@elliemae/ds-shuttle 1.60.0 → 2.0.0-alpha.12
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 +26 -42
- package/cjs/DSShuttle.js +54 -146
- package/cjs/SearchState.js +10 -22
- package/cjs/Shuttle.actions.js +65 -73
- package/cjs/ShuttleContainer.js +49 -77
- package/cjs/ShuttleImpl.js +250 -338
- package/cjs/ShuttleRenderer.js +121 -184
- package/cjs/ShuttleState.js +22 -39
- package/cjs/animation/animationConfig.js +56 -63
- package/cjs/classedComponents.js +32 -35
- package/cjs/components/LoadingIndicator.js +11 -12
- package/cjs/components/OverflowList.js +33 -29
- package/cjs/components/ShuttleBreadcrumb.js +26 -32
- package/cjs/components/ShuttleInfiniteScrollIndicator.js +17 -13
- package/cjs/components/ShuttleListItem/ActionButtons.js +39 -34
- package/cjs/components/ShuttleListItem/ShuttleListItem.js +59 -58
- package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +40 -61
- package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +35 -50
- package/cjs/components/ShuttleListPanel.js +11 -23
- package/cjs/components/ShuttleSearchBox.js +79 -102
- package/cjs/components/ShuttleSource.js +99 -169
- package/cjs/components/ShuttleTarget.js +62 -82
- package/cjs/components/VirtualizedItem.js +28 -22
- package/cjs/components/VirtualizedList.js +52 -50
- package/cjs/components/VirtualizedSortableList.js +25 -23
- package/cjs/helper.js +52 -82
- package/cjs/index.js +1 -60
- package/cjs/updateShuttleStateFromProps.js +41 -40
- package/cjs/utils.js +9 -9
- package/cjs/withProviders.js +15 -16
- package/esm/AnimationState.js +25 -40
- package/esm/DSShuttle.js +51 -143
- package/esm/SearchState.js +9 -20
- package/esm/Shuttle.actions.js +64 -71
- package/esm/ShuttleContainer.js +47 -75
- package/esm/ShuttleImpl.js +254 -334
- package/esm/ShuttleRenderer.js +117 -179
- package/esm/ShuttleState.js +17 -32
- package/esm/animation/animationConfig.js +56 -63
- package/esm/classedComponents.js +30 -33
- package/esm/components/LoadingIndicator.js +10 -11
- package/esm/components/OverflowList.js +30 -26
- package/esm/components/ShuttleBreadcrumb.js +23 -29
- package/esm/components/ShuttleInfiniteScrollIndicator.js +16 -12
- package/esm/components/ShuttleListItem/ActionButtons.js +38 -33
- package/esm/components/ShuttleListItem/ShuttleListItem.js +56 -55
- package/esm/components/ShuttleListItem/ShuttleSourceListItem.js +36 -56
- package/esm/components/ShuttleListItem/ShuttleTargetListItem.js +31 -46
- package/esm/components/ShuttleListPanel.js +10 -22
- package/esm/components/ShuttleSearchBox.js +78 -95
- package/esm/components/ShuttleSource.js +89 -157
- package/esm/components/ShuttleTarget.js +55 -75
- package/esm/components/VirtualizedItem.js +26 -20
- package/esm/components/VirtualizedList.js +48 -46
- package/esm/components/VirtualizedSortableList.js +21 -18
- package/esm/helper.js +49 -77
- package/esm/index.js +0 -59
- package/esm/updateShuttleStateFromProps.js +40 -38
- package/esm/utils.js +6 -4
- package/esm/withProviders.js +13 -15
- package/package.json +163 -18
- package/types/AnimationState.d.ts +26 -0
- package/types/DSShuttle.d.ts +341 -0
- package/types/SearchState.d.ts +22 -0
- package/types/Shuttle.actions.d.ts +11 -0
- package/types/ShuttleContainer.d.ts +3 -0
- package/types/ShuttleImpl.d.ts +3 -0
- package/types/ShuttleRenderer.d.ts +37 -0
- package/types/ShuttleState.d.ts +53 -0
- package/types/animation/animationConfig.d.ts +68 -0
- package/types/classedComponents.d.ts +14 -0
- package/types/components/LoadingIndicator.d.ts +3 -0
- package/types/components/OverflowList.d.ts +7 -0
- package/types/components/ShuttleBreadcrumb.d.ts +7 -0
- package/types/components/ShuttleInfiniteScrollIndicator.d.ts +5 -0
- package/types/components/ShuttleListItem/ActionButtons.d.ts +4 -0
- package/types/components/ShuttleListItem/ShuttleListItem.d.ts +14 -0
- package/types/components/ShuttleListItem/ShuttleSourceListItem.d.ts +13 -0
- package/types/components/ShuttleListItem/ShuttleTargetListItem.d.ts +13 -0
- package/types/components/ShuttleListPanel.d.ts +7 -0
- package/types/components/ShuttleSearchBox.d.ts +20 -0
- package/types/components/ShuttleSource.d.ts +54 -0
- package/types/components/ShuttleTarget.d.ts +16 -0
- package/types/components/VirtualizedItem.d.ts +3 -0
- package/types/components/VirtualizedList.d.ts +12 -0
- package/types/components/VirtualizedSortableList.d.ts +6 -0
- package/types/helper.d.ts +16 -0
- package/types/index.d.ts +1 -0
- package/types/tests/DSShuttle.events.test.d.ts +1 -0
- package/types/tests/DSShuttle.test.d.ts +1 -0
- package/types/tests/utils.d.ts +116 -0
- package/types/updateShuttleStateFromProps.d.ts +1 -0
- package/types/utils.d.ts +2 -0
- package/types/withProviders.d.ts +3 -0
- package/AnimationState/package.json +0 -10
- package/DSShuttle/package.json +0 -10
- package/SearchState/package.json +0 -10
- package/Shuttle.actions/package.json +0 -10
- package/ShuttleContainer/package.json +0 -10
- package/ShuttleImpl/package.json +0 -10
- package/ShuttleRenderer/package.json +0 -10
- package/ShuttleState/package.json +0 -10
- package/animation/animationConfig/package.json +0 -10
- package/cjs/AnimationState.js.map +0 -1
- package/cjs/DSShuttle.js.map +0 -1
- package/cjs/SearchState.js.map +0 -1
- package/cjs/Shuttle.actions.js.map +0 -1
- package/cjs/ShuttleContainer.js.map +0 -1
- package/cjs/ShuttleImpl.js.map +0 -1
- package/cjs/ShuttleRenderer.js.map +0 -1
- package/cjs/ShuttleState.js.map +0 -1
- package/cjs/animation/animationConfig.js.map +0 -1
- package/cjs/classedComponents.js.map +0 -1
- package/cjs/components/LoadingIndicator.js.map +0 -1
- package/cjs/components/OverflowList.js.map +0 -1
- package/cjs/components/ShuttleBreadcrumb.js.map +0 -1
- package/cjs/components/ShuttleInfiniteScrollIndicator.js.map +0 -1
- package/cjs/components/ShuttleListItem/ActionButtons.js.map +0 -1
- package/cjs/components/ShuttleListItem/ShuttleListItem.js.map +0 -1
- package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +0 -1
- package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +0 -1
- package/cjs/components/ShuttleListPanel.js.map +0 -1
- package/cjs/components/ShuttleSearchBox.js.map +0 -1
- package/cjs/components/ShuttleSource.js.map +0 -1
- package/cjs/components/ShuttleTarget.js.map +0 -1
- package/cjs/components/VirtualizedItem.js.map +0 -1
- package/cjs/components/VirtualizedList.js.map +0 -1
- package/cjs/components/VirtualizedSortableList.js.map +0 -1
- package/cjs/helper.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/tests/utils.js +0 -1112
- package/cjs/tests/utils.js.map +0 -1
- package/cjs/updateShuttleStateFromProps.js.map +0 -1
- package/cjs/utils.js.map +0 -1
- package/cjs/withProviders.js.map +0 -1
- package/classedComponents/package.json +0 -10
- package/components/LoadingIndicator/package.json +0 -10
- package/components/OverflowList/package.json +0 -10
- package/components/ShuttleBreadcrumb/package.json +0 -10
- package/components/ShuttleInfiniteScrollIndicator/package.json +0 -10
- package/components/ShuttleListItem/ActionButtons/package.json +0 -10
- package/components/ShuttleListItem/ShuttleListItem/package.json +0 -10
- package/components/ShuttleListItem/ShuttleSourceListItem/package.json +0 -10
- package/components/ShuttleListItem/ShuttleTargetListItem/package.json +0 -10
- package/components/ShuttleListPanel/package.json +0 -10
- package/components/ShuttleSearchBox/package.json +0 -10
- package/components/ShuttleSource/package.json +0 -10
- package/components/ShuttleTarget/package.json +0 -10
- package/components/VirtualizedItem/package.json +0 -10
- package/components/VirtualizedList/package.json +0 -10
- package/components/VirtualizedSortableList/package.json +0 -10
- package/esm/AnimationState.js.map +0 -1
- package/esm/DSShuttle.js.map +0 -1
- package/esm/SearchState.js.map +0 -1
- package/esm/Shuttle.actions.js.map +0 -1
- package/esm/ShuttleContainer.js.map +0 -1
- package/esm/ShuttleImpl.js.map +0 -1
- package/esm/ShuttleRenderer.js.map +0 -1
- package/esm/ShuttleState.js.map +0 -1
- package/esm/animation/animationConfig.js.map +0 -1
- package/esm/classedComponents.js.map +0 -1
- package/esm/components/LoadingIndicator.js.map +0 -1
- package/esm/components/OverflowList.js.map +0 -1
- package/esm/components/ShuttleBreadcrumb.js.map +0 -1
- package/esm/components/ShuttleInfiniteScrollIndicator.js.map +0 -1
- package/esm/components/ShuttleListItem/ActionButtons.js.map +0 -1
- package/esm/components/ShuttleListItem/ShuttleListItem.js.map +0 -1
- package/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +0 -1
- package/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +0 -1
- package/esm/components/ShuttleListPanel.js.map +0 -1
- package/esm/components/ShuttleSearchBox.js.map +0 -1
- package/esm/components/ShuttleSource.js.map +0 -1
- package/esm/components/ShuttleTarget.js.map +0 -1
- package/esm/components/VirtualizedItem.js.map +0 -1
- package/esm/components/VirtualizedList.js.map +0 -1
- package/esm/components/VirtualizedSortableList.js.map +0 -1
- package/esm/helper.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/tests/utils.js +0 -1100
- package/esm/tests/utils.js.map +0 -1
- package/esm/updateShuttleStateFromProps.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/esm/withProviders.js.map +0 -1
- package/helper/package.json +0 -10
- package/tests/utils/package.json +0 -10
- package/updateShuttleStateFromProps/package.json +0 -10
- package/utils/package.json +0 -10
- package/withProviders/package.json +0 -10
package/esm/ShuttleRenderer.js
CHANGED
|
@@ -1,194 +1,132 @@
|
|
|
1
|
-
import
|
|
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';
|
|
2
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import
|
|
8
|
+
import { useContext, useCallback } from 'react';
|
|
4
9
|
import ShuttleSource from './components/ShuttleSource.js';
|
|
5
10
|
import ShuttleTarget from './components/ShuttleTarget.js';
|
|
6
11
|
import { ShuttleContainer } from './classedComponents.js';
|
|
7
12
|
import AnimationContext from './AnimationState.js';
|
|
8
|
-
import '
|
|
9
|
-
import 'prop-types';
|
|
10
|
-
import '@elliemae/ds-icons';
|
|
11
|
-
import '@elliemae/ds-button';
|
|
12
|
-
import '@elliemae/ds-utilities';
|
|
13
|
-
import './components/ShuttleSearchBox.js';
|
|
14
|
-
import '@babel/runtime/helpers/esm/classCallCheck';
|
|
15
|
-
import '@babel/runtime/helpers/esm/createClass';
|
|
16
|
-
import '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
17
|
-
import '@babel/runtime/helpers/esm/inherits';
|
|
18
|
-
import '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
19
|
-
import '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
20
|
-
import '@elliemae/ds-classnames';
|
|
21
|
-
import '@elliemae/ds-form';
|
|
22
|
-
import './components/ShuttleInfiniteScrollIndicator.js';
|
|
23
|
-
import '@elliemae/ds-indeterminate-progress-indicator';
|
|
24
|
-
import './components/ShuttleListItem/ShuttleSourceListItem.js';
|
|
25
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
26
|
-
import './helper.js';
|
|
27
|
-
import 'treetabular';
|
|
28
|
-
import './components/ShuttleListItem/ActionButtons.js';
|
|
29
|
-
import './components/ShuttleListItem/ShuttleListItem.js';
|
|
30
|
-
import 'react-spring/web.cjs';
|
|
31
|
-
import '@elliemae/ds-truncated-tooltip-text';
|
|
32
|
-
import 'react-sortable-hoc';
|
|
33
|
-
import './components/ShuttleListPanel.js';
|
|
34
|
-
import './components/VirtualizedList.js';
|
|
35
|
-
import 'react-window';
|
|
36
|
-
import 'react-window-infinite-loader';
|
|
37
|
-
import 'react-virtualized-auto-sizer';
|
|
38
|
-
import './animation/animationConfig.js';
|
|
39
|
-
import './components/VirtualizedItem.js';
|
|
40
|
-
import './SearchState.js';
|
|
41
|
-
import 'constate';
|
|
42
|
-
import './components/VirtualizedSortableList.js';
|
|
43
|
-
import './components/LoadingIndicator.js';
|
|
44
|
-
import '@elliemae/ds-circular-progress-indicator';
|
|
45
|
-
import 'styled-components';
|
|
46
|
-
import './components/ShuttleListItem/ShuttleTargetListItem.js';
|
|
47
|
-
import './components/ShuttleBreadcrumb.js';
|
|
48
|
-
import '@elliemae/ds-breadcrumb';
|
|
49
|
-
import './components/OverflowList.js';
|
|
13
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
50
14
|
|
|
51
|
-
|
|
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"];
|
|
52
16
|
|
|
53
|
-
var
|
|
17
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (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 = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
20
|
+
|
|
21
|
+
const noop = () => {};
|
|
54
22
|
|
|
55
23
|
function ShuttleRenderer(_ref) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
sourceItems = _ref$sourceItems === void 0 ? [] : _ref$sourceItems,
|
|
91
|
-
_ref$targetItems = _ref.targetItems,
|
|
92
|
-
targetItems = _ref$targetItems === void 0 ? [] : _ref$targetItems,
|
|
93
|
-
sourceEmptyMessage = _ref.sourceEmptyMessage,
|
|
94
|
-
targetEmptyMessage = _ref.targetEmptyMessage,
|
|
95
|
-
composeTargetItemProps = _ref.composeTargetItemProps,
|
|
96
|
-
composeSourceItemProps = _ref.composeSourceItemProps,
|
|
97
|
-
targetSortable = _ref.targetSortable,
|
|
98
|
-
sourceSortable = _ref.sourceSortable,
|
|
99
|
-
onSourceSortEnd = _ref.onSourceSortEnd,
|
|
100
|
-
onTargetSortEnd = _ref.onTargetSortEnd,
|
|
101
|
-
_ref$loadingSource = _ref.loadingSource,
|
|
102
|
-
loadingSource = _ref$loadingSource === void 0 ? false : _ref$loadingSource,
|
|
103
|
-
_ref$loadingTarget = _ref.loadingTarget,
|
|
104
|
-
loadingTarget = _ref$loadingTarget === void 0 ? false : _ref$loadingTarget,
|
|
105
|
-
_ref$onGetMoreItems = _ref.onGetMoreItems,
|
|
106
|
-
onGetMoreItems = _ref$onGetMoreItems === void 0 ? function () {} : _ref$onGetMoreItems,
|
|
107
|
-
_ref$moreItemsLoading = _ref.moreItemsLoading,
|
|
108
|
-
moreItemsLoading = _ref$moreItemsLoading === void 0 ? false : _ref$moreItemsLoading,
|
|
109
|
-
_ref$hasNextPage = _ref.hasNextPage,
|
|
110
|
-
hasNextPage = _ref$hasNextPage === void 0 ? false : _ref$hasNextPage,
|
|
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,
|
|
46
|
+
composeTargetItemProps,
|
|
47
|
+
composeSourceItemProps,
|
|
48
|
+
targetSortable,
|
|
49
|
+
sourceSortable,
|
|
50
|
+
onSourceSortEnd,
|
|
51
|
+
onTargetSortEnd,
|
|
52
|
+
loadingSource = false,
|
|
53
|
+
loadingTarget = false,
|
|
54
|
+
onGetMoreItems = () => {},
|
|
55
|
+
moreItemsLoading = false,
|
|
56
|
+
hasNextPage = false
|
|
57
|
+
} = _ref,
|
|
111
58
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
112
59
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return reset();
|
|
122
|
-
}, 500);
|
|
123
|
-
});
|
|
124
|
-
return /*#__PURE__*/React.createElement(ShuttleContainer, _extends({
|
|
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({
|
|
125
68
|
"data-testid": "em-ds-shuttle"
|
|
126
|
-
}, containerProps),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
onSortEnd: onTargetSortEnd,
|
|
188
|
-
targetSortable: targetSortable,
|
|
189
|
-
loading: loadingTarget
|
|
190
|
-
})));
|
|
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
|
+
}))]
|
|
129
|
+
}));
|
|
191
130
|
}
|
|
192
131
|
|
|
193
132
|
export { ShuttleRenderer as default };
|
|
194
|
-
//# sourceMappingURL=ShuttleRenderer.js.map
|
package/esm/ShuttleState.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
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';
|
|
3
4
|
import { useState } from 'react';
|
|
4
5
|
import createContainer from 'constate';
|
|
5
6
|
import { getItemsById, pipe } from './helper.js';
|
|
6
7
|
import { moveItem, resetMovedItems, navigateTo, resetCheckedItems, toggleItemSelection } from './Shuttle.actions.js';
|
|
7
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
-
import '@elliemae/ds-utilities';
|
|
9
|
-
import 'treetabular';
|
|
10
|
-
import './utils.js';
|
|
11
8
|
|
|
12
9
|
function useShuttleState() {
|
|
13
|
-
|
|
10
|
+
const [shuttleState, setShuttleState] = useState({
|
|
14
11
|
checkedItems: [],
|
|
15
12
|
movedItems: {},
|
|
16
13
|
hierarchy: [{
|
|
@@ -21,23 +18,16 @@ function useShuttleState() {
|
|
|
21
18
|
name: 'Added users',
|
|
22
19
|
id: null
|
|
23
20
|
}]
|
|
24
|
-
})
|
|
25
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
-
shuttleState = _useState2[0],
|
|
27
|
-
setShuttleState = _useState2[1];
|
|
21
|
+
});
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
return setShuttleState(state(shuttleState));
|
|
31
|
-
};
|
|
23
|
+
const setState = state => setShuttleState(state(shuttleState));
|
|
32
24
|
|
|
33
25
|
function setMovedItems() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
setState(pipe([resetMovedItems()].concat(_toConsumableArray(pipeActions))));
|
|
26
|
+
let itemsIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
27
|
+
let items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
28
|
+
const itemsToMove = getItemsById(itemsIds, items);
|
|
29
|
+
const pipeActions = itemsToMove.map(item => moveItem(item));
|
|
30
|
+
setState(pipe([resetMovedItems(), ...pipeActions]));
|
|
41
31
|
}
|
|
42
32
|
|
|
43
33
|
function navigate(item, dest) {
|
|
@@ -63,27 +53,22 @@ function useShuttleState() {
|
|
|
63
53
|
}
|
|
64
54
|
|
|
65
55
|
function moveCheckedItems(items) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
setState(pipe([].concat(_toConsumableArray(pipeActions), [resetCheckedItems$1()])));
|
|
56
|
+
const pipeActions = items.map(item => moveItem$1(item));
|
|
57
|
+
setState(pipe([...pipeActions, resetCheckedItems$1()]));
|
|
70
58
|
}
|
|
71
59
|
|
|
72
60
|
return {
|
|
73
61
|
state: shuttleState,
|
|
74
62
|
toggleItemSelection: toggleItemSelection$1,
|
|
75
|
-
moveCheckedItems
|
|
63
|
+
moveCheckedItems,
|
|
76
64
|
moveItem: moveItem$1,
|
|
77
65
|
resetMovedItems: resetMovedItems$1,
|
|
78
66
|
resetCheckedItems: resetCheckedItems$1,
|
|
79
|
-
navigate
|
|
80
|
-
setMovedItems
|
|
67
|
+
navigate,
|
|
68
|
+
setMovedItems
|
|
81
69
|
};
|
|
82
70
|
}
|
|
83
71
|
|
|
84
|
-
var useShuttleState$1 = createContainer(useShuttleState,
|
|
85
|
-
return [value.state];
|
|
86
|
-
});
|
|
72
|
+
var useShuttleState$1 = createContainer(useShuttleState, value => [value.state]);
|
|
87
73
|
|
|
88
74
|
export { useShuttleState$1 as default };
|
|
89
|
-
//# sourceMappingURL=ShuttleState.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// shuttle list and items constants
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const itemAnimationDuration = 300;
|
|
3
|
+
const listAnimationDuration = 300;
|
|
4
|
+
const xPosMovement = 500; // breadcrumb constants
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const breadcrumbDuration = 200;
|
|
7
|
+
const xBreadcrumbPos = 300;
|
|
8
|
+
const animationConfig = {
|
|
9
9
|
slideRight: {
|
|
10
10
|
from: {
|
|
11
11
|
transform: 'translate3d(0,0,0)'
|
|
@@ -22,63 +22,56 @@ var animationConfig = {
|
|
|
22
22
|
transform: "translate3d(".concat(-xPosMovement, "px,0,0)")
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
moveItem:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
leave: {
|
|
76
|
-
opacity: 0,
|
|
77
|
-
transform: "translate3d(".concat(xBreadcrumbPos, "px,0,0)")
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
}
|
|
25
|
+
moveItem: isMovingLeft => ({
|
|
26
|
+
config: {
|
|
27
|
+
duration: itemAnimationDuration
|
|
28
|
+
},
|
|
29
|
+
enter: {
|
|
30
|
+
opacity: 1,
|
|
31
|
+
transform: "translate3d(".concat(0, "px,0,0)")
|
|
32
|
+
},
|
|
33
|
+
from: {
|
|
34
|
+
opacity: 1,
|
|
35
|
+
transform: "translate3d(".concat(isMovingLeft ? -xPosMovement : xPosMovement, "px,0,0)")
|
|
36
|
+
},
|
|
37
|
+
leave: {
|
|
38
|
+
transform: "translate3d(".concat(isMovingLeft ? -xPosMovement : xPosMovement, "px,0,0)")
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
moveList: isDrillingDown => ({
|
|
42
|
+
config: {
|
|
43
|
+
duration: listAnimationDuration
|
|
44
|
+
},
|
|
45
|
+
enter: {
|
|
46
|
+
opacity: 1,
|
|
47
|
+
transform: 'translate3d(0,0,0)'
|
|
48
|
+
},
|
|
49
|
+
from: {
|
|
50
|
+
opacity: 0,
|
|
51
|
+
transform: "translate3d(0px,".concat(isDrillingDown ? xPosMovement : -xPosMovement, "px,0)")
|
|
52
|
+
},
|
|
53
|
+
leave: {
|
|
54
|
+
opacity: 0,
|
|
55
|
+
transform: "translate3d(0,".concat(isDrillingDown ? -xPosMovement : xPosMovement, "px,0)")
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
breadcrumb: () => ({
|
|
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
|
+
}
|
|
74
|
+
})
|
|
81
75
|
};
|
|
82
76
|
|
|
83
77
|
export { animationConfig };
|
|
84
|
-
//# sourceMappingURL=animationConfig.js.map
|
package/esm/classedComponents.js
CHANGED
|
@@ -2,53 +2,50 @@ import DSButton from '@elliemae/ds-button';
|
|
|
2
2
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
3
3
|
import ShuttleBreadcrumb from './components/ShuttleBreadcrumb.js';
|
|
4
4
|
import OverflowList from './components/OverflowList.js';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'react-spring/web.cjs';
|
|
7
|
-
import '@elliemae/ds-breadcrumb';
|
|
8
|
-
import './animation/animationConfig.js';
|
|
9
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
10
|
-
import './AnimationState.js';
|
|
11
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
12
|
-
import 'constate';
|
|
13
5
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
19
11
|
|
|
20
|
-
|
|
12
|
+
const ShuttleWrapper = aggregatedClasses('div')("".concat(blockName, "-wrapper")); // header
|
|
21
13
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
const ShuttleHeader = aggregatedClasses('div')(headerBlockName);
|
|
15
|
+
const ShuttleHeaderBreadcrumb = aggregatedClasses(ShuttleBreadcrumb)(headerBlockName, 'breadcrumb');
|
|
16
|
+
const ShuttleHeaderSearchToggle = aggregatedClasses(DSButton)(headerBlockName, 'search-toggle'); // list
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const ShuttleList = aggregatedClasses('div')(listBlockName, null, _ref => {
|
|
19
|
+
let {
|
|
20
|
+
showPulse
|
|
21
|
+
} = _ref;
|
|
28
22
|
return {
|
|
29
23
|
'show-pulse': showPulse
|
|
30
24
|
};
|
|
31
25
|
});
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
const ShuttleListPanel = aggregatedClasses('div')(listBlockName, 'panel', _ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
open
|
|
29
|
+
} = _ref2;
|
|
34
30
|
return {
|
|
35
|
-
open
|
|
31
|
+
open
|
|
36
32
|
};
|
|
37
33
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
const Overflow = aggregatedClasses(OverflowList)(listBlockName, 'overflow', _ref3 => {
|
|
35
|
+
let {
|
|
36
|
+
empty,
|
|
37
|
+
searching
|
|
38
|
+
} = _ref3;
|
|
41
39
|
return {
|
|
42
|
-
empty
|
|
43
|
-
searching
|
|
40
|
+
empty,
|
|
41
|
+
searching
|
|
44
42
|
};
|
|
45
43
|
});
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
const EmptyMessage = aggregatedClasses('span')(listBlockName, 'empty-message');
|
|
45
|
+
const LoadingList = aggregatedClasses('div')(listBlockName, 'loading-list'); // footer
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const ShuttleFooter = aggregatedClasses('div')(footerBlockName);
|
|
48
|
+
const ShuttleFooterActions = aggregatedClasses('div')(footerBlockName, 'actions');
|
|
49
|
+
const ShuttleFooterCounter = aggregatedClasses('span')(footerBlockName, 'counter');
|
|
52
50
|
|
|
53
51
|
export { EmptyMessage, LoadingList, Overflow, ShuttleContainer, ShuttleFooter, ShuttleFooterActions, ShuttleFooterCounter, ShuttleHeader, ShuttleHeaderBreadcrumb, ShuttleHeaderSearchToggle, ShuttleList, ShuttleListPanel, ShuttleWrapper };
|
|
54
|
-
//# sourceMappingURL=classedComponents.js.map
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
|
|
5
|
-
var
|
|
6
|
+
var _Wrapper;
|
|
7
|
+
const Wrapper = /*#__PURE__*/styled.div.withConfig({
|
|
6
8
|
componentId: "sc-18oj125-0"
|
|
7
9
|
})(["display:flex;justify-content:center;align-items:center;width:100%;height:100%;"]);
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}));
|
|
16
|
-
};
|
|
11
|
+
const LoadingIndicator = () => _Wrapper || (_Wrapper = /*#__PURE__*/_jsx(Wrapper, {
|
|
12
|
+
"data-testid": "shuttle__loading-indicator"
|
|
13
|
+
}, void 0, /*#__PURE__*/_jsx(DSCircularProgressIndicator, {
|
|
14
|
+
size: "xl",
|
|
15
|
+
showLabel: true
|
|
16
|
+
})));
|
|
17
17
|
|
|
18
18
|
export { LoadingIndicator as default };
|
|
19
|
-
//# sourceMappingURL=LoadingIndicator.js.map
|