@kep-platform/basic-component 1.0.13 → 1.0.14
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.
@@ -30,8 +30,6 @@ export default class WindowStore {
|
|
30
30
|
isMinimize: boolean;
|
31
31
|
isClosed: boolean;
|
32
32
|
onClosedHandler: ((id: string) => void) | undefined;
|
33
|
-
private cachedStyle?;
|
34
|
-
private lastStatus?;
|
35
33
|
constructor(id: string, onClosedHandler?: (id: string) => void);
|
36
34
|
fullscreenWindow(func?: () => void): void;
|
37
35
|
fullscreenExitWindow(): void;
|
@@ -1,6 +1,4 @@
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
5
3
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
6
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
@@ -35,8 +33,6 @@ var WindowStore = /*#__PURE__*/function () {
|
|
35
33
|
_defineProperty(this, "isMinimize", false);
|
36
34
|
_defineProperty(this, "isClosed", false);
|
37
35
|
_defineProperty(this, "onClosedHandler", void 0);
|
38
|
-
_defineProperty(this, "cachedStyle", void 0);
|
39
|
-
_defineProperty(this, "lastStatus", void 0);
|
40
36
|
makeObservable(this, {
|
41
37
|
width: observable,
|
42
38
|
height: observable,
|
@@ -187,14 +183,9 @@ var WindowStore = /*#__PURE__*/function () {
|
|
187
183
|
}, {
|
188
184
|
key: "style",
|
189
185
|
get: function get() {
|
190
|
-
var currentStatus = this.status;
|
191
|
-
if (this.cachedStyle && this.lastStatus === currentStatus) {
|
192
|
-
return this.cachedStyle;
|
193
|
-
}
|
194
|
-
var newStyle;
|
195
186
|
switch (this.status) {
|
196
187
|
case 'closed':
|
197
|
-
|
188
|
+
return {
|
198
189
|
left: this.left + 'px',
|
199
190
|
top: this.top + 'px',
|
200
191
|
width: this.width + 'px',
|
@@ -205,7 +196,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
205
196
|
transition: 'all 0.3s ease-in-out'
|
206
197
|
};
|
207
198
|
case 'minimize':
|
208
|
-
|
199
|
+
return {
|
209
200
|
left: this.minimizePos.left + 'px',
|
210
201
|
top: this.minimizePos.top + 'px',
|
211
202
|
width: this.width + 'px',
|
@@ -216,7 +207,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
216
207
|
transition: 'all 0.3s ease-in-out'
|
217
208
|
};
|
218
209
|
case 'fullscreen':
|
219
|
-
|
210
|
+
return {
|
220
211
|
left: this.fullscreenPos.left + 'px',
|
221
212
|
top: this.fullscreenPos.top + 'px',
|
222
213
|
width: this.fullscreenPos.width + 'px',
|
@@ -228,7 +219,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
228
219
|
case 'normal':
|
229
220
|
default:
|
230
221
|
if (this.isMoving || this.isResizing) {
|
231
|
-
|
222
|
+
return {
|
232
223
|
left: this.left + 'px',
|
233
224
|
top: this.top + 'px',
|
234
225
|
width: this.width + 'px',
|
@@ -238,7 +229,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
238
229
|
transition: 'none'
|
239
230
|
};
|
240
231
|
} else {
|
241
|
-
|
232
|
+
return {
|
242
233
|
left: this.left + 'px',
|
243
234
|
top: this.top + 'px',
|
244
235
|
width: this.width + 'px',
|
@@ -249,11 +240,6 @@ var WindowStore = /*#__PURE__*/function () {
|
|
249
240
|
};
|
250
241
|
}
|
251
242
|
}
|
252
|
-
this.cachedStyle = _objectSpread(_objectSpread({}, newStyle), {}, {
|
253
|
-
willChange: 'transform, left, top, width, height'
|
254
|
-
});
|
255
|
-
this.lastStatus = currentStatus;
|
256
|
-
return this.cachedStyle;
|
257
243
|
}
|
258
244
|
}, {
|
259
245
|
key: "info",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kep-platform/basic-component",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.14",
|
4
4
|
"description": "A react library developed with dumi",
|
5
5
|
"license": "MIT",
|
6
6
|
"module": "dist/index.js",
|
@@ -86,5 +86,5 @@
|
|
86
86
|
"authors": [
|
87
87
|
"less-step-jss 1599925910@qq.com"
|
88
88
|
],
|
89
|
-
"gitHead": "
|
89
|
+
"gitHead": "23573dedaa4b38b9321050a0f197781c90df88d3"
|
90
90
|
}
|