@wemake4u/form-player-se 1.0.18 → 1.0.20

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 (49) hide show
  1. package/esm2022/lib/controls/chart.mjs +10 -0
  2. package/esm2022/lib/controls/checklist.mjs +4 -1
  3. package/esm2022/lib/controls/chipchecklist.mjs +4 -1
  4. package/esm2022/lib/controls/chipradio.mjs +4 -1
  5. package/esm2022/lib/controls/control.mjs +6 -27
  6. package/esm2022/lib/controls/factory.mjs +4 -1
  7. package/esm2022/lib/controls/radio.mjs +4 -1
  8. package/esm2022/lib/controls/select.mjs +4 -1
  9. package/esm2022/lib/controls/table.mjs +4 -1
  10. package/esm2022/lib/controls/taglist.mjs +4 -1
  11. package/esm2022/lib/dialog/dialog.component.mjs +15 -7
  12. package/esm2022/lib/directives/accordion.directive.mjs +2 -13
  13. package/esm2022/lib/directives/dropdown.directive.mjs +7 -7
  14. package/esm2022/lib/directives/grid.directive.mjs +7 -7
  15. package/esm2022/lib/directives/refresh.directive.mjs +25 -0
  16. package/esm2022/lib/dynamic-fields/dynamic-fields.component.mjs +66 -29
  17. package/esm2022/lib/dynamic-form/dynamic-form.component.mjs +72 -48
  18. package/esm2022/lib/services/chart.service.mjs +264 -0
  19. package/esm2022/lib/services/dialog.service.mjs +5 -7
  20. package/esm2022/lib/services/function.service.mjs +9 -6
  21. package/esm2022/lib/services/grid.service.mjs +73 -17
  22. package/esm2022/lib/services/programmability.service.mjs +6 -1
  23. package/esm2022/lib/services/register.service.mjs +60 -19
  24. package/esm2022/lib/services/weak.service.mjs +1 -11
  25. package/esm2022/lib/utils/gridCells.mjs +14 -14
  26. package/esm2022/lib/utils/patchForm.mjs +32 -13
  27. package/fesm2022/wemake4u-form-player-se.mjs +710 -250
  28. package/fesm2022/wemake4u-form-player-se.mjs.map +1 -1
  29. package/lib/controls/chart.d.ts +4 -0
  30. package/lib/controls/checklist.d.ts +1 -0
  31. package/lib/controls/chipchecklist.d.ts +1 -0
  32. package/lib/controls/chipradio.d.ts +1 -0
  33. package/lib/controls/control.d.ts +1 -4
  34. package/lib/controls/radio.d.ts +1 -0
  35. package/lib/controls/select.d.ts +1 -0
  36. package/lib/controls/table.d.ts +1 -0
  37. package/lib/controls/taglist.d.ts +1 -0
  38. package/lib/dialog/dialog.component.d.ts +3 -0
  39. package/lib/directives/refresh.directive.d.ts +10 -0
  40. package/lib/dynamic-fields/dynamic-fields.component.d.ts +14 -5
  41. package/lib/dynamic-form/dynamic-form.component.d.ts +11 -5
  42. package/lib/services/chart.service.d.ts +34 -0
  43. package/lib/services/dialog.service.d.ts +3 -1
  44. package/lib/services/function.service.d.ts +3 -1
  45. package/lib/services/grid.service.d.ts +10 -7
  46. package/lib/services/programmability.service.d.ts +1 -0
  47. package/lib/services/register.service.d.ts +5 -3
  48. package/lib/utils/patchForm.d.ts +1 -0
  49. package/package.json +4 -2
@@ -0,0 +1,4 @@
1
+ import { Control } from "./control";
2
+ export declare class ChartControl extends Control {
3
+ private getChart;
4
+ }
@@ -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,8 @@ 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;
7
+ private dynamicFormType;
6
8
  Texts: {
7
9
  i18n: {
8
10
  it: {
@@ -281,6 +283,7 @@ export declare class DialogComponent extends SirioDialogElement {
281
283
  showTitle(): boolean;
282
284
  showCloseButton(): boolean;
283
285
  showFooter(): boolean;
286
+ isInvalid(): boolean;
284
287
  locale(component: any, key: string): string;
285
288
  private destroy$;
286
289
  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
+ }
@@ -11,10 +11,12 @@ import { WeakService } from '../services/weak.service';
11
11
  import { RegisterService } from '../services/register.service';
12
12
  import { MetadataService } from '../services/metadata.service';
13
13
  import { GridService } from '../services/grid.service';
14
+ import { ChartService } from '../services/chart.service';
14
15
  import { ButtonColors } from 'ngx-sirio-lib';
15
16
  import { Observable } from 'rxjs';
16
17
  import { SirioFileUploadComponent, NgxSirioEvent } from 'ngx-sirio-lib';
17
18
  import { Module, GridOptions } from 'ag-grid-community';
19
+ import { AgChartOptions } from 'ag-charts-community';
18
20
  import * as i0 from "@angular/core";
19
21
  export declare class DynamicFieldsComponent implements OnInit, AfterViewInit, IDynamicFieldsComponent {
20
22
  private sanitizer;
@@ -26,6 +28,7 @@ export declare class DynamicFieldsComponent implements OnInit, AfterViewInit, ID
26
28
  private register;
27
29
  private metadata;
28
30
  private grid;
31
+ private chart;
29
32
  private el;
30
33
  private cdr;
31
34
  rows: Array<any> | undefined;
@@ -299,7 +302,7 @@ export declare class DynamicFieldsComponent implements OnInit, AfterViewInit, ID
299
302
  OpenMenu: string;
300
303
  CloseMenu: string;
301
304
  };
302
- constructor(sanitizer: SanitizeService, markdown: MarkdownService, mime: MimeService, programmability: ProgrammabilityService, events: EventService, weak: WeakService, register: RegisterService, metadata: MetadataService, grid: GridService, el: ElementRef, cdr: ChangeDetectorRef);
305
+ constructor(sanitizer: SanitizeService, markdown: MarkdownService, mime: MimeService, programmability: ProgrammabilityService, events: EventService, weak: WeakService, register: RegisterService, metadata: MetadataService, grid: GridService, chart: ChartService, el: ElementRef, cdr: ChangeDetectorRef);
303
306
  ngOnInit(): void;
304
307
  ngAfterViewInit(): void;
305
308
  getRegister(): RegisterService;
@@ -318,19 +321,25 @@ export declare class DynamicFieldsComponent implements OnInit, AfterViewInit, ID
318
321
  getTemplate(value: string): any;
319
322
  getFormGroup(control: AbstractControl | null): FormGroup;
320
323
  getFormArray(control: AbstractControl | null): FormArray;
321
- getControlFromPath(path: string | null): AbstractControl | null;
324
+ resolvePath(path: string | null): FormGroup;
322
325
  toHTML(text: string): SafeHtml;
323
326
  sanitize(html: string): SafeHtml;
324
327
  getMimeTypes(extensions: string): string;
325
328
  clickButton(component: any, event: any): void;
326
329
  getValues(component: any): Observable<any>;
330
+ refreshValues(component: any): () => void;
331
+ getChartOptions(component: any): AgChartOptions;
327
332
  getGridOptions(component: any): GridOptions;
328
333
  getGridModules(component: any): Module[];
329
- getGridData(component: any): Observable<any>;
330
- addItem(component: any): void;
331
- removeItem(component: any, index: number): void;
334
+ onGridSelectionChanged(component: any, event: any): void;
335
+ getRowSource(component: any): Observable<any>;
336
+ refreshRowSource(component: any): () => void;
337
+ addItem(formArray: FormArray): void;
338
+ removeItem(formArray: FormArray, index: number): void;
332
339
  createUploadTables(component: any): any;
333
340
  fileUploaded($event: NgxSirioEvent<SirioFileUploadComponent>): void;
341
+ private invalidate;
342
+ private getControlFromPath;
334
343
  private focusFirst;
335
344
  private getAsObservable;
336
345
  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
  }
@@ -0,0 +1,34 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { ProgrammabilityService } from '../services/programmability.service';
3
+ import { AgChartOptions } from 'ag-charts-community';
4
+ import * as i0 from "@angular/core";
5
+ export declare class ChartService {
6
+ private programmability;
7
+ constructor(programmability: ProgrammabilityService);
8
+ getOptions(component: any, formGroup: FormGroup, language: string): AgChartOptions;
9
+ private locale;
10
+ private getSeries;
11
+ private getSeriesOptionsNames;
12
+ private getBaseSeriesOptions;
13
+ private getBarSeriesOptions;
14
+ private getLineSeriesOptions;
15
+ private getAreaSeriesOptions;
16
+ private getAreaSeriesOptionsNames;
17
+ private getScatterSeriesOptions;
18
+ private getScatterSeriesOptionsNames;
19
+ private getBubbleSeriesOptions;
20
+ private getBubbleSeriesOptionsNames;
21
+ private getPieSeriesOptions;
22
+ private getPieSeriesOptionsNames;
23
+ private getDonutSeriesOptions;
24
+ private getDonutSeriesOptionsNames;
25
+ private getProps;
26
+ private getDataProps;
27
+ private isBoolean;
28
+ private isString;
29
+ private isNumber;
30
+ private isDirection;
31
+ private isInterpolation;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartService, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChartService>;
34
+ }
@@ -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>;
@@ -7,10 +7,11 @@ export declare class GridService {
7
7
  private formatter;
8
8
  private programmability;
9
9
  constructor(formatter: FormatterService, programmability: ProgrammabilityService);
10
- getGridModules(): Module[];
11
- getGridOptions(component: any, formGroup: FormGroup, language: string): GridOptions;
10
+ getModules(): Module[];
11
+ getOptions(component: any, formGroup: FormGroup, language: string): GridOptions;
12
+ onSelectionChanged(component: any, formGroup: FormGroup, event: any): any;
12
13
  private locale;
13
- private getGridColumns;
14
+ private getColumns;
14
15
  private setCellDataType;
15
16
  private setCellRenderer;
16
17
  private setResizable;
@@ -27,10 +28,12 @@ export declare class GridService {
27
28
  private setPinned;
28
29
  private setWidth;
29
30
  private setValueFormatter;
30
- private getGridPaginable;
31
- private getGridPageSize;
32
- private getGridTexts;
33
- private getGridTheme;
31
+ private getRowSelection;
32
+ private onRowSelectable;
33
+ private getPaginable;
34
+ private getPageSize;
35
+ private getTexts;
36
+ private getTheme;
34
37
  private getDataTypeDefinitions;
35
38
  private getMap;
36
39
  private formatMap;
@@ -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.20",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^18.2.0",
6
6
  "@angular/common": "^18.2.0",
@@ -9,8 +9,10 @@
9
9
  "rxjs": "~7.8.0",
10
10
  "bootstrap": "5.3.3",
11
11
  "ag-grid-angular": "^33.0.4",
12
- "@ag-grid-community/angular": "32.3.7",
12
+ "@ag-grid-community/angular": "^32.3.7",
13
13
  "@ag-grid-community/locale": "^33.1.0",
14
+ "ag-charts-angular": "^11.3.2",
15
+ "ag-charts-community": "^11.3.2",
14
16
  "ngx-sirio-lib": "^1.2.6-A16",
15
17
  "util": "^0.12.5"
16
18
  },