@ltht-react/table 2.0.168 → 2.0.170
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.
|
@@ -47,7 +47,8 @@ var styled_1 = __importDefault(require("@emotion/styled"));
|
|
|
47
47
|
var icon_1 = __importStar(require("@ltht-react/icon"));
|
|
48
48
|
var menu_1 = __importDefault(require("@ltht-react/menu"));
|
|
49
49
|
var styles_1 = require("@ltht-react/styles");
|
|
50
|
-
var StyledIconText = styled_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: 0.4rem;\n"], ["\n margin-left: 0.4rem;\n"
|
|
50
|
+
var StyledIconText = styled_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: 0.4rem;\n"], ["\n margin-left: 0.4rem;\n"])));
|
|
51
|
+
var StyledActionMenuContainer = styled_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n"], ["\n display: flex;\n justify-content: center;\n"
|
|
51
52
|
// TODO: This component is still a WIP and will be re-factored soon!
|
|
52
53
|
// May be best to split it out into different components, the important part is unifying Type used by React-Table so the mapping can be simplified
|
|
53
54
|
// It will need to facilitate the Actions list capability Jonny Dyson has requested
|
|
@@ -66,19 +67,21 @@ var TableCell = function (_a) {
|
|
|
66
67
|
if (adminActions.length === 0) {
|
|
67
68
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
68
69
|
}
|
|
69
|
-
return ((0, jsx_runtime_1.jsx)(menu_1.default, { id: "".concat("".concat(id !== null && id !== void 0 ? id : '', "-"), "action-menu-button"), actions: adminActions, menuButtonOptions: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(StyledActionMenuContainer, { children: (0, jsx_runtime_1.jsx)(menu_1.default, { id: "".concat("".concat(id !== null && id !== void 0 ? id : '', "-"), "action-menu-button"), actions: adminActions, menuButtonOptions: {
|
|
71
|
+
type: 'button',
|
|
72
|
+
text: '',
|
|
73
|
+
buttonProps: {
|
|
74
|
+
styling: {
|
|
75
|
+
buttonStyle: 'standard',
|
|
76
|
+
padding: headerAxis === 'x' ? '0.3rem 0.5rem' : '0.15rem 0.3rem',
|
|
77
|
+
},
|
|
78
|
+
icon: ((0, jsx_runtime_1.jsx)(icon_1.default, { type: headerAxis === 'x' ? 'ellipsis-vertical' : 'ellipsis-horizontal', size: 'medium' })),
|
|
79
|
+
iconPlacement: 'center',
|
|
80
|
+
color: "".concat(styles_1.BTN_COLOURS.DANGER.VALUE),
|
|
76
81
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
}, popupStyle: { zIndex: (0, styles_1.getZIndex)(styles_1.PopUp) }, popupPlacement: headerAxis === 'x' ? 'bottom-start' : 'right-start' }));
|
|
82
|
+
}, style: {
|
|
83
|
+
width: 'fit-content',
|
|
84
|
+
} }) }));
|
|
82
85
|
}
|
|
83
86
|
if (isButton) {
|
|
84
87
|
return (0, jsx_runtime_1.jsx)(button_1.Button, { id: id, value: text, icon: iconProps && (0, jsx_runtime_1.jsx)(icon_1.default, __assign({}, iconProps)), onClick: clickHandler });
|
|
@@ -95,5 +98,5 @@ var TableCell = function (_a) {
|
|
|
95
98
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
96
99
|
};
|
|
97
100
|
exports.default = TableCell;
|
|
98
|
-
var templateObject_1;
|
|
101
|
+
var templateObject_1, templateObject_2;
|
|
99
102
|
//# sourceMappingURL=table-cell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-cell.js","sourceRoot":"","sources":["../../src/molecules/table-cell.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA2C;AAC3C,2DAAoC;AACpC,uDAA8D;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 declare const StyledPageCountDiv: import("@emotion/styled").StyledComponent<{
|
|
|
44
44
|
theme?: import("@emotion/react").Theme | undefined;
|
|
45
45
|
as?: import("react").ElementType<any> | undefined;
|
|
46
46
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
47
|
-
declare const StyledStandardButton: import("@emotion/styled").StyledComponent<import("@ltht-react/icon/lib/organisms/icon-button").IconButtonProps & {
|
|
47
|
+
declare const StyledStandardButton: import("@emotion/styled").StyledComponent<import("@ltht-react/icon/lib/organisms/icon-button").IconButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
|
|
48
48
|
theme?: import("@emotion/react").Theme | undefined;
|
|
49
49
|
}, {}, {}>;
|
|
50
|
-
declare const StyledPaginationButton: import("@emotion/styled").StyledComponent<import("@ltht-react/icon/lib/organisms/icon-button").IconButtonProps & {
|
|
50
|
+
declare const StyledPaginationButton: import("@emotion/styled").StyledComponent<import("@ltht-react/icon/lib/organisms/icon-button").IconButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
|
|
51
51
|
theme?: import("@emotion/react").Theme | undefined;
|
|
52
52
|
}, {}, {}>;
|
|
53
53
|
declare const StyledSpinnerIcon: import("@emotion/styled").StyledComponent<import("@ltht-react/icon").IconProps & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ltht-react/table",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.170",
|
|
4
4
|
"description": "ltht-react Table component.",
|
|
5
5
|
"author": "LTHT",
|
|
6
6
|
"homepage": "",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@emotion/react": "^11.0.0",
|
|
30
30
|
"@emotion/styled": "^11.0.0",
|
|
31
|
-
"@ltht-react/button": "^2.0.
|
|
32
|
-
"@ltht-react/icon": "^2.0.
|
|
33
|
-
"@ltht-react/menu": "^2.0.
|
|
34
|
-
"@ltht-react/styles": "^2.0.
|
|
35
|
-
"@ltht-react/types": "^2.0.
|
|
36
|
-
"@ltht-react/utils": "^2.0.
|
|
31
|
+
"@ltht-react/button": "^2.0.170",
|
|
32
|
+
"@ltht-react/icon": "^2.0.170",
|
|
33
|
+
"@ltht-react/menu": "^2.0.170",
|
|
34
|
+
"@ltht-react/styles": "^2.0.170",
|
|
35
|
+
"@ltht-react/types": "^2.0.170",
|
|
36
|
+
"@ltht-react/utils": "^2.0.170",
|
|
37
37
|
"@tanstack/react-table": "^8.10.7",
|
|
38
38
|
"react": "^18.2.0",
|
|
39
39
|
"react-uuid": "^2.0.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "b90e9e507b315116b1be97f114fe7f0ddf2005af"
|
|
42
42
|
}
|
|
@@ -3,12 +3,16 @@ import { Button } from '@ltht-react/button'
|
|
|
3
3
|
import styled from '@emotion/styled'
|
|
4
4
|
import Icon, { IconButton, IconProps } from '@ltht-react/icon'
|
|
5
5
|
import ActionMenu, { ActionMenuOption } from '@ltht-react/menu'
|
|
6
|
-
import {
|
|
6
|
+
import { BTN_COLOURS } from '@ltht-react/styles'
|
|
7
7
|
import { Axis } from '@ltht-react/types'
|
|
8
8
|
|
|
9
9
|
const StyledIconText = styled.span`
|
|
10
10
|
margin-left: 0.4rem;
|
|
11
11
|
`
|
|
12
|
+
const StyledActionMenuContainer = styled.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
`
|
|
12
16
|
|
|
13
17
|
// TODO: This component is still a WIP and will be re-factored soon!
|
|
14
18
|
// May be best to split it out into different components, the important part is unifying Type used by React-Table so the mapping can be simplified
|
|
@@ -33,27 +37,30 @@ const TableCell: FC<CellProps> = ({
|
|
|
33
37
|
return <></>
|
|
34
38
|
}
|
|
35
39
|
return (
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
<StyledActionMenuContainer>
|
|
41
|
+
<ActionMenu
|
|
42
|
+
id={`${`${id ?? ''}-`}action-menu-button`}
|
|
43
|
+
actions={adminActions}
|
|
44
|
+
menuButtonOptions={{
|
|
45
|
+
type: 'button',
|
|
46
|
+
text: '',
|
|
47
|
+
buttonProps: {
|
|
48
|
+
styling: {
|
|
49
|
+
buttonStyle: 'standard',
|
|
50
|
+
padding: headerAxis === 'x' ? '0.3rem 0.5rem' : '0.15rem 0.3rem',
|
|
51
|
+
},
|
|
52
|
+
icon: (
|
|
53
|
+
<Icon {...{ type: headerAxis === 'x' ? 'ellipsis-vertical' : 'ellipsis-horizontal', size: 'medium' }} />
|
|
54
|
+
),
|
|
55
|
+
iconPlacement: 'center',
|
|
56
|
+
color: `${BTN_COLOURS.DANGER.VALUE}`,
|
|
46
57
|
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}}
|
|
54
|
-
popupStyle={{ zIndex: getZIndex(PopUp) }}
|
|
55
|
-
popupPlacement={headerAxis === 'x' ? 'bottom-start' : 'right-start'}
|
|
56
|
-
/>
|
|
58
|
+
}}
|
|
59
|
+
style={{
|
|
60
|
+
width: 'fit-content',
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
</StyledActionMenuContainer>
|
|
57
64
|
)
|
|
58
65
|
}
|
|
59
66
|
|