dtable-ui-component 7.0.0-xia.1 → 7.0.0-xia.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.
Files changed (281) hide show
  1. package/lib/ActionSheet/index.js +14 -16
  2. package/lib/ActivityIndicator/index.js +7 -8
  3. package/lib/AsyncUserSelect/index.js +40 -19
  4. package/lib/AsyncUserSelect/user-item.js +5 -6
  5. package/lib/AutoNumberFormatter/index.js +3 -4
  6. package/lib/Badge/index.js +9 -11
  7. package/lib/ButtonFormatter/index.js +6 -8
  8. package/lib/CTimeFormatter/index.js +3 -4
  9. package/lib/CheckboxEditor/index.js +1 -3
  10. package/lib/CheckboxEditor/mb-editor.js +9 -20
  11. package/lib/CheckboxEditor/pc-editor.js +12 -24
  12. package/lib/CheckboxFormatter/index.js +4 -5
  13. package/lib/CollaboratorEditor/index.js +2 -4
  14. package/lib/CollaboratorEditor/mb-editor/index.js +11 -19
  15. package/lib/CollaboratorEditor/pc-editor/index.js +25 -34
  16. package/lib/CollaboratorFormatter/index.js +8 -10
  17. package/lib/CollaboratorItem/index.js +4 -5
  18. package/lib/CollapsibleSettingLayout/index.js +9 -7
  19. package/lib/Comment/body/comment.js +10 -18
  20. package/lib/Comment/body/index.js +2 -4
  21. package/lib/Comment/footer/btns/index.js +4 -7
  22. package/lib/Comment/footer/index.js +9 -20
  23. package/lib/Comment/footer/input/index.js +29 -50
  24. package/lib/Comment/footer/input/participant/index.js +4 -5
  25. package/lib/Comment/footer/participants/index.js +4 -5
  26. package/lib/Comment/footer/participants/participant/index.js +1 -3
  27. package/lib/Comment/footer/participants/participant-select/index.js +8 -24
  28. package/lib/Comment/index.js +39 -57
  29. package/lib/Comment/utils/utilities.js +15 -21
  30. package/lib/CreatorFormatter/index.js +6 -8
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +22 -18
  32. package/lib/DTableColorPicker/index.js +55 -40
  33. package/lib/DTableColorPicker/utils.js +4 -6
  34. package/lib/DTableColumnIcon/index.js +6 -7
  35. package/lib/DTableCommonAddTool/index.js +6 -8
  36. package/lib/DTableCustomFooter/index.js +1 -3
  37. package/lib/DTableCustomizeCollaboratorSelect/index.js +17 -20
  38. package/lib/DTableCustomizeSelect/index.js +19 -24
  39. package/lib/DTableDropdownItem/index.js +16 -18
  40. package/lib/DTableDropdownMenu/index.js +8 -10
  41. package/lib/DTableEmptyTip/index.js +4 -5
  42. package/lib/DTableFiltersPopover/index.js +26 -41
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +1 -3
  44. package/lib/DTableFiltersPopover/utils/index.js +63 -113
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +8 -9
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +16 -13
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +18 -15
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +8 -14
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +34 -55
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +107 -170
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +136 -161
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +15 -20
  53. package/lib/DTableGroupSelect/index.js +11 -15
  54. package/lib/DTableGroupSelect/select-option-group.js +23 -32
  55. package/lib/DTableIcon/index.js +6 -7
  56. package/lib/DTableIcon/svg-icon.js +5 -7
  57. package/lib/DTableModalHeader/index.js +4 -13
  58. package/lib/DTablePopover/index.js +11 -15
  59. package/lib/DTableRadio/index.js +10 -9
  60. package/lib/DTableRadioGroup/index.js +8 -17
  61. package/lib/DTableSearchInput/index.js +19 -29
  62. package/lib/DTableSelect/dtable-select-label.js +6 -5
  63. package/lib/DTableSelect/index.js +21 -22
  64. package/lib/DTableSelect/utils.js +7 -15
  65. package/lib/DTableSubDropdownMenu/index.js +8 -10
  66. package/lib/DTableSubDropdownToggle/index.js +12 -12
  67. package/lib/DTableSwitch/index.js +12 -11
  68. package/lib/DTableToolTip/index.js +7 -8
  69. package/lib/DateEditor/index.js +20 -15
  70. package/lib/DateEditor/mb-editor/index.js +18 -31
  71. package/lib/DateEditor/pc-editor.js +26 -45
  72. package/lib/DateFormatter/index.js +4 -5
  73. package/lib/DatePicker/index.js +9 -15
  74. package/lib/DatePicker/utils.js +1 -3
  75. package/lib/DeleteTip/index.js +5 -6
  76. package/lib/DepartmentMultipleSelectEditor/index.js +25 -23
  77. package/lib/DepartmentSelectFilter/index.js +6 -8
  78. package/lib/DepartmentSingleSelectEditor/index.js +1 -3
  79. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +48 -47
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +36 -58
  81. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -19
  82. package/lib/DepartmentSingleSelectFormatter/index.js +4 -6
  83. package/lib/DigitalSignEditor/index.js +1 -3
  84. package/lib/DigitalSignEditor/mb-editor/index.js +12 -20
  85. package/lib/DigitalSignEditor/pc-editor/index.js +17 -24
  86. package/lib/DigitalSignEditor/service.js +2 -4
  87. package/lib/DigitalSignEditor/signature-board/index.js +5 -8
  88. package/lib/DigitalSignEditor/utils.js +2 -4
  89. package/lib/DigitalSignFormatter/index.js +12 -15
  90. package/lib/DigitalSignFormatter/utils.js +4 -5
  91. package/lib/DurationEditor/index.js +21 -31
  92. package/lib/DurationFormatter/index.js +4 -5
  93. package/lib/EditEditorButton/index.js +1 -3
  94. package/lib/EmailFormatter/index.js +3 -4
  95. package/lib/FieldDisplaySetting/field-item.js +12 -12
  96. package/lib/FieldDisplaySetting/index.js +11 -9
  97. package/lib/FileEditor/files-previewer/index.js +1 -3
  98. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +10 -18
  99. package/lib/FileEditor/files-previewer/mb-previewer/index.js +7 -8
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +3 -4
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +5 -6
  102. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +14 -21
  103. package/lib/FileEditor/files-previewer/pc-previewer/index.js +29 -57
  104. package/lib/FileEditor/index.js +1 -3
  105. package/lib/FileEditor/mb-editor/index.js +28 -20
  106. package/lib/FileEditor/pc-editor/addition-previewer/index.js +1 -3
  107. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +11 -25
  108. package/lib/FileEditor/pc-editor/index.js +19 -27
  109. package/lib/FileFormatter/index.js +26 -19
  110. package/lib/FileItemFormatter/index.js +6 -9
  111. package/lib/FileUploader/index.js +28 -45
  112. package/lib/FormulaFormatter/index.js +15 -29
  113. package/lib/GeolocationEditor/index.js +11 -12
  114. package/lib/GeolocationEditor/map-editor-utils.js +17 -15
  115. package/lib/GeolocationEditor/mb-editor/country-editor.js +17 -14
  116. package/lib/GeolocationEditor/mb-editor/index.js +4 -6
  117. package/lib/GeolocationEditor/mb-editor/location-editor.js +18 -15
  118. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +41 -68
  119. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +50 -89
  120. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +17 -14
  121. package/lib/GeolocationEditor/mb-editor/province-editor.js +17 -14
  122. package/lib/GeolocationEditor/pc-editor/country-editor.js +10 -23
  123. package/lib/GeolocationEditor/pc-editor/index.js +12 -20
  124. package/lib/GeolocationEditor/pc-editor/location-editor.js +26 -31
  125. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +34 -54
  126. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +36 -60
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +35 -62
  128. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +36 -65
  129. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +19 -25
  130. package/lib/GeolocationEditor/pc-editor/province-editor.js +6 -13
  131. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +5 -6
  132. package/lib/GeolocationEditor/pc-editor/selector-list.js +6 -7
  133. package/lib/GeolocationFormatter/index.js +4 -5
  134. package/lib/HtmlLongTextFormatter/index.js +4 -12
  135. package/lib/Icon/index.js +3 -5
  136. package/lib/IconButton/index.js +4 -6
  137. package/lib/ImageEditor/images-previewer/image-preview/index.js +12 -21
  138. package/lib/ImageEditor/images-previewer/index.js +3 -9
  139. package/lib/ImageEditor/index.js +1 -3
  140. package/lib/ImageEditor/mb-editor/index.js +28 -20
  141. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +2 -6
  142. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +1 -3
  143. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +7 -21
  144. package/lib/ImageEditor/pc-editor/images-previewer/index.js +3 -9
  145. package/lib/ImageEditor/pc-editor/index.js +11 -16
  146. package/lib/ImageFormatter/images-lazy-load.js +19 -11
  147. package/lib/ImageFormatter/index.js +11 -13
  148. package/lib/ImagePreviewerLightbox/index.js +15 -13
  149. package/lib/ImageThumbnail/index.js +10 -13
  150. package/lib/InputItem/custom-input.js +26 -46
  151. package/lib/InputItem/custom-keyboard.js +15 -18
  152. package/lib/InputItem/index.js +34 -50
  153. package/lib/InputItem/input.js +2 -4
  154. package/lib/LastModifierFormatter/index.js +6 -8
  155. package/lib/LinkEditor/index.js +33 -53
  156. package/lib/LinkEditor/link-editor-option.js +3 -4
  157. package/lib/LinkEditor/mb-popover/index.js +9 -22
  158. package/lib/LinkEditor/pc-popover/index.js +5 -10
  159. package/lib/LinkFormatter/index.js +21 -37
  160. package/lib/List/index.js +6 -8
  161. package/lib/List/list-item.js +22 -28
  162. package/lib/LongTextFormatter/index.js +4 -5
  163. package/lib/MBEditorHeader/index.js +7 -8
  164. package/lib/MTimeFormatter/index.js +3 -4
  165. package/lib/MobileFullScreenPage/body/index.js +3 -5
  166. package/lib/MobileFullScreenPage/header/index.js +4 -6
  167. package/lib/MobileFullScreenPage/index.js +13 -11
  168. package/lib/MobileModal/index.js +1 -3
  169. package/lib/MobileOperationSheet/index.js +7 -8
  170. package/lib/MobileSelector/empty/index.js +1 -3
  171. package/lib/MobileSelector/index.js +5 -7
  172. package/lib/MobileSelector/option/index.js +3 -5
  173. package/lib/MobileSelector/options/index.js +1 -3
  174. package/lib/MobileSelector/search/index.js +3 -5
  175. package/lib/MobileUpload/index.js +4 -5
  176. package/lib/Modal/modal.js +14 -15
  177. package/lib/Modal/prompt.js +4 -4
  178. package/lib/MultipleSelectEditor/index.js +1 -3
  179. package/lib/MultipleSelectFormatter/index.js +6 -8
  180. package/lib/NotificationPopover/index.js +4 -5
  181. package/lib/NumberEditor/index.js +12 -21
  182. package/lib/NumberFormatter/index.js +4 -5
  183. package/lib/PhoneNumberLink/index.js +2 -4
  184. package/lib/Picker/AbstractPicker.js +23 -27
  185. package/lib/Popover/index.js +3 -4
  186. package/lib/Popover/item.js +7 -9
  187. package/lib/Progress/index.js +9 -8
  188. package/lib/Radio/Radio.js +4 -8
  189. package/lib/Radio/RadioItem.js +8 -12
  190. package/lib/RateFormatter/index.js +13 -13
  191. package/lib/RoleStatusEditor/index.js +18 -17
  192. package/lib/RowExpandDialog/body/index.js +32 -49
  193. package/lib/RowExpandDialog/column-content/index.js +5 -9
  194. package/lib/RowExpandDialog/header/index.js +6 -8
  195. package/lib/RowExpandDialog/index.js +49 -34
  196. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +4 -5
  197. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +8 -10
  198. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +22 -33
  199. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +26 -40
  200. package/lib/RowExpandEditor/date-editor/mb-editor.js +12 -18
  201. package/lib/RowExpandEditor/date-editor/pc-editor.js +15 -20
  202. package/lib/RowExpandEditor/department-editor/mb-editor.js +16 -11
  203. package/lib/RowExpandEditor/department-editor/pc-editor.js +19 -14
  204. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +20 -34
  205. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +21 -35
  206. package/lib/RowExpandEditor/duration-editor/mb-editor.js +10 -17
  207. package/lib/RowExpandEditor/duration-editor/pc-editor.js +13 -19
  208. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +9 -19
  209. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +13 -24
  210. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +18 -31
  211. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +16 -23
  212. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +17 -29
  213. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +13 -26
  214. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +15 -25
  215. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +13 -23
  216. package/lib/RowExpandEditor/index.js +4 -8
  217. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +17 -18
  218. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +10 -16
  219. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +16 -23
  220. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +11 -19
  221. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +22 -33
  222. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +8 -14
  223. package/lib/RowExpandEditor/number-editor/pc-editor.js +13 -20
  224. package/lib/RowExpandEditor/rate-editor/mb-editor.js +12 -25
  225. package/lib/RowExpandEditor/rate-editor/pc-editor.js +20 -36
  226. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +17 -28
  227. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +22 -34
  228. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +4 -5
  229. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +15 -26
  230. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +5 -13
  231. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +9 -18
  232. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +2 -4
  233. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +2 -4
  234. package/lib/RowExpandFormatter/email-formatter/index.js +4 -7
  235. package/lib/RowExpandFormatter/file-formatter/index.js +8 -9
  236. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +10 -12
  237. package/lib/RowExpandFormatter/formula-formatter/index.js +19 -34
  238. package/lib/RowExpandFormatter/image-formatter/index.js +9 -11
  239. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +7 -8
  240. package/lib/RowExpandFormatter/index.js +27 -41
  241. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +8 -14
  242. package/lib/RowExpandFormatter/link-formatter/index.js +11 -19
  243. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +3 -5
  244. package/lib/RowExpandFormatter/rate-formatter/index.js +11 -12
  245. package/lib/RowExpandFormatter/text/index.js +4 -5
  246. package/lib/RowExpandFormatter/url-formatter/index.js +4 -7
  247. package/lib/RowExpandView/body/index.js +22 -35
  248. package/lib/RowExpandView/column-content/index.js +3 -7
  249. package/lib/RowExpandView/index.js +42 -30
  250. package/lib/SelectItem/index.js +5 -7
  251. package/lib/SelectOptionGroup/index.js +30 -40
  252. package/lib/SelectedDepartments/index.js +7 -9
  253. package/lib/SimpleLongTextFormatter/index.js +10 -16
  254. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +3 -4
  255. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +12 -21
  256. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -4
  257. package/lib/SingleSelectEditor/index.js +1 -3
  258. package/lib/SingleSelectFormatter/index.js +8 -9
  259. package/lib/TabBar/Tab.js +14 -16
  260. package/lib/TabBar/index.js +18 -21
  261. package/lib/Tabs/index.js +1 -3
  262. package/lib/TextEditor/index.js +14 -23
  263. package/lib/TextFormatter/index.js +3 -4
  264. package/lib/TextareaItem/index.js +19 -26
  265. package/lib/Toast/index.js +3 -4
  266. package/lib/UrlFormatter/index.js +3 -4
  267. package/lib/common/editor-base.js +7 -12
  268. package/lib/hooks/common-hooks.js +2 -4
  269. package/lib/select-editor/index.js +1 -3
  270. package/lib/select-editor/mb-editor/index.js +17 -28
  271. package/lib/select-editor/pc-editor/index.js +27 -42
  272. package/lib/toaster/alert.js +6 -7
  273. package/lib/toaster/toast.js +2 -3
  274. package/lib/toaster/toastManager.js +2 -4
  275. package/lib/utils/cell.js +8 -11
  276. package/lib/utils/column-utils.js +8 -14
  277. package/lib/utils/departments.js +1 -3
  278. package/lib/utils/url.js +24 -31
  279. package/lib/utils/utils.js +2 -6
  280. package/package.json +1 -1
  281. package/lib/DTableModalHeader/index.css +0 -5
@@ -17,10 +17,8 @@ var _lang = require("../../../lang");
17
17
  var _Loading = _interopRequireDefault(require("../../../Loading"));
18
18
  require("./index.css");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
- const {
21
- Header,
22
- Body
23
- } = _MobileFullScreenPage.default;
20
+ const Header = _MobileFullScreenPage.default.Header,
21
+ Body = _MobileFullScreenPage.default.Body;
24
22
  const getInputMode = column => {
25
23
  const data = column.data;
26
24
  if (!data) return _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
@@ -41,9 +39,7 @@ class MapSelectionEditor extends _react.default.Component {
41
39
  constructor(props) {
42
40
  super(props);
43
41
  this.addMarkerByPosition = value => {
44
- const {
45
- lngLat
46
- } = value;
42
+ const lngLat = value.lngLat;
47
43
  let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
48
44
  const marker = new window.BMap.Marker(point, {
49
45
  offset: new window.BMap.Size(-2, -5)
@@ -62,11 +58,9 @@ class MapSelectionEditor extends _react.default.Component {
62
58
  const geoCoder = new window.BMap.Geocoder();
63
59
  let value = {};
64
60
  geoCoder.getLocation(point, result => {
65
- const {
66
- surroundingPois,
67
- address,
68
- point
69
- } = result;
61
+ const surroundingPois = result.surroundingPois,
62
+ address = result.address,
63
+ point = result.point;
70
64
  if (surroundingPois.length === 0) {
71
65
  value.address = address;
72
66
  value.lngLat = {
@@ -77,12 +71,10 @@ class MapSelectionEditor extends _react.default.Component {
77
71
  value.title = '';
78
72
  } else {
79
73
  const position = surroundingPois[0];
80
- const {
81
- address,
82
- title,
83
- tags,
84
- point
85
- } = position;
74
+ const address = position.address,
75
+ title = position.title,
76
+ tags = position.tags,
77
+ point = position.point;
86
78
  value.address = address || '';
87
79
  value.title = title || '';
88
80
  value.tag = tags || [];
@@ -106,17 +98,12 @@ class MapSelectionEditor extends _react.default.Component {
106
98
  if (!window.BMap.Map) return;
107
99
  setTimeout(() => {
108
100
  this.map = new window.BMap.Map('dtable-ui-mobile-geolocation-map-container');
109
- let {
110
- lng,
111
- lat,
112
- zoom
113
- } = (0, _mapEditorUtils.getInitCenter)();
114
- const {
115
- value
116
- } = this.state;
117
- const {
118
- lngLat
119
- } = value;
101
+ let _getInitCenter = (0, _mapEditorUtils.getInitCenter)(),
102
+ lng = _getInitCenter.lng,
103
+ lat = _getInitCenter.lat,
104
+ zoom = _getInitCenter.zoom;
105
+ const value = this.state.value;
106
+ const lngLat = value.lngLat;
120
107
  if ((0, _cell.isValidPosition)(lngLat.lng, lngLat.lat)) {
121
108
  lng = lngLat.lng;
122
109
  lat = lngLat.lat;
@@ -135,11 +122,9 @@ class MapSelectionEditor extends _react.default.Component {
135
122
  const point = event.point;
136
123
  const geoCoder = new window.BMap.Geocoder();
137
124
  geoCoder.getLocation(point, result => {
138
- const {
139
- surroundingPois,
140
- address,
141
- point
142
- } = result;
125
+ const surroundingPois = result.surroundingPois,
126
+ address = result.address,
127
+ point = result.point;
143
128
  if (surroundingPois.length === 0) {
144
129
  value.address = address;
145
130
  value.lngLat = {
@@ -150,12 +135,10 @@ class MapSelectionEditor extends _react.default.Component {
150
135
  value.title = '';
151
136
  } else {
152
137
  const position = surroundingPois[0];
153
- const {
154
- address,
155
- title,
156
- tags,
157
- point
158
- } = position;
138
+ const address = position.address,
139
+ title = position.title,
140
+ tags = position.tags,
141
+ point = position.point;
159
142
  value.address = address || '';
160
143
  value.title = title || '';
161
144
  value.tag = tags || [];
@@ -185,11 +168,9 @@ class MapSelectionEditor extends _react.default.Component {
185
168
  const geoCoder = new window.BMap.Geocoder();
186
169
  geoCoder.getLocation(point, result => {
187
170
  let value = {};
188
- const {
189
- surroundingPois,
190
- address,
191
- point
192
- } = result;
171
+ const surroundingPois = result.surroundingPois,
172
+ address = result.address,
173
+ point = result.point;
193
174
  if (surroundingPois.length === 0) {
194
175
  value.address = address;
195
176
  value.lngLat = {
@@ -200,12 +181,10 @@ class MapSelectionEditor extends _react.default.Component {
200
181
  value.title = '';
201
182
  } else {
202
183
  const position = surroundingPois[0];
203
- const {
204
- address,
205
- title,
206
- tags,
207
- point
208
- } = position;
184
+ const address = position.address,
185
+ title = position.title,
186
+ tags = position.tags,
187
+ point = position.point;
209
188
  value.address = address || '';
210
189
  value.title = title || '';
211
190
  value.tag = tags || [];
@@ -260,9 +239,7 @@ class MapSelectionEditor extends _react.default.Component {
260
239
  });
261
240
  };
262
241
  this.onCommit = () => {
263
- const {
264
- value
265
- } = this.state;
242
+ const value = this.state.value;
266
243
  const isEmptyMapSelection = this.isEmptySelection(value);
267
244
  this.props.onCommit(isEmptyMapSelection ? '' : value);
268
245
  };
@@ -270,9 +247,7 @@ class MapSelectionEditor extends _react.default.Component {
270
247
  this.props.onToggle();
271
248
  };
272
249
  this.onFillIn = () => {
273
- const {
274
- selectedSelection
275
- } = this.state;
250
+ const selectedSelection = this.state.selectedSelection;
276
251
  this.setState({
277
252
  value: selectedSelection,
278
253
  isShowLabel: false
@@ -292,9 +267,7 @@ class MapSelectionEditor extends _react.default.Component {
292
267
  };
293
268
  this.onSearch = e => {
294
269
  e.stopPropagation();
295
- const {
296
- inputValue
297
- } = this.state;
270
+ const inputValue = this.state.inputValue;
298
271
  if (!inputValue) return;
299
272
  const options = {
300
273
  onSearchComplete: results => {
@@ -327,9 +300,7 @@ class MapSelectionEditor extends _react.default.Component {
327
300
  local.search(inputValue);
328
301
  };
329
302
  this.renderSearchResult = () => {
330
- const {
331
- searchResults
332
- } = this.state;
303
+ const searchResults = this.state.searchResults;
333
304
  if (searchResults.length === 0) return null;
334
305
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
335
306
  className: "dtable-ui-mobile-map-selection-editor-search-results",
@@ -349,14 +320,10 @@ class MapSelectionEditor extends _react.default.Component {
349
320
  });
350
321
  };
351
322
  this.renderLabel = () => {
352
- const {
353
- selectedSelection
354
- } = this.state;
355
- const {
356
- address,
357
- title,
358
- tag
359
- } = selectedSelection;
323
+ const selectedSelection = this.state.selectedSelection;
324
+ const address = selectedSelection.address,
325
+ title = selectedSelection.title,
326
+ tag = selectedSelection.tag;
360
327
  const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
361
328
  if (title) {
362
329
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -406,12 +373,11 @@ class MapSelectionEditor extends _react.default.Component {
406
373
  });
407
374
  };
408
375
  this.renderMap = () => {
409
- const {
410
- isLoading,
411
- inputValue,
412
- isShowSearchView,
413
- isShowLabel
414
- } = this.state;
376
+ const _this$state = this.state,
377
+ isLoading = _this$state.isLoading,
378
+ inputValue = _this$state.inputValue,
379
+ isShowSearchView = _this$state.isShowSearchView,
380
+ isShowLabel = _this$state.isShowLabel;
415
381
  if (isLoading) return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
416
382
  className: "w-100 h-100 d-flex align-items-center justify-content-center",
417
383
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {})
@@ -490,16 +456,13 @@ class MapSelectionEditor extends _react.default.Component {
490
456
  }), isShowLabel && this.renderLabel()]
491
457
  });
492
458
  };
493
- const {
494
- value: _value,
495
- config,
496
- column
497
- } = props;
459
+ const _value = props.value,
460
+ config = props.config,
461
+ column = props.column;
498
462
  const oldValue = _value || {};
499
- const {
500
- mapType,
501
- mapKey
502
- } = (0, _mapEditorUtils.getMapInfo)(config);
463
+ const _getMapInfo = (0, _mapEditorUtils.getMapInfo)(config),
464
+ mapType = _getMapInfo.mapType,
465
+ mapKey = _getMapInfo.mapKey;
503
466
  this.mapType = mapType;
504
467
  this.mapKey = mapKey;
505
468
  const mode = getInputMode(column);
@@ -542,9 +505,7 @@ class MapSelectionEditor extends _react.default.Component {
542
505
  this.map = null;
543
506
  }
544
507
  render() {
545
- const {
546
- column
547
- } = this.props;
508
+ const column = this.props.column;
548
509
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MobileFullScreenPage.default, {
549
510
  className: "dtable-ui-mobile-geolocation-map-selection-editor",
550
511
  onClose: this.onClose,
@@ -1,31 +1,34 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
10
  var _react = _interopRequireWildcard(require("react"));
10
11
  var _Picker = _interopRequireDefault(require("../../Picker"));
11
12
  var _List = _interopRequireDefault(require("../../List"));
12
13
  var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
13
14
  var _lang = require("../../lang");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
- const {
16
- Header,
17
- Body
18
- } = _MobileFullScreenPage.default;
16
+ const Header = _MobileFullScreenPage.default.Header,
17
+ Body = _MobileFullScreenPage.default.Body;
19
18
  const ProvinceCityEditor = _ref => {
20
- let {
21
- column,
22
- value: oldValue,
23
- getData,
24
- onToggle,
25
- onCommit
26
- } = _ref;
27
- const [value, setValue] = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city) || '']);
28
- const [isLoading, setLoading] = (0, _react.useState)(true);
19
+ let column = _ref.column,
20
+ oldValue = _ref.value,
21
+ getData = _ref.getData,
22
+ onToggle = _ref.onToggle,
23
+ onCommit = _ref.onCommit;
24
+ const _useState = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city) || '']),
25
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
26
+ value = _useState2[0],
27
+ setValue = _useState2[1];
28
+ const _useState3 = (0, _react.useState)(true),
29
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
30
+ isLoading = _useState4[0],
31
+ setLoading = _useState4[1];
29
32
  const locations = (0, _react.useRef)([]);
30
33
  (0, _react.useEffect)(() => {
31
34
  getData().then(data => {
@@ -1,31 +1,34 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
9
10
  var _react = _interopRequireWildcard(require("react"));
10
11
  var _Picker = _interopRequireDefault(require("../../Picker"));
11
12
  var _List = _interopRequireDefault(require("../../List"));
12
13
  var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
13
14
  var _lang = require("../../lang");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
- const {
16
- Header,
17
- Body
18
- } = _MobileFullScreenPage.default;
16
+ const Header = _MobileFullScreenPage.default.Header,
17
+ Body = _MobileFullScreenPage.default.Body;
19
18
  const ProvinceEditor = _ref => {
20
- let {
21
- column,
22
- value: oldValue,
23
- getData,
24
- onToggle,
25
- onCommit
26
- } = _ref;
27
- const [value, setValue] = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '']);
28
- const [isLoading, setLoading] = (0, _react.useState)(true);
19
+ let column = _ref.column,
20
+ oldValue = _ref.value,
21
+ getData = _ref.getData,
22
+ onToggle = _ref.onToggle,
23
+ onCommit = _ref.onCommit;
24
+ const _useState = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '']),
25
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
26
+ value = _useState2[0],
27
+ setValue = _useState2[1];
28
+ const _useState3 = (0, _react.useState)(true),
29
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
30
+ isLoading = _useState4[0],
31
+ setLoading = _useState4[1];
29
32
  const locations = (0, _react.useRef)([]);
30
33
  (0, _react.useEffect)(() => {
31
34
  getData().then(data => {
@@ -31,9 +31,7 @@ class CountryEditor extends _react.Component {
31
31
  this.onDownArrow = e => {
32
32
  e.preventDefault();
33
33
  e.stopPropagation();
34
- let {
35
- highlightIndexes
36
- } = this.state;
34
+ let highlightIndexes = this.state.highlightIndexes;
37
35
  const continents = Object.keys(this.filteredCountry);
38
36
  if (continents.length === 0) return;
39
37
  const continent = continents[highlightIndexes[0]];
@@ -55,9 +53,7 @@ class CountryEditor extends _react.Component {
55
53
  this.onUpArrow = e => {
56
54
  e.preventDefault();
57
55
  e.stopPropagation();
58
- let {
59
- highlightIndexes
60
- } = this.state;
56
+ let highlightIndexes = this.state.highlightIndexes;
61
57
  const continents = Object.keys(this.filteredCountry);
62
58
  if (continents.length === 0) return;
63
59
  if (highlightIndexes[1] === 0 && highlightIndexes[0] !== 0) {
@@ -95,9 +91,7 @@ class CountryEditor extends _react.Component {
95
91
  });
96
92
  this.props.onSubmit();
97
93
  } else {
98
- const {
99
- highlightIndexes
100
- } = this.state;
94
+ const highlightIndexes = this.state.highlightIndexes;
101
95
  const continents = Object.keys(this.filteredCountry);
102
96
  if (continents.length > 0) {
103
97
  const continent = continents[highlightIndexes[0]];
@@ -117,9 +111,7 @@ class CountryEditor extends _react.Component {
117
111
  };
118
112
  this.onMenuMouseLeave = (continentIndex, countryIndex) => {
119
113
  this.timer = setTimeout(() => {
120
- const {
121
- highlightIndexes
122
- } = this.state;
114
+ const highlightIndexes = this.state.highlightIndexes;
123
115
  if (highlightIndexes[0] === continentIndex && highlightIndexes[1] === countryIndex) {
124
116
  this.setState({
125
117
  highlightIndexes: [0, -1]
@@ -152,10 +144,9 @@ class CountryEditor extends _react.Component {
152
144
  return continentsList;
153
145
  };
154
146
  this.createCountryList = (continent, continentIndex) => {
155
- const {
156
- value,
157
- highlightIndexes
158
- } = this.state;
147
+ const _this$state = this.state,
148
+ value = _this$state.value,
149
+ highlightIndexes = _this$state.highlightIndexes;
159
150
  let countryList = this.filteredCountry[continent].map((country, index) => {
160
151
  const isHighlight = highlightIndexes[0] === continentIndex && highlightIndexes[1] === index;
161
152
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -222,10 +213,8 @@ class CountryEditor extends _react.Component {
222
213
  }
223
214
  };
224
215
  this.countryReg = null;
225
- const {
226
- column,
227
- value: _value
228
- } = props;
216
+ const column = props.column,
217
+ _value = props.value;
229
218
  const columnData = column.data || {};
230
219
  this.lang = columnData.lang === 'cn' ? 'cn' : 'en';
231
220
  this.state = {
@@ -257,9 +246,7 @@ class CountryEditor extends _react.Component {
257
246
  }
258
247
  }
259
248
  render() {
260
- const {
261
- isLoadingData
262
- } = this.state;
249
+ const isLoadingData = this.state.isLoadingData;
263
250
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
264
251
  className: "dtable-ui-geolocation-country-editor",
265
252
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -48,9 +48,7 @@ class PCGeolocationEditor extends _react.default.Component {
48
48
  this.props.onToggle && this.props.onToggle();
49
49
  };
50
50
  this.setEditorPosition = () => {
51
- const {
52
- isInModal
53
- } = this.props;
51
+ const isInModal = this.props.isInModal;
54
52
  const editorFormat = this.getGeoFormat();
55
53
  if (this.ref && (editorFormat === _dtableUtils.GEOLOCATION_FORMAT.COUNTRY_REGION || editorFormat === _dtableUtils.GEOLOCATION_FORMAT.PROVINCE)) {
56
54
  let height = 240;
@@ -116,10 +114,9 @@ class PCGeolocationEditor extends _react.default.Component {
116
114
  geoEditorTop = height + geoEditorTop > innerHeight ? innerHeight - height - 30 : geoEditorTop;
117
115
  geoEditorLeft = -30;
118
116
  } else {
119
- let {
120
- offsetLeft,
121
- offsetTop
122
- } = this.ref.parentNode;
117
+ let _this$ref$parentNode = this.ref.parentNode,
118
+ offsetLeft = _this$ref$parentNode.offsetLeft,
119
+ offsetTop = _this$ref$parentNode.offsetTop;
123
120
  geoEditorLeft = offsetLeft - width;
124
121
  geoEditorTop = offsetTop;
125
122
  if (offsetLeft < width) {
@@ -143,9 +140,7 @@ class PCGeolocationEditor extends _react.default.Component {
143
140
  }
144
141
  };
145
142
  this.getGeoFormat = () => {
146
- const {
147
- column
148
- } = this.props;
143
+ const column = this.props.column;
149
144
  let data = column.data || {};
150
145
  return data.geo_format ? data.geo_format : _dtableUtils.DEFAULT_GEOLOCATION_FORMAT;
151
146
  };
@@ -155,13 +150,12 @@ class PCGeolocationEditor extends _react.default.Component {
155
150
  };
156
151
  this.createEditor = () => {
157
152
  const geoFormat = this.getGeoFormat();
158
- const {
159
- config,
160
- column,
161
- getCountryData,
162
- getLocationData,
163
- toggleLargeMap
164
- } = this.props;
153
+ const _this$props = this.props,
154
+ config = _this$props.config,
155
+ column = _this$props.column,
156
+ getCountryData = _this$props.getCountryData,
157
+ getLocationData = _this$props.getLocationData,
158
+ toggleLargeMap = _this$props.toggleLargeMap;
165
159
  const props = {
166
160
  column,
167
161
  config,
@@ -239,9 +233,7 @@ class PCGeolocationEditor extends _react.default.Component {
239
233
  document.removeEventListener('keydown', this.onHotKey, true);
240
234
  }
241
235
  render() {
242
- const {
243
- editorPosition
244
- } = this.state;
236
+ const editorPosition = this.state.editorPosition;
245
237
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
246
238
  ref: ref => this.ref = ref,
247
239
  style: editorPosition,
@@ -13,7 +13,7 @@ var _selectorList = _interopRequireDefault(require("./selector-list"));
13
13
  var _selectorHeaderItem = _interopRequireDefault(require("./selector-header-item"));
14
14
  var _constants = require("../../constants");
15
15
  var _Loading = _interopRequireDefault(require("../../Loading"));
16
- var _parseGeolocation = _interopRequireDefault(require("./parse-geolocation"));
16
+ var _parseGeolocation2 = _interopRequireDefault(require("./parse-geolocation"));
17
17
  var _lang = require("../../lang");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  class LocationEditor extends _react.Component {
@@ -116,10 +116,9 @@ class LocationEditor extends _react.Component {
116
116
  this.props.setValue(this.value);
117
117
  };
118
118
  this.selectSelectorType = type => {
119
- const {
120
- selectedProvince,
121
- selectedCity
122
- } = this.state;
119
+ const _this$state = this.state,
120
+ selectedProvince = _this$state.selectedProvince,
121
+ selectedCity = _this$state.selectedCity;
123
122
  if (!selectedProvince) return;
124
123
  if (type === 'county' && !selectedCity) return;
125
124
  this.setState({
@@ -146,12 +145,11 @@ class LocationEditor extends _react.Component {
146
145
  this.timer = null;
147
146
  const value = this.parseRef.value;
148
147
  if (this.isComposing) return;
149
- const {
150
- province,
151
- city,
152
- district,
153
- detail
154
- } = (0, _parseGeolocation.default)(this.locations, value);
148
+ const _parseGeolocation = (0, _parseGeolocation2.default)(this.locations, value),
149
+ province = _parseGeolocation.province,
150
+ city = _parseGeolocation.city,
151
+ district = _parseGeolocation.district,
152
+ detail = _parseGeolocation.detail;
155
153
  if (this.detailInfo) {
156
154
  this.detailInfo.value = detail || '';
157
155
  this.value = Object.assign({}, this.value, {
@@ -173,11 +171,10 @@ class LocationEditor extends _react.Component {
173
171
  this.isComposing = false;
174
172
  };
175
173
  this.onSubmit = () => {
176
- const {
177
- province,
178
- city,
179
- district
180
- } = this.value;
174
+ const _this$value = this.value,
175
+ province = _this$value.province,
176
+ city = _this$value.city,
177
+ district = _this$value.district;
181
178
  if (!province || !city || !district) {
182
179
  const errMessage = (0, _lang.getLocale)('Province/City/District_must_be_filled_in');
183
180
  this.setState({
@@ -205,12 +202,11 @@ class LocationEditor extends _react.Component {
205
202
  UNSAFE_componentWillMount() {
206
203
  this.props.getData().then(data => {
207
204
  this.locations = data;
208
- const {
209
- selectedProvince,
210
- selectedCity,
211
- selectedCounty,
212
- selectedItem
213
- } = this.initLocationSelecting(this.value);
205
+ const _this$initLocationSel = this.initLocationSelecting(this.value),
206
+ selectedProvince = _this$initLocationSel.selectedProvince,
207
+ selectedCity = _this$initLocationSel.selectedCity,
208
+ selectedCounty = _this$initLocationSel.selectedCounty,
209
+ selectedItem = _this$initLocationSel.selectedItem;
214
210
  this.setState({
215
211
  isLoadingData: false,
216
212
  selectedProvince,
@@ -221,15 +217,14 @@ class LocationEditor extends _react.Component {
221
217
  });
222
218
  }
223
219
  render() {
224
- const {
225
- selectedItem,
226
- selectedCity,
227
- selectedProvince,
228
- selectedCounty,
229
- isShowSelector,
230
- isLoadingData,
231
- location
232
- } = this.state;
220
+ const _this$state2 = this.state,
221
+ selectedItem = _this$state2.selectedItem,
222
+ selectedCity = _this$state2.selectedCity,
223
+ selectedProvince = _this$state2.selectedProvince,
224
+ selectedCounty = _this$state2.selectedCounty,
225
+ isShowSelector = _this$state2.isShowSelector,
226
+ isLoadingData = _this$state2.isLoadingData,
227
+ location = _this$state2.location;
233
228
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
234
229
  children: [!isLoadingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
235
230
  onClick: this.onClick,