@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
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { PlainObject } from './validator.functions';
|
|
2
|
-
/**
|
|
3
|
-
* Utility function library:
|
|
4
|
-
*
|
|
5
|
-
* addClasses, copy, forEach, forEachCopy, hasOwn, mergeFilteredObject,
|
|
6
|
-
* uniqueItems, commonItems, fixTitle, toTitleCase
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* 'addClasses' function
|
|
10
|
-
*
|
|
11
|
-
* Merges two space-delimited lists of CSS classes and removes duplicates.
|
|
12
|
-
*
|
|
13
|
-
* // {string | string[] | Set<string>} oldClasses
|
|
14
|
-
* // {string | string[] | Set<string>} newClasses
|
|
15
|
-
* // {string | string[] | Set<string>} - Combined classes
|
|
16
|
-
*/
|
|
17
|
-
export declare function addClasses(oldClasses: string | string[] | Set<string>, newClasses: string | string[] | Set<string>): string | string[] | Set<string>;
|
|
18
|
-
/**
|
|
19
|
-
* 'copy' function
|
|
20
|
-
*
|
|
21
|
-
* Makes a shallow copy of a JavaScript object, array, Map, or Set.
|
|
22
|
-
* If passed a JavaScript primitive value (string, number, boolean, or null),
|
|
23
|
-
* it returns the value.
|
|
24
|
-
*
|
|
25
|
-
* // {Object|Array|string|number|boolean|null} object - The object to copy
|
|
26
|
-
* // {boolean = false} errors - Show errors?
|
|
27
|
-
* // {Object|Array|string|number|boolean|null} - The copied object
|
|
28
|
-
*/
|
|
29
|
-
export declare function copy(object: any, errors?: boolean): any;
|
|
30
|
-
/**
|
|
31
|
-
* 'forEach' function
|
|
32
|
-
*
|
|
33
|
-
* Iterates over all items in the first level of an object or array
|
|
34
|
-
* and calls an iterator funciton on each item.
|
|
35
|
-
*
|
|
36
|
-
* The iterator function is called with four values:
|
|
37
|
-
* 1. The current item's value
|
|
38
|
-
* 2. The current item's key
|
|
39
|
-
* 3. The parent object, which contains the current item
|
|
40
|
-
* 4. The root object
|
|
41
|
-
*
|
|
42
|
-
* Setting the optional third parameter to 'top-down' or 'bottom-up' will cause
|
|
43
|
-
* it to also recursively iterate over items in sub-objects or sub-arrays in the
|
|
44
|
-
* specified direction.
|
|
45
|
-
*
|
|
46
|
-
* // {Object|Array} object - The object or array to iterate over
|
|
47
|
-
* // {function} fn - the iterator funciton to call on each item
|
|
48
|
-
* // {boolean = false} errors - Show errors?
|
|
49
|
-
* // {void}
|
|
50
|
-
*/
|
|
51
|
-
export declare function forEach(object: any, fn: (v: any, k?: string | number, c?: any, rc?: any) => any, recurse?: boolean | string, rootObject?: any, errors?: boolean): void;
|
|
52
|
-
/**
|
|
53
|
-
* 'forEachCopy' function
|
|
54
|
-
*
|
|
55
|
-
* Iterates over all items in the first level of an object or array
|
|
56
|
-
* and calls an iterator function on each item. Returns a new object or array
|
|
57
|
-
* with the same keys or indexes as the original, and values set to the results
|
|
58
|
-
* of the iterator function.
|
|
59
|
-
*
|
|
60
|
-
* Does NOT recursively iterate over items in sub-objects or sub-arrays.
|
|
61
|
-
*
|
|
62
|
-
* // {Object | Array} object - The object or array to iterate over
|
|
63
|
-
* // {function} fn - The iterator funciton to call on each item
|
|
64
|
-
* // {boolean = false} errors - Show errors?
|
|
65
|
-
* // {Object | Array} - The resulting object or array
|
|
66
|
-
*/
|
|
67
|
-
export declare function forEachCopy(object: any, fn: (v: any, k?: string | number, o?: any, p?: string) => any, errors?: boolean): any;
|
|
68
|
-
/**
|
|
69
|
-
* 'hasOwn' utility function
|
|
70
|
-
*
|
|
71
|
-
* Checks whether an object or array has a particular property.
|
|
72
|
-
*
|
|
73
|
-
* // {any} object - the object to check
|
|
74
|
-
* // {string} property - the property to look for
|
|
75
|
-
* // {boolean} - true if object has property, false if not
|
|
76
|
-
*/
|
|
77
|
-
export declare function hasOwn(object: any, property: string): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Types of possible expressions which the app is able to evaluate.
|
|
80
|
-
*/
|
|
81
|
-
export declare enum ExpressionType {
|
|
82
|
-
EQUALS = 0,
|
|
83
|
-
NOT_EQUALS = 1,
|
|
84
|
-
NOT_AN_EXPRESSION = 2
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Detects the type of expression from the given candidate. `==` for equals,
|
|
88
|
-
* `!=` for not equals. If none of these are contained in the candidate, the candidate
|
|
89
|
-
* is not considered to be an expression at all and thus `NOT_AN_EXPRESSION` is returned.
|
|
90
|
-
* // {expressionCandidate} expressionCandidate - potential expression
|
|
91
|
-
*/
|
|
92
|
-
export declare function getExpressionType(expressionCandidate: string): ExpressionType;
|
|
93
|
-
export declare function isEqual(expressionType: any): boolean;
|
|
94
|
-
export declare function isNotEqual(expressionType: any): boolean;
|
|
95
|
-
export declare function isNotExpression(expressionType: any): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Splits the expression key by the expressionType on a pair of values
|
|
98
|
-
* before and after the equals or nor equals sign.
|
|
99
|
-
* // {expressionType} enum of an expression type
|
|
100
|
-
* // {key} the given key from a for loop iver all conditions
|
|
101
|
-
*/
|
|
102
|
-
export declare function getKeyAndValueByExpressionType(expressionType: ExpressionType, key: string): string[];
|
|
103
|
-
export declare function cleanValueOfQuotes(keyAndValue: any): String;
|
|
104
|
-
/**
|
|
105
|
-
* 'mergeFilteredObject' utility function
|
|
106
|
-
*
|
|
107
|
-
* Shallowly merges two objects, setting key and values from source object
|
|
108
|
-
* in target object, excluding specified keys.
|
|
109
|
-
*
|
|
110
|
-
* Optionally, it can also use functions to transform the key names and/or
|
|
111
|
-
* the values of the merging object.
|
|
112
|
-
*
|
|
113
|
-
* // {PlainObject} targetObject - Target object to add keys and values to
|
|
114
|
-
* // {PlainObject} sourceObject - Source object to copy keys and values from
|
|
115
|
-
* // {string[]} excludeKeys - Array of keys to exclude
|
|
116
|
-
* // {(string: string) => string = (k) => k} keyFn - Function to apply to keys
|
|
117
|
-
* // {(any: any) => any = (v) => v} valueFn - Function to apply to values
|
|
118
|
-
* // {PlainObject} - Returns targetObject
|
|
119
|
-
*/
|
|
120
|
-
export declare function mergeFilteredObject(targetObject: PlainObject, sourceObject: PlainObject, excludeKeys?: string[], keyFn?: (key: string) => string, valFn?: (val: any) => any): PlainObject;
|
|
121
|
-
/**
|
|
122
|
-
* 'uniqueItems' function
|
|
123
|
-
*
|
|
124
|
-
* Accepts any number of string value inputs,
|
|
125
|
-
* and returns an array of all input vaues, excluding duplicates.
|
|
126
|
-
*
|
|
127
|
-
* // {...string} ...items -
|
|
128
|
-
* // {string[]} -
|
|
129
|
-
*/
|
|
130
|
-
export declare function uniqueItems(...items: any[]): string[];
|
|
131
|
-
/**
|
|
132
|
-
* 'commonItems' function
|
|
133
|
-
*
|
|
134
|
-
* Accepts any number of strings or arrays of string values,
|
|
135
|
-
* and returns a single array containing only values present in all inputs.
|
|
136
|
-
*
|
|
137
|
-
* // {...string|string[]} ...arrays -
|
|
138
|
-
* // {string[]} -
|
|
139
|
-
*/
|
|
140
|
-
export declare function commonItems(...arrays: any[]): string[];
|
|
141
|
-
/**
|
|
142
|
-
* 'fixTitle' function
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* // {string} input -
|
|
146
|
-
* // {string} -
|
|
147
|
-
*/
|
|
148
|
-
export declare function fixTitle(name: string): string;
|
|
149
|
-
/**
|
|
150
|
-
* 'toTitleCase' function
|
|
151
|
-
*
|
|
152
|
-
* Intelligently converts an input string to Title Case.
|
|
153
|
-
*
|
|
154
|
-
* Accepts an optional second parameter with a list of additional
|
|
155
|
-
* words and abbreviations to force into a particular case.
|
|
156
|
-
*
|
|
157
|
-
* This function is built on prior work by John Gruber and David Gouch:
|
|
158
|
-
* http://daringfireball.net/2008/08/title_case_update
|
|
159
|
-
* https://github.com/gouch/to-title-case
|
|
160
|
-
*
|
|
161
|
-
* // {string} input -
|
|
162
|
-
* // {string|string[]} forceWords? -
|
|
163
|
-
* // {string} -
|
|
164
|
-
*/
|
|
165
|
-
export declare function toTitleCase(input: string, forceWords?: string | string[]): string;
|
|
166
|
-
/**
|
|
167
|
-
* Recursively checks if at least one property of the given object (including nested objects)
|
|
168
|
-
* has a non-null and non-undefined value.
|
|
169
|
-
*
|
|
170
|
-
* @param obj - The object to check.
|
|
171
|
-
* @returns `true` if at least one property has a non-null and non-undefined value, otherwise `false`.
|
|
172
|
-
*
|
|
173
|
-
* @example
|
|
174
|
-
* const testObj = { a: null, b: { b1: null, b2: undefined } };
|
|
175
|
-
* console.log(hasNonNullValue(testObj)); // Output: false
|
|
176
|
-
*
|
|
177
|
-
* const testObj2 = { a: 1, b: { b1: null, b2: undefined } };
|
|
178
|
-
* console.log(hasNonNullValue(testObj2)); // Output: true
|
|
179
|
-
*/
|
|
180
|
-
export declare function hasNonNullValue(obj: Record<string, any>): boolean;
|
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
import { AbstractControl } from '@angular/forms';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
/**
|
|
4
|
-
* Validator utility function library:
|
|
5
|
-
*
|
|
6
|
-
* Validator and error utilities:
|
|
7
|
-
* _executeValidators, _executeAsyncValidators, _mergeObjects, _mergeErrors
|
|
8
|
-
*
|
|
9
|
-
* Individual value checking:
|
|
10
|
-
* isDefined, hasValue, isEmpty
|
|
11
|
-
*
|
|
12
|
-
* Individual type checking:
|
|
13
|
-
* isString, isNumber, isInteger, isBoolean, isFunction, isObject, isArray,
|
|
14
|
-
* isMap, isSet, isPromise, isObservable
|
|
15
|
-
*
|
|
16
|
-
* Multiple type checking and fixing:
|
|
17
|
-
* getType, isType, isPrimitive, toJavaScriptType, toSchemaType,
|
|
18
|
-
* _toPromise, toObservable
|
|
19
|
-
*
|
|
20
|
-
* Utility functions:
|
|
21
|
-
* inArray, xor
|
|
22
|
-
*
|
|
23
|
-
* Typescript types and interfaces:
|
|
24
|
-
* SchemaPrimitiveType, SchemaType, JavaScriptPrimitiveType, JavaScriptType,
|
|
25
|
-
* PrimitiveValue, PlainObject, IValidatorFn, AsyncIValidatorFn
|
|
26
|
-
*
|
|
27
|
-
* Note: 'IValidatorFn' is short for 'invertable validator function',
|
|
28
|
-
* which is a validator functions that accepts an optional second
|
|
29
|
-
* argument which, if set to TRUE, causes the validator to perform
|
|
30
|
-
* the opposite of its original function.
|
|
31
|
-
*/
|
|
32
|
-
export type SchemaPrimitiveType = 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
33
|
-
export type SchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'null' | 'object' | 'array';
|
|
34
|
-
export type JavaScriptPrimitiveType = 'string' | 'number' | 'boolean' | 'null' | 'undefined';
|
|
35
|
-
export type JavaScriptType = 'string' | 'number' | 'boolean' | 'null' | 'undefined' | 'object' | 'array' | 'map' | 'set' | 'arguments' | 'date' | 'error' | 'function' | 'json' | 'math' | 'regexp';
|
|
36
|
-
export type PrimitiveValue = string | number | boolean | null | undefined;
|
|
37
|
-
export interface PlainObject {
|
|
38
|
-
[k: string]: any;
|
|
39
|
-
}
|
|
40
|
-
export type IValidatorFn = (c: AbstractControl, i?: boolean) => PlainObject;
|
|
41
|
-
export type AsyncIValidatorFn = (c: AbstractControl, i?: boolean) => any;
|
|
42
|
-
/**
|
|
43
|
-
* '_executeValidators' utility function
|
|
44
|
-
*
|
|
45
|
-
* Validates a control against an array of validators, and returns
|
|
46
|
-
* an array of the same length containing a combination of error messages
|
|
47
|
-
* (from invalid validators) and null values (from valid validators)
|
|
48
|
-
*
|
|
49
|
-
* // { AbstractControl } control - control to validate
|
|
50
|
-
* // { IValidatorFn[] } validators - array of validators
|
|
51
|
-
* // { boolean } invert - invert?
|
|
52
|
-
* // { PlainObject[] } - array of nulls and error message
|
|
53
|
-
*/
|
|
54
|
-
export declare function _executeValidators(control: any, validators: any, invert?: boolean): any;
|
|
55
|
-
/**
|
|
56
|
-
* '_executeAsyncValidators' utility function
|
|
57
|
-
*
|
|
58
|
-
* Validates a control against an array of async validators, and returns
|
|
59
|
-
* an array of observabe results of the same length containing a combination of
|
|
60
|
-
* error messages (from invalid validators) and null values (from valid ones)
|
|
61
|
-
*
|
|
62
|
-
* // { AbstractControl } control - control to validate
|
|
63
|
-
* // { AsyncIValidatorFn[] } validators - array of async validators
|
|
64
|
-
* // { boolean } invert - invert?
|
|
65
|
-
* // - array of observable nulls and error message
|
|
66
|
-
*/
|
|
67
|
-
export declare function _executeAsyncValidators(control: any, validators: any, invert?: boolean): any;
|
|
68
|
-
/**
|
|
69
|
-
* '_mergeObjects' utility function
|
|
70
|
-
*
|
|
71
|
-
* Recursively Merges one or more objects into a single object with combined keys.
|
|
72
|
-
* Automatically detects and ignores null and undefined inputs.
|
|
73
|
-
* Also detects duplicated boolean 'not' keys and XORs their values.
|
|
74
|
-
*
|
|
75
|
-
* // { PlainObject[] } objects - one or more objects to merge
|
|
76
|
-
* // { PlainObject } - merged object
|
|
77
|
-
*/
|
|
78
|
-
export declare function _mergeObjects(...objects: any[]): PlainObject;
|
|
79
|
-
/**
|
|
80
|
-
* '_mergeErrors' utility function
|
|
81
|
-
*
|
|
82
|
-
* Merges an array of objects.
|
|
83
|
-
* Used for combining the validator errors returned from 'executeValidators'
|
|
84
|
-
*
|
|
85
|
-
* // { PlainObject[] } arrayOfErrors - array of objects
|
|
86
|
-
* // { PlainObject } - merged object, or null if no usable input objectcs
|
|
87
|
-
*/
|
|
88
|
-
export declare function _mergeErrors(arrayOfErrors: any): PlainObject;
|
|
89
|
-
/**
|
|
90
|
-
* 'isDefined' utility function
|
|
91
|
-
*
|
|
92
|
-
* Checks if a variable contains a value of any type.
|
|
93
|
-
* Returns true even for otherwise 'falsey' values of 0, '', and false.
|
|
94
|
-
*
|
|
95
|
-
* // value - the value to check
|
|
96
|
-
* // { boolean } - false if undefined or null, otherwise true
|
|
97
|
-
*/
|
|
98
|
-
export declare function isDefined(value: any): boolean;
|
|
99
|
-
/**
|
|
100
|
-
* 'hasValue' utility function
|
|
101
|
-
*
|
|
102
|
-
* Checks if a variable contains a value.
|
|
103
|
-
* Returs false for null, undefined, or a zero-length strng, '',
|
|
104
|
-
* otherwise returns true.
|
|
105
|
-
* (Stricter than 'isDefined' because it also returns false for '',
|
|
106
|
-
* though it stil returns true for otherwise 'falsey' values 0 and false.)
|
|
107
|
-
*
|
|
108
|
-
* // value - the value to check
|
|
109
|
-
* // { boolean } - false if undefined, null, or '', otherwise true
|
|
110
|
-
*/
|
|
111
|
-
export declare function hasValue(value: any): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* 'isEmpty' utility function
|
|
114
|
-
*
|
|
115
|
-
* Similar to !hasValue, but also returns true for empty arrays and objects.
|
|
116
|
-
*
|
|
117
|
-
* // value - the value to check
|
|
118
|
-
* // { boolean } - false if undefined, null, or '', otherwise true
|
|
119
|
-
*/
|
|
120
|
-
export declare function isEmpty(value: any): boolean;
|
|
121
|
-
/**
|
|
122
|
-
* 'isString' utility function
|
|
123
|
-
*
|
|
124
|
-
* Checks if a value is a string.
|
|
125
|
-
*
|
|
126
|
-
* // value - the value to check
|
|
127
|
-
* // { boolean } - true if string, false if not
|
|
128
|
-
*/
|
|
129
|
-
export declare function isString(value: any): value is string;
|
|
130
|
-
/**
|
|
131
|
-
* 'isNumber' utility function
|
|
132
|
-
*
|
|
133
|
-
* Checks if a value is a regular number, numeric string, or JavaScript Date.
|
|
134
|
-
*
|
|
135
|
-
* // value - the value to check
|
|
136
|
-
* // { any = false } strict - if truthy, also checks JavaScript tyoe
|
|
137
|
-
* // { boolean } - true if number, false if not
|
|
138
|
-
*/
|
|
139
|
-
export declare function isNumber(value: any, strict?: any): boolean;
|
|
140
|
-
/**
|
|
141
|
-
* 'isInteger' utility function
|
|
142
|
-
*
|
|
143
|
-
* Checks if a value is an integer.
|
|
144
|
-
*
|
|
145
|
-
* // value - the value to check
|
|
146
|
-
* // { any = false } strict - if truthy, also checks JavaScript tyoe
|
|
147
|
-
* // {boolean } - true if number, false if not
|
|
148
|
-
*/
|
|
149
|
-
export declare function isInteger(value: any, strict?: any): boolean;
|
|
150
|
-
/**
|
|
151
|
-
* 'isBoolean' utility function
|
|
152
|
-
*
|
|
153
|
-
* Checks if a value is a boolean.
|
|
154
|
-
*
|
|
155
|
-
* // value - the value to check
|
|
156
|
-
* // { any = null } option - if 'strict', also checks JavaScript type
|
|
157
|
-
* if TRUE or FALSE, checks only for that value
|
|
158
|
-
* // { boolean } - true if boolean, false if not
|
|
159
|
-
*/
|
|
160
|
-
export declare function isBoolean(value: any, option?: any): boolean;
|
|
161
|
-
export declare function isFunction(item: any): boolean;
|
|
162
|
-
export declare function isObject(item: any): boolean;
|
|
163
|
-
export declare function isArray(item: any): boolean;
|
|
164
|
-
export declare function isDate(item: any): boolean;
|
|
165
|
-
export declare function isMap(item: any): boolean;
|
|
166
|
-
export declare function isSet(item: any): boolean;
|
|
167
|
-
export declare function isSymbol(item: any): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* 'getType' function
|
|
170
|
-
*
|
|
171
|
-
* Detects the JSON Schema Type of a value.
|
|
172
|
-
* By default, detects numbers and integers even if formatted as strings.
|
|
173
|
-
* (So all integers are also numbers, and any number may also be a string.)
|
|
174
|
-
* However, it only detects true boolean values (to detect boolean values
|
|
175
|
-
* in non-boolean formats, use isBoolean() instead).
|
|
176
|
-
*
|
|
177
|
-
* If passed a second optional parameter of 'strict', it will only detect
|
|
178
|
-
* numbers and integers if they are formatted as JavaScript numbers.
|
|
179
|
-
*
|
|
180
|
-
* Examples:
|
|
181
|
-
* getType('10.5') = 'number'
|
|
182
|
-
* getType(10.5) = 'number'
|
|
183
|
-
* getType('10') = 'integer'
|
|
184
|
-
* getType(10) = 'integer'
|
|
185
|
-
* getType('true') = 'string'
|
|
186
|
-
* getType(true) = 'boolean'
|
|
187
|
-
* getType(null) = 'null'
|
|
188
|
-
* getType({ }) = 'object'
|
|
189
|
-
* getType([]) = 'array'
|
|
190
|
-
*
|
|
191
|
-
* getType('10.5', 'strict') = 'string'
|
|
192
|
-
* getType(10.5, 'strict') = 'number'
|
|
193
|
-
* getType('10', 'strict') = 'string'
|
|
194
|
-
* getType(10, 'strict') = 'integer'
|
|
195
|
-
* getType('true', 'strict') = 'string'
|
|
196
|
-
* getType(true, 'strict') = 'boolean'
|
|
197
|
-
*
|
|
198
|
-
* // value - value to check
|
|
199
|
-
* // { any = false } strict - if truthy, also checks JavaScript tyoe
|
|
200
|
-
* // { SchemaType }
|
|
201
|
-
*/
|
|
202
|
-
export declare function getType(value: any, strict?: any): "string" | "number" | "integer" | "boolean" | "null" | "object" | "array";
|
|
203
|
-
/**
|
|
204
|
-
* 'isType' function
|
|
205
|
-
*
|
|
206
|
-
* Checks wether an input (probably string) value contains data of
|
|
207
|
-
* a specified JSON Schema type
|
|
208
|
-
*
|
|
209
|
-
* // { PrimitiveValue } value - value to check
|
|
210
|
-
* // { SchemaPrimitiveType } type - type to check
|
|
211
|
-
* // { boolean }
|
|
212
|
-
*/
|
|
213
|
-
export declare function isType(value: any, type: any): boolean;
|
|
214
|
-
/**
|
|
215
|
-
* 'isPrimitive' function
|
|
216
|
-
*
|
|
217
|
-
* Checks wether an input value is a JavaScript primitive type:
|
|
218
|
-
* string, number, boolean, or null.
|
|
219
|
-
*
|
|
220
|
-
* // value - value to check
|
|
221
|
-
* // { boolean }
|
|
222
|
-
*/
|
|
223
|
-
export declare function isPrimitive(value: any): boolean;
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
* @param date
|
|
227
|
-
* @returns {string}
|
|
228
|
-
* exmaple:
|
|
229
|
-
* toDateString('2018-01-01') = '2018-01-01'
|
|
230
|
-
* toDateString('2018-01-30T00:00:00.000Z') = '2018-01-30'
|
|
231
|
-
*/
|
|
232
|
-
export declare const toIsoString: (date: Date) => string;
|
|
233
|
-
/**
|
|
234
|
-
* 'toJavaScriptType' function
|
|
235
|
-
*
|
|
236
|
-
* Converts an input (probably string) value to a JavaScript primitive type -
|
|
237
|
-
* 'string', 'number', 'boolean', or 'null' - before storing in a JSON object.
|
|
238
|
-
*
|
|
239
|
-
* Does not coerce values (other than null), and only converts the types
|
|
240
|
-
* of values that would otherwise be valid.
|
|
241
|
-
*
|
|
242
|
-
* If the optional third parameter 'strictIntegers' is TRUE, and the
|
|
243
|
-
* JSON Schema type 'integer' is specified, it also verifies the input value
|
|
244
|
-
* is an integer and, if it is, returns it as a JaveScript number.
|
|
245
|
-
* If 'strictIntegers' is FALSE (or not set) the type 'integer' is treated
|
|
246
|
-
* exactly the same as 'number', and allows decimals.
|
|
247
|
-
*
|
|
248
|
-
* Valid Examples:
|
|
249
|
-
* toJavaScriptType('10', 'number' ) = 10 // '10' is a number
|
|
250
|
-
* toJavaScriptType('10', 'integer') = 10 // '10' is also an integer
|
|
251
|
-
* toJavaScriptType( 10, 'integer') = 10 // 10 is still an integer
|
|
252
|
-
* toJavaScriptType( 10, 'string' ) = '10' // 10 can be made into a string
|
|
253
|
-
* toJavaScriptType('10.5', 'number' ) = 10.5 // '10.5' is a number
|
|
254
|
-
*
|
|
255
|
-
* Invalid Examples:
|
|
256
|
-
* toJavaScriptType('10.5', 'integer') = null // '10.5' is not an integer
|
|
257
|
-
* toJavaScriptType( 10.5, 'integer') = null // 10.5 is still not an integer
|
|
258
|
-
*
|
|
259
|
-
* // { PrimitiveValue } value - value to convert
|
|
260
|
-
* // { SchemaPrimitiveType | SchemaPrimitiveType[] } types - types to convert to
|
|
261
|
-
* // { boolean = false } strictIntegers - if FALSE, treat integers as numbers
|
|
262
|
-
* // { PrimitiveValue }
|
|
263
|
-
*/
|
|
264
|
-
export declare function toJavaScriptType(value: any, types: any, strictIntegers?: boolean): any;
|
|
265
|
-
/**
|
|
266
|
-
* 'toSchemaType' function
|
|
267
|
-
*
|
|
268
|
-
* Converts an input (probably string) value to the "best" JavaScript
|
|
269
|
-
* equivalent available from an allowed list of JSON Schema types, which may
|
|
270
|
-
* contain 'string', 'number', 'integer', 'boolean', and/or 'null'.
|
|
271
|
-
* If necssary, it does progressively agressive type coersion.
|
|
272
|
-
* It will not return null unless null is in the list of allowed types.
|
|
273
|
-
*
|
|
274
|
-
* Number conversion examples:
|
|
275
|
-
* toSchemaType('10', ['number','integer','string']) = 10 // integer
|
|
276
|
-
* toSchemaType('10', ['number','string']) = 10 // number
|
|
277
|
-
* toSchemaType('10', ['string']) = '10' // string
|
|
278
|
-
* toSchemaType('10.5', ['number','integer','string']) = 10.5 // number
|
|
279
|
-
* toSchemaType('10.5', ['integer','string']) = '10.5' // string
|
|
280
|
-
* toSchemaType('10.5', ['integer']) = 10 // integer
|
|
281
|
-
* toSchemaType(10.5, ['null','boolean','string']) = '10.5' // string
|
|
282
|
-
* toSchemaType(10.5, ['null','boolean']) = true // boolean
|
|
283
|
-
*
|
|
284
|
-
* String conversion examples:
|
|
285
|
-
* toSchemaType('1.5x', ['boolean','number','integer','string']) = '1.5x' // string
|
|
286
|
-
* toSchemaType('1.5x', ['boolean','number','integer']) = '1.5' // number
|
|
287
|
-
* toSchemaType('1.5x', ['boolean','integer']) = '1' // integer
|
|
288
|
-
* toSchemaType('1.5x', ['boolean']) = true // boolean
|
|
289
|
-
* toSchemaType('xyz', ['number','integer','boolean','null']) = true // boolean
|
|
290
|
-
* toSchemaType('xyz', ['number','integer','null']) = null // null
|
|
291
|
-
* toSchemaType('xyz', ['number','integer']) = 0 // number
|
|
292
|
-
*
|
|
293
|
-
* Boolean conversion examples:
|
|
294
|
-
* toSchemaType('1', ['integer','number','string','boolean']) = 1 // integer
|
|
295
|
-
* toSchemaType('1', ['number','string','boolean']) = 1 // number
|
|
296
|
-
* toSchemaType('1', ['string','boolean']) = '1' // string
|
|
297
|
-
* toSchemaType('1', ['boolean']) = true // boolean
|
|
298
|
-
* toSchemaType('true', ['number','string','boolean']) = 'true' // string
|
|
299
|
-
* toSchemaType('true', ['boolean']) = true // boolean
|
|
300
|
-
* toSchemaType('true', ['number']) = 0 // number
|
|
301
|
-
* toSchemaType(true, ['number','string','boolean']) = true // boolean
|
|
302
|
-
* toSchemaType(true, ['number','string']) = 'true' // string
|
|
303
|
-
* toSchemaType(true, ['number']) = 1 // number
|
|
304
|
-
*
|
|
305
|
-
* // { PrimitiveValue } value - value to convert
|
|
306
|
-
* // { SchemaPrimitiveType | SchemaPrimitiveType[] } types - allowed types to convert to
|
|
307
|
-
* // { PrimitiveValue }
|
|
308
|
-
*/
|
|
309
|
-
export declare function toSchemaType(value: any, types: any): any;
|
|
310
|
-
/**
|
|
311
|
-
* 'isPromise' function
|
|
312
|
-
*
|
|
313
|
-
* // object
|
|
314
|
-
* // { boolean }
|
|
315
|
-
*/
|
|
316
|
-
export declare function isPromise(object: any): object is Promise<any>;
|
|
317
|
-
/**
|
|
318
|
-
* 'isObservable' function
|
|
319
|
-
*
|
|
320
|
-
* // object
|
|
321
|
-
* // { boolean }
|
|
322
|
-
*/
|
|
323
|
-
export declare function isObservable(object: any): object is Observable<any>;
|
|
324
|
-
/**
|
|
325
|
-
* '_toPromise' function
|
|
326
|
-
*
|
|
327
|
-
* // { object } object
|
|
328
|
-
* // { Promise<any> }
|
|
329
|
-
*/
|
|
330
|
-
export declare function _toPromise(object: any): Promise<any>;
|
|
331
|
-
/**
|
|
332
|
-
* 'toObservable' function
|
|
333
|
-
*
|
|
334
|
-
* // { object } object
|
|
335
|
-
* // { Observable<any> }
|
|
336
|
-
*/
|
|
337
|
-
export declare function toObservable(object: any): Observable<any>;
|
|
338
|
-
/**
|
|
339
|
-
* 'inArray' function
|
|
340
|
-
*
|
|
341
|
-
* Searches an array for an item, or one of a list of items, and returns true
|
|
342
|
-
* as soon as a match is found, or false if no match.
|
|
343
|
-
*
|
|
344
|
-
* If the optional third parameter allIn is set to TRUE, and the item to find
|
|
345
|
-
* is an array, then the function returns true only if all elements from item
|
|
346
|
-
* are found in the array list, and false if any element is not found. If the
|
|
347
|
-
* item to find is not an array, setting allIn to TRUE has no effect.
|
|
348
|
-
*
|
|
349
|
-
* // { any|any[] } item - the item to search for
|
|
350
|
-
* // array - the array to search
|
|
351
|
-
* // { boolean = false } allIn - if TRUE, all items must be in array
|
|
352
|
-
* // { boolean } - true if item(s) in array, false otherwise
|
|
353
|
-
*/
|
|
354
|
-
export declare function inArray(item: any, array: any, allIn?: boolean): any;
|
|
355
|
-
/**
|
|
356
|
-
* 'xor' utility function - exclusive or
|
|
357
|
-
*
|
|
358
|
-
* Returns true if exactly one of two values is truthy.
|
|
359
|
-
*
|
|
360
|
-
* // value1 - first value to check
|
|
361
|
-
* // value2 - second value to check
|
|
362
|
-
* // { boolean } - true if exactly one input value is truthy, false if not
|
|
363
|
-
*/
|
|
364
|
-
export declare function xor(value1: any, value2: any): boolean;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class AddReferenceComponent implements OnInit {
|
|
4
|
-
private jsf;
|
|
5
|
-
options: any;
|
|
6
|
-
itemCount: number;
|
|
7
|
-
previousLayoutIndex: number[];
|
|
8
|
-
previousDataIndex: number[];
|
|
9
|
-
readonly layoutNode: import("@angular/core").InputSignal<any>;
|
|
10
|
-
readonly layoutIndex: import("@angular/core").InputSignal<number[]>;
|
|
11
|
-
readonly dataIndex: import("@angular/core").InputSignal<number[]>;
|
|
12
|
-
ngOnInit(): void;
|
|
13
|
-
get showAddButton(): boolean;
|
|
14
|
-
addItem(event: any): void;
|
|
15
|
-
get buttonText(): string;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AddReferenceComponent, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AddReferenceComponent, "add-reference-widget", 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>;
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { AbstractControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ButtonComponent implements OnInit, OnDestroy {
|
|
5
|
-
private jsf;
|
|
6
|
-
formControl: AbstractControl;
|
|
7
|
-
controlName: string;
|
|
8
|
-
controlValue: any;
|
|
9
|
-
controlDisabled: boolean;
|
|
10
|
-
boundControl: boolean;
|
|
11
|
-
options: any;
|
|
12
|
-
readonly layoutNode: import("@angular/core").InputSignal<any>;
|
|
13
|
-
readonly layoutIndex: import("@angular/core").InputSignal<number[]>;
|
|
14
|
-
readonly dataIndex: import("@angular/core").InputSignal<number[]>;
|
|
15
|
-
ngOnInit(): void;
|
|
16
|
-
updateValue(event: any): void;
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "button-widget", 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>;
|
|
20
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { AbstractControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CheckboxComponent implements OnInit, OnDestroy {
|
|
5
|
-
private jsf;
|
|
6
|
-
formControl: AbstractControl;
|
|
7
|
-
controlName: string;
|
|
8
|
-
controlValue: any;
|
|
9
|
-
controlDisabled: boolean;
|
|
10
|
-
boundControl: boolean;
|
|
11
|
-
options: any;
|
|
12
|
-
trueValue: any;
|
|
13
|
-
falseValue: any;
|
|
14
|
-
readonly layoutNode: import("@angular/core").InputSignal<any>;
|
|
15
|
-
readonly layoutIndex: import("@angular/core").InputSignal<number[]>;
|
|
16
|
-
readonly dataIndex: import("@angular/core").InputSignal<number[]>;
|
|
17
|
-
ngOnInit(): void;
|
|
18
|
-
updateValue(event: any): void;
|
|
19
|
-
get isChecked(): boolean;
|
|
20
|
-
ngOnDestroy(): void;
|
|
21
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxComponent, never>;
|
|
22
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxComponent, "checkbox-widget", 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>;
|
|
23
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { AbstractControl } from '@angular/forms';
|
|
3
|
-
import { TitleMapItem } from '../json-schema-form.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class CheckboxesComponent implements OnInit, OnDestroy {
|
|
6
|
-
private jsf;
|
|
7
|
-
formControl: AbstractControl;
|
|
8
|
-
controlName: string;
|
|
9
|
-
controlValue: any;
|
|
10
|
-
controlDisabled: boolean;
|
|
11
|
-
boundControl: boolean;
|
|
12
|
-
options: any;
|
|
13
|
-
layoutOrientation: string;
|
|
14
|
-
formArray: AbstractControl;
|
|
15
|
-
checkboxList: TitleMapItem[];
|
|
16
|
-
readonly layoutNode: import("@angular/core").InputSignal<any>;
|
|
17
|
-
readonly layoutIndex: import("@angular/core").InputSignal<number[]>;
|
|
18
|
-
readonly dataIndex: import("@angular/core").InputSignal<number[]>;
|
|
19
|
-
ngOnInit(): void;
|
|
20
|
-
updateValue(event: any): void;
|
|
21
|
-
ngOnDestroy(): void;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxesComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CheckboxesComponent, "checkboxes-widget", 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>;
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ElementRef, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ElementAttributeDirective {
|
|
4
|
-
private renderer;
|
|
5
|
-
private elementRef;
|
|
6
|
-
attributes: {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
9
|
-
constructor(renderer: Renderer2, elementRef: ElementRef);
|
|
10
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
11
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ElementAttributeDirective, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ElementAttributeDirective, "[attributes]", never, { "attributes": { "alias": "attributes"; "required": false; }; }, {}, never, never, false, never>;
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { AbstractControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class FileComponent implements OnInit, OnDestroy {
|
|
5
|
-
private jsf;
|
|
6
|
-
formControl: AbstractControl;
|
|
7
|
-
controlName: string;
|
|
8
|
-
controlValue: any;
|
|
9
|
-
controlDisabled: boolean;
|
|
10
|
-
boundControl: boolean;
|
|
11
|
-
options: any;
|
|
12
|
-
readonly layoutNode: import("@angular/core").InputSignal<any>;
|
|
13
|
-
readonly layoutIndex: import("@angular/core").InputSignal<number[]>;
|
|
14
|
-
readonly dataIndex: import("@angular/core").InputSignal<number[]>;
|
|
15
|
-
ngOnInit(): void;
|
|
16
|
-
updateValue(event: any): void;
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FileComponent, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileComponent, "file-widget", 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>;
|
|
20
|
-
}
|