@arim-aisdc/public-components 2.3.96 → 2.3.97
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/components/BaseInfo/BaseInfo.d.ts +1 -1
- package/dist/components/CustomForm/CustomForm.js +97 -1
- package/dist/components/TableMax/TableHeader/Cell.js +1 -1
- package/dist/components/TableMax/TableMax.d.ts +0 -7
- package/dist/components/TableMax/TableMax.js +1 -8
- package/dist/components/TableMax/components/ColumnSetting/index.js +1 -1
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/components/Export/useTableExport.js +2 -9
- package/dist/components/TableMax/index.d.ts +1 -1
- package/dist/components/TableMax/index.js +1 -1
- package/dist/components/TableMax/type.d.ts +7 -0
- package/dist/components/TableMax/type.js +8 -0
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
|
|
|
17
17
|
value: any;
|
|
18
18
|
field: string;
|
|
19
19
|
label?: string;
|
|
20
|
-
text: string |
|
|
20
|
+
text: string | Element | JSX.Element;
|
|
21
21
|
units?: string;
|
|
22
22
|
width?: string;
|
|
23
23
|
labelWidth?: string;
|
|
@@ -16,7 +16,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
17
|
import { MinusOutlined } from '@ant-design/icons';
|
|
18
18
|
import { useDebounceFn } from 'ahooks';
|
|
19
|
-
import { AutoComplete, Badge, Button, Cascader, Checkbox, Col, DatePicker, Form, Input, InputNumber, Radio, Row, Select, Spin, Switch } from 'antd';
|
|
19
|
+
import { AutoComplete, Badge, Button, Cascader, Checkbox, Col, DatePicker, Form, Input, InputNumber, Radio, Row, Select, Spin, Switch, Tooltip } from 'antd';
|
|
20
20
|
import dayjs from 'dayjs';
|
|
21
21
|
import { debounce } from 'lodash';
|
|
22
22
|
import React, { forwardRef, useEffect, useMemo, useState } from 'react';
|
|
@@ -319,6 +319,38 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
319
319
|
maxTagCount: item.maxTagCount,
|
|
320
320
|
optionFilterProp: item.optionFilterProp || 'value',
|
|
321
321
|
optionLabelProp: item.optionLabelProp || 'children',
|
|
322
|
+
maxTagPlaceholder: item.maxTagPlaceholder || function (omittedValues) {
|
|
323
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
324
|
+
styles: {
|
|
325
|
+
root: {
|
|
326
|
+
pointerEvents: 'none'
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
title: omittedValues.map(function (_ref2) {
|
|
330
|
+
var label = _ref2.label;
|
|
331
|
+
if (typeof label === 'string' || typeof label === 'number') {
|
|
332
|
+
return String(label);
|
|
333
|
+
} else if ( /*#__PURE__*/React.isValidElement(label)) {
|
|
334
|
+
var _element = label;
|
|
335
|
+
var props = _element.props;
|
|
336
|
+
|
|
337
|
+
// 尝试提取文本
|
|
338
|
+
if ((props === null || props === void 0 ? void 0 : props.text) !== undefined) {
|
|
339
|
+
var text = props.text;
|
|
340
|
+
if (Array.isArray(text)) {
|
|
341
|
+
return text.join(', ');
|
|
342
|
+
}
|
|
343
|
+
return String(text);
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
return '';
|
|
347
|
+
}
|
|
348
|
+
}).join(', '),
|
|
349
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
350
|
+
children: ["+", omittedValues.length, "..."]
|
|
351
|
+
})
|
|
352
|
+
});
|
|
353
|
+
},
|
|
322
354
|
children: (item === null || item === void 0 ? void 0 : item.setting) && Array.isArray(item.setting) && ((_item$setting2 = item.setting) === null || _item$setting2 === void 0 ? void 0 : _item$setting2.map(function (el, num) {
|
|
323
355
|
var _el$options;
|
|
324
356
|
if (el !== null && el !== void 0 && el.options && (el === null || el === void 0 || (_el$options = el.options) === null || _el$options === void 0 ? void 0 : _el$options.length) > 0) {
|
|
@@ -579,6 +611,38 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
579
611
|
style: {
|
|
580
612
|
width: '100%'
|
|
581
613
|
},
|
|
614
|
+
maxTagPlaceholder: item.maxTagPlaceholder || function (omittedValues) {
|
|
615
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
616
|
+
styles: {
|
|
617
|
+
root: {
|
|
618
|
+
pointerEvents: 'none'
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
title: omittedValues.map(function (_ref3) {
|
|
622
|
+
var label = _ref3.label;
|
|
623
|
+
if (typeof label === 'string' || typeof label === 'number') {
|
|
624
|
+
return String(label);
|
|
625
|
+
} else if ( /*#__PURE__*/React.isValidElement(label)) {
|
|
626
|
+
var _element2 = label;
|
|
627
|
+
var props = _element2.props;
|
|
628
|
+
|
|
629
|
+
// 尝试提取文本
|
|
630
|
+
if ((props === null || props === void 0 ? void 0 : props.text) !== undefined) {
|
|
631
|
+
var text = props.text;
|
|
632
|
+
if (Array.isArray(text)) {
|
|
633
|
+
return text.join(', ');
|
|
634
|
+
}
|
|
635
|
+
return String(text);
|
|
636
|
+
}
|
|
637
|
+
} else {
|
|
638
|
+
return '';
|
|
639
|
+
}
|
|
640
|
+
}).join(', '),
|
|
641
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
642
|
+
children: ["+", omittedValues.length, "..."]
|
|
643
|
+
})
|
|
644
|
+
});
|
|
645
|
+
},
|
|
582
646
|
children: (item === null || item === void 0 ? void 0 : item.setting) && Array.isArray(item.setting) && item.setting.map(function (el, num) {
|
|
583
647
|
return /*#__PURE__*/_jsx(Option, {
|
|
584
648
|
value: el.value,
|
|
@@ -622,6 +686,38 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
622
686
|
style: {
|
|
623
687
|
width: '100%'
|
|
624
688
|
},
|
|
689
|
+
maxTagPlaceholder: item.maxTagPlaceholder || function (omittedValues) {
|
|
690
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
691
|
+
styles: {
|
|
692
|
+
root: {
|
|
693
|
+
pointerEvents: 'none'
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
title: omittedValues.map(function (_ref4) {
|
|
697
|
+
var label = _ref4.label;
|
|
698
|
+
if (typeof label === 'string' || typeof label === 'number') {
|
|
699
|
+
return String(label);
|
|
700
|
+
} else if ( /*#__PURE__*/React.isValidElement(label)) {
|
|
701
|
+
var _element3 = label;
|
|
702
|
+
var props = _element3.props;
|
|
703
|
+
|
|
704
|
+
// 尝试提取文本
|
|
705
|
+
if ((props === null || props === void 0 ? void 0 : props.text) !== undefined) {
|
|
706
|
+
var text = props.text;
|
|
707
|
+
if (Array.isArray(text)) {
|
|
708
|
+
return text.join(', ');
|
|
709
|
+
}
|
|
710
|
+
return String(text);
|
|
711
|
+
}
|
|
712
|
+
} else {
|
|
713
|
+
return '';
|
|
714
|
+
}
|
|
715
|
+
}).join(', '),
|
|
716
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
717
|
+
children: ["+", omittedValues.length, "..."]
|
|
718
|
+
})
|
|
719
|
+
});
|
|
720
|
+
},
|
|
625
721
|
children: item.setting1.map(function (el, num) {
|
|
626
722
|
return /*#__PURE__*/_jsx(Option, {
|
|
627
723
|
value: el.value,
|
|
@@ -20,7 +20,7 @@ import { Tooltip } from 'antd';
|
|
|
20
20
|
import { useMemo } from 'react';
|
|
21
21
|
import { useDrag, useDrop } from 'react-dnd';
|
|
22
22
|
import { useConfig } from "../../ConfigProvider";
|
|
23
|
-
import { ColumnType } from "../
|
|
23
|
+
import { ColumnType } from "../type";
|
|
24
24
|
import { ColumnFilter } from "../components/ColumnFilterV2";
|
|
25
25
|
import Sort from "../components/ColumnSort";
|
|
26
26
|
import "./index.less";
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './tableMax.less';
|
|
3
3
|
import { type TableMaxProps } from './type';
|
|
4
|
-
export declare enum ColumnType {
|
|
5
|
-
Selection = "selection-column",
|
|
6
|
-
Darg = "darg-column",
|
|
7
|
-
PlaceHolder = "placeholder-column",
|
|
8
|
-
Expander = "expander",
|
|
9
|
-
Index = "inner-index"
|
|
10
|
-
}
|
|
11
4
|
export type ColumnSizing = Record<string, number>;
|
|
12
5
|
export declare const CACHE_MAX_AGE: number;
|
|
13
6
|
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<TableMaxProps & React.RefAttributes<unknown>>>;
|
|
@@ -35,6 +35,7 @@ import customSortFns, { setDefaultSortFn } from "./components/ColumnSort/customS
|
|
|
35
35
|
import PaginationV2 from "./components/PaginationV2";
|
|
36
36
|
import { useColumnWidth } from "./hooks/useColumnWidth";
|
|
37
37
|
import "./tableMax.less";
|
|
38
|
+
import { ColumnType } from "./type";
|
|
38
39
|
import { downloadExcel, getFormatFilters, getFormatFiltersV2, getFormatSorting, operationColumnNoTooltips } from "./utils";
|
|
39
40
|
import { useTableScrollShadow } from "./hooks/useTableScrollShadow";
|
|
40
41
|
import { ExportTableData } from "./components/Export";
|
|
@@ -42,14 +43,6 @@ import UnifiedTable from "./UnifiedTable";
|
|
|
42
43
|
import { useHoverDetection } from "./hooks/useHoverDetection";
|
|
43
44
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
44
45
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
|
-
export var ColumnType = /*#__PURE__*/function (ColumnType) {
|
|
46
|
-
ColumnType["Selection"] = "selection-column";
|
|
47
|
-
ColumnType["Darg"] = "darg-column";
|
|
48
|
-
ColumnType["PlaceHolder"] = "placeholder-column";
|
|
49
|
-
ColumnType["Expander"] = "expander";
|
|
50
|
-
ColumnType["Index"] = "inner-index";
|
|
51
|
-
return ColumnType;
|
|
52
|
-
}({});
|
|
53
46
|
export var CACHE_MAX_AGE = 1 * 60 * 60 * 1000;
|
|
54
47
|
var getCurrentRouterName = function getCurrentRouterName() {
|
|
55
48
|
return window.location.pathname.slice(1);
|
|
@@ -14,7 +14,7 @@ import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 're
|
|
|
14
14
|
import { useDrag, useDrop } from 'react-dnd';
|
|
15
15
|
import { createPortal } from 'react-dom';
|
|
16
16
|
import { useConfig } from "../../../ConfigProvider";
|
|
17
|
-
import { ColumnType } from "../../
|
|
17
|
+
import { ColumnType } from "../../type";
|
|
18
18
|
import "./index.less";
|
|
19
19
|
import { useTranslation } from "../../../../hooks/useTranslation";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -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) => 1 | 0 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -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) => 1 | 0 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 1 | 0 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -16,14 +16,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
16
16
|
import { useCallback, useState, useRef } from 'react';
|
|
17
17
|
import * as XLSX from 'xlsx';
|
|
18
18
|
import { message } from 'antd';
|
|
19
|
-
|
|
20
|
-
ColumnType["Selection"] = "selection-column";
|
|
21
|
-
ColumnType["Drag"] = "darg-column";
|
|
22
|
-
ColumnType["PlaceHolder"] = "placeholder-column";
|
|
23
|
-
ColumnType["Expander"] = "expander";
|
|
24
|
-
ColumnType["Index"] = "inner-index";
|
|
25
|
-
return ColumnType;
|
|
26
|
-
}(ColumnType || {});
|
|
19
|
+
import { ColumnType } from "../../type";
|
|
27
20
|
var defaultApplyCellLogic = function defaultApplyCellLogic(value, columnId, originalRow, column) {
|
|
28
21
|
var cell = column.cell,
|
|
29
22
|
accessorKey = column.accessorKey,
|
|
@@ -65,7 +58,7 @@ var defaultApplyCellLogic = function defaultApplyCellLogic(value, columnId, orig
|
|
|
65
58
|
}
|
|
66
59
|
return value !== null && value !== void 0 ? value : '';
|
|
67
60
|
};
|
|
68
|
-
var EnableExportColumnTypeList = [ColumnType.Selection, ColumnType.
|
|
61
|
+
var EnableExportColumnTypeList = [ColumnType.Selection, ColumnType.Darg, ColumnType.PlaceHolder, ColumnType.Expander, ColumnType.Index];
|
|
69
62
|
function fetchWithRetry(_x) {
|
|
70
63
|
return _fetchWithRetry.apply(this, arguments);
|
|
71
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import TableMax from './TableMax';
|
|
2
|
-
export { ColumnType } from './
|
|
2
|
+
export { ColumnType } from './type';
|
|
3
3
|
export { InputType } from './components/ColumnEdit';
|
|
4
4
|
export { FilterType } from './components/ColumnFilterV2';
|
|
5
5
|
export type { FilterFnType } from './components/ColumnFilterV2';
|
|
@@ -5,6 +5,13 @@ import { InputType } from './components/ColumnEdit';
|
|
|
5
5
|
import { FilterFnType, FilterType } from './components/ColumnFilterV2';
|
|
6
6
|
import { SortFnType } from './components/ColumnSort/customSortFns';
|
|
7
7
|
import { ExportOptions } from './components/Export';
|
|
8
|
+
export declare enum ColumnType {
|
|
9
|
+
Selection = "selection-column",
|
|
10
|
+
Darg = "darg-column",
|
|
11
|
+
PlaceHolder = "placeholder-column",
|
|
12
|
+
Expander = "expander",
|
|
13
|
+
Index = "inner-index"
|
|
14
|
+
}
|
|
8
15
|
export type PrefixClsType = 'custom-light' | 'custom-dark';
|
|
9
16
|
export declare enum DropSide {
|
|
10
17
|
Top = "top",
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export var ColumnType = /*#__PURE__*/function (ColumnType) {
|
|
2
|
+
ColumnType["Selection"] = "selection-column";
|
|
3
|
+
ColumnType["Darg"] = "darg-column";
|
|
4
|
+
ColumnType["PlaceHolder"] = "placeholder-column";
|
|
5
|
+
ColumnType["Expander"] = "expander";
|
|
6
|
+
ColumnType["Index"] = "inner-index";
|
|
7
|
+
return ColumnType;
|
|
8
|
+
}({});
|
|
1
9
|
export var DropSide = /*#__PURE__*/function (DropSide) {
|
|
2
10
|
DropSide["Top"] = "top";
|
|
3
11
|
DropSide["Bottom"] = "bottom";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arim-aisdc/public-components",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.97",
|
|
4
4
|
"description": "前端组件库",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@ant-design/icons": "^5.3.7",
|
|
50
50
|
"@ant-design/pro-components": "^2.7.10",
|
|
51
|
-
"@arim-aisdc/public-components": "^2.3.
|
|
51
|
+
"@arim-aisdc/public-components": "^2.3.96",
|
|
52
52
|
"@tanstack/match-sorter-utils": "^8.8.4",
|
|
53
53
|
"@tanstack/react-table": "^8.9.1",
|
|
54
54
|
"@tanstack/react-virtual": "^3.13.12",
|