@voplus/morpho-document 6.1.12 → 6.1.13
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/es/components/DocumentTabs/index.js +14 -9
- package/es/components/DocumentTabs/index.js.map +1 -1
- package/es/components/Links/NewLinkType.d.ts +0 -1
- package/es/components/Links/NewLinkType.js +2 -4
- package/es/components/Links/NewLinkType.js.map +1 -1
- package/es/components/Links/index.less +2 -12
- package/package.json +1 -1
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Tabs } from "antd";
|
|
3
|
+
import { observe } from "@voplus/morpho-ui";
|
|
2
4
|
import { Scrollbars } from "react-custom-scrollbars-2";
|
|
3
5
|
import DocumentProperties from "../DocumentProperties";
|
|
4
6
|
import ActivityLog from "@voplus/morpho-org/es/components/ActivityLog2/ActivityLog2";
|
|
5
7
|
import HeaderVisibilityController from "../ViewFrame/HeaderVisibilityController";
|
|
6
8
|
import DocumentList from "../DocumentList";
|
|
7
9
|
import Links from "../Links";
|
|
8
|
-
import { Tabs } from "antd";
|
|
9
10
|
import classnames from "classnames";
|
|
10
|
-
import { observe } from "@voplus/morpho-ui";
|
|
11
11
|
import styles from "./index.less";
|
|
12
12
|
const DocumentTabs = (props) => {
|
|
13
13
|
var _a, _b, _c;
|
|
14
14
|
const { id, active, tabItems, details, properties } = props;
|
|
15
15
|
/**Tabs 当前激活 tab 面板的 key */
|
|
16
16
|
const [activeKey, setActiveKey] = useState(active !== null && active !== void 0 ? active : "Details");
|
|
17
|
-
useEffect(() =>
|
|
18
|
-
|
|
19
|
-
// props.onChange?.(activeKey);
|
|
20
|
-
}, [id, active]);
|
|
21
|
-
const items = tabItems !== null && tabItems !== void 0 ? tabItems : [
|
|
17
|
+
useEffect(() => setActiveKey(active !== null && active !== void 0 ? active : "Details"), [id, active]);
|
|
18
|
+
let items = tabItems !== null && tabItems !== void 0 ? tabItems : [
|
|
22
19
|
{
|
|
23
20
|
key: "Document",
|
|
24
21
|
label: (_b = (_a = props.docTabOptions) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : "Document",
|
|
@@ -35,7 +32,10 @@ const DocumentTabs = (props) => {
|
|
|
35
32
|
children: React.createElement(Links, { id: id, isTitle: false }),
|
|
36
33
|
},
|
|
37
34
|
];
|
|
38
|
-
if (properties)
|
|
35
|
+
if (properties) {
|
|
36
|
+
if (items.some((item) => item.label === "Properties")) {
|
|
37
|
+
items = items.filter((item) => item.label !== "Properties");
|
|
38
|
+
}
|
|
39
39
|
items.unshift({
|
|
40
40
|
key: "Properties",
|
|
41
41
|
label: "Properties",
|
|
@@ -43,12 +43,17 @@ const DocumentTabs = (props) => {
|
|
|
43
43
|
React.createElement("div", { className: "properties-list document-properties-list" },
|
|
44
44
|
React.createElement(DocumentProperties, { id: id })))),
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
}
|
|
47
|
+
if (details) {
|
|
48
|
+
if (items.some((item) => item.label === "Details")) {
|
|
49
|
+
items = items.filter((item) => item.label !== "Details");
|
|
50
|
+
}
|
|
47
51
|
items.unshift({
|
|
48
52
|
key: "Details",
|
|
49
53
|
label: "Details",
|
|
50
54
|
children: details,
|
|
51
55
|
});
|
|
56
|
+
}
|
|
52
57
|
return observe(() => (React.createElement(Tabs, { activeKey: activeKey, onChange: onChange, className: classnames(styles.element, props.className), items: items, tabBarExtraContent: React.createElement(React.Fragment, null,
|
|
53
58
|
props.tabBarExtraContent,
|
|
54
59
|
props.headerVisibility && React.createElement(HeaderVisibilityController, null)) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentTabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DocumentTabs/index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S,CAAC,CAAC;QAC1D,CAAC;QAED,KAAK,CAAC,OAAO,CAAC;YACb,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,SAAS;YAChB,QAAQ,EAAE,OAAO;SACjB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,IAAI,IACJ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,EACtD,KAAK,EAAE,KAAK,EACZ,kBAAkB,EACjB;YACE,KAAK,CAAC,kBAAkB;YACxB,KAAK,CAAC,gBAAgB,IAAI,oBAAC,0BAA0B,OAAG,CACvD,GAEH,CACF,CAAC,CAAC;IAEH,YAAY;IACZ,SAAS,QAAQ,CAAC,SAAiB;;QAClC,YAAY,CAAC,SAAS,CAAC,CAAC;QACxB,MAAA,KAAK,CAAC,QAAQ,sDAAG,SAAS,CAAC,CAAC;IAC7B,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { Dropdown, Menu } from "antd";
|
|
2
1
|
import React, { useState } from "react";
|
|
3
|
-
import {
|
|
2
|
+
import { Dropdown, Menu, Button } from "antd";
|
|
4
3
|
const NewLinkType = (props) => {
|
|
5
4
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
6
5
|
const menu = (React.createElement(Menu, { selectedKeys: selectedKeys, onClick: onSelect, items: props.menus.map((m) => {
|
|
7
6
|
return { label: m, key: m };
|
|
8
7
|
}) }));
|
|
9
8
|
return (React.createElement(Dropdown, { dropdownRender: () => menu, trigger: ["click"], placement: "bottomRight" },
|
|
10
|
-
React.createElement(
|
|
11
|
-
React.createElement(PlusOutlined, { color: "#fff" }))));
|
|
9
|
+
React.createElement(Button, { className: "create-new-btn" }, "+ New")));
|
|
12
10
|
function onSelect({ key }) {
|
|
13
11
|
const hasKey = selectedKeys.some((selectedKey) => selectedKey === key);
|
|
14
12
|
setSelectedKeys(hasKey ? [] : [key.toString()]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewLinkType.js","sourceRoot":"","sources":["../../../src/components/Links/NewLinkType.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NewLinkType.js","sourceRoot":"","sources":["../../../src/components/Links/NewLinkType.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9C,MAAM,WAAW,GAAG,CAAC,KAA6D,EAAE,EAAE;IACrF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAE/D,MAAM,IAAI,GAAG,CACZ,oBAAC,IAAI,IACJ,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC5B,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QAC7B,CAAC,CAAC,GACD,CACF,CAAC;IACF,OAAO,CACN,oBAAC,QAAQ,IAAC,cAAc,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,SAAS,EAAC,aAAa;QAChF,oBAAC,MAAM,IAAC,SAAS,EAAC,gBAAgB,YAAe,CACvC,CACX,CAAC;IACF,SAAS,QAAQ,CAAC,EAAE,GAAG,EAAY;QAClC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,KAAK,GAAG,CAAC,CAAC;QACvE,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAChD,IAAI,KAAK,CAAC,QAAQ;YAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnE,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
:global {
|
|
9
9
|
.reference-header {
|
|
10
|
+
padding: 1em 20px;
|
|
10
11
|
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
12
|
align-items: center;
|
|
13
|
-
|
|
13
|
+
justify-content: space-between;
|
|
14
14
|
|
|
15
15
|
.multiple-remove {
|
|
16
16
|
font-weight: 600;
|
|
@@ -45,16 +45,6 @@
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
.plus-icon {
|
|
50
|
-
display: inline-block;
|
|
51
|
-
padding: 4px;
|
|
52
|
-
margin-left: 10px;
|
|
53
|
-
font-size: 13px;
|
|
54
|
-
line-height: 1px;
|
|
55
|
-
background: #1abc9c;
|
|
56
|
-
cursor: pointer;
|
|
57
|
-
}
|
|
58
48
|
}
|
|
59
49
|
|
|
60
50
|
.reference-view-page {
|