fan-standard-comp 4.0.5 → 4.0.6
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/fan-standard-comp.min.js +1 -1
- package/es/FormComp/RenderItemGroup/index.d.ts +1 -0
- package/es/FormComp/RenderItemGroup/index.js +11 -9
- package/es/StandardFilter/index.js +43 -8
- package/es/StandardForm/StepForm.js +7 -1
- package/es/StandardModal/style/index.js +0 -1
- package/es/data/general.config.d.ts +64 -0
- package/es/data/general.config.js +64 -0
- package/lib/FormComp/RenderItemGroup/index.d.ts +1 -0
- package/lib/FormComp/RenderItemGroup/index.js +11 -9
- package/lib/StandardFilter/index.js +43 -8
- package/lib/StandardForm/StepForm.js +7 -1
- package/lib/StandardModal/style/index.js +0 -1
- package/lib/data/general.config.d.ts +64 -0
- package/lib/data/general.config.js +64 -0
- package/package.json +1 -1
|
@@ -37,7 +37,8 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
37
37
|
_props$layout = props.layout,
|
|
38
38
|
layout = _props$layout === void 0 ? "horizontal" : _props$layout,
|
|
39
39
|
gutter = props.gutter,
|
|
40
|
-
columnCount = props.columnCount
|
|
40
|
+
columnCount = props.columnCount,
|
|
41
|
+
parentNode = props.parentNode;
|
|
41
42
|
var componentName = 'spec-item-group';
|
|
42
43
|
var _useStyle = useStyle(componentName),
|
|
43
44
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -87,6 +88,7 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
87
88
|
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
88
89
|
// 还需要判断 layout为vertical还是horizontal
|
|
89
90
|
var calculateFormLayout = useCallback(function (itemData) {
|
|
91
|
+
var _general$modalSize$md, _general$modalSize$md2, _general$modalSize$lg, _general$modalSize$lg2;
|
|
90
92
|
var formLayout = {};
|
|
91
93
|
// 当布局为 'inline' 时,不配置栅格结构
|
|
92
94
|
if (layout === 'inline') {
|
|
@@ -101,11 +103,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
105
|
} else {
|
|
104
|
-
var _general$modalSize;
|
|
106
|
+
var _general$modalSize, _general$modalSize2;
|
|
105
107
|
// @ts-ignore
|
|
106
|
-
var sizeFormLayout = (_general$modalSize = general.modalSize) === null || _general$modalSize === void 0 ? void 0 : _general$modalSize[size]
|
|
108
|
+
var sizeFormLayout = (_general$modalSize = general.modalSize) === null || _general$modalSize === void 0 || (_general$modalSize = _general$modalSize[size]) === null || _general$modalSize === void 0 ? void 0 : _general$modalSize[parentNode === 'standardFilter' && (size === 'md' || size === 'lg' || size === 'xlg') ? 'filterFormLayout' : 'formLayout'];
|
|
107
109
|
// @ts-ignore
|
|
108
|
-
var sizeFormBlockLayout = general.modalSize[size]
|
|
110
|
+
var sizeFormBlockLayout = (_general$modalSize2 = general.modalSize) === null || _general$modalSize2 === void 0 || (_general$modalSize2 = _general$modalSize2[size]) === null || _general$modalSize2 === void 0 ? void 0 : _general$modalSize2[parentNode === 'standardFilter' && (size === 'md' || size === 'lg' || size === 'xlg') ? 'filterFormBlockLayout' : 'formBlockLayout'];
|
|
109
111
|
// 优先级 displayLayout.side > displayLayout > general
|
|
110
112
|
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
111
113
|
// 还需要判断 layout为vertical还是horizontal
|
|
@@ -117,12 +119,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
117
119
|
sizeFormBlockLayout = general.modalSize.sm.formBlockLayout;
|
|
118
120
|
break;
|
|
119
121
|
case 2:
|
|
120
|
-
sizeFormLayout = general.modalSize.md
|
|
121
|
-
sizeFormBlockLayout = general.modalSize.md
|
|
122
|
+
sizeFormLayout = (_general$modalSize$md = general.modalSize.md) === null || _general$modalSize$md === void 0 ? void 0 : _general$modalSize$md[parentNode === 'standardFilter' ? 'filterFormLayout' : 'formLayout'];
|
|
123
|
+
sizeFormBlockLayout = (_general$modalSize$md2 = general.modalSize.md) === null || _general$modalSize$md2 === void 0 ? void 0 : _general$modalSize$md2[parentNode === 'standardFilter' ? 'filterFormBlockLayout' : 'formBlockLayout'];
|
|
122
124
|
break;
|
|
123
125
|
case 3:
|
|
124
|
-
sizeFormLayout = general.modalSize.lg
|
|
125
|
-
sizeFormBlockLayout = general.modalSize.lg
|
|
126
|
+
sizeFormLayout = (_general$modalSize$lg = general.modalSize.lg) === null || _general$modalSize$lg === void 0 ? void 0 : _general$modalSize$lg[parentNode === 'standardFilter' ? 'filterFormLayout' : 'formLayout'];
|
|
127
|
+
sizeFormBlockLayout = (_general$modalSize$lg2 = general.modalSize.lg) === null || _general$modalSize$lg2 === void 0 ? void 0 : _general$modalSize$lg2[parentNode === 'standardFilter' ? 'filterFormBlockLayout' : 'formBlockLayout'];
|
|
126
128
|
break;
|
|
127
129
|
case 4:
|
|
128
130
|
sizeFormLayout = general.modalSize.xxlg.formLayout;
|
|
@@ -146,7 +148,7 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
return formLayout;
|
|
149
|
-
}, [size, layout, columnCount]);
|
|
151
|
+
}, [size, layout, columnCount, parentNode]);
|
|
150
152
|
|
|
151
153
|
// 渲染表单控件
|
|
152
154
|
var renderFormField = function renderFormField(field) {
|
|
@@ -74,10 +74,14 @@ var StandardFilter = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
74
74
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
75
75
|
isHideCount = _useState4[0],
|
|
76
76
|
setIsHideCount = _useState4[1]; // 表单隐藏项数量值
|
|
77
|
-
var _useState5 = useState(
|
|
77
|
+
var _useState5 = useState(0),
|
|
78
78
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
additionalCount = _useState6[0],
|
|
80
|
+
setAdditionalCount = _useState6[1]; // 根据表单项配置dipslay或者colSpan,额外需要计算在内的栅格占用
|
|
81
|
+
var _useState7 = useState(false),
|
|
82
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
83
|
+
collapsed = _useState8[0],
|
|
84
|
+
setCollapsed = _useState8[1];
|
|
81
85
|
var componentName = 'spec-standard-filter';
|
|
82
86
|
var _useStyle = useStyle(componentName),
|
|
83
87
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -117,10 +121,40 @@ var StandardFilter = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
117
121
|
// 计算表单隐藏项(开启展开与收缩)
|
|
118
122
|
var calculateHideCount = function calculateHideCount(filterFormRef, groups) {
|
|
119
123
|
var _filterFormRef$curren;
|
|
124
|
+
var itemGroupSize = columnNumberAndSize.itemGroupSize,
|
|
125
|
+
columnNumber = columnNumberAndSize.columnNumber;
|
|
120
126
|
var formValues = filterFormRef === null || filterFormRef === void 0 || (_filterFormRef$curren = filterFormRef.current) === null || _filterFormRef$curren === void 0 ? void 0 : _filterFormRef$curren.getFieldValue();
|
|
121
|
-
|
|
127
|
+
// Rule1: 不包括isHidden跟isHide的数据
|
|
128
|
+
// Rule2:剩余的表单项中,查找是否有自定义配置 display='block' 或者colSpan的表单项
|
|
129
|
+
var notShowGroupItem = (groups || []).filter(function (item) {
|
|
122
130
|
return (item === null || item === void 0 ? void 0 : item.isHidden) || (item.hasOwnProperty('isHide') ? item.isHide(_objectSpread({}, formValues), filterFormRef) : false);
|
|
123
|
-
})
|
|
131
|
+
});
|
|
132
|
+
// 可显示的表单值
|
|
133
|
+
var showGroupItem = (groups || []).filter(function (item) {
|
|
134
|
+
return !(item !== null && item !== void 0 && item.isHidden || (item.hasOwnProperty('isHide') ? item.isHide(_objectSpread({}, formValues), filterFormRef) : false));
|
|
135
|
+
});
|
|
136
|
+
var showGroupWithSetting = showGroupItem.filter(function (item) {
|
|
137
|
+
return item.hasOwnProperty('colSpan');
|
|
138
|
+
});
|
|
139
|
+
var resultCount = notShowGroupItem.length;
|
|
140
|
+
var aCount = 0; // 需要再次额外新增的数量
|
|
141
|
+
if (showGroupWithSetting.length > 0) {
|
|
142
|
+
showGroupWithSetting.forEach(function (gItem) {
|
|
143
|
+
// colSpan 优先级更高
|
|
144
|
+
if (gItem.hasOwnProperty('colSpan')) {
|
|
145
|
+
// console.log('有配置了colSpan, 占用栅格数量', gItem.colSpan / (24 / columnNumber), '需要再额外减1', gItem.colSpan / (24 / columnNumber) - 1, Math.ceil(gItem.colSpan / (24 / columnNumber) - 1))
|
|
146
|
+
aCount += Math.ceil(gItem.colSpan / (24 / columnNumber) - 1); // 额外占用了
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
// if (gItem.hasOwnProperty('display') && gItem.display === 'block' ) {
|
|
150
|
+
// // TODO.计算会有问题
|
|
151
|
+
// console.log('有配置了display=block', Math.ceil(24 / (24 / columnNumber) - 1))
|
|
152
|
+
// aCount += columnNumber -1 // Math.ceil(24 / (24 / columnNumber) - 1) // 额外占用了
|
|
153
|
+
// }
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
setAdditionalCount(aCount);
|
|
157
|
+
setIsHideCount(resultCount - aCount);
|
|
124
158
|
};
|
|
125
159
|
|
|
126
160
|
// 配置筛选按钮(确认与取消)
|
|
@@ -145,8 +179,8 @@ var StandardFilter = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
145
179
|
filedName: 'filterAction',
|
|
146
180
|
display: {
|
|
147
181
|
wrapperCol: {
|
|
148
|
-
// 占用的格子数按对应size配置的formItem
|
|
149
|
-
span: general.modalSize[itemGroupSize].
|
|
182
|
+
// 占用的格子数按对应size配置的formItem,如果是md则单独使用筛选的栅格配置
|
|
183
|
+
span: itemGroupSize === 'md' || itemGroupSize === 'lg' || itemGroupSize === 'xlg' ? general.modalSize[itemGroupSize].filterFormLayout.labelCol.span + general.modalSize[itemGroupSize].filterFormLayout.wrapperCol.span : general.modalSize[itemGroupSize].formLayout.labelCol.span + general.modalSize[itemGroupSize].formLayout.wrapperCol.span
|
|
150
184
|
}
|
|
151
185
|
},
|
|
152
186
|
style: {
|
|
@@ -337,7 +371,8 @@ var StandardFilter = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
337
371
|
layout: filterFormLayout,
|
|
338
372
|
form: filterFormRef,
|
|
339
373
|
collapseable: collapseable,
|
|
340
|
-
collapsed: collapsed
|
|
374
|
+
collapsed: collapsed,
|
|
375
|
+
parentNode: 'standardFilter'
|
|
341
376
|
// displayLayout={{labelCol: { span: 8 }, wrapperCol: { span: 16 },}}
|
|
342
377
|
,
|
|
343
378
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -215,7 +216,12 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
215
216
|
onFinishFailed: function onFinishFailed() {
|
|
216
217
|
// setFieldFailed(true)
|
|
217
218
|
}
|
|
218
|
-
}, /*#__PURE__*/React.createElement(Steps,
|
|
219
|
+
}, /*#__PURE__*/React.createElement(Steps, _extends({
|
|
220
|
+
style: {
|
|
221
|
+
width: '80%',
|
|
222
|
+
margin: '0 auto'
|
|
223
|
+
}
|
|
224
|
+
}, stepsConfig), formItemGroup.filter(function (fItem) {
|
|
219
225
|
return !fItem.hideStep;
|
|
220
226
|
}).map(function (item, index) {
|
|
221
227
|
return /*#__PURE__*/React.createElement(Step, {
|
|
@@ -14,7 +14,6 @@ var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
|
14
14
|
};
|
|
15
15
|
return createStyleHook(prefix, function (token) {
|
|
16
16
|
var prefixCls = ".".concat(prefix);
|
|
17
|
-
console.log('token', token);
|
|
18
17
|
return [_defineProperty(_defineProperty(_defineProperty({}, prefixCls, {
|
|
19
18
|
'.ant-modal-body ': _objectSpread(_objectSpread({}, scrollBar(token)), {}, {
|
|
20
19
|
padding: "".concat(token.paddingXS, "px 0")
|
|
@@ -105,6 +105,22 @@ declare const _default: {
|
|
|
105
105
|
span: number;
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
+
filterFormLayout: {
|
|
109
|
+
labelCol: {
|
|
110
|
+
span: number;
|
|
111
|
+
};
|
|
112
|
+
wrapperCol: {
|
|
113
|
+
span: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
filterFormBlockLayout: {
|
|
117
|
+
labelCol: {
|
|
118
|
+
span: number;
|
|
119
|
+
};
|
|
120
|
+
wrapperCol: {
|
|
121
|
+
span: number;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
108
124
|
};
|
|
109
125
|
md: {
|
|
110
126
|
columnNumber: number;
|
|
@@ -125,6 +141,22 @@ declare const _default: {
|
|
|
125
141
|
span: number;
|
|
126
142
|
};
|
|
127
143
|
};
|
|
144
|
+
filterFormLayout: {
|
|
145
|
+
labelCol: {
|
|
146
|
+
span: number;
|
|
147
|
+
};
|
|
148
|
+
wrapperCol: {
|
|
149
|
+
span: number;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
filterFormBlockLayout: {
|
|
153
|
+
labelCol: {
|
|
154
|
+
span: number;
|
|
155
|
+
};
|
|
156
|
+
wrapperCol: {
|
|
157
|
+
span: number;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
128
160
|
};
|
|
129
161
|
lg: {
|
|
130
162
|
columnNumber: number;
|
|
@@ -145,6 +177,22 @@ declare const _default: {
|
|
|
145
177
|
span: number;
|
|
146
178
|
};
|
|
147
179
|
};
|
|
180
|
+
filterFormLayout: {
|
|
181
|
+
labelCol: {
|
|
182
|
+
span: number;
|
|
183
|
+
};
|
|
184
|
+
wrapperCol: {
|
|
185
|
+
span: number;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
filterFormBlockLayout: {
|
|
189
|
+
labelCol: {
|
|
190
|
+
span: number;
|
|
191
|
+
};
|
|
192
|
+
wrapperCol: {
|
|
193
|
+
span: number;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
148
196
|
};
|
|
149
197
|
xlg: {
|
|
150
198
|
columnNumber: number;
|
|
@@ -165,6 +213,22 @@ declare const _default: {
|
|
|
165
213
|
span: number;
|
|
166
214
|
};
|
|
167
215
|
};
|
|
216
|
+
filterFormLayout: {
|
|
217
|
+
labelCol: {
|
|
218
|
+
span: number;
|
|
219
|
+
};
|
|
220
|
+
wrapperCol: {
|
|
221
|
+
span: number;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
filterFormBlockLayout: {
|
|
225
|
+
labelCol: {
|
|
226
|
+
span: number;
|
|
227
|
+
};
|
|
228
|
+
wrapperCol: {
|
|
229
|
+
span: number;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
168
232
|
};
|
|
169
233
|
xxlg: {
|
|
170
234
|
columnNumber: number;
|
|
@@ -111,6 +111,22 @@ export default {
|
|
|
111
111
|
wrapperCol: {
|
|
112
112
|
span: 15
|
|
113
113
|
}
|
|
114
|
+
},
|
|
115
|
+
filterFormLayout: {
|
|
116
|
+
labelCol: {
|
|
117
|
+
span: 7
|
|
118
|
+
},
|
|
119
|
+
wrapperCol: {
|
|
120
|
+
span: 15
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
filterFormBlockLayout: {
|
|
124
|
+
labelCol: {
|
|
125
|
+
span: 7
|
|
126
|
+
},
|
|
127
|
+
wrapperCol: {
|
|
128
|
+
span: 15
|
|
129
|
+
}
|
|
114
130
|
}
|
|
115
131
|
},
|
|
116
132
|
md: {
|
|
@@ -132,6 +148,22 @@ export default {
|
|
|
132
148
|
wrapperCol: {
|
|
133
149
|
span: 19
|
|
134
150
|
}
|
|
151
|
+
},
|
|
152
|
+
filterFormLayout: {
|
|
153
|
+
labelCol: {
|
|
154
|
+
span: 8
|
|
155
|
+
},
|
|
156
|
+
wrapperCol: {
|
|
157
|
+
span: 16
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
filterFormBlockLayout: {
|
|
161
|
+
labelCol: {
|
|
162
|
+
span: 4
|
|
163
|
+
},
|
|
164
|
+
wrapperCol: {
|
|
165
|
+
span: 20
|
|
166
|
+
}
|
|
135
167
|
}
|
|
136
168
|
},
|
|
137
169
|
// 宽度大,1000px下
|
|
@@ -154,6 +186,22 @@ export default {
|
|
|
154
186
|
wrapperCol: {
|
|
155
187
|
span: 21
|
|
156
188
|
}
|
|
189
|
+
},
|
|
190
|
+
filterFormLayout: {
|
|
191
|
+
labelCol: {
|
|
192
|
+
span: 8
|
|
193
|
+
},
|
|
194
|
+
wrapperCol: {
|
|
195
|
+
span: 16
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
filterFormBlockLayout: {
|
|
199
|
+
labelCol: {
|
|
200
|
+
span: 4
|
|
201
|
+
},
|
|
202
|
+
wrapperCol: {
|
|
203
|
+
span: 20
|
|
204
|
+
}
|
|
157
205
|
}
|
|
158
206
|
},
|
|
159
207
|
// 超级宽度大,1200px下
|
|
@@ -176,6 +224,22 @@ export default {
|
|
|
176
224
|
wrapperCol: {
|
|
177
225
|
span: 21
|
|
178
226
|
}
|
|
227
|
+
},
|
|
228
|
+
filterFormLayout: {
|
|
229
|
+
labelCol: {
|
|
230
|
+
span: 8
|
|
231
|
+
},
|
|
232
|
+
wrapperCol: {
|
|
233
|
+
span: 16
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
filterFormBlockLayout: {
|
|
237
|
+
labelCol: {
|
|
238
|
+
span: 4
|
|
239
|
+
},
|
|
240
|
+
wrapperCol: {
|
|
241
|
+
span: 20
|
|
242
|
+
}
|
|
179
243
|
}
|
|
180
244
|
},
|
|
181
245
|
xxlg: {
|
|
@@ -45,7 +45,8 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
45
45
|
_props$layout = props.layout,
|
|
46
46
|
layout = _props$layout === void 0 ? "horizontal" : _props$layout,
|
|
47
47
|
gutter = props.gutter,
|
|
48
|
-
columnCount = props.columnCount
|
|
48
|
+
columnCount = props.columnCount,
|
|
49
|
+
parentNode = props.parentNode;
|
|
49
50
|
var componentName = 'spec-item-group';
|
|
50
51
|
var _useStyle = (0, _style.default)(componentName),
|
|
51
52
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -95,6 +96,7 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
95
96
|
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
96
97
|
// 还需要判断 layout为vertical还是horizontal
|
|
97
98
|
var calculateFormLayout = (0, _react.useCallback)(function (itemData) {
|
|
99
|
+
var _general$modalSize$md, _general$modalSize$md2, _general$modalSize$lg, _general$modalSize$lg2;
|
|
98
100
|
var formLayout = {};
|
|
99
101
|
// 当布局为 'inline' 时,不配置栅格结构
|
|
100
102
|
if (layout === 'inline') {
|
|
@@ -109,11 +111,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
109
111
|
}
|
|
110
112
|
};
|
|
111
113
|
} else {
|
|
112
|
-
var _general$modalSize;
|
|
114
|
+
var _general$modalSize, _general$modalSize2;
|
|
113
115
|
// @ts-ignore
|
|
114
|
-
var sizeFormLayout = (_general$modalSize = _data.general.modalSize) === null || _general$modalSize === void 0 ? void 0 : _general$modalSize[size]
|
|
116
|
+
var sizeFormLayout = (_general$modalSize = _data.general.modalSize) === null || _general$modalSize === void 0 || (_general$modalSize = _general$modalSize[size]) === null || _general$modalSize === void 0 ? void 0 : _general$modalSize[parentNode === 'standardFilter' && (size === 'md' || size === 'lg' || size === 'xlg') ? 'filterFormLayout' : 'formLayout'];
|
|
115
117
|
// @ts-ignore
|
|
116
|
-
var sizeFormBlockLayout = _data.general.modalSize[size]
|
|
118
|
+
var sizeFormBlockLayout = (_general$modalSize2 = _data.general.modalSize) === null || _general$modalSize2 === void 0 || (_general$modalSize2 = _general$modalSize2[size]) === null || _general$modalSize2 === void 0 ? void 0 : _general$modalSize2[parentNode === 'standardFilter' && (size === 'md' || size === 'lg' || size === 'xlg') ? 'filterFormBlockLayout' : 'formBlockLayout'];
|
|
117
119
|
// 优先级 displayLayout.side > displayLayout > general
|
|
118
120
|
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
119
121
|
// 还需要判断 layout为vertical还是horizontal
|
|
@@ -125,12 +127,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
125
127
|
sizeFormBlockLayout = _data.general.modalSize.sm.formBlockLayout;
|
|
126
128
|
break;
|
|
127
129
|
case 2:
|
|
128
|
-
sizeFormLayout = _data.general.modalSize.md
|
|
129
|
-
sizeFormBlockLayout = _data.general.modalSize.md
|
|
130
|
+
sizeFormLayout = (_general$modalSize$md = _data.general.modalSize.md) === null || _general$modalSize$md === void 0 ? void 0 : _general$modalSize$md[parentNode === 'standardFilter' ? 'filterFormLayout' : 'formLayout'];
|
|
131
|
+
sizeFormBlockLayout = (_general$modalSize$md2 = _data.general.modalSize.md) === null || _general$modalSize$md2 === void 0 ? void 0 : _general$modalSize$md2[parentNode === 'standardFilter' ? 'filterFormBlockLayout' : 'formBlockLayout'];
|
|
130
132
|
break;
|
|
131
133
|
case 3:
|
|
132
|
-
sizeFormLayout = _data.general.modalSize.lg
|
|
133
|
-
sizeFormBlockLayout = _data.general.modalSize.lg
|
|
134
|
+
sizeFormLayout = (_general$modalSize$lg = _data.general.modalSize.lg) === null || _general$modalSize$lg === void 0 ? void 0 : _general$modalSize$lg[parentNode === 'standardFilter' ? 'filterFormLayout' : 'formLayout'];
|
|
135
|
+
sizeFormBlockLayout = (_general$modalSize$lg2 = _data.general.modalSize.lg) === null || _general$modalSize$lg2 === void 0 ? void 0 : _general$modalSize$lg2[parentNode === 'standardFilter' ? 'filterFormBlockLayout' : 'formBlockLayout'];
|
|
134
136
|
break;
|
|
135
137
|
case 4:
|
|
136
138
|
sizeFormLayout = _data.general.modalSize.xxlg.formLayout;
|
|
@@ -154,7 +156,7 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
154
156
|
}
|
|
155
157
|
}
|
|
156
158
|
return formLayout;
|
|
157
|
-
}, [size, layout, columnCount]);
|
|
159
|
+
}, [size, layout, columnCount, parentNode]);
|
|
158
160
|
|
|
159
161
|
// 渲染表单控件
|
|
160
162
|
var renderFormField = function renderFormField(field) {
|
|
@@ -82,10 +82,14 @@ var StandardFilter = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
82
82
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
83
83
|
isHideCount = _useState4[0],
|
|
84
84
|
setIsHideCount = _useState4[1]; // 表单隐藏项数量值
|
|
85
|
-
var _useState5 = (0, _react.useState)(
|
|
85
|
+
var _useState5 = (0, _react.useState)(0),
|
|
86
86
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
additionalCount = _useState6[0],
|
|
88
|
+
setAdditionalCount = _useState6[1]; // 根据表单项配置dipslay或者colSpan,额外需要计算在内的栅格占用
|
|
89
|
+
var _useState7 = (0, _react.useState)(false),
|
|
90
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
91
|
+
collapsed = _useState8[0],
|
|
92
|
+
setCollapsed = _useState8[1];
|
|
89
93
|
var componentName = 'spec-standard-filter';
|
|
90
94
|
var _useStyle = (0, _FilterStyle.default)(componentName),
|
|
91
95
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -125,10 +129,40 @@ var StandardFilter = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
125
129
|
// 计算表单隐藏项(开启展开与收缩)
|
|
126
130
|
var calculateHideCount = function calculateHideCount(filterFormRef, groups) {
|
|
127
131
|
var _filterFormRef$curren;
|
|
132
|
+
var itemGroupSize = columnNumberAndSize.itemGroupSize,
|
|
133
|
+
columnNumber = columnNumberAndSize.columnNumber;
|
|
128
134
|
var formValues = filterFormRef === null || filterFormRef === void 0 || (_filterFormRef$curren = filterFormRef.current) === null || _filterFormRef$curren === void 0 ? void 0 : _filterFormRef$curren.getFieldValue();
|
|
129
|
-
|
|
135
|
+
// Rule1: 不包括isHidden跟isHide的数据
|
|
136
|
+
// Rule2:剩余的表单项中,查找是否有自定义配置 display='block' 或者colSpan的表单项
|
|
137
|
+
var notShowGroupItem = (groups || []).filter(function (item) {
|
|
130
138
|
return (item === null || item === void 0 ? void 0 : item.isHidden) || (item.hasOwnProperty('isHide') ? item.isHide(_objectSpread({}, formValues), filterFormRef) : false);
|
|
131
|
-
})
|
|
139
|
+
});
|
|
140
|
+
// 可显示的表单值
|
|
141
|
+
var showGroupItem = (groups || []).filter(function (item) {
|
|
142
|
+
return !(item !== null && item !== void 0 && item.isHidden || (item.hasOwnProperty('isHide') ? item.isHide(_objectSpread({}, formValues), filterFormRef) : false));
|
|
143
|
+
});
|
|
144
|
+
var showGroupWithSetting = showGroupItem.filter(function (item) {
|
|
145
|
+
return item.hasOwnProperty('colSpan');
|
|
146
|
+
});
|
|
147
|
+
var resultCount = notShowGroupItem.length;
|
|
148
|
+
var aCount = 0; // 需要再次额外新增的数量
|
|
149
|
+
if (showGroupWithSetting.length > 0) {
|
|
150
|
+
showGroupWithSetting.forEach(function (gItem) {
|
|
151
|
+
// colSpan 优先级更高
|
|
152
|
+
if (gItem.hasOwnProperty('colSpan')) {
|
|
153
|
+
// console.log('有配置了colSpan, 占用栅格数量', gItem.colSpan / (24 / columnNumber), '需要再额外减1', gItem.colSpan / (24 / columnNumber) - 1, Math.ceil(gItem.colSpan / (24 / columnNumber) - 1))
|
|
154
|
+
aCount += Math.ceil(gItem.colSpan / (24 / columnNumber) - 1); // 额外占用了
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
// if (gItem.hasOwnProperty('display') && gItem.display === 'block' ) {
|
|
158
|
+
// // TODO.计算会有问题
|
|
159
|
+
// console.log('有配置了display=block', Math.ceil(24 / (24 / columnNumber) - 1))
|
|
160
|
+
// aCount += columnNumber -1 // Math.ceil(24 / (24 / columnNumber) - 1) // 额外占用了
|
|
161
|
+
// }
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
setAdditionalCount(aCount);
|
|
165
|
+
setIsHideCount(resultCount - aCount);
|
|
132
166
|
};
|
|
133
167
|
|
|
134
168
|
// 配置筛选按钮(确认与取消)
|
|
@@ -153,8 +187,8 @@ var StandardFilter = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
153
187
|
filedName: 'filterAction',
|
|
154
188
|
display: {
|
|
155
189
|
wrapperCol: {
|
|
156
|
-
// 占用的格子数按对应size配置的formItem
|
|
157
|
-
span: _data.general.modalSize[itemGroupSize].
|
|
190
|
+
// 占用的格子数按对应size配置的formItem,如果是md则单独使用筛选的栅格配置
|
|
191
|
+
span: itemGroupSize === 'md' || itemGroupSize === 'lg' || itemGroupSize === 'xlg' ? _data.general.modalSize[itemGroupSize].filterFormLayout.labelCol.span + _data.general.modalSize[itemGroupSize].filterFormLayout.wrapperCol.span : _data.general.modalSize[itemGroupSize].formLayout.labelCol.span + _data.general.modalSize[itemGroupSize].formLayout.wrapperCol.span
|
|
158
192
|
}
|
|
159
193
|
},
|
|
160
194
|
style: {
|
|
@@ -345,7 +379,8 @@ var StandardFilter = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
345
379
|
layout: filterFormLayout,
|
|
346
380
|
form: filterFormRef,
|
|
347
381
|
collapseable: collapseable,
|
|
348
|
-
collapsed: collapsed
|
|
382
|
+
collapsed: collapsed,
|
|
383
|
+
parentNode: 'standardFilter'
|
|
349
384
|
// displayLayout={{labelCol: { span: 8 }, wrapperCol: { span: 16 },}}
|
|
350
385
|
,
|
|
351
386
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -16,6 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
19
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
20
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
21
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
22
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -224,7 +225,12 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
224
225
|
onFinishFailed: function onFinishFailed() {
|
|
225
226
|
// setFieldFailed(true)
|
|
226
227
|
}
|
|
227
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Steps,
|
|
228
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Steps, _extends({
|
|
229
|
+
style: {
|
|
230
|
+
width: '80%',
|
|
231
|
+
margin: '0 auto'
|
|
232
|
+
}
|
|
233
|
+
}, stepsConfig), formItemGroup.filter(function (fItem) {
|
|
228
234
|
return !fItem.hideStep;
|
|
229
235
|
}).map(function (item, index) {
|
|
230
236
|
return /*#__PURE__*/_react.default.createElement(Step, {
|
|
@@ -20,7 +20,6 @@ var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
|
20
20
|
};
|
|
21
21
|
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
22
22
|
var prefixCls = ".".concat(prefix);
|
|
23
|
-
console.log('token', token);
|
|
24
23
|
return [_defineProperty(_defineProperty(_defineProperty({}, prefixCls, {
|
|
25
24
|
'.ant-modal-body ': _objectSpread(_objectSpread({}, (0, _index.scrollBar)(token)), {}, {
|
|
26
25
|
padding: "".concat(token.paddingXS, "px 0")
|
|
@@ -105,6 +105,22 @@ declare const _default: {
|
|
|
105
105
|
span: number;
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
|
+
filterFormLayout: {
|
|
109
|
+
labelCol: {
|
|
110
|
+
span: number;
|
|
111
|
+
};
|
|
112
|
+
wrapperCol: {
|
|
113
|
+
span: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
filterFormBlockLayout: {
|
|
117
|
+
labelCol: {
|
|
118
|
+
span: number;
|
|
119
|
+
};
|
|
120
|
+
wrapperCol: {
|
|
121
|
+
span: number;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
108
124
|
};
|
|
109
125
|
md: {
|
|
110
126
|
columnNumber: number;
|
|
@@ -125,6 +141,22 @@ declare const _default: {
|
|
|
125
141
|
span: number;
|
|
126
142
|
};
|
|
127
143
|
};
|
|
144
|
+
filterFormLayout: {
|
|
145
|
+
labelCol: {
|
|
146
|
+
span: number;
|
|
147
|
+
};
|
|
148
|
+
wrapperCol: {
|
|
149
|
+
span: number;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
filterFormBlockLayout: {
|
|
153
|
+
labelCol: {
|
|
154
|
+
span: number;
|
|
155
|
+
};
|
|
156
|
+
wrapperCol: {
|
|
157
|
+
span: number;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
128
160
|
};
|
|
129
161
|
lg: {
|
|
130
162
|
columnNumber: number;
|
|
@@ -145,6 +177,22 @@ declare const _default: {
|
|
|
145
177
|
span: number;
|
|
146
178
|
};
|
|
147
179
|
};
|
|
180
|
+
filterFormLayout: {
|
|
181
|
+
labelCol: {
|
|
182
|
+
span: number;
|
|
183
|
+
};
|
|
184
|
+
wrapperCol: {
|
|
185
|
+
span: number;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
filterFormBlockLayout: {
|
|
189
|
+
labelCol: {
|
|
190
|
+
span: number;
|
|
191
|
+
};
|
|
192
|
+
wrapperCol: {
|
|
193
|
+
span: number;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
148
196
|
};
|
|
149
197
|
xlg: {
|
|
150
198
|
columnNumber: number;
|
|
@@ -165,6 +213,22 @@ declare const _default: {
|
|
|
165
213
|
span: number;
|
|
166
214
|
};
|
|
167
215
|
};
|
|
216
|
+
filterFormLayout: {
|
|
217
|
+
labelCol: {
|
|
218
|
+
span: number;
|
|
219
|
+
};
|
|
220
|
+
wrapperCol: {
|
|
221
|
+
span: number;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
filterFormBlockLayout: {
|
|
225
|
+
labelCol: {
|
|
226
|
+
span: number;
|
|
227
|
+
};
|
|
228
|
+
wrapperCol: {
|
|
229
|
+
span: number;
|
|
230
|
+
};
|
|
231
|
+
};
|
|
168
232
|
};
|
|
169
233
|
xxlg: {
|
|
170
234
|
columnNumber: number;
|