dtable-ui-component 6.0.103-alpha.2 → 6.0.103
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.
- package/lib/DTableFiltersPopover/utils/filter-item-utils.js +10 -2
- package/lib/DTableFiltersPopover/widgets/filter-item.js +2 -2
- package/lib/DepartmentSingleSelectEditor/pc-editor/index.js +13 -7
- package/lib/FileFormatter/index.js +3 -1
- package/lib/FileUploader/index.js +4 -4
- package/package.json +2 -3
|
@@ -36,17 +36,21 @@ class FilterItemUtils {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
static generatorPredicateOption(filterPredicate) {
|
|
39
|
+
let isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
40
|
+
// When an option is selected and shown in the select component, the ellipsis at the end of the predicate text is not displayed.
|
|
41
|
+
const translatedPredicateText = isActive ? (0, _lang.getLocale)(filterPredicate).replace(/\s*\.{3}$/, '') : (0, _lang.getLocale)(filterPredicate);
|
|
39
42
|
return {
|
|
40
43
|
value: {
|
|
41
44
|
filterPredicate
|
|
42
45
|
},
|
|
43
46
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
44
47
|
className: "select-option-name",
|
|
45
|
-
children:
|
|
48
|
+
children: translatedPredicateText
|
|
46
49
|
})
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
52
|
static generatorTermModifierOption(filterTermModifier) {
|
|
53
|
+
let isActive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
50
54
|
const FILTER_TERM_MODIFIER_SHOW = {
|
|
51
55
|
'today': (0, _lang.getLocale)('today'),
|
|
52
56
|
'tomorrow': (0, _lang.getLocale)('tomorrow'),
|
|
@@ -70,13 +74,17 @@ class FilterItemUtils {
|
|
|
70
74
|
'this_month': (0, _lang.getLocale)('this_month'),
|
|
71
75
|
'this_year': (0, _lang.getLocale)('this_year')
|
|
72
76
|
};
|
|
77
|
+
const filterTermModifierText = FILTER_TERM_MODIFIER_SHOW[filterTermModifier];
|
|
78
|
+
|
|
79
|
+
// When an option is selected and shown in the select component, the ellipsis at the end of the term modifier text is not displayed.
|
|
80
|
+
const translatedTermModifierText = isActive ? (0, _lang.getLocale)(filterTermModifierText).replace(/\s*\.{3}$/, '') : (0, _lang.getLocale)(filterTermModifierText);
|
|
73
81
|
return {
|
|
74
82
|
value: {
|
|
75
83
|
filterTermModifier
|
|
76
84
|
},
|
|
77
85
|
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
78
86
|
className: "select-option-name",
|
|
79
|
-
children:
|
|
87
|
+
children: translatedTermModifierText
|
|
80
88
|
})
|
|
81
89
|
};
|
|
82
90
|
}
|
|
@@ -744,11 +744,11 @@ class FilterItem extends _react.default.Component {
|
|
|
744
744
|
filter_term_modifier
|
|
745
745
|
} = filter;
|
|
746
746
|
const activeColumn = _filterItemUtils.default.generatorColumnOption(filterColumn);
|
|
747
|
-
const activePredicate = _filterItemUtils.default.generatorPredicateOption(filter_predicate);
|
|
747
|
+
const activePredicate = _filterItemUtils.default.generatorPredicateOption(filter_predicate, true);
|
|
748
748
|
let activeTermModifier = null;
|
|
749
749
|
let _isCheckboxColumn = false;
|
|
750
750
|
if ((0, _dtableUtils.isDateColumn)(filterColumn)) {
|
|
751
|
-
activeTermModifier = _filterItemUtils.default.generatorTermModifierOption(filter_term_modifier);
|
|
751
|
+
activeTermModifier = _filterItemUtils.default.generatorTermModifierOption(filter_term_modifier, true);
|
|
752
752
|
} else if ((0, _columnUtils.isCheckboxColumn)(filterColumn)) {
|
|
753
753
|
_isCheckboxColumn = true;
|
|
754
754
|
}
|
|
@@ -49,14 +49,20 @@ class PCDepartmentSingleSelectEditor extends _react.Component {
|
|
|
49
49
|
}
|
|
50
50
|
componentDidMount() {
|
|
51
51
|
if (this.isRowExpand) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
let menuStyle = {};
|
|
53
|
+
const {
|
|
54
|
+
top,
|
|
55
|
+
left
|
|
56
|
+
} = this.outerRef.getBoundingClientRect();
|
|
57
|
+
if (top > 330) {
|
|
58
|
+
menuStyle.top = -200;
|
|
59
|
+
}
|
|
60
|
+
if (left > window.innerWidth - 300) {
|
|
61
|
+
menuStyle.left = left - window.innerWidth;
|
|
59
62
|
}
|
|
63
|
+
this.setState({
|
|
64
|
+
menuStyle
|
|
65
|
+
});
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
render() {
|
|
@@ -20,6 +20,7 @@ const FileFormatter = _ref => {
|
|
|
20
20
|
containerClassName = '',
|
|
21
21
|
renderItem,
|
|
22
22
|
isSupportOpenFile = false,
|
|
23
|
+
onOpenFile,
|
|
23
24
|
server,
|
|
24
25
|
workspaceID,
|
|
25
26
|
dtableUuid
|
|
@@ -62,7 +63,8 @@ const FileFormatter = _ref => {
|
|
|
62
63
|
let assetFileIndex = openFileUrl.indexOf('/asset');
|
|
63
64
|
if (assetFileIndex > -1) {
|
|
64
65
|
previewerUrl = openFileUrl.replace('/asset', '/asset-preview');
|
|
65
|
-
window.open(previewerUrl, '_blank');
|
|
66
|
+
if (!onOpenFile) window.open(previewerUrl, '_blank');
|
|
67
|
+
onOpenFile(previewerUrl);
|
|
66
68
|
}
|
|
67
69
|
}, [fileImageUrlList, isSupportOpenFile, showLargeImage]);
|
|
68
70
|
const moveNext = (0, _react.useCallback)(() => {
|
|
@@ -135,11 +135,11 @@ class FileUploader extends _react.default.Component {
|
|
|
135
135
|
dealFileCnt++;
|
|
136
136
|
}
|
|
137
137
|
for (let i = 0; i < allFileLen; i++) {
|
|
138
|
-
let
|
|
139
|
-
if (isPasteUpload &&
|
|
138
|
+
let uploadFile = files[i];
|
|
139
|
+
if (isPasteUpload && uploadFile.name === 'image.png') {
|
|
140
140
|
let newName = `image-${(0, _dayjs.default)().format('YYYY-MM-DD-HH-mm')}.png`;
|
|
141
|
-
|
|
142
|
-
type:
|
|
141
|
+
uploadFile = new File([uploadFile], newName, {
|
|
142
|
+
type: uploadFile.type
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-ui-component",
|
|
3
|
-
"version": "6.0.103
|
|
3
|
+
"version": "6.0.103",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@seafile/react-image-lightbox": "4.0.2",
|
|
@@ -130,9 +130,8 @@
|
|
|
130
130
|
"sass-loader": "^12.3.0",
|
|
131
131
|
"semver": "^7.3.5",
|
|
132
132
|
"source-map-loader": "^3.0.0",
|
|
133
|
-
"storybook": "^9.1.
|
|
133
|
+
"storybook": "^9.1.17",
|
|
134
134
|
"style-loader": "^3.3.1",
|
|
135
|
-
"tailwindcss": "^3.0.2",
|
|
136
135
|
"terser-webpack-plugin": "^5.2.5",
|
|
137
136
|
"url-loader": "^4.1.1",
|
|
138
137
|
"web-vitals": "2.1.4",
|