@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
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
2
3
|
import DSButton from '@elliemae/ds-button';
|
|
3
4
|
import { ShuttleListPanel as ShuttleListPanel$1 } from '../classedComponents.js';
|
|
4
|
-
import '@elliemae/ds-classnames';
|
|
5
|
-
import './ShuttleBreadcrumb.js';
|
|
6
|
-
import 'react-spring/web.cjs';
|
|
7
|
-
import '@elliemae/ds-breadcrumb';
|
|
8
|
-
import '../animation/animationConfig.js';
|
|
9
|
-
import './OverflowList.js';
|
|
10
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
11
|
-
import '../AnimationState.js';
|
|
12
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
13
|
-
import 'constate';
|
|
14
5
|
|
|
15
6
|
function ShuttleListPanel(_ref) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
children = _ref.children;
|
|
23
|
-
return /*#__PURE__*/React.createElement(ShuttleListPanel$1, {
|
|
7
|
+
let {
|
|
8
|
+
onClick = () => null,
|
|
9
|
+
open = false,
|
|
10
|
+
children
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/_jsx(ShuttleListPanel$1, {
|
|
24
13
|
classProps: {
|
|
25
|
-
open
|
|
14
|
+
open
|
|
26
15
|
}
|
|
27
|
-
}, /*#__PURE__*/
|
|
16
|
+
}, void 0, /*#__PURE__*/_jsx(DSButton, {
|
|
28
17
|
buttonType: "text",
|
|
29
18
|
icon: children,
|
|
30
19
|
onClick: onClick,
|
|
@@ -33,4 +22,3 @@ function ShuttleListPanel(_ref) {
|
|
|
33
22
|
}
|
|
34
23
|
|
|
35
24
|
export { ShuttleListPanel as default };
|
|
36
|
-
//# sourceMappingURL=ShuttleListPanel.js.map
|
|
@@ -1,121 +1,104 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
4
|
-
import _inherits from '@babel/runtime/helpers/esm/inherits';
|
|
5
|
-
import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
6
|
-
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
7
|
-
import React, { Component } from 'react';
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import { Component } from 'react';
|
|
8
3
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
9
4
|
import { debounce } from '@elliemae/ds-utilities';
|
|
10
5
|
import { DSTextBox } from '@elliemae/ds-form';
|
|
11
6
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var isOpen = _ref.isOpen;
|
|
7
|
+
const blockName = 'shuttle-search-box';
|
|
8
|
+
const SearchBoxContainer = aggregatedClasses('div')(blockName, null, _ref => {
|
|
9
|
+
let {
|
|
10
|
+
isOpen
|
|
11
|
+
} = _ref;
|
|
18
12
|
return {
|
|
19
13
|
opened: isOpen
|
|
20
14
|
};
|
|
21
15
|
});
|
|
22
|
-
|
|
16
|
+
const filterList = debounce((term, onFilterCallback) => {
|
|
23
17
|
onFilterCallback(term);
|
|
24
18
|
}, 200);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _super = _createSuper(ShuttleSearchBox);
|
|
30
|
-
|
|
31
|
-
function ShuttleSearchBox(props) {
|
|
32
|
-
var _this;
|
|
33
|
-
|
|
34
|
-
_classCallCheck(this, ShuttleSearchBox);
|
|
35
|
-
|
|
36
|
-
_this = _super.call(this, props);
|
|
37
|
-
_this.state = {
|
|
19
|
+
class ShuttleSearchBox extends Component {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(props);
|
|
22
|
+
this.state = {
|
|
38
23
|
value: props.value,
|
|
39
24
|
prevProps: {}
|
|
40
25
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return _this;
|
|
26
|
+
this.handleChange = this.handleChange.bind(this);
|
|
27
|
+
this.handleKeyPress = this.handleKeyPress.bind(this);
|
|
44
28
|
}
|
|
45
29
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "handleKeyPress",
|
|
62
|
-
value: function handleKeyPress(e) {
|
|
63
|
-
var onFilter = this.props.onFilter;
|
|
64
|
-
if (e.keyCode === 13) onFilter(e.target.value);
|
|
65
|
-
}
|
|
66
|
-
}, {
|
|
67
|
-
key: "render",
|
|
68
|
-
value: function render() {
|
|
69
|
-
var value = this.state.value;
|
|
70
|
-
var _this$props2 = this.props,
|
|
71
|
-
isOpen = _this$props2.isOpen,
|
|
72
|
-
onClose = _this$props2.onClose,
|
|
73
|
-
placeholder = _this$props2.placeholder;
|
|
74
|
-
return /*#__PURE__*/React.createElement(SearchBoxContainer, {
|
|
75
|
-
classProps: {
|
|
76
|
-
isOpen: isOpen
|
|
30
|
+
static getDerivedStateFromProps(nextProps, _ref2) {
|
|
31
|
+
let {
|
|
32
|
+
prevProps
|
|
33
|
+
} = _ref2;
|
|
34
|
+
const {
|
|
35
|
+
value
|
|
36
|
+
} = nextProps;
|
|
37
|
+
|
|
38
|
+
if (value !== prevProps.value) {
|
|
39
|
+
return {
|
|
40
|
+
value,
|
|
41
|
+
prevProps: {
|
|
42
|
+
value
|
|
77
43
|
}
|
|
78
|
-
}
|
|
79
|
-
autoFocus: true,
|
|
80
|
-
clearable: true,
|
|
81
|
-
onChange: this.handleChange,
|
|
82
|
-
onClear: onClose,
|
|
83
|
-
onKeyDown: this.handleKeyPress,
|
|
84
|
-
placeholder: placeholder,
|
|
85
|
-
value: value
|
|
86
|
-
}));
|
|
44
|
+
};
|
|
87
45
|
}
|
|
88
|
-
}], [{
|
|
89
|
-
key: "getDerivedStateFromProps",
|
|
90
|
-
value: function getDerivedStateFromProps(nextProps, _ref2) {
|
|
91
|
-
var prevProps = _ref2.prevProps;
|
|
92
|
-
var value = nextProps.value;
|
|
93
46
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
value: value,
|
|
97
|
-
prevProps: {
|
|
98
|
-
value: value
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
102
49
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
50
|
+
handleChange(e) {
|
|
51
|
+
const {
|
|
52
|
+
onChange,
|
|
53
|
+
filterOnKeyStroke,
|
|
54
|
+
onFilter
|
|
55
|
+
} = this.props;
|
|
56
|
+
const {
|
|
57
|
+
value
|
|
58
|
+
} = e.target;
|
|
59
|
+
onChange(value);
|
|
60
|
+
if (filterOnKeyStroke) filterList(value, onFilter);
|
|
61
|
+
this.setState({
|
|
62
|
+
value
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
handleKeyPress(e) {
|
|
67
|
+
const {
|
|
68
|
+
onFilter
|
|
69
|
+
} = this.props;
|
|
70
|
+
if (e.keyCode === 13) onFilter(e.target.value);
|
|
71
|
+
}
|
|
106
72
|
|
|
107
|
-
|
|
108
|
-
|
|
73
|
+
render() {
|
|
74
|
+
const {
|
|
75
|
+
value
|
|
76
|
+
} = this.state;
|
|
77
|
+
const {
|
|
78
|
+
isOpen,
|
|
79
|
+
onClose,
|
|
80
|
+
placeholder
|
|
81
|
+
} = this.props;
|
|
82
|
+
return /*#__PURE__*/_jsx(SearchBoxContainer, {
|
|
83
|
+
classProps: {
|
|
84
|
+
isOpen
|
|
85
|
+
}
|
|
86
|
+
}, void 0, /*#__PURE__*/_jsx(DSTextBox, {
|
|
87
|
+
autoFocus: true,
|
|
88
|
+
clearable: true,
|
|
89
|
+
onChange: this.handleChange,
|
|
90
|
+
onClear: onClose,
|
|
91
|
+
onKeyDown: this.handleKeyPress,
|
|
92
|
+
placeholder: placeholder,
|
|
93
|
+
value: value
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
109
96
|
|
|
97
|
+
}
|
|
110
98
|
ShuttleSearchBox.defaultProps = {
|
|
111
99
|
filterOnKeyStroke: false,
|
|
112
|
-
onChange:
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
onFilter: function onFilter() {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
100
|
+
onChange: () => null,
|
|
101
|
+
onFilter: () => null
|
|
118
102
|
};
|
|
119
103
|
|
|
120
104
|
export { ShuttleSearchBox as default };
|
|
121
|
-
//# sourceMappingURL=ShuttleSearchBox.js.map
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
2
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
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';
|
|
11
|
+
import { useContext, useMemo, useCallback } from 'react';
|
|
6
12
|
import { Search, ArrowShortRight } from '@elliemae/ds-icons';
|
|
7
13
|
import DSButton from '@elliemae/ds-button';
|
|
8
14
|
import { runAll } from '@elliemae/ds-utilities';
|
|
@@ -17,113 +23,67 @@ import AnimationContext from '../AnimationState.js';
|
|
|
17
23
|
import SearchState from '../SearchState.js';
|
|
18
24
|
import VirtualizedSortableList from './VirtualizedSortableList.js';
|
|
19
25
|
import LoadingIndicator from './LoadingIndicator.js';
|
|
20
|
-
import '
|
|
21
|
-
import '@babel/runtime/helpers/esm/createClass';
|
|
22
|
-
import '@babel/runtime/helpers/esm/assertThisInitialized';
|
|
23
|
-
import '@babel/runtime/helpers/esm/inherits';
|
|
24
|
-
import '@babel/runtime/helpers/esm/possibleConstructorReturn';
|
|
25
|
-
import '@babel/runtime/helpers/esm/getPrototypeOf';
|
|
26
|
-
import '@elliemae/ds-classnames';
|
|
27
|
-
import '@elliemae/ds-form';
|
|
28
|
-
import '@elliemae/ds-indeterminate-progress-indicator';
|
|
29
|
-
import '@babel/runtime/helpers/esm/slicedToArray';
|
|
30
|
-
import './ShuttleListItem/ActionButtons.js';
|
|
31
|
-
import './ShuttleListItem/ShuttleListItem.js';
|
|
32
|
-
import 'react-spring/web.cjs';
|
|
33
|
-
import '@elliemae/ds-truncated-tooltip-text';
|
|
34
|
-
import 'react-sortable-hoc';
|
|
35
|
-
import './ShuttleBreadcrumb.js';
|
|
36
|
-
import '@elliemae/ds-breadcrumb';
|
|
37
|
-
import '../animation/animationConfig.js';
|
|
38
|
-
import './OverflowList.js';
|
|
39
|
-
import 'react-window';
|
|
40
|
-
import 'react-window-infinite-loader';
|
|
41
|
-
import 'react-virtualized-auto-sizer';
|
|
42
|
-
import './VirtualizedItem.js';
|
|
43
|
-
import 'treetabular';
|
|
44
|
-
import 'constate';
|
|
45
|
-
import '@elliemae/ds-circular-progress-indicator';
|
|
46
|
-
import 'styled-components';
|
|
26
|
+
import { jsx } from 'react/jsx-runtime';
|
|
47
27
|
|
|
48
|
-
|
|
28
|
+
const _excluded = ["item"];
|
|
29
|
+
|
|
30
|
+
var _Search, _LoadingList, _ArrowShortRight, _ShuttleInfiniteScrol;
|
|
49
31
|
|
|
50
32
|
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; }
|
|
51
33
|
|
|
52
34
|
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; }
|
|
53
35
|
|
|
54
|
-
|
|
36
|
+
const noop = () => {};
|
|
55
37
|
|
|
56
38
|
function ShuttleSource(_ref) {
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
hasNextPage = _ref$hasNextPage === void 0 ? false : _ref$hasNextPage;
|
|
102
|
-
|
|
103
|
-
var _useContext = useContext(AnimationContext.Context),
|
|
104
|
-
_useContext$state = _useContext.state,
|
|
105
|
-
_useContext$state$isM = _useContext$state.isMovingBack,
|
|
106
|
-
isMovingBack = _useContext$state$isM === void 0 ? false : _useContext$state$isM,
|
|
107
|
-
isMoving = _useContext$state.isMoving;
|
|
108
|
-
|
|
109
|
-
var _useContext2 = useContext(SearchState.Context),
|
|
110
|
-
_useContext2$state = _useContext2.state,
|
|
111
|
-
searching = _useContext2$state.searching,
|
|
112
|
-
searchTerm = _useContext2$state.searchTerm,
|
|
113
|
-
setSearchTerm = _useContext2.setSearchTerm,
|
|
114
|
-
resetSearch = _useContext2.reset,
|
|
115
|
-
toggleSearchBox = _useContext2.toggleSearchBox;
|
|
116
|
-
|
|
117
|
-
var hashedCheckedItems = useMemo(function () {
|
|
118
|
-
return checkedItems.reduce(function (result, item) {
|
|
119
|
-
return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, item, true));
|
|
120
|
-
}, {});
|
|
121
|
-
}, [checkedItems]);
|
|
122
|
-
var handleCloseSearch = useCallback(function () {
|
|
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;
|
|
64
|
+
const {
|
|
65
|
+
state: {
|
|
66
|
+
isMovingBack = false,
|
|
67
|
+
isMoving
|
|
68
|
+
}
|
|
69
|
+
} = useContext(AnimationContext.Context);
|
|
70
|
+
const {
|
|
71
|
+
state: {
|
|
72
|
+
searching,
|
|
73
|
+
searchTerm
|
|
74
|
+
},
|
|
75
|
+
setSearchTerm,
|
|
76
|
+
reset: resetSearch,
|
|
77
|
+
toggleSearchBox
|
|
78
|
+
} = useContext(SearchState.Context);
|
|
79
|
+
const hashedCheckedItems = useMemo(() => checkedItems.reduce((result, item) => _objectSpread(_objectSpread({}, result), {}, {
|
|
80
|
+
[item]: true
|
|
81
|
+
}), {}), [checkedItems]);
|
|
82
|
+
const handleCloseSearch = useCallback(() => {
|
|
123
83
|
setSearchTerm('');
|
|
124
84
|
runAll(resetSearch, onSearchClose)();
|
|
125
85
|
}, [searching]);
|
|
126
|
-
|
|
86
|
+
const handleToggleSearch = useCallback(() => {
|
|
127
87
|
toggleSearchBox(!searching);
|
|
128
88
|
|
|
129
89
|
if (searching) {
|
|
@@ -132,64 +92,62 @@ function ShuttleSource(_ref) {
|
|
|
132
92
|
onSearchOpen();
|
|
133
93
|
}
|
|
134
94
|
}, [searching]);
|
|
135
|
-
|
|
136
|
-
return sourceSortable ? VirtualizedSortableList : VirtualizedList;
|
|
137
|
-
}, [sourceSortable]);
|
|
95
|
+
const ComponentList = useMemo(() => sourceSortable ? VirtualizedSortableList : VirtualizedList, [sourceSortable]);
|
|
138
96
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
97
|
+
const handleSortEnd = _ref2 => {
|
|
98
|
+
let {
|
|
99
|
+
oldIndex,
|
|
100
|
+
newIndex
|
|
101
|
+
} = _ref2;
|
|
142
102
|
onSortEnd({
|
|
143
103
|
sourceItem: items[oldIndex],
|
|
144
104
|
targetItem: items[newIndex]
|
|
145
105
|
});
|
|
146
106
|
};
|
|
147
107
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return /*#__PURE__*/
|
|
108
|
+
const isEmpty = !items.length;
|
|
109
|
+
const hasContent = !loading && !isEmpty;
|
|
110
|
+
const contentIsEmpty = !loading && isEmpty;
|
|
111
|
+
return /*#__PURE__*/_jsx(ShuttleWrapper, {}, void 0, /*#__PURE__*/_jsx(ShuttleHeader, {}, void 0, /*#__PURE__*/_jsx(ShuttleHeaderBreadcrumb, {
|
|
152
112
|
hierarchy: hierarchy,
|
|
153
113
|
onNavigateTo: onNavigateTo
|
|
154
|
-
}), /*#__PURE__*/
|
|
114
|
+
}), /*#__PURE__*/_jsx(ShuttleHeaderSearchToggle, {
|
|
155
115
|
buttonType: "text",
|
|
156
|
-
icon: /*#__PURE__*/
|
|
116
|
+
icon: _Search || (_Search = /*#__PURE__*/_jsx(Search, {})),
|
|
157
117
|
onClick: handleToggleSearch,
|
|
158
118
|
containerProps: {
|
|
159
119
|
'data-testid': 'shuttle-header-search-toggle'
|
|
160
120
|
}
|
|
161
|
-
})), /*#__PURE__*/
|
|
121
|
+
})), /*#__PURE__*/_jsx(ShuttleList, {
|
|
162
122
|
classProps: {
|
|
163
123
|
showPulse: isMovingBack
|
|
164
124
|
},
|
|
165
125
|
style: {
|
|
166
126
|
pointerEvents: isMoving ? 'none' : null
|
|
167
127
|
}
|
|
168
|
-
}, /*#__PURE__*/
|
|
169
|
-
key: searching,
|
|
128
|
+
}, void 0, /*#__PURE__*/_jsx(ShuttleSearchBox, {
|
|
170
129
|
isOpen: searching,
|
|
171
|
-
onClose: runAll(
|
|
172
|
-
return toggleSearchBox(false);
|
|
173
|
-
}, handleCloseSearch),
|
|
130
|
+
onClose: runAll(() => toggleSearchBox(false), handleCloseSearch),
|
|
174
131
|
onFilter: runAll(setSearchTerm, onSearch),
|
|
175
132
|
placeholder: searchPlaceholder,
|
|
176
133
|
value: searchTerm
|
|
177
|
-
}), hasContent ? /*#__PURE__*/
|
|
134
|
+
}, searching), hasContent ? /*#__PURE__*/_jsx(Overflow, {
|
|
178
135
|
activeHierarchy: getActiveIdFromHierarchy(hierarchy).id,
|
|
179
136
|
classProps: {
|
|
180
|
-
searching
|
|
137
|
+
searching,
|
|
181
138
|
empty: isEmpty
|
|
182
139
|
}
|
|
183
|
-
}, /*#__PURE__*/
|
|
184
|
-
key: searchTerm,
|
|
140
|
+
}, void 0, /*#__PURE__*/_jsx(ComponentList, {
|
|
185
141
|
helperClass: "drag-helper",
|
|
186
|
-
itemRenderer:
|
|
187
|
-
|
|
142
|
+
itemRenderer: _ref3 => {
|
|
143
|
+
let {
|
|
144
|
+
item
|
|
145
|
+
} = _ref3,
|
|
188
146
|
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
189
147
|
|
|
190
|
-
return /*#__PURE__*/
|
|
148
|
+
return /*#__PURE__*/jsx(ShuttleSourceListItem, _objectSpread(_objectSpread(_objectSpread({
|
|
191
149
|
"data-testid": "source-list-item"
|
|
192
|
-
}, rest, composeSourceItemProps(item, rest), {
|
|
150
|
+
}, rest), composeSourceItemProps(item, rest)), {}, {
|
|
193
151
|
isChecked: !!hashedCheckedItems[item.id],
|
|
194
152
|
item: item,
|
|
195
153
|
onItemCheck: onCheckItem,
|
|
@@ -202,46 +160,20 @@ function ShuttleSource(_ref) {
|
|
|
202
160
|
onSortEnd: handleSortEnd,
|
|
203
161
|
getMoreItems: onGetMoreItems,
|
|
204
162
|
hasNextPage: hasNextPage
|
|
205
|
-
})) : null, contentIsEmpty ? /*#__PURE__*/
|
|
163
|
+
}, searchTerm)) : null, contentIsEmpty ? /*#__PURE__*/_jsx(LoadingList, {
|
|
206
164
|
"data-testid": "shuttle__loading-list"
|
|
207
|
-
}, /*#__PURE__*/
|
|
165
|
+
}, void 0, /*#__PURE__*/_jsx(EmptyMessage, {}, void 0, emptyMessage)) : null, loading ? _LoadingList || (_LoadingList = /*#__PURE__*/_jsx(LoadingList, {
|
|
208
166
|
"data-testid": "shuttle__loading-list"
|
|
209
|
-
}, /*#__PURE__*/
|
|
167
|
+
}, void 0, /*#__PURE__*/_jsx(LoadingIndicator, {}))) : null, /*#__PURE__*/_jsx(ShuttleListPanel, {
|
|
210
168
|
onClick: onMoveCheckedItems,
|
|
211
169
|
open: checkedItems.length > 1
|
|
212
|
-
}, /*#__PURE__*/
|
|
170
|
+
}, void 0, _ArrowShortRight || (_ArrowShortRight = /*#__PURE__*/_jsx(ArrowShortRight, {}))), moreItemsLoading ? _ShuttleInfiniteScrol || (_ShuttleInfiniteScrol = /*#__PURE__*/_jsx(ShuttleInfiniteScrollIndicator, {
|
|
213
171
|
isOpen: true
|
|
214
|
-
}) : null), /*#__PURE__*/
|
|
172
|
+
})) : null), /*#__PURE__*/_jsx(ShuttleFooter, {}, void 0, /*#__PURE__*/_jsx(ShuttleFooterActions, {}, void 0, !!checkedItems.length && /*#__PURE__*/_jsx(DSButton, {
|
|
215
173
|
buttonType: "link",
|
|
216
174
|
labelText: sourceClearItemsText,
|
|
217
175
|
onClick: onClearCheckedItems
|
|
218
|
-
})), /*#__PURE__*/
|
|
176
|
+
})), /*#__PURE__*/_jsx(ShuttleFooterCounter, {}, void 0, renderSourceCounter(checkedItems.length))));
|
|
219
177
|
}
|
|
220
178
|
|
|
221
|
-
ShuttleSource.propTypes = {
|
|
222
|
-
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
223
|
-
checkedItems: PropTypes.arrayOf(PropTypes.shape({})),
|
|
224
|
-
hierarchy: PropTypes.arrayOf(PropTypes.shape({})),
|
|
225
|
-
onMoveItem: PropTypes.func,
|
|
226
|
-
onCheckItem: PropTypes.func,
|
|
227
|
-
onMoveCheckedItems: PropTypes.func,
|
|
228
|
-
onNavigateTo: PropTypes.func,
|
|
229
|
-
onClearCheckedItems: PropTypes.func,
|
|
230
|
-
emptyMessage: PropTypes.string,
|
|
231
|
-
composeSourceItemProps: PropTypes.func,
|
|
232
|
-
loading: PropTypes.bool,
|
|
233
|
-
onSearch: PropTypes.func,
|
|
234
|
-
onSearchClose: PropTypes.func,
|
|
235
|
-
onSearchOpen: PropTypes.func,
|
|
236
|
-
sourceSortable: PropTypes.bool,
|
|
237
|
-
onSortEnd: PropTypes.func,
|
|
238
|
-
sourceClearItemsText: PropTypes.string,
|
|
239
|
-
searchPlaceholder: PropTypes.string,
|
|
240
|
-
renderSourceCounter: PropTypes.func,
|
|
241
|
-
onGetMoreItems: PropTypes.func,
|
|
242
|
-
moreItemsLoading: PropTypes.bool,
|
|
243
|
-
hasNextPage: PropTypes.bool
|
|
244
|
-
};
|
|
245
|
-
|
|
246
179
|
export { ShuttleSource as default };
|
|
247
|
-
//# sourceMappingURL=ShuttleSource.js.map
|