@xyo-network/react-shared 2.25.72 → 2.25.75
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 +21 -12
- package/dist/cjs/components/TableCell/EllipsisTableCell.js.map +1 -1
- package/dist/cjs/components/TableCell/getRemainingRowWidth.d.ts +1 -1
- package/dist/cjs/components/TableCell/getRemainingRowWidth.js +2 -3
- package/dist/cjs/components/TableCell/getRemainingRowWidth.js.map +1 -1
- package/dist/cjs/lib/getActualPaddingX.d.ts +13 -0
- package/dist/cjs/lib/getActualPaddingX.js +70 -0
- package/dist/cjs/lib/getActualPaddingX.js.map +1 -0
- package/dist/cjs/lib/index.d.ts +1 -0
- package/dist/cjs/lib/index.js +1 -0
- package/dist/cjs/lib/index.js.map +1 -1
- package/dist/esm/components/CardEx.d.ts +10 -1
- package/dist/esm/components/CardEx.js +2 -2
- package/dist/esm/components/CardEx.js.map +1 -1
- package/dist/esm/components/PageCard.js +3 -2
- package/dist/esm/components/PageCard.js.map +1 -1
- package/dist/esm/components/TableCell/EllipsisTableCell.js +13 -7
- package/dist/esm/components/TableCell/EllipsisTableCell.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CardEx.tsx +27 -2
- package/src/components/PageCard.tsx +4 -3
- package/src/components/TableCell/EllipsisTableCell.tsx +25 -13
|
@@ -6,6 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_common_1 = require("@xylabs/react-common");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
+
const lib_1 = require("../../lib");
|
|
9
10
|
const findParent_1 = require("./findParent");
|
|
10
11
|
const getRemainingRowWidth_1 = require("./getRemainingRowWidth");
|
|
11
12
|
const getSmallestParentWidth_1 = require("./getSmallestParentWidth");
|
|
@@ -17,9 +18,6 @@ const EllipsisTableCell = (_a) => {
|
|
|
17
18
|
var { value, to, href } = _a, props = tslib_1.__rest(_a, ["value", "to", "href"]);
|
|
18
19
|
const [calcCellWidth, setCalcCellWidth] = (0, react_1.useState)(0);
|
|
19
20
|
const hashDivRef = (0, react_1.useRef)(null);
|
|
20
|
-
const theme = (0, material_1.useTheme)();
|
|
21
|
-
// We calulate the spacing since we know that table rows use padding.
|
|
22
|
-
const spacing = parseInt(theme.spacing(4).substring(-2));
|
|
23
21
|
(0, react_1.useEffect)(() => {
|
|
24
22
|
var _a;
|
|
25
23
|
const currentElement = (_a = hashDivRef.current) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
@@ -28,7 +26,10 @@ const EllipsisTableCell = (_a) => {
|
|
|
28
26
|
const checkWidth = (cell) => {
|
|
29
27
|
const smallestParentWidth = (0, getSmallestParentWidth_1.getSmallestParentWidth)(cell);
|
|
30
28
|
if (smallestParentWidth && row) {
|
|
31
|
-
const
|
|
29
|
+
const remainingWidth = (0, getRemainingRowWidth_1.getRemainingRowWidth)(row);
|
|
30
|
+
const actualPaddingX = (0, lib_1.getActualPaddingX)(cell);
|
|
31
|
+
const remainderWidth = smallestParentWidth - remainingWidth - actualPaddingX;
|
|
32
|
+
cell.style.width = `${remainderWidth}`;
|
|
32
33
|
setCalcCellWidth(remainderWidth);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
@@ -40,18 +41,26 @@ const EllipsisTableCell = (_a) => {
|
|
|
40
41
|
if (cell) {
|
|
41
42
|
checkWidth(cell);
|
|
42
43
|
window.addEventListener('resize', onResize);
|
|
44
|
+
row === null || row === void 0 ? void 0 : row.addEventListener('resize', onResize);
|
|
43
45
|
}
|
|
44
46
|
return () => {
|
|
45
47
|
window.removeEventListener('resize', onResize);
|
|
48
|
+
row === null || row === void 0 ? void 0 : row.removeEventListener('resize', onResize);
|
|
46
49
|
};
|
|
47
|
-
}, [hashDivRef
|
|
48
|
-
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
}, [hashDivRef]);
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(material_1.TableCell, Object.assign({}, props, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: hashDivRef }, { children: href || to ? ((0, jsx_runtime_1.jsx)(react_common_1.LinkEx, Object.assign({ style: {
|
|
52
|
+
display: 'block',
|
|
53
|
+
maxWidth: calcCellWidth,
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
textOverflow: 'ellipsis',
|
|
56
|
+
whiteSpace: 'nowrap',
|
|
57
|
+
}, to: to, href: href, target: href ? '_blank' : undefined }, { children: value }))) : ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: {
|
|
58
|
+
display: 'block',
|
|
59
|
+
maxWidth: calcCellWidth,
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
textOverflow: 'ellipsis',
|
|
62
|
+
whiteSpace: 'nowrap',
|
|
63
|
+
} }, { children: value }))) })) })));
|
|
55
64
|
};
|
|
56
65
|
exports.EllipsisTableCell = EllipsisTableCell;
|
|
57
66
|
//# sourceMappingURL=EllipsisTableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EllipsisTableCell.js","sourceRoot":"","sources":["../../../../src/components/TableCell/EllipsisTableCell.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"EllipsisTableCell.js","sourceRoot":"","sources":["../../../../src/components/TableCell/EllipsisTableCell.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAsF;AACtF,uDAA6C;AAC7C,iCAAmD;AAGnD,mCAA6C;AAC7C,6CAAyC;AACzC,iEAA6D;AAC7D,qEAAiE;AAOjE,MAAM,cAAc,GAAkC,CAAC,EAAyC,EAAE,EAAE;QAA7C,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,OAAY,EAAP,KAA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,QAAQ;oBAClB,YAAY,EAAE,UAAU;oBACxB,UAAU,EAAE,QAAQ;iBACrB,gBAEA,KAAK,IACD,CACR,IACG,IACI,CACb,CAAA;AACH,CAAC,CAAA;AAvEY,QAAA,iBAAiB,qBAuE7B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** @description This is the width of all the cells (except the one passed) in the row combined */
|
|
1
|
+
/** @description This is the width of all the cells (except the one passed) in the row combined and the spacing of the main cell */
|
|
2
2
|
export declare const getRemainingRowWidth: (row: HTMLElement, forCell?: number) => number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRemainingRowWidth = void 0;
|
|
4
|
-
/** @description This is the width of all the cells (except the one passed) in the row combined */
|
|
4
|
+
/** @description This is the width of all the cells (except the one passed) in the row combined and the spacing of the main cell */
|
|
5
5
|
const getRemainingRowWidth = (row, forCell = 0) => {
|
|
6
6
|
var _a, _b;
|
|
7
7
|
let width = 0;
|
|
@@ -9,8 +9,7 @@ const getRemainingRowWidth = (row, forCell = 0) => {
|
|
|
9
9
|
const item = row === null || row === void 0 ? void 0 : row.children.item(i);
|
|
10
10
|
if (item) {
|
|
11
11
|
if (i !== forCell) {
|
|
12
|
-
|
|
13
|
-
width += (_b = boundingRect === null || boundingRect === void 0 ? void 0 : boundingRect.width) !== null && _b !== void 0 ? _b : 0;
|
|
12
|
+
width += (_b = item === null || item === void 0 ? void 0 : item.clientWidth) !== null && _b !== void 0 ? _b : 0;
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRemainingRowWidth.js","sourceRoot":"","sources":["../../../../src/components/TableCell/getRemainingRowWidth.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"getRemainingRowWidth.js","sourceRoot":"","sources":["../../../../src/components/TableCell/getRemainingRowWidth.ts"],"names":[],"mappings":";;;AAAA,mIAAmI;AAC5H,MAAM,oBAAoB,GAAG,CAAC,GAAgB,EAAE,OAAO,GAAG,CAAC,EAAE,EAAE;;IACpE,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,iBAAiB,mCAAI,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACtD,MAAM,IAAI,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAClC,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,KAAK,OAAO,EAAE;gBACjB,KAAK,IAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,mCAAI,CAAC,CAAA;aAChC;SACF;KACF;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAZY,QAAA,oBAAoB,wBAYhC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const parseMeausureString: (measure?: string, absolute?: number) => number | undefined;
|
|
2
|
+
export declare const parsePadding: (padding: string) => {
|
|
3
|
+
bottom: string;
|
|
4
|
+
left: string;
|
|
5
|
+
right: string;
|
|
6
|
+
top: string;
|
|
7
|
+
} | {
|
|
8
|
+
bottom: string;
|
|
9
|
+
right: string;
|
|
10
|
+
top: string;
|
|
11
|
+
left?: undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare const getActualPaddingX: (element: HTMLElement) => number;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getActualPaddingX = exports.parsePadding = exports.parseMeausureString = void 0;
|
|
4
|
+
const parseMeausureString = (measure, absolute) => {
|
|
5
|
+
if (measure !== undefined && measure !== null && measure.length > 0) {
|
|
6
|
+
if (measure.endsWith('px')) {
|
|
7
|
+
return parseFloat(measure.substring(0, measure.length - 2));
|
|
8
|
+
}
|
|
9
|
+
else if (measure.endsWith('%')) {
|
|
10
|
+
if (absolute !== undefined) {
|
|
11
|
+
return (parseFloat(measure.substring(0, measure.length - 1)) / 100) * absolute;
|
|
12
|
+
}
|
|
13
|
+
throw Error('Error Parsing Measure [missing absolute]');
|
|
14
|
+
}
|
|
15
|
+
else if (measure.endsWith('vw')) {
|
|
16
|
+
return (parseFloat(measure.substring(0, measure.length - 2)) / 100) * window.innerWidth;
|
|
17
|
+
}
|
|
18
|
+
else if (measure.endsWith('vh')) {
|
|
19
|
+
return (parseFloat(measure.substring(0, measure.length - 2)) / 100) * window.innerHeight;
|
|
20
|
+
}
|
|
21
|
+
throw Error(`Error Parsing Measure [${measure}]`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.parseMeausureString = parseMeausureString;
|
|
25
|
+
const parsePadding = (padding) => {
|
|
26
|
+
const parts = padding.split(' ');
|
|
27
|
+
switch (parts.length) {
|
|
28
|
+
case 4: {
|
|
29
|
+
return {
|
|
30
|
+
bottom: parts[2],
|
|
31
|
+
left: parts[3],
|
|
32
|
+
right: parts[1],
|
|
33
|
+
top: parts[0],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
case 3: {
|
|
37
|
+
return {
|
|
38
|
+
bottom: parts[2],
|
|
39
|
+
right: parts[1],
|
|
40
|
+
top: parts[0],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
case 2: {
|
|
44
|
+
return {
|
|
45
|
+
bottom: parts[0],
|
|
46
|
+
left: parts[1],
|
|
47
|
+
right: parts[1],
|
|
48
|
+
top: parts[0],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
case 1: {
|
|
52
|
+
return {
|
|
53
|
+
bottom: parts[0],
|
|
54
|
+
left: parts[0],
|
|
55
|
+
right: parts[0],
|
|
56
|
+
top: parts[0],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.parsePadding = parsePadding;
|
|
62
|
+
const getActualPaddingX = (element) => {
|
|
63
|
+
var _a, _b, _c, _d;
|
|
64
|
+
const padding = (0, exports.parsePadding)(window.getComputedStyle(element, null).getPropertyValue('padding'));
|
|
65
|
+
const paddingLeft = (_b = (0, exports.parseMeausureString)((_a = window.getComputedStyle(element, null).getPropertyValue('padding-left')) !== null && _a !== void 0 ? _a : padding === null || padding === void 0 ? void 0 : padding.left, element.clientWidth)) !== null && _b !== void 0 ? _b : 0;
|
|
66
|
+
const paddingRight = (_d = (0, exports.parseMeausureString)((_c = window.getComputedStyle(element, null).getPropertyValue('padding-right')) !== null && _c !== void 0 ? _c : padding === null || padding === void 0 ? void 0 : padding.right, element.clientWidth)) !== null && _d !== void 0 ? _d : 0;
|
|
67
|
+
return paddingLeft + paddingRight;
|
|
68
|
+
};
|
|
69
|
+
exports.getActualPaddingX = getActualPaddingX;
|
|
70
|
+
//# sourceMappingURL=getActualPaddingX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getActualPaddingX.js","sourceRoot":"","sources":["../../../src/lib/getActualPaddingX.ts"],"names":[],"mappings":";;;AAAO,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAE,QAAiB,EAAE,EAAE;IACzE,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;QACnE,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1B,OAAO,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;SAC5D;aAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAChC,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC1B,OAAO,CAAC,UAAU,CAAC,OAAO,CA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AG,YAAY,CAAA;AACnC,CAAC,CAAA;AALY,QAAA,iBAAiB,qBAK7B"}
|
package/dist/cjs/lib/index.d.ts
CHANGED
package/dist/cjs/lib/index.js
CHANGED
|
@@ -4,5 +4,6 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./archivistPresets"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./assertDefinedEx"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./divinerPresets"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./getActualPaddingX"), exports);
|
|
7
8
|
tslib_1.__exportStar(require("./networkComponents"), exports);
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,4DAAiC;AACjC,2DAAgC;AAChC,8DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,4DAAiC;AACjC,2DAAgC;AAChC,8DAAmC;AACnC,8DAAmC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CardProps } from '@mui/material';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
3
|
export interface CardExProps extends CardProps {
|
|
4
4
|
gradient?: 'border' | 'background';
|
|
5
|
+
display?: CSSProperties['display'];
|
|
6
|
+
flexDirection?: CSSProperties['flexDirection'];
|
|
7
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
8
|
+
alignItems?: CSSProperties['alignItems'];
|
|
9
|
+
alignContent?: CSSProperties['alignContent'];
|
|
10
|
+
alignSelf?: CSSProperties['alignSelf'];
|
|
11
|
+
justifyItems?: CSSProperties['justifyItems'];
|
|
12
|
+
justifyContent?: CSSProperties['justifyContent'];
|
|
13
|
+
justifySelf?: CSSProperties['justifySelf'];
|
|
5
14
|
}
|
|
6
15
|
export declare const CardEx: React.FC<CardExProps>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Card } from '@mui/material';
|
|
3
3
|
import { useGradientStyles } from '../hooks';
|
|
4
|
-
export const CardEx = ({ style, gradient, ...props }) => {
|
|
4
|
+
export const CardEx = ({ display, flexDirection = 'column', flexGrow, alignItems = 'stretch', alignContent, alignSelf, justifyItems = 'flex-start', justifyContent = 'flex-start', justifySelf, style, gradient, ...props }) => {
|
|
5
5
|
const { styles } = useGradientStyles();
|
|
6
6
|
const gradientStyle = gradient === 'border' ? styles.border : gradient === 'background' ? styles.background : {};
|
|
7
|
-
return _jsx(Card, { style: { ...gradientStyle, ...style }, ...props });
|
|
7
|
+
return (_jsx(Card, { style: { ...gradientStyle, alignContent, alignItems, alignSelf, display, flexDirection, flexGrow, justifyContent, justifyItems, justifySelf, ...style }, ...props }));
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=CardEx.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardEx.js","sourceRoot":"","sources":["../../../src/components/CardEx.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CardEx.js","sourceRoot":"","sources":["../../../src/components/CardEx.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,eAAe,CAAA;AAG/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAe5C,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC5C,OAAO,EACP,aAAa,GAAG,QAAQ,EACxB,QAAQ,EACR,UAAU,GAAG,SAAS,EACtB,YAAY,EACZ,SAAS,EACT,YAAY,GAAG,YAAY,EAC3B,cAAc,GAAG,YAAY,EAC7B,WAAW,EACX,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACtC,MAAM,aAAa,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAA;IAChH,OAAO,CACL,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,GAAG,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,KAAM,KAAK,GAAI,CAC7K,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import RefreshIcon from '@mui/icons-material/Refresh';
|
|
3
|
-
import {
|
|
3
|
+
import { CardHeader, IconButton } from '@mui/material';
|
|
4
|
+
import { CardEx } from './CardEx';
|
|
4
5
|
import { TypographyEx } from './TypographyEx';
|
|
5
6
|
export const PageCard = ({ subheader, title, icon, onRefresh, children, style, ...props }) => {
|
|
6
|
-
return (_jsxs(
|
|
7
|
+
return (_jsxs(CardEx, { style: { position: 'relative', ...style }, ...props, children: [icon?.({ style: { fontSize: 512, left: '-144px', opacity: 0.05, position: 'absolute', top: '-144px' } }), _jsx(CardHeader, { title: _jsx(TypographyEx, { variant: "h4", gradient: "text", children: title }), subheader: subheader, action: _jsx(_Fragment, { children: onRefresh ? (_jsx(IconButton, { onClick: () => onRefresh?.(), children: _jsx(RefreshIcon, {}) })) : null }) }), children] }));
|
|
7
8
|
};
|
|
8
9
|
//# sourceMappingURL=PageCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageCard.js","sourceRoot":"","sources":["../../../src/components/PageCard.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PageCard.js","sourceRoot":"","sources":["../../../src/components/PageCard.tsx"],"names":[],"mappings":";AAAA,OAAO,WAAW,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,UAAU,EAA8B,UAAU,EAAgB,MAAM,eAAe,CAAA;AAGhG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7C,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACpH,OAAO,CACL,MAAC,MAAM,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,KAAM,KAAK,aACzD,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,EACzG,KAAC,UAAU,IACT,KAAK,EACH,KAAC,YAAY,IAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,YACvC,KAAK,GACO,EAEjB,SAAS,EAAE,SAAS,EACpB,MAAM,EACJ,4BACG,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,EAAE,YACtC,KAAC,WAAW,KAAG,GACJ,CACd,CAAC,CAAC,CAAC,IAAI,GACP,GAEL,EACD,QAAQ,IACF,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -48,12 +48,18 @@ export const EllipsisTableCell = ({ value, to, href, ...props }) => {
|
|
|
48
48
|
row?.removeEventListener('resize', onResize);
|
|
49
49
|
};
|
|
50
50
|
}, [hashDivRef]);
|
|
51
|
-
return (_jsx(TableCell, { ...props, children: _jsx("div", { ref: hashDivRef, style: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
return (_jsx(TableCell, { ...props, children: _jsx("div", { ref: hashDivRef, children: href || to ? (_jsx(LinkEx, { style: {
|
|
52
|
+
display: 'block',
|
|
53
|
+
maxWidth: calcCellWidth,
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
textOverflow: 'ellipsis',
|
|
56
|
+
whiteSpace: 'nowrap',
|
|
57
|
+
}, to: to, href: href, target: href ? '_blank' : undefined, children: value })) : (_jsx("span", { style: {
|
|
58
|
+
display: 'block',
|
|
59
|
+
maxWidth: calcCellWidth,
|
|
60
|
+
overflow: 'hidden',
|
|
61
|
+
textOverflow: 'ellipsis',
|
|
62
|
+
whiteSpace: 'nowrap',
|
|
63
|
+
}, children: value })) }) }));
|
|
58
64
|
};
|
|
59
65
|
//# sourceMappingURL=EllipsisTableCell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EllipsisTableCell.js","sourceRoot":"","sources":["../../../../src/components/TableCell/EllipsisTableCell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAkB,UAAU,EAAmB,MAAM,eAAe,CAAA;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO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;iBACrB,YAEA,KAAK,GACD,CACR,GACG,GACI,CACb,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,38 @@
|
|
|
1
1
|
import { Card, CardProps } from '@mui/material'
|
|
2
|
+
import { CSSProperties } from 'react'
|
|
2
3
|
|
|
3
4
|
import { useGradientStyles } from '../hooks'
|
|
4
5
|
|
|
5
6
|
export interface CardExProps extends CardProps {
|
|
6
7
|
gradient?: 'border' | 'background'
|
|
8
|
+
display?: CSSProperties['display']
|
|
9
|
+
flexDirection?: CSSProperties['flexDirection']
|
|
10
|
+
flexGrow?: CSSProperties['flexGrow']
|
|
11
|
+
alignItems?: CSSProperties['alignItems']
|
|
12
|
+
alignContent?: CSSProperties['alignContent']
|
|
13
|
+
alignSelf?: CSSProperties['alignSelf']
|
|
14
|
+
justifyItems?: CSSProperties['justifyItems']
|
|
15
|
+
justifyContent?: CSSProperties['justifyContent']
|
|
16
|
+
justifySelf?: CSSProperties['justifySelf']
|
|
7
17
|
}
|
|
8
18
|
|
|
9
|
-
export const CardEx: React.FC<CardExProps> = ({
|
|
19
|
+
export const CardEx: React.FC<CardExProps> = ({
|
|
20
|
+
display,
|
|
21
|
+
flexDirection = 'column',
|
|
22
|
+
flexGrow,
|
|
23
|
+
alignItems = 'stretch',
|
|
24
|
+
alignContent,
|
|
25
|
+
alignSelf,
|
|
26
|
+
justifyItems = 'flex-start',
|
|
27
|
+
justifyContent = 'flex-start',
|
|
28
|
+
justifySelf,
|
|
29
|
+
style,
|
|
30
|
+
gradient,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
10
33
|
const { styles } = useGradientStyles()
|
|
11
34
|
const gradientStyle = gradient === 'border' ? styles.border : gradient === 'background' ? styles.background : {}
|
|
12
|
-
return
|
|
35
|
+
return (
|
|
36
|
+
<Card style={{ ...gradientStyle, alignContent, alignItems, alignSelf, display, flexDirection, flexGrow, justifyContent, justifyItems, justifySelf, ...style }} {...props} />
|
|
37
|
+
)
|
|
13
38
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import RefreshIcon from '@mui/icons-material/Refresh'
|
|
2
|
-
import {
|
|
2
|
+
import { CardHeader, CardHeaderProps, CardProps, IconButton, SvgIconProps } from '@mui/material'
|
|
3
3
|
import { ReactNode } from 'react'
|
|
4
4
|
|
|
5
|
+
import { CardEx } from './CardEx'
|
|
5
6
|
import { TypographyEx } from './TypographyEx'
|
|
6
7
|
|
|
7
8
|
export interface PageCardProps extends CardProps {
|
|
@@ -12,7 +13,7 @@ export interface PageCardProps extends CardProps {
|
|
|
12
13
|
|
|
13
14
|
export const PageCard: React.FC<PageCardProps> = ({ subheader, title, icon, onRefresh, children, style, ...props }) => {
|
|
14
15
|
return (
|
|
15
|
-
<
|
|
16
|
+
<CardEx style={{ position: 'relative', ...style }} {...props}>
|
|
16
17
|
{icon?.({ style: { fontSize: 512, left: '-144px', opacity: 0.05, position: 'absolute', top: '-144px' } })}
|
|
17
18
|
<CardHeader
|
|
18
19
|
title={
|
|
@@ -32,6 +33,6 @@ export const PageCard: React.FC<PageCardProps> = ({ subheader, title, icon, onRe
|
|
|
32
33
|
}
|
|
33
34
|
/>
|
|
34
35
|
{children}
|
|
35
|
-
</
|
|
36
|
+
</CardEx>
|
|
36
37
|
)
|
|
37
38
|
}
|
|
@@ -78,22 +78,34 @@ export const EllipsisTableCell: React.FC<EllipsisTableCellProps> = ({ value, to,
|
|
|
78
78
|
|
|
79
79
|
return (
|
|
80
80
|
<TableCell {...props}>
|
|
81
|
-
<div
|
|
82
|
-
ref={hashDivRef}
|
|
83
|
-
style={{
|
|
84
|
-
display: 'block',
|
|
85
|
-
maxWidth: calcCellWidth,
|
|
86
|
-
overflow: 'hidden',
|
|
87
|
-
textOverflow: 'ellipsis',
|
|
88
|
-
whiteSpace: 'nowrap',
|
|
89
|
-
}}
|
|
90
|
-
>
|
|
81
|
+
<div ref={hashDivRef}>
|
|
91
82
|
{href || to ? (
|
|
92
|
-
<LinkEx
|
|
93
|
-
|
|
83
|
+
<LinkEx
|
|
84
|
+
style={{
|
|
85
|
+
display: 'block',
|
|
86
|
+
maxWidth: calcCellWidth,
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
textOverflow: 'ellipsis',
|
|
89
|
+
whiteSpace: 'nowrap',
|
|
90
|
+
}}
|
|
91
|
+
to={to}
|
|
92
|
+
href={href}
|
|
93
|
+
target={href ? '_blank' : undefined}
|
|
94
|
+
>
|
|
95
|
+
{value}
|
|
94
96
|
</LinkEx>
|
|
95
97
|
) : (
|
|
96
|
-
<
|
|
98
|
+
<span
|
|
99
|
+
style={{
|
|
100
|
+
display: 'block',
|
|
101
|
+
maxWidth: calcCellWidth,
|
|
102
|
+
overflow: 'hidden',
|
|
103
|
+
textOverflow: 'ellipsis',
|
|
104
|
+
whiteSpace: 'nowrap',
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{value}
|
|
108
|
+
</span>
|
|
97
109
|
)}
|
|
98
110
|
</div>
|
|
99
111
|
</TableCell>
|