@innoways/drip-form-theme-antd 6.3.1 → 6.3.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/index.js +613 -14
  3. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## 6.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - feature: place auto complete search feature added, version 6.3.3
8
+ - Updated dependencies
9
+ - @innoways/hooks@6.3.3
10
+ - @innoways/utils@6.3.3
11
+
12
+ ## 6.3.2
13
+
14
+ ### Patch Changes
15
+
16
+ - feature: Added new field component place auto complete, version 6.3.2
17
+ - Updated dependencies
18
+ - @innoways/hooks@6.3.2
19
+ - @innoways/utils@6.3.2
20
+
3
21
  ## 6.3.1
4
22
 
5
23
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,23 +1,39 @@
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, { memo, useState, useEffect, useMemo, useCallback } from '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 _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
21
+ import 'antd/es/message/style';
22
+ import _message from 'antd/es/message';
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';
27
+ import { fetchFn, typeCheck, isEmpty, binaryData2Blob, checkImg, isValidHttpUrl, fetchFnJsonKey } from '@innoways/utils';
9
28
  import 'antd/es/radio/style';
10
29
  import _Radio from 'antd/es/radio';
11
30
  import reactIs from 'react-is';
12
31
  import 'antd/es/tooltip/style';
13
32
  import _Tooltip from 'antd/es/tooltip';
14
33
  import { QuestionCircleOutlined, InboxOutlined, PlusOutlined, UploadOutlined } from '@ant-design/icons';
15
- import { typeCheck, isEmpty, binaryData2Blob, checkImg, isValidHttpUrl, fetchFnJsonKey } from '@innoways/utils';
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,608 @@ 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
+ var searchTypes = [{
70
+ label: 'Google',
71
+ value: 'WGS84'
72
+ }, {
73
+ label: 'Amap',
74
+ value: 'GCJ02'
75
+ }];
76
+
77
+ function GpsModal(_ref) {
78
+ var isOpen = _ref.isOpen,
79
+ setIsOpen = _ref.setIsOpen,
80
+ onChange = _ref.onChange;
81
+ var columns = [{
82
+ title: 'Address',
83
+ dataIndex: 'address',
84
+ key: 'address'
85
+ }, {
86
+ title: 'Location',
87
+ dataIndex: 'location',
88
+ key: 'location'
89
+ }];
90
+
91
+ var _useState = useState({
92
+ type: '',
93
+ address: '',
94
+ latitude: '',
95
+ longitude: ''
96
+ }),
97
+ _useState2 = _slicedToArray(_useState, 2),
98
+ gpsData = _useState2[0],
99
+ setGpsData = _useState2[1];
100
+
101
+ var _useState3 = useState(3),
102
+ _useState4 = _slicedToArray(_useState3, 2),
103
+ pageSize = _useState4[0],
104
+ setPageSize = _useState4[1];
105
+
106
+ var _useState5 = useState([]),
107
+ _useState6 = _slicedToArray(_useState5, 2),
108
+ selectedRows = _useState6[0],
109
+ setSelectedRows = _useState6[1];
110
+
111
+ var _useState7 = useState([]),
112
+ _useState8 = _slicedToArray(_useState7, 2),
113
+ selectedRowKeys = _useState8[0],
114
+ setSelectedRowKeys = _useState8[1];
115
+
116
+ var _useState9 = useState(false),
117
+ _useState10 = _slicedToArray(_useState9, 2),
118
+ loading = _useState10[0],
119
+ setLoading = _useState10[1];
120
+
121
+ var _useState11 = useState([]),
122
+ _useState12 = _slicedToArray(_useState11, 2),
123
+ gpApiData = _useState12[0],
124
+ setGpApiData = _useState12[1];
125
+
126
+ var _Form$useForm = _Form.useForm(),
127
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
128
+ form = _Form$useForm2[0];
129
+
130
+ var baseSearchUrl = 'http://localhost:8000/api/v1/gps/searchGps';
131
+
132
+ var handleGpsDataChange = function handleGpsDataChange(value, name) {
133
+ setGpsData(_objectSpread$f(_objectSpread$f({}, gpsData), {}, _defineProperty({}, name, value)));
134
+ };
135
+
136
+ var handleResult = function handleResult(result1, type, addressFg) {
137
+ if (type == searchTypes[1].value) {
138
+ if (result1.status == '1') {
139
+ if (addressFg) {
140
+ //By Address
141
+ if (result1.geocodes) {
142
+ return result1.geocodes.map(function (item) {
143
+ return {
144
+ key: item.formatted_address,
145
+ address: item.formatted_address,
146
+ location: item.location,
147
+ longitude: item.location.split(',')[0],
148
+ latitude: item.location.split(',')[1]
149
+ };
150
+ });
151
+ }
152
+ } else {
153
+ //By Location
154
+ if (result1.regeocode) {
155
+ var _result1$regeocode = result1.regeocode,
156
+ formatted_address = _result1$regeocode.formatted_address,
157
+ addressComponent = _result1$regeocode.addressComponent;
158
+ return [{
159
+ key: formatted_address,
160
+ address: formatted_address,
161
+ location: addressComponent.streetNumber.location,
162
+ longitude: addressComponent.streetNumber.location.split(',')[0],
163
+ latitude: addressComponent.streetNumber.location.split(',')[1]
164
+ }];
165
+ }
166
+ }
167
+ }
168
+ } else {
169
+ //谷歌
170
+ if (result1.status == 'OK') {
171
+ //By Address & By Location
172
+ if (result1.results) {
173
+ return result1.results.map(function (item) {
174
+ return {
175
+ key: item.formatted_address,
176
+ address: item.formatted_address,
177
+ location: "".concat(item.geometry.location.lng, ",").concat(item.geometry.location.lat),
178
+ longitude: item.geometry.location.lng,
179
+ latitude: item.geometry.location.lat
180
+ };
181
+ });
182
+ }
183
+ }
184
+ }
185
+
186
+ _message.error('Location not found!', 2);
187
+
188
+ return [];
189
+ };
190
+
191
+ var handleValidate = function handleValidate() {
192
+ form.validateFields(['type', 'address']);
193
+ var type = gpsData.type,
194
+ address = gpsData.address;
195
+ var flag = true;
196
+
197
+ if (!type) {
198
+ flag = false;
199
+ }
200
+
201
+ if (!address) {
202
+ flag = false;
203
+ }
204
+
205
+ return flag;
206
+ };
207
+
208
+ var handleLatValidate = function handleLatValidate() {
209
+ form.validateFields(['type', 'latitude', 'longitude']);
210
+ var type = gpsData.type,
211
+ latitude = gpsData.latitude,
212
+ longitude = gpsData.longitude;
213
+ var flag = true;
214
+
215
+ if (!type) {
216
+ flag = false;
217
+ }
218
+
219
+ if (!latitude) {
220
+ flag = false;
221
+ }
222
+
223
+ if (!longitude) {
224
+ flag = false;
225
+ }
226
+
227
+ return flag;
228
+ };
229
+
230
+ var handleAddressSearch = /*#__PURE__*/function () {
231
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
232
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
233
+ while (1) {
234
+ switch (_context.prev = _context.next) {
235
+ case 0:
236
+ setLoading(true);
237
+
238
+ if (!handleValidate()) {
239
+ _context.next = 4;
240
+ break;
241
+ }
242
+
243
+ _context.next = 4;
244
+ return fetchFn({
245
+ url: baseSearchUrl,
246
+ params: [{
247
+ key: 'type',
248
+ value: gpsData.type
249
+ }, {
250
+ key: 'address',
251
+ value: gpsData.address
252
+ }, {
253
+ key: 'ostype',
254
+ value: 'DynamicForm'
255
+ }],
256
+ method: 'POST'
257
+ }).then(function (res) {
258
+ if (res.Code === 0) {
259
+ var getDetails = res.Data;
260
+ setGpApiData(handleResult(getDetails, gpsData.type, true));
261
+ } else {
262
+ _message.error('Address not found!', 2);
263
+ }
264
+ })["catch"](function () {
265
+ _message.error('Address not found!', 2);
266
+ })["finally"](function () {
267
+ setLoading(false);
268
+ });
269
+
270
+ case 4:
271
+ case "end":
272
+ return _context.stop();
273
+ }
274
+ }
275
+ }, _callee);
276
+ }));
277
+
278
+ return function handleAddressSearch() {
279
+ return _ref2.apply(this, arguments);
280
+ };
281
+ }();
282
+
283
+ var handleLocationSearch = /*#__PURE__*/function () {
284
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
285
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
286
+ while (1) {
287
+ switch (_context2.prev = _context2.next) {
288
+ case 0:
289
+ if (!handleLatValidate()) {
290
+ _context2.next = 3;
291
+ break;
292
+ }
293
+
294
+ _context2.next = 3;
295
+ return fetchFn({
296
+ url: baseSearchUrl,
297
+ params: [{
298
+ key: 'type',
299
+ value: gpsData.type
300
+ }, {
301
+ key: 'latitude',
302
+ value: gpsData.latitude
303
+ }, {
304
+ key: 'longitude',
305
+ value: gpsData.longitude
306
+ }, {
307
+ key: 'ostype',
308
+ value: 'DynamicForm'
309
+ }],
310
+ method: 'POST'
311
+ }).then(function (res) {
312
+ if (res.Code === 0) {
313
+ var getDetails = res.Data;
314
+ setGpApiData(handleResult(getDetails, gpsData.type, false));
315
+ } else {
316
+ _message.error('Location not found!', 2);
317
+ }
318
+ })["catch"](function () {
319
+ _message.error('Location not found!', 2);
320
+ })["finally"](function () {
321
+ setLoading(false);
322
+ });
323
+
324
+ case 3:
325
+ case "end":
326
+ return _context2.stop();
327
+ }
328
+ }
329
+ }, _callee2);
330
+ }));
331
+
332
+ return function handleLocationSearch() {
333
+ return _ref3.apply(this, arguments);
334
+ };
335
+ }();
336
+
337
+ var rowSelection = {
338
+ type: 'radio',
339
+ onChange: function onChange(selRowKeys, selRows) {
340
+ setSelectedRowKeys(selRowKeys);
341
+ setSelectedRows(selRows);
342
+ },
343
+ selectedRowKeys: selectedRowKeys
344
+ };
345
+
346
+ var beforeSearch = function beforeSearch() {
347
+ setLoading(true);
348
+ setSelectedRows([]);
349
+ setSelectedRowKeys([]);
350
+ };
351
+
352
+ var reset = function reset() {
353
+ setSelectedRows([]);
354
+ setSelectedRowKeys([]);
355
+ setGpApiData([]);
356
+ setGpsData({
357
+ type: '',
358
+ address: '',
359
+ latitude: '',
360
+ longitude: ''
361
+ });
362
+ form.resetFields();
363
+ setLoading(false);
364
+ setIsOpen(false);
365
+ };
366
+
367
+ return /*#__PURE__*/React.createElement(_Modal, {
368
+ title: "Modal",
369
+ visible: isOpen,
370
+ okButtonProps: {
371
+ disabled: selectedRows.length === 0
372
+ },
373
+ onOk: function onOk() {
374
+ if (selectedRows.length > 0) {
375
+ onChange(selectedRows[0].address || '');
376
+ }
377
+
378
+ reset();
379
+ },
380
+ onCancel: function onCancel() {
381
+ reset();
382
+ },
383
+ okText: "Save",
384
+ cancelText: "Cancel"
385
+ }, /*#__PURE__*/React.createElement(_Form, {
386
+ form: form
387
+ }, /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
388
+ span: 24
389
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
390
+ label: "Type",
391
+ name: "type",
392
+ rules: [{
393
+ required: true,
394
+ message: 'Please select type!'
395
+ }]
396
+ }, /*#__PURE__*/React.createElement(_Select, {
397
+ options: searchTypes,
398
+ value: gpsData.type,
399
+ onChange: function onChange(e) {
400
+ return handleGpsDataChange(e, 'type');
401
+ }
402
+ }))), /*#__PURE__*/React.createElement(_Col, {
403
+ span: 24
404
+ }, /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
405
+ span: 20
406
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
407
+ label: "Address",
408
+ name: "address",
409
+ rules: [{
410
+ required: true,
411
+ message: 'Please input address!'
412
+ }],
413
+ style: {
414
+ marginRight: '15px'
415
+ }
416
+ }, /*#__PURE__*/React.createElement(_Input, {
417
+ type: "text",
418
+ id: "adresss",
419
+ placeholder: "",
420
+ value: gpsData.address,
421
+ onChange: function onChange(e) {
422
+ return handleGpsDataChange(e.target.value, 'address');
423
+ }
424
+ }))), /*#__PURE__*/React.createElement(_Col, {
425
+ span: 4
426
+ }, /*#__PURE__*/React.createElement(_Button, {
427
+ color: "primary",
428
+ onClick: function onClick() {
429
+ beforeSearch();
430
+ handleAddressSearch();
431
+ }
432
+ }, "Search")))), /*#__PURE__*/React.createElement(_Col, {
433
+ span: 24
434
+ }, /*#__PURE__*/React.createElement(_Row, null, /*#__PURE__*/React.createElement(_Col, {
435
+ span: 10
436
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
437
+ label: "Longitude",
438
+ name: "longitude",
439
+ style: {
440
+ marginLeft: '10px'
441
+ }
442
+ }, /*#__PURE__*/React.createElement(_Input, {
443
+ type: "text",
444
+ id: "longitude",
445
+ placeholder: "",
446
+ value: gpsData.longitude,
447
+ onChange: function onChange(e) {
448
+ return handleGpsDataChange(e.target.value, 'longitude');
449
+ }
450
+ }))), /*#__PURE__*/React.createElement(_Col, {
451
+ span: 10
452
+ }, /*#__PURE__*/React.createElement(_Form.Item, {
453
+ label: "Latitude",
454
+ name: "latitude",
455
+ style: {
456
+ marginLeft: '10px'
457
+ }
458
+ }, /*#__PURE__*/React.createElement(_Input, {
459
+ type: "text",
460
+ id: "latitude",
461
+ placeholder: "",
462
+ value: gpsData.latitude,
463
+ onChange: function onChange(e) {
464
+ return handleGpsDataChange(e.target.value, 'latitude');
465
+ }
466
+ }))), /*#__PURE__*/React.createElement(_Col, {
467
+ span: 4
468
+ }, /*#__PURE__*/React.createElement(_Button, {
469
+ style: {
470
+ marginLeft: '15px'
471
+ },
472
+ color: "primary",
473
+ onClick: function onClick() {
474
+ beforeSearch();
475
+ handleLocationSearch();
476
+ }
477
+ }, "Search")))))), /*#__PURE__*/React.createElement("div", {
478
+ className: "servicesTable mb-1 mt-1"
479
+ }, /*#__PURE__*/React.createElement(_Table, {
480
+ pagination: {
481
+ pageSize: pageSize,
482
+ pageSizeOptions: ['3', '10', '20', '50'],
483
+ total: gpApiData.length,
484
+ showSizeChanger: true,
485
+ showTotal: function showTotal(total) {
486
+ return "Total ".concat(total, " items");
487
+ },
488
+ onChange: function onChange(page, pageSize) {
489
+ setPageSize(pageSize);
490
+ }
491
+ },
492
+ columns: columns,
493
+ dataSource: gpApiData,
494
+ rowSelection: rowSelection,
495
+ loading: loading
496
+ })));
497
+ }
498
+
499
+ /**
500
+ * Place Auto Complete
501
+ */
502
+ var config$l = {
503
+ icon: 'iconfont icon-input',
504
+ title: 'Place Auto Complete',
505
+ unitedSchema: {
506
+ type: 'string',
507
+ title: 'Place Auto Complete',
508
+ ui: {
509
+ type: 'placeAutoComplete',
510
+ description: {
511
+ type: 'icon',
512
+ title: 'Hover description',
513
+ trigger: 'hover'
514
+ },
515
+ style: {
516
+ width: '100%'
517
+ },
518
+ containerStyle: {
519
+ width: '100%'
520
+ },
521
+ theme: 'antd'
522
+ }
523
+ },
524
+ propertyConfig: {
525
+ styleSchema: [{
526
+ type: 'string',
527
+ title: 'Form modes',
528
+ "default": 'edit',
529
+ ui: {
530
+ type: 'radio',
531
+ options: [{
532
+ value: 'edit',
533
+ label: 'Edit'
534
+ }, {
535
+ value: 'view',
536
+ label: 'View'
537
+ }]
538
+ },
539
+ fieldKey: 'formMode'
540
+ }, {
541
+ fieldKey: 'placeholder',
542
+ type: 'string',
543
+ title: 'Placeholder',
544
+ ui: {
545
+ type: 'text',
546
+ placeholder: 'Please enter text',
547
+ allowClear: true
548
+ }
549
+ }, {
550
+ fieldKey: 'multiline',
551
+ type: 'number',
552
+ title: 'Number of text lines',
553
+ "default": 1,
554
+ // formatter: 'value => `${value}%`',
555
+ ui: {
556
+ type: 'number',
557
+ allowClear: true,
558
+ min: 1,
559
+ step: 1
560
+ }
561
+ }, {
562
+ fieldKey: 'disabled',
563
+ type: 'boolean',
564
+ title: 'Is It disabled',
565
+ "default": false,
566
+ ui: {
567
+ type: 'switch'
568
+ }
569
+ }, {
570
+ fieldKey: 'allowClear',
571
+ type: 'boolean',
572
+ title: 'Can be cleared',
573
+ "default": true,
574
+ ui: {
575
+ type: 'switch'
576
+ }
577
+ }, {
578
+ fieldKey: 'showCount',
579
+ type: 'boolean',
580
+ title: 'Whether to display word count',
581
+ "default": false,
582
+ ui: {
583
+ type: 'switch',
584
+ vcontrol: 'return props.formData.ui.multiline>1'
585
+ }
586
+ }, {
587
+ fieldKey: 'default',
588
+ type: 'string',
589
+ title: 'Default value',
590
+ ui: {
591
+ type: 'text',
592
+ placeholder: 'Please enter text',
593
+ allowClear: true
594
+ }
595
+ }]
596
+ }
597
+ };
598
+
599
+ var _excluded$m = ["multiline", "disabled", "onChange", "fieldData", "fieldKey", "dispatch", "disabled_input", "style", "asyncValidate", "getKey", "formMode", "autoSize", "type", "globalState"];
600
+
601
+ 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; }
602
+
603
+ 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; }
604
+ _Input.TextArea;
605
+
606
+ var PlaceAutoCompleteField = function PlaceAutoCompleteField(_ref) {
607
+ _ref.multiline;
608
+ var disabled = _ref.disabled,
609
+ onChange = _ref.onChange,
610
+ fieldData = _ref.fieldData,
611
+ fieldKey = _ref.fieldKey,
612
+ dispatch = _ref.dispatch,
613
+ disabled_input = _ref.disabled_input,
614
+ style = _ref.style,
615
+ asyncValidate = _ref.asyncValidate,
616
+ getKey = _ref.getKey;
617
+ _ref.formMode;
618
+ _ref.autoSize;
619
+ _ref.type;
620
+ var globalState = _ref.globalState,
621
+ restProps = _objectWithoutProperties(_ref, _excluded$m);
622
+
623
+ var _onChange = useField(_objectSpread$e({
624
+ fieldKey: fieldKey,
625
+ onChange: onChange,
626
+ asyncValidate: asyncValidate,
627
+ getKey: getKey
628
+ }, disabled_input && {
629
+ options: {
630
+ disabled_input: disabled_input,
631
+ isFormat: true
632
+ }
633
+ }), dispatch);
634
+
635
+ var handleIsGPSModalOpen = function handleIsGPSModalOpen(toggle) {
636
+ globalState.setGlobalState(_objectSpread$e(_objectSpread$e({}, globalState), {}, {
637
+ webModalForPlaceAutoCompleteField: toggle ? fieldKey : null
638
+ }));
639
+ };
640
+
641
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Input, _extends({
642
+ disabled: disabled,
643
+ onChange: _onChange,
644
+ value: fieldData,
645
+ style: style
646
+ }, restProps)), /*#__PURE__*/React.createElement(GpsModal, {
647
+ isOpen: globalState.webModalForPlaceAutoCompleteField === fieldKey,
648
+ setIsOpen: handleIsGPSModalOpen,
649
+ onChange: _onChange
650
+ }));
651
+ };
652
+
653
+ var placeAutoComplete = /*#__PURE__*/memo(PlaceAutoCompleteField);
654
+
58
655
  /**
59
656
  * Input Box
60
657
  */
@@ -24547,6 +25144,7 @@ TreeSelectField.displayName = 'TreeSelectField';
24547
25144
 
24548
25145
  var antdTheme = {
24549
25146
  text: text,
25147
+ placeAutoComplete: placeAutoComplete,
24550
25148
  number: numberField,
24551
25149
  select: select,
24552
25150
  radio: radio,
@@ -24573,12 +25171,13 @@ var antdTheme = {
24573
25171
  }; // antd的打包改为输出less,需要使用者配置less-loader
24574
25172
  var config = {
24575
25173
  title: 'Form Component',
24576
- order: ['checkbox', 'colorPicker', 'datePicker', 'text', 'number', 'radio', 'select', 'slider', 'switch', 'timePicker', 'uploader', 'cascader', 'transfer', 'null', 'downloader', 'table'],
25174
+ order: ['checkbox', 'colorPicker', 'datePicker', 'text', 'placeAutoComplete', 'number', 'radio', 'select', 'slider', 'switch', 'timePicker', 'uploader', 'cascader', 'transfer', 'null', 'downloader', 'table'],
24577
25175
  fields: {
24578
25176
  checkbox: config$6,
24579
25177
  colorPicker: config$7,
24580
25178
  datePicker: config$8,
24581
25179
  text: config$k,
25180
+ placeAutoComplete: config$l,
24582
25181
  number: config$i,
24583
25182
  radio: config$j,
24584
25183
  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.1",
3
+ "version": "6.3.3",
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.1",
35
- "@innoways/utils": "^6.3.1",
34
+ "@innoways/hooks": "^6.3.3",
35
+ "@innoways/utils": "^6.3.3",
36
36
  "antd": "^4.16.13",
37
37
  "flatpickr": "^4.6.13",
38
38
  "moment": "^2.26.0",