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