@monolith-forensics/monolith-ui 1.2.77 → 1.2.78

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.
@@ -463,7 +463,7 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
463
463
  const handleChangeSelection = useCallback((option) => {
464
464
  const newValue = [..._value, option];
465
465
  !isControlled && setValueState(newValue);
466
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
466
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue.map((v) => v.value), newValue);
467
467
  }, [onChange, _value]);
468
468
  const handleFocus = () => {
469
469
  var _a, _b;
@@ -487,7 +487,7 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
487
487
  const handleRemoveItem = (item) => {
488
488
  const newItems = _value.filter((prevItem, idx) => prevItem.value !== item.value);
489
489
  !isControlled && setValueState(newItems);
490
- onChange === null || onChange === void 0 ? void 0 : onChange(newItems);
490
+ onChange === null || onChange === void 0 ? void 0 : onChange(newItems.map((v) => v.value), newItems);
491
491
  };
492
492
  const handleAddItem = useCallback((newItem) => {
493
493
  const existingItem = resolvedOptions
@@ -554,7 +554,7 @@ const TagBox = styled(({ className, data = [], placeholder = "Select tags", arro
554
554
  if (e.key === "Backspace" && currentInputValue === "") {
555
555
  const newItems = _value === null || _value === void 0 ? void 0 : _value.slice(0, _value.length - 1);
556
556
  !isControlled && setValueState(newItems);
557
- onChange === null || onChange === void 0 ? void 0 : onChange(newItems);
557
+ onChange === null || onChange === void 0 ? void 0 : onChange(newItems.map((v) => v.value), newItems);
558
558
  }
559
559
  // Arrow down
560
560
  if (e.key === "ArrowDown") {
@@ -34,7 +34,7 @@ export interface TagBoxProps {
34
34
  OptionTooltip?: (props: {
35
35
  data: any;
36
36
  }) => JSX.Element | React.ReactNode;
37
- onChange?: (value: any[]) => void;
37
+ onChange?: (value: unknown[], options?: Option[]) => void;
38
38
  onScroll?: (e: any) => void;
39
39
  onSearch?: (value: string) => void;
40
40
  searchFn?: (value: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monolith-forensics/monolith-ui",
3
- "version": "1.2.77",
3
+ "version": "1.2.78",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Matt Danner (Monolith Forensics LLC)",