@oceanbase/ui 1.0.0-alpha.10 → 1.0.0-alpha.11
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/ui.min.js +1 -1
- package/es/Action/Group.js +1 -0
- package/es/Action/Item.js +1 -0
- package/es/Action/index.js +1 -0
- package/es/BackgroundTaskManager/RefreshMan.js +1 -0
- package/es/BackgroundTaskManager/index.js +1 -0
- package/es/BasicLayout/Header.js +1 -0
- package/es/BasicLayout/index.js +1 -0
- package/es/BatchOperationBar/index.js +1 -0
- package/es/Boundary/Components/Code.js +1 -0
- package/es/Boundary/Components/Exception.js +1 -0
- package/es/Boundary/Components/Function.js +1 -0
- package/es/Boundary/index.js +1 -0
- package/es/ContentWithIcon/index.js +1 -0
- package/es/ContentWithQuestion/index.js +1 -0
- package/es/DateRanger/PickerPanel.js +1 -0
- package/es/DateRanger/Ranger.js +1 -0
- package/es/DateRanger/index.js +1 -0
- package/es/Dialog/Anchor.js +1 -0
- package/es/Dialog/EventProxy.js +1 -0
- package/es/Dialog/index.js +1 -0
- package/es/DocDialog/index.js +1 -0
- package/es/FooterToolbar/index.js +1 -0
- package/es/FullscreenBox/index.js +1 -0
- package/es/Highlight/DiffView/DiffCells.js +1 -0
- package/es/Highlight/DiffView/index.js +1 -0
- package/es/Highlight/HighlightCell.js +1 -0
- package/es/Highlight/JsonView.js +1 -0
- package/es/Highlight/index.js +1 -0
- package/es/Highlight/useKeyDownCopyEvent.js +1 -0
- package/es/IconFont/index.js +1 -0
- package/es/LightFilter/index.js +1 -0
- package/es/LocaleDropdown/index.js +1 -0
- package/es/Login/ActivateForm.js +1 -0
- package/es/Login/LoginForm.js +1 -0
- package/es/Login/RegisterForm.js +1 -0
- package/es/Login/index.js +1 -0
- package/es/Lottie/index.js +1 -0
- package/es/NavMenu/index.js +1 -0
- package/es/PageContainer/ItemRender.js +1 -0
- package/es/PageContainer/index.js +1 -0
- package/es/PageLoading/index.js +1 -0
- package/es/Password/Content.js +1 -0
- package/es/Password/index.js +1 -0
- package/es/ProCard/index.js +1 -0
- package/es/ProTable/index.js +2 -3
- package/es/Ranger/QuickPicker.js +1 -0
- package/es/Ranger/Ranger.js +1 -0
- package/es/Ranger/index.js +1 -0
- package/es/SideTip/Dragger.js +1 -0
- package/es/SideTip/IconLoading.js +1 -0
- package/es/SideTip/index.js +1 -0
- package/es/TagSelect/Group.js +1 -0
- package/es/TagSelect/Item.js +1 -0
- package/es/TagSelect/index.js +1 -0
- package/es/TreeSearch/index.js +1 -0
- package/es/Welcome/index.js +1 -0
- package/es/Welcome/step.js +1 -0
- package/es/_util/index.js +1 -0
- package/es/constant/index.js +1 -0
- package/es/index.js +1 -0
- package/es/locale/LocaleWrapper.js +1 -0
- package/es/locale/index.js +1 -0
- package/lib/Action/Group.js +189 -162
- package/lib/Action/Item.js +47 -65
- package/lib/Action/index.js +13 -35
- package/lib/Action/style/index.js +25 -43
- package/lib/BackgroundTaskManager/RefreshMan.js +34 -50
- package/lib/BackgroundTaskManager/constants.js +10 -32
- package/lib/BackgroundTaskManager/index.js +118 -126
- package/lib/BasicLayout/Header.js +242 -200
- package/lib/BasicLayout/index.js +265 -307
- package/lib/BasicLayout/locale/en-US.js +16 -34
- package/lib/BasicLayout/locale/ja-JP.js +16 -34
- package/lib/BasicLayout/locale/zh-CN.js +16 -34
- package/lib/BasicLayout/locale/zh-TW.js +16 -34
- package/lib/BasicLayout/style/Header.js +41 -60
- package/lib/BasicLayout/style/index.js +176 -197
- package/lib/BatchOperationBar/index.js +109 -151
- package/lib/BatchOperationBar/locale/en-US.js +10 -28
- package/lib/BatchOperationBar/locale/ja-JP.js +10 -28
- package/lib/BatchOperationBar/locale/zh-CN.js +10 -28
- package/lib/BatchOperationBar/locale/zh-TW.js +10 -28
- package/lib/BatchOperationBar/style/index.js +30 -46
- package/lib/Boundary/Components/Code.js +57 -75
- package/lib/Boundary/Components/Exception.js +103 -123
- package/lib/Boundary/Components/Function.js +47 -62
- package/lib/Boundary/Components/index.js +36 -25
- package/lib/Boundary/IBoundary.js +4 -16
- package/lib/Boundary/constant.js +16 -38
- package/lib/Boundary/index.js +11 -24
- package/lib/Boundary/locale/en-US.js +14 -32
- package/lib/Boundary/locale/ja-JP.js +14 -32
- package/lib/Boundary/locale/zh-CN.js +14 -32
- package/lib/Boundary/locale/zh-TW.js +14 -32
- package/lib/Boundary/style/index.js +28 -47
- package/lib/Boundary/utils.js +9 -31
- package/lib/ContentWithIcon/index.js +101 -114
- package/lib/ContentWithIcon/style/index.js +17 -36
- package/lib/ContentWithQuestion/index.js +40 -52
- package/lib/ContentWithQuestion/style/index.js +16 -35
- package/lib/DateRanger/PickerPanel.js +343 -325
- package/lib/DateRanger/Ranger.js +430 -515
- package/lib/DateRanger/constant/index.js +188 -376
- package/lib/DateRanger/index.js +45 -64
- package/lib/DateRanger/locale/en-US.js +20 -47
- package/lib/DateRanger/locale/ja-JP.js +20 -47
- package/lib/DateRanger/locale/zh-CN.js +20 -47
- package/lib/DateRanger/locale/zh-TW.js +20 -47
- package/lib/DateRanger/style/index.js +41 -62
- package/lib/DateRanger/typing.js +4 -16
- package/lib/Dialog/Anchor.js +70 -95
- package/lib/Dialog/Dock.js +14 -36
- package/lib/Dialog/EventProxy.js +21 -39
- package/lib/Dialog/index.js +327 -370
- package/lib/Dialog/locale/en-US.js +8 -26
- package/lib/Dialog/locale/ja-JP.js +8 -26
- package/lib/Dialog/locale/zh-CN.js +8 -26
- package/lib/Dialog/locale/zh-TW.js +8 -26
- package/lib/Dialog/style/index.js +58 -76
- package/lib/DocDialog/index.js +51 -77
- package/lib/DocDialog/locale/en-US.js +5 -23
- package/lib/DocDialog/locale/ja-JP.js +5 -23
- package/lib/DocDialog/locale/zh-CN.js +5 -23
- package/lib/DocDialog/locale/zh-TW.js +5 -23
- package/lib/FooterToolbar/index.js +27 -45
- package/lib/FooterToolbar/style/index.js +23 -38
- package/lib/FullscreenBox/index.js +151 -138
- package/lib/FullscreenBox/locale/en-US.js +5 -23
- package/lib/FullscreenBox/locale/ja-JP.js +5 -23
- package/lib/FullscreenBox/locale/zh-CN.js +5 -23
- package/lib/FullscreenBox/locale/zh-TW.js +5 -23
- package/lib/FullscreenBox/style/index.js +23 -41
- package/lib/Highlight/DiffView/DiffCells.js +34 -54
- package/lib/Highlight/DiffView/index.js +165 -163
- package/lib/Highlight/HighlightCell.js +28 -47
- package/lib/Highlight/JsonView.js +45 -74
- package/lib/Highlight/index.js +200 -214
- package/lib/Highlight/languages/bash.js +7 -34
- package/lib/Highlight/languages/cpp.js +7 -34
- package/lib/Highlight/languages/css.js +7 -34
- package/lib/Highlight/languages/dockerfile.js +7 -34
- package/lib/Highlight/languages/go.js +7 -34
- package/lib/Highlight/languages/groovy.js +7 -34
- package/lib/Highlight/languages/http.js +7 -34
- package/lib/Highlight/languages/java.js +7 -34
- package/lib/Highlight/languages/javascript.js +7 -34
- package/lib/Highlight/languages/json.js +7 -34
- package/lib/Highlight/languages/markdown.js +7 -34
- package/lib/Highlight/languages/nginx.js +7 -34
- package/lib/Highlight/languages/python.js +7 -34
- package/lib/Highlight/languages/ruby.js +7 -34
- package/lib/Highlight/languages/solidity.js +7 -34
- package/lib/Highlight/languages/sql.js +7 -34
- package/lib/Highlight/languages/typescript.js +7 -34
- package/lib/Highlight/languages/xml.js +7 -34
- package/lib/Highlight/languages/yaml.js +7 -34
- package/lib/Highlight/locale/en-US.js +7 -25
- package/lib/Highlight/locale/ja-JP.js +7 -25
- package/lib/Highlight/locale/zh-CN.js +7 -25
- package/lib/Highlight/locale/zh-TW.js +7 -25
- package/lib/Highlight/style/index.js +128 -144
- package/lib/Highlight/useKeyDownCopyEvent.js +40 -64
- package/lib/IconFont/index.js +23 -28
- package/lib/LightFilter/index.js +29 -43
- package/lib/LightFilter/style/index.js +15 -33
- package/lib/LocaleDropdown/index.js +43 -53
- package/lib/Login/ActivateForm.js +93 -119
- package/lib/Login/LoginForm.js +149 -184
- package/lib/Login/RegisterForm.js +122 -163
- package/lib/Login/index.js +157 -163
- package/lib/Login/locale/en-US.js +31 -49
- package/lib/Login/locale/ja-JP.js +31 -49
- package/lib/Login/locale/zh-CN.js +31 -49
- package/lib/Login/locale/zh-TW.js +30 -48
- package/lib/Login/style/index.js +77 -98
- package/lib/Lottie/index.js +7 -24
- package/lib/NavMenu/index.js +105 -108
- package/lib/NavMenu/style/index.js +31 -49
- package/lib/PageContainer/ItemRender.js +28 -46
- package/lib/PageContainer/index.js +125 -140
- package/lib/PageContainer/locale/en-US.js +8 -26
- package/lib/PageContainer/locale/ja-JP.js +8 -26
- package/lib/PageContainer/locale/zh-CN.js +8 -26
- package/lib/PageContainer/locale/zh-TW.js +8 -26
- package/lib/PageContainer/style/index.js +19 -40
- package/lib/PageLoading/index.js +33 -54
- package/lib/Password/Content.js +92 -80
- package/lib/Password/index.js +125 -160
- package/lib/Password/locale/en-US.js +14 -32
- package/lib/Password/locale/ja-JP.js +16 -34
- package/lib/Password/locale/zh-CN.js +15 -33
- package/lib/Password/locale/zh-TW.js +14 -32
- package/lib/ProCard/index.js +77 -98
- package/lib/ProCard/style/index.js +21 -39
- package/lib/ProTable/index.js +102 -123
- package/lib/ProTable/style/index.js +21 -38
- package/lib/Ranger/QuickPicker.js +92 -94
- package/lib/Ranger/Ranger.js +98 -133
- package/lib/Ranger/constant/index.js +115 -266
- package/lib/Ranger/index.js +61 -69
- package/lib/Ranger/locale/en-US.js +31 -49
- package/lib/Ranger/locale/ja-JP.js +31 -49
- package/lib/Ranger/locale/zh-CN.js +7 -25
- package/lib/Ranger/locale/zh-TW.js +7 -25
- package/lib/Ranger/style/index.js +21 -39
- package/lib/Ranger/typing.js +4 -16
- package/lib/SideTip/Dragger.js +259 -219
- package/lib/SideTip/IconLoading.js +43 -74
- package/lib/SideTip/index.js +124 -126
- package/lib/SideTip/locale/en-US.js +5 -23
- package/lib/SideTip/locale/ja-JP.js +5 -23
- package/lib/SideTip/locale/zh-CN.js +5 -23
- package/lib/SideTip/locale/zh-TW.js +5 -23
- package/lib/SideTip/style/index.js +76 -92
- package/lib/SideTip/utils.js +40 -61
- package/lib/TagSelect/Group.js +64 -83
- package/lib/TagSelect/Item.js +68 -91
- package/lib/TagSelect/TagSelectContext.js +7 -25
- package/lib/TagSelect/index.js +12 -35
- package/lib/TagSelect/style/index.js +41 -64
- package/lib/TreeSearch/index.js +133 -127
- package/lib/TreeSearch/util.js +52 -70
- package/lib/Welcome/index.js +142 -117
- package/lib/Welcome/locale/en-US.js +8 -26
- package/lib/Welcome/locale/ja-JP.js +8 -26
- package/lib/Welcome/locale/zh-CN.js +8 -26
- package/lib/Welcome/locale/zh-TW.js +8 -26
- package/lib/Welcome/step/style/index.js +24 -40
- package/lib/Welcome/step.js +63 -59
- package/lib/Welcome/style/index.js +58 -70
- package/lib/_util/genComponentStyleHook.js +15 -43
- package/lib/_util/index.js +38 -43
- package/lib/_util/useNavigate.js +11 -26
- package/lib/constant/index.js +23 -49
- package/lib/index.js +283 -129
- package/lib/interface.js +4 -16
- package/lib/locale/LocaleWrapper.js +50 -60
- package/lib/locale/en-US.js +37 -64
- package/lib/locale/index.js +5 -16
- package/lib/locale/ja-JP.js +37 -64
- package/lib/locale/zh-CN.js +36 -63
- package/lib/locale/zh-TW.js +32 -59
- package/package.json +3 -3
package/lib/Dialog/Anchor.js
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(Anchor_exports, {
|
|
22
|
-
Anchor: () => Anchor
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
6
|
+
exports.Anchor = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _EventProxy = require("./EventProxy");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
"use client";
|
|
13
|
+
const Anchor = ({
|
|
29
14
|
children,
|
|
30
15
|
style,
|
|
31
16
|
dock,
|
|
@@ -35,74 +20,64 @@ var Anchor = ({
|
|
|
35
20
|
onEnd,
|
|
36
21
|
...restProps
|
|
37
22
|
}) => {
|
|
38
|
-
const isPointDownRef = (0,
|
|
39
|
-
const originBodyStyleRef = (0,
|
|
40
|
-
const clientXRef = (0,
|
|
41
|
-
const clientYRef = (0,
|
|
42
|
-
const onDragStart = (0,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
originBodyStyleRef.current = document.body.getAttribute("style") || "";
|
|
53
|
-
const bodyStyle = `cursor:${cursor} !important; ${originBodyStyleRef.current}`;
|
|
54
|
-
document.body.setAttribute("style", bodyStyle);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
[onStart, dock]
|
|
58
|
-
);
|
|
59
|
-
const onDragMove = (0, import_react.useCallback)(
|
|
60
|
-
(event) => {
|
|
61
|
-
if (!isPointDownRef.current)
|
|
62
|
-
return;
|
|
63
|
-
if (dock == null ? void 0 : dock.adjust) {
|
|
64
|
-
const { clientX, clientY } = event;
|
|
65
|
-
const moveX = clientX - clientXRef.current;
|
|
66
|
-
const moveY = clientY - clientYRef.current;
|
|
67
|
-
event.moveTop = moveY * (dock.adjust[0] || 0);
|
|
68
|
-
event.moveBottom = moveY * (dock.adjust[1] || 0);
|
|
69
|
-
event.moveLeft = moveX * (dock.adjust[2] || 0);
|
|
70
|
-
event.moveRight = moveX * (dock.adjust[3] || 0);
|
|
71
|
-
}
|
|
72
|
-
if (onMove)
|
|
73
|
-
onMove(event);
|
|
74
|
-
},
|
|
75
|
-
[onMove, dock]
|
|
76
|
-
);
|
|
77
|
-
const onDragEnd = (0, import_react.useCallback)(
|
|
78
|
-
(event) => {
|
|
79
|
-
if (!isPointDownRef.current)
|
|
80
|
-
return;
|
|
81
|
-
isPointDownRef.current = false;
|
|
82
|
-
if (onEnd)
|
|
83
|
-
onEnd(event);
|
|
84
|
-
if (originBodyStyleRef.current !== null) {
|
|
85
|
-
document.body.setAttribute("style", originBodyStyleRef.current);
|
|
86
|
-
}
|
|
87
|
-
originBodyStyleRef.current = null;
|
|
88
|
-
},
|
|
89
|
-
[onEnd]
|
|
90
|
-
);
|
|
91
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
92
|
-
"div",
|
|
93
|
-
{
|
|
94
|
-
className: `${prefixCls}-anchor`,
|
|
95
|
-
style: { ...style, ...dock == null ? void 0 : dock.style },
|
|
96
|
-
onPointerDown: onDragStart,
|
|
97
|
-
...restProps,
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EventProxy.EventProxy, { onPointerMove: onDragMove, onPointerUp: onDragEnd }),
|
|
100
|
-
children
|
|
101
|
-
]
|
|
23
|
+
const isPointDownRef = (0, _react.useRef)(false);
|
|
24
|
+
const originBodyStyleRef = (0, _react.useRef)(null);
|
|
25
|
+
const clientXRef = (0, _react.useRef)(0);
|
|
26
|
+
const clientYRef = (0, _react.useRef)(0);
|
|
27
|
+
const onDragStart = (0, _react.useCallback)(event => {
|
|
28
|
+
isPointDownRef.current = true;
|
|
29
|
+
clientXRef.current = event.clientX;
|
|
30
|
+
clientYRef.current = event.clientY;
|
|
31
|
+
if (onStart) onStart(event);
|
|
32
|
+
const cursor = dock?.style?.cursor;
|
|
33
|
+
if (cursor) {
|
|
34
|
+
originBodyStyleRef.current = document.body.getAttribute('style') || '';
|
|
35
|
+
const bodyStyle = `cursor:${cursor} !important; ${originBodyStyleRef.current}`;
|
|
36
|
+
document.body.setAttribute('style', bodyStyle);
|
|
102
37
|
}
|
|
103
|
-
);
|
|
38
|
+
}, [onStart, dock]);
|
|
39
|
+
const onDragMove = (0, _react.useCallback)(event => {
|
|
40
|
+
if (!isPointDownRef.current) return;
|
|
41
|
+
if (dock?.adjust) {
|
|
42
|
+
const {
|
|
43
|
+
clientX,
|
|
44
|
+
clientY
|
|
45
|
+
} = event;
|
|
46
|
+
const moveX = clientX - clientXRef.current;
|
|
47
|
+
const moveY = clientY - clientYRef.current;
|
|
48
|
+
// 以下event没有moveTop、moveBottom属性,希望在事件传递带上计算后的属性值
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
event.moveTop = moveY * (dock.adjust[0] || 0);
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
event.moveBottom = moveY * (dock.adjust[1] || 0);
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
event.moveLeft = moveX * (dock.adjust[2] || 0);
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
event.moveRight = moveX * (dock.adjust[3] || 0);
|
|
57
|
+
}
|
|
58
|
+
if (onMove) onMove(event);
|
|
59
|
+
}, [onMove, dock]);
|
|
60
|
+
const onDragEnd = (0, _react.useCallback)(event => {
|
|
61
|
+
if (!isPointDownRef.current) return;
|
|
62
|
+
isPointDownRef.current = false;
|
|
63
|
+
if (onEnd) onEnd(event);
|
|
64
|
+
if (originBodyStyleRef.current !== null) {
|
|
65
|
+
document.body.setAttribute('style', originBodyStyleRef.current);
|
|
66
|
+
}
|
|
67
|
+
originBodyStyleRef.current = null;
|
|
68
|
+
}, [onEnd]);
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
70
|
+
className: `${prefixCls}-anchor`,
|
|
71
|
+
style: {
|
|
72
|
+
...style,
|
|
73
|
+
...dock?.style
|
|
74
|
+
},
|
|
75
|
+
onPointerDown: onDragStart,
|
|
76
|
+
...restProps,
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_EventProxy.EventProxy, {
|
|
78
|
+
onPointerMove: onDragMove,
|
|
79
|
+
onPointerUp: onDragEnd
|
|
80
|
+
}), children]
|
|
81
|
+
});
|
|
104
82
|
};
|
|
105
|
-
|
|
106
|
-
0 && (module.exports = {
|
|
107
|
-
Anchor
|
|
108
|
-
});
|
|
83
|
+
exports.Anchor = Anchor;
|
package/lib/Dialog/Dock.js
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(Dock_exports, {
|
|
22
|
-
Dock: () => Dock
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
|
|
6
|
+
exports.Dock = void 0;
|
|
7
|
+
const Dock = exports.Dock = (size => {
|
|
26
8
|
return {
|
|
27
9
|
top: {
|
|
28
10
|
adjust: [1, -1, 0, 0],
|
|
@@ -31,7 +13,7 @@ var Dock = ((size) => {
|
|
|
31
13
|
height: size,
|
|
32
14
|
left: 0,
|
|
33
15
|
right: 0,
|
|
34
|
-
cursor:
|
|
16
|
+
cursor: 'ns-resize'
|
|
35
17
|
}
|
|
36
18
|
},
|
|
37
19
|
bottom: {
|
|
@@ -41,7 +23,7 @@ var Dock = ((size) => {
|
|
|
41
23
|
height: size,
|
|
42
24
|
left: 0,
|
|
43
25
|
right: 0,
|
|
44
|
-
cursor:
|
|
26
|
+
cursor: 'ns-resize'
|
|
45
27
|
}
|
|
46
28
|
},
|
|
47
29
|
left: {
|
|
@@ -51,7 +33,7 @@ var Dock = ((size) => {
|
|
|
51
33
|
width: size,
|
|
52
34
|
top: 0,
|
|
53
35
|
bottom: 0,
|
|
54
|
-
cursor:
|
|
36
|
+
cursor: 'ew-resize'
|
|
55
37
|
}
|
|
56
38
|
},
|
|
57
39
|
right: {
|
|
@@ -61,7 +43,7 @@ var Dock = ((size) => {
|
|
|
61
43
|
width: size,
|
|
62
44
|
top: 0,
|
|
63
45
|
bottom: 0,
|
|
64
|
-
cursor:
|
|
46
|
+
cursor: 'ew-resize'
|
|
65
47
|
}
|
|
66
48
|
},
|
|
67
49
|
topLeft: {
|
|
@@ -71,7 +53,7 @@ var Dock = ((size) => {
|
|
|
71
53
|
left: -size / 2,
|
|
72
54
|
width: size,
|
|
73
55
|
height: size,
|
|
74
|
-
cursor:
|
|
56
|
+
cursor: 'nwse-resize'
|
|
75
57
|
}
|
|
76
58
|
},
|
|
77
59
|
topRight: {
|
|
@@ -81,7 +63,7 @@ var Dock = ((size) => {
|
|
|
81
63
|
right: -size / 2,
|
|
82
64
|
width: size,
|
|
83
65
|
height: size,
|
|
84
|
-
cursor:
|
|
66
|
+
cursor: 'nesw-resize'
|
|
85
67
|
}
|
|
86
68
|
},
|
|
87
69
|
bottomLeft: {
|
|
@@ -91,7 +73,7 @@ var Dock = ((size) => {
|
|
|
91
73
|
left: -size / 2,
|
|
92
74
|
width: size,
|
|
93
75
|
height: size,
|
|
94
|
-
cursor:
|
|
76
|
+
cursor: 'nesw-resize'
|
|
95
77
|
}
|
|
96
78
|
},
|
|
97
79
|
bottomRight: {
|
|
@@ -101,12 +83,8 @@ var Dock = ((size) => {
|
|
|
101
83
|
right: -size / 2,
|
|
102
84
|
width: size,
|
|
103
85
|
height: size,
|
|
104
|
-
cursor:
|
|
86
|
+
cursor: 'nwse-resize'
|
|
105
87
|
}
|
|
106
88
|
}
|
|
107
89
|
};
|
|
108
|
-
})(8);
|
|
109
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
110
|
-
0 && (module.exports = {
|
|
111
|
-
Dock
|
|
112
|
-
});
|
|
90
|
+
})(8);
|
package/lib/Dialog/EventProxy.js
CHANGED
|
@@ -1,60 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(EventProxy_exports, {
|
|
22
|
-
EventProxy: () => EventProxy
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
6
|
+
exports.EventProxy = void 0;
|
|
7
|
+
var _lodash = require("lodash");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
"use client";
|
|
13
|
+
const EventProxy = props => {
|
|
14
|
+
const handlers = (0, _react.useMemo)(() => {
|
|
30
15
|
return Object.entries(props).reduce((list, [name, handler]) => {
|
|
31
16
|
let transName = name;
|
|
32
|
-
if (!(0,
|
|
33
|
-
|
|
34
|
-
if (name === "onDoubleClick")
|
|
35
|
-
transName = "onDblClick";
|
|
17
|
+
if (!(0, _lodash.isFunction)(handler) || !name.startsWith('on')) return list;
|
|
18
|
+
if (name === 'onDoubleClick') transName = 'onDblClick';
|
|
36
19
|
return [...list, [transName.slice(2).toLowerCase(), handler]];
|
|
37
20
|
}, []);
|
|
38
21
|
}, [props]);
|
|
39
|
-
const bind = (0,
|
|
22
|
+
const bind = (0, _react.useCallback)(() => {
|
|
40
23
|
handlers.forEach(([name, handler]) => {
|
|
41
24
|
document.addEventListener(name, handler);
|
|
42
25
|
});
|
|
43
26
|
}, [handlers]);
|
|
44
|
-
const unbind = (0,
|
|
27
|
+
const unbind = (0, _react.useCallback)(() => {
|
|
45
28
|
handlers.forEach(([name, handler]) => {
|
|
46
29
|
document.removeEventListener(name, handler);
|
|
47
30
|
});
|
|
48
31
|
}, [handlers]);
|
|
49
|
-
(0,
|
|
32
|
+
(0, _react.useEffect)(() => {
|
|
50
33
|
bind();
|
|
51
34
|
return () => {
|
|
52
35
|
unbind();
|
|
53
36
|
};
|
|
54
37
|
}, [bind, unbind]);
|
|
55
|
-
return
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
+
id: "event-proxy"
|
|
40
|
+
});
|
|
56
41
|
};
|
|
57
|
-
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
EventProxy
|
|
60
|
-
});
|
|
42
|
+
exports.EventProxy = EventProxy;
|