@zendeskgarden/react-tables 9.0.0-next.9 → 9.1.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/esm/elements/Body.js +1 -1
- package/dist/esm/elements/Caption.js +1 -1
- package/dist/esm/elements/Cell.js +8 -2
- package/dist/esm/elements/GroupRow.js +2 -2
- package/dist/esm/elements/Head.js +11 -4
- package/dist/esm/elements/HeaderCell.js +8 -2
- package/dist/esm/elements/HeaderRow.js +2 -2
- package/dist/esm/elements/OverflowButton.js +10 -28
- package/dist/esm/elements/Row.js +14 -6
- package/dist/esm/elements/SortableCell.js +14 -6
- package/dist/esm/elements/Table.js +9 -4
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/sort-fill.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/sort-stroke.svg.js +1 -1
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/overflow-vertical-stroke.svg.js +25 -0
- package/dist/esm/styled/StyledBaseRow.js +43 -0
- package/dist/esm/styled/StyledBody.js +2 -5
- package/dist/esm/styled/StyledCaption.js +2 -5
- package/dist/esm/styled/StyledCell.js +5 -8
- package/dist/esm/styled/StyledGroupRow.js +20 -7
- package/dist/esm/styled/StyledHead.js +19 -9
- package/dist/esm/styled/StyledHeaderCell.js +5 -8
- package/dist/esm/styled/StyledHeaderRow.js +20 -10
- package/dist/esm/styled/StyledHiddenCell.js +2 -5
- package/dist/esm/styled/StyledOverflowButton.js +7 -35
- package/dist/esm/styled/StyledRow.js +71 -30
- package/dist/esm/styled/StyledSortableButton.js +62 -51
- package/dist/esm/styled/StyledTable.js +6 -6
- package/dist/esm/styled/style-utils.js +2 -2
- package/dist/index.cjs.js +390 -303
- package/dist/typings/elements/OverflowButton.d.ts +2 -10
- package/dist/typings/elements/Table.d.ts +2 -2
- 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 +6 -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 +8 -7
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/overflow-stroke.svg.js +0 -36
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,59 +41,152 @@ 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.
|
|
44
|
+
'data-garden-version': '9.1.0'
|
|
44
45
|
}).withConfig({
|
|
45
46
|
displayName: "StyledBody",
|
|
46
47
|
componentId: "sc-14ud6y-0"
|
|
47
48
|
})(["", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$b, props));
|
|
48
|
-
StyledBody.defaultProps = {
|
|
49
|
-
theme: reactTheming.DEFAULT_THEME
|
|
50
|
-
};
|
|
51
49
|
|
|
52
50
|
const COMPONENT_ID$a = 'tables.caption';
|
|
53
51
|
const StyledCaption = styled__default.default.caption.attrs({
|
|
54
52
|
'data-garden-id': COMPONENT_ID$a,
|
|
55
|
-
'data-garden-version': '9.
|
|
53
|
+
'data-garden-version': '9.1.0'
|
|
56
54
|
}).withConfig({
|
|
57
55
|
displayName: "StyledCaption",
|
|
58
56
|
componentId: "sc-113y327-0"
|
|
59
57
|
})(["display:table-caption;text-align:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$a, props));
|
|
60
|
-
StyledCaption.defaultProps = {
|
|
61
|
-
theme: reactTheming.DEFAULT_THEME
|
|
62
|
-
};
|
|
63
58
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
const sizeStyles$4 = _ref => {
|
|
60
|
+
let {
|
|
61
|
+
theme
|
|
62
|
+
} = _ref;
|
|
63
|
+
return styled.css(["border-bottom:", ";vertical-align:top;box-sizing:border-box;"], theme.borders.sm);
|
|
67
64
|
};
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
const colorStyles$5 = _ref2 => {
|
|
66
|
+
let {
|
|
67
|
+
theme,
|
|
68
|
+
$isStriped
|
|
69
|
+
} = _ref2;
|
|
70
|
+
const borderColor = reactTheming.getColor({
|
|
71
|
+
variable: 'border.subtle',
|
|
72
|
+
theme
|
|
73
|
+
});
|
|
74
|
+
const backgroundColor = reactTheming.getColor({
|
|
75
|
+
variable: 'background.subtle',
|
|
76
|
+
transparency: theme.opacity[100],
|
|
77
|
+
light: {
|
|
78
|
+
offset: 300
|
|
79
|
+
},
|
|
80
|
+
dark: {
|
|
81
|
+
offset: -600
|
|
82
|
+
},
|
|
83
|
+
theme
|
|
84
|
+
});
|
|
85
|
+
return styled.css(["border-bottom-color:", ";background-color:", ";"], borderColor, $isStriped && backgroundColor);
|
|
77
86
|
};
|
|
87
|
+
const StyledBaseRow = styled__default.default.tr.withConfig({
|
|
88
|
+
displayName: "StyledBaseRow",
|
|
89
|
+
componentId: "sc-1t4zqg4-0"
|
|
90
|
+
})(["display:table-row;transition:background-color 0.1s ease-in-out;", " ", ""], sizeStyles$4, colorStyles$5);
|
|
78
91
|
|
|
79
92
|
const getRowHeight = props => {
|
|
80
|
-
if (props
|
|
93
|
+
if (props.$size === 'large') {
|
|
81
94
|
return `${props.theme.space.base * 16}px`;
|
|
82
|
-
} else if (props
|
|
95
|
+
} else if (props.$size === 'small') {
|
|
83
96
|
return `${props.theme.space.base * 8}px`;
|
|
84
97
|
}
|
|
85
98
|
return `${props.theme.space.base * 10}px`;
|
|
86
99
|
};
|
|
87
100
|
|
|
88
|
-
const COMPONENT_ID$
|
|
101
|
+
const COMPONENT_ID$9 = 'tables.overflow_button';
|
|
102
|
+
const OVERFLOW_BUTTON_SIZE = '2em';
|
|
103
|
+
const StyledOverflowButton = styled__default.default(reactButtons.IconButton).attrs({
|
|
104
|
+
'data-garden-id': COMPONENT_ID$9,
|
|
105
|
+
'data-garden-version': '9.1.0'
|
|
106
|
+
}).withConfig({
|
|
107
|
+
displayName: "StyledOverflowButton",
|
|
108
|
+
componentId: "sc-1eba2ml-0"
|
|
109
|
+
})(["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));
|
|
110
|
+
|
|
111
|
+
const COMPONENT_ID$8 = 'tables.header_row';
|
|
112
|
+
const getHeaderRowHeight = props => {
|
|
113
|
+
if (props.$size === 'large') {
|
|
114
|
+
return `${props.theme.space.base * 18}px`;
|
|
115
|
+
} else if (props.$size === 'small') {
|
|
116
|
+
return `${props.theme.space.base * 10}px`;
|
|
117
|
+
}
|
|
118
|
+
return `${props.theme.space.base * 12}px`;
|
|
119
|
+
};
|
|
120
|
+
const colorStyles$4 = _ref => {
|
|
121
|
+
let {
|
|
122
|
+
theme
|
|
123
|
+
} = _ref;
|
|
124
|
+
return styled.css(["border-bottom-color:", ";"], reactTheming.getColor({
|
|
125
|
+
variable: 'border.default',
|
|
126
|
+
theme
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
const sizeStyles$3 = props => {
|
|
130
|
+
const rowHeight = getHeaderRowHeight(props);
|
|
131
|
+
return styled.css(["height:", ";vertical-align:bottom;", "{margin-top:0;margin-bottom:calc(", " - 1em);}"], rowHeight, StyledOverflowButton, polished.math(`${rowHeight} / 2`));
|
|
132
|
+
};
|
|
133
|
+
const StyledHeaderRow = styled__default.default(StyledBaseRow).attrs({
|
|
134
|
+
'data-garden-id': COMPONENT_ID$8,
|
|
135
|
+
'data-garden-version': '9.1.0'
|
|
136
|
+
}).withConfig({
|
|
137
|
+
displayName: "StyledHeaderRow",
|
|
138
|
+
componentId: "sc-16ogvdx-0"
|
|
139
|
+
})(["font-weight:", ";", " ", " ", "{opacity:1;}", ";"], props => props.theme.fontWeights.semibold, sizeStyles$3, colorStyles$4, StyledOverflowButton, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$8, props));
|
|
140
|
+
|
|
141
|
+
const COMPONENT_ID$7 = 'tables.head';
|
|
142
|
+
const colorStyles$3 = _ref => {
|
|
143
|
+
let {
|
|
144
|
+
theme
|
|
145
|
+
} = _ref;
|
|
146
|
+
const borderColor = reactTheming.getColor({
|
|
147
|
+
variable: 'border.default',
|
|
148
|
+
theme
|
|
149
|
+
});
|
|
150
|
+
const backgroundColor = reactTheming.getColor({
|
|
151
|
+
variable: 'background.default',
|
|
152
|
+
theme
|
|
153
|
+
});
|
|
154
|
+
return styled.css(["box-shadow:inset 0 -", " 0 ", ";background-color:", ";& > ", ":last-child{border-bottom-color:transparent;}"], theme.borderWidths.sm, borderColor, backgroundColor, StyledHeaderRow);
|
|
155
|
+
};
|
|
156
|
+
const stickyStyles = () => {
|
|
157
|
+
return styled.css(["position:sticky;top:0;z-index:1;"]);
|
|
158
|
+
};
|
|
159
|
+
const StyledHead = styled__default.default.thead.attrs({
|
|
160
|
+
'data-garden-id': COMPONENT_ID$7,
|
|
161
|
+
'data-garden-version': '9.1.0'
|
|
162
|
+
}).withConfig({
|
|
163
|
+
displayName: "StyledHead",
|
|
164
|
+
componentId: "sc-spf23a-0"
|
|
165
|
+
})(["", " ", " ", ";"], props => props.$isSticky && stickyStyles(), colorStyles$3, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
166
|
+
|
|
167
|
+
const COMPONENT_ID$6 = 'tables.table';
|
|
168
|
+
const getLineHeight = props => {
|
|
169
|
+
return `${props.theme.space.base * 5}px`;
|
|
170
|
+
};
|
|
171
|
+
const StyledTable = styled__default.default.table.attrs({
|
|
172
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
173
|
+
'data-garden-version': '9.1.0'
|
|
174
|
+
}).withConfig({
|
|
175
|
+
displayName: "StyledTable",
|
|
176
|
+
componentId: "sc-gje7na-0"
|
|
177
|
+
})(["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({
|
|
178
|
+
variable: 'foreground.default',
|
|
179
|
+
theme: props.theme
|
|
180
|
+
}), props => props.theme.fontSizes.md, props => props.theme.rtl && 'rtl', props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
181
|
+
|
|
182
|
+
const COMPONENT_ID$5 = 'tables.cell';
|
|
89
183
|
const truncatedStyling$1 = styled.css(["overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"]);
|
|
90
184
|
const sizeStyling = props => {
|
|
91
185
|
let boxSizing = 'border-box';
|
|
92
186
|
let padding;
|
|
93
187
|
let width = props.width;
|
|
94
188
|
let height;
|
|
95
|
-
if (props
|
|
189
|
+
if (props.$hasOverflow) {
|
|
96
190
|
boxSizing = 'content-box';
|
|
97
191
|
width = '2em';
|
|
98
192
|
height = 'inherit';
|
|
@@ -102,284 +196,264 @@ const sizeStyling = props => {
|
|
|
102
196
|
const paddingHorizontal = `${props.theme.space.base * 3}px`;
|
|
103
197
|
padding = `${paddingVertical} ${paddingHorizontal}`;
|
|
104
198
|
}
|
|
105
|
-
if (props
|
|
199
|
+
if (props.$isMinimum) {
|
|
106
200
|
boxSizing = 'content-box';
|
|
107
201
|
width = '1em';
|
|
108
202
|
}
|
|
109
203
|
return styled.css(["box-sizing:", ";padding:", ";width:", ";height:", ";"], boxSizing, padding, width, height);
|
|
110
204
|
};
|
|
111
205
|
const StyledCell = styled__default.default.td.attrs({
|
|
112
|
-
'data-garden-id': COMPONENT_ID$
|
|
113
|
-
'data-garden-version': '9.
|
|
206
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
207
|
+
'data-garden-version': '9.1.0'
|
|
114
208
|
}).withConfig({
|
|
115
209
|
displayName: "StyledCell",
|
|
116
210
|
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
|
|
118
|
-
StyledCell.defaultProps = {
|
|
119
|
-
theme: reactTheming.DEFAULT_THEME
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const COMPONENT_ID$7 = 'tables.overflow_button';
|
|
123
|
-
const OVERFLOW_BUTTON_SIZE = '2em';
|
|
124
|
-
const colorStyles$1 = props => {
|
|
125
|
-
const hoverBackgroundColor = reactTheming.getColorV8('primaryHue', 600, props.theme, 0.08);
|
|
126
|
-
const hoverForegroundColor = reactTheming.getColorV8('neutralHue', 700, props.theme);
|
|
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.9',
|
|
145
|
-
type: 'button'
|
|
146
|
-
}).withConfig({
|
|
147
|
-
displayName: "StyledOverflowButton",
|
|
148
|
-
componentId: "sc-1eba2ml-0"
|
|
149
|
-
})(["display:block;transition:background-color 0.1s ease-in-out,box-shadow 0.1s ease-in-out;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;", " ", ";"], props => props.isActive ? '1' : '0', props => polished.math(`${getRowHeight(props)} / 2`), OVERFLOW_BUTTON_SIZE, props => colorStyles$1(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$7, props));
|
|
150
|
-
StyledOverflowButton.defaultProps = {
|
|
151
|
-
theme: reactTheming.DEFAULT_THEME
|
|
152
|
-
};
|
|
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
|
-
|
|
161
|
-
const COMPONENT_ID$6 = 'tables.row';
|
|
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.9',
|
|
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
|
-
};
|
|
211
|
+
})(["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));
|
|
209
212
|
|
|
210
|
-
const COMPONENT_ID$
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
const COMPONENT_ID$4 = 'tables.head';
|
|
231
|
-
const stickyStyles = props => {
|
|
232
|
-
const borderColor = reactTheming.getColorV8('neutralHue', 300, props.theme);
|
|
233
|
-
return styled.css(["position:sticky;top:0;z-index:1;box-shadow:inset 0 -", " 0 ", ";background-color:", ";& > ", ":last-child{border-bottom-color:transparent;}"], props.theme.borderWidths.sm, borderColor, reactTheming.getColorV8('background', 600 , props.theme), StyledHeaderRow);
|
|
234
|
-
};
|
|
235
|
-
const StyledHead = styled__default.default.thead.attrs({
|
|
236
|
-
'data-garden-id': COMPONENT_ID$4,
|
|
237
|
-
'data-garden-version': '9.0.0-next.9'
|
|
238
|
-
}).withConfig({
|
|
239
|
-
displayName: "StyledHead",
|
|
240
|
-
componentId: "sc-spf23a-0"
|
|
241
|
-
})(["", " ", ";"], props => props.isSticky && stickyStyles(props), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
242
|
-
StyledHead.defaultProps = {
|
|
243
|
-
theme: reactTheming.DEFAULT_THEME
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
const COMPONENT_ID$3 = 'tables.group_row';
|
|
247
|
-
const sizeStyles$1 = props => {
|
|
213
|
+
const COMPONENT_ID$4 = 'tables.group_row';
|
|
214
|
+
const colorStyles$2 = _ref => {
|
|
215
|
+
let {
|
|
216
|
+
theme
|
|
217
|
+
} = _ref;
|
|
218
|
+
return styled.css(["background-color:", ";"], reactTheming.getColor({
|
|
219
|
+
variable: 'background.subtle',
|
|
220
|
+
transparency: theme.opacity[100],
|
|
221
|
+
light: {
|
|
222
|
+
offset: 300
|
|
223
|
+
},
|
|
224
|
+
dark: {
|
|
225
|
+
offset: -600
|
|
226
|
+
},
|
|
227
|
+
theme
|
|
228
|
+
}));
|
|
229
|
+
};
|
|
230
|
+
const sizeStyles$2 = props => {
|
|
248
231
|
const height = `${props.theme.space.base * 8}px`;
|
|
249
232
|
const lineHeight = getLineHeight(props);
|
|
250
233
|
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
234
|
};
|
|
252
235
|
const StyledGroupRow = styled__default.default(StyledBaseRow).attrs({
|
|
253
|
-
'data-garden-id': COMPONENT_ID$
|
|
254
|
-
'data-garden-version': '9.
|
|
236
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
237
|
+
'data-garden-version': '9.1.0'
|
|
255
238
|
}).withConfig({
|
|
256
239
|
displayName: "StyledGroupRow",
|
|
257
240
|
componentId: "sc-mpd0r8-0"
|
|
258
|
-
})(["
|
|
259
|
-
StyledGroupRow.defaultProps = {
|
|
260
|
-
theme: reactTheming.DEFAULT_THEME
|
|
261
|
-
};
|
|
241
|
+
})(["", " ", " ", ";"], sizeStyles$2, colorStyles$2, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$4, props));
|
|
262
242
|
|
|
263
|
-
const COMPONENT_ID$
|
|
243
|
+
const COMPONENT_ID$3 = 'tables.sortable';
|
|
264
244
|
const StyledBaseIconWrapper = styled__default.default.div.withConfig({
|
|
265
245
|
displayName: "StyledSortableButton__StyledBaseIconWrapper",
|
|
266
246
|
componentId: "sc-2s1dli-0"
|
|
267
247
|
})(["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);
|
|
268
|
-
StyledBaseIconWrapper.defaultProps = {
|
|
269
|
-
theme: reactTheming.DEFAULT_THEME
|
|
270
|
-
};
|
|
271
248
|
const StyledSortableStrokeIconWrapper = styled__default.default(StyledBaseIconWrapper).withConfig({
|
|
272
249
|
displayName: "StyledSortableButton__StyledSortableStrokeIconWrapper",
|
|
273
250
|
componentId: "sc-2s1dli-1"
|
|
274
251
|
})([""]);
|
|
275
|
-
StyledSortableStrokeIconWrapper.defaultProps = {
|
|
276
|
-
theme: reactTheming.DEFAULT_THEME
|
|
277
|
-
};
|
|
278
252
|
const StyledSortableFillIconWrapper = styled__default.default(StyledBaseIconWrapper).withConfig({
|
|
279
253
|
displayName: "StyledSortableButton__StyledSortableFillIconWrapper",
|
|
280
254
|
componentId: "sc-2s1dli-2"
|
|
281
255
|
})([""]);
|
|
282
|
-
|
|
283
|
-
|
|
256
|
+
const colorStyles$1 = _ref => {
|
|
257
|
+
let {
|
|
258
|
+
theme,
|
|
259
|
+
$sort
|
|
260
|
+
} = _ref;
|
|
261
|
+
const fgInactive = reactTheming.getColor({
|
|
262
|
+
variable: 'foreground.subtle',
|
|
263
|
+
transparency: theme.opacity[200],
|
|
264
|
+
theme
|
|
265
|
+
});
|
|
266
|
+
const fgActive = reactTheming.getColor({
|
|
267
|
+
variable: 'foreground.subtle',
|
|
268
|
+
theme
|
|
269
|
+
});
|
|
270
|
+
const fgPrimaryActive = reactTheming.getColor({
|
|
271
|
+
variable: 'foreground.primary',
|
|
272
|
+
theme
|
|
273
|
+
});
|
|
274
|
+
const fgPrimaryInactive = reactTheming.getColor({
|
|
275
|
+
variable: 'foreground.primary',
|
|
276
|
+
theme,
|
|
277
|
+
dark: {
|
|
278
|
+
offset: -100
|
|
279
|
+
},
|
|
280
|
+
transparency: theme.opacity[200]
|
|
281
|
+
});
|
|
282
|
+
let color = fgActive;
|
|
283
|
+
let fill = fgActive;
|
|
284
|
+
if ($sort === 'asc') {
|
|
285
|
+
color = fgActive;
|
|
286
|
+
fill = fgInactive;
|
|
287
|
+
} else if ($sort === 'desc') {
|
|
288
|
+
color = fgInactive;
|
|
289
|
+
fill = fgActive;
|
|
290
|
+
}
|
|
291
|
+
return styled.css(["", "{color:", ";fill:", ";}", "{color:", ";fill:", ";}&:hover,", "{color:", ";", ";", " ", "}", ""], StyledSortableStrokeIconWrapper, fgActive, fgActive, StyledSortableFillIconWrapper, color, fill, reactTheming.SELECTOR_FOCUS_VISIBLE, fgPrimaryActive, $sort === undefined && `
|
|
292
|
+
${StyledSortableFillIconWrapper} {
|
|
293
|
+
opacity: 1;
|
|
294
|
+
color: ${fgPrimaryActive};
|
|
295
|
+
fill: ${fgPrimaryActive};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
${StyledSortableStrokeIconWrapper} {
|
|
299
|
+
opacity: 0;
|
|
300
|
+
}
|
|
301
|
+
`, $sort === 'asc' && `
|
|
302
|
+
${StyledSortableFillIconWrapper} {
|
|
303
|
+
color: ${fgPrimaryActive};
|
|
304
|
+
fill: ${fgPrimaryInactive};
|
|
305
|
+
}
|
|
306
|
+
`, $sort === 'desc' && `
|
|
307
|
+
${StyledSortableFillIconWrapper} {
|
|
308
|
+
color: ${fgPrimaryInactive};
|
|
309
|
+
fill: ${fgPrimaryActive};
|
|
310
|
+
}
|
|
311
|
+
`, reactTheming.focusStyles({
|
|
312
|
+
theme
|
|
313
|
+
}));
|
|
284
314
|
};
|
|
285
315
|
const StyledSortableButton = styled__default.default.button.attrs({
|
|
286
|
-
'data-garden-id': COMPONENT_ID$
|
|
287
|
-
'data-garden-version': '9.
|
|
316
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
317
|
+
'data-garden-version': '9.1.0',
|
|
288
318
|
type: 'button'
|
|
289
319
|
}).withConfig({
|
|
290
320
|
displayName: "StyledSortableButton",
|
|
291
321
|
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));
|
|
329
|
-
StyledSortableButton.defaultProps = {
|
|
330
|
-
theme: reactTheming.DEFAULT_THEME
|
|
331
|
-
};
|
|
322
|
+
})(["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));
|
|
332
323
|
|
|
333
|
-
const COMPONENT_ID$
|
|
324
|
+
const COMPONENT_ID$2 = 'tables.header_cell';
|
|
334
325
|
const truncatedStyling = styled.css(["", "{max-width:100%;overflow:hidden;text-overflow:ellipsis;}"], StyledSortableButton);
|
|
335
|
-
const sizeStyles = props => {
|
|
326
|
+
const sizeStyles$1 = props => {
|
|
336
327
|
let paddingVertical = undefined;
|
|
337
|
-
if (!props
|
|
328
|
+
if (!props.$hasOverflow) {
|
|
338
329
|
paddingVertical = polished.math(`(${getRowHeight(props)} - ${getLineHeight(props)}) / 2`);
|
|
339
330
|
}
|
|
340
331
|
return styled.css(["padding-top:", ";padding-bottom:", ";"], paddingVertical, paddingVertical);
|
|
341
332
|
};
|
|
342
333
|
const StyledHeaderCell = styled__default.default(StyledCell).attrs({
|
|
343
334
|
as: 'th',
|
|
344
|
-
'data-garden-id': COMPONENT_ID$
|
|
345
|
-
'data-garden-version': '9.
|
|
335
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
336
|
+
'data-garden-version': '9.1.0'
|
|
346
337
|
}).withConfig({
|
|
347
338
|
displayName: "StyledHeaderCell",
|
|
348
339
|
componentId: "sc-fzagoe-0"
|
|
349
340
|
})(["text-align:", ";font-weight:inherit;", " ", " ", ";"], props => {
|
|
350
|
-
if (!props
|
|
341
|
+
if (!props.$hasOverflow) {
|
|
351
342
|
if (props.theme.rtl) {
|
|
352
343
|
return 'right';
|
|
353
344
|
}
|
|
354
345
|
return 'left';
|
|
355
346
|
}
|
|
356
347
|
return undefined;
|
|
357
|
-
}, props => sizeStyles(props), props => props
|
|
358
|
-
StyledHeaderCell.defaultProps = {
|
|
359
|
-
theme: reactTheming.DEFAULT_THEME
|
|
360
|
-
};
|
|
348
|
+
}, props => sizeStyles$1(props), props => props.$isTruncated && truncatedStyling, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
361
349
|
|
|
362
|
-
const COMPONENT_ID = 'tables.hidden_cell';
|
|
350
|
+
const COMPONENT_ID$1 = 'tables.hidden_cell';
|
|
363
351
|
const StyledHiddenCell = styled__default.default.div.attrs({
|
|
364
|
-
'data-garden-id': COMPONENT_ID,
|
|
365
|
-
'data-garden-version': '9.
|
|
352
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
353
|
+
'data-garden-version': '9.1.0'
|
|
366
354
|
}).withConfig({
|
|
367
355
|
displayName: "StyledHiddenCell",
|
|
368
356
|
componentId: "sc-1x454xw-0"
|
|
369
|
-
})(["", " ", ";"], polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
370
|
-
|
|
371
|
-
|
|
357
|
+
})(["", " ", ";"], polished.hideVisually(), props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
358
|
+
|
|
359
|
+
const COMPONENT_ID = 'tables.row';
|
|
360
|
+
const colorStyles = _ref => {
|
|
361
|
+
let {
|
|
362
|
+
theme,
|
|
363
|
+
$isFocused,
|
|
364
|
+
$isSelected,
|
|
365
|
+
$isHovered,
|
|
366
|
+
$isReadOnly
|
|
367
|
+
} = _ref;
|
|
368
|
+
const hoveredBackgroundColor = reactTheming.getColor({
|
|
369
|
+
variable: 'background.primaryEmphasis',
|
|
370
|
+
transparency: theme.opacity[100],
|
|
371
|
+
dark: {
|
|
372
|
+
offset: -100
|
|
373
|
+
},
|
|
374
|
+
theme
|
|
375
|
+
});
|
|
376
|
+
const hoveredBorderColor = reactTheming.getColor({
|
|
377
|
+
variable: 'border.primaryEmphasis',
|
|
378
|
+
transparency: theme.opacity[200],
|
|
379
|
+
dark: {
|
|
380
|
+
offset: -100
|
|
381
|
+
},
|
|
382
|
+
theme
|
|
383
|
+
});
|
|
384
|
+
const selectedBackgroundColor = reactTheming.getColor({
|
|
385
|
+
variable: 'background.primaryEmphasis',
|
|
386
|
+
transparency: theme.opacity[200],
|
|
387
|
+
dark: {
|
|
388
|
+
offset: -100
|
|
389
|
+
},
|
|
390
|
+
theme
|
|
391
|
+
});
|
|
392
|
+
const selectedBorderColor = reactTheming.getColor({
|
|
393
|
+
variable: 'border.primaryEmphasis',
|
|
394
|
+
light: {
|
|
395
|
+
offset: -400
|
|
396
|
+
},
|
|
397
|
+
dark: {
|
|
398
|
+
offset: 300
|
|
399
|
+
},
|
|
400
|
+
theme
|
|
401
|
+
});
|
|
402
|
+
const hoveredSelectedBackgroundColor = reactTheming.getColor({
|
|
403
|
+
variable: 'background.primaryEmphasis',
|
|
404
|
+
transparency: theme.opacity[300],
|
|
405
|
+
dark: {
|
|
406
|
+
offset: -100
|
|
407
|
+
},
|
|
408
|
+
theme
|
|
409
|
+
});
|
|
410
|
+
const boxShadowColor = reactTheming.getColor({
|
|
411
|
+
variable: 'border.primaryEmphasis',
|
|
412
|
+
theme
|
|
413
|
+
});
|
|
414
|
+
const boxShadow = `inset ${theme.rtl ? '-' : ''}${theme.shadowWidths.md} 0 0 0 ${boxShadowColor}`;
|
|
415
|
+
let backgroundColor = undefined;
|
|
416
|
+
let borderColor = undefined;
|
|
417
|
+
let hoverBorderBottomColor = undefined;
|
|
418
|
+
let hoverBackgroundColor = undefined;
|
|
419
|
+
if ($isSelected) {
|
|
420
|
+
if ($isHovered) {
|
|
421
|
+
backgroundColor = hoveredSelectedBackgroundColor;
|
|
422
|
+
} else {
|
|
423
|
+
backgroundColor = selectedBackgroundColor;
|
|
424
|
+
}
|
|
425
|
+
borderColor = selectedBorderColor;
|
|
426
|
+
hoverBorderBottomColor = selectedBorderColor;
|
|
427
|
+
hoverBackgroundColor = hoveredSelectedBackgroundColor;
|
|
428
|
+
} else if ($isHovered) {
|
|
429
|
+
backgroundColor = hoveredBackgroundColor;
|
|
430
|
+
borderColor = hoveredBorderColor;
|
|
431
|
+
} else if (!$isReadOnly) {
|
|
432
|
+
hoverBorderBottomColor = hoveredBorderColor;
|
|
433
|
+
hoverBackgroundColor = hoveredBackgroundColor;
|
|
434
|
+
}
|
|
435
|
+
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);
|
|
436
|
+
};
|
|
437
|
+
const sizeStyles = props => {
|
|
438
|
+
return styled.css(["height:", ";"], getRowHeight(props));
|
|
372
439
|
};
|
|
440
|
+
const StyledRow = styled__default.default(StyledBaseRow).attrs({
|
|
441
|
+
'data-garden-id': COMPONENT_ID,
|
|
442
|
+
'data-garden-version': '9.1.0'
|
|
443
|
+
}).withConfig({
|
|
444
|
+
displayName: "StyledRow",
|
|
445
|
+
componentId: "sc-ek66ow-0"
|
|
446
|
+
})(["", " ", " ", ";"], sizeStyles, colorStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID, props));
|
|
373
447
|
|
|
374
448
|
const Body = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledBody, Object.assign({
|
|
375
449
|
ref: ref
|
|
376
450
|
}, props)));
|
|
377
|
-
Body.displayName = 'Body';
|
|
451
|
+
Body.displayName = 'Table.Body';
|
|
378
452
|
|
|
379
453
|
const Caption = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledCaption, Object.assign({
|
|
380
454
|
ref: ref
|
|
381
455
|
}, props)));
|
|
382
|
-
Caption.displayName = 'Caption';
|
|
456
|
+
Caption.displayName = 'Table.Caption';
|
|
383
457
|
|
|
384
458
|
const TableContext = React__namespace.default.createContext({
|
|
385
459
|
size: 'medium',
|
|
@@ -392,6 +466,9 @@ const useTableContext = () => {
|
|
|
392
466
|
const Cell = React__namespace.default.forwardRef((_ref, ref) => {
|
|
393
467
|
let {
|
|
394
468
|
hidden,
|
|
469
|
+
isMinimum,
|
|
470
|
+
isTruncated,
|
|
471
|
+
hasOverflow,
|
|
395
472
|
...props
|
|
396
473
|
} = _ref;
|
|
397
474
|
const {
|
|
@@ -399,10 +476,13 @@ const Cell = React__namespace.default.forwardRef((_ref, ref) => {
|
|
|
399
476
|
} = useTableContext();
|
|
400
477
|
return React__namespace.default.createElement(StyledCell, Object.assign({
|
|
401
478
|
ref: ref,
|
|
402
|
-
size: size
|
|
479
|
+
$size: size,
|
|
480
|
+
$isMinimum: isMinimum,
|
|
481
|
+
$isTruncated: isTruncated,
|
|
482
|
+
$hasOverflow: hasOverflow
|
|
403
483
|
}, props), hidden && props.children ? React__namespace.default.createElement(StyledHiddenCell, null, props.children) : props.children);
|
|
404
484
|
});
|
|
405
|
-
Cell.displayName = 'Cell';
|
|
485
|
+
Cell.displayName = 'Table.Cell';
|
|
406
486
|
Cell.propTypes = {
|
|
407
487
|
isMinimum: PropTypes__default.default.bool,
|
|
408
488
|
isTruncated: PropTypes__default.default.bool,
|
|
@@ -416,19 +496,29 @@ const GroupRow = React.forwardRef((props, ref) => {
|
|
|
416
496
|
} = useTableContext();
|
|
417
497
|
return React__namespace.default.createElement(StyledGroupRow, Object.assign({
|
|
418
498
|
ref: ref,
|
|
419
|
-
size: size
|
|
499
|
+
$size: size
|
|
420
500
|
}, props));
|
|
421
501
|
});
|
|
422
|
-
GroupRow.displayName = 'GroupRow';
|
|
502
|
+
GroupRow.displayName = 'Table.GroupRow';
|
|
423
503
|
|
|
424
|
-
const Head = React.forwardRef((
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
504
|
+
const Head = React.forwardRef((_ref, ref) => {
|
|
505
|
+
let {
|
|
506
|
+
isSticky,
|
|
507
|
+
...props
|
|
508
|
+
} = _ref;
|
|
509
|
+
return React__namespace.default.createElement(StyledHead, Object.assign({
|
|
510
|
+
ref: ref,
|
|
511
|
+
$isSticky: isSticky
|
|
512
|
+
}, props));
|
|
513
|
+
});
|
|
514
|
+
Head.displayName = 'Table.Head';
|
|
428
515
|
|
|
429
516
|
const HeaderCell = React.forwardRef((_ref, ref) => {
|
|
430
517
|
let {
|
|
431
518
|
hidden,
|
|
519
|
+
isMinimum,
|
|
520
|
+
isTruncated,
|
|
521
|
+
hasOverflow,
|
|
432
522
|
...props
|
|
433
523
|
} = _ref;
|
|
434
524
|
const {
|
|
@@ -436,10 +526,13 @@ const HeaderCell = React.forwardRef((_ref, ref) => {
|
|
|
436
526
|
} = useTableContext();
|
|
437
527
|
return React__namespace.default.createElement(StyledHeaderCell, Object.assign({
|
|
438
528
|
ref: ref,
|
|
439
|
-
size: size
|
|
529
|
+
$size: size,
|
|
530
|
+
$isMinimum: isMinimum,
|
|
531
|
+
$isTruncated: isTruncated,
|
|
532
|
+
$hasOverflow: hasOverflow
|
|
440
533
|
}, props), hidden && props.children ? React__namespace.default.createElement(StyledHiddenCell, null, props.children) : props.children);
|
|
441
534
|
});
|
|
442
|
-
HeaderCell.displayName = 'HeaderCell';
|
|
535
|
+
HeaderCell.displayName = 'Table.HeaderCell';
|
|
443
536
|
HeaderCell.propTypes = Cell.propTypes;
|
|
444
537
|
|
|
445
538
|
const HeaderRow = React__namespace.default.forwardRef((props, ref) => {
|
|
@@ -448,14 +541,14 @@ const HeaderRow = React__namespace.default.forwardRef((props, ref) => {
|
|
|
448
541
|
} = useTableContext();
|
|
449
542
|
return React__namespace.default.createElement(StyledHeaderRow, Object.assign({
|
|
450
543
|
ref: ref,
|
|
451
|
-
size: size
|
|
544
|
+
$size: size
|
|
452
545
|
}, props));
|
|
453
546
|
});
|
|
454
|
-
HeaderRow.displayName = 'HeaderRow';
|
|
547
|
+
HeaderRow.displayName = 'Table.HeaderRow';
|
|
455
548
|
|
|
456
|
-
var
|
|
457
|
-
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
458
|
-
var
|
|
549
|
+
var _path$2;
|
|
550
|
+
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); }
|
|
551
|
+
var SvgOverflowVerticalStroke = function SvgOverflowVerticalStroke(props) {
|
|
459
552
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
460
553
|
xmlns: "http://www.w3.org/2000/svg",
|
|
461
554
|
width: 16,
|
|
@@ -463,57 +556,33 @@ var SvgOverflowStroke = function SvgOverflowStroke(props) {
|
|
|
463
556
|
focusable: "false",
|
|
464
557
|
viewBox: "0 0 16 16",
|
|
465
558
|
"aria-hidden": "true"
|
|
466
|
-
}, props),
|
|
467
|
-
fill: "currentColor"
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
cy: 8,
|
|
471
|
-
r: 1.5
|
|
472
|
-
}), /*#__PURE__*/React__namespace.createElement("circle", {
|
|
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
|
-
}))));
|
|
559
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
560
|
+
fill: "currentColor",
|
|
561
|
+
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"
|
|
562
|
+
})));
|
|
481
563
|
};
|
|
482
564
|
|
|
483
|
-
const OverflowButton = React.forwardRef((
|
|
484
|
-
let {
|
|
485
|
-
onFocus,
|
|
486
|
-
onBlur,
|
|
487
|
-
isFocused: focused,
|
|
488
|
-
...other
|
|
489
|
-
} = _ref;
|
|
490
|
-
const [isFocused, setIsFocused] = React.useState(false);
|
|
565
|
+
const OverflowButton = React.forwardRef((props, ref) => {
|
|
491
566
|
const {
|
|
492
567
|
size
|
|
493
568
|
} = useTableContext();
|
|
494
569
|
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,
|
|
570
|
+
type: "button",
|
|
571
|
+
$size: size,
|
|
503
572
|
ref: ref
|
|
504
|
-
},
|
|
573
|
+
}, props, {
|
|
574
|
+
focusInset: true
|
|
575
|
+
}), React__namespace.default.createElement(SvgOverflowVerticalStroke, null));
|
|
505
576
|
});
|
|
506
|
-
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
|
-
};
|
|
577
|
+
OverflowButton.displayName = 'Table.OverflowButton';
|
|
512
578
|
|
|
513
579
|
const Row = React.forwardRef((_ref, ref) => {
|
|
514
580
|
let {
|
|
515
581
|
onFocus,
|
|
516
582
|
onBlur,
|
|
583
|
+
isSelected,
|
|
584
|
+
isStriped,
|
|
585
|
+
isHovered,
|
|
517
586
|
isFocused: focused,
|
|
518
587
|
...otherProps
|
|
519
588
|
} = _ref;
|
|
@@ -540,13 +609,18 @@ const Row = React.forwardRef((_ref, ref) => {
|
|
|
540
609
|
return React__namespace.default.createElement(StyledRow, Object.assign({
|
|
541
610
|
onFocus: onFocusCallback,
|
|
542
611
|
onBlur: onBlurCallback,
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
612
|
+
ref: ref,
|
|
613
|
+
$size: size,
|
|
614
|
+
$isReadOnly: isReadOnly,
|
|
615
|
+
$isFocused: computedFocused,
|
|
616
|
+
$isHovered: isHovered,
|
|
617
|
+
$isStriped: isStriped,
|
|
618
|
+
$isSelected: isSelected
|
|
619
|
+
}, otherProps, {
|
|
620
|
+
tabIndex: isReadOnly ? undefined : -1
|
|
621
|
+
}));
|
|
548
622
|
});
|
|
549
|
-
Row.displayName = 'Row';
|
|
623
|
+
Row.displayName = 'Table.Row';
|
|
550
624
|
Row.propTypes = {
|
|
551
625
|
isStriped: PropTypes__default.default.bool,
|
|
552
626
|
isFocused: PropTypes__default.default.bool,
|
|
@@ -555,7 +629,7 @@ Row.propTypes = {
|
|
|
555
629
|
};
|
|
556
630
|
|
|
557
631
|
var _path$1;
|
|
558
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
632
|
+
function _extends$1() { return _extends$1 = 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$1.apply(null, arguments); }
|
|
559
633
|
var SvgSortStroke = function SvgSortStroke(props) {
|
|
560
634
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
561
635
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -573,7 +647,7 @@ var SvgSortStroke = function SvgSortStroke(props) {
|
|
|
573
647
|
};
|
|
574
648
|
|
|
575
649
|
var _path, _path2;
|
|
576
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
650
|
+
function _extends() { return _extends = 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.apply(null, arguments); }
|
|
577
651
|
var SvgSortFill = function SvgSortFill(props) {
|
|
578
652
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
579
653
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -596,11 +670,16 @@ const SORT = ['asc', 'desc'];
|
|
|
596
670
|
const SortableCell = React.forwardRef((_ref, ref) => {
|
|
597
671
|
let {
|
|
598
672
|
sort,
|
|
599
|
-
cellProps,
|
|
673
|
+
cellProps = {},
|
|
600
674
|
width,
|
|
601
675
|
children,
|
|
602
|
-
...
|
|
676
|
+
...sortableButtonProps
|
|
603
677
|
} = _ref;
|
|
678
|
+
const {
|
|
679
|
+
isMinimum,
|
|
680
|
+
isTruncated,
|
|
681
|
+
hasOverflow
|
|
682
|
+
} = cellProps;
|
|
604
683
|
let ariaSortValue = 'none';
|
|
605
684
|
if (sort === 'asc') {
|
|
606
685
|
ariaSortValue = 'ascending';
|
|
@@ -610,24 +689,32 @@ const SortableCell = React.forwardRef((_ref, ref) => {
|
|
|
610
689
|
const SortIcon = sort === undefined ? SvgSortStroke : SvgSortFill;
|
|
611
690
|
return React__namespace.default.createElement(StyledHeaderCell, Object.assign({
|
|
612
691
|
"aria-sort": ariaSortValue,
|
|
613
|
-
width: width
|
|
692
|
+
width: width,
|
|
693
|
+
$isMinimum: isMinimum,
|
|
694
|
+
$isTruncated: isTruncated,
|
|
695
|
+
$hasOverflow: hasOverflow
|
|
614
696
|
}, cellProps), React__namespace.default.createElement(StyledSortableButton, Object.assign({
|
|
615
|
-
sort: sort,
|
|
697
|
+
$sort: sort,
|
|
616
698
|
ref: ref
|
|
617
|
-
},
|
|
699
|
+
}, 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
700
|
});
|
|
619
|
-
SortableCell.displayName = 'SortableCell';
|
|
701
|
+
SortableCell.displayName = 'Table.SortableCell';
|
|
620
702
|
SortableCell.propTypes = {
|
|
621
703
|
sort: PropTypes__default.default.oneOf(SORT),
|
|
622
704
|
cellProps: PropTypes__default.default.any,
|
|
623
705
|
width: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number])
|
|
624
706
|
};
|
|
625
707
|
|
|
626
|
-
const TableComponent = React__namespace.default.forwardRef((
|
|
708
|
+
const TableComponent = React__namespace.default.forwardRef((_ref, ref) => {
|
|
709
|
+
let {
|
|
710
|
+
isReadOnly,
|
|
711
|
+
size,
|
|
712
|
+
...props
|
|
713
|
+
} = _ref;
|
|
627
714
|
const tableContextValue = React.useMemo(() => ({
|
|
628
|
-
size:
|
|
629
|
-
isReadOnly:
|
|
630
|
-
}), [
|
|
715
|
+
size: size,
|
|
716
|
+
isReadOnly: isReadOnly
|
|
717
|
+
}), [size, isReadOnly]);
|
|
631
718
|
return React__namespace.default.createElement(TableContext.Provider, {
|
|
632
719
|
value: tableContextValue
|
|
633
720
|
}, React__namespace.default.createElement(StyledTable, Object.assign({
|