@elliemae/ds-treeview 3.4.3-rc.1 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/TreeView.js +9 -5
- package/dist/cjs/TreeView.js.map +2 -2
- package/dist/cjs/TreeViewContext.js +4 -1
- package/dist/cjs/TreeViewContext.js.map +1 -1
- package/dist/cjs/config/cssClassesConstants.js +4 -1
- package/dist/cjs/config/cssClassesConstants.js.map +1 -1
- package/dist/cjs/config/useTreeview.js +62 -52
- package/dist/cjs/config/useTreeview.js.map +2 -2
- package/dist/cjs/hoc/DnDTreeContext.js +4 -1
- package/dist/cjs/hoc/DnDTreeContext.js.map +1 -1
- package/dist/cjs/hoc/SortableItemContext.js +4 -1
- package/dist/cjs/hoc/SortableItemContext.js.map +2 -2
- package/dist/cjs/hoc/WithConditionalDnDContext.js +67 -50
- package/dist/cjs/hoc/WithConditionalDnDContext.js.map +2 -2
- package/dist/cjs/hoc/WithDnDSortableItemContext.js +24 -13
- package/dist/cjs/hoc/WithDnDSortableItemContext.js.map +2 -2
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parts/CheckboxSelectable.js +20 -11
- package/dist/cjs/parts/CheckboxSelectable.js.map +2 -2
- package/dist/cjs/parts/ChildrenCountDisplayer.js +12 -5
- package/dist/cjs/parts/ChildrenCountDisplayer.js.map +1 -1
- package/dist/cjs/parts/DnDHandle.js +7 -3
- package/dist/cjs/parts/DnDHandle.js.map +1 -1
- package/dist/cjs/parts/DropIndicator.js +27 -16
- package/dist/cjs/parts/DropIndicator.js.map +1 -1
- package/dist/cjs/parts/ExpandCaret.js +11 -8
- package/dist/cjs/parts/ExpandCaret.js.map +2 -2
- package/dist/cjs/parts/Icon.js +4 -1
- package/dist/cjs/parts/Icon.js.map +2 -2
- package/dist/cjs/parts/NestingSpace.js +6 -3
- package/dist/cjs/parts/NestingSpace.js.map +1 -1
- package/dist/cjs/parts/RadioSelectable.js +7 -3
- package/dist/cjs/parts/RadioSelectable.js.map +2 -2
- package/dist/cjs/parts/TreeItem.js +89 -49
- package/dist/cjs/parts/TreeItem.js.map +2 -2
- package/dist/cjs/parts/TreeItemText.js +58 -31
- package/dist/cjs/parts/TreeItemText.js.map +2 -2
- package/dist/cjs/parts/TreeList.js +62 -49
- package/dist/cjs/parts/TreeList.js.map +2 -2
- package/dist/cjs/plugins/dnd/TreeDndPlugin.js +4 -1
- package/dist/cjs/plugins/dnd/TreeDndPlugin.js.map +1 -1
- package/dist/cjs/plugins/dnd/index.js +4 -1
- package/dist/cjs/plugins/dnd/index.js.map +1 -1
- package/dist/cjs/plugins/index.js +4 -1
- package/dist/cjs/plugins/index.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +16 -9
- package/dist/cjs/react-desc-prop-types.js.map +1 -1
- package/dist/cjs/related-components/TreeViewSearchBar.js +6 -3
- package/dist/cjs/related-components/TreeViewSearchBar.js.map +1 -1
- package/dist/cjs/sharedTypes.js +4 -1
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/utils/array-helpers.js +4 -1
- package/dist/cjs/utils/array-helpers.js.map +1 -1
- package/dist/cjs/utils/group-expands-helpers.js +8 -2
- package/dist/cjs/utils/group-expands-helpers.js.map +1 -1
- package/dist/cjs/utils/keyboard-helpers.js +104 -92
- package/dist/cjs/utils/keyboard-helpers.js.map +2 -2
- package/dist/cjs/utils/object-helpers.js +4 -1
- package/dist/cjs/utils/object-helpers.js.map +1 -1
- package/dist/cjs/utils/refs-helpers.js +4 -1
- package/dist/cjs/utils/refs-helpers.js.map +1 -1
- package/dist/cjs/utils/selectable-helper.js +4 -1
- package/dist/cjs/utils/selectable-helper.js.map +1 -1
- package/dist/cjs/utils/string-helpers.js +4 -1
- package/dist/cjs/utils/string-helpers.js.map +1 -1
- package/dist/cjs/utils/tree-helpers.js +8 -2
- package/dist/cjs/utils/tree-helpers.js.map +1 -1
- package/dist/cjs/utils/useInstanceRefActions.js +50 -35
- package/dist/cjs/utils/useInstanceRefActions.js.map +1 -1
- package/dist/cjs/utils/useTree.js +12 -4
- package/dist/cjs/utils/useTree.js.map +2 -2
- package/dist/esm/TreeView.js +5 -4
- package/dist/esm/TreeView.js.map +1 -1
- package/dist/esm/TreeViewContext.js.map +1 -1
- package/dist/esm/config/cssClassesConstants.js.map +1 -1
- package/dist/esm/config/useTreeview.js +58 -51
- package/dist/esm/config/useTreeview.js.map +1 -1
- package/dist/esm/hoc/DnDTreeContext.js.map +1 -1
- package/dist/esm/hoc/SortableItemContext.js.map +2 -2
- package/dist/esm/hoc/WithConditionalDnDContext.js +63 -49
- package/dist/esm/hoc/WithConditionalDnDContext.js.map +1 -1
- package/dist/esm/hoc/WithDnDSortableItemContext.js +20 -12
- package/dist/esm/hoc/WithDnDSortableItemContext.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parts/CheckboxSelectable.js +16 -10
- package/dist/esm/parts/CheckboxSelectable.js.map +1 -1
- package/dist/esm/parts/ChildrenCountDisplayer.js +8 -4
- package/dist/esm/parts/ChildrenCountDisplayer.js.map +1 -1
- package/dist/esm/parts/DnDHandle.js +3 -2
- package/dist/esm/parts/DnDHandle.js.map +1 -1
- package/dist/esm/parts/DropIndicator.js +23 -15
- package/dist/esm/parts/DropIndicator.js.map +1 -1
- package/dist/esm/parts/ExpandCaret.js +7 -7
- package/dist/esm/parts/ExpandCaret.js.map +1 -1
- package/dist/esm/parts/Icon.js.map +2 -2
- package/dist/esm/parts/NestingSpace.js +2 -2
- package/dist/esm/parts/NestingSpace.js.map +1 -1
- package/dist/esm/parts/RadioSelectable.js +3 -2
- package/dist/esm/parts/RadioSelectable.js.map +1 -1
- package/dist/esm/parts/TreeItem.js +85 -48
- package/dist/esm/parts/TreeItem.js.map +1 -1
- package/dist/esm/parts/TreeItemText.js +54 -30
- package/dist/esm/parts/TreeItemText.js.map +1 -1
- package/dist/esm/parts/TreeList.js +58 -48
- package/dist/esm/parts/TreeList.js.map +1 -1
- package/dist/esm/plugins/dnd/TreeDndPlugin.js.map +1 -1
- package/dist/esm/plugins/dnd/index.js.map +1 -1
- package/dist/esm/plugins/index.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +12 -8
- package/dist/esm/react-desc-prop-types.js.map +1 -1
- package/dist/esm/related-components/TreeViewSearchBar.js +2 -2
- package/dist/esm/related-components/TreeViewSearchBar.js.map +1 -1
- package/dist/esm/sharedTypes.js.map +1 -1
- package/dist/esm/utils/array-helpers.js.map +1 -1
- package/dist/esm/utils/group-expands-helpers.js +4 -1
- package/dist/esm/utils/group-expands-helpers.js.map +1 -1
- package/dist/esm/utils/keyboard-helpers.js +100 -91
- package/dist/esm/utils/keyboard-helpers.js.map +1 -1
- package/dist/esm/utils/object-helpers.js.map +1 -1
- package/dist/esm/utils/refs-helpers.js.map +1 -1
- package/dist/esm/utils/selectable-helper.js.map +1 -1
- package/dist/esm/utils/string-helpers.js.map +1 -1
- package/dist/esm/utils/tree-helpers.js +4 -1
- package/dist/esm/utils/tree-helpers.js.map +1 -1
- package/dist/esm/utils/useInstanceRefActions.js +46 -34
- package/dist/esm/utils/useInstanceRefActions.js.map +1 -1
- package/dist/esm/utils/useTree.js +8 -3
- package/dist/esm/utils/useTree.js.map +1 -1
- package/package.json +10 -10
package/dist/cjs/TreeView.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var TreeView_exports = {};
|
|
23
26
|
__export(TreeView_exports, {
|
|
@@ -26,7 +29,7 @@ __export(TreeView_exports, {
|
|
|
26
29
|
});
|
|
27
30
|
module.exports = __toCommonJS(TreeView_exports);
|
|
28
31
|
var React = __toESM(require("react"));
|
|
29
|
-
var
|
|
32
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
33
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
31
34
|
var import_react_desc_prop_types = require("./react-desc-prop-types");
|
|
32
35
|
var import_TreeViewContext = __toESM(require("./TreeViewContext"));
|
|
@@ -34,9 +37,10 @@ var import_useTreeview = require("./config/useTreeview");
|
|
|
34
37
|
var import_TreeList = require("./parts/TreeList");
|
|
35
38
|
function TreeView(props) {
|
|
36
39
|
const { ctx } = (0, import_useTreeview.useTreeview)(props);
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
value: ctx
|
|
39
|
-
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TreeViewContext.default.Provider, {
|
|
41
|
+
value: ctx,
|
|
42
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TreeList.TreeList, {})
|
|
43
|
+
});
|
|
40
44
|
}
|
|
41
45
|
TreeView.propTypes = import_react_desc_prop_types.TreeViewPropTypes;
|
|
42
46
|
TreeView.displayName = "TreeView";
|
package/dist/cjs/TreeView.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/TreeView.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { WeakValidationMap } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { TreeViewPropTypes } from './react-desc-prop-types';\nimport TreeViewContext from './TreeViewContext';\nimport { useTreeview } from './config/useTreeview';\nimport { TreeList } from './parts/TreeList';\nimport type { DSTreeviewT } from './react-desc-prop-types';\nexport function TreeView(props: DSTreeviewT.Props) {\n const { ctx } = useTreeview(props);\n\n return (\n <TreeViewContext.Provider value={ctx}>\n <TreeList />\n </TreeViewContext.Provider>\n );\n}\n\nTreeView.propTypes = TreeViewPropTypes as WeakValidationMap<unknown>;\nTreeView.displayName = 'TreeView';\nconst TreeViewWithSchema = describe(TreeView);\nTreeViewWithSchema.propTypes = TreeViewPropTypes;\n\nexport { TreeViewWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,0BAAyB;AACzB,mCAAkC;AAClC,6BAA4B;AAC5B,yBAA4B;AAC5B,sBAAyB;AAElB,SAAS,SAAS,OAA0B;AACjD,QAAM,EAAE,IAAI,QAAI,gCAAY,KAAK;AAEjC,SACE,4CAAC,uBAAAA,QAAgB,UAAhB;AAAA,IAAyB,OAAO;AAAA,IAC/B,sDAAC,4BAAS;AAAA,GACZ;AAEJ;AAEA,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,MAAM,yBAAqB,8BAAS,QAAQ;AAC5C,mBAAmB,YAAY;",
|
|
6
|
+
"names": ["TreeViewContext"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var TreeViewContext_exports = {};
|
|
23
26
|
__export(TreeViewContext_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/TreeViewContext.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-unused-vars */\nimport { createContext, createRef } from 'react';\nimport type { DSTreeviewT } from './react-desc-prop-types';\nimport type { DSTreeviewInternalsT } from './sharedTypes';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction noop<T extends unknown[]>(..._args: T): void {}\n\nexport const defaultProps = {\n plugins: [],\n selection: {},\n instanceRef: createRef(),\n isItemDisabled: () => false,\n disableIcons: false,\n isMultiSelect: false,\n isSingleSelect: false,\n getIsDropValid: () => true,\n showChildrenAmount: false,\n isLoading: false,\n highlightOnlyQuery: false,\n onItemClick: noop,\n onItemFocus: noop,\n onVisibleItemsChange: noop,\n onOrderChange: noop,\n onSelectionChange: noop,\n onExpandChange: noop,\n onInstanceRefInitialized: noop,\n rowSize: 'normal',\n labelOverflow: 'wrap',\n noItemsPlaceholder: 'No items found',\n nameKey: 'name',\n width: '100%',\n height: '100%',\n groupIcon: null,\n itemIcon: null,\n searchQuery: '',\n // workaround on the typings over the fact that\n // when we instantiate the context we can't have all the props\n // we only have a part of them but the final typings will include missing props\n // this is safe to do because\n // we will \"mergeWithDefaults\" + \"validatePropTypes\" when we do instantiate the context\n} as unknown as DSTreeviewT.Props;\n\nexport const defaultRelativeMouseCoord = {\n isBefore: false,\n isAfter: false,\n isValid: true,\n item: null,\n x: null,\n y: null,\n relativeElementDOMRect: null,\n relativeElementIndex: null,\n};\n\nconst defaultContext: DSTreeviewInternalsT.CTX = {\n props: defaultProps,\n visibleItems: [],\n flattenedItems: [],\n withRadioChecks: false,\n withCheckboxChecks: false,\n withDragAndDrop: false,\n triggerTreeRerender: noop,\n tree: undefined,\n treeRoot: undefined,\n virtualListHelpers: {\n virtualItems: [],\n totalSize: 0,\n scrollToOffset: noop,\n scrollToIndex: noop,\n measure: noop,\n },\n virtualListRef: undefined,\n uniqueTreeViewUUID: '',\n selectedItem: null,\n setSelectedItem: noop,\n focusedItem: null,\n setFocusedItem: noop,\n selectedCheckboxes: {},\n setSelectedCheckboxes: noop,\n expandedGroups: {},\n setExpandedGroups: noop,\n latestToggledItem: null,\n setLatestToggledItem: noop,\n hoverItem: null,\n setHoverItem: noop,\n handleExpandGroup: noop,\n updateUserExpandedState: noop,\n};\n\n/** Context for cross component communication */\nconst TreeViewContext = createContext(defaultContext);\n\nexport default TreeViewContext;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAyC;AAKzC,SAAS,QAA6B,OAAgB;AAAC;AAEhD,MAAM,eAAe;AAAA,EAC1B,SAAS,CAAC;AAAA,EACV,WAAW,CAAC;AAAA,EACZ,iBAAa,wBAAU;AAAA,EACvB,gBAAgB,MAAM;AAAA,EACtB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,gBAAgB,MAAM;AAAA,EACtB,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,SAAS;AAAA,EACT,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AAMf;AAEO,MAAM,4BAA4B;AAAA,EACvC,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AAAA,EACN,GAAG;AAAA,EACH,GAAG;AAAA,EACH,wBAAwB;AAAA,EACxB,sBAAsB;AACxB;AAEA,MAAM,iBAA2C;AAAA,EAC/C,OAAO;AAAA,EACP,cAAc,CAAC;AAAA,EACf,gBAAgB,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,oBAAoB;AAAA,IAClB,cAAc,CAAC;AAAA,IACf,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,oBAAoB,CAAC;AAAA,EACrB,uBAAuB;AAAA,EACvB,gBAAgB,CAAC;AAAA,EACjB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,yBAAyB;AAC3B;AAGA,MAAM,sBAAkB,4BAAc,cAAc;AAEpD,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var cssClassesConstants_exports = {};
|
|
23
26
|
__export(cssClassesConstants_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/cssClassesConstants.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const DSTreeViewPrefix = 'em-ds';\nexport const treeItemBlockName = 'tree-item';\nexport const treeListBlockName = 'tree-list';\nexport const treeListNoItemsBn = `${treeListBlockName}-no-items`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var useTreeview_exports = {};
|
|
23
26
|
__export(useTreeview_exports, {
|
|
@@ -71,9 +74,13 @@ const useTreeview = (props) => {
|
|
|
71
74
|
...selection
|
|
72
75
|
});
|
|
73
76
|
const [expandedGroups, setExpandedGroups] = (0, import_react.useState)({});
|
|
74
|
-
const { visibleItems, flattenedItems, tree, treeRoot, triggerTreeRerender, updateUserExpandedState } = (0, import_useTree.useTree)(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
const { visibleItems, flattenedItems, tree, treeRoot, triggerTreeRerender, updateUserExpandedState } = (0, import_useTree.useTree)(
|
|
78
|
+
data,
|
|
79
|
+
propsWithDefault,
|
|
80
|
+
{
|
|
81
|
+
setExpandedGroups
|
|
82
|
+
}
|
|
83
|
+
);
|
|
77
84
|
const virtualListRef = (0, import_react.useRef)();
|
|
78
85
|
const virtualListHelpers = (0, import_react_virtual.useVirtual)({
|
|
79
86
|
size: visibleItems.length,
|
|
@@ -84,54 +91,57 @@ const useTreeview = (props) => {
|
|
|
84
91
|
const withRadioChecks = isSingleSelect && !isMultiSelect;
|
|
85
92
|
const withCheckboxChecks = !isSingleSelect && isMultiSelect;
|
|
86
93
|
const handleExpandGroup = (0, import_react.useCallback)(import_group_expands_helpers.toggleItemExpand, []);
|
|
87
|
-
const ctx = (0, import_react.useMemo)(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
94
|
+
const ctx = (0, import_react.useMemo)(
|
|
95
|
+
() => ({
|
|
96
|
+
props: propsWithDefault,
|
|
97
|
+
virtualListHelpers,
|
|
98
|
+
virtualListRef,
|
|
99
|
+
tree,
|
|
100
|
+
treeRoot,
|
|
101
|
+
visibleItems,
|
|
102
|
+
flattenedItems,
|
|
103
|
+
triggerTreeRerender,
|
|
104
|
+
withRadioChecks,
|
|
105
|
+
withCheckboxChecks,
|
|
106
|
+
withDragAndDrop,
|
|
107
|
+
uniqueTreeViewUUID,
|
|
108
|
+
selectedCheckboxes,
|
|
109
|
+
setSelectedCheckboxes,
|
|
110
|
+
selectedItem,
|
|
111
|
+
setSelectedItem,
|
|
112
|
+
expandedGroups,
|
|
113
|
+
setExpandedGroups,
|
|
114
|
+
latestToggledItem,
|
|
115
|
+
setLatestToggledItem,
|
|
116
|
+
focusedItem,
|
|
117
|
+
setFocusedItem,
|
|
118
|
+
hoverItem,
|
|
119
|
+
setHoverItem,
|
|
120
|
+
handleExpandGroup,
|
|
121
|
+
updateUserExpandedState
|
|
122
|
+
}),
|
|
123
|
+
[
|
|
124
|
+
propsWithDefault,
|
|
125
|
+
virtualListHelpers,
|
|
126
|
+
tree,
|
|
127
|
+
treeRoot,
|
|
128
|
+
visibleItems,
|
|
129
|
+
flattenedItems,
|
|
130
|
+
triggerTreeRerender,
|
|
131
|
+
withRadioChecks,
|
|
132
|
+
withCheckboxChecks,
|
|
133
|
+
withDragAndDrop,
|
|
134
|
+
uniqueTreeViewUUID,
|
|
135
|
+
selectedCheckboxes,
|
|
136
|
+
selectedItem,
|
|
137
|
+
expandedGroups,
|
|
138
|
+
latestToggledItem,
|
|
139
|
+
focusedItem,
|
|
140
|
+
hoverItem,
|
|
141
|
+
handleExpandGroup,
|
|
142
|
+
updateUserExpandedState
|
|
143
|
+
]
|
|
144
|
+
);
|
|
135
145
|
if (instanceRef)
|
|
136
146
|
instanceRef.current = treeRef.current;
|
|
137
147
|
(0, import_useInstanceRefActions.useInstanceRefActions)(treeRef.current, ctx);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useTreeview.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { useState, useRef, useEffect, useMemo, useCallback } from 'react';\nimport { useVirtual } from 'react-virtual';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-utilities';\nimport { v4 as uuidv4 } from 'uuid';\n\nimport { TreeViewPropTypes } from '../react-desc-prop-types';\nimport { defaultProps } from '../TreeViewContext';\nimport { TreeDndPlugin } from '../plugins/dnd';\nimport { useTree } from '../utils/useTree';\nimport { useNotifyExpandedChange, toggleItemExpand } from '../utils/group-expands-helpers';\nimport { useInstanceRefActions } from '../utils/useInstanceRefActions';\nimport { useGlobalToggleAllExpandShortcut } from '../utils/keyboard-helpers';\nimport type { DSTreeviewT } from '../react-desc-prop-types';\nimport type { DSTreeviewInternalsT } from '../sharedTypes';\n\ntype UseTreeviewT = (props: DSTreeviewT.Props) => { ctx: DSTreeviewInternalsT.CTX };\n\nexport const useTreeview: UseTreeviewT = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSTreeviewT.Props>(props, defaultProps);\n useValidateTypescriptPropTypes<DSTreeviewT.Props>(propsWithDefault, TreeViewPropTypes);\n const defaultActions = {\n actions: {\n toggleExpandAll: () => {},\n scrollTo: () => {},\n setSelectedItemByVirtualIndex: () => {},\n setFocusedItemByVirtualIndex: () => {},\n },\n } as unknown as DSTreeviewT.InstanceRef;\n const treeRef = useRef(defaultActions);\n const {\n data,\n plugins,\n onOrderChange,\n isMultiSelect,\n isSingleSelect,\n instanceRef,\n selection,\n onInstanceRefInitialized,\n } = propsWithDefault;\n const [uniqueTreeViewUUID] = useState(uuidv4());\n const [hoverItem, setHoverItem] = useState<DSTreeviewT.Item | null>(null);\n const [latestToggledItem, setLatestToggledItem] = useState<DSTreeviewT.Item | null>(null);\n const [selectedItem, setSelectedItem] = useState<DSTreeviewT.Item | null>(null);\n const [focusedItem, setFocusedItem] = useState<DSTreeviewT.Item | null>(null);\n const [selectedCheckboxes, setSelectedCheckboxes] = useState({\n ...selection,\n });\n const [expandedGroups, setExpandedGroups] = useState<DSTreeviewT.ExpandedItems>({});\n const { visibleItems, flattenedItems, tree, treeRoot, triggerTreeRerender, updateUserExpandedState } = useTree(\n data,\n propsWithDefault,\n {\n setExpandedGroups,\n },\n );\n\n const virtualListRef = useRef<HTMLUListElement>();\n // estimateSize should not be really required given what was stated on\n // https://github.com/tannerlinsley/react-virtual/issues/23\n\n const virtualListHelpers = useVirtual({\n size: visibleItems.length,\n parentRef: virtualListRef,\n overscan: 15,\n });\n\n const withDragAndDrop = !!(plugins?.includes(TreeDndPlugin) && onOrderChange);\n const withRadioChecks = isSingleSelect && !isMultiSelect;\n const withCheckboxChecks = !isSingleSelect && isMultiSelect;\n\n const handleExpandGroup = useCallback(toggleItemExpand, []);\n\n const ctx: DSTreeviewInternalsT.CTX = useMemo(\n () => ({\n props: propsWithDefault,\n virtualListHelpers,\n virtualListRef,\n tree,\n treeRoot,\n visibleItems,\n flattenedItems,\n triggerTreeRerender,\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n uniqueTreeViewUUID,\n selectedCheckboxes,\n setSelectedCheckboxes,\n selectedItem,\n setSelectedItem,\n expandedGroups,\n setExpandedGroups,\n latestToggledItem,\n setLatestToggledItem,\n focusedItem,\n setFocusedItem,\n hoverItem,\n setHoverItem,\n handleExpandGroup,\n updateUserExpandedState,\n }),\n [\n propsWithDefault,\n virtualListHelpers,\n tree,\n treeRoot,\n visibleItems,\n flattenedItems,\n triggerTreeRerender,\n withRadioChecks,\n withCheckboxChecks,\n withDragAndDrop,\n uniqueTreeViewUUID,\n selectedCheckboxes,\n selectedItem,\n expandedGroups,\n latestToggledItem,\n focusedItem,\n hoverItem,\n handleExpandGroup,\n updateUserExpandedState,\n ],\n );\n // this hooks can't use the context because the context provider doesn't wrap this\n // as such we manually pass the second parameter as fit\n if (instanceRef) instanceRef.current = treeRef.current;\n useInstanceRefActions(treeRef.current, ctx);\n useGlobalToggleAllExpandShortcut(treeRoot, triggerTreeRerender, setLatestToggledItem, updateUserExpandedState);\n useNotifyExpandedChange(propsWithDefault, ctx);\n\n // this is an horrible hack.\n // this is required because there is no \"on rendered\" react-way to check if every children has finished rendering\n // this should be working for now, in the future we may want to review this for a better solution\n useEffect(() => {\n setTimeout(() => onInstanceRefInitialized(treeRef), 100);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return useMemo(() => ({ ctx }), [ctx]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAkE;AAClE,2BAA2B;AAC3B,0BAA6E;AAC7E,kBAA6B;AAE7B,mCAAkC;AAClC,6BAA6B;AAC7B,iBAA8B;AAC9B,qBAAwB;AACxB,mCAA0D;AAC1D,mCAAsC;AACtC,8BAAiD;AAM1C,MAAM,cAA4B,CAAC,UAAU;AAClD,QAAM,uBAAmB,kDAAgD,OAAO,mCAAY;AAC5F,0DAAkD,kBAAkB,8CAAiB;AACrF,QAAM,iBAAiB;AAAA,IACrB,SAAS;AAAA,MACP,iBAAiB,MAAM;AAAA,MAAC;AAAA,MACxB,UAAU,MAAM;AAAA,MAAC;AAAA,MACjB,+BAA+B,MAAM;AAAA,MAAC;AAAA,MACtC,8BAA8B,MAAM;AAAA,MAAC;AAAA,IACvC;AAAA,EACF;AACA,QAAM,cAAU,qBAAO,cAAc;AACrC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,kBAAkB,QAAI,2BAAS,YAAAA,IAAO,CAAC;AAC9C,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAkC,IAAI;AACxE,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,uBAAkC,IAAI;AACxF,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAkC,IAAI;AAC9E,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAkC,IAAI;AAC5E,QAAM,CAAC,oBAAoB,qBAAqB,QAAI,uBAAS;AAAA,IAC3D,GAAG;AAAA,EACL,CAAC;AACD,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAAoC,CAAC,CAAC;AAClF,QAAM,EAAE,cAAc,gBAAgB,MAAM,UAAU,qBAAqB,wBAAwB,QAAI;AAAA,IACrG;AAAA,IACA;AAAA,IACA;AAAA,MACE;AAAA,IACF;AAAA,EACF;AAEA,QAAM,qBAAiB,qBAAyB;AAIhD,QAAM,yBAAqB,iCAAW;AAAA,IACpC,MAAM,aAAa;AAAA,IACnB,WAAW;AAAA,IACX,UAAU;AAAA,EACZ,CAAC;AAED,QAAM,kBAAkB,CAAC,EAAE,SAAS,SAAS,wBAAa,KAAK;AAC/D,QAAM,kBAAkB,kBAAkB,CAAC;AAC3C,QAAM,qBAAqB,CAAC,kBAAkB;AAE9C,QAAM,wBAAoB,0BAAY,+CAAkB,CAAC,CAAC;AAE1D,QAAM,UAAgC;AAAA,IACpC,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAGA,MAAI;AAAa,gBAAY,UAAU,QAAQ;AAC/C,0DAAsB,QAAQ,SAAS,GAAG;AAC1C,gEAAiC,UAAU,qBAAqB,sBAAsB,uBAAuB;AAC7G,4DAAwB,kBAAkB,GAAG;AAK7C,8BAAU,MAAM;AACd,eAAW,MAAM,yBAAyB,OAAO,GAAG,GAAG;AAAA,EAEzD,GAAG,CAAC,CAAC;AAEL,aAAO,sBAAQ,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC;AACvC;",
|
|
6
|
+
"names": ["uuidv4"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var DnDTreeContext_exports = {};
|
|
23
26
|
__export(DnDTreeContext_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hoc/DnDTreeContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { createContext } from 'react';\nimport { DSTreeviewT } from '../react-desc-prop-types';\nimport { DropIndicatorPosition } from './SortableItemContext';\n\ntype DnDTreeContextType = {\n depth: number | undefined;\n activeIndex: number | undefined;\n visibleItems: DSTreeviewT.Item[] | undefined;\n dropIndicatorPosition: DropIndicatorPosition;\n isDropValid: boolean;\n};\n\nexport const DnDTreeContext = createContext<DnDTreeContextType>({\n depth: undefined,\n activeIndex: undefined,\n visibleItems: undefined,\n dropIndicatorPosition: DropIndicatorPosition.None,\n isDropValid: false,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAE9B,iCAAsC;AAU/B,MAAM,qBAAiB,4BAAkC;AAAA,EAC9D,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAAA,EACd,uBAAuB,iDAAsB;AAAA,EAC7C,aAAa;AACf,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var SortableItemContext_exports = {};
|
|
23
26
|
__export(SortableItemContext_exports, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hoc/SortableItemContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { createContext } from 'react';\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport type SortableItemContextType = {\n draggableProps:\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n isDropValid: boolean;\n });\n};\n\n/** Context for cross component communication */\nexport const SortableItemContext = createContext<SortableItemContextType>({\n draggableProps: false,\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA8B;AAEvB,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,8CAAA,UAAO,KAAP;AACA,EAAAA,8CAAA,YAAS,KAAT;AACA,EAAAA,8CAAA,WAAQ,KAAR;AACA,EAAAA,8CAAA,YAAS,KAAT;AAJU,SAAAA;AAAA,GAAA;AAkBL,MAAM,0BAAsB,4BAAuC;AAAA,EACxE,gBAAgB;AAClB,CAAC;",
|
|
6
|
+
"names": ["DropIndicatorPosition"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var WithConditionalDnDContext_exports = {};
|
|
23
26
|
__export(WithConditionalDnDContext_exports, {
|
|
@@ -25,7 +28,8 @@ __export(WithConditionalDnDContext_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(WithConditionalDnDContext_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
28
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
29
33
|
var import_ds_drag_and_drop = require("@elliemae/ds-drag-and-drop");
|
|
30
34
|
var import_TreeViewContext = __toESM(require("../TreeViewContext"));
|
|
31
35
|
var import_TreeItem = require("../parts/TreeItem");
|
|
@@ -47,32 +51,38 @@ const withConditionalDnDRowContext = (Component) => (props) => {
|
|
|
47
51
|
visibleItems: flattenedVisibleTree,
|
|
48
52
|
withDragAndDrop
|
|
49
53
|
} = (0, import_react.useContext)(import_TreeViewContext.default);
|
|
50
|
-
const flattenedVisibleTreeForDnD = (0, import_react.useMemo)(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
nodes
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
const flattenedVisibleTreeForDnD = (0, import_react.useMemo)(
|
|
55
|
+
() => flattenedVisibleTree.map((item, index) => ({
|
|
56
|
+
uid: item.id.toString(),
|
|
57
|
+
depth: (item.treeDepth ?? 1) - 1,
|
|
58
|
+
realIndex: index,
|
|
59
|
+
childrenCount: item.children?.length ?? 0,
|
|
60
|
+
parentId: item.node.parent?.model?.id?.toString() ?? null,
|
|
61
|
+
original: item
|
|
62
|
+
})),
|
|
63
|
+
[flattenedVisibleTree]
|
|
64
|
+
);
|
|
65
|
+
const onReorder = (0, import_react.useCallback)(
|
|
66
|
+
(tree, indexes) => {
|
|
67
|
+
const nodes = {};
|
|
68
|
+
tree.forEach((item) => {
|
|
69
|
+
const originalItem = item.original.model;
|
|
70
|
+
originalItem.children = [];
|
|
71
|
+
nodes[item.uid] = originalItem;
|
|
72
|
+
});
|
|
73
|
+
const newUserTree = [];
|
|
74
|
+
tree.forEach((item) => {
|
|
75
|
+
if (item.parentId !== null && item.parentId !== void 0 && item.parentId !== "__ds_tree_root") {
|
|
76
|
+
const parentNode = nodes[item.parentId];
|
|
77
|
+
parentNode.children?.push(item.original.model);
|
|
78
|
+
} else if (item.uid !== "__ds_tree_root") {
|
|
79
|
+
newUserTree.push(item.original.model);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
onOrderChange(newUserTree, data, flattenedItems[indexes.fromIndex]);
|
|
83
|
+
},
|
|
84
|
+
[onOrderChange, data, flattenedItems]
|
|
85
|
+
);
|
|
76
86
|
const {
|
|
77
87
|
dndContextProps,
|
|
78
88
|
sortableContextProps,
|
|
@@ -109,28 +119,35 @@ const withConditionalDnDRowContext = (Component) => (props) => {
|
|
|
109
119
|
}
|
|
110
120
|
}, [overId, dropIndicatorPosition, triggerTreeRerender, visibleItems, updateUserExpandedState]);
|
|
111
121
|
if (withDragAndDrop)
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
...dndContextProps
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_drag_and_drop.DndContext, {
|
|
123
|
+
...dndContextProps,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_drag_and_drop.SortableContext, {
|
|
126
|
+
...sortableContextProps,
|
|
127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DnDTreeContext.DnDTreeContext.Provider, {
|
|
128
|
+
value: {
|
|
129
|
+
activeIndex,
|
|
130
|
+
depth,
|
|
131
|
+
visibleItems: visibleItems.map((item) => item.original),
|
|
132
|
+
dropIndicatorPosition,
|
|
133
|
+
isDropValid
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
|
|
136
|
+
...props
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
}),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_drag_and_drop.DragOverlay, {
|
|
141
|
+
style: { width: "auto" },
|
|
142
|
+
children: activeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TreeItem.TreeItem, {
|
|
143
|
+
itemIndex: activeIndex,
|
|
144
|
+
item: ensure(flattenedVisibleTree.find((item) => item.id.toString() === activeId)),
|
|
145
|
+
isDragOverlay: true
|
|
146
|
+
}) : null
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
});
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
|
|
134
151
|
...props
|
|
135
152
|
});
|
|
136
153
|
};
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hoc/WithConditionalDnDContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useCallback, useContext, useEffect, useMemo, useRef } from 'react';\nimport { DndContext, DragOverlay, SortableContext, useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { DSTreeviewT } from '../react-desc-prop-types';\nimport TreeViewContext from '../TreeViewContext';\nimport { TreeItem } from '../parts/TreeItem';\nimport { DnDTreeContext } from './DnDTreeContext';\nimport { DropIndicatorPosition } from './SortableItemContext';\nimport { toggleItemExpand } from '../utils/group-expands-helpers';\n\ntype FunctionalHOC = <T = unknown>(Component: React.ComponentType<T>, ...other: unknown[]) => (props: T) => JSX.Element;\n\nconst ensure = <T,>(argument: T | undefined | null, message = 'This should never happen'): T => {\n if (argument === undefined || argument === null) {\n throw new TypeError(message);\n }\n\n return argument;\n};\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: FunctionalHOC = (Component) => (props) => {\n const {\n props: { data, onOrderChange, getIsDropValid },\n flattenedItems,\n updateUserExpandedState,\n triggerTreeRerender,\n visibleItems: flattenedVisibleTree,\n withDragAndDrop,\n } = useContext(TreeViewContext);\n\n const flattenedVisibleTreeForDnD = useMemo(\n () =>\n flattenedVisibleTree.map((item, index) => ({\n uid: item.id.toString(),\n depth: (item.treeDepth ?? 1) - 1,\n realIndex: index,\n childrenCount: item.children?.length ?? 0,\n parentId: item.node.parent?.model?.id?.toString() ?? null,\n original: item,\n })),\n [flattenedVisibleTree],\n );\n\n const onReorder = useCallback(\n (tree: DSTreeviewT.DndItem[], indexes: { targetIndex: number; fromIndex: number }) => {\n // Pull the row's original data into an object\n const nodes: Record<DSTreeviewT.StringOrNum, DSTreeviewT.SimpleItem> = {};\n tree.forEach((item) => {\n const originalItem = item.original.model;\n originalItem.children = [];\n nodes[item.uid] = originalItem;\n });\n\n const newUserTree: DSTreeviewT.SimpleItem[] = [];\n tree.forEach((item) => {\n // If row has parent, insert it to it's subrows\n // otherwise append it to the new user data\n if (item.parentId !== null && item.parentId !== undefined && item.parentId !== '__ds_tree_root') {\n const parentNode = nodes[item.parentId];\n parentNode.children?.push(item.original.model);\n } else if (item.uid !== '__ds_tree_root') {\n newUserTree.push(item.original.model);\n }\n });\n // Tell the user that the order has change, he can chose to commit it or not\n onOrderChange(newUserTree, data, flattenedItems[indexes.fromIndex]);\n },\n [onOrderChange, data, flattenedItems],\n );\n\n const {\n dndContextProps,\n sortableContextProps,\n activeId,\n activeIndex,\n depth,\n dropIndicatorPosition,\n visibleItems,\n isDropValid,\n overId,\n } = useTreeDndkitConfig({\n flattenedItems,\n visibleItems: flattenedVisibleTreeForDnD,\n isHorizontalDnD: false,\n isExpandable: true,\n onReorder,\n getIsDropValid,\n maxDragAndDropLevel: Infinity,\n });\n\n const timeoutRef = useRef<NodeJS.Timeout>();\n\n useEffect(() => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n if (dropIndicatorPosition === DropIndicatorPosition.Inside && overId) {\n timeoutRef.current = setTimeout(() => {\n const overItem = visibleItems.find((item) => item.uid === overId);\n if (overItem) {\n const realOverItem = overItem.original;\n if (realOverItem.isGroup && !realOverItem.isExpanded) {\n toggleItemExpand(realOverItem, triggerTreeRerender, updateUserExpandedState);\n }\n }\n }, 1000);\n }\n }, [overId, dropIndicatorPosition, triggerTreeRerender, visibleItems, updateUserExpandedState]);\n\n if (withDragAndDrop)\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...sortableContextProps}>\n <DnDTreeContext.Provider\n value={{\n activeIndex,\n depth,\n visibleItems: visibleItems.map((item) => item.original),\n dropIndicatorPosition,\n isDropValid,\n }}\n >\n <Component {...props} />\n </DnDTreeContext.Provider>\n </SortableContext>\n <DragOverlay style={{ width: 'auto' }}>\n {activeId ? (\n <TreeItem\n itemIndex={activeIndex}\n item={ensure(flattenedVisibleTree.find((item) => item.id.toString() === activeId))}\n isDragOverlay\n />\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n return <Component {...props} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["TreeViewContext"]
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var WithDnDSortableItemContext_exports = {};
|
|
23
26
|
__export(WithDnDSortableItemContext_exports, {
|
|
@@ -25,7 +28,8 @@ __export(WithDnDSortableItemContext_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(WithDnDSortableItemContext_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
28
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
+
var import_react = require("react");
|
|
29
33
|
var import_ds_drag_and_drop = require("@elliemae/ds-drag-and-drop");
|
|
30
34
|
var import_SortableItemContext = require("./SortableItemContext");
|
|
31
35
|
var import_TreeViewContext = __toESM(require("../TreeViewContext"));
|
|
@@ -34,9 +38,12 @@ const withDnDSortableItemContext = (Component) => (props) => {
|
|
|
34
38
|
const { withDragAndDrop } = (0, import_react.useContext)(import_TreeViewContext.default);
|
|
35
39
|
const { dropIndicatorPosition, isDropValid } = (0, import_react.useContext)(import_DnDTreeContext.DnDTreeContext);
|
|
36
40
|
const id = props.item.id.toString();
|
|
37
|
-
const draggableOptions = (0, import_react.useMemo)(
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
const draggableOptions = (0, import_react.useMemo)(
|
|
42
|
+
() => ({
|
|
43
|
+
id
|
|
44
|
+
}),
|
|
45
|
+
[id]
|
|
46
|
+
);
|
|
40
47
|
const useSortableHelpers = (0, import_ds_drag_and_drop.useSortable)(draggableOptions);
|
|
41
48
|
const draggableProps = (0, import_react.useMemo)(() => {
|
|
42
49
|
if (!withDragAndDrop)
|
|
@@ -49,13 +56,17 @@ const withDnDSortableItemContext = (Component) => (props) => {
|
|
|
49
56
|
isDropValid
|
|
50
57
|
};
|
|
51
58
|
}, [withDragAndDrop, useSortableHelpers, dropIndicatorPosition, isDropValid]);
|
|
52
|
-
const ctx = (0, import_react.useMemo)(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
const ctx = (0, import_react.useMemo)(
|
|
60
|
+
() => ({
|
|
61
|
+
draggableProps
|
|
62
|
+
}),
|
|
63
|
+
[draggableProps]
|
|
64
|
+
);
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_SortableItemContext.SortableItemContext.Provider, {
|
|
66
|
+
value: ctx,
|
|
67
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
|
|
68
|
+
...props
|
|
69
|
+
})
|
|
70
|
+
});
|
|
60
71
|
};
|
|
61
72
|
//# sourceMappingURL=WithDnDSortableItemContext.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hoc/WithDnDSortableItemContext.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-call */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext, useMemo } from 'react';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { SortableItemContext, SortableItemContextType } from './SortableItemContext';\nimport TreeViewContext from '../TreeViewContext';\nimport { DnDTreeContext } from './DnDTreeContext';\nimport { DSTreeviewT } from '../react-desc-prop-types';\n\ntype FunctionalHOC = <T = unknown>(Component: React.ComponentType<T>, ...other: unknown[]) => (props: T) => JSX.Element;\n\nexport const withDnDSortableItemContext: FunctionalHOC = (Component) => (props: any) => {\n const { withDragAndDrop } = useContext(TreeViewContext);\n const { dropIndicatorPosition, isDropValid } = useContext(DnDTreeContext);\n\n const id = (props as { item: DSTreeviewT.Item }).item.id.toString();\n\n // onMount generate unique options, so everyting is only ran once\n const draggableOptions = useMemo(\n () => ({\n id,\n }),\n [id],\n );\n\n const useSortableHelpers = useSortable(draggableOptions);\n\n // calculate all the \"useSortable\" values as per required\n const draggableProps = useMemo(() => {\n if (!withDragAndDrop) return false;\n\n const { index, overIndex } = useSortableHelpers;\n\n return {\n ...useSortableHelpers,\n shouldShowDropIndicatorPosition: overIndex === index,\n dropIndicatorPosition,\n isDropValid,\n };\n }, [withDragAndDrop, useSortableHelpers, dropIndicatorPosition, isDropValid]);\n\n // we use a context so we can easly access information wherever without bubbling down\n // this context is all Memoized so as long as component is not re-mounted,\n // the context won't trigger un-required renders per-se...\n const ctx: SortableItemContextType = useMemo(\n () => ({\n draggableProps,\n }),\n [draggableProps],\n );\n // we always add the context, if draggableProps===false we don't have the DnD enabled.\n return (\n <SortableItemContext.Provider value={ctx}>\n <Component {...props} />\n </SortableItemContext.Provider>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AAGA,mBAA2C;AAC3C,8BAA4B;AAC5B,iCAA6D;AAC7D,6BAA4B;AAC5B,4BAA+B;AAKxB,MAAM,6BAA4C,CAAC,cAAc,CAAC,UAAe;AACtF,QAAM,EAAE,gBAAgB,QAAI,yBAAW,uBAAAA,OAAe;AACtD,QAAM,EAAE,uBAAuB,YAAY,QAAI,yBAAW,oCAAc;AAExE,QAAM,KAAM,MAAqC,KAAK,GAAG,SAAS;AAGlE,QAAM,uBAAmB;AAAA,IACvB,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,EAAE;AAAA,EACL;AAEA,QAAM,yBAAqB,qCAAY,gBAAgB;AAGvD,QAAM,qBAAiB,sBAAQ,MAAM;AACnC,QAAI,CAAC;AAAiB,aAAO;AAE7B,UAAM,EAAE,OAAO,UAAU,IAAI;AAE7B,WAAO;AAAA,MACL,GAAG;AAAA,MACH,iCAAiC,cAAc;AAAA,MAC/C;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG,CAAC,iBAAiB,oBAAoB,uBAAuB,WAAW,CAAC;AAK5E,QAAM,UAA+B;AAAA,IACnC,OAAO;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,cAAc;AAAA,EACjB;AAEA,SACE,4CAAC,+CAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,IACnC,sDAAC;AAAA,MAAW,GAAG;AAAA,KAAO;AAAA,GACxB;AAEJ;",
|
|
6
|
+
"names": ["TreeViewContext"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,7 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
22
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
26
|
var src_exports = {};
|
|
24
27
|
__export(src_exports, {
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './TreeView';\nexport * from './plugins';\n\nexport { TreeViewSearchBar } from './related-components/TreeViewSearchBar';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,uBAAd;AACA,wBAAc,sBADd;AAGA,+BAAkC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|