+
this.main.mount(shell)} className="lc-outline-tree-container">
diff --git a/packages/plugin-outline-pane/src/views/style.less b/packages/plugin-outline-pane/src/views/style.less
index 32fd979cf..423dbbb4e 100644
--- a/packages/plugin-outline-pane/src/views/style.less
+++ b/packages/plugin-outline-pane/src/views/style.less
@@ -6,13 +6,41 @@
background-color: white;
> .lc-outline-tree-container {
- top: 0;
+ top: 52px;
left: 0;
bottom: 0;
right: 0;
position: absolute;
overflow: auto;
}
+
+ > .lc-outline-filter {
+ padding: 12px 16px;
+ display: flex;
+ align-items: center;
+ justify-content: right;
+
+ .lc-outline-filter-search-input {
+ width: 100%;
+ }
+
+ .lc-outline-filter-icon {
+ background: #ebecf0;
+ border: 1px solid #c4c6cf;
+ height: 28px;
+ display: flex;
+ align-items: center;
+ border-radius: 0 2px 2px 0;
+ overflow: hidden;
+ margin-left: -2px;
+ z-index: 1;
+ padding: 0 6px;
+
+ &:hover {
+ cursor: pointer;
+ }
+ }
+ }
}
.lc-outline-tree {
diff --git a/packages/plugin-outline-pane/src/views/tree-branches.tsx b/packages/plugin-outline-pane/src/views/tree-branches.tsx
index 6a953a29b..4521fe2e7 100644
--- a/packages/plugin-outline-pane/src/views/tree-branches.tsx
+++ b/packages/plugin-outline-pane/src/views/tree-branches.tsx
@@ -14,8 +14,11 @@ export default class TreeBranches extends Component<{
render() {
const { treeNode, isModal } = this.props;
const { expanded } = treeNode;
+ const { filterWorking, matchChild } = treeNode.filterReult;
+ // 条件过滤生效时,如果命中了子节点,需要将该节点展开
+ const expandInFilterResult = filterWorking && matchChild;
- if (!expanded) {
+ if (!expandInFilterResult && !expanded) {
return null;
}
@@ -40,12 +43,18 @@ class TreeNodeChildren extends Component<{
const children: any = [];
let groupContents: any[] = [];
let currentGrp: ExclusiveGroup;
+ const { filterWorking, matchSelf, keywords } = treeNode.filterReult;
+
const endGroup = () => {
if (groupContents.length > 0) {
children.push(
,
diff --git a/packages/plugin-outline-pane/src/views/tree-node.tsx b/packages/plugin-outline-pane/src/views/tree-node.tsx
index 234296ce5..282be0a21 100644
--- a/packages/plugin-outline-pane/src/views/tree-node.tsx
+++ b/packages/plugin-outline-pane/src/views/tree-node.tsx
@@ -32,6 +32,13 @@ export default class TreeNodeView extends Component<{
highlight: treeNode.isFocusingNode(),
});
+ const { filterWorking, matchChild, matchSelf } = treeNode.filterReult;
+
+ // 条件过滤生效时,如果未命中本节点或子节点,则不展示该节点
+ if (filterWorking && !matchChild && !matchSelf) {
+ return null;
+ }
+
return (
diff --git a/packages/plugin-outline-pane/src/views/tree-title.tsx b/packages/plugin-outline-pane/src/views/tree-title.tsx
index 42a75d804..245c10934 100644
--- a/packages/plugin-outline-pane/src/views/tree-title.tsx
+++ b/packages/plugin-outline-pane/src/views/tree-title.tsx
@@ -96,6 +96,7 @@ export default class TreeTitle extends Component<{
marginLeft: -indent,
};
}
+ const { filterWorking, matchSelf, keywords } = treeNode.filterReult;
return (
) : (
-
+
{node.slotFor && (
{/* todo: click redirect to prop */}