es-grid-template 1.8.60 → 1.8.61
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.
|
@@ -13,7 +13,7 @@ import 'dayjs/locale/vi';
|
|
|
13
13
|
// import GridEdit from "./table/GridEdit"
|
|
14
14
|
// import InfiniteTable from "./table/InfiniteTable";
|
|
15
15
|
|
|
16
|
-
import Grid from "./table/Grid"
|
|
16
|
+
// import Grid from "./table/Grid"
|
|
17
17
|
import en from "rc-master-ui/es/date-picker/locale/en_US";
|
|
18
18
|
import vi from "rc-master-ui/es/date-picker/locale/vi_VN";
|
|
19
19
|
import enDr from "rc-master-ui/es/locales/en_US";
|
|
@@ -116,15 +116,12 @@ const ResizableTitle = props => {
|
|
|
116
116
|
})))
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
}));
|
|
127
|
-
};
|
|
119
|
+
|
|
120
|
+
// const TableBodyCell = (props: any) => {
|
|
121
|
+
// const dragState = useContext<DragIndexState>(DragIndexContext)
|
|
122
|
+
// return <div {...props} style={{ ...props.style, ...dragActiveStyle(dragState, props.id) }} />
|
|
123
|
+
// }
|
|
124
|
+
|
|
128
125
|
const SortableHeaderCell = ({
|
|
129
126
|
children,
|
|
130
127
|
columnKey
|
|
@@ -190,6 +187,8 @@ const InternalTable = props => {
|
|
|
190
187
|
onSorter,
|
|
191
188
|
defaultSorter,
|
|
192
189
|
toolbarItems,
|
|
190
|
+
allowSortering,
|
|
191
|
+
allowFiltering,
|
|
193
192
|
...rest
|
|
194
193
|
} = props;
|
|
195
194
|
const id = React.useMemo(() => {
|
|
@@ -497,17 +496,17 @@ const InternalTable = props => {
|
|
|
497
496
|
}
|
|
498
497
|
return {
|
|
499
498
|
...transformedColumn,
|
|
500
|
-
...(transformedColumn.allowFiltering === false ? {} : {
|
|
499
|
+
...(transformedColumn.allowFiltering === false || allowFiltering === false ? {} : {
|
|
501
500
|
...getColumnSearchProps(column)
|
|
502
501
|
}),
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
// }),
|
|
502
|
+
sorter: column.sorter === false || allowSortering === false ? undefined : {
|
|
503
|
+
// @ts-ignore
|
|
504
|
+
compare: (a, b) => onSorter ? a : a[column.field] - b[column.field],
|
|
505
|
+
multiple: sortMultiple ? colIndex : undefined
|
|
506
|
+
},
|
|
509
507
|
// @ts-ignore
|
|
510
|
-
sorter: (a, b) => a[column.field] - b[column.field],
|
|
508
|
+
// sorter: (a, b) => a[column.field] - b[column.field],
|
|
509
|
+
|
|
511
510
|
sortIcon: args => {
|
|
512
511
|
const {
|
|
513
512
|
sortOrder
|
|
@@ -978,13 +977,14 @@ const InternalTable = props => {
|
|
|
978
977
|
} // scroll height auto, không quá 600
|
|
979
978
|
,
|
|
980
979
|
height: propsHeight,
|
|
981
|
-
scrollHeight: scrollHeight
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
980
|
+
scrollHeight: scrollHeight,
|
|
981
|
+
toolbarItems: toolbarItems,
|
|
982
|
+
components: {
|
|
983
|
+
header: {
|
|
984
|
+
cell: ResizableTitle
|
|
985
|
+
}
|
|
986
|
+
// body: { cell: TableBodyCell }
|
|
987
|
+
},
|
|
988
988
|
onFilter: val => {
|
|
989
989
|
handleOnFilter(val);
|
|
990
990
|
},
|
|
@@ -1045,7 +1045,7 @@ const InternalTable = props => {
|
|
|
1045
1045
|
strategy: horizontalListSortingStrategy
|
|
1046
1046
|
}, /*#__PURE__*/React.createElement(DragIndexContext.Provider, {
|
|
1047
1047
|
value: dragIndex
|
|
1048
|
-
}, /*#__PURE__*/React.createElement(
|
|
1048
|
+
}, /*#__PURE__*/React.createElement(Group, _extends({}, rest, {
|
|
1049
1049
|
t: t,
|
|
1050
1050
|
id: faker.string.alpha(20),
|
|
1051
1051
|
locale: locale,
|
|
@@ -1087,10 +1087,8 @@ const InternalTable = props => {
|
|
|
1087
1087
|
components: {
|
|
1088
1088
|
header: {
|
|
1089
1089
|
cell: ResizableTitle
|
|
1090
|
-
},
|
|
1091
|
-
body: {
|
|
1092
|
-
cell: TableBodyCell
|
|
1093
1090
|
}
|
|
1091
|
+
// body: { cell: TableBodyCell }
|
|
1094
1092
|
}
|
|
1095
1093
|
// setTooltipContent={setTooltipContent}
|
|
1096
1094
|
,
|
|
@@ -15,7 +15,5 @@ interface UseColumnsConfig<RecordType> {
|
|
|
15
15
|
rowKey?: any;
|
|
16
16
|
onMouseHover?: any;
|
|
17
17
|
}
|
|
18
|
-
declare const useColumns: <RecordType extends AnyObject = AnyObject>(config: UseColumnsConfig<RecordType>) => readonly [
|
|
19
|
-
any
|
|
20
|
-
];
|
|
18
|
+
declare const useColumns: <RecordType extends AnyObject = AnyObject>(config: UseColumnsConfig<RecordType>) => readonly [any];
|
|
21
19
|
export default useColumns;
|
|
@@ -14,7 +14,6 @@ var _server = _interopRequireDefault(require("react-dom/server"));
|
|
|
14
14
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
15
15
|
require("dayjs/locale/es");
|
|
16
16
|
require("dayjs/locale/vi");
|
|
17
|
-
var _Grid = _interopRequireDefault(require("./table/Grid"));
|
|
18
17
|
var _en_US = _interopRequireDefault(require("rc-master-ui/es/date-picker/locale/en_US"));
|
|
19
18
|
var _vi_VN = _interopRequireDefault(require("rc-master-ui/es/date-picker/locale/vi_VN"));
|
|
20
19
|
var _en_US2 = _interopRequireDefault(require("rc-master-ui/es/locales/en_US"));
|
|
@@ -43,6 +42,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
43
42
|
// import GridEdit from "./table/GridEdit"
|
|
44
43
|
// import InfiniteTable from "./table/InfiniteTable";
|
|
45
44
|
|
|
45
|
+
// import Grid from "./table/Grid"
|
|
46
|
+
|
|
46
47
|
// import useColumns from "./hooks/useColumns";
|
|
47
48
|
|
|
48
49
|
// import 'rc-master-ui/es/date-range-picker/styles/index.less'
|
|
@@ -123,15 +124,12 @@ const ResizableTitle = props => {
|
|
|
123
124
|
})))
|
|
124
125
|
);
|
|
125
126
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
134
|
-
};
|
|
127
|
+
|
|
128
|
+
// const TableBodyCell = (props: any) => {
|
|
129
|
+
// const dragState = useContext<DragIndexState>(DragIndexContext)
|
|
130
|
+
// return <div {...props} style={{ ...props.style, ...dragActiveStyle(dragState, props.id) }} />
|
|
131
|
+
// }
|
|
132
|
+
|
|
135
133
|
const SortableHeaderCell = ({
|
|
136
134
|
children,
|
|
137
135
|
columnKey
|
|
@@ -197,6 +195,8 @@ const InternalTable = props => {
|
|
|
197
195
|
onSorter,
|
|
198
196
|
defaultSorter,
|
|
199
197
|
toolbarItems,
|
|
198
|
+
allowSortering,
|
|
199
|
+
allowFiltering,
|
|
200
200
|
...rest
|
|
201
201
|
} = props;
|
|
202
202
|
const id = _react.default.useMemo(() => {
|
|
@@ -504,17 +504,17 @@ const InternalTable = props => {
|
|
|
504
504
|
}
|
|
505
505
|
return {
|
|
506
506
|
...transformedColumn,
|
|
507
|
-
...(transformedColumn.allowFiltering === false ? {} : {
|
|
507
|
+
...(transformedColumn.allowFiltering === false || allowFiltering === false ? {} : {
|
|
508
508
|
...getColumnSearchProps(column)
|
|
509
509
|
}),
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
// }),
|
|
510
|
+
sorter: column.sorter === false || allowSortering === false ? undefined : {
|
|
511
|
+
// @ts-ignore
|
|
512
|
+
compare: (a, b) => onSorter ? a : a[column.field] - b[column.field],
|
|
513
|
+
multiple: sortMultiple ? colIndex : undefined
|
|
514
|
+
},
|
|
516
515
|
// @ts-ignore
|
|
517
|
-
sorter: (a, b) => a[column.field] - b[column.field],
|
|
516
|
+
// sorter: (a, b) => a[column.field] - b[column.field],
|
|
517
|
+
|
|
518
518
|
sortIcon: args => {
|
|
519
519
|
const {
|
|
520
520
|
sortOrder
|
|
@@ -985,13 +985,14 @@ const InternalTable = props => {
|
|
|
985
985
|
} // scroll height auto, không quá 600
|
|
986
986
|
,
|
|
987
987
|
height: propsHeight,
|
|
988
|
-
scrollHeight: scrollHeight
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
988
|
+
scrollHeight: scrollHeight,
|
|
989
|
+
toolbarItems: toolbarItems,
|
|
990
|
+
components: {
|
|
991
|
+
header: {
|
|
992
|
+
cell: ResizableTitle
|
|
993
|
+
}
|
|
994
|
+
// body: { cell: TableBodyCell }
|
|
995
|
+
},
|
|
995
996
|
onFilter: val => {
|
|
996
997
|
handleOnFilter(val);
|
|
997
998
|
},
|
|
@@ -1052,7 +1053,7 @@ const InternalTable = props => {
|
|
|
1052
1053
|
strategy: _sortable.horizontalListSortingStrategy
|
|
1053
1054
|
}, /*#__PURE__*/_react.default.createElement(DragIndexContext.Provider, {
|
|
1054
1055
|
value: dragIndex
|
|
1055
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
1056
|
+
}, /*#__PURE__*/_react.default.createElement(_Group.default, (0, _extends2.default)({}, rest, {
|
|
1056
1057
|
t: t,
|
|
1057
1058
|
id: _faker.faker.string.alpha(20),
|
|
1058
1059
|
locale: locale,
|
|
@@ -1094,10 +1095,8 @@ const InternalTable = props => {
|
|
|
1094
1095
|
components: {
|
|
1095
1096
|
header: {
|
|
1096
1097
|
cell: ResizableTitle
|
|
1097
|
-
},
|
|
1098
|
-
body: {
|
|
1099
|
-
cell: TableBodyCell
|
|
1100
1098
|
}
|
|
1099
|
+
// body: { cell: TableBodyCell }
|
|
1101
1100
|
}
|
|
1102
1101
|
// setTooltipContent={setTooltipContent}
|
|
1103
1102
|
,
|