@hw-component/form 0.0.9-beta-v19 → 0.0.9-beta-v21
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/.eslintcache +1 -0
- package/.idea/hw-component-form.iml +12 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/es/Select/modal.d.ts +1 -3
- package/lib/Select/modal.d.ts +1 -3
- package/package.json +1 -1
- package/public/index.html +0 -19
- package/scripts/rollup.config.js +0 -90
- package/scripts/webpack.config.js +0 -76
- package/src/Layout.tsx +0 -61
- package/src/app.tsx +0 -33
- package/src/components/Cascader/index.tsx +0 -31
- package/src/components/CheckboxGroup/CheckBox/index.tsx +0 -38
- package/src/components/CheckboxGroup/hooks.ts +0 -105
- package/src/components/CheckboxGroup/index.tsx +0 -85
- package/src/components/CheckboxGroup/modal.ts +0 -17
- package/src/components/DialogForm/DrawerForm/Footer.tsx +0 -20
- package/src/components/DialogForm/DrawerForm/Title.tsx +0 -12
- package/src/components/DialogForm/DrawerForm/index.tsx +0 -110
- package/src/components/DialogForm/ModalForm.tsx +0 -91
- package/src/components/DialogForm/hooks.ts +0 -122
- package/src/components/DialogForm/modal.ts +0 -44
- package/src/components/Form/Context/FormConfigProvider.tsx +0 -38
- package/src/components/Form/Context/index.tsx +0 -14
- package/src/components/Form/FormItem/BasicItem.tsx +0 -95
- package/src/components/Form/FormItem/Helper.tsx +0 -25
- package/src/components/Form/FormItem/RegularFormItem.tsx +0 -13
- package/src/components/Form/FormItem/UpFormItem.tsx +0 -21
- package/src/components/Form/FormItem/hooks.tsx +0 -54
- package/src/components/Form/FormItem/index.tsx +0 -8
- package/src/components/Form/HFormConnect.tsx +0 -74
- package/src/components/Form/InitSet.tsx +0 -10
- package/src/components/Form/Label.tsx +0 -50
- package/src/components/Form/config.ts +0 -58
- package/src/components/Form/hooks/index.ts +0 -114
- package/src/components/Form/hooks/useDefaultRender.tsx +0 -45
- package/src/components/Form/hooks/useHForm.ts +0 -182
- package/src/components/Form/hooks/useInitConfigData.tsx +0 -194
- package/src/components/Form/index.less +0 -54
- package/src/components/Form/index.tsx +0 -113
- package/src/components/Form/modal.ts +0 -206
- package/src/components/Input/ButtonInput.tsx +0 -47
- package/src/components/Input/ColorInput/Picker.tsx +0 -18
- package/src/components/Input/ColorInput/data.ts +0 -102
- package/src/components/Input/ColorInput/index.less +0 -10
- package/src/components/Input/ColorInput/index.tsx +0 -58
- package/src/components/Input/InputNumber.tsx +0 -5
- package/src/components/Input/SelectInput.tsx +0 -75
- package/src/components/Input/TrimInput.tsx +0 -26
- package/src/components/Input/VerificationCodeInput.tsx +0 -74
- package/src/components/Input/defaultConfig.ts +0 -8
- package/src/components/Input/index.tsx +0 -26
- package/src/components/Input/modal.ts +0 -40
- package/src/components/PageHandler/ErrorComponent.tsx +0 -20
- package/src/components/PageHandler/LoadingComponent.tsx +0 -9
- package/src/components/PageHandler/index.tsx +0 -14
- package/src/components/PageHandler/modal.ts +0 -6
- package/src/components/RadioGroup/index.tsx +0 -45
- package/src/components/Select/components/AllSelect.tsx +0 -54
- package/src/components/Select/components/CheckBoxOption.tsx +0 -14
- package/src/components/Select/components/DropdownComponent.tsx +0 -36
- package/src/components/Select/components/NoFindItem.tsx +0 -7
- package/src/components/Select/components/NotFoundContent.tsx +0 -25
- package/src/components/Select/defaultConfig.tsx +0 -23
- package/src/components/Select/hooks/changeHooks.tsx +0 -159
- package/src/components/Select/hooks/norHooks.ts +0 -85
- package/src/components/Select/index.less +0 -22
- package/src/components/Select/index.tsx +0 -126
- package/src/components/Select/modal.ts +0 -38
- package/src/components/Select/utils.ts +0 -18
- package/src/components/Submit/components.tsx +0 -57
- package/src/components/Submit/hooks.ts +0 -31
- package/src/components/Submit/index.tsx +0 -33
- package/src/components/Switch/index.tsx +0 -77
- package/src/components/TDPicker/RangePicker.tsx +0 -109
- package/src/components/TDPicker/TimePicker.tsx +0 -29
- package/src/components/TDPicker/hooks.ts +0 -150
- package/src/components/TDPicker/index.tsx +0 -33
- package/src/components/TDPicker/modal.ts +0 -48
- package/src/components/TextArea/TrimTextArea.tsx +0 -30
- package/src/components/TextArea/index.tsx +0 -8
- package/src/components/Upload/Btn.tsx +0 -24
- package/src/components/Upload/MediaTypeEle/TypeEle.tsx +0 -26
- package/src/components/Upload/MediaTypeEle/index.tsx +0 -34
- package/src/components/Upload/Preview/index.tsx +0 -14
- package/src/components/Upload/UrlUpload/index.tsx +0 -104
- package/src/components/Upload/enums.ts +0 -5
- package/src/components/Upload/hooks/change.ts +0 -79
- package/src/components/Upload/hooks/customRequest.ts +0 -87
- package/src/components/Upload/hooks/propsMaker.ts +0 -20
- package/src/components/Upload/index.tsx +0 -119
- package/src/components/Upload/modal.ts +0 -33
- package/src/components/Upload/util.ts +0 -27
- package/src/components/config.ts +0 -47
- package/src/components/hooks/index.ts +0 -53
- package/src/components/index.tsx +0 -37
- package/src/components/modal.ts +0 -20
- package/src/components/styles/index.less +0 -3
- package/src/components/styles/local.less +0 -1
- package/src/components/typings.d.ts +0 -11
- package/src/index.less +0 -20
- package/src/index.tsx +0 -12
- package/src/pages/Checkbox/index.tsx +0 -14
- package/src/pages/DatePicker/index.tsx +0 -33
- package/src/pages/DrawerForm/index.tsx +0 -145
- package/src/pages/Form/index.tsx +0 -172
- package/src/pages/Input/index.tsx +0 -30
- package/src/pages/ModalForm/index.tsx +0 -191
- package/src/pages/Radio/index.tsx +0 -18
- package/src/pages/Select/index.tsx +0 -63
- package/src/pages/Switch/index.tsx +0 -18
- package/src/pages/Upload/index.tsx +0 -14
- package/src/routes.tsx +0 -80
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { Button } from "antd";
|
|
2
|
-
import {
|
|
3
|
-
HModalForm,
|
|
4
|
-
useHDialogForm,
|
|
5
|
-
HFormConfigProvider,
|
|
6
|
-
} from "../../components";
|
|
7
|
-
import { useState } from "react";
|
|
8
|
-
import { ShowParamsModal } from "@/components/DialogForm/modal";
|
|
9
|
-
const data = [
|
|
10
|
-
{
|
|
11
|
-
label: "输入框",
|
|
12
|
-
name: "name",
|
|
13
|
-
rules: [
|
|
14
|
-
() => {
|
|
15
|
-
return {
|
|
16
|
-
required: true,
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label: "数字",
|
|
23
|
-
name: "sz",
|
|
24
|
-
type: "inputNumber",
|
|
25
|
-
rules: [{ required: true }],
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: "下拉输入框",
|
|
29
|
-
name: "selectInput",
|
|
30
|
-
type: "selectInput",
|
|
31
|
-
rules: [{ required: true }],
|
|
32
|
-
itemProps: {
|
|
33
|
-
valueName: {
|
|
34
|
-
select: "op",
|
|
35
|
-
input: "opInput",
|
|
36
|
-
},
|
|
37
|
-
selectProps: {
|
|
38
|
-
options: [{ label: "测试", value: 1 }],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: "按钮输入框",
|
|
44
|
-
name: "buttonInput",
|
|
45
|
-
type: "buttonInput",
|
|
46
|
-
children: "点击",
|
|
47
|
-
rules: [{ required: true }],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
label: "选择",
|
|
51
|
-
name: "checkboxGroup",
|
|
52
|
-
type: "checkboxGroup",
|
|
53
|
-
rules: [{ required: true }],
|
|
54
|
-
helper: "帮助我",
|
|
55
|
-
options: [
|
|
56
|
-
{ label: "选择1", value: "check1" },
|
|
57
|
-
{ label: "选择2", value: "check2" },
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
label: "开关",
|
|
62
|
-
name: "switch",
|
|
63
|
-
type: "switch",
|
|
64
|
-
rules: [{ required: true }],
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
label: "时间",
|
|
68
|
-
name: "datePicker",
|
|
69
|
-
type: "datePicker",
|
|
70
|
-
hover: "时间选择",
|
|
71
|
-
helper: "帮助我",
|
|
72
|
-
rules: [{ required: true }],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
label: "时间段",
|
|
76
|
-
name: "rangePicker",
|
|
77
|
-
type: "rangePicker",
|
|
78
|
-
helper: "帮助我",
|
|
79
|
-
rules: [{ required: true }],
|
|
80
|
-
itemProps: {
|
|
81
|
-
valueMap: {
|
|
82
|
-
start: "testStart",
|
|
83
|
-
end: "testEnd",
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
label: "时分秒",
|
|
89
|
-
name: "timePicker",
|
|
90
|
-
type: "timePicker",
|
|
91
|
-
rules: [{ required: true }],
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: "文件",
|
|
95
|
-
name: "upload",
|
|
96
|
-
type: "upload",
|
|
97
|
-
rules: [{ required: true }],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
label: "地址文件",
|
|
101
|
-
name: "urlUpload",
|
|
102
|
-
type: "urlUpload",
|
|
103
|
-
rules: [{ required: true }],
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
label: "下拉框",
|
|
107
|
-
name: "select",
|
|
108
|
-
type: "select",
|
|
109
|
-
dispatch: {
|
|
110
|
-
fnKey: "reload",
|
|
111
|
-
dependencies: ["selectInput", "sz"],
|
|
112
|
-
manual: false,
|
|
113
|
-
},
|
|
114
|
-
itemProps: {
|
|
115
|
-
request: (params = {}, values) => {
|
|
116
|
-
const { label = "123", value = 1 } = params;
|
|
117
|
-
return Promise.resolve([{ label, value }]);
|
|
118
|
-
},
|
|
119
|
-
showSearch: true,
|
|
120
|
-
},
|
|
121
|
-
rules: [{ required: true }],
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
label: "验证码",
|
|
125
|
-
type: "verificationCodeInput",
|
|
126
|
-
name: "verificationCodeInput",
|
|
127
|
-
itemProps: {
|
|
128
|
-
request: () => {
|
|
129
|
-
return Promise.resolve({ code: 200 });
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
let num = 0;
|
|
135
|
-
export default () => {
|
|
136
|
-
const modalForm = useHDialogForm();
|
|
137
|
-
return (
|
|
138
|
-
<>
|
|
139
|
-
<Button
|
|
140
|
-
onClick={() => {
|
|
141
|
-
num++;
|
|
142
|
-
modalForm.show({
|
|
143
|
-
params: {
|
|
144
|
-
name: num,
|
|
145
|
-
},
|
|
146
|
-
});
|
|
147
|
-
}}
|
|
148
|
-
>
|
|
149
|
-
打开
|
|
150
|
-
</Button>
|
|
151
|
-
<Button
|
|
152
|
-
onClick={() => {
|
|
153
|
-
modalForm.show({
|
|
154
|
-
params: {
|
|
155
|
-
name: num,
|
|
156
|
-
},
|
|
157
|
-
initialValues: {
|
|
158
|
-
name: "name",
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
}}
|
|
162
|
-
>
|
|
163
|
-
宣誓
|
|
164
|
-
</Button>
|
|
165
|
-
<HFormConfigProvider
|
|
166
|
-
uploadProps={{
|
|
167
|
-
request: () => {
|
|
168
|
-
return Promise.resolve({
|
|
169
|
-
url: "https://gw.alicdn.com/imgextra/i2/O1CN01MYuwJQ1GXVBWryCFJ_!!6000000000632-2-tps-1125-570.png_468x468q75.jpg_.webp",
|
|
170
|
-
});
|
|
171
|
-
},
|
|
172
|
-
}}
|
|
173
|
-
>
|
|
174
|
-
<HModalForm
|
|
175
|
-
configData={data}
|
|
176
|
-
labelWidth={88}
|
|
177
|
-
contentRender={(node, form) => {
|
|
178
|
-
return (
|
|
179
|
-
<div>
|
|
180
|
-
<div>测试一些</div>
|
|
181
|
-
{node}
|
|
182
|
-
</div>
|
|
183
|
-
);
|
|
184
|
-
}}
|
|
185
|
-
dialogForm={modalForm}
|
|
186
|
-
title="测试"
|
|
187
|
-
/>
|
|
188
|
-
</HFormConfigProvider>
|
|
189
|
-
</>
|
|
190
|
-
);
|
|
191
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Space } from "antd";
|
|
2
|
-
import { HRadioGroup } from "../../components";
|
|
3
|
-
export default () => {
|
|
4
|
-
return (
|
|
5
|
-
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
6
|
-
<HRadioGroup
|
|
7
|
-
options={[
|
|
8
|
-
{ label: "测试2", value: "2" },
|
|
9
|
-
{ label: "测试1", value: "1" },
|
|
10
|
-
]}
|
|
11
|
-
value={"1"}
|
|
12
|
-
onChange={(value) => {
|
|
13
|
-
console.log(value);
|
|
14
|
-
}}
|
|
15
|
-
/>
|
|
16
|
-
</Space>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { HSelect } from "../../components";
|
|
2
|
-
import { Space } from "antd";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
export default () => {
|
|
5
|
-
const [selectVal, setSelectVal] = useState([10]);
|
|
6
|
-
return (
|
|
7
|
-
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
8
|
-
<HSelect
|
|
9
|
-
options={[{ label: "测试", value: 1 }]}
|
|
10
|
-
value={100}
|
|
11
|
-
placeholder="基础"
|
|
12
|
-
allowClear={true}
|
|
13
|
-
/>
|
|
14
|
-
<HSelect
|
|
15
|
-
fieldNames={{ label: "name", value: "value" }}
|
|
16
|
-
options={[
|
|
17
|
-
{ name: "测试1", value: 10, userId: 112321 },
|
|
18
|
-
{ name: "测试2", value: 20, userId: 112321 },
|
|
19
|
-
]}
|
|
20
|
-
placeholder="多选"
|
|
21
|
-
value={selectVal}
|
|
22
|
-
onChange={(val, option) => {
|
|
23
|
-
setSelectVal(val);
|
|
24
|
-
}}
|
|
25
|
-
allSelect={true}
|
|
26
|
-
mode={"multiple"}
|
|
27
|
-
allowClear={true}
|
|
28
|
-
showSearch={true}
|
|
29
|
-
/>
|
|
30
|
-
<HSelect
|
|
31
|
-
mode={"tags"}
|
|
32
|
-
placeholder="tags模式"
|
|
33
|
-
showSearch={true}
|
|
34
|
-
allowClear={true}
|
|
35
|
-
options={[
|
|
36
|
-
{ label: "测试1", value: 10 },
|
|
37
|
-
{ label: "测试2", value: 20 },
|
|
38
|
-
]}
|
|
39
|
-
/>
|
|
40
|
-
<HSelect
|
|
41
|
-
serviceSearch={true}
|
|
42
|
-
request={(params) => {
|
|
43
|
-
return new Promise((resolve) => {
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
resolve([
|
|
46
|
-
{
|
|
47
|
-
label: `我是搜索文案${params.inputValue}`,
|
|
48
|
-
value: new Date().valueOf(),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
label: `我是搜索文案${params.inputValue}`,
|
|
52
|
-
value: new Date().valueOf() + 1,
|
|
53
|
-
},
|
|
54
|
-
]);
|
|
55
|
-
}, 2000);
|
|
56
|
-
});
|
|
57
|
-
}}
|
|
58
|
-
placeholder="远程搜索"
|
|
59
|
-
mode={"multiple"}
|
|
60
|
-
/>
|
|
61
|
-
</Space>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Space } from "antd";
|
|
2
|
-
import { HSwitch } from "../../components";
|
|
3
|
-
export default () => {
|
|
4
|
-
return (
|
|
5
|
-
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
6
|
-
<HSwitch
|
|
7
|
-
value={1}
|
|
8
|
-
beforeText="开关"
|
|
9
|
-
valueMap={{ open: 1, close: 0 }}
|
|
10
|
-
onChange={(val) => {
|
|
11
|
-
console.log(val);
|
|
12
|
-
}}
|
|
13
|
-
>
|
|
14
|
-
打开
|
|
15
|
-
</HSwitch>
|
|
16
|
-
</Space>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Space } from "antd";
|
|
2
|
-
import { HUrlUpload, HUpload } from "../../components";
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
|
|
5
|
-
export default () => {
|
|
6
|
-
const [files, setFiles] = useState([]);
|
|
7
|
-
const [files1, setFiles1] = useState([]);
|
|
8
|
-
return (
|
|
9
|
-
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
10
|
-
<HUpload value={files} onChange={setFiles} multiple={true} maxCount={3} />
|
|
11
|
-
<HUrlUpload value={files1} onChange={setFiles1} />
|
|
12
|
-
</Space>
|
|
13
|
-
);
|
|
14
|
-
};
|
package/src/routes.tsx
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Navigate } from "react-router-dom";
|
|
3
|
-
import Select from "./pages/Select";
|
|
4
|
-
import Input from "./pages/Input";
|
|
5
|
-
import CheckBox from "./pages/Checkbox";
|
|
6
|
-
import Radio from "./pages/Radio";
|
|
7
|
-
import Switch from "./pages/Switch";
|
|
8
|
-
import DatePicker from "./pages/DatePicker";
|
|
9
|
-
import Upload from "./pages/Upload";
|
|
10
|
-
import Form from "./pages/Form";
|
|
11
|
-
import ModalForm from "./pages/ModalForm";
|
|
12
|
-
import DrawerForm from "./pages/DrawerForm";
|
|
13
|
-
|
|
14
|
-
export interface RouteModal {
|
|
15
|
-
path?: string;
|
|
16
|
-
name?: string;
|
|
17
|
-
children?: RouteModal[];
|
|
18
|
-
element?: JSX.Element;
|
|
19
|
-
index?: boolean;
|
|
20
|
-
errorElement?: JSX.Element;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const routes: RouteModal[] = [
|
|
24
|
-
{
|
|
25
|
-
index: true,
|
|
26
|
-
element: <Navigate to="/select" replace={true} />,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
path: "/select",
|
|
30
|
-
name: "下拉框",
|
|
31
|
-
element: <Select />,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
path: "/input",
|
|
35
|
-
name: "输入框",
|
|
36
|
-
element: <Input />,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
path: "/checkbox",
|
|
40
|
-
name: "多选",
|
|
41
|
-
element: <CheckBox />,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
path: "/radio",
|
|
45
|
-
name: "单选",
|
|
46
|
-
element: <Radio />,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
path: "/switch",
|
|
50
|
-
name: "开关",
|
|
51
|
-
element: <Switch />,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
path: "/datePicker",
|
|
55
|
-
name: "时间",
|
|
56
|
-
element: <DatePicker />,
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
path: "/upload",
|
|
60
|
-
name: "上传文件",
|
|
61
|
-
element: <Upload />,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
path: "/form",
|
|
65
|
-
name: "表单",
|
|
66
|
-
element: <Form />,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
path: "/modalForm",
|
|
70
|
-
name: "弹窗表单",
|
|
71
|
-
element: <ModalForm />,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
path: "/drawerForm",
|
|
75
|
-
name: "抽屉表单",
|
|
76
|
-
element: <DrawerForm />,
|
|
77
|
-
},
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
export default routes;
|