dtable-ui-component 6.0.103-beat.1 → 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.
|
@@ -104,7 +104,6 @@ class DTableCustomizeSelect extends _react.Component {
|
|
|
104
104
|
'disabled': isLocked
|
|
105
105
|
}, className),
|
|
106
106
|
onClick: this.onSelectToggle,
|
|
107
|
-
title: value && value.label ? value.label : placeholder,
|
|
108
107
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
109
108
|
className: "selected-option",
|
|
110
109
|
children: [value && value.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
@@ -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() {
|
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,7 +130,7 @@
|
|
|
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
135
|
"terser-webpack-plugin": "^5.2.5",
|
|
136
136
|
"url-loader": "^4.1.1",
|