@wemake4u/form-player-se 1.0.18 → 1.0.19

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.
Files changed (44) hide show
  1. package/esm2022/lib/controls/checklist.mjs +4 -1
  2. package/esm2022/lib/controls/chipchecklist.mjs +4 -1
  3. package/esm2022/lib/controls/chipradio.mjs +4 -1
  4. package/esm2022/lib/controls/control.mjs +6 -27
  5. package/esm2022/lib/controls/radio.mjs +4 -1
  6. package/esm2022/lib/controls/select.mjs +4 -1
  7. package/esm2022/lib/controls/table.mjs +4 -1
  8. package/esm2022/lib/controls/taglist.mjs +4 -1
  9. package/esm2022/lib/dialog/dialog.component.mjs +11 -4
  10. package/esm2022/lib/directives/accordion.directive.mjs +2 -13
  11. package/esm2022/lib/directives/dropdown.directive.mjs +7 -7
  12. package/esm2022/lib/directives/grid.directive.mjs +7 -7
  13. package/esm2022/lib/directives/refresh.directive.mjs +25 -0
  14. package/esm2022/lib/dynamic-fields/dynamic-fields.component.mjs +46 -19
  15. package/esm2022/lib/dynamic-form/dynamic-form.component.mjs +72 -48
  16. package/esm2022/lib/services/dialog.service.mjs +2 -6
  17. package/esm2022/lib/services/function.service.mjs +9 -6
  18. package/esm2022/lib/services/grid.service.mjs +61 -5
  19. package/esm2022/lib/services/programmability.service.mjs +6 -1
  20. package/esm2022/lib/services/register.service.mjs +60 -19
  21. package/esm2022/lib/services/weak.service.mjs +1 -11
  22. package/esm2022/lib/utils/gridCells.mjs +14 -14
  23. package/esm2022/lib/utils/patchForm.mjs +32 -13
  24. package/fesm2022/wemake4u-form-player-se.mjs +402 -224
  25. package/fesm2022/wemake4u-form-player-se.mjs.map +1 -1
  26. package/lib/controls/checklist.d.ts +1 -0
  27. package/lib/controls/chipchecklist.d.ts +1 -0
  28. package/lib/controls/chipradio.d.ts +1 -0
  29. package/lib/controls/control.d.ts +1 -4
  30. package/lib/controls/radio.d.ts +1 -0
  31. package/lib/controls/select.d.ts +1 -0
  32. package/lib/controls/table.d.ts +1 -0
  33. package/lib/controls/taglist.d.ts +1 -0
  34. package/lib/dialog/dialog.component.d.ts +2 -0
  35. package/lib/directives/refresh.directive.d.ts +10 -0
  36. package/lib/dynamic-fields/dynamic-fields.component.d.ts +9 -4
  37. package/lib/dynamic-form/dynamic-form.component.d.ts +11 -5
  38. package/lib/services/dialog.service.d.ts +3 -1
  39. package/lib/services/function.service.d.ts +3 -1
  40. package/lib/services/grid.service.d.ts +3 -0
  41. package/lib/services/programmability.service.d.ts +1 -0
  42. package/lib/services/register.service.d.ts +5 -3
  43. package/lib/utils/patchForm.d.ts +1 -0
  44. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { Control } from "./control";
2
2
  export declare class CheckListControl extends Control {
3
+ readonly refresh: () => void;
3
4
  private getCheckboxGroup;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  import { Control } from "./control";
2
2
  export declare class ChipCheckListControl extends Control {
3
+ readonly refresh: () => void;
3
4
  private getChipCheckBoxGroup;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  import { Control } from "./control";
2
2
  export declare class ChipRadioControl extends Control {
3
+ readonly refresh: () => void;
3
4
  private getChipRadio;
4
5
  }
@@ -13,10 +13,7 @@ export declare class Control {
13
13
  export declare class ContainerControl extends Control {
14
14
  private register;
15
15
  constructor(name: string, metadata: any, componentRef: any, elementRef: ElementRef, register: RegisterService | undefined);
16
- getControls(): Control[];
17
- getControl(name: string): Control | undefined;
18
- findControl<T extends Control>(name: string, type: new (...args: any[]) => T): T | null;
19
- findControl(name: string): Control | null;
16
+ findControl(predicate: (control: Control) => boolean, firstOnly: boolean): Control[];
20
17
  }
21
18
  export declare class ItemControl extends ContainerControl {
22
19
  readonly index: number;
@@ -1,4 +1,5 @@
1
1
  import { Control } from "./control";
2
2
  export declare class RadioControl extends Control {
3
+ readonly refresh: () => void;
3
4
  private getRadio;
4
5
  }
@@ -1,4 +1,5 @@
1
1
  import { Control } from "./control";
2
2
  export declare class SelectControl extends Control {
3
+ readonly refresh: () => void;
3
4
  private getSelect;
4
5
  }
@@ -2,5 +2,6 @@ import { Control } from "./control";
2
2
  export declare class TableControl extends Control {
3
3
  readonly setFilter: (filter: any) => void;
4
4
  readonly clearFilter: () => void;
5
+ readonly refresh: () => void;
5
6
  private getGrid;
6
7
  }
@@ -1,4 +1,5 @@
1
1
  import { Control } from "./control";
2
2
  export declare class TagListControl extends Control {
3
+ readonly refresh: () => void;
3
4
  private getSelect;
4
5
  }
@@ -3,6 +3,7 @@ import { SirioDialogElement } from 'ngx-sirio-lib';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class DialogComponent extends SirioDialogElement {
5
5
  private formHost;
6
+ private formRef;
6
7
  Texts: {
7
8
  i18n: {
8
9
  it: {
@@ -281,6 +282,7 @@ export declare class DialogComponent extends SirioDialogElement {
281
282
  showTitle(): boolean;
282
283
  showCloseButton(): boolean;
283
284
  showFooter(): boolean;
285
+ isInvalid(): boolean;
284
286
  locale(component: any, key: string): string;
285
287
  private destroy$;
286
288
  private currentValue;
@@ -0,0 +1,10 @@
1
+ import { AfterContentInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class RefreshDirective implements AfterContentInit {
4
+ refresh: (() => void) | null;
5
+ componentRef: any;
6
+ constructor();
7
+ ngAfterContentInit(): void;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<RefreshDirective, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RefreshDirective, "[refresh]", never, { "refresh": { "alias": "refresh"; "required": false; }; "componentRef": { "alias": "componentRef"; "required": false; }; }, {}, never, never, true, never>;
10
+ }
@@ -318,19 +318,24 @@ export declare class DynamicFieldsComponent implements OnInit, AfterViewInit, ID
318
318
  getTemplate(value: string): any;
319
319
  getFormGroup(control: AbstractControl | null): FormGroup;
320
320
  getFormArray(control: AbstractControl | null): FormArray;
321
- getControlFromPath(path: string | null): AbstractControl | null;
321
+ resolvePath(path: string | null): FormGroup;
322
322
  toHTML(text: string): SafeHtml;
323
323
  sanitize(html: string): SafeHtml;
324
324
  getMimeTypes(extensions: string): string;
325
325
  clickButton(component: any, event: any): void;
326
326
  getValues(component: any): Observable<any>;
327
+ refreshValues(component: any): () => void;
327
328
  getGridOptions(component: any): GridOptions;
328
329
  getGridModules(component: any): Module[];
329
- getGridData(component: any): Observable<any>;
330
- addItem(component: any): void;
331
- removeItem(component: any, index: number): void;
330
+ onGridSelectionChanged(component: any, event: any): void;
331
+ getRowSource(component: any): Observable<any>;
332
+ refreshRowSource(component: any): () => void;
333
+ addItem(formArray: FormArray): void;
334
+ removeItem(formArray: FormArray, index: number): void;
332
335
  createUploadTables(component: any): any;
333
336
  fileUploaded($event: NgxSirioEvent<SirioFileUploadComponent>): void;
337
+ private invalidate;
338
+ private getControlFromPath;
334
339
  private focusFirst;
335
340
  private getAsObservable;
336
341
  private configureDatepicker;
@@ -1,4 +1,4 @@
1
- import { OnChanges, OnDestroy, SimpleChanges, EventEmitter, ElementRef } from '@angular/core';
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
4
  import { CommandEvent, EventService } from '../services/event.service';
@@ -15,9 +15,11 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
15
15
  private registerService;
16
16
  private metadata;
17
17
  private dialog;
18
+ private injector;
18
19
  schema: any;
19
20
  formGroup: FormGroup;
20
21
  value: any;
22
+ strict: boolean;
21
23
  showNav: boolean;
22
24
  showNavButton: boolean;
23
25
  showProgress: boolean;
@@ -28,7 +30,7 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
28
30
  onCommand: EventEmitter<CommandEvent>;
29
31
  activeNavChange: EventEmitter<any>;
30
32
  formDiv: ElementRef<HTMLDivElement>;
31
- constructor(fb: FormBuilder, programmability: ProgrammabilityService, events: EventService, registerService: RegisterService, metadata: MetadataService, dialog: DialogService);
33
+ constructor(fb: FormBuilder, programmability: ProgrammabilityService, events: EventService, registerService: RegisterService, metadata: MetadataService, dialog: DialogService, injector: Injector);
32
34
  Texts: {
33
35
  i18n: {
34
36
  it: {
@@ -306,8 +308,8 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
306
308
  goPrevious(): void;
307
309
  canNext(): boolean;
308
310
  goNext(): void;
309
- getControls(): Control[];
310
- getControl(name: string): Control | undefined;
311
+ getControl(name: string): Control | null;
312
+ getControlAs<T extends Control>(name: string, type: new (...args: any[]) => T): T | null;
311
313
  get activeNav(): number;
312
314
  set activeNav(value: number);
313
315
  get language(): string;
@@ -316,13 +318,17 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
316
318
  getFormStatus(form: any, index: number): SirioStepperProgressStatus;
317
319
  activateForm(title: string): void;
318
320
  evaluateBoolean(value: boolean | string | null): boolean | null;
321
+ evaluateTemplate(value: string | null): string;
319
322
  openForm(template: string, options: FormDialogOptions): void;
323
+ refresh(): void;
320
324
  private valueChangesSubscription;
321
325
  private onCommandSubscription;
322
326
  private _forms;
323
327
  private _activeNav;
324
328
  private _language;
325
329
  private defaultValue;
330
+ private onChangeSchema;
331
+ private onChangeValue;
326
332
  private getNext;
327
333
  private getPrevious;
328
334
  private getMaxNav;
@@ -349,5 +355,5 @@ export declare class DynamicFormComponent implements OnChanges, OnDestroy {
349
355
  private splitPath;
350
356
  private hasValue;
351
357
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFormComponent, never>;
352
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "app-dynamic-form", never, { "schema": { "alias": "schema"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "value": { "alias": "value"; "required": false; }; "showNav": { "alias": "showNav"; "required": false; }; "showNavButton": { "alias": "showNavButton"; "required": false; }; "showProgress": { "alias": "showProgress"; "required": false; }; "showFormTitle": { "alias": "showFormTitle"; "required": false; }; "progressStatus": { "alias": "progressStatus"; "required": false; }; "activeNav": { "alias": "activeNav"; "required": false; }; "language": { "alias": "language"; "required": false; }; }, { "valueChange": "valueChange"; "initialized": "initialized"; "onCommand": "onCommand"; "activeNavChange": "activeNavChange"; }, never, never, true, never>;
358
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicFormComponent, "app-dynamic-form", never, { "schema": { "alias": "schema"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "value": { "alias": "value"; "required": false; }; "strict": { "alias": "strict"; "required": false; }; "showNav": { "alias": "showNav"; "required": false; }; "showNavButton": { "alias": "showNavButton"; "required": false; }; "showProgress": { "alias": "showProgress"; "required": false; }; "showFormTitle": { "alias": "showFormTitle"; "required": false; }; "progressStatus": { "alias": "progressStatus"; "required": false; }; "activeNav": { "alias": "activeNav"; "required": false; }; "language": { "alias": "language"; "required": false; }; }, { "valueChange": "valueChange"; "initialized": "initialized"; "onCommand": "onCommand"; "activeNavChange": "activeNavChange"; }, never, never, true, never>;
353
359
  }
@@ -1,3 +1,4 @@
1
+ import { Injector } from '@angular/core';
1
2
  import { SirioDialogService, DialogTypes, DialogSizes } from 'ngx-sirio-lib';
2
3
  import { IEvaluatorProvider } from '../services/programmability.service';
3
4
  import * as i0 from "@angular/core";
@@ -26,6 +27,7 @@ export interface DialogOptions {
26
27
  }
27
28
  export interface FormDialogOptions extends DialogOptions {
28
29
  value?: any;
30
+ injector?: Injector;
29
31
  showNav?: boolean;
30
32
  showNavButton?: boolean;
31
33
  showProgress?: boolean;
@@ -36,4 +38,4 @@ export interface DialogResult {
36
38
  value?: any;
37
39
  }
38
40
  export type DialogAction = 'OK' | 'Cancel' | 'Yes' | 'No' | 'Confirm' | 'Close' | 'Abort' | 'Retry' | 'Ignore' | 'Try' | 'Continue';
39
- export type DialogButtons = 'OK' | 'OKCancel' | 'ConfirmClose' | 'AbortRetryIgnore' | 'YesNoCancel' | 'YesNo' | 'RetryCancel' | 'CancelTryContinue';
41
+ export type DialogButtons = 'OK' | 'OKCancel' | 'ConfirmCancel' | 'AbortRetryIgnore' | 'YesNoCancel' | 'YesNo' | 'RetryCancel' | 'CancelTryContinue';
@@ -1,3 +1,4 @@
1
+ import { Injector } from '@angular/core';
1
2
  import { MetadataService } from '../services/metadata.service';
2
3
  import { DialogService, DialogOptions } from '../services/dialog.service';
3
4
  import { IEvaluatorProvider } from '../services/programmability.service';
@@ -5,7 +6,8 @@ import * as i0 from "@angular/core";
5
6
  export declare class FunctionService implements IEvaluatorProvider {
6
7
  private metadata;
7
8
  private dialog;
8
- constructor(metadata: MetadataService, dialog: DialogService);
9
+ private injector;
10
+ constructor(metadata: MetadataService, dialog: DialogService, injector: Injector);
9
11
  invokable(func: any): Function;
10
12
  openForm(template: string, options: DialogOptions): void;
11
13
  getContext(): Record<string, any>;
@@ -9,6 +9,7 @@ export declare class GridService {
9
9
  constructor(formatter: FormatterService, programmability: ProgrammabilityService);
10
10
  getGridModules(): Module[];
11
11
  getGridOptions(component: any, formGroup: FormGroup, language: string): GridOptions;
12
+ onGridSelectionChanged(component: any, formGroup: FormGroup, event: any): any;
12
13
  private locale;
13
14
  private getGridColumns;
14
15
  private setCellDataType;
@@ -27,6 +28,8 @@ export declare class GridService {
27
28
  private setPinned;
28
29
  private setWidth;
29
30
  private setValueFormatter;
31
+ private getRowSelection;
32
+ private onRowSelectable;
30
33
  private getGridPaginable;
31
34
  private getGridPageSize;
32
35
  private getGridTexts;
@@ -28,6 +28,7 @@ export declare class ProgrammabilityService implements OnDestroy {
28
28
  evaluate(formGroup: FormGroup, value: string | null, options?: EvaluateOptions): any;
29
29
  evaluateTemplate(formGroup: FormGroup, value: string | null): any;
30
30
  evaluateUnary(formGroup: FormGroup, value: string | null, input: any): any;
31
+ invalidate(value: string | null): void;
31
32
  private cacheable;
32
33
  private evalUnaryTest;
33
34
  private evalExpression;
@@ -8,10 +8,12 @@ export declare class RegisterService implements IEvaluatorProvider {
8
8
  register(name: string, control: Control): void;
9
9
  unregister(name: string): void;
10
10
  unregisterAll(): void;
11
- getControl(name: string): Control | undefined;
12
- getControls(): Control[];
13
11
  getContext(): Record<string, any>;
14
- private resolve;
12
+ getControl(name: string): Control | null;
13
+ getControlAs<T extends Control>(name: string, type: new (...args: any[]) => T): T | null;
14
+ findControl(predicate: (control: Control) => boolean, firstOnly?: boolean, parent?: boolean): Control[];
15
+ private castString;
16
+ private resolveParent;
15
17
  static ɵfac: i0.ɵɵFactoryDeclaration<RegisterService, [{ optional: true; skipSelf: true; }]>;
16
18
  static ɵprov: i0.ɵɵInjectableDeclaration<RegisterService>;
17
19
  }
@@ -5,4 +5,5 @@ export declare function patchForm(control: AbstractControl, value: any, options?
5
5
  emitWarn?: boolean;
6
6
  validateType?: boolean;
7
7
  fallbackValue?: any;
8
+ strict: boolean;
8
9
  }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wemake4u/form-player-se",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^18.2.0",
6
6
  "@angular/common": "^18.2.0",