@elliemae/ds-treeview 1.60.0 → 2.0.0-alpha.12
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 +91 -161
- package/cjs/TreeViewContext.js +23 -26
- package/cjs/config/cssClassesConstants.js +4 -5
- package/cjs/deprecated/TreeView.js +39 -50
- package/cjs/deprecated/__testUtils__/utils.js +47 -46
- package/cjs/deprecated/index.js +21 -49
- package/cjs/deprecated/plugins/dnd/TreeDndPlugin.js +57 -67
- package/cjs/deprecated/plugins/dnd/index.js +2 -19
- package/cjs/deprecated/plugins/dnd/renderers/DraggableItem.js +55 -49
- package/cjs/deprecated/plugins/dnd/renderers/DroppableList.js +162 -150
- package/cjs/deprecated/plugins/dnd/utils.js +64 -56
- package/cjs/deprecated/plugins/index.js +14 -44
- package/cjs/deprecated/plugins/roving/TreeRovingPlugin.js +49 -56
- package/cjs/deprecated/plugins/roving/index.js +2 -12
- package/cjs/deprecated/plugins/searchable/SearchableTreePlugin.js +46 -35
- package/cjs/deprecated/plugins/searchable/index.js +2 -7
- package/cjs/deprecated/plugins/searchable/utils.js +1 -2
- package/cjs/deprecated/plugins/selectable/SelectablePluginTree.js +126 -120
- package/cjs/deprecated/plugins/selectable/helper.js +0 -1
- package/cjs/deprecated/plugins/selectable/index.js +2 -14
- package/cjs/deprecated/plugins/selectable/utils.js +2 -3
- package/cjs/deprecated/plugins/toolbar/TreeToolbarPlugin.js +63 -53
- package/cjs/deprecated/plugins/toolbar/index.js +2 -13
- package/cjs/deprecated/plugins/tree/TreeDataPlugin.js +163 -137
- package/cjs/deprecated/plugins/tree/index.js +2 -18
- package/cjs/deprecated/plugins/tree/useExpandTreeState.js +67 -73
- package/cjs/deprecated/plugins/tree/utils.js +22 -30
- package/cjs/deprecated/plugins/tree/walkTreeStrategy.js +21 -30
- package/cjs/deprecated/plugins/virtualization/TreeVirtualizationPlugin.js +124 -109
- package/cjs/deprecated/plugins/virtualization/index.js +2 -12
- package/cjs/deprecated/renderers.js +41 -23
- package/cjs/index.js +19 -93
- package/cjs/parts/CheckboxSelectable.js +42 -36
- package/cjs/parts/ChildrenCountDisplayer.js +15 -16
- package/cjs/parts/ExpandCaret.js +42 -38
- package/cjs/parts/Icon.js +14 -10
- package/cjs/parts/NestingSpace.js +26 -20
- package/cjs/parts/RadioSelectable.js +34 -34
- package/cjs/parts/TreeItem.js +123 -133
- package/cjs/parts/TreeItemText.js +68 -57
- package/cjs/parts/TreeList.js +107 -109
- package/cjs/plugins/dnd/TreeDndPlugin.js +20 -54
- package/cjs/plugins/dnd/index.js +3 -43
- package/cjs/plugins/index.js +15 -55
- package/cjs/plugins/roving/TreeRovingPlugin.js +1 -2
- package/cjs/plugins/roving/index.js +2 -3
- package/cjs/plugins/searchable/SearchableTreePlugin.js +1 -2
- package/cjs/plugins/searchable/index.js +2 -3
- package/cjs/plugins/selectable/SelectablePluginTree.js +1 -2
- package/cjs/plugins/selectable/index.js +2 -3
- package/cjs/plugins/toolbar/TreeToolbarPlugin.js +1 -2
- package/cjs/plugins/toolbar/index.js +2 -3
- package/cjs/plugins/tree/TreeDataPlugin.js +1 -2
- package/cjs/plugins/tree/index.js +2 -3
- package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js +1 -2
- package/cjs/plugins/virtualization/index.js +2 -3
- package/cjs/prop-types.js +25 -26
- package/cjs/react-desc-prop-types.js +4 -5
- package/cjs/related-components/TreeViewSearchBar.js +14 -24
- package/cjs/utils/array-helpers.js +7 -19
- package/cjs/utils/dnd-helpers.js +64 -51
- package/cjs/utils/group-expands-helpers.js +29 -24
- package/cjs/utils/keyboard-helpers.js +80 -75
- package/cjs/utils/object-helpers.js +13 -18
- package/cjs/utils/refs-helpers.js +10 -5
- package/cjs/utils/selectable-helper.js +39 -28
- package/cjs/utils/string-helpers.js +1 -4
- package/cjs/utils/tree-helpers.js +68 -71
- package/cjs/utils/useDnDHelpers.js +128 -114
- package/cjs/utils/useInstanceRefActions.js +40 -50
- package/cjs/utils/useTree.js +40 -57
- package/esm/TreeView.js +81 -150
- package/esm/TreeViewContext.js +22 -25
- package/esm/config/cssClassesConstants.js +4 -5
- package/esm/deprecated/TreeView.js +31 -40
- package/esm/deprecated/__testUtils__/utils.js +43 -40
- package/esm/deprecated/index.js +6 -32
- package/esm/deprecated/plugins/dnd/TreeDndPlugin.js +47 -56
- package/esm/deprecated/plugins/dnd/index.js +0 -17
- package/esm/deprecated/plugins/dnd/renderers/DraggableItem.js +50 -43
- package/esm/deprecated/plugins/dnd/renderers/DroppableList.js +160 -147
- package/esm/deprecated/plugins/dnd/utils.js +63 -54
- package/esm/deprecated/plugins/index.js +0 -30
- package/esm/deprecated/plugins/roving/TreeRovingPlugin.js +48 -53
- package/esm/deprecated/plugins/roving/index.js +0 -10
- package/esm/deprecated/plugins/searchable/SearchableTreePlugin.js +45 -34
- package/esm/deprecated/plugins/searchable/index.js +0 -5
- package/esm/deprecated/plugins/searchable/utils.js +1 -2
- package/esm/deprecated/plugins/selectable/SelectablePluginTree.js +121 -113
- package/esm/deprecated/plugins/selectable/helper.js +0 -1
- package/esm/deprecated/plugins/selectable/index.js +0 -12
- package/esm/deprecated/plugins/selectable/utils.js +2 -3
- package/esm/deprecated/plugins/toolbar/TreeToolbarPlugin.js +58 -47
- package/esm/deprecated/plugins/toolbar/index.js +0 -11
- package/esm/deprecated/plugins/tree/TreeDataPlugin.js +150 -124
- package/esm/deprecated/plugins/tree/index.js +0 -16
- package/esm/deprecated/plugins/tree/useExpandTreeState.js +64 -69
- package/esm/deprecated/plugins/tree/utils.js +16 -24
- package/esm/deprecated/plugins/tree/walkTreeStrategy.js +21 -26
- package/esm/deprecated/plugins/virtualization/TreeVirtualizationPlugin.js +121 -107
- package/esm/deprecated/plugins/virtualization/index.js +0 -10
- package/esm/deprecated/renderers.js +39 -21
- package/esm/index.js +2 -75
- package/esm/parts/CheckboxSelectable.js +39 -33
- package/esm/parts/ChildrenCountDisplayer.js +13 -14
- package/esm/parts/ExpandCaret.js +39 -35
- package/esm/parts/Icon.js +13 -9
- package/esm/parts/NestingSpace.js +24 -18
- package/esm/parts/RadioSelectable.js +34 -32
- package/esm/parts/TreeItem.js +108 -117
- package/esm/parts/TreeItemText.js +65 -53
- package/esm/parts/TreeList.js +104 -105
- package/esm/plugins/dnd/TreeDndPlugin.js +16 -50
- package/esm/plugins/dnd/index.js +0 -40
- package/esm/plugins/index.js +0 -40
- package/esm/plugins/roving/TreeRovingPlugin.js +1 -2
- package/esm/plugins/roving/index.js +0 -1
- package/esm/plugins/searchable/SearchableTreePlugin.js +1 -2
- package/esm/plugins/searchable/index.js +0 -1
- package/esm/plugins/selectable/SelectablePluginTree.js +1 -2
- package/esm/plugins/selectable/index.js +0 -1
- package/esm/plugins/toolbar/TreeToolbarPlugin.js +1 -2
- package/esm/plugins/toolbar/index.js +0 -1
- package/esm/plugins/tree/TreeDataPlugin.js +1 -2
- package/esm/plugins/tree/index.js +0 -1
- package/esm/plugins/virtualization/TreeVirtualizationPlugin.js +1 -2
- package/esm/plugins/virtualization/index.js +0 -1
- package/esm/prop-types.js +8 -9
- package/esm/react-desc-prop-types.js +4 -5
- package/esm/related-components/TreeViewSearchBar.js +13 -22
- package/esm/utils/array-helpers.js +7 -14
- package/esm/utils/dnd-helpers.js +62 -49
- package/esm/utils/group-expands-helpers.js +29 -24
- package/esm/utils/keyboard-helpers.js +73 -68
- package/esm/utils/object-helpers.js +13 -14
- package/esm/utils/refs-helpers.js +10 -5
- package/esm/utils/selectable-helper.js +37 -26
- package/esm/utils/string-helpers.js +1 -4
- package/esm/utils/tree-helpers.js +66 -65
- package/esm/utils/useDnDHelpers.js +125 -107
- package/esm/utils/useInstanceRefActions.js +35 -41
- package/esm/utils/useTree.js +37 -53
- package/package.json +319 -30
- package/types/TreeView.d.ts +157 -0
- package/types/TreeViewContext.d.ts +119 -0
- package/types/config/cssClassesConstants.d.ts +4 -0
- package/types/deprecated/TreeView.d.ts +8 -0
- package/types/deprecated/__testUtils__/utils.d.ts +72 -0
- package/types/deprecated/index.d.ts +2 -0
- package/types/deprecated/plugins/dnd/TreeDndPlugin.d.ts +1 -0
- package/types/deprecated/plugins/dnd/index.d.ts +1 -0
- package/types/deprecated/plugins/dnd/renderers/DraggableItem.d.ts +3 -0
- package/types/deprecated/plugins/dnd/renderers/DroppableList.d.ts +6 -0
- package/types/deprecated/plugins/dnd/tests/TreeDndPlugin.test.d.ts +0 -0
- package/types/deprecated/plugins/dnd/utils.d.ts +28 -0
- package/types/deprecated/plugins/index.d.ts +7 -0
- package/types/deprecated/plugins/roving/TreeRovingPlugin.d.ts +1 -0
- package/types/deprecated/plugins/roving/index.d.ts +1 -0
- package/types/deprecated/plugins/searchable/SearchableTreePlugin.d.ts +1 -0
- package/types/deprecated/plugins/searchable/index.d.ts +1 -0
- package/types/deprecated/plugins/searchable/utils.d.ts +1 -0
- package/types/deprecated/plugins/selectable/SelectablePluginTree.d.ts +1 -0
- package/types/deprecated/plugins/selectable/helper.d.ts +0 -0
- package/types/deprecated/plugins/selectable/index.d.ts +1 -0
- package/types/deprecated/plugins/selectable/tests/SelectablePluginTree.test.d.ts +1 -0
- package/types/deprecated/plugins/selectable/utils.d.ts +1 -0
- package/types/deprecated/plugins/toolbar/TreeToolbarPlugin.d.ts +1 -0
- package/types/deprecated/plugins/toolbar/index.d.ts +1 -0
- package/types/deprecated/plugins/tree/TreeDataPlugin.d.ts +1 -0
- package/types/deprecated/plugins/tree/index.d.ts +1 -0
- package/types/deprecated/plugins/tree/tests/TreeDataPlugin.test.d.ts +1 -0
- package/types/deprecated/plugins/tree/useExpandTreeState.d.ts +14 -0
- package/types/deprecated/plugins/tree/utils.d.ts +8 -0
- package/types/deprecated/plugins/tree/walkTreeStrategy.d.ts +9 -0
- package/types/deprecated/plugins/virtualization/TreeVirtualizationPlugin.d.ts +1 -0
- package/types/deprecated/plugins/virtualization/index.d.ts +1 -0
- package/types/deprecated/renderers.d.ts +19 -0
- package/types/index.d.ts +4 -0
- package/types/parts/CheckboxSelectable.d.ts +9 -0
- package/types/parts/ChildrenCountDisplayer.d.ts +7 -0
- package/types/parts/ExpandCaret.d.ts +7 -0
- package/types/parts/Icon.d.ts +5 -0
- package/types/parts/NestingSpace.d.ts +13 -0
- package/types/parts/RadioSelectable.d.ts +9 -0
- package/types/parts/TreeItem.d.ts +16 -0
- package/types/parts/TreeItemText.d.ts +7 -0
- package/types/parts/TreeList.d.ts +11 -0
- package/types/plugins/dnd/TreeDndPlugin.d.ts +3 -0
- package/types/plugins/dnd/index.d.ts +1 -0
- package/types/plugins/index.d.ts +7 -0
- package/types/plugins/roving/TreeRovingPlugin.d.ts +1 -0
- package/types/plugins/roving/index.d.ts +1 -0
- package/types/plugins/searchable/SearchableTreePlugin.d.ts +1 -0
- package/types/plugins/searchable/index.d.ts +1 -0
- package/types/plugins/selectable/SelectablePluginTree.d.ts +1 -0
- package/types/plugins/selectable/index.d.ts +1 -0
- package/types/plugins/toolbar/TreeToolbarPlugin.d.ts +1 -0
- package/types/plugins/toolbar/index.d.ts +1 -0
- package/types/plugins/tree/TreeDataPlugin.d.ts +1 -0
- package/types/plugins/tree/index.d.ts +1 -0
- package/types/plugins/virtualization/TreeVirtualizationPlugin.d.ts +1 -0
- package/types/plugins/virtualization/index.d.ts +1 -0
- package/types/prop-types.d.ts +26 -0
- package/types/react-desc-prop-types.d.ts +115 -0
- package/types/related-components/TreeViewSearchBar.d.ts +13 -0
- package/types/utils/array-helpers.d.ts +2 -0
- package/types/utils/dnd-helpers.d.ts +38 -0
- package/types/utils/group-expands-helpers.d.ts +11 -0
- package/types/utils/keyboard-helpers.d.ts +3 -0
- package/types/utils/object-helpers.d.ts +2 -0
- package/types/utils/refs-helpers.d.ts +1 -0
- package/types/utils/selectable-helper.d.ts +3 -0
- package/types/utils/string-helpers.d.ts +1 -0
- package/types/utils/tree-helpers.d.ts +11 -0
- package/types/utils/useDnDHelpers.d.ts +6 -0
- package/types/utils/useInstanceRefActions.d.ts +3 -0
- package/types/utils/useTree.d.ts +12 -0
- package/TreeView/package.json +0 -10
- package/TreeViewContext/package.json +0 -10
- package/cjs/TreeView.js.map +0 -1
- package/cjs/TreeViewContext.js.map +0 -1
- package/cjs/config/cssClassesConstants.js.map +0 -1
- package/cjs/deprecated/TreeView.js.map +0 -1
- package/cjs/deprecated/__testUtils__/utils.js.map +0 -1
- package/cjs/deprecated/index.js.map +0 -1
- package/cjs/deprecated/plugins/dnd/TreeDndPlugin.js.map +0 -1
- package/cjs/deprecated/plugins/dnd/index.js.map +0 -1
- package/cjs/deprecated/plugins/dnd/renderers/DraggableItem.js.map +0 -1
- package/cjs/deprecated/plugins/dnd/renderers/DroppableList.js.map +0 -1
- package/cjs/deprecated/plugins/dnd/utils.js.map +0 -1
- package/cjs/deprecated/plugins/index.js.map +0 -1
- package/cjs/deprecated/plugins/roving/TreeRovingPlugin.js.map +0 -1
- package/cjs/deprecated/plugins/roving/index.js.map +0 -1
- package/cjs/deprecated/plugins/searchable/SearchableTreePlugin.js.map +0 -1
- package/cjs/deprecated/plugins/searchable/index.js.map +0 -1
- package/cjs/deprecated/plugins/searchable/utils.js.map +0 -1
- package/cjs/deprecated/plugins/selectable/SelectablePluginTree.js.map +0 -1
- package/cjs/deprecated/plugins/selectable/helper.js.map +0 -1
- package/cjs/deprecated/plugins/selectable/index.js.map +0 -1
- package/cjs/deprecated/plugins/selectable/utils.js.map +0 -1
- package/cjs/deprecated/plugins/toolbar/TreeToolbarPlugin.js.map +0 -1
- package/cjs/deprecated/plugins/toolbar/index.js.map +0 -1
- package/cjs/deprecated/plugins/tree/TreeDataPlugin.js.map +0 -1
- package/cjs/deprecated/plugins/tree/index.js.map +0 -1
- package/cjs/deprecated/plugins/tree/useExpandTreeState.js.map +0 -1
- package/cjs/deprecated/plugins/tree/utils.js.map +0 -1
- package/cjs/deprecated/plugins/tree/walkTreeStrategy.js.map +0 -1
- package/cjs/deprecated/plugins/virtualization/TreeVirtualizationPlugin.js.map +0 -1
- package/cjs/deprecated/plugins/virtualization/index.js.map +0 -1
- package/cjs/deprecated/renderers.js.map +0 -1
- package/cjs/index-72490bed.js +0 -31
- package/cjs/index-72490bed.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/parts/CheckboxSelectable.js.map +0 -1
- package/cjs/parts/ChildrenCountDisplayer.js.map +0 -1
- package/cjs/parts/ExpandCaret.js.map +0 -1
- package/cjs/parts/Icon.js.map +0 -1
- package/cjs/parts/NestingSpace.js.map +0 -1
- package/cjs/parts/RadioSelectable.js.map +0 -1
- package/cjs/parts/TreeItem.js.map +0 -1
- package/cjs/parts/TreeItemText.js.map +0 -1
- package/cjs/parts/TreeList.js.map +0 -1
- package/cjs/plugins/dnd/TreeDndPlugin.js.map +0 -1
- package/cjs/plugins/dnd/index.js.map +0 -1
- package/cjs/plugins/index.js.map +0 -1
- package/cjs/plugins/roving/TreeRovingPlugin.js.map +0 -1
- package/cjs/plugins/roving/index.js.map +0 -1
- package/cjs/plugins/searchable/SearchableTreePlugin.js.map +0 -1
- package/cjs/plugins/searchable/index.js.map +0 -1
- package/cjs/plugins/selectable/SelectablePluginTree.js.map +0 -1
- package/cjs/plugins/selectable/index.js.map +0 -1
- package/cjs/plugins/toolbar/TreeToolbarPlugin.js.map +0 -1
- package/cjs/plugins/toolbar/index.js.map +0 -1
- package/cjs/plugins/tree/TreeDataPlugin.js.map +0 -1
- package/cjs/plugins/tree/index.js.map +0 -1
- package/cjs/plugins/virtualization/TreeVirtualizationPlugin.js.map +0 -1
- package/cjs/plugins/virtualization/index.js.map +0 -1
- package/cjs/prop-types.js.map +0 -1
- package/cjs/react-desc-prop-types.js.map +0 -1
- package/cjs/related-components/TreeViewSearchBar.js.map +0 -1
- package/cjs/utils/array-helpers.js.map +0 -1
- package/cjs/utils/dnd-helpers.js.map +0 -1
- package/cjs/utils/group-expands-helpers.js.map +0 -1
- package/cjs/utils/keyboard-helpers.js.map +0 -1
- package/cjs/utils/object-helpers.js.map +0 -1
- package/cjs/utils/refs-helpers.js.map +0 -1
- package/cjs/utils/selectable-helper.js.map +0 -1
- package/cjs/utils/string-helpers.js.map +0 -1
- package/cjs/utils/tree-helpers.js.map +0 -1
- package/cjs/utils/useDnDHelpers.js.map +0 -1
- package/cjs/utils/useInstanceRefActions.js.map +0 -1
- package/cjs/utils/useTree.js.map +0 -1
- package/config/cssClassesConstants/package.json +0 -10
- package/deprecated/TreeView/package.json +0 -10
- package/deprecated/__testUtils__/utils/package.json +0 -10
- package/deprecated/package.json +0 -10
- package/deprecated/plugins/dnd/TreeDndPlugin/package.json +0 -10
- package/deprecated/plugins/dnd/package.json +0 -10
- package/deprecated/plugins/dnd/renderers/DraggableItem/package.json +0 -10
- package/deprecated/plugins/dnd/renderers/DroppableList/package.json +0 -10
- package/deprecated/plugins/dnd/utils/package.json +0 -10
- package/deprecated/plugins/package.json +0 -10
- package/deprecated/plugins/roving/TreeRovingPlugin/package.json +0 -10
- package/deprecated/plugins/roving/package.json +0 -10
- package/deprecated/plugins/searchable/SearchableTreePlugin/package.json +0 -10
- package/deprecated/plugins/searchable/package.json +0 -10
- package/deprecated/plugins/searchable/utils/package.json +0 -10
- package/deprecated/plugins/selectable/SelectablePluginTree/package.json +0 -10
- package/deprecated/plugins/selectable/helper/package.json +0 -10
- package/deprecated/plugins/selectable/package.json +0 -10
- package/deprecated/plugins/selectable/utils/package.json +0 -10
- package/deprecated/plugins/toolbar/TreeToolbarPlugin/package.json +0 -10
- package/deprecated/plugins/toolbar/package.json +0 -10
- package/deprecated/plugins/tree/TreeDataPlugin/package.json +0 -10
- package/deprecated/plugins/tree/package.json +0 -10
- package/deprecated/plugins/tree/useExpandTreeState/package.json +0 -10
- package/deprecated/plugins/tree/utils/package.json +0 -10
- package/deprecated/plugins/tree/walkTreeStrategy/package.json +0 -10
- package/deprecated/plugins/virtualization/TreeVirtualizationPlugin/package.json +0 -10
- package/deprecated/plugins/virtualization/package.json +0 -10
- package/deprecated/renderers/package.json +0 -10
- package/esm/TreeView.js.map +0 -1
- package/esm/TreeViewContext.js.map +0 -1
- package/esm/config/cssClassesConstants.js.map +0 -1
- package/esm/deprecated/TreeView.js.map +0 -1
- package/esm/deprecated/__testUtils__/utils.js.map +0 -1
- package/esm/deprecated/index.js.map +0 -1
- package/esm/deprecated/plugins/dnd/TreeDndPlugin.js.map +0 -1
- package/esm/deprecated/plugins/dnd/index.js.map +0 -1
- package/esm/deprecated/plugins/dnd/renderers/DraggableItem.js.map +0 -1
- package/esm/deprecated/plugins/dnd/renderers/DroppableList.js.map +0 -1
- package/esm/deprecated/plugins/dnd/utils.js.map +0 -1
- package/esm/deprecated/plugins/index.js.map +0 -1
- package/esm/deprecated/plugins/roving/TreeRovingPlugin.js.map +0 -1
- package/esm/deprecated/plugins/roving/index.js.map +0 -1
- package/esm/deprecated/plugins/searchable/SearchableTreePlugin.js.map +0 -1
- package/esm/deprecated/plugins/searchable/index.js.map +0 -1
- package/esm/deprecated/plugins/searchable/utils.js.map +0 -1
- package/esm/deprecated/plugins/selectable/SelectablePluginTree.js.map +0 -1
- package/esm/deprecated/plugins/selectable/helper.js.map +0 -1
- package/esm/deprecated/plugins/selectable/index.js.map +0 -1
- package/esm/deprecated/plugins/selectable/utils.js.map +0 -1
- package/esm/deprecated/plugins/toolbar/TreeToolbarPlugin.js.map +0 -1
- package/esm/deprecated/plugins/toolbar/index.js.map +0 -1
- package/esm/deprecated/plugins/tree/TreeDataPlugin.js.map +0 -1
- package/esm/deprecated/plugins/tree/index.js.map +0 -1
- package/esm/deprecated/plugins/tree/useExpandTreeState.js.map +0 -1
- package/esm/deprecated/plugins/tree/utils.js.map +0 -1
- package/esm/deprecated/plugins/tree/walkTreeStrategy.js.map +0 -1
- package/esm/deprecated/plugins/virtualization/TreeVirtualizationPlugin.js.map +0 -1
- package/esm/deprecated/plugins/virtualization/index.js.map +0 -1
- package/esm/deprecated/renderers.js.map +0 -1
- package/esm/index-6009bfe6.js +0 -29
- package/esm/index-6009bfe6.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/parts/CheckboxSelectable.js.map +0 -1
- package/esm/parts/ChildrenCountDisplayer.js.map +0 -1
- package/esm/parts/ExpandCaret.js.map +0 -1
- package/esm/parts/Icon.js.map +0 -1
- package/esm/parts/NestingSpace.js.map +0 -1
- package/esm/parts/RadioSelectable.js.map +0 -1
- package/esm/parts/TreeItem.js.map +0 -1
- package/esm/parts/TreeItemText.js.map +0 -1
- package/esm/parts/TreeList.js.map +0 -1
- package/esm/plugins/dnd/TreeDndPlugin.js.map +0 -1
- package/esm/plugins/dnd/index.js.map +0 -1
- package/esm/plugins/index.js.map +0 -1
- package/esm/plugins/roving/TreeRovingPlugin.js.map +0 -1
- package/esm/plugins/roving/index.js.map +0 -1
- package/esm/plugins/searchable/SearchableTreePlugin.js.map +0 -1
- package/esm/plugins/searchable/index.js.map +0 -1
- package/esm/plugins/selectable/SelectablePluginTree.js.map +0 -1
- package/esm/plugins/selectable/index.js.map +0 -1
- package/esm/plugins/toolbar/TreeToolbarPlugin.js.map +0 -1
- package/esm/plugins/toolbar/index.js.map +0 -1
- package/esm/plugins/tree/TreeDataPlugin.js.map +0 -1
- package/esm/plugins/tree/index.js.map +0 -1
- package/esm/plugins/virtualization/TreeVirtualizationPlugin.js.map +0 -1
- package/esm/plugins/virtualization/index.js.map +0 -1
- package/esm/prop-types.js.map +0 -1
- package/esm/react-desc-prop-types.js.map +0 -1
- package/esm/related-components/TreeViewSearchBar.js.map +0 -1
- package/esm/utils/array-helpers.js.map +0 -1
- package/esm/utils/dnd-helpers.js.map +0 -1
- package/esm/utils/group-expands-helpers.js.map +0 -1
- package/esm/utils/keyboard-helpers.js.map +0 -1
- package/esm/utils/object-helpers.js.map +0 -1
- package/esm/utils/refs-helpers.js.map +0 -1
- package/esm/utils/selectable-helper.js.map +0 -1
- package/esm/utils/string-helpers.js.map +0 -1
- package/esm/utils/tree-helpers.js.map +0 -1
- package/esm/utils/useDnDHelpers.js.map +0 -1
- package/esm/utils/useInstanceRefActions.js.map +0 -1
- package/esm/utils/useTree.js.map +0 -1
- package/parts/CheckboxSelectable/package.json +0 -10
- package/parts/ChildrenCountDisplayer/package.json +0 -10
- package/parts/ExpandCaret/package.json +0 -10
- package/parts/Icon/package.json +0 -10
- package/parts/NestingSpace/package.json +0 -10
- package/parts/RadioSelectable/package.json +0 -10
- package/parts/TreeItem/package.json +0 -10
- package/parts/TreeItemText/package.json +0 -10
- package/parts/TreeList/package.json +0 -10
- package/plugins/dnd/TreeDndPlugin/package.json +0 -10
- package/plugins/dnd/package.json +0 -10
- package/plugins/package.json +0 -10
- package/plugins/roving/TreeRovingPlugin/package.json +0 -10
- package/plugins/roving/package.json +0 -10
- package/plugins/searchable/SearchableTreePlugin/package.json +0 -10
- package/plugins/searchable/package.json +0 -10
- package/plugins/selectable/SelectablePluginTree/package.json +0 -10
- package/plugins/selectable/package.json +0 -10
- package/plugins/toolbar/TreeToolbarPlugin/package.json +0 -10
- package/plugins/toolbar/package.json +0 -10
- package/plugins/tree/TreeDataPlugin/package.json +0 -10
- package/plugins/tree/package.json +0 -10
- package/plugins/virtualization/TreeVirtualizationPlugin/package.json +0 -10
- package/plugins/virtualization/package.json +0 -10
- package/prop-types/package.json +0 -10
- package/react-desc-prop-types/package.json +0 -10
- package/related-components/TreeViewSearchBar/package.json +0 -10
- package/utils/array-helpers/package.json +0 -10
- package/utils/dnd-helpers/package.json +0 -10
- package/utils/group-expands-helpers/package.json +0 -10
- package/utils/keyboard-helpers/package.json +0 -10
- package/utils/object-helpers/package.json +0 -10
- package/utils/refs-helpers/package.json +0 -10
- package/utils/selectable-helper/package.json +0 -10
- package/utils/string-helpers/package.json +0 -10
- package/utils/tree-helpers/package.json +0 -10
- package/utils/useDnDHelpers/package.json +0 -10
- package/utils/useInstanceRefActions/package.json +0 -10
- package/utils/useTree/package.json +0 -10
|
@@ -1,13 +1 @@
|
|
|
1
1
|
export { SelectablePluginTree } from './SelectablePluginTree.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
3
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '@elliemae/ds-form';
|
|
7
|
-
import '@elliemae/ds-utilities';
|
|
8
|
-
import '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
9
|
-
import '../tree/walkTreeStrategy.js';
|
|
10
|
-
import '../tree/utils.js';
|
|
11
|
-
import 'lodash/get';
|
|
12
|
-
import './utils.js';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const checkParentState = (nextSelectedChildrenAmount, parentChildrenLength, checked) => {
|
|
2
|
+
let parentState = false;
|
|
3
3
|
|
|
4
4
|
if (nextSelectedChildrenAmount === parentChildrenLength) {
|
|
5
5
|
parentState = true;
|
|
@@ -13,4 +13,3 @@ var checkParentState = function checkParentState(nextSelectedChildrenAmount, par
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export { checkParentState };
|
|
16
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1,39 +1,46 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
2
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import
|
|
9
|
+
import { useMemo, useContext, useRef } from 'react';
|
|
5
10
|
import { MoreOptionsVert } from '@elliemae/ds-icons';
|
|
6
11
|
import Button from '@elliemae/ds-button';
|
|
7
12
|
import { runAll } from '@elliemae/ds-utilities';
|
|
8
13
|
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
9
14
|
import ToolbarProvider, { ToolbarContext } from '@elliemae/ds-shared/toolbar/ToolbarProvider';
|
|
10
15
|
import FocusGroupContext from '@elliemae/ds-shared/FocusGroup/FocusGroupContext';
|
|
16
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
const _excluded = ["onMouseEnter", "onMouseLeave", "extraParams", "renderToolbar", "isItemFocused", "icon", "rowSize"];
|
|
13
19
|
|
|
14
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
21
|
|
|
16
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
const ToolbarDisclosure = props => {
|
|
25
|
+
const {
|
|
26
|
+
onMouseEnter,
|
|
27
|
+
onMouseLeave,
|
|
28
|
+
extraParams,
|
|
29
|
+
renderToolbar,
|
|
30
|
+
isItemFocused,
|
|
31
|
+
icon = /*#__PURE__*/_jsx(MoreOptionsVert, {
|
|
32
|
+
color: ['brand-primary', 800]
|
|
33
|
+
}),
|
|
34
|
+
rowSize
|
|
35
|
+
} = props,
|
|
36
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
30
37
|
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
const toolbarContext = useContext(ToolbarContext);
|
|
39
|
+
const ref = useRef(null);
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
const show = () => {
|
|
35
42
|
if (ref.current) {
|
|
36
|
-
|
|
43
|
+
const toolbar = renderToolbar(_objectSpread(_objectSpread({
|
|
37
44
|
onCloseToolbar: toolbarContext.hide
|
|
38
45
|
}, extraParams), {}, {
|
|
39
46
|
size: rowSize
|
|
@@ -45,11 +52,11 @@ var ToolbarDisclosure = function ToolbarDisclosure(props) {
|
|
|
45
52
|
}
|
|
46
53
|
};
|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
const hide = e => {
|
|
49
56
|
toolbarContext.hide(e);
|
|
50
57
|
};
|
|
51
58
|
|
|
52
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({}, rest), {}, {
|
|
53
60
|
buttonType: "text",
|
|
54
61
|
className: "toolbar-trigger",
|
|
55
62
|
icon: icon,
|
|
@@ -61,43 +68,47 @@ var ToolbarDisclosure = function ToolbarDisclosure(props) {
|
|
|
61
68
|
}));
|
|
62
69
|
};
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
onShowToolbar
|
|
68
|
-
onCloseToolbar
|
|
69
|
-
renderToolbar
|
|
70
|
-
rowSize
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
const TriggerFormatter = (value, extraParams, instance) => {
|
|
72
|
+
const {
|
|
73
|
+
props: {
|
|
74
|
+
onShowToolbar,
|
|
75
|
+
onCloseToolbar,
|
|
76
|
+
renderToolbar,
|
|
77
|
+
rowSize
|
|
78
|
+
}
|
|
79
|
+
} = instance.getInstance();
|
|
80
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
81
|
+
children: [value, /*#__PURE__*/_jsx(ToolbarDisclosure, {
|
|
82
|
+
isItemFocused: extraParams.isItemFocused,
|
|
83
|
+
onClose: onCloseToolbar,
|
|
84
|
+
onShow: onShowToolbar,
|
|
85
|
+
renderToolbar: renderToolbar,
|
|
86
|
+
rowSize: rowSize
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
79
89
|
};
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
const TreeToolbarPlugin = createInstancePlugin('tree-toolbar', {
|
|
82
92
|
itemRenderer: TriggerFormatter,
|
|
83
|
-
renderers: function renderers(_renderers) {
|
|
84
|
-
var List = useMemo(function () {
|
|
85
|
-
var Component = _renderers.list; // eslint-disable-next-line react/display-name
|
|
86
93
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
renderers(renderers) {
|
|
95
|
+
const List = useMemo(() => {
|
|
96
|
+
const Component = renderers.list; // eslint-disable-next-line react/display-name
|
|
97
|
+
|
|
98
|
+
return props => {
|
|
99
|
+
const focusContext = useContext(FocusGroupContext);
|
|
100
|
+
return /*#__PURE__*/_jsx(ToolbarProvider, {
|
|
101
|
+
onHide: (state, e) => {
|
|
91
102
|
if (e && e.type === 'keydown' && focusContext) focusContext.focus();
|
|
92
103
|
}
|
|
93
|
-
}, /*#__PURE__*/
|
|
104
|
+
}, void 0, /*#__PURE__*/jsx(Component, _objectSpread({}, props)));
|
|
94
105
|
};
|
|
95
106
|
}, []);
|
|
96
|
-
return _objectSpread(_objectSpread({},
|
|
107
|
+
return _objectSpread(_objectSpread({}, renderers), {}, {
|
|
97
108
|
list: List
|
|
98
109
|
});
|
|
99
110
|
}
|
|
111
|
+
|
|
100
112
|
});
|
|
101
113
|
|
|
102
114
|
export { TreeToolbarPlugin };
|
|
103
|
-
//# sourceMappingURL=TreeToolbarPlugin.js.map
|
|
@@ -1,12 +1 @@
|
|
|
1
1
|
export { TreeToolbarPlugin } from './TreeToolbarPlugin.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
3
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '@elliemae/ds-icons';
|
|
7
|
-
import '@elliemae/ds-button';
|
|
8
|
-
import '@elliemae/ds-utilities';
|
|
9
|
-
import '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
10
|
-
import '@elliemae/ds-shared/toolbar/ToolbarProvider';
|
|
11
|
-
import '@elliemae/ds-shared/FocusGroup/FocusGroupContext';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
5
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.some.js';
|
|
10
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
11
|
+
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
12
|
+
import 'core-js/modules/esnext.iterator.find.js';
|
|
3
13
|
import React, { useCallback } from 'react';
|
|
4
14
|
import { cx, isFunction } from '@elliemae/ds-utilities';
|
|
5
15
|
import Button from '@elliemae/ds-button';
|
|
@@ -10,107 +20,109 @@ import { walkTreeStrategy } from './walkTreeStrategy.js';
|
|
|
10
20
|
import { getParentId, getItemChildrenLength, findItemOnDocument, getListFromDocument } from './utils.js';
|
|
11
21
|
import { treeItemBlockName } from '../../renderers.js';
|
|
12
22
|
import { useExpandTreeState } from './useExpandTreeState.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
23
|
+
|
|
24
|
+
var _ArrowheadDown, _ArrowheadRight;
|
|
16
25
|
|
|
17
26
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
18
27
|
|
|
19
28
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
const ItemContent = aggregatedClasses('div')("".concat(treeItemBlockName, "-content"));
|
|
30
|
+
const ItemValue = aggregatedClasses('span')(treeItemBlockName, 'value');
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
return null;
|
|
25
|
-
};
|
|
32
|
+
const noop = () => null;
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
const getItemNestingLeftPadding = (level, opts) => {
|
|
35
|
+
const {
|
|
36
|
+
spaceForNestingLevel,
|
|
37
|
+
isChild
|
|
38
|
+
} = _objectSpread({
|
|
29
39
|
spaceForNestingLevel: 1.5
|
|
30
|
-
}, opts)
|
|
31
|
-
spaceForNestingLevel = _spaceForNestingLevel.spaceForNestingLevel,
|
|
32
|
-
isChild = _spaceForNestingLevel.isChild;
|
|
40
|
+
}, opts);
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
const groupLeftPadding = spaceForNestingLevel * (level - 1);
|
|
35
43
|
return isChild ? "".concat(groupLeftPadding + spaceForNestingLevel - 0.1, "em") : "".concat(groupLeftPadding, "em");
|
|
36
44
|
};
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
showChildrenAmount =
|
|
45
|
-
labelRenderer
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const itemRenderer = (value, itemProps, instance) => {
|
|
47
|
+
const {
|
|
48
|
+
record
|
|
49
|
+
} = itemProps;
|
|
50
|
+
const {
|
|
51
|
+
props: {
|
|
52
|
+
showChildrenAmount = false,
|
|
53
|
+
labelRenderer,
|
|
54
|
+
onItemClick = noop
|
|
55
|
+
}
|
|
56
|
+
} = instance.getInstance(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
49
57
|
|
|
50
|
-
|
|
58
|
+
const handleItemClick = useCallback(e => {
|
|
51
59
|
onItemClick(record.data, e);
|
|
52
60
|
}, [record.data, onItemClick]);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return /*#__PURE__*/
|
|
61
|
+
const amountChildren = Number(getItemChildrenLength(record));
|
|
62
|
+
const renderedLabel = isFunction(labelRenderer) && labelRenderer(value, itemProps) || value;
|
|
63
|
+
return /*#__PURE__*/_jsx(ItemContent, {
|
|
56
64
|
"data-testid": "".concat(treeItemBlockName, "-content"),
|
|
57
65
|
onClick: handleItemClick
|
|
58
|
-
}, /*#__PURE__*/
|
|
66
|
+
}, void 0, /*#__PURE__*/_jsx(ItemValue, {}, void 0, renderedLabel, showChildrenAmount && record.isGroup && " (".concat(amountChildren, ")")));
|
|
59
67
|
};
|
|
60
68
|
|
|
61
69
|
itemRenderer.order = 100;
|
|
62
|
-
|
|
70
|
+
const TreePluginList = createInstancePlugin('tree-data', {
|
|
63
71
|
state: useExpandTreeState,
|
|
64
|
-
recordIterator:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
recordIterator: opts => {
|
|
73
|
+
const shouldWalkChildren = record => {
|
|
74
|
+
const {
|
|
75
|
+
state: {
|
|
76
|
+
expandedAll
|
|
77
|
+
},
|
|
78
|
+
decorators
|
|
79
|
+
} = opts.instance.getInstance();
|
|
80
|
+
const shouldWalk = decorators.shouldWalkChildren.some(decorator => decorator(record, opts.instance));
|
|
73
81
|
if (shouldWalk) return true;
|
|
74
82
|
if (expandedAll === true) return true;
|
|
75
83
|
return !record.parentNode.id || record.parentNode.expanded;
|
|
76
84
|
};
|
|
77
85
|
|
|
78
86
|
walkTreeStrategy(_objectSpread(_objectSpread({}, opts), {}, {
|
|
79
|
-
shouldWalkChildren
|
|
87
|
+
shouldWalkChildren
|
|
80
88
|
}));
|
|
81
89
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
|
|
91
|
+
getItemProps(props, instance, _ref) {
|
|
92
|
+
let {
|
|
93
|
+
record
|
|
94
|
+
} = _ref;
|
|
95
|
+
const {
|
|
96
|
+
nestingLevel
|
|
97
|
+
} = record;
|
|
98
|
+
const {
|
|
99
|
+
actions: {
|
|
100
|
+
_toggleExpand
|
|
101
|
+
},
|
|
102
|
+
props: {
|
|
103
|
+
itemIcon,
|
|
104
|
+
groupIcon,
|
|
105
|
+
spaceForNestingLevel = 1.5
|
|
106
|
+
}
|
|
107
|
+
} = instance.getInstance(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
108
|
+
|
|
109
|
+
const handleExpandRow = useCallback(() => _toggleExpand(record.data), [record.data]);
|
|
110
|
+
const icon = record.isGroup ? groupIcon : itemIcon;
|
|
111
|
+
const itemNestingLeftPadding = getItemNestingLeftPadding(nestingLevel || record.nestingLevel, {
|
|
100
112
|
isChild: !record.isGroup,
|
|
101
|
-
spaceForNestingLevel
|
|
113
|
+
spaceForNestingLevel
|
|
102
114
|
});
|
|
103
|
-
|
|
115
|
+
|
|
116
|
+
const expandAddon = record.isGroup && /*#__PURE__*/_jsx(Button, {
|
|
104
117
|
buttonType: "text",
|
|
105
118
|
className: "expandable-arrow",
|
|
106
119
|
"data-testid": "tree-item-expand-toggle",
|
|
107
|
-
|
|
108
|
-
icon: record.expanded ? /*#__PURE__*/React.createElement(ArrowheadDown, {
|
|
120
|
+
icon: record.expanded ? _ArrowheadDown || (_ArrowheadDown = /*#__PURE__*/_jsx(ArrowheadDown, {
|
|
109
121
|
"data-testid": "ic-arrow-head-down"
|
|
110
|
-
}) : /*#__PURE__*/
|
|
122
|
+
})) : _ArrowheadRight || (_ArrowheadRight = /*#__PURE__*/_jsx(ArrowheadRight, {
|
|
111
123
|
"data-testid": "ic-arrow-head-right"
|
|
112
|
-
}),
|
|
113
|
-
onClick:
|
|
124
|
+
})),
|
|
125
|
+
onClick: e => {
|
|
114
126
|
// Avoid item selection on caret click (just expand/hide)
|
|
115
127
|
e.stopPropagation();
|
|
116
128
|
handleExpandRow(e);
|
|
@@ -118,58 +130,69 @@ var TreePluginList = createInstancePlugin('tree-data', {
|
|
|
118
130
|
size: "s",
|
|
119
131
|
tabIndex: -1 // eslint-disable-next-line max-lines
|
|
120
132
|
|
|
121
|
-
});
|
|
122
|
-
|
|
133
|
+
}, "".concat(record.id, "-expand-addon"));
|
|
134
|
+
|
|
135
|
+
const iconAddon = icon && /*#__PURE__*/React.cloneElement(icon, {
|
|
123
136
|
'data-testid': record.isGroup ? 'tree-item-group-icon' : 'tree-item-icon',
|
|
124
137
|
className: cx(icon.props.className, 'tree-item-icon')
|
|
125
138
|
});
|
|
126
|
-
|
|
139
|
+
|
|
140
|
+
const spaceAddon = /*#__PURE__*/_jsx("div", {
|
|
127
141
|
"data-testid": "tree-item-nested-space",
|
|
128
142
|
style: {
|
|
129
143
|
width: itemNestingLeftPadding
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
144
|
+
}
|
|
145
|
+
}, "".concat(record.id, "-space-addon"));
|
|
146
|
+
|
|
133
147
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
134
148
|
'data-id': record.id,
|
|
135
149
|
'data-parentid': getParentId(record),
|
|
136
150
|
'aria-expanded': !!record.expanded,
|
|
137
|
-
leftAddons: [
|
|
151
|
+
leftAddons: [...(props.leftAddons || []), spaceAddon, expandAddon, iconAddon]
|
|
138
152
|
});
|
|
139
153
|
},
|
|
140
|
-
record: function record(_record, instance) {
|
|
141
|
-
var _instance$getInstance8 = instance.getInstance(),
|
|
142
|
-
_instance$getInstance9 = _instance$getInstance8.state,
|
|
143
|
-
expanded = _instance$getInstance9.expanded,
|
|
144
|
-
expandedAll = _instance$getInstance9.expandedAll;
|
|
145
|
-
|
|
146
|
-
var isParentExpanded = !_record.parentNode.id || _record.parentNode.expanded; // eslint-disable-next-line no-param-reassign
|
|
147
|
-
|
|
148
|
-
if (expandedAll === true) _record.expanded = true; // eslint-disable-next-line no-param-reassign
|
|
149
|
-
else if (expandedAll === false) _record.expanded = false; // eslint-disable-next-line no-param-reassign
|
|
150
|
-
else _record.expanded = isParentExpanded && !!expanded[_record.id];
|
|
151
|
-
return isParentExpanded && _record;
|
|
152
|
-
},
|
|
153
|
-
hotKeys: function hotKeys(instance) {
|
|
154
|
-
function handleExpand(_ref2) {
|
|
155
|
-
var index = _ref2.index;
|
|
156
154
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
record: (record, instance) => {
|
|
156
|
+
const {
|
|
157
|
+
state: {
|
|
158
|
+
expanded,
|
|
159
|
+
expandedAll
|
|
160
|
+
}
|
|
161
|
+
} = instance.getInstance();
|
|
162
|
+
const isParentExpanded = !record.parentNode.id || record.parentNode.expanded; // eslint-disable-next-line no-param-reassign
|
|
160
163
|
|
|
161
|
-
|
|
164
|
+
if (expandedAll === true) record.expanded = true; // eslint-disable-next-line no-param-reassign
|
|
165
|
+
else if (expandedAll === false) record.expanded = false; // eslint-disable-next-line no-param-reassign
|
|
166
|
+
else record.expanded = isParentExpanded && !!expanded[record.id];
|
|
167
|
+
return isParentExpanded && record;
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
hotKeys(instance) {
|
|
171
|
+
function handleExpand(_ref2) {
|
|
172
|
+
let {
|
|
173
|
+
index
|
|
174
|
+
} = _ref2;
|
|
175
|
+
const {
|
|
176
|
+
records,
|
|
177
|
+
actions: {
|
|
178
|
+
_toggleExpand
|
|
179
|
+
}
|
|
180
|
+
} = instance.getInstance();
|
|
181
|
+
const record = records[index];
|
|
162
182
|
if (record && record.data.children.length > 0) _toggleExpand(record.data);
|
|
163
183
|
}
|
|
164
184
|
|
|
165
185
|
function handleCollapse(_ref3) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
186
|
+
let {
|
|
187
|
+
index
|
|
188
|
+
} = _ref3;
|
|
189
|
+
const {
|
|
190
|
+
records,
|
|
191
|
+
actions: {
|
|
192
|
+
collapse
|
|
193
|
+
}
|
|
194
|
+
} = instance.getInstance();
|
|
195
|
+
const record = records[index];
|
|
173
196
|
|
|
174
197
|
if (record && record.expanded) {
|
|
175
198
|
collapse(record);
|
|
@@ -177,18 +200,18 @@ var TreePluginList = createInstancePlugin('tree-data', {
|
|
|
177
200
|
}
|
|
178
201
|
|
|
179
202
|
function handleExpandAll() {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
203
|
+
const {
|
|
204
|
+
actions: {
|
|
205
|
+
toggleExpandAll
|
|
206
|
+
}
|
|
207
|
+
} = instance.getInstance();
|
|
208
|
+
const active = document.activeElement;
|
|
209
|
+
toggleExpandAll().then(() => {
|
|
210
|
+
const {
|
|
211
|
+
records
|
|
212
|
+
} = instance.getInstance();
|
|
213
|
+
const itemToFocus = records.find( // eslint-disable-next-line eqeqeq
|
|
214
|
+
record => record.id == active.dataset.id);
|
|
192
215
|
|
|
193
216
|
if (itemToFocus) {
|
|
194
217
|
// eslint-disable-next-line no-unused-expressions
|
|
@@ -196,7 +219,7 @@ var TreePluginList = createInstancePlugin('tree-data', {
|
|
|
196
219
|
findItemOnDocument(itemToFocus.id) ? findItemOnDocument(itemToFocus.id).focus() : findItemOnDocument(records[0].id).focus();
|
|
197
220
|
} else {
|
|
198
221
|
getListFromDocument().scrollTo(0, 0);
|
|
199
|
-
setTimeout(
|
|
222
|
+
setTimeout(() => {
|
|
200
223
|
findItemOnDocument(records[0].id).focus();
|
|
201
224
|
}, 200);
|
|
202
225
|
}
|
|
@@ -214,14 +237,17 @@ var TreePluginList = createInstancePlugin('tree-data', {
|
|
|
214
237
|
handler: handleCollapse
|
|
215
238
|
}, {
|
|
216
239
|
key: 'enter',
|
|
217
|
-
handler:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
240
|
+
handler: _ref4 => {
|
|
241
|
+
let {
|
|
242
|
+
index
|
|
243
|
+
} = _ref4;
|
|
244
|
+
const {
|
|
245
|
+
records,
|
|
246
|
+
actions: {
|
|
247
|
+
select
|
|
248
|
+
}
|
|
249
|
+
} = instance.getInstance();
|
|
250
|
+
const record = records[index];
|
|
225
251
|
select(record);
|
|
226
252
|
}
|
|
227
253
|
}, {
|
|
@@ -236,8 +262,8 @@ var TreePluginList = createInstancePlugin('tree-data', {
|
|
|
236
262
|
handler: handleExpandAll
|
|
237
263
|
}];
|
|
238
264
|
},
|
|
239
|
-
|
|
265
|
+
|
|
266
|
+
itemRenderer
|
|
240
267
|
});
|
|
241
268
|
|
|
242
269
|
export { TreePluginList };
|
|
243
|
-
//# sourceMappingURL=TreeDataPlugin.js.map
|
|
@@ -1,17 +1 @@
|
|
|
1
1
|
export { TreePluginList } from './TreeDataPlugin.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/toConsumableArray';
|
|
3
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import 'react';
|
|
5
|
-
import '@elliemae/ds-utilities';
|
|
6
|
-
import '@elliemae/ds-button';
|
|
7
|
-
import '@elliemae/ds-icons';
|
|
8
|
-
import '@elliemae/ds-classnames';
|
|
9
|
-
import '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
10
|
-
import './walkTreeStrategy.js';
|
|
11
|
-
import './utils.js';
|
|
12
|
-
import 'lodash/get';
|
|
13
|
-
import '../../renderers.js';
|
|
14
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
15
|
-
import './useExpandTreeState.js';
|
|
16
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
17
|
-
//# sourceMappingURL=index.js.map
|