@pingux/astro 2.112.0-alpha.0 → 2.112.0-alpha.2
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/DataTable/DataTable.js +9 -1
- package/lib/cjs/components/DataTable/DataTable.stories.js +23 -16
- package/lib/cjs/components/DataTable/DataTable.styles.d.ts +7 -1
- package/lib/cjs/components/DataTable/DataTable.styles.js +10 -2
- package/lib/cjs/components/DataTable/DataTableBadge.js +5 -32
- package/lib/cjs/components/DataTable/DataTableBadge.test.js +0 -2
- package/lib/cjs/components/Loader/Loader.js +6 -5
- package/lib/cjs/types/loader.d.ts +2 -0
- package/lib/components/DataTable/DataTable.js +9 -1
- package/lib/components/DataTable/DataTable.stories.js +23 -16
- package/lib/components/DataTable/DataTable.styles.js +10 -2
- package/lib/components/DataTable/DataTableBadge.js +6 -33
- package/lib/components/DataTable/DataTableBadge.test.js +0 -2
- package/lib/components/Loader/Loader.js +6 -5
- package/package.json +1 -1
@@ -203,7 +203,15 @@ var DataTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
203
203
|
case 'loader':
|
204
204
|
return (0, _react2.jsx)(CenteredWrapper, null, (0, _react2.jsx)(_index.Loader, {
|
205
205
|
color: "accent.70",
|
206
|
-
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading'
|
206
|
+
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading',
|
207
|
+
sx: {
|
208
|
+
gap: '9px'
|
209
|
+
},
|
210
|
+
dotProps: {
|
211
|
+
sx: {
|
212
|
+
m: 0
|
213
|
+
}
|
214
|
+
}
|
207
215
|
}));
|
208
216
|
default:
|
209
217
|
return undefined;
|
@@ -154,6 +154,13 @@ var _default = {
|
|
154
154
|
}
|
155
155
|
};
|
156
156
|
exports["default"] = _default;
|
157
|
+
var getHeaderProps = function getHeaderProps() {
|
158
|
+
return {
|
159
|
+
sx: {
|
160
|
+
fontWeight: '3'
|
161
|
+
}
|
162
|
+
};
|
163
|
+
};
|
157
164
|
var getCellProps = function getCellProps(columnKey, align) {
|
158
165
|
return {
|
159
166
|
pr: columnKey !== 'menu' ? 'lg' : 0,
|
@@ -189,7 +196,7 @@ var Default = function Default(args) {
|
|
189
196
|
id: 1,
|
190
197
|
timestamp: timestampCell,
|
191
198
|
eventType: 'User Access Allowed',
|
192
|
-
description: (0, _react2.jsx)(
|
199
|
+
description: (0, _react2.jsx)(_index.Box, null, "Passed Role Access Control"),
|
193
200
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
194
201
|
cell: "Approved"
|
195
202
|
}),
|
@@ -199,13 +206,10 @@ var Default = function Default(args) {
|
|
199
206
|
id: 2,
|
200
207
|
timestamp: timestampCell,
|
201
208
|
eventType: 'User Access Denied',
|
202
|
-
description: (0, _react2.jsx)(
|
203
|
-
display: "
|
204
|
-
|
205
|
-
|
206
|
-
}, "Control"), (0, _react2.jsx)(_index.Box, {
|
207
|
-
display: "block"
|
208
|
-
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words")),
|
209
|
+
description: (0, _react2.jsx)(_index.Box, {
|
210
|
+
display: "-webkit-box",
|
211
|
+
variant: "dataTable.truncateText"
|
212
|
+
}, "Passed Role Access Control Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
209
213
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
210
214
|
cell: "Rejected"
|
211
215
|
}),
|
@@ -215,7 +219,10 @@ var Default = function Default(args) {
|
|
215
219
|
id: 3,
|
216
220
|
timestamp: timestampCell,
|
217
221
|
eventType: 'User Access Allowed',
|
218
|
-
description:
|
222
|
+
description: (0, _react2.jsx)(_index.Box, {
|
223
|
+
display: "-webkit-box",
|
224
|
+
variant: "dataTable.truncateText"
|
225
|
+
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
219
226
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
220
227
|
cell: "Approved"
|
221
228
|
}),
|
@@ -225,7 +232,7 @@ var Default = function Default(args) {
|
|
225
232
|
id: 4,
|
226
233
|
timestamp: timestampCell,
|
227
234
|
eventType: 'User Access Allowed',
|
228
|
-
description: (0, _react2.jsx)(
|
235
|
+
description: (0, _react2.jsx)(_index.Box, null, "Passed Role Access Control"),
|
229
236
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
230
237
|
cell: "Approved"
|
231
238
|
}),
|
@@ -235,7 +242,7 @@ var Default = function Default(args) {
|
|
235
242
|
id: 5,
|
236
243
|
timestamp: timestampCell,
|
237
244
|
eventType: 'User Access Allowed',
|
238
|
-
description: (0, _react2.jsx)(
|
245
|
+
description: (0, _react2.jsx)(_index.Box, null, "Passed Role Access Control"),
|
239
246
|
status: (0, _react2.jsx)(_index.DataTableBadge, {
|
240
247
|
cell: "Approved"
|
241
248
|
}),
|
@@ -248,7 +255,7 @@ var Default = function Default(args) {
|
|
248
255
|
}), (0, _react2.jsx)(_index.DataTableHeader, {
|
249
256
|
columns: columns
|
250
257
|
}, function (column) {
|
251
|
-
return (0, _react2.jsx)(_index.DataTableColumn, (0, _extends2["default"])({}, getCellProps(column.key, false), {
|
258
|
+
return (0, _react2.jsx)(_index.DataTableColumn, (0, _extends2["default"])({}, getCellProps(column.key, false), getHeaderProps(), {
|
252
259
|
minWidth: column.key !== 'menu' ? 175 : 32,
|
253
260
|
width: column.key !== 'menu' ? '19.4%' : 32
|
254
261
|
}), column.name);
|
@@ -308,7 +315,7 @@ var Dynamic = function Dynamic(args) {
|
|
308
315
|
id: 5,
|
309
316
|
country: 'Mexico',
|
310
317
|
population: '126,000,000',
|
311
|
-
continent: '
|
318
|
+
continent: 'North America'
|
312
319
|
}, {
|
313
320
|
id: 6,
|
314
321
|
country: 'Ethiopia',
|
@@ -415,7 +422,7 @@ var Sortable = function Sortable(args) {
|
|
415
422
|
id: 6,
|
416
423
|
country: 'Mexico',
|
417
424
|
population: '126,000,000',
|
418
|
-
continent: '
|
425
|
+
continent: 'North America'
|
419
426
|
}, {
|
420
427
|
id: 7,
|
421
428
|
country: 'USA',
|
@@ -550,7 +557,7 @@ var Selection = function Selection(args) {
|
|
550
557
|
id: 5,
|
551
558
|
country: 'Mexico',
|
552
559
|
population: '126,000,000',
|
553
|
-
continent: '
|
560
|
+
continent: 'North America'
|
554
561
|
}, {
|
555
562
|
id: 6,
|
556
563
|
country: 'Ethiopia',
|
@@ -635,7 +642,7 @@ var ControlledSelection = function ControlledSelection(args) {
|
|
635
642
|
id: 5,
|
636
643
|
country: 'Mexico',
|
637
644
|
population: '126,000,000',
|
638
|
-
continent: '
|
645
|
+
continent: 'North America'
|
639
646
|
}, {
|
640
647
|
id: 6,
|
641
648
|
country: 'Ethiopia',
|
@@ -51,7 +51,6 @@ declare const _default: {
|
|
51
51
|
};
|
52
52
|
tableCellContents: {
|
53
53
|
maxHeight: number;
|
54
|
-
overflow: string;
|
55
54
|
display: string;
|
56
55
|
'-webkit-line-clamp': string;
|
57
56
|
'-webkit-box-orient': string;
|
@@ -167,5 +166,12 @@ declare const _default: {
|
|
167
166
|
borderRadius: string;
|
168
167
|
mr: string;
|
169
168
|
};
|
169
|
+
truncateText: {
|
170
|
+
whiteSpace: string;
|
171
|
+
WebkitBoxOrient: string;
|
172
|
+
display: string;
|
173
|
+
WebkitLineClamp: string;
|
174
|
+
overflow: string;
|
175
|
+
};
|
170
176
|
};
|
171
177
|
export default _default;
|
@@ -48,7 +48,7 @@ var tableCell = _objectSpread(_objectSpread({}, _Text.text.tableData), {}, {
|
|
48
48
|
});
|
49
49
|
var tableCellContents = {
|
50
50
|
maxHeight: 80,
|
51
|
-
overflow: 'hidden',
|
51
|
+
// overflow: 'hidden',
|
52
52
|
display: '-webkit-box !important',
|
53
53
|
'-webkit-line-clamp': '4',
|
54
54
|
'-webkit-box-orient': 'vertical'
|
@@ -159,6 +159,13 @@ var tableMenu = {
|
|
159
159
|
borderRadius: '50px',
|
160
160
|
mr: 'md'
|
161
161
|
};
|
162
|
+
var truncateText = {
|
163
|
+
whiteSpace: 'normal',
|
164
|
+
WebkitBoxOrient: 'vertical',
|
165
|
+
display: '-webkit-box',
|
166
|
+
WebkitLineClamp: '2',
|
167
|
+
overflow: 'hidden'
|
168
|
+
};
|
162
169
|
var _default = {
|
163
170
|
selectableTableRow: selectableTableRow,
|
164
171
|
tableBody: tableBody,
|
@@ -168,6 +175,7 @@ var _default = {
|
|
168
175
|
tableCell: tableCell,
|
169
176
|
tableRow: tableRow,
|
170
177
|
tableHeadCell: tableHeadCell,
|
171
|
-
tableMenu: tableMenu
|
178
|
+
tableMenu: tableMenu,
|
179
|
+
truncateText: truncateText
|
172
180
|
};
|
173
181
|
exports["default"] = _default;
|
@@ -11,9 +11,6 @@ _Object$defineProperty(exports, "__esModule", {
|
|
11
11
|
exports["default"] = void 0;
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
14
|
-
var _AlertCircleIcon = _interopRequireDefault(require("@pingux/mdi-react/AlertCircleIcon"));
|
15
|
-
var _AlertIcon = _interopRequireDefault(require("@pingux/mdi-react/AlertIcon"));
|
16
|
-
var _CheckIcon = _interopRequireDefault(require("@pingux/mdi-react/CheckIcon"));
|
17
14
|
var _index = require("../../index");
|
18
15
|
var _react2 = require("@emotion/react");
|
19
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -25,53 +22,29 @@ var DataTableBadge = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
25
22
|
var componentProps = {
|
26
23
|
'Pending': {
|
27
24
|
badgeProps: {
|
28
|
-
variant: '
|
29
|
-
},
|
30
|
-
iconProps: {
|
31
|
-
icon: _CheckIcon["default"]
|
25
|
+
variant: 'activeStatusBadge'
|
32
26
|
}
|
33
27
|
},
|
34
28
|
'Failed': {
|
35
29
|
badgeProps: {
|
36
|
-
variant: '
|
37
|
-
},
|
38
|
-
iconProps: {
|
39
|
-
icon: _AlertIcon["default"],
|
40
|
-
title: {
|
41
|
-
name: 'Alert Icon'
|
42
|
-
}
|
30
|
+
variant: 'warningStatusBadge'
|
43
31
|
}
|
44
32
|
},
|
45
33
|
'Rejected': {
|
46
34
|
badgeProps: {
|
47
|
-
variant: '
|
48
|
-
},
|
49
|
-
iconProps: {
|
50
|
-
icon: _AlertCircleIcon["default"],
|
51
|
-
title: {
|
52
|
-
name: 'Alert Circle Icon'
|
53
|
-
}
|
35
|
+
variant: 'criticalStatusBadge'
|
54
36
|
}
|
55
37
|
},
|
56
38
|
'Approved': {
|
57
39
|
badgeProps: {
|
58
|
-
variant: '
|
59
|
-
},
|
60
|
-
iconProps: {
|
61
|
-
icon: _CheckIcon["default"],
|
62
|
-
title: {
|
63
|
-
name: 'Check Icon'
|
64
|
-
}
|
40
|
+
variant: 'healthyStatusBadge'
|
65
41
|
}
|
66
42
|
}
|
67
43
|
};
|
68
44
|
return (0, _react2.jsx)(_index.Badge, (0, _extends2["default"])({
|
69
45
|
label: cell,
|
70
46
|
ref: ref
|
71
|
-
}, cell && componentProps[cell].badgeProps)
|
72
|
-
mr: "xs",
|
73
|
-
size: "14px"
|
74
|
-
}, cell && componentProps[cell].iconProps)));
|
47
|
+
}, cell && componentProps[cell].badgeProps));
|
75
48
|
});
|
76
49
|
var _default = DataTableBadge;
|
77
50
|
exports["default"] = _default;
|
@@ -23,7 +23,6 @@ test('renders component with rejected label', function () {
|
|
23
23
|
cell: cell
|
24
24
|
});
|
25
25
|
expect(_react2.screen.queryByText('Rejected')).toBeInTheDocument();
|
26
|
-
expect(_react2.screen.queryByText('Alert Circle Icon')).toBeInTheDocument();
|
27
26
|
});
|
28
27
|
test('renders component with pending label', function () {
|
29
28
|
var cell = 'Pending';
|
@@ -38,7 +37,6 @@ test('renders component with failed label', function () {
|
|
38
37
|
cell: cell
|
39
38
|
});
|
40
39
|
expect(_react2.screen.queryByText('Failed')).toBeInTheDocument();
|
41
|
-
expect(_react2.screen.queryByText('Alert Icon')).toBeInTheDocument();
|
42
40
|
});
|
43
41
|
test('renders component with null cell', function () {
|
44
42
|
var cell = null;
|
@@ -14,11 +14,12 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime-c
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
15
15
|
var _Box = _interopRequireDefault(require("../Box"));
|
16
16
|
var _react2 = require("@emotion/react");
|
17
|
-
var _excluded = ["size"];
|
17
|
+
var _excluded = ["size", "dotProps"];
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
20
20
|
var Loader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
21
21
|
var size = props.size,
|
22
|
+
dotProps = props.dotProps,
|
22
23
|
others = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
23
24
|
return (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
24
25
|
ref: ref,
|
@@ -28,13 +29,13 @@ var Loader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
28
29
|
role: "alert",
|
29
30
|
"aria-live": "assertive",
|
30
31
|
"aria-label": "Loading in progress"
|
31
|
-
}, others), (0, _react2.jsx)(_Box["default"], {
|
32
|
+
}, others), (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
32
33
|
variant: "loader.dotLeft"
|
33
|
-
}), (0, _react2.jsx)(_Box["default"], {
|
34
|
+
}, dotProps)), (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
34
35
|
variant: "loader.dotCenter"
|
35
|
-
}), (0, _react2.jsx)(_Box["default"], {
|
36
|
+
}, dotProps)), (0, _react2.jsx)(_Box["default"], (0, _extends2["default"])({
|
36
37
|
variant: "loader.dotRight"
|
37
|
-
}));
|
38
|
+
}, dotProps)));
|
38
39
|
});
|
39
40
|
var _default = Loader;
|
40
41
|
exports["default"] = _default;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { IconSize, StyleProps } from './shared';
|
2
|
+
import { BoxProps } from '.';
|
2
3
|
export interface LoaderProps extends StyleProps {
|
3
4
|
/**
|
4
5
|
* Color key from theme or string value.
|
@@ -6,4 +7,5 @@ export interface LoaderProps extends StyleProps {
|
|
6
7
|
*/
|
7
8
|
color?: string;
|
8
9
|
size?: IconSize;
|
10
|
+
dotProps?: BoxProps;
|
9
11
|
}
|
@@ -192,7 +192,15 @@ var DataTable = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
192
192
|
case 'loader':
|
193
193
|
return ___EmotionJSX(CenteredWrapper, null, ___EmotionJSX(Loader, {
|
194
194
|
color: "accent.70",
|
195
|
-
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading'
|
195
|
+
"aria-label": state.collection.size > 0 ? 'loadingMore' : 'loading',
|
196
|
+
sx: {
|
197
|
+
gap: '9px'
|
198
|
+
},
|
199
|
+
dotProps: {
|
200
|
+
sx: {
|
201
|
+
m: 0
|
202
|
+
}
|
203
|
+
}
|
196
204
|
}));
|
197
205
|
default:
|
198
206
|
return undefined;
|
@@ -142,6 +142,13 @@ export default {
|
|
142
142
|
overflowMode: 'truncate'
|
143
143
|
}
|
144
144
|
};
|
145
|
+
var getHeaderProps = function getHeaderProps() {
|
146
|
+
return {
|
147
|
+
sx: {
|
148
|
+
fontWeight: '3'
|
149
|
+
}
|
150
|
+
};
|
151
|
+
};
|
145
152
|
var getCellProps = function getCellProps(columnKey, align) {
|
146
153
|
return {
|
147
154
|
pr: columnKey !== 'menu' ? 'lg' : 0,
|
@@ -177,7 +184,7 @@ export var Default = function Default(args) {
|
|
177
184
|
id: 1,
|
178
185
|
timestamp: timestampCell,
|
179
186
|
eventType: 'User Access Allowed',
|
180
|
-
description: ___EmotionJSX(
|
187
|
+
description: ___EmotionJSX(Box, null, "Passed Role Access Control"),
|
181
188
|
status: ___EmotionJSX(DataTableBadge, {
|
182
189
|
cell: "Approved"
|
183
190
|
}),
|
@@ -187,13 +194,10 @@ export var Default = function Default(args) {
|
|
187
194
|
id: 2,
|
188
195
|
timestamp: timestampCell,
|
189
196
|
eventType: 'User Access Denied',
|
190
|
-
description: ___EmotionJSX(
|
191
|
-
display: "
|
192
|
-
|
193
|
-
|
194
|
-
}, "Control"), ___EmotionJSX(Box, {
|
195
|
-
display: "block"
|
196
|
-
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words")),
|
197
|
+
description: ___EmotionJSX(Box, {
|
198
|
+
display: "-webkit-box",
|
199
|
+
variant: "dataTable.truncateText"
|
200
|
+
}, "Passed Role Access Control Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
197
201
|
status: ___EmotionJSX(DataTableBadge, {
|
198
202
|
cell: "Rejected"
|
199
203
|
}),
|
@@ -203,7 +207,10 @@ export var Default = function Default(args) {
|
|
203
207
|
id: 3,
|
204
208
|
timestamp: timestampCell,
|
205
209
|
eventType: 'User Access Allowed',
|
206
|
-
description:
|
210
|
+
description: ___EmotionJSX(Box, {
|
211
|
+
display: "-webkit-box",
|
212
|
+
variant: "dataTable.truncateText"
|
213
|
+
}, "Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words Words"),
|
207
214
|
status: ___EmotionJSX(DataTableBadge, {
|
208
215
|
cell: "Approved"
|
209
216
|
}),
|
@@ -213,7 +220,7 @@ export var Default = function Default(args) {
|
|
213
220
|
id: 4,
|
214
221
|
timestamp: timestampCell,
|
215
222
|
eventType: 'User Access Allowed',
|
216
|
-
description: ___EmotionJSX(
|
223
|
+
description: ___EmotionJSX(Box, null, "Passed Role Access Control"),
|
217
224
|
status: ___EmotionJSX(DataTableBadge, {
|
218
225
|
cell: "Approved"
|
219
226
|
}),
|
@@ -223,7 +230,7 @@ export var Default = function Default(args) {
|
|
223
230
|
id: 5,
|
224
231
|
timestamp: timestampCell,
|
225
232
|
eventType: 'User Access Allowed',
|
226
|
-
description: ___EmotionJSX(
|
233
|
+
description: ___EmotionJSX(Box, null, "Passed Role Access Control"),
|
227
234
|
status: ___EmotionJSX(DataTableBadge, {
|
228
235
|
cell: "Approved"
|
229
236
|
}),
|
@@ -236,7 +243,7 @@ export var Default = function Default(args) {
|
|
236
243
|
}), ___EmotionJSX(DataTableHeader, {
|
237
244
|
columns: columns
|
238
245
|
}, function (column) {
|
239
|
-
return ___EmotionJSX(DataTableColumn, _extends({}, getCellProps(column.key, false), {
|
246
|
+
return ___EmotionJSX(DataTableColumn, _extends({}, getCellProps(column.key, false), getHeaderProps(), {
|
240
247
|
minWidth: column.key !== 'menu' ? 175 : 32,
|
241
248
|
width: column.key !== 'menu' ? '19.4%' : 32
|
242
249
|
}), column.name);
|
@@ -295,7 +302,7 @@ export var Dynamic = function Dynamic(args) {
|
|
295
302
|
id: 5,
|
296
303
|
country: 'Mexico',
|
297
304
|
population: '126,000,000',
|
298
|
-
continent: '
|
305
|
+
continent: 'North America'
|
299
306
|
}, {
|
300
307
|
id: 6,
|
301
308
|
country: 'Ethiopia',
|
@@ -401,7 +408,7 @@ export var Sortable = function Sortable(args) {
|
|
401
408
|
id: 6,
|
402
409
|
country: 'Mexico',
|
403
410
|
population: '126,000,000',
|
404
|
-
continent: '
|
411
|
+
continent: 'North America'
|
405
412
|
}, {
|
406
413
|
id: 7,
|
407
414
|
country: 'USA',
|
@@ -535,7 +542,7 @@ export var Selection = function Selection(args) {
|
|
535
542
|
id: 5,
|
536
543
|
country: 'Mexico',
|
537
544
|
population: '126,000,000',
|
538
|
-
continent: '
|
545
|
+
continent: 'North America'
|
539
546
|
}, {
|
540
547
|
id: 6,
|
541
548
|
country: 'Ethiopia',
|
@@ -619,7 +626,7 @@ export var ControlledSelection = function ControlledSelection(args) {
|
|
619
626
|
id: 5,
|
620
627
|
country: 'Mexico',
|
621
628
|
population: '126,000,000',
|
622
|
-
continent: '
|
629
|
+
continent: 'North America'
|
623
630
|
}, {
|
624
631
|
id: 6,
|
625
632
|
country: 'Ethiopia',
|
@@ -41,7 +41,7 @@ var tableCell = _objectSpread(_objectSpread({}, text.tableData), {}, {
|
|
41
41
|
});
|
42
42
|
var tableCellContents = {
|
43
43
|
maxHeight: 80,
|
44
|
-
overflow: 'hidden',
|
44
|
+
// overflow: 'hidden',
|
45
45
|
display: '-webkit-box !important',
|
46
46
|
'-webkit-line-clamp': '4',
|
47
47
|
'-webkit-box-orient': 'vertical'
|
@@ -152,6 +152,13 @@ var tableMenu = {
|
|
152
152
|
borderRadius: '50px',
|
153
153
|
mr: 'md'
|
154
154
|
};
|
155
|
+
var truncateText = {
|
156
|
+
whiteSpace: 'normal',
|
157
|
+
WebkitBoxOrient: 'vertical',
|
158
|
+
display: '-webkit-box',
|
159
|
+
WebkitLineClamp: '2',
|
160
|
+
overflow: 'hidden'
|
161
|
+
};
|
155
162
|
export default {
|
156
163
|
selectableTableRow: selectableTableRow,
|
157
164
|
tableBody: tableBody,
|
@@ -161,5 +168,6 @@ export default {
|
|
161
168
|
tableCell: tableCell,
|
162
169
|
tableRow: tableRow,
|
163
170
|
tableHeadCell: tableHeadCell,
|
164
|
-
tableMenu: tableMenu
|
171
|
+
tableMenu: tableMenu,
|
172
|
+
truncateText: truncateText
|
165
173
|
};
|
@@ -1,62 +1,35 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
/* eslint-disable no-nested-ternary */
|
3
3
|
import React, { forwardRef } from 'react';
|
4
|
-
import
|
5
|
-
import AlertIcon from '@pingux/mdi-react/AlertIcon';
|
6
|
-
import CheckIcon from '@pingux/mdi-react/CheckIcon';
|
7
|
-
import { Badge, Icon } from '../../index';
|
4
|
+
import { Badge } from '../../index';
|
8
5
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
9
6
|
var DataTableBadge = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
10
7
|
var cell = _ref.cell;
|
11
8
|
var componentProps = {
|
12
9
|
'Pending': {
|
13
10
|
badgeProps: {
|
14
|
-
variant: '
|
15
|
-
},
|
16
|
-
iconProps: {
|
17
|
-
icon: CheckIcon
|
11
|
+
variant: 'activeStatusBadge'
|
18
12
|
}
|
19
13
|
},
|
20
14
|
'Failed': {
|
21
15
|
badgeProps: {
|
22
|
-
variant: '
|
23
|
-
},
|
24
|
-
iconProps: {
|
25
|
-
icon: AlertIcon,
|
26
|
-
title: {
|
27
|
-
name: 'Alert Icon'
|
28
|
-
}
|
16
|
+
variant: 'warningStatusBadge'
|
29
17
|
}
|
30
18
|
},
|
31
19
|
'Rejected': {
|
32
20
|
badgeProps: {
|
33
|
-
variant: '
|
34
|
-
},
|
35
|
-
iconProps: {
|
36
|
-
icon: AlertCircleIcon,
|
37
|
-
title: {
|
38
|
-
name: 'Alert Circle Icon'
|
39
|
-
}
|
21
|
+
variant: 'criticalStatusBadge'
|
40
22
|
}
|
41
23
|
},
|
42
24
|
'Approved': {
|
43
25
|
badgeProps: {
|
44
|
-
variant: '
|
45
|
-
},
|
46
|
-
iconProps: {
|
47
|
-
icon: CheckIcon,
|
48
|
-
title: {
|
49
|
-
name: 'Check Icon'
|
50
|
-
}
|
26
|
+
variant: 'healthyStatusBadge'
|
51
27
|
}
|
52
28
|
}
|
53
29
|
};
|
54
30
|
return ___EmotionJSX(Badge, _extends({
|
55
31
|
label: cell,
|
56
32
|
ref: ref
|
57
|
-
}, cell && componentProps[cell].badgeProps)
|
58
|
-
mr: "xs",
|
59
|
-
size: "14px"
|
60
|
-
}, cell && componentProps[cell].iconProps)));
|
33
|
+
}, cell && componentProps[cell].badgeProps));
|
61
34
|
});
|
62
35
|
export default DataTableBadge;
|
@@ -20,7 +20,6 @@ test('renders component with rejected label', function () {
|
|
20
20
|
cell: cell
|
21
21
|
});
|
22
22
|
expect(screen.queryByText('Rejected')).toBeInTheDocument();
|
23
|
-
expect(screen.queryByText('Alert Circle Icon')).toBeInTheDocument();
|
24
23
|
});
|
25
24
|
test('renders component with pending label', function () {
|
26
25
|
var cell = 'Pending';
|
@@ -35,7 +34,6 @@ test('renders component with failed label', function () {
|
|
35
34
|
cell: cell
|
36
35
|
});
|
37
36
|
expect(screen.queryByText('Failed')).toBeInTheDocument();
|
38
|
-
expect(screen.queryByText('Alert Icon')).toBeInTheDocument();
|
39
37
|
});
|
40
38
|
test('renders component with null cell', function () {
|
41
39
|
var cell = null;
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["size"];
|
3
|
+
var _excluded = ["size", "dotProps"];
|
4
4
|
import React, { forwardRef } from 'react';
|
5
5
|
import Box from '../Box';
|
6
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
7
7
|
var Loader = /*#__PURE__*/forwardRef(function (props, ref) {
|
8
8
|
var size = props.size,
|
9
|
+
dotProps = props.dotProps,
|
9
10
|
others = _objectWithoutProperties(props, _excluded);
|
10
11
|
return ___EmotionJSX(Box, _extends({
|
11
12
|
ref: ref,
|
@@ -15,12 +16,12 @@ var Loader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
15
16
|
role: "alert",
|
16
17
|
"aria-live": "assertive",
|
17
18
|
"aria-label": "Loading in progress"
|
18
|
-
}, others), ___EmotionJSX(Box, {
|
19
|
+
}, others), ___EmotionJSX(Box, _extends({
|
19
20
|
variant: "loader.dotLeft"
|
20
|
-
}), ___EmotionJSX(Box, {
|
21
|
+
}, dotProps)), ___EmotionJSX(Box, _extends({
|
21
22
|
variant: "loader.dotCenter"
|
22
|
-
}), ___EmotionJSX(Box, {
|
23
|
+
}, dotProps)), ___EmotionJSX(Box, _extends({
|
23
24
|
variant: "loader.dotRight"
|
24
|
-
}));
|
25
|
+
}, dotProps)));
|
25
26
|
});
|
26
27
|
export default Loader;
|