@zendeskgarden/react-tables 9.0.0-next.13 → 9.0.0-next.15
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/LICENSE.md +176 -0
- package/dist/esm/elements/Cell.js +7 -1
- package/dist/esm/elements/GroupRow.js +1 -1
- package/dist/esm/elements/Head.js +10 -3
- package/dist/esm/elements/HeaderCell.js +7 -1
- package/dist/esm/elements/HeaderRow.js +1 -1
- package/dist/esm/elements/OverflowButton.js +9 -27
- package/dist/esm/elements/Row.js +13 -5
- package/dist/esm/elements/SortableCell.js +13 -5
- package/dist/esm/elements/Table.js +9 -4
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/{overflow-stroke.svg.js → overflow-vertical-stroke.svg.js} +7 -18
- package/dist/esm/styled/StyledBaseRow.js +46 -0
- package/dist/esm/styled/StyledBody.js +1 -1
- package/dist/esm/styled/StyledCaption.js +1 -1
- package/dist/esm/styled/StyledCell.js +4 -4
- package/dist/esm/styled/StyledGroupRow.js +20 -4
- package/dist/esm/styled/StyledHead.js +19 -6
- package/dist/esm/styled/StyledHeaderCell.js +4 -4
- package/dist/esm/styled/StyledHeaderRow.js +20 -7
- package/dist/esm/styled/StyledHiddenCell.js +1 -1
- package/dist/esm/styled/StyledOverflowButton.js +7 -32
- package/dist/esm/styled/StyledRow.js +71 -27
- package/dist/esm/styled/StyledSortableButton.js +63 -40
- package/dist/esm/styled/StyledTable.js +6 -3
- package/dist/esm/styled/style-utils.js +2 -2
- package/dist/index.cjs.js +395 -260
- package/dist/typings/elements/OverflowButton.d.ts +2 -10
- package/dist/typings/styled/StyledBaseRow.d.ts +11 -0
- package/dist/typings/styled/StyledCell.d.ts +5 -2
- package/dist/typings/styled/StyledGroupRow.d.ts +7 -3
- package/dist/typings/styled/StyledHead.d.ts +1 -1
- package/dist/typings/styled/StyledHeaderRow.d.ts +7 -3
- package/dist/typings/styled/StyledOverflowButton.d.ts +7 -9
- package/dist/typings/styled/StyledRow.d.ts +10 -8
- package/dist/typings/styled/StyledSortableButton.d.ts +5 -4
- package/dist/typings/styled/StyledTable.d.ts +4 -6
- package/dist/typings/styled/index.d.ts +1 -1
- package/dist/typings/styled/style-utils.d.ts +1 -1
- package/package.json +5 -3
package/dist/index.cjs.js
CHANGED
|
@@ -10,6 +10,7 @@ var React = require('react');
|
|
|
10
10
|
var styled = require('styled-components');
|
|
11
11
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
12
12
|
var polished = require('polished');
|
|
13
|
+
var reactButtons = require('@zendeskgarden/react-buttons');
|
|
13
14
|
var PropTypes = require('prop-types');
|
|
14
15
|
var containerUtilities = require('@zendeskgarden/container-utilities');
|
|
15
16
|
|
|
@@ -40,7 +41,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
40
41
|
const COMPONENT_ID$b = 'tables.body';
|
|
41
42
|
const StyledBody = styled__default.default.tbody.attrs({
|
|
42
43
|
'data-garden-id': COMPONENT_ID$b,
|
|
43
|
-
'data-garden-version': '9.0.0-next.
|
|
44
|
+
'data-garden-version': '9.0.0-next.15'
|
|
44
45
|
}).withConfig({
|
|
45
46
|
displayName: "StyledBody",
|
|
46
47
|
componentId: "sc-14ud6y-0"
|
|
@@ -52,7 +53,7 @@ StyledBody.defaultProps = {
|
|
|
52
53
|
const COMPONENT_ID$a = 'tables.caption';
|
|
53
54
|
const StyledCaption = styled__default.default.caption.attrs({
|
|
54
55
|
'data-garden-id': COMPONENT_ID$a,
|
|
55
|
-
'data-garden-version': '9.0.0-next.
|
|
56
|
+
'data-garden-version': '9.0.0-next.15'
|
|
56
57
|
}).withConfig({
|
|
57
58
|
displayName: "StyledCaption",
|
|
58
59
|
componentId: "sc-113y327-0"
|
|
@@ -61,206 +62,212 @@ StyledCaption.defaultProps = {
|
|
|
61
62
|
theme: reactTheming.DEFAULT_THEME
|
|
62
63
|
};
|
|
63
64
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
const sizeStyles$4 = _ref => {
|
|
66
|
+
let {
|
|
67
|
+
theme
|
|
68
|
+
} = _ref;
|
|
69
|
+
return styled.css(["border-bottom:", ";vertical-align:top;box-sizing:border-box;"], theme.borders.sm);
|
|
67
70
|
};
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
const colorStyles$5 = _ref2 => {
|
|
72
|
+
let {
|
|
73
|
+
theme,
|
|
74
|
+
$isStriped
|
|
75
|
+
} = _ref2;
|
|
76
|
+
const borderColor = reactTheming.getColor({
|
|
77
|
+
variable: 'border.subtle',
|
|
78
|
+
theme
|
|
79
|
+
});
|
|
80
|
+
const backgroundColor = reactTheming.getColor({
|
|
81
|
+
variable: 'background.subtle',
|
|
82
|
+
transparency: theme.opacity[100],
|
|
83
|
+
light: {
|
|
84
|
+
offset: 300
|
|
85
|
+
},
|
|
86
|
+
dark: {
|
|
87
|
+
offset: -600
|
|
88
|
+
},
|
|
89
|
+
theme
|
|
90
|
+
});
|
|
91
|
+
return styled.css(["border-bottom-color:", ";background-color:", ";"], borderColor, $isStriped && backgroundColor);
|
|
92
|
+
};
|
|
93
|
+
const StyledBaseRow = styled__default.default.tr.withConfig({
|
|
94
|
+
displayName: "StyledBaseRow",
|
|
95
|
+
componentId: "sc-1t4zqg4-0"
|
|
96
|
+
})(["display:table-row;transition:background-color 0.1s ease-in-out;", " ", ""], sizeStyles$4, colorStyles$5);
|
|
97
|
+
StyledBaseRow.defaultProps = {
|
|
76
98
|
theme: reactTheming.DEFAULT_THEME
|
|
77
99
|
};
|
|
78
100
|
|
|
79
101
|
const getRowHeight = props => {
|
|
80
|
-
if (props
|
|
102
|
+
if (props.$size === 'large') {
|
|
81
103
|
return `${props.theme.space.base * 16}px`;
|
|
82
|
-
} else if (props
|
|
104
|
+
} else if (props.$size === 'small') {
|
|
83
105
|
return `${props.theme.space.base * 8}px`;
|
|
84
106
|
}
|
|
85
107
|
return `${props.theme.space.base * 10}px`;
|
|
86
108
|
};
|
|
87
109
|
|
|
88
|
-
const COMPONENT_ID$
|
|
89
|
-
const truncatedStyling$1 = styled.css(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
90
|
-
const sizeStyling = props => {
|
|
91
|
-
let boxSizing = 'border-box';
|
|
92
|
-
let padding;
|
|
93
|
-
let width = props.width;
|
|
94
|
-
let height;
|
|
95
|
-
if (props.hasOverflow) {
|
|
96
|
-
boxSizing = 'content-box';
|
|
97
|
-
width = '2em';
|
|
98
|
-
height = 'inherit';
|
|
99
|
-
padding = props.theme.rtl ? `0 0 0 ${props.theme.space.base}px` : `0 ${props.theme.space.base}px 0 0`;
|
|
100
|
-
} else {
|
|
101
|
-
const paddingVertical = polished.math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
102
|
-
const paddingHorizontal = `${props.theme.space.base * 3}px`;
|
|
103
|
-
padding = `${paddingVertical} ${paddingHorizontal}`;
|
|
104
|
-
}
|
|
105
|
-
if (props.isMinimum) {
|
|
106
|
-
boxSizing = 'content-box';
|
|
107
|
-
width = '1em';
|
|
108
|
-
}
|
|
109
|
-
return styled.css(["box-sizing:", ";padding:", ";width:", ";height:", ";"], boxSizing, padding, width, height);
|
|
110
|
-
};
|
|
111
|
-
const StyledCell = styled__default.default.td.attrs({
|
|
112
|
-
'data-garden-id': COMPONENT_ID$8,
|
|
113
|
-
'data-garden-version': '9.0.0-next.13'
|
|
114
|
-
}).withConfig({
|
|
115
|
-
displayName: "StyledCell",
|
|
116
|
-
componentId: "sc-8hpncx-0"
|
|
117
|
-
})(["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$8, props));
|
|
118
|
-
StyledCell.defaultProps = {
|
|
119
|
-
theme: reactTheming.DEFAULT_THEME
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const COMPONENT_ID$7 = 'tables.overflow_button';
|
|
110
|
+
const COMPONENT_ID$9 = 'tables.overflow_button';
|
|
123
111
|
const OVERFLOW_BUTTON_SIZE = '2em';
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const activeBackgroundColor = reactTheming.getColorV8('primaryHue', 600, props.theme, 0.2);
|
|
128
|
-
const activeForegroundColor = reactTheming.getColorV8('neutralHue', 800, props.theme);
|
|
129
|
-
let foregroundColor;
|
|
130
|
-
if (props.isHovered) {
|
|
131
|
-
foregroundColor = hoverForegroundColor;
|
|
132
|
-
} else if (props.isActive) {
|
|
133
|
-
foregroundColor = activeForegroundColor;
|
|
134
|
-
} else {
|
|
135
|
-
foregroundColor = reactTheming.getColorV8('neutralHue', 600, props.theme);
|
|
136
|
-
}
|
|
137
|
-
return styled.css(["color:", ";&:hover{background-color:", ";color:", ";}", " &:active{background-color:", ";color:", ";}"], foregroundColor, hoverBackgroundColor, hoverForegroundColor, reactTheming.focusStyles({
|
|
138
|
-
theme: props.theme,
|
|
139
|
-
inset: true
|
|
140
|
-
}), activeBackgroundColor, activeForegroundColor);
|
|
141
|
-
};
|
|
142
|
-
const StyledOverflowButton = styled__default.default.button.attrs({
|
|
143
|
-
'data-garden-id': COMPONENT_ID$7,
|
|
144
|
-
'data-garden-version': '9.0.0-next.13',
|
|
145
|
-
type: 'button'
|
|
112
|
+
const StyledOverflowButton = styled__default.default(reactButtons.IconButton).attrs({
|
|
113
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
114
|
+
'data-garden-version': '9.0.0-next.15'
|
|
146
115
|
}).withConfig({
|
|
147
116
|
displayName: "StyledOverflowButton",
|
|
148
117
|
componentId: "sc-1eba2ml-0"
|
|
149
|
-
})(["
|
|
118
|
+
})(["margin-top:calc(", " - 1em);width:100%;min-width:unset;height:", ";font-size:inherit;", ";"], props => polished.math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$9, props));
|
|
150
119
|
StyledOverflowButton.defaultProps = {
|
|
151
120
|
theme: reactTheming.DEFAULT_THEME
|
|
152
121
|
};
|
|
153
|
-
const StyledOverflowButtonIconWrapper = styled__default.default.div.withConfig({
|
|
154
|
-
displayName: "StyledOverflowButton__StyledOverflowButtonIconWrapper",
|
|
155
|
-
componentId: "sc-1eba2ml-1"
|
|
156
|
-
})(["display:flex;align-items:center;justify-content:center;transform:rotate(90deg);transition:background-color 0.1s ease-in-out;width:", ";height:", ";"], OVERFLOW_BUTTON_SIZE, OVERFLOW_BUTTON_SIZE);
|
|
157
|
-
StyledOverflowButtonIconWrapper.defaultProps = {
|
|
158
|
-
theme: reactTheming.DEFAULT_THEME
|
|
159
|
-
};
|
|
160
122
|
|
|
161
|
-
const COMPONENT_ID$
|
|
162
|
-
const StyledBaseRow = styled__default.default.tr.withConfig({
|
|
163
|
-
displayName: "StyledRow__StyledBaseRow",
|
|
164
|
-
componentId: "sc-ek66ow-0"
|
|
165
|
-
})(["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.getColorV8('neutralHue', 200, props.theme)}`, props => props.isStriped && reactTheming.getColorV8('neutralHue', 100, props.theme));
|
|
166
|
-
StyledBaseRow.defaultProps = {
|
|
167
|
-
theme: reactTheming.DEFAULT_THEME
|
|
168
|
-
};
|
|
169
|
-
const colorStyles = props => {
|
|
170
|
-
const boxShadow = `inset ${props.theme.rtl ? '-' : ''}${props.theme.shadowWidths.md} 0 0 0 ${reactTheming.getColorV8('primaryHue', 600, props.theme)}`;
|
|
171
|
-
const hoveredBackgroundColor = reactTheming.getColorV8('primaryHue', 600, props.theme, 0.08);
|
|
172
|
-
const hoveredBorderColor = reactTheming.getColorV8('primaryHue', 200, props.theme);
|
|
173
|
-
const selectedBackgroundColor = reactTheming.getColorV8('primaryHue', 600, props.theme, 0.2);
|
|
174
|
-
const selectedBorderColor = reactTheming.getColorV8('primaryHue', 300, props.theme);
|
|
175
|
-
const hoveredSelectedBackgroundColor = reactTheming.getColorV8('primaryHue', 600, props.theme, 0.28);
|
|
176
|
-
let backgroundColor = undefined;
|
|
177
|
-
let borderColor = undefined;
|
|
178
|
-
let hoverBorderBottomColor = undefined;
|
|
179
|
-
let hoverBackgroundColor = undefined;
|
|
180
|
-
if (props.isSelected) {
|
|
181
|
-
if (props.isHovered) {
|
|
182
|
-
backgroundColor = hoveredSelectedBackgroundColor;
|
|
183
|
-
} else {
|
|
184
|
-
backgroundColor = selectedBackgroundColor;
|
|
185
|
-
}
|
|
186
|
-
borderColor = selectedBorderColor;
|
|
187
|
-
hoverBorderBottomColor = selectedBorderColor;
|
|
188
|
-
hoverBackgroundColor = hoveredSelectedBackgroundColor;
|
|
189
|
-
} else if (props.isHovered) {
|
|
190
|
-
backgroundColor = hoveredBackgroundColor;
|
|
191
|
-
borderColor = hoveredBorderColor;
|
|
192
|
-
} else if (!props.isReadOnly) {
|
|
193
|
-
hoverBorderBottomColor = hoveredBorderColor;
|
|
194
|
-
hoverBackgroundColor = hoveredBackgroundColor;
|
|
195
|
-
}
|
|
196
|
-
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);
|
|
197
|
-
};
|
|
198
|
-
const StyledRow = styled__default.default(StyledBaseRow).attrs(props => ({
|
|
199
|
-
'data-garden-id': COMPONENT_ID$6,
|
|
200
|
-
'data-garden-version': '9.0.0-next.13',
|
|
201
|
-
tabIndex: props.isReadOnly ? undefined : -1
|
|
202
|
-
})).withConfig({
|
|
203
|
-
displayName: "StyledRow",
|
|
204
|
-
componentId: "sc-ek66ow-1"
|
|
205
|
-
})(["height:", ";", " ", ";"], getRowHeight, props => colorStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
206
|
-
StyledRow.defaultProps = {
|
|
207
|
-
theme: reactTheming.DEFAULT_THEME
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
const COMPONENT_ID$5 = 'tables.header_row';
|
|
123
|
+
const COMPONENT_ID$8 = 'tables.header_row';
|
|
211
124
|
const getHeaderRowHeight = props => {
|
|
212
|
-
if (props
|
|
125
|
+
if (props.$size === 'large') {
|
|
213
126
|
return `${props.theme.space.base * 18}px`;
|
|
214
|
-
} else if (props
|
|
127
|
+
} else if (props.$size === 'small') {
|
|
215
128
|
return `${props.theme.space.base * 10}px`;
|
|
216
129
|
}
|
|
217
130
|
return `${props.theme.space.base * 12}px`;
|
|
218
131
|
};
|
|
132
|
+
const colorStyles$4 = _ref => {
|
|
133
|
+
let {
|
|
134
|
+
theme
|
|
135
|
+
} = _ref;
|
|
136
|
+
return styled.css(["border-bottom-color:", ";"], reactTheming.getColor({
|
|
137
|
+
variable: 'border.default',
|
|
138
|
+
theme
|
|
139
|
+
}));
|
|
140
|
+
};
|
|
141
|
+
const sizeStyles$3 = props => {
|
|
142
|
+
const rowHeight = getHeaderRowHeight(props);
|
|
143
|
+
return styled.css(["height:", ";vertical-align:bottom;", "{margin-top:0;margin-bottom:calc(", " - 1em);}"], rowHeight, StyledOverflowButton, polished.math(`${rowHeight} / 2`));
|
|
144
|
+
};
|
|
219
145
|
const StyledHeaderRow = styled__default.default(StyledBaseRow).attrs({
|
|
220
|
-
'data-garden-id': COMPONENT_ID$
|
|
221
|
-
'data-garden-version': '9.0.0-next.
|
|
146
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
147
|
+
'data-garden-version': '9.0.0-next.15'
|
|
222
148
|
}).withConfig({
|
|
223
149
|
displayName: "StyledHeaderRow",
|
|
224
150
|
componentId: "sc-16ogvdx-0"
|
|
225
|
-
})(["
|
|
151
|
+
})(["font-weight:", ";", " ", " ", "{opacity:1;}", ";"], props => props.theme.fontWeights.semibold, sizeStyles$3, colorStyles$4, StyledOverflowButton, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
226
152
|
StyledHeaderRow.defaultProps = {
|
|
227
153
|
theme: reactTheming.DEFAULT_THEME
|
|
228
154
|
};
|
|
229
155
|
|
|
230
|
-
const COMPONENT_ID$
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
156
|
+
const COMPONENT_ID$7 = 'tables.head';
|
|
157
|
+
const colorStyles$3 = _ref => {
|
|
158
|
+
let {
|
|
159
|
+
theme
|
|
160
|
+
} = _ref;
|
|
161
|
+
const borderColor = reactTheming.getColor({
|
|
162
|
+
variable: 'border.default',
|
|
163
|
+
theme
|
|
164
|
+
});
|
|
165
|
+
const backgroundColor = reactTheming.getColor({
|
|
166
|
+
variable: 'background.default',
|
|
167
|
+
theme
|
|
168
|
+
});
|
|
169
|
+
return styled.css(["box-shadow:inset 0 -", " 0 ", ";background-color:", ";& > ", ":last-child{border-bottom-color:transparent;}"], theme.borderWidths.sm, borderColor, backgroundColor, StyledHeaderRow);
|
|
170
|
+
};
|
|
171
|
+
const stickyStyles = () => {
|
|
172
|
+
return styled.css(["position:sticky;top:0;z-index:1;"]);
|
|
234
173
|
};
|
|
235
174
|
const StyledHead = styled__default.default.thead.attrs({
|
|
236
|
-
'data-garden-id': COMPONENT_ID$
|
|
237
|
-
'data-garden-version': '9.0.0-next.
|
|
175
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
176
|
+
'data-garden-version': '9.0.0-next.15'
|
|
238
177
|
}).withConfig({
|
|
239
178
|
displayName: "StyledHead",
|
|
240
179
|
componentId: "sc-spf23a-0"
|
|
241
|
-
})(["", " ", ";"], props => props
|
|
180
|
+
})(["", " ", " ", ";"], props => props.$isSticky && stickyStyles(), colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
242
181
|
StyledHead.defaultProps = {
|
|
243
182
|
theme: reactTheming.DEFAULT_THEME
|
|
244
183
|
};
|
|
245
184
|
|
|
246
|
-
const COMPONENT_ID$
|
|
247
|
-
const
|
|
185
|
+
const COMPONENT_ID$6 = 'tables.table';
|
|
186
|
+
const getLineHeight = props => {
|
|
187
|
+
return `${props.theme.space.base * 5}px`;
|
|
188
|
+
};
|
|
189
|
+
const StyledTable = styled__default.default.table.attrs({
|
|
190
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
191
|
+
'data-garden-version': '9.0.0-next.15'
|
|
192
|
+
}).withConfig({
|
|
193
|
+
displayName: "StyledTable",
|
|
194
|
+
componentId: "sc-gje7na-0"
|
|
195
|
+
})(["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 => reactTheming.getColor({
|
|
196
|
+
variable: 'foreground.default',
|
|
197
|
+
theme: props.theme
|
|
198
|
+
}), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
199
|
+
StyledTable.defaultProps = {
|
|
200
|
+
theme: reactTheming.DEFAULT_THEME
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const COMPONENT_ID$5 = 'tables.cell';
|
|
204
|
+
const truncatedStyling$1 = styled.css(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
205
|
+
const sizeStyling = props => {
|
|
206
|
+
let boxSizing = 'border-box';
|
|
207
|
+
let padding;
|
|
208
|
+
let width = props.width;
|
|
209
|
+
let height;
|
|
210
|
+
if (props.$hasOverflow) {
|
|
211
|
+
boxSizing = 'content-box';
|
|
212
|
+
width = '2em';
|
|
213
|
+
height = 'inherit';
|
|
214
|
+
padding = props.theme.rtl ? `0 0 0 ${props.theme.space.base}px` : `0 ${props.theme.space.base}px 0 0`;
|
|
215
|
+
} else {
|
|
216
|
+
const paddingVertical = polished.math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
217
|
+
const paddingHorizontal = `${props.theme.space.base * 3}px`;
|
|
218
|
+
padding = `${paddingVertical} ${paddingHorizontal}`;
|
|
219
|
+
}
|
|
220
|
+
if (props.$isMinimum) {
|
|
221
|
+
boxSizing = 'content-box';
|
|
222
|
+
width = '1em';
|
|
223
|
+
}
|
|
224
|
+
return styled.css(["box-sizing:", ";padding:", ";width:", ";height:", ";"], boxSizing, padding, width, height);
|
|
225
|
+
};
|
|
226
|
+
const StyledCell = styled__default.default.td.attrs({
|
|
227
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
228
|
+
'data-garden-version': '9.0.0-next.15'
|
|
229
|
+
}).withConfig({
|
|
230
|
+
displayName: "StyledCell",
|
|
231
|
+
componentId: "sc-8hpncx-0"
|
|
232
|
+
})(["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$5, props));
|
|
233
|
+
StyledCell.defaultProps = {
|
|
234
|
+
theme: reactTheming.DEFAULT_THEME
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const COMPONENT_ID$4 = 'tables.group_row';
|
|
238
|
+
const colorStyles$2 = _ref => {
|
|
239
|
+
let {
|
|
240
|
+
theme
|
|
241
|
+
} = _ref;
|
|
242
|
+
return styled.css(["background-color:", ";"], reactTheming.getColor({
|
|
243
|
+
variable: 'background.subtle',
|
|
244
|
+
transparency: theme.opacity[100],
|
|
245
|
+
light: {
|
|
246
|
+
offset: 300
|
|
247
|
+
},
|
|
248
|
+
dark: {
|
|
249
|
+
offset: -600
|
|
250
|
+
},
|
|
251
|
+
theme
|
|
252
|
+
}));
|
|
253
|
+
};
|
|
254
|
+
const sizeStyles$2 = props => {
|
|
248
255
|
const height = `${props.theme.space.base * 8}px`;
|
|
249
256
|
const lineHeight = getLineHeight(props);
|
|
250
257
|
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);
|
|
251
258
|
};
|
|
252
259
|
const StyledGroupRow = styled__default.default(StyledBaseRow).attrs({
|
|
253
|
-
'data-garden-id': COMPONENT_ID$
|
|
254
|
-
'data-garden-version': '9.0.0-next.
|
|
260
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
261
|
+
'data-garden-version': '9.0.0-next.15'
|
|
255
262
|
}).withConfig({
|
|
256
263
|
displayName: "StyledGroupRow",
|
|
257
264
|
componentId: "sc-mpd0r8-0"
|
|
258
|
-
})(["
|
|
265
|
+
})(["", " ", " ", ";"], sizeStyles$2, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
259
266
|
StyledGroupRow.defaultProps = {
|
|
260
267
|
theme: reactTheming.DEFAULT_THEME
|
|
261
268
|
};
|
|
262
269
|
|
|
263
|
-
const COMPONENT_ID$
|
|
270
|
+
const COMPONENT_ID$3 = 'tables.sortable';
|
|
264
271
|
const StyledBaseIconWrapper = styled__default.default.div.withConfig({
|
|
265
272
|
displayName: "StyledSortableButton__StyledBaseIconWrapper",
|
|
266
273
|
componentId: "sc-2s1dli-0"
|
|
@@ -282,95 +289,210 @@ const StyledSortableFillIconWrapper = styled__default.default(StyledBaseIconWrap
|
|
|
282
289
|
StyledSortableFillIconWrapper.defaultProps = {
|
|
283
290
|
theme: reactTheming.DEFAULT_THEME
|
|
284
291
|
};
|
|
292
|
+
const colorStyles$1 = _ref => {
|
|
293
|
+
let {
|
|
294
|
+
theme,
|
|
295
|
+
$sort
|
|
296
|
+
} = _ref;
|
|
297
|
+
const fgInactive = reactTheming.getColor({
|
|
298
|
+
variable: 'foreground.subtle',
|
|
299
|
+
transparency: theme.opacity[200],
|
|
300
|
+
theme
|
|
301
|
+
});
|
|
302
|
+
const fgActive = reactTheming.getColor({
|
|
303
|
+
variable: 'foreground.subtle',
|
|
304
|
+
theme
|
|
305
|
+
});
|
|
306
|
+
const fgPrimaryActive = reactTheming.getColor({
|
|
307
|
+
variable: 'foreground.primary',
|
|
308
|
+
theme
|
|
309
|
+
});
|
|
310
|
+
const fgPrimaryInactive = reactTheming.getColor({
|
|
311
|
+
variable: 'foreground.primary',
|
|
312
|
+
theme,
|
|
313
|
+
dark: {
|
|
314
|
+
offset: -100
|
|
315
|
+
},
|
|
316
|
+
transparency: theme.opacity[200]
|
|
317
|
+
});
|
|
318
|
+
let color = fgActive;
|
|
319
|
+
let fill = fgActive;
|
|
320
|
+
if ($sort === 'asc') {
|
|
321
|
+
color = fgActive;
|
|
322
|
+
fill = fgInactive;
|
|
323
|
+
} else if ($sort === 'desc') {
|
|
324
|
+
color = fgInactive;
|
|
325
|
+
fill = fgActive;
|
|
326
|
+
}
|
|
327
|
+
return styled.css(["", "{color:", ";fill:", ";}", "{color:", ";fill:", ";}&:hover,", "{color:", ";", ";", " ", "}", ""], StyledSortableStrokeIconWrapper, fgActive, fgActive, StyledSortableFillIconWrapper, color, fill, reactTheming.SELECTOR_FOCUS_VISIBLE, fgPrimaryActive, $sort === undefined && `
|
|
328
|
+
${StyledSortableFillIconWrapper} {
|
|
329
|
+
opacity: 1;
|
|
330
|
+
color: ${fgPrimaryActive};
|
|
331
|
+
fill: ${fgPrimaryActive};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
${StyledSortableStrokeIconWrapper} {
|
|
335
|
+
opacity: 0;
|
|
336
|
+
}
|
|
337
|
+
`, $sort === 'asc' && `
|
|
338
|
+
${StyledSortableFillIconWrapper} {
|
|
339
|
+
color: ${fgPrimaryActive};
|
|
340
|
+
fill: ${fgPrimaryInactive};
|
|
341
|
+
}
|
|
342
|
+
`, $sort === 'desc' && `
|
|
343
|
+
${StyledSortableFillIconWrapper} {
|
|
344
|
+
color: ${fgPrimaryInactive};
|
|
345
|
+
fill: ${fgPrimaryActive};
|
|
346
|
+
}
|
|
347
|
+
`, reactTheming.focusStyles({
|
|
348
|
+
theme
|
|
349
|
+
}));
|
|
350
|
+
};
|
|
285
351
|
const StyledSortableButton = styled__default.default.button.attrs({
|
|
286
|
-
'data-garden-id': COMPONENT_ID$
|
|
287
|
-
'data-garden-version': '9.0.0-next.
|
|
352
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
353
|
+
'data-garden-version': '9.0.0-next.15',
|
|
288
354
|
type: 'button'
|
|
289
355
|
}).withConfig({
|
|
290
356
|
displayName: "StyledSortableButton",
|
|
291
357
|
componentId: "sc-2s1dli-3"
|
|
292
|
-
})(["position:relative;transition:box-shadow 0.1s ease-in-out;border:none;border-radius:", ";background-color:transparent;cursor:pointer;padding:0;padding-", ":", ";width:", ";text-decoration:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:", ";", "{opacity:", ";}", "{opacity:", ";
|
|
293
|
-
if (props.sort === 'asc') {
|
|
294
|
-
return reactTheming.getColorV8('neutralHue', 600, props.theme);
|
|
295
|
-
} else if (props.sort === 'desc') {
|
|
296
|
-
return reactTheming.getColorV8('neutralHue', 400, props.theme);
|
|
297
|
-
}
|
|
298
|
-
return undefined;
|
|
299
|
-
}, props => {
|
|
300
|
-
if (props.sort === 'asc') {
|
|
301
|
-
return reactTheming.getColorV8('neutralHue', 400, props.theme);
|
|
302
|
-
} else if (props.sort === 'desc') {
|
|
303
|
-
return reactTheming.getColorV8('neutralHue', 600, props.theme);
|
|
304
|
-
}
|
|
305
|
-
return undefined;
|
|
306
|
-
}, reactTheming.SELECTOR_FOCUS_VISIBLE, props => reactTheming.getColorV8('primaryHue', 600, props.theme), props => props.sort === undefined && `
|
|
307
|
-
${StyledSortableFillIconWrapper} {
|
|
308
|
-
opacity: 1;
|
|
309
|
-
color: ${reactTheming.getColorV8('primaryHue', 600, props.theme)};
|
|
310
|
-
fill: ${reactTheming.getColorV8('primaryHue', 600, props.theme)};
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
${StyledSortableStrokeIconWrapper} {
|
|
314
|
-
opacity: 0;
|
|
315
|
-
}
|
|
316
|
-
`, props => props.sort === 'asc' && `
|
|
317
|
-
${StyledSortableFillIconWrapper} {
|
|
318
|
-
color: ${reactTheming.getColorV8('primaryHue', 600, props.theme)};
|
|
319
|
-
fill: ${reactTheming.getColorV8('primaryHue', 600, props.theme, 0.25)};
|
|
320
|
-
}
|
|
321
|
-
`, props => props.sort === 'desc' && `
|
|
322
|
-
${StyledSortableFillIconWrapper} {
|
|
323
|
-
color: ${reactTheming.getColorV8('primaryHue', 600, props.theme, 0.25)};
|
|
324
|
-
fill: ${reactTheming.getColorV8('primaryHue', 600, props.theme)};
|
|
325
|
-
}
|
|
326
|
-
`, props => reactTheming.focusStyles({
|
|
327
|
-
theme: props.theme
|
|
328
|
-
}), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
358
|
+
})(["position:relative;transition:box-shadow 0.1s ease-in-out;border:none;border-radius:", ";background-color:transparent;cursor:pointer;padding:0;padding-", ":", ";width:", ";text-decoration:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:", ";", "{opacity:", ";}", "{opacity:", ";}&:hover,", "{text-decoration:none;}", " ", ";"], props => props.theme.borderRadii.sm, 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, reactTheming.SELECTOR_FOCUS_VISIBLE, colorStyles$1, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$3, props));
|
|
329
359
|
StyledSortableButton.defaultProps = {
|
|
330
360
|
theme: reactTheming.DEFAULT_THEME
|
|
331
361
|
};
|
|
332
362
|
|
|
333
|
-
const COMPONENT_ID$
|
|
363
|
+
const COMPONENT_ID$2 = 'tables.header_cell';
|
|
334
364
|
const truncatedStyling = styled.css(["", "{max-width:100%;overflow:hidden;text-overflow:ellipsis;}"], StyledSortableButton);
|
|
335
|
-
const sizeStyles = props => {
|
|
365
|
+
const sizeStyles$1 = props => {
|
|
336
366
|
let paddingVertical = undefined;
|
|
337
|
-
if (!props
|
|
367
|
+
if (!props.$hasOverflow) {
|
|
338
368
|
paddingVertical = polished.math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
339
369
|
}
|
|
340
370
|
return styled.css(["padding-top:", ";padding-bottom:", ";"], paddingVertical, paddingVertical);
|
|
341
371
|
};
|
|
342
372
|
const StyledHeaderCell = styled__default.default(StyledCell).attrs({
|
|
343
373
|
as: 'th',
|
|
344
|
-
'data-garden-id': COMPONENT_ID$
|
|
345
|
-
'data-garden-version': '9.0.0-next.
|
|
374
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
375
|
+
'data-garden-version': '9.0.0-next.15'
|
|
346
376
|
}).withConfig({
|
|
347
377
|
displayName: "StyledHeaderCell",
|
|
348
378
|
componentId: "sc-fzagoe-0"
|
|
349
379
|
})(["text-align:", ";font-weight:inherit;", " ", " ", ";"], props => {
|
|
350
|
-
if (!props
|
|
380
|
+
if (!props.$hasOverflow) {
|
|
351
381
|
if (props.theme.rtl) {
|
|
352
382
|
return 'right';
|
|
353
383
|
}
|
|
354
384
|
return 'left';
|
|
355
385
|
}
|
|
356
386
|
return undefined;
|
|
357
|
-
}, props => sizeStyles(props), props => props
|
|
387
|
+
}, props => sizeStyles$1(props), props => props.$isTruncated && truncatedStyling, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
358
388
|
StyledHeaderCell.defaultProps = {
|
|
359
389
|
theme: reactTheming.DEFAULT_THEME
|
|
360
390
|
};
|
|
361
391
|
|
|
362
|
-
const COMPONENT_ID = 'tables.hidden_cell';
|
|
392
|
+
const COMPONENT_ID$1 = 'tables.hidden_cell';
|
|
363
393
|
const StyledHiddenCell = styled__default.default.div.attrs({
|
|
364
|
-
'data-garden-id': COMPONENT_ID,
|
|
365
|
-
'data-garden-version': '9.0.0-next.
|
|
394
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
395
|
+
'data-garden-version': '9.0.0-next.15'
|
|
366
396
|
}).withConfig({
|
|
367
397
|
displayName: "StyledHiddenCell",
|
|
368
398
|
componentId: "sc-1x454xw-0"
|
|
369
|
-
})(["", " ", ";"], polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
399
|
+
})(["", " ", ";"], polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
370
400
|
StyledHiddenCell.defaultProps = {
|
|
371
401
|
theme: reactTheming.DEFAULT_THEME
|
|
372
402
|
};
|
|
373
403
|
|
|
404
|
+
const COMPONENT_ID = 'tables.row';
|
|
405
|
+
const colorStyles = _ref => {
|
|
406
|
+
let {
|
|
407
|
+
theme,
|
|
408
|
+
$isFocused,
|
|
409
|
+
$isSelected,
|
|
410
|
+
$isHovered,
|
|
411
|
+
$isReadOnly
|
|
412
|
+
} = _ref;
|
|
413
|
+
const hoveredBackgroundColor = reactTheming.getColor({
|
|
414
|
+
variable: 'background.primaryEmphasis',
|
|
415
|
+
transparency: theme.opacity[100],
|
|
416
|
+
dark: {
|
|
417
|
+
offset: -100
|
|
418
|
+
},
|
|
419
|
+
theme
|
|
420
|
+
});
|
|
421
|
+
const hoveredBorderColor = reactTheming.getColor({
|
|
422
|
+
variable: 'border.primaryEmphasis',
|
|
423
|
+
transparency: theme.opacity[200],
|
|
424
|
+
dark: {
|
|
425
|
+
offset: -100
|
|
426
|
+
},
|
|
427
|
+
theme
|
|
428
|
+
});
|
|
429
|
+
const selectedBackgroundColor = reactTheming.getColor({
|
|
430
|
+
variable: 'background.primaryEmphasis',
|
|
431
|
+
transparency: theme.opacity[200],
|
|
432
|
+
dark: {
|
|
433
|
+
offset: -100
|
|
434
|
+
},
|
|
435
|
+
theme
|
|
436
|
+
});
|
|
437
|
+
const selectedBorderColor = reactTheming.getColor({
|
|
438
|
+
variable: 'border.primaryEmphasis',
|
|
439
|
+
light: {
|
|
440
|
+
offset: -400
|
|
441
|
+
},
|
|
442
|
+
dark: {
|
|
443
|
+
offset: 300
|
|
444
|
+
},
|
|
445
|
+
theme
|
|
446
|
+
});
|
|
447
|
+
const hoveredSelectedBackgroundColor = reactTheming.getColor({
|
|
448
|
+
variable: 'background.primaryEmphasis',
|
|
449
|
+
transparency: theme.opacity[300],
|
|
450
|
+
dark: {
|
|
451
|
+
offset: -100
|
|
452
|
+
},
|
|
453
|
+
theme
|
|
454
|
+
});
|
|
455
|
+
const boxShadowColor = reactTheming.getColor({
|
|
456
|
+
variable: 'border.primaryEmphasis',
|
|
457
|
+
theme
|
|
458
|
+
});
|
|
459
|
+
const boxShadow = `inset ${theme.rtl ? '-' : ''}${theme.shadowWidths.md} 0 0 0 ${boxShadowColor}`;
|
|
460
|
+
let backgroundColor = undefined;
|
|
461
|
+
let borderColor = undefined;
|
|
462
|
+
let hoverBorderBottomColor = undefined;
|
|
463
|
+
let hoverBackgroundColor = undefined;
|
|
464
|
+
if ($isSelected) {
|
|
465
|
+
if ($isHovered) {
|
|
466
|
+
backgroundColor = hoveredSelectedBackgroundColor;
|
|
467
|
+
} else {
|
|
468
|
+
backgroundColor = selectedBackgroundColor;
|
|
469
|
+
}
|
|
470
|
+
borderColor = selectedBorderColor;
|
|
471
|
+
hoverBorderBottomColor = selectedBorderColor;
|
|
472
|
+
hoverBackgroundColor = hoveredSelectedBackgroundColor;
|
|
473
|
+
} else if ($isHovered) {
|
|
474
|
+
backgroundColor = hoveredBackgroundColor;
|
|
475
|
+
borderColor = hoveredBorderColor;
|
|
476
|
+
} else if (!$isReadOnly) {
|
|
477
|
+
hoverBorderBottomColor = hoveredBorderColor;
|
|
478
|
+
hoverBackgroundColor = hoveredBackgroundColor;
|
|
479
|
+
}
|
|
480
|
+
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, $isFocused && boxShadow, boxShadow);
|
|
481
|
+
};
|
|
482
|
+
const sizeStyles = props => {
|
|
483
|
+
return styled.css(["height:", ";"], getRowHeight(props));
|
|
484
|
+
};
|
|
485
|
+
const StyledRow = styled__default.default(StyledBaseRow).attrs({
|
|
486
|
+
'data-garden-id': COMPONENT_ID,
|
|
487
|
+
'data-garden-version': '9.0.0-next.15'
|
|
488
|
+
}).withConfig({
|
|
489
|
+
displayName: "StyledRow",
|
|
490
|
+
componentId: "sc-ek66ow-0"
|
|
491
|
+
})(["", " ", " ", ";"], sizeStyles, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
492
|
+
StyledRow.defaultProps = {
|
|
493
|
+
theme: reactTheming.DEFAULT_THEME
|
|
494
|
+
};
|
|
495
|
+
|
|
374
496
|
const Body = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledBody, Object.assign({
|
|
375
497
|
ref: ref
|
|
376
498
|
}, props)));
|
|
@@ -392,6 +514,9 @@ const useTableContext = () => {
|
|
|
392
514
|
const Cell = React__namespace.default.forwardRef((_ref, ref) => {
|
|
393
515
|
let {
|
|
394
516
|
hidden,
|
|
517
|
+
isMinimum,
|
|
518
|
+
isTruncated,
|
|
519
|
+
hasOverflow,
|
|
395
520
|
...props
|
|
396
521
|
} = _ref;
|
|
397
522
|
const {
|
|
@@ -399,7 +524,10 @@ const Cell = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
399
524
|
} = useTableContext();
|
|
400
525
|
return React__namespace.default.createElement(StyledCell, Object.assign({
|
|
401
526
|
ref: ref,
|
|
402
|
-
size: size
|
|
527
|
+
$size: size,
|
|
528
|
+
$isMinimum: isMinimum,
|
|
529
|
+
$isTruncated: isTruncated,
|
|
530
|
+
$hasOverflow: hasOverflow
|
|
403
531
|
}, props), hidden && props.children ? React__namespace.default.createElement(StyledHiddenCell, null, props.children) : props.children);
|
|
404
532
|
});
|
|
405
533
|
Cell.displayName = 'Cell';
|
|
@@ -416,19 +544,29 @@ const GroupRow = React.forwardRef((props, ref) => {
|
|
|
416
544
|
} = useTableContext();
|
|
417
545
|
return React__namespace.default.createElement(StyledGroupRow, Object.assign({
|
|
418
546
|
ref: ref,
|
|
419
|
-
size: size
|
|
547
|
+
$size: size
|
|
420
548
|
}, props));
|
|
421
549
|
});
|
|
422
550
|
GroupRow.displayName = 'GroupRow';
|
|
423
551
|
|
|
424
|
-
const Head = React.forwardRef((
|
|
425
|
-
|
|
426
|
-
|
|
552
|
+
const Head = React.forwardRef((_ref, ref) => {
|
|
553
|
+
let {
|
|
554
|
+
isSticky,
|
|
555
|
+
...props
|
|
556
|
+
} = _ref;
|
|
557
|
+
return React__namespace.default.createElement(StyledHead, Object.assign({
|
|
558
|
+
ref: ref,
|
|
559
|
+
$isSticky: isSticky
|
|
560
|
+
}, props));
|
|
561
|
+
});
|
|
427
562
|
Head.displayName = 'Head';
|
|
428
563
|
|
|
429
564
|
const HeaderCell = React.forwardRef((_ref, ref) => {
|
|
430
565
|
let {
|
|
431
566
|
hidden,
|
|
567
|
+
isMinimum,
|
|
568
|
+
isTruncated,
|
|
569
|
+
hasOverflow,
|
|
432
570
|
...props
|
|
433
571
|
} = _ref;
|
|
434
572
|
const {
|
|
@@ -436,7 +574,10 @@ const HeaderCell = React.forwardRef((_ref, ref) => {
|
|
|
436
574
|
} = useTableContext();
|
|
437
575
|
return React__namespace.default.createElement(StyledHeaderCell, Object.assign({
|
|
438
576
|
ref: ref,
|
|
439
|
-
size: size
|
|
577
|
+
$size: size,
|
|
578
|
+
$isMinimum: isMinimum,
|
|
579
|
+
$isTruncated: isTruncated,
|
|
580
|
+
$hasOverflow: hasOverflow
|
|
440
581
|
}, props), hidden && props.children ? React__namespace.default.createElement(StyledHiddenCell, null, props.children) : props.children);
|
|
441
582
|
});
|
|
442
583
|
HeaderCell.displayName = 'HeaderCell';
|
|
@@ -448,14 +589,14 @@ const HeaderRow = React__namespace.default.forwardRef((props, ref) => {
|
|
|
448
589
|
} = useTableContext();
|
|
449
590
|
return React__namespace.default.createElement(StyledHeaderRow, Object.assign({
|
|
450
591
|
ref: ref,
|
|
451
|
-
size: size
|
|
592
|
+
$size: size
|
|
452
593
|
}, props));
|
|
453
594
|
});
|
|
454
595
|
HeaderRow.displayName = 'HeaderRow';
|
|
455
596
|
|
|
456
|
-
var
|
|
597
|
+
var _path$2;
|
|
457
598
|
function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
|
|
458
|
-
var
|
|
599
|
+
var SvgOverflowVerticalStroke = function SvgOverflowVerticalStroke(props) {
|
|
459
600
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
460
601
|
xmlns: "http://www.w3.org/2000/svg",
|
|
461
602
|
width: 16,
|
|
@@ -463,57 +604,33 @@ var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
|
463
604
|
focusable: "false",
|
|
464
605
|
viewBox: "0 0 16 16",
|
|
465
606
|
"aria-hidden": "true"
|
|
466
|
-
}, props),
|
|
467
|
-
fill: "currentColor"
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
cx: 8,
|
|
474
|
-
cy: 8,
|
|
475
|
-
r: 1.5
|
|
476
|
-
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
477
|
-
cx: 13.5,
|
|
478
|
-
cy: 8,
|
|
479
|
-
r: 1.5
|
|
480
|
-
}))));
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
const OverflowButton = React.forwardRef((_ref, ref) => {
|
|
484
|
-
let {
|
|
485
|
-
onFocus,
|
|
486
|
-
onBlur,
|
|
487
|
-
isFocused: focused,
|
|
488
|
-
...other
|
|
489
|
-
} = _ref;
|
|
490
|
-
const [isFocused, setIsFocused] = React.useState(false);
|
|
607
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
608
|
+
fill: "currentColor",
|
|
609
|
+
d: "M9.5 2.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm0 5.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm0 5.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"
|
|
610
|
+
})));
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const OverflowButton = React.forwardRef((props, ref) => {
|
|
491
614
|
const {
|
|
492
615
|
size
|
|
493
616
|
} = useTableContext();
|
|
494
617
|
return React__namespace.default.createElement(StyledOverflowButton, Object.assign({
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}),
|
|
498
|
-
onBlur: containerUtilities.composeEventHandlers(onBlur, () => {
|
|
499
|
-
setIsFocused(false);
|
|
500
|
-
}),
|
|
501
|
-
size: size,
|
|
502
|
-
isFocused: typeof focused === 'undefined' ? isFocused : focused,
|
|
618
|
+
type: "button",
|
|
619
|
+
$size: size,
|
|
503
620
|
ref: ref
|
|
504
|
-
},
|
|
621
|
+
}, props, {
|
|
622
|
+
focusInset: true
|
|
623
|
+
}), React__namespace.default.createElement(SvgOverflowVerticalStroke, null));
|
|
505
624
|
});
|
|
506
625
|
OverflowButton.displayName = 'OverflowButton';
|
|
507
|
-
OverflowButton.propTypes = {
|
|
508
|
-
isHovered: PropTypes__default.default.bool,
|
|
509
|
-
isActive: PropTypes__default.default.bool,
|
|
510
|
-
isFocused: PropTypes__default.default.bool
|
|
511
|
-
};
|
|
512
626
|
|
|
513
627
|
const Row = React.forwardRef((_ref, ref) => {
|
|
514
628
|
let {
|
|
515
629
|
onFocus,
|
|
516
630
|
onBlur,
|
|
631
|
+
isSelected,
|
|
632
|
+
isStriped,
|
|
633
|
+
isHovered,
|
|
517
634
|
isFocused: focused,
|
|
518
635
|
...otherProps
|
|
519
636
|
} = _ref;
|
|
@@ -540,11 +657,16 @@ const Row = React.forwardRef((_ref, ref) => {
|
|
|
540
657
|
return React__namespace.default.createElement(StyledRow, Object.assign({
|
|
541
658
|
onFocus: onFocusCallback,
|
|
542
659
|
onBlur: onBlurCallback,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
660
|
+
ref: ref,
|
|
661
|
+
$size: size,
|
|
662
|
+
$isReadOnly: isReadOnly,
|
|
663
|
+
$isFocused: computedFocused,
|
|
664
|
+
$isHovered: isHovered,
|
|
665
|
+
$isStriped: isStriped,
|
|
666
|
+
$isSelected: isSelected
|
|
667
|
+
}, otherProps, {
|
|
668
|
+
tabIndex: isReadOnly ? undefined : -1
|
|
669
|
+
}));
|
|
548
670
|
});
|
|
549
671
|
Row.displayName = 'Row';
|
|
550
672
|
Row.propTypes = {
|
|
@@ -596,11 +718,16 @@ const SORT = ['asc', 'desc'];
|
|
|
596
718
|
const SortableCell = React.forwardRef((_ref, ref) => {
|
|
597
719
|
let {
|
|
598
720
|
sort,
|
|
599
|
-
cellProps,
|
|
721
|
+
cellProps = {},
|
|
600
722
|
width,
|
|
601
723
|
children,
|
|
602
|
-
...
|
|
724
|
+
...sortableButtonProps
|
|
603
725
|
} = _ref;
|
|
726
|
+
const {
|
|
727
|
+
isMinimum,
|
|
728
|
+
isTruncated,
|
|
729
|
+
hasOverflow
|
|
730
|
+
} = cellProps;
|
|
604
731
|
let ariaSortValue = 'none';
|
|
605
732
|
if (sort === 'asc') {
|
|
606
733
|
ariaSortValue = 'ascending';
|
|
@@ -610,11 +737,14 @@ const SortableCell = React.forwardRef((_ref, ref) => {
|
|
|
610
737
|
const SortIcon = sort === undefined ? SvgSortStroke : SvgSortFill;
|
|
611
738
|
return React__namespace.default.createElement(StyledHeaderCell, Object.assign({
|
|
612
739
|
"aria-sort": ariaSortValue,
|
|
613
|
-
width: width
|
|
740
|
+
width: width,
|
|
741
|
+
$isMinimum: isMinimum,
|
|
742
|
+
$isTruncated: isTruncated,
|
|
743
|
+
$hasOverflow: hasOverflow
|
|
614
744
|
}, cellProps), React__namespace.default.createElement(StyledSortableButton, Object.assign({
|
|
615
|
-
sort: sort,
|
|
745
|
+
$sort: sort,
|
|
616
746
|
ref: ref
|
|
617
|
-
},
|
|
747
|
+
}, sortableButtonProps), children, React__namespace.default.createElement(StyledSortableStrokeIconWrapper, null, React__namespace.default.createElement(SortIcon, null)), React__namespace.default.createElement(StyledSortableFillIconWrapper, null, React__namespace.default.createElement(SvgSortFill, null))));
|
|
618
748
|
});
|
|
619
749
|
SortableCell.displayName = 'SortableCell';
|
|
620
750
|
SortableCell.propTypes = {
|
|
@@ -623,11 +753,16 @@ SortableCell.propTypes = {
|
|
|
623
753
|
width: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number])
|
|
624
754
|
};
|
|
625
755
|
|
|
626
|
-
const TableComponent = React__namespace.default.forwardRef((
|
|
756
|
+
const TableComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
757
|
+
let {
|
|
758
|
+
isReadOnly,
|
|
759
|
+
size,
|
|
760
|
+
...props
|
|
761
|
+
} = _ref;
|
|
627
762
|
const tableContextValue = React.useMemo(() => ({
|
|
628
|
-
size:
|
|
629
|
-
isReadOnly:
|
|
630
|
-
}), [
|
|
763
|
+
size: size,
|
|
764
|
+
isReadOnly: isReadOnly
|
|
765
|
+
}), [size, isReadOnly]);
|
|
631
766
|
return React__namespace.default.createElement(TableContext.Provider, {
|
|
632
767
|
value: tableContextValue
|
|
633
768
|
}, React__namespace.default.createElement(StyledTable, Object.assign({
|