@stemy/ngx-dynamic-form 19.1.10 → 19.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common-types.d.ts +37 -0
- package/components/base/dynamic-base-form-array.component.d.ts +38 -0
- package/components/base/dynamic-base-form-control-container.component.d.ts +39 -0
- package/components/base/dynamic-base-form-control.component.d.ts +26 -0
- package/components/base/dynamic-base-form-group.component.d.ts +25 -0
- package/components/base/dynamic-base-form.component.d.ts +46 -0
- package/components/base/dynamic-base-select.component.d.ts +15 -0
- package/directives/async-submit.directive.d.ts +31 -0
- package/fesm2022/stemy-ngx-dynamic-form-src-ngx-dynamic-form-nebular.mjs +50 -0
- package/fesm2022/stemy-ngx-dynamic-form-src-ngx-dynamic-form-nebular.mjs.map +1 -0
- package/fesm2022/stemy-ngx-dynamic-form-ui-nebular.mjs +50 -0
- package/fesm2022/stemy-ngx-dynamic-form-ui-nebular.mjs.map +1 -0
- package/fesm2022/stemy-ngx-dynamic-form.mjs +3 -3
- package/fesm2022/stemy-ngx-dynamic-form.mjs.map +1 -1
- package/imports.d.ts +12 -0
- package/ngx-dynamic-form/common-types.d.ts +1 -1
- package/ngx-dynamic-form/utils/customizer.d.ts +1 -1
- package/ngx-dynamic-form.imports.d.ts +12 -0
- package/ngx-dynamic-form.module.d.ts +21 -0
- package/package.json +1 -1
- package/services/dynamic-form.service.d.ts +61 -0
- package/src/ngx-dynamic-form/nebular/imports.d.ts +4 -0
- package/src/ngx-dynamic-form/nebular/index.d.ts +5 -0
- package/src/ngx-dynamic-form/nebular/ngx-dynamic-form.nebular.module.d.ts +9 -0
- package/src/ngx-dynamic-form/nebular/public_api.d.ts +1 -0
- package/ui-nebular/imports.d.ts +4 -0
- package/ui-nebular/index.d.ts +5 -0
- package/ui-nebular/ngx-dynamic-form.nebular.module.d.ts +9 -0
- package/ui-nebular/public_api.d.ts +1 -0
- package/utils/creators.d.ts +18 -0
- package/utils/customizer.d.ts +14 -0
- package/utils/dynamic-editor.model.d.ts +11 -0
- package/utils/dynamic-form-array.model.d.ts +69 -0
- package/utils/dynamic-form-group.model.d.ts +14 -0
- package/utils/dynamic-select.model.d.ts +39 -0
- package/utils/form-select-subject.d.ts +6 -0
- package/utils/form-subject.d.ts +10 -0
- package/utils/misc.d.ts +11 -0
- package/utils/validation-errors.d.ts +11 -0
- package/utils/validators.d.ts +8 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, Injector, Type } from "@angular/core";
|
|
2
|
+
import { AbstractControl } from "@angular/forms";
|
|
3
|
+
import { DynamicFormControl, DynamicFormControlComponent, DynamicFormControlEvent, DynamicFormControlMapFn, DynamicFormControlModel, DynamicFormControlModelConfig, DynamicFormValueControlModel, DynamicFormComponent } from "@ng-dynamic-forms/core";
|
|
4
|
+
import { IAsyncMessage, IOpenApiSchema, IOpenApiSchemaProperty } from "@stemy/ngx-utils";
|
|
5
|
+
export type DynamicFormState = "VALID" | "INVALID" | "PENDING" | "DISABLED" | "LOADING";
|
|
6
|
+
export type DynamicFormUpdateOn = "change" | "blur" | "submit";
|
|
7
|
+
export interface IDynamicFormEvent extends DynamicFormControlEvent {
|
|
8
|
+
form: IDynamicForm;
|
|
9
|
+
}
|
|
10
|
+
export interface IDynamicForm extends DynamicFormComponent {
|
|
11
|
+
status?: DynamicFormState;
|
|
12
|
+
onValueChange?: EventEmitter<IDynamicFormEvent>;
|
|
13
|
+
onStatusChange?: EventEmitter<IDynamicForm>;
|
|
14
|
+
onSubmit?: EventEmitter<IDynamicForm>;
|
|
15
|
+
}
|
|
16
|
+
export declare interface ModelType extends Function {
|
|
17
|
+
new (config: DynamicFormControlModelConfig): DynamicFormControlModel;
|
|
18
|
+
}
|
|
19
|
+
export type PromiseOrNot<T> = Promise<T> | T;
|
|
20
|
+
export type FormControlSerializer = (model: DynamicFormValueControlModel<any>, control: AbstractControl) => Promise<any>;
|
|
21
|
+
export type FormModelCustomizer = (property: IOpenApiSchemaProperty, schema: IOpenApiSchema, model: DynamicFormControlModel, config: DynamicFormControlModelConfig, injector: Injector) => PromiseOrNot<DynamicFormControlModel | DynamicFormControlModel[]>;
|
|
22
|
+
export interface ModelForSchemaOptions {
|
|
23
|
+
labelPrefix?: string;
|
|
24
|
+
customizer?: FormModelCustomizer;
|
|
25
|
+
}
|
|
26
|
+
export interface ModelForSchemaWrapOptions extends Omit<ModelForSchemaOptions, "customizer"> {
|
|
27
|
+
schema: IOpenApiSchema;
|
|
28
|
+
customizer?: (property: IOpenApiSchemaProperty, options: ModelForSchemaWrapOptions, modelType: ModelType, config: DynamicFormControlModelConfig, path: string) => Promise<DynamicFormControlModel[]>;
|
|
29
|
+
}
|
|
30
|
+
export interface DynamicFormInitControl extends DynamicFormControl {
|
|
31
|
+
initialize(cdr?: ChangeDetectorRef): void;
|
|
32
|
+
}
|
|
33
|
+
export declare type AsyncSubmitMethod = (form: IDynamicForm, context?: any) => Promise<IAsyncMessage>;
|
|
34
|
+
export type GetFormControlComponentType = (model: DynamicFormControlModel, injector: Injector) => Type<DynamicFormControlComponent>;
|
|
35
|
+
export interface IDynamicFormModuleConfig {
|
|
36
|
+
controlProvider?: (injector: Injector) => DynamicFormControlMapFn;
|
|
37
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, Injector, OnDestroy, QueryList } from "@angular/core";
|
|
2
|
+
import { FormGroup } from "@angular/forms";
|
|
3
|
+
import { Subscription } from "rxjs";
|
|
4
|
+
import { DynamicFormArrayComponent, DynamicFormControlCustomEvent, DynamicFormControlLayout, DynamicFormControlLayoutContext, DynamicFormControlLayoutPlace, DynamicFormControlModel, DynamicFormLayout, DynamicFormLayoutService, DynamicFormValidationService, DynamicTemplateDirective } from "@ng-dynamic-forms/core";
|
|
5
|
+
import { DynamicFormArrayGroupModel, DynamicFormArrayModel } from "../../utils/dynamic-form-array.model";
|
|
6
|
+
import { DynamicFormInitControl } from "../../common-types";
|
|
7
|
+
import { DynamicBaseFormComponent } from "./dynamic-base-form.component";
|
|
8
|
+
import { DynamicBaseFormControlContainerComponent } from "./dynamic-base-form-control-container.component";
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class DynamicBaseFormArrayComponent extends DynamicFormArrayComponent implements DynamicFormInitControl, OnDestroy {
|
|
11
|
+
readonly form: DynamicBaseFormComponent;
|
|
12
|
+
readonly injector: Injector;
|
|
13
|
+
readonly cdr: ChangeDetectorRef;
|
|
14
|
+
formLayout: DynamicFormLayout;
|
|
15
|
+
group: FormGroup;
|
|
16
|
+
layout: DynamicFormControlLayout;
|
|
17
|
+
model: DynamicFormArrayModel;
|
|
18
|
+
templates: QueryList<DynamicTemplateDirective> | undefined;
|
|
19
|
+
blur: EventEmitter<any>;
|
|
20
|
+
change: EventEmitter<any>;
|
|
21
|
+
customEvent: EventEmitter<DynamicFormControlCustomEvent>;
|
|
22
|
+
focus: EventEmitter<any>;
|
|
23
|
+
components: QueryList<DynamicBaseFormControlContainerComponent>;
|
|
24
|
+
get useTabs(): boolean;
|
|
25
|
+
protected subscription: Subscription;
|
|
26
|
+
constructor(layoutService: DynamicFormLayoutService, validationService: DynamicFormValidationService, form: DynamicBaseFormComponent, injector: Injector, cdr: ChangeDetectorRef);
|
|
27
|
+
initialize(cdr: ChangeDetectorRef): void;
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
saveTab(index: number): void;
|
|
30
|
+
restoreTab(): number;
|
|
31
|
+
getTabLabel(index: number, model: DynamicFormArrayGroupModel): string;
|
|
32
|
+
getClass(context: DynamicFormControlLayoutContext, place: DynamicFormControlLayoutPlace, model?: DynamicFormControlModel): string;
|
|
33
|
+
protected getModelClass(model?: DynamicFormControlModel): string;
|
|
34
|
+
protected getAdditionalClass(model?: DynamicFormControlModel): string;
|
|
35
|
+
protected updateGroups(filteredGroups: ReadonlyArray<DynamicFormArrayGroupModel>): void;
|
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBaseFormArrayComponent, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBaseFormArrayComponent, "dynamic-base-form-array", never, { "formLayout": { "alias": "formLayout"; "required": false; }; "group": { "alias": "group"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "model": { "alias": "model"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; }, { "blur": "blur"; "change": "change"; "customEvent": "customEvent"; "focus": "focus"; }, never, never, false, never>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ComponentFactoryResolver, EventEmitter, Injector, QueryList, Type, ViewContainerRef } from "@angular/core";
|
|
2
|
+
import { FormGroup } from "@angular/forms";
|
|
3
|
+
import { Subscription } from "rxjs";
|
|
4
|
+
import { DynamicFormComponentService, DynamicFormControl, DynamicFormControlContainerComponent, DynamicFormControlEvent, DynamicFormControlModel, DynamicFormLayout, DynamicFormLayoutService, DynamicFormRelationService, DynamicFormValidationService, DynamicTemplateDirective } from "@ng-dynamic-forms/core";
|
|
5
|
+
import { DynamicFormArrayGroupModel } from "../../utils/dynamic-form-array.model";
|
|
6
|
+
import { DynamicFormService } from "../../services/dynamic-form.service";
|
|
7
|
+
import { DynamicBaseFormComponent } from "./dynamic-base-form.component";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class DynamicBaseFormControlContainerComponent extends DynamicFormControlContainerComponent {
|
|
10
|
+
readonly form: DynamicBaseFormComponent;
|
|
11
|
+
readonly cdr: ChangeDetectorRef;
|
|
12
|
+
readonly injector: Injector;
|
|
13
|
+
contentTemplateList: QueryList<DynamicTemplateDirective>;
|
|
14
|
+
klass: any;
|
|
15
|
+
context: DynamicFormArrayGroupModel | null;
|
|
16
|
+
group: FormGroup;
|
|
17
|
+
hostClass: string[];
|
|
18
|
+
inputTemplateList: QueryList<DynamicTemplateDirective>;
|
|
19
|
+
layout: DynamicFormLayout;
|
|
20
|
+
model: DynamicFormControlModel;
|
|
21
|
+
blur: EventEmitter<DynamicFormControlEvent>;
|
|
22
|
+
change: EventEmitter<DynamicFormControlEvent>;
|
|
23
|
+
focus: EventEmitter<DynamicFormControlEvent>;
|
|
24
|
+
componentViewContainerRef: ViewContainerRef;
|
|
25
|
+
get componentType(): Type<DynamicFormControl> | null;
|
|
26
|
+
get startTemplate(): DynamicTemplateDirective;
|
|
27
|
+
get endTemplate(): DynamicTemplateDirective;
|
|
28
|
+
get formService(): DynamicFormService;
|
|
29
|
+
protected onDetectChanges: Subscription;
|
|
30
|
+
constructor(form: DynamicBaseFormComponent, cdr: ChangeDetectorRef, injector: Injector, cfr: ComponentFactoryResolver, layoutService: DynamicFormLayoutService, validationService: DynamicFormValidationService, componentService: DynamicFormComponentService, relationService: DynamicFormRelationService);
|
|
31
|
+
ngOnInit(): void;
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
getLabel(): string;
|
|
34
|
+
getLabelIcon(): string;
|
|
35
|
+
clickLabel(): void;
|
|
36
|
+
protected createFormControlComponent(): void;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBaseFormControlContainerComponent, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBaseFormControlContainerComponent, "dynamic-base-form-control", never, { "context": { "alias": "context"; "required": false; }; "group": { "alias": "group"; "required": false; }; "hostClass": { "alias": "hostClass"; "required": false; }; "inputTemplateList": { "alias": "templates"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "model": { "alias": "model"; "required": false; }; }, { "blur": "blur"; "change": "change"; "focus": "focus"; }, ["contentTemplateList"], never, false, never>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, EventEmitter, Injector, OnDestroy } from "@angular/core";
|
|
2
|
+
import { FormGroup } from "@angular/forms";
|
|
3
|
+
import { Subscription } from "rxjs";
|
|
4
|
+
import { DynamicFormControlComponent, DynamicFormControlLayout, DynamicFormControlModel, DynamicFormLayout, DynamicFormLayoutService, DynamicFormValidationService } from "@ng-dynamic-forms/core";
|
|
5
|
+
import { DynamicBaseFormComponent } from "./dynamic-base-form.component";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class DynamicBaseFormControlComponent<T extends DynamicFormControlModel> extends DynamicFormControlComponent implements AfterViewInit, OnDestroy {
|
|
8
|
+
readonly form: DynamicBaseFormComponent;
|
|
9
|
+
readonly injector: Injector;
|
|
10
|
+
readonly cdr: ChangeDetectorRef;
|
|
11
|
+
formLayout: DynamicFormLayout;
|
|
12
|
+
group: FormGroup;
|
|
13
|
+
layout: DynamicFormControlLayout;
|
|
14
|
+
model: T;
|
|
15
|
+
blur: EventEmitter<any>;
|
|
16
|
+
change: EventEmitter<any>;
|
|
17
|
+
focus: EventEmitter<any>;
|
|
18
|
+
protected subscription: Subscription;
|
|
19
|
+
constructor(layoutService: DynamicFormLayoutService, validationService: DynamicFormValidationService, form: DynamicBaseFormComponent, injector: Injector, cdr: ChangeDetectorRef);
|
|
20
|
+
ngAfterViewInit(): void;
|
|
21
|
+
ngOnDestroy(): void;
|
|
22
|
+
submit(): void;
|
|
23
|
+
protected onValueChanged(value: any): void;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBaseFormControlComponent<any>, [null, null, { optional: true; }, null, null]>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBaseFormControlComponent<any>, "dynamic-base-form-control", never, { "formLayout": { "alias": "formLayout"; "required": false; }; "group": { "alias": "group"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "model": { "alias": "model"; "required": false; }; }, { "blur": "blur"; "change": "change"; "focus": "focus"; }, never, never, false, never>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventEmitter, QueryList } from "@angular/core";
|
|
2
|
+
import { FormGroup } from "@angular/forms";
|
|
3
|
+
import { DynamicFormControlContainerComponent, DynamicFormControlCustomEvent, DynamicFormControlLayout, DynamicFormControlLayoutContext, DynamicFormControlLayoutPlace, DynamicFormControlModel, DynamicFormGroupComponent, DynamicFormLayout, DynamicFormLayoutService, DynamicFormValidationService, DynamicTemplateDirective } from "@ng-dynamic-forms/core";
|
|
4
|
+
import { DynamicFormGroupModel } from "../../utils/dynamic-form-group.model";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DynamicBaseFormGroupComponent extends DynamicFormGroupComponent {
|
|
7
|
+
protected layoutService: DynamicFormLayoutService;
|
|
8
|
+
protected validationService: DynamicFormValidationService;
|
|
9
|
+
formLayout: DynamicFormLayout;
|
|
10
|
+
group: FormGroup;
|
|
11
|
+
layout: DynamicFormControlLayout;
|
|
12
|
+
model: DynamicFormGroupModel;
|
|
13
|
+
templates: QueryList<DynamicTemplateDirective> | DynamicTemplateDirective[] | undefined;
|
|
14
|
+
blur: EventEmitter<any>;
|
|
15
|
+
change: EventEmitter<any>;
|
|
16
|
+
customEvent: EventEmitter<DynamicFormControlCustomEvent>;
|
|
17
|
+
focus: EventEmitter<any>;
|
|
18
|
+
components: QueryList<DynamicFormControlContainerComponent>;
|
|
19
|
+
constructor(layoutService: DynamicFormLayoutService, validationService: DynamicFormValidationService);
|
|
20
|
+
getClass(context: DynamicFormControlLayoutContext, place: DynamicFormControlLayoutPlace, model?: DynamicFormControlModel): string;
|
|
21
|
+
protected getModelClass(model?: DynamicFormControlModel): string;
|
|
22
|
+
protected getAdditionalClass(model?: DynamicFormControlModel): string;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBaseFormGroupComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBaseFormGroupComponent, "dynamic-base-form-group", never, { "formLayout": { "alias": "formLayout"; "required": false; }; "group": { "alias": "group"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "model": { "alias": "model"; "required": false; }; "templates": { "alias": "templates"; "required": false; }; }, { "blur": "blur"; "change": "change"; "customEvent": "customEvent"; "focus": "focus"; }, never, never, false, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnChanges, QueryList, SimpleChanges } from "@angular/core";
|
|
2
|
+
import { FormArray, FormGroup } from "@angular/forms";
|
|
3
|
+
import { Subscription } from "rxjs";
|
|
4
|
+
import { DynamicFormComponent, DynamicFormComponentService, DynamicFormControlEvent, DynamicFormControlModel, DynamicFormLayout, DynamicFormModel, DynamicTemplateDirective } from "@ng-dynamic-forms/core";
|
|
5
|
+
import { EventsService } from "@stemy/ngx-utils";
|
|
6
|
+
import { DynamicFormState, GetFormControlComponentType, IDynamicForm, IDynamicFormEvent } from "../../common-types";
|
|
7
|
+
import { DynamicFormGroupModel } from "../../utils/dynamic-form-group.model";
|
|
8
|
+
import { DynamicFormArrayModel } from "../../utils/dynamic-form-array.model";
|
|
9
|
+
import { DynamicFormService } from "../../services/dynamic-form.service";
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare class DynamicBaseFormComponent extends DynamicFormComponent implements OnChanges, AfterViewInit, IDynamicForm {
|
|
12
|
+
readonly formService: DynamicFormService;
|
|
13
|
+
readonly events: EventsService;
|
|
14
|
+
group: FormGroup;
|
|
15
|
+
model: DynamicFormModel;
|
|
16
|
+
layout: DynamicFormLayout;
|
|
17
|
+
blur: EventEmitter<DynamicFormControlEvent>;
|
|
18
|
+
change: EventEmitter<DynamicFormControlEvent>;
|
|
19
|
+
focus: EventEmitter<DynamicFormControlEvent>;
|
|
20
|
+
groupModel: DynamicFormGroupModel;
|
|
21
|
+
labelPrefix: string;
|
|
22
|
+
getComponentType: GetFormControlComponentType;
|
|
23
|
+
contentTemplates: QueryList<DynamicTemplateDirective>;
|
|
24
|
+
viewTemplates: QueryList<DynamicTemplateDirective>;
|
|
25
|
+
get status(): DynamicFormState;
|
|
26
|
+
readonly onValueChange: EventEmitter<IDynamicFormEvent>;
|
|
27
|
+
readonly onStatusChange: EventEmitter<IDynamicForm>;
|
|
28
|
+
readonly onSubmit: EventEmitter<IDynamicForm>;
|
|
29
|
+
readonly onDetectChanges: EventEmitter<IDynamicForm>;
|
|
30
|
+
protected subscription: Subscription;
|
|
31
|
+
protected groupSubscription: Subscription;
|
|
32
|
+
constructor(formService: DynamicFormService, events: EventsService, changeDetectorRef: ChangeDetectorRef, componentService: DynamicFormComponentService);
|
|
33
|
+
submit(): void;
|
|
34
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
35
|
+
ngAfterViewInit(): void;
|
|
36
|
+
ngOnDestroy(): void;
|
|
37
|
+
detectChanges(): void;
|
|
38
|
+
insertFormArrayGroup(index: number, formArray: FormArray, formArrayModel: DynamicFormArrayModel): void;
|
|
39
|
+
cloneFormArrayGroup(index: number, formArray: FormArray, formArrayModel: DynamicFormArrayModel): void;
|
|
40
|
+
removeFormArrayGroup(index: number, formArray: FormArray, formArrayModel: DynamicFormArrayModel): void;
|
|
41
|
+
moveFormArrayGroup(index: number, step: number, formArray: FormArray, formArrayModel: DynamicFormArrayModel): void;
|
|
42
|
+
clearFormArray(formArray: FormArray, formArrayModel: DynamicFormArrayModel): void;
|
|
43
|
+
getClass(model?: DynamicFormControlModel): string;
|
|
44
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBaseFormComponent, never>;
|
|
45
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBaseFormComponent, "dynamic-base-form", never, { "group": { "alias": "group"; "required": false; }; "model": { "alias": "model"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "groupModel": { "alias": "groupModel"; "required": false; }; "labelPrefix": { "alias": "labelPrefix"; "required": false; }; "getComponentType": { "alias": "getComponentType"; "required": false; }; }, { "blur": "blur"; "change": "change"; "focus": "focus"; "onValueChange": "onValueChange"; "onStatusChange": "onStatusChange"; "onSubmit": "onSubmit"; "onDetectChanges": "onDetectChanges"; }, ["contentTemplates"], never, false, never>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { BehaviorSubject } from "rxjs";
|
|
3
|
+
import { DynamicBaseFormControlComponent } from "./dynamic-base-form-control.component";
|
|
4
|
+
import { DynamicFormOption, DynamicFormOptionGroup, DynamicSelectModel } from "../../utils/dynamic-select.model";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class DynamicBaseSelectComponent extends DynamicBaseFormControlComponent<DynamicSelectModel<any>> implements OnInit, OnDestroy {
|
|
7
|
+
groups$: BehaviorSubject<DynamicFormOptionGroup<any>[]>;
|
|
8
|
+
hasOptions: boolean;
|
|
9
|
+
ngOnInit(): void;
|
|
10
|
+
ngOnDestroy(): void;
|
|
11
|
+
isSelected(option: DynamicFormOption<any>): boolean;
|
|
12
|
+
selectToggle(option: DynamicFormOption<any>, state: boolean): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicBaseSelectComponent, never>;
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicBaseSelectComponent, "dynamic-base-select", never, {}, {}, never, never, false, never>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, Renderer2, SimpleChanges } from "@angular/core";
|
|
2
|
+
import { Subscription } from "rxjs";
|
|
3
|
+
import { IAsyncMessage, IToasterService } from "@stemy/ngx-utils";
|
|
4
|
+
import { AsyncSubmitMethod, IDynamicForm } from "../common-types";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class AsyncSubmitDirective implements OnChanges, OnDestroy {
|
|
7
|
+
private toaster;
|
|
8
|
+
readonly cdr: ChangeDetectorRef;
|
|
9
|
+
readonly zone: NgZone;
|
|
10
|
+
readonly elem: ElementRef<HTMLElement>;
|
|
11
|
+
readonly renderer: Renderer2;
|
|
12
|
+
method: AsyncSubmitMethod;
|
|
13
|
+
form: IDynamicForm;
|
|
14
|
+
context: any;
|
|
15
|
+
onSuccess: EventEmitter<IAsyncMessage>;
|
|
16
|
+
onError: EventEmitter<IAsyncMessage>;
|
|
17
|
+
protected loading: boolean;
|
|
18
|
+
protected disabled: boolean;
|
|
19
|
+
protected callback: Function;
|
|
20
|
+
protected subscription: Subscription;
|
|
21
|
+
get isDisabled(): boolean;
|
|
22
|
+
set isDisabled(value: boolean);
|
|
23
|
+
get isLoading(): boolean;
|
|
24
|
+
constructor(toaster: IToasterService, cdr: ChangeDetectorRef, zone: NgZone, elem: ElementRef<HTMLElement>, renderer: Renderer2);
|
|
25
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
26
|
+
ngOnDestroy(): void;
|
|
27
|
+
click(): void;
|
|
28
|
+
callMethod(): void;
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AsyncSubmitDirective, never>;
|
|
30
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AsyncSubmitDirective, "[async-submit]", ["async-submit"], { "method": { "alias": "async-submit"; "required": false; }; "form": { "alias": "form"; "required": false; }; "context": { "alias": "context"; "required": false; }; }, { "onSuccess": "onSuccess"; "onError": "onError"; }, never, never, false, never>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { NgxDynamicFormModule } from '@stemy/ngx-dynamic-form';
|
|
6
|
+
|
|
7
|
+
// --- Components ---
|
|
8
|
+
const components = [];
|
|
9
|
+
// --- Directives ---
|
|
10
|
+
const directives = [];
|
|
11
|
+
// --- Pipes ---
|
|
12
|
+
const pipes = [];
|
|
13
|
+
|
|
14
|
+
class NgxDynamicFormNebularModule {
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
16
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, imports: [CommonModule,
|
|
17
|
+
FormsModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
NgxDynamicFormModule], exports: [NgxDynamicFormModule] });
|
|
20
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, imports: [CommonModule,
|
|
21
|
+
FormsModule,
|
|
22
|
+
ReactiveFormsModule,
|
|
23
|
+
NgxDynamicFormModule, NgxDynamicFormModule] });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, decorators: [{
|
|
26
|
+
type: NgModule,
|
|
27
|
+
args: [{
|
|
28
|
+
declarations: [
|
|
29
|
+
...components,
|
|
30
|
+
],
|
|
31
|
+
imports: [
|
|
32
|
+
CommonModule,
|
|
33
|
+
FormsModule,
|
|
34
|
+
ReactiveFormsModule,
|
|
35
|
+
NgxDynamicFormModule
|
|
36
|
+
],
|
|
37
|
+
exports: [
|
|
38
|
+
...components,
|
|
39
|
+
NgxDynamicFormModule
|
|
40
|
+
],
|
|
41
|
+
providers: []
|
|
42
|
+
}]
|
|
43
|
+
}] });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generated bundle index. Do not edit.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
export { NgxDynamicFormNebularModule };
|
|
50
|
+
//# sourceMappingURL=stemy-ngx-dynamic-form-src-ngx-dynamic-form-nebular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stemy-ngx-dynamic-form-src-ngx-dynamic-form-nebular.mjs","sources":["../../src/ngx-dynamic-form/nebular/imports.ts","../../src/ngx-dynamic-form/nebular/ngx-dynamic-form.nebular.module.ts","../../src/ngx-dynamic-form/nebular/stemy-ngx-dynamic-form-src-ngx-dynamic-form-nebular.ts"],"sourcesContent":["import {Type} from \"@angular/core\";\n\n// --- Components ---\nexport const components = [\n\n] as Type<any>[];\n\n// --- Directives ---\nexport const directives = [\n\n];\n\n// --- Pipes ---\nexport const pipes = [];\n","import {NgModule} from \"@angular/core\";\nimport {CommonModule} from \"@angular/common\";\nimport {FormsModule, ReactiveFormsModule} from \"@angular/forms\";\nimport {NgxDynamicFormModule} from \"@stemy/ngx-dynamic-form\";\n\nimport {components} from \"./imports\";\n\n@NgModule({\n declarations: [\n ...components,\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NgxDynamicFormModule\n ],\n exports: [\n ...components,\n NgxDynamicFormModule\n ],\n providers: [\n\n ]\n})\nexport class NgxDynamicFormNebularModule {\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAEA;AACO,MAAM,UAAU,GAAG,EAEV;AAEhB;AACO,MAAM,UAAU,GAAG,EAEzB;AAED;AACO,MAAM,KAAK,GAAG,EAAE;;MCYV,2BAA2B,CAAA;uGAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAbhC,YAAY;YACZ,WAAW;YACX,mBAAmB;AACnB,YAAA,oBAAoB,aAIpB,oBAAoB,CAAA,EAAA,CAAA;AAMf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAbhC,YAAY;YACZ,WAAW;YACX,mBAAmB;AACnB,YAAA,oBAAoB,EAIpB,oBAAoB,CAAA,EAAA,CAAA;;2FAMf,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAlBvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;AACV,wBAAA,GAAG,UAAU;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;wBACb;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE;AAGd,iBAAA;;;ACxBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { NgxDynamicFormModule } from '@stemy/ngx-dynamic-form';
|
|
6
|
+
|
|
7
|
+
// --- Components ---
|
|
8
|
+
const components = [];
|
|
9
|
+
// --- Directives ---
|
|
10
|
+
const directives = [];
|
|
11
|
+
// --- Pipes ---
|
|
12
|
+
const pipes = [];
|
|
13
|
+
|
|
14
|
+
class NgxDynamicFormNebularModule {
|
|
15
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
16
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, imports: [CommonModule,
|
|
17
|
+
FormsModule,
|
|
18
|
+
ReactiveFormsModule,
|
|
19
|
+
NgxDynamicFormModule], exports: [NgxDynamicFormModule] });
|
|
20
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, imports: [CommonModule,
|
|
21
|
+
FormsModule,
|
|
22
|
+
ReactiveFormsModule,
|
|
23
|
+
NgxDynamicFormModule, NgxDynamicFormModule] });
|
|
24
|
+
}
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: NgxDynamicFormNebularModule, decorators: [{
|
|
26
|
+
type: NgModule,
|
|
27
|
+
args: [{
|
|
28
|
+
declarations: [
|
|
29
|
+
...components,
|
|
30
|
+
],
|
|
31
|
+
imports: [
|
|
32
|
+
CommonModule,
|
|
33
|
+
FormsModule,
|
|
34
|
+
ReactiveFormsModule,
|
|
35
|
+
NgxDynamicFormModule
|
|
36
|
+
],
|
|
37
|
+
exports: [
|
|
38
|
+
...components,
|
|
39
|
+
NgxDynamicFormModule
|
|
40
|
+
],
|
|
41
|
+
providers: []
|
|
42
|
+
}]
|
|
43
|
+
}] });
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generated bundle index. Do not edit.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
export { NgxDynamicFormNebularModule };
|
|
50
|
+
//# sourceMappingURL=stemy-ngx-dynamic-form-ui-nebular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stemy-ngx-dynamic-form-ui-nebular.mjs","sources":["../../ui-nebular/imports.ts","../../ui-nebular/ngx-dynamic-form.nebular.module.ts","../../ui-nebular/stemy-ngx-dynamic-form-ui-nebular.ts"],"sourcesContent":["import {Type} from \"@angular/core\";\n\n// --- Components ---\nexport const components = [\n\n] as Type<any>[];\n\n// --- Directives ---\nexport const directives = [\n\n];\n\n// --- Pipes ---\nexport const pipes = [];\n","import {NgModule} from \"@angular/core\";\nimport {CommonModule} from \"@angular/common\";\nimport {FormsModule, ReactiveFormsModule} from \"@angular/forms\";\nimport {NgxDynamicFormModule} from \"@stemy/ngx-dynamic-form\";\n\nimport {components} from \"./imports\";\n\n@NgModule({\n declarations: [\n ...components,\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n NgxDynamicFormModule\n ],\n exports: [\n ...components,\n NgxDynamicFormModule\n ],\n providers: [\n\n ]\n})\nexport class NgxDynamicFormNebularModule {\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAEA;AACO,MAAM,UAAU,GAAG,EAEV;AAEhB;AACO,MAAM,UAAU,GAAG,EAEzB;AAED;AACO,MAAM,KAAK,GAAG,EAAE;;MCYV,2BAA2B,CAAA;uGAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAbhC,YAAY;YACZ,WAAW;YACX,mBAAmB;AACnB,YAAA,oBAAoB,aAIpB,oBAAoB,CAAA,EAAA,CAAA;AAMf,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAbhC,YAAY;YACZ,WAAW;YACX,mBAAmB;AACnB,YAAA,oBAAoB,EAIpB,oBAAoB,CAAA,EAAA,CAAA;;2FAMf,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAlBvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;AACV,wBAAA,GAAG,UAAU;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB;AACH,qBAAA;AACD,oBAAA,OAAO,EAAE;AACL,wBAAA,GAAG,UAAU;wBACb;AACH,qBAAA;AACD,oBAAA,SAAS,EAAE;AAGd,iBAAA;;;ACxBD;;AAEG;;;;"}
|
|
@@ -336,13 +336,13 @@ function getFormComponent(...providers) {
|
|
|
336
336
|
}
|
|
337
337
|
function customizeFormModel(...providers) {
|
|
338
338
|
const factory = cachedFactory(providers);
|
|
339
|
-
return async (property, schema, model, config, injector) => {
|
|
339
|
+
return async (property, schema, model, config, path, injector) => {
|
|
340
340
|
const customizers = factory(injector);
|
|
341
341
|
const models = [model];
|
|
342
342
|
for (const customizer of customizers) {
|
|
343
343
|
const index = models.findIndex(m => customizer.acceptModel(m));
|
|
344
344
|
if (index >= 0) {
|
|
345
|
-
const custom = await customizer.customizeModel(models[index], config, property, schema);
|
|
345
|
+
const custom = await customizer.customizeModel(models[index], config, property, schema, path);
|
|
346
346
|
const result = Array.isArray(custom) ? custom : [custom];
|
|
347
347
|
models.splice(index, 1, ...result);
|
|
348
348
|
}
|
|
@@ -773,7 +773,7 @@ class DynamicFormService extends DynamicFormService$1 {
|
|
|
773
773
|
};
|
|
774
774
|
if (!ObjectUtils.isFunction(customizeModel))
|
|
775
775
|
return [model];
|
|
776
|
-
let res = customizeModel(property, schema, model, config, this.injector);
|
|
776
|
+
let res = customizeModel(property, schema, model, config, path, this.injector);
|
|
777
777
|
if (!res)
|
|
778
778
|
return [model];
|
|
779
779
|
if (res instanceof Promise) {
|