@elliemae/ds-treeview 2.2.0-next.3 → 2.3.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/cjs/TreeView.js +49 -27
  2. package/cjs/TreeView.js.map +7 -0
  3. package/cjs/TreeViewContext.js +61 -37
  4. package/cjs/TreeViewContext.js.map +7 -0
  5. package/cjs/config/cssClassesConstants.js +41 -13
  6. package/cjs/config/cssClassesConstants.js.map +7 -0
  7. package/cjs/config/useTreeview.js +116 -78
  8. package/cjs/config/useTreeview.js.map +7 -0
  9. package/cjs/index.js +37 -26
  10. package/cjs/index.js.map +7 -0
  11. package/cjs/parts/CheckboxSelectable.js +70 -59
  12. package/cjs/parts/CheckboxSelectable.js.map +7 -0
  13. package/cjs/parts/ChildrenCountDisplayer.js +45 -28
  14. package/cjs/parts/ChildrenCountDisplayer.js.map +7 -0
  15. package/cjs/parts/ExpandCaret.js +85 -83
  16. package/cjs/parts/ExpandCaret.js.map +7 -0
  17. package/cjs/parts/Icon.js +46 -31
  18. package/cjs/parts/Icon.js.map +7 -0
  19. package/cjs/parts/NestingSpace.js +43 -35
  20. package/cjs/parts/NestingSpace.js.map +7 -0
  21. package/cjs/parts/RadioSelectable.js +52 -37
  22. package/cjs/parts/RadioSelectable.js.map +7 -0
  23. package/cjs/parts/TreeItem.js +147 -141
  24. package/cjs/parts/TreeItem.js.map +7 -0
  25. package/cjs/parts/TreeItemText.js +88 -95
  26. package/cjs/parts/TreeItemText.js.map +7 -0
  27. package/cjs/parts/TreeList.js +119 -130
  28. package/cjs/parts/TreeList.js.map +7 -0
  29. package/cjs/plugins/dnd/TreeDndPlugin.js +59 -7
  30. package/cjs/plugins/dnd/TreeDndPlugin.js.map +7 -0
  31. package/cjs/plugins/dnd/index.js +28 -9
  32. package/cjs/plugins/dnd/index.js.map +7 -0
  33. package/cjs/plugins/index.js +34 -21
  34. package/cjs/plugins/index.js.map +7 -0
  35. package/cjs/plugins/roving/TreeRovingPlugin.js +35 -7
  36. package/cjs/plugins/roving/TreeRovingPlugin.js.map +7 -0
  37. package/cjs/plugins/roving/index.js +28 -9
  38. package/cjs/plugins/roving/index.js.map +7 -0
  39. package/cjs/plugins/searchable/SearchableTreePlugin.js +35 -7
  40. package/cjs/plugins/searchable/SearchableTreePlugin.js.map +7 -0
  41. package/cjs/plugins/searchable/index.js +28 -9
  42. package/cjs/plugins/searchable/index.js.map +7 -0
  43. package/cjs/plugins/selectable/SelectablePluginTree.js +35 -7
  44. package/cjs/plugins/selectable/SelectablePluginTree.js.map +7 -0
  45. package/cjs/plugins/selectable/index.js +28 -9
  46. package/cjs/plugins/selectable/index.js.map +7 -0
  47. package/cjs/plugins/toolbar/TreeToolbarPlugin.js +35 -7
  48. package/cjs/plugins/toolbar/TreeToolbarPlugin.js.map +7 -0
  49. package/cjs/plugins/toolbar/index.js +28 -9
  50. package/cjs/plugins/toolbar/index.js.map +7 -0
  51. package/cjs/plugins/tree/TreeDataPlugin.js +35 -7
  52. package/cjs/plugins/tree/TreeDataPlugin.js.map +7 -0
  53. package/cjs/plugins/tree/index.js +28 -9
  54. package/cjs/plugins/tree/index.js.map +7 -0
  55. package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +35 -7
  56. package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js.map +7 -0
  57. package/cjs/plugins/virtualization/index.js +28 -9
  58. package/cjs/plugins/virtualization/index.js.map +7 -0
  59. package/cjs/react-desc-prop-types.js +82 -54
  60. package/cjs/react-desc-prop-types.js.map +7 -0
  61. package/cjs/related-components/TreeViewSearchBar.js +42 -40
  62. package/cjs/related-components/TreeViewSearchBar.js.map +7 -0
  63. package/cjs/sharedTypes.js +27 -2
  64. package/cjs/sharedTypes.js.map +7 -0
  65. package/cjs/utils/array-helpers.js +35 -11
  66. package/cjs/utils/array-helpers.js.map +7 -0
  67. package/cjs/utils/dnd-helpers.js +146 -0
  68. package/cjs/utils/dnd-helpers.js.map +7 -0
  69. package/cjs/utils/group-expands-helpers.js +86 -59
  70. package/cjs/utils/group-expands-helpers.js.map +7 -0
  71. package/cjs/utils/keyboard-helpers.js +85 -90
  72. package/cjs/utils/keyboard-helpers.js.map +7 -0
  73. package/cjs/utils/object-helpers.js +43 -36
  74. package/cjs/utils/object-helpers.js.map +7 -0
  75. package/cjs/utils/refs-helpers.js +43 -22
  76. package/cjs/utils/refs-helpers.js.map +7 -0
  77. package/cjs/utils/selectable-helper.js +61 -53
  78. package/cjs/utils/selectable-helper.js.map +7 -0
  79. package/cjs/utils/string-helpers.js +35 -7
  80. package/cjs/utils/string-helpers.js.map +7 -0
  81. package/cjs/utils/tree-helpers.js +105 -161
  82. package/cjs/utils/tree-helpers.js.map +7 -0
  83. package/cjs/utils/useDnDHelpers.js +199 -0
  84. package/cjs/utils/useDnDHelpers.js.map +7 -0
  85. package/cjs/utils/useInstanceRefActions.js +54 -43
  86. package/cjs/utils/useInstanceRefActions.js.map +7 -0
  87. package/cjs/utils/useTree.js +76 -80
  88. package/cjs/utils/useTree.js.map +7 -0
  89. package/esm/TreeView.js +18 -16
  90. package/esm/TreeView.js.map +7 -0
  91. package/esm/TreeViewContext.js +32 -31
  92. package/esm/TreeViewContext.js.map +7 -0
  93. package/esm/config/cssClassesConstants.js +12 -6
  94. package/esm/config/cssClassesConstants.js.map +7 -0
  95. package/esm/config/useTreeview.js +73 -56
  96. package/esm/config/useTreeview.js.map +7 -0
  97. package/esm/index.js +8 -9
  98. package/esm/index.js.map +7 -0
  99. package/esm/parts/CheckboxSelectable.js +36 -46
  100. package/esm/parts/CheckboxSelectable.js.map +7 -0
  101. package/esm/parts/ChildrenCountDisplayer.js +16 -20
  102. package/esm/parts/ChildrenCountDisplayer.js.map +7 -0
  103. package/esm/parts/ExpandCaret.js +54 -72
  104. package/esm/parts/ExpandCaret.js.map +7 -0
  105. package/esm/parts/Icon.js +16 -22
  106. package/esm/parts/Icon.js.map +7 -0
  107. package/esm/parts/NestingSpace.js +14 -27
  108. package/esm/parts/NestingSpace.js.map +7 -0
  109. package/esm/parts/RadioSelectable.js +20 -28
  110. package/esm/parts/RadioSelectable.js.map +7 -0
  111. package/esm/parts/TreeItem.js +114 -125
  112. package/esm/parts/TreeItem.js.map +7 -0
  113. package/esm/parts/TreeItemText.js +58 -85
  114. package/esm/parts/TreeItemText.js.map +7 -0
  115. package/esm/parts/TreeList.js +91 -119
  116. package/esm/parts/TreeList.js.map +7 -0
  117. package/esm/plugins/dnd/TreeDndPlugin.js +30 -3
  118. package/esm/plugins/dnd/TreeDndPlugin.js.map +7 -0
  119. package/esm/plugins/dnd/index.js +3 -1
  120. package/esm/plugins/dnd/index.js.map +7 -0
  121. package/esm/plugins/index.js +9 -7
  122. package/esm/plugins/index.js.map +7 -0
  123. package/esm/plugins/roving/TreeRovingPlugin.js +6 -3
  124. package/esm/plugins/roving/TreeRovingPlugin.js.map +7 -0
  125. package/esm/plugins/roving/index.js +3 -1
  126. package/esm/plugins/roving/index.js.map +7 -0
  127. package/esm/plugins/searchable/SearchableTreePlugin.js +6 -3
  128. package/esm/plugins/searchable/SearchableTreePlugin.js.map +7 -0
  129. package/esm/plugins/searchable/index.js +3 -1
  130. package/esm/plugins/searchable/index.js.map +7 -0
  131. package/esm/plugins/selectable/SelectablePluginTree.js +6 -3
  132. package/esm/plugins/selectable/SelectablePluginTree.js.map +7 -0
  133. package/esm/plugins/selectable/index.js +3 -1
  134. package/esm/plugins/selectable/index.js.map +7 -0
  135. package/esm/plugins/toolbar/TreeToolbarPlugin.js +6 -3
  136. package/esm/plugins/toolbar/TreeToolbarPlugin.js.map +7 -0
  137. package/esm/plugins/toolbar/index.js +3 -1
  138. package/esm/plugins/toolbar/index.js.map +7 -0
  139. package/esm/plugins/tree/TreeDataPlugin.js +6 -3
  140. package/esm/plugins/tree/TreeDataPlugin.js.map +7 -0
  141. package/esm/plugins/tree/index.js +3 -1
  142. package/esm/plugins/tree/index.js.map +7 -0
  143. package/esm/plugins/virtualization/TreeVirtualizationPlugin.js +6 -3
  144. package/esm/plugins/virtualization/TreeVirtualizationPlugin.js.map +7 -0
  145. package/esm/plugins/virtualization/index.js +3 -1
  146. package/esm/plugins/virtualization/index.js.map +7 -0
  147. package/esm/react-desc-prop-types.js +47 -44
  148. package/esm/react-desc-prop-types.js.map +7 -0
  149. package/esm/related-components/TreeViewSearchBar.js +13 -32
  150. package/esm/related-components/TreeViewSearchBar.js.map +7 -0
  151. package/esm/sharedTypes.js +2 -1
  152. package/esm/sharedTypes.js.map +7 -0
  153. package/esm/utils/array-helpers.js +6 -6
  154. package/esm/utils/array-helpers.js.map +7 -0
  155. package/esm/utils/dnd-helpers.js +117 -0
  156. package/esm/utils/dnd-helpers.js.map +7 -0
  157. package/esm/utils/group-expands-helpers.js +56 -46
  158. package/esm/utils/group-expands-helpers.js.map +7 -0
  159. package/esm/utils/keyboard-helpers.js +46 -74
  160. package/esm/utils/keyboard-helpers.js.map +7 -0
  161. package/esm/utils/object-helpers.js +14 -31
  162. package/esm/utils/object-helpers.js.map +7 -0
  163. package/esm/utils/refs-helpers.js +15 -19
  164. package/esm/utils/refs-helpers.js.map +7 -0
  165. package/esm/utils/selectable-helper.js +32 -43
  166. package/esm/utils/selectable-helper.js.map +7 -0
  167. package/esm/utils/string-helpers.js +6 -3
  168. package/esm/utils/string-helpers.js.map +7 -0
  169. package/esm/utils/tree-helpers.js +73 -143
  170. package/esm/utils/tree-helpers.js.map +7 -0
  171. package/esm/utils/useDnDHelpers.js +170 -0
  172. package/esm/utils/useDnDHelpers.js.map +7 -0
  173. package/esm/utils/useInstanceRefActions.js +21 -35
  174. package/esm/utils/useInstanceRefActions.js.map +7 -0
  175. package/esm/utils/useTree.js +35 -59
  176. package/esm/utils/useTree.js.map +7 -0
  177. package/package.json +19 -35
  178. package/types/TreeView.d.ts +1 -1
  179. package/types/parts/TreeItem.d.ts +11 -4
  180. package/types/parts/TreeList.d.ts +4 -0
  181. package/types/plugins/dnd/TreeDndPlugin.d.ts +2 -0
  182. package/types/react-desc-prop-types.d.ts +3 -17
  183. package/types/sharedTypes.d.ts +8 -1
  184. package/types/utils/dnd-helpers.d.ts +39 -0
  185. package/types/utils/keyboard-helpers.d.ts +1 -2
  186. package/types/utils/refs-helpers.d.ts +1 -1
  187. package/types/utils/tree-helpers.d.ts +1 -4
  188. package/types/utils/useDnDHelpers.d.ts +26 -0
  189. package/types/utils/useTree.d.ts +0 -1
  190. package/cjs/hoc/DnDTreeContext.js +0 -18
  191. package/cjs/hoc/SortableItemContext.js +0 -21
  192. package/cjs/hoc/WithConditionalDnDContext.js +0 -138
  193. package/cjs/hoc/WithDnDSortableItemContext.js +0 -70
  194. package/cjs/parts/DnDHandle.js +0 -46
  195. package/cjs/parts/DropIndicator.js +0 -75
  196. package/esm/hoc/DnDTreeContext.js +0 -14
  197. package/esm/hoc/SortableItemContext.js +0 -17
  198. package/esm/hoc/WithConditionalDnDContext.js +0 -128
  199. package/esm/hoc/WithDnDSortableItemContext.js +0 -61
  200. package/esm/parts/DnDHandle.js +0 -38
  201. package/esm/parts/DropIndicator.js +0 -68
  202. package/types/hoc/DnDTreeContext.d.ts +0 -14
  203. package/types/hoc/SortableItemContext.d.ts +0 -19
  204. package/types/hoc/WithConditionalDnDContext.d.ts +0 -4
  205. package/types/hoc/WithDnDSortableItemContext.d.ts +0 -4
  206. package/types/parts/DnDHandle.d.ts +0 -6
  207. package/types/parts/DropIndicator.d.ts +0 -10
@@ -1,127 +1,99 @@
1
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
- import _jsx from '@babel/runtime/helpers/esm/jsx';
3
- import 'core-js/modules/esnext.async-iterator.map.js';
4
- import 'core-js/modules/esnext.iterator.map.js';
5
- import 'core-js/modules/esnext.async-iterator.filter.js';
6
- import 'core-js/modules/esnext.iterator.constructor.js';
7
- import 'core-js/modules/esnext.iterator.filter.js';
8
- import 'core-js/modules/esnext.async-iterator.for-each.js';
9
- import 'core-js/modules/esnext.iterator.for-each.js';
10
- import { useContext } from 'react';
11
- import { aggregatedClasses } from '@elliemae/ds-classnames';
12
- import { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';
13
- import TreeViewContext from '../TreeViewContext.js';
14
- import { treeListBlockName, DSTreeViewPrefix } from '../config/cssClassesConstants.js';
15
- import TreeItem from './TreeItem.js';
16
- import { withConditionalDnDRowContext } from '../hoc/WithConditionalDnDContext.js';
17
- import { DnDTreeContext } from '../hoc/DnDTreeContext.js';
18
- import { jsxs, jsx } from 'react/jsx-runtime';
19
-
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
- const treeListNoItemsBn = "".concat(treeListBlockName, "-no-items");
24
- const TreeListNoItems = aggregatedClasses('div', {
25
- 'data-testid': treeListNoItemsBn
26
- })(treeListNoItemsBn); // React.ComponentProps<'ul'> uses LegacyRef typings that existed pre-hook era
27
- // we omit the LegacyRef typings in favor of hook-era typings
28
-
29
- const TreeListWrapper = aggregatedClasses('ul', {
30
- 'data-testid': treeListBlockName,
31
- role: 'tree'
32
- })(treeListBlockName, null, _ref => {
33
- let {
34
- rowSize
35
- } = _ref;
36
- return {
37
- ["rowsize-".concat(rowSize)]: rowSize
38
- };
39
- });
40
- const compactRowClass = "".concat(DSTreeViewPrefix, "-tv-row-size-compact");
41
- const normaRowClass = "".concat(DSTreeViewPrefix, "-tv-row-size-normal");
42
-
43
- const TreeListComp = () => {
1
+ import * as React from "react";
2
+ import React2, { useContext } from "react";
3
+ import { SortableContainer } from "@elliemae/react-sortable-hoc";
4
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
5
+ import { DSCircularProgressIndicator } from "@elliemae/ds-circular-progress-indicator";
6
+ import TreeViewContext from "../TreeViewContext";
7
+ import { DSTreeViewPrefix, treeListBlockName } from "../config/cssClassesConstants";
8
+ import { TreeItem, DragAndDropTreeItem } from "./TreeItem";
9
+ const treeListNoItemsBn = `${treeListBlockName}-no-items`;
10
+ const TreeListNoItems = aggregatedClasses("div", {
11
+ "data-testid": treeListNoItemsBn
12
+ })(treeListNoItemsBn);
13
+ const TreeListWrapper = aggregatedClasses("ul", {
14
+ "data-testid": treeListBlockName,
15
+ role: "tree"
16
+ })(treeListBlockName, null, ({ rowSize }) => ({
17
+ [`rowsize-${rowSize}`]: rowSize
18
+ }));
19
+ const compactRowClass = `${DSTreeViewPrefix}-tv-row-size-compact`;
20
+ const normaRowClass = `${DSTreeViewPrefix}-tv-row-size-normal`;
21
+ const TreeList = (props) => {
22
+ const { onMouseDragOverItem } = props;
44
23
  const ctx = useContext(TreeViewContext);
45
24
  const {
46
25
  virtualListRef,
47
26
  virtualListHelpers,
48
- visibleItems: flattenedVisibleItems,
49
- props: {
50
- width,
51
- height,
52
- rowSize,
53
- noItemsPlaceholder,
54
- isLoading
55
- }
27
+ visibleItems,
28
+ withDragAndDrop,
29
+ props: { width, height, rowSize, noItemsPlaceholder, isLoading }
56
30
  } = ctx;
57
- const {
58
- totalSize,
59
- virtualItems
60
- } = virtualListHelpers;
61
- const className = "".concat(rowSize === 'compact' ? "".concat(compactRowClass) : "".concat(normaRowClass));
62
- const {
63
- visibleItems
64
- } = useContext(DnDTreeContext);
65
- return /*#__PURE__*/jsxs(TreeListWrapper, {
31
+ const { totalSize, virtualItems } = virtualListHelpers;
32
+ const className = `${rowSize === "compact" ? `${compactRowClass}` : `${normaRowClass}`}`;
33
+ return /* @__PURE__ */ React2.createElement(TreeListWrapper, {
66
34
  ref: virtualListRef,
67
- className: className,
35
+ className,
36
+ style: {
37
+ height: `${typeof height === "number" ? `${height}px` : height}`,
38
+ width: `${typeof width === "number" ? `${width}px` : width}`,
39
+ overflow: "auto"
40
+ }
41
+ }, isLoading ? /* @__PURE__ */ React2.createElement("div", {
68
42
  style: {
69
- height: "".concat(typeof height === 'number' ? "".concat(height, "px") : height),
70
- width: "".concat(typeof width === 'number' ? "".concat(width, "px") : width),
71
- overflow: 'auto'
72
- },
73
- children: [isLoading ? /*#__PURE__*/_jsx("div", {
74
- style: {
75
- width: '100%',
76
- height: '100%',
77
- display: 'flex',
78
- alignItems: 'center',
79
- justifyContent: 'center'
80
- }
81
- }, void 0, /*#__PURE__*/_jsx(DSCircularProgressIndicator, {
82
- size: "xl",
83
- loading: isLoading,
84
- showLabel: true,
85
- waiting: false,
86
- showTooltip: false
87
- })) : null, !isLoading && virtualItems.length === 0 ? /*#__PURE__*/_jsx(TreeListNoItems, {}, void 0, noItemsPlaceholder) : null, !isLoading && virtualItems.length !== 0 ? /*#__PURE__*/_jsx("div", {
88
- style: {
89
- height: "".concat(totalSize, "px"),
90
- width: '100%',
91
- position: 'relative'
92
- }
93
- }, void 0, virtualItems.map(virtualItem => {
94
- const {
95
- index,
96
- measureRef,
97
- start
98
- } = virtualItem;
99
- const item = (visibleItems || flattenedVisibleItems)[index];
100
- if (!item) return null;
101
- item.virtualIndex = index;
102
- const {
103
- id
104
- } = item;
105
- const style = {
106
- position: 'absolute',
107
- top: "".concat(start, "px"),
108
- left: 0,
109
- width: '100%'
110
- };
111
- const listItemProps = {
112
- key: "DS-TreeView-List-Item-".concat(id),
113
- virtualItemRef: measureRef,
114
- index,
115
- // this is consumed by the DnD HOC
116
- itemIndex: index,
117
- item,
118
- itemWrapperStyle: style
119
- };
120
- return /*#__PURE__*/jsx(TreeItem, _objectSpread({}, listItemProps));
121
- })) : null]
122
- });
43
+ width: "100%",
44
+ height: "100%",
45
+ display: "flex",
46
+ alignItems: "center",
47
+ justifyContent: "center"
48
+ }
49
+ }, /* @__PURE__ */ React2.createElement(DSCircularProgressIndicator, {
50
+ size: "xl",
51
+ loading: isLoading,
52
+ showLabel: true,
53
+ waiting: false,
54
+ showTooltip: false
55
+ })) : null, !isLoading && virtualItems.length === 0 ? /* @__PURE__ */ React2.createElement(TreeListNoItems, null, noItemsPlaceholder) : null, !isLoading && virtualItems.length !== 0 ? /* @__PURE__ */ React2.createElement("div", {
56
+ style: {
57
+ height: `${totalSize}px`,
58
+ width: "100%",
59
+ position: "relative"
60
+ }
61
+ }, virtualItems.map((virtualItem) => {
62
+ const { index, measureRef, start } = virtualItem;
63
+ const item = visibleItems[index];
64
+ item.virtualIndex = index;
65
+ const { id } = item;
66
+ const style = {
67
+ position: "absolute",
68
+ top: 0,
69
+ left: 0,
70
+ width: "100%",
71
+ transform: `translateY(${start}px)`
72
+ };
73
+ const listItemProps = {
74
+ key: `DS-TreeView-List-Item-${id}`,
75
+ virtualItemRef: measureRef,
76
+ index,
77
+ itemIndex: index,
78
+ item,
79
+ itemWrapperStyle: style
80
+ };
81
+ if (withDragAndDrop)
82
+ return /* @__PURE__ */ React2.createElement(DragAndDropTreeItem, {
83
+ ...listItemProps,
84
+ onMouseDragOverItem
85
+ });
86
+ return /* @__PURE__ */ React2.createElement(TreeItem, {
87
+ ...listItemProps
88
+ });
89
+ })) : null);
90
+ };
91
+ const DragAndDropTreeList = SortableContainer(TreeList);
92
+ export {
93
+ DragAndDropTreeList,
94
+ TreeList,
95
+ TreeListNoItems,
96
+ TreeListWrapper,
97
+ treeListNoItemsBn
123
98
  };
124
-
125
- const TreeList = withConditionalDnDRowContext(TreeListComp);
126
-
127
- export { TreeList, TreeListNoItems, TreeListWrapper, treeListNoItemsBn };
99
+ //# 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 { SortableContainer } from '@elliemae/react-sortable-hoc';\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, DragAndDropTreeItem } from './TreeItem';\n\nimport type { DSTreeviewT } from '../react-desc-prop-types';\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\nexport const TreeList = (props: PropsT) => {\n const { onMouseDragOverItem } = props;\n const ctx = useContext(TreeViewContext);\n const {\n virtualListRef,\n virtualListHelpers,\n visibleItems,\n withDragAndDrop,\n props: { width, height, rowSize, noItemsPlaceholder, isLoading },\n } = ctx;\n const { totalSize, virtualItems } = virtualListHelpers;\n const className = `${rowSize === 'compact' ? `${compactRowClass}` : `${normaRowClass}`}`;\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[index];\n item.virtualIndex = index;\n const { id } = item;\n\n const style = {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${start}px)`,\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 if (withDragAndDrop)\n return <DragAndDropTreeItem {...listItemProps} onMouseDragOverItem={onMouseDragOverItem} />;\n return <TreeItem {...listItemProps} />;\n })}\n </div>\n ) : null}\n </TreeListWrapper>\n );\n};\ntype SortablePropsT = PropsT & {\n disableAnimation?: boolean;\n getContainer: (element: React.ReactElement<unknown>) => HTMLElement | Promise<HTMLElement>;\n};\nexport const DragAndDropTreeList = SortableContainer<SortablePropsT>(TreeList);\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA;AACA;AACA;AAIO,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;AAYlB,MAAM,WAAW,CAAC,UAAkB;AACzC,QAAM,EAAE,wBAAwB;AAChC,QAAM,MAAM,WAAW;AACvB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,OAAO,QAAQ,SAAS,oBAAoB;AAAA,MACnD;AACJ,QAAM,EAAE,WAAW,iBAAiB;AACpC,QAAM,YAAY,GAAG,YAAY,YAAY,GAAG,oBAAoB,GAAG;AAEvE,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,OAAO,aAAa;AAC1B,SAAK,eAAe;AACpB,UAAM,EAAE,OAAO;AAEf,UAAM,QAAQ;AAAA,MACZ,UAAU;AAAA,MACV,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,WAAW,cAAc;AAAA;AAG3B,UAAM,gBAAgB;AAAA,MACpB,KAAK,yBAAyB;AAAA,MAC9B,gBAAgB;AAAA,MAChB;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA,kBAAkB;AAAA;AAGpB,QAAI;AACF,aAAO,qCAAC,qBAAD;AAAA,WAAyB;AAAA,QAAe;AAAA;AACjD,WAAO,qCAAC,UAAD;AAAA,SAAc;AAAA;AAAA,QAGvB;AAAA;AAQH,MAAM,sBAAsB,kBAAkC;",
6
+ "names": []
7
+ }
@@ -1,3 +1,30 @@
1
- const TreeDndPlugin = 'tree-dnd';
2
-
3
- export { TreeDndPlugin };
1
+ import * as React from "react";
2
+ import React2, { useContext } from "react";
3
+ import { DragAndDropTreeList } from "../../parts/TreeList";
4
+ import { useDnDHelpers } from "../../utils/useDnDHelpers";
5
+ import { keyCodes } from "../../utils/dnd-helpers";
6
+ import TreeViewContext from "../../TreeViewContext";
7
+ const TreeDnD = () => {
8
+ const { updateBeforeSortStart, onSortStart, onMouseDragOverItem, onSortEnd } = useDnDHelpers();
9
+ const ctx = useContext(TreeViewContext);
10
+ const { virtualListRef } = ctx;
11
+ return /* @__PURE__ */ React2.createElement(DragAndDropTreeList, {
12
+ useDragHandle: true,
13
+ transitionDuration: 0,
14
+ keyboardSortingTransitionDuration: 0,
15
+ hideSortableGhost: false,
16
+ disableAnimation: true,
17
+ updateBeforeSortStart,
18
+ onSortStart,
19
+ onMouseDragOverItem,
20
+ onSortEnd,
21
+ getContainer: () => virtualListRef?.current,
22
+ keyCodes
23
+ });
24
+ };
25
+ const TreeDndPlugin = "tree-dnd";
26
+ export {
27
+ TreeDnD,
28
+ TreeDndPlugin
29
+ };
30
+ //# sourceMappingURL=TreeDndPlugin.js.map
@@ -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", "import React, { useContext } from 'react';\n\nimport { DragAndDropTreeList } from '../../parts/TreeList';\n\nimport { useDnDHelpers } from '../../utils/useDnDHelpers';\nimport { keyCodes } from '../../utils/dnd-helpers';\n\nimport TreeViewContext from '../../TreeViewContext';\nexport const TreeDnD = () => {\n const { updateBeforeSortStart, onSortStart, onMouseDragOverItem, onSortEnd } = useDnDHelpers();\n const ctx = useContext(TreeViewContext);\n const { virtualListRef } = ctx;\n return (\n <DragAndDropTreeList\n useDragHandle\n transitionDuration={0}\n keyboardSortingTransitionDuration={0}\n hideSortableGhost={false}\n disableAnimation\n updateBeforeSortStart={updateBeforeSortStart}\n onSortStart={onSortStart}\n onMouseDragOverItem={onMouseDragOverItem}\n onSortEnd={onSortEnd}\n getContainer={() => virtualListRef?.current as HTMLUListElement}\n keyCodes={keyCodes}\n />\n );\n};\n\nexport const TreeDndPlugin = 'tree-dnd';\n"],
5
+ "mappings": "AAAA;ACAA;AAEA;AAEA;AACA;AAEA;AACO,MAAM,UAAU,MAAM;AAC3B,QAAM,EAAE,uBAAuB,aAAa,qBAAqB,cAAc;AAC/E,QAAM,MAAM,WAAW;AACvB,QAAM,EAAE,mBAAmB;AAC3B,SACE,qCAAC,qBAAD;AAAA,IACE,eAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,mCAAmC;AAAA,IACnC,mBAAmB;AAAA,IACnB,kBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc,MAAM,gBAAgB;AAAA,IACpC;AAAA;AAAA;AAKC,MAAM,gBAAgB;",
6
+ "names": []
7
+ }
@@ -1 +1,3 @@
1
- export { TreeDndPlugin } from './TreeDndPlugin.js';
1
+ import * as React from "react";
2
+ export * from "./TreeDndPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }
@@ -1,7 +1,9 @@
1
- export { TreeDndPlugin } from './dnd/TreeDndPlugin.js';
2
- export { TreeRovingPlugin } from './roving/TreeRovingPlugin.js';
3
- export { SelectablePluginTree } from './selectable/SelectablePluginTree.js';
4
- export { TreeToolbarPlugin } from './toolbar/TreeToolbarPlugin.js';
5
- export { TreePluginList } from './tree/TreeDataPlugin.js';
6
- export { TreeVirtualizationPlugin } from './virtualization/TreeVirtualizationPlugin.js';
7
- export { SearchableTreePlugin } from './searchable/SearchableTreePlugin.js';
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
+ }
@@ -1,3 +1,6 @@
1
- const TreeRovingPlugin = 'tree-roving';
2
-
3
- export { TreeRovingPlugin };
1
+ import * as React from "react";
2
+ const TreeRovingPlugin = "tree-roving";
3
+ export {
4
+ TreeRovingPlugin
5
+ };
6
+ //# sourceMappingURL=TreeRovingPlugin.js.map
@@ -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
+ }
@@ -1 +1,3 @@
1
- export { TreeRovingPlugin } from './TreeRovingPlugin.js';
1
+ import * as React from "react";
2
+ export * from "./TreeRovingPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }
@@ -1,3 +1,6 @@
1
- const SearchableTreePlugin = 'tree-searchable';
2
-
3
- export { SearchableTreePlugin };
1
+ import * as React from "react";
2
+ const SearchableTreePlugin = "tree-searchable";
3
+ export {
4
+ SearchableTreePlugin
5
+ };
6
+ //# sourceMappingURL=SearchableTreePlugin.js.map
@@ -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
+ }
@@ -1 +1,3 @@
1
- export { SearchableTreePlugin } from './SearchableTreePlugin.js';
1
+ import * as React from "react";
2
+ export * from "./SearchableTreePlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }
@@ -1,3 +1,6 @@
1
- const SelectablePluginTree = 'tree-selectable';
2
-
3
- export { SelectablePluginTree };
1
+ import * as React from "react";
2
+ const SelectablePluginTree = "tree-selectable";
3
+ export {
4
+ SelectablePluginTree
5
+ };
6
+ //# sourceMappingURL=SelectablePluginTree.js.map
@@ -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
+ }
@@ -1 +1,3 @@
1
- export { SelectablePluginTree } from './SelectablePluginTree.js';
1
+ import * as React from "react";
2
+ export * from "./SelectablePluginTree";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }
@@ -1,3 +1,6 @@
1
- const TreeToolbarPlugin = 'tree-toolbar';
2
-
3
- export { TreeToolbarPlugin };
1
+ import * as React from "react";
2
+ const TreeToolbarPlugin = "tree-toolbar";
3
+ export {
4
+ TreeToolbarPlugin
5
+ };
6
+ //# sourceMappingURL=TreeToolbarPlugin.js.map
@@ -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
+ }
@@ -1 +1,3 @@
1
- export { TreeToolbarPlugin } from './TreeToolbarPlugin.js';
1
+ import * as React from "react";
2
+ export * from "./TreeToolbarPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }
@@ -1,3 +1,6 @@
1
- const TreePluginList = 'tree-data';
2
-
3
- export { TreePluginList };
1
+ import * as React from "react";
2
+ const TreePluginList = "tree-data";
3
+ export {
4
+ TreePluginList
5
+ };
6
+ //# sourceMappingURL=TreeDataPlugin.js.map
@@ -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
+ }
@@ -1 +1,3 @@
1
- export { TreePluginList } from './TreeDataPlugin.js';
1
+ import * as React from "react";
2
+ export * from "./TreeDataPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }
@@ -1,3 +1,6 @@
1
- const TreeVirtualizationPlugin = 'tree-virtualization';
2
-
3
- export { TreeVirtualizationPlugin };
1
+ import * as React from "react";
2
+ const TreeVirtualizationPlugin = "tree-virtualization";
3
+ export {
4
+ TreeVirtualizationPlugin
5
+ };
6
+ //# sourceMappingURL=TreeVirtualizationPlugin.js.map
@@ -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
+ }
@@ -1 +1,3 @@
1
- export { TreeVirtualizationPlugin } from './TreeVirtualizationPlugin.js';
1
+ import * as React from "react";
2
+ export * from "./TreeVirtualizationPlugin";
3
+ //# sourceMappingURL=index.js.map
@@ -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
+ }