@muziehdesign/forms 20.0.0-beta.995 → 20.0.0-next.1035

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Input, Component, forwardRef, Directive, Optional, SkipSelf, ContentChild, HostListener, NgModule } from '@angular/core';
2
+ import { Injectable, LOCALE_ID, Inject, Input, Component, forwardRef, Directive, Optional, SkipSelf, ContentChild, HostListener, NgModule } from '@angular/core';
3
3
  import * as Yup from 'yup';
4
4
  import { object } from 'yup';
5
5
  import 'reflect-metadata';
@@ -11,9 +11,10 @@ import { CommonModule } from '@angular/common';
11
11
  class ModelSchema {
12
12
  // TODO: need to keep track of internal and external
13
13
  //private definitions?: {[K in keyof T]: FieldSchema<any>};
14
- constructor(metadata, schema) {
14
+ constructor(metadata, schema, name) {
15
15
  this.metadata = metadata;
16
16
  this.schema = schema;
17
+ this.name = name;
17
18
  }
18
19
  getMetadata(paths) {
19
20
  //console.log('fetching metadata for path: ', paths);
@@ -109,9 +110,9 @@ class ModelSchemaFactory {
109
110
  constructor() { }
110
111
  build(model) {
111
112
  const metadata = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, model);
112
- const schemaData = [...metadata.values()];
113
+ const schemaData = [...metadata.schemas.values()];
113
114
  const schema = this.buildYupSchema(schemaData);
114
- return new ModelSchema(schemaData, schema);
115
+ return new ModelSchema(schemaData, schema, metadata.name);
115
116
  }
116
117
  buildUntyped(raw) {
117
118
  const schema = this.buildYupSchema(raw);
@@ -194,6 +195,12 @@ class ModelSchemaFactory {
194
195
  if (original.label) {
195
196
  schema.label(original.label);
196
197
  }
198
+ schema = schema.transform(function (value, originalValue) {
199
+ if (originalValue === '') {
200
+ return undefined;
201
+ }
202
+ return value;
203
+ });
197
204
  const options = original.constraints;
198
205
  if (options.required) {
199
206
  schema = schema.required(options.required.message);
@@ -205,12 +212,17 @@ class ModelSchemaFactory {
205
212
  schema = schema.max(options.max.max, options.max.message);
206
213
  }
207
214
  if (options.test) {
208
- schema = schema.test({
209
- name: options.test.name,
210
- message: options.test.message,
211
- test: (d, context) => {
212
- return options.test.test(d);
213
- },
215
+ schema = schema.test(options.test.name, function (v, context) {
216
+ if (v && options.test?.test(v) !== true) {
217
+ return context.createError({
218
+ message: options.test?.message,
219
+ path: context.path,
220
+ params: {
221
+ key: options.test?.name
222
+ }
223
+ });
224
+ }
225
+ return true;
214
226
  });
215
227
  }
216
228
  return schema;
@@ -248,7 +260,7 @@ class ModelSchemaFactory {
248
260
  }
249
261
  buildNestedObjectSchema(original) {
250
262
  const metadata = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, original.constraints.getInstance());
251
- let nestedSchema = this.buildYupSchema([...metadata.values()]);
263
+ let nestedSchema = this.buildYupSchema([...metadata.schemas.values()]);
252
264
  if (original.label) {
253
265
  nestedSchema.label(original.label);
254
266
  }
@@ -283,9 +295,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
283
295
  }], ctorParameters: () => [] });
284
296
 
285
297
  const METADATA_KEY = 'custom:muziehdesign:annotations';
286
- const registerMetadata = (target, propertyKey, schema) => {
287
- const metadata = Reflect.getMetadata(METADATA_KEY, target) || new Map();
288
- metadata.set(propertyKey, schema);
298
+ const registerPropertyMetadata = (target, propertyKey, schema) => {
299
+ const metadata = Reflect.getMetadata(METADATA_KEY, target) || { schemas: new Map() };
300
+ metadata.schemas.set(propertyKey, schema);
301
+ Reflect.defineMetadata(METADATA_KEY, metadata, target);
302
+ };
303
+ const registerMetadata = (target, name) => {
304
+ const metadata = Reflect.getMetadata(METADATA_KEY, target) || { schemas: new Map() };
305
+ metadata.name = name;
289
306
  Reflect.defineMetadata(METADATA_KEY, metadata, target);
290
307
  };
291
308
  function StringType(...annotations) {
@@ -293,9 +310,9 @@ function StringType(...annotations) {
293
310
  const schema = {
294
311
  name: propertyKey,
295
312
  type: FieldSchemaType.string,
296
- constraints: Object.assign({}, ...annotations)
313
+ constraints: Object.assign({}, ...annotations),
297
314
  };
298
- registerMetadata(target, propertyKey, schema);
315
+ registerPropertyMetadata(target, propertyKey, schema);
299
316
  };
300
317
  }
301
318
  function BooleanType(...annotations) {
@@ -303,9 +320,9 @@ function BooleanType(...annotations) {
303
320
  const schema = {
304
321
  name: propertyKey,
305
322
  type: FieldSchemaType.boolean,
306
- constraints: Object.assign({}, ...annotations)
323
+ constraints: Object.assign({}, ...annotations),
307
324
  };
308
- registerMetadata(target, propertyKey, schema);
325
+ registerPropertyMetadata(target, propertyKey, schema);
309
326
  };
310
327
  }
311
328
  function DateType(...annotations) {
@@ -313,9 +330,9 @@ function DateType(...annotations) {
313
330
  const schema = {
314
331
  name: propertyKey,
315
332
  type: FieldSchemaType.date,
316
- constraints: Object.assign({}, ...annotations)
333
+ constraints: Object.assign({}, ...annotations),
317
334
  };
318
- registerMetadata(target, propertyKey, schema);
335
+ registerPropertyMetadata(target, propertyKey, schema);
319
336
  };
320
337
  }
321
338
  function NumberType(...annotations) {
@@ -323,9 +340,9 @@ function NumberType(...annotations) {
323
340
  const schema = {
324
341
  name: propertyKey,
325
342
  type: FieldSchemaType.number,
326
- constraints: Object.assign({}, ...annotations)
343
+ constraints: Object.assign({}, ...annotations),
327
344
  };
328
- registerMetadata(target, propertyKey, schema);
345
+ registerPropertyMetadata(target, propertyKey, schema);
329
346
  };
330
347
  }
331
348
  function ObjectType(type, ...annotations) {
@@ -333,9 +350,9 @@ function ObjectType(type, ...annotations) {
333
350
  const schema = {
334
351
  name: propertyKey,
335
352
  type: FieldSchemaType.object,
336
- constraints: Object.assign({}, ...annotations, { getInstance: () => new type() })
353
+ constraints: Object.assign({}, ...annotations, { getInstance: () => new type() }),
337
354
  };
338
- registerMetadata(target, propertyKey, schema);
355
+ registerPropertyMetadata(target, propertyKey, schema);
339
356
  };
340
357
  }
341
358
  function ArrayType(...annotations) {
@@ -343,9 +360,9 @@ function ArrayType(...annotations) {
343
360
  const schema = {
344
361
  name: propertyKey,
345
362
  type: FieldSchemaType.array,
346
- constraints: Object.assign({}, ...annotations)
363
+ constraints: Object.assign({}, ...annotations),
347
364
  };
348
- registerMetadata(target, propertyKey, schema);
365
+ registerPropertyMetadata(target, propertyKey, schema);
349
366
  };
350
367
  }
351
368
  function FileType(...annotations) {
@@ -353,9 +370,17 @@ function FileType(...annotations) {
353
370
  const schema = {
354
371
  name: propertyKey,
355
372
  type: FieldSchemaType.file,
356
- constraints: Object.assign({}, ...annotations)
373
+ constraints: Object.assign({}, ...annotations),
357
374
  };
358
- registerMetadata(target, propertyKey, schema);
375
+ registerPropertyMetadata(target, propertyKey, schema);
376
+ };
377
+ }
378
+ function Model(name) {
379
+ return function (constructor) {
380
+ // Class decorators receive the constructor, but property decorators write to constructor.prototype
381
+ // So we need to write to constructor.prototype to share the same metadata object
382
+ registerMetadata(constructor.prototype, name);
383
+ return constructor;
359
384
  };
360
385
  }
361
386
  function required(message) {
@@ -510,17 +535,101 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
510
535
  }]
511
536
  }], ctorParameters: () => [{ type: ModelSchemaFactory }] });
512
537
 
538
+ class FormMessageService {
539
+ constructor(localeId) {
540
+ this.localeId = localeId;
541
+ this.localeData = {};
542
+ }
543
+ getMessage(messageProps, namespace) {
544
+ if (typeof messageProps === 'string') {
545
+ return messageProps;
546
+ }
547
+ try {
548
+ const parts = messageProps.key.split('.');
549
+ // get namespaced message
550
+ if (namespace && namespace.length > 0 && messageProps.path && messageProps.path.length > 0) {
551
+ const namespaced = this.getLocaleData([namespace, messageProps.path, ...parts]);
552
+ if (namespaced !== undefined) {
553
+ return namespaced;
554
+ }
555
+ }
556
+ // get global message
557
+ const message = this.getLocaleData(parts);
558
+ if (!message) {
559
+ return messageProps.key;
560
+ }
561
+ return this.formatMessage(message, messageProps);
562
+ }
563
+ catch {
564
+ return messageProps.key;
565
+ }
566
+ }
567
+ formatMessage(message, params) {
568
+ let formatted = message;
569
+ // Format min parameter
570
+ if (params.min !== undefined) {
571
+ const formattedMin = params.min instanceof Date
572
+ ? params.min.toLocaleDateString(this.localeId)
573
+ : params.min.toString();
574
+ formatted = formatted.replace('{min}', formattedMin);
575
+ }
576
+ // Format max parameter
577
+ if (params.max !== undefined) {
578
+ const formattedMax = params.max instanceof Date
579
+ ? params.max.toLocaleDateString(this.localeId)
580
+ : params.max.toString();
581
+ formatted = formatted.replace('{max}', formattedMax);
582
+ }
583
+ // Format less parameter
584
+ if (params.less !== undefined) {
585
+ formatted = formatted.replace('{less}', params.less.toString());
586
+ }
587
+ // Format more parameter
588
+ if (params.more !== undefined) {
589
+ formatted = formatted.replace('{more}', params.more.toString());
590
+ }
591
+ // Format length parameter
592
+ if (params.length !== undefined) {
593
+ formatted = formatted.replace('{length}', params.length.toString());
594
+ }
595
+ return formatted;
596
+ }
597
+ registerLocaleMessages(data, localeId) {
598
+ this.localeData[localeId] = data;
599
+ }
600
+ getLocaleData(keyParts) {
601
+ const messages = this.localeData[this.localeId] || this.localeData['en'];
602
+ return keyParts.reduce((obj, part) => {
603
+ if (obj?.[part] === undefined) {
604
+ return undefined;
605
+ }
606
+ return obj[part];
607
+ }, messages);
608
+ }
609
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FormMessageService, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
610
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FormMessageService, providedIn: 'root' }); }
611
+ }
612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FormMessageService, decorators: [{
613
+ type: Injectable,
614
+ args: [{
615
+ providedIn: 'root',
616
+ }]
617
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
618
+ type: Inject,
619
+ args: [LOCALE_ID]
620
+ }] }] });
621
+
513
622
  class FieldErrorsComponent {
514
623
  get errorMessage() {
515
624
  const errorKeys = Object.keys(this.field?.errors || {});
516
625
  return errorKeys.length > 0 ? (this.field?.errors)[errorKeys[0]] : '';
517
626
  }
518
627
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FieldErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
519
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: FieldErrorsComponent, isStandalone: false, selector: "mz-field-errors", inputs: { field: "field" }, ngImport: i0, template: "@if (errorMessage) {\n <div class=\"field-error\">{{ errorMessage }}</div>\n}\n", styles: [""] }); }
628
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: FieldErrorsComponent, isStandalone: false, selector: "mz-field-errors", inputs: { field: "field" }, ngImport: i0, template: "@if (errorMessage) {\n <div class=\"field-error\">{{ errorMessage }}</div>\n test test\n}\n", styles: [""] }); }
520
629
  }
521
630
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: FieldErrorsComponent, decorators: [{
522
631
  type: Component,
523
- args: [{ selector: 'mz-field-errors', standalone: false, template: "@if (errorMessage) {\n <div class=\"field-error\">{{ errorMessage }}</div>\n}\n" }]
632
+ args: [{ selector: 'mz-field-errors', standalone: false, template: "@if (errorMessage) {\n <div class=\"field-error\">{{ errorMessage }}</div>\n test test\n}\n" }]
524
633
  }], propDecorators: { field: [{
525
634
  type: Input
526
635
  }] } });
@@ -707,34 +816,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
707
816
  }] } });
708
817
 
709
818
  function getControlContainer(group, form) {
710
- console.log('getControlContainer', group, form);
711
819
  return group ?? form;
712
820
  }
713
821
  class MzField {
714
- constructor(elementRef) {
715
- this.elementRef = elementRef;
822
+ constructor(message, form) {
823
+ this.message = message;
824
+ this.form = form;
716
825
  this.controlType = 'other';
717
826
  }
718
- ngAfterContentInit() {
719
- //this.fieldMetadata = this.form.schema.getMetadata(this.ngModel?.path || []);
720
- }
721
827
  getErrorMessage() {
722
828
  try {
723
829
  const list = Object.values(this.ngModel.errors);
724
- return list[0];
830
+ return this.message.getMessage(list[0], this.form?.schema.name);
725
831
  }
726
832
  catch {
727
833
  return undefined;
728
834
  }
729
835
  }
730
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MzField, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
731
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: MzField, isStandalone: true, selector: "mz-field", inputs: { label: "label", controlType: "controlType", schema: "schema" }, providers: [
836
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MzField, deps: [{ token: FormMessageService }, { token: MzForm, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
837
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: MzField, isStandalone: true, selector: "mz-field", inputs: { label: "label", controlType: "controlType" }, providers: [
732
838
  {
733
839
  provide: ControlContainer,
734
840
  useFactory: getControlContainer,
735
- deps: [[new Optional(), new SkipSelf(), NgModelGroup], [new Optional(), new SkipSelf(), NgForm]]
736
- }
737
- ], queries: [{ propertyName: "ngModel", first: true, predicate: NgModel, descendants: true }], ngImport: i0, template: "<label class=\"field\">\n @if(label && controlType !== 'checkbox') {\n <span class=\"field-label\">\n {{ label }} \n </span>\n }\n <ng-content></ng-content>\n\n @if(controlType === 'checkbox' && label) {\n <span class=\"checkbox-label\">{{ label }}</span>\n } \n @if(ngModel?.touched && ngModel?.invalid) {\n <div class=\"field-error\">\n {{ getErrorMessage() }}\n </div>\n }\n</label>\n" }); }
841
+ deps: [
842
+ [new Optional(), new SkipSelf(), NgModelGroup],
843
+ [new Optional(), new SkipSelf(), NgForm],
844
+ ],
845
+ },
846
+ ], queries: [{ propertyName: "ngModel", first: true, predicate: NgModel, descendants: true }], ngImport: i0, template: "<label class=\"field\">\n @if(label && controlType !== 'checkbox') {\n <span class=\"field-label\">\n {{ label }}\n </span>\n }\n <ng-content></ng-content>\n\n @if(controlType === 'checkbox' && label) {\n <span class=\"checkbox-label\">{{ label }}</span>\n }\n @if(ngModel?.touched && ngModel?.invalid) {\n <div class=\"field-error\">\n {{ getErrorMessage() }}\n </div>\n }\n</label>\n" }); }
738
847
  }
739
848
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: MzField, decorators: [{
740
849
  type: Component,
@@ -742,15 +851,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
742
851
  {
743
852
  provide: ControlContainer,
744
853
  useFactory: getControlContainer,
745
- deps: [[new Optional(), new SkipSelf(), NgModelGroup], [new Optional(), new SkipSelf(), NgForm]]
746
- }
747
- ], template: "<label class=\"field\">\n @if(label && controlType !== 'checkbox') {\n <span class=\"field-label\">\n {{ label }} \n </span>\n }\n <ng-content></ng-content>\n\n @if(controlType === 'checkbox' && label) {\n <span class=\"checkbox-label\">{{ label }}</span>\n } \n @if(ngModel?.touched && ngModel?.invalid) {\n <div class=\"field-error\">\n {{ getErrorMessage() }}\n </div>\n }\n</label>\n" }]
748
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { label: [{
854
+ deps: [
855
+ [new Optional(), new SkipSelf(), NgModelGroup],
856
+ [new Optional(), new SkipSelf(), NgForm],
857
+ ],
858
+ },
859
+ ], template: "<label class=\"field\">\n @if(label && controlType !== 'checkbox') {\n <span class=\"field-label\">\n {{ label }}\n </span>\n }\n <ng-content></ng-content>\n\n @if(controlType === 'checkbox' && label) {\n <span class=\"checkbox-label\">{{ label }}</span>\n }\n @if(ngModel?.touched && ngModel?.invalid) {\n <div class=\"field-error\">\n {{ getErrorMessage() }}\n </div>\n }\n</label>\n" }]
860
+ }], ctorParameters: () => [{ type: FormMessageService }, { type: MzForm, decorators: [{
861
+ type: Optional
862
+ }] }], propDecorators: { label: [{
749
863
  type: Input
750
864
  }], controlType: [{
751
865
  type: Input
752
- }], schema: [{
753
- type: Input
754
866
  }], ngModel: [{
755
867
  type: ContentChild,
756
868
  args: [NgModel]
@@ -842,6 +954,65 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
842
954
  }]
843
955
  }] });
844
956
 
957
+ const YUP_DEFAULT_LOCALES = {
958
+ mixed: {
959
+ required: 'Required',
960
+ notType: 'Invalid value',
961
+ },
962
+ };
963
+ function getMessage(message, key) {
964
+ if (typeof message === 'string') {
965
+ return { key: message };
966
+ }
967
+ return { ...message, key: message.key ?? key };
968
+ }
969
+ const YUP_LOCALE_KEYS = {
970
+ mixed: {
971
+ required: (params) => getMessage(params, 'mixed.required'),
972
+ notType: (params) => getMessage(params, 'mixed.notType'),
973
+ oneOf: (params) => getMessage(params, 'mixed.oneOf'),
974
+ notOneOf: (params) => getMessage(params, 'mixed.notOneOf'),
975
+ default: (params) => getMessage(params, 'mixed.default'),
976
+ defined: (params) => getMessage(params, 'mixed.defined'),
977
+ },
978
+ string: {
979
+ min: (params) => getMessage(params, 'string.min'),
980
+ max: (params) => getMessage(params, 'string.max'),
981
+ length: (params) => getMessage(params, 'string.length'),
982
+ matches: (params) => getMessage(params, 'string.matches'),
983
+ email: (params) => getMessage(params, 'string.email'),
984
+ url: (params) => getMessage(params, 'string.url'),
985
+ uuid: (params) => getMessage(params, 'string.uuid'),
986
+ trim: (params) => getMessage(params, 'string.trim'),
987
+ lowercase: (params) => getMessage(params, 'string.lowercase'),
988
+ uppercase: (params) => getMessage(params, 'string.uppercase'),
989
+ },
990
+ number: {
991
+ min: (params) => getMessage(params, 'number.min'),
992
+ max: (params) => getMessage(params, 'number.max'),
993
+ lessThan: (params) => getMessage(params, 'number.lessThan'),
994
+ moreThan: (params) => getMessage(params, 'number.moreThan'),
995
+ positive: (params) => getMessage(params, 'number.positive'),
996
+ negative: (params) => getMessage(params, 'number.negative'),
997
+ integer: (params) => getMessage(params, 'number.integer'),
998
+ },
999
+ date: {
1000
+ min: (params) => getMessage(params, 'date.min'),
1001
+ max: (params) => getMessage(params, 'date.max')
1002
+ },
1003
+ object: {
1004
+ noUnknown: (params) => getMessage(params, 'object.noUnknown'),
1005
+ },
1006
+ array: {
1007
+ min: (params) => getMessage(params, 'array.min'),
1008
+ max: (params) => getMessage(params, 'array.max'),
1009
+ length: (params) => getMessage(params, 'array.length'),
1010
+ },
1011
+ boolean: {
1012
+ isValue: (params) => getMessage(params, 'boolean.isValue'),
1013
+ }
1014
+ };
1015
+
845
1016
  /*
846
1017
  * Public API Surface of forms
847
1018
  */
@@ -850,5 +1021,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
850
1021
  * Generated bundle index. Do not edit.
851
1022
  */
852
1023
 
853
- export { ArrayType, BooleanType, DateType, DateValueAccessor, FieldErrorsComponent, FieldSchemaType, FileType, FormsModule, ModelSchema, ModelSchemaFactory, MzCheckboxGroup, MzField, MzForm, MzFormsModule, NgFormModelState, NgFormModelStateFactory, NumberType, ObjectType, StringType, buildArraySchema, buildBooleanSchema, buildDateSchema, buildNumberSchema, buildStringSchema, currencyOptions, equals, integerOptions, length, max, maxLength, min, minLength, ofValues, pattern, phoneNumberOptions, required, ssnOptions, test };
1024
+ export { ArrayType, BooleanType, DateType, DateValueAccessor, FieldErrorsComponent, FieldSchemaType, FileType, FormMessageService, FormsModule, Model, ModelSchema, ModelSchemaFactory, MzCheckboxGroup, MzField, MzForm, MzFormsModule, NgFormModelState, NgFormModelStateFactory, NumberType, ObjectType, StringType, YUP_DEFAULT_LOCALES, YUP_LOCALE_KEYS, buildArraySchema, buildBooleanSchema, buildDateSchema, buildNumberSchema, buildStringSchema, currencyOptions, equals, getMessage, integerOptions, length, max, maxLength, min, minLength, ofValues, pattern, phoneNumberOptions, required, ssnOptions, test };
854
1025
  //# sourceMappingURL=muziehdesign-forms.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"muziehdesign-forms.mjs","sources":["../../../../projects/muziehdesign/forms/src/lib/model-schema.ts","../../../../projects/muziehdesign/forms/src/lib/constants.ts","../../../../projects/muziehdesign/forms/src/lib/field-schema.ts","../../../../projects/muziehdesign/forms/src/lib/model-schema.factory.ts","../../../../projects/muziehdesign/forms/src/lib/type-annotations.ts","../../../../projects/muziehdesign/forms/src/lib/ngform-model-state.ts","../../../../projects/muziehdesign/forms/src/lib/ng-form-model-state.service.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.html","../../../../projects/muziehdesign/forms/src/lib/masks.ts","../../../../projects/muziehdesign/forms/src/lib/date-value-accessor.directive.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.html","../../../../projects/muziehdesign/forms/src/lib/field/field.component.ts","../../../../projects/muziehdesign/forms/src/lib/field/field.component.html","../../../../projects/muziehdesign/forms/src/lib/form/form.directive.ts","../../../../projects/muziehdesign/forms/src/lib/forms.module.ts","../../../../projects/muziehdesign/forms/src/public-api.ts","../../../../projects/muziehdesign/forms/src/muziehdesign-forms.ts"],"sourcesContent":["import { AnyObjectSchema, SchemaOf, ValidationError } from 'yup';\nimport { FieldError } from './field-error';\nimport { FieldSchema } from './field-schema';\nexport class ModelSchema<T> {\n // TODO: need to keep track of internal and external\n //private definitions?: {[K in keyof T]: FieldSchema<any>};\n constructor(private metadata: FieldSchema<any>[], private schema: AnyObjectSchema) {\n\n }\n \n getMetadata(paths: string[]) {\n //console.log('fetching metadata for path: ', paths);\n //console.log(this.schema.describe());\n for(var i = 0; i < paths.length; i++) {\n const field = this.metadata.find(f=>f.name === paths[i]);\n if(!field?.constraints.required || field.constraints.required.required === false) {\n return { required: false } satisfies FieldMetadata;\n }\n }\n return { required: true } satisfies FieldMetadata;\n\n }\n\n validate<T>(model: T): Promise<FieldError[]> {\n return this.schema\n .validate(model, { abortEarly: false })\n .then(() => {\n return [];\n })\n .catch((e: ValidationError) => {\n return e.inner.map((error) => <FieldError>{ path: error.path, type: error.type, message: error.message });\n });\n }\n\n cast(value: any) {\n return this.schema.cast(value);\n }\n}\n\nexport type SchemaDefinition<T> = {\n //[K in keyof Required<T>]: T[K] extends object ? SchemaDefinition<T[K]>: FieldSchema<any>;\n [K in keyof Required<T>]: FieldSchema<any>\n}\n\nexport interface FieldMetadata {\n required: boolean;\n}","export const SCHEMA_METADATA_NAMESPACE = 'custom:muziehdesign:annotations';\n","import { ArrayTypeAnnotations, BooleanTypeAnnotations, ConstraintAnnotations, DateTypeAnnotations, FileTypeAnnotations, NumberTypeAnnotations, ObjectTypeAnnotations, StringTypeAnnotations } from './type-annotations';\n\nexport enum FieldSchemaType {\n string = 'string',\n boolean = 'boolean',\n date = 'date',\n object = 'object',\n number = 'number',\n array = 'array',\n file = 'file',\n}\n\nexport interface FieldSchema<T extends ConstraintAnnotations> {\n name: string;\n type: FieldSchemaType;\n label?: string;\n constraints: T;\n}\n\nexport interface StringSchema extends FieldSchema<StringTypeAnnotations> {\n type: FieldSchemaType.string;\n}\n\nexport interface NumberSchema extends FieldSchema<NumberTypeAnnotations> {\n type: FieldSchemaType.number;\n}\n\nexport interface BooleanSchema extends FieldSchema<BooleanTypeAnnotations> {\n type: FieldSchemaType.boolean;\n}\n\nexport interface DateSchema extends FieldSchema<DateTypeAnnotations> {\n type: FieldSchemaType.date;\n}\n\nexport interface ArraySchema extends FieldSchema<ArrayTypeAnnotations> {\n type: FieldSchemaType.array;\n}\n\nexport interface FileSchema extends FieldSchema<FileTypeAnnotations> {\n type: FieldSchemaType.file;\n}\n\nexport interface ObjectSchema extends FieldSchema<ObjectTypeAnnotations> {\n type: FieldSchemaType.object;\n}\n\nexport const buildStringSchema = (path: string, constraints: StringTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.string,\n constraints: { ...constraints },\n } satisfies StringSchema;\n};\n\nexport const buildBooleanSchema = (path: string, constraints: BooleanTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.boolean,\n constraints: { ...constraints },\n } satisfies BooleanSchema;\n};\n\nexport const buildNumberSchema = (path: string, constraints: NumberTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.number,\n constraints: { ...constraints },\n } satisfies NumberSchema;\n};\n\nexport const buildDateSchema = (path: string, constraints: DateTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.date,\n constraints: { ...constraints },\n } satisfies DateSchema;\n};\n\nexport const buildArraySchema = (path: string, constraints: ArrayTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.array,\n constraints: { ...constraints },\n } satisfies ArraySchema;\n};\n","import { Injectable } from '@angular/core';\nimport { object, SchemaOf } from 'yup';\nimport { ModelSchema } from './model-schema';\nimport { SCHEMA_METADATA_NAMESPACE } from './constants';\nimport { ObjectShape } from 'yup/lib/object';\nimport * as Yup from 'yup';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\n/*\nSchema rules need to be built in the order they need to be evaluated in.\nFor example,\n ```\n schema.required().max(...).matches(...);\n ```\nevaluates the 3 rules in this order\n - required\n - max\n - matches\n*/\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModelSchemaFactory {\n constructor() {}\n\n build<T extends object>(model: T): ModelSchema<T> {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, model);\n const schemaData = [...metadata.values()];\n const schema = this.buildYupSchema(schemaData);\n return new ModelSchema(schemaData, schema);\n }\n\n buildUntyped(raw: FieldSchema<any>[]) : ModelSchema<{[key: string]: string}> {\n const schema = this.buildYupSchema(raw);\n return new ModelSchema(raw, schema);\n }\n\n private buildYupSchema(fields: FieldSchema<any>[]) : Yup.AnyObjectSchema {\n let shape: ObjectShape = {};\n fields.forEach((value) => {\n if (value.type == FieldSchemaType.string) {\n shape[value.name] = this.buildStringSchema(value as StringSchema);\n } else if (value.type == FieldSchemaType.boolean) {\n shape[value.name] = this.buildBooleanSchema(value as BooleanSchema);\n } else if (value.type == FieldSchemaType.date) {\n shape[value.name] = this.buildDateSchema(value as DateSchema);\n } else if (value.type == FieldSchemaType.object) {\n shape[value.name] = this.buildNestedObjectSchema(value as ObjectSchema);\n } else if (value.type == FieldSchemaType.number) {\n shape[value.name] = this.buildNumberSchema(value as NumberSchema);\n } else if (value.type == FieldSchemaType.array) {\n shape[value.name] = this.buildArraySchema(value as ArraySchema);\n } else if (value.type == FieldSchemaType.file) {\n shape[value.name] = this.buildFileSchema(value as FileSchema);\n } else {\n throw new Error('Unrecognized field schema');\n }\n });\n\n return object(shape);\n }\n\n private buildStringSchema(original: StringSchema) {\n let schema = Yup.string();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.length) {\n schema = schema.length(options.length.length, options.length.message);\n }\n\n if (options.maxLength) {\n schema = schema.max(options.maxLength.maxLength, options.maxLength.message);\n }\n\n if (options.minLength) {\n schema = schema.min(options.minLength.minLength, options.minLength.message);\n }\n\n if (options.pattern) {\n schema = schema.matches(options.pattern.pattern, { message: options.pattern.message, excludeEmptyString: true });\n }\n\n return schema;\n }\n\n private buildBooleanSchema(original: BooleanSchema) {\n let schema = Yup.boolean();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.equals) {\n if (options.equals.equals) {\n schema = schema.isTrue(options.equals.message);\n } else {\n schema = schema.isFalse(options.equals.message);\n }\n }\n\n return schema;\n }\n\n private buildDateSchema(original: DateSchema) {\n let schema = Yup.date();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n if (options.test) {\n schema = schema.test({\n name: options.test.name,\n message: options.test.message,\n test: (d?: Date, context?: any) => {\n return options.test!.test(d!);\n },\n });\n }\n\n return schema;\n }\n\n private buildNumberSchema(original: NumberSchema) {\n let schema = Yup.number();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildArraySchema(original: ArraySchema) {\n let schema = Yup.array();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildNestedObjectSchema(original: ObjectSchema) {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, original.constraints.getInstance());\n\n let nestedSchema = this.buildYupSchema([...metadata.values()]);\n if(original.label) {\n nestedSchema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n nestedSchema = nestedSchema.required();\n } else {\n nestedSchema = nestedSchema.notRequired().default(undefined);\n }\n\n return nestedSchema;\n }\n\n private buildFileSchema(original: FileSchema) {\n let schema = Yup.mixed().nullable().optional();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints; \n if (options.required) {\n schema = schema.required(options.required.message);\n }\n\n return schema;\n }\n}\n","import 'reflect-metadata';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\nconst METADATA_KEY = 'custom:muziehdesign:annotations';\n\nexport interface ConstraintAnnotations {\n\n}\n\nexport interface StringTypeConstraints {\n required?: true;\n requiredMessage?: string;\n\n pattern?: RegExp;\n patternMessage?: string;\n\n length?: number;\n lengthMessage?: string;\n}\n\nexport interface StringTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n length?: LengthAnnotation;\n pattern?: PatternAnnotation;\n maxLength?: MaxLengthAnnotation;\n minLength?: MinLengthAnnotation;\n}\n\nexport interface BooleanTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n equals?: EqualsAnnotation<boolean>;\n}\n\nexport interface DateTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<Date>;\n max?: MaximumAnnotation<Date>;\n test?: TestAnnotation<Date>;\n}\n\nexport interface ObjectTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n getInstance: () => any;\n}\n\nexport interface NumberTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface ArrayTypeAnnotations extends ConstraintAnnotations {\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface FileTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n}\n\nexport interface ValidationAnnotation {\n message?: string;\n}\n\nexport interface RequiredAnnotation extends ValidationAnnotation {\n required: boolean;\n}\n\nexport interface LengthAnnotation extends ValidationAnnotation {\n length: number;\n}\n\nexport interface PatternAnnotation extends ValidationAnnotation {\n pattern: RegExp;\n}\n\nexport interface OfValuesAnnotation extends ValidationAnnotation {\n values: [];\n}\n\nexport interface EqualsAnnotation<T> extends ValidationAnnotation {\n equals: T;\n}\n\nexport interface MinimumAnnotation<T> extends ValidationAnnotation {\n min: T;\n}\n\nexport interface MaximumAnnotation<T> extends ValidationAnnotation {\n max: T;\n}\n\nexport interface TestAnnotation<T> extends ValidationAnnotation {\n test: (d: T) => boolean;\n name: string;\n}\n\nexport interface MaxLengthAnnotation extends ValidationAnnotation {\n maxLength: number;\n}\n\nexport interface MinLengthAnnotation extends ValidationAnnotation {\n minLength: number;\n}\n\nconst registerMetadata = (target: Object, propertyKey: string, schema: FieldSchema<any>) => {\n const metadata: Map<string, FieldSchema<any>> = Reflect.getMetadata(METADATA_KEY, target) || new Map<string, FieldSchema<any>>();\n metadata.set(propertyKey, schema);\n Reflect.defineMetadata(METADATA_KEY, metadata, target);\n};\n\nexport function StringType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.string,\n constraints: Object.assign({}, ...annotations) as StringTypeAnnotations\n } satisfies StringSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function BooleanType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.boolean,\n constraints: Object.assign({}, ...annotations) as BooleanTypeAnnotations\n } satisfies BooleanSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function DateType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.date,\n constraints: Object.assign({}, ...annotations) as DateTypeAnnotations\n } satisfies DateSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function NumberType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.number,\n constraints: Object.assign({}, ...annotations) as NumberTypeAnnotations\n } satisfies NumberSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ObjectType<T>(type: { new (): T }, ...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.object,\n constraints: Object.assign({}, ...annotations, { getInstance: () => new type() } as Partial<ObjectTypeAnnotations>) as ObjectTypeAnnotations\n } satisfies ObjectSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ArrayType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.array,\n constraints: Object.assign({}, ...annotations) as ArrayTypeAnnotations\n } satisfies ArraySchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function FileType<T>(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.file,\n constraints: Object.assign({}, ...annotations) as FileTypeAnnotations\n } satisfies FileSchema;\n\n registerMetadata(target, propertyKey, schema);\n };\n}\n\nexport function required(message?: string): { [key: string]: RequiredAnnotation } {\n return { required: { required: true, message: message } };\n}\n\nexport function pattern(regex: RegExp, message?: string): { [key: string]: PatternAnnotation } {\n return { pattern: { pattern: regex, message: message } };\n}\n\nexport function length(length: number, message?: string): { [key: string]: LengthAnnotation } {\n return { length: { length: length, message: message } };\n}\n\nexport function maxLength(maxLength: number, message?: string): { [key: string]: MaxLengthAnnotation } {\n return { maxLength: { maxLength: maxLength, message: message } };\n}\n\nexport function minLength(minLength: number, message?: string): { [key: string]: MinLengthAnnotation } {\n return { minLength: { minLength: minLength, message: message } };\n}\n\nexport function ofValues(values: [], message?: string): { [key: string]: OfValuesAnnotation } {\n return { ofValues: { values: values, message: message } };\n}\n\nexport function equals<T>(value: T, message?: string): { [key: string]: EqualsAnnotation<T> } {\n return { equals: { equals: value, message: message } };\n}\n\nexport function min<T>(value: T, message?: string): { [key: string]: MinimumAnnotation<T> } {\n return { min: { min: value, message: message } };\n}\n\nexport function max<T>(value: T, message?: string): { [key: string]: MaximumAnnotation<T> } {\n return { max: { max: value, message: message } };\n}\n\nexport function test<T>(name: string, test: (d: T) => boolean, message?: string): { [key: string]: TestAnnotation<T> } {\n return { test: { name: name, test: test, message: message } };\n}\n","import { AbstractControl, FormArray, FormGroup, NgForm, ValidationErrors } from '@angular/forms';\nimport { BehaviorSubject, from, switchMap } from 'rxjs';\nimport { FieldError } from './field-error';\nimport { ModelStateOptions } from './model-state-options';\nimport { ModelStateResult } from './model-state-result';\nimport { ModelSchema } from './model-schema';\n\nexport class NgFormModelState<T> {\n private changesSubject = new BehaviorSubject<ModelStateResult<T> | undefined>(undefined);\n public readonly changes = this.changesSubject.asObservable();\n\n constructor(private form: NgForm, private modelValidator: ModelSchema<T>, private options?: ModelStateOptions) {\n this.form.form.valueChanges\n .pipe(\n switchMap(async (x) => {\n return from(this.validate());\n })\n )\n .subscribe();\n }\n\n getCurrent(): ModelStateResult<T> | undefined {\n return this.changesSubject.value;\n }\n\n setState(model: T, errors: FieldError[]) {\n const state = {\n model: model,\n errors: errors,\n valid: errors.length === 0,\n } as ModelStateResult<T>;\n this.setStateInternal(state);\n }\n\n setErrors(errors: FieldError[]) {\n //this.errors.next(errors);\n throw new Error('needs implementation');\n }\n\n appendErrors(errors: FieldError[], skipEmit?: boolean) {\n const allErrors = [...(this.changesSubject.value?.errors || []), ...errors];\n const state = { ...this.changesSubject.value } as ModelStateResult<T>;\n state.errors = allErrors;\n this.setStateInternal(state);\n }\n\n async validate(): Promise<ModelStateResult<T>> {\n const model = this.form.value;\n const state = await this.runValidations(model, this.options?.onValidate);\n this.setStateInternal(state);\n return state;\n }\n\n\n private setStateInternal(state: ModelStateResult<T>) {\n this.deleteFormErrors();\n\n const grouped = state.errors.reduce((grouped, v) => grouped.set(v.path, [...(grouped.get(v.path) || []), v]), new Map<string, FieldError[]>());\n grouped.forEach((value, path) => {\n let validationErrors = <ValidationErrors>{};\n value.forEach((v) => (validationErrors[v.type] = v.message));\n\n const control = this.form.form.get(path);\n if (!control) {\n // TODO: use actual logging service\n } else {\n control.setErrors(validationErrors);\n }\n });\n\n this.changesSubject.next(state);\n }\n\n private deleteFormErrors() {\n this.deleteErrors(this.form.form);\n }\n\n private deleteErrors(rootFormGroup: FormGroup) {\n Object.keys(rootFormGroup.controls).forEach((key) => {\n const control = rootFormGroup.controls[key];\n\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(key, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private deleteErrorsFromControl(key: string | number, control: AbstractControl) {\n control.setErrors(null);\n }\n\n private isParentControl(control: AbstractControl) {\n return control instanceof FormGroup || control instanceof FormArray;\n }\n\n private loopFormArray(formArray: FormArray) {\n formArray.controls.forEach((control, index) => {\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(index, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private async runValidations<T>(model: T, callback?: (list: FieldError[]) => Promise<FieldError[]>): Promise<ModelStateResult<T>> {\n const list = await this.modelValidator.validate(model);\n const final = callback ? (await callback?.(list)) : list;\n return {\n valid: final.length === 0,\n errors: final,\n model: model,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { NgForm } from '@angular/forms';\nimport { ModelSchemaFactory } from './model-schema.factory';\nimport { ModelStateOptions } from './model-state-options';\nimport { NgFormModelState } from './ngform-model-state';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgFormModelStateFactory {\n constructor(private factory: ModelSchemaFactory) {}\n\n create<T extends object>(form: NgForm, model: T, options?: ModelStateOptions) {\n const modelState = new NgFormModelState<T>(form, this.factory.build(model), options);\n return modelState;\n }\n}\n","import { Component, Input, OnInit } from '@angular/core';\nimport { NgControl, ValidationErrors } from '@angular/forms';\n\n@Component({\n selector: 'mz-field-errors',\n templateUrl: './field-errors.component.html',\n styleUrls: ['./field-errors.component.css'],\n standalone: false\n})\nexport class FieldErrorsComponent {\n @Input() field?: NgControl;\n\n get errorMessage(): string {\n const errorKeys = Object.keys(this.field?.errors || {});\n return errorKeys.length > 0 ? (this.field?.errors as ValidationErrors)[errorKeys[0]] : '';\n }\n}\n","@if (errorMessage) {\n <div class=\"field-error\">{{ errorMessage }}</div>\n}\n","import { format, isValid, parse } from 'date-fns';\nimport * as IMask from 'imask';\n\nexport const phoneNumberOptions = {\n mask: '(000) 000-0000',\n};\n\nexport const ssnOptions = {\n mask: '000-00-0000',\n};\n\nexport const currencyOptions = {\n mask: Number,\n scale: 2,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n\nexport const integerOptions = {\n mask: Number,\n scale: 0,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n\n","import { formatDate } from '@angular/common';\nimport { Directive, ElementRef, Renderer2, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Directive({\n selector: '[mzDateInput]',\n standalone: true,\n host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateValueAccessor),\n multi: true,\n },\n ],\n})\nexport class DateValueAccessor implements ControlValueAccessor {\n onChange = (_: any) => {};\n onTouched = () => {};\n\n constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {}\n\n writeValue(obj?: Date): void {\n let normalizedValue = '';\n if (!obj) {\n normalizedValue = '';\n } else if (this._elementRef.nativeElement.type === 'date') {\n normalizedValue = obj.toISOString().split('T')[0];\n } else {\n normalizedValue = obj.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' }); // TODO: support other date formats\n }\n this.setProperty('value', normalizedValue);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = (value) => {\n const parsed = this.parseDate(value);\n fn(parsed);\n };\n }\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n this.setProperty('disabled', isDisabled);\n }\n protected setProperty(key: string, value: any): void {\n this._renderer.setProperty(this._elementRef.nativeElement, key, value);\n }\n\n private parseDate(value: string): Date | undefined {\n const validFormat = this._elementRef.nativeElement.type === 'date' ? /^(\\d{4}-\\d{2}-\\d{2})$/.test(value) : /^(\\d{1,2}\\/\\d{1,2}\\/\\d{4})$/.test(value);\n if (!validFormat) {\n return undefined;\n }\n\n const entry = new Date(value).toISOString().split('T')[0];\n\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = entry.split('-').map((val: string) => +val);\n return this.createDate(y, m - 1, d);\n }\n\n private createDate(year: number, month: number, date: number): Date {\n // The `newDate` is set to midnight (UTC) on January 1st 1970.\n // - In PST this will be December 31st 1969 at 4pm.\n // - In GMT this will be January 1st 1970 at 1am.\n // Note that they even have different years, dates and months!\n const newDate = new Date(0);\n\n // `setFullYear()` allows years like 0001 to be set correctly. This function does not\n // change the internal time of the date.\n // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).\n // - In PST this will now be September 20, 2019 at 4pm\n // - In GMT this will now be September 20, 2019 at 1am\n\n newDate.setFullYear(year, month, date);\n // We want the final date to be at local midnight, so we reset the time.\n // - In PST this will now be September 20, 2019 at 12am\n // - In GMT this will now be September 20, 2019 at 12am\n newDate.setHours(0, 0, 0);\n\n return newDate;\n }\n}\n","import { Component, Input, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport type FieldOption = {\n label: string;\n value: any;\n};\n\n@Component({\n selector: 'mz-checkbox-group',\n imports: [FormsModule],\n templateUrl: './checkbox-group.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MzCheckboxGroup),\n multi: true,\n },\n ]\n})\nexport class MzCheckboxGroup implements ControlValueAccessor {\n @Input({ required: true }) options!: FieldOption[];\n @Input({ required: false }) disabled = false;\n\n selections: any[] = [];\n\n onChange: (value: string[]) => void = () => {};\n onTouched: () => void = () => {};\n\n // Writes the selected values from the form model\n writeValue(values: any[]): void {\n this.selections = values || [];\n }\n\n // Registers the onChange function to propagate changes\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n // Registers the onTouched function\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n // Checks if a checkbox is selected\n isChecked(option: FieldOption): boolean {\n return this.selections.includes(option.value);\n }\n\n // Handles changes when checkboxes are clicked\n onCheckboxChange(event: Event, option: FieldOption): void {\n const checked = (event.target as HTMLInputElement).checked;\n\n if (checked) {\n this.selections = [...this.selections, option.value];\n } else {\n this.selections = this.selections.filter((val) => val !== option.value);\n }\n\n this.onChange(this.selections);\n this.onTouched();\n }\n}\n","@for(option of options; track $index) {\n <label class=\"field-option\">\n <input type=\"checkbox\" class=\"form-checkbox\" [disabled]=\"disabled\" [value]=\"option.value\" [checked]=\"isChecked(option)\" (change)=\"onCheckboxChange($event, option)\" />\n <span class=\"checkbox-label\">{{option.label}}</span>\n </label>\n}\n","import { AfterContentInit, Component, ContentChild, ElementRef, Input, Optional, SkipSelf } from '@angular/core';\nimport { ControlContainer, NgForm, NgModel, NgModelGroup } from '@angular/forms';\nimport { FieldSchema } from '../field-schema';\nimport { FieldMetadata } from '../model-schema';\n\nfunction getControlContainer(\n group: NgModelGroup | null,\n form: NgForm | null\n ): ControlContainer {\n console.log('getControlContainer', group, form);\n return group ?? form!;\n }\n\n@Component({\n selector: 'mz-field',\n imports: [],\n templateUrl: './field.component.html',\n providers: [\n {\n provide: ControlContainer,\n useFactory: getControlContainer,\n deps: [[new Optional(), new SkipSelf(), NgModelGroup], [new Optional(), new SkipSelf(), NgForm]]\n }\n ]\n})\nexport class MzField implements AfterContentInit {\n @Input() label?: string;\n @Input() controlType: 'checkbox' | 'checkboxgroup' | 'other' = 'other';\n @Input() schema?: FieldSchema<any>;\n @ContentChild(NgModel) ngModel?: NgModel;\n\n fieldMetadata?: FieldMetadata;\n constructor(private elementRef: ElementRef) {\n }\n\n ngAfterContentInit(): void {\n //this.fieldMetadata = this.form.schema.getMetadata(this.ngModel?.path || []);\n }\n\n getErrorMessage(): string | undefined {\n try {\n const list = Object.values(this.ngModel!.errors!);\n return list[0];\n } catch {\n return undefined;\n }\n }\n}\n","<label class=\"field\">\n @if(label && controlType !== 'checkbox') {\n <span class=\"field-label\">\n {{ label }} \n </span>\n }\n <ng-content></ng-content>\n\n @if(controlType === 'checkbox' && label) {\n <span class=\"checkbox-label\">{{ label }}</span>\n } \n @if(ngModel?.touched && ngModel?.invalid) {\n <div class=\"field-error\">\n {{ getErrorMessage() }}\n </div>\n }\n</label>\n","import { AfterViewInit, Directive, HostListener, Input, OnInit } from '@angular/core';\nimport { NgForm } from '@angular/forms';\nimport { ModelSchema } from '../model-schema';\nimport { NgFormModelState } from '../ngform-model-state';\n\n@Directive({\n selector: '[mzForm]',\n standalone: true,\n})\nexport class MzForm implements AfterViewInit {\n @Input({ required: true }) schema!: ModelSchema<unknown>;\n\n private modelState!: NgFormModelState<unknown>;\n\n constructor(private ngForm: NgForm) {\n\n }\n \n ngAfterViewInit(): void {\n this.modelState = new NgFormModelState(this.ngForm, this.schema);\n }\n\n @HostListener('submit', ['$event'])\n onSubmit(event: Event) {\n this.ngForm.form.markAllAsTouched();\n if(this.ngForm.invalid) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FieldErrorsComponent } from './field-errors/field-errors.component';\nimport { MzField } from './field/field.component';\nimport { MzForm } from './form/form.directive';\nimport { DateValueAccessor } from './date-value-accessor.directive';\nimport { MzCheckboxGroup } from './checkbox-group/checkbox-group.component';\n\n\n/**\n * @deprecated\n */\n@NgModule({\n providers: [],\n declarations: [\n FieldErrorsComponent\n ],\n exports: [\n FieldErrorsComponent\n ],\n imports: [\n CommonModule // TODO: can remove once done with temp error displaying\n ]\n})\nexport class FormsModule { }\n\n\n@NgModule({\n providers: [],\n exports: [\n MzField,\n MzForm,\n DateValueAccessor,\n MzCheckboxGroup\n ],\n imports: [\n MzField,\n MzForm,\n DateValueAccessor,\n MzCheckboxGroup\n ]\n})\nexport class MzFormsModule { }\n","/*\n * Public API Surface of forms\n */\nexport * from './lib/field-error';\nexport * from './lib/model-state-result';\nexport * from './lib/model-schema.factory';\nexport { ModelSchema, SchemaDefinition } from './lib/model-schema';\nexport * from './lib/type-annotations';\nexport * from './lib/ng-form-model-state.service';\nexport * from './lib/ngform-model-state';\nexport * from './lib/field-errors/field-errors.component';\nexport * from './lib/masks';\n\nexport { DateValueAccessor } from './lib/date-value-accessor.directive';\nexport { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema, buildStringSchema, buildNumberSchema, buildDateSchema, buildBooleanSchema, buildArraySchema } from './lib/field-schema';\nexport { MzCheckboxGroup, FieldOption } from './lib/checkbox-group/checkbox-group.component';\n\nexport { FormsModule, MzFormsModule } from './lib/forms.module';\nexport { MzForm } from './lib/form/form.directive';\nexport { MzField } from './lib/field/field.component';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModelSchemaFactory","FormsModule"],"mappings":";;;;;;;;;;MAGa,WAAW,CAAA;;;IAGpB,WAAA,CAAoB,QAA4B,EAAU,MAAuB,EAAA;QAA7D,IAAA,CAAA,QAAQ,GAAR,QAAQ;QAA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,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,YAAY;AACb;AACF,iBAAA;;MAmBY,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YANtB,OAAO;YACP,MAAM;YACN,iBAAiB;AACjB,YAAA,eAAe,aATf,OAAO;YACP,MAAM;YACN,iBAAiB;YACjB,eAAe,CAAA,EAAA,CAAA,CAAA;AASN,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YAHtB,eAAe,CAAA,EAAA,CAAA,CAAA;;2FAGN,aAAa,EAAA,UAAA,EAAA,CAAA;kBAfzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE,EAAE;AACb,oBAAA,OAAO,EAAE;wBACP,OAAO;wBACP,MAAM;wBACN,iBAAiB;wBACjB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,OAAO;wBACP,MAAM;wBACN,iBAAiB;wBACjB;AACD;AACF,iBAAA;;;ACzCD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"muziehdesign-forms.mjs","sources":["../../../../projects/muziehdesign/forms/src/lib/model-schema.ts","../../../../projects/muziehdesign/forms/src/lib/constants.ts","../../../../projects/muziehdesign/forms/src/lib/field-schema.ts","../../../../projects/muziehdesign/forms/src/lib/model-schema.factory.ts","../../../../projects/muziehdesign/forms/src/lib/type-annotations.ts","../../../../projects/muziehdesign/forms/src/lib/ngform-model-state.ts","../../../../projects/muziehdesign/forms/src/lib/ng-form-model-state.service.ts","../../../../projects/muziehdesign/forms/src/lib/form-message.service.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.ts","../../../../projects/muziehdesign/forms/src/lib/field-errors/field-errors.component.html","../../../../projects/muziehdesign/forms/src/lib/masks.ts","../../../../projects/muziehdesign/forms/src/lib/date-value-accessor.directive.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.ts","../../../../projects/muziehdesign/forms/src/lib/checkbox-group/checkbox-group.component.html","../../../../projects/muziehdesign/forms/src/lib/field/field.component.ts","../../../../projects/muziehdesign/forms/src/lib/field/field.component.html","../../../../projects/muziehdesign/forms/src/lib/form/form.directive.ts","../../../../projects/muziehdesign/forms/src/lib/forms.module.ts","../../../../projects/muziehdesign/forms/src/lib/yup-locales.ts","../../../../projects/muziehdesign/forms/src/public-api.ts","../../../../projects/muziehdesign/forms/src/muziehdesign-forms.ts"],"sourcesContent":["import { AnyObjectSchema, SchemaOf, ValidationError } from 'yup';\nimport { FieldError } from './field-error';\nimport { FieldSchema } from './field-schema';\nexport class ModelSchema<T> {\n // TODO: need to keep track of internal and external\n //private definitions?: {[K in keyof T]: FieldSchema<any>};\n constructor(private metadata: FieldSchema<any>[], private schema: AnyObjectSchema, public readonly name?: string) {\n\n }\n\n getMetadata(paths: string[]) {\n //console.log('fetching metadata for path: ', paths);\n //console.log(this.schema.describe());\n for(var i = 0; i < paths.length; i++) {\n const field = this.metadata.find(f=>f.name === paths[i]);\n if(!field?.constraints.required || field.constraints.required.required === false) {\n return { required: false } satisfies FieldMetadata;\n }\n }\n return { required: true } satisfies FieldMetadata;\n\n }\n\n validate<T>(model: T): Promise<FieldError[]> {\n return this.schema\n .validate(model, { abortEarly: false })\n .then(() => {\n return [];\n })\n .catch((e: ValidationError) => {\n return e.inner.map((error) => <FieldError>{ path: error.path, type: error.type, message: error.message });\n });\n }\n\n cast(value: any) {\n return this.schema.cast(value);\n }\n}\n\nexport type SchemaDefinition<T> = {\n //[K in keyof Required<T>]: T[K] extends object ? SchemaDefinition<T[K]>: FieldSchema<any>;\n [K in keyof Required<T>]: FieldSchema<any>\n}\n\nexport interface FieldMetadata {\n required: boolean;\n}\n","export const SCHEMA_METADATA_NAMESPACE = 'custom:muziehdesign:annotations';\n","import { ArrayTypeAnnotations, BooleanTypeAnnotations, ConstraintAnnotations, DateTypeAnnotations, FileTypeAnnotations, NumberTypeAnnotations, ObjectTypeAnnotations, StringTypeAnnotations } from './type-annotations';\n\nexport enum FieldSchemaType {\n string = 'string',\n boolean = 'boolean',\n date = 'date',\n object = 'object',\n number = 'number',\n array = 'array',\n file = 'file',\n}\n\nexport interface FieldSchema<T extends ConstraintAnnotations> {\n name: string;\n type: FieldSchemaType;\n label?: string;\n constraints: T;\n}\n\nexport interface StringSchema extends FieldSchema<StringTypeAnnotations> {\n type: FieldSchemaType.string;\n}\n\nexport interface NumberSchema extends FieldSchema<NumberTypeAnnotations> {\n type: FieldSchemaType.number;\n}\n\nexport interface BooleanSchema extends FieldSchema<BooleanTypeAnnotations> {\n type: FieldSchemaType.boolean;\n}\n\nexport interface DateSchema extends FieldSchema<DateTypeAnnotations> {\n type: FieldSchemaType.date;\n}\n\nexport interface ArraySchema extends FieldSchema<ArrayTypeAnnotations> {\n type: FieldSchemaType.array;\n}\n\nexport interface FileSchema extends FieldSchema<FileTypeAnnotations> {\n type: FieldSchemaType.file;\n}\n\nexport interface ObjectSchema extends FieldSchema<ObjectTypeAnnotations> {\n type: FieldSchemaType.object;\n}\n\nexport const buildStringSchema = (path: string, constraints: StringTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.string,\n constraints: { ...constraints },\n } satisfies StringSchema;\n};\n\nexport const buildBooleanSchema = (path: string, constraints: BooleanTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.boolean,\n constraints: { ...constraints },\n } satisfies BooleanSchema;\n};\n\nexport const buildNumberSchema = (path: string, constraints: NumberTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.number,\n constraints: { ...constraints },\n } satisfies NumberSchema;\n};\n\nexport const buildDateSchema = (path: string, constraints: DateTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.date,\n constraints: { ...constraints },\n } satisfies DateSchema;\n};\n\nexport const buildArraySchema = (path: string, constraints: ArrayTypeAnnotations, label?: string) => {\n return {\n name: path,\n label: label,\n type: FieldSchemaType.array,\n constraints: { ...constraints },\n } satisfies ArraySchema;\n};\n","import { Injectable } from '@angular/core';\nimport { object, SchemaOf } from 'yup';\nimport { ModelSchema } from './model-schema';\nimport { SCHEMA_METADATA_NAMESPACE } from './constants';\nimport { ObjectShape } from 'yup/lib/object';\nimport * as Yup from 'yup';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\nimport { ModelMetadata } from './type-annotations';\n\n/*\nSchema rules need to be built in the order they need to be evaluated in.\nFor example,\n ```\n schema.required().max(...).matches(...);\n ```\nevaluates the 3 rules in this order\n - required\n - max\n - matches\n*/\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ModelSchemaFactory {\n constructor() {}\n\n build<T extends object>(model: T): ModelSchema<T> {\n const metadata: ModelMetadata = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, model);\n const schemaData = [...metadata.schemas.values()];\n const schema = this.buildYupSchema(schemaData);\n return new ModelSchema(schemaData, schema, metadata.name);\n }\n\n buildUntyped(raw: FieldSchema<any>[]) : ModelSchema<{[key: string]: string}> {\n const schema = this.buildYupSchema(raw);\n return new ModelSchema(raw, schema);\n }\n\n private buildYupSchema(fields: FieldSchema<any>[]) : Yup.AnyObjectSchema {\n let shape: ObjectShape = {};\n fields.forEach((value) => {\n if (value.type == FieldSchemaType.string) {\n shape[value.name] = this.buildStringSchema(value as StringSchema);\n } else if (value.type == FieldSchemaType.boolean) {\n shape[value.name] = this.buildBooleanSchema(value as BooleanSchema);\n } else if (value.type == FieldSchemaType.date) {\n shape[value.name] = this.buildDateSchema(value as DateSchema);\n } else if (value.type == FieldSchemaType.object) {\n shape[value.name] = this.buildNestedObjectSchema(value as ObjectSchema);\n } else if (value.type == FieldSchemaType.number) {\n shape[value.name] = this.buildNumberSchema(value as NumberSchema);\n } else if (value.type == FieldSchemaType.array) {\n shape[value.name] = this.buildArraySchema(value as ArraySchema);\n } else if (value.type == FieldSchemaType.file) {\n shape[value.name] = this.buildFileSchema(value as FileSchema);\n } else {\n throw new Error('Unrecognized field schema');\n }\n });\n\n return object(shape);\n }\n\n private buildStringSchema(original: StringSchema) {\n let schema = Yup.string();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints;\n\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.length) {\n schema = schema.length(options.length.length, options.length.message);\n }\n\n if (options.maxLength) {\n schema = schema.max(options.maxLength.maxLength, options.maxLength.message);\n }\n\n if (options.minLength) {\n schema = schema.min(options.minLength.minLength, options.minLength.message);\n }\n\n if (options.pattern) {\n schema = schema.matches(options.pattern.pattern, { message: options.pattern.message, excludeEmptyString: true });\n }\n\n return schema;\n }\n\n private buildBooleanSchema(original: BooleanSchema) {\n let schema = Yup.boolean();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints;\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.equals) {\n if (options.equals.equals) {\n schema = schema.isTrue(options.equals.message);\n } else {\n schema = schema.isFalse(options.equals.message);\n }\n }\n\n return schema;\n }\n\n private buildDateSchema(original: DateSchema) {\n let schema = Yup.date();\n if(original.label) {\n schema.label(original.label);\n }\n\n schema = schema.transform(function(value, originalValue) {\n if(originalValue === '') {\n return undefined;\n }\n\n return value;\n });\n\n const options = original.constraints;\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n if (options.test) {\n schema = schema.test(options.test.name, function(v, context){\n if(v && options.test?.test(v) !== true) {\n return context.createError({\n message: options.test?.message,\n path: context.path,\n params: {\n key: options.test?.name\n }\n });\n }\n return true;\n });\n }\n\n return schema;\n }\n\n private buildNumberSchema(original: NumberSchema) {\n let schema = Yup.number();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints;\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildArraySchema(original: ArraySchema) {\n let schema = Yup.array();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints;\n\n if (options.min) {\n schema = schema.min(options.min.min, options.min.message);\n }\n if (options.max) {\n schema = schema.max(options.max.max, options.max.message);\n }\n\n return schema;\n }\n\n private buildNestedObjectSchema(original: ObjectSchema) {\n const metadata: ModelMetadata = Reflect.getMetadata(SCHEMA_METADATA_NAMESPACE, original.constraints.getInstance());\n\n let nestedSchema = this.buildYupSchema([...metadata.schemas.values()]);\n if(original.label) {\n nestedSchema.label(original.label);\n }\n\n const options = original.constraints;\n if (options.required) {\n nestedSchema = nestedSchema.required();\n } else {\n nestedSchema = nestedSchema.notRequired().default(undefined);\n }\n\n return nestedSchema;\n }\n\n private buildFileSchema(original: FileSchema) {\n let schema = Yup.mixed().nullable().optional();\n if(original.label) {\n schema.label(original.label);\n }\n\n const options = original.constraints;\n if (options.required) {\n schema = schema.required(options.required.message);\n }\n\n return schema;\n }\n}\n","import 'reflect-metadata';\nimport { ArraySchema, BooleanSchema, DateSchema, FieldSchema, FieldSchemaType, FileSchema, NumberSchema, ObjectSchema, StringSchema } from './field-schema';\n\nconst METADATA_KEY = 'custom:muziehdesign:annotations';\n\nexport interface ConstraintAnnotations {}\n\nexport interface StringTypeConstraints {\n required?: true;\n requiredMessage?: string;\n\n pattern?: RegExp;\n patternMessage?: string;\n\n length?: number;\n lengthMessage?: string;\n}\n\nexport interface StringTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n length?: LengthAnnotation;\n pattern?: PatternAnnotation;\n maxLength?: MaxLengthAnnotation;\n minLength?: MinLengthAnnotation;\n}\n\nexport interface BooleanTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n equals?: EqualsAnnotation<boolean>;\n}\n\nexport interface DateTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<Date>;\n max?: MaximumAnnotation<Date>;\n test?: TestAnnotation<Date>;\n}\n\nexport interface ObjectTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n getInstance: () => any;\n}\n\nexport interface NumberTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface ArrayTypeAnnotations extends ConstraintAnnotations {\n min?: MinimumAnnotation<number>;\n max?: MaximumAnnotation<number>;\n}\n\nexport interface FileTypeAnnotations extends ConstraintAnnotations {\n required?: RequiredAnnotation;\n}\n\nexport interface ValidationAnnotation {\n message?: string;\n}\n\nexport interface RequiredAnnotation extends ValidationAnnotation {\n required: boolean;\n}\n\nexport interface LengthAnnotation extends ValidationAnnotation {\n length: number;\n}\n\nexport interface PatternAnnotation extends ValidationAnnotation {\n pattern: RegExp;\n}\n\nexport interface OfValuesAnnotation extends ValidationAnnotation {\n values: [];\n}\n\nexport interface EqualsAnnotation<T> extends ValidationAnnotation {\n equals: T;\n}\n\nexport interface MinimumAnnotation<T> extends ValidationAnnotation {\n min: T;\n}\n\nexport interface MaximumAnnotation<T> extends ValidationAnnotation {\n max: T;\n}\n\nexport interface TestAnnotation<T> extends ValidationAnnotation {\n test: (d: T) => boolean;\n name: string;\n}\n\nexport interface MaxLengthAnnotation extends ValidationAnnotation {\n maxLength: number;\n}\n\nexport interface MinLengthAnnotation extends ValidationAnnotation {\n minLength: number;\n}\n\nexport interface ModelMetadata {\n name?: string;\n schemas: Map<string, FieldSchema<any>>;\n}\n\nconst registerPropertyMetadata = (target: Object, propertyKey: string, schema: FieldSchema<any>) => {\n const metadata: ModelMetadata = Reflect.getMetadata(METADATA_KEY, target) || ({ schemas: new Map<string, FieldSchema<any>>() } satisfies ModelMetadata);\n metadata.schemas.set(propertyKey, schema);\n Reflect.defineMetadata(METADATA_KEY, metadata, target);\n};\n\nconst registerMetadata = (target: Object, name: string) => {\n const metadata: ModelMetadata = Reflect.getMetadata(METADATA_KEY, target) || ({ schemas: new Map<string, FieldSchema<any>>() } satisfies ModelMetadata);\n metadata.name = name;\n Reflect.defineMetadata(METADATA_KEY, metadata, target);\n};\n\nexport function StringType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.string,\n constraints: Object.assign({}, ...annotations) as StringTypeAnnotations,\n } satisfies StringSchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function BooleanType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.boolean,\n constraints: Object.assign({}, ...annotations) as BooleanTypeAnnotations,\n } satisfies BooleanSchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function DateType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.date,\n constraints: Object.assign({}, ...annotations) as DateTypeAnnotations,\n } satisfies DateSchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function NumberType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.number,\n constraints: Object.assign({}, ...annotations) as NumberTypeAnnotations,\n } satisfies NumberSchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ObjectType<T>(type: { new (): T }, ...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.object,\n constraints: Object.assign({}, ...annotations, { getInstance: () => new type() } as Partial<ObjectTypeAnnotations>) as ObjectTypeAnnotations,\n } satisfies ObjectSchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function ArrayType(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.array,\n constraints: Object.assign({}, ...annotations) as ArrayTypeAnnotations,\n } satisfies ArraySchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function FileType<T>(...annotations: { [key: string]: ValidationAnnotation }[]) {\n return function (target: Object, propertyKey: string) {\n const schema = {\n name: propertyKey,\n type: FieldSchemaType.file,\n constraints: Object.assign({}, ...annotations) as FileTypeAnnotations,\n } satisfies FileSchema;\n\n registerPropertyMetadata(target, propertyKey, schema);\n };\n}\n\nexport function Model(name: string) {\n return function <T extends { new (...args: any[]): {} }>(constructor: T) {\n // Class decorators receive the constructor, but property decorators write to constructor.prototype\n // So we need to write to constructor.prototype to share the same metadata object\n registerMetadata(constructor.prototype, name);\n return constructor;\n }\n}\n\nexport function required(message?: string): { [key: string]: RequiredAnnotation } {\n return { required: { required: true, message: message } };\n}\n\nexport function pattern(regex: RegExp, message?: string): { [key: string]: PatternAnnotation } {\n return { pattern: { pattern: regex, message: message } };\n}\n\nexport function length(length: number, message?: string): { [key: string]: LengthAnnotation } {\n return { length: { length: length, message: message } };\n}\n\nexport function maxLength(maxLength: number, message?: string): { [key: string]: MaxLengthAnnotation } {\n return { maxLength: { maxLength: maxLength, message: message } };\n}\n\nexport function minLength(minLength: number, message?: string): { [key: string]: MinLengthAnnotation } {\n return { minLength: { minLength: minLength, message: message } };\n}\n\nexport function ofValues(values: [], message?: string): { [key: string]: OfValuesAnnotation } {\n return { ofValues: { values: values, message: message } };\n}\n\nexport function equals<T>(value: T, message?: string): { [key: string]: EqualsAnnotation<T> } {\n return { equals: { equals: value, message: message } };\n}\n\nexport function min<T>(value: T, message?: string): { [key: string]: MinimumAnnotation<T> } {\n return { min: { min: value, message: message } };\n}\n\nexport function max<T>(value: T, message?: string): { [key: string]: MaximumAnnotation<T> } {\n return { max: { max: value, message: message } };\n}\n\nexport function test<T>(name: string, test: (d: T) => boolean, message?: string): { [key: string]: TestAnnotation<T> } {\n return { test: { name: name, test: test, message: message } };\n}\n","import { AbstractControl, FormArray, FormGroup, NgForm, ValidationErrors } from '@angular/forms';\nimport { BehaviorSubject, from, switchMap } from 'rxjs';\nimport { FieldError } from './field-error';\nimport { ModelStateOptions } from './model-state-options';\nimport { ModelStateResult } from './model-state-result';\nimport { ModelSchema } from './model-schema';\n\nexport class NgFormModelState<T> {\n private changesSubject = new BehaviorSubject<ModelStateResult<T> | undefined>(undefined);\n public readonly changes = this.changesSubject.asObservable();\n\n constructor(private form: NgForm, private modelValidator: ModelSchema<T>, private options?: ModelStateOptions) {\n this.form.form.valueChanges\n .pipe(\n switchMap(async (x) => {\n return from(this.validate());\n })\n )\n .subscribe();\n }\n\n getCurrent(): ModelStateResult<T> | undefined {\n return this.changesSubject.value;\n }\n\n setState(model: T, errors: FieldError[]) {\n const state = {\n model: model,\n errors: errors,\n valid: errors.length === 0,\n } as ModelStateResult<T>;\n this.setStateInternal(state);\n }\n\n setErrors(errors: FieldError[]) {\n //this.errors.next(errors);\n throw new Error('needs implementation');\n }\n\n appendErrors(errors: FieldError[], skipEmit?: boolean) {\n const allErrors = [...(this.changesSubject.value?.errors || []), ...errors];\n const state = { ...this.changesSubject.value } as ModelStateResult<T>;\n state.errors = allErrors;\n this.setStateInternal(state);\n }\n\n async validate(): Promise<ModelStateResult<T>> {\n const model = this.form.value;\n const state = await this.runValidations(model, this.options?.onValidate);\n this.setStateInternal(state);\n return state;\n }\n\n\n private setStateInternal(state: ModelStateResult<T>) {\n this.deleteFormErrors();\n\n const grouped = state.errors.reduce((grouped, v) => grouped.set(v.path, [...(grouped.get(v.path) || []), v]), new Map<string, FieldError[]>());\n grouped.forEach((value, path) => {\n let validationErrors = <ValidationErrors>{};\n value.forEach((v) => (validationErrors[v.type] = v.message));\n\n const control = this.form.form.get(path);\n if (!control) {\n // TODO: use actual logging service\n } else {\n control.setErrors(validationErrors);\n }\n });\n\n this.changesSubject.next(state);\n }\n\n private deleteFormErrors() {\n this.deleteErrors(this.form.form);\n }\n\n private deleteErrors(rootFormGroup: FormGroup) {\n Object.keys(rootFormGroup.controls).forEach((key) => {\n const control = rootFormGroup.controls[key];\n\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(key, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private deleteErrorsFromControl(key: string | number, control: AbstractControl) {\n control.setErrors(null);\n }\n\n private isParentControl(control: AbstractControl) {\n return control instanceof FormGroup || control instanceof FormArray;\n }\n\n private loopFormArray(formArray: FormArray) {\n formArray.controls.forEach((control, index) => {\n if (!this.isParentControl(control)) {\n this.deleteErrorsFromControl(index, control);\n } else if (control instanceof FormGroup) {\n this.deleteErrors(control as FormGroup);\n } else if (control instanceof FormArray) {\n this.loopFormArray(control as FormArray);\n }\n });\n }\n\n private async runValidations<T>(model: T, callback?: (list: FieldError[]) => Promise<FieldError[]>): Promise<ModelStateResult<T>> {\n const list = await this.modelValidator.validate(model);\n const final = callback ? (await callback?.(list)) : list;\n return {\n valid: final.length === 0,\n errors: final,\n model: model,\n };\n }\n}\n","import { Injectable } from '@angular/core';\nimport { NgForm } from '@angular/forms';\nimport { ModelSchemaFactory } from './model-schema.factory';\nimport { ModelStateOptions } from './model-state-options';\nimport { NgFormModelState } from './ngform-model-state';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class NgFormModelStateFactory {\n constructor(private factory: ModelSchemaFactory) {}\n\n create<T extends object>(form: NgForm, model: T, options?: ModelStateOptions) {\n const modelState = new NgFormModelState<T>(form, this.factory.build(model), options);\n return modelState;\n }\n}\n","import { Inject, Injectable, LOCALE_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormMessageService {\n private localeData: { [localeId: string]: any } = {};\n constructor(@Inject(LOCALE_ID) private localeId: string) {}\n\n getMessage(messageProps: string | { key: string; path?: string; message?: string; min?: number | Date; max?: number | Date; less?: number; more?: number, length?: number }, namespace?: string): string | undefined {\n if (typeof messageProps === 'string') {\n return messageProps;\n }\n\n try {\n const parts = messageProps.key.split('.');\n\n // get namespaced message\n if (namespace && namespace.length > 0 && messageProps.path && messageProps.path.length > 0) {\n const namespaced = this.getLocaleData([namespace, messageProps.path, ...parts]);\n if (namespaced !== undefined) {\n return namespaced;\n }\n }\n\n // get global message\n const message = this.getLocaleData(parts);\n if (!message) {\n return messageProps.key;\n }\n\n return this.formatMessage(message, messageProps);\n } catch {\n return messageProps.key;\n }\n }\n\n private formatMessage(message: string, params: { min?: number | Date; max?: number | Date; less?: number; more?: number; length?: number }): string {\n let formatted = message;\n\n // Format min parameter\n if (params.min !== undefined) {\n const formattedMin = params.min instanceof Date\n ? params.min.toLocaleDateString(this.localeId)\n : params.min.toString();\n formatted = formatted.replace('{min}', formattedMin);\n }\n\n // Format max parameter\n if (params.max !== undefined) {\n const formattedMax = params.max instanceof Date\n ? params.max.toLocaleDateString(this.localeId)\n : params.max.toString();\n formatted = formatted.replace('{max}', formattedMax);\n }\n\n // Format less parameter\n if (params.less !== undefined) {\n formatted = formatted.replace('{less}', params.less.toString());\n }\n\n // Format more parameter\n if (params.more !== undefined) {\n formatted = formatted.replace('{more}', params.more.toString());\n }\n\n // Format length parameter\n if (params.length !== undefined) {\n formatted = formatted.replace('{length}', params.length.toString());\n }\n\n return formatted;\n }\n\n registerLocaleMessages(data: any, localeId: string) {\n this.localeData[localeId] = data;\n }\n\n private getLocaleData(keyParts: string[]): string | undefined {\n const messages = this.localeData[this.localeId] || this.localeData['en'];\n return keyParts.reduce((obj, part) => {\n if (obj?.[part] === undefined) {\n return undefined;\n }\n return obj[part];\n }, messages);\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { NgControl, ValidationErrors } from '@angular/forms';\n\n@Component({\n selector: 'mz-field-errors',\n templateUrl: './field-errors.component.html',\n styleUrls: ['./field-errors.component.css'],\n standalone: false\n})\nexport class FieldErrorsComponent {\n @Input() field?: NgControl;\n\n get errorMessage(): string {\n const errorKeys = Object.keys(this.field?.errors || {});\n return errorKeys.length > 0 ? (this.field?.errors as ValidationErrors)[errorKeys[0]] : '';\n }\n}\n","@if (errorMessage) {\n <div class=\"field-error\">{{ errorMessage }}</div>\n test test\n}\n","import { format, isValid, parse } from 'date-fns';\nimport * as IMask from 'imask';\n\nexport const phoneNumberOptions = {\n mask: '(000) 000-0000',\n};\n\nexport const ssnOptions = {\n mask: '000-00-0000',\n};\n\nexport const currencyOptions = {\n mask: Number,\n scale: 2,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n\nexport const integerOptions = {\n mask: Number,\n scale: 0,\n thousandsSeparator: ',',\n padFractionalZeros: true,\n radix: '.',\n mapToRadix: ['.'],\n};\n\n","import { formatDate } from '@angular/common';\nimport { Directive, ElementRef, Renderer2, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Directive({\n selector: '[mzDateInput]',\n standalone: true,\n host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateValueAccessor),\n multi: true,\n },\n ],\n})\nexport class DateValueAccessor implements ControlValueAccessor {\n onChange = (_: any) => {};\n onTouched = () => {};\n\n constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {}\n\n writeValue(obj?: Date): void {\n let normalizedValue = '';\n if (!obj) {\n normalizedValue = '';\n } else if (this._elementRef.nativeElement.type === 'date') {\n normalizedValue = obj.toISOString().split('T')[0];\n } else {\n normalizedValue = obj.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit', year: 'numeric' }); // TODO: support other date formats\n }\n this.setProperty('value', normalizedValue);\n }\n\n registerOnChange(fn: any): void {\n this.onChange = (value) => {\n const parsed = this.parseDate(value);\n fn(parsed);\n };\n }\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n this.setProperty('disabled', isDisabled);\n }\n protected setProperty(key: string, value: any): void {\n this._renderer.setProperty(this._elementRef.nativeElement, key, value);\n }\n\n private parseDate(value: string): Date | undefined {\n const validFormat = this._elementRef.nativeElement.type === 'date' ? /^(\\d{4}-\\d{2}-\\d{2})$/.test(value) : /^(\\d{1,2}\\/\\d{1,2}\\/\\d{4})$/.test(value);\n if (!validFormat) {\n return undefined;\n }\n\n const entry = new Date(value).toISOString().split('T')[0];\n\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = entry.split('-').map((val: string) => +val);\n return this.createDate(y, m - 1, d);\n }\n\n private createDate(year: number, month: number, date: number): Date {\n // The `newDate` is set to midnight (UTC) on January 1st 1970.\n // - In PST this will be December 31st 1969 at 4pm.\n // - In GMT this will be January 1st 1970 at 1am.\n // Note that they even have different years, dates and months!\n const newDate = new Date(0);\n\n // `setFullYear()` allows years like 0001 to be set correctly. This function does not\n // change the internal time of the date.\n // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).\n // - In PST this will now be September 20, 2019 at 4pm\n // - In GMT this will now be September 20, 2019 at 1am\n\n newDate.setFullYear(year, month, date);\n // We want the final date to be at local midnight, so we reset the time.\n // - In PST this will now be September 20, 2019 at 12am\n // - In GMT this will now be September 20, 2019 at 12am\n newDate.setHours(0, 0, 0);\n\n return newDate;\n }\n}\n","import { Component, Input, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport type FieldOption = {\n label: string;\n value: any;\n};\n\n@Component({\n selector: 'mz-checkbox-group',\n imports: [FormsModule],\n templateUrl: './checkbox-group.component.html',\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MzCheckboxGroup),\n multi: true,\n },\n ]\n})\nexport class MzCheckboxGroup implements ControlValueAccessor {\n @Input({ required: true }) options!: FieldOption[];\n @Input({ required: false }) disabled = false;\n\n selections: any[] = [];\n\n onChange: (value: string[]) => void = () => {};\n onTouched: () => void = () => {};\n\n // Writes the selected values from the form model\n writeValue(values: any[]): void {\n this.selections = values || [];\n }\n\n // Registers the onChange function to propagate changes\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n // Registers the onTouched function\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n setDisabledState?(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n // Checks if a checkbox is selected\n isChecked(option: FieldOption): boolean {\n return this.selections.includes(option.value);\n }\n\n // Handles changes when checkboxes are clicked\n onCheckboxChange(event: Event, option: FieldOption): void {\n const checked = (event.target as HTMLInputElement).checked;\n\n if (checked) {\n this.selections = [...this.selections, option.value];\n } else {\n this.selections = this.selections.filter((val) => val !== option.value);\n }\n\n this.onChange(this.selections);\n this.onTouched();\n }\n}\n","@for(option of options; track $index) {\n <label class=\"field-option\">\n <input type=\"checkbox\" class=\"form-checkbox\" [disabled]=\"disabled\" [value]=\"option.value\" [checked]=\"isChecked(option)\" (change)=\"onCheckboxChange($event, option)\" />\n <span class=\"checkbox-label\">{{option.label}}</span>\n </label>\n}\n","import { Component, ContentChild, Input, Optional, SkipSelf } from '@angular/core';\nimport { ControlContainer, NgForm, NgModel, NgModelGroup } from '@angular/forms';\nimport { FormMessageService } from '../form-message.service';\nimport { MzForm } from '../../public-api';\n\nfunction getControlContainer(group: NgModelGroup | null, form: NgForm | null): ControlContainer {\n return group ?? form!;\n}\n\n@Component({\n selector: 'mz-field',\n imports: [],\n templateUrl: './field.component.html',\n providers: [\n {\n provide: ControlContainer,\n useFactory: getControlContainer,\n deps: [\n [new Optional(), new SkipSelf(), NgModelGroup],\n [new Optional(), new SkipSelf(), NgForm],\n ],\n },\n ],\n})\nexport class MzField {\n @Input() label?: string;\n @Input() controlType: 'checkbox' | 'checkboxgroup' | 'other' = 'other';\n @ContentChild(NgModel) ngModel?: NgModel;\n\n constructor(private message: FormMessageService, @Optional() private form?: MzForm) {}\n\n getErrorMessage(): string | undefined {\n try {\n const list = Object.values(this.ngModel!.errors!);\n return this.message.getMessage(list[0], this.form?.schema.name);\n } catch {\n return undefined;\n }\n }\n}\n","<label class=\"field\">\n @if(label && controlType !== 'checkbox') {\n <span class=\"field-label\">\n {{ label }}\n </span>\n }\n <ng-content></ng-content>\n\n @if(controlType === 'checkbox' && label) {\n <span class=\"checkbox-label\">{{ label }}</span>\n }\n @if(ngModel?.touched && ngModel?.invalid) {\n <div class=\"field-error\">\n {{ getErrorMessage() }}\n </div>\n }\n</label>\n","import { AfterViewInit, Directive, HostListener, Input, OnInit } from '@angular/core';\nimport { NgForm } from '@angular/forms';\nimport { ModelSchema } from '../model-schema';\nimport { NgFormModelState } from '../ngform-model-state';\n\n@Directive({\n selector: '[mzForm]',\n standalone: true,\n})\nexport class MzForm implements AfterViewInit {\n @Input({ required: true }) schema!: ModelSchema<unknown>;\n\n private modelState!: NgFormModelState<unknown>;\n\n constructor(private ngForm: NgForm) {\n\n }\n \n ngAfterViewInit(): void {\n this.modelState = new NgFormModelState(this.ngForm, this.schema);\n }\n\n @HostListener('submit', ['$event'])\n onSubmit(event: Event) {\n this.ngForm.form.markAllAsTouched();\n if(this.ngForm.invalid) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FieldErrorsComponent } from './field-errors/field-errors.component';\nimport { MzField } from './field/field.component';\nimport { MzForm } from './form/form.directive';\nimport { DateValueAccessor } from './date-value-accessor.directive';\nimport { MzCheckboxGroup } from './checkbox-group/checkbox-group.component';\n\n\n/**\n * @deprecated\n */\n@NgModule({\n providers: [],\n declarations: [\n FieldErrorsComponent\n ],\n exports: [\n FieldErrorsComponent\n ],\n imports: [\n CommonModule // TODO: can remove once done with temp error displaying\n ]\n})\nexport class FormsModule { }\n\n\n@NgModule({\n providers: [],\n exports: [\n MzField,\n MzForm,\n DateValueAccessor,\n MzCheckboxGroup\n ],\n imports: [\n MzField,\n MzForm,\n DateValueAccessor,\n MzCheckboxGroup\n ]\n})\nexport class MzFormsModule { }\n","import { LocaleObject } from 'yup/lib/locale';\nimport { MessageParams } from 'yup/lib/types';\n\nexport const YUP_DEFAULT_LOCALES: LocaleObject = {\n mixed: {\n required: 'Required',\n notType: 'Invalid value',\n },\n};\n\nexport function getMessage(message: string | {key?: string} & MessageParams, key: string) {\n if(typeof message === 'string') {\n return {key: message}\n }\n\n return {...message, key: message.key ?? key};\n}\n\nexport const YUP_LOCALE_KEYS = {\n mixed: {\n required: (params) => getMessage(params, 'mixed.required'),\n notType: (params) => getMessage(params, 'mixed.notType'),\n oneOf: (params) => getMessage(params, 'mixed.oneOf'),\n notOneOf: (params) => getMessage(params, 'mixed.notOneOf'),\n default: (params) => getMessage(params, 'mixed.default'),\n defined: (params) => getMessage(params, 'mixed.defined'),\n },\n string: {\n min: (params) => getMessage(params, 'string.min'),\n max: (params) => getMessage(params, 'string.max'),\n length: (params) => getMessage(params, 'string.length'),\n matches: (params) => getMessage(params, 'string.matches'),\n email: (params) => getMessage(params, 'string.email'),\n url: (params) => getMessage(params, 'string.url'),\n uuid: (params) => getMessage(params, 'string.uuid'),\n trim: (params) => getMessage(params, 'string.trim'),\n lowercase: (params) => getMessage(params, 'string.lowercase'),\n uppercase: (params) => getMessage(params, 'string.uppercase'),\n },\n number: {\n min: (params) => getMessage(params, 'number.min'),\n max: (params) => getMessage(params, 'number.max'),\n lessThan: (params) => getMessage(params, 'number.lessThan'),\n moreThan: (params) => getMessage(params, 'number.moreThan'),\n positive: (params) => getMessage(params, 'number.positive'),\n negative: (params) => getMessage(params, 'number.negative'),\n integer: (params) => getMessage(params, 'number.integer'),\n },\n date: {\n min: (params) => getMessage(params, 'date.min'),\n max: (params) => getMessage(params, 'date.max')\n },\n object: {\n noUnknown: (params) => getMessage(params, 'object.noUnknown'),\n },\n array: {\n min: (params) => getMessage(params, 'array.min'),\n max: (params) => getMessage(params, 'array.max'),\n length: (params) => getMessage(params, 'array.length'),\n },\n boolean: {\n isValue: (params) => getMessage(params, 'boolean.isValue'),\n }\n} satisfies LocaleObject;\n","/*\n * Public API Surface of forms\n */\nexport * from './lib/field-error';\nexport * from './lib/model-state-result';\nexport * from './lib/model-schema.factory';\nexport { ModelSchema, SchemaDefinition } from './lib/model-schema';\nexport * from './lib/type-annotations';\nexport * from './lib/ng-form-model-state.service';\nexport * from './lib/ngform-model-state';\nexport * from './lib/form-message.service';\nexport * from './lib/field-errors/field-errors.component';\nexport * from './lib/masks';\n\nexport { DateValueAccessor } from './lib/date-value-accessor.directive';\nexport { FieldSchema, FieldSchemaType, StringSchema, NumberSchema, DateSchema, BooleanSchema, FileSchema, ObjectSchema, buildStringSchema, buildNumberSchema, buildDateSchema, buildBooleanSchema, buildArraySchema } from './lib/field-schema';\nexport { MzCheckboxGroup, FieldOption } from './lib/checkbox-group/checkbox-group.component';\n\nexport { FormsModule, MzFormsModule } from './lib/forms.module';\nexport { MzForm } from './lib/form/form.directive';\nexport { MzField } from './lib/field/field.component';\n\nexport * from './lib/yup-locales';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ModelSchemaFactory","FormsModule","i1.FormMessageService","i2.MzForm"],"mappings":";;;;;;;;;;MAGa,WAAW,CAAA;;;AAGpB,IAAA,WAAA,CAAoB,QAA4B,EAAU,MAAuB,EAAkB,IAAa,EAAA;QAA5F,IAAA,CAAA,QAAQ,GAAR,QAAQ;QAA8B,IAAA,CAAA,MAAM,GAAN,MAAM;QAAmC,IAAA,CAAA,IAAI,GAAJ,IAAI;IAEvG;AAEA,IAAA,WAAW,CAAC,KAAe,EAAA;;;AAGvB,QAAA,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAClC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAE,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,YAAA,IAAG,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,KAAK,KAAK,EAAE;AAC9E,gBAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAA0B;YACtD;QACJ;AACA,QAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAA0B;IAErD;AAEA,IAAA,QAAQ,CAAI,KAAQ,EAAA;QAChB,OAAO,IAAI,CAAC;aACP,QAAQ,CAAC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;aACrC,IAAI,CAAC,MAAK;AACP,YAAA,OAAO,EAAE;AACb,QAAA,CAAC;AACA,aAAA,KAAK,CAAC,CAAC,CAAkB,KAAI;AAC1B,YAAA,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,MAAiB,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE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
1
  import { AnyObjectSchema } from 'yup';
2
2
  import * as _muziehdesign_forms from '@muziehdesign/forms';
3
3
  import * as i0 from '@angular/core';
4
- import { Renderer2, ElementRef, AfterContentInit, AfterViewInit } from '@angular/core';
4
+ import { Renderer2, ElementRef, AfterViewInit } from '@angular/core';
5
5
  import { NgForm, NgControl, ControlValueAccessor, NgModel } from '@angular/forms';
6
6
  import * as rxjs from 'rxjs';
7
7
  import * as i2 from '@angular/common';
8
+ import { LocaleObject } from 'yup/lib/locale';
9
+ import { MessageParams } from 'yup/lib/types';
8
10
 
9
11
  interface FieldError {
10
12
  path: string;
@@ -95,6 +97,10 @@ interface MaxLengthAnnotation extends ValidationAnnotation {
95
97
  interface MinLengthAnnotation extends ValidationAnnotation {
96
98
  minLength: number;
97
99
  }
100
+ interface ModelMetadata {
101
+ name?: string;
102
+ schemas: Map<string, FieldSchema<any>>;
103
+ }
98
104
  declare function StringType(...annotations: {
99
105
  [key: string]: ValidationAnnotation;
100
106
  }[]): (target: Object, propertyKey: string) => void;
@@ -118,6 +124,9 @@ declare function ArrayType(...annotations: {
118
124
  declare function FileType<T>(...annotations: {
119
125
  [key: string]: ValidationAnnotation;
120
126
  }[]): (target: Object, propertyKey: string) => void;
127
+ declare function Model(name: string): <T extends {
128
+ new (...args: any[]): {};
129
+ }>(constructor: T) => T;
121
130
  declare function required(message?: string): {
122
131
  [key: string]: RequiredAnnotation;
123
132
  };
@@ -237,7 +246,8 @@ declare const buildArraySchema: (path: string, constraints: ArrayTypeAnnotations
237
246
  declare class ModelSchema<T> {
238
247
  private metadata;
239
248
  private schema;
240
- constructor(metadata: FieldSchema<any>[], schema: AnyObjectSchema);
249
+ readonly name?: string | undefined;
250
+ constructor(metadata: FieldSchema<any>[], schema: AnyObjectSchema, name?: string | undefined);
241
251
  getMetadata(paths: string[]): {
242
252
  required: false;
243
253
  } | {
@@ -249,9 +259,6 @@ declare class ModelSchema<T> {
249
259
  type SchemaDefinition<T> = {
250
260
  [K in keyof Required<T>]: FieldSchema<any>;
251
261
  };
252
- interface FieldMetadata {
253
- required: boolean;
254
- }
255
262
 
256
263
  declare class ModelSchemaFactory {
257
264
  constructor();
@@ -304,6 +311,27 @@ declare class NgFormModelStateFactory {
304
311
  static ɵprov: i0.ɵɵInjectableDeclaration<NgFormModelStateFactory>;
305
312
  }
306
313
 
314
+ declare class FormMessageService {
315
+ private localeId;
316
+ private localeData;
317
+ constructor(localeId: string);
318
+ getMessage(messageProps: string | {
319
+ key: string;
320
+ path?: string;
321
+ message?: string;
322
+ min?: number | Date;
323
+ max?: number | Date;
324
+ less?: number;
325
+ more?: number;
326
+ length?: number;
327
+ }, namespace?: string): string | undefined;
328
+ private formatMessage;
329
+ registerLocaleMessages(data: any, localeId: string): void;
330
+ private getLocaleData;
331
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormMessageService, never>;
332
+ static ɵprov: i0.ɵɵInjectableDeclaration<FormMessageService>;
333
+ }
334
+
307
335
  declare class FieldErrorsComponent {
308
336
  field?: NgControl;
309
337
  get errorMessage(): string;
@@ -371,18 +399,16 @@ declare class MzCheckboxGroup implements ControlValueAccessor {
371
399
  static ɵcmp: i0.ɵɵComponentDeclaration<MzCheckboxGroup, "mz-checkbox-group", never, { "options": { "alias": "options"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
372
400
  }
373
401
 
374
- declare class MzField implements AfterContentInit {
375
- private elementRef;
402
+ declare class MzField {
403
+ private message;
404
+ private form?;
376
405
  label?: string;
377
406
  controlType: 'checkbox' | 'checkboxgroup' | 'other';
378
- schema?: FieldSchema<any>;
379
407
  ngModel?: NgModel;
380
- fieldMetadata?: FieldMetadata;
381
- constructor(elementRef: ElementRef);
382
- ngAfterContentInit(): void;
408
+ constructor(message: FormMessageService, form?: MzForm | undefined);
383
409
  getErrorMessage(): string | undefined;
384
- static ɵfac: i0.ɵɵFactoryDeclaration<MzField, never>;
385
- static ɵcmp: i0.ɵɵComponentDeclaration<MzField, "mz-field", never, { "label": { "alias": "label"; "required": false; }; "controlType": { "alias": "controlType"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; }, {}, ["ngModel"], ["*"], true, never>;
410
+ static ɵfac: i0.ɵɵFactoryDeclaration<MzField, [null, { optional: true; }]>;
411
+ static ɵcmp: i0.ɵɵComponentDeclaration<MzField, "mz-field", never, { "label": { "alias": "label"; "required": false; }; "controlType": { "alias": "controlType"; "required": false; }; }, {}, ["ngModel"], ["*"], true, never>;
386
412
  }
387
413
 
388
414
  declare class MzForm implements AfterViewInit {
@@ -410,5 +436,375 @@ declare class MzFormsModule {
410
436
  static ɵinj: i0.ɵɵInjectorDeclaration<MzFormsModule>;
411
437
  }
412
438
 
413
- export { ArrayType, BooleanType, DateType, DateValueAccessor, FieldErrorsComponent, FieldSchemaType, FileType, FormsModule, ModelSchema, ModelSchemaFactory, MzCheckboxGroup, MzField, MzForm, MzFormsModule, NgFormModelState, NgFormModelStateFactory, NumberType, ObjectType, StringType, buildArraySchema, buildBooleanSchema, buildDateSchema, buildNumberSchema, buildStringSchema, currencyOptions, equals, integerOptions, length, max, maxLength, min, minLength, ofValues, pattern, phoneNumberOptions, required, ssnOptions, test };
414
- export type { ArrayTypeAnnotations, BooleanSchema, BooleanTypeAnnotations, ConstraintAnnotations, DateSchema, DateTypeAnnotations, EqualsAnnotation, FieldError, FieldOption, FieldSchema, FileSchema, FileTypeAnnotations, LengthAnnotation, MaxLengthAnnotation, MaximumAnnotation, MinLengthAnnotation, MinimumAnnotation, ModelStateResult, NumberSchema, NumberTypeAnnotations, ObjectSchema, ObjectTypeAnnotations, OfValuesAnnotation, PatternAnnotation, RequiredAnnotation, SchemaDefinition, StringSchema, StringTypeAnnotations, StringTypeConstraints, TestAnnotation, ValidationAnnotation };
439
+ declare const YUP_DEFAULT_LOCALES: LocaleObject;
440
+ declare function getMessage(message: string | {
441
+ key?: string;
442
+ } & MessageParams, key: string): {
443
+ key: string;
444
+ } | {
445
+ key: string;
446
+ path: string;
447
+ value: any;
448
+ originalValue: any;
449
+ label: string;
450
+ type: string;
451
+ };
452
+ declare const YUP_LOCALE_KEYS: {
453
+ mixed: {
454
+ required: (params: MessageParams) => {
455
+ key: string;
456
+ } | {
457
+ key: string;
458
+ path: string;
459
+ value: any;
460
+ originalValue: any;
461
+ label: string;
462
+ type: string;
463
+ };
464
+ notType: (params: MessageParams) => {
465
+ key: string;
466
+ } | {
467
+ key: string;
468
+ path: string;
469
+ value: any;
470
+ originalValue: any;
471
+ label: string;
472
+ type: string;
473
+ };
474
+ oneOf: (params: {
475
+ values: any;
476
+ } & MessageParams) => {
477
+ key: string;
478
+ } | {
479
+ key: string;
480
+ path: string;
481
+ value: any;
482
+ originalValue: any;
483
+ label: string;
484
+ type: string;
485
+ };
486
+ notOneOf: (params: {
487
+ values: any;
488
+ } & MessageParams) => {
489
+ key: string;
490
+ } | {
491
+ key: string;
492
+ path: string;
493
+ value: any;
494
+ originalValue: any;
495
+ label: string;
496
+ type: string;
497
+ };
498
+ default: (params: MessageParams) => {
499
+ key: string;
500
+ } | {
501
+ key: string;
502
+ path: string;
503
+ value: any;
504
+ originalValue: any;
505
+ label: string;
506
+ type: string;
507
+ };
508
+ defined: (params: MessageParams) => {
509
+ key: string;
510
+ } | {
511
+ key: string;
512
+ path: string;
513
+ value: any;
514
+ originalValue: any;
515
+ label: string;
516
+ type: string;
517
+ };
518
+ };
519
+ string: {
520
+ min: (params: {
521
+ min: number;
522
+ } & MessageParams) => {
523
+ key: string;
524
+ } | {
525
+ key: string;
526
+ path: string;
527
+ value: any;
528
+ originalValue: any;
529
+ label: string;
530
+ type: string;
531
+ };
532
+ max: (params: {
533
+ max: number;
534
+ } & MessageParams) => {
535
+ key: string;
536
+ } | {
537
+ key: string;
538
+ path: string;
539
+ value: any;
540
+ originalValue: any;
541
+ label: string;
542
+ type: string;
543
+ };
544
+ length: (params: {
545
+ length: number;
546
+ } & MessageParams) => {
547
+ key: string;
548
+ } | {
549
+ key: string;
550
+ path: string;
551
+ value: any;
552
+ originalValue: any;
553
+ label: string;
554
+ type: string;
555
+ };
556
+ matches: (params: {
557
+ regex: RegExp;
558
+ } & MessageParams) => {
559
+ key: string;
560
+ } | {
561
+ key: string;
562
+ path: string;
563
+ value: any;
564
+ originalValue: any;
565
+ label: string;
566
+ type: string;
567
+ };
568
+ email: (params: {
569
+ regex: RegExp;
570
+ } & MessageParams) => {
571
+ key: string;
572
+ } | {
573
+ key: string;
574
+ path: string;
575
+ value: any;
576
+ originalValue: any;
577
+ label: string;
578
+ type: string;
579
+ };
580
+ url: (params: {
581
+ regex: RegExp;
582
+ } & MessageParams) => {
583
+ key: string;
584
+ } | {
585
+ key: string;
586
+ path: string;
587
+ value: any;
588
+ originalValue: any;
589
+ label: string;
590
+ type: string;
591
+ };
592
+ uuid: (params: {
593
+ regex: RegExp;
594
+ } & MessageParams) => {
595
+ key: string;
596
+ } | {
597
+ key: string;
598
+ path: string;
599
+ value: any;
600
+ originalValue: any;
601
+ label: string;
602
+ type: string;
603
+ };
604
+ trim: (params: MessageParams) => {
605
+ key: string;
606
+ } | {
607
+ key: string;
608
+ path: string;
609
+ value: any;
610
+ originalValue: any;
611
+ label: string;
612
+ type: string;
613
+ };
614
+ lowercase: (params: MessageParams) => {
615
+ key: string;
616
+ } | {
617
+ key: string;
618
+ path: string;
619
+ value: any;
620
+ originalValue: any;
621
+ label: string;
622
+ type: string;
623
+ };
624
+ uppercase: (params: MessageParams) => {
625
+ key: string;
626
+ } | {
627
+ key: string;
628
+ path: string;
629
+ value: any;
630
+ originalValue: any;
631
+ label: string;
632
+ type: string;
633
+ };
634
+ };
635
+ number: {
636
+ min: (params: {
637
+ min: number;
638
+ } & MessageParams) => {
639
+ key: string;
640
+ } | {
641
+ key: string;
642
+ path: string;
643
+ value: any;
644
+ originalValue: any;
645
+ label: string;
646
+ type: string;
647
+ };
648
+ max: (params: {
649
+ max: number;
650
+ } & MessageParams) => {
651
+ key: string;
652
+ } | {
653
+ key: string;
654
+ path: string;
655
+ value: any;
656
+ originalValue: any;
657
+ label: string;
658
+ type: string;
659
+ };
660
+ lessThan: (params: {
661
+ less: number;
662
+ } & MessageParams) => {
663
+ key: string;
664
+ } | {
665
+ key: string;
666
+ path: string;
667
+ value: any;
668
+ originalValue: any;
669
+ label: string;
670
+ type: string;
671
+ };
672
+ moreThan: (params: {
673
+ more: number;
674
+ } & MessageParams) => {
675
+ key: string;
676
+ } | {
677
+ key: string;
678
+ path: string;
679
+ value: any;
680
+ originalValue: any;
681
+ label: string;
682
+ type: string;
683
+ };
684
+ positive: (params: {
685
+ more: number;
686
+ } & MessageParams) => {
687
+ key: string;
688
+ } | {
689
+ key: string;
690
+ path: string;
691
+ value: any;
692
+ originalValue: any;
693
+ label: string;
694
+ type: string;
695
+ };
696
+ negative: (params: {
697
+ less: number;
698
+ } & MessageParams) => {
699
+ key: string;
700
+ } | {
701
+ key: string;
702
+ path: string;
703
+ value: any;
704
+ originalValue: any;
705
+ label: string;
706
+ type: string;
707
+ };
708
+ integer: (params: MessageParams) => {
709
+ key: string;
710
+ } | {
711
+ key: string;
712
+ path: string;
713
+ value: any;
714
+ originalValue: any;
715
+ label: string;
716
+ type: string;
717
+ };
718
+ };
719
+ date: {
720
+ min: (params: {
721
+ min: Date | string;
722
+ } & MessageParams) => {
723
+ key: string;
724
+ } | {
725
+ key: string;
726
+ path: string;
727
+ value: any;
728
+ originalValue: any;
729
+ label: string;
730
+ type: string;
731
+ };
732
+ max: (params: {
733
+ max: Date | string;
734
+ } & MessageParams) => {
735
+ key: string;
736
+ } | {
737
+ key: string;
738
+ path: string;
739
+ value: any;
740
+ originalValue: any;
741
+ label: string;
742
+ type: string;
743
+ };
744
+ };
745
+ object: {
746
+ noUnknown: (params: MessageParams) => {
747
+ key: string;
748
+ } | {
749
+ key: string;
750
+ path: string;
751
+ value: any;
752
+ originalValue: any;
753
+ label: string;
754
+ type: string;
755
+ };
756
+ };
757
+ array: {
758
+ min: (params: {
759
+ min: number;
760
+ } & MessageParams) => {
761
+ key: string;
762
+ } | {
763
+ key: string;
764
+ path: string;
765
+ value: any;
766
+ originalValue: any;
767
+ label: string;
768
+ type: string;
769
+ };
770
+ max: (params: {
771
+ max: number;
772
+ } & MessageParams) => {
773
+ key: string;
774
+ } | {
775
+ key: string;
776
+ path: string;
777
+ value: any;
778
+ originalValue: any;
779
+ label: string;
780
+ type: string;
781
+ };
782
+ length: (params: {
783
+ length: number;
784
+ } & MessageParams) => {
785
+ key: string;
786
+ } | {
787
+ key: string;
788
+ path: string;
789
+ value: any;
790
+ originalValue: any;
791
+ label: string;
792
+ type: string;
793
+ };
794
+ };
795
+ boolean: {
796
+ isValue: (params: MessageParams) => {
797
+ key: string;
798
+ } | {
799
+ key: string;
800
+ path: string;
801
+ value: any;
802
+ originalValue: any;
803
+ label: string;
804
+ type: string;
805
+ };
806
+ };
807
+ };
808
+
809
+ export { ArrayType, BooleanType, DateType, DateValueAccessor, FieldErrorsComponent, FieldSchemaType, FileType, FormMessageService, FormsModule, Model, ModelSchema, ModelSchemaFactory, MzCheckboxGroup, MzField, MzForm, MzFormsModule, NgFormModelState, NgFormModelStateFactory, NumberType, ObjectType, StringType, YUP_DEFAULT_LOCALES, YUP_LOCALE_KEYS, buildArraySchema, buildBooleanSchema, buildDateSchema, buildNumberSchema, buildStringSchema, currencyOptions, equals, getMessage, integerOptions, length, max, maxLength, min, minLength, ofValues, pattern, phoneNumberOptions, required, ssnOptions, test };
810
+ export type { ArrayTypeAnnotations, BooleanSchema, BooleanTypeAnnotations, ConstraintAnnotations, DateSchema, DateTypeAnnotations, EqualsAnnotation, FieldError, FieldOption, FieldSchema, FileSchema, FileTypeAnnotations, LengthAnnotation, MaxLengthAnnotation, MaximumAnnotation, MinLengthAnnotation, MinimumAnnotation, ModelMetadata, ModelStateResult, NumberSchema, NumberTypeAnnotations, ObjectSchema, ObjectTypeAnnotations, OfValuesAnnotation, PatternAnnotation, RequiredAnnotation, SchemaDefinition, StringSchema, StringTypeAnnotations, StringTypeConstraints, TestAnnotation, ValidationAnnotation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muziehdesign/forms",
3
- "version": "20.0.0-beta.995",
3
+ "version": "20.0.0-next.1035",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",