@stemy/ngx-dynamic-form 19.3.1 → 19.3.3

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.
@@ -45,7 +45,11 @@ function defineFormControl(target, propertyKey, cb) {
45
45
  }
46
46
  function FormSerializable(serializer) {
47
47
  return (target, key) => {
48
- defineFormControl(target, key, () => ({ key, serializer, serialize: true }));
48
+ defineFormControl(target, key, () => ({
49
+ key,
50
+ serializer,
51
+ serialize: true
52
+ }));
49
53
  };
50
54
  }
51
55
  function FormInput(data) {
@@ -192,18 +196,21 @@ function getFieldByPath(field, path) {
192
196
  }
193
197
  return null;
194
198
  }
195
- function getFieldsByKey(field, key) {
196
- if (field.key === key) {
199
+ function getFieldsByPredicate(field, cb) {
200
+ if (cb(field)) {
197
201
  return [field];
198
202
  }
199
203
  if (!field.fieldGroup)
200
204
  return [];
201
205
  const results = [];
202
206
  for (const sf of field.fieldGroup) {
203
- results.push(...getFieldsByKey(sf, key));
207
+ results.push(...getFieldsByPredicate(sf, cb));
204
208
  }
205
209
  return results;
206
210
  }
211
+ function getFieldsByKey(field, key) {
212
+ return getFieldsByPredicate(field, f => f.key === key);
213
+ }
207
214
  function setFieldHidden(field, hidden = true) {
208
215
  const hide = field.expressions?.hide;
209
216
  if (hide) {
@@ -374,13 +381,22 @@ class DynamicFormBuilderService {
374
381
  createFieldSets(fields, parent, options) {
375
382
  const others = [];
376
383
  const groups = {};
384
+ fields = fields.filter(f => {
385
+ if (Array.isArray(f.fieldGroup) && Array.isArray(f.wrappers) && f.wrappers[0] === "form-fieldset") {
386
+ // This field is an already existing set
387
+ groups[f.id] = f.fieldGroup;
388
+ return false;
389
+ }
390
+ return true;
391
+ });
377
392
  for (const field of fields) {
378
393
  const fsName = field.hide ? null : String(field.fieldSet || "");
379
394
  // If we have a fieldset name defined and have actual fields for it
380
395
  // then push the property fields into a group
381
396
  if (fsName) {
382
- const group = groups[fsName] || [];
383
- groups[fsName] = group;
397
+ const fsId = !parent?.path ? fsName : `${parent.path}.${fsName}`;
398
+ const group = groups[fsId] || [];
399
+ groups[fsId] = group;
384
400
  group.push(field);
385
401
  continue;
386
402
  }
@@ -388,16 +404,20 @@ class DynamicFormBuilderService {
388
404
  others.push(field);
389
405
  }
390
406
  // Create a field-set wrapper for each group and concat the other fields to the end
391
- return Object.keys(groups).map(group => {
407
+ return Object.keys(groups).map(id => {
408
+ const key = id.split(".").pop();
392
409
  const fieldSet = {
393
- fieldGroup: groups[group],
410
+ id,
411
+ parent,
412
+ fieldGroup: groups[id],
394
413
  wrappers: ["form-fieldset"],
395
- className: `dynamic-form-fieldset dynamic-form-fieldset-${group}`,
396
- id: !parent?.path ? group : `${parent.path}.${group}`,
414
+ className: `dynamic-form-fieldset dynamic-form-fieldset-${id}`,
397
415
  props: {
398
- label: this.getLabel(group, group, parent, options),
416
+ label: this.getLabel(key, key, parent, options),
399
417
  hidden: false
400
- }
418
+ },
419
+ hooks: {},
420
+ expressions: {}
401
421
  };
402
422
  this.setExpressions(fieldSet, options);
403
423
  return fieldSet;
@@ -435,7 +455,7 @@ class DynamicFormBuilderService {
435
455
  groupBy: data.groupBy,
436
456
  allowEmpty: data.allowEmpty
437
457
  }, parent, options);
438
- select.hooks = {
458
+ select.hooks = Object.assign(select.hooks, {
439
459
  onInit: field => {
440
460
  const options = data.options?.(field) || [];
441
461
  const control = field.formControl.root;
@@ -444,7 +464,7 @@ class DynamicFormBuilderService {
444
464
  return this.fixSelectOptions(field, results);
445
465
  })) : options;
446
466
  }
447
- };
467
+ });
448
468
  return select;
449
469
  }
450
470
  createFormUpload(key, data, parent, options) {
@@ -500,6 +520,8 @@ class DynamicFormBuilderService {
500
520
  array.fieldArray = {
501
521
  wrappers: ["form-group"],
502
522
  fieldGroup: items,
523
+ hooks: {},
524
+ expressions: {}
503
525
  };
504
526
  return array;
505
527
  }
@@ -549,8 +571,7 @@ class DynamicFormBuilderService {
549
571
  const labelItems = ObjectUtils.isString(label)
550
572
  ? (!label ? [] : [labelPrefix, label])
551
573
  : [pathPrefix, `${key || ""}`];
552
- return options.labelCustomizer?.(key, label, parent, options.labelPrefix)
553
- ?? labelItems.filter(l => l.length > 0).join(".");
574
+ return labelItems.filter(l => l.length > 0).join(".");
554
575
  }
555
576
  createFormField(key, type, data, props, parent, options) {
556
577
  const validators = Array.isArray(data.validators)
@@ -579,12 +600,14 @@ class DynamicFormBuilderService {
579
600
  disabled: data.disabled === true,
580
601
  formCheck: "nolabel",
581
602
  required: !!validators.required,
582
- label: this.getLabel(key, data.label, parent, options),
603
+ label: options.labelCustomizer?.(key, data.label, parent, options.labelPrefix)
604
+ ?? this.getLabel(key, data.label, parent, options),
583
605
  },
584
606
  modelOptions: {
585
607
  updateOn: "change"
586
608
  },
587
609
  fieldGroupClassName: "field-container",
610
+ hooks: {},
588
611
  expressions: {
589
612
  hide,
590
613
  additional,
@@ -990,10 +1013,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
990
1013
 
991
1014
  class DynamicFormService {
992
1015
  fs;
1016
+ fb;
993
1017
  injector;
994
1018
  api;
995
- constructor(fs, injector, api) {
1019
+ constructor(fs, fb, injector, api) {
996
1020
  this.fs = fs;
1021
+ this.fb = fb;
997
1022
  this.injector = injector;
998
1023
  this.api = api;
999
1024
  }
@@ -1020,8 +1045,8 @@ class DynamicFormService {
1020
1045
  return config;
1021
1046
  // Add id fields if necessary
1022
1047
  const idFields = [
1023
- { key: "id", props: { hidden: true } },
1024
- { key: "_id", props: { hidden: true } },
1048
+ this.fb.createFormInput("id", { hidden: true }, null, wrapOptions),
1049
+ this.fb.createFormInput("_id", { hidden: true }, null, wrapOptions)
1025
1050
  ];
1026
1051
  fieldGroup.unshift(...idFields
1027
1052
  .filter(t => !fields.some(c => c.key == t.key)));
@@ -1121,12 +1146,12 @@ class DynamicFormService {
1121
1146
  }
1122
1147
  });
1123
1148
  }
1124
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService, deps: [{ token: DynamicFormSchemaService }, { token: i0.Injector }, { token: API_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
1149
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService, deps: [{ token: DynamicFormSchemaService }, { token: DynamicFormBuilderService }, { token: i0.Injector }, { token: API_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
1125
1150
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService });
1126
1151
  }
1127
1152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DynamicFormService, decorators: [{
1128
1153
  type: Injectable
1129
- }], ctorParameters: () => [{ type: DynamicFormSchemaService }, { type: i0.Injector }, { type: undefined, decorators: [{
1154
+ }], ctorParameters: () => [{ type: DynamicFormSchemaService }, { type: DynamicFormBuilderService }, { type: i0.Injector }, { type: undefined, decorators: [{
1130
1155
  type: Inject,
1131
1156
  args: [API_SERVICE]
1132
1157
  }] }] });
@@ -1241,6 +1266,9 @@ class DynamicFormComponent {
1241
1266
  language = toSignal(this.events.languageChanged, {
1242
1267
  initialValue: this.languages.currentLanguage
1243
1268
  });
1269
+ enableTranslations = toSignal(this.events.translationsEnabled, {
1270
+ initialValue: this.languages.enableTranslations
1271
+ });
1244
1272
  config = computed(() => {
1245
1273
  return this.fields() || this.builder.resolveFormFields(this.data()?.constructor, null, {
1246
1274
  labelPrefix: this.labelPrefix(),
@@ -1268,6 +1296,7 @@ class DynamicFormComponent {
1268
1296
  constructor() {
1269
1297
  effect(() => {
1270
1298
  this.language();
1299
+ this.enableTranslations();
1271
1300
  this.config().forEach(field => {
1272
1301
  if (!field.options)
1273
1302
  return;
@@ -1414,8 +1443,7 @@ class NgxDynamicFormModule {
1414
1443
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NgxDynamicFormModule, declarations: [DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormUploadComponent, AsyncSubmitDirective], imports: [CommonModule,
1415
1444
  FormsModule,
1416
1445
  ReactiveFormsModule,
1417
- NgxUtilsModule,
1418
- FormlyModule], exports: [DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormUploadComponent, AsyncSubmitDirective, FormsModule,
1446
+ NgxUtilsModule, i3.FormlyModule], exports: [DynamicFormComponent, DynamicFormArrayComponent, DynamicFormChipsComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormUploadComponent, AsyncSubmitDirective, FormsModule,
1419
1447
  ReactiveFormsModule,
1420
1448
  NgxUtilsModule,
1421
1449
  FormlyModule] });
@@ -1425,7 +1453,7 @@ class NgxDynamicFormModule {
1425
1453
  FormsModule,
1426
1454
  ReactiveFormsModule,
1427
1455
  NgxUtilsModule,
1428
- FormlyModule, FormsModule,
1456
+ FormlyModule.forChild(), FormsModule,
1429
1457
  ReactiveFormsModule,
1430
1458
  NgxUtilsModule,
1431
1459
  FormlyModule] });
@@ -1443,7 +1471,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
1443
1471
  FormsModule,
1444
1472
  ReactiveFormsModule,
1445
1473
  NgxUtilsModule,
1446
- FormlyModule
1474
+ FormlyModule.forChild()
1447
1475
  ],
1448
1476
  exports: [
1449
1477
  ...components,
@@ -1464,5 +1492,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
1464
1492
  * Generated bundle index. Do not edit.
1465
1493
  */
1466
1494
 
1467
- export { AsyncSubmitDirective, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormUploadComponent, EDITOR_FORMATS, FORM_ROOT_KEY, FormFile, FormGroup, FormInput, FormModel, FormSelect, FormSerializable, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, additionalFieldValues, customizeFormField, emailValidation, getFieldByPath, getFieldsByKey, jsonValidation, maxLengthValidation, maxValueValidation, minLengthValidation, minValueValidation, phoneValidation, replaceSpecialChars, requiredValidation, setFieldDisabled, setFieldHidden, translationValidation, validationMessage };
1495
+ export { AsyncSubmitDirective, DynamicFormArrayComponent, DynamicFormBuilderService, DynamicFormChipsComponent, DynamicFormComponent, DynamicFormFieldComponent, DynamicFormFieldsetComponent, DynamicFormGroupComponent, DynamicFormSchemaService, DynamicFormService, DynamicFormUploadComponent, EDITOR_FORMATS, FORM_ROOT_KEY, FormFile, FormGroup, FormInput, FormModel, FormSelect, FormSerializable, FormUpload, MAX_INPUT_NUM, MIN_INPUT_NUM, NgxDynamicFormModule, additionalFieldValues, customizeFormField, emailValidation, getFieldByPath, getFieldsByKey, getFieldsByPredicate, jsonValidation, maxLengthValidation, maxValueValidation, minLengthValidation, minValueValidation, phoneValidation, replaceSpecialChars, requiredValidation, setFieldDisabled, setFieldHidden, translationValidation, validationMessage };
1468
1496
  //# sourceMappingURL=stemy-ngx-dynamic-form.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"stemy-ngx-dynamic-form.mjs","sources":["../../src/ngx-dynamic-form/common-types.ts","../../src/ngx-dynamic-form/utils/customizer.ts","../../src/ngx-dynamic-form/utils/decorators.ts","../../src/ngx-dynamic-form/utils/validation.ts","../../src/ngx-dynamic-form/utils/misc.ts","../../src/ngx-dynamic-form/utils/internal.ts","../../src/ngx-dynamic-form/services/dynamic-form-builder.service.ts","../../src/ngx-dynamic-form/services/dynamic-form-schema.service.ts","../../src/ngx-dynamic-form/services/dynamic-form.service.ts","../../src/ngx-dynamic-form/directives/async-submit.directive.ts","../../src/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.ts","../../src/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.html","../../src/ngx-dynamic-form/components/dynamic-form-array/dynamic-form-array.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-array/dynamic-form-array.component.html","../../src/ngx-dynamic-form/components/dynamic-form-chips/dynamic-form-chips.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-chips/dynamic-form-chips.component.html","../../src/ngx-dynamic-form/components/dynamic-form-field/dynamic-form-field.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-field/dynamic-form-field.component.html","../../src/ngx-dynamic-form/components/dynamic-form-fieldset/dynamic-form-fieldset.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-fieldset/dynamic-form-fieldset.component.html","../../src/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.html","../../src/ngx-dynamic-form/components/dynamic-form-upload/dynamic-form-upload.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-upload/dynamic-form-upload.component.html","../../src/ngx-dynamic-form/ngx-dynamic-form.imports.ts","../../src/ngx-dynamic-form/ngx-dynamic-form.module.ts","../../src/stemy-ngx-dynamic-form.ts"],"sourcesContent":["import {Injector, OutputRef, Signal} from \"@angular/core\";\nimport {AbstractControl, FormControl, FormGroup} from \"@angular/forms\";\nimport {Observable} from \"rxjs\";\nimport {ConfigOption, FormlyFieldConfig, FormlyFieldProps} from \"@ngx-formly/core\";\nimport {FormlySelectOption} from \"@ngx-formly/core/select\";\nimport {\n IAsyncMessage,\n IOpenApiSchema,\n IOpenApiSchemaProperty,\n IRequestOptions,\n MaybeArray,\n MaybePromise\n} from \"@stemy/ngx-utils\";\n\n// --- Basic frm constants ---\nexport const FORM_ROOT_KEY = \"__root\";\n\n// --- Basic form types ---\n\nexport type DynamicFormState = \"VALID\" | \"INVALID\" | \"PENDING\" | \"DISABLED\" | \"LOADING\";\nexport type DynamicFormUpdateOn = \"change\" | \"blur\" | \"submit\";\nexport type UploadData = Record<string, any> | ArrayBuffer | FormData;\n\n// --- Basic form field interfaces ---\n\nexport type FormFieldLabelCustomizer = (key: string, label: string, parent: FormFieldConfig, labelPrefix: string) => string;\n\nexport interface FormBuilderOptions {\n labelPrefix?: string;\n labelCustomizer?: FormFieldLabelCustomizer;\n testId?: string;\n}\n\nexport interface FormFieldProps extends FormlyFieldProps {\n // --- Input props ---\n autocomplete?: string;\n suffix?: string;\n // --- Checkbox props ---\n formCheck?: string;\n indeterminate?: boolean;\n // --- Select props ---\n multiple?: boolean;\n allowEmpty?: boolean;\n groupBy?: string;\n // --- Array props ---\n useTabs?: boolean;\n tabsLabel?: string;\n addItem?: boolean;\n insertItem?: boolean;\n cloneItem?: boolean;\n moveItem?: boolean;\n removeItem?: boolean;\n clearItems?: boolean;\n // --- Upload props ---\n inline?: boolean;\n accept?: string | string[];\n url?: string;\n maxSize?: number;\n uploadOptions?: IRequestOptions;\n createUploadData?: (file: File) => UploadData | Promise<UploadData>;\n // --- Old upload props\n multi?: boolean;\n asFile?: boolean;\n uploadUrl?: string;\n}\n\nexport type FormFieldSerializer = (field: FormFieldConfig, injector: Injector) => MaybePromise<any>;\n\nexport declare type FormHookFn = (field: FormFieldConfig) => void;\n\nexport interface FormHookConfig {\n onInit?: FormHookFn | ((field: FormFieldConfig) => Observable<any>);\n onChanges?: FormHookFn;\n afterContentInit?: FormHookFn;\n afterViewInit?: FormHookFn;\n onDestroy?: FormHookFn;\n}\n\nexport type FormFieldExpression<T = any> = string | ((field: FormFieldConfig) => T) | Observable<T>;\nexport type FormFieldExpressions = {\n [property: string]: FormFieldExpression;\n} & {\n className?: FormFieldExpression<string>;\n hide?: FormFieldExpression<boolean>;\n \"props.disabled\"?: FormFieldExpression<boolean>;\n \"props.required\"?: FormFieldExpression<boolean>;\n};\n\nexport interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T> {\n serializer?: FormFieldSerializer;\n serialize?: boolean;\n fieldSet?: string;\n parent?: FormFieldConfig;\n fieldGroup?: FormFieldConfig[];\n fieldArray?: FormFieldConfig | ((field: FormFieldConfig) => FormFieldConfig);\n hooks?: FormHookConfig;\n expressions?: FormFieldExpressions;\n readonly additional?: Readonly<{[key: string]: any}>;\n readonly path?: string;\n readonly testId?: string;\n}\n\nexport interface FormFieldType<T = FormFieldProps> extends FormFieldConfig<T> {\n formControl: FormControl;\n props: NonNullable<T>;\n}\n\nexport interface FormFieldChangeEvent {\n field: FormFieldConfig;\n type: string;\n value: any;\n [meta: string]: any;\n}\n\nexport interface FormSerializeResult {\n [key: string]: any;\n}\n\nexport interface FormSelectOption extends FormlySelectOption {\n className?: string;\n classes?: string[] | string;\n id?: any;\n}\n\nexport type FormSelectOptions = FormSelectOption[] | Observable<FormSelectOption[]>;\n\nexport interface IDynamicForm {\n\n readonly fieldChanges: Observable<FormFieldChangeEvent>;\n readonly config: Signal<FormFieldConfig[]>;\n readonly group: Signal<FormGroup>;\n readonly status: Signal<DynamicFormState>;\n readonly onSubmit: OutputRef<IDynamicForm>;\n\n reset(): void;\n}\n\n// --- Validation types ---\n\ntype FormFieldValidatorFn<T> = ((control: AbstractControl, field?: FormlyFieldConfig) => T) & {\n validatorName?: string\n};\n\nexport type ValidationMessageFn = (error: any, field: FormFieldConfig) => string | Observable<string>;\n\ninterface FormFieldValidatorExpression<T> {\n expression: FormFieldValidatorFn<T>;\n message: ValidationMessageFn;\n}\n\ntype FormFieldValidation<T, R> = {\n validation?: (string | T)[];\n} & {\n [key: string]: FormFieldValidatorFn<R> | FormFieldValidatorExpression<R>;\n}\n\nexport type ValidatorFn = FormFieldValidatorFn<boolean>;\n\nexport type ValidatorExpression = FormFieldValidatorExpression<boolean>;\n\nexport type Validators = FormFieldValidation<ValidatorFn, boolean>;\n\nexport type AsyncBoolean = Promise<boolean> | Observable<boolean>;\n\nexport type AsyncValidatorFn = FormFieldValidatorFn<AsyncBoolean>;\n\nexport type AsyncValidatorExpression = FormFieldValidatorExpression<AsyncBoolean>;\n\nexport type AsyncValidators = FormFieldValidation<AsyncValidatorFn, AsyncBoolean>;\n\nexport interface AllValidationErrors {\n control: AbstractControl;\n path: string;\n errorKey: string;\n errorValue: any;\n}\n\n// --- Form field data types ---\n\nexport type FormFieldCustom = Pick<FormFieldConfig, \"wrappers\" | \"hooks\" | \"fieldGroup\" | \"fieldArray\">;\n\nexport type FormFieldData = Pick<FormFieldProps, \"label\" | \"readonly\" | \"hidden\" | \"disabled\">\n & {\n validators?: Validators | ValidatorFn[];\n serializer?: FormFieldSerializer;\n fieldSet?: string;\n classes?: string[] | string;\n};\n\nexport type FormInputData = FormFieldData\n & Pick<FormFieldProps, \"type\" | \"pattern\" | \"placeholder\" | \"step\" | \"min\" | \"max\" | \"minLength\" | \"maxLength\" | \"autocomplete\" | \"suffix\" | \"indeterminate\" | \"cols\" | \"rows\">;\n\nexport type FormSelectData = FormFieldData\n & Pick<FormFieldProps, \"multiple\" | \"type\" | \"allowEmpty\" | \"groupBy\"> & {\n options?: (field: FormFieldConfig) => FormSelectOptions | Promise<FormSelectOption[]>;\n};\n\nexport type FormUploadData = FormFieldData\n & Pick<FormFieldProps, \"inline\" | \"multiple\" | \"accept\" | \"url\" | \"maxSize\" | \"uploadOptions\" | \"createUploadData\" | \"multi\" | \"asFile\" | \"uploadUrl\">;\n\nexport type FormGroupData = FormFieldData;\n\nexport type FormArrayData = FormFieldData\n & Pick<FormFieldProps, \"useTabs\" | \"tabsLabel\" | \"addItem\" | \"insertItem\" | \"cloneItem\" | \"moveItem\" | \"removeItem\" | \"clearItems\">;\n\n// --- JSON schema interfaces ---\n\nexport type FormFieldCustomizer = (\n field: FormFieldConfig, options: FormBuilderOptions, injector: Injector,\n property: IOpenApiSchemaProperty, schema: IOpenApiSchema\n) => MaybePromise<MaybeArray<FormFieldConfig>>;\n\nexport interface ConfigForSchemaOptions extends FormBuilderOptions {\n fieldCustomizer?: FormFieldCustomizer;\n}\n\nexport type CustomizerOrSchemaOptions = FormFieldCustomizer | ConfigForSchemaOptions;\n\nexport declare type AsyncSubmitMethod = (form: IDynamicForm, context?: any) => Promise<IAsyncMessage>;\n\nexport interface IDynamicFormModuleConfig extends Pick<ConfigOption, \"types\" | \"wrappers\" | \"extras\"> {\n\n}\n","import {\n cachedFactory,\n CachedProvider,\n IOpenApiSchema,\n IOpenApiSchemaProperty,\n MaybeArray,\n MaybePromise\n} from \"@stemy/ngx-utils\";\n\nimport {FormBuilderOptions, FormFieldConfig, FormFieldCustomizer} from \"../common-types\";\n\nexport interface IFormFieldCustomizer {\n acceptField(\n field: FormFieldConfig,\n property: IOpenApiSchemaProperty,\n schema: IOpenApiSchema\n ): boolean;\n customizeField(\n field: FormFieldConfig,\n options: FormBuilderOptions,\n property: IOpenApiSchemaProperty,\n schema: IOpenApiSchema\n ): MaybePromise<MaybeArray<FormFieldConfig>>;\n}\n\nexport function customizeFormField(...providers: CachedProvider<IFormFieldCustomizer>[]): FormFieldCustomizer {\n const factory = cachedFactory(providers);\n return async (field, options, injector, property, schema) => {\n const customizers = factory(injector);\n const fields = [field];\n for (const customizer of customizers) {\n const index = fields.findIndex(m => customizer.acceptField(m, property, schema));\n if (index >= 0) {\n const custom = await customizer.customizeField(\n fields[index], options, property, schema\n );\n const result = Array.isArray(custom) ? custom : [custom];\n fields.splice(index, 1, ...result);\n }\n }\n return fields;\n }\n}\n","import {ObjectUtils, ReflectUtils} from \"@stemy/ngx-utils\";\nimport {\n FormArrayData,\n FormFieldSerializer,\n FormGroupData,\n FormInputData,\n FormSelectData,\n FormUploadData\n} from \"../common-types\";\nimport {FormFieldBuilder} from \"../services/dynamic-form-builder.service\";\nimport {Type} from \"@angular/core\";\n\nfunction defineFormControl(target: any, propertyKey: string, cb: FormFieldBuilder): void {\n const fields: Set<string> = ReflectUtils.getMetadata(\"dynamicFormFields\", target) || new Set();\n const existing: FormFieldBuilder = ReflectUtils.getMetadata(\"dynamicFormField\", target, propertyKey);\n const builder: FormFieldBuilder = !ObjectUtils.isFunction(existing) ? cb : ((fb, opts, path) => {\n const data = existing(fb, opts, path);\n return ObjectUtils.assign(data || {}, cb(fb, opts, path) || {});\n });\n fields.add(propertyKey);\n ReflectUtils.defineMetadata(\"dynamicFormField\", builder, target, propertyKey);\n ReflectUtils.defineMetadata(\"dynamicFormFields\", fields, target);\n}\n\nexport function FormSerializable(serializer?: FormFieldSerializer): PropertyDecorator {\n return (target: any, key: string): void => {\n defineFormControl(target, key, () => ({key, serializer, serialize: true}));\n };\n}\n\nexport function FormInput(data?: FormInputData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n const meta = ReflectUtils.getOwnMetadata(\"design:type\", target, key);\n const type = meta ? meta.name : \"\";\n let inputType = key.indexOf(\"password\") < 0 ? \"text\" : \"password\";\n switch (type) {\n case \"Number\":\n inputType = \"number\";\n break;\n case \"Boolean\":\n inputType = \"checkbox\";\n break;\n }\n data.type = data.type || inputType;\n defineFormControl(\n target, key,\n (fb, path, options) =>\n fb.createFormInput(key, data, path, options)\n );\n };\n}\n\nexport function FormSelect(data?: FormSelectData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) =>\n fb.createFormSelect(key, data, path, options)\n );\n };\n}\n\nexport function FormUpload(data?: FormUploadData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) =>\n fb.createFormUpload(key, data, path, options)\n );\n };\n}\n\nexport function FormFile(data?: FormUploadData): PropertyDecorator {\n console.warn(`@FormFile decorator is deprecated, use @FormUpload instead`);\n return FormUpload(data);\n}\n\nexport function FormGroup(data?: FormGroupData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) => {\n const targetType = ReflectUtils.getOwnMetadata(\"design:type\", target, key);\n return fb.resolveFormGroup(key, targetType, data, path, options);\n }\n );\n };\n}\n\nexport function FormArray(itemType: string | FormInputData | Type<any>, data?: FormArrayData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) => {\n return fb.resolveFormArray(key, itemType, data, path, options);\n }\n );\n };\n}\n\nexport function FormModel(data?: FormGroupData): PropertyDecorator {\n console.warn(`@FormModel decorator is deprecated, use @FormGroup instead`);\n return FormGroup(data);\n}\n","import {Injector} from \"@angular/core\";\nimport {LANGUAGE_SERVICE, ObjectUtils} from \"@stemy/ngx-utils\";\nimport {ValidationMessageFn, ValidatorFn} from \"../common-types\";\n\nexport function validationMessage(injector: Injector, key: string, labelPrefix?: string): ValidationMessageFn {\n const language = injector.get(LANGUAGE_SERVICE);\n return (_, field) => {\n return language.getTranslationSync(labelPrefix ? `${labelPrefix}.error.${key}` : `error.${key}`, field);\n }\n}\n\nexport function withName(fn: ValidatorFn, name: string): ValidatorFn {\n fn.validatorName = name;\n return fn;\n}\n\nfunction validateEach(each: boolean, cb: (value: any) => boolean, name: string): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n return each ? Array.isArray(value) && value.every(cb) : cb(value);\n }, name);\n}\n\nexport function jsonValidation(): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n if (!value) return false;\n try {\n JSON.parse(value);\n return true;\n } catch (e) {\n return false;\n }\n }, \"json\");\n}\n\nexport function requiredValidation(): ValidatorFn {\n return withName((control) =>\n ObjectUtils.isString(control.value) ? control.value.length > 0 : ObjectUtils.isDefined(control.value),\n \"required\"\n )\n}\n\nexport function translationValidation(langs: string[] = [\"de\", \"en\"]): ValidatorFn {\n return withName((control) => {\n const value: any[] = control.value;\n if (!value || value.length == 0) return false;\n return value.findIndex(t => langs.includes(t.lang) && !t.translation) < 0;\n }, \"translation\");\n}\n\nexport function phoneValidation(): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n if (!value) return true;\n const phoneRegexp = /^\\d{10,12}$/;\n return phoneRegexp.test(value);\n }, \"phone\");\n}\n\nexport function emailValidation(): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n if (!value) return true;\n const emailRegexp = /^[\\w-.]+@([\\w-]+\\.)+[\\w-]{2,4}$/g;\n return emailRegexp.test(value);\n }, \"email\");\n}\n\nexport function minLengthValidation(minLength: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"string\" && v.length >= minLength, \"minLength\");\n}\n\nexport function maxLengthValidation(maxLength: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"string\" && v.length <= maxLength, \"maxLength\");\n}\n\nexport function minValueValidation(min: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"number\" && v >= min, \"minValue\");\n}\n\nexport function maxValueValidation(max: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"number\" && v <= max, \"maxValue\");\n}\n","import {ObjectUtils} from \"@stemy/ngx-utils\";\nimport {BehaviorSubject, Subject} from \"rxjs\";\nimport {FormFieldConfig} from \"../common-types\";\n\nexport function replaceSpecialChars(str: string, to: string = \"-\"): string {\n return `${str}`.replace(/[&\\/\\\\#, +()$~%.@'\":*?<>{}]/g, to);\n}\n\nexport function getFieldByPath(field: FormFieldConfig, path: string): FormFieldConfig | null {\n if (field.path === path) {\n return field;\n }\n if (!field.fieldGroup) return null;\n for (const sf of field.fieldGroup) {\n const found = getFieldByPath(sf, path);\n if (found) return found;\n }\n return null;\n}\n\nexport function getFieldsByKey(field: FormFieldConfig, key: string): FormFieldConfig[] {\n if (field.key === key) {\n return [field];\n }\n if (!field.fieldGroup) return [];\n const results: FormFieldConfig[] = [];\n for (const sf of field.fieldGroup) {\n results.push(...getFieldsByKey(sf, key));\n }\n return results;\n}\n\nexport function setFieldHidden(field: FormFieldConfig, hidden: boolean = true): void {\n const hide = field.expressions?.hide;\n if (hide) {\n if (hide instanceof Subject) {\n hide.next(hidden);\n return;\n }\n field.expressions.hide = new BehaviorSubject(hidden);\n return;\n }\n field.hide = hidden;\n}\n\nexport function setFieldDisabled(field: FormFieldConfig, disabled: boolean = true): void {\n field.props = {\n ...(field.props || {}),\n disabled\n };\n}\n\nexport function additionalFieldValues(field: FormFieldConfig, values: {[key: string]: any}): void {\n const additional = field.expressions?.additional;\n if (additional instanceof BehaviorSubject) {\n additional.next(ObjectUtils.assign(additional.value, values || {}));\n return;\n }\n field.expressions.additional = new BehaviorSubject(values || {});\n}\n\nexport const MIN_INPUT_NUM = -999999999;\n\nexport const MAX_INPUT_NUM = 999999999;\n\nexport const EDITOR_FORMATS = [\"php\", \"json\", \"html\", \"css\", \"scss\"];\n","import {Injector} from \"@angular/core\";\r\nimport {IOpenApiSchema, IOpenApiSchemaProperty, MaybeArray, ObjectUtils, ForbiddenZone} from \"@stemy/ngx-utils\";\r\nimport {\r\n AllValidationErrors,\r\n ConfigForSchemaOptions,\r\n CustomizerOrSchemaOptions,\r\n FormBuilderOptions,\r\n FormFieldConfig,\r\n FormFieldCustomizer\r\n} from \"../common-types\";\r\nimport {AbstractControl, FormArray, FormGroup} from \"@angular/forms\";\r\n\r\nexport type ConfigForSchemaWrapMode = \"wrap\" | \"customizer\";\r\n\r\nexport interface ConfigForSchemaWrapOptions extends Required<FormBuilderOptions> {\r\n readonly injector: Injector;\r\n readonly schema: IOpenApiSchema;\r\n customize(field: FormFieldConfig, property: IOpenApiSchemaProperty, schema: IOpenApiSchema): Promise<FormFieldConfig[]>;\r\n}\r\n\r\nclass ConfigForSchemaWrap implements ConfigForSchemaWrapOptions {\r\n\r\n get labelPrefix() {\r\n return this.opts.labelPrefix;\r\n }\r\n\r\n get labelCustomizer() {\r\n return this.opts.labelCustomizer;\r\n }\r\n\r\n get testId() {\r\n return this.opts.testId;\r\n }\r\n\r\n protected fieldCustomizer: FormFieldCustomizer;\r\n\r\n constructor(\r\n protected readonly opts: ConfigForSchemaOptions,\r\n protected readonly mode: ConfigForSchemaWrapMode,\r\n readonly injector: Injector,\r\n readonly schema: IOpenApiSchema\r\n ) {\r\n this.fieldCustomizer = this.mode !== \"wrap\" || !ObjectUtils.isFunction(this.opts.fieldCustomizer)\r\n ? field => field\r\n : this.opts.fieldCustomizer;\r\n }\r\n\r\n async customize(field: FormFieldConfig, property: IOpenApiSchemaProperty, schema: IOpenApiSchema) {\r\n field.defaultValue = `${field.props?.type}`.startsWith(\"date\")\r\n ? convertToDate(property.default) : property.default;\r\n const res = await ForbiddenZone.run(\"customizer\", () =>\r\n this.fieldCustomizer(\r\n field, this.forCustomizer(), this.injector,\r\n property, schema\r\n )\r\n );\r\n return !res ? [field] : handleConfigs(res);\r\n }\r\n\r\n forCustomizer(): FormBuilderOptions {\r\n return new ConfigForSchemaWrap(this.opts, \"customizer\", this.injector, this.schema);\r\n }\r\n\r\n forSchema(schema: IOpenApiSchema): ConfigForSchemaWrapOptions {\r\n return new ConfigForSchemaWrap(this.opts, this.mode, this.injector, schema);\r\n }\r\n}\r\n\r\nexport async function toWrapOptions(customizeOrOptions: CustomizerOrSchemaOptions | ConfigForSchemaWrapOptions,\r\n injector: Injector,\r\n schema: IOpenApiSchema,\r\n errorMsg?: string): Promise<ConfigForSchemaWrapOptions> {\r\n if (errorMsg && ForbiddenZone.isForbidden(\"customizer\")) {\r\n throw new Error(errorMsg);\r\n }\r\n if (customizeOrOptions instanceof ConfigForSchemaWrap) {\r\n return customizeOrOptions;\r\n }\r\n let schemaOptions = customizeOrOptions as ConfigForSchemaOptions;\r\n if (!ObjectUtils.isObject(schemaOptions)) {\r\n schemaOptions = {\r\n fieldCustomizer: customizeOrOptions as FormFieldCustomizer\r\n };\r\n }\r\n return new ConfigForSchemaWrap(schemaOptions, \"wrap\", injector, schema);\r\n}\r\n\r\nexport function convertToDate(value: any): any {\r\n if (ObjectUtils.isNullOrUndefined(value)) return null;\r\n const date = ObjectUtils.isDate(value)\r\n ? value\r\n : new Date(value);\r\n return isNaN(date as any) ? new Date() : date;\r\n}\r\n\r\nexport function handleConfigs(configs: MaybeArray<FormFieldConfig>) {\r\n return Array.isArray(configs) ? configs : [configs];\r\n}\r\n\r\nexport function isStringWithVal(val: any): boolean {\r\n return typeof val == \"string\" && val.length > 0;\r\n}\r\n\r\nexport function findRefs(property: IOpenApiSchemaProperty): string[] {\r\n const refs = Array.isArray(property.allOf)\r\n ? property.allOf.map(o => o.$ref).filter(isStringWithVal)\r\n : [property.items?.$ref, property.$ref].filter(isStringWithVal);\r\n return refs.map(t => t.split(\"/\").pop());\r\n}\r\n\r\nexport function mergeFormFields(formFields: FormFieldConfig[][]): FormFieldConfig[] {\r\n const res: FormFieldConfig[] = [];\r\n for (const formModel of formFields) {\r\n for (const subModel of formModel) {\r\n const index = res.findIndex(t => t.key == subModel.key);\r\n if (index >= 0) {\r\n res[index] = subModel;\r\n continue;\r\n }\r\n res.push(subModel);\r\n }\r\n }\r\n return res;\r\n}\r\n\r\ninterface FormGroupControls {\r\n [key: string]: AbstractControl;\r\n}\r\n\r\nexport function getFormValidationErrors(controls: FormGroupControls, parentPath: string = \"\"): AllValidationErrors[] {\r\n const errors: AllValidationErrors[] = [];\r\n Object.entries(controls).forEach(([name, control], ix) => {\r\n const path = !parentPath ? name : `${parentPath}.${name}`;\r\n if (control instanceof FormGroup) {\r\n getFormValidationErrors(control.controls, path).forEach(error => errors.push(error));\r\n return;\r\n }\r\n if (control instanceof FormArray) {\r\n control.controls.forEach((control: FormGroup, ix) => {\r\n getFormValidationErrors(control.controls, `${path}.${ix}`).forEach(error => errors.push(error));\r\n });\r\n return;\r\n }\r\n Object.entries(control.errors || {}).forEach(([errorKey, errorValue]) => {\r\n errors.push({control, path, errorKey, errorValue});\r\n });\r\n });\r\n return errors;\r\n}\r\n","import {Inject, Injectable, Injector, Type} from \"@angular/core\";\nimport {BehaviorSubject, distinctUntilChanged, startWith, switchMap} from \"rxjs\";\nimport {\n API_SERVICE,\n IApiService,\n ILanguageService,\n LANGUAGE_SERVICE,\n MaybePromise,\n ObjectUtils,\n ReflectUtils\n} from \"@stemy/ngx-utils\";\n\nimport {\n FormArrayData,\n FormBuilderOptions,\n FormFieldConfig,\n FormFieldData,\n FormFieldExpressions,\n FormFieldProps,\n FormGroupData,\n FormInputData,\n FormSelectData,\n FormSelectOption,\n FormUploadData,\n Validators\n} from \"../common-types\";\nimport {validationMessage} from \"../utils/validation\";\nimport {MAX_INPUT_NUM, MIN_INPUT_NUM} from \"../utils/misc\";\nimport {isStringWithVal} from \"../utils/internal\";\n\nexport type FormFieldBuilder = (fb: DynamicFormBuilderService, parent: FormFieldConfig, options: FormBuilderOptions) => FormFieldConfig;\n\n@Injectable()\nexport class DynamicFormBuilderService {\n\n constructor(readonly injector: Injector,\n @Inject(API_SERVICE) readonly api: IApiService,\n @Inject(LANGUAGE_SERVICE) readonly language: ILanguageService) {\n }\n\n resolveFormFields(target: Type<any>, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig[] {\n const prototype = target?.prototype || {};\n const fields: Set<string> = ReflectUtils.getMetadata(\"dynamicFormFields\", target?.prototype || {}) || new Set();\n const result: FormFieldConfig[] = [];\n for (const key of fields) {\n const builder: FormFieldBuilder = ReflectUtils.getMetadata(\"dynamicFormField\", prototype, key);\n const field = builder(this, parent, options);\n if (field) {\n result.push(field);\n }\n }\n return this.createFieldSets(result, parent, options);\n }\n\n resolveFormGroup(key: string, target: Type<any>, data: FormGroupData, parent: FormFieldConfig = null, options: FormBuilderOptions = {}): FormFieldConfig {\n return this.createFormGroup(key, sp => this.resolveFormFields(\n target, sp, options\n ), data, parent, options);\n }\n\n resolveFormArray(key: string, itemType: string | FormInputData | Type<any>, data: FormArrayData, parent: FormFieldConfig = null, options: FormBuilderOptions = {}): FormFieldConfig {\n return this.createFormArray(key, sp => {\n return typeof itemType === \"function\" ? this.resolveFormFields(\n itemType, sp, options\n ) : this.createFormInput(\"\", typeof itemType === \"string\" ? {type: `${itemType}`} : itemType, null, options);\n }, data, parent, options);\n }\n\n createFieldSets(fields: FormFieldConfig[], parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig[] {\n const others: FormFieldConfig[] = [];\n const groups: { [fs: string]: FormFieldConfig[] } = {};\n\n for (const field of fields) {\n const fsName = field.hide ? null : String(field.fieldSet || \"\");\n // If we have a fieldset name defined and have actual fields for it\n // then push the property fields into a group\n if (fsName) {\n const group = groups[fsName] || [];\n groups[fsName] = group;\n group.push(field);\n continue;\n }\n // Otherwise just push the fields to the others\n others.push(field);\n }\n\n // Create a field-set wrapper for each group and concat the other fields to the end\n return Object.keys(groups).map(group => {\n const fieldSet: FormFieldConfig = {\n fieldGroup: groups[group],\n wrappers: [\"form-fieldset\"],\n className: `dynamic-form-fieldset dynamic-form-fieldset-${group}`,\n id: !parent?.path ? group : `${parent.path}.${group}`,\n props: {\n label: this.getLabel(group, group, parent, options),\n hidden: false\n }\n };\n this.setExpressions(fieldSet, options);\n return fieldSet;\n }).concat(others);\n }\n\n createFormInput(key: string, data: FormInputData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n data = data || {};\n const type = `${data.type || \"text\"}`;\n const autocomplete = data.autocomplete || (type === \"password\" ? \"new-password\" : \"none\");\n return this.createFormField(key, type === \"checkbox\" || type === \"textarea\" ? type : \"input\", data, {\n type,\n autocomplete,\n pattern: ObjectUtils.isString(data.pattern) ? data.pattern : \"\",\n step: data.step,\n cols: data.cols || null,\n rows: data.rows || 10,\n min: isNaN(data.min) ? MIN_INPUT_NUM : data.min,\n max: isNaN(data.max) ? MAX_INPUT_NUM : data.max,\n minLength: isNaN(data.minLength) ? 0 : data.minLength,\n maxLength: isNaN(data.maxLength) ? MAX_INPUT_NUM : data.maxLength,\n placeholder: data.placeholder || \"\",\n indeterminate: data.indeterminate || false,\n suffix: data.suffix || \"\",\n attributes: {\n autocomplete\n },\n }, parent, options);\n }\n\n createFormSelect(key: string, data: FormSelectData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n data = data || {};\n const type = `${data.type || \"select\"}`;\n const select = this.createFormField(key, type === \"radio\" ? type : \"select\", data, {\n type,\n multiple: data.multiple,\n groupBy: data.groupBy,\n allowEmpty: data.allowEmpty\n }, parent, options);\n select.hooks = {\n onInit: field => {\n const options = data.options?.(field) || [];\n const control = field.formControl.root;\n field.props.options = options instanceof Promise ? control.valueChanges.pipe(\n startWith(control.value),\n distinctUntilChanged(),\n switchMap(async () => {\n const results: FormSelectOption[] = await data.options(field) as any;\n return this.fixSelectOptions(field, results);\n })\n ) : options;\n }\n };\n return select;\n }\n\n createFormUpload(key: string, data: FormUploadData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n data = data || {};\n\n if (data.asFile) {\n data.inline = true;\n console.warn(`File upload property \"asFile\" is deprecated. Use \"inline\" instead.`);\n }\n\n if (data.multi) {\n data.multiple = true;\n console.warn(`File upload property \"multi\" is deprecated. Use \"multiple\" instead.`);\n }\n\n return this.createFormField(key, \"upload\", data, {\n inline: data.inline === true,\n multiple: data.multiple === true,\n accept: data.accept || [\".png\", \".jpg\"],\n url: data.url?.startsWith(\"http\") ? data.url : this.api.url(data.url || \"assets\"),\n maxSize: isNaN(data.maxSize) ? MAX_INPUT_NUM : data.maxSize,\n uploadOptions: data.uploadOptions || {},\n createUploadData: data.createUploadData\n }, parent, options);\n }\n\n createFormGroup(key: string, fields: (parent: FormFieldConfig) => FormFieldConfig[], data: FormGroupData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig\n createFormGroup(key: string, fields: (parent: FormFieldConfig) => Promise<FormFieldConfig[]>, data: FormGroupData, parent: FormFieldConfig, options: FormBuilderOptions): Promise<FormFieldConfig>\n createFormGroup(key: string, fields: (parent: FormFieldConfig) => any, data: FormGroupData, parent: FormFieldConfig, options: FormBuilderOptions): MaybePromise<FormFieldConfig> {\n data = data || {};\n const group = this.createFormField(key, undefined, data, {}, parent, options);\n group.wrappers = [\"form-group\"];\n const result = fields(group);\n const handleGroup = (fieldGroup: FormFieldConfig[]) => {\n group.fieldGroup = fieldGroup;\n return group;\n };\n return result instanceof Promise\n ? result.then(handleGroup)\n : handleGroup(result);\n }\n\n createFormArray(key: string, fields: (parent: FormFieldConfig) => FormFieldConfig | FormFieldConfig[], data: FormArrayData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig\n createFormArray(key: string, fields: (parent: FormFieldConfig) => Promise<FormFieldConfig | FormFieldConfig[]>, data: FormArrayData, parent: FormFieldConfig, options: FormBuilderOptions): Promise<FormFieldConfig>\n createFormArray(key: string, fields: (parent: FormFieldConfig) => any, data: FormArrayData, parent: FormFieldConfig, options: FormBuilderOptions): MaybePromise<FormFieldConfig> {\n data = data || {};\n const array = this.createFormField(key, \"array\", data, {\n // initialCount: data.initialCount || 0,\n // sortable: data.sortable || false,\n useTabs: data.useTabs === true,\n tabsLabel: `${data.tabsLabel || \"label\"}`,\n addItem: data.addItem !== false,\n insertItem: data.insertItem !== false,\n cloneItem: data.cloneItem !== false,\n moveItem: data.moveItem !== false,\n removeItem: data.removeItem !== false,\n clearItems: data.clearItems !== false\n }, parent, options);\n const result = fields(array);\n const handleItems = (items: FormFieldConfig | FormFieldConfig[]) => {\n if (Array.isArray(items)) {\n array.fieldArray = {\n wrappers: [\"form-group\"],\n fieldGroup: items,\n };\n return array;\n }\n const props = items.props || {};\n if (props.type === \"text\" || props.type === \"number\") {\n array.type = \"chips\";\n array.wrappers = [\"form-field\"];\n array.props = {\n ...props,\n ...array.props,\n multiple: true\n };\n return array;\n }\n array.fieldArray = {\n ...items,\n props: {\n ...items.props,\n label: \"\"\n }\n };\n return array;\n };\n return result instanceof Promise\n ? result.then(handleItems)\n : handleItems(result);\n }\n\n async fixSelectOptions(field: FormFieldConfig, options: FormSelectOption[]): Promise<FormSelectOption[]> {\n if (!options) return [];\n for (const option of options) {\n const classes = Array.isArray(option.classes) ? option.classes : [`${option.classes}`];\n option.className = classes.filter(isStringWithVal).join(\" \");\n option.label = await this.language.getTranslation(option.label);\n option.value = option.value ?? option.id;\n option.id = option.id ?? option.value;\n }\n const control = field.formControl;\n if (field.props.multiple || options.length === 0 || options.findIndex(o => o.value === control.value) >= 0) return options;\n control.setValue(options[0].value);\n return options;\n }\n\n protected getLabel(key: string, label: string, parent: FormFieldConfig, options: FormBuilderOptions): string {\n const labelPrefix = !ObjectUtils.isString(options.labelPrefix) ? `` : options.labelPrefix;\n const pathPrefix = `${parent?.props?.label || labelPrefix}`;\n const labelItems = ObjectUtils.isString(label)\n ? (!label ? [] : [labelPrefix, label])\n : [pathPrefix, `${key || \"\"}`]\n return options.labelCustomizer?.(key, label, parent, options.labelPrefix)\n ?? labelItems.filter(l => l.length > 0).join(\".\");\n }\n\n protected createFormField(key: string, type: string, data: FormFieldData, props: FormFieldProps, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n const validators = Array.isArray(data.validators)\n ? data.validators.reduce((res, validator, ix) => {\n res[validator.validatorName || `validator_${ix}`] = validator;\n return res;\n }, {} as Validators)\n : data.validators || {};\n const hide = new BehaviorSubject(data.hidden === true);\n const additional = new BehaviorSubject({});\n const field: FormFieldConfig = {\n key,\n type,\n validators,\n parent,\n fieldSet: String(data.fieldSet || \"\"),\n resetOnHide: false,\n validation: {\n messages: Object.keys(validators).reduce((res, key) => {\n res[key] = validationMessage(this.injector, key, options.labelPrefix);\n return res;\n }, {})\n },\n props: {\n ...props,\n disabled: data.disabled === true,\n formCheck: \"nolabel\",\n required: !!validators.required,\n label: this.getLabel(key, data.label, parent, options),\n },\n modelOptions: {\n updateOn: \"change\"\n },\n fieldGroupClassName: \"field-container\",\n expressions: {\n hide,\n additional,\n className: (target: FormFieldConfig) => {\n return target.hide ? `` : [`dynamic-form-field`, `dynamic-form-field-${target.key}`, `dynamic-form-${target.type || \"group\"}`].concat(\n Array.isArray(data.classes) ? data.classes : [data.classes || \"\"]\n ).filter(c => c?.length > 0).join(\" \");\n }\n }\n };\n this.setExpressions(field, options);\n return field;\n }\n\n protected setExpressions(field: FormFieldConfig, options: FormBuilderOptions): void {\n const expressions: FormFieldExpressions = {\n path: target => {\n const tp = target.parent;\n const key = !target.key ? `` : `.${target.key}`;\n return !tp?.path ? `${target.key || \"\"}` : `${tp.path}.${key}`;\n },\n testId: target => {\n const tp = target.parent;\n const prefix = !options.testId ? `` : `${options.testId}-`;\n const key = !target.key ? `` : `-${target.key}`;\n return !tp?.testId ? `${prefix}${target.key || key}` : `${tp.testId}${key}`;\n }\n };\n Object.entries(expressions).forEach(([key, expression]) => {\n field.expressions = field.expressions ?? {};\n field.expressions[key] = expression;\n if (ObjectUtils.isFunction(expression)) {\n field[key] = expression(field);\n }\n });\n }\n}\n","import {Injectable, Injector} from \"@angular/core\";\nimport {AbstractControl, FormArray, FormGroup} from \"@angular/forms\";\nimport {distinctUntilChanged, firstValueFrom, from, isObservable, startWith, switchMap} from \"rxjs\";\nimport {\n IApiService,\n ILanguageService, IOpenApiSchema,\n IOpenApiSchemaProperty,\n ObjectUtils,\n OpenApiService,\n StringUtils\n} from \"@stemy/ngx-utils\";\n\nimport {\n CustomizerOrSchemaOptions,\n FormFieldConfig,\n FormFieldData,\n FormSelectOption,\n FormSelectOptions,\n Validators\n} from \"../common-types\";\n\nimport {\n emailValidation,\n maxLengthValidation,\n maxValueValidation,\n minLengthValidation,\n minValueValidation,\n requiredValidation\n} from \"../utils/validation\";\nimport {\n ConfigForSchemaWrapOptions,\n convertToDate,\n findRefs,\n isStringWithVal,\n mergeFormFields,\n toWrapOptions\n} from \"../utils/internal\";\n\nimport {DynamicFormBuilderService} from \"./dynamic-form-builder.service\";\n\n@Injectable()\nexport class DynamicFormSchemaService {\n\n get api(): IApiService {\n return this.openApi.api;\n }\n\n get language(): ILanguageService {\n return this.api.language;\n }\n\n constructor(protected readonly openApi: OpenApiService,\n protected readonly injector: Injector,\n protected readonly builder: DynamicFormBuilderService) {\n }\n\n async getSchema(name: string): Promise<IOpenApiSchema> {\n return this.openApi.getSchema(name);\n }\n\n async getFormFieldsForSchema(name: string,\n parent: FormFieldConfig,\n customizeOrOptions: CustomizerOrSchemaOptions): Promise<FormFieldConfig[]> {\n const schema = await this.getSchema(name);\n if (!schema) return [];\n const options = await toWrapOptions(customizeOrOptions, this.injector, schema);\n const keys = Object.keys(schema.properties || {});\n const fields: FormFieldConfig[] = [];\n // Collect all properties of this schema def\n for (const key of keys) {\n const property = schema.properties[key];\n const propFields = await this.getFormFieldsForProp(property, schema, options, parent);\n fields.push(...propFields);\n }\n return this.builder.createFieldSets(\n fields.filter(f => null !== f),\n parent, options\n );\n }\n\n protected async getFormFieldsForProp(property: IOpenApiSchemaProperty, schema: IOpenApiSchema, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig[]> {\n const field = await this.getFormFieldForProp(property, options, parent);\n return !field ? [] : options.customize(field, property, schema);\n }\n\n protected async getFormFieldForProp(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig> {\n const $enum = property.items?.enum || property.enum;\n if (Array.isArray($enum) || isStringWithVal(property.optionsPath) || isStringWithVal(property.endpoint)) {\n return this.getFormSelectConfig(property, options, parent);\n }\n switch (property.type) {\n case \"string\":\n case \"number\":\n case \"integer\":\n case \"textarea\":\n // if (this.checkIsEditorProperty(property)) {\n // return this.getFormEditorConfig(property, options, parent);\n // }\n if (property.format == \"textarea\") {\n return this.getFormTextareaConfig(property, options, parent);\n }\n if (property.format == \"date\" || property.format == \"date-time\") {\n return this.getFormDatepickerConfig(property, options, parent);\n }\n return this.getFormInputConfig(property, options, parent);\n // case \"object\":\n // return this.getFormEditorConfig(property, options, parent);\n case \"boolean\":\n return this.getFormCheckboxConfig(property, options, parent);\n case \"array\":\n return this.getFormArrayConfig(property, options, parent);\n case \"file\":\n case \"upload\":\n return this.getFormUploadConfig(property, options, parent);\n }\n if (findRefs(property).length > 0) {\n return this.getFormGroupConfig(property, options, parent);\n }\n return null;\n }\n\n protected getFormFieldData(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions): FormFieldData {\n const validators: Validators = {};\n const schema = options.schema;\n if (ObjectUtils.isArray(schema.required) && schema.required.indexOf(property.id) >= 0) {\n validators.required = requiredValidation();\n }\n this.addPropertyValidators(validators, property);\n this.addItemsValidators(validators, property.items);\n return {\n hidden: property.hidden === true,\n fieldSet: property.fieldSet,\n classes: property.classes,\n validators\n };\n }\n\n protected async getFormArrayConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig> {\n return this.builder.createFormArray(property.id, async sp => {\n const subSchemas = findRefs(property);\n if (subSchemas.length > 0) {\n const subModels = await Promise.all(\n subSchemas.map(s => this.getFormFieldsForSchema(s, sp, options))\n );\n return mergeFormFields(ObjectUtils.copy(subModels));\n }\n return this.getFormFieldForProp(property.items, options, null);\n }, {\n ...this.getFormFieldData(property, options),\n // initialCount: property.initialCount || 0,\n // sortable: property.sortable || false,\n useTabs: property.useTabs,\n tabsLabel: property.tabsLabel,\n addItem: property.addItem,\n insertItem: property.insertItem,\n cloneItem: property.cloneItem,\n moveItem: property.moveItem,\n removeItem: property.removeItem,\n clearItems: property.clearItems\n }, parent, options);\n }\n\n protected async getFormGroupConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig> {\n return this.builder.createFormGroup(property.id, async sp => {\n const subSchemas = findRefs(property);\n const subModels = await Promise.all(\n subSchemas.map(s => this.getFormFieldsForSchema(s, sp, options))\n );\n return mergeFormFields(subModels);\n }, {\n ...this.getFormFieldData(property, options),\n }, parent, options);\n }\n\n protected getFormInputConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n let type = StringUtils.has(property.id || \"\", \"password\", \"Password\") ? \"password\" : (property.format || property.type);\n switch (type) {\n case \"string\":\n type = \"text\";\n break;\n case \"boolean\":\n type = \"checkbox\";\n break;\n case \"textarea\":\n type = \"textarea\";\n break;\n case \"integer\":\n type = \"number\";\n break;\n }\n const sub = property.type == \"array\" ? property.items || property : property;\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type,\n autocomplete: property.autocomplete,\n pattern: property.pattern,\n step: isNaN(sub.step) ? property.step : sub.step,\n min: sub.minimum,\n max: sub.maximum,\n minLength: sub.minLength,\n maxLength: sub.maxLength,\n placeholder: property.placeholder,\n indeterminate: property.indeterminate,\n suffix: property.suffix\n }, parent, options);\n }\n\n protected getFormTextareaConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type: \"textarea\",\n autocomplete: property.autoComplete,\n cols: property.cols || null,\n rows: property.rows || 10,\n minLength: property.minLength,\n maxLength: property.maxLength,\n placeholder: property.placeholder || \"\"\n }, parent, options);\n }\n\n // getFormEditorConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrap): DynamicEditorModelConfig {\n // const sub = property.type == \"array\" ? property.items || property : property;\n // return Object.assign(\n // this.getFormControlConfig(property, options),\n // {\n // inputType: property.format || \"json\",\n // convertObject: property.type !== \"string\",\n // autoComplete: property.autoComplete || \"off\",\n // multiple: property.type == \"array\",\n // accept: ObjectUtils.isString(property.accept) ? property.accept : null,\n // mask: ObjectUtils.isString(property.mask) ? property.mask : null,\n // pattern: ObjectUtils.isString(property.pattern) ? property.pattern : null,\n // step: isNaN(sub.step) ? (isNaN(property.step) ? 1 : property.step) : sub.step,\n // minLength: isNaN(sub.minLength) ? 0 : sub.minLength,\n // maxLength: isNaN(sub.maxLength) ? MAX_INPUT_NUM : sub.maxLength,\n // placeholder: property.placeholder || \"\"\n // }\n // );\n // }\n\n protected getFormDatepickerConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type: property.format == \"date-time\" ? \"datetime-local\" : \"date\",\n // format: property.dateFormat || \"dd.MM.yyyy\",\n min: convertToDate(property.min),\n max: convertToDate(property.max),\n }, parent, options);\n }\n\n protected getFormSelectConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormSelect(property.id, {\n ...this.getFormFieldData(property, options),\n options: field => this.getFormSelectOptions(property, options, field),\n type: property.format || \"select\",\n multiple: property.type == \"array\",\n groupBy: property.groupBy,\n allowEmpty: property.allowEmpty\n }, parent, options);\n }\n\n protected getFormUploadConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormUpload(property.id, {\n ...this.getFormFieldData(property, options),\n multiple: property.type === \"array\",\n inline: property.inline,\n accept: property.accept,\n url: property.url,\n maxSize: property.maxSize,\n uploadOptions: property.uploadOptions\n }, parent, options);\n }\n\n protected getFormCheckboxConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type: \"checkbox\",\n indeterminate: property.indeterminate || false\n }, parent, options);\n }\n\n protected getFormSelectOptions(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, field: FormFieldConfig): FormSelectOptions {\n const $enum = property.items?.enum || property.enum;\n if (Array.isArray($enum)) {\n return from(this.builder.fixSelectOptions(field, $enum.map(value => {\n const label = options.labelPrefix\n ? this.language.getTranslationSync(`${options.labelPrefix}.${property.id}.${value}`)\n : `${property.id}.${value}`;\n return {value, label};\n })));\n }\n if (isStringWithVal(property.endpoint)) {\n const entries = Object.entries((field.formControl.root as FormGroup)?.controls || {});\n const endpoint = entries.reduce((res, [key, control]) => {\n return this.replaceOptionsEndpoint(res, key, control?.value);\n }, `${property.endpoint}`);\n this.api.cache[endpoint] = this.api.cache[endpoint] || this.api.list(endpoint, this.api.makeListParams(1, -1)).then(result => {\n const items = ObjectUtils.isArray(result)\n ? result\n : (ObjectUtils.isArray(result.items) ? result.items : []);\n return items.map(i => {\n const item = ObjectUtils.isObject(i) ? i : {id: i};\n return {\n ...item,\n value: item.id || item._id,\n label: item[property.labelField] || item.label || item.id || item._id\n };\n });\n });\n const options = this.api.cache[endpoint] as Promise<FormSelectOption[]>;\n return from(options.then(opts => {\n return this.builder.fixSelectOptions(field, opts.map(o => Object.assign({}, o)))\n }));\n }\n let path = property.optionsPath as string;\n let control = field.formControl;\n let current = field;\n if (path.startsWith(\"$root\")) {\n path = path.substring(5);\n control = control.root || control;\n while (current.parent) {\n current = current.parent;\n }\n }\n while (path.startsWith(\".\")) {\n path = path.substring(1);\n control = control.parent || control;\n current = current.parent || current;\n }\n control = !path ? control : control.get(path);\n return control.valueChanges.pipe(\n startWith(control.value),\n distinctUntilChanged(),\n switchMap(async (controlVal) => {\n const currentOpts = current.props.options;\n const finalOpts = isObservable(currentOpts)\n ? await firstValueFrom(currentOpts)\n : (Array.isArray(currentOpts) ? currentOpts : []);\n return this.builder.fixSelectOptions(field, (!Array.isArray(controlVal) ? [] : controlVal).map(value => {\n const modelOption = finalOpts.find(t => t.value == value);\n return {value, label: modelOption?.label || value};\n }));\n })\n );\n }\n\n protected replaceOptionsEndpoint(endpoint: string, key: string, value: any): string {\n if (ObjectUtils.isObject(value)) {\n return Object.entries(value).reduce((res, [k, v]) => {\n return this.replaceOptionsEndpoint(res, `${key}.${k}`, v);\n }, endpoint)\n }\n if (ObjectUtils.isArray(value)) {\n return value.reduce((res, v, i) => {\n return this.replaceOptionsEndpoint(res, `${key}.${i}`, v);\n }, endpoint)\n }\n return endpoint.replace(new RegExp(`\\\\$${key}`, \"gi\"), `${value ?? \"\"}`);\n }\n\n protected showErrorsForGroup(formGroup: FormGroup): void {\n if (!formGroup) return;\n formGroup.markAsTouched({onlySelf: true});\n const controls = Object.keys(formGroup.controls).map(id => formGroup.controls[id]);\n this.showErrorsForControls(controls);\n }\n\n protected showErrorsForControls(controls: AbstractControl[]): void {\n controls.forEach(control => {\n if (control instanceof FormGroup) {\n this.showErrorsForGroup(control);\n return;\n }\n control.markAsTouched({onlySelf: true});\n if (control instanceof FormArray) {\n this.showErrorsForControls(control.controls);\n }\n });\n }\n\n protected addPropertyValidators(validators: Validators, property: IOpenApiSchemaProperty): void {\n if (!property) return;\n if (!isNaN(property.minLength)) {\n validators.minLength = minLengthValidation(property.minLength);\n }\n if (!isNaN(property.maxLength)) {\n validators.maxLength = maxLengthValidation(property.maxLength);\n }\n if (!isNaN(property.minimum)) {\n validators.min = minValueValidation(property.minimum);\n }\n if (!isNaN(property.maximum)) {\n validators.max = maxValueValidation(property.maximum);\n }\n // if (isString(property.pattern) && property.pattern.length) {\n // validators.pattern = property.pattern;\n // }\n switch (property.format) {\n case \"email\":\n validators.email = emailValidation();\n break;\n }\n }\n\n protected addItemsValidators(validators: Validators, items: IOpenApiSchemaProperty): void {\n if (!items) return;\n if (!isNaN(items.minLength)) {\n validators.itemsMinLength = minLengthValidation(items.minLength, true);\n }\n if (!isNaN(items.maxLength)) {\n validators.itemsMaxLength = maxLengthValidation(items.maxLength, true);\n }\n if (!isNaN(items.minimum)) {\n validators.itemsMinValue = minValueValidation(items.minimum, true);\n }\n if (!isNaN(items.maximum)) {\n validators.itemsMaxValue = maxValueValidation(items.maximum, true);\n }\n }\n}\n","import {Inject, Injectable, Injector} from \"@angular/core\";\nimport {AbstractControl, FormArray, FormGroup} from \"@angular/forms\";\nimport {first} from \"rxjs\";\nimport {API_SERVICE, IApiService, ObjectUtils} from \"@stemy/ngx-utils\";\n\nimport {\n CustomizerOrSchemaOptions,\n FORM_ROOT_KEY,\n FormFieldConfig,\n FormSerializeResult,\n IDynamicForm\n} from \"../common-types\";\nimport {getFormValidationErrors, toWrapOptions} from \"../utils/internal\";\n\nimport {DynamicFormSchemaService} from \"./dynamic-form-schema.service\";\n\n@Injectable()\nexport class DynamicFormService {\n\n constructor(protected readonly fs: DynamicFormSchemaService,\n protected readonly injector: Injector,\n @Inject(API_SERVICE) protected readonly api: IApiService) {\n\n }\n\n async getFormFieldsForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig[]> {\n const group = await this.getFormFieldGroupBySchemaName(name, customizeOrOptions, \"getFormFieldsForSchema\");\n return group.fieldGroup;\n }\n\n async getFormFieldGroupForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig> {\n return this.getFormFieldGroupBySchemaName(name, customizeOrOptions, \"getFormFieldsForSchema\");\n }\n\n protected async getFormFieldGroupBySchemaName(name: string, customizeOrOptions: CustomizerOrSchemaOptions, restrictedMethod: string): Promise<FormFieldConfig> {\n const config = {\n key: FORM_ROOT_KEY,\n path: \"\",\n wrappers: [\"form-group\"]\n } as FormFieldConfig;\n const schema = await this.fs.getSchema(name);\n const wrapOptions = await toWrapOptions(\n customizeOrOptions, this.injector, schema,\n `\"DynamicFormService.${restrictedMethod}\" is called from a customizer, which is not allowed. Please use DynamicFormSchemaService instead!`\n );\n const fields = await this.fs.getFormFieldsForSchema(name, config, wrapOptions);\n const fieldGroup = [...fields];\n\n config.fieldGroup = fieldGroup;\n\n // There are no actual fields in the schema, or no schema exists\n if (fields.length === 0) return config;\n\n // Add id fields if necessary\n const idFields: FormFieldConfig[] = [\n {key: \"id\", props: {hidden: true}},\n {key: \"_id\", props: {hidden: true}},\n ];\n fieldGroup.unshift(...idFields\n .filter(t => !fields.some(c => c.key == t.key))\n );\n\n const root = await wrapOptions.customize(config, {\n id: FORM_ROOT_KEY,\n type: \"object\",\n properties: schema?.properties || {}\n }, schema);\n // Check if the customized root wrapper returned an array\n fields.length = 0;\n\n for (const model of root) {\n if (model.key === FORM_ROOT_KEY) {\n return model;\n } else {\n fields.push(model);\n }\n }\n\n return {\n ...config,\n fieldGroup: fields\n };\n }\n\n async validateForm(form: IDynamicForm, showErrors: boolean = true): Promise<any> {\n const group = form.group();\n if (!group) return Promise.resolve();\n return new Promise<any>((resolve, reject) => {\n group.statusChanges\n .pipe(first(status => status == \"VALID\" || status == \"INVALID\"))\n .subscribe(status => {\n if (showErrors) {\n this.showErrorsForGroup(group);\n }\n if (status == \"VALID\") {\n resolve(null);\n return;\n }\n reject(getFormValidationErrors(group.controls));\n });\n group.updateValueAndValidity();\n });\n }\n\n async serializeForm(form: IDynamicForm, validate: boolean = true): Promise<FormSerializeResult> {\n const fields = form.config();\n if (!fields) return null;\n if (validate) {\n await this.validateForm(form);\n }\n return this.serialize(fields);\n }\n\n async serialize(fields: FormFieldConfig[]): Promise<FormSerializeResult> {\n const result = {};\n if (!fields) return result;\n for (const field of fields) {\n const serializer = field.serializer;\n const key = `${field.key}`;\n if (ObjectUtils.isFunction(serializer)) {\n result[key] = await serializer(field, this.injector);\n continue;\n }\n if (field.hide && !field.serialize) {\n continue;\n }\n const control = field.formControl;\n if (field.fieldGroup) {\n const group = await this.serialize(field.fieldGroup);\n if (field.key) {\n result[key] = !field.fieldArray ? group : Object.values(group);\n continue;\n }\n Object.assign(result, group);\n continue;\n }\n result[key] = control.value;\n }\n return result;\n }\n\n protected showErrorsForGroup(formGroup: FormGroup): void {\n if (!formGroup) return;\n formGroup.markAsTouched({onlySelf: true});\n const controls = Object.keys(formGroup.controls).map(id => formGroup.controls[id]);\n this.showErrorsForControls(controls);\n }\n\n protected showErrorsForControls(controls: AbstractControl[]): void {\n controls.forEach(control => {\n if (control instanceof FormGroup) {\n this.showErrorsForGroup(control);\n return;\n }\n control.markAsTouched({onlySelf: true});\n if (control instanceof FormArray) {\n this.showErrorsForControls(control.controls);\n }\n });\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n HostBinding,\n HostListener,\n inject,\n input,\n output,\n Renderer2,\n signal\n} from \"@angular/core\";\nimport {outputToObservable} from \"@angular/core/rxjs-interop\";\nimport {debounceTime} from \"rxjs/operators\";\nimport {IAsyncMessage, TOASTER_SERVICE} from \"@stemy/ngx-utils\";\n\nimport {AsyncSubmitMethod, IDynamicForm} from \"../common-types\";\n\n@Directive({\n standalone: false,\n selector: \"[async-submit]\",\n exportAs: \"async-submit\"\n})\nexport class AsyncSubmitDirective {\n\n method = input<AsyncSubmitMethod>(null, {alias: \"async-submit\"});\n form = input<IDynamicForm>();\n context = input<any>();\n\n onSuccess = output<IAsyncMessage>();\n onError = output<IAsyncMessage>();\n\n toaster = inject(TOASTER_SERVICE);\n renderer = inject(Renderer2);\n elem = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected status = computed(() => {\n const form = this.form();\n return form?.status() || null;\n });\n\n protected group = computed(() => {\n const form = this.form();\n return form?.group() || null;\n });\n\n protected loading = signal(false);\n protected callback = signal<() => void>(null);\n\n @HostBinding(\"class.disabled\")\n get isDisabled(): boolean {\n return this.status() !== \"VALID\";\n }\n\n @HostBinding(\"class.loading\")\n get isLoading(): boolean {\n return this.loading();\n }\n\n constructor() {\n effect(() => {\n if (this.elem.nativeElement.tagName === \"BUTTON\") {\n this.renderer.setAttribute(this.elem.nativeElement, \"type\", \"button\");\n }\n });\n effect(() => {\n const status = this.status();\n const cb = this.callback();\n if (!cb || status == \"PENDING\") return;\n if (status === \"VALID\") {\n cb();\n }\n this.callback.set(null);\n });\n effect(() => {\n const form = this.form();\n if (!form) return;\n const sub = outputToObservable(form.onSubmit)\n .pipe(debounceTime(200)).subscribe(() => this.callMethod());\n return () => sub.unsubscribe();\n });\n }\n\n @HostListener(\"click\")\n click(): void {\n const status = this.status();\n if (status !== \"VALID\" && status !== \"INVALID\") {\n this.callback.set(() => this.callMethod());\n return;\n }\n this.callMethod();\n }\n\n callMethod(): void {\n if (this.loading()) return;\n this.loading.set(true);\n this.method()(this.form(), this.context).then(result => {\n this.loading.set(false);\n if (result) {\n this.onSuccess.emit(result);\n this.toaster.success(result.message, result.context);\n }\n }, reason => {\n if (!reason || !reason.message)\n throw new Error(\"Reason must implement IAsyncMessage interface\");\n this.loading.set(false);\n this.onError.emit(reason);\n this.toaster.error(reason.message, reason.context);\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n Injector,\n input,\n output,\n ViewEncapsulation\n} from \"@angular/core\";\nimport {rxResource, toSignal} from \"@angular/core/rxjs-interop\";\nimport {FormGroup} from \"@angular/forms\";\nimport {Subject} from \"rxjs\";\nimport {FormlyFormOptions} from \"@ngx-formly/core\";\nimport {EventsService, LANGUAGE_SERVICE} from \"@stemy/ngx-utils\";\n\nimport {FormFieldChangeEvent, FormFieldConfig, FormFieldLabelCustomizer, IDynamicForm} from \"../../common-types\";\nimport {DynamicFormBuilderService} from \"../../services/dynamic-form-builder.service\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form\",\n templateUrl: \"./dynamic-form.component.html\",\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DynamicFormComponent implements IDynamicForm {\n\n protected readonly builder = inject(DynamicFormBuilderService);\n\n protected readonly events = inject(EventsService);\n\n protected readonly languages = inject(LANGUAGE_SERVICE);\n\n readonly labelPrefix = input<string>(\"label\");\n\n readonly labelCustomizer = input<FormFieldLabelCustomizer>(null);\n\n readonly testId = input<string>(\"\");\n\n readonly data = input<any>({});\n\n readonly fields = input<FormFieldConfig[]>(null);\n\n readonly fieldChanges = new Subject<FormFieldChangeEvent>();\n\n protected readonly language = toSignal(this.events.languageChanged, {\n initialValue: this.languages.currentLanguage\n });\n\n readonly config = computed(() => {\n return this.fields() || this.builder.resolveFormFields(this.data()?.constructor, null, {\n labelPrefix: this.labelPrefix(),\n labelCustomizer: this.labelCustomizer(),\n testId: this.testId(),\n });\n });\n\n readonly group = computed(() => {\n this.config();\n return new FormGroup({});\n });\n\n protected readonly status$ = rxResource({\n request: () => this.group(),\n loader: p => p.request.statusChanges,\n defaultValue: \"PENDING\"\n });\n\n readonly status = computed(() => this.status$.value());\n\n readonly onSubmit = output<IDynamicForm>();\n\n readonly options: FormlyFormOptions = {\n fieldChanges: this.fieldChanges,\n formState: {\n injector: inject(Injector)\n }\n };\n\n constructor() {\n effect(() => {\n this.language();\n this.config().forEach(field => {\n if (!field.options) return;\n this.options.detectChanges(field);\n });\n });\n }\n\n submit() {\n // TODO: Templ disable submit\n // this.onSubmit.emit(this);\n }\n\n reset() {\n this.options?.resetModel?.();\n }\n}\n","@if (config() && group()) {\n <form [formGroup]=\"group()\" (ngSubmit)=\"submit()\" autocomplete=\"off\" role=\"presentation\">\n <input type=\"submit\" [hidden]=\"true\" />\n <formly-form [model]=\"data()\"\n [fields]=\"config()\"\n [form]=\"group()\"\n [options]=\"options\"></formly-form>\n <ng-content></ng-content>\n </form>\n}\n","import {Component, signal, ViewEncapsulation} from \"@angular/core\";\nimport {FormArray} from \"@angular/forms\";\nimport {FieldArrayType} from \"@ngx-formly/core\";\nimport {FormFieldConfig} from \"../../common-types\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-array\",\n templateUrl: \"./dynamic-form-array.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormArrayComponent extends FieldArrayType<FormFieldConfig> {\n\n readonly currentTab = signal(0);\n\n clear(): void {\n const control = this.formControl as FormArray;\n while (control.length > 0) {\n this.remove(0);\n }\n }\n}\n","<label class=\"field-label\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n</label>\n<div class=\"field-container\">\n @if (props.useTabs) {\n <ul class=\"form-array-tabs\">\n @for (field of field.fieldGroup; track field.key; let ix = $index) {\n <li>\n <a class=\"btn\" [ngClass]=\"[currentTab() === ix ? 'btn-primary' : 'btn-secondary']\"\n (click)=\"currentTab.set(ix)\">\n {{ (field.formControl.value | getValue : props.tabsLabel) || ix + 1 }}\n </a>\n </li>\n }\n </ul>\n }\n @for (field of field.fieldGroup; track field.key; let ix = $index) {\n @if (!props.useTabs || ix === currentTab()) {\n <div class=\"form-array-item\">\n <div class=\"form-array-buttons\">\n @if (props.removeItem) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"remove(ix)\">\n <i icon=\"trash-outline\"></i>\n </button>\n }\n @if (props.insertItem) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"add(ix)\">\n <i icon=\"plus-outline\"></i>\n </button>\n }\n </div>\n <formly-field [field]=\"field\"></formly-field>\n </div>\n }\n }\n <div class=\"form-array-buttons\">\n @if (props.clearItems) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"clear()\">\n <i icon=\"trash-outline\"></i>\n {{ 'button.clear-items' | translate }}\n </button>\n }\n @if (props.addItem) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"add()\">\n <i icon=\"plus-outline\"></i>\n {{ 'button.insert-item' | translate }}\n </button>\n }\n </div>\n</div>\n","import {ChangeDetectionStrategy, Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldType} from \"@ngx-formly/core\";\nimport {FormFieldType} from \"../../common-types\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-chips\",\n templateUrl: \"./dynamic-form-chips.component.html\",\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicFormChipsComponent extends FieldType<FormFieldType> {\n\n}\n","<chips [formControl]=\"formControl\"\n [type]=\"props.type\"\n [step]=\"props.step\"\n [minLength]=\"props.minLength\"\n [maxLength]=\"props.maxLength\"\n [min]=\"props.min\"\n [max]=\"props.max\"\n [multiple]=\"props.multiple\"\n [formlyAttributes]=\"field\">\n</chips>\n","import {Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldWrapper} from \"@ngx-formly/core\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-field\",\n templateUrl: \"./dynamic-form-field.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormFieldComponent extends FieldWrapper {\n\n}\n","<label class=\"field-label\" [for]=\"id\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n <span class=\"field-required\" *ngIf=\"props.required && props.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n</label>\n<div class=\"field-container\">\n <ng-container #fieldComponent></ng-container>\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\n <formly-validation-message\n id=\"{{ id }}-formly-validation-error\"\n [field]=\"field\"\n role=\"alert\"\n ></formly-validation-message>\n </div>\n</div>\n","import {Component, inject, ViewEncapsulation} from \"@angular/core\";\nimport {FieldWrapper} from \"@ngx-formly/core\";\nimport {DynamicFormGroupComponent} from \"../dynamic-form-group/dynamic-form-group.component\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-fieldset\",\n templateUrl: \"./dynamic-form-fieldset.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormFieldsetComponent extends FieldWrapper {\n\n ngOnInit(): void {\n // console.log(this.field.id, this.field.props?.label, this.options);\n // console.log(this.field.parent);\n }\n}\n","<legend class=\"field-legend\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n</legend>\n<div class=\"field-container\">\n <ng-container #fieldComponent></ng-container>\n</div>\n","import {Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldWrapper} from \"@ngx-formly/core\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-group\",\n templateUrl: \"./dynamic-form-group.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormGroupComponent extends FieldWrapper {\n\n}\n","<label class=\"field-label\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n</label>\n<ng-container #fieldComponent></ng-container>\n","import {ChangeDetectionStrategy, Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldType} from \"@ngx-formly/core\";\nimport {FormFieldType} from \"../../common-types\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-upload\",\n templateUrl: \"./dynamic-form-upload.component.html\",\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicFormUploadComponent extends FieldType<FormFieldType> {\n\n}\n","<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n","import {AsyncSubmitDirective} from \"./directives/async-submit.directive\";\n\nimport {DynamicFormComponent} from \"./components/dynamic-form/dynamic-form.component\";\nimport {DynamicFormArrayComponent} from \"./components/dynamic-form-array/dynamic-form-array.component\";\nimport {DynamicFormChipsComponent} from \"./components/dynamic-form-chips/dynamic-form-chips.component\";\nimport {DynamicFormFieldComponent} from \"./components/dynamic-form-field/dynamic-form-field.component\";\nimport {DynamicFormFieldsetComponent} from \"./components/dynamic-form-fieldset/dynamic-form-fieldset.component\";\nimport {DynamicFormGroupComponent} from \"./components/dynamic-form-group/dynamic-form-group.component\";\nimport {DynamicFormUploadComponent} from \"./components/dynamic-form-upload/dynamic-form-upload.component\";\n\n// --- Components ---\nexport const components = [\n DynamicFormComponent,\n DynamicFormArrayComponent,\n DynamicFormChipsComponent,\n DynamicFormFieldComponent,\n DynamicFormFieldsetComponent,\n DynamicFormGroupComponent,\n DynamicFormUploadComponent\n];\n\n// --- Directives ---\nexport const directives = [\n AsyncSubmitDirective,\n];\n\n// --- Pipes ---\nexport const pipes = [];\n","import {EnvironmentProviders, makeEnvironmentProviders, ModuleWithProviders, NgModule, Provider} from \"@angular/core\";\nimport {CommonModule} from \"@angular/common\";\nimport {FormsModule, ReactiveFormsModule} from \"@angular/forms\";\nimport {FormlyModule} from \"@ngx-formly/core\";\nimport {NgxUtilsModule} from \"@stemy/ngx-utils\";\n\nimport {components, directives, pipes} from \"./ngx-dynamic-form.imports\";\n\nimport {IDynamicFormModuleConfig} from \"./common-types\";\n\nimport {DynamicFormService} from \"./services/dynamic-form.service\";\nimport {DynamicFormBuilderService} from \"./services/dynamic-form-builder.service\";\nimport {DynamicFormSchemaService} from \"./services/dynamic-form-schema.service\";\n\nimport {DynamicFormArrayComponent} from \"./components/dynamic-form-array/dynamic-form-array.component\";\nimport {DynamicFormChipsComponent} from \"./components/dynamic-form-chips/dynamic-form-chips.component\";\nimport {DynamicFormGroupComponent} from \"./components/dynamic-form-group/dynamic-form-group.component\";\nimport {DynamicFormFieldComponent} from \"./components/dynamic-form-field/dynamic-form-field.component\";\nimport {DynamicFormFieldsetComponent} from \"./components/dynamic-form-fieldset/dynamic-form-fieldset.component\";\nimport {DynamicFormUploadComponent} from \"./components/dynamic-form-upload/dynamic-form-upload.component\";\n\n@NgModule({\n declarations: [\n ...components,\n ...directives,\n ...pipes\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NgxUtilsModule,\n FormlyModule\n ],\n exports: [\n ...components,\n ...directives,\n ...pipes,\n FormsModule,\n ReactiveFormsModule,\n NgxUtilsModule,\n FormlyModule\n ],\n providers: [\n ...pipes\n ]\n})\nexport class NgxDynamicFormModule {\n\n private static getProviders(config?: IDynamicFormModuleConfig): Provider[] {\n const {providers} = FormlyModule.forRoot({\n types: [\n {name: \"array\", component: DynamicFormArrayComponent},\n {name: \"chips\", component: DynamicFormChipsComponent},\n {name: \"upload\", component: DynamicFormUploadComponent, wrappers: [\"form-field\"]},\n {name: \"file\", extends: \"upload\"},\n {name: \"translation\", extends: \"array\"},\n ...(config?.types || [])\n ],\n wrappers: [\n { name: \"form-field\", component: DynamicFormFieldComponent },\n { name: \"form-fieldset\", component: DynamicFormFieldsetComponent },\n { name: \"form-group\", component: DynamicFormGroupComponent },\n ...(config?.wrappers || [])\n ],\n extras: {\n renderFormlyFieldElement: false,\n ...(config?.extras || {})\n }\n });\n\n return [\n ...(providers as Provider[]),\n DynamicFormService,\n DynamicFormBuilderService,\n DynamicFormSchemaService\n ];\n }\n\n static forRoot(config?: IDynamicFormModuleConfig): ModuleWithProviders<NgxDynamicFormModule> {\n return {\n ngModule: NgxDynamicFormModule,\n providers: NgxDynamicFormModule.getProviders(config)\n }\n }\n\n static provideForms(config?: IDynamicFormModuleConfig): EnvironmentProviders {\n return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["FormGroup","FormArray","i1","i2.DynamicFormBuilderService","i2","i3"],"mappings":";;;;;;;;;;;;;;AAcA;AACO,MAAM,aAAa,GAAG;;ACUb,SAAA,kBAAkB,CAAC,GAAG,SAAiD,EAAA;AACnF,IAAA,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC;AACxC,IAAA,OAAO,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,KAAI;AACxD,QAAA,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;AACrC,QAAA,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC;AACtB,QAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YAClC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChF,YAAA,IAAI,KAAK,IAAI,CAAC,EAAE;AACZ,gBAAA,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,cAAc,CAC1C,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAC3C;AACD,gBAAA,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC;gBACxD,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC;;;AAG1C,QAAA,OAAO,MAAM;AACjB,KAAC;AACL;;AC9BA,SAAS,iBAAiB,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAoB,EAAA;AAC7E,IAAA,MAAM,MAAM,GAAgB,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,CAAC,IAAI,IAAI,GAAG,E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nB,cAAc;YACd,YAAY,CAAA,EAAA,CAAA;AAMP,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAJlB,SAAA,EAAA;AACP,YAAA,GAAG;AACN,SAAA,EAAA,OAAA,EAAA,CAjBG,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,cAAc;AACd,YAAA,YAAY,EAMZ,WAAW;YACX,mBAAmB;YACnB,cAAc;YACd,YAAY,CAAA,EAAA,CAAA;;4FAMP,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBA1BhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;AACV,wBAAA,GAAG,UAAU;AACb,wBAAA,GAAG,UAAU;AACb,wBAAA,GAAG;AACN,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,cAAc;wBACd;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;AACb,wBAAA,GAAG,UAAU;AACb,wBAAA,GAAG,KAAK;wBACR,WAAW;wBACX,mBAAmB;wBACnB,cAAc;wBACd;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE;AACP,wBAAA,GAAG;AACN;AACJ,iBAAA;;;AC9CD;;AAEG;;;;"}
1
+ {"version":3,"file":"stemy-ngx-dynamic-form.mjs","sources":["../../src/ngx-dynamic-form/common-types.ts","../../src/ngx-dynamic-form/utils/customizer.ts","../../src/ngx-dynamic-form/utils/decorators.ts","../../src/ngx-dynamic-form/utils/validation.ts","../../src/ngx-dynamic-form/utils/misc.ts","../../src/ngx-dynamic-form/utils/internal.ts","../../src/ngx-dynamic-form/services/dynamic-form-builder.service.ts","../../src/ngx-dynamic-form/services/dynamic-form-schema.service.ts","../../src/ngx-dynamic-form/services/dynamic-form.service.ts","../../src/ngx-dynamic-form/directives/async-submit.directive.ts","../../src/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.ts","../../src/ngx-dynamic-form/components/dynamic-form/dynamic-form.component.html","../../src/ngx-dynamic-form/components/dynamic-form-array/dynamic-form-array.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-array/dynamic-form-array.component.html","../../src/ngx-dynamic-form/components/dynamic-form-chips/dynamic-form-chips.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-chips/dynamic-form-chips.component.html","../../src/ngx-dynamic-form/components/dynamic-form-field/dynamic-form-field.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-field/dynamic-form-field.component.html","../../src/ngx-dynamic-form/components/dynamic-form-fieldset/dynamic-form-fieldset.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-fieldset/dynamic-form-fieldset.component.html","../../src/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-group/dynamic-form-group.component.html","../../src/ngx-dynamic-form/components/dynamic-form-upload/dynamic-form-upload.component.ts","../../src/ngx-dynamic-form/components/dynamic-form-upload/dynamic-form-upload.component.html","../../src/ngx-dynamic-form/ngx-dynamic-form.imports.ts","../../src/ngx-dynamic-form/ngx-dynamic-form.module.ts","../../src/stemy-ngx-dynamic-form.ts"],"sourcesContent":["import {Injector, OutputRef, Signal} from \"@angular/core\";\nimport {AbstractControl, FormControl, FormGroup} from \"@angular/forms\";\nimport {Observable} from \"rxjs\";\nimport {ConfigOption, FormlyFieldConfig, FormlyFieldProps} from \"@ngx-formly/core\";\nimport {FormlySelectOption} from \"@ngx-formly/core/select\";\nimport {\n IAsyncMessage,\n IOpenApiSchema,\n IOpenApiSchemaProperty,\n IRequestOptions,\n MaybeArray,\n MaybePromise\n} from \"@stemy/ngx-utils\";\n\n// --- Basic frm constants ---\nexport const FORM_ROOT_KEY = \"__root\";\n\n// --- Basic form types ---\n\nexport type DynamicFormState = \"VALID\" | \"INVALID\" | \"PENDING\" | \"DISABLED\" | \"LOADING\";\nexport type DynamicFormUpdateOn = \"change\" | \"blur\" | \"submit\";\nexport type UploadData = Record<string, any> | ArrayBuffer | FormData;\n\n// --- Basic form field interfaces ---\n\nexport type FormFieldKey = string | number | (string | number)[];\n\nexport type FormFieldLabelCustomizer = (key: string, label: string, parent: FormFieldConfig, labelPrefix: string) => string;\n\nexport interface FormBuilderOptions {\n labelPrefix?: string;\n labelCustomizer?: FormFieldLabelCustomizer;\n testId?: string;\n}\n\nexport interface FormFieldProps extends FormlyFieldProps {\n // --- Input props ---\n autocomplete?: string;\n suffix?: string;\n // --- Checkbox props ---\n formCheck?: string;\n indeterminate?: boolean;\n // --- Select props ---\n multiple?: boolean;\n allowEmpty?: boolean;\n groupBy?: string;\n // --- Array props ---\n useTabs?: boolean;\n tabsLabel?: string;\n addItem?: boolean;\n insertItem?: boolean;\n cloneItem?: boolean;\n moveItem?: boolean;\n removeItem?: boolean;\n clearItems?: boolean;\n // --- Upload props ---\n inline?: boolean;\n accept?: string | string[];\n url?: string;\n maxSize?: number;\n uploadOptions?: IRequestOptions;\n createUploadData?: (file: File) => UploadData | Promise<UploadData>;\n // --- Old upload props\n multi?: boolean;\n asFile?: boolean;\n uploadUrl?: string;\n}\n\nexport type FormFieldSerializer = (field: FormFieldConfig, injector: Injector) => MaybePromise<any>;\n\nexport declare type FormHookFn = (field: FormFieldConfig) => void;\n\nexport interface FormHookConfig {\n onInit?: FormHookFn | ((field: FormFieldConfig) => Observable<any>);\n onChanges?: FormHookFn;\n afterContentInit?: FormHookFn;\n afterViewInit?: FormHookFn;\n onDestroy?: FormHookFn;\n}\n\nexport type FormFieldExpression<T = any> = string | ((field: FormFieldConfig) => T) | Observable<T>;\nexport type FormFieldExpressions = {\n [property: string]: FormFieldExpression;\n} & {\n className?: FormFieldExpression<string>;\n hide?: FormFieldExpression<boolean>;\n \"props.disabled\"?: FormFieldExpression<boolean>;\n \"props.required\"?: FormFieldExpression<boolean>;\n};\n\nexport interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T> {\n serializer?: FormFieldSerializer;\n serialize?: boolean;\n fieldSet?: string;\n parent?: FormFieldConfig;\n fieldGroup?: FormFieldConfig[];\n fieldArray?: FormFieldConfig | ((field: FormFieldConfig) => FormFieldConfig);\n hooks: FormHookConfig;\n expressions: FormFieldExpressions;\n readonly additional?: Readonly<{[key: string]: any}>;\n readonly path?: string;\n readonly testId?: string;\n}\n\nexport interface FormFieldType<T = FormFieldProps> extends FormFieldConfig<T> {\n formControl: FormControl;\n props: NonNullable<T>;\n}\n\nexport interface FormFieldChangeEvent {\n field: FormFieldConfig;\n type: string;\n value: any;\n [meta: string]: any;\n}\n\nexport interface FormSerializeResult {\n [key: string]: any;\n}\n\nexport interface FormSelectOption extends FormlySelectOption {\n className?: string;\n classes?: string[] | string;\n id?: any;\n}\n\nexport type FormSelectOptions = FormSelectOption[] | Observable<FormSelectOption[]>;\n\nexport interface IDynamicForm {\n\n readonly fieldChanges: Observable<FormFieldChangeEvent>;\n readonly config: Signal<FormFieldConfig[]>;\n readonly group: Signal<FormGroup>;\n readonly status: Signal<DynamicFormState>;\n readonly onSubmit: OutputRef<IDynamicForm>;\n\n reset(): void;\n}\n\n// --- Validation types ---\n\ntype FormFieldValidatorFn<T> = ((control: AbstractControl, field?: FormlyFieldConfig) => T) & {\n validatorName?: string\n};\n\nexport type ValidationMessageFn = (error: any, field: FormFieldConfig) => string | Observable<string>;\n\ninterface FormFieldValidatorExpression<T> {\n expression: FormFieldValidatorFn<T>;\n message: ValidationMessageFn;\n}\n\ntype FormFieldValidation<T, R> = {\n validation?: (string | T)[];\n} & {\n [key: string]: FormFieldValidatorFn<R> | FormFieldValidatorExpression<R>;\n}\n\nexport type ValidatorFn = FormFieldValidatorFn<boolean>;\n\nexport type ValidatorExpression = FormFieldValidatorExpression<boolean>;\n\nexport type Validators = FormFieldValidation<ValidatorFn, boolean>;\n\nexport type AsyncBoolean = Promise<boolean> | Observable<boolean>;\n\nexport type AsyncValidatorFn = FormFieldValidatorFn<AsyncBoolean>;\n\nexport type AsyncValidatorExpression = FormFieldValidatorExpression<AsyncBoolean>;\n\nexport type AsyncValidators = FormFieldValidation<AsyncValidatorFn, AsyncBoolean>;\n\nexport interface AllValidationErrors {\n control: AbstractControl;\n path: string;\n errorKey: string;\n errorValue: any;\n}\n\n// --- Form field data types ---\n\nexport type FormFieldCustom = Pick<FormFieldConfig, \"wrappers\" | \"hooks\" | \"fieldGroup\" | \"fieldArray\">;\n\nexport type FormFieldData = Pick<FormFieldProps, \"label\" | \"readonly\" | \"hidden\" | \"disabled\">\n & {\n validators?: Validators | ValidatorFn[];\n serializer?: FormFieldSerializer;\n fieldSet?: string;\n classes?: string[] | string;\n};\n\nexport type FormInputData = FormFieldData\n & Pick<FormFieldProps, \"type\" | \"pattern\" | \"placeholder\" | \"step\" | \"min\" | \"max\" | \"minLength\" | \"maxLength\" | \"autocomplete\" | \"suffix\" | \"indeterminate\" | \"cols\" | \"rows\">;\n\nexport type FormSelectData = FormFieldData\n & Pick<FormFieldProps, \"multiple\" | \"type\" | \"allowEmpty\" | \"groupBy\"> & {\n options?: (field: FormFieldConfig) => FormSelectOptions | Promise<FormSelectOption[]>;\n};\n\nexport type FormUploadData = FormFieldData\n & Pick<FormFieldProps, \"inline\" | \"multiple\" | \"accept\" | \"url\" | \"maxSize\" | \"uploadOptions\" | \"createUploadData\" | \"multi\" | \"asFile\" | \"uploadUrl\">;\n\nexport type FormGroupData = FormFieldData;\n\nexport type FormArrayData = FormFieldData\n & Pick<FormFieldProps, \"useTabs\" | \"tabsLabel\" | \"addItem\" | \"insertItem\" | \"cloneItem\" | \"moveItem\" | \"removeItem\" | \"clearItems\">;\n\n// --- JSON schema interfaces ---\n\nexport type FormFieldCustomizer = (\n field: FormFieldConfig, options: FormBuilderOptions, injector: Injector,\n property: IOpenApiSchemaProperty, schema: IOpenApiSchema\n) => MaybePromise<MaybeArray<FormFieldConfig>>;\n\nexport interface ConfigForSchemaOptions extends FormBuilderOptions {\n fieldCustomizer?: FormFieldCustomizer;\n}\n\nexport type CustomizerOrSchemaOptions = FormFieldCustomizer | ConfigForSchemaOptions;\n\nexport declare type AsyncSubmitMethod = (form: IDynamicForm, context?: any) => Promise<IAsyncMessage>;\n\nexport interface IDynamicFormModuleConfig extends Pick<ConfigOption, \"types\" | \"wrappers\" | \"extras\"> {\n\n}\n","import {\n cachedFactory,\n CachedProvider,\n IOpenApiSchema,\n IOpenApiSchemaProperty,\n MaybeArray,\n MaybePromise\n} from \"@stemy/ngx-utils\";\n\nimport {FormBuilderOptions, FormFieldConfig, FormFieldCustomizer} from \"../common-types\";\n\nexport interface IFormFieldCustomizer {\n acceptField(\n field: FormFieldConfig,\n property: IOpenApiSchemaProperty,\n schema: IOpenApiSchema\n ): boolean;\n customizeField(\n field: FormFieldConfig,\n options: FormBuilderOptions,\n property: IOpenApiSchemaProperty,\n schema: IOpenApiSchema\n ): MaybePromise<MaybeArray<FormFieldConfig>>;\n}\n\nexport function customizeFormField(...providers: CachedProvider<IFormFieldCustomizer>[]): FormFieldCustomizer {\n const factory = cachedFactory(providers);\n return async (field, options, injector, property, schema) => {\n const customizers = factory(injector);\n const fields = [field];\n for (const customizer of customizers) {\n const index = fields.findIndex(m => customizer.acceptField(m, property, schema));\n if (index >= 0) {\n const custom = await customizer.customizeField(\n fields[index], options, property, schema\n );\n const result = Array.isArray(custom) ? custom : [custom];\n fields.splice(index, 1, ...result);\n }\n }\n return fields;\n }\n}\n","import {ObjectUtils, ReflectUtils} from \"@stemy/ngx-utils\";\nimport {\n FormArrayData,\n FormFieldSerializer,\n FormGroupData,\n FormInputData,\n FormSelectData,\n FormUploadData\n} from \"../common-types\";\nimport {FormFieldBuilder} from \"../services/dynamic-form-builder.service\";\nimport {Type} from \"@angular/core\";\n\nfunction defineFormControl(target: any, propertyKey: string, cb: FormFieldBuilder): void {\n const fields: Set<string> = ReflectUtils.getMetadata(\"dynamicFormFields\", target) || new Set();\n const existing: FormFieldBuilder = ReflectUtils.getMetadata(\"dynamicFormField\", target, propertyKey);\n const builder: FormFieldBuilder = !ObjectUtils.isFunction(existing) ? cb : ((fb, opts, path) => {\n const data = existing(fb, opts, path);\n return ObjectUtils.assign(data || {}, cb(fb, opts, path) || {});\n });\n fields.add(propertyKey);\n ReflectUtils.defineMetadata(\"dynamicFormField\", builder, target, propertyKey);\n ReflectUtils.defineMetadata(\"dynamicFormFields\", fields, target);\n}\n\nexport function FormSerializable(serializer?: FormFieldSerializer): PropertyDecorator {\n return (target: any, key: string): void => {\n defineFormControl(target, key, () => ({\n key,\n serializer,\n serialize: true\n }));\n };\n}\n\nexport function FormInput(data?: FormInputData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n const meta = ReflectUtils.getOwnMetadata(\"design:type\", target, key);\n const type = meta ? meta.name : \"\";\n let inputType = key.indexOf(\"password\") < 0 ? \"text\" : \"password\";\n switch (type) {\n case \"Number\":\n inputType = \"number\";\n break;\n case \"Boolean\":\n inputType = \"checkbox\";\n break;\n }\n data.type = data.type || inputType;\n defineFormControl(\n target, key,\n (fb, path, options) =>\n fb.createFormInput(key, data, path, options)\n );\n };\n}\n\nexport function FormSelect(data?: FormSelectData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) =>\n fb.createFormSelect(key, data, path, options)\n );\n };\n}\n\nexport function FormUpload(data?: FormUploadData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) =>\n fb.createFormUpload(key, data, path, options)\n );\n };\n}\n\nexport function FormFile(data?: FormUploadData): PropertyDecorator {\n console.warn(`@FormFile decorator is deprecated, use @FormUpload instead`);\n return FormUpload(data);\n}\n\nexport function FormGroup(data?: FormGroupData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) => {\n const targetType = ReflectUtils.getOwnMetadata(\"design:type\", target, key);\n return fb.resolveFormGroup(key, targetType, data, path, options);\n }\n );\n };\n}\n\nexport function FormArray(itemType: string | FormInputData | Type<any>, data?: FormArrayData): PropertyDecorator {\n data = data || {};\n return (target: any, key: string): void => {\n defineFormControl(\n target, key,\n (fb, path, options) => {\n return fb.resolveFormArray(key, itemType, data, path, options);\n }\n );\n };\n}\n\nexport function FormModel(data?: FormGroupData): PropertyDecorator {\n console.warn(`@FormModel decorator is deprecated, use @FormGroup instead`);\n return FormGroup(data);\n}\n","import {Injector} from \"@angular/core\";\nimport {LANGUAGE_SERVICE, ObjectUtils} from \"@stemy/ngx-utils\";\nimport {ValidationMessageFn, ValidatorFn} from \"../common-types\";\n\nexport function validationMessage(injector: Injector, key: string, labelPrefix?: string): ValidationMessageFn {\n const language = injector.get(LANGUAGE_SERVICE);\n return (_, field) => {\n return language.getTranslationSync(labelPrefix ? `${labelPrefix}.error.${key}` : `error.${key}`, field);\n }\n}\n\nexport function withName(fn: ValidatorFn, name: string): ValidatorFn {\n fn.validatorName = name;\n return fn;\n}\n\nfunction validateEach(each: boolean, cb: (value: any) => boolean, name: string): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n return each ? Array.isArray(value) && value.every(cb) : cb(value);\n }, name);\n}\n\nexport function jsonValidation(): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n if (!value) return false;\n try {\n JSON.parse(value);\n return true;\n } catch (e) {\n return false;\n }\n }, \"json\");\n}\n\nexport function requiredValidation(): ValidatorFn {\n return withName((control) =>\n ObjectUtils.isString(control.value) ? control.value.length > 0 : ObjectUtils.isDefined(control.value),\n \"required\"\n )\n}\n\nexport function translationValidation(langs: string[] = [\"de\", \"en\"]): ValidatorFn {\n return withName((control) => {\n const value: any[] = control.value;\n if (!value || value.length == 0) return false;\n return value.findIndex(t => langs.includes(t.lang) && !t.translation) < 0;\n }, \"translation\");\n}\n\nexport function phoneValidation(): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n if (!value) return true;\n const phoneRegexp = /^\\d{10,12}$/;\n return phoneRegexp.test(value);\n }, \"phone\");\n}\n\nexport function emailValidation(): ValidatorFn {\n return withName((control) => {\n const value = control.value;\n if (!value) return true;\n const emailRegexp = /^[\\w-.]+@([\\w-]+\\.)+[\\w-]{2,4}$/g;\n return emailRegexp.test(value);\n }, \"email\");\n}\n\nexport function minLengthValidation(minLength: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"string\" && v.length >= minLength, \"minLength\");\n}\n\nexport function maxLengthValidation(maxLength: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"string\" && v.length <= maxLength, \"maxLength\");\n}\n\nexport function minValueValidation(min: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"number\" && v >= min, \"minValue\");\n}\n\nexport function maxValueValidation(max: number, each?: boolean): ValidatorFn {\n return validateEach(each, v => typeof v == \"number\" && v <= max, \"maxValue\");\n}\n","import {BehaviorSubject, Subject} from \"rxjs\";\nimport {ObjectUtils} from \"@stemy/ngx-utils\";\nimport {FormFieldKey, FormFieldConfig} from \"../common-types\";\n\nexport function replaceSpecialChars(str: string, to: string = \"-\"): string {\n return `${str}`.replace(/[&\\/\\\\#, +()$~%.@'\":*?<>{}]/g, to);\n}\n\nexport function getFieldByPath(field: FormFieldConfig, path: string): FormFieldConfig | null {\n if (field.path === path) {\n return field;\n }\n if (!field.fieldGroup) return null;\n for (const sf of field.fieldGroup) {\n const found = getFieldByPath(sf, path);\n if (found) return found;\n }\n return null;\n}\n\nexport function getFieldsByPredicate(field: FormFieldConfig, cb: (field: FormFieldConfig) => boolean): FormFieldConfig[] {\n if (cb(field)) {\n return [field];\n }\n if (!field.fieldGroup) return [];\n const results: FormFieldConfig[] = [];\n for (const sf of field.fieldGroup) {\n results.push(...getFieldsByPredicate(sf, cb));\n }\n return results;\n}\n\nexport function getFieldsByKey(field: FormFieldConfig, key: FormFieldKey): FormFieldConfig[] {\n return getFieldsByPredicate(field, f => f.key === key);\n}\n\nexport function setFieldHidden(field: FormFieldConfig, hidden: boolean = true): void {\n const hide = field.expressions?.hide;\n if (hide) {\n if (hide instanceof Subject) {\n hide.next(hidden);\n return;\n }\n field.expressions.hide = new BehaviorSubject(hidden);\n return;\n }\n field.hide = hidden;\n}\n\nexport function setFieldDisabled(field: FormFieldConfig, disabled: boolean = true): void {\n field.props = {\n ...(field.props || {}),\n disabled\n };\n}\n\nexport function additionalFieldValues(field: FormFieldConfig, values: {[key: string]: any}): void {\n const additional = field.expressions?.additional;\n if (additional instanceof BehaviorSubject) {\n additional.next(ObjectUtils.assign(additional.value, values || {}));\n return;\n }\n field.expressions.additional = new BehaviorSubject(values || {});\n}\n\nexport const MIN_INPUT_NUM = -999999999;\n\nexport const MAX_INPUT_NUM = 999999999;\n\nexport const EDITOR_FORMATS = [\"php\", \"json\", \"html\", \"css\", \"scss\"];\n","import {Injector} from \"@angular/core\";\r\nimport {IOpenApiSchema, IOpenApiSchemaProperty, MaybeArray, ObjectUtils, ForbiddenZone} from \"@stemy/ngx-utils\";\r\nimport {\r\n AllValidationErrors,\r\n ConfigForSchemaOptions,\r\n CustomizerOrSchemaOptions,\r\n FormBuilderOptions,\r\n FormFieldConfig,\r\n FormFieldCustomizer\r\n} from \"../common-types\";\r\nimport {AbstractControl, FormArray, FormGroup} from \"@angular/forms\";\r\n\r\nexport type ConfigForSchemaWrapMode = \"wrap\" | \"customizer\";\r\n\r\nexport interface ConfigForSchemaWrapOptions extends Required<FormBuilderOptions> {\r\n readonly injector: Injector;\r\n readonly schema: IOpenApiSchema;\r\n customize(field: FormFieldConfig, property: IOpenApiSchemaProperty, schema: IOpenApiSchema): Promise<FormFieldConfig[]>;\r\n}\r\n\r\nclass ConfigForSchemaWrap implements ConfigForSchemaWrapOptions {\r\n\r\n get labelPrefix() {\r\n return this.opts.labelPrefix;\r\n }\r\n\r\n get labelCustomizer() {\r\n return this.opts.labelCustomizer;\r\n }\r\n\r\n get testId() {\r\n return this.opts.testId;\r\n }\r\n\r\n protected fieldCustomizer: FormFieldCustomizer;\r\n\r\n constructor(\r\n protected readonly opts: ConfigForSchemaOptions,\r\n protected readonly mode: ConfigForSchemaWrapMode,\r\n readonly injector: Injector,\r\n readonly schema: IOpenApiSchema\r\n ) {\r\n this.fieldCustomizer = this.mode !== \"wrap\" || !ObjectUtils.isFunction(this.opts.fieldCustomizer)\r\n ? field => field\r\n : this.opts.fieldCustomizer;\r\n }\r\n\r\n async customize(field: FormFieldConfig, property: IOpenApiSchemaProperty, schema: IOpenApiSchema) {\r\n field.defaultValue = `${field.props?.type}`.startsWith(\"date\")\r\n ? convertToDate(property.default) : property.default;\r\n const res = await ForbiddenZone.run(\"customizer\", () =>\r\n this.fieldCustomizer(\r\n field, this.forCustomizer(), this.injector,\r\n property, schema\r\n )\r\n );\r\n return !res ? [field] : handleConfigs(res);\r\n }\r\n\r\n forCustomizer(): FormBuilderOptions {\r\n return new ConfigForSchemaWrap(this.opts, \"customizer\", this.injector, this.schema);\r\n }\r\n\r\n forSchema(schema: IOpenApiSchema): ConfigForSchemaWrapOptions {\r\n return new ConfigForSchemaWrap(this.opts, this.mode, this.injector, schema);\r\n }\r\n}\r\n\r\nexport async function toWrapOptions(customizeOrOptions: CustomizerOrSchemaOptions | ConfigForSchemaWrapOptions,\r\n injector: Injector,\r\n schema: IOpenApiSchema,\r\n errorMsg?: string): Promise<ConfigForSchemaWrapOptions> {\r\n if (errorMsg && ForbiddenZone.isForbidden(\"customizer\")) {\r\n throw new Error(errorMsg);\r\n }\r\n if (customizeOrOptions instanceof ConfigForSchemaWrap) {\r\n return customizeOrOptions;\r\n }\r\n let schemaOptions = customizeOrOptions as ConfigForSchemaOptions;\r\n if (!ObjectUtils.isObject(schemaOptions)) {\r\n schemaOptions = {\r\n fieldCustomizer: customizeOrOptions as FormFieldCustomizer\r\n };\r\n }\r\n return new ConfigForSchemaWrap(schemaOptions, \"wrap\", injector, schema);\r\n}\r\n\r\nexport function convertToDate(value: any): any {\r\n if (ObjectUtils.isNullOrUndefined(value)) return null;\r\n const date = ObjectUtils.isDate(value)\r\n ? value\r\n : new Date(value);\r\n return isNaN(date as any) ? new Date() : date;\r\n}\r\n\r\nexport function handleConfigs(configs: MaybeArray<FormFieldConfig>) {\r\n return Array.isArray(configs) ? configs : [configs];\r\n}\r\n\r\nexport function isStringWithVal(val: any): boolean {\r\n return typeof val == \"string\" && val.length > 0;\r\n}\r\n\r\nexport function findRefs(property: IOpenApiSchemaProperty): string[] {\r\n const refs = Array.isArray(property.allOf)\r\n ? property.allOf.map(o => o.$ref).filter(isStringWithVal)\r\n : [property.items?.$ref, property.$ref].filter(isStringWithVal);\r\n return refs.map(t => t.split(\"/\").pop());\r\n}\r\n\r\nexport function mergeFormFields(formFields: FormFieldConfig[][]): FormFieldConfig[] {\r\n const res: FormFieldConfig[] = [];\r\n for (const formModel of formFields) {\r\n for (const subModel of formModel) {\r\n const index = res.findIndex(t => t.key == subModel.key);\r\n if (index >= 0) {\r\n res[index] = subModel;\r\n continue;\r\n }\r\n res.push(subModel);\r\n }\r\n }\r\n return res;\r\n}\r\n\r\ninterface FormGroupControls {\r\n [key: string]: AbstractControl;\r\n}\r\n\r\nexport function getFormValidationErrors(controls: FormGroupControls, parentPath: string = \"\"): AllValidationErrors[] {\r\n const errors: AllValidationErrors[] = [];\r\n Object.entries(controls).forEach(([name, control], ix) => {\r\n const path = !parentPath ? name : `${parentPath}.${name}`;\r\n if (control instanceof FormGroup) {\r\n getFormValidationErrors(control.controls, path).forEach(error => errors.push(error));\r\n return;\r\n }\r\n if (control instanceof FormArray) {\r\n control.controls.forEach((control: FormGroup, ix) => {\r\n getFormValidationErrors(control.controls, `${path}.${ix}`).forEach(error => errors.push(error));\r\n });\r\n return;\r\n }\r\n Object.entries(control.errors || {}).forEach(([errorKey, errorValue]) => {\r\n errors.push({control, path, errorKey, errorValue});\r\n });\r\n });\r\n return errors;\r\n}\r\n","import {Inject, Injectable, Injector, Type} from \"@angular/core\";\nimport {BehaviorSubject, distinctUntilChanged, startWith, switchMap} from \"rxjs\";\nimport {\n API_SERVICE,\n IApiService,\n ILanguageService,\n LANGUAGE_SERVICE,\n MaybePromise,\n ObjectUtils,\n ReflectUtils\n} from \"@stemy/ngx-utils\";\n\nimport {\n FormArrayData,\n FormBuilderOptions,\n FormFieldConfig,\n FormFieldData,\n FormFieldExpressions,\n FormFieldProps,\n FormGroupData,\n FormHookConfig,\n FormInputData,\n FormSelectData,\n FormSelectOption,\n FormUploadData,\n Validators\n} from \"../common-types\";\nimport {validationMessage} from \"../utils/validation\";\nimport {MAX_INPUT_NUM, MIN_INPUT_NUM} from \"../utils/misc\";\nimport {isStringWithVal} from \"../utils/internal\";\n\nexport type FormFieldBuilder = (fb: DynamicFormBuilderService, parent: FormFieldConfig, options: FormBuilderOptions) => Partial<FormFieldConfig>;\n\n@Injectable()\nexport class DynamicFormBuilderService {\n\n constructor(readonly injector: Injector,\n @Inject(API_SERVICE) readonly api: IApiService,\n @Inject(LANGUAGE_SERVICE) readonly language: ILanguageService) {\n }\n\n resolveFormFields(target: Type<any>, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig[] {\n const prototype = target?.prototype || {};\n const fields: Set<string> = ReflectUtils.getMetadata(\"dynamicFormFields\", target?.prototype || {}) || new Set();\n const result: FormFieldConfig[] = [];\n for (const key of fields) {\n const builder: FormFieldBuilder = ReflectUtils.getMetadata(\"dynamicFormField\", prototype, key);\n const field = builder(this, parent, options) as FormFieldConfig;\n if (field) {\n result.push(field);\n }\n }\n return this.createFieldSets(result, parent, options);\n }\n\n resolveFormGroup(key: string, target: Type<any>, data: FormGroupData, parent: FormFieldConfig = null, options: FormBuilderOptions = {}): FormFieldConfig {\n return this.createFormGroup(key, sp => this.resolveFormFields(\n target, sp, options\n ), data, parent, options);\n }\n\n resolveFormArray(key: string, itemType: string | FormInputData | Type<any>, data: FormArrayData, parent: FormFieldConfig = null, options: FormBuilderOptions = {}): FormFieldConfig {\n return this.createFormArray(key, sp => {\n return typeof itemType === \"function\" ? this.resolveFormFields(\n itemType, sp, options\n ) : this.createFormInput(\"\", typeof itemType === \"string\" ? {type: `${itemType}`} : itemType, null, options);\n }, data, parent, options);\n }\n\n createFieldSets(fields: FormFieldConfig[], parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig[] {\n const others: FormFieldConfig[] = [];\n const groups: { [fs: string]: FormFieldConfig[] } = {};\n fields = fields.filter(f => {\n if (Array.isArray(f.fieldGroup) && Array.isArray(f.wrappers) && f.wrappers[0] === \"form-fieldset\") {\n // This field is an already existing set\n groups[f.id] = f.fieldGroup;\n return false;\n }\n return true;\n });\n\n for (const field of fields) {\n const fsName = field.hide ? null : String(field.fieldSet || \"\");\n // If we have a fieldset name defined and have actual fields for it\n // then push the property fields into a group\n if (fsName) {\n const fsId = !parent?.path ? fsName : `${parent.path}.${fsName}`;\n const group = groups[fsId] || [];\n groups[fsId] = group;\n group.push(field);\n continue;\n }\n // Otherwise just push the fields to the others\n others.push(field);\n }\n\n // Create a field-set wrapper for each group and concat the other fields to the end\n return Object.keys(groups).map(id => {\n const key = id.split(\".\").pop();\n const fieldSet: FormFieldConfig = {\n id,\n parent,\n fieldGroup: groups[id],\n wrappers: [\"form-fieldset\"],\n className: `dynamic-form-fieldset dynamic-form-fieldset-${id}`,\n props: {\n label: this.getLabel(key, key, parent, options),\n hidden: false\n },\n hooks: {},\n expressions: {}\n };\n this.setExpressions(fieldSet, options);\n return fieldSet;\n }).concat(others);\n }\n\n createFormInput(key: string, data: FormInputData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n data = data || {};\n const type = `${data.type || \"text\"}`;\n const autocomplete = data.autocomplete || (type === \"password\" ? \"new-password\" : \"none\");\n return this.createFormField(key, type === \"checkbox\" || type === \"textarea\" ? type : \"input\", data, {\n type,\n autocomplete,\n pattern: ObjectUtils.isString(data.pattern) ? data.pattern : \"\",\n step: data.step,\n cols: data.cols || null,\n rows: data.rows || 10,\n min: isNaN(data.min) ? MIN_INPUT_NUM : data.min,\n max: isNaN(data.max) ? MAX_INPUT_NUM : data.max,\n minLength: isNaN(data.minLength) ? 0 : data.minLength,\n maxLength: isNaN(data.maxLength) ? MAX_INPUT_NUM : data.maxLength,\n placeholder: data.placeholder || \"\",\n indeterminate: data.indeterminate || false,\n suffix: data.suffix || \"\",\n attributes: {\n autocomplete\n },\n }, parent, options);\n }\n\n createFormSelect(key: string, data: FormSelectData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n data = data || {};\n const type = `${data.type || \"select\"}`;\n const select = this.createFormField(key, type === \"radio\" ? type : \"select\", data, {\n type,\n multiple: data.multiple,\n groupBy: data.groupBy,\n allowEmpty: data.allowEmpty\n }, parent, options);\n select.hooks = Object.assign(select.hooks, {\n onInit: field => {\n const options = data.options?.(field) || [];\n const control = field.formControl.root;\n field.props.options = options instanceof Promise ? control.valueChanges.pipe(\n startWith(control.value),\n distinctUntilChanged(),\n switchMap(async () => {\n const results: FormSelectOption[] = await data.options(field) as any;\n return this.fixSelectOptions(field, results);\n })\n ) : options;\n }\n } as FormHookConfig);\n return select;\n }\n\n createFormUpload(key: string, data: FormUploadData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n data = data || {};\n\n if (data.asFile) {\n data.inline = true;\n console.warn(`File upload property \"asFile\" is deprecated. Use \"inline\" instead.`);\n }\n\n if (data.multi) {\n data.multiple = true;\n console.warn(`File upload property \"multi\" is deprecated. Use \"multiple\" instead.`);\n }\n\n return this.createFormField(key, \"upload\", data, {\n inline: data.inline === true,\n multiple: data.multiple === true,\n accept: data.accept || [\".png\", \".jpg\"],\n url: data.url?.startsWith(\"http\") ? data.url : this.api.url(data.url || \"assets\"),\n maxSize: isNaN(data.maxSize) ? MAX_INPUT_NUM : data.maxSize,\n uploadOptions: data.uploadOptions || {},\n createUploadData: data.createUploadData\n }, parent, options);\n }\n\n createFormGroup(key: string, fields: (parent: FormFieldConfig) => FormFieldConfig[], data: FormGroupData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig\n createFormGroup(key: string, fields: (parent: FormFieldConfig) => Promise<FormFieldConfig[]>, data: FormGroupData, parent: FormFieldConfig, options: FormBuilderOptions): Promise<FormFieldConfig>\n createFormGroup(key: string, fields: (parent: FormFieldConfig) => any, data: FormGroupData, parent: FormFieldConfig, options: FormBuilderOptions): MaybePromise<FormFieldConfig> {\n data = data || {};\n const group = this.createFormField(key, undefined, data, {}, parent, options);\n group.wrappers = [\"form-group\"];\n const result = fields(group);\n const handleGroup = (fieldGroup: FormFieldConfig[]) => {\n group.fieldGroup = fieldGroup;\n return group;\n };\n return result instanceof Promise\n ? result.then(handleGroup)\n : handleGroup(result);\n }\n\n createFormArray(key: string, fields: (parent: FormFieldConfig) => FormFieldConfig | FormFieldConfig[], data: FormArrayData, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig\n createFormArray(key: string, fields: (parent: FormFieldConfig) => Promise<FormFieldConfig | FormFieldConfig[]>, data: FormArrayData, parent: FormFieldConfig, options: FormBuilderOptions): Promise<FormFieldConfig>\n createFormArray(key: string, fields: (parent: FormFieldConfig) => any, data: FormArrayData, parent: FormFieldConfig, options: FormBuilderOptions): MaybePromise<FormFieldConfig> {\n data = data || {};\n const array = this.createFormField(key, \"array\", data, {\n // initialCount: data.initialCount || 0,\n // sortable: data.sortable || false,\n useTabs: data.useTabs === true,\n tabsLabel: `${data.tabsLabel || \"label\"}`,\n addItem: data.addItem !== false,\n insertItem: data.insertItem !== false,\n cloneItem: data.cloneItem !== false,\n moveItem: data.moveItem !== false,\n removeItem: data.removeItem !== false,\n clearItems: data.clearItems !== false\n }, parent, options);\n const result = fields(array);\n const handleItems = (items: FormFieldConfig | FormFieldConfig[]) => {\n if (Array.isArray(items)) {\n array.fieldArray = {\n wrappers: [\"form-group\"],\n fieldGroup: items,\n hooks: {},\n expressions: {}\n };\n return array;\n }\n const props = items.props || {};\n if (props.type === \"text\" || props.type === \"number\") {\n array.type = \"chips\";\n array.wrappers = [\"form-field\"];\n array.props = {\n ...props,\n ...array.props,\n multiple: true\n };\n return array;\n }\n array.fieldArray = {\n ...items,\n props: {\n ...items.props,\n label: \"\"\n }\n };\n return array;\n };\n return result instanceof Promise\n ? result.then(handleItems)\n : handleItems(result);\n }\n\n async fixSelectOptions(field: FormFieldConfig, options: FormSelectOption[]): Promise<FormSelectOption[]> {\n if (!options) return [];\n for (const option of options) {\n const classes = Array.isArray(option.classes) ? option.classes : [`${option.classes}`];\n option.className = classes.filter(isStringWithVal).join(\" \");\n option.label = await this.language.getTranslation(option.label);\n option.value = option.value ?? option.id;\n option.id = option.id ?? option.value;\n }\n const control = field.formControl;\n if (field.props.multiple || options.length === 0 || options.findIndex(o => o.value === control.value) >= 0) return options;\n control.setValue(options[0].value);\n return options;\n }\n\n protected getLabel(key: string, label: string, parent: FormFieldConfig, options: FormBuilderOptions): string {\n const labelPrefix = !ObjectUtils.isString(options.labelPrefix) ? `` : options.labelPrefix;\n const pathPrefix = `${parent?.props?.label || labelPrefix}`;\n const labelItems = ObjectUtils.isString(label)\n ? (!label ? [] : [labelPrefix, label])\n : [pathPrefix, `${key || \"\"}`]\n return labelItems.filter(l => l.length > 0).join(\".\");\n }\n\n protected createFormField(key: string, type: string, data: FormFieldData, props: FormFieldProps, parent: FormFieldConfig, options: FormBuilderOptions): FormFieldConfig {\n const validators = Array.isArray(data.validators)\n ? data.validators.reduce((res, validator, ix) => {\n res[validator.validatorName || `validator_${ix}`] = validator;\n return res;\n }, {} as Validators)\n : data.validators || {};\n const hide = new BehaviorSubject(data.hidden === true);\n const additional = new BehaviorSubject({});\n const field: FormFieldConfig = {\n key,\n type,\n validators,\n parent,\n fieldSet: String(data.fieldSet || \"\"),\n resetOnHide: false,\n validation: {\n messages: Object.keys(validators).reduce((res, key) => {\n res[key] = validationMessage(this.injector, key, options.labelPrefix);\n return res;\n }, {})\n },\n props: {\n ...props,\n disabled: data.disabled === true,\n formCheck: \"nolabel\",\n required: !!validators.required,\n label: options.labelCustomizer?.(key, data.label, parent, options.labelPrefix)\n ?? this.getLabel(key, data.label, parent, options),\n },\n modelOptions: {\n updateOn: \"change\"\n },\n fieldGroupClassName: \"field-container\",\n hooks: {},\n expressions: {\n hide,\n additional,\n className: (target: FormFieldConfig) => {\n return target.hide ? `` : [`dynamic-form-field`, `dynamic-form-field-${target.key}`, `dynamic-form-${target.type || \"group\"}`].concat(\n Array.isArray(data.classes) ? data.classes : [data.classes || \"\"]\n ).filter(c => c?.length > 0).join(\" \");\n }\n }\n };\n this.setExpressions(field, options);\n return field;\n }\n\n protected setExpressions(field: FormFieldConfig, options: FormBuilderOptions): void {\n const expressions: FormFieldExpressions = {\n path: target => {\n const tp = target.parent;\n const key = !target.key ? `` : `.${target.key}`;\n return !tp?.path ? `${target.key || \"\"}` : `${tp.path}.${key}`;\n },\n testId: target => {\n const tp = target.parent;\n const prefix = !options.testId ? `` : `${options.testId}-`;\n const key = !target.key ? `` : `-${target.key}`;\n return !tp?.testId ? `${prefix}${target.key || key}` : `${tp.testId}${key}`;\n }\n };\n Object.entries(expressions).forEach(([key, expression]) => {\n field.expressions = field.expressions ?? {};\n field.expressions[key] = expression;\n if (ObjectUtils.isFunction(expression)) {\n field[key] = expression(field);\n }\n });\n }\n}\n","import {Injectable, Injector} from \"@angular/core\";\nimport {AbstractControl, FormArray, FormGroup} from \"@angular/forms\";\nimport {distinctUntilChanged, firstValueFrom, from, isObservable, startWith, switchMap} from \"rxjs\";\nimport {\n IApiService,\n ILanguageService, IOpenApiSchema,\n IOpenApiSchemaProperty,\n ObjectUtils,\n OpenApiService,\n StringUtils\n} from \"@stemy/ngx-utils\";\n\nimport {\n CustomizerOrSchemaOptions,\n FormFieldConfig,\n FormFieldData,\n FormSelectOption,\n FormSelectOptions,\n Validators\n} from \"../common-types\";\n\nimport {\n emailValidation,\n maxLengthValidation,\n maxValueValidation,\n minLengthValidation,\n minValueValidation,\n requiredValidation\n} from \"../utils/validation\";\nimport {\n ConfigForSchemaWrapOptions,\n convertToDate,\n findRefs,\n isStringWithVal,\n mergeFormFields,\n toWrapOptions\n} from \"../utils/internal\";\n\nimport {DynamicFormBuilderService} from \"./dynamic-form-builder.service\";\n\n@Injectable()\nexport class DynamicFormSchemaService {\n\n get api(): IApiService {\n return this.openApi.api;\n }\n\n get language(): ILanguageService {\n return this.api.language;\n }\n\n constructor(protected readonly openApi: OpenApiService,\n protected readonly injector: Injector,\n protected readonly builder: DynamicFormBuilderService) {\n }\n\n async getSchema(name: string): Promise<IOpenApiSchema> {\n return this.openApi.getSchema(name);\n }\n\n async getFormFieldsForSchema(name: string,\n parent: FormFieldConfig,\n customizeOrOptions: CustomizerOrSchemaOptions): Promise<FormFieldConfig[]> {\n const schema = await this.getSchema(name);\n if (!schema) return [];\n const options = await toWrapOptions(customizeOrOptions, this.injector, schema);\n const keys = Object.keys(schema.properties || {});\n const fields: FormFieldConfig[] = [];\n // Collect all properties of this schema def\n for (const key of keys) {\n const property = schema.properties[key];\n const propFields = await this.getFormFieldsForProp(property, schema, options, parent);\n fields.push(...propFields);\n }\n return this.builder.createFieldSets(\n fields.filter(f => null !== f),\n parent, options\n );\n }\n\n protected async getFormFieldsForProp(property: IOpenApiSchemaProperty, schema: IOpenApiSchema, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig[]> {\n const field = await this.getFormFieldForProp(property, options, parent);\n return !field ? [] : options.customize(field, property, schema);\n }\n\n protected async getFormFieldForProp(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig> {\n const $enum = property.items?.enum || property.enum;\n if (Array.isArray($enum) || isStringWithVal(property.optionsPath) || isStringWithVal(property.endpoint)) {\n return this.getFormSelectConfig(property, options, parent);\n }\n switch (property.type) {\n case \"string\":\n case \"number\":\n case \"integer\":\n case \"textarea\":\n // if (this.checkIsEditorProperty(property)) {\n // return this.getFormEditorConfig(property, options, parent);\n // }\n if (property.format == \"textarea\") {\n return this.getFormTextareaConfig(property, options, parent);\n }\n if (property.format == \"date\" || property.format == \"date-time\") {\n return this.getFormDatepickerConfig(property, options, parent);\n }\n return this.getFormInputConfig(property, options, parent);\n // case \"object\":\n // return this.getFormEditorConfig(property, options, parent);\n case \"boolean\":\n return this.getFormCheckboxConfig(property, options, parent);\n case \"array\":\n return this.getFormArrayConfig(property, options, parent);\n case \"file\":\n case \"upload\":\n return this.getFormUploadConfig(property, options, parent);\n }\n if (findRefs(property).length > 0) {\n return this.getFormGroupConfig(property, options, parent);\n }\n return null;\n }\n\n protected getFormFieldData(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions): FormFieldData {\n const validators: Validators = {};\n const schema = options.schema;\n if (ObjectUtils.isArray(schema.required) && schema.required.indexOf(property.id) >= 0) {\n validators.required = requiredValidation();\n }\n this.addPropertyValidators(validators, property);\n this.addItemsValidators(validators, property.items);\n return {\n hidden: property.hidden === true,\n fieldSet: property.fieldSet,\n classes: property.classes,\n validators\n };\n }\n\n protected async getFormArrayConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig> {\n return this.builder.createFormArray(property.id, async sp => {\n const subSchemas = findRefs(property);\n if (subSchemas.length > 0) {\n const subModels = await Promise.all(\n subSchemas.map(s => this.getFormFieldsForSchema(s, sp, options))\n );\n return mergeFormFields(ObjectUtils.copy(subModels));\n }\n return this.getFormFieldForProp(property.items, options, null);\n }, {\n ...this.getFormFieldData(property, options),\n // initialCount: property.initialCount || 0,\n // sortable: property.sortable || false,\n useTabs: property.useTabs,\n tabsLabel: property.tabsLabel,\n addItem: property.addItem,\n insertItem: property.insertItem,\n cloneItem: property.cloneItem,\n moveItem: property.moveItem,\n removeItem: property.removeItem,\n clearItems: property.clearItems\n }, parent, options);\n }\n\n protected async getFormGroupConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): Promise<FormFieldConfig> {\n return this.builder.createFormGroup(property.id, async sp => {\n const subSchemas = findRefs(property);\n const subModels = await Promise.all(\n subSchemas.map(s => this.getFormFieldsForSchema(s, sp, options))\n );\n return mergeFormFields(subModels);\n }, {\n ...this.getFormFieldData(property, options),\n }, parent, options);\n }\n\n protected getFormInputConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n let type = StringUtils.has(property.id || \"\", \"password\", \"Password\") ? \"password\" : (property.format || property.type);\n switch (type) {\n case \"string\":\n type = \"text\";\n break;\n case \"boolean\":\n type = \"checkbox\";\n break;\n case \"textarea\":\n type = \"textarea\";\n break;\n case \"integer\":\n type = \"number\";\n break;\n }\n const sub = property.type == \"array\" ? property.items || property : property;\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type,\n autocomplete: property.autocomplete,\n pattern: property.pattern,\n step: isNaN(sub.step) ? property.step : sub.step,\n min: sub.minimum,\n max: sub.maximum,\n minLength: sub.minLength,\n maxLength: sub.maxLength,\n placeholder: property.placeholder,\n indeterminate: property.indeterminate,\n suffix: property.suffix\n }, parent, options);\n }\n\n protected getFormTextareaConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type: \"textarea\",\n autocomplete: property.autoComplete,\n cols: property.cols || null,\n rows: property.rows || 10,\n minLength: property.minLength,\n maxLength: property.maxLength,\n placeholder: property.placeholder || \"\"\n }, parent, options);\n }\n\n // getFormEditorConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrap): DynamicEditorModelConfig {\n // const sub = property.type == \"array\" ? property.items || property : property;\n // return Object.assign(\n // this.getFormControlConfig(property, options),\n // {\n // inputType: property.format || \"json\",\n // convertObject: property.type !== \"string\",\n // autoComplete: property.autoComplete || \"off\",\n // multiple: property.type == \"array\",\n // accept: ObjectUtils.isString(property.accept) ? property.accept : null,\n // mask: ObjectUtils.isString(property.mask) ? property.mask : null,\n // pattern: ObjectUtils.isString(property.pattern) ? property.pattern : null,\n // step: isNaN(sub.step) ? (isNaN(property.step) ? 1 : property.step) : sub.step,\n // minLength: isNaN(sub.minLength) ? 0 : sub.minLength,\n // maxLength: isNaN(sub.maxLength) ? MAX_INPUT_NUM : sub.maxLength,\n // placeholder: property.placeholder || \"\"\n // }\n // );\n // }\n\n protected getFormDatepickerConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type: property.format == \"date-time\" ? \"datetime-local\" : \"date\",\n // format: property.dateFormat || \"dd.MM.yyyy\",\n min: convertToDate(property.min),\n max: convertToDate(property.max),\n }, parent, options);\n }\n\n protected getFormSelectConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormSelect(property.id, {\n ...this.getFormFieldData(property, options),\n options: field => this.getFormSelectOptions(property, options, field),\n type: property.format || \"select\",\n multiple: property.type == \"array\",\n groupBy: property.groupBy,\n allowEmpty: property.allowEmpty\n }, parent, options);\n }\n\n protected getFormUploadConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormUpload(property.id, {\n ...this.getFormFieldData(property, options),\n multiple: property.type === \"array\",\n inline: property.inline,\n accept: property.accept,\n url: property.url,\n maxSize: property.maxSize,\n uploadOptions: property.uploadOptions\n }, parent, options);\n }\n\n protected getFormCheckboxConfig(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, parent: FormFieldConfig): FormFieldConfig {\n return this.builder.createFormInput(property.id, {\n ...this.getFormFieldData(property, options),\n type: \"checkbox\",\n indeterminate: property.indeterminate || false\n }, parent, options);\n }\n\n protected getFormSelectOptions(property: IOpenApiSchemaProperty, options: ConfigForSchemaWrapOptions, field: FormFieldConfig): FormSelectOptions {\n const $enum = property.items?.enum || property.enum;\n if (Array.isArray($enum)) {\n return from(this.builder.fixSelectOptions(field, $enum.map(value => {\n const label = options.labelPrefix\n ? this.language.getTranslationSync(`${options.labelPrefix}.${property.id}.${value}`)\n : `${property.id}.${value}`;\n return {value, label};\n })));\n }\n if (isStringWithVal(property.endpoint)) {\n const entries = Object.entries((field.formControl.root as FormGroup)?.controls || {});\n const endpoint = entries.reduce((res, [key, control]) => {\n return this.replaceOptionsEndpoint(res, key, control?.value);\n }, `${property.endpoint}`);\n this.api.cache[endpoint] = this.api.cache[endpoint] || this.api.list(endpoint, this.api.makeListParams(1, -1)).then(result => {\n const items = ObjectUtils.isArray(result)\n ? result\n : (ObjectUtils.isArray(result.items) ? result.items : []);\n return items.map(i => {\n const item = ObjectUtils.isObject(i) ? i : {id: i};\n return {\n ...item,\n value: item.id || item._id,\n label: item[property.labelField] || item.label || item.id || item._id\n };\n });\n });\n const options = this.api.cache[endpoint] as Promise<FormSelectOption[]>;\n return from(options.then(opts => {\n return this.builder.fixSelectOptions(field, opts.map(o => Object.assign({}, o)))\n }));\n }\n let path = property.optionsPath as string;\n let control = field.formControl;\n let current = field;\n if (path.startsWith(\"$root\")) {\n path = path.substring(5);\n control = control.root || control;\n while (current.parent) {\n current = current.parent;\n }\n }\n while (path.startsWith(\".\")) {\n path = path.substring(1);\n control = control.parent || control;\n current = current.parent || current;\n }\n control = !path ? control : control.get(path);\n return control.valueChanges.pipe(\n startWith(control.value),\n distinctUntilChanged(),\n switchMap(async (controlVal) => {\n const currentOpts = current.props.options;\n const finalOpts = isObservable(currentOpts)\n ? await firstValueFrom(currentOpts)\n : (Array.isArray(currentOpts) ? currentOpts : []);\n return this.builder.fixSelectOptions(field, (!Array.isArray(controlVal) ? [] : controlVal).map(value => {\n const modelOption = finalOpts.find(t => t.value == value);\n return {value, label: modelOption?.label || value};\n }));\n })\n );\n }\n\n protected replaceOptionsEndpoint(endpoint: string, key: string, value: any): string {\n if (ObjectUtils.isObject(value)) {\n return Object.entries(value).reduce((res, [k, v]) => {\n return this.replaceOptionsEndpoint(res, `${key}.${k}`, v);\n }, endpoint)\n }\n if (ObjectUtils.isArray(value)) {\n return value.reduce((res, v, i) => {\n return this.replaceOptionsEndpoint(res, `${key}.${i}`, v);\n }, endpoint)\n }\n return endpoint.replace(new RegExp(`\\\\$${key}`, \"gi\"), `${value ?? \"\"}`);\n }\n\n protected showErrorsForGroup(formGroup: FormGroup): void {\n if (!formGroup) return;\n formGroup.markAsTouched({onlySelf: true});\n const controls = Object.keys(formGroup.controls).map(id => formGroup.controls[id]);\n this.showErrorsForControls(controls);\n }\n\n protected showErrorsForControls(controls: AbstractControl[]): void {\n controls.forEach(control => {\n if (control instanceof FormGroup) {\n this.showErrorsForGroup(control);\n return;\n }\n control.markAsTouched({onlySelf: true});\n if (control instanceof FormArray) {\n this.showErrorsForControls(control.controls);\n }\n });\n }\n\n protected addPropertyValidators(validators: Validators, property: IOpenApiSchemaProperty): void {\n if (!property) return;\n if (!isNaN(property.minLength)) {\n validators.minLength = minLengthValidation(property.minLength);\n }\n if (!isNaN(property.maxLength)) {\n validators.maxLength = maxLengthValidation(property.maxLength);\n }\n if (!isNaN(property.minimum)) {\n validators.min = minValueValidation(property.minimum);\n }\n if (!isNaN(property.maximum)) {\n validators.max = maxValueValidation(property.maximum);\n }\n // if (isString(property.pattern) && property.pattern.length) {\n // validators.pattern = property.pattern;\n // }\n switch (property.format) {\n case \"email\":\n validators.email = emailValidation();\n break;\n }\n }\n\n protected addItemsValidators(validators: Validators, items: IOpenApiSchemaProperty): void {\n if (!items) return;\n if (!isNaN(items.minLength)) {\n validators.itemsMinLength = minLengthValidation(items.minLength, true);\n }\n if (!isNaN(items.maxLength)) {\n validators.itemsMaxLength = maxLengthValidation(items.maxLength, true);\n }\n if (!isNaN(items.minimum)) {\n validators.itemsMinValue = minValueValidation(items.minimum, true);\n }\n if (!isNaN(items.maximum)) {\n validators.itemsMaxValue = maxValueValidation(items.maximum, true);\n }\n }\n}\n","import {Inject, Injectable, Injector} from \"@angular/core\";\nimport {AbstractControl, FormArray, FormGroup} from \"@angular/forms\";\nimport {first} from \"rxjs\";\nimport {API_SERVICE, IApiService, ObjectUtils} from \"@stemy/ngx-utils\";\n\nimport {\n CustomizerOrSchemaOptions,\n FORM_ROOT_KEY,\n FormFieldConfig,\n FormSerializeResult,\n IDynamicForm\n} from \"../common-types\";\nimport {getFormValidationErrors, toWrapOptions} from \"../utils/internal\";\n\nimport {DynamicFormSchemaService} from \"./dynamic-form-schema.service\";\nimport {DynamicFormBuilderService} from \"./dynamic-form-builder.service\";\n\n@Injectable()\nexport class DynamicFormService {\n\n constructor(protected readonly fs: DynamicFormSchemaService,\n protected readonly fb: DynamicFormBuilderService,\n protected readonly injector: Injector,\n @Inject(API_SERVICE) protected readonly api: IApiService) {\n\n }\n\n async getFormFieldsForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig[]> {\n const group = await this.getFormFieldGroupBySchemaName(name, customizeOrOptions, \"getFormFieldsForSchema\");\n return group.fieldGroup;\n }\n\n async getFormFieldGroupForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig> {\n return this.getFormFieldGroupBySchemaName(name, customizeOrOptions, \"getFormFieldsForSchema\");\n }\n\n protected async getFormFieldGroupBySchemaName(name: string, customizeOrOptions: CustomizerOrSchemaOptions, restrictedMethod: string): Promise<FormFieldConfig> {\n const config = {\n key: FORM_ROOT_KEY,\n path: \"\",\n wrappers: [\"form-group\"]\n } as FormFieldConfig;\n const schema = await this.fs.getSchema(name);\n const wrapOptions = await toWrapOptions(\n customizeOrOptions, this.injector, schema,\n `\"DynamicFormService.${restrictedMethod}\" is called from a customizer, which is not allowed. Please use DynamicFormSchemaService instead!`\n );\n const fields = await this.fs.getFormFieldsForSchema(name, config, wrapOptions);\n const fieldGroup = [...fields];\n\n config.fieldGroup = fieldGroup;\n\n // There are no actual fields in the schema, or no schema exists\n if (fields.length === 0) return config;\n\n // Add id fields if necessary\n const idFields: FormFieldConfig[] = [\n this.fb.createFormInput(\"id\", {hidden: true}, null, wrapOptions),\n this.fb.createFormInput(\"_id\", {hidden: true}, null, wrapOptions)\n ];\n\n fieldGroup.unshift(...idFields\n .filter(t => !fields.some(c => c.key == t.key))\n );\n\n const root = await wrapOptions.customize(config, {\n id: FORM_ROOT_KEY,\n type: \"object\",\n properties: schema?.properties || {}\n }, schema);\n // Check if the customized root wrapper returned an array\n fields.length = 0;\n\n for (const model of root) {\n if (model.key === FORM_ROOT_KEY) {\n return model;\n } else {\n fields.push(model);\n }\n }\n\n return {\n ...config,\n fieldGroup: fields\n };\n }\n\n async validateForm(form: IDynamicForm, showErrors: boolean = true): Promise<any> {\n const group = form.group();\n if (!group) return Promise.resolve();\n return new Promise<any>((resolve, reject) => {\n group.statusChanges\n .pipe(first(status => status == \"VALID\" || status == \"INVALID\"))\n .subscribe(status => {\n if (showErrors) {\n this.showErrorsForGroup(group);\n }\n if (status == \"VALID\") {\n resolve(null);\n return;\n }\n reject(getFormValidationErrors(group.controls));\n });\n group.updateValueAndValidity();\n });\n }\n\n async serializeForm(form: IDynamicForm, validate: boolean = true): Promise<FormSerializeResult> {\n const fields = form.config();\n if (!fields) return null;\n if (validate) {\n await this.validateForm(form);\n }\n return this.serialize(fields);\n }\n\n async serialize(fields: FormFieldConfig[]): Promise<FormSerializeResult> {\n const result = {};\n if (!fields) return result;\n for (const field of fields) {\n const serializer = field.serializer;\n const key = `${field.key}`;\n if (ObjectUtils.isFunction(serializer)) {\n result[key] = await serializer(field, this.injector);\n continue;\n }\n if (field.hide && !field.serialize) {\n continue;\n }\n const control = field.formControl;\n if (field.fieldGroup) {\n const group = await this.serialize(field.fieldGroup);\n if (field.key) {\n result[key] = !field.fieldArray ? group : Object.values(group);\n continue;\n }\n Object.assign(result, group);\n continue;\n }\n result[key] = control.value;\n }\n return result;\n }\n\n protected showErrorsForGroup(formGroup: FormGroup): void {\n if (!formGroup) return;\n formGroup.markAsTouched({onlySelf: true});\n const controls = Object.keys(formGroup.controls).map(id => formGroup.controls[id]);\n this.showErrorsForControls(controls);\n }\n\n protected showErrorsForControls(controls: AbstractControl[]): void {\n controls.forEach(control => {\n if (control instanceof FormGroup) {\n this.showErrorsForGroup(control);\n return;\n }\n control.markAsTouched({onlySelf: true});\n if (control instanceof FormArray) {\n this.showErrorsForControls(control.controls);\n }\n });\n }\n}\n","import {\n computed,\n Directive,\n effect,\n ElementRef,\n HostBinding,\n HostListener,\n inject,\n input,\n output,\n Renderer2,\n signal\n} from \"@angular/core\";\nimport {outputToObservable} from \"@angular/core/rxjs-interop\";\nimport {debounceTime} from \"rxjs/operators\";\nimport {IAsyncMessage, TOASTER_SERVICE} from \"@stemy/ngx-utils\";\n\nimport {AsyncSubmitMethod, IDynamicForm} from \"../common-types\";\n\n@Directive({\n standalone: false,\n selector: \"[async-submit]\",\n exportAs: \"async-submit\"\n})\nexport class AsyncSubmitDirective {\n\n method = input<AsyncSubmitMethod>(null, {alias: \"async-submit\"});\n form = input<IDynamicForm>();\n context = input<any>();\n\n onSuccess = output<IAsyncMessage>();\n onError = output<IAsyncMessage>();\n\n toaster = inject(TOASTER_SERVICE);\n renderer = inject(Renderer2);\n elem = inject<ElementRef<HTMLElement>>(ElementRef);\n\n protected status = computed(() => {\n const form = this.form();\n return form?.status() || null;\n });\n\n protected group = computed(() => {\n const form = this.form();\n return form?.group() || null;\n });\n\n protected loading = signal(false);\n protected callback = signal<() => void>(null);\n\n @HostBinding(\"class.disabled\")\n get isDisabled(): boolean {\n return this.status() !== \"VALID\";\n }\n\n @HostBinding(\"class.loading\")\n get isLoading(): boolean {\n return this.loading();\n }\n\n constructor() {\n effect(() => {\n if (this.elem.nativeElement.tagName === \"BUTTON\") {\n this.renderer.setAttribute(this.elem.nativeElement, \"type\", \"button\");\n }\n });\n effect(() => {\n const status = this.status();\n const cb = this.callback();\n if (!cb || status == \"PENDING\") return;\n if (status === \"VALID\") {\n cb();\n }\n this.callback.set(null);\n });\n effect(() => {\n const form = this.form();\n if (!form) return;\n const sub = outputToObservable(form.onSubmit)\n .pipe(debounceTime(200)).subscribe(() => this.callMethod());\n return () => sub.unsubscribe();\n });\n }\n\n @HostListener(\"click\")\n click(): void {\n const status = this.status();\n if (status !== \"VALID\" && status !== \"INVALID\") {\n this.callback.set(() => this.callMethod());\n return;\n }\n this.callMethod();\n }\n\n callMethod(): void {\n if (this.loading()) return;\n this.loading.set(true);\n this.method()(this.form(), this.context).then(result => {\n this.loading.set(false);\n if (result) {\n this.onSuccess.emit(result);\n this.toaster.success(result.message, result.context);\n }\n }, reason => {\n if (!reason || !reason.message)\n throw new Error(\"Reason must implement IAsyncMessage interface\");\n this.loading.set(false);\n this.onError.emit(reason);\n this.toaster.error(reason.message, reason.context);\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n Injector,\n input,\n output,\n ViewEncapsulation\n} from \"@angular/core\";\nimport {rxResource, toSignal} from \"@angular/core/rxjs-interop\";\nimport {FormGroup} from \"@angular/forms\";\nimport {Subject} from \"rxjs\";\nimport {FormlyFormOptions} from \"@ngx-formly/core\";\nimport {EventsService, LANGUAGE_SERVICE} from \"@stemy/ngx-utils\";\n\nimport {FormFieldChangeEvent, FormFieldConfig, FormFieldLabelCustomizer, IDynamicForm} from \"../../common-types\";\nimport {DynamicFormBuilderService} from \"../../services/dynamic-form-builder.service\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form\",\n templateUrl: \"./dynamic-form.component.html\",\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DynamicFormComponent implements IDynamicForm {\n\n protected readonly builder = inject(DynamicFormBuilderService);\n\n protected readonly events = inject(EventsService);\n\n protected readonly languages = inject(LANGUAGE_SERVICE);\n\n readonly labelPrefix = input<string>(\"label\");\n\n readonly labelCustomizer = input<FormFieldLabelCustomizer>(null);\n\n readonly testId = input<string>(\"\");\n\n readonly data = input<any>({});\n\n readonly fields = input<FormFieldConfig[]>(null);\n\n readonly fieldChanges = new Subject<FormFieldChangeEvent>();\n\n protected readonly language = toSignal(this.events.languageChanged, {\n initialValue: this.languages.currentLanguage\n });\n\n protected readonly enableTranslations = toSignal(this.events.translationsEnabled, {\n initialValue: this.languages.enableTranslations\n });\n\n readonly config = computed(() => {\n return this.fields() || this.builder.resolveFormFields(this.data()?.constructor, null, {\n labelPrefix: this.labelPrefix(),\n labelCustomizer: this.labelCustomizer(),\n testId: this.testId(),\n });\n });\n\n readonly group = computed(() => {\n this.config();\n return new FormGroup({});\n });\n\n protected readonly status$ = rxResource({\n request: () => this.group(),\n loader: p => p.request.statusChanges,\n defaultValue: \"PENDING\"\n });\n\n readonly status = computed(() => this.status$.value());\n\n readonly onSubmit = output<IDynamicForm>();\n\n readonly options: FormlyFormOptions = {\n fieldChanges: this.fieldChanges,\n formState: {\n injector: inject(Injector)\n }\n };\n\n constructor() {\n effect(() => {\n this.language();\n this.enableTranslations();\n this.config().forEach(field => {\n if (!field.options) return;\n this.options.detectChanges(field);\n });\n });\n }\n\n submit() {\n // TODO: Templ disable submit\n // this.onSubmit.emit(this);\n }\n\n reset() {\n this.options?.resetModel?.();\n }\n}\n","@if (config() && group()) {\n <form [formGroup]=\"group()\" (ngSubmit)=\"submit()\" autocomplete=\"off\" role=\"presentation\">\n <input type=\"submit\" [hidden]=\"true\" />\n <formly-form [model]=\"data()\"\n [fields]=\"config()\"\n [form]=\"group()\"\n [options]=\"options\"></formly-form>\n <ng-content></ng-content>\n </form>\n}\n","import {Component, signal, ViewEncapsulation} from \"@angular/core\";\nimport {FormArray} from \"@angular/forms\";\nimport {FieldArrayType} from \"@ngx-formly/core\";\nimport {FormFieldConfig} from \"../../common-types\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-array\",\n templateUrl: \"./dynamic-form-array.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormArrayComponent extends FieldArrayType<FormFieldConfig> {\n\n readonly currentTab = signal(0);\n\n clear(): void {\n const control = this.formControl as FormArray;\n while (control.length > 0) {\n this.remove(0);\n }\n }\n}\n","<label class=\"field-label\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n</label>\n<div class=\"field-container\">\n @if (props.useTabs) {\n <ul class=\"form-array-tabs\">\n @for (field of field.fieldGroup; track field.key; let ix = $index) {\n <li>\n <a class=\"btn\" [ngClass]=\"[currentTab() === ix ? 'btn-primary' : 'btn-secondary']\"\n (click)=\"currentTab.set(ix)\">\n {{ (field.formControl.value | getValue : props.tabsLabel) || ix + 1 }}\n </a>\n </li>\n }\n </ul>\n }\n @for (field of field.fieldGroup; track field.key; let ix = $index) {\n @if (!props.useTabs || ix === currentTab()) {\n <div class=\"form-array-item\">\n <div class=\"form-array-buttons\">\n @if (props.removeItem) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"remove(ix)\">\n <i icon=\"trash-outline\"></i>\n </button>\n }\n @if (props.insertItem) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"add(ix)\">\n <i icon=\"plus-outline\"></i>\n </button>\n }\n </div>\n <formly-field [field]=\"field\"></formly-field>\n </div>\n }\n }\n <div class=\"form-array-buttons\">\n @if (props.clearItems) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"clear()\">\n <i icon=\"trash-outline\"></i>\n {{ 'button.clear-items' | translate }}\n </button>\n }\n @if (props.addItem) {\n <button type=\"button\" class=\"btn btn-sm btn-primary\" (click)=\"add()\">\n <i icon=\"plus-outline\"></i>\n {{ 'button.insert-item' | translate }}\n </button>\n }\n </div>\n</div>\n","import {ChangeDetectionStrategy, Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldType} from \"@ngx-formly/core\";\nimport {FormFieldType} from \"../../common-types\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-chips\",\n templateUrl: \"./dynamic-form-chips.component.html\",\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicFormChipsComponent extends FieldType<FormFieldType> {\n\n}\n","<chips [formControl]=\"formControl\"\n [type]=\"props.type\"\n [step]=\"props.step\"\n [minLength]=\"props.minLength\"\n [maxLength]=\"props.maxLength\"\n [min]=\"props.min\"\n [max]=\"props.max\"\n [multiple]=\"props.multiple\"\n [formlyAttributes]=\"field\">\n</chips>\n","import {Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldWrapper} from \"@ngx-formly/core\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-field\",\n templateUrl: \"./dynamic-form-field.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormFieldComponent extends FieldWrapper {\n\n}\n","<label class=\"field-label\" [for]=\"id\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n <span class=\"field-required\" *ngIf=\"props.required && props.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n</label>\n<div class=\"field-container\">\n <ng-container #fieldComponent></ng-container>\n <div *ngIf=\"showError\" class=\"field-errors invalid-feedback\">\n <formly-validation-message\n id=\"{{ id }}-formly-validation-error\"\n [field]=\"field\"\n role=\"alert\"\n ></formly-validation-message>\n </div>\n</div>\n","import {Component, inject, ViewEncapsulation} from \"@angular/core\";\nimport {FieldWrapper} from \"@ngx-formly/core\";\nimport {DynamicFormGroupComponent} from \"../dynamic-form-group/dynamic-form-group.component\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-fieldset\",\n templateUrl: \"./dynamic-form-fieldset.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormFieldsetComponent extends FieldWrapper {\n\n ngOnInit(): void {\n // console.log(this.field.id, this.field.props?.label, this.options);\n // console.log(this.field.parent);\n }\n}\n","<legend class=\"field-legend\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n</legend>\n<div class=\"field-container\">\n <ng-container #fieldComponent></ng-container>\n</div>\n","import {Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldWrapper} from \"@ngx-formly/core\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-group\",\n templateUrl: \"./dynamic-form-group.component.html\",\n encapsulation: ViewEncapsulation.None\n})\nexport class DynamicFormGroupComponent extends FieldWrapper {\n\n}\n","<label class=\"field-label\" *ngIf=\"props.label\">\n {{ props.label | translate }}\n <p class=\"field-description\" *ngIf=\"props.description\">{{ props.description | translate }}</p>\n</label>\n<ng-container #fieldComponent></ng-container>\n","import {ChangeDetectionStrategy, Component, ViewEncapsulation} from \"@angular/core\";\nimport {FieldType} from \"@ngx-formly/core\";\nimport {FormFieldType} from \"../../common-types\";\n\n@Component({\n standalone: false,\n selector: \"dynamic-form-upload\",\n templateUrl: \"./dynamic-form-upload.component.html\",\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicFormUploadComponent extends FieldType<FormFieldType> {\n\n}\n","<upload [formControl]=\"formControl\"\n [multiple]=\"props.multiple\"\n [inline]=\"props.inline\"\n [accept]=\"props.accept\"\n [baseUrl]=\"props.url\"\n [makeUpload]=\"props.createUploadData\"\n [formlyAttributes]=\"field\">\n</upload>\n","import {AsyncSubmitDirective} from \"./directives/async-submit.directive\";\n\nimport {DynamicFormComponent} from \"./components/dynamic-form/dynamic-form.component\";\nimport {DynamicFormArrayComponent} from \"./components/dynamic-form-array/dynamic-form-array.component\";\nimport {DynamicFormChipsComponent} from \"./components/dynamic-form-chips/dynamic-form-chips.component\";\nimport {DynamicFormFieldComponent} from \"./components/dynamic-form-field/dynamic-form-field.component\";\nimport {DynamicFormFieldsetComponent} from \"./components/dynamic-form-fieldset/dynamic-form-fieldset.component\";\nimport {DynamicFormGroupComponent} from \"./components/dynamic-form-group/dynamic-form-group.component\";\nimport {DynamicFormUploadComponent} from \"./components/dynamic-form-upload/dynamic-form-upload.component\";\n\n// --- Components ---\nexport const components = [\n DynamicFormComponent,\n DynamicFormArrayComponent,\n DynamicFormChipsComponent,\n DynamicFormFieldComponent,\n DynamicFormFieldsetComponent,\n DynamicFormGroupComponent,\n DynamicFormUploadComponent\n];\n\n// --- Directives ---\nexport const directives = [\n AsyncSubmitDirective,\n];\n\n// --- Pipes ---\nexport const pipes = [];\n","import {EnvironmentProviders, makeEnvironmentProviders, ModuleWithProviders, NgModule, Provider} from \"@angular/core\";\nimport {CommonModule} from \"@angular/common\";\nimport {FormsModule, ReactiveFormsModule} from \"@angular/forms\";\nimport {FormlyModule} from \"@ngx-formly/core\";\nimport {NgxUtilsModule} from \"@stemy/ngx-utils\";\n\nimport {components, directives, pipes} from \"./ngx-dynamic-form.imports\";\n\nimport {IDynamicFormModuleConfig} from \"./common-types\";\n\nimport {DynamicFormService} from \"./services/dynamic-form.service\";\nimport {DynamicFormBuilderService} from \"./services/dynamic-form-builder.service\";\nimport {DynamicFormSchemaService} from \"./services/dynamic-form-schema.service\";\n\nimport {DynamicFormArrayComponent} from \"./components/dynamic-form-array/dynamic-form-array.component\";\nimport {DynamicFormChipsComponent} from \"./components/dynamic-form-chips/dynamic-form-chips.component\";\nimport {DynamicFormGroupComponent} from \"./components/dynamic-form-group/dynamic-form-group.component\";\nimport {DynamicFormFieldComponent} from \"./components/dynamic-form-field/dynamic-form-field.component\";\nimport {DynamicFormFieldsetComponent} from \"./components/dynamic-form-fieldset/dynamic-form-fieldset.component\";\nimport {DynamicFormUploadComponent} from \"./components/dynamic-form-upload/dynamic-form-upload.component\";\n\n@NgModule({\n declarations: [\n ...components,\n ...directives,\n ...pipes\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NgxUtilsModule,\n FormlyModule.forChild()\n ],\n exports: [\n ...components,\n ...directives,\n ...pipes,\n FormsModule,\n ReactiveFormsModule,\n NgxUtilsModule,\n FormlyModule\n ],\n providers: [\n ...pipes\n ]\n})\nexport class NgxDynamicFormModule {\n\n private static getProviders(config?: IDynamicFormModuleConfig): Provider[] {\n const {providers} = FormlyModule.forRoot({\n types: [\n {name: \"array\", component: DynamicFormArrayComponent},\n {name: \"chips\", component: DynamicFormChipsComponent},\n {name: \"upload\", component: DynamicFormUploadComponent, wrappers: [\"form-field\"]},\n {name: \"file\", extends: \"upload\"},\n {name: \"translation\", extends: \"array\"},\n ...(config?.types || [])\n ],\n wrappers: [\n { name: \"form-field\", component: DynamicFormFieldComponent },\n { name: \"form-fieldset\", component: DynamicFormFieldsetComponent },\n { name: \"form-group\", component: DynamicFormGroupComponent },\n ...(config?.wrappers || [])\n ],\n extras: {\n renderFormlyFieldElement: false,\n ...(config?.extras || {})\n }\n });\n\n return [\n ...(providers as Provider[]),\n DynamicFormService,\n DynamicFormBuilderService,\n DynamicFormSchemaService\n ];\n }\n\n static forRoot(config?: IDynamicFormModuleConfig): ModuleWithProviders<NgxDynamicFormModule> {\n return {\n ngModule: NgxDynamicFormModule,\n providers: NgxDynamicFormModule.getProviders(config)\n }\n }\n\n static provideForms(config?: IDynamicFormModuleConfig): EnvironmentProviders {\n return makeEnvironmentProviders(NgxDynamicFormModule.getProviders(config));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["FormGroup","FormArray","i1","i2.DynamicFormBuilderService","i2","i3"],"mappings":";;;;;;;;;;;;;;AAcA;AACO,MAAM,aAAa,GAAG;;ACUb,SAAA,kBAAkB,CAAC,GAAG,SAAiD,EAAA;AACnF,IAAA,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC;AACxC,IAAA,OAAO,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,KAAI;AACxD,QAAA,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;AACrC,QAAA,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC;AACtB,QAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;YAClC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,UAAU,CAAC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AAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;AACb,wBAAA,GAAG,UAAU;AACb,wBAAA,GAAG,KAAK;wBACR,WAAW;wBACX,mBAAmB;wBACnB,cAAc;wBACd;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE;AACP,wBAAA,GAAG;AACN;AACJ,iBAAA;;;AC9CD;;AAEG;;;;"}
@@ -8,6 +8,7 @@ export declare const FORM_ROOT_KEY = "__root";
8
8
  export type DynamicFormState = "VALID" | "INVALID" | "PENDING" | "DISABLED" | "LOADING";
9
9
  export type DynamicFormUpdateOn = "change" | "blur" | "submit";
10
10
  export type UploadData = Record<string, any> | ArrayBuffer | FormData;
11
+ export type FormFieldKey = string | number | (string | number)[];
11
12
  export type FormFieldLabelCustomizer = (key: string, label: string, parent: FormFieldConfig, labelPrefix: string) => string;
12
13
  export interface FormBuilderOptions {
13
14
  labelPrefix?: string;
@@ -65,8 +66,8 @@ export interface FormFieldConfig<T = FormFieldProps> extends FormlyFieldConfig<T
65
66
  parent?: FormFieldConfig;
66
67
  fieldGroup?: FormFieldConfig[];
67
68
  fieldArray?: FormFieldConfig | ((field: FormFieldConfig) => FormFieldConfig);
68
- hooks?: FormHookConfig;
69
- expressions?: FormFieldExpressions;
69
+ hooks: FormHookConfig;
70
+ expressions: FormFieldExpressions;
70
71
  readonly additional?: Readonly<{
71
72
  [key: string]: any;
72
73
  }>;
@@ -16,6 +16,7 @@ export declare class DynamicFormComponent implements IDynamicForm {
16
16
  readonly fields: import("@angular/core").InputSignal<FormFieldConfig<import("../../common-types").FormFieldProps>[]>;
17
17
  readonly fieldChanges: Subject<FormFieldChangeEvent>;
18
18
  protected readonly language: import("@angular/core").Signal<string>;
19
+ protected readonly enableTranslations: import("@angular/core").Signal<boolean>;
19
20
  readonly config: import("@angular/core").Signal<FormFieldConfig<import("../../common-types").FormFieldProps>[]>;
20
21
  readonly group: import("@angular/core").Signal<FormGroup<{}>>;
21
22
  protected readonly status$: import("@angular/core").ResourceRef<import("@angular/forms").FormControlStatus>;
@@ -2,7 +2,7 @@ import { Injector, Type } from "@angular/core";
2
2
  import { IApiService, ILanguageService } from "@stemy/ngx-utils";
3
3
  import { FormArrayData, FormBuilderOptions, FormFieldConfig, FormFieldData, FormFieldProps, FormGroupData, FormInputData, FormSelectData, FormSelectOption, FormUploadData } from "../common-types";
4
4
  import * as i0 from "@angular/core";
5
- export type FormFieldBuilder = (fb: DynamicFormBuilderService, parent: FormFieldConfig, options: FormBuilderOptions) => FormFieldConfig;
5
+ export type FormFieldBuilder = (fb: DynamicFormBuilderService, parent: FormFieldConfig, options: FormBuilderOptions) => Partial<FormFieldConfig>;
6
6
  export declare class DynamicFormBuilderService {
7
7
  readonly injector: Injector;
8
8
  readonly api: IApiService;
@@ -3,12 +3,14 @@ import { AbstractControl, FormGroup } from "@angular/forms";
3
3
  import { IApiService } from "@stemy/ngx-utils";
4
4
  import { CustomizerOrSchemaOptions, FormFieldConfig, FormSerializeResult, IDynamicForm } from "../common-types";
5
5
  import { DynamicFormSchemaService } from "./dynamic-form-schema.service";
6
+ import { DynamicFormBuilderService } from "./dynamic-form-builder.service";
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class DynamicFormService {
8
9
  protected readonly fs: DynamicFormSchemaService;
10
+ protected readonly fb: DynamicFormBuilderService;
9
11
  protected readonly injector: Injector;
10
12
  protected readonly api: IApiService;
11
- constructor(fs: DynamicFormSchemaService, injector: Injector, api: IApiService);
13
+ constructor(fs: DynamicFormSchemaService, fb: DynamicFormBuilderService, injector: Injector, api: IApiService);
12
14
  getFormFieldsForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig[]>;
13
15
  getFormFieldGroupForSchema(name: string, customizeOrOptions?: CustomizerOrSchemaOptions): Promise<FormFieldConfig>;
14
16
  protected getFormFieldGroupBySchemaName(name: string, customizeOrOptions: CustomizerOrSchemaOptions, restrictedMethod: string): Promise<FormFieldConfig>;
@@ -1,7 +1,8 @@
1
- import { FormFieldConfig } from "../common-types";
1
+ import { FormFieldKey, FormFieldConfig } from "../common-types";
2
2
  export declare function replaceSpecialChars(str: string, to?: string): string;
3
3
  export declare function getFieldByPath(field: FormFieldConfig, path: string): FormFieldConfig | null;
4
- export declare function getFieldsByKey(field: FormFieldConfig, key: string): FormFieldConfig[];
4
+ export declare function getFieldsByPredicate(field: FormFieldConfig, cb: (field: FormFieldConfig) => boolean): FormFieldConfig[];
5
+ export declare function getFieldsByKey(field: FormFieldConfig, key: FormFieldKey): FormFieldConfig[];
5
6
  export declare function setFieldHidden(field: FormFieldConfig, hidden?: boolean): void;
6
7
  export declare function setFieldDisabled(field: FormFieldConfig, disabled?: boolean): void;
7
8
  export declare function additionalFieldValues(field: FormFieldConfig, values: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-dynamic-form",
3
- "version": "19.3.1",
3
+ "version": "19.3.3",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-dynamic-form.git",
@@ -22,7 +22,7 @@
22
22
  "ngx-device-detector": "^9.0.0",
23
23
  "@floating-ui/dom": "^1.7.1",
24
24
  "json5": "^2.2.3",
25
- "@stemy/ngx-utils": ">=19.5.2",
25
+ "@stemy/ngx-utils": ">=19.5.3",
26
26
  "@ngx-formly/core": "^6.3.12",
27
27
  "ngx-mask": "^17.1.8"
28
28
  },
package/public_api.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export { FORM_ROOT_KEY, FormFieldLabelCustomizer, FormBuilderOptions, FormFieldProps, FormFieldSerializer, FormHookFn, FormHookConfig, FormFieldExpression, FormFieldExpressions, FormFieldConfig, FormFieldType, FormFieldChangeEvent, FormSerializeResult, FormSelectOption, FormSelectOptions, IDynamicForm, ValidationMessageFn, ValidatorFn, ValidatorExpression, Validators, AsyncValidatorFn, AsyncValidatorExpression, AsyncValidators, AllValidationErrors, FormFieldCustom, FormFieldData, FormInputData, FormSelectData, FormUploadData, FormGroupData, FormArrayData, FormFieldCustomizer, ConfigForSchemaOptions, DynamicFormState, DynamicFormUpdateOn, AsyncSubmitMethod, IDynamicFormModuleConfig, } from "./ngx-dynamic-form/common-types";
1
+ export { FORM_ROOT_KEY, FormFieldKey, FormFieldLabelCustomizer, FormBuilderOptions, FormFieldProps, FormFieldSerializer, FormHookFn, FormHookConfig, FormFieldExpression, FormFieldExpressions, FormFieldConfig, FormFieldType, FormFieldChangeEvent, FormSerializeResult, FormSelectOption, FormSelectOptions, IDynamicForm, ValidationMessageFn, ValidatorFn, ValidatorExpression, Validators, AsyncValidatorFn, AsyncValidatorExpression, AsyncValidators, AllValidationErrors, FormFieldCustom, FormFieldData, FormInputData, FormSelectData, FormUploadData, FormGroupData, FormArrayData, FormFieldCustomizer, ConfigForSchemaOptions, DynamicFormState, DynamicFormUpdateOn, AsyncSubmitMethod, IDynamicFormModuleConfig, } from "./ngx-dynamic-form/common-types";
2
2
  export { IFormFieldCustomizer, customizeFormField } from "./ngx-dynamic-form/utils/customizer";
3
3
  export { FormSerializable, FormInput, FormSelect, FormUpload, FormFile, FormGroup, FormModel } from "./ngx-dynamic-form/utils/decorators";
4
4
  export { validationMessage, jsonValidation, requiredValidation, translationValidation, phoneValidation, emailValidation, minLengthValidation, maxLengthValidation, minValueValidation, maxValueValidation } from "./ngx-dynamic-form/utils/validation";
5
- export { replaceSpecialChars, getFieldByPath, getFieldsByKey, setFieldHidden, setFieldDisabled, additionalFieldValues, MIN_INPUT_NUM, MAX_INPUT_NUM, EDITOR_FORMATS } from "./ngx-dynamic-form/utils/misc";
5
+ export { replaceSpecialChars, getFieldByPath, getFieldsByPredicate, getFieldsByKey, setFieldHidden, setFieldDisabled, additionalFieldValues, MIN_INPUT_NUM, MAX_INPUT_NUM, EDITOR_FORMATS } from "./ngx-dynamic-form/utils/misc";
6
6
  export { DynamicFormBuilderService } from "./ngx-dynamic-form/services/dynamic-form-builder.service";
7
7
  export { DynamicFormSchemaService } from "./ngx-dynamic-form/services/dynamic-form-schema.service";
8
8
  export { DynamicFormService } from "./ngx-dynamic-form/services/dynamic-form.service";