@thecb/components 8.0.6-beta.6 → 8.0.6-beta.7
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/dist/index.d.ts +24 -7
- package/package.json +1 -1
- package/src/components/atoms/form-layouts/index.d.ts +4 -1
- package/src/components/atoms/form-select/index.d.ts +7 -5
- package/src/components/atoms/spinner/index.d.ts +2 -2
- package/src/types/common/Field.ts +5 -0
- package/src/types/common/FieldActions.ts +6 -0
- package/src/types/common/index.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -63,7 +63,23 @@ interface ErrorMessage {
|
|
|
63
63
|
[fieldName: string]: string;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
interface Field {
|
|
67
|
+
hasErrors?: boolean;
|
|
68
|
+
dirty?: boolean;
|
|
69
|
+
rawValue?: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface FieldActions {
|
|
73
|
+
set?: (value: any) => void;
|
|
74
|
+
addValidator?: (validator: any) => void;
|
|
75
|
+
removeValidator?: (validator: any) => void;
|
|
76
|
+
clear?: () => void;
|
|
77
|
+
}
|
|
78
|
+
|
|
66
79
|
interface FormInputProps {
|
|
80
|
+
extraStyles?: string;
|
|
81
|
+
field?: Field;
|
|
82
|
+
fieldActions?: FieldActions;
|
|
67
83
|
disabled?: boolean;
|
|
68
84
|
errorMessages?: ErrorMessage[];
|
|
69
85
|
helperModal?: boolean;
|
|
@@ -78,18 +94,19 @@ declare const FormInput: React.FC<Expand<FormInputProps> &
|
|
|
78
94
|
React.HTMLAttributes<HTMLElement>>;
|
|
79
95
|
|
|
80
96
|
interface Option {
|
|
81
|
-
text
|
|
82
|
-
value
|
|
97
|
+
text?: string;
|
|
98
|
+
value?: string | number;
|
|
83
99
|
}
|
|
84
100
|
|
|
85
101
|
interface FormSelectProps {
|
|
102
|
+
disabled?: boolean;
|
|
86
103
|
dropdownMaxHeight?: string;
|
|
87
104
|
labelTextWhenNoError?: string;
|
|
88
105
|
options?: Option[];
|
|
89
|
-
fieldActions?:
|
|
106
|
+
fieldActions?: FieldActions;
|
|
90
107
|
showErrors?: boolean;
|
|
91
|
-
errorMessages?:
|
|
92
|
-
field?:
|
|
108
|
+
errorMessages?: ErrorMessage[]
|
|
109
|
+
field?: Field
|
|
93
110
|
}
|
|
94
111
|
|
|
95
112
|
declare const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -446,8 +463,8 @@ declare const Paragraph: React.FC<Expand<ParagraphProps> &
|
|
|
446
463
|
React.HTMLAttributes<HTMLElement>>;
|
|
447
464
|
|
|
448
465
|
interface SpinnerProps {
|
|
449
|
-
size
|
|
450
|
-
centerSpinner
|
|
466
|
+
size?: string;
|
|
467
|
+
centerSpinner?: boolean;
|
|
451
468
|
}
|
|
452
469
|
|
|
453
470
|
declare const Spinner: React.FC<Expand<SpinnerProps> &
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
|
-
import ErrorMessage from "../../../types/common
|
|
3
|
+
import { ErrorMessage, Field, FieldActions } from "../../../types/common";
|
|
4
4
|
|
|
5
5
|
export interface FormInputProps {
|
|
6
|
+
extraStyles?: string;
|
|
7
|
+
field?: Field;
|
|
8
|
+
fieldActions?: FieldActions;
|
|
6
9
|
disabled?: boolean;
|
|
7
10
|
errorMessages?: ErrorMessage[];
|
|
8
11
|
helperModal?: boolean;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
|
+
import { ErrorMessage, Field, FieldActions} from "../../../types/common";
|
|
3
4
|
|
|
4
5
|
interface Option {
|
|
5
|
-
text
|
|
6
|
-
value
|
|
6
|
+
text?: string;
|
|
7
|
+
value?: string | number;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export interface FormSelectProps {
|
|
11
|
+
disabled?: boolean;
|
|
10
12
|
dropdownMaxHeight?: string;
|
|
11
13
|
labelTextWhenNoError?: string;
|
|
12
14
|
options?: Option[];
|
|
13
|
-
fieldActions?:
|
|
15
|
+
fieldActions?: FieldActions;
|
|
14
16
|
showErrors?: boolean;
|
|
15
|
-
errorMessages?:
|
|
16
|
-
field?:
|
|
17
|
+
errorMessages?: ErrorMessage[]
|
|
18
|
+
field?: Field
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export const FormSelect: React.FC<Expand<FormSelectProps> &
|