@terraware/web-components 3.0.10 → 3.0.11
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.
@@ -1,40 +1,45 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
2
2
|
import { RendererProps } from './types';
|
3
3
|
import { TextAlignment } from '.';
|
4
4
|
export type TableRowType = Record<string, any>;
|
5
5
|
export default function CellRenderer(props: RendererProps<TableRowType>): JSX.Element;
|
6
6
|
export declare const cellDateFormatter: (value?: string) => string | undefined;
|
7
|
-
export declare function CellDateRenderer({ id, value, className, alignment, }: {
|
7
|
+
export declare function CellDateRenderer({ id, value, className, alignment, style, }: {
|
8
8
|
id: string;
|
9
9
|
value: string;
|
10
10
|
className?: string;
|
11
11
|
alignment?: TextAlignment;
|
12
|
+
style?: CSSProperties;
|
12
13
|
}): JSX.Element;
|
13
|
-
export declare function CellTextRenderer({ id, value, className, alignment, }: {
|
14
|
+
export declare function CellTextRenderer({ id, value, className, alignment, style, }: {
|
14
15
|
id: string;
|
15
16
|
value?: string | number | any[] | ReactNode;
|
16
17
|
className?: string;
|
17
18
|
alignment?: TextAlignment;
|
19
|
+
style?: CSSProperties;
|
18
20
|
}): JSX.Element;
|
19
|
-
export declare function CellBooleanRenderer({ id, value, className, booleanFalseText, booleanTrueText, alignment, }: {
|
21
|
+
export declare function CellBooleanRenderer({ id, value, className, booleanFalseText, booleanTrueText, alignment, style, }: {
|
20
22
|
id: string;
|
21
23
|
value?: boolean | string | number | any[] | ReactNode;
|
22
24
|
className?: string;
|
23
25
|
booleanFalseText: string;
|
24
26
|
booleanTrueText: string;
|
25
27
|
alignment?: TextAlignment;
|
28
|
+
style?: CSSProperties;
|
26
29
|
}): JSX.Element;
|
27
|
-
export declare function CellNotesRenderer({ id, value, className, alignment, }: {
|
30
|
+
export declare function CellNotesRenderer({ id, value, className, alignment, style, }: {
|
28
31
|
id: string;
|
29
32
|
value?: string;
|
30
33
|
className?: string;
|
31
34
|
alignment?: TextAlignment;
|
35
|
+
style?: CSSProperties;
|
32
36
|
}): JSX.Element;
|
33
|
-
export declare function CellEditRenderer({ id, onRowClick, className, editText, alignment, }: {
|
37
|
+
export declare function CellEditRenderer({ id, onRowClick, className, editText, alignment, style, }: {
|
34
38
|
id: string;
|
35
39
|
onRowClick?: () => void;
|
36
40
|
className?: string;
|
37
41
|
editText: string;
|
38
42
|
alignment?: TextAlignment;
|
43
|
+
style?: CSSProperties;
|
39
44
|
}): JSX.Element;
|
40
45
|
//# sourceMappingURL=TableCellRenderer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TableCellRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableCellRenderer.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"TableCellRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableCellRenderer.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAuBlC,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAkCpF;AAED,eAAO,MAAM,iBAAiB,WAAY,MAAM,KAAG,MAAM,GAAG,SAI3D,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,KAAK,EACL,SAAS,EACT,SAAS,EACT,KAAK,GACN,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,M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AgB,CAAC,EAC/B,EAAE,EACF,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,GAAG,GAAG,CAAC,OAAO,CAwBd"}
|
@@ -45,7 +45,8 @@ function CellRenderer(props) {
|
|
45
45
|
className,
|
46
46
|
booleanFalseText,
|
47
47
|
booleanTrueText,
|
48
|
-
editText
|
48
|
+
editText,
|
49
|
+
style
|
49
50
|
} = props;
|
50
51
|
const id = "row".concat(index, "-").concat(column.key);
|
51
52
|
if (column.type === 'date' && typeof value === 'string' && value) {
|
@@ -53,14 +54,16 @@ function CellRenderer(props) {
|
|
53
54
|
id: id,
|
54
55
|
value: value,
|
55
56
|
className: className,
|
56
|
-
alignment: column.alignment
|
57
|
+
alignment: column.alignment,
|
58
|
+
style: style
|
57
59
|
});
|
58
60
|
} else if (column.type === 'notes' && value && typeof value === 'string') {
|
59
61
|
return /*#__PURE__*/_react.default.createElement(CellNotesRenderer, {
|
60
62
|
id: id,
|
61
63
|
value: value,
|
62
64
|
className: className,
|
63
|
-
alignment: column.alignment
|
65
|
+
alignment: column.alignment,
|
66
|
+
style: style
|
64
67
|
});
|
65
68
|
} else if (column.type === 'boolean') {
|
66
69
|
return /*#__PURE__*/_react.default.createElement(CellBooleanRenderer, {
|
@@ -69,7 +72,8 @@ function CellRenderer(props) {
|
|
69
72
|
className: className,
|
70
73
|
booleanFalseText: booleanFalseText,
|
71
74
|
booleanTrueText: booleanTrueText,
|
72
|
-
alignment: column.alignment
|
75
|
+
alignment: column.alignment,
|
76
|
+
style: style
|
73
77
|
});
|
74
78
|
} else if (column.type === 'edit') {
|
75
79
|
return /*#__PURE__*/_react.default.createElement(CellEditRenderer, {
|
@@ -77,14 +81,16 @@ function CellRenderer(props) {
|
|
77
81
|
onRowClick: onRowClick,
|
78
82
|
className: className,
|
79
83
|
editText: editText,
|
80
|
-
alignment: column.alignment
|
84
|
+
alignment: column.alignment,
|
85
|
+
style: style
|
81
86
|
});
|
82
87
|
}
|
83
88
|
return /*#__PURE__*/_react.default.createElement(CellTextRenderer, {
|
84
89
|
id: id,
|
85
90
|
value: value,
|
86
91
|
className: className,
|
87
|
-
alignment: column.alignment
|
92
|
+
alignment: column.alignment,
|
93
|
+
style: style
|
88
94
|
});
|
89
95
|
}
|
90
96
|
const cellDateFormatter = value => {
|
@@ -98,13 +104,15 @@ function CellDateRenderer(_ref) {
|
|
98
104
|
id,
|
99
105
|
value,
|
100
106
|
className,
|
101
|
-
alignment
|
107
|
+
alignment,
|
108
|
+
style
|
102
109
|
} = _ref;
|
103
110
|
const classes = useStyles();
|
104
111
|
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
105
112
|
id: id,
|
106
113
|
align: alignment || 'left',
|
107
|
-
className: "".concat(classes.date, " ").concat(classes.default, " ").concat(className)
|
114
|
+
className: "".concat(classes.date, " ").concat(classes.default, " ").concat(className),
|
115
|
+
sx: style
|
108
116
|
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
109
117
|
component: "p",
|
110
118
|
variant: "body1",
|
@@ -116,14 +124,16 @@ function CellTextRenderer(_ref2) {
|
|
116
124
|
id,
|
117
125
|
value,
|
118
126
|
className,
|
119
|
-
alignment
|
127
|
+
alignment,
|
128
|
+
style
|
120
129
|
} = _ref2;
|
121
130
|
const classes = useStyles();
|
122
131
|
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
123
132
|
id: id,
|
124
133
|
align: alignment || 'left',
|
125
134
|
title: typeof value === 'string' ? value : '',
|
126
|
-
className: "".concat(classes.default, " ").concat(className)
|
135
|
+
className: "".concat(classes.default, " ").concat(className),
|
136
|
+
sx: style
|
127
137
|
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
128
138
|
component: "p",
|
129
139
|
variant: "body1",
|
@@ -141,13 +151,15 @@ function CellBooleanRenderer(_ref3) {
|
|
141
151
|
className,
|
142
152
|
booleanFalseText,
|
143
153
|
booleanTrueText,
|
144
|
-
alignment
|
154
|
+
alignment,
|
155
|
+
style
|
145
156
|
} = _ref3;
|
146
157
|
const classes = useStyles();
|
147
158
|
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
148
159
|
id: id,
|
149
160
|
align: alignment || 'left',
|
150
|
-
className: "".concat(classes.default, " ").concat(className)
|
161
|
+
className: "".concat(classes.default, " ").concat(className),
|
162
|
+
sx: style
|
151
163
|
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
152
164
|
component: "p",
|
153
165
|
variant: "body1",
|
@@ -159,13 +171,15 @@ function CellNotesRenderer(_ref4) {
|
|
159
171
|
id,
|
160
172
|
value,
|
161
173
|
className,
|
162
|
-
alignment
|
174
|
+
alignment,
|
175
|
+
style
|
163
176
|
} = _ref4;
|
164
177
|
const classes = useStyles();
|
165
178
|
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
166
179
|
id: id,
|
167
180
|
align: alignment || 'left',
|
168
|
-
className: "".concat(classes.default, " ").concat(className)
|
181
|
+
className: "".concat(classes.default, " ").concat(className),
|
182
|
+
sx: style
|
169
183
|
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
170
184
|
id: id,
|
171
185
|
component: "p",
|
@@ -179,13 +193,15 @@ function CellEditRenderer(_ref5) {
|
|
179
193
|
onRowClick,
|
180
194
|
className,
|
181
195
|
editText,
|
182
|
-
alignment
|
196
|
+
alignment,
|
197
|
+
style
|
183
198
|
} = _ref5;
|
184
199
|
const classes = useStyles();
|
185
200
|
return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
|
186
201
|
id: id,
|
187
202
|
align: alignment || 'left',
|
188
|
-
className: "".concat(classes.default, " ").concat(className)
|
203
|
+
className: "".concat(classes.default, " ").concat(className),
|
204
|
+
sx: style
|
189
205
|
}, /*#__PURE__*/_react.default.createElement(_material.Link, {
|
190
206
|
id: "".concat(id, "-button"),
|
191
207
|
href: "#",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ReactNode } from 'react';
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
2
2
|
import { TooltipProps } from '@mui/material';
|
3
3
|
import { TextAlignment } from '.';
|
4
4
|
export interface TableColumnType {
|
@@ -17,6 +17,7 @@ export interface RendererProps<T> {
|
|
17
17
|
onRowClick?: (newValue?: string) => void;
|
18
18
|
reloadData?: () => void;
|
19
19
|
className?: string;
|
20
|
+
style?: CSSProperties;
|
20
21
|
booleanFalseText: string;
|
21
22
|
booleanTrueText: string;
|
22
23
|
editText: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/table/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/table/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;AAElC,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC3B,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,WAAW,aAA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