@elliemae/ds-treeview 2.3.1 → 3.0.0-alpha.3
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/cjs/TreeView.js +50 -0
- package/dist/cjs/TreeView.js.map +7 -0
- package/dist/cjs/TreeViewContext.js +116 -0
- package/dist/cjs/TreeViewContext.js.map +7 -0
- package/dist/cjs/config/cssClassesConstants.js +41 -0
- package/dist/cjs/config/cssClassesConstants.js.map +7 -0
- package/dist/cjs/config/useTreeview.js +163 -0
- package/dist/cjs/config/useTreeview.js.map +7 -0
- package/dist/cjs/hoc/DnDTreeContext.js +45 -0
- package/dist/cjs/hoc/DnDTreeContext.js.map +7 -0
- package/dist/cjs/hoc/SortableItemContext.js +46 -0
- package/dist/cjs/hoc/SortableItemContext.js.map +7 -0
- package/dist/cjs/hoc/WithConditionalDnDContext.js +134 -0
- package/dist/cjs/hoc/WithConditionalDnDContext.js.map +7 -0
- package/dist/cjs/hoc/WithDnDSortableItemContext.js +83 -0
- package/dist/cjs/hoc/WithDnDSortableItemContext.js.map +7 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/parts/CheckboxSelectable.js +111 -0
- package/dist/cjs/parts/CheckboxSelectable.js.map +7 -0
- package/dist/cjs/parts/ChildrenCountDisplayer.js +47 -0
- package/dist/cjs/parts/ChildrenCountDisplayer.js.map +7 -0
- package/dist/cjs/parts/DnDHandle.js +71 -0
- package/dist/cjs/parts/DnDHandle.js.map +7 -0
- package/dist/cjs/parts/DropIndicator.js +80 -0
- package/dist/cjs/parts/DropIndicator.js.map +7 -0
- package/dist/cjs/parts/ExpandCaret.js +96 -0
- package/dist/cjs/parts/ExpandCaret.js.map +7 -0
- package/dist/cjs/parts/Icon.js +52 -0
- package/dist/cjs/parts/Icon.js.map +7 -0
- package/dist/cjs/parts/NestingSpace.js +55 -0
- package/dist/cjs/parts/NestingSpace.js.map +7 -0
- package/dist/cjs/parts/RadioSelectable.js +74 -0
- package/dist/cjs/parts/RadioSelectable.js.map +7 -0
- package/dist/cjs/parts/TreeItem.js +180 -0
- package/dist/cjs/parts/TreeItem.js.map +7 -0
- package/dist/cjs/parts/TreeItemText.js +101 -0
- package/dist/cjs/parts/TreeItemText.js.map +7 -0
- package/dist/cjs/parts/TreeList.js +135 -0
- package/dist/cjs/parts/TreeList.js.map +7 -0
- package/dist/cjs/plugins/dnd/TreeDndPlugin.js +35 -0
- package/dist/cjs/plugins/dnd/TreeDndPlugin.js.map +7 -0
- package/dist/cjs/plugins/dnd/index.js +28 -0
- package/dist/cjs/plugins/dnd/index.js.map +7 -0
- package/dist/cjs/plugins/index.js +34 -0
- package/dist/cjs/plugins/index.js.map +7 -0
- package/dist/cjs/plugins/roving/TreeRovingPlugin.js +35 -0
- package/dist/cjs/plugins/roving/TreeRovingPlugin.js.map +7 -0
- package/dist/cjs/plugins/roving/index.js +28 -0
- package/dist/cjs/plugins/roving/index.js.map +7 -0
- package/dist/cjs/plugins/searchable/SearchableTreePlugin.js +35 -0
- package/dist/cjs/plugins/searchable/SearchableTreePlugin.js.map +7 -0
- package/dist/cjs/plugins/searchable/index.js +28 -0
- package/dist/cjs/plugins/searchable/index.js.map +7 -0
- package/dist/cjs/plugins/selectable/SelectablePluginTree.js +35 -0
- package/dist/cjs/plugins/selectable/SelectablePluginTree.js.map +7 -0
- package/dist/cjs/plugins/selectable/index.js +28 -0
- package/dist/cjs/plugins/selectable/index.js.map +7 -0
- package/dist/cjs/plugins/toolbar/TreeToolbarPlugin.js +35 -0
- package/dist/cjs/plugins/toolbar/TreeToolbarPlugin.js.map +7 -0
- package/dist/cjs/plugins/toolbar/index.js +28 -0
- package/dist/cjs/plugins/toolbar/index.js.map +7 -0
- package/dist/cjs/plugins/tree/TreeDataPlugin.js +35 -0
- package/dist/cjs/plugins/tree/TreeDataPlugin.js.map +7 -0
- package/dist/cjs/plugins/tree/index.js +28 -0
- package/dist/cjs/plugins/tree/index.js.map +7 -0
- package/dist/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +35 -0
- package/dist/cjs/plugins/virtualization/TreeVirtualizationPlugin.js.map +7 -0
- package/dist/cjs/plugins/virtualization/index.js +28 -0
- package/dist/cjs/plugins/virtualization/index.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +85 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/related-components/TreeViewSearchBar.js +50 -0
- package/dist/cjs/related-components/TreeViewSearchBar.js.map +7 -0
- package/dist/cjs/sharedTypes.js +27 -0
- package/dist/cjs/sharedTypes.js.map +7 -0
- package/dist/cjs/utils/array-helpers.js +48 -0
- package/dist/cjs/utils/array-helpers.js.map +7 -0
- package/dist/cjs/utils/group-expands-helpers.js +138 -0
- package/dist/cjs/utils/group-expands-helpers.js.map +7 -0
- package/dist/cjs/utils/keyboard-helpers.js +170 -0
- package/dist/cjs/utils/keyboard-helpers.js.map +7 -0
- package/dist/cjs/utils/object-helpers.js +76 -0
- package/dist/cjs/utils/object-helpers.js.map +7 -0
- package/dist/cjs/utils/refs-helpers.js +52 -0
- package/dist/cjs/utils/refs-helpers.js.map +7 -0
- package/dist/cjs/utils/selectable-helper.js +102 -0
- package/dist/cjs/utils/selectable-helper.js.map +7 -0
- package/dist/cjs/utils/string-helpers.js +35 -0
- package/dist/cjs/utils/string-helpers.js.map +7 -0
- package/dist/cjs/utils/tree-helpers.js +184 -0
- package/dist/cjs/utils/tree-helpers.js.map +7 -0
- package/dist/cjs/utils/useInstanceRefActions.js +98 -0
- package/dist/cjs/utils/useInstanceRefActions.js.map +7 -0
- package/dist/cjs/utils/useTree.js +123 -0
- package/dist/cjs/utils/useTree.js.map +7 -0
- package/dist/esm/TreeView.js +21 -0
- package/dist/esm/TreeView.js.map +7 -0
- package/{esm → dist/esm}/TreeViewContext.js +24 -29
- package/dist/esm/TreeViewContext.js.map +7 -0
- package/dist/esm/config/cssClassesConstants.js +12 -0
- package/dist/esm/config/cssClassesConstants.js.map +7 -0
- package/dist/esm/config/useTreeview.js +136 -0
- package/dist/esm/config/useTreeview.js.map +7 -0
- package/dist/esm/hoc/DnDTreeContext.js +16 -0
- package/dist/esm/hoc/DnDTreeContext.js.map +7 -0
- package/dist/esm/hoc/SortableItemContext.js +17 -0
- package/dist/esm/hoc/SortableItemContext.js.map +7 -0
- package/dist/esm/hoc/WithConditionalDnDContext.js +107 -0
- package/dist/esm/hoc/WithConditionalDnDContext.js.map +7 -0
- package/dist/esm/hoc/WithDnDSortableItemContext.js +56 -0
- package/dist/esm/hoc/WithDnDSortableItemContext.js.map +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/parts/CheckboxSelectable.js +84 -0
- package/dist/esm/parts/CheckboxSelectable.js.map +7 -0
- package/dist/esm/parts/ChildrenCountDisplayer.js +18 -0
- package/dist/esm/parts/ChildrenCountDisplayer.js.map +7 -0
- package/dist/esm/parts/DnDHandle.js +44 -0
- package/dist/esm/parts/DnDHandle.js.map +7 -0
- package/dist/esm/parts/DropIndicator.js +51 -0
- package/dist/esm/parts/DropIndicator.js.map +7 -0
- package/dist/esm/parts/ExpandCaret.js +67 -0
- package/dist/esm/parts/ExpandCaret.js.map +7 -0
- package/dist/esm/parts/Icon.js +23 -0
- package/dist/esm/parts/Icon.js.map +7 -0
- package/dist/esm/parts/NestingSpace.js +26 -0
- package/dist/esm/parts/NestingSpace.js.map +7 -0
- package/dist/esm/parts/RadioSelectable.js +45 -0
- package/dist/esm/parts/RadioSelectable.js.map +7 -0
- package/dist/esm/parts/TreeItem.js +153 -0
- package/dist/esm/parts/TreeItem.js.map +7 -0
- package/dist/esm/parts/TreeItemText.js +72 -0
- package/dist/esm/parts/TreeItemText.js.map +7 -0
- package/dist/esm/parts/TreeList.js +108 -0
- package/dist/esm/parts/TreeList.js.map +7 -0
- package/dist/esm/plugins/dnd/TreeDndPlugin.js +6 -0
- package/dist/esm/plugins/dnd/TreeDndPlugin.js.map +7 -0
- package/dist/esm/plugins/dnd/index.js +3 -0
- package/dist/esm/plugins/dnd/index.js.map +7 -0
- package/dist/esm/plugins/index.js +9 -0
- package/dist/esm/plugins/index.js.map +7 -0
- package/dist/esm/plugins/roving/TreeRovingPlugin.js +6 -0
- package/dist/esm/plugins/roving/TreeRovingPlugin.js.map +7 -0
- package/dist/esm/plugins/roving/index.js +3 -0
- package/dist/esm/plugins/roving/index.js.map +7 -0
- package/dist/esm/plugins/searchable/SearchableTreePlugin.js +6 -0
- package/dist/esm/plugins/searchable/SearchableTreePlugin.js.map +7 -0
- package/dist/esm/plugins/searchable/index.js +3 -0
- package/dist/esm/plugins/searchable/index.js.map +7 -0
- package/dist/esm/plugins/selectable/SelectablePluginTree.js +6 -0
- package/dist/esm/plugins/selectable/SelectablePluginTree.js.map +7 -0
- package/dist/esm/plugins/selectable/index.js +3 -0
- package/dist/esm/plugins/selectable/index.js.map +7 -0
- package/dist/esm/plugins/toolbar/TreeToolbarPlugin.js +6 -0
- package/dist/esm/plugins/toolbar/TreeToolbarPlugin.js.map +7 -0
- package/dist/esm/plugins/toolbar/index.js +3 -0
- package/dist/esm/plugins/toolbar/index.js.map +7 -0
- package/dist/esm/plugins/tree/TreeDataPlugin.js +6 -0
- package/dist/esm/plugins/tree/TreeDataPlugin.js.map +7 -0
- package/dist/esm/plugins/tree/index.js +3 -0
- package/dist/esm/plugins/tree/index.js.map +7 -0
- package/dist/esm/plugins/virtualization/TreeVirtualizationPlugin.js +6 -0
- package/dist/esm/plugins/virtualization/TreeVirtualizationPlugin.js.map +7 -0
- package/dist/esm/plugins/virtualization/index.js +3 -0
- package/dist/esm/plugins/virtualization/index.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +56 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/related-components/TreeViewSearchBar.js +21 -0
- package/dist/esm/related-components/TreeViewSearchBar.js.map +7 -0
- package/dist/esm/sharedTypes.js +2 -0
- package/dist/esm/sharedTypes.js.map +7 -0
- package/{esm → dist/esm}/utils/array-helpers.js +6 -6
- package/dist/esm/utils/array-helpers.js.map +7 -0
- package/dist/esm/utils/group-expands-helpers.js +109 -0
- package/dist/esm/utils/group-expands-helpers.js.map +7 -0
- package/{esm → dist/esm}/utils/keyboard-helpers.js +43 -71
- package/dist/esm/utils/keyboard-helpers.js.map +7 -0
- package/dist/esm/utils/object-helpers.js +47 -0
- package/dist/esm/utils/object-helpers.js.map +7 -0
- package/dist/esm/utils/refs-helpers.js +23 -0
- package/dist/esm/utils/refs-helpers.js.map +7 -0
- package/dist/esm/utils/selectable-helper.js +75 -0
- package/dist/esm/utils/selectable-helper.js.map +7 -0
- package/dist/esm/utils/string-helpers.js +6 -0
- package/dist/esm/utils/string-helpers.js.map +7 -0
- package/dist/esm/utils/tree-helpers.js +155 -0
- package/dist/esm/utils/tree-helpers.js.map +7 -0
- package/{esm → dist/esm}/utils/useInstanceRefActions.js +21 -35
- package/dist/esm/utils/useInstanceRefActions.js.map +7 -0
- package/dist/esm/utils/useTree.js +96 -0
- package/dist/esm/utils/useTree.js.map +7 -0
- package/package.json +133 -123
- package/cjs/TreeView.js +0 -30
- package/cjs/TreeViewContext.js +0 -98
- package/cjs/config/cssClassesConstants.js +0 -13
- package/cjs/config/useTreeview.js +0 -127
- package/cjs/hoc/DnDTreeContext.js +0 -18
- package/cjs/hoc/SortableItemContext.js +0 -21
- package/cjs/hoc/WithConditionalDnDContext.js +0 -138
- package/cjs/hoc/WithDnDSortableItemContext.js +0 -70
- package/cjs/index.js +0 -26
- package/cjs/parts/CheckboxSelectable.js +0 -86
- package/cjs/parts/ChildrenCountDisplayer.js +0 -30
- package/cjs/parts/DnDHandle.js +0 -46
- package/cjs/parts/DropIndicator.js +0 -75
- package/cjs/parts/ExpandCaret.js +0 -94
- package/cjs/parts/Icon.js +0 -37
- package/cjs/parts/NestingSpace.js +0 -47
- package/cjs/parts/RadioSelectable.js +0 -59
- package/cjs/parts/TreeItem.js +0 -185
- package/cjs/parts/TreeItemText.js +0 -108
- package/cjs/parts/TreeList.js +0 -139
- package/cjs/plugins/dnd/TreeDndPlugin.js +0 -7
- package/cjs/plugins/dnd/index.js +0 -9
- package/cjs/plugins/index.js +0 -21
- package/cjs/plugins/roving/TreeRovingPlugin.js +0 -7
- package/cjs/plugins/roving/index.js +0 -9
- package/cjs/plugins/searchable/SearchableTreePlugin.js +0 -7
- package/cjs/plugins/searchable/index.js +0 -9
- package/cjs/plugins/selectable/SelectablePluginTree.js +0 -7
- package/cjs/plugins/selectable/index.js +0 -9
- package/cjs/plugins/toolbar/TreeToolbarPlugin.js +0 -7
- package/cjs/plugins/toolbar/index.js +0 -9
- package/cjs/plugins/tree/TreeDataPlugin.js +0 -7
- package/cjs/plugins/tree/index.js +0 -9
- package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +0 -7
- package/cjs/plugins/virtualization/index.js +0 -9
- package/cjs/react-desc-prop-types.js +0 -56
- package/cjs/related-components/TreeViewSearchBar.js +0 -48
- package/cjs/sharedTypes.js +0 -2
- package/cjs/utils/array-helpers.js +0 -24
- package/cjs/utils/group-expands-helpers.js +0 -111
- package/cjs/utils/keyboard-helpers.js +0 -175
- package/cjs/utils/object-helpers.js +0 -69
- package/cjs/utils/refs-helpers.js +0 -31
- package/cjs/utils/selectable-helper.js +0 -80
- package/cjs/utils/string-helpers.js +0 -7
- package/cjs/utils/tree-helpers.js +0 -220
- package/cjs/utils/useInstanceRefActions.js +0 -87
- package/cjs/utils/useTree.js +0 -108
- package/esm/TreeView.js +0 -21
- package/esm/config/cssClassesConstants.js +0 -6
- package/esm/config/useTreeview.js +0 -119
- package/esm/hoc/DnDTreeContext.js +0 -14
- package/esm/hoc/SortableItemContext.js +0 -17
- package/esm/hoc/WithConditionalDnDContext.js +0 -128
- package/esm/hoc/WithDnDSortableItemContext.js +0 -61
- package/esm/index.js +0 -9
- package/esm/parts/CheckboxSelectable.js +0 -78
- package/esm/parts/ChildrenCountDisplayer.js +0 -22
- package/esm/parts/DnDHandle.js +0 -38
- package/esm/parts/DropIndicator.js +0 -68
- package/esm/parts/ExpandCaret.js +0 -85
- package/esm/parts/Icon.js +0 -29
- package/esm/parts/NestingSpace.js +0 -39
- package/esm/parts/RadioSelectable.js +0 -53
- package/esm/parts/TreeItem.js +0 -173
- package/esm/parts/TreeItemText.js +0 -99
- package/esm/parts/TreeList.js +0 -127
- package/esm/plugins/dnd/TreeDndPlugin.js +0 -3
- package/esm/plugins/dnd/index.js +0 -1
- package/esm/plugins/index.js +0 -7
- package/esm/plugins/roving/TreeRovingPlugin.js +0 -3
- package/esm/plugins/roving/index.js +0 -1
- package/esm/plugins/searchable/SearchableTreePlugin.js +0 -3
- package/esm/plugins/searchable/index.js +0 -1
- package/esm/plugins/selectable/SelectablePluginTree.js +0 -3
- package/esm/plugins/selectable/index.js +0 -1
- package/esm/plugins/toolbar/TreeToolbarPlugin.js +0 -3
- package/esm/plugins/toolbar/index.js +0 -1
- package/esm/plugins/tree/TreeDataPlugin.js +0 -3
- package/esm/plugins/tree/index.js +0 -1
- package/esm/plugins/virtualization/TreeVirtualizationPlugin.js +0 -3
- package/esm/plugins/virtualization/index.js +0 -1
- package/esm/react-desc-prop-types.js +0 -52
- package/esm/related-components/TreeViewSearchBar.js +0 -40
- package/esm/sharedTypes.js +0 -1
- package/esm/utils/group-expands-helpers.js +0 -99
- package/esm/utils/object-helpers.js +0 -64
- package/esm/utils/refs-helpers.js +0 -27
- package/esm/utils/selectable-helper.js +0 -70
- package/esm/utils/string-helpers.js +0 -3
- package/esm/utils/tree-helpers.js +0 -205
- package/esm/utils/useTree.js +0 -99
- package/types/TreeView.d.ts +0 -13
- package/types/TreeViewContext.d.ts +0 -17
- package/types/config/cssClassesConstants.d.ts +0 -4
- package/types/config/useTreeview.d.ts +0 -7
- package/types/hoc/DnDTreeContext.d.ts +0 -14
- package/types/hoc/SortableItemContext.d.ts +0 -19
- package/types/hoc/WithConditionalDnDContext.d.ts +0 -4
- package/types/hoc/WithDnDSortableItemContext.d.ts +0 -4
- package/types/index.d.ts +0 -3
- package/types/parts/CheckboxSelectable.d.ts +0 -8
- package/types/parts/ChildrenCountDisplayer.d.ts +0 -7
- package/types/parts/DnDHandle.d.ts +0 -6
- package/types/parts/DropIndicator.d.ts +0 -10
- package/types/parts/ExpandCaret.d.ts +0 -7
- package/types/parts/Icon.d.ts +0 -7
- package/types/parts/NestingSpace.d.ts +0 -8
- package/types/parts/RadioSelectable.d.ts +0 -8
- package/types/parts/TreeItem.d.ts +0 -17
- package/types/parts/TreeItemText.d.ts +0 -7
- package/types/parts/TreeList.d.ts +0 -20
- package/types/plugins/dnd/TreeDndPlugin.d.ts +0 -1
- package/types/plugins/dnd/index.d.ts +0 -1
- package/types/plugins/index.d.ts +0 -7
- package/types/plugins/roving/TreeRovingPlugin.d.ts +0 -1
- package/types/plugins/roving/index.d.ts +0 -1
- package/types/plugins/searchable/SearchableTreePlugin.d.ts +0 -1
- package/types/plugins/searchable/index.d.ts +0 -1
- package/types/plugins/selectable/SelectablePluginTree.d.ts +0 -1
- package/types/plugins/selectable/index.d.ts +0 -1
- package/types/plugins/toolbar/TreeToolbarPlugin.d.ts +0 -1
- package/types/plugins/toolbar/index.d.ts +0 -1
- package/types/plugins/tree/TreeDataPlugin.d.ts +0 -1
- package/types/plugins/tree/index.d.ts +0 -1
- package/types/plugins/virtualization/TreeVirtualizationPlugin.d.ts +0 -1
- package/types/plugins/virtualization/index.d.ts +0 -1
- package/types/react-desc-prop-types.d.ts +0 -210
- package/types/related-components/TreeViewSearchBar.d.ts +0 -16
- package/types/sharedTypes.d.ts +0 -47
- package/types/utils/array-helpers.d.ts +0 -2
- package/types/utils/group-expands-helpers.d.ts +0 -14
- package/types/utils/keyboard-helpers.d.ts +0 -6
- package/types/utils/object-helpers.d.ts +0 -6
- package/types/utils/refs-helpers.d.ts +0 -4
- package/types/utils/selectable-helper.d.ts +0 -7
- package/types/utils/string-helpers.d.ts +0 -1
- package/types/utils/tree-helpers.d.ts +0 -28
- package/types/utils/useInstanceRefActions.d.ts +0 -3
- package/types/utils/useTree.d.ts +0 -14
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import React2, { useContext } from "react";
|
|
19
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
20
|
+
import { DSCircularProgressIndicator } from "@elliemae/ds-circular-progress-indicator";
|
|
21
|
+
import TreeViewContext from "../TreeViewContext";
|
|
22
|
+
import { DSTreeViewPrefix, treeListBlockName } from "../config/cssClassesConstants";
|
|
23
|
+
import TreeItem from "./TreeItem";
|
|
24
|
+
import { withConditionalDnDRowContext } from "../hoc/WithConditionalDnDContext";
|
|
25
|
+
import { DnDTreeContext } from "../hoc/DnDTreeContext";
|
|
26
|
+
const treeListNoItemsBn = `${treeListBlockName}-no-items`;
|
|
27
|
+
const TreeListNoItems = aggregatedClasses("div", {
|
|
28
|
+
"data-testid": treeListNoItemsBn
|
|
29
|
+
})(treeListNoItemsBn);
|
|
30
|
+
const TreeListWrapper = aggregatedClasses("ul", {
|
|
31
|
+
"data-testid": treeListBlockName,
|
|
32
|
+
role: "tree"
|
|
33
|
+
})(treeListBlockName, null, ({ rowSize }) => ({
|
|
34
|
+
[`rowsize-${rowSize}`]: rowSize
|
|
35
|
+
}));
|
|
36
|
+
const compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;
|
|
37
|
+
const normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;
|
|
38
|
+
const TreeListComp = () => {
|
|
39
|
+
const ctx = useContext(TreeViewContext);
|
|
40
|
+
const {
|
|
41
|
+
virtualListRef,
|
|
42
|
+
virtualListHelpers,
|
|
43
|
+
visibleItems: flattenedVisibleItems,
|
|
44
|
+
props: { width, height, rowSize, noItemsPlaceholder, isLoading }
|
|
45
|
+
} = ctx;
|
|
46
|
+
const { totalSize, virtualItems } = virtualListHelpers;
|
|
47
|
+
const className = `${rowSize === "compact" ? `${compactRowClass}` : `${normaRowClass}`}`;
|
|
48
|
+
const { visibleItems } = useContext(DnDTreeContext);
|
|
49
|
+
return /* @__PURE__ */ React2.createElement(TreeListWrapper, {
|
|
50
|
+
ref: virtualListRef,
|
|
51
|
+
className,
|
|
52
|
+
style: {
|
|
53
|
+
height: `${typeof height === "number" ? `${height}px` : height}`,
|
|
54
|
+
width: `${typeof width === "number" ? `${width}px` : width}`,
|
|
55
|
+
overflow: "auto"
|
|
56
|
+
}
|
|
57
|
+
}, isLoading ? /* @__PURE__ */ React2.createElement("div", {
|
|
58
|
+
style: {
|
|
59
|
+
width: "100%",
|
|
60
|
+
height: "100%",
|
|
61
|
+
display: "flex",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
justifyContent: "center"
|
|
64
|
+
}
|
|
65
|
+
}, /* @__PURE__ */ React2.createElement(DSCircularProgressIndicator, {
|
|
66
|
+
size: "xl",
|
|
67
|
+
loading: isLoading,
|
|
68
|
+
showLabel: true,
|
|
69
|
+
waiting: false,
|
|
70
|
+
showTooltip: false
|
|
71
|
+
})) : null, !isLoading && virtualItems.length === 0 ? /* @__PURE__ */ React2.createElement(TreeListNoItems, null, noItemsPlaceholder) : null, !isLoading && virtualItems.length !== 0 ? /* @__PURE__ */ React2.createElement("div", {
|
|
72
|
+
style: {
|
|
73
|
+
height: `${totalSize}px`,
|
|
74
|
+
width: "100%",
|
|
75
|
+
position: "relative"
|
|
76
|
+
}
|
|
77
|
+
}, virtualItems.map((virtualItem) => {
|
|
78
|
+
const { index, measureRef, start } = virtualItem;
|
|
79
|
+
const item = (visibleItems || flattenedVisibleItems)[index];
|
|
80
|
+
if (!item)
|
|
81
|
+
return null;
|
|
82
|
+
item.virtualIndex = index;
|
|
83
|
+
const { id } = item;
|
|
84
|
+
const style = {
|
|
85
|
+
position: "absolute",
|
|
86
|
+
top: `${start}px`,
|
|
87
|
+
left: 0,
|
|
88
|
+
width: "100%"
|
|
89
|
+
};
|
|
90
|
+
const listItemProps = {
|
|
91
|
+
key: `DS-TreeView-List-Item-${id}`,
|
|
92
|
+
virtualItemRef: measureRef,
|
|
93
|
+
index,
|
|
94
|
+
itemIndex: index,
|
|
95
|
+
item,
|
|
96
|
+
itemWrapperStyle: style
|
|
97
|
+
};
|
|
98
|
+
return /* @__PURE__ */ React2.createElement(TreeItem, __spreadValues({}, listItemProps));
|
|
99
|
+
})) : null);
|
|
100
|
+
};
|
|
101
|
+
const TreeList = withConditionalDnDRowContext(TreeListComp);
|
|
102
|
+
export {
|
|
103
|
+
TreeList,
|
|
104
|
+
TreeListNoItems,
|
|
105
|
+
TreeListWrapper,
|
|
106
|
+
treeListNoItemsBn
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=TreeList.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TreeList.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\n\nimport TreeViewContext from '../TreeViewContext';\nimport { DSTreeViewPrefix, treeListBlockName } from '../config/cssClassesConstants';\nimport TreeItem from './TreeItem';\n\nimport type { DSTreeviewT } from '../react-desc-prop-types';\nimport { withConditionalDnDRowContext } from '../hoc/WithConditionalDnDContext';\nimport { DnDTreeContext } from '../hoc/DnDTreeContext';\n\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\nexport const TreeListNoItems = aggregatedClasses('div', {\n 'data-testid': treeListNoItemsBn,\n})(treeListNoItemsBn) as unknown as React.ComponentType<React.ComponentProps<'div'>>;\n\n// React.ComponentProps<'ul'> uses LegacyRef typings that existed pre-hook era\n// we omit the LegacyRef typings in favor of hook-era typings\ninterface UlProps extends Omit<React.ComponentProps<'ul'>, 'ref'> {\n ref: React.MutableRefObject<HTMLUListElement | undefined> | undefined;\n}\nexport const TreeListWrapper = aggregatedClasses('ul', {\n 'data-testid': treeListBlockName,\n role: 'tree',\n})(treeListBlockName, null, ({ rowSize }: { rowSize: 'normal' | 'compact' }) => ({\n [`rowsize-${rowSize}`]: rowSize,\n})) as unknown as React.ComponentType<UlProps>;\n\nconst compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;\nconst normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;\n\ninterface PropsT {\n onMouseDragOverItem?: (opts: {\n event: React.MouseEvent<HTMLLIElement>;\n item: DSTreeviewT.Item;\n itemIndex: number;\n setIsDraggingOverThis: React.Dispatch<React.SetStateAction<boolean>>;\n openFolderOnHoverTimeout: React.MutableRefObject<NodeJS.Timeout | null>;\n }) => void;\n}\n\nconst TreeListComp: React.ComponentType<PropsT> = () => {\n const ctx = useContext(TreeViewContext);\n const {\n virtualListRef,\n virtualListHelpers,\n visibleItems: flattenedVisibleItems,\n props: { width, height, rowSize, noItemsPlaceholder, isLoading },\n } = ctx;\n const { totalSize, virtualItems } = virtualListHelpers;\n const className = `${rowSize === 'compact' ? `${compactRowClass}` : `${normaRowClass}`}`;\n\n const { visibleItems } = useContext(DnDTreeContext);\n\n return (\n <TreeListWrapper\n ref={virtualListRef}\n className={className}\n style={{\n height: `${typeof height === 'number' ? `${height}px` : height}`,\n width: `${typeof width === 'number' ? `${width}px` : width}`,\n overflow: 'auto',\n }}\n >\n {isLoading ? (\n <div\n style={{\n width: '100%',\n height: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <DSCircularProgressIndicator size=\"xl\" loading={isLoading} showLabel waiting={false} showTooltip={false} />\n </div>\n ) : null}\n {!isLoading && virtualItems.length === 0 ? <TreeListNoItems>{noItemsPlaceholder}</TreeListNoItems> : null}\n {!isLoading && virtualItems.length !== 0 ? (\n <div\n style={{\n height: `${totalSize}px`,\n width: '100%',\n position: 'relative',\n }}\n >\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const item = (visibleItems || flattenedVisibleItems)[index];\n if (!item) return null;\n item.virtualIndex = index;\n const { id } = item;\n\n const style = {\n position: 'absolute',\n top: `${start}px`,\n left: 0,\n width: '100%',\n };\n\n const listItemProps = {\n key: `DS-TreeView-List-Item-${id}`,\n virtualItemRef: measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n item,\n itemWrapperStyle: style,\n };\n\n return <TreeItem {...listItemProps} />;\n })}\n </div>\n ) : null}\n </TreeListWrapper>\n );\n};\n\nexport const TreeList = withConditionalDnDRowContext(TreeListComp);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AAEA;AACA;AACA;AAGA;AACA;AAEO,MAAM,oBAAoB,GAAG;AAC7B,MAAM,kBAAkB,kBAAkB,OAAO;AAAA,EACtD,eAAe;AAAA,GACd;AAOI,MAAM,kBAAkB,kBAAkB,MAAM;AAAA,EACrD,eAAe;AAAA,EACf,MAAM;AAAA,GACL,mBAAmB,MAAM,CAAC,EAAE,cAAkD;AAAA,GAC9E,WAAW,YAAY;AAAA;AAG1B,MAAM,kBAAkB,GAAG;AAC3B,MAAM,gBAAgB,GAAG;AAYzB,MAAM,eAA4C,MAAM;AACtD,QAAM,MAAM,WAAW;AACvB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,OAAO,EAAE,OAAO,QAAQ,SAAS,oBAAoB;AAAA,MACnD;AACJ,QAAM,EAAE,WAAW,iBAAiB;AACpC,QAAM,YAAY,GAAG,YAAY,YAAY,GAAG,oBAAoB,GAAG;AAEvE,QAAM,EAAE,iBAAiB,WAAW;AAEpC,SACE,qCAAC,iBAAD;AAAA,IACE,KAAK;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,QAAQ,GAAG,OAAO,WAAW,WAAW,GAAG,aAAa;AAAA,MACxD,OAAO,GAAG,OAAO,UAAU,WAAW,GAAG,YAAY;AAAA,MACrD,UAAU;AAAA;AAAA,KAGX,YACC,qCAAC,OAAD;AAAA,IACE,OAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA;AAAA,KAGlB,qCAAC,6BAAD;AAAA,IAA6B,MAAK;AAAA,IAAK,SAAS;AAAA,IAAW,WAAS;AAAA,IAAC,SAAS;AAAA,IAAO,aAAa;AAAA,QAElG,MACH,CAAC,aAAa,aAAa,WAAW,IAAI,qCAAC,iBAAD,MAAkB,sBAAwC,MACpG,CAAC,aAAa,aAAa,WAAW,IACrC,qCAAC,OAAD;AAAA,IACE,OAAO;AAAA,MACL,QAAQ,GAAG;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA;AAAA,KAGX,aAAa,IAAI,CAAC,gBAAgB;AACjC,UAAM,EAAE,OAAO,YAAY,UAAU;AACrC,UAAM,OAAQ,iBAAgB,uBAAuB;AACrD,QAAI,CAAC;AAAM,aAAO;AAClB,SAAK,eAAe;AACpB,UAAM,EAAE,OAAO;AAEf,UAAM,QAAQ;AAAA,MACZ,UAAU;AAAA,MACV,KAAK,GAAG;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA;AAGT,UAAM,gBAAgB;AAAA,MACpB,KAAK,yBAAyB;AAAA,MAC9B,gBAAgB;AAAA,MAChB;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA,kBAAkB;AAAA;AAGpB,WAAO,qCAAC,UAAD,mBAAc;AAAA,QAGvB;AAAA;AAKH,MAAM,WAAW,6BAA6B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/TreeDndPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeDndPlugin = 'tree-dnd';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/dnd/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeDndPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./dnd";
|
|
3
|
+
export * from "./roving";
|
|
4
|
+
export * from "./selectable";
|
|
5
|
+
export * from "./toolbar";
|
|
6
|
+
export * from "./tree";
|
|
7
|
+
export * from "./virtualization";
|
|
8
|
+
export * from "./searchable";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './dnd';\nexport * from './roving';\nexport * from './selectable';\nexport * from './toolbar';\nexport * from './tree';\nexport * from './virtualization';\nexport * from './searchable';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/roving/TreeRovingPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeRovingPlugin = 'tree-roving';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,mBAAmB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/roving/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeRovingPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/searchable/SearchableTreePlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const SearchableTreePlugin = 'tree-searchable';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,uBAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/searchable/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './SearchableTreePlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/SelectablePluginTree.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const SelectablePluginTree = 'tree-selectable';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,uBAAuB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './SelectablePluginTree';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/TreeToolbarPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeToolbarPlugin = 'tree-toolbar';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,oBAAoB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeToolbarPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/tree/TreeDataPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreePluginList = 'tree-data';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,iBAAiB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/tree/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeDataPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/TreeVirtualizationPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const TreeVirtualizationPlugin = 'tree-virtualization';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,2BAA2B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/virtualization/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './TreeVirtualizationPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
|
+
const TreeViewPropTypes = {
|
|
4
|
+
data: PropTypes.arrayOf(PropTypes.shape({
|
|
5
|
+
children: PropTypes.arrayOf(PropTypes.object),
|
|
6
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
7
|
+
isGroup: PropTypes.oneOfType([PropTypes.oneOf([void 0, null]), PropTypes.bool]),
|
|
8
|
+
name: PropTypes.string,
|
|
9
|
+
node: PropTypes.object
|
|
10
|
+
})).description("data to populate tree view").isRequired,
|
|
11
|
+
plugins: PropTypes.arrayOf(PropTypes.string).description("list of enabled plugins").defaultValue([]),
|
|
12
|
+
selection: PropTypes.object.description("pre selected items").defaultValue({}),
|
|
13
|
+
expanded: PropTypes.object.description("control what items are expanded").defaultValue(void 0),
|
|
14
|
+
instanceRef: PropTypes.shape({
|
|
15
|
+
current: PropTypes.oneOfType([
|
|
16
|
+
PropTypes.oneOf([null, void 0]),
|
|
17
|
+
PropTypes.shape({
|
|
18
|
+
actions: PropTypes.shape({
|
|
19
|
+
toggleExpandAll: PropTypes.func,
|
|
20
|
+
scrollTo: PropTypes.func
|
|
21
|
+
}).description("").isRequired
|
|
22
|
+
})
|
|
23
|
+
])
|
|
24
|
+
}).description("instance ref"),
|
|
25
|
+
isItemDisabled: PropTypes.func.description("Function that receives an item, and returns whether that item should be disabled").defaultValue("() => false"),
|
|
26
|
+
disableIcons: PropTypes.bool.description("disable icons").defaultValue(false),
|
|
27
|
+
fluid: PropTypes.bool.description("whether is fluid or not").defaultValue(false),
|
|
28
|
+
isMultiSelect: PropTypes.bool.description("whether the tree view is multi select or not").defaultValue(false),
|
|
29
|
+
isSingleSelect: PropTypes.bool.description("wheter the tree view is single select or not").defaultValue(false),
|
|
30
|
+
isLoading: PropTypes.bool.description("wheter the tree should show the loading state or not").defaultValue(false),
|
|
31
|
+
getIsDropValid: PropTypes.func.description("Function that returns true if the drop is valid and false if it's not").defaultValue("() => true"),
|
|
32
|
+
restrictDragAndDrop: PropTypes.bool.description("whether to restrict DnD functionality or not").defaultValue(false),
|
|
33
|
+
showChildrenAmount: PropTypes.bool.description("whether to show the amount of children or not").defaultValue(false),
|
|
34
|
+
sortable: PropTypes.bool.description("whether the sortable functionality is active or not").defaultValue(false),
|
|
35
|
+
onItemClick: PropTypes.func.description("function executed when clicking on an item").defaultValue("() => {}"),
|
|
36
|
+
onItemFocus: PropTypes.func.description("function executed when focusing on an item").defaultValue("() => {}"),
|
|
37
|
+
onVisibleItemsChange: PropTypes.func.description("function executed when the visible items change").defaultValue("() => {}"),
|
|
38
|
+
onOrderChange: PropTypes.func.description("function executed when the items order changes").defaultValue("() => {}"),
|
|
39
|
+
onSelectionChange: PropTypes.func.description("function executed when the selection changes").defaultValue("() => {}"),
|
|
40
|
+
onExpandChange: PropTypes.func.description("function executed when expanding an item").defaultValue("() => {}"),
|
|
41
|
+
onInstanceRefInitialized: PropTypes.func.description("function executed when instanceRef has terminated instanciation").defaultValue("() => {}"),
|
|
42
|
+
rowSize: PropTypes.oneOf(["normal", "compact"]).description("size of the row").defaultValue("normal"),
|
|
43
|
+
labelOverflow: PropTypes.oneOf(["wrap", "wrap-all", "truncate"]).description("label truncation preference").defaultValue("wrap"),
|
|
44
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("components width").defaultValue("100%"),
|
|
45
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description("components height").defaultValue("100%"),
|
|
46
|
+
groupIcon: PropTypes.node.description("icon for groups"),
|
|
47
|
+
itemIcon: PropTypes.node.description("icon for items"),
|
|
48
|
+
searchQuery: PropTypes.string.description("search query value"),
|
|
49
|
+
noItemsPlaceholder: PropTypes.string.description("message to be shown when there are no items in the treeview to be displayed").defaultValue("No items found"),
|
|
50
|
+
name: PropTypes.string.description("property key to identifier for items labels").defaultValue("name"),
|
|
51
|
+
highlightOnlyQuery: PropTypes.bool.description("whether to highlight results or not").defaultValue(false)
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
TreeViewPropTypes
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { PropTypes } from 'react-desc';\nimport TreeModel from 'tree-model';\nimport { useVirtual } from 'react-virtual';\nexport declare namespace DSTreeviewT {\n export type StringOrNum = string | number;\n export type SelectionState = boolean | 'mixed';\n export type SelectionItems = Record<StringOrNum, SelectionState>;\n export type ScrollToFunc = ReturnType<typeof useVirtual>['scrollToIndex'];\n export type ScrollToItemOptions = Parameters<ReturnType<typeof useVirtual>['scrollToIndex']>[1];\n export type ScrollToItemFunc = (options: ScrollToItemOptions) => void;\n export type ExpandedItems = Record<StringOrNum, true>; // { [id]:true } -> e.g. {1:true; 2:true} // false are not listed\n export interface SimpleItem {\n [key: string]: unknown;\n name: string;\n children?: SimpleItem[];\n id: StringOrNum;\n }\n\n export interface Item extends SimpleItem {\n children: Item[];\n treeDepth?: number;\n virtualIndex?: number;\n isChecked?: boolean | 'mixed';\n isGroup?: boolean;\n isExpanded?: boolean;\n childrenMatchesSearchQuery?: boolean;\n matchesSearchQuery?: boolean;\n nodeItemRef?: React.RefObject<HTMLLIElement>;\n model: TreeModel.Node<Item>['model'];\n node: TreeModel.Node<Item> & { parent?: TreeModel.Node<Item> };\n nodePath: TreeModel.Node<Item>[];\n }\n\n export interface DndItem {\n uid: string;\n depth: number;\n realIndex: number;\n childrenCount: number;\n parentId: string | null;\n original: SimpleItem;\n }\n\n export interface Actions {\n toggleExpandAll: (isExpand: boolean) => Promise<DSTreeviewT.Item[]>;\n scrollTo: DSTreeviewT.ScrollToFunc;\n setSelectedItemByVirtualIndex: (index: number) => void;\n setFocusedItemByVirtualIndex: (\n index: number,\n scrollOpts: DSTreeviewT.ScrollToItemOptions & { withScroll?: boolean },\n ) => void;\n }\n export interface InstanceRef {\n actions: Actions;\n }\n\n export interface DefaultProps {\n plugins: string[];\n selection: SelectionItems;\n instanceRef: React.MutableRefObject<InstanceRef>;\n isItemDisabled: (item: Item) => boolean;\n disableIcons: boolean;\n fluid: boolean;\n isMultiSelect: boolean;\n isSingleSelect: boolean;\n getIsDropValid: (\n active: DndItem,\n over: DndItem,\n dropIndicatorPosition: 'none' | 'before' | 'after' | 'inside',\n ) => boolean;\n restrictDragAndDrop: boolean;\n showChildrenAmount: boolean;\n sortable: boolean;\n isLoading: boolean;\n highlightOnlyQuery: boolean;\n onItemClick: (item: Item, e: React.MouseEvent<HTMLLIElement>) => void;\n onItemFocus: (meta: { scrollToItem: ScrollToItemFunc; itemIndex: number; item: Item }) => void;\n onVisibleItemsChange: (newVisibleItems: Item[]) => void;\n onOrderChange: (newData: SimpleItem[], oldData: SimpleItem[], draggedItem: DndItem) => void;\n onSelectionChange: (\n selection: SelectionItems,\n item: Item,\n meta: { scrollToItem: ScrollToItemFunc; itemIndex: number },\n ) => void;\n onExpandChange: (expandedHashmap: ExpandedItems, itemToggled: Item | null | undefined) => void;\n onInstanceRefInitialized: (instanceRef: React.MutableRefObject<InstanceRef>) => void;\n rowSize: 'normal' | 'compact';\n labelOverflow: 'wrap' | 'wrap-all' | 'truncate';\n noItemsPlaceholder: string;\n nameKey: string;\n width: StringOrNum;\n height: StringOrNum;\n groupIcon: JSX.Element | null;\n itemIcon: JSX.Element | null;\n searchQuery: string;\n }\n export interface PropsOptional {\n expanded: ExpandedItems;\n rightAddons: ((item: Item) => React.ReactNode | React.ReactNode[]) | JSX.Element;\n }\n export interface PropsRequired {\n data: Item[];\n }\n export interface Props extends DefaultProps, PropsOptional, PropsRequired {}\n}\n\nexport const TreeViewPropTypes = {\n data: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.arrayOf(PropTypes.object),\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n isGroup: PropTypes.oneOfType([PropTypes.oneOf([undefined, null]), PropTypes.bool]),\n name: PropTypes.string,\n node: PropTypes.object,\n }),\n ).description('data to populate tree view').isRequired,\n plugins: PropTypes.arrayOf(PropTypes.string).description('list of enabled plugins').defaultValue([]),\n selection: PropTypes.object.description('pre selected items').defaultValue({}),\n expanded: PropTypes.object.description('control what items are expanded').defaultValue(undefined),\n instanceRef: PropTypes.shape({\n current: PropTypes.oneOfType([\n PropTypes.oneOf([null, undefined]),\n PropTypes.shape({\n actions: PropTypes.shape({\n toggleExpandAll: PropTypes.func,\n scrollTo: PropTypes.func,\n }).description('').isRequired,\n }),\n ]),\n }).description('instance ref'),\n isItemDisabled: PropTypes.func\n .description('Function that receives an item, and returns whether that item should be disabled')\n .defaultValue('() => false'),\n disableIcons: PropTypes.bool.description('disable icons').defaultValue(false),\n fluid: PropTypes.bool.description('whether is fluid or not').defaultValue(false),\n isMultiSelect: PropTypes.bool.description('whether the tree view is multi select or not').defaultValue(false),\n isSingleSelect: PropTypes.bool.description('wheter the tree view is single select or not').defaultValue(false),\n isLoading: PropTypes.bool.description('wheter the tree should show the loading state or not').defaultValue(false),\n getIsDropValid: PropTypes.func\n .description(\"Function that returns true if the drop is valid and false if it's not\")\n .defaultValue('() => true'),\n restrictDragAndDrop: PropTypes.bool.description('whether to restrict DnD functionality or not').defaultValue(false),\n showChildrenAmount: PropTypes.bool.description('whether to show the amount of children or not').defaultValue(false),\n sortable: PropTypes.bool.description('whether the sortable functionality is active or not').defaultValue(false),\n onItemClick: PropTypes.func.description('function executed when clicking on an item').defaultValue('() => {}'),\n onItemFocus: PropTypes.func.description('function executed when focusing on an item').defaultValue('() => {}'),\n onVisibleItemsChange: PropTypes.func\n .description('function executed when the visible items change')\n .defaultValue('() => {}'),\n onOrderChange: PropTypes.func.description('function executed when the items order changes').defaultValue('() => {}'),\n onSelectionChange: PropTypes.func\n .description('function executed when the selection changes')\n .defaultValue('() => {}'),\n onExpandChange: PropTypes.func.description('function executed when expanding an item').defaultValue('() => {}'),\n onInstanceRefInitialized: PropTypes.func\n .description('function executed when instanceRef has terminated instanciation')\n .defaultValue('() => {}'),\n rowSize: PropTypes.oneOf(['normal', 'compact']).description('size of the row').defaultValue('normal'),\n labelOverflow: PropTypes.oneOf(['wrap', 'wrap-all', 'truncate'])\n .description('label truncation preference')\n .defaultValue('wrap'),\n width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description('components width').defaultValue('100%'),\n height: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('components height')\n .defaultValue('100%'),\n groupIcon: PropTypes.node.description('icon for groups'),\n itemIcon: PropTypes.node.description('icon for items'),\n searchQuery: PropTypes.string.description('search query value'),\n noItemsPlaceholder: PropTypes.string\n .description('message to be shown when there are no items in the treeview to be displayed')\n .defaultValue('No items found'),\n name: PropTypes.string.description('property key to identifier for items labels').defaultValue('name'),\n highlightOnlyQuery: PropTypes.bool.description('whether to highlight results or not').defaultValue(false),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AAyGO,MAAM,oBAAoB;AAAA,EAC/B,MAAM,UAAU,QACd,UAAU,MAAM;AAAA,IACd,UAAU,UAAU,QAAQ,UAAU;AAAA,IACtC,IAAI,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,IACrD,SAAS,UAAU,UAAU,CAAC,UAAU,MAAM,CAAC,QAAW,QAAQ,UAAU;AAAA,IAC5E,MAAM,UAAU;AAAA,IAChB,MAAM,UAAU;AAAA,MAElB,YAAY,8BAA8B;AAAA,EAC5C,SAAS,UAAU,QAAQ,UAAU,QAAQ,YAAY,2BAA2B,aAAa;AAAA,EACjG,WAAW,UAAU,OAAO,YAAY,sBAAsB,aAAa;AAAA,EAC3E,UAAU,UAAU,OAAO,YAAY,mCAAmC,aAAa;AAAA,EACvF,aAAa,UAAU,MAAM;AAAA,IAC3B,SAAS,UAAU,UAAU;AAAA,MAC3B,UAAU,MAAM,CAAC,MAAM;AAAA,MACvB,UAAU,MAAM;AAAA,QACd,SAAS,UAAU,MAAM;AAAA,UACvB,iBAAiB,UAAU;AAAA,UAC3B,UAAU,UAAU;AAAA,WACnB,YAAY,IAAI;AAAA;AAAA;AAAA,KAGtB,YAAY;AAAA,EACf,gBAAgB,UAAU,KACvB,YAAY,oFACZ,aAAa;AAAA,EAChB,cAAc,UAAU,KAAK,YAAY,iBAAiB,aAAa;AAAA,EACvE,OAAO,UAAU,KAAK,YAAY,2BAA2B,aAAa;AAAA,EAC1E,eAAe,UAAU,KAAK,YAAY,gDAAgD,aAAa;AAAA,EACvG,gBAAgB,UAAU,KAAK,YAAY,gDAAgD,aAAa;AAAA,EACxG,WAAW,UAAU,KAAK,YAAY,wDAAwD,aAAa;AAAA,EAC3G,gBAAgB,UAAU,KACvB,YAAY,yEACZ,aAAa;AAAA,EAChB,qBAAqB,UAAU,KAAK,YAAY,gDAAgD,aAAa;AAAA,EAC7G,oBAAoB,UAAU,KAAK,YAAY,iDAAiD,aAAa;AAAA,EAC7G,UAAU,UAAU,KAAK,YAAY,uDAAuD,aAAa;AAAA,EACzG,aAAa,UAAU,KAAK,YAAY,8CAA8C,aAAa;AAAA,EACnG,aAAa,UAAU,KAAK,YAAY,8CAA8C,aAAa;AAAA,EACnG,sBAAsB,UAAU,KAC7B,YAAY,mDACZ,aAAa;AAAA,EAChB,eAAe,UAAU,KAAK,YAAY,kDAAkD,aAAa;AAAA,EACzG,mBAAmB,UAAU,KAC1B,YAAY,gDACZ,aAAa;AAAA,EAChB,gBAAgB,UAAU,KAAK,YAAY,4CAA4C,aAAa;AAAA,EACpG,0BAA0B,UAAU,KACjC,YAAY,mEACZ,aAAa;AAAA,EAChB,SAAS,UAAU,MAAM,CAAC,UAAU,YAAY,YAAY,mBAAmB,aAAa;AAAA,EAC5F,eAAe,UAAU,MAAM,CAAC,QAAQ,YAAY,aACjD,YAAY,+BACZ,aAAa;AAAA,EAChB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SAAS,YAAY,oBAAoB,aAAa;AAAA,EAC9G,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,SACtD,YAAY,qBACZ,aAAa;AAAA,EAChB,WAAW,UAAU,KAAK,YAAY;AAAA,EACtC,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,aAAa,UAAU,OAAO,YAAY;AAAA,EAC1C,oBAAoB,UAAU,OAC3B,YAAY,+EACZ,aAAa;AAAA,EAChB,MAAM,UAAU,OAAO,YAAY,+CAA+C,aAAa;AAAA,EAC/F,oBAAoB,UAAU,KAAK,YAAY,uCAAuC,aAAa;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { DSNavSearchBox } from "@elliemae/ds-form";
|
|
4
|
+
function TreeViewSearchBar(props) {
|
|
5
|
+
const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;
|
|
6
|
+
return /* @__PURE__ */ React2.createElement(DSNavSearchBox, {
|
|
7
|
+
onChange: (v) => {
|
|
8
|
+
handleChange({ target: { value: v } });
|
|
9
|
+
},
|
|
10
|
+
onNext,
|
|
11
|
+
onPrevious,
|
|
12
|
+
onClear,
|
|
13
|
+
currentResultIndex,
|
|
14
|
+
totalResults,
|
|
15
|
+
value
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
TreeViewSearchBar
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=TreeViewSearchBar.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/related-components/TreeViewSearchBar.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSNavSearchBox } from '@elliemae/ds-form';\n\ninterface PropsT {\n handleChange: (opt: { target: { value: string } }) => void;\n onNext: () => void;\n onPrevious: () => void;\n onClear: () => void;\n currentResultIndex: number;\n totalResults: number;\n value: string;\n}\n\nexport function TreeViewSearchBar(props: PropsT) {\n const { handleChange, onNext, onPrevious, onClear, currentResultIndex, totalResults, value } = props;\n\n return (\n <DSNavSearchBox\n onChange={(v: string) => {\n handleChange({ target: { value: v } });\n }}\n onNext={onNext}\n onPrevious={onPrevious}\n onClear={onClear}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n value={value}\n />\n );\n}\n\n// TreeViewSearchBar.propTypes = {\n// value: PropTypes.string.isRequired,\n// handleChange: PropTypes.func.isRequired,\n// onNext: PropTypes.func.isRequired,\n// onPrevious: PropTypes.func.isRequired,\n// onClear: PropTypes.func.isRequired,\n// currentResultIndex: PropTypes.number.isRequired,\n// totalResults: PropTypes.number.isRequired,\n// };\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AAYO,2BAA2B,OAAe;AAC/C,QAAM,EAAE,cAAc,QAAQ,YAAY,SAAS,oBAAoB,cAAc,UAAU;AAE/F,SACE,qCAAC,gBAAD;AAAA,IACE,UAAU,CAAC,MAAc;AACvB,mBAAa,EAAE,QAAQ,EAAE,OAAO;AAAA;AAAA,IAElC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
// https://github.com/sindresorhus/array-move/blob/master/index.js
|
|
1
|
+
import * as React from "react";
|
|
4
2
|
const arrayMoveMutate = (array, from, to) => {
|
|
5
3
|
const startIndex = from < 0 ? array.length + from : from;
|
|
6
|
-
|
|
7
4
|
if (startIndex >= 0 && startIndex < array.length) {
|
|
8
5
|
const endIndex = to < 0 ? array.length + to : to;
|
|
9
6
|
const [item] = array.splice(from, 1);
|
|
@@ -15,5 +12,8 @@ const arrayMove = (array, from, to) => {
|
|
|
15
12
|
arrayMoveMutate(newArray, from, to);
|
|
16
13
|
return newArray;
|
|
17
14
|
};
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
export {
|
|
16
|
+
arrayMove,
|
|
17
|
+
arrayMoveMutate
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=array-helpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/array-helpers.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// https://github.com/sindresorhus/array-move/blob/master/index.js\nexport const arrayMoveMutate = (array: unknown[], from: number, to: number) => {\n const startIndex = from < 0 ? array.length + from : from;\n\n if (startIndex >= 0 && startIndex < array.length) {\n const endIndex = to < 0 ? array.length + to : to;\n\n const [item] = array.splice(from, 1);\n array.splice(endIndex, 0, item);\n }\n};\n\nexport const arrayMove = (array: unknown[], from: number, to: number) => {\n const newArray = [...array];\n arrayMoveMutate(newArray, from, to);\n return newArray;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCO,MAAM,kBAAkB,CAAC,OAAkB,MAAc,OAAe;AAC7E,QAAM,aAAa,OAAO,IAAI,MAAM,SAAS,OAAO;AAEpD,MAAI,cAAc,KAAK,aAAa,MAAM,QAAQ;AAChD,UAAM,WAAW,KAAK,IAAI,MAAM,SAAS,KAAK;AAE9C,UAAM,CAAC,QAAQ,MAAM,OAAO,MAAM;AAClC,UAAM,OAAO,UAAU,GAAG;AAAA;AAAA;AAIvB,MAAM,YAAY,CAAC,OAAkB,MAAc,OAAe;AACvE,QAAM,WAAW,CAAC,GAAG;AACrB,kBAAgB,UAAU,MAAM;AAChC,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|