@stemy/ngx-dynamic-form 19.8.0 → 19.8.2

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.
@@ -314,7 +314,7 @@ export type FormUploadData = FormFieldData & Pick<FormFieldProps, "inline" | "mu
314
314
  export type FormGroupData = FormFieldData & Pick<FormFieldProps, "useTabs">;
315
315
  export type FormArrayData = FormFieldData & Pick<FormFieldProps, "useTabs" | "tabsLabel" | "insertItem" | "cloneItem" | "moveItem" | "removeItem" | "addItem" | "clearItems">;
316
316
  export type AsyncSubmitMode = "click" | "submit" | "all";
317
- export type AsyncSubmitMethod = (form: IDynamicForm, context?: any) => Promise<IAsyncMessage>;
317
+ export type AsyncSubmitMethod = (form: IDynamicForm, context?: any, ev?: MouseEvent) => Promise<IAsyncMessage>;
318
318
  export type FormFieldCustomizer = (field: FormFieldConfig, options: FormBuilderOptions, injector: Injector, property: OpenApiSchemaProperty, schema: OpenApiSchema) => MaybePromise<MaybeArray<FormFieldConfig>>;
319
319
  export interface ConfigForSchemaOptions extends FormBuilderOptions {
320
320
  fieldCustomizer?: FormFieldCustomizer;
@@ -4,7 +4,7 @@ import * as i0 from "@angular/core";
4
4
  export declare class DynamicFormArrayComponent extends FieldArrayType<FormFieldConfig> {
5
5
  currentTab: import("@angular/core").WritableSignal<number>;
6
6
  clearItems(): void;
7
- addItem(i?: number): void;
7
+ addItem(i?: number, initialModel?: any): void;
8
8
  removeItem(i: number): void;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormArrayComponent, never>;
10
10
  static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormArrayComponent, "dynamic-form-array", never, {}, {}, never, never, false, never>;
@@ -0,0 +1,16 @@
1
+ import { OnDestroy, OnInit } from "@angular/core";
2
+ import { Subscription } from "rxjs";
3
+ import { EventsService, ILanguageService } from "@stemy/ngx-utils";
4
+ import { DynamicFormArrayComponent } from "../dynamic-form-array/dynamic-form-array.component";
5
+ import * as i0 from "@angular/core";
6
+ export declare class DynamicFormTranslationComponent extends DynamicFormArrayComponent implements OnInit, OnDestroy {
7
+ readonly events: EventsService;
8
+ readonly language: ILanguageService;
9
+ protected subscription: Subscription;
10
+ constructor(events: EventsService, language: ILanguageService);
11
+ ngOnInit(): void;
12
+ ngOnDestroy(): void;
13
+ protected setLanguage(lang: string): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormTranslationComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormTranslationComponent, "dynamic-form-translation", never, {}, {}, never, never, false, never>;
16
+ }
@@ -1,26 +1,22 @@
1
1
  import { ElementRef, Renderer2 } from "@angular/core";
2
- import { IAsyncMessage } from "@stemy/ngx-utils";
2
+ import { AsyncMethodBase } from "@stemy/ngx-utils";
3
3
  import { AsyncSubmitMethod, AsyncSubmitMode, IDynamicForm } from "../common-types";
4
4
  import * as i0 from "@angular/core";
5
- export declare class AsyncSubmitDirective {
5
+ export declare class AsyncSubmitDirective extends AsyncMethodBase {
6
6
  readonly method: import("@angular/core").InputSignal<AsyncSubmitMethod>;
7
7
  readonly mode: import("@angular/core").InputSignal<AsyncSubmitMode>;
8
- form: import("@angular/core").InputSignal<IDynamicForm>;
9
- context: import("@angular/core").InputSignal<any>;
10
- onSuccess: import("@angular/core").OutputEmitterRef<IAsyncMessage>;
11
- onError: import("@angular/core").OutputEmitterRef<IAsyncMessage>;
12
- toaster: import("@stemy/ngx-utils").IToasterService;
8
+ readonly form: import("@angular/core").InputSignal<IDynamicForm>;
13
9
  renderer: Renderer2;
14
10
  elem: ElementRef<HTMLElement>;
15
11
  protected status: import("@angular/core").Signal<import("../common-types").DynamicFormStatus>;
16
12
  protected group: import("@angular/core").Signal<import("@angular/forms").FormGroup<any>>;
17
- protected loading: import("@angular/core").WritableSignal<boolean>;
18
13
  protected callback: import("@angular/core").WritableSignal<() => void>;
19
14
  get isDisabled(): boolean;
20
15
  get isLoading(): boolean;
21
16
  constructor();
22
- click(): void;
23
- callMethod(): void;
17
+ protected handleClick(ev: MouseEvent): boolean;
18
+ protected getMethod(): AsyncSubmitMethod;
19
+ protected getArgs(ev: MouseEvent): unknown[];
24
20
  static ɵfac: i0.ɵɵFactoryDeclaration<AsyncSubmitDirective, never>;
25
- static ɵdir: i0.ɵɵDirectiveDeclaration<AsyncSubmitDirective, "[async-submit]", ["async-submit"], { "method": { "alias": "async-submit"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "context": { "alias": "context"; "required": false; "isSignal": true; }; }, { "onSuccess": "onSuccess"; "onError": "onError"; }, never, never, false, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AsyncSubmitDirective, "[async-submit]", ["async-submit"], { "method": { "alias": "async-submit"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
26
22
  }
@@ -0,0 +1,5 @@
1
+ export declare class RichTranslationModel {
2
+ lang: string;
3
+ translation: string;
4
+ constructor(data?: any);
5
+ }
@@ -0,0 +1,5 @@
1
+ export declare class TranslationModel {
2
+ lang: string;
3
+ translation: string;
4
+ constructor(data?: any);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ILanguageService } from "@stemy/ngx-utils";
2
+ import { FormSelectOptionsFactory } from "../common-types";
3
+ export declare class ModelUtils {
4
+ static getLanguages(language: ILanguageService): FormSelectOptionsFactory;
5
+ }
@@ -2,7 +2,8 @@ import { AsyncSubmitDirective } from "./directives/async-submit.directive";
2
2
  import { DynamicFormComponent } from "./components/dynamic-form/dynamic-form.component";
3
3
  import { DynamicFormArrayComponent } from "./components/dynamic-form-array/dynamic-form-array.component";
4
4
  import { DynamicFormChipsComponent } from "./components/dynamic-form-chips/dynamic-form-chips.component";
5
+ import { DynamicFormTranslationComponent } from "./components/dynamic-form-translation/dynamic-form-translation.component";
5
6
  import { DynamicFormAlertComponent } from "./components/dynamic-form-alert/dynamic-form-alert.component";
6
- export declare const components: (typeof DynamicFormComponent | typeof DynamicFormArrayComponent | typeof DynamicFormChipsComponent | typeof DynamicFormAlertComponent)[];
7
+ export declare const components: (typeof DynamicFormComponent | typeof DynamicFormArrayComponent | typeof DynamicFormChipsComponent | typeof DynamicFormTranslationComponent | typeof DynamicFormAlertComponent)[];
7
8
  export declare const directives: (typeof AsyncSubmitDirective)[];
8
9
  export declare const pipes: any[];
@@ -6,23 +6,24 @@ import * as i2 from "./components/dynamic-form/dynamic-form.component";
6
6
  import * as i3 from "./components/dynamic-form-array/dynamic-form-array.component";
7
7
  import * as i4 from "./components/dynamic-form-chips/dynamic-form-chips.component";
8
8
  import * as i5 from "./components/dynamic-form-static/dynamic-form-static.component";
9
- import * as i6 from "./components/dynamic-form-upload/dynamic-form-upload.component";
10
- import * as i7 from "./components/dynamic-form-wysiwyg/dynamic-form-wysiwyg.component";
11
- import * as i8 from "./components/dynamic-form-alert/dynamic-form-alert.component";
12
- import * as i9 from "./components/dynamic-form-field/dynamic-form-field.component";
13
- import * as i10 from "./components/dynamic-form-fieldset/dynamic-form-fieldset.component";
14
- import * as i11 from "./components/dynamic-form-group/dynamic-form-group.component";
15
- import * as i12 from "./directives/async-submit.directive";
16
- import * as i13 from "@angular/common";
17
- import * as i14 from "@angular/forms";
18
- import * as i15 from "@stemy/ngx-utils";
19
- import * as i16 from "@ngx-formly/core";
20
- import * as i17 from "@ngx-formly/core/select";
9
+ import * as i6 from "./components/dynamic-form-translation/dynamic-form-translation.component";
10
+ import * as i7 from "./components/dynamic-form-upload/dynamic-form-upload.component";
11
+ import * as i8 from "./components/dynamic-form-wysiwyg/dynamic-form-wysiwyg.component";
12
+ import * as i9 from "./components/dynamic-form-alert/dynamic-form-alert.component";
13
+ import * as i10 from "./components/dynamic-form-field/dynamic-form-field.component";
14
+ import * as i11 from "./components/dynamic-form-fieldset/dynamic-form-fieldset.component";
15
+ import * as i12 from "./components/dynamic-form-group/dynamic-form-group.component";
16
+ import * as i13 from "./directives/async-submit.directive";
17
+ import * as i14 from "@angular/common";
18
+ import * as i15 from "@angular/forms";
19
+ import * as i16 from "@stemy/ngx-utils";
20
+ import * as i17 from "@ngx-formly/core";
21
+ import * as i18 from "@ngx-formly/core/select";
21
22
  export declare class NgxDynamicFormModule {
22
23
  private static getProviders;
23
24
  static forRoot(config?: IDynamicFormModuleConfig): ModuleWithProviders<NgxDynamicFormModule>;
24
25
  static provideForms(config?: IDynamicFormModuleConfig): EnvironmentProviders;
25
26
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxDynamicFormModule, never>;
26
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDynamicFormModule, [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.DynamicFormStaticComponent, typeof i6.DynamicFormUploadComponent, typeof i7.DynamicFormWysiwygComponent, typeof i8.DynamicFormAlertComponent, typeof i9.DynamicFormFieldComponent, typeof i10.DynamicFormFieldsetComponent, typeof i11.DynamicFormGroupComponent, typeof i12.AsyncSubmitDirective], [typeof i13.CommonModule, typeof i14.FormsModule, typeof i14.ReactiveFormsModule, typeof i15.NgxUtilsModule, typeof i16.FormlyModule, typeof i17.FormlySelectModule], [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.DynamicFormStaticComponent, typeof i6.DynamicFormUploadComponent, typeof i7.DynamicFormWysiwygComponent, typeof i8.DynamicFormAlertComponent, typeof i9.DynamicFormFieldComponent, typeof i10.DynamicFormFieldsetComponent, typeof i11.DynamicFormGroupComponent, typeof i12.AsyncSubmitDirective, typeof i14.FormsModule, typeof i14.ReactiveFormsModule, typeof i15.NgxUtilsModule, typeof i16.FormlyModule, typeof i17.FormlySelectModule]>;
27
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDynamicFormModule, [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.DynamicFormStaticComponent, typeof i6.DynamicFormTranslationComponent, typeof i7.DynamicFormUploadComponent, typeof i8.DynamicFormWysiwygComponent, typeof i9.DynamicFormAlertComponent, typeof i10.DynamicFormFieldComponent, typeof i11.DynamicFormFieldsetComponent, typeof i12.DynamicFormGroupComponent, typeof i13.AsyncSubmitDirective], [typeof i14.CommonModule, typeof i15.FormsModule, typeof i15.ReactiveFormsModule, typeof i16.NgxUtilsModule, typeof i17.FormlyModule, typeof i18.FormlySelectModule], [typeof i1.DynamicFieldType, typeof i2.DynamicFormComponent, typeof i3.DynamicFormArrayComponent, typeof i4.DynamicFormChipsComponent, typeof i5.DynamicFormStaticComponent, typeof i6.DynamicFormTranslationComponent, typeof i7.DynamicFormUploadComponent, typeof i8.DynamicFormWysiwygComponent, typeof i9.DynamicFormAlertComponent, typeof i10.DynamicFormFieldComponent, typeof i11.DynamicFormFieldsetComponent, typeof i12.DynamicFormGroupComponent, typeof i13.AsyncSubmitDirective, typeof i15.FormsModule, typeof i15.ReactiveFormsModule, typeof i16.NgxUtilsModule, typeof i17.FormlyModule, typeof i18.FormlySelectModule]>;
27
28
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxDynamicFormModule>;
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-dynamic-form",
3
- "version": "19.8.0",
3
+ "version": "19.8.2",
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.7.30",
25
+ "@stemy/ngx-utils": ">=19.8.1",
26
26
  "@ngx-formly/core": "^7.0.0",
27
27
  "ngx-mask": "^19.0.7",
28
28
  "@angular/material": "^19.2.18"
package/public_api.d.ts CHANGED
@@ -3,6 +3,8 @@ export { IFormFieldCustomizer, customizeFormField } from "./ngx-dynamic-form/uti
3
3
  export { FormSerializable, FormInput, FormSelect, FormStatic, FormUpload, FormFile, FormGroup, FormArray, FormModel } from "./ngx-dynamic-form/utils/decorators";
4
4
  export { addFieldValidators, removeFieldValidators, jsonValidation, requiredValidation, translationValidation, phoneValidation, emailValidation, arrayLengthValidation, minLengthValidation, maxLengthValidation, minValueValidation, maxValueValidation } from "./ngx-dynamic-form/utils/validation";
5
5
  export { replaceSpecialChars, controlValues, controlStatus, convertToDateFormat, convertToDate, convertToNumber, getFieldByPath, getFieldsByPredicate, getFieldsByKey, getSelectOptions, replaceFieldArray, clearFieldArray, insertToFieldArray, removeFromFieldArray, setFieldDefault, setFieldValue, setFieldProps, setFieldProp, setFieldHidden, setFieldDisabled, setFieldHooks, MIN_INPUT_NUM, MAX_INPUT_NUM, EDITOR_FORMATS } from "./ngx-dynamic-form/utils/misc";
6
+ export { RichTranslationModel } from "./ngx-dynamic-form/models/rich-translation.model";
7
+ export { TranslationModel } from "./ngx-dynamic-form/models/translation.model";
6
8
  export { DynamicFormBuilderService } from "./ngx-dynamic-form/services/dynamic-form-builder.service";
7
9
  export { DynamicFormSchemaService } from "./ngx-dynamic-form/services/dynamic-form-schema.service";
8
10
  export { DynamicFormService } from "./ngx-dynamic-form/services/dynamic-form.service";
@@ -12,6 +14,7 @@ export { DynamicFormComponent } from "./ngx-dynamic-form/components/dynamic-form
12
14
  export { DynamicFormArrayComponent } from "./ngx-dynamic-form/components/dynamic-form-array/dynamic-form-array.component";
13
15
  export { DynamicFormChipsComponent } from "./ngx-dynamic-form/components/dynamic-form-chips/dynamic-form-chips.component";
14
16
  export { DynamicFormStaticComponent } from "./ngx-dynamic-form/components/dynamic-form-static/dynamic-form-static.component";
17
+ export { DynamicFormTranslationComponent } from "./ngx-dynamic-form/components/dynamic-form-translation/dynamic-form-translation.component";
15
18
  export { DynamicFormUploadComponent } from "./ngx-dynamic-form/components/dynamic-form-upload/dynamic-form-upload.component";
16
19
  export { DynamicFormWysiwygComponent } from "./ngx-dynamic-form/components/dynamic-form-wysiwyg/dynamic-form-wysiwyg.component";
17
20
  export { DynamicFormAlertComponent } from "./ngx-dynamic-form/components/dynamic-form-alert/dynamic-form-alert.component";