@hw-component/form 0.0.3-beta-v7 → 0.0.3-beta-v8
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/es/CheckboxGroup/CheckBox/index.js +6 -4
- package/es/CheckboxGroup/index.js +17 -15
- package/es/DialogForm/DrawerForm/Footer.js +16 -12
- package/es/DialogForm/DrawerForm/Title.js +9 -6
- package/es/DialogForm/DrawerForm/index.js +56 -44
- package/es/DialogForm/ModalForm.js +53 -41
- package/es/Form/Context/FormConfigProvider.js +6 -4
- package/es/Form/FormItem/BasicItem.js +33 -17
- package/es/Form/FormItem/Helper.js +9 -7
- package/es/Form/FormItem/RegularFormItem.js +13 -3
- package/es/Form/FormItem/UpFormItem.js +19 -8
- package/es/Form/FormItem/index.js +13 -2
- package/es/Form/HFormConnect.js +13 -2
- package/es/Form/InitSet.js +3 -2
- package/es/Form/Label.js +15 -12
- package/es/Form/config.d.ts +1 -1
- package/es/Form/hooks/useDefaultRender.js +2 -2
- package/es/Form/index.js +35 -20
- package/es/Input/ButtonInput.js +29 -17
- package/es/Input/ColorInput/Picker.js +2 -2
- package/es/Input/ColorInput/index.js +23 -12
- package/es/Input/InputNumber.js +13 -3
- package/es/Input/SelectInput.js +3 -4
- package/es/Input/index.js +13 -2
- package/es/PageHandler/ErrorComponent.js +22 -17
- package/es/PageHandler/LoadingComponent.js +7 -6
- package/es/PageHandler/index.js +6 -4
- package/es/RadioGroup/index.js +14 -3
- package/es/Select/components/AllSelect.js +16 -10
- package/es/Select/components/CheckBoxOption.js +6 -4
- package/es/Select/components/DropdownComponent.js +16 -11
- package/es/Select/components/NoFindItem.js +5 -4
- package/es/Select/components/NotFoundContent.js +23 -18
- package/es/Select/defaultConfig.js +3 -3
- package/es/Select/index.js +36 -22
- package/es/Submit/index.js +29 -14
- package/es/Switch/index.js +23 -8
- package/es/TDPicker/RangePicker.js +3 -3
- package/es/TDPicker/TimePicker.js +13 -3
- package/es/TDPicker/index.js +13 -3
- package/es/TextArea/index.js +13 -3
- package/es/Upload/Btn.js +14 -9
- package/es/Upload/MediaTypeEle/TypeEle.js +14 -12
- package/es/Upload/MediaTypeEle/index.js +3 -2
- package/es/Upload/Preview/index.js +7 -6
- package/es/Upload/UrlUpload/index.js +39 -26
- package/es/Upload/index.js +26 -23
- package/es/index.d.ts +1 -1
- package/lib/CheckboxGroup/CheckBox/index.js +5 -3
- package/lib/CheckboxGroup/index.js +17 -15
- package/lib/DialogForm/DrawerForm/Footer.js +16 -12
- package/lib/DialogForm/DrawerForm/Title.js +9 -6
- package/lib/DialogForm/DrawerForm/index.js +56 -44
- package/lib/DialogForm/ModalForm.js +53 -41
- package/lib/Form/Context/FormConfigProvider.js +5 -3
- package/lib/Form/FormItem/BasicItem.js +33 -17
- package/lib/Form/FormItem/Helper.js +9 -7
- package/lib/Form/FormItem/RegularFormItem.js +13 -3
- package/lib/Form/FormItem/UpFormItem.js +19 -8
- package/lib/Form/FormItem/index.js +13 -2
- package/lib/Form/HFormConnect.js +13 -2
- package/lib/Form/InitSet.js +3 -2
- package/lib/Form/Label.js +15 -12
- package/lib/Form/config.d.ts +1 -1
- package/lib/Form/hooks/useDefaultRender.js +2 -2
- package/lib/Form/index.js +35 -20
- package/lib/Input/ButtonInput.js +29 -17
- package/lib/Input/ColorInput/Picker.js +2 -2
- package/lib/Input/ColorInput/index.js +23 -12
- package/lib/Input/InputNumber.js +13 -3
- package/lib/Input/SelectInput.js +3 -4
- package/lib/Input/index.js +13 -2
- package/lib/PageHandler/ErrorComponent.js +22 -17
- package/lib/PageHandler/LoadingComponent.js +7 -6
- package/lib/PageHandler/index.js +6 -4
- package/lib/RadioGroup/index.js +14 -3
- package/lib/Select/components/AllSelect.js +16 -10
- package/lib/Select/components/CheckBoxOption.js +6 -4
- package/lib/Select/components/DropdownComponent.js +16 -11
- package/lib/Select/components/NoFindItem.js +5 -4
- package/lib/Select/components/NotFoundContent.js +23 -18
- package/lib/Select/defaultConfig.js +3 -3
- package/lib/Select/index.js +36 -22
- package/lib/Submit/index.js +28 -13
- package/lib/Switch/index.js +22 -7
- package/lib/TDPicker/RangePicker.js +2 -2
- package/lib/TDPicker/TimePicker.js +13 -3
- package/lib/TDPicker/index.js +13 -3
- package/lib/TextArea/index.js +13 -3
- package/lib/Upload/Btn.js +14 -9
- package/lib/Upload/MediaTypeEle/TypeEle.js +14 -12
- package/lib/Upload/MediaTypeEle/index.js +3 -2
- package/lib/Upload/Preview/index.js +7 -6
- package/lib/Upload/UrlUpload/index.js +39 -26
- package/lib/Upload/index.js +26 -23
- package/lib/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/Submit/index.tsx +27 -23
- package/tsconfig.json +1 -1
package/lib/Upload/index.js
CHANGED
|
@@ -10,11 +10,11 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/
|
|
|
10
10
|
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js/object/get-own-property-descriptors');
|
|
11
11
|
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js/object/define-properties');
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js/object/define-property');
|
|
13
|
-
var _extends = require('@babel/runtime-corejs3/helpers/extends');
|
|
14
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
15
14
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
16
15
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
17
16
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js/instance/map');
|
|
17
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
18
18
|
var React = require('react');
|
|
19
19
|
var propsMaker = require('./hooks/propsMaker.js');
|
|
20
20
|
var index = require('./Preview/index.js');
|
|
@@ -115,28 +115,31 @@ var Index = function Index(_ref, ref) {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
|
-
return
|
|
119
|
-
style: contentStyle
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
118
|
+
return jsxRuntime.jsxs("div", {
|
|
119
|
+
style: contentStyle,
|
|
120
|
+
children: [jsxRuntime.jsx(antd.Upload, _objectSpread(_objectSpread({
|
|
121
|
+
listType: listType,
|
|
122
|
+
maxCount: maxNum,
|
|
123
|
+
fileList: value,
|
|
124
|
+
onPreview: preview,
|
|
125
|
+
onChange: change$1,
|
|
126
|
+
beforeUpload: function beforeUpload() {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}, props), {}, {
|
|
130
|
+
children: jsxRuntime.jsx(Btn.default, {
|
|
131
|
+
value: value,
|
|
132
|
+
maxCount: maxCount,
|
|
133
|
+
listType: listType
|
|
134
|
+
})
|
|
135
|
+
})), jsxRuntime.jsx(index.default, {
|
|
136
|
+
visible: visible,
|
|
137
|
+
file: previewFile,
|
|
138
|
+
onCancel: function onCancel() {
|
|
139
|
+
setPreviewModal({});
|
|
140
|
+
}
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
140
143
|
};
|
|
141
144
|
var HUpload = HFormConnect.default( /*#__PURE__*/React.forwardRef(Index));
|
|
142
145
|
|
package/lib/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const HButtonInput: import("react").FC<import("./Input/modal").HB
|
|
|
14
14
|
export declare const HCheckBox: import("react").FC<import("./CheckboxGroup/modal").HCheckboxProps>;
|
|
15
15
|
export declare const HSwitch: import("react").FC<import("./Switch").HSwitchProps>;
|
|
16
16
|
export declare const HCheckboxGroup: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
17
|
-
export declare const HDatePicker: (
|
|
17
|
+
export declare const HDatePicker: import("react").FC<import("./TDPicker/modal").HDatePickerProps>;
|
|
18
18
|
export declare const HRangePicker: import("react").ForwardRefExoticComponent<import("./Form/modal").HFormItemProps & import("react").RefAttributes<any>>;
|
|
19
19
|
export declare const HRadioGroup: ({ value, options, onChange, fieldNames: propsFieldNames, ...props }: import("./RadioGroup").HRadioGroupProps) => JSX.Element;
|
|
20
20
|
export declare const HTimePicker: ({ value, format, onChange, ...props }: import("./TDPicker/modal").HTimePickerProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hw-component/form",
|
|
3
|
-
"version": "0.0.3-beta-
|
|
3
|
+
"version": "0.0.3-beta-v8",
|
|
4
4
|
"description": "基于antd二次开发",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"ahooks": "2.10.9",
|
|
33
33
|
"antd": "4.20.7",
|
|
34
34
|
"react": "17.0.0",
|
|
35
|
-
"react-dom": "17.0.2",
|
|
36
35
|
"react-color": "^2.19.3",
|
|
36
|
+
"react-dom": "17.0.2",
|
|
37
37
|
"react-router-dom": "^6.11.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Button, Row} from "antd";
|
|
1
|
+
import { Button, Row,Space } from "antd";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useFormContext } from "../Form/Context";
|
|
4
4
|
import type { ButtonProps, FormInstance } from "antd/es";
|
|
@@ -6,37 +6,41 @@ import type { ButtonProps, FormInstance } from "antd/es";
|
|
|
6
6
|
export interface ISubmitProps extends Omit<ButtonProps, "form"> {
|
|
7
7
|
text?: string;
|
|
8
8
|
form: FormInstance;
|
|
9
|
-
reset?:boolean;
|
|
10
|
-
position?:"start"|"end"
|
|
9
|
+
reset?: boolean;
|
|
10
|
+
position?: "start" | "end";
|
|
11
11
|
}
|
|
12
12
|
export default ({
|
|
13
13
|
text = "提交",
|
|
14
14
|
type = "primary",
|
|
15
15
|
form,
|
|
16
16
|
loading,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
position = "start",
|
|
18
|
+
reset,
|
|
19
19
|
...props
|
|
20
20
|
}: ISubmitProps) => {
|
|
21
21
|
const { loading: formSubLoading = loading } = useFormContext();
|
|
22
22
|
return (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
<Row justify={position} style={{ width: "100%" }}>
|
|
24
|
+
<Space>
|
|
25
|
+
{reset && (
|
|
26
|
+
<Button
|
|
27
|
+
{...props}
|
|
28
|
+
onClick={() => {
|
|
29
|
+
form.resetFields();
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
重制
|
|
33
|
+
</Button>
|
|
34
|
+
)}
|
|
35
|
+
<Button
|
|
36
|
+
{...props}
|
|
37
|
+
type={type}
|
|
38
|
+
onClick={form.submit}
|
|
39
|
+
loading={formSubLoading}
|
|
40
|
+
>
|
|
41
|
+
{text}
|
|
42
|
+
</Button>
|
|
43
|
+
</Space>
|
|
44
|
+
</Row>
|
|
41
45
|
);
|
|
42
46
|
};
|