@zendeskgarden/react-tables 8.57.0 → 8.58.0
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/index.cjs.js +206 -379
- package/dist/index.esm.js +206 -379
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -17,194 +17,81 @@ function _extends$3() {
|
|
|
17
17
|
_extends$3 = Object.assign ? Object.assign.bind() : function (target) {
|
|
18
18
|
for (var i = 1; i < arguments.length; i++) {
|
|
19
19
|
var source = arguments[i];
|
|
20
|
-
|
|
21
20
|
for (var key in source) {
|
|
22
21
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
22
|
target[key] = source[key];
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
return target;
|
|
29
27
|
};
|
|
30
28
|
return _extends$3.apply(this, arguments);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var target = {};
|
|
36
|
-
var sourceKeys = Object.keys(source);
|
|
37
|
-
var key, i;
|
|
38
|
-
|
|
39
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
40
|
-
key = sourceKeys[i];
|
|
41
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
42
|
-
target[key] = source[key];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return target;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _objectWithoutProperties(source, excluded) {
|
|
49
|
-
if (source == null) return {};
|
|
50
|
-
|
|
51
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
52
|
-
|
|
53
|
-
var key, i;
|
|
54
|
-
|
|
55
|
-
if (Object.getOwnPropertySymbols) {
|
|
56
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
57
|
-
|
|
58
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
59
|
-
key = sourceSymbolKeys[i];
|
|
60
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
-
target[key] = source[key];
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return target;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _slicedToArray(arr, i) {
|
|
70
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _arrayWithHoles(arr) {
|
|
74
|
-
if (Array.isArray(arr)) return arr;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _iterableToArrayLimit(arr, i) {
|
|
78
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
79
|
-
|
|
80
|
-
if (_i == null) return;
|
|
81
|
-
var _arr = [];
|
|
82
|
-
var _n = true;
|
|
83
|
-
var _d = false;
|
|
84
|
-
|
|
85
|
-
var _s, _e;
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
89
|
-
_arr.push(_s.value);
|
|
90
|
-
|
|
91
|
-
if (i && _arr.length === i) break;
|
|
92
|
-
}
|
|
93
|
-
} catch (err) {
|
|
94
|
-
_d = true;
|
|
95
|
-
_e = err;
|
|
96
|
-
} finally {
|
|
97
|
-
try {
|
|
98
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
99
|
-
} finally {
|
|
100
|
-
if (_d) throw _e;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return _arr;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
108
|
-
if (!o) return;
|
|
109
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
110
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
111
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
112
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
113
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function _arrayLikeToArray(arr, len) {
|
|
117
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
118
|
-
|
|
119
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
120
|
-
|
|
121
|
-
return arr2;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function _nonIterableRest() {
|
|
125
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var COMPONENT_ID$a = 'tables.body';
|
|
129
|
-
var StyledBody = styled.tbody.attrs({
|
|
31
|
+
const COMPONENT_ID$a = 'tables.body';
|
|
32
|
+
const StyledBody = styled.tbody.attrs({
|
|
130
33
|
'data-garden-id': COMPONENT_ID$a,
|
|
131
|
-
'data-garden-version': '8.
|
|
34
|
+
'data-garden-version': '8.58.0'
|
|
132
35
|
}).withConfig({
|
|
133
36
|
displayName: "StyledBody",
|
|
134
37
|
componentId: "sc-14ud6y-0"
|
|
135
|
-
})(["", ";"],
|
|
136
|
-
return retrieveComponentStyles(COMPONENT_ID$a, props);
|
|
137
|
-
});
|
|
38
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
138
39
|
StyledBody.defaultProps = {
|
|
139
40
|
theme: DEFAULT_THEME
|
|
140
41
|
};
|
|
141
42
|
|
|
142
|
-
|
|
143
|
-
|
|
43
|
+
const COMPONENT_ID$9 = 'tables.caption';
|
|
44
|
+
const StyledCaption = styled.caption.attrs({
|
|
144
45
|
'data-garden-id': COMPONENT_ID$9,
|
|
145
|
-
'data-garden-version': '8.
|
|
46
|
+
'data-garden-version': '8.58.0'
|
|
146
47
|
}).withConfig({
|
|
147
48
|
displayName: "StyledCaption",
|
|
148
49
|
componentId: "sc-113y327-0"
|
|
149
|
-
})(["display:table-caption;text-align:", ";", ";"],
|
|
150
|
-
return props.theme.rtl ? 'right' : 'left';
|
|
151
|
-
}, function (props) {
|
|
152
|
-
return retrieveComponentStyles(COMPONENT_ID$9, props);
|
|
153
|
-
});
|
|
50
|
+
})(["display:table-caption;text-align:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
154
51
|
StyledCaption.defaultProps = {
|
|
155
52
|
theme: DEFAULT_THEME
|
|
156
53
|
};
|
|
157
54
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return
|
|
55
|
+
const COMPONENT_ID$8 = 'tables.table';
|
|
56
|
+
const getLineHeight = props => {
|
|
57
|
+
return `${props.theme.space.base * 5}px`;
|
|
161
58
|
};
|
|
162
|
-
|
|
59
|
+
const StyledTable = styled.table.attrs({
|
|
163
60
|
'data-garden-id': COMPONENT_ID$8,
|
|
164
|
-
'data-garden-version': '8.
|
|
61
|
+
'data-garden-version': '8.58.0'
|
|
165
62
|
}).withConfig({
|
|
166
63
|
displayName: "StyledTable",
|
|
167
64
|
componentId: "sc-gje7na-0"
|
|
168
|
-
})(["display:table;border:none;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;line-height:", ";color:", ";font-size:", ";direction:", ";", ";"],
|
|
169
|
-
return getLineHeight(props);
|
|
170
|
-
}, function (props) {
|
|
171
|
-
return props.theme.colors.foreground;
|
|
172
|
-
}, function (props) {
|
|
173
|
-
return props.theme.fontSizes.md;
|
|
174
|
-
}, function (props) {
|
|
175
|
-
return props.theme.rtl && 'rtl';
|
|
176
|
-
}, function (props) {
|
|
177
|
-
return retrieveComponentStyles(COMPONENT_ID$8, props);
|
|
178
|
-
});
|
|
65
|
+
})(["display:table;border:none;width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;line-height:", ";color:", ";font-size:", ";direction:", ";", ";"], props => getLineHeight(props), props => props.theme.colors.foreground, props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
179
66
|
StyledTable.defaultProps = {
|
|
180
67
|
theme: DEFAULT_THEME
|
|
181
68
|
};
|
|
182
69
|
|
|
183
|
-
|
|
70
|
+
const getRowHeight = props => {
|
|
184
71
|
if (props.size === 'large') {
|
|
185
|
-
return
|
|
72
|
+
return `${props.theme.space.base * 16}px`;
|
|
186
73
|
} else if (props.size === 'small') {
|
|
187
|
-
return
|
|
74
|
+
return `${props.theme.space.base * 8}px`;
|
|
188
75
|
}
|
|
189
|
-
return
|
|
76
|
+
return `${props.theme.space.base * 10}px`;
|
|
190
77
|
};
|
|
191
78
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
79
|
+
const COMPONENT_ID$7 = 'tables.cell';
|
|
80
|
+
const truncatedStyling$1 = css(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
81
|
+
const sizeStyling = props => {
|
|
82
|
+
let boxSizing = 'border-box';
|
|
83
|
+
let padding;
|
|
84
|
+
let width = props.width;
|
|
85
|
+
let height;
|
|
199
86
|
if (props.hasOverflow) {
|
|
200
87
|
boxSizing = 'content-box';
|
|
201
88
|
width = '2em';
|
|
202
89
|
height = 'inherit';
|
|
203
|
-
padding = props.theme.rtl ?
|
|
90
|
+
padding = props.theme.rtl ? `0 0 0 ${props.theme.space.base}px` : `0 ${props.theme.space.base}px 0 0`;
|
|
204
91
|
} else {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
padding =
|
|
92
|
+
const paddingVertical = math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
93
|
+
const paddingHorizontal = `${props.theme.space.base * 3}px`;
|
|
94
|
+
padding = `${paddingVertical} ${paddingHorizontal}`;
|
|
208
95
|
}
|
|
209
96
|
if (props.isMinimum) {
|
|
210
97
|
boxSizing = 'content-box';
|
|
@@ -212,32 +99,26 @@ var sizeStyling = function sizeStyling(props) {
|
|
|
212
99
|
}
|
|
213
100
|
return css(["box-sizing:", ";padding:", ";width:", ";height:", ";"], boxSizing, padding, width, height);
|
|
214
101
|
};
|
|
215
|
-
|
|
102
|
+
const StyledCell = styled.td.attrs({
|
|
216
103
|
'data-garden-id': COMPONENT_ID$7,
|
|
217
|
-
'data-garden-version': '8.
|
|
104
|
+
'data-garden-version': '8.58.0'
|
|
218
105
|
}).withConfig({
|
|
219
106
|
displayName: "StyledCell",
|
|
220
107
|
componentId: "sc-8hpncx-0"
|
|
221
|
-
})(["display:table-cell;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;", ";", ";", ";"],
|
|
222
|
-
return sizeStyling(props);
|
|
223
|
-
}, function (props) {
|
|
224
|
-
return props.isTruncated && truncatedStyling$1;
|
|
225
|
-
}, function (props) {
|
|
226
|
-
return retrieveComponentStyles(COMPONENT_ID$7, props);
|
|
227
|
-
});
|
|
108
|
+
})(["display:table-cell;transition:border-color 0.25s ease-in-out,box-shadow 0.1s ease-in-out;", ";", ";", ";"], props => sizeStyling(props), props => props.isTruncated && truncatedStyling$1, props => retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
228
109
|
StyledCell.defaultProps = {
|
|
229
110
|
theme: DEFAULT_THEME
|
|
230
111
|
};
|
|
231
112
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
113
|
+
const COMPONENT_ID$6 = 'tables.overflow_button';
|
|
114
|
+
const OVERFLOW_BUTTON_SIZE = '2em';
|
|
115
|
+
const colorStyles$1 = props => {
|
|
116
|
+
const boxShadow = props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35));
|
|
117
|
+
const hoverBackgroundColor = getColor('primaryHue', 600, props.theme, 0.08);
|
|
118
|
+
const hoverForegroundColor = getColor('neutralHue', 700, props.theme);
|
|
119
|
+
const activeBackgroundColor = getColor('primaryHue', 600, props.theme, 0.2);
|
|
120
|
+
const activeForegroundColor = getColor('neutralHue', 800, props.theme);
|
|
121
|
+
let foregroundColor;
|
|
241
122
|
if (props.isHovered) {
|
|
242
123
|
foregroundColor = hoverForegroundColor;
|
|
243
124
|
} else if (props.isActive) {
|
|
@@ -247,28 +128,18 @@ var colorStyles$1 = function colorStyles(props) {
|
|
|
247
128
|
}
|
|
248
129
|
return css(["color:", ";&:hover{background-color:", ";color:", ";}&:active{background-color:", ";color:", ";}&:focus{outline:none;}&[data-garden-focus-visible]{box-shadow:inset ", ";}"], foregroundColor, hoverBackgroundColor, hoverForegroundColor, activeBackgroundColor, activeForegroundColor, boxShadow);
|
|
249
130
|
};
|
|
250
|
-
|
|
131
|
+
const StyledOverflowButton = styled.button.attrs({
|
|
251
132
|
'data-garden-id': COMPONENT_ID$6,
|
|
252
|
-
'data-garden-version': '8.
|
|
133
|
+
'data-garden-version': '8.58.0',
|
|
253
134
|
type: 'button'
|
|
254
135
|
}).withConfig({
|
|
255
136
|
displayName: "StyledOverflowButton",
|
|
256
137
|
componentId: "sc-1eba2ml-0"
|
|
257
|
-
})(["display:block;transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;opacity:", ";z-index:", ";margin-top:calc(", " - 1em);border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:100%;height:", ";text-decoration:none;font-size:inherit;", " &[aria-expanded='true']{opacity:1;}", ";"],
|
|
258
|
-
return props.isHovered || props.isFocused || props.isActive ? '1' : '0';
|
|
259
|
-
}, function (props) {
|
|
260
|
-
return props.isActive ? '1' : '0';
|
|
261
|
-
}, function (props) {
|
|
262
|
-
return math("".concat(getRowHeight(props), " / 2"));
|
|
263
|
-
}, OVERFLOW_BUTTON_SIZE, function (props) {
|
|
264
|
-
return colorStyles$1(props);
|
|
265
|
-
}, function (props) {
|
|
266
|
-
return retrieveComponentStyles(COMPONENT_ID$6, props);
|
|
267
|
-
});
|
|
138
|
+
})(["display:block;transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;opacity:", ";z-index:", ";margin-top:calc(", " - 1em);border:none;border-radius:50%;background-color:transparent;cursor:pointer;padding:0;width:100%;height:", ";text-decoration:none;font-size:inherit;", " &[aria-expanded='true']{opacity:1;}", ";"], props => props.isHovered || props.isFocused || props.isActive ? '1' : '0', props => props.isActive ? '1' : '0', props => math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => colorStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
268
139
|
StyledOverflowButton.defaultProps = {
|
|
269
140
|
theme: DEFAULT_THEME
|
|
270
141
|
};
|
|
271
|
-
|
|
142
|
+
const StyledOverflowButtonIconWrapper = styled.div.withConfig({
|
|
272
143
|
displayName: "StyledOverflowButton__StyledOverflowButtonIconWrapper",
|
|
273
144
|
componentId: "sc-1eba2ml-1"
|
|
274
145
|
})(["display:flex;align-items:center;justify-content:center;transform:rotate(90deg);transition:opacity 0.25s ease-in-out,background-color 0.1s ease-in-out;width:", ";height:", ";&:hover{opacity:1;}"], OVERFLOW_BUTTON_SIZE, OVERFLOW_BUTTON_SIZE);
|
|
@@ -276,29 +147,25 @@ StyledOverflowButtonIconWrapper.defaultProps = {
|
|
|
276
147
|
theme: DEFAULT_THEME
|
|
277
148
|
};
|
|
278
149
|
|
|
279
|
-
|
|
280
|
-
|
|
150
|
+
const COMPONENT_ID$5 = 'tables.row';
|
|
151
|
+
const StyledBaseRow = styled.tr.withConfig({
|
|
281
152
|
displayName: "StyledRow__StyledBaseRow",
|
|
282
153
|
componentId: "sc-ek66ow-0"
|
|
283
|
-
})(["display:table-row;transition:background-color 0.1s ease-in-out;border-bottom:", ";background-color:", ";vertical-align:top;box-sizing:border-box;"],
|
|
284
|
-
return "".concat(props.theme.borders.sm, " ").concat(getColor('neutralHue', 200, props.theme));
|
|
285
|
-
}, function (props) {
|
|
286
|
-
return props.isStriped && getColor('neutralHue', 100, props.theme);
|
|
287
|
-
});
|
|
154
|
+
})(["display:table-row;transition:background-color 0.1s ease-in-out;border-bottom:", ";background-color:", ";vertical-align:top;box-sizing:border-box;"], props => `${props.theme.borders.sm} ${getColor('neutralHue', 200, props.theme)}`, props => props.isStriped && getColor('neutralHue', 100, props.theme));
|
|
288
155
|
StyledBaseRow.defaultProps = {
|
|
289
156
|
theme: DEFAULT_THEME
|
|
290
157
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
158
|
+
const colorStyles = props => {
|
|
159
|
+
const boxShadow = `inset ${props.theme.rtl ? '-' : ''}${props.theme.shadowWidths.md} 0 0 0 ${getColor('primaryHue', 600, props.theme)}`;
|
|
160
|
+
const hoveredBackgroundColor = getColor('primaryHue', 600, props.theme, 0.08);
|
|
161
|
+
const hoveredBorderColor = getColor('primaryHue', 200, props.theme);
|
|
162
|
+
const selectedBackgroundColor = getColor('primaryHue', 600, props.theme, 0.2);
|
|
163
|
+
const selectedBorderColor = getColor('primaryHue', 300, props.theme);
|
|
164
|
+
const hoveredSelectedBackgroundColor = getColor('primaryHue', 600, props.theme, 0.28);
|
|
165
|
+
let backgroundColor = undefined;
|
|
166
|
+
let borderColor = undefined;
|
|
167
|
+
let hoverBorderBottomColor = undefined;
|
|
168
|
+
let hoverBackgroundColor = undefined;
|
|
302
169
|
if (props.isSelected) {
|
|
303
170
|
if (props.isHovered) {
|
|
304
171
|
backgroundColor = hoveredSelectedBackgroundColor;
|
|
@@ -317,180 +184,152 @@ var colorStyles = function colorStyles(props) {
|
|
|
317
184
|
}
|
|
318
185
|
return css(["border-bottom-color:", ";background-color:", ";&:hover{border-bottom-color:", ";background-color:", ";", "{opacity:1;}}&:focus{outline:none;}", ":first-of-type{box-shadow:", ";&:focus{box-shadow:", ";}}"], borderColor, backgroundColor, hoverBorderBottomColor, hoverBackgroundColor, StyledOverflowButton, StyledCell, props.isFocused && boxShadow, boxShadow);
|
|
319
186
|
};
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
};
|
|
326
|
-
}).withConfig({
|
|
187
|
+
const StyledRow = styled(StyledBaseRow).attrs(props => ({
|
|
188
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
189
|
+
'data-garden-version': '8.58.0',
|
|
190
|
+
tabIndex: props.isReadOnly ? undefined : -1
|
|
191
|
+
})).withConfig({
|
|
327
192
|
displayName: "StyledRow",
|
|
328
193
|
componentId: "sc-ek66ow-1"
|
|
329
|
-
})(["height:", ";", " ", ";"], getRowHeight,
|
|
330
|
-
return colorStyles(props);
|
|
331
|
-
}, function (props) {
|
|
332
|
-
return retrieveComponentStyles(COMPONENT_ID$5, props);
|
|
333
|
-
});
|
|
194
|
+
})(["height:", ";", " ", ";"], getRowHeight, props => colorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$5, props));
|
|
334
195
|
StyledRow.defaultProps = {
|
|
335
196
|
theme: DEFAULT_THEME
|
|
336
197
|
};
|
|
337
198
|
|
|
338
|
-
|
|
339
|
-
|
|
199
|
+
const COMPONENT_ID$4 = 'tables.header_row';
|
|
200
|
+
const getHeaderRowHeight = props => {
|
|
340
201
|
if (props.size === 'large') {
|
|
341
|
-
return
|
|
202
|
+
return `${props.theme.space.base * 18}px`;
|
|
342
203
|
} else if (props.size === 'small') {
|
|
343
|
-
return
|
|
204
|
+
return `${props.theme.space.base * 10}px`;
|
|
344
205
|
}
|
|
345
|
-
return
|
|
206
|
+
return `${props.theme.space.base * 12}px`;
|
|
346
207
|
};
|
|
347
|
-
|
|
208
|
+
const StyledHeaderRow = styled(StyledBaseRow).attrs({
|
|
348
209
|
'data-garden-id': COMPONENT_ID$4,
|
|
349
|
-
'data-garden-version': '8.
|
|
210
|
+
'data-garden-version': '8.58.0'
|
|
350
211
|
}).withConfig({
|
|
351
212
|
displayName: "StyledHeaderRow",
|
|
352
213
|
componentId: "sc-16ogvdx-0"
|
|
353
|
-
})(["border-bottom-color:", ";height:", ";vertical-align:bottom;font-weight:", ";", "{opacity:1;margin-top:0;margin-bottom:calc(", " - 1em);}", ";"],
|
|
354
|
-
return getColor('neutralHue', 300, props.theme);
|
|
355
|
-
}, getHeaderRowHeight, function (props) {
|
|
356
|
-
return props.theme.fontWeights.semibold;
|
|
357
|
-
}, StyledOverflowButton, function (props) {
|
|
358
|
-
return math("".concat(getHeaderRowHeight(props), " / 2"));
|
|
359
|
-
}, function (props) {
|
|
360
|
-
return retrieveComponentStyles(COMPONENT_ID$4, props);
|
|
361
|
-
});
|
|
214
|
+
})(["border-bottom-color:", ";height:", ";vertical-align:bottom;font-weight:", ";", "{opacity:1;margin-top:0;margin-bottom:calc(", " - 1em);}", ";"], props => getColor('neutralHue', 300, props.theme), getHeaderRowHeight, props => props.theme.fontWeights.semibold, StyledOverflowButton, props => math(`${getHeaderRowHeight(props)} / 2`), props => retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
362
215
|
StyledHeaderRow.defaultProps = {
|
|
363
216
|
theme: DEFAULT_THEME
|
|
364
217
|
};
|
|
365
218
|
|
|
366
|
-
|
|
367
|
-
|
|
219
|
+
const COMPONENT_ID$3 = 'tables.head';
|
|
220
|
+
const StyledHead = styled.thead.attrs({
|
|
368
221
|
'data-garden-id': COMPONENT_ID$3,
|
|
369
|
-
'data-garden-version': '8.
|
|
222
|
+
'data-garden-version': '8.58.0'
|
|
370
223
|
}).withConfig({
|
|
371
224
|
displayName: "StyledHead",
|
|
372
225
|
componentId: "sc-spf23a-0"
|
|
373
|
-
})(["", ";"],
|
|
374
|
-
return retrieveComponentStyles(COMPONENT_ID$3, props);
|
|
375
|
-
});
|
|
226
|
+
})(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
376
227
|
StyledHead.defaultProps = {
|
|
377
228
|
theme: DEFAULT_THEME
|
|
378
229
|
};
|
|
379
230
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
return css(["height:", ";line-height:", ";font-size:", ";", "{padding:", " ", "px;}"], height, lineHeight, props.theme.fontSizes.sm, StyledCell, math(
|
|
231
|
+
const COMPONENT_ID$2 = 'tables.group_row';
|
|
232
|
+
const sizeStyles$1 = props => {
|
|
233
|
+
const height = `${props.theme.space.base * 8}px`;
|
|
234
|
+
const lineHeight = getLineHeight(props);
|
|
235
|
+
return css(["height:", ";line-height:", ";font-size:", ";", "{padding:", " ", "px;}"], height, lineHeight, props.theme.fontSizes.sm, StyledCell, math(`(${height} - ${lineHeight}) / 2`), props.theme.space.base * 3);
|
|
385
236
|
};
|
|
386
|
-
|
|
237
|
+
const StyledGroupRow = styled(StyledBaseRow).attrs({
|
|
387
238
|
'data-garden-id': COMPONENT_ID$2,
|
|
388
|
-
'data-garden-version': '8.
|
|
239
|
+
'data-garden-version': '8.58.0'
|
|
389
240
|
}).withConfig({
|
|
390
241
|
displayName: "StyledGroupRow",
|
|
391
242
|
componentId: "sc-mpd0r8-0"
|
|
392
|
-
})(["background-color:", ";", " ", ";"],
|
|
393
|
-
return getColor('neutralHue', 100, props.theme);
|
|
394
|
-
}, function (props) {
|
|
395
|
-
return sizeStyles$1(props);
|
|
396
|
-
}, function (props) {
|
|
397
|
-
return retrieveComponentStyles(COMPONENT_ID$2, props);
|
|
398
|
-
});
|
|
243
|
+
})(["background-color:", ";", " ", ";"], props => getColor('neutralHue', 100, props.theme), props => sizeStyles$1(props), props => retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
399
244
|
StyledGroupRow.defaultProps = {
|
|
400
245
|
theme: DEFAULT_THEME
|
|
401
246
|
};
|
|
402
247
|
|
|
403
|
-
|
|
404
|
-
|
|
248
|
+
const COMPONENT_ID$1 = 'tables.sortable';
|
|
249
|
+
const StyledBaseIconWrapper = styled.div.withConfig({
|
|
405
250
|
displayName: "StyledSortableButton__StyledBaseIconWrapper",
|
|
406
251
|
componentId: "sc-2s1dli-0"
|
|
407
|
-
})(["display:flex;position:absolute;top:0;", ":0;align-items:center;justify-content:center;opacity:0;width:", ";height:100%;color:inherit;fill:inherit;"],
|
|
408
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
409
|
-
}, function (props) {
|
|
410
|
-
return props.theme.iconSizes.sm;
|
|
411
|
-
});
|
|
252
|
+
})(["display:flex;position:absolute;top:0;", ":0;align-items:center;justify-content:center;opacity:0;width:", ";height:100%;color:inherit;fill:inherit;"], props => props.theme.rtl ? 'left' : 'right', props => props.theme.iconSizes.sm);
|
|
412
253
|
StyledBaseIconWrapper.defaultProps = {
|
|
413
254
|
theme: DEFAULT_THEME
|
|
414
255
|
};
|
|
415
|
-
|
|
256
|
+
const StyledSortableStrokeIconWrapper = styled(StyledBaseIconWrapper).withConfig({
|
|
416
257
|
displayName: "StyledSortableButton__StyledSortableStrokeIconWrapper",
|
|
417
258
|
componentId: "sc-2s1dli-1"
|
|
418
259
|
})([""]);
|
|
419
260
|
StyledSortableStrokeIconWrapper.defaultProps = {
|
|
420
261
|
theme: DEFAULT_THEME
|
|
421
262
|
};
|
|
422
|
-
|
|
263
|
+
const StyledSortableFillIconWrapper = styled(StyledBaseIconWrapper).withConfig({
|
|
423
264
|
displayName: "StyledSortableButton__StyledSortableFillIconWrapper",
|
|
424
265
|
componentId: "sc-2s1dli-2"
|
|
425
266
|
})([""]);
|
|
426
267
|
StyledSortableFillIconWrapper.defaultProps = {
|
|
427
268
|
theme: DEFAULT_THEME
|
|
428
269
|
};
|
|
429
|
-
|
|
270
|
+
const StyledSortableButton = styled.button.attrs({
|
|
430
271
|
'data-garden-id': COMPONENT_ID$1,
|
|
431
|
-
'data-garden-version': '8.
|
|
272
|
+
'data-garden-version': '8.58.0',
|
|
432
273
|
type: 'button'
|
|
433
274
|
}).withConfig({
|
|
434
275
|
displayName: "StyledSortableButton",
|
|
435
276
|
componentId: "sc-2s1dli-3"
|
|
436
|
-
})(["position:relative;border:none;background-color:transparent;cursor:pointer;padding:0;padding-", ":", ";width:", ";text-decoration:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:", ";", "{opacity:", ";}", "{opacity:", ";color:", ";fill:", ";}&:hover,&[data-garden-focus-visible]{text-decoration:none;color:", ";", ";", " ", "}&:focus{outline:none;}", ";"],
|
|
437
|
-
return props.theme.rtl ? 'left' : 'right';
|
|
438
|
-
}, function (props) {
|
|
439
|
-
return math("".concat(props.theme.space.base, " + ").concat(props.theme.iconSizes.sm));
|
|
440
|
-
}, function (props) {
|
|
441
|
-
return props.width;
|
|
442
|
-
}, function (props) {
|
|
443
|
-
return props.theme.fontWeights.semibold;
|
|
444
|
-
}, StyledSortableStrokeIconWrapper, function (props) {
|
|
445
|
-
return props.sort === undefined && 1;
|
|
446
|
-
}, StyledSortableFillIconWrapper, function (props) {
|
|
447
|
-
return props.sort !== undefined && 1;
|
|
448
|
-
}, function (props) {
|
|
277
|
+
})(["position:relative;border:none;background-color:transparent;cursor:pointer;padding:0;padding-", ":", ";width:", ";text-decoration:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:", ";", "{opacity:", ";}", "{opacity:", ";color:", ";fill:", ";}&:hover,&[data-garden-focus-visible]{text-decoration:none;color:", ";", ";", " ", "}&:focus{outline:none;}", ";"], props => props.theme.rtl ? 'left' : 'right', props => math(`${props.theme.space.base} + ${props.theme.iconSizes.sm}`), props => props.width, props => props.theme.fontWeights.semibold, StyledSortableStrokeIconWrapper, props => props.sort === undefined && 1, StyledSortableFillIconWrapper, props => props.sort !== undefined && 1, props => {
|
|
449
278
|
if (props.sort === 'asc') {
|
|
450
279
|
return getColor('neutralHue', 600, props.theme);
|
|
451
280
|
} else if (props.sort === 'desc') {
|
|
452
281
|
return getColor('neutralHue', 400, props.theme);
|
|
453
282
|
}
|
|
454
283
|
return undefined;
|
|
455
|
-
},
|
|
284
|
+
}, props => {
|
|
456
285
|
if (props.sort === 'asc') {
|
|
457
286
|
return getColor('neutralHue', 400, props.theme);
|
|
458
287
|
} else if (props.sort === 'desc') {
|
|
459
288
|
return getColor('neutralHue', 600, props.theme);
|
|
460
289
|
}
|
|
461
290
|
return undefined;
|
|
462
|
-
},
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
291
|
+
}, props => getColor('primaryHue', 600, props.theme), props => props.sort === undefined && `
|
|
292
|
+
${StyledSortableFillIconWrapper} {
|
|
293
|
+
opacity: 1;
|
|
294
|
+
color: ${getColor('primaryHue', 600, props.theme)};
|
|
295
|
+
fill: ${getColor('primaryHue', 600, props.theme)};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
${StyledSortableStrokeIconWrapper} {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
}
|
|
301
|
+
`, props => props.sort === 'asc' && `
|
|
302
|
+
${StyledSortableFillIconWrapper} {
|
|
303
|
+
color: ${getColor('primaryHue', 600, props.theme)};
|
|
304
|
+
fill: ${getColor('primaryHue', 600, props.theme, 0.25)};
|
|
305
|
+
}
|
|
306
|
+
`, props => props.sort === 'desc' && `
|
|
307
|
+
${StyledSortableFillIconWrapper} {
|
|
308
|
+
color: ${getColor('primaryHue', 600, props.theme, 0.25)};
|
|
309
|
+
fill: ${getColor('primaryHue', 600, props.theme)};
|
|
310
|
+
}
|
|
311
|
+
`, props => retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
473
312
|
StyledSortableButton.defaultProps = {
|
|
474
313
|
theme: DEFAULT_THEME
|
|
475
314
|
};
|
|
476
315
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
316
|
+
const COMPONENT_ID = 'tables.header_cell';
|
|
317
|
+
const truncatedStyling = css(["", "{max-width:100%;overflow:hidden;text-overflow:ellipsis;}"], StyledSortableButton);
|
|
318
|
+
const sizeStyles = props => {
|
|
319
|
+
let paddingVertical = undefined;
|
|
481
320
|
if (!props.hasOverflow) {
|
|
482
|
-
paddingVertical = math(
|
|
321
|
+
paddingVertical = math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
483
322
|
}
|
|
484
323
|
return css(["padding-top:", ";padding-bottom:", ";"], paddingVertical, paddingVertical);
|
|
485
324
|
};
|
|
486
|
-
|
|
325
|
+
const StyledHeaderCell = styled(StyledCell).attrs({
|
|
487
326
|
as: 'th',
|
|
488
327
|
'data-garden-id': COMPONENT_ID,
|
|
489
|
-
'data-garden-version': '8.
|
|
328
|
+
'data-garden-version': '8.58.0'
|
|
490
329
|
}).withConfig({
|
|
491
330
|
displayName: "StyledHeaderCell",
|
|
492
331
|
componentId: "sc-fzagoe-0"
|
|
493
|
-
})(["text-align:", ";font-weight:inherit;", " ", " ", ";"],
|
|
332
|
+
})(["text-align:", ";font-weight:inherit;", " ", " ", ";"], props => {
|
|
494
333
|
if (!props.hasOverflow) {
|
|
495
334
|
if (props.theme.rtl) {
|
|
496
335
|
return 'right';
|
|
@@ -498,42 +337,33 @@ var StyledHeaderCell = styled(StyledCell).attrs({
|
|
|
498
337
|
return 'left';
|
|
499
338
|
}
|
|
500
339
|
return undefined;
|
|
501
|
-
},
|
|
502
|
-
return sizeStyles(props);
|
|
503
|
-
}, function (props) {
|
|
504
|
-
return props.isTruncated && truncatedStyling;
|
|
505
|
-
}, function (props) {
|
|
506
|
-
return retrieveComponentStyles(COMPONENT_ID, props);
|
|
507
|
-
});
|
|
340
|
+
}, props => sizeStyles(props), props => props.isTruncated && truncatedStyling, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
508
341
|
StyledHeaderCell.defaultProps = {
|
|
509
342
|
theme: DEFAULT_THEME
|
|
510
343
|
};
|
|
511
344
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}, props));
|
|
516
|
-
});
|
|
345
|
+
const Body = forwardRef((props, ref) => React__default.createElement(StyledBody, _extends$3({
|
|
346
|
+
ref: ref
|
|
347
|
+
}, props)));
|
|
517
348
|
Body.displayName = 'Body';
|
|
518
349
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}, props));
|
|
523
|
-
});
|
|
350
|
+
const Caption = forwardRef((props, ref) => React__default.createElement(StyledCaption, _extends$3({
|
|
351
|
+
ref: ref
|
|
352
|
+
}, props)));
|
|
524
353
|
Caption.displayName = 'Caption';
|
|
525
354
|
|
|
526
|
-
|
|
355
|
+
const TableContext = React__default.createContext({
|
|
527
356
|
size: 'medium',
|
|
528
357
|
isReadOnly: false
|
|
529
358
|
});
|
|
530
|
-
|
|
359
|
+
const useTableContext = () => {
|
|
531
360
|
return useContext(TableContext);
|
|
532
361
|
};
|
|
533
362
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
363
|
+
const Cell = React__default.forwardRef((props, ref) => {
|
|
364
|
+
const {
|
|
365
|
+
size
|
|
366
|
+
} = useTableContext();
|
|
537
367
|
return React__default.createElement(StyledCell, _extends$3({
|
|
538
368
|
ref: ref,
|
|
539
369
|
size: size
|
|
@@ -547,9 +377,10 @@ Cell.propTypes = {
|
|
|
547
377
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
548
378
|
};
|
|
549
379
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
380
|
+
const GroupRow = forwardRef((props, ref) => {
|
|
381
|
+
const {
|
|
382
|
+
size
|
|
383
|
+
} = useTableContext();
|
|
553
384
|
return React__default.createElement(StyledGroupRow, _extends$3({
|
|
554
385
|
ref: ref,
|
|
555
386
|
size: size
|
|
@@ -557,16 +388,15 @@ var GroupRow = forwardRef(function (props, ref) {
|
|
|
557
388
|
});
|
|
558
389
|
GroupRow.displayName = 'GroupRow';
|
|
559
390
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}, props));
|
|
564
|
-
});
|
|
391
|
+
const Head = forwardRef((props, ref) => React__default.createElement(StyledHead, _extends$3({
|
|
392
|
+
ref: ref
|
|
393
|
+
}, props)));
|
|
565
394
|
Head.displayName = 'Head';
|
|
566
395
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
396
|
+
const HeaderCell = forwardRef((props, ref) => {
|
|
397
|
+
const {
|
|
398
|
+
size
|
|
399
|
+
} = useTableContext();
|
|
570
400
|
return React__default.createElement(StyledHeaderCell, _extends$3({
|
|
571
401
|
ref: ref,
|
|
572
402
|
size: size
|
|
@@ -575,9 +405,10 @@ var HeaderCell = forwardRef(function (props, ref) {
|
|
|
575
405
|
HeaderCell.displayName = 'HeaderCell';
|
|
576
406
|
HeaderCell.propTypes = Cell.propTypes;
|
|
577
407
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
408
|
+
const HeaderRow = React__default.forwardRef((props, ref) => {
|
|
409
|
+
const {
|
|
410
|
+
size
|
|
411
|
+
} = useTableContext();
|
|
581
412
|
return React__default.createElement(StyledHeaderRow, _extends$3({
|
|
582
413
|
ref: ref,
|
|
583
414
|
size: size
|
|
@@ -596,7 +427,8 @@ var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
|
596
427
|
height: 16,
|
|
597
428
|
focusable: "false",
|
|
598
429
|
viewBox: "0 0 16 16",
|
|
599
|
-
"aria-hidden": "true"
|
|
430
|
+
"aria-hidden": "true",
|
|
431
|
+
role: "img"
|
|
600
432
|
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
601
433
|
fill: "currentColor"
|
|
602
434
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
@@ -614,23 +446,22 @@ var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
|
614
446
|
}))));
|
|
615
447
|
};
|
|
616
448
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
size = _useTableContext.size;
|
|
449
|
+
const OverflowButton = forwardRef((_ref, ref) => {
|
|
450
|
+
let {
|
|
451
|
+
onFocus,
|
|
452
|
+
onBlur,
|
|
453
|
+
isFocused: focused,
|
|
454
|
+
...other
|
|
455
|
+
} = _ref;
|
|
456
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
457
|
+
const {
|
|
458
|
+
size
|
|
459
|
+
} = useTableContext();
|
|
629
460
|
return React__default.createElement(StyledOverflowButton, _extends$3({
|
|
630
|
-
onFocus: composeEventHandlers(onFocus,
|
|
461
|
+
onFocus: composeEventHandlers(onFocus, () => {
|
|
631
462
|
setIsFocused(true);
|
|
632
463
|
}),
|
|
633
|
-
onBlur: composeEventHandlers(onBlur,
|
|
464
|
+
onBlur: composeEventHandlers(onBlur, () => {
|
|
634
465
|
setIsFocused(false);
|
|
635
466
|
}),
|
|
636
467
|
size: size,
|
|
@@ -645,20 +476,19 @@ OverflowButton.propTypes = {
|
|
|
645
476
|
isFocused: PropTypes.bool
|
|
646
477
|
};
|
|
647
478
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
var computedFocused = useMemo(function () {
|
|
479
|
+
const Row = forwardRef((_ref, ref) => {
|
|
480
|
+
let {
|
|
481
|
+
onFocus,
|
|
482
|
+
onBlur,
|
|
483
|
+
isFocused: focused,
|
|
484
|
+
...otherProps
|
|
485
|
+
} = _ref;
|
|
486
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
487
|
+
const {
|
|
488
|
+
size,
|
|
489
|
+
isReadOnly
|
|
490
|
+
} = useTableContext();
|
|
491
|
+
const computedFocused = useMemo(() => {
|
|
662
492
|
if (typeof focused !== 'undefined') {
|
|
663
493
|
return focused;
|
|
664
494
|
}
|
|
@@ -667,16 +497,12 @@ var Row = forwardRef(function (_ref, ref) {
|
|
|
667
497
|
}
|
|
668
498
|
return isFocused;
|
|
669
499
|
}, [focused, isFocused, isReadOnly]);
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
return composeEventHandlers(onBlur, function () {
|
|
677
|
-
setIsFocused(false);
|
|
678
|
-
});
|
|
679
|
-
}, [onBlur, setIsFocused]);
|
|
500
|
+
const onFocusCallback = useMemo(() => composeEventHandlers(onFocus, () => {
|
|
501
|
+
setIsFocused(true);
|
|
502
|
+
}), [onFocus, setIsFocused]);
|
|
503
|
+
const onBlurCallback = useMemo(() => composeEventHandlers(onBlur, () => {
|
|
504
|
+
setIsFocused(false);
|
|
505
|
+
}), [onBlur, setIsFocused]);
|
|
680
506
|
return React__default.createElement(StyledRow, _extends$3({
|
|
681
507
|
onFocus: onFocusCallback,
|
|
682
508
|
onBlur: onBlurCallback,
|
|
@@ -705,7 +531,8 @@ var SvgSortStroke = function SvgSortStroke(props) {
|
|
|
705
531
|
height: 12,
|
|
706
532
|
focusable: "false",
|
|
707
533
|
viewBox: "0 0 12 12",
|
|
708
|
-
"aria-hidden": "true"
|
|
534
|
+
"aria-hidden": "true",
|
|
535
|
+
role: "img"
|
|
709
536
|
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
710
537
|
fill: "none",
|
|
711
538
|
stroke: "currentColor",
|
|
@@ -725,7 +552,8 @@ var SvgSortFill = function SvgSortFill(props) {
|
|
|
725
552
|
height: 12,
|
|
726
553
|
focusable: "false",
|
|
727
554
|
viewBox: "0 0 12 12",
|
|
728
|
-
"aria-hidden": "true"
|
|
555
|
+
"aria-hidden": "true",
|
|
556
|
+
role: "img"
|
|
729
557
|
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
730
558
|
fill: "currentColor",
|
|
731
559
|
d: "M10 5H2a.5.5 0 01-.46-.31.47.47 0 01.11-.54L5.29.5A1 1 0 016.7.5l3.65 3.65a.49.49 0 01.11.54A.51.51 0 0110 5z"
|
|
@@ -734,23 +562,24 @@ var SvgSortFill = function SvgSortFill(props) {
|
|
|
734
562
|
})));
|
|
735
563
|
};
|
|
736
564
|
|
|
737
|
-
|
|
738
|
-
|
|
565
|
+
const SIZE = ['small', 'medium', 'large'];
|
|
566
|
+
const SORT = ['asc', 'desc'];
|
|
739
567
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
568
|
+
const SortableCell = forwardRef((_ref, ref) => {
|
|
569
|
+
let {
|
|
570
|
+
sort,
|
|
571
|
+
cellProps,
|
|
572
|
+
width,
|
|
573
|
+
children,
|
|
574
|
+
...otherProps
|
|
575
|
+
} = _ref;
|
|
576
|
+
let ariaSortValue = 'none';
|
|
748
577
|
if (sort === 'asc') {
|
|
749
578
|
ariaSortValue = 'ascending';
|
|
750
579
|
} else if (sort === 'desc') {
|
|
751
580
|
ariaSortValue = 'descending';
|
|
752
581
|
}
|
|
753
|
-
|
|
582
|
+
const SortIcon = sort === undefined ? SvgSortStroke : SvgSortFill;
|
|
754
583
|
return React__default.createElement(StyledHeaderCell, _extends$3({
|
|
755
584
|
"aria-sort": ariaSortValue,
|
|
756
585
|
width: width
|
|
@@ -766,13 +595,11 @@ SortableCell.propTypes = {
|
|
|
766
595
|
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
767
596
|
};
|
|
768
597
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
};
|
|
775
|
-
}, [props.size, props.isReadOnly]);
|
|
598
|
+
const Table = React__default.forwardRef((props, ref) => {
|
|
599
|
+
const tableContextValue = useMemo(() => ({
|
|
600
|
+
size: props.size,
|
|
601
|
+
isReadOnly: props.isReadOnly
|
|
602
|
+
}), [props.size, props.isReadOnly]);
|
|
776
603
|
return React__default.createElement(TableContext.Provider, {
|
|
777
604
|
value: tableContextValue
|
|
778
605
|
}, React__default.createElement(StyledTable, _extends$3({
|