dtable-ui-component 7.0.13 → 7.0.15

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 (308) hide show
  1. package/lib/ActionSheet/index.js +58 -49
  2. package/lib/ActivityIndicator/index.js +17 -16
  3. package/lib/AsyncUserSelect/index.js +20 -46
  4. package/lib/AsyncUserSelect/user-item.js +6 -5
  5. package/lib/AutoNumberFormatter/index.js +4 -3
  6. package/lib/Badge/index.js +27 -29
  7. package/lib/ButtonFormatter/index.js +8 -6
  8. package/lib/CTimeFormatter/index.js +4 -3
  9. package/lib/CheckboxEditor/index.js +16 -13
  10. package/lib/CheckboxEditor/mb-editor.js +20 -9
  11. package/lib/CheckboxEditor/pc-editor.js +24 -12
  12. package/lib/CheckboxFormatter/index.js +5 -4
  13. package/lib/CollaboratorEditor/index.js +17 -14
  14. package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
  15. package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
  16. package/lib/CollaboratorFormatter/index.js +10 -8
  17. package/lib/CollaboratorItem/index.js +5 -4
  18. package/lib/CollapsibleSettingLayout/index.js +8 -10
  19. package/lib/Comment/body/comment.js +19 -11
  20. package/lib/Comment/body/index.js +8 -8
  21. package/lib/Comment/footer/btns/index.js +7 -4
  22. package/lib/Comment/footer/index.js +21 -10
  23. package/lib/Comment/footer/input/index.js +55 -34
  24. package/lib/Comment/footer/input/participant/index.js +6 -5
  25. package/lib/Comment/footer/participants/index.js +5 -4
  26. package/lib/Comment/footer/participants/participant/index.js +3 -1
  27. package/lib/Comment/footer/participants/participant-select/index.js +26 -10
  28. package/lib/Comment/index.js +57 -39
  29. package/lib/Comment/utils/utilities.js +22 -16
  30. package/lib/CreatorFormatter/index.js +8 -6
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
  32. package/lib/DTableColorPicker/index.js +53 -67
  33. package/lib/DTableColorPicker/utils.js +7 -5
  34. package/lib/DTableColumnIcon/index.js +7 -6
  35. package/lib/DTableCommonAddTool/index.js +10 -8
  36. package/lib/DTableCustomFooter/index.js +3 -1
  37. package/lib/DTableCustomizeSearchInput/index.js +41 -26
  38. package/lib/DTableCustomizeSelect/index.js +24 -19
  39. package/lib/DTableDropdownItem/index.js +28 -24
  40. package/lib/DTableDropdownMenu/index.js +17 -14
  41. package/lib/DTableEmptyTip/index.js +5 -4
  42. package/lib/DTableFiltersPopover/index.js +42 -27
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
  44. package/lib/DTableFiltersPopover/utils/index.js +114 -64
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
  53. package/lib/DTableIcon/index.js +11 -10
  54. package/lib/DTableIcon/svg-icon.js +11 -9
  55. package/lib/DTableModalHeader/index.js +7 -7
  56. package/lib/DTablePopover/index.js +16 -12
  57. package/lib/DTableRadio/index.js +9 -10
  58. package/lib/DTableRadioGroup/index.js +20 -11
  59. package/lib/DTableSearchInput/index.js +29 -19
  60. package/lib/DTableSelect/dtable-select-label.js +6 -7
  61. package/lib/DTableSelect/index.js +26 -25
  62. package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
  63. package/lib/DTableSelect/utils.js +83 -47
  64. package/lib/DTableSubDropdownMenu/index.js +16 -12
  65. package/lib/DTableSubDropdownToggle/index.js +16 -17
  66. package/lib/DTableSwitch/index.js +11 -12
  67. package/lib/DTableToolTip/index.js +12 -11
  68. package/lib/DateEditor/index.js +28 -30
  69. package/lib/DateEditor/mb-editor/index.js +31 -18
  70. package/lib/DateEditor/pc-editor.js +46 -27
  71. package/lib/DateFormatter/index.js +5 -4
  72. package/lib/DatePicker/index.js +15 -9
  73. package/lib/DatePicker/utils.js +7 -5
  74. package/lib/DeleteTip/index.js +6 -5
  75. package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
  76. package/lib/DepartmentSelectFilter/index.js +13 -8
  77. package/lib/DepartmentSingleSelectEditor/index.js +16 -13
  78. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
  79. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
  81. package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
  82. package/lib/DigitalSignEditor/index.js +16 -13
  83. package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
  84. package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
  85. package/lib/DigitalSignEditor/service.js +5 -3
  86. package/lib/DigitalSignEditor/signature-board/index.js +10 -7
  87. package/lib/DigitalSignEditor/utils.js +4 -2
  88. package/lib/DigitalSignFormatter/index.js +15 -12
  89. package/lib/DigitalSignFormatter/utils.js +6 -5
  90. package/lib/Drawer/index.js +3 -2
  91. package/lib/DurationEditor/index.js +31 -21
  92. package/lib/DurationFormatter/index.js +5 -4
  93. package/lib/EditEditorButton/index.js +3 -1
  94. package/lib/EmailFormatter/index.js +4 -3
  95. package/lib/FieldDisplaySetting/field-item.js +13 -13
  96. package/lib/FieldDisplaySetting/index.js +20 -20
  97. package/lib/FileEditor/files-previewer/index.js +16 -13
  98. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
  99. package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
  102. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
  103. package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
  104. package/lib/FileEditor/index.js +16 -13
  105. package/lib/FileEditor/mb-editor/index.js +20 -28
  106. package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
  107. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
  108. package/lib/FileEditor/pc-editor/index.js +30 -22
  109. package/lib/FileFormatter/index.js +20 -27
  110. package/lib/FileItemFormatter/index.js +10 -7
  111. package/lib/FileUploader/index.js +46 -29
  112. package/lib/FormulaFormatter/index.js +44 -24
  113. package/lib/GeolocationEditor/index.js +32 -27
  114. package/lib/GeolocationEditor/map-editor-utils.js +23 -21
  115. package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
  116. package/lib/GeolocationEditor/mb-editor/index.js +28 -22
  117. package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
  118. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
  119. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
  120. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
  121. package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
  122. package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
  123. package/lib/GeolocationEditor/pc-editor/index.js +41 -27
  124. package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
  125. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
  126. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
  128. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
  129. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
  130. package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
  131. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
  132. package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
  133. package/lib/GeolocationFormatter/index.js +5 -4
  134. package/lib/HtmlLongTextFormatter/index.js +13 -5
  135. package/lib/Icon/index.js +13 -15
  136. package/lib/Icon/load-sprite.js +13 -2
  137. package/lib/IconButton/index.js +12 -13
  138. package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
  139. package/lib/ImageEditor/images-previewer/index.js +9 -3
  140. package/lib/ImageEditor/index.js +16 -13
  141. package/lib/ImageEditor/mb-editor/index.js +20 -28
  142. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
  143. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
  144. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
  145. package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
  146. package/lib/ImageEditor/pc-editor/index.js +16 -11
  147. package/lib/ImageFormatter/images-lazy-load.js +11 -19
  148. package/lib/ImageFormatter/index.js +14 -12
  149. package/lib/ImagePreviewerLightbox/index.js +15 -19
  150. package/lib/ImageThumbnail/index.js +15 -12
  151. package/lib/InputItem/custom-input.js +55 -35
  152. package/lib/InputItem/custom-keyboard.js +42 -42
  153. package/lib/InputItem/index.js +82 -63
  154. package/lib/InputItem/input.js +9 -11
  155. package/lib/LastModifierFormatter/index.js +8 -6
  156. package/lib/LinkEditor/index.js +53 -33
  157. package/lib/LinkEditor/link-editor-option.js +4 -3
  158. package/lib/LinkEditor/mb-popover/index.js +22 -9
  159. package/lib/LinkEditor/pc-popover/index.js +13 -7
  160. package/lib/LinkFormatter/index.js +37 -21
  161. package/lib/List/index.js +17 -19
  162. package/lib/List/list-item.js +59 -55
  163. package/lib/LongTextFormatter/index.js +5 -4
  164. package/lib/MBEditorHeader/index.js +9 -8
  165. package/lib/MTimeFormatter/index.js +4 -3
  166. package/lib/MobileFullScreenPage/body/index.js +6 -4
  167. package/lib/MobileFullScreenPage/header/index.js +10 -8
  168. package/lib/MobileFullScreenPage/index.js +12 -14
  169. package/lib/MobileModal/index.js +7 -8
  170. package/lib/MobileOperationSheet/index.js +8 -7
  171. package/lib/MobileSelector/empty/index.js +3 -1
  172. package/lib/MobileSelector/index.js +7 -5
  173. package/lib/MobileSelector/option/index.js +5 -3
  174. package/lib/MobileSelector/options/index.css +0 -4
  175. package/lib/MobileSelector/options/index.js +3 -1
  176. package/lib/MobileSelector/search/index.js +5 -3
  177. package/lib/MobileUpload/index.js +5 -4
  178. package/lib/Modal/alert.js +2 -2
  179. package/lib/Modal/modal.js +28 -30
  180. package/lib/Modal/prompt.js +14 -14
  181. package/lib/MultipleSelectEditor/index.js +7 -7
  182. package/lib/MultipleSelectFormatter/index.js +9 -7
  183. package/lib/NotificationPopover/index.js +5 -4
  184. package/lib/NumberEditor/index.js +21 -12
  185. package/lib/NumberFormatter/index.js +5 -4
  186. package/lib/PhoneNumberLink/index.js +5 -3
  187. package/lib/Picker/AbstractPicker.js +35 -33
  188. package/lib/Popover/index.js +9 -11
  189. package/lib/Popover/item.js +22 -24
  190. package/lib/Progress/index.js +18 -17
  191. package/lib/Radio/Radio.js +17 -15
  192. package/lib/Radio/RadioItem.js +23 -19
  193. package/lib/RateFormatter/index.js +15 -15
  194. package/lib/RoleStatusEditor/index.js +18 -19
  195. package/lib/RowExpand/index.js +7 -6
  196. package/lib/RowExpandDialog/body/index.js +57 -40
  197. package/lib/RowExpandDialog/column-content/index.js +10 -6
  198. package/lib/RowExpandDialog/header/index.js +12 -9
  199. package/lib/RowExpandDialog/index.js +59 -63
  200. package/lib/RowExpandEditor/add-btn/index.js +7 -6
  201. package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
  202. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
  203. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
  204. package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
  205. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
  206. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
  207. package/lib/RowExpandEditor/date-editor/index.js +7 -6
  208. package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
  209. package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
  210. package/lib/RowExpandEditor/department-editor/index.js +7 -6
  211. package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
  212. package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
  213. package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
  214. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
  215. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
  216. package/lib/RowExpandEditor/duration-editor/index.js +7 -6
  217. package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
  218. package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
  219. package/lib/RowExpandEditor/email-editor/index.js +7 -6
  220. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
  221. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
  222. package/lib/RowExpandEditor/file-editor/index.js +7 -6
  223. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
  224. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
  225. package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
  226. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
  227. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
  228. package/lib/RowExpandEditor/image-editor/index.js +7 -6
  229. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
  230. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
  231. package/lib/RowExpandEditor/index.js +16 -11
  232. package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
  233. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
  234. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
  235. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
  236. package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
  237. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
  238. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
  239. package/lib/RowExpandEditor/number-editor/index.js +7 -6
  240. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
  241. package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
  242. package/lib/RowExpandEditor/rate-editor/index.js +7 -6
  243. package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
  244. package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
  245. package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
  246. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
  247. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
  248. package/lib/RowExpandEditor/text-editor/index.js +7 -6
  249. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
  250. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
  251. package/lib/RowExpandEditor/url-editor/index.js +7 -6
  252. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
  253. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
  254. package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
  255. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
  256. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
  257. package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
  258. package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
  259. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
  260. package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
  261. package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
  262. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
  263. package/lib/RowExpandFormatter/index.js +52 -34
  264. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
  265. package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
  266. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
  267. package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
  268. package/lib/RowExpandFormatter/text/index.js +5 -4
  269. package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
  270. package/lib/RowExpandView/body/index.js +43 -32
  271. package/lib/RowExpandView/column-content/index.js +7 -3
  272. package/lib/RowExpandView/index.js +52 -53
  273. package/lib/SelectItem/index.js +7 -5
  274. package/lib/SelectOptionGroup/index.js +40 -30
  275. package/lib/SelectedDepartments/index.js +12 -10
  276. package/lib/SimpleLongTextFormatter/index.js +18 -12
  277. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
  278. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
  279. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
  280. package/lib/SingleSelectEditor/index.js +7 -7
  281. package/lib/SingleSelectFormatter/index.js +9 -8
  282. package/lib/TabBar/Tab.js +26 -24
  283. package/lib/TabBar/index.js +28 -24
  284. package/lib/Tabs/index.js +13 -10
  285. package/lib/TextEditor/index.js +23 -14
  286. package/lib/TextFormatter/index.js +4 -3
  287. package/lib/TextareaItem/index.js +53 -48
  288. package/lib/Toast/index.js +9 -8
  289. package/lib/UrlFormatter/index.js +4 -3
  290. package/lib/common/editor-base.js +12 -7
  291. package/lib/formatterConfig/index.js +3 -3
  292. package/lib/hooks/common-hooks.js +4 -2
  293. package/lib/select-editor/index.js +16 -13
  294. package/lib/select-editor/mb-editor/index.js +28 -17
  295. package/lib/select-editor/pc-editor/index.js +47 -32
  296. package/lib/toaster/alert.js +8 -7
  297. package/lib/toaster/toast.js +4 -3
  298. package/lib/toaster/toastManager.js +13 -13
  299. package/lib/toaster/toaster.js +12 -9
  300. package/lib/utils/cell.js +11 -8
  301. package/lib/utils/class.js +3 -3
  302. package/lib/utils/column-utils.js +14 -8
  303. package/lib/utils/departments.js +6 -5
  304. package/lib/utils/getLocale.js +11 -5
  305. package/lib/utils/object-utils.js +5 -4
  306. package/lib/utils/url.js +29 -22
  307. package/lib/utils/utils.js +6 -2
  308. package/package.json +2 -2
@@ -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 _parseGeolocation2 = _interopRequireDefault(require("./parse-geolocation"));
16
+ var _parseGeolocation = _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,9 +116,10 @@ class LocationEditor extends _react.Component {
116
116
  this.props.setValue(this.value);
117
117
  };
118
118
  this.selectSelectorType = type => {
119
- const _this$state = this.state,
120
- selectedProvince = _this$state.selectedProvince,
121
- selectedCity = _this$state.selectedCity;
119
+ const {
120
+ selectedProvince,
121
+ selectedCity
122
+ } = this.state;
122
123
  if (!selectedProvince) return;
123
124
  if (type === 'county' && !selectedCity) return;
124
125
  this.setState({
@@ -145,11 +146,12 @@ class LocationEditor extends _react.Component {
145
146
  this.timer = null;
146
147
  const value = this.parseRef.value;
147
148
  if (this.isComposing) return;
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;
149
+ const {
150
+ province,
151
+ city,
152
+ district,
153
+ detail
154
+ } = (0, _parseGeolocation.default)(this.locations, value);
153
155
  if (this.detailInfo) {
154
156
  this.detailInfo.value = detail || '';
155
157
  this.value = Object.assign({}, this.value, {
@@ -171,10 +173,11 @@ class LocationEditor extends _react.Component {
171
173
  this.isComposing = false;
172
174
  };
173
175
  this.onSubmit = () => {
174
- const _this$value = this.value,
175
- province = _this$value.province,
176
- city = _this$value.city,
177
- district = _this$value.district;
176
+ const {
177
+ province,
178
+ city,
179
+ district
180
+ } = this.value;
178
181
  if (!province || !city || !district) {
179
182
  const errMessage = (0, _lang.getLocale)('Province/City/District_must_be_filled_in');
180
183
  this.setState({
@@ -188,7 +191,7 @@ class LocationEditor extends _react.Component {
188
191
  this.locations = {};
189
192
  this.state = {
190
193
  isShowSelector: false,
191
- location: "".concat(this.value.province || '').concat(this.value.city || '').concat(this.value.district || ''),
194
+ location: `${this.value.province || ''}${this.value.city || ''}${this.value.district || ''}`,
192
195
  selectedProvince: null,
193
196
  selectedCity: null,
194
197
  selectedCounty: null,
@@ -202,11 +205,12 @@ class LocationEditor extends _react.Component {
202
205
  UNSAFE_componentWillMount() {
203
206
  this.props.getData().then(data => {
204
207
  this.locations = data;
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;
208
+ const {
209
+ selectedProvince,
210
+ selectedCity,
211
+ selectedCounty,
212
+ selectedItem
213
+ } = this.initLocationSelecting(this.value);
210
214
  this.setState({
211
215
  isLoadingData: false,
212
216
  selectedProvince,
@@ -217,14 +221,15 @@ class LocationEditor extends _react.Component {
217
221
  });
218
222
  }
219
223
  render() {
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;
224
+ const {
225
+ selectedItem,
226
+ selectedCity,
227
+ selectedProvince,
228
+ selectedCounty,
229
+ isShowSelector,
230
+ isLoadingData,
231
+ location
232
+ } = this.state;
228
233
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
229
234
  children: [!isLoadingData ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
230
235
  onClick: this.onClick,
@@ -238,7 +243,7 @@ class LocationEditor extends _react.Component {
238
243
  className: "dtable-ui-geolocation-editor-item-right",
239
244
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
240
245
  onClick: this.onToggleSelector,
241
- className: "dtable-ui-geolocation-editor-selector text-truncate ".concat(isShowSelector ? 'focus' : ''),
246
+ className: `dtable-ui-geolocation-editor-selector text-truncate ${isShowSelector ? 'focus' : ''}`,
242
247
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
243
248
  className: "selected-option-show",
244
249
  children: location ? location : (0, _lang.getLocale)('Select_province_city_district')
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
9
  var _react = _interopRequireWildcard(require("react"));
11
10
  var _dtableUtils = require("dtable-utils");
12
11
  var _toaster = _interopRequireDefault(require("../../../toaster"));
@@ -50,12 +49,13 @@ class MapEditor extends _react.Component {
50
49
  this.loadMineMapCallBack = () => {
51
50
  if (!this.timer) {
52
51
  this.timer = setTimeout(() => {
53
- const _getMineMapUrl = (0, _mapEditorUtils.getMineMapUrl)(),
54
- domainUrl = _getMineMapUrl.domainUrl,
55
- dataDomainUrl = _getMineMapUrl.dataDomainUrl,
56
- serverDomainUrl = _getMineMapUrl.serverDomainUrl,
57
- spriteUrl = _getMineMapUrl.spriteUrl,
58
- serviceUrl = _getMineMapUrl.serviceUrl;
52
+ const {
53
+ domainUrl,
54
+ dataDomainUrl,
55
+ serverDomainUrl,
56
+ spriteUrl,
57
+ serviceUrl
58
+ } = (0, _mapEditorUtils.getMineMapUrl)();
59
59
  window.minemap.domainUrl = domainUrl;
60
60
  window.minemap.dataDomainUrl = dataDomainUrl;
61
61
  window.minemap.serverDomainUrl = serverDomainUrl;
@@ -82,11 +82,14 @@ class MapEditor extends _react.Component {
82
82
  minZoom: 3,
83
83
  projection: 'MERCATOR'
84
84
  });
85
- let _getInitCenter = (0, _mapEditorUtils.getInitCenter)(),
86
- lng = _getInitCenter.lng,
87
- lat = _getInitCenter.lat,
88
- zoom = _getInitCenter.zoom;
89
- const value = this.state.value;
85
+ let {
86
+ lng,
87
+ lat,
88
+ zoom
89
+ } = (0, _mapEditorUtils.getInitCenter)();
90
+ const {
91
+ value
92
+ } = this.state;
90
93
  if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
91
94
  lng = value.lng;
92
95
  lat = value.lat;
@@ -110,11 +113,14 @@ class MapEditor extends _react.Component {
110
113
  this.map = new window.BMap.Map('geolocation-map-container', {
111
114
  enableMapClick: false
112
115
  });
113
- let _getInitCenter2 = (0, _mapEditorUtils.getInitCenter)(),
114
- lng = _getInitCenter2.lng,
115
- lat = _getInitCenter2.lat,
116
- zoom = _getInitCenter2.zoom;
117
- const value = this.state.value;
116
+ let {
117
+ lng,
118
+ lat,
119
+ zoom
120
+ } = (0, _mapEditorUtils.getInitCenter)();
121
+ const {
122
+ value
123
+ } = this.state;
118
124
  if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
119
125
  lng = value.lng;
120
126
  lat = value.lat;
@@ -133,7 +139,9 @@ class MapEditor extends _react.Component {
133
139
  };
134
140
  this.geolocationCallback = (error, point) => {
135
141
  if (!error) {
136
- this.setValue((0, _objectSpread2.default)({}, point));
142
+ this.setValue({
143
+ ...point
144
+ });
137
145
  this.addMarkerByPosition(point.lng, point.lat);
138
146
  if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP) {
139
147
  this.map.setCenter({
@@ -149,10 +157,11 @@ class MapEditor extends _react.Component {
149
157
  this.setState({
150
158
  isLoading: false
151
159
  }, () => {
152
- let _getInitCenter3 = (0, _mapEditorUtils.getInitCenter)(),
153
- lng = _getInitCenter3.lng,
154
- lat = _getInitCenter3.lat,
155
- zoom = _getInitCenter3.zoom;
160
+ let {
161
+ lng,
162
+ lat,
163
+ zoom
164
+ } = (0, _mapEditorUtils.getInitCenter)();
156
165
  this.map = new window.google.maps.Map(this.ref, {
157
166
  zoom,
158
167
  center: {
@@ -166,7 +175,9 @@ class MapEditor extends _react.Component {
166
175
  rotateControl: false,
167
176
  fullscreenControl: false
168
177
  });
169
- const value = this.state.value;
178
+ const {
179
+ value
180
+ } = this.state;
170
181
  if (value.lng && value.lat) {
171
182
  lng = value.lng;
172
183
  lat = value.lat;
@@ -201,8 +212,10 @@ class MapEditor extends _react.Component {
201
212
  });
202
213
  };
203
214
  this.setPropsValue = _ref => {
204
- let lng = _ref.lng,
205
- lat = _ref.lat;
215
+ let {
216
+ lng,
217
+ lat
218
+ } = _ref;
206
219
  if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
207
220
  this.props.setValue(null);
208
221
  return;
@@ -266,7 +279,9 @@ class MapEditor extends _react.Component {
266
279
  event.preventDefault();
267
280
  event.stopPropagation();
268
281
  event.nativeEvent.stopImmediatePropagation();
269
- const value = this.state.value;
282
+ const {
283
+ value
284
+ } = this.state;
270
285
  const numericValue = (0, _dtableUtils.normalizeMapPoint)(value);
271
286
  this.setPropsValue(numericValue);
272
287
  this.setState({
@@ -283,8 +298,10 @@ class MapEditor extends _react.Component {
283
298
  this.props.onSubmit();
284
299
  };
285
300
  this.rerenderMapMarker = _ref2 => {
286
- let lng = _ref2.lng,
287
- lat = _ref2.lat;
301
+ let {
302
+ lng,
303
+ lat
304
+ } = _ref2;
288
305
  if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) return;
289
306
  if (this.map) {
290
307
  if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP || this.mapType === _mapEditorUtils.MAP_TYPES.M_MAP) {
@@ -299,16 +316,19 @@ class MapEditor extends _react.Component {
299
316
  this.addMarkerByPosition(lng, lat);
300
317
  };
301
318
  this.onBlur = () => {
302
- const value = this.state.value;
319
+ const {
320
+ value
321
+ } = this.state;
303
322
  const numericValue = (0, _dtableUtils.normalizeMapPoint)(value);
304
323
  this.setState({
305
324
  value: numericValue
306
325
  });
307
326
  };
308
327
  this.onChangeLatitude = event => {
309
- const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
328
+ const newValue = {
329
+ ...this.state.value,
310
330
  lat: event.target.value
311
- });
331
+ };
312
332
  this.setState({
313
333
  value: newValue
314
334
  }, () => {
@@ -317,9 +337,10 @@ class MapEditor extends _react.Component {
317
337
  });
318
338
  };
319
339
  this.onChangeLongitude = event => {
320
- const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
340
+ const newValue = {
341
+ ...this.state.value,
321
342
  lng: event.target.value
322
- });
343
+ };
323
344
  this.setState({
324
345
  value: newValue
325
346
  }, () => {
@@ -351,9 +372,10 @@ class MapEditor extends _react.Component {
351
372
  lng: '',
352
373
  lat: ''
353
374
  };
354
- const _getMapInfo = (0, _mapEditorUtils.getMapInfo)(props.config),
355
- mapType = _getMapInfo.mapType,
356
- mapKey = _getMapInfo.mapKey;
375
+ const {
376
+ mapType,
377
+ mapKey
378
+ } = (0, _mapEditorUtils.getMapInfo)(props.config);
357
379
  this.mapType = mapType;
358
380
  this.mapKey = mapKey;
359
381
  this.readOnly = props.readOnly;
@@ -389,10 +411,11 @@ class MapEditor extends _react.Component {
389
411
  this.onSubmit();
390
412
  }
391
413
  render() {
392
- const _this$state = this.state,
393
- isLoading = _this$state.isLoading,
394
- lng_lat = _this$state.value,
395
- isShowLargeEditor = _this$state.isShowLargeEditor;
414
+ const {
415
+ isLoading,
416
+ value: lng_lat,
417
+ isShowLargeEditor
418
+ } = this.state;
396
419
  const lat = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lat) ? lng_lat.lat : '';
397
420
  const lng = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lng) ? lng_lat.lng : '';
398
421
  if (!isShowLargeEditor) {
@@ -492,11 +515,12 @@ class MapEditor extends _react.Component {
492
515
  })]
493
516
  });
494
517
  }
495
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props), {}, {
518
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_largeEditor.default, {
519
+ ...this.props,
496
520
  value: this.state.value,
497
521
  setValue: this.setValue,
498
522
  toggleFullScreen: this.toggleFullScreen
499
- }));
523
+ });
500
524
  }
501
525
  }
502
526
  var _default = exports.default = MapEditor;
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _reactstrap = require("reactstrap");
11
10
  var _dtableUtils = require("dtable-utils");
@@ -23,12 +22,13 @@ class LargeMapEditorDialog extends _react.default.Component {
23
22
  this.loadMineMapCallBack = () => {
24
23
  if (!this.timer) {
25
24
  this.timer = setTimeout(() => {
26
- const _getMineMapUrl = (0, _mapEditorUtils.getMineMapUrl)(),
27
- domainUrl = _getMineMapUrl.domainUrl,
28
- dataDomainUrl = _getMineMapUrl.dataDomainUrl,
29
- serverDomainUrl = _getMineMapUrl.serverDomainUrl,
30
- spriteUrl = _getMineMapUrl.spriteUrl,
31
- serviceUrl = _getMineMapUrl.serviceUrl;
25
+ const {
26
+ domainUrl,
27
+ dataDomainUrl,
28
+ serverDomainUrl,
29
+ spriteUrl,
30
+ serviceUrl
31
+ } = (0, _mapEditorUtils.getMineMapUrl)();
32
32
  window.minemap.domainUrl = domainUrl;
33
33
  window.minemap.dataDomainUrl = dataDomainUrl;
34
34
  window.minemap.serverDomainUrl = serverDomainUrl;
@@ -55,11 +55,14 @@ class LargeMapEditorDialog extends _react.default.Component {
55
55
  minZoom: 3,
56
56
  projection: 'MERCATOR'
57
57
  });
58
- let _getInitCenter = (0, _mapEditorUtils.getInitCenter)(),
59
- lng = _getInitCenter.lng,
60
- lat = _getInitCenter.lat,
61
- zoom = _getInitCenter.zoom;
62
- const value = this.state.value;
58
+ let {
59
+ lng,
60
+ lat,
61
+ zoom
62
+ } = (0, _mapEditorUtils.getInitCenter)();
63
+ const {
64
+ value
65
+ } = this.state;
63
66
  if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
64
67
  lng = value.lng;
65
68
  lat = value.lat;
@@ -81,11 +84,14 @@ class LargeMapEditorDialog extends _react.default.Component {
81
84
  }, () => {
82
85
  if (!window.BMap.Map) return;
83
86
  this.map = new window.BMap.Map('geolocation-map-container-large');
84
- let _getInitCenter2 = (0, _mapEditorUtils.getInitCenter)(),
85
- lng = _getInitCenter2.lng,
86
- lat = _getInitCenter2.lat,
87
- zoom = _getInitCenter2.zoom;
88
- const value = this.state.value;
87
+ let {
88
+ lng,
89
+ lat,
90
+ zoom
91
+ } = (0, _mapEditorUtils.getInitCenter)();
92
+ const {
93
+ value
94
+ } = this.state;
89
95
  if ((0, _cell.isValidPosition)(value.lng, value.lat)) {
90
96
  lng = value.lng;
91
97
  lat = value.lat;
@@ -106,10 +112,11 @@ class LargeMapEditorDialog extends _react.default.Component {
106
112
  this.setState({
107
113
  isLoading: false
108
114
  }, () => {
109
- let _getInitCenter3 = (0, _mapEditorUtils.getInitCenter)(),
110
- lng = _getInitCenter3.lng,
111
- lat = _getInitCenter3.lat,
112
- zoom = _getInitCenter3.zoom;
115
+ let {
116
+ lng,
117
+ lat,
118
+ zoom
119
+ } = (0, _mapEditorUtils.getInitCenter)();
113
120
  this.map = new window.google.maps.Map(this.ref, {
114
121
  zoom,
115
122
  center: {
@@ -123,7 +130,9 @@ class LargeMapEditorDialog extends _react.default.Component {
123
130
  rotateControl: false,
124
131
  fullscreenControl: false
125
132
  });
126
- const value = this.state.value;
133
+ const {
134
+ value
135
+ } = this.state;
127
136
  if (value.lng && value.lat) {
128
137
  lng = value.lng;
129
138
  lat = value.lat;
@@ -147,7 +156,9 @@ class LargeMapEditorDialog extends _react.default.Component {
147
156
  };
148
157
  this.geolocationCallback = (error, point) => {
149
158
  if (!error) {
150
- this.setValue((0, _objectSpread2.default)({}, point));
159
+ this.setValue({
160
+ ...point
161
+ });
151
162
  this.addMarkerByPosition(point.lng, point.lat);
152
163
  if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP) {
153
164
  this.map.setCenter({
@@ -160,8 +171,10 @@ class LargeMapEditorDialog extends _react.default.Component {
160
171
  }
161
172
  };
162
173
  this.setPropsValue = _ref => {
163
- let lng = _ref.lng,
164
- lat = _ref.lat;
174
+ let {
175
+ lng,
176
+ lat
177
+ } = _ref;
165
178
  if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) {
166
179
  this.props.setValue(null);
167
180
  return;
@@ -229,8 +242,10 @@ class LargeMapEditorDialog extends _react.default.Component {
229
242
  }
230
243
  };
231
244
  this.rerenderMapMarker = _ref2 => {
232
- let lng = _ref2.lng,
233
- lat = _ref2.lat;
245
+ let {
246
+ lng,
247
+ lat
248
+ } = _ref2;
234
249
  if (!(0, _dtableUtils.isNumber)(lng) || !(0, _dtableUtils.isNumber)(lat)) return;
235
250
  if (this.map) {
236
251
  if (this.mapType === _mapEditorUtils.MAP_TYPES.G_MAP || this.mapType === _mapEditorUtils.MAP_TYPES.M_MAP) {
@@ -245,16 +260,19 @@ class LargeMapEditorDialog extends _react.default.Component {
245
260
  this.addMarkerByPosition(lng, lat);
246
261
  };
247
262
  this.onBlur = () => {
248
- const value = this.state.value;
263
+ const {
264
+ value
265
+ } = this.state;
249
266
  const numericValue = (0, _dtableUtils.normalizeMapPoint)(value);
250
267
  this.setState({
251
268
  value: numericValue
252
269
  });
253
270
  };
254
271
  this.onChangeLatitude = event => {
255
- const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
272
+ const newValue = {
273
+ ...this.state.value,
256
274
  lat: event.target.value
257
- });
275
+ };
258
276
  this.setState({
259
277
  value: newValue
260
278
  }, () => {
@@ -264,9 +282,10 @@ class LargeMapEditorDialog extends _react.default.Component {
264
282
  });
265
283
  };
266
284
  this.onChangeLongitude = event => {
267
- const newValue = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.state.value), {}, {
285
+ const newValue = {
286
+ ...this.state.value,
268
287
  lng: event.target.value
269
- });
288
+ };
270
289
  this.setState({
271
290
  value: newValue
272
291
  }, () => {
@@ -283,7 +302,9 @@ class LargeMapEditorDialog extends _react.default.Component {
283
302
  }
284
303
  };
285
304
  this.onSubmit = () => {
286
- const value = this.state.value;
305
+ const {
306
+ value
307
+ } = this.state;
287
308
  this.props.setValue(value);
288
309
  this.props.onSubmit();
289
310
  };
@@ -304,7 +325,9 @@ class LargeMapEditorDialog extends _react.default.Component {
304
325
  event.preventDefault();
305
326
  event.stopPropagation();
306
327
  event.nativeEvent.stopImmediatePropagation();
307
- const value = this.state.value;
328
+ const {
329
+ value
330
+ } = this.state;
308
331
  this.props.setValue(value);
309
332
  this.props.toggleFullScreen(event);
310
333
  };
@@ -313,16 +336,19 @@ class LargeMapEditorDialog extends _react.default.Component {
313
336
  e.nativeEvent.stopImmediatePropagation();
314
337
  e.stopPropagation();
315
338
  };
316
- const readOnly = props.readOnly,
317
- config = props.config;
339
+ const {
340
+ readOnly,
341
+ config
342
+ } = props;
318
343
  const _value = props.value || {
319
344
  lng: '',
320
345
  lat: ''
321
346
  };
322
347
  this.readOnly = readOnly;
323
- const _getMapInfo = (0, _mapEditorUtils.getMapInfo)(config),
324
- mapType = _getMapInfo.mapType,
325
- mapKey = _getMapInfo.mapKey;
348
+ const {
349
+ mapType,
350
+ mapKey
351
+ } = (0, _mapEditorUtils.getMapInfo)(config);
326
352
  this.mapType = mapType;
327
353
  this.mapKey = mapKey;
328
354
  this.map = null;
@@ -377,9 +403,10 @@ class LargeMapEditorDialog extends _react.default.Component {
377
403
  this.map = null;
378
404
  }
379
405
  render() {
380
- const _this$state = this.state,
381
- isLoading = _this$state.isLoading,
382
- lng_lat = _this$state.value;
406
+ const {
407
+ isLoading,
408
+ value: lng_lat
409
+ } = this.state;
383
410
  const lat = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lat) ? lng_lat.lat : '';
384
411
  const lng = lng_lat && !(0, _dtableUtils.isEmpty)(lng_lat.lng) ? lng_lat.lng : '';
385
412
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactstrap.Modal, {