@xyo-network/react-shared 2.25.61 → 2.25.62
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/dist/cjs/components/TableCell/EllipsisTableCell.js +5 -6
- package/dist/cjs/components/TableCell/EllipsisTableCell.js.map +1 -1
- package/dist/cjs/components/TableCell/getSmallestParentWidth.js +3 -3
- package/dist/cjs/components/TableCell/getSmallestParentWidth.js.map +1 -1
- package/dist/cjs/hooks/GradientStyles/GradientStyles.js.map +1 -1
- package/package.json +1 -1
|
@@ -15,11 +15,10 @@ const TableCellValue = (_a) => {
|
|
|
15
15
|
};
|
|
16
16
|
const EllipsisTableCell = (_a) => {
|
|
17
17
|
var { value, to, href } = _a, props = tslib_1.__rest(_a, ["value", "to", "href"]);
|
|
18
|
-
const [
|
|
18
|
+
const [hashCellWidth, setHashCellWidth] = (0, react_1.useState)(0);
|
|
19
19
|
const hashDivRef = (0, react_1.useRef)(null);
|
|
20
20
|
const theme = (0, material_1.useTheme)();
|
|
21
|
-
|
|
22
|
-
const spacing = parseInt(theme.spacing(4).substring(-2));
|
|
21
|
+
const spacing = parseInt(theme.spacing(2).substring(-2));
|
|
23
22
|
(0, react_1.useEffect)(() => {
|
|
24
23
|
var _a;
|
|
25
24
|
const currentElement = (_a = hashDivRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
@@ -29,7 +28,7 @@ const EllipsisTableCell = (_a) => {
|
|
|
29
28
|
const smallestParentWidth = (0, getSmallestParentWidth_1.getSmallestParentWidth)(cell);
|
|
30
29
|
if (smallestParentWidth && row) {
|
|
31
30
|
const remainderWidth = smallestParentWidth - (0, getRemainingRowWidth_1.getRemainingRowWidth)(row) - spacing;
|
|
32
|
-
|
|
31
|
+
setHashCellWidth(remainderWidth);
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
const onResize = () => {
|
|
@@ -47,11 +46,11 @@ const EllipsisTableCell = (_a) => {
|
|
|
47
46
|
}, [hashDivRef, spacing]);
|
|
48
47
|
return ((0, jsx_runtime_1.jsx)(material_1.TableCell, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: hashDivRef, style: {
|
|
49
48
|
display: 'block',
|
|
50
|
-
maxWidth:
|
|
49
|
+
maxWidth: hashCellWidth,
|
|
51
50
|
overflow: 'hidden',
|
|
52
51
|
textOverflow: 'ellipsis',
|
|
53
52
|
whiteSpace: 'nowrap',
|
|
54
|
-
} }, { children: href || to ? ((0, jsx_runtime_1.jsx)(react_common_1.LinkEx, Object.assign({ to: to, href: href, target: href ? '_blank' : undefined }, { children: (0, jsx_runtime_1.jsx)(TableCellValue, { value: value, hashCellWidth:
|
|
53
|
+
} }, { children: href || to ? ((0, jsx_runtime_1.jsx)(react_common_1.LinkEx, Object.assign({ to: to, href: href, target: href ? '_blank' : undefined }, { children: (0, jsx_runtime_1.jsx)(TableCellValue, { value: value, hashCellWidth: hashCellWidth }) }))) : ((0, jsx_runtime_1.jsx)(TableCellValue, { value: value, hashCellWidth: hashCellWidth })) })) })));
|
|
55
54
|
};
|
|
56
55
|
exports.EllipsisTableCell = EllipsisTableCell;
|
|
57
56
|
//# sourceMappingURL=EllipsisTableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EllipsisTableCell.js","sourceRoot":"","sources":["../../../../src/components/TableCell/EllipsisTableCell.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAgG;AAChG,uDAA6C;AAC7C,iCAAmD;AAGnD,6CAAyC;AACzC,iEAA6D;AAC7D,qEAAiE;AAOjE,MAAM,cAAc,GAAkC,CAAC,EAAyC,EAAE,EAAE;QAA7C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,OAAY,EAAP,KAAK,sBAAvC,mCAAyC,CAAF;IAC5F,OAAO,CACL,uBAAC,qBAAU,kBACT,OAAO,EAAC,OAAO,EACf,UAAU,EAAC,WAAW,EACtB,KAAK,kBACH,OAAO,EAAE,OAAO,EAChB,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AQ,CAAC,CAAA;QAChD,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;IAEzB,OAAO,CACL,uBAAC,oBAAS,oBAAK,KAAK,cAClB,8CACE,GAAG,EAAE,UAAU,EACf,KAAK,EAAE;gBACL,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,aAAa;gBACvB,QAAQ,EAAE,QAAQ;gBAClB,YAAY,EAAE,UAAU;gBACxB,UAAU,EAAE,QAAQ;aACrB,gBAEA,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CACZ,uBAAC,qBAAM,kBAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBAC7D,uBAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,GAAI,IACvD,CACV,CAAC,CAAC,CAAC,CACF,uBAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,GAAI,CAC/D,IACG,IACI,CACb,CAAA;AACH,CAAC,CAAA;AAzDY,QAAA,iBAAiB,qBAyD7B"}
|
|
@@ -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;
|
|
5
|
+
var _a, _b, _c;
|
|
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 > currentElement.
|
|
11
|
-
width = currentElement.
|
|
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'];
|
|
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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GradientStyles.js","sourceRoot":"","sources":["../../../../src/hooks/GradientStyles/GradientStyles.tsx"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"GradientStyles.js","sourceRoot":"","sources":["../../../../src/hooks/GradientStyles/GradientStyles.tsx"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,wCAAsD;AAS/C,MAAM,yBAAyB,GAAG,GAAG,EAAE;IAC5C,OAAO;QACL,UAAU,EAAE;YACV,eAAe,EAAE,qEAAqE;SACvF;QACD,MAAM,EAAE;YACN,WAAW,EAAE,qEAAqE;YAClF,gBAAgB,EAAE,CAAC;YACnB,iBAAiB,EAAE,qEAAqE;YACxF,YAAY,EAAE,CAAC;YACf,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,KAAK;SACnB;QACD,OAAO,EAAE;YACP,oBAAoB,EAAE,MAAM;YAC5B,mBAAmB,EAAE,aAAa;YAClC,UAAU,EAAE,qEAAqE;YACjF,OAAO,EAAE,cAAc;SACxB;KACF,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,yBAAyB,6BAoBrC;AAEM,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,OAAO;QACL,UAAU,EAAE;YACV,eAAe,EAAE,qEAAqE;SACvF;QACD,MAAM,EAAE;YACN,WAAW,EAAE,qEAAqE;YAClF,gBAAgB,EAAE,CAAC;YACnB,iBAAiB,EAAE,qEAAqE;YACxF,YAAY,EAAE,CAAC;YACf,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,KAAK;SACnB;QACD,OA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