@yuntijs/ui 1.0.0-beta.45 → 1.0.0-beta.46
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.
|
@@ -13,7 +13,7 @@ export interface FormListOperationAddParams {
|
|
|
13
13
|
}
|
|
14
14
|
export interface FormCollapseListColumn extends FormCollapseListColumnItem, Pick<TableColumnProps<any>, 'align' | 'ellipsis' | 'fixed' | 'responsive' | 'shouldCellUpdate' | 'width'> {
|
|
15
15
|
}
|
|
16
|
-
export interface FormCollapseListProps extends Omit<AntFormListProps, 'name' | 'children'>, Pick<CollapseGroupProps, 'className' | 'icon' | 'title' | 'variant' | 'defaultActive' | 'style'> {
|
|
16
|
+
export interface FormCollapseListProps extends Omit<AntFormListProps, 'name' | 'children'>, Pick<CollapseGroupProps, 'className' | 'extra' | 'expandIcon' | 'icon' | 'title' | 'variant' | 'defaultActive' | 'style'> {
|
|
17
17
|
/** 字段名 */
|
|
18
18
|
name?: FormItemProps['name'];
|
|
19
19
|
/** 表单列为空时展示的空内容 */
|
|
@@ -34,5 +34,7 @@ export interface FormCollapseListProps extends Omit<AntFormListProps, 'name' | '
|
|
|
34
34
|
maxFileds?: number;
|
|
35
35
|
/** 删除时调用,返回 false 时取消删除 */
|
|
36
36
|
onRemove?: (values: any) => boolean | void | Promise<boolean | void>;
|
|
37
|
+
/** 是否启用表单项删除按钮,默认为启用 */
|
|
38
|
+
fieldRemoveButton?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export declare const FormCollapseList: React.FC<FormCollapseListProps>;
|
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["icon", "title", "variant", "defaultActive", "empty", "columns", "disabled", "readOnly", "addOneFieldDefault", "disableRemoveWhenOneField", "maxFileds", "name", "addParams", "className", "onRemove", "style"],
|
|
5
|
+
var _excluded = ["extra", "expandIcon", "icon", "title", "variant", "defaultActive", "empty", "columns", "disabled", "readOnly", "addOneFieldDefault", "disableRemoveWhenOneField", "maxFileds", "name", "addParams", "className", "onRemove", "fieldRemoveButton", "style"],
|
|
6
6
|
_excluded2 = ["label", "name", "render", "dependencies", "rules", "align", "ellipsis", "fixed", "responsive", "shouldCellUpdate", "width"],
|
|
7
7
|
_excluded3 = ["key", "name"];
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
@@ -17,7 +17,9 @@ import { CollapseGroup } from "../../CollapseGroup";
|
|
|
17
17
|
import { useStyles } from "./style";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
export var FormCollapseList = function FormCollapseList(_ref) {
|
|
20
|
-
var
|
|
20
|
+
var extra = _ref.extra,
|
|
21
|
+
expandIcon = _ref.expandIcon,
|
|
22
|
+
icon = _ref.icon,
|
|
21
23
|
title = _ref.title,
|
|
22
24
|
variant = _ref.variant,
|
|
23
25
|
defaultActive = _ref.defaultActive,
|
|
@@ -34,6 +36,8 @@ export var FormCollapseList = function FormCollapseList(_ref) {
|
|
|
34
36
|
addParams = _ref.addParams,
|
|
35
37
|
className = _ref.className,
|
|
36
38
|
onRemove = _ref.onRemove,
|
|
39
|
+
_ref$fieldRemoveButto = _ref.fieldRemoveButton,
|
|
40
|
+
fieldRemoveButton = _ref$fieldRemoveButto === void 0 ? true : _ref$fieldRemoveButto,
|
|
37
41
|
style = _ref.style,
|
|
38
42
|
formListProps = _objectWithoutProperties(_ref, _excluded);
|
|
39
43
|
var _useStyles = useStyles(),
|
|
@@ -60,7 +64,7 @@ export var FormCollapseList = function FormCollapseList(_ref) {
|
|
|
60
64
|
}
|
|
61
65
|
}, [addOneFieldDefault, getAddParams, form, name]);
|
|
62
66
|
return /*#__PURE__*/_jsx(CollapseGroup, {
|
|
63
|
-
extra: name && !readOnly && /*#__PURE__*/_jsx(Tooltip, {
|
|
67
|
+
extra: extra === undefined ? name && !readOnly && /*#__PURE__*/_jsx(Tooltip, {
|
|
64
68
|
title: maxFileds && "\u6700\u591A\u6DFB\u52A0 ".concat(maxFileds, " \u9879"),
|
|
65
69
|
children: /*#__PURE__*/_jsx(Button, {
|
|
66
70
|
disabled: disabled || !!(maxFileds && (fieldsWatch === null || fieldsWatch === void 0 ? void 0 : fieldsWatch.length) === maxFileds),
|
|
@@ -73,8 +77,9 @@ export var FormCollapseList = function FormCollapseList(_ref) {
|
|
|
73
77
|
size: "small",
|
|
74
78
|
type: "text"
|
|
75
79
|
})
|
|
76
|
-
}),
|
|
80
|
+
}) : extra,
|
|
77
81
|
className: className,
|
|
82
|
+
expandIcon: expandIcon,
|
|
78
83
|
icon: icon,
|
|
79
84
|
title: title,
|
|
80
85
|
variant: variant,
|
|
@@ -151,13 +156,10 @@ export var FormCollapseList = function FormCollapseList(_ref) {
|
|
|
151
156
|
}), key);
|
|
152
157
|
}
|
|
153
158
|
};
|
|
154
|
-
})), [{
|
|
159
|
+
})), [!readOnly && fieldRemoveButton !== false && {
|
|
155
160
|
title: '',
|
|
156
161
|
dataIndex: 'del',
|
|
157
162
|
render: function render(_text, _record, index) {
|
|
158
|
-
if (readOnly) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
163
|
var fieldName = fields[index].name;
|
|
162
164
|
return /*#__PURE__*/_jsx(Form.Item, {
|
|
163
165
|
children: /*#__PURE__*/_jsx(Button, {
|
|
@@ -187,7 +189,9 @@ export var FormCollapseList = function FormCollapseList(_ref) {
|
|
|
187
189
|
})
|
|
188
190
|
});
|
|
189
191
|
}
|
|
190
|
-
}])
|
|
192
|
+
}]).filter(function (c) {
|
|
193
|
+
return !!c;
|
|
194
|
+
}),
|
|
191
195
|
dataSource: fields,
|
|
192
196
|
locale: {
|
|
193
197
|
emptyText: empty
|
package/es/SliderInput/index.js
CHANGED
|
@@ -55,7 +55,7 @@ export var SliderInput = function SliderInput(_ref) {
|
|
|
55
55
|
min: min,
|
|
56
56
|
onChange: onNumberChange,
|
|
57
57
|
step: step,
|
|
58
|
-
value: value
|
|
58
|
+
value: value !== null && value !== void 0 ? value : number
|
|
59
59
|
}))
|
|
60
60
|
})), /*#__PURE__*/_jsx(Col, _objectSpread(_objectSpread({}, inputCol), {}, {
|
|
61
61
|
children: /*#__PURE__*/_jsx(InputNumber, _objectSpread(_objectSpread({}, inputProps), {}, {
|
|
@@ -67,7 +67,7 @@ export var SliderInput = function SliderInput(_ref) {
|
|
|
67
67
|
onChange: onNumberChange,
|
|
68
68
|
placeholder: placeholder,
|
|
69
69
|
step: step,
|
|
70
|
-
value: value
|
|
70
|
+
value: value !== null && value !== void 0 ? value : number
|
|
71
71
|
}))
|
|
72
72
|
}))]
|
|
73
73
|
});
|