dtable-ui-component 5.3.1-beta6 → 5.3.2-alpha1

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 (248) hide show
  1. package/lib/CheckboxEditor/index.css +20 -3
  2. package/lib/CheckboxEditor/index.js +35 -98
  3. package/lib/CheckboxFormatter/index.js +9 -6
  4. package/lib/CollaboratorEditor/index.css +35 -12
  5. package/lib/CollaboratorEditor/index.js +212 -18
  6. package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.js +29 -26
  7. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +97 -0
  8. package/lib/CollaboratorItem/index.css +1 -1
  9. package/lib/CollaboratorItem/index.js +2 -6
  10. package/lib/DTableCustomizeSelect/index.css +1 -1
  11. package/lib/DTableFiltersPopover/utils/index.js +7 -1
  12. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +2 -2
  13. package/lib/DTableGroupSelect/select-option-group.css +17 -17
  14. package/lib/DTableGroupSelect/select-option-group.js +1 -1
  15. package/lib/DTableSelect/index.js +1 -3
  16. package/lib/DateEditor/index.js +51 -14
  17. package/lib/DateEditor/pc-date-editor-popover.js +12 -145
  18. package/lib/Department-editor/department-single-select.js +1 -1
  19. package/lib/Department-editor/index.js +4 -3
  20. package/lib/DepartmentSingleSelectFormatter/index.js +1 -2
  21. package/lib/FileEditor/index.js +11 -258
  22. package/lib/FileEditor/pc-files-addition/index.js +1 -0
  23. package/lib/FileEditor/pc-files-addition/pc-file-uploaded-item.js +1 -0
  24. package/lib/FileEditor/pc-files-preview/index.js +1 -0
  25. package/lib/FileEditor/pc-files-preview/pc-file-item-preview.js +1 -0
  26. package/lib/FileItemFormatter/assets/file/192/excel.png +0 -0
  27. package/lib/FileItemFormatter/assets/file/192/file.png +0 -0
  28. package/lib/FileItemFormatter/assets/file/192/music.png +0 -0
  29. package/lib/FileItemFormatter/assets/file/192/pdf.png +0 -0
  30. package/lib/FileItemFormatter/assets/file/192/pic.png +0 -0
  31. package/lib/FileItemFormatter/assets/file/192/ppt.png +0 -0
  32. package/lib/FileItemFormatter/assets/file/192/txt.png +0 -0
  33. package/lib/FileItemFormatter/assets/file/192/video.png +0 -0
  34. package/lib/FileItemFormatter/assets/file/192/word.png +0 -0
  35. package/lib/FileItemFormatter/assets/file/24/excel.png +0 -0
  36. package/lib/FileItemFormatter/assets/file/24/file.png +0 -0
  37. package/lib/FileItemFormatter/assets/file/24/music.png +0 -0
  38. package/lib/FileItemFormatter/assets/file/24/pdf.png +0 -0
  39. package/lib/FileItemFormatter/assets/file/24/pic.png +0 -0
  40. package/lib/FileItemFormatter/assets/file/24/ppt.png +0 -0
  41. package/lib/FileItemFormatter/assets/file/24/txt.png +0 -0
  42. package/lib/FileItemFormatter/assets/file/24/video.png +0 -0
  43. package/lib/FileItemFormatter/assets/file/24/word.png +0 -0
  44. package/lib/FileItemFormatter/assets/folder/folder-192.png +0 -0
  45. package/lib/FileItemFormatter/assets/folder/folder-24.png +0 -0
  46. package/lib/FileItemFormatter/index.js +20 -19
  47. package/lib/FileItemFormatter/utils.js +99 -0
  48. package/lib/FileUploader/index.js +14 -268
  49. package/lib/FormulaFormatter/index.js +1 -2
  50. package/lib/FormulaFormatter/utils.js +31 -0
  51. package/lib/LinkEditor/pc-link-editor-popover/index.js +1 -1
  52. package/lib/MultipleSelectEditor/index.css +9 -0
  53. package/lib/MultipleSelectEditor/index.js +177 -16
  54. package/lib/NumberEditor/index.js +77 -64
  55. package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.css +1 -1
  56. package/lib/{RowExpandFormatter/RowExpandEmailFormatter → RowExpandEmailFormatter}/index.js +1 -1
  57. package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.css +6 -6
  58. package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/index.js +1 -3
  59. package/lib/{RowExpandFormatter/RowExpandFileFormatter → RowExpandFileFormatter}/row-expand-file-item-formatter.js +11 -10
  60. package/lib/RowExpandFormatter/index.css +1 -27
  61. package/lib/RowExpandFormatter/index.js +100 -83
  62. package/lib/{RowExpandFormatter/RowExpandFormulaFormatter → RowExpandFormulaFormatter}/index.js +10 -11
  63. package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.css +6 -6
  64. package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/index.js +1 -1
  65. package/lib/{RowExpandFormatter/RowExpandImageFormatter → RowExpandImageFormatter}/row-expand-image-item-formatter.js +3 -3
  66. package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/collaborator-item-formatter.js +1 -1
  67. package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.js +6 -6
  68. package/lib/RowExpandLinkFormatter/utils.js +71 -0
  69. package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.css +1 -1
  70. package/lib/RowExpandUrlFormatter/index.css +1 -0
  71. package/lib/{RowExpandFormatter/RowExpandUrlFormatter → RowExpandUrlFormatter}/index.js +3 -4
  72. package/lib/SingleSelectEditor/index.css +14 -0
  73. package/lib/SingleSelectEditor/index.js +156 -16
  74. package/lib/TextEditor/index.js +42 -113
  75. package/lib/constants/index.js +2 -34
  76. package/lib/css/cell-editor.css +2 -18
  77. package/lib/index.js +46 -74
  78. package/lib/lang/index.js +16 -19
  79. package/lib/locals/de.js +103 -0
  80. package/lib/locals/en.js +104 -0
  81. package/lib/locals/es.js +103 -0
  82. package/lib/locals/fr.js +103 -0
  83. package/lib/locals/pt.js +103 -0
  84. package/lib/locals/ru.js +103 -0
  85. package/lib/locals/zh-CN.js +104 -0
  86. package/lib/select-editor/index.js +6 -6
  87. package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.js +3 -3
  88. package/lib/select-editor/pc-select-editor-popover/index.css +71 -0
  89. package/lib/select-editor/pc-select-editor-popover/index.js +122 -0
  90. package/lib/utils/editor-utils.js +6 -1
  91. package/lib/utils/url.js +8 -121
  92. package/lib/utils/utils.js +2 -145
  93. package/package.json +2 -3
  94. package/lib/CollaboratorEditor/pc-collaborator-editor/index.js +0 -257
  95. package/lib/Comment/body/comment.js +0 -190
  96. package/lib/Comment/body/index.css +0 -95
  97. package/lib/Comment/body/index.js +0 -32
  98. package/lib/Comment/footer/btns/index.css +0 -40
  99. package/lib/Comment/footer/btns/index.js +0 -113
  100. package/lib/Comment/footer/index.css +0 -157
  101. package/lib/Comment/footer/index.js +0 -170
  102. package/lib/Comment/footer/input/index.css +0 -52
  103. package/lib/Comment/footer/input/index.js +0 -448
  104. package/lib/Comment/footer/input/participant/index.css +0 -0
  105. package/lib/Comment/footer/input/participant/index.js +0 -53
  106. package/lib/Comment/footer/participants/index.css +0 -22
  107. package/lib/Comment/footer/participants/index.js +0 -68
  108. package/lib/Comment/footer/participants/participant/index.css +0 -5
  109. package/lib/Comment/footer/participants/participant/index.js +0 -32
  110. package/lib/Comment/footer/participants/participant-select/index.css +0 -104
  111. package/lib/Comment/footer/participants/participant-select/index.js +0 -182
  112. package/lib/Comment/index.css +0 -19
  113. package/lib/Comment/index.js +0 -305
  114. package/lib/Comment/model.js +0 -25
  115. package/lib/Comment/utils/common.js +0 -62
  116. package/lib/Comment/utils/index.js +0 -27
  117. package/lib/Comment/utils/utilities.js +0 -176
  118. package/lib/DeleteTip/index.js +0 -50
  119. package/lib/DigitalSignEditor/constants.js +0 -7
  120. package/lib/DigitalSignEditor/index.css +0 -69
  121. package/lib/DigitalSignEditor/index.js +0 -182
  122. package/lib/DigitalSignEditor/service.js +0 -38
  123. package/lib/DigitalSignEditor/signature-board/index.css +0 -35
  124. package/lib/DigitalSignEditor/signature-board/index.js +0 -135
  125. package/lib/DigitalSignEditor/signature-board/signature-tool.js +0 -396
  126. package/lib/DigitalSignEditor/utils.js +0 -29
  127. package/lib/DurationEditor/index.js +0 -111
  128. package/lib/EmailEditor/index.js +0 -59
  129. package/lib/FileEditor/addition-previewer/index.css +0 -1
  130. package/lib/FileEditor/addition-previewer/index.js +0 -52
  131. package/lib/FileEditor/addition-previewer/local-file-addition/index.css +0 -1
  132. package/lib/FileEditor/addition-previewer/local-file-addition/index.js +0 -252
  133. package/lib/FileEditor/constants.js +0 -7
  134. package/lib/FileEditor/files-previewer/file-previewer/dropdown-menu.js +0 -74
  135. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.css +0 -5
  136. package/lib/FileEditor/files-previewer/file-previewer/file-name-editor/index.js +0 -77
  137. package/lib/FileEditor/files-previewer/file-previewer/index.css +0 -88
  138. package/lib/FileEditor/files-previewer/file-previewer/index.js +0 -167
  139. package/lib/FileEditor/files-previewer/index.css +0 -56
  140. package/lib/FileEditor/files-previewer/index.js +0 -277
  141. package/lib/FileEditor/index.css +0 -6
  142. package/lib/FileEditor/utils.js +0 -22
  143. package/lib/FileUploader/index.css +0 -9
  144. package/lib/GeolocationEditor/country-editor.js +0 -319
  145. package/lib/GeolocationEditor/index.css +0 -641
  146. package/lib/GeolocationEditor/index.js +0 -241
  147. package/lib/GeolocationEditor/location-editor.js +0 -368
  148. package/lib/GeolocationEditor/map-editor/index.js +0 -456
  149. package/lib/GeolocationEditor/map-editor/large-editor/index.css +0 -137
  150. package/lib/GeolocationEditor/map-editor/large-editor/index.js +0 -461
  151. package/lib/GeolocationEditor/map-editor-utils.js +0 -153
  152. package/lib/GeolocationEditor/map-selection-editor/index.js +0 -455
  153. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.css +0 -1
  154. package/lib/GeolocationEditor/map-selection-editor/large-editor/index.js +0 -447
  155. package/lib/GeolocationEditor/parse-geolocation.js +0 -282
  156. package/lib/GeolocationEditor/province-city-editor.js +0 -292
  157. package/lib/GeolocationEditor/province-editor.js +0 -226
  158. package/lib/GeolocationEditor/selector-header-item.js +0 -28
  159. package/lib/GeolocationEditor/selector-list.js +0 -33
  160. package/lib/GeolocationEditor/with-ref.js +0 -27
  161. package/lib/ImageEditor/addition-previewer/image-link/index.css +0 -45
  162. package/lib/ImageEditor/addition-previewer/image-link/index.js +0 -73
  163. package/lib/ImageEditor/addition-previewer/index.css +0 -106
  164. package/lib/ImageEditor/addition-previewer/index.js +0 -63
  165. package/lib/ImageEditor/addition-previewer/local-image-addition/index.css +0 -125
  166. package/lib/ImageEditor/addition-previewer/local-image-addition/index.js +0 -254
  167. package/lib/ImageEditor/constants.js +0 -7
  168. package/lib/ImageEditor/images-previewer/image-preview/index.css +0 -59
  169. package/lib/ImageEditor/images-previewer/image-preview/index.js +0 -155
  170. package/lib/ImageEditor/images-previewer/index.css +0 -18
  171. package/lib/ImageEditor/images-previewer/index.js +0 -140
  172. package/lib/ImageEditor/index.css +0 -24
  173. package/lib/ImageEditor/index.js +0 -194
  174. package/lib/ImageThumbnail/index.css +0 -20
  175. package/lib/ImageThumbnail/index.js +0 -136
  176. package/lib/RowExpandDialog/body/index.css +0 -21
  177. package/lib/RowExpandDialog/body/index.js +0 -262
  178. package/lib/RowExpandDialog/column-content/index.css +0 -44
  179. package/lib/RowExpandDialog/column-content/index.js +0 -50
  180. package/lib/RowExpandDialog/header/index.css +0 -31
  181. package/lib/RowExpandDialog/header/index.js +0 -55
  182. package/lib/RowExpandDialog/index.css +0 -24
  183. package/lib/RowExpandDialog/index.js +0 -252
  184. package/lib/RowExpandEditor/RowExpandAddBtn/index.css +0 -22
  185. package/lib/RowExpandEditor/RowExpandAddBtn/index.js +0 -24
  186. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.css +0 -18
  187. package/lib/RowExpandEditor/RowExpandCheckboxEditor/index.js +0 -43
  188. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.css +0 -5
  189. package/lib/RowExpandEditor/RowExpandCollaboratorEditor/index.js +0 -232
  190. package/lib/RowExpandEditor/RowExpandDateEditor/index.js +0 -130
  191. package/lib/RowExpandEditor/RowExpandDepartmentEditor/index.js +0 -129
  192. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.css +0 -13
  193. package/lib/RowExpandEditor/RowExpandDigitalSignEditor/index.js +0 -208
  194. package/lib/RowExpandEditor/RowExpandDurationEditor/index.js +0 -105
  195. package/lib/RowExpandEditor/RowExpandEmailEditor/index.css +0 -2
  196. package/lib/RowExpandEditor/RowExpandEmailEditor/index.js +0 -125
  197. package/lib/RowExpandEditor/RowExpandFileEditor/index.css +0 -1
  198. package/lib/RowExpandEditor/RowExpandFileEditor/index.js +0 -146
  199. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.css +0 -17
  200. package/lib/RowExpandEditor/RowExpandGeolocationEditor/index.js +0 -165
  201. package/lib/RowExpandEditor/RowExpandImageEditor/index.css +0 -6
  202. package/lib/RowExpandEditor/RowExpandImageEditor/index.js +0 -170
  203. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.css +0 -6
  204. package/lib/RowExpandEditor/RowExpandLongTextEditor/index.js +0 -123
  205. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.css +0 -44
  206. package/lib/RowExpandEditor/RowExpandMultipleSelectEditor/index.js +0 -224
  207. package/lib/RowExpandEditor/RowExpandNumberEditor/index.js +0 -105
  208. package/lib/RowExpandEditor/RowExpandRateEditor/index.css +0 -13
  209. package/lib/RowExpandEditor/RowExpandRateEditor/index.js +0 -152
  210. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.css +0 -58
  211. package/lib/RowExpandEditor/RowExpandSingleSelectorEditor/index.js +0 -192
  212. package/lib/RowExpandEditor/RowExpandTextEditor/index.css +0 -4
  213. package/lib/RowExpandEditor/RowExpandTextEditor/index.js +0 -127
  214. package/lib/RowExpandEditor/RowExpandUrlEditor/index.css +0 -31
  215. package/lib/RowExpandEditor/RowExpandUrlEditor/index.js +0 -130
  216. package/lib/RowExpandEditor/constants.js +0 -44
  217. package/lib/RowExpandEditor/index.css +0 -0
  218. package/lib/RowExpandEditor/index.js +0 -32
  219. package/lib/RowExpandFormatter/RowExpandDepartmentFormatter/index.js +0 -27
  220. package/lib/RowExpandFormatter/RowExpandUrlFormatter/index.css +0 -1
  221. package/lib/RowExpandFormatter/constants.js +0 -60
  222. package/lib/UploadProgress/index.js +0 -38
  223. package/lib/UrlEditor/index.js +0 -62
  224. package/lib/common/editor-base.js +0 -53
  225. package/lib/constants/file.js +0 -96
  226. package/lib/constants/key-codes.js +0 -109
  227. package/lib/hooks/index.js +0 -16
  228. package/lib/locales/de.json +0 -167
  229. package/lib/locales/en.json +0 -167
  230. package/lib/locales/es.json +0 -167
  231. package/lib/locales/fr.json +0 -167
  232. package/lib/locales/pt.json +0 -167
  233. package/lib/locales/ru.json +0 -167
  234. package/lib/locales/zh-CN.json +0 -167
  235. package/lib/select-editor/pc-select-editor/index.css +0 -85
  236. package/lib/select-editor/pc-select-editor/index.js +0 -290
  237. package/lib/utils/cell-comparer.js +0 -35
  238. package/lib/utils/cell.js +0 -55
  239. package/lib/utils/column-utils.js +0 -25
  240. package/lib/utils/get-event-transfer.js +0 -75
  241. package/lib/utils/hotkey.js +0 -37
  242. package/lib/utils/object-utils.js +0 -61
  243. /package/lib/CollaboratorEditor/{mb-collaborator-editor → mb-collaborator-editor-popover}/index.css +0 -0
  244. /package/lib/CollaboratorEditor/{pc-collaborator-editor → pc-collaborator-editor-popover}/index.css +0 -0
  245. /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/index.css +0 -0
  246. /package/lib/{RowExpandFormatter/RowExpandLinkFormatter → RowExpandLinkFormatter}/value-display-utils.js +0 -0
  247. /package/lib/{RowExpandFormatter/RowExpandRateFormatter → RowExpandRateFormatter}/index.js +0 -0
  248. /package/lib/select-editor/{mb-select-editor → mb-select-editor-popover}/index.css +0 -0
@@ -6,15 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _dtableUtils = require("dtable-utils");
10
9
  var _lang = require("../../lang");
11
10
  var _MBEditorHeader = _interopRequireDefault(require("../../MBEditorHeader"));
12
- var _DTableSearchInput = _interopRequireDefault(require("../../DTableSearchInput"));
13
11
  require("./index.css");
14
- class MBCollaboratorEditor extends _react.default.Component {
12
+ class MBCollaboratorEditorPopover extends _react.default.Component {
15
13
  constructor(props) {
16
14
  super(props);
17
- this.handleHistoryBack = e => {
15
+ this.handleHistaryBack = e => {
18
16
  e.preventDefault();
19
17
  this.props.onClosePopover();
20
18
  };
@@ -25,13 +23,16 @@ class MBCollaboratorEditor extends _react.default.Component {
25
23
  return false;
26
24
  }
27
25
  };
28
- this.onChangeSearch = newValue => {
26
+ this.onChangeSearch = event => {
29
27
  let {
30
28
  searchVal
31
29
  } = this.state;
32
- if (searchVal === newValue) return;
30
+ if (searchVal === event.target.value) {
31
+ return;
32
+ }
33
+ searchVal = event.target.value;
33
34
  this.setState({
34
- searchVal: newValue
35
+ searchVal
35
36
  });
36
37
  };
37
38
  this.getSelectedCollaborators = () => {
@@ -53,24 +54,24 @@ class MBCollaboratorEditor extends _react.default.Component {
53
54
  let {
54
55
  searchVal
55
56
  } = this.state;
56
- return searchVal ? (0, _dtableUtils.searchCollaborators)(collaborators, searchVal) : collaborators;
57
+ return searchVal ? collaborators.filter(item => item.name.indexOf(searchVal) > -1) : collaborators;
57
58
  };
58
- this.onCollaboratorClick = collaborator => {
59
- this.props.onCommit(collaborator);
59
+ this.onSelectCollaborator = collaborator => {
60
+ this.props.onCollaboratorItemToggle(collaborator);
60
61
  };
61
62
  this.onRemoveCollaborator = collaborator => {
62
- this.props.onCommit(collaborator);
63
+ this.props.onCollaboratorItemToggle(collaborator);
63
64
  };
64
65
  this.renderFilteredCollaborators = collaborators => {
65
66
  let {
66
- value = []
67
+ value
67
68
  } = this.props;
68
69
  return collaborators.map((collaborator, index) => {
69
- const isSelected = value.includes(collaborator.email);
70
+ let isSelect = value.some(item => item === collaborator.email);
70
71
  return /*#__PURE__*/_react.default.createElement("div", {
71
72
  className: "mb-collaborator-option-item",
72
73
  key: index,
73
- onMouseDown: this.onCollaboratorClick.bind(this, collaborator)
74
+ onMouseDown: this.onSelectCollaborator.bind(this, collaborator)
74
75
  }, /*#__PURE__*/_react.default.createElement("span", {
75
76
  className: "mb-collaborator-info"
76
77
  }, /*#__PURE__*/_react.default.createElement("span", {
@@ -82,7 +83,7 @@ class MBCollaboratorEditor extends _react.default.Component {
82
83
  alt: "avatar"
83
84
  })), /*#__PURE__*/_react.default.createElement("span", {
84
85
  className: "collaborator-name"
85
- }, collaborator.name)), isSelected && /*#__PURE__*/_react.default.createElement("i", {
86
+ }, collaborator.name)), isSelect && /*#__PURE__*/_react.default.createElement("i", {
86
87
  className: "mb-collaborator-checked dtable-font dtable-icon-check-mark"
87
88
  }));
88
89
  });
@@ -96,10 +97,10 @@ class MBCollaboratorEditor extends _react.default.Component {
96
97
  }
97
98
  componentDidMount() {
98
99
  history.pushState(null, null, '#'); // eslint-disable-line
99
- window.addEventListener('popstate', this.handleHistoryBack, false);
100
+ window.addEventListener('popstate', this.handleHistaryBack, false);
100
101
  }
101
102
  componentWillUnmount() {
102
- window.removeEventListener('popstate', this.handleHistoryBack, false);
103
+ window.removeEventListener('popstate', this.handleHistaryBack, false);
103
104
  }
104
105
  render() {
105
106
  const {
@@ -119,17 +120,19 @@ class MBCollaboratorEditor extends _react.default.Component {
119
120
  className: "dtable-font dtable-icon-return"
120
121
  }),
121
122
  rightContent: /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Done')),
122
- onLeftClick: this.props.onClose,
123
- onRightClick: this.props.onClose
123
+ onLeftClick: this.props.onClosePopover,
124
+ onRightClick: this.props.onClosePopover
124
125
  }), /*#__PURE__*/_react.default.createElement("div", {
125
126
  className: "dtable-ui-mb-editor-body dtable-ui-mb-collaborator-editor-body"
126
127
  }, /*#__PURE__*/_react.default.createElement("div", {
127
128
  className: "mb-search-collaborator-items"
128
- }, /*#__PURE__*/_react.default.createElement(_DTableSearchInput.default, {
129
- autoFocus: true,
130
- value: searchVal,
129
+ }, /*#__PURE__*/_react.default.createElement("input", {
130
+ className: "form-control",
131
+ type: "text",
131
132
  placeholder: (0, _lang.getLocale)('Search_collaborator'),
132
- onChange: this.onChangeSearch
133
+ value: searchVal,
134
+ onChange: this.onChangeSearch,
135
+ onClick: this.onInputClick
133
136
  })), /*#__PURE__*/_react.default.createElement("div", {
134
137
  className: "mb-collaborators-container"
135
138
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -138,11 +141,11 @@ class MBCollaboratorEditor extends _react.default.Component {
138
141
  className: "content"
139
142
  }, filteredCollaborators.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
140
143
  className: "search-result-none"
141
- }, (0, _lang.getLocale)('No_collaborators_available')), filteredCollaborators.length > 0 && this.renderFilteredCollaborators(filteredCollaborators)))));
144
+ }, (0, _lang.getLocale)('No_collaborators_avaliable')), filteredCollaborators.length > 0 && this.renderFilteredCollaborators(filteredCollaborators)))));
142
145
  }
143
146
  }
144
- MBCollaboratorEditor.defaultProps = {
147
+ MBCollaboratorEditorPopover.defaultProps = {
145
148
  isReadOnly: false,
146
149
  value: []
147
150
  };
148
- var _default = exports.default = MBCollaboratorEditor;
151
+ var _default = exports.default = MBCollaboratorEditorPopover;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _lang = require("../../lang");
10
+ var _CollaboratorItem = _interopRequireDefault(require("../../CollaboratorItem"));
11
+ require("./index.css");
12
+ class PCCollaboratorEditorPopover extends _react.default.Component {
13
+ constructor(props) {
14
+ super(props);
15
+ this.onValueChanged = event => {
16
+ let value = event.target.value;
17
+ this.setState({
18
+ searchValue: value
19
+ });
20
+ };
21
+ this.onInputClick = event => {
22
+ event.nativeEvent.stopImmediatePropagation();
23
+ event.stopPropagation();
24
+ };
25
+ this.onCollaboratorItemToggle = item => {
26
+ this.props.onCollaboratorItemToggle(item);
27
+ };
28
+ this.getFilterCollaborator = () => {
29
+ let {
30
+ collaborators
31
+ } = this.props;
32
+ let filter = this.state.searchValue.toLowerCase();
33
+ if (!filter) {
34
+ return collaborators;
35
+ }
36
+ return collaborators.filter(collaborator => {
37
+ return collaborator.name.toString().toLowerCase().indexOf(filter) > -1;
38
+ });
39
+ };
40
+ this.state = {
41
+ searchValue: ''
42
+ };
43
+ this.editorInputRef = /*#__PURE__*/_react.default.createRef();
44
+ }
45
+ componentDidMount() {
46
+ this.editorInputRef.current.focus();
47
+ }
48
+ render() {
49
+ let {
50
+ searchValue
51
+ } = this.state;
52
+ let {
53
+ selectedCollaborators,
54
+ popoverPosition
55
+ } = this.props;
56
+ let collaborators = this.getFilterCollaborator();
57
+ let popoverStyle = Object.assign({}, {
58
+ ...popoverPosition
59
+ }, {
60
+ position: 'absolute'
61
+ });
62
+ return /*#__PURE__*/_react.default.createElement("div", {
63
+ className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
64
+ style: popoverStyle,
65
+ ref: this.props.setPopoverRef
66
+ }, /*#__PURE__*/_react.default.createElement("div", {
67
+ className: "collaborator-search-container"
68
+ }, /*#__PURE__*/_react.default.createElement("input", {
69
+ className: "form-control",
70
+ value: searchValue,
71
+ onChange: this.onValueChanged,
72
+ onClick: this.onInputClick,
73
+ placeholder: (0, _lang.getLocale)('Search_collaborator'),
74
+ ref: this.editorInputRef
75
+ })), /*#__PURE__*/_react.default.createElement("div", {
76
+ className: "collaborator-list-container"
77
+ }, collaborators.length > 0 && collaborators.map((collaborator, index) => {
78
+ const isSelect = selectedCollaborators.some(selectedCollaborator => {
79
+ return selectedCollaborator.email === collaborator.email;
80
+ });
81
+ return /*#__PURE__*/_react.default.createElement("div", {
82
+ key: index,
83
+ className: "collaborator-item-container",
84
+ onClick: this.onCollaboratorItemToggle.bind(this, collaborator)
85
+ }, /*#__PURE__*/_react.default.createElement(_CollaboratorItem.default, {
86
+ collaborator: collaborator
87
+ }), /*#__PURE__*/_react.default.createElement("div", {
88
+ className: "collaborator-checked"
89
+ }, isSelect && /*#__PURE__*/_react.default.createElement("i", {
90
+ className: "dtable-font dtable-icon-check-mark"
91
+ })));
92
+ }), collaborators.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
93
+ className: "no-search-result"
94
+ }, (0, _lang.getLocale)('No_collaborators_available'))));
95
+ }
96
+ }
97
+ var _default = exports.default = PCCollaboratorEditorPopover;
@@ -20,7 +20,7 @@
20
20
  display: flex;
21
21
  align-items: center;
22
22
  justify-content: center;
23
- margin: 0 5px 0 1px;
23
+ margin: 0 5px 0 2px;
24
24
  }
25
25
 
26
26
  .dtable-ui.collaborator-item .collaborator-avatar img {
@@ -6,26 +6,22 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
9
  require("./index.css");
11
10
  class CollaboratorItem extends _react.default.Component {
12
11
  constructor() {
13
12
  super(...arguments);
14
- this.onDeleteCollaborator = event => {
15
- event.stopPropagation();
16
- event && event.nativeEvent.stopImmediatePropagation();
13
+ this.onDeleteCollaborator = () => {
17
14
  this.props.onDeleteCollaborator(this.props.collaborator);
18
15
  };
19
16
  }
20
17
  render() {
21
18
  const {
22
- className,
23
19
  collaborator,
24
20
  enableDeleteCollaborator
25
21
  } = this.props;
26
22
  return /*#__PURE__*/_react.default.createElement("div", {
27
23
  title: collaborator.name,
28
- className: (0, _classnames.default)('dtable-ui collaborator-item', className)
24
+ className: "dtable-ui collaborator-item"
29
25
  }, /*#__PURE__*/_react.default.createElement("span", {
30
26
  className: "collaborator-avatar"
31
27
  }, /*#__PURE__*/_react.default.createElement("img", {
@@ -40,7 +40,7 @@
40
40
  display: inline-block;
41
41
  font-size: 12px;
42
42
  color: #999;
43
- transform: scale(0.8) translateY(2px);
43
+ transform: translateY(2px);
44
44
  transition: all 0.1s;
45
45
  }
46
46
 
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "FilterItemUtils", {
10
10
  return _filterItemUtils.default;
11
11
  }
12
12
  });
13
- exports.isFilterTermArray = exports.isCheckboxColumn = exports.getUpdatedFilterByTermModifier = exports.getUpdatedFilterBySpecialTerm = exports.getUpdatedFilterBySelectSingle = exports.getUpdatedFilterBySelectMultiple = exports.getUpdatedFilterByRate = exports.getUpdatedFilterByPredicate = exports.getUpdatedFilterByNormalTerm = exports.getUpdatedFilterByCreator = exports.getUpdatedFilterByColumn = exports.getUpdatedFilterByCollaborator = exports.getFormulaColumnFilter = exports.getFilterByColumn = exports.getColumnOptions = exports.getColumnByKey = exports.generateDefaultUser = void 0;
13
+ exports.isFilterTermArray = exports.isCheckboxColumn = exports.getUpdatedFilterByTermModifier = exports.getUpdatedFilterBySpecialTerm = exports.getUpdatedFilterBySelectSingle = exports.getUpdatedFilterBySelectMultiple = exports.getUpdatedFilterByRate = exports.getUpdatedFilterByPredicate = exports.getUpdatedFilterByNormalTerm = exports.getUpdatedFilterByCreator = exports.getUpdatedFilterByColumn = exports.getUpdatedFilterByCollaborator = exports.getFormulaColumnFilter = exports.getFilterByColumn = exports.getDateColumnFormat = exports.getColumnOptions = exports.getColumnByKey = exports.generateDefaultUser = void 0;
14
14
  var _dtableUtils = require("dtable-utils");
15
15
  var _filterItemUtils = _interopRequireDefault(require("./filter-item-utils"));
16
16
  var _constants = require("../constants");
@@ -459,6 +459,12 @@ const isCheckboxColumn = column => {
459
459
  return type === _dtableUtils.CellType.CHECKBOX;
460
460
  };
461
461
  exports.isCheckboxColumn = isCheckboxColumn;
462
+ const getDateColumnFormat = column => {
463
+ const format = column && column.data && column.data.format ? column.data.format : _dtableUtils.DEFAULT_DATE_FORMAT;
464
+ // Old Europe format is D/M/YYYY new format is DD/MM/YYYY
465
+ return format;
466
+ };
467
+ exports.getDateColumnFormat = getDateColumnFormat;
462
468
  const getMediaUrl = () => {
463
469
  var _window, _window$dtable, _window2, _window2$dtablePlugin;
464
470
  return ((_window = window) === null || _window === void 0 ? void 0 : (_window$dtable = _window.dtable) === null || _window$dtable === void 0 ? void 0 : _window$dtable.mediaUrl) || ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$dtablePlugin = _window2.dtablePluginConfig) === null || _window2$dtablePlugin === void 0 ? void 0 : _window2$dtablePlugin.mediaUrl) || '/media/';
@@ -13,7 +13,7 @@ require("dayjs/locale/en-gb");
13
13
  var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
14
14
  var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
15
15
  var _lang = require("../../lang");
16
- var _columnUtils = require("../../utils/column-utils");
16
+ var _utils = require("../utils");
17
17
  require("@seafile/seafile-calendar/assets/index.css");
18
18
  let now = (0, _dayjs.default)();
19
19
  class FilterCalendar extends _react.Component {
@@ -80,7 +80,7 @@ class FilterCalendar extends _react.Component {
80
80
  open: false,
81
81
  value: null
82
82
  };
83
- const DataFormat = (0, _columnUtils.getDateColumnFormat)(props.filterColumn).trim();
83
+ const DataFormat = (0, _utils.getDateColumnFormat)(props.filterColumn).trim();
84
84
  // Minutes and seconds are not supported at present
85
85
  this.columnDataFormat = DataFormat.split(' ')[0];
86
86
  this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
@@ -1,4 +1,4 @@
1
- .option-group {
1
+ .group-selector.option-group {
2
2
  position: absolute;
3
3
  left: 0;
4
4
  min-height: 60px;
@@ -13,29 +13,29 @@
13
13
  z-index: 10001;
14
14
  }
15
15
 
16
- .option-group .option-group-search {
16
+ .group-selector.option-group .option-group-search {
17
17
  width: 100%;
18
18
  padding: 6px 10px;
19
19
  min-width: 170px;
20
20
  }
21
21
 
22
- .option-group-search .form-control {
22
+ .group-selector .option-group-search .form-control {
23
23
  height: 31px;
24
24
  }
25
25
 
26
- .option-group .none-search-result {
26
+ .group-selector.option-group .none-search-result {
27
27
  height: 100px;
28
28
  width: 100%;
29
29
  padding: 10px;
30
30
  color: #666666;
31
31
  }
32
32
 
33
- .option-group .option-group-content {
33
+ .group-selector.option-group .option-group-content {
34
34
  max-height: 252px;
35
35
  overflow-y: auto;
36
36
  }
37
37
 
38
- .option {
38
+ .group-selector .option {
39
39
  display: block;
40
40
  width: 100%;
41
41
  line-height: 24px;
@@ -53,39 +53,39 @@
53
53
  justify-content: space-between;
54
54
  }
55
55
 
56
- .option .dtable-icon-check-mark {
56
+ .group-selector .option .dtable-icon-check-mark {
57
57
  font-size: 12px;
58
58
  color: #798d99;
59
59
  }
60
60
 
61
- .option.option-active {
61
+ .group-selector .option.option-active {
62
62
  background-color: #20a0ff;
63
63
  color: #fff;
64
64
  cursor: pointer;
65
65
  }
66
66
 
67
- .option.option-active .dtable-icon-check-mark,
68
- .option.option-active .select-option-name {
67
+ .group-selector .option.option-active .dtable-icon-check-mark,
68
+ .group-selector .option.option-active .select-option-name {
69
69
  color: #fff !important;
70
70
  }
71
71
 
72
- .option .select-option-name .single-select-option {
72
+ .group-selector .option .select-option-name .single-select-option {
73
73
  margin: 0 0 0 12px;
74
74
  }
75
75
 
76
- .option .select-option-name .multiple-select-option {
76
+ .group-selector .option .select-option-name .multiple-select-option {
77
77
  margin: 0;
78
78
  }
79
79
 
80
- .option-group-selector-single-select .select-option-name {
80
+ .group-selector .option-group-selector-single-select .select-option-name {
81
81
  display: flex;
82
82
  align-items: center;
83
83
  justify-content: space-between;
84
84
  }
85
85
 
86
- .option-group-selector-single-select .option:hover,
87
- .option-group-selector-single-select .option.option-active,
88
- .option-group-selector-multiple-select .option:hover,
89
- .option-group-selector-multiple-select .option.option-active {
86
+ .group-selector .option-group-selector-single-select .option:hover,
87
+ .group-selector .option-group-selector-single-select .option.option-active,
88
+ .group-selector .option-group-selector-multiple-select .option:hover,
89
+ .group-selector .option-group-selector-multiple-select .option.option-active {
90
90
  background-color: #f5f5f5;
91
91
  }
@@ -208,7 +208,7 @@ class SelectOptionGroup extends _react.Component {
208
208
  return /*#__PURE__*/_react.default.createElement(_ClickOutside.default, {
209
209
  onClickOutside: this.props.onClickOutside
210
210
  }, /*#__PURE__*/_react.default.createElement("div", {
211
- className: (0, _classnames.default)('option-group', className ? 'option-group-' + className : ''),
211
+ className: (0, _classnames.default)('option-group group-selector', className ? 'option-group-' + className : ''),
212
212
  ref: ref => this.optionGroupRef = ref,
213
213
  style: style,
214
214
  onMouseDown: this.onMouseDown
@@ -26,15 +26,13 @@ class DTableSelect extends _react.default.Component {
26
26
  isDisabled,
27
27
  form,
28
28
  customFilterOption,
29
- autoFocus,
30
- className
29
+ autoFocus
31
30
  } = this.props;
32
31
  return /*#__PURE__*/_react.default.createElement(_reactSelect.default, {
33
32
  value: value,
34
33
  onChange: onChange,
35
34
  options: options,
36
35
  isMulti: isMulti,
37
- className: className,
38
36
  classNamePrefix: classNamePrefix,
39
37
  styles: style || _utils.MenuSelectStyle,
40
38
  components: {
@@ -1,13 +1,15 @@
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;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
+ var _react = _interopRequireWildcard(require("react"));
9
10
  var _reactResponsive = _interopRequireDefault(require("react-responsive"));
10
- var _dayjs = _interopRequireDefault(require("../utils/dayjs"));
11
+ var _dayjs = _interopRequireDefault(require("dayjs"));
12
+ var _dtableUtils = require("dtable-utils");
11
13
  var _pcDateEditorPopover = _interopRequireDefault(require("./pc-date-editor-popover"));
12
14
  var _mbDateEditorPopover = _interopRequireDefault(require("./mb-date-editor-popover"));
13
15
  require("dayjs/locale/zh-cn");
@@ -24,21 +26,45 @@ class DateEditor extends _react.default.Component {
24
26
  let dateFormat = column.data && column.data.format;
25
27
  return dateFormat || defaultDateFormat;
26
28
  };
29
+ this.onDateEditorToggle = () => {
30
+ const {
31
+ isReadOnly
32
+ } = this.props;
33
+ if (isReadOnly) {
34
+ return;
35
+ }
36
+ this.setState({
37
+ isPopoverShow: !this.state.isPopoverShow
38
+ });
39
+ };
27
40
  this.onValueChanged = value => {
28
41
  if (value !== this.state.newValue) {
29
42
  this.setState({
30
43
  newValue: value
31
44
  });
32
45
  this.onCommit(value);
46
+ if (!this.state.showHourAndMinute) {
47
+ this.onClosePopover();
48
+ }
33
49
  }
34
50
  };
35
51
  this.onCommit = newValue => {
36
- this.props.onCommit(newValue);
52
+ let updated = {};
53
+ let {
54
+ column
55
+ } = this.props;
56
+ updated[column.key] = newValue;
57
+ this.props.onCommit(updated);
58
+ };
59
+ this.onClosePopover = () => {
60
+ this.setState({
61
+ isPopoverShow: false
62
+ });
37
63
  };
38
64
  this.state = {
39
65
  isDateInit: false,
40
66
  newValue: '',
41
- dateFormat: '',
67
+ isPopoverShow: false,
42
68
  showHourAndMinute: false,
43
69
  defaultCalendarValue: null
44
70
  };
@@ -53,36 +79,47 @@ class DateEditor extends _react.default.Component {
53
79
  this.setState({
54
80
  isDateInit: true,
55
81
  newValue: value,
56
- dateFormat,
82
+ dateFormat: dateFormat,
57
83
  showHourAndMinute: dateFormat.indexOf('HH:mm') > -1
58
84
  });
59
85
  }
60
86
  render() {
61
87
  if (!this.state.isDateInit) {
62
- return null;
88
+ return /*#__PURE__*/_react.default.createElement("div", {
89
+ className: "cell-editor date-editor"
90
+ }, /*#__PURE__*/_react.default.createElement("div", {
91
+ className: "date-editor-container"
92
+ }, /*#__PURE__*/_react.default.createElement("div", {
93
+ className: "control-form"
94
+ })));
63
95
  }
64
96
  let {
65
97
  lang,
66
98
  column,
67
- className,
68
- isInModal
99
+ className
69
100
  } = this.props;
70
101
  let {
71
102
  newValue,
103
+ isPopoverShow,
72
104
  dateFormat,
73
105
  showHourAndMinute
74
106
  } = this.state;
75
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
107
+ return /*#__PURE__*/_react.default.createElement("div", {
108
+ className: "cell-editor dtable-ui-date-editor"
109
+ }, !isPopoverShow && /*#__PURE__*/_react.default.createElement("div", {
110
+ className: "dtable-ui-date-editor-container"
111
+ }, /*#__PURE__*/_react.default.createElement("div", {
112
+ className: "form-control",
113
+ onClick: this.onDateEditorToggle
114
+ }, (0, _dtableUtils.getDateDisplayString)(newValue, dateFormat))), isPopoverShow && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
76
115
  query: '(min-width: 768px)'
77
116
  }, /*#__PURE__*/_react.default.createElement(_pcDateEditorPopover.default, {
78
117
  className: className,
79
118
  lang: lang,
80
- isInModal: isInModal,
81
119
  value: newValue,
82
120
  dateFormat: dateFormat,
83
121
  showHourAndMinute: showHourAndMinute,
84
- onValueChanged: this.onValueChanged,
85
- hideCalendar: this.props.hideCalendar
122
+ onValueChanged: this.onValueChanged
86
123
  })), /*#__PURE__*/_react.default.createElement(_reactResponsive.default, {
87
124
  query: '(max-width: 767.8px)'
88
125
  }, /*#__PURE__*/_react.default.createElement(_mbDateEditorPopover.default, {
@@ -94,8 +131,8 @@ class DateEditor extends _react.default.Component {
94
131
  showHourAndMinute: showHourAndMinute,
95
132
  column: column,
96
133
  onValueChanged: this.onValueChanged,
97
- onClosePopover: this.props.hideCalendar
98
- })));
134
+ onClosePopover: this.onClosePopover
135
+ }))));
99
136
  }
100
137
  }
101
138
  DateEditor.defaultProps = {