@pingux/astro 2.131.0-alpha.1 → 2.131.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/lib/cjs/components/Box/Box.styles.d.ts +14 -0
- package/lib/cjs/components/Box/Box.styles.js +16 -1
- package/lib/cjs/components/Checkbox/CheckboxBase.js +2 -6
- package/lib/cjs/components/MenuItem/MenuItem.styles.d.ts +1 -0
- package/lib/cjs/components/MenuItem/MenuItem.styles.js +1 -0
- package/lib/cjs/components/TableBase/TableBase.d.ts +7 -6
- package/lib/cjs/components/TableBase/TableBase.js +141 -47
- package/lib/cjs/components/TableBase/TableBase.stories.d.ts +5 -3
- package/lib/cjs/components/TableBase/TableBase.stories.js +114 -28
- package/lib/cjs/components/TableBase/TableBase.styles.d.ts +12 -6
- package/lib/cjs/components/TableBase/TableBase.styles.js +14 -8
- package/lib/cjs/components/TableBase/TableBase.test.js +158 -9
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +13 -0
- package/lib/cjs/styles/themes/next-gen/variants/tableBase.d.ts +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/tableBase.js +1 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +13 -0
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +13 -1
- package/lib/cjs/types/checkboxField.d.ts +1 -5
- package/lib/cjs/types/tableBase.d.ts +35 -19
- package/lib/components/Box/Box.styles.js +16 -1
- package/lib/components/Checkbox/CheckboxBase.js +2 -6
- package/lib/components/MenuItem/MenuItem.styles.js +1 -0
- package/lib/components/TableBase/TableBase.js +141 -48
- package/lib/components/TableBase/TableBase.stories.js +106 -27
- package/lib/components/TableBase/TableBase.styles.js +14 -8
- package/lib/components/TableBase/TableBase.test.js +159 -10
- package/lib/styles/themes/next-gen/variants/tableBase.js +1 -0
- package/lib/styles/themes/next-gen/variants/variants.js +13 -1
- package/package.json +1 -1
@@ -1,10 +1,18 @@
|
|
1
1
|
declare const _default: {
|
2
|
-
thead: {
|
2
|
+
thead: {
|
3
|
+
borderBottom: string;
|
4
|
+
backgroundColor: string;
|
5
|
+
borderBottomColor: string;
|
6
|
+
'&.is-sticky': {
|
7
|
+
position: string;
|
8
|
+
top: number;
|
9
|
+
zIndex: number;
|
10
|
+
};
|
11
|
+
};
|
3
12
|
tbody: {
|
4
|
-
borderTop: string;
|
5
|
-
borderTopColor: string;
|
6
13
|
borderBottom: string;
|
7
14
|
borderBottomColor: string;
|
15
|
+
overflow: string;
|
8
16
|
};
|
9
17
|
caption: {
|
10
18
|
fontFamily: string;
|
@@ -17,12 +25,10 @@ declare const _default: {
|
|
17
25
|
width: string;
|
18
26
|
borderSpacing: string;
|
19
27
|
borderCollapse: string;
|
28
|
+
position: string;
|
20
29
|
};
|
21
30
|
data: {
|
22
31
|
p: string;
|
23
|
-
'&.no-wrap': {
|
24
|
-
whiteSpace: string;
|
25
|
-
};
|
26
32
|
'&.is-focused': {
|
27
33
|
outline: string;
|
28
34
|
outlineStyle: string;
|
@@ -26,7 +26,8 @@ var defaultFocus = {
|
|
26
26
|
var container = {
|
27
27
|
width: '100%',
|
28
28
|
borderSpacing: '0',
|
29
|
-
borderCollapse: 'collapse'
|
29
|
+
borderCollapse: 'collapse',
|
30
|
+
position: 'relative'
|
30
31
|
};
|
31
32
|
var caption = {
|
32
33
|
fontFamily: 'standard',
|
@@ -35,7 +36,16 @@ var caption = {
|
|
35
36
|
p: 'sm',
|
36
37
|
textAlign: 'left'
|
37
38
|
};
|
38
|
-
var thead = {
|
39
|
+
var thead = {
|
40
|
+
borderBottom: '1px solid',
|
41
|
+
backgroundColor: 'white',
|
42
|
+
borderBottomColor: 'neutral.40',
|
43
|
+
'&.is-sticky': {
|
44
|
+
position: 'sticky',
|
45
|
+
top: 0,
|
46
|
+
zIndex: 1
|
47
|
+
}
|
48
|
+
};
|
39
49
|
var head = _objectSpread(_objectSpread({}, _Text.text.label), {}, {
|
40
50
|
fontWeight: 500,
|
41
51
|
textAlign: 'left',
|
@@ -44,10 +54,9 @@ var head = _objectSpread(_objectSpread({}, _Text.text.label), {}, {
|
|
44
54
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
45
55
|
});
|
46
56
|
var tbody = {
|
47
|
-
borderTop: '1px solid',
|
48
|
-
borderTopColor: 'neutral.40',
|
49
57
|
borderBottom: '1px solid',
|
50
|
-
borderBottomColor: 'neutral.80'
|
58
|
+
borderBottomColor: 'neutral.80',
|
59
|
+
overflow: 'auto'
|
51
60
|
};
|
52
61
|
var row = {
|
53
62
|
'&:nth-of-type(odd) ': {
|
@@ -63,9 +72,6 @@ var row = {
|
|
63
72
|
};
|
64
73
|
var data = _objectSpread(_objectSpread({}, _Text.text.tableData), {}, {
|
65
74
|
p: 'sm',
|
66
|
-
'&.no-wrap': {
|
67
|
-
whiteSpace: 'nowrap'
|
68
|
-
},
|
69
75
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
70
76
|
});
|
71
77
|
var _default = {
|
@@ -5,6 +5,7 @@ var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-st
|
|
5
5
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
6
6
|
var _react = _interopRequireDefault(require("react"));
|
7
7
|
var _react2 = require("@testing-library/react");
|
8
|
+
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
8
9
|
var _index = require("../../index");
|
9
10
|
var _universalComponentTest = require("../../utils/testUtils/universalComponentTest");
|
10
11
|
var _TableBase = _interopRequireDefault(require("./TableBase"));
|
@@ -29,10 +30,7 @@ var objects = [{
|
|
29
30
|
key: '1',
|
30
31
|
country: 'USA',
|
31
32
|
population: '320,000,000',
|
32
|
-
continent: 'South America'
|
33
|
-
cellProps: {
|
34
|
-
noWrap: true
|
35
|
-
}
|
33
|
+
continent: 'South America'
|
36
34
|
}, {
|
37
35
|
key: '2',
|
38
36
|
country: 'Canada',
|
@@ -50,7 +48,8 @@ var objects = [{
|
|
50
48
|
continent: 'Europe'
|
51
49
|
}];
|
52
50
|
var getComponent = function getComponent() {
|
53
|
-
|
51
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
52
|
+
return (0, _react2.render)((0, _react3.jsx)(_TableBase["default"], (0, _extends2["default"])({}, defaultProps, props), (0, _react3.jsx)(_index.THead, {
|
54
53
|
columns: headers
|
55
54
|
}, function (head) {
|
56
55
|
return (0, _react3.jsx)(_index.Column, {
|
@@ -62,7 +61,7 @@ var getComponent = function getComponent() {
|
|
62
61
|
return (0, _react3.jsx)(_index.Row, {
|
63
62
|
key: row.key
|
64
63
|
}, function (columnKey) {
|
65
|
-
return (0, _react3.jsx)(_index.Cell,
|
64
|
+
return (0, _react3.jsx)(_index.Cell, null, row[columnKey]);
|
66
65
|
});
|
67
66
|
})));
|
68
67
|
};
|
@@ -115,8 +114,158 @@ test('renders table rows', function () {
|
|
115
114
|
expect(_react2.screen.getByText(object.continent)).toBeInTheDocument();
|
116
115
|
});
|
117
116
|
});
|
118
|
-
test('renders
|
117
|
+
test('renders checkbox in case of multi selection', function () {
|
118
|
+
getComponent({
|
119
|
+
selectionMode: 'multiple'
|
120
|
+
});
|
121
|
+
var checkboxes = _react2.screen.getAllByRole('checkbox');
|
122
|
+
expect(checkboxes).toHaveLength(objects.length + 1);
|
123
|
+
});
|
124
|
+
test('should change selection on mouse press', function () {
|
125
|
+
getComponent({
|
126
|
+
selectionMode: 'multiple'
|
127
|
+
});
|
128
|
+
var rows = _react2.screen.getAllByRole('row');
|
129
|
+
expect(rows[1]).not.toHaveClass('is-selected');
|
130
|
+
_userEvent["default"].click(rows[1]);
|
131
|
+
expect(rows[1]).toHaveClass('is-selected');
|
132
|
+
});
|
133
|
+
test('should change select all checkbox on mouse press', function () {
|
134
|
+
getComponent({
|
135
|
+
selectionMode: 'multiple'
|
136
|
+
});
|
137
|
+
var rows = _react2.screen.getAllByRole('row');
|
138
|
+
(0, _forEach["default"])(rows).call(rows, function (element) {
|
139
|
+
_userEvent["default"].click(element);
|
140
|
+
});
|
141
|
+
var headerCheckbox = _react2.screen.getByTestId('select-all-checkbox');
|
142
|
+
expect(headerCheckbox).toBeChecked();
|
143
|
+
});
|
144
|
+
test('should checked checkboxes if selected keys are provided', function () {
|
145
|
+
getComponent({
|
146
|
+
selectionMode: 'multiple',
|
147
|
+
selectedKeys: ['1', '3']
|
148
|
+
});
|
149
|
+
var checkboxes = _react2.screen.getAllByRole('checkbox');
|
150
|
+
var rows = _react2.screen.getAllByRole('row');
|
151
|
+
expect(checkboxes[1]).toBeChecked();
|
152
|
+
expect(rows[1]).toHaveClass('is-selected');
|
153
|
+
expect(checkboxes[2]).not.toBeChecked();
|
154
|
+
expect(rows[2]).not.toHaveClass('is-selected');
|
155
|
+
expect(checkboxes[3]).toBeChecked();
|
156
|
+
expect(rows[3]).toHaveClass('is-selected');
|
157
|
+
var headerCheckbox = _react2.screen.getByTestId('select-all-checkbox');
|
158
|
+
expect(headerCheckbox).toBePartiallyChecked();
|
159
|
+
});
|
160
|
+
test('tab key should focus on the first cell of the first row', function () {
|
161
|
+
getComponent();
|
162
|
+
var rows = _react2.screen.getAllByRole('row');
|
163
|
+
_userEvent["default"].tab();
|
164
|
+
expect(rows[1]).toHaveFocus();
|
165
|
+
});
|
166
|
+
test('Arrow Down key should focus the next row', function () {
|
167
|
+
getComponent();
|
168
|
+
var rows = _react2.screen.getAllByRole('row');
|
169
|
+
_userEvent["default"].tab();
|
170
|
+
expect(rows[1]).toHaveFocus();
|
171
|
+
_react2.fireEvent.keyDown(rows[1], {
|
172
|
+
key: 'ArrowDown'
|
173
|
+
});
|
174
|
+
_react2.fireEvent.keyUp(rows[1], {
|
175
|
+
key: 'ArrowDown'
|
176
|
+
});
|
177
|
+
expect(rows[2]).toHaveFocus();
|
178
|
+
_react2.fireEvent.keyDown(rows[2], {
|
179
|
+
key: 'ArrowDown'
|
180
|
+
});
|
181
|
+
_react2.fireEvent.keyUp(rows[2], {
|
182
|
+
key: 'ArrowDown'
|
183
|
+
});
|
184
|
+
expect(rows[3]).toHaveFocus();
|
185
|
+
});
|
186
|
+
test('Arrow Up key should focus the next row', function () {
|
187
|
+
getComponent();
|
188
|
+
var rows = _react2.screen.getAllByRole('row');
|
189
|
+
_userEvent["default"].tab();
|
190
|
+
expect(rows[1]).toHaveFocus();
|
191
|
+
_react2.fireEvent.keyDown(rows[1], {
|
192
|
+
key: 'ArrowUp'
|
193
|
+
});
|
194
|
+
_react2.fireEvent.keyUp(rows[1], {
|
195
|
+
key: 'ArrowUp'
|
196
|
+
});
|
197
|
+
var columnheader = _react2.screen.getAllByRole('columnheader');
|
198
|
+
expect(columnheader[0]).toHaveFocus();
|
199
|
+
});
|
200
|
+
test('Arrow Right move the focus to next cell', function () {
|
201
|
+
getComponent();
|
202
|
+
var rows = _react2.screen.getAllByRole('row');
|
203
|
+
var firstRow = _react2.screen.getAllByRole('row')[1];
|
204
|
+
var tableCells = firstRow.querySelectorAll('td');
|
205
|
+
_userEvent["default"].tab();
|
206
|
+
expect(rows[1]).toHaveFocus();
|
207
|
+
_react2.fireEvent.keyDown(rows[1], {
|
208
|
+
key: 'ArrowRight'
|
209
|
+
});
|
210
|
+
_react2.fireEvent.keyUp(rows[1], {
|
211
|
+
key: 'ArrowRight'
|
212
|
+
});
|
213
|
+
expect(tableCells[0]).toHaveFocus();
|
214
|
+
_react2.fireEvent.keyDown(tableCells[0], {
|
215
|
+
key: 'ArrowRight'
|
216
|
+
});
|
217
|
+
_react2.fireEvent.keyUp(tableCells[0], {
|
218
|
+
key: 'ArrowRight'
|
219
|
+
});
|
220
|
+
expect(tableCells[1]).toHaveFocus();
|
221
|
+
_react2.fireEvent.keyDown(tableCells[1], {
|
222
|
+
key: 'ArrowRight'
|
223
|
+
});
|
224
|
+
_react2.fireEvent.keyUp(tableCells[1], {
|
225
|
+
key: 'ArrowRight'
|
226
|
+
});
|
227
|
+
expect(tableCells[2]).toHaveFocus();
|
228
|
+
_react2.fireEvent.keyDown(tableCells[2], {
|
229
|
+
key: 'ArrowRight'
|
230
|
+
});
|
231
|
+
_react2.fireEvent.keyUp(tableCells[2], {
|
232
|
+
key: 'ArrowRight'
|
233
|
+
});
|
234
|
+
expect(rows[1]).toHaveFocus();
|
235
|
+
});
|
236
|
+
test('Arrow Left move the focus to next cell', function () {
|
119
237
|
getComponent();
|
120
|
-
var
|
121
|
-
|
238
|
+
var rows = _react2.screen.getAllByRole('row');
|
239
|
+
var firstRow = _react2.screen.getAllByRole('row')[1];
|
240
|
+
var tableCells = firstRow.querySelectorAll('td');
|
241
|
+
_userEvent["default"].tab();
|
242
|
+
expect(rows[1]).toHaveFocus();
|
243
|
+
_react2.fireEvent.keyDown(rows[1], {
|
244
|
+
key: 'ArrowLeft'
|
245
|
+
});
|
246
|
+
_react2.fireEvent.keyUp(rows[1], {
|
247
|
+
key: 'ArrowLeft'
|
248
|
+
});
|
249
|
+
expect(tableCells[2]).toHaveFocus();
|
250
|
+
_react2.fireEvent.keyDown(tableCells[2], {
|
251
|
+
key: 'ArrowLeft'
|
252
|
+
});
|
253
|
+
_react2.fireEvent.keyUp(tableCells[2], {
|
254
|
+
key: 'ArrowLeft'
|
255
|
+
});
|
256
|
+
expect(tableCells[1]).toHaveFocus();
|
257
|
+
_react2.fireEvent.keyDown(tableCells[1], {
|
258
|
+
key: 'ArrowLeft'
|
259
|
+
});
|
260
|
+
_react2.fireEvent.keyUp(tableCells[1], {
|
261
|
+
key: 'ArrowLeft'
|
262
|
+
});
|
263
|
+
expect(tableCells[0]).toHaveFocus();
|
264
|
+
_react2.fireEvent.keyDown(tableCells[0], {
|
265
|
+
key: 'ArrowLeft'
|
266
|
+
});
|
267
|
+
_react2.fireEvent.keyUp(tableCells[0], {
|
268
|
+
key: 'ArrowLeft'
|
269
|
+
});
|
270
|
+
expect(rows[1]).toHaveFocus();
|
122
271
|
});
|
@@ -3830,6 +3830,7 @@ declare const _default: {
|
|
3830
3830
|
};
|
3831
3831
|
};
|
3832
3832
|
thead: {
|
3833
|
+
borderBottomColor: string;
|
3833
3834
|
backgroundColor: string;
|
3834
3835
|
'&:not(.has-caption)': {
|
3835
3836
|
'& > tr:first-child': {
|
@@ -3887,6 +3888,18 @@ declare const _default: {
|
|
3887
3888
|
};
|
3888
3889
|
};
|
3889
3890
|
};
|
3891
|
+
box: {
|
3892
|
+
indeterminateCheckboxIcon: {
|
3893
|
+
height: string;
|
3894
|
+
width: string;
|
3895
|
+
'&.is-disabled': {
|
3896
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
3897
|
+
fill: string;
|
3898
|
+
stroke: string;
|
3899
|
+
};
|
3900
|
+
};
|
3901
|
+
};
|
3902
|
+
};
|
3890
3903
|
};
|
3891
3904
|
images: {
|
3892
3905
|
avatar: {};
|
@@ -1429,6 +1429,7 @@ declare const _default: {
|
|
1429
1429
|
};
|
1430
1430
|
};
|
1431
1431
|
thead: {
|
1432
|
+
borderBottomColor: string;
|
1432
1433
|
backgroundColor: string;
|
1433
1434
|
'&:not(.has-caption)': {
|
1434
1435
|
'& > tr:first-child': {
|
@@ -1486,5 +1487,17 @@ declare const _default: {
|
|
1486
1487
|
};
|
1487
1488
|
};
|
1488
1489
|
};
|
1490
|
+
box: {
|
1491
|
+
indeterminateCheckboxIcon: {
|
1492
|
+
height: string;
|
1493
|
+
width: string;
|
1494
|
+
'&.is-disabled': {
|
1495
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
1496
|
+
fill: string;
|
1497
|
+
stroke: string;
|
1498
|
+
};
|
1499
|
+
};
|
1500
|
+
};
|
1501
|
+
};
|
1489
1502
|
};
|
1490
1503
|
export default _default;
|
@@ -389,6 +389,18 @@ var _default = {
|
|
389
389
|
loader: loader,
|
390
390
|
callout: _callout["default"],
|
391
391
|
table: _table.table,
|
392
|
-
tableBase: _tableBase.tableBase
|
392
|
+
tableBase: _tableBase.tableBase,
|
393
|
+
box: {
|
394
|
+
indeterminateCheckboxIcon: {
|
395
|
+
height: '19.25px',
|
396
|
+
width: '19.25px',
|
397
|
+
'&.is-disabled': {
|
398
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
399
|
+
fill: 'gray-500',
|
400
|
+
stroke: 'gray-500'
|
401
|
+
}
|
402
|
+
}
|
403
|
+
}
|
404
|
+
}
|
393
405
|
};
|
394
406
|
exports["default"] = _default;
|
@@ -1,10 +1,6 @@
|
|
1
1
|
import { UseFieldProps } from '../hooks/useField/useField';
|
2
2
|
import { HelpHintProps } from './helpHint';
|
3
|
-
export interface CheckboxFieldProps extends Omit<UseFieldProps<HTMLInputElement>, 'onChange'> {
|
4
|
-
/** Handler that is called when a key is pressed. */
|
5
|
-
onKeyDown?: () => void;
|
6
|
-
/** Handler that is called when a key is released. */
|
7
|
-
onKeyUp?: () => void;
|
3
|
+
export interface CheckboxFieldProps extends Omit<UseFieldProps<HTMLInputElement>, 'onChange' | 'onKeyDown' | 'onKeyUp'> {
|
8
4
|
/** Handler that is called when the element's selection state changes. */
|
9
5
|
onChange?: (isSelected: boolean) => void;
|
10
6
|
/** props that are spread directly into the checkbox component */
|
@@ -1,45 +1,61 @@
|
|
1
|
-
import {
|
1
|
+
import { ReactNode } from 'react';
|
2
2
|
import type { TableState } from '@react-stately/table';
|
3
|
+
import { TableColumnResizeState } from '@react-stately/table';
|
3
4
|
import type { GridNode } from '@react-types/grid';
|
4
5
|
import type { Node } from '@react-types/shared';
|
6
|
+
import type { TableProps } from '@react-types/table';
|
5
7
|
import { TestingAttributes } from './shared/test';
|
6
8
|
import { BoxProps } from './box';
|
7
9
|
import { DOMAttributes } from './shared';
|
8
|
-
export interface
|
10
|
+
export interface BaseProp extends BoxProps, TestingAttributes, DOMAttributes {
|
9
11
|
}
|
10
|
-
export interface TableBaseProps extends
|
12
|
+
export interface TableBaseProps<T extends object> extends TableProps<T>, Omit<BaseProp, 'children'> {
|
11
13
|
'aria-label'?: string;
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
selectionMode?: 'none' | 'single' | 'multiple';
|
15
|
+
selectionBehavior?: 'replace' | 'toggle';
|
16
|
+
showSelectionCheckboxes?: boolean;
|
15
17
|
'data-testid'?: string;
|
16
18
|
caption?: ReactNode | string;
|
17
19
|
tableBodyProps?: Record<string, unknown>;
|
20
|
+
isStickyHeader?: boolean;
|
18
21
|
}
|
19
|
-
export interface TableRowGroupProps extends
|
22
|
+
export interface TableRowGroupProps extends BaseProp {
|
20
23
|
type: 'thead' | 'tbody' | 'tfoot';
|
21
24
|
children: ReactNode;
|
22
25
|
hasCaption?: boolean;
|
26
|
+
isSticky?: boolean;
|
23
27
|
}
|
24
|
-
export interface TableHeaderRowProps extends
|
25
|
-
item: Node<
|
26
|
-
state: TableState<
|
28
|
+
export interface TableHeaderRowProps<T> extends BaseProp {
|
29
|
+
item: Node<T>;
|
30
|
+
state: TableState<T>;
|
27
31
|
children: ReactNode;
|
28
32
|
className?: string;
|
29
33
|
}
|
30
|
-
export interface TableColumnHeaderProps extends
|
31
|
-
column: GridNode<
|
32
|
-
state: TableState<
|
34
|
+
export interface TableColumnHeaderProps<T> extends BaseProp {
|
35
|
+
column: GridNode<T>;
|
36
|
+
state: TableState<T>;
|
33
37
|
className?: string;
|
38
|
+
layoutState: TableColumnResizeState<T>;
|
34
39
|
}
|
35
|
-
export interface TableRowProps extends
|
36
|
-
item: Node<
|
37
|
-
state: TableState<
|
40
|
+
export interface TableRowProps<T> extends BaseProp {
|
41
|
+
item: Node<T>;
|
42
|
+
state: TableState<T>;
|
38
43
|
children: ReactNode;
|
39
44
|
className?: string;
|
40
45
|
}
|
41
|
-
export interface TableCellProps extends
|
42
|
-
cell: GridNode<
|
43
|
-
state: TableState<
|
46
|
+
export interface TableCellProps<T> extends BaseProp {
|
47
|
+
cell: GridNode<T>;
|
48
|
+
state: TableState<T>;
|
44
49
|
className?: string;
|
50
|
+
layoutState: TableColumnResizeState<T>;
|
51
|
+
}
|
52
|
+
export interface TableCheckboxCellProps<T> extends BaseProp {
|
53
|
+
cell: GridNode<T>;
|
54
|
+
state: TableState<T>;
|
55
|
+
layoutState: TableColumnResizeState<T>;
|
56
|
+
}
|
57
|
+
export interface TableSelectAllCellProps<T> extends BaseProp {
|
58
|
+
column: GridNode<T>;
|
59
|
+
state: TableState<T>;
|
60
|
+
layoutState: TableColumnResizeState<T>;
|
45
61
|
}
|
@@ -1,6 +1,21 @@
|
|
1
1
|
var base = {
|
2
2
|
display: 'flex'
|
3
3
|
};
|
4
|
+
var indeterminateCheckboxIcon = {
|
5
|
+
width: '24px',
|
6
|
+
height: '24px',
|
7
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
8
|
+
fill: 'active',
|
9
|
+
stroke: 'active'
|
10
|
+
},
|
11
|
+
'&.is-disabled': {
|
12
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
13
|
+
fill: 'neutral.80',
|
14
|
+
stroke: 'neutral.80'
|
15
|
+
}
|
16
|
+
}
|
17
|
+
};
|
4
18
|
export default {
|
5
|
-
base: base
|
19
|
+
base: base,
|
20
|
+
indeterminateCheckboxIcon: indeterminateCheckboxIcon
|
6
21
|
};
|
@@ -4,7 +4,6 @@ import { VisuallyHidden } from '@react-aria/visually-hidden';
|
|
4
4
|
import { omit } from 'lodash';
|
5
5
|
import PropTypes from 'prop-types';
|
6
6
|
import { Checkbox as ThemeUICheckbox } from 'theme-ui';
|
7
|
-
import { active, neutral } from '../../styles/colors';
|
8
7
|
import Box from '../Box';
|
9
8
|
|
10
9
|
/**
|
@@ -22,10 +21,7 @@ var DefaultCheckbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
22
21
|
}, props));
|
23
22
|
});
|
24
23
|
var IndeterminateCheckboxIcon = function IndeterminateCheckboxIcon(props) {
|
25
|
-
var color = props.disabled ? neutral[80] : active;
|
26
24
|
return ___EmotionJSX("svg", _extends({
|
27
|
-
width: "24",
|
28
|
-
height: "24",
|
29
25
|
viewBox: "0 0 24 24",
|
30
26
|
fill: "none",
|
31
27
|
xmlns: "http://www.w3.org/2000/svg",
|
@@ -39,8 +35,7 @@ var IndeterminateCheckboxIcon = function IndeterminateCheckboxIcon(props) {
|
|
39
35
|
width: "17",
|
40
36
|
height: "17",
|
41
37
|
rx: "1.5",
|
42
|
-
|
43
|
-
stroke: color
|
38
|
+
id: "indeterminate-checkbox-icon-wrapper"
|
44
39
|
}), ___EmotionJSX("rect", {
|
45
40
|
x: "6.5",
|
46
41
|
y: "11",
|
@@ -65,6 +60,7 @@ var IndeterminateCheckbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
65
60
|
ref: ref
|
66
61
|
}, props))), ___EmotionJSX(Box, _extends({
|
67
62
|
as: IndeterminateCheckboxIcon,
|
63
|
+
variant: "variants.box.indeterminateCheckboxIcon",
|
68
64
|
mr: 2
|
69
65
|
}, props, {
|
70
66
|
opacity: 1
|