@elliemae/ds-shuttle 2.0.0-alpha.10 → 2.0.0-alpha.14
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 +1 -0
- package/cjs/DSShuttle.js +84 -80
- package/cjs/SearchState.js +1 -0
- package/cjs/Shuttle.actions.js +28 -18
- package/cjs/ShuttleContainer.js +15 -8
- package/cjs/ShuttleImpl.js +28 -16
- package/cjs/ShuttleRenderer.js +9 -2
- package/cjs/ShuttleState.js +7 -2
- package/cjs/animation/animationConfig.js +10 -10
- package/cjs/classedComponents.js +31 -22
- package/cjs/components/LoadingIndicator.js +2 -2
- package/cjs/components/OverflowList.js +23 -12
- package/cjs/components/ShuttleBreadcrumb.js +21 -15
- package/cjs/components/ShuttleInfiniteScrollIndicator.js +22 -16
- package/cjs/components/ShuttleListItem/ActionButtons.js +10 -10
- package/cjs/components/ShuttleListItem/ShuttleListItem.js +22 -15
- package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +6 -0
- package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +5 -0
- package/cjs/components/ShuttleListPanel.js +7 -6
- package/cjs/components/ShuttleSearchBox.js +18 -18
- package/cjs/components/ShuttleSource.js +49 -43
- package/cjs/components/ShuttleTarget.js +29 -22
- package/cjs/components/VirtualizedItem.js +12 -6
- package/cjs/components/VirtualizedList.js +47 -35
- package/cjs/components/VirtualizedSortableList.js +5 -0
- package/cjs/helper.js +36 -14
- package/cjs/updateShuttleStateFromProps.js +16 -6
- package/cjs/utils.js +7 -2
- package/cjs/withProviders.js +5 -0
- package/esm/AnimationState.js +1 -0
- package/esm/DSShuttle.js +84 -80
- package/esm/SearchState.js +1 -0
- package/esm/Shuttle.actions.js +22 -12
- package/esm/ShuttleContainer.js +12 -5
- package/esm/ShuttleImpl.js +22 -10
- package/esm/ShuttleRenderer.js +9 -2
- package/esm/ShuttleState.js +7 -2
- package/esm/animation/animationConfig.js +10 -10
- package/esm/classedComponents.js +31 -22
- package/esm/components/LoadingIndicator.js +1 -1
- package/esm/components/OverflowList.js +23 -12
- package/esm/components/ShuttleBreadcrumb.js +21 -15
- package/esm/components/ShuttleInfiniteScrollIndicator.js +22 -16
- package/esm/components/ShuttleListItem/ActionButtons.js +7 -4
- package/esm/components/ShuttleListItem/ShuttleListItem.js +21 -13
- package/esm/components/ShuttleListItem/ShuttleSourceListItem.js +6 -0
- package/esm/components/ShuttleListItem/ShuttleTargetListItem.js +5 -0
- package/esm/components/ShuttleListPanel.js +7 -6
- package/esm/components/ShuttleSearchBox.js +16 -14
- package/esm/components/ShuttleSource.js +44 -36
- package/esm/components/ShuttleTarget.js +29 -22
- package/esm/components/VirtualizedItem.js +12 -6
- package/esm/components/VirtualizedList.js +47 -35
- package/esm/components/VirtualizedSortableList.js +5 -0
- package/esm/helper.js +33 -11
- package/esm/updateShuttleStateFromProps.js +11 -1
- package/esm/utils.js +6 -1
- package/esm/withProviders.js +5 -0
- package/package.json +27 -12
- package/types/DSShuttle.d.ts +259 -37
- package/types/components/ShuttleBreadcrumb.d.ts +1 -1
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
2
|
import { Component } from 'react';
|
|
4
3
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
5
|
-
import { debounce } from '@elliemae/ds-utilities
|
|
6
|
-
import DSTextBox from '@elliemae/ds-
|
|
4
|
+
import { debounce } from '@elliemae/ds-utilities';
|
|
5
|
+
import { DSTextBox } from '@elliemae/ds-form';
|
|
7
6
|
|
|
8
7
|
const blockName = 'shuttle-search-box';
|
|
9
|
-
const SearchBoxContainer = aggregatedClasses('div')(blockName, null,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const SearchBoxContainer = aggregatedClasses('div')(blockName, null, _ref => {
|
|
9
|
+
let {
|
|
10
|
+
isOpen
|
|
11
|
+
} = _ref;
|
|
12
|
+
return {
|
|
13
|
+
opened: isOpen
|
|
14
|
+
};
|
|
15
|
+
});
|
|
14
16
|
const filterList = debounce((term, onFilterCallback) => {
|
|
15
17
|
onFilterCallback(term);
|
|
16
18
|
}, 200);
|
|
@@ -25,9 +27,10 @@ class ShuttleSearchBox extends Component {
|
|
|
25
27
|
this.handleKeyPress = this.handleKeyPress.bind(this);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
static getDerivedStateFromProps(nextProps, {
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
static getDerivedStateFromProps(nextProps, _ref2) {
|
|
31
|
+
let {
|
|
32
|
+
prevProps
|
|
33
|
+
} = _ref2;
|
|
31
34
|
const {
|
|
32
35
|
value
|
|
33
36
|
} = nextProps;
|
|
@@ -92,11 +95,10 @@ class ShuttleSearchBox extends Component {
|
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
}
|
|
95
|
-
|
|
96
|
-
_defineProperty(ShuttleSearchBox, "defaultProps", {
|
|
98
|
+
ShuttleSearchBox.defaultProps = {
|
|
97
99
|
filterOnKeyStroke: false,
|
|
98
100
|
onChange: () => null,
|
|
99
101
|
onFilter: () => null
|
|
100
|
-
}
|
|
102
|
+
};
|
|
101
103
|
|
|
102
104
|
export { ShuttleSearchBox as default };
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
7
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
11
|
import { useContext, useMemo, useCallback } from 'react';
|
|
5
|
-
import ArrowShortRight from '@elliemae/ds-icons
|
|
6
|
-
import DSButton from '@elliemae/ds-
|
|
7
|
-
import
|
|
8
|
-
import { runAll } from '@elliemae/ds-utilities/utils';
|
|
12
|
+
import { Search, ArrowShortRight } from '@elliemae/ds-icons';
|
|
13
|
+
import DSButton from '@elliemae/ds-button';
|
|
14
|
+
import { runAll } from '@elliemae/ds-utilities';
|
|
9
15
|
import ShuttleSearchBox from './ShuttleSearchBox.js';
|
|
10
16
|
import ShuttleInfiniteScrollIndicator from './ShuttleInfiniteScrollIndicator.js';
|
|
11
17
|
import ShuttleSourceListItem from './ShuttleListItem/ShuttleSourceListItem.js';
|
|
@@ -29,31 +35,32 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
29
35
|
|
|
30
36
|
const noop = () => {};
|
|
31
37
|
|
|
32
|
-
function ShuttleSource({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
function ShuttleSource(_ref) {
|
|
39
|
+
let {
|
|
40
|
+
items = [],
|
|
41
|
+
checkedItems = [],
|
|
42
|
+
// build Map() and memoize it for better performance
|
|
43
|
+
hierarchy = [],
|
|
44
|
+
onMoveItem = noop,
|
|
45
|
+
onCheckItem = noop,
|
|
46
|
+
onMoveCheckedItems = noop,
|
|
47
|
+
onNavigateTo = noop,
|
|
48
|
+
onClearCheckedItems = noop,
|
|
49
|
+
emptyMessage = 'No items found',
|
|
50
|
+
composeSourceItemProps = noop,
|
|
51
|
+
loading = false,
|
|
52
|
+
onSearch = noop,
|
|
53
|
+
onSearchClose = noop,
|
|
54
|
+
onSearchOpen = noop,
|
|
55
|
+
sourceSortable = false,
|
|
56
|
+
onSortEnd = noop,
|
|
57
|
+
sourceClearItemsText = 'CLEAR ALL',
|
|
58
|
+
searchPlaceholder,
|
|
59
|
+
renderSourceCounter = amount => "".concat(amount, " items"),
|
|
60
|
+
onGetMoreItems = () => {},
|
|
61
|
+
moreItemsLoading = false,
|
|
62
|
+
hasNextPage = false
|
|
63
|
+
} = _ref;
|
|
57
64
|
const {
|
|
58
65
|
state: {
|
|
59
66
|
isMovingBack = false,
|
|
@@ -87,10 +94,11 @@ function ShuttleSource({
|
|
|
87
94
|
}, [searching]);
|
|
88
95
|
const ComponentList = useMemo(() => sourceSortable ? VirtualizedSortableList : VirtualizedList, [sourceSortable]);
|
|
89
96
|
|
|
90
|
-
const handleSortEnd =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
const handleSortEnd = _ref2 => {
|
|
98
|
+
let {
|
|
99
|
+
oldIndex,
|
|
100
|
+
newIndex
|
|
101
|
+
} = _ref2;
|
|
94
102
|
onSortEnd({
|
|
95
103
|
sourceItem: items[oldIndex],
|
|
96
104
|
targetItem: items[newIndex]
|
|
@@ -131,11 +139,11 @@ function ShuttleSource({
|
|
|
131
139
|
}
|
|
132
140
|
}, void 0, /*#__PURE__*/_jsx(ComponentList, {
|
|
133
141
|
helperClass: "drag-helper",
|
|
134
|
-
itemRenderer:
|
|
142
|
+
itemRenderer: _ref3 => {
|
|
135
143
|
let {
|
|
136
144
|
item
|
|
137
|
-
} =
|
|
138
|
-
rest = _objectWithoutProperties(
|
|
145
|
+
} = _ref3,
|
|
146
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
139
147
|
|
|
140
148
|
return /*#__PURE__*/jsx(ShuttleSourceListItem, _objectSpread(_objectSpread(_objectSpread({
|
|
141
149
|
"data-testid": "source-list-item"
|
|
@@ -1,8 +1,13 @@
|
|
|
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';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
8
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
4
9
|
import { useContext } from 'react';
|
|
5
|
-
import DSButton from '@elliemae/ds-
|
|
10
|
+
import DSButton from '@elliemae/ds-button';
|
|
6
11
|
import { ShuttleWrapper, ShuttleHeader, ShuttleHeaderBreadcrumb, ShuttleList, Overflow, LoadingList, ShuttleFooter, ShuttleFooterActions, ShuttleFooterCounter, EmptyMessage } from '../classedComponents.js';
|
|
7
12
|
import { getActiveIdFromHierarchy } from '../helper.js';
|
|
8
13
|
import AnimationContext from '../AnimationState.js';
|
|
@@ -22,20 +27,21 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
22
27
|
|
|
23
28
|
const noop = () => {};
|
|
24
29
|
|
|
25
|
-
function ShuttleTarget({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
function ShuttleTarget(_ref) {
|
|
31
|
+
let {
|
|
32
|
+
items = [],
|
|
33
|
+
hierarchy = [],
|
|
34
|
+
onNavigateTo = noop,
|
|
35
|
+
onMoveItem = noop,
|
|
36
|
+
onClearMovedItems = noop,
|
|
37
|
+
emptyMessage = 'No items selected',
|
|
38
|
+
composeTargetItemProps = () => ({}),
|
|
39
|
+
targetSortable = false,
|
|
40
|
+
onSortEnd = noop,
|
|
41
|
+
targetClearItemsText = 'CLEAR ALL',
|
|
42
|
+
renderTargetCounter = amount => "".concat(amount, " items"),
|
|
43
|
+
loading = false
|
|
44
|
+
} = _ref;
|
|
39
45
|
const {
|
|
40
46
|
state: {
|
|
41
47
|
isMoving = false
|
|
@@ -45,10 +51,11 @@ function ShuttleTarget({
|
|
|
45
51
|
const emptyContent = loading ? _LoadingIndicator || (_LoadingIndicator = /*#__PURE__*/_jsx(LoadingIndicator, {})) : /*#__PURE__*/_jsx(EmptyMessage, {}, void 0, emptyMessage);
|
|
46
52
|
const ComponentList = targetSortable ? VirtualizedSortableList : VirtualizedList;
|
|
47
53
|
|
|
48
|
-
const handleSortEnd =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
const handleSortEnd = _ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
oldIndex,
|
|
57
|
+
newIndex
|
|
58
|
+
} = _ref2;
|
|
52
59
|
onSortEnd({
|
|
53
60
|
sourceItem: items[oldIndex],
|
|
54
61
|
targetItem: items[newIndex]
|
|
@@ -68,11 +75,11 @@ function ShuttleTarget({
|
|
|
68
75
|
empty: !items.length
|
|
69
76
|
}
|
|
70
77
|
}, void 0, /*#__PURE__*/_jsx(ComponentList, {
|
|
71
|
-
itemRenderer:
|
|
78
|
+
itemRenderer: _ref3 => {
|
|
72
79
|
let {
|
|
73
80
|
item
|
|
74
|
-
} =
|
|
75
|
-
rest = _objectWithoutProperties(
|
|
81
|
+
} = _ref3,
|
|
82
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
76
83
|
|
|
77
84
|
return /*#__PURE__*/jsx(ShuttleTargetListItem, _objectSpread(_objectSpread(_objectSpread({
|
|
78
85
|
"data-testid": "target-list-item"
|
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import { memo } from 'react';
|
|
3
8
|
import { areEqual } from 'react-window';
|
|
@@ -5,12 +10,13 @@ import { areEqual } from 'react-window';
|
|
|
5
10
|
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; }
|
|
6
11
|
|
|
7
12
|
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; }
|
|
8
|
-
const VirtualizedItem = /*#__PURE__*/memo(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
const VirtualizedItem = /*#__PURE__*/memo(_ref => {
|
|
14
|
+
let {
|
|
15
|
+
data,
|
|
16
|
+
index,
|
|
17
|
+
style: virtualizedStyles,
|
|
18
|
+
showSortHandler = false
|
|
19
|
+
} = _ref;
|
|
14
20
|
const {
|
|
15
21
|
items,
|
|
16
22
|
itemRenderer,
|
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import { useRef, useContext, useEffect } from 'react';
|
|
@@ -14,16 +19,17 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
14
19
|
|
|
15
20
|
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; }
|
|
16
21
|
|
|
17
|
-
function VirtualizedList({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
function VirtualizedList(_ref) {
|
|
23
|
+
let {
|
|
24
|
+
items,
|
|
25
|
+
itemRenderer,
|
|
26
|
+
searching,
|
|
27
|
+
target = false,
|
|
28
|
+
innerRef,
|
|
29
|
+
children,
|
|
30
|
+
hasNextPage = true,
|
|
31
|
+
getMoreItems = () => {}
|
|
32
|
+
} = _ref;
|
|
27
33
|
const hasMounted = useRef(false);
|
|
28
34
|
const {
|
|
29
35
|
state: {
|
|
@@ -42,31 +48,37 @@ function VirtualizedList({
|
|
|
42
48
|
|
|
43
49
|
const isItemLoaded = index => !hasNextPage || index < items.length;
|
|
44
50
|
|
|
45
|
-
return /*#__PURE__*/_jsx(AutoSizer, {}, void 0,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
51
|
+
return /*#__PURE__*/_jsx(AutoSizer, {}, void 0, _ref2 => {
|
|
52
|
+
let {
|
|
53
|
+
height,
|
|
54
|
+
width
|
|
55
|
+
} = _ref2;
|
|
56
|
+
return /*#__PURE__*/_jsx(InfiniteLoader, {
|
|
57
|
+
isItemLoaded: isItemLoaded,
|
|
58
|
+
itemCount: itemCount,
|
|
59
|
+
loadMoreItems: getMoreItems
|
|
60
|
+
}, void 0, _ref3 => {
|
|
61
|
+
let {
|
|
62
|
+
onItemsRendered,
|
|
63
|
+
ref
|
|
64
|
+
} = _ref3;
|
|
65
|
+
return /*#__PURE__*/jsx(FixedSizeList, {
|
|
66
|
+
height: searching ? 300 : height,
|
|
67
|
+
width: width,
|
|
68
|
+
innerRef: innerRef,
|
|
69
|
+
itemCount: transitions.length,
|
|
70
|
+
itemData: {
|
|
71
|
+
items: transitions,
|
|
72
|
+
itemRenderer,
|
|
73
|
+
isItemMoving: hasMounted.current && (isMoving || isMovingBack)
|
|
74
|
+
},
|
|
75
|
+
itemSize: 35,
|
|
76
|
+
onItemsRendered: onItemsRendered,
|
|
77
|
+
ref: ref,
|
|
78
|
+
children: children || VirtualizedItem
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
70
82
|
}
|
|
71
83
|
|
|
72
84
|
export { VirtualizedList as default };
|
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
8
|
import 'react';
|
package/esm/helper.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
3
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.some.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.some.js';
|
|
7
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
11
|
+
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
12
|
+
import 'core-js/modules/esnext.iterator.find.js';
|
|
13
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
14
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
15
|
+
import { omit, compose, hashArray } from '@elliemae/ds-utilities';
|
|
3
16
|
import * as tree from 'treetabular';
|
|
4
17
|
|
|
5
18
|
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; }
|
|
@@ -7,8 +20,14 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
7
20
|
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; }
|
|
8
21
|
const getHierarchyTypeName = dest => !dest ? 'hierarchy' : 'hierarchyDest';
|
|
9
22
|
const checkHasChildren = (list, currentItem) => list.some(item => currentItem.id === item.parent);
|
|
10
|
-
const getActiveIdFromHierarchy = (
|
|
11
|
-
|
|
23
|
+
const getActiveIdFromHierarchy = function () {
|
|
24
|
+
let hierarchy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
25
|
+
return hierarchy[hierarchy.length - 1] || {};
|
|
26
|
+
};
|
|
27
|
+
const filterItemsByHierarchy = function (list, hierarchyId) {
|
|
28
|
+
let parentField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'parent';
|
|
29
|
+
return list.filter(item => item[parentField] === hierarchyId);
|
|
30
|
+
};
|
|
12
31
|
const getItemsById = (ids, list) => ids.reduce((acc, id) => acc.concat(list.find(item => String(item.id) === String(id))), []).filter(item => item);
|
|
13
32
|
const toggleInObject = (obj, key, value) => obj[key] ? omit(obj, [key]) : _objectSpread(_objectSpread({}, obj), {}, {
|
|
14
33
|
[key]: value
|
|
@@ -16,14 +35,17 @@ const toggleInObject = (obj, key, value) => obj[key] ? omit(obj, [key]) : _objec
|
|
|
16
35
|
const isMovable = item => !item.forceNotMovable && (item.hasChildren && item.isMoveableContainer || !item.hasChildren); // utility to execute all specified actions in sequence
|
|
17
36
|
|
|
18
37
|
const pipe = actions => (initState, props) => actions.reduce((prevState, action) => action(prevState, props), initState);
|
|
19
|
-
const moveItems =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
items
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
const moveItems = _ref => {
|
|
39
|
+
let {
|
|
40
|
+
oldIndex,
|
|
41
|
+
newIndex
|
|
42
|
+
} = _ref;
|
|
43
|
+
return items => {
|
|
44
|
+
const sourceItem = items[oldIndex];
|
|
45
|
+
items.splice(oldIndex, 1);
|
|
46
|
+
items.splice(newIndex, 0, sourceItem);
|
|
47
|
+
return items;
|
|
48
|
+
};
|
|
27
49
|
};
|
|
28
50
|
const prepareItems = items => compose(tree.fixOrder(), items => items.map(item => _objectSpread(_objectSpread({}, item), {}, {
|
|
29
51
|
hasChildren: checkHasChildren(items, item)
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
5
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.find.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
11
|
+
import 'core-js/modules/esnext.iterator.find.js';
|
|
12
|
+
import { compose, isEqual, hashArray } from '@elliemae/ds-utilities';
|
|
3
13
|
import { getItemsById, pipe, prepareItems } from './helper.js';
|
|
4
14
|
import { addToTarget, resetMovedItems } from './Shuttle.actions.js';
|
|
5
15
|
|
package/esm/utils.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
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';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import * as tree from 'treetabular';
|
|
3
|
-
import { compose } from '@elliemae/ds-utilities
|
|
8
|
+
import { compose } from '@elliemae/ds-utilities';
|
|
4
9
|
import { prepareItems } from './helper.js';
|
|
5
10
|
|
|
6
11
|
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; }
|
package/esm/withProviders.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import 'react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-shuttle",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Shuttle",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -152,26 +152,41 @@
|
|
|
152
152
|
"build": "node ../../scripts/build/build.js"
|
|
153
153
|
},
|
|
154
154
|
"dependencies": {
|
|
155
|
-
"@elliemae/ds-basic": "2.0.0-alpha.
|
|
156
|
-
"@elliemae/ds-
|
|
157
|
-
"@elliemae/ds-
|
|
155
|
+
"@elliemae/ds-basic": "2.0.0-alpha.14",
|
|
156
|
+
"@elliemae/ds-button": "2.0.0-alpha.14",
|
|
157
|
+
"@elliemae/ds-circular-progress-indicator": "2.0.0-alpha.14",
|
|
158
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.14",
|
|
159
|
+
"@elliemae/ds-form": "2.0.0-alpha.14",
|
|
160
|
+
"@elliemae/ds-icons": "2.0.0-alpha.14",
|
|
161
|
+
"@elliemae/ds-indeterminate-progress-indicator": "2.0.0-alpha.14",
|
|
162
|
+
"@elliemae/ds-system": "2.0.0-alpha.14",
|
|
163
|
+
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.14",
|
|
164
|
+
"@elliemae/ds-utilities": "2.0.0-alpha.14",
|
|
158
165
|
"constate": "~1.3.2",
|
|
159
|
-
"memoize-one": "~4.0.3",
|
|
160
166
|
"prop-types": "~15.7.2",
|
|
167
|
+
"react-desc": "~4.1.3",
|
|
161
168
|
"react-sortable-hoc": "~1.9.1",
|
|
162
169
|
"react-spring": "~8.0.27",
|
|
163
|
-
"react-
|
|
164
|
-
"react-window
|
|
170
|
+
"react-virtualized-auto-sizer": "~1.0.4",
|
|
171
|
+
"react-window": "~1.8.5",
|
|
172
|
+
"react-window-infinite-loader": "~1.0.5",
|
|
165
173
|
"treetabular": "~3.6.0"
|
|
166
174
|
},
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
175
|
+
"devDependencies": {
|
|
176
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
177
|
+
"@testing-library/react": "~12.1.2",
|
|
178
|
+
"@testing-library/user-event": "~13.5.0",
|
|
179
|
+
"styled-components": "~5.3.3"
|
|
171
180
|
},
|
|
172
181
|
"peerDependencies": {
|
|
173
182
|
"lodash": "^4.17.21",
|
|
174
183
|
"react": "~17.0.2",
|
|
175
|
-
"react-dom": "^17.0.2"
|
|
184
|
+
"react-dom": "^17.0.2",
|
|
185
|
+
"styled-components": "^5.3.3"
|
|
186
|
+
},
|
|
187
|
+
"publishConfig": {
|
|
188
|
+
"access": "public",
|
|
189
|
+
"directory": "dist",
|
|
190
|
+
"generateSubmodules": true
|
|
176
191
|
}
|
|
177
192
|
}
|