@monolith-forensics/monolith-ui 1.2.64 → 1.2.66

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.
@@ -238,7 +238,16 @@ const Rules = ({ rules = [], combinator, showCombinator, filterDefinitions, onDe
238
238
  onUpdateRootCombinator(e);
239
239
  };
240
240
  const handleOperatorChange = (rule, operator) => {
241
- onUpdate(Object.assign(Object.assign({}, rule), { operator }));
241
+ const prevValue = rule.value;
242
+ let newValue;
243
+ const isBetween = operator.value.toLowerCase().includes("between");
244
+ if (!isBetween) {
245
+ newValue = !!(prevValue === null || prevValue === void 0 ? void 0 : prevValue[0]) ? [prevValue[0]] : undefined;
246
+ }
247
+ else {
248
+ newValue = [(prevValue === null || prevValue === void 0 ? void 0 : prevValue[0]) || "", (prevValue === null || prevValue === void 0 ? void 0 : prevValue[1]) || ""];
249
+ }
250
+ onUpdate(Object.assign(Object.assign({}, rule), { operator, value: newValue }));
242
251
  };
243
252
  return (_jsxs(_Fragment, { children: [showCombinator === true && (_jsx(DropDownMenu, { variant: "outlined", data: [
244
253
  { label: "AND", value: "and" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.2.64",
3
+ "version": "1.2.66",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",