@elliemae/ds-shuttle-v2 3.70.0-next.4 → 3.70.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/DSShuttleV2.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/index.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/useDataStructure.js.map +2 -2
- package/dist/cjs/config/useStore/useStore.js.map +1 -1
- package/dist/cjs/config/useValidateProps.js.map +2 -2
- package/dist/cjs/constants/index.js +3 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/exported-related/ShuttleItem.js +27 -3
- package/dist/cjs/exported-related/ShuttleItem.js.map +2 -2
- package/dist/cjs/parts/Dnd/DndHandle.js +47 -21
- package/dist/cjs/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/cjs/parts/Dnd/DragOverlay.js +1 -1
- package/dist/cjs/parts/Dnd/DragOverlay.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +16 -14
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/cjs/parts/Item/Item.js +29 -68
- package/dist/cjs/parts/Item/Item.js.map +3 -3
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js +19 -5
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/{useInnerRefHandlers.js → useInnerRefActionHandlers.js} +6 -6
- package/dist/cjs/parts/Item/ItemActions/useInnerRefActionHandlers.js.map +7 -0
- package/dist/cjs/parts/Item/ItemMiddleSection.js +1 -0
- package/dist/cjs/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Item/ItemSelectionUi/CheckboxSelectionUI.js +72 -0
- package/dist/cjs/parts/Item/ItemSelectionUi/CheckboxSelectionUI.js.map +7 -0
- package/dist/cjs/parts/Item/ItemSelectionUi/ItemSelectionUI.js +83 -0
- package/dist/cjs/parts/Item/ItemSelectionUi/ItemSelectionUI.js.map +7 -0
- package/dist/cjs/parts/{HoC/withConditionalUseSortable.js → Item/ItemSelectionUi/ItemSelectionUI.types.js} +3 -18
- package/dist/cjs/parts/Item/ItemSelectionUi/ItemSelectionUI.types.js.map +7 -0
- package/dist/cjs/parts/Item/{ItemSelection.js → ItemSelectionUi/VerticalBarSelectionUI.js} +14 -12
- package/dist/cjs/parts/Item/ItemSelectionUi/VerticalBarSelectionUI.js.map +7 -0
- package/dist/cjs/parts/Item/useItemInnerRefHandlers.js +73 -0
- package/dist/cjs/parts/Item/useItemInnerRefHandlers.js.map +7 -0
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/{useInnerRefHandlers.js → useLoadMoreBtnInnerRefHandlers.js} +6 -6
- package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnInnerRefHandlers.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +65 -33
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +2 -2
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +8 -4
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/slot-props.js +181 -0
- package/dist/cjs/typescript-testing/slot-props.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid-with-datum.js +159 -0
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid-with-datum.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid.js +0 -1
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid.js.map +2 -2
- package/dist/esm/DSShuttleV2.js.map +2 -2
- package/dist/esm/config/useAutoCalculated/index.js.map +2 -2
- package/dist/esm/config/useAutoCalculated/useDataStructure.js.map +2 -2
- package/dist/esm/config/useStore/useStore.js.map +1 -1
- package/dist/esm/config/useValidateProps.js.map +2 -2
- package/dist/esm/constants/index.js +3 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/exported-related/ShuttleItem.js +28 -4
- package/dist/esm/exported-related/ShuttleItem.js.map +2 -2
- package/dist/esm/parts/Dnd/DndHandle.js +48 -22
- package/dist/esm/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/esm/parts/Dnd/DragOverlay.js +1 -1
- package/dist/esm/parts/Dnd/DragOverlay.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +16 -14
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/esm/parts/Item/Item.js +30 -69
- package/dist/esm/parts/Item/Item.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/ItemActions.js +19 -5
- package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/{useInnerRefHandlers.js → useInnerRefActionHandlers.js} +3 -3
- package/dist/esm/parts/Item/ItemActions/useInnerRefActionHandlers.js.map +7 -0
- package/dist/esm/parts/Item/ItemMiddleSection.js +1 -0
- package/dist/esm/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/esm/parts/Item/ItemSelectionUi/CheckboxSelectionUI.js +42 -0
- package/dist/esm/parts/Item/ItemSelectionUi/CheckboxSelectionUI.js.map +7 -0
- package/dist/esm/parts/Item/ItemSelectionUi/ItemSelectionUI.js +53 -0
- package/dist/esm/parts/Item/ItemSelectionUi/ItemSelectionUI.js.map +7 -0
- package/dist/esm/parts/Item/ItemSelectionUi/ItemSelectionUI.types.js +2 -0
- package/dist/esm/parts/Item/ItemSelectionUi/ItemSelectionUI.types.js.map +7 -0
- package/dist/esm/parts/Item/{ItemSelection.js → ItemSelectionUi/VerticalBarSelectionUI.js} +11 -9
- package/dist/esm/parts/Item/ItemSelectionUi/VerticalBarSelectionUI.js.map +7 -0
- package/dist/esm/parts/Item/useItemInnerRefHandlers.js +43 -0
- package/dist/esm/parts/Item/useItemInnerRefHandlers.js.map +7 -0
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +2 -2
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/esm/parts/Panel/bottom/{useInnerRefHandlers.js → useLoadMoreBtnInnerRefHandlers.js} +3 -3
- package/dist/esm/parts/Panel/bottom/useLoadMoreBtnInnerRefHandlers.js.map +7 -0
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +66 -34
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +2 -2
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/esm/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +8 -4
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/slot-props.js +158 -0
- package/dist/esm/typescript-testing/slot-props.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid-with-datum.js +136 -0
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid-with-datum.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid.js +0 -1
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid.js.map +2 -2
- package/dist/types/DSShuttleV2.d.ts +2 -2
- package/dist/types/config/useAutoCalculated/index.d.ts +7 -7
- package/dist/types/config/useAutoCalculated/useDataStructure.d.ts +7 -7
- package/dist/types/config/useStore/useStore.d.ts +64 -64
- package/dist/types/config/useValidateProps.d.ts +1 -1
- package/dist/types/constants/index.d.ts +6 -2
- package/dist/types/parts/Dnd/DndHandle.d.ts +3 -10
- package/dist/types/parts/Item/Item.d.ts +1 -5
- package/dist/types/parts/Item/ItemActions/{useInnerRefHandlers.d.ts → useInnerRefActionHandlers.d.ts} +1 -1
- package/dist/types/parts/Item/ItemSelectionUi/CheckboxSelectionUI.d.ts +2 -0
- package/dist/types/parts/Item/ItemSelectionUi/ItemSelectionUI.d.ts +2 -0
- package/dist/types/parts/Item/ItemSelectionUi/ItemSelectionUI.types.d.ts +11 -0
- package/dist/types/parts/Item/ItemSelectionUi/VerticalBarSelectionUI.d.ts +2 -0
- package/dist/types/parts/Item/useItemInnerRefHandlers.d.ts +5 -0
- package/dist/types/parts/Panel/bottom/{useInnerRefHandlers.d.ts → useLoadMoreBtnInnerRefHandlers.d.ts} +1 -1
- package/dist/types/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.d.ts +2 -2
- package/dist/types/react-desc-prop-types.d.ts +111 -57
- package/package.json +25 -25
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js.map +0 -7
- package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js.map +0 -7
- package/dist/cjs/parts/Item/ItemSelection.js.map +0 -7
- package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js.map +0 -7
- package/dist/esm/parts/HoC/withConditionalUseSortable.js +0 -13
- package/dist/esm/parts/HoC/withConditionalUseSortable.js.map +0 -7
- package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js.map +0 -7
- package/dist/esm/parts/Item/ItemSelection.js.map +0 -7
- package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js.map +0 -7
- package/dist/types/parts/HoC/withConditionalUseSortable.d.ts +0 -9
- package/dist/types/parts/Item/ItemSelection.d.ts +0 -3
- package/dist/types/tests/DSShuttlev2.PUI-16059.test.d.ts +0 -1
- package/dist/types/tests/configs/ControlledTestRender.d.ts +0 -1
- package/dist/types/tests/configs/basic.d.ts +0 -24
- package/dist/types/tests/configs/breadcrumb.d.ts +0 -1
- package/dist/types/tests/configs/dnd.d.ts +0 -1
- package/dist/types/tests/configs/filter.d.ts +0 -30
- package/dist/types/tests/configs/loadMore.d.ts +0 -28
- package/dist/types/tests/configs/soft-delete.d.ts +0 -1
- package/dist/types/tests/loadMore/ShuttleV2WithLoadMoreTestable.d.ts +0 -2
- package/dist/types/tests/loadMore/shuttle-v2.load-more.focus.test.d.ts +0 -1
- package/dist/types/tests/loadMore/shuttle-v2.load-more.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.a11y.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.data-testid.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.dnd.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.events.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.exports.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.get-owner-props.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.keyboard.test.d.ts +0 -1
- package/dist/types/tests/shuttle-v2.soft-delete.test.d.ts +0 -1
- package/dist/types/typescript-testing/typescript-shuttle-v2-valid.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Dnd/DndHandle.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { mergeRefs, styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { usePropsStore } from '../../config/useStore/useStore.js';\nimport { DATA_TESTID, DSShuttleV2Name, DSShuttleV2Slots } from '../../constants/index.js';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types.js';\n\nexport const StyledGripperButtonOrOverlay = styled('div', {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.DRAG_AND_DROP_HANDLE,\n})<{\n isActive: boolean;\n isDragOverlay?: boolean;\n disabled?: boolean;\n}>`\n cursor: ${({ isActive, isDragOverlay, disabled }) => {\n if (isActive || isDragOverlay) return 'grabbing';\n if (disabled) return 'not-allowed';\n return 'grab';\n }};\n outline: none;\n display: flex;\n align-items: center;\n touch-action: none;\n display: flex;\n min-width: 24px;\n justify-content: center;\n &:focus {\n .em-ds-icon {\n outline: 2px solid brand-700;\n }\n }\n`;\n\nexport const StyledGripperWrapper = styled('div', {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.DRAG_AND_DROP_HANDLE_WRAPPER,\n})`\n display: flex;\n height: 100%;\n position: relative;\n`;\n\nexport const DragHandle: React.ComponentType<DSShuttleV2T.DragHandleArguments> = (props) => {\n const { id, isDndActive, isDragging, disabled = false, innerRef, useSortableHelpers, ariaLabelledby } = props;\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => props, [props]);\n\n // Interacting with the drag handle must not bubble up to the row's onClick (selectItem) /\n // onMouseDown handlers \u2014 grabbing the handle should not toggle item selection.\n const stopPropagation = React.useCallback((event: React.SyntheticEvent) => {\n event.stopPropagation();\n }, []);\n\n return (\n <StyledGripperWrapper\n onClick={stopPropagation}\n onMouseDown={stopPropagation}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledGripperButtonOrOverlay\n {...(!disabled && useSortableHelpers\n ? {\n ...useSortableHelpers.listeners,\n ...useSortableHelpers.attributes,\n }\n : {})}\n aria-labelledby={ariaLabelledby}\n isActive={isDndActive}\n innerRef={mergeRefs(innerRef, useSortableHelpers?.setActivatorNodeRef)}\n tabIndex={-1}\n data-testid={DATA_TESTID.SHUTTLE_DRAG_HANDLE}\n id={`${id}-drag-handle`}\n key={`${id}-drag-handle`}\n disabled={disabled}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <GripperVertical color={isDragging || disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledGripperButton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B,mBAAmB;AAAA,UACrE,UAAU;AAAA,UACV,eAAa,YAAY;AAAA,UACzB,IAAI,GAAG,EAAE;AAAA,UACT,KAAK,GAAG,EAAE;AAAA,UACV;AAAA,UACA;AAAA,UACA;AAAA;AAAA,QAEA,oBAAC,mBAAgB,OAAO,cAAc,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG;AAAA,MAClG;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -11,7 +11,7 @@ const DragOverlay = ({ id, isDragging, isDndActive }) => /* @__PURE__ */ jsx(
|
|
|
11
11
|
tabIndex: -1,
|
|
12
12
|
"data-testid": DATA_TESTID.SHUTTLE_DRAG_HANDLE,
|
|
13
13
|
id: `${id}-drag-overlay`,
|
|
14
|
-
children: /* @__PURE__ */ jsx(GripperVertical, {
|
|
14
|
+
children: /* @__PURE__ */ jsx(GripperVertical, { color: isDragging ? ["neutral", "500"] : ["brand-primary", "800"] })
|
|
15
15
|
},
|
|
16
16
|
`${id}-drag-overlay`
|
|
17
17
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Dnd/DragOverlay.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { DATA_TESTID } from '../../constants/index.js';\nimport { StyledGripperButtonOrOverlay } from './DndHandle.js';\n\nexport const DragOverlay: React.ComponentType<{\n id: string;\n isDndActive: boolean;\n isDragging: boolean;\n}> = ({ id, isDragging, isDndActive }) => (\n <StyledGripperButtonOrOverlay\n isDragOverlay\n isActive={isDndActive}\n tabIndex={-1}\n data-testid={DATA_TESTID.SHUTTLE_DRAG_HANDLE}\n id={`${id}-drag-overlay`}\n key={`${id}-drag-overlay`}\n >\n <GripperVertical
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACkBnB;AAjBJ,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,oCAAoC;AAEtC,MAAM,cAIR,CAAC,EAAE,IAAI,YAAY,YAAY,MAClC;AAAA,EAAC;AAAA;AAAA,IACC,eAAa;AAAA,IACb,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAa,YAAY;AAAA,IACzB,IAAI,GAAG,EAAE;AAAA,IAGT,8BAAC,mBAAgB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { DATA_TESTID } from '../../constants/index.js';\nimport { StyledGripperButtonOrOverlay } from './DndHandle.js';\n\nexport const DragOverlay: React.ComponentType<{\n id: string;\n isDndActive: boolean;\n isDragging: boolean;\n}> = ({ id, isDragging, isDndActive }) => (\n <StyledGripperButtonOrOverlay\n isDragOverlay\n isActive={isDndActive}\n tabIndex={-1}\n data-testid={DATA_TESTID.SHUTTLE_DRAG_HANDLE}\n id={`${id}-drag-overlay`}\n key={`${id}-drag-overlay`}\n >\n <GripperVertical color={isDragging ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledGripperButtonOrOverlay>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkBnB;AAjBJ,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,oCAAoC;AAEtC,MAAM,cAIR,CAAC,EAAE,IAAI,YAAY,YAAY,MAClC;AAAA,EAAC;AAAA;AAAA,IACC,eAAa;AAAA,IACb,UAAU;AAAA,IACV,UAAU;AAAA,IACV,eAAa,YAAY;AAAA,IACzB,IAAI,GAAG,EAAE;AAAA,IAGT,8BAAC,mBAAgB,OAAO,aAAa,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,EAF/E,GAAG,EAAE;AAGZ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -6,14 +6,11 @@ import { DndContext, DragOverlay, SortableContext, useTreeDndkitConfig } from "@
|
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
7
|
import { useInternalStore, usePropsStore } from "../../config/useStore/index.js";
|
|
8
8
|
import { ItemOverlay } from "../Item/ItemOverlay.js";
|
|
9
|
-
const
|
|
9
|
+
const DnDRowContext = ({ Component, ...props }) => {
|
|
10
10
|
const { isDestinationPanel } = props;
|
|
11
11
|
const itemList = usePropsStore(
|
|
12
12
|
(state) => isDestinationPanel ? state.destinationConfiguredData : state.sourceConfiguredData
|
|
13
13
|
);
|
|
14
|
-
const withDragNDrop = usePropsStore(
|
|
15
|
-
(state) => isDestinationPanel ? !state.removeDragAndDropFromDestination : state.addDragAndDropFromSource
|
|
16
|
-
);
|
|
17
14
|
const theme = useContext(ThemeContext);
|
|
18
15
|
const setDndDraggingItemMeta = useInternalStore((state) => state.setDndDraggingItemMeta);
|
|
19
16
|
const dndDraggingItemMeta = useInternalStore((state) => state.dndDraggingItemMeta);
|
|
@@ -37,7 +34,6 @@ const withConditionalDnDRowContext = (Component) => (props) => {
|
|
|
37
34
|
);
|
|
38
35
|
const treeConfig = React2.useMemo(() => {
|
|
39
36
|
const configuredItemList = itemList.map((item, i) => ({
|
|
40
|
-
// dnd
|
|
41
37
|
uid: item.hydratedId,
|
|
42
38
|
depth: 0,
|
|
43
39
|
parentId: null,
|
|
@@ -78,15 +74,21 @@ const withConditionalDnDRowContext = (Component) => (props) => {
|
|
|
78
74
|
setLastActiveId,
|
|
79
75
|
setOverId
|
|
80
76
|
]);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
return /* @__PURE__ */ jsx(DndContext, { ...dndContextProps, children: /* @__PURE__ */ jsxs(SortableContext, { ...containerSortableContextProps, children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Component, { ...props }),
|
|
79
|
+
createPortal(
|
|
80
|
+
/* @__PURE__ */ jsx(DragOverlay, { style: { width: "auto" }, zIndex: theme.zIndex.tooltip, children: dndDraggingItemMeta ? /* @__PURE__ */ jsx(ItemOverlay, { ...dndDraggingItemMeta }) : null }),
|
|
81
|
+
document.body
|
|
82
|
+
)
|
|
83
|
+
] }) });
|
|
84
|
+
};
|
|
85
|
+
const withConditionalDnDRowContext = (Component) => (props) => {
|
|
86
|
+
const { isDestinationPanel } = props;
|
|
87
|
+
const withDragNDrop = usePropsStore(
|
|
88
|
+
(state) => isDestinationPanel ? !state.removeDragAndDropFromDestination : state.addDragAndDropFromSource
|
|
89
|
+
);
|
|
90
|
+
if (!withDragNDrop) return /* @__PURE__ */ jsx(Component, { ...props });
|
|
91
|
+
return /* @__PURE__ */ jsx(DnDRowContext, { Component, ...props });
|
|
90
92
|
};
|
|
91
93
|
export {
|
|
92
94
|
withConditionalDnDRowContext
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/HoC/withConditionalDnDRowContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-statements */\n/* eslint-disable max-params */\n/* eslint-disable react/function-component-definition */\nimport React, { useCallback, useContext, useEffect } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { ThemeContext } from '@xstyled/styled-components';\nimport type { DnDKitTree } from '@elliemae/ds-drag-and-drop';\nimport { DndContext, DragOverlay, SortableContext, useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { createPortal } from 'react-dom';\nimport { useInternalStore, usePropsStore } from '../../config/useStore/index.js';\nimport type { DSShuttleV2T } from '../../react-desc-prop-types.js';\nimport { ItemOverlay } from '../Item/ItemOverlay.js';\n\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable max-statements */\n/* eslint-disable max-params */\n/* eslint-disable react/function-component-definition */\nimport React, { useCallback, useContext, useEffect } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { ThemeContext } from '@xstyled/styled-components';\nimport type { DnDKitTree } from '@elliemae/ds-drag-and-drop';\nimport { DndContext, DragOverlay, SortableContext, useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { createPortal } from 'react-dom';\nimport { useInternalStore, usePropsStore } from '../../config/useStore/index.js';\nimport type { DSShuttleV2T } from '../../react-desc-prop-types.js';\nimport { ItemOverlay } from '../Item/ItemOverlay.js';\n\ntype HoCConfig = DSShuttleV2T.PanelMetaInfo;\ntype InternalHoCStates = {\n activeId?: DSShuttleV2T.HydratedId;\n overId?: DSShuttleV2T.HydratedId;\n isDropValid?: boolean;\n};\ntype ResultComponentProps = DSShuttleV2T.PanelMetaInfo & InternalHoCStates;\n\ntype DnDRowContextProps = DSShuttleV2T.PanelMetaInfo & {\n Component: React.ComponentType<ResultComponentProps>;\n};\n\n// Only mounts when DnD is enabled \u2014 all DnD machinery is paid here and nowhere else\nconst DnDRowContext = ({ Component, ...props }: DnDRowContextProps) => {\n const { isDestinationPanel } = props;\n const itemList = usePropsStore((state) =>\n isDestinationPanel ? state.destinationConfiguredData : state.sourceConfiguredData,\n );\n\n const theme = useContext(ThemeContext);\n\n const setDndDraggingItemMeta = useInternalStore((state) => state.setDndDraggingItemMeta);\n const dndDraggingItemMeta = useInternalStore((state) => state.dndDraggingItemMeta);\n const setOverId = useInternalStore((state) => state.setOverId);\n const setIsDropValid = useInternalStore((state) => state.setIsDropValid);\n const setDndDraggingItem = useInternalStore((state) => state.setDndDraggingItem);\n const setLastActiveId = useInternalStore((state) => state.setLastActiveId);\n const setDropIndicatorPosition = useInternalStore((state) => state.setDropIndicatorPosition);\n\n const onItemsReorder = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationReorder : state.onSourceReorder,\n );\n\n const onReorder: DnDKitTree.OnReorder<DSShuttleV2T.ConfiguredDatum> = useCallback(\n (dndActive, targetIndex, metadata) => {\n // eslint-disable-next-line no-unused-vars\n const { considerExpanding, over: dndOver, ...dndData } = metadata;\n const over = dndOver.original.original;\n const active = dndActive.original.original;\n const cleanedMetaData = { ...dndData, over, active, targetIndex };\n onItemsReorder(active, cleanedMetaData);\n },\n [onItemsReorder],\n );\n\n const treeConfig = React.useMemo(() => {\n const configuredItemList = itemList.map((item, i) => ({\n uid: item.hydratedId,\n depth: 0,\n parentId: null,\n realIndex: i,\n childrenCount: 0,\n original: item,\n subitems: [],\n index: i,\n }));\n return {\n flattenedItems: configuredItemList,\n isHorizontalDnD: false,\n isExpandable: false,\n onReorder,\n maxDragAndDropLevel: 0,\n getIsDropValid: () => true,\n };\n }, [itemList, onReorder]);\n\n const { dndContextProps, sortableContextProps, activeItem, active, over, dropIndicatorPosition, isDropValid } =\n useTreeDndkitConfig(treeConfig);\n\n const containerSortableContextProps = sortableContextProps.root;\n\n useEffect(() => {\n setLastActiveId(active?.id?.toString() ?? '');\n setOverId(over?.id?.toString() ?? '');\n setIsDropValid(isDropValid);\n setDndDraggingItem(activeItem?.original ?? null);\n setDropIndicatorPosition(dropIndicatorPosition);\n if (!active) setDndDraggingItemMeta(null);\n }, [\n active,\n activeItem,\n dropIndicatorPosition,\n isDropValid,\n over,\n setDndDraggingItem,\n setDndDraggingItemMeta,\n setDropIndicatorPosition,\n setIsDropValid,\n setLastActiveId,\n setOverId,\n ]);\n\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...containerSortableContextProps}>\n <Component {...props} />\n {createPortal(\n <DragOverlay style={{ width: 'auto' }} zIndex={theme.zIndex.tooltip}>\n {dndDraggingItemMeta ? <ItemOverlay {...dndDraggingItemMeta} /> : null}\n </DragOverlay>,\n document.body,\n )}\n </SortableContext>\n </DndContext>\n );\n};\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: TypescriptHelpersT.ReactFunctionalHOCWithDifferentInterface<\n HoCConfig,\n ResultComponentProps\n> = (Component) => (props) => {\n const { isDestinationPanel } = props;\n const withDragNDrop = usePropsStore((state) =>\n isDestinationPanel ? !state.removeDragAndDropFromDestination : state.addDragAndDropFromSource,\n );\n\n if (!withDragNDrop) return <Component {...props} />;\n return <DnDRowContext Component={Component} {...props} />;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4GjB,SACE,KADF;AAxGN,OAAOA,UAAS,aAAa,YAAY,iBAAiB;AAE1D,SAAS,oBAAoB;AAE7B,SAAS,YAAY,aAAa,iBAAiB,2BAA2B;AAC9E,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,qBAAqB;AAEhD,SAAS,mBAAmB;AAe5B,MAAM,gBAAgB,CAAC,EAAE,WAAW,GAAG,MAAM,MAA0B;AACrE,QAAM,EAAE,mBAAmB,IAAI;AAC/B,QAAM,WAAW;AAAA,IAAc,CAAC,UAC9B,qBAAqB,MAAM,4BAA4B,MAAM;AAAA,EAC/D;AAEA,QAAM,QAAQ,WAAW,YAAY;AAErC,QAAM,yBAAyB,iBAAiB,CAAC,UAAU,MAAM,sBAAsB;AACvF,QAAM,sBAAsB,iBAAiB,CAAC,UAAU,MAAM,mBAAmB;AACjF,QAAM,YAAY,iBAAiB,CAAC,UAAU,MAAM,SAAS;AAC7D,QAAM,iBAAiB,iBAAiB,CAAC,UAAU,MAAM,cAAc;AACvE,QAAM,qBAAqB,iBAAiB,CAAC,UAAU,MAAM,kBAAkB;AAC/E,QAAM,kBAAkB,iBAAiB,CAAC,UAAU,MAAM,eAAe;AACzE,QAAM,2BAA2B,iBAAiB,CAAC,UAAU,MAAM,wBAAwB;AAE3F,QAAM,iBAAiB;AAAA,IAAc,CAAC,UACpC,qBAAqB,MAAM,uBAAuB,MAAM;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;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SACE,oBAAC,cAAY,GAAG,iBACd,+BAAC,mBAAiB,GAAG,+BACnB;AAAA,wBAAC,aAAW,GAAG,OAAO;AAAA,IACrB;AAAA,MACC,oBAAC,eAAY,OAAO,EAAE,OAAO,OAAO,GAAG,QAAQ,MAAM,OAAO,SACzD,gCAAsB,oBAAC,eAAa,GAAG,qBAAqB,IAAK,MACpE;AAAA,MACA,SAAS;AAAA,IACX;AAAA,KACF,GACF;AAEJ;AAGO,MAAM,+BAGT,CAAC,cAAc,CAAC,UAAU;AAC5B,QAAM,EAAE,mBAAmB,IAAI;AAC/B,QAAM,gBAAgB;AAAA,IAAc,CAAC,UACnC,qBAAqB,CAAC,MAAM,mCAAmC,MAAM;AAAA,EACvE;AAEA,MAAI,CAAC,cAAe,QAAO,oBAAC,aAAW,GAAG,OAAO;AACjD,SAAO,oBAAC,iBAAc,WAAuB,GAAG,OAAO;AACzD;",
|
|
6
6
|
"names": ["React", "over", "active"]
|
|
7
7
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useSortable } from "@elliemae/ds-drag-and-drop";
|
|
3
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
4
5
|
import { useHeadlessTooltip } from "@elliemae/ds-hooks-headless-tooltip";
|
|
5
6
|
import { css, styled } from "@elliemae/ds-system";
|
|
6
|
-
import React2, {
|
|
7
|
+
import React2, { useMemo } from "react";
|
|
7
8
|
import { useInternalStore, usePropsStore } from "../../config/useStore/index.js";
|
|
8
|
-
import {
|
|
9
|
+
import { DSShuttleV2Name, DSShuttleV2Slots } from "../../constants/index.js";
|
|
9
10
|
import { DragHandle } from "../Dnd/DndHandle.js";
|
|
10
11
|
import { DropIndicator } from "../Dnd/DropIndicator.js";
|
|
11
|
-
import { withConditionalUseSortable } from "../HoC/withConditionalUseSortable.js";
|
|
12
12
|
import { ItemActions } from "./ItemActions/index.js";
|
|
13
|
-
import {
|
|
13
|
+
import { useInnerRefActionHandlers } from "./ItemActions/useInnerRefActionHandlers.js";
|
|
14
14
|
import { ItemMiddleSection } from "./ItemMiddleSection.js";
|
|
15
|
-
import {
|
|
15
|
+
import { ItemSelectionUI } from "./ItemSelectionUi/ItemSelectionUI.js";
|
|
16
16
|
import { useItemArrowNavigation } from "./useItemArrowNavigation.js";
|
|
17
|
+
import { useItemInnerRefHandlers } from "./useItemInnerRefHandlers.js";
|
|
17
18
|
import { useItemKeyboardSelection } from "./useItemKeyboardSelection.js";
|
|
18
19
|
import { useSelectionLogic } from "./useSelectionLogic.js";
|
|
19
|
-
import { useThisItemIsFocused } from "./useThisItemIsFocused.js";
|
|
20
20
|
const cssDisabled = css`
|
|
21
21
|
background-color: ${({ theme }) => theme.colors.neutral["100"]};
|
|
22
22
|
color: ${({ theme }) => theme.colors.neutral["300"]};
|
|
@@ -50,53 +50,17 @@ const ItemWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots
|
|
|
50
50
|
|
|
51
51
|
${({ isDragging }) => isDragging && cssDisabled}
|
|
52
52
|
`;
|
|
53
|
-
const ItemSelectionWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_CHECKBOX })`
|
|
54
|
-
height: 100%;
|
|
55
|
-
&:focus {
|
|
56
|
-
outline: none;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const useInnerRefHandlers = (itemMeta) => {
|
|
60
|
-
const { datumInternalMeta, isDestinationPanel } = itemMeta;
|
|
61
|
-
const { hydratedId } = datumInternalMeta;
|
|
62
|
-
const setZustandRef = useInternalStore((state) => state.setZustandRef);
|
|
63
|
-
const setDeferFocusUntilFirstRender = useInternalStore((state) => state.setDeferFocusUntilFirstRender);
|
|
64
|
-
const deferedAfterFirstRender = useInternalStore((state) => state.getDeferFocusUntilFirstRender());
|
|
65
|
-
const isLoadingMore = usePropsStore(
|
|
66
|
-
(state) => isDestinationPanel ? state.destinationIsLoadingMore : state.sourceIsLoadingMore
|
|
67
|
-
);
|
|
68
|
-
const thisItemIsFocused = useThisItemIsFocused(itemMeta);
|
|
69
|
-
const currRegion = isDestinationPanel ? REGIONS_FOCUSES.DESTINATION_PANEL_ITEM : REGIONS_FOCUSES.SOURCE_PANEL_ITEM;
|
|
70
|
-
const currItemId = hydratedId;
|
|
71
|
-
const innerRefHandlerParentItem = React2.useCallback(
|
|
72
|
-
(node) => {
|
|
73
|
-
setZustandRef([currRegion, currItemId, "parent"], node);
|
|
74
|
-
if (deferedAfterFirstRender && thisItemIsFocused && node) {
|
|
75
|
-
setDeferFocusUntilFirstRender(false);
|
|
76
|
-
if (node.tabIndex === -1) node.tabIndex = 0;
|
|
77
|
-
node.focus();
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
[setZustandRef, currRegion, currItemId, thisItemIsFocused, deferedAfterFirstRender, setDeferFocusUntilFirstRender]
|
|
81
|
-
);
|
|
82
|
-
useEffect(
|
|
83
|
-
() => () => {
|
|
84
|
-
if (isLoadingMore) setDeferFocusUntilFirstRender(true);
|
|
85
|
-
},
|
|
86
|
-
[isLoadingMore, setDeferFocusUntilFirstRender]
|
|
87
|
-
);
|
|
88
|
-
return React2.useMemo(
|
|
89
|
-
() => ({ innerRefHandlerParentItem, thisItemIsFocused }),
|
|
90
|
-
[innerRefHandlerParentItem, thisItemIsFocused]
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
53
|
const Item = React2.memo((itemMeta) => {
|
|
94
54
|
const { datumInternalMeta, withDragNDrop, useSortableHelpers, hasMultipleSelection } = itemMeta;
|
|
95
|
-
const {
|
|
55
|
+
const { hydratedId, softDeleted } = datumInternalMeta;
|
|
56
|
+
const explicitSelectionUI = usePropsStore((store) => store.explicitSelectionUI);
|
|
96
57
|
const cols = useMemo(() => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
58
|
+
const selectionUIWidth = explicitSelectionUI ? "auto" : "5px";
|
|
59
|
+
const finalCols = [selectionUIWidth];
|
|
60
|
+
if (withDragNDrop) finalCols.push("auto");
|
|
61
|
+
finalCols.push("1fr", "auto");
|
|
62
|
+
return finalCols;
|
|
63
|
+
}, [withDragNDrop, explicitSelectionUI]);
|
|
100
64
|
const setDndDraggingItemMeta = useInternalStore((state) => state.setDndDraggingItemMeta);
|
|
101
65
|
const getIsDragAndDropHappening = useInternalStore((state) => state.getIsDragAndDropHappening);
|
|
102
66
|
const isDraggingThisItem = useInternalStore((state) => state.dndDraggingItem?.hydratedId === hydratedId);
|
|
@@ -118,7 +82,8 @@ const Item = React2.memo((itemMeta) => {
|
|
|
118
82
|
},
|
|
119
83
|
[onItemKeyDownSelection, onItemContainerKeyDown]
|
|
120
84
|
);
|
|
121
|
-
const
|
|
85
|
+
const itemInnerRefHandlers = useItemInnerRefHandlers(itemMeta);
|
|
86
|
+
const { thisItemIsFocused } = itemInnerRefHandlers;
|
|
122
87
|
const { innerRefHandlerDnd } = useInnerRefActionHandlers(itemMeta);
|
|
123
88
|
const overId = useInternalStore((state) => state.overId);
|
|
124
89
|
const isDropValid = useInternalStore((state) => state.isDropValid);
|
|
@@ -128,7 +93,6 @@ const Item = React2.memo((itemMeta) => {
|
|
|
128
93
|
});
|
|
129
94
|
const config = React2.useMemo(() => ({ hasFocus: thisItemIsFocused }), [thisItemIsFocused]);
|
|
130
95
|
const tooltipHelpers = useHeadlessTooltip(config);
|
|
131
|
-
const idItem = useMemo(() => `${hydratedId}-wrapper${softDeleted ? "-soft-deleted" : ""}`, [hydratedId, softDeleted]);
|
|
132
96
|
const getOwnerProps = usePropsStore((store) => store.get);
|
|
133
97
|
const getOwnerPropsArguments = React2.useCallback(() => itemMeta, [itemMeta]);
|
|
134
98
|
return /* @__PURE__ */ jsxs(
|
|
@@ -152,19 +116,11 @@ const Item = React2.memo((itemMeta) => {
|
|
|
152
116
|
getOwnerPropsArguments,
|
|
153
117
|
children: [
|
|
154
118
|
/* @__PURE__ */ jsx(
|
|
155
|
-
|
|
119
|
+
ItemSelectionUI,
|
|
156
120
|
{
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
onBlur: tooltipHelpers.onBlur,
|
|
161
|
-
"aria-labelledby": `${hydratedId}-text-section${softDeleted ? "-soft-deleted" : ""}`,
|
|
162
|
-
id: idItem,
|
|
163
|
-
innerRef: innerRefHandlerParentItem,
|
|
164
|
-
"aria-disabled": softDeleted,
|
|
165
|
-
getOwnerProps,
|
|
166
|
-
getOwnerPropsArguments,
|
|
167
|
-
children: /* @__PURE__ */ jsx(ItemSelection, { ...itemMeta })
|
|
121
|
+
tooltipHelpers,
|
|
122
|
+
itemInnerRefHandlers,
|
|
123
|
+
itemMeta
|
|
168
124
|
}
|
|
169
125
|
),
|
|
170
126
|
withDragNDrop && useSortableHelpers ? /* @__PURE__ */ jsx(
|
|
@@ -186,11 +142,16 @@ const Item = React2.memo((itemMeta) => {
|
|
|
186
142
|
}
|
|
187
143
|
);
|
|
188
144
|
});
|
|
189
|
-
const
|
|
190
|
-
|
|
145
|
+
const ItemWithSortable = (props) => {
|
|
146
|
+
const {
|
|
147
|
+
datumInternalMeta: { hydratedId }
|
|
148
|
+
} = props;
|
|
149
|
+
const useSortableConfig = useMemo(() => ({ id: hydratedId }), [hydratedId]);
|
|
150
|
+
const useSortableHelpers = useSortable(useSortableConfig);
|
|
151
|
+
return /* @__PURE__ */ jsx(Item, { ...props, useSortableHelpers });
|
|
152
|
+
};
|
|
153
|
+
const ItemSortable = (props) => props.withDragNDrop ? /* @__PURE__ */ jsx(ItemWithSortable, { ...props }) : /* @__PURE__ */ jsx(Item, { ...props });
|
|
191
154
|
export {
|
|
192
|
-
|
|
193
|
-
ItemSortable,
|
|
194
|
-
Item_default as default
|
|
155
|
+
ItemSortable
|
|
195
156
|
};
|
|
196
157
|
//# sourceMappingURL=Item.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Item/Item.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { Grid } from '@elliemae/ds-grid';\nimport { useHeadlessTooltip } from '@elliemae/ds-hooks-headless-tooltip';\nimport { css, styled } from '@elliemae/ds-system';\nimport React, {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { Grid } from '@elliemae/ds-grid';\nimport { useHeadlessTooltip } from '@elliemae/ds-hooks-headless-tooltip';\nimport { css, styled } from '@elliemae/ds-system';\nimport React, { useMemo } from 'react';\nimport { useInternalStore, usePropsStore } from '../../config/useStore/index.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../constants/index.js';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types.js';\nimport { DragHandle } from '../Dnd/DndHandle.js';\nimport { DropIndicator } from '../Dnd/DropIndicator.js';\nimport { ItemActions } from './ItemActions/index.js';\nimport { useInnerRefActionHandlers } from './ItemActions/useInnerRefActionHandlers.js';\nimport { ItemMiddleSection } from './ItemMiddleSection.js';\nimport { ItemSelectionUI } from './ItemSelectionUi/ItemSelectionUI.js';\nimport { useItemArrowNavigation } from './useItemArrowNavigation.js';\nimport { useItemInnerRefHandlers } from './useItemInnerRefHandlers.js';\nimport { useItemKeyboardSelection } from './useItemKeyboardSelection.js';\nimport { useSelectionLogic } from './useSelectionLogic.js';\n\n// we are using the class-name added via slot for the children `:hover` styling of icon colors\nconst cssDisabled = css`\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n color: ${({ theme }) => theme.colors.neutral['300']};\n .DSShuttleV2-item-action-btn-to-source-icon > svg,\n .DSShuttleV2-item-action-btn-to-destination-icon > svg,\n .DSShuttleV2-item-action-btn-drilldown-icon > svg {\n fill: ${({ theme }) => theme.colors.neutral['300']};\n }\n`;\n\nconst focusRing = css`\n outline: 2px solid ${({ theme }) => theme.colors.brand['700']};\n outline-offset: -2px;\n`;\ninterface ItemWrapperT {\n isDragging: boolean;\n isDndActive: boolean;\n hasFocusRing: boolean;\n}\n\nconst ItemWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_WRAPPER })<ItemWrapperT>`\n min-height: 2.769rem;\n position: relative;\n background-color: white;\n &:hover {\n background-color: ${({ isDndActive, theme }) => (!isDndActive ? theme.colors.brand['200'] : 'white')};\n .DSShuttleV2-item-action-btn-to-source-icon > svg,\n .DSShuttleV2-item-action-btn-to-destination-icon > svg,\n .DSShuttleV2-item-action-btn-drilldown-icon > svg {\n fill: brand-700;\n }\n ${({ isDragging }) => isDragging && cssDisabled}\n }\n\n ${({ hasFocusRing }) => hasFocusRing && focusRing}\n\n border-bottom: 1px solid neutral-100;\n\n ${({ isDragging }) => isDragging && cssDisabled}\n`;\nconst Item = React.memo((itemMeta: DSShuttleV2T.ItemMeta) => {\n const { datumInternalMeta, withDragNDrop, useSortableHelpers, hasMultipleSelection } = itemMeta;\n const { hydratedId, softDeleted } = datumInternalMeta;\n\n const explicitSelectionUI = usePropsStore((store) => store.explicitSelectionUI);\n const cols = useMemo(() => {\n const selectionUIWidth = explicitSelectionUI ? 'auto' : '5px';\n const finalCols = [selectionUIWidth];\n if (withDragNDrop) finalCols.push('auto');\n finalCols.push('1fr', 'auto');\n return finalCols;\n }, [withDragNDrop, explicitSelectionUI]);\n\n const setDndDraggingItemMeta = useInternalStore((state) => state.setDndDraggingItemMeta);\n const getIsDragAndDropHappening = useInternalStore((state) => state.getIsDragAndDropHappening);\n const isDraggingThisItem = useInternalStore((state) => state.dndDraggingItem?.hydratedId === hydratedId);\n\n React.useEffect(() => {\n if (isDraggingThisItem) {\n setDndDraggingItemMeta((prevItemMeta) => {\n if (prevItemMeta?.datumInternalMeta.hydratedId === hydratedId) return prevItemMeta;\n return itemMeta;\n });\n }\n }, [hydratedId, isDraggingThisItem, itemMeta, setDndDraggingItemMeta]);\n\n const { selectItem, onShiftMouseDownPreventTextSelection } = useSelectionLogic(itemMeta);\n const { onItemContainerKeyDown } = useItemArrowNavigation(itemMeta);\n const { onItemKeyDownSelection } = useItemKeyboardSelection(itemMeta);\n\n const handleItemKeyDown: React.KeyboardEventHandler<HTMLDivElement> = React.useCallback(\n (event) => {\n onItemKeyDownSelection(event);\n onItemContainerKeyDown(event);\n },\n [onItemKeyDownSelection, onItemContainerKeyDown],\n );\n const itemInnerRefHandlers = useItemInnerRefHandlers(itemMeta);\n const { thisItemIsFocused } = itemInnerRefHandlers;\n const { innerRefHandlerDnd } = useInnerRefActionHandlers(itemMeta);\n const overId = useInternalStore((state) => state.overId);\n const isDropValid = useInternalStore((state) => state.isDropValid);\n const dropIndicatorPosition = useInternalStore((state) => state.dropIndicatorPosition);\n\n const showDropIndicatorPosition = hydratedId === overId && dropIndicatorPosition;\n const sortableRef = useSortableHelpers?.setNodeRef ?? (() => {});\n\n // const thisItemIsFocused = useThisItemIsFocused(itemMeta);\n const config = React.useMemo(() => ({ hasFocus: thisItemIsFocused }), [thisItemIsFocused]);\n\n const tooltipHelpers = useHeadlessTooltip(config);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => itemMeta, [itemMeta]);\n\n return (\n <ItemWrapper\n isDragging={isDraggingThisItem}\n isDndActive={getIsDragAndDropHappening()}\n cols={cols}\n alignItems=\"center\"\n onClick={selectItem}\n innerRef={sortableRef}\n onKeyDown={handleItemKeyDown}\n onMouseDown={onShiftMouseDownPreventTextSelection}\n onMouseEnter={tooltipHelpers.onMouseEnter}\n onMouseLeave={tooltipHelpers.onMouseLeave}\n onPointerEnter={tooltipHelpers.onMouseEnter}\n onPointerLeave={tooltipHelpers.onMouseLeave}\n hasFocusRing={thisItemIsFocused}\n tabIndex={-1}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <ItemSelectionUI\n tooltipHelpers={tooltipHelpers}\n itemInnerRefHandlers={itemInnerRefHandlers}\n itemMeta={itemMeta}\n />\n {withDragNDrop && useSortableHelpers ? (\n <DragHandle\n id={hydratedId}\n useSortableHelpers={useSortableHelpers}\n isDndActive={getIsDragAndDropHappening()}\n isDragging={isDraggingThisItem}\n innerRef={innerRefHandlerDnd}\n disabled={hasMultipleSelection}\n ariaLabelledby={`${hydratedId}-text-section${softDeleted ? '-soft-deleted' : ''}`}\n />\n ) : null}\n <ItemMiddleSection {...itemMeta} tooltipHelpers={tooltipHelpers} />\n {!hasMultipleSelection ? <ItemActions {...itemMeta} /> : null}\n <DropIndicator vertical={false} dropIndicatorPosition={showDropIndicatorPosition} isDropValid={isDropValid} />\n </ItemWrapper>\n );\n});\n\nconst ItemWithSortable = (props: DSShuttleV2T.ItemMeta) => {\n const {\n datumInternalMeta: { hydratedId },\n } = props;\n const useSortableConfig = useMemo(() => ({ id: hydratedId }), [hydratedId]);\n const useSortableHelpers = useSortable(useSortableConfig);\n return <Item {...props} useSortableHelpers={useSortableHelpers} />;\n};\n\nexport const ItemSortable = (props: DSShuttleV2T.ItemMeta) =>\n props.withDragNDrop ? <ItemWithSortable {...props} /> : <Item {...props} />;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsHnB,SAkBE,KAlBF;AApHJ,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,0BAA0B;AACnC,SAAS,KAAK,cAAc;AAC5B,OAAOA,UAAS,eAAe;AAC/B,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,iBAAiB,wBAAwB;AAElD,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAC5B,SAAS,iCAAiC;AAC1C,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;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,gBAAgB,oBAAC,oBAAkB,GAAG,OAAO,IAAK,oBAAC,QAAM,GAAG,OAAO;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -6,10 +6,12 @@ import { Grid } from "@elliemae/ds-grid";
|
|
|
6
6
|
import { DSButtonV3, BUTTON_SIZES } from "@elliemae/ds-button-v2";
|
|
7
7
|
import { ArrowShortReturn, ArrowShortRight, CloseMedium } from "@elliemae/ds-icons";
|
|
8
8
|
import { useActionsHandlers } from "./useActionsHandlers.js";
|
|
9
|
-
import {
|
|
9
|
+
import { useInnerRefActionHandlers } from "./useInnerRefActionHandlers.js";
|
|
10
10
|
import { DSShuttleV2Name, DSShuttleV2Slots } from "../../../constants/index.js";
|
|
11
11
|
import { useInternalStore, usePropsStore } from "../../../config/useStore/useStore.js";
|
|
12
|
-
const StyledItemActions = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTIONS_WRAPPER })
|
|
12
|
+
const StyledItemActions = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTIONS_WRAPPER })`
|
|
13
|
+
height: 100%;
|
|
14
|
+
`;
|
|
13
15
|
const StyledItemActionWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTION_WRAPPER })``;
|
|
14
16
|
const StyledButton = styled(DSButtonV3, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTION_BTN })`
|
|
15
17
|
height: 1.692rem !important;
|
|
@@ -42,7 +44,7 @@ const ItemActions = React2.memo((itemMeta) => {
|
|
|
42
44
|
} = itemMeta;
|
|
43
45
|
const { withActions, internallyDisabledDrilldown, internallyDisabledMove } = datumRenderFlags;
|
|
44
46
|
const { preventDrilldown, label } = datumHydratables;
|
|
45
|
-
const { innerRefHandlerDrilldown, innerRefHandlerMove } =
|
|
47
|
+
const { innerRefHandlerDrilldown, innerRefHandlerMove } = useInnerRefActionHandlers(itemMeta);
|
|
46
48
|
const { handleClickDrilldown, handleClickSingleMove, handleKeyDownSelectionBubbleUp } = useActionsHandlers(itemMeta);
|
|
47
49
|
const drillDownAriaLabel = useMemo(() => `Drilldown into ${label} option`, [label]);
|
|
48
50
|
const moveAriaLabel = useMemo(
|
|
@@ -53,6 +55,16 @@ const ItemActions = React2.memo((itemMeta) => {
|
|
|
53
55
|
const moveButtonProps = usePropsStore((state) => state.moveButtonProps);
|
|
54
56
|
const getOwnerProps = usePropsStore((store) => store.get);
|
|
55
57
|
const getOwnerPropsArguments = React2.useCallback(() => itemMeta, [itemMeta]);
|
|
58
|
+
const getOwnerPropsArgumentsIcons = React2.useCallback(
|
|
59
|
+
() => ({
|
|
60
|
+
panelMetaInfo: itemMeta,
|
|
61
|
+
extraMetaInfo: { itemMeta }
|
|
62
|
+
}),
|
|
63
|
+
[itemMeta]
|
|
64
|
+
);
|
|
65
|
+
const stopPropagation = React2.useCallback((event) => {
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
}, []);
|
|
56
68
|
return /* @__PURE__ */ jsx(
|
|
57
69
|
StyledItemActions,
|
|
58
70
|
{
|
|
@@ -61,6 +73,8 @@ const ItemActions = React2.memo((itemMeta) => {
|
|
|
61
73
|
pl: "xs",
|
|
62
74
|
pr: "xxs",
|
|
63
75
|
alignItems: "center",
|
|
76
|
+
onClick: stopPropagation,
|
|
77
|
+
onMouseDown: stopPropagation,
|
|
64
78
|
getOwnerProps,
|
|
65
79
|
getOwnerPropsArguments,
|
|
66
80
|
children: withActions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -104,7 +118,7 @@ const ItemActions = React2.memo((itemMeta) => {
|
|
|
104
118
|
width: "1.538rem",
|
|
105
119
|
height: "1.538rem",
|
|
106
120
|
getOwnerProps,
|
|
107
|
-
getOwnerPropsArguments
|
|
121
|
+
getOwnerPropsArguments: getOwnerPropsArgumentsIcons
|
|
108
122
|
}
|
|
109
123
|
) : /* @__PURE__ */ jsx(
|
|
110
124
|
StyledArrowShortRightIcon,
|
|
@@ -112,7 +126,7 @@ const ItemActions = React2.memo((itemMeta) => {
|
|
|
112
126
|
width: "1.538rem",
|
|
113
127
|
height: "1.538rem",
|
|
114
128
|
getOwnerProps,
|
|
115
|
-
getOwnerPropsArguments
|
|
129
|
+
getOwnerPropsArguments: getOwnerPropsArgumentsIcons
|
|
116
130
|
}
|
|
117
131
|
)
|
|
118
132
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Item/ItemActions/ItemActions.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV3, BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ArrowShortReturn, ArrowShortRight, CloseMedium } from '@elliemae/ds-icons';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { useActionsHandlers } from './useActionsHandlers.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV3, BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ArrowShortReturn, ArrowShortRight, CloseMedium } from '@elliemae/ds-icons';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { useActionsHandlers } from './useActionsHandlers.js';\nimport { useInnerRefActionHandlers } from './useInnerRefActionHandlers.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../constants/index.js';\nimport { useInternalStore, usePropsStore } from '../../../config/useStore/useStore.js';\n\nconst StyledItemActions = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTIONS_WRAPPER })`\n height: 100%;\n`;\nconst StyledItemActionWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTION_WRAPPER })``;\nconst StyledButton = styled(DSButtonV3, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTION_BTN })`\n height: 1.692rem !important;\n svg {\n fill: brand-600;\n }\n :disabled svg {\n fill: neutral-200 !important;\n }\n`;\nconst StyledDrilldownIcon = styled(ArrowShortReturn, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.ITEM_ACTION_BTN_DRILLDOWN_ICON,\n})``;\nconst StyledCloseMediumIcon = styled(CloseMedium, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.ITEM_ACTION_BTN_TO_SOURCE_ICON,\n})``;\nconst StyledArrowShortRightIcon = styled(ArrowShortRight, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.ITEM_ACTION_BTN_TO_DESTINATION_ICON,\n})``;\n\nconst actionsCols = ['1.538rem', '1.538rem'];\n\nexport const ItemActions = React.memo((itemMeta: DSShuttleV2T.ItemMeta) => {\n const {\n datumHydratables,\n isDestinationPanel,\n datumRenderFlags,\n datumInternalMeta: { hydratedPreventMove, hydratedId },\n } = itemMeta;\n // withActions is calculated in /src/config/configureAutoCalculated.ts\n const { withActions, internallyDisabledDrilldown, internallyDisabledMove } = datumRenderFlags;\n const { preventDrilldown, label } = datumHydratables;\n const { innerRefHandlerDrilldown, innerRefHandlerMove } = useInnerRefActionHandlers(itemMeta);\n const { handleClickDrilldown, handleClickSingleMove, handleKeyDownSelectionBubbleUp } = useActionsHandlers(itemMeta);\n const drillDownAriaLabel = useMemo(() => `Drilldown into ${label} option`, [label]);\n const moveAriaLabel = useMemo(\n () => `Move option ${label} into ${isDestinationPanel ? 'source' : 'destination'} panel`,\n [label, isDestinationPanel],\n );\n\n const isDraggingThisItem = useInternalStore((state) => state.dndDraggingItem?.hydratedId === hydratedId);\n\n const moveButtonProps = usePropsStore((state) => state.moveButtonProps);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => itemMeta, [itemMeta]);\n // The to-source / to-destination icon slots share a unified argument shape with the bulk-action\n // button (see MultipleSelectionAction). Here the per-item itemMeta is available via extraMetaInfo.\n const getOwnerPropsArgumentsIcons = React.useCallback(\n (): DSShuttleV2T.ItemActionIconArguments => ({\n panelMetaInfo: itemMeta,\n extraMetaInfo: { itemMeta },\n }),\n [itemMeta],\n );\n\n // Clicking an action button (drilldown / move) must not bubble up to the row's onClick\n // (selectItem) / onMouseDown handlers \u2014 using an action should not toggle item selection.\n const stopPropagation = React.useCallback((event: React.SyntheticEvent) => {\n event.stopPropagation();\n }, []);\n\n return (\n <StyledItemActions\n cols={actionsCols}\n gutter=\"xxs\"\n pl=\"xs\"\n pr=\"xxs\"\n alignItems=\"center\"\n onClick={stopPropagation}\n onMouseDown={stopPropagation}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {withActions ? (\n <>\n <StyledItemActionWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledButton\n buttonType=\"icon\"\n aria-label={drillDownAriaLabel}\n onClick={handleClickDrilldown}\n onKeyDown={handleKeyDownSelectionBubbleUp}\n size={BUTTON_SIZES.S}\n innerRef={innerRefHandlerDrilldown}\n tabIndex={-1} // We overwrite it via vanilla js on the focus manager\n disabled={internallyDisabledDrilldown || preventDrilldown === true || isDraggingThisItem}\n >\n <StyledDrilldownIcon\n width=\"1.538rem\"\n height=\"1.538rem\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n </StyledButton>\n </StyledItemActionWrapper>\n <StyledItemActionWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledButton\n buttonType=\"icon\"\n aria-label={moveAriaLabel}\n onClick={handleClickSingleMove}\n onKeyDown={handleKeyDownSelectionBubbleUp}\n size={BUTTON_SIZES.S}\n innerRef={innerRefHandlerMove}\n tabIndex={-1} // We overwrite it via vanilla js on the focus manager\n disabled={internallyDisabledMove || hydratedPreventMove === true || isDraggingThisItem}\n {...(moveButtonProps && moveButtonProps({ itemMeta, isDestinationPanel }))}\n >\n {isDestinationPanel ? (\n <StyledCloseMediumIcon\n width=\"1.538rem\"\n height=\"1.538rem\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArgumentsIcons}\n />\n ) : (\n <StyledArrowShortRightIcon\n width=\"1.538rem\"\n height=\"1.538rem\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArgumentsIcons}\n />\n )}\n </StyledButton>\n </StyledItemActionWrapper>\n </>\n ) : (\n // this is a place-holder used for mantainting the grid spacing when item has no actions (so when item is soft-deleted)\n <>\n <div />\n <div />\n </>\n )}\n </StyledItemActions>\n );\n});\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4Ff,mBAYM,KAZN;AA5FR,OAAOA,UAAS,eAAe;AAC/B,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY,oBAAoB;AACzC,SAAS,kBAAkB,iBAAiB,mBAAmB;AAE/D,SAAS,0BAA0B;AACnC,SAAS,iCAAiC;AAC1C,SAAS,iBAAiB,wBAAwB;AAClD,SAAS,kBAAkB,qBAAqB;AAEhD,MAAM,oBAAoB,OAAO,MAAM,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,qBAAqB,CAAC;AAAA;AAAA;AAG7G,MAAM,0BAA0B,OAAO,MAAM,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,oBAAoB,CAAC;AAClH,MAAM,eAAe,OAAO,YAAY,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASzG,MAAM,sBAAsB,OAAO,kBAAkB;AAAA,EACnD,MAAM;AAAA,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AA;AAAA,EAEJ;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
package/dist/esm/parts/Item/ItemActions/{useInnerRefHandlers.js → useInnerRefActionHandlers.js}
RENAMED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import React2 from "react";
|
|
3
3
|
import { useInternalStore } from "../../../config/useStore/index.js";
|
|
4
4
|
import { REGIONS_FOCUSES, ACTIONS_FOCUSES } from "../../../constants/index.js";
|
|
5
|
-
const
|
|
5
|
+
const useInnerRefActionHandlers = ({ datumInternalMeta, isDestinationPanel }) => {
|
|
6
6
|
const setZustandRef = useInternalStore((state) => state.setZustandRef);
|
|
7
7
|
const currRegion = isDestinationPanel ? REGIONS_FOCUSES.DESTINATION_PANEL_ITEM : REGIONS_FOCUSES.SOURCE_PANEL_ITEM;
|
|
8
8
|
const currItemId = datumInternalMeta.hydratedId;
|
|
@@ -34,6 +34,6 @@ const useInnerRefHandlers = ({ datumInternalMeta, isDestinationPanel }) => {
|
|
|
34
34
|
);
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
useInnerRefActionHandlers
|
|
38
38
|
};
|
|
39
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=useInnerRefActionHandlers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Item/ItemActions/useInnerRefActionHandlers.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types.js';\nimport { useInternalStore } from '../../../config/useStore/index.js';\nimport { REGIONS_FOCUSES, ACTIONS_FOCUSES } from '../../../constants/index.js';\n\nexport const useInnerRefActionHandlers = ({ datumInternalMeta, isDestinationPanel }: DSShuttleV2T.ItemMeta) => {\n const setZustandRef = useInternalStore((state) => state.setZustandRef);\n const currRegion = isDestinationPanel ? REGIONS_FOCUSES.DESTINATION_PANEL_ITEM : REGIONS_FOCUSES.SOURCE_PANEL_ITEM;\n const currItemId = datumInternalMeta.hydratedId;\n const innerRefHandlerDrilldown = React.useCallback(\n (node: HTMLButtonElement) => {\n setZustandRef([currRegion, currItemId, ACTIONS_FOCUSES.DRILLDOWN_BTN], node);\n },\n [currItemId, currRegion, setZustandRef],\n );\n const innerRefHandlerMove = React.useCallback(\n (node: HTMLButtonElement) => {\n setZustandRef([currRegion, currItemId, ACTIONS_FOCUSES.MOVE_BTN], node);\n },\n [currItemId, currRegion, setZustandRef],\n );\n const innerRefHandlerDnd = React.useCallback(\n (node: HTMLDivElement | null) => {\n setZustandRef([currRegion, currItemId, ACTIONS_FOCUSES.DRAG_N_DROP], node);\n },\n [currItemId, currRegion, setZustandRef],\n );\n return React.useMemo(\n () => ({\n innerRefHandlerDnd,\n innerRefHandlerDrilldown,\n innerRefHandlerMove,\n }),\n [innerRefHandlerDrilldown, innerRefHandlerDnd, innerRefHandlerMove],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAElB,SAAS,wBAAwB;AACjC,SAAS,iBAAiB,uBAAuB;AAE1C,MAAM,4BAA4B,CAAC,EAAE,mBAAmB,mBAAmB,MAA6B;AAC7G,QAAM,gBAAgB,iBAAiB,CAAC,UAAU,MAAM,aAAa;AACrE,QAAM,aAAa,qBAAqB,gBAAgB,yBAAyB,gBAAgB;AACjG,QAAM,aAAa,kBAAkB;AACrC,QAAM,2BAA2BA,OAAM;AAAA,IACrC,CAAC,SAA4B;AAC3B,oBAAc,CAAC,YAAY,YAAY,gBAAgB,aAAa,GAAG,IAAI;AAAA,IAC7E;AAAA,IACA,CAAC,YAAY,YAAY,aAAa;AAAA,EACxC;AACA,QAAM,sBAAsBA,OAAM;AAAA,IAChC,CAAC,SAA4B;AAC3B,oBAAc,CAAC,YAAY,YAAY,gBAAgB,QAAQ,GAAG,IAAI;AAAA,IACxE;AAAA,IACA,CAAC,YAAY,YAAY,aAAa;AAAA,EACxC;AACA,QAAM,qBAAqBA,OAAM;AAAA,IAC/B,CAAC,SAAgC;AAC/B,oBAAc,CAAC,YAAY,YAAY,gBAAgB,WAAW,GAAG,IAAI;AAAA,IAC3E;AAAA,IACA,CAAC,YAAY,YAAY,aAAa;AAAA,EACxC;AACA,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,0BAA0B,oBAAoB,mBAAmB;AAAA,EACpE;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Item/ItemMiddleSection.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../constants/index.js';\nimport { TextSection } from './TextSection.js';\nimport { useThisItemIsFocused } from './useThisItemIsFocused.js';\nimport { usePropsStore } from '../../config/useStore/useStore.js';\n\nconst IconWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ICON_WRAPPER })`\n min-height: 1rem;\n`;\n\nconst MidSection = styled(Grid, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.ITEM_MIDSECTION_WRAPPER,\n})<{ $softDeleted: boolean }>`\n min-height: 1rem;\n ${(props) => {\n if (props.$softDeleted)\n return `\n color: ${props.theme.colors.neutral[500]};\n svg {\n fill: ${props.theme.colors.neutral[400]};\n }\n `;\n return '';\n }};\n`;\nconst customMidSectionCols = ['1fr'];\nconst customMidSectionRows = ['1fr'];\n\nexport const ItemMiddleSection = React.memo(\n (props: DSShuttleV2T.ItemMeta & { tooltipHelpers?: DSShuttleV2T.ComponentProps['tooltipHelpers'] }) => {\n const { tooltipHelpers, ...itemMeta } = props;\n const { datum, datumHydratables, datumInternalMeta, isDestinationPanel, hasMultipleSelection } = itemMeta;\n const { Icon, CustomRenderer, ...componentlessHydratables } = datumHydratables;\n const { softDeleted, hydratedId } = datumInternalMeta;\n const thisItemIsFocused = useThisItemIsFocused(itemMeta);\n const customComponentProps = React.useMemo<DSShuttleV2T.ComponentProps>(\n () => ({\n datum,\n tooltipHelpers,\n thisItemIsFocused,\n panelMetaInfo: { isDestinationPanel, hasMultipleSelection },\n datumInternalMeta,\n datumHydratables: { ...componentlessHydratables, id: hydratedId },\n }),\n [\n componentlessHydratables,\n datum,\n datumInternalMeta,\n hasMultipleSelection,\n hydratedId,\n isDestinationPanel,\n thisItemIsFocused,\n tooltipHelpers,\n ],\n );\n const cols = React.useMemo(() => {\n // if CustomRenderer is defined, shortcircuit\n if (CustomRenderer) return [];\n const dynamicCols = [];\n if (Icon) dynamicCols.push('auto');\n dynamicCols.push('1fr');\n return dynamicCols;\n }, [CustomRenderer, Icon]);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => props, [props]);\n\n if (CustomRenderer)\n return (\n <MidSection\n cols={customMidSectionCols}\n rows={customMidSectionRows}\n $softDeleted={Boolean(softDeleted)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <CustomRenderer {...customComponentProps} />\n </MidSection>\n );\n\n // if we ever need to do something for truncation and showing a tooltip in the future,\n // check out what has been done in exported-related/ShuttleItem.tsx\n // also, be aware that we have the headless logic alread inside tooltipHelpers\n // when this comment has been written, the logic was working with keyboard and mouse as per tooltip-v3\n // integrated with all the shuttle-v2 custom focus navigation\n return (\n <MidSection\n cols={cols}\n alignItems=\"center\"\n ml=\"xxs\"\n $softDeleted={Boolean(softDeleted)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {Icon ? (\n <IconWrapper\n alignItems=\"center\"\n mr=\"xxs\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Icon {...customComponentProps} />\n </IconWrapper>\n ) : null}\n <TextSection {...itemMeta} />\n </MidSection>\n );\n },\n);\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { type DSShuttleV2T } from '../../react-desc-prop-types.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../constants/index.js';\nimport { TextSection } from './TextSection.js';\nimport { useThisItemIsFocused } from './useThisItemIsFocused.js';\nimport { usePropsStore } from '../../config/useStore/useStore.js';\n\nconst IconWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ICON_WRAPPER })`\n min-height: 1rem;\n`;\n\nconst MidSection = styled(Grid, {\n name: DSShuttleV2Name,\n slot: DSShuttleV2Slots.ITEM_MIDSECTION_WRAPPER,\n})<{ $softDeleted: boolean }>`\n height: 100%;\n min-height: 1rem;\n ${(props) => {\n if (props.$softDeleted)\n return `\n color: ${props.theme.colors.neutral[500]};\n svg {\n fill: ${props.theme.colors.neutral[400]};\n }\n `;\n return '';\n }};\n`;\nconst customMidSectionCols = ['1fr'];\nconst customMidSectionRows = ['1fr'];\n\nexport const ItemMiddleSection = React.memo(\n (props: DSShuttleV2T.ItemMeta & { tooltipHelpers?: DSShuttleV2T.ComponentProps['tooltipHelpers'] }) => {\n const { tooltipHelpers, ...itemMeta } = props;\n const { datum, datumHydratables, datumInternalMeta, isDestinationPanel, hasMultipleSelection } = itemMeta;\n const { Icon, CustomRenderer, ...componentlessHydratables } = datumHydratables;\n const { softDeleted, hydratedId } = datumInternalMeta;\n const thisItemIsFocused = useThisItemIsFocused(itemMeta);\n const customComponentProps = React.useMemo<DSShuttleV2T.ComponentProps>(\n () => ({\n datum,\n tooltipHelpers,\n thisItemIsFocused,\n panelMetaInfo: { isDestinationPanel, hasMultipleSelection },\n datumInternalMeta,\n datumHydratables: { ...componentlessHydratables, id: hydratedId },\n }),\n [\n componentlessHydratables,\n datum,\n datumInternalMeta,\n hasMultipleSelection,\n hydratedId,\n isDestinationPanel,\n thisItemIsFocused,\n tooltipHelpers,\n ],\n );\n const cols = React.useMemo(() => {\n // if CustomRenderer is defined, shortcircuit\n if (CustomRenderer) return [];\n const dynamicCols = [];\n if (Icon) dynamicCols.push('auto');\n dynamicCols.push('1fr');\n return dynamicCols;\n }, [CustomRenderer, Icon]);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => props, [props]);\n\n if (CustomRenderer)\n return (\n <MidSection\n cols={customMidSectionCols}\n rows={customMidSectionRows}\n $softDeleted={Boolean(softDeleted)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <CustomRenderer {...customComponentProps} />\n </MidSection>\n );\n\n // if we ever need to do something for truncation and showing a tooltip in the future,\n // check out what has been done in exported-related/ShuttleItem.tsx\n // also, be aware that we have the headless logic alread inside tooltipHelpers\n // when this comment has been written, the logic was working with keyboard and mouse as per tooltip-v3\n // integrated with all the shuttle-v2 custom focus navigation\n return (\n <MidSection\n cols={cols}\n alignItems=\"center\"\n ml=\"xxs\"\n $softDeleted={Boolean(softDeleted)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {Icon ? (\n <IconWrapper\n alignItems=\"center\"\n mr=\"xxs\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Icon {...customComponentProps} />\n </IconWrapper>\n ) : null}\n <TextSection {...itemMeta} />\n </MidSection>\n );\n },\n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