@peassoft/mnr-web-ui-kit 0.1.0 → 0.1.1
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.
|
@@ -7,6 +7,8 @@ type Props = {
|
|
|
7
7
|
label: string;
|
|
8
8
|
/** autocomplete attribute */
|
|
9
9
|
autocompleteAttribute?: string;
|
|
10
|
+
/** disabled attribule */
|
|
11
|
+
disabled?: boolean;
|
|
10
12
|
/** Width in any CSS length value */
|
|
11
13
|
width?: string;
|
|
12
14
|
/** Error message */
|
|
@@ -15,7 +17,13 @@ type Props = {
|
|
|
15
17
|
value: string;
|
|
16
18
|
/** Ref */
|
|
17
19
|
ref?: React.RefObject<HTMLInputElement | null>;
|
|
18
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* onChange callback
|
|
22
|
+
*
|
|
23
|
+
* For disabled state (when passing `disabled` attribute), pass a noop function
|
|
24
|
+
* (like, `() => {}`) to prevent React's warnings about controlled components
|
|
25
|
+
* (with `value` prop) having no `onChange` handler.
|
|
26
|
+
*/
|
|
19
27
|
onChange: (newValue: string) => unknown;
|
|
20
28
|
/** Optional handler of Tab key press */
|
|
21
29
|
onTab?: () => unknown;
|
|
@@ -7,6 +7,7 @@ export function InputField(props) {
|
|
|
7
7
|
type = 'text',
|
|
8
8
|
label,
|
|
9
9
|
autocompleteAttribute,
|
|
10
|
+
disabled = false,
|
|
10
11
|
width = '100%',
|
|
11
12
|
errorMessage,
|
|
12
13
|
value,
|
|
@@ -59,6 +60,7 @@ export function InputField(props) {
|
|
|
59
60
|
className: 'uikit_InputField_input',
|
|
60
61
|
type: type,
|
|
61
62
|
autoComplete: autocompleteAttribute,
|
|
63
|
+
disabled: disabled,
|
|
62
64
|
value: value,
|
|
63
65
|
onChange: handleChange,
|
|
64
66
|
onKeyDown: handleKeyDown,
|