dtable-ui-component 5.0.9-beta.1 → 5.0.9-beta.2

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 +5 -3
  2. package/lib/ButtonFormatter/index.js +9 -5
  3. package/lib/CTimeFormatter/index.js +5 -3
  4. package/lib/CheckboxEditor/index.js +15 -12
  5. package/lib/CheckboxFormatter/index.js +7 -5
  6. package/lib/CollaboratorEditor/index.js +46 -37
  7. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +60 -47
  8. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +37 -31
  9. package/lib/CollaboratorFormatter/index.js +8 -7
  10. package/lib/CollaboratorItem/index.js +21 -16
  11. package/lib/CollapsibleSettingLayout/index.js +17 -12
  12. package/lib/CreatorFormatter/index.js +8 -7
  13. package/lib/DTableCommonAddTool/index.js +10 -7
  14. package/lib/DTableCustomizeCollaboratorSelect/index.js +38 -32
  15. package/lib/DTableCustomizeSelect/index.js +51 -44
  16. package/lib/DTableFiltersPopover/index.js +46 -41
  17. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +67 -51
  18. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +64 -49
  19. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +38 -32
  20. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +42 -34
  21. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +35 -31
  22. package/lib/DTableFiltersPopover/widgets/filter-item.js +92 -76
  23. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +19 -17
  24. package/lib/DTableFiltersPopover/widgets/rate-item.js +12 -9
  25. package/lib/DTablePopover/index.js +9 -6
  26. package/lib/DTableRadio/index.js +20 -17
  27. package/lib/DTableSearchInput/index.js +22 -18
  28. package/lib/DTableSelect/dtable-select-label.js +12 -7
  29. package/lib/DTableSelect/index.js +2 -1
  30. package/lib/DTableSelect/utils.js +26 -13
  31. package/lib/DTableSwitch/index.js +20 -16
  32. package/lib/DateEditor/index.js +46 -36
  33. package/lib/DateEditor/mb-date-editor-popover/index.js +80 -63
  34. package/lib/DateEditor/pc-date-editor-popover.js +25 -22
  35. package/lib/DateFormatter/index.js +5 -3
  36. package/lib/Department-editor/department-multiple-select/index.js +49 -42
  37. package/lib/Department-editor/department-single-select.js +70 -54
  38. package/lib/Department-editor/index.js +18 -14
  39. package/lib/Department-editor/selected-departments/index.js +54 -44
  40. package/lib/DepartmentSelectFilter/index.js +8 -1
  41. package/lib/DepartmentSingleSelectFormatter/index.js +13 -9
  42. package/lib/DigitalSignFormatter/index.js +21 -17
  43. package/lib/DurationFormatter/index.js +7 -5
  44. package/lib/EditEditorButton/index.js +5 -3
  45. package/lib/EmailFormatter/index.js +5 -3
  46. package/lib/FieldDisplaySetting/field-item.js +25 -19
  47. package/lib/FieldDisplaySetting/index.js +47 -38
  48. package/lib/FileEditor/index.js +10 -7
  49. package/lib/FileFormatter/index.js +18 -15
  50. package/lib/FileItemFormatter/index.js +2 -1
  51. package/lib/FileUploader/index.js +2 -1
  52. package/lib/FormulaFormatter/index.js +21 -14
  53. package/lib/GeolocationFormatter/index.js +8 -6
  54. package/lib/HtmlLongTextFormatter/index.js +2 -1
  55. package/lib/ImageFormatter/images-lazy-load.js +7 -6
  56. package/lib/ImageFormatter/index.js +35 -29
  57. package/lib/ImagePreviewerLightbox/index.js +12 -8
  58. package/lib/LastModifierFormatter/index.js +8 -7
  59. package/lib/LinkEditor/index.js +38 -32
  60. package/lib/LinkEditor/link-editor-option.js +25 -20
  61. package/lib/LinkEditor/mb-link-editor-popover/index.js +53 -41
  62. package/lib/LinkEditor/pc-link-editor-popover/index.js +41 -33
  63. package/lib/LinkFormatter/index.js +13 -10
  64. package/lib/Loading/index.js +2 -1
  65. package/lib/LongTextFormatter/index.js +3 -2
  66. package/lib/MBEditorHeader/index.js +19 -14
  67. package/lib/MTimeFormatter/index.js +5 -3
  68. package/lib/MultipleSelectEditor/index.js +43 -37
  69. package/lib/MultipleSelectFormatter/index.js +8 -7
  70. package/lib/NotificationPopover/index.js +43 -32
  71. package/lib/NumberEditor/index.js +24 -20
  72. package/lib/NumberFormatter/index.js +5 -3
  73. package/lib/RateFormatter/index.js +7 -6
  74. package/lib/RoleStatusEditor/index.js +35 -30
  75. package/lib/RowExpandEmailFormatter/index.js +11 -8
  76. package/lib/RowExpandFileFormatter/index.js +14 -13
  77. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +43 -36
  78. package/lib/RowExpandFormatter/index.js +129 -112
  79. package/lib/RowExpandFormulaFormatter/index.js +37 -29
  80. package/lib/RowExpandImageFormatter/index.js +29 -26
  81. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +47 -39
  82. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +2 -1
  83. package/lib/RowExpandLinkFormatter/index.js +70 -67
  84. package/lib/RowExpandRateFormatter/index.js +7 -6
  85. package/lib/RowExpandUrlFormatter/index.js +11 -8
  86. package/lib/SelectItem/index.js +5 -3
  87. package/lib/SelectOptionGroup/index.js +38 -31
  88. package/lib/SelectOptionGroup/option.js +5 -3
  89. package/lib/SimpleLongTextFormatter/index.js +39 -30
  90. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +11 -8
  91. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +3 -2
  92. package/lib/SingleSelectEditor/index.js +42 -34
  93. package/lib/SingleSelectFormatter/index.js +6 -4
  94. package/lib/TextEditor/index.js +2 -1
  95. package/lib/TextFormatter/index.js +5 -3
  96. package/lib/UrlFormatter/index.js +5 -3
  97. package/lib/common/delete-tip.js +27 -19
  98. package/lib/formatterConfig/base-formatter-config.js +23 -22
  99. package/lib/formatterConfig/index.js +3 -2
  100. package/lib/select-editor/mb-select-editor-popover/index.js +84 -64
  101. package/lib/select-editor/pc-select-editor-popover/index.js +50 -39
  102. package/lib/select-editor/select-editor-option.js +24 -19
  103. package/lib/toaster/alert.js +25 -16
  104. package/lib/toaster/toast.js +28 -24
  105. package/lib/toaster/toastManager.js +16 -13
  106. package/lib/toaster/toaster.js +2 -1
  107. package/package.json +1 -1
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _lang = require("../../lang");
10
10
  require("./index.css");
11
+ var _jsxRuntime = require("react/jsx-runtime");
11
12
  class PCSelectEditorPopover extends _react.default.Component {
12
13
  constructor(props) {
13
14
  super(props);
@@ -72,46 +73,56 @@ class PCSelectEditorPopover extends _react.default.Component {
72
73
  }, {
73
74
  position: 'absolute'
74
75
  });
75
- return /*#__PURE__*/_react.default.createElement("div", {
76
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
76
77
  className: "dtable-ui-editor-popover dtable-ui-select-editor-popover",
77
- style: popoverStyle
78
- }, /*#__PURE__*/_react.default.createElement("div", {
79
- className: "select-options-search"
80
- }, /*#__PURE__*/_react.default.createElement("input", {
81
- className: "form-control",
82
- onChange: this.onValueChanged,
83
- onClick: this.onInputClick,
84
- placeholder: (0, _lang.getLocale)('Search_option')
85
- })), /*#__PURE__*/_react.default.createElement("div", {
86
- className: "select-options-container"
87
- }, options.length > 0 && options.map((option, index) => {
88
- let optionStyle = this.getOptionStyle(option);
89
- let isSelect = selectedOptions.some(selectedOption => {
90
- return selectedOption.id === option.id;
91
- });
92
- return /*#__PURE__*/_react.default.createElement("div", {
93
- key: index,
94
- className: "select-option-item",
95
- onClick: this.onOptionItemToggle.bind(this, option)
96
- }, /*#__PURE__*/_react.default.createElement("div", {
97
- className: "option-info"
98
- }, /*#__PURE__*/_react.default.createElement("div", {
99
- className: "option-name",
100
- style: optionStyle,
101
- title: option.name
102
- }, option.name)), /*#__PURE__*/_react.default.createElement("div", {
103
- className: "option-checked"
104
- }, isSelect && /*#__PURE__*/_react.default.createElement("i", {
105
- className: "dtable-font dtable-icon-check-mark"
106
- })));
107
- }), options.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
108
- className: "no-search-result"
109
- }, (0, _lang.getLocale)('No_options_available'))), isSupportNewOption && !!searchValue && /*#__PURE__*/_react.default.createElement("div", {
110
- className: "select-options-add",
111
- onClick: this.onAddNewOption
112
- }, /*#__PURE__*/_react.default.createElement("i", {
113
- className: "dtable-font dtable-icon-add-table"
114
- }), /*#__PURE__*/_react.default.createElement("span", null, (0, _lang.getLocale)('Add_an_option'), ' ', searchValue)));
78
+ style: popoverStyle,
79
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
80
+ className: "select-options-search",
81
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
82
+ className: "form-control",
83
+ onChange: this.onValueChanged,
84
+ onClick: this.onInputClick,
85
+ placeholder: (0, _lang.getLocale)('Search_option')
86
+ })
87
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
88
+ className: "select-options-container",
89
+ children: [options.length > 0 && options.map((option, index) => {
90
+ let optionStyle = this.getOptionStyle(option);
91
+ let isSelect = selectedOptions.some(selectedOption => {
92
+ return selectedOption.id === option.id;
93
+ });
94
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
95
+ className: "select-option-item",
96
+ onClick: this.onOptionItemToggle.bind(this, option),
97
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
98
+ className: "option-info",
99
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
100
+ className: "option-name",
101
+ style: optionStyle,
102
+ title: option.name,
103
+ children: option.name
104
+ })
105
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
106
+ className: "option-checked",
107
+ children: isSelect && /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
108
+ className: "dtable-font dtable-icon-check-mark"
109
+ })
110
+ })]
111
+ }, index);
112
+ }), options.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
113
+ className: "no-search-result",
114
+ children: (0, _lang.getLocale)('No_options_available')
115
+ })]
116
+ }), isSupportNewOption && !!searchValue && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
117
+ className: "select-options-add",
118
+ onClick: this.onAddNewOption,
119
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
120
+ className: "dtable-font dtable-icon-add-table"
121
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
122
+ children: [(0, _lang.getLocale)('Add_an_option'), ' ', searchValue]
123
+ })]
124
+ })]
125
+ });
115
126
  }
116
127
  }
117
128
  PCSelectEditorPopover.defaultProps = {
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
9
10
  class SelectEditorOption extends _react.default.Component {
10
11
  constructor() {
11
12
  super(...arguments);
@@ -56,26 +57,30 @@ class SelectEditorOption extends _react.default.Component {
56
57
  let containerStyle = this.getContainerStyle();
57
58
  let optionStyle = this.getOptionStyle(option);
58
59
  let operationStyle = this.getOperationStyle(option);
59
- return /*#__PURE__*/_react.default.createElement("div", {
60
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
60
61
  className: "dtable-ui select-option-item",
61
- style: containerStyle
62
- }, /*#__PURE__*/_react.default.createElement("div", {
63
- className: "option-info",
64
- style: optionStyle
65
- }, /*#__PURE__*/_react.default.createElement("div", {
66
- className: "option-name",
67
- title: option.name
68
- }, option.name)), isShowRemoveIcon && /*#__PURE__*/_react.default.createElement("div", {
69
- className: "option-remove",
70
- style: operationStyle,
71
- onClick: this.onDeleteOption
72
- }, /*#__PURE__*/_react.default.createElement("i", {
73
- className: "dtable-font dtable-icon-fork-number",
74
- style: {
75
- fontSize: '12px',
76
- lineHeight: '20px'
77
- }
78
- })));
62
+ style: containerStyle,
63
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
64
+ className: "option-info",
65
+ style: optionStyle,
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
67
+ className: "option-name",
68
+ title: option.name,
69
+ children: option.name
70
+ })
71
+ }), isShowRemoveIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
72
+ className: "option-remove",
73
+ style: operationStyle,
74
+ onClick: this.onDeleteOption,
75
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
76
+ className: "dtable-font dtable-icon-fork-number",
77
+ style: {
78
+ fontSize: '12px',
79
+ lineHeight: '20px'
80
+ }
81
+ })
82
+ })]
83
+ });
79
84
  }
80
85
  }
81
86
  SelectEditorOption.defaultProps = {
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
9
10
  class Alert extends _react.default.PureComponent {
10
11
  getIconClass(intent) {
11
12
  switch (intent) {
@@ -30,22 +31,30 @@ class Alert extends _react.default.PureComponent {
30
31
  onRemove
31
32
  } = this.props;
32
33
  const iconClass = this.getIconClass(intent);
33
- return /*#__PURE__*/_react.default.createElement("div", {
34
- className: "dtable-toast-alert-container ".concat(intent || 'success')
35
- }, /*#__PURE__*/_react.default.createElement("div", {
36
- className: "toast-alert-icon"
37
- }, /*#__PURE__*/_react.default.createElement("i", {
38
- className: iconClass
39
- })), /*#__PURE__*/_react.default.createElement("div", {
40
- className: "toast-text-container"
41
- }, /*#__PURE__*/_react.default.createElement("p", {
42
- className: "toast-text-title"
43
- }, title), children ? /*#__PURE__*/_react.default.createElement("p", {
44
- className: "toast-text-child"
45
- }, children) : null), isRemovable && /*#__PURE__*/_react.default.createElement("div", {
46
- onClick: onRemove,
47
- className: "toast-close"
48
- }, /*#__PURE__*/_react.default.createElement("span", null, "\xD7")));
34
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
35
+ className: "dtable-toast-alert-container ".concat(intent || 'success'),
36
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
37
+ className: "toast-alert-icon",
38
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
39
+ className: iconClass
40
+ })
41
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
42
+ className: "toast-text-container",
43
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
44
+ className: "toast-text-title",
45
+ children: title
46
+ }), children ? /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
47
+ className: "toast-text-child",
48
+ children: children
49
+ }) : null]
50
+ }), isRemovable && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
51
+ onClick: onRemove,
52
+ className: "toast-close",
53
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
54
+ children: "\xD7"
55
+ })
56
+ })]
57
+ });
49
58
  }
50
59
  }
51
60
  var _default = exports.default = Alert;
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
10
10
  var _alert = _interopRequireDefault(require("./alert"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
11
12
  const ANIMATION_DURATION = 240;
12
13
  class Toast extends _react.default.PureComponent {
13
14
  constructor() {
@@ -70,34 +71,37 @@ class Toast extends _react.default.PureComponent {
70
71
  this.clearCloseTimer();
71
72
  }
72
73
  render() {
73
- return /*#__PURE__*/_react.default.createElement(_Transition.default, {
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Transition.default, {
74
75
  appear: true,
75
76
  unmountOnExit: true,
76
77
  timeout: ANIMATION_DURATION,
77
78
  in: this.state.isShown,
78
- onExited: this.props.onRemove
79
- }, state => /*#__PURE__*/_react.default.createElement("div", {
80
- "data-state": state,
81
- className: "dtable-toast-container ".concat(state),
82
- onMouseEnter: this.handleMouseEnter,
83
- onMouseLeave: this.handleMouseLeave,
84
- style: {
85
- height: this.state.height,
86
- zIndex: this.props.zIndex,
87
- marginBottom: this.state.isShown ? 0 : -this.state.height
88
- }
89
- }, /*#__PURE__*/_react.default.createElement("div", {
90
- ref: this.onRef,
91
- style: {
92
- padding: 8
93
- }
94
- }, /*#__PURE__*/_react.default.createElement(_alert.default, {
95
- intent: this.props.intent,
96
- title: this.props.title,
97
- children: this.props.children || '',
98
- isRemovable: this.props.hasCloseButton,
99
- onRemove: event => this.close(event)
100
- }))));
79
+ onExited: this.props.onRemove,
80
+ children: state => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
81
+ "data-state": state,
82
+ className: "dtable-toast-container ".concat(state),
83
+ onMouseEnter: this.handleMouseEnter,
84
+ onMouseLeave: this.handleMouseLeave,
85
+ style: {
86
+ height: this.state.height,
87
+ zIndex: this.props.zIndex,
88
+ marginBottom: this.state.isShown ? 0 : -this.state.height
89
+ },
90
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
91
+ ref: this.onRef,
92
+ style: {
93
+ padding: 8
94
+ },
95
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_alert.default, {
96
+ intent: this.props.intent,
97
+ title: this.props.title,
98
+ children: this.props.children || '',
99
+ isRemovable: this.props.hasCloseButton,
100
+ onRemove: event => this.close(event)
101
+ })
102
+ })
103
+ })
104
+ });
101
105
  }
102
106
  }
103
107
  exports.default = Toast;
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _toast = _interopRequireDefault(require("./toast"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
10
11
  const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id');
11
12
  class ToastManager extends _react.default.PureComponent {
12
13
  constructor(props, context) {
@@ -90,19 +91,21 @@ class ToastManager extends _react.default.PureComponent {
90
91
  };
91
92
  }
92
93
  render() {
93
- return /*#__PURE__*/_react.default.createElement("div", {
94
- className: "dtable-toast-manager"
95
- }, this.state.toasts.map(_ref => {
96
- let {
97
- id,
98
- description,
99
- ...props
100
- } = _ref;
101
- return /*#__PURE__*/_react.default.createElement(_toast.default, Object.assign({
102
- key: id,
103
- onRemove: () => this.removeToast(id)
104
- }, props), description);
105
- }));
94
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
95
+ className: "dtable-toast-manager",
96
+ children: this.state.toasts.map(_ref => {
97
+ let {
98
+ id,
99
+ description,
100
+ ...props
101
+ } = _ref;
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_toast.default, {
103
+ onRemove: () => this.removeToast(id),
104
+ ...props,
105
+ children: description
106
+ }, id);
107
+ })
108
+ });
106
109
  }
107
110
  }
108
111
  exports.default = ToastManager;
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
  var _reactDom = _interopRequireDefault(require("react-dom"));
10
10
  var _toastManager = _interopRequireDefault(require("./toastManager"));
11
11
  require("./index.css");
12
+ var _jsxRuntime = require("react/jsx-runtime");
12
13
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
13
14
 
14
15
  /**
@@ -65,7 +66,7 @@ class Toaster {
65
66
  const container = document.createElement('div');
66
67
  container.setAttribute('data-evergreen-toaster-container', '');
67
68
  document.body.appendChild(container);
68
- _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_toastManager.default, {
69
+ _reactDom.default.render( /*#__PURE__*/(0, _jsxRuntime.jsx)(_toastManager.default, {
69
70
  bindNotify: this._bindNotify,
70
71
  bindGetToasts: this._bindGetToasts,
71
72
  bindCloseAll: this._bindCloseAll
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "5.0.9-beta.1",
3
+ "version": "5.0.9-beta.2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",