dtable-ui-component 6.0.25 → 6.0.26-beta1

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 (323) hide show
  1. package/lib/BodyPortal/index.js +29 -0
  2. package/lib/CheckboxEditor/index.js +20 -116
  3. package/lib/CheckboxEditor/lg.js +118 -0
  4. package/lib/CheckboxEditor/sm.js +101 -0
  5. package/lib/CollaboratorEditor/index.js +19 -9
  6. package/lib/CollaboratorEditor/{pc-collaborator-editor → lg}/index.js +2 -2
  7. package/lib/CollaboratorEditor/sm/index.css +41 -0
  8. package/lib/CollaboratorEditor/sm/index.js +88 -0
  9. package/lib/DTableCommonAddTool/index.js +1 -3
  10. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +3 -3
  11. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +4 -4
  12. package/lib/DateEditor/index.js +68 -95
  13. package/lib/DateEditor/{pc-date-editor-popover.js → large.js} +6 -6
  14. package/lib/DateEditor/sm/custom-rc-calendar.css +118 -0
  15. package/lib/DateEditor/sm/index.css +40 -0
  16. package/lib/DateEditor/{mb-date-editor-popover → sm}/index.js +20 -35
  17. package/lib/{Department-editor → DepartmentEditor}/constants.js +7 -0
  18. package/lib/{Department-editor → DepartmentEditor}/department-multiple-select/index.css +4 -1
  19. package/lib/{Department-editor → DepartmentEditor}/department-multiple-select/index.js +7 -4
  20. package/lib/DepartmentEditor/index.js +34 -0
  21. package/lib/{Department-editor → DepartmentEditor/lg}/department-single-select.js +10 -7
  22. package/lib/{Department-editor → DepartmentEditor/lg}/index.css +12 -3
  23. package/lib/{Department-editor → DepartmentEditor/lg}/index.js +8 -25
  24. package/lib/DepartmentEditor/sm/index.css +4 -0
  25. package/lib/DepartmentEditor/sm/index.js +220 -0
  26. package/lib/DigitalSignEditor/index.js +24 -171
  27. package/lib/DigitalSignEditor/lg/index.js +181 -0
  28. package/lib/DigitalSignEditor/sm/index.css +35 -0
  29. package/lib/DigitalSignEditor/sm/index.js +139 -0
  30. package/lib/FileEditor/files-previewer/index.js +16 -267
  31. package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/dropdown-menu.js +1 -1
  32. package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/file-name-editor/index.js +1 -1
  33. package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/index.css +0 -2
  34. package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/index.js +2 -2
  35. package/lib/FileEditor/files-previewer/lg/index.js +276 -0
  36. package/lib/FileEditor/files-previewer/sm/file-previewer/index.js +122 -0
  37. package/lib/FileEditor/files-previewer/sm/index.css +39 -0
  38. package/lib/FileEditor/files-previewer/sm/index.js +59 -0
  39. package/lib/FileEditor/index.css +0 -5
  40. package/lib/FileEditor/index.js +26 -265
  41. package/lib/FileEditor/lg/addition-previewer/index.css +1 -0
  42. package/lib/FileEditor/{addition-previewer → lg/addition-previewer}/index.js +1 -1
  43. package/lib/FileEditor/lg/addition-previewer/local-file-addition/index.css +1 -0
  44. package/lib/FileEditor/{addition-previewer → lg/addition-previewer}/local-file-addition/index.js +4 -4
  45. package/lib/FileEditor/lg/index.css +5 -0
  46. package/lib/FileEditor/lg/index.js +274 -0
  47. package/lib/FileEditor/sm/index.css +10 -0
  48. package/lib/FileEditor/sm/index.js +131 -0
  49. package/lib/FileFormatter/index.js +98 -38
  50. package/lib/FileItemFormatter/index.js +3 -1
  51. package/lib/FormulaFormatter/index.css +5 -5
  52. package/lib/GeolocationEditor/index.js +88 -231
  53. package/lib/GeolocationEditor/{country-editor.js → lg/country-editor.js} +5 -49
  54. package/lib/GeolocationEditor/{index.css → lg/index.css} +1 -2
  55. package/lib/GeolocationEditor/lg/index.js +247 -0
  56. package/lib/GeolocationEditor/{location-editor.js → lg/location-editor.js} +8 -41
  57. package/lib/GeolocationEditor/{map-editor → lg/map-editor}/index.js +6 -6
  58. package/lib/GeolocationEditor/{map-editor → lg/map-editor}/large-editor/index.js +7 -7
  59. package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/index.js +7 -7
  60. package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/large-editor/index.js +7 -7
  61. package/lib/GeolocationEditor/{province-city-editor.js → lg/province-city-editor.js} +7 -38
  62. package/lib/GeolocationEditor/{province-editor.js → lg/province-editor.js} +7 -31
  63. package/lib/GeolocationEditor/{selector-header-item.js → lg/selector-header-item.js} +1 -1
  64. package/lib/GeolocationEditor/map-editor-utils.js +6 -2
  65. package/lib/GeolocationEditor/sm/country-editor.js +70 -0
  66. package/lib/GeolocationEditor/sm/index.css +11 -0
  67. package/lib/GeolocationEditor/sm/index.js +125 -0
  68. package/lib/GeolocationEditor/sm/location-editor.js +93 -0
  69. package/lib/GeolocationEditor/sm/map-editor/index.css +11 -0
  70. package/lib/GeolocationEditor/sm/map-editor/index.js +469 -0
  71. package/lib/GeolocationEditor/sm/map-selection-editor/index.css +158 -0
  72. package/lib/GeolocationEditor/sm/map-selection-editor/index.js +525 -0
  73. package/lib/GeolocationEditor/sm/province-city-editor.js +68 -0
  74. package/lib/GeolocationEditor/sm/province-editor.js +67 -0
  75. package/lib/ImageEditor/images-previewer/image-preview/index.js +2 -2
  76. package/lib/ImageEditor/images-previewer/index.js +3 -3
  77. package/lib/ImageEditor/index.css +17 -16
  78. package/lib/ImageEditor/index.js +26 -185
  79. package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/image-link/index.js +1 -1
  80. package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/index.js +1 -1
  81. package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/local-image-addition/index.js +4 -4
  82. package/lib/ImageEditor/lg/images-previewer/index.js +140 -0
  83. package/lib/ImageEditor/lg/index.css +24 -0
  84. package/lib/ImageEditor/lg/index.js +194 -0
  85. package/lib/ImageEditor/sm/index.css +29 -0
  86. package/lib/ImageEditor/sm/index.js +131 -0
  87. package/lib/ImageThumbnail/index.js +2 -1
  88. package/lib/LinkEditor/pc-link-editor-popover/index.css +1 -1
  89. package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
  90. package/lib/MobileFullScreenPage/body/index.css +9 -0
  91. package/lib/MobileFullScreenPage/body/index.js +23 -0
  92. package/lib/MobileFullScreenPage/header/index.css +35 -0
  93. package/lib/MobileFullScreenPage/header/index.js +38 -0
  94. package/lib/MobileFullScreenPage/index.css +13 -0
  95. package/lib/MobileFullScreenPage/index.js +81 -0
  96. package/lib/MobileModal/index.js +41 -0
  97. package/lib/MobileOperationSheet/index.css +27 -0
  98. package/lib/MobileOperationSheet/index.js +92 -0
  99. package/lib/MobileSelectorEditor/empty/index.css +3 -0
  100. package/lib/MobileSelectorEditor/empty/index.js +23 -0
  101. package/lib/MobileSelectorEditor/index.css +32 -0
  102. package/lib/MobileSelectorEditor/index.js +57 -0
  103. package/lib/MobileSelectorEditor/option/index.css +28 -0
  104. package/lib/MobileSelectorEditor/option/index.js +36 -0
  105. package/lib/MobileSelectorEditor/options/index.css +8 -0
  106. package/lib/MobileSelectorEditor/options/index.js +18 -0
  107. package/lib/MobileSelectorEditor/search/index.css +7 -0
  108. package/lib/MobileSelectorEditor/search/index.js +26 -0
  109. package/lib/MobileUpload/index.css +1 -0
  110. package/lib/MobileUpload/index.js +160 -0
  111. package/lib/MultipleSelectEditor/index.js +9 -14
  112. package/lib/RowExpand/index.js +19 -0
  113. package/lib/{RowExpandDialog → RowExpand/lg}/body/index.js +4 -4
  114. package/lib/{RowExpandDialog → RowExpand/lg}/column-content/index.js +2 -2
  115. package/lib/{RowExpandDialog → RowExpand/lg}/header/index.js +3 -3
  116. package/lib/{RowExpandDialog → RowExpand/lg}/index.js +6 -6
  117. package/lib/RowExpand/sm/body/index.css +173 -0
  118. package/lib/RowExpand/sm/body/index.js +111 -0
  119. package/lib/RowExpand/sm/column-content/index.css +27 -0
  120. package/lib/RowExpand/sm/column-content/index.js +25 -0
  121. package/lib/RowExpand/sm/index.css +0 -0
  122. package/lib/RowExpand/sm/index.js +172 -0
  123. package/lib/RowExpandEditor/RightAngle/index.css +6 -0
  124. package/lib/RowExpandEditor/RightAngle/index.js +17 -0
  125. package/lib/RowExpandEditor/RowExpandAddBtn/index.js +12 -17
  126. package/lib/RowExpandEditor/RowExpandAddBtn/lg/index.js +26 -0
  127. package/lib/RowExpandEditor/RowExpandAddBtn/sm/index.css +3 -0
  128. package/lib/RowExpandEditor/RowExpandAddBtn/sm/index.js +19 -0
  129. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +10 -33
  130. package/lib/RowExpandEditor/RowExpandCheckboxEditor/lg.js +42 -0
  131. package/lib/RowExpandEditor/RowExpandCheckboxEditor/sm/index.css +6 -0
  132. package/lib/RowExpandEditor/RowExpandCheckboxEditor/sm/index.js +39 -0
  133. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +10 -223
  134. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/{index.css → lg/index.css} +1 -1
  135. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/lg/index.js +231 -0
  136. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/sm/index.css +9 -0
  137. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/sm/index.js +163 -0
  138. package/lib/RowExpandEditor/RowExpandDateEditor/index.js +10 -121
  139. package/lib/RowExpandEditor/RowExpandDateEditor/lg.js +130 -0
  140. package/lib/RowExpandEditor/RowExpandDateEditor/sm.js +84 -0
  141. package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +11 -96
  142. package/lib/RowExpandEditor/RowExpandDepartmentEditor/lg.js +101 -0
  143. package/lib/RowExpandEditor/RowExpandDepartmentEditor/sm.js +65 -0
  144. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +10 -199
  145. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/{index.css → lg/index.css} +1 -1
  146. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/lg/index.js +208 -0
  147. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/sm/index.css +1 -0
  148. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/sm/index.js +130 -0
  149. package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +11 -97
  150. package/lib/RowExpandEditor/RowExpandDurationEditor/lg.js +105 -0
  151. package/lib/RowExpandEditor/RowExpandDurationEditor/sm.js +71 -0
  152. package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +10 -116
  153. package/lib/RowExpandEditor/RowExpandEmailEditor/lg/index.css +1 -0
  154. package/lib/RowExpandEditor/RowExpandEmailEditor/lg/index.js +125 -0
  155. package/lib/RowExpandEditor/RowExpandEmailEditor/sm/index.css +1 -0
  156. package/lib/RowExpandEditor/RowExpandEmailEditor/sm/index.js +84 -0
  157. package/lib/RowExpandEditor/RowExpandFileEditor/index.js +10 -139
  158. package/lib/RowExpandEditor/RowExpandFileEditor/lg/index.css +1 -0
  159. package/lib/RowExpandEditor/RowExpandFileEditor/lg/index.js +148 -0
  160. package/lib/RowExpandEditor/RowExpandFileEditor/sm/index.js +116 -0
  161. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +10 -156
  162. package/lib/RowExpandEditor/RowExpandGeolocationEditor/lg/index.js +164 -0
  163. package/lib/RowExpandEditor/RowExpandGeolocationEditor/sm/index.css +0 -0
  164. package/lib/RowExpandEditor/RowExpandGeolocationEditor/sm/index.js +101 -0
  165. package/lib/RowExpandEditor/RowExpandImageEditor/index.js +10 -161
  166. package/lib/RowExpandEditor/RowExpandImageEditor/lg/index.js +170 -0
  167. package/lib/RowExpandEditor/RowExpandImageEditor/sm/index.css +25 -0
  168. package/lib/RowExpandEditor/RowExpandImageEditor/sm/index.js +109 -0
  169. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +11 -115
  170. package/lib/RowExpandEditor/RowExpandLongTextEditor/lg/index.js +123 -0
  171. package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/editor/index.css +10 -0
  172. package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/editor/index.js +80 -0
  173. package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/index.css +3 -0
  174. package/lib/RowExpandEditor/RowExpandLongTextEditor/sm/index.js +91 -0
  175. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +10 -238
  176. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/{index.css → lg/index.css} +1 -1
  177. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/lg/index.js +247 -0
  178. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/sm/index.css +0 -0
  179. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/sm/index.js +155 -0
  180. package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +10 -96
  181. package/lib/RowExpandEditor/RowExpandNumberEditor/lg.js +105 -0
  182. package/lib/RowExpandEditor/RowExpandNumberEditor/sm/index.css +3 -0
  183. package/lib/RowExpandEditor/RowExpandNumberEditor/sm/index.js +76 -0
  184. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +21 -0
  185. package/lib/RowExpandEditor/RowExpandRateEditor/index.js +10 -142
  186. package/lib/RowExpandEditor/RowExpandRateEditor/lg.js +151 -0
  187. package/lib/RowExpandEditor/RowExpandRateEditor/sm.js +92 -0
  188. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +11 -198
  189. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/lg/index.js +206 -0
  190. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/sm/index.css +8 -0
  191. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/sm/index.js +134 -0
  192. package/lib/RowExpandEditor/RowExpandTextEditor/index.js +11 -128
  193. package/lib/RowExpandEditor/RowExpandTextEditor/lg/index.js +136 -0
  194. package/lib/RowExpandEditor/RowExpandTextEditor/sm/index.css +14 -0
  195. package/lib/RowExpandEditor/RowExpandTextEditor/sm/index.js +37 -0
  196. package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +10 -121
  197. package/lib/RowExpandEditor/RowExpandUrlEditor/lg/index.js +130 -0
  198. package/lib/RowExpandEditor/RowExpandUrlEditor/sm/index.css +17 -0
  199. package/lib/RowExpandEditor/RowExpandUrlEditor/sm/index.js +87 -0
  200. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +10 -18
  201. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/lg.js +27 -0
  202. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/sm.js +20 -0
  203. package/lib/RowExpandFormatter/RowExpandEmailFormatter/index.css +4 -4
  204. package/lib/RowExpandFormatter/RowExpandRateFormatter/index.css +1 -1
  205. package/lib/RowExpandFormatter/index.css +18 -18
  206. package/lib/RowExpandFormatter/index.js +1 -1
  207. package/lib/SelectItem/index.js +57 -33
  208. package/lib/SingleSelectEditor/index.js +9 -14
  209. package/lib/SvgIcon/index.js +2 -1
  210. package/lib/constants/file.js +1 -0
  211. package/lib/constants/index.js +3 -2
  212. package/lib/index.js +42 -98
  213. package/lib/locales/zh-CN.json +1 -1
  214. package/lib/select-editor/index.js +27 -20
  215. package/lib/select-editor/{pc-select-editor → lg}/index.css +1 -1
  216. package/lib/select-editor/{pc-select-editor → lg}/index.js +10 -10
  217. package/lib/select-editor/sm/index.css +1 -0
  218. package/lib/select-editor/sm/index.js +105 -0
  219. package/lib/utils/get-event-transfer.js +2 -1
  220. package/lib/utils/utils.js +11 -2
  221. package/package.json +3 -12
  222. package/lib/ActionSheet/index.js +0 -194
  223. package/lib/ActionSheet/style/index.css +0 -365
  224. package/lib/ActivityIndicator/index.css +0 -108
  225. package/lib/ActivityIndicator/index.js +0 -76
  226. package/lib/Badge/index.css +0 -96
  227. package/lib/Badge/index.js +0 -65
  228. package/lib/CollaboratorEditor/mb-collaborator-editor/index.css +0 -85
  229. package/lib/CollaboratorEditor/mb-collaborator-editor/index.js +0 -148
  230. package/lib/DateEditor/mb-date-editor-popover/custom-rc-calendar.css +0 -118
  231. package/lib/DateEditor/mb-date-editor-popover/index.css +0 -45
  232. package/lib/DatePicker/index.js +0 -120
  233. package/lib/DatePicker/locale/en_US.js +0 -14
  234. package/lib/DatePicker/locale/ru_RU.js +0 -14
  235. package/lib/DatePicker/locale/sv_SE.js +0 -14
  236. package/lib/DatePicker/locale/zh_CN.js +0 -14
  237. package/lib/DatePicker/style/index.css +0 -290
  238. package/lib/DatePicker/utils.js +0 -36
  239. package/lib/Drawer/index.css +0 -142
  240. package/lib/Drawer/index.js +0 -21
  241. package/lib/FileEditor/addition-previewer/index.css +0 -1
  242. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
  243. package/lib/Icon/index.css +0 -50
  244. package/lib/Icon/index.js +0 -34
  245. package/lib/Icon/load-sprite.js +0 -56
  246. package/lib/InputItem/custom-input.js +0 -321
  247. package/lib/InputItem/custom-keyboard.js +0 -162
  248. package/lib/InputItem/index.js +0 -388
  249. package/lib/InputItem/input.js +0 -45
  250. package/lib/InputItem/locale/en_US.js +0 -12
  251. package/lib/InputItem/locale/ru_RU.js +0 -12
  252. package/lib/InputItem/locale/sv_SE.js +0 -12
  253. package/lib/InputItem/locale/zh_CN.js +0 -12
  254. package/lib/InputItem/portal.js +0 -23
  255. package/lib/InputItem/style/index.css +0 -512
  256. package/lib/List/index.css +0 -381
  257. package/lib/List/index.js +0 -41
  258. package/lib/List/list-item.js +0 -169
  259. package/lib/Modal/alert.js +0 -82
  260. package/lib/Modal/index.js +0 -15
  261. package/lib/Modal/modal.js +0 -118
  262. package/lib/Modal/operation.js +0 -77
  263. package/lib/Modal/prompt.js +0 -207
  264. package/lib/Picker/AbstractPicker.js +0 -190
  265. package/lib/Picker/index.js +0 -28
  266. package/lib/Picker/locale/en_US.js +0 -12
  267. package/lib/Picker/locale/ru_RU.js +0 -12
  268. package/lib/Picker/locale/sv_SE.js +0 -12
  269. package/lib/Picker/locale/zh_CN.js +0 -12
  270. package/lib/Picker/popupProps.js +0 -12
  271. package/lib/Picker/style/index.css +0 -141
  272. package/lib/Popover/index.js +0 -62
  273. package/lib/Popover/item.js +0 -55
  274. package/lib/Popover/style/index.css +0 -229
  275. package/lib/Progress/index.css +0 -22
  276. package/lib/Progress/index.js +0 -65
  277. package/lib/Radio/Radio.js +0 -47
  278. package/lib/Radio/RadioItem.js +0 -57
  279. package/lib/Radio/index.css +0 -90
  280. package/lib/Radio/index.js +0 -12
  281. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
  282. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
  283. package/lib/TabBar/Tab.js +0 -76
  284. package/lib/TabBar/index.css +0 -138
  285. package/lib/TabBar/index.js +0 -128
  286. package/lib/Tabs/index.css +0 -443
  287. package/lib/Tabs/index.js +0 -38
  288. package/lib/TextareaItem/index.css +0 -231
  289. package/lib/TextareaItem/index.js +0 -231
  290. package/lib/Toast/index.css +0 -65
  291. package/lib/Toast/index.js +0 -131
  292. package/lib/_util/class.js +0 -34
  293. package/lib/_util/closest.js +0 -17
  294. package/lib/_util/exenv.js +0 -8
  295. package/lib/_util/getDataAttr.js +0 -15
  296. package/lib/_util/getLocale.js +0 -42
  297. package/lib/select-editor/mb-select-editor/index.css +0 -127
  298. package/lib/select-editor/mb-select-editor/index.js +0 -197
  299. package/lib/select-editor/select-editor-option.js +0 -84
  300. /package/lib/CollaboratorEditor/{pc-collaborator-editor → lg}/index.css +0 -0
  301. /package/lib/{Department-editor → DepartmentEditor}/selected-departments/index.css +0 -0
  302. /package/lib/{Department-editor → DepartmentEditor}/selected-departments/index.js +0 -0
  303. /package/lib/{Department-editor → DepartmentEditor}/utils.js +0 -0
  304. /package/lib/DigitalSignEditor/{index.css → lg/index.css} +0 -0
  305. /package/lib/FileEditor/files-previewer/{file-previewer → lg/file-previewer}/file-name-editor/index.css +0 -0
  306. /package/lib/GeolocationEditor/{map-editor → lg/map-editor}/large-editor/index.css +0 -0
  307. /package/lib/GeolocationEditor/{map-selection-editor → lg/map-selection-editor}/large-editor/index.css +0 -0
  308. /package/lib/GeolocationEditor/{parse-geolocation.js → lg/parse-geolocation.js} +0 -0
  309. /package/lib/GeolocationEditor/{selector-list.js → lg/selector-list.js} +0 -0
  310. /package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/image-link/index.css +0 -0
  311. /package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/index.css +0 -0
  312. /package/lib/ImageEditor/{addition-previewer → lg/addition-previewer}/local-image-addition/index.css +0 -0
  313. /package/lib/{RowExpandDialog → RowExpand/lg}/body/index.css +0 -0
  314. /package/lib/{RowExpandDialog → RowExpand/lg}/column-content/index.css +0 -0
  315. /package/lib/{RowExpandDialog → RowExpand/lg}/header/index.css +0 -0
  316. /package/lib/{RowExpandDialog → RowExpand/lg}/index.css +0 -0
  317. /package/lib/RowExpandEditor/RowExpandAddBtn/{index.css → lg/index.css} +0 -0
  318. /package/lib/RowExpandEditor/RowExpandGeolocationEditor/{index.css → lg/index.css} +0 -0
  319. /package/lib/RowExpandEditor/RowExpandImageEditor/{index.css → lg/index.css} +0 -0
  320. /package/lib/RowExpandEditor/RowExpandLongTextEditor/{index.css → lg/index.css} +0 -0
  321. /package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/{index.css → lg/index.css} +0 -0
  322. /package/lib/RowExpandEditor/RowExpandTextEditor/{index.css → lg/index.css} +0 -0
  323. /package/lib/RowExpandEditor/RowExpandUrlEditor/{index.css → lg/index.css} +0 -0
@@ -7,23 +7,20 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _DTablePopover = _interopRequireDefault(require("../DTablePopover"));
11
- var _constants = require("./constants");
10
+ var _DTablePopover = _interopRequireDefault(require("../../DTablePopover"));
12
11
  var _departmentSingleSelect = _interopRequireDefault(require("./department-single-select"));
13
- var _lang = require("../lang");
14
12
  require("./index.css");
15
- class DepartmentSingleSelectEditor extends _react.Component {
13
+ class Large extends _react.Component {
16
14
  constructor(props) {
17
15
  super(props);
18
16
  this.onCommit = value => {
19
17
  const {
20
- onCommit,
21
- column
18
+ onCommit
22
19
  } = this.props;
23
20
  this.setState({
24
21
  value
25
22
  }, () => {
26
- this.isRowExpand ? onCommit(this.getValue(), column) : onCommit();
23
+ this.isRowExpand ? onCommit(value) : onCommit();
27
24
  });
28
25
  };
29
26
  this.getValue = () => {
@@ -31,28 +28,14 @@ class DepartmentSingleSelectEditor extends _react.Component {
31
28
  updated[this.props.column.key] = this.state.value;
32
29
  return updated;
33
30
  };
34
- this.createSpecificDepartments = () => {
35
- return _constants.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map(option => {
36
- const {
37
- type,
38
- name
39
- } = option;
40
- return {
41
- value: type,
42
- label: /*#__PURE__*/_react.default.createElement("span", {
43
- className: "text-truncate department-name"
44
- }, (0, _lang.getLocale)(name))
45
- };
46
- });
47
- };
48
31
  const {
49
- column: _column,
32
+ column,
50
33
  isInModal,
51
34
  value: _value,
52
35
  height
53
36
  } = props;
54
- const editorWidth = _column.width > 300 ? _column.width : 300;
55
- const data = _column.data || {};
37
+ const editorWidth = column.width > 300 ? column.width : 300;
38
+ const data = column.data || {};
56
39
  this.state = {
57
40
  value: _value || '',
58
41
  menuStyle: isInModal ? {} : {
@@ -103,4 +86,4 @@ class DepartmentSingleSelectEditor extends _react.Component {
103
86
  }, dom)) : dom;
104
87
  }
105
88
  }
106
- var _default = exports.default = DepartmentSingleSelectEditor;
89
+ var _default = exports.default = Large;
@@ -0,0 +1,4 @@
1
+ .mobile-dtable-ui-department-editor .mobile-dtable-ui-department-editor-department-item .dtable-radio {
2
+ margin-top: 2px;
3
+ margin-bottom: 0;
4
+ }
@@ -0,0 +1,220 @@
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 _list = _interopRequireDefault(require("antd-mobile/lib/list"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+ var _DTableRadio = _interopRequireDefault(require("../../DTableRadio"));
12
+ var _MobileFullScreenPage = _interopRequireDefault(require("../../MobileFullScreenPage"));
13
+ var _utils = require("../utils");
14
+ var _constants = require("../constants");
15
+ var _lang = require("../../lang");
16
+ require("./index.css");
17
+ const Item = _list.default.Item;
18
+ const Small = _ref => {
19
+ let {
20
+ value: oldValue,
21
+ column,
22
+ isSupportMultiple = false,
23
+ isFilterEditor = false,
24
+ userDepartmentIdsMap = {},
25
+ departments: initialDepartments = [],
26
+ onCommit,
27
+ onClose
28
+ } = _ref;
29
+ const [value, setValue] = (0, _react.useState)(oldValue ? oldValue : isSupportMultiple ? [] : '');
30
+ const [departments, setDepartments] = (0, _react.useState)([]);
31
+ const [parentId, setParentId] = (0, _react.useState)('');
32
+ const [topParentIds, setTopParentIds] = (0, _react.useState)([]);
33
+ const initColumnData = (0, _react.useMemo)(() => {
34
+ const data = column.data || {};
35
+ const enableSelectRange = data.enable_select_range || false;
36
+ const selectedRange = data.selected_range || '';
37
+ const specificDepartments = data.specific_departments || [];
38
+ return {
39
+ enableSelectRange,
40
+ selectedRange,
41
+ specificDepartments
42
+ };
43
+ }, [column]);
44
+ const onSave = (0, _react.useCallback)(() => {
45
+ !isFilterEditor && onCommit && onCommit(value);
46
+ onClose && onClose();
47
+ }, [isFilterEditor, value, onCommit, onClose]);
48
+ const onDepartmentClick = (0, _react.useCallback)((event, department) => {
49
+ event.preventDefault();
50
+ const {
51
+ id,
52
+ hasChild
53
+ } = department;
54
+ if (event.target && event.target.className.indexOf('am-list-arrow') > -1) {
55
+ if (!hasChild) return;
56
+ setParentId(id);
57
+ return;
58
+ }
59
+ let newValue;
60
+ if (isSupportMultiple) {
61
+ newValue = value.slice(0);
62
+ const index = newValue.indexOf(id);
63
+ index === -1 ? newValue.push(id) : newValue.splice(index);
64
+ } else {
65
+ newValue = id === value ? '' : id;
66
+ }
67
+ if (isFilterEditor) {
68
+ onCommit && onCommit({
69
+ id
70
+ });
71
+ }
72
+ setValue(newValue);
73
+ }, [isSupportMultiple, isFilterEditor, value, onCommit]);
74
+ const onParentDepartmentClick = (0, _react.useCallback)((event, type) => {
75
+ event.preventDefault();
76
+ let newValue;
77
+ if (isSupportMultiple) {
78
+ newValue = value.slice(0);
79
+ const index = newValue.indexOf(type);
80
+ index === -1 ? newValue.push(type) : newValue.splice(index);
81
+ } else {
82
+ newValue = type === value ? '' : type;
83
+ }
84
+ if (isFilterEditor) {
85
+ onCommit && onCommit({
86
+ id: type
87
+ });
88
+ }
89
+ setValue(newValue);
90
+ }, [value, isFilterEditor, isSupportMultiple, onCommit]);
91
+ const onLeftClick = (0, _react.useCallback)(() => {
92
+ const parentDepartment = departments.find(item => item.id === parentId);
93
+ if (!parentDepartment) {
94
+ onClose && onClose();
95
+ return;
96
+ }
97
+ const {
98
+ enableSelectRange
99
+ } = initColumnData;
100
+ if (topParentIds.includes(parentId) && enableSelectRange) {
101
+ setParentId('');
102
+ return;
103
+ }
104
+ const upperLevelDepartmentParentId = parentDepartment.parent_id;
105
+ setParentId(upperLevelDepartmentParentId);
106
+ }, [initColumnData, departments, parentId, topParentIds, onClose]);
107
+ const renderLeftContent = (0, _react.useCallback)(() => {
108
+ const parentDepartment = departments.find(item => item.id === parentId);
109
+ if (!parentDepartment && !isFilterEditor) return (0, _lang.getLocale)('Cancel');
110
+ return /*#__PURE__*/_react.default.createElement("i", {
111
+ "aria-hidden": "true",
112
+ className: "dtable-font dtable-icon-return"
113
+ });
114
+ }, [isFilterEditor, departments, parentId]);
115
+ const renderDepartments = (0, _react.useCallback)(() => {
116
+ const {
117
+ enableSelectRange
118
+ } = initColumnData;
119
+ let currentDepartments = [];
120
+ if (enableSelectRange && !parentId && !isFilterEditor) {
121
+ currentDepartments = departments.filter(department => topParentIds.includes(department.id));
122
+ } else {
123
+ currentDepartments = departments.filter(department => department.parent_id === parentId);
124
+ }
125
+ if (currentDepartments.length === 0) {
126
+ return /*#__PURE__*/_react.default.createElement("div", {
127
+ className: "empty-department-list d-flex justify-content-center"
128
+ }, /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('No_departments_available')));
129
+ }
130
+ return /*#__PURE__*/_react.default.createElement(_list.default, {
131
+ className: "my-list mobile-dtable-ui-department-editor-departments",
132
+ renderHeader: () => (0, _lang.getLocale)('Select_department')
133
+ }, isFilterEditor && parentId === -1 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, _constants.DEPARTMENT_SELECT_RANGE_OPTIONS.slice(0, 2).map((option, index) => {
134
+ const {
135
+ type,
136
+ name
137
+ } = option;
138
+ const isChecked = isSupportMultiple ? value.includes(type) : value === type;
139
+ return /*#__PURE__*/_react.default.createElement(Item, {
140
+ key: "department-range-item-".concat(index),
141
+ multipleLine: true,
142
+ onClick: event => onParentDepartmentClick(event, type),
143
+ className: "mobile-dtable-ui-department-editor-department-item"
144
+ }, /*#__PURE__*/_react.default.createElement("div", {
145
+ className: "d-flex"
146
+ }, /*#__PURE__*/_react.default.createElement(_DTableRadio.default, {
147
+ isChecked: isChecked,
148
+ onCheckedChange: event => onParentDepartmentClick(event, type),
149
+ label: (0, _lang.getLocale)(name)
150
+ })));
151
+ })), currentDepartments.map((department, index) => {
152
+ const {
153
+ hasChild,
154
+ name,
155
+ id
156
+ } = department;
157
+ const isChecked = isSupportMultiple ? value.includes(id) : value === id;
158
+ return /*#__PURE__*/_react.default.createElement(Item, {
159
+ arrow: hasChild ? 'horizontal' : '',
160
+ key: "department-item-".concat(index),
161
+ multipleLine: true,
162
+ onClick: event => onDepartmentClick(event, department),
163
+ className: "mobile-dtable-ui-department-editor-department-item"
164
+ }, /*#__PURE__*/_react.default.createElement("div", {
165
+ className: "d-flex"
166
+ }, /*#__PURE__*/_react.default.createElement(_DTableRadio.default, {
167
+ isChecked: isChecked,
168
+ onCheckedChange: event => onParentDepartmentClick(event, department),
169
+ label: name
170
+ })));
171
+ }));
172
+ }, [initColumnData, parentId, isFilterEditor, isSupportMultiple, departments, value, topParentIds, onParentDepartmentClick, onDepartmentClick]);
173
+ (0, _react.useEffect)(() => {
174
+ const {
175
+ enableSelectRange,
176
+ selectedRange,
177
+ specificDepartments
178
+ } = initColumnData;
179
+ if (enableSelectRange && !isFilterEditor) {
180
+ const {
181
+ current_user_department_ids = [],
182
+ current_user_department_and_sub_ids = []
183
+ } = userDepartmentIdsMap;
184
+ const {
185
+ departments: initialDepartments
186
+ } = window.app.state;
187
+ let targetDepartments = [];
188
+ let topParentIds = [];
189
+ let canExpand = true;
190
+ if (selectedRange === _constants.DEPARTMENT_SELECT_RANGE_MAP.CURRENT_USER_DEPARTMENT) {
191
+ canExpand = false;
192
+ topParentIds = current_user_department_ids;
193
+ targetDepartments = initialDepartments.filter(department => current_user_department_ids.includes(department.id));
194
+ } else if (selectedRange === _constants.DEPARTMENT_SELECT_RANGE_MAP.CURRENT_USER_DEPARTMENT_AND_SUB) {
195
+ const currentUserDepartments = initialDepartments.filter(department => current_user_department_ids.includes(department.id));
196
+ topParentIds = currentUserDepartments.filter(department => !current_user_department_ids.includes(department.parent_id)).map(department => department.id);
197
+ targetDepartments = initialDepartments.filter(department => current_user_department_and_sub_ids.includes(department.id));
198
+ } else {
199
+ canExpand = false;
200
+ topParentIds = specificDepartments;
201
+ targetDepartments = initialDepartments.filter(department => specificDepartments.includes(department.id));
202
+ }
203
+ const departments = (0, _utils.getNormalizedDepartments)(targetDepartments, canExpand);
204
+ setDepartments(departments);
205
+ setTopParentIds(topParentIds);
206
+ return;
207
+ }
208
+ const departments = (0, _utils.getNormalizedDepartments)(initialDepartments);
209
+ setDepartments(departments);
210
+ setParentId(-1);
211
+ // eslint-disable-next-line react-hooks/exhaustive-deps
212
+ }, []);
213
+ return /*#__PURE__*/_react.default.createElement(_MobileFullScreenPage.default, {
214
+ className: "mobile-dtable-ui-department-editor",
215
+ onLeftClick: onLeftClick,
216
+ onRightClick: onSave,
217
+ onClose: onClose
218
+ }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderLeftContent()), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, column.name), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isFilterEditor ? null : (0, _lang.getLocale)('Submit')), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderDepartments()));
219
+ };
220
+ var _default = exports.default = Small;
@@ -7,175 +7,28 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _reactstrap = require("reactstrap");
11
- var _DTableCustomFooter = _interopRequireDefault(require("../DTableCustomFooter"));
12
- var _signatureBoard = _interopRequireDefault(require("./signature-board"));
13
- var _service = _interopRequireDefault(require("./service"));
14
- var _utils = _interopRequireDefault(require("./utils"));
15
- var _url = require("../utils/url");
16
- var _toaster = _interopRequireDefault(require("../toaster"));
17
- var _lang = require("../lang");
18
- var _utils2 = require("../utils/utils");
19
- require("./index.css");
20
- class DigitalSignEditor extends _react.Component {
21
- constructor(props) {
22
- super(props);
23
- this.setPosition = () => {
24
- if (!this.editor) return;
25
- const {
26
- offsetLeft,
27
- offsetTop
28
- } = this.editor.parentNode;
29
- const {
30
- offsetWidth: editorWidth,
31
- offsetHeight: editorHeight
32
- } = this.editor;
33
- let editorLeft = offsetLeft - editorWidth;
34
- let editorTop = offsetTop;
35
- if (this.props.isInModal) {
36
- const innerHeight = window.innerHeight;
37
- const offsetTop = this.editor.parentNode.getBoundingClientRect().y;
38
- editorTop = offsetTop;
39
- editorTop = editorHeight + editorTop > innerHeight ? innerHeight - editorHeight - 30 : editorTop;
40
- editorLeft = -30;
41
- } else {
42
- if (offsetLeft < editorWidth) {
43
- editorLeft = offsetLeft + this.props.column.width;
44
- }
45
- if (editorLeft + editorWidth > window.innerWidth) {
46
- editorLeft = window.innerWidth - editorWidth;
47
- }
48
- if (offsetTop + editorHeight > window.innerHeight) {
49
- editorTop = window.innerHeight - editorHeight - 10;
50
- }
51
- }
52
- this.setState({
53
- editorPosition: {
54
- top: editorTop,
55
- left: editorLeft
56
- }
57
- });
58
- };
59
- this.getValue = () => {
60
- const updated = {
61
- [this.props.column.key]: this.value
62
- };
63
- return updated;
64
- };
65
- this.saveSignature = () => {
66
- if (!this.signatureBoard || this.state.saving) return;
67
- if (!this.signatureBoard.checkHasChanged()) {
68
- this.props.onCommitCancel();
69
- return;
70
- }
71
- this.signatureBoard.convert2BlobPNG(signBlob => {
72
- if (!signBlob) {
73
- if (!this.props.value) {
74
- this.props.onCommitCancel();
75
- return;
76
- }
77
-
78
- // clear the old dtable-ui-digital-sign
79
- this.value = null;
80
- this.props.onCommit(this.value);
81
- return;
82
- }
83
- this.setState({
84
- saving: true
85
- });
86
- this.digitalService.uploadSignImage(signBlob, {
87
- successCallback: signature => {
88
- this.value = signature;
89
- this.setState({
90
- saving: false
91
- }, () => {
92
- this.props.onCommit(Object.assign({}, this.value));
93
- });
94
- },
95
- failedCallback: error => {
96
- const errMsg = (0, _utils2.getErrorMsg)(error, true);
97
- if (!error.response || error.response.status !== 403) {
98
- _toaster.default.danger((0, _lang.getLocale)(errMsg));
99
- }
100
- this.setState({
101
- saving: false
102
- });
103
- }
104
- });
105
- });
106
- };
107
- this.clearSignature = () => {
108
- this.signatureBoard.clear();
109
- };
110
- this.state = {
111
- editorPosition: {},
112
- saving: false
113
- };
114
- const {
115
- uploadFile,
116
- config,
117
- value
118
- } = props;
119
- const {
120
- username
121
- } = config || {};
122
- this.value = value || {};
123
- this.digitalService = new _service.default({
124
- uploadFile,
125
- username
126
- });
127
- }
128
- componentDidMount() {
129
- this.setPosition();
130
- }
131
- render() {
132
- const {
133
- value,
134
- config
135
- } = this.props;
136
- const {
137
- editorPosition,
138
- saving
139
- } = this.state;
140
- const signImageUrl = (0, _url.generateCurrentBaseImageUrl)({
141
- ...config,
142
- partUrl: _utils.default.getSignImageUrl(value)
143
- });
144
- return /*#__PURE__*/_react.default.createElement("div", {
145
- className: "dtable-ui-digital-sign-editor-container",
146
- ref: ref => this.editor = ref,
147
- style: {
148
- ...editorPosition,
149
- zIndex: 1000
150
- }
151
- }, /*#__PURE__*/_react.default.createElement("div", {
152
- className: "dtable-ui-digital-sign-editor-header"
153
- }, /*#__PURE__*/_react.default.createElement("div", {
154
- className: "dtable-ui-digital-sign-editor-logo"
155
- }, /*#__PURE__*/_react.default.createElement("i", {
156
- className: "dtable-font dtable-icon-handwritten-signature"
157
- }), /*#__PURE__*/_react.default.createElement("span", {
158
- className: "ml-2 dtable-ui-digital-sign-editor-title"
159
- }, (0, _lang.getLocale)('Digital_signature'))), /*#__PURE__*/_react.default.createElement("div", {
160
- className: "dtable-ui-digital-sign-editor-operations"
161
- }, /*#__PURE__*/_react.default.createElement("div", {
162
- className: "btn-clear-dtable-ui-digital-sign",
163
- onClick: this.clearSignature
164
- }, /*#__PURE__*/_react.default.createElement("i", {
165
- className: "dtable-font dtable-icon-clear-format"
166
- }), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Re-sign'))))), /*#__PURE__*/_react.default.createElement("div", {
167
- className: "dtable-ui-digital-sign-panel"
168
- }, /*#__PURE__*/_react.default.createElement(_signatureBoard.default, {
169
- ref: ref => this.signatureBoard = ref,
170
- signImageUrl: signImageUrl
171
- })), /*#__PURE__*/_react.default.createElement(_DTableCustomFooter.default, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
172
- onClick: this.props.onCommitCancel,
173
- color: "secondary"
174
- }, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
175
- onClick: this.saveSignature,
176
- color: "primary",
177
- disabled: saving
178
- }, (0, _lang.getLocale)(saving ? 'Saving' : 'Save'))));
179
- }
180
- }
10
+ var _reactResponsive = _interopRequireDefault(require("react-responsive"));
11
+ var _lg = _interopRequireDefault(require("./lg"));
12
+ var _sm = _interopRequireDefault(require("./sm"));
13
+ const DigitalSignEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
14
+ let {
15
+ size,
16
+ ...props
17
+ } = _ref;
18
+ if (size === 'lg') return /*#__PURE__*/_react.default.createElement(_lg.default, Object.assign({}, props, {
19
+ ref: ref
20
+ }));
21
+ if (size === 'sm') return /*#__PURE__*/_react.default.createElement(_sm.default, Object.assign({}, props, {
22
+ ref: ref
23
+ }));
24
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
25
+ query: "(min-width: 768px)"
26
+ }, /*#__PURE__*/_react.default.createElement(_lg.default, Object.assign({}, props, {
27
+ ref: ref
28
+ }))), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
29
+ query: "(max-width: 768px)"
30
+ }, /*#__PURE__*/_react.default.createElement(_sm.default, Object.assign({}, props, {
31
+ ref: ref
32
+ }))));
33
+ });
181
34
  var _default = exports.default = DigitalSignEditor;
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactstrap = require("reactstrap");
11
+ var _DTableCustomFooter = _interopRequireDefault(require("../../DTableCustomFooter"));
12
+ var _signatureBoard = _interopRequireDefault(require("../signature-board"));
13
+ var _service = _interopRequireDefault(require("../service"));
14
+ var _utils = _interopRequireDefault(require("../utils"));
15
+ var _url = require("../../utils/url");
16
+ var _toaster = _interopRequireDefault(require("../../toaster"));
17
+ var _lang = require("../../lang");
18
+ var _utils2 = require("../../utils/utils");
19
+ require("./index.css");
20
+ class Large extends _react.Component {
21
+ constructor(props) {
22
+ super(props);
23
+ this.setPosition = () => {
24
+ if (!this.editor) return;
25
+ const {
26
+ offsetLeft,
27
+ offsetTop
28
+ } = this.editor.parentNode;
29
+ const {
30
+ offsetWidth: editorWidth,
31
+ offsetHeight: editorHeight
32
+ } = this.editor;
33
+ let editorLeft = offsetLeft - editorWidth;
34
+ let editorTop = offsetTop;
35
+ if (this.props.isInModal) {
36
+ const innerHeight = window.innerHeight;
37
+ const offsetTop = this.editor.parentNode.getBoundingClientRect().y;
38
+ editorTop = offsetTop;
39
+ editorTop = editorHeight + editorTop > innerHeight ? innerHeight - editorHeight - 30 : editorTop;
40
+ editorLeft = -30;
41
+ } else {
42
+ if (offsetLeft < editorWidth) {
43
+ editorLeft = offsetLeft + this.props.column.width;
44
+ }
45
+ if (editorLeft + editorWidth > window.innerWidth) {
46
+ editorLeft = window.innerWidth - editorWidth;
47
+ }
48
+ if (offsetTop + editorHeight > window.innerHeight) {
49
+ editorTop = window.innerHeight - editorHeight - 10;
50
+ }
51
+ }
52
+ this.setState({
53
+ editorPosition: {
54
+ top: editorTop,
55
+ left: editorLeft
56
+ }
57
+ });
58
+ };
59
+ this.getValue = () => {
60
+ const updated = {
61
+ [this.props.column.key]: this.value
62
+ };
63
+ return updated;
64
+ };
65
+ this.saveSignature = () => {
66
+ if (!this.signatureBoard || this.state.saving) return;
67
+ if (!this.signatureBoard.checkHasChanged()) {
68
+ this.props.onCommitCancel();
69
+ return;
70
+ }
71
+ this.signatureBoard.convert2BlobPNG(signBlob => {
72
+ if (!signBlob) {
73
+ if (!this.props.value) {
74
+ this.props.onCommitCancel();
75
+ return;
76
+ }
77
+
78
+ // clear the old dtable-ui-digital-sign
79
+ this.value = null;
80
+ this.props.onCommit(this.value);
81
+ return;
82
+ }
83
+ this.setState({
84
+ saving: true
85
+ });
86
+ this.digitalService.uploadSignImage(signBlob, {
87
+ successCallback: signature => {
88
+ this.value = signature;
89
+ this.setState({
90
+ saving: false
91
+ }, () => {
92
+ this.props.onCommit(this.value);
93
+ });
94
+ },
95
+ failedCallback: error => {
96
+ const errMsg = (0, _utils2.getErrorMsg)(error, true);
97
+ if (!error.response || error.response.status !== 403) {
98
+ _toaster.default.danger((0, _lang.getLocale)(errMsg));
99
+ }
100
+ this.setState({
101
+ saving: false
102
+ });
103
+ }
104
+ });
105
+ });
106
+ };
107
+ this.clearSignature = () => {
108
+ this.signatureBoard.clear();
109
+ };
110
+ this.state = {
111
+ editorPosition: {},
112
+ saving: false
113
+ };
114
+ const {
115
+ uploadFile,
116
+ config,
117
+ value
118
+ } = props;
119
+ const {
120
+ username
121
+ } = config || {};
122
+ this.value = value || {};
123
+ this.digitalService = new _service.default({
124
+ uploadFile,
125
+ username
126
+ });
127
+ }
128
+ componentDidMount() {
129
+ this.setPosition();
130
+ }
131
+ render() {
132
+ const {
133
+ value,
134
+ config
135
+ } = this.props;
136
+ const {
137
+ editorPosition,
138
+ saving
139
+ } = this.state;
140
+ const signImageUrl = (0, _url.generateCurrentBaseImageUrl)({
141
+ ...config,
142
+ partUrl: _utils.default.getSignImageUrl(value)
143
+ });
144
+ return /*#__PURE__*/_react.default.createElement("div", {
145
+ className: "dtable-ui-digital-sign-editor-container",
146
+ ref: ref => this.editor = ref,
147
+ style: {
148
+ ...editorPosition,
149
+ zIndex: 1000
150
+ }
151
+ }, /*#__PURE__*/_react.default.createElement("div", {
152
+ className: "dtable-ui-digital-sign-editor-header"
153
+ }, /*#__PURE__*/_react.default.createElement("div", {
154
+ className: "dtable-ui-digital-sign-editor-logo"
155
+ }, /*#__PURE__*/_react.default.createElement("i", {
156
+ className: "dtable-font dtable-icon-handwritten-signature"
157
+ }), /*#__PURE__*/_react.default.createElement("span", {
158
+ className: "ml-2 dtable-ui-digital-sign-editor-title"
159
+ }, (0, _lang.getLocale)('Digital_signature'))), /*#__PURE__*/_react.default.createElement("div", {
160
+ className: "dtable-ui-digital-sign-editor-operations"
161
+ }, /*#__PURE__*/_react.default.createElement("div", {
162
+ className: "btn-clear-dtable-ui-digital-sign",
163
+ onClick: this.clearSignature
164
+ }, /*#__PURE__*/_react.default.createElement("i", {
165
+ className: "dtable-font dtable-icon-clear-format"
166
+ }), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Re-sign'))))), /*#__PURE__*/_react.default.createElement("div", {
167
+ className: "dtable-ui-digital-sign-panel"
168
+ }, /*#__PURE__*/_react.default.createElement(_signatureBoard.default, {
169
+ ref: ref => this.signatureBoard = ref,
170
+ signImageUrl: signImageUrl
171
+ })), /*#__PURE__*/_react.default.createElement(_DTableCustomFooter.default, null, /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
172
+ onClick: this.props.onCommitCancel,
173
+ color: "secondary"
174
+ }, (0, _lang.getLocale)('Cancel')), /*#__PURE__*/_react.default.createElement(_reactstrap.Button, {
175
+ onClick: this.saveSignature,
176
+ color: "primary",
177
+ disabled: saving
178
+ }, (0, _lang.getLocale)(saving ? 'Saving' : 'Save'))));
179
+ }
180
+ }
181
+ var _default = exports.default = Large;