@innoways/drip-form-theme-antd 6.3.0 → 6.3.2
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/CHANGELOG.md +18 -0
- package/dist/index.js +459 -14
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feature: Added new field component place auto complete, version 6.3.2
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @innoways/hooks@6.3.2
|
|
10
|
+
- @innoways/utils@6.3.2
|
|
11
|
+
|
|
12
|
+
## 6.3.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Added hideOnViewMode feature version 6.3.1.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @innoways/hooks@6.3.1
|
|
19
|
+
- @innoways/utils@6.3.1
|
|
20
|
+
|
|
3
21
|
## 6.3.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,29 @@
|
|
|
1
1
|
import _extends from '@babel/runtime/helpers/extends';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
5
4
|
import 'antd/es/input/style';
|
|
6
5
|
import _Input from 'antd/es/input';
|
|
7
|
-
import React, {
|
|
6
|
+
import React, { useState, memo, useEffect, useMemo, useCallback } from 'react';
|
|
8
7
|
import { useField, useCountryStateCityOptions, usePrevious, useQuery, useEventCallback } from '@innoways/hooks';
|
|
8
|
+
import 'antd/es/modal/style';
|
|
9
|
+
import _Modal from 'antd/es/modal';
|
|
10
|
+
import 'antd/es/table/style';
|
|
11
|
+
import _Table from 'antd/es/table';
|
|
12
|
+
import 'antd/es/row/style';
|
|
13
|
+
import _Row from 'antd/es/row';
|
|
14
|
+
import 'antd/es/button/style';
|
|
15
|
+
import _Button from 'antd/es/button';
|
|
16
|
+
import 'antd/es/col/style';
|
|
17
|
+
import _Col from 'antd/es/col';
|
|
18
|
+
import 'antd/es/select/style';
|
|
19
|
+
import _Select from 'antd/es/select';
|
|
20
|
+
import 'antd/es/message/style';
|
|
21
|
+
import _message from 'antd/es/message';
|
|
22
|
+
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
23
|
+
import 'antd/es/form/style';
|
|
24
|
+
import _Form from 'antd/es/form';
|
|
25
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
26
|
+
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
9
27
|
import 'antd/es/radio/style';
|
|
10
28
|
import _Radio from 'antd/es/radio';
|
|
11
29
|
import reactIs from 'react-is';
|
|
@@ -16,8 +34,6 @@ import { typeCheck, isEmpty, binaryData2Blob, checkImg, isValidHttpUrl, fetchFnJ
|
|
|
16
34
|
import { Collapse, Button, Popconfirm } from 'antd';
|
|
17
35
|
import 'antd/es/input-number/style';
|
|
18
36
|
import _InputNumber from 'antd/es/input-number';
|
|
19
|
-
import 'antd/es/select/style';
|
|
20
|
-
import _Select from 'antd/es/select';
|
|
21
37
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
22
38
|
import * as Icon from 'react-feather';
|
|
23
39
|
import { Edit, Delete, Search } from 'react-feather';
|
|
@@ -34,27 +50,454 @@ import 'antd/es/date-picker/style';
|
|
|
34
50
|
import _DatePicker from 'antd/es/date-picker';
|
|
35
51
|
import Flatpickr from 'react-flatpickr';
|
|
36
52
|
import 'flatpickr/dist/flatpickr.min.css';
|
|
37
|
-
import 'antd/es/button/style';
|
|
38
|
-
import _Button from 'antd/es/button';
|
|
39
53
|
import { SketchPicker } from 'react-color';
|
|
40
54
|
import 'antd/es/checkbox/style';
|
|
41
55
|
import _Checkbox from 'antd/es/checkbox';
|
|
42
|
-
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
43
56
|
import 'antd/es/upload/style';
|
|
44
57
|
import _Upload from 'antd/es/upload';
|
|
45
|
-
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
46
58
|
import { useImmer } from 'use-immer';
|
|
47
59
|
import 'antd/es/cascader/style';
|
|
48
60
|
import _Cascader from 'antd/es/cascader';
|
|
49
61
|
import 'antd/es/transfer/style';
|
|
50
62
|
import _Transfer from 'antd/es/transfer';
|
|
51
|
-
import 'antd/es/table/style';
|
|
52
|
-
import _Table from 'antd/es/table';
|
|
53
|
-
import 'antd/es/modal/style';
|
|
54
|
-
import _Modal from 'antd/es/modal';
|
|
55
63
|
import 'antd/es/tree-select/style';
|
|
56
64
|
import _TreeSelect from 'antd/es/tree-select';
|
|
57
65
|
|
|
66
|
+
function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
67
|
+
|
|
68
|
+
function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
69
|
+
|
|
70
|
+
function GpsModal(_ref) {
|
|
71
|
+
var isOpen = _ref.isOpen,
|
|
72
|
+
setIsOpen = _ref.setIsOpen;
|
|
73
|
+
|
|
74
|
+
var _useState = useState({
|
|
75
|
+
type: '',
|
|
76
|
+
address: '',
|
|
77
|
+
latitude: '',
|
|
78
|
+
longitude: ''
|
|
79
|
+
}),
|
|
80
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
81
|
+
gpsData = _useState2[0],
|
|
82
|
+
setGpsData = _useState2[1];
|
|
83
|
+
|
|
84
|
+
var _useState3 = useState([]),
|
|
85
|
+
_useState4 = _slicedToArray(_useState3, 2);
|
|
86
|
+
_useState4[0];
|
|
87
|
+
_useState4[1];
|
|
88
|
+
|
|
89
|
+
var _Form$useForm = _Form.useForm(),
|
|
90
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
91
|
+
form = _Form$useForm2[0];
|
|
92
|
+
|
|
93
|
+
var handleGpsDataChange = function handleGpsDataChange(value, name) {
|
|
94
|
+
setGpsData(_objectSpread$f(_objectSpread$f({}, gpsData), {}, _defineProperty({}, name, value)));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
var handleValidate = function handleValidate() {
|
|
98
|
+
form.validateFields(['type', 'address']);
|
|
99
|
+
var type = gpsData.type,
|
|
100
|
+
address = gpsData.address;
|
|
101
|
+
var flag = true;
|
|
102
|
+
|
|
103
|
+
if (!type) {
|
|
104
|
+
flag = false;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!address) {
|
|
108
|
+
flag = false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return flag;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var handleLatValidate = function handleLatValidate() {
|
|
115
|
+
form.validateFields(['type', 'latitude', 'longitude']);
|
|
116
|
+
var type = gpsData.type,
|
|
117
|
+
latitude = gpsData.latitude,
|
|
118
|
+
longitude = gpsData.longitude;
|
|
119
|
+
var flag = true;
|
|
120
|
+
|
|
121
|
+
if (!type) {
|
|
122
|
+
flag = false;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!latitude) {
|
|
126
|
+
flag = false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (!longitude) {
|
|
130
|
+
flag = false;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return flag;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var handleAddressSearch = /*#__PURE__*/function () {
|
|
137
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
138
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
139
|
+
while (1) {
|
|
140
|
+
switch (_context.prev = _context.next) {
|
|
141
|
+
case 0:
|
|
142
|
+
if (!handleValidate()) {
|
|
143
|
+
_context.next = 3;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
_context.next = 3;
|
|
148
|
+
return fetch("https://api.a4appz.com/apim/getlocation?type=".concat(gpsData.type, "&address=").concat(gpsData.address, "&ostype=DynamicForm"), {
|
|
149
|
+
method: 'GET',
|
|
150
|
+
headers: {
|
|
151
|
+
'X-SiiA-Api-Key': '0726e1cf-a8b3-426c-bb7b-3857704ff011',
|
|
152
|
+
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
|
|
153
|
+
Accept: '*/*',
|
|
154
|
+
Host: 'api.a4appz.com',
|
|
155
|
+
Connection: 'keep-alive',
|
|
156
|
+
'Content-Type': 'application/json'
|
|
157
|
+
}
|
|
158
|
+
}).then(function (res) {
|
|
159
|
+
return res.json();
|
|
160
|
+
}).then(function (res) {
|
|
161
|
+
if (res.status === 200) {
|
|
162
|
+
var _res$data;
|
|
163
|
+
|
|
164
|
+
var getDetails = res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.data;
|
|
165
|
+
console.log(getDetails); // setGpsData(getDetails)
|
|
166
|
+
}
|
|
167
|
+
})["catch"](function (err) {
|
|
168
|
+
console.log('err', err === null || err === void 0 ? void 0 : err.response);
|
|
169
|
+
|
|
170
|
+
_message.error('Address not found!', 2);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
case 3:
|
|
174
|
+
case "end":
|
|
175
|
+
return _context.stop();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}, _callee);
|
|
179
|
+
}));
|
|
180
|
+
|
|
181
|
+
return function handleAddressSearch() {
|
|
182
|
+
return _ref2.apply(this, arguments);
|
|
183
|
+
};
|
|
184
|
+
}();
|
|
185
|
+
|
|
186
|
+
var handleLocationSearch = /*#__PURE__*/function () {
|
|
187
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
188
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
189
|
+
while (1) {
|
|
190
|
+
switch (_context2.prev = _context2.next) {
|
|
191
|
+
case 0:
|
|
192
|
+
if (!handleLatValidate()) {
|
|
193
|
+
_context2.next = 3;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
_context2.next = 3;
|
|
198
|
+
return fetch("https://api.a4appz.com/apim/getlocation?type=".concat(gpsData.type, "&location=").concat(gpsData.latitude, ",").concat(gpsData.longitude, "&ostype=DynamicForm"), {
|
|
199
|
+
method: 'GET',
|
|
200
|
+
headers: {
|
|
201
|
+
'X-SiiA-Api-Key': '0726e1cf-a8b3-426c-bb7b-3857704ff011',
|
|
202
|
+
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
|
|
203
|
+
Accept: '*/*',
|
|
204
|
+
Host: 'api.a4appz.com',
|
|
205
|
+
Connection: 'keep-alive',
|
|
206
|
+
'Content-Type': 'application/json'
|
|
207
|
+
}
|
|
208
|
+
}).then(function (res) {
|
|
209
|
+
return res.json();
|
|
210
|
+
}).then(function (res) {
|
|
211
|
+
if (res.status === 200) {
|
|
212
|
+
var _res$data2;
|
|
213
|
+
|
|
214
|
+
var getDetails = res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.data;
|
|
215
|
+
console.log(getDetails); // setGpsData(getDetails)
|
|
216
|
+
}
|
|
217
|
+
})["catch"](function (err) {
|
|
218
|
+
console.log('err', err === null || err === void 0 ? void 0 : err.response);
|
|
219
|
+
|
|
220
|
+
_message.error('Location not found!', 2);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
case 3:
|
|
224
|
+
case "end":
|
|
225
|
+
return _context2.stop();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}, _callee2);
|
|
229
|
+
}));
|
|
230
|
+
|
|
231
|
+
return function handleLocationSearch() {
|
|
232
|
+
return _ref3.apply(this, arguments);
|
|
233
|
+
};
|
|
234
|
+
}();
|
|
235
|
+
|
|
236
|
+
return /*#__PURE__*/React.createElement(_Modal, {
|
|
237
|
+
title: "Modal",
|
|
238
|
+
visible: isOpen,
|
|
239
|
+
onOk: function onOk() {},
|
|
240
|
+
onCancel: function onCancel() {
|
|
241
|
+
return setIsOpen(false);
|
|
242
|
+
},
|
|
243
|
+
okText: "Save",
|
|
244
|
+
cancelText: "Cancel"
|
|
245
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
|
246
|
+
form: form
|
|
247
|
+
}, /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
|
|
248
|
+
span: 24
|
|
249
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
250
|
+
label: "Type",
|
|
251
|
+
name: "type",
|
|
252
|
+
rules: [{
|
|
253
|
+
required: true,
|
|
254
|
+
message: 'Please select type!'
|
|
255
|
+
}]
|
|
256
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
257
|
+
options: [{
|
|
258
|
+
label: 'Google',
|
|
259
|
+
value: 'WGS84'
|
|
260
|
+
}, {
|
|
261
|
+
label: 'Amap',
|
|
262
|
+
value: 'GCJ02'
|
|
263
|
+
}],
|
|
264
|
+
value: gpsData.type,
|
|
265
|
+
onChange: function onChange(e) {
|
|
266
|
+
return handleGpsDataChange(e, 'type');
|
|
267
|
+
}
|
|
268
|
+
}))), /*#__PURE__*/React.createElement(_Col, {
|
|
269
|
+
span: 24
|
|
270
|
+
}, /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
|
|
271
|
+
span: 20
|
|
272
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
273
|
+
label: "Address",
|
|
274
|
+
name: "address",
|
|
275
|
+
rules: [{
|
|
276
|
+
required: true,
|
|
277
|
+
message: 'Please input address!'
|
|
278
|
+
}],
|
|
279
|
+
style: {
|
|
280
|
+
marginRight: '15px'
|
|
281
|
+
}
|
|
282
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
283
|
+
type: "text",
|
|
284
|
+
id: "adresss",
|
|
285
|
+
placeholder: "",
|
|
286
|
+
value: gpsData.address,
|
|
287
|
+
onChange: function onChange(e) {
|
|
288
|
+
return handleGpsDataChange(e.target.value, 'address');
|
|
289
|
+
}
|
|
290
|
+
}))), /*#__PURE__*/React.createElement(_Col, {
|
|
291
|
+
span: 4
|
|
292
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
293
|
+
color: "primary",
|
|
294
|
+
onClick: function onClick() {
|
|
295
|
+
return handleAddressSearch();
|
|
296
|
+
}
|
|
297
|
+
}, "Search")))), /*#__PURE__*/React.createElement(_Col, {
|
|
298
|
+
span: 24
|
|
299
|
+
}, /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
|
|
300
|
+
span: 10
|
|
301
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
302
|
+
label: "Longitude",
|
|
303
|
+
name: "longitude",
|
|
304
|
+
style: {
|
|
305
|
+
marginLeft: '10px'
|
|
306
|
+
}
|
|
307
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
308
|
+
type: "text",
|
|
309
|
+
id: "longitude",
|
|
310
|
+
placeholder: "",
|
|
311
|
+
value: gpsData.longitude,
|
|
312
|
+
onChange: function onChange(e) {
|
|
313
|
+
return handleGpsDataChange(e.target.value, 'longitude');
|
|
314
|
+
}
|
|
315
|
+
}))), /*#__PURE__*/React.createElement(_Col, {
|
|
316
|
+
span: 10
|
|
317
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
318
|
+
label: "Latitude",
|
|
319
|
+
name: "latitude",
|
|
320
|
+
style: {
|
|
321
|
+
marginLeft: '10px'
|
|
322
|
+
}
|
|
323
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
324
|
+
type: "text",
|
|
325
|
+
id: "latitude",
|
|
326
|
+
placeholder: "",
|
|
327
|
+
value: gpsData.latitude,
|
|
328
|
+
onChange: function onChange(e) {
|
|
329
|
+
return handleGpsDataChange(e.target.value, 'latitude');
|
|
330
|
+
}
|
|
331
|
+
}))), /*#__PURE__*/React.createElement(_Col, {
|
|
332
|
+
span: 4
|
|
333
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
334
|
+
style: {
|
|
335
|
+
marginLeft: '15px'
|
|
336
|
+
},
|
|
337
|
+
color: "primary",
|
|
338
|
+
onClick: function onClick() {
|
|
339
|
+
return handleLocationSearch();
|
|
340
|
+
}
|
|
341
|
+
}, "Search")))))), /*#__PURE__*/React.createElement("div", {
|
|
342
|
+
className: "servicesTable mb-1 mt-1"
|
|
343
|
+
}, /*#__PURE__*/React.createElement(_Table, null)));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Place Auto Complete
|
|
348
|
+
*/
|
|
349
|
+
var config$l = {
|
|
350
|
+
icon: 'iconfont icon-input',
|
|
351
|
+
title: 'Place Auto Complete',
|
|
352
|
+
unitedSchema: {
|
|
353
|
+
type: 'string',
|
|
354
|
+
title: 'Place Auto Complete',
|
|
355
|
+
ui: {
|
|
356
|
+
type: 'placeAutoComplete',
|
|
357
|
+
description: {
|
|
358
|
+
type: 'icon',
|
|
359
|
+
title: 'Hover description',
|
|
360
|
+
trigger: 'hover'
|
|
361
|
+
},
|
|
362
|
+
style: {
|
|
363
|
+
width: '100%'
|
|
364
|
+
},
|
|
365
|
+
containerStyle: {
|
|
366
|
+
width: '100%'
|
|
367
|
+
},
|
|
368
|
+
theme: 'antd'
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
propertyConfig: {
|
|
372
|
+
styleSchema: [{
|
|
373
|
+
type: 'string',
|
|
374
|
+
title: 'Form modes',
|
|
375
|
+
"default": 'edit',
|
|
376
|
+
ui: {
|
|
377
|
+
type: 'radio',
|
|
378
|
+
options: [{
|
|
379
|
+
value: 'edit',
|
|
380
|
+
label: 'Edit'
|
|
381
|
+
}, {
|
|
382
|
+
value: 'view',
|
|
383
|
+
label: 'View'
|
|
384
|
+
}]
|
|
385
|
+
},
|
|
386
|
+
fieldKey: 'formMode'
|
|
387
|
+
}, {
|
|
388
|
+
fieldKey: 'placeholder',
|
|
389
|
+
type: 'string',
|
|
390
|
+
title: 'Placeholder',
|
|
391
|
+
ui: {
|
|
392
|
+
type: 'text',
|
|
393
|
+
placeholder: 'Please enter text',
|
|
394
|
+
allowClear: true
|
|
395
|
+
}
|
|
396
|
+
}, {
|
|
397
|
+
fieldKey: 'multiline',
|
|
398
|
+
type: 'number',
|
|
399
|
+
title: 'Number of text lines',
|
|
400
|
+
"default": 1,
|
|
401
|
+
// formatter: 'value => `${value}%`',
|
|
402
|
+
ui: {
|
|
403
|
+
type: 'number',
|
|
404
|
+
allowClear: true,
|
|
405
|
+
min: 1,
|
|
406
|
+
step: 1
|
|
407
|
+
}
|
|
408
|
+
}, {
|
|
409
|
+
fieldKey: 'disabled',
|
|
410
|
+
type: 'boolean',
|
|
411
|
+
title: 'Is It disabled',
|
|
412
|
+
"default": false,
|
|
413
|
+
ui: {
|
|
414
|
+
type: 'switch'
|
|
415
|
+
}
|
|
416
|
+
}, {
|
|
417
|
+
fieldKey: 'allowClear',
|
|
418
|
+
type: 'boolean',
|
|
419
|
+
title: 'Can be cleared',
|
|
420
|
+
"default": true,
|
|
421
|
+
ui: {
|
|
422
|
+
type: 'switch'
|
|
423
|
+
}
|
|
424
|
+
}, {
|
|
425
|
+
fieldKey: 'showCount',
|
|
426
|
+
type: 'boolean',
|
|
427
|
+
title: 'Whether to display word count',
|
|
428
|
+
"default": false,
|
|
429
|
+
ui: {
|
|
430
|
+
type: 'switch',
|
|
431
|
+
vcontrol: 'return props.formData.ui.multiline>1'
|
|
432
|
+
}
|
|
433
|
+
}, {
|
|
434
|
+
fieldKey: 'default',
|
|
435
|
+
type: 'string',
|
|
436
|
+
title: 'Default value',
|
|
437
|
+
ui: {
|
|
438
|
+
type: 'text',
|
|
439
|
+
placeholder: 'Please enter text',
|
|
440
|
+
allowClear: true
|
|
441
|
+
}
|
|
442
|
+
}]
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
var _excluded$m = ["multiline", "disabled", "onChange", "fieldData", "fieldKey", "dispatch", "disabled_input", "style", "asyncValidate", "getKey", "formMode", "autoSize", "type", "globalState"];
|
|
447
|
+
|
|
448
|
+
function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
449
|
+
|
|
450
|
+
function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
451
|
+
_Input.TextArea;
|
|
452
|
+
|
|
453
|
+
var PlaceAutoCompleteField = function PlaceAutoCompleteField(_ref) {
|
|
454
|
+
_ref.multiline;
|
|
455
|
+
var disabled = _ref.disabled,
|
|
456
|
+
onChange = _ref.onChange,
|
|
457
|
+
fieldData = _ref.fieldData,
|
|
458
|
+
fieldKey = _ref.fieldKey,
|
|
459
|
+
dispatch = _ref.dispatch,
|
|
460
|
+
disabled_input = _ref.disabled_input,
|
|
461
|
+
style = _ref.style,
|
|
462
|
+
asyncValidate = _ref.asyncValidate,
|
|
463
|
+
getKey = _ref.getKey;
|
|
464
|
+
_ref.formMode;
|
|
465
|
+
_ref.autoSize;
|
|
466
|
+
_ref.type;
|
|
467
|
+
var globalState = _ref.globalState,
|
|
468
|
+
restProps = _objectWithoutProperties(_ref, _excluded$m);
|
|
469
|
+
|
|
470
|
+
var _onChange = useField(_objectSpread$e({
|
|
471
|
+
fieldKey: fieldKey,
|
|
472
|
+
onChange: onChange,
|
|
473
|
+
asyncValidate: asyncValidate,
|
|
474
|
+
getKey: getKey
|
|
475
|
+
}, disabled_input && {
|
|
476
|
+
options: {
|
|
477
|
+
disabled_input: disabled_input,
|
|
478
|
+
isFormat: true
|
|
479
|
+
}
|
|
480
|
+
}), dispatch);
|
|
481
|
+
|
|
482
|
+
var handleIsGPSModalOpen = function handleIsGPSModalOpen(toggle) {
|
|
483
|
+
globalState.setGlobalState(_objectSpread$e(_objectSpread$e({}, globalState), {}, {
|
|
484
|
+
webModalForPlaceAutoCompleteField: toggle ? fieldKey : null
|
|
485
|
+
}));
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Input, _extends({
|
|
489
|
+
disabled: disabled,
|
|
490
|
+
onChange: _onChange,
|
|
491
|
+
value: fieldData,
|
|
492
|
+
style: style
|
|
493
|
+
}, restProps)), /*#__PURE__*/React.createElement(GpsModal, {
|
|
494
|
+
isOpen: globalState.webModalForPlaceAutoCompleteField === fieldKey,
|
|
495
|
+
setIsOpen: handleIsGPSModalOpen
|
|
496
|
+
}));
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
var placeAutoComplete = /*#__PURE__*/memo(PlaceAutoCompleteField);
|
|
500
|
+
|
|
58
501
|
/**
|
|
59
502
|
* Input Box
|
|
60
503
|
*/
|
|
@@ -20438,7 +20881,7 @@ var config$c = {
|
|
|
20438
20881
|
fieldKey: 'renderType'
|
|
20439
20882
|
}, {
|
|
20440
20883
|
type: 'string',
|
|
20441
|
-
title: 'Type',
|
|
20884
|
+
title: 'Display Type',
|
|
20442
20885
|
"default": 'none',
|
|
20443
20886
|
ui: {
|
|
20444
20887
|
type: 'radio',
|
|
@@ -24547,6 +24990,7 @@ TreeSelectField.displayName = 'TreeSelectField';
|
|
|
24547
24990
|
|
|
24548
24991
|
var antdTheme = {
|
|
24549
24992
|
text: text,
|
|
24993
|
+
placeAutoComplete: placeAutoComplete,
|
|
24550
24994
|
number: numberField,
|
|
24551
24995
|
select: select,
|
|
24552
24996
|
radio: radio,
|
|
@@ -24573,12 +25017,13 @@ var antdTheme = {
|
|
|
24573
25017
|
}; // antd的打包改为输出less,需要使用者配置less-loader
|
|
24574
25018
|
var config = {
|
|
24575
25019
|
title: 'Form Component',
|
|
24576
|
-
order: ['checkbox', 'colorPicker', 'datePicker', 'text', 'number', 'radio', 'select', 'slider', 'switch', 'timePicker', 'uploader', 'cascader', 'transfer', 'null', 'downloader', 'table'],
|
|
25020
|
+
order: ['checkbox', 'colorPicker', 'datePicker', 'text', 'placeAutoComplete', 'number', 'radio', 'select', 'slider', 'switch', 'timePicker', 'uploader', 'cascader', 'transfer', 'null', 'downloader', 'table'],
|
|
24577
25021
|
fields: {
|
|
24578
25022
|
checkbox: config$6,
|
|
24579
25023
|
colorPicker: config$7,
|
|
24580
25024
|
datePicker: config$8,
|
|
24581
25025
|
text: config$k,
|
|
25026
|
+
placeAutoComplete: config$l,
|
|
24582
25027
|
number: config$i,
|
|
24583
25028
|
radio: config$j,
|
|
24584
25029
|
select: config$d,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innoways/drip-form-theme-antd",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.2",
|
|
4
4
|
"author": "JDFED",
|
|
5
5
|
"description": "drip-form antd主题包",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@ant-design/icons": "^4.7.0",
|
|
33
33
|
"@babel/runtime": "^7.10.2",
|
|
34
|
-
"@innoways/hooks": "^6.3.
|
|
35
|
-
"@innoways/utils": "^6.3.
|
|
34
|
+
"@innoways/hooks": "^6.3.2",
|
|
35
|
+
"@innoways/utils": "^6.3.2",
|
|
36
36
|
"antd": "^4.16.13",
|
|
37
37
|
"flatpickr": "^4.6.13",
|
|
38
38
|
"moment": "^2.26.0",
|