zmdms-webui 0.0.64 → 0.0.66
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/es/collapse/collapse.d.ts +7 -0
- package/dist/es/collapse/collapse.js +29 -0
- package/dist/es/collapse/index.d.ts +5 -0
- package/dist/es/collapse/index.js +5 -0
- package/dist/es/collapse/interface.d.ts +19 -0
- package/dist/es/config/constant.js +4 -2
- package/dist/es/container/container.js +1 -1
- package/dist/es/descriptions/descriptions.js +2 -1
- package/dist/es/descriptions/interface.d.ts +1 -0
- package/dist/es/detaillist/item.d.ts +2 -0
- package/dist/es/detaillist/item.js +4 -2
- package/dist/es/detaillist/list.d.ts +1 -0
- package/dist/es/detaillist/list.js +2 -1
- package/dist/es/differences/differences.d.ts +5 -0
- package/dist/es/differences/differences.js +22 -0
- package/dist/es/differences/index.d.ts +5 -0
- package/dist/es/differences/index.js +5 -0
- package/dist/es/differences/interface.d.ts +17 -0
- package/dist/es/leftcontent/leftContent.js +29 -24
- package/dist/es/placeholder/index.d.ts +5 -0
- package/dist/es/placeholder/index.js +5 -0
- package/dist/es/placeholder/interface.d.ts +12 -0
- package/dist/es/placeholder/placeholder.d.ts +5 -0
- package/dist/es/placeholder/placeholder.js +18 -0
- package/dist/es/select/select.js +1 -1
- package/dist/es/table/interface.d.ts +7 -0
- package/dist/es/table/table.js +17 -4
- package/dist/es/table/useColumns.js +3 -2
- package/dist/index.build.d.ts +4 -1
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/index.es.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { CollapseComponent, ICollapsePanelProps } from './interface.js';
|
|
3
|
+
|
|
4
|
+
declare const CollapsePanel: React__default.FC<ICollapsePanelProps>;
|
|
5
|
+
declare const MemoDifferences: CollapseComponent;
|
|
6
|
+
|
|
7
|
+
export { CollapsePanel, MemoDifferences as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { __rest, __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Collapse as Collapse$1 } from 'antd';
|
|
5
|
+
import classNames from '../node_modules/classnames/index.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 显示差异内容
|
|
9
|
+
*/
|
|
10
|
+
var Collapse = function (props) {
|
|
11
|
+
var className = props.className, _a = props.customBg, customBg = _a === void 0 ? true : _a, customPadding = props.customPadding, resetProps = __rest(props, ["className", "customBg", "customPadding"]);
|
|
12
|
+
var classes = classNames("ztxk-collapse", className, {
|
|
13
|
+
"ztxk-collapse--custom-background": customBg,
|
|
14
|
+
"ztxk-collapse--custom-padding": customPadding,
|
|
15
|
+
});
|
|
16
|
+
return (jsx(Collapse$1, __assign({ expandIconPosition: "end", className: classes }, resetProps)));
|
|
17
|
+
};
|
|
18
|
+
var CollapsePanel = function (_a) {
|
|
19
|
+
var hiddenBordered = _a.hiddenBordered, className = _a.className, resetProps = __rest(_a, ["hiddenBordered", "className"]);
|
|
20
|
+
var classes = classNames("ztxk-collapse--panel", className, {
|
|
21
|
+
"ztxk-collapse--panel-hidden-border": hiddenBordered,
|
|
22
|
+
});
|
|
23
|
+
return jsx(Collapse$1.Panel, __assign({ className: classes }, resetProps));
|
|
24
|
+
};
|
|
25
|
+
var MemoDifferences = memo(Collapse);
|
|
26
|
+
MemoDifferences.displayName = "ZTXK_WEBUI_Collapse";
|
|
27
|
+
MemoDifferences.Panel = CollapsePanel;
|
|
28
|
+
|
|
29
|
+
export { CollapsePanel, MemoDifferences as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { CollapsePanel } from './collapse.js';
|
|
3
|
+
import { CollapseProps, CollapsePanelProps } from 'antd/es/collapse';
|
|
4
|
+
|
|
5
|
+
interface ICollapseProps extends CollapseProps {
|
|
6
|
+
/** 背景 */
|
|
7
|
+
customBg?: boolean;
|
|
8
|
+
/** 内边距 */
|
|
9
|
+
customPadding?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface ICollapsePanelProps extends CollapsePanelProps {
|
|
12
|
+
hiddenBordered?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface CollapseComponent extends React__default.FC<ICollapseProps> {
|
|
15
|
+
displayName: string;
|
|
16
|
+
Panel: typeof CollapsePanel;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { CollapseComponent, ICollapsePanelProps, ICollapseProps };
|
|
@@ -19,7 +19,7 @@ var Container = function (props) {
|
|
|
19
19
|
var classes = classNames("ztxk-container__content", className, {
|
|
20
20
|
"ztxk-container__content--flex": isFlex,
|
|
21
21
|
});
|
|
22
|
-
return (jsxs("div", __assign({ className: "ztxk-container", ref: containerRef }, { children: [leftContent && (jsx(LeftContentMemo, __assign({ containerRef: containerRef, defaultLeftOpen: defaultLeftOpen, width: defaultLeftWidth }, { children: leftContent }))), jsx(ContainerLoading, { loading: loading }), jsx("div", __assign({ className: classes }, { children: children })), jsx(Footer, { footerDom: footerDom })] })));
|
|
22
|
+
return (jsxs("div", __assign({ className: "ztxk-container", ref: containerRef }, { children: [leftContent && (jsx(LeftContentMemo, __assign({ containerRef: containerRef, defaultLeftOpen: defaultLeftOpen, width: defaultLeftWidth, isShow: true }, { children: leftContent }))), jsx(ContainerLoading, { loading: loading }), jsx("div", __assign({ className: classes }, { children: children })), jsx(Footer, { footerDom: footerDom })] })));
|
|
23
23
|
};
|
|
24
24
|
var ContainerButtonWrap = memo(function (_a) {
|
|
25
25
|
var children = _a.children, isMarginTop = _a.isMarginTop, className = _a.className, style = _a.style;
|
|
@@ -11,6 +11,7 @@ var Descriptions = function (props) {
|
|
|
11
11
|
};
|
|
12
12
|
var DescriptionsCom = Descriptions;
|
|
13
13
|
DescriptionsCom.displayName = "ZTXK_WEBUI_Descriptions";
|
|
14
|
-
DescriptionsCom.Item = Descriptions$1.Item;
|
|
14
|
+
DescriptionsCom.Item = Descriptions$1.Item;
|
|
15
|
+
DescriptionsCom.DifferencesClassName = "ztxk-descriptions--differences";
|
|
15
16
|
|
|
16
17
|
export { DescriptionsCom as default };
|
|
@@ -6,6 +6,7 @@ interface IDescriptionsProps extends DescriptionsProps {
|
|
|
6
6
|
interface DescriptionsComponent extends React__default.FC<IDescriptionsProps> {
|
|
7
7
|
Item: typeof Descriptions.Item;
|
|
8
8
|
displayName: string;
|
|
9
|
+
DifferencesClassName: string;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export { DescriptionsComponent, IDescriptionsProps };
|
|
@@ -4,8 +4,10 @@ import classNames from '../node_modules/classnames/index.js';
|
|
|
4
4
|
import { Col } from 'antd';
|
|
5
5
|
|
|
6
6
|
var Item = function (_a) {
|
|
7
|
-
var children = _a.children, className = _a.className, title = _a.title, _b = _a.colon, colon = _b === void 0 ? true : _b, span = _a.span, titleSpan = _a.titleSpan, titleProps = _a.titleProps, textProps = _a.textProps, showDiff = _a.showDiff, _c = _a.isEllipsis, isEllipsis = _c === void 0 ? true : _c, isBlod = _a.isBlod;
|
|
8
|
-
var classes = classNames("ztxk-grid-item", className
|
|
7
|
+
var children = _a.children, className = _a.className, title = _a.title, _b = _a.colon, colon = _b === void 0 ? true : _b, span = _a.span, titleSpan = _a.titleSpan, titleProps = _a.titleProps, textProps = _a.textProps, showDiff = _a.showDiff, _c = _a.isEllipsis, isEllipsis = _c === void 0 ? true : _c, isBlod = _a.isBlod, isFlex = _a.isFlex;
|
|
8
|
+
var classes = classNames("ztxk-grid-item", className, {
|
|
9
|
+
"ztxk-grid-item--flex": isFlex,
|
|
10
|
+
});
|
|
9
11
|
return (jsxs(Fragment, { children: [jsxs(Col, __assign({ className: classes + " ztxk-grid-item--title",
|
|
10
12
|
// span={titleSpan ? titleSpan : Math.ceil(span * 0.3)}
|
|
11
13
|
span: titleSpan ? titleSpan : 3, title: title }, titleProps, { children: [jsx("span", __assign({ className: "ztxk-grid-item--title-text" }, { children: title })), jsx("span", __assign({ className: "ztxk-grid-item--title-colon" }, { children: colon && ":" }))] })), jsx(Col, __assign({ className: showDiff
|
|
@@ -5,10 +5,11 @@ import Item from './item.js';
|
|
|
5
5
|
import { Row } from 'antd';
|
|
6
6
|
|
|
7
7
|
var List = function (_a) {
|
|
8
|
-
var children = _a.children, className = _a.className, border = _a.border, isBg = _a.isBg, restProps = __rest(_a, ["children", "className", "border", "isBg"]);
|
|
8
|
+
var children = _a.children, className = _a.className, border = _a.border, isBg = _a.isBg, isFlex = _a.isFlex, restProps = __rest(_a, ["children", "className", "border", "isBg", "isFlex"]);
|
|
9
9
|
var classes = classNames("ztxk-grid", className, {
|
|
10
10
|
"ztxk-grid--border": border,
|
|
11
11
|
"ztxk-grid--background": isBg,
|
|
12
|
+
"ztxk-grid--flex": isFlex,
|
|
12
13
|
});
|
|
13
14
|
return (jsx(Row, __assign({ className: classes }, restProps, { gutter: 0 }, { children: children })));
|
|
14
15
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import classNames from '../node_modules/classnames/index.js';
|
|
5
|
+
import { PLACEHOLDER_NULL } from '../config/constant.js';
|
|
6
|
+
import { Tooltip } from 'antd';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 显示差异内容
|
|
10
|
+
*/
|
|
11
|
+
var Differences = function (_a) {
|
|
12
|
+
var children = _a.children, describe = _a.describe, preValue = _a.preValue, currentValue = _a.currentValue, className = _a.className;
|
|
13
|
+
var classes = classNames("ztxk-differences", className, {});
|
|
14
|
+
var title = describe
|
|
15
|
+
? describe
|
|
16
|
+
: "\u53D8\u66F4\u524D\u7684\u503C\uFF1A".concat(preValue || PLACEHOLDER_NULL, " \n\u5F53\u524D\u503C\uFF1A").concat(currentValue || PLACEHOLDER_NULL);
|
|
17
|
+
return (jsx(Tooltip, __assign({ className: classes, title: title }, { children: children })));
|
|
18
|
+
};
|
|
19
|
+
var MemoDifferences = memo(Differences);
|
|
20
|
+
MemoDifferences.displayName = "ZTXK_WEBUI_Differences";
|
|
21
|
+
|
|
22
|
+
export { MemoDifferences as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface IDifferencesProps {
|
|
4
|
+
children?: React__default.ReactNode;
|
|
5
|
+
/** 自定义描述 */
|
|
6
|
+
describe?: string;
|
|
7
|
+
/** 之前的值 */
|
|
8
|
+
preValue?: any;
|
|
9
|
+
/** 现在的值 */
|
|
10
|
+
currentValue?: any;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
interface DifferencesComponent extends React__default.FC<IDifferencesProps> {
|
|
14
|
+
displayName: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { DifferencesComponent, IDifferencesProps };
|
|
@@ -22,41 +22,46 @@ var LeftContent = function (_a, ref) {
|
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
if (!changeDomRef.current) {
|
|
25
|
-
var containerDom = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
26
|
-
// 如果没有传入需要改变宽度的容器 那么默认取下一个兄弟节点
|
|
27
|
-
if (!containerDom) {
|
|
28
|
-
containerDom = (_a = currentRef.current) === null || _a === void 0 ? void 0 : _a.nextElementSibling;
|
|
29
|
-
}
|
|
30
|
-
if (!containerDom) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
25
|
// 如果找到指定元素 是否终止
|
|
34
26
|
var isReture = true;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (containerDom.classList.contains(changeSizeClassName[i])) {
|
|
39
|
-
isReture = false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
27
|
+
var containerDom = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current;
|
|
28
|
+
if (containerDom) {
|
|
29
|
+
isReture = false;
|
|
42
30
|
}
|
|
43
31
|
else {
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
// 如果没有传入需要改变宽度的容器 那么默认取下一个兄弟节点
|
|
33
|
+
if (!containerDom) {
|
|
34
|
+
containerDom = (_a = currentRef.current) === null || _a === void 0 ? void 0 : _a.nextElementSibling;
|
|
46
35
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (Array.isArray(
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
if (!containerDom) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (Array.isArray(changeSizeClassName)) {
|
|
40
|
+
for (var i = 0; i < changeSizeClassName.length; i++) {
|
|
41
|
+
// 如果包含这个类名
|
|
42
|
+
if (containerDom.classList.contains(changeSizeClassName[i])) {
|
|
43
|
+
isReture = false;
|
|
44
|
+
}
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
47
|
else {
|
|
56
|
-
if (
|
|
48
|
+
if (containerDom.classList.contains(changeSizeClassName)) {
|
|
57
49
|
isReture = false;
|
|
58
50
|
}
|
|
59
51
|
}
|
|
52
|
+
if (isReture) {
|
|
53
|
+
var id = (_b = containerDom === null || containerDom === void 0 ? void 0 : containerDom.getAttribute) === null || _b === void 0 ? void 0 : _b.call(containerDom, "id");
|
|
54
|
+
if (Array.isArray(changeSizeId)) {
|
|
55
|
+
if (changeSizeId.includes(id)) {
|
|
56
|
+
isReture = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (changeSizeId === id) {
|
|
61
|
+
isReture = false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
if (isReture) {
|
|
62
67
|
return;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface IPlaceholderProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React__default.ReactNode;
|
|
6
|
+
style?: React__default.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
interface PlaceholderComponent extends React__default.FC<IPlaceholderProps> {
|
|
9
|
+
displayName: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { IPlaceholderProps, PlaceholderComponent };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import classNames from '../node_modules/classnames/index.js';
|
|
5
|
+
import { PLACEHOLDER_NULL } from '../config/constant.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 显示差异内容
|
|
9
|
+
*/
|
|
10
|
+
var Placeholder = function (_a) {
|
|
11
|
+
var children = _a.children, className = _a.className, style = _a.style;
|
|
12
|
+
var classes = classNames("ztxk-placeholder", className, {});
|
|
13
|
+
return children ? (jsx("div", __assign({ style: style, className: classes }, { children: children }))) : (jsx(Fragment, { children: PLACEHOLDER_NULL }));
|
|
14
|
+
};
|
|
15
|
+
var MemoPlaceholder = memo(Placeholder);
|
|
16
|
+
MemoPlaceholder.displayName = "ZTXK_WEBUI_Placeholder";
|
|
17
|
+
|
|
18
|
+
export { MemoPlaceholder as default };
|
package/dist/es/select/select.js
CHANGED
|
@@ -101,7 +101,7 @@ var Select = function (props, ref) {
|
|
|
101
101
|
var text = textContent(option === null || option === void 0 ? void 0 : option.children);
|
|
102
102
|
return (text === null || text === void 0 ? void 0 : text.toLowerCase().indexOf(input.toLowerCase().trim())) >= 0;
|
|
103
103
|
};
|
|
104
|
-
return (jsx(Select$1, __assign({ defaultValue: showAll ? "" : undefined, showArrow: true, dropdownMatchSelectWidth: dropdownMatchSelectWidth, onChange: onChangeHandle, showSearch: true, onSearch: onDebounceSearchHandle, filterOption: isRemoteSearch ? false : filterOptionHandle, dropdownRender: dropdownRender
|
|
104
|
+
return (jsx(Select$1, __assign({ defaultValue: showAll ? "" : undefined, showArrow: true, allowClear: true, dropdownMatchSelectWidth: dropdownMatchSelectWidth, onChange: onChangeHandle, showSearch: true, onSearch: onDebounceSearchHandle, filterOption: isRemoteSearch ? false : filterOptionHandle, dropdownRender: dropdownRender
|
|
105
105
|
? dropdownRender
|
|
106
106
|
: dropdownButton
|
|
107
107
|
? dropdownButtonHandle
|
|
@@ -206,6 +206,12 @@ interface ITableProps<RecordType> extends Omit<TableProps<RecordType>, "columns"
|
|
|
206
206
|
* 如果开启服务端排序,那么前端这边不做排序处理,只返回设置的字段
|
|
207
207
|
*/
|
|
208
208
|
serviceOrder?: (order: IOrder) => void;
|
|
209
|
+
/**
|
|
210
|
+
* 标明需要展示的差异数组
|
|
211
|
+
* 可以传入需要展示的差异行索引 [2,4,5]
|
|
212
|
+
* 也可以传入一个函数
|
|
213
|
+
*/
|
|
214
|
+
differences?: number[] | ((record: any, index: number) => boolean);
|
|
209
215
|
}
|
|
210
216
|
interface IFields {
|
|
211
217
|
/**
|
|
@@ -252,6 +258,7 @@ interface TableComponent<T> extends React.FC<ITableProps<T>> {
|
|
|
252
258
|
ColumnGroup: typeof Table.ColumnGroup;
|
|
253
259
|
Summary: typeof Table.Summary;
|
|
254
260
|
TitleDirectionColumn: typeof _default;
|
|
261
|
+
DifferencesClassName: string;
|
|
255
262
|
}
|
|
256
263
|
/**
|
|
257
264
|
* 排序相关类型
|
package/dist/es/table/table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __rest, __awaiter, __assign, __generator } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { memo, useRef, useEffect, useMemo, useImperativeHandle } from 'react';
|
|
3
|
+
import { memo, useRef, useEffect, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
4
4
|
import { Table as Table$1 } from 'antd';
|
|
5
5
|
import { BasicRow, MoveRow } from './components/EnhanceRow.js';
|
|
6
6
|
import EnhanceCell from './components/EnhanceCell.js';
|
|
@@ -30,7 +30,7 @@ import { DndProvider } from '../node_modules/react-dnd/dist/core/DndProvider.js'
|
|
|
30
30
|
// TODO: 实现表头自定义伸缩
|
|
31
31
|
var Table = function (props) {
|
|
32
32
|
// console.log("表格渲染");
|
|
33
|
-
var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, _c = props.isDelAll, isDelAll = _c === void 0 ? true : _c, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _d = props.summaryFixed, summaryFixed = _d === void 0 ? true : _d, isInnerPagination = props.isInnerPagination, _e = props.innerPaginationPageSize, innerPaginationPageSize = _e === void 0 ? 30 : _e, _f = props.innerPaginationPosition, innerPaginationPosition = _f === void 0 ? INNER_TABLE_PAGINATION_POSITION : _f, _g = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _g === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _g, tableRefHandle = props.tableRefHandle, tableName = props.tableName, serviceOrder = props.serviceOrder, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "addMode", "addCallback", "isDel", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "tableRefHandle", "tableName", "serviceOrder"]);
|
|
33
|
+
var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, _c = props.isDelAll, isDelAll = _c === void 0 ? true : _c, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _d = props.summaryFixed, summaryFixed = _d === void 0 ? true : _d, isInnerPagination = props.isInnerPagination, _e = props.innerPaginationPageSize, innerPaginationPageSize = _e === void 0 ? 30 : _e, _f = props.innerPaginationPosition, innerPaginationPosition = _f === void 0 ? INNER_TABLE_PAGINATION_POSITION : _f, _g = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _g === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _g, tableRefHandle = props.tableRefHandle, tableName = props.tableName, serviceOrder = props.serviceOrder, differences = props.differences, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "addMode", "addCallback", "isDel", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "tableRefHandle", "tableName", "serviceOrder", "differences"]);
|
|
34
34
|
var classes = classNames("ztxk-table", className, {
|
|
35
35
|
"ztxk-table--flex": isFlex,
|
|
36
36
|
});
|
|
@@ -126,6 +126,18 @@ var Table = function (props) {
|
|
|
126
126
|
}
|
|
127
127
|
return components;
|
|
128
128
|
}, [isEdit, isMove]);
|
|
129
|
+
// 展示差异的行类方法
|
|
130
|
+
var rowClassName = useCallback(function (record, index) {
|
|
131
|
+
if (Array.isArray(differences) && differences.includes(index)) {
|
|
132
|
+
return MemoTable.DifferencesClassName;
|
|
133
|
+
}
|
|
134
|
+
if (typeof differences === "function") {
|
|
135
|
+
return differences(record, index)
|
|
136
|
+
? MemoTable.DifferencesClassName
|
|
137
|
+
: undefined;
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
}, [differences]);
|
|
129
141
|
// 暴露给外部一些方法
|
|
130
142
|
useImperativeHandle(tableRefHandle, function () {
|
|
131
143
|
return {
|
|
@@ -165,7 +177,7 @@ var Table = function (props) {
|
|
|
165
177
|
? pagination
|
|
166
178
|
? pagination
|
|
167
179
|
: paginationConfig
|
|
168
|
-
: pagination }, resetProps)));
|
|
180
|
+
: pagination, rowClassName: rowClassName }, resetProps)));
|
|
169
181
|
return (jsxs("div", __assign({ style: isFlex
|
|
170
182
|
? { position: "relative", overflow: "hidden", flex: 1 }
|
|
171
183
|
: { position: "relative", overflow: "hidden" }, ref: tableRef }, { children: [isMove ? (jsx(DndProvider, __assign({ backend: HTML5Backend, context: window }, { children: SingleTable }))) : (SingleTable), dynamicKey ? (jsx(DynamicSetting, { parentDynamicKey: TABLE_DYNAMIC_KEY, dynamicKey: dynamicKey, defaultList: defaultDynamicList, onCurrentListChange: onCurrentListChange, ref: dynamicSettingRef, hiddenOperationIcon: true })) : null] })));
|
|
@@ -180,6 +192,7 @@ MemoTable.SELECTION_NONE = Table$1.SELECTION_NONE;
|
|
|
180
192
|
MemoTable.Column = Table$1.Column;
|
|
181
193
|
MemoTable.ColumnGroup = Table$1.ColumnGroup;
|
|
182
194
|
MemoTable.Summary = Table$1.Summary;
|
|
183
|
-
MemoTable.TitleDirectionColumn = TitleDirectionColumn;
|
|
195
|
+
MemoTable.TitleDirectionColumn = TitleDirectionColumn;
|
|
196
|
+
MemoTable.DifferencesClassName = "ztxk-table--differences";
|
|
184
197
|
|
|
185
198
|
export { MemoTable as default };
|
|
@@ -7,6 +7,7 @@ import ColumnDynamic from './components/ColumnDynamic.js';
|
|
|
7
7
|
import ColumnAddDel, { ColumnDelAll } from './components/ColumnAddDel.js';
|
|
8
8
|
import TitleOperation from './components/TitleOperation.js';
|
|
9
9
|
import SortTitle from './components/SortTitle.js';
|
|
10
|
+
import { PLACEHOLDER_NULL } from '../config/constant.js';
|
|
10
11
|
|
|
11
12
|
// 处理columns
|
|
12
13
|
// 根据传入的一些信息 重新生成新的columns配置
|
|
@@ -74,9 +75,9 @@ function useColumns(columns, options) {
|
|
|
74
75
|
if (!_column.render && !_column.editable) {
|
|
75
76
|
_column.render = function (text, record, index) {
|
|
76
77
|
if (typeof text === "object") {
|
|
77
|
-
return
|
|
78
|
+
return PLACEHOLDER_NULL;
|
|
78
79
|
}
|
|
79
|
-
return text == null || text === "" ?
|
|
80
|
+
return text == null || text === "" ? PLACEHOLDER_NULL : text;
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
myNewColumns.push(_column);
|
package/dist/index.build.d.ts
CHANGED
|
@@ -32,7 +32,10 @@ export { default as Title } from './es/title/title.js';
|
|
|
32
32
|
export { default as Print } from './es/print/print.js';
|
|
33
33
|
export { default as Tag } from './es/tag/tag.js';
|
|
34
34
|
export { default as LeftContent } from './es/leftcontent/leftContent.js';
|
|
35
|
-
export {
|
|
35
|
+
export { default as Differences } from './es/differences/differences.js';
|
|
36
|
+
export { default as Collapse } from './es/collapse/collapse.js';
|
|
37
|
+
export { default as Placeholder } from './es/placeholder/placeholder.js';
|
|
38
|
+
export { Affix, Alert, Anchor, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, Card, Carousel, Cascader, Checkbox, Col, Comment, ConfigProvider, Divider, Drawer, Dropdown, Empty, Grid, Image, Layout, List, Mentions, Menu, PageHeader, Popconfirm, Popover, Progress, Radio, Rate, Result, Row, Segmented, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Timeline, Tooltip, Transfer, Typography, Upload, message, notification } from 'antd';
|
|
36
39
|
export { IModalOpenOptions, IModalProps, IModalRef } from './es/modal/interface.js';
|
|
37
40
|
export { IFooterDom, IFooterProps } from './es/footer/interface.js';
|
|
38
41
|
export { IColumnsType, ITableProps } from './es/table/interface.js';
|