@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.
- package/cjs/AnimationState.js +19 -46
- package/cjs/DSShuttle.js +219 -166
- package/cjs/SearchState.js +25 -44
- package/cjs/Shuttle.actions.js +98 -87
- package/cjs/ShuttleContainer.js +61 -56
- package/cjs/ShuttleImpl.js +206 -109
- package/cjs/ShuttleRenderer.js +135 -140
- package/cjs/ShuttleState.js +53 -57
- package/cjs/animation/animationConfig.js +56 -53
- package/cjs/classedComponents.js +69 -70
- package/cjs/components/LoadingIndicator.js +22 -49
- package/cjs/components/OverflowList.js +48 -50
- package/cjs/components/ShuttleBreadcrumb.js +40 -52
- package/cjs/components/ShuttleInfiniteScrollIndicator.js +37 -46
- package/cjs/components/ShuttleListItem/ActionButtons.js +51 -56
- package/cjs/components/ShuttleListItem/ShuttleListItem.js +80 -78
- package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +64 -78
- package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +56 -72
- package/cjs/components/ShuttleListPanel.js +26 -44
- package/cjs/components/ShuttleSearchBox.js +72 -61
- package/cjs/components/ShuttleSource.js +146 -150
- package/cjs/components/ShuttleTarget.js +100 -88
- package/cjs/components/VirtualizedItem.js +40 -45
- package/cjs/components/VirtualizedList.js +86 -81
- package/cjs/components/VirtualizedSortableList.js +40 -47
- package/cjs/helper.js +103 -69
- package/cjs/index.js +12 -38
- package/cjs/updateShuttleStateFromProps.js +69 -73
- package/cjs/utils.js +42 -40
- package/cjs/withProviders.js +27 -43
- package/esm/AnimationState.js +8 -12
- package/esm/DSShuttle.js +198 -126
- package/esm/SearchState.js +19 -15
- package/esm/Shuttle.actions.js +80 -63
- package/esm/ShuttleContainer.js +50 -34
- package/esm/ShuttleImpl.js +183 -78
- package/esm/ShuttleRenderer.js +128 -111
- package/esm/ShuttleState.js +53 -34
- package/esm/animation/animationConfig.js +52 -24
- package/esm/classedComponents.js +51 -43
- package/esm/components/LoadingIndicator.js +15 -20
- package/esm/components/OverflowList.js +41 -21
- package/esm/components/ShuttleBreadcrumb.js +33 -23
- package/esm/components/ShuttleInfiniteScrollIndicator.js +31 -18
- package/esm/components/ShuttleListItem/ActionButtons.js +39 -27
- package/esm/components/ShuttleListItem/ShuttleListItem.js +72 -50
- package/esm/components/ShuttleListItem/ShuttleSourceListItem.js +52 -45
- package/esm/components/ShuttleListItem/ShuttleTargetListItem.js +47 -42
- package/esm/components/ShuttleListPanel.js +19 -15
- package/esm/components/ShuttleSearchBox.js +66 -32
- package/esm/components/ShuttleSource.js +129 -125
- package/esm/components/ShuttleTarget.js +89 -68
- package/esm/components/VirtualizedItem.js +33 -15
- package/esm/components/VirtualizedList.js +75 -50
- package/esm/components/VirtualizedSortableList.js +32 -17
- package/esm/helper.js +67 -43
- package/esm/index.js +2 -9
- package/esm/updateShuttleStateFromProps.js +58 -39
- package/esm/utils.js +18 -12
- package/esm/withProviders.js +20 -14
- package/package.json +11 -11
- package/types/AnimationState.d.ts +2 -3
- package/types/DSShuttle.d.ts +1 -1
- package/types/SearchState.d.ts +2 -3
- package/types/ShuttleImpl.d.ts +2 -3
- package/types/ShuttleRenderer.d.ts +0 -1
- package/types/ShuttleState.d.ts +2 -3
- package/types/components/LoadingIndicator.d.ts +0 -1
- package/types/components/OverflowList.d.ts +0 -1
- package/types/components/ShuttleBreadcrumb.d.ts +0 -1
- package/types/components/ShuttleInfiniteScrollIndicator.d.ts +0 -1
- package/types/components/ShuttleListItem/ShuttleListItem.d.ts +0 -1
- package/types/components/ShuttleListItem/ShuttleSourceListItem.d.ts +0 -1
- package/types/components/ShuttleListItem/ShuttleTargetListItem.d.ts +0 -1
- package/types/components/ShuttleListPanel.d.ts +0 -1
- package/types/components/ShuttleSearchBox.d.ts +1 -3
- package/types/components/ShuttleSource.d.ts +0 -1
- package/types/components/ShuttleTarget.d.ts +0 -1
- package/types/components/VirtualizedItem.d.ts +0 -1
- package/types/components/VirtualizedList.d.ts +0 -1
- package/types/components/VirtualizedSortableList.d.ts +0 -1
- package/types/index.d.ts +1 -1
- package/types/updateShuttleStateFromProps.d.ts +1 -3
- package/types/withProviders.d.ts +0 -1
- package/cjs/AnimationState.js.map +0 -7
- package/cjs/DSShuttle.js.map +0 -7
- package/cjs/SearchState.js.map +0 -7
- package/cjs/Shuttle.actions.js.map +0 -7
- package/cjs/ShuttleContainer.js.map +0 -7
- package/cjs/ShuttleImpl.js.map +0 -7
- package/cjs/ShuttleRenderer.js.map +0 -7
- package/cjs/ShuttleState.js.map +0 -7
- package/cjs/animation/animationConfig.js.map +0 -7
- package/cjs/classedComponents.js.map +0 -7
- package/cjs/components/LoadingIndicator.js.map +0 -7
- package/cjs/components/OverflowList.js.map +0 -7
- package/cjs/components/ShuttleBreadcrumb.js.map +0 -7
- package/cjs/components/ShuttleInfiniteScrollIndicator.js.map +0 -7
- package/cjs/components/ShuttleListItem/ActionButtons.js.map +0 -7
- package/cjs/components/ShuttleListItem/ShuttleListItem.js.map +0 -7
- package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +0 -7
- package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +0 -7
- package/cjs/components/ShuttleListPanel.js.map +0 -7
- package/cjs/components/ShuttleSearchBox.js.map +0 -7
- package/cjs/components/ShuttleSource.js.map +0 -7
- package/cjs/components/ShuttleTarget.js.map +0 -7
- package/cjs/components/VirtualizedItem.js.map +0 -7
- package/cjs/components/VirtualizedList.js.map +0 -7
- package/cjs/components/VirtualizedSortableList.js.map +0 -7
- package/cjs/helper.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/tests/utils.js +0 -1218
- package/cjs/tests/utils.js.map +0 -7
- package/cjs/updateShuttleStateFromProps.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/cjs/withProviders.js.map +0 -7
- package/esm/AnimationState.js.map +0 -7
- package/esm/DSShuttle.js.map +0 -7
- package/esm/SearchState.js.map +0 -7
- package/esm/Shuttle.actions.js.map +0 -7
- package/esm/ShuttleContainer.js.map +0 -7
- package/esm/ShuttleImpl.js.map +0 -7
- package/esm/ShuttleRenderer.js.map +0 -7
- package/esm/ShuttleState.js.map +0 -7
- package/esm/animation/animationConfig.js.map +0 -7
- package/esm/classedComponents.js.map +0 -7
- package/esm/components/LoadingIndicator.js.map +0 -7
- package/esm/components/OverflowList.js.map +0 -7
- package/esm/components/ShuttleBreadcrumb.js.map +0 -7
- package/esm/components/ShuttleInfiniteScrollIndicator.js.map +0 -7
- package/esm/components/ShuttleListItem/ActionButtons.js.map +0 -7
- package/esm/components/ShuttleListItem/ShuttleListItem.js.map +0 -7
- package/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +0 -7
- package/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +0 -7
- package/esm/components/ShuttleListPanel.js.map +0 -7
- package/esm/components/ShuttleSearchBox.js.map +0 -7
- package/esm/components/ShuttleSource.js.map +0 -7
- package/esm/components/ShuttleTarget.js.map +0 -7
- package/esm/components/VirtualizedItem.js.map +0 -7
- package/esm/components/VirtualizedList.js.map +0 -7
- package/esm/components/VirtualizedSortableList.js.map +0 -7
- package/esm/helper.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/tests/utils.js +0 -1189
- package/esm/tests/utils.js.map +0 -7
- package/esm/updateShuttleStateFromProps.js.map +0 -7
- package/esm/utils.js.map +0 -7
- package/esm/withProviders.js.map +0 -7
package/esm/ShuttleRenderer.js
CHANGED
|
@@ -1,115 +1,132 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
111
|
-
export {
|
|
112
|
-
ShuttleRenderer,
|
|
113
|
-
ShuttleRenderer_default as default
|
|
114
|
-
};
|
|
115
|
-
//# sourceMappingURL=ShuttleRenderer.js.map
|
|
131
|
+
|
|
132
|
+
export { ShuttleRenderer as default };
|
package/esm/ShuttleState.js
CHANGED
|
@@ -1,55 +1,74 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
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: [{
|
|
11
|
-
|
|
13
|
+
hierarchy: [{
|
|
14
|
+
name: 'Category',
|
|
15
|
+
id: null
|
|
16
|
+
}],
|
|
17
|
+
hierarchyDest: [{
|
|
18
|
+
name: 'Added users',
|
|
19
|
+
id: null
|
|
20
|
+
}]
|
|
12
21
|
});
|
|
13
|
-
|
|
14
|
-
|
|
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(
|
|
17
|
-
setState(pipe([
|
|
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([
|
|
34
|
+
setState(pipe([navigateTo(item, dest), resetCheckedItems()]));
|
|
21
35
|
}
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
|
|
37
|
+
function resetCheckedItems$1() {
|
|
38
|
+
setState(resetCheckedItems());
|
|
24
39
|
}
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
|
|
41
|
+
function resetMovedItems$1() {
|
|
42
|
+
setState(pipe([navigateTo({
|
|
43
|
+
id: null
|
|
44
|
+
}, true), resetMovedItems()]));
|
|
27
45
|
}
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
|
|
47
|
+
function moveItem$1(item, dest) {
|
|
48
|
+
setState(pipe([moveItem(item), resetCheckedItems()]));
|
|
30
49
|
}
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
|
|
51
|
+
function toggleItemSelection$1(item) {
|
|
52
|
+
setState(toggleItemSelection(item.id));
|
|
33
53
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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: {
|
|
10
|
-
|
|
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: {
|
|
14
|
-
|
|
18
|
+
from: {
|
|
19
|
+
transform: 'translate3d(0,0,0)'
|
|
20
|
+
},
|
|
21
|
+
to: {
|
|
22
|
+
transform: "translate3d(".concat(-xPosMovement, "px,0,0)")
|
|
23
|
+
}
|
|
15
24
|
},
|
|
16
|
-
moveItem:
|
|
17
|
-
config: {
|
|
18
|
-
|
|
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:
|
|
35
|
+
transform: "translate3d(".concat(isMovingLeft ? -xPosMovement : xPosMovement, "px,0,0)")
|
|
22
36
|
},
|
|
23
37
|
leave: {
|
|
24
|
-
transform:
|
|
38
|
+
transform: "translate3d(".concat(isMovingLeft ? -xPosMovement : xPosMovement, "px,0,0)")
|
|
25
39
|
}
|
|
26
40
|
}),
|
|
27
|
-
moveList:
|
|
28
|
-
config: {
|
|
29
|
-
|
|
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:
|
|
51
|
+
transform: "translate3d(0px,".concat(isDrillingDown ? xPosMovement : -xPosMovement, "px,0)")
|
|
33
52
|
},
|
|
34
53
|
leave: {
|
|
35
54
|
opacity: 0,
|
|
36
|
-
transform:
|
|
55
|
+
transform: "translate3d(0,".concat(isDrillingDown ? -xPosMovement : xPosMovement, "px,0)")
|
|
37
56
|
}
|
|
38
57
|
}),
|
|
39
58
|
breadcrumb: () => ({
|
|
40
|
-
config: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=animationConfig.js.map
|
|
76
|
+
|
|
77
|
+
export { animationConfig };
|
package/esm/classedComponents.js
CHANGED
|
@@ -1,43 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const blockName =
|
|
7
|
-
const headerBlockName =
|
|
8
|
-
const listBlockName =
|
|
9
|
-
const footerBlockName =
|
|
10
|
-
const ShuttleContainer = aggregatedClasses(
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { DSCircularProgressIndicator } from
|
|
4
|
-
import styled from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
},
|
|
13
|
+
}, void 0, /*#__PURE__*/_jsx(DSCircularProgressIndicator, {
|
|
15
14
|
size: "xl",
|
|
16
15
|
showLabel: true
|
|
17
|
-
}));
|
|
18
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
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: {
|
|
26
|
+
state: {
|
|
27
|
+
isDrillingDown = false
|
|
28
|
+
},
|
|
9
29
|
setIsDrillingDown
|
|
10
|
-
} = useContext(
|
|
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
|
-
|
|
22
|
-
export {
|
|
23
|
-
OverflowList,
|
|
24
|
-
OverflowList_default as default
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=OverflowList.js.map
|
|
45
|
+
|
|
46
|
+
export { OverflowList as default };
|