dtable-ui-component 6.0.126 → 7.0.0-xia.1

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