1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.StyledTableEmptyMessage = exports.StyledTableLoadingMessage = exports.StyledTableBodyCell = exports.StyledTableBodyRow = exports.StyledTableBody = exports.StyledSortNoneIcon = exports.StyledSortDescIcon = exports.StyledSortAscIcon = exports.StyledTableHeadCellSortable = exports.StyledTableHeadCell = exports.StyledTableHeadRow = exports.StyledTableHead = exports.StyledTable = exports.StyledRoot = void 0;
|
7 |
|
8 | var _blank = _interopRequireDefault(require("../icon/blank.js"));
|
9 |
|
10 | var _chevronDown = _interopRequireDefault(require("../icon/chevron-down.js"));
|
11 |
|
12 | var _chevronUp = _interopRequireDefault(require("../icon/chevron-up.js"));
|
13 |
|
14 | var _index = require("../styles/index.js");
|
15 |
|
16 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17 |
|
18 | 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; }
|
19 |
|
20 | 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; }
|
21 |
|
22 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
23 |
|
24 | var StyledRoot = (0, _index.styled)('div', function (_ref) {
|
25 | var $theme = _ref.$theme;
|
26 | return _objectSpread({}, (0, _index.expandBorderStyles)($theme.borders.border300), {
|
27 | position: 'relative',
|
28 | overflow: 'auto',
|
29 | WebkitOverflowScrolling: 'touch',
|
30 | backgroundColor: $theme.colors.tableBackground,
|
31 | borderTopLeftRadius: $theme.borders.radius200,
|
32 | borderTopRightRadius: $theme.borders.radius200,
|
33 | borderBottomRightRadius: $theme.borders.radius200,
|
34 | borderBottomLeftRadius: $theme.borders.radius200,
|
35 |
|
36 |
|
37 | transform: 'scale(1)'
|
38 | });
|
39 | });
|
40 | exports.StyledRoot = StyledRoot;
|
41 | StyledRoot.displayName = "StyledRoot";
|
42 | var StyledTable = (0, _index.styled)('table', function (_ref2) {
|
43 | var $theme = _ref2.$theme,
|
44 | $width = _ref2.$width;
|
45 | return {
|
46 | borderCollapse: 'collapse',
|
47 | boxSizing: 'border-box',
|
48 | minWidth: '100%',
|
49 | width: $width || null
|
50 | };
|
51 | });
|
52 | exports.StyledTable = StyledTable;
|
53 | StyledTable.displayName = "StyledTable";
|
54 | var StyledTableHead = (0, _index.styled)('thead', function (_ref3) {
|
55 | var $theme = _ref3.$theme;
|
56 | return {};
|
57 | });
|
58 | exports.StyledTableHead = StyledTableHead;
|
59 | StyledTableHead.displayName = "StyledTableHead";
|
60 | var StyledTableHeadRow = (0, _index.styled)('tr', function (_ref4) {
|
61 | var $theme = _ref4.$theme;
|
62 | return {};
|
63 | });
|
64 | exports.StyledTableHeadRow = StyledTableHeadRow;
|
65 | StyledTableHeadRow.displayName = "StyledTableHeadRow";
|
66 | var StyledTableHeadCell = (0, _index.styled)('th', function (_ref5) {
|
67 | var _before;
|
68 |
|
69 | var $theme = _ref5.$theme;
|
70 | var borderDir = $theme.direction === 'rtl' ? 'left' : 'right';
|
71 | return _objectSpread({}, $theme.typography.font350, {
|
72 | position: 'sticky',
|
73 | top: 0,
|
74 | paddingTop: $theme.sizing.scale500,
|
75 | paddingRight: $theme.sizing.scale600,
|
76 | paddingBottom: $theme.sizing.scale500,
|
77 | paddingLeft: $theme.sizing.scale600,
|
78 | backgroundColor: $theme.colors.tableHeadBackgroundColor,
|
79 | color: $theme.colors.contentPrimary,
|
80 | textAlign: $theme.direction === 'rtl' ? 'right' : 'left',
|
81 | verticalAlign: 'top',
|
82 | whiteSpace: 'nowrap',
|
83 | zIndex: 1,
|
84 |
|
85 |
|
86 |
|
87 | '::before': (_before = {
|
88 | content: '""',
|
89 | position: 'absolute',
|
90 | top: '0'
|
91 | }, _defineProperty(_before, borderDir, '100%'), _defineProperty(_before, "bottom", '0'), _defineProperty(_before, "borderLeftColor", $theme.borders.border300.borderColor), _defineProperty(_before, "borderLeftStyle", $theme.borders.border300.borderStyle), _defineProperty(_before, "borderLeftWidth", $theme.borders.border300.borderWidth), _before),
|
92 |
|
93 |
|
94 | '::after': {
|
95 | content: '""',
|
96 | position: 'absolute',
|
97 | top: '100%',
|
98 | right: '0',
|
99 | left: '0',
|
100 | height: $theme.sizing.scale100,
|
101 | pointerEvents: 'none',
|
102 | backgroundImage: "\n linear-gradient(\n to bottom,\n rgba(0, 0, 0, 0.16),\n rgba(0, 0, 0, 0)\n )\n "
|
103 | }
|
104 | });
|
105 | });
|
106 | exports.StyledTableHeadCell = StyledTableHeadCell;
|
107 | StyledTableHeadCell.displayName = "StyledTableHeadCell";
|
108 | var StyledTableHeadCellSortable = (0, _index.withStyle)(StyledTableHeadCell, function (_ref6) {
|
109 | var $theme = _ref6.$theme,
|
110 | $isFocusVisible = _ref6.$isFocusVisible;
|
111 | return {
|
112 | cursor: 'pointer',
|
113 | paddingRight: $theme.sizing.scale1000,
|
114 | outline: 'none',
|
115 | ':focus': {
|
116 | outline: $isFocusVisible ? "3px solid ".concat($theme.colors.accent) : 'none',
|
117 | outlineOffset: '-3px'
|
118 | },
|
119 | ':hover': {
|
120 | backgroundColor: $theme.colors.tableStripedBackground
|
121 | }
|
122 | };
|
123 | });
|
124 | exports.StyledTableHeadCellSortable = StyledTableHeadCellSortable;
|
125 | StyledTableHeadCellSortable.displayName = "StyledTableHeadCellSortable";
|
126 | var StyledSortAscIcon = (0, _index.styled)(_chevronDown.default, function (_ref7) {
|
127 | var $theme = _ref7.$theme;
|
128 | return {
|
129 | position: 'absolute',
|
130 | top: '50%',
|
131 | right: $theme.sizing.scale500,
|
132 | transform: 'translateY(-50%)'
|
133 | };
|
134 | });
|
135 | exports.StyledSortAscIcon = StyledSortAscIcon;
|
136 | StyledSortAscIcon.displayName = "StyledSortAscIcon";
|
137 | var StyledSortDescIcon = (0, _index.styled)(_chevronUp.default, function (_ref8) {
|
138 | var $theme = _ref8.$theme;
|
139 | return {
|
140 | position: 'absolute',
|
141 | top: '50%',
|
142 | right: $theme.sizing.scale500,
|
143 | transform: 'translateY(-50%)'
|
144 | };
|
145 | });
|
146 | exports.StyledSortDescIcon = StyledSortDescIcon;
|
147 | StyledSortDescIcon.displayName = "StyledSortDescIcon";
|
148 | var StyledSortNoneIcon = (0, _index.styled)(_blank.default, function (_ref9) {
|
149 | var $theme = _ref9.$theme;
|
150 | return {
|
151 | position: 'absolute',
|
152 | top: '50%',
|
153 | right: $theme.sizing.scale500,
|
154 | transform: 'translateY(-50%)'
|
155 | };
|
156 | });
|
157 | exports.StyledSortNoneIcon = StyledSortNoneIcon;
|
158 | StyledSortNoneIcon.displayName = "StyledSortNoneIcon";
|
159 | var StyledTableBody = (0, _index.styled)('tbody', function (_ref10) {
|
160 | var $theme = _ref10.$theme;
|
161 | return {};
|
162 | });
|
163 | exports.StyledTableBody = StyledTableBody;
|
164 | StyledTableBody.displayName = "StyledTableBody";
|
165 | var StyledTableBodyRow = (0, _index.styled)('tr', function (_ref11) {
|
166 | var $theme = _ref11.$theme;
|
167 | return {
|
168 | ':hover': {
|
169 | backgroundColor: $theme.colors.tableStripedBackground
|
170 | }
|
171 | };
|
172 | });
|
173 | exports.StyledTableBodyRow = StyledTableBodyRow;
|
174 | StyledTableBodyRow.displayName = "StyledTableBodyRow";
|
175 | var StyledTableBodyCell = (0, _index.styled)('td', function (_ref12) {
|
176 | var $theme = _ref12.$theme,
|
177 | $isNumeric = _ref12.$isNumeric;
|
178 | return _objectSpread({}, $theme.typography.font200, {
|
179 | paddingTop: $theme.sizing.scale300,
|
180 | paddingRight: $theme.sizing.scale600,
|
181 | paddingBottom: $theme.sizing.scale300,
|
182 | paddingLeft: $theme.sizing.scale600,
|
183 | color: $theme.colors.contentPrimary,
|
184 | textAlign: $isNumeric ? 'right' : null,
|
185 | verticalAlign: 'top'
|
186 | });
|
187 | });
|
188 | exports.StyledTableBodyCell = StyledTableBodyCell;
|
189 | StyledTableBodyCell.displayName = "StyledTableBodyCell";
|
190 | var StyledTableLoadingMessage = (0, _index.styled)('div', function (_ref13) {
|
191 | var $theme = _ref13.$theme;
|
192 | return _objectSpread({}, $theme.typography.ParagraphSmall, {
|
193 | color: $theme.colors.contentPrimary,
|
194 | padding: $theme.sizing.scale600
|
195 | });
|
196 | });
|
197 | exports.StyledTableLoadingMessage = StyledTableLoadingMessage;
|
198 | StyledTableLoadingMessage.displayName = "StyledTableLoadingMessage";
|
199 | var StyledTableEmptyMessage = StyledTableLoadingMessage;
|
200 | exports.StyledTableEmptyMessage = StyledTableEmptyMessage; |
\ | No newline at end of file |