@websolutespa/bom-mixer-forms 0.2.1 → 0.2.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/CHANGELOG.md +31 -25
- package/dist/index.d.ts +1 -2
- package/dist/index.js +0 -15
- package/dist/index.mjs +0 -14
- package/package.json +1 -1
- package/src/forms/utils.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
# @websolutespa/bom-mixer-forms
|
|
2
|
-
|
|
3
|
-
## 0.2.
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
## 0.2.
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
- Added:
|
|
14
|
-
|
|
15
|
-
## 0.
|
|
16
|
-
|
|
17
|
-
### Minor Changes
|
|
18
|
-
|
|
19
|
-
- Added:
|
|
20
|
-
|
|
21
|
-
## 0.0
|
|
22
|
-
|
|
23
|
-
###
|
|
24
|
-
|
|
25
|
-
- Added:
|
|
1
|
+
# @websolutespa/bom-mixer-forms
|
|
2
|
+
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Removed: unnecessary method deepCopy.
|
|
8
|
+
|
|
9
|
+
## 0.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Added: source files.
|
|
14
|
+
|
|
15
|
+
## 0.2.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- Added: splat routes.
|
|
20
|
+
|
|
21
|
+
## 0.1.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- Added: @websolutespa/bom-core.
|
|
26
|
+
|
|
27
|
+
## 0.0.2
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Added: first release.
|
package/dist/index.d.ts
CHANGED
|
@@ -236,7 +236,6 @@ declare class FormAbstract extends EventEmitter {
|
|
|
236
236
|
declare function validValue(value: any): any;
|
|
237
237
|
declare function isThenable(result: any): any;
|
|
238
238
|
declare function mapErrors_(errors: FormErrors): FormValidationError[];
|
|
239
|
-
declare function deepCopy<T>(source: T): T;
|
|
240
239
|
declare function valueToString(value: IOption | IOption[] | IEquatable | IEquatable[] | null): string | string[] | undefined;
|
|
241
240
|
declare function stringToValue(value: string | string[] | undefined, options?: IOption[], optionsExtra?: {
|
|
242
241
|
asEquatable: boolean;
|
|
@@ -303,4 +302,4 @@ declare function useForm<T, U extends (FormGroup | FormArray)>(factory: () => U,
|
|
|
303
302
|
|
|
304
303
|
declare function useFormBuilder<T, U extends (FormGroup | FormArray)>(schema: IFormBuilderSchema, deps?: DependencyList): [FormState<T>, (value: Partial<T>) => void, () => void, () => void, U];
|
|
305
304
|
|
|
306
|
-
export { ControlType, EmailValidator, FormAbstract, FormAbstractCollection, FormActivator, FormArray, FormAsyncValidator, FormCollection, FormControl, FormControls, FormErrors, FormFlags, FormGroup, FormOptions, FormState, FormValidationError, FormValidationErrors, FormValidator, IControlParam, IFormBuilderArraySchema, IFormBuilderControlSchema, IFormBuilderGroupSchema, IFormBuilderGroupValues, IFormBuilderSchema, IFormOption, MatchValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, NullValidator, PatternValidator, RequiredIfValidator, RequiredTrueValidator, RequiredValidator, StateValue, ValidationError,
|
|
305
|
+
export { ControlType, EmailValidator, FormAbstract, FormAbstractCollection, FormActivator, FormArray, FormAsyncValidator, FormCollection, FormControl, FormControls, FormErrors, FormFlags, FormGroup, FormOptions, FormState, FormValidationError, FormValidationErrors, FormValidator, IControlParam, IFormBuilderArraySchema, IFormBuilderControlSchema, IFormBuilderGroupSchema, IFormBuilderGroupValues, IFormBuilderSchema, IFormOption, MatchValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, NullValidator, PatternValidator, RequiredIfValidator, RequiredTrueValidator, RequiredValidator, StateValue, ValidationError, formArray, formControl, formGroup, isThenable, mapErrors_, stringToValue, useControl, useForm, useFormBuilder, validValue, valueToString };
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,6 @@ __export(src_exports, {
|
|
|
70
70
|
RequiredIfValidator: () => RequiredIfValidator,
|
|
71
71
|
RequiredTrueValidator: () => RequiredTrueValidator,
|
|
72
72
|
RequiredValidator: () => RequiredValidator,
|
|
73
|
-
deepCopy: () => deepCopy,
|
|
74
73
|
formArray: () => formArray,
|
|
75
74
|
formControl: () => formControl,
|
|
76
75
|
formGroup: () => formGroup,
|
|
@@ -130,19 +129,6 @@ function isThenable(result) {
|
|
|
130
129
|
function mapErrors_(errors) {
|
|
131
130
|
return Object.keys(errors).map((key) => ({ key, value: errors[key] }));
|
|
132
131
|
}
|
|
133
|
-
function deepCopy(source) {
|
|
134
|
-
if (Array.isArray(source)) {
|
|
135
|
-
return source.map((x) => deepCopy(x));
|
|
136
|
-
} else if (source && typeof source === "object") {
|
|
137
|
-
const copy = {};
|
|
138
|
-
Object.keys(source).forEach((key) => {
|
|
139
|
-
copy[key] = deepCopy(source[key]);
|
|
140
|
-
});
|
|
141
|
-
return copy;
|
|
142
|
-
} else {
|
|
143
|
-
return source;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
132
|
function valueToString(value) {
|
|
147
133
|
function mapValue(value2) {
|
|
148
134
|
const stringValue = value2 != null ? typeof value2 === "object" ? value2.id.toString() : value2.toString() : void 0;
|
|
@@ -1116,7 +1102,6 @@ function mapSchema_(schema) {
|
|
|
1116
1102
|
RequiredIfValidator,
|
|
1117
1103
|
RequiredTrueValidator,
|
|
1118
1104
|
RequiredValidator,
|
|
1119
|
-
deepCopy,
|
|
1120
1105
|
formArray,
|
|
1121
1106
|
formControl,
|
|
1122
1107
|
formGroup,
|
package/dist/index.mjs
CHANGED
|
@@ -80,19 +80,6 @@ function isThenable(result) {
|
|
|
80
80
|
function mapErrors_(errors) {
|
|
81
81
|
return Object.keys(errors).map((key) => ({ key, value: errors[key] }));
|
|
82
82
|
}
|
|
83
|
-
function deepCopy(source) {
|
|
84
|
-
if (Array.isArray(source)) {
|
|
85
|
-
return source.map((x) => deepCopy(x));
|
|
86
|
-
} else if (source && typeof source === "object") {
|
|
87
|
-
const copy = {};
|
|
88
|
-
Object.keys(source).forEach((key) => {
|
|
89
|
-
copy[key] = deepCopy(source[key]);
|
|
90
|
-
});
|
|
91
|
-
return copy;
|
|
92
|
-
} else {
|
|
93
|
-
return source;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
83
|
function valueToString(value) {
|
|
97
84
|
function mapValue(value2) {
|
|
98
85
|
const stringValue = value2 != null ? typeof value2 === "object" ? value2.id.toString() : value2.toString() : void 0;
|
|
@@ -1065,7 +1052,6 @@ export {
|
|
|
1065
1052
|
RequiredIfValidator,
|
|
1066
1053
|
RequiredTrueValidator,
|
|
1067
1054
|
RequiredValidator,
|
|
1068
|
-
deepCopy,
|
|
1069
1055
|
formArray,
|
|
1070
1056
|
formControl,
|
|
1071
1057
|
formGroup,
|
package/package.json
CHANGED
package/src/forms/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IEquatable, IOption } from '@websolutespa/bom-core';
|
|
2
|
-
import { FormErrors, FormValidationError
|
|
2
|
+
import { FormErrors, FormValidationError } from './types';
|
|
3
3
|
|
|
4
4
|
export function validValue(value: any) {
|
|
5
5
|
return value !== undefined && value !== '' ? value : null;
|
|
@@ -13,8 +13,8 @@ export function mapErrors_(errors: FormErrors): FormValidationError[] {
|
|
|
13
13
|
return Object.keys(errors).map(key => ({ key, value: errors[key] }));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/*
|
|
16
17
|
export function deepCopy<T>(source: T): T;
|
|
17
|
-
// export function deepCopy(source: any): any {
|
|
18
18
|
export function deepCopy(source: StateValue): StateValue {
|
|
19
19
|
if (Array.isArray(source)) {
|
|
20
20
|
return source.map(x => deepCopy(x));
|
|
@@ -28,6 +28,7 @@ export function deepCopy(source: StateValue): StateValue {
|
|
|
28
28
|
return source;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
*/
|
|
31
32
|
|
|
32
33
|
export function valueToString(value: IOption | IOption[] | IEquatable | IEquatable[] | null): string | string[] | undefined {
|
|
33
34
|
function mapValue(value: IOption | IEquatable | null): string | undefined {
|