@evoke-platform/ui-components 1.0.0-dev.179 → 1.0.0-dev.181

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.
@@ -21,6 +21,7 @@ export declare type FormFieldProps = {
21
21
  queryAddresses?: Function;
22
22
  isOptionEqualToValue?: Function;
23
23
  renderOption?: Function;
24
+ disableCloseOnSelect?: boolean;
24
25
  };
25
26
  declare const FormField: (props: FormFieldProps) => any;
26
27
  export default FormField;
@@ -7,7 +7,7 @@ import InputFieldComponent from './InputFieldComponent/InputFieldComponent';
7
7
  import Select from './Select/Select';
8
8
  import TimePickerSelect from './TimePickerSelect/TimePickerSelect';
9
9
  const FormField = (props) => {
10
- const { defaultValue, error, onChange, property, readOnly, selectOptions, required, size, placeholder, errorMessage, onBlur, mask, max, min, isMultiLineText, rows, inputMaskPlaceholderChar, queryAddresses, isOptionEqualToValue, renderOption, } = props;
10
+ const { defaultValue, error, onChange, property, readOnly, selectOptions, required, size, placeholder, errorMessage, onBlur, mask, max, min, isMultiLineText, rows, inputMaskPlaceholderChar, queryAddresses, isOptionEqualToValue, renderOption, disableCloseOnSelect, } = props;
11
11
  const id = property.id;
12
12
  let control;
13
13
  const commonProps = {
@@ -27,6 +27,7 @@ const FormField = (props) => {
27
27
  max,
28
28
  isOptionEqualToValue,
29
29
  renderOption,
30
+ disableCloseOnSelect,
30
31
  };
31
32
  if (queryAddresses) {
32
33
  control = (React.createElement(AddressFieldComponent, Object.assign({}, commonProps, { mask: mask, inputMaskPlaceholderChar: inputMaskPlaceholderChar, isMultiLineText: isMultiLineText, rows: rows, queryAddresses: queryAddresses })));
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
2
2
  import { Autocomplete, TextField } from '../../../core';
3
3
  import InputFieldComponent from '../InputFieldComponent/InputFieldComponent';
4
4
  const Select = (props) => {
5
- const { property, defaultValue, error, errorMessage, onBlur, readOnly, selectOptions, required, size, isOptionEqualToValue, renderOption, } = props;
5
+ const { property, defaultValue, error, errorMessage, onBlur, readOnly, selectOptions, required, size, isOptionEqualToValue, renderOption, disableCloseOnSelect, } = props;
6
6
  const [value, setValue] = useState(defaultValue);
7
7
  const [inputValue, setInputValue] = useState('');
8
8
  useEffect(() => {
@@ -27,10 +27,10 @@ const Select = (props) => {
27
27
  setInputValue(selectValue);
28
28
  }
29
29
  };
30
- return readOnly ? (React.createElement(InputFieldComponent, Object.assign({}, props))) : (React.createElement(Autocomplete, { multiple: (property === null || property === void 0 ? void 0 : property.type) === 'array' ? true : false, id: id, renderInput: (params) => React.createElement(TextField, Object.assign({}, params, { value: value, fullWidth: true, onBlur: onBlur })), value: value !== null && value !== void 0 ? value : ((property === null || property === void 0 ? void 0 : property.type) === 'array' ? [] : undefined), onChange: handleChange, options: (property === null || property === void 0 ? void 0 : property.type) === 'array' ? property === null || property === void 0 ? void 0 : property.enum : selectOptions, disableClearable: true, inputValue: inputValue !== null && inputValue !== void 0 ? inputValue : '', error: error, errorMessage: errorMessage, required: required, onInputChange: handleInputValueChange, filterOptions: (option) => { var _a; return (property === null || property === void 0 ? void 0 : property.type) === 'array' ? (_a = property === null || property === void 0 ? void 0 : property.enum) === null || _a === void 0 ? void 0 : _a.filter((item) => item !== option.value) : option; }, size: size, isOptionEqualToValue: isOptionEqualToValue
30
+ return readOnly ? (React.createElement(InputFieldComponent, Object.assign({}, props))) : (React.createElement(Autocomplete, { multiple: (property === null || property === void 0 ? void 0 : property.type) === 'array' ? true : false, id: id, renderInput: (params) => React.createElement(TextField, Object.assign({}, params, { value: value, fullWidth: true, onBlur: onBlur })), value: value !== null && value !== void 0 ? value : ((property === null || property === void 0 ? void 0 : property.type) === 'array' ? [] : undefined), onChange: handleChange, options: selectOptions, disableClearable: true, inputValue: inputValue !== null && inputValue !== void 0 ? inputValue : '', error: error, errorMessage: errorMessage, required: required, onInputChange: handleInputValueChange, size: size, isOptionEqualToValue: isOptionEqualToValue
31
31
  ? (option, value) => isOptionEqualToValue(option, value)
32
32
  : undefined, renderOption: renderOption
33
33
  ? (props, option, state) => renderOption(props, option, state)
34
- : undefined }));
34
+ : undefined, disableCloseOnSelect: disableCloseOnSelect }));
35
35
  };
36
36
  export default Select;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.179",
3
+ "version": "1.0.0-dev.181",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",