@keenmate/svelte-treeview 0.2.1 → 0.3.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.
- package/README.md +7 -243
- package/dist/Branch.svelte +218 -0
- package/dist/Branch.svelte.d.ts +49 -0
- package/dist/Checkbox.svelte +34 -31
- package/dist/Checkbox.svelte.d.ts +15 -29
- package/dist/TreeView.svelte +250 -288
- package/dist/TreeView.svelte.d.ts +72 -33
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +24 -0
- package/dist/helpers/drag-drop-helpers.d.ts +17 -14
- package/dist/helpers/drag-drop-helpers.js +164 -193
- package/dist/helpers/property-helper.d.ts +29 -0
- package/dist/helpers/property-helper.js +82 -0
- package/dist/helpers/selection-helpers.d.ts +28 -20
- package/dist/helpers/selection-helpers.js +148 -182
- package/dist/helpers/tree-helper.d.ts +25 -24
- package/dist/helpers/tree-helper.js +129 -169
- package/dist/index.d.ts +6 -5
- package/dist/index.js +3 -2
- package/dist/menu/ContextMenu.svelte.d.ts +2 -2
- package/dist/menu/Menu.svelte.d.ts +2 -2
- package/dist/menu/MenuDivider.svelte.d.ts +2 -2
- package/dist/menu/MenuOption.svelte +1 -1
- package/dist/menu/MenuOption.svelte.d.ts +2 -2
- package/dist/tree-styles.sass +0 -2
- package/dist/types.d.ts +46 -0
- package/dist/types.js +12 -0
- package/package.json +71 -63
- package/dist/consts.d.ts +0 -28
- package/dist/consts.js +0 -31
|
@@ -1,169 +1,129 @@
|
|
|
1
|
-
//
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const resultNodes = [];
|
|
131
|
-
|
|
132
|
-
//console.log("matching nodes length:" + matchingPathes.length)
|
|
133
|
-
filteredNodes.forEach((node) => {
|
|
134
|
-
resultNodes.push(node);
|
|
135
|
-
|
|
136
|
-
const parentNodes = this.getParents(tree, node);
|
|
137
|
-
resultNodes.push(...parentNodes);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
const uniqueNodes = unique(resultNodes, (node) => this.path(node));
|
|
141
|
-
|
|
142
|
-
return uniqueNodes;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
getParents(tree, node) {
|
|
146
|
-
const parentsPaths = [];
|
|
147
|
-
|
|
148
|
-
let nodePath = this.path(node);
|
|
149
|
-
|
|
150
|
-
// get all parents
|
|
151
|
-
while (nodePath.length > 0) {
|
|
152
|
-
nodePath = this.getParentNodePath(nodePath);
|
|
153
|
-
parentsPaths.push(nodePath);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
//find nodes for given ids
|
|
157
|
-
const parentNodes = tree.filter((n) =>
|
|
158
|
-
parentsPaths.some((parentNodePath) => this.path(n) === parentNodePath)
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
return parentNodes;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export default (...args) => {
|
|
166
|
-
// TODO redundant now, maybe remove
|
|
167
|
-
let helper = new TreeHelper(...args);
|
|
168
|
-
return helper;
|
|
169
|
-
};
|
|
1
|
+
import orderBy from 'lodash.unionby'; // used by tree merge
|
|
2
|
+
import uniqueBy from 'lodash.uniqby'; // used by tree merge
|
|
3
|
+
import { SelectionHelper } from './selection-helpers.js';
|
|
4
|
+
import { DragAndDropHelper } from './drag-drop-helpers.js';
|
|
5
|
+
export class TreeHelper {
|
|
6
|
+
props;
|
|
7
|
+
config;
|
|
8
|
+
selection;
|
|
9
|
+
dragDrop;
|
|
10
|
+
constructor(props, config = {}) {
|
|
11
|
+
this.props = props;
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.selection = new SelectionHelper(this, config?.recursive ?? false);
|
|
14
|
+
this.dragDrop = new DragAndDropHelper(this);
|
|
15
|
+
}
|
|
16
|
+
// replace with this.props.path
|
|
17
|
+
path(node) {
|
|
18
|
+
return this.props.path(node);
|
|
19
|
+
}
|
|
20
|
+
//#region basic helpres
|
|
21
|
+
getParentNodePath(nodePath) {
|
|
22
|
+
if (nodePath == null)
|
|
23
|
+
throw new Error('cannot get parent of root');
|
|
24
|
+
const separator = this.config.separator ?? '.';
|
|
25
|
+
const parentPath = nodePath?.substring(0, nodePath.lastIndexOf(separator));
|
|
26
|
+
if (parentPath === '')
|
|
27
|
+
return null;
|
|
28
|
+
return parentPath ?? null;
|
|
29
|
+
}
|
|
30
|
+
isChildrenOf(parentNodePath, childrenNodePath) {
|
|
31
|
+
if (parentNodePath === childrenNodePath)
|
|
32
|
+
return false;
|
|
33
|
+
return childrenNodePath?.startsWith(parentNodePath ?? '');
|
|
34
|
+
}
|
|
35
|
+
hasChildren(tree, nodePath) {
|
|
36
|
+
return tree?.find((x) => this.getParentNodePath(this.path(x)) === nodePath);
|
|
37
|
+
}
|
|
38
|
+
findNode(tree, nodePath) {
|
|
39
|
+
return tree.find((node) => this.path(node) === nodePath) ?? null;
|
|
40
|
+
}
|
|
41
|
+
nodePathIsChild(nodePath) {
|
|
42
|
+
const separator = this.config.separator ?? '.';
|
|
43
|
+
const includesSeparator = nodePath?.includes(separator);
|
|
44
|
+
return includesSeparator;
|
|
45
|
+
}
|
|
46
|
+
getDirectChildren(tree, parentNodePath) {
|
|
47
|
+
const children = (tree || []).filter((x) => !parentNodePath
|
|
48
|
+
? !this.nodePathIsChild(this.path(x))
|
|
49
|
+
: this.getParentNodePath(this.path(x)) === parentNodePath);
|
|
50
|
+
return children;
|
|
51
|
+
}
|
|
52
|
+
allCHildren(tree, parentNodePath) {
|
|
53
|
+
const children = tree.filter((x) => this.isChildrenOf(parentNodePath, this.path(x)));
|
|
54
|
+
return children;
|
|
55
|
+
}
|
|
56
|
+
getAllLeafNodes(tree) {
|
|
57
|
+
return tree.filter((x) => {
|
|
58
|
+
return this.props.hasChildren(x) == undefined || this.props.hasChildren(x) == false;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
joinTrees(filteredTree, tree) {
|
|
62
|
+
return tree.map((tnode) => this.findNode(filteredTree, this.path(tnode)) || tnode);
|
|
63
|
+
}
|
|
64
|
+
mergeTrees(oldTree, addedTree, nodePath = 'nodePath') {
|
|
65
|
+
return orderBy(addedTree, oldTree, nodePath);
|
|
66
|
+
}
|
|
67
|
+
/** toggles expansion on
|
|
68
|
+
*/
|
|
69
|
+
changeExpansion(tree, node, changeTo) {
|
|
70
|
+
const foundNode = this.findNode(tree, this.path(node));
|
|
71
|
+
this.props.setExpanded(foundNode, changeTo);
|
|
72
|
+
}
|
|
73
|
+
/** changes expansion of every node that has this.hasChildren set to true
|
|
74
|
+
*/
|
|
75
|
+
changeEveryExpansion(tree, changeTo) {
|
|
76
|
+
return tree.map((node) => {
|
|
77
|
+
if (this.props.hasChildren(node) == true) {
|
|
78
|
+
this.props.setExpanded(node, changeTo);
|
|
79
|
+
}
|
|
80
|
+
return node;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** changes expansion of every node that has this.hasChildren set to true if they are abose set level and expansion property isnt set
|
|
84
|
+
*/
|
|
85
|
+
expandToLevel(tree, level) {
|
|
86
|
+
return tree.map((n) => {
|
|
87
|
+
if (this.props.expanded(n) == undefined &&
|
|
88
|
+
this.props.expanded(n) == null &&
|
|
89
|
+
this.props.useCallback(n) != true &&
|
|
90
|
+
this.getDepthLevel(this.path(n)) <= level) {
|
|
91
|
+
this.props.setExpanded(n, true);
|
|
92
|
+
}
|
|
93
|
+
return n;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//based on number of dots
|
|
97
|
+
getDepthLevel(nodePath) {
|
|
98
|
+
if (nodePath == null)
|
|
99
|
+
return 0;
|
|
100
|
+
const separator = this.config.separator ?? '.';
|
|
101
|
+
return nodePath.split(separator).length - 1;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
searchTree(tree, filter) {
|
|
105
|
+
const filteredNodes = tree.filter(filter);
|
|
106
|
+
const resultNodes = [];
|
|
107
|
+
// add all parents from each node
|
|
108
|
+
// needed so that tree can be rendered
|
|
109
|
+
filteredNodes.forEach((node) => {
|
|
110
|
+
resultNodes.push(node);
|
|
111
|
+
const parentNodes = this.getParents(tree, node);
|
|
112
|
+
resultNodes.push(...parentNodes);
|
|
113
|
+
});
|
|
114
|
+
const uniqueNodes = uniqueBy(resultNodes, (node) => this.path(node));
|
|
115
|
+
return uniqueNodes;
|
|
116
|
+
}
|
|
117
|
+
getParents(tree, node) {
|
|
118
|
+
const parentsPaths = [];
|
|
119
|
+
let nodePath = this.path(node);
|
|
120
|
+
// get all parents
|
|
121
|
+
while (nodePath && nodePath.length > 0) {
|
|
122
|
+
nodePath = this.getParentNodePath(nodePath);
|
|
123
|
+
parentsPaths.push(nodePath);
|
|
124
|
+
}
|
|
125
|
+
//find nodes for given ids
|
|
126
|
+
const parentNodes = tree.filter((n) => parentsPaths.some((parentNodePath) => this.path(n) === parentNodePath));
|
|
127
|
+
return parentNodes;
|
|
128
|
+
}
|
|
129
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export {
|
|
3
|
-
export { default as
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
1
|
+
export * as Contants from './constants.js';
|
|
2
|
+
export { TreeHelper } from './helpers/tree-helper.js';
|
|
3
|
+
export { default as TreeView } from './TreeView.svelte';
|
|
4
|
+
export { default as MenuDivider } from './menu/MenuDivider.svelte';
|
|
5
|
+
export { default as MenuOption } from './menu/MenuOption.svelte';
|
|
6
|
+
export * from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
export * as Contants from './constants.js';
|
|
2
|
+
export { TreeHelper } from './helpers/tree-helper.js';
|
|
1
3
|
export { default as TreeView } from './TreeView.svelte';
|
|
2
4
|
export { default as MenuDivider } from './menu/MenuDivider.svelte';
|
|
3
5
|
export { default as MenuOption } from './menu/MenuOption.svelte';
|
|
4
|
-
export
|
|
5
|
-
export * as Constants from './consts.js';
|
|
6
|
+
export * from './types.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} ContextMenuProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} ContextMenuEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ContextMenuSlots */
|
|
4
|
-
export default class ContextMenu extends
|
|
4
|
+
export default class ContextMenu extends SvelteComponent<{
|
|
5
5
|
onRightClick?: ((e: any, n: any) => Promise<void>) | undefined;
|
|
6
6
|
}, {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
@@ -15,7 +15,7 @@ export default class ContextMenu extends SvelteComponentTyped<{
|
|
|
15
15
|
export type ContextMenuProps = typeof __propDef.props;
|
|
16
16
|
export type ContextMenuEvents = typeof __propDef.events;
|
|
17
17
|
export type ContextMenuSlots = typeof __propDef.slots;
|
|
18
|
-
import {
|
|
18
|
+
import { SvelteComponent } from "svelte";
|
|
19
19
|
declare const __propDef: {
|
|
20
20
|
props: {
|
|
21
21
|
onRightClick?: ((e: any, n: any) => Promise<void>) | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuSlots */
|
|
4
|
-
export default class Menu extends
|
|
4
|
+
export default class Menu extends SvelteComponent<{
|
|
5
5
|
x: any;
|
|
6
6
|
y: any;
|
|
7
7
|
}, {
|
|
@@ -16,7 +16,7 @@ export default class Menu extends SvelteComponentTyped<{
|
|
|
16
16
|
export type MenuProps = typeof __propDef.props;
|
|
17
17
|
export type MenuEvents = typeof __propDef.events;
|
|
18
18
|
export type MenuSlots = typeof __propDef.slots;
|
|
19
|
-
import {
|
|
19
|
+
import { SvelteComponent } from "svelte";
|
|
20
20
|
declare const __propDef: {
|
|
21
21
|
props: {
|
|
22
22
|
x: any;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuDividerProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuDividerEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuDividerSlots */
|
|
4
|
-
export default class MenuDivider extends
|
|
4
|
+
export default class MenuDivider extends SvelteComponent<{
|
|
5
5
|
[x: string]: never;
|
|
6
6
|
}, {
|
|
7
7
|
[evt: string]: CustomEvent<any>;
|
|
@@ -10,7 +10,7 @@ export default class MenuDivider extends SvelteComponentTyped<{
|
|
|
10
10
|
export type MenuDividerProps = typeof __propDef.props;
|
|
11
11
|
export type MenuDividerEvents = typeof __propDef.events;
|
|
12
12
|
export type MenuDividerSlots = typeof __propDef.slots;
|
|
13
|
-
import {
|
|
13
|
+
import { SvelteComponent } from "svelte";
|
|
14
14
|
declare const __propDef: {
|
|
15
15
|
props: {
|
|
16
16
|
[x: string]: never;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MenuOptionProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MenuOptionEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MenuOptionSlots */
|
|
4
|
-
export default class MenuOption extends
|
|
4
|
+
export default class MenuOption extends SvelteComponent<{
|
|
5
5
|
isDisabled?: boolean | undefined;
|
|
6
6
|
text?: string | undefined;
|
|
7
7
|
}, {
|
|
@@ -15,7 +15,7 @@ export default class MenuOption extends SvelteComponentTyped<{
|
|
|
15
15
|
export type MenuOptionProps = typeof __propDef.props;
|
|
16
16
|
export type MenuOptionEvents = typeof __propDef.events;
|
|
17
17
|
export type MenuOptionSlots = typeof __propDef.slots;
|
|
18
|
-
import {
|
|
18
|
+
import { SvelteComponent } from "svelte";
|
|
19
19
|
declare const __propDef: {
|
|
20
20
|
props: {
|
|
21
21
|
isDisabled?: boolean | undefined;
|
package/dist/tree-styles.sass
CHANGED
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type Props = {
|
|
2
|
+
nodePath: string;
|
|
3
|
+
hasChildren: string;
|
|
4
|
+
expanded: string;
|
|
5
|
+
selected: string;
|
|
6
|
+
useCallback: string;
|
|
7
|
+
priority: string;
|
|
8
|
+
isDraggable: string;
|
|
9
|
+
insertDisabled: string;
|
|
10
|
+
nestDisabled: string;
|
|
11
|
+
checkbox: string;
|
|
12
|
+
visualState: string;
|
|
13
|
+
};
|
|
14
|
+
export declare enum VisualStates {
|
|
15
|
+
indeterminate = "indeterminate",
|
|
16
|
+
selected = "true",
|
|
17
|
+
notSelected = "false"
|
|
18
|
+
}
|
|
19
|
+
export declare enum SelectionModes {
|
|
20
|
+
all = "all",
|
|
21
|
+
perNode = "perNode",
|
|
22
|
+
none = "none"
|
|
23
|
+
}
|
|
24
|
+
export type Node = unknown;
|
|
25
|
+
export type Tree = Node[];
|
|
26
|
+
export type InsertionType = -1 | 0 | 1;
|
|
27
|
+
export type NodePath = string | null;
|
|
28
|
+
export type CustomizableClasses = {
|
|
29
|
+
treeClass: string;
|
|
30
|
+
nodeClass: string;
|
|
31
|
+
expandedToggleClass: string;
|
|
32
|
+
collapsedToggleClass: string;
|
|
33
|
+
expandClass: string;
|
|
34
|
+
inserLineClass: string;
|
|
35
|
+
inserLineNestClass: string;
|
|
36
|
+
currentlyDraggedClass: string;
|
|
37
|
+
};
|
|
38
|
+
export type DragEnterCallback = (draggendNode: Node, oldParent: Node, newParent: Node) => boolean;
|
|
39
|
+
export type BeforeMovedCallback = (draggendNode: Node, oldParent: Node, newParent: Node, insertionType: string) => boolean;
|
|
40
|
+
export type ExpandedCallback = (node: Node) => Promise<Node[]>;
|
|
41
|
+
export type HelperConfig = {
|
|
42
|
+
separator?: string;
|
|
43
|
+
recursive?: boolean;
|
|
44
|
+
recalculateNodePath?: boolean;
|
|
45
|
+
checkboxes?: SelectionModes;
|
|
46
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var VisualStates;
|
|
2
|
+
(function (VisualStates) {
|
|
3
|
+
VisualStates["indeterminate"] = "indeterminate";
|
|
4
|
+
VisualStates["selected"] = "true";
|
|
5
|
+
VisualStates["notSelected"] = "false";
|
|
6
|
+
})(VisualStates || (VisualStates = {}));
|
|
7
|
+
export var SelectionModes;
|
|
8
|
+
(function (SelectionModes) {
|
|
9
|
+
SelectionModes["all"] = "all";
|
|
10
|
+
SelectionModes["perNode"] = "perNode";
|
|
11
|
+
SelectionModes["none"] = "none";
|
|
12
|
+
})(SelectionModes || (SelectionModes = {}));
|
package/package.json
CHANGED
|
@@ -1,63 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@keenmate/svelte-treeview",
|
|
3
|
-
"version": "0.2
|
|
4
|
-
"scripts": {
|
|
5
|
-
"dev": "vite dev",
|
|
6
|
-
"build": "vite build && npm run package",
|
|
7
|
-
"preview": "vite preview",
|
|
8
|
-
"package": "svelte-kit sync && svelte-package && publint",
|
|
9
|
-
"prepublishOnly": "npm run package",
|
|
10
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
11
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
12
|
-
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
13
|
-
"format": "prettier --plugin-search-dir . --write ."
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"eslint-plugin
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"svelte
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"svelte-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@keenmate/svelte-treeview",
|
|
3
|
+
"version": "0.3.2",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dev": "vite dev",
|
|
6
|
+
"build": "vite build && npm run package",
|
|
7
|
+
"preview": "vite preview",
|
|
8
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
9
|
+
"prepublishOnly": "npm run package",
|
|
10
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
11
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
12
|
+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
|
13
|
+
"format": "prettier --plugin-search-dir . --write .",
|
|
14
|
+
"test": "vitest",
|
|
15
|
+
"test:loud": "vitest --silent=false",
|
|
16
|
+
"coverage": "vitest run --coverage"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"svelte": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"!dist/**/*.test.*",
|
|
27
|
+
"!dist/**/*.spec.*"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"svelte": "^4.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@keenmate/svelte-adminlte": "^1.1.3",
|
|
34
|
+
"@sveltejs/adapter-auto": "^2.0.0",
|
|
35
|
+
"@sveltejs/kit": "^1.20.4",
|
|
36
|
+
"@sveltejs/package": "^2.0.0",
|
|
37
|
+
"@types/marked": "^5.0.0",
|
|
38
|
+
"@types/node": "^20.3.3",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
40
|
+
"@typescript-eslint/parser": "^5.45.0",
|
|
41
|
+
"@vitest/coverage-v8": "^1.4.0",
|
|
42
|
+
"eslint": "^8.28.0",
|
|
43
|
+
"eslint-config-prettier": "^8.5.0",
|
|
44
|
+
"eslint-plugin-svelte": "^2.30.0",
|
|
45
|
+
"marked": "^5.1.0",
|
|
46
|
+
"prettier": "^2.8.0",
|
|
47
|
+
"prettier-plugin-svelte": "^2.10.1",
|
|
48
|
+
"publint": "^0.1.9",
|
|
49
|
+
"rollup-plugin-string": "^3.0.0",
|
|
50
|
+
"sass": "^1.49.0",
|
|
51
|
+
"svelte": "^4.0.0",
|
|
52
|
+
"svelte-check": "^3.4.3",
|
|
53
|
+
"svelte-multiselect": "github:KeenMate/svelte-multiselect",
|
|
54
|
+
"svelte-preprocess": "^5.0.4",
|
|
55
|
+
"tslib": "^2.4.1",
|
|
56
|
+
"typescript": "^5.0.0",
|
|
57
|
+
"vite": "^4.3.6",
|
|
58
|
+
"vitest": "^1.4.0"
|
|
59
|
+
},
|
|
60
|
+
"svelte": "./dist/index.js",
|
|
61
|
+
"types": "./dist/index.d.ts",
|
|
62
|
+
"type": "module",
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@types/lodash.unionby": "^4.8.9",
|
|
65
|
+
"@types/lodash.uniq": "^4.5.9",
|
|
66
|
+
"@types/lodash.uniqby": "^4.7.9",
|
|
67
|
+
"lodash.unionby": "^4.8.0",
|
|
68
|
+
"lodash.uniq": "^4.5.0",
|
|
69
|
+
"lodash.uniqby": "^4.7.0"
|
|
70
|
+
}
|
|
71
|
+
}
|
package/dist/consts.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export namespace defaultPropNames {
|
|
2
|
-
let nodePath: string;
|
|
3
|
-
let hasChildren: string;
|
|
4
|
-
let expanded: string;
|
|
5
|
-
let selected: string;
|
|
6
|
-
let useCallback: string;
|
|
7
|
-
let priority: string;
|
|
8
|
-
let isDraggable: string;
|
|
9
|
-
let insertDisabled: string;
|
|
10
|
-
let nestDisabled: string;
|
|
11
|
-
let checkbox: string;
|
|
12
|
-
}
|
|
13
|
-
export const defaultPixelTreshold: 50;
|
|
14
|
-
export const defaultTreeClass: "treeview";
|
|
15
|
-
export const defaultExpandClass: "inserting-highlighted";
|
|
16
|
-
export const defaultCurrentlyDraggedClass: "currently-dragged";
|
|
17
|
-
export namespace checkboxesType {
|
|
18
|
-
let all: string;
|
|
19
|
-
let perNode: string;
|
|
20
|
-
let none: string;
|
|
21
|
-
let readonly: string;
|
|
22
|
-
}
|
|
23
|
-
export namespace visualStateType {
|
|
24
|
-
export let indeterminate: string;
|
|
25
|
-
let selected_1: string;
|
|
26
|
-
export { selected_1 as selected };
|
|
27
|
-
export let notSelected: string;
|
|
28
|
-
}
|