@elliemae/ds-shuttle 3.5.0-rc.9 → 3.5.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSShuttle.js +43 -41
- package/dist/cjs/DSShuttle.js.map +2 -2
- package/dist/cjs/ShuttleImpl.js +3 -2
- package/dist/cjs/ShuttleImpl.js.map +2 -2
- package/dist/cjs/ShuttleRenderer.js +71 -66
- package/dist/cjs/ShuttleRenderer.js.map +2 -2
- package/dist/cjs/components/LoadingIndicator.js +8 -7
- package/dist/cjs/components/LoadingIndicator.js.map +2 -2
- package/dist/cjs/components/OverflowList.js +6 -5
- package/dist/cjs/components/OverflowList.js.map +2 -2
- package/dist/cjs/components/ShuttleBreadcrumb.js +13 -12
- package/dist/cjs/components/ShuttleBreadcrumb.js.map +2 -2
- package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js +8 -7
- package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ActionButtons.js +7 -7
- package/dist/cjs/components/ShuttleListItem/ActionButtons.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js +29 -15
- package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +7 -8
- package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +7 -8
- package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +2 -2
- package/dist/cjs/components/ShuttleListPanel.js +10 -9
- package/dist/cjs/components/ShuttleListPanel.js.map +2 -2
- package/dist/cjs/components/ShuttleSearchBox.js +14 -12
- package/dist/cjs/components/ShuttleSearchBox.js.map +2 -2
- package/dist/cjs/components/ShuttleSource.js +90 -57
- package/dist/cjs/components/ShuttleSource.js.map +2 -2
- package/dist/cjs/components/ShuttleTarget.js +56 -32
- package/dist/cjs/components/ShuttleTarget.js.map +2 -2
- package/dist/cjs/components/VirtualizedList.js +24 -19
- package/dist/cjs/components/VirtualizedList.js.map +2 -2
- package/dist/cjs/components/VirtualizedSortableList.js +5 -4
- package/dist/cjs/components/VirtualizedSortableList.js.map +2 -2
- package/dist/cjs/withProviders.js +10 -4
- package/dist/cjs/withProviders.js.map +2 -2
- package/dist/esm/DSShuttle.js +43 -41
- package/dist/esm/DSShuttle.js.map +2 -2
- package/dist/esm/ShuttleImpl.js +3 -2
- package/dist/esm/ShuttleImpl.js.map +2 -2
- package/dist/esm/ShuttleRenderer.js +71 -66
- package/dist/esm/ShuttleRenderer.js.map +2 -2
- package/dist/esm/components/LoadingIndicator.js +8 -7
- package/dist/esm/components/LoadingIndicator.js.map +2 -2
- package/dist/esm/components/OverflowList.js +6 -5
- package/dist/esm/components/OverflowList.js.map +2 -2
- package/dist/esm/components/ShuttleBreadcrumb.js +13 -12
- package/dist/esm/components/ShuttleBreadcrumb.js.map +2 -2
- package/dist/esm/components/ShuttleInfiniteScrollIndicator.js +8 -7
- package/dist/esm/components/ShuttleInfiniteScrollIndicator.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ActionButtons.js +7 -7
- package/dist/esm/components/ShuttleListItem/ActionButtons.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ShuttleListItem.js +29 -15
- package/dist/esm/components/ShuttleListItem/ShuttleListItem.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js +7 -8
- package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js +7 -8
- package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +2 -2
- package/dist/esm/components/ShuttleListPanel.js +10 -9
- package/dist/esm/components/ShuttleListPanel.js.map +2 -2
- package/dist/esm/components/ShuttleSearchBox.js +14 -12
- package/dist/esm/components/ShuttleSearchBox.js.map +2 -2
- package/dist/esm/components/ShuttleSource.js +90 -57
- package/dist/esm/components/ShuttleSource.js.map +2 -2
- package/dist/esm/components/ShuttleTarget.js +56 -32
- package/dist/esm/components/ShuttleTarget.js.map +2 -2
- package/dist/esm/components/VirtualizedList.js +24 -19
- package/dist/esm/components/VirtualizedList.js.map +2 -2
- package/dist/esm/components/VirtualizedSortableList.js +5 -4
- package/dist/esm/components/VirtualizedSortableList.js.map +2 -2
- package/dist/esm/withProviders.js +10 -4
- package/dist/esm/withProviders.js.map +2 -2
- package/package.json +11 -11
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleListPanel.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\nimport { ShuttleListPanel as Wrapper } from '../classedComponents';\n\nfunction ShuttleListPanel({ onClick = () => null, open = false, children }) {\n return (\n <Wrapper classProps={{ open }}>\n <DSButton buttonType=\"text\" icon={children} onClick={onClick} data-testid=\"list-panel-btn\" />\n </Wrapper>\n );\n}\n\nexport { ShuttleListPanel };\nexport default ShuttleListPanel;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,eAAe;AAE5C,SAAS,iBAAiB,EAAE,UAAU,MAAM,MAAM,OAAO,OAAO,SAAS,GAAG;AAC1E,SACE,oBAAC;AAAA,IAAQ,YAAY,EAAE,KAAK;AAAA,IAC1B,8BAAC;AAAA,MAAS,YAAW;AAAA,MAAO,MAAM;AAAA,MAAU;AAAA,MAAkB,eAAY;AAAA,KAAiB;AAAA,GAC7F;AAEJ;AAGA,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Component } from "react";
|
|
3
4
|
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
5
|
import { debounce } from "@elliemae/ds-utilities";
|
|
5
6
|
import { DSTextBox } from "@elliemae/ds-form";
|
|
@@ -44,17 +45,18 @@ class ShuttleSearchBox extends Component {
|
|
|
44
45
|
render() {
|
|
45
46
|
const { value } = this.state;
|
|
46
47
|
const { isOpen, onClose, placeholder } = this.props;
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
-
classProps: { isOpen }
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
return /* @__PURE__ */ jsx(SearchBoxContainer, {
|
|
49
|
+
classProps: { isOpen },
|
|
50
|
+
children: /* @__PURE__ */ jsx(DSTextBox, {
|
|
51
|
+
autoFocus: true,
|
|
52
|
+
clearable: true,
|
|
53
|
+
onChange: this.handleChange,
|
|
54
|
+
onClear: onClose,
|
|
55
|
+
onKeyDown: this.handleKeyPress,
|
|
56
|
+
placeholder,
|
|
57
|
+
value
|
|
58
|
+
})
|
|
59
|
+
});
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
ShuttleSearchBox.defaultProps = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleSearchBox.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-unused-state */\nimport React, { Component } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { debounce } from '@elliemae/ds-utilities';\nimport { DSTextBox } from '@elliemae/ds-form';\n\nconst blockName = 'shuttle-search-box';\n\nconst SearchBoxContainer = aggregatedClasses('div')(blockName, null, ({ isOpen }) => ({ opened: isOpen }));\n\nconst filterList = debounce((term, onFilterCallback) => {\n onFilterCallback(term);\n}, 200);\n\nclass ShuttleSearchBox extends Component {\n static defaultProps = {\n filterOnKeyStroke: false,\n onChange: () => null,\n onFilter: () => null,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n value: props.value,\n prevProps: {},\n };\n this.handleKeyPress = this.handleKeyPress.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n\n static getDerivedStateFromProps(nextProps, { prevProps }) {\n const { value } = nextProps;\n if (value !== prevProps.value) {\n return {\n value,\n prevProps: { value },\n };\n }\n return null;\n }\n\n handleChange(e) {\n const { onChange, filterOnKeyStroke, onFilter } = this.props;\n const { value } = e.target;\n onChange(value);\n if (filterOnKeyStroke) filterList(value, onFilter);\n this.setState({ value });\n }\n\n handleKeyPress(e) {\n const { onFilter } = this.props;\n if (e.keyCode === 13) onFilter(e.target.value);\n }\n\n render() {\n const { value } = this.state;\n const { isOpen, onClose, placeholder } = this.props;\n return (\n <SearchBoxContainer classProps={{ isOpen }}>\n <DSTextBox\n autoFocus\n clearable\n onChange={this.handleChange}\n onClear={onClose}\n onKeyDown={this.handleKeyPress}\n placeholder={placeholder}\n value={value}\n />\n </SearchBoxContainer>\n );\n }\n}\n\nexport { ShuttleSearchBox };\nexport default ShuttleSearchBox;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,iBAAiB;AACjC,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAE1B,MAAM,YAAY;AAElB,MAAM,qBAAqB,kBAAkB,KAAK,EAAE,WAAW,MAAM,CAAC,EAAE,OAAO,OAAO,EAAE,QAAQ,OAAO,EAAE;AAEzG,MAAM,aAAa,SAAS,CAAC,MAAM,qBAAqB;AACtD,mBAAiB,IAAI;AACvB,GA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F,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useContext, useMemo } from "react";
|
|
3
4
|
import PropTypes from "prop-types";
|
|
4
5
|
import { ArrowShortRight, Search } from "@elliemae/ds-icons";
|
|
5
6
|
import { DSButton } from "@elliemae/ds-button";
|
|
@@ -89,62 +90,94 @@ function ShuttleSource({
|
|
|
89
90
|
const isEmpty = !items.length;
|
|
90
91
|
const hasContent = !loading && !isEmpty;
|
|
91
92
|
const contentIsEmpty = !loading && isEmpty;
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
93
|
+
return /* @__PURE__ */ jsxs(ShuttleWrapper, {
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsxs(ShuttleHeader, {
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(ShuttleHeaderBreadcrumb, {
|
|
98
|
+
hierarchy,
|
|
99
|
+
onNavigateTo
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ jsx(ShuttleHeaderSearchToggle, {
|
|
102
|
+
buttonType: "text",
|
|
103
|
+
icon: /* @__PURE__ */ jsx(Search, {}),
|
|
104
|
+
onClick: handleToggleSearch,
|
|
105
|
+
containerProps: { "data-testid": "shuttle-header-search-toggle" }
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsxs(ShuttleList, {
|
|
110
|
+
classProps: { showPulse: isMovingBack },
|
|
111
|
+
style: { pointerEvents: isMoving ? "none" : null },
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(ShuttleSearchBox, {
|
|
114
|
+
isOpen: searching,
|
|
115
|
+
onClose: runAll(() => toggleSearchBox(false), handleCloseSearch),
|
|
116
|
+
onFilter: runAll(setSearchTerm, onSearch),
|
|
117
|
+
placeholder: searchPlaceholder,
|
|
118
|
+
value: searchTerm
|
|
119
|
+
}, searching),
|
|
120
|
+
hasContent ? /* @__PURE__ */ jsx(Overflow, {
|
|
121
|
+
activeHierarchy: getActiveIdFromHierarchy(hierarchy).id,
|
|
122
|
+
classProps: {
|
|
123
|
+
searching,
|
|
124
|
+
empty: isEmpty
|
|
125
|
+
},
|
|
126
|
+
children: /* @__PURE__ */ jsx(ComponentList, {
|
|
127
|
+
helperClass: "drag-helper",
|
|
128
|
+
itemRenderer: ({ item, ...rest }) => /* @__PURE__ */ jsx(ShuttleSourceListItem, {
|
|
129
|
+
"data-testid": "source-list-item",
|
|
130
|
+
...rest,
|
|
131
|
+
...composeSourceItemProps(item, rest),
|
|
132
|
+
isChecked: !!hashedCheckedItems[item.id],
|
|
133
|
+
item,
|
|
134
|
+
onItemCheck: onCheckItem,
|
|
135
|
+
onMoveToTarget: onMoveItem,
|
|
136
|
+
onNavigateOnSourceTo: onNavigateTo,
|
|
137
|
+
showSortHandler: sourceSortable
|
|
138
|
+
}),
|
|
139
|
+
items,
|
|
140
|
+
onSortEnd: handleSortEnd,
|
|
141
|
+
getMoreItems: onGetMoreItems,
|
|
142
|
+
hasNextPage
|
|
143
|
+
}, searchTerm)
|
|
144
|
+
}) : null,
|
|
145
|
+
contentIsEmpty ? /* @__PURE__ */ jsx(LoadingList, {
|
|
146
|
+
"data-testid": "shuttle__loading-list",
|
|
147
|
+
children: /* @__PURE__ */ jsx(EmptyMessage, {
|
|
148
|
+
children: emptyMessage
|
|
149
|
+
})
|
|
150
|
+
}) : null,
|
|
151
|
+
loading ? /* @__PURE__ */ jsx(LoadingList, {
|
|
152
|
+
"data-testid": "shuttle__loading-list",
|
|
153
|
+
children: /* @__PURE__ */ jsx(LoadingIndicator, {})
|
|
154
|
+
}) : null,
|
|
155
|
+
/* @__PURE__ */ jsx(ShuttleListPanel, {
|
|
156
|
+
onClick: onMoveCheckedItems,
|
|
157
|
+
open: checkedItems.length > 1,
|
|
158
|
+
children: /* @__PURE__ */ jsx(ArrowShortRight, {})
|
|
159
|
+
}),
|
|
160
|
+
moreItemsLoading ? /* @__PURE__ */ jsx(ShuttleInfiniteScrollIndicator, {
|
|
161
|
+
isOpen: true
|
|
162
|
+
}) : null
|
|
163
|
+
]
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsxs(ShuttleFooter, {
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx(ShuttleFooterActions, {
|
|
168
|
+
children: !!checkedItems.length && /* @__PURE__ */ jsx(DSButton, {
|
|
169
|
+
buttonType: "link",
|
|
170
|
+
labelText: sourceClearItemsText,
|
|
171
|
+
onClick: onClearCheckedItems
|
|
172
|
+
})
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx(ShuttleFooterCounter, {
|
|
175
|
+
children: renderSourceCounter(checkedItems.length)
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
148
181
|
}
|
|
149
182
|
ShuttleSource.propTypes = {
|
|
150
183
|
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleSource.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable no-shadow */\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { ArrowShortRight, Search } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { runAll } from '@elliemae/ds-utilities';\nimport { ShuttleSearchBox } from './ShuttleSearchBox';\nimport { ShuttleInfiniteScrollIndicator } from './ShuttleInfiniteScrollIndicator';\nimport { ShuttleSourceListItem } from './ShuttleListItem/ShuttleSourceListItem';\nimport {\n ShuttleFooterCounter,\n Overflow,\n ShuttleFooter,\n ShuttleHeader,\n ShuttleHeaderBreadcrumb,\n ShuttleHeaderSearchToggle,\n ShuttleList,\n ShuttleWrapper,\n ShuttleFooterActions,\n EmptyMessage,\n LoadingList,\n} from '../classedComponents';\nimport { ShuttleListPanel } from './ShuttleListPanel';\nimport { VirtualizedList } from './VirtualizedList';\nimport { getActiveIdFromHierarchy } from '../helper';\nimport { AnimationState } from '../AnimationState';\nimport { SearchState } from '../SearchState';\nimport { VirtualizedSortableList } from './VirtualizedSortableList';\nimport { LoadingIndicator } from './LoadingIndicator';\n\nconst noop = () => {};\n\nfunction ShuttleSource({\n items = [],\n checkedItems = [], // build Map() and memoize it for better performance\n hierarchy = [],\n onMoveItem = noop,\n onCheckItem = noop,\n onMoveCheckedItems = noop,\n onNavigateTo = noop,\n onClearCheckedItems = noop,\n emptyMessage = 'No items found',\n composeSourceItemProps = noop,\n loading = false,\n onSearch = noop,\n onSearchClose = noop,\n onSearchOpen = noop,\n sourceSortable = false,\n onSortEnd = noop,\n sourceClearItemsText = 'CLEAR ALL',\n searchPlaceholder,\n renderSourceCounter = (amount) => `${amount} items`,\n onGetMoreItems = () => {},\n moreItemsLoading = false,\n hasNextPage = false,\n}) {\n const {\n state: { isMovingBack = false, isMoving },\n } = useContext(AnimationState.Context);\n const {\n state: { searching, searchTerm },\n setSearchTerm,\n reset: resetSearch,\n toggleSearchBox,\n } = useContext(SearchState.Context);\n\n const hashedCheckedItems = useMemo(\n () => checkedItems.reduce((result, item) => ({ ...result, [item]: true }), {}),\n [checkedItems],\n );\n\n const handleCloseSearch = useCallback(() => {\n setSearchTerm('');\n runAll(resetSearch, onSearchClose)();\n }, [searching]);\n\n const handleToggleSearch = useCallback(() => {\n toggleSearchBox(!searching);\n if (searching) {\n handleCloseSearch();\n } else {\n onSearchOpen();\n }\n }, [searching]);\n\n const ComponentList = useMemo(() => (sourceSortable ? VirtualizedSortableList : VirtualizedList), [sourceSortable]);\n\n const handleSortEnd = ({ oldIndex, newIndex }) => {\n onSortEnd({\n sourceItem: items[oldIndex],\n targetItem: items[newIndex],\n });\n };\n\n const isEmpty = !items.length;\n const hasContent = !loading && !isEmpty;\n const contentIsEmpty = !loading && isEmpty;\n\n return (\n <ShuttleWrapper>\n <ShuttleHeader>\n <ShuttleHeaderBreadcrumb hierarchy={hierarchy} onNavigateTo={onNavigateTo} />\n <ShuttleHeaderSearchToggle\n buttonType=\"text\"\n icon={<Search />}\n onClick={handleToggleSearch}\n containerProps={{ 'data-testid': 'shuttle-header-search-toggle' }}\n />\n </ShuttleHeader>\n <ShuttleList classProps={{ showPulse: isMovingBack }} style={{ pointerEvents: isMoving ? 'none' : null }}>\n <ShuttleSearchBox\n key={searching}\n isOpen={searching}\n onClose={runAll(() => toggleSearchBox(false), handleCloseSearch)}\n onFilter={runAll(setSearchTerm, onSearch)}\n placeholder={searchPlaceholder}\n value={searchTerm}\n />\n {hasContent ? (\n <Overflow\n activeHierarchy={getActiveIdFromHierarchy(hierarchy).id}\n classProps={{\n searching,\n empty: isEmpty,\n }}\n >\n <ComponentList\n key={searchTerm}\n helperClass=\"drag-helper\"\n itemRenderer={({ item, ...rest }) => (\n <ShuttleSourceListItem\n data-testid=\"source-list-item\"\n {...rest}\n {...composeSourceItemProps(item, rest)}\n isChecked={!!hashedCheckedItems[item.id]}\n item={item}\n onItemCheck={onCheckItem}\n onMoveToTarget={onMoveItem}\n onNavigateOnSourceTo={onNavigateTo}\n showSortHandler={sourceSortable}\n />\n )}\n items={items}\n onSortEnd={handleSortEnd}\n getMoreItems={onGetMoreItems}\n hasNextPage={hasNextPage}\n />\n </Overflow>\n ) : null}\n {contentIsEmpty ? (\n <LoadingList data-testid=\"shuttle__loading-list\">\n <EmptyMessage>{emptyMessage}</EmptyMessage>\n </LoadingList>\n ) : null}\n {loading ? (\n <LoadingList data-testid=\"shuttle__loading-list\">\n <LoadingIndicator />\n </LoadingList>\n ) : null}\n <ShuttleListPanel onClick={onMoveCheckedItems} open={checkedItems.length > 1}>\n <ArrowShortRight />\n </ShuttleListPanel>\n {moreItemsLoading ? <ShuttleInfiniteScrollIndicator isOpen /> : null}\n </ShuttleList>\n <ShuttleFooter>\n <ShuttleFooterActions>\n {!!checkedItems.length && (\n <DSButton buttonType=\"link\" labelText={sourceClearItemsText} onClick={onClearCheckedItems} />\n )}\n </ShuttleFooterActions>\n <ShuttleFooterCounter>{renderSourceCounter(checkedItems.length)}</ShuttleFooterCounter>\n </ShuttleFooter>\n </ShuttleWrapper>\n );\n}\n\nShuttleSource.propTypes = {\n items: PropTypes.arrayOf(PropTypes.shape({})),\n checkedItems: PropTypes.arrayOf(PropTypes.shape({})),\n hierarchy: PropTypes.arrayOf(PropTypes.shape({})),\n onMoveItem: PropTypes.func,\n onCheckItem: PropTypes.func,\n onMoveCheckedItems: PropTypes.func,\n onNavigateTo: PropTypes.func,\n onClearCheckedItems: PropTypes.func,\n emptyMessage: PropTypes.string,\n composeSourceItemProps: PropTypes.func,\n loading: PropTypes.bool,\n onSearch: PropTypes.func,\n onSearchClose: PropTypes.func,\n onSearchOpen: PropTypes.func,\n sourceSortable: PropTypes.bool,\n onSortEnd: PropTypes.func,\n sourceClearItemsText: PropTypes.string,\n searchPlaceholder: PropTypes.string,\n renderSourceCounter: PropTypes.func,\n onGetMoreItems: PropTypes.func,\n moreItemsLoading: PropTypes.bool,\n hasNextPage: PropTypes.bool,\n};\n\nexport { ShuttleSource };\nexport default ShuttleSource;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAgB,aAAa,YAAY,eAAe;AACxD,OAAO,eAAe;AACtB,SAAS,iBAAiB,cAAc;AACxC,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,SAAS,sCAAsC;AAC/C,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAEjC,MAAM,OAAO,MAAM;AAAC;AAEpB,SAAS,cAAc;AAAA,EACrB,QAAQ,CAAC;AAAA,EACT,eAAe,CAAC;AAAA,EAChB,YAAY,CAAC;AAAA,EACb,aAAa;AAAA,EACb,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,yBAAyB;AAAA,EACzB,UAAU;AAAA,EACV,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,YA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|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useContext } from "react";
|
|
3
4
|
import { DSButton } from "@elliemae/ds-button";
|
|
4
5
|
import {
|
|
5
6
|
EmptyMessage,
|
|
@@ -39,7 +40,9 @@ function ShuttleTarget({
|
|
|
39
40
|
state: { isMoving = false }
|
|
40
41
|
} = useContext(AnimationState.Context);
|
|
41
42
|
const isEmpty = !items.length;
|
|
42
|
-
const emptyContent = loading ? /* @__PURE__ */
|
|
43
|
+
const emptyContent = loading ? /* @__PURE__ */ jsx(LoadingIndicator, {}) : /* @__PURE__ */ jsx(EmptyMessage, {
|
|
44
|
+
children: emptyMessage
|
|
45
|
+
});
|
|
43
46
|
const ComponentList = targetSortable ? VirtualizedSortableList : VirtualizedList;
|
|
44
47
|
const handleSortEnd = ({ oldIndex, newIndex }) => {
|
|
45
48
|
onSortEnd({
|
|
@@ -47,36 +50,57 @@ function ShuttleTarget({
|
|
|
47
50
|
targetItem: items[newIndex]
|
|
48
51
|
});
|
|
49
52
|
};
|
|
50
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
53
|
+
return /* @__PURE__ */ jsxs(ShuttleWrapper, {
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx(ShuttleHeader, {
|
|
56
|
+
children: /* @__PURE__ */ jsx(ShuttleHeaderBreadcrumb, {
|
|
57
|
+
hierarchy,
|
|
58
|
+
onNavigateTo
|
|
59
|
+
})
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ jsx(ShuttleList, {
|
|
62
|
+
classProps: { showPulse: isMoving },
|
|
63
|
+
children: !loading && !isEmpty ? /* @__PURE__ */ jsx(Overflow, {
|
|
64
|
+
activeHierarchy: getActiveIdFromHierarchy(hierarchy).id,
|
|
65
|
+
classProps: {
|
|
66
|
+
empty: !items.length
|
|
67
|
+
},
|
|
68
|
+
children: /* @__PURE__ */ jsx(ComponentList, {
|
|
69
|
+
itemRenderer: ({ item, ...rest }) => /* @__PURE__ */ jsx(ShuttleTargetListItem, {
|
|
70
|
+
"data-testid": "target-list-item",
|
|
71
|
+
...rest,
|
|
72
|
+
...composeTargetItemProps(item, rest),
|
|
73
|
+
isRoot: !getActiveIdFromHierarchy(hierarchy).id,
|
|
74
|
+
item,
|
|
75
|
+
onMoveToSource: onMoveItem,
|
|
76
|
+
onNavigateOnTargetTo: onNavigateTo,
|
|
77
|
+
showSortHandler: targetSortable
|
|
78
|
+
}),
|
|
79
|
+
items,
|
|
80
|
+
onSortEnd: handleSortEnd,
|
|
81
|
+
target: true
|
|
82
|
+
})
|
|
83
|
+
}) : /* @__PURE__ */ jsx(LoadingList, {
|
|
84
|
+
children: emptyContent
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ jsxs(ShuttleFooter, {
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsx(ShuttleFooterActions, {
|
|
90
|
+
children: !!items.length && /* @__PURE__ */ jsx(DSButton, {
|
|
91
|
+
containerProps: { "data-testid": "shuttle-clear-all-target" },
|
|
92
|
+
buttonType: "link",
|
|
93
|
+
labelText: targetClearItemsText,
|
|
94
|
+
onClick: onClearMovedItems
|
|
95
|
+
})
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ jsx(ShuttleFooterCounter, {
|
|
98
|
+
children: renderTargetCounter(items.length)
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
80
104
|
}
|
|
81
105
|
var ShuttleTarget_default = ShuttleTarget;
|
|
82
106
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleTarget.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { DSButton } from '@elliemae/ds-button';\n\nimport {\n EmptyMessage,\n Overflow,\n ShuttleFooter,\n ShuttleFooterActions,\n ShuttleFooterCounter,\n ShuttleHeader,\n ShuttleHeaderBreadcrumb,\n ShuttleList,\n ShuttleWrapper,\n LoadingList,\n} from '../classedComponents';\nimport { getActiveIdFromHierarchy } from '../helper';\nimport { AnimationState } from '../AnimationState';\nimport { VirtualizedList } from './VirtualizedList';\nimport { ShuttleTargetListItem } from './ShuttleListItem/ShuttleTargetListItem';\nimport { VirtualizedSortableList } from './VirtualizedSortableList';\nimport { LoadingIndicator } from './LoadingIndicator';\n\nconst noop = () => {};\n\nfunction ShuttleTarget({\n items = [],\n hierarchy = [],\n onNavigateTo = noop,\n onMoveItem = noop,\n onClearMovedItems = noop,\n emptyMessage = 'No items selected',\n composeTargetItemProps = () => ({}),\n targetSortable = false,\n onSortEnd = noop,\n targetClearItemsText = 'CLEAR ALL',\n renderTargetCounter = (amount) => `${amount} items`,\n loading = false,\n}) {\n const {\n state: { isMoving = false },\n } = useContext(AnimationState.Context);\n const isEmpty = !items.length;\n const emptyContent = loading ? <LoadingIndicator /> : <EmptyMessage>{emptyMessage}</EmptyMessage>;\n\n const ComponentList = targetSortable ? VirtualizedSortableList : VirtualizedList;\n\n const handleSortEnd = ({ oldIndex, newIndex }) => {\n onSortEnd({\n sourceItem: items[oldIndex],\n targetItem: items[newIndex],\n });\n };\n\n return (\n <ShuttleWrapper>\n <ShuttleHeader>\n <ShuttleHeaderBreadcrumb hierarchy={hierarchy} onNavigateTo={onNavigateTo} />\n </ShuttleHeader>\n <ShuttleList classProps={{ showPulse: isMoving }}>\n {!loading && !isEmpty ? (\n <Overflow\n activeHierarchy={getActiveIdFromHierarchy(hierarchy).id}\n classProps={{\n empty: !items.length,\n }}\n >\n <ComponentList\n itemRenderer={({ item, ...rest }) => (\n <ShuttleTargetListItem\n data-testid=\"target-list-item\"\n {...rest}\n {...composeTargetItemProps(item, rest)}\n isRoot={!getActiveIdFromHierarchy(hierarchy).id}\n item={item}\n onMoveToSource={onMoveItem}\n onNavigateOnTargetTo={onNavigateTo}\n showSortHandler={targetSortable}\n />\n )}\n items={items}\n onSortEnd={handleSortEnd}\n target\n />\n </Overflow>\n ) : (\n <LoadingList>{emptyContent}</LoadingList>\n )}\n </ShuttleList>\n <ShuttleFooter>\n <ShuttleFooterActions>\n {!!items.length && (\n <DSButton\n containerProps={{ 'data-testid': 'shuttle-clear-all-target' }}\n buttonType=\"link\"\n labelText={targetClearItemsText}\n onClick={onClearMovedItems}\n />\n )}\n </ShuttleFooterActions>\n <ShuttleFooterCounter>{renderTargetCounter(items.length)}</ShuttleFooterCounter>\n </ShuttleFooter>\n </ShuttleWrapper>\n );\n}\n\nexport { ShuttleTarget };\nexport default ShuttleTarget;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAAA,SAAgB,kBAAkB;AAClC,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AAEjC,MAAM,OAAO,MAAM;AAAC;AAEpB,SAAS,cAAc;AAAA,EACrB,Q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AAAA,YACA,WAAW;AAAA,YACX,QAAM;AAAA,WACR;AAAA,SACF,IAEA,oBAAC;AAAA,UAAa;AAAA,SAAa;AAAA,OAE/B;AAAA,MACA,qBAAC;AAAA,QACC;AAAA,8BAAC;AAAA,YACE,WAAC,CAAC,MAAM,UACP,oBAAC;AAAA,cACC,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,cAC5D,YAAW;AAAA,cACX,WAAW;AAAA,cACX,SAAS;AAAA,aACX;AAAA,WAEJ;AAAA,UACA,oBAAC;AAAA,YAAsB,8BAAoB,MAAM,MAAM;AAAA,WAAE;AAAA;AAAA,OAC3D;AAAA;AAAA,GACF;AAEJ;AAGA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useContext, useEffect, useRef } from "react";
|
|
3
4
|
import { useTransition } from "react-spring/web";
|
|
4
5
|
import { FixedSizeList as List } from "react-window";
|
|
5
6
|
import InfiniteLoader from "react-window-infinite-loader";
|
|
@@ -32,24 +33,28 @@ function VirtualizedList({
|
|
|
32
33
|
});
|
|
33
34
|
const itemCount = hasNextPage ? items.length + 1 : items.length;
|
|
34
35
|
const isItemLoaded = (index) => !hasNextPage || index < items.length;
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
return /* @__PURE__ */ jsx(AutoSizer, {
|
|
37
|
+
children: ({ height, width }) => /* @__PURE__ */ jsx(InfiniteLoader, {
|
|
38
|
+
isItemLoaded,
|
|
39
|
+
itemCount,
|
|
40
|
+
loadMoreItems: getMoreItems,
|
|
41
|
+
children: ({ onItemsRendered, ref }) => /* @__PURE__ */ jsx(List, {
|
|
42
|
+
height: searching ? 300 : height,
|
|
43
|
+
width,
|
|
44
|
+
innerRef,
|
|
45
|
+
itemCount: transitions.length,
|
|
46
|
+
itemData: {
|
|
47
|
+
items: transitions,
|
|
48
|
+
itemRenderer,
|
|
49
|
+
isItemMoving: hasMounted.current && (isMoving || isMovingBack)
|
|
50
|
+
},
|
|
51
|
+
itemSize: 35,
|
|
52
|
+
onItemsRendered,
|
|
53
|
+
ref,
|
|
54
|
+
children: children || VirtualizedItem
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
53
58
|
}
|
|
54
59
|
var VirtualizedList_default = VirtualizedList;
|
|
55
60
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/VirtualizedList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext, useEffect, useRef } from 'react';\nimport { useTransition } from 'react-spring/web';\nimport { FixedSizeList as List } from 'react-window';\nimport InfiniteLoader from 'react-window-infinite-loader';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { animationConfig } from '../animation/animationConfig';\nimport { AnimationState } from '../AnimationState';\nimport { VirtualizedItem } from './VirtualizedItem';\n\nfunction VirtualizedList({\n items,\n itemRenderer,\n searching,\n target = false,\n innerRef,\n children,\n hasNextPage = true,\n getMoreItems = () => {},\n}) {\n const hasMounted = useRef(false);\n const {\n state: { isMoving, isMovingBack },\n reset,\n } = useContext(AnimationState.Context);\n\n useEffect(() => {\n hasMounted.current = true;\n }, []);\n\n const transitions = useTransition(items, (item) => item.id, {\n ...animationConfig.moveItem(target),\n onDestroyed: () => reset(),\n });\n\n const itemCount = hasNextPage ? items.length + 1 : items.length;\n\n const isItemLoaded = (index) => !hasNextPage || index < items.length;\n\n return (\n <AutoSizer>\n {({ height, width }) => (\n <InfiniteLoader\n isItemLoaded={isItemLoaded}\n itemCount={itemCount}\n loadMoreItems={getMoreItems}\n >\n {({ onItemsRendered, ref }) => (\n <List\n height={searching ? 300 : height}\n width={width}\n innerRef={innerRef}\n itemCount={transitions.length}\n itemData={{\n items: transitions,\n itemRenderer,\n isItemMoving: hasMounted.current && (isMoving || isMovingBack),\n }}\n itemSize={35}\n onItemsRendered={onItemsRendered}\n ref={ref}\n >\n {children || VirtualizedItem}\n </List>\n )}\n </InfiniteLoader>\n )}\n </AutoSizer>\n );\n}\n\nexport { VirtualizedList };\nexport default VirtualizedList;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,YAAY,WAAW,cAAc;AACrD,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB,YAAY;AACtC,OAAO,oBAAoB;AAC3B,OAAO,eAAe;AACtB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAEhC,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,eAAe,MAAM;AAAA,EAAC;AACxB,GAAG;AACD,QAAM,aAAa,OAAO,KAAK;AAC/B,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,aAAa;AAAA,IAChC;AAAA,EACF,IAAI,WAAW,eAAe,OAAO;AAErC,YAAU,MAAM;AACd,eAAW,UAAU;AAAA,EACvB,GAAG,CAAC,CAAC;AAEL,QAAM,cAAc,cAAc,OAAO,CAAC,SAAS,KAAK,IAAI;AAAA,IAC1D,GAAG,gBAAgB,SAAS,MAAM;AAAA,IAClC,aAAa,MAAM,MAAM;AAAA,EAC3B,CAAC;AAED,QAAM,YAAY,cAAc,MAAM,SAAS,IAAI,MAAM;AAEzD,QAAM,eAAe,CAAC,UAAU,CAAC,eAAe,QAAQ,MAAM;AAE9D,SACE,oBAAC;AAAA,IACE,WAAC,EAAE,QAAQ,MAAM,MAChB,oBAAC;AAAA,MACC;AAAA,MACA;AAAA,MACA,eAAe;AAAA,MAEd,WAAC,EAAE,iBAAiB,IAAI,MACvB,oBAAC;AAAA,QACC,QAAQ,YAAY,MAAM;AAAA,QAC1B;AAAA,QACA;AAAA,QACA,WAAW,YAAY;AAAA,QACvB,UAAU;AAAA,UACR,OAAO;AAAA,UACP;AAAA,UACA,cAAc,WAAW,YAAY,YAAY;AAAA,QACnD;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QAEC,sBAAY;AAAA,OACf;AAAA,KAEJ;AAAA,GAEJ;AAEJ;AAGA,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { sortableElement, sortableContainer } from "react-sortable-hoc";
|
|
4
4
|
import { VirtualizedList } from "./VirtualizedList";
|
|
5
5
|
import { VirtualizedItem } from "./VirtualizedItem";
|
|
6
6
|
const SortableList = sortableContainer(VirtualizedList);
|
|
7
7
|
function VirtualizedSortableList({ items, ...otherProps }) {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsx(SortableList, {
|
|
9
9
|
...otherProps,
|
|
10
10
|
items,
|
|
11
|
-
useDragHandle: true
|
|
12
|
-
|
|
11
|
+
useDragHandle: true,
|
|
12
|
+
children: sortableElement(VirtualizedItem)
|
|
13
|
+
});
|
|
13
14
|
}
|
|
14
15
|
var VirtualizedSortableList_default = VirtualizedSortableList;
|
|
15
16
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/VirtualizedSortableList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { sortableElement, sortableContainer } from 'react-sortable-hoc';\nimport { VirtualizedList } from './VirtualizedList';\nimport { VirtualizedItem } from './VirtualizedItem';\n\nconst SortableList = sortableContainer(VirtualizedList);\n\nfunction VirtualizedSortableList({ items, ...otherProps }) {\n return (\n <SortableList {...otherProps} items={items} useDragHandle>\n {sortableElement(VirtualizedItem)}\n </SortableList>\n );\n}\n\nexport { VirtualizedSortableList };\nexport default VirtualizedSortableList;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,iBAAiB,yBAAyB;AACnD,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAEhC,MAAM,eAAe,kBAAkB,eAAe;AAEtD,SAAS,wBAAwB,EAAE,UAAU,WAAW,GAAG;AACzD,SACE,oBAAC;AAAA,IAAc,GAAG;AAAA,IAAY;AAAA,IAAc,eAAa;AAAA,IACtD,0BAAgB,eAAe;AAAA,GAClC;AAEJ;AAGA,IAAO,kCAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { AnimationState } from "./AnimationState";
|
|
4
4
|
import { SearchState } from "./SearchState";
|
|
5
5
|
import { ShuttleState } from "./ShuttleState";
|
|
6
6
|
function withProviders(Component) {
|
|
7
|
-
return (props) => /* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return (props) => /* @__PURE__ */ jsx(ShuttleState.Provider, {
|
|
8
|
+
children: /* @__PURE__ */ jsx(AnimationState.Provider, {
|
|
9
|
+
children: /* @__PURE__ */ jsx(SearchState.Provider, {
|
|
10
|
+
children: /* @__PURE__ */ jsx(Component, {
|
|
11
|
+
...props
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
})
|
|
15
|
+
});
|
|
10
16
|
}
|
|
11
17
|
var withProviders_default = withProviders;
|
|
12
18
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/withProviders.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React from 'react';\nimport { AnimationState } from './AnimationState';\nimport { SearchState } from './SearchState';\nimport { ShuttleState } from './ShuttleState';\n\nfunction withProviders(Component) {\n return props => (\n <ShuttleState.Provider>\n <AnimationState.Provider>\n <SearchState.Provider>\n <Component {...props} />\n </SearchState.Provider>\n </AnimationState.Provider>\n </ShuttleState.Provider>\n );\n}\n\nexport { withProviders };\nexport default withProviders;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AAEA,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAE7B,SAAS,cAAc,WAAW;AAChC,SAAO,WACL,oBAAC,aAAa,UAAb;AAAA,IACC,8BAAC,eAAe,UAAf;AAAA,MACC,8BAAC,YAAY,UAAZ;AAAA,QACC,8BAAC;AAAA,UAAW,GAAG;AAAA,SAAO;AAAA,OACxB;AAAA,KACF;AAAA,GACF;AAEJ;AAGA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-shuttle",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Shuttle",
|
|
6
6
|
"files": [
|
|
@@ -155,16 +155,16 @@
|
|
|
155
155
|
"indent": 4
|
|
156
156
|
},
|
|
157
157
|
"dependencies": {
|
|
158
|
-
"@elliemae/ds-breadcrumb": "3.5.
|
|
159
|
-
"@elliemae/ds-button": "3.5.
|
|
160
|
-
"@elliemae/ds-circular-progress-indicator": "3.5.
|
|
161
|
-
"@elliemae/ds-classnames": "3.5.
|
|
162
|
-
"@elliemae/ds-form": "3.5.
|
|
163
|
-
"@elliemae/ds-icons": "3.5.
|
|
164
|
-
"@elliemae/ds-indeterminate-progress-indicator": "3.5.
|
|
165
|
-
"@elliemae/ds-system": "3.5.
|
|
166
|
-
"@elliemae/ds-truncated-tooltip-text": "3.5.
|
|
167
|
-
"@elliemae/ds-utilities": "3.5.
|
|
158
|
+
"@elliemae/ds-breadcrumb": "3.5.1-rc.2",
|
|
159
|
+
"@elliemae/ds-button": "3.5.1-rc.2",
|
|
160
|
+
"@elliemae/ds-circular-progress-indicator": "3.5.1-rc.2",
|
|
161
|
+
"@elliemae/ds-classnames": "3.5.1-rc.2",
|
|
162
|
+
"@elliemae/ds-form": "3.5.1-rc.2",
|
|
163
|
+
"@elliemae/ds-icons": "3.5.1-rc.2",
|
|
164
|
+
"@elliemae/ds-indeterminate-progress-indicator": "3.5.1-rc.2",
|
|
165
|
+
"@elliemae/ds-system": "3.5.1-rc.2",
|
|
166
|
+
"@elliemae/ds-truncated-tooltip-text": "3.5.1-rc.2",
|
|
167
|
+
"@elliemae/ds-utilities": "3.5.1-rc.2",
|
|
168
168
|
"constate": "~1.3.2",
|
|
169
169
|
"prop-types": "~15.8.1",
|
|
170
170
|
"react-sortable-hoc": "~1.9.1",
|