@evoke-platform/ui-components 1.4.0-dev.1 → 1.4.0-dev.2

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,10 +27,7 @@ const ValueEditor = (props) => {
27
27
  if (!!context.treeViewOpts && !!property) {
28
28
  inputType = property.type;
29
29
  if (property.enum) {
30
- values = property.enum.map((item) => ({
31
- name: item,
32
- label: item,
33
- }));
30
+ values = property.enum.map((item) => ({ name: item, label: item }));
34
31
  }
35
32
  }
36
33
  const [invalidDateTime, setInvalidDateTime] = useState(false);
@@ -42,8 +39,8 @@ const ValueEditor = (props) => {
42
39
  const disabled = ['null', 'notNull'].includes(operator);
43
40
  const presetValues = context.presetValues?.filter((val) => !val.type || val.type === inputType) ?? [];
44
41
  const isPresetValue = (value) => value?.startsWith('{{{') && value?.endsWith('}}}');
45
- const isPresetValueSelected = presetValues && typeof value === 'string' && isPresetValue(value);
46
- const presetDisplayValue = presetValues?.find((option) => option.value.name === value)?.label ?? '';
42
+ const presetDisplayValue = presetValues?.find((option) => option.value.name === value)?.label;
43
+ const isPresetValueSelected = presetValues && typeof value === 'string' && isPresetValue(value) && !!presetDisplayValue;
47
44
  let readOnly = context.disabled;
48
45
  if (!readOnly && context.disabledCriteria) {
49
46
  readOnly =
@@ -54,9 +51,7 @@ const ValueEditor = (props) => {
54
51
  width: '33%',
55
52
  background: readOnly ? '#f4f6f8' : '#fff',
56
53
  borderRadius: '8px',
57
- '& .MuiAutocomplete-tag': {
58
- backgroundColor: '#edeff1',
59
- },
54
+ '& .MuiAutocomplete-tag': { backgroundColor: '#edeff1' },
60
55
  },
61
56
  };
62
57
  useEffect(() => {
@@ -181,9 +176,7 @@ const ValueEditor = (props) => {
181
176
  console.error('Error processing date value:', error);
182
177
  setInvalidDateTime(true);
183
178
  }
184
- }, onClose: onClose, PopperProps: {
185
- anchorEl,
186
- }, renderInput: (params) => (React.createElement(Box, { sx: styles.input, ref: setAnchorEl },
179
+ }, onClose: onClose, PopperProps: { anchorEl }, renderInput: (params) => (React.createElement(Box, { sx: styles.input, ref: setAnchorEl },
187
180
  React.createElement(TextField, { ...params, disabled: disabled, onClick: onClick, placeholder: "Value", size: "small", inputRef: inputRef, error: invalidDateTime }))), readOnly: readOnly })));
188
181
  }
189
182
  else if (inputType === 'number' || inputType === 'integer') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.4.0-dev.1",
3
+ "version": "1.4.0-dev.2",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",