uiconfig-blueprint 0.1.0-dev.6 → 0.1.0-dev.8
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/{allPaths-CxAGUqQA.js → allPaths-CaVZ3prc.js} +5 -5
- package/dist/{allPaths-CxAGUqQA.js.map → allPaths-CaVZ3prc.js.map} +1 -1
- package/dist/{allPathsLoader-D9qLQ797.js → allPathsLoader-DqAkPjCt.js} +4 -4
- package/dist/{allPathsLoader-D9qLQ797.js.map → allPathsLoader-DqAkPjCt.js.map} +1 -1
- package/dist/bpComponents/BPButtonComponent.d.ts +1 -0
- package/dist/bpComponents/BPColorInputComponent.d.ts +1 -0
- package/dist/bpComponents/BPComponent.d.ts +1 -0
- package/dist/bpComponents/BPFileComponent.d.ts +1 -0
- package/dist/bpComponents/BPFolderComponent.d.ts +5 -0
- package/dist/bpComponents/BPTreeComponent.d.ts +9 -3
- package/dist/components/InspectorStackComponent.d.ts +2 -1
- package/dist/components/Tree2.d.ts +52 -0
- package/dist/components/TreeNode2.d.ts +43 -0
- package/dist/components/treeTypes.d.ts +18 -0
- package/dist/{index-CWeYtJnn.js → index-CdK1RFUj.js} +2 -2
- package/dist/{index-CWeYtJnn.js.map → index-CdK1RFUj.js.map} +1 -1
- package/dist/{index-CKe0TkQl.js → index-CdVGBTp6.js} +5260 -4993
- package/dist/index-CdVGBTp6.js.map +1 -0
- package/dist/{index-Dv22bSeb.js → index-Ut14H6M3.js} +2 -2
- package/dist/{index-Dv22bSeb.js.map → index-Ut14H6M3.js.map} +1 -1
- package/dist/index.js +44 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{splitPathsBySizeLoader-DjI12iKG.js → splitPathsBySizeLoader-D0hMznHW.js} +5 -5
- package/dist/{splitPathsBySizeLoader-DjI12iKG.js.map → splitPathsBySizeLoader-D0hMznHW.js.map} +1 -1
- package/docs/classes/UI.html +3 -3
- package/docs/classes/UiConfigRendererBlueprint.html +3 -3
- package/lib/css/renderer.css +77 -10
- package/lib/css/renderer.css.map +1 -1
- package/lib/esm/ConfigObject.js +8 -4
- package/lib/esm/ConfigObject.js.map +1 -1
- package/lib/esm/UiConfigRendererBlueprint.js +22 -11
- package/lib/esm/UiConfigRendererBlueprint.js.map +1 -1
- package/lib/esm/bpComponents/BPButtonComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPButtonComponent.js +4 -2
- package/lib/esm/bpComponents/BPButtonComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPColorInputComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPColorInputComponent.js +3 -1
- package/lib/esm/bpComponents/BPColorInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPComponent.js +4 -2
- package/lib/esm/bpComponents/BPComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPDropdownInputComponent.js +2 -2
- package/lib/esm/bpComponents/BPDropdownInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPFileComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPFileComponent.js +7 -1
- package/lib/esm/bpComponents/BPFileComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPFolderComponent.d.ts +5 -0
- package/lib/esm/bpComponents/BPFolderComponent.js +46 -6
- package/lib/esm/bpComponents/BPFolderComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPInputComponent.js +2 -1
- package/lib/esm/bpComponents/BPInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPNumberInputComponent.js +1 -1
- package/lib/esm/bpComponents/BPNumberInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPTextInputComponent.js +1 -1
- package/lib/esm/bpComponents/BPTextInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPToggleInputComponent.js +3 -2
- package/lib/esm/bpComponents/BPToggleInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPTreeComponent.d.ts +9 -3
- package/lib/esm/bpComponents/BPTreeComponent.js +14 -3
- package/lib/esm/bpComponents/BPTreeComponent.js.map +1 -1
- package/lib/esm/components/ExtendedNumericInput.js +1 -1
- package/lib/esm/components/ExtendedNumericInput.js.map +1 -1
- package/lib/esm/components/InspectorStackComponent.d.ts +2 -1
- package/lib/esm/components/InspectorStackComponent.js +2 -2
- package/lib/esm/components/InspectorStackComponent.js.map +1 -1
- package/lib/esm/components/Tree2.d.ts +52 -0
- package/lib/esm/components/Tree2.js +177 -0
- package/lib/esm/components/Tree2.js.map +1 -0
- package/lib/esm/components/TreeNode2.d.ts +43 -0
- package/lib/esm/components/TreeNode2.js +111 -0
- package/lib/esm/components/TreeNode2.js.map +1 -0
- package/lib/esm/components/treeTypes.d.ts +18 -0
- package/lib/esm/components/treeTypes.js +2 -0
- package/lib/esm/components/treeTypes.js.map +1 -0
- package/package.json +3 -3
- package/src/ConfigObject.tsx +11 -4
- package/src/UiConfigRendererBlueprint.tsx +22 -11
- package/src/bpComponents/BPButtonComponent.scss +3 -1
- package/src/bpComponents/BPButtonComponent.tsx +8 -2
- package/src/bpComponents/BPColorInputComponent.tsx +7 -1
- package/src/bpComponents/BPComponent.tsx +3 -0
- package/src/bpComponents/BPDropdownInputComponent.tsx +2 -1
- package/src/bpComponents/BPFileComponent.tsx +13 -2
- package/src/bpComponents/BPFolderComponent.scss +8 -3
- package/src/bpComponents/BPFolderComponent.tsx +85 -13
- package/src/bpComponents/BPInputComponent.tsx +4 -1
- package/src/bpComponents/BPNumberInputComponent.tsx +2 -1
- package/src/bpComponents/BPTextInputComponent.tsx +1 -0
- package/src/bpComponents/BPToggleInputComponent.tsx +6 -3
- package/src/bpComponents/BPTreeComponent.tsx +21 -5
- package/src/components/ExtendedNumericInput.tsx +1 -1
- package/src/components/InspectorStackComponent.tsx +2 -2
- package/src/components/Tree2.tsx +344 -0
- package/src/components/TreeNode2.tsx +192 -0
- package/src/components/common.scss +3 -0
- package/src/components/tree2.scss +42 -0
- package/src/components/treeTypes.ts +97 -0
- package/src/renderer.scss +39 -6
- package/dist/index-CKe0TkQl.js.map +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
* Changes:
|
|
17
|
+
* - Added support for drag and drop
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import classNames from "classnames";
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
|
|
23
|
+
import {ChevronRight} from "@blueprintjs/icons";
|
|
24
|
+
|
|
25
|
+
import type {TreeEventHandler, TreeNodeInfo} from "@blueprintjs/core";
|
|
26
|
+
import {Classes, Collapse, DISPLAYNAME_PREFIX, Icon} from "@blueprintjs/core";
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
29
|
+
export interface TreeNodeProps<T = {}> extends TreeNodeInfo<T> {
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
contentRef?: (node: TreeNodeInfo<T>, element: HTMLDivElement | null) => void;
|
|
32
|
+
depth: number;
|
|
33
|
+
key?: string | number;
|
|
34
|
+
onClick?: TreeEventHandler<T>;
|
|
35
|
+
onCollapse?: TreeEventHandler<T>;
|
|
36
|
+
onContextMenu?: TreeEventHandler<T>;
|
|
37
|
+
onDoubleClick?: TreeEventHandler<T>;
|
|
38
|
+
onExpand?: TreeEventHandler<T>;
|
|
39
|
+
onMouseEnter?: TreeEventHandler<T>;
|
|
40
|
+
onMouseLeave?: TreeEventHandler<T>;
|
|
41
|
+
path: number[];
|
|
42
|
+
draggable?: boolean;
|
|
43
|
+
onDragStart?: (node: TreeNodeInfo<T>, path: number[], e: React.DragEvent<HTMLElement>) => void;
|
|
44
|
+
onDragOver?: (node: TreeNodeInfo<T>, path: number[], e: React.DragEvent<HTMLElement>) => void;
|
|
45
|
+
onDrop?: (node: TreeNodeInfo<T>, path: number[], e: React.DragEvent<HTMLElement>) => void;
|
|
46
|
+
onDragEnd?: (node: TreeNodeInfo<T>, path: number[], e: React.DragEvent<HTMLElement>) => void;
|
|
47
|
+
onDragEnter?: (node: TreeNodeInfo<T>, path: number[], e: React.DragEvent<HTMLElement>) => void;
|
|
48
|
+
onDragLeave?: (node: TreeNodeInfo<T>, path: number[], e: React.DragEvent<HTMLElement>) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Tree node component.
|
|
53
|
+
*
|
|
54
|
+
* @see https://blueprintjs.com/docs/#core/components/tree.tree-node
|
|
55
|
+
*/
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
57
|
+
export class TreeNode2<T = {}> extends React.Component<TreeNodeProps<T>> {
|
|
58
|
+
public static displayName = `${DISPLAYNAME_PREFIX}.TreeNode`;
|
|
59
|
+
|
|
60
|
+
/** @deprecated no longer necessary now that the TypeScript parser supports type arguments on JSX element tags */
|
|
61
|
+
public static ofType<U>() {
|
|
62
|
+
return TreeNode2 as new (props: TreeNodeProps<U>) => TreeNode2<U>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public render() {
|
|
66
|
+
const { children, className, disabled, icon, isExpanded, isSelected, label, draggable } = this.props;
|
|
67
|
+
const classes = classNames(
|
|
68
|
+
Classes.TREE_NODE,
|
|
69
|
+
{
|
|
70
|
+
[Classes.DISABLED]: disabled,
|
|
71
|
+
[Classes.TREE_NODE_SELECTED]: isSelected,
|
|
72
|
+
[Classes.TREE_NODE_EXPANDED]: isExpanded,
|
|
73
|
+
},
|
|
74
|
+
className,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const contentClasses = classNames(
|
|
78
|
+
Classes.TREE_NODE_CONTENT,
|
|
79
|
+
`${Classes.TREE_NODE_CONTENT}-${this.props.depth}`,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const eventHandlers =
|
|
83
|
+
disabled === true
|
|
84
|
+
? {}
|
|
85
|
+
: {
|
|
86
|
+
onClick: this.handleClick,
|
|
87
|
+
onContextMenu: this.handleContextMenu,
|
|
88
|
+
onDoubleClick: this.handleDoubleClick,
|
|
89
|
+
onMouseEnter: this.handleMouseEnter,
|
|
90
|
+
onMouseLeave: this.handleMouseLeave,
|
|
91
|
+
draggable: draggable,
|
|
92
|
+
onDragStart: this.handleDragStart,
|
|
93
|
+
onDragOver: this.handleDragOver,
|
|
94
|
+
onDrop: this.handleDrop,
|
|
95
|
+
onDragEnd: this.handleDragEnd,
|
|
96
|
+
onDragEnter: this.handleDragEnter,
|
|
97
|
+
onDragLeave: this.handleDragLeave,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<li className={classes}>
|
|
102
|
+
<div className={contentClasses} ref={this.handleContentRef} {...eventHandlers}>
|
|
103
|
+
{this.maybeRenderCaret()}
|
|
104
|
+
<Icon className={Classes.TREE_NODE_ICON} icon={icon} aria-hidden={true} tabIndex={-1} />
|
|
105
|
+
<span className={Classes.TREE_NODE_LABEL}>{label}</span>
|
|
106
|
+
{this.maybeRenderSecondaryLabel()}
|
|
107
|
+
</div>
|
|
108
|
+
<Collapse isOpen={isExpanded}>{children}</Collapse>
|
|
109
|
+
</li>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private maybeRenderCaret() {
|
|
114
|
+
const { children, isExpanded, disabled, hasCaret = React.Children.count(children) > 0 } = this.props;
|
|
115
|
+
if (hasCaret) {
|
|
116
|
+
const caretClasses = classNames(
|
|
117
|
+
Classes.TREE_NODE_CARET,
|
|
118
|
+
isExpanded ? Classes.TREE_NODE_CARET_OPEN : Classes.TREE_NODE_CARET_CLOSED,
|
|
119
|
+
);
|
|
120
|
+
return (
|
|
121
|
+
<ChevronRight
|
|
122
|
+
title={isExpanded ? "Collapse group" : "Expand group"}
|
|
123
|
+
className={caretClasses}
|
|
124
|
+
onClick={disabled === true ? undefined : this.handleCaretClick}
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return <span className={Classes.TREE_NODE_CARET_NONE} />;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private maybeRenderSecondaryLabel() {
|
|
132
|
+
if (this.props.secondaryLabel != null) {
|
|
133
|
+
return <span className={Classes.TREE_NODE_SECONDARY_LABEL}>{this.props.secondaryLabel}</span>;
|
|
134
|
+
} else {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private handleCaretClick = (e: React.MouseEvent<HTMLElement>) => {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
const { isExpanded, onCollapse, onExpand } = this.props;
|
|
142
|
+
(isExpanded ? onCollapse : onExpand)?.(this.props, this.props.path, e);
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
private handleClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
146
|
+
this.props.onClick?.(this.props, this.props.path, e);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
private handleContentRef = (element: HTMLDivElement | null) => {
|
|
150
|
+
this.props.contentRef?.(this.props, element);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
private handleContextMenu = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
154
|
+
this.props.onContextMenu?.(this.props, this.props.path, e);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
private handleDoubleClick = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
158
|
+
this.props.onDoubleClick?.(this.props, this.props.path, e);
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
private handleMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
162
|
+
this.props.onMouseEnter?.(this.props, this.props.path, e);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
private handleMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {
|
|
166
|
+
this.props.onMouseLeave?.(this.props, this.props.path, e);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
private handleDragStart = (e: React.DragEvent<HTMLDivElement>) => {
|
|
170
|
+
this.props.onDragStart?.(this.props, this.props.path, e);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
private handleDragOver = (e: React.DragEvent<HTMLDivElement>) => {
|
|
174
|
+
this.props.onDragOver?.(this.props, this.props.path, e);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
private handleDrop = (e: React.DragEvent<HTMLDivElement>) => {
|
|
178
|
+
this.props.onDrop?.(this.props, this.props.path, e);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
private handleDragEnd = (e: React.DragEvent<HTMLDivElement>) => {
|
|
182
|
+
this.props.onDragEnd?.(this.props, this.props.path, e);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
private handleDragEnter = (e: React.DragEvent<HTMLDivElement>) => {
|
|
186
|
+
this.props.onDragEnter?.(this.props, this.props.path, e);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
private handleDragLeave = (e: React.DragEvent<HTMLDivElement>) => {
|
|
190
|
+
this.props.onDragLeave?.(this.props, this.props.path, e);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
// blueprint tree drag and drop styles
|
|
3
|
+
|
|
4
|
+
//.bp5-tree-node-dragging{
|
|
5
|
+
// opacity: 0.5;
|
|
6
|
+
// background-color: green !important;
|
|
7
|
+
// box-shadow: none;
|
|
8
|
+
//}
|
|
9
|
+
//.bp5-tree-node-dragover{
|
|
10
|
+
// opacity: 0.5;
|
|
11
|
+
// background-color: red;
|
|
12
|
+
// box-shadow: none;
|
|
13
|
+
//}
|
|
14
|
+
.bp5-tree-node-dragover{
|
|
15
|
+
//opacity: 0.5;
|
|
16
|
+
//background-color: red;
|
|
17
|
+
//box-shadow: none;
|
|
18
|
+
outline: var(--pt-intent-primary) solid 2px;
|
|
19
|
+
outline-offset: -2px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.bp5-tree-drop-spacer {
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 0;
|
|
25
|
+
overflow: visible;
|
|
26
|
+
font-size: 0;
|
|
27
|
+
background: none;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
position: relative;
|
|
30
|
+
|
|
31
|
+
div{
|
|
32
|
+
width: 100%;
|
|
33
|
+
min-height: 10px;
|
|
34
|
+
background: transparent;
|
|
35
|
+
position: absolute;
|
|
36
|
+
transform: translateY(-50%);
|
|
37
|
+
z-index: 100;
|
|
38
|
+
}
|
|
39
|
+
.bp5-tree-dragging-node &{
|
|
40
|
+
pointer-events: auto;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2021 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type {IconName, MaybeElement} from "@blueprintjs/core";
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
20
|
+
export interface TreeNodeInfo<T = {}> {
|
|
21
|
+
/**
|
|
22
|
+
* A space-delimited list of class names for this tree node element.
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Child tree nodes of this node.
|
|
28
|
+
*/
|
|
29
|
+
childNodes?: Array<TreeNodeInfo<T>>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Whether this tree node is non-interactive. Enabling this prop will ignore
|
|
33
|
+
* mouse event handlers (in particular click, down, enter, leave).
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Whether the caret to expand/collapse a node should be shown.
|
|
39
|
+
* If not specified, this will be true if the node has children and false otherwise.
|
|
40
|
+
*/
|
|
41
|
+
hasCaret?: boolean;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The name of a Blueprint icon (or an icon element) to render next to the node's label.
|
|
45
|
+
*/
|
|
46
|
+
icon?: IconName | MaybeElement;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A unique identifier for the node.
|
|
50
|
+
*/
|
|
51
|
+
id: string | number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
*/
|
|
55
|
+
isExpanded?: boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Whether this node is selected.
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
isSelected?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The main label for the node.
|
|
66
|
+
*/
|
|
67
|
+
label: string | React.JSX.Element;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A secondary label/component that is displayed at the right side of the node.
|
|
71
|
+
*/
|
|
72
|
+
secondaryLabel?: string | MaybeElement;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* An optional custom user object to associate with the node.
|
|
76
|
+
* This property can then be used in the `onClick`, `onContextMenu` and `onDoubleClick`
|
|
77
|
+
* event handlers for doing custom logic per node.
|
|
78
|
+
*/
|
|
79
|
+
nodeData?: T;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Whether this node can be dragged. If false, drag events will not be enabled for this node.
|
|
83
|
+
*/
|
|
84
|
+
draggable?: boolean;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Whether this node can be a drop target. If false, drop events will not be enabled for this node.
|
|
88
|
+
*/
|
|
89
|
+
droppable?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
93
|
+
export type TreeEventHandler<T = {}> = (
|
|
94
|
+
node: TreeNodeInfo<T>,
|
|
95
|
+
nodePath: number[],
|
|
96
|
+
e: React.MouseEvent<HTMLElement>,
|
|
97
|
+
) => void;
|
package/src/renderer.scss
CHANGED
|
@@ -54,11 +54,23 @@
|
|
|
54
54
|
@import "components/common";
|
|
55
55
|
@import "bpComponents/index";
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
:root { font-family: Inter, sans-serif; }
|
|
58
|
+
|
|
59
|
+
.bp5-vars, :root {
|
|
60
|
+
--pt-text-color: var(--gray-1) !important;
|
|
61
|
+
--pt-font-family-sans: Inter, ui-sans-serif, -apple-system,"BlinkMacSystemFont","Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Open Sans","Helvetica Neue","Icons16",sans-serif;
|
|
62
|
+
}
|
|
63
|
+
.bp5-dark {
|
|
64
|
+
--pt-text-color: var(--light-gray2) !important;
|
|
65
|
+
--pt-font-family-sans: Inter, ui-sans-serif, -apple-system,"BlinkMacSystemFont","Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Open Sans","Helvetica Neue","Icons16",sans-serif;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bp5-form-group.bp5-inline label.bp5-label, .switch .bp5-label {
|
|
58
69
|
text-overflow: ellipsis;
|
|
59
70
|
overflow: hidden;
|
|
60
|
-
max-width: calc(
|
|
61
|
-
width:
|
|
71
|
+
max-width: calc(8 * $pt-font-size-small);
|
|
72
|
+
min-width: calc(8 * $pt-font-size-small);
|
|
73
|
+
width: calc(8 * $pt-font-size-small);
|
|
62
74
|
font-size: $pt-font-size-small;
|
|
63
75
|
height: $pt-input-height;
|
|
64
76
|
line-height: normal;
|
|
@@ -68,11 +80,16 @@
|
|
|
68
80
|
display: flex;
|
|
69
81
|
align-items: center;
|
|
70
82
|
justify-content: flex-start;
|
|
83
|
+
|
|
84
|
+
color: $dark-gray1;
|
|
85
|
+
.bp5-dark & {
|
|
86
|
+
color: $gray5;
|
|
87
|
+
}
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
.switch{
|
|
74
91
|
display: flex;
|
|
75
|
-
justify-content:
|
|
92
|
+
justify-content: left;
|
|
76
93
|
align-items: center;
|
|
77
94
|
flex-direction: row-reverse;
|
|
78
95
|
margin-bottom: 0;
|
|
@@ -94,7 +111,7 @@
|
|
|
94
111
|
}
|
|
95
112
|
|
|
96
113
|
:root{
|
|
97
|
-
--background-color-transition-time: 0.
|
|
114
|
+
--background-color-transition-time: 0.2s;
|
|
98
115
|
--background-color-transition: background-color var(--background-color-transition-time) ease-in-out;
|
|
99
116
|
}
|
|
100
117
|
.bp5-panel-stack-view {
|
|
@@ -114,6 +131,10 @@
|
|
|
114
131
|
position: relative;
|
|
115
132
|
overflow-y: scroll;
|
|
116
133
|
padding: 0 0 0 0;
|
|
134
|
+
|
|
135
|
+
.bp5-panel-stack2-header{
|
|
136
|
+
box-shadow: none;
|
|
137
|
+
}
|
|
117
138
|
}
|
|
118
139
|
#blueprintUiContainer {
|
|
119
140
|
height: 100%;
|
|
@@ -126,7 +147,7 @@
|
|
|
126
147
|
width: var(--blueprint-ui-container-width);
|
|
127
148
|
pointer-events: auto;
|
|
128
149
|
max-height: calc(100% - 40px);
|
|
129
|
-
border-radius:
|
|
150
|
+
border-radius: $pt-grid-size;
|
|
130
151
|
font-family: Inter, ui-sans-serif, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
131
152
|
}
|
|
132
153
|
|
|
@@ -144,6 +165,7 @@
|
|
|
144
165
|
.folderContent {
|
|
145
166
|
flex: 1 1 auto;
|
|
146
167
|
max-width: 100%;
|
|
168
|
+
margin-left: calc($pt-grid-size * 0.5);
|
|
147
169
|
}
|
|
148
170
|
|
|
149
171
|
//button {
|
|
@@ -210,3 +232,14 @@
|
|
|
210
232
|
.bp5-panel-stack2-view{
|
|
211
233
|
background: transparent;
|
|
212
234
|
}
|
|
235
|
+
|
|
236
|
+
.bp5-slider-handle{
|
|
237
|
+
border-radius: 100%;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.bp5-collapse .bp5-collapse-body {
|
|
241
|
+
transition: transform 0.3s var(--pt-transition-ease), opacity 0.3s;
|
|
242
|
+
}
|
|
243
|
+
.bp5-collapse {
|
|
244
|
+
transition: height 0.3s var(--pt-transition-ease);
|
|
245
|
+
}
|