dtable-ui-component 7.0.13 → 7.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/lib/ActionSheet/index.js +58 -49
  2. package/lib/ActivityIndicator/index.js +17 -16
  3. package/lib/AsyncUserSelect/index.js +20 -46
  4. package/lib/AsyncUserSelect/user-item.js +6 -5
  5. package/lib/AutoNumberFormatter/index.js +4 -3
  6. package/lib/Badge/index.js +27 -29
  7. package/lib/ButtonFormatter/index.js +8 -6
  8. package/lib/CTimeFormatter/index.js +4 -3
  9. package/lib/CheckboxEditor/index.js +16 -13
  10. package/lib/CheckboxEditor/mb-editor.js +20 -9
  11. package/lib/CheckboxEditor/pc-editor.js +24 -12
  12. package/lib/CheckboxFormatter/index.js +5 -4
  13. package/lib/CollaboratorEditor/index.js +17 -14
  14. package/lib/CollaboratorEditor/mb-editor/index.js +19 -11
  15. package/lib/CollaboratorEditor/pc-editor/index.js +35 -26
  16. package/lib/CollaboratorFormatter/index.js +10 -8
  17. package/lib/CollaboratorItem/index.js +5 -4
  18. package/lib/CollapsibleSettingLayout/index.js +8 -10
  19. package/lib/Comment/body/comment.js +19 -11
  20. package/lib/Comment/body/index.js +8 -8
  21. package/lib/Comment/footer/btns/index.js +7 -4
  22. package/lib/Comment/footer/index.js +21 -10
  23. package/lib/Comment/footer/input/index.js +55 -34
  24. package/lib/Comment/footer/input/participant/index.js +6 -5
  25. package/lib/Comment/footer/participants/index.js +5 -4
  26. package/lib/Comment/footer/participants/participant/index.js +3 -1
  27. package/lib/Comment/footer/participants/participant-select/index.js +26 -10
  28. package/lib/Comment/index.js +57 -39
  29. package/lib/Comment/utils/utilities.js +22 -16
  30. package/lib/CreatorFormatter/index.js +8 -6
  31. package/lib/DTableColorPicker/ColorPickerPortal/index.js +26 -28
  32. package/lib/DTableColorPicker/index.js +53 -67
  33. package/lib/DTableColorPicker/utils.js +7 -5
  34. package/lib/DTableColumnIcon/index.js +7 -6
  35. package/lib/DTableCommonAddTool/index.js +10 -8
  36. package/lib/DTableCustomFooter/index.js +3 -1
  37. package/lib/DTableCustomizeSearchInput/index.js +41 -26
  38. package/lib/DTableCustomizeSelect/index.js +24 -19
  39. package/lib/DTableDropdownItem/index.js +28 -24
  40. package/lib/DTableDropdownMenu/index.js +17 -14
  41. package/lib/DTableEmptyTip/index.js +5 -4
  42. package/lib/DTableFiltersPopover/index.js +42 -27
  43. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +3 -1
  44. package/lib/DTableFiltersPopover/utils/index.js +114 -64
  45. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -8
  46. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +13 -16
  47. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +15 -18
  48. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +14 -8
  49. package/lib/DTableFiltersPopover/widgets/filter-group.js +57 -36
  50. package/lib/DTableFiltersPopover/widgets/filter-item.js +165 -106
  51. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +162 -137
  52. package/lib/DTableFiltersPopover/widgets/rate-item.js +25 -20
  53. package/lib/DTableIcon/index.js +11 -10
  54. package/lib/DTableIcon/svg-icon.js +11 -9
  55. package/lib/DTableModalHeader/index.js +7 -7
  56. package/lib/DTablePopover/index.js +16 -12
  57. package/lib/DTableRadio/index.js +9 -10
  58. package/lib/DTableRadioGroup/index.js +20 -11
  59. package/lib/DTableSearchInput/index.js +29 -19
  60. package/lib/DTableSelect/dtable-select-label.js +6 -7
  61. package/lib/DTableSelect/index.js +26 -25
  62. package/lib/DTableSelect/select-dropdown-indicator/index.js +3 -1
  63. package/lib/DTableSelect/utils.js +83 -47
  64. package/lib/DTableSubDropdownMenu/index.js +16 -12
  65. package/lib/DTableSubDropdownToggle/index.js +16 -17
  66. package/lib/DTableSwitch/index.js +11 -12
  67. package/lib/DTableToolTip/index.js +12 -11
  68. package/lib/DateEditor/index.js +28 -30
  69. package/lib/DateEditor/mb-editor/index.js +31 -18
  70. package/lib/DateEditor/pc-editor.js +46 -27
  71. package/lib/DateFormatter/index.js +5 -4
  72. package/lib/DatePicker/index.js +15 -9
  73. package/lib/DatePicker/utils.js +7 -5
  74. package/lib/DeleteTip/index.js +6 -5
  75. package/lib/DepartmentMultipleSelectEditor/index.js +26 -28
  76. package/lib/DepartmentSelectFilter/index.js +13 -8
  77. package/lib/DepartmentSingleSelectEditor/index.js +16 -13
  78. package/lib/DepartmentSingleSelectEditor/mb-editor/index.js +49 -50
  79. package/lib/DepartmentSingleSelectEditor/pc-editor/department-single-select.js +64 -42
  80. package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +19 -13
  81. package/lib/DepartmentSingleSelectFormatter/index.js +6 -4
  82. package/lib/DigitalSignEditor/index.js +16 -13
  83. package/lib/DigitalSignEditor/mb-editor/index.js +24 -16
  84. package/lib/DigitalSignEditor/pc-editor/index.js +31 -23
  85. package/lib/DigitalSignEditor/service.js +5 -3
  86. package/lib/DigitalSignEditor/signature-board/index.js +10 -7
  87. package/lib/DigitalSignEditor/utils.js +4 -2
  88. package/lib/DigitalSignFormatter/index.js +15 -12
  89. package/lib/DigitalSignFormatter/utils.js +6 -5
  90. package/lib/Drawer/index.js +3 -2
  91. package/lib/DurationEditor/index.js +31 -21
  92. package/lib/DurationFormatter/index.js +5 -4
  93. package/lib/EditEditorButton/index.js +3 -1
  94. package/lib/EmailFormatter/index.js +4 -3
  95. package/lib/FieldDisplaySetting/field-item.js +13 -13
  96. package/lib/FieldDisplaySetting/index.js +20 -20
  97. package/lib/FileEditor/files-previewer/index.js +16 -13
  98. package/lib/FileEditor/files-previewer/mb-previewer/file-previewer/index.js +20 -12
  99. package/lib/FileEditor/files-previewer/mb-previewer/index.js +8 -7
  100. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/dropdown-menu.js +4 -3
  101. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/file-name-editor/index.js +6 -5
  102. package/lib/FileEditor/files-previewer/pc-previewer/file-previewer/index.js +24 -17
  103. package/lib/FileEditor/files-previewer/pc-previewer/index.js +57 -29
  104. package/lib/FileEditor/index.js +16 -13
  105. package/lib/FileEditor/mb-editor/index.js +20 -28
  106. package/lib/FileEditor/pc-editor/addition-previewer/index.js +4 -2
  107. package/lib/FileEditor/pc-editor/addition-previewer/local-file-addition/index.js +31 -17
  108. package/lib/FileEditor/pc-editor/index.js +30 -22
  109. package/lib/FileFormatter/index.js +20 -27
  110. package/lib/FileItemFormatter/index.js +10 -7
  111. package/lib/FileUploader/index.js +46 -29
  112. package/lib/FormulaFormatter/index.js +44 -24
  113. package/lib/GeolocationEditor/index.js +32 -27
  114. package/lib/GeolocationEditor/map-editor-utils.js +23 -21
  115. package/lib/GeolocationEditor/mb-editor/country-editor.js +14 -17
  116. package/lib/GeolocationEditor/mb-editor/index.js +28 -22
  117. package/lib/GeolocationEditor/mb-editor/location-editor.js +15 -18
  118. package/lib/GeolocationEditor/mb-editor/map-editor/index.js +77 -47
  119. package/lib/GeolocationEditor/mb-editor/map-selection-editor/index.js +89 -50
  120. package/lib/GeolocationEditor/mb-editor/province-city-editor.js +14 -17
  121. package/lib/GeolocationEditor/mb-editor/province-editor.js +14 -17
  122. package/lib/GeolocationEditor/pc-editor/country-editor.js +25 -12
  123. package/lib/GeolocationEditor/pc-editor/index.js +41 -27
  124. package/lib/GeolocationEditor/pc-editor/location-editor.js +33 -28
  125. package/lib/GeolocationEditor/pc-editor/map-editor/index.js +67 -43
  126. package/lib/GeolocationEditor/pc-editor/map-editor/large-editor/index.js +69 -42
  127. package/lib/GeolocationEditor/pc-editor/map-selection-editor/index.js +86 -42
  128. package/lib/GeolocationEditor/pc-editor/map-selection-editor/large-editor/index.js +85 -39
  129. package/lib/GeolocationEditor/pc-editor/province-city-editor.js +26 -20
  130. package/lib/GeolocationEditor/pc-editor/province-editor.js +15 -8
  131. package/lib/GeolocationEditor/pc-editor/selector-header-item.js +6 -5
  132. package/lib/GeolocationEditor/pc-editor/selector-list.js +8 -7
  133. package/lib/GeolocationFormatter/index.js +5 -4
  134. package/lib/HtmlLongTextFormatter/index.js +13 -5
  135. package/lib/Icon/index.js +13 -15
  136. package/lib/Icon/load-sprite.js +13 -2
  137. package/lib/IconButton/index.js +12 -13
  138. package/lib/ImageEditor/images-previewer/image-preview/index.js +22 -13
  139. package/lib/ImageEditor/images-previewer/index.js +9 -3
  140. package/lib/ImageEditor/index.js +16 -13
  141. package/lib/ImageEditor/mb-editor/index.js +20 -28
  142. package/lib/ImageEditor/pc-editor/addition-previewer/image-link/index.js +6 -2
  143. package/lib/ImageEditor/pc-editor/addition-previewer/index.js +5 -3
  144. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +26 -12
  145. package/lib/ImageEditor/pc-editor/images-previewer/index.js +10 -4
  146. package/lib/ImageEditor/pc-editor/index.js +16 -11
  147. package/lib/ImageFormatter/images-lazy-load.js +11 -19
  148. package/lib/ImageFormatter/index.js +14 -12
  149. package/lib/ImagePreviewerLightbox/index.js +15 -19
  150. package/lib/ImageThumbnail/index.js +15 -12
  151. package/lib/InputItem/custom-input.js +55 -35
  152. package/lib/InputItem/custom-keyboard.js +42 -42
  153. package/lib/InputItem/index.js +82 -63
  154. package/lib/InputItem/input.js +9 -11
  155. package/lib/LastModifierFormatter/index.js +8 -6
  156. package/lib/LinkEditor/index.js +53 -33
  157. package/lib/LinkEditor/link-editor-option.js +4 -3
  158. package/lib/LinkEditor/mb-popover/index.js +22 -9
  159. package/lib/LinkEditor/pc-popover/index.js +13 -7
  160. package/lib/LinkFormatter/index.js +37 -21
  161. package/lib/List/index.js +17 -19
  162. package/lib/List/list-item.js +59 -55
  163. package/lib/LongTextFormatter/index.js +5 -4
  164. package/lib/MBEditorHeader/index.js +9 -8
  165. package/lib/MTimeFormatter/index.js +4 -3
  166. package/lib/MobileFullScreenPage/body/index.js +6 -4
  167. package/lib/MobileFullScreenPage/header/index.js +10 -8
  168. package/lib/MobileFullScreenPage/index.js +12 -14
  169. package/lib/MobileModal/index.js +7 -8
  170. package/lib/MobileOperationSheet/index.js +8 -7
  171. package/lib/MobileSelector/empty/index.js +3 -1
  172. package/lib/MobileSelector/index.js +7 -5
  173. package/lib/MobileSelector/option/index.js +5 -3
  174. package/lib/MobileSelector/options/index.css +0 -4
  175. package/lib/MobileSelector/options/index.js +3 -1
  176. package/lib/MobileSelector/search/index.js +5 -3
  177. package/lib/MobileUpload/index.js +5 -4
  178. package/lib/Modal/alert.js +2 -2
  179. package/lib/Modal/modal.js +28 -30
  180. package/lib/Modal/prompt.js +14 -14
  181. package/lib/MultipleSelectEditor/index.js +7 -7
  182. package/lib/MultipleSelectFormatter/index.js +9 -7
  183. package/lib/NotificationPopover/index.js +5 -4
  184. package/lib/NumberEditor/index.js +21 -12
  185. package/lib/NumberFormatter/index.js +5 -4
  186. package/lib/PhoneNumberLink/index.js +5 -3
  187. package/lib/Picker/AbstractPicker.js +35 -33
  188. package/lib/Popover/index.js +9 -11
  189. package/lib/Popover/item.js +22 -24
  190. package/lib/Progress/index.js +18 -17
  191. package/lib/Radio/Radio.js +17 -15
  192. package/lib/Radio/RadioItem.js +23 -19
  193. package/lib/RateFormatter/index.js +15 -15
  194. package/lib/RoleStatusEditor/index.js +18 -19
  195. package/lib/RowExpand/index.js +7 -6
  196. package/lib/RowExpandDialog/body/index.js +57 -40
  197. package/lib/RowExpandDialog/column-content/index.js +10 -6
  198. package/lib/RowExpandDialog/header/index.js +12 -9
  199. package/lib/RowExpandDialog/index.js +59 -63
  200. package/lib/RowExpandEditor/add-btn/index.js +7 -6
  201. package/lib/RowExpandEditor/checkbox-editor/index.js +7 -6
  202. package/lib/RowExpandEditor/checkbox-editor/mb-editor/index.js +5 -4
  203. package/lib/RowExpandEditor/checkbox-editor/pc-editor.js +10 -8
  204. package/lib/RowExpandEditor/collaborator-editor/index.js +7 -6
  205. package/lib/RowExpandEditor/collaborator-editor/mb-editor/index.js +33 -22
  206. package/lib/RowExpandEditor/collaborator-editor/pc-editor/index.js +40 -26
  207. package/lib/RowExpandEditor/date-editor/index.js +7 -6
  208. package/lib/RowExpandEditor/date-editor/mb-editor.js +18 -12
  209. package/lib/RowExpandEditor/date-editor/pc-editor.js +20 -15
  210. package/lib/RowExpandEditor/department-editor/index.js +7 -6
  211. package/lib/RowExpandEditor/department-editor/mb-editor.js +11 -16
  212. package/lib/RowExpandEditor/department-editor/pc-editor.js +14 -19
  213. package/lib/RowExpandEditor/digital-sign-editor/index.js +7 -6
  214. package/lib/RowExpandEditor/digital-sign-editor/mb-editor/index.js +38 -24
  215. package/lib/RowExpandEditor/digital-sign-editor/pc-editor/index.js +39 -25
  216. package/lib/RowExpandEditor/duration-editor/index.js +7 -6
  217. package/lib/RowExpandEditor/duration-editor/mb-editor.js +17 -10
  218. package/lib/RowExpandEditor/duration-editor/pc-editor.js +19 -13
  219. package/lib/RowExpandEditor/email-editor/index.js +7 -6
  220. package/lib/RowExpandEditor/email-editor/mb-editor/index.js +20 -10
  221. package/lib/RowExpandEditor/email-editor/pc-editor/index.js +25 -14
  222. package/lib/RowExpandEditor/file-editor/index.js +7 -6
  223. package/lib/RowExpandEditor/file-editor/mb-editor/index.js +31 -18
  224. package/lib/RowExpandEditor/file-editor/pc-editor/index.js +23 -16
  225. package/lib/RowExpandEditor/geolocation-editor/index.js +7 -6
  226. package/lib/RowExpandEditor/geolocation-editor/mb-editor/index.js +29 -17
  227. package/lib/RowExpandEditor/geolocation-editor/pc-editor/index.js +26 -13
  228. package/lib/RowExpandEditor/image-editor/index.js +7 -6
  229. package/lib/RowExpandEditor/image-editor/mb-editor/index.js +26 -16
  230. package/lib/RowExpandEditor/image-editor/pc-editor/index.js +24 -14
  231. package/lib/RowExpandEditor/index.js +16 -11
  232. package/lib/RowExpandEditor/long-text-editor/index.js +7 -6
  233. package/lib/RowExpandEditor/long-text-editor/mb-editor/editor/index.js +18 -17
  234. package/lib/RowExpandEditor/long-text-editor/mb-editor/index.js +16 -10
  235. package/lib/RowExpandEditor/long-text-editor/pc-editor/index.js +23 -16
  236. package/lib/RowExpandEditor/multiple-select-editor/index.js +7 -6
  237. package/lib/RowExpandEditor/multiple-select-editor/mb-editor/index.js +20 -12
  238. package/lib/RowExpandEditor/multiple-select-editor/pc-editor/index.js +38 -27
  239. package/lib/RowExpandEditor/number-editor/index.js +7 -6
  240. package/lib/RowExpandEditor/number-editor/mb-editor/index.js +14 -8
  241. package/lib/RowExpandEditor/number-editor/pc-editor.js +20 -13
  242. package/lib/RowExpandEditor/rate-editor/index.js +7 -6
  243. package/lib/RowExpandEditor/rate-editor/mb-editor.js +26 -13
  244. package/lib/RowExpandEditor/rate-editor/pc-editor.js +41 -25
  245. package/lib/RowExpandEditor/single-select-editor/index.js +7 -6
  246. package/lib/RowExpandEditor/single-select-editor/mb-editor/index.js +32 -21
  247. package/lib/RowExpandEditor/single-select-editor/pc-editor/index.js +37 -25
  248. package/lib/RowExpandEditor/text-editor/index.js +7 -6
  249. package/lib/RowExpandEditor/text-editor/mb-editor/index.js +5 -4
  250. package/lib/RowExpandEditor/text-editor/pc-editor/index.js +26 -15
  251. package/lib/RowExpandEditor/url-editor/index.js +7 -6
  252. package/lib/RowExpandEditor/url-editor/mb-editor/index.js +15 -7
  253. package/lib/RowExpandEditor/url-editor/pc-editor/index.js +20 -11
  254. package/lib/RowExpandFormatter/department-formatter/index.js +6 -3
  255. package/lib/RowExpandFormatter/department-formatter/mb-formatter.js +4 -2
  256. package/lib/RowExpandFormatter/department-formatter/pc-formatter.js +4 -2
  257. package/lib/RowExpandFormatter/email-formatter/index.js +8 -5
  258. package/lib/RowExpandFormatter/file-formatter/index.js +9 -8
  259. package/lib/RowExpandFormatter/file-formatter/row-expand-file-item-formatter.js +14 -12
  260. package/lib/RowExpandFormatter/formula-formatter/index.js +51 -30
  261. package/lib/RowExpandFormatter/image-formatter/index.js +11 -9
  262. package/lib/RowExpandFormatter/image-formatter/row-expand-image-item-formatter.js +10 -9
  263. package/lib/RowExpandFormatter/index.js +52 -34
  264. package/lib/RowExpandFormatter/link-formatter/collaborator-item-formatter.js +15 -9
  265. package/lib/RowExpandFormatter/link-formatter/index.js +25 -17
  266. package/lib/RowExpandFormatter/link-formatter/value-display-utils.js +5 -3
  267. package/lib/RowExpandFormatter/rate-formatter/index.js +14 -13
  268. package/lib/RowExpandFormatter/text/index.js +5 -4
  269. package/lib/RowExpandFormatter/url-formatter/index.js +9 -6
  270. package/lib/RowExpandView/body/index.js +43 -32
  271. package/lib/RowExpandView/column-content/index.js +7 -3
  272. package/lib/RowExpandView/index.js +52 -53
  273. package/lib/SelectItem/index.js +7 -5
  274. package/lib/SelectOptionGroup/index.js +40 -30
  275. package/lib/SelectedDepartments/index.js +12 -10
  276. package/lib/SimpleLongTextFormatter/index.js +18 -12
  277. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +4 -3
  278. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +21 -12
  279. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +4 -3
  280. package/lib/SingleSelectEditor/index.js +7 -7
  281. package/lib/SingleSelectFormatter/index.js +9 -8
  282. package/lib/TabBar/Tab.js +26 -24
  283. package/lib/TabBar/index.js +28 -24
  284. package/lib/Tabs/index.js +13 -10
  285. package/lib/TextEditor/index.js +23 -14
  286. package/lib/TextFormatter/index.js +4 -3
  287. package/lib/TextareaItem/index.js +53 -48
  288. package/lib/Toast/index.js +9 -8
  289. package/lib/UrlFormatter/index.js +4 -3
  290. package/lib/common/editor-base.js +12 -7
  291. package/lib/formatterConfig/index.js +3 -3
  292. package/lib/hooks/common-hooks.js +4 -2
  293. package/lib/select-editor/index.js +16 -13
  294. package/lib/select-editor/mb-editor/index.js +28 -17
  295. package/lib/select-editor/pc-editor/index.js +47 -32
  296. package/lib/toaster/alert.js +8 -7
  297. package/lib/toaster/toast.js +4 -3
  298. package/lib/toaster/toastManager.js +13 -13
  299. package/lib/toaster/toaster.js +12 -9
  300. package/lib/utils/cell.js +11 -8
  301. package/lib/utils/class.js +3 -3
  302. package/lib/utils/column-utils.js +14 -8
  303. package/lib/utils/departments.js +6 -5
  304. package/lib/utils/getLocale.js +11 -5
  305. package/lib/utils/object-utils.js +5 -4
  306. package/lib/utils/url.js +29 -22
  307. package/lib/utils/utils.js +6 -2
  308. package/package.json +2 -2
@@ -1,13 +1,11 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
9
  var _classnames = _interopRequireDefault(require("classnames"));
12
10
  var PropTypes = _interopRequireWildcard(require("prop-types"));
13
11
  var React = _interopRequireWildcard(require("react"));
@@ -17,8 +15,8 @@ var _customInput = _interopRequireDefault(require("./custom-input"));
17
15
  var _input = _interopRequireDefault(require("./input"));
18
16
  require("./style/index.css");
19
17
  var _jsxRuntime = require("react/jsx-runtime");
20
- const _excluded = ["prefixCls", "prefixListCls", "editable", "style", "clear", "children", "error", "className", "extra", "labelNumber", "type", "onExtraClick", "onErrorClick", "moneyKeyboardAlign", "moneyKeyboardWrapProps", "moneyKeyboardHeader", "onVirtualKeyboardConfirm", "autoAdjustHeight", "disabledKeys"];
21
18
  /* tslint:disable:jsx-no-multiline-js */
19
+
22
20
  function noop() {}
23
21
  function normalizeValue(value) {
24
22
  if (typeof value === 'undefined' || value === null) {
@@ -33,7 +31,9 @@ class InputItem extends React.Component {
33
31
  _this = this;
34
32
  this.onInputChange = e => {
35
33
  const el = e.target;
36
- const rawVal = el.value;
34
+ const {
35
+ value: rawVal
36
+ } = el;
37
37
  let prePos = 0;
38
38
  try {
39
39
  // some input type do not support selection, see https://html.spec.whatwg.org/multipage/input.html#do-not-apply
@@ -41,9 +41,12 @@ class InputItem extends React.Component {
41
41
  } catch (error) {
42
42
  console.warn('Get selection error:', error);
43
43
  }
44
- const _this$state$value = this.state.value,
45
- preCtrlVal = _this$state$value === void 0 ? '' : _this$state$value;
46
- const type = this.props.type;
44
+ const {
45
+ value: preCtrlVal = ''
46
+ } = this.state;
47
+ const {
48
+ type
49
+ } = this.props;
47
50
  let ctrlValue = rawVal;
48
51
  switch (type) {
49
52
  case 'bankCard':
@@ -53,9 +56,9 @@ class InputItem extends React.Component {
53
56
  ctrlValue = rawVal.replace(/\D/g, '').substring(0, 11);
54
57
  const valueLen = ctrlValue.length;
55
58
  if (valueLen > 3 && valueLen < 8) {
56
- ctrlValue = "".concat(ctrlValue.substr(0, 3), " ").concat(ctrlValue.substr(3));
59
+ ctrlValue = `${ctrlValue.substr(0, 3)} ${ctrlValue.substr(3)}`;
57
60
  } else if (valueLen >= 8) {
58
- ctrlValue = "".concat(ctrlValue.substr(0, 3), " ").concat(ctrlValue.substr(3, 4), " ").concat(ctrlValue.substr(7));
61
+ ctrlValue = `${ctrlValue.substr(0, 3)} ${ctrlValue.substr(3, 4)} ${ctrlValue.substr(7)}`;
59
62
  }
60
63
  break;
61
64
  case 'number':
@@ -91,7 +94,9 @@ class InputItem extends React.Component {
91
94
  this.handleOnChange = function (value) {
92
95
  let isMutated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
93
96
  let adjustPos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
94
- const onChange = _this.props.onChange;
97
+ const {
98
+ onChange
99
+ } = _this.props;
95
100
  if (!('value' in _this.props)) {
96
101
  _this.setState({
97
102
  value
@@ -215,56 +220,67 @@ class InputItem extends React.Component {
215
220
  }
216
221
  }
217
222
  render() {
218
- const props = (0, _objectSpread2.default)({}, this.props);
223
+ const props = {
224
+ ...this.props
225
+ };
219
226
  delete props.updatePlaceholder;
220
- const prefixCls = props.prefixCls,
221
- prefixListCls = props.prefixListCls,
222
- editable = props.editable,
223
- style = props.style,
224
- clear = props.clear,
225
- children = props.children,
226
- error = props.error,
227
- className = props.className,
228
- extra = props.extra,
229
- labelNumber = props.labelNumber,
230
- type = props.type,
231
- onExtraClick = props.onExtraClick,
232
- onErrorClick = props.onErrorClick,
233
- moneyKeyboardAlign = props.moneyKeyboardAlign,
234
- moneyKeyboardWrapProps = props.moneyKeyboardWrapProps,
235
- moneyKeyboardHeader = props.moneyKeyboardHeader,
236
- onVirtualKeyboardConfirm = props.onVirtualKeyboardConfirm,
237
- autoAdjustHeight = props.autoAdjustHeight,
238
- disabledKeys = props.disabledKeys,
239
- restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
240
- const name = restProps.name,
241
- disabled = restProps.disabled,
242
- maxLength = restProps.maxLength;
243
- const value = this.state.value;
227
+ const {
228
+ prefixCls,
229
+ prefixListCls,
230
+ editable,
231
+ style,
232
+ clear,
233
+ children,
234
+ error,
235
+ className,
236
+ extra,
237
+ labelNumber,
238
+ type,
239
+ onExtraClick,
240
+ onErrorClick,
241
+ moneyKeyboardAlign,
242
+ moneyKeyboardWrapProps,
243
+ moneyKeyboardHeader,
244
+ onVirtualKeyboardConfirm,
245
+ autoAdjustHeight,
246
+ disabledKeys,
247
+ ...restProps
248
+ } = props;
249
+ const {
250
+ name,
251
+ disabled,
252
+ maxLength
253
+ } = restProps;
254
+ const {
255
+ value
256
+ } = this.state;
244
257
 
245
258
  // tslint:disable-next-line:variable-name
246
259
  const _locale = (0, _getLocale.getComponentLocale)(this.props, this.context, 'InputItem', () => require('./locale/zh_CN'));
247
- const confirmLabel = _locale.confirmLabel,
248
- backspaceLabel = _locale.backspaceLabel,
249
- cancelKeyboardLabel = _locale.cancelKeyboardLabel;
250
- const _this$state = this.state,
251
- focus = _this$state.focus,
252
- placeholder = _this$state.placeholder;
253
- const wrapCls = (0, _classnames.default)("".concat(prefixListCls, "-item"), "".concat(prefixCls, "-item"), "".concat(prefixListCls, "-item-middle"), className, {
254
- ["".concat(prefixCls, "-disabled")]: disabled,
255
- ["".concat(prefixCls, "-error")]: error,
256
- ["".concat(prefixCls, "-focus")]: focus,
257
- ["".concat(prefixCls, "-android")]: focus
260
+ const {
261
+ confirmLabel,
262
+ backspaceLabel,
263
+ cancelKeyboardLabel
264
+ } = _locale;
265
+ const {
266
+ focus,
267
+ placeholder
268
+ } = this.state;
269
+ const wrapCls = (0, _classnames.default)(`${prefixListCls}-item`, `${prefixCls}-item`, `${prefixListCls}-item-middle`, className, {
270
+ [`${prefixCls}-disabled`]: disabled,
271
+ [`${prefixCls}-error`]: error,
272
+ [`${prefixCls}-focus`]: focus,
273
+ [`${prefixCls}-android`]: focus
258
274
  });
259
- const labelCls = (0, _classnames.default)("".concat(prefixCls, "-label"), {
260
- ["".concat(prefixCls, "-label-2")]: labelNumber === 2,
261
- ["".concat(prefixCls, "-label-3")]: labelNumber === 3,
262
- ["".concat(prefixCls, "-label-4")]: labelNumber === 4,
263
- ["".concat(prefixCls, "-label-5")]: labelNumber === 5,
264
- ["".concat(prefixCls, "-label-6")]: labelNumber === 6,
265
- ["".concat(prefixCls, "-label-7")]: labelNumber === 7
275
+ const labelCls = (0, _classnames.default)(`${prefixCls}-label`, {
276
+ [`${prefixCls}-label-2`]: labelNumber === 2,
277
+ [`${prefixCls}-label-3`]: labelNumber === 3,
278
+ [`${prefixCls}-label-4`]: labelNumber === 4,
279
+ [`${prefixCls}-label-5`]: labelNumber === 5,
280
+ [`${prefixCls}-label-6`]: labelNumber === 6,
281
+ [`${prefixCls}-label-7`]: labelNumber === 7
266
282
  });
267
- const controlCls = "".concat(prefixCls, "-control");
283
+ const controlCls = `${prefixCls}-control`;
268
284
  let inputType = 'text';
269
285
  if (type === 'bankCard' || type === 'phone') {
270
286
  inputType = 'tel';
@@ -290,7 +306,7 @@ class InputItem extends React.Component {
290
306
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
291
307
  className: wrapCls,
292
308
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
293
- className: "".concat(prefixListCls, "-line"),
309
+ className: `${prefixListCls}-line`,
294
310
  children: [children ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
295
311
  className: labelCls,
296
312
  children: children
@@ -318,7 +334,10 @@ class InputItem extends React.Component {
318
334
  moneyKeyboardHeader: moneyKeyboardHeader,
319
335
  autoAdjustHeight: autoAdjustHeight,
320
336
  disabledKeys: disabledKeys
321
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.default, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, patternProps), restProps), classNameProps), {}, {
337
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.default, {
338
+ ...patternProps,
339
+ ...restProps,
340
+ ...classNameProps,
322
341
  value: normalizeValue(value),
323
342
  defaultValue: undefined,
324
343
  ref: el => this.inputRef = el,
@@ -332,18 +351,18 @@ class InputItem extends React.Component {
332
351
  onBlur: this.onInputBlur,
333
352
  readOnly: !editable,
334
353
  disabled: disabled
335
- }))
336
- }), clear && editable && !disabled && value && "".concat(value).length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
337
- activeClassName: "".concat(prefixCls, "-clear-active"),
354
+ })
355
+ }), clear && editable && !disabled && value && `${value}`.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_rmcFeedback.default, {
356
+ activeClassName: `${prefixCls}-clear-active`,
338
357
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
339
- className: "".concat(prefixCls, "-clear"),
358
+ className: `${prefixCls}-clear`,
340
359
  onClick: this.clearInput
341
360
  })
342
361
  }) : null, error ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
343
- className: "".concat(prefixCls, "-error-extra"),
362
+ className: `${prefixCls}-error-extra`,
344
363
  onClick: onErrorClick
345
364
  }) : null, extra !== '' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
346
- className: "".concat(prefixCls, "-extra"),
365
+ className: `${prefixCls}-extra`,
347
366
  onClick: onExtraClick,
348
367
  children: extra
349
368
  }) : null]
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
8
  var React = _interopRequireWildcard(require("react"));
12
9
  require("./style/index.css");
13
10
  var _jsxRuntime = require("react/jsx-runtime");
14
- const _excluded = ["onBlur", "onFocus"];
15
11
  class Input extends React.Component {
16
12
  constructor() {
17
13
  super(...arguments);
@@ -35,15 +31,17 @@ class Input extends React.Component {
35
31
  };
36
32
  }
37
33
  render() {
38
- const _this$props = this.props,
39
- onBlur = _this$props.onBlur,
40
- onFocus = _this$props.onFocus,
41
- restProps = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
42
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread2.default)({
34
+ const {
35
+ onBlur,
36
+ onFocus,
37
+ ...restProps
38
+ } = this.props;
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
43
40
  ref: el => this.inputRef = el,
44
41
  onBlur: this.onInputBlur,
45
- onFocus: this.onInputFocus
46
- }, restProps));
42
+ onFocus: this.onInputFocus,
43
+ ...restProps
44
+ });
47
45
  }
48
46
  }
49
47
  var _default = exports.default = Input;
@@ -20,9 +20,10 @@ class LastModifierFormatter extends _react.default.PureComponent {
20
20
  constructor() {
21
21
  super(...arguments);
22
22
  this.getCollaborators = () => {
23
- let _this$props = this.props,
24
- value = _this$props.value,
25
- collaborators = _this$props.collaborators;
23
+ let {
24
+ value,
25
+ collaborators
26
+ } = this.props;
26
27
  if (!Array.isArray(value)) {
27
28
  value = [value];
28
29
  }
@@ -42,9 +43,10 @@ class LastModifierFormatter extends _react.default.PureComponent {
42
43
  };
43
44
  }
44
45
  render() {
45
- const _this$props2 = this.props,
46
- containerClassName = _this$props2.containerClassName,
47
- value = _this$props2.value;
46
+ const {
47
+ containerClassName,
48
+ value
49
+ } = this.props;
48
50
  const classname = (0, _classnames.default)('dtable-ui cell-formatter-container last-modified-formatter', containerClassName);
49
51
  if (!value || Array.isArray(value) && value.length === 0) {
50
52
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -25,29 +25,36 @@ class LinkEditor extends _react.default.Component {
25
25
  }
26
26
  };
27
27
  this.getLinkedCellValue = () => {
28
- let _this$props = this.props,
29
- row = _this$props.row,
30
- column = _this$props.column,
31
- linkMetaData = _this$props.linkMetaData;
32
- let _ref = column.data || {},
33
- link_id = _ref.link_id,
34
- table_id = _ref.table_id,
35
- other_table_id = _ref.other_table_id;
28
+ let {
29
+ row,
30
+ column,
31
+ linkMetaData
32
+ } = this.props;
33
+ let {
34
+ link_id,
35
+ table_id,
36
+ other_table_id
37
+ } = column.data || {};
36
38
  this.linkId = link_id;
37
39
  this.tableId = table_id;
38
40
  this.otherTableId = other_table_id;
39
41
  return linkMetaData.getLinkedCellValue(this.linkId, this.tableId, this.otherTableId, row._id);
40
42
  };
41
43
  this.formatLinkedValuesToOptions = () => {
42
- let _this$props2 = this.props,
43
- column = _this$props2.column,
44
- linkMetaData = _this$props2.linkMetaData;
45
- let rowIds = this.state.newValue;
44
+ let {
45
+ column,
46
+ linkMetaData
47
+ } = this.props;
48
+ let {
49
+ newValue: rowIds
50
+ } = this.state;
46
51
  if (rowIds && Array.isArray(rowIds) && rowIds.length > 0) {
47
52
  let linkedRows = linkMetaData.getLinkedRows(this.otherTableId, rowIds);
48
53
  let linkedTable = linkMetaData.getLinkedTable(this.otherTableId);
49
54
  return linkedRows.map(linkedRow => {
50
- let displayColumnKey = column.data.display_column_key;
55
+ let {
56
+ display_column_key: displayColumnKey
57
+ } = column.data;
51
58
  // format value to display
52
59
  let displayValue = this.getDisplayValue(linkedTable, linkedRow, displayColumnKey);
53
60
  return {
@@ -61,8 +68,10 @@ class LinkEditor extends _react.default.Component {
61
68
  this.getDisplayValue = (linkedTable, linkedRow, displayColumnKey) => {
62
69
  let value = linkedRow[displayColumnKey];
63
70
  let linkedColumn = linkedTable.columns.find(column => column.key === displayColumnKey);
64
- let type = linkedColumn.type,
65
- data = linkedColumn.data;
71
+ let {
72
+ type,
73
+ data
74
+ } = linkedColumn;
66
75
  switch (type) {
67
76
  case _dtableUtils.CellType.NUMBER:
68
77
  {
@@ -70,7 +79,9 @@ class LinkEditor extends _react.default.Component {
70
79
  }
71
80
  case _dtableUtils.CellType.DATE:
72
81
  {
73
- let format = data.format;
82
+ let {
83
+ format
84
+ } = data;
74
85
  return (0, _dtableUtils.getDateDisplayString)(value, format);
75
86
  }
76
87
  default:
@@ -78,10 +89,13 @@ class LinkEditor extends _react.default.Component {
78
89
  }
79
90
  };
80
91
  this.getAvailableLinkedOptions = () => {
81
- let _this$props3 = this.props,
82
- column = _this$props3.column,
83
- linkMetaData = _this$props3.linkMetaData;
84
- let displayColumnKey = column.data.display_column_key;
92
+ let {
93
+ column,
94
+ linkMetaData
95
+ } = this.props;
96
+ let {
97
+ display_column_key: displayColumnKey
98
+ } = column.data;
85
99
  let linkedTable = linkMetaData.getLinkedTable(this.otherTableId);
86
100
  let availableRows = linkedTable.rows.filter(row => {
87
101
  return !!row[displayColumnKey];
@@ -118,9 +132,10 @@ class LinkEditor extends _react.default.Component {
118
132
  }
119
133
  };
120
134
  this.onOptionItemToggle = option => {
121
- let _this$props4 = this.props,
122
- row = _this$props4.row,
123
- linkMetaData = _this$props4.linkMetaData;
135
+ let {
136
+ row,
137
+ linkMetaData
138
+ } = this.props;
124
139
  let newValue = this.state.newValue.slice();
125
140
  let optionIndex = newValue.findIndex(option_id => option_id === option.id);
126
141
  if (optionIndex !== -1) {
@@ -135,9 +150,10 @@ class LinkEditor extends _react.default.Component {
135
150
  });
136
151
  };
137
152
  this.onDeleteOption = option => {
138
- let _this$props5 = this.props,
139
- row = _this$props5.row,
140
- linkMetaData = _this$props5.linkMetaData;
153
+ let {
154
+ row,
155
+ linkMetaData
156
+ } = this.props;
141
157
  let newValue = this.state.newValue.slice();
142
158
  let optionIndex = newValue.findIndex(option_id => option_id === option.id);
143
159
  newValue.splice(optionIndex, 1);
@@ -150,9 +166,10 @@ class LinkEditor extends _react.default.Component {
150
166
  this.caculatePopoverPosition = () => {
151
167
  const POPOVER_MAX_HEIGHT = 200;
152
168
  let innerHeight = window.innerHeight;
153
- let _this$editor$getClien = this.editor.getClientRects()[0],
154
- top = _this$editor$getClien.top,
155
- height = _this$editor$getClien.height;
169
+ let {
170
+ top,
171
+ height
172
+ } = this.editor.getClientRects()[0];
156
173
  let isBelow = innerHeight - (top + height) > POPOVER_MAX_HEIGHT;
157
174
  let position = {
158
175
  top: height + 1,
@@ -194,10 +211,13 @@ class LinkEditor extends _react.default.Component {
194
211
  document.removeEventListener('mousedown', this.onMouseDown);
195
212
  }
196
213
  render() {
197
- let isReadOnly = this.props.isReadOnly;
198
- let _this$state = this.state,
199
- isPopoverShow = _this$state.isPopoverShow,
200
- popoverPosition = _this$state.popoverPosition;
214
+ let {
215
+ isReadOnly
216
+ } = this.props;
217
+ let {
218
+ isPopoverShow,
219
+ popoverPosition
220
+ } = this.state;
201
221
  let options = this.getAvailableLinkedOptions();
202
222
  let selectedOptions = this.formatLinkedValuesToOptions();
203
223
  let isShowRemoveIcon = !isReadOnly;
@@ -54,9 +54,10 @@ class LinkEditorOption extends _react.default.Component {
54
54
  };
55
55
  }
56
56
  render() {
57
- let _this$props = this.props,
58
- option = _this$props.option,
59
- isShowRemoveIcon = _this$props.isShowRemoveIcon;
57
+ let {
58
+ option,
59
+ isShowRemoveIcon
60
+ } = this.props;
60
61
  let containerStyle = this.getContainerStyle();
61
62
  let optionStyle = this.getOptionStyle();
62
63
  let optionNameStyle = this.getOptionNameStyle();
@@ -25,7 +25,9 @@ class MBLinkEditorPopover extends _react.default.Component {
25
25
  }
26
26
  };
27
27
  this.onChangeSearch = event => {
28
- let searchVal = this.state.searchVal;
28
+ let {
29
+ searchVal
30
+ } = this.state;
29
31
  if (searchVal === event.target.value) {
30
32
  return;
31
33
  }
@@ -35,9 +37,10 @@ class MBLinkEditorPopover extends _react.default.Component {
35
37
  });
36
38
  };
37
39
  this.getSelectedOptions = () => {
38
- let _this$props = this.props,
39
- value = _this$props.value,
40
- options = _this$props.options;
40
+ let {
41
+ value,
42
+ options
43
+ } = this.props;
41
44
  if (!Array.isArray(value)) {
42
45
  return [];
43
46
  }
@@ -46,8 +49,12 @@ class MBLinkEditorPopover extends _react.default.Component {
46
49
  });
47
50
  };
48
51
  this.getFilterOptions = () => {
49
- let options = this.props.options;
50
- let searchVal = this.state.searchVal;
52
+ let {
53
+ options
54
+ } = this.props;
55
+ let {
56
+ searchVal
57
+ } = this.state;
51
58
  return searchVal ? options.filter(item => item.name.indexOf(searchVal) > -1) : options;
52
59
  };
53
60
  this.onSelectOption = option => {
@@ -57,7 +64,9 @@ class MBLinkEditorPopover extends _react.default.Component {
57
64
  this.props.onOptionItemToggle(option);
58
65
  };
59
66
  this.renderFilteredOptions = options => {
60
- let value = this.props.value;
67
+ let {
68
+ value
69
+ } = this.props;
61
70
  return options.map((option, index) => {
62
71
  let isSelect = value.some(item => item === option.id);
63
72
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
@@ -91,8 +100,12 @@ class MBLinkEditorPopover extends _react.default.Component {
91
100
  window.removeEventListener('popstate', this.handleHistaryBack, false);
92
101
  }
93
102
  render() {
94
- const column = this.props.column;
95
- const searchVal = this.state.searchVal;
103
+ const {
104
+ column
105
+ } = this.props;
106
+ const {
107
+ searchVal
108
+ } = this.state;
96
109
  let filterOptions = this.getFilterOptions();
97
110
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
98
111
  ref: this.setEditorPopover,
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
9
8
  var _react = _interopRequireDefault(require("react"));
10
9
  var _lang = require("../../lang");
11
10
  require("./index.css");
@@ -27,7 +26,9 @@ class PCLinkEditorPopover extends _react.default.Component {
27
26
  this.props.onOptionItemToggle(item);
28
27
  };
29
28
  this.getFilterOptions = () => {
30
- let options = this.props.options;
29
+ let {
30
+ options
31
+ } = this.props;
31
32
  let filter = this.state.searchValue.toLowerCase();
32
33
  if (!filter) {
33
34
  return options;
@@ -42,11 +43,16 @@ class PCLinkEditorPopover extends _react.default.Component {
42
43
  }
43
44
  render() {
44
45
  let options = this.getFilterOptions();
45
- let _this$props = this.props,
46
- popoverPosition = _this$props.popoverPosition,
47
- selectedOptions = _this$props.selectedOptions;
48
- let searchValue = this.state.searchValue;
49
- let popoverStyle = Object.assign({}, (0, _objectSpread2.default)({}, popoverPosition), {
46
+ let {
47
+ popoverPosition,
48
+ selectedOptions
49
+ } = this.props;
50
+ let {
51
+ searchValue
52
+ } = this.state;
53
+ let popoverStyle = Object.assign({}, {
54
+ ...popoverPosition
55
+ }, {
50
56
  position: 'absolute'
51
57
  });
52
58
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {