@thecb/components 8.0.6-beta.5 → 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 +31 -22
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/index.d.ts +1 -1
- package/src/components/atoms/form-layouts/index.d.ts +9 -18
- 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/ErrorMessage.ts +4 -0
- 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
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
|
4
4
|
|
|
5
5
|
interface ButtonWithActionProps {
|
|
6
|
-
action?: React.
|
|
6
|
+
action?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
7
|
variant?: string;
|
|
8
8
|
text?: string;
|
|
9
9
|
textWrap?: boolean;
|
|
@@ -60,44 +60,53 @@ declare const Card: React.FC<Expand<CardProps> &
|
|
|
60
60
|
React.HTMLAttributes<HTMLElement>>;
|
|
61
61
|
|
|
62
62
|
interface ErrorMessage {
|
|
63
|
-
|
|
63
|
+
[fieldName: string]: string;
|
|
64
|
+
}
|
|
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;
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
interface FormInputProps {
|
|
67
|
-
|
|
68
|
-
|
|
80
|
+
extraStyles?: string;
|
|
81
|
+
field?: Field;
|
|
82
|
+
fieldActions?: FieldActions;
|
|
83
|
+
disabled?: boolean;
|
|
69
84
|
errorMessages?: ErrorMessage[];
|
|
70
|
-
isNum?: boolean;
|
|
71
|
-
isEmail?: boolean;
|
|
72
85
|
helperModal?: boolean;
|
|
73
|
-
|
|
74
|
-
|
|
86
|
+
isEmail?: boolean;
|
|
87
|
+
isNum?: boolean;
|
|
88
|
+
labelTextWhenNoError?: string;
|
|
75
89
|
showErrors?: boolean;
|
|
76
|
-
|
|
77
|
-
decorator?: any;
|
|
78
|
-
background?: any;
|
|
79
|
-
customHeight?: any;
|
|
80
|
-
autocomplete?: any;
|
|
81
|
-
extraStyles?: any;
|
|
82
|
-
removeFromValue?: any;
|
|
90
|
+
type?: string;
|
|
83
91
|
}
|
|
84
92
|
|
|
85
93
|
declare const FormInput: React.FC<Expand<FormInputProps> &
|
|
86
94
|
React.HTMLAttributes<HTMLElement>>;
|
|
87
95
|
|
|
88
96
|
interface Option {
|
|
89
|
-
text
|
|
90
|
-
value
|
|
97
|
+
text?: string;
|
|
98
|
+
value?: string | number;
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
interface FormSelectProps {
|
|
102
|
+
disabled?: boolean;
|
|
94
103
|
dropdownMaxHeight?: string;
|
|
95
104
|
labelTextWhenNoError?: string;
|
|
96
105
|
options?: Option[];
|
|
97
|
-
fieldActions?:
|
|
106
|
+
fieldActions?: FieldActions;
|
|
98
107
|
showErrors?: boolean;
|
|
99
|
-
errorMessages?:
|
|
100
|
-
field?:
|
|
108
|
+
errorMessages?: ErrorMessage[]
|
|
109
|
+
field?: Field
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
declare const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -454,8 +463,8 @@ declare const Paragraph: React.FC<Expand<ParagraphProps> &
|
|
|
454
463
|
React.HTMLAttributes<HTMLElement>>;
|
|
455
464
|
|
|
456
465
|
interface SpinnerProps {
|
|
457
|
-
size
|
|
458
|
-
centerSpinner
|
|
466
|
+
size?: string;
|
|
467
|
+
centerSpinner?: boolean;
|
|
459
468
|
}
|
|
460
469
|
|
|
461
470
|
declare const Spinner: React.FC<Expand<SpinnerProps> &
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
3
|
|
|
4
4
|
export interface ButtonWithActionProps {
|
|
5
|
-
action?: React.
|
|
5
|
+
action?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
6
|
variant?: string;
|
|
7
7
|
text?: string;
|
|
8
8
|
textWrap?: boolean;
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface ErrorMessage {
|
|
6
|
-
[fieldName: string]: string;
|
|
7
|
-
}
|
|
3
|
+
import { ErrorMessage, Field, FieldActions } from "../../../types/common";
|
|
8
4
|
|
|
9
5
|
export interface FormInputProps {
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
extraStyles?: string;
|
|
7
|
+
field?: Field;
|
|
8
|
+
fieldActions?: FieldActions;
|
|
9
|
+
disabled?: boolean;
|
|
12
10
|
errorMessages?: ErrorMessage[];
|
|
13
|
-
isNum?: boolean;
|
|
14
|
-
isEmail?: boolean;
|
|
15
11
|
helperModal?: boolean;
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
isEmail?: boolean;
|
|
13
|
+
isNum?: boolean;
|
|
14
|
+
labelTextWhenNoError?: string;
|
|
18
15
|
showErrors?: boolean;
|
|
19
|
-
|
|
20
|
-
decorator?: any;
|
|
21
|
-
background?: any;
|
|
22
|
-
customHeight?: any;
|
|
23
|
-
autocomplete?: any;
|
|
24
|
-
extraStyles?: any;
|
|
25
|
-
removeFromValue?: any;
|
|
16
|
+
type?: string;
|
|
26
17
|
}
|
|
27
18
|
|
|
28
19
|
export const FormInput: React.FC<Expand<FormInputProps> &
|
|
@@ -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> &
|