@atlaskit/dynamic-table 14.2.3 → 14.4.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/CHANGELOG.md +39 -0
- package/dist/cjs/components/Body.js +2 -2
- package/dist/cjs/components/LoadingContainer.js +1 -1
- package/dist/cjs/components/LoadingContainerAdvanced.js +4 -4
- package/dist/cjs/components/Stateful.js +5 -3
- package/dist/cjs/components/Stateless.js +6 -4
- package/dist/cjs/components/TableHead.js +1 -1
- package/dist/cjs/components/TableHeadCell.js +18 -48
- package/dist/cjs/components/TableRow.js +4 -1
- package/dist/cjs/components/managedPagination.js +1 -1
- package/dist/cjs/components/rankable/Body.js +2 -2
- package/dist/cjs/components/rankable/TableCell.js +5 -5
- package/dist/cjs/components/rankable/TableHeadCell.js +3 -5
- package/dist/cjs/components/rankable/TableRow.js +5 -5
- package/dist/cjs/hoc/withDimensions.js +3 -5
- package/dist/cjs/hoc/withSortedPageRows.js +4 -6
- package/dist/cjs/styled/DynamicTable.js +80 -50
- package/dist/cjs/styled/EmptyBody.js +23 -28
- package/dist/cjs/styled/LoadingContainer.js +41 -36
- package/dist/cjs/styled/LoadingContainerAdvanced.js +42 -36
- package/dist/cjs/styled/TableCell.js +21 -15
- package/dist/cjs/styled/TableHead.js +157 -45
- package/dist/cjs/styled/TableRow.js +36 -42
- package/dist/cjs/styled/constants.js +33 -118
- package/dist/cjs/styled/rankable/RowPlaceholder.js +11 -12
- package/dist/cjs/styled/rankable/TableCell.js +18 -27
- package/dist/cjs/styled/rankable/TableRow.js +32 -54
- package/dist/cjs/theme.js +33 -20
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Body.js +1 -1
- package/dist/es2019/components/LoadingContainerAdvanced.js +2 -4
- package/dist/es2019/components/Stateful.js +4 -2
- package/dist/es2019/components/Stateless.js +5 -3
- package/dist/es2019/components/TableHeadCell.js +18 -22
- package/dist/es2019/components/TableRow.js +4 -1
- package/dist/es2019/components/rankable/Body.js +1 -1
- package/dist/es2019/components/rankable/TableCell.js +4 -4
- package/dist/es2019/components/rankable/TableHeadCell.js +1 -3
- package/dist/es2019/components/rankable/TableRow.js +3 -3
- package/dist/es2019/hoc/withDimensions.js +2 -4
- package/dist/es2019/hoc/withSortedPageRows.js +2 -4
- package/dist/es2019/styled/DynamicTable.js +75 -27
- package/dist/es2019/styled/EmptyBody.js +21 -11
- package/dist/es2019/styled/LoadingContainer.js +39 -18
- package/dist/es2019/styled/LoadingContainerAdvanced.js +38 -20
- package/dist/es2019/styled/TableCell.js +20 -5
- package/dist/es2019/styled/TableHead.js +160 -33
- package/dist/es2019/styled/TableRow.js +34 -20
- package/dist/es2019/styled/constants.js +30 -88
- package/dist/es2019/styled/rankable/RowPlaceholder.js +10 -4
- package/dist/es2019/styled/rankable/TableCell.js +16 -9
- package/dist/es2019/styled/rankable/TableRow.js +32 -24
- package/dist/es2019/theme.js +25 -18
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Body.js +2 -2
- package/dist/esm/components/LoadingContainer.js +1 -1
- package/dist/esm/components/LoadingContainerAdvanced.js +4 -4
- package/dist/esm/components/Stateful.js +5 -3
- package/dist/esm/components/Stateless.js +6 -4
- package/dist/esm/components/TableHead.js +1 -1
- package/dist/esm/components/TableHeadCell.js +19 -47
- package/dist/esm/components/TableRow.js +4 -1
- package/dist/esm/components/managedPagination.js +1 -1
- package/dist/esm/components/rankable/Body.js +2 -2
- package/dist/esm/components/rankable/TableCell.js +5 -5
- package/dist/esm/components/rankable/TableHeadCell.js +3 -5
- package/dist/esm/components/rankable/TableRow.js +5 -5
- package/dist/esm/hoc/withDimensions.js +3 -5
- package/dist/esm/hoc/withSortedPageRows.js +4 -6
- package/dist/esm/styled/DynamicTable.js +75 -46
- package/dist/esm/styled/EmptyBody.js +23 -26
- package/dist/esm/styled/LoadingContainer.js +40 -36
- package/dist/esm/styled/LoadingContainerAdvanced.js +41 -35
- package/dist/esm/styled/TableCell.js +21 -15
- package/dist/esm/styled/TableHead.js +152 -41
- package/dist/esm/styled/TableRow.js +38 -42
- package/dist/esm/styled/constants.js +28 -108
- package/dist/esm/styled/rankable/RowPlaceholder.js +12 -14
- package/dist/esm/styled/rankable/TableCell.js +18 -27
- package/dist/esm/styled/rankable/TableRow.js +33 -54
- package/dist/esm/theme.js +25 -18
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Body.d.ts +22 -22
- package/dist/types/components/LoadingContainerAdvanced.d.ts +2 -2
- package/dist/types/components/Stateless.d.ts +3 -3
- package/dist/types/components/TableHeadCell.d.ts +4 -9
- package/dist/types/components/rankable/Body.d.ts +22 -22
- package/dist/types/components/rankable/TableHeadCell.d.ts +1 -1
- package/dist/types/components/rankable/TableRow.d.ts +3 -3
- package/dist/types/hoc/withDimensions.d.ts +2 -2
- package/dist/types/hoc/withSortedPageRows.d.ts +20 -20
- package/dist/types/styled/DynamicTable.d.ts +13 -6
- package/dist/types/styled/EmptyBody.d.ts +4 -3
- package/dist/types/styled/LoadingContainer.d.ts +8 -7
- package/dist/types/styled/LoadingContainerAdvanced.d.ts +5 -4
- package/dist/types/styled/TableCell.d.ts +3 -2
- package/dist/types/styled/TableHead.d.ts +8 -5
- package/dist/types/styled/TableRow.d.ts +7 -4
- package/dist/types/styled/constants.d.ts +13 -10
- package/dist/types/styled/rankable/RowPlaceholder.d.ts +3 -2
- package/dist/types/styled/rankable/TableCell.d.ts +8 -6
- package/dist/types/styled/rankable/TableRow.d.ts +9 -6
- package/dist/types/theme.d.ts +15 -9
- package/dist/types/types.d.ts +18 -6
- package/package.json +15 -9
|
@@ -1,51 +1,162 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
4
|
|
|
3
|
-
function
|
|
4
|
-
var data = _taggedTemplateLiteral(["\n ", "\n ", " \n ", " \n ", " \n border: none;\n color: ", ";\n box-sizing: border-box;\n font-size: 12px;\n font-weight: 600;\n position: relative;\n text-align: left;\n vertical-align: top;\n &:focus {\n outline: solid 2px ", ";\n }\n"]);
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
return data;
|
|
8
|
-
};
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { forwardRef } from 'react';
|
|
11
|
+
import { css, jsx } from '@emotion/core';
|
|
12
|
+
import { B100, N30A } from '@atlaskit/theme/colors';
|
|
13
|
+
import { useGlobalTheme } from '@atlaskit/theme/components';
|
|
14
|
+
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
15
|
+
import { token } from '@atlaskit/tokens';
|
|
16
|
+
import { ASC, DESC } from '../internal/constants';
|
|
17
|
+
import { arrow, head, MSThemeColors } from '../theme';
|
|
18
|
+
import { cellStyles, fixedSizeTruncateStyles, getTruncationStyleVars, overflowTruncateStyles, truncationWidthStyles } from './constants';
|
|
19
|
+
var gridSize = getGridSize();
|
|
20
|
+
var CSS_VAR_TEXT_COLOR = '--local-dynamic-table-text-color';
|
|
21
|
+
var rankingStyles = css({
|
|
22
|
+
display: 'block'
|
|
23
|
+
});
|
|
12
24
|
|
|
13
|
-
function
|
|
14
|
-
|
|
25
|
+
var getHeadStyles = function getHeadStyles(theme) {
|
|
26
|
+
return css({
|
|
27
|
+
borderBottom: "2px solid ".concat(token('color.border.neutral', head.borderColor({
|
|
28
|
+
theme: theme
|
|
29
|
+
})))
|
|
30
|
+
});
|
|
31
|
+
};
|
|
15
32
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
33
|
+
export var Head = function Head(_ref) {
|
|
34
|
+
var isRanking = _ref.isRanking,
|
|
35
|
+
props = _objectWithoutProperties(_ref, ["isRanking"]);
|
|
19
36
|
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
var theme = useGlobalTheme();
|
|
38
|
+
return jsx("thead", _extends({
|
|
39
|
+
css: [getHeadStyles(theme), isRanking && rankingStyles]
|
|
40
|
+
}, props));
|
|
41
|
+
};
|
|
42
|
+
var headCellStyles = css([cellStyles, {
|
|
43
|
+
border: 'none',
|
|
44
|
+
boxSizing: 'border-box',
|
|
45
|
+
fontSize: '12px',
|
|
46
|
+
fontWeight: 600,
|
|
47
|
+
position: 'relative',
|
|
48
|
+
textAlign: 'left',
|
|
49
|
+
verticalAlign: 'top',
|
|
50
|
+
color: token('color.text.lowEmphasis', "var(".concat(CSS_VAR_TEXT_COLOR, ")")),
|
|
51
|
+
'&:focus': {
|
|
52
|
+
outline: "solid 2px ".concat(token('color.border.focus', B100))
|
|
53
|
+
}
|
|
54
|
+
}]); // this needs to be made static: https://product-fabric.atlassian.net/browse/DSP-2011
|
|
22
55
|
|
|
23
|
-
function
|
|
24
|
-
|
|
56
|
+
export var getArrowStyles = function getArrowStyles(isSortable, sortOrder, theme) {
|
|
57
|
+
if (!isSortable) {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
25
60
|
|
|
26
|
-
|
|
27
|
-
|
|
61
|
+
var pseudoBaseStyles = {
|
|
62
|
+
border: '3px solid transparent',
|
|
63
|
+
display: 'block',
|
|
64
|
+
height: 0,
|
|
65
|
+
right: "-".concat(gridSize, "px"),
|
|
66
|
+
width: 0,
|
|
67
|
+
'@media (forced-colors: active)': {
|
|
68
|
+
border: "3px solid ".concat(MSThemeColors.Background)
|
|
69
|
+
}
|
|
28
70
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
return css({
|
|
72
|
+
'& > span': {
|
|
73
|
+
position: 'relative',
|
|
74
|
+
'&::before': _objectSpread(_objectSpread({}, pseudoBaseStyles), {}, {
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
borderBottom: "3px solid ".concat(sortOrder === ASC ? arrow.selectedColor({
|
|
77
|
+
theme: theme
|
|
78
|
+
}) : arrow.defaultColor({
|
|
79
|
+
theme: theme
|
|
80
|
+
})),
|
|
81
|
+
bottom: '8px',
|
|
82
|
+
content: '""'
|
|
83
|
+
}),
|
|
84
|
+
'&::after': _objectSpread(_objectSpread({}, pseudoBaseStyles), {}, {
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
borderTop: "3px solid ".concat(sortOrder === DESC ? arrow.selectedColor({
|
|
87
|
+
theme: theme
|
|
88
|
+
}) : arrow.defaultColor({
|
|
89
|
+
theme: theme
|
|
90
|
+
})),
|
|
91
|
+
bottom: 0,
|
|
92
|
+
content: '""'
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
'&:hover > span': {
|
|
96
|
+
'&::before': {
|
|
97
|
+
borderBottom: "3px solid\n ".concat(sortOrder === ASC ? arrow.selectedColor({
|
|
98
|
+
theme: theme
|
|
99
|
+
}) : arrow.hoverColor({
|
|
100
|
+
theme: theme
|
|
101
|
+
}))
|
|
102
|
+
},
|
|
103
|
+
'&::after': {
|
|
104
|
+
borderTop: "3px solid\n ".concat(sortOrder === DESC ? arrow.selectedColor({
|
|
105
|
+
theme: theme
|
|
106
|
+
}) : arrow.hoverColor({
|
|
107
|
+
theme: theme
|
|
108
|
+
}))
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
'@media (forced-colors: active)': {
|
|
112
|
+
'& > span': {
|
|
113
|
+
'&::before': {
|
|
114
|
+
borderBottom: "3px solid\n ".concat(sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
|
|
115
|
+
},
|
|
116
|
+
'&::after': {
|
|
117
|
+
borderTop: "3px solid\n ".concat(sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
'&:hover > span': {
|
|
121
|
+
'&::before': {
|
|
122
|
+
borderBottom: "3px solid\n ".concat(sortOrder === ASC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
|
|
123
|
+
},
|
|
124
|
+
'&::after': {
|
|
125
|
+
borderTop: "3px solid\n ".concat(sortOrder === DESC ? MSThemeColors.SelectedBackground : MSThemeColors.Text)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
46
129
|
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
130
|
+
};
|
|
131
|
+
var onClickStyles = css({
|
|
132
|
+
'&:hover': {
|
|
133
|
+
cursor: 'pointer',
|
|
134
|
+
backgroundColor: token('color.background.subtleNeutral.hover', N30A)
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
export var HeadCell = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
138
|
+
var width = _ref2.width,
|
|
139
|
+
children = _ref2.children,
|
|
140
|
+
isSortable = _ref2.isSortable,
|
|
141
|
+
sortOrder = _ref2.sortOrder,
|
|
142
|
+
isFixedSize = _ref2.isFixedSize,
|
|
143
|
+
shouldTruncate = _ref2.shouldTruncate,
|
|
144
|
+
onClick = _ref2.onClick,
|
|
145
|
+
style = _ref2.style,
|
|
146
|
+
rest = _objectWithoutProperties(_ref2, ["width", "children", "isSortable", "sortOrder", "isFixedSize", "shouldTruncate", "onClick", "style"]);
|
|
147
|
+
|
|
148
|
+
var theme = useGlobalTheme();
|
|
149
|
+
|
|
150
|
+
var mergedStyles = _objectSpread(_objectSpread(_objectSpread({}, style), width && getTruncationStyleVars({
|
|
151
|
+
width: width
|
|
152
|
+
})), {}, _defineProperty({}, CSS_VAR_TEXT_COLOR, head.textColor({
|
|
153
|
+
theme: theme
|
|
154
|
+
})));
|
|
155
|
+
|
|
156
|
+
return jsx("th", _extends({
|
|
157
|
+
style: mergedStyles,
|
|
158
|
+
css: [headCellStyles, onClick && onClickStyles, truncationWidthStyles, isFixedSize && shouldTruncate && fixedSizeTruncateStyles, isFixedSize && overflowTruncateStyles, getArrowStyles(isSortable, sortOrder, theme)],
|
|
159
|
+
onClick: onClick,
|
|
160
|
+
ref: ref
|
|
161
|
+
}, rest), children);
|
|
162
|
+
});
|
|
@@ -1,42 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, function (_ref2) {
|
|
40
|
-
var isHighlighted = _ref2.isHighlighted;
|
|
41
|
-
return css(_templateObject3(), isHighlighted ? row.hoverHighlightedBackground : row.hoverBackground);
|
|
42
|
-
}, outlineWidth, row.focusOutline, outlineWidth);
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { css, jsx } from '@emotion/core';
|
|
7
|
+
import { token } from '@atlaskit/tokens';
|
|
8
|
+
import { tableRowCSSVars as cssVars } from './DynamicTable';
|
|
9
|
+
var rowStyles = css({
|
|
10
|
+
'&:focus': {
|
|
11
|
+
outline: "2px solid ".concat(token('color.border.focus', "var(".concat(cssVars.CSS_VAR_HOVER_BACKGROUND, ")"))),
|
|
12
|
+
outlineOffset: "-2px"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var rowBackgroundStyles = css({
|
|
16
|
+
'&:hover': {
|
|
17
|
+
backgroundColor: token('color.background.transparentNeutral.hover', "var(".concat(cssVars.CSS_VAR_HOVER_BACKGROUND, ")"))
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
var rowHighlightedBackgroundStyles = css({
|
|
21
|
+
backgroundColor: token('color.background.selected.resting', "var(".concat(cssVars.CSS_VAR_HIGHLIGHTED_BACKGROUND, ")")),
|
|
22
|
+
'&:hover': {
|
|
23
|
+
backgroundColor: token('color.background.selected.hover', "var(".concat(cssVars.CSS_VAR_HOVER_HIGHLIGHTED_BACKGROUND, ")"))
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export var TableBodyRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
27
|
+
var isHighlighted = _ref.isHighlighted,
|
|
28
|
+
children = _ref.children,
|
|
29
|
+
style = _ref.style,
|
|
30
|
+
rest = _objectWithoutProperties(_ref, ["isHighlighted", "children", "style"]);
|
|
31
|
+
|
|
32
|
+
return jsx("tr", _extends({
|
|
33
|
+
style: style,
|
|
34
|
+
css: [rowStyles, isHighlighted ? rowHighlightedBackgroundStyles : rowBackgroundStyles]
|
|
35
|
+
}, rest, {
|
|
36
|
+
ref: ref
|
|
37
|
+
}), children);
|
|
38
|
+
});
|
|
@@ -1,110 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function _templateObject6() {
|
|
24
|
-
var data = _taggedTemplateLiteral(["\n border: 3px solid transparent;\n display: block;\n height: 0;\n position: absolute;\n right: -", "px;\n width: 0;\n "]);
|
|
25
|
-
|
|
26
|
-
_templateObject6 = function _templateObject6() {
|
|
27
|
-
return data;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _templateObject5() {
|
|
34
|
-
var data = _taggedTemplateLiteral(["\n &:hover {\n cursor: pointer;\n background-color: ", ";\n }\n "]);
|
|
35
|
-
|
|
36
|
-
_templateObject5 = function _templateObject5() {
|
|
37
|
-
return data;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function _templateObject4() {
|
|
44
|
-
var data = _taggedTemplateLiteral(["\n text-overflow: ellipsis;\n white-space: nowrap;\n "]);
|
|
45
|
-
|
|
46
|
-
_templateObject4 = function _templateObject4() {
|
|
47
|
-
return data;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return data;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function _templateObject3() {
|
|
54
|
-
var data = _taggedTemplateLiteral(["\n overflow: hidden;\n "]);
|
|
55
|
-
|
|
56
|
-
_templateObject3 = function _templateObject3() {
|
|
57
|
-
return data;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return data;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function _templateObject2() {
|
|
64
|
-
var data = _taggedTemplateLiteral(["\n width: ", "%;\n "]);
|
|
65
|
-
|
|
66
|
-
_templateObject2 = function _templateObject2() {
|
|
67
|
-
return data;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
return data;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _templateObject() {
|
|
74
|
-
var data = _taggedTemplateLiteral(["\n ", " ", ";\n ", ";\n"]);
|
|
75
|
-
|
|
76
|
-
_templateObject = function _templateObject() {
|
|
77
|
-
return data;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return data;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
import { css } from 'styled-components';
|
|
84
|
-
import { N30A } from '@atlaskit/theme/colors';
|
|
85
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
86
|
-
import { divide } from '@atlaskit/theme/math';
|
|
87
|
-
import { ASC, DESC } from '../internal/constants';
|
|
88
|
-
import { arrow } from '../theme';
|
|
89
|
-
export var truncateStyle = function truncateStyle(_ref) {
|
|
90
|
-
var width = _ref.width,
|
|
91
|
-
isFixedSize = _ref.isFixedSize,
|
|
92
|
-
shouldTruncate = _ref.shouldTruncate;
|
|
93
|
-
return css(_templateObject(), width ? css(_templateObject2(), width) : '', isFixedSize ? css(_templateObject3()) : '', isFixedSize && shouldTruncate ? css(_templateObject4()) : '');
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { css } from '@emotion/core';
|
|
3
|
+
import { gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
4
|
+
var CSS_VAR_WIDTH = '--local-dynamic-table-width';
|
|
5
|
+
var gridSize = getGridSize();
|
|
6
|
+
export var truncationWidthStyles = css({
|
|
7
|
+
width: "var(".concat(CSS_VAR_WIDTH, ")")
|
|
8
|
+
});
|
|
9
|
+
export var fixedSizeTruncateStyles = css({
|
|
10
|
+
textOverflow: 'ellipsis',
|
|
11
|
+
whiteSpace: 'nowrap'
|
|
12
|
+
});
|
|
13
|
+
export var overflowTruncateStyles = css({
|
|
14
|
+
overflow: 'hidden'
|
|
15
|
+
});
|
|
16
|
+
export var getTruncationStyleVars = function getTruncationStyleVars(_ref) {
|
|
17
|
+
var width = _ref.width;
|
|
18
|
+
return _defineProperty({}, CSS_VAR_WIDTH, "".concat(width, "%"));
|
|
94
19
|
};
|
|
95
|
-
export var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return '';
|
|
20
|
+
export var cellStyles = css({
|
|
21
|
+
border: 'none',
|
|
22
|
+
padding: "".concat(gridSize / 2, "px ").concat(gridSize, "px"),
|
|
23
|
+
textAlign: 'left',
|
|
24
|
+
'&:first-of-type': {
|
|
25
|
+
paddingLeft: 0
|
|
26
|
+
},
|
|
27
|
+
'&:last-child': {
|
|
28
|
+
paddingRight: 0
|
|
105
29
|
}
|
|
106
|
-
|
|
107
|
-
var pseudoBase = css(_templateObject6(), gridSize);
|
|
108
|
-
return css(_templateObject7(), pseudoBase, sortOrder === ASC ? arrow.selectedColor(props) : arrow.defaultColor(props), pseudoBase, sortOrder === DESC ? arrow.selectedColor(props) : arrow.defaultColor(props), sortOrder === ASC ? arrow.selectedColor(props) : arrow.hoverColor(props), sortOrder === DESC ? arrow.selectedColor(props) : arrow.hoverColor(props));
|
|
109
|
-
};
|
|
110
|
-
export var cellStyle = css(_templateObject8(), divide(gridSize, 2), gridSize);
|
|
30
|
+
});
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
import styled from 'styled-components';
|
|
14
|
-
export var RowPlaceholderCell = styled.td(_templateObject());
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
5
|
+
var rowPlaceholderStyles = css({
|
|
6
|
+
padding: 0
|
|
7
|
+
});
|
|
8
|
+
export var RowPlaceholderCell = function RowPlaceholderCell(props) {
|
|
9
|
+
return jsx("td", _extends({
|
|
10
|
+
css: rowPlaceholderStyles
|
|
11
|
+
}, props));
|
|
12
|
+
};
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
_templateObject2 = function _templateObject2() {
|
|
7
|
-
return data;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
return data;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function _templateObject() {
|
|
14
|
-
var data = _taggedTemplateLiteral(["\n box-sizing: border-box;\n"]);
|
|
15
|
-
|
|
16
|
-
_templateObject = function _templateObject() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
import styled, { css } from 'styled-components';
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import { css, jsx } from '@emotion/core';
|
|
24
6
|
import { TableBodyCell } from '../TableCell';
|
|
25
|
-
var rankingStyles = css(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
var rankingStyles = css({
|
|
8
|
+
boxSizing: 'border-box'
|
|
9
|
+
});
|
|
10
|
+
export var RankableTableBodyCell = function RankableTableBodyCell(_ref) {
|
|
11
|
+
var isRanking = _ref.isRanking,
|
|
12
|
+
innerRef = _ref.innerRef,
|
|
13
|
+
props = _objectWithoutProperties(_ref, ["isRanking", "innerRef"]);
|
|
14
|
+
|
|
15
|
+
return jsx(TableBodyCell, _extends({
|
|
16
|
+
css: isRanking && rankingStyles
|
|
17
|
+
}, props, {
|
|
18
|
+
innerRef: innerRef
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
@@ -1,61 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return data;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function _templateObject3() {
|
|
14
|
-
var data = _taggedTemplateLiteral(["\n ", " ", " &:focus {\n outline-style: solid;\n outline-color: ", ";\n outline-width: 2px;\n }\n"]);
|
|
15
|
-
|
|
16
|
-
_templateObject3 = function _templateObject3() {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return data;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function _templateObject2() {
|
|
24
|
-
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n ", " border-radius: 2px;\n"]);
|
|
25
|
-
|
|
26
|
-
_templateObject2 = function _templateObject2() {
|
|
27
|
-
return data;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return data;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function _templateObject() {
|
|
34
|
-
var data = _taggedTemplateLiteral(["\n display: block;\n"]);
|
|
35
|
-
|
|
36
|
-
_templateObject = function _templateObject() {
|
|
37
|
-
return data;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return data;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
import styled, { css } from 'styled-components';
|
|
44
|
-
import { B100, N20 } from '@atlaskit/theme/colors';
|
|
45
|
-
import { e500 } from '@atlaskit/theme/elevation';
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { css, jsx } from '@emotion/core';
|
|
7
|
+
import { B100, N20, N50A, N60A } from '@atlaskit/theme/colors';
|
|
8
|
+
import { token } from '@atlaskit/tokens';
|
|
46
9
|
import { TableBodyRow } from '../TableRow';
|
|
47
|
-
var rankingStyles = css(
|
|
10
|
+
var rankingStyles = css({
|
|
11
|
+
display: 'block'
|
|
12
|
+
});
|
|
13
|
+
var elevationStyle = token('shadow.overlay', "0 20px 32px -8px ".concat(N50A, ", 0 0 1px ").concat(N60A));
|
|
48
14
|
/**
|
|
49
15
|
* TODO: Pass the props here to get particular theme for the table
|
|
50
16
|
* Skipping it for now as it may impact migration as util-shared-styles does not support this feature
|
|
51
17
|
*/
|
|
52
18
|
|
|
53
|
-
var rankingItemStyles = css(
|
|
54
|
-
|
|
55
|
-
|
|
19
|
+
var rankingItemStyles = css({
|
|
20
|
+
backgroundColor: token('color.background.subtleNeutral.resting', N20),
|
|
21
|
+
boxShadow: elevationStyle,
|
|
22
|
+
borderRadius: '2px'
|
|
23
|
+
});
|
|
24
|
+
var draggableStyles = css({
|
|
25
|
+
'&:focus': {
|
|
26
|
+
outlineStyle: 'solid',
|
|
27
|
+
outlineColor: token('color.border.focus', B100)
|
|
28
|
+
},
|
|
29
|
+
outlineWidth: '2px'
|
|
30
|
+
});
|
|
31
|
+
export var RankableTableBodyRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
56
32
|
var isRanking = _ref.isRanking,
|
|
57
|
-
isRankingItem = _ref.isRankingItem
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
33
|
+
isRankingItem = _ref.isRankingItem,
|
|
34
|
+
props = _objectWithoutProperties(_ref, ["isRanking", "isRankingItem"]);
|
|
35
|
+
|
|
36
|
+
return jsx(TableBodyRow, _extends({
|
|
37
|
+
css: [isRanking && rankingStyles, isRankingItem && rankingItemStyles, draggableStyles],
|
|
38
|
+
ref: ref
|
|
39
|
+
}, props));
|
|
40
|
+
});
|