dtable-ui-component 4.3.7 → 4.3.8

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 (120) 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.js +80 -99
  13. package/lib/DTableCustomizeCollaboratorSelect/utils.js +12 -13
  14. package/lib/DTableCustomizeSelect/index.js +92 -103
  15. package/lib/DTablePopover/index.js +52 -71
  16. package/lib/DTablePopover/utils.js +1 -1
  17. package/lib/DTableRadio/index.js +9 -7
  18. package/lib/DTableSearchInput/index.js +89 -99
  19. package/lib/DTableSearchInput/utils.js +2 -2
  20. package/lib/DTableSelect/dtable-select-label.js +5 -3
  21. package/lib/DTableSelect/index.js +50 -64
  22. package/lib/DTableSelect/utils.js +36 -41
  23. package/lib/DTableSwitch/index.js +7 -5
  24. package/lib/DateEditor/index.js +88 -94
  25. package/lib/DateEditor/mb-date-editor-popover/index.js +136 -134
  26. package/lib/DateEditor/pc-date-editor-popover.js +70 -77
  27. package/lib/DateFormatter/index.js +15 -28
  28. package/lib/DepartmentSingleSelectFormatter/index.js +9 -9
  29. package/lib/DigitalSignFormatter/index.js +55 -65
  30. package/lib/DigitalSignFormatter/utils.js +9 -8
  31. package/lib/DurationFormatter/index.js +14 -27
  32. package/lib/EditEditorButton/index.js +10 -22
  33. package/lib/EmailFormatter/index.js +11 -24
  34. package/lib/FieldDisplaySetting/field-item.js +18 -20
  35. package/lib/FieldDisplaySetting/index.js +41 -43
  36. package/lib/FileEditor/index.js +18 -29
  37. package/lib/FileFormatter/index.js +29 -43
  38. package/lib/FileItemFormatter/index.js +17 -32
  39. package/lib/FileItemFormatter/utils.js +5 -5
  40. package/lib/FileUploader/index.js +20 -33
  41. package/lib/FormulaFormatter/cell-value-validator.js +23 -8
  42. package/lib/FormulaFormatter/index.js +77 -83
  43. package/lib/FormulaFormatter/utils.js +27 -21
  44. package/lib/GeolocationFormatter/index.js +19 -32
  45. package/lib/HtmlLongTextFormatter/index.js +43 -52
  46. package/lib/HtmlLongTextFormatter/markdown2html.js +2 -2
  47. package/lib/HtmlLongTextFormatter/unified/index.js +1 -1
  48. package/lib/HtmlLongTextFormatter/vfile/core.js +10 -10
  49. package/lib/ImageFormatter/images-lazy-load.js +71 -79
  50. package/lib/ImageFormatter/index.js +86 -97
  51. package/lib/ImageFormatter/utils.js +1 -1
  52. package/lib/ImagePreviewerLightbox/index.js +20 -18
  53. package/lib/ImagePreviewerLightbox/utils.js +3 -3
  54. package/lib/LastModifierFormatter/index.js +24 -40
  55. package/lib/LinkEditor/index.js +163 -167
  56. package/lib/LinkEditor/link-editor-option.js +41 -56
  57. package/lib/LinkEditor/mb-link-editor-popover/index.js +90 -99
  58. package/lib/LinkEditor/pc-link-editor-popover/index.js +63 -71
  59. package/lib/LinkFormatter/index.js +75 -77
  60. package/lib/LongTextFormatter/index.js +5 -3
  61. package/lib/MBEditorHeader/index.js +25 -38
  62. package/lib/MTimeFormatter/index.js +17 -32
  63. package/lib/ModalPortal/index.js +15 -32
  64. package/lib/MultipleSelectEditor/index.js +118 -136
  65. package/lib/MultipleSelectFormatter/index.js +24 -40
  66. package/lib/NotificationPopover/index.js +68 -95
  67. package/lib/NumberEditor/index.js +75 -82
  68. package/lib/NumberFormatter/index.js +15 -28
  69. package/lib/RateFormatter/index.js +29 -45
  70. package/lib/RoleStatusEditor/index.js +20 -22
  71. package/lib/RowExpandEmailFormatter/index.js +24 -37
  72. package/lib/RowExpandFileFormatter/index.js +28 -42
  73. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +66 -82
  74. package/lib/RowExpandFormatter/index.js +92 -96
  75. package/lib/RowExpandFormulaFormatter/index.js +85 -91
  76. package/lib/RowExpandImageFormatter/index.js +65 -82
  77. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +71 -84
  78. package/lib/RowExpandImageFormatter/utils.js +1 -1
  79. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +54 -68
  80. package/lib/RowExpandLinkFormatter/index.js +131 -137
  81. package/lib/RowExpandLinkFormatter/utils.js +23 -17
  82. package/lib/RowExpandLinkFormatter/value-display-utils.js +9 -7
  83. package/lib/RowExpandRateFormatter/index.js +27 -42
  84. package/lib/RowExpandUrlFormatter/index.js +27 -40
  85. package/lib/SelectItem/index.js +17 -33
  86. package/lib/SelectOptionGroup/index.js +141 -159
  87. package/lib/SelectOptionGroup/option.js +24 -40
  88. package/lib/SimpleLongTextFormatter/index.js +55 -67
  89. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +23 -22
  90. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +42 -57
  91. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +31 -46
  92. package/lib/SingleSelectEditor/index.js +108 -119
  93. package/lib/SingleSelectFormatter/index.js +21 -37
  94. package/lib/TextEditor/index.js +45 -51
  95. package/lib/TextFormatter/index.js +17 -32
  96. package/lib/UrlFormatter/index.js +11 -24
  97. package/lib/cellFormatterFactory/index.js +8 -17
  98. package/lib/common/ClickOutside.js +22 -43
  99. package/lib/common/delete-tip.js +40 -65
  100. package/lib/common/modal-portal.js +15 -33
  101. package/lib/constants/index.js +5 -5
  102. package/lib/data/dtable-value.js +4 -4
  103. package/lib/formatterConfig/base-formatter-config.js +24 -3
  104. package/lib/formatterConfig/index.js +5 -4
  105. package/lib/lang/index.js +6 -6
  106. package/lib/locals/de.js +1 -1
  107. package/lib/locals/en.js +1 -1
  108. package/lib/locals/fr.js +1 -1
  109. package/lib/locals/zh-CN.js +1 -1
  110. package/lib/select-editor/mb-select-editor-popover/index.js +126 -137
  111. package/lib/select-editor/pc-select-editor-popover/index.js +75 -83
  112. package/lib/select-editor/select-editor-option.js +41 -56
  113. package/lib/toaster/alert.js +73 -88
  114. package/lib/toaster/index.js +1 -1
  115. package/lib/toaster/toast.js +75 -102
  116. package/lib/toaster/toastManager.js +55 -91
  117. package/lib/toaster/toaster.js +58 -57
  118. package/lib/utils/editor-utils.js +17 -19
  119. package/lib/utils/utils.js +14 -14
  120. package/package.json +4 -4
@@ -1,65 +1,66 @@
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
+ const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
8
5
 
9
6
  /**
10
7
  * The Toaster manages the interactionsb between
11
8
  * the ToasterManger and the toast API.
12
9
  */
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 };
10
+ export default class Toaster {
11
+ constructor() {
12
+ var _this = this;
13
+ this._bindNotify = handler => {
14
+ this.notifyHandler = handler;
15
+ };
16
+ this._bindGetToasts = handler => {
17
+ this.getToastsHandler = handler;
18
+ };
19
+ this._bindCloseAll = handler => {
20
+ this.closeAllHandler = handler;
21
+ };
22
+ this.getToasts = () => {
23
+ return this.getToastsHandler();
24
+ };
25
+ this.closeAll = () => {
26
+ return this.closeAllHandler();
27
+ };
28
+ this.notify = function (title) {
29
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
30
+ return _this.notifyHandler(title, {
31
+ ...settings,
32
+ intent: 'none'
33
+ });
34
+ };
35
+ this.success = function (title) {
36
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
37
+ return _this.notifyHandler(title, {
38
+ ...settings,
39
+ intent: 'success'
40
+ });
41
+ };
42
+ this.warning = function (title) {
43
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
44
+ return _this.notifyHandler(title, {
45
+ ...settings,
46
+ intent: 'warning'
47
+ });
48
+ };
49
+ this.danger = function (title) {
50
+ let settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
51
+ return _this.notifyHandler(title, {
52
+ ...settings,
53
+ intent: 'danger'
54
+ });
55
+ };
56
+ if (!isBrowser) return;
57
+ const container = document.createElement('div');
58
+ container.setAttribute('data-evergreen-toaster-container', '');
59
+ document.body.appendChild(container);
60
+ ReactDOM.render( /*#__PURE__*/React.createElement(ToastManager, {
61
+ bindNotify: this._bindNotify,
62
+ bindGetToasts: this._bindGetToasts,
63
+ bindCloseAll: this._bindCloseAll
64
+ }), container);
65
+ }
66
+ }
@@ -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,17 +1,17 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.3.7",
3
+ "version": "4.3.8",
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.145",
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",
14
+ "dtable-utils": "~4.3.5",
15
15
  "glamor": "^2.20.40",
16
16
  "hast-util-sanitize": "^1.1.2",
17
17
  "hast-util-to-html": "3.1.0",
@@ -19,7 +19,7 @@
19
19
  "react": "17.0.2",
20
20
  "react-app-polyfill": "^1.0.6",
21
21
  "react-dom": "17.0.2",
22
- "react-responsive": "^8.0.3",
22
+ "react-responsive": "9.0.2",
23
23
  "react-select": "5.7.0",
24
24
  "react-transition-group": "^4.4.1",
25
25
  "reactstrap": "8.9.0",