@ng-formworks/core 19.6.3 → 20.6.4
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/README.md +2 -1
- package/fesm2022/ng-formworks-core.mjs +209 -209
- package/fesm2022/ng-formworks-core.mjs.map +1 -1
- package/index.d.ts +2772 -3
- package/package.json +11 -6
- package/lib/framework-library/framework-library.service.d.ts +0 -53
- package/lib/framework-library/framework.d.ts +0 -13
- package/lib/framework-library/no-framework.component.d.ts +0 -8
- package/lib/framework-library/no-framework.module.d.ts +0 -9
- package/lib/framework-library/no.framework.d.ts +0 -10
- package/lib/json-schema-form.component.d.ts +0 -225
- package/lib/json-schema-form.module.d.ts +0 -11
- package/lib/json-schema-form.service.d.ts +0 -150
- package/lib/locale/de-validation-messages.d.ts +0 -1
- package/lib/locale/en-validation-messages.d.ts +0 -1
- package/lib/locale/es-validation-messages.d.ts +0 -1
- package/lib/locale/fr-validation-messages.d.ts +0 -1
- package/lib/locale/index.d.ts +0 -7
- package/lib/locale/it-validation-messages.d.ts +0 -1
- package/lib/locale/pt-validation-messages.d.ts +0 -1
- package/lib/locale/zh-validation-messages.d.ts +0 -1
- package/lib/shared/convert-schema-to-draft6.function.d.ts +0 -21
- package/lib/shared/form-group.functions.d.ts +0 -128
- package/lib/shared/format-regex.constants.d.ts +0 -20
- package/lib/shared/index.d.ts +0 -9
- package/lib/shared/json-schema.functions.d.ts +0 -214
- package/lib/shared/json.validators.d.ts +0 -441
- package/lib/shared/jsonpointer.functions.d.ts +0 -416
- package/lib/shared/layout.functions.d.ts +0 -83
- package/lib/shared/merge-schemas.function.d.ts +0 -19
- package/lib/shared/utility.functions.d.ts +0 -180
- package/lib/shared/validator.functions.d.ts +0 -364
- package/lib/widget-library/add-reference.component.d.ts +0 -18
- package/lib/widget-library/button.component.d.ts +0 -20
- package/lib/widget-library/checkbox.component.d.ts +0 -23
- package/lib/widget-library/checkboxes.component.d.ts +0 -24
- package/lib/widget-library/element-attribute.directive.d.ts +0 -13
- package/lib/widget-library/file.component.d.ts +0 -20
- package/lib/widget-library/hidden.component.d.ts +0 -18
- package/lib/widget-library/index.d.ts +0 -29
- package/lib/widget-library/input.component.d.ts +0 -22
- package/lib/widget-library/message.component.d.ts +0 -13
- package/lib/widget-library/none.component.d.ts +0 -8
- package/lib/widget-library/number.component.d.ts +0 -27
- package/lib/widget-library/one-of.component.d.ts +0 -21
- package/lib/widget-library/orderable.directive.d.ts +0 -41
- package/lib/widget-library/radios.component.d.ts +0 -22
- package/lib/widget-library/root.component.d.ts +0 -23
- package/lib/widget-library/section.component.d.ts +0 -17
- package/lib/widget-library/select-framework.component.d.ts +0 -15
- package/lib/widget-library/select-widget.component.d.ts +0 -15
- package/lib/widget-library/select.component.d.ts +0 -25
- package/lib/widget-library/selectcheckbox.component.d.ts +0 -55
- package/lib/widget-library/submit.component.d.ts +0 -22
- package/lib/widget-library/tab.component.d.ts +0 -12
- package/lib/widget-library/tabs.component.d.ts +0 -18
- package/lib/widget-library/template.component.d.ts +0 -15
- package/lib/widget-library/textarea.component.d.ts +0 -20
- package/lib/widget-library/widget-library.module.d.ts +0 -34
- package/lib/widget-library/widget-library.service.d.ts +0 -22
- package/public_api.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-formworks/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.6.4",
|
|
4
4
|
"description": "Angular ng-formworks - JSON Schema Form builder core",
|
|
5
5
|
"author": "https://github.com/zahmo/ng-formworks/graphs/contributors",
|
|
6
6
|
"keywords": [
|
|
@@ -12,13 +12,18 @@
|
|
|
12
12
|
"Angular 16",
|
|
13
13
|
"Angular17",
|
|
14
14
|
"Angular 17",
|
|
15
|
+
"Angular18",
|
|
15
16
|
"Angular 18",
|
|
17
|
+
"Angular19",
|
|
16
18
|
"Angular 19",
|
|
19
|
+
"Angular20",
|
|
20
|
+
"Angular 20",
|
|
17
21
|
"ng15",
|
|
18
22
|
"ng16",
|
|
19
23
|
"ng17",
|
|
20
24
|
"ng18",
|
|
21
25
|
"ng19",
|
|
26
|
+
"ng20",
|
|
22
27
|
"JSON Schema",
|
|
23
28
|
"form",
|
|
24
29
|
"forms",
|
|
@@ -44,14 +49,14 @@
|
|
|
44
49
|
"lodash-es": "~4.17.21",
|
|
45
50
|
"ajv": "^8.12.0",
|
|
46
51
|
"tslib": "^2.7.0",
|
|
47
|
-
"nxt-sortablejs": "^
|
|
52
|
+
"nxt-sortablejs": "^20.0.0",
|
|
48
53
|
"sortablejs": "^1.15.6"
|
|
49
54
|
},
|
|
50
55
|
"peerDependencies": {
|
|
51
|
-
"@angular/common": ">=
|
|
52
|
-
"@angular/core": ">=
|
|
53
|
-
"@angular/forms": ">=
|
|
54
|
-
"@angular/platform-browser": ">=
|
|
56
|
+
"@angular/common": ">=20.0.0",
|
|
57
|
+
"@angular/core": ">=20.0.0",
|
|
58
|
+
"@angular/forms": ">=20.0.0",
|
|
59
|
+
"@angular/platform-browser": ">=20.0.0",
|
|
55
60
|
"rxjs": "^7.0.0"
|
|
56
61
|
},
|
|
57
62
|
"module": "fesm2022/ng-formworks-core.mjs",
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
|
-
import { Framework } from './framework';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class FrameworkLibraryService {
|
|
5
|
-
private frameworks;
|
|
6
|
-
private widgetLibrary;
|
|
7
|
-
private http;
|
|
8
|
-
activeFramework: Framework;
|
|
9
|
-
stylesheets: (HTMLStyleElement | HTMLLinkElement)[];
|
|
10
|
-
scripts: HTMLScriptElement[];
|
|
11
|
-
loadExternalAssets: boolean;
|
|
12
|
-
defaultFramework: string;
|
|
13
|
-
frameworkLibrary: {
|
|
14
|
-
[name: string]: Framework;
|
|
15
|
-
};
|
|
16
|
-
activeFrameworkName$: Observable<string>;
|
|
17
|
-
private activeFrameworkNameSubject;
|
|
18
|
-
private activeFrameworkName;
|
|
19
|
-
constructor(frameworks: any[]);
|
|
20
|
-
setLoadExternalAssets(loadExternalAssets?: boolean): void;
|
|
21
|
-
setFramework(framework?: string | Framework, loadExternalAssets?: boolean): boolean;
|
|
22
|
-
registerFrameworkWidgets(framework: Framework): boolean;
|
|
23
|
-
hasFramework(type: string): boolean;
|
|
24
|
-
getFramework(): any;
|
|
25
|
-
getFrameworkList(): {
|
|
26
|
-
name: string;
|
|
27
|
-
text: string;
|
|
28
|
-
}[];
|
|
29
|
-
getFrameworkWidgets(): any;
|
|
30
|
-
getFrameworkStylesheets(load?: boolean): string[];
|
|
31
|
-
getFrameworkScripts(load?: boolean): string[];
|
|
32
|
-
getFrameworkConfig(existingFramework?: any): any;
|
|
33
|
-
getFrameworkAssetConfig(existingFramework?: any, useAssetRelPath?: boolean): Promise<{
|
|
34
|
-
stylesheets: string[];
|
|
35
|
-
scripts: string[];
|
|
36
|
-
}>;
|
|
37
|
-
getFrameworkThemes(): {
|
|
38
|
-
name: string;
|
|
39
|
-
text: string;
|
|
40
|
-
}[];
|
|
41
|
-
requestThemeChange(name: string, validateThemeExists?: boolean, existingFramework?: any): boolean;
|
|
42
|
-
getActiveTheme(existingFramework?: any): {
|
|
43
|
-
name: string;
|
|
44
|
-
text: string;
|
|
45
|
-
};
|
|
46
|
-
registerTheme(newTheme: {
|
|
47
|
-
name: string;
|
|
48
|
-
text: string;
|
|
49
|
-
}, existingFramework?: any): boolean;
|
|
50
|
-
unregisterTheme(name: string, existingFramework?: any): boolean;
|
|
51
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FrameworkLibraryService, never>;
|
|
52
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<FrameworkLibraryService>;
|
|
53
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class NoFrameworkComponent {
|
|
3
|
-
readonly layoutNode: import("@angular/core").InputSignal<any>;
|
|
4
|
-
readonly layoutIndex: import("@angular/core").InputSignal<number[]>;
|
|
5
|
-
readonly dataIndex: import("@angular/core").InputSignal<number[]>;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NoFrameworkComponent, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NoFrameworkComponent, "no-framework", never, { "layoutNode": { "alias": "layoutNode"; "required": false; "isSignal": true; }; "layoutIndex": { "alias": "layoutIndex"; "required": false; "isSignal": true; }; "dataIndex": { "alias": "dataIndex"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,225 +0,0 @@
|
|
|
1
|
-
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
import { Subscription } from 'rxjs';
|
|
4
|
-
import { JsonSchemaFormService } from './json-schema-form.service';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare const JSON_SCHEMA_FORM_VALUE_ACCESSOR: any;
|
|
7
|
-
/**
|
|
8
|
-
* @module 'JsonSchemaFormComponent' - Angular JSON Schema Form
|
|
9
|
-
*
|
|
10
|
-
* Root module of the Angular JSON Schema Form client-side library,
|
|
11
|
-
* an Angular library which generates an HTML form from a JSON schema
|
|
12
|
-
* structured data model and/or a JSON Schema Form layout description.
|
|
13
|
-
*
|
|
14
|
-
* This library also validates input data by the user, using both validators on
|
|
15
|
-
* individual controls to provide real-time feedback while the user is filling
|
|
16
|
-
* out the form, and then validating the entire input against the schema when
|
|
17
|
-
* the form is submitted to make sure the returned JSON data object is valid.
|
|
18
|
-
*
|
|
19
|
-
* This library is similar to, and mostly API compatible with:
|
|
20
|
-
*
|
|
21
|
-
* - JSON Schema Form's Angular Schema Form library for AngularJs
|
|
22
|
-
* http://schemaform.io
|
|
23
|
-
* http://schemaform.io/examples/bootstrap-example.html (examples)
|
|
24
|
-
*
|
|
25
|
-
* - Mozilla's react-jsonschema-form library for React
|
|
26
|
-
* https://github.com/mozilla-services/react-jsonschema-form
|
|
27
|
-
* https://mozilla-services.github.io/react-jsonschema-form (examples)
|
|
28
|
-
*
|
|
29
|
-
* - Joshfire's JSON Form library for jQuery
|
|
30
|
-
* https://github.com/joshfire/jsonform
|
|
31
|
-
* http://ulion.github.io/jsonform/playground (examples)
|
|
32
|
-
*
|
|
33
|
-
* This library depends on:
|
|
34
|
-
* - Angular (obviously) https://angular.io
|
|
35
|
-
* - lodash, JavaScript utility library https://github.com/lodash/lodash
|
|
36
|
-
* - ajv, Another JSON Schema validator https://github.com/epoberezkin/ajv
|
|
37
|
-
*
|
|
38
|
-
* In addition, the Example Playground also depends on:
|
|
39
|
-
* - brace, Browserified Ace editor http://thlorenz.github.io/brace
|
|
40
|
-
*/
|
|
41
|
-
export declare class JsonSchemaFormComponent implements ControlValueAccessor, OnChanges, OnInit, OnDestroy {
|
|
42
|
-
private changeDetector;
|
|
43
|
-
private frameworkLibrary;
|
|
44
|
-
private widgetLibrary;
|
|
45
|
-
jsf: JsonSchemaFormService;
|
|
46
|
-
private unsubscribeOnActivateForm$;
|
|
47
|
-
debugOutput: any;
|
|
48
|
-
formValueSubscription: any;
|
|
49
|
-
formInitialized: boolean;
|
|
50
|
-
objectWrap: boolean;
|
|
51
|
-
formValuesInput: string;
|
|
52
|
-
previousInputs: {
|
|
53
|
-
schema: any;
|
|
54
|
-
layout: any[];
|
|
55
|
-
data: any;
|
|
56
|
-
options: any;
|
|
57
|
-
framework: any | string;
|
|
58
|
-
widgets: any;
|
|
59
|
-
form: any;
|
|
60
|
-
model: any;
|
|
61
|
-
JSONSchema: any;
|
|
62
|
-
UISchema: any;
|
|
63
|
-
formData: any;
|
|
64
|
-
loadExternalAssets: boolean;
|
|
65
|
-
debug: boolean;
|
|
66
|
-
ajvOptions: any;
|
|
67
|
-
};
|
|
68
|
-
readonly schema: import("@angular/core").InputSignal<any>;
|
|
69
|
-
readonly layout: import("@angular/core").InputSignal<any[]>;
|
|
70
|
-
readonly data: import("@angular/core").InputSignal<any>;
|
|
71
|
-
readonly options: import("@angular/core").InputSignal<any>;
|
|
72
|
-
readonly framework: import("@angular/core").InputSignal<any>;
|
|
73
|
-
readonly widgets: import("@angular/core").InputSignal<any>;
|
|
74
|
-
readonly form: import("@angular/core").InputSignal<any>;
|
|
75
|
-
readonly model: import("@angular/core").InputSignal<any>;
|
|
76
|
-
readonly JSONSchema: import("@angular/core").InputSignal<any>;
|
|
77
|
-
readonly UISchema: import("@angular/core").InputSignal<any>;
|
|
78
|
-
readonly formData: import("@angular/core").InputSignal<any>;
|
|
79
|
-
readonly ngModel: import("@angular/core").InputSignal<any>;
|
|
80
|
-
readonly language: import("@angular/core").InputSignal<string>;
|
|
81
|
-
readonly loadExternalAssets: import("@angular/core").InputSignal<boolean>;
|
|
82
|
-
readonly debug: import("@angular/core").InputSignal<boolean>;
|
|
83
|
-
readonly theme: import("@angular/core").InputSignal<string>;
|
|
84
|
-
readonly ajvOptions: import("@angular/core").InputSignal<any>;
|
|
85
|
-
private ajvInstanceName;
|
|
86
|
-
get value(): any;
|
|
87
|
-
set value(value: any);
|
|
88
|
-
readonly onChanges: import("@angular/core").OutputEmitterRef<any>;
|
|
89
|
-
readonly onSubmit: import("@angular/core").OutputEmitterRef<any>;
|
|
90
|
-
readonly isValid: import("@angular/core").OutputEmitterRef<boolean>;
|
|
91
|
-
readonly validationErrors: import("@angular/core").OutputEmitterRef<any>;
|
|
92
|
-
readonly formSchema: import("@angular/core").OutputEmitterRef<any>;
|
|
93
|
-
readonly formLayout: import("@angular/core").OutputEmitterRef<any>;
|
|
94
|
-
readonly dataChange: import("@angular/core").OutputEmitterRef<any>;
|
|
95
|
-
readonly modelChange: import("@angular/core").OutputEmitterRef<any>;
|
|
96
|
-
readonly formDataChange: import("@angular/core").OutputEmitterRef<any>;
|
|
97
|
-
readonly ngModelChange: import("@angular/core").OutputEmitterRef<any>;
|
|
98
|
-
onChange: Function;
|
|
99
|
-
onTouched: Function;
|
|
100
|
-
dataChangesSubs: Subscription;
|
|
101
|
-
statusChangesSubs: Subscription;
|
|
102
|
-
isValidChangesSubs: Subscription;
|
|
103
|
-
validationErrorChangesSubs: Subscription;
|
|
104
|
-
ngOnDestroy(): void;
|
|
105
|
-
private getInputValue;
|
|
106
|
-
private resetScriptsAndStyleSheets;
|
|
107
|
-
private loadScripts;
|
|
108
|
-
private loadStyleSheets;
|
|
109
|
-
private loadAssets;
|
|
110
|
-
ngOnInit(): void;
|
|
111
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
112
|
-
writeValue(value: any): void;
|
|
113
|
-
registerOnChange(fn: Function): void;
|
|
114
|
-
registerOnTouched(fn: Function): void;
|
|
115
|
-
setDisabledState(isDisabled: boolean): void;
|
|
116
|
-
updateForm(): void;
|
|
117
|
-
setFormValues(formValues: any, resetFirst?: boolean): void;
|
|
118
|
-
submitForm(): void;
|
|
119
|
-
/**
|
|
120
|
-
* 'initializeForm' function
|
|
121
|
-
*
|
|
122
|
-
* - Update 'schema', 'layout', and 'formValues', from inputs.
|
|
123
|
-
*
|
|
124
|
-
* - Create 'schemaRefLibrary' and 'schemaRecursiveRefMap'
|
|
125
|
-
* to resolve schema $ref links, including recursive $ref links.
|
|
126
|
-
*
|
|
127
|
-
* - Create 'dataRecursiveRefMap' to resolve recursive links in data
|
|
128
|
-
* and corectly set output formats for recursively nested values.
|
|
129
|
-
*
|
|
130
|
-
* - Create 'layoutRefLibrary' and 'templateRefLibrary' to store
|
|
131
|
-
* new layout nodes and formGroup elements to use when dynamically
|
|
132
|
-
* adding form components to arrays and recursive $ref points.
|
|
133
|
-
*
|
|
134
|
-
* - Create 'dataMap' to map the data to the schema and template.
|
|
135
|
-
*
|
|
136
|
-
* - Create the master 'formGroupTemplate' then from it 'formGroup'
|
|
137
|
-
* the Angular formGroup used to control the reactive form.
|
|
138
|
-
*/
|
|
139
|
-
initializeForm(initialData?: any): void;
|
|
140
|
-
/**
|
|
141
|
-
* 'initializeAjv' function
|
|
142
|
-
*
|
|
143
|
-
* Initialize ajv from 'ajvOptions'
|
|
144
|
-
*/
|
|
145
|
-
private initializeAjv;
|
|
146
|
-
/**
|
|
147
|
-
* 'initializeOptions' function
|
|
148
|
-
*
|
|
149
|
-
* Initialize 'options' (global form options) and set framework
|
|
150
|
-
* Combine available inputs:
|
|
151
|
-
* 1. options - recommended
|
|
152
|
-
* 2. form.options - Single input style
|
|
153
|
-
*/
|
|
154
|
-
private initializeOptions;
|
|
155
|
-
/**
|
|
156
|
-
* 'initializeSchema' function
|
|
157
|
-
*
|
|
158
|
-
* Initialize 'schema'
|
|
159
|
-
* Use first available input:
|
|
160
|
-
* 1. schema - recommended / Angular Schema Form style
|
|
161
|
-
* 2. form.schema - Single input / JSON Form style
|
|
162
|
-
* 3. JSONSchema - React JSON Schema Form style
|
|
163
|
-
* 4. form.JSONSchema - For testing single input React JSON Schema Forms
|
|
164
|
-
* 5. form - For testing single schema-only inputs
|
|
165
|
-
*
|
|
166
|
-
* ... if no schema input found, the 'activateForm' function, below,
|
|
167
|
-
* will make two additional attempts to build a schema
|
|
168
|
-
* 6. If layout input - build schema from layout
|
|
169
|
-
* 7. If data input - build schema from data
|
|
170
|
-
*/
|
|
171
|
-
private initializeSchema;
|
|
172
|
-
/**
|
|
173
|
-
* 'initializeData' function
|
|
174
|
-
*
|
|
175
|
-
* Initialize 'formValues'
|
|
176
|
-
* defulat or previously submitted values used to populate form
|
|
177
|
-
* Use first available input:
|
|
178
|
-
* 1. data - recommended
|
|
179
|
-
* 2. model - Angular Schema Form style
|
|
180
|
-
* 3. form.value - JSON Form style
|
|
181
|
-
* 4. form.data - Single input style
|
|
182
|
-
* 5. formData - React JSON Schema Form style
|
|
183
|
-
* 6. form.formData - For easier testing of React JSON Schema Forms
|
|
184
|
-
* 7. (none) no data - initialize data from schema and layout defaults only
|
|
185
|
-
*/
|
|
186
|
-
private initializeData;
|
|
187
|
-
/**
|
|
188
|
-
* 'initializeLayout' function
|
|
189
|
-
*
|
|
190
|
-
* Initialize 'layout'
|
|
191
|
-
* Use first available array input:
|
|
192
|
-
* 1. layout - recommended
|
|
193
|
-
* 2. form - Angular Schema Form style
|
|
194
|
-
* 3. form.form - JSON Form style
|
|
195
|
-
* 4. form.layout - Single input style
|
|
196
|
-
* 5. (none) no layout - set default layout instead
|
|
197
|
-
* (full layout will be built later from the schema)
|
|
198
|
-
*
|
|
199
|
-
* Also, if alternate layout formats are available,
|
|
200
|
-
* import from 'UISchema' or 'customFormItems'
|
|
201
|
-
* used for React JSON Schema Form and JSON Form API compatibility
|
|
202
|
-
* Use first available input:
|
|
203
|
-
* 1. UISchema - React JSON Schema Form style
|
|
204
|
-
* 2. form.UISchema - For testing single input React JSON Schema Forms
|
|
205
|
-
* 2. form.customFormItems - JSON Form style
|
|
206
|
-
* 3. (none) no input - don't import
|
|
207
|
-
*/
|
|
208
|
-
private initializeLayout;
|
|
209
|
-
/**
|
|
210
|
-
* 'activateForm' function
|
|
211
|
-
*
|
|
212
|
-
* ...continued from 'initializeSchema' function, above
|
|
213
|
-
* If 'schema' has not been initialized (i.e. no schema input found)
|
|
214
|
-
* 6. If layout input - build schema from layout input
|
|
215
|
-
* 7. If data input - build schema from data input
|
|
216
|
-
*
|
|
217
|
-
* Create final layout,
|
|
218
|
-
* build the FormGroup template and the Angular FormGroup,
|
|
219
|
-
* subscribe to changes,
|
|
220
|
-
* and activate the form.
|
|
221
|
-
*/
|
|
222
|
-
private activateForm;
|
|
223
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<JsonSchemaFormComponent, never>;
|
|
224
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<JsonSchemaFormComponent, "json-schema-form", never, { "schema": { "alias": "schema"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "framework": { "alias": "framework"; "required": false; "isSignal": true; }; "widgets": { "alias": "widgets"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "model": { "alias": "model"; "required": false; "isSignal": true; }; "JSONSchema": { "alias": "JSONSchema"; "required": false; "isSignal": true; }; "UISchema": { "alias": "UISchema"; "required": false; "isSignal": true; }; "formData": { "alias": "formData"; "required": false; "isSignal": true; }; "ngModel": { "alias": "ngModel"; "required": false; "isSignal": true; }; "language": { "alias": "language"; "required": false; "isSignal": true; }; "loadExternalAssets": { "alias": "loadExternalAssets"; "required": false; "isSignal": true; }; "debug": { "alias": "debug"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; "ajvOptions": { "alias": "ajvOptions"; "required": false; "isSignal": true; }; "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>;
|
|
225
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./json-schema-form.component";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
import * as i3 from "@angular/forms";
|
|
5
|
-
import * as i4 from "./widget-library/widget-library.module";
|
|
6
|
-
import * as i5 from "./framework-library/no-framework.module";
|
|
7
|
-
export declare class JsonSchemaFormModule {
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<JsonSchemaFormModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<JsonSchemaFormModule, [typeof i1.JsonSchemaFormComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.WidgetLibraryModule, typeof i5.NoFrameworkModule], [typeof i1.JsonSchemaFormComponent, typeof i4.WidgetLibraryModule]>;
|
|
10
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<JsonSchemaFormModule>;
|
|
11
|
-
}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, Signal } from '@angular/core';
|
|
2
|
-
import { AbstractControl, UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
|
3
|
-
import Ajv2019, { ErrorObject, Options, ValidateFunction } from 'ajv/dist/2019';
|
|
4
|
-
import { Subject, Subscription } from 'rxjs';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export type WidgetContext = {
|
|
7
|
-
formControl?: AbstractControl;
|
|
8
|
-
layoutNode?: Signal<any>;
|
|
9
|
-
layoutIndex?: Signal<number[]>;
|
|
10
|
-
dataIndex?: Signal<number[]>;
|
|
11
|
-
options?: any;
|
|
12
|
-
controlValue?: any;
|
|
13
|
-
boundControl?: boolean;
|
|
14
|
-
controlName?: string;
|
|
15
|
-
controlDisabled?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type AJVRegistryItem = {
|
|
18
|
-
[name: string]: {
|
|
19
|
-
name: string;
|
|
20
|
-
ajvInstance: Ajv2019;
|
|
21
|
-
ajvValidator: ValidateFunction;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export interface TitleMapItem {
|
|
25
|
-
name?: string;
|
|
26
|
-
value?: any;
|
|
27
|
-
checked?: boolean;
|
|
28
|
-
group?: string;
|
|
29
|
-
items?: TitleMapItem[];
|
|
30
|
-
}
|
|
31
|
-
export interface ErrorMessages {
|
|
32
|
-
[control_name: string]: {
|
|
33
|
-
message: string | Function | Object;
|
|
34
|
-
code: string;
|
|
35
|
-
}[];
|
|
36
|
-
}
|
|
37
|
-
export declare class JsonSchemaFormService implements OnDestroy {
|
|
38
|
-
JsonFormCompatibility: boolean;
|
|
39
|
-
ReactJsonSchemaFormCompatibility: boolean;
|
|
40
|
-
AngularSchemaFormCompatibility: boolean;
|
|
41
|
-
tpldata: any;
|
|
42
|
-
ajvOptions: Options;
|
|
43
|
-
ajv: any;
|
|
44
|
-
validateFormData: any;
|
|
45
|
-
formValues: any;
|
|
46
|
-
data: any;
|
|
47
|
-
schema: any;
|
|
48
|
-
layout: any[];
|
|
49
|
-
formGroupTemplate: any;
|
|
50
|
-
formGroup: any;
|
|
51
|
-
framework: any;
|
|
52
|
-
formOptions: any;
|
|
53
|
-
validData: any;
|
|
54
|
-
isValid: boolean;
|
|
55
|
-
ajvErrors: ErrorObject[];
|
|
56
|
-
validationErrors: any;
|
|
57
|
-
dataErrors: any;
|
|
58
|
-
formValueSubscription: any;
|
|
59
|
-
dataChanges: Subject<any>;
|
|
60
|
-
isValidChanges: Subject<any>;
|
|
61
|
-
validationErrorChanges: Subject<any>;
|
|
62
|
-
arrayMap: Map<string, number>;
|
|
63
|
-
dataMap: Map<string, any>;
|
|
64
|
-
dataRecursiveRefMap: Map<string, string>;
|
|
65
|
-
schemaRecursiveRefMap: Map<string, string>;
|
|
66
|
-
schemaRefLibrary: any;
|
|
67
|
-
layoutRefLibrary: any;
|
|
68
|
-
templateRefLibrary: any;
|
|
69
|
-
hasRootReference: boolean;
|
|
70
|
-
language: string;
|
|
71
|
-
defaultFormOptions: any;
|
|
72
|
-
fcValueChangesSubs: Subscription;
|
|
73
|
-
fcStatusChangesSubs: Subscription;
|
|
74
|
-
private draggableStateSubject;
|
|
75
|
-
draggableState$: import("rxjs").Observable<boolean>;
|
|
76
|
-
setDraggableState(value: boolean): void;
|
|
77
|
-
private sortableOptionsSubject;
|
|
78
|
-
sortableOptions$: import("rxjs").Observable<any>;
|
|
79
|
-
setSortableOptions(value: any): void;
|
|
80
|
-
createAjvInstance(ajvOptions: any): Ajv2019;
|
|
81
|
-
createAndRegisterAjvInstance(ajvOptions: any, name?: string): {
|
|
82
|
-
name: string;
|
|
83
|
-
ajvInstance: Ajv2019;
|
|
84
|
-
ajvValidator: ValidateFunction;
|
|
85
|
-
};
|
|
86
|
-
ajvRegistry: AJVRegistryItem;
|
|
87
|
-
getAjvInstance(name?: string): Ajv2019;
|
|
88
|
-
getAjvValidator(name?: string): ValidateFunction<unknown>;
|
|
89
|
-
constructor();
|
|
90
|
-
ngOnDestroy(): void;
|
|
91
|
-
setLanguage(language?: string): void;
|
|
92
|
-
getData(): any;
|
|
93
|
-
getSchema(): any;
|
|
94
|
-
getLayout(): any[];
|
|
95
|
-
resetAllValues(): void;
|
|
96
|
-
/**
|
|
97
|
-
* 'buildRemoteError' function
|
|
98
|
-
*
|
|
99
|
-
* Example errors:
|
|
100
|
-
* {
|
|
101
|
-
* last_name: [ {
|
|
102
|
-
* message: 'Last name must by start with capital letter.',
|
|
103
|
-
* code: 'capital_letter'
|
|
104
|
-
* } ],
|
|
105
|
-
* email: [ {
|
|
106
|
-
* message: 'Email must be from example.com domain.',
|
|
107
|
-
* code: 'special_domain'
|
|
108
|
-
* }, {
|
|
109
|
-
* message: 'Email must contain an @ symbol.',
|
|
110
|
-
* code: 'at_symbol'
|
|
111
|
-
* } ]
|
|
112
|
-
* }
|
|
113
|
-
* //{ErrorMessages} errors
|
|
114
|
-
*/
|
|
115
|
-
buildRemoteError(errors: ErrorMessages): void;
|
|
116
|
-
validateData(newValue: any, updateSubscriptions?: boolean, ajvInstanceName?: string): void;
|
|
117
|
-
buildFormGroupTemplate(formValues?: any, setValues?: boolean): void;
|
|
118
|
-
buildFormGroup(ajvInstanceName?: string): void;
|
|
119
|
-
buildLayout(widgetLibrary: any): void;
|
|
120
|
-
setOptions(newOptions: any): void;
|
|
121
|
-
compileAjvSchema(ajvInstanceName?: string): void;
|
|
122
|
-
buildSchemaFromData(data?: any, requireAllFields?: boolean): any;
|
|
123
|
-
buildSchemaFromLayout(layout?: any): any;
|
|
124
|
-
setTpldata(newTpldata?: any): void;
|
|
125
|
-
parseText(text?: string, value?: any, values?: any, key?: number | string): string;
|
|
126
|
-
parseExpression(expression?: string, value?: any, values?: any, key?: number | string, tpldata?: any): any;
|
|
127
|
-
setArrayItemTitle(parentCtx?: any, childNode?: any, index?: number): string;
|
|
128
|
-
setItemTitle(ctx: WidgetContext): string;
|
|
129
|
-
evaluateCondition(layoutNode: any, dataIndex: number[]): boolean;
|
|
130
|
-
initializeControl(ctx: WidgetContext, bind?: boolean): boolean;
|
|
131
|
-
formatErrors(errors: any, validationMessages?: any): string;
|
|
132
|
-
updateValue(ctx: WidgetContext, value: any): void;
|
|
133
|
-
updateArrayCheckboxList(ctx: WidgetContext, checkboxList: TitleMapItem[]): void;
|
|
134
|
-
updateArrayMultiSelectList(ctx: WidgetContext, selectList: TitleMapItem[]): void;
|
|
135
|
-
getFormControl(ctx: WidgetContext): AbstractControl;
|
|
136
|
-
setFormControl(ctx: WidgetContext, control: AbstractControl): AbstractControl;
|
|
137
|
-
getFormControlValue(ctx: WidgetContext): AbstractControl;
|
|
138
|
-
getFormControlGroup(ctx: WidgetContext): UntypedFormArray | UntypedFormGroup;
|
|
139
|
-
getFormControlName(ctx: WidgetContext): string;
|
|
140
|
-
getLayoutArray(ctx: WidgetContext): any[];
|
|
141
|
-
getParentNode(ctx: WidgetContext): any;
|
|
142
|
-
getDataPointer(ctx: WidgetContext): string;
|
|
143
|
-
getLayoutPointer(ctx: WidgetContext): string;
|
|
144
|
-
isControlBound(ctx: WidgetContext): boolean;
|
|
145
|
-
addItem(ctx: WidgetContext, name?: string): boolean;
|
|
146
|
-
moveArrayItem(ctx: WidgetContext, oldIndex: number, newIndex: number, moveLayout?: boolean): boolean;
|
|
147
|
-
removeItem(ctx: WidgetContext): boolean;
|
|
148
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<JsonSchemaFormService, never>;
|
|
149
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<JsonSchemaFormService>;
|
|
150
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const deValidationMessages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const enValidationMessages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const esValidationMessages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const frValidationMessages: any;
|
package/lib/locale/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { deValidationMessages } from './de-validation-messages';
|
|
2
|
-
export { enValidationMessages } from './en-validation-messages';
|
|
3
|
-
export { esValidationMessages } from './es-validation-messages';
|
|
4
|
-
export { frValidationMessages } from './fr-validation-messages';
|
|
5
|
-
export { itValidationMessages } from './it-validation-messages';
|
|
6
|
-
export { ptValidationMessages } from './pt-validation-messages';
|
|
7
|
-
export { zhValidationMessages } from './zh-validation-messages';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const itValidationMessages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ptValidationMessages: any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const zhValidationMessages: any;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 'convertSchemaToDraft6' function
|
|
3
|
-
*
|
|
4
|
-
* Converts a JSON Schema from draft 1 through 4 format to draft 6 format
|
|
5
|
-
*
|
|
6
|
-
* Inspired by on geraintluff's JSON Schema 3 to 4 compatibility function:
|
|
7
|
-
* https://github.com/geraintluff/json-schema-compatibility
|
|
8
|
-
* Also uses suggestions from AJV's JSON Schema 4 to 6 migration guide:
|
|
9
|
-
* https://github.com/epoberezkin/ajv/releases/tag/5.0.0
|
|
10
|
-
* And additional details from the official JSON Schema documentation:
|
|
11
|
-
* http://json-schema.org
|
|
12
|
-
*
|
|
13
|
-
* // { object } originalSchema - JSON schema (draft 1, 2, 3, 4, or 6)
|
|
14
|
-
* // { OptionObject = {} } options - options: parent schema changed?, schema draft number?
|
|
15
|
-
* // { object } - JSON schema (draft 6)
|
|
16
|
-
*/
|
|
17
|
-
export interface OptionObject {
|
|
18
|
-
changed?: boolean;
|
|
19
|
-
draft?: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function convertSchemaToDraft6(schema: any, options?: OptionObject): any;
|