@wemake4u/form-player-se 1.0.28 → 1.0.29
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/esm2022/lib/controls/displayfield.mjs +4 -0
- package/esm2022/lib/controls/factory.mjs +4 -1
- package/esm2022/lib/directives/dropdown.directive.mjs +14 -5
- package/esm2022/lib/directives/number.directive.mjs +20 -5
- package/esm2022/lib/dynamic-fields/dynamic-fields.component.mjs +3 -3
- package/esm2022/lib/dynamic-form/dynamic-form.component.mjs +68 -58
- package/esm2022/lib/services/disable.service.mjs +74 -0
- package/esm2022/lib/services/form.service.mjs +6 -6
- package/esm2022/lib/services/programmability.service.mjs +24 -191
- package/esm2022/lib/services/status.service.mjs +49 -0
- package/esm2022/lib/services/validation.service.mjs +179 -0
- package/esm2022/lib/utils/CallbackRegistry.mjs +16 -0
- package/fesm2022/wemake4u-form-player-se.mjs +455 -287
- package/fesm2022/wemake4u-form-player-se.mjs.map +1 -1
- package/lib/controls/displayfield.d.ts +3 -0
- package/lib/directives/dropdown.directive.d.ts +4 -1
- package/lib/dynamic-form/dynamic-form.component.d.ts +8 -4
- package/lib/services/disable.service.d.ts +21 -0
- package/lib/services/form.service.d.ts +1 -1
- package/lib/services/programmability.service.d.ts +6 -14
- package/lib/services/status.service.d.ts +19 -0
- package/lib/services/validation.service.d.ts +36 -0
- package/lib/utils/CallbackRegistry.d.ts +6 -0
- package/package.json +1 -1
|
@@ -6,16 +6,19 @@ export declare class DropdownDirective implements AfterViewInit, OnDestroy {
|
|
|
6
6
|
private renderer;
|
|
7
7
|
private sirioSelect;
|
|
8
8
|
constructor(el: ElementRef, renderer: Renderer2, sirioSelect: SirioSelectComponent);
|
|
9
|
-
private optionsSubscription?;
|
|
10
9
|
ngAfterViewInit(): void;
|
|
10
|
+
ngOnInit(): void;
|
|
11
11
|
ngOnDestroy(): void;
|
|
12
12
|
private handleValue;
|
|
13
13
|
private handleSearchable;
|
|
14
14
|
private handleOptionsChanges;
|
|
15
|
+
private optionsSubscription?;
|
|
16
|
+
private canValidate;
|
|
15
17
|
private validator;
|
|
16
18
|
private addValidator;
|
|
17
19
|
private removeValidator;
|
|
18
20
|
private validateOptions;
|
|
21
|
+
private refreshValidators;
|
|
19
22
|
private deactivate;
|
|
20
23
|
private activate;
|
|
21
24
|
private onKeyUp;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { OnChanges, OnDestroy, SimpleChanges, EventEmitter, ElementRef, Injector } from '@angular/core';
|
|
2
2
|
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
3
|
import { ProgrammabilityService } from '../services/programmability.service';
|
|
4
|
+
import { ValidationService } from '../services/validation.service';
|
|
5
|
+
import { DisableService } from '../services/disable.service';
|
|
6
|
+
import { StatusService } from '../services/status.service';
|
|
4
7
|
import { CommandEvent, EventService } from '../services/event.service';
|
|
5
8
|
import { MetadataService } from '../services/metadata.service';
|
|
6
9
|
import { FormService } from '../services/form.service';
|
|
@@ -13,6 +16,9 @@ import * as i0 from "@angular/core";
|
|
|
13
16
|
export declare class DynamicFormComponent implements OnChanges, OnDestroy {
|
|
14
17
|
private fb;
|
|
15
18
|
private programmability;
|
|
19
|
+
private validationService;
|
|
20
|
+
private disableService;
|
|
21
|
+
private statusService;
|
|
16
22
|
private events;
|
|
17
23
|
private registerService;
|
|
18
24
|
private languageService;
|
|
@@ -34,7 +40,7 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
|
|
|
34
40
|
onCommand: EventEmitter<CommandEvent>;
|
|
35
41
|
activeNavChange: EventEmitter<any>;
|
|
36
42
|
formDiv: ElementRef<HTMLDivElement>;
|
|
37
|
-
constructor(fb: FormBuilder, programmability: ProgrammabilityService, events: EventService, registerService: RegisterService, languageService: LanguageService, metadata: MetadataService, formService: FormService, dialog: DialogService, injector: Injector);
|
|
43
|
+
constructor(fb: FormBuilder, programmability: ProgrammabilityService, validationService: ValidationService, disableService: DisableService, statusService: StatusService, events: EventService, registerService: RegisterService, languageService: LanguageService, metadata: MetadataService, formService: FormService, dialog: DialogService, injector: Injector);
|
|
38
44
|
Texts: {
|
|
39
45
|
i18n: {
|
|
40
46
|
it: {
|
|
@@ -325,7 +331,7 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
|
|
|
325
331
|
set activeNav(value: number);
|
|
326
332
|
getFormGroup(path: string | null): FormGroup;
|
|
327
333
|
getFormStatus(form: any, index: number): SirioStepperProgressStatus;
|
|
328
|
-
|
|
334
|
+
countInvalids(form: any): number;
|
|
329
335
|
activateForm(event: NgxSirioEvent<SirioStepperProgressBarComponent>): void;
|
|
330
336
|
evaluateBoolean(value: boolean | string | null): boolean | null;
|
|
331
337
|
evaluateTemplate(value: string | null): string;
|
|
@@ -338,7 +344,6 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
|
|
|
338
344
|
private _forms;
|
|
339
345
|
private _activeNav;
|
|
340
346
|
private defaultValue;
|
|
341
|
-
private controlMap;
|
|
342
347
|
private get language();
|
|
343
348
|
private onChangeSchema;
|
|
344
349
|
private onChangeValue;
|
|
@@ -353,7 +358,6 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
|
|
|
353
358
|
private clearHandlers;
|
|
354
359
|
private buildForm;
|
|
355
360
|
private addControls;
|
|
356
|
-
private getValidationRules;
|
|
357
361
|
private createFormArray;
|
|
358
362
|
private resizeFormArray;
|
|
359
363
|
private hasPath;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ProgrammabilityService } from './programmability.service';
|
|
2
|
+
import { FormService } from './form.service';
|
|
3
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DisableService {
|
|
6
|
+
private programmability;
|
|
7
|
+
private formService;
|
|
8
|
+
constructor(programmability: ProgrammabilityService, formService: FormService);
|
|
9
|
+
createCollection(): DisableCollection;
|
|
10
|
+
addToCollection(collection: DisableCollection, control: AbstractControl, parentGroup: FormGroup, disabled: any): void;
|
|
11
|
+
setupCollection(collection: DisableCollection): void;
|
|
12
|
+
private applyRule;
|
|
13
|
+
private getPath;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DisableService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DisableService>;
|
|
16
|
+
}
|
|
17
|
+
export interface DisableContext {
|
|
18
|
+
parentGroup: FormGroup;
|
|
19
|
+
disabled: any;
|
|
20
|
+
}
|
|
21
|
+
export type DisableCollection = Map<AbstractControl, DisableContext>;
|
|
@@ -28,7 +28,7 @@ export declare class FormService implements IEvaluatorProvider {
|
|
|
28
28
|
moveUp(control: AbstractControl, path: Path, index: number): boolean;
|
|
29
29
|
moveDown(control: AbstractControl, path: Path, index: number): boolean;
|
|
30
30
|
status(control: AbstractControl, path: Path, pathOptions?: PathOptions): FormControlStatus | undefined;
|
|
31
|
-
|
|
31
|
+
countInvalid(controls: Iterable<AbstractControl>): number;
|
|
32
32
|
getInvalidControls(control: AbstractControl): {
|
|
33
33
|
path: string;
|
|
34
34
|
control: AbstractControl;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { FormGroup } from '@angular/forms';
|
|
3
3
|
import { FeelService } from '../services/feel.service';
|
|
4
4
|
import { ScopeService } from '../services/scope.service';
|
|
5
5
|
import { RegisterService } from '../services/register.service';
|
|
@@ -37,10 +37,10 @@ export declare class ProgrammabilityService implements OnDestroy {
|
|
|
37
37
|
invalidate(value: string | null): void;
|
|
38
38
|
watch(formGroup: FormGroup, dependencies: (string | string[])[], callback: () => void): void;
|
|
39
39
|
getDependencies(expression: string): (string | string[])[];
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
private
|
|
43
|
-
private
|
|
40
|
+
get verbose(): boolean;
|
|
41
|
+
get cacheable(): boolean;
|
|
42
|
+
private _verbose;
|
|
43
|
+
private _cacheable;
|
|
44
44
|
private onErrorHandler;
|
|
45
45
|
private Init;
|
|
46
46
|
private evalUnaryTest;
|
|
@@ -56,13 +56,10 @@ export declare class ProgrammabilityService implements OnDestroy {
|
|
|
56
56
|
private watchingExpression;
|
|
57
57
|
private watchingTemplateExpression;
|
|
58
58
|
private watchingDependencies;
|
|
59
|
+
private subscribeChanges;
|
|
59
60
|
private invalidateExpression;
|
|
60
61
|
private processDependencies;
|
|
61
62
|
private getPath;
|
|
62
|
-
private validateFn;
|
|
63
|
-
private invalidateFn;
|
|
64
|
-
private createValidators;
|
|
65
|
-
private watchForValidation;
|
|
66
63
|
static ɵfac: i0.ɵɵFactoryDeclaration<ProgrammabilityService, [null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
67
64
|
static ɵprov: i0.ɵɵInjectableDeclaration<ProgrammabilityService>;
|
|
68
65
|
}
|
|
@@ -74,8 +71,3 @@ export interface EvaluateOptions {
|
|
|
74
71
|
extendContext?: ExtendContextFn;
|
|
75
72
|
}
|
|
76
73
|
export type ExtendContextFn = () => Record<string, any>;
|
|
77
|
-
export interface ValidationRule {
|
|
78
|
-
expression: string;
|
|
79
|
-
type: "validate" | "invalidate";
|
|
80
|
-
message: string;
|
|
81
|
-
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { FormService } from './form.service';
|
|
3
|
+
import { AbstractControl } from '@angular/forms';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class StatusService implements OnDestroy {
|
|
6
|
+
private formService;
|
|
7
|
+
constructor(formService: FormService);
|
|
8
|
+
ngOnDestroy(): void;
|
|
9
|
+
createCollection(): StatusCollection;
|
|
10
|
+
addToCollection(collection: StatusCollection, control: AbstractControl): void;
|
|
11
|
+
setupCollection(key: any, collection: StatusCollection): void;
|
|
12
|
+
countInvalid(key: any): number;
|
|
13
|
+
private destroy$;
|
|
14
|
+
private invalidMap;
|
|
15
|
+
private subscribeChanges;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StatusService, never>;
|
|
17
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StatusService>;
|
|
18
|
+
}
|
|
19
|
+
export type StatusCollection = Set<AbstractControl>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ProgrammabilityService } from '../services/programmability.service';
|
|
2
|
+
import { AbstractControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { LanguageService } from '@wemake4u/interact';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class ValidationService {
|
|
6
|
+
private languageService;
|
|
7
|
+
private programmability;
|
|
8
|
+
constructor(languageService: LanguageService, programmability: ProgrammabilityService);
|
|
9
|
+
suppress: boolean;
|
|
10
|
+
createCollection(): ValidationCollection;
|
|
11
|
+
addToCollection(collection: ValidationCollection, control: AbstractControl, component: any, formGroup: FormGroup): void;
|
|
12
|
+
setupCollection(collection: ValidationCollection): void;
|
|
13
|
+
private getRules;
|
|
14
|
+
private validateRules;
|
|
15
|
+
private createValidator;
|
|
16
|
+
private createAsyncValidator;
|
|
17
|
+
private validationErrors;
|
|
18
|
+
private watchForValidation;
|
|
19
|
+
private logValidation;
|
|
20
|
+
private readonly nullObserver;
|
|
21
|
+
private get language();
|
|
22
|
+
private locale;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationService, never>;
|
|
24
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ValidationService>;
|
|
25
|
+
}
|
|
26
|
+
export interface ComponentContext {
|
|
27
|
+
component: any;
|
|
28
|
+
formGroup: FormGroup;
|
|
29
|
+
}
|
|
30
|
+
export interface ValidationRule {
|
|
31
|
+
expression: string;
|
|
32
|
+
type: "validate" | "invalidate";
|
|
33
|
+
message: string;
|
|
34
|
+
async: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type ValidationCollection = Map<AbstractControl, ComponentContext>;
|