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