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

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 +3 -5
  2. package/lib/ButtonFormatter/index.js +5 -9
  3. package/lib/CTimeFormatter/index.js +3 -5
  4. package/lib/CheckboxEditor/index.js +12 -15
  5. package/lib/CheckboxFormatter/index.js +5 -7
  6. package/lib/CollaboratorEditor/index.js +37 -46
  7. package/lib/CollaboratorEditor/mb-collaborator-editor-popover/index.js +47 -60
  8. package/lib/CollaboratorEditor/pc-collaborator-editor-popover/index.js +31 -37
  9. package/lib/CollaboratorFormatter/index.js +7 -8
  10. package/lib/CollaboratorItem/index.js +16 -21
  11. package/lib/CollapsibleSettingLayout/index.js +14 -18
  12. package/lib/CreatorFormatter/index.js +7 -8
  13. package/lib/DTableCommonAddTool/index.js +7 -10
  14. package/lib/DTableCustomizeCollaboratorSelect/index.js +32 -38
  15. package/lib/DTableCustomizeSelect/index.js +44 -51
  16. package/lib/DTableFiltersPopover/index.js +41 -46
  17. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +51 -67
  18. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +49 -64
  19. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-multiple-select-filter.js +32 -38
  20. package/lib/DTableFiltersPopover/widgets/department-select-filter/department-single-select-filter.js +34 -42
  21. package/lib/DTableFiltersPopover/widgets/filter-calendar.js +31 -35
  22. package/lib/DTableFiltersPopover/widgets/filter-item.js +76 -92
  23. package/lib/DTableFiltersPopover/widgets/filter-list/index.js +17 -19
  24. package/lib/DTableFiltersPopover/widgets/rate-item.js +9 -12
  25. package/lib/DTablePopover/index.js +6 -9
  26. package/lib/DTableRadio/index.js +17 -20
  27. package/lib/DTableSearchInput/index.js +18 -22
  28. package/lib/DTableSelect/dtable-select-label.js +7 -12
  29. package/lib/DTableSelect/index.js +1 -2
  30. package/lib/DTableSelect/utils.js +13 -26
  31. package/lib/DTableSwitch/index.js +16 -20
  32. package/lib/DateEditor/index.js +36 -46
  33. package/lib/DateEditor/mb-date-editor-popover/index.js +63 -80
  34. package/lib/DateEditor/pc-date-editor-popover.js +22 -25
  35. package/lib/DateFormatter/index.js +3 -5
  36. package/lib/Department-editor/department-multiple-select/index.js +42 -49
  37. package/lib/Department-editor/department-single-select.js +54 -70
  38. package/lib/Department-editor/index.js +14 -18
  39. package/lib/Department-editor/selected-departments/index.js +44 -54
  40. package/lib/DepartmentSelectFilter/index.js +1 -8
  41. package/lib/DepartmentSingleSelectFormatter/index.js +9 -13
  42. package/lib/DigitalSignFormatter/index.js +17 -21
  43. package/lib/DurationFormatter/index.js +5 -7
  44. package/lib/EditEditorButton/index.js +3 -5
  45. package/lib/EmailFormatter/index.js +3 -5
  46. package/lib/FieldDisplaySetting/field-item.js +19 -25
  47. package/lib/FieldDisplaySetting/index.js +38 -47
  48. package/lib/FileEditor/index.js +7 -10
  49. package/lib/FileFormatter/index.js +15 -18
  50. package/lib/FileItemFormatter/index.js +1 -2
  51. package/lib/FileUploader/index.js +1 -2
  52. package/lib/FormulaFormatter/index.js +14 -21
  53. package/lib/GeolocationFormatter/index.js +6 -8
  54. package/lib/HtmlLongTextFormatter/index.js +1 -2
  55. package/lib/ImageFormatter/images-lazy-load.js +6 -7
  56. package/lib/ImageFormatter/index.js +29 -35
  57. package/lib/ImagePreviewerLightbox/index.js +8 -12
  58. package/lib/LastModifierFormatter/index.js +7 -8
  59. package/lib/LinkEditor/index.js +32 -38
  60. package/lib/LinkEditor/link-editor-option.js +20 -25
  61. package/lib/LinkEditor/mb-link-editor-popover/index.js +41 -53
  62. package/lib/LinkEditor/pc-link-editor-popover/index.js +33 -41
  63. package/lib/LinkFormatter/index.js +10 -13
  64. package/lib/Loading/index.js +1 -2
  65. package/lib/LongTextFormatter/index.js +2 -3
  66. package/lib/MBEditorHeader/index.js +14 -19
  67. package/lib/MTimeFormatter/index.js +3 -5
  68. package/lib/MultipleSelectEditor/index.js +37 -43
  69. package/lib/MultipleSelectFormatter/index.js +7 -8
  70. package/lib/NotificationPopover/index.js +32 -43
  71. package/lib/NumberEditor/index.js +20 -24
  72. package/lib/NumberFormatter/index.js +3 -5
  73. package/lib/RateFormatter/index.js +6 -7
  74. package/lib/RoleStatusEditor/index.js +30 -35
  75. package/lib/RowExpandEmailFormatter/index.js +8 -11
  76. package/lib/RowExpandFileFormatter/index.js +13 -14
  77. package/lib/RowExpandFileFormatter/row-expand-file-item-formatter.js +36 -43
  78. package/lib/RowExpandFormatter/index.js +112 -129
  79. package/lib/RowExpandFormulaFormatter/index.js +29 -37
  80. package/lib/RowExpandImageFormatter/index.js +26 -29
  81. package/lib/RowExpandImageFormatter/row-expand-image-item-formatter.js +39 -47
  82. package/lib/RowExpandLinkFormatter/collaborator-item-formatter.js +1 -2
  83. package/lib/RowExpandLinkFormatter/index.js +67 -70
  84. package/lib/RowExpandRateFormatter/index.js +6 -7
  85. package/lib/RowExpandUrlFormatter/index.js +8 -11
  86. package/lib/SelectItem/index.js +3 -5
  87. package/lib/SelectOptionGroup/index.js +31 -38
  88. package/lib/SelectOptionGroup/option.js +3 -5
  89. package/lib/SimpleLongTextFormatter/index.js +30 -39
  90. package/lib/SimpleLongTextFormatter/widgets/LongTextPreview.js +8 -11
  91. package/lib/SimpleLongTextFormatter/widgets/dtable-markdown-viewer.js +2 -3
  92. package/lib/SingleSelectEditor/index.js +34 -42
  93. package/lib/SingleSelectFormatter/index.js +4 -6
  94. package/lib/TextEditor/index.js +1 -2
  95. package/lib/TextFormatter/index.js +3 -5
  96. package/lib/UrlFormatter/index.js +3 -5
  97. package/lib/common/delete-tip.js +19 -27
  98. package/lib/formatterConfig/base-formatter-config.js +22 -23
  99. package/lib/formatterConfig/index.js +2 -3
  100. package/lib/select-editor/mb-select-editor-popover/index.js +64 -84
  101. package/lib/select-editor/pc-select-editor-popover/index.js +39 -50
  102. package/lib/select-editor/select-editor-option.js +19 -24
  103. package/lib/toaster/alert.js +16 -25
  104. package/lib/toaster/toast.js +24 -28
  105. package/lib/toaster/toastManager.js +13 -16
  106. package/lib/toaster/toaster.js +1 -2
  107. package/package.json +1 -1
@@ -8,7 +8,6 @@ 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");
12
11
  class PCSelectEditorPopover extends _react.default.Component {
13
12
  constructor(props) {
14
13
  super(props);
@@ -73,56 +72,46 @@ class PCSelectEditorPopover extends _react.default.Component {
73
72
  }, {
74
73
  position: 'absolute'
75
74
  });
76
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
75
+ return /*#__PURE__*/_react.default.createElement("div", {
77
76
  className: "dtable-ui-editor-popover dtable-ui-select-editor-popover",
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
- });
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)));
126
115
  }
127
116
  }
128
117
  PCSelectEditorPopover.defaultProps = {
@@ -6,7 +6,6 @@ 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");
10
9
  class SelectEditorOption extends _react.default.Component {
11
10
  constructor() {
12
11
  super(...arguments);
@@ -57,30 +56,26 @@ class SelectEditorOption extends _react.default.Component {
57
56
  let containerStyle = this.getContainerStyle();
58
57
  let optionStyle = this.getOptionStyle(option);
59
58
  let operationStyle = this.getOperationStyle(option);
60
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
59
+ return /*#__PURE__*/_react.default.createElement("div", {
61
60
  className: "dtable-ui select-option-item",
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
- });
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
+ })));
84
79
  }
85
80
  }
86
81
  SelectEditorOption.defaultProps = {
@@ -6,7 +6,6 @@ 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");
10
9
  class Alert extends _react.default.PureComponent {
11
10
  getIconClass(intent) {
12
11
  switch (intent) {
@@ -31,30 +30,22 @@ class Alert extends _react.default.PureComponent {
31
30
  onRemove
32
31
  } = this.props;
33
32
  const iconClass = this.getIconClass(intent);
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
- });
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")));
58
49
  }
59
50
  }
60
51
  var _default = exports.default = Alert;
@@ -8,7 +8,6 @@ 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");
12
11
  const ANIMATION_DURATION = 240;
13
12
  class Toast extends _react.default.PureComponent {
14
13
  constructor() {
@@ -71,37 +70,34 @@ class Toast extends _react.default.PureComponent {
71
70
  this.clearCloseTimer();
72
71
  }
73
72
  render() {
74
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Transition.default, {
73
+ return /*#__PURE__*/_react.default.createElement(_Transition.default, {
75
74
  appear: true,
76
75
  unmountOnExit: true,
77
76
  timeout: ANIMATION_DURATION,
78
77
  in: this.state.isShown,
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
- });
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
+ }))));
105
101
  }
106
102
  }
107
103
  exports.default = Toast;
@@ -7,7 +7,6 @@ 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");
11
10
  const hasCustomId = settings => Object.hasOwnProperty.call(settings, 'id');
12
11
  class ToastManager extends _react.default.PureComponent {
13
12
  constructor(props, context) {
@@ -91,21 +90,19 @@ class ToastManager extends _react.default.PureComponent {
91
90
  };
92
91
  }
93
92
  render() {
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
- });
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
+ }));
109
106
  }
110
107
  }
111
108
  exports.default = ToastManager;
@@ -9,7 +9,6 @@ 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");
13
12
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
14
13
 
15
14
  /**
@@ -66,7 +65,7 @@ class Toaster {
66
65
  const container = document.createElement('div');
67
66
  container.setAttribute('data-evergreen-toaster-container', '');
68
67
  document.body.appendChild(container);
69
- _reactDom.default.render( /*#__PURE__*/(0, _jsxRuntime.jsx)(_toastManager.default, {
68
+ _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_toastManager.default, {
70
69
  bindNotify: this._bindNotify,
71
70
  bindGetToasts: this._bindGetToasts,
72
71
  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.2",
3
+ "version": "5.0.9-beta.3",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",