@elliemae/ds-treeview 2.3.0-alpha.9 → 2.3.0-next.0
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/cjs/TreeView.js +30 -0
- package/cjs/TreeViewContext.js +98 -0
- package/cjs/config/cssClassesConstants.js +13 -0
- package/cjs/config/useTreeview.js +127 -0
- package/cjs/hoc/DnDTreeContext.js +18 -0
- package/cjs/hoc/SortableItemContext.js +21 -0
- package/cjs/hoc/WithConditionalDnDContext.js +138 -0
- package/cjs/hoc/WithDnDSortableItemContext.js +70 -0
- package/cjs/index.js +26 -0
- package/cjs/parts/CheckboxSelectable.js +86 -0
- package/cjs/parts/ChildrenCountDisplayer.js +30 -0
- package/cjs/parts/DnDHandle.js +46 -0
- package/cjs/parts/DropIndicator.js +75 -0
- package/cjs/parts/ExpandCaret.js +94 -0
- package/cjs/parts/Icon.js +37 -0
- package/cjs/parts/NestingSpace.js +47 -0
- package/cjs/parts/RadioSelectable.js +59 -0
- package/cjs/parts/TreeItem.js +185 -0
- package/cjs/parts/TreeItemText.js +108 -0
- package/cjs/parts/TreeList.js +139 -0
- package/cjs/plugins/dnd/TreeDndPlugin.js +7 -0
- package/cjs/plugins/dnd/index.js +9 -0
- package/cjs/plugins/index.js +21 -0
- package/cjs/plugins/roving/TreeRovingPlugin.js +7 -0
- package/cjs/plugins/roving/index.js +9 -0
- package/cjs/plugins/searchable/SearchableTreePlugin.js +7 -0
- package/cjs/plugins/searchable/index.js +9 -0
- package/cjs/plugins/selectable/SelectablePluginTree.js +7 -0
- package/cjs/plugins/selectable/index.js +9 -0
- package/cjs/plugins/toolbar/TreeToolbarPlugin.js +7 -0
- package/cjs/plugins/toolbar/index.js +9 -0
- package/cjs/plugins/tree/TreeDataPlugin.js +7 -0
- package/cjs/plugins/tree/index.js +9 -0
- package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +7 -0
- package/cjs/plugins/virtualization/index.js +9 -0
- package/cjs/react-desc-prop-types.js +56 -0
- package/cjs/related-components/TreeViewSearchBar.js +48 -0
- package/cjs/sharedTypes.js +2 -0
- package/cjs/utils/array-helpers.js +24 -0
- package/cjs/utils/group-expands-helpers.js +111 -0
- package/cjs/utils/keyboard-helpers.js +175 -0
- package/cjs/utils/object-helpers.js +69 -0
- package/cjs/utils/refs-helpers.js +31 -0
- package/cjs/utils/selectable-helper.js +80 -0
- package/cjs/utils/string-helpers.js +7 -0
- package/cjs/utils/tree-helpers.js +220 -0
- package/cjs/utils/useInstanceRefActions.js +87 -0
- package/cjs/utils/useTree.js +108 -0
- package/esm/TreeView.js +21 -0
- package/{dist/esm → esm}/TreeViewContext.js +29 -24
- package/esm/config/cssClassesConstants.js +6 -0
- package/esm/config/useTreeview.js +119 -0
- package/esm/hoc/DnDTreeContext.js +14 -0
- package/esm/hoc/SortableItemContext.js +17 -0
- package/esm/hoc/WithConditionalDnDContext.js +128 -0
- package/esm/hoc/WithDnDSortableItemContext.js +61 -0
- package/esm/index.js +9 -0
- package/esm/parts/CheckboxSelectable.js +78 -0
- package/esm/parts/ChildrenCountDisplayer.js +22 -0
- package/esm/parts/DnDHandle.js +38 -0
- package/esm/parts/DropIndicator.js +68 -0
- package/esm/parts/ExpandCaret.js +85 -0
- package/esm/parts/Icon.js +29 -0
- package/esm/parts/NestingSpace.js +39 -0
- package/esm/parts/RadioSelectable.js +53 -0
- package/esm/parts/TreeItem.js +173 -0
- package/esm/parts/TreeItemText.js +99 -0
- package/esm/parts/TreeList.js +127 -0
- package/esm/plugins/dnd/TreeDndPlugin.js +3 -0
- package/esm/plugins/dnd/index.js +1 -0
- package/esm/plugins/index.js +7 -0
- package/esm/plugins/roving/TreeRovingPlugin.js +3 -0
- package/esm/plugins/roving/index.js +1 -0
- package/esm/plugins/searchable/SearchableTreePlugin.js +3 -0
- package/esm/plugins/searchable/index.js +1 -0
- package/esm/plugins/selectable/SelectablePluginTree.js +3 -0
- package/esm/plugins/selectable/index.js +1 -0
- package/esm/plugins/toolbar/TreeToolbarPlugin.js +3 -0
- package/esm/plugins/toolbar/index.js +1 -0
- package/esm/plugins/tree/TreeDataPlugin.js +3 -0
- package/esm/plugins/tree/index.js +1 -0
- package/esm/plugins/virtualization/TreeVirtualizationPlugin.js +3 -0
- package/esm/plugins/virtualization/index.js +1 -0
- package/esm/react-desc-prop-types.js +52 -0
- package/esm/related-components/TreeViewSearchBar.js +40 -0
- package/esm/sharedTypes.js +1 -0
- package/{dist/esm → esm}/utils/array-helpers.js +6 -6
- package/esm/utils/group-expands-helpers.js +99 -0
- package/{dist/esm → esm}/utils/keyboard-helpers.js +71 -43
- package/esm/utils/object-helpers.js +64 -0
- package/esm/utils/refs-helpers.js +27 -0
- package/esm/utils/selectable-helper.js +70 -0
- package/esm/utils/string-helpers.js +3 -0
- package/esm/utils/tree-helpers.js +205 -0
- package/{dist/esm → esm}/utils/useInstanceRefActions.js +35 -21
- package/esm/utils/useTree.js +99 -0
- package/package.json +121 -124
- package/{dist/types → types}/TreeView.d.ts +0 -0
- package/{dist/types → types}/TreeViewContext.d.ts +0 -0
- package/{dist/types → types}/config/cssClassesConstants.d.ts +0 -0
- package/{dist/types → types}/config/useTreeview.d.ts +0 -0
- package/{dist/types → types}/hoc/DnDTreeContext.d.ts +0 -0
- package/{dist/types → types}/hoc/SortableItemContext.d.ts +0 -0
- package/{dist/types → types}/hoc/WithConditionalDnDContext.d.ts +0 -0
- package/{dist/types → types}/hoc/WithDnDSortableItemContext.d.ts +0 -0
- package/{dist/types → types}/index.d.ts +0 -0
- package/{dist/types → types}/parts/CheckboxSelectable.d.ts +0 -0
- package/{dist/types → types}/parts/ChildrenCountDisplayer.d.ts +0 -0
- package/{dist/types → types}/parts/DnDHandle.d.ts +0 -0
- package/{dist/types → types}/parts/DropIndicator.d.ts +0 -0
- package/{dist/types → types}/parts/ExpandCaret.d.ts +0 -0
- package/{dist/types → types}/parts/Icon.d.ts +0 -0
- package/{dist/types → types}/parts/NestingSpace.d.ts +0 -0
- package/{dist/types → types}/parts/RadioSelectable.d.ts +0 -0
- package/{dist/types → types}/parts/TreeItem.d.ts +0 -0
- package/{dist/types → types}/parts/TreeItemText.d.ts +0 -0
- package/{dist/types → types}/parts/TreeList.d.ts +0 -0
- package/{dist/types → types}/plugins/dnd/TreeDndPlugin.d.ts +0 -0
- package/{dist/types → types}/plugins/dnd/index.d.ts +0 -0
- package/{dist/types → types}/plugins/index.d.ts +0 -0
- package/{dist/types → types}/plugins/roving/TreeRovingPlugin.d.ts +0 -0
- package/{dist/types → types}/plugins/roving/index.d.ts +0 -0
- package/{dist/types → types}/plugins/searchable/SearchableTreePlugin.d.ts +0 -0
- package/{dist/types → types}/plugins/searchable/index.d.ts +0 -0
- package/{dist/types → types}/plugins/selectable/SelectablePluginTree.d.ts +0 -0
- package/{dist/types → types}/plugins/selectable/index.d.ts +0 -0
- package/{dist/types → types}/plugins/toolbar/TreeToolbarPlugin.d.ts +0 -0
- package/{dist/types → types}/plugins/toolbar/index.d.ts +0 -0
- package/{dist/types → types}/plugins/tree/TreeDataPlugin.d.ts +0 -0
- package/{dist/types → types}/plugins/tree/index.d.ts +0 -0
- package/{dist/types → types}/plugins/virtualization/TreeVirtualizationPlugin.d.ts +0 -0
- package/{dist/types → types}/plugins/virtualization/index.d.ts +0 -0
- package/{dist/types → types}/react-desc-prop-types.d.ts +0 -0
- package/{dist/types → types}/related-components/TreeViewSearchBar.d.ts +0 -0
- package/{dist/types → types}/sharedTypes.d.ts +0 -0
- package/{dist/types → types}/utils/array-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/group-expands-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/keyboard-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/object-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/refs-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/selectable-helper.d.ts +0 -0
- package/{dist/types → types}/utils/string-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/tree-helpers.d.ts +0 -0
- package/{dist/types → types}/utils/useInstanceRefActions.d.ts +0 -0
- package/{dist/types → types}/utils/useTree.d.ts +0 -0
- package/dist/cjs/TreeView.js +0 -50
- package/dist/cjs/TreeView.js.map +0 -7
- package/dist/cjs/TreeViewContext.js +0 -116
- package/dist/cjs/TreeViewContext.js.map +0 -7
- package/dist/cjs/config/cssClassesConstants.js +0 -41
- package/dist/cjs/config/cssClassesConstants.js.map +0 -7
- package/dist/cjs/config/useTreeview.js +0 -151
- package/dist/cjs/config/useTreeview.js.map +0 -7
- package/dist/cjs/hoc/DnDTreeContext.js +0 -45
- package/dist/cjs/hoc/DnDTreeContext.js.map +0 -7
- package/dist/cjs/hoc/SortableItemContext.js +0 -46
- package/dist/cjs/hoc/SortableItemContext.js.map +0 -7
- package/dist/cjs/hoc/WithConditionalDnDContext.js +0 -128
- package/dist/cjs/hoc/WithConditionalDnDContext.js.map +0 -7
- package/dist/cjs/hoc/WithDnDSortableItemContext.js +0 -69
- package/dist/cjs/hoc/WithDnDSortableItemContext.js.map +0 -7
- package/dist/cjs/index.js +0 -37
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/parts/CheckboxSelectable.js +0 -97
- package/dist/cjs/parts/CheckboxSelectable.js.map +0 -7
- package/dist/cjs/parts/ChildrenCountDisplayer.js +0 -47
- package/dist/cjs/parts/ChildrenCountDisplayer.js.map +0 -7
- package/dist/cjs/parts/DnDHandle.js +0 -57
- package/dist/cjs/parts/DnDHandle.js.map +0 -7
- package/dist/cjs/parts/DropIndicator.js +0 -80
- package/dist/cjs/parts/DropIndicator.js.map +0 -7
- package/dist/cjs/parts/ExpandCaret.js +0 -96
- package/dist/cjs/parts/ExpandCaret.js.map +0 -7
- package/dist/cjs/parts/Icon.js +0 -52
- package/dist/cjs/parts/Icon.js.map +0 -7
- package/dist/cjs/parts/NestingSpace.js +0 -55
- package/dist/cjs/parts/NestingSpace.js.map +0 -7
- package/dist/cjs/parts/RadioSelectable.js +0 -74
- package/dist/cjs/parts/RadioSelectable.js.map +0 -7
- package/dist/cjs/parts/TreeItem.js +0 -166
- package/dist/cjs/parts/TreeItem.js.map +0 -7
- package/dist/cjs/parts/TreeItemText.js +0 -101
- package/dist/cjs/parts/TreeItemText.js.map +0 -7
- package/dist/cjs/parts/TreeList.js +0 -123
- package/dist/cjs/parts/TreeList.js.map +0 -7
- package/dist/cjs/plugins/dnd/TreeDndPlugin.js +0 -35
- package/dist/cjs/plugins/dnd/TreeDndPlugin.js.map +0 -7
- package/dist/cjs/plugins/dnd/index.js +0 -28
- package/dist/cjs/plugins/dnd/index.js.map +0 -7
- package/dist/cjs/plugins/index.js +0 -34
- package/dist/cjs/plugins/index.js.map +0 -7
- package/dist/cjs/plugins/roving/TreeRovingPlugin.js +0 -35
- package/dist/cjs/plugins/roving/TreeRovingPlugin.js.map +0 -7
- package/dist/cjs/plugins/roving/index.js +0 -28
- package/dist/cjs/plugins/roving/index.js.map +0 -7
- package/dist/cjs/plugins/searchable/SearchableTreePlugin.js +0 -35
- package/dist/cjs/plugins/searchable/SearchableTreePlugin.js.map +0 -7
- package/dist/cjs/plugins/searchable/index.js +0 -28
- package/dist/cjs/plugins/searchable/index.js.map +0 -7
- package/dist/cjs/plugins/selectable/SelectablePluginTree.js +0 -35
- package/dist/cjs/plugins/selectable/SelectablePluginTree.js.map +0 -7
- package/dist/cjs/plugins/selectable/index.js +0 -28
- package/dist/cjs/plugins/selectable/index.js.map +0 -7
- package/dist/cjs/plugins/toolbar/TreeToolbarPlugin.js +0 -35
- package/dist/cjs/plugins/toolbar/TreeToolbarPlugin.js.map +0 -7
- package/dist/cjs/plugins/toolbar/index.js +0 -28
- package/dist/cjs/plugins/toolbar/index.js.map +0 -7
- package/dist/cjs/plugins/tree/TreeDataPlugin.js +0 -35
- package/dist/cjs/plugins/tree/TreeDataPlugin.js.map +0 -7
- package/dist/cjs/plugins/tree/index.js +0 -28
- package/dist/cjs/plugins/tree/index.js.map +0 -7
- package/dist/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +0 -35
- package/dist/cjs/plugins/virtualization/TreeVirtualizationPlugin.js.map +0 -7
- package/dist/cjs/plugins/virtualization/index.js +0 -28
- package/dist/cjs/plugins/virtualization/index.js.map +0 -7
- package/dist/cjs/react-desc-prop-types.js +0 -85
- package/dist/cjs/react-desc-prop-types.js.map +0 -7
- package/dist/cjs/related-components/TreeViewSearchBar.js +0 -50
- package/dist/cjs/related-components/TreeViewSearchBar.js.map +0 -7
- package/dist/cjs/sharedTypes.js +0 -27
- package/dist/cjs/sharedTypes.js.map +0 -7
- package/dist/cjs/utils/array-helpers.js +0 -48
- package/dist/cjs/utils/array-helpers.js.map +0 -7
- package/dist/cjs/utils/group-expands-helpers.js +0 -138
- package/dist/cjs/utils/group-expands-helpers.js.map +0 -7
- package/dist/cjs/utils/keyboard-helpers.js +0 -170
- package/dist/cjs/utils/keyboard-helpers.js.map +0 -7
- package/dist/cjs/utils/object-helpers.js +0 -76
- package/dist/cjs/utils/object-helpers.js.map +0 -7
- package/dist/cjs/utils/refs-helpers.js +0 -52
- package/dist/cjs/utils/refs-helpers.js.map +0 -7
- package/dist/cjs/utils/selectable-helper.js +0 -88
- package/dist/cjs/utils/selectable-helper.js.map +0 -7
- package/dist/cjs/utils/string-helpers.js +0 -35
- package/dist/cjs/utils/string-helpers.js.map +0 -7
- package/dist/cjs/utils/tree-helpers.js +0 -184
- package/dist/cjs/utils/tree-helpers.js.map +0 -7
- package/dist/cjs/utils/useInstanceRefActions.js +0 -98
- package/dist/cjs/utils/useInstanceRefActions.js.map +0 -7
- package/dist/cjs/utils/useTree.js +0 -106
- package/dist/cjs/utils/useTree.js.map +0 -7
- package/dist/esm/TreeView.js +0 -21
- package/dist/esm/TreeView.js.map +0 -7
- package/dist/esm/TreeViewContext.js.map +0 -7
- package/dist/esm/config/cssClassesConstants.js +0 -12
- package/dist/esm/config/cssClassesConstants.js.map +0 -7
- package/dist/esm/config/useTreeview.js +0 -122
- package/dist/esm/config/useTreeview.js.map +0 -7
- package/dist/esm/hoc/DnDTreeContext.js +0 -16
- package/dist/esm/hoc/DnDTreeContext.js.map +0 -7
- package/dist/esm/hoc/SortableItemContext.js +0 -17
- package/dist/esm/hoc/SortableItemContext.js.map +0 -7
- package/dist/esm/hoc/WithConditionalDnDContext.js +0 -99
- package/dist/esm/hoc/WithConditionalDnDContext.js.map +0 -7
- package/dist/esm/hoc/WithDnDSortableItemContext.js +0 -40
- package/dist/esm/hoc/WithDnDSortableItemContext.js.map +0 -7
- package/dist/esm/index.js +0 -8
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/parts/CheckboxSelectable.js +0 -68
- package/dist/esm/parts/CheckboxSelectable.js.map +0 -7
- package/dist/esm/parts/ChildrenCountDisplayer.js +0 -18
- package/dist/esm/parts/ChildrenCountDisplayer.js.map +0 -7
- package/dist/esm/parts/DnDHandle.js +0 -28
- package/dist/esm/parts/DnDHandle.js.map +0 -7
- package/dist/esm/parts/DropIndicator.js +0 -51
- package/dist/esm/parts/DropIndicator.js.map +0 -7
- package/dist/esm/parts/ExpandCaret.js +0 -67
- package/dist/esm/parts/ExpandCaret.js.map +0 -7
- package/dist/esm/parts/Icon.js +0 -23
- package/dist/esm/parts/Icon.js.map +0 -7
- package/dist/esm/parts/NestingSpace.js +0 -26
- package/dist/esm/parts/NestingSpace.js.map +0 -7
- package/dist/esm/parts/RadioSelectable.js +0 -45
- package/dist/esm/parts/RadioSelectable.js.map +0 -7
- package/dist/esm/parts/TreeItem.js +0 -137
- package/dist/esm/parts/TreeItem.js.map +0 -7
- package/dist/esm/parts/TreeItemText.js +0 -72
- package/dist/esm/parts/TreeItemText.js.map +0 -7
- package/dist/esm/parts/TreeList.js +0 -94
- package/dist/esm/parts/TreeList.js.map +0 -7
- package/dist/esm/plugins/dnd/TreeDndPlugin.js +0 -6
- package/dist/esm/plugins/dnd/TreeDndPlugin.js.map +0 -7
- package/dist/esm/plugins/dnd/index.js +0 -3
- package/dist/esm/plugins/dnd/index.js.map +0 -7
- package/dist/esm/plugins/index.js +0 -9
- package/dist/esm/plugins/index.js.map +0 -7
- package/dist/esm/plugins/roving/TreeRovingPlugin.js +0 -6
- package/dist/esm/plugins/roving/TreeRovingPlugin.js.map +0 -7
- package/dist/esm/plugins/roving/index.js +0 -3
- package/dist/esm/plugins/roving/index.js.map +0 -7
- package/dist/esm/plugins/searchable/SearchableTreePlugin.js +0 -6
- package/dist/esm/plugins/searchable/SearchableTreePlugin.js.map +0 -7
- package/dist/esm/plugins/searchable/index.js +0 -3
- package/dist/esm/plugins/searchable/index.js.map +0 -7
- package/dist/esm/plugins/selectable/SelectablePluginTree.js +0 -6
- package/dist/esm/plugins/selectable/SelectablePluginTree.js.map +0 -7
- package/dist/esm/plugins/selectable/index.js +0 -3
- package/dist/esm/plugins/selectable/index.js.map +0 -7
- package/dist/esm/plugins/toolbar/TreeToolbarPlugin.js +0 -6
- package/dist/esm/plugins/toolbar/TreeToolbarPlugin.js.map +0 -7
- package/dist/esm/plugins/toolbar/index.js +0 -3
- package/dist/esm/plugins/toolbar/index.js.map +0 -7
- package/dist/esm/plugins/tree/TreeDataPlugin.js +0 -6
- package/dist/esm/plugins/tree/TreeDataPlugin.js.map +0 -7
- package/dist/esm/plugins/tree/index.js +0 -3
- package/dist/esm/plugins/tree/index.js.map +0 -7
- package/dist/esm/plugins/virtualization/TreeVirtualizationPlugin.js +0 -6
- package/dist/esm/plugins/virtualization/TreeVirtualizationPlugin.js.map +0 -7
- package/dist/esm/plugins/virtualization/index.js +0 -3
- package/dist/esm/plugins/virtualization/index.js.map +0 -7
- package/dist/esm/react-desc-prop-types.js +0 -56
- package/dist/esm/react-desc-prop-types.js.map +0 -7
- package/dist/esm/related-components/TreeViewSearchBar.js +0 -21
- package/dist/esm/related-components/TreeViewSearchBar.js.map +0 -7
- package/dist/esm/sharedTypes.js +0 -2
- package/dist/esm/sharedTypes.js.map +0 -7
- package/dist/esm/utils/array-helpers.js.map +0 -7
- package/dist/esm/utils/group-expands-helpers.js +0 -109
- package/dist/esm/utils/group-expands-helpers.js.map +0 -7
- package/dist/esm/utils/keyboard-helpers.js.map +0 -7
- package/dist/esm/utils/object-helpers.js +0 -47
- package/dist/esm/utils/object-helpers.js.map +0 -7
- package/dist/esm/utils/refs-helpers.js +0 -23
- package/dist/esm/utils/refs-helpers.js.map +0 -7
- package/dist/esm/utils/selectable-helper.js +0 -59
- package/dist/esm/utils/selectable-helper.js.map +0 -7
- package/dist/esm/utils/string-helpers.js +0 -6
- package/dist/esm/utils/string-helpers.js.map +0 -7
- package/dist/esm/utils/tree-helpers.js +0 -155
- package/dist/esm/utils/tree-helpers.js.map +0 -7
- package/dist/esm/utils/useInstanceRefActions.js.map +0 -7
- package/dist/esm/utils/useTree.js +0 -77
- package/dist/esm/utils/useTree.js.map +0 -7
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
16
|
+
var dsCircularProgressIndicator = require('@elliemae/ds-circular-progress-indicator');
|
|
17
|
+
var TreeViewContext = require('../TreeViewContext.js');
|
|
18
|
+
var cssClassesConstants = require('../config/cssClassesConstants.js');
|
|
19
|
+
var TreeItem = require('./TreeItem.js');
|
|
20
|
+
var WithConditionalDnDContext = require('../hoc/WithConditionalDnDContext.js');
|
|
21
|
+
var DnDTreeContext = require('../hoc/DnDTreeContext.js');
|
|
22
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
23
|
+
|
|
24
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
+
|
|
26
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
27
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
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__default["default"](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; }
|
|
32
|
+
const treeListNoItemsBn = "".concat(cssClassesConstants.treeListBlockName, "-no-items");
|
|
33
|
+
const TreeListNoItems = dsClassnames.aggregatedClasses('div', {
|
|
34
|
+
'data-testid': treeListNoItemsBn
|
|
35
|
+
})(treeListNoItemsBn); // React.ComponentProps<'ul'> uses LegacyRef typings that existed pre-hook era
|
|
36
|
+
// we omit the LegacyRef typings in favor of hook-era typings
|
|
37
|
+
|
|
38
|
+
const TreeListWrapper = dsClassnames.aggregatedClasses('ul', {
|
|
39
|
+
'data-testid': cssClassesConstants.treeListBlockName,
|
|
40
|
+
role: 'tree'
|
|
41
|
+
})(cssClassesConstants.treeListBlockName, null, _ref => {
|
|
42
|
+
let {
|
|
43
|
+
rowSize
|
|
44
|
+
} = _ref;
|
|
45
|
+
return {
|
|
46
|
+
["rowsize-".concat(rowSize)]: rowSize
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
const compactRowClass = "".concat(cssClassesConstants.DSTreeViewPrefix, "-tv-row-size-compact");
|
|
50
|
+
const normaRowClass = "".concat(cssClassesConstants.DSTreeViewPrefix, "-tv-row-size-normal");
|
|
51
|
+
|
|
52
|
+
const TreeListComp = () => {
|
|
53
|
+
const ctx = React.useContext(TreeViewContext["default"]);
|
|
54
|
+
const {
|
|
55
|
+
virtualListRef,
|
|
56
|
+
virtualListHelpers,
|
|
57
|
+
visibleItems: flattenedVisibleItems,
|
|
58
|
+
props: {
|
|
59
|
+
width,
|
|
60
|
+
height,
|
|
61
|
+
rowSize,
|
|
62
|
+
noItemsPlaceholder,
|
|
63
|
+
isLoading
|
|
64
|
+
}
|
|
65
|
+
} = ctx;
|
|
66
|
+
const {
|
|
67
|
+
totalSize,
|
|
68
|
+
virtualItems
|
|
69
|
+
} = virtualListHelpers;
|
|
70
|
+
const className = "".concat(rowSize === 'compact' ? "".concat(compactRowClass) : "".concat(normaRowClass));
|
|
71
|
+
const {
|
|
72
|
+
visibleItems
|
|
73
|
+
} = React.useContext(DnDTreeContext.DnDTreeContext);
|
|
74
|
+
return /*#__PURE__*/jsxRuntime.jsxs(TreeListWrapper, {
|
|
75
|
+
ref: virtualListRef,
|
|
76
|
+
className: className,
|
|
77
|
+
style: {
|
|
78
|
+
height: "".concat(typeof height === 'number' ? "".concat(height, "px") : height),
|
|
79
|
+
width: "".concat(typeof width === 'number' ? "".concat(width, "px") : width),
|
|
80
|
+
overflow: 'auto'
|
|
81
|
+
},
|
|
82
|
+
children: [isLoading ? /*#__PURE__*/_jsx__default["default"]("div", {
|
|
83
|
+
style: {
|
|
84
|
+
width: '100%',
|
|
85
|
+
height: '100%',
|
|
86
|
+
display: 'flex',
|
|
87
|
+
alignItems: 'center',
|
|
88
|
+
justifyContent: 'center'
|
|
89
|
+
}
|
|
90
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsCircularProgressIndicator.DSCircularProgressIndicator, {
|
|
91
|
+
size: "xl",
|
|
92
|
+
loading: isLoading,
|
|
93
|
+
showLabel: true,
|
|
94
|
+
waiting: false,
|
|
95
|
+
showTooltip: false
|
|
96
|
+
})) : null, !isLoading && virtualItems.length === 0 ? /*#__PURE__*/_jsx__default["default"](TreeListNoItems, {}, void 0, noItemsPlaceholder) : null, !isLoading && virtualItems.length !== 0 ? /*#__PURE__*/_jsx__default["default"]("div", {
|
|
97
|
+
style: {
|
|
98
|
+
height: "".concat(totalSize, "px"),
|
|
99
|
+
width: '100%',
|
|
100
|
+
position: 'relative'
|
|
101
|
+
}
|
|
102
|
+
}, void 0, virtualItems.map(virtualItem => {
|
|
103
|
+
const {
|
|
104
|
+
index,
|
|
105
|
+
measureRef,
|
|
106
|
+
start
|
|
107
|
+
} = virtualItem;
|
|
108
|
+
const item = (visibleItems || flattenedVisibleItems)[index];
|
|
109
|
+
if (!item) return null;
|
|
110
|
+
item.virtualIndex = index;
|
|
111
|
+
const {
|
|
112
|
+
id
|
|
113
|
+
} = item;
|
|
114
|
+
const style = {
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
top: "".concat(start, "px"),
|
|
117
|
+
left: 0,
|
|
118
|
+
width: '100%'
|
|
119
|
+
};
|
|
120
|
+
const listItemProps = {
|
|
121
|
+
key: "DS-TreeView-List-Item-".concat(id),
|
|
122
|
+
virtualItemRef: measureRef,
|
|
123
|
+
index,
|
|
124
|
+
// this is consumed by the DnD HOC
|
|
125
|
+
itemIndex: index,
|
|
126
|
+
item,
|
|
127
|
+
itemWrapperStyle: style
|
|
128
|
+
};
|
|
129
|
+
return /*#__PURE__*/jsxRuntime.jsx(TreeItem["default"], _objectSpread({}, listItemProps));
|
|
130
|
+
})) : null]
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const TreeList = WithConditionalDnDContext.withConditionalDnDRowContext(TreeListComp);
|
|
135
|
+
|
|
136
|
+
exports.TreeList = TreeList;
|
|
137
|
+
exports.TreeListNoItems = TreeListNoItems;
|
|
138
|
+
exports.TreeListWrapper = TreeListWrapper;
|
|
139
|
+
exports.treeListNoItemsBn = treeListNoItemsBn;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var TreeDndPlugin = require('./dnd/TreeDndPlugin.js');
|
|
6
|
+
var TreeRovingPlugin = require('./roving/TreeRovingPlugin.js');
|
|
7
|
+
var SelectablePluginTree = require('./selectable/SelectablePluginTree.js');
|
|
8
|
+
var TreeToolbarPlugin = require('./toolbar/TreeToolbarPlugin.js');
|
|
9
|
+
var TreeDataPlugin = require('./tree/TreeDataPlugin.js');
|
|
10
|
+
var TreeVirtualizationPlugin = require('./virtualization/TreeVirtualizationPlugin.js');
|
|
11
|
+
var SearchableTreePlugin = require('./searchable/SearchableTreePlugin.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.TreeDndPlugin = TreeDndPlugin.TreeDndPlugin;
|
|
16
|
+
exports.TreeRovingPlugin = TreeRovingPlugin.TreeRovingPlugin;
|
|
17
|
+
exports.SelectablePluginTree = SelectablePluginTree.SelectablePluginTree;
|
|
18
|
+
exports.TreeToolbarPlugin = TreeToolbarPlugin.TreeToolbarPlugin;
|
|
19
|
+
exports.TreePluginList = TreeDataPlugin.TreePluginList;
|
|
20
|
+
exports.TreeVirtualizationPlugin = TreeVirtualizationPlugin.TreeVirtualizationPlugin;
|
|
21
|
+
exports.SearchableTreePlugin = SearchableTreePlugin.SearchableTreePlugin;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
|
|
7
|
+
/* eslint-disable max-lines */
|
|
8
|
+
const TreeViewPropTypes = {
|
|
9
|
+
data: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.shape({
|
|
10
|
+
children: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object),
|
|
11
|
+
id: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number]),
|
|
12
|
+
isGroup: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.oneOf([undefined, null]), reactDesc.PropTypes.bool]),
|
|
13
|
+
name: reactDesc.PropTypes.string,
|
|
14
|
+
node: reactDesc.PropTypes.object
|
|
15
|
+
})).description('data to populate tree view').isRequired,
|
|
16
|
+
plugins: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.string).description('list of enabled plugins').defaultValue([]),
|
|
17
|
+
selection: reactDesc.PropTypes.object.description('pre selected items').defaultValue({}),
|
|
18
|
+
expanded: reactDesc.PropTypes.object.description('control what items are expanded').defaultValue(undefined),
|
|
19
|
+
instanceRef: reactDesc.PropTypes.shape({
|
|
20
|
+
current: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.oneOf([null, undefined]), reactDesc.PropTypes.shape({
|
|
21
|
+
actions: reactDesc.PropTypes.shape({
|
|
22
|
+
toggleExpandAll: reactDesc.PropTypes.func,
|
|
23
|
+
scrollTo: reactDesc.PropTypes.func
|
|
24
|
+
}).description('').isRequired
|
|
25
|
+
})])
|
|
26
|
+
}).description('instance ref'),
|
|
27
|
+
isItemDisabled: reactDesc.PropTypes.func.description('Function that receives an item, and returns whether that item should be disabled').defaultValue('() => false'),
|
|
28
|
+
disableIcons: reactDesc.PropTypes.bool.description('disable icons').defaultValue(false),
|
|
29
|
+
fluid: reactDesc.PropTypes.bool.description('whether is fluid or not').defaultValue(false),
|
|
30
|
+
isMultiSelect: reactDesc.PropTypes.bool.description('whether the tree view is multi select or not').defaultValue(false),
|
|
31
|
+
isSingleSelect: reactDesc.PropTypes.bool.description('wheter the tree view is single select or not').defaultValue(false),
|
|
32
|
+
isLoading: reactDesc.PropTypes.bool.description('wheter the tree should show the loading state or not').defaultValue(false),
|
|
33
|
+
getIsDropValid: reactDesc.PropTypes.func.description("Function that returns true if the drop is valid and false if it's not").defaultValue('() => true'),
|
|
34
|
+
restrictDragAndDrop: reactDesc.PropTypes.bool.description('whether to restrict DnD functionality or not').defaultValue(false),
|
|
35
|
+
showChildrenAmount: reactDesc.PropTypes.bool.description('whether to show the amount of children or not').defaultValue(false),
|
|
36
|
+
sortable: reactDesc.PropTypes.bool.description('whether the sortable functionality is active or not').defaultValue(false),
|
|
37
|
+
onItemClick: reactDesc.PropTypes.func.description('function executed when clicking on an item').defaultValue('() => {}'),
|
|
38
|
+
onItemFocus: reactDesc.PropTypes.func.description('function executed when focusing on an item').defaultValue('() => {}'),
|
|
39
|
+
onVisibleItemsChange: reactDesc.PropTypes.func.description('function executed when the visible items change').defaultValue('() => {}'),
|
|
40
|
+
onOrderChange: reactDesc.PropTypes.func.description('function executed when the items order changes').defaultValue('() => {}'),
|
|
41
|
+
onSelectionChange: reactDesc.PropTypes.func.description('function executed when the selection changes').defaultValue('() => {}'),
|
|
42
|
+
onExpandChange: reactDesc.PropTypes.func.description('function executed when expanding an item').defaultValue('() => {}'),
|
|
43
|
+
onInstanceRefInitialized: reactDesc.PropTypes.func.description('function executed when instanceRef has terminated instanciation').defaultValue('() => {}'),
|
|
44
|
+
rowSize: reactDesc.PropTypes.oneOf(['normal', 'compact']).description('size of the row').defaultValue('normal'),
|
|
45
|
+
labelOverflow: reactDesc.PropTypes.oneOf(['wrap', 'wrap-all', 'truncate']).description('label truncation preference').defaultValue('wrap'),
|
|
46
|
+
width: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.number, reactDesc.PropTypes.string]).description('components width').defaultValue('100%'),
|
|
47
|
+
height: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.number, reactDesc.PropTypes.string]).description('components height').defaultValue('100%'),
|
|
48
|
+
groupIcon: reactDesc.PropTypes.node.description('icon for groups'),
|
|
49
|
+
itemIcon: reactDesc.PropTypes.node.description('icon for items'),
|
|
50
|
+
searchQuery: reactDesc.PropTypes.string.description('search query value'),
|
|
51
|
+
noItemsPlaceholder: reactDesc.PropTypes.string.description('message to be shown when there are no items in the treeview to be displayed').defaultValue('No items found'),
|
|
52
|
+
name: reactDesc.PropTypes.string.description('property key to identifier for items labels').defaultValue('name'),
|
|
53
|
+
highlightOnlyQuery: reactDesc.PropTypes.bool.description('whether to highlight results or not').defaultValue(false)
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.TreeViewPropTypes = TreeViewPropTypes;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('react');
|
|
7
|
+
var dsForm = require('@elliemae/ds-form');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
|
+
|
|
13
|
+
function TreeViewSearchBar(props) {
|
|
14
|
+
const {
|
|
15
|
+
handleChange,
|
|
16
|
+
onNext,
|
|
17
|
+
onPrevious,
|
|
18
|
+
onClear,
|
|
19
|
+
currentResultIndex,
|
|
20
|
+
totalResults,
|
|
21
|
+
value
|
|
22
|
+
} = props;
|
|
23
|
+
return /*#__PURE__*/_jsx__default["default"](dsForm.DSNavSearchBox, {
|
|
24
|
+
onChange: v => {
|
|
25
|
+
handleChange({
|
|
26
|
+
target: {
|
|
27
|
+
value: v
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
onNext: onNext,
|
|
32
|
+
onPrevious: onPrevious,
|
|
33
|
+
onClear: onClear,
|
|
34
|
+
currentResultIndex: currentResultIndex,
|
|
35
|
+
totalResults: totalResults,
|
|
36
|
+
value: value
|
|
37
|
+
});
|
|
38
|
+
} // TreeViewSearchBar.propTypes = {
|
|
39
|
+
// value: PropTypes.string.isRequired,
|
|
40
|
+
// handleChange: PropTypes.func.isRequired,
|
|
41
|
+
// onNext: PropTypes.func.isRequired,
|
|
42
|
+
// onPrevious: PropTypes.func.isRequired,
|
|
43
|
+
// onClear: PropTypes.func.isRequired,
|
|
44
|
+
// currentResultIndex: PropTypes.number.isRequired,
|
|
45
|
+
// totalResults: PropTypes.number.isRequired,
|
|
46
|
+
// };
|
|
47
|
+
|
|
48
|
+
exports.TreeViewSearchBar = TreeViewSearchBar;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
|
|
7
|
+
// https://github.com/sindresorhus/array-move/blob/master/index.js
|
|
8
|
+
const arrayMoveMutate = (array, from, to) => {
|
|
9
|
+
const startIndex = from < 0 ? array.length + from : from;
|
|
10
|
+
|
|
11
|
+
if (startIndex >= 0 && startIndex < array.length) {
|
|
12
|
+
const endIndex = to < 0 ? array.length + to : to;
|
|
13
|
+
const [item] = array.splice(from, 1);
|
|
14
|
+
array.splice(endIndex, 0, item);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const arrayMove = (array, from, to) => {
|
|
18
|
+
const newArray = [...array];
|
|
19
|
+
arrayMoveMutate(newArray, from, to);
|
|
20
|
+
return newArray;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.arrayMove = arrayMove;
|
|
24
|
+
exports.arrayMoveMutate = arrayMoveMutate;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
/* eslint-disable max-params */
|
|
8
|
+
const updateExpandedState = (treeRoot, onExpandChange) => {
|
|
9
|
+
const shouldContinueWalking = true;
|
|
10
|
+
const newExpandedHashMap = {
|
|
11
|
+
__ds_tree_root: true
|
|
12
|
+
};
|
|
13
|
+
treeRoot.walk(node => {
|
|
14
|
+
if (!node.isRoot() && node.model.isGroup && node.model.isExpanded) {
|
|
15
|
+
newExpandedHashMap[node.model.id] = true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return shouldContinueWalking;
|
|
19
|
+
});
|
|
20
|
+
if (onExpandChange) onExpandChange(newExpandedHashMap, null);
|
|
21
|
+
};
|
|
22
|
+
const toggleItemExpand = function (itemToToggle, triggerTreeRerender, updateUserExpandedState) {
|
|
23
|
+
let scrollTo = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : () => {};
|
|
24
|
+
const {
|
|
25
|
+
node: {
|
|
26
|
+
model: {
|
|
27
|
+
isExpanded
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
virtualIndex
|
|
31
|
+
} = itemToToggle;
|
|
32
|
+
|
|
33
|
+
if (itemToToggle.node.model.isGroup) {
|
|
34
|
+
itemToToggle.node.model.isExpanded = !isExpanded;
|
|
35
|
+
triggerTreeRerender();
|
|
36
|
+
updateUserExpandedState();
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
if (typeof virtualIndex === 'number') scrollTo(virtualIndex, {
|
|
39
|
+
align: 'start'
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const expandItemModel = modelToExpand => {
|
|
45
|
+
if (modelToExpand.isGroup) modelToExpand.isExpanded = true;
|
|
46
|
+
};
|
|
47
|
+
const collapseItemModel = modelToCollapse => {
|
|
48
|
+
if (modelToCollapse.isGroup) modelToCollapse.isExpanded = false;
|
|
49
|
+
};
|
|
50
|
+
const expandAll = (treeRoot, triggerTreeRerender) => {
|
|
51
|
+
const shouldContinueWalking = true;
|
|
52
|
+
treeRoot.walk(node => {
|
|
53
|
+
if (!node.isRoot()) expandItemModel(node.model);
|
|
54
|
+
return shouldContinueWalking;
|
|
55
|
+
});
|
|
56
|
+
triggerTreeRerender();
|
|
57
|
+
};
|
|
58
|
+
const collapseAll = (treeRoot, triggerTreeRerender) => {
|
|
59
|
+
const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking
|
|
60
|
+
|
|
61
|
+
treeRoot.walk(node => {
|
|
62
|
+
if (!node.isRoot()) collapseItemModel(node.model);
|
|
63
|
+
return shouldContinueWalking;
|
|
64
|
+
});
|
|
65
|
+
triggerTreeRerender();
|
|
66
|
+
};
|
|
67
|
+
const getToggleExpandShouldExpand = treeRoot => {
|
|
68
|
+
let shouldExpand = false;
|
|
69
|
+
const shouldContinueWalking = true; // tree-model ask we return true if we want to continue walking
|
|
70
|
+
|
|
71
|
+
treeRoot.walk(node => {
|
|
72
|
+
if (!node.isRoot()) {
|
|
73
|
+
if (!node.model.isExpanded && node.model.isGroup) {
|
|
74
|
+
shouldExpand = true; // eslint-disable-next-line no-useless-return
|
|
75
|
+
|
|
76
|
+
return shouldContinueWalking;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return shouldContinueWalking;
|
|
81
|
+
});
|
|
82
|
+
return shouldExpand;
|
|
83
|
+
};
|
|
84
|
+
const toggleExpandAllHelper = (isExpand, treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState) => {
|
|
85
|
+
if (isExpand === true) expandAll(treeRoot, triggerTreeRerender);else if (isExpand === false) collapseAll(treeRoot, triggerTreeRerender);else {
|
|
86
|
+
const shouldExpand = getToggleExpandShouldExpand(treeRoot);
|
|
87
|
+
if (shouldExpand === true) expandAll(treeRoot, triggerTreeRerender);else collapseAll(treeRoot, triggerTreeRerender);
|
|
88
|
+
}
|
|
89
|
+
setLatestToggledItem(null);
|
|
90
|
+
updateUserExpandedState();
|
|
91
|
+
};
|
|
92
|
+
const useNotifyExpandedChange = (propsWithDefaults, _ref) => {
|
|
93
|
+
let {
|
|
94
|
+
latestToggledItem,
|
|
95
|
+
expandedGroups
|
|
96
|
+
} = _ref;
|
|
97
|
+
const notifyExpandedChange = React.useCallback(expandedGroupHashmap => propsWithDefaults === null || propsWithDefaults === void 0 ? void 0 : propsWithDefaults.onExpandChange(expandedGroupHashmap || {}, latestToggledItem), [propsWithDefaults, latestToggledItem]);
|
|
98
|
+
React.useEffect(() => {
|
|
99
|
+
if (!propsWithDefaults.expanded) notifyExpandedChange(expandedGroups);
|
|
100
|
+
}, [expandedGroups, notifyExpandedChange, propsWithDefaults.expanded]);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
exports.collapseAll = collapseAll;
|
|
104
|
+
exports.collapseItemModel = collapseItemModel;
|
|
105
|
+
exports.expandAll = expandAll;
|
|
106
|
+
exports.expandItemModel = expandItemModel;
|
|
107
|
+
exports.getToggleExpandShouldExpand = getToggleExpandShouldExpand;
|
|
108
|
+
exports.toggleExpandAllHelper = toggleExpandAllHelper;
|
|
109
|
+
exports.toggleItemExpand = toggleItemExpand;
|
|
110
|
+
exports.updateExpandedState = updateExpandedState;
|
|
111
|
+
exports.useNotifyExpandedChange = useNotifyExpandedChange;
|