@elliemae/ds-shuttle 2.2.0-alpha.4 → 3.0.0-next.2

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 (148) hide show
  1. package/cjs/AnimationState.js +19 -46
  2. package/cjs/DSShuttle.js +219 -166
  3. package/cjs/SearchState.js +25 -44
  4. package/cjs/Shuttle.actions.js +98 -87
  5. package/cjs/ShuttleContainer.js +61 -56
  6. package/cjs/ShuttleImpl.js +206 -109
  7. package/cjs/ShuttleRenderer.js +135 -140
  8. package/cjs/ShuttleState.js +53 -57
  9. package/cjs/animation/animationConfig.js +56 -53
  10. package/cjs/classedComponents.js +69 -70
  11. package/cjs/components/LoadingIndicator.js +22 -49
  12. package/cjs/components/OverflowList.js +48 -50
  13. package/cjs/components/ShuttleBreadcrumb.js +40 -52
  14. package/cjs/components/ShuttleInfiniteScrollIndicator.js +37 -46
  15. package/cjs/components/ShuttleListItem/ActionButtons.js +51 -56
  16. package/cjs/components/ShuttleListItem/ShuttleListItem.js +80 -78
  17. package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +64 -78
  18. package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +56 -72
  19. package/cjs/components/ShuttleListPanel.js +26 -44
  20. package/cjs/components/ShuttleSearchBox.js +72 -61
  21. package/cjs/components/ShuttleSource.js +146 -150
  22. package/cjs/components/ShuttleTarget.js +100 -88
  23. package/cjs/components/VirtualizedItem.js +40 -45
  24. package/cjs/components/VirtualizedList.js +86 -81
  25. package/cjs/components/VirtualizedSortableList.js +40 -47
  26. package/cjs/helper.js +103 -69
  27. package/cjs/index.js +12 -38
  28. package/cjs/updateShuttleStateFromProps.js +69 -73
  29. package/cjs/utils.js +42 -40
  30. package/cjs/withProviders.js +27 -43
  31. package/esm/AnimationState.js +8 -12
  32. package/esm/DSShuttle.js +198 -126
  33. package/esm/SearchState.js +19 -15
  34. package/esm/Shuttle.actions.js +80 -63
  35. package/esm/ShuttleContainer.js +50 -34
  36. package/esm/ShuttleImpl.js +183 -78
  37. package/esm/ShuttleRenderer.js +128 -111
  38. package/esm/ShuttleState.js +53 -34
  39. package/esm/animation/animationConfig.js +52 -24
  40. package/esm/classedComponents.js +51 -43
  41. package/esm/components/LoadingIndicator.js +15 -20
  42. package/esm/components/OverflowList.js +41 -21
  43. package/esm/components/ShuttleBreadcrumb.js +33 -23
  44. package/esm/components/ShuttleInfiniteScrollIndicator.js +31 -18
  45. package/esm/components/ShuttleListItem/ActionButtons.js +39 -27
  46. package/esm/components/ShuttleListItem/ShuttleListItem.js +72 -50
  47. package/esm/components/ShuttleListItem/ShuttleSourceListItem.js +52 -45
  48. package/esm/components/ShuttleListItem/ShuttleTargetListItem.js +47 -42
  49. package/esm/components/ShuttleListPanel.js +19 -15
  50. package/esm/components/ShuttleSearchBox.js +66 -32
  51. package/esm/components/ShuttleSource.js +129 -125
  52. package/esm/components/ShuttleTarget.js +89 -68
  53. package/esm/components/VirtualizedItem.js +33 -15
  54. package/esm/components/VirtualizedList.js +75 -50
  55. package/esm/components/VirtualizedSortableList.js +32 -17
  56. package/esm/helper.js +67 -43
  57. package/esm/index.js +2 -9
  58. package/esm/updateShuttleStateFromProps.js +58 -39
  59. package/esm/utils.js +18 -12
  60. package/esm/withProviders.js +20 -14
  61. package/package.json +11 -11
  62. package/types/AnimationState.d.ts +2 -3
  63. package/types/DSShuttle.d.ts +1 -1
  64. package/types/SearchState.d.ts +2 -3
  65. package/types/ShuttleImpl.d.ts +2 -3
  66. package/types/ShuttleRenderer.d.ts +0 -1
  67. package/types/ShuttleState.d.ts +2 -3
  68. package/types/components/LoadingIndicator.d.ts +0 -1
  69. package/types/components/OverflowList.d.ts +0 -1
  70. package/types/components/ShuttleBreadcrumb.d.ts +0 -1
  71. package/types/components/ShuttleInfiniteScrollIndicator.d.ts +0 -1
  72. package/types/components/ShuttleListItem/ShuttleListItem.d.ts +0 -1
  73. package/types/components/ShuttleListItem/ShuttleSourceListItem.d.ts +0 -1
  74. package/types/components/ShuttleListItem/ShuttleTargetListItem.d.ts +0 -1
  75. package/types/components/ShuttleListPanel.d.ts +0 -1
  76. package/types/components/ShuttleSearchBox.d.ts +1 -3
  77. package/types/components/ShuttleSource.d.ts +0 -1
  78. package/types/components/ShuttleTarget.d.ts +0 -1
  79. package/types/components/VirtualizedItem.d.ts +0 -1
  80. package/types/components/VirtualizedList.d.ts +0 -1
  81. package/types/components/VirtualizedSortableList.d.ts +0 -1
  82. package/types/index.d.ts +1 -1
  83. package/types/updateShuttleStateFromProps.d.ts +1 -3
  84. package/types/withProviders.d.ts +0 -1
  85. package/cjs/AnimationState.js.map +0 -7
  86. package/cjs/DSShuttle.js.map +0 -7
  87. package/cjs/SearchState.js.map +0 -7
  88. package/cjs/Shuttle.actions.js.map +0 -7
  89. package/cjs/ShuttleContainer.js.map +0 -7
  90. package/cjs/ShuttleImpl.js.map +0 -7
  91. package/cjs/ShuttleRenderer.js.map +0 -7
  92. package/cjs/ShuttleState.js.map +0 -7
  93. package/cjs/animation/animationConfig.js.map +0 -7
  94. package/cjs/classedComponents.js.map +0 -7
  95. package/cjs/components/LoadingIndicator.js.map +0 -7
  96. package/cjs/components/OverflowList.js.map +0 -7
  97. package/cjs/components/ShuttleBreadcrumb.js.map +0 -7
  98. package/cjs/components/ShuttleInfiniteScrollIndicator.js.map +0 -7
  99. package/cjs/components/ShuttleListItem/ActionButtons.js.map +0 -7
  100. package/cjs/components/ShuttleListItem/ShuttleListItem.js.map +0 -7
  101. package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +0 -7
  102. package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +0 -7
  103. package/cjs/components/ShuttleListPanel.js.map +0 -7
  104. package/cjs/components/ShuttleSearchBox.js.map +0 -7
  105. package/cjs/components/ShuttleSource.js.map +0 -7
  106. package/cjs/components/ShuttleTarget.js.map +0 -7
  107. package/cjs/components/VirtualizedItem.js.map +0 -7
  108. package/cjs/components/VirtualizedList.js.map +0 -7
  109. package/cjs/components/VirtualizedSortableList.js.map +0 -7
  110. package/cjs/helper.js.map +0 -7
  111. package/cjs/index.js.map +0 -7
  112. package/cjs/tests/utils.js +0 -1218
  113. package/cjs/tests/utils.js.map +0 -7
  114. package/cjs/updateShuttleStateFromProps.js.map +0 -7
  115. package/cjs/utils.js.map +0 -7
  116. package/cjs/withProviders.js.map +0 -7
  117. package/esm/AnimationState.js.map +0 -7
  118. package/esm/DSShuttle.js.map +0 -7
  119. package/esm/SearchState.js.map +0 -7
  120. package/esm/Shuttle.actions.js.map +0 -7
  121. package/esm/ShuttleContainer.js.map +0 -7
  122. package/esm/ShuttleImpl.js.map +0 -7
  123. package/esm/ShuttleRenderer.js.map +0 -7
  124. package/esm/ShuttleState.js.map +0 -7
  125. package/esm/animation/animationConfig.js.map +0 -7
  126. package/esm/classedComponents.js.map +0 -7
  127. package/esm/components/LoadingIndicator.js.map +0 -7
  128. package/esm/components/OverflowList.js.map +0 -7
  129. package/esm/components/ShuttleBreadcrumb.js.map +0 -7
  130. package/esm/components/ShuttleInfiniteScrollIndicator.js.map +0 -7
  131. package/esm/components/ShuttleListItem/ActionButtons.js.map +0 -7
  132. package/esm/components/ShuttleListItem/ShuttleListItem.js.map +0 -7
  133. package/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +0 -7
  134. package/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +0 -7
  135. package/esm/components/ShuttleListPanel.js.map +0 -7
  136. package/esm/components/ShuttleSearchBox.js.map +0 -7
  137. package/esm/components/ShuttleSource.js.map +0 -7
  138. package/esm/components/ShuttleTarget.js.map +0 -7
  139. package/esm/components/VirtualizedItem.js.map +0 -7
  140. package/esm/components/VirtualizedList.js.map +0 -7
  141. package/esm/components/VirtualizedSortableList.js.map +0 -7
  142. package/esm/helper.js.map +0 -7
  143. package/esm/index.js.map +0 -7
  144. package/esm/tests/utils.js +0 -1189
  145. package/esm/tests/utils.js.map +0 -7
  146. package/esm/updateShuttleStateFromProps.js.map +0 -7
  147. package/esm/utils.js.map +0 -7
  148. package/esm/withProviders.js.map +0 -7
@@ -1,115 +1,132 @@
1
- import * as React from "react";
2
- import React2, { useCallback, useContext } from "react";
3
- import { ShuttleSource } from "./components/ShuttleSource";
4
- import { ShuttleTarget } from "./components/ShuttleTarget";
5
- import { ShuttleContainer } from "./classedComponents";
6
- import { AnimationState } from "./AnimationState";
7
- const noop = () => {
8
- };
9
- function ShuttleRenderer({
10
- containerProps,
11
- onNavigateOnTargetTo = noop,
12
- onNavigateOnSourceTo = noop,
13
- onMoveItemToSource = noop,
14
- onMoveItemToTarget = noop,
15
- onClearMovedItems = noop,
16
- onMoveCheckedItems = noop,
17
- onClearCheckedItems = noop,
18
- onToggleSearch = noop,
19
- onSearch = noop,
20
- onSearchClose = noop,
21
- onSearchOpen = noop,
22
- searching = false,
23
- onCheckItem = noop,
24
- hierarchy = [],
25
- hierarchyDest = [],
26
- checkedItems = [],
27
- sourceItems = [],
28
- targetItems = [],
29
- sourceEmptyMessage,
30
- targetEmptyMessage,
31
- composeTargetItemProps,
32
- composeSourceItemProps,
33
- targetSortable,
34
- sourceSortable,
35
- onSourceSortEnd,
36
- onTargetSortEnd,
37
- loadingSource = false,
38
- loadingTarget = false,
39
- onGetMoreItems = () => {
40
- },
41
- moreItemsLoading = false,
42
- hasNextPage = false,
43
- ...otherProps
44
- }) {
45
- const { setIsMoving, setIsDrillingDown, setIsMovingBack, reset } = useContext(AnimationState.Context);
46
- const removeAnimationState = useCallback(() => setTimeout(() => reset(), 500));
47
- return /* @__PURE__ */ React2.createElement(ShuttleContainer, {
48
- "data-testid": "em-ds-shuttle",
49
- ...containerProps
50
- }, /* @__PURE__ */ React2.createElement(ShuttleSource, {
51
- ...otherProps,
52
- checkedItems,
53
- composeSourceItemProps,
54
- emptyMessage: sourceEmptyMessage,
55
- hierarchy,
56
- items: sourceItems,
57
- onCheckItem,
58
- onClearCheckedItems,
59
- onMoveCheckedItems: (item) => {
60
- setIsMoving(true);
61
- onMoveCheckedItems(item);
62
- },
63
- onMoveItem: (item) => {
64
- setIsMoving(true);
65
- onMoveItemToTarget(item);
66
- removeAnimationState();
67
- },
68
- onNavigateTo: (item, direction = "down") => {
69
- const indexInHierarchy = hierarchy.findIndex((hItem) => hItem.id === item.id);
70
- setIsDrillingDown(indexInHierarchy === -1);
71
- onNavigateOnSourceTo(item, direction);
72
- },
73
- onSearch,
74
- onSearchClose,
75
- onSearchOpen,
76
- onSortEnd: onSourceSortEnd,
77
- onToggleSearch,
78
- searching,
79
- sourceSortable,
80
- loading: loadingSource,
81
- onGetMoreItems,
82
- moreItemsLoading,
83
- hasNextPage
84
- }), /* @__PURE__ */ React2.createElement(ShuttleTarget, {
85
- ...otherProps,
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
8
+ import { useContext, useCallback } from 'react';
9
+ import ShuttleSource from './components/ShuttleSource.js';
10
+ import ShuttleTarget from './components/ShuttleTarget.js';
11
+ import { ShuttleContainer } from './classedComponents.js';
12
+ import AnimationContext from './AnimationState.js';
13
+ import { jsxs, jsx } from 'react/jsx-runtime';
14
+
15
+ const _excluded = ["containerProps", "onNavigateOnTargetTo", "onNavigateOnSourceTo", "onMoveItemToSource", "onMoveItemToTarget", "onClearMovedItems", "onMoveCheckedItems", "onClearCheckedItems", "onToggleSearch", "onSearch", "onSearchClose", "onSearchOpen", "searching", "onCheckItem", "hierarchy", "hierarchyDest", "checkedItems", "sourceItems", "targetItems", "sourceEmptyMessage", "targetEmptyMessage", "composeTargetItemProps", "composeSourceItemProps", "targetSortable", "sourceSortable", "onSourceSortEnd", "onTargetSortEnd", "loadingSource", "loadingTarget", "onGetMoreItems", "moreItemsLoading", "hasNextPage"];
16
+
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
+
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+
21
+ const noop = () => {};
22
+
23
+ function ShuttleRenderer(_ref) {
24
+ let {
25
+ containerProps,
26
+ onNavigateOnTargetTo = noop,
27
+ onNavigateOnSourceTo = noop,
28
+ onMoveItemToSource = noop,
29
+ onMoveItemToTarget = noop,
30
+ onClearMovedItems = noop,
31
+ onMoveCheckedItems = noop,
32
+ onClearCheckedItems = noop,
33
+ onToggleSearch = noop,
34
+ onSearch = noop,
35
+ onSearchClose = noop,
36
+ onSearchOpen = noop,
37
+ searching = false,
38
+ onCheckItem = noop,
39
+ hierarchy = [],
40
+ hierarchyDest = [],
41
+ checkedItems = [],
42
+ sourceItems = [],
43
+ targetItems = [],
44
+ sourceEmptyMessage,
45
+ targetEmptyMessage,
86
46
  composeTargetItemProps,
87
- emptyMessage: targetEmptyMessage,
88
- hierarchy: hierarchyDest,
89
- items: targetItems,
90
- onClearMovedItems: () => {
91
- setIsMovingBack(true);
92
- removeAnimationState();
93
- onClearMovedItems();
94
- },
95
- onMoveItem: (item) => {
96
- setIsMovingBack(true);
97
- removeAnimationState();
98
- onMoveItemToSource(item);
99
- },
100
- onNavigateTo: (item, direction = "down") => {
101
- const indexInHierarchy = hierarchyDest.findIndex((hItem) => hItem.id === item.id);
102
- setIsDrillingDown(indexInHierarchy === -1);
103
- onNavigateOnTargetTo(item, direction);
104
- },
105
- onSortEnd: onTargetSortEnd,
47
+ composeSourceItemProps,
106
48
  targetSortable,
107
- loading: loadingTarget
49
+ sourceSortable,
50
+ onSourceSortEnd,
51
+ onTargetSortEnd,
52
+ loadingSource = false,
53
+ loadingTarget = false,
54
+ onGetMoreItems = () => {},
55
+ moreItemsLoading = false,
56
+ hasNextPage = false
57
+ } = _ref,
58
+ otherProps = _objectWithoutProperties(_ref, _excluded);
59
+
60
+ const {
61
+ setIsMoving,
62
+ setIsDrillingDown,
63
+ setIsMovingBack,
64
+ reset
65
+ } = useContext(AnimationContext.Context);
66
+ const removeAnimationState = useCallback(() => setTimeout(() => reset(), 500));
67
+ return /*#__PURE__*/jsxs(ShuttleContainer, _objectSpread(_objectSpread({
68
+ "data-testid": "em-ds-shuttle"
69
+ }, containerProps), {}, {
70
+ children: [/*#__PURE__*/jsx(ShuttleSource, _objectSpread(_objectSpread({}, otherProps), {}, {
71
+ checkedItems: checkedItems,
72
+ composeSourceItemProps: composeSourceItemProps,
73
+ emptyMessage: sourceEmptyMessage,
74
+ hierarchy: hierarchy,
75
+ items: sourceItems,
76
+ onCheckItem: onCheckItem,
77
+ onClearCheckedItems: onClearCheckedItems,
78
+ onMoveCheckedItems: item => {
79
+ setIsMoving(true);
80
+ onMoveCheckedItems(item);
81
+ },
82
+ onMoveItem: item => {
83
+ setIsMoving(true);
84
+ onMoveItemToTarget(item);
85
+ removeAnimationState();
86
+ },
87
+ onNavigateTo: function (item) {
88
+ let direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'down';
89
+ const indexInHierarchy = hierarchy.findIndex(hItem => hItem.id === item.id);
90
+ setIsDrillingDown(indexInHierarchy === -1);
91
+ onNavigateOnSourceTo(item, direction);
92
+ },
93
+ onSearch: onSearch,
94
+ onSearchClose: onSearchClose,
95
+ onSearchOpen: onSearchOpen,
96
+ onSortEnd: onSourceSortEnd,
97
+ onToggleSearch: onToggleSearch,
98
+ searching: searching,
99
+ sourceSortable: sourceSortable,
100
+ loading: loadingSource,
101
+ onGetMoreItems: onGetMoreItems,
102
+ moreItemsLoading: moreItemsLoading,
103
+ hasNextPage: hasNextPage
104
+ })), /*#__PURE__*/jsx(ShuttleTarget, _objectSpread(_objectSpread({}, otherProps), {}, {
105
+ composeTargetItemProps: composeTargetItemProps,
106
+ emptyMessage: targetEmptyMessage,
107
+ hierarchy: hierarchyDest,
108
+ items: targetItems,
109
+ onClearMovedItems: () => {
110
+ setIsMovingBack(true);
111
+ removeAnimationState();
112
+ onClearMovedItems();
113
+ },
114
+ onMoveItem: item => {
115
+ setIsMovingBack(true);
116
+ removeAnimationState();
117
+ onMoveItemToSource(item);
118
+ },
119
+ onNavigateTo: function (item) {
120
+ let direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'down';
121
+ const indexInHierarchy = hierarchyDest.findIndex(hItem => hItem.id === item.id);
122
+ setIsDrillingDown(indexInHierarchy === -1);
123
+ onNavigateOnTargetTo(item, direction);
124
+ },
125
+ onSortEnd: onTargetSortEnd,
126
+ targetSortable: targetSortable,
127
+ loading: loadingTarget
128
+ }))]
108
129
  }));
109
130
  }
110
- var ShuttleRenderer_default = ShuttleRenderer;
111
- export {
112
- ShuttleRenderer,
113
- ShuttleRenderer_default as default
114
- };
115
- //# sourceMappingURL=ShuttleRenderer.js.map
131
+
132
+ export { ShuttleRenderer as default };
@@ -1,55 +1,74 @@
1
- import * as React from "react";
2
- import { useState } from "react";
3
- import createContainer from "constate";
4
- import { getItemsById, pipe } from "./helper";
5
- import * as actions from "./Shuttle.actions";
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+ import 'core-js/modules/esnext.async-iterator.map.js';
3
+ import 'core-js/modules/esnext.iterator.map.js';
4
+ import { useState } from 'react';
5
+ import createContainer from 'constate';
6
+ import { getItemsById, pipe } from './helper.js';
7
+ import { moveItem, resetMovedItems, navigateTo, resetCheckedItems, toggleItemSelection } from './Shuttle.actions.js';
8
+
6
9
  function useShuttleState() {
7
10
  const [shuttleState, setShuttleState] = useState({
8
11
  checkedItems: [],
9
12
  movedItems: {},
10
- hierarchy: [{ name: "Category", id: null }],
11
- hierarchyDest: [{ name: "Added users", id: null }]
13
+ hierarchy: [{
14
+ name: 'Category',
15
+ id: null
16
+ }],
17
+ hierarchyDest: [{
18
+ name: 'Added users',
19
+ id: null
20
+ }]
12
21
  });
13
- const setState = (state) => setShuttleState(state(shuttleState));
14
- function setMovedItems(itemsIds = [], items = []) {
22
+
23
+ const setState = state => setShuttleState(state(shuttleState));
24
+
25
+ function setMovedItems() {
26
+ let itemsIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
27
+ let items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
15
28
  const itemsToMove = getItemsById(itemsIds, items);
16
- const pipeActions = itemsToMove.map((item) => actions.moveItem(item, true));
17
- setState(pipe([actions.resetMovedItems(), ...pipeActions]));
29
+ const pipeActions = itemsToMove.map(item => moveItem(item));
30
+ setState(pipe([resetMovedItems(), ...pipeActions]));
18
31
  }
32
+
19
33
  function navigate(item, dest) {
20
- setState(pipe([actions.navigateTo(item, dest), actions.resetCheckedItems()]));
34
+ setState(pipe([navigateTo(item, dest), resetCheckedItems()]));
21
35
  }
22
- function resetCheckedItems() {
23
- setState(actions.resetCheckedItems());
36
+
37
+ function resetCheckedItems$1() {
38
+ setState(resetCheckedItems());
24
39
  }
25
- function resetMovedItems() {
26
- setState(pipe([actions.navigateTo({ id: null }, true), actions.resetMovedItems()]));
40
+
41
+ function resetMovedItems$1() {
42
+ setState(pipe([navigateTo({
43
+ id: null
44
+ }, true), resetMovedItems()]));
27
45
  }
28
- function moveItem(item, dest) {
29
- setState(pipe([actions.moveItem(item, dest), actions.resetCheckedItems()]));
46
+
47
+ function moveItem$1(item, dest) {
48
+ setState(pipe([moveItem(item), resetCheckedItems()]));
30
49
  }
31
- function toggleItemSelection(item) {
32
- setState(actions.toggleItemSelection(item.id));
50
+
51
+ function toggleItemSelection$1(item) {
52
+ setState(toggleItemSelection(item.id));
33
53
  }
34
- function moveCheckedItems(items, dest = true) {
35
- const pipeActions = items.map((item) => moveItem(item, dest));
36
- setState(pipe([...pipeActions, resetCheckedItems()]));
54
+
55
+ function moveCheckedItems(items) {
56
+ const pipeActions = items.map(item => moveItem$1(item));
57
+ setState(pipe([...pipeActions, resetCheckedItems$1()]));
37
58
  }
59
+
38
60
  return {
39
61
  state: shuttleState,
40
- toggleItemSelection,
62
+ toggleItemSelection: toggleItemSelection$1,
41
63
  moveCheckedItems,
42
- moveItem,
43
- resetMovedItems,
44
- resetCheckedItems,
64
+ moveItem: moveItem$1,
65
+ resetMovedItems: resetMovedItems$1,
66
+ resetCheckedItems: resetCheckedItems$1,
45
67
  navigate,
46
68
  setMovedItems
47
69
  };
48
70
  }
49
- const useShuttleStateHOC = createContainer(useShuttleState, (value) => [value.state]);
50
- var ShuttleState_default = useShuttleStateHOC;
51
- export {
52
- useShuttleStateHOC as ShuttleState,
53
- ShuttleState_default as default
54
- };
55
- //# sourceMappingURL=ShuttleState.js.map
71
+
72
+ var useShuttleState$1 = createContainer(useShuttleState, value => [value.state]);
73
+
74
+ export { useShuttleState$1 as default };
@@ -1,49 +1,77 @@
1
- import * as React from "react";
1
+ // shuttle list and items constants
2
2
  const itemAnimationDuration = 300;
3
3
  const listAnimationDuration = 300;
4
- const xPosMovement = 500;
4
+ const xPosMovement = 500; // breadcrumb constants
5
+
5
6
  const breadcrumbDuration = 200;
6
7
  const xBreadcrumbPos = 300;
7
8
  const animationConfig = {
8
9
  slideRight: {
9
- from: { transform: "translate3d(0,0,0)" },
10
- to: { transform: `translate3d(${xPosMovement}px,0,0)` }
10
+ from: {
11
+ transform: 'translate3d(0,0,0)'
12
+ },
13
+ to: {
14
+ transform: "translate3d(".concat(xPosMovement, "px,0,0)")
15
+ }
11
16
  },
12
17
  slideLeft: {
13
- from: { transform: "translate3d(0,0,0)" },
14
- to: { transform: `translate3d(${-xPosMovement}px,0,0)` }
18
+ from: {
19
+ transform: 'translate3d(0,0,0)'
20
+ },
21
+ to: {
22
+ transform: "translate3d(".concat(-xPosMovement, "px,0,0)")
23
+ }
15
24
  },
16
- moveItem: (isMovingLeft) => ({
17
- config: { duration: itemAnimationDuration },
18
- enter: { opacity: 1, transform: `translate3d(${0}px,0,0)` },
25
+ moveItem: isMovingLeft => ({
26
+ config: {
27
+ duration: itemAnimationDuration
28
+ },
29
+ enter: {
30
+ opacity: 1,
31
+ transform: "translate3d(".concat(0, "px,0,0)")
32
+ },
19
33
  from: {
20
34
  opacity: 1,
21
- transform: `translate3d(${isMovingLeft ? -xPosMovement : xPosMovement}px,0,0)`
35
+ transform: "translate3d(".concat(isMovingLeft ? -xPosMovement : xPosMovement, "px,0,0)")
22
36
  },
23
37
  leave: {
24
- transform: `translate3d(${isMovingLeft ? -xPosMovement : xPosMovement}px,0,0)`
38
+ transform: "translate3d(".concat(isMovingLeft ? -xPosMovement : xPosMovement, "px,0,0)")
25
39
  }
26
40
  }),
27
- moveList: (isDrillingDown) => ({
28
- config: { duration: listAnimationDuration },
29
- enter: { opacity: 1, transform: "translate3d(0,0,0)" },
41
+ moveList: isDrillingDown => ({
42
+ config: {
43
+ duration: listAnimationDuration
44
+ },
45
+ enter: {
46
+ opacity: 1,
47
+ transform: 'translate3d(0,0,0)'
48
+ },
30
49
  from: {
31
50
  opacity: 0,
32
- transform: `translate3d(0px,${isDrillingDown ? xPosMovement : -xPosMovement}px,0)`
51
+ transform: "translate3d(0px,".concat(isDrillingDown ? xPosMovement : -xPosMovement, "px,0)")
33
52
  },
34
53
  leave: {
35
54
  opacity: 0,
36
- transform: `translate3d(0,${isDrillingDown ? -xPosMovement : xPosMovement}px,0)`
55
+ transform: "translate3d(0,".concat(isDrillingDown ? -xPosMovement : xPosMovement, "px,0)")
37
56
  }
38
57
  }),
39
58
  breadcrumb: () => ({
40
- config: { duration: breadcrumbDuration },
41
- enter: { opacity: 1, transform: `translate3d(${0}px,0,0)` },
42
- from: { opacity: 0, transform: `translate3d(${xBreadcrumbPos}px,0px,0)` },
43
- leave: { opacity: 0, transform: `translate3d(${xBreadcrumbPos}px,0,0)` }
59
+ config: {
60
+ duration: breadcrumbDuration
61
+ },
62
+ enter: {
63
+ opacity: 1,
64
+ transform: "translate3d(".concat(0, "px,0,0)")
65
+ },
66
+ from: {
67
+ opacity: 0,
68
+ transform: "translate3d(".concat(xBreadcrumbPos, "px,0px,0)")
69
+ },
70
+ leave: {
71
+ opacity: 0,
72
+ transform: "translate3d(".concat(xBreadcrumbPos, "px,0,0)")
73
+ }
44
74
  })
45
75
  };
46
- export {
47
- animationConfig
48
- };
49
- //# sourceMappingURL=animationConfig.js.map
76
+
77
+ export { animationConfig };
@@ -1,43 +1,51 @@
1
- import * as React from "react";
2
- import { DSButton } from "@elliemae/ds-button";
3
- import { aggregatedClasses } from "@elliemae/ds-classnames";
4
- import { ShuttleBreadcrumb } from "./components/ShuttleBreadcrumb";
5
- import { OverflowList } from "./components/OverflowList";
6
- const blockName = "shuttle";
7
- const headerBlockName = `${blockName}-header`;
8
- const listBlockName = `${blockName}-list`;
9
- const footerBlockName = `${blockName}-footer`;
10
- const ShuttleContainer = aggregatedClasses("div")(blockName);
11
- const ShuttleWrapper = aggregatedClasses("div")(`${blockName}-wrapper`);
12
- const ShuttleHeader = aggregatedClasses("div")(headerBlockName);
13
- const ShuttleHeaderBreadcrumb = aggregatedClasses(ShuttleBreadcrumb)(headerBlockName, "breadcrumb");
14
- const ShuttleHeaderSearchToggle = aggregatedClasses(DSButton)(headerBlockName, "search-toggle");
15
- const ShuttleList = aggregatedClasses("div")(listBlockName, null, ({ showPulse }) => ({
16
- "show-pulse": showPulse
17
- }));
18
- const ShuttleListPanel = aggregatedClasses("div")(listBlockName, "panel", ({ open }) => ({ open }));
19
- const Overflow = aggregatedClasses(OverflowList)(listBlockName, "overflow", ({ empty, searching }) => ({
20
- empty,
21
- searching
22
- }));
23
- const EmptyMessage = aggregatedClasses("span")(listBlockName, "empty-message");
24
- const LoadingList = aggregatedClasses("div")(listBlockName, "loading-list");
25
- const ShuttleFooter = aggregatedClasses("div")(footerBlockName);
26
- const ShuttleFooterActions = aggregatedClasses("div")(footerBlockName, "actions");
27
- const ShuttleFooterCounter = aggregatedClasses("span")(footerBlockName, "counter");
28
- export {
29
- EmptyMessage,
30
- LoadingList,
31
- Overflow,
32
- ShuttleContainer,
33
- ShuttleFooter,
34
- ShuttleFooterActions,
35
- ShuttleFooterCounter,
36
- ShuttleHeader,
37
- ShuttleHeaderBreadcrumb,
38
- ShuttleHeaderSearchToggle,
39
- ShuttleList,
40
- ShuttleListPanel,
41
- ShuttleWrapper
42
- };
43
- //# sourceMappingURL=classedComponents.js.map
1
+ import DSButton from '@elliemae/ds-button';
2
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
3
+ import ShuttleBreadcrumb from './components/ShuttleBreadcrumb.js';
4
+ import OverflowList from './components/OverflowList.js';
5
+
6
+ const blockName = 'shuttle';
7
+ const headerBlockName = "".concat(blockName, "-header");
8
+ const listBlockName = "".concat(blockName, "-list");
9
+ const footerBlockName = "".concat(blockName, "-footer");
10
+ const ShuttleContainer = aggregatedClasses('div')(blockName); // wrapper
11
+
12
+ const ShuttleWrapper = aggregatedClasses('div')("".concat(blockName, "-wrapper")); // header
13
+
14
+ const ShuttleHeader = aggregatedClasses('div')(headerBlockName);
15
+ const ShuttleHeaderBreadcrumb = aggregatedClasses(ShuttleBreadcrumb)(headerBlockName, 'breadcrumb');
16
+ const ShuttleHeaderSearchToggle = aggregatedClasses(DSButton)(headerBlockName, 'search-toggle'); // list
17
+
18
+ const ShuttleList = aggregatedClasses('div')(listBlockName, null, _ref => {
19
+ let {
20
+ showPulse
21
+ } = _ref;
22
+ return {
23
+ 'show-pulse': showPulse
24
+ };
25
+ });
26
+ const ShuttleListPanel = aggregatedClasses('div')(listBlockName, 'panel', _ref2 => {
27
+ let {
28
+ open
29
+ } = _ref2;
30
+ return {
31
+ open
32
+ };
33
+ });
34
+ const Overflow = aggregatedClasses(OverflowList)(listBlockName, 'overflow', _ref3 => {
35
+ let {
36
+ empty,
37
+ searching
38
+ } = _ref3;
39
+ return {
40
+ empty,
41
+ searching
42
+ };
43
+ });
44
+ const EmptyMessage = aggregatedClasses('span')(listBlockName, 'empty-message');
45
+ const LoadingList = aggregatedClasses('div')(listBlockName, 'loading-list'); // footer
46
+
47
+ const ShuttleFooter = aggregatedClasses('div')(footerBlockName);
48
+ const ShuttleFooterActions = aggregatedClasses('div')(footerBlockName, 'actions');
49
+ const ShuttleFooterCounter = aggregatedClasses('span')(footerBlockName, 'counter');
50
+
51
+ export { EmptyMessage, LoadingList, Overflow, ShuttleContainer, ShuttleFooter, ShuttleFooterActions, ShuttleFooterCounter, ShuttleHeader, ShuttleHeaderBreadcrumb, ShuttleHeaderSearchToggle, ShuttleList, ShuttleListPanel, ShuttleWrapper };
@@ -1,23 +1,18 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { DSCircularProgressIndicator } from "@elliemae/ds-circular-progress-indicator";
4
- import styled from "styled-components";
5
- const Wrapper = styled.div`
6
- display: flex;
7
- justify-content: center;
8
- align-items: center;
9
- width: 100%;
10
- height: 100%;
11
- `;
12
- const LoadingIndicator = () => /* @__PURE__ */ React2.createElement(Wrapper, {
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import 'react';
3
+ import { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';
4
+ import styled from 'styled-components';
5
+
6
+ var _Wrapper;
7
+ const Wrapper = /*#__PURE__*/styled.div.withConfig({
8
+ componentId: "sc-18oj125-0"
9
+ })(["display:flex;justify-content:center;align-items:center;width:100%;height:100%;"]);
10
+
11
+ const LoadingIndicator = () => _Wrapper || (_Wrapper = /*#__PURE__*/_jsx(Wrapper, {
13
12
  "data-testid": "shuttle__loading-indicator"
14
- }, /* @__PURE__ */ React2.createElement(DSCircularProgressIndicator, {
13
+ }, void 0, /*#__PURE__*/_jsx(DSCircularProgressIndicator, {
15
14
  size: "xl",
16
15
  showLabel: true
17
- }));
18
- var LoadingIndicator_default = LoadingIndicator;
19
- export {
20
- LoadingIndicator,
21
- LoadingIndicator_default as default
22
- };
23
- //# sourceMappingURL=LoadingIndicator.js.map
16
+ })));
17
+
18
+ export { LoadingIndicator as default };
@@ -1,26 +1,46 @@
1
- import * as React from "react";
2
- import React2, { useContext } from "react";
3
- import { useTransition, animated } from "react-spring/web";
4
- import { animationConfig } from "../animation/animationConfig";
5
- import { AnimationState } from "../AnimationState";
6
- function OverflowList({ className = "", activeHierarchy = "", children }) {
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
7
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import 'core-js/modules/esnext.async-iterator.map.js';
9
+ import 'core-js/modules/esnext.iterator.map.js';
10
+ import { useContext } from 'react';
11
+ import { useTransition, animated } from 'react-spring/web';
12
+ import { animationConfig } from '../animation/animationConfig.js';
13
+ import AnimationContext from '../AnimationState.js';
14
+
15
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
+
17
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
18
+
19
+ function OverflowList(_ref) {
20
+ let {
21
+ className = '',
22
+ activeHierarchy = '',
23
+ children
24
+ } = _ref;
7
25
  const {
8
- state: { isDrillingDown = false },
26
+ state: {
27
+ isDrillingDown = false
28
+ },
9
29
  setIsDrillingDown
10
- } = useContext(AnimationState.Context);
11
- const overflowTransition = useTransition(activeHierarchy, null, {
12
- ...animationConfig.moveList(isDrillingDown),
30
+ } = useContext(AnimationContext.Context);
31
+ const overflowTransition = useTransition(activeHierarchy, null, _objectSpread(_objectSpread({}, animationConfig.moveList(isDrillingDown)), {}, {
13
32
  onDestroyed: () => setIsDrillingDown(false)
33
+ }));
34
+ return overflowTransition.map(_ref2 => {
35
+ let {
36
+ props,
37
+ key
38
+ } = _ref2;
39
+ return /*#__PURE__*/_jsx(animated.div, {
40
+ className: className,
41
+ style: props
42
+ }, key, children);
14
43
  });
15
- return overflowTransition.map(({ props, key }) => /* @__PURE__ */ React2.createElement(animated.div, {
16
- key,
17
- className,
18
- style: props
19
- }, children));
20
44
  }
21
- var OverflowList_default = OverflowList;
22
- export {
23
- OverflowList,
24
- OverflowList_default as default
25
- };
26
- //# sourceMappingURL=OverflowList.js.map
45
+
46
+ export { OverflowList as default };