@zat-design/sisyphus-react 4.2.0 → 4.3.0-beta.10
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/index.esm.css +1 -1
- package/dist/less.esm.css +1 -1
- package/es/ProEditTable/components/RenderField/index.js +1 -23
- package/es/ProEditTable/index.js +2 -6
- package/es/ProEditTable/propsType.d.ts +1 -3
- package/es/ProEditTable/style/index.less +0 -14
- package/es/ProEditTable/utils/index.js +0 -18
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +11 -2
- package/es/ProForm/components/combination/Group/style/index.less +42 -31
- package/es/ProForm/components/combination/Group/utils/index.d.ts +18 -18
- package/es/ProForm/utils/useForm.js +12 -10
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +11 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +3 -3
- package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +3 -5
- package/es/ProLayout/components/TabsManager/components/TabsHeader.js +65 -24
- package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +59 -65
- package/es/ProLayout/components/TabsManager/index.js +68 -36
- package/es/ProLayout/components/TabsManager/propTypes.d.ts +8 -0
- package/es/ProLayout/components/TabsManager/style/index.less +60 -68
- package/es/ProLayout/components/TabsManager/utils/index.d.ts +14 -0
- package/es/ProLayout/components/TabsManager/utils/index.js +38 -6
- package/es/ProLayout/index.js +45 -15
- package/es/ProLayout/propTypes.d.ts +15 -0
- package/es/ProLayout/style/index.less +49 -1
- package/es/assets/edit.svg +1 -0
- package/package.json +1 -3
|
@@ -66,7 +66,6 @@ const RenderField = ({
|
|
|
66
66
|
const {
|
|
67
67
|
mode,
|
|
68
68
|
cellName,
|
|
69
|
-
cellNamePath,
|
|
70
69
|
_isEditing,
|
|
71
70
|
form,
|
|
72
71
|
setState,
|
|
@@ -89,11 +88,7 @@ const RenderField = ({
|
|
|
89
88
|
let _disabled = false;
|
|
90
89
|
let _desensitization = desensitization || [];
|
|
91
90
|
let _component = component || editRender;
|
|
92
|
-
const isCell = mode === 'cell';
|
|
93
91
|
const isSingleMode = mode === 'single';
|
|
94
|
-
if (isCell) {
|
|
95
|
-
record['is-view'] = !_isEqual(cellNamePath, cellName);
|
|
96
|
-
}
|
|
97
92
|
|
|
98
93
|
// type类型 首字母转大写
|
|
99
94
|
type = type?.replace?.(type[0], type[0].toUpperCase()) || 'Input';
|
|
@@ -512,12 +507,6 @@ const RenderField = ({
|
|
|
512
507
|
}
|
|
513
508
|
}
|
|
514
509
|
}
|
|
515
|
-
if (isCell) {
|
|
516
|
-
await form.validateFields([cellName]);
|
|
517
|
-
setState({
|
|
518
|
-
cellNamePath: []
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
510
|
// 单行编辑时需要 强制更新视图,仅对当前行打标记
|
|
522
511
|
compatStartTransition(() => {
|
|
523
512
|
setState({
|
|
@@ -526,7 +515,7 @@ const RenderField = ({
|
|
|
526
515
|
}
|
|
527
516
|
});
|
|
528
517
|
});
|
|
529
|
-
}, [onBlur, formatArgs, namePath, index, form, TargetComponent, validateTrigger, debounceValidate,
|
|
518
|
+
}, [onBlur, formatArgs, namePath, index, form, TargetComponent, validateTrigger, debounceValidate, cellName, setState]);
|
|
530
519
|
|
|
531
520
|
// 使用useMemo优化componentProps对象
|
|
532
521
|
let componentProps = useMemo(() => ({
|
|
@@ -556,20 +545,9 @@ const RenderField = ({
|
|
|
556
545
|
}
|
|
557
546
|
}), [cellName, _fieldProps, TargetComponent?.props, namePath, index, _disabled, _onChange, _onblur, confirm, _desensitization, names, originalName, viewEmpty, _valueType, isView, otherProps?.desensitizationKey]);
|
|
558
547
|
componentProps = _omit(componentProps, ['onFieldChange', 'namePath', 'index', ...OMIT_FORM_ITEM_AND_DOM_KEYS]);
|
|
559
|
-
|
|
560
|
-
// 单元格编辑时,设置各个单元格disabled属性
|
|
561
|
-
if (isCell) {
|
|
562
|
-
record[`${dataIndex}-Disabled`] = _disabled;
|
|
563
|
-
}
|
|
564
548
|
if (['Switch', 'SwitchCheckbox'].includes(type)) {
|
|
565
549
|
_formItemProps.valuePropName = 'checked';
|
|
566
550
|
}
|
|
567
|
-
useEffect(() => {
|
|
568
|
-
if (isCell) {
|
|
569
|
-
const editingDom = document.getElementById(cellNamePath.join('_'));
|
|
570
|
-
editingDom?.focus?.();
|
|
571
|
-
}
|
|
572
|
-
}, [cellNamePath, isCell]);
|
|
573
551
|
|
|
574
552
|
// 可编辑表格默认关闭scrollFollowParent
|
|
575
553
|
if (['Select', 'ProSelect', 'ProEnum'].includes(type)) {
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -81,8 +81,6 @@ const ProEditTable = ({
|
|
|
81
81
|
return themeConfig?.data?.zauiFormAlign ?? configRequiredAlign ?? 'left';
|
|
82
82
|
}, [themeConfig?.data?.zauiFormAlign, configRequiredAlign]);
|
|
83
83
|
const [state, setState] = useSetState({
|
|
84
|
-
cellNamePath: [],
|
|
85
|
-
// hover模式下正在编辑的单元格路径
|
|
86
84
|
forceUpdate: {},
|
|
87
85
|
// 表格内部强制刷新开关
|
|
88
86
|
editingKeys: [],
|
|
@@ -99,7 +97,6 @@ const ProEditTable = ({
|
|
|
99
97
|
}
|
|
100
98
|
});
|
|
101
99
|
const {
|
|
102
|
-
cellNamePath,
|
|
103
100
|
forceUpdate,
|
|
104
101
|
editingKeys,
|
|
105
102
|
virtualKey,
|
|
@@ -186,7 +183,6 @@ const ProEditTable = ({
|
|
|
186
183
|
isView,
|
|
187
184
|
viewEmpty,
|
|
188
185
|
disabled,
|
|
189
|
-
cellNamePath,
|
|
190
186
|
forceUpdate,
|
|
191
187
|
insertType,
|
|
192
188
|
emptyBtnText,
|
|
@@ -221,7 +217,7 @@ const ProEditTable = ({
|
|
|
221
217
|
getIsNew,
|
|
222
218
|
handlePageChange,
|
|
223
219
|
...resetProps
|
|
224
|
-
}), [actionDirection, actionProps, actionWidth,
|
|
220
|
+
}), [actionDirection, actionProps, actionWidth, deletePoConfirmMsg, diffConfig, editingKeys, emptyBtnText, form,
|
|
225
221
|
// forceUpdate 不应该作为依赖项,因为它是触发刷新的信号,而非用于比较的数据
|
|
226
222
|
getIsNew, handlePageChange, insertType, isView, max, mode, mulDeletePoConfirmMsg, name, namePath, onlyOneLineMsg, originalValues, prefixCls, requiredAlign, resetProps, rowDisabled, selectedRowKeys, selectedRows, shouldUpdateDebounce, tableRef, toolbarProps, value?.length, viewEmpty, virtualKey, page]);
|
|
227
223
|
|
|
@@ -317,7 +313,7 @@ const ProEditTable = ({
|
|
|
317
313
|
};
|
|
318
314
|
const _columns = useMemo(() => {
|
|
319
315
|
return transformColumns(columns, config);
|
|
320
|
-
}, [disabled, forceUpdate, columns, page, actionProps, editingKeys,
|
|
316
|
+
}, [disabled, forceUpdate, columns, page, actionProps, editingKeys, config]);
|
|
321
317
|
const initDataSource = () => {
|
|
322
318
|
// 检查每一项是否有 rowKey 或通过 rowKey 字段获取的 key
|
|
323
319
|
const isAllHasKey = value?.every?.(item => item.rowKey || typeof rowKey === 'string' && item[rowKey]);
|
|
@@ -194,8 +194,6 @@ export type ProEditTableColumnsProps<K = any> = ProColumnsProps<K, 'ProEditTable
|
|
|
194
194
|
* 状态接口
|
|
195
195
|
*/
|
|
196
196
|
export interface StateProps {
|
|
197
|
-
/** 单元格名称路径 */
|
|
198
|
-
cellNamePath: NamePath[];
|
|
199
197
|
/** 表格内部强制刷新开关 */
|
|
200
198
|
forceUpdate: Record<string, any>;
|
|
201
199
|
/** 正在编辑行的row-key集合 */
|
|
@@ -232,7 +230,7 @@ export type ProEditTableRefType = ProEditTableRefProps;
|
|
|
232
230
|
/**
|
|
233
231
|
* 可编辑表格模式类型
|
|
234
232
|
*/
|
|
235
|
-
export type ProEditTableMode = 'single' | 'multiple'
|
|
233
|
+
export type ProEditTableMode = 'single' | 'multiple';
|
|
236
234
|
export type ProEditTableModeType = ProEditTableMode;
|
|
237
235
|
/**
|
|
238
236
|
* 表格插入类型
|
|
@@ -76,20 +76,6 @@
|
|
|
76
76
|
left: -9999px;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
.is-cell
|
|
80
|
-
.@{ant-prefix}-form-item
|
|
81
|
-
.@{ant-prefix}-form-item-row
|
|
82
|
-
.@{ant-prefix}-form-item-control
|
|
83
|
-
.@{ant-prefix}-form-item-control-input {
|
|
84
|
-
border: 1px solid transparent;
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
border: 1px solid #dee0e3;
|
|
88
|
-
border-radius: var(--zaui-border-radius, 8px);
|
|
89
|
-
text-indent: 5px;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
79
|
.pro-edit-table-drag-wrapper {
|
|
94
80
|
display: flex;
|
|
95
81
|
align-items: center;
|
|
@@ -185,7 +185,6 @@ export const transformColumns = (columns = [], config) => {
|
|
|
185
185
|
form,
|
|
186
186
|
name,
|
|
187
187
|
disabled,
|
|
188
|
-
cellNamePath,
|
|
189
188
|
editingKeys,
|
|
190
189
|
virtualKey,
|
|
191
190
|
requiredAlign,
|
|
@@ -193,7 +192,6 @@ export const transformColumns = (columns = [], config) => {
|
|
|
193
192
|
setState,
|
|
194
193
|
page
|
|
195
194
|
} = config;
|
|
196
|
-
const isCell = mode === 'cell';
|
|
197
195
|
let nextColumns = columns.map(item => cloneDeepFilterNode(item));
|
|
198
196
|
const pageNum = tools.calc(page.pageNum, '-', 1);
|
|
199
197
|
const firstIndex = tools.calc(pageNum, '*', page.pageSize);
|
|
@@ -304,25 +302,9 @@ export const transformColumns = (columns = [], config) => {
|
|
|
304
302
|
isResponsiveWidth: true
|
|
305
303
|
});
|
|
306
304
|
}
|
|
307
|
-
let cellClassName;
|
|
308
|
-
const isCanEdit = isCell && !record[`${columnName}-Disabled`] && item.isEditable !== false;
|
|
309
|
-
// 单元格编辑场景下,需要将所有单元格设置为不可编辑状态,当鼠标hover时,展示输出框。点击可修改
|
|
310
|
-
if (isCanEdit) {
|
|
311
|
-
record['is-view'] = true;
|
|
312
|
-
// 样式处理
|
|
313
|
-
cellClassName = classnames({
|
|
314
|
-
'is-cell': !_isEqual(cellNamePath, cellName)
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
305
|
|
|
318
306
|
// 单行多行交互有较大差异
|
|
319
307
|
return /*#__PURE__*/_jsxs("div", {
|
|
320
|
-
className: cellClassName,
|
|
321
|
-
onClick: () => {
|
|
322
|
-
isCanEdit && setState({
|
|
323
|
-
cellNamePath: cellName
|
|
324
|
-
});
|
|
325
|
-
},
|
|
326
308
|
children: [index === 0 && !item.width ? /*#__PURE__*/_jsx("div", {
|
|
327
309
|
style: {
|
|
328
310
|
visibility: 'hidden',
|
|
@@ -9,11 +9,20 @@ const AddonWrapper = props => {
|
|
|
9
9
|
} = props;
|
|
10
10
|
return /*#__PURE__*/_jsxs("div", {
|
|
11
11
|
className: "addon-wrapper",
|
|
12
|
+
style: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
gap: '8px'
|
|
16
|
+
},
|
|
12
17
|
children: [before && /*#__PURE__*/_jsx("div", {
|
|
13
|
-
|
|
18
|
+
style: {
|
|
19
|
+
whiteSpace: 'nowrap'
|
|
20
|
+
},
|
|
14
21
|
children: before
|
|
15
22
|
}), children, after && /*#__PURE__*/_jsx("div", {
|
|
16
|
-
|
|
23
|
+
style: {
|
|
24
|
+
whiteSpace: 'nowrap'
|
|
25
|
+
},
|
|
17
26
|
children: after
|
|
18
27
|
})]
|
|
19
28
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import '../../../../../style/variables.less';
|
|
2
|
+
@import '../component/AddonWrapper/index.less';
|
|
2
3
|
|
|
3
4
|
.pro-group {
|
|
4
5
|
display: flex;
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
|
|
116
117
|
// 确保输入框完全贴合
|
|
117
118
|
.@{ant-prefix}-input,
|
|
118
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
119
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
119
120
|
.@{ant-prefix}-input-number,
|
|
120
121
|
.@{ant-prefix}-input-number-input {
|
|
121
122
|
// 重置z-index确保正确的层级关系
|
|
@@ -127,7 +128,7 @@
|
|
|
127
128
|
// 第一个表单项:左边保持圆角
|
|
128
129
|
&:first-child {
|
|
129
130
|
.@{ant-prefix}-input,
|
|
130
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
131
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
131
132
|
.@{ant-prefix}-input-number,
|
|
132
133
|
.@{ant-prefix}-input-number-input {
|
|
133
134
|
border-top-left-radius: 6px;
|
|
@@ -138,7 +139,7 @@
|
|
|
138
139
|
// 最后一个表单项:右边保持圆角
|
|
139
140
|
&:last-child {
|
|
140
141
|
.@{ant-prefix}-input,
|
|
141
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
142
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
142
143
|
.@{ant-prefix}-input-number,
|
|
143
144
|
.@{ant-prefix}-input-number-input {
|
|
144
145
|
border-top-right-radius: 6px;
|
|
@@ -154,7 +155,7 @@
|
|
|
154
155
|
|
|
155
156
|
// 聚焦时恢复左边框
|
|
156
157
|
.@{ant-prefix}-input:focus,
|
|
157
|
-
.@{ant-prefix}-select:focus .@{ant-prefix}-select-
|
|
158
|
+
.@{ant-prefix}-select:focus .@{ant-prefix}-select-content,
|
|
158
159
|
.@{ant-prefix}-input-number:focus,
|
|
159
160
|
.@{ant-prefix}-input-number:focus .@{ant-prefix}-input-number-input {
|
|
160
161
|
margin-left: -1px;
|
|
@@ -165,7 +166,7 @@
|
|
|
165
166
|
// 错误状态:确保边框变红(优先级要高于上面的 border-left-width: 0)
|
|
166
167
|
&.@{ant-prefix}-form-item-has-error {
|
|
167
168
|
.@{ant-prefix}-input,
|
|
168
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
169
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
169
170
|
.@{ant-prefix}-input-number,
|
|
170
171
|
.@{ant-prefix}-input-number-input {
|
|
171
172
|
border-color: #ff4d4f !important;
|
|
@@ -174,7 +175,7 @@
|
|
|
174
175
|
// 错误状态下,中间元素也需要恢复左边框并设置为红色
|
|
175
176
|
&:not(:first-child) {
|
|
176
177
|
.@{ant-prefix}-input,
|
|
177
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
178
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
178
179
|
.@{ant-prefix}-input-number {
|
|
179
180
|
border-left-color: #ff4d4f !important;
|
|
180
181
|
border-left-width: 1px !important;
|
|
@@ -187,14 +188,14 @@
|
|
|
187
188
|
|
|
188
189
|
// 聚焦时保持红色边框
|
|
189
190
|
.@{ant-prefix}-input:focus,
|
|
190
|
-
.@{ant-prefix}-select:focus .@{ant-prefix}-select-
|
|
191
|
+
.@{ant-prefix}-select:focus .@{ant-prefix}-select-content,
|
|
191
192
|
.@{ant-prefix}-input-number:focus,
|
|
192
193
|
.@{ant-prefix}-input-number:focus .@{ant-prefix}-input-number-input {
|
|
193
194
|
border-color: #ff4d4f !important;
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
// Select 组件的错误状态处理
|
|
197
|
-
.@{ant-prefix}-select.@{ant-prefix}-select-status-error .@{ant-prefix}-select-
|
|
198
|
+
.@{ant-prefix}-select.@{ant-prefix}-select-status-error .@{ant-prefix}-select-content {
|
|
198
199
|
border-color: #ff4d4f !important;
|
|
199
200
|
}
|
|
200
201
|
}
|
|
@@ -317,37 +318,41 @@
|
|
|
317
318
|
}
|
|
318
319
|
|
|
319
320
|
// 确保输入框完全贴合
|
|
321
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
320
322
|
.@{ant-prefix}-input,
|
|
321
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
323
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
322
324
|
.@{ant-prefix}-input-number,
|
|
323
325
|
.@{ant-prefix}-input-number-input,
|
|
324
326
|
.@{ant-prefix}-picker {
|
|
325
327
|
// 重置z-index确保正确的层级关系
|
|
326
328
|
position: relative;
|
|
327
|
-
//
|
|
328
|
-
border-radius: 0;
|
|
329
|
+
// 重置圆角(!important 确保覆盖 antd v6 CSS-in-JS 懒注入的 disabled 等状态样式)
|
|
330
|
+
border-radius: 0 !important;
|
|
329
331
|
}
|
|
330
332
|
|
|
331
333
|
// 第一个表单项:左边保持圆角
|
|
332
334
|
&:first-child {
|
|
335
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
333
336
|
.@{ant-prefix}-input,
|
|
334
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
337
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
335
338
|
.@{ant-prefix}-input-number,
|
|
336
|
-
.@{ant-prefix}-input-number-input
|
|
337
|
-
|
|
338
|
-
border-
|
|
339
|
+
.@{ant-prefix}-input-number-input,
|
|
340
|
+
.@{ant-prefix}-picker {
|
|
341
|
+
border-top-left-radius: 6px !important;
|
|
342
|
+
border-bottom-left-radius: 6px !important;
|
|
339
343
|
}
|
|
340
344
|
}
|
|
341
345
|
|
|
342
346
|
// 最后一个表单项:右边保持圆角
|
|
343
347
|
&:last-child {
|
|
348
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
344
349
|
.@{ant-prefix}-input,
|
|
345
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
350
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
346
351
|
.@{ant-prefix}-input-number,
|
|
347
352
|
.@{ant-prefix}-input-number-input,
|
|
348
353
|
.@{ant-prefix}-picker {
|
|
349
|
-
border-top-right-radius: 6px;
|
|
350
|
-
border-bottom-right-radius: 6px;
|
|
354
|
+
border-top-right-radius: 6px !important;
|
|
355
|
+
border-bottom-right-radius: 6px !important;
|
|
351
356
|
}
|
|
352
357
|
}
|
|
353
358
|
|
|
@@ -355,7 +360,7 @@
|
|
|
355
360
|
&:not(:first-child) {
|
|
356
361
|
// 聚焦时恢复左边框
|
|
357
362
|
.@{ant-prefix}-input:focus,
|
|
358
|
-
.@{ant-prefix}-select:focus .@{ant-prefix}-select-
|
|
363
|
+
.@{ant-prefix}-select:focus .@{ant-prefix}-select-content,
|
|
359
364
|
.@{ant-prefix}-input-number:focus,
|
|
360
365
|
.@{ant-prefix}-input-number:focus .@{ant-prefix}-input-number-input {
|
|
361
366
|
margin-left: -1px;
|
|
@@ -426,7 +431,7 @@
|
|
|
426
431
|
&:not(.pro-group-flexible) {
|
|
427
432
|
// 错误状态:确保边框变红(优先级要高于上面的 border-left-width: 0)
|
|
428
433
|
.@{ant-prefix}-input,
|
|
429
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
434
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
430
435
|
.@{ant-prefix}-input-number,
|
|
431
436
|
.@{ant-prefix}-input-number-input {
|
|
432
437
|
border-color: #ff4d4f !important;
|
|
@@ -435,7 +440,7 @@
|
|
|
435
440
|
// 错误状态下,中间元素也需要恢复左边框并设置为红色
|
|
436
441
|
&:not(:first-child) {
|
|
437
442
|
.@{ant-prefix}-input,
|
|
438
|
-
.@{ant-prefix}-select .@{ant-prefix}-select-
|
|
443
|
+
.@{ant-prefix}-select .@{ant-prefix}-select-content,
|
|
439
444
|
.@{ant-prefix}-input-number {
|
|
440
445
|
border-left-color: #ff4d4f !important;
|
|
441
446
|
border-left-width: 1px !important;
|
|
@@ -448,14 +453,14 @@
|
|
|
448
453
|
|
|
449
454
|
// 聚焦时保持红色边框
|
|
450
455
|
.@{ant-prefix}-input:focus,
|
|
451
|
-
.@{ant-prefix}-select:focus .@{ant-prefix}-select-
|
|
456
|
+
.@{ant-prefix}-select:focus .@{ant-prefix}-select-content,
|
|
452
457
|
.@{ant-prefix}-input-number:focus,
|
|
453
458
|
.@{ant-prefix}-input-number:focus .@{ant-prefix}-input-number-input {
|
|
454
459
|
border-color: #ff4d4f !important;
|
|
455
460
|
}
|
|
456
461
|
|
|
457
462
|
// Select 组件的错误状态处理
|
|
458
|
-
.@{ant-prefix}-select.@{ant-prefix}-select-status-error .@{ant-prefix}-select-
|
|
463
|
+
.@{ant-prefix}-select.@{ant-prefix}-select-status-error .@{ant-prefix}-select-content {
|
|
459
464
|
border-color: #ff4d4f !important;
|
|
460
465
|
}
|
|
461
466
|
}
|
|
@@ -464,8 +469,10 @@
|
|
|
464
469
|
// compact模式容器, 修复antd6定制模式下,Group组件内嵌套Form.Item时,表单样式问题
|
|
465
470
|
.pro-group-compact-container {
|
|
466
471
|
.@{ant-prefix}-select {
|
|
467
|
-
border-radius: 0;
|
|
468
|
-
|
|
472
|
+
border-radius: 0 !important;
|
|
473
|
+
}
|
|
474
|
+
.@{ant-prefix}-input-affix-wrapper {
|
|
475
|
+
border-radius: 0 !important;
|
|
469
476
|
}
|
|
470
477
|
|
|
471
478
|
> .pro-group-form-item:not(:first-child) {
|
|
@@ -492,9 +499,11 @@
|
|
|
492
499
|
> .pro-group-form-item:first-child {
|
|
493
500
|
.pro-select .@{ant-prefix}-select,
|
|
494
501
|
.@{ant-prefix}-select,
|
|
495
|
-
.@{ant-prefix}-input-
|
|
496
|
-
|
|
497
|
-
|
|
502
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
503
|
+
.@{ant-prefix}-input-number,
|
|
504
|
+
.@{ant-prefix}-picker {
|
|
505
|
+
border-top-left-radius: 6px !important;
|
|
506
|
+
border-bottom-left-radius: 6px !important;
|
|
498
507
|
}
|
|
499
508
|
}
|
|
500
509
|
|
|
@@ -502,9 +511,11 @@
|
|
|
502
511
|
> .pro-group-form-item:last-child {
|
|
503
512
|
.pro-select .@{ant-prefix}-select,
|
|
504
513
|
.@{ant-prefix}-select,
|
|
505
|
-
.@{ant-prefix}-input-
|
|
506
|
-
|
|
507
|
-
|
|
514
|
+
.@{ant-prefix}-input-affix-wrapper,
|
|
515
|
+
.@{ant-prefix}-input-number,
|
|
516
|
+
.@{ant-prefix}-picker {
|
|
517
|
+
border-top-right-radius: 6px !important;
|
|
518
|
+
border-bottom-right-radius: 6px !important;
|
|
508
519
|
}
|
|
509
520
|
}
|
|
510
521
|
}
|
|
@@ -75,31 +75,36 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
75
75
|
confirm?: boolean | import("antd").ModalFuncProps | import("../../../render/propsType").FunctionArgs<any, boolean | import("antd").ModalFuncProps>;
|
|
76
76
|
show?: boolean | ReactiveFunction<any, boolean>;
|
|
77
77
|
component?: React.ReactNode | ReactiveFunction<any, React.ReactNode>;
|
|
78
|
-
|
|
79
|
-
normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
|
|
80
|
-
children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
|
|
78
|
+
id?: string;
|
|
81
79
|
className?: string;
|
|
80
|
+
children?: React.ReactNode | ((form: FormInstance<any>) => React.ReactNode);
|
|
81
|
+
hidden?: boolean;
|
|
82
82
|
style?: React.CSSProperties;
|
|
83
|
+
onReset?: () => void;
|
|
83
84
|
prefixCls?: string;
|
|
84
|
-
trigger?: string;
|
|
85
|
-
id?: string;
|
|
86
|
-
isView?: boolean;
|
|
87
85
|
rootClassName?: string;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
status?: "" | "warning" | "error" | "success" | "validating";
|
|
86
|
+
layout?: import("antd/es/form/Form").FormItemLayout;
|
|
87
|
+
help?: React.ReactNode;
|
|
91
88
|
vertical?: boolean;
|
|
92
|
-
validateTrigger?: string | false | string[];
|
|
93
89
|
preserve?: boolean;
|
|
90
|
+
trim?: boolean;
|
|
91
|
+
normalize?: (value: any, prevValue: any, allValues: import("@rc-component/form/lib/interface").Store) => any;
|
|
94
92
|
htmlFor?: string;
|
|
95
|
-
|
|
93
|
+
trigger?: string;
|
|
94
|
+
isView?: boolean;
|
|
95
|
+
status?: "" | "warning" | "error" | "success" | "validating";
|
|
96
|
+
getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
|
|
97
|
+
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
98
|
+
validateTrigger?: string | false | string[];
|
|
99
|
+
clearNotShow?: boolean;
|
|
96
100
|
labelAlign?: import("antd/es/form/interface").FormLabelAlign;
|
|
101
|
+
colon?: boolean;
|
|
97
102
|
labelCol?: import("antd").ColProps;
|
|
103
|
+
wrapperCol?: import("antd").ColProps;
|
|
98
104
|
getValueFromEvent?: (...args: import("@rc-component/form/lib/interface").EventArgs) => any;
|
|
99
105
|
shouldUpdate?: import("@rc-component/form/lib/Field").ShouldUpdate<any>;
|
|
100
106
|
validateDebounce?: number;
|
|
101
107
|
valuePropName?: string;
|
|
102
|
-
getValueProps?: ((value: any) => Record<string, unknown>) & ((value: any) => Record<string, unknown>);
|
|
103
108
|
messageVariables?: Record<string, string>;
|
|
104
109
|
initialValue?: any;
|
|
105
110
|
onMetaChange?: (meta: import("@rc-component/form/lib/Field").MetaEvent) => void;
|
|
@@ -110,9 +115,6 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
110
115
|
icons: import("antd/es/form/FormItem").FeedbackIcons;
|
|
111
116
|
};
|
|
112
117
|
validateStatus?: "" | "warning" | "error" | "success" | "validating";
|
|
113
|
-
layout?: import("antd/es/form/Form").FormItemLayout;
|
|
114
|
-
wrapperCol?: import("antd").ColProps;
|
|
115
|
-
help?: React.ReactNode;
|
|
116
118
|
fieldId?: string;
|
|
117
119
|
valueType?: import("../../../render/propsType").ProFormValueType;
|
|
118
120
|
switchValue?: [any, any];
|
|
@@ -125,8 +127,6 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
125
127
|
upperCase?: boolean;
|
|
126
128
|
toISOString?: boolean;
|
|
127
129
|
toCSTString?: boolean;
|
|
128
|
-
clearNotShow?: boolean;
|
|
129
|
-
desensitization?: [number, number] | ReactiveFunction<any, [number, number]>;
|
|
130
130
|
name: any;
|
|
131
131
|
dependencies: any[];
|
|
132
132
|
tooltip: string | {
|
|
@@ -141,7 +141,7 @@ export declare const useFormItemProps: (column: FlexibleGroupColumnType, context
|
|
|
141
141
|
* 创建组件属性
|
|
142
142
|
*/
|
|
143
143
|
export declare const createComponentProps: (column: FlexibleGroupColumnType, formItemProps: any) => {
|
|
144
|
-
componentProps: import("lodash").Omit<any, "format" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "
|
|
144
|
+
componentProps: import("lodash").Omit<any, "format" | "clearNotShow" | "valueType" | "switchValue" | "dependNames" | "toISOString" | "toCSTString" | "precision">;
|
|
145
145
|
formItemTransform: {
|
|
146
146
|
getValueProps: any;
|
|
147
147
|
normalize: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Form } from 'antd';
|
|
2
|
-
import { useContext
|
|
2
|
+
import { useContext } from 'react';
|
|
3
3
|
import { filterInternalFields, getFormFieldPaths, mergeNames, isListForm } from "./index";
|
|
4
4
|
import { handleScrollToError as handleScrollToErrorProEditTable } from "../../ProEditTable/utils/tools";
|
|
5
5
|
import { FormsContext } from "../../FormsProvider";
|
|
@@ -19,15 +19,17 @@ export const useForm = function (originForm, options) {
|
|
|
19
19
|
|
|
20
20
|
// formKey全局共享逻辑
|
|
21
21
|
const forms = useContext(FormsContext);
|
|
22
|
-
const [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const [localForm] = Form.useForm(_originForm);
|
|
23
|
+
// 同步注册共享实例,确保同一渲染流程中相同 formKey 复用同一个实例
|
|
24
|
+
if (formKey && !forms[formKey]) {
|
|
25
|
+
forms[formKey] = localForm;
|
|
26
|
+
localForm.formKey = formKey;
|
|
27
|
+
}
|
|
28
|
+
const sharedForm = formKey ? forms[formKey] : undefined;
|
|
29
|
+
const form = sharedForm || localForm;
|
|
30
|
+
if (formKey && form.formKey !== formKey) {
|
|
31
|
+
form.formKey = formKey;
|
|
32
|
+
}
|
|
31
33
|
const {
|
|
32
34
|
getFieldsValue,
|
|
33
35
|
validateFields,
|
|
@@ -109,7 +109,7 @@ const FoldMenu = props => {
|
|
|
109
109
|
},
|
|
110
110
|
placement: "rightTop",
|
|
111
111
|
children: /*#__PURE__*/_jsx("span", {
|
|
112
|
-
onClick:
|
|
112
|
+
onClick: e => {
|
|
113
113
|
// 查找完整的菜单项数据
|
|
114
114
|
const menuItem = findMenuItemByKey(menus, String(id));
|
|
115
115
|
const menuKeyPath = menuItem?.keyIdPath ? menuItem.keyIdPath.map(id => String(id)) : [String(id)];
|
|
@@ -141,7 +141,7 @@ const FoldMenu = props => {
|
|
|
141
141
|
placement: "right",
|
|
142
142
|
title: name,
|
|
143
143
|
children: /*#__PURE__*/_jsx("span", {
|
|
144
|
-
|
|
144
|
+
onClickCapture: e => {
|
|
145
145
|
// 查找完整的菜单项数据
|
|
146
146
|
const menuItem = findMenuItemByKey(menus, String(id));
|
|
147
147
|
const menuKeyPath = menuItem?.keyIdPath ? menuItem.keyIdPath.map(id => String(id)) : [String(id)];
|
|
@@ -165,6 +165,10 @@ const FoldMenu = props => {
|
|
|
165
165
|
onSelected({
|
|
166
166
|
selectedPath: toPath
|
|
167
167
|
});
|
|
168
|
+
} else {
|
|
169
|
+
// Capture 阶段拦截,早于 Link 内部导航处理器
|
|
170
|
+
e.preventDefault();
|
|
171
|
+
e.stopPropagation();
|
|
168
172
|
}
|
|
169
173
|
},
|
|
170
174
|
children: /*#__PURE__*/_jsx(Link, {
|
|
@@ -173,7 +177,7 @@ const FoldMenu = props => {
|
|
|
173
177
|
})
|
|
174
178
|
})
|
|
175
179
|
}, `${id}-${name}`) : /*#__PURE__*/_jsx("span", {
|
|
176
|
-
|
|
180
|
+
onClickCapture: e => {
|
|
177
181
|
// 查找完整的菜单项数据
|
|
178
182
|
const menuItem = findMenuItemByKey(menus, String(id));
|
|
179
183
|
const menuKeyPath = menuItem?.keyIdPath ? menuItem.keyIdPath.map(id => String(id)) : [String(id)];
|
|
@@ -197,6 +201,10 @@ const FoldMenu = props => {
|
|
|
197
201
|
onSelected({
|
|
198
202
|
selectedPath: toPath
|
|
199
203
|
});
|
|
204
|
+
} else {
|
|
205
|
+
// Capture 阶段拦截,早于 Link 内部导航处理器
|
|
206
|
+
e.preventDefault();
|
|
207
|
+
e.stopPropagation();
|
|
200
208
|
}
|
|
201
209
|
},
|
|
202
210
|
children: /*#__PURE__*/_jsx(Link, {
|
|
@@ -7,7 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
import { Link as RouterLink } from 'react-router-dom';
|
|
8
8
|
import { LayoutContext } from "../../../../index";
|
|
9
9
|
import { getIdsByPathName, findMenuItemByKey } from "../../../../utils";
|
|
10
|
-
import {
|
|
10
|
+
import { canOpenAsTab } from "../../../TabsManager/utils";
|
|
11
11
|
import { Icon } from "../../index";
|
|
12
12
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const Link = RouterLink;
|
|
@@ -163,9 +163,9 @@ const OpenMenu = props => {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
//
|
|
166
|
+
// 可入签节点(叶子 + 根节点特例)才设置选中状态和路径
|
|
167
167
|
// 并且只有在 shouldActivate 为 true 时才设置
|
|
168
|
-
if (menuItem &&
|
|
168
|
+
if (menuItem && canOpenAsTab(menuItem) && shouldActivate) {
|
|
169
169
|
setState({
|
|
170
170
|
selectedKeys: keyPath,
|
|
171
171
|
router: item?.props?.router
|
|
@@ -4,9 +4,7 @@ export interface TabsHeaderProps {
|
|
|
4
4
|
tabsItems: TabsProps['items'];
|
|
5
5
|
onTabChange: (activeKey: string) => void;
|
|
6
6
|
onTabEdit: (targetKey: string, action: 'add' | 'remove') => void;
|
|
7
|
+
draggable?: boolean;
|
|
8
|
+
onReorder?: (activeId: string, overId: string) => void;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
* 标签页头部:监听 window 滚动(实际滚动在 window/documentElement,非 body),
|
|
10
|
-
* 滚动时添加阴影类名;仅此组件随滚动重渲染,不带动父组件内容区。
|
|
11
|
-
*/
|
|
12
|
-
export declare function TabsHeader({ activeKey, tabsItems, onTabChange, onTabEdit }: TabsHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function TabsHeader({ activeKey, tabsItems, onTabChange, onTabEdit, draggable, onReorder, }: TabsHeaderProps): import("react/jsx-runtime").JSX.Element;
|