@elliemae/ds-shuttle 3.15.0 → 3.16.0-next.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/dist/cjs/AnimationState.js +1 -3
- package/dist/cjs/AnimationState.js.map +2 -2
- package/dist/cjs/DSShuttle.js +46 -46
- package/dist/cjs/DSShuttle.js.map +2 -2
- package/dist/cjs/SearchState.js.map +2 -2
- package/dist/cjs/Shuttle.actions.js +6 -15
- package/dist/cjs/Shuttle.actions.js.map +3 -3
- package/dist/cjs/ShuttleContainer.js +6 -10
- package/dist/cjs/ShuttleContainer.js.map +2 -2
- package/dist/cjs/ShuttleImpl.js +26 -55
- package/dist/cjs/ShuttleImpl.js.map +2 -2
- package/dist/cjs/ShuttleRenderer.js +11 -19
- package/dist/cjs/ShuttleRenderer.js.map +2 -2
- package/dist/cjs/ShuttleState.js +4 -8
- package/dist/cjs/ShuttleState.js.map +2 -2
- package/dist/cjs/animation/animationConfig.js.map +2 -2
- package/dist/cjs/classedComponents.js +2 -2
- package/dist/cjs/classedComponents.js.map +1 -1
- package/dist/cjs/components/OverflowList.js +2 -2
- package/dist/cjs/components/OverflowList.js.map +1 -1
- package/dist/cjs/components/ShuttleBreadcrumb.js +3 -3
- package/dist/cjs/components/ShuttleBreadcrumb.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js +4 -4
- package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +7 -9
- package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +2 -2
- package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +6 -8
- package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +2 -2
- package/dist/cjs/components/ShuttleListPanel.js +2 -4
- package/dist/cjs/components/ShuttleListPanel.js.map +2 -2
- package/dist/cjs/components/ShuttleSource.js +14 -14
- package/dist/cjs/components/ShuttleSource.js.map +2 -2
- package/dist/cjs/components/ShuttleTarget.js +10 -10
- package/dist/cjs/components/ShuttleTarget.js.map +2 -2
- package/dist/cjs/components/VirtualizedItem.js +13 -16
- package/dist/cjs/components/VirtualizedItem.js.map +2 -2
- package/dist/cjs/components/VirtualizedList.js +22 -30
- package/dist/cjs/components/VirtualizedList.js.map +2 -2
- package/dist/cjs/components/VirtualizedSortableList.js +3 -5
- package/dist/cjs/components/VirtualizedSortableList.js.map +2 -2
- package/dist/cjs/helper.js.map +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/tests/utils.js +1 -3
- package/dist/cjs/tests/utils.js.map +2 -2
- package/dist/cjs/updateShuttleStateFromProps.js +6 -10
- package/dist/cjs/updateShuttleStateFromProps.js.map +2 -2
- package/dist/cjs/utils.js +1 -1
- package/dist/cjs/utils.js.map +2 -2
- package/dist/cjs/withProviders.js +6 -4
- package/dist/cjs/withProviders.js.map +2 -2
- package/dist/esm/AnimationState.js +1 -3
- package/dist/esm/AnimationState.js.map +2 -2
- package/dist/esm/DSShuttle.js +3 -3
- package/dist/esm/DSShuttle.js.map +1 -1
- package/dist/esm/SearchState.js.map +2 -2
- package/dist/esm/Shuttle.actions.js +7 -25
- package/dist/esm/Shuttle.actions.js.map +3 -3
- package/dist/esm/ShuttleContainer.js +7 -22
- package/dist/esm/ShuttleContainer.js.map +2 -2
- package/dist/esm/ShuttleImpl.js +18 -47
- package/dist/esm/ShuttleImpl.js.map +2 -2
- package/dist/esm/ShuttleRenderer.js +11 -19
- package/dist/esm/ShuttleRenderer.js.map +2 -2
- package/dist/esm/ShuttleState.js +4 -8
- package/dist/esm/ShuttleState.js.map +2 -2
- package/dist/esm/animation/animationConfig.js.map +2 -2
- package/dist/esm/classedComponents.js +2 -2
- package/dist/esm/classedComponents.js.map +1 -1
- package/dist/esm/components/OverflowList.js +2 -2
- package/dist/esm/components/OverflowList.js.map +1 -1
- package/dist/esm/components/ShuttleBreadcrumb.js +3 -3
- package/dist/esm/components/ShuttleBreadcrumb.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ShuttleListItem.js +4 -4
- package/dist/esm/components/ShuttleListItem/ShuttleListItem.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js +7 -9
- package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +2 -2
- package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js +6 -8
- package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +2 -2
- package/dist/esm/components/ShuttleListPanel.js +2 -4
- package/dist/esm/components/ShuttleListPanel.js.map +2 -2
- package/dist/esm/components/ShuttleSource.js +14 -14
- package/dist/esm/components/ShuttleSource.js.map +2 -2
- package/dist/esm/components/ShuttleTarget.js +10 -10
- package/dist/esm/components/ShuttleTarget.js.map +2 -2
- package/dist/esm/components/VirtualizedItem.js +13 -16
- package/dist/esm/components/VirtualizedItem.js.map +2 -2
- package/dist/esm/components/VirtualizedList.js +22 -30
- package/dist/esm/components/VirtualizedList.js.map +2 -2
- package/dist/esm/components/VirtualizedSortableList.js +3 -5
- package/dist/esm/components/VirtualizedSortableList.js.map +2 -2
- package/dist/esm/helper.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/tests/utils.js +1 -3
- package/dist/esm/tests/utils.js.map +2 -2
- package/dist/esm/updateShuttleStateFromProps.js +4 -8
- package/dist/esm/updateShuttleStateFromProps.js.map +2 -2
- package/dist/esm/utils.js +1 -1
- package/dist/esm/utils.js.map +2 -2
- package/dist/esm/withProviders.js +6 -4
- package/dist/esm/withProviders.js.map +2 -2
- package/dist/types/DSShuttle.d.ts +38 -38
- package/dist/types/Shuttle.actions.d.ts +7 -7
- package/dist/types/ShuttleRenderer.d.ts +2 -2
- package/dist/types/ShuttleState.d.ts +1 -1
- package/dist/types/components/ShuttleBreadcrumb.d.ts +2 -2
- package/dist/types/components/ShuttleListItem/ShuttleListItem.d.ts +2 -2
- package/dist/types/components/ShuttleListItem/ShuttleSourceListItem.d.ts +2 -2
- package/dist/types/components/ShuttleListItem/ShuttleTargetListItem.d.ts +2 -2
- package/dist/types/components/ShuttleListPanel.d.ts +2 -2
- package/dist/types/components/ShuttleSource.d.ts +27 -28
- package/dist/types/components/ShuttleTarget.d.ts +2 -2
- package/dist/types/components/VirtualizedList.d.ts +2 -2
- package/dist/types/components/VirtualizedSortableList.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/package.json +15 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleBreadcrumb.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { useTransition, animated } from 'react-spring/web';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { animationConfig } from '../animation/animationConfig';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACab;AAXV,SAAS,eAAe,gBAAgB;AACxC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { useTransition, animated } from 'react-spring/web';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { animationConfig } from '../animation/animationConfig.js';\n\nconst ShuttleBreadcrumb = ({ className = '', hierarchy = [], onNavigateTo = () => null }) => {\n const animatedCrumbs = useTransition(hierarchy, (item) => item.id, animationConfig.breadcrumb());\n\n return (\n <div className={className}>\n <DSBreadcrumb isTitle>\n {animatedCrumbs.map(({ item, props, key }) => (\n <DSBreadcrumb.Item\n key={key}\n containerComponent={animated.li}\n label={item.name}\n onClick={() => onNavigateTo(item, 'up')}\n style={props}\n />\n ))}\n </DSBreadcrumb>\n </div>\n );\n};\n\nexport { ShuttleBreadcrumb };\nexport default ShuttleBreadcrumb;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACab;AAXV,SAAS,eAAe,gBAAgB;AACxC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAEhC,MAAM,oBAAoB,CAAC,EAAE,YAAY,IAAI,YAAY,CAAC,GAAG,eAAe,MAAM,KAAK,MAAM;AAC3F,QAAM,iBAAiB,cAAc,WAAW,CAAC,SAAS,KAAK,IAAI,gBAAgB,WAAW,CAAC;AAE/F,SACE,oBAAC,SAAI,WACH,8BAAC,gBAAa,SAAO,MAClB,yBAAe,IAAI,CAAC,EAAE,MAAM,OAAO,IAAI,MACtC;AAAA,IAAC,aAAa;AAAA,IAAb;AAAA,MAEC,oBAAoB,SAAS;AAAA,MAC7B,OAAO,KAAK;AAAA,MACZ,SAAS,MAAM,aAAa,MAAM,IAAI;AAAA,MACtC,OAAO;AAAA;AAAA,IAJF;AAAA,EAKP,CACD,GACH,GACF;AAEJ;AAGA,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,7 +7,7 @@ import { animated } from "react-spring/web";
|
|
|
7
7
|
import { DSTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
8
8
|
import { sortableHandle } from "react-sortable-hoc";
|
|
9
9
|
import { GripperVertical } from "@elliemae/ds-icons";
|
|
10
|
-
import { isMovable } from "../../helper";
|
|
10
|
+
import { isMovable } from "../../helper.js";
|
|
11
11
|
const blockName = "shuttle-list-item";
|
|
12
12
|
const Wrapper = aggregatedClasses(animated.li)(blockName);
|
|
13
13
|
const ActionsGroup = aggregatedClasses("div")(blockName, "actions");
|
|
@@ -18,7 +18,7 @@ const Content = aggregatedClasses("label")(blockName, "content", ({ isChecked, c
|
|
|
18
18
|
"read-only": isReadonly
|
|
19
19
|
}));
|
|
20
20
|
const SortHandler = sortableHandle(() => /* @__PURE__ */ jsx(GripperVertical, { className: "gripper" }));
|
|
21
|
-
|
|
21
|
+
const ShuttleListItem = ({
|
|
22
22
|
item = {},
|
|
23
23
|
showIcons = void 0,
|
|
24
24
|
showIcon = true,
|
|
@@ -29,7 +29,7 @@ function ShuttleListItem({
|
|
|
29
29
|
actions = [],
|
|
30
30
|
showSortHandler = false,
|
|
31
31
|
...rest
|
|
32
|
-
}) {
|
|
32
|
+
}) => {
|
|
33
33
|
const theme = useContext(ThemeContext);
|
|
34
34
|
return /* @__PURE__ */ jsxs(Wrapper, { ...rest, role: "listitem", style: { ...style, zIndex: theme.zIndex.dialog }, children: [
|
|
35
35
|
/* @__PURE__ */ jsxs(
|
|
@@ -50,7 +50,7 @@ function ShuttleListItem({
|
|
|
50
50
|
),
|
|
51
51
|
showActions && /* @__PURE__ */ jsx(ActionsGroup, { children: actions })
|
|
52
52
|
] });
|
|
53
|
-
}
|
|
53
|
+
};
|
|
54
54
|
var ShuttleListItem_default = ShuttleListItem;
|
|
55
55
|
export {
|
|
56
56
|
ShuttleListItem,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ShuttleListItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { animated } from 'react-spring/web';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { sortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { isMovable } from '../../helper';\n\nconst blockName = 'shuttle-list-item';\nconst Wrapper = aggregatedClasses(animated.li)(blockName);\nconst ActionsGroup = aggregatedClasses('div')(blockName, 'actions');\nconst IconWrapper = aggregatedClasses('div')(blockName, 'icon-wrapper');\nconst Content = aggregatedClasses('label')(blockName, 'content', ({ isChecked, canMove, isReadonly }) => ({\n checked: isChecked,\n 'can-hover': canMove,\n 'read-only': isReadonly,\n}));\n\nconst SortHandler = sortableHandle(() => <GripperVertical className=\"gripper\" />);\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACoBkB,cAmBnC,YAnBmC;AAnBzC,SAAgB,kBAAkB;AAClC,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAE1B,MAAM,YAAY;AAClB,MAAM,UAAU,kBAAkB,SAAS,EAAE,EAAE,SAAS;AACxD,MAAM,eAAe,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAClE,MAAM,cAAc,kBAAkB,KAAK,EAAE,WAAW,cAAc;AACtE,MAAM,UAAU,kBAAkB,OAAO,EAAE,WAAW,WAAW,CAAC,EAAE,WAAW,SAAS,WAAW,OAAO;AAAA,EACxG,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AACf,EAAE;AAEF,MAAM,cAAc,eAAe,MAAM,oBAAC,mBAAgB,WAAU,WAAU,CAAE;AAEhF,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ThemeContext } from '@elliemae/ds-system';\nimport { animated } from 'react-spring/web';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { sortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { isMovable } from '../../helper.js';\n\nconst blockName = 'shuttle-list-item';\nconst Wrapper = aggregatedClasses(animated.li)(blockName);\nconst ActionsGroup = aggregatedClasses('div')(blockName, 'actions');\nconst IconWrapper = aggregatedClasses('div')(blockName, 'icon-wrapper');\nconst Content = aggregatedClasses('label')(blockName, 'content', ({ isChecked, canMove, isReadonly }) => ({\n checked: isChecked,\n 'can-hover': canMove,\n 'read-only': isReadonly,\n}));\n\nconst SortHandler = sortableHandle(() => <GripperVertical className=\"gripper\" />);\n\nconst ShuttleListItem = ({\n item = {},\n showIcons = undefined,\n showIcon = true,\n onSelect = () => null,\n isChecked = false,\n style = undefined,\n showActions = true,\n actions = [],\n showSortHandler = false,\n ...rest\n}) => {\n const theme = useContext(ThemeContext);\n\n return (\n // z-index fixed https://jira.elliemae.io/browse/PUI-8802\n <Wrapper {...rest} role=\"listitem\" style={{ ...style, zIndex: theme.zIndex.dialog }}>\n <Content\n classProps={{\n canMove: isMovable(item),\n isChecked,\n isReadonly: item.readyOnly,\n }}\n onClick={onSelect}\n >\n {showSortHandler && <SortHandler />}\n {(showIcon || showIcons) && <IconWrapper>{item.icon}</IconWrapper>}\n <DSTruncatedTooltipText className=\"shuttle-tooltip-text\" value={item.name} />\n </Content>\n {showActions && <ActionsGroup>{actions}</ActionsGroup>}\n </Wrapper>\n );\n};\n\nexport { ShuttleListItem };\nexport default ShuttleListItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoBkB,cAmBnC,YAnBmC;AAnBzC,SAAgB,kBAAkB;AAClC,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAE1B,MAAM,YAAY;AAClB,MAAM,UAAU,kBAAkB,SAAS,EAAE,EAAE,SAAS;AACxD,MAAM,eAAe,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAClE,MAAM,cAAc,kBAAkB,KAAK,EAAE,WAAW,cAAc;AACtE,MAAM,UAAU,kBAAkB,OAAO,EAAE,WAAW,WAAW,CAAC,EAAE,WAAW,SAAS,WAAW,OAAO;AAAA,EACxG,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AACf,EAAE;AAEF,MAAM,cAAc,eAAe,MAAM,oBAAC,mBAAgB,WAAU,WAAU,CAAE;AAEhF,MAAM,kBAAkB,CAAC;AAAA,EACvB,OAAO,CAAC;AAAA,EACR,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW,MAAM;AAAA,EACjB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU,CAAC;AAAA,EACX,kBAAkB;AAAA,KACf;AACL,MAAM;AACJ,QAAM,QAAQ,WAAW,YAAY;AAErC,SAEE,qBAAC,WAAS,GAAG,MAAM,MAAK,YAAW,OAAO,EAAE,GAAG,OAAO,QAAQ,MAAM,OAAO,OAAO,GAChF;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,YAAY;AAAA,UACV,SAAS,UAAU,IAAI;AAAA,UACvB;AAAA,UACA,YAAY,KAAK;AAAA,QACnB;AAAA,QACA,SAAS;AAAA,QAER;AAAA,6BAAmB,oBAAC,eAAY;AAAA,WAC/B,YAAY,cAAc,oBAAC,eAAa,eAAK,MAAK;AAAA,UACpD,oBAAC,0BAAuB,WAAU,wBAAuB,OAAO,KAAK,MAAM;AAAA;AAAA;AAAA,IAC7E;AAAA,IACC,eAAe,oBAAC,gBAAc,mBAAQ;AAAA,KACzC;AAEJ;AAGA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useCallback, useEffect } from "react";
|
|
4
|
-
import { isMovable } from "../../helper";
|
|
5
|
-
import { DrillDownButton, MoveButton } from "./ActionButtons";
|
|
6
|
-
import { ShuttleListItem } from "./ShuttleListItem";
|
|
7
|
-
|
|
4
|
+
import { isMovable } from "../../helper.js";
|
|
5
|
+
import { DrillDownButton, MoveButton } from "./ActionButtons.js";
|
|
6
|
+
import { ShuttleListItem } from "./ShuttleListItem.js";
|
|
7
|
+
const ShuttleSourceListItem = ({
|
|
8
8
|
item = {},
|
|
9
9
|
onItemCheck = () => null,
|
|
10
10
|
onMoveToTarget = () => null,
|
|
@@ -14,7 +14,7 @@ function ShuttleSourceListItem({
|
|
|
14
14
|
showDrillDownButton = true,
|
|
15
15
|
index,
|
|
16
16
|
...rest
|
|
17
|
-
}) {
|
|
17
|
+
}) => {
|
|
18
18
|
const [clicked, setClicked] = useState(false);
|
|
19
19
|
const moveToTarget = useCallback(() => onMoveToTarget(item), [item]);
|
|
20
20
|
useEffect(() => {
|
|
@@ -22,9 +22,7 @@ function ShuttleSourceListItem({
|
|
|
22
22
|
moveToTarget();
|
|
23
23
|
}
|
|
24
24
|
}, [clicked]);
|
|
25
|
-
const navigateOnSourceTo = useCallback(() => onNavigateOnSourceTo(item), [
|
|
26
|
-
item
|
|
27
|
-
]);
|
|
25
|
+
const navigateOnSourceTo = useCallback(() => onNavigateOnSourceTo(item), [item]);
|
|
28
26
|
const checkItem = useCallback(() => {
|
|
29
27
|
if (!clicked)
|
|
30
28
|
onItemCheck(item);
|
|
@@ -62,7 +60,7 @@ function ShuttleSourceListItem({
|
|
|
62
60
|
onSelect: checkItem
|
|
63
61
|
}
|
|
64
62
|
);
|
|
65
|
-
}
|
|
63
|
+
};
|
|
66
64
|
var ShuttleSourceListItem_default = ShuttleSourceListItem;
|
|
67
65
|
export {
|
|
68
66
|
ShuttleSourceListItem,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ShuttleSourceListItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { isMovable } from '../../helper';\nimport { DrillDownButton, MoveButton } from './ActionButtons';\nimport { ShuttleListItem } from './ShuttleListItem';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { isMovable } from '../../helper.js';\nimport { DrillDownButton, MoveButton } from './ActionButtons.js';\nimport { ShuttleListItem } from './ShuttleListItem.js';\n\nconst ShuttleSourceListItem = ({\n item = {},\n onItemCheck = () => null,\n onMoveToTarget = () => null,\n onNavigateOnSourceTo = () => null,\n isChecked = false,\n showMoveButton = true,\n showDrillDownButton = true,\n index,\n ...rest\n}) => {\n const [clicked, setClicked] = useState(false);\n const moveToTarget = useCallback(() => onMoveToTarget(item), [item]);\n useEffect(() => {\n if (clicked) {\n moveToTarget();\n }\n }, [clicked]);\n const navigateOnSourceTo = useCallback(() => onNavigateOnSourceTo(item), [item]);\n const checkItem = useCallback(() => {\n if (!clicked) onItemCheck(item);\n }, [item, clicked]);\n const handleOnClick = () => {\n if (!clicked) {\n setClicked(true);\n }\n };\n\n return (\n <ShuttleListItem\n {...rest}\n actions={[\n showDrillDownButton && (\n <DrillDownButton\n key=\"drill-down\"\n disabled={(!item.hasChildren && !item.asyncLoad) || item.readOnly || item.disableDrillDown}\n onClick={navigateOnSourceTo}\n />\n ),\n showMoveButton && (\n <MoveButton\n data-testid=\"ds-shuttle__move-button\"\n key=\"move\"\n disabled={!isMovable(item) || item.readOnly}\n onClick={handleOnClick}\n />\n ),\n ]}\n isChecked={isChecked}\n item={item}\n onSelect={checkItem}\n />\n );\n};\n\nexport { ShuttleSourceListItem };\nexport default ShuttleSourceListItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuCb;AAtCV,SAAgB,UAAU,aAAa,iBAAiB;AACxD,SAAS,iBAAiB;AAC1B,SAAS,iBAAiB,kBAAkB;AAC5C,SAAS,uBAAuB;AAEhC,MAAM,wBA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* as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback } from "react";
|
|
4
|
-
import { DeleteButton, DrillDownButton } from "./ActionButtons";
|
|
5
|
-
import { ShuttleListItem } from "./ShuttleListItem";
|
|
6
|
-
|
|
4
|
+
import { DeleteButton, DrillDownButton } from "./ActionButtons.js";
|
|
5
|
+
import { ShuttleListItem } from "./ShuttleListItem.js";
|
|
6
|
+
const ShuttleTargetListItem = ({
|
|
7
7
|
item = {},
|
|
8
8
|
onMoveToSource = () => null,
|
|
9
9
|
onNavigateOnTargetTo = () => null,
|
|
@@ -13,11 +13,9 @@ function ShuttleTargetListItem({
|
|
|
13
13
|
showActions = true,
|
|
14
14
|
index,
|
|
15
15
|
...rest
|
|
16
|
-
}) {
|
|
16
|
+
}) => {
|
|
17
17
|
const moveToSource = useCallback(() => onMoveToSource(item), [item]);
|
|
18
|
-
const navigateOnTargetTo = useCallback(() => onNavigateOnTargetTo(item), [
|
|
19
|
-
item
|
|
20
|
-
]);
|
|
18
|
+
const navigateOnTargetTo = useCallback(() => onNavigateOnTargetTo(item), [item]);
|
|
21
19
|
return /* @__PURE__ */ jsx(
|
|
22
20
|
ShuttleListItem,
|
|
23
21
|
{
|
|
@@ -45,7 +43,7 @@ function ShuttleTargetListItem({
|
|
|
45
43
|
showActions
|
|
46
44
|
}
|
|
47
45
|
);
|
|
48
|
-
}
|
|
46
|
+
};
|
|
49
47
|
var ShuttleTargetListItem_default = ShuttleTargetListItem;
|
|
50
48
|
export {
|
|
51
49
|
ShuttleTargetListItem,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ShuttleTargetListItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useCallback } from 'react';\nimport { DeleteButton, DrillDownButton } from './ActionButtons';\nimport { ShuttleListItem } from './ShuttleListItem';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useCallback } from 'react';\nimport { DeleteButton, DrillDownButton } from './ActionButtons.js';\nimport { ShuttleListItem } from './ShuttleListItem.js';\n\nconst ShuttleTargetListItem = ({\n item = {},\n onMoveToSource = () => null,\n onNavigateOnTargetTo = () => null,\n isRoot = false,\n showDeleteButton = true,\n showDrillDownButton = true,\n showActions = true,\n index,\n ...rest\n}) => {\n const moveToSource = useCallback(() => onMoveToSource(item), [item]);\n const navigateOnTargetTo = useCallback(() => onNavigateOnTargetTo(item), [item]);\n return (\n <ShuttleListItem\n {...rest}\n actions={[\n showDrillDownButton && (\n <DrillDownButton\n key=\"drill-down\"\n disabled={(!item.hasChildren && !item.asyncLoad) || item.readOnly || item.disableDrillDown}\n onClick={navigateOnTargetTo}\n />\n ),\n showDeleteButton && isRoot && (\n <DeleteButton\n key=\"delete\"\n disabled={item.readOnly}\n onClick={moveToSource}\n data-testid=\"ds-shuttle__close-button\"\n />\n ),\n ]}\n item={item}\n showActions={showActions}\n />\n );\n};\n\nexport { ShuttleTargetListItem };\nexport default ShuttleTargetListItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuBb;AAtBV,SAAgB,mBAAmB;AACnC,SAAS,cAAc,uBAAuB;AAC9C,SAAS,uBAAuB;AAEhC,MAAM,wBAAwB,CAAC;AAAA,EAC7B,OAAO,CAAC;AAAA,EACR,iBAAiB,MAAM;AAAA,EACvB,uBAAuB,MAAM;AAAA,EAC7B,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd;AAAA,KACG;AACL,MAAM;AACJ,QAAM,eAAe,YAAY,MAAM,eAAe,IAAI,GAAG,CAAC,IAAI,CAAC;AACnE,QAAM,qBAAqB,YAAY,MAAM,qBAAqB,IAAI,GAAG,CAAC,IAAI,CAAC;AAC/E,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,SAAS;AAAA,QACP,uBACE;AAAA,UAAC;AAAA;AAAA,YAEC,UAAW,CAAC,KAAK,eAAe,CAAC,KAAK,aAAc,KAAK,YAAY,KAAK;AAAA,YAC1E,SAAS;AAAA;AAAA,UAFL;AAAA,QAGN;AAAA,QAEF,oBAAoB,UAClB;AAAA,UAAC;AAAA;AAAA,YAEC,UAAU,KAAK;AAAA,YACf,SAAS;AAAA,YACT,eAAY;AAAA;AAAA,UAHR;AAAA,QAIN;AAAA,MAEJ;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAGA,IAAO,gCAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { DSButton } from "@elliemae/ds-button";
|
|
4
|
-
import { ShuttleListPanel as Wrapper } from "../classedComponents";
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ jsx(Wrapper, { classProps: { open }, children: /* @__PURE__ */ jsx(DSButton, { buttonType: "text", icon: children, onClick, "data-testid": "list-panel-btn" }) });
|
|
7
|
-
}
|
|
4
|
+
import { ShuttleListPanel as Wrapper } from "../classedComponents.js";
|
|
5
|
+
const ShuttleListPanel = ({ onClick = () => null, open = false, children }) => /* @__PURE__ */ jsx(Wrapper, { classProps: { open }, children: /* @__PURE__ */ jsx(DSButton, { buttonType: "text", icon: children, onClick, "data-testid": "list-panel-btn" }) });
|
|
8
6
|
var ShuttleListPanel_default = ShuttleListPanel;
|
|
9
7
|
export {
|
|
10
8
|
ShuttleListPanel,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleListPanel.tsx"],
|
|
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\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
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.js';\n\nconst ShuttleListPanel = ({ onClick = () => null, open = false, children }) => (\n <Wrapper classProps={{ open }}>\n <DSButton buttonType=\"text\" icon={children} onClick={onClick} data-testid=\"list-panel-btn\" />\n </Wrapper>\n);\n\nexport { ShuttleListPanel };\nexport default ShuttleListPanel;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACMnB;AALJ,SAAS,gBAAgB;AACzB,SAAS,oBAAoB,eAAe;AAE5C,MAAM,mBAAmB,CAAC,EAAE,UAAU,MAAM,MAAM,OAAO,OAAO,SAAS,MACvE,oBAAC,WAAQ,YAAY,EAAE,KAAK,GAC1B,8BAAC,YAAS,YAAW,QAAO,MAAM,UAAU,SAAkB,eAAY,kBAAiB,GAC7F;AAIF,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,9 +5,9 @@ import PropTypes from "prop-types";
|
|
|
5
5
|
import { ArrowShortRight, Search } from "@elliemae/ds-icons";
|
|
6
6
|
import { DSButton } from "@elliemae/ds-button";
|
|
7
7
|
import { runAll } from "@elliemae/ds-utilities";
|
|
8
|
-
import { ShuttleSearchBox } from "./ShuttleSearchBox";
|
|
9
|
-
import { ShuttleInfiniteScrollIndicator } from "./ShuttleInfiniteScrollIndicator";
|
|
10
|
-
import { ShuttleSourceListItem } from "./ShuttleListItem/ShuttleSourceListItem";
|
|
8
|
+
import { ShuttleSearchBox } from "./ShuttleSearchBox.js";
|
|
9
|
+
import { ShuttleInfiniteScrollIndicator } from "./ShuttleInfiniteScrollIndicator.js";
|
|
10
|
+
import { ShuttleSourceListItem } from "./ShuttleListItem/ShuttleSourceListItem.js";
|
|
11
11
|
import {
|
|
12
12
|
ShuttleFooterCounter,
|
|
13
13
|
Overflow,
|
|
@@ -20,17 +20,17 @@ import {
|
|
|
20
20
|
ShuttleFooterActions,
|
|
21
21
|
EmptyMessage,
|
|
22
22
|
LoadingList
|
|
23
|
-
} from "../classedComponents";
|
|
24
|
-
import { ShuttleListPanel } from "./ShuttleListPanel";
|
|
25
|
-
import { VirtualizedList } from "./VirtualizedList";
|
|
26
|
-
import { getActiveIdFromHierarchy } from "../helper";
|
|
27
|
-
import { AnimationState } from "../AnimationState";
|
|
28
|
-
import { SearchState } from "../SearchState";
|
|
29
|
-
import { VirtualizedSortableList } from "./VirtualizedSortableList";
|
|
30
|
-
import { LoadingIndicator } from "./LoadingIndicator";
|
|
23
|
+
} from "../classedComponents.js";
|
|
24
|
+
import { ShuttleListPanel } from "./ShuttleListPanel.js";
|
|
25
|
+
import { VirtualizedList } from "./VirtualizedList.js";
|
|
26
|
+
import { getActiveIdFromHierarchy } from "../helper.js";
|
|
27
|
+
import { AnimationState } from "../AnimationState.js";
|
|
28
|
+
import { SearchState } from "../SearchState.js";
|
|
29
|
+
import { VirtualizedSortableList } from "./VirtualizedSortableList.js";
|
|
30
|
+
import { LoadingIndicator } from "./LoadingIndicator.js";
|
|
31
31
|
const noop = () => {
|
|
32
32
|
};
|
|
33
|
-
|
|
33
|
+
const ShuttleSource = ({
|
|
34
34
|
items = [],
|
|
35
35
|
checkedItems = [],
|
|
36
36
|
hierarchy = [],
|
|
@@ -54,7 +54,7 @@ function ShuttleSource({
|
|
|
54
54
|
},
|
|
55
55
|
moreItemsLoading = false,
|
|
56
56
|
hasNextPage = false
|
|
57
|
-
}) {
|
|
57
|
+
}) => {
|
|
58
58
|
const {
|
|
59
59
|
state: { isMovingBack = false, isMoving }
|
|
60
60
|
} = useContext(AnimationState.Context);
|
|
@@ -160,7 +160,7 @@ function ShuttleSource({
|
|
|
160
160
|
/* @__PURE__ */ jsx(ShuttleFooterCounter, { children: renderSourceCounter(checkedItems.length) })
|
|
161
161
|
] })
|
|
162
162
|
] });
|
|
163
|
-
}
|
|
163
|
+
};
|
|
164
164
|
ShuttleSource.propTypes = {
|
|
165
165
|
items: PropTypes.arrayOf(PropTypes.shape({})),
|
|
166
166
|
checkedItems: PropTypes.arrayOf(PropTypes.shape({})),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleSource.tsx"],
|
|
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\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACqGjB,SACE,KADF;AAnGN,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,
|
|
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.js';\nimport { ShuttleInfiniteScrollIndicator } from './ShuttleInfiniteScrollIndicator.js';\nimport { ShuttleSourceListItem } from './ShuttleListItem/ShuttleSourceListItem.js';\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.js';\nimport { ShuttleListPanel } from './ShuttleListPanel.js';\nimport { VirtualizedList } from './VirtualizedList.js';\nimport { getActiveIdFromHierarchy } from '../helper.js';\nimport { AnimationState } from '../AnimationState.js';\nimport { SearchState } from '../SearchState.js';\nimport { VirtualizedSortableList } from './VirtualizedSortableList.js';\nimport { LoadingIndicator } from './LoadingIndicator.js';\n\nconst noop = () => {};\n\nconst 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;ACqGjB,SACE,KADF;AAnGN,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,MAAM,gBAAgB,CAAC;AAAA,EACrB,QAAQ,CAAC;AAAA,EACT,eAAe,CAAC;AAAA,EAChB,YAAY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EAC5B,aAAa,UAAU;AACzB;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
ShuttleList,
|
|
14
14
|
ShuttleWrapper,
|
|
15
15
|
LoadingList
|
|
16
|
-
} from "../classedComponents";
|
|
17
|
-
import { getActiveIdFromHierarchy } from "../helper";
|
|
18
|
-
import { AnimationState } from "../AnimationState";
|
|
19
|
-
import { VirtualizedList } from "./VirtualizedList";
|
|
20
|
-
import { ShuttleTargetListItem } from "./ShuttleListItem/ShuttleTargetListItem";
|
|
21
|
-
import { VirtualizedSortableList } from "./VirtualizedSortableList";
|
|
22
|
-
import { LoadingIndicator } from "./LoadingIndicator";
|
|
16
|
+
} from "../classedComponents.js";
|
|
17
|
+
import { getActiveIdFromHierarchy } from "../helper.js";
|
|
18
|
+
import { AnimationState } from "../AnimationState.js";
|
|
19
|
+
import { VirtualizedList } from "./VirtualizedList.js";
|
|
20
|
+
import { ShuttleTargetListItem } from "./ShuttleListItem/ShuttleTargetListItem.js";
|
|
21
|
+
import { VirtualizedSortableList } from "./VirtualizedSortableList.js";
|
|
22
|
+
import { LoadingIndicator } from "./LoadingIndicator.js";
|
|
23
23
|
const noop = () => {
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
const ShuttleTarget = ({
|
|
26
26
|
items = [],
|
|
27
27
|
hierarchy = [],
|
|
28
28
|
onNavigateTo = noop,
|
|
@@ -35,7 +35,7 @@ function ShuttleTarget({
|
|
|
35
35
|
targetClearItemsText = "CLEAR ALL",
|
|
36
36
|
renderTargetCounter = (amount) => `${amount} items`,
|
|
37
37
|
loading = false
|
|
38
|
-
}) {
|
|
38
|
+
}) => {
|
|
39
39
|
const {
|
|
40
40
|
state: { isMoving = false }
|
|
41
41
|
} = useContext(AnimationState.Context);
|
|
@@ -93,7 +93,7 @@ function ShuttleTarget({
|
|
|
93
93
|
/* @__PURE__ */ jsx(ShuttleFooterCounter, { children: renderTargetCounter(items.length) })
|
|
94
94
|
] })
|
|
95
95
|
] });
|
|
96
|
-
}
|
|
96
|
+
};
|
|
97
97
|
var ShuttleTarget_default = ShuttleTarget;
|
|
98
98
|
export {
|
|
99
99
|
ShuttleTarget,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleTarget.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { DSButton } from '@elliemae/ds-button';\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { DSButton } from '@elliemae/ds-button';\nimport {\n EmptyMessage,\n Overflow,\n ShuttleFooter,\n ShuttleFooterActions,\n ShuttleFooterCounter,\n ShuttleHeader,\n ShuttleHeaderBreadcrumb,\n ShuttleList,\n ShuttleWrapper,\n LoadingList,\n} from '../classedComponents.js';\nimport { getActiveIdFromHierarchy } from '../helper.js';\nimport { AnimationState } from '../AnimationState.js';\nimport { VirtualizedList } from './VirtualizedList.js';\nimport { ShuttleTargetListItem } from './ShuttleListItem/ShuttleTargetListItem.js';\nimport { VirtualizedSortableList } from './VirtualizedSortableList.js';\nimport { LoadingIndicator } from './LoadingIndicator.js';\n\nconst noop = () => {};\n\nconst 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;ACyCU,cA8C3B,YA9C2B;AAzCjC,SAAgB,kBAAkB;AAClC,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP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BACH,GAAG,uBAAuB,MAAM,IAAI;AAAA,gBACrC,QAAQ,CAAC,yBAAyB,SAAS,EAAE;AAAA,gBAC7C;AAAA,gBACA,gBAAgB;AAAA,gBAChB,sBAAsB;AAAA,gBACtB,iBAAiB;AAAA;AAAA,YACnB;AAAA,YAEF;AAAA,YACA,WAAW;AAAA,YACX,QAAM;AAAA;AAAA,QACR;AAAA;AAAA,IACF,IAEA,oBAAC,eAAa,wBAAa,GAE/B;AAAA,IACA,qBAAC,iBACC;AAAA,0BAAC,wBACE,WAAC,CAAC,MAAM,UACP;AAAA,QAAC;AAAA;AAAA,UACC,gBAAgB,EAAE,eAAe,2BAA2B;AAAA,UAC5D,YAAW;AAAA,UACX,WAAW;AAAA,UACX,SAAS;AAAA;AAAA,MACX,GAEJ;AAAA,MACA,oBAAC,wBAAsB,8BAAoB,MAAM,MAAM,GAAE;AAAA,OAC3D;AAAA,KACF;AAEJ;AAGA,IAAO,wBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { areEqual } from "react-window";
|
|
4
|
-
const VirtualizedItem = memo(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
areEqual
|
|
19
|
-
);
|
|
4
|
+
const VirtualizedItem = memo(({ data, index, style: virtualizedStyles, showSortHandler = false }) => {
|
|
5
|
+
const { items, itemRenderer, isItemMoving } = data;
|
|
6
|
+
const { item, props: animatedStyles, key } = items[index] || {};
|
|
7
|
+
if (!item)
|
|
8
|
+
return null;
|
|
9
|
+
return itemRenderer({
|
|
10
|
+
index,
|
|
11
|
+
key,
|
|
12
|
+
item,
|
|
13
|
+
showSortHandler,
|
|
14
|
+
style: isItemMoving ? { ...animatedStyles, ...virtualizedStyles } : virtualizedStyles
|
|
15
|
+
});
|
|
16
|
+
}, areEqual);
|
|
20
17
|
var VirtualizedItem_default = VirtualizedItem;
|
|
21
18
|
export {
|
|
22
19
|
VirtualizedItem,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/VirtualizedItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { memo } from 'react';\nimport { areEqual } from 'react-window';\n\nconst VirtualizedItem = memo(
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAEzB,MAAM,kBAAkB
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { memo } from 'react';\nimport { areEqual } from 'react-window';\n\nconst VirtualizedItem = memo(({ data, index, style: virtualizedStyles, showSortHandler = false }) => {\n const { items, itemRenderer, isItemMoving } = data;\n const { item, props: animatedStyles, key } = items[index] || {};\n if (!item) return null;\n return itemRenderer({\n index,\n key,\n item,\n showSortHandler,\n style: isItemMoving ? { ...animatedStyles, ...virtualizedStyles } : virtualizedStyles,\n });\n}, areEqual);\n\nexport { VirtualizedItem };\nexport default VirtualizedItem;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAEzB,MAAM,kBAAkB,KAAK,CAAC,EAAE,MAAM,OAAO,OAAO,mBAAmB,kBAAkB,MAAM,MAAM;AACnG,QAAM,EAAE,OAAO,cAAc,aAAa,IAAI;AAC9C,QAAM,EAAE,MAAM,OAAO,gBAAgB,IAAI,IAAI,MAAM,UAAU,CAAC;AAC9D,MAAI,CAAC;AAAM,WAAO;AAClB,SAAO,aAAa;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,eAAe,EAAE,GAAG,gBAAgB,GAAG,kBAAkB,IAAI;AAAA,EACtE,CAAC;AACH,GAAG,QAAQ;AAGX,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,10 +5,10 @@ import { useTransition } from "react-spring/web";
|
|
|
5
5
|
import { FixedSizeList as List } from "react-window";
|
|
6
6
|
import InfiniteLoader from "react-window-infinite-loader";
|
|
7
7
|
import AutoSizer from "react-virtualized-auto-sizer";
|
|
8
|
-
import { animationConfig } from "../animation/animationConfig";
|
|
9
|
-
import { AnimationState } from "../AnimationState";
|
|
10
|
-
import { VirtualizedItem } from "./VirtualizedItem";
|
|
11
|
-
|
|
8
|
+
import { animationConfig } from "../animation/animationConfig.js";
|
|
9
|
+
import { AnimationState } from "../AnimationState.js";
|
|
10
|
+
import { VirtualizedItem } from "./VirtualizedItem.js";
|
|
11
|
+
const VirtualizedList = ({
|
|
12
12
|
items,
|
|
13
13
|
itemRenderer,
|
|
14
14
|
searching,
|
|
@@ -18,7 +18,7 @@ function VirtualizedList({
|
|
|
18
18
|
hasNextPage = true,
|
|
19
19
|
getMoreItems = () => {
|
|
20
20
|
}
|
|
21
|
-
}) {
|
|
21
|
+
}) => {
|
|
22
22
|
const hasMounted = useRef(false);
|
|
23
23
|
const {
|
|
24
24
|
state: { isMoving, isMovingBack },
|
|
@@ -33,33 +33,25 @@ function VirtualizedList({
|
|
|
33
33
|
});
|
|
34
34
|
const itemCount = hasNextPage ? items.length + 1 : items.length;
|
|
35
35
|
const isItemLoaded = (index) => !hasNextPage || index < items.length;
|
|
36
|
-
return /* @__PURE__ */ jsx(AutoSizer, { children: ({ height, width }) => /* @__PURE__ */ jsx(
|
|
37
|
-
|
|
36
|
+
return /* @__PURE__ */ jsx(AutoSizer, { children: ({ height, width }) => /* @__PURE__ */ jsx(InfiniteLoader, { isItemLoaded, itemCount, loadMoreItems: getMoreItems, children: ({ onItemsRendered, ref }) => /* @__PURE__ */ jsx(
|
|
37
|
+
List,
|
|
38
38
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
isItemMoving: hasMounted.current && (isMoving || isMovingBack)
|
|
53
|
-
},
|
|
54
|
-
itemSize: 35,
|
|
55
|
-
onItemsRendered,
|
|
56
|
-
ref,
|
|
57
|
-
children: children || VirtualizedItem
|
|
58
|
-
}
|
|
59
|
-
)
|
|
39
|
+
height: searching ? 300 : height,
|
|
40
|
+
width,
|
|
41
|
+
innerRef,
|
|
42
|
+
itemCount: transitions.length,
|
|
43
|
+
itemData: {
|
|
44
|
+
items: transitions,
|
|
45
|
+
itemRenderer,
|
|
46
|
+
isItemMoving: hasMounted.current && (isMoving || isMovingBack)
|
|
47
|
+
},
|
|
48
|
+
itemSize: 35,
|
|
49
|
+
onItemsRendered,
|
|
50
|
+
ref,
|
|
51
|
+
children: children || VirtualizedItem
|
|
60
52
|
}
|
|
61
|
-
) });
|
|
62
|
-
}
|
|
53
|
+
) }) });
|
|
54
|
+
};
|
|
63
55
|
var VirtualizedList_default = VirtualizedList;
|
|
64
56
|
export {
|
|
65
57
|
VirtualizedList,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/VirtualizedList.tsx"],
|
|
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\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
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.js';\nimport { AnimationState } from '../AnimationState.js';\nimport { VirtualizedItem } from './VirtualizedItem.js';\n\nconst 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 isItemLoaded={isItemLoaded} itemCount={itemCount} loadMoreItems={getMoreItems}>\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;AC4CX;AA3CZ,SAAgB,YAAY,WAAW,cAAc;AACrD,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB,YAA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2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { sortableElement, sortableContainer } from "react-sortable-hoc";
|
|
4
|
-
import { VirtualizedList } from "./VirtualizedList";
|
|
5
|
-
import { VirtualizedItem } from "./VirtualizedItem";
|
|
4
|
+
import { VirtualizedList } from "./VirtualizedList.js";
|
|
5
|
+
import { VirtualizedItem } from "./VirtualizedItem.js";
|
|
6
6
|
const SortableList = sortableContainer(VirtualizedList);
|
|
7
|
-
|
|
8
|
-
return /* @__PURE__ */ jsx(SortableList, { ...otherProps, items, useDragHandle: true, children: sortableElement(VirtualizedItem) });
|
|
9
|
-
}
|
|
7
|
+
const VirtualizedSortableList = ({ items, ...otherProps }) => /* @__PURE__ */ jsx(SortableList, { ...otherProps, items, useDragHandle: true, children: sortableElement(VirtualizedItem) });
|
|
10
8
|
var VirtualizedSortableList_default = VirtualizedSortableList;
|
|
11
9
|
export {
|
|
12
10
|
VirtualizedSortableList,
|