@bolttech/form-engine-core 1.0.2-beta.1 → 1.0.2
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/index.d.ts +2314 -0
- package/index.esm.js +131 -81
- package/package.json +9 -10
- package/index.esm.d.ts +0 -1
- package/src/constants/constants.d.ts +0 -10
- package/src/formatters/creditCard.d.ts +0 -23
- package/src/formatters/custom.d.ts +0 -29
- package/src/formatters/handler.d.ts +0 -2
- package/src/formatters/regex.d.ts +0 -47
- package/src/formatters/splitter.d.ts +0 -17
- package/src/formatters/string.d.ts +0 -88
- package/src/helpers/SafeSubject.d.ts +0 -11
- package/src/helpers/creditCard.d.ts +0 -95
- package/src/helpers/helpers.d.ts +0 -67
- package/src/helpers/validation.d.ts +0 -27
- package/src/index.d.ts +0 -10
- package/src/interfaces/schema.d.ts +0 -112
- package/src/interfaces/state.d.ts +0 -22
- package/src/managers/field.d.ts +0 -326
- package/src/managers/form.d.ts +0 -346
- package/src/managers/formGroup.d.ts +0 -110
- package/src/managers/index.d.ts +0 -3
- package/src/masks/creditCard.d.ts +0 -60
- package/src/masks/generic.d.ts +0 -39
- package/src/masks/handler.d.ts +0 -2
- package/src/masks/string.d.ts +0 -99
- package/src/types/event.d.ts +0 -109
- package/src/types/form.d.ts +0 -55
- package/src/types/mapper.d.ts +0 -95
- package/src/types/schema.d.ts +0 -835
- package/src/types/template.d.ts +0 -50
- package/src/types/utility.d.ts +0 -6
- package/src/validations/creditCard.d.ts +0 -52
- package/src/validations/custom.d.ts +0 -25
- package/src/validations/date.d.ts +0 -79
- package/src/validations/document.d.ts +0 -25
- package/src/validations/handler.d.ts +0 -2
- package/src/validations/length.d.ts +0 -39
- package/src/validations/list.d.ts +0 -32
- package/src/validations/logical.d.ts +0 -75
- package/src/validations/multiple.d.ts +0 -31
- package/src/validations/namedRule.d.ts +0 -22
- package/src/validations/number.d.ts +0 -145
- package/src/validations/object.d.ts +0 -44
- package/src/validations/regex.d.ts +0 -217
- package/src/validations/string.d.ts +0 -53
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { TValidationMethods } from '../types/schema';
|
|
2
|
-
/**
|
|
3
|
-
* Validates if a value matches a given regular expression.
|
|
4
|
-
*
|
|
5
|
-
* @param value - The value to be checked.
|
|
6
|
-
* @param validations - An object containing the regex pattern for validation.
|
|
7
|
-
* @returns `true` if the value does not match the regex, otherwise `false`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { regex } from './path/to/validationFunctions';
|
|
12
|
-
*
|
|
13
|
-
* const validations = { regex: '^[a-zA-Z0-9]*$' };
|
|
14
|
-
*
|
|
15
|
-
* const isValid = regex('abc123', validations);
|
|
16
|
-
* console.log(isValid); // Output: false
|
|
17
|
-
*
|
|
18
|
-
* // Using from a JSON config
|
|
19
|
-
* const config = {
|
|
20
|
-
* inputValue: 'abc123',
|
|
21
|
-
* validations: { regex: '^[a-zA-Z0-9]*$' }
|
|
22
|
-
* };
|
|
23
|
-
*
|
|
24
|
-
* const isValid = regex(config.inputValue, config.validations);
|
|
25
|
-
* console.log(isValid); // Output: false
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare const regex: (value: unknown, validations: TValidationMethods) => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Validates if a value is a valid email address.
|
|
31
|
-
*
|
|
32
|
-
* @param value - The value to be checked.
|
|
33
|
-
* @param validations - An object containing the email validation flag.
|
|
34
|
-
* @returns `true` if the value is not a valid email, otherwise `false`.
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* import { email } from './path/to/validationFunctions';
|
|
39
|
-
*
|
|
40
|
-
* const validations = { email: true };
|
|
41
|
-
*
|
|
42
|
-
* const isValid = email('test@example.com', validations);
|
|
43
|
-
* console.log(isValid); // Output: false
|
|
44
|
-
*
|
|
45
|
-
* // Using from a JSON config
|
|
46
|
-
* const config = {
|
|
47
|
-
* inputValue: 'invalid-email',
|
|
48
|
-
* validations: { email: true }
|
|
49
|
-
* };
|
|
50
|
-
*
|
|
51
|
-
* const isValid = email(config.inputValue, config.validations);
|
|
52
|
-
* console.log(isValid); // Output: true
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
export declare const email: (value: unknown, validations: TValidationMethods) => boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Validates if a value is a valid URL.
|
|
58
|
-
*
|
|
59
|
-
* @param value - The value to be checked.
|
|
60
|
-
* @param validations - An object containing the URL validation flag.
|
|
61
|
-
* @returns `true` if the value is not a valid URL, otherwise `false`.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```typescript
|
|
65
|
-
* import { url } from './path/to/validationFunctions';
|
|
66
|
-
*
|
|
67
|
-
* const validations = { url: true };
|
|
68
|
-
*
|
|
69
|
-
* const isValid = url('https://example.com', validations);
|
|
70
|
-
* console.log(isValid); // Output: false
|
|
71
|
-
*
|
|
72
|
-
* // Using from a JSON config
|
|
73
|
-
* const config = {
|
|
74
|
-
* inputValue: 'invalid-url',
|
|
75
|
-
* validations: { url: true }
|
|
76
|
-
* };
|
|
77
|
-
*
|
|
78
|
-
* const isValid = url(config.inputValue, config.validations);
|
|
79
|
-
* console.log(isValid); // Output: true
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export declare const url: (value: unknown, validations: TValidationMethods) => boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Validates if a value contains only letters.
|
|
85
|
-
*
|
|
86
|
-
* @param value - The value to be checked.
|
|
87
|
-
* @param validations - An object containing the onlyLetters validation flag.
|
|
88
|
-
* @returns `true` if the value contains non-letter characters, otherwise `false`.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```typescript
|
|
92
|
-
* import { onlyLetters } from './path/to/validationFunctions';
|
|
93
|
-
*
|
|
94
|
-
* const validations = { onlyLetters: true };
|
|
95
|
-
*
|
|
96
|
-
* const isValid = onlyLetters('abc', validations);
|
|
97
|
-
* console.log(isValid); // Output: false
|
|
98
|
-
*
|
|
99
|
-
* // Using from a JSON config
|
|
100
|
-
* const config = {
|
|
101
|
-
* inputValue: '123',
|
|
102
|
-
* validations: { onlyLetters: true }
|
|
103
|
-
* };
|
|
104
|
-
*
|
|
105
|
-
* const isValid = onlyLetters(config.inputValue, config.validations);
|
|
106
|
-
* console.log(isValid); // Output: true
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
export declare const onlyLetters: (value: unknown, validations: TValidationMethods) => boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Validates if a value does not contain spaces.
|
|
112
|
-
*
|
|
113
|
-
* @param value - The value to be checked.
|
|
114
|
-
* @param validations - An object containing the notAllowSpaces validation flag.
|
|
115
|
-
* @returns `true` if the value contains spaces, otherwise `false`.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```typescript
|
|
119
|
-
* import { notAllowSpaces } from './path/to/validationFunctions';
|
|
120
|
-
*
|
|
121
|
-
* const validations = { notAllowSpaces: true };
|
|
122
|
-
*
|
|
123
|
-
* const isValid = notAllowSpaces('no spaces', validations);
|
|
124
|
-
* console.log(isValid); // Output: true
|
|
125
|
-
*
|
|
126
|
-
* // Using from a JSON config
|
|
127
|
-
* const config = {
|
|
128
|
-
* inputValue: 'nospaces',
|
|
129
|
-
* validations: { notAllowSpaces: true }
|
|
130
|
-
* };
|
|
131
|
-
*
|
|
132
|
-
* const isValid = notAllowSpaces(config.inputValue, config.validations);
|
|
133
|
-
* console.log(isValid); // Output: false
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
export declare const notAllowSpaces: (value: unknown, validations: TValidationMethods) => boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Validates if a value is a number.
|
|
139
|
-
*
|
|
140
|
-
* @param value - The value to be checked.
|
|
141
|
-
* @param validations - An object containing the isNumber validation flag.
|
|
142
|
-
* @returns `true` if the value is not a number, otherwise `false`.
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```typescript
|
|
146
|
-
* import { isNumber } from './path/to/validationFunctions';
|
|
147
|
-
*
|
|
148
|
-
* const validations = { isNumber: true };
|
|
149
|
-
*
|
|
150
|
-
* const isValid = isNumber('123', validations);
|
|
151
|
-
* console.log(isValid); // Output: false
|
|
152
|
-
*
|
|
153
|
-
* // Using from a JSON config
|
|
154
|
-
* const config = {
|
|
155
|
-
* inputValue: 'abc',
|
|
156
|
-
* validations: { isNumber: true }
|
|
157
|
-
* };
|
|
158
|
-
*
|
|
159
|
-
* const isValid = isNumber(config.inputValue, config.validations);
|
|
160
|
-
* console.log(isValid); // Output: true
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
export declare const isNumber: (value: unknown, validations: TValidationMethods) => boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Validates if a value has no trailing or leading spaces.
|
|
166
|
-
*
|
|
167
|
-
* @param value - The value to be checked.
|
|
168
|
-
* @param validations - An object containing the hasNoExtraSpaces validation flag.
|
|
169
|
-
* @returns `true` if the value has trailing or leading spaces, otherwise `false`.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```typescript
|
|
173
|
-
* import { hasNoExtraSpaces } from './path/to/validationFunctions';
|
|
174
|
-
*
|
|
175
|
-
* const validations = { hasNoExtraSpaces: true };
|
|
176
|
-
*
|
|
177
|
-
* const isValid = hasNoExtraSpaces('Hello', validations);
|
|
178
|
-
* console.log(isValid); // Output: true
|
|
179
|
-
*
|
|
180
|
-
* // Using from a JSON config
|
|
181
|
-
* const config = {
|
|
182
|
-
* inputValue: ' Hello ',
|
|
183
|
-
* validations: { hasNoExtraSpaces: true }
|
|
184
|
-
* };
|
|
185
|
-
*
|
|
186
|
-
* const isValid = hasNoExtraSpaces(config.inputValue, config.validations);
|
|
187
|
-
* console.log(isValid); // Output: false
|
|
188
|
-
* ```
|
|
189
|
-
*/
|
|
190
|
-
export declare const hasNoExtraSpaces: (value: unknown, validations: TValidationMethods) => boolean;
|
|
191
|
-
/**
|
|
192
|
-
* Validates if a value contains repeated digits.
|
|
193
|
-
*
|
|
194
|
-
* @param value - The value to be checked.
|
|
195
|
-
* @param validations - An object containing the repeated validation flag.
|
|
196
|
-
* @returns `true` if the value contains repeated digits, otherwise `false`.
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* ```typescript
|
|
200
|
-
* import { repeated } from './path/to/validationFunctions';
|
|
201
|
-
*
|
|
202
|
-
* const validations = { repeated: true };
|
|
203
|
-
*
|
|
204
|
-
* const isValid = repeated('1231', validations);
|
|
205
|
-
* console.log(isValid); // Output: true
|
|
206
|
-
*
|
|
207
|
-
* // Using from a JSON config
|
|
208
|
-
* const config = {
|
|
209
|
-
* inputValue: '1234',
|
|
210
|
-
* validations: { repeated: true }
|
|
211
|
-
* };
|
|
212
|
-
*
|
|
213
|
-
* const isValid = repeated(config.inputValue, config.validations);
|
|
214
|
-
* console.log(isValid); // Output: false
|
|
215
|
-
* ```
|
|
216
|
-
*/
|
|
217
|
-
export declare const repeated: (value: unknown, validations: TValidationMethods) => boolean;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { TValidationMethods } from '../types/schema';
|
|
2
|
-
/**
|
|
3
|
-
* Validates that a string value is not empty.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} value - The value to be validated.
|
|
6
|
-
* @param {TValidationMethods} validations - The validation methods object containing the notEmpty validation rule.
|
|
7
|
-
* @returns {boolean} - Returns `true` if the value is empty and the notEmpty validation rule is set, otherwise `false`.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // Assume validations is an object with a notEmpty property
|
|
12
|
-
* const validations = { notEmpty: true };
|
|
13
|
-
*
|
|
14
|
-
* // Returns true because the string is empty
|
|
15
|
-
* const result1 = notEmpty('', validations);
|
|
16
|
-
* console.log(result1); // true
|
|
17
|
-
*
|
|
18
|
-
* // Returns false because the string is not empty
|
|
19
|
-
* const result2 = notEmpty('hello', validations);
|
|
20
|
-
* console.log(result2); // false
|
|
21
|
-
*
|
|
22
|
-
* // Returns false because the notEmpty validation rule is not set
|
|
23
|
-
* const result3 = notEmpty('', { notEmpty: false });
|
|
24
|
-
* console.log(result3); // false
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare const notEmpty: (value: unknown, validations: TValidationMethods) => boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Validates that a value matches a specified value.
|
|
30
|
-
*
|
|
31
|
-
* @param {unknown} value - The value to be validated.
|
|
32
|
-
* @param {TValidationMethods} validations - The validation methods object containing the value validation rule.
|
|
33
|
-
* @returns {boolean} - Returns `true` if the value does not match the specified validation value, otherwise `false`.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* // Assume validations is an object with a value property
|
|
38
|
-
* const validations = { value: 42 };
|
|
39
|
-
*
|
|
40
|
-
* // Returns true because the value does not match the validation value
|
|
41
|
-
* const result1 = value(10, validations);
|
|
42
|
-
* console.log(result1); // true
|
|
43
|
-
*
|
|
44
|
-
* // Returns false because the value matches the validation value
|
|
45
|
-
* const result2 = value(42, validations);
|
|
46
|
-
* console.log(result2); // false
|
|
47
|
-
*
|
|
48
|
-
* // Returns false because the value validation rule is not set
|
|
49
|
-
* const result3 = value(10, { value: undefined });
|
|
50
|
-
* console.log(result3); // false
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
export declare const value: (value: unknown, validations: TValidationMethods) => boolean;
|