dtable-ui-component 7.0.1-beta.5 → 7.0.1-beta.btn2

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 (45) hide show
  1. package/lib/AsyncUserSelect/index.css +28 -38
  2. package/lib/AsyncUserSelect/index.js +18 -29
  3. package/lib/DTableCustomizeCollaboratorSelect/index.css +86 -0
  4. package/lib/DTableCustomizeCollaboratorSelect/index.js +158 -0
  5. package/lib/DTableCustomizeSelect/index.css +42 -120
  6. package/lib/DTableCustomizeSelect/index.js +6 -12
  7. package/lib/DTableFiltersPopover/index.js +9 -8
  8. package/lib/DTableFiltersPopover/utils/filter-item-utils.js +19 -7
  9. package/lib/DTableFiltersPopover/widgets/collaborator-filter/index.js +9 -5
  10. package/lib/DTableFiltersPopover/widgets/filter-group.js +1 -1
  11. package/lib/DTableFiltersPopover/widgets/filter-item.js +8 -16
  12. package/lib/DTableFiltersPopover/widgets/filter-list/index.css +8 -8
  13. package/lib/DTableGroupSelect/index.css +96 -0
  14. package/lib/DTableGroupSelect/index.js +131 -0
  15. package/lib/DTableGroupSelect/option.js +42 -0
  16. package/lib/DTableGroupSelect/select-option-group.css +54 -0
  17. package/lib/DTableGroupSelect/select-option-group.js +227 -0
  18. package/lib/DTableModalHeader/index.js +3 -10
  19. package/lib/DTableSelect/dtable-select-label.css +3 -8
  20. package/lib/DTableSelect/dtable-select-label.js +1 -1
  21. package/lib/DTableSelect/index.js +3 -3
  22. package/lib/DTableSelect/user-select.css +46 -7
  23. package/lib/DTableSelect/utils.js +79 -166
  24. package/lib/FieldDisplaySetting/index.js +1 -1
  25. package/lib/ImageEditor/images-previewer/image-preview/index.js +2 -1
  26. package/lib/ImageEditor/pc-editor/addition-previewer/local-image-addition/index.js +2 -2
  27. package/lib/ImageFormatter/images-lazy-load.js +2 -2
  28. package/lib/ImageFormatter/index.js +5 -2
  29. package/lib/ImagePreviewerLightbox/index.js +2 -1
  30. package/lib/ImageThumbnail/index.js +2 -1
  31. package/lib/SelectItem/index.js +1 -1
  32. package/lib/SelectOptionGroup/KeyCodes.js +4 -96
  33. package/lib/SelectOptionGroup/index.css +54 -44
  34. package/lib/SelectOptionGroup/index.js +18 -35
  35. package/lib/SelectOptionGroup/option.js +4 -16
  36. package/lib/index.js +10 -3
  37. package/lib/utils/url.js +10 -35
  38. package/package.json +2 -2
  39. package/lib/DTableCustomizeSearchInput/index.css +0 -75
  40. package/lib/DTableCustomizeSearchInput/index.js +0 -133
  41. package/lib/DTableModalHeader/index.css +0 -22
  42. package/lib/DTableSelect/select-dropdown-indicator/index.css +0 -16
  43. package/lib/DTableSelect/select-dropdown-indicator/index.js +0 -24
  44. package/lib/assets/icons/close.svg +0 -1
  45. package/lib/assets/icons/down.svg +0 -3
package/lib/utils/url.js CHANGED
@@ -3,7 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.needUseThumbnailImage = exports.isTargetUrl = exports.isInternalURL = exports.isInternalImg = exports.isDigitalSignsUrl = exports.isCustomAssetUrl = exports.isBase64 = exports.isAIUrl = exports.imageCheck = exports.getValidFileImageUrls = exports.getImageThumbnailUrl = exports.getFileThumbnailInfo = exports.getFileSuffix = exports.getFileName = exports.getFileIconUrl = exports.generateCurrentBaseImageUrl = exports.generateCurrentBaseImageThumbnailUrl = exports.checkSVGImage = exports.checkImgExists = void 0;
6
+ exports.needUseThumbnailImage = exports.isTargetUrl = exports.isInternalURL = exports.isInternalImg = exports.isDigitalSignsUrl = exports.isCustomAssetUrl = exports.isBase64 = exports.isAIUrl = exports.imageCheck = exports.getValidFileImageUrls = exports.getFileThumbnailInfo = exports.getFileSuffix = exports.getFileName = exports.getFileIconUrl = exports.generateCurrentBaseImageUrl = exports.generateCurrentBaseImageThumbnailUrl = exports.checkSVGImage = exports.checkImgExists = void 0;
7
+ var _dtableUtils = require("dtable-utils");
7
8
  var _file = require("../constants/file");
8
9
  const isTargetUrl = (target, url) => {
9
10
  if (!url || typeof url !== 'string') return false;
@@ -95,32 +96,6 @@ const generateCurrentBaseImageUrl = _ref2 => {
95
96
  return "".concat(validServer, "/workspace/").concat(workspaceID, "/asset/").concat(dtableUuid).concat(partUrl);
96
97
  };
97
98
  exports.generateCurrentBaseImageUrl = generateCurrentBaseImageUrl;
98
- const getImageThumbnailUrl = function (url) {
99
- let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
100
- server = _ref3.server,
101
- dtableUuid = _ref3.dtableUuid,
102
- workspaceID = _ref3.workspaceID,
103
- _ref3$size = _ref3.size,
104
- size = _ref3$size === void 0 ? 256 : _ref3$size;
105
- if (!url || typeof url !== 'string') return '';
106
- if (server && dtableUuid && isCustomAssetUrl(url)) {
107
- const assetUuid = url.slice(url.lastIndexOf('/') + 1, url.lastIndexOf('.'));
108
- return server + '/dtable/' + dtableUuid + '/custom-asset-thumbnail/' + assetUuid + '?size=' + size;
109
- }
110
- if (isAIUrl(url) || checkSVGImage(url) || !isInternalImg(url) || isBase64(url)) return url;
111
- if (server && workspaceID && dtableUuid && isDigitalSignsUrl(url)) {
112
- return generateCurrentBaseImageThumbnailUrl({
113
- server,
114
- workspaceID,
115
- dtableUuid,
116
- size,
117
- partUrl: url
118
- });
119
- }
120
- if (url.includes('/thumbnail/workspace')) return url;
121
- return url.replace('/workspace', '/thumbnail/workspace') + '?size=' + size;
122
- };
123
- exports.getImageThumbnailUrl = getImageThumbnailUrl;
124
99
  const getFileName = url => {
125
100
  if (!url) return null;
126
101
  let validUrl = url;
@@ -145,9 +120,9 @@ const imageCheck = filename => {
145
120
  };
146
121
  exports.imageCheck = imageCheck;
147
122
  const isInternalURL = function (url) {
148
- let _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
149
- _ref4$server = _ref4.server,
150
- server = _ref4$server === void 0 ? '' : _ref4$server;
123
+ let _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
124
+ _ref3$server = _ref3.server,
125
+ server = _ref3$server === void 0 ? '' : _ref3$server;
151
126
  if (!url || typeof url !== 'string') return false;
152
127
  return server && url.indexOf(server) > -1;
153
128
  };
@@ -182,10 +157,10 @@ const getFileIconUrl = (filename, direntType) => {
182
157
  };
183
158
  exports.getFileIconUrl = getFileIconUrl;
184
159
  const getFileThumbnailInfo = function (file) {
185
- let _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
186
- server = _ref5.server,
187
- dtableUuid = _ref5.dtableUuid,
188
- workspaceID = _ref5.workspaceID;
160
+ let _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
161
+ server = _ref4.server,
162
+ dtableUuid = _ref4.dtableUuid,
163
+ workspaceID = _ref4.workspaceID;
189
164
  const defaultIcon = _file.FILEEXT_ICON_MAP['default'];
190
165
  const defaultIconUrl = _file.FILEEXT_ICON_URL_MAP[defaultIcon];
191
166
  if (!file || !file.name) return {
@@ -195,7 +170,7 @@ const getFileThumbnailInfo = function (file) {
195
170
  const isImage = imageCheck(file.name);
196
171
  if (isImage && server) return {
197
172
  isImage,
198
- fileIconUrl: getImageThumbnailUrl(file.url, {
173
+ fileIconUrl: (0, _dtableUtils.getImageThumbnailUrl)(file.url, {
199
174
  server,
200
175
  dtableUuid,
201
176
  workspaceID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "7.0.1-beta.5",
3
+ "version": "7.0.1-beta.btn2",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",
@@ -8,7 +8,7 @@
8
8
  "@seafile/seafile-editor": "^3.0.34",
9
9
  "classnames": "~2.5.*",
10
10
  "dayjs": "1.10.7",
11
- "dtable-utils": "~5.0.27",
11
+ "dtable-utils": "~5.0.32",
12
12
  "is-hotkey": "0.2.0",
13
13
  "rc-checkbox": "3.5.0",
14
14
  "react-color": "2.19.3",
@@ -1,75 +0,0 @@
1
- .seatable-search-input {
2
- width: 100%;
3
- padding: 6px 10px;
4
- min-width: 170px;
5
- position: relative;
6
- padding: 0;
7
- height: 32px;
8
- border-bottom: 1px solid var(--bs-border-secondary-color);
9
- }
10
-
11
- .seatable-select-search {
12
- border-bottom: 1px solid var(--bs-border-secondary-color);
13
- height: 32px;
14
- }
15
-
16
- .select-search-control {
17
- height: 100%;
18
- border: none;
19
- cursor: pointer;
20
- display: block;
21
- background-color: var(--bs-popover-bg);
22
- font-weight: 400;
23
- font-size: .875rem;
24
- line-height: 1.6;
25
- width: 100%;
26
- padding: .375rem 1rem;
27
- border-top-left-radius: 4px;
28
- border-top-right-radius: 4px;
29
- }
30
-
31
- .select-search-control:focus {
32
- outline: none;
33
- box-shadow: none;
34
- border: none;
35
- cursor: pointer;
36
- height: 100%;
37
- }
38
-
39
- .clear-icon-x {
40
- position: absolute;
41
- display: flex;
42
- justify-content: center;
43
- align-items: center;
44
- min-width: 20px;
45
- pointer-events: auto;
46
- color: var(--bs-icon-color);
47
- right: 13px;
48
- top: 6px;
49
- z-index: 1;
50
- height: 20px;
51
- width: 20px;
52
- cursor: pointer;
53
- border-radius: 3px;
54
- }
55
-
56
- .clear-icon-x .multicolor-icon {
57
- font-size: 12px;
58
- }
59
-
60
- .clear-icon-x:hover {
61
- background-color: var(--bs-btn-background-hover);
62
- }
63
-
64
- .seatable-search-input .none-search-result {
65
- height: 100px;
66
- width: 100%;
67
- padding: 10px;
68
- color: var(--bs-icon-color);
69
- }
70
-
71
- .dtable-ui-user-select-popover .select-search-control,
72
- .dtable-popover .select-search-control {
73
- border-top-left-radius: 8px;
74
- border-top-right-radius: 8px;
75
- }
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _classnames = _interopRequireDefault(require("classnames"));
11
- var _DTableIcon = _interopRequireDefault(require("../DTableIcon"));
12
- require("./index.css");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- class DTableCustomizeSearchInput extends _react.Component {
15
- constructor(props) {
16
- super(props);
17
- this.onCompositionStart = () => {
18
- this.isInputtingChinese = true;
19
- };
20
- this.onChange = e => {
21
- this.timer && clearTimeout(this.timer);
22
- const _this$props = this.props,
23
- onChange = _this$props.onChange,
24
- _this$props$wait = _this$props.wait,
25
- wait = _this$props$wait === void 0 ? 100 : _this$props$wait;
26
- let text = e.target.value;
27
- this.setState({
28
- searchValue: text || ''
29
- }, () => {
30
- if (this.isInputtingChinese) return;
31
- this.timer = setTimeout(() => {
32
- onChange && onChange(this.state.searchValue.trim());
33
- }, wait);
34
- });
35
- };
36
- this.onCompositionEnd = e => {
37
- this.isInputtingChinese = false;
38
- this.onChange(e);
39
- };
40
- this.clearSearch = e => {
41
- e && e.stopPropagation && e.stopPropagation();
42
- const clearValue = this.props.clearValue;
43
- this.setState({
44
- searchValue: ''
45
- }, () => {
46
- clearValue && clearValue();
47
- });
48
- };
49
- this.setFocus = isSelectAllText => {
50
- if (this.inputRef === document.activeElement) return;
51
- this.inputRef.focus();
52
- if (isSelectAllText) {
53
- const txtLength = this.state.searchValue.length;
54
- this.inputRef.setSelectionRange(0, txtLength);
55
- }
56
- };
57
- this.renderClear = () => {
58
- const _this$props2 = this.props,
59
- isClearable = _this$props2.isClearable,
60
- clearClassName = _this$props2.clearClassName;
61
- const searchValue = this.state.searchValue;
62
- if (!isClearable || !searchValue) return null;
63
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
64
- className: (0, _classnames.default)('clear-icon-x', clearClassName),
65
- onClick: this.clearSearch,
66
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
67
- symbol: "close",
68
- color: "var(--bs-icon-secondary-color)"
69
- })
70
- });
71
- };
72
- this.state = {
73
- searchValue: props.value || ''
74
- };
75
- this.isInputtingChinese = false;
76
- this.timer = null;
77
- this.inputRef = null;
78
- }
79
- componentDidMount() {
80
- if (this.props.autoFocus && this.inputRef && this.inputRef !== document.activeElement) {
81
- setTimeout(() => {
82
- this.inputRef.focus();
83
- }, 0);
84
- }
85
- }
86
- UNSAFE_componentWillReceiveProps(nextProps) {
87
- if (nextProps.value !== this.props.value) {
88
- this.setState({
89
- searchValue: nextProps.value
90
- });
91
- }
92
- }
93
- componentWillUnmount() {
94
- this.timer && clearTimeout(this.timer);
95
- this.timer = null;
96
- this.inputRef = null;
97
- }
98
- render() {
99
- const _this$props3 = this.props,
100
- placeholder = _this$props3.placeholder,
101
- autoFocus = _this$props3.autoFocus,
102
- className = _this$props3.className,
103
- onKeyDown = _this$props3.onKeyDown,
104
- _this$props3$disabled = _this$props3.disabled,
105
- disabled = _this$props3$disabled === void 0 ? false : _this$props3$disabled,
106
- _this$props3$style = _this$props3.style,
107
- style = _this$props3$style === void 0 ? {} : _this$props3$style,
108
- isClearable = _this$props3.isClearable,
109
- _this$props3$isMultip = _this$props3.isMultiple,
110
- isMultiple = _this$props3$isMultip === void 0 ? false : _this$props3$isMultip;
111
- const searchValue = this.state.searchValue;
112
- const inputWidth = isClearable && searchValue && !isMultiple ? 'calc(100% - 40px)' : '100%';
113
- style.width = inputWidth;
114
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
115
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
116
- type: "text",
117
- name: "search-input",
118
- value: searchValue,
119
- className: (0, _classnames.default)('select-search-control', className),
120
- onChange: this.onChange,
121
- autoFocus: autoFocus,
122
- placeholder: placeholder,
123
- onCompositionStart: this.onCompositionStart,
124
- onCompositionEnd: this.onCompositionEnd,
125
- onKeyDown: onKeyDown,
126
- disabled: disabled,
127
- style: style,
128
- ref: ref => this.inputRef = ref
129
- }), this.renderClear()]
130
- });
131
- }
132
- }
133
- var _default = exports.default = DTableCustomizeSearchInput;
@@ -1,22 +0,0 @@
1
- .modal-header .dtable-modal-close.close {
2
- padding: 14px 16px;
3
- opacity: 1;
4
- margin: -1rem -1rem -1rem auto;
5
- background-color: transparent;
6
- border: 0;
7
- float: right;
8
- font-size: 1.40625rem;
9
- font-weight: 700;
10
- line-height: 1;
11
- color: #000;
12
- }
13
-
14
- .modal-header .dtable-modal-close.close:not(:disabled):not(.disabled):hover {
15
- opacity: 1;
16
- }
17
-
18
- .modal-header .dtable-modal-close .dtable-modal-close-inner {
19
- width: 28px;
20
- height: 28px;
21
- font-size: 22.5px; /* same with Seafile close icon */
22
- }
@@ -1,16 +0,0 @@
1
- .select-dropdown-indicator {
2
- position: absolute;
3
- top: 50%;
4
- right: 18px;
5
- transform: translateY(-50%);
6
- margin-left: -2px;
7
- }
8
-
9
- .select-dropdown-indicator svg {
10
- width: 12px;
11
- height: 12px;
12
- }
13
-
14
- .dis-multicolor-icon-down {
15
- opacity: 0.65 !important;
16
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _DTableIcon = _interopRequireDefault(require("../../DTableIcon"));
10
- require("./index.css");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- const SelectDropdownIndicator = _ref => {
13
- let isDisabled = _ref.isDisabled;
14
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
15
- className: "select-dropdown-indicator d-flex align-items-center",
16
- "aria-hidden": "true",
17
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableIcon.default, {
18
- symbol: "down",
19
- color: "var(--bs-icon-color)",
20
- className: isDisabled ? 'dis-multicolor-icon-down' : ''
21
- })
22
- });
23
- };
24
- var _default = exports.default = SelectDropdownIndicator;
@@ -1 +0,0 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1718937171668" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18368" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M489.6 444.8l294.4-294.4 67.2 67.2-294.4 294.4 294.4 294.4-67.2 67.2-294.4-294.4-272 272-67.2-67.2 272-272-272-272 67.2-67.2z" p-id="18369" fill="currentColor"></path></svg>
@@ -1,3 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M3.27148 11.2718L6.09991 8.44336L15.9994 18.3429L25.8989 8.44336L28.7273 11.2718L15.9994 23.9997L3.27148 11.2718Z" fill="currentColor"/>
3
- </svg>