@evoke-platform/ui-components 1.0.1-dev.0 → 1.0.1-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.
@@ -333,7 +333,10 @@ const CriteriaBuilder = (props) => {
|
|
333
333
|
ruleProcessor: (rule, options) => {
|
334
334
|
let newRule = rule;
|
335
335
|
const isPresetValue = typeof rule.value === 'string' && rule.value.startsWith('{{') && rule.value.endsWith('}}');
|
336
|
-
if (
|
336
|
+
if (rule.operator !== 'null' && rule.operator !== 'notNull' && rule.value === null) {
|
337
|
+
newRule = { ...rule, value: '' };
|
338
|
+
}
|
339
|
+
else if (!disableRegexEscapeChars &&
|
337
340
|
['contains', 'beginsWith', 'endsWith'].includes(rule.operator) &&
|
338
341
|
!isPresetValue) {
|
339
342
|
newRule = { ...rule, value: escape(rule.value) };
|
@@ -108,6 +108,7 @@ const ValueEditor = (props) => {
|
|
108
108
|
}
|
109
109
|
}
|
110
110
|
else {
|
111
|
+
const [inputValue, setInputValue] = useState('');
|
111
112
|
const isMultiple = inputType === 'array' || ['in', 'notIn'].includes(operator);
|
112
113
|
const options = [
|
113
114
|
...(values?.sort((a, b) => a.label.localeCompare(b.label)) ?? []),
|
@@ -127,7 +128,15 @@ const ValueEditor = (props) => {
|
|
127
128
|
value = newValue?.name ?? newValue?.value?.name ?? '';
|
128
129
|
}
|
129
130
|
handleOnChange(value);
|
130
|
-
},
|
131
|
+
}, onBlur: () => {
|
132
|
+
if (inputValue) {
|
133
|
+
const newValues = Array.isArray(value) ? [...value, inputValue] : [inputValue];
|
134
|
+
handleOnChange(Array.from(new Set(newValues)));
|
135
|
+
}
|
136
|
+
setInputValue('');
|
137
|
+
}, onInputChange: (event, newInputValue) => {
|
138
|
+
setInputValue(newInputValue);
|
139
|
+
}, inputValue: inputValue, renderInput: (params) => (React.createElement(TextField, { inputRef: inputRef, label: params?.label, ...params, size: "small", sx: { backgroundColor: '#fff' } })),
|
131
140
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
132
141
|
getOptionLabel: (option) => {
|
133
142
|
if (typeof option === 'string') {
|
@@ -195,10 +195,7 @@ CriteriaBuilder.args = {
|
|
195
195
|
name: { $in: ['Jane', 'John', 'Jack'] },
|
196
196
|
},
|
197
197
|
{
|
198
|
-
|
199
|
-
licenseeName: {
|
200
|
-
$gt: 'k',
|
201
|
-
},
|
198
|
+
inState: null,
|
202
199
|
},
|
203
200
|
{
|
204
201
|
amountOfInspections: {
|