@veritone-ce/design-system 1.12.49 → 1.12.50
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.
|
@@ -18,7 +18,8 @@ function ComboBox(_ref) {
|
|
|
18
18
|
var items = _ref.items,
|
|
19
19
|
label = _ref.label,
|
|
20
20
|
width = _ref.width,
|
|
21
|
-
|
|
21
|
+
_onChange = _ref.onChange,
|
|
22
|
+
error = _ref.error;
|
|
22
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Autocomplete, {
|
|
23
24
|
disablePortal: true,
|
|
24
25
|
options: items,
|
|
@@ -27,10 +28,14 @@ function ComboBox(_ref) {
|
|
|
27
28
|
},
|
|
28
29
|
renderInput: function renderInput(params) {
|
|
29
30
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, _objectSpread(_objectSpread({}, params), {}, {
|
|
30
|
-
label: label
|
|
31
|
+
label: label,
|
|
32
|
+
error: error,
|
|
33
|
+
helperText: error ? "Please select a ".concat(label) : ''
|
|
31
34
|
}));
|
|
32
35
|
},
|
|
33
|
-
onChange: onChange
|
|
36
|
+
onChange: function onChange(event, value) {
|
|
37
|
+
return _onChange(event, value);
|
|
38
|
+
}
|
|
34
39
|
});
|
|
35
40
|
}
|
|
36
41
|
var _default = ComboBox;
|
|
@@ -11,7 +11,8 @@ function ComboBox(_ref) {
|
|
|
11
11
|
var items = _ref.items,
|
|
12
12
|
label = _ref.label,
|
|
13
13
|
width = _ref.width,
|
|
14
|
-
|
|
14
|
+
_onChange = _ref.onChange,
|
|
15
|
+
error = _ref.error;
|
|
15
16
|
return /*#__PURE__*/_jsx(Autocomplete, {
|
|
16
17
|
disablePortal: true,
|
|
17
18
|
options: items,
|
|
@@ -20,10 +21,14 @@ function ComboBox(_ref) {
|
|
|
20
21
|
},
|
|
21
22
|
renderInput: function renderInput(params) {
|
|
22
23
|
return /*#__PURE__*/_jsx(TextField, _objectSpread(_objectSpread({}, params), {}, {
|
|
23
|
-
label: label
|
|
24
|
+
label: label,
|
|
25
|
+
error: error,
|
|
26
|
+
helperText: error ? "Please select a ".concat(label) : ''
|
|
24
27
|
}));
|
|
25
28
|
},
|
|
26
|
-
onChange: onChange
|
|
29
|
+
onChange: function onChange(event, value) {
|
|
30
|
+
return _onChange(event, value);
|
|
31
|
+
}
|
|
27
32
|
});
|
|
28
33
|
}
|
|
29
34
|
export default ComboBox;
|
|
@@ -8,6 +8,7 @@ export type AutocompleteProps = {
|
|
|
8
8
|
label: string;
|
|
9
9
|
width: number;
|
|
10
10
|
onChange: (event: React.SyntheticEvent, value: Item | null) => void;
|
|
11
|
+
error?: boolean;
|
|
11
12
|
};
|
|
12
|
-
declare function ComboBox({ items, label, width, onChange }: AutocompleteProps): React.JSX.Element;
|
|
13
|
+
declare function ComboBox({ items, label, width, onChange, error }: AutocompleteProps): React.JSX.Element;
|
|
13
14
|
export default ComboBox;
|