@seafile/seafile-editor 0.3.115 → 0.3.116
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.
|
@@ -20,18 +20,8 @@ var FieldSetting = /*#__PURE__*/function (_React$Component) {
|
|
|
20
20
|
|
|
21
21
|
_this = _super.call(this, props);
|
|
22
22
|
|
|
23
|
-
_this.
|
|
23
|
+
_this.onMouseEnter = function () {
|
|
24
24
|
if (!_this.props.option) return;
|
|
25
|
-
var isShowMenu = _this.state.isShowMenu;
|
|
26
|
-
|
|
27
|
-
if (isShowMenu) {
|
|
28
|
-
_this.setState({
|
|
29
|
-
isShowMenu: false
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
25
|
var container = _this.settingRef;
|
|
36
26
|
|
|
37
27
|
var _container$getBoundin = container.getBoundingClientRect(),
|
|
@@ -49,6 +39,12 @@ var FieldSetting = /*#__PURE__*/function (_React$Component) {
|
|
|
49
39
|
});
|
|
50
40
|
};
|
|
51
41
|
|
|
42
|
+
_this.onMouseLeave = function () {
|
|
43
|
+
_this.setState({
|
|
44
|
+
isShowMenu: false
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
52
48
|
_this.onBoldClick = function (event) {
|
|
53
49
|
event.stopPropagation();
|
|
54
50
|
var option = _this.props.option;
|
|
@@ -98,14 +94,15 @@ var FieldSetting = /*#__PURE__*/function (_React$Component) {
|
|
|
98
94
|
isItalic = _ref.italic;
|
|
99
95
|
|
|
100
96
|
var isShowMenu = this.state.isShowMenu;
|
|
101
|
-
var className = "
|
|
97
|
+
var className = "field-setting ".concat(isDisable ? 'disable' : '', " option-item");
|
|
102
98
|
return /*#__PURE__*/React.createElement("span", {
|
|
103
99
|
ref: this.setSettingRef,
|
|
104
100
|
className: className,
|
|
105
|
-
|
|
101
|
+
onMouseEnter: this.onMouseEnter,
|
|
102
|
+
onMouseLeave: this.onMouseLeave
|
|
106
103
|
}, /*#__PURE__*/React.createElement(TextIcon, {
|
|
107
104
|
width: "14",
|
|
108
|
-
color:
|
|
105
|
+
color: '#aaa'
|
|
109
106
|
}), /*#__PURE__*/React.createElement("span", {
|
|
110
107
|
className: "label"
|
|
111
108
|
}, t('Font_style')), /*#__PURE__*/React.createElement("span", {
|
|
@@ -38,8 +38,15 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
_this.onSelectToggle = function (event) {
|
|
41
|
+
var isShowSelector = _this.state.isShowSelector;
|
|
42
|
+
var newValue = !isShowSelector;
|
|
43
|
+
|
|
44
|
+
if (newValue) {
|
|
45
|
+
_this.dropdownContainerHasInit = false;
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
_this.setState({
|
|
42
|
-
isShowSelector:
|
|
49
|
+
isShowSelector: newValue
|
|
43
50
|
});
|
|
44
51
|
};
|
|
45
52
|
|
|
@@ -137,14 +144,16 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
137
144
|
}, /*#__PURE__*/React.createElement("i", {
|
|
138
145
|
className: "iconfont icon-drop-down arrow"
|
|
139
146
|
}))), isShowSelector && /*#__PURE__*/React.createElement("span", {
|
|
140
|
-
|
|
141
|
-
className: "value-container"
|
|
147
|
+
className: "select-popover"
|
|
142
148
|
}, /*#__PURE__*/React.createElement(FieldSetting, {
|
|
143
149
|
option: currentOption,
|
|
144
150
|
onUpdateOption: this.onUpdateOption
|
|
145
151
|
}), /*#__PURE__*/React.createElement("span", {
|
|
146
152
|
className: "option-item-divider"
|
|
147
|
-
}),
|
|
153
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
154
|
+
className: "option-item-wrapper",
|
|
155
|
+
ref: this.setContainerRef
|
|
156
|
+
}, options.map(function (option) {
|
|
148
157
|
var isActive = option.value === (currentOption && currentOption.value);
|
|
149
158
|
return /*#__PURE__*/React.createElement(Option, {
|
|
150
159
|
key: option.value,
|
|
@@ -153,7 +162,7 @@ var Select = /*#__PURE__*/function (_React$Component) {
|
|
|
153
162
|
option: option,
|
|
154
163
|
onOptionChanged: _this2.onChange
|
|
155
164
|
});
|
|
156
|
-
})));
|
|
165
|
+
}))));
|
|
157
166
|
}
|
|
158
167
|
}]);
|
|
159
168
|
|
|
@@ -55,14 +55,12 @@
|
|
|
55
55
|
color: #666;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
.select-container .
|
|
58
|
+
.select-container .select-popover {
|
|
59
59
|
position: absolute;
|
|
60
60
|
left: 0;
|
|
61
61
|
display: flex;
|
|
62
62
|
min-width: 80px;
|
|
63
|
-
max-height:
|
|
64
|
-
overflow-x: hidden;
|
|
65
|
-
overflow-y: auto;
|
|
63
|
+
max-height: 265px;
|
|
66
64
|
margin-top: 4px;
|
|
67
65
|
padding: 8px 0;
|
|
68
66
|
flex-direction: column;
|
|
@@ -71,15 +69,41 @@
|
|
|
71
69
|
border-radius: 4px;
|
|
72
70
|
background: #fff;
|
|
73
71
|
z-index: 10;
|
|
74
|
-
scrollbar-width: none;
|
|
75
|
-
-ms-overflow-style: none;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
.select-
|
|
79
|
-
|
|
74
|
+
.select-popover .option-item-divider {
|
|
75
|
+
margin-top: 8px;
|
|
76
|
+
border-top: 1px solid #EFEFEF;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.select-popover .field-setting {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
position: relative;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.select-popover .field-setting .icon-container {
|
|
86
|
+
position: absolute;
|
|
87
|
+
right: 10px;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
80
91
|
}
|
|
81
92
|
|
|
82
|
-
.select-
|
|
93
|
+
.select-popover .field-setting .op-icon {
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
transform: rotate(90deg);
|
|
96
|
+
color: #aaa;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.select-popover .option-item-wrapper {
|
|
100
|
+
flex: 1;
|
|
101
|
+
min-height: 0;
|
|
102
|
+
min-width: 0;
|
|
103
|
+
overflow: auto;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.select-popover .option-item {
|
|
83
107
|
flex-shrink: 0;
|
|
84
108
|
display: flex;
|
|
85
109
|
align-items: center;
|
|
@@ -91,59 +115,30 @@
|
|
|
91
115
|
white-space: nowrap;
|
|
92
116
|
}
|
|
93
117
|
|
|
94
|
-
.select-
|
|
118
|
+
.select-popover .option-item:hover {
|
|
95
119
|
background-color: #F5F5F5;
|
|
96
120
|
}
|
|
97
121
|
|
|
98
|
-
.select-
|
|
122
|
+
.select-popover .option-item.active {
|
|
99
123
|
background-color: #39A0FF;
|
|
100
124
|
color: #fff;
|
|
101
125
|
}
|
|
102
126
|
|
|
103
|
-
.select-
|
|
127
|
+
.select-popover .option-item.disable {
|
|
104
128
|
color: #aaa;
|
|
105
129
|
cursor: default;
|
|
106
130
|
}
|
|
107
131
|
|
|
108
|
-
.select-
|
|
132
|
+
.select-popover .option-item .item-icon {
|
|
109
133
|
font-size: 14px;
|
|
110
134
|
color: rgb(170, 170, 170);
|
|
111
135
|
cursor: default;
|
|
112
136
|
}
|
|
113
137
|
|
|
114
|
-
.select-
|
|
138
|
+
.select-popover .option-item.active .item-icon {
|
|
115
139
|
color: #fff;
|
|
116
140
|
}
|
|
117
141
|
|
|
118
|
-
.select-
|
|
142
|
+
.select-popover .option-item .label {
|
|
119
143
|
margin: 0 5px;
|
|
120
144
|
}
|
|
121
|
-
|
|
122
|
-
.option-item.field-setting {
|
|
123
|
-
display: flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
position: relative;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.option-item.field-setting .icon-container {
|
|
129
|
-
position: absolute;
|
|
130
|
-
right: 10px;
|
|
131
|
-
display: flex;
|
|
132
|
-
align-items: center;
|
|
133
|
-
justify-content: center;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.option-item.field-setting .op-icon {
|
|
137
|
-
font-size: 12px;
|
|
138
|
-
transform: rotate(90deg);
|
|
139
|
-
color: #aaa;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.option-item.active.field-setting .op-icon {
|
|
143
|
-
color: #FFF;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.value-container .option-item-divider {
|
|
147
|
-
margin-top: 8px;
|
|
148
|
-
border-top: 1px solid #EFEFEF;
|
|
149
|
-
}
|