dtable-ui-component 0.1.75-beta1 → 0.1.75-beta5

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 (227) hide show
  1. package/lib/AutoNumberFormatter/index.css +1 -0
  2. package/{es/components/cell-formatter/auto-number-formatter.js → lib/AutoNumberFormatter/index.js} +1 -0
  3. package/lib/ButtonFormatter/index.css +13 -0
  4. package/{es/components/cell-formatter/button-formatter.js → lib/ButtonFormatter/index.js} +1 -0
  5. package/lib/CTimeFormatter/index.css +1 -0
  6. package/{es/components/cell-formatter/ctime-formatter.js → lib/CTimeFormatter/index.js} +1 -0
  7. package/lib/CheckboxFormatter/index.css +1 -0
  8. package/{es/components/cell-formatter/checkbox-formatter.js → lib/CheckboxFormatter/index.js} +1 -0
  9. package/lib/CollaboratorFormatter/index.css +1 -0
  10. package/{es/components/cell-formatter/collaborator-formatter.js → lib/CollaboratorFormatter/index.js} +3 -2
  11. package/lib/CollaboratorItem/index.css +49 -0
  12. package/{es/components/common/collaborator-item.js → lib/CollaboratorItem/index.js} +1 -0
  13. package/lib/CreatorFormatter/index.css +1 -0
  14. package/{es/components/cell-formatter/creator-formatter.js → lib/CreatorFormatter/index.js} +3 -2
  15. package/lib/DateFormatter/index.css +1 -0
  16. package/{es/components/cell-formatter/date-formatter.js → lib/DateFormatter/index.js} +2 -1
  17. package/lib/DurationFormatter/index.css +1 -0
  18. package/{es/components/cell-formatter/duration-formatter.js → lib/DurationFormatter/index.js} +2 -1
  19. package/lib/EmailFormatter/index.css +5 -0
  20. package/{es/components/cell-formatter/email-formatter.js → lib/EmailFormatter/index.js} +1 -0
  21. package/lib/FileFormatter/index.css +29 -0
  22. package/{es/components/cell-formatter/file-formatter.js → lib/FileFormatter/index.js} +2 -1
  23. package/{es/components/cell-formatter/widgets/file-item-formatter.js → lib/FileItemFormatter/index.js} +3 -2
  24. package/{es/components/file-uploader → lib/FileUploader}/index.js +0 -0
  25. package/lib/FormulaFormatter/index.css +19 -0
  26. package/{es/components/cell-formatter/formula-formatter.js → lib/FormulaFormatter/index.js} +8 -8
  27. package/lib/GeolocationFormatter/index.css +1 -0
  28. package/{es/components/cell-formatter/geolocation-formatter.js → lib/GeolocationFormatter/index.js} +2 -1
  29. package/{es/components/common → lib/ImageFormatter}/images-lazy-load.js +2 -2
  30. package/lib/ImageFormatter/index.css +34 -0
  31. package/{es/components/cell-formatter/image-formatter.js → lib/ImageFormatter/index.js} +4 -3
  32. package/{es/css/image-previewer-ligntbox.css → lib/ImagePreviewerLightbox/index.css} +0 -0
  33. package/{es/components/cell-formatter/widgets/image-previewer-lightbox.js → lib/ImagePreviewerLightbox/index.js} +3 -3
  34. package/lib/LastModifierFormatter/index.css +1 -0
  35. package/{es/components/cell-formatter/last-modifier-formatter.js → lib/LastModifierFormatter/index.js} +5 -4
  36. package/lib/LinkFormatter/index.css +27 -0
  37. package/{es/components/cell-formatter/link-formatter.js → lib/LinkFormatter/index.js} +2 -2
  38. package/{es/css/loading.css → lib/Loading/index.css} +0 -0
  39. package/{es/components/loading.js → lib/Loading/index.js} +1 -1
  40. package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/html-long-text-formatter.js +1 -1
  41. package/lib/LongTextFormatter/index.css +63 -0
  42. package/{es/components/cell-formatter/long-text-formatter.js → lib/LongTextFormatter/index.js} +3 -2
  43. package/{es/components/cell-formatter/widgets/long-text-formatter → lib/LongTextFormatter}/simple-long-text-formatter.js +1 -1
  44. package/lib/MTimeFormatter/index.css +1 -0
  45. package/{es/components/cell-formatter/mtime-formatter.js → lib/MTimeFormatter/index.js} +1 -0
  46. package/{es/components/common/modal-portal.js → lib/ModalPortal/index.js} +0 -0
  47. package/lib/MultipleSelectFormatter/index.css +1 -0
  48. package/{es/components/cell-formatter/multiple-select-formatter.js → lib/MultipleSelectFormatter/index.js} +2 -1
  49. package/lib/NumberFormatter/index.css +1 -0
  50. package/{es/components/cell-formatter/number-formatter.js → lib/NumberFormatter/index.js} +2 -1
  51. package/lib/RateFormatter/index.css +1 -0
  52. package/{es/components/cell-formatter/rate-formatter.js → lib/RateFormatter/index.js} +1 -0
  53. package/{es/components/common/select-item.js → lib/SelectItem/index.js} +0 -0
  54. package/lib/SingleSelectFormatter/index.css +1 -0
  55. package/{es/components/cell-formatter/single-select-formatter.js → lib/SingleSelectFormatter/index.js} +2 -1
  56. package/lib/TextFormatter/index.css +1 -0
  57. package/{es/components/cell-formatter/text-formatter.js → lib/TextFormatter/index.js} +1 -0
  58. package/lib/UrlFormatter/index.css +5 -0
  59. package/{es/components/cell-formatter/url-formatter.js → lib/UrlFormatter/index.js} +1 -0
  60. package/lib/app.js +75 -80
  61. package/{es/components/cell-factory/cell-formatter-factory.js → lib/cellFormatterFactory/index.js} +3 -3
  62. package/lib/components/cell-editor/checkbox-editor.js +59 -66
  63. package/lib/components/cell-editor/collaborator-editor.js +113 -126
  64. package/lib/components/cell-editor/date-editor.js +99 -119
  65. package/lib/components/cell-editor/index.js +9 -40
  66. package/lib/components/cell-editor/link-editor.js +122 -140
  67. package/lib/components/cell-editor/multiple-select-editor.js +114 -127
  68. package/lib/components/cell-editor/number-editor.js +78 -86
  69. package/lib/components/cell-editor/single-select-editor.js +106 -120
  70. package/lib/components/cell-editor/text-editor.js +65 -72
  71. package/lib/components/cell-editor-dialog/pc-file-editor-dialog.js +31 -51
  72. package/lib/components/cell-editor-dialog/pc-files-addition/index.js +0 -1
  73. package/lib/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -1
  74. package/lib/components/cell-editor-dialog/pc-files-preview/index.js +0 -1
  75. package/lib/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -1
  76. package/lib/components/cell-editor-popover/mb-collaborator-editor-popover.js +105 -111
  77. package/lib/components/cell-editor-popover/mb-date-editor-popover.js +140 -157
  78. package/lib/components/cell-editor-popover/mb-link-editor-popover.js +103 -109
  79. package/lib/components/cell-editor-popover/mb-select-editor-popover.js +142 -155
  80. package/lib/components/cell-editor-popover/pc-collaborator-editor-popover.js +74 -89
  81. package/lib/components/cell-editor-popover/pc-date-editor-popover.js +88 -102
  82. package/lib/components/cell-editor-popover/pc-link-editor-popover.js +77 -91
  83. package/lib/components/cell-editor-popover/pc-select-editor-popover.js +91 -105
  84. package/lib/components/common/collaborator-item.js +43 -59
  85. package/lib/components/common/edit-editor-button.js +28 -39
  86. package/lib/components/common/link-editor-option.js +63 -71
  87. package/lib/components/common/mobile/mb-editor-header.js +39 -52
  88. package/lib/components/common/select-editor-option.js +58 -74
  89. package/lib/constants/cell-types.js +25 -54
  90. package/lib/constants/index.js +5 -26
  91. package/lib/css/cell-formatter.css +0 -243
  92. package/lib/formatterConfig/index.js +31 -0
  93. package/lib/index.js +31 -64
  94. package/lib/lang/index.js +11 -27
  95. package/lib/locals/de.js +1 -6
  96. package/lib/locals/en.js +1 -6
  97. package/lib/locals/fr.js +1 -6
  98. package/lib/locals/zh-CN.js +1 -6
  99. package/{es/components/toast → lib/toaster}/alert.js +0 -0
  100. package/{es/components/toast → lib/toaster}/index.js +0 -0
  101. package/{es/components/toast → lib/toaster}/toast.js +0 -0
  102. package/{es/components/toast → lib/toaster}/toastManager.js +0 -0
  103. package/{es/components/toast → lib/toaster}/toaster.js +0 -0
  104. package/lib/utils/cell-value-validator.js +4 -14
  105. package/lib/utils/column-utils.js +5 -13
  106. package/lib/utils/editor-utils.js +3 -13
  107. package/lib/utils/markdown2html.js +1 -7
  108. package/lib/utils/normalize-long-text-value.js +1 -6
  109. package/lib/utils/number-precision.js +14 -31
  110. package/lib/utils/utils.js +8 -33
  111. package/lib/utils/value-format-utils.js +60 -108
  112. package/package.json +5 -5
  113. package/es/app.css +0 -20
  114. package/es/app.js +0 -91
  115. package/es/assets/images/avatar/default_avatar.png +0 -0
  116. package/es/assets/images/file/192/excel.png +0 -0
  117. package/es/assets/images/file/192/file.png +0 -0
  118. package/es/assets/images/file/192/music.png +0 -0
  119. package/es/assets/images/file/192/pdf.png +0 -0
  120. package/es/assets/images/file/192/pic.png +0 -0
  121. package/es/assets/images/file/192/ppt.png +0 -0
  122. package/es/assets/images/file/192/txt.png +0 -0
  123. package/es/assets/images/file/192/video.png +0 -0
  124. package/es/assets/images/file/192/word.png +0 -0
  125. package/es/assets/images/file/24/excel.png +0 -0
  126. package/es/assets/images/file/24/file.png +0 -0
  127. package/es/assets/images/file/24/music.png +0 -0
  128. package/es/assets/images/file/24/pdf.png +0 -0
  129. package/es/assets/images/file/24/pic.png +0 -0
  130. package/es/assets/images/file/24/ppt.png +0 -0
  131. package/es/assets/images/file/24/txt.png +0 -0
  132. package/es/assets/images/file/24/video.png +0 -0
  133. package/es/assets/images/file/24/word.png +0 -0
  134. package/es/assets/images/folder/folder-192.png +0 -0
  135. package/es/assets/images/folder/folder-24.png +0 -0
  136. package/es/components/cell-editor/checkbox-editor.js +0 -104
  137. package/es/components/cell-editor/collaborator-editor.js +0 -236
  138. package/es/components/cell-editor/date-editor.js +0 -151
  139. package/es/components/cell-editor/index.js +0 -9
  140. package/es/components/cell-editor/link-editor.js +0 -303
  141. package/es/components/cell-editor/multiple-select-editor.js +0 -237
  142. package/es/components/cell-editor/number-editor.js +0 -154
  143. package/es/components/cell-editor/single-select-editor.js +0 -202
  144. package/es/components/cell-editor/text-editor.js +0 -122
  145. package/es/components/cell-editor-dialog/pc-file-editor-dialog.js +0 -46
  146. package/es/components/cell-editor-dialog/pc-files-addition/index.js +0 -0
  147. package/es/components/cell-editor-dialog/pc-files-addition/pc-file-uploaded-item.js +0 -0
  148. package/es/components/cell-editor-dialog/pc-files-preview/index.js +0 -0
  149. package/es/components/cell-editor-dialog/pc-files-preview/pc-file-item-preview.js +0 -0
  150. package/es/components/cell-editor-popover/mb-collaborator-editor-popover.js +0 -177
  151. package/es/components/cell-editor-popover/mb-date-editor-popover.js +0 -245
  152. package/es/components/cell-editor-popover/mb-link-editor-popover.js +0 -170
  153. package/es/components/cell-editor-popover/mb-select-editor-popover.js +0 -230
  154. package/es/components/cell-editor-popover/pc-collaborator-editor-popover.js +0 -109
  155. package/es/components/cell-editor-popover/pc-date-editor-popover.js +0 -142
  156. package/es/components/cell-editor-popover/pc-link-editor-popover.js +0 -114
  157. package/es/components/cell-editor-popover/pc-select-editor-popover.js +0 -143
  158. package/es/components/cell-formatter/formatter-config.js +0 -31
  159. package/es/components/cell-formatter/index.js +0 -27
  160. package/es/components/common/edit-editor-button.js +0 -56
  161. package/es/components/common/link-editor-option.js +0 -113
  162. package/es/components/common/mobile/mb-editor-header.js +0 -48
  163. package/es/components/common/select-editor-option.js +0 -106
  164. package/es/constants/cell-types.js +0 -25
  165. package/es/constants/index.js +0 -48
  166. package/es/css/cell-editor.css +0 -614
  167. package/es/css/cell-formatter.css +0 -247
  168. package/es/css/custom-rc-calendar.css +0 -118
  169. package/es/index.js +0 -6
  170. package/es/lang/index.js +0 -50
  171. package/es/locals/de.js +0 -2
  172. package/es/locals/en.js +0 -17
  173. package/es/locals/fr.js +0 -2
  174. package/es/locals/zh-CN.js +0 -17
  175. package/es/utils/cell-value-validator.js +0 -32
  176. package/es/utils/column-utils.js +0 -7
  177. package/es/utils/editor-utils.js +0 -71
  178. package/es/utils/markdown2html.js +0 -62
  179. package/es/utils/normalize-long-text-value.js +0 -69
  180. package/es/utils/number-precision.js +0 -163
  181. package/es/utils/unified/index.js +0 -470
  182. package/es/utils/utils.js +0 -116
  183. package/es/utils/value-format-utils.js +0 -495
  184. package/es/utils/vfile/core.js +0 -172
  185. package/es/utils/vfile/index.js +0 -48
  186. package/lib/components/cell-factory/cell-formatter-factory.js +0 -28
  187. package/lib/components/cell-formatter/auto-number-formatter.js +0 -45
  188. package/lib/components/cell-formatter/button-formatter.js +0 -66
  189. package/lib/components/cell-formatter/checkbox-formatter.js +0 -56
  190. package/lib/components/cell-formatter/collaborator-formatter.js +0 -111
  191. package/lib/components/cell-formatter/creator-formatter.js +0 -105
  192. package/lib/components/cell-formatter/ctime-formatter.js +0 -70
  193. package/lib/components/cell-formatter/date-formatter.js +0 -73
  194. package/lib/components/cell-formatter/duration-formatter.js +0 -49
  195. package/lib/components/cell-formatter/email-formatter.js +0 -45
  196. package/lib/components/cell-formatter/file-formatter.js +0 -77
  197. package/lib/components/cell-formatter/formatter-config.js +0 -66
  198. package/lib/components/cell-formatter/formula-formatter.js +0 -189
  199. package/lib/components/cell-formatter/geolocation-formatter.js +0 -66
  200. package/lib/components/cell-formatter/image-formatter.js +0 -171
  201. package/lib/components/cell-formatter/index.js +0 -112
  202. package/lib/components/cell-formatter/last-modifier-formatter.js +0 -105
  203. package/lib/components/cell-formatter/link-formatter.js +0 -165
  204. package/lib/components/cell-formatter/long-text-formatter.js +0 -46
  205. package/lib/components/cell-formatter/mtime-formatter.js +0 -70
  206. package/lib/components/cell-formatter/multiple-select-formatter.js +0 -84
  207. package/lib/components/cell-formatter/number-formatter.js +0 -60
  208. package/lib/components/cell-formatter/rate-formatter.js +0 -93
  209. package/lib/components/cell-formatter/single-select-formatter.js +0 -84
  210. package/lib/components/cell-formatter/text-formatter.js +0 -67
  211. package/lib/components/cell-formatter/url-formatter.js +0 -45
  212. package/lib/components/cell-formatter/widgets/file-item-formatter.js +0 -63
  213. package/lib/components/cell-formatter/widgets/image-previewer-lightbox.js +0 -152
  214. package/lib/components/cell-formatter/widgets/long-text-formatter/html-long-text-formatter.js +0 -107
  215. package/lib/components/cell-formatter/widgets/long-text-formatter/simple-long-text-formatter.js +0 -110
  216. package/lib/components/common/images-lazy-load.js +0 -158
  217. package/lib/components/common/modal-portal.js +0 -51
  218. package/lib/components/common/select-item.js +0 -73
  219. package/lib/components/file-uploader/index.js +0 -63
  220. package/lib/components/loading.js +0 -16
  221. package/lib/components/toast/alert.js +0 -164
  222. package/lib/components/toast/index.js +0 -12
  223. package/lib/components/toast/toast.js +0 -223
  224. package/lib/components/toast/toastManager.js +0 -189
  225. package/lib/components/toast/toaster.js +0 -92
  226. package/lib/css/image-previewer-ligntbox.css +0 -87
  227. package/lib/css/loading.css +0 -54
@@ -1,57 +1,42 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports.default = void 0;
7
-
8
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
9
-
10
- var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
11
-
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- var _lang = require("../../lang");
19
-
20
- var _collaboratorItem = _interopRequireDefault(require("../common/collaborator-item"));
21
-
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
23
-
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
-
26
- var propTypes = {
27
- popoverPosition: _propTypes.default.object.isRequired,
28
- selectedCollaborators: _propTypes.default.array.isRequired,
29
- collaborators: _propTypes.default.array.isRequired,
30
- onCollaboratorItemToggle: _propTypes.default.func.isRequired
31
- };
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import React from 'react';
7
+ import { getLocale } from '../../lang';
8
+ import CollaboratorItem from '../common/collaborator-item';
32
9
 
33
10
  var PCCollaboratorEditorPopover = /*#__PURE__*/function (_React$Component) {
34
- (0, _inheritsLoose2.default)(PCCollaboratorEditorPopover, _React$Component);
11
+ _inherits(PCCollaboratorEditorPopover, _React$Component);
12
+
13
+ var _super = _createSuper(PCCollaboratorEditorPopover);
35
14
 
36
15
  function PCCollaboratorEditorPopover(props) {
37
16
  var _this;
38
17
 
39
- _this = _React$Component.call(this, props) || this;
40
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onValueChanged", function (event) {
18
+ _classCallCheck(this, PCCollaboratorEditorPopover);
19
+
20
+ _this = _super.call(this, props);
21
+
22
+ _this.onValueChanged = function (event) {
41
23
  var value = event.target.value;
42
24
 
43
25
  _this.setState({
44
26
  searchValue: value
45
27
  });
46
- });
47
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onInputClick", function (event) {
28
+ };
29
+
30
+ _this.onInputClick = function (event) {
48
31
  event.nativeEvent.stopImmediatePropagation();
49
32
  event.stopPropagation();
50
- });
51
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onCollaboratorItemToggle", function (item) {
33
+ };
34
+
35
+ _this.onCollaboratorItemToggle = function (item) {
52
36
  _this.props.onCollaboratorItemToggle(item);
53
- });
54
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFilterCollaborator", function () {
37
+ };
38
+
39
+ _this.getFilterCollaborator = function () {
55
40
  var collaborators = _this.props.collaborators;
56
41
 
57
42
  var filter = _this.state.searchValue.toLowerCase();
@@ -63,62 +48,62 @@ var PCCollaboratorEditorPopover = /*#__PURE__*/function (_React$Component) {
63
48
  return collaborators.filter(function (collaborator) {
64
49
  return collaborator.name.toString().toLowerCase().indexOf(filter) > -1;
65
50
  });
66
- });
51
+ };
52
+
67
53
  _this.state = {
68
54
  searchValue: ''
69
55
  };
70
56
  return _this;
71
57
  }
72
58
 
73
- var _proto = PCCollaboratorEditorPopover.prototype;
74
-
75
- _proto.render = function render() {
76
- var _this2 = this;
77
-
78
- var searchValue = this.state.searchValue;
79
- var _this$props = this.props,
80
- selectedCollaborators = _this$props.selectedCollaborators,
81
- popoverPosition = _this$props.popoverPosition;
82
- var collaborators = this.getFilterCollaborator();
83
- var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
84
- position: 'absolute'
85
- });
86
- return /*#__PURE__*/_react.default.createElement("div", {
87
- className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
88
- style: popoverStyle
89
- }, /*#__PURE__*/_react.default.createElement("div", {
90
- className: "collaborator-search-container"
91
- }, /*#__PURE__*/_react.default.createElement("input", {
92
- className: "form-control",
93
- value: searchValue,
94
- onChange: this.onValueChanged,
95
- onClick: this.onInputClick,
96
- placeholder: (0, _lang.getLocale)('Find_a_collaborator')
97
- })), /*#__PURE__*/_react.default.createElement("div", {
98
- className: "collaborator-list-container"
99
- }, collaborators.length > 0 && collaborators.map(function (collaborator, index) {
100
- var isSelect = selectedCollaborators.some(function (selectedCollaborator) {
101
- return selectedCollaborator.email === collaborator.email;
59
+ _createClass(PCCollaboratorEditorPopover, [{
60
+ key: "render",
61
+ value: function render() {
62
+ var _this2 = this;
63
+
64
+ var searchValue = this.state.searchValue;
65
+ var _this$props = this.props,
66
+ selectedCollaborators = _this$props.selectedCollaborators,
67
+ popoverPosition = _this$props.popoverPosition;
68
+ var collaborators = this.getFilterCollaborator();
69
+ var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
70
+ position: 'absolute'
102
71
  });
103
- return /*#__PURE__*/_react.default.createElement("div", {
104
- key: index,
105
- className: "collaborator-item-container",
106
- onClick: _this2.onCollaboratorItemToggle.bind(_this2, collaborator)
107
- }, /*#__PURE__*/_react.default.createElement(_collaboratorItem.default, {
108
- collaborator: collaborator
109
- }), /*#__PURE__*/_react.default.createElement("div", {
110
- className: "collaborator-checked"
111
- }, isSelect && /*#__PURE__*/_react.default.createElement("i", {
112
- className: "dtable-font dtable-icon-check-mark"
113
- })));
114
- }), collaborators.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
115
- className: "search-option-null"
116
- }, (0, _lang.getLocale)('No_collaborators_available'))));
117
- };
72
+ return /*#__PURE__*/React.createElement("div", {
73
+ className: "dtable-ui-editor-popover dtable-ui-collaborator-editor-popover",
74
+ style: popoverStyle
75
+ }, /*#__PURE__*/React.createElement("div", {
76
+ className: "collaborator-search-container"
77
+ }, /*#__PURE__*/React.createElement("input", {
78
+ className: "form-control",
79
+ value: searchValue,
80
+ onChange: this.onValueChanged,
81
+ onClick: this.onInputClick,
82
+ placeholder: getLocale('Find_a_collaborator')
83
+ })), /*#__PURE__*/React.createElement("div", {
84
+ className: "collaborator-list-container"
85
+ }, collaborators.length > 0 && collaborators.map(function (collaborator, index) {
86
+ var isSelect = selectedCollaborators.some(function (selectedCollaborator) {
87
+ return selectedCollaborator.email === collaborator.email;
88
+ });
89
+ return /*#__PURE__*/React.createElement("div", {
90
+ key: index,
91
+ className: "collaborator-item-container",
92
+ onClick: _this2.onCollaboratorItemToggle.bind(_this2, collaborator)
93
+ }, /*#__PURE__*/React.createElement(CollaboratorItem, {
94
+ collaborator: collaborator
95
+ }), /*#__PURE__*/React.createElement("div", {
96
+ className: "collaborator-checked"
97
+ }, isSelect && /*#__PURE__*/React.createElement("i", {
98
+ className: "dtable-font dtable-icon-check-mark"
99
+ })));
100
+ }), collaborators.length === 0 && /*#__PURE__*/React.createElement("div", {
101
+ className: "search-option-null"
102
+ }, getLocale('No_collaborators_available'))));
103
+ }
104
+ }]);
118
105
 
119
106
  return PCCollaboratorEditorPopover;
120
- }(_react.default.Component);
107
+ }(React.Component);
121
108
 
122
- PCCollaboratorEditorPopover.propTypes = propTypes;
123
- var _default = PCCollaboratorEditorPopover;
124
- exports.default = _default;
109
+ export default PCCollaboratorEditorPopover;
@@ -1,48 +1,28 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports.default = void 0;
7
-
8
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
9
-
10
- var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
11
-
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- var _moment = _interopRequireDefault(require("moment"));
19
-
20
- var _Picker = _interopRequireDefault(require("@seafile/seafile-calendar/lib/Picker"));
21
-
22
- var _seafileCalendar = _interopRequireDefault(require("@seafile/seafile-calendar"));
23
-
24
- var _editorUtils = require("../../utils/editor-utils");
25
-
26
- require("@seafile/seafile-calendar/assets/index.css");
27
-
28
- var _lang = require("../../lang");
29
-
30
- var propTypes = {
31
- lang: _propTypes.default.string.isRequired,
32
- value: _propTypes.default.string,
33
- dateFormat: _propTypes.default.string.isRequired,
34
- showHourAndMinute: _propTypes.default.bool.isRequired,
35
- onValueChanged: _propTypes.default.func.isRequired
36
- };
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
+ import React from 'react';
6
+ import moment from 'moment';
7
+ import DatePicker from '@seafile/seafile-calendar/lib/Picker';
8
+ import Calendar from '@seafile/seafile-calendar';
9
+ import { initDateEditorLanguage } from '../../utils/editor-utils';
10
+ import '@seafile/seafile-calendar/assets/index.css';
11
+ import { getLocale } from '../../lang';
37
12
 
38
13
  var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
39
- (0, _inheritsLoose2.default)(PCDateEditorPopover, _React$Component);
14
+ _inherits(PCDateEditorPopover, _React$Component);
15
+
16
+ var _super = _createSuper(PCDateEditorPopover);
40
17
 
41
18
  function PCDateEditorPopover(props) {
42
19
  var _this;
43
20
 
44
- _this = _React$Component.call(this, props) || this;
45
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onChange", function (value) {
21
+ _classCallCheck(this, PCDateEditorPopover);
22
+
23
+ _this = _super.call(this, props);
24
+
25
+ _this.onChange = function (value) {
46
26
  if (!value) return;
47
27
  var dateFormat = _this.props.dateFormat;
48
28
 
@@ -53,104 +33,110 @@ var PCDateEditorPopover = /*#__PURE__*/function (_React$Component) {
53
33
  });
54
34
 
55
35
  _this.props.onValueChanged(value.format(dateFormat));
56
- });
57
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function (open) {
36
+ };
37
+
38
+ _this.onOpenChange = function (open) {
58
39
  _this.setState({
59
40
  open: open
60
41
  });
61
42
 
62
43
  return;
63
- });
64
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClear", function () {
44
+ };
45
+
46
+ _this.onClear = function () {
65
47
  _this.setState({
66
48
  datePickerValue: null
67
49
  });
68
- });
69
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFocusDatePicker", function () {
50
+ };
51
+
52
+ _this.onFocusDatePicker = function () {
70
53
  _this.setState({
71
54
  open: true
72
55
  });
73
- });
74
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleMouseDown", function (event) {
56
+ };
57
+
58
+ _this.handleMouseDown = function (event) {
75
59
  event.preventDefault();
76
60
  event.stopPropagation();
77
- });
78
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCalendarContainer", function () {
61
+ };
62
+
63
+ _this.getCalendarContainer = function () {
79
64
  return _this.calendarContainerRef.current;
80
- });
81
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCalender", function () {
65
+ };
66
+
67
+ _this.getCalender = function () {
82
68
  var _this$props = _this.props,
83
69
  dateFormat = _this$props.dateFormat,
84
70
  showHourAndMinute = _this$props.showHourAndMinute,
85
71
  lang = _this$props.lang;
86
- var defaultValue = (0, _moment.default)().clone();
87
- return /*#__PURE__*/_react.default.createElement(_seafileCalendar.default, {
88
- locale: (0, _editorUtils.initDateEditorLanguage)(lang),
72
+ var defaultValue = moment().clone();
73
+ return /*#__PURE__*/React.createElement(Calendar, {
74
+ locale: initDateEditorLanguage(lang),
89
75
  style: {
90
76
  zIndex: 1001
91
77
  },
92
78
  format: dateFormat,
93
79
  defaultValue: defaultValue,
94
80
  showHourAndMinute: showHourAndMinute,
95
- dateInputPlaceholder: (0, _lang.getLocale)('Please_input'),
81
+ dateInputPlaceholder: getLocale('Please_input'),
96
82
  showDateInput: true,
97
83
  focusablePanel: false,
98
84
  onClear: _this.onClear
99
85
  });
100
- });
86
+ };
87
+
101
88
  _this.state = {
102
89
  open: true,
103
- datePickerValue: props.value ? (0, _moment.default)(props.value) : null
90
+ datePickerValue: props.value ? moment(props.value) : null
104
91
  };
105
- _this.calendarContainerRef = /*#__PURE__*/_react.default.createRef();
92
+ _this.calendarContainerRef = React.createRef();
106
93
  return _this;
107
94
  } // event trigger sequence: onOpenChange --> onChange
108
95
 
109
96
 
110
- var _proto = PCDateEditorPopover.prototype;
111
-
112
- _proto.render = function render() {
113
- var _this2 = this;
114
-
115
- var dateFormat = this.props.dateFormat;
116
- var _this$state = this.state,
117
- open = _this$state.open,
118
- datePickerValue = _this$state.datePickerValue;
119
- var calendar = this.getCalender();
120
- return /*#__PURE__*/_react.default.createElement(_Picker.default, {
121
- open: open,
122
- value: datePickerValue,
123
- animation: "slide-up",
124
- style: {
125
- zIndex: 1001
126
- },
127
- calendar: calendar,
128
- getCalendarContainer: this.getCalendarContainer,
129
- onChange: this.onChange,
130
- onOpenChange: this.onOpenChange
131
- }, function (_ref) {
132
- var value = _ref.value;
133
- value = value && value.format(dateFormat);
134
- return /*#__PURE__*/_react.default.createElement("span", {
135
- className: "dtable-ui-date-editor-container",
136
- tabIndex: "0",
137
- onFocus: _this2.onFocusDatePicker
138
- }, /*#__PURE__*/_react.default.createElement("input", {
139
- readOnly: true,
140
- tabIndex: "-1",
141
- className: "form-control",
142
- placeholder: (0, _lang.getLocale)('Please_select'),
143
- value: value || '',
144
- onMouseDown: _this2.handleMouseDown
145
- }), /*#__PURE__*/_react.default.createElement("div", {
146
- ref: _this2.calendarContainerRef
147
- }));
148
- });
149
- };
97
+ _createClass(PCDateEditorPopover, [{
98
+ key: "render",
99
+ value: function render() {
100
+ var _this2 = this;
101
+
102
+ var dateFormat = this.props.dateFormat;
103
+ var _this$state = this.state,
104
+ open = _this$state.open,
105
+ datePickerValue = _this$state.datePickerValue;
106
+ var calendar = this.getCalender();
107
+ return /*#__PURE__*/React.createElement(DatePicker, {
108
+ open: open,
109
+ value: datePickerValue,
110
+ animation: "slide-up",
111
+ style: {
112
+ zIndex: 1001
113
+ },
114
+ calendar: calendar,
115
+ getCalendarContainer: this.getCalendarContainer,
116
+ onChange: this.onChange,
117
+ onOpenChange: this.onOpenChange
118
+ }, function (_ref) {
119
+ var value = _ref.value;
120
+ value = value && value.format(dateFormat);
121
+ return /*#__PURE__*/React.createElement("span", {
122
+ className: "dtable-ui-date-editor-container",
123
+ tabIndex: "0",
124
+ onFocus: _this2.onFocusDatePicker
125
+ }, /*#__PURE__*/React.createElement("input", {
126
+ readOnly: true,
127
+ tabIndex: "-1",
128
+ className: "form-control",
129
+ placeholder: getLocale('Please_select'),
130
+ value: value || '',
131
+ onMouseDown: _this2.handleMouseDown
132
+ }), /*#__PURE__*/React.createElement("div", {
133
+ ref: _this2.calendarContainerRef
134
+ }));
135
+ });
136
+ }
137
+ }]);
150
138
 
151
139
  return PCDateEditorPopover;
152
- }(_react.default.Component);
140
+ }(React.Component);
153
141
 
154
- PCDateEditorPopover.propTypes = propTypes;
155
- var _default = PCDateEditorPopover;
156
- exports.default = _default;
142
+ export default PCDateEditorPopover;
@@ -1,55 +1,41 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports.default = void 0;
7
-
8
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
9
-
10
- var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
11
-
12
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- var _lang = require("../../lang");
19
-
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
-
24
- var propTypes = {
25
- popoverPosition: _propTypes.default.object.isRequired,
26
- options: _propTypes.default.array.isRequired,
27
- selectedOptions: _propTypes.default.array.isRequired,
28
- onOptionItemToggle: _propTypes.default.func.isRequired
29
- };
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
+ import React from 'react';
7
+ import { getLocale } from '../../lang';
30
8
 
31
9
  var PCLinkEditorPopover = /*#__PURE__*/function (_React$Component) {
32
- (0, _inheritsLoose2.default)(PCLinkEditorPopover, _React$Component);
10
+ _inherits(PCLinkEditorPopover, _React$Component);
11
+
12
+ var _super = _createSuper(PCLinkEditorPopover);
33
13
 
34
14
  function PCLinkEditorPopover(props) {
35
15
  var _this;
36
16
 
37
- _this = _React$Component.call(this, props) || this;
38
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onValueChanged", function (event) {
17
+ _classCallCheck(this, PCLinkEditorPopover);
18
+
19
+ _this = _super.call(this, props);
20
+
21
+ _this.onValueChanged = function (event) {
39
22
  var value = event.target.value;
40
23
 
41
24
  _this.setState({
42
25
  searchValue: value
43
26
  });
44
- });
45
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onInputClick", function (event) {
27
+ };
28
+
29
+ _this.onInputClick = function (event) {
46
30
  event.nativeEvent.stopImmediatePropagation();
47
31
  event.stopPropagation();
48
- });
49
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOptionItemToggle", function (item) {
32
+ };
33
+
34
+ _this.onOptionItemToggle = function (item) {
50
35
  _this.props.onOptionItemToggle(item);
51
- });
52
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getFilterOptions", function () {
36
+ };
37
+
38
+ _this.getFilterOptions = function () {
53
39
  var options = _this.props.options;
54
40
 
55
41
  var filter = _this.state.searchValue.toLowerCase();
@@ -61,68 +47,68 @@ var PCLinkEditorPopover = /*#__PURE__*/function (_React$Component) {
61
47
  return options.filter(function (option) {
62
48
  return option.name.toString().toLowerCase().indexOf(filter) > -1;
63
49
  });
64
- });
50
+ };
51
+
65
52
  _this.state = {
66
53
  searchValue: ''
67
54
  };
68
55
  return _this;
69
56
  }
70
57
 
71
- var _proto = PCLinkEditorPopover.prototype;
72
-
73
- _proto.render = function render() {
74
- var _this2 = this;
75
-
76
- var options = this.getFilterOptions();
77
- var _this$props = this.props,
78
- popoverPosition = _this$props.popoverPosition,
79
- selectedOptions = _this$props.selectedOptions;
80
- var searchValue = this.state.searchValue;
81
- var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
82
- position: 'absolute'
83
- });
84
- return /*#__PURE__*/_react.default.createElement("div", {
85
- className: "dtable-ui-editor-popover dtable-ui-link-editor-popover",
86
- style: popoverStyle
87
- }, /*#__PURE__*/_react.default.createElement("div", {
88
- className: "link-options-search"
89
- }, /*#__PURE__*/_react.default.createElement("input", {
90
- className: "form-control",
91
- value: searchValue,
92
- onChange: this.onValueChanged,
93
- onClick: this.onInputClick,
94
- placeholder: (0, _lang.getLocale)('Find_an_option')
95
- })), /*#__PURE__*/_react.default.createElement("div", {
96
- className: "link-options-container"
97
- }, options.length > 0 && options.map(function (option, index) {
98
- var isSelect = selectedOptions.some(function (selectedOption) {
99
- return selectedOption.id === option.id;
58
+ _createClass(PCLinkEditorPopover, [{
59
+ key: "render",
60
+ value: function render() {
61
+ var _this2 = this;
62
+
63
+ var options = this.getFilterOptions();
64
+ var _this$props = this.props,
65
+ popoverPosition = _this$props.popoverPosition,
66
+ selectedOptions = _this$props.selectedOptions;
67
+ var searchValue = this.state.searchValue;
68
+ var popoverStyle = Object.assign({}, _objectSpread({}, popoverPosition), {
69
+ position: 'absolute'
100
70
  });
101
- return /*#__PURE__*/_react.default.createElement("div", {
102
- key: index,
103
- className: "link-option-item",
104
- onClick: _this2.onOptionItemToggle.bind(_this2, option)
105
- }, /*#__PURE__*/_react.default.createElement("div", {
106
- className: "option-info"
107
- }, /*#__PURE__*/_react.default.createElement("div", {
108
- className: "option-name"
109
- }, option.name)), /*#__PURE__*/_react.default.createElement("div", {
110
- className: "option-checked"
111
- }, isSelect && /*#__PURE__*/_react.default.createElement("i", {
112
- className: "dtable-font dtable-icon-check-mark"
113
- })));
114
- }), options.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
115
- className: "link-option-null"
116
- }, (0, _lang.getLocale)('No_options_available'))));
117
- };
71
+ return /*#__PURE__*/React.createElement("div", {
72
+ className: "dtable-ui-editor-popover dtable-ui-link-editor-popover",
73
+ style: popoverStyle
74
+ }, /*#__PURE__*/React.createElement("div", {
75
+ className: "link-options-search"
76
+ }, /*#__PURE__*/React.createElement("input", {
77
+ className: "form-control",
78
+ value: searchValue,
79
+ onChange: this.onValueChanged,
80
+ onClick: this.onInputClick,
81
+ placeholder: getLocale('Find_an_option')
82
+ })), /*#__PURE__*/React.createElement("div", {
83
+ className: "link-options-container"
84
+ }, options.length > 0 && options.map(function (option, index) {
85
+ var isSelect = selectedOptions.some(function (selectedOption) {
86
+ return selectedOption.id === option.id;
87
+ });
88
+ return /*#__PURE__*/React.createElement("div", {
89
+ key: index,
90
+ className: "link-option-item",
91
+ onClick: _this2.onOptionItemToggle.bind(_this2, option)
92
+ }, /*#__PURE__*/React.createElement("div", {
93
+ className: "option-info"
94
+ }, /*#__PURE__*/React.createElement("div", {
95
+ className: "option-name"
96
+ }, option.name)), /*#__PURE__*/React.createElement("div", {
97
+ className: "option-checked"
98
+ }, isSelect && /*#__PURE__*/React.createElement("i", {
99
+ className: "dtable-font dtable-icon-check-mark"
100
+ })));
101
+ }), options.length === 0 && /*#__PURE__*/React.createElement("div", {
102
+ className: "link-option-null"
103
+ }, getLocale('No_options_available'))));
104
+ }
105
+ }]);
118
106
 
119
107
  return PCLinkEditorPopover;
120
- }(_react.default.Component);
108
+ }(React.Component);
121
109
 
122
- (0, _defineProperty2.default)(PCLinkEditorPopover, "defaultProps", {
110
+ PCLinkEditorPopover.defaultProps = {
123
111
  popoverPosition: {},
124
112
  options: []
125
- });
126
- PCLinkEditorPopover.propTypes = propTypes;
127
- var _default = PCLinkEditorPopover;
128
- exports.default = _default;
113
+ };
114
+ export default PCLinkEditorPopover;