@para-ui/core 4.0.0-rc → 4.0.0-rc.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.
- package/AutoBox/index.d.ts +1 -1
- package/AutoBox/index.js +12 -12
- package/AutoTips/autoTipsMultiline/index.d.ts +1 -1
- package/AutoTips/index.d.ts +2 -2
- package/AutoTips/index.js +12 -12
- package/Badge/index.d.ts +23 -0
- package/Badge/index.js +54 -0
- package/Breadcrumbs/index.js +8 -8
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +3 -3
- package/Carousel/index.d.ts +6 -6
- package/Carousel/index.js +5 -5
- package/Cascader/Cascader.d.ts +10 -10
- package/Cascader/OptionList/Column.d.ts +3 -3
- package/Cascader/OptionList/index.d.ts +2 -2
- package/Cascader/index.d.ts +1 -1
- package/Cascader/index.js +4 -2
- package/Cascader/lang/en_US.d.ts +5 -0
- package/Cascader/lang/index.d.ts +11 -0
- package/Cascader/lang/zh_CN.d.ts +5 -0
- package/Cascader/utils/treeUtil.d.ts +1 -1
- package/Checkbox/index.d.ts +1 -1
- package/Checkbox/index.js +4 -4
- package/CheckboxGroup/index.d.ts +2 -2
- package/CheckboxGroup/index.js +3 -3
- package/Collapse/index.js +4 -4
- package/CollapseBox/index.js +12 -20
- package/CollapseLayout/index.js +20 -20
- package/ColorPicker/index.js +2 -2
- package/ComboSelect/index.js +43 -52
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.d.ts +3 -3
- package/Container/index.js +56 -56
- package/CopyText/index.d.ts +2 -2
- package/DatePicker/generatePicker/index.d.ts +22 -22
- package/DatePicker/index.js +8 -7
- package/DatePicker/util.d.ts +1 -1
- package/Desktop/index.d.ts +1 -1
- package/Desktop/index.js +18 -13
- package/DragVerify/index.d.ts +1 -1
- package/DragVerify/index.js +13 -13
- package/Drawer/index.js +29 -33
- package/Drawer/interface.d.ts +2 -2
- package/Dropdown/index.d.ts +1 -1
- package/DynamicMultiBox/formItem.d.ts +1 -1
- package/DynamicMultiBox/index.d.ts +1 -1
- package/DynamicMultiBox/index.js +38 -35
- package/DynamicMultiBox/interface.d.ts +8 -8
- package/DynamicMultiBox/rowForm.d.ts +3 -1
- package/Empty/index.d.ts +1 -1
- package/Empty/index.js +2 -2
- package/Form/index.d.ts +12 -13
- package/Form/index.js +10 -8
- package/FormItem/compoments/defaultCompoments/index.d.ts +4 -4
- package/FormItem/compoments/formCheckboxGroup/index.d.ts +1 -1
- package/FormItem/compoments/formFile/index.d.ts +2 -2
- package/FormItem/compoments/formRadioGroup/index.d.ts +1 -1
- package/FormItem/compoments/formSelect/index.d.ts +7 -7
- package/FormItem/errorTips.d.ts +3 -3
- package/FormItem/index.d.ts +5 -5
- package/FormItem/index.js +3 -2
- package/FormItem/lang/en_US.d.ts +10 -0
- package/FormItem/lang/index.d.ts +21 -0
- package/FormItem/lang/zh_CN.d.ts +10 -0
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/dialog.d.ts +26 -26
- package/FunctionModal/index.d.ts +6 -6
- package/FunctionModal/index.js +6 -6
- package/FunctionModal/modalContext.d.ts +3 -3
- package/GlobalContext/componentsProps.d.ts +7 -7
- package/GlobalContext/index.d.ts +2 -2
- package/GlobalContext/useFormatMessage.d.ts +1 -1
- package/Help/index.js +1 -1
- package/HelperText/index.js +1 -1
- package/InputLang/index.d.ts +2 -2
- package/InputLang/index.js +8 -8
- package/InputNumber/index.d.ts +2 -2
- package/InputNumber/index.js +3 -3
- package/Label/index.js +2 -2
- package/Loading/index.js +1 -1
- package/Menu/index.js +14 -14
- package/Menu/interface.d.ts +1 -1
- package/Message/index.js +12 -12
- package/Modal/Confirm/index.d.ts +3 -3
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +5 -5
- package/MultiBox/index.d.ts +2 -2
- package/MultiBox/index.js +3 -3
- package/Notification/index.js +1 -1
- package/OperateBtn/index.d.ts +2 -2
- package/OperateBtn/index.js +40 -36
- package/PageHeader/index.js +30 -30
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +1 -1
- package/Pagination/index.js +17 -17
- package/PasswordRules/index.js +7 -7
- package/PopConfirm/index.js +3 -3
- package/Progress/Line.d.ts +10 -10
- package/Progress/Steps.d.ts +2 -2
- package/Progress/index.d.ts +12 -12
- package/Progress/index.js +40 -40
- package/Progress/utils.d.ts +4 -4
- package/Querying/index.d.ts +1 -1
- package/Querying/index.js +2 -2
- package/README.md +3 -0
- package/Radio/index.d.ts +1 -1
- package/Radio/index.js +4 -4
- package/RadioGroup/index.d.ts +2 -2
- package/RadioGroup/index.js +3 -3
- package/Search/index.js +1 -1
- package/Select/index.d.ts +3 -3
- package/Select/index.js +42 -42
- package/SelectInput/index.js +2 -2
- package/Selector/index.js +15 -15
- package/Selector/interface.d.ts +6 -6
- package/SelectorPicker/index.d.ts +4 -4
- package/SelectorPicker/index.js +9 -9
- package/SingleBox/index.d.ts +2 -2
- package/SingleBox/index.js +3 -3
- package/Slider/interface.d.ts +1 -1
- package/Status/index.d.ts +4 -4
- package/Status/index.js +4 -4
- package/Stepper/index.d.ts +5 -5
- package/Stepper/index.js +23 -23
- package/Switch/index.d.ts +7 -7
- package/Switch/index.js +23 -5
- package/Switch/lang/en_US.d.ts +4 -0
- package/Switch/lang/index.d.ts +9 -0
- package/Switch/lang/zh_CN.d.ts +4 -0
- package/Table/index.js +34 -34
- package/Table/interface.d.ts +4 -4
- package/Table/tableBodyElement/index.d.ts +1 -1
- package/Table/tableBodyInterface.d.ts +2 -2
- package/Table/tableContainer/index.d.ts +1 -1
- package/Table/tableElement/index.d.ts +1 -1
- package/Table/tableHeadElement/index.d.ts +1 -1
- package/Table/tableHeadInterface.d.ts +1 -1
- package/Table/tablePaginationInterface.d.ts +6 -6
- package/Table/tdElement/index.d.ts +1 -1
- package/Table/thElement/index.d.ts +2 -2
- package/Table/trElement/index.d.ts +1 -1
- package/Table/util.d.ts +1 -1
- package/Tabs/index.d.ts +1 -1
- package/Tabs/index.js +25 -17
- package/Tag/TagGroup.d.ts +5 -5
- package/Tag/index.d.ts +7 -7
- package/Tag/index.js +25 -25
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +45 -27
- package/TextEditor/lang/en_US.d.ts +4 -0
- package/TextEditor/lang/index.d.ts +9 -0
- package/TextEditor/lang/zh_CN.d.ts +4 -0
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +13 -13
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +1 -1
- package/Timeline/TimelineItem.d.ts +1 -1
- package/Timeline/index.d.ts +5 -5
- package/Timeline/index.js +14 -14
- package/Title/index.d.ts +4 -4
- package/Title/index.js +3 -3
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.d.ts +5 -1
- package/ToggleButton/index.js +17 -10
- package/Transfer/box.d.ts +6 -6
- package/Transfer/index.js +21 -21
- package/Tree/OperateBar/index.d.ts +4 -4
- package/Tree/Tree.d.ts +2 -2
- package/Tree/index.js +2 -2
- package/Tree/interface.d.ts +4 -4
- package/Tree/utils/tools.d.ts +1 -1
- package/Upload/Dragger/index.d.ts +2 -2
- package/Upload/ErroTip/index.d.ts +1 -1
- package/Upload/index.d.ts +2 -2
- package/Upload/index.js +7 -7
- package/Upload/interface.d.ts +1 -1
- package/_verture/{index-8469865e.js → index-0f315bca.js} +2 -2
- package/_verture/{index-e1b800aa.js → index-92e406f4.js} +48 -24
- package/_verture/{index-47297a40.js → index-bc461491.js} +45 -45
- package/_verture/{index-1c8d3e94.js → index-d251967e.js} +101 -47
- package/_verture/{modalContext-670eab09.js → modalContext-9299acc9.js} +25 -25
- package/index.d.ts +2 -0
- package/index.js +8 -7
- package/locale/en-US.d.ts +19 -0
- package/locale/index.d.ts +38 -0
- package/locale/index.js +39 -1
- package/locale/zh-CN.d.ts +19 -0
- package/package.json +3 -1
- package/umd/AutoBox.js +1 -1
- package/umd/AutoTips.js +1 -1
- package/umd/Badge.js +1 -0
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Button.js +2 -2
- package/umd/ButtonGroup.js +2 -2
- package/umd/Cascader.js +5 -5
- package/umd/Checkbox.js +1 -1
- package/umd/CheckboxGroup.js +1 -1
- package/umd/Collapse.js +1 -1
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ComboSelect.js +4 -4
- package/umd/CopyText.js +1 -1
- package/umd/DatePicker.js +2 -2
- package/umd/Desktop.js +2 -2
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +2 -2
- package/umd/DynamicMultiBox.js +4 -4
- package/umd/Form.js +4 -4
- package/umd/FormItem.js +4 -4
- package/umd/FunctionModal.js +2 -2
- package/umd/Help.js +1 -1
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/InputNumber.js +1 -1
- package/umd/Label.js +1 -1
- package/umd/Loading.js +1 -1
- package/umd/Menu.js +2 -2
- package/umd/Message.js +1 -1
- package/umd/Modal.js +2 -2
- package/umd/MultiBox.js +7 -7
- package/umd/Notification.js +1 -1
- package/umd/OperateBtn.js +2 -2
- package/umd/PageHeader.js +2 -2
- package/umd/Pagination.js +4 -4
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +2 -2
- package/umd/Progress.js +1 -1
- package/umd/Radio.js +1 -1
- package/umd/RadioGroup.js +1 -1
- package/umd/Search.js +7 -7
- package/umd/Select.js +1 -1
- package/umd/SelectInput.js +1 -1
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +1 -1
- package/umd/SingleBox.js +1 -1
- package/umd/Stepper.js +1 -1
- package/umd/Switch.js +4 -4
- package/umd/Table.js +2 -2
- package/umd/Tabs.js +4 -4
- package/umd/Tag.js +1 -1
- package/umd/TextEditor.js +2 -2
- package/umd/TextField.js +7 -7
- package/umd/TimePicker.js +2 -2
- package/umd/Title.js +1 -1
- package/umd/ToggleButton.js +4 -4
- package/umd/Transfer.js +2 -2
- package/umd/Tree.js +1 -1
- package/umd/Upload.js +2 -2
- package/umd/locale.js +1 -1
package/Drawer/index.js
CHANGED
|
@@ -103,7 +103,8 @@ var Drawer = function Drawer(props) {
|
|
|
103
103
|
var timerRef = useRef();
|
|
104
104
|
var isHorizontal = ['left', 'right'].includes((_a = props.placement) !== null && _a !== void 0 ? _a : 'right');
|
|
105
105
|
var startRef = useRef(0);
|
|
106
|
-
var
|
|
106
|
+
var rootEleSize = useRef(0);
|
|
107
|
+
var contentEleSize = useRef(0);
|
|
107
108
|
useEffect(function () {
|
|
108
109
|
return function () {
|
|
109
110
|
// 销毁时销毁timer
|
|
@@ -123,28 +124,20 @@ var Drawer = function Drawer(props) {
|
|
|
123
124
|
return {};
|
|
124
125
|
}
|
|
125
126
|
var sizeMap = {
|
|
126
|
-
large:
|
|
127
|
-
medium:
|
|
128
|
-
small:
|
|
127
|
+
large: '1000px',
|
|
128
|
+
medium: '630px',
|
|
129
|
+
small: '400px'
|
|
129
130
|
};
|
|
130
131
|
var offsetStyle = {};
|
|
131
132
|
if (props.placement === 'left' || props.placement === 'right') {
|
|
132
133
|
var defaultWidth = sizeMap[size];
|
|
133
134
|
if (size !== 'auto') {
|
|
134
|
-
|
|
135
|
-
offsetStyle.width = typeof props.width === 'string' ? parseInt(props.width) : props.width;
|
|
136
|
-
} else {
|
|
137
|
-
offsetStyle.width = defaultWidth;
|
|
138
|
-
}
|
|
135
|
+
offsetStyle.width = props.width === undefined ? defaultWidth : props.width;
|
|
139
136
|
}
|
|
140
137
|
} else {
|
|
141
138
|
var defaultHeight = size === 'large' ? 736 : 378;
|
|
142
139
|
if (size !== 'auto') {
|
|
143
|
-
|
|
144
|
-
offsetStyle.height = typeof props.height === 'string' ? parseInt(props.height) : props.height;
|
|
145
|
-
} else {
|
|
146
|
-
offsetStyle.height = defaultHeight;
|
|
147
|
-
}
|
|
140
|
+
offsetStyle.height = props.height === undefined ? defaultHeight : props.height;
|
|
148
141
|
}
|
|
149
142
|
}
|
|
150
143
|
return offsetStyle;
|
|
@@ -162,10 +155,14 @@ var Drawer = function Drawer(props) {
|
|
|
162
155
|
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
|
163
156
|
};
|
|
164
157
|
var onHandlerMouseDown = function onHandlerMouseDown(e) {
|
|
165
|
-
var _a;
|
|
158
|
+
var _a, _b;
|
|
166
159
|
setIsResizing(true);
|
|
167
|
-
drawerRootEle.current = (_a = closest(e.target, ".".concat($prefixCls, "-drawer-open"))) !== null && _a !== void 0 ? _a : document.body;
|
|
168
160
|
startRef.current = isHorizontal ? e.clientX : e.clientY;
|
|
161
|
+
var rootEle = (_a = closest(e.target, ".".concat($prefixCls, "-drawer-open"))) !== null && _a !== void 0 ? _a : document.body;
|
|
162
|
+
var contentCls = ".".concat($prefixCls, "-drawer-content-wrapper");
|
|
163
|
+
var contentEle = (_b = closest(e.target, contentCls)) !== null && _b !== void 0 ? _b : rootEle.querySelector(contentCls);
|
|
164
|
+
rootEleSize.current = isHorizontal ? rootEle.offsetWidth : rootEle.offsetHeight;
|
|
165
|
+
contentEleSize.current = isHorizontal ? contentEle.offsetWidth : contentEle.offsetHeight;
|
|
169
166
|
document.addEventListener('mousemove', onHandlerMouseMove);
|
|
170
167
|
document.addEventListener('mouseup', onHandlerMouseUp);
|
|
171
168
|
};
|
|
@@ -175,12 +172,11 @@ var Drawer = function Drawer(props) {
|
|
|
175
172
|
document.removeEventListener('mouseup', onHandlerMouseUp);
|
|
176
173
|
};
|
|
177
174
|
var onHandlerMouseMove = function onHandlerMouseMove(e) {
|
|
178
|
-
var maximum = isHorizontal ? drawerRootEle.current.offsetWidth : drawerRootEle.current.offsetHeight;
|
|
179
175
|
switch (props.placement) {
|
|
180
176
|
case 'left':
|
|
181
177
|
{
|
|
182
|
-
var newWidth =
|
|
183
|
-
if (newWidth + 100 >=
|
|
178
|
+
var newWidth = contentEleSize.current + (e.clientX - startRef.current);
|
|
179
|
+
if (newWidth + 100 >= rootEleSize.current || newWidth < resizeMinimum) return;
|
|
184
180
|
setOffsetStyle({
|
|
185
181
|
width: newWidth
|
|
186
182
|
});
|
|
@@ -188,8 +184,8 @@ var Drawer = function Drawer(props) {
|
|
|
188
184
|
}
|
|
189
185
|
case 'right':
|
|
190
186
|
{
|
|
191
|
-
var _newWidth =
|
|
192
|
-
if (_newWidth + 100 >=
|
|
187
|
+
var _newWidth = contentEleSize.current - (e.clientX - startRef.current);
|
|
188
|
+
if (_newWidth + 100 >= rootEleSize.current || _newWidth < resizeMinimum) return;
|
|
193
189
|
setOffsetStyle({
|
|
194
190
|
width: _newWidth
|
|
195
191
|
});
|
|
@@ -197,8 +193,8 @@ var Drawer = function Drawer(props) {
|
|
|
197
193
|
}
|
|
198
194
|
case 'top':
|
|
199
195
|
{
|
|
200
|
-
var newHeight =
|
|
201
|
-
if (newHeight + 100 >=
|
|
196
|
+
var newHeight = contentEleSize.current + (e.clientY - startRef.current);
|
|
197
|
+
if (newHeight + 100 >= rootEleSize.current || newHeight < resizeMinimum) return;
|
|
202
198
|
setOffsetStyle({
|
|
203
199
|
height: newHeight
|
|
204
200
|
});
|
|
@@ -206,8 +202,8 @@ var Drawer = function Drawer(props) {
|
|
|
206
202
|
}
|
|
207
203
|
case 'bottom':
|
|
208
204
|
{
|
|
209
|
-
var _newHeight =
|
|
210
|
-
if (_newHeight + 100 >=
|
|
205
|
+
var _newHeight = contentEleSize.current - (e.clientY - startRef.current);
|
|
206
|
+
if (_newHeight + 100 >= rootEleSize.current || _newHeight < resizeMinimum) return;
|
|
211
207
|
setOffsetStyle({
|
|
212
208
|
height: _newHeight
|
|
213
209
|
});
|
|
@@ -243,16 +239,16 @@ var Drawer = function Drawer(props) {
|
|
|
243
239
|
}, {
|
|
244
240
|
children: extra || jsxs(Fragment, {
|
|
245
241
|
children: [jsx(Button, Object.assign({
|
|
246
|
-
variant:
|
|
247
|
-
size:
|
|
242
|
+
variant: "outlined",
|
|
243
|
+
size: "medium",
|
|
248
244
|
onClick: handleCancel
|
|
249
245
|
}, cancelButtonProps, {
|
|
250
246
|
children: (cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.children) || intl({
|
|
251
247
|
id: 'cancel'
|
|
252
248
|
})
|
|
253
249
|
})), jsx(Button, Object.assign({
|
|
254
|
-
variant:
|
|
255
|
-
size:
|
|
250
|
+
variant: "contained",
|
|
251
|
+
size: "medium",
|
|
256
252
|
onClick: handleOk
|
|
257
253
|
}, okButtonProps, {
|
|
258
254
|
children: (okButtonProps === null || okButtonProps === void 0 ? void 0 : okButtonProps.children) || intl({
|
|
@@ -285,7 +281,7 @@ var Drawer = function Drawer(props) {
|
|
|
285
281
|
return null;
|
|
286
282
|
}
|
|
287
283
|
var maskMotion = {
|
|
288
|
-
motionName: $prefixCls
|
|
284
|
+
motionName: "".concat($prefixCls, "-drawer-mask-motion"),
|
|
289
285
|
motionAppear: true,
|
|
290
286
|
motionEnter: true,
|
|
291
287
|
motionLeave: true,
|
|
@@ -293,7 +289,7 @@ var Drawer = function Drawer(props) {
|
|
|
293
289
|
};
|
|
294
290
|
var panelMotion = function panelMotion(motionPlacement) {
|
|
295
291
|
return {
|
|
296
|
-
motionName: $prefixCls
|
|
292
|
+
motionName: "".concat($prefixCls, "-drawer-panel-motion-").concat(motionPlacement),
|
|
297
293
|
motionAppear: true,
|
|
298
294
|
motionEnter: true,
|
|
299
295
|
motionLeave: true,
|
|
@@ -321,11 +317,11 @@ var Drawer = function Drawer(props) {
|
|
|
321
317
|
}
|
|
322
318
|
}, {
|
|
323
319
|
children: [resizable && jsx("div", Object.assign({
|
|
324
|
-
className:
|
|
320
|
+
className: "drawer-handle",
|
|
325
321
|
onMouseDown: onHandlerMouseDown
|
|
326
322
|
}, {
|
|
327
323
|
children: jsx("div", {
|
|
328
|
-
className:
|
|
324
|
+
className: "drawer-handle-icon"
|
|
329
325
|
})
|
|
330
326
|
})), renderContent()]
|
|
331
327
|
}));
|
package/Drawer/interface.d.ts
CHANGED
package/Dropdown/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import React, { FC } from 'react';
|
|
7
7
|
import './index.scss';
|
|
8
|
-
export type Placement =
|
|
8
|
+
export type Placement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
9
9
|
export interface DropdownProps {
|
|
10
10
|
/** 触发下拉的行为 */
|
|
11
11
|
trigger?: ('click' | 'hover' | 'contextMenu')[];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @date 2022/11/7 10:32 AM
|
|
4
4
|
* @description 多值框组件
|
|
5
5
|
*/
|
|
6
|
-
import { FunctionComponent } from
|
|
6
|
+
import { FunctionComponent } from 'react';
|
|
7
7
|
import { IMultiValueProps } from './interface';
|
|
8
8
|
import './index.scss';
|
|
9
9
|
declare const DynamicMultiBox: FunctionComponent<IMultiValueProps>;
|
package/DynamicMultiBox/index.js
CHANGED
|
@@ -73,7 +73,7 @@ import 'rc-pagination';
|
|
|
73
73
|
import '@para-ui/icons/Right';
|
|
74
74
|
import '@para-ui/icons/DoubleLeft';
|
|
75
75
|
import '@para-ui/icons/DoubleRight';
|
|
76
|
-
import '../_verture/index-
|
|
76
|
+
import '../_verture/index-bc461491.js';
|
|
77
77
|
import 'rc-tree';
|
|
78
78
|
import '@para-ui/icons/Document';
|
|
79
79
|
import 'react-dom';
|
|
@@ -81,6 +81,7 @@ import '@para-ui/icons/EditFile';
|
|
|
81
81
|
import '@para-ui/icons/PlusCircle';
|
|
82
82
|
import '@para-ui/icons/MoreCircle';
|
|
83
83
|
import '../_verture/utils-06d86594.js';
|
|
84
|
+
import '../Search/index.js';
|
|
84
85
|
import 'rc-picker/es/generate/dayjs';
|
|
85
86
|
import '../Tag/index.js';
|
|
86
87
|
import '@para-ui/icons/EditOutline';
|
|
@@ -180,7 +181,7 @@ var FormItem = function FormItem(props) {
|
|
|
180
181
|
var getTextField = function getTextField() {
|
|
181
182
|
return jsx(TextField, Object.assign({}, rest, {
|
|
182
183
|
required: false,
|
|
183
|
-
label:
|
|
184
|
+
label: "",
|
|
184
185
|
disabled: disabled,
|
|
185
186
|
onChange: function onChange(e) {
|
|
186
187
|
return inputChange(e.target.value);
|
|
@@ -196,7 +197,7 @@ var FormItem = function FormItem(props) {
|
|
|
196
197
|
return jsx(Select, Object.assign({}, rest, {
|
|
197
198
|
list: selectList,
|
|
198
199
|
required: false,
|
|
199
|
-
label:
|
|
200
|
+
label: "",
|
|
200
201
|
disabled: disabled,
|
|
201
202
|
onChange: function onChange(value) {
|
|
202
203
|
return inputChange(value);
|
|
@@ -242,7 +243,7 @@ var FormItem = function FormItem(props) {
|
|
|
242
243
|
var getInputNumber = function getInputNumber() {
|
|
243
244
|
return jsx(InputNumber, Object.assign({}, rest, {
|
|
244
245
|
required: false,
|
|
245
|
-
label:
|
|
246
|
+
label: "",
|
|
246
247
|
disabled: disabled,
|
|
247
248
|
onChange: function onChange(value) {
|
|
248
249
|
return inputChange(value);
|
|
@@ -256,7 +257,7 @@ var FormItem = function FormItem(props) {
|
|
|
256
257
|
var getInputLang = function getInputLang() {
|
|
257
258
|
return jsx(InputLang, Object.assign({}, rest, {
|
|
258
259
|
required: false,
|
|
259
|
-
label:
|
|
260
|
+
label: "",
|
|
260
261
|
onChange: function onChange(value) {
|
|
261
262
|
return inputChange(value);
|
|
262
263
|
}
|
|
@@ -269,7 +270,7 @@ var FormItem = function FormItem(props) {
|
|
|
269
270
|
var getDatePicker = function getDatePicker() {
|
|
270
271
|
return jsx(DatePicker, Object.assign({}, rest, {
|
|
271
272
|
required: false,
|
|
272
|
-
label:
|
|
273
|
+
label: "",
|
|
273
274
|
disabled: disabled,
|
|
274
275
|
onChange: onDatePickerChange,
|
|
275
276
|
getPopupContainer: function getPopupContainer() {
|
|
@@ -284,7 +285,7 @@ var FormItem = function FormItem(props) {
|
|
|
284
285
|
var getComboSelect = function getComboSelect() {
|
|
285
286
|
return jsx(ComboSelect, Object.assign({}, rest, {
|
|
286
287
|
required: false,
|
|
287
|
-
label:
|
|
288
|
+
label: "",
|
|
288
289
|
disabled: disabled,
|
|
289
290
|
onChange: function onChange(options) {
|
|
290
291
|
return inputChange(options);
|
|
@@ -306,7 +307,9 @@ var FormItem = function FormItem(props) {
|
|
|
306
307
|
};
|
|
307
308
|
|
|
308
309
|
var RowForm = function RowForm(props) {
|
|
309
|
-
var _props$
|
|
310
|
+
var _props$rowKey = props.rowKey,
|
|
311
|
+
rowKey = _props$rowKey === void 0 ? 'id' : _props$rowKey,
|
|
312
|
+
_props$valueList = props.valueList,
|
|
310
313
|
valueList = _props$valueList === void 0 ? [] : _props$valueList,
|
|
311
314
|
rowError = props.rowError,
|
|
312
315
|
_props$errors = props.errors,
|
|
@@ -339,13 +342,13 @@ var RowForm = function RowForm(props) {
|
|
|
339
342
|
othersData = __rest(data, ["style"]);
|
|
340
343
|
var formItemProps = (data === null || data === void 0 ? void 0 : data.inputType) !== 'Switch' ? Object.assign({
|
|
341
344
|
rowIndex: rowIndex,
|
|
342
|
-
id: rowValue
|
|
345
|
+
id: rowValue[rowKey],
|
|
343
346
|
value: rowValue === null || rowValue === void 0 ? void 0 : rowValue[data.name || ''],
|
|
344
347
|
error: !!(rowError === null || rowError === void 0 ? void 0 : rowError[data.name || '']),
|
|
345
348
|
helperText: rowError === null || rowError === void 0 ? void 0 : rowError[data.name || '']
|
|
346
349
|
}, othersData) : Object.assign({
|
|
347
350
|
rowIndex: rowIndex,
|
|
348
|
-
id: rowValue
|
|
351
|
+
id: rowValue[rowKey],
|
|
349
352
|
checked: rowValue === null || rowValue === void 0 ? void 0 : rowValue[data.name || '']
|
|
350
353
|
}, othersData);
|
|
351
354
|
return jsxs("div", Object.assign({
|
|
@@ -926,11 +929,13 @@ var localeJson = {
|
|
|
926
929
|
en: en
|
|
927
930
|
};
|
|
928
931
|
|
|
929
|
-
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-dynamic-multi-box {\n width: 100%;\n}\n.paraui-v4-dynamic-multi-box svg {\n overflow: hidden;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content {\n width: 100%;\n position: relative;\n overflow-x: auto;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config .title-config-row {\n display: flex;\n flex: 1;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config .title-config-row .title-config-row-item {\n display: flex;\n align-items: center;\n min-width: 180px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config .title-config-row .row-form-switch {\n flex: 0;\n min-width: 80px;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 {\n width: 32px;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n cursor: pointer;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel .svg-box {\n height: 24px;\n width: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgb(247, 248, 250);\n border-radius: 2px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel .svg-box svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel .svg-box svg:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n cursor: pointer;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover {\n background: rgb(247, 248, 250);\n border-radius: 4px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover svg {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .hidden-icon {\n display: none;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .center-line {\n width: 1px;\n height: 12px;\n background-color: rgb(212, 218, 227);\n margin: 0 3px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-80 {\n width: 72px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form {\n width: 100%;\n display: flex;\n align-items: flex-start;\n min-height: 42px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .paraui-v4-select {\n overflow: hidden;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .form-item {\n display: flex;\n align-items: flex-start;\n min-width: 180px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .form-item-icon {\n margin-left: 10px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .row-form-switch {\n flex: 0;\n box-sizing: content-box;\n align-items: center;\n height: 32px;\n min-width: 80px;\n}\n.paraui-v4-dynamic-multi-box .add-button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 32px;\n background: rgb(247, 248, 250);\n border: 1px dashed rgb(212, 218, 227);\n border-radius: 4px;\n}\n.paraui-v4-dynamic-multi-box .add-button .text {\n font-size: 14px;\n margin-left: 10px;\n}\n.paraui-v4-dynamic-multi-box .add-button.add-button-scroll {\n margin-top: 14px;\n}\n.paraui-v4-dynamic-multi-box .add-button.normal-button {\n cursor: pointer;\n}\n.paraui-v4-dynamic-multi-box .add-button.normal-button .text {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-dynamic-multi-box .add-button.normal-button:hover {\n background: rgb(240, 245, 255);\n border: 1px dashed rgb(87, 131, 235);\n}\n.paraui-v4-dynamic-multi-box .add-button.disabled-add {\n cursor: not-allowed;\n}\n.paraui-v4-dynamic-multi-box .add-button.disabled-add .text {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-dynamic-multi-box .add-button.disabled-add svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-dynamic-multi-box .paraui-v4-comboselect,\n.paraui-v4-dynamic-multi-box .paraui-v4-picker-wrapper {\n width: 100%;\n}\n.paraui-v4-dynamic-multi-box .multi-value-switch {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-switch .switch-text {\n color: rgb(161, 168, 179);\n margin-right: 4px;\n overflow: hidden;\n}\n.paraui-v4-dynamic-multi-box .multi-value-switch .switch {\n flex: 1;\n}\n\n.paraui-v4-dynamic-multi-box-popover .filter-config {\n width: 140px;\n padding-top: 4px;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .check-list .title {\n font-size: 12px;\n color: rgb(161, 168, 179);\n line-height: 30px;\n padding: 0 10px;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .check-list .paraui-v4-checkbox-group {\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .check-list .paraui-v4-checkbox-group.paraui-v4-checkbox-group-column .checkbox-group-content > span {\n padding: 0 10px;\n margin-bottom: 0;\n line-height: 30px;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .restore-default {\n display: flex;\n justify-content: center;\n align-items: center;\n height:
|
|
932
|
+
var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-dynamic-multi-box {\n width: 100%;\n}\n.paraui-v4-dynamic-multi-box svg {\n overflow: hidden;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content {\n width: 100%;\n position: relative;\n overflow-x: auto;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config .title-config-row {\n display: flex;\n flex: 1;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config .title-config-row .title-config-row-item {\n display: flex;\n align-items: center;\n min-width: 180px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .title-config .title-config-row .row-form-switch {\n flex: 0;\n min-width: 80px;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 {\n width: 32px;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n cursor: pointer;\n margin-right: 1px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel .svg-box {\n height: 24px;\n width: 24px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgb(247, 248, 250);\n border-radius: 2px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel .svg-box svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel .svg-box svg:hover {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n cursor: pointer;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon svg {\n font-size: 20px;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover {\n background: rgb(247, 248, 250);\n border-radius: 4px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover svg {\n color: rgb(87, 131, 235);\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .hidden-icon {\n display: none;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-40 .center-line {\n width: 1px;\n height: 12px;\n background-color: rgb(212, 218, 227);\n margin: 0 3px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .operator-column-80 {\n width: 72px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form {\n width: 100%;\n display: flex;\n align-items: flex-start;\n min-height: 42px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .paraui-v4-select {\n overflow: hidden;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .form-item {\n display: flex;\n align-items: flex-start;\n min-width: 180px;\n margin-right: 10px;\n flex-shrink: 0;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .form-item-icon {\n margin-left: 10px;\n}\n.paraui-v4-dynamic-multi-box .multi-value-content .content-row-form .row-form-switch {\n flex: 0;\n box-sizing: content-box;\n align-items: center;\n height: 32px;\n min-width: 80px;\n}\n.paraui-v4-dynamic-multi-box .add-button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 32px;\n background: rgb(247, 248, 250);\n border: 1px dashed rgb(212, 218, 227);\n border-radius: 4px;\n}\n.paraui-v4-dynamic-multi-box .add-button .text {\n font-size: 14px;\n margin-left: 10px;\n}\n.paraui-v4-dynamic-multi-box .add-button.add-button-scroll {\n margin-top: 14px;\n}\n.paraui-v4-dynamic-multi-box .add-button.normal-button {\n cursor: pointer;\n}\n.paraui-v4-dynamic-multi-box .add-button.normal-button .text {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-dynamic-multi-box .add-button.normal-button:hover {\n background: rgb(240, 245, 255);\n border: 1px dashed rgb(87, 131, 235);\n}\n.paraui-v4-dynamic-multi-box .add-button.disabled-add {\n cursor: not-allowed;\n}\n.paraui-v4-dynamic-multi-box .add-button.disabled-add .text {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-dynamic-multi-box .add-button.disabled-add svg {\n color: rgb(161, 168, 179);\n}\n.paraui-v4-dynamic-multi-box .paraui-v4-comboselect,\n.paraui-v4-dynamic-multi-box .paraui-v4-picker-wrapper {\n width: 100%;\n}\n.paraui-v4-dynamic-multi-box .multi-value-switch {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v4-dynamic-multi-box .multi-value-switch .switch-text {\n color: rgb(161, 168, 179);\n margin-right: 4px;\n overflow: hidden;\n}\n.paraui-v4-dynamic-multi-box .multi-value-switch .switch {\n flex: 1;\n}\n\n.paraui-v4-dynamic-multi-box-popover .filter-config {\n width: 140px;\n padding-top: 4px;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .check-list .title {\n font-size: 12px;\n color: rgb(161, 168, 179);\n line-height: 30px;\n padding: 0 10px;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .check-list .paraui-v4-checkbox-group {\n max-height: 320px;\n overflow-y: auto;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .check-list .paraui-v4-checkbox-group.paraui-v4-checkbox-group-column .checkbox-group-content > span {\n padding: 0 10px;\n margin-bottom: 0;\n line-height: 30px;\n}\n.paraui-v4-dynamic-multi-box-popover .filter-config .restore-default {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 36px;\n color: rgb(46, 101, 230);\n cursor: pointer;\n border-top: 1px solid rgb(247, 248, 250);\n}\n.paraui-v4-dynamic-multi-box-popover .no-other-property {\n width: 200px;\n padding: 16px 0;\n text-align: center;\n font-size: 12px;\n color: rgb(161, 168, 179);\n}";
|
|
930
933
|
styleInject(css_248z);
|
|
931
934
|
|
|
932
935
|
var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
933
|
-
var
|
|
936
|
+
var _props$rowKey = props.rowKey,
|
|
937
|
+
rowKey = _props$rowKey === void 0 ? 'id' : _props$rowKey,
|
|
938
|
+
valueList = props.valueList,
|
|
934
939
|
_props$config = props.config,
|
|
935
940
|
config = _props$config === void 0 ? [] : _props$config,
|
|
936
941
|
_props$errors = props.errors,
|
|
@@ -1140,8 +1145,8 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1140
1145
|
});
|
|
1141
1146
|
};
|
|
1142
1147
|
var popoverHandClass = function popoverHandClass() {
|
|
1143
|
-
var str = $prefixCls
|
|
1144
|
-
if (popoverClassName) str +=
|
|
1148
|
+
var str = "".concat($prefixCls, "-dynamic-multi-box-popover");
|
|
1149
|
+
if (popoverClassName) str += " ".concat(popoverClassName);
|
|
1145
1150
|
return str;
|
|
1146
1151
|
};
|
|
1147
1152
|
/**
|
|
@@ -1161,20 +1166,21 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1161
1166
|
required = item.required,
|
|
1162
1167
|
className = item.className,
|
|
1163
1168
|
inputType = item.inputType,
|
|
1164
|
-
style = item.style
|
|
1169
|
+
style = item.style,
|
|
1170
|
+
labelProps = item.labelProps;
|
|
1165
1171
|
var str = 'title-config-row-item';
|
|
1166
1172
|
if (inputType === 'Switch') str += ' row-form-switch';
|
|
1167
|
-
if (className) str +=
|
|
1173
|
+
if (className) str += " ".concat(className);
|
|
1168
1174
|
var styleCom = Object.assign({}, style);
|
|
1169
1175
|
if (!(style === null || style === void 0 ? void 0 : style.width) && !(style === null || style === void 0 ? void 0 : style.flex)) styleCom.flex = 1;
|
|
1170
1176
|
return jsx("div", Object.assign({
|
|
1171
1177
|
className: str,
|
|
1172
1178
|
style: styleCom
|
|
1173
1179
|
}, {
|
|
1174
|
-
children: jsx(Label, {
|
|
1180
|
+
children: jsx(Label, Object.assign({
|
|
1175
1181
|
required: required,
|
|
1176
1182
|
label: label
|
|
1177
|
-
})
|
|
1183
|
+
}, labelProps))
|
|
1178
1184
|
}), index);
|
|
1179
1185
|
})
|
|
1180
1186
|
})) : titleMode === 'single' ? jsx(Label, {
|
|
@@ -1206,7 +1212,7 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1206
1212
|
}))]
|
|
1207
1213
|
}))]
|
|
1208
1214
|
}));
|
|
1209
|
-
}, [titleMode, fixedConfig, selectedConfig, isSort, isFilter, checked, onCheckChange, onRestoreDefault]);
|
|
1215
|
+
}, [titleMode, fixedConfig, selectedConfig, isSort, isFilter, checked, onCheckChange, onRestoreDefault, rowKey]);
|
|
1210
1216
|
/**
|
|
1211
1217
|
* 判断是否全部隐藏删除
|
|
1212
1218
|
* 默认全部隐藏
|
|
@@ -1218,7 +1224,7 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1218
1224
|
return false;
|
|
1219
1225
|
}
|
|
1220
1226
|
for (var i = 0, l = valueList === null || valueList === void 0 ? void 0 : valueList.length; i < l; i++) {
|
|
1221
|
-
var id = (_a = valueList[i]) === null || _a === void 0 ? void 0 : _a
|
|
1227
|
+
var id = (_a = valueList[i]) === null || _a === void 0 ? void 0 : _a[rowKey];
|
|
1222
1228
|
if (id && deleteDisable.indexOf(id) === -1) {
|
|
1223
1229
|
bol = false;
|
|
1224
1230
|
break;
|
|
@@ -1237,9 +1243,9 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1237
1243
|
return jsx(Fragment, {
|
|
1238
1244
|
children: valueList.map(function (item, rowIndex) {
|
|
1239
1245
|
var _a;
|
|
1240
|
-
var id = item
|
|
1246
|
+
var id = item[rowKey];
|
|
1241
1247
|
var rowError = (_a = errors === null || errors === void 0 ? void 0 : errors.filter(function (item) {
|
|
1242
|
-
return item
|
|
1248
|
+
return item[rowKey] === id;
|
|
1243
1249
|
})) === null || _a === void 0 ? void 0 : _a[0];
|
|
1244
1250
|
return jsxs("div", Object.assign({
|
|
1245
1251
|
className: 'content-row-form'
|
|
@@ -1280,7 +1286,7 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1280
1286
|
})
|
|
1281
1287
|
});
|
|
1282
1288
|
}
|
|
1283
|
-
}, [valueList, isSort, isFilter, errors, fixedConfig, selectedConfig, keepLastItem, deleteRender]);
|
|
1289
|
+
}, [valueList, isSort, isFilter, errors, fixedConfig, selectedConfig, keepLastItem, deleteRender, rowKey]);
|
|
1284
1290
|
/**
|
|
1285
1291
|
* @desc 删除事件
|
|
1286
1292
|
* */
|
|
@@ -1321,12 +1327,8 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1321
1327
|
var id = UUID();
|
|
1322
1328
|
// 取出已经筛选的配置数据
|
|
1323
1329
|
var configArr = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig));
|
|
1324
|
-
valueArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'value')), {
|
|
1325
|
-
|
|
1326
|
-
}));
|
|
1327
|
-
errorArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'error')), {
|
|
1328
|
-
id: id
|
|
1329
|
-
}));
|
|
1330
|
+
valueArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'value')), _defineProperty({}, rowKey, id)));
|
|
1331
|
+
errorArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'error')), _defineProperty({}, rowKey, id)));
|
|
1330
1332
|
onAdd && onAdd(valueArr, errorArr);
|
|
1331
1333
|
};
|
|
1332
1334
|
/**
|
|
@@ -1346,12 +1348,12 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1346
1348
|
var onDragSort = function onDragSort(newValueList) {
|
|
1347
1349
|
// 获取排序后 id映射下标集合
|
|
1348
1350
|
var idMapIndex = newValueList.reduce(function (acc, cur, index) {
|
|
1349
|
-
return Object.assign(Object.assign({}, acc), _defineProperty({}, cur
|
|
1351
|
+
return Object.assign(Object.assign({}, acc), _defineProperty({}, cur[rowKey], index));
|
|
1350
1352
|
}, {});
|
|
1351
1353
|
// 需要交换的下标集合
|
|
1352
1354
|
var swapIds = [];
|
|
1353
1355
|
valueList.forEach(function (item, idx) {
|
|
1354
|
-
if (idx !== idMapIndex[item
|
|
1356
|
+
if (idx !== idMapIndex[item[rowKey]]) swapIds.push(idx);
|
|
1355
1357
|
});
|
|
1356
1358
|
onSort && onSort(newValueList, swapIds);
|
|
1357
1359
|
};
|
|
@@ -1369,8 +1371,8 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1369
1371
|
* @desc 处理className
|
|
1370
1372
|
* */
|
|
1371
1373
|
var handClass = function handClass() {
|
|
1372
|
-
var str = $prefixCls
|
|
1373
|
-
if (className) str +=
|
|
1374
|
+
var str = "".concat($prefixCls, "-dynamic-multi-box");
|
|
1375
|
+
if (className) str += " ".concat(className);
|
|
1374
1376
|
return str;
|
|
1375
1377
|
};
|
|
1376
1378
|
return jsxs("div", Object.assign({
|
|
@@ -1380,14 +1382,15 @@ var DynamicMultiBox = function DynamicMultiBox(props) {
|
|
|
1380
1382
|
children: [jsxs("div", Object.assign({
|
|
1381
1383
|
className: "multi-value-content"
|
|
1382
1384
|
}, {
|
|
1383
|
-
children: [renderTitle, jsx(dist.exports.ReactSortable, Object.assign({
|
|
1385
|
+
children: [renderTitle, isSort ? jsx(dist.exports.ReactSortable, Object.assign({
|
|
1386
|
+
id: rowKey,
|
|
1384
1387
|
list: valueList,
|
|
1385
1388
|
handle: '.sort-handler',
|
|
1386
1389
|
animation: 150,
|
|
1387
1390
|
setList: onDragSort
|
|
1388
1391
|
}, {
|
|
1389
1392
|
children: renderContent
|
|
1390
|
-
}))]
|
|
1393
|
+
})) : renderContent]
|
|
1391
1394
|
})), jsxs("div", Object.assign({
|
|
1392
1395
|
className: "add-button ".concat(disabledAdd ? 'disabled-add' : 'normal-button'),
|
|
1393
1396
|
onClick: onAddEvent
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* @date 2022/11/7 10:32 AM
|
|
4
4
|
* @description 多值框组件接口定义
|
|
5
5
|
*/
|
|
6
|
-
import { ReactNode } from
|
|
7
|
-
import { TextFieldProps, SelectProps, SwitchProps, InputNumberProps, InputLangProps, ComboSelectProps, DatePickerProps } from
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { TextFieldProps, SelectProps, SwitchProps, InputNumberProps, InputLangProps, ComboSelectProps, DatePickerProps } from '@para-ui/core';
|
|
8
|
+
import { LabelProps } from "../Label";
|
|
8
9
|
/**组件类型:输入框,下拉框,开关,数字输入框,国际化输入框,日期框,时间选择框,组合选择器,自定义组件*/
|
|
9
10
|
export type IInputType = 'TextField' | 'Select' | 'Switch' | 'InputNumber' | 'InputLang' | 'ComboSelect' | 'DatePicker' | 'custom';
|
|
10
11
|
/** 配置项*/
|
|
@@ -27,31 +28,28 @@ export type IConfig = {
|
|
|
27
28
|
list?: ((rowIndex: number, id: string, name: string, valueList: IValueList[]) => any[]) | any[];
|
|
28
29
|
/** 样式 */
|
|
29
30
|
style?: React.CSSProperties;
|
|
31
|
+
/** 标题样式 */
|
|
32
|
+
labelProps?: LabelProps;
|
|
30
33
|
/** 其他*/
|
|
31
34
|
[name: string]: any;
|
|
32
35
|
} & (TextFieldProps | SelectProps | SwitchProps | InputNumberProps | InputLangProps | ComboSelectProps | DatePickerProps);
|
|
33
36
|
/** value集合*/
|
|
34
37
|
export interface IValueList {
|
|
35
|
-
/** id*/
|
|
36
|
-
id: string;
|
|
37
38
|
/** 每行value值集合, name映射configItem中的name*/
|
|
38
39
|
[name: string]: any;
|
|
39
40
|
}
|
|
40
41
|
export interface IErrors {
|
|
41
|
-
/** id*/
|
|
42
|
-
id: string;
|
|
43
42
|
/** 每行错误集合,name映射configItem中的name*/
|
|
44
43
|
[name: string]: any;
|
|
45
44
|
}
|
|
46
45
|
export interface ICurrentItem {
|
|
47
46
|
/** 表单名*/
|
|
48
47
|
name?: string;
|
|
49
|
-
/** 表单所处行id*/
|
|
50
|
-
id: string;
|
|
51
48
|
/** 表单值*/
|
|
52
49
|
value?: any;
|
|
53
50
|
/** 表单所处下标*/
|
|
54
51
|
rowIndex?: number;
|
|
52
|
+
[name: string]: any;
|
|
55
53
|
}
|
|
56
54
|
/** 过滤回调出参*/
|
|
57
55
|
export interface IFilterParams {
|
|
@@ -66,6 +64,8 @@ export interface IFilterParams {
|
|
|
66
64
|
}
|
|
67
65
|
/** 主体接口定义*/
|
|
68
66
|
export interface IMultiValueProps {
|
|
67
|
+
/** 指定每行key */
|
|
68
|
+
rowKey?: string;
|
|
69
69
|
/**
|
|
70
70
|
* 组件配置项
|
|
71
71
|
*/
|
package/Empty/index.d.ts
CHANGED
package/Empty/index.js
CHANGED
|
@@ -570,8 +570,8 @@ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/4/2 上
|
|
|
570
570
|
styleInject(css_248z);
|
|
571
571
|
|
|
572
572
|
var imageMap = {
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
large: jsx(LargeNull, {}),
|
|
574
|
+
small: jsx(SmallNull, {})
|
|
575
575
|
};
|
|
576
576
|
//empty空状态
|
|
577
577
|
var Empty = function Empty(props) {
|
package/Form/index.d.ts
CHANGED
|
@@ -6,8 +6,7 @@ import { ItemTypeProps } from '../FormItem/itemType';
|
|
|
6
6
|
/**
|
|
7
7
|
* form 表单原始属性
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
}
|
|
9
|
+
type FormHtmlProps = FormHTMLAttributes<HTMLFormElement>;
|
|
11
10
|
/**
|
|
12
11
|
* 配置项项类型
|
|
13
12
|
*/
|
|
@@ -53,17 +52,17 @@ export interface FormProps {
|
|
|
53
52
|
*/
|
|
54
53
|
refData?: RefDataProps;
|
|
55
54
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
* 获取生效项目的值对象,会过滤掉不显示或是不启用的项目的值,
|
|
56
|
+
*/
|
|
58
57
|
getValidValues?: Function;
|
|
59
58
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
* 重置表单
|
|
60
|
+
*/
|
|
62
61
|
reset?: Function;
|
|
63
62
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
* 清空表单数据
|
|
64
|
+
* 允许清空单个
|
|
65
|
+
*/
|
|
67
66
|
clear?: (name?: string | string[]) => void;
|
|
68
67
|
}>;
|
|
69
68
|
/**
|
|
@@ -122,12 +121,12 @@ export interface FormProps {
|
|
|
122
121
|
*/
|
|
123
122
|
className?: string;
|
|
124
123
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
* 标题其他配置
|
|
125
|
+
*/
|
|
127
126
|
labelProps?: LabelProps;
|
|
128
127
|
/**
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
* 报错提示其他配置
|
|
129
|
+
*/
|
|
131
130
|
helperTextProps?: HelperTextProps;
|
|
132
131
|
/**
|
|
133
132
|
* 文字宽度, 只对 type === vertical,状态下生效
|