@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.
@@ -1,169 +1,129 @@
1
- // @ts-nocheck
2
- import orderBy from 'lodash.unionby'; // used by tree merge
3
- import unique from 'lodash.uniq'; // used by tree merge
4
- import { SelectionHelper } from './selection-helpers';
5
- import { DragAndDropHelper } from './drag-drop-helpers';
6
- import { defaultPropNames } from '../consts.js';
7
-
8
- export class TreeHelper {
9
- constructor(propNames, config = {}) {
10
- this.props = { ...defaultPropNames, ...propNames };
11
- this.config = config;
12
- this.selection = new SelectionHelper(this);
13
- this.dragDrop = new DragAndDropHelper(this);
14
- }
15
-
16
- path(node) {
17
- return node?.[this.props.nodePath];
18
- }
19
-
20
- //#region basic helpres
21
-
22
- getParentNodePath(nodePath) {
23
- const separator = this.config.separator ?? '.';
24
- const parentPath = nodePath?.substring(0, nodePath.lastIndexOf(separator));
25
- return parentPath;
26
- }
27
-
28
- hasChildren(tree, nodePath) {
29
- return tree?.find((x) => this.getParentNodePath(this.path(x)) === nodePath);
30
- }
31
-
32
- findNode(tree, nodePath) {
33
- return tree.find((node) => this.path(node) === nodePath);
34
- }
35
-
36
- nodePathIsChild(nodePath) {
37
- const separator = this.config.separator ?? '.';
38
-
39
- const includesSeparator = nodePath?.includes(separator);
40
- return includesSeparator;
41
- }
42
-
43
- getDirectChildren(tree, parentNodePath) {
44
- const children = (tree || []).filter((x) =>
45
- !parentNodePath
46
- ? !this.nodePathIsChild(this.path(x))
47
- : this.getParentNodePath(this.path(x)) === parentNodePath
48
- );
49
-
50
- return children;
51
- }
52
-
53
- allCHildren(tree, parentNodePath) {
54
- let children;
55
- children = tree.filter((x) => {
56
- if (!parentNodePath) {
57
- //top level
58
- return !this.nodePathIsChild(this.path(x));
59
- } else {
60
- return this.path(x).startsWith(parentNodePath.toString()) && this.path(x) != parentNodePath;
61
- }
62
- });
63
- return children;
64
- }
65
-
66
- getAllLeafNodes(tree) {
67
- return tree.filter((x) => {
68
- return x[this.props.hasChildren] == undefined || x[this.props.hasChildren] == false;
69
- });
70
- }
71
-
72
- joinTrees(filteredTree, tree) {
73
- return tree.map((tnode) => this.findNode(filteredTree, this.path(tnode)) || tnode);
74
- }
75
-
76
- mergeTrees(oldTree, addedTree, nodePath = 'nodePath') {
77
- return orderBy(addedTree, oldTree, nodePath);
78
- }
79
-
80
- /** toggles expansion on
81
- */
82
- changeExpansion(tree, node, changeTo) {
83
- let foundNode = this.findNode(tree, this.path(node));
84
-
85
- foundNode[this.props.expanded] = changeTo;
86
- }
87
-
88
- /** changes expansion of every node that has this.hasChildren set to true
89
- */
90
- changeEveryExpansion(tree, changeTo) {
91
- return tree.map((node) => {
92
- if (node[this.props.hasChildren] == true) node[this.props.expanded] = changeTo;
93
- return node;
94
- });
95
- }
96
-
97
- /** changes expansion of every node that has this.hasChildren set to true if they are abose set level and expansion property isnt set
98
- */
99
- expandToLevel(tree, level) {
100
- return tree.map((n) => {
101
- if (
102
- n[this.props.expanded] == undefined &&
103
- n[this.props.expanded] == null &&
104
- n[this.props.useCallback] != true &&
105
- this.getDepthLevel(this.path(n)) <= level
106
- ) {
107
- n[this.props.expanded] = true;
108
- }
109
- return n;
110
- });
111
- }
112
-
113
- //based on number of dots
114
- getDepthLevel(nodePath) {
115
- const separator = this.config.separator ?? '.';
116
- return nodePath.split(separator).length - 1;
117
- }
118
-
119
- //#endregion
120
-
121
- searchTree(tree, filter, leafesOnly) {
122
- let filteredNodes;
123
- if (leafesOnly) {
124
- filteredNodes = this.getAllLeafNodes(tree).filter(filter);
125
- } else {
126
- console.log(tree);
127
- filteredNodes = tree.filter(filter);
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 { default as TreeView } from "./TreeView.svelte";
2
- export { default as MenuDivider } from "./menu/MenuDivider.svelte";
3
- export { default as MenuOption } from "./menu/MenuOption.svelte";
4
- export { TreeHelper } from "./helpers/tree-helper.js";
5
- export * as Constants from "./consts.js";
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 { TreeHelper } from './helpers/tree-helper.js';
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 SvelteComponentTyped<{
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 { SvelteComponentTyped } from "svelte";
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 SvelteComponentTyped<{
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 { SvelteComponentTyped } from "svelte";
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 SvelteComponentTyped<{
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 { SvelteComponentTyped } from "svelte";
13
+ import { SvelteComponent } from "svelte";
14
14
  declare const __propDef: {
15
15
  props: {
16
16
  [x: string]: never;
@@ -20,7 +20,7 @@
20
20
  };
21
21
  </script>
22
22
 
23
- <div class:disabled={isDisabled} on:click={handleClick}>
23
+ <div class:disabled={isDisabled} on:click={handleClick} on:keydown={handleClick} role="button" tabindex="">
24
24
  {#if text}
25
25
  {text}
26
26
  {:else}
@@ -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 SvelteComponentTyped<{
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 { SvelteComponentTyped } from "svelte";
18
+ import { SvelteComponent } from "svelte";
19
19
  declare const __propDef: {
20
20
  props: {
21
21
  isDisabled?: boolean | undefined;
@@ -61,8 +61,6 @@ $treeview-lines: solid black 1px
61
61
  align-items: center
62
62
  padding: 4px 0
63
63
 
64
- .div-has-children
65
-
66
64
  .no-arrow
67
65
  padding-left: .5rem
68
66
 
@@ -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.1",
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
- "exports": {
16
- ".": {
17
- "types": "./dist/index.d.ts",
18
- "svelte": "./dist/index.js"
19
- }
20
- },
21
- "files": [
22
- "dist",
23
- "!dist/**/*.test.*",
24
- "!dist/**/*.spec.*"
25
- ],
26
- "peerDependencies": {
27
- "svelte": "^4.0.0"
28
- },
29
- "devDependencies": {
30
- "@sveltejs/adapter-auto": "^2.0.0",
31
- "@sveltejs/kit": "^1.20.4",
32
- "@sveltejs/package": "^2.0.0",
33
- "@types/marked": "^5.0.0",
34
- "@types/node": "^20.3.3",
35
- "@typescript-eslint/eslint-plugin": "^5.45.0",
36
- "@typescript-eslint/parser": "^5.45.0",
37
- "eslint": "^8.28.0",
38
- "eslint-config-prettier": "^8.5.0",
39
- "eslint-plugin-svelte": "^2.30.0",
40
- "prettier": "^2.8.0",
41
- "prettier-plugin-svelte": "^2.10.1",
42
- "publint": "^0.1.9",
43
- "rollup-plugin-string": "^3.0.0",
44
- "sass": "^1.49.0",
45
- "svelte": "^4.0.0",
46
- "svelte-check": "^3.4.3",
47
- "svelte-preprocess": "^5.0.4",
48
- "tslib": "^2.4.1",
49
- "typescript": "^5.0.0",
50
- "vite": "^4.3.6",
51
- "@keenmate/svelte-adminlte": "^0.3.20",
52
- "@keenmate/svelte-treeview": "^0.0.1",
53
- "marked": "^5.1.0",
54
- "svelte-multiselect": "github:KeenMate/svelte-multiselect"
55
- },
56
- "svelte": "./dist/index.js",
57
- "types": "./dist/index.d.ts",
58
- "type": "module",
59
- "dependencies": {
60
- "lodash.unionby": "^4.8.0",
61
- "lodash.uniq": "^4.5.0"
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
- }