@elliemae/ds-shuttle 2.3.0-next.3 → 3.0.0-alpha.0
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 +75 -0
- package/dist/cjs/AnimationState.js.map +7 -0
- package/dist/cjs/DSShuttle.js +170 -0
- package/dist/cjs/DSShuttle.js.map +7 -0
- package/dist/cjs/SearchState.js +60 -0
- package/dist/cjs/SearchState.js.map +7 -0
- package/dist/cjs/Shuttle.actions.js +126 -0
- package/dist/cjs/Shuttle.actions.js.map +7 -0
- package/dist/cjs/ShuttleContainer.js +82 -0
- package/dist/cjs/ShuttleContainer.js.map +7 -0
- package/dist/cjs/ShuttleImpl.js +214 -0
- package/dist/cjs/ShuttleImpl.js.map +7 -0
- package/dist/cjs/ShuttleRenderer.js +144 -0
- package/dist/cjs/ShuttleRenderer.js.map +7 -0
- package/dist/cjs/ShuttleState.js +84 -0
- package/dist/cjs/ShuttleState.js.map +7 -0
- package/dist/cjs/animation/animationConfig.js +78 -0
- package/dist/cjs/animation/animationConfig.js.map +7 -0
- package/dist/cjs/classedComponents.js +72 -0
- package/dist/cjs/classedComponents.js.map +7 -0
- package/dist/cjs/components/LoadingIndicator.js +52 -0
- package/dist/cjs/components/LoadingIndicator.js.map +7 -0
- package/dist/cjs/components/OverflowList.js +55 -0
- package/dist/cjs/components/OverflowList.js.map +7 -0
- package/dist/cjs/components/ShuttleBreadcrumb.js +54 -0
- package/dist/cjs/components/ShuttleBreadcrumb.js.map +7 -0
- package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js +48 -0
- package/dist/cjs/components/ShuttleInfiniteScrollIndicator.js.map +7 -0
- package/dist/cjs/components/ShuttleListItem/ActionButtons.js +60 -0
- package/dist/cjs/components/ShuttleListItem/ActionButtons.js.map +7 -0
- package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js +83 -0
- package/dist/cjs/components/ShuttleListItem/ShuttleListItem.js.map +7 -0
- package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +90 -0
- package/dist/cjs/components/ShuttleListItem/ShuttleSourceListItem.js.map +7 -0
- package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +73 -0
- package/dist/cjs/components/ShuttleListItem/ShuttleTargetListItem.js.map +7 -0
- package/dist/cjs/components/ShuttleListPanel.js +49 -0
- package/dist/cjs/components/ShuttleListPanel.js.map +7 -0
- package/dist/cjs/components/ShuttleSearchBox.js +99 -0
- package/dist/cjs/components/ShuttleSearchBox.js.map +7 -0
- package/dist/cjs/components/ShuttleSource.js +192 -0
- package/dist/cjs/components/ShuttleSource.js.map +7 -0
- package/dist/cjs/components/ShuttleTarget.js +104 -0
- package/dist/cjs/components/ShuttleTarget.js.map +7 -0
- package/dist/cjs/components/VirtualizedItem.js +51 -0
- package/dist/cjs/components/VirtualizedItem.js.map +7 -0
- package/dist/cjs/components/VirtualizedList.js +88 -0
- package/dist/cjs/components/VirtualizedList.js.map +7 -0
- package/dist/cjs/components/VirtualizedSortableList.js +48 -0
- package/dist/cjs/components/VirtualizedSortableList.js.map +7 -0
- package/dist/cjs/helper.js +83 -0
- package/dist/cjs/helper.js.map +7 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/tests/utils.js +1218 -0
- package/dist/cjs/tests/utils.js.map +7 -0
- package/dist/cjs/updateShuttleStateFromProps.js +98 -0
- package/dist/cjs/updateShuttleStateFromProps.js.map +7 -0
- package/dist/cjs/utils.js +41 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/withProviders.js +45 -0
- package/dist/cjs/withProviders.js.map +7 -0
- package/{esm → dist/esm}/AnimationState.js +12 -8
- package/dist/esm/AnimationState.js.map +7 -0
- package/dist/esm/DSShuttle.js +141 -0
- package/dist/esm/DSShuttle.js.map +7 -0
- package/dist/esm/SearchState.js +31 -0
- package/dist/esm/SearchState.js.map +7 -0
- package/dist/esm/Shuttle.actions.js +106 -0
- package/dist/esm/Shuttle.actions.js.map +7 -0
- package/dist/esm/ShuttleContainer.js +64 -0
- package/dist/esm/ShuttleContainer.js.map +7 -0
- package/dist/esm/ShuttleImpl.js +199 -0
- package/dist/esm/ShuttleImpl.js.map +7 -0
- package/dist/esm/ShuttleRenderer.js +115 -0
- package/dist/esm/ShuttleRenderer.js.map +7 -0
- package/dist/esm/ShuttleState.js +55 -0
- package/dist/esm/ShuttleState.js.map +7 -0
- package/dist/esm/animation/animationConfig.js +49 -0
- package/dist/esm/animation/animationConfig.js.map +7 -0
- package/dist/esm/classedComponents.js +43 -0
- package/dist/esm/classedComponents.js.map +7 -0
- package/dist/esm/components/LoadingIndicator.js +23 -0
- package/dist/esm/components/LoadingIndicator.js.map +7 -0
- package/dist/esm/components/OverflowList.js +26 -0
- package/dist/esm/components/OverflowList.js.map +7 -0
- package/dist/esm/components/ShuttleBreadcrumb.js +25 -0
- package/dist/esm/components/ShuttleBreadcrumb.js.map +7 -0
- package/dist/esm/components/ShuttleInfiniteScrollIndicator.js +19 -0
- package/dist/esm/components/ShuttleInfiniteScrollIndicator.js.map +7 -0
- package/dist/esm/components/ShuttleListItem/ActionButtons.js +31 -0
- package/dist/esm/components/ShuttleListItem/ActionButtons.js.map +7 -0
- package/dist/esm/components/ShuttleListItem/ShuttleListItem.js +54 -0
- package/dist/esm/components/ShuttleListItem/ShuttleListItem.js.map +7 -0
- package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js +61 -0
- package/dist/esm/components/ShuttleListItem/ShuttleSourceListItem.js.map +7 -0
- package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js +44 -0
- package/dist/esm/components/ShuttleListItem/ShuttleTargetListItem.js.map +7 -0
- package/dist/esm/components/ShuttleListPanel.js +20 -0
- package/dist/esm/components/ShuttleListPanel.js.map +7 -0
- package/dist/esm/components/ShuttleSearchBox.js +70 -0
- package/dist/esm/components/ShuttleSearchBox.js.map +7 -0
- package/dist/esm/components/ShuttleSource.js +175 -0
- package/dist/esm/components/ShuttleSource.js.map +7 -0
- package/dist/esm/components/ShuttleTarget.js +86 -0
- package/dist/esm/components/ShuttleTarget.js.map +7 -0
- package/dist/esm/components/VirtualizedItem.js +22 -0
- package/dist/esm/components/VirtualizedItem.js.map +7 -0
- package/dist/esm/components/VirtualizedList.js +59 -0
- package/dist/esm/components/VirtualizedList.js.map +7 -0
- package/dist/esm/components/VirtualizedSortableList.js +19 -0
- package/dist/esm/components/VirtualizedSortableList.js.map +7 -0
- package/dist/esm/helper.js +54 -0
- package/dist/esm/helper.js.map +7 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/tests/utils.js +1189 -0
- package/dist/esm/tests/utils.js.map +7 -0
- package/dist/esm/updateShuttleStateFromProps.js +69 -0
- package/dist/esm/updateShuttleStateFromProps.js.map +7 -0
- package/dist/esm/utils.js +12 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/withProviders.js +16 -0
- package/dist/esm/withProviders.js.map +7 -0
- package/{types → dist/types}/AnimationState.d.ts +3 -2
- package/{types → dist/types}/DSShuttle.d.ts +1 -1
- package/{types → dist/types}/SearchState.d.ts +3 -2
- package/{types → dist/types}/Shuttle.actions.d.ts +0 -0
- package/{types → dist/types}/ShuttleContainer.d.ts +0 -0
- package/dist/types/ShuttleImpl.d.ts +4 -0
- package/{types → dist/types}/ShuttleRenderer.d.ts +1 -0
- package/{types → dist/types}/ShuttleState.d.ts +3 -2
- package/{types → dist/types}/animation/animationConfig.d.ts +0 -0
- package/{types → dist/types}/classedComponents.d.ts +0 -0
- package/{types → dist/types}/components/LoadingIndicator.d.ts +1 -0
- package/{types → dist/types}/components/OverflowList.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleBreadcrumb.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleInfiniteScrollIndicator.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleListItem/ActionButtons.d.ts +0 -0
- package/{types → dist/types}/components/ShuttleListItem/ShuttleListItem.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleListItem/ShuttleSourceListItem.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleListItem/ShuttleTargetListItem.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleListPanel.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleSearchBox.d.ts +3 -1
- package/{types → dist/types}/components/ShuttleSource.d.ts +1 -0
- package/{types → dist/types}/components/ShuttleTarget.d.ts +1 -0
- package/{types → dist/types}/components/VirtualizedItem.d.ts +1 -0
- package/{types → dist/types}/components/VirtualizedList.d.ts +1 -0
- package/{types → dist/types}/components/VirtualizedSortableList.d.ts +1 -0
- package/{types → dist/types}/helper.d.ts +0 -0
- package/dist/types/index.d.ts +1 -0
- package/{types → dist/types}/tests/DSShuttle.events.test.d.ts +0 -0
- package/{types → dist/types}/tests/DSShuttle.test.d.ts +0 -0
- package/{types → dist/types}/tests/utils.d.ts +0 -0
- package/dist/types/updateShuttleStateFromProps.d.ts +3 -0
- package/{types → dist/types}/utils.d.ts +0 -0
- package/{types → dist/types}/withProviders.d.ts +1 -0
- package/package.json +97 -89
- package/cjs/AnimationState.js +0 -48
- package/cjs/DSShuttle.js +0 -223
- package/cjs/SearchState.js +0 -41
- package/cjs/Shuttle.actions.js +0 -137
- package/cjs/ShuttleContainer.js +0 -87
- package/cjs/ShuttleImpl.js +0 -311
- package/cjs/ShuttleRenderer.js +0 -139
- package/cjs/ShuttleState.js +0 -80
- package/cjs/animation/animationConfig.js +0 -81
- package/cjs/classedComponents.js +0 -71
- package/cjs/components/LoadingIndicator.js +0 -25
- package/cjs/components/OverflowList.js +0 -53
- package/cjs/components/ShuttleBreadcrumb.js +0 -42
- package/cjs/components/ShuttleInfiniteScrollIndicator.js +0 -39
- package/cjs/components/ShuttleListItem/ActionButtons.js +0 -55
- package/cjs/components/ShuttleListItem/ShuttleListItem.js +0 -85
- package/cjs/components/ShuttleListItem/ShuttleSourceListItem.js +0 -76
- package/cjs/components/ShuttleListItem/ShuttleTargetListItem.js +0 -57
- package/cjs/components/ShuttleListPanel.js +0 -31
- package/cjs/components/ShuttleSearchBox.js +0 -110
- package/cjs/components/ShuttleSource.js +0 -188
- package/cjs/components/ShuttleTarget.js +0 -116
- package/cjs/components/VirtualizedItem.js +0 -46
- package/cjs/components/VirtualizedList.js +0 -93
- package/cjs/components/VirtualizedSortableList.js +0 -41
- package/cjs/helper.js +0 -117
- package/cjs/index.js +0 -12
- package/cjs/updateShuttleStateFromProps.js +0 -94
- package/cjs/utils.js +0 -43
- package/cjs/withProviders.js +0 -29
- package/esm/DSShuttle.js +0 -213
- package/esm/SearchState.js +0 -35
- package/esm/Shuttle.actions.js +0 -123
- package/esm/ShuttleContainer.js +0 -80
- package/esm/ShuttleImpl.js +0 -304
- package/esm/ShuttleRenderer.js +0 -132
- package/esm/ShuttleState.js +0 -74
- package/esm/animation/animationConfig.js +0 -77
- package/esm/classedComponents.js +0 -51
- package/esm/components/LoadingIndicator.js +0 -18
- package/esm/components/OverflowList.js +0 -46
- package/esm/components/ShuttleBreadcrumb.js +0 -35
- package/esm/components/ShuttleInfiniteScrollIndicator.js +0 -32
- package/esm/components/ShuttleListItem/ActionButtons.js +0 -43
- package/esm/components/ShuttleListItem/ShuttleListItem.js +0 -76
- package/esm/components/ShuttleListItem/ShuttleSourceListItem.js +0 -68
- package/esm/components/ShuttleListItem/ShuttleTargetListItem.js +0 -49
- package/esm/components/ShuttleListPanel.js +0 -24
- package/esm/components/ShuttleSearchBox.js +0 -104
- package/esm/components/ShuttleSource.js +0 -179
- package/esm/components/ShuttleTarget.js +0 -107
- package/esm/components/VirtualizedItem.js +0 -40
- package/esm/components/VirtualizedList.js +0 -84
- package/esm/components/VirtualizedSortableList.js +0 -34
- package/esm/helper.js +0 -78
- package/esm/index.js +0 -2
- package/esm/updateShuttleStateFromProps.js +0 -88
- package/esm/utils.js +0 -18
- package/esm/withProviders.js +0 -22
- package/types/ShuttleImpl.d.ts +0 -3
- package/types/index.d.ts +0 -1
- package/types/updateShuttleStateFromProps.d.ts +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const itemAnimationDuration = 300;
|
|
3
|
+
const listAnimationDuration = 300;
|
|
4
|
+
const xPosMovement = 500;
|
|
5
|
+
const breadcrumbDuration = 200;
|
|
6
|
+
const xBreadcrumbPos = 300;
|
|
7
|
+
const animationConfig = {
|
|
8
|
+
slideRight: {
|
|
9
|
+
from: { transform: "translate3d(0,0,0)" },
|
|
10
|
+
to: { transform: `translate3d(${xPosMovement}px,0,0)` }
|
|
11
|
+
},
|
|
12
|
+
slideLeft: {
|
|
13
|
+
from: { transform: "translate3d(0,0,0)" },
|
|
14
|
+
to: { transform: `translate3d(${-xPosMovement}px,0,0)` }
|
|
15
|
+
},
|
|
16
|
+
moveItem: (isMovingLeft) => ({
|
|
17
|
+
config: { duration: itemAnimationDuration },
|
|
18
|
+
enter: { opacity: 1, transform: `translate3d(${0}px,0,0)` },
|
|
19
|
+
from: {
|
|
20
|
+
opacity: 1,
|
|
21
|
+
transform: `translate3d(${isMovingLeft ? -xPosMovement : xPosMovement}px,0,0)`
|
|
22
|
+
},
|
|
23
|
+
leave: {
|
|
24
|
+
transform: `translate3d(${isMovingLeft ? -xPosMovement : xPosMovement}px,0,0)`
|
|
25
|
+
}
|
|
26
|
+
}),
|
|
27
|
+
moveList: (isDrillingDown) => ({
|
|
28
|
+
config: { duration: listAnimationDuration },
|
|
29
|
+
enter: { opacity: 1, transform: "translate3d(0,0,0)" },
|
|
30
|
+
from: {
|
|
31
|
+
opacity: 0,
|
|
32
|
+
transform: `translate3d(0px,${isDrillingDown ? xPosMovement : -xPosMovement}px,0)`
|
|
33
|
+
},
|
|
34
|
+
leave: {
|
|
35
|
+
opacity: 0,
|
|
36
|
+
transform: `translate3d(0,${isDrillingDown ? -xPosMovement : xPosMovement}px,0)`
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
breadcrumb: () => ({
|
|
40
|
+
config: { duration: breadcrumbDuration },
|
|
41
|
+
enter: { opacity: 1, transform: `translate3d(${0}px,0,0)` },
|
|
42
|
+
from: { opacity: 0, transform: `translate3d(${xBreadcrumbPos}px,0px,0)` },
|
|
43
|
+
leave: { opacity: 0, transform: `translate3d(${xBreadcrumbPos}px,0,0)` }
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
animationConfig
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=animationConfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/animation/animationConfig.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// shuttle list and items constants\nconst itemAnimationDuration = 300;\nconst listAnimationDuration = 300;\nconst xPosMovement = 500;\n\n// breadcrumb constants\nconst breadcrumbDuration = 200;\nconst xBreadcrumbPos = 300;\n\nexport const animationConfig = {\n slideRight: {\n from: { transform: 'translate3d(0,0,0)' },\n to: { transform: `translate3d(${xPosMovement}px,0,0)` },\n },\n slideLeft: {\n from: { transform: 'translate3d(0,0,0)' },\n to: { transform: `translate3d(${-xPosMovement}px,0,0)` },\n },\n moveItem: isMovingLeft => ({\n config: { duration: itemAnimationDuration },\n enter: { opacity: 1, transform: `translate3d(${0}px,0,0)` },\n from: {\n opacity: 1,\n transform: `translate3d(${\n isMovingLeft ? -xPosMovement : xPosMovement\n }px,0,0)`,\n },\n leave: {\n transform: `translate3d(${\n isMovingLeft ? -xPosMovement : xPosMovement\n }px,0,0)`,\n },\n }),\n moveList: isDrillingDown => ({\n config: { duration: listAnimationDuration },\n enter: { opacity: 1, transform: 'translate3d(0,0,0)' },\n from: {\n opacity: 0,\n transform: `translate3d(0px,${\n isDrillingDown ? xPosMovement : -xPosMovement\n }px,0)`,\n },\n leave: {\n opacity: 0,\n transform: `translate3d(0,${\n isDrillingDown ? -xPosMovement : xPosMovement\n }px,0)`,\n },\n }),\n breadcrumb: () => ({\n config: { duration: breadcrumbDuration },\n enter: { opacity: 1, transform: `translate3d(${0}px,0,0)` },\n from: { opacity: 0, transform: `translate3d(${xBreadcrumbPos}px,0px,0)` },\n leave: { opacity: 0, transform: `translate3d(${xBreadcrumbPos}px,0,0)` },\n }),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,eAAe;AAGrB,MAAM,qBAAqB;AAC3B,MAAM,iBAAiB;AAEhB,MAAM,kBAAkB;AAAA,EAC7B,YAAY;AAAA,IACV,MAAM,EAAE,WAAW;AAAA,IACnB,IAAI,EAAE,WAAW,eAAe;AAAA;AAAA,EAElC,WAAW;AAAA,IACT,MAAM,EAAE,WAAW;AAAA,IACnB,IAAI,EAAE,WAAW,eAAe,CAAC;AAAA;AAAA,EAEnC,UAAU,kBAAiB;AAAA,IACzB,QAAQ,EAAE,UAAU;AAAA,IACpB,OAAO,EAAE,SAAS,GAAG,WAAW,eAAe;AAAA,IAC/C,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,WAAW,eACT,eAAe,CAAC,eAAe;AAAA;AAAA,IAGnC,OAAO;AAAA,MACL,WAAW,eACT,eAAe,CAAC,eAAe;AAAA;AAAA;AAAA,EAIrC,UAAU,oBAAmB;AAAA,IAC3B,QAAQ,EAAE,UAAU;AAAA,IACpB,OAAO,EAAE,SAAS,GAAG,WAAW;AAAA,IAChC,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,WAAW,mBACT,iBAAiB,eAAe,CAAC;AAAA;AAAA,IAGrC,OAAO;AAAA,MACL,SAAS;AAAA,MACT,WAAW,iBACT,iBAAiB,CAAC,eAAe;AAAA;AAAA;AAAA,EAIvC,YAAY,MAAO;AAAA,IACjB,QAAQ,EAAE,UAAU;AAAA,IACpB,OAAO,EAAE,SAAS,GAAG,WAAW,eAAe;AAAA,IAC/C,MAAM,EAAE,SAAS,GAAG,WAAW,eAAe;AAAA,IAC9C,OAAO,EAAE,SAAS,GAAG,WAAW,eAAe;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSButton } from "@elliemae/ds-button";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { ShuttleBreadcrumb } from "./components/ShuttleBreadcrumb";
|
|
5
|
+
import { OverflowList } from "./components/OverflowList";
|
|
6
|
+
const blockName = "shuttle";
|
|
7
|
+
const headerBlockName = `${blockName}-header`;
|
|
8
|
+
const listBlockName = `${blockName}-list`;
|
|
9
|
+
const footerBlockName = `${blockName}-footer`;
|
|
10
|
+
const ShuttleContainer = aggregatedClasses("div")(blockName);
|
|
11
|
+
const ShuttleWrapper = aggregatedClasses("div")(`${blockName}-wrapper`);
|
|
12
|
+
const ShuttleHeader = aggregatedClasses("div")(headerBlockName);
|
|
13
|
+
const ShuttleHeaderBreadcrumb = aggregatedClasses(ShuttleBreadcrumb)(headerBlockName, "breadcrumb");
|
|
14
|
+
const ShuttleHeaderSearchToggle = aggregatedClasses(DSButton)(headerBlockName, "search-toggle");
|
|
15
|
+
const ShuttleList = aggregatedClasses("div")(listBlockName, null, ({ showPulse }) => ({
|
|
16
|
+
"show-pulse": showPulse
|
|
17
|
+
}));
|
|
18
|
+
const ShuttleListPanel = aggregatedClasses("div")(listBlockName, "panel", ({ open }) => ({ open }));
|
|
19
|
+
const Overflow = aggregatedClasses(OverflowList)(listBlockName, "overflow", ({ empty, searching }) => ({
|
|
20
|
+
empty,
|
|
21
|
+
searching
|
|
22
|
+
}));
|
|
23
|
+
const EmptyMessage = aggregatedClasses("span")(listBlockName, "empty-message");
|
|
24
|
+
const LoadingList = aggregatedClasses("div")(listBlockName, "loading-list");
|
|
25
|
+
const ShuttleFooter = aggregatedClasses("div")(footerBlockName);
|
|
26
|
+
const ShuttleFooterActions = aggregatedClasses("div")(footerBlockName, "actions");
|
|
27
|
+
const ShuttleFooterCounter = aggregatedClasses("span")(footerBlockName, "counter");
|
|
28
|
+
export {
|
|
29
|
+
EmptyMessage,
|
|
30
|
+
LoadingList,
|
|
31
|
+
Overflow,
|
|
32
|
+
ShuttleContainer,
|
|
33
|
+
ShuttleFooter,
|
|
34
|
+
ShuttleFooterActions,
|
|
35
|
+
ShuttleFooterCounter,
|
|
36
|
+
ShuttleHeader,
|
|
37
|
+
ShuttleHeaderBreadcrumb,
|
|
38
|
+
ShuttleHeaderSearchToggle,
|
|
39
|
+
ShuttleList,
|
|
40
|
+
ShuttleListPanel,
|
|
41
|
+
ShuttleWrapper
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=classedComponents.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/classedComponents.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButton } from '@elliemae/ds-button';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ShuttleBreadcrumb } from './components/ShuttleBreadcrumb';\nimport { OverflowList } from './components/OverflowList';\n\n// block names\nconst blockName = 'shuttle';\nconst headerBlockName = `${blockName}-header`;\nconst listBlockName = `${blockName}-list`;\nconst footerBlockName = `${blockName}-footer`;\n\nexport const ShuttleContainer = aggregatedClasses('div')(blockName);\n\n// wrapper\nexport const ShuttleWrapper = aggregatedClasses('div')(`${blockName}-wrapper`);\n\n// header\nexport const ShuttleHeader = aggregatedClasses('div')(headerBlockName);\nexport const ShuttleHeaderBreadcrumb = aggregatedClasses(ShuttleBreadcrumb)(headerBlockName, 'breadcrumb');\nexport const ShuttleHeaderSearchToggle = aggregatedClasses(DSButton)(headerBlockName, 'search-toggle');\n\n// list\nexport const ShuttleList = aggregatedClasses('div')(listBlockName, null, ({ showPulse }) => ({\n 'show-pulse': showPulse,\n}));\n\nexport const ShuttleListPanel = aggregatedClasses('div')(listBlockName, 'panel', ({ open }) => ({ open }));\nexport const Overflow = aggregatedClasses(OverflowList)(listBlockName, 'overflow', ({ empty, searching }) => ({\n empty,\n searching,\n}));\nexport const EmptyMessage = aggregatedClasses('span')(listBlockName, 'empty-message');\nexport const LoadingList = aggregatedClasses('div')(listBlockName, 'loading-list');\n\n// footer\nexport const ShuttleFooter = aggregatedClasses('div')(footerBlockName);\nexport const ShuttleFooterActions = aggregatedClasses('div')(footerBlockName, 'actions');\nexport const ShuttleFooterCounter = aggregatedClasses('span')(footerBlockName, 'counter');\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAGA,MAAM,YAAY;AAClB,MAAM,kBAAkB,GAAG;AAC3B,MAAM,gBAAgB,GAAG;AACzB,MAAM,kBAAkB,GAAG;AAEpB,MAAM,mBAAmB,kBAAkB,OAAO;AAGlD,MAAM,iBAAiB,kBAAkB,OAAO,GAAG;AAGnD,MAAM,gBAAgB,kBAAkB,OAAO;AAC/C,MAAM,0BAA0B,kBAAkB,mBAAmB,iBAAiB;AACtF,MAAM,4BAA4B,kBAAkB,UAAU,iBAAiB;AAG/E,MAAM,cAAc,kBAAkB,OAAO,eAAe,MAAM,CAAC,EAAE,gBAAiB;AAAA,EAC3F,cAAc;AAAA;AAGT,MAAM,mBAAmB,kBAAkB,OAAO,eAAe,SAAS,CAAC,EAAE,WAAY,GAAE;AAC3F,MAAM,WAAW,kBAAkB,cAAc,eAAe,YAAY,CAAC,EAAE,OAAO,gBAAiB;AAAA,EAC5G;AAAA,EACA;AAAA;AAEK,MAAM,eAAe,kBAAkB,QAAQ,eAAe;AAC9D,MAAM,cAAc,kBAAkB,OAAO,eAAe;AAG5D,MAAM,gBAAgB,kBAAkB,OAAO;AAC/C,MAAM,uBAAuB,kBAAkB,OAAO,iBAAiB;AACvE,MAAM,uBAAuB,kBAAkB,QAAQ,iBAAiB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { DSCircularProgressIndicator } from "@elliemae/ds-circular-progress-indicator";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
const Wrapper = styled.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
`;
|
|
12
|
+
const LoadingIndicator = () => /* @__PURE__ */ React2.createElement(Wrapper, {
|
|
13
|
+
"data-testid": "shuttle__loading-indicator"
|
|
14
|
+
}, /* @__PURE__ */ React2.createElement(DSCircularProgressIndicator, {
|
|
15
|
+
size: "xl",
|
|
16
|
+
showLabel: true
|
|
17
|
+
}));
|
|
18
|
+
var LoadingIndicator_default = LoadingIndicator;
|
|
19
|
+
export {
|
|
20
|
+
LoadingIndicator,
|
|
21
|
+
LoadingIndicator_default as default
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=LoadingIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/LoadingIndicator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport styled from 'styled-components';\n\nconst Wrapper = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n`;\n\nconst LoadingIndicator = () => (\n <Wrapper data-testid=\"shuttle__loading-indicator\">\n <DSCircularProgressIndicator size=\"xl\" showLabel />\n </Wrapper>\n);\n\nexport { LoadingIndicator };\nexport default LoadingIndicator;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA,MAAM,UAAU,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvB,MAAM,mBAAmB,MACvB,qCAAC,SAAD;AAAA,EAAS,eAAY;AAAA,GACnB,qCAAC,6BAAD;AAAA,EAA6B,MAAK;AAAA,EAAK,WAAS;AAAA;AAKpD,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useContext } from "react";
|
|
3
|
+
import { useTransition, animated } from "react-spring/web";
|
|
4
|
+
import { animationConfig } from "../animation/animationConfig";
|
|
5
|
+
import { AnimationState } from "../AnimationState";
|
|
6
|
+
function OverflowList({ className = "", activeHierarchy = "", children }) {
|
|
7
|
+
const {
|
|
8
|
+
state: { isDrillingDown = false },
|
|
9
|
+
setIsDrillingDown
|
|
10
|
+
} = useContext(AnimationState.Context);
|
|
11
|
+
const overflowTransition = useTransition(activeHierarchy, null, {
|
|
12
|
+
...animationConfig.moveList(isDrillingDown),
|
|
13
|
+
onDestroyed: () => setIsDrillingDown(false)
|
|
14
|
+
});
|
|
15
|
+
return overflowTransition.map(({ props, key }) => /* @__PURE__ */ React2.createElement(animated.div, {
|
|
16
|
+
key,
|
|
17
|
+
className,
|
|
18
|
+
style: props
|
|
19
|
+
}, children));
|
|
20
|
+
}
|
|
21
|
+
var OverflowList_default = OverflowList;
|
|
22
|
+
export {
|
|
23
|
+
OverflowList,
|
|
24
|
+
OverflowList_default as default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=OverflowList.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/OverflowList.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { useTransition, animated } from 'react-spring/web';\nimport { animationConfig } from '../animation/animationConfig';\nimport { AnimationState } from '../AnimationState';\n\nfunction OverflowList({ className = '', activeHierarchy = '', children }) {\n const {\n state: { isDrillingDown = false },\n setIsDrillingDown,\n } = useContext(AnimationState.Context);\n\n const overflowTransition = useTransition(activeHierarchy, null, {\n ...animationConfig.moveList(isDrillingDown),\n onDestroyed: () => setIsDrillingDown(false),\n });\n return overflowTransition.map(({ props, key }) => (\n <animated.div key={key} className={className} style={props}>\n {children}\n </animated.div>\n ));\n}\n\nexport { OverflowList };\nexport default OverflowList;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,sBAAsB,EAAE,YAAY,IAAI,kBAAkB,IAAI,YAAY;AACxE,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB;AAAA,IAC1B;AAAA,MACE,WAAW,eAAe;AAE9B,QAAM,qBAAqB,cAAc,iBAAiB,MAAM;AAAA,OAC3D,gBAAgB,SAAS;AAAA,IAC5B,aAAa,MAAM,kBAAkB;AAAA;AAEvC,SAAO,mBAAmB,IAAI,CAAC,EAAE,OAAO,UACtC,qCAAC,SAAS,KAAV;AAAA,IAAc;AAAA,IAAU;AAAA,IAAsB,OAAO;AAAA,KAClD;AAAA;AAMP,IAAO,uBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { useTransition, animated } from "react-spring/web";
|
|
4
|
+
import { DSBreadcrumb } from "@elliemae/ds-breadcrumb";
|
|
5
|
+
import { animationConfig } from "../animation/animationConfig";
|
|
6
|
+
function ShuttleBreadcrumb({ className = "", hierarchy = [], onNavigateTo = () => null }) {
|
|
7
|
+
const animatedCrumbs = useTransition(hierarchy, (item) => item.id, animationConfig.breadcrumb());
|
|
8
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
9
|
+
className
|
|
10
|
+
}, /* @__PURE__ */ React2.createElement(DSBreadcrumb, {
|
|
11
|
+
isTitle: true
|
|
12
|
+
}, animatedCrumbs.map(({ item, props, key }) => /* @__PURE__ */ React2.createElement(DSBreadcrumb.Item, {
|
|
13
|
+
key,
|
|
14
|
+
containerComponent: animated.li,
|
|
15
|
+
label: item.name,
|
|
16
|
+
onClick: () => onNavigateTo(item, "up"),
|
|
17
|
+
style: props
|
|
18
|
+
}))));
|
|
19
|
+
}
|
|
20
|
+
var ShuttleBreadcrumb_default = ShuttleBreadcrumb;
|
|
21
|
+
export {
|
|
22
|
+
ShuttleBreadcrumb,
|
|
23
|
+
ShuttleBreadcrumb_default as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=ShuttleBreadcrumb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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\nfunction 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;ACCA;AACA;AACA;AACA;AAEA,2BAA2B,EAAE,YAAY,IAAI,YAAY,IAAI,eAAe,MAAM,QAAQ;AACxF,QAAM,iBAAiB,cAAc,WAAW,CAAC,SAAS,KAAK,IAAI,gBAAgB;AAEnF,SACE,qCAAC,OAAD;AAAA,IAAK;AAAA,KACH,qCAAC,cAAD;AAAA,IAAc,SAAO;AAAA,KAClB,eAAe,IAAI,CAAC,EAAE,MAAM,OAAO,UAClC,qCAAC,aAAa,MAAd;AAAA,IACE;AAAA,IACA,oBAAoB,SAAS;AAAA,IAC7B,OAAO,KAAK;AAAA,IACZ,SAAS,MAAM,aAAa,MAAM;AAAA,IAClC,OAAO;AAAA;AAAA;AASnB,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { DSIndeterminateProgressIndicator } from "@elliemae/ds-indeterminate-progress-indicator";
|
|
5
|
+
const blockName = "shuttle-infinite-scroll-indicator";
|
|
6
|
+
const InfiniteScrollBarContainer = aggregatedClasses("div")(blockName, null, ({ isOpen }) => ({ opened: isOpen }));
|
|
7
|
+
const ShuttleInfiniteScrollIndicator = ({ isOpen }) => /* @__PURE__ */ React2.createElement(InfiniteScrollBarContainer, {
|
|
8
|
+
classProps: { isOpen },
|
|
9
|
+
"data-testid": blockName
|
|
10
|
+
}, /* @__PURE__ */ React2.createElement(DSIndeterminateProgressIndicator, {
|
|
11
|
+
processing: true,
|
|
12
|
+
title: "Loading"
|
|
13
|
+
}));
|
|
14
|
+
var ShuttleInfiniteScrollIndicator_default = ShuttleInfiniteScrollIndicator;
|
|
15
|
+
export {
|
|
16
|
+
ShuttleInfiniteScrollIndicator,
|
|
17
|
+
ShuttleInfiniteScrollIndicator_default as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=ShuttleInfiniteScrollIndicator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleInfiniteScrollIndicator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-unused-state */\nimport React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSIndeterminateProgressIndicator } from '@elliemae/ds-indeterminate-progress-indicator';\n\nconst blockName = 'shuttle-infinite-scroll-indicator';\n\nconst InfiniteScrollBarContainer = aggregatedClasses('div')(blockName, null, ({ isOpen }) => ({ opened: isOpen }));\n\nconst ShuttleInfiniteScrollIndicator = ({ isOpen }) => (\n <InfiniteScrollBarContainer classProps={{ isOpen }} data-testid={blockName}>\n <DSIndeterminateProgressIndicator processing title=\"Loading\" />\n </InfiniteScrollBarContainer>\n);\n\nexport { ShuttleInfiniteScrollIndicator };\nexport default ShuttleInfiniteScrollIndicator;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,6BAA6B,kBAAkB,OAAO,WAAW,MAAM,CAAC,EAAE,aAAc,GAAE,QAAQ;AAExG,MAAM,iCAAiC,CAAC,EAAE,aACxC,qCAAC,4BAAD;AAAA,EAA4B,YAAY,EAAE;AAAA,EAAU,eAAa;AAAA,GAC/D,qCAAC,kCAAD;AAAA,EAAkC,YAAU;AAAA,EAAC,OAAM;AAAA;AAKvD,IAAO,yCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { DSButton } from "@elliemae/ds-button";
|
|
5
|
+
import { ArrowShortRight, ArrowShortReturn, CloseCircle } from "@elliemae/ds-icons";
|
|
6
|
+
const ActionButton = aggregatedClasses(DSButton)("shuttle-list-item", "action-button");
|
|
7
|
+
const DeleteButton = (props) => /* @__PURE__ */ React2.createElement(ActionButton, {
|
|
8
|
+
buttonType: "text",
|
|
9
|
+
icon: /* @__PURE__ */ React2.createElement(CloseCircle, null),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
const MoveButton = (props) => /* @__PURE__ */ React2.createElement(ActionButton, {
|
|
13
|
+
buttonType: "text",
|
|
14
|
+
icon: /* @__PURE__ */ React2.createElement(ArrowShortRight, null),
|
|
15
|
+
...props,
|
|
16
|
+
containerProps: { "data-testid": "ds-shuttle__move-button" }
|
|
17
|
+
});
|
|
18
|
+
const DrillDownButton = (props) => /* @__PURE__ */ React2.createElement(ActionButton, {
|
|
19
|
+
buttonType: "text",
|
|
20
|
+
icon: /* @__PURE__ */ React2.createElement(ArrowShortReturn, {
|
|
21
|
+
"data-testid": "shuttle__drill-btn-icon"
|
|
22
|
+
}),
|
|
23
|
+
...props,
|
|
24
|
+
containerProps: { "data-testid": "shuttle__drill-btn" }
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
DeleteButton,
|
|
28
|
+
DrillDownButton,
|
|
29
|
+
MoveButton
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=ActionButtons.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/ShuttleListItem/ActionButtons.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { DSButton } from '@elliemae/ds-button';\nimport { ArrowShortRight, ArrowShortReturn, CloseCircle } from '@elliemae/ds-icons';\n\nconst ActionButton = aggregatedClasses(DSButton)('shuttle-list-item', 'action-button');\n\nexport const DeleteButton = (props) => (\n <ActionButton\n buttonType=\"text\"\n icon={<CloseCircle />}\n {...props}\n // containerProps={{ 'data-testid': 'ds-shuttle__close-button' }}\n />\n);\n\nexport const MoveButton = (props) => (\n <ActionButton\n buttonType=\"text\"\n icon={<ArrowShortRight />}\n {...props}\n containerProps={{ 'data-testid': 'ds-shuttle__move-button' }}\n />\n);\n\nexport const DrillDownButton = (props) => (\n <ActionButton\n buttonType=\"text\"\n icon={<ArrowShortReturn data-testid=\"shuttle__drill-btn-icon\" />}\n {...props}\n containerProps={{ 'data-testid': 'shuttle__drill-btn' }}\n />\n);\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,eAAe,kBAAkB,UAAU,qBAAqB;AAE/D,MAAM,eAAe,CAAC,UAC3B,qCAAC,cAAD;AAAA,EACE,YAAW;AAAA,EACX,MAAM,qCAAC,aAAD;AAAA,KACF;AAAA;AAKD,MAAM,aAAa,CAAC,UACzB,qCAAC,cAAD;AAAA,EACE,YAAW;AAAA,EACX,MAAM,qCAAC,iBAAD;AAAA,KACF;AAAA,EACJ,gBAAgB,EAAE,eAAe;AAAA;AAI9B,MAAM,kBAAkB,CAAC,UAC9B,qCAAC,cAAD;AAAA,EACE,YAAW;AAAA,EACX,MAAM,qCAAC,kBAAD;AAAA,IAAkB,eAAY;AAAA;AAAA,KAChC;AAAA,EACJ,gBAAgB,EAAE,eAAe;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { animated } from "react-spring/web";
|
|
5
|
+
import { DSTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
6
|
+
import { sortableHandle } from "react-sortable-hoc";
|
|
7
|
+
import { GripperVertical } from "@elliemae/ds-icons";
|
|
8
|
+
import { isMovable } from "../../helper";
|
|
9
|
+
const blockName = "shuttle-list-item";
|
|
10
|
+
const Wrapper = aggregatedClasses(animated.li)(blockName);
|
|
11
|
+
const ActionsGroup = aggregatedClasses("div")(blockName, "actions");
|
|
12
|
+
const IconWrapper = aggregatedClasses("div")(blockName, "icon-wrapper");
|
|
13
|
+
const Content = aggregatedClasses("label")(blockName, "content", ({ isChecked, canMove, isReadonly }) => ({
|
|
14
|
+
checked: isChecked,
|
|
15
|
+
"can-hover": canMove,
|
|
16
|
+
"read-only": isReadonly
|
|
17
|
+
}));
|
|
18
|
+
const SortHandler = sortableHandle(() => /* @__PURE__ */ React2.createElement(GripperVertical, {
|
|
19
|
+
className: "gripper"
|
|
20
|
+
}));
|
|
21
|
+
function ShuttleListItem({
|
|
22
|
+
item = {},
|
|
23
|
+
showIcons = void 0,
|
|
24
|
+
showIcon = true,
|
|
25
|
+
onSelect = () => null,
|
|
26
|
+
isChecked = false,
|
|
27
|
+
style = void 0,
|
|
28
|
+
showActions = true,
|
|
29
|
+
actions = [],
|
|
30
|
+
showSortHandler = false,
|
|
31
|
+
...rest
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ React2.createElement(Wrapper, {
|
|
34
|
+
...rest,
|
|
35
|
+
role: "listitem",
|
|
36
|
+
style
|
|
37
|
+
}, /* @__PURE__ */ React2.createElement(Content, {
|
|
38
|
+
classProps: {
|
|
39
|
+
canMove: isMovable(item),
|
|
40
|
+
isChecked,
|
|
41
|
+
isReadonly: item.readyOnly
|
|
42
|
+
},
|
|
43
|
+
onClick: onSelect
|
|
44
|
+
}, showSortHandler && /* @__PURE__ */ React2.createElement(SortHandler, null), (showIcon || showIcons) && /* @__PURE__ */ React2.createElement(IconWrapper, null, item.icon), /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
|
|
45
|
+
className: "shuttle-tooltip-text",
|
|
46
|
+
value: item.name
|
|
47
|
+
})), showActions && /* @__PURE__ */ React2.createElement(ActionsGroup, null, actions));
|
|
48
|
+
}
|
|
49
|
+
var ShuttleListItem_default = ShuttleListItem;
|
|
50
|
+
export {
|
|
51
|
+
ShuttleListItem,
|
|
52
|
+
ShuttleListItem_default as default
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=ShuttleListItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\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\nfunction 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 return (\n <Wrapper {...rest} role=\"listitem\" style={style}>\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;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAClB,MAAM,UAAU,kBAAkB,SAAS,IAAI;AAC/C,MAAM,eAAe,kBAAkB,OAAO,WAAW;AACzD,MAAM,cAAc,kBAAkB,OAAO,WAAW;AACxD,MAAM,UAAU,kBAAkB,SAAS,WAAW,WAAW,CAAC,EAAE,WAAW,SAAS,iBAAkB;AAAA,EACxG,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA;AAGf,MAAM,cAAc,eAAe,MAAM,qCAAC,iBAAD;AAAA,EAAiB,WAAU;AAAA;AAEpE,yBAAyB;AAAA,EACvB,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW,MAAM;AAAA,EACjB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,UAAU;AAAA,EACV,kBAAkB;AAAA,KACf;AAAA,GACF;AACD,SACE,qCAAC,SAAD;AAAA,OAAa;AAAA,IAAM,MAAK;AAAA,IAAW;AAAA,KACjC,qCAAC,SAAD;AAAA,IACE,YAAY;AAAA,MACV,SAAS,UAAU;AAAA,MACnB;AAAA,MACA,YAAY,KAAK;AAAA;AAAA,IAEnB,SAAS;AAAA,KAER,mBAAmB,qCAAC,aAAD,OAClB,aAAY,cAAc,qCAAC,aAAD,MAAc,KAAK,OAC/C,qCAAC,wBAAD;AAAA,IAAwB,WAAU;AAAA,IAAuB,OAAO,KAAK;AAAA,OAEtE,eAAe,qCAAC,cAAD,MAAe;AAAA;AAMrC,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useState, useCallback, useEffect } from "react";
|
|
3
|
+
import { isMovable } from "../../helper";
|
|
4
|
+
import { DrillDownButton, MoveButton } from "./ActionButtons";
|
|
5
|
+
import { ShuttleListItem } from "./ShuttleListItem";
|
|
6
|
+
function ShuttleSourceListItem({
|
|
7
|
+
item = {},
|
|
8
|
+
onItemCheck = () => null,
|
|
9
|
+
onMoveToTarget = () => null,
|
|
10
|
+
onNavigateOnSourceTo = () => null,
|
|
11
|
+
isChecked = false,
|
|
12
|
+
showMoveButton = true,
|
|
13
|
+
showDrillDownButton = true,
|
|
14
|
+
index,
|
|
15
|
+
...rest
|
|
16
|
+
}) {
|
|
17
|
+
const [clicked, setClicked] = useState(false);
|
|
18
|
+
const moveToTarget = useCallback(() => onMoveToTarget(item), [item]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (clicked) {
|
|
21
|
+
moveToTarget();
|
|
22
|
+
}
|
|
23
|
+
}, [clicked]);
|
|
24
|
+
const navigateOnSourceTo = useCallback(() => onNavigateOnSourceTo(item), [
|
|
25
|
+
item
|
|
26
|
+
]);
|
|
27
|
+
const checkItem = useCallback(() => {
|
|
28
|
+
if (!clicked)
|
|
29
|
+
onItemCheck(item);
|
|
30
|
+
}, [item, clicked]);
|
|
31
|
+
const handleOnClick = () => {
|
|
32
|
+
if (!clicked) {
|
|
33
|
+
setClicked(true);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ React2.createElement(ShuttleListItem, {
|
|
37
|
+
...rest,
|
|
38
|
+
actions: [
|
|
39
|
+
showDrillDownButton && /* @__PURE__ */ React2.createElement(DrillDownButton, {
|
|
40
|
+
key: "drill-down",
|
|
41
|
+
disabled: !item.hasChildren && !item.asyncLoad || item.readOnly || item.disableDrillDown,
|
|
42
|
+
onClick: navigateOnSourceTo
|
|
43
|
+
}),
|
|
44
|
+
showMoveButton && /* @__PURE__ */ React2.createElement(MoveButton, {
|
|
45
|
+
"data-testid": "ds-shuttle__move-button",
|
|
46
|
+
key: "move",
|
|
47
|
+
disabled: !isMovable(item) || item.readOnly,
|
|
48
|
+
onClick: handleOnClick
|
|
49
|
+
})
|
|
50
|
+
],
|
|
51
|
+
isChecked,
|
|
52
|
+
item,
|
|
53
|
+
onSelect: checkItem
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var ShuttleSourceListItem_default = ShuttleSourceListItem;
|
|
57
|
+
export {
|
|
58
|
+
ShuttleSourceListItem,
|
|
59
|
+
ShuttleSourceListItem_default as default
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=ShuttleSourceListItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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\nfunction 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), [\n item,\n ]);\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={\n (!item.hasChildren && !item.asyncLoad) ||\n item.readOnly ||\n item.disableDrillDown\n }\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;ACCA;AACA;AACA;AACA;AAEA,+BAA+B;AAAA,EAC7B,OAAO;AAAA,EACP,cAAc,MAAM;AAAA,EACpB,iBAAiB,MAAM;AAAA,EACvB,uBAAuB,MAAM;AAAA,EAC7B,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB;AAAA,KACG;AAAA,GACF;AACD,QAAM,CAAC,SAAS,cAAc,SAAS;AACvC,QAAM,eAAe,YAAY,MAAM,eAAe,OAAO,CAAC;AAC9D,YAAU,MAAM;AACd,QAAI,SAAS;AACX;AAAA;AAAA,KAED,CAAC;AACJ,QAAM,qBAAqB,YAAY,MAAM,qBAAqB,OAAO;AAAA,IACvE;AAAA;AAEF,QAAM,YAAY,YAAY,MAAM;AAClC,QAAI,CAAC;AAAS,kBAAY;AAAA,KACzB,CAAC,MAAM;AACV,QAAM,gBAAgB,MAAM;AAC1B,QAAI,CAAC,SAAS;AACZ,iBAAW;AAAA;AAAA;AAIf,SACE,qCAAC,iBAAD;AAAA,OACM;AAAA,IACJ,SAAS;AAAA,MACP,uBACE,qCAAC,iBAAD;AAAA,QACE,KAAI;AAAA,QACJ,UACG,CAAC,KAAK,eAAe,CAAC,KAAK,aAC5B,KAAK,YACL,KAAK;AAAA,QAEP,SAAS;AAAA;AAAA,MAGb,kBACE,qCAAC,YAAD;AAAA,QACE,eAAY;AAAA,QACZ,KAAI;AAAA,QACJ,UAAU,CAAC,UAAU,SAAS,KAAK;AAAA,QACnC,SAAS;AAAA;AAAA;AAAA,IAIf;AAAA,IACA;AAAA,IACA,UAAU;AAAA;AAAA;AAMhB,IAAO,gCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useCallback } from "react";
|
|
3
|
+
import { DeleteButton, DrillDownButton } from "./ActionButtons";
|
|
4
|
+
import { ShuttleListItem } from "./ShuttleListItem";
|
|
5
|
+
function ShuttleTargetListItem({
|
|
6
|
+
item = {},
|
|
7
|
+
onMoveToSource = () => null,
|
|
8
|
+
onNavigateOnTargetTo = () => null,
|
|
9
|
+
isRoot = false,
|
|
10
|
+
showDeleteButton = true,
|
|
11
|
+
showDrillDownButton = true,
|
|
12
|
+
showActions = true,
|
|
13
|
+
index,
|
|
14
|
+
...rest
|
|
15
|
+
}) {
|
|
16
|
+
const moveToSource = useCallback(() => onMoveToSource(item), [item]);
|
|
17
|
+
const navigateOnTargetTo = useCallback(() => onNavigateOnTargetTo(item), [
|
|
18
|
+
item
|
|
19
|
+
]);
|
|
20
|
+
return /* @__PURE__ */ React2.createElement(ShuttleListItem, {
|
|
21
|
+
...rest,
|
|
22
|
+
actions: [
|
|
23
|
+
showDrillDownButton && /* @__PURE__ */ React2.createElement(DrillDownButton, {
|
|
24
|
+
key: "drill-down",
|
|
25
|
+
disabled: !item.hasChildren && !item.asyncLoad || item.readOnly || item.disableDrillDown,
|
|
26
|
+
onClick: navigateOnTargetTo
|
|
27
|
+
}),
|
|
28
|
+
showDeleteButton && isRoot && /* @__PURE__ */ React2.createElement(DeleteButton, {
|
|
29
|
+
key: "delete",
|
|
30
|
+
disabled: item.readOnly,
|
|
31
|
+
onClick: moveToSource,
|
|
32
|
+
"data-testid": "ds-shuttle__close-button"
|
|
33
|
+
})
|
|
34
|
+
],
|
|
35
|
+
item,
|
|
36
|
+
showActions
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var ShuttleTargetListItem_default = ShuttleTargetListItem;
|
|
40
|
+
export {
|
|
41
|
+
ShuttleTargetListItem,
|
|
42
|
+
ShuttleTargetListItem_default as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=ShuttleTargetListItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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\nfunction 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), [\n item,\n ]);\n return (\n <ShuttleListItem\n {...rest}\n actions={[\n showDrillDownButton && (\n <DrillDownButton\n key=\"drill-down\"\n disabled={\n (!item.hasChildren && !item.asyncLoad) ||\n item.readOnly ||\n item.disableDrillDown\n }\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;ACCA;AACA;AACA;AAEA,+BAA+B;AAAA,EAC7B,OAAO;AAAA,EACP,iBAAiB,MAAM;AAAA,EACvB,uBAAuB,MAAM;AAAA,EAC7B,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd;AAAA,KACG;AAAA,GACF;AACD,QAAM,eAAe,YAAY,MAAM,eAAe,OAAO,CAAC;AAC9D,QAAM,qBAAqB,YAAY,MAAM,qBAAqB,OAAO;AAAA,IACvE;AAAA;AAEF,SACE,qCAAC,iBAAD;AAAA,OACM;AAAA,IACJ,SAAS;AAAA,MACP,uBACE,qCAAC,iBAAD;AAAA,QACE,KAAI;AAAA,QACJ,UACG,CAAC,KAAK,eAAe,CAAC,KAAK,aAC5B,KAAK,YACL,KAAK;AAAA,QAEP,SAAS;AAAA;AAAA,MAGb,oBAAoB,UAClB,qCAAC,cAAD;AAAA,QACE,KAAI;AAAA,QACJ,UAAU,KAAK;AAAA,QACf,SAAS;AAAA,QACT,eAAY;AAAA;AAAA;AAAA,IAIlB;AAAA,IACA;AAAA;AAAA;AAMN,IAAO,gCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { DSButton } from "@elliemae/ds-button";
|
|
4
|
+
import { ShuttleListPanel as Wrapper } from "../classedComponents";
|
|
5
|
+
function ShuttleListPanel({ onClick = () => null, open = false, children }) {
|
|
6
|
+
return /* @__PURE__ */ React2.createElement(Wrapper, {
|
|
7
|
+
classProps: { open }
|
|
8
|
+
}, /* @__PURE__ */ React2.createElement(DSButton, {
|
|
9
|
+
buttonType: "text",
|
|
10
|
+
icon: children,
|
|
11
|
+
onClick,
|
|
12
|
+
"data-testid": "list-panel-btn"
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
var ShuttleListPanel_default = ShuttleListPanel;
|
|
16
|
+
export {
|
|
17
|
+
ShuttleListPanel,
|
|
18
|
+
ShuttleListPanel_default as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=ShuttleListPanel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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\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;ACAA;AACA;AACA;AAEA,0BAA0B,EAAE,UAAU,MAAM,MAAM,OAAO,OAAO,YAAY;AAC1E,SACE,qCAAC,SAAD;AAAA,IAAS,YAAY,EAAE;AAAA,KACrB,qCAAC,UAAD;AAAA,IAAU,YAAW;AAAA,IAAO,MAAM;AAAA,IAAU;AAAA,IAAkB,eAAY;AAAA;AAAA;AAMhF,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { Component } from "react";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { debounce } from "@elliemae/ds-utilities";
|
|
5
|
+
import { DSTextBox } from "@elliemae/ds-form";
|
|
6
|
+
const blockName = "shuttle-search-box";
|
|
7
|
+
const SearchBoxContainer = aggregatedClasses("div")(blockName, null, ({ isOpen }) => ({ opened: isOpen }));
|
|
8
|
+
const filterList = debounce((term, onFilterCallback) => {
|
|
9
|
+
onFilterCallback(term);
|
|
10
|
+
}, 200);
|
|
11
|
+
class ShuttleSearchBox extends Component {
|
|
12
|
+
constructor(props) {
|
|
13
|
+
super(props);
|
|
14
|
+
this.state = {
|
|
15
|
+
value: props.value,
|
|
16
|
+
prevProps: {}
|
|
17
|
+
};
|
|
18
|
+
this.handleKeyPress = this.handleKeyPress.bind(this);
|
|
19
|
+
this.handleChange = this.handleChange.bind(this);
|
|
20
|
+
}
|
|
21
|
+
static getDerivedStateFromProps(nextProps, { prevProps }) {
|
|
22
|
+
const { value } = nextProps;
|
|
23
|
+
if (value !== prevProps.value) {
|
|
24
|
+
return {
|
|
25
|
+
value,
|
|
26
|
+
prevProps: { value }
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
handleChange(e) {
|
|
32
|
+
const { onChange, filterOnKeyStroke, onFilter } = this.props;
|
|
33
|
+
const { value } = e.target;
|
|
34
|
+
onChange(value);
|
|
35
|
+
if (filterOnKeyStroke)
|
|
36
|
+
filterList(value, onFilter);
|
|
37
|
+
this.setState({ value });
|
|
38
|
+
}
|
|
39
|
+
handleKeyPress(e) {
|
|
40
|
+
const { onFilter } = this.props;
|
|
41
|
+
if (e.keyCode === 13)
|
|
42
|
+
onFilter(e.target.value);
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const { value } = this.state;
|
|
46
|
+
const { isOpen, onClose, placeholder } = this.props;
|
|
47
|
+
return /* @__PURE__ */ React2.createElement(SearchBoxContainer, {
|
|
48
|
+
classProps: { isOpen }
|
|
49
|
+
}, /* @__PURE__ */ React2.createElement(DSTextBox, {
|
|
50
|
+
autoFocus: true,
|
|
51
|
+
clearable: true,
|
|
52
|
+
onChange: this.handleChange,
|
|
53
|
+
onClear: onClose,
|
|
54
|
+
onKeyDown: this.handleKeyPress,
|
|
55
|
+
placeholder,
|
|
56
|
+
value
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
ShuttleSearchBox.defaultProps = {
|
|
61
|
+
filterOnKeyStroke: false,
|
|
62
|
+
onChange: () => null,
|
|
63
|
+
onFilter: () => null
|
|
64
|
+
};
|
|
65
|
+
var ShuttleSearchBox_default = ShuttleSearchBox;
|
|
66
|
+
export {
|
|
67
|
+
ShuttleSearchBox,
|
|
68
|
+
ShuttleSearchBox_default as default
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=ShuttleSearchBox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/ShuttleSearchBox.tsx"],
|
|
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;ACCA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,qBAAqB,kBAAkB,OAAO,WAAW,MAAM,CAAC,EAAE,aAAc,GAAE,QAAQ;AAEhG,MAAM,aAAa,SAAS,CAAC,MAAM,qBAAqB;AACtD,mBAAiB;AAAA,GAChB;AAEH,+BAA+B,UAAU;AAAA,EAOvC,YAAY,OAAO;AACjB,UAAM;AACN,SAAK,QAAQ;AAAA,MACX,OAAO,MAAM;AAAA,MACb,WAAW;AAAA;AAEb,SAAK,iBAAiB,KAAK,eAAe,KAAK;AAC/C,SAAK,eAAe,KAAK,aAAa,KAAK;AAAA;AAAA,SAGtC,yBAAyB,WAAW,EAAE,aAAa;AACxD,UAAM,EAAE,UAAU;AAClB,QAAI,UAAU,UAAU,OAAO;AAC7B,aAAO;AAAA,QACL;AAAA,QACA,WAAW,EAAE;AAAA;AAAA;AAGjB,WAAO;AAAA;AAAA,EAGT,aAAa,GAAG;AACd,UAAM,EAAE,UAAU,mBAAmB,aAAa,KAAK;AACvD,UAAM,EAAE,UAAU,EAAE;AACpB,aAAS;AACT,QAAI;AAAmB,iBAAW,OAAO;AACzC,SAAK,SAAS,EAAE;AAAA;AAAA,EAGlB,eAAe,GAAG;AAChB,UAAM,EAAE,aAAa,KAAK;AAC1B,QAAI,EAAE,YAAY;AAAI,eAAS,EAAE,OAAO;AAAA;AAAA,EAG1C,SAAS;AACP,UAAM,EAAE,UAAU,KAAK;AACvB,UAAM,EAAE,QAAQ,SAAS,gBAAgB,KAAK;AAC9C,WACE,qCAAC,oBAAD;AAAA,MAAoB,YAAY,EAAE;AAAA,OAChC,qCAAC,WAAD;AAAA,MACE,WAAS;AAAA,MACT,WAAS;AAAA,MACT,UAAU,KAAK;AAAA,MACf,SAAS;AAAA,MACT,WAAW,KAAK;AAAA,MAChB;AAAA,MACA;AAAA;AAAA;AAAA;AApDD,AADT,iBACS,eAAe;AAAA,EACpB,mBAAmB;AAAA,EACnB,UAAU,MAAM;AAAA,EAChB,UAAU,MAAM;AAAA;AAyDpB,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|