@pdg/react-table 1.0.0 → 1.0.1
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/dist/Table/Table.types.d.ts +1 -1
- package/dist/index.esm.js +11 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ export interface TableItem {
|
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}
|
|
8
8
|
export interface TableColumn<T = TableItem> {
|
|
9
|
-
type?: 'text' | 'number' | 'date' | 'img' | 'button' | 'buttons';
|
|
9
|
+
type?: 'text' | 'number' | 'date' | 'datetime' | 'img' | 'button' | 'buttons';
|
|
10
10
|
label?: ReactNode;
|
|
11
11
|
name?: string;
|
|
12
12
|
align?: TableCellProps['align'];
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as React from'react';import React__default,{useRef,useEffect,cloneElement,useState,isValidElement,createRef,PureComponent,useLayoutEffect,useCallback}from'react';import {styled,TableRow,lighten,TableCell,Box,Tooltip,Stack,Pagination,Paper,Table as Table$1,TableHead,TableBody,Icon,TableFooter,Grid,Button}from'@mui/material';import {findDOMNode}from'react-dom';import {Search,SearchGroup,FormHidden}from'@pdg/react-form';
|
|
1
|
+
import*as React from'react';import React__default,{useRef,useEffect,cloneElement,useState,isValidElement,createRef,PureComponent,useLayoutEffect,useCallback}from'react';import {styled,TableRow,lighten,TableCell,Box,Tooltip,Stack,Pagination,Paper,Table as Table$1,TableHead,TableBody,Icon,TableFooter,Grid,Button}from'@mui/material';import {findDOMNode}from'react-dom';import dayjs from'dayjs';import {Search,SearchGroup,FormHidden}from'@pdg/react-form';var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};var classnames = {exports: {}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
@@ -8522,6 +8522,16 @@ var TableBodyCell = function (_a) {
|
|
|
8522
8522
|
React__default.createElement(Tooltip, __assign({ title: React__default.createElement("div", { style: { paddingTop: 3, paddingBottom: 3 } }, img) }, column.tooltipProps, { placement: placement }), img)));
|
|
8523
8523
|
}
|
|
8524
8524
|
break;
|
|
8525
|
+
case 'date':
|
|
8526
|
+
if (data && data instanceof Date) {
|
|
8527
|
+
data = dayjs(data).format('YYYY-MM-DD');
|
|
8528
|
+
}
|
|
8529
|
+
break;
|
|
8530
|
+
case 'datetime':
|
|
8531
|
+
if (data && data instanceof Date) {
|
|
8532
|
+
data = dayjs(data).format('YYYY-MM-DD HH:mm:ss');
|
|
8533
|
+
}
|
|
8534
|
+
break;
|
|
8525
8535
|
default:
|
|
8526
8536
|
{
|
|
8527
8537
|
var tooltip = void 0;
|