@voplus/morpho-document 6.1.67 → 6.1.68
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/obsolete/LibraryDefaultView/LibraryDefaultView2.js +2 -3
- package/es/obsolete/LibraryDefaultView/LibraryDefaultView2.js.map +1 -1
- package/es/obsolete/LibraryDefaultView/index.js +2 -3
- package/es/obsolete/LibraryDefaultView/index.js.map +1 -1
- package/es/pages/TreeViewPage/index.js.map +1 -1
- package/es/views/TreeView/index.js.map +1 -1
- package/package.json +1 -1
- package/es/components/DocumentSortableTree/SortableTreeContext.d.ts +0 -8
- package/es/components/DocumentSortableTree/SortableTreeContext.js +0 -25
- package/es/components/DocumentSortableTree/SortableTreeContext.js.map +0 -1
- package/es/components/DocumentSortableTree/index.d.ts +0 -11
- package/es/components/DocumentSortableTree/index.js +0 -161
- package/es/components/DocumentSortableTree/index.js.map +0 -1
- package/es/components/DocumentSortableTree/index.less +0 -22
- package/es/components/DocumentSortableTree/state.d.ts +0 -88
- package/es/components/DocumentSortableTree/state.js +0 -339
- package/es/components/DocumentSortableTree/state.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/index.d.ts +0 -3
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/index.js +0 -22
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/index.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.d.ts +0 -4
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.js +0 -85
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/node-content-renderer.less +0 -406
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/tree-node-renderer.d.ts +0 -3
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/tree-node-renderer.js +0 -21
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/tree-node-renderer.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/FileExplorerTheme/tree-node-renderer.less +0 -4
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/index.d.ts +0 -4
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/index.js +0 -23
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/index.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/node-content-renderer.d.ts +0 -3
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/node-content-renderer.js +0 -60
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/node-content-renderer.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/node-content-renderer.less +0 -64
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.d.ts +0 -3
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.js +0 -95
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.js.map +0 -1
- package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.less +0 -18
package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React, { Children, cloneElement, useCallback, useRef, useState } from "react";
|
|
2
|
-
import { observe } from "@voplus/morpho-ui";
|
|
3
|
-
import { useSortableTreeContext } from "../../SortableTreeContext";
|
|
4
|
-
import classnames from "classnames";
|
|
5
|
-
import styles from "./tree-node-renderer.less";
|
|
6
|
-
const FileThemeTreeNodeRenderer = (props) => {
|
|
7
|
-
const { children, listIndex, swapFrom, swapLength, swapDepth, scaffoldBlockPxWidth, lowerSiblingCounts, connectDropTarget, isOver, draggedNode, canDrop, treeIndex, treeId, // Delete from otherProps
|
|
8
|
-
getPrevRow, // Delete from otherProps
|
|
9
|
-
node, // Delete from otherProps
|
|
10
|
-
path, // Delete from otherProps
|
|
11
|
-
rowDirection, ...otherProps } = props;
|
|
12
|
-
const ref = useRef(null);
|
|
13
|
-
const tree = useSortableTreeContext();
|
|
14
|
-
const [width, setWidth] = useState(0);
|
|
15
|
-
// Construct the scaffold representing the structure of the tree
|
|
16
|
-
const scaffoldBlockCount = lowerSiblingCounts.length;
|
|
17
|
-
const scaffold = [];
|
|
18
|
-
lowerSiblingCounts.forEach((lowerSiblingCount, i) => {
|
|
19
|
-
let lineClass = "";
|
|
20
|
-
if (lowerSiblingCount > 0) {
|
|
21
|
-
// At this level in the tree, the nodes had sibling nodes further down
|
|
22
|
-
if (listIndex === 0) {
|
|
23
|
-
// Top-left corner of the tree
|
|
24
|
-
lineClass = "rst__lineHalfHorizontalRight rst__lineHalfVerticalBottom";
|
|
25
|
-
}
|
|
26
|
-
else if (i === scaffoldBlockCount - 1) {
|
|
27
|
-
// Last scaffold block in the row, right before the row content
|
|
28
|
-
lineClass = "rst__lineHalfHorizontalRight rst__lineFullVertical";
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
// Simply connecting the line extending down to the next sibling on this level
|
|
32
|
-
lineClass = "rst__lineFullVertical";
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else if (listIndex === 0) {
|
|
36
|
-
// Top-left corner of the tree, but has no siblings
|
|
37
|
-
lineClass = "rst__lineHalfHorizontalRight";
|
|
38
|
-
}
|
|
39
|
-
else if (i === scaffoldBlockCount - 1) {
|
|
40
|
-
// The last or only node in this level of the tree
|
|
41
|
-
lineClass = "rst__lineHalfVerticalTop rst__lineHalfHorizontalRight";
|
|
42
|
-
}
|
|
43
|
-
scaffold.push(React.createElement("div", { key: `pre_${1 + i}`, style: { width: scaffoldBlockPxWidth }, className: classnames("rst__lineBlock", lineClass) }));
|
|
44
|
-
if (treeIndex !== listIndex && i === swapDepth) {
|
|
45
|
-
// This row has been shifted, and is at the depth of
|
|
46
|
-
// the line pointing to the new destination
|
|
47
|
-
let highlightLineClass = "";
|
|
48
|
-
if (listIndex === swapFrom + swapLength - 1) {
|
|
49
|
-
// This block is on the bottom (target) line
|
|
50
|
-
// This block points at the target block (where the row will go when released)
|
|
51
|
-
highlightLineClass = "rst__highlightBottomLeftCorner";
|
|
52
|
-
}
|
|
53
|
-
else if (treeIndex === swapFrom) {
|
|
54
|
-
// This block is on the top (source) line
|
|
55
|
-
highlightLineClass = "rst__highlightTopLeftCorner";
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
// This block is between the bottom and top
|
|
59
|
-
highlightLineClass = "rst__highlightLineVertical";
|
|
60
|
-
}
|
|
61
|
-
const style = {
|
|
62
|
-
width: scaffoldBlockPxWidth,
|
|
63
|
-
left: scaffoldBlockPxWidth * i,
|
|
64
|
-
};
|
|
65
|
-
scaffold.push(React.createElement("div", { key: i, style: style, className: classnames("rst__absoluteLineBlock", highlightLineClass) }));
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const nodeRef = useCallback((node) => {
|
|
69
|
-
if (node !== null) {
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
setWidth(node.getBoundingClientRect().width);
|
|
72
|
-
}, 500);
|
|
73
|
-
}
|
|
74
|
-
}, [tree.isAside]);
|
|
75
|
-
return observe(() => {
|
|
76
|
-
var _a, _b;
|
|
77
|
-
return connectDropTarget(React.createElement("div", { ...otherProps, ref: nodeRef, className: classnames("rst__node", styles["documenet-node"]), style: {
|
|
78
|
-
width: "100%",
|
|
79
|
-
height: 98,
|
|
80
|
-
} },
|
|
81
|
-
scaffold,
|
|
82
|
-
React.createElement("div", { className: "rst__nodeContent", style: {
|
|
83
|
-
left: scaffoldBlockPxWidth * scaffoldBlockCount,
|
|
84
|
-
width: ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientWidth) < width - scaffoldBlockPxWidth * scaffoldBlockCount - 10
|
|
85
|
-
? (_b = ref.current) === null || _b === void 0 ? void 0 : _b.clientWidth
|
|
86
|
-
: width - scaffoldBlockPxWidth * scaffoldBlockCount - 10,
|
|
87
|
-
}, ref: ref }, Children.map(children, (child) => cloneElement(child, {
|
|
88
|
-
isOver,
|
|
89
|
-
canDrop,
|
|
90
|
-
draggedNode,
|
|
91
|
-
})))));
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
export default FileThemeTreeNodeRenderer;
|
|
95
|
-
//# sourceMappingURL=tree-node-renderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree-node-renderer.js","sourceRoot":"","sources":["../../../../../src/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,yBAAyB,GAAiB,CAAC,KAAwB,EAAE,EAAE;IAC5E,MAAM,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,OAAO,EACP,SAAS,EACT,MAAM,EAAE,yBAAyB;IACjC,UAAU,EAAE,yBAAyB;IACrC,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,yBAAyB;IAC/B,YAAY,EACZ,GAAG,UAAU,EACb,GAAG,KAAK,CAAC;IAEV,MAAM,GAAG,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,sBAAsB,EAAE,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;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CAAC,OAAO,0CAAE,WAAY,IAAG,KAAK,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,EAAE;wBACjF,CAAC,CAAC,MAAA,GAAG,CAAC,OAAO,0CAAE,WAAY;wBAC3B,CAAC,CAAC,KAAK,GAAG,oBAAoB,GAAG,kBAAkB,GAAG,EAAE;iBAC1D,EACD,GAAG,EAAE,GAAG,IAEP,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CACjC,YAAY,CAAC,KAAK,EAAE;gBACnB,MAAM;gBACN,OAAO;gBACP,WAAW;aACX,CAAC,CACF,CACI,CACD,CACN,CAAA;KAAA,CACD,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
package/es/components/DocumentSortableTree/themes/SortableTreeDocumentTheme/tree-node-renderer.less
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
@import "~@voplus/morpho-theme/styles/index.less";
|
|
2
|
-
|
|
3
|
-
.documenet-node {
|
|
4
|
-
white-space: normal;
|
|
5
|
-
:global {
|
|
6
|
-
.rst__lineHalfHorizontalRight::before,
|
|
7
|
-
.rst__lineFullVertical::after,
|
|
8
|
-
.rst__lineHalfVerticalTop::after,
|
|
9
|
-
.rst__lineHalfVerticalBottom::after {
|
|
10
|
-
position: absolute;
|
|
11
|
-
content: "";
|
|
12
|
-
background-color: #cccccc !important;
|
|
13
|
-
}
|
|
14
|
-
.document-item .file-type svg {
|
|
15
|
-
color: @purple-primary-color;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|