dtable-ui-component 4.4.30 → 4.4.32

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.
@@ -313,7 +313,7 @@ class FilterItem extends _react.default.Component {
313
313
  onSelectOption: _this.onSelectMultiple,
314
314
  placeholder: (0, _lang.getLocale)('Select_option(s)'),
315
315
  searchable: true,
316
- searchPlaceholder: (0, _lang.getLocale)('Find_an_option'),
316
+ searchPlaceholder: (0, _lang.getLocale)('Search_option'),
317
317
  noOptionsPlaceholder: (0, _lang.getLocale)('No_options_available'),
318
318
  supportMultipleSelect: isSupportMultipleSelect
319
319
  });
@@ -417,7 +417,7 @@ class FilterItem extends _react.default.Component {
417
417
  onSelectOption: this.onSelectSingle,
418
418
  placeholder: (0, _lang.getLocale)('Select_an_option'),
419
419
  searchable: true,
420
- searchPlaceholder: (0, _lang.getLocale)('Find_an_option'),
420
+ searchPlaceholder: (0, _lang.getLocale)('Search_option'),
421
421
  noOptionsPlaceholder: (0, _lang.getLocale)('No_options_available')
422
422
  });
423
423
  }
@@ -663,7 +663,7 @@ class FilterItem extends _react.default.Component {
663
663
  options: filterColumnOptions,
664
664
  onSelectOption: this.onSelectColumn,
665
665
  searchable: true,
666
- searchPlaceholder: (0, _lang.getLocale)('Find_column'),
666
+ searchPlaceholder: (0, _lang.getLocale)('Search_column'),
667
667
  noOptionsPlaceholder: (0, _lang.getLocale)('No_results')
668
668
  })), /*#__PURE__*/_react.default.createElement("div", {
669
669
  className: "filter-predicate ml-2 ".concat(_isCheckboxColumn ? 'filter-checkbox-predicate' : '')
@@ -138,7 +138,7 @@ function DepartmentMultipleSelect(props) {
138
138
  className: "form-control",
139
139
  type: "text",
140
140
  autoFocus: true,
141
- placeholder: (0, _lang.getLocale)('Find_a_department'),
141
+ placeholder: (0, _lang.getLocale)('Search_department'),
142
142
  value: searchVal,
143
143
  onChange: onChangeSearch,
144
144
  onClick: onClick
@@ -259,7 +259,7 @@ class DepartmentSingleSelect extends _react.Component {
259
259
  className: "form-control",
260
260
  type: "text",
261
261
  autoFocus: true,
262
- placeholder: (0, _lang.getLocale)('Find_a_department'),
262
+ placeholder: (0, _lang.getLocale)('Search_department'),
263
263
  value: this.state.searchVal,
264
264
  onChange: this.onChangeSearch,
265
265
  onClick: this.onStopPropagation
@@ -123,7 +123,7 @@ class MBLinkEditorPopover extends _react.default.Component {
123
123
  }, /*#__PURE__*/_react.default.createElement("input", {
124
124
  className: "form-control",
125
125
  type: "text",
126
- placeholder: (0, _lang.getLocale)('Find_an_option'),
126
+ placeholder: (0, _lang.getLocale)('Search_option'),
127
127
  value: searchVal,
128
128
  onChange: this.onChangeSearch,
129
129
  onClick: this.onInputClick
@@ -64,7 +64,7 @@ class PCLinkEditorPopover extends _react.default.Component {
64
64
  value: searchValue,
65
65
  onChange: this.onValueChanged,
66
66
  onClick: this.onInputClick,
67
- placeholder: (0, _lang.getLocale)('Find_an_option')
67
+ placeholder: (0, _lang.getLocale)('Search_option')
68
68
  })), /*#__PURE__*/_react.default.createElement("div", {
69
69
  className: "link-options-container"
70
70
  }, options.length > 0 && options.map((option, index) => {
@@ -63,20 +63,22 @@ class SimpleLongTextFormatter extends _react.default.Component {
63
63
  }
64
64
  return {};
65
65
  };
66
- this.clearTimer = () => {
67
- if (this.timer) {
68
- clearTimeout(this.timer);
69
- this.timer = null;
70
- }
66
+ this.clearOpenPreviewTimer = () => {
67
+ if (!this.openPreviewTimer) return;
68
+ clearTimeout(this.openPreviewTimer);
69
+ this.openPreviewTimer = null;
70
+ };
71
+ this.clearClosePreviewTimer = () => {
72
+ if (!this.closePreviewTimer) return;
73
+ clearTimeout(this.closePreviewTimer);
74
+ this.closePreviewTimer = null;
71
75
  };
72
76
  this.onMouseEnter = () => {
73
77
  // in case that there is no `modal-wrapper`
74
- if (!document.getElementById('modal-wrapper')) {
75
- return;
76
- }
77
- this.clearTimer();
78
+ if (!document.getElementById('modal-wrapper')) return;
79
+ this.clearOpenPreviewTimer();
78
80
  if (this.props.value) {
79
- this.timer = setTimeout(() => {
81
+ this.openPreviewTimer = setTimeout(() => {
80
82
  const style = this.ref.getBoundingClientRect();
81
83
  this.formatterStyle = style;
82
84
  this.setState({
@@ -86,7 +88,23 @@ class SimpleLongTextFormatter extends _react.default.Component {
86
88
  }
87
89
  };
88
90
  this.onMouseLeave = () => {
89
- this.clearTimer();
91
+ this.clearOpenPreviewTimer();
92
+
93
+ // Case 1: The mouse moves out of the cell and is not in the preview component, close the preview component after 2S
94
+ this.closePreviewTimer = setTimeout(() => {
95
+ if (this.state.isPreview) {
96
+ this.setState({
97
+ isPreview: false
98
+ });
99
+ }
100
+ }, 2000);
101
+ };
102
+ // Case 2: The mouse moves out of the cell and into the preview component, do not close the preview component
103
+ this.onPreviewMouseEnter = () => {
104
+ this.clearClosePreviewTimer();
105
+ };
106
+ // Case 2: The mouse move out of the preview component, close the preview component
107
+ this.onPreviewMouseLeave = () => {
90
108
  if (this.state.isPreview) {
91
109
  this.setState({
92
110
  isPreview: false
@@ -99,7 +117,8 @@ class SimpleLongTextFormatter extends _react.default.Component {
99
117
  };
100
118
  }
101
119
  componentWillUnmount() {
102
- this.clearTimer();
120
+ this.clearOpenPreviewTimer();
121
+ this.clearClosePreviewTimer();
103
122
  }
104
123
  render() {
105
124
  const {
@@ -119,7 +138,9 @@ class SimpleLongTextFormatter extends _react.default.Component {
119
138
  }, this.renderLinks(value), this.renderCheckList(value), this.renderImages(value), this.renderContent(value), isPreview && /*#__PURE__*/_react.default.createElement(_ModalPortal.default, null, /*#__PURE__*/_react.default.createElement(_LongTextPreview.default, {
120
139
  className: previewClassName,
121
140
  value: value,
122
- formatterStyle: this.formatterStyle
141
+ formatterStyle: this.formatterStyle,
142
+ onMouseEnter: this.onPreviewMouseEnter,
143
+ onMouseLeave: this.onPreviewMouseLeave
123
144
  })));
124
145
  }
125
146
  }
@@ -20,8 +20,11 @@ class LongTextPreview extends _react.default.PureComponent {
20
20
  left,
21
21
  top
22
22
  } = formatterStyle;
23
+ const {
24
+ height,
25
+ opacity
26
+ } = this.state;
23
27
  const width = 520;
24
- const height = this.state.height;
25
28
  const padding = 6;
26
29
  left = left - width > 0 ? left - width - 12 : 0;
27
30
  top = top - padding;
@@ -31,9 +34,15 @@ class LongTextPreview extends _react.default.PureComponent {
31
34
  return {
32
35
  left,
33
36
  top,
34
- opacity: this.state.opacity
37
+ opacity
35
38
  };
36
39
  };
40
+ this.onMouseEnter = e => {
41
+ this.props.onMouseEnter && this.props.onMouseEnter(e);
42
+ };
43
+ this.onMouseLeave = e => {
44
+ this.props.onMouseLeave && this.props.onMouseLeave(e);
45
+ };
37
46
  this.state = {
38
47
  height: 450,
39
48
  opacity: 0
@@ -41,13 +50,23 @@ class LongTextPreview extends _react.default.PureComponent {
41
50
  }
42
51
  componentDidMount() {
43
52
  setTimeout(() => {
53
+ var _value$images;
44
54
  if (!this.ref) return;
45
- const domHeight = this.ref.offsetHeight;
55
+ const {
56
+ value
57
+ } = this.props;
58
+
59
+ // If image is included, sets the preview height to the maximum height
60
+ const hasImage = (value === null || value === void 0 ? void 0 : (_value$images = value.images) === null || _value$images === void 0 ? void 0 : _value$images.length) >= 2 ? true : false;
61
+ let {
62
+ height: domHeight
63
+ } = this.ref.getBoundingClientRect();
64
+ domHeight = hasImage ? 450 : domHeight;
46
65
  this.setState({
47
- height: domHeight,
66
+ height: Math.min(domHeight, 450),
48
67
  opacity: 1
49
68
  });
50
- }, 0);
69
+ }, 10);
51
70
  }
52
71
  render() {
53
72
  const {
@@ -58,7 +77,9 @@ class LongTextPreview extends _react.default.PureComponent {
58
77
  return /*#__PURE__*/_react.default.createElement("div", {
59
78
  className: (0, _classnames.default)('longtext-modal-dialog longtext-preview', className),
60
79
  style: this.getStyle(),
61
- ref: ref => this.ref = ref
80
+ ref: ref => this.ref = ref,
81
+ onMouseEnter: this.onMouseEnter,
82
+ onMouseLeave: this.onMouseLeave
62
83
  }, /*#__PURE__*/_react.default.createElement("div", {
63
84
  className: "longtext-container longtext-container-scroll"
64
85
  }, /*#__PURE__*/_react.default.createElement(_dtableMarkdownViewer.default, {
@@ -339,10 +339,12 @@
339
339
 
340
340
  .longtext-preview .sf-slate-viewer-scroll-container .sf-slate-viewer-article-container {
341
341
  width: 100%;
342
+ margin: 0;
342
343
  }
343
344
 
344
345
  .longtext-preview .longtext-container .article {
345
346
  padding: 10px 16px;
347
+ border: unset;
346
348
  }
347
349
 
348
350
  .row-height-128 .longtext-formatter .article {
package/lib/locals/de.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const de = {
9
9
  "Add_an_option": "Fügen Sie eine Option hinzu",
10
- "Find_an_option": "Finden Sie eine Option",
10
+ "Search_option": "Finden Sie eine Option",
11
11
  "No_options_available": "Es sind keine Optionen verfügbar.",
12
12
  "Current_option": "Aktuelle Option",
13
13
  "No_option": "Keine Option",
@@ -24,7 +24,7 @@ const de = {
24
24
  "Are_you_sure_you_want_to_delete_this_image": "Möchten Sie das Bild wirklich löschen?",
25
25
  "Cancel": "Abbrechen",
26
26
  "Delete": "Löschen",
27
- "Find_a_department": "Bereich suchen",
27
+ "Search_department": "Bereich suchen",
28
28
  "No_departments_available": "Es sind keine Departments verfügbar.",
29
29
  "Current_user_department": "Department des aktuellen Benutzers",
30
30
  "Current_user_department_and_sub": "Bereich und Unterbereiche des aktuellen Benutzers",
@@ -38,7 +38,7 @@ const de = {
38
38
  "Add_a_creator": "Mitarbeiter hinzufügen",
39
39
  "Add_a_last_modifier": "Letzten Bearbeiter hinzufügen",
40
40
  "Invalid_filter": "Ungültiger Filter",
41
- "Find_column": "Spalte suchen",
41
+ "Search_column": "Spalte suchen",
42
42
  "No_results": "Keine Ergebnisse",
43
43
  "Select_option(s)": "Option(en) auswählen",
44
44
  "contains": "enthält",
package/lib/locals/en.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const en = {
9
9
  "Add_an_option": "Add an option",
10
- "Find_an_option": "Find a option",
10
+ "Search_option": "Search option",
11
11
  "No_options_available": "No options available",
12
12
  "Current_option": "Current option",
13
13
  "No_option": "No option",
@@ -24,7 +24,7 @@ const en = {
24
24
  "Are_you_sure_you_want_to_delete_this_image": "Are you sure you want to delete this image?",
25
25
  "Cancel": "Cancel",
26
26
  "Delete": "Delete",
27
- "Find_a_department": "Find a department",
27
+ "Search_department": "Search department",
28
28
  "No_departments_available": "No departments available",
29
29
  "Current_user_department": "Current user\"s department",
30
30
  "Current_user_department_and_sub": "Current user\"s department and sub-departments",
@@ -38,7 +38,7 @@ const en = {
38
38
  "Add_a_creator": "Add a creator",
39
39
  "Add_a_last_modifier": "Add a last modifier",
40
40
  "Invalid_filter": "Invalid filter",
41
- "Find_column": "Find column",
41
+ "Search_column": "Search column",
42
42
  "No_results": "No results",
43
43
  "Select_option(s)": "Select option(s)",
44
44
  "contains": "contains",
package/lib/locals/es.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const es = {
9
9
  "Add_an_option": "Add an option",
10
- "Find_an_option": "Find a option",
10
+ "Search_option": "Search option",
11
11
  "No_options_available": " No hay opciones disponibles",
12
12
  "Current_option": "Opción actual",
13
13
  "No_option": "Sin opciones",
@@ -24,7 +24,7 @@ const es = {
24
24
  "Are_you_sure_you_want_to_delete_this_file": "¿Está seguro de querer eliminar este archivo?",
25
25
  "Cancel": "Cancelar",
26
26
  "Delete": "Borrar",
27
- "Find_a_department": "Find a department",
27
+ "Search_department": "Search department",
28
28
  "No_departments_available": "No departments available",
29
29
  "Current_user_department": "Current user's department",
30
30
  "Current_user_department_and_sub": "Current user's department and sub-departments",
@@ -38,7 +38,7 @@ const es = {
38
38
  "Add_a_creator": "Añadir un creador",
39
39
  "Add_a_last_modifier": "Añadir un último en modificar",
40
40
  "Invalid_filter": "Filtro inválido",
41
- "Find_column": "Find column",
41
+ "Search_column": "Search column",
42
42
  "No_results": "Sin resultados.",
43
43
  "Select_option(s)": "Elegir opción(es)",
44
44
  "contains": "contiene",
package/lib/locals/fr.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const fr = {
9
9
  "Add_an_option": "Ajouter une option",
10
- "Find_an_option": "Trouver une option",
10
+ "Search_option": "Trouver une option",
11
11
  "No_options_available": "Il n'y a pas d'options disponibles.",
12
12
  "Current_option": "Option actuelle",
13
13
  "No_option": "Aucune option",
@@ -24,7 +24,7 @@ const fr = {
24
24
  "Are_you_sure_you_want_to_delete_this_file": "Êtes-vous sûr de vouloir supprimer ce fichier?",
25
25
  "Cancel": "Annuler",
26
26
  "Delete": "Supprimer",
27
- "Find_a_department": "Chercher un département",
27
+ "Search_department": "Chercher un département",
28
28
  "No_departments_available": "Aucun département n'est disponible.",
29
29
  "Current_user_department": "Département de l'utilisateur actuel",
30
30
  "Current_user_department_and_sub": "Département et sous-départements de l'utilisateur actuel",
@@ -38,7 +38,7 @@ const fr = {
38
38
  "Add_a_creator": "Ajouter un créateur",
39
39
  "Add_a_last_modifier": "Ajouter un dernier éditeur",
40
40
  "Invalid_filter": "Filtre invalide",
41
- "Find_column": "Rechercher une colonne",
41
+ "Search_column": "Rechercher une colonne",
42
42
  "No_results": "Aucun résultat",
43
43
  "Select_option(s)": "Selectionner une ou plusieurs options",
44
44
  "contains": "contient",
package/lib/locals/pt.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const pt = {
9
9
  "Add_an_option": "Adicione uma opção",
10
- "Find_an_option": "Encontre uma opção",
10
+ "Search_option": "Encontre uma opção",
11
11
  "No_options_available": "Sem opções disponíveis",
12
12
  "Current_option": "Opção atual",
13
13
  "No_option": "Nenhuma opção",
@@ -24,7 +24,7 @@ const pt = {
24
24
  "Are_you_sure_you_want_to_delete_this_file": "Tem certeza de que deseja excluir este arquivo?",
25
25
  "Cancel": "Cancelar",
26
26
  "Delete": "Excluir",
27
- "Find_a_department": "Find a department",
27
+ "Search_department": "Search department",
28
28
  "No_departments_available": "No departments available",
29
29
  "Current_user_department": "Current user's department",
30
30
  "Current_user_department_and_sub": "Current user's department and sub-departments",
@@ -38,7 +38,7 @@ const pt = {
38
38
  "Add_a_creator": "Adicione um Criador",
39
39
  "Add_a_last_modifier": "Adicione um último modificador",
40
40
  "Invalid_filter": "Filtro inválido",
41
- "Find_column": "Encontrar coluna",
41
+ "Search_column": "Encontrar coluna",
42
42
  "No_results": "Sem resultados.",
43
43
  "Select_option(s)": "Selecione as opções)",
44
44
  "contains": "contém",
package/lib/locals/ru.js CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const ru = {
9
9
  "Add_an_option": "Add an option",
10
- "Find_an_option": "Find a option",
10
+ "Search_option": "Search option",
11
11
  "No_options_available": "Нет доступных вариантов.",
12
12
  "Current_option": "Текущая опция",
13
13
  "No_option": "Нет опций",
@@ -24,7 +24,7 @@ const ru = {
24
24
  "Are_you_sure_you_want_to_delete_this_file": "Are you sure you want to delete this file?",
25
25
  "Cancel": "Отменить",
26
26
  "Delete": "Удалить",
27
- "Find_a_department": "Find a department",
27
+ "Search_department": "Search department",
28
28
  "No_departments_available": "No departments available",
29
29
  "Current_user_department": "Current user's department",
30
30
  "Current_user_department_and_sub": "Current user's department and sub-departments",
@@ -38,7 +38,7 @@ const ru = {
38
38
  "Add_a_creator": "Добавить создателя",
39
39
  "Add_a_last_modifier": "Добавить последний изменивший",
40
40
  "Invalid_filter": "Invalid filter",
41
- "Find_column": "Find column",
41
+ "Search_column": "Search column",
42
42
  "No_results": "Нет результатов.",
43
43
  "Select_option(s)": "Выберите опцию(и)",
44
44
  "contains": "содержит",
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  /* eslint-disable quotes */
8
8
  const zh_CN = {
9
9
  "Add_an_option": "添加一个选项",
10
- "Find_an_option": "查找标签",
10
+ "Search_option": "查找标签",
11
11
  "No_options_available": "没有找到标签。",
12
12
  "Current_option": "当前标签",
13
13
  "No_option": "没有标签",
@@ -24,7 +24,7 @@ const zh_CN = {
24
24
  "Are_you_sure_you_want_to_delete_this_image": "你确定要删除此图片吗?",
25
25
  "Cancel": "取消",
26
26
  "Delete": "删除",
27
- "Find_a_department": "查找部门",
27
+ "Search_department": "查找部门",
28
28
  "No_departments_available": "没有可用的部门",
29
29
  "Current_user_department": "当前用户的部门",
30
30
  "Current_user_department_and_sub": "当前用户的部门和子部门",
@@ -38,7 +38,7 @@ const zh_CN = {
38
38
  "Add_a_creator": "增加创建者",
39
39
  "Add_a_last_modifier": "增加最后修改者",
40
40
  "Invalid_filter": "无效的过滤器",
41
- "Find_column": "查找列",
41
+ "Search_column": "查找列",
42
42
  "No_results": "没有结果",
43
43
  "Select_option(s)": "选择标签",
44
44
  "contains": "包含",
@@ -166,7 +166,7 @@ class MBSelectEditorPopover extends _react.default.Component {
166
166
  }, /*#__PURE__*/_react.default.createElement("input", {
167
167
  className: "form-control",
168
168
  type: "text",
169
- placeholder: (0, _lang.getLocale)('Find_an_option'),
169
+ placeholder: (0, _lang.getLocale)('Search_option'),
170
170
  value: searchVal,
171
171
  onChange: this.onChangeSearch,
172
172
  onClick: this.onInputClick
@@ -81,7 +81,7 @@ class PCSelectEditorPopover extends _react.default.Component {
81
81
  className: "form-control",
82
82
  onChange: this.onValueChanged,
83
83
  onClick: this.onInputClick,
84
- placeholder: (0, _lang.getLocale)('Find_an_option')
84
+ placeholder: (0, _lang.getLocale)('Search_option')
85
85
  })), /*#__PURE__*/_react.default.createElement("div", {
86
86
  className: "select-options-container"
87
87
  }, options.length > 0 && options.map((option, index) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "4.4.30",
3
+ "version": "4.4.32",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.5",