@kep-platform/basic-component 0.0.45 → 0.0.46
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/dist/ViewPort/ViewPort.js +65 -24
- package/dist/ViewPort/ViewPortStore.d.ts +1 -0
- package/dist/ViewPort/ViewPortStore.js +7 -0
- package/dist/ViewPort/ViewPortWindow.d.ts +1 -0
- package/dist/ViewPort/ViewPortWindow.js +7 -1
- package/dist/Window/Window.js +19 -2
- package/dist/Window/WindowController.d.ts +2 -2
- package/dist/Window/WindowController.js +4 -3
- package/dist/Window/WindowStore.d.ts +4 -19
- package/dist/Window/WindowStore.js +14 -1
- package/dist/Window/test.js +2 -1
- package/package.json +3 -3
@@ -6,8 +6,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
7
7
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
8
8
|
import { DndContext, useDraggable } from '@dnd-kit/core';
|
9
|
+
import { useDebounce } from '@kep-platform/hooks';
|
10
|
+
import { runInAction } from 'mobx';
|
9
11
|
import { observer } from 'mobx-react-lite';
|
10
|
-
import React, { useEffect, useRef } from 'react';
|
12
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
11
13
|
import styled from 'styled-components';
|
12
14
|
import { RippleManagerStore } from "./Ripple";
|
13
15
|
import { ViewPortWindow } from "./ViewPortWindow";
|
@@ -21,18 +23,23 @@ var ViewPortEntity = observer(function (props) {
|
|
21
23
|
onScale = props.onScale,
|
22
24
|
rest = _objectWithoutProperties(props, _excluded);
|
23
25
|
var _useDraggable = useDraggable({
|
24
|
-
id: 'ViewPortEntity'
|
26
|
+
id: 'ViewPortEntity',
|
27
|
+
disabled: viewPortStore.isTransition
|
25
28
|
}),
|
26
29
|
setNodeRef = _useDraggable.setNodeRef,
|
27
30
|
attributes = _useDraggable.attributes,
|
28
31
|
listeners = _useDraggable.listeners,
|
29
32
|
setActivatorNodeRef = _useDraggable.setActivatorNodeRef,
|
30
33
|
transform = _useDraggable.transform;
|
31
|
-
var
|
34
|
+
var contentRef = useRef(null);
|
35
|
+
var containerRef = useRef(null);
|
36
|
+
var pointerDownTimer = useRef();
|
32
37
|
var createRipple = function createRipple(event) {
|
38
|
+
var _containerRef$current;
|
33
39
|
event.preventDefault();
|
34
40
|
event.stopPropagation();
|
35
|
-
var rect =
|
41
|
+
var rect = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.getBoundingClientRect();
|
42
|
+
if (!rect) return;
|
36
43
|
var left = event.clientX - rect.left;
|
37
44
|
var top = event.clientY - rect.top;
|
38
45
|
rippleManagerStore.addRipple(left, top);
|
@@ -49,7 +56,7 @@ var ViewPortEntity = observer(function (props) {
|
|
49
56
|
}
|
50
57
|
}, [transform]);
|
51
58
|
useEffect(function () {
|
52
|
-
var
|
59
|
+
var _contentRef$current;
|
53
60
|
function scaleHandler(e) {
|
54
61
|
e.stopPropagation();
|
55
62
|
e.preventDefault();
|
@@ -60,35 +67,69 @@ var ViewPortEntity = observer(function (props) {
|
|
60
67
|
}
|
61
68
|
onScale === null || onScale === void 0 || onScale(viewPortStore.transform.left, viewPortStore.transform.top, viewPortStore.scale, viewPortStore.ratio);
|
62
69
|
}
|
63
|
-
(
|
70
|
+
(_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.addEventListener('wheel', scaleHandler, {
|
64
71
|
passive: false
|
65
72
|
});
|
66
73
|
return function () {
|
67
|
-
var
|
68
|
-
(
|
74
|
+
var _contentRef$current2;
|
75
|
+
(_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.removeEventListener('wheel', scaleHandler);
|
69
76
|
};
|
70
77
|
}, []);
|
78
|
+
var debounceDoubleClick = useDebounce(function (e) {
|
79
|
+
//在transition期间禁止操作
|
80
|
+
if (viewPortStore.isTransition) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
//双击的时候取消pointerDown的触发事件
|
84
|
+
if (pointerDownTimer.current) clearTimeout(pointerDownTimer.current);
|
85
|
+
pointerDownTimer.current = null;
|
86
|
+
createRipple(e);
|
87
|
+
var container = containerRef.current;
|
88
|
+
var _container$getBoundin = container.getBoundingClientRect(),
|
89
|
+
left = _container$getBoundin.left,
|
90
|
+
top = _container$getBoundin.top;
|
91
|
+
var offsetLeft = e.clientX - left;
|
92
|
+
var offsetTop = e.clientY - top;
|
93
|
+
if (viewPortStore.scale === 1) {
|
94
|
+
viewPortStore.unfocus();
|
95
|
+
} else viewPortStore.focus(offsetLeft, offsetTop);
|
96
|
+
}, 100);
|
97
|
+
var onContainerDoubleClickHandler = function onContainerDoubleClickHandler(e) {
|
98
|
+
debounceDoubleClick(e);
|
99
|
+
};
|
100
|
+
var onContainerTransitionEnd = useCallback(function () {
|
101
|
+
runInAction(function () {
|
102
|
+
viewPortStore.isTransition = false;
|
103
|
+
});
|
104
|
+
}, []);
|
105
|
+
var onContentPointerDownHandler = useCallback(function (e) {
|
106
|
+
if (viewPortStore.isTransition) return;
|
107
|
+
//鼠标点击的时候,先清除定时器,然后再异步触发pointerDown操作,这样保证doubleClick的优先级高于pointerDown
|
108
|
+
if (pointerDownTimer.current) clearTimeout(pointerDownTimer.current);
|
109
|
+
pointerDownTimer.current = setTimeout(function () {
|
110
|
+
var _onPointerDown, _ref;
|
111
|
+
listeners === null || listeners === void 0 || (_onPointerDown = (_ref = listeners).onPointerDown) === null || _onPointerDown === void 0 || _onPointerDown.call(_ref, e);
|
112
|
+
}, 0);
|
113
|
+
}, [listeners]);
|
114
|
+
var onContentPointerUpHandler = useCallback(function (e) {
|
115
|
+
var _onPointerUp, _ref2;
|
116
|
+
if (viewPortStore.isTransition) return;
|
117
|
+
listeners === null || listeners === void 0 || (_onPointerUp = (_ref2 = listeners).onPointerUp) === null || _onPointerUp === void 0 || _onPointerUp.call(_ref2, e);
|
118
|
+
}, [listeners]);
|
71
119
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
72
120
|
style: viewPortStore.containerStyle,
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
var _container$getBoundin = container.getBoundingClientRect(),
|
77
|
-
left = _container$getBoundin.left,
|
78
|
-
top = _container$getBoundin.top;
|
79
|
-
var offsetLeft = e.clientX - left;
|
80
|
-
var offsetTop = e.clientY - top;
|
81
|
-
if (viewPortStore.scale === 1) {
|
82
|
-
viewPortStore.unfocus();
|
83
|
-
} else viewPortStore.focus(offsetLeft, offsetTop);
|
84
|
-
}
|
121
|
+
onDoubleClick: onContainerDoubleClickHandler,
|
122
|
+
onTransitionEnd: onContainerTransitionEnd,
|
123
|
+
ref: containerRef
|
85
124
|
}, rest), rippleManagerStore.rippleInfo, /*#__PURE__*/React.createElement(Content, _extends({
|
86
125
|
ref: function ref(dom) {
|
87
|
-
|
88
|
-
setNodeRef(
|
89
|
-
setActivatorNodeRef(
|
126
|
+
contentRef.current = dom;
|
127
|
+
setNodeRef(contentRef.current);
|
128
|
+
setActivatorNodeRef(contentRef.current);
|
90
129
|
}
|
91
|
-
}, attributes,
|
130
|
+
}, attributes, {
|
131
|
+
onPointerDown: onContentPointerDownHandler,
|
132
|
+
onPointerUp: onContentPointerUpHandler,
|
92
133
|
style: viewPortStore.contentStyle
|
93
134
|
}), children));
|
94
135
|
});
|
@@ -7,6 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
8
8
|
import { makeAutoObservable } from 'mobx';
|
9
9
|
export var ViewPortStore = /*#__PURE__*/function () {
|
10
|
+
//在动画执行期间,禁止任何鼠标操作
|
10
11
|
function ViewPortStore(width, height, ratio) {
|
11
12
|
_classCallCheck(this, ViewPortStore);
|
12
13
|
_defineProperty(this, "transform", {
|
@@ -24,6 +25,7 @@ export var ViewPortStore = /*#__PURE__*/function () {
|
|
24
25
|
//缩放比例
|
25
26
|
_defineProperty(this, "isMoving", false);
|
26
27
|
_defineProperty(this, "maxZIndex", 1);
|
28
|
+
_defineProperty(this, "isTransition", false);
|
27
29
|
if (ratio) this.ratio = ratio;
|
28
30
|
if (width) this.width = width;
|
29
31
|
if (height) this.height = height;
|
@@ -39,12 +41,14 @@ export var ViewPortStore = /*#__PURE__*/function () {
|
|
39
41
|
value: function increaseScale() {
|
40
42
|
this.setScale(this.scale + this.scaleStep);
|
41
43
|
this.setTransform(this.transform.left, this.transform.top);
|
44
|
+
this.isTransition = true;
|
42
45
|
}
|
43
46
|
}, {
|
44
47
|
key: "decreaseScale",
|
45
48
|
value: function decreaseScale() {
|
46
49
|
this.setScale(this.scale - this.scaleStep);
|
47
50
|
this.setTransform(this.transform.left, this.transform.top);
|
51
|
+
this.isTransition = true;
|
48
52
|
}
|
49
53
|
}, {
|
50
54
|
key: "validScale",
|
@@ -97,12 +101,14 @@ export var ViewPortStore = /*#__PURE__*/function () {
|
|
97
101
|
value: function focus(left, top) {
|
98
102
|
this.setScale(1);
|
99
103
|
this.setTransform((1 - this.ratio) * left + this.offsetLeft, (1 - this.ratio) * top + this.offsetTop);
|
104
|
+
this.isTransition = true;
|
100
105
|
}
|
101
106
|
}, {
|
102
107
|
key: "unfocus",
|
103
108
|
value: function unfocus() {
|
104
109
|
this.setScale(1 / this.ratio);
|
105
110
|
this.setTransform(0, 0);
|
111
|
+
this.isTransition = true;
|
106
112
|
}
|
107
113
|
}, {
|
108
114
|
key: "move",
|
@@ -141,6 +147,7 @@ export var ViewPortStore = /*#__PURE__*/function () {
|
|
141
147
|
get: function get() {
|
142
148
|
return this.posInViewPort(0, 0, this.width, this.height);
|
143
149
|
}
|
150
|
+
|
144
151
|
/* 这个函数比较重要,因为你想要让content中的元素在视窗相对位置显示,这个函数会帮你计算偏移量和缩放量,直接得出你的元素应该在content中的偏移量 */
|
145
152
|
}, {
|
146
153
|
key: "posInViewPort",
|
@@ -34,6 +34,7 @@ export declare class ViewPortWindowStore extends WindowStore {
|
|
34
34
|
centerDisplay(): void;
|
35
35
|
fullscreenWindow(func?: () => void): void;
|
36
36
|
constructor(id: string, viewPort: ViewPortStore, onClosedHandler?: (id: string) => void);
|
37
|
+
get disabled(): boolean;
|
37
38
|
}
|
38
39
|
export declare const ViewPortWindow: React.FunctionComponent<WindowProps & {
|
39
40
|
window: ViewPortWindowStore;
|
@@ -34,7 +34,8 @@ export var ViewPortWindowStore = /*#__PURE__*/function (_WindowStore) {
|
|
34
34
|
style: override,
|
35
35
|
controll: override,
|
36
36
|
focus: override,
|
37
|
-
centerDisplay: action
|
37
|
+
centerDisplay: action,
|
38
|
+
disabled: override
|
38
39
|
});
|
39
40
|
return _this;
|
40
41
|
}
|
@@ -159,6 +160,11 @@ export var ViewPortWindowStore = /*#__PURE__*/function (_WindowStore) {
|
|
159
160
|
func === null || func === void 0 || func();
|
160
161
|
this.fullscreenPos = this.viewPortStore.viewPortRect;
|
161
162
|
}
|
163
|
+
}, {
|
164
|
+
key: "disabled",
|
165
|
+
get: function get() {
|
166
|
+
return this.viewPortStore.isTransition || this.isTransition;
|
167
|
+
}
|
162
168
|
}]);
|
163
169
|
return ViewPortWindowStore;
|
164
170
|
}(WindowStore);
|
package/dist/Window/Window.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
2
2
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
3
3
|
import { CloseCircleOutlined, FullscreenExitOutlined, FullscreenOutlined, MinusCircleOutlined } from '@ant-design/icons';
|
4
|
+
import { runInAction } from 'mobx';
|
4
5
|
import { observer } from 'mobx-react-lite';
|
5
6
|
import React, { useEffect, useRef } from 'react';
|
6
7
|
import styled, { css } from 'styled-components';
|
@@ -52,22 +53,31 @@ var Window = observer(function (props) {
|
|
52
53
|
(_windowContainerRef$c2 = windowContainerRef.current) === null || _windowContainerRef$c2 === void 0 || _windowContainerRef$c2.removeEventListener('wheel', stopWheel);
|
53
54
|
};
|
54
55
|
}, []);
|
56
|
+
|
55
57
|
/* style 的原因是因为性能问题 */
|
56
58
|
return /*#__PURE__*/React.createElement(WindowContainer, {
|
57
59
|
style: window.style,
|
58
60
|
isMinimize: !!window.isMinimize,
|
59
61
|
onTransitionEnd: function onTransitionEnd(e) {
|
62
|
+
if (e.target === e.currentTarget) {
|
63
|
+
runInAction(function () {
|
64
|
+
window.isTransition = false;
|
65
|
+
});
|
66
|
+
}
|
60
67
|
if (e.target === e.currentTarget && window.isClosed && e.nativeEvent.propertyName === 'transform') {
|
61
68
|
var _window$onClosedHandl;
|
62
69
|
(_window$onClosedHandl = window.onClosedHandler) === null || _window$onClosedHandl === void 0 || _window$onClosedHandl.call(window, window.id);
|
63
70
|
}
|
64
71
|
},
|
72
|
+
onDoubleClick: function onDoubleClick(e) {
|
73
|
+
e.stopPropagation();
|
74
|
+
},
|
65
75
|
onPointerDown: function onPointerDown(e) {
|
76
|
+
if (window.disabled) return;
|
66
77
|
e.stopPropagation();
|
67
78
|
window.focus();
|
68
79
|
onFocusHandler === null || onFocusHandler === void 0 || onFocusHandler();
|
69
|
-
}
|
70
|
-
ref: windowContainerRef
|
80
|
+
}
|
71
81
|
}, /*#__PURE__*/React.createElement(WindowControllerLeft, {
|
72
82
|
window: window,
|
73
83
|
type: "left"
|
@@ -97,6 +107,9 @@ var Window = observer(function (props) {
|
|
97
107
|
type: "move"
|
98
108
|
}, /*#__PURE__*/React.createElement(WindowHeader, {
|
99
109
|
isDragging: window.isMoving,
|
110
|
+
onPointerDown: function onPointerDown(e) {
|
111
|
+
if (window.disabled) e.stopPropagation();
|
112
|
+
},
|
100
113
|
onDoubleClick: function onDoubleClick(e) {
|
101
114
|
e.stopPropagation();
|
102
115
|
e.preventDefault();
|
@@ -114,22 +127,26 @@ var Window = observer(function (props) {
|
|
114
127
|
color: "var(--kep-platform-orange-4)",
|
115
128
|
icon: /*#__PURE__*/React.createElement(FullscreenOutlined, null),
|
116
129
|
onClick: function onClick() {
|
130
|
+
if (window.disabled) return;
|
117
131
|
window.fullscreenWindow(onFullscreenHandler);
|
118
132
|
}
|
119
133
|
}) : /*#__PURE__*/React.createElement(WindowOption, {
|
120
134
|
color: "var(--kep-platform-orange-4)",
|
121
135
|
icon: /*#__PURE__*/React.createElement(FullscreenExitOutlined, null),
|
122
136
|
onClick: function onClick() {
|
137
|
+
if (window.disabled) return;
|
123
138
|
window.fullscreenExitWindow();
|
124
139
|
}
|
125
140
|
}), /*#__PURE__*/React.createElement(WindowOption, {
|
126
141
|
color: "var(--kep-platform-green-3)",
|
127
142
|
icon: /*#__PURE__*/React.createElement(MinusCircleOutlined, null),
|
128
143
|
onClick: function onClick() {
|
144
|
+
if (window.disabled) return;
|
129
145
|
window.minimizeWindow();
|
130
146
|
}
|
131
147
|
}), /*#__PURE__*/React.createElement(WindowOption, {
|
132
148
|
onClick: function onClick() {
|
149
|
+
if (window.disabled) return;
|
133
150
|
window.closeWindow();
|
134
151
|
},
|
135
152
|
icon: /*#__PURE__*/React.createElement(CloseCircleOutlined, null),
|
@@ -6,5 +6,5 @@ type WindowControllerProps = {
|
|
6
6
|
window: WindowStore;
|
7
7
|
children?: ReactNode;
|
8
8
|
};
|
9
|
-
|
10
|
-
export
|
9
|
+
declare const _default: React.FunctionComponent<WindowControllerProps>;
|
10
|
+
export default _default;
|
@@ -5,17 +5,18 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
5
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
6
6
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
7
7
|
import { useDraggable } from '@dnd-kit/core';
|
8
|
+
import { observer } from 'mobx-react-lite';
|
8
9
|
import React, { useEffect } from 'react';
|
9
10
|
import styled from 'styled-components';
|
10
11
|
var WindowControllerContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &:active,\n &:focus {\n outline: none;\n }\n"])));
|
11
|
-
export default function WindowController(props) {
|
12
|
+
export default observer(function WindowController(props) {
|
12
13
|
var type = props.type,
|
13
14
|
window = props.window,
|
14
15
|
children = props.children,
|
15
16
|
rest = _objectWithoutProperties(props, _excluded);
|
16
17
|
var _useDraggable = useDraggable({
|
17
18
|
id: "".concat(window.id, "/").concat(type),
|
18
|
-
disabled: window.
|
19
|
+
disabled: window.disabled
|
19
20
|
}),
|
20
21
|
attributes = _useDraggable.attributes,
|
21
22
|
transform = _useDraggable.transform,
|
@@ -33,4 +34,4 @@ export default function WindowController(props) {
|
|
33
34
|
ref: setNodeRef,
|
34
35
|
role: "div"
|
35
36
|
}), children);
|
36
|
-
}
|
37
|
+
});
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Transform } from '@dnd-kit/utilities';
|
2
|
+
import { CSSProperties } from 'react';
|
2
3
|
import { WindowControllerType } from './WindowController';
|
3
4
|
export default class WindowStore {
|
4
5
|
width: number;
|
@@ -7,6 +8,7 @@ export default class WindowStore {
|
|
7
8
|
top: number;
|
8
9
|
zIndex: number;
|
9
10
|
fullscreen: boolean;
|
11
|
+
isTransition: boolean;
|
10
12
|
id: string;
|
11
13
|
transform: {
|
12
14
|
x: number;
|
@@ -31,6 +33,7 @@ export default class WindowStore {
|
|
31
33
|
fullscreenWindow(func?: () => void): void;
|
32
34
|
fullscreenExitWindow(): void;
|
33
35
|
resetState(): void;
|
36
|
+
get disabled(): boolean;
|
34
37
|
calculateTransform(transform: Transform): {
|
35
38
|
x: number;
|
36
39
|
y: number;
|
@@ -41,24 +44,6 @@ export default class WindowStore {
|
|
41
44
|
normalizeWindow(): void;
|
42
45
|
closeWindow(): void;
|
43
46
|
focus(): void;
|
44
|
-
get style():
|
45
|
-
left: string;
|
46
|
-
top: string;
|
47
|
-
width: string;
|
48
|
-
height: string;
|
49
|
-
zIndex: number;
|
50
|
-
transform: string;
|
51
|
-
transformOrigin: string;
|
52
|
-
transition: string;
|
53
|
-
} | {
|
54
|
-
left: string;
|
55
|
-
top: string;
|
56
|
-
width: string;
|
57
|
-
height: string;
|
58
|
-
zIndex: number;
|
59
|
-
transform: string;
|
60
|
-
transition: string;
|
61
|
-
transformOrigin?: undefined;
|
62
|
-
};
|
47
|
+
get style(): CSSProperties;
|
63
48
|
get info(): string;
|
64
49
|
}
|
@@ -15,6 +15,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
15
15
|
_defineProperty(this, "top", 0);
|
16
16
|
_defineProperty(this, "zIndex", 1);
|
17
17
|
_defineProperty(this, "fullscreen", false);
|
18
|
+
_defineProperty(this, "isTransition", false);
|
18
19
|
_defineProperty(this, "id", '');
|
19
20
|
_defineProperty(this, "transform", null);
|
20
21
|
_defineProperty(this, "isMoving", false);
|
@@ -41,6 +42,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
41
42
|
fullscreen: observable,
|
42
43
|
transform: observable.struct,
|
43
44
|
isMoving: observable,
|
45
|
+
isTransition: observable,
|
44
46
|
isResizing: observable,
|
45
47
|
isClosed: observable,
|
46
48
|
fullscreenExitWindow: action,
|
@@ -56,7 +58,8 @@ var WindowStore = /*#__PURE__*/function () {
|
|
56
58
|
closeWindow: action,
|
57
59
|
resetState: action,
|
58
60
|
focus: action,
|
59
|
-
info: computed
|
61
|
+
info: computed,
|
62
|
+
disabled: computed
|
60
63
|
});
|
61
64
|
this.id = id;
|
62
65
|
this.onClosedHandler = onClosedHandler;
|
@@ -66,12 +69,14 @@ var WindowStore = /*#__PURE__*/function () {
|
|
66
69
|
value: function fullscreenWindow(func) {
|
67
70
|
this.resetState();
|
68
71
|
this.fullscreen = true;
|
72
|
+
this.isTransition = true;
|
69
73
|
func === null || func === void 0 || func();
|
70
74
|
}
|
71
75
|
}, {
|
72
76
|
key: "fullscreenExitWindow",
|
73
77
|
value: function fullscreenExitWindow() {
|
74
78
|
this.resetState();
|
79
|
+
this.isTransition = true;
|
75
80
|
this.fullscreen = false;
|
76
81
|
}
|
77
82
|
}, {
|
@@ -79,6 +84,11 @@ var WindowStore = /*#__PURE__*/function () {
|
|
79
84
|
value: function resetState() {
|
80
85
|
this.transform = null;
|
81
86
|
}
|
87
|
+
}, {
|
88
|
+
key: "disabled",
|
89
|
+
get: function get() {
|
90
|
+
return this.isTransition;
|
91
|
+
}
|
82
92
|
}, {
|
83
93
|
key: "calculateTransform",
|
84
94
|
value: function calculateTransform(transform) {
|
@@ -131,6 +141,7 @@ var WindowStore = /*#__PURE__*/function () {
|
|
131
141
|
value: function minimizeWindow() {
|
132
142
|
this.isMinimize = true;
|
133
143
|
this.fullscreen = false;
|
144
|
+
this.isTransition = true;
|
134
145
|
this.resetState();
|
135
146
|
}
|
136
147
|
}, {
|
@@ -138,12 +149,14 @@ var WindowStore = /*#__PURE__*/function () {
|
|
138
149
|
value: function normalizeWindow() {
|
139
150
|
this.isMinimize = false;
|
140
151
|
this.fullscreen = false;
|
152
|
+
this.isTransition = true;
|
141
153
|
this.resetState();
|
142
154
|
}
|
143
155
|
}, {
|
144
156
|
key: "closeWindow",
|
145
157
|
value: function closeWindow() {
|
146
158
|
this.isClosed = true;
|
159
|
+
this.isTransition = true;
|
147
160
|
this.resetState();
|
148
161
|
}
|
149
162
|
}, {
|
package/dist/Window/test.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { DndContext } from '@dnd-kit/core';
|
1
2
|
import { observer, useLocalObservable } from 'mobx-react-lite';
|
2
3
|
import React from 'react';
|
3
4
|
import { GlobalStyles } from "../__styles";
|
@@ -7,7 +8,7 @@ export default observer(function Test() {
|
|
7
8
|
var windowStore = useLocalObservable(function () {
|
8
9
|
return new WindowStore('jss');
|
9
10
|
});
|
10
|
-
return /*#__PURE__*/React.createElement(
|
11
|
+
return /*#__PURE__*/React.createElement(DndContext, null, /*#__PURE__*/React.createElement(GlobalStyles, {
|
11
12
|
$css: []
|
12
13
|
}), /*#__PURE__*/React.createElement("div", {
|
13
14
|
style: {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kep-platform/basic-component",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.46",
|
4
4
|
"description": "A react library developed with dumi",
|
5
5
|
"license": "MIT",
|
6
6
|
"module": "dist/index.js",
|
@@ -47,7 +47,7 @@
|
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
49
|
"@ant-design/icons": "^5.3.7",
|
50
|
-
"@kep-platform/hooks": "^0.0.
|
50
|
+
"@kep-platform/hooks": "^0.0.46",
|
51
51
|
"color": "^4.2.3",
|
52
52
|
"rc-pagination": "^4.1.0"
|
53
53
|
},
|
@@ -87,5 +87,5 @@
|
|
87
87
|
"authors": [
|
88
88
|
"less-step-jss 1599925910@qq.com"
|
89
89
|
],
|
90
|
-
"gitHead": "
|
90
|
+
"gitHead": "a68fe348236a6319c9232ac8d12e9cd567c1fe91"
|
91
91
|
}
|