ebaoferc 0.0.2-beta.0 → 0.0.2-beta.1
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/components/MindGraph/core/graphic/zoom.js +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useBIHooks/index.d.ts +10 -0
- package/dist/hooks/useBIHooks/index.js +64 -0
- package/dist/utils/bi/index.d.ts +2 -0
- package/dist/utils/bi/index.js +35 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +3 -2
|
@@ -84,6 +84,7 @@ export var Zoom = /*#__PURE__*/_createClass(function Zoom(viewport) {
|
|
|
84
84
|
this.controller.filter(function (event) {
|
|
85
85
|
// 修改默认,手势
|
|
86
86
|
// 右键移动,ctrl+滚轮 缩放
|
|
87
|
+
event.preventDefault();
|
|
87
88
|
return event.button === 0 && event.type !== 'dblclick' || event.ctrlKey && event.type === 'wheel';
|
|
88
89
|
});
|
|
89
90
|
});
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import dayjs from 'dayjs';
|
|
8
|
+
import { useEffect, useRef, useState } from 'react';
|
|
9
|
+
export function useHandleWindowResize() {
|
|
10
|
+
var w = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1902;
|
|
11
|
+
var h = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1080;
|
|
12
|
+
var _useState = useState(1),
|
|
13
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14
|
+
scale = _useState2[0],
|
|
15
|
+
setScale = _useState2[1];
|
|
16
|
+
var handleWindowResize = function handleWindowResize() {
|
|
17
|
+
var _window = window,
|
|
18
|
+
innerWidth = _window.innerWidth,
|
|
19
|
+
innerHeight = _window.innerHeight;
|
|
20
|
+
var Wr = innerWidth / w;
|
|
21
|
+
var Hr = innerHeight / h;
|
|
22
|
+
setScale(Math.min(Wr, Hr));
|
|
23
|
+
};
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
handleWindowResize();
|
|
26
|
+
window.addEventListener('resize', handleWindowResize);
|
|
27
|
+
return function () {
|
|
28
|
+
window.removeEventListener('resize', handleWindowResize);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
return {
|
|
32
|
+
scale: scale
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function useTime() {
|
|
36
|
+
var _useState3 = useState(),
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
value = _useState4[0],
|
|
39
|
+
setValue = _useState4[1];
|
|
40
|
+
var intervalRef = useRef(null);
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
intervalRef.current = setInterval(function () {
|
|
43
|
+
var time = new Date();
|
|
44
|
+
var _dayjs$format$split = dayjs(time).format('YYYY-MM-DD').split('-'),
|
|
45
|
+
_dayjs$format$split2 = _slicedToArray(_dayjs$format$split, 3),
|
|
46
|
+
year = _dayjs$format$split2[0],
|
|
47
|
+
month = _dayjs$format$split2[1],
|
|
48
|
+
day = _dayjs$format$split2[2];
|
|
49
|
+
var dateStr = year + '年' + month + '月' + day + '日';
|
|
50
|
+
var weekArr = ['日', '一', '二', '三', '四', '五', '六'];
|
|
51
|
+
var weekStr = '星期' + weekArr[dayjs(time).day()];
|
|
52
|
+
var timeStr = dayjs(time).format('HH:mm:ss');
|
|
53
|
+
setValue({
|
|
54
|
+
dateStr: dateStr,
|
|
55
|
+
weekStr: weekStr,
|
|
56
|
+
timeStr: timeStr
|
|
57
|
+
});
|
|
58
|
+
}, 1000);
|
|
59
|
+
return function () {
|
|
60
|
+
return clearInterval(intervalRef.current);
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
// 打开全屏
|
|
3
|
+
export function openFullscreen() {
|
|
4
|
+
try {
|
|
5
|
+
var isFullScreen = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
|
|
6
|
+
if (!isFullScreen) {
|
|
7
|
+
if (document.documentElement.requestFullscreen) {
|
|
8
|
+
document.documentElement.requestFullscreen().catch(function () {});
|
|
9
|
+
} else if (document.documentElement.msRequestFullscreen) {
|
|
10
|
+
document.documentElement.msRequestFullscreen().catch(function () {});
|
|
11
|
+
} else if (document.documentElement.mozRequestFullScreen) {
|
|
12
|
+
document.documentElement.mozRequestFullScreen().catch(function () {});
|
|
13
|
+
} else if (document.documentElement.webkitRequestFullscreen) {
|
|
14
|
+
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT).catch(function () {});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
} catch (error) {}
|
|
18
|
+
}
|
|
19
|
+
// 关闭全屏
|
|
20
|
+
export function closeFullscreen() {
|
|
21
|
+
try {
|
|
22
|
+
var isFullScreen = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
|
|
23
|
+
if (isFullScreen) {
|
|
24
|
+
if (document.exitFullscreen) {
|
|
25
|
+
document.exitFullscreen().catch(function () {});
|
|
26
|
+
} else if (document.msExitFullscreen) {
|
|
27
|
+
document.msExitFullscreen().catch(function () {});
|
|
28
|
+
} else if (document.mozCancelFullScreen) {
|
|
29
|
+
document.mozCancelFullScreen().catch(function () {});
|
|
30
|
+
} else if (document.webkitCancelFullScreen) {
|
|
31
|
+
document.webkitCancelFullScreen().catch(function () {});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
} catch (error) {}
|
|
35
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ebaoferc",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.1",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -91,7 +91,8 @@
|
|
|
91
91
|
"react-dom": ">=16.9.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
|
-
"access": "public"
|
|
94
|
+
"access": "public",
|
|
95
|
+
"registry": "https://registry.npmjs.org"
|
|
95
96
|
},
|
|
96
97
|
"authors": []
|
|
97
98
|
}
|