@ng-formworks/core 17.2.7 → 18.0.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.
- package/LICENSE +21 -0
- package/README.md +834 -0
- package/esm2022/lib/framework-library/framework-library.service.mjs +175 -0
- package/esm2022/lib/framework-library/framework.mjs +15 -0
- package/esm2022/lib/framework-library/no-framework.component.mjs +18 -0
- package/esm2022/lib/framework-library/no-framework.module.mjs +27 -0
- package/esm2022/lib/framework-library/no.framework.mjs +19 -0
- package/esm2022/lib/json-schema-form.component.mjs +765 -0
- package/esm2022/lib/json-schema-form.module.mjs +26 -0
- package/esm2022/lib/json-schema-form.service.mjs +676 -0
- package/esm2022/lib/locale/de-validation-messages.mjs +60 -0
- package/esm2022/lib/locale/en-validation-messages.mjs +60 -0
- package/esm2022/lib/locale/es-validation-messages.mjs +57 -0
- package/esm2022/lib/locale/fr-validation-messages.mjs +60 -0
- package/esm2022/lib/locale/index.mjs +8 -0
- package/esm2022/lib/locale/it-validation-messages.mjs +60 -0
- package/esm2022/lib/locale/pt-validation-messages.mjs +60 -0
- package/esm2022/lib/locale/zh-validation-messages.mjs +60 -0
- package/esm2022/lib/shared/convert-schema-to-draft6.function.mjs +300 -0
- package/esm2022/lib/shared/form-group.functions.mjs +442 -0
- package/esm2022/lib/shared/format-regex.constants.mjs +54 -0
- package/esm2022/lib/shared/index.mjs +12 -0
- package/esm2022/lib/shared/json-schema.functions.mjs +784 -0
- package/esm2022/lib/shared/json.validators.mjs +884 -0
- package/esm2022/lib/shared/jsonpointer.functions.mjs +1026 -0
- package/esm2022/lib/shared/layout.functions.mjs +1158 -0
- package/esm2022/lib/shared/merge-schemas.function.mjs +345 -0
- package/esm2022/lib/shared/utility.functions.mjs +380 -0
- package/esm2022/lib/shared/validator.functions.mjs +584 -0
- package/esm2022/lib/widget-library/add-reference.component.mjs +61 -0
- package/esm2022/lib/widget-library/button.component.mjs +72 -0
- package/esm2022/lib/widget-library/checkbox.component.mjs +105 -0
- package/esm2022/lib/widget-library/checkboxes.component.mjs +147 -0
- package/esm2022/lib/widget-library/file.component.mjs +35 -0
- package/esm2022/lib/widget-library/hidden.component.mjs +54 -0
- package/esm2022/lib/widget-library/index.mjs +55 -0
- package/esm2022/lib/widget-library/input.component.mjs +119 -0
- package/esm2022/lib/widget-library/message.component.mjs +38 -0
- package/esm2022/lib/widget-library/none.component.mjs +21 -0
- package/esm2022/lib/widget-library/number.component.mjs +123 -0
- package/esm2022/lib/widget-library/one-of.component.mjs +35 -0
- package/esm2022/lib/widget-library/orderable.directive.mjs +123 -0
- package/esm2022/lib/widget-library/radios.component.mjs +153 -0
- package/esm2022/lib/widget-library/root.component.mjs +79 -0
- package/esm2022/lib/widget-library/section.component.mjs +199 -0
- package/esm2022/lib/widget-library/select-framework.component.mjs +51 -0
- package/esm2022/lib/widget-library/select-widget.component.mjs +46 -0
- package/esm2022/lib/widget-library/select.component.mjs +150 -0
- package/esm2022/lib/widget-library/submit.component.mjs +82 -0
- package/esm2022/lib/widget-library/tab.component.mjs +41 -0
- package/esm2022/lib/widget-library/tabs.component.mjs +108 -0
- package/esm2022/lib/widget-library/template.component.mjs +46 -0
- package/esm2022/lib/widget-library/textarea.component.mjs +104 -0
- package/esm2022/lib/widget-library/widget-library.module.mjs +42 -0
- package/esm2022/lib/widget-library/widget-library.service.mjs +226 -0
- package/esm2022/ng-formworks-core.mjs +5 -0
- package/esm2022/public_api.mjs +13 -0
- package/fesm2022/ng-formworks-core.mjs +10151 -0
- package/fesm2022/ng-formworks-core.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/framework-library/framework-library.service.d.ts +55 -0
- package/lib/framework-library/framework.d.ts +13 -0
- package/lib/framework-library/no-framework.component.d.ts +8 -0
- package/lib/framework-library/no-framework.module.d.ts +9 -0
- package/lib/framework-library/no.framework.d.ts +10 -0
- package/lib/json-schema-form.component.d.ts +218 -0
- package/lib/json-schema-form.module.d.ts +11 -0
- package/lib/json-schema-form.service.d.ts +115 -0
- package/lib/locale/de-validation-messages.d.ts +1 -0
- package/lib/locale/en-validation-messages.d.ts +1 -0
- package/lib/locale/es-validation-messages.d.ts +1 -0
- package/lib/locale/fr-validation-messages.d.ts +1 -0
- package/{src/lib/locale/index.ts → lib/locale/index.d.ts} +7 -7
- package/lib/locale/it-validation-messages.d.ts +1 -0
- package/lib/locale/pt-validation-messages.d.ts +1 -0
- package/lib/locale/zh-validation-messages.d.ts +1 -0
- package/lib/shared/convert-schema-to-draft6.function.d.ts +21 -0
- package/lib/shared/form-group.functions.d.ts +100 -0
- package/lib/shared/format-regex.constants.d.ts +19 -0
- package/lib/shared/index.d.ts +9 -0
- package/lib/shared/json-schema.functions.d.ts +193 -0
- package/lib/shared/json.validators.d.ts +441 -0
- package/lib/shared/jsonpointer.functions.d.ts +416 -0
- package/lib/shared/layout.functions.d.ts +83 -0
- package/lib/shared/merge-schemas.function.d.ts +19 -0
- package/lib/shared/utility.functions.d.ts +165 -0
- package/{src/lib/shared/validator.functions.ts → lib/shared/validator.functions.d.ts} +364 -601
- package/lib/widget-library/add-reference.component.d.ts +20 -0
- package/lib/widget-library/button.component.d.ts +21 -0
- package/lib/widget-library/checkbox.component.d.ts +24 -0
- package/lib/widget-library/checkboxes.component.d.ts +24 -0
- package/lib/widget-library/file.component.d.ts +21 -0
- package/lib/widget-library/hidden.component.d.ts +19 -0
- package/{src/lib/widget-library/index.ts → lib/widget-library/index.d.ts} +47 -56
- package/lib/widget-library/input.component.d.ts +22 -0
- package/lib/widget-library/message.component.d.ts +15 -0
- package/lib/widget-library/none.component.d.ts +8 -0
- package/lib/widget-library/number.component.d.ts +25 -0
- package/lib/widget-library/one-of.component.d.ts +21 -0
- package/lib/widget-library/orderable.directive.d.ts +41 -0
- package/lib/widget-library/radios.component.d.ts +23 -0
- package/lib/widget-library/root.component.d.ts +17 -0
- package/lib/widget-library/section.component.d.ts +19 -0
- package/lib/widget-library/select-framework.component.d.ts +18 -0
- package/lib/widget-library/select-widget.component.d.ts +18 -0
- package/lib/widget-library/select.component.d.ts +24 -0
- package/lib/widget-library/submit.component.d.ts +24 -0
- package/lib/widget-library/tab.component.d.ts +14 -0
- package/lib/widget-library/tabs.component.d.ts +20 -0
- package/lib/widget-library/template.component.d.ts +18 -0
- package/lib/widget-library/textarea.component.d.ts +21 -0
- package/lib/widget-library/widget-library.module.d.ts +31 -0
- package/lib/widget-library/widget-library.service.d.ts +22 -0
- package/package.json +66 -53
- package/{src/public_api.ts → public_api.d.ts} +9 -21
- package/karma.conf.js +0 -46
- package/ng-package.json +0 -11
- package/src/lib/framework-library/framework-library.service.ts +0 -195
- package/src/lib/framework-library/framework.ts +0 -11
- package/src/lib/framework-library/no-framework.component.html +0 -2
- package/src/lib/framework-library/no-framework.component.ts +0 -11
- package/src/lib/framework-library/no-framework.module.ts +0 -18
- package/src/lib/framework-library/no.framework.ts +0 -11
- package/src/lib/json-schema-form.component.html +0 -7
- package/src/lib/json-schema-form.component.ts +0 -809
- package/src/lib/json-schema-form.module.ts +0 -17
- package/src/lib/json-schema-form.service.ts +0 -907
- package/src/lib/locale/de-validation-messages.ts +0 -58
- package/src/lib/locale/en-validation-messages.ts +0 -58
- package/src/lib/locale/es-validation-messages.ts +0 -55
- package/src/lib/locale/fr-validation-messages.ts +0 -58
- package/src/lib/locale/it-validation-messages.ts +0 -58
- package/src/lib/locale/pt-validation-messages.ts +0 -58
- package/src/lib/locale/zh-validation-messages.ts +0 -58
- package/src/lib/locale-dates/en-US.ts +0 -5
- package/src/lib/shared/convert-schema-to-draft6.function.ts +0 -321
- package/src/lib/shared/form-group.functions.ts +0 -522
- package/src/lib/shared/format-regex.constants.ts +0 -73
- package/src/lib/shared/index.ts +0 -40
- package/src/lib/shared/json-schema.functions.ts +0 -788
- package/src/lib/shared/json.validators.ts +0 -878
- package/src/lib/shared/jsonpointer.functions.ts +0 -1012
- package/src/lib/shared/jspointer.functions.json.spec.ts +0 -103
- package/src/lib/shared/layout.functions.ts +0 -1233
- package/src/lib/shared/merge-schemas.function.ts +0 -329
- package/src/lib/shared/utility.functions.ts +0 -373
- package/src/lib/shared/validator.functions.spec.ts +0 -55
- package/src/lib/widget-library/add-reference.component.ts +0 -59
- package/src/lib/widget-library/button.component.ts +0 -54
- package/src/lib/widget-library/checkbox.component.ts +0 -74
- package/src/lib/widget-library/checkboxes.component.ts +0 -104
- package/src/lib/widget-library/file.component.ts +0 -36
- package/src/lib/widget-library/hidden.component.ts +0 -39
- package/src/lib/widget-library/input.component.ts +0 -76
- package/src/lib/widget-library/message.component.ts +0 -29
- package/src/lib/widget-library/none.component.ts +0 -12
- package/src/lib/widget-library/number.component.ts +0 -79
- package/src/lib/widget-library/one-of.component.ts +0 -36
- package/src/lib/widget-library/orderable.directive.ts +0 -130
- package/src/lib/widget-library/radios.component.ts +0 -101
- package/src/lib/widget-library/root.component.ts +0 -78
- package/src/lib/widget-library/section.component.ts +0 -133
- package/src/lib/widget-library/select-framework.component.ts +0 -50
- package/src/lib/widget-library/select-widget.component.ts +0 -46
- package/src/lib/widget-library/select.component.ts +0 -96
- package/src/lib/widget-library/submit.component.ts +0 -68
- package/src/lib/widget-library/tab.component.ts +0 -29
- package/src/lib/widget-library/tabs.component.ts +0 -83
- package/src/lib/widget-library/template.component.ts +0 -52
- package/src/lib/widget-library/textarea.component.ts +0 -68
- package/src/lib/widget-library/widget-library.module.ts +0 -13
- package/src/lib/widget-library/widget-library.service.ts +0 -234
- package/src/test.ts +0 -18
- package/tsconfig.lib.json +0 -25
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -17
- package/tslint.json +0 -11
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./add-reference.component";
|
|
3
|
+
import * as i2 from "./one-of.component";
|
|
4
|
+
import * as i3 from "./button.component";
|
|
5
|
+
import * as i4 from "./checkbox.component";
|
|
6
|
+
import * as i5 from "./checkboxes.component";
|
|
7
|
+
import * as i6 from "./file.component";
|
|
8
|
+
import * as i7 from "./hidden.component";
|
|
9
|
+
import * as i8 from "./input.component";
|
|
10
|
+
import * as i9 from "./message.component";
|
|
11
|
+
import * as i10 from "./none.component";
|
|
12
|
+
import * as i11 from "./number.component";
|
|
13
|
+
import * as i12 from "./radios.component";
|
|
14
|
+
import * as i13 from "./root.component";
|
|
15
|
+
import * as i14 from "./section.component";
|
|
16
|
+
import * as i15 from "./select.component";
|
|
17
|
+
import * as i16 from "./select-framework.component";
|
|
18
|
+
import * as i17 from "./select-widget.component";
|
|
19
|
+
import * as i18 from "./submit.component";
|
|
20
|
+
import * as i19 from "./tab.component";
|
|
21
|
+
import * as i20 from "./tabs.component";
|
|
22
|
+
import * as i21 from "./template.component";
|
|
23
|
+
import * as i22 from "./textarea.component";
|
|
24
|
+
import * as i23 from "./orderable.directive";
|
|
25
|
+
import * as i24 from "@angular/common";
|
|
26
|
+
import * as i25 from "@angular/forms";
|
|
27
|
+
export declare class WidgetLibraryModule {
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetLibraryModule, never>;
|
|
29
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<WidgetLibraryModule, [typeof i1.AddReferenceComponent, typeof i2.OneOfComponent, typeof i3.ButtonComponent, typeof i4.CheckboxComponent, typeof i5.CheckboxesComponent, typeof i6.FileComponent, typeof i7.HiddenComponent, typeof i8.InputComponent, typeof i9.MessageComponent, typeof i10.NoneComponent, typeof i11.NumberComponent, typeof i12.RadiosComponent, typeof i13.RootComponent, typeof i14.SectionComponent, typeof i15.SelectComponent, typeof i16.SelectFrameworkComponent, typeof i17.SelectWidgetComponent, typeof i18.SubmitComponent, typeof i19.TabComponent, typeof i20.TabsComponent, typeof i21.TemplateComponent, typeof i22.TextareaComponent, typeof i23.OrderableDirective], [typeof i24.CommonModule, typeof i25.FormsModule, typeof i25.ReactiveFormsModule], [typeof i1.AddReferenceComponent, typeof i2.OneOfComponent, typeof i3.ButtonComponent, typeof i4.CheckboxComponent, typeof i5.CheckboxesComponent, typeof i6.FileComponent, typeof i7.HiddenComponent, typeof i8.InputComponent, typeof i9.MessageComponent, typeof i10.NoneComponent, typeof i11.NumberComponent, typeof i12.RadiosComponent, typeof i13.RootComponent, typeof i14.SectionComponent, typeof i15.SelectComponent, typeof i16.SelectFrameworkComponent, typeof i17.SelectWidgetComponent, typeof i18.SubmitComponent, typeof i19.TabComponent, typeof i20.TabsComponent, typeof i21.TemplateComponent, typeof i22.TextareaComponent, typeof i23.OrderableDirective]>;
|
|
30
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<WidgetLibraryModule>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class WidgetLibraryService {
|
|
3
|
+
defaultWidget: string;
|
|
4
|
+
widgetLibrary: any;
|
|
5
|
+
registeredWidgets: any;
|
|
6
|
+
frameworkWidgets: any;
|
|
7
|
+
activeWidgets: any;
|
|
8
|
+
constructor();
|
|
9
|
+
setActiveWidgets(): boolean;
|
|
10
|
+
setDefaultWidget(type: string): boolean;
|
|
11
|
+
hasWidget(type: string, widgetSet?: string): boolean;
|
|
12
|
+
hasDefaultWidget(type: string): boolean;
|
|
13
|
+
registerWidget(type: string, widget: any): boolean;
|
|
14
|
+
unRegisterWidget(type: string): boolean;
|
|
15
|
+
unRegisterAllWidgets(unRegisterFrameworkWidgets?: boolean): boolean;
|
|
16
|
+
registerFrameworkWidgets(widgets: any): boolean;
|
|
17
|
+
unRegisterFrameworkWidgets(): boolean;
|
|
18
|
+
getWidget(type?: string, widgetSet?: string): any;
|
|
19
|
+
getAllWidgets(): any;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WidgetLibraryService, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WidgetLibraryService>;
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,54 +1,67 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@ng-formworks/core",
|
|
3
|
+
"version": "18.0.0",
|
|
4
|
+
"description": "Angular ng-formworks - JSON Schema Form builder core",
|
|
5
|
+
"author": "https://github.com/zahmo/ng-formworks/graphs/contributors",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"Angular",
|
|
8
|
+
"ng",
|
|
9
|
+
"Angular15",
|
|
10
|
+
"Angular 15",
|
|
11
|
+
"Angular16",
|
|
12
|
+
"Angular 16",
|
|
13
|
+
"Angular17",
|
|
14
|
+
"Angular 17",
|
|
15
|
+
"Angular 18",
|
|
16
|
+
"ng15",
|
|
17
|
+
"ng16",
|
|
18
|
+
"ng17",
|
|
19
|
+
"ng18",
|
|
20
|
+
"JSON Schema",
|
|
21
|
+
"form",
|
|
22
|
+
"forms",
|
|
23
|
+
"form builder",
|
|
24
|
+
"form themes",
|
|
25
|
+
"form generator",
|
|
26
|
+
"ajsf",
|
|
27
|
+
"ng-formworks",
|
|
28
|
+
"ng formworks",
|
|
29
|
+
"formworks",
|
|
30
|
+
"angular json schema form"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/zahmo/ng-formworks"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/zahmo/ng-formworks/issues"
|
|
39
|
+
},
|
|
40
|
+
"private": false,
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"lodash-es": "~4.17.21",
|
|
43
|
+
"ajv": "^8.12.0",
|
|
44
|
+
"tslib": "^2.7.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@angular/common": ">=18.0.0",
|
|
48
|
+
"@angular/core": ">=18.0.0",
|
|
49
|
+
"@angular/forms": ">=18.0.0",
|
|
50
|
+
"@angular/platform-browser": ">=18.0.0",
|
|
51
|
+
"rxjs": "^7.0.0"
|
|
52
|
+
},
|
|
53
|
+
"module": "fesm2022/ng-formworks-core.mjs",
|
|
54
|
+
"typings": "index.d.ts",
|
|
55
|
+
"exports": {
|
|
56
|
+
"./package.json": {
|
|
57
|
+
"default": "./package.json"
|
|
58
|
+
},
|
|
59
|
+
".": {
|
|
60
|
+
"types": "./index.d.ts",
|
|
61
|
+
"esm2022": "./esm2022/ng-formworks-core.mjs",
|
|
62
|
+
"esm": "./esm2022/ng-formworks-core.mjs",
|
|
63
|
+
"default": "./fesm2022/ng-formworks-core.mjs"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"sideEffects": false
|
|
54
67
|
}
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
11
|
-
deValidationMessages,
|
|
12
|
-
enValidationMessages,
|
|
13
|
-
esValidationMessages,
|
|
14
|
-
frValidationMessages,
|
|
15
|
-
itValidationMessages,
|
|
16
|
-
ptValidationMessages,
|
|
17
|
-
zhValidationMessages
|
|
18
|
-
} from './lib/locale';
|
|
19
|
-
export * from './lib/widget-library';
|
|
20
|
-
export * from './lib/widget-library/widget-library.module';
|
|
21
|
-
export * from './lib/shared';
|
|
1
|
+
export { JsonSchemaFormModule } from './lib/json-schema-form.module';
|
|
2
|
+
export { TitleMapItem, ErrorMessages, JsonSchemaFormService } from './lib/json-schema-form.service';
|
|
3
|
+
export { JsonSchemaFormComponent } from './lib/json-schema-form.component';
|
|
4
|
+
export { Framework } from './lib/framework-library/framework';
|
|
5
|
+
export { FrameworkLibraryService } from './lib/framework-library/framework-library.service';
|
|
6
|
+
export { deValidationMessages, enValidationMessages, esValidationMessages, frValidationMessages, itValidationMessages, ptValidationMessages, zhValidationMessages } from './lib/locale';
|
|
7
|
+
export * from './lib/widget-library';
|
|
8
|
+
export * from './lib/widget-library/widget-library.module';
|
|
9
|
+
export * from './lib/shared';
|
package/karma.conf.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma'),
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
17
|
-
},
|
|
18
|
-
coverageReporter: {
|
|
19
|
-
dir: require('path').join(__dirname, '../../coverage/ajsf-core'),
|
|
20
|
-
reporters: [
|
|
21
|
-
{
|
|
22
|
-
type: 'html',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
type: 'lcov',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
type: 'text-summary',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
reporters: ['progress', 'kjhtml'],
|
|
33
|
-
port: 9876,
|
|
34
|
-
colors: true,
|
|
35
|
-
logLevel: config.LOG_INFO,
|
|
36
|
-
autoWatch: true,
|
|
37
|
-
singleRun: false,
|
|
38
|
-
browsers: ['Chrome', 'ChromeHeadlessCI'],
|
|
39
|
-
customLaunchers: {
|
|
40
|
-
ChromeHeadlessCI: {
|
|
41
|
-
base: 'ChromeHeadless',
|
|
42
|
-
flags: ['--no-sandbox'],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
};
|
package/ng-package.json
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
|
-
import { Inject, Injectable } from '@angular/core';
|
|
3
|
-
import { Observable, Subject, lastValueFrom } from 'rxjs';
|
|
4
|
-
import { hasOwn } from '../shared/utility.functions';
|
|
5
|
-
import { WidgetLibraryService } from '../widget-library/widget-library.service';
|
|
6
|
-
import { Framework } from './framework';
|
|
7
|
-
|
|
8
|
-
// Possible future frameworks:
|
|
9
|
-
// - Foundation 6:
|
|
10
|
-
// http://justindavis.co/2017/06/15/using-foundation-6-in-angular-4/
|
|
11
|
-
// https://github.com/zurb/foundation-sites
|
|
12
|
-
// - Semantic UI:
|
|
13
|
-
// https://github.com/edcarroll/ng2-semantic-ui
|
|
14
|
-
// https://github.com/vladotesanovic/ngSemantic
|
|
15
|
-
|
|
16
|
-
@Injectable({
|
|
17
|
-
providedIn: 'root',
|
|
18
|
-
})
|
|
19
|
-
export class FrameworkLibraryService {
|
|
20
|
-
activeFramework: Framework = null;
|
|
21
|
-
stylesheets: (HTMLStyleElement|HTMLLinkElement)[];
|
|
22
|
-
scripts: HTMLScriptElement[];
|
|
23
|
-
loadExternalAssets = false;
|
|
24
|
-
defaultFramework: string;
|
|
25
|
-
frameworkLibrary: { [name: string]: Framework } = {};
|
|
26
|
-
|
|
27
|
-
activeFrameworkName$: Observable<string>;
|
|
28
|
-
private activeFrameworkNameSubject: Subject<string>;
|
|
29
|
-
private activeFrameworkName:string;
|
|
30
|
-
|
|
31
|
-
constructor(
|
|
32
|
-
@Inject(Framework) private frameworks: any[],
|
|
33
|
-
@Inject(WidgetLibraryService) private widgetLibrary: WidgetLibraryService,
|
|
34
|
-
private http: HttpClient,
|
|
35
|
-
) {
|
|
36
|
-
this.frameworks.forEach(framework =>
|
|
37
|
-
this.frameworkLibrary[framework.name] = framework
|
|
38
|
-
);
|
|
39
|
-
this.defaultFramework = this.frameworks[0].name;
|
|
40
|
-
//this.setFramework(this.defaultFramework);
|
|
41
|
-
|
|
42
|
-
this.activeFrameworkName=this.defaultFramework;
|
|
43
|
-
this.activeFrameworkNameSubject = new Subject<string>();
|
|
44
|
-
this.activeFrameworkName$ = this.activeFrameworkNameSubject.asObservable();
|
|
45
|
-
this.setFramework(this.defaultFramework);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public setLoadExternalAssets(loadExternalAssets = true): void {
|
|
49
|
-
this.loadExternalAssets = !!loadExternalAssets;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public setFramework(
|
|
53
|
-
framework: string|Framework = this.defaultFramework,
|
|
54
|
-
loadExternalAssets = this.loadExternalAssets
|
|
55
|
-
): boolean {
|
|
56
|
-
this.activeFramework =
|
|
57
|
-
typeof framework === 'string' && this.hasFramework(framework) ?
|
|
58
|
-
this.frameworkLibrary[framework] :
|
|
59
|
-
typeof framework === 'object' && hasOwn(framework, 'framework') ?
|
|
60
|
-
framework :
|
|
61
|
-
this.frameworkLibrary[this.defaultFramework];
|
|
62
|
-
if(this.activeFramework.name !=this.activeFrameworkName){
|
|
63
|
-
this.activeFrameworkName=this.activeFramework.name;
|
|
64
|
-
this.activeFrameworkNameSubject.next(this.activeFrameworkName);
|
|
65
|
-
}
|
|
66
|
-
return this.registerFrameworkWidgets(this.activeFramework);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
registerFrameworkWidgets(framework: Framework): boolean {
|
|
70
|
-
return hasOwn(framework, 'widgets') ?
|
|
71
|
-
this.widgetLibrary.registerFrameworkWidgets(framework.widgets) :
|
|
72
|
-
this.widgetLibrary.unRegisterFrameworkWidgets();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public hasFramework(type: string): boolean {
|
|
76
|
-
return hasOwn(this.frameworkLibrary, type);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public getFramework(): any {
|
|
80
|
-
if (!this.activeFramework) { this.setFramework('default', true); }
|
|
81
|
-
return this.activeFramework.framework;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public getFrameworkList():{name:string,text:string}[] {
|
|
85
|
-
return this.frameworks.map(fw=>{
|
|
86
|
-
return {name:fw.name,text:fw.text};
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
public getFrameworkWidgets(): any {
|
|
92
|
-
return this.activeFramework.widgets || {};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
public getFrameworkStylesheets(load: boolean = this.loadExternalAssets): string[] {
|
|
98
|
-
return (load && this.activeFramework.stylesheets) || [];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
public getFrameworkScripts(load: boolean = this.loadExternalAssets): string[] {
|
|
102
|
-
return (load && this.activeFramework.scripts) || [];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
//applies to CssFramework classes
|
|
106
|
-
public getFrameworkConfig(existingFramework?:any): any {
|
|
107
|
-
let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;
|
|
108
|
-
return actFramework.config;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
//this will load the list of assets to be loaded at runtime in case the dependent framework
|
|
112
|
-
//scripts and styles are include locally with the parent app
|
|
113
|
-
public getFrameworkAssetConfig(existingFramework?:any,useAssetRelPath=true):Promise<{stylesheets:string[],scripts:string[]}>{
|
|
114
|
-
let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;
|
|
115
|
-
//TODO move this into config
|
|
116
|
-
const assetConfigPath = `assets/${actFramework.name}/cssframework`
|
|
117
|
-
const assetConfigURL = `${assetConfigPath}/assets.json`;
|
|
118
|
-
let subs=this.http
|
|
119
|
-
.get(assetConfigURL, { responseType: 'text' })
|
|
120
|
-
//.subscribe(assetConfig => {
|
|
121
|
-
// assetConfig
|
|
122
|
-
//})
|
|
123
|
-
|
|
124
|
-
return lastValueFrom(subs).then(assetCfgText=>{
|
|
125
|
-
let assetCfg=JSON.parse(assetCfgText);
|
|
126
|
-
if(useAssetRelPath){
|
|
127
|
-
assetCfg.stylesheets=assetCfg.stylesheets.map(styleLink=>{
|
|
128
|
-
//ignore relative path if url starts with known protocol or //
|
|
129
|
-
let nonRelPrefixes=["/","//","http:","https:"];//"//" list for completeness
|
|
130
|
-
let isNonRel=false;
|
|
131
|
-
nonRelPrefixes.forEach(prefix=>{
|
|
132
|
-
isNonRel=isNonRel||styleLink.indexOf(prefix)==0;
|
|
133
|
-
})
|
|
134
|
-
if(isNonRel){
|
|
135
|
-
return styleLink;
|
|
136
|
-
}
|
|
137
|
-
return `${assetConfigPath}/${styleLink}`;
|
|
138
|
-
})
|
|
139
|
-
assetCfg.scripts=assetCfg.scripts.map(scriptLink=>{
|
|
140
|
-
return `${assetConfigPath}/${scriptLink}`;
|
|
141
|
-
})
|
|
142
|
-
}
|
|
143
|
-
return assetCfg
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
//applies to CssFramework classes
|
|
148
|
-
public getFrameworkThemes():{name:string,text:string}[] {
|
|
149
|
-
let cssfwConfig=this.getFrameworkConfig();
|
|
150
|
-
let themes;
|
|
151
|
-
if(cssfwConfig){
|
|
152
|
-
themes=cssfwConfig?.widgetstyles?.__themes__||[]
|
|
153
|
-
}
|
|
154
|
-
return themes
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
//applies to CssFramework classes
|
|
158
|
-
public requestThemeChange(name:string,validateThemeExists:boolean=false,existingFramework?:any){
|
|
159
|
-
let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;
|
|
160
|
-
if(actFramework.requestThemeChange){
|
|
161
|
-
if(validateThemeExists){
|
|
162
|
-
let themes=this.getFrameworkThemes();
|
|
163
|
-
let foundThemes=themes.filter(thm=>{return thm.name==name});
|
|
164
|
-
if(!foundThemes|| foundThemes.length==0){
|
|
165
|
-
return false;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
actFramework.requestThemeChange(name);
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
//applies to CssFramework classes
|
|
173
|
-
public getActiveTheme(existingFramework?:any):{name:string,text:string}{
|
|
174
|
-
let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;
|
|
175
|
-
if(actFramework.getActiveTheme){
|
|
176
|
-
return actFramework.getActiveTheme();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
//applies to CssFramework classes
|
|
181
|
-
public registerTheme(newTheme:{name:string,text:string},existingFramework?:any):boolean{
|
|
182
|
-
let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;
|
|
183
|
-
if(actFramework.registerTheme){
|
|
184
|
-
return actFramework.registerTheme(newTheme);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
//applies to CssFramework classes
|
|
189
|
-
public unregisterTheme(name:string,existingFramework?:any):boolean{
|
|
190
|
-
let actFramework:Framework& { [key: string]: any; }=existingFramework||this.activeFramework;
|
|
191
|
-
if(actFramework.registerTheme){
|
|
192
|
-
return actFramework.unregisterTheme(name);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Component, Input } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
selector: 'no-framework',
|
|
5
|
-
templateUrl: './no-framework.component.html',
|
|
6
|
-
})
|
|
7
|
-
export class NoFrameworkComponent {
|
|
8
|
-
@Input() layoutNode: any;
|
|
9
|
-
@Input() layoutIndex: number[];
|
|
10
|
-
@Input() dataIndex: number[];
|
|
11
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { Framework } from './framework';
|
|
3
|
-
import { NgModule } from '@angular/core';
|
|
4
|
-
import { NoFramework } from './no.framework';
|
|
5
|
-
import { NoFrameworkComponent } from './no-framework.component';
|
|
6
|
-
import { WidgetLibraryModule } from '../widget-library/widget-library.module';
|
|
7
|
-
|
|
8
|
-
// No framework - plain HTML controls (styles from form layout only)
|
|
9
|
-
|
|
10
|
-
@NgModule({
|
|
11
|
-
imports: [CommonModule, WidgetLibraryModule],
|
|
12
|
-
declarations: [NoFrameworkComponent],
|
|
13
|
-
exports: [NoFrameworkComponent],
|
|
14
|
-
providers: [
|
|
15
|
-
{ provide: Framework, useClass: NoFramework, multi: true }
|
|
16
|
-
]
|
|
17
|
-
})
|
|
18
|
-
export class NoFrameworkModule { }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { Framework } from './framework';
|
|
3
|
-
import { NoFrameworkComponent } from './no-framework.component';
|
|
4
|
-
// No framework - plain HTML controls (styles from form layout only)
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class NoFramework extends Framework {
|
|
8
|
-
name = 'no-framework';
|
|
9
|
-
text ='None (plain HTML)';
|
|
10
|
-
framework = NoFrameworkComponent;
|
|
11
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<form [autocomplete]="jsf?.formOptions?.autocomplete ? 'on' : 'off'" class="json-schema-form" (ngSubmit)="submitForm()">
|
|
2
|
-
<root-widget [layout]="jsf?.layout"></root-widget>
|
|
3
|
-
</form>
|
|
4
|
-
<div *ngIf="debug || jsf?.formOptions?.debug">
|
|
5
|
-
Debug output:
|
|
6
|
-
<pre>{{debugOutput}}</pre>
|
|
7
|
-
</div>
|