@arim-aisdc/public-components 2.1.3 → 2.1.4
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.
|
@@ -144,11 +144,11 @@ var TableBody = function TableBody(_ref) {
|
|
|
144
144
|
var addToLast = useCallback(function () {
|
|
145
145
|
publishCurTableHoveringEvent();
|
|
146
146
|
var lastIndex = table.getRowModel().rows.length - 1;
|
|
147
|
-
if (lastIndex !== hoverRowIndex) {
|
|
147
|
+
if (lastIndex !== hoverRowIndex || lastIndex === hoverRowIndex && dropSide !== DropSide.Bottom) {
|
|
148
148
|
setHoverRowIndex(lastIndex);
|
|
149
149
|
setDropSide(DropSide.Bottom);
|
|
150
150
|
}
|
|
151
|
-
}, [hoverRowIndex]);
|
|
151
|
+
}, [hoverRowIndex, dropSide]);
|
|
152
152
|
|
|
153
153
|
// cell右键菜单
|
|
154
154
|
var handleCellContextMenu = function handleCellContextMenu(e, cell) {
|
|
@@ -12,8 +12,8 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
import { AutoComplete, DatePicker, Input, InputNumber } from 'antd';
|
|
15
|
-
import { debounce } from 'lodash';
|
|
16
15
|
import dayjs from 'dayjs';
|
|
16
|
+
import { debounce } from 'lodash';
|
|
17
17
|
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
18
18
|
import { TableContext } from "../../TableMax";
|
|
19
19
|
import { noValue } from "../../utils";
|
|
@@ -84,7 +84,7 @@ export function Filter(_ref) {
|
|
|
84
84
|
apiOptions = _useState4[0],
|
|
85
85
|
setApiOptions = _useState4[1];
|
|
86
86
|
// 调用接口获取可选值
|
|
87
|
-
var fetchOptions = /*#__PURE__*/function () {
|
|
87
|
+
var fetchOptions = useCallback( /*#__PURE__*/function () {
|
|
88
88
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(inputValue) {
|
|
89
89
|
var res;
|
|
90
90
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -113,14 +113,14 @@ export function Filter(_ref) {
|
|
|
113
113
|
}
|
|
114
114
|
}, _callee, null, [[1, 8]]);
|
|
115
115
|
}));
|
|
116
|
-
return function
|
|
116
|
+
return function (_x) {
|
|
117
117
|
return _ref2.apply(this, arguments);
|
|
118
118
|
};
|
|
119
|
-
}();
|
|
119
|
+
}(), [getFilterOptionsFn]);
|
|
120
120
|
var onSearch = useCallback(debounce(function (value) {
|
|
121
121
|
// console.log('onSearch', value);
|
|
122
122
|
fetchOptions(value);
|
|
123
|
-
}, 500), []);
|
|
123
|
+
}, 500), [fetchOptions]);
|
|
124
124
|
|
|
125
125
|
// 回显
|
|
126
126
|
useEffect(function () {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|