dtable-ui-component 4.3.7 → 4.3.9-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 (123) hide show
  1. package/lib/AutoNumberFormatter/index.js +11 -24
  2. package/lib/ButtonFormatter/index.js +29 -45
  3. package/lib/CTimeFormatter/index.js +17 -32
  4. package/lib/CheckboxEditor/index.js +42 -49
  5. package/lib/CheckboxFormatter/index.js +17 -30
  6. package/lib/CollaboratorEditor/index.js +118 -135
  7. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +90 -99
  8. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +61 -69
  9. package/lib/CollaboratorFormatter/index.js +26 -42
  10. package/lib/CollaboratorItem/index.js +31 -44
  11. package/lib/CreatorFormatter/index.js +24 -40
  12. package/lib/DTableCustomizeCollaboratorSelect/index.css +1 -1
  13. package/lib/DTableCustomizeCollaboratorSelect/index.js +80 -99
  14. package/lib/DTableCustomizeCollaboratorSelect/utils.js +12 -13
  15. package/lib/DTableCustomizeSelect/index.js +92 -103
  16. package/lib/DTablePopover/index.js +52 -71
  17. package/lib/DTablePopover/utils.js +1 -1
  18. package/lib/DTableRadio/index.js +9 -7
  19. package/lib/DTableSearchInput/index.js +89 -99
  20. package/lib/DTableSearchInput/utils.js +2 -2
  21. package/lib/DTableSelect/dtable-select-label.js +5 -3
  22. package/lib/DTableSelect/index.js +50 -64
  23. package/lib/DTableSelect/utils.js +36 -41
  24. package/lib/DTableSwitch/index.js +7 -5
  25. package/lib/DateEditor/index.js +88 -94
  26. package/lib/DateEditor/mb-date-editor-popover/index.js +136 -134
  27. package/lib/DateEditor/pc-date-editor-popover.js +70 -77
  28. package/lib/DateFormatter/index.js +15 -28
  29. package/lib/DepartmentSingleSelectFormatter/index.js +9 -9
  30. package/lib/DigitalSignFormatter/index.js +55 -65
  31. package/lib/DigitalSignFormatter/utils.js +9 -8
  32. package/lib/DurationFormatter/index.js +14 -27
  33. package/lib/EditEditorButton/index.js +10 -22
  34. package/lib/EmailFormatter/index.js +11 -24
  35. package/lib/FieldDisplaySetting/field-item.js +18 -20
  36. package/lib/FieldDisplaySetting/index.js +41 -43
  37. package/lib/FileEditor/index.js +18 -29
  38. package/lib/FileFormatter/index.js +29 -43
  39. package/lib/FileItemFormatter/index.js +17 -32
  40. package/lib/FileItemFormatter/utils.js +5 -5
  41. package/lib/FileUploader/index.js +20 -33
  42. package/lib/FormulaFormatter/cell-value-validator.js +23 -8
  43. package/lib/FormulaFormatter/index.js +77 -83
  44. package/lib/FormulaFormatter/utils.js +27 -21
  45. package/lib/GeolocationFormatter/index.js +19 -32
  46. package/lib/HtmlLongTextFormatter/index.js +43 -52
  47. package/lib/HtmlLongTextFormatter/markdown2html.js +2 -2
  48. package/lib/HtmlLongTextFormatter/unified/index.js +1 -1
  49. package/lib/HtmlLongTextFormatter/vfile/core.js +10 -10
  50. package/lib/ImageFormatter/images-lazy-load.js +71 -79
  51. package/lib/ImageFormatter/index.js +86 -97
  52. package/lib/ImageFormatter/utils.js +1 -1
  53. package/lib/ImagePreviewerLightbox/index.js +20 -18
  54. package/lib/ImagePreviewerLightbox/utils.js +3 -3
  55. package/lib/LastModifierFormatter/index.js +24 -40
  56. package/lib/LinkEditor/index.js +163 -167
  57. package/lib/LinkEditor/link-editor-option.js +41 -56
  58. package/lib/LinkEditor/mb-link-editor-popover/index.js +90 -99
  59. package/lib/LinkEditor/pc-link-editor-popover/index.js +63 -71
  60. package/lib/LinkFormatter/index.js +75 -77
  61. package/lib/LongTextFormatter/index.js +5 -3
  62. package/lib/MBEditorHeader/index.js +25 -38
  63. package/lib/MTimeFormatter/index.js +17 -32
  64. package/lib/ModalPortal/index.js +15 -32
  65. package/lib/MultipleSelectEditor/index.js +118 -136
  66. package/lib/MultipleSelectFormatter/index.js +24 -40
  67. package/lib/NotificationPopover/index.js +68 -95
  68. package/lib/NumberEditor/index.js +75 -82
  69. package/lib/NumberFormatter/index.js +15 -28
  70. package/lib/RateFormatter/index.js +29 -45
  71. package/lib/RoleStatusEditor/index.js +20 -22
  72. package/lib/RowExpandEmailFormatter/index.js +24 -37
  73. package/lib/RowExpandFileFormatter/index.js +28 -42
  74. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +66 -82
  75. package/lib/RowExpandFormatter/index.js +92 -96
  76. package/lib/RowExpandFormulaFormatter/index.js +85 -91
  77. package/lib/RowExpandImageFormatter/index.js +65 -82
  78. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +71 -84
  79. package/lib/RowExpandImageFormatter/utils.js +1 -1
  80. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +54 -68
  81. package/lib/RowExpandLinkFormatter/index.js +131 -137
  82. package/lib/RowExpandLinkFormatter/utils.js +23 -17
  83. package/lib/RowExpandLinkFormatter/value-display-utils.js +9 -7
  84. package/lib/RowExpandRateFormatter/index.js +27 -42
  85. package/lib/RowExpandUrlFormatter/index.js +27 -40
  86. package/lib/SelectItem/index.js +17 -33
  87. package/lib/SelectOptionGroup/index.css +1 -1
  88. package/lib/SelectOptionGroup/index.js +141 -159
  89. package/lib/SelectOptionGroup/option.js +24 -40
  90. package/lib/SimpleLongTextFormatter/index.js +55 -67
  91. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +23 -22
  92. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +42 -57
  93. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +31 -46
  94. package/lib/SingleSelectEditor/index.js +108 -119
  95. package/lib/SingleSelectFormatter/index.js +21 -37
  96. package/lib/TextEditor/index.js +45 -51
  97. package/lib/TextFormatter/index.js +17 -32
  98. package/lib/UrlFormatter/index.js +11 -24
  99. package/lib/cellFormatterFactory/index.js +8 -17
  100. package/lib/common/ClickOutside.js +22 -43
  101. package/lib/common/delete-tip.js +40 -65
  102. package/lib/common/modal-portal.js +15 -33
  103. package/lib/constants/index.js +5 -5
  104. package/lib/data/dtable-value.js +4 -4
  105. package/lib/formatterConfig/base-formatter-config.js +24 -3
  106. package/lib/formatterConfig/index.js +5 -4
  107. package/lib/lang/index.js +6 -6
  108. package/lib/locals/de.js +1 -1
  109. package/lib/locals/en.js +1 -1
  110. package/lib/locals/fr.js +1 -1
  111. package/lib/locals/zh-CN.js +1 -1
  112. package/lib/select-editor/mb-select-editor-popover/index.js +126 -137
  113. package/lib/select-editor/pc-select-editor-popover/index.js +75 -83
  114. package/lib/select-editor/select-editor-option.js +41 -56
  115. package/lib/toaster/alert.js +41 -135
  116. package/lib/toaster/index.css +116 -0
  117. package/lib/toaster/index.js +1 -1
  118. package/lib/toaster/toast.js +71 -136
  119. package/lib/toaster/toastManager.js +54 -100
  120. package/lib/toaster/toaster.js +59 -57
  121. package/lib/utils/editor-utils.js +17 -19
  122. package/lib/utils/utils.js +14 -14
  123. package/package.json +5 -6
@@ -1,74 +1,38 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
- import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
5
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/esm/createClass";
7
- import _inherits from "@babel/runtime/helpers/esm/inherits";
8
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
9
- var _excluded = ["id", "description"];
10
1
  import React from 'react';
11
- import { css } from 'glamor';
12
2
  import Toast from './toast';
13
- var wrapperClass = css({
14
- maxWidth: 560,
15
- margin: '0 auto',
16
- top: 0,
17
- left: 0,
18
- right: 0,
19
- position: 'fixed',
20
- zIndex: 999999
21
- });
22
- var hasCustomId = function hasCustomId(settings) {
23
- return Object.hasOwnProperty.call(settings, 'id');
24
- };
25
- var ToastManager = /*#__PURE__*/function (_React$PureComponent) {
26
- _inherits(ToastManager, _React$PureComponent);
27
- var _super = _createSuper(ToastManager);
28
- function ToastManager(props, context) {
29
- var _this;
30
- _classCallCheck(this, ToastManager);
31
- _this = _super.call(this, props, context);
32
- _this.getToasts = function () {
33
- return _this.state.toasts;
3
+ const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id');
4
+ export default class ToastManager extends React.PureComponent {
5
+ constructor(props, context) {
6
+ super(props, context);
7
+ this.getToasts = () => {
8
+ return this.state.toasts;
34
9
  };
35
- _this.closeAll = function () {
36
- _this.getToasts().forEach(function (toast) {
37
- return toast.close();
38
- });
10
+ this.closeAll = () => {
11
+ this.getToasts().forEach(toast => toast.close());
39
12
  };
40
- _this.notify = function (title, settings) {
13
+ this.notify = (title, settings) => {
41
14
  // If there's a custom toast ID passed, close existing toasts with the same custom ID
42
15
  if (hasCustomId(settings)) {
43
- var _iterator = _createForOfIteratorHelper(_this.state.toasts),
44
- _step;
45
- try {
46
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
47
- var toast = _step.value;
48
- // Since unique ID is still appended to a custom ID, skip the unique ID and check only prefix
49
- if (String(toast.id).startsWith(settings.id)) {
50
- _this.closeToast(toast.id);
51
- }
16
+ for (const toast of this.state.toasts) {
17
+ // Since unique ID is still appended to a custom ID, skip the unique ID and check only prefix
18
+ if (String(toast.id).startsWith(settings.id)) {
19
+ this.closeToast(toast.id);
52
20
  }
53
- } catch (err) {
54
- _iterator.e(err);
55
- } finally {
56
- _iterator.f();
57
21
  }
58
22
  }
59
- var instance = _this.createToastInstance(title, settings);
60
- _this.setState(function (previousState) {
23
+ const instance = this.createToastInstance(title, settings);
24
+ this.setState(previousState => {
61
25
  return {
62
- toasts: [instance].concat(_toConsumableArray(previousState.toasts))
26
+ toasts: [instance, ...previousState.toasts]
63
27
  };
64
28
  });
65
29
  return instance;
66
30
  };
67
- _this.createToastInstance = function (title, settings) {
68
- var uniqueId = ++ToastManager.idCounter;
69
- var id = hasCustomId(settings) ? "".concat(settings.id, "-").concat(uniqueId) : uniqueId;
70
- var hasCloseButton = settings.hasCloseButton || true;
71
- var duration = settings.duration || 2;
31
+ this.createToastInstance = (title, settings) => {
32
+ const uniqueId = ++ToastManager.idCounter;
33
+ const id = hasCustomId(settings) ? "".concat(settings.id, "-").concat(uniqueId) : uniqueId;
34
+ let hasCloseButton = settings.hasCloseButton || true;
35
+ let duration = settings.duration || 2;
72
36
  if (settings.hasCloseButton !== undefined) {
73
37
  hasCloseButton = settings.hasCloseButton;
74
38
  }
@@ -76,14 +40,12 @@ var ToastManager = /*#__PURE__*/function (_React$PureComponent) {
76
40
  duration = settings.duration;
77
41
  }
78
42
  return {
79
- id: id,
80
- title: title,
43
+ id,
44
+ title,
81
45
  description: settings.description,
82
46
  hasCloseButton: hasCloseButton,
83
47
  duration: duration,
84
- close: function close() {
85
- return _this.closeToast(id);
86
- },
48
+ close: () => this.closeToast(id),
87
49
  intent: settings.intent
88
50
  };
89
51
  };
@@ -91,57 +53,49 @@ var ToastManager = /*#__PURE__*/function (_React$PureComponent) {
91
53
  * This will set isShown on the Toast which will close the toast.
92
54
  * It won't remove the toast until onExited triggers onRemove.
93
55
  */
94
- _this.closeToast = function (id) {
95
- _this.setState(function (previousState) {
56
+ this.closeToast = id => {
57
+ this.setState(previousState => {
96
58
  return {
97
- toasts: previousState.toasts.map(function (toast) {
59
+ toasts: previousState.toasts.map(toast => {
98
60
  if (toast.id === id) {
99
- return _objectSpread(_objectSpread({}, toast), {}, {
61
+ return {
62
+ ...toast,
100
63
  isShown: false
101
- });
64
+ };
102
65
  }
103
66
  return toast;
104
67
  })
105
68
  };
106
69
  });
107
70
  };
108
- _this.removeToast = function (id) {
109
- _this.setState(function (previousState) {
71
+ this.removeToast = id => {
72
+ this.setState(previousState => {
110
73
  return {
111
- toasts: previousState.toasts.filter(function (toast) {
112
- return toast.id !== id;
113
- })
74
+ toasts: previousState.toasts.filter(toast => toast.id !== id)
114
75
  };
115
76
  });
116
77
  };
117
- props.bindNotify(_this.notify);
118
- props.bindGetToasts(_this.getToasts);
119
- props.bindCloseAll(_this.closeAll);
120
- _this.state = {
78
+ props.bindNotify(this.notify);
79
+ props.bindGetToasts(this.getToasts);
80
+ props.bindCloseAll(this.closeAll);
81
+ this.state = {
121
82
  toasts: []
122
83
  };
123
- return _this;
124
84
  }
125
- _createClass(ToastManager, [{
126
- key: "render",
127
- value: function render() {
128
- var _this2 = this;
129
- return /*#__PURE__*/React.createElement("span", {
130
- className: wrapperClass
131
- }, this.state.toasts.map(function (_ref) {
132
- var id = _ref.id,
133
- description = _ref.description,
134
- props = _objectWithoutProperties(_ref, _excluded);
135
- return /*#__PURE__*/React.createElement(Toast, Object.assign({
136
- key: id,
137
- onRemove: function onRemove() {
138
- return _this2.removeToast(id);
139
- }
140
- }, props), description);
141
- }));
142
- }
143
- }]);
144
- return ToastManager;
145
- }(React.PureComponent);
146
- ToastManager.idCounter = 0;
147
- export { ToastManager as default };
85
+ render() {
86
+ return /*#__PURE__*/React.createElement("div", {
87
+ className: "dtable-toast-manager"
88
+ }, this.state.toasts.map(_ref => {
89
+ let {
90
+ id,
91
+ description,
92
+ ...props
93
+ } = _ref;
94
+ return /*#__PURE__*/React.createElement(Toast, Object.assign({
95
+ key: id,
96
+ onRemove: () => this.removeToast(id)
97
+ }, props), description);
98
+ }));
99
+ }
100
+ }
101
+ ToastManager.idCounter = 0;
@@ -1,65 +1,67 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
1
  import React from 'react';
5
2
  import ReactDOM from 'react-dom';
6
3
  import ToastManager from './toastManager';
7
- var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
4
+ import './index.css';
5
+ const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
8
6
 
9
7
  /**
10
8
  * The Toaster manages the interactionsb between
11
9
  * the ToasterManger and the toast API.
12
10
  */
13
- var Toaster = /*#__PURE__*/_createClass(function Toaster() {
14
- var _this = this;
15
- _classCallCheck(this, Toaster);
16
- this._bindNotify = function (handler) {
17
- _this.notifyHandler = handler;
18
- };
19
- this._bindGetToasts = function (handler) {
20
- _this.getToastsHandler = handler;
21
- };
22
- this._bindCloseAll = function (handler) {
23
- _this.closeAllHandler = handler;
24
- };
25
- this.getToasts = function () {
26
- return _this.getToastsHandler();
27
- };
28
- this.closeAll = function () {
29
- return _this.closeAllHandler();
30
- };
31
- this.notify = function (title) {
32
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
33
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
34
- intent: 'none'
35
- }));
36
- };
37
- this.success = function (title) {
38
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
40
- intent: 'success'
41
- }));
42
- };
43
- this.warning = function (title) {
44
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
46
- intent: 'warning'
47
- }));
48
- };
49
- this.danger = function (title) {
50
- var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
51
- return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
52
- intent: 'danger'
53
- }));
54
- };
55
- if (!isBrowser) return;
56
- var container = document.createElement('div');
57
- container.setAttribute('data-evergreen-toaster-container', '');
58
- document.body.appendChild(container);
59
- ReactDOM.render( /*#__PURE__*/React.createElement(ToastManager, {
60
- bindNotify: this._bindNotify,
61
- bindGetToasts: this._bindGetToasts,
62
- bindCloseAll: this._bindCloseAll
63
- }), container);
64
- });
65
- export { Toaster as default };
11
+ export default class Toaster {
12
+ constructor() {
13
+ var _this = this;
14
+ this._bindNotify = handler => {
15
+ this.notifyHandler = handler;
16
+ };
17
+ this._bindGetToasts = handler => {
18
+ this.getToastsHandler = handler;
19
+ };
20
+ this._bindCloseAll = handler => {
21
+ this.closeAllHandler = handler;
22
+ };
23
+ this.getToasts = () => {
24
+ return this.getToastsHandler();
25
+ };
26
+ this.closeAll = () => {
27
+ return this.closeAllHandler();
28
+ };
29
+ this.notify = function (title) {
30
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
31
+ return _this.notifyHandler(title, {
32
+ ...settings,
33
+ intent: 'none'
34
+ });
35
+ };
36
+ this.success = function (title) {
37
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
38
+ return _this.notifyHandler(title, {
39
+ ...settings,
40
+ intent: 'success'
41
+ });
42
+ };
43
+ this.warning = function (title) {
44
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
45
+ return _this.notifyHandler(title, {
46
+ ...settings,
47
+ intent: 'warning'
48
+ });
49
+ };
50
+ this.danger = function (title) {
51
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
52
+ return _this.notifyHandler(title, {
53
+ ...settings,
54
+ intent: 'danger'
55
+ });
56
+ };
57
+ if (!isBrowser) return;
58
+ const container = document.createElement('div');
59
+ container.setAttribute('data-evergreen-toaster-container', '');
60
+ document.body.appendChild(container);
61
+ ReactDOM.render( /*#__PURE__*/React.createElement(ToastManager, {
62
+ bindNotify: this._bindNotify,
63
+ bindGetToasts: this._bindGetToasts,
64
+ bindCloseAll: this._bindCloseAll
65
+ }), container);
66
+ }
67
+ }
@@ -1,15 +1,15 @@
1
- var zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
2
- var zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
3
- var enUS = require('@seafile/seafile-calendar/lib/locale/en_US');
4
- var frFR = require('@seafile/seafile-calendar/lib/locale/fr_FR');
5
- var deDE = require('@seafile/seafile-calendar/lib/locale/de_DE');
6
- var esES = require('@seafile/seafile-calendar/lib/locale/es_ES');
7
- var plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
8
- var ptBR = require('@seafile/seafile-calendar/lib/locale/pt_BR');
9
- var csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
10
- var ruRU = require('@seafile/seafile-calendar/lib/locale/ru_RU');
11
- export var initDateEditorLanguage = function initDateEditorLanguage(lang) {
12
- var language;
1
+ const zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
2
+ const zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
3
+ const enUS = require('@seafile/seafile-calendar/lib/locale/en_US');
4
+ const frFR = require('@seafile/seafile-calendar/lib/locale/fr_FR');
5
+ const deDE = require('@seafile/seafile-calendar/lib/locale/de_DE');
6
+ const esES = require('@seafile/seafile-calendar/lib/locale/es_ES');
7
+ const plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
8
+ const ptBR = require('@seafile/seafile-calendar/lib/locale/pt_BR');
9
+ const csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
10
+ const ruRU = require('@seafile/seafile-calendar/lib/locale/ru_RU');
11
+ export const initDateEditorLanguage = lang => {
12
+ let language;
13
13
  switch (lang) {
14
14
  case 'zh-cn':
15
15
  language = zhCN;
@@ -52,15 +52,13 @@ export var initDateEditorLanguage = function initDateEditorLanguage(lang) {
52
52
  }
53
53
  return language;
54
54
  };
55
- export var getSelectOptionItem = function getSelectOptionItem(options, optionId) {
56
- return options.find(function (option) {
57
- return option.id === optionId;
58
- });
55
+ export const getSelectOptionItem = (options, optionId) => {
56
+ return options.find(option => option.id === optionId);
59
57
  };
60
- export var isValidUrl = function isValidUrl(url) {
61
- var reg = /^(([-a-zA-Z0-9+.]+):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
58
+ export const isValidUrl = url => {
59
+ const reg = /^(([-a-zA-Z0-9+.]+):\/\/)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
62
60
  return reg.test(url);
63
61
  };
64
- export var getTrimmedString = function getTrimmedString(value) {
62
+ export const getTrimmedString = value => {
65
63
  return typeof value === 'string' ? value.trim() : '';
66
64
  };
@@ -1,18 +1,18 @@
1
- export var debounce = function debounce(fn, wait) {
2
- var timeout = null;
1
+ export const debounce = (fn, wait) => {
2
+ let timeout = null;
3
3
  return function () {
4
4
  if (timeout !== null) clearTimeout(timeout);
5
5
  timeout = setTimeout(fn, wait);
6
6
  };
7
7
  };
8
- export var throttle = function throttle(func, delay) {
9
- var timer = null;
10
- var startTime = Date.now();
8
+ export const throttle = (func, delay) => {
9
+ let timer = null;
10
+ let startTime = Date.now();
11
11
  return function () {
12
- var curTime = Date.now();
13
- var remaining = delay - (curTime - startTime);
14
- var context = this;
15
- var args = arguments;
12
+ let curTime = Date.now();
13
+ let remaining = delay - (curTime - startTime);
14
+ let context = this;
15
+ let args = arguments;
16
16
  clearTimeout(timer);
17
17
  if (remaining <= 0) {
18
18
  func.apply(context, args);
@@ -22,17 +22,17 @@ export var throttle = function throttle(func, delay) {
22
22
  }
23
23
  };
24
24
  };
25
- export var isMac = function isMac() {
26
- var platform = navigator.platform;
25
+ export const isMac = () => {
26
+ const platform = navigator.platform;
27
27
  // eslint-disable-next-line eqeqeq
28
28
  return platform == 'Mac68K' || platform == 'MacPPC' || platform == 'Macintosh' || platform == 'MacIntel';
29
29
  };
30
- export var downloadFile = function downloadFile(downloadUrl) {
31
- var downloadFrame = document.getElementById('dtableUiComponentDownloadFrame');
30
+ export const downloadFile = downloadUrl => {
31
+ const downloadFrame = document.getElementById('dtableUiComponentDownloadFrame');
32
32
  if (downloadFrame != null) {
33
33
  document.body.removeChild(downloadFrame);
34
34
  }
35
- var iframe = document.createElement('iframe');
35
+ let iframe = document.createElement('iframe');
36
36
  iframe.setAttribute('id', 'dtableUiComponentDownloadFrame');
37
37
  iframe.style.display = 'none';
38
38
  iframe.src = downloadUrl;
package/package.json CHANGED
@@ -1,25 +1,24 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.3.7",
3
+ "version": "4.3.9-alpha1",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",
7
7
  "@seafile/seafile-calendar": "0.0.24",
8
- "@seafile/seafile-editor": "0.3.140",
8
+ "@seafile/seafile-editor": "0.3.146",
9
9
  "antd-mobile": "2.3.1",
10
10
  "bail": "1.0.5",
11
11
  "classnames": "^2.3.2",
12
12
  "dayjs": "1.10.7",
13
13
  "deepmerge": "^2.1.0",
14
- "dtable-utils": "4.3.5",
15
- "glamor": "^2.20.40",
14
+ "dtable-utils": "~4.3.5",
16
15
  "hast-util-sanitize": "^1.1.2",
17
16
  "hast-util-to-html": "3.1.0",
18
17
  "is-hotkey": "0.2.0",
19
18
  "react": "17.0.2",
20
- "react-app-polyfill": "^1.0.6",
19
+ "react-app-polyfill": "^3.0.0",
21
20
  "react-dom": "17.0.2",
22
- "react-responsive": "^8.0.3",
21
+ "react-responsive": "9.0.2",
23
22
  "react-select": "5.7.0",
24
23
  "react-transition-group": "^4.4.1",
25
24
  "reactstrap": "8.9.0",