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,35 +1,277 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _reactResponsive = _interopRequireDefault(require("react-responsive"));
11
- var _pcPreviewer = _interopRequireDefault(require("./pc-previewer"));
12
- var _mbPreviewer = _interopRequireDefault(require("./mb-previewer"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _url = require("../../utils/url");
10
+ var _utils = require("../../utils/utils");
11
+ var _constants = require("../../constants");
12
+ var _lang = require("../../lang");
13
+ var _ImagePreviewerLightbox = _interopRequireDefault(require("../../ImagePreviewerLightbox"));
14
+ var _DTableCommonAddTool = _interopRequireDefault(require("../../DTableCommonAddTool"));
15
+ var _filePreviewer = _interopRequireDefault(require("./file-previewer"));
13
16
  require("./index.css");
14
- const FilesPreviewer = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
15
- let {
16
- isMobile,
17
- ...props
18
- } = _ref;
19
- if (isMobile === false) return /*#__PURE__*/_react.default.createElement(_pcPreviewer.default, Object.assign({}, props, {
20
- ref: ref
21
- }));
22
- if (isMobile === true) return /*#__PURE__*/_react.default.createElement(_mbPreviewer.default, Object.assign({}, props, {
23
- ref: ref
24
- }));
25
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
26
- query: "(min-width: 768px)"
27
- }, /*#__PURE__*/_react.default.createElement(_pcPreviewer.default, Object.assign({}, props, {
28
- ref: ref
29
- }))), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
30
- query: "(max-width: 768px)"
31
- }, /*#__PURE__*/_react.default.createElement(_mbPreviewer.default, Object.assign({}, props, {
32
- ref: ref
33
- }))));
34
- });
17
+ class FilesPreviewer extends _react.default.Component {
18
+ constructor(props) {
19
+ super(props);
20
+ this.getFileItemImageUrlList = value => {
21
+ this.setState({
22
+ fileImageUrlList: (0, _url.getValidFileImageUrls)(value)
23
+ });
24
+ };
25
+ this.showLargeImage = itemUrl => {
26
+ let {
27
+ fileImageUrlList
28
+ } = this.state;
29
+ this.setState({
30
+ isShowLargeImage: true,
31
+ largeImageIndex: fileImageUrlList.indexOf(itemUrl)
32
+ });
33
+ };
34
+ this.moveNext = () => {
35
+ let {
36
+ fileImageUrlList
37
+ } = this.state;
38
+ this.setState(prevState => ({
39
+ largeImageIndex: (prevState.largeImageIndex + 1) % fileImageUrlList.length
40
+ }));
41
+ };
42
+ this.movePrev = () => {
43
+ let {
44
+ fileImageUrlList
45
+ } = this.state;
46
+ this.setState(prevState => ({
47
+ largeImageIndex: (prevState.largeImageIndex + fileImageUrlList.length - 1) % fileImageUrlList.length
48
+ }));
49
+ };
50
+ this.hideLargeImage = () => {
51
+ this.setState({
52
+ isShowLargeImage: false,
53
+ largeImageIndex: -1
54
+ });
55
+ };
56
+ this.downloadImage = imageItemUrl => {
57
+ const {
58
+ value
59
+ } = this.props;
60
+ const file = value.find(v => v.url === imageItemUrl);
61
+ if (!file) return;
62
+ this.props.getDownLoadFiles([file], _ref => {
63
+ let [dFile] = _ref;
64
+ dFile && (0, _utils.downloadFile)(dFile);
65
+ });
66
+ };
67
+ this.onRotateImage = (imageIndex, degree) => {
68
+ let {
69
+ fileImageUrlList
70
+ } = this.state;
71
+ const imageUrl = fileImageUrlList[imageIndex];
72
+ this.props.onRotateImage && this.props.onRotateImage(imageUrl, degree);
73
+ };
74
+ this.deleteImage = (index, type) => {
75
+ const {
76
+ value
77
+ } = this.props;
78
+ let {
79
+ fileImageUrlList
80
+ } = this.state;
81
+ const imageUrl = fileImageUrlList[index];
82
+ let fileItemIndex = value.findIndex(fileItem => fileItem.url === imageUrl);
83
+ this.props.deleteFile(fileItemIndex, type);
84
+ if (index > fileImageUrlList.length - 2) {
85
+ if (fileImageUrlList.length - 2 < 0) {
86
+ this.hideLargeImage();
87
+ } else {
88
+ this.setState({
89
+ largeImageIndex: 0
90
+ });
91
+ }
92
+ }
93
+ };
94
+ this.togglePreviewer = () => {
95
+ this.props.togglePreviewer(_constants.FILE_EDITOR_STATUS.ADDITION);
96
+ this.props.resetFileValue();
97
+ };
98
+ this.freezeItem = () => {
99
+ this.setState({
100
+ isItemFreezed: true
101
+ });
102
+ };
103
+ this.unFreezeItem = () => {
104
+ this.setState({
105
+ isItemFreezed: false
106
+ });
107
+ };
108
+ this.onSelectFiles = name => {
109
+ const {
110
+ selectedFilesList
111
+ } = this.state;
112
+ let filesList = selectedFilesList.slice(0);
113
+ const selectedFileIndex = selectedFilesList.indexOf(name);
114
+ if (selectedFileIndex > -1) {
115
+ filesList.splice(selectedFileIndex, 1);
116
+ } else {
117
+ filesList.push(name);
118
+ }
119
+ this.setState({
120
+ selectedFilesList: filesList
121
+ });
122
+ };
123
+ this.onSelectAllFiles = () => {
124
+ const {
125
+ value
126
+ } = this.props;
127
+ const {
128
+ selectedFilesList
129
+ } = this.state;
130
+ if (value.length === 0) return;
131
+ let allFilesList = selectedFilesList.slice(0);
132
+ value.map(item => {
133
+ if (selectedFilesList.indexOf(item.name) === -1) {
134
+ allFilesList.push(item.name);
135
+ }
136
+ return null;
137
+ });
138
+ this.setState({
139
+ selectedFilesList: allFilesList
140
+ });
141
+ };
142
+ this.onChangeSelectMultipleFiles = state => {
143
+ this.setState({
144
+ isSelectMultipleFiles: state,
145
+ selectedFilesList: []
146
+ });
147
+ };
148
+ this.onDownloadAllSelectedFiles = () => {
149
+ const {
150
+ config
151
+ } = this.props;
152
+ const {
153
+ selectedFilesList
154
+ } = this.state;
155
+ if (selectedFilesList.length === 0) return;
156
+ this.props.getDownLoadFiles(selectedFilesList, downloadFilesUrlList => {
157
+ if (downloadFilesUrlList.length > 0) {
158
+ (0, _utils.downloadFiles)(downloadFilesUrlList, config);
159
+ }
160
+ this.onChangeSelectMultipleFiles(false);
161
+ });
162
+ };
163
+ this.onDeleteAllSelectedFiles = () => {
164
+ const {
165
+ selectedFilesList
166
+ } = this.state;
167
+ this.props.deleteFiles(selectedFilesList);
168
+ this.onChangeSelectMultipleFiles(false);
169
+ };
170
+ this.renderFilesOperation = () => {
171
+ const {
172
+ value,
173
+ deleteFiles,
174
+ getDownLoadFiles
175
+ } = this.props;
176
+ const {
177
+ isSelectMultipleFiles,
178
+ selectedFilesList
179
+ } = this.state;
180
+ if (value.length === 0) return null;
181
+ return /*#__PURE__*/_react.default.createElement("div", {
182
+ className: "dtable-ui-file-editor-operation-content"
183
+ }, !isSelectMultipleFiles ? /*#__PURE__*/_react.default.createElement("span", {
184
+ onClick: this.onChangeSelectMultipleFiles.bind(this, true)
185
+ }, (0, _lang.getLocale)('Select')) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, selectedFilesList.length > 0 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, deleteFiles && /*#__PURE__*/_react.default.createElement("span", {
186
+ onClick: this.onDeleteAllSelectedFiles
187
+ }, (0, _lang.getLocale)('Delete')), getDownLoadFiles && /*#__PURE__*/_react.default.createElement("span", {
188
+ className: "ml-2",
189
+ onClick: this.onDownloadAllSelectedFiles
190
+ }, (0, _lang.getLocale)('Download'))), /*#__PURE__*/_react.default.createElement("span", {
191
+ className: "ml-2",
192
+ onClick: this.onSelectAllFiles
193
+ }, (0, _lang.getLocale)('Select_all')), /*#__PURE__*/_react.default.createElement("span", {
194
+ className: "ml-2",
195
+ onClick: this.onChangeSelectMultipleFiles.bind(this, false)
196
+ }, (0, _lang.getLocale)('Cancel'))));
197
+ };
198
+ this.state = {
199
+ isShowRename: false,
200
+ value: props.value,
201
+ isItemFreezed: false,
202
+ isShowLargeImage: false,
203
+ isSelectMultipleFiles: false,
204
+ fileImageUrlList: [],
205
+ selectedFilesList: [],
206
+ largeImageIndex: -1
207
+ };
208
+ }
209
+ componentDidMount() {
210
+ this.getFileItemImageUrlList(this.props.value);
211
+ }
212
+ UNSAFE_componentWillReceiveProps(nextProps) {
213
+ if (JSON.stringify(this.props.value) !== JSON.stringify(nextProps.value)) {
214
+ this.getFileItemImageUrlList(nextProps.value);
215
+ }
216
+ }
217
+ render() {
218
+ let {
219
+ value,
220
+ getDownLoadFiles
221
+ } = this.props;
222
+ const {
223
+ isSelectMultipleFiles,
224
+ selectedFilesList
225
+ } = this.state;
226
+ return /*#__PURE__*/_react.default.createElement("div", {
227
+ className: "dtable-ui-file-editor-previewer"
228
+ }, /*#__PURE__*/_react.default.createElement("div", {
229
+ className: "dtable-ui-file-editor-previewer-wrapper"
230
+ }, /*#__PURE__*/_react.default.createElement("div", {
231
+ className: "dtable-ui-file-editor-previewer-header d-flex align-items-center"
232
+ }, selectedFilesList.length > 0 ? /*#__PURE__*/_react.default.createElement("span", {
233
+ className: "dtable-ui-file-editor-count-content"
234
+ }, selectedFilesList.length === 1 ? (0, _lang.getLocale)('1_file_selected') : (0, _lang.getLocale)('Selected_xxx_files', {
235
+ count: selectedFilesList.length
236
+ })) : /*#__PURE__*/_react.default.createElement("span", {
237
+ className: "dtable-ui-file-editor-count-content"
238
+ }, value.length <= 1 ? (0, _lang.getLocale)('xxx_existing_file', {
239
+ count: value.length
240
+ }) : (0, _lang.getLocale)('xxx_existing_files', {
241
+ count: value.length
242
+ })), this.renderFilesOperation()), /*#__PURE__*/_react.default.createElement("div", {
243
+ className: "dtable-ui-file-editor-previewer-content"
244
+ }, value.length > 0 && value.map((fileItem, index) => {
245
+ const isSelected = selectedFilesList.indexOf(fileItem.name) === -1 ? false : true;
246
+ return /*#__PURE__*/_react.default.createElement(_filePreviewer.default, {
247
+ key: fileItem.url,
248
+ fileItem: fileItem,
249
+ deleteFile: this.props.deleteFile,
250
+ renameFile: this.props.renameFile,
251
+ freezeItem: this.freezeItem,
252
+ unFreezeItem: this.unFreezeItem,
253
+ isItemFreezed: this.state.isItemFreezed,
254
+ itemIndex: index,
255
+ isSelected: isSelected,
256
+ showLargeImage: this.showLargeImage,
257
+ onSelectFiles: this.onSelectFiles,
258
+ isSelectMultipleFiles: isSelectMultipleFiles,
259
+ downloadFile: getDownLoadFiles ? this.downloadImage : null
260
+ });
261
+ }))), this.state.isShowLargeImage && /*#__PURE__*/_react.default.createElement(_ImagePreviewerLightbox.default, {
262
+ imageItems: this.state.fileImageUrlList,
263
+ imageIndex: this.state.largeImageIndex,
264
+ closeImagePopup: this.hideLargeImage,
265
+ moveToPrevImage: this.movePrev,
266
+ moveToNextImage: this.moveNext,
267
+ deleteImage: this.deleteImage,
268
+ downloadImage: this.downloadImage,
269
+ onRotateImage: this.onRotateImage
270
+ }), /*#__PURE__*/_react.default.createElement(_DTableCommonAddTool.default, {
271
+ className: "dtable-ui-file-editor-previewer-add-btn",
272
+ callBack: this.togglePreviewer,
273
+ footerName: (0, _lang.getLocale)('Add_files')
274
+ }));
275
+ }
276
+ }
35
277
  var _default = exports.default = FilesPreviewer;
@@ -1 +1,6 @@
1
1
  @import url('../ImageEditor/index.css');
2
+
3
+ .dtable-ui-file-editor-container {
4
+ min-height: 300px;
5
+ }
6
+
@@ -1,35 +1,274 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _reactResponsive = _interopRequireDefault(require("react-responsive"));
11
- var _pcEditor = _interopRequireDefault(require("./pc-editor"));
12
- var _mbEditor = _interopRequireDefault(require("./mb-editor"));
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactstrap = require("reactstrap");
10
+ var _filesPreviewer = _interopRequireDefault(require("./files-previewer"));
11
+ var _additionPreviewer = _interopRequireDefault(require("./addition-previewer"));
12
+ var _constants = require("../constants");
13
+ var _DTableModalHeader = _interopRequireDefault(require("../DTableModalHeader"));
14
+ var _lang = require("../lang");
15
+ var _constants2 = require("./constants");
16
+ var _utils = require("../utils/utils");
17
+ var _toaster = _interopRequireDefault(require("../toaster"));
13
18
  require("./index.css");
14
- const FileEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
15
- let {
16
- isMobile,
17
- ...props
18
- } = _ref;
19
- if (isMobile === false) return /*#__PURE__*/_react.default.createElement(_pcEditor.default, Object.assign({}, props, {
20
- ref: ref
21
- }));
22
- if (isMobile === true) return /*#__PURE__*/_react.default.createElement(_mbEditor.default, Object.assign({}, props, {
23
- ref: ref
24
- }));
25
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
26
- query: "(min-width: 768px)"
27
- }, /*#__PURE__*/_react.default.createElement(_pcEditor.default, Object.assign({}, props, {
28
- ref: ref
29
- }))), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
30
- query: "(max-width: 768px)"
31
- }, /*#__PURE__*/_react.default.createElement(_mbEditor.default, Object.assign({}, props, {
32
- ref: ref
33
- }))));
34
- });
19
+ class FileEditor extends _react.default.Component {
20
+ constructor(props) {
21
+ var _this;
22
+ super(props);
23
+ _this = this;
24
+ this.getValue = () => {
25
+ return this.state.value;
26
+ };
27
+ this.getEditorView = () => {
28
+ const {
29
+ isInModal,
30
+ value
31
+ } = this.props;
32
+ return !value || value.length === 0 || isInModal ? _constants.FILE_EDITOR_STATUS.ADDITION : _constants.FILE_EDITOR_STATUS.PREVIEWER;
33
+ };
34
+ this.deleteImage = function (index) {
35
+ let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
36
+ let uploadLocalFileValue = _this.state.uploadLocalFileValue.slice(0);
37
+ let value = _this.state.value.slice(0);
38
+ if (_this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
39
+ value.splice(index, 1);
40
+ } else {
41
+ if (type === 'localPicture') {
42
+ uploadLocalFileValue.splice(index, 1);
43
+ }
44
+ }
45
+ _this.setState({
46
+ uploadLocalFileValue: uploadLocalFileValue,
47
+ isUpdated: true,
48
+ value: value
49
+ });
50
+ };
51
+ this.resetAdditionImage = () => {
52
+ this.setState({
53
+ uploadLocalFileValue: [],
54
+ imageLinkValue: []
55
+ });
56
+ };
57
+ this.toggle = e => {
58
+ e.stopPropagation();
59
+ if (this.state.isOpen && this.state.isUpdated) {
60
+ if (this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION) {
61
+ let {
62
+ value,
63
+ uploadLocalFileValue
64
+ } = this.state;
65
+ let newValue = value.concat(uploadLocalFileValue);
66
+ this.setState({
67
+ value: newValue
68
+ }, () => {
69
+ this.props.isInModal ? this.props.onCommit(this.getValue()) : this.props.onCommit();
70
+ });
71
+ return;
72
+ }
73
+ this.props.isInModal ? this.props.onCommit(this.getValue()) : this.props.onCommit();
74
+ }
75
+ if (this.props.isInModal) {
76
+ this.props.onToggle();
77
+ }
78
+ const nextIsOpen = !this.state.isOpen;
79
+ this.setState({
80
+ isOpen: nextIsOpen
81
+ }, () => {
82
+ if (!nextIsOpen) {
83
+ this.props.onCommitCancel && this.props.onCommitCancel();
84
+ }
85
+ });
86
+ };
87
+ this.closeEditor = () => {
88
+ this.setState({
89
+ isOpen: false
90
+ });
91
+ };
92
+ this.togglePreviewer = type => {
93
+ this.setState({
94
+ editorView: type
95
+ });
96
+ };
97
+ this.fileUploadCompleted = fileMessage => {
98
+ let uploadLocalFileValue = this.state.uploadLocalFileValue.slice(0);
99
+ let fileUploadMessage = {
100
+ name: fileMessage.name,
101
+ size: fileMessage.size,
102
+ type: fileMessage.type,
103
+ url: fileMessage.url,
104
+ upload_time: fileMessage.upload_time
105
+ };
106
+ uploadLocalFileValue.push(fileUploadMessage);
107
+ this.setState({
108
+ uploadLocalFileValue: uploadLocalFileValue,
109
+ isUpdated: true
110
+ });
111
+ };
112
+ this.addUploadedFile = fileMessageList => {
113
+ const uploadLocalFileValue = [...this.state.uploadLocalFileValue, ...fileMessageList.map(_ref => {
114
+ let {
115
+ name,
116
+ size,
117
+ type,
118
+ url,
119
+ mtime
120
+ } = _ref;
121
+ return {
122
+ name,
123
+ size,
124
+ type: type || 'file',
125
+ url,
126
+ upload_time: mtime
127
+ };
128
+ })];
129
+ this.setState({
130
+ uploadLocalFileValue,
131
+ isUpdated: true
132
+ });
133
+ };
134
+ this.renderHeader = () => {
135
+ let {
136
+ editorView
137
+ } = this.state;
138
+ // if (this.props.isInModal) {
139
+ // return (<span>{getLocale('Add_files')}</span>);
140
+ // }
141
+ if (editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
142
+ return /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('All_files'));
143
+ }
144
+ return /*#__PURE__*/_react.default.createElement("div", {
145
+ onClick: this.showImageListPreviewer
146
+ }, /*#__PURE__*/_react.default.createElement("span", {
147
+ "aria-hidden": "true",
148
+ className: "dtable-font dtable-icon-return mr-2"
149
+ }), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_files')));
150
+ };
151
+ this.showImageListPreviewer = () => {
152
+ let {
153
+ value,
154
+ uploadLocalFileValue,
155
+ imageLinkValue
156
+ } = this.state;
157
+ let newValue = value.concat(uploadLocalFileValue, imageLinkValue);
158
+ this.setState({
159
+ value: newValue
160
+ });
161
+ this.togglePreviewer(_constants.FILE_EDITOR_STATUS.PREVIEWER);
162
+ };
163
+ this.uploadFile = (file, callback) => {
164
+ return this.props.uploadFile(file, _constants2.FILES_FOLDER, callback);
165
+ };
166
+ this.resetFileValue = () => {
167
+ this.setState({
168
+ uploadLocalFileValue: []
169
+ });
170
+ };
171
+ this.deleteFile = (index, type) => {
172
+ let uploadLocalFileValue = this.state.uploadLocalFileValue.slice(0);
173
+ let value = this.state.value.slice(0);
174
+ if (this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER) {
175
+ value.splice(index, 1);
176
+ } else {
177
+ if (type === 'localFile') {
178
+ uploadLocalFileValue.splice(index, 1);
179
+ }
180
+ }
181
+ this.setState({
182
+ uploadLocalFileValue: uploadLocalFileValue,
183
+ isUpdated: true,
184
+ value: value
185
+ });
186
+ };
187
+ this.deleteFilesByPreviewer = fileList => {
188
+ const result = this.state.value.filter(file => !fileList.includes(file.name));
189
+ this.setState({
190
+ isUpdated: true,
191
+ value: result
192
+ });
193
+ };
194
+ this.onRenameFile = (index, newName) => {
195
+ let newValue = this.state.value.slice(0);
196
+ let fileItem = newValue[index];
197
+ if (!this.props.renameFile) return;
198
+ this.props.renameFile(fileItem, newName).then(res => {
199
+ const {
200
+ name,
201
+ url
202
+ } = res.data;
203
+ fileItem = {
204
+ ...fileItem,
205
+ name,
206
+ url
207
+ };
208
+ newValue[index] = fileItem;
209
+ this.setState({
210
+ value: newValue
211
+ });
212
+ }).catch(error => {
213
+ const errorMessage = (0, _utils.getErrorMsg)(error);
214
+ if (!error.response || error.response.status !== 403) {
215
+ _toaster.default.danger((0, _lang.getLocale)(errorMessage));
216
+ }
217
+ });
218
+ };
219
+ this.onRotateImage = (url, degree) => {
220
+ this.props.rotateImage(url, degree).then(res => {
221
+ // todo
222
+ }).catch(error => {
223
+ const errorMessage = (0, _utils.getErrorMsg)(error);
224
+ if (!error.response || error.response.status !== 403) {
225
+ _toaster.default.danger((0, _lang.getLocale)(errorMessage));
226
+ }
227
+ });
228
+ };
229
+ this.state = {
230
+ value: props.value || [],
231
+ editorView: this.getEditorView(),
232
+ isOpen: true,
233
+ isShowFileChooser: false,
234
+ uploadLocalFileValue: [],
235
+ imageLinkValue: [],
236
+ isUpdated: false
237
+ };
238
+ }
239
+ render() {
240
+ return /*#__PURE__*/_react.default.createElement(_reactstrap.Modal, {
241
+ className: "dtable-ui-image-editor-dialog dtable-ui-file-editor-dialog",
242
+ contentClassName: "dtable-ui-image-editor-modal",
243
+ isOpen: this.state.isOpen,
244
+ toggle: this.toggle
245
+ }, /*#__PURE__*/_react.default.createElement(_DTableModalHeader.default, {
246
+ toggle: this.toggle
247
+ }, this.renderHeader()), /*#__PURE__*/_react.default.createElement(_reactstrap.ModalBody, {
248
+ className: "p-0"
249
+ }, /*#__PURE__*/_react.default.createElement("div", {
250
+ className: "dtable-ui-image-editor-container dtable-ui-file-editor-container"
251
+ }, this.state.editorView === _constants.FILE_EDITOR_STATUS.PREVIEWER && /*#__PURE__*/_react.default.createElement(_filesPreviewer.default, {
252
+ value: this.state.value,
253
+ config: this.props.config,
254
+ togglePreviewer: this.togglePreviewer,
255
+ deleteFile: this.deleteFile,
256
+ deleteFiles: this.deleteFilesByPreviewer,
257
+ renameFile: this.props.renameFile ? this.onRenameFile : null,
258
+ resetFileValue: this.resetFileValue,
259
+ rotateImage: this.props.rotateImage ? this.onRotateImage : null,
260
+ getDownLoadFiles: this.props.getDownLoadFiles || (() => {})
261
+ }), this.state.editorView === _constants.FILE_EDITOR_STATUS.ADDITION && /*#__PURE__*/_react.default.createElement(_additionPreviewer.default, {
262
+ config: this.props.config,
263
+ deleteImage: this.deleteImage,
264
+ handleFilesChange: this.handleFilesChange,
265
+ uploadLocalFileValue: this.state.uploadLocalFileValue,
266
+ togglePreviewer: this.togglePreviewer,
267
+ fileUploadCompleted: this.fileUploadCompleted,
268
+ addUploadedFile: this.addUploadedFile,
269
+ showImageListPreviewer: this.showImageListPreviewer,
270
+ uploadFile: this.uploadFile
271
+ }))));
272
+ }
273
+ }
35
274
  var _default = exports.default = FileEditor;
@@ -5,13 +5,13 @@
5
5
  margin-right: 10px;
6
6
  }
7
7
 
8
- .dtable-ui.dtable-ui-row-expand-formatter .formula-formatter-content-item {
8
+ .dtable-ui.dtable-row-expand-formatter .formula-formatter-content-item {
9
9
  margin-top: 0.5rem;
10
10
  margin-bottom: 5px;
11
11
  }
12
12
 
13
- .dtable-ui.dtable-ui-row-expand-formatter .formula-url-formatter-column .formula-url-link,
14
- .dtable-ui.dtable-ui-row-expand-formatter .formula-url-formatter-column .formula-email-link {
13
+ .dtable-ui.dtable-row-expand-formatter .formula-url-formatter-column .formula-url-link,
14
+ .dtable-ui.dtable-row-expand-formatter .formula-url-formatter-column .formula-email-link {
15
15
  display: flex;
16
16
  align-items: center;
17
17
  font-size: 14px;
@@ -28,8 +28,8 @@
28
28
  box-shadow: 0 0 1px;
29
29
  }
30
30
 
31
- .dtable-ui.dtable-ui-row-expand-formatter .formula-url-formatter-column .formula-email-link:hover,
32
- .dtable-ui.dtable-ui-row-expand-formatter .formula-url-formatter-column .formula-url-link:hover {
31
+ .dtable-ui.dtable-row-expand-formatter .formula-url-formatter-column .formula-email-link:hover,
32
+ .dtable-ui.dtable-row-expand-formatter .formula-url-formatter-column .formula-url-link:hover {
33
33
  background: #f5f5f5;
34
34
  border: 1px solid #c9c9c9;
35
35
  }