dtable-ui-component 0.3.20 → 0.3.21

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 (107) hide show
  1. package/lib/AutoNumberFormatter/index.js +2 -9
  2. package/lib/ButtonFormatter/index.js +4 -17
  3. package/lib/CTimeFormatter/index.js +2 -15
  4. package/lib/CheckboxEditor/index.js +0 -13
  5. package/lib/CheckboxFormatter/index.js +2 -11
  6. package/lib/CollaboratorEditor/index.js +6 -44
  7. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +2 -27
  8. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +2 -20
  9. package/lib/CollaboratorFormatter/index.js +6 -23
  10. package/lib/CollaboratorItem/index.js +2 -14
  11. package/lib/CreatorFormatter/index.js +6 -22
  12. package/lib/DTableCustomizeCollaboratorSelect/index.js +16 -37
  13. package/lib/DTableCustomizeCollaboratorSelect/utils.js +6 -5
  14. package/lib/DTableCustomizeSelect/index.js +14 -37
  15. package/lib/DTablePopover/index.js +8 -26
  16. package/lib/DTableRadio/index.js +0 -2
  17. package/lib/DTableSearchInput/index.js +12 -36
  18. package/lib/DTableSelect/index.js +13 -27
  19. package/lib/DTableSwitch/index.js +4 -6
  20. package/lib/DateEditor/index.js +8 -27
  21. package/lib/DateEditor/mb-date-editor-popover/index.js +8 -42
  22. package/lib/DateEditor/pc-date-editor-popover.js +7 -27
  23. package/lib/DateFormatter/index.js +3 -12
  24. package/lib/DigitalSignFormatter/index.js +8 -26
  25. package/lib/DigitalSignFormatter/utils.js +3 -6
  26. package/lib/DurationFormatter/index.js +3 -10
  27. package/lib/EditEditorButton/index.js +0 -7
  28. package/lib/EmailFormatter/index.js +2 -9
  29. package/lib/FieldDisplaySetting/field-item.js +6 -20
  30. package/lib/FieldDisplaySetting/index.js +8 -13
  31. package/lib/FileEditor/index.js +0 -8
  32. package/lib/FileFormatter/index.js +3 -14
  33. package/lib/FileItemFormatter/index.js +0 -13
  34. package/lib/FileItemFormatter/utils.js +0 -6
  35. package/lib/FileUploader/index.js +0 -16
  36. package/lib/FormulaFormatter/cell-value-validator.js +0 -10
  37. package/lib/FormulaFormatter/index.js +8 -38
  38. package/lib/FormulaFormatter/utils.js +0 -17
  39. package/lib/GeolocationFormatter/index.js +4 -13
  40. package/lib/HtmlLongTextFormatter/index.js +0 -21
  41. package/lib/HtmlLongTextFormatter/markdown2html.js +2 -17
  42. package/lib/HtmlLongTextFormatter/unified/index.js +29 -102
  43. package/lib/HtmlLongTextFormatter/vfile/core.js +13 -32
  44. package/lib/HtmlLongTextFormatter/vfile/index.js +4 -11
  45. package/lib/ImageFormatter/images-lazy-load.js +5 -35
  46. package/lib/ImageFormatter/index.js +7 -34
  47. package/lib/ImageFormatter/utils.js +0 -1
  48. package/lib/ImagePreviewerLightbox/index.js +11 -13
  49. package/lib/LastModifierFormatter/index.js +6 -22
  50. package/lib/LinkEditor/index.js +23 -69
  51. package/lib/LinkEditor/link-editor-option.js +2 -18
  52. package/lib/LinkEditor/mb-link-editor-popover/index.js +2 -27
  53. package/lib/LinkEditor/pc-link-editor-popover/index.js +2 -20
  54. package/lib/LinkFormatter/index.js +12 -35
  55. package/lib/LongTextFormatter/index.js +2 -6
  56. package/lib/MBEditorHeader/index.js +6 -13
  57. package/lib/MTimeFormatter/index.js +2 -15
  58. package/lib/ModalPortal/index.js +0 -8
  59. package/lib/MultipleSelectEditor/index.js +4 -42
  60. package/lib/MultipleSelectFormatter/index.js +4 -17
  61. package/lib/NotificationPopover/index.js +3 -22
  62. package/lib/NumberEditor/index.js +7 -35
  63. package/lib/NumberFormatter/index.js +3 -12
  64. package/lib/RateFormatter/index.js +10 -25
  65. package/lib/RowExpandEmailFormatter/index.js +2 -13
  66. package/lib/RowExpandFileFormatter/index.js +6 -15
  67. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +6 -24
  68. package/lib/RowExpandFormatter/index.js +10 -60
  69. package/lib/RowExpandFormulaFormatter/index.js +10 -41
  70. package/lib/RowExpandImageFormatter/index.js +8 -27
  71. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +11 -27
  72. package/lib/RowExpandImageFormatter/utils.js +0 -1
  73. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +4 -35
  74. package/lib/RowExpandLinkFormatter/index.js +6 -28
  75. package/lib/RowExpandLinkFormatter/utils.js +0 -4
  76. package/lib/RowExpandLinkFormatter/value-display-utils.js +2 -2
  77. package/lib/RowExpandRateFormatter/index.js +8 -23
  78. package/lib/RowExpandUrlFormatter/index.js +2 -14
  79. package/lib/SelectItem/index.js +2 -13
  80. package/lib/SelectOptionGroup/index.js +13 -42
  81. package/lib/SelectOptionGroup/option.js +0 -14
  82. package/lib/SimpleLongTextFormatter/index.js +0 -26
  83. package/lib/SimpleLongTextFormatter/normalize-long-text-value.js +2 -12
  84. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +1 -16
  85. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +0 -17
  86. package/lib/SingleSelectEditor/index.js +4 -37
  87. package/lib/SingleSelectFormatter/index.js +5 -17
  88. package/lib/TextEditor/index.js +3 -22
  89. package/lib/TextFormatter/index.js +2 -15
  90. package/lib/UrlFormatter/index.js +2 -9
  91. package/lib/cellFormatterFactory/index.js +0 -5
  92. package/lib/common/delete-tip.js +4 -16
  93. package/lib/common/modal-portal.js +0 -8
  94. package/lib/formatterConfig/base-formatter-config.js +0 -2
  95. package/lib/formatterConfig/index.js +0 -4
  96. package/lib/index.js +12 -6
  97. package/lib/lang/index.js +0 -7
  98. package/lib/select-editor/mb-select-editor-popover/index.js +6 -38
  99. package/lib/select-editor/pc-select-editor-popover/index.js +3 -25
  100. package/lib/select-editor/select-editor-option.js +2 -17
  101. package/lib/toaster/alert.js +0 -12
  102. package/lib/toaster/toast.js +1 -22
  103. package/lib/toaster/toastManager.js +7 -30
  104. package/lib/toaster/toaster.js +4 -15
  105. package/lib/utils/editor-utils.js +0 -20
  106. package/lib/utils/utils.js +2 -5
  107. package/package.json +5 -5
@@ -1,67 +1,57 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
2
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
4
  import React from 'react';
4
5
  import ReactDOM from 'react-dom';
5
6
  import ToastManager from './toastManager';
6
7
  var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
8
+
7
9
  /**
8
10
  * The Toaster manages the interactionsb between
9
11
  * the ToasterManger and the toast API.
10
12
  */
11
-
12
- var Toaster = function Toaster() {
13
+ var Toaster = /*#__PURE__*/_createClass(function Toaster() {
13
14
  var _this = this;
14
-
15
15
  _classCallCheck(this, Toaster);
16
-
17
16
  this._bindNotify = function (handler) {
18
17
  _this.notifyHandler = handler;
19
18
  };
20
-
21
19
  this._bindGetToasts = function (handler) {
22
20
  _this.getToastsHandler = handler;
23
21
  };
24
-
25
22
  this._bindCloseAll = function (handler) {
26
23
  _this.closeAllHandler = handler;
27
24
  };
28
-
29
25
  this.getToasts = function () {
30
26
  return _this.getToastsHandler();
31
27
  };
32
-
33
28
  this.closeAll = function () {
34
29
  return _this.closeAllHandler();
35
30
  };
36
-
37
31
  this.notify = function (title) {
38
32
  var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39
33
  return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
40
34
  intent: 'none'
41
35
  }));
42
36
  };
43
-
44
37
  this.success = function (title) {
45
38
  var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46
39
  return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
47
40
  intent: 'success'
48
41
  }));
49
42
  };
50
-
51
43
  this.warning = function (title) {
52
44
  var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
53
45
  return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
54
46
  intent: 'warning'
55
47
  }));
56
48
  };
57
-
58
49
  this.danger = function (title) {
59
50
  var settings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
60
51
  return _this.notifyHandler(title, _objectSpread(_objectSpread({}, settings), {}, {
61
52
  intent: 'danger'
62
53
  }));
63
54
  };
64
-
65
55
  if (!isBrowser) return;
66
56
  var container = document.createElement('div');
67
57
  container.setAttribute('data-evergreen-toaster-container', '');
@@ -71,6 +61,5 @@ var Toaster = function Toaster() {
71
61
  bindGetToasts: this._bindGetToasts,
72
62
  bindCloseAll: this._bindCloseAll
73
63
  }), container);
74
- };
75
-
64
+ });
76
65
  export { Toaster as default };
@@ -1,67 +1,47 @@
1
1
  var zhCN = require('@seafile/seafile-calendar/lib/locale/zh_CN');
2
-
3
2
  var zhTW = require('@seafile/seafile-calendar/lib/locale/zh_TW');
4
-
5
3
  var enUS = require('@seafile/seafile-calendar/lib/locale/en_US');
6
-
7
4
  var frFR = require('@seafile/seafile-calendar/lib/locale/fr_FR');
8
-
9
5
  var deDE = require('@seafile/seafile-calendar/lib/locale/de_DE');
10
-
11
6
  var esES = require('@seafile/seafile-calendar/lib/locale/es_ES');
12
-
13
7
  var plPL = require('@seafile/seafile-calendar/lib/locale/pl_PL');
14
-
15
8
  var csCZ = require('@seafile/seafile-calendar/lib/locale/cs_CZ');
16
-
17
9
  export var initDateEditorLanguage = function initDateEditorLanguage(lang) {
18
10
  var language;
19
-
20
11
  switch (lang) {
21
12
  case 'zh-cn':
22
13
  language = zhCN;
23
14
  break;
24
-
25
15
  case 'zh-tw':
26
16
  language = zhTW;
27
17
  break;
28
-
29
18
  case 'en':
30
19
  language = enUS;
31
20
  break;
32
-
33
21
  case 'fr':
34
22
  language = frFR;
35
23
  break;
36
-
37
24
  case 'de':
38
25
  language = deDE;
39
26
  break;
40
-
41
27
  case 'es':
42
28
  language = esES;
43
29
  break;
44
-
45
30
  case 'es-ar':
46
31
  language = esES;
47
32
  break;
48
-
49
33
  case 'es-mx':
50
34
  language = esES;
51
35
  break;
52
-
53
36
  case 'pl':
54
37
  language = plPL;
55
38
  break;
56
-
57
39
  case 'cs':
58
40
  language = csCZ;
59
41
  break;
60
-
61
42
  default:
62
43
  language = zhCN;
63
44
  }
64
-
65
45
  return language;
66
46
  };
67
47
  export var getSelectOptionItem = function getSelectOptionItem(options, optionId) {
@@ -14,7 +14,6 @@ export var throttle = function throttle(func, delay) {
14
14
  var context = this;
15
15
  var args = arguments;
16
16
  clearTimeout(timer);
17
-
18
17
  if (remaining <= 0) {
19
18
  func.apply(context, args);
20
19
  startTime = Date.now();
@@ -24,17 +23,15 @@ export var throttle = function throttle(func, delay) {
24
23
  };
25
24
  };
26
25
  export var isMac = function isMac() {
27
- var platform = navigator.platform; // eslint-disable-next-line eqeqeq
28
-
26
+ var platform = navigator.platform;
27
+ // eslint-disable-next-line eqeqeq
29
28
  return platform == 'Mac68K' || platform == 'MacPPC' || platform == 'Macintosh' || platform == 'MacIntel';
30
29
  };
31
30
  export var downloadFile = function downloadFile(downloadUrl) {
32
31
  var downloadFrame = document.getElementById('dtableUiComponentDownloadFrame');
33
-
34
32
  if (downloadFrame != null) {
35
33
  document.body.removeChild(downloadFrame);
36
34
  }
37
-
38
35
  var iframe = document.createElement('iframe');
39
36
  iframe.setAttribute('id', 'dtableUiComponentDownloadFrame');
40
37
  iframe.style.display = 'none';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.4",
@@ -22,7 +22,7 @@
22
22
  "react-responsive": "^8.0.3",
23
23
  "react-select": "4.3.0",
24
24
  "react-transition-group": "^4.4.1",
25
- "reactstrap": "^8.4.1",
25
+ "reactstrap": "8.9.0",
26
26
  "rehype-format": "^2.2.0",
27
27
  "rehype-mathjax": "^2.0.0",
28
28
  "rehype-raw": "^2.0.0",
@@ -88,7 +88,7 @@
88
88
  "@storybook/addon-knobs": "^5.3.19",
89
89
  "@storybook/addon-links": "^5.3.14",
90
90
  "@storybook/addons": "^5.3.14",
91
- "@storybook/react": "^5.3.14",
91
+ "@storybook/react": "^7.5.0",
92
92
  "@svgr/webpack": "4.3.3",
93
93
  "@testing-library/jest-dom": "^4.2.4",
94
94
  "@testing-library/react": "^9.5.0",
@@ -132,10 +132,10 @@
132
132
  "postcss-normalize": "8.0.1",
133
133
  "postcss-preset-env": "6.7.0",
134
134
  "postcss-safe-parser": "4.0.1",
135
- "react-dev-utils": "^10.2.0",
135
+ "react-dev-utils": "^12.0.1",
136
136
  "react-element-to-jsx-string": "^14.3.1",
137
137
  "resolve": "1.15.0",
138
- "resolve-url-loader": "3.1.1",
138
+ "resolve-url-loader": "3.1.5",
139
139
  "sass-loader": "8.0.2",
140
140
  "semver": "6.3.1",
141
141
  "style-loader": "0.23.1",