compote-ui 0.40.1 → 0.40.2
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.
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
let {
|
|
21
21
|
items = [],
|
|
22
22
|
label,
|
|
23
|
-
|
|
24
|
-
contextNode = $bindable(null),
|
|
23
|
+
onContextMenu,
|
|
25
24
|
selectedValue = $bindable([]),
|
|
26
25
|
checkedValue = $bindable([]),
|
|
27
26
|
selectionMode = 'single',
|
|
@@ -68,7 +67,9 @@
|
|
|
68
67
|
const targetNode = target.closest('[data-part="item"], [data-part="branch-control"]');
|
|
69
68
|
if (targetNode) {
|
|
70
69
|
const nodeId = targetNode.getAttribute('data-value');
|
|
71
|
-
|
|
70
|
+
if (nodeId) {
|
|
71
|
+
onContextMenu?.({ nodeId, event });
|
|
72
|
+
}
|
|
72
73
|
}
|
|
73
74
|
}
|
|
74
75
|
</script>
|
|
@@ -4,7 +4,7 @@ import { type TreeItem } from '../../utils/collections';
|
|
|
4
4
|
declare function $$render<T extends TreeItem>(): {
|
|
5
5
|
props: TreeViewProps<T>;
|
|
6
6
|
exports: {};
|
|
7
|
-
bindings: "selectedValue" | "checkedValue"
|
|
7
|
+
bindings: "selectedValue" | "checkedValue";
|
|
8
8
|
slots: {};
|
|
9
9
|
events: {};
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ declare class __sveltets_Render<T extends TreeItem> {
|
|
|
12
12
|
props(): ReturnType<typeof $$render<T>>['props'];
|
|
13
13
|
events(): ReturnType<typeof $$render<T>>['events'];
|
|
14
14
|
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
15
|
-
bindings(): "selectedValue" | "checkedValue"
|
|
15
|
+
bindings(): "selectedValue" | "checkedValue";
|
|
16
16
|
exports(): {};
|
|
17
17
|
}
|
|
18
18
|
interface $$IsomorphicComponent {
|
|
@@ -3,5 +3,8 @@ import type { TreeItem } from '../../utils/collections';
|
|
|
3
3
|
export interface TreeViewProps<T extends TreeItem> extends Omit<UseTreeViewProps<T>, 'collection'> {
|
|
4
4
|
items?: T[];
|
|
5
5
|
label?: string;
|
|
6
|
-
|
|
6
|
+
onContextMenu?: (details: {
|
|
7
|
+
nodeId: string;
|
|
8
|
+
event: MouseEvent;
|
|
9
|
+
}) => void;
|
|
7
10
|
}
|