@voplus/morpho-document 6.0.25 → 6.0.26
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/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React, { MouseEventHandler, ReactNode } from "react";
|
|
2
|
-
/** 点击list item是显示quick view 还是 properties view */
|
|
3
|
-
declare const ItemFunction: (props: {
|
|
4
|
-
className?: string | undefined;
|
|
5
|
-
children?: React.ReactNode | React.ReactNode[];
|
|
6
|
-
onClick?: React.MouseEventHandler | undefined;
|
|
7
|
-
onMouseOver?: (() => void) | undefined;
|
|
8
|
-
onMouseLeave?: (() => void) | undefined;
|
|
9
|
-
/** properties view */
|
|
10
|
-
propertiesView?: ReactNode;
|
|
11
|
-
/** quick view */
|
|
12
|
-
quickViewDialog?: ((onCancel?: () => void) => ReactNode) | undefined;
|
|
13
|
-
}) => React.JSX.Element;
|
|
14
|
-
export default ItemFunction;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { useLayout } from "@voplus/morpho-data";
|
|
2
|
-
import { useViewContext } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
|
3
|
-
import { useAsideContentContext } from "@voplus/morpho-ui";
|
|
4
|
-
import classnames from "classnames";
|
|
5
|
-
import React, { useState } from "react";
|
|
6
|
-
/** 点击list item是显示quick view 还是 properties view */
|
|
7
|
-
const ItemFunction = (props) => {
|
|
8
|
-
var _a;
|
|
9
|
-
const layout = useLayout();
|
|
10
|
-
const view = useViewContext();
|
|
11
|
-
const asideContext = useAsideContentContext();
|
|
12
|
-
const [visibleQuickView, setVisibleQuickView] = useState(false);
|
|
13
|
-
return (React.createElement(React.Fragment, null,
|
|
14
|
-
React.createElement("div", { className: classnames(props.className), onClick: onQuickView, onMouseOver: props.onMouseOver, onMouseLeave: props.onMouseLeave }, props.children),
|
|
15
|
-
visibleQuickView && ((_a = props.quickViewDialog) === null || _a === void 0 ? void 0 : _a.call(props, toggleQuickView))));
|
|
16
|
-
/** Quick View */
|
|
17
|
-
function onQuickView(e) {
|
|
18
|
-
var _a;
|
|
19
|
-
if ((view === null || view === void 0 ? void 0 : view.Type) === "PropertiesView" || (view === null || view === void 0 ? void 0 : view.Type) === "QuickView") {
|
|
20
|
-
toggleQuickView();
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(props.propertiesView, {
|
|
24
|
-
span: 12,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
28
|
-
}
|
|
29
|
-
/** Quick View */
|
|
30
|
-
function toggleQuickView() {
|
|
31
|
-
var _a;
|
|
32
|
-
/* 手机模式 */
|
|
33
|
-
if (layout.ui.mobile) {
|
|
34
|
-
const element = asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent;
|
|
35
|
-
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement("div", { style: {
|
|
36
|
-
width: "100%",
|
|
37
|
-
height: "100%",
|
|
38
|
-
background: "#fff",
|
|
39
|
-
position: "absolute",
|
|
40
|
-
top: "0",
|
|
41
|
-
} }, (_a = props.quickViewDialog) === null || _a === void 0 ? void 0 : _a.call(props, () => {
|
|
42
|
-
if (asideContext === null || asideContext === void 0 ? void 0 : asideContext.asideContent)
|
|
43
|
-
asideContext.closeAside();
|
|
44
|
-
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(element, { span: 12 });
|
|
45
|
-
})), { span: 12 });
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
setVisibleQuickView(!visibleQuickView);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
export default ItemFunction;
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controls/ItemFunction/index.t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