@elliemae/ds-shuttle 3.0.0-next.9 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/cjs/AnimationState.js +9 -16
  2. package/dist/cjs/AnimationState.js.map +1 -1
  3. package/dist/cjs/DSShuttle.js +10 -16
  4. package/dist/cjs/DSShuttle.js.map +2 -2
  5. package/dist/cjs/SearchState.js +9 -16
  6. package/dist/cjs/SearchState.js.map +1 -1
  7. package/dist/cjs/Shuttle.actions.js +9 -16
  8. package/dist/cjs/Shuttle.actions.js.map +1 -1
  9. package/dist/cjs/ShuttleContainer.js +9 -16
  10. package/dist/cjs/ShuttleContainer.js.map +1 -1
  11. package/dist/cjs/ShuttleImpl.js +86 -95
  12. package/dist/cjs/ShuttleImpl.js.map +2 -2
  13. package/dist/cjs/ShuttleRenderer.js +9 -16
  14. package/dist/cjs/ShuttleRenderer.js.map +1 -1
  15. package/dist/cjs/ShuttleState.js +9 -16
  16. package/dist/cjs/ShuttleState.js.map +1 -1
  17. package/dist/cjs/animation/animationConfig.js +9 -16
  18. package/dist/cjs/animation/animationConfig.js.map +1 -1
  19. package/dist/cjs/classedComponents.js +9 -16
  20. package/dist/cjs/classedComponents.js.map +1 -1
  21. package/dist/cjs/components/LoadingIndicator.js +9 -16
  22. package/dist/cjs/components/LoadingIndicator.js.map +1 -1
  23. package/dist/cjs/components/OverflowList.js +9 -16
  24. package/dist/cjs/components/OverflowList.js.map +1 -1
  25. package/dist/cjs/components/ShuttleBreadcrumb.js +9 -16
  26. package/dist/cjs/components/ShuttleBreadcrumb.js.map +1 -1
  27. package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js +9 -16
  28. package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js.map +1 -1
  29. package/dist/cjs/components/ShuttleListItem/ActionButtons.js +9 -16
  30. package/dist/cjs/components/ShuttleListItem/ActionButtons.js.map +1 -1
  31. package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js +9 -16
  32. package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js.map +1 -1
  33. package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +9 -16
  34. package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +1 -1
  35. package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +9 -16
  36. package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +1 -1
  37. package/dist/cjs/components/ShuttleListPanel.js +9 -16
  38. package/dist/cjs/components/ShuttleListPanel.js.map +1 -1
  39. package/dist/cjs/components/ShuttleSearchBox.js +9 -16
  40. package/dist/cjs/components/ShuttleSearchBox.js.map +1 -1
  41. package/dist/cjs/components/ShuttleSource.js +9 -16
  42. package/dist/cjs/components/ShuttleSource.js.map +1 -1
  43. package/dist/cjs/components/ShuttleTarget.js +9 -16
  44. package/dist/cjs/components/ShuttleTarget.js.map +1 -1
  45. package/dist/cjs/components/VirtualizedItem.js +9 -16
  46. package/dist/cjs/components/VirtualizedItem.js.map +1 -1
  47. package/dist/cjs/components/VirtualizedList.js +9 -16
  48. package/dist/cjs/components/VirtualizedList.js.map +1 -1
  49. package/dist/cjs/components/VirtualizedSortableList.js +9 -16
  50. package/dist/cjs/components/VirtualizedSortableList.js.map +1 -1
  51. package/dist/cjs/helper.js +9 -16
  52. package/dist/cjs/helper.js.map +1 -1
  53. package/dist/cjs/index.js +9 -16
  54. package/dist/cjs/index.js.map +1 -1
  55. package/dist/cjs/tests/utils.js +9 -16
  56. package/dist/cjs/tests/utils.js.map +1 -1
  57. package/dist/cjs/updateShuttleStateFromProps.js +9 -16
  58. package/dist/cjs/updateShuttleStateFromProps.js.map +1 -1
  59. package/dist/cjs/utils.js +9 -16
  60. package/dist/cjs/utils.js.map +1 -1
  61. package/dist/cjs/withProviders.js +9 -16
  62. package/dist/cjs/withProviders.js.map +1 -1
  63. package/dist/esm/AnimationState.js.map +1 -1
  64. package/dist/esm/DSShuttle.js +1 -0
  65. package/dist/esm/DSShuttle.js.map +2 -2
  66. package/dist/esm/SearchState.js.map +1 -1
  67. package/dist/esm/Shuttle.actions.js.map +1 -1
  68. package/dist/esm/ShuttleContainer.js.map +1 -1
  69. package/dist/esm/ShuttleImpl.js +77 -79
  70. package/dist/esm/ShuttleImpl.js.map +2 -2
  71. package/dist/esm/ShuttleRenderer.js.map +1 -1
  72. package/dist/esm/ShuttleState.js.map +1 -1
  73. package/dist/esm/animation/animationConfig.js.map +1 -1
  74. package/dist/esm/classedComponents.js.map +1 -1
  75. package/dist/esm/components/LoadingIndicator.js.map +1 -1
  76. package/dist/esm/components/OverflowList.js.map +1 -1
  77. package/dist/esm/components/ShuttleBreadcrumb.js.map +1 -1
  78. package/dist/esm/components/ShuttleInfiniteScrollIndicator.js.map +1 -1
  79. package/dist/esm/components/ShuttleListItem/ActionButtons.js.map +1 -1
  80. package/dist/esm/components/ShuttleListItem/ShuttleListItem.js.map +1 -1
  81. package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +1 -1
  82. package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +1 -1
  83. package/dist/esm/components/ShuttleListPanel.js.map +1 -1
  84. package/dist/esm/components/ShuttleSearchBox.js.map +1 -1
  85. package/dist/esm/components/ShuttleSource.js.map +1 -1
  86. package/dist/esm/components/ShuttleTarget.js.map +1 -1
  87. package/dist/esm/components/VirtualizedItem.js.map +1 -1
  88. package/dist/esm/components/VirtualizedList.js.map +1 -1
  89. package/dist/esm/components/VirtualizedSortableList.js.map +1 -1
  90. package/dist/esm/helper.js.map +1 -1
  91. package/dist/esm/tests/utils.js.map +1 -1
  92. package/dist/esm/updateShuttleStateFromProps.js.map +1 -1
  93. package/dist/esm/utils.js.map +1 -1
  94. package/dist/esm/withProviders.js.map +1 -1
  95. package/package.json +19 -19
@@ -4,32 +4,26 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var AnimationState_exports = {};
29
22
  __export(AnimationState_exports, {
30
23
  AnimationState: () => AnimationState,
31
24
  default: () => AnimationState_default
32
25
  });
26
+ module.exports = __toCommonJS(AnimationState_exports);
33
27
  var React = __toESM(require("react"));
34
28
  var import_react = require("react");
35
29
  var import_constate = __toESM(require("constate"));
@@ -71,5 +65,4 @@ const AnimationState = (0, import_constate.default)(useShuttleAnimationState, (v
71
65
  value.state
72
66
  ]);
73
67
  var AnimationState_default = AnimationState;
74
- module.exports = __toCommonJS(AnimationState_exports);
75
68
  //# sourceMappingURL=AnimationState.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/AnimationState.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useCallback, useState } from 'react';\nimport createContainer from 'constate';\n\nfunction useShuttleAnimationState() {\n const [animationState, setAnimationState] = useState({\n isMoving: false,\n isMovingBack: false,\n isDrillingDown: false,\n });\n const reset = useCallback(\n () =>\n setAnimationState({\n isMoving: false,\n isMovingBack: false,\n isDrillingDown: false,\n }),\n [],\n );\n const move = useCallback(\n () =>\n setAnimationState({\n isMovingBack: false,\n isMoving: true,\n isDrillingDown: false,\n }),\n [],\n );\n\n const moveBack = useCallback(\n () =>\n setAnimationState({\n isMovingBack: true,\n isMoving: false,\n isDrillingDown: false,\n }),\n [],\n );\n\n const drilldown = useCallback(\n () =>\n setAnimationState({\n isMovingBack: false,\n isMoving: false,\n isDrillingDown: true,\n }),\n [],\n );\n\n return {\n state: animationState,\n setIsMoving: move,\n setIsMovingBack: moveBack,\n setIsDrillingDown: drilldown,\n reset,\n };\n}\n\nconst AnimationState = createContainer(useShuttleAnimationState, value => [\n value.state,\n]);\n\nexport { AnimationState };\nexport default AnimationState;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsC;AACtC,sBAA4B;AAE5B,oCAAoC;AAClC,QAAM,CAAC,gBAAgB,qBAAqB,2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B,cAAc;AAAA,IACd,UAAU;AAAA,IACV,gBAAgB;AAAA,EAClB,CAAC,GACH,CAAC,CACH;AAEA,QAAM,YAAY,8BAChB,MACE,kBAAkB;AAAA,IAChB,cAAc;AAAA,IACd,UAAU;AAAA,IACV,gBAAgB;AAAA,EAClB,CAAC,GACH,CAAC,CACH;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,IACP,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB;AAAA,EACF;AACF;AAEA,MAAM,iBAAiB,6BAAgB,0BAA0B,WAAS;AAAA,EACxE,MAAM;AACR,CAAC;AAGD,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var DSShuttle_exports = {};
29
22
  __export(DSShuttle_exports, {
30
23
  DSShuttle: () => DSShuttle,
@@ -32,6 +25,7 @@ __export(DSShuttle_exports, {
32
25
  default: () => DSShuttle_default,
33
26
  utils: () => import_utils.default
34
27
  });
28
+ module.exports = __toCommonJS(DSShuttle_exports);
35
29
  var React = __toESM(require("react"));
36
30
  var import_react = __toESM(require("react"));
37
31
  var import_lodash = require("lodash");
@@ -163,8 +157,8 @@ const props = {
163
157
  loadingTarget: import_react_desc.PropTypes.bool.description("Displays loading indicator on target section")
164
158
  };
165
159
  DSShuttle.propTypes = props;
160
+ DSShuttle.displayName = "DSShuttle";
166
161
  const DSShuttleWithSchema = (0, import_react_desc.describe)(DSShuttle);
167
162
  DSShuttleWithSchema.propTypes = props;
168
163
  var DSShuttle_default = DSShuttle;
169
- module.exports = __toCommonJS(DSShuttle_exports);
170
164
  //# sourceMappingURL=DSShuttle.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSShuttle.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { debounce } from 'lodash';\nimport { describe, PropTypes } from 'react-desc';\nimport { TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { ShuttleImpl } from './ShuttleImpl';\nimport utils from './utils';\n\nconst noop = () => {};\n\nconst DSShuttle = ({\n containerProps = {},\n idField = 'id',\n parentIdField = 'parent',\n showIcons = true,\n items = [],\n selectedItems = undefined, // if defined it becomes controlled (v1)\n // TODO make `nonSelectedItems` the default controlled behavior (v2)\n nonSelectedItems = undefined,\n onSearch = noop,\n onSearchOpen = noop,\n onSearchClose = noop,\n onDrillDown = noop,\n onDrillDownTarget = noop,\n onTargetSortEnd = noop,\n setGetStatus = noop,\n targetSortable = true,\n sourceEmptyMessage = 'No Items Found',\n sourceRootTitle = 'Category',\n targetEmptyMessage = 'No Items Selected',\n targetRootTitle = 'Selected Items',\n composeSourceItemProps = () => ({}),\n composeTargetItemProps = () => ({}),\n onAddToTarget = noop,\n onAddCheckedItems = noop,\n onRemoveFromTarget = noop,\n onRemoveAllFromTarget = noop,\n onChange = noop,\n renderSourceCounter = noop,\n renderTargetCounter = noop,\n sourceClearItemsText = 'CLEAR ALL',\n targetClearItemsText = 'CLEAR ALL',\n searchPlaceholder = 'Search field ID, name, etc.',\n loadingSource = false,\n loadingTarget = false,\n onGetMoreItems = () => null,\n hasNextPage = false,\n moreItemsLoading,\n}) => (\n <TooltipTextProvider>\n <ShuttleImpl\n composeSourceItemProps={composeSourceItemProps}\n composeTargetItemProps={composeTargetItemProps}\n containerProps={containerProps}\n idField={idField}\n items={items}\n onAddCheckedItems={onAddCheckedItems}\n onAddToTarget={onAddToTarget}\n onChange={onChange}\n onDrillDown={onDrillDown}\n nonSelectedItems={nonSelectedItems}\n onDrillDownTarget={onDrillDownTarget}\n onRemoveAllFromTarget={onRemoveAllFromTarget}\n onRemoveFromTarget={onRemoveFromTarget}\n onSearch={onSearch}\n onSearchClose={onSearchClose}\n onSearchOpen={onSearchOpen}\n onTargetSortEnd={onTargetSortEnd}\n parentIdField={parentIdField}\n renderSourceCounter={renderSourceCounter}\n renderTargetCounter={renderTargetCounter}\n searchPlaceholder={searchPlaceholder}\n selectedItems={selectedItems}\n setGetStatus={setGetStatus}\n showIcons={showIcons}\n sourceClearItemsText={sourceClearItemsText}\n sourceEmptyMessage={sourceEmptyMessage}\n sourceRootTitle={sourceRootTitle}\n targetClearItemsText={targetClearItemsText}\n targetEmptyMessage={targetEmptyMessage}\n targetRootTitle={targetRootTitle}\n targetSortable={targetSortable}\n loadingSource={loadingSource}\n loadingTarget={loadingTarget}\n onGetMoreItems={debounce((...args) => {\n onGetMoreItems(...args);\n }, 500)}\n moreItemsLoading={moreItemsLoading}\n hasNextPage={hasNextPage}\n />\n </TooltipTextProvider>\n);\n\nconst props = {\n /** inject props to shuttle wrapper */\n containerProps: PropTypes.object.description('inject props to shuttle wrapper'),\n /** The identifier field for the item object */\n idField: PropTypes.string.description('The identifier field for the item object'),\n /** The parent identifier field for the item object */\n parentIdField: PropTypes.string.description('The parent identifier field for the item object'),\n /** Whether to show the icons or not */\n showIcons: PropTypes.string.description('Whether to show the icons or not'),\n /** List of items */\n items: PropTypes.arrayOf(\n PropTypes.shape({\n disableDrillDown: PropTypes.bool,\n icon: PropTypes.element,\n name: PropTypes.string,\n readOnly: PropTypes.bool,\n description: PropTypes.string,\n }),\n ).description('list of items'),\n /** Array of item ids that are selected. If passed the component behaves as controlled */\n selectedItems: PropTypes.arrayOf(PropTypes.string).description(\n 'Array of item ids that are selected. If passed the component behaves as controlled',\n ),\n /** Array of item ids that aren't selected. Should include ALL non selected items, even those not rendered */\n nonSelectedItems: PropTypes.arrayOf(PropTypes.string).description(\n \"Array of item ids that aren't selected.. Should include ALL non selected items, even those not rendered\",\n ),\n /** Handler on search */\n onSearch: PropTypes.func.description('Handler on search'),\n /** Handler when the searchbox is visible */\n onSearchOpen: PropTypes.func.description('Handler when the searchbox is visible'),\n /** Handler when the searchbox is not visible */\n onSearchClose: PropTypes.func.description('Handler when the searchbox is not visible'),\n /** Source handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\") */\n onDrillDown: PropTypes.func.description(\n 'Source handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\")',\n ),\n /** Target handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\") */\n onDrillDownTarget: PropTypes.func.description(\n 'Target handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\")',\n ),\n /** Target handler when user stops dragging an item */\n onTargetSortEnd: PropTypes.func.description('Target handler when user stops dragging an item'),\n /** Callback function that gets more items for Infinite Scroll */\n onGetMoreItems: PropTypes.func.description('Callback function that gets more items for Infinite Scroll'),\n /** Wheter there are mor items loading for Infinite Scroll */\n moreItemsLoading: PropTypes.bool.description('Wheter there are mor items loading for Infinite Scroll'),\n /** Wheter there is a next page for Infinite Scroll, controls when to trigger onGetMoreItems */\n hasNextPage: PropTypes.bool.description(\n 'Wheter there is a next page for Infinite Scroll, controls when to trigger onGetMoreItems',\n ),\n /** Function that takes as a parameter an internal getter for the state */\n setGetStatus: PropTypes.func.description('Function that takes as a parameter an internal getter for the state'),\n /** Whether the target can be sortable with DnD */\n targetSortable: PropTypes.bool.description('Whether the target can be sortable with DnD'),\n /** Handler when the searchbox is visible */\n sourceRootTitle: PropTypes.string.description('Handler when the searchbox is visible'),\n /** Source text when there is no items */\n sourceEmptyMessage: PropTypes.string.description('Source text when there is no items'),\n /** Target text when there is no items */\n targetEmptyMessage: PropTypes.string.description('Target text when there is no items'),\n /** Target text for the first hierarchy item */\n targetRootTitle: PropTypes.string.description('Target text for the first hierarchy item'),\n /** Function that allow to compose the item props in the source */\n composeSourceItemProps: PropTypes.func.description('Function that allow to compose the item props in the source'),\n /** Function that allow to compose the item props in the target */\n composeTargetItemProps: PropTypes.func.description('Function that allow to compose the item props in the target'),\n /** Handler when a users moves an item to the target */\n onAddToTarget: PropTypes.func.description('Handler when a users moves an item to the target'),\n /** Handler when a users moves all the 'checked' items to the target */\n onAddCheckedItems: PropTypes.func.description(\"Handler when a users moves all the 'checked' items to the target\"),\n /** Handler when a user removes an item from the target */\n onRemoveFromTarget: PropTypes.func.description('Handler when a user removes an item from the target'),\n /** Handler when a user removes all the items from the target */\n onRemoveAllFromTarget: PropTypes.func.description('Handler when a user removes all the items from the target'),\n /** Handler for every change on the state */\n onChange: PropTypes.func.description('Handler for every change on the state'),\n /** Function that returns an element for the source counter */\n renderSourceCounter: PropTypes.func.description('Function that returns an element for the source counter'),\n /** Function that returns an element for the target counter */\n renderTargetCounter: PropTypes.func.description('Function that returns an element for the target counter'),\n /** Source text for the clear items button */\n sourceClearItemsText: PropTypes.string.description('Source text for the clear items button'),\n /** Target text for the clear items button */\n targetClearItemsText: PropTypes.string.description('Target text for the clear items button'),\n /** Searchbox placeholder */\n searchPlaceholder: PropTypes.string.description('Searchbox placeholder'),\n /** Displays loading indicator on source section */\n loadingSource: PropTypes.bool.description('Displays loading indicator on source section'),\n /** Displays loading indicator on target section */\n loadingTarget: PropTypes.bool.description('Displays loading indicator on target section'),\n};\n\nDSShuttle.propTypes = props;\nconst DSShuttleWithSchema = describe(DSShuttle);\nDSShuttleWithSchema.propTypes = props;\n\nexport { utils, DSShuttleWithSchema, DSShuttle };\n\nexport default DSShuttle;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,oBAAyB;AACzB,wBAAoC;AACpC,uCAAoC;AACpC,yBAA4B;AAC5B,mBAAkB;AAElB,MAAM,OAAO,MAAM;AAAA;AAEnB,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAEhB,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,eAAe;AAAA,EACf,gBAAgB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A,EAEhD,sBAAsB,4BAAU,OAAO,YAAY;AAAA,EAEnD,sBAAsB,4BAAU,OAAO,YAAY;AAAA,EAEnD,mBAAmB,4BAAU,OAAO,YAAY;AAAA,EAEhD,eAAe,4BAAU,KAAK,YAAY;AAAA,EAE1C,eAAe,4BAAU,KAAK,YAAY;AAAA;AAG5C,UAAU,YAAY;AACtB,MAAM,sBAAsB,gCAAS;AACrC,oBAAoB,YAAY;AAIhC,IAAO,oBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { debounce } from 'lodash';\nimport { describe, PropTypes } from 'react-desc';\nimport { TooltipTextProvider } from '@elliemae/ds-truncated-tooltip-text';\nimport { ShuttleImpl } from './ShuttleImpl';\nimport utils from './utils';\n\nconst noop = () => {};\n\nconst DSShuttle = ({\n containerProps = {},\n idField = 'id',\n parentIdField = 'parent',\n showIcons = true,\n items = [],\n selectedItems = undefined, // if defined it becomes controlled (v1)\n // TODO make `nonSelectedItems` the default controlled behavior (v2)\n nonSelectedItems = undefined,\n onSearch = noop,\n onSearchOpen = noop,\n onSearchClose = noop,\n onDrillDown = noop,\n onDrillDownTarget = noop,\n onTargetSortEnd = noop,\n setGetStatus = noop,\n targetSortable = true,\n sourceEmptyMessage = 'No Items Found',\n sourceRootTitle = 'Category',\n targetEmptyMessage = 'No Items Selected',\n targetRootTitle = 'Selected Items',\n composeSourceItemProps = () => ({}),\n composeTargetItemProps = () => ({}),\n onAddToTarget = noop,\n onAddCheckedItems = noop,\n onRemoveFromTarget = noop,\n onRemoveAllFromTarget = noop,\n onChange = noop,\n renderSourceCounter = noop,\n renderTargetCounter = noop,\n sourceClearItemsText = 'CLEAR ALL',\n targetClearItemsText = 'CLEAR ALL',\n searchPlaceholder = 'Search field ID, name, etc.',\n loadingSource = false,\n loadingTarget = false,\n onGetMoreItems = () => null,\n hasNextPage = false,\n moreItemsLoading,\n}) => (\n <TooltipTextProvider>\n <ShuttleImpl\n composeSourceItemProps={composeSourceItemProps}\n composeTargetItemProps={composeTargetItemProps}\n containerProps={containerProps}\n idField={idField}\n items={items}\n onAddCheckedItems={onAddCheckedItems}\n onAddToTarget={onAddToTarget}\n onChange={onChange}\n onDrillDown={onDrillDown}\n nonSelectedItems={nonSelectedItems}\n onDrillDownTarget={onDrillDownTarget}\n onRemoveAllFromTarget={onRemoveAllFromTarget}\n onRemoveFromTarget={onRemoveFromTarget}\n onSearch={onSearch}\n onSearchClose={onSearchClose}\n onSearchOpen={onSearchOpen}\n onTargetSortEnd={onTargetSortEnd}\n parentIdField={parentIdField}\n renderSourceCounter={renderSourceCounter}\n renderTargetCounter={renderTargetCounter}\n searchPlaceholder={searchPlaceholder}\n selectedItems={selectedItems}\n setGetStatus={setGetStatus}\n showIcons={showIcons}\n sourceClearItemsText={sourceClearItemsText}\n sourceEmptyMessage={sourceEmptyMessage}\n sourceRootTitle={sourceRootTitle}\n targetClearItemsText={targetClearItemsText}\n targetEmptyMessage={targetEmptyMessage}\n targetRootTitle={targetRootTitle}\n targetSortable={targetSortable}\n loadingSource={loadingSource}\n loadingTarget={loadingTarget}\n onGetMoreItems={debounce((...args) => {\n onGetMoreItems(...args);\n }, 500)}\n moreItemsLoading={moreItemsLoading}\n hasNextPage={hasNextPage}\n />\n </TooltipTextProvider>\n);\n\nconst props = {\n /** inject props to shuttle wrapper */\n containerProps: PropTypes.object.description('inject props to shuttle wrapper'),\n /** The identifier field for the item object */\n idField: PropTypes.string.description('The identifier field for the item object'),\n /** The parent identifier field for the item object */\n parentIdField: PropTypes.string.description('The parent identifier field for the item object'),\n /** Whether to show the icons or not */\n showIcons: PropTypes.string.description('Whether to show the icons or not'),\n /** List of items */\n items: PropTypes.arrayOf(\n PropTypes.shape({\n disableDrillDown: PropTypes.bool,\n icon: PropTypes.element,\n name: PropTypes.string,\n readOnly: PropTypes.bool,\n description: PropTypes.string,\n }),\n ).description('list of items'),\n /** Array of item ids that are selected. If passed the component behaves as controlled */\n selectedItems: PropTypes.arrayOf(PropTypes.string).description(\n 'Array of item ids that are selected. If passed the component behaves as controlled',\n ),\n /** Array of item ids that aren't selected. Should include ALL non selected items, even those not rendered */\n nonSelectedItems: PropTypes.arrayOf(PropTypes.string).description(\n \"Array of item ids that aren't selected.. Should include ALL non selected items, even those not rendered\",\n ),\n /** Handler on search */\n onSearch: PropTypes.func.description('Handler on search'),\n /** Handler when the searchbox is visible */\n onSearchOpen: PropTypes.func.description('Handler when the searchbox is visible'),\n /** Handler when the searchbox is not visible */\n onSearchClose: PropTypes.func.description('Handler when the searchbox is not visible'),\n /** Source handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\") */\n onDrillDown: PropTypes.func.description(\n 'Source handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\")',\n ),\n /** Target handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\") */\n onDrillDownTarget: PropTypes.func.description(\n 'Target handler when a user navigates to a level down on the nested structure. First param: item drilled. Second param: direction (\"up\" | \"down\")',\n ),\n /** Target handler when user stops dragging an item */\n onTargetSortEnd: PropTypes.func.description('Target handler when user stops dragging an item'),\n /** Callback function that gets more items for Infinite Scroll */\n onGetMoreItems: PropTypes.func.description('Callback function that gets more items for Infinite Scroll'),\n /** Wheter there are mor items loading for Infinite Scroll */\n moreItemsLoading: PropTypes.bool.description('Wheter there are mor items loading for Infinite Scroll'),\n /** Wheter there is a next page for Infinite Scroll, controls when to trigger onGetMoreItems */\n hasNextPage: PropTypes.bool.description(\n 'Wheter there is a next page for Infinite Scroll, controls when to trigger onGetMoreItems',\n ),\n /** Function that takes as a parameter an internal getter for the state */\n setGetStatus: PropTypes.func.description('Function that takes as a parameter an internal getter for the state'),\n /** Whether the target can be sortable with DnD */\n targetSortable: PropTypes.bool.description('Whether the target can be sortable with DnD'),\n /** Handler when the searchbox is visible */\n sourceRootTitle: PropTypes.string.description('Handler when the searchbox is visible'),\n /** Source text when there is no items */\n sourceEmptyMessage: PropTypes.string.description('Source text when there is no items'),\n /** Target text when there is no items */\n targetEmptyMessage: PropTypes.string.description('Target text when there is no items'),\n /** Target text for the first hierarchy item */\n targetRootTitle: PropTypes.string.description('Target text for the first hierarchy item'),\n /** Function that allow to compose the item props in the source */\n composeSourceItemProps: PropTypes.func.description('Function that allow to compose the item props in the source'),\n /** Function that allow to compose the item props in the target */\n composeTargetItemProps: PropTypes.func.description('Function that allow to compose the item props in the target'),\n /** Handler when a users moves an item to the target */\n onAddToTarget: PropTypes.func.description('Handler when a users moves an item to the target'),\n /** Handler when a users moves all the 'checked' items to the target */\n onAddCheckedItems: PropTypes.func.description(\"Handler when a users moves all the 'checked' items to the target\"),\n /** Handler when a user removes an item from the target */\n onRemoveFromTarget: PropTypes.func.description('Handler when a user removes an item from the target'),\n /** Handler when a user removes all the items from the target */\n onRemoveAllFromTarget: PropTypes.func.description('Handler when a user removes all the items from the target'),\n /** Handler for every change on the state */\n onChange: PropTypes.func.description('Handler for every change on the state'),\n /** Function that returns an element for the source counter */\n renderSourceCounter: PropTypes.func.description('Function that returns an element for the source counter'),\n /** Function that returns an element for the target counter */\n renderTargetCounter: PropTypes.func.description('Function that returns an element for the target counter'),\n /** Source text for the clear items button */\n sourceClearItemsText: PropTypes.string.description('Source text for the clear items button'),\n /** Target text for the clear items button */\n targetClearItemsText: PropTypes.string.description('Target text for the clear items button'),\n /** Searchbox placeholder */\n searchPlaceholder: PropTypes.string.description('Searchbox placeholder'),\n /** Displays loading indicator on source section */\n loadingSource: PropTypes.bool.description('Displays loading indicator on source section'),\n /** Displays loading indicator on target section */\n loadingTarget: PropTypes.bool.description('Displays loading indicator on target section'),\n};\n\nDSShuttle.propTypes = props;\nDSShuttle.displayName = 'DSShuttle';\nconst DSShuttleWithSchema = describe(DSShuttle);\nDSShuttleWithSchema.propTypes = props;\n\nexport { utils, DSShuttleWithSchema, DSShuttle };\n\nexport default DSShuttle;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;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__hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
7
  var __export = (target, all) => {
9
8
  for (var name in all)
10
9
  __defProp(target, name, { get: all[name], enumerable: true });
11
10
  };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
16
  }
18
- return target;
17
+ return to;
19
18
  };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
21
  var SearchState_exports = {};
29
22
  __export(SearchState_exports, {
30
23
  SearchState: () => SearchState,
31
24
  default: () => SearchState_default
32
25
  });
26
+ module.exports = __toCommonJS(SearchState_exports);
33
27
  var React = __toESM(require("react"));
34
28
  var import_react = require("react");
35
29
  var import_constate = __toESM(require("constate"));
@@ -56,5 +50,4 @@ function useSearchState() {
56
50
  }
57
51
  const SearchState = (0, import_constate.default)(useSearchState, (value) => [value.state]);
58
52
  var SearchState_default = SearchState;
59
- module.exports = __toCommonJS(SearchState_exports);
60
53
  //# sourceMappingURL=SearchState.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/SearchState.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { useState } from 'react';\nimport createContainer from 'constate';\n\nfunction useSearchState() {\n const [searchTerm, setSearchTerm] = useState('');\n const [searching, setSearchBoxVisibility] = useState(false); // todo: create a hook for Visibility behavior\n\n function toggleSearchBox(userVisible) {\n if (userVisible !== undefined) {\n setSearchBoxVisibility(userVisible);\n } else {\n setSearchBoxVisibility(!searching);\n }\n }\n\n function reset() {\n setSearchTerm('');\n setSearchBoxVisibility(false);\n }\n\n return {\n state: { searchTerm, searching },\n setSearchTerm,\n toggleSearchBox,\n reset,\n };\n}\n\nconst SearchState = createContainer(useSearchState, value => [value.state]);\nexport { SearchState };\nexport default SearchState;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyB;AACzB,sBAA4B;AAE5B,0BAA0B;AACxB,QAAM,CAAC,YAAY,iBAAiB,2BAAS;AAC7C,QAAM,CAAC,WAAW,0BAA0B,2BAAS;AAErD,2BAAyB,aAAa;AACpC,QAAI,gBAAgB,QAAW;AAC7B,6BAAuB;AAAA,WAClB;AACL,6BAAuB,CAAC;AAAA;AAAA;AAI5B,mBAAiB;AACf,kBAAc;AACd,2BAAuB;AAAA;AAGzB,SAAO;AAAA,IACL,OAAO,EAAE,YAAY;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAIJ,MAAM,cAAc,6BAAgB,gBAAgB,WAAS,CAAC,MAAM;AAEpE,IAAO,sBAAQ;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAyB;AACzB,sBAA4B;AAE5B,0BAA0B;AACxB,QAAM,CAAC,YAAY,iBAAiB,2BAAS,EAAE;AAC/C,QAAM,CAAC,WAAW,0BAA0B,2BAAS,KAAK;AAE1D,2BAAyB,aAAa;AACpC,QAAI,gBAAgB,QAAW;AAC7B,6BAAuB,WAAW;AAAA,IACpC,OAAO;AACL,6BAAuB,CAAC,SAAS;AAAA,IACnC;AAAA,EACF;AAEA,mBAAiB;AACf,kBAAc,EAAE;AAChB,2BAAuB,KAAK;AAAA,EAC9B;AAEA,SAAO;AAAA,IACL,OAAO,EAAE,YAAY,UAAU;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,MAAM,cAAc,6BAAgB,gBAAgB,WAAS,CAAC,MAAM,KAAK,CAAC;AAE1E,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -21,27 +21,20 @@ var __spreadValues = (a, b) => {
21
21
  return a;
22
22
  };
23
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
25
24
  var __export = (target, all) => {
26
25
  for (var name in all)
27
26
  __defProp(target, name, { get: all[name], enumerable: true });
28
27
  };
29
- var __reExport = (target, module2, copyDefault, desc) => {
30
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
31
- for (let key of __getOwnPropNames(module2))
32
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
33
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
28
+ var __copyProps = (to, from, except, desc) => {
29
+ if (from && typeof from === "object" || typeof from === "function") {
30
+ for (let key of __getOwnPropNames(from))
31
+ if (!__hasOwnProp.call(to, key) && key !== except)
32
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
33
  }
35
- return target;
34
+ return to;
36
35
  };
37
- var __toESM = (module2, isNodeMode) => {
38
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
39
- };
40
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
41
- return (module2, temp) => {
42
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
43
- };
44
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
37
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
45
38
  var Shuttle_actions_exports = {};
46
39
  __export(Shuttle_actions_exports, {
47
40
  addToTarget: () => addToTarget,
@@ -52,6 +45,7 @@ __export(Shuttle_actions_exports, {
52
45
  resetMovedItems: () => resetMovedItems,
53
46
  toggleItemSelection: () => toggleItemSelection
54
47
  });
48
+ module.exports = __toCommonJS(Shuttle_actions_exports);
55
49
  var React = __toESM(require("react"));
56
50
  var import_ds_utilities = require("@elliemae/ds-utilities");
57
51
  var import_helper = require("./helper");
@@ -132,5 +126,4 @@ function resetMovedItems() {
132
126
  targetItems: []
133
127
  });
134
128
  }
135
- module.exports = __toCommonJS(Shuttle_actions_exports);
136
129
  //# sourceMappingURL=Shuttle.actions.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/Shuttle.actions.js", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import {\n addOrRemove,\n cloneDeep,\n hashArray,\n compose,\n} from '@elliemae/ds-utilities';\nimport {\n getHierarchyTypeName,\n toggleInObject,\n filterMovedItems,\n} from './helper';\n\nimport utils from './utils';\n\nexport function toggleItemSelection(itemId) {\n return state => ({\n ...state,\n checkedItems: addOrRemove(state.checkedItems, itemId),\n });\n}\nexport function navigateTo(item, dest) {\n const hierarchyType = getHierarchyTypeName(dest);\n return state => {\n const indexInHierarchy = state[hierarchyType].findIndex(\n hItem => hItem.id === item.id,\n );\n const hierarchy = state[hierarchyType];\n return {\n ...state,\n [hierarchyType]:\n indexInHierarchy !== -1\n ? hierarchy.slice(0, indexInHierarchy + 1)\n : [...hierarchy, item],\n };\n };\n}\nexport function moveItem(item) {\n return state => {\n const movedItems = toggleInObject(state.movedItems, item.id, item);\n return {\n ...state,\n movedItems,\n };\n };\n}\n\nconst defaultOptions = {\n parentField: 'parent',\n idField: 'id',\n op: hasMoved => !hasMoved,\n};\n\n// todo: optimize this\nfunction getItemDeep({ collection, id, options }) {\n const { idField } = { ...defaultOptions, ...options };\n const itemIndex = collection.findIndex(fItem => fItem[idField] === id);\n\n // get item with nested children\n const item = collection[itemIndex];\n const children = item?.hasChildren\n ? compose(utils.getChildren({ index: itemIndex }))(collection) || []\n : [];\n\n return { item, children };\n}\n\nexport function addToTarget(itemToAdd, collection) {\n return (state, { idField }) => {\n const items = collection || state.preparedItems;\n\n const { item, children } = getItemDeep({\n collection: items,\n id: itemToAdd[idField],\n });\n\n return {\n ...state,\n movedItems: [...state.movedItems, item],\n targetItems: [...state.targetItems, item, ...children],\n };\n };\n}\n\n// todo: optimize this\nexport function removeFromTarget(itemToRemove) {\n return (state, { idField }) => {\n let targetItems = cloneDeep(state.targetItems);\n\n const itemIndex = targetItems.findIndex(\n fItem => fItem.id === itemToRemove.id,\n );\n\n const item = targetItems[itemIndex];\n const children = item?.hasChildren\n ? compose(\n filterMovedItems(state.movedItems),\n utils.getChildren({ index: itemIndex }),\n )(targetItems) || []\n : [];\n\n targetItems.splice(itemIndex, 1);\n if (item?.hasChildren && children.length) {\n const childrenHash = hashArray(children, 'id');\n targetItems = targetItems.filter(i => !childrenHash[i.id]);\n }\n\n return {\n ...state,\n movedItems: state.movedItems.filter(\n mItem => mItem[idField] !== itemToRemove[idField],\n ),\n targetItems,\n };\n };\n}\n\nexport function resetCheckedItems() {\n return state => ({\n ...state,\n checkedItems: [],\n });\n}\nexport function resetMovedItems() {\n return state => ({\n ...state,\n movedItems: [],\n targetItems: [],\n });\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAKO;AACP,oBAIO;AAEP,mBAAkB;AAEX,6BAA6B,QAAQ;AAC1C,SAAO,WAAU,iCACZ,QADY;AAAA,IAEf,cAAc,qCAAY,MAAM,cAAc;AAAA;AAAA;AAG3C,oBAAoB,MAAM,MAAM;AACrC,QAAM,gBAAgB,wCAAqB;AAC3C,SAAO,WAAS;AACd,UAAM,mBAAmB,MAAM,eAAe,UAC5C,WAAS,MAAM,OAAO,KAAK;AAE7B,UAAM,YAAY,MAAM;AACxB,WAAO,iCACF,QADE;AAAA,OAEJ,gBACC,qBAAqB,KACjB,UAAU,MAAM,GAAG,mBAAmB,KACtC,CAAC,GAAG,WAAW;AAAA;AAAA;AAAA;AAIpB,kBAAkB,MAAM;AAC7B,SAAO,WAAS;AACd,UAAM,aAAa,kCAAe,MAAM,YAAY,KAAK,IAAI;AAC7D,WAAO,iCACF,QADE;AAAA,MAEL;AAAA;AAAA;AAAA;AAKN,MAAM,iBAAiB;AAAA,EACrB,aAAa;AAAA,EACb,SAAS;AAAA,EACT,IAAI,cAAY,CAAC;AAAA;AAInB,qBAAqB,EAAE,YAAY,IAAI,WAAW;AAChD,QAAM,EAAE,YAAY,kCAAK,iBA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AM,QAAQ,cAAc,MAAM;AAElC,UAAM,EAAE,MAAM,aAAa,YAAY;AAAA,MACrC,YAAY;AAAA,MACZ,IAAI,UAAU;AAAA,IAChB,CAAC;AAED,WAAO,iCACF,QADE;AAAA,MAEL,YAAY,CAAC,GAAG,MAAM,YAAY,IAAI;AAAA,MACtC,aAAa,CAAC,GAAG,MAAM,aAAa,MAAM,GAAG,QAAQ;AAAA,IACvD;AAAA,EACF;AACF;AAGO,0BAA0B,cAAc;AAC7C,SAAO,CAAC,OAAO,EAAE,cAAc;AAC7B,QAAI,cAAc,mCAAU,MAAM,WAAW;AAE7C,UAAM,YAAY,YAAY,UAC5B,WAAS,MAAM,OAAO,aAAa,EACrC;AAEA,UAAM,OAAO,YAAY;AACzB,UAAM,WAAW,MAAM,cACnB,iCACE,oCAAiB,MAAM,UAAU,GACjC,qBAAM,YAAY,EAAE,OAAO,UAAU,CAAC,CACxC,EAAE,WAAW,KAAK,CAAC,IACnB,CAAC;AAEL,gBAAY,OAAO,WAAW,CAAC;AAC/B,QAAI,MAAM,eAAe,SAAS,QAAQ;AACxC,YAAM,eAAe,mCAAU,UAAU,IAAI;AAC7C,oBAAc,YAAY,OAAO,OAAK,CAAC,aAAa,EAAE,GAAG;AAAA,IAC3D;AAEA,WAAO,iCACF,QADE;AAAA,MAEL,YAAY,MAAM,WAAW,OAC3B,WAAS,MAAM,aAAa,aAAa,QAC3C;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEO,6BAA6B;AAClC,SAAO,WAAU,iCACZ,QADY;AAAA,IAEf,cAAc,CAAC;AAAA,EACjB;AACF;AACO,2BAA2B;AAChC,SAAO,WAAU,iCACZ,QADY;AAAA,IAEf,YAAY,CAAC;AAAA,IACb,aAAa,CAAC;AAAA,EAChB;AACF;",
6
6
  "names": []
7
7
  }
@@ -18,7 +18,6 @@ var __spreadValues = (a, b) => {
18
18
  }
19
19
  return a;
20
20
  };
21
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
22
21
  var __objRest = (source, exclude) => {
23
22
  var target = {};
24
23
  for (var prop in source)
@@ -35,26 +34,21 @@ var __export = (target, all) => {
35
34
  for (var name in all)
36
35
  __defProp(target, name, { get: all[name], enumerable: true });
37
36
  };
38
- var __reExport = (target, module2, copyDefault, desc) => {
39
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
40
- for (let key of __getOwnPropNames(module2))
41
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
42
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
37
+ var __copyProps = (to, from, except, desc) => {
38
+ if (from && typeof from === "object" || typeof from === "function") {
39
+ for (let key of __getOwnPropNames(from))
40
+ if (!__hasOwnProp.call(to, key) && key !== except)
41
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
43
42
  }
44
- return target;
45
- };
46
- var __toESM = (module2, isNodeMode) => {
47
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
43
+ return to;
48
44
  };
49
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
50
- return (module2, temp) => {
51
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
52
- };
53
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
45
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
46
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
54
47
  var ShuttleContainer_exports = {};
55
48
  __export(ShuttleContainer_exports, {
56
49
  default: () => ShuttleContainer_default
57
50
  });
51
+ module.exports = __toCommonJS(ShuttleContainer_exports);
58
52
  var React = __toESM(require("react"));
59
53
  var import_react = require("react");
60
54
  var import_ds_utilities = require("@elliemae/ds-utilities");
@@ -104,5 +98,4 @@ function ShuttleContainer({ items = [], children }) {
104
98
  });
105
99
  }
106
100
  var ShuttleContainer_default = (0, import_withProviders.withProviders)(ShuttleContainer);
107
- module.exports = __toCommonJS(ShuttleContainer_exports);
108
101
  //# sourceMappingURL=ShuttleContainer.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/ShuttleContainer.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-shadow */\nimport { useContext, useMemo } from 'react';\nimport {\n isFunction,\n compose,\n uniqBy,\n values,\n sortBy,\n} from '@elliemae/ds-utilities';\nimport { withProviders } from './withProviders';\nimport {\n prepareItems,\n getActiveIdFromHierarchy,\n filterItemsByHierarchy,\n getItemsById,\n} from './helper';\nimport { SearchState } from './SearchState';\nimport { ShuttleState } from './ShuttleState';\n\nfunction filterItemsByTerm(items, term) {\n return items.filter(\n item =>\n item.name.toLowerCase().indexOf(String(term).toLowerCase()) !== -1 ||\n String(item.id).indexOf(String(term).toLowerCase()) !== -1,\n );\n}\n\nfunction ShuttleContainer({ items = [], children }) {\n const { state: shuttleState, ...handlers } = useContext(\n ShuttleState.Context,\n );\n const { state: searchState } = useContext(SearchState.Context);\n const {\n movedItems,\n hierarchy,\n hierarchyDest,\n checkedItems,\n searchTerm,\n searching,\n toggleItemSelection,\n resetCheckedItems,\n resetMovedItems,\n moveCheckedItems,\n moveItem,\n navigate,\n } = { ...shuttleState, ...searchState, ...handlers };\n\n const sourceItems = useMemo(\n () =>\n compose(\n items => items.filter(item => !movedItems[item.id]),\n items =>\n searchTerm && searching\n ? filterItemsByTerm(items, searchTerm)\n : items,\n items =>\n filterItemsByHierarchy(items, getActiveIdFromHierarchy(hierarchy).id),\n items => prepareItems(items),\n )(items),\n [items, searchTerm, searching, hierarchy, movedItems],\n );\n\n const targetItems = useMemo(() => {\n const hierarchyId = getActiveIdFromHierarchy(hierarchyDest).id;\n return compose(\n items => sortBy(items, ['name']),\n items =>\n hierarchyId\n ? filterItemsByHierarchy(items, hierarchyId).filter(\n item => !movedItems[item.id],\n )\n : uniqBy(values(movedItems), 'id'),\n )(items);\n }, [items, searching, hierarchyDest, movedItems]);\n\n return (\n isFunction(children) &&\n children({\n checkedItems,\n hierarchy,\n hierarchyDest,\n onCheckItem: toggleItemSelection,\n onClearCheckedItems: resetCheckedItems,\n onClearMovedItems: resetMovedItems,\n onMoveCheckedItems: () =>\n moveCheckedItems(getItemsById(checkedItems, items)),\n onMoveItemToSource: item => moveItem(item, false),\n onMoveItemToTarget: item => moveItem(item, true),\n onNavigateOnSourceTo: item => navigate(item, false),\n onNavigateOnTargetTo: item => navigate(item, true),\n sourceItems,\n targetItems,\n })\n );\n}\n\nexport default withProviders(ShuttleContainer);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AACpC,0BAMO;AACP,2BAA8B;AAC9B,oBAKO;AACP,yBAA4B;AAC5B,0BAA6B;AAE7B,2BAA2B,OAAO,MAAM;AACtC,SAAO,MAAM,OACX,UACE,KAAK,KAAK,cAAc,QAAQ,OAAO,MAAM,mBAAmB,MAChE,OAAO,KAAK,IAAI,QAAQ,OAAO,MAAM,mBAAmB;AAAA;AAI9D,0BAA0B,EAAE,QAAQ,IAAI,YAAY;AAClD,QAA6C,kCAC3C,iCAAa,UADP,SAAO,iBAA8B,IAAb,qBAAa,IAAb,CAAxB;AAGR,QAAM,EAAE,OAAO,gBAAgB,6BAAW,+BAAY;AACtD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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