@kne/form-info 0.1.0-alpha.0
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/README.md +61 -0
- package/dist/index.css +198 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +401 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +398 -0
- package/dist/index.modern.js.map +1 -0
- package/package.json +92 -0
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
# form-info
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### 描述
|
|
6
|
+
|
|
7
|
+
构建一个更加美观的form表单组件
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### 安装
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
npm i --save @kne/form-info
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 示例
|
|
17
|
+
|
|
18
|
+
#### 示例代码
|
|
19
|
+
|
|
20
|
+
- 这里填写示例标题
|
|
21
|
+
- 这里填写示例说明
|
|
22
|
+
- _FormInfo(@kne/current-lib_form-info),(@kne/current-lib_form-info/dist/index.css)
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
const {default: FormInfo, List, TableList, MultiField, Form, Input, TextArea} = _FormInfo;
|
|
26
|
+
|
|
27
|
+
const BaseExample = () => {
|
|
28
|
+
return <Form>
|
|
29
|
+
<FormInfo title="标题" subtitle="附标题" list={[<Input name="field_1" label="字段1" rule="REQ"/>,
|
|
30
|
+
<Input name="field_2" label="字段2" rule="REQ"/>,
|
|
31
|
+
<Input name="field_3" hidden label="隐藏字段" rule="REQ"/>,
|
|
32
|
+
<MultiField name="field_4" label="字段4" rule="REQ" field={Input} block/>,
|
|
33
|
+
<TextArea name="description" label="描述" block/>]}/>
|
|
34
|
+
<List title="列表" name="list-1" itemTitle={({index}) => `项目${index + 1}`}
|
|
35
|
+
list={[<Input name="field_1" label="字段1" rule="REQ"/>, <Input name="field_2" label="字段2" rule="REQ"/>,
|
|
36
|
+
<TextArea name="description" label="描述" block/>]}/>
|
|
37
|
+
<List title="复杂列表" name="list-2" itemTitle={({index}) => `项目${index + 1}`} important
|
|
38
|
+
list={[<Input name="field_1" label="字段1" rule="REQ"/>, <Input name="field_2" label="字段2" rule="REQ"/>,
|
|
39
|
+
<TextArea name="description" label="描述" block/>,
|
|
40
|
+
<List title="子级列表" itemTitle={({index}) => `子级项目${index + 1}`}
|
|
41
|
+
list={[<Input name="field_1" label="字段1" rule="REQ"/>,
|
|
42
|
+
<Input name="field_2" label="字段2" rule="REQ"/>,
|
|
43
|
+
<TextArea name="description" label="描述" block/>]} block/>]}/>
|
|
44
|
+
<TableList title="表格列表" name="list-3" itemTitle={({index}) => `项目${index + 1}`}
|
|
45
|
+
list={[<Input name="field_1" label="字段1" rule="REQ"/>,
|
|
46
|
+
<Input name="field_2" label="字段2" rule="REQ"/>,
|
|
47
|
+
<Input name="description" label="描述" block/>]}/>
|
|
48
|
+
</Form>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
render(<BaseExample/>);
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### API
|
|
57
|
+
|
|
58
|
+
| 属性名 | 说明 | 类型 | 默认值 |
|
|
59
|
+
|-----|----|----|-----|
|
|
60
|
+
| | | | |
|
|
61
|
+
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
._ZQNNL .react-form__field {
|
|
2
|
+
color: var(--font-color);
|
|
3
|
+
}
|
|
4
|
+
._ZQNNL .react-form__field input {
|
|
5
|
+
color: var(--font-color);
|
|
6
|
+
}
|
|
7
|
+
._ZQNNL .react-form__field input::placeholder {
|
|
8
|
+
color: var(--font-color-grey-2);
|
|
9
|
+
}
|
|
10
|
+
._ZQNNL .react-form__field-label.is-req {
|
|
11
|
+
margin-left: 0;
|
|
12
|
+
}
|
|
13
|
+
._ZQNNL .react-form__field-label {
|
|
14
|
+
color: var(--font-color-grey);
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
height: 20px;
|
|
18
|
+
margin-bottom: 8px;
|
|
19
|
+
font-weight: normal !important;
|
|
20
|
+
}
|
|
21
|
+
._ZQNNL .react-form__field-label.is-req:before {
|
|
22
|
+
color: var(--color-warning);
|
|
23
|
+
position: static;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
transform: translateX(0);
|
|
26
|
+
margin-right: 6px;
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
}
|
|
29
|
+
._ZQNNL .react-form__field-error {
|
|
30
|
+
line-height: 14px;
|
|
31
|
+
}
|
|
32
|
+
._ZQNNL .ant-input-number,
|
|
33
|
+
._ZQNNL .ant-input-number-group-wrapper {
|
|
34
|
+
width: 100%;
|
|
35
|
+
}
|
|
36
|
+
._ZQNNL .ant-picker.react-form__field-component,
|
|
37
|
+
._ZQNNL .data_range_picker {
|
|
38
|
+
flex: 1;
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
._ZQNNL .ant-input-number-group-addon,
|
|
42
|
+
._ZQNNL .ant-input-group-addon {
|
|
43
|
+
background: #ffffff;
|
|
44
|
+
color: var(--font-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
._GW4Xx > .ant-card-head .part-title {
|
|
48
|
+
font-size: var(--font-size-large);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
._eY4qR.ant-btn {
|
|
52
|
+
border-radius: 2px;
|
|
53
|
+
border: 1px solid var(--font-color-grey-2);
|
|
54
|
+
padding: 6px 12px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
._SL3dC > .ant-card-head .part-title {
|
|
58
|
+
font-size: var(--font-size-large);
|
|
59
|
+
}
|
|
60
|
+
._SL3dC ._SL3dC ._eY4qR {
|
|
61
|
+
padding: 0;
|
|
62
|
+
border: none;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
._SL3dC.ant-card .ant-card-body {
|
|
66
|
+
padding: 16px 0 0;
|
|
67
|
+
border-radius: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
._PNnMa._Xkp38 > ._HiB5Q.ant-card > .ant-card-head {
|
|
71
|
+
background: var(--primary-color-06);
|
|
72
|
+
}
|
|
73
|
+
._PNnMa._Xkp38 > ._HiB5Q.ant-card > .ant-card-head .ant-card-head-title .part-title {
|
|
74
|
+
color: var(--primary-color);
|
|
75
|
+
}
|
|
76
|
+
._PNnMa._Xkp38 ._HiB5Q.ant-card .ant-card-head-title .part-title {
|
|
77
|
+
font-weight: 500;
|
|
78
|
+
}
|
|
79
|
+
._PNnMa._Xkp38 > ._HiB5Q.ant-card ._SL3dC.ant-card > .ant-card-head {
|
|
80
|
+
background: transparent;
|
|
81
|
+
padding: 0;
|
|
82
|
+
border: none;
|
|
83
|
+
line-height: 1;
|
|
84
|
+
}
|
|
85
|
+
._PNnMa._Xkp38 > ._HiB5Q.ant-card ._SL3dC.ant-card > .ant-card-head .part-title {
|
|
86
|
+
background: var(--primary-color-06);
|
|
87
|
+
color: var(--primary-color);
|
|
88
|
+
font-size: var(--font-size-small);
|
|
89
|
+
font-weight: bold;
|
|
90
|
+
}
|
|
91
|
+
._PNnMa._Xkp38 > ._HiB5Q.ant-card ._SL3dC.ant-card > .ant-card-body {
|
|
92
|
+
padding: 16px 0;
|
|
93
|
+
}
|
|
94
|
+
._PNnMa._Xkp38 > ._HiB5Q {
|
|
95
|
+
border-color: var(--primary-color-5);
|
|
96
|
+
}
|
|
97
|
+
._PNnMa._Xkp38 ._Uw-3T {
|
|
98
|
+
border: none;
|
|
99
|
+
}
|
|
100
|
+
._PNnMa ._HiB5Q.ant-card .ant-card-head {
|
|
101
|
+
background: #f8f8f8;
|
|
102
|
+
border-bottom: 1px solid var(--font-color-grey-4);
|
|
103
|
+
line-height: 36px;
|
|
104
|
+
height: 36px;
|
|
105
|
+
padding: 0 16px;
|
|
106
|
+
}
|
|
107
|
+
._PNnMa ._HiB5Q.ant-card .ant-card-head-title .part-title {
|
|
108
|
+
background: transparent;
|
|
109
|
+
font-weight: normal;
|
|
110
|
+
font-size: 14px;
|
|
111
|
+
color: var(--font-color);
|
|
112
|
+
}
|
|
113
|
+
._PNnMa ._HiB5Q.ant-card .ant-card-body {
|
|
114
|
+
padding: 16px;
|
|
115
|
+
}
|
|
116
|
+
._PNnMa .ant-divider {
|
|
117
|
+
border-top-color: var(--font-color-grey-2);
|
|
118
|
+
}
|
|
119
|
+
._PNnMa .ant-divider {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
._PNnMa:not(:last-child) {
|
|
123
|
+
margin-bottom: 16px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
._HiB5Q {
|
|
127
|
+
border: 1px solid var(--font-color-grey-4);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
._uogqr {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-wrap: nowrap;
|
|
133
|
+
gap: 8px;
|
|
134
|
+
}
|
|
135
|
+
._uogqr:not(._4UoWy) .react-form__field-label {
|
|
136
|
+
display: none;
|
|
137
|
+
}
|
|
138
|
+
._uogqr ._UGjS9 {
|
|
139
|
+
color: var(--font-color-grey);
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
line-height: 20px;
|
|
142
|
+
height: 20px;
|
|
143
|
+
margin-bottom: 8px;
|
|
144
|
+
}
|
|
145
|
+
._uogqr .react-form__field {
|
|
146
|
+
flex: 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
._rjVPh {
|
|
150
|
+
margin-bottom: 16px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
._r8-bn ._PNnMa {
|
|
154
|
+
margin-bottom: 0 !important;
|
|
155
|
+
}
|
|
156
|
+
._r8-bn .react-form__field-label {
|
|
157
|
+
display: none;
|
|
158
|
+
}
|
|
159
|
+
._r8-bn .ant-row:not(:last-child) {
|
|
160
|
+
border-bottom: solid 1px var(--bg-color-grey-3);
|
|
161
|
+
}
|
|
162
|
+
._r8-bn .ant-row:hover {
|
|
163
|
+
background: var(--bg-color-grey-1) !important;
|
|
164
|
+
}
|
|
165
|
+
._r8-bn .ant-col {
|
|
166
|
+
padding: 16px;
|
|
167
|
+
width: var(--col-width);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
._Uw-3T {
|
|
171
|
+
border: solid 1px var(--bg-color-grey-3);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
._Qkutm.ant-col {
|
|
175
|
+
padding-bottom: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
._9WdfD {
|
|
179
|
+
background: var(--bg-color-grey-1);
|
|
180
|
+
}
|
|
181
|
+
._9WdfD ._CsPaL:before {
|
|
182
|
+
color: var(--color-warning);
|
|
183
|
+
content: "*";
|
|
184
|
+
position: static;
|
|
185
|
+
display: inline-block;
|
|
186
|
+
transform: translateX(0);
|
|
187
|
+
margin-right: 6px;
|
|
188
|
+
font-weight: bold;
|
|
189
|
+
}
|
|
190
|
+
._9WdfD .ant-col {
|
|
191
|
+
padding: 8px 16px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
._8smwK {
|
|
195
|
+
flex-basis: 100px;
|
|
196
|
+
text-align: right;
|
|
197
|
+
}
|
|
198
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,wBAAwB;AAC1B;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,+BAA+B;AACjC;AACA;EACE,cAAc;AAChB;AACA;EACE,6BAA6B;EAC7B,eAAe;EACf,iBAAiB;EACjB,YAAY;EACZ,kBAAkB;EAClB,8BAA8B;AAChC;AACA;EACE,2BAA2B;EAC3B,gBAAgB;EAChB,qBAAqB;EACrB,wBAAwB;EACxB,iBAAiB;EACjB,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;AACA;;EAEE,WAAW;AACb;AACA;;EAEE,OAAO;EACP,WAAW;AACb;AACA;;EAEE,mBAAmB;EACnB,wBAAwB;AAC1B;;AAEA;EACE,iCAAiC;AACnC;;AAEA;EACE,kBAAkB;EAClB,0CAA0C;EAC1C,iBAAiB;AACnB;;AAEA;EACE,iCAAiC;AACnC;AACA;EACE,UAAU;EACV,YAAY;EACZ,YAAY;AACd;AACA;EACE,iBAAiB;EACjB,gBAAgB;AAClB;;AAEA;EACE,mCAAmC;AACrC;AACA;EACE,2BAA2B;AAC7B;AACA;EACE,gBAAgB;AAClB;AACA;EACE,uBAAuB;EACvB,UAAU;EACV,YAAY;EACZ,cAAc;AAChB;AACA;EACE,mCAAmC;EACnC,2BAA2B;EAC3B,iCAAiC;EACjC,iBAAiB;AACnB;AACA;EACE,eAAe;AACjB;AACA;EACE,oCAAoC;AACtC;AACA;EACE,YAAY;AACd;AACA;EACE,mBAAmB;EACnB,iDAAiD;EACjD,iBAAiB;EACjB,YAAY;EACZ,eAAe;AACjB;AACA;EACE,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,wBAAwB;AAC1B;AACA;EACE,aAAa;AACf;AACA;EACE,0CAA0C;AAC5C;AACA;EACE,aAAa;AACf;AACA;EACE,mBAAmB;AACrB;;AAEA;EACE,0CAA0C;AAC5C;;AAEA;EACE,aAAa;EACb,iBAAiB;EACjB,QAAQ;AACV;AACA;EACE,aAAa;AACf;AACA;EACE,6BAA6B;EAC7B,eAAe;EACf,iBAAiB;EACjB,YAAY;EACZ,kBAAkB;AACpB;AACA;EACE,OAAO;AACT;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,2BAA2B;AAC7B;AACA;EACE,aAAa;AACf;AACA;EACE,+CAA+C;AACjD;AACA;EACE,6CAA6C;AAC/C;AACA;EACE,aAAa;EACb,uBAAuB;AACzB;;AAEA;EACE,wCAAwC;AAC1C;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;AACpC;AACA;EACE,2BAA2B;EAC3B,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,wBAAwB;EACxB,iBAAiB;EACjB,iBAAiB;AACnB;AACA;EACE,iBAAiB;AACnB;;AAEA;EACE,iBAAiB;EACjB,iBAAiB;AACnB","file":"index.css","sourcesContent":[".form-outer :global .react-form__field {\n color: var(--font-color);\n}\n.form-outer :global .react-form__field input {\n color: var(--font-color);\n}\n.form-outer :global .react-form__field input::placeholder {\n color: var(--font-color-grey-2);\n}\n.form-outer :global .react-form__field-label.is-req {\n margin-left: 0;\n}\n.form-outer :global .react-form__field-label {\n color: var(--font-color-grey);\n font-size: 14px;\n line-height: 20px;\n height: 20px;\n margin-bottom: 8px;\n font-weight: normal !important;\n}\n.form-outer :global .react-form__field-label.is-req:before {\n color: var(--color-warning);\n position: static;\n display: inline-block;\n transform: translateX(0);\n margin-right: 6px;\n font-weight: bold;\n}\n.form-outer :global .react-form__field-error {\n line-height: 14px;\n}\n.form-outer :global .ant-input-number,\n.form-outer :global .ant-input-number-group-wrapper {\n width: 100%;\n}\n.form-outer :global .ant-picker.react-form__field-component,\n.form-outer :global .data_range_picker {\n flex: 1;\n width: 100%;\n}\n.form-outer :global .ant-input-number-group-addon,\n.form-outer :global .ant-input-group-addon {\n background: #ffffff;\n color: var(--font-color);\n}\n\n.form-info > :global(.ant-card-head .part-title) {\n font-size: var(--font-size-large);\n}\n\n.extra-btn:global(.ant-btn) {\n border-radius: 2px;\n border: 1px solid var(--font-color-grey-2);\n padding: 6px 12px;\n}\n\n.list-part > :global(.ant-card-head .part-title) {\n font-size: var(--font-size-large);\n}\n.list-part .list-part .extra-btn {\n padding: 0;\n border: none;\n min-width: 0;\n}\n.list-part:global.ant-card .ant-card-body {\n padding: 16px 0 0;\n border-radius: 0;\n}\n\n.list-item.is-important > .list-item-part:global(.ant-card > .ant-card-head) {\n background: var(--primary-color-06);\n}\n.list-item.is-important > .list-item-part:global(.ant-card > .ant-card-head .ant-card-head-title .part-title) {\n color: var(--primary-color);\n}\n.list-item.is-important .list-item-part:global(.ant-card .ant-card-head-title .part-title) {\n font-weight: 500;\n}\n.list-item.is-important > .list-item-part:global(.ant-card) .list-part:global(.ant-card > .ant-card-head) {\n background: transparent;\n padding: 0;\n border: none;\n line-height: 1;\n}\n.list-item.is-important > .list-item-part:global(.ant-card) .list-part:global(.ant-card > .ant-card-head) :global(.part-title) {\n background: var(--primary-color-06);\n color: var(--primary-color);\n font-size: var(--font-size-small);\n font-weight: bold;\n}\n.list-item.is-important > .list-item-part:global(.ant-card) .list-part:global(.ant-card > .ant-card-body) {\n padding: 16px 0;\n}\n.list-item.is-important > .list-item-part {\n border-color: var(--primary-color-5);\n}\n.list-item.is-important .table-list-inner {\n border: none;\n}\n.list-item .list-item-part:global.ant-card .ant-card-head {\n background: #f8f8f8;\n border-bottom: 1px solid var(--font-color-grey-4);\n line-height: 36px;\n height: 36px;\n padding: 0 16px;\n}\n.list-item .list-item-part:global.ant-card .ant-card-head-title .part-title {\n background: transparent;\n font-weight: normal;\n font-size: 14px;\n color: var(--font-color);\n}\n.list-item .list-item-part:global.ant-card .ant-card-body {\n padding: 16px;\n}\n.list-item :global(.ant-divider) {\n border-top-color: var(--font-color-grey-2);\n}\n.list-item :global(.ant-divider) {\n display: none;\n}\n.list-item:not(:last-child) {\n margin-bottom: 16px;\n}\n\n.list-item-part {\n border: 1px solid var(--font-color-grey-4);\n}\n\n.multi-field-item {\n display: flex;\n flex-wrap: nowrap;\n gap: 8px;\n}\n.multi-field-item:not(.first-item) :global .react-form__field-label {\n display: none;\n}\n.multi-field-item .react-form__field-label {\n color: var(--font-color-grey);\n font-size: 14px;\n line-height: 20px;\n height: 20px;\n margin-bottom: 8px;\n}\n.multi-field-item :global .react-form__field {\n flex: 1;\n}\n\n.multi-field-add-btn {\n margin-bottom: 16px;\n}\n\n.table-list .list-item {\n margin-bottom: 0 !important;\n}\n.table-list :global .react-form__field-label {\n display: none;\n}\n.table-list :global .ant-row:not(:last-child) {\n border-bottom: solid 1px var(--bg-color-grey-3);\n}\n.table-list :global .ant-row:hover {\n background: var(--bg-color-grey-1) !important;\n}\n.table-list :global .ant-col {\n padding: 16px;\n width: var(--col-width);\n}\n\n.table-list-inner {\n border: solid 1px var(--bg-color-grey-3);\n}\n\n.table-list-field:global(.ant-col) {\n padding-bottom: 0;\n}\n\n.table-list-header {\n background: var(--bg-color-grey-1);\n}\n.table-list-header .is-req:before {\n color: var(--color-warning);\n content: \"*\";\n position: static;\n display: inline-block;\n transform: translateX(0);\n margin-right: 6px;\n font-weight: bold;\n}\n.table-list-header :global .ant-col {\n padding: 8px 16px;\n}\n\n.table-options {\n flex-basis: 100px;\n text-align: right;\n}"]}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
require('@kne/info-page/dist/index.css');
|
|
2
|
+
require('@kne/react-form-antd/dist/index.css');
|
|
3
|
+
var reactFormAntd = require('@kne/react-form-antd');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var InfoPage = require('@kne/info-page');
|
|
6
|
+
var flexBox = require('@kne/flex-box');
|
|
7
|
+
var reactFormPlus = require('@kne/react-form-plus');
|
|
8
|
+
var antd = require('antd');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
+
var InfoPage__default = /*#__PURE__*/_interopDefaultLegacy(InfoPage);
|
|
14
|
+
|
|
15
|
+
function _extends() {
|
|
16
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
17
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
18
|
+
var t = arguments[e];
|
|
19
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
20
|
+
}
|
|
21
|
+
return n;
|
|
22
|
+
}, _extends.apply(null, arguments);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function createCommonjsModule(fn) {
|
|
26
|
+
var module = { exports: {} };
|
|
27
|
+
return fn(module, module.exports), module.exports;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/*!
|
|
31
|
+
Copyright (c) 2018 Jed Watson.
|
|
32
|
+
Licensed under the MIT License (MIT), see
|
|
33
|
+
http://jedwatson.github.io/classnames
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
var classnames = createCommonjsModule(function (module) {
|
|
37
|
+
/* global define */
|
|
38
|
+
|
|
39
|
+
(function () {
|
|
40
|
+
|
|
41
|
+
var hasOwn = {}.hasOwnProperty;
|
|
42
|
+
|
|
43
|
+
function classNames () {
|
|
44
|
+
var classes = '';
|
|
45
|
+
|
|
46
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
47
|
+
var arg = arguments[i];
|
|
48
|
+
if (arg) {
|
|
49
|
+
classes = appendClass(classes, parseValue(arg));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return classes;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function parseValue (arg) {
|
|
57
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
58
|
+
return arg;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (typeof arg !== 'object') {
|
|
62
|
+
return '';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (Array.isArray(arg)) {
|
|
66
|
+
return classNames.apply(null, arg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
70
|
+
return arg.toString();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var classes = '';
|
|
74
|
+
|
|
75
|
+
for (var key in arg) {
|
|
76
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
77
|
+
classes = appendClass(classes, key);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return classes;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function appendClass (value, newClass) {
|
|
85
|
+
if (!newClass) {
|
|
86
|
+
return value;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (value) {
|
|
90
|
+
return value + ' ' + newClass;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return value + newClass;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (module.exports) {
|
|
97
|
+
classNames.default = classNames;
|
|
98
|
+
module.exports = classNames;
|
|
99
|
+
} else {
|
|
100
|
+
window.classNames = classNames;
|
|
101
|
+
}
|
|
102
|
+
}());
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
var style = {"form-outer":"_ZQNNL","form-info":"_GW4Xx","extra-btn":"_eY4qR","list-part":"_SL3dC","list-item":"_PNnMa","is-important":"_Xkp38","list-item-part":"_HiB5Q","table-list-inner":"_Uw-3T","multi-field-item":"_uogqr","first-item":"_4UoWy","react-form__field-label":"_UGjS9","multi-field-add-btn":"_rjVPh","table-list":"_r8-bn","table-list-field":"_Qkutm","table-list-header":"_9WdfD","is-req":"_CsPaL","table-options":"_8smwK"};
|
|
106
|
+
|
|
107
|
+
const FormInfo = props => {
|
|
108
|
+
const {
|
|
109
|
+
className,
|
|
110
|
+
column,
|
|
111
|
+
list,
|
|
112
|
+
gap,
|
|
113
|
+
...others
|
|
114
|
+
} = Object.assign({}, {
|
|
115
|
+
column: 2,
|
|
116
|
+
list: []
|
|
117
|
+
}, props);
|
|
118
|
+
const isFlexBox = !(Number.isInteger(column) && column > 0);
|
|
119
|
+
const {
|
|
120
|
+
ref: flexBoxRef,
|
|
121
|
+
column: flexBoxColumn
|
|
122
|
+
} = flexBox.useFlexBox(isFlexBox ? column : {});
|
|
123
|
+
const renderInner = (column, notLayout) => {
|
|
124
|
+
return /*#__PURE__*/React__default["default"].createElement(reactFormPlus.FormInfo, {
|
|
125
|
+
list: list,
|
|
126
|
+
column: column,
|
|
127
|
+
className: classnames({
|
|
128
|
+
[style["column-not-layout"]]: notLayout
|
|
129
|
+
}),
|
|
130
|
+
itemRender: (children, props) => {
|
|
131
|
+
if (props.hidden) {
|
|
132
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
133
|
+
style: {
|
|
134
|
+
display: 'none'
|
|
135
|
+
}
|
|
136
|
+
}, children);
|
|
137
|
+
}
|
|
138
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
139
|
+
span: props.span
|
|
140
|
+
}, children);
|
|
141
|
+
}
|
|
142
|
+
}, children => {
|
|
143
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Row, {
|
|
144
|
+
gutter: [gap || 24, 0]
|
|
145
|
+
}, children);
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
const renderColumn = () => {
|
|
149
|
+
if (!isFlexBox) {
|
|
150
|
+
return renderInner(column);
|
|
151
|
+
}
|
|
152
|
+
if (flexBoxColumn) {
|
|
153
|
+
return renderInner(flexBoxColumn.col);
|
|
154
|
+
}
|
|
155
|
+
return renderInner(2, true);
|
|
156
|
+
};
|
|
157
|
+
return /*#__PURE__*/React__default["default"].createElement(InfoPage__default["default"].Part, _extends({}, others, {
|
|
158
|
+
className: classnames(className, style['form-info'])
|
|
159
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
160
|
+
ref: flexBoxRef
|
|
161
|
+
}), renderColumn());
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const List = props => {
|
|
165
|
+
const {
|
|
166
|
+
className,
|
|
167
|
+
removeIcon,
|
|
168
|
+
removeText,
|
|
169
|
+
addText,
|
|
170
|
+
addIcon,
|
|
171
|
+
important,
|
|
172
|
+
...others
|
|
173
|
+
} = Object.assign({}, {
|
|
174
|
+
addText: '添加',
|
|
175
|
+
addIcon: null,
|
|
176
|
+
removeText: '删除',
|
|
177
|
+
removeIcon: null,
|
|
178
|
+
empty: /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
179
|
+
description: false
|
|
180
|
+
})
|
|
181
|
+
}, props);
|
|
182
|
+
return /*#__PURE__*/React__default["default"].createElement(reactFormPlus.SubList, _extends({}, others, {
|
|
183
|
+
className: classnames(className, style["list-part"]),
|
|
184
|
+
listRender: _ref => {
|
|
185
|
+
let {
|
|
186
|
+
id,
|
|
187
|
+
allowRemove,
|
|
188
|
+
onRemove,
|
|
189
|
+
index,
|
|
190
|
+
groupArgs,
|
|
191
|
+
...props
|
|
192
|
+
} = _ref;
|
|
193
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
194
|
+
key: id,
|
|
195
|
+
className: classnames(style["list-item"], {
|
|
196
|
+
[style["is-important"]]: important
|
|
197
|
+
})
|
|
198
|
+
}, /*#__PURE__*/React__default["default"].createElement(FormInfo, _extends({}, props, {
|
|
199
|
+
className: style["list-item-part"],
|
|
200
|
+
gap: 16,
|
|
201
|
+
extra: allowRemove && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
202
|
+
type: "link",
|
|
203
|
+
danger: true,
|
|
204
|
+
className: "btn-no-padding",
|
|
205
|
+
icon: removeIcon,
|
|
206
|
+
onClick: onRemove
|
|
207
|
+
}, removeText)
|
|
208
|
+
})), /*#__PURE__*/React__default["default"].createElement(antd.Divider, null));
|
|
209
|
+
}
|
|
210
|
+
}), (children, _ref2) => {
|
|
211
|
+
let {
|
|
212
|
+
allowAdd,
|
|
213
|
+
onAdd,
|
|
214
|
+
isUnshift,
|
|
215
|
+
...others
|
|
216
|
+
} = _ref2;
|
|
217
|
+
return /*#__PURE__*/React__default["default"].createElement(InfoPage__default["default"].Part, _extends({}, others, {
|
|
218
|
+
extra: allowAdd && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
219
|
+
className: style['extra-btn'],
|
|
220
|
+
icon: addIcon,
|
|
221
|
+
onClick: onAdd
|
|
222
|
+
}, addText)
|
|
223
|
+
}), children);
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
const MultiField = props => {
|
|
228
|
+
const {
|
|
229
|
+
className,
|
|
230
|
+
addText,
|
|
231
|
+
addIcon,
|
|
232
|
+
removeIcon,
|
|
233
|
+
removeText,
|
|
234
|
+
...others
|
|
235
|
+
} = Object.assign({}, {
|
|
236
|
+
addText: '添加',
|
|
237
|
+
addIcon: null,
|
|
238
|
+
removeIcon: null,
|
|
239
|
+
removeText: '删除',
|
|
240
|
+
empty: /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
241
|
+
description: false
|
|
242
|
+
})
|
|
243
|
+
}, props);
|
|
244
|
+
return /*#__PURE__*/React__default["default"].createElement(reactFormPlus.MultiField, _extends({}, others, {
|
|
245
|
+
itemRender: (children, _ref) => {
|
|
246
|
+
let {
|
|
247
|
+
id,
|
|
248
|
+
index,
|
|
249
|
+
allowRemove,
|
|
250
|
+
onRemove
|
|
251
|
+
} = _ref;
|
|
252
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
253
|
+
key: id,
|
|
254
|
+
className: classnames("multi-field-item", style["multi-field-item"], {
|
|
255
|
+
[style["first-item"]]: index === 0
|
|
256
|
+
})
|
|
257
|
+
}, children, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
258
|
+
className: classnames(style["react-form__field-label"], "react-form__field-label", "multi-field-delete-label")
|
|
259
|
+
}), /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
260
|
+
danger: true,
|
|
261
|
+
icon: removeIcon,
|
|
262
|
+
onClick: onRemove,
|
|
263
|
+
disabled: !allowRemove
|
|
264
|
+
}, removeText)));
|
|
265
|
+
}
|
|
266
|
+
}), (children, _ref2) => {
|
|
267
|
+
let {
|
|
268
|
+
allowAdd,
|
|
269
|
+
onAdd
|
|
270
|
+
} = _ref2;
|
|
271
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
272
|
+
className: classnames(className, 'multi-field', style['multi-field'])
|
|
273
|
+
}, children, allowAdd && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
274
|
+
className: classnames("multi-field-add-btn", style["multi-field-add-btn"]),
|
|
275
|
+
type: "dashed",
|
|
276
|
+
onClick: onAdd,
|
|
277
|
+
icon: addIcon
|
|
278
|
+
}, typeof addText === 'function' ? addText(others.label) : `${addText}${others.label}`));
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const TableList = props => {
|
|
283
|
+
const {
|
|
284
|
+
className,
|
|
285
|
+
addIcon,
|
|
286
|
+
addText,
|
|
287
|
+
removeIcon,
|
|
288
|
+
removeText,
|
|
289
|
+
...others
|
|
290
|
+
} = Object.assign({}, {
|
|
291
|
+
empty: /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
292
|
+
description: false
|
|
293
|
+
}),
|
|
294
|
+
addIcon: null,
|
|
295
|
+
addText: '添加',
|
|
296
|
+
removeIcon: null,
|
|
297
|
+
removeText: '删除'
|
|
298
|
+
}, props);
|
|
299
|
+
return /*#__PURE__*/React__default["default"].createElement(reactFormPlus.TableList, _extends({}, others, {
|
|
300
|
+
headerRender: (children, _ref) => {
|
|
301
|
+
let {
|
|
302
|
+
width
|
|
303
|
+
} = _ref;
|
|
304
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Row, {
|
|
305
|
+
className: style['table-list-header'],
|
|
306
|
+
wrap: false,
|
|
307
|
+
style: {
|
|
308
|
+
"--col-width": width
|
|
309
|
+
}
|
|
310
|
+
}, children, /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
311
|
+
className: style['table-options']
|
|
312
|
+
}));
|
|
313
|
+
},
|
|
314
|
+
headerItemRender: (children, _ref2) => {
|
|
315
|
+
let {
|
|
316
|
+
id,
|
|
317
|
+
isReq
|
|
318
|
+
} = _ref2;
|
|
319
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
320
|
+
className: classnames({
|
|
321
|
+
[style["is-req"]]: isReq
|
|
322
|
+
}),
|
|
323
|
+
key: id
|
|
324
|
+
}, children);
|
|
325
|
+
},
|
|
326
|
+
itemRender: children => {
|
|
327
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
328
|
+
className: style['table-list-field'],
|
|
329
|
+
flex: 1
|
|
330
|
+
}, children);
|
|
331
|
+
},
|
|
332
|
+
listRender: (children, _ref3) => {
|
|
333
|
+
let {
|
|
334
|
+
id,
|
|
335
|
+
width,
|
|
336
|
+
onRemove,
|
|
337
|
+
allowRemove
|
|
338
|
+
} = _ref3;
|
|
339
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Row, {
|
|
340
|
+
key: id,
|
|
341
|
+
wrap: false,
|
|
342
|
+
align: "top",
|
|
343
|
+
style: {
|
|
344
|
+
"--col-width": width
|
|
345
|
+
}
|
|
346
|
+
}, children, /*#__PURE__*/React__default["default"].createElement(antd.Col, {
|
|
347
|
+
className: style['table-options']
|
|
348
|
+
}, /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
349
|
+
type: "link",
|
|
350
|
+
onClick: onRemove,
|
|
351
|
+
danger: true,
|
|
352
|
+
disabled: !allowRemove,
|
|
353
|
+
icon: removeIcon
|
|
354
|
+
}, removeText)));
|
|
355
|
+
}
|
|
356
|
+
}), (children, _ref4) => {
|
|
357
|
+
let {
|
|
358
|
+
onAdd,
|
|
359
|
+
allowAdd,
|
|
360
|
+
...others
|
|
361
|
+
} = _ref4;
|
|
362
|
+
return /*#__PURE__*/React__default["default"].createElement(InfoPage__default["default"].Part, _extends({}, props, {
|
|
363
|
+
className: classnames(className, style["table-list"]),
|
|
364
|
+
extra: allowAdd && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
365
|
+
className: style['extra-btn'],
|
|
366
|
+
icon: addIcon,
|
|
367
|
+
onClick: onAdd
|
|
368
|
+
}, addText)
|
|
369
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
370
|
+
className: style['table-list-inner']
|
|
371
|
+
}, children));
|
|
372
|
+
});
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
const Form = React.forwardRef((props, ref) => {
|
|
376
|
+
const {
|
|
377
|
+
className,
|
|
378
|
+
children,
|
|
379
|
+
...others
|
|
380
|
+
} = Object.assign({}, {
|
|
381
|
+
type: 'inner'
|
|
382
|
+
}, props);
|
|
383
|
+
return /*#__PURE__*/React__default["default"].createElement(reactFormAntd.FormAntd, _extends({}, others, {
|
|
384
|
+
ref: ref,
|
|
385
|
+
className: classnames(className, style["form-outer"])
|
|
386
|
+
}), /*#__PURE__*/React__default["default"].createElement(InfoPage__default["default"], null, children));
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
exports.Form = Form;
|
|
390
|
+
exports.List = List;
|
|
391
|
+
exports.MultiField = MultiField;
|
|
392
|
+
exports.SubList = List;
|
|
393
|
+
exports.TableList = TableList;
|
|
394
|
+
exports["default"] = FormInfo;
|
|
395
|
+
Object.keys(reactFormAntd).forEach(function (k) {
|
|
396
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function () { return reactFormAntd[k]; }
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/classnames/index.js","../src/FormInfo.js","../src/List.js","../src/MultiField.js","../src/TableList.js","../src/Form.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from 'react';\nimport InfoPage from '@kne/info-page';\nimport {useFlexBox} from '@kne/flex-box';\nimport {FormInfo as FormInfoBase} from '@kne/react-form-plus';\nimport {Row, Col} from 'antd';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst FormInfo = (props) => {\n const {className, column, list, gap, ...others} = Object.assign({}, {column: 2, list: []}, props);\n const isFlexBox = !(Number.isInteger(column) && column > 0);\n const {ref: flexBoxRef, column: flexBoxColumn} = useFlexBox(isFlexBox ? column : {});\n const renderInner = (column, notLayout) => {\n return <FormInfoBase list={list} column={column} className={classnames({\n [style[\"column-not-layout\"]]: notLayout\n })} itemRender={(children, props) => {\n if (props.hidden) {\n return <div style={{display: 'none'}}>{children}</div>\n }\n return <Col span={props.span}>{children}</Col>;\n }}>{(children) => {\n return <Row gutter={[gap || 24, 0]}>\n {children}\n </Row>\n }}</FormInfoBase>\n };\n\n const renderColumn = () => {\n if (!isFlexBox) {\n return renderInner(column);\n }\n if (flexBoxColumn) {\n return renderInner(flexBoxColumn.col);\n }\n\n return renderInner(2, true);\n };\n\n return <InfoPage.Part {...others} className={classnames(className, style['form-info'])}>\n <div ref={flexBoxRef}/>\n {renderColumn()}\n </InfoPage.Part>\n};\n\nexport default FormInfo;\n","import React from 'react';\nimport {Button, Divider, Empty} from 'antd';\nimport FormInfo from './FormInfo';\nimport InfoPage from \"@kne/info-page\";\nimport {SubList} from '@kne/react-form-plus';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst List = (props) => {\n const {className, removeIcon, removeText, addText, addIcon, important, ...others} = Object.assign({}, {\n addText: '添加', addIcon: null, removeText: '删除', removeIcon: null, empty: <Empty description={false}/>\n }, props);\n return <SubList {...others} className={classnames(className, style[\"list-part\"])}\n listRender={({id, allowRemove, onRemove, index, groupArgs, ...props}) => {\n return <div key={id} className={classnames(style[\"list-item\"], {\n [style[\"is-important\"]]: important,\n })}>\n <FormInfo {...props} className={style[\"list-item-part\"]} gap={16}\n extra={allowRemove &&\n <Button type=\"link\" danger className=\"btn-no-padding\" icon={removeIcon}\n onClick={onRemove}>{removeText}</Button>}/>\n <Divider/>\n </div>\n }}>{(children, {allowAdd, onAdd, isUnshift, ...others}) => {\n return <InfoPage.Part {...others} extra={allowAdd &&\n <Button className={style['extra-btn']} icon={addIcon} onClick={onAdd}>{addText}</Button>}>\n {children}\n </InfoPage.Part>\n }}</SubList>\n};\n\nexport default List;\n","import React from 'react';\nimport {Button, Empty} from 'antd';\nimport {MultiField as MultiFieldBase} from '@kne/react-form-plus';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst MultiField = (props) => {\n const {className, addText, addIcon, removeIcon, removeText, ...others} = Object.assign({}, {\n addText: '添加', addIcon: null, removeIcon: null, removeText: '删除', empty: <Empty description={false}/>\n }, props);\n return <MultiFieldBase {...others} itemRender={(children, {id, index, allowRemove, onRemove}) => {\n return <div key={id} className={classnames(\"multi-field-item\", style[\"multi-field-item\"], {\n [style[\"first-item\"]]: index === 0,\n })}>\n {children}\n <div>\n <div\n className={classnames(style[\"react-form__field-label\"], \"react-form__field-label\", \"multi-field-delete-label\")}/>\n <Button danger icon={removeIcon} onClick={onRemove} disabled={!allowRemove}>{removeText}</Button>\n </div>\n\n </div>\n }}>{(children, {allowAdd, onAdd}) => <div\n className={classnames(className, 'multi-field', style['multi-field'])}>\n {children}\n {allowAdd && <Button className={classnames(\"multi-field-add-btn\", style[\"multi-field-add-btn\"])} type=\"dashed\"\n onClick={onAdd} icon={addIcon}>\n {typeof addText === 'function' ? addText(others.label) : `${addText}${others.label}`}\n </Button>}\n </div>}</MultiFieldBase>\n};\n\nexport default MultiField;\n","import React from 'react';\nimport InfoPage from '@kne/info-page';\nimport {Empty, Row, Col, Button} from 'antd';\nimport {TableList as TableListBase} from '@kne/react-form-plus';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst TableList = (props) => {\n const {className, addIcon, addText, removeIcon, removeText, ...others} = Object.assign({}, {\n empty: <Empty description={false}/>, addIcon: null, addText: '添加', removeIcon: null, removeText: '删除'\n }, props);\n return <TableListBase {...others} headerRender={(children, {width}) => {\n return <Row className={style['table-list-header']} wrap={false} style={{\n \"--col-width\": width,\n }}>\n {children}\n <Col className={style['table-options']}></Col>\n </Row>\n }} headerItemRender={(children, {id, isReq}) => {\n return <Col className={classnames({\n [style[\"is-req\"]]: isReq\n })} key={id}>{children}</Col>\n }} itemRender={(children) => {\n return <Col className={style['table-list-field']} flex={1}>{children}</Col>;\n }} listRender={(children, {id, width, onRemove, allowRemove}) => {\n return <Row key={id} wrap={false} align=\"top\" style={{\n \"--col-width\": width,\n }}>\n {children}\n <Col className={style['table-options']}>\n <Button type=\"link\" onClick={onRemove} danger disabled={!allowRemove}\n icon={removeIcon}>{removeText}</Button>\n </Col>\n </Row>\n }}>{(children, {onAdd, allowAdd, ...others}) => {\n return <InfoPage.Part {...props} className={classnames(className, style[\"table-list\"])} extra={allowAdd &&\n <Button className={style['extra-btn']} icon={addIcon} onClick={onAdd}>{addText}</Button>}>\n <div className={style['table-list-inner']}>\n {children}\n </div>\n </InfoPage.Part>\n }}</TableListBase>\n};\n\nexport default TableList;\n","import React, {forwardRef, useRef} from 'react';\nimport InfoPage from '@kne/info-page';\nimport {FormAntd as ReactForm} from \"@kne/react-form-antd\";\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst Form = forwardRef((props, ref) => {\n const {className, children, ...others} = Object.assign({}, {type: 'inner'}, props);\n return <ReactForm {...others} ref={ref} className={classnames(className, style[\"form-outer\"])}>\n <InfoPage>{children}</InfoPage>\n </ReactForm>\n});\n\nexport default Form;\n"],"names":["FormInfo","props","className","column","list","gap","others","Object","assign","isFlexBox","Number","isInteger","ref","flexBoxRef","flexBoxColumn","useFlexBox","renderInner","notLayout","React","createElement","FormInfoBase","classnames","style","itemRender","children","hidden","display","Col","span","Row","gutter","renderColumn","col","InfoPage","Part","_extends","List","removeIcon","removeText","addText","addIcon","important","empty","Empty","description","SubList","listRender","_ref","id","allowRemove","onRemove","index","groupArgs","key","extra","Button","type","danger","icon","onClick","Divider","_ref2","allowAdd","onAdd","isUnshift","MultiField","MultiFieldBase","disabled","label","TableList","TableListBase","headerRender","width","wrap","headerItemRender","isReq","flex","_ref3","align","_ref4","Form","forwardRef","ReactForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA,CAAC,YAAY;AAEb;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,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
export * from '@kne/react-form-antd';
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
|
+
import InfoPage from '@kne/info-page';
|
|
7
|
+
import { useFlexBox } from '@kne/flex-box';
|
|
8
|
+
import { FormInfo as FormInfo$1, SubList, MultiField as MultiField$1, TableList as TableList$1 } from '@kne/react-form-plus';
|
|
9
|
+
import { Col, Row, Empty, Button, Divider } from 'antd';
|
|
10
|
+
|
|
11
|
+
function _extends() {
|
|
12
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
13
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
14
|
+
var t = arguments[e];
|
|
15
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
18
|
+
}, _extends.apply(null, arguments);
|
|
19
|
+
}
|
|
20
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
21
|
+
if (null == r) return {};
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
24
|
+
if (e.includes(n)) continue;
|
|
25
|
+
t[n] = r[n];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createCommonjsModule(fn) {
|
|
31
|
+
var module = { exports: {} };
|
|
32
|
+
return fn(module, module.exports), module.exports;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/*!
|
|
36
|
+
Copyright (c) 2018 Jed Watson.
|
|
37
|
+
Licensed under the MIT License (MIT), see
|
|
38
|
+
http://jedwatson.github.io/classnames
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
var classnames = createCommonjsModule(function (module) {
|
|
42
|
+
/* global define */
|
|
43
|
+
|
|
44
|
+
(function () {
|
|
45
|
+
|
|
46
|
+
var hasOwn = {}.hasOwnProperty;
|
|
47
|
+
|
|
48
|
+
function classNames () {
|
|
49
|
+
var classes = '';
|
|
50
|
+
|
|
51
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
52
|
+
var arg = arguments[i];
|
|
53
|
+
if (arg) {
|
|
54
|
+
classes = appendClass(classes, parseValue(arg));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return classes;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function parseValue (arg) {
|
|
62
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
63
|
+
return arg;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (typeof arg !== 'object') {
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (Array.isArray(arg)) {
|
|
71
|
+
return classNames.apply(null, arg);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
75
|
+
return arg.toString();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
var classes = '';
|
|
79
|
+
|
|
80
|
+
for (var key in arg) {
|
|
81
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
82
|
+
classes = appendClass(classes, key);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return classes;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function appendClass (value, newClass) {
|
|
90
|
+
if (!newClass) {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (value) {
|
|
95
|
+
return value + ' ' + newClass;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return value + newClass;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (module.exports) {
|
|
102
|
+
classNames.default = classNames;
|
|
103
|
+
module.exports = classNames;
|
|
104
|
+
} else {
|
|
105
|
+
window.classNames = classNames;
|
|
106
|
+
}
|
|
107
|
+
}());
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
var style = {"form-outer":"_ZQNNL","form-info":"_GW4Xx","extra-btn":"_eY4qR","list-part":"_SL3dC","list-item":"_PNnMa","is-important":"_Xkp38","list-item-part":"_HiB5Q","table-list-inner":"_Uw-3T","multi-field-item":"_uogqr","first-item":"_4UoWy","react-form__field-label":"_UGjS9","multi-field-add-btn":"_rjVPh","table-list":"_r8-bn","table-list-field":"_Qkutm","table-list-header":"_9WdfD","is-req":"_CsPaL","table-options":"_8smwK"};
|
|
111
|
+
|
|
112
|
+
const _excluded$4 = ["className", "column", "list", "gap"];
|
|
113
|
+
const FormInfo = props => {
|
|
114
|
+
const _Object$assign = Object.assign({}, {
|
|
115
|
+
column: 2,
|
|
116
|
+
list: []
|
|
117
|
+
}, props),
|
|
118
|
+
{
|
|
119
|
+
className,
|
|
120
|
+
column,
|
|
121
|
+
list,
|
|
122
|
+
gap
|
|
123
|
+
} = _Object$assign,
|
|
124
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$4);
|
|
125
|
+
const isFlexBox = !(Number.isInteger(column) && column > 0);
|
|
126
|
+
const {
|
|
127
|
+
ref: flexBoxRef,
|
|
128
|
+
column: flexBoxColumn
|
|
129
|
+
} = useFlexBox(isFlexBox ? column : {});
|
|
130
|
+
const renderInner = (column, notLayout) => {
|
|
131
|
+
return /*#__PURE__*/React.createElement(FormInfo$1, {
|
|
132
|
+
list: list,
|
|
133
|
+
column: column,
|
|
134
|
+
className: classnames({
|
|
135
|
+
[style["column-not-layout"]]: notLayout
|
|
136
|
+
}),
|
|
137
|
+
itemRender: (children, props) => {
|
|
138
|
+
if (props.hidden) {
|
|
139
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
style: {
|
|
141
|
+
display: 'none'
|
|
142
|
+
}
|
|
143
|
+
}, children);
|
|
144
|
+
}
|
|
145
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
146
|
+
span: props.span
|
|
147
|
+
}, children);
|
|
148
|
+
}
|
|
149
|
+
}, children => {
|
|
150
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
151
|
+
gutter: [gap || 24, 0]
|
|
152
|
+
}, children);
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const renderColumn = () => {
|
|
156
|
+
if (!isFlexBox) {
|
|
157
|
+
return renderInner(column);
|
|
158
|
+
}
|
|
159
|
+
if (flexBoxColumn) {
|
|
160
|
+
return renderInner(flexBoxColumn.col);
|
|
161
|
+
}
|
|
162
|
+
return renderInner(2, true);
|
|
163
|
+
};
|
|
164
|
+
return /*#__PURE__*/React.createElement(InfoPage.Part, _extends({}, others, {
|
|
165
|
+
className: classnames(className, style['form-info'])
|
|
166
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
ref: flexBoxRef
|
|
168
|
+
}), renderColumn());
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const _excluded$3 = ["className", "removeIcon", "removeText", "addText", "addIcon", "important"],
|
|
172
|
+
_excluded2$1 = ["id", "allowRemove", "onRemove", "index", "groupArgs"],
|
|
173
|
+
_excluded3 = ["allowAdd", "onAdd", "isUnshift"];
|
|
174
|
+
const List = props => {
|
|
175
|
+
const _Object$assign = Object.assign({}, {
|
|
176
|
+
addText: '添加',
|
|
177
|
+
addIcon: null,
|
|
178
|
+
removeText: '删除',
|
|
179
|
+
removeIcon: null,
|
|
180
|
+
empty: /*#__PURE__*/React.createElement(Empty, {
|
|
181
|
+
description: false
|
|
182
|
+
})
|
|
183
|
+
}, props),
|
|
184
|
+
{
|
|
185
|
+
className,
|
|
186
|
+
removeIcon,
|
|
187
|
+
removeText,
|
|
188
|
+
addText,
|
|
189
|
+
addIcon,
|
|
190
|
+
important
|
|
191
|
+
} = _Object$assign,
|
|
192
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$3);
|
|
193
|
+
return /*#__PURE__*/React.createElement(SubList, _extends({}, others, {
|
|
194
|
+
className: classnames(className, style["list-part"]),
|
|
195
|
+
listRender: _ref => {
|
|
196
|
+
let {
|
|
197
|
+
id,
|
|
198
|
+
allowRemove,
|
|
199
|
+
onRemove
|
|
200
|
+
} = _ref,
|
|
201
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded2$1);
|
|
202
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
key: id,
|
|
204
|
+
className: classnames(style["list-item"], {
|
|
205
|
+
[style["is-important"]]: important
|
|
206
|
+
})
|
|
207
|
+
}, /*#__PURE__*/React.createElement(FormInfo, _extends({}, props, {
|
|
208
|
+
className: style["list-item-part"],
|
|
209
|
+
gap: 16,
|
|
210
|
+
extra: allowRemove && /*#__PURE__*/React.createElement(Button, {
|
|
211
|
+
type: "link",
|
|
212
|
+
danger: true,
|
|
213
|
+
className: "btn-no-padding",
|
|
214
|
+
icon: removeIcon,
|
|
215
|
+
onClick: onRemove
|
|
216
|
+
}, removeText)
|
|
217
|
+
})), /*#__PURE__*/React.createElement(Divider, null));
|
|
218
|
+
}
|
|
219
|
+
}), (children, _ref2) => {
|
|
220
|
+
let {
|
|
221
|
+
allowAdd,
|
|
222
|
+
onAdd
|
|
223
|
+
} = _ref2,
|
|
224
|
+
others = _objectWithoutPropertiesLoose(_ref2, _excluded3);
|
|
225
|
+
return /*#__PURE__*/React.createElement(InfoPage.Part, _extends({}, others, {
|
|
226
|
+
extra: allowAdd && /*#__PURE__*/React.createElement(Button, {
|
|
227
|
+
className: style['extra-btn'],
|
|
228
|
+
icon: addIcon,
|
|
229
|
+
onClick: onAdd
|
|
230
|
+
}, addText)
|
|
231
|
+
}), children);
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const _excluded$2 = ["className", "addText", "addIcon", "removeIcon", "removeText"];
|
|
236
|
+
const MultiField = props => {
|
|
237
|
+
const _Object$assign = Object.assign({}, {
|
|
238
|
+
addText: '添加',
|
|
239
|
+
addIcon: null,
|
|
240
|
+
removeIcon: null,
|
|
241
|
+
removeText: '删除',
|
|
242
|
+
empty: /*#__PURE__*/React.createElement(Empty, {
|
|
243
|
+
description: false
|
|
244
|
+
})
|
|
245
|
+
}, props),
|
|
246
|
+
{
|
|
247
|
+
className,
|
|
248
|
+
addText,
|
|
249
|
+
addIcon,
|
|
250
|
+
removeIcon,
|
|
251
|
+
removeText
|
|
252
|
+
} = _Object$assign,
|
|
253
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$2);
|
|
254
|
+
return /*#__PURE__*/React.createElement(MultiField$1, _extends({}, others, {
|
|
255
|
+
itemRender: (children, {
|
|
256
|
+
id,
|
|
257
|
+
index,
|
|
258
|
+
allowRemove,
|
|
259
|
+
onRemove
|
|
260
|
+
}) => {
|
|
261
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
262
|
+
key: id,
|
|
263
|
+
className: classnames("multi-field-item", style["multi-field-item"], {
|
|
264
|
+
[style["first-item"]]: index === 0
|
|
265
|
+
})
|
|
266
|
+
}, children, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
267
|
+
className: classnames(style["react-form__field-label"], "react-form__field-label", "multi-field-delete-label")
|
|
268
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
269
|
+
danger: true,
|
|
270
|
+
icon: removeIcon,
|
|
271
|
+
onClick: onRemove,
|
|
272
|
+
disabled: !allowRemove
|
|
273
|
+
}, removeText)));
|
|
274
|
+
}
|
|
275
|
+
}), (children, {
|
|
276
|
+
allowAdd,
|
|
277
|
+
onAdd
|
|
278
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
279
|
+
className: classnames(className, 'multi-field', style['multi-field'])
|
|
280
|
+
}, children, allowAdd && /*#__PURE__*/React.createElement(Button, {
|
|
281
|
+
className: classnames("multi-field-add-btn", style["multi-field-add-btn"]),
|
|
282
|
+
type: "dashed",
|
|
283
|
+
onClick: onAdd,
|
|
284
|
+
icon: addIcon
|
|
285
|
+
}, typeof addText === 'function' ? addText(others.label) : `${addText}${others.label}`)));
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
const _excluded$1 = ["className", "addIcon", "addText", "removeIcon", "removeText"],
|
|
289
|
+
_excluded2 = ["onAdd", "allowAdd"];
|
|
290
|
+
const TableList = props => {
|
|
291
|
+
const _Object$assign = Object.assign({}, {
|
|
292
|
+
empty: /*#__PURE__*/React.createElement(Empty, {
|
|
293
|
+
description: false
|
|
294
|
+
}),
|
|
295
|
+
addIcon: null,
|
|
296
|
+
addText: '添加',
|
|
297
|
+
removeIcon: null,
|
|
298
|
+
removeText: '删除'
|
|
299
|
+
}, props),
|
|
300
|
+
{
|
|
301
|
+
className,
|
|
302
|
+
addIcon,
|
|
303
|
+
addText,
|
|
304
|
+
removeIcon,
|
|
305
|
+
removeText
|
|
306
|
+
} = _Object$assign,
|
|
307
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded$1);
|
|
308
|
+
return /*#__PURE__*/React.createElement(TableList$1, _extends({}, others, {
|
|
309
|
+
headerRender: (children, {
|
|
310
|
+
width
|
|
311
|
+
}) => {
|
|
312
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
313
|
+
className: style['table-list-header'],
|
|
314
|
+
wrap: false,
|
|
315
|
+
style: {
|
|
316
|
+
"--col-width": width
|
|
317
|
+
}
|
|
318
|
+
}, children, /*#__PURE__*/React.createElement(Col, {
|
|
319
|
+
className: style['table-options']
|
|
320
|
+
}));
|
|
321
|
+
},
|
|
322
|
+
headerItemRender: (children, {
|
|
323
|
+
id,
|
|
324
|
+
isReq
|
|
325
|
+
}) => {
|
|
326
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
327
|
+
className: classnames({
|
|
328
|
+
[style["is-req"]]: isReq
|
|
329
|
+
}),
|
|
330
|
+
key: id
|
|
331
|
+
}, children);
|
|
332
|
+
},
|
|
333
|
+
itemRender: children => {
|
|
334
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
335
|
+
className: style['table-list-field'],
|
|
336
|
+
flex: 1
|
|
337
|
+
}, children);
|
|
338
|
+
},
|
|
339
|
+
listRender: (children, {
|
|
340
|
+
id,
|
|
341
|
+
width,
|
|
342
|
+
onRemove,
|
|
343
|
+
allowRemove
|
|
344
|
+
}) => {
|
|
345
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
346
|
+
key: id,
|
|
347
|
+
wrap: false,
|
|
348
|
+
align: "top",
|
|
349
|
+
style: {
|
|
350
|
+
"--col-width": width
|
|
351
|
+
}
|
|
352
|
+
}, children, /*#__PURE__*/React.createElement(Col, {
|
|
353
|
+
className: style['table-options']
|
|
354
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
355
|
+
type: "link",
|
|
356
|
+
onClick: onRemove,
|
|
357
|
+
danger: true,
|
|
358
|
+
disabled: !allowRemove,
|
|
359
|
+
icon: removeIcon
|
|
360
|
+
}, removeText)));
|
|
361
|
+
}
|
|
362
|
+
}), (children, _ref) => {
|
|
363
|
+
let {
|
|
364
|
+
onAdd,
|
|
365
|
+
allowAdd
|
|
366
|
+
} = _ref;
|
|
367
|
+
_objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
368
|
+
return /*#__PURE__*/React.createElement(InfoPage.Part, _extends({}, props, {
|
|
369
|
+
className: classnames(className, style["table-list"]),
|
|
370
|
+
extra: allowAdd && /*#__PURE__*/React.createElement(Button, {
|
|
371
|
+
className: style['extra-btn'],
|
|
372
|
+
icon: addIcon,
|
|
373
|
+
onClick: onAdd
|
|
374
|
+
}, addText)
|
|
375
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
376
|
+
className: style['table-list-inner']
|
|
377
|
+
}, children));
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
const _excluded = ["className", "children"];
|
|
382
|
+
const Form = forwardRef((props, ref) => {
|
|
383
|
+
const _Object$assign = Object.assign({}, {
|
|
384
|
+
type: 'inner'
|
|
385
|
+
}, props),
|
|
386
|
+
{
|
|
387
|
+
className,
|
|
388
|
+
children
|
|
389
|
+
} = _Object$assign,
|
|
390
|
+
others = _objectWithoutPropertiesLoose(_Object$assign, _excluded);
|
|
391
|
+
return /*#__PURE__*/React.createElement(FormAntd, _extends({}, others, {
|
|
392
|
+
ref: ref,
|
|
393
|
+
className: classnames(className, style["form-outer"])
|
|
394
|
+
}), /*#__PURE__*/React.createElement(InfoPage, null, children));
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
export { Form, List, MultiField, List as SubList, TableList, FormInfo as default };
|
|
398
|
+
//# sourceMappingURL=index.modern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.modern.js","sources":["../node_modules/classnames/index.js","../src/FormInfo.js","../src/List.js","../src/MultiField.js","../src/TableList.js","../src/Form.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React from 'react';\nimport InfoPage from '@kne/info-page';\nimport {useFlexBox} from '@kne/flex-box';\nimport {FormInfo as FormInfoBase} from '@kne/react-form-plus';\nimport {Row, Col} from 'antd';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst FormInfo = (props) => {\n const {className, column, list, gap, ...others} = Object.assign({}, {column: 2, list: []}, props);\n const isFlexBox = !(Number.isInteger(column) && column > 0);\n const {ref: flexBoxRef, column: flexBoxColumn} = useFlexBox(isFlexBox ? column : {});\n const renderInner = (column, notLayout) => {\n return <FormInfoBase list={list} column={column} className={classnames({\n [style[\"column-not-layout\"]]: notLayout\n })} itemRender={(children, props) => {\n if (props.hidden) {\n return <div style={{display: 'none'}}>{children}</div>\n }\n return <Col span={props.span}>{children}</Col>;\n }}>{(children) => {\n return <Row gutter={[gap || 24, 0]}>\n {children}\n </Row>\n }}</FormInfoBase>\n };\n\n const renderColumn = () => {\n if (!isFlexBox) {\n return renderInner(column);\n }\n if (flexBoxColumn) {\n return renderInner(flexBoxColumn.col);\n }\n\n return renderInner(2, true);\n };\n\n return <InfoPage.Part {...others} className={classnames(className, style['form-info'])}>\n <div ref={flexBoxRef}/>\n {renderColumn()}\n </InfoPage.Part>\n};\n\nexport default FormInfo;\n","import React from 'react';\nimport {Button, Divider, Empty} from 'antd';\nimport FormInfo from './FormInfo';\nimport InfoPage from \"@kne/info-page\";\nimport {SubList} from '@kne/react-form-plus';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst List = (props) => {\n const {className, removeIcon, removeText, addText, addIcon, important, ...others} = Object.assign({}, {\n addText: '添加', addIcon: null, removeText: '删除', removeIcon: null, empty: <Empty description={false}/>\n }, props);\n return <SubList {...others} className={classnames(className, style[\"list-part\"])}\n listRender={({id, allowRemove, onRemove, index, groupArgs, ...props}) => {\n return <div key={id} className={classnames(style[\"list-item\"], {\n [style[\"is-important\"]]: important,\n })}>\n <FormInfo {...props} className={style[\"list-item-part\"]} gap={16}\n extra={allowRemove &&\n <Button type=\"link\" danger className=\"btn-no-padding\" icon={removeIcon}\n onClick={onRemove}>{removeText}</Button>}/>\n <Divider/>\n </div>\n }}>{(children, {allowAdd, onAdd, isUnshift, ...others}) => {\n return <InfoPage.Part {...others} extra={allowAdd &&\n <Button className={style['extra-btn']} icon={addIcon} onClick={onAdd}>{addText}</Button>}>\n {children}\n </InfoPage.Part>\n }}</SubList>\n};\n\nexport default List;\n","import React from 'react';\nimport {Button, Empty} from 'antd';\nimport {MultiField as MultiFieldBase} from '@kne/react-form-plus';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst MultiField = (props) => {\n const {className, addText, addIcon, removeIcon, removeText, ...others} = Object.assign({}, {\n addText: '添加', addIcon: null, removeIcon: null, removeText: '删除', empty: <Empty description={false}/>\n }, props);\n return <MultiFieldBase {...others} itemRender={(children, {id, index, allowRemove, onRemove}) => {\n return <div key={id} className={classnames(\"multi-field-item\", style[\"multi-field-item\"], {\n [style[\"first-item\"]]: index === 0,\n })}>\n {children}\n <div>\n <div\n className={classnames(style[\"react-form__field-label\"], \"react-form__field-label\", \"multi-field-delete-label\")}/>\n <Button danger icon={removeIcon} onClick={onRemove} disabled={!allowRemove}>{removeText}</Button>\n </div>\n\n </div>\n }}>{(children, {allowAdd, onAdd}) => <div\n className={classnames(className, 'multi-field', style['multi-field'])}>\n {children}\n {allowAdd && <Button className={classnames(\"multi-field-add-btn\", style[\"multi-field-add-btn\"])} type=\"dashed\"\n onClick={onAdd} icon={addIcon}>\n {typeof addText === 'function' ? addText(others.label) : `${addText}${others.label}`}\n </Button>}\n </div>}</MultiFieldBase>\n};\n\nexport default MultiField;\n","import React from 'react';\nimport InfoPage from '@kne/info-page';\nimport {Empty, Row, Col, Button} from 'antd';\nimport {TableList as TableListBase} from '@kne/react-form-plus';\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst TableList = (props) => {\n const {className, addIcon, addText, removeIcon, removeText, ...others} = Object.assign({}, {\n empty: <Empty description={false}/>, addIcon: null, addText: '添加', removeIcon: null, removeText: '删除'\n }, props);\n return <TableListBase {...others} headerRender={(children, {width}) => {\n return <Row className={style['table-list-header']} wrap={false} style={{\n \"--col-width\": width,\n }}>\n {children}\n <Col className={style['table-options']}></Col>\n </Row>\n }} headerItemRender={(children, {id, isReq}) => {\n return <Col className={classnames({\n [style[\"is-req\"]]: isReq\n })} key={id}>{children}</Col>\n }} itemRender={(children) => {\n return <Col className={style['table-list-field']} flex={1}>{children}</Col>;\n }} listRender={(children, {id, width, onRemove, allowRemove}) => {\n return <Row key={id} wrap={false} align=\"top\" style={{\n \"--col-width\": width,\n }}>\n {children}\n <Col className={style['table-options']}>\n <Button type=\"link\" onClick={onRemove} danger disabled={!allowRemove}\n icon={removeIcon}>{removeText}</Button>\n </Col>\n </Row>\n }}>{(children, {onAdd, allowAdd, ...others}) => {\n return <InfoPage.Part {...props} className={classnames(className, style[\"table-list\"])} extra={allowAdd &&\n <Button className={style['extra-btn']} icon={addIcon} onClick={onAdd}>{addText}</Button>}>\n <div className={style['table-list-inner']}>\n {children}\n </div>\n </InfoPage.Part>\n }}</TableListBase>\n};\n\nexport default TableList;\n","import React, {forwardRef, useRef} from 'react';\nimport InfoPage from '@kne/info-page';\nimport {FormAntd as ReactForm} from \"@kne/react-form-antd\";\nimport classnames from 'classnames';\nimport style from './style.module.scss';\n\nconst Form = forwardRef((props, ref) => {\n const {className, children, ...others} = Object.assign({}, {type: 'inner'}, props);\n return <ReactForm {...others} ref={ref} className={classnames(className, style[\"form-outer\"])}>\n <InfoPage>{children}</InfoPage>\n </ReactForm>\n});\n\nexport default Form;\n"],"names":["FormInfo","props","_Object$assign","Object","assign","column","list","className","gap","others","_objectWithoutPropertiesLoose","_excluded","isFlexBox","Number","isInteger","ref","flexBoxRef","flexBoxColumn","useFlexBox","renderInner","notLayout","React","createElement","FormInfoBase","classnames","style","itemRender","children","hidden","display","Col","span","Row","gutter","renderColumn","col","InfoPage","Part","_extends","List","addText","addIcon","removeText","removeIcon","empty","Empty","description","important","SubList","listRender","_ref","id","allowRemove","onRemove","_excluded2","key","extra","Button","type","danger","icon","onClick","Divider","_ref2","allowAdd","onAdd","_excluded3","MultiField","MultiFieldBase","index","disabled","label","TableList","TableListBase","headerRender","width","wrap","headerItemRender","isReq","flex","align","Form","forwardRef","ReactForm"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA,CAAC,YAAY;AAEb;AACA,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC;AAChC;AACA,CAAC,SAAS,UAAU,IAAI;AACxB,EAAE,IAAI,OAAO,GAAG,EAAE,CAAC;AACnB;AACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC7C,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1B,GAAG,IAAI,GAAG,EAAE;AACZ,IAAI,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,IAAI;AACJ,GAAG;AACH;AACA,EAAE,OAAO,OAAO,CAAC;AACjB,EAAE;AACF;AACA,CAAC,SAAS,UAAU,EAAE,GAAG,EAAE;AAC3B,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC1D,GAAG,OAAO,GAAG,CAAC;AACd,GAAG;AACH;AACA,EAAE,IAAI,OAAO,GAAG,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OAAgB,CAAA;KACvFnB,CAAAA,eAAAA,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;MAAKf,SAAS,EAAEkB,KAAK,CAAC,kBAAkB,CAAA;KACnCE,EAAAA,QACA,CACM,CAAC,CAAA;AACpB,GAAiB,CAAC,CAAA;AACtB;;;ACpCMsD,MAAAA,IAAI,GAAGC,UAAU,CAAC,CAACjF,KAAK,EAAEc,GAAG,KAAK;EACpC,MAAAb,cAAA,GAAyCC,MAAM,CAACC,MAAM,CAAC,EAAE,EAAE;AAACsD,MAAAA,IAAI,EAAE,OAAA;KAAQ,EAAEzD,KAAK,CAAC;AAA5E,IAAA;MAACM,SAAS;AAAEoB,MAAAA,QAAAA;AAAmB,KAAC,GAAAzB,cAAA;AAAPO,IAAAA,MAAM,GAAAC,6BAAA,CAAAR,cAAA,EAAAS,SAAA,CAAA,CAAA;EACrC,oBAAOU,KAAA,CAAAC,aAAA,CAAC6D,QAAS,EAAA7C,QAAA,KAAK7B,MAAM,EAAA;AAAEM,IAAAA,GAAG,EAAEA,GAAI;IAACR,SAAS,EAAEiB,UAAU,CAACjB,SAAS,EAAEkB,KAAK,CAAC,YAAY,CAAC,CAAA;GACxFJ,CAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACc,QAAQ,EAAET,IAAAA,EAAAA,QAAmB,CACvB,CAAC,CAAA;AAChB,CAAC;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kne/form-info",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "构建一个更加美观的form表单组件",
|
|
5
|
+
"syntax": {
|
|
6
|
+
"esmodules": true
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.modern.js",
|
|
10
|
+
"source": "src/index.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"init": "husky && npm run init-example",
|
|
13
|
+
"start": "run-p start:lib start:md start:example",
|
|
14
|
+
"build": "run-s build:lib build:md build:example",
|
|
15
|
+
"init-example": "modules-dev-libs-init",
|
|
16
|
+
"build:md": "npx @kne/md-doc",
|
|
17
|
+
"start:md": "npx @kne/md-doc --watch",
|
|
18
|
+
"build:lib": "microbundle --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment",
|
|
19
|
+
"start:lib": "microbundle watch --no-compress --format modern,cjs --jsx React.createElement --jsxFragment React.Fragment",
|
|
20
|
+
"build:example": "cd example && npm run build",
|
|
21
|
+
"start:example": "cd example && npm run start",
|
|
22
|
+
"test:build": "run-s build",
|
|
23
|
+
"test:lint": "eslint .",
|
|
24
|
+
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
25
|
+
"test:watch": "react-scripts test --env=jsdom",
|
|
26
|
+
"prettier": "prettier --config .prettierrc --write '{src/**/*,index,prompts}.{js,jsx,ts,tsx,json,css,scss}'",
|
|
27
|
+
"lint-staged": "npx lint-staged"
|
|
28
|
+
},
|
|
29
|
+
"husky": {
|
|
30
|
+
"hooks": {
|
|
31
|
+
"pre-commit": "lint-staged"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"lint-staged": {
|
|
35
|
+
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
|
|
36
|
+
"prettier --config .prettierrc --write",
|
|
37
|
+
"git add"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/kne-union/form-info.git"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [],
|
|
48
|
+
"author": "linzp",
|
|
49
|
+
"license": "ISC",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/kne-union/form-info/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://www.kne-union.top/#/libs/FormInfo",
|
|
54
|
+
"eslintConfig": {
|
|
55
|
+
"extends": [
|
|
56
|
+
"react-app",
|
|
57
|
+
"react-app/jest"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"browserslist": {
|
|
61
|
+
"production": [
|
|
62
|
+
">0.2%",
|
|
63
|
+
"not dead",
|
|
64
|
+
"not op_mini all"
|
|
65
|
+
],
|
|
66
|
+
"development": [
|
|
67
|
+
"last 1 chrome version",
|
|
68
|
+
"last 1 firefox version",
|
|
69
|
+
"last 1 safari version"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"react": "*",
|
|
74
|
+
"react-dom": "*"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@kne/microbundle": "^0.15.5",
|
|
78
|
+
"@kne/modules-dev": "^2.0.14",
|
|
79
|
+
"cross-env": "^7.0.3",
|
|
80
|
+
"husky": "^9.0.11",
|
|
81
|
+
"npm-run-all": "^4.1.5",
|
|
82
|
+
"prettier": "^3.2.5",
|
|
83
|
+
"react": "^18.2.0",
|
|
84
|
+
"react-dom": "^18.2.0"
|
|
85
|
+
},
|
|
86
|
+
"dependencies": {
|
|
87
|
+
"@kne/flex-box": "^0.1.1",
|
|
88
|
+
"@kne/info-page": "^0.1.0-alpha.0",
|
|
89
|
+
"@kne/react-form-antd": "^3.1.6",
|
|
90
|
+
"@kne/react-form-plus": "^0.1.0-alpha.1"
|
|
91
|
+
}
|
|
92
|
+
}
|