@ng-formworks/core 16.3.0 → 17.3.0

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 (113) hide show
  1. package/esm2022/lib/framework-library/framework-library.service.mjs +174 -174
  2. package/esm2022/lib/framework-library/framework.mjs +14 -14
  3. package/esm2022/lib/framework-library/no-framework.component.mjs +17 -17
  4. package/esm2022/lib/framework-library/no-framework.module.mjs +26 -26
  5. package/esm2022/lib/framework-library/no.framework.mjs +18 -18
  6. package/esm2022/lib/json-schema-form.component.mjs +765 -765
  7. package/esm2022/lib/json-schema-form.module.mjs +25 -25
  8. package/esm2022/lib/json-schema-form.service.mjs +675 -675
  9. package/esm2022/lib/locale/de-validation-messages.mjs +59 -59
  10. package/esm2022/lib/locale/en-validation-messages.mjs +59 -59
  11. package/esm2022/lib/locale/es-validation-messages.mjs +56 -56
  12. package/esm2022/lib/locale/fr-validation-messages.mjs +59 -59
  13. package/esm2022/lib/locale/index.mjs +7 -7
  14. package/esm2022/lib/locale/it-validation-messages.mjs +59 -59
  15. package/esm2022/lib/locale/pt-validation-messages.mjs +59 -59
  16. package/esm2022/lib/locale/zh-validation-messages.mjs +59 -59
  17. package/esm2022/lib/shared/convert-schema-to-draft6.function.mjs +299 -299
  18. package/esm2022/lib/shared/form-group.functions.mjs +441 -441
  19. package/esm2022/lib/shared/format-regex.constants.mjs +53 -53
  20. package/esm2022/lib/shared/index.mjs +11 -11
  21. package/esm2022/lib/shared/json-schema.functions.mjs +783 -783
  22. package/esm2022/lib/shared/json.validators.mjs +883 -883
  23. package/esm2022/lib/shared/jsonpointer.functions.mjs +1025 -1025
  24. package/esm2022/lib/shared/layout.functions.mjs +1153 -1153
  25. package/esm2022/lib/shared/merge-schemas.function.mjs +344 -344
  26. package/esm2022/lib/shared/utility.functions.mjs +379 -379
  27. package/esm2022/lib/shared/validator.functions.mjs +583 -583
  28. package/esm2022/lib/widget-library/add-reference.component.mjs +48 -48
  29. package/esm2022/lib/widget-library/button.component.mjs +41 -41
  30. package/esm2022/lib/widget-library/checkbox.component.mjs +46 -46
  31. package/esm2022/lib/widget-library/checkboxes.component.mjs +52 -52
  32. package/esm2022/lib/widget-library/file.component.mjs +35 -35
  33. package/esm2022/lib/widget-library/hidden.component.mjs +33 -33
  34. package/esm2022/lib/widget-library/index.mjs +54 -54
  35. package/esm2022/lib/widget-library/input.component.mjs +38 -38
  36. package/esm2022/lib/widget-library/message.component.mjs +33 -33
  37. package/esm2022/lib/widget-library/none.component.mjs +20 -20
  38. package/esm2022/lib/widget-library/number.component.mjs +44 -44
  39. package/esm2022/lib/widget-library/one-of.component.mjs +35 -35
  40. package/esm2022/lib/widget-library/orderable.directive.mjs +123 -123
  41. package/esm2022/lib/widget-library/radios.component.mjs +44 -44
  42. package/esm2022/lib/widget-library/root.component.mjs +44 -44
  43. package/esm2022/lib/widget-library/section.component.mjs +78 -78
  44. package/esm2022/lib/widget-library/select-framework.component.mjs +51 -51
  45. package/esm2022/lib/widget-library/select-widget.component.mjs +46 -46
  46. package/esm2022/lib/widget-library/select.component.mjs +41 -41
  47. package/esm2022/lib/widget-library/submit.component.mjs +55 -55
  48. package/esm2022/lib/widget-library/tab.component.mjs +30 -30
  49. package/esm2022/lib/widget-library/tabs.component.mjs +53 -53
  50. package/esm2022/lib/widget-library/template.component.mjs +46 -46
  51. package/esm2022/lib/widget-library/textarea.component.mjs +37 -37
  52. package/esm2022/lib/widget-library/widget-library.module.mjs +41 -41
  53. package/esm2022/lib/widget-library/widget-library.service.mjs +225 -225
  54. package/esm2022/ng-formworks-core.mjs +4 -4
  55. package/esm2022/public_api.mjs +12 -12
  56. package/fesm2022/ng-formworks-core.mjs +9103 -9103
  57. package/fesm2022/ng-formworks-core.mjs.map +1 -1
  58. package/index.d.ts +5 -5
  59. package/lib/framework-library/framework-library.service.d.ts +55 -55
  60. package/lib/framework-library/framework.d.ts +13 -13
  61. package/lib/framework-library/no-framework.component.d.ts +8 -8
  62. package/lib/framework-library/no-framework.module.d.ts +9 -9
  63. package/lib/framework-library/no.framework.d.ts +10 -10
  64. package/lib/json-schema-form.component.d.ts +218 -218
  65. package/lib/json-schema-form.module.d.ts +11 -11
  66. package/lib/json-schema-form.service.d.ts +115 -115
  67. package/lib/locale/de-validation-messages.d.ts +1 -1
  68. package/lib/locale/en-validation-messages.d.ts +1 -1
  69. package/lib/locale/es-validation-messages.d.ts +1 -1
  70. package/lib/locale/fr-validation-messages.d.ts +1 -1
  71. package/lib/locale/index.d.ts +7 -7
  72. package/lib/locale/it-validation-messages.d.ts +1 -1
  73. package/lib/locale/pt-validation-messages.d.ts +1 -1
  74. package/lib/locale/zh-validation-messages.d.ts +1 -1
  75. package/lib/shared/convert-schema-to-draft6.function.d.ts +21 -21
  76. package/lib/shared/form-group.functions.d.ts +100 -100
  77. package/lib/shared/format-regex.constants.d.ts +19 -19
  78. package/lib/shared/index.d.ts +9 -9
  79. package/lib/shared/json-schema.functions.d.ts +193 -193
  80. package/lib/shared/json.validators.d.ts +441 -441
  81. package/lib/shared/jsonpointer.functions.d.ts +416 -416
  82. package/lib/shared/layout.functions.d.ts +83 -83
  83. package/lib/shared/merge-schemas.function.d.ts +19 -19
  84. package/lib/shared/utility.functions.d.ts +165 -165
  85. package/lib/shared/validator.functions.d.ts +364 -364
  86. package/lib/widget-library/add-reference.component.d.ts +20 -20
  87. package/lib/widget-library/button.component.d.ts +21 -21
  88. package/lib/widget-library/checkbox.component.d.ts +24 -24
  89. package/lib/widget-library/checkboxes.component.d.ts +24 -24
  90. package/lib/widget-library/file.component.d.ts +21 -21
  91. package/lib/widget-library/hidden.component.d.ts +19 -19
  92. package/lib/widget-library/index.d.ts +47 -47
  93. package/lib/widget-library/input.component.d.ts +22 -22
  94. package/lib/widget-library/message.component.d.ts +15 -15
  95. package/lib/widget-library/none.component.d.ts +8 -8
  96. package/lib/widget-library/number.component.d.ts +25 -25
  97. package/lib/widget-library/one-of.component.d.ts +21 -21
  98. package/lib/widget-library/orderable.directive.d.ts +41 -41
  99. package/lib/widget-library/radios.component.d.ts +23 -23
  100. package/lib/widget-library/root.component.d.ts +17 -17
  101. package/lib/widget-library/section.component.d.ts +19 -19
  102. package/lib/widget-library/select-framework.component.d.ts +18 -18
  103. package/lib/widget-library/select-widget.component.d.ts +18 -18
  104. package/lib/widget-library/select.component.d.ts +24 -24
  105. package/lib/widget-library/submit.component.d.ts +24 -24
  106. package/lib/widget-library/tab.component.d.ts +14 -14
  107. package/lib/widget-library/tabs.component.d.ts +20 -20
  108. package/lib/widget-library/template.component.d.ts +18 -18
  109. package/lib/widget-library/textarea.component.d.ts +21 -21
  110. package/lib/widget-library/widget-library.module.d.ts +31 -31
  111. package/lib/widget-library/widget-library.service.d.ts +22 -22
  112. package/package.json +5 -5
  113. package/public_api.d.ts +9 -9
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@ng-formworks/core" />
5
- export * from './public_api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@ng-formworks/core" />
5
+ export * from './public_api';
@@ -1,55 +1,55 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- import { WidgetLibraryService } from '../widget-library/widget-library.service';
4
- import { Framework } from './framework';
5
- import * as i0 from "@angular/core";
6
- export declare class FrameworkLibraryService {
7
- private frameworks;
8
- private widgetLibrary;
9
- private http;
10
- activeFramework: Framework;
11
- stylesheets: (HTMLStyleElement | HTMLLinkElement)[];
12
- scripts: HTMLScriptElement[];
13
- loadExternalAssets: boolean;
14
- defaultFramework: string;
15
- frameworkLibrary: {
16
- [name: string]: Framework;
17
- };
18
- activeFrameworkName$: Observable<string>;
19
- private activeFrameworkNameSubject;
20
- private activeFrameworkName;
21
- constructor(frameworks: any[], widgetLibrary: WidgetLibraryService, http: HttpClient);
22
- setLoadExternalAssets(loadExternalAssets?: boolean): void;
23
- setFramework(framework?: string | Framework, loadExternalAssets?: boolean): boolean;
24
- registerFrameworkWidgets(framework: Framework): boolean;
25
- hasFramework(type: string): boolean;
26
- getFramework(): any;
27
- getFrameworkList(): {
28
- name: string;
29
- text: string;
30
- }[];
31
- getFrameworkWidgets(): any;
32
- getFrameworkStylesheets(load?: boolean): string[];
33
- getFrameworkScripts(load?: boolean): string[];
34
- getFrameworkConfig(existingFramework?: any): any;
35
- getFrameworkAssetConfig(existingFramework?: any, useAssetRelPath?: boolean): Promise<{
36
- stylesheets: string[];
37
- scripts: string[];
38
- }>;
39
- getFrameworkThemes(): {
40
- name: string;
41
- text: string;
42
- }[];
43
- requestThemeChange(name: string, validateThemeExists?: boolean, existingFramework?: any): boolean;
44
- getActiveTheme(existingFramework?: any): {
45
- name: string;
46
- text: string;
47
- };
48
- registerTheme(newTheme: {
49
- name: string;
50
- text: string;
51
- }, existingFramework?: any): boolean;
52
- unregisterTheme(name: string, existingFramework?: any): boolean;
53
- static ɵfac: i0.ɵɵFactoryDeclaration<FrameworkLibraryService, never>;
54
- static ɵprov: i0.ɵɵInjectableDeclaration<FrameworkLibraryService>;
55
- }
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { WidgetLibraryService } from '../widget-library/widget-library.service';
4
+ import { Framework } from './framework';
5
+ import * as i0 from "@angular/core";
6
+ export declare class FrameworkLibraryService {
7
+ private frameworks;
8
+ private widgetLibrary;
9
+ private http;
10
+ activeFramework: Framework;
11
+ stylesheets: (HTMLStyleElement | HTMLLinkElement)[];
12
+ scripts: HTMLScriptElement[];
13
+ loadExternalAssets: boolean;
14
+ defaultFramework: string;
15
+ frameworkLibrary: {
16
+ [name: string]: Framework;
17
+ };
18
+ activeFrameworkName$: Observable<string>;
19
+ private activeFrameworkNameSubject;
20
+ private activeFrameworkName;
21
+ constructor(frameworks: any[], widgetLibrary: WidgetLibraryService, http: HttpClient);
22
+ setLoadExternalAssets(loadExternalAssets?: boolean): void;
23
+ setFramework(framework?: string | Framework, loadExternalAssets?: boolean): boolean;
24
+ registerFrameworkWidgets(framework: Framework): boolean;
25
+ hasFramework(type: string): boolean;
26
+ getFramework(): any;
27
+ getFrameworkList(): {
28
+ name: string;
29
+ text: string;
30
+ }[];
31
+ getFrameworkWidgets(): any;
32
+ getFrameworkStylesheets(load?: boolean): string[];
33
+ getFrameworkScripts(load?: boolean): string[];
34
+ getFrameworkConfig(existingFramework?: any): any;
35
+ getFrameworkAssetConfig(existingFramework?: any, useAssetRelPath?: boolean): Promise<{
36
+ stylesheets: string[];
37
+ scripts: string[];
38
+ }>;
39
+ getFrameworkThemes(): {
40
+ name: string;
41
+ text: string;
42
+ }[];
43
+ requestThemeChange(name: string, validateThemeExists?: boolean, existingFramework?: any): boolean;
44
+ getActiveTheme(existingFramework?: any): {
45
+ name: string;
46
+ text: string;
47
+ };
48
+ registerTheme(newTheme: {
49
+ name: string;
50
+ text: string;
51
+ }, existingFramework?: any): boolean;
52
+ unregisterTheme(name: string, existingFramework?: any): boolean;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<FrameworkLibraryService, never>;
54
+ static ɵprov: i0.ɵɵInjectableDeclaration<FrameworkLibraryService>;
55
+ }
@@ -1,13 +1,13 @@
1
- import * as i0 from "@angular/core";
2
- export declare class Framework {
3
- name: string;
4
- text: string;
5
- framework: any;
6
- widgets?: {
7
- [key: string]: any;
8
- };
9
- stylesheets?: string[];
10
- scripts?: string[];
11
- static ɵfac: i0.ɵɵFactoryDeclaration<Framework, never>;
12
- static ɵprov: i0.ɵɵInjectableDeclaration<Framework>;
13
- }
1
+ import * as i0 from "@angular/core";
2
+ export declare class Framework {
3
+ name: string;
4
+ text: string;
5
+ framework: any;
6
+ widgets?: {
7
+ [key: string]: any;
8
+ };
9
+ stylesheets?: string[];
10
+ scripts?: string[];
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<Framework, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<Framework>;
13
+ }
@@ -1,8 +1,8 @@
1
- import * as i0 from "@angular/core";
2
- export declare class NoFrameworkComponent {
3
- layoutNode: any;
4
- layoutIndex: number[];
5
- dataIndex: number[];
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NoFrameworkComponent, never>;
7
- static ɵcmp: i0.ɵɵComponentDeclaration<NoFrameworkComponent, "no-framework", never, { "layoutNode": { "alias": "layoutNode"; "required": false; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; }; "dataIndex": { "alias": "dataIndex"; "required": false; }; }, {}, never, never, false, never>;
8
- }
1
+ import * as i0 from "@angular/core";
2
+ export declare class NoFrameworkComponent {
3
+ layoutNode: any;
4
+ layoutIndex: number[];
5
+ dataIndex: number[];
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<NoFrameworkComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<NoFrameworkComponent, "no-framework", never, { "layoutNode": { "alias": "layoutNode"; "required": false; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; }; "dataIndex": { "alias": "dataIndex"; "required": false; }; }, {}, never, never, false, never>;
8
+ }
@@ -1,9 +1,9 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./no-framework.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "../widget-library/widget-library.module";
5
- export declare class NoFrameworkModule {
6
- static ɵfac: i0.ɵɵFactoryDeclaration<NoFrameworkModule, never>;
7
- static ɵmod: i0.ɵɵNgModuleDeclaration<NoFrameworkModule, [typeof i1.NoFrameworkComponent], [typeof i2.CommonModule, typeof i3.WidgetLibraryModule], [typeof i1.NoFrameworkComponent]>;
8
- static ɵinj: i0.ɵɵInjectorDeclaration<NoFrameworkModule>;
9
- }
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./no-framework.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "../widget-library/widget-library.module";
5
+ export declare class NoFrameworkModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<NoFrameworkModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NoFrameworkModule, [typeof i1.NoFrameworkComponent], [typeof i2.CommonModule, typeof i3.WidgetLibraryModule], [typeof i1.NoFrameworkComponent]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<NoFrameworkModule>;
9
+ }
@@ -1,10 +1,10 @@
1
- import { Framework } from './framework';
2
- import { NoFrameworkComponent } from './no-framework.component';
3
- import * as i0 from "@angular/core";
4
- export declare class NoFramework extends Framework {
5
- name: string;
6
- text: string;
7
- framework: typeof NoFrameworkComponent;
8
- static ɵfac: i0.ɵɵFactoryDeclaration<NoFramework, never>;
9
- static ɵprov: i0.ɵɵInjectableDeclaration<NoFramework>;
10
- }
1
+ import { Framework } from './framework';
2
+ import { NoFrameworkComponent } from './no-framework.component';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NoFramework extends Framework {
5
+ name: string;
6
+ text: string;
7
+ framework: typeof NoFrameworkComponent;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<NoFramework, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<NoFramework>;
10
+ }
@@ -1,218 +1,218 @@
1
- import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
- import { ControlValueAccessor } from '@angular/forms';
3
- import { Subscription } from 'rxjs';
4
- import { FrameworkLibraryService } from './framework-library/framework-library.service';
5
- import { JsonSchemaFormService } from './json-schema-form.service';
6
- import { WidgetLibraryService } from './widget-library/widget-library.service';
7
- import * as i0 from "@angular/core";
8
- export declare const JSON_SCHEMA_FORM_VALUE_ACCESSOR: any;
9
- /**
10
- * @module 'JsonSchemaFormComponent' - Angular JSON Schema Form
11
- *
12
- * Root module of the Angular JSON Schema Form client-side library,
13
- * an Angular library which generates an HTML form from a JSON schema
14
- * structured data model and/or a JSON Schema Form layout description.
15
- *
16
- * This library also validates input data by the user, using both validators on
17
- * individual controls to provide real-time feedback while the user is filling
18
- * out the form, and then validating the entire input against the schema when
19
- * the form is submitted to make sure the returned JSON data object is valid.
20
- *
21
- * This library is similar to, and mostly API compatible with:
22
- *
23
- * - JSON Schema Form's Angular Schema Form library for AngularJs
24
- * http://schemaform.io
25
- * http://schemaform.io/examples/bootstrap-example.html (examples)
26
- *
27
- * - Mozilla's react-jsonschema-form library for React
28
- * https://github.com/mozilla-services/react-jsonschema-form
29
- * https://mozilla-services.github.io/react-jsonschema-form (examples)
30
- *
31
- * - Joshfire's JSON Form library for jQuery
32
- * https://github.com/joshfire/jsonform
33
- * http://ulion.github.io/jsonform/playground (examples)
34
- *
35
- * This library depends on:
36
- * - Angular (obviously) https://angular.io
37
- * - lodash, JavaScript utility library https://github.com/lodash/lodash
38
- * - ajv, Another JSON Schema validator https://github.com/epoberezkin/ajv
39
- *
40
- * In addition, the Example Playground also depends on:
41
- * - brace, Browserified Ace editor http://thlorenz.github.io/brace
42
- */
43
- export declare class JsonSchemaFormComponent implements ControlValueAccessor, OnChanges, OnInit, OnDestroy {
44
- private changeDetector;
45
- private frameworkLibrary;
46
- private widgetLibrary;
47
- jsf: JsonSchemaFormService;
48
- private unsubscribeOnActivateForm$;
49
- debugOutput: any;
50
- formValueSubscription: any;
51
- formInitialized: boolean;
52
- objectWrap: boolean;
53
- formValuesInput: string;
54
- previousInputs: {
55
- schema: any;
56
- layout: any[];
57
- data: any;
58
- options: any;
59
- framework: any | string;
60
- widgets: any;
61
- form: any;
62
- model: any;
63
- JSONSchema: any;
64
- UISchema: any;
65
- formData: any;
66
- loadExternalAssets: boolean;
67
- debug: boolean;
68
- };
69
- schema: any;
70
- layout: any[];
71
- data: any;
72
- options: any;
73
- framework: any | string;
74
- widgets: any;
75
- form: any;
76
- model: any;
77
- JSONSchema: any;
78
- UISchema: any;
79
- formData: any;
80
- ngModel: any;
81
- language: string;
82
- loadExternalAssets: boolean;
83
- debug: boolean;
84
- theme: string;
85
- get value(): any;
86
- set value(value: any);
87
- onChanges: EventEmitter<any>;
88
- onSubmit: EventEmitter<any>;
89
- isValid: EventEmitter<boolean>;
90
- validationErrors: EventEmitter<any>;
91
- formSchema: EventEmitter<any>;
92
- formLayout: EventEmitter<any>;
93
- dataChange: EventEmitter<any>;
94
- modelChange: EventEmitter<any>;
95
- formDataChange: EventEmitter<any>;
96
- ngModelChange: EventEmitter<any>;
97
- onChange: Function;
98
- onTouched: Function;
99
- dataChangesSubs: Subscription;
100
- statusChangesSubs: Subscription;
101
- isValidChangesSubs: Subscription;
102
- validationErrorChangesSubs: Subscription;
103
- constructor(changeDetector: ChangeDetectorRef, frameworkLibrary: FrameworkLibraryService, widgetLibrary: WidgetLibraryService, jsf: JsonSchemaFormService);
104
- ngOnDestroy(): void;
105
- private resetScriptsAndStyleSheets;
106
- private loadScripts;
107
- private loadStyleSheets;
108
- private loadAssets;
109
- ngOnInit(): void;
110
- ngOnChanges(changes: SimpleChanges): void;
111
- writeValue(value: any): void;
112
- registerOnChange(fn: Function): void;
113
- registerOnTouched(fn: Function): void;
114
- setDisabledState(isDisabled: boolean): void;
115
- updateForm(): void;
116
- setFormValues(formValues: any, resetFirst?: boolean): void;
117
- submitForm(): void;
118
- /**
119
- * 'initializeForm' function
120
- *
121
- * - Update 'schema', 'layout', and 'formValues', from inputs.
122
- *
123
- * - Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'
124
- * to resolve schema $ref links, including recursive $ref links.
125
- *
126
- * - Create 'dataRecursiveRefMap' to resolve recursive links in data
127
- * and corectly set output formats for recursively nested values.
128
- *
129
- * - Create 'layoutRefLibrary' and 'templateRefLibrary' to store
130
- * new layout nodes and formGroup elements to use when dynamically
131
- * adding form components to arrays and recursive $ref points.
132
- *
133
- * - Create 'dataMap' to map the data to the schema and template.
134
- *
135
- * - Create the master 'formGroupTemplate' then from it 'formGroup'
136
- * the Angular formGroup used to control the reactive form.
137
- */
138
- initializeForm(initialData?: any): void;
139
- /**
140
- * 'initializeOptions' function
141
- *
142
- * Initialize 'options' (global form options) and set framework
143
- * Combine available inputs:
144
- * 1. options - recommended
145
- * 2. form.options - Single input style
146
- */
147
- private initializeOptions;
148
- /**
149
- * 'initializeSchema' function
150
- *
151
- * Initialize 'schema'
152
- * Use first available input:
153
- * 1. schema - recommended / Angular Schema Form style
154
- * 2. form.schema - Single input / JSON Form style
155
- * 3. JSONSchema - React JSON Schema Form style
156
- * 4. form.JSONSchema - For testing single input React JSON Schema Forms
157
- * 5. form - For testing single schema-only inputs
158
- *
159
- * ... if no schema input found, the 'activateForm' function, below,
160
- * will make two additional attempts to build a schema
161
- * 6. If layout input - build schema from layout
162
- * 7. If data input - build schema from data
163
- */
164
- private initializeSchema;
165
- /**
166
- * 'initializeData' function
167
- *
168
- * Initialize 'formValues'
169
- * defulat or previously submitted values used to populate form
170
- * Use first available input:
171
- * 1. data - recommended
172
- * 2. model - Angular Schema Form style
173
- * 3. form.value - JSON Form style
174
- * 4. form.data - Single input style
175
- * 5. formData - React JSON Schema Form style
176
- * 6. form.formData - For easier testing of React JSON Schema Forms
177
- * 7. (none) no data - initialize data from schema and layout defaults only
178
- */
179
- private initializeData;
180
- /**
181
- * 'initializeLayout' function
182
- *
183
- * Initialize 'layout'
184
- * Use first available array input:
185
- * 1. layout - recommended
186
- * 2. form - Angular Schema Form style
187
- * 3. form.form - JSON Form style
188
- * 4. form.layout - Single input style
189
- * 5. (none) no layout - set default layout instead
190
- * (full layout will be built later from the schema)
191
- *
192
- * Also, if alternate layout formats are available,
193
- * import from 'UISchema' or 'customFormItems'
194
- * used for React JSON Schema Form and JSON Form API compatibility
195
- * Use first available input:
196
- * 1. UISchema - React JSON Schema Form style
197
- * 2. form.UISchema - For testing single input React JSON Schema Forms
198
- * 2. form.customFormItems - JSON Form style
199
- * 3. (none) no input - don't import
200
- */
201
- private initializeLayout;
202
- /**
203
- * 'activateForm' function
204
- *
205
- * ...continued from 'initializeSchema' function, above
206
- * If 'schema' has not been initialized (i.e. no schema input found)
207
- * 6. If layout input - build schema from layout input
208
- * 7. If data input - build schema from data input
209
- *
210
- * Create final layout,
211
- * build the FormGroup template and the Angular FormGroup,
212
- * subscribe to changes,
213
- * and activate the form.
214
- */
215
- private activateForm;
216
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonSchemaFormComponent, never>;
217
- static ɵcmp: i0.ɵɵComponentDeclaration<JsonSchemaFormComponent, "json-schema-form", never, { "schema": { "alias": "schema"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "data": { "alias": "data"; "required": false; }; "options": { "alias": "options"; "required": false; }; "framework": { "alias": "framework"; "required": false; }; "widgets": { "alias": "widgets"; "required": false; }; "form": { "alias": "form"; "required": false; }; "model": { "alias": "model"; "required": false; }; "JSONSchema": { "alias": "JSONSchema"; "required": false; }; "UISchema": { "alias": "UISchema"; "required": false; }; "formData": { "alias": "formData"; "required": false; }; "ngModel": { "alias": "ngModel"; "required": false; }; "language": { "alias": "language"; "required": false; }; "loadExternalAssets": { "alias": "loadExternalAssets"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "onChanges": "onChanges"; "onSubmit": "onSubmit"; "isValid": "isValid"; "validationErrors": "validationErrors"; "formSchema": "formSchema"; "formLayout": "formLayout"; "dataChange": "dataChange"; "modelChange": "modelChange"; "formDataChange": "formDataChange"; "ngModelChange": "ngModelChange"; }, never, never, false, never>;
218
- }
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { Subscription } from 'rxjs';
4
+ import { FrameworkLibraryService } from './framework-library/framework-library.service';
5
+ import { JsonSchemaFormService } from './json-schema-form.service';
6
+ import { WidgetLibraryService } from './widget-library/widget-library.service';
7
+ import * as i0 from "@angular/core";
8
+ export declare const JSON_SCHEMA_FORM_VALUE_ACCESSOR: any;
9
+ /**
10
+ * @module 'JsonSchemaFormComponent' - Angular JSON Schema Form
11
+ *
12
+ * Root module of the Angular JSON Schema Form client-side library,
13
+ * an Angular library which generates an HTML form from a JSON schema
14
+ * structured data model and/or a JSON Schema Form layout description.
15
+ *
16
+ * This library also validates input data by the user, using both validators on
17
+ * individual controls to provide real-time feedback while the user is filling
18
+ * out the form, and then validating the entire input against the schema when
19
+ * the form is submitted to make sure the returned JSON data object is valid.
20
+ *
21
+ * This library is similar to, and mostly API compatible with:
22
+ *
23
+ * - JSON Schema Form's Angular Schema Form library for AngularJs
24
+ * http://schemaform.io
25
+ * http://schemaform.io/examples/bootstrap-example.html (examples)
26
+ *
27
+ * - Mozilla's react-jsonschema-form library for React
28
+ * https://github.com/mozilla-services/react-jsonschema-form
29
+ * https://mozilla-services.github.io/react-jsonschema-form (examples)
30
+ *
31
+ * - Joshfire's JSON Form library for jQuery
32
+ * https://github.com/joshfire/jsonform
33
+ * http://ulion.github.io/jsonform/playground (examples)
34
+ *
35
+ * This library depends on:
36
+ * - Angular (obviously) https://angular.io
37
+ * - lodash, JavaScript utility library https://github.com/lodash/lodash
38
+ * - ajv, Another JSON Schema validator https://github.com/epoberezkin/ajv
39
+ *
40
+ * In addition, the Example Playground also depends on:
41
+ * - brace, Browserified Ace editor http://thlorenz.github.io/brace
42
+ */
43
+ export declare class JsonSchemaFormComponent implements ControlValueAccessor, OnChanges, OnInit, OnDestroy {
44
+ private changeDetector;
45
+ private frameworkLibrary;
46
+ private widgetLibrary;
47
+ jsf: JsonSchemaFormService;
48
+ private unsubscribeOnActivateForm$;
49
+ debugOutput: any;
50
+ formValueSubscription: any;
51
+ formInitialized: boolean;
52
+ objectWrap: boolean;
53
+ formValuesInput: string;
54
+ previousInputs: {
55
+ schema: any;
56
+ layout: any[];
57
+ data: any;
58
+ options: any;
59
+ framework: any | string;
60
+ widgets: any;
61
+ form: any;
62
+ model: any;
63
+ JSONSchema: any;
64
+ UISchema: any;
65
+ formData: any;
66
+ loadExternalAssets: boolean;
67
+ debug: boolean;
68
+ };
69
+ schema: any;
70
+ layout: any[];
71
+ data: any;
72
+ options: any;
73
+ framework: any | string;
74
+ widgets: any;
75
+ form: any;
76
+ model: any;
77
+ JSONSchema: any;
78
+ UISchema: any;
79
+ formData: any;
80
+ ngModel: any;
81
+ language: string;
82
+ loadExternalAssets: boolean;
83
+ debug: boolean;
84
+ theme: string;
85
+ get value(): any;
86
+ set value(value: any);
87
+ onChanges: EventEmitter<any>;
88
+ onSubmit: EventEmitter<any>;
89
+ isValid: EventEmitter<boolean>;
90
+ validationErrors: EventEmitter<any>;
91
+ formSchema: EventEmitter<any>;
92
+ formLayout: EventEmitter<any>;
93
+ dataChange: EventEmitter<any>;
94
+ modelChange: EventEmitter<any>;
95
+ formDataChange: EventEmitter<any>;
96
+ ngModelChange: EventEmitter<any>;
97
+ onChange: Function;
98
+ onTouched: Function;
99
+ dataChangesSubs: Subscription;
100
+ statusChangesSubs: Subscription;
101
+ isValidChangesSubs: Subscription;
102
+ validationErrorChangesSubs: Subscription;
103
+ constructor(changeDetector: ChangeDetectorRef, frameworkLibrary: FrameworkLibraryService, widgetLibrary: WidgetLibraryService, jsf: JsonSchemaFormService);
104
+ ngOnDestroy(): void;
105
+ private resetScriptsAndStyleSheets;
106
+ private loadScripts;
107
+ private loadStyleSheets;
108
+ private loadAssets;
109
+ ngOnInit(): void;
110
+ ngOnChanges(changes: SimpleChanges): void;
111
+ writeValue(value: any): void;
112
+ registerOnChange(fn: Function): void;
113
+ registerOnTouched(fn: Function): void;
114
+ setDisabledState(isDisabled: boolean): void;
115
+ updateForm(): void;
116
+ setFormValues(formValues: any, resetFirst?: boolean): void;
117
+ submitForm(): void;
118
+ /**
119
+ * 'initializeForm' function
120
+ *
121
+ * - Update 'schema', 'layout', and 'formValues', from inputs.
122
+ *
123
+ * - Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'
124
+ * to resolve schema $ref links, including recursive $ref links.
125
+ *
126
+ * - Create 'dataRecursiveRefMap' to resolve recursive links in data
127
+ * and corectly set output formats for recursively nested values.
128
+ *
129
+ * - Create 'layoutRefLibrary' and 'templateRefLibrary' to store
130
+ * new layout nodes and formGroup elements to use when dynamically
131
+ * adding form components to arrays and recursive $ref points.
132
+ *
133
+ * - Create 'dataMap' to map the data to the schema and template.
134
+ *
135
+ * - Create the master 'formGroupTemplate' then from it 'formGroup'
136
+ * the Angular formGroup used to control the reactive form.
137
+ */
138
+ initializeForm(initialData?: any): void;
139
+ /**
140
+ * 'initializeOptions' function
141
+ *
142
+ * Initialize 'options' (global form options) and set framework
143
+ * Combine available inputs:
144
+ * 1. options - recommended
145
+ * 2. form.options - Single input style
146
+ */
147
+ private initializeOptions;
148
+ /**
149
+ * 'initializeSchema' function
150
+ *
151
+ * Initialize 'schema'
152
+ * Use first available input:
153
+ * 1. schema - recommended / Angular Schema Form style
154
+ * 2. form.schema - Single input / JSON Form style
155
+ * 3. JSONSchema - React JSON Schema Form style
156
+ * 4. form.JSONSchema - For testing single input React JSON Schema Forms
157
+ * 5. form - For testing single schema-only inputs
158
+ *
159
+ * ... if no schema input found, the 'activateForm' function, below,
160
+ * will make two additional attempts to build a schema
161
+ * 6. If layout input - build schema from layout
162
+ * 7. If data input - build schema from data
163
+ */
164
+ private initializeSchema;
165
+ /**
166
+ * 'initializeData' function
167
+ *
168
+ * Initialize 'formValues'
169
+ * defulat or previously submitted values used to populate form
170
+ * Use first available input:
171
+ * 1. data - recommended
172
+ * 2. model - Angular Schema Form style
173
+ * 3. form.value - JSON Form style
174
+ * 4. form.data - Single input style
175
+ * 5. formData - React JSON Schema Form style
176
+ * 6. form.formData - For easier testing of React JSON Schema Forms
177
+ * 7. (none) no data - initialize data from schema and layout defaults only
178
+ */
179
+ private initializeData;
180
+ /**
181
+ * 'initializeLayout' function
182
+ *
183
+ * Initialize 'layout'
184
+ * Use first available array input:
185
+ * 1. layout - recommended
186
+ * 2. form - Angular Schema Form style
187
+ * 3. form.form - JSON Form style
188
+ * 4. form.layout - Single input style
189
+ * 5. (none) no layout - set default layout instead
190
+ * (full layout will be built later from the schema)
191
+ *
192
+ * Also, if alternate layout formats are available,
193
+ * import from 'UISchema' or 'customFormItems'
194
+ * used for React JSON Schema Form and JSON Form API compatibility
195
+ * Use first available input:
196
+ * 1. UISchema - React JSON Schema Form style
197
+ * 2. form.UISchema - For testing single input React JSON Schema Forms
198
+ * 2. form.customFormItems - JSON Form style
199
+ * 3. (none) no input - don't import
200
+ */
201
+ private initializeLayout;
202
+ /**
203
+ * 'activateForm' function
204
+ *
205
+ * ...continued from 'initializeSchema' function, above
206
+ * If 'schema' has not been initialized (i.e. no schema input found)
207
+ * 6. If layout input - build schema from layout input
208
+ * 7. If data input - build schema from data input
209
+ *
210
+ * Create final layout,
211
+ * build the FormGroup template and the Angular FormGroup,
212
+ * subscribe to changes,
213
+ * and activate the form.
214
+ */
215
+ private activateForm;
216
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonSchemaFormComponent, never>;
217
+ static ɵcmp: i0.ɵɵComponentDeclaration<JsonSchemaFormComponent, "json-schema-form", never, { "schema": { "alias": "schema"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "data": { "alias": "data"; "required": false; }; "options": { "alias": "options"; "required": false; }; "framework": { "alias": "framework"; "required": false; }; "widgets": { "alias": "widgets"; "required": false; }; "form": { "alias": "form"; "required": false; }; "model": { "alias": "model"; "required": false; }; "JSONSchema": { "alias": "JSONSchema"; "required": false; }; "UISchema": { "alias": "UISchema"; "required": false; }; "formData": { "alias": "formData"; "required": false; }; "ngModel": { "alias": "ngModel"; "required": false; }; "language": { "alias": "language"; "required": false; }; "loadExternalAssets": { "alias": "loadExternalAssets"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "onChanges": "onChanges"; "onSubmit": "onSubmit"; "isValid": "isValid"; "validationErrors": "validationErrors"; "formSchema": "formSchema"; "formLayout": "formLayout"; "dataChange": "dataChange"; "modelChange": "modelChange"; "formDataChange": "formDataChange"; "ngModelChange": "ngModelChange"; }, never, never, false, never>;
218
+ }