@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 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: string;
82
- value: string | number;
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?: any;
106
+ fieldActions?: FieldActions;
90
107
  showErrors?: boolean;
91
- errorMessages?: any;
92
- field?: any;
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: string;
450
- centerSpinner: boolean;
466
+ size?: string;
467
+ centerSpinner?: boolean;
451
468
  }
452
469
 
453
470
  declare const Spinner: React.FC<Expand<SpinnerProps> &
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "8.0.6-beta.6",
3
+ "version": "8.0.6-beta.7",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,8 +1,11 @@
1
1
  import React from "react";
2
2
  import Expand from "../../../util/expand";
3
- import ErrorMessage from "../../../types/common/ErrorMessage";
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: string;
6
- value: string | number;
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?: any;
15
+ fieldActions?: FieldActions;
14
16
  showErrors?: boolean;
15
- errorMessages?: any;
16
- field?: any;
17
+ errorMessages?: ErrorMessage[]
18
+ field?: Field
17
19
  }
18
20
 
19
21
  export const FormSelect: React.FC<Expand<FormSelectProps> &
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import Expand from "../../../util/expand";
3
3
 
4
4
  export interface SpinnerProps {
5
- size: string;
6
- centerSpinner: boolean;
5
+ size?: string;
6
+ centerSpinner?: boolean;
7
7
  }
8
8
 
9
9
  export const Spinner: React.FC<Expand<SpinnerProps> &
@@ -0,0 +1,5 @@
1
+ export default interface Field {
2
+ hasErrors?: boolean;
3
+ dirty?: boolean;
4
+ rawValue?: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ export default interface FieldActions {
2
+ set?: (value: any) => void;
3
+ addValidator?: (validator: any) => void;
4
+ removeValidator?: (validator: any) => void;
5
+ clear?: () => void;
6
+ }
@@ -0,0 +1,3 @@
1
+ export { default as ErrorMessage } from "./ErrorMessage";
2
+ export { default as Field } from "./Field";
3
+ export { default as FieldActions } from "./FieldActions"