@fonixtree/magic-design 1.0.188 → 1.0.190
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/es/composite-comp/common/components/ProductItem/index.js +19 -4
- package/es/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.js +21 -10
- package/es/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.less +36 -14
- package/es/meta-comp/components/Text/index.js +17 -4
- package/es/meta-comp/config-panels/TextConfig/index.js +28 -7
- package/es/meta-comp/config-panels/TextConfig/index.less +27 -0
- package/lib/composite-comp/common/components/ProductItem/index.js +19 -4
- package/lib/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.js +21 -10
- package/lib/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.less +36 -14
- package/lib/meta-comp/components/Text/index.js +17 -4
- package/lib/meta-comp/config-panels/TextConfig/index.js +28 -7
- package/lib/meta-comp/config-panels/TextConfig/index.less +27 -0
- package/package.json +1 -1
|
@@ -97,8 +97,22 @@ function (_super) {
|
|
|
97
97
|
|
|
98
98
|
ProductItem.prototype.componentDidMount = function () {
|
|
99
99
|
if (this.videoRef.current) {
|
|
100
|
-
this.videoRef.current
|
|
101
|
-
|
|
100
|
+
var video_1 = this.videoRef.current; // iOS 10+ 特殊处理
|
|
101
|
+
|
|
102
|
+
video_1.setAttribute('playsinline', 'true');
|
|
103
|
+
video_1.setAttribute('webkit-playsinline', 'true');
|
|
104
|
+
video_1.setAttribute('x-webkit-airplay', 'allow');
|
|
105
|
+
video_1.setAttribute('muted', 'true'); // 阻止全屏
|
|
106
|
+
|
|
107
|
+
video_1.addEventListener('webkitbeginfullscreen', function (e) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
video_1.webkitExitFullscreen();
|
|
110
|
+
});
|
|
111
|
+
video_1.addEventListener('webkitpresentationmodechanged', function () {
|
|
112
|
+
if (video_1.webkitPresentationMode === 'fullscreen') {
|
|
113
|
+
video_1.webkitSetPresentationMode('inline');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
102
116
|
}
|
|
103
117
|
};
|
|
104
118
|
|
|
@@ -164,7 +178,6 @@ function (_super) {
|
|
|
164
178
|
})) || []; // ad 卡片
|
|
165
179
|
|
|
166
180
|
if (data.type === 'ad') {
|
|
167
|
-
console.log('data', data);
|
|
168
181
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
182
|
className: "m-product-item-advertise",
|
|
170
183
|
onClick: function onClick() {
|
|
@@ -176,10 +189,12 @@ function (_super) {
|
|
|
176
189
|
}), data.url && data.url.includes('.mp4') && /*#__PURE__*/_react["default"].createElement("video", {
|
|
177
190
|
ref: this.videoRef,
|
|
178
191
|
autoPlay: true,
|
|
192
|
+
disablePictureInPicture: true,
|
|
179
193
|
loop: true,
|
|
180
194
|
muted: true,
|
|
181
195
|
playsinline: true,
|
|
182
|
-
"webkit-playsinline": true
|
|
196
|
+
"webkit-playsinline": "true",
|
|
197
|
+
"x-webkit-airplay": "allow"
|
|
183
198
|
}, /*#__PURE__*/_react["default"].createElement("source", {
|
|
184
199
|
src: data.url,
|
|
185
200
|
type: "video/mp4"
|
|
@@ -93,12 +93,14 @@ function (_super) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
ProductItem.prototype.render = function () {
|
|
96
|
-
var _a
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
var _a, _b;
|
|
97
|
+
|
|
98
|
+
var _c = this.props,
|
|
99
|
+
data = _c.data,
|
|
100
|
+
panelProps = _c.panelProps,
|
|
101
|
+
onItemClick = _c.onItemClick,
|
|
102
|
+
unknownPrice = _c.unknownPrice,
|
|
103
|
+
rest = __rest(_c, ["data", "panelProps", "onItemClick", "unknownPrice"]);
|
|
102
104
|
|
|
103
105
|
var promotions = (0, _businessUtil.getPromotionList)(data);
|
|
104
106
|
var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
@@ -129,6 +131,7 @@ function (_super) {
|
|
|
129
131
|
var _price = integerPart + " " + (decimalPart ? '.' + decimalPart : '');
|
|
130
132
|
|
|
131
133
|
var oldPrice = data.marketPrice !== null ? (0, _currencyUtil.formatCurrencyWithSymbol)(data.marketPrice) : null;
|
|
134
|
+
var salePercent = Number(data.salePercent) / 100 || 0;
|
|
132
135
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
133
136
|
className: (0, _classnames["default"])('m-pc-flash-product-item'),
|
|
134
137
|
onClick: function onClick() {
|
|
@@ -170,7 +173,7 @@ function (_super) {
|
|
|
170
173
|
style: {
|
|
171
174
|
color: panelProps.salesPrice.content.color
|
|
172
175
|
}
|
|
173
|
-
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
|
+
})), ((_a = panelProps.salesProgressVisible) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
174
177
|
className: "rate-sold-wrap"
|
|
175
178
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
179
|
className: "rate-wrap"
|
|
@@ -180,9 +183,17 @@ function (_super) {
|
|
|
180
183
|
type: "icon-star"
|
|
181
184
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
182
185
|
className: "rate-text"
|
|
183
|
-
}, (0, _currencyUtil.numberToFixed)(5.0, 1))),
|
|
184
|
-
className: "
|
|
185
|
-
},
|
|
186
|
+
}, (0, _currencyUtil.numberToFixed)(5.0, 1))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
187
|
+
className: "progress-container"
|
|
188
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
189
|
+
className: "text"
|
|
190
|
+
}, salePercent, "% Terjual"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
191
|
+
className: "progress",
|
|
192
|
+
style: {
|
|
193
|
+
width: salePercent + "%",
|
|
194
|
+
backgroundColor: (_b = panelProps.salesProgressVisible) === null || _b === void 0 ? void 0 : _b.color
|
|
195
|
+
}
|
|
196
|
+
})))));
|
|
186
197
|
};
|
|
187
198
|
|
|
188
199
|
ProductItem.defaultProps = {
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.old-price {
|
|
57
|
+
width: auto !important;
|
|
57
58
|
text-decoration: line-through;
|
|
58
59
|
width: fit-content;
|
|
59
60
|
}
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.rate-sold-wrap {
|
|
64
|
-
margin-top: 4px;
|
|
65
|
+
// margin-top: 4px;
|
|
65
66
|
display: flex;
|
|
66
67
|
align-items: center;
|
|
67
68
|
|
|
@@ -75,26 +76,47 @@
|
|
|
75
76
|
color: #666666;
|
|
76
77
|
margin-left: 4px;
|
|
77
78
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.sold-count {
|
|
81
|
-
font-size: 16px;
|
|
82
|
-
font-weight: 500;
|
|
83
|
-
color: #666666;
|
|
84
|
-
margin-left: 10px;
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
79
|
|
|
88
|
-
&:
|
|
80
|
+
&:after {
|
|
89
81
|
content: '';
|
|
90
82
|
display: block;
|
|
91
83
|
width: 2px;
|
|
92
84
|
height: 16px;
|
|
93
|
-
background-color: #
|
|
94
|
-
margin
|
|
85
|
+
background-color: #666;
|
|
86
|
+
margin: 0 8px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.progress-container {
|
|
91
|
+
width: 100%;
|
|
92
|
+
height: 16px;
|
|
93
|
+
background-color: #F8B1B9;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
position: relative;
|
|
96
|
+
|
|
97
|
+
.text {
|
|
98
|
+
font-family: Montserrat;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
line-height: 16px;
|
|
102
|
+
letter-spacing: 0%;
|
|
103
|
+
color: #fff;
|
|
104
|
+
text-align: center;
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
bottom: 0;
|
|
109
|
+
right: 0;
|
|
110
|
+
margin: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.progress {
|
|
114
|
+
width: 10px;
|
|
115
|
+
border-radius: 8px;
|
|
116
|
+
height: 100%;
|
|
117
|
+
background: linear-gradient(289.79deg, #FCD117 -16.44%, #CE1126 58.47%, #0038A7 114.99%);
|
|
95
118
|
}
|
|
96
119
|
}
|
|
97
120
|
}
|
|
98
121
|
}
|
|
99
|
-
|
|
100
122
|
}
|
|
@@ -139,6 +139,7 @@ function (_super) {
|
|
|
139
139
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
140
140
|
|
|
141
141
|
_this.textRef = /*#__PURE__*/_react["default"].createRef();
|
|
142
|
+
_this.quillWrapRef = /*#__PURE__*/_react["default"].createRef();
|
|
142
143
|
_this.quillRef = null;
|
|
143
144
|
_this.state = {
|
|
144
145
|
editabled: false
|
|
@@ -175,10 +176,22 @@ function (_super) {
|
|
|
175
176
|
close: _this.onEditorClose
|
|
176
177
|
}
|
|
177
178
|
});
|
|
179
|
+
|
|
180
|
+
document.addEventListener('mousedown', _this.onEditorBlur);
|
|
178
181
|
}, 100);
|
|
179
182
|
});
|
|
180
183
|
};
|
|
181
184
|
|
|
185
|
+
_this.onEditorBlur = function (event) {
|
|
186
|
+
var _a, _b;
|
|
187
|
+
|
|
188
|
+
var toolbarDom = document.querySelector('.toolbar-wrap');
|
|
189
|
+
|
|
190
|
+
if (((_a = _this.quillWrapRef) === null || _a === void 0 ? void 0 : _a.current) && !((_b = _this.quillWrapRef) === null || _b === void 0 ? void 0 : _b.current.contains(event.target)) && !toolbarDom.contains(event.target)) {
|
|
191
|
+
_this.onEditorClose();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
182
195
|
_this.onContentClick = function () {
|
|
183
196
|
var data = _this.props.data;
|
|
184
197
|
|
|
@@ -190,6 +203,7 @@ function (_super) {
|
|
|
190
203
|
};
|
|
191
204
|
|
|
192
205
|
_this.onEditorClose = function () {
|
|
206
|
+
document.removeEventListener('mousedown', _this.onEditorBlur);
|
|
193
207
|
_this.props.data.html = _this.quillRef.root.innerHTML;
|
|
194
208
|
|
|
195
209
|
_this.setState({
|
|
@@ -253,10 +267,9 @@ function (_super) {
|
|
|
253
267
|
}
|
|
254
268
|
|
|
255
269
|
if (editabled) {
|
|
256
|
-
return /*#__PURE__*/_react["default"].createElement("div",
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
270
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
271
|
+
ref: this.quillWrapRef
|
|
272
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
260
273
|
className: "quill-text-content-wrap",
|
|
261
274
|
style: {
|
|
262
275
|
zIndex: 3
|
|
@@ -151,6 +151,15 @@ function (_super) {
|
|
|
151
151
|
|
|
152
152
|
_this.state = {};
|
|
153
153
|
_this.containerRef = /*#__PURE__*/_react["default"].createRef();
|
|
154
|
+
_this.editInputRef = /*#__PURE__*/_react["default"].createRef();
|
|
155
|
+
|
|
156
|
+
_this.onEditInputBlur = function (event) {
|
|
157
|
+
var _a, _b;
|
|
158
|
+
|
|
159
|
+
if (((_a = _this.editInputRef) === null || _a === void 0 ? void 0 : _a.current) && !((_b = _this.editInputRef) === null || _b === void 0 ? void 0 : _b.current.contains(event.target))) {
|
|
160
|
+
_this.selfRender();
|
|
161
|
+
}
|
|
162
|
+
};
|
|
154
163
|
|
|
155
164
|
_this.onSizeTypeChange = function (v, obj) {
|
|
156
165
|
_extends(obj, sizeTypeMap[v]);
|
|
@@ -165,11 +174,23 @@ function (_super) {
|
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
TextConfig.prototype.componentDidMount = function () {
|
|
177
|
+
var _a, _b;
|
|
178
|
+
|
|
179
|
+
var data = this.props.data;
|
|
168
180
|
window.document.addEventListener('text-render', this.selfRender);
|
|
181
|
+
(_b = (_a = this.editInputRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.addEventListener('input', function () {
|
|
182
|
+
if (data.html) {
|
|
183
|
+
data.html = this.textContent;
|
|
184
|
+
} else {
|
|
185
|
+
data.text = this.textContent;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
document.addEventListener('mousedown', this.onEditInputBlur);
|
|
169
189
|
};
|
|
170
190
|
|
|
171
191
|
TextConfig.prototype.componentWillUnmount = function () {
|
|
172
192
|
window.document.removeEventListener('text-render', this.selfRender);
|
|
193
|
+
document.removeEventListener('mousedown', this.onEditInputBlur);
|
|
173
194
|
};
|
|
174
195
|
|
|
175
196
|
TextConfig.prototype.render = function () {
|
|
@@ -365,13 +386,13 @@ function (_super) {
|
|
|
365
386
|
className: "text-input",
|
|
366
387
|
split: "solid",
|
|
367
388
|
title: (0, _locale.i18n)('TEXT')
|
|
368
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
389
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
390
|
+
ref: this.editInputRef,
|
|
391
|
+
className: "edit-input",
|
|
392
|
+
contentEditable: "true",
|
|
393
|
+
dangerouslySetInnerHTML: {
|
|
394
|
+
__html: data.html || data.text
|
|
395
|
+
}
|
|
375
396
|
})), /*#__PURE__*/_react["default"].createElement(_common.Collapse // divider="dashed"
|
|
376
397
|
// headerSize="small"
|
|
377
398
|
, {
|
|
@@ -11,6 +11,33 @@
|
|
|
11
11
|
border-color: #EDF0F4 !important;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.edit-input {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 36px;
|
|
17
|
+
line-height: 36px;
|
|
18
|
+
padding: 0 11px;
|
|
19
|
+
color: rgba(0, 0, 0, 0.85);
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
background-image: none;
|
|
23
|
+
border: 1px solid #d9d9d9;
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
overflow-x: auto;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
border-color: #40a9ff;
|
|
30
|
+
border-right-width: 1px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:focus {
|
|
34
|
+
border-color: #40a9ff;
|
|
35
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
36
|
+
border-right-width: 1px;
|
|
37
|
+
outline: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
14
41
|
.edit-text-btn {
|
|
15
42
|
margin: 8px auto;
|
|
16
43
|
padding: 6px 16px;
|
|
@@ -97,8 +97,22 @@ function (_super) {
|
|
|
97
97
|
|
|
98
98
|
ProductItem.prototype.componentDidMount = function () {
|
|
99
99
|
if (this.videoRef.current) {
|
|
100
|
-
this.videoRef.current
|
|
101
|
-
|
|
100
|
+
var video_1 = this.videoRef.current; // iOS 10+ 特殊处理
|
|
101
|
+
|
|
102
|
+
video_1.setAttribute('playsinline', 'true');
|
|
103
|
+
video_1.setAttribute('webkit-playsinline', 'true');
|
|
104
|
+
video_1.setAttribute('x-webkit-airplay', 'allow');
|
|
105
|
+
video_1.setAttribute('muted', 'true'); // 阻止全屏
|
|
106
|
+
|
|
107
|
+
video_1.addEventListener('webkitbeginfullscreen', function (e) {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
video_1.webkitExitFullscreen();
|
|
110
|
+
});
|
|
111
|
+
video_1.addEventListener('webkitpresentationmodechanged', function () {
|
|
112
|
+
if (video_1.webkitPresentationMode === 'fullscreen') {
|
|
113
|
+
video_1.webkitSetPresentationMode('inline');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
102
116
|
}
|
|
103
117
|
};
|
|
104
118
|
|
|
@@ -164,7 +178,6 @@ function (_super) {
|
|
|
164
178
|
})) || []; // ad 卡片
|
|
165
179
|
|
|
166
180
|
if (data.type === 'ad') {
|
|
167
|
-
console.log('data', data);
|
|
168
181
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
182
|
className: "m-product-item-advertise",
|
|
170
183
|
onClick: function onClick() {
|
|
@@ -176,10 +189,12 @@ function (_super) {
|
|
|
176
189
|
}), data.url && data.url.includes('.mp4') && /*#__PURE__*/_react["default"].createElement("video", {
|
|
177
190
|
ref: this.videoRef,
|
|
178
191
|
autoPlay: true,
|
|
192
|
+
disablePictureInPicture: true,
|
|
179
193
|
loop: true,
|
|
180
194
|
muted: true,
|
|
181
195
|
playsinline: true,
|
|
182
|
-
"webkit-playsinline": true
|
|
196
|
+
"webkit-playsinline": "true",
|
|
197
|
+
"x-webkit-airplay": "allow"
|
|
183
198
|
}, /*#__PURE__*/_react["default"].createElement("source", {
|
|
184
199
|
src: data.url,
|
|
185
200
|
type: "video/mp4"
|
|
@@ -93,12 +93,14 @@ function (_super) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
ProductItem.prototype.render = function () {
|
|
96
|
-
var _a
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
var _a, _b;
|
|
97
|
+
|
|
98
|
+
var _c = this.props,
|
|
99
|
+
data = _c.data,
|
|
100
|
+
panelProps = _c.panelProps,
|
|
101
|
+
onItemClick = _c.onItemClick,
|
|
102
|
+
unknownPrice = _c.unknownPrice,
|
|
103
|
+
rest = __rest(_c, ["data", "panelProps", "onItemClick", "unknownPrice"]);
|
|
102
104
|
|
|
103
105
|
var promotions = (0, _businessUtil.getPromotionList)(data);
|
|
104
106
|
var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
|
|
@@ -129,6 +131,7 @@ function (_super) {
|
|
|
129
131
|
var _price = integerPart + " " + (decimalPart ? '.' + decimalPart : '');
|
|
130
132
|
|
|
131
133
|
var oldPrice = data.marketPrice !== null ? (0, _currencyUtil.formatCurrencyWithSymbol)(data.marketPrice) : null;
|
|
134
|
+
var salePercent = Number(data.salePercent) / 100 || 0;
|
|
132
135
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
133
136
|
className: (0, _classnames["default"])('m-pc-flash-product-item'),
|
|
134
137
|
onClick: function onClick() {
|
|
@@ -170,7 +173,7 @@ function (_super) {
|
|
|
170
173
|
style: {
|
|
171
174
|
color: panelProps.salesPrice.content.color
|
|
172
175
|
}
|
|
173
|
-
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
|
+
})), ((_a = panelProps.salesProgressVisible) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
174
177
|
className: "rate-sold-wrap"
|
|
175
178
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
176
179
|
className: "rate-wrap"
|
|
@@ -180,9 +183,17 @@ function (_super) {
|
|
|
180
183
|
type: "icon-star"
|
|
181
184
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
182
185
|
className: "rate-text"
|
|
183
|
-
}, (0, _currencyUtil.numberToFixed)(5.0, 1))),
|
|
184
|
-
className: "
|
|
185
|
-
},
|
|
186
|
+
}, (0, _currencyUtil.numberToFixed)(5.0, 1))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
187
|
+
className: "progress-container"
|
|
188
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
189
|
+
className: "text"
|
|
190
|
+
}, salePercent, "% Terjual"), /*#__PURE__*/_react["default"].createElement("div", {
|
|
191
|
+
className: "progress",
|
|
192
|
+
style: {
|
|
193
|
+
width: salePercent + "%",
|
|
194
|
+
backgroundColor: (_b = panelProps.salesProgressVisible) === null || _b === void 0 ? void 0 : _b.color
|
|
195
|
+
}
|
|
196
|
+
})))));
|
|
186
197
|
};
|
|
187
198
|
|
|
188
199
|
ProductItem.defaultProps = {
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.old-price {
|
|
57
|
+
width: auto !important;
|
|
57
58
|
text-decoration: line-through;
|
|
58
59
|
width: fit-content;
|
|
59
60
|
}
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.rate-sold-wrap {
|
|
64
|
-
margin-top: 4px;
|
|
65
|
+
// margin-top: 4px;
|
|
65
66
|
display: flex;
|
|
66
67
|
align-items: center;
|
|
67
68
|
|
|
@@ -75,26 +76,47 @@
|
|
|
75
76
|
color: #666666;
|
|
76
77
|
margin-left: 4px;
|
|
77
78
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.sold-count {
|
|
81
|
-
font-size: 16px;
|
|
82
|
-
font-weight: 500;
|
|
83
|
-
color: #666666;
|
|
84
|
-
margin-left: 10px;
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
79
|
|
|
88
|
-
&:
|
|
80
|
+
&:after {
|
|
89
81
|
content: '';
|
|
90
82
|
display: block;
|
|
91
83
|
width: 2px;
|
|
92
84
|
height: 16px;
|
|
93
|
-
background-color: #
|
|
94
|
-
margin
|
|
85
|
+
background-color: #666;
|
|
86
|
+
margin: 0 8px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.progress-container {
|
|
91
|
+
width: 100%;
|
|
92
|
+
height: 16px;
|
|
93
|
+
background-color: #F8B1B9;
|
|
94
|
+
border-radius: 8px;
|
|
95
|
+
position: relative;
|
|
96
|
+
|
|
97
|
+
.text {
|
|
98
|
+
font-family: Montserrat;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
line-height: 16px;
|
|
102
|
+
letter-spacing: 0%;
|
|
103
|
+
color: #fff;
|
|
104
|
+
text-align: center;
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
bottom: 0;
|
|
109
|
+
right: 0;
|
|
110
|
+
margin: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.progress {
|
|
114
|
+
width: 10px;
|
|
115
|
+
border-radius: 8px;
|
|
116
|
+
height: 100%;
|
|
117
|
+
background: linear-gradient(289.79deg, #FCD117 -16.44%, #CE1126 58.47%, #0038A7 114.99%);
|
|
95
118
|
}
|
|
96
119
|
}
|
|
97
120
|
}
|
|
98
121
|
}
|
|
99
|
-
|
|
100
122
|
}
|
|
@@ -139,6 +139,7 @@ function (_super) {
|
|
|
139
139
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
140
140
|
|
|
141
141
|
_this.textRef = /*#__PURE__*/_react["default"].createRef();
|
|
142
|
+
_this.quillWrapRef = /*#__PURE__*/_react["default"].createRef();
|
|
142
143
|
_this.quillRef = null;
|
|
143
144
|
_this.state = {
|
|
144
145
|
editabled: false
|
|
@@ -175,10 +176,22 @@ function (_super) {
|
|
|
175
176
|
close: _this.onEditorClose
|
|
176
177
|
}
|
|
177
178
|
});
|
|
179
|
+
|
|
180
|
+
document.addEventListener('mousedown', _this.onEditorBlur);
|
|
178
181
|
}, 100);
|
|
179
182
|
});
|
|
180
183
|
};
|
|
181
184
|
|
|
185
|
+
_this.onEditorBlur = function (event) {
|
|
186
|
+
var _a, _b;
|
|
187
|
+
|
|
188
|
+
var toolbarDom = document.querySelector('.toolbar-wrap');
|
|
189
|
+
|
|
190
|
+
if (((_a = _this.quillWrapRef) === null || _a === void 0 ? void 0 : _a.current) && !((_b = _this.quillWrapRef) === null || _b === void 0 ? void 0 : _b.current.contains(event.target)) && !toolbarDom.contains(event.target)) {
|
|
191
|
+
_this.onEditorClose();
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
182
195
|
_this.onContentClick = function () {
|
|
183
196
|
var data = _this.props.data;
|
|
184
197
|
|
|
@@ -190,6 +203,7 @@ function (_super) {
|
|
|
190
203
|
};
|
|
191
204
|
|
|
192
205
|
_this.onEditorClose = function () {
|
|
206
|
+
document.removeEventListener('mousedown', _this.onEditorBlur);
|
|
193
207
|
_this.props.data.html = _this.quillRef.root.innerHTML;
|
|
194
208
|
|
|
195
209
|
_this.setState({
|
|
@@ -253,10 +267,9 @@ function (_super) {
|
|
|
253
267
|
}
|
|
254
268
|
|
|
255
269
|
if (editabled) {
|
|
256
|
-
return /*#__PURE__*/_react["default"].createElement("div",
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
270
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
271
|
+
ref: this.quillWrapRef
|
|
272
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
260
273
|
className: "quill-text-content-wrap",
|
|
261
274
|
style: {
|
|
262
275
|
zIndex: 3
|
|
@@ -151,6 +151,15 @@ function (_super) {
|
|
|
151
151
|
|
|
152
152
|
_this.state = {};
|
|
153
153
|
_this.containerRef = /*#__PURE__*/_react["default"].createRef();
|
|
154
|
+
_this.editInputRef = /*#__PURE__*/_react["default"].createRef();
|
|
155
|
+
|
|
156
|
+
_this.onEditInputBlur = function (event) {
|
|
157
|
+
var _a, _b;
|
|
158
|
+
|
|
159
|
+
if (((_a = _this.editInputRef) === null || _a === void 0 ? void 0 : _a.current) && !((_b = _this.editInputRef) === null || _b === void 0 ? void 0 : _b.current.contains(event.target))) {
|
|
160
|
+
_this.selfRender();
|
|
161
|
+
}
|
|
162
|
+
};
|
|
154
163
|
|
|
155
164
|
_this.onSizeTypeChange = function (v, obj) {
|
|
156
165
|
_extends(obj, sizeTypeMap[v]);
|
|
@@ -165,11 +174,23 @@ function (_super) {
|
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
TextConfig.prototype.componentDidMount = function () {
|
|
177
|
+
var _a, _b;
|
|
178
|
+
|
|
179
|
+
var data = this.props.data;
|
|
168
180
|
window.document.addEventListener('text-render', this.selfRender);
|
|
181
|
+
(_b = (_a = this.editInputRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.addEventListener('input', function () {
|
|
182
|
+
if (data.html) {
|
|
183
|
+
data.html = this.textContent;
|
|
184
|
+
} else {
|
|
185
|
+
data.text = this.textContent;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
document.addEventListener('mousedown', this.onEditInputBlur);
|
|
169
189
|
};
|
|
170
190
|
|
|
171
191
|
TextConfig.prototype.componentWillUnmount = function () {
|
|
172
192
|
window.document.removeEventListener('text-render', this.selfRender);
|
|
193
|
+
document.removeEventListener('mousedown', this.onEditInputBlur);
|
|
173
194
|
};
|
|
174
195
|
|
|
175
196
|
TextConfig.prototype.render = function () {
|
|
@@ -365,13 +386,13 @@ function (_super) {
|
|
|
365
386
|
className: "text-input",
|
|
366
387
|
split: "solid",
|
|
367
388
|
title: (0, _locale.i18n)('TEXT')
|
|
368
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
389
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
390
|
+
ref: this.editInputRef,
|
|
391
|
+
className: "edit-input",
|
|
392
|
+
contentEditable: "true",
|
|
393
|
+
dangerouslySetInnerHTML: {
|
|
394
|
+
__html: data.html || data.text
|
|
395
|
+
}
|
|
375
396
|
})), /*#__PURE__*/_react["default"].createElement(_common.Collapse // divider="dashed"
|
|
376
397
|
// headerSize="small"
|
|
377
398
|
, {
|
|
@@ -11,6 +11,33 @@
|
|
|
11
11
|
border-color: #EDF0F4 !important;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.edit-input {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 36px;
|
|
17
|
+
line-height: 36px;
|
|
18
|
+
padding: 0 11px;
|
|
19
|
+
color: rgba(0, 0, 0, 0.85);
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
background-color: #fff;
|
|
22
|
+
background-image: none;
|
|
23
|
+
border: 1px solid #d9d9d9;
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
overflow-x: auto;
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
border-color: #40a9ff;
|
|
30
|
+
border-right-width: 1px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:focus {
|
|
34
|
+
border-color: #40a9ff;
|
|
35
|
+
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
36
|
+
border-right-width: 1px;
|
|
37
|
+
outline: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
14
41
|
.edit-text-btn {
|
|
15
42
|
margin: 8px auto;
|
|
16
43
|
padding: 6px 16px;
|