@veritone-ce/design-system 1.12.26 → 1.12.28
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.
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ButtonProps as MuiButtonProps } from '@mui/material';
|
|
2
3
|
export type ButtonProps = {
|
|
3
4
|
'data-testid'?: string;
|
|
4
5
|
isLoading?: boolean;
|
|
6
|
+
component?: React.ElementType;
|
|
7
|
+
to?: string;
|
|
5
8
|
} & MuiButtonProps;
|
|
6
9
|
/**
|
|
7
10
|
- Use a button for common user click actions. Several variations available.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
interface ModelGridViewData {
|
|
2
3
|
modelName: string;
|
|
3
4
|
lastModified: string;
|
|
@@ -8,6 +9,7 @@ interface ModelGridViewData {
|
|
|
8
9
|
export type ModelGridViewProps = {
|
|
9
10
|
'data-testid'?: string;
|
|
10
11
|
rows: ModelGridViewData[];
|
|
12
|
+
zeroStateComponent?: React.ReactNode;
|
|
11
13
|
};
|
|
12
|
-
declare const ModelGridView: ({ rows }: ModelGridViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const ModelGridView: ({ rows, zeroStateComponent }: ModelGridViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default ModelGridView;
|
|
@@ -118,8 +118,24 @@ function EnhancedTableHead(props) {
|
|
|
118
118
|
})
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
+
var ZeroState = function ZeroState() {
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
123
|
+
sx: {
|
|
124
|
+
width: '100%',
|
|
125
|
+
height: '100vh',
|
|
126
|
+
display: 'flex',
|
|
127
|
+
justifyContent: 'center',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
backgroundColor: 'rgba(224, 232, 240, 1)'
|
|
130
|
+
},
|
|
131
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
132
|
+
children: "No data to display"
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
};
|
|
121
136
|
var ModelGridView = function ModelGridView(_ref) {
|
|
122
|
-
var rows = _ref.rows
|
|
137
|
+
var rows = _ref.rows,
|
|
138
|
+
zeroStateComponent = _ref.zeroStateComponent;
|
|
123
139
|
var _React$useState = React.useState('desc'),
|
|
124
140
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
125
141
|
order = _React$useState2[0],
|
|
@@ -178,8 +194,18 @@ var ModelGridView = function ModelGridView(_ref) {
|
|
|
178
194
|
order: order,
|
|
179
195
|
orderBy: orderBy,
|
|
180
196
|
onRequestSort: handleRequestSort
|
|
181
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
182
|
-
children: rows.
|
|
197
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.TableBody, {
|
|
198
|
+
children: [rows.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableRow, {
|
|
199
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TableCell, {
|
|
200
|
+
colSpan: 6,
|
|
201
|
+
align: "center",
|
|
202
|
+
sx: {
|
|
203
|
+
height: '100%',
|
|
204
|
+
verticalAlign: 'middle'
|
|
205
|
+
},
|
|
206
|
+
children: zeroStateComponent || /*#__PURE__*/(0, _jsxRuntime.jsx)(ZeroState, {})
|
|
207
|
+
})
|
|
208
|
+
}), rows.length > 0 && rows.slice().sort(getComparator(order, orderBy)).map(function (row, index) {
|
|
183
209
|
var labelId = "enhanced-table-checkbox-".concat(index);
|
|
184
210
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.TableRow, {
|
|
185
211
|
tabIndex: -1,
|
|
@@ -293,7 +319,7 @@ var ModelGridView = function ModelGridView(_ref) {
|
|
|
293
319
|
})]
|
|
294
320
|
})]
|
|
295
321
|
}, row.modelName);
|
|
296
|
-
})
|
|
322
|
+
})]
|
|
297
323
|
})]
|
|
298
324
|
})
|
|
299
325
|
})
|