@elliemae/ds-shuttle-v2 3.53.0-next.1 → 3.53.0-next.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-shuttle-v2",
3
- "version": "3.53.0-next.1",
3
+ "version": "3.53.0-next.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Shuttle v2",
6
6
  "files": [
@@ -38,33 +38,33 @@
38
38
  "dependencies": {
39
39
  "fast-deep-equal": "~3.1.3",
40
40
  "uid": "~2.0.1",
41
- "@elliemae/ds-button-v2": "3.53.0-next.1",
42
- "@elliemae/ds-drag-and-drop": "3.53.0-next.1",
43
- "@elliemae/ds-circular-progress-indicator": "3.53.0-next.1",
44
- "@elliemae/ds-form-checkbox": "3.53.0-next.1",
45
- "@elliemae/ds-form-input-text": "3.53.0-next.1",
46
- "@elliemae/ds-fast-list": "3.53.0-next.1",
47
- "@elliemae/ds-grid": "3.53.0-next.1",
48
- "@elliemae/ds-hooks-fontsize-detector": "3.53.0-next.1",
49
- "@elliemae/ds-hooks-on-blur-out": "3.53.0-next.1",
50
- "@elliemae/ds-hooks-headless-tooltip": "3.53.0-next.1",
51
- "@elliemae/ds-icons": "3.53.0-next.1",
52
- "@elliemae/ds-indeterminate-progress-indicator": "3.53.0-next.1",
53
- "@elliemae/ds-popperjs": "3.53.0-next.1",
54
- "@elliemae/ds-props-helpers": "3.53.0-next.1",
55
- "@elliemae/ds-system": "3.53.0-next.1",
56
- "@elliemae/ds-zustand-helpers": "3.53.0-next.1",
57
- "@elliemae/ds-typescript-helpers": "3.53.0-next.1",
58
- "@elliemae/ds-typography": "3.53.0-next.1"
41
+ "@elliemae/ds-button-v2": "3.53.0-next.10",
42
+ "@elliemae/ds-circular-progress-indicator": "3.53.0-next.10",
43
+ "@elliemae/ds-drag-and-drop": "3.53.0-next.10",
44
+ "@elliemae/ds-form-checkbox": "3.53.0-next.10",
45
+ "@elliemae/ds-fast-list": "3.53.0-next.10",
46
+ "@elliemae/ds-form-input-text": "3.53.0-next.10",
47
+ "@elliemae/ds-hooks-fontsize-detector": "3.53.0-next.10",
48
+ "@elliemae/ds-hooks-headless-tooltip": "3.53.0-next.10",
49
+ "@elliemae/ds-grid": "3.53.0-next.10",
50
+ "@elliemae/ds-hooks-on-blur-out": "3.53.0-next.10",
51
+ "@elliemae/ds-indeterminate-progress-indicator": "3.53.0-next.10",
52
+ "@elliemae/ds-icons": "3.53.0-next.10",
53
+ "@elliemae/ds-popperjs": "3.53.0-next.10",
54
+ "@elliemae/ds-props-helpers": "3.53.0-next.10",
55
+ "@elliemae/ds-system": "3.53.0-next.10",
56
+ "@elliemae/ds-typescript-helpers": "3.53.0-next.10",
57
+ "@elliemae/ds-typography": "3.53.0-next.10",
58
+ "@elliemae/ds-zustand-helpers": "3.53.0-next.10"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@elliemae/pui-cli": "9.0.0-next.63",
62
62
  "jest": "~29.7.0",
63
63
  "lodash-es": "^4.17.21",
64
64
  "styled-components": "~5.3.9",
65
- "@elliemae/ds-monorepo-devops": "3.53.0-next.1",
66
- "@elliemae/ds-breadcrumb": "3.53.0-next.1",
67
- "@elliemae/ds-tree-model": "3.53.0-next.1"
65
+ "@elliemae/ds-breadcrumb": "3.53.0-next.10",
66
+ "@elliemae/ds-monorepo-devops": "3.53.0-next.10",
67
+ "@elliemae/ds-tree-model": "3.53.0-next.10"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "lodash-es": "^4.17.21",
@@ -1,164 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var basic_exports = {};
30
- __export(basic_exports, {
31
- BreadCrumbHoc: () => BreadCrumbHoc,
32
- useShuttle: () => useShuttle
33
- });
34
- module.exports = __toCommonJS(basic_exports);
35
- var React = __toESM(require("react"));
36
- var import_jsx_runtime = require("react/jsx-runtime");
37
- var import_react = __toESM(require("react"));
38
- var import_ds_breadcrumb = require("@elliemae/ds-breadcrumb");
39
- var import_ds_tree_model = require("@elliemae/ds-tree-model");
40
- var import_uid = require("uid");
41
- const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
42
- const node = {
43
- id: (0, import_uid.uid)(),
44
- label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
45
- parent: parent ? parent.id : null
46
- };
47
- if (depth <= finalDepth) {
48
- node.subitems = Array.from(
49
- { length: 2 },
50
- (_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
51
- );
52
- }
53
- return node;
54
- };
55
- const options = {
56
- getUniqueId: (item) => item.id
57
- };
58
- const startingSourceData = genTreeOfData({ prefix: "Source" });
59
- const startingDestinationData = genTreeOfData({ prefix: "Destination" });
60
- const BreadCrumb = (props) => {
61
- const { breadCrumbPath, setCurrentNode, ...rest } = props;
62
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_breadcrumb.DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
- import_ds_breadcrumb.DSBreadcrumb.Item,
64
- {
65
- label: node.plainItem.label,
66
- onClick: () => setCurrentNode(node),
67
- dataTestId: "amigo"
68
- },
69
- `${node.dsId}`
70
- )) });
71
- };
72
- const BreadCrumbHoc = ({ path, setCurrentNode }) => {
73
- const WrappedBreadCrumb = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
74
- return WrappedBreadCrumb;
75
- };
76
- const useListData = (startingData) => {
77
- const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = (0, import_ds_tree_model.useDSTree)(startingData, options);
78
- const [currentNode, setCurrentNode] = (0, import_react.useState)(getRoot());
79
- const [selection, setSelection] = (0, import_react.useState)({});
80
- const breadcrumbPath = (0, import_react.useMemo)(() => getPath(currentNode.dsId), [currentNode, getPath]);
81
- const displayedData = (0, import_react.useMemo)(
82
- () => currentNode.children.map((node) => node.getJson()),
83
- // eslint-disable-next-line react-hooks/exhaustive-deps
84
- [currentNode, hash]
85
- );
86
- const onDrilldown = (0, import_react.useCallback)((item) => setCurrentNode(getNode(item.id)), [getNode]);
87
- return (0, import_react.useMemo)(
88
- () => ({
89
- getNode,
90
- addNode,
91
- replaceNode,
92
- removeNode,
93
- currentNode,
94
- setCurrentNode,
95
- selection,
96
- setSelection,
97
- breadcrumbPath,
98
- displayedData,
99
- onDrilldown
100
- }),
101
- [addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection]
102
- );
103
- };
104
- const useShuttle = () => {
105
- const {
106
- currentNode: currentSourceNode,
107
- setCurrentNode: setCurrentSourceNode,
108
- selection: sourceSelection,
109
- setSelection: setSourceSelection,
110
- breadcrumbPath: sourceBreadCrumbPath,
111
- displayedData: sourceDisplayedData,
112
- onDrilldown: onSourceDrilldown,
113
- addNode: addSourceNode,
114
- removeNode: removeSourceNode
115
- } = useListData(startingSourceData);
116
- const {
117
- currentNode: currentDestinationNode,
118
- setCurrentNode: setCurrentDestinationNode,
119
- selection: destinationSelection,
120
- setSelection: setDestinationSelection,
121
- breadcrumbPath: destinationBreadCrumbPath,
122
- displayedData: destinationDisplayedData,
123
- onDrilldown: onDestinationDrilldown,
124
- addNode: addDestinationNode,
125
- removeNode: removeDestinationNode
126
- } = useListData(startingDestinationData);
127
- const onSourceAdd = (0, import_react.useCallback)(
128
- (items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),
129
- [addSourceNode, currentSourceNode]
130
- );
131
- const onSourceRemove = (0, import_react.useCallback)(
132
- (items) => items.forEach((item) => removeSourceNode(item.id, item)),
133
- [removeSourceNode]
134
- );
135
- const onDestinationAdd = (0, import_react.useCallback)(
136
- (items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),
137
- [addDestinationNode, currentDestinationNode]
138
- );
139
- const onDestinationRemove = (0, import_react.useCallback)(
140
- (items) => items.forEach((item) => removeDestinationNode(item.id)),
141
- [removeDestinationNode]
142
- );
143
- return {
144
- setCurrentSourceNode,
145
- setCurrentDestinationNode,
146
- sourceDisplayedData,
147
- destinationDisplayedData,
148
- sourceSelection,
149
- destinationSelection,
150
- setSourceSelection,
151
- setDestinationSelection,
152
- onSourceDrilldown,
153
- onDestinationDrilldown,
154
- onSourceAdd,
155
- onSourceRemove,
156
- onDestinationAdd,
157
- onDestinationRemove,
158
- sourceBreadCrumbPath,
159
- destinationBreadCrumbPath,
160
- currentSourceNode,
161
- currentDestinationNode
162
- };
163
- };
164
- //# sourceMappingURL=basic.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/tests/configs/basic.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item\n key={`${node.dsId}`}\n label={node.plainItem.label}\n onClick={() => setCurrentNode(node)}\n dataTestId=\"amigo\"\n />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return useMemo(\n () => ({\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n\n breadcrumbPath,\n displayedData,\n onDrilldown,\n }),\n [addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection],\n );\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),\n [addSourceNode, currentSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),\n [addDestinationNode, currentDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCf;AAjCR,mBAAsD;AACtD,2BAA6B;AAC7B,2BAA0B;AAC1B,iBAAoB;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,QAAI,gBAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,MAAM;AAAA,IAC3D,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,UAAU;AAAA,EACd,aAAa,CAAC,SAAS,KAAK;AAC9B;AAEA,MAAM,qBAAqB,cAAc,EAAE,QAAQ,SAAS,CAAC;AAC7D,MAAM,0BAA0B,cAAc,EAAE,QAAQ,cAAc,CAAC;AAEvE,MAAM,aAAa,CAAC,UAAU;AAC5B,QAAM,EAAE,gBAAgB,gBAAgB,GAAG,KAAK,IAAI;AAEpD,SACE,4CAAC,qCAAa,SAAO,MAAE,GAAG,MACvB,yBAAe,IAAI,CAAC,SACnB;AAAA,IAAC,kCAAa;AAAA,IAAb;AAAA,MAEC,OAAO,KAAK,UAAU;AAAA,MACtB,SAAS,MAAM,eAAe,IAAI;AAAA,MAClC,YAAW;AAAA;AAAA,IAHN,GAAG,KAAK,IAAI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Aa;AAAA,IACb,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,aAAa;AAAA,IACb,SAAS;AAAA,IACT,YAAY;AAAA,EACd,IAAI,YAAY,uBAAuB;AAEvC,QAAM,kBAAc;AAAA,IAClB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,cAAc,MAAM,EAAE,QAAQ,kBAAkB,CAAC,CAAC;AAAA,IACrF,CAAC,eAAe,iBAAiB;AAAA,EACnC;AAEA,QAAM,qBAAiB;AAAA,IACrB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,iBAAiB,KAAK,IAAI,IAAI,CAAC;AAAA,IAClE,CAAC,gBAAgB;AAAA,EACnB;AAEA,QAAM,uBAAmB;AAAA,IACvB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,mBAAmB,MAAM,EAAE,QAAQ,uBAAuB,CAAC,CAAC;AAAA,IAC/F,CAAC,oBAAoB,sBAAsB;AAAA,EAC7C;AAEA,QAAM,0BAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,199 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var filter_exports = {};
30
- __export(filter_exports, {
31
- BreadCrumbHoc: () => BreadCrumbHoc,
32
- useShuttle: () => useShuttle
33
- });
34
- module.exports = __toCommonJS(filter_exports);
35
- var React = __toESM(require("react"));
36
- var import_jsx_runtime = require("react/jsx-runtime");
37
- var import_react = __toESM(require("react"));
38
- var import_ds_breadcrumb = require("@elliemae/ds-breadcrumb");
39
- var import_ds_tree_model = require("@elliemae/ds-tree-model");
40
- var import_uid = require("uid");
41
- const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
42
- const node = {
43
- id: (0, import_uid.uid)(),
44
- label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
45
- parent: parent ? parent.id : null
46
- };
47
- if (depth <= finalDepth) {
48
- node.subitems = Array.from(
49
- { length: 2 },
50
- (_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
51
- );
52
- }
53
- return node;
54
- };
55
- const options = {
56
- getUniqueId: (item) => item.id
57
- };
58
- const startingSourceData = genTreeOfData({ prefix: "Source" });
59
- const startingDestinationData = genTreeOfData({ prefix: "Destination" });
60
- const matcheslenientStringSearch = (filter, str) => {
61
- const regexpString = `[\\s\\S]*${filter.replace(/\s/g, "").split("").join("[\\s\\S]*")}[\\s\\S]*`;
62
- const regexpFilter = new RegExp(regexpString);
63
- return regexpFilter.test(str);
64
- };
65
- const BreadCrumb = (props) => {
66
- const { breadCrumbPath, setCurrentNode, ...rest } = props;
67
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_breadcrumb.DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_breadcrumb.DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
68
- };
69
- const BreadCrumbHoc = ({ path, setCurrentNode }) => {
70
- const WrappedBreadCrumb = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
71
- return WrappedBreadCrumb;
72
- };
73
- const useListData = (startingData) => {
74
- const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = (0, import_ds_tree_model.useDSTree)(startingData, options);
75
- const [currentNode, setCurrentNode] = (0, import_react.useState)(getRoot());
76
- const [filterValue, setFilterValue] = (0, import_react.useState)("");
77
- const [selection, setSelection] = (0, import_react.useState)({});
78
- const breadcrumbPath = (0, import_react.useMemo)(() => getPath(currentNode.dsId), [currentNode, getPath]);
79
- const displayedData = (0, import_react.useMemo)(
80
- () => currentNode.children.map((node) => node.getJson()).filter((item) => matcheslenientStringSearch(filterValue, item.label)),
81
- // eslint-disable-next-line react-hooks/exhaustive-deps
82
- [currentNode, hash, filterValue]
83
- );
84
- const onDrilldown = (0, import_react.useCallback)((item) => setCurrentNode(getNode(item.id)), [getNode]);
85
- return {
86
- getNode,
87
- addNode,
88
- replaceNode,
89
- removeNode,
90
- currentNode,
91
- setCurrentNode,
92
- selection,
93
- setSelection,
94
- filterValue,
95
- setFilterValue,
96
- breadcrumbPath,
97
- displayedData,
98
- onDrilldown
99
- };
100
- };
101
- const useShuttle = () => {
102
- const {
103
- currentNode: currentSourceNode,
104
- setCurrentNode: setCurrentSourceNode,
105
- selection: sourceSelection,
106
- setSelection: setSourceSelection,
107
- breadcrumbPath: sourceBreadCrumbPath,
108
- displayedData: sourceDisplayedData,
109
- filterValue: sourceFilterValue,
110
- setFilterValue: setSourceFilterValue,
111
- onDrilldown: onSourceDrilldown,
112
- getNode: getSourceNode,
113
- addNode: addSourceNode,
114
- removeNode: removeSourceNode
115
- } = useListData(startingSourceData);
116
- const {
117
- currentNode: currentDestinationNode,
118
- setCurrentNode: setCurrentDestinationNode,
119
- selection: destinationSelection,
120
- setSelection: setDestinationSelection,
121
- breadcrumbPath: destinationBreadCrumbPath,
122
- displayedData: destinationDisplayedData,
123
- filterValue: destinationFilterValue,
124
- setFilterValue: setDestinationFilterValue,
125
- onDrilldown: onDestinationDrilldown,
126
- getNode: getDestinationNode,
127
- addNode: addDestinationNode,
128
- removeNode: removeDestinationNode
129
- } = useListData(startingDestinationData);
130
- const onSourceAdd = (0, import_react.useCallback)(
131
- (items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
132
- [addSourceNode, currentSourceNode, getSourceNode]
133
- );
134
- const onSourceRemove = (0, import_react.useCallback)(
135
- (items) => items.forEach((item) => removeSourceNode(item.id, item)),
136
- [removeSourceNode]
137
- );
138
- const onDestinationAdd = (0, import_react.useCallback)(
139
- (items) => items.forEach(
140
- (item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
141
- ),
142
- [addDestinationNode, currentDestinationNode, getDestinationNode]
143
- );
144
- const onDestinationRemove = (0, import_react.useCallback)(
145
- (items) => items.forEach((item) => removeDestinationNode(item.id)),
146
- [removeDestinationNode]
147
- );
148
- return (0, import_react.useMemo)(
149
- () => ({
150
- setCurrentSourceNode,
151
- setCurrentDestinationNode,
152
- sourceDisplayedData,
153
- destinationDisplayedData,
154
- sourceSelection,
155
- destinationSelection,
156
- setSourceSelection,
157
- setDestinationSelection,
158
- sourceFilterValue,
159
- destinationFilterValue,
160
- setSourceFilterValue,
161
- setDestinationFilterValue,
162
- onSourceDrilldown,
163
- onDestinationDrilldown,
164
- onSourceAdd,
165
- onSourceRemove,
166
- onDestinationAdd,
167
- onDestinationRemove,
168
- sourceBreadCrumbPath,
169
- destinationBreadCrumbPath,
170
- currentSourceNode,
171
- currentDestinationNode
172
- }),
173
- [
174
- setCurrentSourceNode,
175
- setCurrentDestinationNode,
176
- sourceDisplayedData,
177
- destinationDisplayedData,
178
- sourceSelection,
179
- destinationSelection,
180
- setSourceSelection,
181
- setDestinationSelection,
182
- sourceFilterValue,
183
- destinationFilterValue,
184
- setSourceFilterValue,
185
- setDestinationFilterValue,
186
- onSourceDrilldown,
187
- onDestinationDrilldown,
188
- onSourceAdd,
189
- onSourceRemove,
190
- onDestinationAdd,
191
- onDestinationRemove,
192
- sourceBreadCrumbPath,
193
- destinationBreadCrumbPath,
194
- currentSourceNode,
195
- currentDestinationNode
196
- ]
197
- );
198
- };
199
- //# sourceMappingURL=filter.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/tests/configs/filter.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst matcheslenientStringSearch = (filter, str) => {\n const regexpString = `[\\\\s\\\\S]*${filter.replace(/\\s/g, '').split('').join('[\\\\s\\\\S]*')}[\\\\s\\\\S]*`;\n const regexpFilter = new RegExp(regexpString);\n return regexpFilter.test(str);\n};\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [filterValue, setFilterValue] = useState('');\n\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () =>\n currentNode.children\n .map((node) => node.getJson())\n .filter((item) => matcheslenientStringSearch(filterValue, item.label)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash, filterValue],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n filterValue,\n setFilterValue,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n filterValue: sourceFilterValue,\n setFilterValue: setSourceFilterValue,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n filterValue: destinationFilterValue,\n setFilterValue: setDestinationFilterValue,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return useMemo(\n () => ({\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n }),\n [\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwCf;AAvCR,mBAAsD;AACtD,2BAA6B;AAC7B,2BAA0B;AAC1B,iBAAoB;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,QAAI,gBAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,MAAM;AAAA,IAC3D,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,UAAU;AAAA,EACd,aAAa,CAAC,SAAS,KAAK;AAC9B;AAEA,MAAM,qBAAqB,cAAc,EAAE,QAAQ,SAAS,CAAC;AAC7D,MAAM,0BAA0B,cAAc,EAAE,QAAQ,cAAc,CAAC;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,KAAK,uBAAuB,CAAC;AAAA,IAChG;AAAA,IACF,CAAC,oBAAoB,wBAAwB,kBAAkB;AAAA,EACjE;AAEA,QAAM,0BAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;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,MAEA;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,MACA;AAAA,MAEA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,179 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var loadMore_exports = {};
30
- __export(loadMore_exports, {
31
- BreadCrumbHoc: () => BreadCrumbHoc,
32
- useShuttle: () => useShuttle
33
- });
34
- module.exports = __toCommonJS(loadMore_exports);
35
- var React = __toESM(require("react"));
36
- var import_jsx_runtime = require("react/jsx-runtime");
37
- var import_react = __toESM(require("react"));
38
- var import_ds_breadcrumb = require("@elliemae/ds-breadcrumb");
39
- var import_ds_tree_model = require("@elliemae/ds-tree-model");
40
- var import_uid = require("uid");
41
- const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
42
- const node = {
43
- id: (0, import_uid.uid)(),
44
- label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
45
- parent: parent ? parent.id : null
46
- };
47
- if (depth <= finalDepth) {
48
- node.subitems = Array.from(
49
- { length: 2 },
50
- (_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
51
- );
52
- }
53
- return node;
54
- };
55
- const options = {
56
- getUniqueId: (item) => item.id
57
- };
58
- const startingSourceData = genTreeOfData({ prefix: "Source" });
59
- const startingDestinationData = genTreeOfData({ prefix: "Destination" });
60
- const BreadCrumb = (props) => {
61
- const { breadCrumbPath, setCurrentNode, ...rest } = props;
62
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_breadcrumb.DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_breadcrumb.DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
63
- };
64
- const BreadCrumbHoc = ({ path, setCurrentNode }) => {
65
- const WrappedBreadCrumb = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
66
- return WrappedBreadCrumb;
67
- };
68
- const useListData = (startingData) => {
69
- const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = (0, import_ds_tree_model.useDSTree)(startingData, options);
70
- const [currentNode, setCurrentNode] = (0, import_react.useState)(getRoot());
71
- const [selection, setSelection] = (0, import_react.useState)({});
72
- const [isLoadingMore, setIsLoadingMore] = (0, import_react.useState)(false);
73
- const breadcrumbPath = (0, import_react.useMemo)(() => getPath(currentNode.dsId), [currentNode, getPath]);
74
- const displayedData = (0, import_react.useMemo)(
75
- () => currentNode.children.map((node) => node.getJson()),
76
- // eslint-disable-next-line react-hooks/exhaustive-deps
77
- [currentNode, hash]
78
- );
79
- const onDrilldown = (0, import_react.useCallback)((item) => setCurrentNode(getNode(item.id)), [getNode]);
80
- const onLoadMore = (0, import_react.useCallback)(() => {
81
- setIsLoadingMore(true);
82
- setTimeout(() => {
83
- const newChildren = Array.from(
84
- { length: 1 },
85
- (_, i) => genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i })
86
- );
87
- newChildren.forEach((child) => addNode(child, { parent: currentNode }));
88
- setIsLoadingMore(false);
89
- }, 1e3);
90
- }, [addNode, currentNode]);
91
- return {
92
- getNode,
93
- addNode,
94
- replaceNode,
95
- removeNode,
96
- currentNode,
97
- setCurrentNode,
98
- selection,
99
- setSelection,
100
- isLoadingMore,
101
- onLoadMore,
102
- breadcrumbPath,
103
- displayedData,
104
- onDrilldown
105
- };
106
- };
107
- const useShuttle = () => {
108
- const {
109
- currentNode: currentSourceNode,
110
- setCurrentNode: setCurrentSourceNode,
111
- selection: sourceSelection,
112
- setSelection: setSourceSelection,
113
- breadcrumbPath: sourceBreadCrumbPath,
114
- displayedData: sourceDisplayedData,
115
- onDrilldown: onSourceDrilldown,
116
- getNode: getSourceNode,
117
- addNode: addSourceNode,
118
- removeNode: removeSourceNode,
119
- isLoadingMore: isSourceLoadingMore,
120
- onLoadMore: onLoadMoreSource
121
- } = useListData(startingSourceData, "S");
122
- const {
123
- currentNode: currentDestinationNode,
124
- setCurrentNode: setCurrentDestinationNode,
125
- selection: destinationSelection,
126
- setSelection: setDestinationSelection,
127
- breadcrumbPath: destinationBreadCrumbPath,
128
- displayedData: destinationDisplayedData,
129
- onDrilldown: onDestinationDrilldown,
130
- getNode: getDestinationNode,
131
- addNode: addDestinationNode,
132
- removeNode: removeDestinationNode,
133
- isLoadingMore: isDestinationLoadingMore,
134
- onLoadMore: onLoadMoreDestination
135
- } = useListData(startingDestinationData, "D");
136
- const onSourceAdd = (0, import_react.useCallback)(
137
- (items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
138
- [addSourceNode, currentSourceNode, getSourceNode]
139
- );
140
- const onSourceRemove = (0, import_react.useCallback)(
141
- (items) => items.forEach((item) => removeSourceNode(item.id, item)),
142
- [removeSourceNode]
143
- );
144
- const onDestinationAdd = (0, import_react.useCallback)(
145
- (items) => items.forEach(
146
- (item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
147
- ),
148
- [addDestinationNode, currentDestinationNode, getDestinationNode]
149
- );
150
- const onDestinationRemove = (0, import_react.useCallback)(
151
- (items) => items.forEach((item) => removeDestinationNode(item.id)),
152
- [removeDestinationNode]
153
- );
154
- return {
155
- setCurrentSourceNode,
156
- setCurrentDestinationNode,
157
- sourceDisplayedData,
158
- destinationDisplayedData,
159
- sourceSelection,
160
- destinationSelection,
161
- setSourceSelection,
162
- setDestinationSelection,
163
- onSourceDrilldown,
164
- onDestinationDrilldown,
165
- onSourceAdd,
166
- onSourceRemove,
167
- onDestinationAdd,
168
- onDestinationRemove,
169
- sourceBreadCrumbPath,
170
- destinationBreadCrumbPath,
171
- isSourceLoadingMore,
172
- onLoadMoreSource,
173
- isDestinationLoadingMore,
174
- onLoadMoreDestination,
175
- currentSourceNode,
176
- currentDestinationNode
177
- };
178
- };
179
- //# sourceMappingURL=loadMore.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/tests/configs/loadMore.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n const onLoadMore = useCallback(() => {\n setIsLoadingMore(true);\n setTimeout(() => {\n const newChildren = Array.from({ length: 1 }, (_, i) =>\n genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i }),\n );\n newChildren.forEach((child) => addNode(child, { parent: currentNode }));\n setIsLoadingMore(false);\n }, 1000);\n }, [addNode, currentNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n isLoadingMore,\n onLoadMore,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n isLoadingMore: isSourceLoadingMore,\n onLoadMore: onLoadMoreSource,\n } = useListData(startingSourceData, 'S');\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n isLoadingMore: isDestinationLoadingMore,\n onLoadMore: onLoadMoreDestination,\n } = useListData(startingDestinationData, 'D');\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n isSourceLoadingMore,\n onLoadMoreSource,\n isDestinationLoadingMore,\n onLoadMoreDestination,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCf;AAjCR,mBAAsD;AACtD,2BAA6B;AAC7B,2BAA0B;AAC1B,iBAAoB;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,QAAI,gBAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,MAAM;AAAA,IAC3D,QAA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,SAAS;AAAA,IACT,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,YAAY;AAAA,EACd,IAAI,YAAY,yBAAyB,GAAG;AAE5C,QAAM,kBAAc;AAAA,IAClB,CAAC,UACC,MAAM,QAAQ,CAAC,SAAS,cAAc,MAAM,EAAE,QAAQ,cAAc,KAAK,MAAM,KAAK,kBAAkB,CAAC,CAAC;AAAA,IAC1G,CAAC,eAAe,mBAAmB,aAAa;AAAA,EAClD;AAEA,QAAM,qBAAiB;AAAA,IACrB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,iBAAiB,KAAK,IAAI,IAAI,CAAC;AAAA,IAClE,CAAC,gBAAgB;AAAA,EACnB;AAEA,QAAM,uBAAmB;AAAA,IACvB,CAAC,UACC,MAAM;AAAA,MAAQ,CAAC,SACb,mBAAmB,MAAM,EAAE,QAAQ,mBAAmB,KAAK,MAAM,KAAK,uBAAuB,CAAC;AAAA,IAChG;AAAA,IACF,CAAC,oBAAoB,wBAAwB,kBAAkB;AAAA,EACjE;AAEA,QAAM,0BAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
6
- "names": []
7
- }
@@ -1,134 +0,0 @@
1
- import * as React from "react";
2
- import { jsx } from "react/jsx-runtime";
3
- import React2, { useMemo, useState, useCallback } from "react";
4
- import { DSBreadcrumb } from "@elliemae/ds-breadcrumb";
5
- import { useDSTree } from "@elliemae/ds-tree-model";
6
- import { uid } from "uid";
7
- const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
8
- const node = {
9
- id: uid(),
10
- label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
11
- parent: parent ? parent.id : null
12
- };
13
- if (depth <= finalDepth) {
14
- node.subitems = Array.from(
15
- { length: 2 },
16
- (_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
17
- );
18
- }
19
- return node;
20
- };
21
- const options = {
22
- getUniqueId: (item) => item.id
23
- };
24
- const startingSourceData = genTreeOfData({ prefix: "Source" });
25
- const startingDestinationData = genTreeOfData({ prefix: "Destination" });
26
- const BreadCrumb = (props) => {
27
- const { breadCrumbPath, setCurrentNode, ...rest } = props;
28
- return /* @__PURE__ */ jsx(DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ jsx(
29
- DSBreadcrumb.Item,
30
- {
31
- label: node.plainItem.label,
32
- onClick: () => setCurrentNode(node),
33
- dataTestId: "amigo"
34
- },
35
- `${node.dsId}`
36
- )) });
37
- };
38
- const BreadCrumbHoc = ({ path, setCurrentNode }) => {
39
- const WrappedBreadCrumb = (props) => /* @__PURE__ */ jsx(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
40
- return WrappedBreadCrumb;
41
- };
42
- const useListData = (startingData) => {
43
- const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);
44
- const [currentNode, setCurrentNode] = useState(getRoot());
45
- const [selection, setSelection] = useState({});
46
- const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
47
- const displayedData = useMemo(
48
- () => currentNode.children.map((node) => node.getJson()),
49
- // eslint-disable-next-line react-hooks/exhaustive-deps
50
- [currentNode, hash]
51
- );
52
- const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
53
- return useMemo(
54
- () => ({
55
- getNode,
56
- addNode,
57
- replaceNode,
58
- removeNode,
59
- currentNode,
60
- setCurrentNode,
61
- selection,
62
- setSelection,
63
- breadcrumbPath,
64
- displayedData,
65
- onDrilldown
66
- }),
67
- [addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection]
68
- );
69
- };
70
- const useShuttle = () => {
71
- const {
72
- currentNode: currentSourceNode,
73
- setCurrentNode: setCurrentSourceNode,
74
- selection: sourceSelection,
75
- setSelection: setSourceSelection,
76
- breadcrumbPath: sourceBreadCrumbPath,
77
- displayedData: sourceDisplayedData,
78
- onDrilldown: onSourceDrilldown,
79
- addNode: addSourceNode,
80
- removeNode: removeSourceNode
81
- } = useListData(startingSourceData);
82
- const {
83
- currentNode: currentDestinationNode,
84
- setCurrentNode: setCurrentDestinationNode,
85
- selection: destinationSelection,
86
- setSelection: setDestinationSelection,
87
- breadcrumbPath: destinationBreadCrumbPath,
88
- displayedData: destinationDisplayedData,
89
- onDrilldown: onDestinationDrilldown,
90
- addNode: addDestinationNode,
91
- removeNode: removeDestinationNode
92
- } = useListData(startingDestinationData);
93
- const onSourceAdd = useCallback(
94
- (items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),
95
- [addSourceNode, currentSourceNode]
96
- );
97
- const onSourceRemove = useCallback(
98
- (items) => items.forEach((item) => removeSourceNode(item.id, item)),
99
- [removeSourceNode]
100
- );
101
- const onDestinationAdd = useCallback(
102
- (items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),
103
- [addDestinationNode, currentDestinationNode]
104
- );
105
- const onDestinationRemove = useCallback(
106
- (items) => items.forEach((item) => removeDestinationNode(item.id)),
107
- [removeDestinationNode]
108
- );
109
- return {
110
- setCurrentSourceNode,
111
- setCurrentDestinationNode,
112
- sourceDisplayedData,
113
- destinationDisplayedData,
114
- sourceSelection,
115
- destinationSelection,
116
- setSourceSelection,
117
- setDestinationSelection,
118
- onSourceDrilldown,
119
- onDestinationDrilldown,
120
- onSourceAdd,
121
- onSourceRemove,
122
- onDestinationAdd,
123
- onDestinationRemove,
124
- sourceBreadCrumbPath,
125
- destinationBreadCrumbPath,
126
- currentSourceNode,
127
- currentDestinationNode
128
- };
129
- };
130
- export {
131
- BreadCrumbHoc,
132
- useShuttle
133
- };
134
- //# sourceMappingURL=basic.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/basic.js"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item\n key={`${node.dsId}`}\n label={node.plainItem.label}\n onClick={() => setCurrentNode(node)}\n dataTestId=\"amigo\"\n />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return useMemo(\n () => ({\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n\n breadcrumbPath,\n displayedData,\n onDrilldown,\n }),\n [addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection],\n );\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),\n [addSourceNode, currentSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),\n [addDestinationNode, currentDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkCf;AAjCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,MAAM;AAAA,IAC3D,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,UAAU;AAAA,EACd,aAAa,CAAC,SAAS,KAAK;AAC9B;AAEA,MAAM,qBAAqB,cAAc,EAAE,QAAQ,SAAS,CAAC;AAC7D,MAAM,0BAA0B,cAAc,EAAE,QAAQ,cAAc,CAAC;AAEvE,MAAM,aAAa,CAAC,UAAU;AAC5B,QAAM,EAAE,gBAAgB,gBAAgB,GAAG,KAAK,IAAI;AAEpD,SACE,oBAAC,gBAAa,S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@@
1
- import * as React from "react";
2
- import { jsx } from "react/jsx-runtime";
3
- import React2, { useMemo, useState, useCallback } from "react";
4
- import { DSBreadcrumb } from "@elliemae/ds-breadcrumb";
5
- import { useDSTree } from "@elliemae/ds-tree-model";
6
- import { uid } from "uid";
7
- const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
8
- const node = {
9
- id: uid(),
10
- label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
11
- parent: parent ? parent.id : null
12
- };
13
- if (depth <= finalDepth) {
14
- node.subitems = Array.from(
15
- { length: 2 },
16
- (_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
17
- );
18
- }
19
- return node;
20
- };
21
- const options = {
22
- getUniqueId: (item) => item.id
23
- };
24
- const startingSourceData = genTreeOfData({ prefix: "Source" });
25
- const startingDestinationData = genTreeOfData({ prefix: "Destination" });
26
- const matcheslenientStringSearch = (filter, str) => {
27
- const regexpString = `[\\s\\S]*${filter.replace(/\s/g, "").split("").join("[\\s\\S]*")}[\\s\\S]*`;
28
- const regexpFilter = new RegExp(regexpString);
29
- return regexpFilter.test(str);
30
- };
31
- const BreadCrumb = (props) => {
32
- const { breadCrumbPath, setCurrentNode, ...rest } = props;
33
- return /* @__PURE__ */ jsx(DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ jsx(DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
34
- };
35
- const BreadCrumbHoc = ({ path, setCurrentNode }) => {
36
- const WrappedBreadCrumb = (props) => /* @__PURE__ */ jsx(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
37
- return WrappedBreadCrumb;
38
- };
39
- const useListData = (startingData) => {
40
- const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);
41
- const [currentNode, setCurrentNode] = useState(getRoot());
42
- const [filterValue, setFilterValue] = useState("");
43
- const [selection, setSelection] = useState({});
44
- const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
45
- const displayedData = useMemo(
46
- () => currentNode.children.map((node) => node.getJson()).filter((item) => matcheslenientStringSearch(filterValue, item.label)),
47
- // eslint-disable-next-line react-hooks/exhaustive-deps
48
- [currentNode, hash, filterValue]
49
- );
50
- const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
51
- return {
52
- getNode,
53
- addNode,
54
- replaceNode,
55
- removeNode,
56
- currentNode,
57
- setCurrentNode,
58
- selection,
59
- setSelection,
60
- filterValue,
61
- setFilterValue,
62
- breadcrumbPath,
63
- displayedData,
64
- onDrilldown
65
- };
66
- };
67
- const useShuttle = () => {
68
- const {
69
- currentNode: currentSourceNode,
70
- setCurrentNode: setCurrentSourceNode,
71
- selection: sourceSelection,
72
- setSelection: setSourceSelection,
73
- breadcrumbPath: sourceBreadCrumbPath,
74
- displayedData: sourceDisplayedData,
75
- filterValue: sourceFilterValue,
76
- setFilterValue: setSourceFilterValue,
77
- onDrilldown: onSourceDrilldown,
78
- getNode: getSourceNode,
79
- addNode: addSourceNode,
80
- removeNode: removeSourceNode
81
- } = useListData(startingSourceData);
82
- const {
83
- currentNode: currentDestinationNode,
84
- setCurrentNode: setCurrentDestinationNode,
85
- selection: destinationSelection,
86
- setSelection: setDestinationSelection,
87
- breadcrumbPath: destinationBreadCrumbPath,
88
- displayedData: destinationDisplayedData,
89
- filterValue: destinationFilterValue,
90
- setFilterValue: setDestinationFilterValue,
91
- onDrilldown: onDestinationDrilldown,
92
- getNode: getDestinationNode,
93
- addNode: addDestinationNode,
94
- removeNode: removeDestinationNode
95
- } = useListData(startingDestinationData);
96
- const onSourceAdd = useCallback(
97
- (items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
98
- [addSourceNode, currentSourceNode, getSourceNode]
99
- );
100
- const onSourceRemove = useCallback(
101
- (items) => items.forEach((item) => removeSourceNode(item.id, item)),
102
- [removeSourceNode]
103
- );
104
- const onDestinationAdd = useCallback(
105
- (items) => items.forEach(
106
- (item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
107
- ),
108
- [addDestinationNode, currentDestinationNode, getDestinationNode]
109
- );
110
- const onDestinationRemove = useCallback(
111
- (items) => items.forEach((item) => removeDestinationNode(item.id)),
112
- [removeDestinationNode]
113
- );
114
- return useMemo(
115
- () => ({
116
- setCurrentSourceNode,
117
- setCurrentDestinationNode,
118
- sourceDisplayedData,
119
- destinationDisplayedData,
120
- sourceSelection,
121
- destinationSelection,
122
- setSourceSelection,
123
- setDestinationSelection,
124
- sourceFilterValue,
125
- destinationFilterValue,
126
- setSourceFilterValue,
127
- setDestinationFilterValue,
128
- onSourceDrilldown,
129
- onDestinationDrilldown,
130
- onSourceAdd,
131
- onSourceRemove,
132
- onDestinationAdd,
133
- onDestinationRemove,
134
- sourceBreadCrumbPath,
135
- destinationBreadCrumbPath,
136
- currentSourceNode,
137
- currentDestinationNode
138
- }),
139
- [
140
- setCurrentSourceNode,
141
- setCurrentDestinationNode,
142
- sourceDisplayedData,
143
- destinationDisplayedData,
144
- sourceSelection,
145
- destinationSelection,
146
- setSourceSelection,
147
- setDestinationSelection,
148
- sourceFilterValue,
149
- destinationFilterValue,
150
- setSourceFilterValue,
151
- setDestinationFilterValue,
152
- onSourceDrilldown,
153
- onDestinationDrilldown,
154
- onSourceAdd,
155
- onSourceRemove,
156
- onDestinationAdd,
157
- onDestinationRemove,
158
- sourceBreadCrumbPath,
159
- destinationBreadCrumbPath,
160
- currentSourceNode,
161
- currentDestinationNode
162
- ]
163
- );
164
- };
165
- export {
166
- BreadCrumbHoc,
167
- useShuttle
168
- };
169
- //# sourceMappingURL=filter.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/filter.js"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst matcheslenientStringSearch = (filter, str) => {\n const regexpString = `[\\\\s\\\\S]*${filter.replace(/\\s/g, '').split('').join('[\\\\s\\\\S]*')}[\\\\s\\\\S]*`;\n const regexpFilter = new RegExp(regexpString);\n return regexpFilter.test(str);\n};\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [filterValue, setFilterValue] = useState('');\n\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () =>\n currentNode.children\n .map((node) => node.getJson())\n .filter((item) => matcheslenientStringSearch(filterValue, item.label)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash, filterValue],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n filterValue,\n setFilterValue,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n filterValue: sourceFilterValue,\n setFilterValue: setSourceFilterValue,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n filterValue: destinationFilterValue,\n setFilterValue: setDestinationFilterValue,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return useMemo(\n () => ({\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n }),\n [\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n ],\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACwCf;AAvCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,MAAM;AAAA,IAC3D,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MA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Ae,mBAAmB,aAAa;AAAA,EAClD;AAEA,QAAM,iBAAiB;AAAA,IACrB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,iBAAiB,KAAK,IAAI,IAAI,CAAC;AAAA,IAClE,CAAC,gBAAgB;AAAA,EACnB;AAEA,QAAM,mBAAmB;AAAA,IACvB,CAAC,UACC,MAAM;AAAA,MAAQ,CAAC,SACb,mBAAmB,MAAM,EAAE,QAAQ,mBAAmB,KAAK,MAAM,KAAK,uBAAuB,CAAC;AAAA,IAChG;AAAA,IACF,CAAC,oBAAoB,wBAAwB,kBAAkB;AAAA,EACjE;AAEA,QAAM,sBAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;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,MAEA;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,MACA;AAAA,MAEA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
- "names": ["React"]
7
- }
@@ -1,149 +0,0 @@
1
- import * as React from "react";
2
- import { jsx } from "react/jsx-runtime";
3
- import React2, { useMemo, useState, useCallback } from "react";
4
- import { DSBreadcrumb } from "@elliemae/ds-breadcrumb";
5
- import { useDSTree } from "@elliemae/ds-tree-model";
6
- import { uid } from "uid";
7
- const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
8
- const node = {
9
- id: uid(),
10
- label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
11
- parent: parent ? parent.id : null
12
- };
13
- if (depth <= finalDepth) {
14
- node.subitems = Array.from(
15
- { length: 2 },
16
- (_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
17
- );
18
- }
19
- return node;
20
- };
21
- const options = {
22
- getUniqueId: (item) => item.id
23
- };
24
- const startingSourceData = genTreeOfData({ prefix: "Source" });
25
- const startingDestinationData = genTreeOfData({ prefix: "Destination" });
26
- const BreadCrumb = (props) => {
27
- const { breadCrumbPath, setCurrentNode, ...rest } = props;
28
- return /* @__PURE__ */ jsx(DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ jsx(DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
29
- };
30
- const BreadCrumbHoc = ({ path, setCurrentNode }) => {
31
- const WrappedBreadCrumb = (props) => /* @__PURE__ */ jsx(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
32
- return WrappedBreadCrumb;
33
- };
34
- const useListData = (startingData) => {
35
- const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);
36
- const [currentNode, setCurrentNode] = useState(getRoot());
37
- const [selection, setSelection] = useState({});
38
- const [isLoadingMore, setIsLoadingMore] = useState(false);
39
- const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
40
- const displayedData = useMemo(
41
- () => currentNode.children.map((node) => node.getJson()),
42
- // eslint-disable-next-line react-hooks/exhaustive-deps
43
- [currentNode, hash]
44
- );
45
- const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
46
- const onLoadMore = useCallback(() => {
47
- setIsLoadingMore(true);
48
- setTimeout(() => {
49
- const newChildren = Array.from(
50
- { length: 1 },
51
- (_, i) => genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i })
52
- );
53
- newChildren.forEach((child) => addNode(child, { parent: currentNode }));
54
- setIsLoadingMore(false);
55
- }, 1e3);
56
- }, [addNode, currentNode]);
57
- return {
58
- getNode,
59
- addNode,
60
- replaceNode,
61
- removeNode,
62
- currentNode,
63
- setCurrentNode,
64
- selection,
65
- setSelection,
66
- isLoadingMore,
67
- onLoadMore,
68
- breadcrumbPath,
69
- displayedData,
70
- onDrilldown
71
- };
72
- };
73
- const useShuttle = () => {
74
- const {
75
- currentNode: currentSourceNode,
76
- setCurrentNode: setCurrentSourceNode,
77
- selection: sourceSelection,
78
- setSelection: setSourceSelection,
79
- breadcrumbPath: sourceBreadCrumbPath,
80
- displayedData: sourceDisplayedData,
81
- onDrilldown: onSourceDrilldown,
82
- getNode: getSourceNode,
83
- addNode: addSourceNode,
84
- removeNode: removeSourceNode,
85
- isLoadingMore: isSourceLoadingMore,
86
- onLoadMore: onLoadMoreSource
87
- } = useListData(startingSourceData, "S");
88
- const {
89
- currentNode: currentDestinationNode,
90
- setCurrentNode: setCurrentDestinationNode,
91
- selection: destinationSelection,
92
- setSelection: setDestinationSelection,
93
- breadcrumbPath: destinationBreadCrumbPath,
94
- displayedData: destinationDisplayedData,
95
- onDrilldown: onDestinationDrilldown,
96
- getNode: getDestinationNode,
97
- addNode: addDestinationNode,
98
- removeNode: removeDestinationNode,
99
- isLoadingMore: isDestinationLoadingMore,
100
- onLoadMore: onLoadMoreDestination
101
- } = useListData(startingDestinationData, "D");
102
- const onSourceAdd = useCallback(
103
- (items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
104
- [addSourceNode, currentSourceNode, getSourceNode]
105
- );
106
- const onSourceRemove = useCallback(
107
- (items) => items.forEach((item) => removeSourceNode(item.id, item)),
108
- [removeSourceNode]
109
- );
110
- const onDestinationAdd = useCallback(
111
- (items) => items.forEach(
112
- (item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
113
- ),
114
- [addDestinationNode, currentDestinationNode, getDestinationNode]
115
- );
116
- const onDestinationRemove = useCallback(
117
- (items) => items.forEach((item) => removeDestinationNode(item.id)),
118
- [removeDestinationNode]
119
- );
120
- return {
121
- setCurrentSourceNode,
122
- setCurrentDestinationNode,
123
- sourceDisplayedData,
124
- destinationDisplayedData,
125
- sourceSelection,
126
- destinationSelection,
127
- setSourceSelection,
128
- setDestinationSelection,
129
- onSourceDrilldown,
130
- onDestinationDrilldown,
131
- onSourceAdd,
132
- onSourceRemove,
133
- onDestinationAdd,
134
- onDestinationRemove,
135
- sourceBreadCrumbPath,
136
- destinationBreadCrumbPath,
137
- isSourceLoadingMore,
138
- onLoadMoreSource,
139
- isDestinationLoadingMore,
140
- onLoadMoreDestination,
141
- currentSourceNode,
142
- currentDestinationNode
143
- };
144
- };
145
- export {
146
- BreadCrumbHoc,
147
- useShuttle
148
- };
149
- //# sourceMappingURL=loadMore.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/loadMore.js"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n const onLoadMore = useCallback(() => {\n setIsLoadingMore(true);\n setTimeout(() => {\n const newChildren = Array.from({ length: 1 }, (_, i) =>\n genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i }),\n );\n newChildren.forEach((child) => addNode(child, { parent: currentNode }));\n setIsLoadingMore(false);\n }, 1000);\n }, [addNode, currentNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n isLoadingMore,\n onLoadMore,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n isLoadingMore: isSourceLoadingMore,\n onLoadMore: onLoadMoreSource,\n } = useListData(startingSourceData, 'S');\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n isLoadingMore: isDestinationLoadingMore,\n onLoadMore: onLoadMoreDestination,\n } = useListData(startingDestinationData, 'D');\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n isSourceLoadingMore,\n onLoadMoreSource,\n isDestinationLoadingMore,\n onLoadMoreDestination,\n\n currentS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