baseui 0.0.0-next-03a6fdb → 0.0.0-next-efef314
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/dnd-list/index.js.flow +2 -1
- package/es/dnd-list/index.js +2 -1
- package/es/select/select-component.js +4 -4
- package/es/table-semantic/styled-components.js +6 -4
- package/es/table-semantic/table-builder.js +3 -0
- package/es/tooltip/styled-components.js +8 -0
- package/esm/dnd-list/index.js +2 -1
- package/esm/select/select-component.js +4 -4
- package/esm/table-semantic/styled-components.js +6 -4
- package/esm/table-semantic/table-builder.js +3 -0
- package/esm/tooltip/styled-components.js +8 -0
- package/menu/index.d.ts +1 -0
- package/menu/types.js.flow +2 -0
- package/package.json +2 -2
- package/select/select-component.js +4 -4
- package/select/select-component.js.flow +4 -4
- package/table-semantic/styled-components.js +6 -4
- package/table-semantic/styled-components.js.flow +6 -4
- package/table-semantic/table-builder.js +3 -0
- package/table-semantic/table-builder.js.flow +3 -0
- package/tooltip/styled-components.js +8 -0
- package/tooltip/styled-components.js.flow +8 -0
package/dnd-list/index.js.flow
CHANGED
|
@@ -5,7 +5,8 @@ This source code is licensed under the MIT license found in the
|
|
|
5
5
|
LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
// @flow
|
|
8
|
-
|
|
8
|
+
import {arrayMove, arrayRemove} from 'react-movable';
|
|
9
|
+
export {arrayMove, arrayRemove};
|
|
9
10
|
export {default as StatefulList} from './stateful-list.js';
|
|
10
11
|
export {default as StatefulListContainer} from './stateful-list-container.js';
|
|
11
12
|
export {default as List} from './list.js';
|
package/es/dnd-list/index.js
CHANGED
|
@@ -4,7 +4,8 @@ Copyright (c) Uber Technologies, Inc.
|
|
|
4
4
|
This source code is licensed under the MIT license found in the
|
|
5
5
|
LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
import { arrayMove, arrayRemove } from 'react-movable';
|
|
8
|
+
export { arrayMove, arrayRemove };
|
|
8
9
|
export { default as StatefulList } from './stateful-list.js';
|
|
9
10
|
export { default as StatefulListContainer } from './stateful-list-container.js';
|
|
10
11
|
export { default as List } from './list.js'; // Constants
|
|
@@ -105,7 +105,7 @@ class Select extends React.Component {
|
|
|
105
105
|
isPseudoFocused: false
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
_defineProperty(this, "
|
|
108
|
+
_defineProperty(this, "isItMounted", false);
|
|
109
109
|
|
|
110
110
|
_defineProperty(this, "handleTouchOutside", event => {
|
|
111
111
|
if (containsNode(this.dropdown.current, event.target)) return;
|
|
@@ -238,7 +238,7 @@ class Select extends React.Component {
|
|
|
238
238
|
this.props.onBlur(event);
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
if (this.
|
|
241
|
+
if (this.isItMounted) {
|
|
242
242
|
this.setState({
|
|
243
243
|
isFocused: false,
|
|
244
244
|
isOpen: false,
|
|
@@ -565,7 +565,7 @@ class Select extends React.Component {
|
|
|
565
565
|
this.focus();
|
|
566
566
|
}
|
|
567
567
|
|
|
568
|
-
this.
|
|
568
|
+
this.isItMounted = true;
|
|
569
569
|
|
|
570
570
|
if (this.props.methodsRef) {
|
|
571
571
|
const {
|
|
@@ -601,7 +601,7 @@ class Select extends React.Component {
|
|
|
601
601
|
document.removeEventListener('click', this.handleClickOutside);
|
|
602
602
|
}
|
|
603
603
|
|
|
604
|
-
this.
|
|
604
|
+
this.isItMounted = false;
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
focus() {
|
|
@@ -67,7 +67,8 @@ StyledTableHeadRow.displayName = "StyledTableHeadRow";
|
|
|
67
67
|
export const StyledTableHeadCell = styled('th', ({
|
|
68
68
|
$theme,
|
|
69
69
|
$size,
|
|
70
|
-
$divider
|
|
70
|
+
$divider,
|
|
71
|
+
$isNumeric
|
|
71
72
|
}) => {
|
|
72
73
|
const borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
73
74
|
const borderVertical = $divider === DIVIDER.grid || $divider === DIVIDER.vertical;
|
|
@@ -81,7 +82,7 @@ export const StyledTableHeadCell = styled('th', ({
|
|
|
81
82
|
paddingLeft: padding,
|
|
82
83
|
backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
|
83
84
|
color: $theme.colors.contentPrimary,
|
|
84
|
-
textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
|
85
|
+
textAlign: $theme.direction === 'rtl' || $isNumeric ? 'right' : 'left',
|
|
85
86
|
verticalAlign: 'top',
|
|
86
87
|
whiteSpace: 'nowrap',
|
|
87
88
|
zIndex: 1,
|
|
@@ -170,7 +171,8 @@ export const StyledTableBodyCell = styled('td', ({
|
|
|
170
171
|
$size,
|
|
171
172
|
$divider,
|
|
172
173
|
$isNumeric,
|
|
173
|
-
$isLastRow
|
|
174
|
+
$isLastRow,
|
|
175
|
+
$isSortable
|
|
174
176
|
}) => {
|
|
175
177
|
const borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
176
178
|
const borderVertical = $divider === DIVIDER.vertical || $divider === DIVIDER.grid;
|
|
@@ -178,7 +180,7 @@ export const StyledTableBodyCell = styled('td', ({
|
|
|
178
180
|
const padding = sizeToCellPadding($theme, $size);
|
|
179
181
|
return { ...$theme.typography.font200,
|
|
180
182
|
paddingTop: padding,
|
|
181
|
-
paddingRight: padding,
|
|
183
|
+
paddingRight: !$isSortable ? padding : $theme.sizing.scale1000,
|
|
182
184
|
paddingBottom: padding,
|
|
183
185
|
paddingLeft: padding,
|
|
184
186
|
color: $theme.colors.contentPrimary,
|
|
@@ -79,6 +79,7 @@ export default class TableBuilder extends React.Component {
|
|
|
79
79
|
$col: col,
|
|
80
80
|
$colIndex: colIndex,
|
|
81
81
|
$divider: divider,
|
|
82
|
+
$isNumeric: col.numeric,
|
|
82
83
|
$size: size
|
|
83
84
|
}, tableHeadCellProps, colTableHeadCellProps), col.header);
|
|
84
85
|
}
|
|
@@ -117,6 +118,7 @@ export default class TableBuilder extends React.Component {
|
|
|
117
118
|
$col: col,
|
|
118
119
|
$colIndex: colIndex,
|
|
119
120
|
$divider: divider,
|
|
121
|
+
$isNumeric: col.numeric,
|
|
120
122
|
role: "button",
|
|
121
123
|
tabIndex: "0",
|
|
122
124
|
"aria-label": `${col.tableHeadAriaLabel || col.header}, ${sortLabel}`,
|
|
@@ -143,6 +145,7 @@ export default class TableBuilder extends React.Component {
|
|
|
143
145
|
$rowIndex: rowIndex,
|
|
144
146
|
$isNumeric: col.numeric,
|
|
145
147
|
$isLastRow: rowIndex === lastRowindex,
|
|
148
|
+
$isSortable: col.sortable,
|
|
146
149
|
$size: size
|
|
147
150
|
}, tableBodyCellProps, colTableBodyCellProps), col.children(row, rowIndex));
|
|
148
151
|
}
|
|
@@ -21,6 +21,10 @@ import { getEndPosition } from '../popover/utils.js';
|
|
|
21
21
|
*/
|
|
22
22
|
export const Body = styled('div', props => ({ ...getBodyStyles(props),
|
|
23
23
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
24
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
25
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
26
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
27
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
24
28
|
boxShadow: props.$theme.lighting.shadow400,
|
|
25
29
|
color: props.$theme.colors.tooltipText,
|
|
26
30
|
// Reset transition property to opacity only, and static transform
|
|
@@ -30,6 +34,10 @@ export const Body = styled('div', props => ({ ...getBodyStyles(props),
|
|
|
30
34
|
Body.displayName = "Body";
|
|
31
35
|
export const Inner = styled('div', props => ({ ...getInnerStyles(props),
|
|
32
36
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
37
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
38
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
39
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
40
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
33
41
|
paddingTop: props.$theme.sizing.scale300,
|
|
34
42
|
paddingBottom: props.$theme.sizing.scale300,
|
|
35
43
|
paddingLeft: props.$theme.sizing.scale600,
|
package/esm/dnd-list/index.js
CHANGED
|
@@ -4,7 +4,8 @@ Copyright (c) Uber Technologies, Inc.
|
|
|
4
4
|
This source code is licensed under the MIT license found in the
|
|
5
5
|
LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
import { arrayMove, arrayRemove } from 'react-movable';
|
|
8
|
+
export { arrayMove, arrayRemove };
|
|
8
9
|
export { default as StatefulList } from './stateful-list.js';
|
|
9
10
|
export { default as StatefulListContainer } from './stateful-list-container.js';
|
|
10
11
|
export { default as List } from './list.js'; // Constants
|
|
@@ -159,7 +159,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
159
159
|
isPseudoFocused: false
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
162
|
+
_defineProperty(_assertThisInitialized(_this), "isItMounted", false);
|
|
163
163
|
|
|
164
164
|
_defineProperty(_assertThisInitialized(_this), "handleTouchOutside", function (event) {
|
|
165
165
|
if (containsNode(_this.dropdown.current, event.target)) return;
|
|
@@ -307,7 +307,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
307
307
|
_this.props.onBlur(event);
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
if (_this.
|
|
310
|
+
if (_this.isItMounted) {
|
|
311
311
|
_this.setState({
|
|
312
312
|
isFocused: false,
|
|
313
313
|
isOpen: false,
|
|
@@ -661,7 +661,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
661
661
|
this.focus();
|
|
662
662
|
}
|
|
663
663
|
|
|
664
|
-
this.
|
|
664
|
+
this.isItMounted = true;
|
|
665
665
|
|
|
666
666
|
if (this.props.methodsRef) {
|
|
667
667
|
var methodsRef = this.props.methodsRef;
|
|
@@ -697,7 +697,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
697
697
|
document.removeEventListener('click', this.handleClickOutside);
|
|
698
698
|
}
|
|
699
699
|
|
|
700
|
-
this.
|
|
700
|
+
this.isItMounted = false;
|
|
701
701
|
}
|
|
702
702
|
}, {
|
|
703
703
|
key: "focus",
|
|
@@ -70,7 +70,8 @@ export var StyledTableHeadCell = styled('th', function (_ref5) {
|
|
|
70
70
|
|
|
71
71
|
var $theme = _ref5.$theme,
|
|
72
72
|
$size = _ref5.$size,
|
|
73
|
-
$divider = _ref5.$divider
|
|
73
|
+
$divider = _ref5.$divider,
|
|
74
|
+
$isNumeric = _ref5.$isNumeric;
|
|
74
75
|
var borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
75
76
|
var borderVertical = $divider === DIVIDER.grid || $divider === DIVIDER.vertical;
|
|
76
77
|
var padding = sizeToCellPadding($theme, $size);
|
|
@@ -83,7 +84,7 @@ export var StyledTableHeadCell = styled('th', function (_ref5) {
|
|
|
83
84
|
paddingLeft: padding,
|
|
84
85
|
backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
|
85
86
|
color: $theme.colors.contentPrimary,
|
|
86
|
-
textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
|
87
|
+
textAlign: $theme.direction === 'rtl' || $isNumeric ? 'right' : 'left',
|
|
87
88
|
verticalAlign: 'top',
|
|
88
89
|
whiteSpace: 'nowrap',
|
|
89
90
|
zIndex: 1
|
|
@@ -164,14 +165,15 @@ export var StyledTableBodyCell = styled('td', function (_ref12) {
|
|
|
164
165
|
$size = _ref12.$size,
|
|
165
166
|
$divider = _ref12.$divider,
|
|
166
167
|
$isNumeric = _ref12.$isNumeric,
|
|
167
|
-
$isLastRow = _ref12.$isLastRow
|
|
168
|
+
$isLastRow = _ref12.$isLastRow,
|
|
169
|
+
$isSortable = _ref12.$isSortable;
|
|
168
170
|
var borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
169
171
|
var borderVertical = $divider === DIVIDER.vertical || $divider === DIVIDER.grid;
|
|
170
172
|
var borderHorizontal = $divider === undefined || $divider === DIVIDER.horizontal || $divider === DIVIDER.grid;
|
|
171
173
|
var padding = sizeToCellPadding($theme, $size);
|
|
172
174
|
return _objectSpread(_objectSpread({}, $theme.typography.font200), {}, {
|
|
173
175
|
paddingTop: padding,
|
|
174
|
-
paddingRight: padding,
|
|
176
|
+
paddingRight: !$isSortable ? padding : $theme.sizing.scale1000,
|
|
175
177
|
paddingBottom: padding,
|
|
176
178
|
paddingLeft: padding,
|
|
177
179
|
color: $theme.colors.contentPrimary,
|
|
@@ -200,6 +200,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
200
200
|
$col: col,
|
|
201
201
|
$colIndex: colIndex,
|
|
202
202
|
$divider: divider,
|
|
203
|
+
$isNumeric: col.numeric,
|
|
203
204
|
$size: size
|
|
204
205
|
}, tableHeadCellProps, colTableHeadCellProps), col.header);
|
|
205
206
|
}
|
|
@@ -242,6 +243,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
242
243
|
$col: col,
|
|
243
244
|
$colIndex: colIndex,
|
|
244
245
|
$divider: divider,
|
|
246
|
+
$isNumeric: col.numeric,
|
|
245
247
|
role: "button",
|
|
246
248
|
tabIndex: "0",
|
|
247
249
|
"aria-label": "".concat(col.tableHeadAriaLabel || col.header, ", ").concat(sortLabel),
|
|
@@ -275,6 +277,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
275
277
|
$rowIndex: rowIndex,
|
|
276
278
|
$isNumeric: col.numeric,
|
|
277
279
|
$isLastRow: rowIndex === lastRowindex,
|
|
280
|
+
$isSortable: col.sortable,
|
|
278
281
|
$size: size
|
|
279
282
|
}, tableBodyCellProps, colTableBodyCellProps), col.children(row, rowIndex));
|
|
280
283
|
}
|
|
@@ -28,6 +28,10 @@ import { getEndPosition } from '../popover/utils.js';
|
|
|
28
28
|
export var Body = styled('div', function (props) {
|
|
29
29
|
return _objectSpread(_objectSpread({}, getBodyStyles(props)), {}, {
|
|
30
30
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
31
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
32
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
33
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
34
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
31
35
|
boxShadow: props.$theme.lighting.shadow400,
|
|
32
36
|
color: props.$theme.colors.tooltipText,
|
|
33
37
|
// Reset transition property to opacity only, and static transform
|
|
@@ -39,6 +43,10 @@ Body.displayName = "Body";
|
|
|
39
43
|
export var Inner = styled('div', function (props) {
|
|
40
44
|
return _objectSpread(_objectSpread(_objectSpread({}, getInnerStyles(props)), {}, {
|
|
41
45
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
46
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
47
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
48
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
49
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
42
50
|
paddingTop: props.$theme.sizing.scale300,
|
|
43
51
|
paddingBottom: props.$theme.sizing.scale300,
|
|
44
52
|
paddingLeft: props.$theme.sizing.scale600,
|
package/menu/index.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export interface OptionListProps extends BaseMenuPropsT {
|
|
|
123
123
|
item: any;
|
|
124
124
|
getItemLabel: (item: any) => React.ReactNode;
|
|
125
125
|
getChildMenu?: (item: any) => React.ReactNode;
|
|
126
|
+
onMouseDown?: (event: MouseEvent) => any;
|
|
126
127
|
onMouseEnter?: (event: MouseEvent) => any;
|
|
127
128
|
size?: OPTION_LIST_SIZE[keyof OPTION_LIST_SIZE];
|
|
128
129
|
overrides?: {
|
package/menu/types.js.flow
CHANGED
|
@@ -234,6 +234,8 @@ export type OptionListPropsT = {
|
|
|
234
234
|
getChildMenu?: (item: ItemT) => React.Node,
|
|
235
235
|
onClick?: (event: MouseEvent) => mixed,
|
|
236
236
|
/** Callback used to change highlighted index in stateful menu. */
|
|
237
|
+
onMouseDown?: (event: MouseEvent) => mixed,
|
|
238
|
+
/** Callback used to change highlighted index in stateful menu. */
|
|
237
239
|
onMouseEnter?: (event: MouseEvent) => mixed,
|
|
238
240
|
/** Renders UI in defined scale. */
|
|
239
241
|
size?: $Keys<typeof OPTION_LIST_SIZE>,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baseui",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-efef314",
|
|
4
4
|
"description": "A React Component library implementing the Base design language",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@commitlint/config-conventional": "^8.0.0",
|
|
82
82
|
"@date-io/luxon": "^2.7.0",
|
|
83
83
|
"@date-io/moment": "^2.7.0",
|
|
84
|
-
"@ladle/react": "^0.
|
|
84
|
+
"@ladle/react": "^0.3.0",
|
|
85
85
|
"@mdx-js/tag": "^0.20.0",
|
|
86
86
|
"@octokit/rest": "^16.33.1",
|
|
87
87
|
"@svgr/cli": "^4.3.2",
|
|
@@ -180,7 +180,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
180
180
|
isPseudoFocused: false
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
183
|
+
_defineProperty(_assertThisInitialized(_this), "isItMounted", false);
|
|
184
184
|
|
|
185
185
|
_defineProperty(_assertThisInitialized(_this), "handleTouchOutside", function (event) {
|
|
186
186
|
if (containsNode(_this.dropdown.current, event.target)) return;
|
|
@@ -328,7 +328,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
328
328
|
_this.props.onBlur(event);
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
if (_this.
|
|
331
|
+
if (_this.isItMounted) {
|
|
332
332
|
_this.setState({
|
|
333
333
|
isFocused: false,
|
|
334
334
|
isOpen: false,
|
|
@@ -682,7 +682,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
682
682
|
this.focus();
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
this.
|
|
685
|
+
this.isItMounted = true;
|
|
686
686
|
|
|
687
687
|
if (this.props.methodsRef) {
|
|
688
688
|
var methodsRef = this.props.methodsRef;
|
|
@@ -718,7 +718,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
718
718
|
document.removeEventListener('click', this.handleClickOutside);
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
this.
|
|
721
|
+
this.isItMounted = false;
|
|
722
722
|
}
|
|
723
723
|
}, {
|
|
724
724
|
key: "focus",
|
|
@@ -117,13 +117,13 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
117
117
|
isPseudoFocused: false,
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
isItMounted: boolean = false;
|
|
121
121
|
|
|
122
122
|
componentDidMount() {
|
|
123
123
|
if (this.props.autoFocus) {
|
|
124
124
|
this.focus();
|
|
125
125
|
}
|
|
126
|
-
this.
|
|
126
|
+
this.isItMounted = true;
|
|
127
127
|
|
|
128
128
|
if (this.props.methodsRef) {
|
|
129
129
|
const {methodsRef} = this.props;
|
|
@@ -157,7 +157,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
157
157
|
document.removeEventListener('touchstart', this.handleTouchOutside);
|
|
158
158
|
document.removeEventListener('click', this.handleClickOutside);
|
|
159
159
|
}
|
|
160
|
-
this.
|
|
160
|
+
this.isItMounted = false;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
focus() {
|
|
@@ -319,7 +319,7 @@ class Select extends React.Component<PropsT, SelectStateT> {
|
|
|
319
319
|
this.props.onBlur(event);
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
if (this.
|
|
322
|
+
if (this.isItMounted) {
|
|
323
323
|
this.setState({
|
|
324
324
|
isFocused: false,
|
|
325
325
|
isOpen: false,
|
|
@@ -81,7 +81,8 @@ var StyledTableHeadCell = (0, _index.styled)('th', function (_ref5) {
|
|
|
81
81
|
|
|
82
82
|
var $theme = _ref5.$theme,
|
|
83
83
|
$size = _ref5.$size,
|
|
84
|
-
$divider = _ref5.$divider
|
|
84
|
+
$divider = _ref5.$divider,
|
|
85
|
+
$isNumeric = _ref5.$isNumeric;
|
|
85
86
|
var borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
86
87
|
var borderVertical = $divider === _constants.DIVIDER.grid || $divider === _constants.DIVIDER.vertical;
|
|
87
88
|
var padding = sizeToCellPadding($theme, $size);
|
|
@@ -94,7 +95,7 @@ var StyledTableHeadCell = (0, _index.styled)('th', function (_ref5) {
|
|
|
94
95
|
paddingLeft: padding,
|
|
95
96
|
backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
|
96
97
|
color: $theme.colors.contentPrimary,
|
|
97
|
-
textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
|
98
|
+
textAlign: $theme.direction === 'rtl' || $isNumeric ? 'right' : 'left',
|
|
98
99
|
verticalAlign: 'top',
|
|
99
100
|
whiteSpace: 'nowrap',
|
|
100
101
|
zIndex: 1
|
|
@@ -182,14 +183,15 @@ var StyledTableBodyCell = (0, _index.styled)('td', function (_ref12) {
|
|
|
182
183
|
$size = _ref12.$size,
|
|
183
184
|
$divider = _ref12.$divider,
|
|
184
185
|
$isNumeric = _ref12.$isNumeric,
|
|
185
|
-
$isLastRow = _ref12.$isLastRow
|
|
186
|
+
$isLastRow = _ref12.$isLastRow,
|
|
187
|
+
$isSortable = _ref12.$isSortable;
|
|
186
188
|
var borderDir = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
187
189
|
var borderVertical = $divider === _constants.DIVIDER.vertical || $divider === _constants.DIVIDER.grid;
|
|
188
190
|
var borderHorizontal = $divider === undefined || $divider === _constants.DIVIDER.horizontal || $divider === _constants.DIVIDER.grid;
|
|
189
191
|
var padding = sizeToCellPadding($theme, $size);
|
|
190
192
|
return _objectSpread(_objectSpread({}, $theme.typography.font200), {}, {
|
|
191
193
|
paddingTop: padding,
|
|
192
|
-
paddingRight: padding,
|
|
194
|
+
paddingRight: !$isSortable ? padding : $theme.sizing.scale1000,
|
|
193
195
|
paddingBottom: padding,
|
|
194
196
|
paddingLeft: padding,
|
|
195
197
|
color: $theme.colors.contentPrimary,
|
|
@@ -78,12 +78,13 @@ type StyledTableHeadCellPropsT = {
|
|
|
78
78
|
$col?: {},
|
|
79
79
|
$colIndex?: ?number,
|
|
80
80
|
$divider?: DividerT,
|
|
81
|
+
$isNumeric?: ?boolean,
|
|
81
82
|
$size?: SizeT,
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
export const StyledTableHeadCell = styled<StyledTableHeadCellPropsT>(
|
|
85
86
|
'th',
|
|
86
|
-
({$theme, $size, $divider}) => {
|
|
87
|
+
({$theme, $size, $divider, $isNumeric}) => {
|
|
87
88
|
const borderDir: string = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
88
89
|
const borderVertical =
|
|
89
90
|
$divider === DIVIDER.grid || $divider === DIVIDER.vertical;
|
|
@@ -99,7 +100,7 @@ export const StyledTableHeadCell = styled<StyledTableHeadCellPropsT>(
|
|
|
99
100
|
paddingLeft: padding,
|
|
100
101
|
backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
|
101
102
|
color: $theme.colors.contentPrimary,
|
|
102
|
-
textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
|
103
|
+
textAlign: $theme.direction === 'rtl' || $isNumeric ? 'right' : 'left',
|
|
103
104
|
verticalAlign: 'top',
|
|
104
105
|
whiteSpace: 'nowrap',
|
|
105
106
|
zIndex: 1,
|
|
@@ -215,11 +216,12 @@ type StyledTableBodyCellPropsT = {
|
|
|
215
216
|
$size?: SizeT,
|
|
216
217
|
$isNumeric?: ?boolean,
|
|
217
218
|
$isLastRow?: ?boolean,
|
|
219
|
+
$isSortable?: ?boolean,
|
|
218
220
|
};
|
|
219
221
|
|
|
220
222
|
export const StyledTableBodyCell = styled<StyledTableBodyCellPropsT>(
|
|
221
223
|
'td',
|
|
222
|
-
({$theme, $size, $divider, $isNumeric, $isLastRow}) => {
|
|
224
|
+
({$theme, $size, $divider, $isNumeric, $isLastRow, $isSortable}) => {
|
|
223
225
|
const borderDir: string = $theme.direction === 'rtl' ? 'Left' : 'Right';
|
|
224
226
|
const borderVertical =
|
|
225
227
|
$divider === DIVIDER.vertical || $divider === DIVIDER.grid;
|
|
@@ -232,7 +234,7 @@ export const StyledTableBodyCell = styled<StyledTableBodyCellPropsT>(
|
|
|
232
234
|
return {
|
|
233
235
|
...$theme.typography.font200,
|
|
234
236
|
paddingTop: padding,
|
|
235
|
-
paddingRight: padding,
|
|
237
|
+
paddingRight: !$isSortable ? padding : $theme.sizing.scale1000,
|
|
236
238
|
paddingBottom: padding,
|
|
237
239
|
paddingLeft: padding,
|
|
238
240
|
color: $theme.colors.contentPrimary,
|
|
@@ -208,6 +208,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
208
208
|
$col: col,
|
|
209
209
|
$colIndex: colIndex,
|
|
210
210
|
$divider: divider,
|
|
211
|
+
$isNumeric: col.numeric,
|
|
211
212
|
$size: size
|
|
212
213
|
}, tableHeadCellProps, colTableHeadCellProps), col.header);
|
|
213
214
|
}
|
|
@@ -250,6 +251,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
250
251
|
$col: col,
|
|
251
252
|
$colIndex: colIndex,
|
|
252
253
|
$divider: divider,
|
|
254
|
+
$isNumeric: col.numeric,
|
|
253
255
|
role: "button",
|
|
254
256
|
tabIndex: "0",
|
|
255
257
|
"aria-label": "".concat(col.tableHeadAriaLabel || col.header, ", ").concat(sortLabel),
|
|
@@ -283,6 +285,7 @@ var TableBuilder = /*#__PURE__*/function (_React$Component) {
|
|
|
283
285
|
$rowIndex: rowIndex,
|
|
284
286
|
$isNumeric: col.numeric,
|
|
285
287
|
$isLastRow: rowIndex === lastRowindex,
|
|
288
|
+
$isSortable: col.sortable,
|
|
286
289
|
$size: size
|
|
287
290
|
}, tableBodyCellProps, colTableBodyCellProps), col.children(row, rowIndex));
|
|
288
291
|
}
|
|
@@ -153,6 +153,7 @@ export default class TableBuilder<T> extends React.Component<
|
|
|
153
153
|
$col={col}
|
|
154
154
|
$colIndex={colIndex}
|
|
155
155
|
$divider={divider}
|
|
156
|
+
$isNumeric={col.numeric}
|
|
156
157
|
$size={size}
|
|
157
158
|
{...tableHeadCellProps}
|
|
158
159
|
{...colTableHeadCellProps}
|
|
@@ -211,6 +212,7 @@ export default class TableBuilder<T> extends React.Component<
|
|
|
211
212
|
$col={col}
|
|
212
213
|
$colIndex={colIndex}
|
|
213
214
|
$divider={divider}
|
|
215
|
+
$isNumeric={col.numeric}
|
|
214
216
|
role="button"
|
|
215
217
|
tabIndex="0"
|
|
216
218
|
aria-label={`${col.tableHeadAriaLabel || col.header}, ${sortLabel}`}
|
|
@@ -249,6 +251,7 @@ export default class TableBuilder<T> extends React.Component<
|
|
|
249
251
|
$rowIndex={rowIndex}
|
|
250
252
|
$isNumeric={col.numeric}
|
|
251
253
|
$isLastRow={rowIndex === lastRowindex}
|
|
254
|
+
$isSortable={col.sortable}
|
|
252
255
|
$size={size}
|
|
253
256
|
{...tableBodyCellProps}
|
|
254
257
|
{...colTableBodyCellProps}
|
|
@@ -31,6 +31,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
31
31
|
var Body = (0, _index.styled)('div', function (props) {
|
|
32
32
|
return _objectSpread(_objectSpread({}, (0, _styledComponents.getBodyStyles)(props)), {}, {
|
|
33
33
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
34
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
35
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
36
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
37
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
34
38
|
boxShadow: props.$theme.lighting.shadow400,
|
|
35
39
|
color: props.$theme.colors.tooltipText,
|
|
36
40
|
// Reset transition property to opacity only, and static transform
|
|
@@ -43,6 +47,10 @@ Body.displayName = "Body";
|
|
|
43
47
|
var Inner = (0, _index.styled)('div', function (props) {
|
|
44
48
|
return _objectSpread(_objectSpread(_objectSpread({}, (0, _styledComponents.getInnerStyles)(props)), {}, {
|
|
45
49
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
50
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
51
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
52
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
53
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
46
54
|
paddingTop: props.$theme.sizing.scale300,
|
|
47
55
|
paddingBottom: props.$theme.sizing.scale300,
|
|
48
56
|
paddingLeft: props.$theme.sizing.scale600,
|
|
@@ -28,6 +28,10 @@ import type {SharedStylePropsArgT} from '../popover/types.js';
|
|
|
28
28
|
export const Body = styled<SharedStylePropsArgT>('div', props => ({
|
|
29
29
|
...getBodyStyles(props),
|
|
30
30
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
31
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
32
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
33
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
34
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
31
35
|
boxShadow: props.$theme.lighting.shadow400,
|
|
32
36
|
color: props.$theme.colors.tooltipText,
|
|
33
37
|
// Reset transition property to opacity only, and static transform
|
|
@@ -38,6 +42,10 @@ export const Body = styled<SharedStylePropsArgT>('div', props => ({
|
|
|
38
42
|
export const Inner = styled<SharedStylePropsArgT>('div', props => ({
|
|
39
43
|
...getInnerStyles(props),
|
|
40
44
|
backgroundColor: props.$theme.colors.tooltipBackground,
|
|
45
|
+
borderTopLeftRadius: props.$theme.borders.radius300,
|
|
46
|
+
borderTopRightRadius: props.$theme.borders.radius300,
|
|
47
|
+
borderBottomRightRadius: props.$theme.borders.radius300,
|
|
48
|
+
borderBottomLeftRadius: props.$theme.borders.radius300,
|
|
41
49
|
paddingTop: props.$theme.sizing.scale300,
|
|
42
50
|
paddingBottom: props.$theme.sizing.scale300,
|
|
43
51
|
paddingLeft: props.$theme.sizing.scale600,
|