dtable-ui-component 0.3.21-beta.1 → 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.
@@ -6,7 +6,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
6
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
7
7
  import React from 'react';
8
8
  import classnames from 'classnames';
9
- import { TextFormatter, NumberFormatter, CheckboxFormatter, DateFormatter, SingleSelectFormatter, MultipleSelectFormatter, CollaboratorFormatter, LongTextFormatter, GeolocationFormatter, CTimeFormatter, CreatorFormatter, LastModifierFormatter, MTimeFormatter, AutoNumberFormatter, DurationFormatter, ButtonFormatter, RowExpandUrlFormatter, RowExpandEmailFormatter, RowExpandRateFormatter, RowExpandImageFormatter, RowExpandFileFormatter, RowExpandLinkFormatter, RowExpandFormulaFormatter, DigitalSignFormatter, DepartmentSingleSelectFormatter } from '../index';
9
+ import { TextFormatter, NumberFormatter, CheckboxFormatter, DateFormatter, SingleSelectFormatter, MultipleSelectFormatter, CollaboratorFormatter, LongTextFormatter, GeolocationFormatter, CTimeFormatter, CreatorFormatter, LastModifierFormatter, MTimeFormatter, AutoNumberFormatter, DurationFormatter, ButtonFormatter, RowExpandUrlFormatter, RowExpandEmailFormatter, RowExpandRateFormatter, RowExpandImageFormatter, RowExpandFileFormatter, RowExpandLinkFormatter, RowExpandFormulaFormatter, DigitalSignFormatter } from '../index';
10
10
  import { CellType } from '../constants';
11
11
  import './index.css';
12
12
  var EditorFormatter = /*#__PURE__*/function (_React$Component) {
@@ -326,13 +326,6 @@ var EditorFormatter = /*#__PURE__*/function (_React$Component) {
326
326
  config: _this.props.config
327
327
  });
328
328
  }
329
- case CellType.DEPARTMENT_SINGLE_SELECT:
330
- {
331
- return /*#__PURE__*/React.createElement(DepartmentSingleSelectFormatter, {
332
- value: cellValue,
333
- departments: _this.props.departments
334
- });
335
- }
336
329
  default:
337
330
  return null;
338
331
  }
@@ -4,6 +4,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
4
4
  import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
  import React, { Component } from 'react';
6
6
  import { Tooltip } from 'reactstrap';
7
+ import MediaQuery from 'react-responsive';
7
8
  import { getLocale } from '../lang';
8
9
  import DeleteTip from '../common/delete-tip';
9
10
  var RowExpandImageItemFormatter = /*#__PURE__*/function (_Component) {
@@ -91,7 +92,9 @@ var RowExpandImageItemFormatter = /*#__PURE__*/function (_Component) {
91
92
  toggle: this.closeDeleteTip,
92
93
  onDelete: this.onDelete,
93
94
  deleteTip: getLocale('Are_you_sure_you_want_to_delete_this_image')
94
- }), /*#__PURE__*/React.createElement(Tooltip, {
95
+ }), /*#__PURE__*/React.createElement(MediaQuery, {
96
+ query: '(min-width: 768px)'
97
+ }, /*#__PURE__*/React.createElement(Tooltip, {
95
98
  placement: "bottom",
96
99
  isOpen: this.state.isTooltipOpen,
97
100
  toggle: this.toggleTooltip,
@@ -101,7 +104,7 @@ var RowExpandImageItemFormatter = /*#__PURE__*/function (_Component) {
101
104
  hide: 0
102
105
  },
103
106
  fade: false
104
- }, name));
107
+ }, name)));
105
108
  }
106
109
  }]);
107
110
  return RowExpandImageItemFormatter;
@@ -90,7 +90,6 @@ var DTABLE_VALUE = {
90
90
  'row_id': 'CU3j3PNyQaetnLWyiizURg',
91
91
  'display_value': '第二行'
92
92
  }],
93
- '9zu5': 1,
94
93
  'mFuA': {
95
94
  'username': 'bing.an@seafile.com',
96
95
  'sign_image_url': '/digital-signs/2023-06/bing.an%40seafile.com-1687316234288.png',
@@ -1260,26 +1259,6 @@ var DTABLE_VALUE = {
1260
1259
  'props': {},
1261
1260
  '_owner': null
1262
1261
  }
1263
- }, {
1264
- 'key': '9zu5',
1265
- 'name': '部门单选',
1266
- 'type': 'department-single-select',
1267
- 'width': 200,
1268
- 'editable': true,
1269
- 'resizable': true,
1270
- 'frozen': false,
1271
- 'editor': {
1272
- 'key': null,
1273
- 'ref': null,
1274
- 'props': {},
1275
- '_owner': null
1276
- },
1277
- 'formatter': {
1278
- 'key': null,
1279
- 'ref': null,
1280
- 'props': {},
1281
- '_owner': null
1282
- }
1283
1262
  }],
1284
1263
  'view_structure': {
1285
1264
  'folders': [{
@@ -2709,25 +2688,6 @@ var DTABLE_VALUE = {
2709
2688
  'header_settings': {}
2710
2689
  }]
2711
2690
  };
2712
- var DEPARTMENTS = [{
2713
- id: 1,
2714
- id_in_org: 1,
2715
- name: '海文互知',
2716
- org_id: -1,
2717
- parent_id: -1
2718
- }, {
2719
- id: 2,
2720
- id_in_org: 2,
2721
- name: '产品组',
2722
- org_id: -1,
2723
- parent_id: 1
2724
- }, {
2725
- id: 3,
2726
- id_in_org: 3,
2727
- name: '研发组',
2728
- org_id: -1,
2729
- parent_id: 1
2730
- }];
2731
2691
  var COLLABORATORS = [{
2732
2692
  'avatar_url': 'https://dev.seatable.cn/image-view/avatars/0/0/916e1e9e7c6184061cb7d96a680292/resized/80/de58ef113a311d390934b06ceafd77cf.png',
2733
2693
  'contact_email': '',
@@ -2762,4 +2722,4 @@ var SIGN_CONFIG = {
2762
2722
  workspaceID: 3,
2763
2723
  dtableUuid: '8327efbf-c9ff-4a14-9010-00e801a7e295'
2764
2724
  };
2765
- export { DTABLE_VALUE, COLLABORATORS, DEPARTMENTS, SIGN_CONFIG };
2725
+ export { DTABLE_VALUE, COLLABORATORS, SIGN_CONFIG };
package/lib/index.js CHANGED
@@ -34,7 +34,6 @@ export { default as ImagePreviewerLightbox } from './ImagePreviewerLightbox';
34
34
  export { default as CollaboratorItem } from './CollaboratorItem';
35
35
  export { default as FileItemFormatter } from './FileItemFormatter';
36
36
  export { default as DigitalSignFormatter } from './DigitalSignFormatter';
37
- export { default as DepartmentSingleSelectFormatter } from './DepartmentSingleSelectFormatter';
38
37
  export { default as SimpleLongTextFormatter } from './SimpleLongTextFormatter';
39
38
 
40
39
  // row expand formatter
package/lib/locals/en.js CHANGED
@@ -16,7 +16,6 @@ var en = {
16
16
  Are_you_sure_you_want_to_delete_this_file: 'Are you sure you want to delete this file?',
17
17
  Are_you_sure_you_want_to_delete_this_image: 'Are you sure you want to delete this image?',
18
18
  Cancel: 'Cancel',
19
- Delete: 'Delete',
20
- Deleted_department: 'Deleted department'
19
+ Delete: 'Delete'
21
20
  };
22
21
  export default en;
@@ -16,7 +16,6 @@ var zh_CN = {
16
16
  Are_you_sure_you_want_to_delete_this_file: '你确定要删除此文件吗?',
17
17
  Are_you_sure_you_want_to_delete_this_image: '你确定要删除此图片吗?',
18
18
  Cancel: '取消',
19
- Delete: '删除',
20
- Deleted_department: '已删除的部门'
19
+ Delete: '删除'
21
20
  };
22
21
  export default zh_CN;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "0.3.21-beta.1",
3
+ "version": "0.3.21",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "2.0.4",
@@ -11,7 +11,7 @@
11
11
  "classnames": "^2.3.2",
12
12
  "dayjs": "1.10.7",
13
13
  "deepmerge": "^2.1.0",
14
- "dtable-utils": "4.2.5",
14
+ "dtable-utils": "4.2.4",
15
15
  "glamor": "^2.20.40",
16
16
  "hast-util-sanitize": "^1.1.2",
17
17
  "hast-util-to-html": "3.1.0",
@@ -1,29 +0,0 @@
1
- @import url('../css/cell-formatter.css');
2
-
3
- .department-single-select-formatter {
4
- display: inline-flex;
5
- align-items: center;
6
- height: 20px;
7
- padding: 0 8px 0 2px;
8
- font-size: 13px;
9
- border-radius: 10px;
10
- background: #eaeaea;
11
- }
12
-
13
- .department-single-select-formatter .department-avatar-container {
14
- width: 18px;
15
- height: 18px;
16
- background: #ff8000;
17
- border-radius: 50%;
18
- padding: 2px 2px 3px 2px;
19
- }
20
-
21
- .department-single-select-formatter .department-avatar-container span {
22
- font-size: 12px;
23
- color: #fff;
24
- }
25
-
26
- .department-single-select-formatter .department-name {
27
- margin-left: 4px;
28
- flex: 1 1;
29
- }
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { getLocale } from '../lang';
3
- import './index.css';
4
- function DepartmentSingleSelectFormatter(props) {
5
- var value = props.value,
6
- departments = props.departments;
7
- if (!value) return null;
8
- var department = departments.find(function (department) {
9
- return department.id === value;
10
- });
11
- var name = department ? department.name : getLocale('Deleted_department');
12
- return /*#__PURE__*/React.createElement("div", {
13
- className: "department-single-select-formatter text-truncate"
14
- }, /*#__PURE__*/React.createElement("div", {
15
- className: "department-avatar-container d-flex align-items-center justify-content-center"
16
- }, /*#__PURE__*/React.createElement("span", {
17
- className: "dtable-font dtable-icon-department-single-selection"
18
- })), /*#__PURE__*/React.createElement("span", {
19
- className: "department-name text-truncate"
20
- }, name));
21
- }
22
- export default DepartmentSingleSelectFormatter;