fan-standard-comp 3.1.11 → 3.1.13
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.umd.js +8 -8
- package/es/ButtonGroup/index.js +4 -4
- package/es/FormComp/RenderItemGroup/index.js +15 -2
- package/es/NavLeafScroll/index.js +115 -43
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/StandardForm/StepForm.js +10 -4
- package/es/StandardModal/index.js +7 -2
- package/lib/ButtonGroup/index.js +4 -4
- package/lib/FormComp/RenderItemGroup/index.js +15 -2
- package/lib/NavLeafScroll/index.js +115 -43
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/StandardForm/StepForm.js +10 -4
- package/lib/StandardModal/index.js +7 -2
- package/package.json +1 -1
package/es/ButtonGroup/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
75
75
|
key: index
|
|
76
76
|
}, item.children.map(function (child, childIndex) {
|
|
77
77
|
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
78
|
-
key: childIndex
|
|
78
|
+
key: child.name + childIndex
|
|
79
79
|
}, /*#__PURE__*/React.createElement("a", {
|
|
80
80
|
onClick: child.fn ? function () {
|
|
81
81
|
return child.fn(child);
|
|
@@ -86,7 +86,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
88
|
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
89
|
-
key: index
|
|
89
|
+
key: item.name + index
|
|
90
90
|
}, /*#__PURE__*/React.createElement("a", {
|
|
91
91
|
onClick: item.fn ? function () {
|
|
92
92
|
return item.fn(item);
|
|
@@ -173,10 +173,10 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
173
173
|
if (gItem.children) {
|
|
174
174
|
return /*#__PURE__*/React.createElement(_Menu.SubMenu, {
|
|
175
175
|
title: gItem.exName || gItem.name,
|
|
176
|
-
key: gItem
|
|
176
|
+
key: gItem.name + gIndex
|
|
177
177
|
}, gItem.children.map(function (child, childIndex) {
|
|
178
178
|
return /*#__PURE__*/React.createElement(_Menu.Item, {
|
|
179
|
-
key: childIndex
|
|
179
|
+
key: child.name + childIndex
|
|
180
180
|
}, /*#__PURE__*/React.createElement("a", {
|
|
181
181
|
onClick: child.fn ? function () {
|
|
182
182
|
return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
@@ -48,6 +48,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
48
48
|
}
|
|
49
49
|
return isHide || false;
|
|
50
50
|
};
|
|
51
|
+
// layout='inline'条件下设置指定控件宽度自动
|
|
52
|
+
var setAutoWidth = function setAutoWidth(fieldType) {
|
|
53
|
+
var widgets = ['checkbox', 'radio', 'datePicker', 'dateTimePicker', 'rangePicker', 'rangeTimePicker', 'timePicker', 'timePickerRange'];
|
|
54
|
+
if (!fieldType) return false;
|
|
55
|
+
return widgets.includes(fieldType);
|
|
56
|
+
};
|
|
51
57
|
// 渲染表单控件
|
|
52
58
|
var renderFormField = function renderFormField(field) {
|
|
53
59
|
var componentStyle = field.componentStyle,
|
|
@@ -69,7 +75,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
69
75
|
},
|
|
70
76
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
71
77
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
72
|
-
style:
|
|
78
|
+
// style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}
|
|
79
|
+
// style={componentStyle || (layout === 'inline' ? { ...general.formItemStyle.xsm } : { ...general.formItemStyle.wide } )}
|
|
80
|
+
style: Object.assign({
|
|
81
|
+
width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : general.formItemStyle.xsm.width : general.formItemStyle.wide.width
|
|
82
|
+
}, componentStyle)
|
|
73
83
|
}))), extra ? extra(field, form) : '');
|
|
74
84
|
} else {
|
|
75
85
|
return /*#__PURE__*/React.createElement(Field, Object.assign({}, field, {
|
|
@@ -88,7 +98,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
88
98
|
},
|
|
89
99
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
90
100
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
91
|
-
style
|
|
101
|
+
// style={componentStyle || { ...general.formItemStyle.wide }}
|
|
102
|
+
style: Object.assign({
|
|
103
|
+
width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : general.formItemStyle.xsm.width : general.formItemStyle.wide.width
|
|
104
|
+
}, componentStyle)
|
|
92
105
|
}));
|
|
93
106
|
}
|
|
94
107
|
};
|
|
@@ -30,6 +30,7 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
30
30
|
_defineProperty(_assertThisInitialized(_this), "initFloorValues", function () {
|
|
31
31
|
var _this$props = _this.props,
|
|
32
32
|
baseItemHeight = _this$props.baseItemHeight,
|
|
33
|
+
baseItemWidth = _this$props.baseItemWidth,
|
|
33
34
|
activeKey = _this$props.activeKey,
|
|
34
35
|
navList = _this$props.navList,
|
|
35
36
|
_this$props$optionNam = _this$props.optionName,
|
|
@@ -37,68 +38,106 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
37
38
|
key: 'id',
|
|
38
39
|
title: 'title',
|
|
39
40
|
count: 'count'
|
|
40
|
-
} : _this$props$optionNam
|
|
41
|
+
} : _this$props$optionNam,
|
|
42
|
+
type = _this$props.type; // 元素个数占用的高度是否不超过内容区域
|
|
41
43
|
var isInsideEnough = navList.length * baseItemHeight <= _this.mainWrap.current.clientHeight;
|
|
42
44
|
var wrapHeight = _this.mainWrap.current.clientHeight - (isInsideEnough ? 0 : 32 * 2); // 每次需要移动的偏移量 32是上下切换角占用的高度
|
|
43
45
|
var floorHeight = _this.leafNav.current.clientHeight; // 所有楼层占用的高度
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
// const isEnough = wrapHeight % baseItemHeight === 0; // 剩余的是否足够容纳一个单元格
|
|
47
|
+
var isInsideEnoughWidth = navList.length * baseItemWidth <= _this.mainWrap.current.clientWidth;
|
|
48
|
+
var wrapWidth = _this.mainWrap.current.clientWidth - (isInsideEnoughWidth ? 0 : 30 * 2);
|
|
49
|
+
var floorWidth = _this.leafNav.current.clientWidth; // 所有楼层占用的宽度
|
|
50
|
+
if (type === 'horizontal') {
|
|
51
|
+
// 判断有效区域与单元格高度:若小于,则直接使用单元格高度,否则将内容区高度去除不足一个单元格高度
|
|
52
|
+
if (_this.mainWrap.current.clientWidth - (isInsideEnoughWidth ? 0 : 30 * 2) >= baseItemWidth) {
|
|
53
|
+
wrapWidth -= wrapWidth % baseItemWidth; // 判断是否除不尽,如果还有余数,则当前 区域有效区域要去除一个单元格的高度
|
|
54
|
+
} else {
|
|
55
|
+
wrapWidth = baseItemWidth;
|
|
56
|
+
}
|
|
48
57
|
} else {
|
|
49
|
-
|
|
58
|
+
// 判断有效区域与单元格高度:若小于,则直接使用单元格高度,否则将内容区高度去除不足一个单元格高度
|
|
59
|
+
if (_this.mainWrap.current.clientHeight - (isInsideEnough ? 0 : 32 * 2) >= baseItemHeight) {
|
|
60
|
+
wrapHeight -= wrapHeight % baseItemHeight; // 判断是否除不尽,如果还有余数,则当前 区域有效区域要去除一个单元格的高度
|
|
61
|
+
} else {
|
|
62
|
+
wrapHeight = baseItemHeight;
|
|
63
|
+
}
|
|
50
64
|
}
|
|
51
|
-
var stepSize = wrapHeight / baseItemHeight; // - (isEnough ? 0 : 1) // 当前一页可容纳的单元格数量
|
|
65
|
+
var stepSize = type === 'horizontal' ? wrapWidth / baseItemWidth : wrapHeight / baseItemHeight; // - (isEnough ? 0 : 1) // 当前一页可容纳的单元格数量
|
|
52
66
|
_this.setState({
|
|
53
67
|
floorRelatedSize: {
|
|
54
68
|
wrapHeight: wrapHeight,
|
|
55
69
|
// 有效内容区域的
|
|
56
|
-
floorHeight: floorHeight
|
|
70
|
+
floorHeight: floorHeight,
|
|
71
|
+
// 楼层列表占用的高度
|
|
72
|
+
wrapWidth: wrapWidth,
|
|
73
|
+
floorWidth: floorWidth
|
|
57
74
|
},
|
|
58
|
-
|
|
59
75
|
stepSize: stepSize,
|
|
60
|
-
showArrow: floorHeight > wrapHeight
|
|
76
|
+
showArrow: type === 'horizontal' ? isInsideEnoughWidth ? false : floorWidth > wrapWidth : isInsideEnough ? false : floorHeight > wrapHeight
|
|
61
77
|
});
|
|
62
78
|
if (activeKey && navList.length > 0) {
|
|
63
79
|
var matchIndex = _.findIndex(navList, function (item) {
|
|
64
80
|
return item[(optionName === null || optionName === void 0 ? void 0 : optionName.key) || 'id'] === activeKey;
|
|
65
81
|
});
|
|
66
|
-
var stepNo = wrapHeight === 0 ? 0 : Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
82
|
+
var stepNo = type === 'horizontal' ? wrapWidth === 0 ? 0 : Math.floor(matchIndex / (wrapWidth / baseItemWidth)) : wrapHeight === 0 ? 0 : Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
67
83
|
var stepTotalSize = Math.ceil(navList.length / stepSize) || 0; // 当前所有单元格占用的页总数
|
|
68
84
|
_this.setState({
|
|
85
|
+
leafNavScrollX: matchIndex !== -1 && stepNo !== 0 ? -wrapWidth * stepNo : 0,
|
|
69
86
|
leafNavScrollY: matchIndex !== -1 && stepNo !== 0 ? -wrapHeight * stepNo : 0,
|
|
70
87
|
// 如果当前默认传值有楼层节点,则需要判断其所在的位置
|
|
71
88
|
arrowPermit: {
|
|
72
89
|
prev: matchIndex !== -1 && stepNo !== 0,
|
|
73
|
-
|
|
90
|
+
left: matchIndex !== -1 && stepNo !== 0,
|
|
91
|
+
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize,
|
|
92
|
+
right: floorWidth > wrapWidth && stepNo + 1 !== stepTotalSize
|
|
74
93
|
}
|
|
75
94
|
});
|
|
76
95
|
} else {
|
|
77
96
|
_this.setState({
|
|
97
|
+
leafNavScrollX: 0,
|
|
78
98
|
leafNavScrollY: 0,
|
|
79
99
|
arrowPermit: {
|
|
80
100
|
prev: false,
|
|
81
|
-
|
|
101
|
+
left: false,
|
|
102
|
+
next: floorHeight > wrapHeight,
|
|
103
|
+
right: floorWidth > wrapWidth
|
|
82
104
|
}
|
|
83
105
|
});
|
|
84
106
|
}
|
|
85
107
|
});
|
|
86
|
-
_defineProperty(_assertThisInitialized(_this), "handleLeafControl", function (
|
|
108
|
+
_defineProperty(_assertThisInitialized(_this), "handleLeafControl", function (method) {
|
|
109
|
+
var type = _this.props.type;
|
|
87
110
|
var _this$state = _this.state,
|
|
88
111
|
floorRelatedSize = _this$state.floorRelatedSize,
|
|
89
|
-
leafNavScrollY = _this$state.leafNavScrollY
|
|
112
|
+
leafNavScrollY = _this$state.leafNavScrollY,
|
|
113
|
+
leafNavScrollX = _this$state.leafNavScrollX;
|
|
90
114
|
var wrapHeight = floorRelatedSize.wrapHeight,
|
|
91
|
-
floorHeight = floorRelatedSize.floorHeight
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
115
|
+
floorHeight = floorRelatedSize.floorHeight,
|
|
116
|
+
wrapWidth = floorRelatedSize.wrapWidth,
|
|
117
|
+
floorWidth = floorRelatedSize.floorWidth;
|
|
118
|
+
if (type === 'horizontal') {
|
|
119
|
+
var maxNextPosition = -(wrapWidth * (Math.ceil(floorWidth / wrapWidth) - 1)); // 向右滚动的最大值
|
|
120
|
+
var scrollX = method === 'right' ? leafNavScrollX - wrapWidth : leafNavScrollX + wrapWidth;
|
|
121
|
+
_this.setState({
|
|
122
|
+
arrowPermit: {
|
|
123
|
+
left: method === 'left' ? scrollX !== 0 : true,
|
|
124
|
+
right: method === 'left' ? true : scrollX !== maxNextPosition // 滚动大小与最大滚动值一致时,向右滚动禁用,
|
|
125
|
+
},
|
|
99
126
|
|
|
100
|
-
|
|
101
|
-
|
|
127
|
+
leafNavScrollX: scrollX
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
var _maxNextPosition = -(wrapHeight * (Math.ceil(floorHeight / wrapHeight) - 1)); // 向下滚动的最大值
|
|
131
|
+
var scrollY = method === 'next' ? leafNavScrollY - wrapHeight : leafNavScrollY + wrapHeight;
|
|
132
|
+
_this.setState({
|
|
133
|
+
arrowPermit: {
|
|
134
|
+
prev: method === 'prev' ? scrollY !== 0 : true,
|
|
135
|
+
next: method === 'prev' ? true : scrollY !== _maxNextPosition // 滚动大小与最大滚动值一致时,向下滚动禁用,
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
leafNavScrollY: scrollY
|
|
139
|
+
});
|
|
140
|
+
}
|
|
102
141
|
});
|
|
103
142
|
_defineProperty(_assertThisInitialized(_this), "handleItemControl", function (key, data) {
|
|
104
143
|
var onClick = _this.props.onClick;
|
|
@@ -119,21 +158,25 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
119
158
|
onMouseLeave && onMouseLeave(e);
|
|
120
159
|
});
|
|
121
160
|
_defineProperty(_assertThisInitialized(_this), "mouseWheel", function (e) {
|
|
161
|
+
var type = _this.props.type;
|
|
122
162
|
var _this$state2 = _this.state,
|
|
123
163
|
isMouseEnter = _this$state2.isMouseEnter,
|
|
124
164
|
arrowPermit = _this$state2.arrowPermit;
|
|
125
165
|
if (!isMouseEnter) return; // 鼠标没有经过内容区域,则不会滚轮监听
|
|
126
166
|
e.preventDefault();
|
|
127
167
|
if (e.deltaY <= 0) {
|
|
128
|
-
|
|
168
|
+
// 向上滚动(向左滚动)
|
|
169
|
+
type === 'horizontal' ? arrowPermit.left && _this.handleLeafControl('left') : arrowPermit.prev && _this.handleLeafControl('prev');
|
|
129
170
|
} else {
|
|
130
|
-
arrowPermit.next && _this.handleLeafControl('next'); // 向下滚动
|
|
171
|
+
type === 'horizontal' ? arrowPermit.right && _this.handleLeafControl('right') : arrowPermit.next && _this.handleLeafControl('next'); // 向下滚动(向右滚动)
|
|
131
172
|
}
|
|
132
|
-
// onWheel && onWheel(e)
|
|
133
173
|
});
|
|
134
174
|
_this.state = {
|
|
135
175
|
isMouseEnter: false,
|
|
176
|
+
leafNavScrollX: 0,
|
|
177
|
+
// 水平滚动区域
|
|
136
178
|
leafNavScrollY: 0,
|
|
179
|
+
// 垂直滚动区域
|
|
137
180
|
showArrow: false,
|
|
138
181
|
arrowPermit: {
|
|
139
182
|
prev: false,
|
|
@@ -185,6 +228,8 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
185
228
|
value: function componentDidUpdate(prevProps) {
|
|
186
229
|
var _this$props2 = this.props,
|
|
187
230
|
baseItemHeight = _this$props2.baseItemHeight,
|
|
231
|
+
baseItemWidth = _this$props2.baseItemWidth,
|
|
232
|
+
type = _this$props2.type,
|
|
188
233
|
navList = _this$props2.navList,
|
|
189
234
|
activeKey = _this$props2.activeKey,
|
|
190
235
|
_this$props2$optionNa = _this$props2.optionName,
|
|
@@ -198,8 +243,11 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
198
243
|
_this$state3$floorRel = _this$state3.floorRelatedSize,
|
|
199
244
|
wrapHeight = _this$state3$floorRel.wrapHeight,
|
|
200
245
|
floorHeight = _this$state3$floorRel.floorHeight,
|
|
246
|
+
wrapWidth = _this$state3$floorRel.wrapWidth,
|
|
247
|
+
floorWidth = _this$state3$floorRel.floorWidth,
|
|
201
248
|
stepSize = _this$state3.stepSize;
|
|
202
|
-
if (
|
|
249
|
+
if (type === 'horizontal') {}
|
|
250
|
+
if (JSON.stringify(navList) !== JSON.stringify(prevProps.navList) || (type === 'horizontal' ? baseItemWidth !== prevProps.baseItemWidth : baseItemHeight !== prevProps.baseItemHeight)) {
|
|
203
251
|
this.initFloorValues();
|
|
204
252
|
}
|
|
205
253
|
if (forbidScroll !== prevProps.forbidScroll) {
|
|
@@ -217,14 +265,18 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
217
265
|
var matchIndex = _.findIndex(navList, function (item) {
|
|
218
266
|
return item[optionName.key] === activeKey;
|
|
219
267
|
});
|
|
220
|
-
var stepNo = Math.floor(matchIndex / (wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
268
|
+
var stepNo = Math.floor(matchIndex / (type === 'horizontal' ? wrapWidth / baseItemWidth : wrapHeight / baseItemHeight)); // 当前所在的切换页数,从0开始
|
|
221
269
|
var stepTotalSize = Array.isArray(navList) && Math.ceil(navList.length / stepSize) || 0; // 当前所有单元格占用的页总数
|
|
270
|
+
console.log('stepTotalSize', stepTotalSize);
|
|
222
271
|
this.setState({
|
|
272
|
+
leafNavScrollX: matchIndex !== -1 && stepNo !== 0 ? -wrapWidth * stepNo : 0,
|
|
223
273
|
leafNavScrollY: matchIndex !== -1 && stepNo !== 0 ? -wrapHeight * stepNo : 0,
|
|
224
274
|
// 如果当前默认传值有楼层节点,则需要判断其所在的位置
|
|
225
275
|
arrowPermit: {
|
|
226
276
|
prev: matchIndex !== -1 && stepNo !== 0,
|
|
227
|
-
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize
|
|
277
|
+
next: floorHeight > wrapHeight && stepNo + 1 !== stepTotalSize,
|
|
278
|
+
left: matchIndex !== -1 && stepNo !== 0,
|
|
279
|
+
right: floorWidth > wrapWidth && stepNo + 1 !== stepTotalSize
|
|
228
280
|
},
|
|
229
281
|
isMouseEnter: true
|
|
230
282
|
});
|
|
@@ -250,16 +302,20 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
250
302
|
count: 'count'
|
|
251
303
|
} : _this$props3$optionNa,
|
|
252
304
|
_this$props3$emptyNod = _this$props3.emptyNode,
|
|
253
|
-
emptyNode = _this$props3$emptyNod === void 0 ? null : _this$props3$emptyNod
|
|
305
|
+
emptyNode = _this$props3$emptyNod === void 0 ? null : _this$props3$emptyNod,
|
|
306
|
+
type = _this$props3.type,
|
|
307
|
+
height = _this$props3.height;
|
|
254
308
|
var _this$state4 = this.state,
|
|
255
309
|
showArrow = _this$state4.showArrow,
|
|
256
310
|
arrowPermit = _this$state4.arrowPermit,
|
|
257
|
-
leafNavScrollY = _this$state4.leafNavScrollY
|
|
311
|
+
leafNavScrollY = _this$state4.leafNavScrollY,
|
|
312
|
+
leafNavScrollX = _this$state4.leafNavScrollX;
|
|
258
313
|
return /*#__PURE__*/React.createElement("div", {
|
|
259
|
-
className: classNames(className, "nav-leaf"),
|
|
260
|
-
style:
|
|
261
|
-
width: "".concat(width, "px")
|
|
262
|
-
|
|
314
|
+
className: classNames(className, "nav-leaf", type === 'horizontal' ? 'nav-leaf-horizontal' : ''),
|
|
315
|
+
style: {
|
|
316
|
+
width: width ? "".concat(width, "px") : '',
|
|
317
|
+
height: height ? "".concat(height, "px") : ''
|
|
318
|
+
},
|
|
263
319
|
ref: this.mainWrap
|
|
264
320
|
// onWheel={this.mouseWheel}
|
|
265
321
|
,
|
|
@@ -271,7 +327,21 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
271
327
|
padding: 0
|
|
272
328
|
} : {},
|
|
273
329
|
"data-prev": showArrow
|
|
274
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
330
|
+
}, type === 'horizontal' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
331
|
+
className: classNames("nav-leaf-arrow nav-leaf-btn-left", showArrow ? '' : 'is-hide', arrowPermit.left ? '' : 'is-disabled'),
|
|
332
|
+
onClick: function onClick() {
|
|
333
|
+
return arrowPermit.left ? _this2.handleLeafControl('left') : '';
|
|
334
|
+
}
|
|
335
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
336
|
+
name: "caret-left"
|
|
337
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
338
|
+
className: classNames("nav-leaf-arrow nav-leaf-btn-right", showArrow ? '' : 'is-hide', arrowPermit.right ? '' : 'is-disabled'),
|
|
339
|
+
onClick: function onClick() {
|
|
340
|
+
return arrowPermit.right ? _this2.handleLeafControl('right') : '';
|
|
341
|
+
}
|
|
342
|
+
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
343
|
+
name: "caret-right"
|
|
344
|
+
}))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
275
345
|
className: classNames("nav-leaf-arrow nav-leaf-btn-prev", showArrow ? '' : 'is-hide', arrowPermit.prev ? '' : 'is-disabled'),
|
|
276
346
|
onClick: function onClick() {
|
|
277
347
|
return arrowPermit.prev ? _this2.handleLeafControl('prev') : '';
|
|
@@ -285,7 +355,7 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
285
355
|
}
|
|
286
356
|
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
287
357
|
name: "caret-down"
|
|
288
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
358
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
289
359
|
className: "nav-leaf-wrap",
|
|
290
360
|
ref: this.leafWrap
|
|
291
361
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -294,15 +364,17 @@ var NavLeafScroll = /*#__PURE__*/function (_Component) {
|
|
|
294
364
|
className: "nav-leaf-nav",
|
|
295
365
|
ref: this.leafNav,
|
|
296
366
|
style: {
|
|
297
|
-
transform: "translate3d(
|
|
367
|
+
transform: "translate3d(".concat(type === 'horizontal' ? leafNavScrollX : 0, "px, ").concat(type === 'horizontal' ? 0 : leafNavScrollY, "px, 0px)")
|
|
298
368
|
}
|
|
299
369
|
}, navList && navList.length > 0 ? navList.map(function (item, i) {
|
|
300
|
-
var _this2$props;
|
|
370
|
+
var _this2$props, _this2$props2;
|
|
301
371
|
return /*#__PURE__*/React.createElement("div", {
|
|
302
372
|
key: item[optionName.key],
|
|
303
373
|
className: classNames('nav-leaf-item', activeKey && activeKey === item[optionName.key] ? 'is-active' : ''),
|
|
304
|
-
style: {
|
|
305
|
-
|
|
374
|
+
style: type === 'horizontal' ? {
|
|
375
|
+
width: "".concat(((_this2$props = _this2.props) === null || _this2$props === void 0 ? void 0 : _this2$props.baseItemWidth) || 60, "px")
|
|
376
|
+
} : {
|
|
377
|
+
height: "".concat(((_this2$props2 = _this2.props) === null || _this2$props2 === void 0 ? void 0 : _this2$props2.baseItemHeight) || 40, "px")
|
|
306
378
|
},
|
|
307
379
|
onClick: function onClick() {
|
|
308
380
|
return _this2.handleItemControl(item[optionName.key], item);
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
.nav-leaf {
|
|
5
5
|
width: 110px;
|
|
6
6
|
height: 100%;
|
|
7
|
+
&.nav-leaf-horizontal {
|
|
8
|
+
width: 100%;
|
|
9
|
+
.nav-leaf-container.nav-leaf-container-scroll {
|
|
10
|
+
padding: 0 30px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
7
13
|
//.nav-leaf-container {
|
|
8
14
|
// height: ~'calc(100vh - @{nav-header-height})';
|
|
9
15
|
//}
|
|
@@ -31,6 +37,17 @@
|
|
|
31
37
|
height: 100%;
|
|
32
38
|
overflow: hidden;
|
|
33
39
|
}
|
|
40
|
+
&.nav-leaf-horizontal {
|
|
41
|
+
.nav-leaf-item {
|
|
42
|
+
display: inline-block;
|
|
43
|
+
text-align: center;
|
|
44
|
+
border-top-right-radius: 20px;
|
|
45
|
+
border-bottom-right-radius: 20px;
|
|
46
|
+
}
|
|
47
|
+
.nav-leaf-nav {
|
|
48
|
+
width: inherit;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
34
51
|
.nav-leaf-nav {
|
|
35
52
|
position: relative;
|
|
36
53
|
display: inline-block;
|
|
@@ -42,7 +59,6 @@
|
|
|
42
59
|
}
|
|
43
60
|
.nav-leaf-arrow {
|
|
44
61
|
position: absolute;
|
|
45
|
-
left: 0;
|
|
46
62
|
width: 100%;
|
|
47
63
|
height: 32px;
|
|
48
64
|
color: @text-color;
|
|
@@ -58,11 +74,27 @@
|
|
|
58
74
|
color: fade(@primary-color, 30%) !important;
|
|
59
75
|
cursor: not-allowed !important;
|
|
60
76
|
}
|
|
77
|
+
&.nav-leaf-btn-left {
|
|
78
|
+
width: 30px;
|
|
79
|
+
height: auto;
|
|
80
|
+
top: 50%;
|
|
81
|
+
left: 0;
|
|
82
|
+
transform: translateY(-50%);
|
|
83
|
+
}
|
|
84
|
+
&.nav-leaf-btn-right{
|
|
85
|
+
width: 30px;
|
|
86
|
+
height: auto;
|
|
87
|
+
top: 50%;
|
|
88
|
+
right: 0;
|
|
89
|
+
transform: translateY(-50%);
|
|
90
|
+
}
|
|
61
91
|
&.nav-leaf-btn-prev {
|
|
62
92
|
top: 0;
|
|
93
|
+
left:0;
|
|
63
94
|
}
|
|
64
95
|
&.nav-leaf-btn-next {
|
|
65
96
|
bottom: 0;
|
|
97
|
+
left:0;
|
|
66
98
|
}
|
|
67
99
|
}
|
|
68
100
|
.nav-leaf-item {
|
|
@@ -204,8 +204,10 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
204
204
|
onFinishFailed: function onFinishFailed() {
|
|
205
205
|
// setFieldFailed(true)
|
|
206
206
|
}
|
|
207
|
-
}, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig), formItemGroup.
|
|
208
|
-
return !
|
|
207
|
+
}, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig), formItemGroup.filter(function (fItem) {
|
|
208
|
+
return !fItem.hideStep;
|
|
209
|
+
}).map(function (item, index) {
|
|
210
|
+
return /*#__PURE__*/React.createElement(Step, {
|
|
209
211
|
key: "".concat(item.title).concat(index),
|
|
210
212
|
description: item.description,
|
|
211
213
|
icon: item.icon,
|
|
@@ -213,8 +215,12 @@ var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
213
215
|
title: item.title,
|
|
214
216
|
subTitle: item.subTitle,
|
|
215
217
|
disabled: item.disabled
|
|
216
|
-
})
|
|
217
|
-
})),
|
|
218
|
+
});
|
|
219
|
+
})),
|
|
220
|
+
// 过滤隐藏掉的步骤表单
|
|
221
|
+
formItemGroup.filter(function (fItem) {
|
|
222
|
+
return !fItem.hideStep;
|
|
223
|
+
}).map(function (item, index) {
|
|
218
224
|
return /*#__PURE__*/React.createElement("div", {
|
|
219
225
|
key: index,
|
|
220
226
|
className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
|
|
@@ -84,7 +84,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
84
84
|
return ((_b = activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
|
85
85
|
}
|
|
86
86
|
if (type === 'stepForm') {
|
|
87
|
-
var currentStepInfo = formItemGroup
|
|
87
|
+
var currentStepInfo = formItemGroup.filter(function (fItem) {
|
|
88
|
+
return !fItem.hideStep;
|
|
89
|
+
})[stepsConfig.current];
|
|
88
90
|
openLog && console.log('rule 0-2', ((_c = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _c === void 0 ? void 0 : _c.length) > 0);
|
|
89
91
|
return ((_d = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _d === void 0 ? void 0 : _d.length) > 0;
|
|
90
92
|
}
|
|
@@ -370,7 +372,10 @@ var StandardModal = function StandardModal(props) {
|
|
|
370
372
|
var renderFooter = function renderFooter() {
|
|
371
373
|
var _a, _b;
|
|
372
374
|
if (type === 'stepForm') {
|
|
373
|
-
|
|
375
|
+
// 过滤隐藏掉的步骤表单
|
|
376
|
+
var currentStepInfo = formItemGroup.filter(function (fItem) {
|
|
377
|
+
return !fItem.hideStep;
|
|
378
|
+
})[stepsConfig.current];
|
|
374
379
|
return ((_a = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _a === void 0 ? void 0 : _a.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
|
|
375
380
|
list: currentStepInfo.actions || [],
|
|
376
381
|
onStep: handleStepType,
|
package/lib/ButtonGroup/index.js
CHANGED
|
@@ -85,7 +85,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
85
85
|
key: index
|
|
86
86
|
}, item.children.map(function (child, childIndex) {
|
|
87
87
|
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
88
|
-
key: childIndex
|
|
88
|
+
key: child.name + childIndex
|
|
89
89
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
90
90
|
onClick: child.fn ? function () {
|
|
91
91
|
return child.fn(child);
|
|
@@ -96,7 +96,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
96
96
|
}));
|
|
97
97
|
}
|
|
98
98
|
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
99
|
-
key: index
|
|
99
|
+
key: item.name + index
|
|
100
100
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
101
101
|
onClick: item.fn ? function () {
|
|
102
102
|
return item.fn(item);
|
|
@@ -183,10 +183,10 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
183
183
|
if (gItem.children) {
|
|
184
184
|
return /*#__PURE__*/_react.default.createElement(_menu.default.SubMenu, {
|
|
185
185
|
title: gItem.exName || gItem.name,
|
|
186
|
-
key: gItem
|
|
186
|
+
key: gItem.name + gIndex
|
|
187
187
|
}, gItem.children.map(function (child, childIndex) {
|
|
188
188
|
return /*#__PURE__*/_react.default.createElement(_menu.default.Item, {
|
|
189
|
-
key: childIndex
|
|
189
|
+
key: child.name + childIndex
|
|
190
190
|
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
191
191
|
onClick: child.fn ? function () {
|
|
192
192
|
return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
@@ -55,6 +55,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
55
55
|
}
|
|
56
56
|
return isHide || false;
|
|
57
57
|
};
|
|
58
|
+
// layout='inline'条件下设置指定控件宽度自动
|
|
59
|
+
var setAutoWidth = function setAutoWidth(fieldType) {
|
|
60
|
+
var widgets = ['checkbox', 'radio', 'datePicker', 'dateTimePicker', 'rangePicker', 'rangeTimePicker', 'timePicker', 'timePickerRange'];
|
|
61
|
+
if (!fieldType) return false;
|
|
62
|
+
return widgets.includes(fieldType);
|
|
63
|
+
};
|
|
58
64
|
// 渲染表单控件
|
|
59
65
|
var renderFormField = function renderFormField(field) {
|
|
60
66
|
var componentStyle = field.componentStyle,
|
|
@@ -76,7 +82,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
76
82
|
},
|
|
77
83
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
78
84
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
79
|
-
style:
|
|
85
|
+
// style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}
|
|
86
|
+
// style={componentStyle || (layout === 'inline' ? { ...general.formItemStyle.xsm } : { ...general.formItemStyle.wide } )}
|
|
87
|
+
style: Object.assign({
|
|
88
|
+
width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : _data.general.formItemStyle.xsm.width : _data.general.formItemStyle.wide.width
|
|
89
|
+
}, componentStyle)
|
|
80
90
|
}))), extra ? extra(field, form) : '');
|
|
81
91
|
} else {
|
|
82
92
|
return /*#__PURE__*/_react.default.createElement(_FieldComponent.default, Object.assign({}, field, {
|
|
@@ -95,7 +105,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
95
105
|
},
|
|
96
106
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
97
107
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
98
|
-
style
|
|
108
|
+
// style={componentStyle || { ...general.formItemStyle.wide }}
|
|
109
|
+
style: Object.assign({
|
|
110
|
+
width: layout === 'inline' ? setAutoWidth(field.type) ? 'auto' : _data.general.formItemStyle.xsm.width : _data.general.formItemStyle.wide.width
|
|
111
|
+
}, componentStyle)
|
|
99
112
|
}));
|
|
100
113
|
}
|
|
101
114
|
};
|