@elliemae/ds-shuttle-v2 3.14.0-next.7 → 3.14.0-next.9
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/itemMovementHelpers.js.map +1 -1
- package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js +2 -2
- package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js.map +2 -2
- package/dist/cjs/config/useStore/useStore.js +7 -2
- package/dist/cjs/config/useStore/useStore.js.map +2 -2
- package/dist/cjs/parts/Dnd/DndHandle.js +13 -6
- package/dist/cjs/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/cjs/parts/Header.js +2 -2
- package/dist/cjs/parts/Header.js.map +2 -2
- package/dist/cjs/parts/Item/Item.js +12 -19
- package/dist/cjs/parts/Item/Item.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js +10 -8
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js +8 -3
- package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js +23 -3
- package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js.map +2 -2
- package/dist/cjs/parts/Item/ItemMiddleSection.js +5 -18
- package/dist/cjs/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Item/TextSection.js +50 -0
- package/dist/cjs/parts/Item/TextSection.js.map +7 -0
- package/dist/cjs/parts/Item/useItemArrowNavigation.js +29 -7
- package/dist/cjs/parts/Item/useItemArrowNavigation.js.map +2 -2
- package/dist/cjs/parts/Item/useItemKeyboardSelection.js +57 -0
- package/dist/cjs/parts/Item/useItemKeyboardSelection.js.map +7 -0
- package/dist/cjs/parts/Item/useSelectionLogic.js +51 -15
- package/dist/cjs/parts/Item/useSelectionLogic.js.map +2 -2
- package/dist/cjs/parts/MainContent.js +5 -2
- package/dist/cjs/parts/MainContent.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +3 -3
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +4 -5
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js +9 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +29 -6
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +2 -13
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/SelectionHeader.js +1 -1
- package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/cjs/parts/PanelWrapper.js +8 -11
- package/dist/cjs/parts/PanelWrapper.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/config/itemMovementHelpers.js.map +1 -1
- package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js +2 -2
- package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js.map +2 -2
- package/dist/esm/config/useStore/useStore.js +7 -2
- package/dist/esm/config/useStore/useStore.js.map +2 -2
- package/dist/esm/parts/Dnd/DndHandle.js +13 -6
- package/dist/esm/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/esm/parts/Header.js +1 -1
- package/dist/esm/parts/Header.js.map +1 -1
- package/dist/esm/parts/Item/Item.js +12 -19
- package/dist/esm/parts/Item/Item.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/ItemActions.js +7 -5
- package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/useActionsHandlers.js +8 -3
- package/dist/esm/parts/Item/ItemActions/useActionsHandlers.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/useActionsLogicHandlers.js +23 -3
- package/dist/esm/parts/Item/ItemActions/useActionsLogicHandlers.js.map +2 -2
- package/dist/esm/parts/Item/ItemMiddleSection.js +4 -17
- package/dist/esm/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/esm/parts/Item/TextSection.js +24 -0
- package/dist/esm/parts/Item/TextSection.js.map +7 -0
- package/dist/esm/parts/Item/useItemArrowNavigation.js +30 -8
- package/dist/esm/parts/Item/useItemArrowNavigation.js.map +2 -2
- package/dist/esm/parts/Item/useItemKeyboardSelection.js +31 -0
- package/dist/esm/parts/Item/useItemKeyboardSelection.js.map +7 -0
- package/dist/esm/parts/Item/useSelectionLogic.js +51 -15
- package/dist/esm/parts/Item/useSelectionLogic.js.map +2 -2
- package/dist/esm/parts/MainContent.js +5 -2
- package/dist/esm/parts/MainContent.js.map +2 -2
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +1 -1
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js +4 -5
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
- package/dist/esm/parts/Panel/middle/ItemListWrapper/getDatumFlags.js +9 -2
- package/dist/esm/parts/Panel/middle/ItemListWrapper/getDatumFlags.js.map +2 -2
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +28 -5
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +2 -13
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/esm/parts/Panel/top/SelectionHeader.js +1 -1
- package/dist/esm/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/esm/parts/PanelWrapper.js +8 -11
- package/dist/esm/parts/PanelWrapper.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/package.json +12 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/itemMovementHelpers.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React from 'react';\nimport { useMakeMutable } from '@elliemae/ds-utilities';\nimport { type DSButtonT } from '@elliemae/ds-button';\nimport { type DSShuttleV2T } from '../react-desc-prop-types';\nimport { usePropsStore, useInternalStore } from './useStore';\n\nexport const useHandleMoveSelection = ({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n const currSelectionMap = useInternalStore((store) =>\n isDestinationPanel ? store.destinationSelectionArray : store.sourceSelectionArray,\n );\n const currOnSelectionChange = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange,\n );\n\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const destinationSelectionArray = useInternalStore((store) => store.destinationSelectionItemArray);\n const sourceSelectionArray = useInternalStore((store) => store.sourceSelectionItemArray);\n const selectedItems = isDestinationPanel ? destinationSelectionArray : sourceSelectionArray;\n\n const mutableSelectedItems = useMakeMutable(selectedItems);\n const mutableCurrSelectionMap = useMakeMutable(currSelectionMap);\n const mutableCurrOnSelectionChange = useMakeMutable(currOnSelectionChange);\n const mutableCurrOnRemove = useMakeMutable(currOnRemove);\n const mutableOtherOnAdd = useMakeMutable(otherPanelOnAdd);\n const mutableCurrOnSoftDelete = useMakeMutable(currOnSoftDelete);\n const mutableOtherOnSoftDelete = useMakeMutable(otherOnSoftDelete);\n const mutableCurrSoftDeletedItems = useMakeMutable(currSoftDeletedItems);\n const mutableOtherSoftDeletedItems = useMakeMutable(otherSoftDeletedItems);\n\n const moveSelection = React.useCallback(\n (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => {\n event.preventDefault();\n event.stopPropagation();\n // movement\n mutableCurrOnRemove.current(mutableSelectedItems.current, { event });\n mutableOtherOnAdd.current(mutableSelectedItems.current, { event });\n // soft delete\n const currSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n const otherSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n mutableCurrSelectionMap.current.forEach((id) => {\n currSoftDeletedMap[id] = true;\n otherSoftDeletedMap[id] = false;\n });\n mutableCurrOnSoftDelete.current({ ...mutableCurrSoftDeletedItems.current, ...currSoftDeletedMap }, { event });\n mutableOtherOnSoftDelete.current({ ...mutableOtherSoftDeletedItems.current, ...otherSoftDeletedMap }, { event });\n // cleanup\n mutableCurrOnSelectionChange.current({}, { event });\n },\n [\n mutableCurrSelectionMap,\n mutableCurrOnRemove,\n mutableCurrOnSelectionChange,\n mutableCurrOnSoftDelete,\n mutableCurrSoftDeletedItems,\n mutableOtherOnAdd,\n mutableOtherOnSoftDelete,\n mutableOtherSoftDeletedItems,\n mutableSelectedItems,\n ],\n );\n // optimization ...\n const mutableMoveSelection = useMakeMutable(moveSelection);\n return React.useMemo(() => ({ moveSelection: mutableMoveSelection.current }), [mutableMoveSelection]);\n};\n\nexport const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }: DSShuttleV2T.ItemMeta) => {\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const mutableCurrOnRemove = useMakeMutable(currOnRemove);\n const mutableOtherOnAdd = useMakeMutable(otherPanelOnAdd);\n const mutableCurrOnSoftDelete = useMakeMutable(currOnSoftDelete);\n const mutableOtherOnSoftDelete = useMakeMutable(otherOnSoftDelete);\n const mutableCurrSoftDeletedItems = useMakeMutable(currSoftDeletedItems);\n const mutableOtherSoftDeletedItems = useMakeMutable(otherSoftDeletedItems);\n\n const moveItem = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n mutableCurrOnRemove.current([datum], { event });\n mutableOtherOnAdd.current([datum], { event });\n mutableCurrOnSoftDelete.current(\n { ...mutableCurrSoftDeletedItems.current, [datumInternalMeta.hydratedId]: true },\n { event },\n );\n mutableOtherOnSoftDelete.current(\n { ...mutableOtherSoftDeletedItems.current, [datumInternalMeta.hydratedId]: false },\n { event },\n );\n },\n [\n datum,\n datumInternalMeta.hydratedId,\n mutableCurrOnRemove,\n mutableCurrOnSoftDelete,\n mutableCurrSoftDeletedItems,\n mutableOtherOnAdd,\n mutableOtherOnSoftDelete,\n mutableOtherSoftDeletedItems,\n ],\n );\n return moveItem;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport React from 'react';\nimport { useMakeMutable } from '@elliemae/ds-utilities';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type DSShuttleV2T } from '../react-desc-prop-types';\nimport { usePropsStore, useInternalStore } from './useStore';\n\nexport const useHandleMoveSelection = ({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n const currSelectionMap = useInternalStore((store) =>\n isDestinationPanel ? store.destinationSelectionArray : store.sourceSelectionArray,\n );\n const currOnSelectionChange = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange,\n );\n\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const destinationSelectionArray = useInternalStore((store) => store.destinationSelectionItemArray);\n const sourceSelectionArray = useInternalStore((store) => store.sourceSelectionItemArray);\n const selectedItems = isDestinationPanel ? destinationSelectionArray : sourceSelectionArray;\n\n const mutableSelectedItems = useMakeMutable(selectedItems);\n const mutableCurrSelectionMap = useMakeMutable(currSelectionMap);\n const mutableCurrOnSelectionChange = useMakeMutable(currOnSelectionChange);\n const mutableCurrOnRemove = useMakeMutable(currOnRemove);\n const mutableOtherOnAdd = useMakeMutable(otherPanelOnAdd);\n const mutableCurrOnSoftDelete = useMakeMutable(currOnSoftDelete);\n const mutableOtherOnSoftDelete = useMakeMutable(otherOnSoftDelete);\n const mutableCurrSoftDeletedItems = useMakeMutable(currSoftDeletedItems);\n const mutableOtherSoftDeletedItems = useMakeMutable(otherSoftDeletedItems);\n\n const moveSelection = React.useCallback(\n (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => {\n event.preventDefault();\n event.stopPropagation();\n // movement\n mutableCurrOnRemove.current(mutableSelectedItems.current, { event });\n mutableOtherOnAdd.current(mutableSelectedItems.current, { event });\n // soft delete\n const currSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n const otherSoftDeletedMap: DSShuttleV2T.SoftDeletedMap = {};\n mutableCurrSelectionMap.current.forEach((id) => {\n currSoftDeletedMap[id] = true;\n otherSoftDeletedMap[id] = false;\n });\n mutableCurrOnSoftDelete.current({ ...mutableCurrSoftDeletedItems.current, ...currSoftDeletedMap }, { event });\n mutableOtherOnSoftDelete.current({ ...mutableOtherSoftDeletedItems.current, ...otherSoftDeletedMap }, { event });\n // cleanup\n mutableCurrOnSelectionChange.current({}, { event });\n },\n [\n mutableCurrSelectionMap,\n mutableCurrOnRemove,\n mutableCurrOnSelectionChange,\n mutableCurrOnSoftDelete,\n mutableCurrSoftDeletedItems,\n mutableOtherOnAdd,\n mutableOtherOnSoftDelete,\n mutableOtherSoftDeletedItems,\n mutableSelectedItems,\n ],\n );\n // optimization ...\n const mutableMoveSelection = useMakeMutable(moveSelection);\n return React.useMemo(() => ({ moveSelection: mutableMoveSelection.current }), [mutableMoveSelection]);\n};\n\nexport const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }: DSShuttleV2T.ItemMeta) => {\n const currSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems,\n );\n const otherSoftDeletedItems = usePropsStore((state) =>\n isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems,\n );\n const currOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete,\n );\n const otherOnSoftDelete = usePropsStore((state) =>\n isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete,\n );\n\n const currOnRemove = usePropsStore((state) =>\n isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove,\n );\n const otherPanelOnAdd = usePropsStore((state) => (isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd));\n\n const mutableCurrOnRemove = useMakeMutable(currOnRemove);\n const mutableOtherOnAdd = useMakeMutable(otherPanelOnAdd);\n const mutableCurrOnSoftDelete = useMakeMutable(currOnSoftDelete);\n const mutableOtherOnSoftDelete = useMakeMutable(otherOnSoftDelete);\n const mutableCurrSoftDeletedItems = useMakeMutable(currSoftDeletedItems);\n const mutableOtherSoftDeletedItems = useMakeMutable(otherSoftDeletedItems);\n\n const moveItem = React.useCallback(\n (event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n mutableCurrOnRemove.current([datum], { event });\n mutableOtherOnAdd.current([datum], { event });\n mutableCurrOnSoftDelete.current(\n { ...mutableCurrSoftDeletedItems.current, [datumInternalMeta.hydratedId]: true },\n { event },\n );\n mutableOtherOnSoftDelete.current(\n { ...mutableOtherSoftDeletedItems.current, [datumInternalMeta.hydratedId]: false },\n { event },\n );\n },\n [\n datum,\n datumInternalMeta.hydratedId,\n mutableCurrOnRemove,\n mutableCurrOnSoftDelete,\n mutableCurrSoftDeletedItems,\n mutableOtherOnAdd,\n mutableOtherOnSoftDelete,\n mutableOtherSoftDeletedItems,\n ],\n );\n return moveItem;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAkB;AAClB,0BAA+B;AAG/B,sBAAgD;AAEzC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EA,QAAM,mBAAe;AAAA,IAAc,CAAC,UAClC,qBAAqB,MAAM,sBAAsB,MAAM;AAAA,EACzD;AACA,QAAM,sBAAkB,+BAAc,CAAC,UAAW,qBAAqB,MAAM,cAAc,MAAM,gBAAiB;AAElH,QAAM,0BAAsB,oCAAe,YAAY;AACvD,QAAM,wBAAoB,oCAAe,eAAe;AACxD,QAAM,8BAA0B,oCAAe,gBAAgB;AAC/D,QAAM,+BAA2B,oCAAe,iBAAiB;AACjE,QAAM,kCAA8B,oCAAe,oBAAoB;AACvE,QAAM,mCAA+B,oCAAe,qBAAqB;AAEzE,QAAM,WAAW,aAAAA,QAAM;AAAA,IACrB,CAAC,UAAwF;AACvF,YAAM,eAAe;AACrB,YAAM,gBAAgB;AACtB,0BAAoB,QAAQ,CAAC,KAAK,GAAG,EAAE,MAAM,CAAC;AAC9C,wBAAkB,QAAQ,CAAC,KAAK,GAAG,EAAE,MAAM,CAAC;AAC5C,8BAAwB;AAAA,QACtB,EAAE,GAAG,4BAA4B,SAAS,CAAC,kBAAkB,aAAa,KAAK;AAAA,QAC/E,EAAE,MAAM;AAAA,MACV;AACA,+BAAyB;AAAA,QACvB,EAAE,GAAG,6BAA6B,SAAS,CAAC,kBAAkB,aAAa,MAAM;AAAA,QACjF,EAAE,MAAM;AAAA,MACV;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -48,7 +48,7 @@ const useFocusRegionTrackers = () => {
|
|
|
48
48
|
trackFocusRegionDestinationPanel: () => setFocusRegion(import_constants.REGIONS_FOCUSES.DESTINATION_PANEL),
|
|
49
49
|
trackFocusRegionDestinationBottom: () => setFocusRegion(import_constants.REGIONS_FOCUSES.DESTINATION_BOTTOM),
|
|
50
50
|
trackFocusRegionDestinationPanelItem: () => setFocusRegion(import_constants.REGIONS_FOCUSES.DESTINATION_PANEL_ITEM),
|
|
51
|
-
|
|
51
|
+
trackFocusRegionDestinationPanelFocusMoveAll: () => setFocusRegion(import_constants.REGIONS_FOCUSES.DESTINATION_PANEL_ITEM_MOVE_ALL),
|
|
52
52
|
trackFocusRegionHeader: (isDestinationPanel) => {
|
|
53
53
|
if (isDestinationPanel)
|
|
54
54
|
setFocusRegion(import_constants.REGIONS_FOCUSES.DESTINATION_HEADER);
|
|
@@ -73,7 +73,7 @@ const useFocusRegionTrackers = () => {
|
|
|
73
73
|
else
|
|
74
74
|
setFocusRegion(import_constants.REGIONS_FOCUSES.SOURCE_PANEL_ITEM);
|
|
75
75
|
},
|
|
76
|
-
|
|
76
|
+
trackFocusRegionPanelFocusMoveAll: (isDestinationPanel) => {
|
|
77
77
|
if (isDestinationPanel)
|
|
78
78
|
setFocusRegion(import_constants.REGIONS_FOCUSES.DESTINATION_PANEL_ITEM_MOVE_ALL);
|
|
79
79
|
else
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/config/useFocusTracker/useFocusRegionTrackers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport { useMakeMutable } from '@elliemae/ds-utilities';\nimport { useInternalStore } from '../useStore';\nimport { REGIONS_FOCUSES } from '../../constants/index';\n\nexport const useFocusRegionTrackers = () => {\n const focusRegion = useInternalStore((state) => state.focusRegion);\n // tracking actions are always triggered as user action callbacks\n // this means it should always be invoked after all the useEffect execute\n // since this is the case, we can avoid re-declaring the function with mutable pattern\n // this way we avoid useless re-renders\n const mutableFocusRegion = useMakeMutable(focusRegion);\n const setFocusRegion = useInternalStore((state) => state.setFocusRegion);\n return useMemo(\n () => ({\n mutableFocusRegion,\n trackFocusRegionSourceHeader: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_HEADER),\n trackFocusRegionSourcePanel: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL),\n trackFocusRegionSourceBottom: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_BOTTOM),\n trackFocusRegionSourcePanelItem: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL_ITEM),\n trackFocusRegionSourcePanelFocusAll: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL_ITEM_MOVE_ALL),\n trackFocusRegionDestinationHeader: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_HEADER),\n trackFocusRegionDestinationPanel: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL),\n trackFocusRegionDestinationBottom: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_BOTTOM),\n trackFocusRegionDestinationPanelItem: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL_ITEM),\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AACxB,0BAA+B;AAC/B,sBAAiC;AACjC,uBAAgC;AAEzB,MAAM,yBAAyB,MAAM;AAC1C,QAAM,kBAAc,kCAAiB,CAAC,UAAU,MAAM,WAAW;AAKjE,QAAM,yBAAqB,oCAAe,WAAW;AACrD,QAAM,qBAAiB,kCAAiB,CAAC,UAAU,MAAM,cAAc;AACvE,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA,8BAA8B,MAAM,eAAe,iCAAgB,aAAa;AAAA,MAChF,6BAA6B,MAAM,eAAe,iCAAgB,YAAY;AAAA,MAC9E,8BAA8B,MAAM,eAAe,iCAAgB,aAAa;AAAA,MAChF,iCAAiC,MAAM,eAAe,iCAAgB,iBAAiB;AAAA,MACvF,qCAAqC,MAAM,eAAe,iCAAgB,0BAA0B;AAAA,MACpG,mCAAmC,MAAM,eAAe,iCAAgB,kBAAkB;AAAA,MAC1F,kCAAkC,MAAM,eAAe,iCAAgB,iBAAiB;AAAA,MACxF,mCAAmC,MAAM,eAAe,iCAAgB,kBAAkB;AAAA,MAC1F,sCAAsC,MAAM,eAAe,iCAAgB,sBAAsB;AAAA,MACjG,
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react';\nimport { useMakeMutable } from '@elliemae/ds-utilities';\nimport { useInternalStore } from '../useStore';\nimport { REGIONS_FOCUSES } from '../../constants/index';\n\nexport const useFocusRegionTrackers = () => {\n const focusRegion = useInternalStore((state) => state.focusRegion);\n // tracking actions are always triggered as user action callbacks\n // this means it should always be invoked after all the useEffect execute\n // since this is the case, we can avoid re-declaring the function with mutable pattern\n // this way we avoid useless re-renders\n const mutableFocusRegion = useMakeMutable(focusRegion);\n const setFocusRegion = useInternalStore((state) => state.setFocusRegion);\n return useMemo(\n () => ({\n mutableFocusRegion,\n trackFocusRegionSourceHeader: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_HEADER),\n trackFocusRegionSourcePanel: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL),\n trackFocusRegionSourceBottom: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_BOTTOM),\n trackFocusRegionSourcePanelItem: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL_ITEM),\n trackFocusRegionSourcePanelFocusAll: () => setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL_ITEM_MOVE_ALL),\n trackFocusRegionDestinationHeader: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_HEADER),\n trackFocusRegionDestinationPanel: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL),\n trackFocusRegionDestinationBottom: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_BOTTOM),\n trackFocusRegionDestinationPanelItem: () => setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL_ITEM),\n trackFocusRegionDestinationPanelFocusMoveAll: () =>\n setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL_ITEM_MOVE_ALL),\n trackFocusRegionHeader: (isDestinationPanel: boolean) => {\n if (isDestinationPanel) setFocusRegion(REGIONS_FOCUSES.DESTINATION_HEADER);\n else setFocusRegion(REGIONS_FOCUSES.SOURCE_HEADER);\n },\n trackFocusRegionBottom: (isDestinationPanel: boolean) => {\n if (isDestinationPanel) setFocusRegion(REGIONS_FOCUSES.DESTINATION_BOTTOM);\n else setFocusRegion(REGIONS_FOCUSES.SOURCE_BOTTOM);\n },\n trackFocusRegionPanel: (isDestinationPanel: boolean) => {\n if (isDestinationPanel) setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL);\n else setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL);\n },\n trackFocusRegionPanelItem: (isDestinationPanel: boolean) => {\n if (isDestinationPanel) setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL_ITEM);\n else setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL_ITEM);\n },\n trackFocusRegionPanelFocusMoveAll: (isDestinationPanel: boolean) => {\n if (isDestinationPanel) setFocusRegion(REGIONS_FOCUSES.DESTINATION_PANEL_ITEM_MOVE_ALL);\n else setFocusRegion(REGIONS_FOCUSES.SOURCE_PANEL_ITEM_MOVE_ALL);\n },\n trackFocusRegionReset: () => setFocusRegion(''),\n }),\n [mutableFocusRegion, setFocusRegion],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AACxB,0BAA+B;AAC/B,sBAAiC;AACjC,uBAAgC;AAEzB,MAAM,yBAAyB,MAAM;AAC1C,QAAM,kBAAc,kCAAiB,CAAC,UAAU,MAAM,WAAW;AAKjE,QAAM,yBAAqB,oCAAe,WAAW;AACrD,QAAM,qBAAiB,kCAAiB,CAAC,UAAU,MAAM,cAAc;AACvE,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA,8BAA8B,MAAM,eAAe,iC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 const internalStoreCreatorFunc = (autoCalculatedData) => (0, import_zustand.defa
|
|
|
78
78
|
dndDraggingItemMeta: null,
|
|
79
79
|
setDndDraggingItemMeta: (dndDraggingItemMeta) => set({ dndDraggingItemMeta }),
|
|
80
80
|
isDropValid: false,
|
|
81
|
-
setIsDropValid: (isDropValid) => set({ isDropValid })
|
|
81
|
+
setIsDropValid: (isDropValid) => set({ isDropValid }),
|
|
82
|
+
sourceLastSelectedItem: null,
|
|
83
|
+
setSourceLastSelectedItem: (sourceLastSelectedItem) => set({ sourceLastSelectedItem }),
|
|
84
|
+
destinationLastSelectedItem: null,
|
|
85
|
+
setDestinationLastSelectedItem: (destinationLastSelectedItem) => set({ destinationLastSelectedItem })
|
|
82
86
|
};
|
|
83
87
|
const composedInformation = {
|
|
84
|
-
getIsDragAndDropHappening: () => Boolean(get()?.lastActiveId) && get()?.lastActiveId !== ""
|
|
88
|
+
getIsDragAndDropHappening: () => Boolean(get()?.lastActiveId) && get()?.lastActiveId !== "",
|
|
89
|
+
getPanelLastSelectedItem: (isDestinationPanel) => isDestinationPanel ? get().destinationLastSelectedItem : get().sourceLastSelectedItem
|
|
85
90
|
};
|
|
86
91
|
return {
|
|
87
92
|
...constants,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/config/useStore/useStore.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* @typescript-eslint/eslint no-use-before-define: ['error',{ typedefs: false }] */\nimport { useCallback } from 'react';\nimport create, { type StoreApi } from 'zustand';\nimport createContext from 'zustand/context';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { type useShuttleVirtualized } from '../useAutoCalculated/useShuttleVirtualized';\nimport { type DSShuttleV2T, defaultProps } from '../../react-desc-prop-types';\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from '../../constants';\nimport { useAutoCalculated } from '../useAutoCalculated';\n\ntype FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\ntype FocusRegionSetter = (newVal: FocusRegion | ((arg: FocusRegion, store: InternalStore) => FocusRegion)) => void;\n\ntype FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\ntype FocusItemSetter = (newVal: FocusItem | ((arg: FocusItem, store: InternalStore) => FocusItem)) => void;\n\ntype FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\ntype FocusItemActionSetter = (\n newVal: FocusItemAction | ((arg: FocusItemAction, store: InternalStore) => FocusItemAction),\n) => void;\n\ntype UseShuttleVirtualizedT = ReturnType<typeof useShuttleVirtualized>;\nexport type InternalAtoms = {\n focusRegion: FocusRegion;\n setFocusRegion: FocusRegionSetter;\n focusItem: FocusItem;\n setFocusItem: FocusItemSetter;\n focusItemAction: FocusItemAction;\n setFocusItemAction: FocusItemActionSetter;\n dropIndicatorPosition: number;\n setDropIndicatorPosition: (newVal: number) => void;\n overId: string;\n setOverId: (newVal: string) => void;\n dndDraggingItem: DSShuttleV2T.ConfiguredDatum | null;\n setDndDraggingItem: (newVal: DSShuttleV2T.ConfiguredDatum | null) => void;\n dndDraggingItemMeta: DSShuttleV2T.ItemMeta | null;\n setDndDraggingItemMeta: (newVal: DSShuttleV2T.ItemMeta | null) => void;\n lastActiveId: string;\n setLastActiveId: (newVal: string) => void;\n isDropValid: boolean;\n setIsDropValid: (newVal: boolean) => void;\n};\nexport type ComposedInformation = {\n getIsDragAndDropHappening: () => boolean;\n};\n\nexport type StoreConstants = {\n set: StoreApi<InternalStore>['setState'];\n};\n\nexport interface InternalStore\n extends InternalAtoms,\n UseShuttleVirtualizedT,\n StoreConstants,\n ComposedInformation,\n ReturnType<typeof useAutoCalculated> {}\nexport interface PropsStore extends DSShuttleV2T.InternalProps {\n set: StoreApi<PropsStore>['setState'];\n}\n\nconst internalStoreCreatorFunc = (autoCalculatedData: ReturnType<typeof useAutoCalculated>) =>\n create<InternalStore>((set, get) => {\n const constants: StoreConstants = {\n set,\n };\n const internalAtoms: InternalAtoms = {\n focusRegion: '',\n setFocusRegion: (focusRegion) => {\n if (typeof focusRegion === 'function') set({ focusRegion: focusRegion(get().focusRegion, get()) });\n else set({ focusRegion });\n },\n focusItem: '',\n setFocusItem: (focusItem) => {\n if (typeof focusItem === 'function') set({ focusItem: focusItem(get().focusItem, get()) });\n else set({ focusItem });\n },\n focusItemAction: '',\n setFocusItemAction: (focusItemAction) => {\n if (typeof focusItemAction === 'function')\n set({ focusItemAction: focusItemAction(get().focusItemAction, get()) });\n else set({ focusItemAction });\n },\n dropIndicatorPosition: 0,\n setDropIndicatorPosition: (dropIndicatorPosition) => set({ dropIndicatorPosition }),\n overId: '',\n setOverId: (overId) => set({ overId }),\n lastActiveId: '',\n setLastActiveId: (lastActiveId) => set({ lastActiveId }),\n dndDraggingItem: null,\n setDndDraggingItem: (dndDraggingItem) => set({ dndDraggingItem }),\n dndDraggingItemMeta: null,\n setDndDraggingItemMeta: (dndDraggingItemMeta) => set({ dndDraggingItemMeta }),\n isDropValid: false,\n setIsDropValid: (isDropValid) => set({ isDropValid }),\n };\n\n const composedInformation: ComposedInformation = {\n getIsDragAndDropHappening: () => Boolean(get()?.lastActiveId) && get()?.lastActiveId !== '',\n };\n\n return {\n ...constants,\n ...internalAtoms,\n ...composedInformation,\n ...autoCalculatedData,\n };\n });\nconst propsStoreCreatorFunc = (propsWithDefaults: DSShuttleV2T.InternalProps) =>\n create<PropsStore>((set) => ({\n set,\n ...propsWithDefaults,\n }));\n\nconst {\n Provider: InternalProvider,\n useStore: useInternalStore,\n useStoreApi: useInternalStoreApi,\n} = createContext<ReturnType<typeof internalStoreCreatorFunc>>();\nconst {\n Provider: PropsProvider,\n useStore: usePropsStore,\n useStoreApi: usePropsStoreApi,\n} = createContext<ReturnType<typeof propsStoreCreatorFunc>>();\n\nconst useShuttleV2InternalStoreConfig = (propsFromUser: DSShuttleV2T.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSShuttleV2T.InternalProps>(propsFromUser, defaultProps);\n const autoCalculatedData = useAutoCalculated(propsWithDefaults);\n return useCallback(() => internalStoreCreatorFunc(autoCalculatedData), [autoCalculatedData]);\n};\nconst useShuttleV2PropsStoreConfig = (propsFromUser: DSShuttleV2T.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSShuttleV2T.InternalProps>(propsFromUser, defaultProps);\n\n return useCallback(() => propsStoreCreatorFunc(propsWithDefaults), [propsWithDefaults]);\n};\n\nexport {\n useInternalStore,\n usePropsStore,\n useInternalStoreApi,\n usePropsStoreApi,\n InternalProvider,\n PropsProvider,\n useShuttleV2InternalStoreConfig,\n useShuttleV2PropsStoreConfig,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA4B;AAC5B,qBAAsC;AACtC,qBAA0B;AAC1B,0BAA6C;AAE7C,mCAAgD;AAEhD,+BAAkC;
|
|
4
|
+
"sourcesContent": ["/* @typescript-eslint/eslint no-use-before-define: ['error',{ typedefs: false }] */\nimport { useCallback } from 'react';\nimport create, { type StoreApi } from 'zustand';\nimport createContext from 'zustand/context';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-utilities';\nimport { type useShuttleVirtualized } from '../useAutoCalculated/useShuttleVirtualized';\nimport { type DSShuttleV2T, defaultProps } from '../../react-desc-prop-types';\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from '../../constants';\nimport { useAutoCalculated } from '../useAutoCalculated';\n\ntype FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\ntype FocusRegionSetter = (newVal: FocusRegion | ((arg: FocusRegion, store: InternalStore) => FocusRegion)) => void;\n\ntype FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\ntype FocusItemSetter = (newVal: FocusItem | ((arg: FocusItem, store: InternalStore) => FocusItem)) => void;\n\ntype FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\ntype FocusItemActionSetter = (\n newVal: FocusItemAction | ((arg: FocusItemAction, store: InternalStore) => FocusItemAction),\n) => void;\n\ntype UseShuttleVirtualizedT = ReturnType<typeof useShuttleVirtualized>;\nexport type InternalAtoms = {\n focusRegion: FocusRegion;\n setFocusRegion: FocusRegionSetter;\n focusItem: FocusItem;\n setFocusItem: FocusItemSetter;\n focusItemAction: FocusItemAction;\n setFocusItemAction: FocusItemActionSetter;\n dropIndicatorPosition: number;\n setDropIndicatorPosition: (newVal: number) => void;\n overId: string;\n setOverId: (newVal: string) => void;\n dndDraggingItem: DSShuttleV2T.ConfiguredDatum | null;\n setDndDraggingItem: (newVal: DSShuttleV2T.ConfiguredDatum | null) => void;\n dndDraggingItemMeta: DSShuttleV2T.ItemMeta | null;\n setDndDraggingItemMeta: (newVal: DSShuttleV2T.ItemMeta | null) => void;\n lastActiveId: string;\n setLastActiveId: (newVal: string) => void;\n isDropValid: boolean;\n setIsDropValid: (newVal: boolean) => void;\n sourceLastSelectedItem: string | null | undefined;\n setSourceLastSelectedItem: (newVal: string | null | undefined) => void;\n destinationLastSelectedItem: string | null | undefined;\n setDestinationLastSelectedItem: (newVal: string | null | undefined) => void;\n};\nexport type ComposedInformation = {\n getIsDragAndDropHappening: () => boolean;\n getPanelLastSelectedItem: (isDestinationPanel: boolean) => string | null | undefined;\n};\n\nexport type StoreConstants = {\n set: StoreApi<InternalStore>['setState'];\n};\n\nexport interface InternalStore\n extends InternalAtoms,\n UseShuttleVirtualizedT,\n StoreConstants,\n ComposedInformation,\n ReturnType<typeof useAutoCalculated> {}\nexport interface PropsStore extends DSShuttleV2T.InternalProps {\n set: StoreApi<PropsStore>['setState'];\n}\n\nconst internalStoreCreatorFunc = (autoCalculatedData: ReturnType<typeof useAutoCalculated>) =>\n create<InternalStore>((set, get) => {\n const constants: StoreConstants = {\n set,\n };\n const internalAtoms: InternalAtoms = {\n focusRegion: '',\n setFocusRegion: (focusRegion) => {\n if (typeof focusRegion === 'function') set({ focusRegion: focusRegion(get().focusRegion, get()) });\n else set({ focusRegion });\n },\n focusItem: '',\n setFocusItem: (focusItem) => {\n if (typeof focusItem === 'function') set({ focusItem: focusItem(get().focusItem, get()) });\n else set({ focusItem });\n },\n focusItemAction: '',\n setFocusItemAction: (focusItemAction) => {\n if (typeof focusItemAction === 'function')\n set({ focusItemAction: focusItemAction(get().focusItemAction, get()) });\n else set({ focusItemAction });\n },\n dropIndicatorPosition: 0,\n setDropIndicatorPosition: (dropIndicatorPosition) => set({ dropIndicatorPosition }),\n overId: '',\n setOverId: (overId) => set({ overId }),\n lastActiveId: '',\n setLastActiveId: (lastActiveId) => set({ lastActiveId }),\n dndDraggingItem: null,\n setDndDraggingItem: (dndDraggingItem) => set({ dndDraggingItem }),\n dndDraggingItemMeta: null,\n setDndDraggingItemMeta: (dndDraggingItemMeta) => set({ dndDraggingItemMeta }),\n isDropValid: false,\n setIsDropValid: (isDropValid) => set({ isDropValid }),\n sourceLastSelectedItem: null,\n setSourceLastSelectedItem: (sourceLastSelectedItem) => set({ sourceLastSelectedItem }),\n destinationLastSelectedItem: null,\n setDestinationLastSelectedItem: (destinationLastSelectedItem) => set({ destinationLastSelectedItem }),\n };\n\n const composedInformation: ComposedInformation = {\n getIsDragAndDropHappening: () => Boolean(get()?.lastActiveId) && get()?.lastActiveId !== '',\n getPanelLastSelectedItem: (isDestinationPanel) =>\n isDestinationPanel ? get().destinationLastSelectedItem : get().sourceLastSelectedItem,\n };\n\n return {\n ...constants,\n ...internalAtoms,\n ...composedInformation,\n ...autoCalculatedData,\n };\n });\nconst propsStoreCreatorFunc = (propsWithDefaults: DSShuttleV2T.InternalProps) =>\n create<PropsStore>((set) => ({\n set,\n ...propsWithDefaults,\n }));\n\nconst {\n Provider: InternalProvider,\n useStore: useInternalStore,\n useStoreApi: useInternalStoreApi,\n} = createContext<ReturnType<typeof internalStoreCreatorFunc>>();\nconst {\n Provider: PropsProvider,\n useStore: usePropsStore,\n useStoreApi: usePropsStoreApi,\n} = createContext<ReturnType<typeof propsStoreCreatorFunc>>();\n\nconst useShuttleV2InternalStoreConfig = (propsFromUser: DSShuttleV2T.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSShuttleV2T.InternalProps>(propsFromUser, defaultProps);\n const autoCalculatedData = useAutoCalculated(propsWithDefaults);\n return useCallback(() => internalStoreCreatorFunc(autoCalculatedData), [autoCalculatedData]);\n};\nconst useShuttleV2PropsStoreConfig = (propsFromUser: DSShuttleV2T.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSShuttleV2T.InternalProps>(propsFromUser, defaultProps);\n\n return useCallback(() => propsStoreCreatorFunc(propsWithDefaults), [propsWithDefaults]);\n};\n\nexport {\n useInternalStore,\n usePropsStore,\n useInternalStoreApi,\n usePropsStoreApi,\n InternalProvider,\n PropsProvider,\n useShuttleV2InternalStoreConfig,\n useShuttleV2PropsStoreConfig,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA4B;AAC5B,qBAAsC;AACtC,qBAA0B;AAC1B,0BAA6C;AAE7C,mCAAgD;AAEhD,+BAAkC;AAyDlC,MAAM,2BAA2B,CAAC,2BAChC,eAAAA,SAAsB,CAAC,KAAK,QAAQ;AAClC,QAAM,YAA4B;AAAA,IAChC;AAAA,EACF;AACA,QAAM,gBAA+B;AAAA,IACnC,aAAa;AAAA,IACb,gBAAg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AA2C;AAAA,IAC/C,2BAA2B,MAAM,QAAQ,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,iBAAiB;AAAA,IACzF,0BAA0B,CAAC,uBACzB,qBAAqB,IAAI,EAAE,8BAA8B,IAAI,EAAE;AAAA,EACnE;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF,CAAC;AACH,MAAM,wBAAwB,CAAC,0BAC7B,eAAAA,SAAmB,CAAC,SAAS;AAAA,EAC3B;AAAA,EACA,GAAG;AACL,EAAE;AAEJ,MAAM;AAAA,EACJ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,aAAa;AACf,QAAI,eAAAC,SAA2D;AAC/D,MAAM;AAAA,EACJ,UAAU;AAAA,EACV,UAAU;AAAA,EACV,aAAa;AACf,QAAI,eAAAA,SAAwD;AAE5D,MAAM,kCAAkC,CAAC,kBAAsC;AAC7E,QAAM,wBAAoB,kDAAyD,eAAe,yCAAY;AAC9G,QAAM,yBAAqB,4CAAkB,iBAAiB;AAC9D,aAAO,0BAAY,MAAM,yBAAyB,kBAAkB,GAAG,CAAC,kBAAkB,CAAC;AAC7F;AACA,MAAM,+BAA+B,CAAC,kBAAsC;AAC1E,QAAM,wBAAoB,kDAAyD,eAAe,yCAAY;AAE9G,aAAO,0BAAY,MAAM,sBAAsB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;AACxF;",
|
|
6
6
|
"names": ["create", "createContext"]
|
|
7
7
|
}
|
|
@@ -36,7 +36,13 @@ var import_ds_system = require("@elliemae/ds-system");
|
|
|
36
36
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
37
37
|
var import_constants = require("../../constants");
|
|
38
38
|
const StyledGripperButtonOrOverlay = import_ds_system.styled.div`
|
|
39
|
-
cursor: ${({ isActive, isDragOverlay }) =>
|
|
39
|
+
cursor: ${({ isActive, isDragOverlay, disabled }) => {
|
|
40
|
+
if (isActive || isDragOverlay)
|
|
41
|
+
return "grabbing";
|
|
42
|
+
if (disabled)
|
|
43
|
+
return "not-allowed";
|
|
44
|
+
return "grab";
|
|
45
|
+
}};
|
|
40
46
|
outline: none;
|
|
41
47
|
display: flex;
|
|
42
48
|
align-items: center;
|
|
@@ -45,20 +51,21 @@ const StyledGripperButtonOrOverlay = import_ds_system.styled.div`
|
|
|
45
51
|
outline: 1px solid brand-700;
|
|
46
52
|
}
|
|
47
53
|
`;
|
|
48
|
-
const DragHandle = ({ id, isDndActive, isDragging, innerRef, useSortableHelpers }) => /* @__PURE__ */ (0, import_react.createElement)(
|
|
54
|
+
const DragHandle = ({ id, isDndActive, isDragging, disabled = false, innerRef, useSortableHelpers }) => /* @__PURE__ */ (0, import_react.createElement)(
|
|
49
55
|
StyledGripperButtonOrOverlay,
|
|
50
56
|
{
|
|
51
|
-
|
|
57
|
+
...!disabled && useSortableHelpers ? {
|
|
52
58
|
...useSortableHelpers.listeners,
|
|
53
59
|
...useSortableHelpers.attributes
|
|
54
|
-
},
|
|
60
|
+
} : {},
|
|
55
61
|
isActive: isDndActive,
|
|
56
62
|
ref: (0, import_ds_utilities.mergeRefs)(innerRef, useSortableHelpers?.setActivatorNodeRef),
|
|
57
63
|
tabIndex: -1,
|
|
58
64
|
"data-testid": import_constants.DATA_TESTID.SHUTTLE_DRAG_HANDLE,
|
|
59
65
|
id: `${id}-drag-handle`,
|
|
60
|
-
key: `${id}-drag-handle
|
|
66
|
+
key: `${id}-drag-handle`,
|
|
67
|
+
disabled
|
|
61
68
|
},
|
|
62
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.GripperVertical, { size: "s", color: isDragging ? ["neutral", "500"] : ["brand-primary", "800"] })
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.GripperVertical, { size: "s", color: isDragging || disabled ? ["neutral", "500"] : ["brand-primary", "800"] })
|
|
63
70
|
);
|
|
64
71
|
//# sourceMappingURL=DndHandle.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Dnd/DndHandle.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable indent */\nimport React from 'react';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport type { useSortable } from '@elliemae/ds-drag-and-drop';\n\nimport { styled } from '@elliemae/ds-system';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { DATA_TESTID } from '../../constants';\n\nexport const StyledGripperButtonOrOverlay = styled.div<{\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 &:focus {\n outline: 1px solid brand-700;\n }\n`;\n\nexport const DragHandle: React.ComponentType<{\n id: string;\n innerRef: React.RefObject<HTMLDivElement> | React.RefCallback<HTMLDivElement>;\n useSortableHelpers: ReturnType<typeof useSortable>;\n isDndActive: boolean;\n isDragging: boolean;\n disabled?: boolean;\n}> = ({ id, isDndActive, isDragging, disabled = false, innerRef, useSortableHelpers }) => (\n <StyledGripperButtonOrOverlay\n {...(!disabled && useSortableHelpers\n ? {\n ...useSortableHelpers.listeners,\n ...useSortableHelpers.attributes,\n }\n : {})}\n isActive={isDndActive}\n ref={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 >\n <GripperVertical size=\"s\" color={isDragging || disabled ? ['neutral', '500'] : ['brand-primary', '800']} />\n </StyledGripperButtonOrOverlay>\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDnB;AAfF;AAlCF,sBAAgC;AAGhC,uBAAuB;AACvB,0BAA0B;AAC1B,uBAA4B;AAErB,MAAM,+BAA+B,wBAAO;AAAA,YAKvC,CAAC,EAAE,UAAU,eAAe,SAAS,MAAM;AACnD,MAAI,YAAY;AAAe,WAAO;AACtC,MAAI;AAAU,WAAO;AACrB,SAAO;AACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUK,MAAM,aAOR,CAAC,EAAE,IAAI,aAAa,YAAY,WAAW,OAAO,UAAU,mBAAmB,MAClF;AAAA,EAAC;AAAA;AAAA,IACE,GAAI,CAAC,YAAY,qBACd;AAAA,MACE,GAAG,mBAAmB;AAAA,MACtB,GAAG,mBAAmB;AAAA,IACxB,IACA,CAAC;AAAA,IACL,UAAU;AAAA,IACV,SAAK,+BAAU,UAAU,oBAAoB,mBAAmB;AAAA,IAChE,UAAU;AAAA,IACV,eAAa,6BAAY;AAAA,IACzB,IAAI,GAAG;AAAA,IACP,KAAK,GAAG;AAAA,IACR;AAAA;AAAA,EAEA,4CAAC,mCAAgB,MAAK,KAAI,OAAO,cAAc,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK,GAAG;AAC3G;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/parts/Header.js
CHANGED
|
@@ -32,12 +32,12 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
32
32
|
var import_react = __toESM(require("react"));
|
|
33
33
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
34
34
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
35
|
-
var
|
|
35
|
+
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
36
36
|
var import_ds_system = require("@elliemae/ds-system");
|
|
37
37
|
var import_DSShuttleV2Definitions = require("../config/DSShuttleV2Definitions");
|
|
38
38
|
var import_useStore = require("../config/useStore");
|
|
39
39
|
var import_useFocusTracker = require("../config/useFocusTracker");
|
|
40
|
-
const StyledIconButton = (0, import_ds_system.styled)(
|
|
40
|
+
const StyledIconButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2, { name: import_DSShuttleV2Definitions.DSShuttleV2Name, slot: import_DSShuttleV2Definitions.DSShuttleV2Slots.HEADER_SEARCH_ICON })`
|
|
41
41
|
width: 1.231rem;
|
|
42
42
|
height: 1.231rem;
|
|
43
43
|
`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/Header.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Search } from '@elliemae/ds-icons';\nimport {\n DSButtonV2,\n type DSButtonT,\n // BUTTON_SIZES\n} from '@elliemae/ds-button';\nimport { styled } from '@elliemae/ds-system';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../config/DSShuttleV2Definitions';\nimport { usePropsStore } from '../config/useStore';\nimport { useFocusTracker } from '../config/useFocusTracker';\nimport { type DSShuttleV2T } from '../react-desc-prop-types';\n\nconst StyledIconButton = styled(DSButtonV2, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.HEADER_SEARCH_ICON })`\n width: 1.231rem;\n height: 1.231rem;\n`;\nexport const Header = React.memo(({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {\n const HeaderRenderer = usePropsStore((state) => (isDestinationPanel ? state.DestinationHeader : state.SourceHeader));\n const onSearchBarOpen = usePropsStore((state) =>\n isDestinationPanel ? state.onDesinationOpenSearchbar : state.onSourceOpenSearchbar,\n );\n const isSearchBarOpen = usePropsStore((state) =>\n isDestinationPanel ? state.destinationShowSearchbar : state.sourceShowSearchbar,\n );\n const { trackFocusRegionHeader, trackFocusItemReset, trackFocusActionReset } = useFocusTracker();\n const onHeaderFocus = React.useCallback(() => {\n trackFocusRegionHeader(isDestinationPanel);\n trackFocusItemReset();\n trackFocusActionReset();\n }, [isDestinationPanel, trackFocusActionReset, trackFocusItemReset, trackFocusRegionHeader]);\n\n const handleFilterClick = React.useCallback(\n (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => {\n onSearchBarOpen?.(!isSearchBarOpen, { event });\n },\n [isSearchBarOpen, onSearchBarOpen],\n );\n\n const cols = React.useMemo(() => {\n const finalCols = ['1fr'];\n if (onSearchBarOpen) finalCols.push('auto');\n return finalCols;\n }, [onSearchBarOpen]);\n\n return (\n <Grid onFocus={onHeaderFocus} cols={cols}>\n <HeaderRenderer />\n {onSearchBarOpen ? (\n <StyledIconButton buttonType=\"icon\" onClick={handleFilterClick}>\n <Search width=\"1.077rem\" height=\"1.077rem\" />\n </StyledIconButton>\n ) : null}\n </Grid>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+CnB;AA/CJ,mBAAkB;AAClB,qBAAqB;AACrB,sBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Search } from '@elliemae/ds-icons';\nimport {\n DSButtonV2,\n type DSButtonT,\n // BUTTON_SIZES\n} from '@elliemae/ds-button-v2';\nimport { styled } from '@elliemae/ds-system';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../config/DSShuttleV2Definitions';\nimport { usePropsStore } from '../config/useStore';\nimport { useFocusTracker } from '../config/useFocusTracker';\nimport { type DSShuttleV2T } from '../react-desc-prop-types';\n\nconst StyledIconButton = styled(DSButtonV2, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.HEADER_SEARCH_ICON })`\n width: 1.231rem;\n height: 1.231rem;\n`;\nexport const Header = React.memo(({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {\n const HeaderRenderer = usePropsStore((state) => (isDestinationPanel ? state.DestinationHeader : state.SourceHeader));\n const onSearchBarOpen = usePropsStore((state) =>\n isDestinationPanel ? state.onDesinationOpenSearchbar : state.onSourceOpenSearchbar,\n );\n const isSearchBarOpen = usePropsStore((state) =>\n isDestinationPanel ? state.destinationShowSearchbar : state.sourceShowSearchbar,\n );\n const { trackFocusRegionHeader, trackFocusItemReset, trackFocusActionReset } = useFocusTracker();\n const onHeaderFocus = React.useCallback(() => {\n trackFocusRegionHeader(isDestinationPanel);\n trackFocusItemReset();\n trackFocusActionReset();\n }, [isDestinationPanel, trackFocusActionReset, trackFocusItemReset, trackFocusRegionHeader]);\n\n const handleFilterClick = React.useCallback(\n (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => {\n onSearchBarOpen?.(!isSearchBarOpen, { event });\n },\n [isSearchBarOpen, onSearchBarOpen],\n );\n\n const cols = React.useMemo(() => {\n const finalCols = ['1fr'];\n if (onSearchBarOpen) finalCols.push('auto');\n return finalCols;\n }, [onSearchBarOpen]);\n\n return (\n <Grid onFocus={onHeaderFocus} cols={cols}>\n <HeaderRenderer />\n {onSearchBarOpen ? (\n <StyledIconButton buttonType=\"icon\" onClick={handleFilterClick}>\n <Search width=\"1.077rem\" height=\"1.077rem\" />\n </StyledIconButton>\n ) : null}\n </Grid>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+CnB;AA/CJ,mBAAkB;AAClB,qBAAqB;AACrB,sBAAuB;AACvB,0BAIO;AACP,uBAAuB;AACvB,oCAAkD;AAClD,sBAA8B;AAC9B,6BAAgC;AAGhC,MAAM,uBAAmB,yBAAO,gCAAY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48
|
var import_DropIndicator = require("../Dnd/DropIndicator");
|
|
49
49
|
var import_withConditionalUseSortable = require("../HoC/withConditionalUseSortable");
|
|
50
50
|
var import_useInnerRefHandlers = require("./ItemActions/useInnerRefHandlers");
|
|
51
|
+
var import_useItemKeyboardSelection = require("./useItemKeyboardSelection");
|
|
51
52
|
const cssDisabled = import_ds_system.css`
|
|
52
53
|
background-color: ${({ theme }) => theme.colors.neutral["100"]};
|
|
53
54
|
color: ${({ theme }) => theme.colors.neutral["300"]};
|
|
@@ -103,7 +104,7 @@ const useInnerRefHandlers = ({ datum, datumInternalMeta, isDestinationPanel }) =
|
|
|
103
104
|
return import_react.default.useMemo(() => ({ shouldFocus, innerRefHandlerParentItem }), [shouldFocus, innerRefHandlerParentItem]);
|
|
104
105
|
};
|
|
105
106
|
const Item = import_react.default.memo((itemMeta) => {
|
|
106
|
-
const { datumInternalMeta, withDragNDrop, useSortableHelpers,
|
|
107
|
+
const { datumInternalMeta, withDragNDrop, useSortableHelpers, hasMultipleSelection } = itemMeta;
|
|
107
108
|
const { isSelected, hydratedId } = datumInternalMeta;
|
|
108
109
|
const cols = (0, import_react.useMemo)(() => {
|
|
109
110
|
if (withDragNDrop)
|
|
@@ -113,7 +114,6 @@ const Item = import_react.default.memo((itemMeta) => {
|
|
|
113
114
|
const setDndDraggingItemMeta = (0, import_useStore.useInternalStore)((state) => state.setDndDraggingItemMeta);
|
|
114
115
|
const dndDraggingItemMeta = (0, import_useStore.useInternalStore)((state) => state.dndDraggingItemMeta);
|
|
115
116
|
const getIsDragAndDropHappening = (0, import_useStore.useInternalStore)((state) => state.getIsDragAndDropHappening);
|
|
116
|
-
const isDragAndDropHappening = getIsDragAndDropHappening();
|
|
117
117
|
const dndDraggingItem = (0, import_useStore.useInternalStore)((state) => state.dndDraggingItem);
|
|
118
118
|
const isDraggingThisItem = dndDraggingItem?.hydratedId === hydratedId;
|
|
119
119
|
import_react.default.useEffect(() => {
|
|
@@ -126,24 +126,15 @@ const Item = import_react.default.memo((itemMeta) => {
|
|
|
126
126
|
itemMeta,
|
|
127
127
|
setDndDraggingItemMeta
|
|
128
128
|
]);
|
|
129
|
-
const selectItem = (0, import_useSelectionLogic.useSelectionLogic)(itemMeta);
|
|
129
|
+
const { selectItem, onShiftMouseDownPreventTextSelection } = (0, import_useSelectionLogic.useSelectionLogic)(itemMeta);
|
|
130
130
|
const { onItemContainerKeyDown } = (0, import_useItemArrowNavigation.useItemArrowNavigation)(itemMeta);
|
|
131
|
+
const { onItemKeyDownSelection } = (0, import_useItemKeyboardSelection.useItemKeyboardSelection)(itemMeta);
|
|
131
132
|
const handleItemKeyDown = import_react.default.useCallback(
|
|
132
133
|
(event) => {
|
|
133
|
-
|
|
134
|
-
if (["Spacebar", " ", "Enter"].includes(key)) {
|
|
135
|
-
const isDragNDroping = getIsDragAndDropHappening();
|
|
136
|
-
if (isDragNDroping || event.target.id === `${hydratedId}-drag-handle`) {
|
|
137
|
-
event.preventDefault();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
event.preventDefault();
|
|
141
|
-
event.stopPropagation();
|
|
142
|
-
selectItem(event);
|
|
143
|
-
}
|
|
134
|
+
onItemKeyDownSelection(event);
|
|
144
135
|
onItemContainerKeyDown(event);
|
|
145
136
|
},
|
|
146
|
-
[
|
|
137
|
+
[onItemKeyDownSelection, onItemContainerKeyDown]
|
|
147
138
|
);
|
|
148
139
|
const { shouldFocus, innerRefHandlerParentItem } = useInnerRefHandlers(itemMeta);
|
|
149
140
|
const { innerRefHandlerDnd } = (0, import_useInnerRefHandlers.useInnerRefHandlers)(itemMeta);
|
|
@@ -157,12 +148,13 @@ const Item = import_react.default.memo((itemMeta) => {
|
|
|
157
148
|
ItemWrapper,
|
|
158
149
|
{
|
|
159
150
|
isDragging: isDraggingThisItem,
|
|
160
|
-
isDndActive:
|
|
151
|
+
isDndActive: getIsDragAndDropHappening(),
|
|
161
152
|
cols,
|
|
162
153
|
alignItems: "center",
|
|
163
154
|
onClick: selectItem,
|
|
164
|
-
ref: (0, import_ds_utilities.mergeRefs)(innerRefHandlerParentItem, sortableRef
|
|
155
|
+
ref: (0, import_ds_utilities.mergeRefs)(innerRefHandlerParentItem, sortableRef),
|
|
165
156
|
onKeyDown: handleItemKeyDown,
|
|
157
|
+
onMouseDown: onShiftMouseDownPreventTextSelection,
|
|
166
158
|
tabIndex: shouldFocus ? 0 : -1,
|
|
167
159
|
role: "checkbox",
|
|
168
160
|
"aria-checked": isSelected,
|
|
@@ -174,9 +166,10 @@ const Item = import_react.default.memo((itemMeta) => {
|
|
|
174
166
|
{
|
|
175
167
|
id: hydratedId,
|
|
176
168
|
useSortableHelpers,
|
|
177
|
-
isDndActive:
|
|
169
|
+
isDndActive: getIsDragAndDropHappening(),
|
|
178
170
|
isDragging: dndDraggingItem?.hydratedId === hydratedId,
|
|
179
|
-
innerRef: innerRefHandlerDnd
|
|
171
|
+
innerRef: innerRefHandlerDnd,
|
|
172
|
+
disabled: hasMultipleSelection
|
|
180
173
|
}
|
|
181
174
|
) : null,
|
|
182
175
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ItemMiddleSection.ItemMiddleSection, { ...itemMeta }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Item/Item.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\nimport React, { useMemo } from 'react';\nimport { styled, css } from '@elliemae/ds-system';\nimport { mergeRefs } from '@elliemae/ds-utilities';\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\nimport React, { useMemo } from 'react';\nimport { styled, css } from '@elliemae/ds-system';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { Grid } from '@elliemae/ds-grid';\n\nimport { type DSShuttleV2T } from '../../react-desc-prop-types';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../config/DSShuttleV2Definitions';\nimport { useInternalStore } from '../../config/useStore';\nimport { useFocusTracker } from '../../config/useFocusTracker';\nimport { ItemSelection } from './ItemSelection';\nimport { ItemActions } from './ItemActions';\nimport { ItemMiddleSection } from './ItemMiddleSection';\nimport { useSelectionLogic } from './useSelectionLogic';\nimport { useItemArrowNavigation } from './useItemArrowNavigation';\nimport { REGIONS_FOCUSES } from '../../constants';\nimport { DragHandle } from '../Dnd/DndHandle';\nimport { DropIndicator } from '../Dnd/DropIndicator';\nimport { withConditionalUseSortable } from '../HoC/withConditionalUseSortable';\nimport { useInnerRefHandlers as useInnerRefActionHandlers } from './ItemActions/useInnerRefHandlers';\nimport { useItemKeyboardSelection } from './useItemKeyboardSelection';\n// we are using the class-name added via slot for the children `:hover` styling of icon colors\n\nconst cssDisabled = css`\n background-color: ${({ theme }) => theme.colors.neutral['100']};\n color: ${({ theme }) => theme.colors.neutral['300']};\n .ds-shuttle-v2-item-action-btn-to-source-icon > svg,\n .ds-shuttle-v2-item-action-btn-to-destination-icon > svg,\n .ds-shuttle-v2-item-action-btn-drilldown-icon > svg {\n fill: ${({ theme }) => theme.colors.neutral['300']};\n }\n`;\n\ninterface ItemWrapperT {\n isDragging: boolean;\n isDndActive: 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 .ds-shuttle-v2-item-action-btn-to-source-icon > svg,\n .ds-shuttle-v2-item-action-btn-to-destination-icon > svg,\n .ds-shuttle-v2-item-action-btn-drilldown-icon > svg {\n fill: brand-700;\n }\n ${({ isDragging }) => isDragging && cssDisabled}\n }\n\n &:focus {\n outline: 2px solid brand-700;\n outline-offset: -2px;\n }\n border-bottom: 1px solid neutral-100;\n\n ${({ isDragging }) => isDragging && cssDisabled}\n`;\n\nconst useInnerRefHandlers = ({ datum, datumInternalMeta, isDestinationPanel }: DSShuttleV2T.ItemMeta) => {\n const { isFirst, isLast, hydratedId } = datumInternalMeta;\n const { trackFocusItem } = useFocusTracker();\n const focusRegion = useInternalStore((state) => state.focusRegion);\n const focusItem = useInternalStore((state) => state.focusItem);\n const focusItemAction = useInternalStore((state) => state.focusItemAction);\n const currRegion = isDestinationPanel ? REGIONS_FOCUSES.DESTINATION_PANEL_ITEM : REGIONS_FOCUSES.SOURCE_PANEL_ITEM;\n const currItemId = hydratedId;\n\n const shouldFocus = React.useMemo(\n () =>\n focusRegion === currRegion &&\n focusItemAction === 'parent' &&\n (focusItem === currItemId || (isFirst && focusItem === 'first') || (isLast && focusItem === 'last')),\n [currItemId, currRegion, focusItem, focusItemAction, focusRegion, isFirst, isLast],\n );\n const innerRefHandlerParentItem = React.useCallback(\n (node: HTMLDivElement | null) => {\n if (shouldFocus) {\n node?.focus();\n trackFocusItem({ original: datum, ...datumInternalMeta }); // this converts 'first'/'last' to actual id -> prevents 'last' to focus \"new last\" if new items are added\n }\n },\n [datum, datumInternalMeta, shouldFocus, trackFocusItem],\n );\n return React.useMemo(() => ({ shouldFocus, innerRefHandlerParentItem }), [shouldFocus, innerRefHandlerParentItem]);\n};\n\nexport const Item = React.memo((itemMeta: DSShuttleV2T.ItemMeta) => {\n const { datumInternalMeta, withDragNDrop, useSortableHelpers, hasMultipleSelection } = itemMeta;\n const { isSelected, hydratedId } = datumInternalMeta;\n\n const cols = useMemo(() => {\n if (withDragNDrop) return ['5px', 'auto', '1fr', 'auto'];\n return ['5px', '1fr', 'auto'];\n }, [withDragNDrop]);\n\n const setDndDraggingItemMeta = useInternalStore((state) => state.setDndDraggingItemMeta);\n const dndDraggingItemMeta = useInternalStore((state) => state.dndDraggingItemMeta);\n const getIsDragAndDropHappening = useInternalStore((state) => state.getIsDragAndDropHappening);\n const dndDraggingItem = useInternalStore((state) => state.dndDraggingItem);\n const isDraggingThisItem = dndDraggingItem?.hydratedId === hydratedId;\n React.useEffect(() => {\n if (isDraggingThisItem && dndDraggingItemMeta?.datumInternalMeta.hydratedId !== hydratedId)\n setDndDraggingItemMeta(itemMeta);\n }, [\n dndDraggingItemMeta?.datumInternalMeta.hydratedId,\n hydratedId,\n isDraggingThisItem,\n itemMeta,\n setDndDraggingItemMeta,\n ]);\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 { shouldFocus, innerRefHandlerParentItem } = useInnerRefHandlers(itemMeta);\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 ? useSortableHelpers?.setNodeRef : () => {};\n return (\n <ItemWrapper\n isDragging={isDraggingThisItem}\n isDndActive={getIsDragAndDropHappening()}\n cols={cols}\n alignItems=\"center\"\n onClick={selectItem}\n ref={mergeRefs(innerRefHandlerParentItem, sortableRef)}\n onKeyDown={handleItemKeyDown}\n onMouseDown={onShiftMouseDownPreventTextSelection}\n tabIndex={shouldFocus ? 0 : -1}\n role=\"checkbox\"\n aria-checked={isSelected}\n id={`${hydratedId}-wrapper`}\n >\n <ItemSelection {...itemMeta} />\n {withDragNDrop && useSortableHelpers ? (\n <DragHandle\n id={hydratedId}\n useSortableHelpers={useSortableHelpers}\n isDndActive={getIsDragAndDropHappening()}\n isDragging={dndDraggingItem?.hydratedId === hydratedId}\n innerRef={innerRefHandlerDnd}\n disabled={hasMultipleSelection}\n />\n ) : null}\n <ItemMiddleSection {...itemMeta} />\n <ItemActions {...itemMeta} />\n <DropIndicator vertical={false} dropIndicatorPosition={showDropIndicatorPosition} isDropValid={isDropValid} />\n </ItemWrapper>\n );\n});\n\nconst ItemSortable = withConditionalUseSortable(Item);\nexport { ItemSortable };\nexport default ItemSortable;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADsInB;AArIJ,mBAA+B;AAC/B,uBAA4B;AAC5B,0BAA0B;AAC1B,qBAAqB;AAGrB,oCAAkD;AAClD,sBAAiC;AACjC,6BAAgC;AAChC,2BAA8B;AAC9B,yBAA4B;AAC5B,+BAAkC;AAClC,+BAAkC;AAClC,oCAAuC;AACvC,uBAAgC;AAChC,uBAA2B;AAC3B,2BAA8B;AAC9B,wCAA2C;AAC3C,iCAAiE;AACjE,sCAAyC;AAGzC,MAAM,cAAc;AAAA,sBACE,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ;AAAA,WAC/C,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA,YAInC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAShD,MAAM,kBAAc,yBAAO,qBAAM,EAAE,MAAM,+CAAiB,MAAM,+CAAiB,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,wBAKvE,CAAC,EAAE,aAAa,MAAM,MAAO,CAAC,cAAc,MAAM,OAAO,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM1F,CAAC,EAAE,WAAW,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;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aAAa,0BAA0B;AAAA,MACvC;AAAA,MACA,YAAW;AAAA,MACX,SAAS;AAAA,MACT,SAAK,+BAAU,2BAA2B,WAAW;AAAA,MACrD,WAAW;AAAA,MACX,aAAa;AAAA,MACb,UAAU,cAAc,IAAI;AAAA,MAC5B,MAAK;AAAA,MACL,gBAAc;AAAA,MACd,IAAI,GAAG;AAAA,MAEP;AAAA,oDAAC,sCAAe,GAAG,UAAU;AAAA,QAC5B,iBAAiB,qBAChB;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ;AAAA,YACA,aAAa,0BAA0B;AAAA,YACvC,YAAY,iBAAiB,eAAe;AAAA,YAC5C,UAAU;AAAA,YACV,UAAU;AAAA;AAAA,QACZ,IACE;AAAA,QACJ,4CAAC,8CAAmB,GAAG,UAAU;AAAA,QACjC,4CAAC,kCAAa,GAAG,UAAU;AAAA,QAC3B,4CAAC,sCAAc,UAAU,OAAO,uBAAuB,2BAA2B,aAA0B;AAAA;AAAA;AAAA,EAC9G;AAEJ,CAAC;AAED,MAAM,mBAAe,8DAA2B,IAAI;AAEpD,IAAO,eAAQ;",
|
|
6
6
|
"names": ["React", "useInnerRefActionHandlers"]
|
|
7
7
|
}
|
|
@@ -32,14 +32,14 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
32
32
|
var import_react = __toESM(require("react"));
|
|
33
33
|
var import_ds_system = require("@elliemae/ds-system");
|
|
34
34
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
35
|
-
var
|
|
35
|
+
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
36
36
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
37
37
|
var import_useActionsHandlers = require("./useActionsHandlers");
|
|
38
38
|
var import_useInnerRefHandlers = require("./useInnerRefHandlers");
|
|
39
39
|
var import_DSShuttleV2Definitions = require("../../../config/DSShuttleV2Definitions");
|
|
40
40
|
const StyledItemActions = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_DSShuttleV2Definitions.DSShuttleV2Name, slot: import_DSShuttleV2Definitions.DSShuttleV2Slots.ITEM_ACTIONS_WRAPPER })``;
|
|
41
41
|
const StyledItemActionWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: import_DSShuttleV2Definitions.DSShuttleV2Name, slot: import_DSShuttleV2Definitions.DSShuttleV2Slots.ITEM_ACTION_WRAPPER })``;
|
|
42
|
-
const StyledButton = (0, import_ds_system.styled)(
|
|
42
|
+
const StyledButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2, { name: import_DSShuttleV2Definitions.DSShuttleV2Name, slot: import_DSShuttleV2Definitions.DSShuttleV2Slots.ITEM_ACTION_BTN })`
|
|
43
43
|
height: 1.692rem !important;
|
|
44
44
|
svg {
|
|
45
45
|
fill: brand-600;
|
|
@@ -63,20 +63,21 @@ const StyledArrowShortRightIcon = (0, import_ds_system.styled)(import_ds_icons.A
|
|
|
63
63
|
const actionsCols = ["1.538rem", "1.538rem"];
|
|
64
64
|
const ItemActions = import_react.default.memo((itemMeta) => {
|
|
65
65
|
const { datumHydratables, isDestinationPanel, datumRenderFlags } = itemMeta;
|
|
66
|
-
const { withActions } = datumRenderFlags;
|
|
66
|
+
const { withActions, internallyDisabledDrilldown, internallyDisabledMove } = datumRenderFlags;
|
|
67
67
|
const { preventDrilldown, preventMove } = datumHydratables;
|
|
68
68
|
const { shouldFocusDrilldown, shouldFocusMove, innerRefHandlerDrilldown, innerRefHandlerMove } = (0, import_useInnerRefHandlers.useInnerRefHandlers)(itemMeta);
|
|
69
|
-
const { handleClickDrilldown, handleClickSingleMove } = (0, import_useActionsHandlers.useActionsHandlers)(itemMeta);
|
|
69
|
+
const { handleClickDrilldown, handleClickSingleMove, handleKeyDownSelectionBubbleUp } = (0, import_useActionsHandlers.useActionsHandlers)(itemMeta);
|
|
70
70
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledItemActions, { cols: actionsCols, gutter: "xxs", pl: "xs", pr: "xxs", alignItems: "center", children: withActions ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
71
71
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledItemActionWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
72
|
StyledButton,
|
|
73
73
|
{
|
|
74
74
|
buttonType: "icon",
|
|
75
75
|
onClick: handleClickDrilldown,
|
|
76
|
-
|
|
76
|
+
onKeyDown: handleKeyDownSelectionBubbleUp,
|
|
77
|
+
size: import_ds_button_v2.BUTTON_SIZES.S,
|
|
77
78
|
innerRef: innerRefHandlerDrilldown,
|
|
78
79
|
tabIndex: shouldFocusDrilldown && !preventDrilldown ? 0 : -1,
|
|
79
|
-
disabled: preventDrilldown === true,
|
|
80
|
+
disabled: internallyDisabledDrilldown || preventDrilldown === true,
|
|
80
81
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledDrilldownIcon, { width: "1.538rem", height: "1.538rem" })
|
|
81
82
|
}
|
|
82
83
|
) }),
|
|
@@ -85,10 +86,11 @@ const ItemActions = import_react.default.memo((itemMeta) => {
|
|
|
85
86
|
{
|
|
86
87
|
buttonType: "icon",
|
|
87
88
|
onClick: handleClickSingleMove,
|
|
88
|
-
|
|
89
|
+
onKeyDown: handleKeyDownSelectionBubbleUp,
|
|
90
|
+
size: import_ds_button_v2.BUTTON_SIZES.S,
|
|
89
91
|
innerRef: innerRefHandlerMove,
|
|
90
92
|
tabIndex: shouldFocusMove && !preventMove ? 0 : -1,
|
|
91
|
-
disabled: preventMove === true,
|
|
93
|
+
disabled: internallyDisabledMove || preventMove === true,
|
|
92
94
|
children: isDestinationPanel ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCloseMediumIcon, { width: "1.538rem", height: "1.538rem" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledArrowShortRightIcon, { width: "1.538rem", height: "1.538rem" })
|
|
93
95
|
}
|
|
94
96
|
) })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Item/ItemActions/ItemActions.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2, BUTTON_SIZES } from '@elliemae/ds-button';\nimport { ArrowShortReturn, ArrowShortRight, CloseMedium } from '@elliemae/ds-icons';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types';\nimport { useActionsHandlers } from './useActionsHandlers';\nimport { useInnerRefHandlers } from './useInnerRefHandlers';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../config/DSShuttleV2Definitions';\n\nconst StyledItemActions = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTIONS_WRAPPER })``;\nconst StyledItemActionWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTION_WRAPPER })``;\nconst StyledButton = styled(DSButtonV2, { 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 { datumHydratables, isDestinationPanel, datumRenderFlags } = itemMeta;\n // withActions is calculated in /src/config/configureAutoCalculated.ts\n const { withActions } = datumRenderFlags;\n const { preventDrilldown, preventMove } = datumHydratables;\n const { shouldFocusDrilldown, shouldFocusMove, innerRefHandlerDrilldown, innerRefHandlerMove } =\n useInnerRefHandlers(itemMeta);\n const { handleClickDrilldown, handleClickSingleMove } = useActionsHandlers(itemMeta);\n\n return (\n <StyledItemActions cols={actionsCols} gutter=\"xxs\" pl=\"xs\" pr=\"xxs\" alignItems=\"center\">\n {withActions ? (\n <>\n <StyledItemActionWrapper>\n <StyledButton\n buttonType=\"icon\"\n onClick={handleClickDrilldown}\n size={BUTTON_SIZES.S}\n innerRef={innerRefHandlerDrilldown}\n tabIndex={shouldFocusDrilldown && !preventDrilldown ? 0 : -1}\n disabled={preventDrilldown === true}\n >\n <StyledDrilldownIcon width=\"1.538rem\" height=\"1.538rem\" />\n </StyledButton>\n </StyledItemActionWrapper>\n <StyledItemActionWrapper>\n <StyledButton\n buttonType=\"icon\"\n onClick={handleClickSingleMove}\n size={BUTTON_SIZES.S}\n innerRef={innerRefHandlerMove}\n tabIndex={shouldFocusMove && !preventMove ? 0 : -1}\n disabled={preventMove === true}\n >\n {isDestinationPanel ? (\n <StyledCloseMediumIcon width=\"1.538rem\" height=\"1.538rem\" />\n ) : (\n <StyledArrowShortRightIcon width=\"1.538rem\" height=\"1.538rem\" />\n )}\n </StyledButton>\n </StyledItemActionWrapper>\n </>\n ) : (\n // this is a place-holder used for mantainting the grid spacing\n <>\n <div />\n <div />\n </>\n )}\n </StyledItemActions>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgDf;AAhDR,mBAAkB;AAClB,uBAAuB;AACvB,qBAAqB;AACrB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2, BUTTON_SIZES } from '@elliemae/ds-button-v2';\nimport { ArrowShortReturn, ArrowShortRight, CloseMedium } from '@elliemae/ds-icons';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types';\nimport { useActionsHandlers } from './useActionsHandlers';\nimport { useInnerRefHandlers } from './useInnerRefHandlers';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../../../config/DSShuttleV2Definitions';\n\nconst StyledItemActions = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTIONS_WRAPPER })``;\nconst StyledItemActionWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.ITEM_ACTION_WRAPPER })``;\nconst StyledButton = styled(DSButtonV2, { 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 { datumHydratables, isDestinationPanel, datumRenderFlags } = itemMeta;\n // withActions is calculated in /src/config/configureAutoCalculated.ts\n const { withActions, internallyDisabledDrilldown, internallyDisabledMove } = datumRenderFlags;\n const { preventDrilldown, preventMove } = datumHydratables;\n const { shouldFocusDrilldown, shouldFocusMove, innerRefHandlerDrilldown, innerRefHandlerMove } =\n useInnerRefHandlers(itemMeta);\n const { handleClickDrilldown, handleClickSingleMove, handleKeyDownSelectionBubbleUp } = useActionsHandlers(itemMeta);\n\n return (\n <StyledItemActions cols={actionsCols} gutter=\"xxs\" pl=\"xs\" pr=\"xxs\" alignItems=\"center\">\n {withActions ? (\n <>\n <StyledItemActionWrapper>\n <StyledButton\n buttonType=\"icon\"\n onClick={handleClickDrilldown}\n onKeyDown={handleKeyDownSelectionBubbleUp}\n size={BUTTON_SIZES.S}\n innerRef={innerRefHandlerDrilldown}\n tabIndex={shouldFocusDrilldown && !preventDrilldown ? 0 : -1}\n disabled={internallyDisabledDrilldown || preventDrilldown === true}\n >\n <StyledDrilldownIcon width=\"1.538rem\" height=\"1.538rem\" />\n </StyledButton>\n </StyledItemActionWrapper>\n <StyledItemActionWrapper>\n <StyledButton\n buttonType=\"icon\"\n onClick={handleClickSingleMove}\n onKeyDown={handleKeyDownSelectionBubbleUp}\n size={BUTTON_SIZES.S}\n innerRef={innerRefHandlerMove}\n tabIndex={shouldFocusMove && !preventMove ? 0 : -1}\n disabled={internallyDisabledMove || preventMove === true}\n >\n {isDestinationPanel ? (\n <StyledCloseMediumIcon width=\"1.538rem\" height=\"1.538rem\" />\n ) : (\n <StyledArrowShortRightIcon width=\"1.538rem\" height=\"1.538rem\" />\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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgDf;AAhDR,mBAAkB;AAClB,uBAAuB;AACvB,qBAAqB;AACrB,0BAAyC;AACzC,sBAA+D;AAE/D,gCAAmC;AACnC,iCAAoC;AACpC,oCAAkD;AAElD,MA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,qBAAqB;AAAA,QAE9D,sDAAC,uBAAoB,OAAM,YAAW,QAAO,YAAW;AAAA;AAAA,IAC1D,GACF;AAAA,IACA,4CAAC,2BACC;AAAA,MAAC;AAAA;AAAA,QACC,YAAW;AAAA,QACX,SAAS;AAAA,QACT,WAAW;AAAA,QACX,MAAM,iCAAa;AAAA,QACnB,UAAU;AAAA,QACV,UAAU,mBAAmB,CAAC,cAAc,IAAI;AAAA,QAChD,UAAU,0BAA0B,gBAAgB;AAAA,QAEnD,+BACC,4CAAC,yBAAsB,OAAM,YAAW,QAAO,YAAW,IAE1D,4CAAC,6BAA0B,OAAM,YAAW,QAAO,YAAW;AAAA;AAAA,IAElE,GACF;AAAA,KACF,IAGA,4EACE;AAAA,gDAAC,SAAI;AAAA,IACL,4CAAC,SAAI;AAAA,KACP,GAEJ;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -31,15 +31,20 @@ var React = __toESM(require("react"));
|
|
|
31
31
|
var import_react = __toESM(require("react"));
|
|
32
32
|
var import_useActionsLogicHandlers = require("./useActionsLogicHandlers");
|
|
33
33
|
const useActionsHandlers = (itemMeta) => {
|
|
34
|
-
const { handleDrilldown, handleSingleMove } = (0, import_useActionsLogicHandlers.useActionsLogicHandlers)(itemMeta);
|
|
34
|
+
const { handleDrilldown, handleSingleMove, preventKeyDownSelectionBubbleUp } = (0, import_useActionsLogicHandlers.useActionsLogicHandlers)(itemMeta);
|
|
35
35
|
const handleClickDrilldown = import_react.default.useCallback(handleDrilldown, [handleDrilldown]);
|
|
36
36
|
const handleClickSingleMove = import_react.default.useCallback(handleSingleMove, [handleSingleMove]);
|
|
37
|
+
const handleKeyDownSelectionBubbleUp = import_react.default.useCallback(
|
|
38
|
+
preventKeyDownSelectionBubbleUp,
|
|
39
|
+
[preventKeyDownSelectionBubbleUp]
|
|
40
|
+
);
|
|
37
41
|
return import_react.default.useMemo(
|
|
38
42
|
() => ({
|
|
39
43
|
handleClickDrilldown,
|
|
40
|
-
handleClickSingleMove
|
|
44
|
+
handleClickSingleMove,
|
|
45
|
+
handleKeyDownSelectionBubbleUp
|
|
41
46
|
}),
|
|
42
|
-
[handleClickDrilldown, handleClickSingleMove]
|
|
47
|
+
[handleClickDrilldown, handleClickSingleMove, handleKeyDownSelectionBubbleUp]
|
|
43
48
|
);
|
|
44
49
|
};
|
|
45
50
|
//# sourceMappingURL=useActionsHandlers.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Item/ItemActions/useActionsHandlers.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { type DSButtonT } from '@elliemae/ds-button';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types';\nimport { useActionsLogicHandlers } from './useActionsLogicHandlers';\n\nexport const useActionsHandlers = (itemMeta: DSShuttleV2T.ItemMeta) => {\n const { handleDrilldown, handleSingleMove } = useActionsLogicHandlers(itemMeta);\n const handleClickDrilldown: DSButtonT.Props['onClick'] = React.useCallback(handleDrilldown, [handleDrilldown]);\n const handleClickSingleMove: DSButtonT.Props['onClick'] = React.useCallback(handleSingleMove, [handleSingleMove]);\n\n return React.useMemo(\n () => ({\n handleClickDrilldown,\n handleClickSingleMove,\n }),\n [handleClickDrilldown, handleClickSingleMove],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAGlB,qCAAwC;AAEjC,MAAM,qBAAqB,CAAC,aAAoC;AACrE,QAAM,EAAE,iBAAiB,
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type DSShuttleV2T } from '../../../react-desc-prop-types';\nimport { useActionsLogicHandlers } from './useActionsLogicHandlers';\n\nexport const useActionsHandlers = (itemMeta: DSShuttleV2T.ItemMeta) => {\n const { handleDrilldown, handleSingleMove, preventKeyDownSelectionBubbleUp } = useActionsLogicHandlers(itemMeta);\n const handleClickDrilldown: DSButtonT.Props['onClick'] = React.useCallback(handleDrilldown, [handleDrilldown]);\n const handleClickSingleMove: DSButtonT.Props['onClick'] = React.useCallback(handleSingleMove, [handleSingleMove]);\n const handleKeyDownSelectionBubbleUp: DSButtonT.Props['onKeyDown'] = React.useCallback(\n preventKeyDownSelectionBubbleUp,\n [preventKeyDownSelectionBubbleUp],\n );\n return React.useMemo(\n () => ({\n handleClickDrilldown,\n handleClickSingleMove,\n handleKeyDownSelectionBubbleUp,\n }),\n [handleClickDrilldown, handleClickSingleMove, handleKeyDownSelectionBubbleUp],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAGlB,qCAAwC;AAEjC,MAAM,qBAAqB,CAAC,aAAoC;AACrE,QAAM,EAAE,iBAAiB,kBAAkB,gCAAgC,QAAI,wDAAwB,QAAQ;AAC/G,QAAM,uBAAmD,aAAAA,QAAM,YAAY,iBAAiB,CAAC,eAAe,CAAC;AAC7G,QAAM,wBAAoD,aAAAA,QAAM,YAAY,kBAAkB,CAAC,gBAAgB,CAAC;AAChH,QAAM,iCAA+D,aAAAA,QAAM;AAAA,IACzE;AAAA,IACA,CAAC,+BAA+B;AAAA,EAClC;AACA,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,sBAAsB,uBAAuB,8BAA8B;AAAA,EAC9E;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|