@keenmate/svelte-treeview 1.1.0-beta.3 → 1.1.1
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/README.md +16 -9
- package/dist/Branch.svelte +3 -3
- package/dist/TreeView.svelte +5 -0
- package/dist/tree-styles.sass +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@ The most elaborate treeview for svelte on earth (or even in our galaxy).
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- load new nodes
|
|
8
|
-
-
|
|
9
|
-
- checkboxes
|
|
7
|
+
- load new nodes when expanding
|
|
8
|
+
- choose what object properties to use to get necessary information (id, path, ...)
|
|
9
|
+
- enable checkboxes on whole tree or just per node
|
|
10
10
|
- recursive seletion mode, where leafes can be selected
|
|
11
11
|
- build-in support for search
|
|
12
12
|
- drag and drop functionality controlable per node
|
|
@@ -17,7 +17,9 @@ The most elaborate treeview for svelte on earth (or even in our galaxy).
|
|
|
17
17
|
|
|
18
18
|
install the package `@keenmate/svelte-treeview` using your favourite package manager.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
> [!warning]
|
|
21
|
+
> **Font awesome is required for expand/collapse icons.**
|
|
22
|
+
> If you wish to not use FA, you need to change all icons in classes properties
|
|
21
23
|
|
|
22
24
|
## Minimal usage
|
|
23
25
|
|
|
@@ -44,10 +46,11 @@ You can specify which keys to use for what properties by setting **props**.
|
|
|
44
46
|
|
|
45
47
|
For more examples see `src/routes/`
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
By default
|
|
50
|
-
|
|
49
|
+
> [!note]
|
|
50
|
+
> Both **id** and **path** is required for tree to work.
|
|
51
|
+
> By default tree uses nodePath property for both.
|
|
52
|
+
> So if you change propery fro path, you need to also change id property.
|
|
53
|
+
> You can change both using props attribute.
|
|
51
54
|
|
|
52
55
|
## Properties
|
|
53
56
|
|
|
@@ -82,10 +85,14 @@ You can change this by setting nodoId in prosp.
|
|
|
82
85
|
## Custom classes
|
|
83
86
|
|
|
84
87
|
## Drag and drop
|
|
88
|
+
> [!NOTE]
|
|
89
|
+
> In memory drag and drop is not yet supported. Tree just dispatches `moved` event with dragged node(`node`), target node (`target`) and insertion type (`insertType`).
|
|
90
|
+
> In future, this package will export function, that will allow you to easily compute new tree on frontend.
|
|
91
|
+
|
|
85
92
|
|
|
86
93
|
## Keyboard navigation
|
|
87
94
|
|
|
88
95
|
Enable keyboard navigation by setting `useKeyboardNavigation` to true.
|
|
89
96
|
|
|
90
97
|
Use arrows to navigata tree. First you need to focus some node,
|
|
91
|
-
you can use `focusNode` to do that. Use Enter or Space to select checkbox.
|
|
98
|
+
you can use `focusNode` to do that. Use Enter or Space to select checkbox.
|
package/dist/Branch.svelte
CHANGED
|
@@ -127,10 +127,10 @@ function getHighlighMode(node, highlightedNode, insertionType) {
|
|
|
127
127
|
type="button"
|
|
128
128
|
tabindex="-1"
|
|
129
129
|
>
|
|
130
|
-
<i class="
|
|
130
|
+
<i class="fixed-icon arrow {expanded ? classes.collapseIcon : classes.expandIcon}" />
|
|
131
131
|
</button>
|
|
132
132
|
{:else}
|
|
133
|
-
<span class="
|
|
133
|
+
<span class="fixed-icon" />
|
|
134
134
|
{/if}
|
|
135
135
|
|
|
136
136
|
<Checkbox
|
|
@@ -151,7 +151,7 @@ function getHighlighMode(node, highlightedNode, insertionType) {
|
|
|
151
151
|
on:dragover|stopPropagation={(e) =>
|
|
152
152
|
handleDragOver(e, node, liElements[getNodeId(node)], true)}
|
|
153
153
|
>
|
|
154
|
-
<i class="
|
|
154
|
+
<i class="fixed-icon {classes.nestIcon}" />
|
|
155
155
|
|
|
156
156
|
{#if effectiveHighlight === InsertionType.nest}
|
|
157
157
|
<slot name="nest-highlight" />
|
package/dist/TreeView.svelte
CHANGED
package/dist/tree-styles.sass
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keenmate/svelte-treeview",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run package",
|
|
@@ -70,4 +70,4 @@
|
|
|
70
70
|
"lodash.uniqby": "^4.7.0",
|
|
71
71
|
"svelte-highlight": "^7.6.1"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|