dtable-ui-component 6.0.29-beta9 → 6.0.29

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 (346) hide show
  1. package/lib/ActionSheet/index.js +196 -0
  2. package/lib/ActionSheet/style/index.css +377 -0
  3. package/lib/ActivityIndicator/index.css +110 -0
  4. package/lib/ActivityIndicator/index.js +76 -0
  5. package/lib/Badge/index.css +98 -0
  6. package/lib/Badge/index.js +65 -0
  7. package/lib/CheckboxEditor/index.js +116 -24
  8. package/lib/CollaboratorEditor/index.js +11 -23
  9. package/lib/CollaboratorEditor/mb-collaborator-editor/index.css +85 -0
  10. package/lib/CollaboratorEditor/mb-collaborator-editor/index.js +148 -0
  11. package/lib/DTableCommonAddTool/index.js +3 -1
  12. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +6 -6
  13. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +6 -6
  14. package/lib/DateEditor/index.js +95 -69
  15. package/lib/DateEditor/mb-date-editor-popover/custom-rc-calendar.css +118 -0
  16. package/lib/DateEditor/mb-date-editor-popover/index.css +45 -0
  17. package/lib/DateEditor/mb-date-editor-popover/index.js +226 -0
  18. package/lib/DateEditor/{pc-editor.js → pc-date-editor-popover.js} +9 -9
  19. package/lib/DatePicker/index.js +120 -0
  20. package/lib/DatePicker/locale/en_US.js +14 -0
  21. package/lib/DatePicker/locale/ru_RU.js +14 -0
  22. package/lib/DatePicker/locale/sv_SE.js +14 -0
  23. package/lib/DatePicker/locale/zh_CN.js +14 -0
  24. package/lib/DatePicker/style/index.css +298 -0
  25. package/lib/DatePicker/utils.js +36 -0
  26. package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.js +6 -6
  27. package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/department-single-select.js +7 -7
  28. package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/index.css +3 -10
  29. package/lib/{DepartmentSingleSelectEditor/pc-editor → Department-editor}/index.js +25 -8
  30. package/lib/{SelectedDepartments → Department-editor/selected-departments}/index.css +1 -0
  31. package/lib/{SelectedDepartments → Department-editor/selected-departments}/index.js +3 -3
  32. package/lib/DigitalSignEditor/index.js +171 -24
  33. package/lib/Drawer/index.css +144 -0
  34. package/lib/Drawer/index.js +21 -0
  35. package/lib/FileEditor/addition-previewer/index.css +1 -0
  36. package/lib/FileEditor/{pc-editor/addition-previewer → addition-previewer}/index.js +1 -1
  37. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +1 -0
  38. package/lib/FileEditor/{pc-editor/addition-previewer → addition-previewer}/local-file-addition/index.js +4 -4
  39. package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/dropdown-menu.js +1 -1
  40. package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/file-name-editor/index.js +1 -1
  41. package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/index.css +2 -0
  42. package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/index.js +2 -2
  43. package/lib/FileEditor/files-previewer/index.js +268 -26
  44. package/lib/FileEditor/index.css +5 -0
  45. package/lib/FileEditor/index.js +265 -26
  46. package/lib/FormulaFormatter/index.css +5 -5
  47. package/lib/GeolocationEditor/{pc-editor/country-editor.js → country-editor.js} +49 -5
  48. package/lib/GeolocationEditor/{pc-editor/index.css → index.css} +4 -3
  49. package/lib/GeolocationEditor/index.js +230 -90
  50. package/lib/GeolocationEditor/{pc-editor/location-editor.js → location-editor.js} +41 -8
  51. package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/index.js +6 -6
  52. package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/large-editor/index.js +7 -7
  53. package/lib/GeolocationEditor/map-editor-utils.js +4 -10
  54. package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/index.js +7 -7
  55. package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/large-editor/index.js +7 -7
  56. package/lib/GeolocationEditor/{pc-editor/province-city-editor.js → province-city-editor.js} +38 -7
  57. package/lib/GeolocationEditor/{pc-editor/province-editor.js → province-editor.js} +31 -7
  58. package/lib/GeolocationEditor/{pc-editor/selector-header-item.js → selector-header-item.js} +1 -1
  59. package/lib/Icon/index.css +50 -0
  60. package/lib/Icon/index.js +35 -0
  61. package/lib/Icon/load-sprite.js +56 -0
  62. package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/image-link/index.js +1 -1
  63. package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/index.js +1 -1
  64. package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/local-image-addition/index.js +4 -4
  65. package/lib/ImageEditor/images-previewer/image-preview/index.js +3 -3
  66. package/lib/ImageEditor/images-previewer/index.js +4 -9
  67. package/lib/ImageEditor/index.css +16 -17
  68. package/lib/ImageEditor/index.js +185 -26
  69. package/lib/ImageThumbnail/index.js +1 -2
  70. package/lib/InputItem/custom-input.js +321 -0
  71. package/lib/InputItem/custom-keyboard.js +162 -0
  72. package/lib/InputItem/index.js +389 -0
  73. package/lib/InputItem/input.js +45 -0
  74. package/lib/InputItem/locale/en_US.js +12 -0
  75. package/lib/InputItem/locale/ru_RU.js +12 -0
  76. package/lib/InputItem/locale/sv_SE.js +12 -0
  77. package/lib/InputItem/locale/zh_CN.js +12 -0
  78. package/lib/InputItem/portal.js +23 -0
  79. package/lib/InputItem/style/index.css +524 -0
  80. package/lib/LinkEditor/index.js +5 -5
  81. package/lib/LinkEditor/{mb-popover → mb-link-editor-popover}/index.css +1 -1
  82. package/lib/List/index.css +389 -0
  83. package/lib/List/index.js +41 -0
  84. package/lib/List/list-item.js +169 -0
  85. package/lib/Modal/alert.js +86 -0
  86. package/lib/Modal/index.js +16 -0
  87. package/lib/Modal/modal.js +118 -0
  88. package/lib/Modal/operation.js +81 -0
  89. package/lib/Modal/prompt.js +211 -0
  90. package/lib/Modal/style/index.css +593 -0
  91. package/lib/MultipleSelectEditor/index.js +14 -9
  92. package/lib/Picker/AbstractPicker.js +190 -0
  93. package/lib/Picker/index.js +28 -0
  94. package/lib/Picker/locale/en_US.js +12 -0
  95. package/lib/Picker/locale/ru_RU.js +12 -0
  96. package/lib/Picker/locale/sv_SE.js +12 -0
  97. package/lib/Picker/locale/zh_CN.js +12 -0
  98. package/lib/Picker/popupProps.js +12 -0
  99. package/lib/Picker/style/index.css +145 -0
  100. package/lib/Popover/index.js +63 -0
  101. package/lib/Popover/item.js +55 -0
  102. package/lib/Popover/style/index.css +233 -0
  103. package/lib/Progress/index.css +24 -0
  104. package/lib/Progress/index.js +66 -0
  105. package/lib/Radio/Radio.js +47 -0
  106. package/lib/Radio/RadioItem.js +57 -0
  107. package/lib/Radio/index.css +92 -0
  108. package/lib/Radio/index.js +12 -0
  109. package/lib/RowExpandDialog/column-content/index.js +2 -2
  110. package/lib/RowExpandDialog/index.js +0 -2
  111. package/lib/RowExpandEditor/{add-btn/pc-add-btn → RowExpandAddBtn}/index.js +4 -6
  112. package/lib/RowExpandEditor/{checkbox-editor/pc-editor.js → RowExpandCheckboxEditor/index.js} +13 -9
  113. package/lib/RowExpandEditor/{collaborator-editor/pc-editor → RowExpandCollaboratorEditor}/index.css +1 -1
  114. package/lib/RowExpandEditor/{collaborator-editor/pc-editor → RowExpandCollaboratorEditor}/index.js +7 -6
  115. package/lib/RowExpandEditor/{date-editor/pc-editor.js → RowExpandDateEditor/index.js} +2 -2
  116. package/lib/RowExpandEditor/{department-editor/pc-editor.js → RowExpandDepartmentEditor/index.js} +49 -44
  117. package/lib/RowExpandEditor/{digital-sign-editor/pc-editor → RowExpandDigitalSignEditor}/index.css +1 -1
  118. package/lib/RowExpandEditor/{digital-sign-editor/pc-editor → RowExpandDigitalSignEditor}/index.js +11 -11
  119. package/lib/RowExpandEditor/{duration-editor/pc-editor.js → RowExpandDurationEditor/index.js} +2 -2
  120. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +2 -0
  121. package/lib/RowExpandEditor/{email-editor/pc-editor → RowExpandEmailEditor}/index.js +3 -3
  122. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +1 -0
  123. package/lib/RowExpandEditor/{file-editor/pc-editor → RowExpandFileEditor}/index.js +9 -9
  124. package/lib/RowExpandEditor/{geolocation-editor/pc-editor → RowExpandGeolocationEditor}/index.js +13 -17
  125. package/lib/RowExpandEditor/{image-editor/pc-editor → RowExpandImageEditor}/index.js +9 -9
  126. package/lib/RowExpandEditor/{long-text-editor/pc-editor → RowExpandLongTextEditor}/index.js +7 -7
  127. package/lib/RowExpandEditor/{multiple-select-editor/pc-editor → RowExpandMultipleSelectEditor}/index.css +1 -1
  128. package/lib/RowExpandEditor/{multiple-select-editor/pc-editor → RowExpandMultipleSelectEditor}/index.js +6 -6
  129. package/lib/RowExpandEditor/{number-editor/pc-editor.js → RowExpandNumberEditor/index.js} +2 -2
  130. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +13 -0
  131. package/lib/RowExpandEditor/{rate-editor/pc-editor.js → RowExpandRateEditor/index.js} +3 -2
  132. package/lib/RowExpandEditor/{single-select-editor/pc-editor → RowExpandSingleSelectorEditor}/index.js +17 -17
  133. package/lib/RowExpandEditor/{text-editor/pc-editor → RowExpandTextEditor}/index.js +7 -7
  134. package/lib/RowExpandEditor/{url-editor/pc-editor → RowExpandUrlEditor}/index.js +6 -6
  135. package/lib/RowExpandEditor/constants.js +34 -34
  136. package/lib/RowExpandFormatter/{department-formatter/pc-formatter.js → RowExpandDepartmentFormatter/index.js} +2 -2
  137. package/lib/RowExpandFormatter/{email-formatter → RowExpandEmailFormatter}/index.css +4 -4
  138. package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +5 -0
  139. package/lib/RowExpandFormatter/constants.js +17 -17
  140. package/lib/RowExpandFormatter/index.css +18 -33
  141. package/lib/RowExpandFormatter/index.js +1 -1
  142. package/lib/SelectItem/index.js +33 -57
  143. package/lib/SingleSelectEditor/index.js +14 -9
  144. package/lib/SvgIcon/index.js +1 -2
  145. package/lib/TabBar/Tab.js +76 -0
  146. package/lib/TabBar/index.css +142 -0
  147. package/lib/TabBar/index.js +129 -0
  148. package/lib/Tabs/index.css +453 -0
  149. package/lib/Tabs/index.js +39 -0
  150. package/lib/TextareaItem/index.css +235 -0
  151. package/lib/TextareaItem/index.js +231 -0
  152. package/lib/Toast/index.css +67 -0
  153. package/lib/Toast/index.js +131 -0
  154. package/lib/_util/class.js +34 -0
  155. package/lib/_util/closest.js +17 -0
  156. package/lib/_util/exenv.js +8 -0
  157. package/lib/_util/getDataAttr.js +15 -0
  158. package/lib/_util/getLocale.js +42 -0
  159. package/lib/constants/index.js +2 -3
  160. package/lib/css/am.css +390 -0
  161. package/lib/css/mb-cell-editor.css +1 -1
  162. package/lib/index.js +100 -51
  163. package/lib/locales/de.json +1 -3
  164. package/lib/locales/en.json +1 -3
  165. package/lib/locales/es.json +1 -3
  166. package/lib/locales/fr.json +1 -3
  167. package/lib/locales/pt.json +1 -3
  168. package/lib/locales/ru.json +1 -3
  169. package/lib/locales/zh-CN.json +1 -3
  170. package/lib/select-editor/index.js +20 -27
  171. package/lib/select-editor/mb-select-editor/index.css +127 -0
  172. package/lib/select-editor/mb-select-editor/index.js +197 -0
  173. package/lib/select-editor/{pc-editor → pc-select-editor}/index.css +1 -1
  174. package/lib/select-editor/{pc-editor → pc-select-editor}/index.js +7 -7
  175. package/lib/select-editor/select-editor-option.js +84 -0
  176. package/lib/utils/editor-utils.js +2 -6
  177. package/lib/utils/get-event-transfer.js +1 -2
  178. package/lib/utils/utils.js +2 -11
  179. package/package.json +25 -16
  180. package/lib/BodyPortal/index.js +0 -29
  181. package/lib/CheckboxEditor/mb-editor.js +0 -99
  182. package/lib/CheckboxEditor/pc-editor.js +0 -118
  183. package/lib/CollaboratorEditor/mb-editor/index.css +0 -41
  184. package/lib/CollaboratorEditor/mb-editor/index.js +0 -88
  185. package/lib/DateEditor/mb-editor/custom-rc-calendar.css +0 -118
  186. package/lib/DateEditor/mb-editor/index.css +0 -39
  187. package/lib/DateEditor/mb-editor/index.js +0 -215
  188. package/lib/DepartmentSingleSelectEditor/index.js +0 -34
  189. package/lib/DepartmentSingleSelectEditor/mb-editor/index.css +0 -4
  190. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +0 -230
  191. package/lib/DigitalSignEditor/mb-editor/index.css +0 -35
  192. package/lib/DigitalSignEditor/mb-editor/index.js +0 -144
  193. package/lib/DigitalSignEditor/pc-editor/index.js +0 -181
  194. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +0 -122
  195. package/lib/FileEditor/files-previewer/mb-previewer/index.css +0 -39
  196. package/lib/FileEditor/files-previewer/mb-previewer/index.js +0 -64
  197. package/lib/FileEditor/files-previewer/pc-previewer/index.js +0 -276
  198. package/lib/FileEditor/mb-editor/index.css +0 -10
  199. package/lib/FileEditor/mb-editor/index.js +0 -136
  200. package/lib/FileEditor/pc-editor/addition-previewer/index.css +0 -1
  201. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.css +0 -1
  202. package/lib/FileEditor/pc-editor/index.css +0 -5
  203. package/lib/FileEditor/pc-editor/index.js +0 -274
  204. package/lib/GeolocationEditor/mb-editor/country-editor.js +0 -79
  205. package/lib/GeolocationEditor/mb-editor/index.css +0 -11
  206. package/lib/GeolocationEditor/mb-editor/index.js +0 -125
  207. package/lib/GeolocationEditor/mb-editor/location-editor.js +0 -101
  208. package/lib/GeolocationEditor/mb-editor/map-editor/index.css +0 -11
  209. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +0 -474
  210. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.css +0 -158
  211. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +0 -530
  212. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +0 -77
  213. package/lib/GeolocationEditor/mb-editor/province-editor.js +0 -76
  214. package/lib/GeolocationEditor/pc-editor/index.js +0 -247
  215. package/lib/ImageEditor/mb-editor/index.css +0 -29
  216. package/lib/ImageEditor/mb-editor/index.js +0 -136
  217. package/lib/ImageEditor/pc-editor/images-previewer/index.js +0 -140
  218. package/lib/ImageEditor/pc-editor/index.css +0 -24
  219. package/lib/ImageEditor/pc-editor/index.js +0 -194
  220. package/lib/MobileFullScreenPage/body/index.css +0 -9
  221. package/lib/MobileFullScreenPage/body/index.js +0 -23
  222. package/lib/MobileFullScreenPage/header/index.css +0 -39
  223. package/lib/MobileFullScreenPage/header/index.js +0 -38
  224. package/lib/MobileFullScreenPage/index.css +0 -13
  225. package/lib/MobileFullScreenPage/index.js +0 -73
  226. package/lib/MobileModal/index.js +0 -41
  227. package/lib/MobileOperationSheet/index.css +0 -27
  228. package/lib/MobileOperationSheet/index.js +0 -92
  229. package/lib/MobileSelector/empty/index.css +0 -3
  230. package/lib/MobileSelector/empty/index.js +0 -23
  231. package/lib/MobileSelector/index.css +0 -32
  232. package/lib/MobileSelector/index.js +0 -57
  233. package/lib/MobileSelector/option/index.css +0 -28
  234. package/lib/MobileSelector/option/index.js +0 -36
  235. package/lib/MobileSelector/options/index.css +0 -8
  236. package/lib/MobileSelector/options/index.js +0 -18
  237. package/lib/MobileSelector/search/index.css +0 -7
  238. package/lib/MobileSelector/search/index.js +0 -26
  239. package/lib/MobileUpload/index.css +0 -1
  240. package/lib/MobileUpload/index.js +0 -160
  241. package/lib/RowExpand/index.js +0 -24
  242. package/lib/RowExpandEditor/add-btn/index.js +0 -24
  243. package/lib/RowExpandEditor/add-btn/mb-add-btn/index.css +0 -3
  244. package/lib/RowExpandEditor/add-btn/mb-add-btn/index.js +0 -19
  245. package/lib/RowExpandEditor/checkbox-editor/index.js +0 -25
  246. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.css +0 -6
  247. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +0 -36
  248. package/lib/RowExpandEditor/collaborator-editor/index.js +0 -24
  249. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.css +0 -9
  250. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +0 -163
  251. package/lib/RowExpandEditor/date-editor/index.js +0 -24
  252. package/lib/RowExpandEditor/date-editor/mb-editor.js +0 -82
  253. package/lib/RowExpandEditor/department-editor/index.js +0 -24
  254. package/lib/RowExpandEditor/department-editor/mb-editor.js +0 -65
  255. package/lib/RowExpandEditor/digital-sign-editor/index.js +0 -24
  256. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.css +0 -1
  257. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +0 -130
  258. package/lib/RowExpandEditor/duration-editor/index.js +0 -24
  259. package/lib/RowExpandEditor/duration-editor/mb-editor.js +0 -71
  260. package/lib/RowExpandEditor/email-editor/index.js +0 -24
  261. package/lib/RowExpandEditor/email-editor/mb-editor/index.css +0 -1
  262. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +0 -84
  263. package/lib/RowExpandEditor/email-editor/pc-editor/index.css +0 -1
  264. package/lib/RowExpandEditor/file-editor/index.js +0 -24
  265. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +0 -114
  266. package/lib/RowExpandEditor/file-editor/pc-editor/index.css +0 -1
  267. package/lib/RowExpandEditor/geolocation-editor/index.js +0 -24
  268. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +0 -100
  269. package/lib/RowExpandEditor/image-editor/index.js +0 -24
  270. package/lib/RowExpandEditor/image-editor/mb-editor/index.css +0 -30
  271. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +0 -109
  272. package/lib/RowExpandEditor/long-text-editor/index.js +0 -24
  273. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.css +0 -10
  274. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +0 -80
  275. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.css +0 -3
  276. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +0 -91
  277. package/lib/RowExpandEditor/multiple-select-editor/index.js +0 -24
  278. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +0 -154
  279. package/lib/RowExpandEditor/number-editor/index.js +0 -24
  280. package/lib/RowExpandEditor/number-editor/mb-editor/index.css +0 -3
  281. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +0 -76
  282. package/lib/RowExpandEditor/rate-editor/index.css +0 -34
  283. package/lib/RowExpandEditor/rate-editor/index.js +0 -25
  284. package/lib/RowExpandEditor/rate-editor/mb-editor.js +0 -92
  285. package/lib/RowExpandEditor/right-angle/index.css +0 -6
  286. package/lib/RowExpandEditor/right-angle/index.js +0 -17
  287. package/lib/RowExpandEditor/single-select-editor/index.js +0 -24
  288. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.css +0 -8
  289. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +0 -134
  290. package/lib/RowExpandEditor/text-editor/index.js +0 -24
  291. package/lib/RowExpandEditor/text-editor/mb-editor/index.css +0 -14
  292. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +0 -37
  293. package/lib/RowExpandEditor/url-editor/index.js +0 -24
  294. package/lib/RowExpandEditor/url-editor/mb-editor/index.css +0 -17
  295. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +0 -87
  296. package/lib/RowExpandFormatter/department-formatter/index.js +0 -19
  297. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +0 -20
  298. package/lib/RowExpandFormatter/rate-formatter/index.css +0 -5
  299. package/lib/RowExpandView/body/index.css +0 -173
  300. package/lib/RowExpandView/body/index.js +0 -111
  301. package/lib/RowExpandView/column-content/index.css +0 -27
  302. package/lib/RowExpandView/column-content/index.js +0 -25
  303. package/lib/RowExpandView/index.css +0 -3
  304. package/lib/RowExpandView/index.js +0 -178
  305. package/lib/select-editor/mb-editor/index.css +0 -1
  306. package/lib/select-editor/mb-editor/index.js +0 -105
  307. /package/lib/CollaboratorEditor/{pc-editor → pc-collaborator-editor}/index.css +0 -0
  308. /package/lib/CollaboratorEditor/{pc-editor → pc-collaborator-editor}/index.js +0 -0
  309. /package/lib/{constants/departments.js → Department-editor/constants.js} +0 -0
  310. /package/lib/{DepartmentMultipleSelectEditor → Department-editor/department-multiple-select}/index.css +0 -0
  311. /package/lib/{utils/departments.js → Department-editor/utils.js} +0 -0
  312. /package/lib/DigitalSignEditor/{pc-editor/index.css → index.css} +0 -0
  313. /package/lib/FileEditor/files-previewer/{pc-previewer/file-previewer → file-previewer}/file-name-editor/index.css +0 -0
  314. /package/lib/GeolocationEditor/{pc-editor/map-editor → map-editor}/large-editor/index.css +0 -0
  315. /package/lib/GeolocationEditor/{pc-editor/map-selection-editor → map-selection-editor}/large-editor/index.css +0 -0
  316. /package/lib/GeolocationEditor/{pc-editor/parse-geolocation.js → parse-geolocation.js} +0 -0
  317. /package/lib/GeolocationEditor/{pc-editor/selector-list.js → selector-list.js} +0 -0
  318. /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/image-link/index.css +0 -0
  319. /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/index.css +0 -0
  320. /package/lib/ImageEditor/{pc-editor/addition-previewer → addition-previewer}/local-image-addition/index.css +0 -0
  321. /package/lib/LinkEditor/{mb-popover → mb-link-editor-popover}/index.js +0 -0
  322. /package/lib/LinkEditor/{pc-popover → pc-link-editor-popover}/index.css +0 -0
  323. /package/lib/LinkEditor/{pc-popover → pc-link-editor-popover}/index.js +0 -0
  324. /package/lib/RowExpandEditor/{add-btn/pc-add-btn → RowExpandAddBtn}/index.css +0 -0
  325. /package/lib/RowExpandEditor/{checkbox-editor → RowExpandCheckboxEditor}/index.css +0 -0
  326. /package/lib/RowExpandEditor/{geolocation-editor/pc-editor → RowExpandGeolocationEditor}/index.css +0 -0
  327. /package/lib/RowExpandEditor/{image-editor/pc-editor → RowExpandImageEditor}/index.css +0 -0
  328. /package/lib/RowExpandEditor/{long-text-editor/pc-editor → RowExpandLongTextEditor}/index.css +0 -0
  329. /package/lib/RowExpandEditor/{single-select-editor/pc-editor → RowExpandSingleSelectorEditor}/index.css +0 -0
  330. /package/lib/RowExpandEditor/{text-editor/pc-editor → RowExpandTextEditor}/index.css +0 -0
  331. /package/lib/RowExpandEditor/{url-editor/pc-editor → RowExpandUrlEditor}/index.css +0 -0
  332. /package/lib/RowExpandFormatter/{email-formatter → RowExpandEmailFormatter}/index.js +0 -0
  333. /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/index.css +0 -0
  334. /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/index.js +0 -0
  335. /package/lib/RowExpandFormatter/{file-formatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +0 -0
  336. /package/lib/RowExpandFormatter/{formula-formatter → RowExpandFormulaFormatter}/index.js +0 -0
  337. /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/index.css +0 -0
  338. /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/index.js +0 -0
  339. /package/lib/RowExpandFormatter/{image-formatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +0 -0
  340. /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +0 -0
  341. /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/index.css +0 -0
  342. /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/index.js +0 -0
  343. /package/lib/RowExpandFormatter/{link-formatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
  344. /package/lib/RowExpandFormatter/{rate-formatter → RowExpandRateFormatter}/index.js +0 -0
  345. /package/lib/RowExpandFormatter/{url-formatter → RowExpandUrlFormatter}/index.css +0 -0
  346. /package/lib/RowExpandFormatter/{url-formatter → RowExpandUrlFormatter}/index.js +0 -0
@@ -1,530 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _inputItem = _interopRequireDefault(require("antd-mobile/lib/input-item"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _reactstrap = require("reactstrap");
11
- var _dtableUtils = require("dtable-utils");
12
- var _toaster = _interopRequireDefault(require("../../../toaster"));
13
- var _MobileFullScreenPage = _interopRequireDefault(require("../../../MobileFullScreenPage"));
14
- var _mapEditorUtils = require("../../map-editor-utils");
15
- var _cell = require("../../../utils/cell");
16
- var _lang = require("../../../lang");
17
- var _Loading = _interopRequireDefault(require("../../../Loading"));
18
- require("./index.css");
19
- const {
20
- Header,
21
- Body
22
- } = _MobileFullScreenPage.default;
23
- const getInputMode = column => {
24
- const data = column.data;
25
- if (!data) return _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
26
- return data.input_mode || _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
27
- };
28
- const getInitValue = value => {
29
- if (!value || (0, _dtableUtils.isEmptyObject)(value) || !value.address) {
30
- return {
31
- address: '',
32
- title: '',
33
- tag: '',
34
- lngLat: {}
35
- };
36
- }
37
- return value;
38
- };
39
- class MapSelectionEditor extends _react.default.Component {
40
- constructor(props) {
41
- super(props);
42
- this.addMarkerByPosition = value => {
43
- const {
44
- lngLat
45
- } = value;
46
- let point = new window.BMap.Point(lngLat.lng, lngLat.lat);
47
- const marker = new window.BMap.Marker(point, {
48
- offset: new window.BMap.Size(-2, -5)
49
- });
50
- if (this.map) {
51
- this.map.clearOverlays();
52
- this.map.addOverlay(marker);
53
- this.map.centerAndZoom(point, 10);
54
- }
55
- };
56
- this.realTimePositioning = (error, point) => {
57
- if (error) {
58
- _toaster.default.danger((0, _lang.getLocale)('Positioning_failed'));
59
- return;
60
- }
61
- const geoCoder = new window.BMap.Geocoder();
62
- let value = {};
63
- geoCoder.getLocation(point, result => {
64
- const {
65
- surroundingPois,
66
- address,
67
- point
68
- } = result;
69
- if (surroundingPois.length === 0) {
70
- value.address = address;
71
- value.lngLat = {
72
- lng: point.lng,
73
- lat: point.lat
74
- };
75
- value.tag = [];
76
- value.title = '';
77
- } else {
78
- const position = surroundingPois[0];
79
- const {
80
- address,
81
- title,
82
- tags,
83
- point
84
- } = position;
85
- value.address = address || '';
86
- value.title = title || '';
87
- value.tag = tags || [];
88
- value.lngLat = {
89
- lng: point.lng,
90
- lat: point.lat
91
- };
92
- }
93
- this.setState({
94
- isShowLabel: true,
95
- selectedSelection: value,
96
- inputValue: value.title || value.address
97
- });
98
- this.addMarkerByPosition(value);
99
- });
100
- };
101
- this.renderBaiduMap = () => {
102
- this.setState({
103
- isLoading: false
104
- }, () => {
105
- if (!window.BMap.Map) return;
106
- setTimeout(() => {
107
- this.map = new window.BMap.Map('dtable-ui-mobile-geolocation-map-container');
108
- let {
109
- lng,
110
- lat,
111
- zoom
112
- } = (0, _mapEditorUtils.getInitCenter)();
113
- const {
114
- value
115
- } = this.state;
116
- const {
117
- lngLat
118
- } = value;
119
- if ((0, _cell.isValidPosition)(lngLat.lng, lngLat.lat)) {
120
- lng = lngLat.lng;
121
- lat = lngLat.lat;
122
- this.setState({
123
- isShowLabel: true,
124
- selectedSelection: value
125
- });
126
- this.addMarkerByPosition(value);
127
- }
128
- let point = new window.BMap.Point(lng, lat);
129
- this.map.centerAndZoom(point, zoom);
130
- this.map.enableScrollWheelZoom(true);
131
- // normal map selection
132
- this.canSelectPosition && this.map.addEventListener('click', event => {
133
- let value = {};
134
- const point = event.point;
135
- const geoCoder = new window.BMap.Geocoder();
136
- geoCoder.getLocation(point, result => {
137
- const {
138
- surroundingPois,
139
- address,
140
- point
141
- } = result;
142
- if (surroundingPois.length === 0) {
143
- value.address = address;
144
- value.lngLat = {
145
- lng: point.lng,
146
- lat: point.lat
147
- };
148
- value.tag = [];
149
- value.title = '';
150
- } else {
151
- const position = surroundingPois[0];
152
- const {
153
- address,
154
- title,
155
- tags,
156
- point
157
- } = position;
158
- value.address = address || '';
159
- value.title = title || '';
160
- value.tag = tags || [];
161
- value.lngLat = {
162
- lng: point.lng,
163
- lat: point.lat
164
- };
165
- }
166
- this.setState({
167
- isShowLabel: true,
168
- selectedSelection: value,
169
- inputValue: value.title || value.address
170
- });
171
- this.addMarkerByPosition(value);
172
- });
173
- });
174
- // for mobile device real-time positioning, use current position
175
- !this.canSelectPosition && (0, _mapEditorUtils.locateCurrentPosition)(this.map, this.mapType, this.realTimePositioning);
176
- }, 1);
177
- });
178
- };
179
- this.geolocationCallback = (error, point) => {
180
- if (error) {
181
- _toaster.default.danger((0, _lang.getLocale)('Positioning_failed'));
182
- return;
183
- }
184
- const geoCoder = new window.BMap.Geocoder();
185
- geoCoder.getLocation(point, result => {
186
- let value = {};
187
- const {
188
- surroundingPois,
189
- address,
190
- point
191
- } = result;
192
- if (surroundingPois.length === 0) {
193
- value.address = address;
194
- value.lngLat = {
195
- lng: point.lng,
196
- lat: point.lat
197
- };
198
- value.tag = [];
199
- value.title = '';
200
- } else {
201
- const position = surroundingPois[0];
202
- const {
203
- address,
204
- title,
205
- tags,
206
- point
207
- } = position;
208
- value.address = address || '';
209
- value.title = title || '';
210
- value.tag = tags || [];
211
- value.lngLat = {
212
- lng: point.lng,
213
- lat: point.lat
214
- };
215
- }
216
- this.setState({
217
- isShowLabel: true,
218
- selectedSelection: value
219
- });
220
- this.addMarkerByPosition(value);
221
- });
222
- };
223
- this.isEmptySelection = value => {
224
- return !value.title && !value.address && !value.tag && (0, _dtableUtils.isEmptyObject)(value.lngLat);
225
- };
226
- this.clearSearchNumerical = () => {
227
- this.setState({
228
- inputValue: '',
229
- value: {}
230
- });
231
- };
232
- this.onChange = inputValue => {
233
- this.setState({
234
- inputValue
235
- });
236
- };
237
- this.onZoomIn = () => {
238
- if (!this.map) return;
239
- const currentZoom = this.map.getZoom();
240
- this.map.setZoom(currentZoom + 1);
241
- };
242
- this.onZoomOut = () => {
243
- if (!this.map) return;
244
- const currentZoom = this.map.getZoom();
245
- this.map.setZoom(currentZoom - 1);
246
- };
247
- this.onLocateCurrentPosition = () => {
248
- (0, _mapEditorUtils.locateCurrentPosition)(this.map, this.mapType, this.geolocationCallback);
249
- };
250
- this.onClickSelection = result => {
251
- this.setState({
252
- searchResults: [],
253
- inputValue: result.title || result.address,
254
- selectedSelection: result,
255
- isShowSearchView: false,
256
- isShowLabel: true
257
- }, () => {
258
- this.addMarkerByPosition(result);
259
- });
260
- };
261
- this.onCommit = () => {
262
- const {
263
- value
264
- } = this.state;
265
- const isEmptyMapSelection = this.isEmptySelection(value);
266
- this.props.onCommit(isEmptyMapSelection ? '' : value);
267
- };
268
- this.onClose = () => {
269
- this.props.onToggle();
270
- };
271
- this.onFillIn = () => {
272
- const {
273
- selectedSelection
274
- } = this.state;
275
- this.setState({
276
- value: selectedSelection,
277
- isShowLabel: false
278
- }, () => {
279
- _toaster.default.success((0, _lang.getLocale)('Successfully_filled_in'));
280
- this.onCommit();
281
- });
282
- };
283
- this.onCloseLabel = e => {
284
- e.stopPropagation();
285
- this.map.clearOverlays();
286
- this.setState({
287
- isShowLabel: false,
288
- selectedSelection: {},
289
- inputValue: ''
290
- });
291
- };
292
- this.onSearch = e => {
293
- e.stopPropagation();
294
- const {
295
- inputValue
296
- } = this.state;
297
- if (!inputValue) return;
298
- const options = {
299
- onSearchComplete: results => {
300
- const status = local.getStatus();
301
- if (status !== window.BMAP_STATUS_SUCCESS) {
302
- _toaster.default.danger((0, _lang.getLocale)('Search_failed_please_enter_detailed_address'));
303
- return;
304
- }
305
- let searchResults = [];
306
- for (let i = 0; i < results.getCurrentNumPois(); i++) {
307
- const value = results.getPoi(i);
308
- let position = {};
309
- position.address = value.address || '';
310
- position.title = value.title || '';
311
- position.tag = value.tags || [];
312
- position.lngLat = {
313
- lng: value.point.lng,
314
- lat: value.point.lat
315
- };
316
- searchResults.push(position);
317
- }
318
- this.setState({
319
- searchResults,
320
- isShowSearchView: true,
321
- isShowLabel: false
322
- });
323
- }
324
- };
325
- let local = new window.BMap.LocalSearch(this.map, options);
326
- local.search(inputValue);
327
- };
328
- this.renderSearchResult = () => {
329
- const {
330
- searchResults
331
- } = this.state;
332
- if (searchResults.length === 0) return null;
333
- return /*#__PURE__*/_react.default.createElement("div", {
334
- className: "dtable-ui-mobile-map-selection-editor-search-results"
335
- }, searchResults.map((result, index) => {
336
- return /*#__PURE__*/_react.default.createElement("div", {
337
- className: "dtable-ui-mobile-map-selection-editor-search-result",
338
- key: index,
339
- onClick: this.onClickSelection.bind(this, result)
340
- }, /*#__PURE__*/_react.default.createElement("span", {
341
- className: "dtable-ui-mobile-map-selection-editor-search-result-title"
342
- }, result.title || ''), /*#__PURE__*/_react.default.createElement("span", {
343
- className: "dtable-ui-mobile-map-selection-editor-search-result-address"
344
- }, result.address || ''));
345
- }));
346
- };
347
- this.renderLabel = () => {
348
- const {
349
- selectedSelection
350
- } = this.state;
351
- const {
352
- address,
353
- title,
354
- tag
355
- } = selectedSelection;
356
- const tagContent = Array.isArray(tag) && tag.length > 0 ? tag[0] : '';
357
- if (title) {
358
- return /*#__PURE__*/_react.default.createElement("div", {
359
- className: "dtable-ui-mobile-geolocation-map-editor-label"
360
- }, /*#__PURE__*/_react.default.createElement("span", {
361
- className: "dtable-ui-mobile-geolocation-map-editor-label-title",
362
- title: title
363
- }, title), tagContent && /*#__PURE__*/_react.default.createElement("span", {
364
- className: "dtable-ui-mobile-geolocation-map-editor-label-tag"
365
- }, tagContent), /*#__PURE__*/_react.default.createElement("span", {
366
- className: "dtable-font dtable-icon-x",
367
- onClick: this.onCloseLabel
368
- }), /*#__PURE__*/_react.default.createElement("span", {
369
- className: "dtable-ui-mobile-geolocation-map-editor-label-address-tip"
370
- }, (0, _lang.getLocale)('Address')), /*#__PURE__*/_react.default.createElement("span", {
371
- className: "dtable-ui-mobile-geolocation-map-editor-label-address",
372
- title: address
373
- }, address), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
374
- className: "dtable-ui-mobile-geolocation-map-editor-label-btn",
375
- color: "primary",
376
- size: "sm",
377
- onClick: this.onFillIn
378
- }, (0, _lang.getLocale)('Fill_in')));
379
- }
380
- return /*#__PURE__*/_react.default.createElement("div", {
381
- className: "dtable-ui-mobile-geolocation-map-editor-label simple"
382
- }, /*#__PURE__*/_react.default.createElement("span", {
383
- className: "dtable-font dtable-icon-x",
384
- onClick: this.onCloseLabel
385
- }), /*#__PURE__*/_react.default.createElement("span", {
386
- className: "dtable-ui-mobile-geolocation-map-editor-label-address text-truncate simple",
387
- title: address
388
- }, address), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
389
- className: "dtable-ui-mobile-geolocation-map-editor-label-btn simple",
390
- color: "primary",
391
- size: "sm",
392
- onClick: this.onFillIn
393
- }, (0, _lang.getLocale)('Fill_in')));
394
- };
395
- this.renderMap = () => {
396
- const {
397
- isLoading,
398
- inputValue,
399
- isShowSearchView,
400
- isShowLabel
401
- } = this.state;
402
- if (isLoading) return /*#__PURE__*/_react.default.createElement("div", {
403
- className: "w-100 h-100 d-flex align-items-center justify-content-center"
404
- }, /*#__PURE__*/_react.default.createElement(_Loading.default, null));
405
- if (!this.mapType) {
406
- return /*#__PURE__*/_react.default.createElement("div", {
407
- className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center align-items-center w-100 h-100"
408
- }, /*#__PURE__*/_react.default.createElement("span", {
409
- className: "alert-danger"
410
- }, (0, _lang.getLocale)('The_map_plugin_is_not_properly_configured_contact_the_administrator')));
411
- }
412
- if (this.mapType !== _mapEditorUtils.MAP_TYPES.B_MAP) {
413
- return /*#__PURE__*/_react.default.createElement("div", {
414
- className: "dtable-ui-geolocation-map-editor-error-message d-flex justify-content-center align-items-center w-100 h-100"
415
- }, /*#__PURE__*/_react.default.createElement("span", {
416
- className: "alert-danger"
417
- }, (0, _lang.getLocale)('This_map_type_currently_does_not_support_map_point_selection')));
418
- }
419
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, this.canSelectPosition && /*#__PURE__*/_react.default.createElement("div", {
420
- className: "dtable-ui-mobile-geolocation-map-editor-input-container"
421
- }, /*#__PURE__*/_react.default.createElement(_inputItem.default, {
422
- type: "text",
423
- className: "dtable-ui-mobile-geolocation-map-editor-input",
424
- style: {
425
- marginTop: 0
426
- },
427
- value: inputValue,
428
- onChange: this.onChange,
429
- clear: true,
430
- placeholder: (0, _lang.getLocale)('Please_enter_the_address')
431
- }), /*#__PURE__*/_react.default.createElement("div", {
432
- className: "dtable-ui-mobile-geolocation-map-editor-search-btn",
433
- onClick: this.onSearch
434
- }, /*#__PURE__*/_react.default.createElement("i", {
435
- className: "dtable-font dtable-icon-search"
436
- }))), /*#__PURE__*/_react.default.createElement("div", {
437
- className: "dtable-ui-mobile-geolocation-map-editor-map"
438
- }, /*#__PURE__*/_react.default.createElement("div", {
439
- className: "w-100 h-100",
440
- ref: ref => this.ref = ref,
441
- id: "dtable-ui-mobile-geolocation-map-container"
442
- }), /*#__PURE__*/_react.default.createElement("div", {
443
- className: "dtable-ui-geolocation-map-controller"
444
- }, /*#__PURE__*/_react.default.createElement("div", {
445
- className: "dtable-ui-geolocation-locate-control",
446
- onClick: this.onLocateCurrentPosition
447
- }, /*#__PURE__*/_react.default.createElement("i", {
448
- className: "dtable-font dtable-icon-current-location"
449
- })), /*#__PURE__*/_react.default.createElement("div", {
450
- className: "dtable-ui-geolocation-zoom-control"
451
- }, /*#__PURE__*/_react.default.createElement("div", {
452
- className: "dtable-ui-geolocation-zoom-control-btn",
453
- onClick: this.onZoomIn
454
- }, /*#__PURE__*/_react.default.createElement("i", {
455
- "aria-hidden": "true",
456
- className: "dtable-font dtable-icon-enlarge"
457
- })), /*#__PURE__*/_react.default.createElement("div", {
458
- className: "dtable-ui-geolocation-zoom-control-btn",
459
- onClick: this.onZoomOut
460
- }, /*#__PURE__*/_react.default.createElement("i", {
461
- "aria-hidden": "true",
462
- className: "dtable-font dtable-icon-narrow"
463
- })))), isShowSearchView && this.renderSearchResult()), isShowLabel && this.renderLabel());
464
- };
465
- const {
466
- value: _value,
467
- config,
468
- column
469
- } = props;
470
- const oldValue = _value || {};
471
- const {
472
- mapType,
473
- mapKey
474
- } = (0, _mapEditorUtils.getMapInfo)(config);
475
- this.mapType = mapType;
476
- this.mapKey = mapKey;
477
- const mode = getInputMode(column);
478
- this.canSelectPosition = mode === _mapEditorUtils.INPUT_MODE_MAP.ANY_LOCATION;
479
- const initValue = getInitValue(_value);
480
- this.map = null;
481
- this.state = {
482
- isLoading: true,
483
- value: oldValue,
484
- inputValue: initValue.title || initValue.address || '',
485
- isShowSearchView: false,
486
- isShowLabel: false,
487
- searchResults: [],
488
- selectedSelection: {}
489
- };
490
- }
491
- componentDidMount() {
492
- if (this.mapType !== _mapEditorUtils.MAP_TYPES.B_MAP) {
493
- this.setState({
494
- isLoading: false
495
- });
496
- return;
497
- }
498
- if (!window.BMap) {
499
- window.renderBaiduMap = () => this.renderBaiduMap();
500
- (0, _mapEditorUtils.loadMapSource)(this.mapType, this.mapKey);
501
- return;
502
- }
503
- this.renderBaiduMap();
504
- }
505
- componentWillUnmount() {
506
- let center = {};
507
- if (!this.map) return;
508
- center.zoom = this.map.getZoom();
509
- const coordinate = this.map.getCenter();
510
- center.lng = coordinate.lng;
511
- center.lat = coordinate.lat;
512
- this.mineMapMarker = null;
513
- localStorage.setItem('geolocation-map-center', JSON.stringify(center));
514
- this.map = null;
515
- }
516
- render() {
517
- const {
518
- column
519
- } = this.props;
520
- return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
521
- className: "dtable-ui-mobile-geolocation-map-selection-editor",
522
- onClose: this.onClose
523
- }, /*#__PURE__*/_react.default.createElement(Header, {
524
- onLeftClick: this.onClose
525
- }, /*#__PURE__*/_react.default.createElement("i", {
526
- className: "dtable-font dtable-icon-return"
527
- }), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name)), /*#__PURE__*/_react.default.createElement(Body, null, this.renderMap()));
528
- }
529
- }
530
- var _default = exports.default = MapSelectionEditor;
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _picker = _interopRequireDefault(require("antd-mobile/lib/picker"));
10
- var _list = _interopRequireDefault(require("antd-mobile/lib/list"));
11
- var _react = _interopRequireWildcard(require("react"));
12
- var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
13
- var _lang = require("../../lang");
14
- const {
15
- Header,
16
- Body
17
- } = _MobileFullScreenPage.default;
18
- const ProvinceCityEditor = _ref => {
19
- let {
20
- column,
21
- value: oldValue,
22
- getData,
23
- onToggle,
24
- onCommit
25
- } = _ref;
26
- const [value, setValue] = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '', (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city) || '']);
27
- const [isLoading, setLoading] = (0, _react.useState)(true);
28
- const locations = (0, _react.useRef)([]);
29
- (0, _react.useEffect)(() => {
30
- getData().then(data => {
31
- locations.current = data;
32
- setLoading(false);
33
- });
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
- }, []);
36
- const onValueChange = (0, _react.useCallback)(newValue => {
37
- if (value === newValue) return;
38
- setValue(newValue);
39
- }, [value]);
40
- const onSubmit = (0, _react.useCallback)(() => {
41
- if (value[0] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || value[1] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.city)) {
42
- onCommit({
43
- province: value[0],
44
- city: value[1]
45
- });
46
- }
47
- onToggle();
48
- }, [value, oldValue, onCommit, onToggle]);
49
- return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
50
- onToggle: onToggle
51
- }, /*#__PURE__*/_react.default.createElement(Header, {
52
- onLeftClick: onToggle,
53
- onRightClick: onSubmit
54
- }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement("span", {
55
- style: {
56
- color: '#f09f3f'
57
- }
58
- }, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement(Body, null, /*#__PURE__*/_react.default.createElement("div", {
59
- className: "dtable-ui-mobile-row-expand-subtitle"
60
- }, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Address_information'))), /*#__PURE__*/_react.default.createElement(_picker.default, {
61
- className: "dtable-ui-mobile-geolocation-editor-picker",
62
- data: isLoading ? [] : locations.current,
63
- value: value,
64
- format: "",
65
- onChange: onValueChange,
66
- cascade: true,
67
- title: (0, _lang.getLocale)('Address_information'),
68
- extra: (0, _lang.getLocale)('Select_location'),
69
- onOk: e => onValueChange(e),
70
- okText: (0, _lang.getLocale)('Done'),
71
- dismissText: (0, _lang.getLocale)('Cancel'),
72
- cols: 2
73
- }, /*#__PURE__*/_react.default.createElement(_list.default.Item, {
74
- arrow: "horizontal"
75
- }, value.join(' ') || (0, _lang.getLocale)('Select_location')))));
76
- };
77
- var _default = exports.default = ProvinceCityEditor;
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _picker = _interopRequireDefault(require("antd-mobile/lib/picker"));
10
- var _list = _interopRequireDefault(require("antd-mobile/lib/list"));
11
- var _react = _interopRequireWildcard(require("react"));
12
- var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
13
- var _lang = require("../../lang");
14
- const {
15
- Header,
16
- Body
17
- } = _MobileFullScreenPage.default;
18
- const ProvinceEditor = _ref => {
19
- let {
20
- column,
21
- value: oldValue,
22
- getData,
23
- onToggle,
24
- onCommit
25
- } = _ref;
26
- const [value, setValue] = (0, _react.useState)([(oldValue === null || oldValue === void 0 ? void 0 : oldValue.province) || '']);
27
- const [isLoading, setLoading] = (0, _react.useState)(true);
28
- const locations = (0, _react.useRef)([]);
29
- (0, _react.useEffect)(() => {
30
- getData().then(data => {
31
- locations.current = data;
32
- setLoading(false);
33
- });
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
- }, []);
36
- const onValueChange = (0, _react.useCallback)(newValue => {
37
- if (value[0] === newValue[0]) return;
38
- setValue(newValue);
39
- }, [value]);
40
- const onSubmit = (0, _react.useCallback)(() => {
41
- if (value[0] !== (oldValue === null || oldValue === void 0 ? void 0 : oldValue.province)) {
42
- onCommit({
43
- province: value[0]
44
- });
45
- }
46
- onToggle();
47
- }, [value, oldValue, onCommit, onToggle]);
48
- return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
49
- onClose: onToggle
50
- }, /*#__PURE__*/_react.default.createElement(Header, {
51
- onLeftClick: onToggle,
52
- onRightClick: onSubmit
53
- }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement("span", {
54
- style: {
55
- color: '#f09f3f'
56
- }
57
- }, (0, _lang.getLocale)('Submit'))), /*#__PURE__*/_react.default.createElement(Body, null, /*#__PURE__*/_react.default.createElement("div", {
58
- className: "dtable-ui-mobile-row-expand-subtitle"
59
- }, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Address_information'))), /*#__PURE__*/_react.default.createElement(_picker.default, {
60
- className: "dtable-ui-mobile-geolocation-editor-picker",
61
- data: isLoading ? [] : locations.current,
62
- value: value,
63
- format: "",
64
- onChange: onValueChange,
65
- cascade: true,
66
- title: (0, _lang.getLocale)('Address_information'),
67
- extra: (0, _lang.getLocale)('Select_location'),
68
- onOk: e => onValueChange(e),
69
- okText: (0, _lang.getLocale)('Done'),
70
- dismissText: (0, _lang.getLocale)('Cancel'),
71
- cols: 1
72
- }, /*#__PURE__*/_react.default.createElement(_list.default.Item, {
73
- arrow: "horizontal"
74
- }, value[0] || (0, _lang.getLocale)('Select_location')))));
75
- };
76
- var _default = exports.default = ProvinceEditor;