@elliemae/ds-shuttle 3.0.0-next.2 → 3.0.0-next.6

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 (217) hide show
  1. package/dist/cjs/AnimationState.js +75 -0
  2. package/dist/cjs/AnimationState.js.map +7 -0
  3. package/dist/cjs/DSShuttle.js +170 -0
  4. package/dist/cjs/DSShuttle.js.map +7 -0
  5. package/dist/cjs/SearchState.js +60 -0
  6. package/dist/cjs/SearchState.js.map +7 -0
  7. package/dist/cjs/Shuttle.actions.js +136 -0
  8. package/dist/cjs/Shuttle.actions.js.map +7 -0
  9. package/dist/cjs/ShuttleContainer.js +108 -0
  10. package/dist/cjs/ShuttleContainer.js.map +7 -0
  11. package/dist/cjs/ShuttleImpl.js +242 -0
  12. package/dist/cjs/ShuttleImpl.js.map +7 -0
  13. package/dist/cjs/ShuttleRenderer.js +203 -0
  14. package/dist/cjs/ShuttleRenderer.js.map +7 -0
  15. package/dist/cjs/ShuttleState.js +84 -0
  16. package/dist/cjs/ShuttleState.js.map +7 -0
  17. package/dist/cjs/animation/animationConfig.js +78 -0
  18. package/dist/cjs/animation/animationConfig.js.map +7 -0
  19. package/dist/cjs/classedComponents.js +72 -0
  20. package/dist/cjs/classedComponents.js.map +7 -0
  21. package/dist/cjs/components/LoadingIndicator.js +52 -0
  22. package/dist/cjs/components/LoadingIndicator.js.map +7 -0
  23. package/dist/cjs/components/OverflowList.js +71 -0
  24. package/dist/cjs/components/OverflowList.js.map +7 -0
  25. package/dist/cjs/components/ShuttleBreadcrumb.js +54 -0
  26. package/dist/cjs/components/ShuttleBreadcrumb.js.map +7 -0
  27. package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js +48 -0
  28. package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js.map +7 -0
  29. package/dist/cjs/components/ShuttleListItem/ActionButtons.js +76 -0
  30. package/dist/cjs/components/ShuttleListItem/ActionButtons.js.map +7 -0
  31. package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js +121 -0
  32. package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js.map +7 -0
  33. package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +127 -0
  34. package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +7 -0
  35. package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +110 -0
  36. package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +7 -0
  37. package/dist/cjs/components/ShuttleListPanel.js +49 -0
  38. package/dist/cjs/components/ShuttleListPanel.js.map +7 -0
  39. package/dist/cjs/components/ShuttleSearchBox.js +99 -0
  40. package/dist/cjs/components/ShuttleSearchBox.js.map +7 -0
  41. package/dist/cjs/components/ShuttleSource.js +223 -0
  42. package/dist/cjs/components/ShuttleSource.js.map +7 -0
  43. package/dist/cjs/components/ShuttleTarget.js +135 -0
  44. package/dist/cjs/components/ShuttleTarget.js.map +7 -0
  45. package/dist/cjs/components/VirtualizedItem.js +65 -0
  46. package/dist/cjs/components/VirtualizedItem.js.map +7 -0
  47. package/dist/cjs/components/VirtualizedList.js +104 -0
  48. package/dist/cjs/components/VirtualizedList.js.map +7 -0
  49. package/dist/cjs/components/VirtualizedSortableList.js +77 -0
  50. package/dist/cjs/components/VirtualizedSortableList.js.map +7 -0
  51. package/dist/cjs/helper.js +99 -0
  52. package/dist/cjs/helper.js.map +7 -0
  53. package/dist/cjs/index.js +38 -0
  54. package/dist/cjs/index.js.map +7 -0
  55. package/dist/cjs/tests/utils.js +1235 -0
  56. package/dist/cjs/tests/utils.js.map +7 -0
  57. package/dist/cjs/updateShuttleStateFromProps.js +108 -0
  58. package/dist/cjs/updateShuttleStateFromProps.js.map +7 -0
  59. package/dist/cjs/utils.js +54 -0
  60. package/dist/cjs/utils.js.map +7 -0
  61. package/dist/cjs/withProviders.js +57 -0
  62. package/dist/cjs/withProviders.js.map +7 -0
  63. package/{esm → dist/esm}/AnimationState.js +12 -8
  64. package/dist/esm/AnimationState.js.map +7 -0
  65. package/dist/esm/DSShuttle.js +141 -0
  66. package/dist/esm/DSShuttle.js.map +7 -0
  67. package/dist/esm/SearchState.js +31 -0
  68. package/dist/esm/SearchState.js.map +7 -0
  69. package/dist/esm/Shuttle.actions.js +118 -0
  70. package/dist/esm/Shuttle.actions.js.map +7 -0
  71. package/dist/esm/ShuttleContainer.js +92 -0
  72. package/dist/esm/ShuttleContainer.js.map +7 -0
  73. package/dist/esm/ShuttleImpl.js +229 -0
  74. package/dist/esm/ShuttleImpl.js.map +7 -0
  75. package/dist/esm/ShuttleRenderer.js +176 -0
  76. package/dist/esm/ShuttleRenderer.js.map +7 -0
  77. package/dist/esm/ShuttleState.js +55 -0
  78. package/dist/esm/ShuttleState.js.map +7 -0
  79. package/dist/esm/animation/animationConfig.js +49 -0
  80. package/dist/esm/animation/animationConfig.js.map +7 -0
  81. package/dist/esm/classedComponents.js +43 -0
  82. package/dist/esm/classedComponents.js.map +7 -0
  83. package/dist/esm/components/LoadingIndicator.js +23 -0
  84. package/dist/esm/components/LoadingIndicator.js.map +7 -0
  85. package/dist/esm/components/OverflowList.js +44 -0
  86. package/dist/esm/components/OverflowList.js.map +7 -0
  87. package/dist/esm/components/ShuttleBreadcrumb.js +25 -0
  88. package/dist/esm/components/ShuttleBreadcrumb.js.map +7 -0
  89. package/dist/esm/components/ShuttleInfiniteScrollIndicator.js +19 -0
  90. package/dist/esm/components/ShuttleInfiniteScrollIndicator.js.map +7 -0
  91. package/dist/esm/components/ShuttleListItem/ActionButtons.js +49 -0
  92. package/dist/esm/components/ShuttleListItem/ActionButtons.js.map +7 -0
  93. package/dist/esm/components/ShuttleListItem/ShuttleListItem.js +94 -0
  94. package/dist/esm/components/ShuttleListItem/ShuttleListItem.js.map +7 -0
  95. package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js +100 -0
  96. package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +7 -0
  97. package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js +83 -0
  98. package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +7 -0
  99. package/dist/esm/components/ShuttleListPanel.js +20 -0
  100. package/dist/esm/components/ShuttleListPanel.js.map +7 -0
  101. package/dist/esm/components/ShuttleSearchBox.js +70 -0
  102. package/dist/esm/components/ShuttleSearchBox.js.map +7 -0
  103. package/dist/esm/components/ShuttleSource.js +208 -0
  104. package/dist/esm/components/ShuttleSource.js.map +7 -0
  105. package/dist/esm/components/ShuttleTarget.js +119 -0
  106. package/dist/esm/components/ShuttleTarget.js.map +7 -0
  107. package/dist/esm/components/VirtualizedItem.js +38 -0
  108. package/dist/esm/components/VirtualizedItem.js.map +7 -0
  109. package/dist/esm/components/VirtualizedList.js +77 -0
  110. package/dist/esm/components/VirtualizedList.js.map +7 -0
  111. package/dist/esm/components/VirtualizedSortableList.js +50 -0
  112. package/dist/esm/components/VirtualizedSortableList.js.map +7 -0
  113. package/dist/esm/helper.js +72 -0
  114. package/dist/esm/helper.js.map +7 -0
  115. package/dist/esm/index.js +9 -0
  116. package/dist/esm/index.js.map +7 -0
  117. package/dist/esm/tests/utils.js +1208 -0
  118. package/dist/esm/tests/utils.js.map +7 -0
  119. package/dist/esm/updateShuttleStateFromProps.js +81 -0
  120. package/dist/esm/updateShuttleStateFromProps.js.map +7 -0
  121. package/dist/esm/utils.js +27 -0
  122. package/dist/esm/utils.js.map +7 -0
  123. package/dist/esm/withProviders.js +30 -0
  124. package/dist/esm/withProviders.js.map +7 -0
  125. package/package.json +98 -89
  126. package/cjs/AnimationState.js +0 -48
  127. package/cjs/DSShuttle.js +0 -223
  128. package/cjs/SearchState.js +0 -41
  129. package/cjs/Shuttle.actions.js +0 -137
  130. package/cjs/ShuttleContainer.js +0 -87
  131. package/cjs/ShuttleImpl.js +0 -311
  132. package/cjs/ShuttleRenderer.js +0 -139
  133. package/cjs/ShuttleState.js +0 -80
  134. package/cjs/animation/animationConfig.js +0 -81
  135. package/cjs/classedComponents.js +0 -71
  136. package/cjs/components/LoadingIndicator.js +0 -25
  137. package/cjs/components/OverflowList.js +0 -53
  138. package/cjs/components/ShuttleBreadcrumb.js +0 -42
  139. package/cjs/components/ShuttleInfiniteScrollIndicator.js +0 -39
  140. package/cjs/components/ShuttleListItem/ActionButtons.js +0 -55
  141. package/cjs/components/ShuttleListItem/ShuttleListItem.js +0 -85
  142. package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +0 -76
  143. package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +0 -57
  144. package/cjs/components/ShuttleListPanel.js +0 -31
  145. package/cjs/components/ShuttleSearchBox.js +0 -110
  146. package/cjs/components/ShuttleSource.js +0 -188
  147. package/cjs/components/ShuttleTarget.js +0 -116
  148. package/cjs/components/VirtualizedItem.js +0 -46
  149. package/cjs/components/VirtualizedList.js +0 -93
  150. package/cjs/components/VirtualizedSortableList.js +0 -41
  151. package/cjs/helper.js +0 -117
  152. package/cjs/index.js +0 -12
  153. package/cjs/updateShuttleStateFromProps.js +0 -94
  154. package/cjs/utils.js +0 -43
  155. package/cjs/withProviders.js +0 -29
  156. package/esm/DSShuttle.js +0 -213
  157. package/esm/SearchState.js +0 -35
  158. package/esm/Shuttle.actions.js +0 -123
  159. package/esm/ShuttleContainer.js +0 -80
  160. package/esm/ShuttleImpl.js +0 -304
  161. package/esm/ShuttleRenderer.js +0 -132
  162. package/esm/ShuttleState.js +0 -74
  163. package/esm/animation/animationConfig.js +0 -77
  164. package/esm/classedComponents.js +0 -51
  165. package/esm/components/LoadingIndicator.js +0 -18
  166. package/esm/components/OverflowList.js +0 -46
  167. package/esm/components/ShuttleBreadcrumb.js +0 -35
  168. package/esm/components/ShuttleInfiniteScrollIndicator.js +0 -32
  169. package/esm/components/ShuttleListItem/ActionButtons.js +0 -43
  170. package/esm/components/ShuttleListItem/ShuttleListItem.js +0 -76
  171. package/esm/components/ShuttleListItem/ShuttleSourceListItem.js +0 -68
  172. package/esm/components/ShuttleListItem/ShuttleTargetListItem.js +0 -49
  173. package/esm/components/ShuttleListPanel.js +0 -24
  174. package/esm/components/ShuttleSearchBox.js +0 -104
  175. package/esm/components/ShuttleSource.js +0 -179
  176. package/esm/components/ShuttleTarget.js +0 -107
  177. package/esm/components/VirtualizedItem.js +0 -40
  178. package/esm/components/VirtualizedList.js +0 -84
  179. package/esm/components/VirtualizedSortableList.js +0 -34
  180. package/esm/helper.js +0 -78
  181. package/esm/index.js +0 -2
  182. package/esm/updateShuttleStateFromProps.js +0 -88
  183. package/esm/utils.js +0 -18
  184. package/esm/withProviders.js +0 -22
  185. package/types/AnimationState.d.ts +0 -26
  186. package/types/DSShuttle.d.ts +0 -341
  187. package/types/SearchState.d.ts +0 -22
  188. package/types/Shuttle.actions.d.ts +0 -11
  189. package/types/ShuttleContainer.d.ts +0 -3
  190. package/types/ShuttleImpl.d.ts +0 -3
  191. package/types/ShuttleRenderer.d.ts +0 -37
  192. package/types/ShuttleState.d.ts +0 -53
  193. package/types/animation/animationConfig.d.ts +0 -68
  194. package/types/classedComponents.d.ts +0 -14
  195. package/types/components/LoadingIndicator.d.ts +0 -3
  196. package/types/components/OverflowList.d.ts +0 -7
  197. package/types/components/ShuttleBreadcrumb.d.ts +0 -7
  198. package/types/components/ShuttleInfiniteScrollIndicator.d.ts +0 -5
  199. package/types/components/ShuttleListItem/ActionButtons.d.ts +0 -4
  200. package/types/components/ShuttleListItem/ShuttleListItem.d.ts +0 -14
  201. package/types/components/ShuttleListItem/ShuttleSourceListItem.d.ts +0 -13
  202. package/types/components/ShuttleListItem/ShuttleTargetListItem.d.ts +0 -13
  203. package/types/components/ShuttleListPanel.d.ts +0 -7
  204. package/types/components/ShuttleSearchBox.d.ts +0 -20
  205. package/types/components/ShuttleSource.d.ts +0 -54
  206. package/types/components/ShuttleTarget.d.ts +0 -16
  207. package/types/components/VirtualizedItem.d.ts +0 -3
  208. package/types/components/VirtualizedList.d.ts +0 -12
  209. package/types/components/VirtualizedSortableList.d.ts +0 -6
  210. package/types/helper.d.ts +0 -16
  211. package/types/index.d.ts +0 -1
  212. package/types/tests/DSShuttle.events.test.d.ts +0 -1
  213. package/types/tests/DSShuttle.test.d.ts +0 -1
  214. package/types/tests/utils.d.ts +0 -116
  215. package/types/updateShuttleStateFromProps.d.ts +0 -1
  216. package/types/utils.d.ts +0 -2
  217. package/types/withProviders.d.ts +0 -3
@@ -0,0 +1,94 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import * as React from "react";
33
+ import React2 from "react";
34
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
35
+ import { animated } from "react-spring/web";
36
+ import { DSTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
37
+ import { sortableHandle } from "react-sortable-hoc";
38
+ import { GripperVertical } from "@elliemae/ds-icons";
39
+ import { isMovable } from "../../helper";
40
+ const blockName = "shuttle-list-item";
41
+ const Wrapper = aggregatedClasses(animated.li)(blockName);
42
+ const ActionsGroup = aggregatedClasses("div")(blockName, "actions");
43
+ const IconWrapper = aggregatedClasses("div")(blockName, "icon-wrapper");
44
+ const Content = aggregatedClasses("label")(blockName, "content", ({ isChecked, canMove, isReadonly }) => ({
45
+ checked: isChecked,
46
+ "can-hover": canMove,
47
+ "read-only": isReadonly
48
+ }));
49
+ const SortHandler = sortableHandle(() => /* @__PURE__ */ React2.createElement(GripperVertical, {
50
+ className: "gripper"
51
+ }));
52
+ function ShuttleListItem(_a) {
53
+ var _b = _a, {
54
+ item = {},
55
+ showIcons = void 0,
56
+ showIcon = true,
57
+ onSelect = () => null,
58
+ isChecked = false,
59
+ style = void 0,
60
+ showActions = true,
61
+ actions = [],
62
+ showSortHandler = false
63
+ } = _b, rest = __objRest(_b, [
64
+ "item",
65
+ "showIcons",
66
+ "showIcon",
67
+ "onSelect",
68
+ "isChecked",
69
+ "style",
70
+ "showActions",
71
+ "actions",
72
+ "showSortHandler"
73
+ ]);
74
+ return /* @__PURE__ */ React2.createElement(Wrapper, __spreadProps(__spreadValues({}, rest), {
75
+ role: "listitem",
76
+ style
77
+ }), /* @__PURE__ */ React2.createElement(Content, {
78
+ classProps: {
79
+ canMove: isMovable(item),
80
+ isChecked,
81
+ isReadonly: item.readyOnly
82
+ },
83
+ onClick: onSelect
84
+ }, showSortHandler && /* @__PURE__ */ React2.createElement(SortHandler, null), (showIcon || showIcons) && /* @__PURE__ */ React2.createElement(IconWrapper, null, item.icon), /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
85
+ className: "shuttle-tooltip-text",
86
+ value: item.name
87
+ })), showActions && /* @__PURE__ */ React2.createElement(ActionsGroup, null, actions));
88
+ }
89
+ var ShuttleListItem_default = ShuttleListItem;
90
+ export {
91
+ ShuttleListItem,
92
+ ShuttleListItem_default as default
93
+ };
94
+ //# sourceMappingURL=ShuttleListItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ShuttleListItem.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { animated } from 'react-spring/web';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { sortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { isMovable } from '../../helper';\n\nconst blockName = 'shuttle-list-item';\nconst Wrapper = aggregatedClasses(animated.li)(blockName);\nconst ActionsGroup = aggregatedClasses('div')(blockName, 'actions');\nconst IconWrapper = aggregatedClasses('div')(blockName, 'icon-wrapper');\nconst Content = aggregatedClasses('label')(blockName, 'content', ({ isChecked, canMove, isReadonly }) => ({\n checked: isChecked,\n 'can-hover': canMove,\n 'read-only': isReadonly,\n}));\n\nconst SortHandler = sortableHandle(() => <GripperVertical className=\"gripper\" />);\n\nfunction ShuttleListItem({\n item = {},\n showIcons = undefined,\n showIcon = true,\n onSelect = () => null,\n isChecked = false,\n style = undefined,\n showActions = true,\n actions = [],\n showSortHandler = false,\n ...rest\n}) {\n return (\n <Wrapper {...rest} role=\"listitem\" style={style}>\n <Content\n classProps={{\n canMove: isMovable(item),\n isChecked,\n isReadonly: item.readyOnly,\n }}\n onClick={onSelect}\n >\n {showSortHandler && <SortHandler />}\n {(showIcon || showIcons) && <IconWrapper>{item.icon}</IconWrapper>}\n <DSTruncatedTooltipText className=\"shuttle-tooltip-text\" value={item.name} />\n </Content>\n {showActions && <ActionsGroup>{actions}</ActionsGroup>}\n </Wrapper>\n );\n}\n\nexport { ShuttleListItem };\nexport default ShuttleListItem;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAClB,MAAM,UAAU,kBAAkB,SAAS,IAAI;AAC/C,MAAM,eAAe,kBAAkB,OAAO,WAAW;AACzD,MAAM,cAAc,kBAAkB,OAAO,WAAW;AACxD,MAAM,UAAU,kBAAkB,SAAS,WAAW,WAAW,CAAC,EAAE,WAAW,SAAS,iBAAkB;AAAA,EACxG,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA;AAGf,MAAM,cAAc,eAAe,MAAM,qCAAC,iBAAD;AAAA,EAAiB,WAAU;AAAA;AAEpE,yBAAyB,IAWtB;AAXsB,eACvB;AAAA,WAAO;AAAA,IACP,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW,MAAM;AAAA,IACjB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,UAAU;AAAA,IACV,kBAAkB;AAAA,MATK,IAUpB,iBAVoB,IAUpB;AAAA,IATH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,qCAAC,SAAD,iCAAa,OAAb;AAAA,IAAmB,MAAK;AAAA,IAAW;AAAA,MACjC,qCAAC,SAAD;AAAA,IACE,YAAY;AAAA,MACV,SAAS,UAAU;AAAA,MACnB;AAAA,MACA,YAAY,KAAK;AAAA;AAAA,IAEnB,SAAS;AAAA,KAER,mBAAmB,qCAAC,aAAD,OAClB,aAAY,cAAc,qCAAC,aAAD,MAAc,KAAK,OAC/C,qCAAC,wBAAD;AAAA,IAAwB,WAAU;AAAA,IAAuB,OAAO,KAAK;AAAA,OAEtE,eAAe,qCAAC,cAAD,MAAe;AAAA;AAMrC,IAAO,0BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,100 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import * as React from "react";
33
+ import React2, { useState, useCallback, useEffect } from "react";
34
+ import { isMovable } from "../../helper";
35
+ import { DrillDownButton, MoveButton } from "./ActionButtons";
36
+ import { ShuttleListItem } from "./ShuttleListItem";
37
+ function ShuttleSourceListItem(_a) {
38
+ var _b = _a, {
39
+ item = {},
40
+ onItemCheck = () => null,
41
+ onMoveToTarget = () => null,
42
+ onNavigateOnSourceTo = () => null,
43
+ isChecked = false,
44
+ showMoveButton = true,
45
+ showDrillDownButton = true,
46
+ index
47
+ } = _b, rest = __objRest(_b, [
48
+ "item",
49
+ "onItemCheck",
50
+ "onMoveToTarget",
51
+ "onNavigateOnSourceTo",
52
+ "isChecked",
53
+ "showMoveButton",
54
+ "showDrillDownButton",
55
+ "index"
56
+ ]);
57
+ const [clicked, setClicked] = useState(false);
58
+ const moveToTarget = useCallback(() => onMoveToTarget(item), [item]);
59
+ useEffect(() => {
60
+ if (clicked) {
61
+ moveToTarget();
62
+ }
63
+ }, [clicked]);
64
+ const navigateOnSourceTo = useCallback(() => onNavigateOnSourceTo(item), [
65
+ item
66
+ ]);
67
+ const checkItem = useCallback(() => {
68
+ if (!clicked)
69
+ onItemCheck(item);
70
+ }, [item, clicked]);
71
+ const handleOnClick = () => {
72
+ if (!clicked) {
73
+ setClicked(true);
74
+ }
75
+ };
76
+ return /* @__PURE__ */ React2.createElement(ShuttleListItem, __spreadProps(__spreadValues({}, rest), {
77
+ actions: [
78
+ showDrillDownButton && /* @__PURE__ */ React2.createElement(DrillDownButton, {
79
+ key: "drill-down",
80
+ disabled: !item.hasChildren && !item.asyncLoad || item.readOnly || item.disableDrillDown,
81
+ onClick: navigateOnSourceTo
82
+ }),
83
+ showMoveButton && /* @__PURE__ */ React2.createElement(MoveButton, {
84
+ "data-testid": "ds-shuttle__move-button",
85
+ key: "move",
86
+ disabled: !isMovable(item) || item.readOnly,
87
+ onClick: handleOnClick
88
+ })
89
+ ],
90
+ isChecked,
91
+ item,
92
+ onSelect: checkItem
93
+ }));
94
+ }
95
+ var ShuttleSourceListItem_default = ShuttleSourceListItem;
96
+ export {
97
+ ShuttleSourceListItem,
98
+ ShuttleSourceListItem_default as default
99
+ };
100
+ //# sourceMappingURL=ShuttleSourceListItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ShuttleSourceListItem.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { isMovable } from '../../helper';\nimport { DrillDownButton, MoveButton } from './ActionButtons';\nimport { ShuttleListItem } from './ShuttleListItem';\n\nfunction ShuttleSourceListItem({\n item = {},\n onItemCheck = () => null,\n onMoveToTarget = () => null,\n onNavigateOnSourceTo = () => null,\n isChecked = false,\n showMoveButton = true,\n showDrillDownButton = true,\n index,\n ...rest\n}) {\n const [clicked, setClicked] = useState(false);\n const moveToTarget = useCallback(() => onMoveToTarget(item), [item]);\n useEffect(() => {\n if (clicked) {\n moveToTarget();\n }\n }, [clicked]);\n const navigateOnSourceTo = useCallback(() => onNavigateOnSourceTo(item), [\n item,\n ]);\n const checkItem = useCallback(() => {\n if (!clicked) onItemCheck(item);\n }, [item, clicked]);\n const handleOnClick = () => {\n if (!clicked) {\n setClicked(true);\n }\n };\n\n return (\n <ShuttleListItem\n {...rest}\n actions={[\n showDrillDownButton && (\n <DrillDownButton\n key=\"drill-down\"\n disabled={\n (!item.hasChildren && !item.asyncLoad) ||\n item.readOnly ||\n item.disableDrillDown\n }\n onClick={navigateOnSourceTo}\n />\n ),\n showMoveButton && (\n <MoveButton\n data-testid=\"ds-shuttle__move-button\"\n key=\"move\"\n disabled={!isMovable(item) || item.readOnly}\n onClick={handleOnClick}\n />\n ),\n ]}\n isChecked={isChecked}\n item={item}\n onSelect={checkItem}\n />\n );\n}\n\nexport { ShuttleSourceListItem };\nexport default ShuttleSourceListItem;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AACA;AAEA,+BAA+B,IAU5B;AAV4B,eAC7B;AAAA,WAAO;AAAA,IACP,cAAc,MAAM;AAAA,IACpB,iBAAiB,MAAM;AAAA,IACvB,uBAAuB,MAAM;AAAA,IAC7B,YAAY;AAAA,IACZ,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB;AAAA,MAR6B,IAS1B,iBAT0B,IAS1B;AAAA,IARH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,CAAC,SAAS,cAAc,SAAS;AACvC,QAAM,eAAe,YAAY,MAAM,eAAe,OAAO,CAAC;AAC9D,YAAU,MAAM;AACd,QAAI,SAAS;AACX;AAAA;AAAA,KAED,CAAC;AACJ,QAAM,qBAAqB,YAAY,MAAM,qBAAqB,OAAO;AAAA,IACvE;AAAA;AAEF,QAAM,YAAY,YAAY,MAAM;AAClC,QAAI,CAAC;AAAS,kBAAY;AAAA,KACzB,CAAC,MAAM;AACV,QAAM,gBAAgB,MAAM;AAC1B,QAAI,CAAC,SAAS;AACZ,iBAAW;AAAA;AAAA;AAIf,SACE,qCAAC,iBAAD,iCACM,OADN;AAAA,IAEE,SAAS;AAAA,MACP,uBACE,qCAAC,iBAAD;AAAA,QACE,KAAI;AAAA,QACJ,UACG,CAAC,KAAK,eAAe,CAAC,KAAK,aAC5B,KAAK,YACL,KAAK;AAAA,QAEP,SAAS;AAAA;AAAA,MAGb,kBACE,qCAAC,YAAD;AAAA,QACE,eAAY;AAAA,QACZ,KAAI;AAAA,QACJ,UAAU,CAAC,UAAU,SAAS,KAAK;AAAA,QACnC,SAAS;AAAA;AAAA;AAAA,IAIf;AAAA,IACA;AAAA,IACA,UAAU;AAAA;AAAA;AAMhB,IAAO,gCAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,83 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import * as React from "react";
33
+ import React2, { useCallback } from "react";
34
+ import { DeleteButton, DrillDownButton } from "./ActionButtons";
35
+ import { ShuttleListItem } from "./ShuttleListItem";
36
+ function ShuttleTargetListItem(_a) {
37
+ var _b = _a, {
38
+ item = {},
39
+ onMoveToSource = () => null,
40
+ onNavigateOnTargetTo = () => null,
41
+ isRoot = false,
42
+ showDeleteButton = true,
43
+ showDrillDownButton = true,
44
+ showActions = true,
45
+ index
46
+ } = _b, rest = __objRest(_b, [
47
+ "item",
48
+ "onMoveToSource",
49
+ "onNavigateOnTargetTo",
50
+ "isRoot",
51
+ "showDeleteButton",
52
+ "showDrillDownButton",
53
+ "showActions",
54
+ "index"
55
+ ]);
56
+ const moveToSource = useCallback(() => onMoveToSource(item), [item]);
57
+ const navigateOnTargetTo = useCallback(() => onNavigateOnTargetTo(item), [
58
+ item
59
+ ]);
60
+ return /* @__PURE__ */ React2.createElement(ShuttleListItem, __spreadProps(__spreadValues({}, rest), {
61
+ actions: [
62
+ showDrillDownButton && /* @__PURE__ */ React2.createElement(DrillDownButton, {
63
+ key: "drill-down",
64
+ disabled: !item.hasChildren && !item.asyncLoad || item.readOnly || item.disableDrillDown,
65
+ onClick: navigateOnTargetTo
66
+ }),
67
+ showDeleteButton && isRoot && /* @__PURE__ */ React2.createElement(DeleteButton, {
68
+ key: "delete",
69
+ disabled: item.readOnly,
70
+ onClick: moveToSource,
71
+ "data-testid": "ds-shuttle__close-button"
72
+ })
73
+ ],
74
+ item,
75
+ showActions
76
+ }));
77
+ }
78
+ var ShuttleTargetListItem_default = ShuttleTargetListItem;
79
+ export {
80
+ ShuttleTargetListItem,
81
+ ShuttleTargetListItem_default as default
82
+ };
83
+ //# sourceMappingURL=ShuttleTargetListItem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ShuttleTargetListItem.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useCallback } from 'react';\nimport { DeleteButton, DrillDownButton } from './ActionButtons';\nimport { ShuttleListItem } from './ShuttleListItem';\n\nfunction ShuttleTargetListItem({\n item = {},\n onMoveToSource = () => null,\n onNavigateOnTargetTo = () => null,\n isRoot = false,\n showDeleteButton = true,\n showDrillDownButton = true,\n showActions = true,\n index,\n ...rest\n}) {\n const moveToSource = useCallback(() => onMoveToSource(item), [item]);\n const navigateOnTargetTo = useCallback(() => onNavigateOnTargetTo(item), [\n item,\n ]);\n return (\n <ShuttleListItem\n {...rest}\n actions={[\n showDrillDownButton && (\n <DrillDownButton\n key=\"drill-down\"\n disabled={\n (!item.hasChildren && !item.asyncLoad) ||\n item.readOnly ||\n item.disableDrillDown\n }\n onClick={navigateOnTargetTo}\n />\n ),\n showDeleteButton && isRoot && (\n <DeleteButton\n key=\"delete\"\n disabled={item.readOnly}\n onClick={moveToSource}\n data-testid=\"ds-shuttle__close-button\"\n />\n ),\n ]}\n item={item}\n showActions={showActions}\n />\n );\n}\n\nexport { ShuttleTargetListItem };\nexport default ShuttleTargetListItem;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AAEA,+BAA+B,IAU5B;AAV4B,eAC7B;AAAA,WAAO;AAAA,IACP,iBAAiB,MAAM;AAAA,IACvB,uBAAuB,MAAM;AAAA,IAC7B,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,sBAAsB;AAAA,IACtB,cAAc;AAAA,IACd;AAAA,MAR6B,IAS1B,iBAT0B,IAS1B;AAAA,IARH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,eAAe,YAAY,MAAM,eAAe,OAAO,CAAC;AAC9D,QAAM,qBAAqB,YAAY,MAAM,qBAAqB,OAAO;AAAA,IACvE;AAAA;AAEF,SACE,qCAAC,iBAAD,iCACM,OADN;AAAA,IAEE,SAAS;AAAA,MACP,uBACE,qCAAC,iBAAD;AAAA,QACE,KAAI;AAAA,QACJ,UACG,CAAC,KAAK,eAAe,CAAC,KAAK,aAC5B,KAAK,YACL,KAAK;AAAA,QAEP,SAAS;AAAA;AAAA,MAGb,oBAAoB,UAClB,qCAAC,cAAD;AAAA,QACE,KAAI;AAAA,QACJ,UAAU,KAAK;AAAA,QACf,SAAS;AAAA,QACT,eAAY;AAAA;AAAA;AAAA,IAIlB;AAAA,IACA;AAAA;AAAA;AAMN,IAAO,gCAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import React2 from "react";
3
+ import { DSButton } from "@elliemae/ds-button";
4
+ import { ShuttleListPanel as Wrapper } from "../classedComponents";
5
+ function ShuttleListPanel({ onClick = () => null, open = false, children }) {
6
+ return /* @__PURE__ */ React2.createElement(Wrapper, {
7
+ classProps: { open }
8
+ }, /* @__PURE__ */ React2.createElement(DSButton, {
9
+ buttonType: "text",
10
+ icon: children,
11
+ onClick,
12
+ "data-testid": "list-panel-btn"
13
+ }));
14
+ }
15
+ var ShuttleListPanel_default = ShuttleListPanel;
16
+ export {
17
+ ShuttleListPanel,
18
+ ShuttleListPanel_default as default
19
+ };
20
+ //# sourceMappingURL=ShuttleListPanel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleListPanel.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\nimport { ShuttleListPanel as Wrapper } from '../classedComponents';\n\nfunction ShuttleListPanel({ onClick = () => null, open = false, children }) {\n return (\n <Wrapper classProps={{ open }}>\n <DSButton buttonType=\"text\" icon={children} onClick={onClick} data-testid=\"list-panel-btn\" />\n </Wrapper>\n );\n}\n\nexport { ShuttleListPanel };\nexport default ShuttleListPanel;\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AAEA,0BAA0B,EAAE,UAAU,MAAM,MAAM,OAAO,OAAO,YAAY;AAC1E,SACE,qCAAC,SAAD;AAAA,IAAS,YAAY,EAAE;AAAA,KACrB,qCAAC,UAAD;AAAA,IAAU,YAAW;AAAA,IAAO,MAAM;AAAA,IAAU;AAAA,IAAkB,eAAY;AAAA;AAAA;AAMhF,IAAO,2BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,70 @@
1
+ import * as React from "react";
2
+ import React2, { Component } from "react";
3
+ import { aggregatedClasses } from "@elliemae/ds-classnames";
4
+ import { debounce } from "@elliemae/ds-utilities";
5
+ import { DSTextBox } from "@elliemae/ds-form";
6
+ const blockName = "shuttle-search-box";
7
+ const SearchBoxContainer = aggregatedClasses("div")(blockName, null, ({ isOpen }) => ({ opened: isOpen }));
8
+ const filterList = debounce((term, onFilterCallback) => {
9
+ onFilterCallback(term);
10
+ }, 200);
11
+ class ShuttleSearchBox extends Component {
12
+ constructor(props) {
13
+ super(props);
14
+ this.state = {
15
+ value: props.value,
16
+ prevProps: {}
17
+ };
18
+ this.handleKeyPress = this.handleKeyPress.bind(this);
19
+ this.handleChange = this.handleChange.bind(this);
20
+ }
21
+ static getDerivedStateFromProps(nextProps, { prevProps }) {
22
+ const { value } = nextProps;
23
+ if (value !== prevProps.value) {
24
+ return {
25
+ value,
26
+ prevProps: { value }
27
+ };
28
+ }
29
+ return null;
30
+ }
31
+ handleChange(e) {
32
+ const { onChange, filterOnKeyStroke, onFilter } = this.props;
33
+ const { value } = e.target;
34
+ onChange(value);
35
+ if (filterOnKeyStroke)
36
+ filterList(value, onFilter);
37
+ this.setState({ value });
38
+ }
39
+ handleKeyPress(e) {
40
+ const { onFilter } = this.props;
41
+ if (e.keyCode === 13)
42
+ onFilter(e.target.value);
43
+ }
44
+ render() {
45
+ const { value } = this.state;
46
+ const { isOpen, onClose, placeholder } = this.props;
47
+ return /* @__PURE__ */ React2.createElement(SearchBoxContainer, {
48
+ classProps: { isOpen }
49
+ }, /* @__PURE__ */ React2.createElement(DSTextBox, {
50
+ autoFocus: true,
51
+ clearable: true,
52
+ onChange: this.handleChange,
53
+ onClear: onClose,
54
+ onKeyDown: this.handleKeyPress,
55
+ placeholder,
56
+ value
57
+ }));
58
+ }
59
+ }
60
+ ShuttleSearchBox.defaultProps = {
61
+ filterOnKeyStroke: false,
62
+ onChange: () => null,
63
+ onFilter: () => null
64
+ };
65
+ var ShuttleSearchBox_default = ShuttleSearchBox;
66
+ export {
67
+ ShuttleSearchBox,
68
+ ShuttleSearchBox_default as default
69
+ };
70
+ //# sourceMappingURL=ShuttleSearchBox.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleSearchBox.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-unused-state */\nimport React, { Component } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { debounce } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '@elliemae/ds-form';\n\nconst blockName = 'shuttle-search-box';\n\nconst SearchBoxContainer = aggregatedClasses('div')(blockName, null, ({ isOpen }) => ({ opened: isOpen }));\n\nconst filterList = debounce((term, onFilterCallback) => {\n onFilterCallback(term);\n}, 200);\n\nclass ShuttleSearchBox extends Component {\n static defaultProps = {\n filterOnKeyStroke: false,\n onChange: () => null,\n onFilter: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n prevProps: {},\n };\n this.handleKeyPress = this.handleKeyPress.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n\n static getDerivedStateFromProps(nextProps, { prevProps }) {\n const { value } = nextProps;\n if (value !== prevProps.value) {\n return {\n value,\n prevProps: { value },\n };\n }\n return null;\n }\n\n handleChange(e) {\n const { onChange, filterOnKeyStroke, onFilter } = this.props;\n const { value } = e.target;\n onChange(value);\n if (filterOnKeyStroke) filterList(value, onFilter);\n this.setState({ value });\n }\n\n handleKeyPress(e) {\n const { onFilter } = this.props;\n if (e.keyCode === 13) onFilter(e.target.value);\n }\n\n render() {\n const { value } = this.state;\n const { isOpen, onClose, placeholder } = this.props;\n return (\n <SearchBoxContainer classProps={{ isOpen }}>\n <DSTextBox\n autoFocus\n clearable\n onChange={this.handleChange}\n onClear={onClose}\n onKeyDown={this.handleKeyPress}\n placeholder={placeholder}\n value={value}\n />\n </SearchBoxContainer>\n );\n }\n}\n\nexport { ShuttleSearchBox };\nexport default ShuttleSearchBox;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,qBAAqB,kBAAkB,OAAO,WAAW,MAAM,CAAC,EAAE,aAAc,GAAE,QAAQ;AAEhG,MAAM,aAAa,SAAS,CAAC,MAAM,qBAAqB;AACtD,mBAAiB;AAAA,GAChB;AAEH,+BAA+B,UAAU;AAAA,EAOvC,YAAY,OAAO;AACjB,UAAM;AACN,SAAK,QAAQ;AAAA,MACX,OAAO,MAAM;AAAA,MACb,WAAW;AAAA;AAEb,SAAK,iBAAiB,KAAK,eAAe,KAAK;AAC/C,SAAK,eAAe,KAAK,aAAa,KAAK;AAAA;AAAA,SAGtC,yBAAyB,WAAW,EAAE,aAAa;AACxD,UAAM,EAAE,UAAU;AAClB,QAAI,UAAU,UAAU,OAAO;AAC7B,aAAO;AAAA,QACL;AAAA,QACA,WAAW,EAAE;AAAA;AAAA;AAGjB,WAAO;AAAA;AAAA,EAGT,aAAa,GAAG;AACd,UAAM,EAAE,UAAU,mBAAmB,aAAa,KAAK;AACvD,UAAM,EAAE,UAAU,EAAE;AACpB,aAAS;AACT,QAAI;AAAmB,iBAAW,OAAO;AACzC,SAAK,SAAS,EAAE;AAAA;AAAA,EAGlB,eAAe,GAAG;AAChB,UAAM,EAAE,aAAa,KAAK;AAC1B,QAAI,EAAE,YAAY;AAAI,eAAS,EAAE,OAAO;AAAA;AAAA,EAG1C,SAAS;AACP,UAAM,EAAE,UAAU,KAAK;AACvB,UAAM,EAAE,QAAQ,SAAS,gBAAgB,KAAK;AAC9C,WACE,qCAAC,oBAAD;AAAA,MAAoB,YAAY,EAAE;AAAA,OAChC,qCAAC,WAAD;AAAA,MACE,WAAS;AAAA,MACT,WAAS;AAAA,MACT,UAAU,KAAK;AAAA,MACf,SAAS;AAAA,MACT,WAAW,KAAK;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AApDD,AADT,iBACS,eAAe;AAAA,EACpB,mBAAmB;AAAA,EACnB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA;AAyDpB,IAAO,2BAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,208 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import * as React from "react";
33
+ import React2, { useCallback, useContext, useMemo } from "react";
34
+ import PropTypes from "prop-types";
35
+ import { ArrowShortRight, Search } from "@elliemae/ds-icons";
36
+ import { DSButton } from "@elliemae/ds-button";
37
+ import { runAll } from "@elliemae/ds-utilities";
38
+ import { ShuttleSearchBox } from "./ShuttleSearchBox";
39
+ import { ShuttleInfiniteScrollIndicator } from "./ShuttleInfiniteScrollIndicator";
40
+ import { ShuttleSourceListItem } from "./ShuttleListItem/ShuttleSourceListItem";
41
+ import {
42
+ ShuttleFooterCounter,
43
+ Overflow,
44
+ ShuttleFooter,
45
+ ShuttleHeader,
46
+ ShuttleHeaderBreadcrumb,
47
+ ShuttleHeaderSearchToggle,
48
+ ShuttleList,
49
+ ShuttleWrapper,
50
+ ShuttleFooterActions,
51
+ EmptyMessage,
52
+ LoadingList
53
+ } from "../classedComponents";
54
+ import { ShuttleListPanel } from "./ShuttleListPanel";
55
+ import { VirtualizedList } from "./VirtualizedList";
56
+ import { getActiveIdFromHierarchy } from "../helper";
57
+ import { AnimationState } from "../AnimationState";
58
+ import { SearchState } from "../SearchState";
59
+ import { VirtualizedSortableList } from "./VirtualizedSortableList";
60
+ import { LoadingIndicator } from "./LoadingIndicator";
61
+ const noop = () => {
62
+ };
63
+ function ShuttleSource({
64
+ items = [],
65
+ checkedItems = [],
66
+ hierarchy = [],
67
+ onMoveItem = noop,
68
+ onCheckItem = noop,
69
+ onMoveCheckedItems = noop,
70
+ onNavigateTo = noop,
71
+ onClearCheckedItems = noop,
72
+ emptyMessage = "No items found",
73
+ composeSourceItemProps = noop,
74
+ loading = false,
75
+ onSearch = noop,
76
+ onSearchClose = noop,
77
+ onSearchOpen = noop,
78
+ sourceSortable = false,
79
+ onSortEnd = noop,
80
+ sourceClearItemsText = "CLEAR ALL",
81
+ searchPlaceholder,
82
+ renderSourceCounter = (amount) => `${amount} items`,
83
+ onGetMoreItems = () => {
84
+ },
85
+ moreItemsLoading = false,
86
+ hasNextPage = false
87
+ }) {
88
+ const {
89
+ state: { isMovingBack = false, isMoving }
90
+ } = useContext(AnimationState.Context);
91
+ const {
92
+ state: { searching, searchTerm },
93
+ setSearchTerm,
94
+ reset: resetSearch,
95
+ toggleSearchBox
96
+ } = useContext(SearchState.Context);
97
+ const hashedCheckedItems = useMemo(() => checkedItems.reduce((result, item) => __spreadProps(__spreadValues({}, result), { [item]: true }), {}), [checkedItems]);
98
+ const handleCloseSearch = useCallback(() => {
99
+ setSearchTerm("");
100
+ runAll(resetSearch, onSearchClose)();
101
+ }, [searching]);
102
+ const handleToggleSearch = useCallback(() => {
103
+ toggleSearchBox(!searching);
104
+ if (searching) {
105
+ handleCloseSearch();
106
+ } else {
107
+ onSearchOpen();
108
+ }
109
+ }, [searching]);
110
+ const ComponentList = useMemo(() => sourceSortable ? VirtualizedSortableList : VirtualizedList, [sourceSortable]);
111
+ const handleSortEnd = ({ oldIndex, newIndex }) => {
112
+ onSortEnd({
113
+ sourceItem: items[oldIndex],
114
+ targetItem: items[newIndex]
115
+ });
116
+ };
117
+ const isEmpty = !items.length;
118
+ const hasContent = !loading && !isEmpty;
119
+ const contentIsEmpty = !loading && isEmpty;
120
+ return /* @__PURE__ */ React2.createElement(ShuttleWrapper, null, /* @__PURE__ */ React2.createElement(ShuttleHeader, null, /* @__PURE__ */ React2.createElement(ShuttleHeaderBreadcrumb, {
121
+ hierarchy,
122
+ onNavigateTo
123
+ }), /* @__PURE__ */ React2.createElement(ShuttleHeaderSearchToggle, {
124
+ buttonType: "text",
125
+ icon: /* @__PURE__ */ React2.createElement(Search, null),
126
+ onClick: handleToggleSearch,
127
+ containerProps: { "data-testid": "shuttle-header-search-toggle" }
128
+ })), /* @__PURE__ */ React2.createElement(ShuttleList, {
129
+ classProps: { showPulse: isMovingBack },
130
+ style: { pointerEvents: isMoving ? "none" : null }
131
+ }, /* @__PURE__ */ React2.createElement(ShuttleSearchBox, {
132
+ key: searching,
133
+ isOpen: searching,
134
+ onClose: runAll(() => toggleSearchBox(false), handleCloseSearch),
135
+ onFilter: runAll(setSearchTerm, onSearch),
136
+ placeholder: searchPlaceholder,
137
+ value: searchTerm
138
+ }), hasContent ? /* @__PURE__ */ React2.createElement(Overflow, {
139
+ activeHierarchy: getActiveIdFromHierarchy(hierarchy).id,
140
+ classProps: {
141
+ searching,
142
+ empty: isEmpty
143
+ }
144
+ }, /* @__PURE__ */ React2.createElement(ComponentList, {
145
+ key: searchTerm,
146
+ helperClass: "drag-helper",
147
+ itemRenderer: (_a) => {
148
+ var _b = _a, { item } = _b, rest = __objRest(_b, ["item"]);
149
+ return /* @__PURE__ */ React2.createElement(ShuttleSourceListItem, __spreadProps(__spreadValues(__spreadValues({
150
+ "data-testid": "source-list-item"
151
+ }, rest), composeSourceItemProps(item, rest)), {
152
+ isChecked: !!hashedCheckedItems[item.id],
153
+ item,
154
+ onItemCheck: onCheckItem,
155
+ onMoveToTarget: onMoveItem,
156
+ onNavigateOnSourceTo: onNavigateTo,
157
+ showSortHandler: sourceSortable
158
+ }));
159
+ },
160
+ items,
161
+ onSortEnd: handleSortEnd,
162
+ getMoreItems: onGetMoreItems,
163
+ hasNextPage
164
+ })) : null, contentIsEmpty ? /* @__PURE__ */ React2.createElement(LoadingList, {
165
+ "data-testid": "shuttle__loading-list"
166
+ }, /* @__PURE__ */ React2.createElement(EmptyMessage, null, emptyMessage)) : null, loading ? /* @__PURE__ */ React2.createElement(LoadingList, {
167
+ "data-testid": "shuttle__loading-list"
168
+ }, /* @__PURE__ */ React2.createElement(LoadingIndicator, null)) : null, /* @__PURE__ */ React2.createElement(ShuttleListPanel, {
169
+ onClick: onMoveCheckedItems,
170
+ open: checkedItems.length > 1
171
+ }, /* @__PURE__ */ React2.createElement(ArrowShortRight, null)), moreItemsLoading ? /* @__PURE__ */ React2.createElement(ShuttleInfiniteScrollIndicator, {
172
+ isOpen: true
173
+ }) : null), /* @__PURE__ */ React2.createElement(ShuttleFooter, null, /* @__PURE__ */ React2.createElement(ShuttleFooterActions, null, !!checkedItems.length && /* @__PURE__ */ React2.createElement(DSButton, {
174
+ buttonType: "link",
175
+ labelText: sourceClearItemsText,
176
+ onClick: onClearCheckedItems
177
+ })), /* @__PURE__ */ React2.createElement(ShuttleFooterCounter, null, renderSourceCounter(checkedItems.length))));
178
+ }
179
+ ShuttleSource.propTypes = {
180
+ items: PropTypes.arrayOf(PropTypes.shape({})),
181
+ checkedItems: PropTypes.arrayOf(PropTypes.shape({})),
182
+ hierarchy: PropTypes.arrayOf(PropTypes.shape({})),
183
+ onMoveItem: PropTypes.func,
184
+ onCheckItem: PropTypes.func,
185
+ onMoveCheckedItems: PropTypes.func,
186
+ onNavigateTo: PropTypes.func,
187
+ onClearCheckedItems: PropTypes.func,
188
+ emptyMessage: PropTypes.string,
189
+ composeSourceItemProps: PropTypes.func,
190
+ loading: PropTypes.bool,
191
+ onSearch: PropTypes.func,
192
+ onSearchClose: PropTypes.func,
193
+ onSearchOpen: PropTypes.func,
194
+ sourceSortable: PropTypes.bool,
195
+ onSortEnd: PropTypes.func,
196
+ sourceClearItemsText: PropTypes.string,
197
+ searchPlaceholder: PropTypes.string,
198
+ renderSourceCounter: PropTypes.func,
199
+ onGetMoreItems: PropTypes.func,
200
+ moreItemsLoading: PropTypes.bool,
201
+ hasNextPage: PropTypes.bool
202
+ };
203
+ var ShuttleSource_default = ShuttleSource;
204
+ export {
205
+ ShuttleSource,
206
+ ShuttleSource_default as default
207
+ };
208
+ //# sourceMappingURL=ShuttleSource.js.map