@vuu-ui/vuu-utils 4.0.0-beta.4 → 4.0.0-beta.6

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.0-beta.4",
2
+ "version": "4.0.0-beta.6",
3
3
  "author": "heswell",
4
4
  "main": "./src/index.js",
5
5
  "license": "Apache-2.0",
@@ -15,14 +15,14 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@dnd-kit/react": "^0.1.21",
18
- "@vuu-ui/vuu-data-types": "4.0.0-beta.4",
19
- "@vuu-ui/vuu-table-types": "4.0.0-beta.4",
20
- "@vuu-ui/vuu-filter-types": "4.0.0-beta.4",
21
- "@vuu-ui/vuu-protocol-types": "4.0.0-beta.4"
18
+ "@vuu-ui/vuu-data-types": "4.0.0-beta.6",
19
+ "@vuu-ui/vuu-table-types": "4.0.0-beta.6",
20
+ "@vuu-ui/vuu-filter-types": "4.0.0-beta.6",
21
+ "@vuu-ui/vuu-protocol-types": "4.0.0-beta.6"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "@internationalized/date": "^3.0.0",
25
- "@vuu-ui/vuu-filter-parser": "4.0.0-beta.4",
25
+ "@vuu-ui/vuu-filter-parser": "4.0.0-beta.6",
26
26
  "clsx": "^2.0.0",
27
27
  "react": "^19.2.3",
28
28
  "react-dom": "^19.2.3"
package/src/html-utils.js CHANGED
@@ -57,6 +57,13 @@ const isDateInput = (el)=>isInputElement(el) && el.classList.contains("saltDateI
57
57
  const hasOpenOptionList = (el)=>{
58
58
  if (null !== el) return "true" === el.ariaExpanded;
59
59
  };
60
+ const containsPoint = (el, x, y)=>{
61
+ if (el) {
62
+ const { left, right, top, bottom } = el.getBoundingClientRect();
63
+ return x >= left && x <= right && y >= top && y <= bottom;
64
+ }
65
+ return false;
66
+ };
60
67
  let size;
61
68
  function getScrollbarSize() {
62
69
  if (void 0 === size) {
@@ -139,4 +146,4 @@ const dispatchCustomEvent = (el, type)=>{
139
146
  });
140
147
  el.dispatchEvent(evt);
141
148
  };
142
- export { DEFAULT_MAX_SCROLL_HEIGHT, createEl, dispatchCustomEvent, dispatchKeyboardEvent, dispatchMouseEvent, focusFirstFocusableElement, getClosest, getClosestIndexItem, getElementByDataIndex, getElementDataIndex, getFocusableElement, getMaxScrollHeight, getScrollbarSize, hasOpenOptionList, isDateInput, isInputElement, isSelectableElement, queryClosest };
149
+ export { DEFAULT_MAX_SCROLL_HEIGHT, containsPoint, createEl, dispatchCustomEvent, dispatchKeyboardEvent, dispatchMouseEvent, focusFirstFocusableElement, getClosest, getClosestIndexItem, getElementByDataIndex, getElementDataIndex, getFocusableElement, getMaxScrollHeight, getScrollbarSize, hasOpenOptionList, isDateInput, isInputElement, isSelectableElement, queryClosest };
@@ -12,6 +12,11 @@ export declare const isSelectableElement: (el?: HTMLElement | null) => boolean;
12
12
  export declare const isInputElement: (el: HTMLElement | EventTarget | null) => el is HTMLInputElement;
13
13
  export declare const isDateInput: (el: HTMLElement | EventTarget | null) => el is HTMLInputElement;
14
14
  export declare const hasOpenOptionList: (el: HTMLElement | EventTarget | null) => boolean | undefined;
15
+ /**
16
+ * Test whether viewport coordinates (e.g. clientX, clientY from a pointer
17
+ * event) fall within the bounding rect of an element.
18
+ */
19
+ export declare const containsPoint: (el: HTMLElement | null, x: number, y: number) => boolean;
15
20
  export declare function getScrollbarSize(): number;
16
21
  /**
17
22
  * Used when the max scroll height cannot be measured, e.g. outside a browser.