@xyo-network/react-shared 2.25.57 → 2.25.58

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.
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSmallestParentWidth = void 0;
4
4
  const getSmallestParentWidth = (element, maxDepth = 4) => {
5
- var _a, _b, _c;
5
+ var _a;
6
6
  let currentElement = element === null || element === void 0 ? void 0 : element.parentElement;
7
7
  let width = (_a = currentElement === null || currentElement === void 0 ? void 0 : currentElement.clientWidth) !== null && _a !== void 0 ? _a : screen.width;
8
8
  let maxDepthCounter = maxDepth;
9
9
  while (currentElement && maxDepthCounter > 0) {
10
- if (width > ((_b = currentElement.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b['width'])) {
11
- width = (_c = currentElement.getBoundingClientRect()) === null || _c === void 0 ? void 0 : _c['width'];
10
+ if (width > currentElement.clientWidth) {
11
+ width = currentElement.clientWidth;
12
12
  }
13
13
  currentElement = currentElement.parentElement;
14
14
  maxDepthCounter--;
@@ -1 +1 @@
1
- {"version":3,"file":"getSmallestParentWidth.js","sourceRoot":"","sources":["../../../../src/components/TableCell/getSmallestParentWidth.ts"],"names":[],"mappings":";;;AAAO,MAAM,sBAAsB,GAAG,CAAC,OAAoB,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE;;IAC3E,IAAI,cAAc,GAAuB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAA;IAC/D,IAAI,KAAK,GAAG,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,WAAW,mCAAI,MAAM,CAAC,KAAK,CAAA;IACvD,IAAI,eAAe,GAAG,QAAQ,CAAA;IAC9B,OAAO,cAAc,IAAI,eAAe,GAAG,CAAC,EAAE;QAC5C,IAAI,KAAK,IAAG,MAAA,cAAc,CAAC,qBAAqB,EAAE,0CAAG,OAAO,CAAC,CAAA,EAAE;YAC7D,KAAK,GAAG,MAAA,cAAc,CAAC,qBAAqB,EAAE,0CAAG,OAAO,CAAC,CAAA;SAC1D;QACD,cAAc,GAAG,cAAc,CAAC,aAAa,CAAA;QAC7C,eAAe,EAAE,CAAA;KAClB;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAZY,QAAA,sBAAsB,0BAYlC"}
1
+ {"version":3,"file":"getSmallestParentWidth.js","sourceRoot":"","sources":["../../../../src/components/TableCell/getSmallestParentWidth.ts"],"names":[],"mappings":";;;AAAO,MAAM,sBAAsB,GAAG,CAAC,OAAoB,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE;;IAC3E,IAAI,cAAc,GAAuB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAA;IAC/D,IAAI,KAAK,GAAG,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,WAAW,mCAAI,MAAM,CAAC,KAAK,CAAA;IACvD,IAAI,eAAe,GAAG,QAAQ,CAAA;IAC9B,OAAO,cAAc,IAAI,eAAe,GAAG,CAAC,EAAE;QAC5C,IAAI,KAAK,GAAG,cAAc,CAAC,WAAW,EAAE;YACtC,KAAK,GAAG,cAAc,CAAC,WAAW,CAAA;SACnC;QACD,cAAc,GAAG,cAAc,CAAC,aAAa,CAAA;QAC7C,eAAe,EAAE,CAAA;KAClB;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAZY,QAAA,sBAAsB,0BAYlC"}
@@ -3,8 +3,8 @@ export const getSmallestParentWidth = (element, maxDepth = 4) => {
3
3
  let width = currentElement?.clientWidth ?? screen.width;
4
4
  let maxDepthCounter = maxDepth;
5
5
  while (currentElement && maxDepthCounter > 0) {
6
- if (width > currentElement.getBoundingClientRect()?.['width']) {
7
- width = currentElement.getBoundingClientRect()?.['width'];
6
+ if (width > currentElement.clientWidth) {
7
+ width = currentElement.clientWidth;
8
8
  }
9
9
  currentElement = currentElement.parentElement;
10
10
  maxDepthCounter--;
@@ -1 +1 @@
1
- {"version":3,"file":"getSmallestParentWidth.js","sourceRoot":"","sources":["../../../../src/components/TableCell/getSmallestParentWidth.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAoB,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE;IAC3E,IAAI,cAAc,GAAuB,OAAO,EAAE,aAAa,CAAA;IAC/D,IAAI,KAAK,GAAG,cAAc,EAAE,WAAW,IAAI,MAAM,CAAC,KAAK,CAAA;IACvD,IAAI,eAAe,GAAG,QAAQ,CAAA;IAC9B,OAAO,cAAc,IAAI,eAAe,GAAG,CAAC,EAAE;QAC5C,IAAI,KAAK,GAAG,cAAc,CAAC,qBAAqB,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;YAC7D,KAAK,GAAG,cAAc,CAAC,qBAAqB,EAAE,EAAE,CAAC,OAAO,CAAC,CAAA;SAC1D;QACD,cAAc,GAAG,cAAc,CAAC,aAAa,CAAA;QAC7C,eAAe,EAAE,CAAA;KAClB;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
1
+ {"version":3,"file":"getSmallestParentWidth.js","sourceRoot":"","sources":["../../../../src/components/TableCell/getSmallestParentWidth.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAoB,EAAE,QAAQ,GAAG,CAAC,EAAE,EAAE;IAC3E,IAAI,cAAc,GAAuB,OAAO,EAAE,aAAa,CAAA;IAC/D,IAAI,KAAK,GAAG,cAAc,EAAE,WAAW,IAAI,MAAM,CAAC,KAAK,CAAA;IACvD,IAAI,eAAe,GAAG,QAAQ,CAAA;IAC9B,OAAO,cAAc,IAAI,eAAe,GAAG,CAAC,EAAE;QAC5C,IAAI,KAAK,GAAG,cAAc,CAAC,WAAW,EAAE;YACtC,KAAK,GAAG,cAAc,CAAC,WAAW,CAAA;SACnC;QACD,cAAc,GAAG,cAAc,CAAC,aAAa,CAAA;QAC7C,eAAe,EAAE,CAAA;KAClB;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
package/package.json CHANGED
@@ -88,6 +88,6 @@
88
88
  },
89
89
  "sideEffects": false,
90
90
  "types": "dist/esm/index.d.ts",
91
- "version": "2.25.57",
91
+ "version": "2.25.58",
92
92
  "packageManager": "yarn@3.1.1"
93
93
  }
@@ -3,8 +3,8 @@ export const getSmallestParentWidth = (element: HTMLElement, maxDepth = 4) => {
3
3
  let width = currentElement?.clientWidth ?? screen.width
4
4
  let maxDepthCounter = maxDepth
5
5
  while (currentElement && maxDepthCounter > 0) {
6
- if (width > currentElement.getBoundingClientRect()?.['width']) {
7
- width = currentElement.getBoundingClientRect()?.['width']
6
+ if (width > currentElement.clientWidth) {
7
+ width = currentElement.clientWidth
8
8
  }
9
9
  currentElement = currentElement.parentElement
10
10
  maxDepthCounter--