@vuu-ui/vuu-data-react 0.8.20-debug → 0.8.21-debug

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.
package/cjs/index.js CHANGED
@@ -22033,9 +22033,37 @@ var useViewActionDispatcher = (id, root, viewPath, dropTargets) => {
22033
22033
  var import_vuu_utils26 = require("@vuu-ui/vuu-utils");
22034
22034
  var import_react86 = __toESM(require("react"));
22035
22035
 
22036
- // ../vuu-ui-controls/src/combo-box/ComboBox.tsx
22037
- var import_vuu_utils18 = require("@vuu-ui/vuu-utils");
22038
- var import_react69 = require("react");
22036
+ // ../vuu-ui-controls/src/dropdown/DropdownBase.tsx
22037
+ var import_vuu_utils10 = require("@vuu-ui/vuu-utils");
22038
+ var import_react45 = require("react");
22039
+
22040
+ // ../vuu-ui-controls/src/utils/escapeRegExp.ts
22041
+ var regExp = /[.*+?^${}()|[\]\\]/g;
22042
+ function escapeRegExp(string2) {
22043
+ return string2.replace(regExp, "\\$&");
22044
+ }
22045
+
22046
+ // ../vuu-ui-controls/src/utils/forwardCallbackProps.ts
22047
+ var forwardCallbackProps = (ownProps, overrideProps) => {
22048
+ const props = Object.keys(ownProps).reduce(
22049
+ (map, name2) => {
22050
+ const ownProp = ownProps[name2];
22051
+ const overrideProp = overrideProps[name2];
22052
+ if (typeof ownProp === "function" && typeof overrideProp === "function") {
22053
+ map[name2] = (...args) => {
22054
+ ownProp(...args);
22055
+ overrideProp(...args);
22056
+ };
22057
+ }
22058
+ return map;
22059
+ },
22060
+ { ...overrideProps }
22061
+ );
22062
+ return props;
22063
+ };
22064
+
22065
+ // ../vuu-ui-controls/src/dropdown/useDropdownBase.ts
22066
+ var import_react44 = require("react");
22039
22067
 
22040
22068
  // ../vuu-ui-controls/src/common-hooks/collectionProvider.tsx
22041
22069
  var import_react38 = require("react");
@@ -22055,8 +22083,10 @@ function useCollection() {
22055
22083
  }
22056
22084
  }
22057
22085
 
22058
- // ../vuu-ui-controls/src/common-hooks/itemToString.ts
22086
+ // ../vuu-ui-controls/src/common-hooks/isPlainObject.ts
22059
22087
  var isPlainObject = (obj) => Object.prototype.toString.call(obj) === "[object Object]";
22088
+
22089
+ // ../vuu-ui-controls/src/common-hooks/itemToString.ts
22060
22090
  function itemToString(item) {
22061
22091
  if (typeof item === "string") {
22062
22092
  return item;
@@ -22251,31 +22281,6 @@ function replaceCollectionItem(nodes, id, props) {
22251
22281
  return newNodes;
22252
22282
  }
22253
22283
 
22254
- // ../vuu-ui-controls/src/utils/escapeRegExp.ts
22255
- var regExp = /[.*+?^${}()|[\]\\]/g;
22256
- function escapeRegExp(string2) {
22257
- return string2.replace(regExp, "\\$&");
22258
- }
22259
-
22260
- // ../vuu-ui-controls/src/utils/forwardCallbackProps.ts
22261
- var forwardCallbackProps = (ownProps, overrideProps) => {
22262
- const props = Object.keys(ownProps).reduce(
22263
- (map, name2) => {
22264
- const ownProp = ownProps[name2];
22265
- const overrideProp = overrideProps[name2];
22266
- if (typeof ownProp === "function" && typeof overrideProp === "function") {
22267
- map[name2] = (...args) => {
22268
- ownProp(...args);
22269
- overrideProp(...args);
22270
- };
22271
- }
22272
- return map;
22273
- },
22274
- { ...overrideProps }
22275
- );
22276
- return props;
22277
- };
22278
-
22279
22284
  // ../vuu-ui-controls/src/list/common-hooks/utils/filter-utils.ts
22280
22285
  var leftTrim = (value) => value ? value.replace(/^\s+/g, "") : value;
22281
22286
  var getDefaultFilterRegex = (value) => new RegExp(`(${escapeRegExp(leftTrim(value))})`, "gi");
@@ -22776,13 +22781,6 @@ var selectionIsDisallowed = (selection) => selection === "none";
22776
22781
  var hasSelection = (selected) => selected !== void 0 && selected.length > 0;
22777
22782
  var getFirstSelectedItem = (selected) => selected[0];
22778
22783
 
22779
- // ../vuu-ui-controls/src/dropdown/DropdownBase.tsx
22780
- var import_vuu_utils10 = require("@vuu-ui/vuu-utils");
22781
- var import_react45 = require("react");
22782
-
22783
- // ../vuu-ui-controls/src/dropdown/useDropdownBase.ts
22784
- var import_react44 = require("react");
22785
-
22786
22784
  // ../vuu-ui-controls/src/dropdown/useClickAway.ts
22787
22785
  var import_react43 = require("react");
22788
22786
  var NO_HANDLERS = [];
@@ -24089,7 +24087,7 @@ var useDragDropProvider = (id) => {
24089
24087
 
24090
24088
  // ../vuu-ui-controls/src/drag-drop/DragDropState.ts
24091
24089
  var DragDropState = class {
24092
- constructor(evt, dragElement) {
24090
+ constructor(mousePosition, dragElement) {
24093
24091
  /** Element being dragged, (initial element cloned and rendered in portal). */
24094
24092
  this.draggableElement = null;
24095
24093
  this.payload = null;
@@ -24098,13 +24096,13 @@ var DragDropState = class {
24098
24096
  this.draggableElement = el;
24099
24097
  };
24100
24098
  this.initialDragElement = dragElement;
24101
- this.mouseOffset = this.getMouseOffset(evt, dragElement);
24099
+ this.mouseOffset = this.getMouseOffset(mousePosition, dragElement);
24102
24100
  }
24103
24101
  setPayload(payload) {
24104
24102
  this.payload = payload;
24105
24103
  }
24106
- getMouseOffset(evt, dragElement) {
24107
- const { clientX, clientY } = evt;
24104
+ getMouseOffset(mousePosition, dragElement) {
24105
+ const { clientX, clientY } = mousePosition;
24108
24106
  const draggableRect = dragElement.getBoundingClientRect();
24109
24107
  return {
24110
24108
  x: clientX - draggableRect.left,
@@ -24113,7 +24111,7 @@ var DragDropState = class {
24113
24111
  }
24114
24112
  };
24115
24113
 
24116
- // ../vuu-ui-controls/src/drag-drop/useDragDropNext.tsx
24114
+ // ../vuu-ui-controls/src/drag-drop/useDragDrop.tsx
24117
24115
  var import_vuu_utils14 = require("@vuu-ui/vuu-utils");
24118
24116
  var import_react61 = require("react");
24119
24117
 
@@ -24776,7 +24774,7 @@ var useDragDropIndicator = ({
24776
24774
  };
24777
24775
  };
24778
24776
 
24779
- // ../vuu-ui-controls/src/drag-drop/useDragDropNaturalMovementNext.tsx
24777
+ // ../vuu-ui-controls/src/drag-drop/useDragDropNaturalMovement.tsx
24780
24778
  var import_react60 = require("react");
24781
24779
 
24782
24780
  // ../vuu-ui-controls/src/drag-drop/useDragDisplacers.ts
@@ -24915,7 +24913,7 @@ var useDragDisplacers = (orientation = "horizontal") => {
24915
24913
  };
24916
24914
  };
24917
24915
 
24918
- // ../vuu-ui-controls/src/drag-drop/useDragDropNaturalMovementNext.tsx
24916
+ // ../vuu-ui-controls/src/drag-drop/useDragDropNaturalMovement.tsx
24919
24917
  var import_vuu_utils13 = require("@vuu-ui/vuu-utils");
24920
24918
  var useDragDropNaturalMovement = ({
24921
24919
  onDrop,
@@ -25175,7 +25173,7 @@ var useDragDropNaturalMovement = ({
25175
25173
  };
25176
25174
  };
25177
25175
 
25178
- // ../vuu-ui-controls/src/drag-drop/useDragDropNext.tsx
25176
+ // ../vuu-ui-controls/src/drag-drop/useDragDrop.tsx
25179
25177
  var import_jsx_runtime25 = require("react/jsx-runtime");
25180
25178
  var NULL_DRAG_DROP_RESULT = {
25181
25179
  beginDrag: () => void 0,
@@ -25196,14 +25194,14 @@ var UNBOUNDED = {
25196
25194
  };
25197
25195
  var noDragDrop = () => NULL_DRAG_DROP_RESULT;
25198
25196
  var dragThreshold = 3;
25199
- var getDraggableElement = (el, query) => el.closest(query);
25197
+ var getDraggableElement = (el, query) => el == null ? void 0 : el.closest(query);
25200
25198
  var getLastElement = (container, itemQuery) => {
25201
25199
  const fullItemQuery = `:is(${itemQuery}${NOT_OVERFLOWED},.vuuOverflowContainer-OverflowIndicator)`;
25202
25200
  const childElements = Array.from(container.querySelectorAll(fullItemQuery));
25203
25201
  const lastElement = childElements.pop();
25204
25202
  return [lastElement, isOverflowElement(lastElement)];
25205
25203
  };
25206
- var useDragDropNext = ({
25204
+ var useDragDrop = ({
25207
25205
  allowDragDrop,
25208
25206
  containerRef,
25209
25207
  draggableClassName,
@@ -25230,6 +25228,7 @@ var useDragDropNext = ({
25230
25228
  const dragDropStateRef = (0, import_react61.useRef)(null);
25231
25229
  const mouseDownTimer = (0, import_react61.useRef)(null);
25232
25230
  const isScrollableRef = (0, import_react61.useRef)(false);
25231
+ const mousedownElementRef = (0, import_react61.useRef)(null);
25233
25232
  const mousePosRef = (0, import_react61.useRef)({ x: 0, y: 0 });
25234
25233
  const startPosRef = (0, import_react61.useRef)({ x: 0, y: 0 });
25235
25234
  const settlingItemRef = (0, import_react61.useRef)(null);
@@ -25494,10 +25493,10 @@ var useDragDropNext = ({
25494
25493
  [attachDragHandlers, beginDrag, containerRef, setDragBoundaries]
25495
25494
  );
25496
25495
  const dragStart = (0, import_react61.useCallback)(
25497
- (evt) => {
25498
- const { target } = evt;
25499
- const dragElement = getDraggableElement(target, itemQuery);
25496
+ (mousePosition) => {
25500
25497
  const { current: container } = containerRef;
25498
+ const { current: target } = mousedownElementRef;
25499
+ const dragElement = getDraggableElement(target, itemQuery);
25501
25500
  if (container && dragElement) {
25502
25501
  const scrollableContainer = getScrollableContainer(
25503
25502
  container,
@@ -25511,7 +25510,7 @@ var useDragDropNext = ({
25511
25510
  const containerRect = container.getBoundingClientRect();
25512
25511
  const draggableRect = dragElement.getBoundingClientRect();
25513
25512
  const dragDropState = dragDropStateRef.current = new DragDropState(
25514
- evt,
25513
+ mousePosition,
25515
25514
  dragElement
25516
25515
  );
25517
25516
  setDragBoundaries(containerRect, draggableRect);
@@ -25536,6 +25535,7 @@ var useDragDropNext = ({
25536
25535
  });
25537
25536
  onDragStart == null ? void 0 : onDragStart(dragDropState);
25538
25537
  attachDragHandlers();
25538
+ mousedownElementRef.current = null;
25539
25539
  }
25540
25540
  },
25541
25541
  [
@@ -25552,9 +25552,10 @@ var useDragDropNext = ({
25552
25552
  );
25553
25553
  const preDragMouseMoveHandler = (0, import_react61.useCallback)(
25554
25554
  (evt) => {
25555
+ const { current: mouseDownPosition } = startPosRef;
25555
25556
  const { CLIENT_POS, POS } = dimensions(orientation);
25556
25557
  const { [CLIENT_POS]: clientPos } = evt;
25557
- const mouseMoveDistance = Math.abs(clientPos - startPosRef.current[POS]);
25558
+ const mouseMoveDistance = Math.abs(clientPos - mouseDownPosition[POS]);
25558
25559
  if (mouseMoveDistance > dragThreshold && containerRef.current) {
25559
25560
  if (mouseDownTimer.current) {
25560
25561
  window.clearTimeout(mouseDownTimer.current);
@@ -25562,7 +25563,11 @@ var useDragDropNext = ({
25562
25563
  }
25563
25564
  document.removeEventListener("mousemove", preDragMouseMoveHandler);
25564
25565
  document.removeEventListener("mouseup", preDragMouseUpHandler, false);
25565
- dragStart(evt);
25566
+ const mousePosition = {
25567
+ clientX: mouseDownPosition.x,
25568
+ clientY: mouseDownPosition.y
25569
+ };
25570
+ dragStart(mousePosition);
25566
25571
  }
25567
25572
  },
25568
25573
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -25584,6 +25589,11 @@ var useDragDropNext = ({
25584
25589
  const { clientX, clientY } = evt;
25585
25590
  mousePosRef.current.x = startPosRef.current.x = clientX;
25586
25591
  mousePosRef.current.y = startPosRef.current.y = clientY;
25592
+ mousedownElementRef.current = evt.target;
25593
+ const mousePosition = {
25594
+ clientX,
25595
+ clientY
25596
+ };
25587
25597
  document.addEventListener("mousemove", preDragMouseMoveHandler, false);
25588
25598
  document.addEventListener("mouseup", preDragMouseUpHandler, false);
25589
25599
  evt.persist();
@@ -25594,7 +25604,7 @@ var useDragDropNext = ({
25594
25604
  false
25595
25605
  );
25596
25606
  document.removeEventListener("mouseup", preDragMouseUpHandler, false);
25597
- dragStart(evt.nativeEvent);
25607
+ dragStart(mousePosition);
25598
25608
  }, 500);
25599
25609
  }
25600
25610
  },
@@ -25880,7 +25890,7 @@ var useList = ({
25880
25890
  isDragging,
25881
25891
  isScrolling: isDragDropScrolling,
25882
25892
  ...dragDropHook
25883
- } = useDragDropNext({
25893
+ } = useDragDrop({
25884
25894
  allowDragDrop,
25885
25895
  draggableClassName: "list-item",
25886
25896
  orientation: "vertical",
@@ -26431,6 +26441,10 @@ var List = (0, import_react66.forwardRef)(function List2({
26431
26441
  );
26432
26442
  });
26433
26443
 
26444
+ // ../vuu-ui-controls/src/combo-box/ComboBox.tsx
26445
+ var import_vuu_utils18 = require("@vuu-ui/vuu-utils");
26446
+ var import_react69 = require("react");
26447
+
26434
26448
  // ../vuu-ui-controls/src/list/ChevronIcon.tsx
26435
26449
  var import_jsx_runtime27 = require("react/jsx-runtime");
26436
26450
  var classBase8 = "vuuChevronIcon";
@@ -27673,7 +27687,7 @@ var useTabstrip = ({
27673
27687
  suspendAnimation
27674
27688
  ]
27675
27689
  );
27676
- const { onMouseDown: dragDropHookHandleMouseDown, ...dragDropHook } = useDragDropNext({
27690
+ const { onMouseDown: dragDropHookHandleMouseDown, ...dragDropHook } = useDragDrop({
27677
27691
  allowDragDrop,
27678
27692
  containerRef,
27679
27693
  // this is for useDragDropNext
@@ -29396,7 +29410,7 @@ var useOverflowContainer = ({
29396
29410
  },
29397
29411
  [onMoveItem]
29398
29412
  );
29399
- const { onMouseDown: dragDropHookHandleMouseDown, ...dragDropHook } = useDragDropNext({
29413
+ const { onMouseDown: dragDropHookHandleMouseDown, ...dragDropHook } = useDragDrop({
29400
29414
  allowDragDrop,
29401
29415
  containerRef,
29402
29416
  // this is for useDragDropNext
@@ -30134,21 +30148,13 @@ var TextInput = (0, import_react105.forwardRef)(function TextInput2({
30134
30148
  const [typeaheadValues, setTypeaheadValues] = (0, import_react105.useState)([]);
30135
30149
  const getSuggestions = suggestionProvider();
30136
30150
  const handleSingleValueSelectionChange = (0, import_react105.useCallback)(
30137
- (evt, value2) => onInputComplete(value2),
30151
+ (_, value2) => onInputComplete(value2),
30138
30152
  [onInputComplete]
30139
30153
  );
30140
30154
  const handleMultiValueSelectionChange = (0, import_react105.useCallback)(
30141
- (evt, value2) => {
30142
- if (value2.length === 1) {
30143
- onInputComplete(value2[0]);
30144
- } else if (value2.length > 1) {
30145
- onInputComplete(value2);
30146
- }
30147
- },
30155
+ (_, values) => onInputComplete(values),
30148
30156
  [onInputComplete]
30149
30157
  );
30150
- (0, import_react105.useEffect)(() => {
30151
- }, [column]);
30152
30158
  (0, import_react105.useEffect)(() => {
30153
30159
  if (table) {
30154
30160
  const params = valueInputValue ? [table, column.name, valueInputValue] : [table, column.name];