@zat-design/sisyphus-react 3.6.10 → 3.7.0-beta.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.
Files changed (77) hide show
  1. package/dist/index.esm.css +52 -54
  2. package/dist/less.esm.css +52 -54
  3. package/es/ProEditTable/components/RenderField/ListChanged.d.ts +16 -0
  4. package/es/ProEditTable/components/RenderField/ListChanged.js +124 -0
  5. package/es/ProEditTable/components/RenderField/index.js +27 -46
  6. package/es/ProEditTable/style/index.less +2 -1
  7. package/es/ProEditTable/utils/index.d.ts +1 -1
  8. package/es/ProEditTable/utils/index.js +19 -13
  9. package/es/ProEditTable/utils/tools.d.ts +6 -0
  10. package/es/ProEditTable/utils/tools.js +15 -2
  11. package/es/ProEnum/hooks/useEnumRequest.js +3 -0
  12. package/es/ProEnum/utils/index.js +1 -1
  13. package/es/ProForm/components/combination/FormList/components/BlockFields.js +4 -2
  14. package/es/ProForm/components/combination/FormList/components/LineFields.js +4 -1
  15. package/es/ProForm/components/combination/FormList/utils.d.ts +1 -0
  16. package/es/ProForm/components/combination/FormList/utils.js +13 -0
  17. package/es/ProForm/components/combination/ProCascader/index.js +8 -14
  18. package/es/ProForm/components/render/Changed.d.ts +14 -0
  19. package/es/ProForm/components/render/Changed.js +64 -0
  20. package/es/ProForm/components/render/Render.js +17 -37
  21. package/es/ProForm/style/index.less +52 -52
  22. package/es/ProForm/utils/diffOriginal.d.ts +0 -1
  23. package/es/ProForm/utils/diffOriginal.js +4 -27
  24. package/es/ProForm/utils/useChanged.js +1 -2
  25. package/es/ProForm/utils/useListChanged.js +3 -3
  26. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +3 -1
  27. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +108 -41
  28. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +14 -1
  29. package/es/ProTable/index.js +6 -2
  30. package/es/ProTable/propsType.d.ts +22 -0
  31. package/es/ProTable/style/index.less +27 -32
  32. package/es/ProThemeTools/component/{PrdTools → ProTools}/index.d.ts +2 -2
  33. package/es/ProThemeTools/component/{PrdTools → ProTools}/index.js +2 -2
  34. package/es/ProThemeTools/component/index.d.ts +1 -2
  35. package/es/ProThemeTools/component/index.js +1 -2
  36. package/es/ProThemeTools/index.js +2 -2
  37. package/es/ProThemeTools/style/index.less +1 -1
  38. package/es/ProTreeModal/components/List.js +30 -4
  39. package/lib/ProEditTable/components/RenderField/ListChanged.d.ts +16 -0
  40. package/lib/ProEditTable/components/RenderField/ListChanged.js +129 -0
  41. package/lib/ProEditTable/components/RenderField/index.js +26 -41
  42. package/lib/ProEditTable/style/index.less +2 -1
  43. package/lib/ProEditTable/utils/index.d.ts +1 -1
  44. package/lib/ProEditTable/utils/index.js +17 -11
  45. package/lib/ProEditTable/utils/tools.d.ts +6 -0
  46. package/lib/ProEditTable/utils/tools.js +15 -1
  47. package/lib/ProEnum/hooks/useEnumRequest.js +3 -0
  48. package/lib/ProEnum/utils/index.js +1 -1
  49. package/lib/ProForm/components/combination/FormList/components/BlockFields.js +5 -2
  50. package/lib/ProForm/components/combination/FormList/components/LineFields.js +4 -1
  51. package/lib/ProForm/components/combination/FormList/utils.d.ts +1 -0
  52. package/lib/ProForm/components/combination/FormList/utils.js +15 -1
  53. package/lib/ProForm/components/combination/ProCascader/index.js +6 -12
  54. package/lib/ProForm/components/render/Changed.d.ts +14 -0
  55. package/lib/ProForm/components/render/Changed.js +69 -0
  56. package/lib/ProForm/components/render/Render.js +17 -35
  57. package/lib/ProForm/style/index.less +52 -52
  58. package/lib/ProForm/utils/diffOriginal.d.ts +0 -1
  59. package/lib/ProForm/utils/diffOriginal.js +3 -27
  60. package/lib/ProForm/utils/useChanged.js +1 -2
  61. package/lib/ProForm/utils/useListChanged.js +2 -2
  62. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +3 -1
  63. package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +108 -41
  64. package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +13 -1
  65. package/lib/ProTable/index.js +6 -2
  66. package/lib/ProTable/propsType.d.ts +22 -0
  67. package/lib/ProTable/style/index.less +27 -32
  68. package/lib/ProThemeTools/component/{PrdTools → ProTools}/index.d.ts +2 -2
  69. package/lib/ProThemeTools/component/{PrdTools → ProTools}/index.js +2 -2
  70. package/lib/ProThemeTools/component/index.d.ts +1 -2
  71. package/lib/ProThemeTools/component/index.js +3 -3
  72. package/lib/ProThemeTools/index.js +1 -1
  73. package/lib/ProThemeTools/style/index.less +1 -1
  74. package/lib/ProTreeModal/components/List.js +30 -4
  75. package/package.json +1 -1
  76. /package/es/ProThemeTools/component/{PrdTools → ProTools}/style/index.less +0 -0
  77. /package/lib/ProThemeTools/component/{PrdTools → ProTools}/style/index.less +0 -0
@@ -1,3 +1,5 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
1
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
5
  var _excluded = ["disabled", "children"];
@@ -6,6 +8,7 @@ import React from 'react';
6
8
  import { DndContext, closestCorners } from '@dnd-kit/core';
7
9
  import { arrayMove, useSortable, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
8
10
  import { CSS } from '@dnd-kit/utilities';
11
+ import { isFunction } from 'lodash';
9
12
  import { addLevelAndParentId, treeNodeFind, transformTreeToArray, createTreeFromArray } from './utils/index';
10
13
  import ProIcon from '../../../../../../../ProIcon';
11
14
  export var Row = function Row(props) {
@@ -67,55 +70,119 @@ var DndWrapper = function DndWrapper(_ref2) {
67
70
  onChange = _ref2.onChange,
68
71
  disabled = _ref2.disabled,
69
72
  children = _ref2.children,
70
- rowKey = _ref2.rowKey;
71
- var onDragEnd = function onDragEnd(_ref3) {
72
- var active = _ref3.active,
73
- over = _ref3.over;
74
- // 为数据源划分层级及parentId
75
- var transformedValue = addLevelAndParentId(value, rowKey);
76
- // 同一level层级的且parentId相同的,可以互相之间拖拽替换
77
- if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
78
- var activeObject = treeNodeFind(transformedValue, function (t) {
79
- return t.rowKey === active.id;
80
- });
81
- var overObject = treeNodeFind(transformedValue, function (t) {
82
- return t.rowKey === (over === null || over === void 0 ? void 0 : over.id);
83
- });
84
- if (activeObject && overObject) {
85
- var activeLevel = activeObject.level,
86
- activeParentId = activeObject.parentId;
87
- var overLevel = overObject.level,
88
- overParentId = overObject.parentId;
89
- if (activeLevel === overLevel && activeParentId === overParentId) {
90
- // 将树平铺
91
- var _flatTree = transformTreeToArray(transformedValue).map(function (item) {
92
- return _objectSpread(_objectSpread({}, item), {}, {
93
- children: undefined
73
+ rowKey = _ref2.rowKey,
74
+ onDragStartGuard = _ref2.onDragStartGuard,
75
+ onDragEndGuard = _ref2.onDragEndGuard;
76
+ var onDragStart = /*#__PURE__*/function () {
77
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
78
+ var active, _transformedValue, activeObject;
79
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
80
+ while (1) switch (_context.prev = _context.next) {
81
+ case 0:
82
+ active = _ref3.active;
83
+ if (!(onDragStartGuard && isFunction(onDragStartGuard))) {
84
+ _context.next = 6;
85
+ break;
86
+ }
87
+ // 为数据源划分层级及parentId
88
+ _transformedValue = addLevelAndParentId(value, rowKey);
89
+ activeObject = treeNodeFind(_transformedValue, function (t) {
90
+ return t.rowKey === active.id;
94
91
  });
95
- });
96
- var activeIndex = _flatTree.findIndex(function (i) {
97
- return i.rowKey === active.id;
98
- });
99
- var overIndex = _flatTree.findIndex(function (i) {
100
- return i.rowKey === (over === null || over === void 0 ? void 0 : over.id);
101
- });
102
- var nextValue = arrayMove(_flatTree, activeIndex, overIndex);
103
- onChange(createTreeFromArray(nextValue, {
104
- itemKey: 'rowKey',
105
- parentKey: 'parentId',
106
- childrenKey: 'children'
107
- }));
92
+ _context.next = 6;
93
+ return onDragStartGuard({
94
+ activeObject: activeObject,
95
+ currentDataSource: value
96
+ });
97
+ case 6:
98
+ case "end":
99
+ return _context.stop();
108
100
  }
109
- }
110
- }
111
- };
101
+ }, _callee);
102
+ }));
103
+ return function onDragStart(_x) {
104
+ return _ref4.apply(this, arguments);
105
+ };
106
+ }();
107
+ var onDragEnd = /*#__PURE__*/function () {
108
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
109
+ var active, over, transformedValue, activeObject, overObject, activeLevel, activeParentId, overLevel, overParentId, nextDataSource, _flatTree, activeIndex, overIndex, nextValue;
110
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
111
+ while (1) switch (_context2.prev = _context2.next) {
112
+ case 0:
113
+ active = _ref5.active, over = _ref5.over;
114
+ // 为数据源划分层级及parentId
115
+ transformedValue = addLevelAndParentId(value, rowKey); // 同一level层级的且parentId相同的,可以互相之间拖拽替换
116
+ if (!(active.id !== (over === null || over === void 0 ? void 0 : over.id))) {
117
+ _context2.next = 15;
118
+ break;
119
+ }
120
+ activeObject = treeNodeFind(transformedValue, function (t) {
121
+ return t.rowKey === active.id;
122
+ });
123
+ overObject = treeNodeFind(transformedValue, function (t) {
124
+ return t.rowKey === (over === null || over === void 0 ? void 0 : over.id);
125
+ });
126
+ if (!(activeObject && overObject)) {
127
+ _context2.next = 15;
128
+ break;
129
+ }
130
+ activeLevel = activeObject.level, activeParentId = activeObject.parentId;
131
+ overLevel = overObject.level, overParentId = overObject.parentId; // 如果传了onDragEndGuard 则视为外部业务逻辑自处理
132
+ if (!(onDragEndGuard && isFunction(onDragEndGuard))) {
133
+ _context2.next = 14;
134
+ break;
135
+ }
136
+ _context2.next = 11;
137
+ return onDragEndGuard({
138
+ activeObject: activeObject,
139
+ overObject: overObject,
140
+ currentDataSource: value
141
+ });
142
+ case 11:
143
+ nextDataSource = _context2.sent;
144
+ onChange(nextDataSource !== null && nextDataSource !== void 0 ? nextDataSource : []);
145
+ return _context2.abrupt("return");
146
+ case 14:
147
+ if (activeLevel === overLevel && activeParentId === overParentId) {
148
+ // 将树平铺
149
+ _flatTree = transformTreeToArray(transformedValue).map(function (item) {
150
+ return _objectSpread(_objectSpread({}, item), {}, {
151
+ children: undefined
152
+ });
153
+ });
154
+ activeIndex = _flatTree.findIndex(function (i) {
155
+ return i.rowKey === active.id;
156
+ });
157
+ overIndex = _flatTree.findIndex(function (i) {
158
+ return i.rowKey === (over === null || over === void 0 ? void 0 : over.id);
159
+ });
160
+ nextValue = arrayMove(_flatTree, activeIndex, overIndex);
161
+ onChange(createTreeFromArray(nextValue, {
162
+ itemKey: 'rowKey',
163
+ parentKey: 'parentId',
164
+ childrenKey: 'children'
165
+ }));
166
+ }
167
+ case 15:
168
+ case "end":
169
+ return _context2.stop();
170
+ }
171
+ }, _callee2);
172
+ }));
173
+ return function onDragEnd(_x2) {
174
+ return _ref6.apply(this, arguments);
175
+ };
176
+ }();
177
+ var transformedValue = addLevelAndParentId(value, rowKey);
112
178
  // 将树平铺
113
- var flatTree = transformTreeToArray(value).map(function (item) {
179
+ var flatTree = transformTreeToArray(transformedValue).map(function (item) {
114
180
  return _objectSpread(_objectSpread({}, item), {}, {
115
181
  children: undefined
116
182
  });
117
183
  });
118
184
  return draggable && !disabled ? _jsx(DndContext, {
185
+ onDragStart: onDragStart,
119
186
  onDragEnd: onDragEnd,
120
187
  collisionDetection: closestCorners,
121
188
  children: _jsx(SortableContext, {
@@ -4,6 +4,15 @@ import _Table from "antd/es/table";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["dataSource", "tableProps", "draggableProps", "summaryProps", "emptyTextProps"];
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ /*
8
+ * @Author: za-xuwenli xuwenli@zhongan.io
9
+ * @Date: 2024-08-09 13:48:59
10
+ * @LastEditors: za-xuwenli xuwenli@zhongan.io
11
+ * @LastEditTime: 2024-08-20 19:31:24
12
+ * @FilePath: /za-material-warehouse/src/ProTable/components/RcTable/components/DraggableTable/index.tsx
13
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
14
+ */
15
+
7
16
  import { memo } from 'react';
8
17
  import DndWrapper, { Row } from './components/DndWrapper';
9
18
  import { RenderEmptyText, RenderSummary } from '../../../index';
@@ -21,13 +30,17 @@ var DraggableTable = function DraggableTable(_ref) {
21
30
  disabled = tableProps.disabled;
22
31
  var onChange = draggableProps.onChange,
23
32
  draggable = draggableProps.draggable,
24
- rowKey = draggableProps.rowKey;
33
+ rowKey = draggableProps.rowKey,
34
+ onDragStartGuard = draggableProps.onDragStartGuard,
35
+ onDragEndGuard = draggableProps.onDragEndGuard;
25
36
  return _jsx(DndWrapper, {
26
37
  value: dataSource !== null && dataSource !== void 0 ? dataSource : [],
27
38
  onChange: onChange,
28
39
  disabled: disabled,
29
40
  draggable: draggable,
30
41
  rowKey: rowKey,
42
+ onDragStartGuard: onDragStartGuard,
43
+ onDragEndGuard: onDragEndGuard,
31
44
  children: _jsx(_Table, _objectSpread(_objectSpread({
32
45
  className: "pro-edit-table-drag",
33
46
  components: {
@@ -5,7 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
7
7
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
8
- var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "originalDataSource"],
8
+ var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "draggable", "disabled", "isView", "rowDisabled", "summary", "emptyText", "originalDataSource", "onDragStart", "onDragEnd"],
9
9
  _excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
10
10
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { useEffect, useMemo, useState, createContext } from 'react';
@@ -53,6 +53,8 @@ function ProTable(props) {
53
53
  _props$emptyText = props.emptyText,
54
54
  emptyText = _props$emptyText === void 0 ? locale === null || locale === void 0 ? void 0 : (_locale$ProTable = locale.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
55
55
  originalDataSource = props.originalDataSource,
56
+ onDragStartGuard = props.onDragStart,
57
+ onDragEndGuard = props.onDragEnd,
56
58
  restProps = _objectWithoutProperties(props, _excluded);
57
59
  var quickTableConfig = quickConfig ? _objectSpread({
58
60
  columnConfig: true,
@@ -352,7 +354,9 @@ function ProTable(props) {
352
354
  draggableProps: {
353
355
  onChange: onDataSourceChange,
354
356
  draggable: draggable,
355
- rowKey: rowKey
357
+ rowKey: rowKey,
358
+ onDragStartGuard: onDragStartGuard,
359
+ onDragEndGuard: onDragEndGuard
356
360
  },
357
361
  tableProps: {
358
362
  value: _dataSource,
@@ -41,6 +41,23 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
41
41
  toolTipProps?: TooltipProps & React.RefAttributes<unknown>;
42
42
  transform?: (value: any, record?: any) => string[];
43
43
  }
44
+ export interface CreateTreeFromArrayOptions {
45
+ itemKey?: string;
46
+ parentKey?: string;
47
+ childrenKey?: string;
48
+ }
49
+ export interface DragCommonGuardProps<T> {
50
+ event: T;
51
+ }
52
+ export interface DragEndGuardProps {
53
+ activeObject: any;
54
+ overObject?: any;
55
+ currentDataSource: any[];
56
+ }
57
+ export interface DragStartGuardProps {
58
+ activeObject: any;
59
+ currentDataSource: any[];
60
+ }
44
61
  export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary' | 'columns'> {
45
62
  tableId?: string;
46
63
  rowKey?: string | GetRowKey<any>;
@@ -67,6 +84,11 @@ export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary'
67
84
  stripe?: boolean;
68
85
  columns: ProTableColumn[];
69
86
  originalDataSource?: any[];
87
+ /**
88
+ * 拖拽额外配置
89
+ */
90
+ onDragStart?: DragStartGuardProps;
91
+ onDragEnd?: DragEndGuardProps;
70
92
  }
71
93
  export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
72
94
  export interface Response<T = any> {
@@ -2,17 +2,17 @@
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
4
  .pro-table {
5
- &.pro-table-draggable-only{
6
- .ant-table-tbody{
5
+ &.pro-table-draggable-only {
6
+ .ant-table-tbody {
7
7
  .anticon {
8
8
  margin-right: 0;
9
9
  }
10
10
  }
11
11
  }
12
12
  .@{ant-prefix}-table-cell-with-append {
13
- white-space: nowrap;
14
13
  position: relative;
15
14
  z-index: 100;
15
+ white-space: nowrap;
16
16
  }
17
17
  .@{ant-prefix}-table-row-expand-icon {
18
18
  position: absolute;
@@ -20,16 +20,15 @@
20
20
  }
21
21
 
22
22
  .@{ant-prefix}-table-content {
23
- >table {
23
+ > table {
24
24
  .@{ant-prefix}-table-summary {
25
+ color: var(--zaui-text, #343434);
26
+ font-weight: 600;
25
27
  background-color: var(--zaui-table-header-bg, #f2f3f5);
26
- color : var(--zaui-text, #343434);
27
- font-weight : 600;
28
28
 
29
29
  .@{ant-prefix}-table-cell-fix-left,
30
30
  .@{ant-prefix}-table-cell-fix-right {
31
31
  background-color: var(--zaui-table-header-bg, #f2f3f5);
32
-
33
32
  }
34
33
  }
35
34
 
@@ -43,33 +42,37 @@
43
42
  }
44
43
  }
45
44
 
46
- .@{ant-prefix}-table-thead>tr>th:not(.@{ant-prefix}-table-selection-column):not(.@{ant-prefix}-table-row-expand-icon-cell):not([colspan]).is-required {
45
+ .@{ant-prefix}-table-thead
46
+ > tr
47
+ > th:not(.@{ant-prefix}-table-selection-column):not(
48
+ .@{ant-prefix}-table-row-expand-icon-cell
49
+ ):not([colspan]).is-required {
47
50
  &.is-required-right {
48
51
  .pro-edit-table-title {
49
52
  &::before {
50
- position : static;
51
- top : 0;
52
- display : inline-block;
53
- text-indent: -8px;
54
- color : #ff5050;
55
- font-size : var(--zaui-font-size-md, 14px);
53
+ position: static;
54
+ top: 0;
55
+ display: inline-block;
56
+ color: #ff5050;
57
+ font-size: var(--zaui-font-size-md, 14px);
56
58
  line-height: 1;
57
- content : "*";
59
+ text-indent: -8px;
60
+ content: '*';
58
61
  }
59
62
  }
60
63
  }
61
64
  &.is-required-left {
62
65
  .pro-edit-table-title {
63
66
  &::after {
67
+ position: static;
68
+ top: 0;
69
+ display: inline-block;
64
70
  width: auto;
65
- position : static;
66
- top : 0;
67
- display : inline-block;
68
71
  margin-left: var(--zaui-space-size-xs, 4px);
69
- color : #ff5050;
70
- font-size : 14px;
72
+ color: #ff5050;
73
+ font-size: 14px;
71
74
  line-height: 1;
72
- content : "*";
75
+ content: '*';
73
76
  }
74
77
  }
75
78
  }
@@ -80,9 +83,9 @@
80
83
  display: flex;
81
84
  width: 20px;
82
85
  .anticon {
83
- cursor: pointer;
84
86
  margin-right: 12px;
85
- .drag-icon{
87
+ cursor: pointer;
88
+ .drag-icon {
86
89
  margin-right: 0;
87
90
  }
88
91
  }
@@ -93,8 +96,6 @@
93
96
  }
94
97
  }
95
98
 
96
-
97
-
98
99
  &.pro-table-bordered {
99
100
  .@{ant-prefix}-table .@{ant-prefix}-table-thead > tr > th {
100
101
  border-bottom: 1px solid #f0f0f0;
@@ -557,10 +558,4 @@
557
558
  }
558
559
  }
559
560
  }
560
- }
561
-
562
- .pro-edit-table-drag {
563
- table tr th.@{ant-prefix}-table-selection-column.@{ant-prefix}-table-cell-fix-left{
564
- text-align: right;
565
- }
566
- }
561
+ }
@@ -1,3 +1,3 @@
1
1
  import type { DevToolsPropsType } from '../../propsType';
2
- declare const PrdTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => import("react/jsx-runtime").JSX.Element;
3
- export default PrdTools;
2
+ declare const ProTools: ({ onReset, onClose, setState, open, state, tableBorder, tableStripe, }: DevToolsPropsType) => import("react/jsx-runtime").JSX.Element;
3
+ export default ProTools;
@@ -21,7 +21,7 @@ var connect = function connect(Component) {
21
21
  return ComponentWrapper;
22
22
  };
23
23
  var NewDrawer = connect(_Drawer);
24
- var PrdTools = function PrdTools(_ref) {
24
+ var ProTools = function ProTools(_ref) {
25
25
  var onReset = _ref.onReset,
26
26
  onClose = _ref.onClose,
27
27
  setState = _ref.setState,
@@ -266,4 +266,4 @@ var PrdTools = function PrdTools(_ref) {
266
266
  })]
267
267
  });
268
268
  };
269
- export default PrdTools;
269
+ export default ProTools;
@@ -1,2 +1 @@
1
- /// <reference types="typings" />
2
- export { default as PrdTools } from './PrdTools';
1
+ export { default as ProTools } from './ProTools';
@@ -1,2 +1 @@
1
- /// <reference path="../../../typings.d.ts" />;
2
- export { default as PrdTools } from './PrdTools';
1
+ export { default as ProTools } from './ProTools';
@@ -17,7 +17,7 @@ import { isEqual } from 'lodash';
17
17
  import classnames from 'classnames';
18
18
  import { getKebabCase, setThemes, setTableBorder, getMapKebabCase, getMapHumpCase } from './utils/index';
19
19
  import settingSvg from '../assets/setting.svg';
20
- import { PrdTools } from './component';
20
+ import { ProTools } from './component';
21
21
  import locale from '../locale';
22
22
  var defaultCacheTime = 1; // 配置保存时间为一天
23
23
  var defaultThemeConfig = {
@@ -183,7 +183,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
183
183
  className: "setting-icon",
184
184
  src: settingSvg
185
185
  })
186
- }), _jsx(PrdTools, {
186
+ }), _jsx(ProTools, {
187
187
  prefixCls: prefixCls,
188
188
  onReset: onReset,
189
189
  onClose: toggle,
@@ -1,7 +1,7 @@
1
1
  @root-entry-name: 'default';
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
- @import '../component/PrdTools/style/index.less';
4
+ @import '../component/ProTools/style/index.less';
5
5
 
6
6
  .pro-theme-tools {
7
7
  display: flex;
@@ -122,11 +122,32 @@ function List(props, ref) {
122
122
  document.body.removeChild(temp);
123
123
  return len * 20;
124
124
  }
125
+ var handleCommonTitle = function handleCommonTitle(item) {
126
+ if (isCASCADER) {
127
+ return item === null || item === void 0 ? void 0 : item.title;
128
+ }
129
+ return item[fieldNameLabel];
130
+ };
131
+ var handleGetTitle = function handleGetTitle(item) {
132
+ if (showCodeName) {
133
+ if (isCASCADER) {
134
+ if (item[fieldNameValue] && (item === null || item === void 0 ? void 0 : item.title)) {
135
+ return "".concat(item[fieldNameValue], "-").concat(item.title);
136
+ }
137
+ return handleCommonTitle(item);
138
+ }
139
+ if (item[fieldNameValue] && item[fieldNameValue]) {
140
+ return "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]);
141
+ }
142
+ return handleCommonTitle(item);
143
+ }
144
+ return handleCommonTitle(item);
145
+ };
125
146
  var _useVirtualList = useVirtualList(originalList, {
126
147
  containerTarget: containerRef,
127
148
  wrapperTarget: wrapperRef,
128
149
  itemHeight: function itemHeight(index, item) {
129
- var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(isCASCADER ? item === null || item === void 0 ? void 0 : item.title : item[fieldNameLabel]) : "".concat(isCASCADER ? item === null || item === void 0 ? void 0 : item.title : item[fieldNameLabel]);
150
+ var title = handleGetTitle(item);
130
151
  return Math.floor(getLineHeight(title, 406)) + 12;
131
152
  }
132
153
  }),
@@ -182,7 +203,7 @@ function List(props, ref) {
182
203
  children: _jsx(_Row, {
183
204
  children: list.map(function (_item) {
184
205
  var item = _item.data;
185
- var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(isCASCADER ? item === null || item === void 0 ? void 0 : item.title : item[fieldNameLabel]) : "".concat(isCASCADER ? item === null || item === void 0 ? void 0 : item.title : item[fieldNameLabel]);
206
+ var title = handleGetTitle(item);
186
207
  var content = optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
187
208
  label: title,
188
209
  searchStr: searchStr
@@ -220,7 +241,7 @@ function List(props, ref) {
220
241
  value: checkedValues,
221
242
  children: _jsx(_Row, {
222
243
  children: treeData.map(function (item) {
223
- var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(isCASCADER ? item === null || item === void 0 ? void 0 : item.title : item[fieldNameLabel]) : "".concat(isCASCADER ? item === null || item === void 0 ? void 0 : item.title : item[fieldNameLabel]);
244
+ var title = handleGetTitle(item);
224
245
  var content = optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
225
246
  label: title,
226
247
  searchStr: searchStr
@@ -257,7 +278,12 @@ function List(props, ref) {
257
278
  ref: wrapperRef,
258
279
  children: list.map(function (_item) {
259
280
  var item = _item.data;
260
- var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
281
+ var title = item[fieldNameLabel];
282
+ if (showCodeName) {
283
+ if (item[fieldNameValue] && item[fieldNameLabel]) {
284
+ title = "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]);
285
+ }
286
+ }
261
287
  return _jsxs("div", {
262
288
  className: "pro-tree-modal-checkbox-content",
263
289
  children: [_jsx("div", {
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { FormInstance } from 'antd';
3
+ import { NamePath } from 'antd/lib/form/interface';
4
+ interface Props {
5
+ name?: NamePath;
6
+ names?: NamePath[];
7
+ originalName?: NamePath;
8
+ originalNames?: NamePath[];
9
+ namesStr?: NamePath;
10
+ originalValues?: any;
11
+ form: FormInstance;
12
+ equalWith?: (preValue: any, curValue: any) => boolean | undefined;
13
+ [name: string]: any;
14
+ }
15
+ declare const ListChanged: React.FC<Props>;
16
+ export default ListChanged;