@ng-formworks/core 17.2.7 → 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.
- package/LICENSE +21 -0
- package/README.md +833 -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 +1154 -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 +10147 -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 +64 -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
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import {JsonPointer} from './jsonpointer.functions';
|
|
2
|
-
|
|
3
|
-
const subObjectWithEvaluatedProperty = {name: 'abc', other_property: false};
|
|
4
|
-
|
|
5
|
-
describe('JsonPointer.evaluateExpression', () => {
|
|
6
|
-
|
|
7
|
-
it('should return true when subObject and corresponding key is given', () => {
|
|
8
|
-
const result = JsonPointer.evaluateExpression({name: 'abc', other_property: false}, 'name==\'abc\'');
|
|
9
|
-
|
|
10
|
-
expect(result.passed).toEqual(true);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should not fail when subObject is null', () => {
|
|
14
|
-
const result = JsonPointer.evaluateExpression(null, 'name==\'abc\'');
|
|
15
|
-
|
|
16
|
-
expect(result).toBeDefined();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should not fail when subObject is undefined', () => {
|
|
20
|
-
const result = JsonPointer.evaluateExpression(undefined, 'name==\'abc\'');
|
|
21
|
-
|
|
22
|
-
expect(result).toBeDefined();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should return false when key is undefined', () => {
|
|
26
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, undefined);
|
|
27
|
-
|
|
28
|
-
expect(result.passed).toBeFalsy();
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should return false when key is null', () => {
|
|
32
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, null);
|
|
33
|
-
|
|
34
|
-
expect(result.passed).toBeFalsy();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should return false when key corrupted', () => {
|
|
38
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'name=\'abc\'');
|
|
39
|
-
|
|
40
|
-
expect(result.passed).toBeFalsy();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should return the same key when key corrupted', () => {
|
|
44
|
-
const key = 'name=\'abc\'';
|
|
45
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, key);
|
|
46
|
-
|
|
47
|
-
expect(result.key).toEqual(key);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('should return the first part of key when key contains equals', () => {
|
|
51
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'name==\'abc\'');
|
|
52
|
-
|
|
53
|
-
expect(result.key).toEqual('name');
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('should not return the first part of key when key contains not equals', () => {
|
|
57
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'name!=\'abc\'');
|
|
58
|
-
|
|
59
|
-
expect(result.key).not.toEqual('name');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should return false when key equals does not correspond to the subObject property', () => {
|
|
63
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'somethingElse==\'abc\'');
|
|
64
|
-
|
|
65
|
-
expect(result.passed).toBeFalsy();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('should return true when key not equals does not correspond to the subObject property', () => {
|
|
69
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'somethingElse!=\'abc\'');
|
|
70
|
-
|
|
71
|
-
expect(result.passed).toBeTruthy();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('should return the first part of key when key does not equal to the property value', () => {
|
|
75
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'name!=\'cba\'');
|
|
76
|
-
|
|
77
|
-
expect(result.key).toEqual('name');
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('should return the first part of key when key does equal to the property value', () => {
|
|
81
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'name==\'abc\'');
|
|
82
|
-
|
|
83
|
-
expect(result.key).toEqual('name');
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it('should return false when key is different', () => {
|
|
87
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'eman==\'abc\'');
|
|
88
|
-
|
|
89
|
-
expect(result.passed).toBeFalsy();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('should return true when key is without quotes', () => {
|
|
93
|
-
const result = JsonPointer.evaluateExpression({name: 'abc', other_property: false}, 'name==abc');
|
|
94
|
-
|
|
95
|
-
expect(result.passed).toEqual(true);
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('should return false when key has different value', () => {
|
|
99
|
-
const result = JsonPointer.evaluateExpression(subObjectWithEvaluatedProperty, 'name==\'cba\'');
|
|
100
|
-
|
|
101
|
-
expect(result.passed).toBeFalsy();
|
|
102
|
-
});
|
|
103
|
-
});
|