@elliemae/ds-shuttle-v2 3.57.0-next.4 → 3.57.0-next.41
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/config/useStore/useStore.js +3 -1
- package/dist/cjs/config/useStore/useStore.js.map +2 -2
- package/dist/cjs/constants/index.js +45 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +4 -1
- package/dist/cjs/parts/Dnd/DndHandle.js +4 -5
- package/dist/cjs/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/cjs/parts/Header.js +6 -2
- package/dist/cjs/parts/Header.js.map +2 -2
- package/dist/cjs/parts/Item/Item.js +5 -4
- package/dist/cjs/parts/Item/Item.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js +10 -10
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/cjs/parts/Item/ItemMiddleSection.js +4 -4
- package/dist/cjs/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Item/ItemOverlay.js +2 -2
- package/dist/cjs/parts/Item/ItemOverlay.js.map +2 -2
- package/dist/cjs/parts/Item/ItemSelection.js +2 -2
- package/dist/cjs/parts/Item/ItemSelection.js.map +2 -2
- package/dist/cjs/parts/Item/TextSection.js +9 -3
- package/dist/cjs/parts/Item/TextSection.js.map +2 -2
- package/dist/cjs/parts/MainContent.js +2 -2
- package/dist/cjs/parts/MainContent.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +4 -3
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js +3 -3
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js +2 -2
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/EmptyItems.js +2 -2
- package/dist/cjs/parts/Panel/middle/EmptyItems.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/LoadingItems.js +2 -2
- package/dist/cjs/parts/Panel/middle/LoadingItems.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +8 -9
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +16 -15
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ShuttleLoadingAnnouncement.js +58 -0
- package/dist/cjs/parts/Panel/middle/ShuttleLoadingAnnouncement.js.map +7 -0
- package/dist/cjs/parts/Panel/top/AriaLivePanelCenter.js +90 -0
- package/dist/cjs/parts/Panel/top/AriaLivePanelCenter.js.map +7 -0
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js +2 -2
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js +6 -4
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/SelectionHeader.js +7 -5
- package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/cjs/parts/PanelWrapper.js +3 -3
- package/dist/cjs/parts/PanelWrapper.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +3 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid.js +142 -0
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid.js.map +7 -0
- package/dist/esm/config/useStore/useStore.js +3 -1
- package/dist/esm/config/useStore/useStore.js.map +2 -2
- package/dist/esm/constants/index.js +45 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +4 -1
- package/dist/esm/parts/Dnd/DndHandle.js +3 -4
- package/dist/esm/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/esm/parts/Header.js +6 -2
- package/dist/esm/parts/Header.js.map +2 -2
- package/dist/esm/parts/Item/Item.js +4 -3
- package/dist/esm/parts/Item/Item.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/ItemActions.js +1 -1
- package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +1 -1
- package/dist/esm/parts/Item/ItemMiddleSection.js +1 -1
- package/dist/esm/parts/Item/ItemMiddleSection.js.map +1 -1
- package/dist/esm/parts/Item/ItemOverlay.js +1 -1
- package/dist/esm/parts/Item/ItemOverlay.js.map +1 -1
- package/dist/esm/parts/Item/ItemSelection.js +1 -1
- package/dist/esm/parts/Item/ItemSelection.js.map +1 -1
- package/dist/esm/parts/Item/TextSection.js +8 -2
- package/dist/esm/parts/Item/TextSection.js.map +2 -2
- package/dist/esm/parts/MainContent.js +1 -1
- package/dist/esm/parts/MainContent.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +2 -1
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/esm/parts/Panel/bottom/LoadingMore.js +1 -1
- package/dist/esm/parts/Panel/bottom/LoadingMore.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js +1 -1
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js.map +1 -1
- package/dist/esm/parts/Panel/middle/EmptyItems.js +1 -1
- package/dist/esm/parts/Panel/middle/EmptyItems.js.map +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +1 -1
- package/dist/esm/parts/Panel/middle/LoadingItems.js +1 -1
- package/dist/esm/parts/Panel/middle/LoadingItems.js.map +1 -1
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +1 -2
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +16 -15
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/esm/parts/Panel/middle/ShuttleLoadingAnnouncement.js +28 -0
- package/dist/esm/parts/Panel/middle/ShuttleLoadingAnnouncement.js.map +7 -0
- package/dist/esm/parts/Panel/top/AriaLivePanelCenter.js +60 -0
- package/dist/esm/parts/Panel/top/AriaLivePanelCenter.js.map +7 -0
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js +1 -1
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js.map +1 -1
- package/dist/esm/parts/Panel/top/PanelFilterSection.js +5 -3
- package/dist/esm/parts/Panel/top/PanelFilterSection.js.map +2 -2
- package/dist/esm/parts/Panel/top/SelectionHeader.js +3 -1
- package/dist/esm/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/esm/parts/PanelWrapper.js +1 -1
- package/dist/esm/parts/PanelWrapper.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +1 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid.js +119 -0
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid.js.map +7 -0
- package/dist/types/constants/index.d.ts +74 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/Dnd/DndHandle.d.ts +1 -0
- package/dist/types/parts/Panel/middle/ShuttleLoadingAnnouncement.d.ts +7 -0
- package/dist/types/parts/Panel/top/AriaLivePanelCenter.d.ts +2 -0
- package/dist/types/react-desc-prop-types.d.ts +2 -1
- package/dist/types/tests/configs/breadcrumb.d.ts +1 -0
- package/dist/types/tests/configs/dnd.d.ts +1 -0
- package/dist/types/tests/configs/soft-delete.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.dnd.test.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.soft-delete.test.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-shuttle-v2-valid.d.ts +1 -0
- package/package.json +45 -43
- package/dist/cjs/config/DSShuttleV2Definitions.js +0 -74
- package/dist/cjs/config/DSShuttleV2Definitions.js.map +0 -7
- package/dist/esm/config/DSShuttleV2Definitions.js +0 -44
- package/dist/esm/config/DSShuttleV2Definitions.js.map +0 -7
- package/dist/types/config/DSShuttleV2Definitions.d.ts +0 -69
|
@@ -34,7 +34,6 @@ module.exports = __toCommonJS(PanelContentMiddleSection_exports);
|
|
|
34
34
|
var React = __toESM(require("react"));
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_uid = require("uid");
|
|
38
37
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
38
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
40
39
|
var import_useOnSpecificFocus = require("./useOnSpecificFocus.js");
|
|
@@ -45,8 +44,8 @@ var import_useFocusTracker = require("../../../config/useFocusTracker/index.js")
|
|
|
45
44
|
var import_LoadingItems = require("./LoadingItems.js");
|
|
46
45
|
var import_MultipleSelectionAction = require("./MultipleSelectionAction.js");
|
|
47
46
|
var import_constants = require("../../../constants/index.js");
|
|
48
|
-
var import_DSShuttleV2Definitions = require("../../../config/DSShuttleV2Definitions.js");
|
|
49
47
|
var import_styles = require("../../../styles.js");
|
|
48
|
+
var import_ShuttleLoadingAnnouncement = require("./ShuttleLoadingAnnouncement.js");
|
|
50
49
|
const useInnerRefHandlers = (isDestinationPanel) => {
|
|
51
50
|
const setZustandRef = (0, import_useStore.useInternalStore)((state) => state.setZustandRef);
|
|
52
51
|
const currRegion = isDestinationPanel ? import_constants.REGIONS_FOCUSES.DESTINATION_PANEL : import_constants.REGIONS_FOCUSES.SOURCE_PANEL;
|
|
@@ -59,7 +58,7 @@ const useInnerRefHandlers = (isDestinationPanel) => {
|
|
|
59
58
|
return import_react.default.useMemo(() => ({ innerRefHandlerParentItem }), [innerRefHandlerParentItem]);
|
|
60
59
|
};
|
|
61
60
|
const rows = [1];
|
|
62
|
-
const StyledListWrapperMid = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
|
|
61
|
+
const StyledListWrapperMid = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSShuttleV2Name, slot: import_constants.DSShuttleV2Slots.LIST_WRAPPER_MID })`
|
|
63
62
|
overflow: hidden;
|
|
64
63
|
position: relative;
|
|
65
64
|
:focus,
|
|
@@ -72,6 +71,9 @@ const PanelContentMiddleSection = import_react.default.memo((panelMetaInfo) => {
|
|
|
72
71
|
const itemsLength = (0, import_useStore.usePropsStore)(
|
|
73
72
|
(state) => isDestinationPanel ? state.destinationData.length : state.sourceData.length
|
|
74
73
|
);
|
|
74
|
+
const headerProps = (0, import_useStore.usePropsStore)(
|
|
75
|
+
(state) => isDestinationPanel ? state.destinationHeaderProps : state.sourceHeaderProps
|
|
76
|
+
);
|
|
75
77
|
const itemList = (0, import_useStore.usePropsStore)(
|
|
76
78
|
(state) => isDestinationPanel ? state.destinationConfiguredData : state.sourceConfiguredData
|
|
77
79
|
);
|
|
@@ -155,12 +157,12 @@ const PanelContentMiddleSection = import_react.default.memo((panelMetaInfo) => {
|
|
|
155
157
|
const getOwnerProps = (0, import_useStore.usePropsStore)((store) => store.get);
|
|
156
158
|
const getOwnerPropsArguments = (0, import_react.useCallback)(() => panelMetaInfo, [panelMetaInfo]);
|
|
157
159
|
const defaultAriaDescribedBy = itemList.length > 0 ? "Press Up and Down arrow to navigate the options list and Press Right and Left arrow to access items actions" : "No items available in the panel";
|
|
158
|
-
const uidDescribedBy =
|
|
160
|
+
const uidDescribedBy = (0, import_useStore.useInternalStore)((state) => state.shuttleInternalId);
|
|
159
161
|
const defaultAriaLabel = import_react.default.useMemo(
|
|
160
|
-
() => `Entering ${isDestinationPanel ? "destination" : "source"} panel
|
|
162
|
+
() => `Entering ${isDestinationPanel ? "destination" : "source"} panel.`,
|
|
161
163
|
[isDestinationPanel]
|
|
162
164
|
);
|
|
163
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
166
|
StyledListWrapperMid,
|
|
165
167
|
{
|
|
166
168
|
onFocus: onPanelFocus,
|
|
@@ -170,19 +172,18 @@ const PanelContentMiddleSection = import_react.default.memo((panelMetaInfo) => {
|
|
|
170
172
|
rows,
|
|
171
173
|
"aria-label": defaultAriaLabel,
|
|
172
174
|
"aria-describedby": uidDescribedBy,
|
|
173
|
-
"aria-roledescription": isDestinationPanel ? "shuttle
|
|
175
|
+
"aria-roledescription": isDestinationPanel ? "shuttle destination panel" : "shuttle source panel",
|
|
174
176
|
getOwnerProps,
|
|
175
177
|
getOwnerPropsArguments,
|
|
176
178
|
innerRef: innerRefHandlerParentItem,
|
|
177
|
-
children: [
|
|
179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_grid.Grid, { cols, rows, children: [
|
|
178
180
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledA11yNoVisible, { id: uidDescribedBy, children: defaultAriaDescribedBy }),
|
|
179
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
]
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ShuttleLoadingAnnouncement.ShuttleLoadingAnnouncement, { isLoading, headerProps }),
|
|
182
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LoadingItems.LoadingItems, { ...panelMetaInfo }) : null,
|
|
183
|
+
showEmptyMessage ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EmptyItems.EmptyItems, { ...panelMetaInfo }) : null,
|
|
184
|
+
showItems ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Index.ItemListWrapperWithContext, { ...panelMetaInfo }) : null,
|
|
185
|
+
hasMultipleSelection ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MultipleSelectionAction.MultipleSelectionAction, { ...panelMetaInfo }) : null
|
|
186
|
+
] })
|
|
186
187
|
}
|
|
187
188
|
);
|
|
188
189
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Panel/middle/PanelContentMiddleSection.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React, { useCallback } from 'react';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport React, { useCallback } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { useOnSpecificFocus } from './useOnSpecificFocus.js';\nimport { usePropsStore, useInternalStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { ItemListWrapperWithContext } from './ItemListWrapper/Index.js';\nimport { EmptyItems } from './EmptyItems.js';\nimport { useFocusTracker } from '../../../config/useFocusTracker/index.js';\nimport { LoadingItems } from './LoadingItems.js';\nimport { MultipleSelectionAction } from './MultipleSelectionAction.js';\nimport { DSShuttleV2Name, REGIONS_FOCUSES, DSShuttleV2Slots } from '../../../constants/index.js';\nimport { StyledA11yNoVisible } from '../../../styles.js';\nimport { ShuttleLoadingAnnouncement } from './ShuttleLoadingAnnouncement.js';\n\nconst useInnerRefHandlers = (isDestinationPanel: boolean) => {\n const setZustandRef = useInternalStore((state) => state.setZustandRef);\n const currRegion = isDestinationPanel ? REGIONS_FOCUSES.DESTINATION_PANEL : REGIONS_FOCUSES.SOURCE_PANEL;\n\n const innerRefHandlerParentItem = React.useCallback(\n (node: HTMLDivElement | null) => {\n setZustandRef([currRegion, '', ''], node);\n },\n [currRegion, setZustandRef],\n );\n return React.useMemo(() => ({ innerRefHandlerParentItem }), [innerRefHandlerParentItem]);\n};\n\nconst rows = [1];\n\nconst StyledListWrapperMid = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.LIST_WRAPPER_MID })`\n overflow: hidden;\n position: relative;\n :focus,\n :focus-visible {\n outline: 2px solid brand-700;\n }\n`;\n\nexport const PanelContentMiddleSection = React.memo((panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const { isDestinationPanel = false, hasMultipleSelection } = panelMetaInfo;\n const itemsLength = usePropsStore((state) =>\n isDestinationPanel ? state.destinationData.length : state.sourceData.length,\n );\n\n const headerProps = usePropsStore((state) =>\n isDestinationPanel ? state.destinationHeaderProps : state.sourceHeaderProps,\n );\n\n const itemList = usePropsStore((state) =>\n isDestinationPanel ? state.destinationConfiguredData : state.sourceConfiguredData,\n );\n const isLoading = usePropsStore((state) => (isDestinationPanel ? state.destinationIsLoading : state.sourceIsLoading));\n const showEmptyMessage = !isLoading && itemsLength === 0;\n const showItems = !isLoading && !showEmptyMessage;\n\n const actionRef = usePropsStore((state) =>\n isDestinationPanel ? state.destinationVirtualRef : state.sourceVirtualRef,\n );\n\n const getIsDragAndDropHappening = useInternalStore((state) => state.getIsDragAndDropHappening);\n const withLoadMore = usePropsStore((state) =>\n isDestinationPanel ? state.destinationWithLoadMore : state.sourceWithLoadMore,\n );\n const { innerRefHandlerParentItem } = useInnerRefHandlers(isDestinationPanel);\n const {\n trackFocusRegionPanel,\n trackFocusItemFirst,\n trackFocusItemLast,\n trackFocusActionParent,\n trackFocusRegionPanelItem,\n trackFocusLoadMoreBtnDestination,\n trackFocusLoadMoreBtn,\n } = useFocusTracker();\n const config = React.useMemo(\n () => ({\n onFocus: () => {\n trackFocusRegionPanel(isDestinationPanel);\n },\n }),\n [trackFocusRegionPanel, isDestinationPanel],\n );\n const onPanelFocus = useOnSpecificFocus(config);\n\n const onPanelKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (e) => {\n const { key } = e;\n // we need to invoke \"getIsDragAndDropHappening\" here to ensure we have the latest info at the moment of the event\n const isDragAndDropHappening = getIsDragAndDropHappening();\n if (isDragAndDropHappening) {\n e.preventDefault();\n return;\n }\n if (['Home', 'End', 'ArrowUp', 'ArrowDown'].includes(key)) {\n e.preventDefault();\n e.stopPropagation();\n trackFocusRegionPanelItem(isDestinationPanel);\n trackFocusActionParent();\n // we won't receive ArrowUp/ArrowDown if this happens in a child because children are stopping propagation\n if ((key === 'ArrowDown' || key === 'Home') && itemList.length > 0) {\n actionRef.current.scrollTo(0);\n trackFocusItemFirst(panelMetaInfo);\n }\n if ((key === 'ArrowUp' || key === 'End') && itemList.length > 0) {\n if (withLoadMore) {\n if (isDestinationPanel) trackFocusLoadMoreBtnDestination();\n else trackFocusLoadMoreBtn();\n } else {\n trackFocusItemLast(panelMetaInfo);\n actionRef.current.scrollTo(itemsLength - 1);\n }\n }\n }\n },\n [\n getIsDragAndDropHappening,\n trackFocusRegionPanelItem,\n isDestinationPanel,\n trackFocusActionParent,\n itemList.length,\n actionRef,\n trackFocusItemFirst,\n panelMetaInfo,\n withLoadMore,\n trackFocusLoadMoreBtnDestination,\n trackFocusLoadMoreBtn,\n trackFocusItemLast,\n itemsLength,\n ],\n );\n\n const cols = React.useMemo(() => {\n if (hasMultipleSelection) return ['1fr', '5rem'];\n return ['auto'];\n }, [hasMultipleSelection]);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n\n const defaultAriaDescribedBy =\n itemList.length > 0\n ? 'Press Up and Down arrow to navigate the options list and Press Right and Left arrow to access items actions'\n : 'No items available in the panel';\n\n const uidDescribedBy = useInternalStore((state) => state.shuttleInternalId);\n\n const defaultAriaLabel = React.useMemo(\n () => `Entering ${isDestinationPanel ? 'destination' : 'source'} panel.`,\n [isDestinationPanel],\n );\n\n return (\n <StyledListWrapperMid\n onFocus={onPanelFocus}\n onKeyDown={onPanelKeyDown}\n role=\"group\"\n tabIndex={0}\n rows={rows}\n aria-label={defaultAriaLabel}\n aria-describedby={uidDescribedBy}\n aria-roledescription={isDestinationPanel ? 'shuttle destination panel' : 'shuttle source panel'}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={innerRefHandlerParentItem}\n >\n <Grid cols={cols} rows={rows}>\n <StyledA11yNoVisible id={uidDescribedBy}>{defaultAriaDescribedBy}</StyledA11yNoVisible>\n <ShuttleLoadingAnnouncement isLoading={isLoading} headerProps={headerProps} />\n {isLoading ? <LoadingItems {...panelMetaInfo} /> : null}\n {showEmptyMessage ? <EmptyItems {...panelMetaInfo} /> : null}\n {showItems ? <ItemListWrapperWithContext {...panelMetaInfo} /> : null}\n {hasMultipleSelection ? <MultipleSelectionAction {...panelMetaInfo} /> : null}\n </Grid>\n </StyledListWrapperMid>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ShuttleLoadingAnnouncement_exports = {};
|
|
30
|
+
__export(ShuttleLoadingAnnouncement_exports, {
|
|
31
|
+
ShuttleLoadingAnnouncement: () => ShuttleLoadingAnnouncement
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ShuttleLoadingAnnouncement_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_styles = require("../../../styles.js");
|
|
38
|
+
const ShuttleLoadingAnnouncement = import_react.default.memo(({ isLoading, headerProps }) => {
|
|
39
|
+
const myHeaderProp = headerProps;
|
|
40
|
+
const label = myHeaderProp?.currentNode?.plainItem?.label || "current level";
|
|
41
|
+
const previousNodeRef = import_react.default.useRef("");
|
|
42
|
+
import_react.default.useEffect(() => {
|
|
43
|
+
if (!isLoading) {
|
|
44
|
+
previousNodeRef.current = label;
|
|
45
|
+
}
|
|
46
|
+
}, [isLoading, label]);
|
|
47
|
+
const messageLabel = import_react.default.useMemo(() => {
|
|
48
|
+
if (isLoading) {
|
|
49
|
+
return "Loading items";
|
|
50
|
+
}
|
|
51
|
+
if (previousNodeRef.current !== label) {
|
|
52
|
+
return `Content loaded for ${label}`;
|
|
53
|
+
}
|
|
54
|
+
return "";
|
|
55
|
+
}, [isLoading, label]);
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledA11yNoVisible, { role: "status", "aria-live": "polite", children: messageLabel });
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=ShuttleLoadingAnnouncement.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/Panel/middle/ShuttleLoadingAnnouncement.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { StyledA11yNoVisible } from '../../../styles.js';\n\ninterface ShuttleLoadingAnnouncementProps {\n isLoading: boolean;\n headerProps?: Record<string, unknown>;\n}\n\n// NOTE ABOUT `headerProps` SHAPE\n// -------------------------------------\n// The shuttle panel header is fully **customizable**. Consumers can render\n// *anything* in the header area to represent the \u201Ccurrent level\u201D, therefore we\n// cannot enforce a strict type here. For that reason, `headerProps` is typed as\n// `Record<string, unknown>`.\n//\n// However, **all of our Storybook examples** use the DimSum Bredcrumb and TreeModel\n// component as the header. In that scenario, the structure is predictable:\n//\n// headerProps.currentNode.plainItem.label\n//\n// This gives us access to the label of the current breadcrumb node, which we\n// use to announce:\n// - \"Loading items\" while the panel fetches data\n// - \"Content loaded for {label}\" once loading completes\n//\n// Consumers using a different header implementation will not rely on this\n// internal structure, but our fallback (\u201Ccurrent level\u201D) ensures the region\n// still announces meaningful information.\n\nexport const ShuttleLoadingAnnouncement = React.memo(({ isLoading, headerProps }: ShuttleLoadingAnnouncementProps) => {\n const myHeaderProp = headerProps as { currentNode?: { plainItem?: { label?: string } } };\n\n const label = myHeaderProp?.currentNode?.plainItem?.label || 'current level';\n const previousNodeRef = React.useRef('');\n\n React.useEffect(() => {\n if (!isLoading) {\n previousNodeRef.current = label;\n }\n }, [isLoading, label]);\n\n const messageLabel = React.useMemo(() => {\n if (isLoading) {\n return 'Loading items';\n }\n if (previousNodeRef.current !== label) {\n return `Content loaded for ${label}`;\n }\n return '';\n }, [isLoading, label]);\n return (\n <StyledA11yNoVisible role=\"status\" aria-live=\"polite\">\n {messageLabel}\n </StyledA11yNoVisible>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDnB;AAnDJ,mBAAkB;AAClB,oBAAoC;AA4B7B,MAAM,6BAA6B,aAAAA,QAAM,KAAK,CAAC,EAAE,WAAW,YAAY,MAAuC;AACpH,QAAM,eAAe;AAErB,QAAM,QAAQ,cAAc,aAAa,WAAW,SAAS;AAC7D,QAAM,kBAAkB,aAAAA,QAAM,OAAO,EAAE;AAEvC,eAAAA,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,WAAW;AACd,sBAAgB,UAAU;AAAA,IAC5B;AAAA,EACF,GAAG,CAAC,WAAW,KAAK,CAAC;AAErB,QAAM,eAAe,aAAAA,QAAM,QAAQ,MAAM;AACvC,QAAI,WAAW;AACb,aAAO;AAAA,IACT;AACA,QAAI,gBAAgB,YAAY,OAAO;AACrC,aAAO,sBAAsB,KAAK;AAAA,IACpC;AACA,WAAO;AAAA,EACT,GAAG,CAAC,WAAW,KAAK,CAAC;AACrB,SACE,4CAAC,qCAAoB,MAAK,UAAS,aAAU,UAC1C,wBACH;AAEJ,CAAC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var AriaLivePanelCenter_exports = {};
|
|
30
|
+
__export(AriaLivePanelCenter_exports, {
|
|
31
|
+
AriaLivePanelCenter: () => AriaLivePanelCenter
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(AriaLivePanelCenter_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
+
var import_constants = require("../../../constants/index.js");
|
|
39
|
+
var import_useStore = require("../../../config/useStore/index.js");
|
|
40
|
+
var import_styles = require("../../../styles.js");
|
|
41
|
+
const StyleAriaLiveRegion = (0, import_ds_system.styled)(import_styles.StyledA11yNoVisible, {
|
|
42
|
+
name: import_constants.DSShuttleV2Name,
|
|
43
|
+
slot: import_constants.DSShuttleV2Slots.ARIA_LIVE_PANEL_CENTER
|
|
44
|
+
})``;
|
|
45
|
+
const AriaLivePanelCenter = (panelMetaInfo) => {
|
|
46
|
+
const { isDestinationPanel = false } = panelMetaInfo;
|
|
47
|
+
const isLoading = (0, import_useStore.usePropsStore)((state) => isDestinationPanel ? state.destinationIsLoading : state.sourceIsLoading);
|
|
48
|
+
const filterValue = (0, import_useStore.usePropsStore)(
|
|
49
|
+
(state) => isDestinationPanel ? state.destinationFilterValue : state.sourceFilterValue
|
|
50
|
+
);
|
|
51
|
+
const itemsLength = (0, import_useStore.usePropsStore)(
|
|
52
|
+
(state) => isDestinationPanel ? state.destinationData.length : state.sourceData.length
|
|
53
|
+
);
|
|
54
|
+
const showEmptyMessage = !isLoading && itemsLength === 0;
|
|
55
|
+
const noOptionsMessage = (0, import_useStore.usePropsStore)(
|
|
56
|
+
(state) => panelMetaInfo.isDestinationPanel ? state.destinationNoOptionsMessage : state.sourceNoOptionsMessage
|
|
57
|
+
);
|
|
58
|
+
const selectionLength = (0, import_useStore.usePropsStore)(
|
|
59
|
+
(state) => isDestinationPanel ? state.destinationSelectionItemArray.length : state.sourceSelectionItemArray.length
|
|
60
|
+
);
|
|
61
|
+
const lastFilterValueRef = (0, import_react.useRef)(filterValue);
|
|
62
|
+
const getOwnerProps = (0, import_useStore.usePropsStore)((store) => store.get);
|
|
63
|
+
const getOwnerPropsArguments = (0, import_react.useCallback)(() => panelMetaInfo, [panelMetaInfo]);
|
|
64
|
+
import_react.default.useEffect(() => {
|
|
65
|
+
lastFilterValueRef.current = filterValue;
|
|
66
|
+
}, [filterValue]);
|
|
67
|
+
const messageA11y = (0, import_react.useMemo)(() => {
|
|
68
|
+
if (showEmptyMessage && selectionLength === 0) {
|
|
69
|
+
return noOptionsMessage;
|
|
70
|
+
}
|
|
71
|
+
if (selectionLength > 0) {
|
|
72
|
+
return `${selectionLength} item${selectionLength === 1 ? "" : "s"} selected.`;
|
|
73
|
+
}
|
|
74
|
+
if (filterValue || lastFilterValueRef.current !== "" && filterValue === "") {
|
|
75
|
+
return `${itemsLength} items available.`;
|
|
76
|
+
}
|
|
77
|
+
return "";
|
|
78
|
+
}, [filterValue, itemsLength, noOptionsMessage, selectionLength, showEmptyMessage]);
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
|
+
StyleAriaLiveRegion,
|
|
81
|
+
{
|
|
82
|
+
"aria-live": "polite",
|
|
83
|
+
"aria-atomic": "true",
|
|
84
|
+
getOwnerProps,
|
|
85
|
+
getOwnerPropsArguments,
|
|
86
|
+
children: messageA11y
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=AriaLivePanelCenter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/Panel/top/AriaLivePanelCenter.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useMemo, useCallback, useRef } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../constants/index.js';\nimport { usePropsStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { StyledA11yNoVisible } from '../../../styles.js';\n\nconst StyleAriaLiveRegion = styled(StyledA11yNoVisible, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.ARIA_LIVE_PANEL_CENTER,\n})``;\n\n// This component is kept separate from SelectionHeader to keep concerns isolated.\n// Having multiple aria-live regions in the Shuttle (e.g., when selecting all items\n// and moving them across panels) may cause overlapping announcements.\n// Separating this region prevents conflicts between messages like\n// \u201Cx items selected\u201D and \u201Cno items available\u201D.\n\nexport const AriaLivePanelCenter = (panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const { isDestinationPanel = false } = panelMetaInfo;\n\n const isLoading = usePropsStore((state) => (isDestinationPanel ? state.destinationIsLoading : state.sourceIsLoading));\n\n const filterValue = usePropsStore((state) =>\n isDestinationPanel ? state.destinationFilterValue : state.sourceFilterValue,\n );\n\n const itemsLength = usePropsStore((state) =>\n isDestinationPanel ? state.destinationData.length : state.sourceData.length,\n );\n const showEmptyMessage = !isLoading && itemsLength === 0;\n\n const noOptionsMessage = usePropsStore((state) =>\n panelMetaInfo.isDestinationPanel ? state.destinationNoOptionsMessage : state.sourceNoOptionsMessage,\n );\n\n const selectionLength = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSelectionItemArray.length : state.sourceSelectionItemArray.length,\n );\n\n const lastFilterValueRef = useRef(filterValue);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n\n React.useEffect(() => {\n lastFilterValueRef.current = filterValue;\n }, [filterValue]);\n\n const messageA11y = useMemo(() => {\n if (showEmptyMessage && selectionLength === 0) {\n return noOptionsMessage;\n }\n if (selectionLength > 0) {\n return `${selectionLength} item${selectionLength === 1 ? '' : 's'} selected.`;\n }\n if (filterValue || (lastFilterValueRef.current !== '' && filterValue === '')) {\n return `${itemsLength} items available.`;\n }\n return '';\n }, [filterValue, itemsLength, noOptionsMessage, selectionLength, showEmptyMessage]);\n\n return (\n <StyleAriaLiveRegion\n aria-live=\"polite\"\n aria-atomic=\"true\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {messageA11y}\n </StyleAriaLiveRegion>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+DnB;AA/DJ,mBAAoD;AACpD,uBAAuB;AACvB,uBAAkD;AAClD,sBAA8B;AAE9B,oBAAoC;AAEpC,MAAM,0BAAsB,yBAAO,mCAAqB;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,kCAAiB;AACzB,CAAC;AAQM,MAAM,sBAAsB,CAAC,kBAA8C;AAChF,QAAM,EAAE,qBAAqB,MAAM,IAAI;AAEvC,QAAM,gBAAY,+BAAc,CAAC,UAAW,qBAAqB,MAAM,uBAAuB,MAAM,eAAgB;AAEpH,QAAM,kBAAc;AAAA,IAAc,CAAC,UACjC,qBAAqB,MAAM,yBAAyB,MAAM;AAAA,EAC5D;AAEA,QAAM,kBAAc;AAAA,IAAc,CAAC,UACjC,qBAAqB,MAAM,gBAAgB,SAAS,MAAM,WAAW;AAAA,EACvE;AACA,QAAM,mBAAmB,CAAC,aAAa,gBAAgB;AAEvD,QAAM,uBAAmB;AAAA,IAAc,CAAC,UACtC,cAAc,qBAAqB,MAAM,8BAA8B,MAAM;AAAA,EAC/E;AAEA,QAAM,sBAAkB;AAAA,IAAc,CAAC,UACrC,qBAAqB,MAAM,8BAA8B,SAAS,MAAM,yBAAyB;AAAA,EACnG;AAEA,QAAM,yBAAqB,qBAAO,WAAW;AAE7C,QAAM,oBAAgB,+BAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,6BAAyB,0BAAY,MAAM,eAAe,CAAC,aAAa,CAAC;AAE/E,eAAAA,QAAM,UAAU,MAAM;AACpB,uBAAmB,UAAU;AAAA,EAC/B,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,kBAAc,sBAAQ,MAAM;AAChC,QAAI,oBAAoB,oBAAoB,GAAG;AAC7C,aAAO;AAAA,IACT;AACA,QAAI,kBAAkB,GAAG;AACvB,aAAO,GAAG,eAAe,QAAQ,oBAAoB,IAAI,KAAK,GAAG;AAAA,IACnE;AACA,QAAI,eAAgB,mBAAmB,YAAY,MAAM,gBAAgB,IAAK;AAC5E,aAAO,GAAG,WAAW;AAAA,IACvB;AACA,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,aAAa,kBAAkB,iBAAiB,gBAAgB,CAAC;AAElF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,eAAY;AAAA,MACZ;AAAA,MACA;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -39,8 +39,8 @@ var import_ds_grid = require("@elliemae/ds-grid");
|
|
|
39
39
|
var import_useStore = require("../../../config/useStore/index.js");
|
|
40
40
|
var import_SelectionHeader = require("./SelectionHeader.js");
|
|
41
41
|
var import_PanelFilterSection = require("./PanelFilterSection.js");
|
|
42
|
-
var
|
|
43
|
-
const StyledListWrapperTop = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
|
|
42
|
+
var import_constants = require("../../../constants/index.js");
|
|
43
|
+
const StyledListWrapperTop = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSShuttleV2Name, slot: import_constants.DSShuttleV2Slots.LIST_WRAPPER_TOP })``;
|
|
44
44
|
const PanelContentTopSection = (panelMetaInfo) => {
|
|
45
45
|
const getOwnerProps = (0, import_useStore.usePropsStore)((store) => store.get);
|
|
46
46
|
const getOwnerPropsArguments = (0, import_react.useCallback)(() => panelMetaInfo, [panelMetaInfo]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Panel/top/PanelContentTopSection.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { usePropsStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { SelectionHeader } from './SelectionHeader.js';\nimport { PanelFilterSection } from './PanelFilterSection.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BnB;AA1BJ,mBAAmC;AACnC,uBAAuB;AACvB,qBAAqB;AACrB,sBAA8B;AAE9B,6BAAgC;AAChC,gCAAmC;AACnC,
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { usePropsStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { SelectionHeader } from './SelectionHeader.js';\nimport { PanelFilterSection } from './PanelFilterSection.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../constants/index.js';\n\nconst StyledListWrapperTop = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.LIST_WRAPPER_TOP })``;\n\nexport const PanelContentTopSection = (panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n\n const { isDestinationPanel = false } = panelMetaInfo;\n const isSearchBarOpen = usePropsStore((state) =>\n isDestinationPanel ? state.destinationShowSearchbar : state.sourceShowSearchbar,\n );\n const topSectionRows = React.useMemo(() => {\n const cols = [];\n if (isSearchBarOpen) cols.push('auto');\n cols.push('auto');\n return cols;\n }, [isSearchBarOpen]);\n return (\n <StyledListWrapperTop\n rows={topSectionRows}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {isSearchBarOpen ? <PanelFilterSection {...panelMetaInfo} /> : null}\n <SelectionHeader {...panelMetaInfo} />\n </StyledListWrapperTop>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BnB;AA1BJ,mBAAmC;AACnC,uBAAuB;AACvB,qBAAqB;AACrB,sBAA8B;AAE9B,6BAAgC;AAChC,gCAAmC;AACnC,uBAAkD;AAElD,MAAM,2BAAuB,yBAAO,qBAAM,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,iBAAiB,CAAC;AAErG,MAAM,yBAAyB,CAAC,kBAA8C;AACnF,QAAM,oBAAgB,+BAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,6BAAyB,0BAAY,MAAM,eAAe,CAAC,aAAa,CAAC;AAE/E,QAAM,EAAE,qBAAqB,MAAM,IAAI;AACvC,QAAM,sBAAkB;AAAA,IAAc,CAAC,UACrC,qBAAqB,MAAM,2BAA2B,MAAM;AAAA,EAC9D;AACA,QAAM,iBAAiB,aAAAA,QAAM,QAAQ,MAAM;AACzC,UAAM,OAAO,CAAC;AACd,QAAI,gBAAiB,MAAK,KAAK,MAAM;AACrC,SAAK,KAAK,MAAM;AAChB,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,CAAC;AACpB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MAEC;AAAA,0BAAkB,4CAAC,gDAAoB,GAAG,eAAe,IAAK;AAAA,QAC/D,4CAAC,0CAAiB,GAAG,eAAe;AAAA;AAAA;AAAA,EACtC;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -38,12 +38,12 @@ var import_ds_grid = require("@elliemae/ds-grid");
|
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
39
|
var import_ds_form_input_text = require("@elliemae/ds-form-input-text");
|
|
40
40
|
var import_useStore = require("../../../config/useStore/index.js");
|
|
41
|
-
var
|
|
42
|
-
const StyledSearchWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
|
|
41
|
+
var import_constants = require("../../../constants/index.js");
|
|
42
|
+
const StyledSearchWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSShuttleV2Name, slot: import_constants.DSShuttleV2Slots.AREA_SEARCH_WRAPPER })`
|
|
43
43
|
border-bottom: 1px solid neutral-400;
|
|
44
44
|
border-radius: 0;
|
|
45
45
|
`;
|
|
46
|
-
const StyledInputText = (0, import_ds_system.styled)(import_ds_form_input_text.DSInputText, { name:
|
|
46
|
+
const StyledInputText = (0, import_ds_system.styled)(import_ds_form_input_text.DSInputText, { name: import_constants.DSShuttleV2Name, slot: import_constants.DSShuttleV2Slots.AREA_SEARCH_BAR })`
|
|
47
47
|
border: none;
|
|
48
48
|
:focus {
|
|
49
49
|
border-radius: 0;
|
|
@@ -52,6 +52,7 @@ const StyledInputText = (0, import_ds_system.styled)(import_ds_form_input_text.D
|
|
|
52
52
|
const PanelFilterSection = (panelMetaInfo) => {
|
|
53
53
|
const getOwnerProps = (0, import_useStore.usePropsStore)((store) => store.get);
|
|
54
54
|
const getOwnerPropsArguments = (0, import_react.useCallback)(() => panelMetaInfo, [panelMetaInfo]);
|
|
55
|
+
const shuttleId = (0, import_useStore.useInternalStore)((state) => state.shuttleInternalId);
|
|
55
56
|
const areaSearchBarProps = (0, import_useStore.usePropsStore)((store) => store.areaSearchBarProps);
|
|
56
57
|
const { isDestinationPanel = false } = panelMetaInfo;
|
|
57
58
|
const onFilterCb = (0, import_useStore.usePropsStore)(
|
|
@@ -66,15 +67,16 @@ const PanelFilterSection = (panelMetaInfo) => {
|
|
|
66
67
|
},
|
|
67
68
|
[onFilterCb]
|
|
68
69
|
);
|
|
70
|
+
const inputTextId = isDestinationPanel ? `${import_constants.SHUTTLE_IDS.DESTINATION_PANEL_SEARCH}-${shuttleId}` : `${import_constants.SHUTTLE_IDS.SOURCE_PANEL_SEARCH}-${shuttleId}`;
|
|
69
71
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledSearchWrapper, { getOwnerProps, getOwnerPropsArguments, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
72
|
StyledInputText,
|
|
71
73
|
{
|
|
74
|
+
id: inputTextId,
|
|
72
75
|
value: filterValue,
|
|
73
76
|
onValueChange: handleFilterChange,
|
|
74
77
|
"aria-label": isDestinationPanel ? "Destination input search" : "Source input search",
|
|
75
78
|
getOwnerProps,
|
|
76
79
|
getOwnerPropsArguments,
|
|
77
|
-
autoFocus: true,
|
|
78
80
|
...areaSearchBarProps && areaSearchBarProps({ isDestinationPanel })
|
|
79
81
|
}
|
|
80
82
|
) });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Panel/top/PanelFilterSection.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { usePropsStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { usePropsStore, useInternalStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots, SHUTTLE_IDS } from '../../../constants/index.js';\n\nconst StyledSearchWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.AREA_SEARCH_WRAPPER })`\n border-bottom: 1px solid neutral-400;\n border-radius: 0;\n`;\nconst StyledInputText = styled(DSInputText, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.AREA_SEARCH_BAR })`\n border: none;\n :focus {\n border-radius: 0;\n }\n`;\n\nexport const PanelFilterSection = (panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n const shuttleId = useInternalStore((state) => state.shuttleInternalId);\n const areaSearchBarProps = usePropsStore((store) => store.areaSearchBarProps);\n const { isDestinationPanel = false } = panelMetaInfo;\n const onFilterCb = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationFilterChange : state.onSourceFilterChange,\n );\n const filterValue = usePropsStore((state) =>\n isDestinationPanel ? state.destinationFilterValue : state.sourceFilterValue,\n );\n const handleFilterChange = React.useCallback(\n (value: string | number, event: React.ChangeEvent<HTMLInputElement>) => {\n onFilterCb?.(`${value}`, { event });\n },\n [onFilterCb],\n );\n\n const inputTextId = isDestinationPanel\n ? `${SHUTTLE_IDS.DESTINATION_PANEL_SEARCH}-${shuttleId}`\n : `${SHUTTLE_IDS.SOURCE_PANEL_SEARCH}-${shuttleId}`;\n return (\n <StyledSearchWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledInputText\n id={inputTextId}\n value={filterValue}\n onValueChange={handleFilterChange}\n aria-label={isDestinationPanel ? 'Destination input search' : 'Source input search'}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n {...(areaSearchBarProps && areaSearchBarProps({ isDestinationPanel }))}\n />\n </StyledSearchWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2CjB;AA3CN,mBAAmC;AACnC,qBAAqB;AACrB,uBAAuB;AACvB,gCAA4B;AAC5B,sBAAgD;AAEhD,uBAA+D;AAE/D,MAAM,0BAAsB,yBAAO,qBAAM,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,oBAAoB,CAAC;AAAA;AAAA;AAAA;AAI9G,MAAM,sBAAkB,yBAAO,uCAAa,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOtG,MAAM,qBAAqB,CAAC,kBAA8C;AAC/E,QAAM,oBAAgB,+BAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,6BAAyB,0BAAY,MAAM,eAAe,CAAC,aAAa,CAAC;AAC/E,QAAM,gBAAY,kCAAiB,CAAC,UAAU,MAAM,iBAAiB;AACrE,QAAM,yBAAqB,+BAAc,CAAC,UAAU,MAAM,kBAAkB;AAC5E,QAAM,EAAE,qBAAqB,MAAM,IAAI;AACvC,QAAM,iBAAa;AAAA,IAAc,CAAC,UAChC,qBAAqB,MAAM,4BAA4B,MAAM;AAAA,EAC/D;AACA,QAAM,kBAAc;AAAA,IAAc,CAAC,UACjC,qBAAqB,MAAM,yBAAyB,MAAM;AAAA,EAC5D;AACA,QAAM,qBAAqB,aAAAA,QAAM;AAAA,IAC/B,CAAC,OAAwB,UAA+C;AACtE,mBAAa,GAAG,KAAK,IAAI,EAAE,MAAM,CAAC;AAAA,IACpC;AAAA,IACA,CAAC,UAAU;AAAA,EACb;AAEA,QAAM,cAAc,qBAChB,GAAG,6BAAY,wBAAwB,IAAI,SAAS,KACpD,GAAG,6BAAY,mBAAmB,IAAI,SAAS;AACnD,SACE,4CAAC,uBAAoB,eAA8B,wBACjD;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,eAAe;AAAA,MACf,cAAY,qBAAqB,6BAA6B;AAAA,MAC9D;AAAA,MACA;AAAA,MACC,GAAI,sBAAsB,mBAAmB,EAAE,mBAAmB,CAAC;AAAA;AAAA,EACtE,GACF;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -38,10 +38,11 @@ var import_ds_system = require("@elliemae/ds-system");
|
|
|
38
38
|
var import_ds_form_checkbox = require("@elliemae/ds-form-checkbox");
|
|
39
39
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
40
40
|
var import_useStore = require("../../../config/useStore/index.js");
|
|
41
|
-
var
|
|
41
|
+
var import_constants = require("../../../constants/index.js");
|
|
42
|
+
var import_AriaLivePanelCenter = require("./AriaLivePanelCenter.js");
|
|
42
43
|
const StyledSelectionHeaderWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, {
|
|
43
|
-
name:
|
|
44
|
-
slot:
|
|
44
|
+
name: import_constants.DSShuttleV2Name,
|
|
45
|
+
slot: import_constants.DSShuttleV2Slots.AREA_SELECTION_HEADER
|
|
45
46
|
})`
|
|
46
47
|
line-height: 1;
|
|
47
48
|
font-size: 1rem;
|
|
@@ -49,8 +50,8 @@ const StyledSelectionHeaderWrapper = (0, import_ds_system.styled)(import_ds_grid
|
|
|
49
50
|
border-bottom: 1px solid neutral-400;
|
|
50
51
|
`;
|
|
51
52
|
const StyledSelectionHeaderCountLabel = (0, import_ds_system.styled)("div", {
|
|
52
|
-
name:
|
|
53
|
-
slot:
|
|
53
|
+
name: import_constants.DSShuttleV2Name,
|
|
54
|
+
slot: import_constants.DSShuttleV2Slots.AREA_SELECTION_HEADER_COUNT_LABEL
|
|
54
55
|
})`
|
|
55
56
|
text-align: end;
|
|
56
57
|
color: neutral-500;
|
|
@@ -124,6 +125,7 @@ const SelectionHeader = import_react.default.memo((panelMetaInfo) => {
|
|
|
124
125
|
...checkboxSelectAllProps && checkboxSelectAllProps({ isDestinationPanel, hasMultipleSelection: selectionLength > 1 })
|
|
125
126
|
}
|
|
126
127
|
) }),
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AriaLivePanelCenter.AriaLivePanelCenter, { ...panelMetaInfo }),
|
|
127
129
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledSelectionHeaderCountLabel, { getOwnerProps, getOwnerPropsArguments, children: [
|
|
128
130
|
selectionLength,
|
|
129
131
|
" selected"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Panel/top/SelectionHeader.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback, useMemo } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSControlledCheckbox, type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { Grid } from '@elliemae/ds-grid';\nimport { usePropsStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useMemo } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSControlledCheckbox, type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { Grid } from '@elliemae/ds-grid';\nimport { usePropsStore } from '../../../config/useStore/index.js';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../constants/index.js';\nimport { AriaLivePanelCenter } from './AriaLivePanelCenter.js';\n\nconst StyledSelectionHeaderWrapper = styled(Grid, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.AREA_SELECTION_HEADER,\n})`\n line-height: 1;\n font-size: 1rem;\n background-color: neutral-000;\n border-bottom: 1px solid neutral-400;\n`;\nconst StyledSelectionHeaderCountLabel = styled('div', {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.AREA_SELECTION_HEADER_COUNT_LABEL,\n})`\n text-align: end;\n color: neutral-500;\n font-weight: 600;\n`;\n\nconst StyledCheckbox = styled(DSControlledCheckbox)``;\n\nconst wrapperCols = ['auto', '1fr'];\nexport const SelectionHeader = React.memo((panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const { isDestinationPanel = false } = panelMetaInfo;\n const selectionableItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSelectionableData : state.sourceSelectionableData,\n );\n const ids = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSelectionableIds : state.sourceSelectionableIds,\n );\n\n const checkboxSelectAllProps = usePropsStore((state) => state.checkboxSelectAllProps);\n\n const ariaControls = useMemo(\n () =>\n ids.length === 0\n ? ''\n : ids\n .split(' ')\n .map((d) => `${d}-wrapper`)\n .join(' '),\n [ids],\n );\n\n const onSelectionChange = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange,\n );\n const selectionLength = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSelectionItemArray.length : state.sourceSelectionItemArray.length,\n );\n const checkboxValue = React.useMemo(() => {\n let newVal: boolean | 'mixed' = false;\n if (selectionLength > 0)\n if (selectionLength === selectionableItems.length) newVal = true;\n else newVal = 'mixed';\n return newVal;\n }, [selectionableItems.length, selectionLength]);\n\n const handleSelectAll = React.useCallback<DSControlledCheckboxT.InternalProps['onChange']>(\n (_, event) => {\n if (checkboxValue === true) {\n onSelectionChange({}, { event });\n } else {\n const newSelection: DSShuttleV2T.InternalProps<object, object, object, object>['sourceSelectedItems'] = {};\n selectionableItems.forEach((selectableItem) => {\n newSelection[selectableItem.hydratedId] = true;\n });\n onSelectionChange(newSelection, { event });\n }\n },\n [checkboxValue, onSelectionChange, selectionableItems],\n );\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n\n return (\n <StyledSelectionHeaderWrapper\n cols={wrapperCols}\n justifyContent=\"center\"\n alignItems=\"center\"\n py=\"7px\"\n px=\"xxs2\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Grid justifyContent=\"center\" alignItems=\"center\">\n <StyledCheckbox\n checked={checkboxValue}\n aria-label={`${checkboxValue === true ? 'Deselect' : 'Select'} all ${\n isDestinationPanel ? 'destination' : 'source'\n } items`}\n onChange={handleSelectAll}\n aria-controls={ariaControls}\n // need to overwrite this becasue the default aria-labelledby is not working for axe-core\n aria-labelledby=\"\"\n disabled={selectionableItems.length === 0}\n aria-disabled={selectionableItems.length === 0}\n {...(checkboxSelectAllProps &&\n checkboxSelectAllProps({ isDestinationPanel, hasMultipleSelection: selectionLength > 1 }))}\n />\n </Grid>\n <AriaLivePanelCenter {...panelMetaInfo} />\n <StyledSelectionHeaderCountLabel getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {selectionLength} selected\n </StyledSelectionHeaderCountLabel>\n </StyledSelectionHeaderWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -40,12 +40,12 @@ var import_Header = require("./Header.js");
|
|
|
40
40
|
var import_PanelContentTopSection = require("./Panel/top/PanelContentTopSection.js");
|
|
41
41
|
var import_PanelContentMiddleSection = require("./Panel/middle/PanelContentMiddleSection.js");
|
|
42
42
|
var import_PanelContentBottomSection = require("./Panel/bottom/PanelContentBottomSection.js");
|
|
43
|
-
var
|
|
43
|
+
var import_constants = require("../constants/index.js");
|
|
44
44
|
var import_useStore = require("../config/useStore/useStore.js");
|
|
45
|
-
const StyledPanelWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
|
|
45
|
+
const StyledPanelWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSShuttleV2Name, slot: import_constants.DSShuttleV2Slots.PANEL_WRAPPER })`
|
|
46
46
|
min-width: 300px;
|
|
47
47
|
`;
|
|
48
|
-
const StyledListWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name:
|
|
48
|
+
const StyledListWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_constants.DSShuttleV2Name, slot: import_constants.DSShuttleV2Slots.LIST_WRAPPER })`
|
|
49
49
|
border: 1px solid neutral-400;
|
|
50
50
|
height: 100%;
|
|
51
51
|
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/PanelWrapper.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSShuttleV2T } from '../react-desc-prop-types.js';\nimport { Header } from './Header.js';\nimport { PanelContentTopSection } from './Panel/top/PanelContentTopSection.js';\nimport { PanelContentMiddleSection } from './Panel/middle/PanelContentMiddleSection.js';\nimport { PanelContentBottomSection } from './Panel/bottom/PanelContentBottomSection.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BjB;AA/BN,mBAAmC;AACnC,uBAAuB;AACvB,qBAAqB;AAErB,oBAAuB;AACvB,oCAAuC;AACvC,uCAA0C;AAC1C,uCAA0C;AAC1C,
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSShuttleV2T } from '../react-desc-prop-types.js';\nimport { Header } from './Header.js';\nimport { PanelContentTopSection } from './Panel/top/PanelContentTopSection.js';\nimport { PanelContentMiddleSection } from './Panel/middle/PanelContentMiddleSection.js';\nimport { PanelContentBottomSection } from './Panel/bottom/PanelContentBottomSection.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../constants/index.js';\nimport { usePropsStore } from '../config/useStore/useStore.js';\n\nconst StyledPanelWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.PANEL_WRAPPER })`\n min-width: 300px;\n`;\nconst StyledListWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.LIST_WRAPPER })`\n border: 1px solid neutral-400;\n height: 100%;\n`;\nconst panelWrapperRows = ['auto', '1fr'];\nconst listWrapperRows = ['auto', '1fr', 'auto'];\n\nexport const PanelWrapper = React.memo((panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n return (\n <StyledPanelWrapper\n rows={panelWrapperRows}\n gutter=\"xxxs\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Header {...panelMetaInfo} />\n <StyledListWrapper\n rows={listWrapperRows}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <PanelContentTopSection {...panelMetaInfo} />\n <PanelContentMiddleSection {...panelMetaInfo} />\n <PanelContentBottomSection {...panelMetaInfo} />\n </StyledListWrapper>\n </StyledPanelWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BjB;AA/BN,mBAAmC;AACnC,uBAAuB;AACvB,qBAAqB;AAErB,oBAAuB;AACvB,oCAAuC;AACvC,uCAA0C;AAC1C,uCAA0C;AAC1C,uBAAkD;AAClD,sBAA8B;AAE9B,MAAM,yBAAqB,yBAAO,qBAAM,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,cAAc,CAAC;AAAA;AAAA;AAGvG,MAAM,wBAAoB,yBAAO,qBAAM,EAAE,MAAM,kCAAiB,MAAM,kCAAiB,aAAa,CAAC;AAAA;AAAA;AAAA;AAIrG,MAAM,mBAAmB,CAAC,QAAQ,KAAK;AACvC,MAAM,kBAAkB,CAAC,QAAQ,OAAO,MAAM;AAEvC,MAAM,eAAe,aAAAA,QAAM,KAAK,CAAC,kBAA8C;AACpF,QAAM,oBAAgB,+BAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,6BAAyB,0BAAY,MAAM,eAAe,CAAC,aAAa,CAAC;AAC/E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP;AAAA,MACA;AAAA,MAEA;AAAA,oDAAC,wBAAQ,GAAG,eAAe;AAAA,QAC3B;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YAEA;AAAA,0DAAC,wDAAwB,GAAG,eAAe;AAAA,cAC3C,4CAAC,8DAA2B,GAAG,eAAe;AAAA,cAC9C,4CAAC,8DAA2B,GAAG,eAAe;AAAA;AAAA;AAAA,QAChD;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -34,7 +34,7 @@ __export(react_desc_prop_types_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
35
|
var React = __toESM(require("react"));
|
|
36
36
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
-
var
|
|
37
|
+
var import_constants = require("./constants/index.js");
|
|
38
38
|
const defaultProps = {
|
|
39
39
|
addDragAndDropFromSource: false,
|
|
40
40
|
removeDragAndDropFromDestination: false,
|
|
@@ -71,7 +71,7 @@ const defaultProps = {
|
|
|
71
71
|
getPreventMove: () => false
|
|
72
72
|
};
|
|
73
73
|
const DSShuttleV2PropTypes = {
|
|
74
|
-
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(
|
|
74
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSShuttleV2Name, import_constants.DSShuttleV2Slots),
|
|
75
75
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
76
76
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
77
77
|
sourceData: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).description(
|
|
@@ -156,7 +156,7 @@ const DSShuttleV2PropTypes = {
|
|
|
156
156
|
getPreventDrilldown: import_ds_props_helpers.PropTypes.func.description("Callback function that determines whether drilldown should be prevented for a particular item.").defaultValue(() => false),
|
|
157
157
|
getCustomRenderer: import_ds_props_helpers.PropTypes.func.description("Callback function that returns a custom renderer for each item in the list.").defaultValue(() => void 0),
|
|
158
158
|
getBatchActionableButtonProps: import_ds_props_helpers.PropTypes.func.description("Callback function that returns the props for the batch actionable button in the destination list.").defaultValue(() => ({})).signature(`(({ isDestionationPanel: boolean }) => ({ "aria-label": string }))`),
|
|
159
|
-
...(0, import_ds_props_helpers.getPropsPerDatatestIdPropTypes)(
|
|
159
|
+
...(0, import_ds_props_helpers.getPropsPerDatatestIdPropTypes)(import_constants.DSShuttleV2DataTestIds),
|
|
160
160
|
destinationNoOptionsMessage: import_ds_props_helpers.PropTypes.string.description("Custome message to be display when no matches found after filtering in destination panel").defaultValue("There are no items to display"),
|
|
161
161
|
sourceNoOptionsMessage: import_ds_props_helpers.PropTypes.string.description("Custome message to be display when no matches found after filtering in source panel").defaultValue("There are no items to display"),
|
|
162
162
|
checkboxSelectAllProps: import_ds_props_helpers.PropTypes.func.description("Function that returns props for the select all checkbox in the source panel.").defaultValue({}),
|