@galaxy-ds/core 1.1.75 → 1.1.76
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.
|
@@ -27,6 +27,10 @@ export interface AutocompleteProps {
|
|
|
27
27
|
* If true, the Autocomplete is free solo, meaning that the user input is not bound to provided options.
|
|
28
28
|
*/
|
|
29
29
|
freeSolo?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If true, sets the Autocomplete text field to readonly.
|
|
32
|
+
*/
|
|
33
|
+
textFieldReadOnly?: boolean;
|
|
30
34
|
/**
|
|
31
35
|
* Used to determine the string value for a given option. It's used to fill the input (and the list box options if renderOption is not provided).
|
|
32
36
|
*/
|
package/dist/index.esm.js
CHANGED
|
@@ -33339,9 +33339,10 @@ var useStyles$y = makeStyles(function (theme) {
|
|
|
33339
33339
|
});
|
|
33340
33340
|
});
|
|
33341
33341
|
var Autocomplete = function (_a) {
|
|
33342
|
-
var
|
|
33342
|
+
var _b;
|
|
33343
|
+
var label = _a.label, placeholder = _a.placeholder, _c = _a.platform, platform = _c === void 0 ? 'desktop' : _c, actionLabel = _a.actionLabel, actionClick = _a.actionClick, onChange = _a.onChange, bottomButtonHeight = _a.bottomButtonHeight, textFieldReadOnly = _a.textFieldReadOnly, rest = __rest(_a, ["label", "placeholder", "platform", "actionLabel", "actionClick", "onChange", "bottomButtonHeight", "textFieldReadOnly"]);
|
|
33343
33344
|
var classes = useStyles$y({ platform: platform, bottomButtonHeight: bottomButtonHeight });
|
|
33344
|
-
var
|
|
33345
|
+
var _d = useState(!((_b = rest.defaultValue) === null || _b === void 0 ? void 0 : _b.length) ? placeholder : null), inputPlaceholder = _d[0], setInputPlaceholder = _d[1];
|
|
33345
33346
|
var root = useRef(null);
|
|
33346
33347
|
var onKeyDownHandler = function (event) {
|
|
33347
33348
|
var inputRootEl = root.current.getElementsByClassName('MuiAutocomplete-inputRoot')[0];
|
|
@@ -33365,7 +33366,7 @@ var Autocomplete = function (_a) {
|
|
|
33365
33366
|
};
|
|
33366
33367
|
return (React__default.createElement(React__default.Fragment, null,
|
|
33367
33368
|
label && React__default.createElement(InputLabel, null, label),
|
|
33368
|
-
React__default.createElement(MuiAutocomplete, __assign$1({ classes: classes, disableClearable: true, renderInput: function (params) { return (React__default.createElement(TextField$1, __assign$1({}, params, { inputProps: __assign$1(__assign$1({}, params.inputProps), { autoComplete:
|
|
33369
|
+
React__default.createElement(MuiAutocomplete, __assign$1({ classes: classes, disableClearable: true, renderInput: function (params) { return (React__default.createElement(TextField$1, __assign$1({}, params, { inputProps: __assign$1(__assign$1({}, params.inputProps), { autoComplete: "new-password", readOnly: textFieldReadOnly }), placeholder: inputPlaceholder, className: "customLargeSize" }))); }, PaperComponent: CustomPaper, onChange: function (event, value, reason) {
|
|
33369
33370
|
value && value.length > 0
|
|
33370
33371
|
? setInputPlaceholder(null)
|
|
33371
33372
|
: setInputPlaceholder(placeholder);
|