@elliemae/ds-shuttle-v2 3.16.0-next.2 → 3.16.0-next.21
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 +14 -3
- package/dist/cjs/DSShuttleV2.js.map +2 -2
- package/dist/cjs/config/DSShuttleV2Definitions.js +4 -0
- package/dist/cjs/config/DSShuttleV2Definitions.js.map +1 -1
- package/dist/cjs/config/itemMovementHelpers.js +5 -1
- package/dist/cjs/config/itemMovementHelpers.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/index.js +6 -2
- package/dist/cjs/config/useAutoCalculated/index.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/useDataStructure.js +4 -0
- package/dist/cjs/config/useAutoCalculated/useDataStructure.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/useShuttleVirtualized.js +4 -0
- package/dist/cjs/config/useAutoCalculated/useShuttleVirtualized.js.map +2 -2
- package/dist/cjs/config/useFocusTracker/index.js +8 -4
- package/dist/cjs/config/useFocusTracker/index.js.map +2 -2
- package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js +6 -2
- package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js.map +2 -2
- package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js +6 -2
- package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js.map +2 -2
- package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js +6 -2
- package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js.map +2 -2
- package/dist/cjs/config/useFocusTracker/useFocusTracker.js +7 -3
- package/dist/cjs/config/useFocusTracker/useFocusTracker.js.map +2 -2
- package/dist/cjs/config/useStore/focusAndTabIndexManager.js +8 -4
- package/dist/cjs/config/useStore/focusAndTabIndexManager.js.map +2 -2
- package/dist/cjs/config/useStore/index.js +5 -1
- package/dist/cjs/config/useStore/index.js.map +2 -2
- package/dist/cjs/config/useStore/useStore.js +10 -6
- package/dist/cjs/config/useStore/useStore.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js +7 -3
- package/dist/cjs/config/useValidateProps.js.map +2 -2
- package/dist/cjs/constants/index.js +4 -0
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/exported-related/ShuttleItem.js +60 -0
- package/dist/cjs/exported-related/ShuttleItem.js.map +7 -0
- package/dist/cjs/exported-related/index.js +36 -0
- package/dist/cjs/exported-related/index.js.map +7 -0
- package/dist/cjs/index.js +10 -3
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/Dnd/DndHandle.js +6 -2
- package/dist/cjs/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/cjs/parts/Dnd/DragOverlay.js +6 -2
- package/dist/cjs/parts/Dnd/DragOverlay.js.map +2 -2
- package/dist/cjs/parts/Dnd/DropIndicator.js +4 -0
- package/dist/cjs/parts/Dnd/DropIndicator.js.map +1 -1
- package/dist/cjs/parts/Header.js +7 -3
- package/dist/cjs/parts/Header.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +7 -2
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js +4 -0
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js.map +2 -2
- package/dist/cjs/parts/Item/Item.js +41 -31
- package/dist/cjs/parts/Item/Item.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js +14 -7
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/index.js +5 -1
- package/dist/cjs/parts/Item/ItemActions/index.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js +5 -1
- package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js +7 -3
- package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js +6 -2
- package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js.map +2 -2
- package/dist/cjs/parts/Item/ItemMiddleSection.js +50 -30
- package/dist/cjs/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Item/ItemOverlay.js +8 -4
- package/dist/cjs/parts/Item/ItemOverlay.js.map +2 -2
- package/dist/cjs/parts/Item/ItemSelection.js +5 -1
- package/dist/cjs/parts/Item/ItemSelection.js.map +2 -2
- package/dist/cjs/parts/Item/TextSection.js +5 -1
- package/dist/cjs/parts/Item/TextSection.js.map +2 -2
- package/dist/cjs/parts/Item/useItemArrowNavigation.js +6 -2
- package/dist/cjs/parts/Item/useItemArrowNavigation.js.map +2 -2
- package/dist/cjs/parts/Item/useItemKeyboardSelection.js +6 -2
- package/dist/cjs/parts/Item/useItemKeyboardSelection.js.map +2 -2
- package/dist/cjs/parts/Item/useSelectionLogic.js +6 -2
- package/dist/cjs/parts/Item/useSelectionLogic.js.map +2 -2
- package/dist/cjs/parts/Item/useThisItemIsFocused.js +47 -0
- package/dist/cjs/parts/Item/useThisItemIsFocused.js.map +7 -0
- package/dist/cjs/parts/MainContent.js +8 -4
- package/dist/cjs/parts/MainContent.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +8 -4
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js +5 -1
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js +10 -6
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js +6 -2
- package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js +6 -2
- package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/EmptyItems.js +5 -1
- package/dist/cjs/parts/Panel/middle/EmptyItems.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +10 -6
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js +4 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js.map +1 -1
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +5 -1
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/LoadingItems.js +5 -1
- package/dist/cjs/parts/Panel/middle/LoadingItems.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +21 -5
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +12 -8
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js +8 -4
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js +6 -2
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/SelectionHeader.js +6 -2
- package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/cjs/parts/PanelWrapper.js +9 -5
- package/dist/cjs/parts/PanelWrapper.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +69 -47
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/tests/configs/basic.js +5 -0
- package/dist/cjs/tests/configs/basic.js.map +1 -1
- package/dist/cjs/tests/configs/filter.js +5 -0
- package/dist/cjs/tests/configs/filter.js.map +1 -1
- package/dist/cjs/tests/configs/loadMore.js +5 -0
- package/dist/cjs/tests/configs/loadMore.js.map +1 -1
- package/dist/esm/DSShuttleV2.js +10 -3
- package/dist/esm/DSShuttleV2.js.map +2 -2
- package/dist/esm/config/itemMovementHelpers.js +1 -1
- package/dist/esm/config/itemMovementHelpers.js.map +2 -2
- package/dist/esm/config/useAutoCalculated/index.js +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/useAutoCalculated/useShuttleVirtualized.js.map +2 -2
- package/dist/esm/config/useFocusTracker/index.js +4 -4
- package/dist/esm/config/useFocusTracker/index.js.map +1 -1
- package/dist/esm/config/useFocusTracker/useFocusActionTrackers.js +2 -2
- package/dist/esm/config/useFocusTracker/useFocusActionTrackers.js.map +1 -1
- package/dist/esm/config/useFocusTracker/useFocusItemTracker.js +2 -2
- package/dist/esm/config/useFocusTracker/useFocusItemTracker.js.map +2 -2
- package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js +2 -2
- package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js.map +1 -1
- package/dist/esm/config/useFocusTracker/useFocusTracker.js +3 -3
- package/dist/esm/config/useFocusTracker/useFocusTracker.js.map +1 -1
- package/dist/esm/config/useStore/focusAndTabIndexManager.js +4 -4
- package/dist/esm/config/useStore/focusAndTabIndexManager.js.map +2 -2
- package/dist/esm/config/useStore/index.js +1 -1
- package/dist/esm/config/useStore/index.js.map +1 -1
- package/dist/esm/config/useStore/useStore.js +6 -6
- package/dist/esm/config/useStore/useStore.js.map +2 -2
- package/dist/esm/config/useValidateProps.js +2 -2
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/exported-related/ShuttleItem.js +30 -0
- package/dist/esm/exported-related/ShuttleItem.js.map +7 -0
- package/dist/esm/exported-related/index.js +6 -0
- package/dist/esm/exported-related/index.js.map +7 -0
- package/dist/esm/index.js +6 -3
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/Dnd/DndHandle.js +2 -2
- package/dist/esm/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/esm/parts/Dnd/DragOverlay.js +2 -2
- package/dist/esm/parts/Dnd/DragOverlay.js.map +1 -1
- package/dist/esm/parts/Dnd/DropIndicator.js.map +1 -1
- package/dist/esm/parts/Header.js +3 -3
- package/dist/esm/parts/Header.js.map +1 -1
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +3 -2
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalUseSortable.js.map +1 -1
- package/dist/esm/parts/Item/Item.js +37 -31
- package/dist/esm/parts/Item/Item.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/ItemActions.js +10 -7
- package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/index.js +1 -1
- package/dist/esm/parts/Item/ItemActions/index.js.map +1 -1
- package/dist/esm/parts/Item/ItemActions/useActionsHandlers.js +1 -1
- package/dist/esm/parts/Item/ItemActions/useActionsHandlers.js.map +1 -1
- package/dist/esm/parts/Item/ItemActions/useActionsLogicHandlers.js +3 -3
- package/dist/esm/parts/Item/ItemActions/useActionsLogicHandlers.js.map +1 -1
- package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js +2 -2
- package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js.map +1 -1
- package/dist/esm/parts/Item/ItemMiddleSection.js +46 -30
- package/dist/esm/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/esm/parts/Item/ItemOverlay.js +4 -4
- package/dist/esm/parts/Item/ItemOverlay.js.map +2 -2
- package/dist/esm/parts/Item/ItemSelection.js +1 -1
- package/dist/esm/parts/Item/ItemSelection.js.map +2 -2
- package/dist/esm/parts/Item/TextSection.js +1 -1
- package/dist/esm/parts/Item/TextSection.js.map +1 -1
- package/dist/esm/parts/Item/useItemArrowNavigation.js +6 -2
- package/dist/esm/parts/Item/useItemArrowNavigation.js.map +2 -2
- package/dist/esm/parts/Item/useItemKeyboardSelection.js +2 -2
- package/dist/esm/parts/Item/useItemKeyboardSelection.js.map +1 -1
- package/dist/esm/parts/Item/useSelectionLogic.js +2 -2
- package/dist/esm/parts/Item/useSelectionLogic.js.map +2 -2
- package/dist/esm/parts/Item/useThisItemIsFocused.js +17 -0
- package/dist/esm/parts/Item/useThisItemIsFocused.js.map +7 -0
- package/dist/esm/parts/MainContent.js +4 -4
- package/dist/esm/parts/MainContent.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +4 -4
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/LoadingMore.js +1 -1
- package/dist/esm/parts/Panel/bottom/LoadingMore.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js +6 -6
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js +2 -2
- package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js +6 -2
- package/dist/esm/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js.map +2 -2
- package/dist/esm/parts/Panel/middle/EmptyItems.js +1 -1
- package/dist/esm/parts/Panel/middle/EmptyItems.js.map +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js +6 -6
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
- package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +2 -2
- package/dist/esm/parts/Panel/middle/LoadingItems.js +1 -1
- package/dist/esm/parts/Panel/middle/LoadingItems.js.map +1 -1
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +17 -5
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +8 -8
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js +4 -4
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js.map +1 -1
- package/dist/esm/parts/Panel/top/PanelFilterSection.js +2 -2
- package/dist/esm/parts/Panel/top/PanelFilterSection.js.map +1 -1
- package/dist/esm/parts/Panel/top/SelectionHeader.js +2 -2
- package/dist/esm/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/esm/parts/PanelWrapper.js +5 -5
- package/dist/esm/parts/PanelWrapper.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +65 -47
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/tests/configs/basic.js +1 -0
- package/dist/esm/tests/configs/basic.js.map +1 -1
- package/dist/esm/tests/configs/filter.js +1 -0
- package/dist/esm/tests/configs/filter.js.map +1 -1
- package/dist/esm/tests/configs/loadMore.js +1 -0
- package/dist/esm/tests/configs/loadMore.js.map +1 -1
- package/dist/types/DSShuttleV2.d.ts +3 -1
- package/dist/types/config/itemMovementHelpers.d.ts +1 -1
- package/dist/types/config/useAutoCalculated/index.d.ts +1 -1
- package/dist/types/config/useAutoCalculated/useDataStructure.d.ts +1 -1
- package/dist/types/config/useAutoCalculated/useShuttleVirtualized.d.ts +1 -1
- package/dist/types/config/useFocusTracker/index.d.ts +4 -4
- package/dist/types/config/useFocusTracker/useFocusActionTrackers.d.ts +1 -1
- package/dist/types/config/useFocusTracker/useFocusItemTracker.d.ts +1 -1
- package/dist/types/config/useFocusTracker/useFocusTracker.d.ts +7 -7
- package/dist/types/config/useStore/focusAndTabIndexManager.d.ts +1 -1
- package/dist/types/config/useStore/index.d.ts +1 -1
- package/dist/types/config/useStore/useStore.d.ts +1 -1
- package/dist/types/config/useValidateProps.d.ts +1 -1
- package/dist/types/exported-related/ShuttleItem.d.ts +8 -0
- package/dist/types/exported-related/index.d.ts +1 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/parts/Header.d.ts +1 -1
- package/dist/types/parts/HoC/withConditionalDnDRowContext.d.ts +1 -1
- package/dist/types/parts/HoC/withConditionalUseSortable.d.ts +1 -1
- package/dist/types/parts/Item/Item.d.ts +1 -1
- package/dist/types/parts/Item/ItemActions/ItemActions.d.ts +1 -1
- package/dist/types/parts/Item/ItemActions/index.d.ts +1 -1
- package/dist/types/parts/Item/ItemActions/useActionsHandlers.d.ts +1 -1
- package/dist/types/parts/Item/ItemActions/useActionsLogicHandlers.d.ts +1 -1
- package/dist/types/parts/Item/ItemActions/useInnerRefHandlers.d.ts +1 -1
- package/dist/types/parts/Item/ItemMiddleSection.d.ts +4 -2
- package/dist/types/parts/Item/ItemOverlay.d.ts +1 -1
- package/dist/types/parts/Item/ItemSelection.d.ts +1 -1
- package/dist/types/parts/Item/TextSection.d.ts +1 -1
- package/dist/types/parts/Item/useItemArrowNavigation.d.ts +1 -1
- package/dist/types/parts/Item/useItemKeyboardSelection.d.ts +1 -1
- package/dist/types/parts/Item/useSelectionLogic.d.ts +1 -1
- package/dist/types/parts/Item/useThisItemIsFocused.d.ts +4 -0
- package/dist/types/parts/Panel/bottom/LoadMoreBtn.d.ts +1 -1
- package/dist/types/parts/Panel/bottom/LoadingMore.d.ts +1 -1
- package/dist/types/parts/Panel/bottom/PanelContentBottomSection.d.ts +1 -1
- package/dist/types/parts/Panel/bottom/useInnerRefHandlers.d.ts +1 -1
- package/dist/types/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.d.ts +1 -1
- package/dist/types/parts/Panel/middle/EmptyItems.d.ts +1 -1
- package/dist/types/parts/Panel/middle/ItemListWrapper/Index.d.ts +1 -1
- package/dist/types/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.d.ts +1 -1
- package/dist/types/parts/Panel/middle/LoadingItems.d.ts +1 -1
- package/dist/types/parts/Panel/middle/MultipleSelectionAction.d.ts +1 -1
- package/dist/types/parts/Panel/middle/PanelContentMiddleSection.d.ts +1 -1
- package/dist/types/parts/Panel/top/PanelContentTopSection.d.ts +1 -1
- package/dist/types/parts/Panel/top/PanelFilterSection.d.ts +1 -1
- package/dist/types/parts/Panel/top/SelectionHeader.d.ts +1 -1
- package/dist/types/parts/PanelWrapper.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +6 -4
- package/package.json +20 -18
|
@@ -36,67 +36,85 @@ const defaultProps = {
|
|
|
36
36
|
const DSShuttleV2PropTypes = {
|
|
37
37
|
...globalAttributesPropTypes,
|
|
38
38
|
...xstyledPropTypes,
|
|
39
|
-
sourceData: PropTypes.arrayOf(PropTypes.object).description(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
sourceData: PropTypes.arrayOf(PropTypes.object).description(
|
|
40
|
+
"An array of objects representing the items in the source list"
|
|
41
|
+
).isRequired,
|
|
42
|
+
sourceSelectedItems: PropTypes.object.description("An object representing the selected items in the source list").isRequired,
|
|
43
|
+
onSourceSelectionChange: PropTypes.func.description("A function called when the selection in the source list changes").isRequired,
|
|
44
|
+
SourceHeader: PropTypes.node.description("The header component for the source list").isRequired,
|
|
45
|
+
onSourceDrilldown: PropTypes.func.description("A function called when an item in the source list is clicked").isRequired,
|
|
46
|
+
destinationData: PropTypes.arrayOf(PropTypes.object).description(
|
|
47
|
+
"An array of objects representing the items in the destination list"
|
|
48
|
+
).isRequired,
|
|
49
|
+
destinationSelectedItems: PropTypes.object.description(
|
|
50
|
+
"An object representing the selected items in the destination list"
|
|
51
|
+
).isRequired,
|
|
52
|
+
onDestinationSelectionChange: PropTypes.func.description(
|
|
53
|
+
"A function called when the selection in the destination list changes"
|
|
54
|
+
).isRequired,
|
|
55
|
+
DestinationHeader: PropTypes.node.description("The header component for the destination list").isRequired,
|
|
56
|
+
onDestinationDrilldown: PropTypes.func.description(
|
|
57
|
+
"A function called when an item in the destination list is clicked"
|
|
58
|
+
).isRequired,
|
|
59
|
+
getId: PropTypes.func.description(
|
|
60
|
+
"A function that takes an item from the source/destination list and returns its unique identifier"
|
|
61
|
+
).isRequired,
|
|
62
|
+
getLabel: PropTypes.func.description(
|
|
63
|
+
"A function that takes an item from the source/destination list and returns its display label"
|
|
64
|
+
).isRequired,
|
|
65
|
+
sourceIsLoading: PropTypes.bool.description("A boolean indicating whether the source list is currently loading data").defaultValue(false),
|
|
66
|
+
destinationIsLoading: PropTypes.bool.description("A boolean indicating whether the destination list is currently loading data").defaultValue(false),
|
|
67
|
+
sourceWithLoadMore: PropTypes.bool.description('A boolean indicating whether the source list supports "load more" functionality').defaultValue(false),
|
|
68
|
+
destinationWithLoadMore: PropTypes.bool.description('A boolean indicating whether the destination list supports "load more" functionality').defaultValue(false),
|
|
69
|
+
sourceIsLoadingMore: PropTypes.bool.description("A boolean indicating whether the source list is currently loading more data").defaultValue(false),
|
|
70
|
+
destinationIsLoadingMore: PropTypes.bool.description("A boolean indicating whether the destination list is currently loading more data").defaultValue(false),
|
|
71
|
+
onSourceLoadMore: PropTypes.func.description('A function called when the "load more" button in the source list is clicked').defaultValue(() => {
|
|
58
72
|
}),
|
|
59
|
-
onDestinationLoadMore: PropTypes.func.description("
|
|
73
|
+
onDestinationLoadMore: PropTypes.func.description('A function called when the "load more" button in the destination list is clicked').defaultValue(() => {
|
|
60
74
|
}),
|
|
61
|
-
onSourceAdd: PropTypes.func.description("
|
|
75
|
+
onSourceAdd: PropTypes.func.description("A function called when an item is added from the source list to the destination list").defaultValue(() => {
|
|
62
76
|
}),
|
|
63
|
-
onDestinationAdd: PropTypes.func.description("
|
|
77
|
+
onDestinationAdd: PropTypes.func.description("A function called when an item is added from the destination list to the source list").defaultValue(() => {
|
|
64
78
|
}),
|
|
65
|
-
onSourceRemove: PropTypes.func.description("
|
|
79
|
+
onSourceRemove: PropTypes.func.description("A function called when an item is removed from the destination list").defaultValue(() => {
|
|
66
80
|
}),
|
|
67
|
-
onDestinationRemove: PropTypes.func.description("
|
|
81
|
+
onDestinationRemove: PropTypes.func.description("Callback function to handle when an item is removed from the destination shuttle list. ").defaultValue(() => {
|
|
68
82
|
}),
|
|
69
|
-
onSourceReorder: PropTypes.func.description("
|
|
83
|
+
onSourceReorder: PropTypes.func.description("Callback function to handle when items are reordered in the source shuttle list.").defaultValue(() => {
|
|
70
84
|
}),
|
|
71
|
-
onDestinationReorder: PropTypes.func.description("
|
|
85
|
+
onDestinationReorder: PropTypes.func.description("Callback function to handle when items are reordered in the destination shuttle list. ").defaultValue(() => {
|
|
72
86
|
}),
|
|
73
|
-
sourceSoftDeletedItems: PropTypes.object.description(
|
|
74
|
-
|
|
87
|
+
sourceSoftDeletedItems: PropTypes.object.description(
|
|
88
|
+
"Object containing the soft deleted items in the source shuttle list, where the key is the item ID and the value is the deleted item."
|
|
89
|
+
).defaultValue({}),
|
|
90
|
+
onSourceSoftDelete: PropTypes.func.description("Callback function to handle when an item is soft deleted in the source shuttle list. ").defaultValue(() => {
|
|
75
91
|
}),
|
|
76
|
-
destinationSoftDeletedItems: PropTypes.object.description(
|
|
77
|
-
|
|
92
|
+
destinationSoftDeletedItems: PropTypes.object.description(
|
|
93
|
+
"Object containing the soft deleted items in the destination shuttle list, where the key is the item ID and the value is the deleted item."
|
|
94
|
+
).defaultValue({}),
|
|
95
|
+
onDestinationSoftDelete: PropTypes.func.description("Callback function to handle when an item is soft deleted in the destination shuttle list.").defaultValue(() => {
|
|
78
96
|
}),
|
|
79
|
-
getPreventMove: PropTypes.func.description("
|
|
80
|
-
addDragAndDropFromSource: PropTypes.bool.description("
|
|
81
|
-
removeDragAndDropFromDestination: PropTypes.bool.description("
|
|
82
|
-
sourceItemProps: PropTypes.object.description("
|
|
83
|
-
destinationItemProps: PropTypes.object.description("
|
|
84
|
-
sourceShowSearchbar: PropTypes.bool.description("
|
|
85
|
-
destinationShowSearchbar: PropTypes.bool.description("
|
|
86
|
-
onSourceOpenSearchbar: PropTypes.func.description("
|
|
97
|
+
getPreventMove: PropTypes.func.description("Function that determines whether a specific item can be moved to the destination shuttle list. ").defaultValue(() => false),
|
|
98
|
+
addDragAndDropFromSource: PropTypes.bool.description("Specifies whether items can be dragged from the source list and dropped into the destination list.").defaultValue(false),
|
|
99
|
+
removeDragAndDropFromDestination: PropTypes.bool.description("Specifies whether items can be removed from the destination list by dragging them out of the list.").defaultValue(false),
|
|
100
|
+
sourceItemProps: PropTypes.object.description("Specifies additional props to be applied to each item in the source list.").defaultValue({}),
|
|
101
|
+
destinationItemProps: PropTypes.object.description("Specifies additional props to be applied to each item in the destination list.").defaultValue({}),
|
|
102
|
+
sourceShowSearchbar: PropTypes.bool.description("Specifies whether the search bar should be shown in the source list.").defaultValue(false),
|
|
103
|
+
destinationShowSearchbar: PropTypes.bool.description("Specifies whether the search bar should be shown in the destination list.").defaultValue(false),
|
|
104
|
+
onSourceOpenSearchbar: PropTypes.func.description("Callback function that is called when the search bar in the source list is opened.").defaultValue(() => {
|
|
87
105
|
}),
|
|
88
|
-
onDesinationOpenSearchbar: PropTypes.func.description("
|
|
106
|
+
onDesinationOpenSearchbar: PropTypes.func.description("Callback function that is called when the search bar in the destination list is opened.").defaultValue(() => {
|
|
89
107
|
}),
|
|
90
|
-
sourceFilterValue: PropTypes.string.description("
|
|
91
|
-
destinationFilterValue: PropTypes.string.description("
|
|
92
|
-
onSourceFilterChange: PropTypes.func.description("
|
|
108
|
+
sourceFilterValue: PropTypes.string.description("Specifies the current value of the search filter in the source list.").defaultValue(""),
|
|
109
|
+
destinationFilterValue: PropTypes.string.description("Specifies the current value of the search filter in the destination list.").defaultValue(""),
|
|
110
|
+
onSourceFilterChange: PropTypes.func.description("Callback function that is called when the search filter in the source list is changed.").defaultValue(() => {
|
|
93
111
|
}),
|
|
94
|
-
onDestinationFilterChange: PropTypes.func.description("
|
|
112
|
+
onDestinationFilterChange: PropTypes.func.description("Callback function that is called when the search filter in the destination list is changed.").defaultValue(() => {
|
|
95
113
|
}),
|
|
96
|
-
getSubtitle: PropTypes.func.description("
|
|
97
|
-
getIcon: PropTypes.func.description("
|
|
98
|
-
getPreventDrilldown: PropTypes.func.description("
|
|
99
|
-
getCustomRenderer: PropTypes.func.description("
|
|
114
|
+
getSubtitle: PropTypes.func.description("Callback function that returns the subtitle to be displayed for each item in the list.").defaultValue(() => ""),
|
|
115
|
+
getIcon: PropTypes.func.description("Callback function that returns the icon to be displayed for each item in the list.").defaultValue(() => ""),
|
|
116
|
+
getPreventDrilldown: PropTypes.func.description("Callback function that determines whether drilldown should be prevented for a particular item.").defaultValue(() => false),
|
|
117
|
+
getCustomRenderer: PropTypes.func.description("Callback function that returns a custom renderer for each item in the list.").defaultValue(() => void 0)
|
|
100
118
|
};
|
|
101
119
|
const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes;
|
|
102
120
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type useSortable, type DnDKitTree } from '@elliemae/ds-drag-and-drop';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\n\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from './constants';\nimport type { useAutoCalculated } from './config/useAutoCalculated';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection: boolean };\n type HydratedId = string;\n\n export type DatumInternalMeta = {\n isFirst: boolean;\n isLast: boolean;\n isSelected: boolean;\n softDeleted: boolean;\n localIndex: number;\n hydratedId: HydratedId;\n hydratedPreventMove: boolean;\n };\n export type DatumRenderFlags = {\n selectionPrevented: boolean;\n withActions: boolean;\n withMoveBtn: boolean;\n withDrilldownBtn: boolean;\n internallyDisabledMove: boolean;\n internallyDisabledDrilldown: boolean;\n };\n\n // =============================================================================\n // Hydratables section\n // Component-less\n // =============================================================================\n export type PrimaryKeyHydratables = {\n id: HydratedId;\n };\n type FunctionalHydratables = {\n preventMove?: boolean;\n };\n type RequiredDatumHydratablesWithoutComponents = {\n label: string;\n };\n type OptionalDatumHydratablesWithoutComponents = {\n subtitle?: string;\n preventDrilldown?: boolean;\n };\n type DatumHydratablesWithoutComponents = PrimaryKeyHydratables &\n FunctionalHydratables &\n RequiredDatumHydratablesWithoutComponents &\n OptionalDatumHydratablesWithoutComponents;\n // =============================================================================\n // Hydratables section\n // Component-only\n // =============================================================================\n export type ComponentProps = {\n datum: Datum;\n panelMetaInfo: PanelMetaInfo;\n datumInternalMeta: DatumInternalMeta;\n datumHydratables: DatumHydratablesWithoutComponents;\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n type RequiredDatumHydratablesComponents = {};\n type OptionalDatumHydratablesComponents = {\n Icon?: React.ComponentType<ComponentProps>;\n CustomRenderer?: React.ComponentType<ComponentProps>;\n };\n // =============================================================================\n // Hydratables section\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = RequiredDatumHydratables & OptionalDatumHydratables;\n\n // =============================================================================\n // Hydraters\n // =============================================================================\n export type PrimaryKeyHydraters = Hydraters<PrimaryKeyHydratables, [Datum]>;\n export type FunctionalHydraters = Hydraters<FunctionalHydratables, [Datum]>;\n type HydratersMeta = { datumMeta: DatumInternalMeta; panelMetaInfo: PanelMetaInfo };\n type RequiredDatumHydraters = Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;\n type OptionalDatumHydraters = Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;\n\n type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;\n\n // =============================================================================\n // Datum & Internals structures\n // =============================================================================\n export type ConfiguredDatum = DatumInternalMeta & { original: Datum };\n export interface ItemMeta extends PanelMetaInfo {\n datum: Datum;\n datumHydratables: DatumHydratables;\n datumInternalMeta: DatumInternalMeta;\n datumRenderFlags: DatumRenderFlags;\n withDragNDrop: boolean;\n useSortableHelpers?: ReturnType<typeof useSortable>;\n }\n\n // =============================================================================\n // Callbacks\n // =============================================================================\n type OnDataChange = (\n newData: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n item?: Datum;\n selectedItems?: Datum[];\n },\n ) => void;\n\n type OnChangeEvent = (\n items: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n },\n ) => void;\n\n type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;\n type OnReorderEvent = (movedItem: Datum, metadata: OnReorderEventMetadata) => void;\n\n export type SelectionMap = Record<string, boolean>;\n type OnSelectionChange = (\n newSelection: SelectionMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n type OnSelectionDrilldown = (\n item: Datum,\n metainfo: { event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement> },\n ) => void;\n\n type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;\n type OnFilterChange = (\n newfilter: string | null,\n metainfo: { event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement> },\n ) => void;\n type OnSearchbarOpen = (\n newfilter: boolean,\n metainfo: { event: Parameters<Required<DSButtonT.Props>['onClick']>[0] },\n ) => void;\n\n export type SoftDeletedMap = Record<string, boolean>;\n type OnSoftDeletedChange = (\n newSoftDeleted: SoftDeletedMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n // =============================================================================\n // Zustand Store\n // =============================================================================\n export type FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\n export type FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\n export type FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n export type InternalAtoms = {\n focusRegion: FocusRegion;\n focusItem: FocusItem;\n focusItemAction: FocusItemAction;\n shouldFocusItemOnRender: boolean;\n dropIndicatorPosition: number;\n overId: string;\n dndDraggingItem: ConfiguredDatum | null;\n dndDraggingItemMeta: ItemMeta | null;\n lastActiveId: string;\n isDropValid: boolean;\n sourcePanelLastSelectedItem: string | null | undefined;\n destinationPanelLastSelectedItem: string | null | undefined;\n };\n export type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;\n export type Selectors = {\n getIsDragAndDropHappening: () => boolean;\n getPanelLastSelectedItem: (isDestinationPanel: boolean) => string | null | undefined;\n };\n export type Reducers = Record<string, never>;\n export type ShuttleInternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;\n // =============================================================================\n // Final Props\n // =============================================================================\n export interface RequiredProps extends RequiredDatumHydraters, PrimaryKeyHydraters {\n sourceData: Datum[];\n sourceSelectedItems: SelectionMap;\n onSourceSelectionChange: OnSelectionChange;\n SourceHeader: React.ComponentType<unknown>;\n onSourceDrilldown: OnSelectionDrilldown;\n\n destinationData: Datum[];\n destinationSelectedItems: SelectionMap;\n onDestinationSelectionChange: OnSelectionChange;\n DestinationHeader: React.ComponentType<unknown>;\n onDestinationDrilldown: OnSelectionDrilldown;\n }\n\n export interface DefaultProps extends Required<FunctionalHydraters> {\n // load-more and loaders\n sourceIsLoading: boolean;\n sourceWithLoadMore: boolean;\n sourceIsLoadingMore: boolean;\n onSourceLoadMore: OnLoadMore;\n destinationIsLoading: boolean;\n destinationWithLoadMore: boolean;\n destinationIsLoadingMore: boolean;\n onDestinationLoadMore: OnLoadMore;\n\n // switch side\n onSourceAdd: OnChangeEvent;\n onSourceRemove: OnChangeEvent;\n onDestinationAdd: OnChangeEvent;\n onDestinationRemove: OnChangeEvent;\n\n // dnd\n addDragAndDropFromSource: boolean;\n removeDragAndDropFromDestination: boolean;\n onSourceReorder: OnReorderEvent;\n onDestinationReorder: OnReorderEvent;\n\n // soft delete\n sourceSoftDeletedItems: SoftDeletedMap;\n onSourceSoftDelete: OnSoftDeletedChange;\n destinationSoftDeletedItems: SoftDeletedMap;\n onDestinationSoftDelete: OnSoftDeletedChange;\n }\n\n export interface OptionalProps extends OptionalDatumHydraters {\n sourceItemProps?: Record<string, unknown>;\n destinationItemProps?: Record<string, unknown>;\n\n // filtering\n sourceShowSearchbar?: boolean;\n destinationShowSearchbar?: boolean;\n onSourceOpenSearchbar?: OnSearchbarOpen;\n onDesinationOpenSearchbar?: OnSearchbarOpen;\n\n sourceFilterValue?: string;\n destinationFilterValue?: string;\n onSourceFilterChange?: OnFilterChange;\n onDestinationFilterChange?: OnFilterChange;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSShuttleV2T.DefaultProps = {\n addDragAndDropFromSource: false,\n removeDragAndDropFromDestination: false,\n\n sourceIsLoading: false,\n destinationIsLoading: false,\n sourceWithLoadMore: false,\n destinationWithLoadMore: false,\n sourceIsLoadingMore: false,\n destinationIsLoadingMore: false,\n onSourceLoadMore: () => {},\n onDestinationLoadMore: () => {},\n\n onSourceAdd: () => {},\n onDestinationAdd: () => {},\n onSourceRemove: () => {},\n onDestinationRemove: () => {},\n onSourceReorder: () => {},\n onDestinationReorder: () => {},\n\n sourceSoftDeletedItems: {},\n onSourceSoftDelete: () => {},\n destinationSoftDeletedItems: {},\n onDestinationSoftDelete: () => {},\n\n getPreventMove: () => false,\n};\n\nconst DSShuttleV2PropTypes: DSPropTypesSchema<DSShuttleV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n sourceData: PropTypes.arrayOf(PropTypes.object).description('hello!').isRequired,\n sourceSelectedItems: PropTypes.object.description('hello!').isRequired,\n onSourceSelectionChange: PropTypes.func.description('hello!').isRequired,\n SourceHeader: PropTypes.node.description('hello!').isRequired,\n onSourceDrilldown: PropTypes.func.description('hello!').isRequired,\n\n destinationData: PropTypes.arrayOf(PropTypes.object).description('hello!').isRequired,\n destinationSelectedItems: PropTypes.object.description('hello!').isRequired,\n onDestinationSelectionChange: PropTypes.func.description('hello!').isRequired,\n DestinationHeader: PropTypes.node.description('hello!').isRequired,\n onDestinationDrilldown: PropTypes.func.description('hello!').isRequired,\n\n getId: PropTypes.func.description('hello!').isRequired,\n getLabel: PropTypes.func.description('hello!').isRequired,\n\n sourceIsLoading: PropTypes.bool.description('hello!').defaultValue(false),\n destinationIsLoading: PropTypes.bool.description('hello!').defaultValue(false),\n sourceWithLoadMore: PropTypes.bool.description('hello!').defaultValue(false),\n destinationWithLoadMore: PropTypes.bool.description('hello!').defaultValue(false),\n sourceIsLoadingMore: PropTypes.bool.description('hello!').defaultValue(false),\n destinationIsLoadingMore: PropTypes.bool.description('hello!').defaultValue(false),\n onSourceLoadMore: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationLoadMore: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceAdd: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationAdd: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceRemove: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationRemove: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceReorder: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationReorder: PropTypes.func.description('hello!').defaultValue(() => {}),\n sourceSoftDeletedItems: PropTypes.object.description('hello!').defaultValue({}),\n onSourceSoftDelete: PropTypes.func.description('hello!').defaultValue(() => {}),\n destinationSoftDeletedItems: PropTypes.object.description('hello!').defaultValue({}),\n onDestinationSoftDelete: PropTypes.func.description('hello!').defaultValue(() => {}),\n getPreventMove: PropTypes.func.description('hello!').defaultValue(() => false),\n\n addDragAndDropFromSource: PropTypes.bool.description('hello!').defaultValue(false),\n removeDragAndDropFromDestination: PropTypes.bool.description('hello!').defaultValue(false),\n\n sourceItemProps: PropTypes.object.description('hello!').defaultValue({}),\n destinationItemProps: PropTypes.object.description('hello!').defaultValue({}),\n\n sourceShowSearchbar: PropTypes.bool.description('hello!').defaultValue(false),\n destinationShowSearchbar: PropTypes.bool.description('hello!').defaultValue(false),\n onSourceOpenSearchbar: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDesinationOpenSearchbar: PropTypes.func.description('hello!').defaultValue(() => {}),\n sourceFilterValue: PropTypes.string.description('hello!').defaultValue(''),\n destinationFilterValue: PropTypes.string.description('hello!').defaultValue(''),\n onSourceFilterChange: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationFilterChange: PropTypes.func.description('hello!').defaultValue(() => {}),\n\n getSubtitle: PropTypes.func.description('hello!').defaultValue(() => ''),\n getIcon: PropTypes.func.description('hello!').defaultValue(() => ''),\n getPreventDrilldown: PropTypes.func.description('hello!').defaultValue(() => false),\n\n getCustomRenderer: PropTypes.func.description('hello!').defaultValue(() => undefined),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as WeakValidationMap<DSShuttleV2T.Props>;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, useHeadlessTooltip } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type useSortable, type DnDKitTree } from '@elliemae/ds-drag-and-drop';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\n\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from './constants/index.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated/index.js';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection: boolean };\n type HydratedId = string;\n\n export type DatumInternalMeta = {\n isFirst: boolean;\n isLast: boolean;\n isSelected: boolean;\n softDeleted: boolean;\n localIndex: number;\n hydratedId: HydratedId;\n hydratedPreventMove: boolean;\n };\n export type DatumRenderFlags = {\n selectionPrevented: boolean;\n withActions: boolean;\n withMoveBtn: boolean;\n withDrilldownBtn: boolean;\n internallyDisabledMove: boolean;\n internallyDisabledDrilldown: boolean;\n };\n\n // =============================================================================\n // Hydratables section\n // Component-less\n // =============================================================================\n export type PrimaryKeyHydratables = {\n id: HydratedId;\n };\n type FunctionalHydratables = {\n preventMove?: boolean;\n };\n type RequiredDatumHydratablesWithoutComponents = {\n label: string;\n };\n type OptionalDatumHydratablesWithoutComponents = {\n subtitle?: string;\n preventDrilldown?: boolean;\n };\n type DatumHydratablesWithoutComponents = PrimaryKeyHydratables &\n FunctionalHydratables &\n RequiredDatumHydratablesWithoutComponents &\n OptionalDatumHydratablesWithoutComponents;\n // =============================================================================\n // Hydratables section\n // Component-only\n // =============================================================================\n export type ComponentProps = {\n datum: Datum;\n thisItemIsFocused: boolean;\n panelMetaInfo: PanelMetaInfo;\n datumInternalMeta: DatumInternalMeta;\n datumHydratables: DatumHydratablesWithoutComponents;\n tooltipHelpers: ReturnType<typeof useHeadlessTooltip>;\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n type RequiredDatumHydratablesComponents = {};\n type OptionalDatumHydratablesComponents = {\n Icon?: React.ComponentType<ComponentProps>;\n CustomRenderer?: React.ComponentType<ComponentProps>;\n };\n // =============================================================================\n // Hydratables section\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = RequiredDatumHydratables & OptionalDatumHydratables;\n\n // =============================================================================\n // Hydraters\n // =============================================================================\n export type PrimaryKeyHydraters = Hydraters<PrimaryKeyHydratables, [Datum]>;\n export type FunctionalHydraters = Hydraters<FunctionalHydratables, [Datum]>;\n type HydratersMeta = { datumMeta: DatumInternalMeta; panelMetaInfo: PanelMetaInfo };\n type RequiredDatumHydraters = Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;\n type OptionalDatumHydraters = Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;\n\n type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;\n\n // =============================================================================\n // Datum & Internals structures\n // =============================================================================\n export type ConfiguredDatum = DatumInternalMeta & { original: Datum };\n export interface ItemMeta extends PanelMetaInfo {\n datum: Datum;\n datumHydratables: DatumHydratables;\n datumInternalMeta: DatumInternalMeta;\n datumRenderFlags: DatumRenderFlags;\n withDragNDrop: boolean;\n useSortableHelpers?: ReturnType<typeof useSortable>;\n }\n\n // =============================================================================\n // Callbacks\n // =============================================================================\n type OnDataChange = (\n newData: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n item?: Datum;\n selectedItems?: Datum[];\n },\n ) => void;\n\n type OnChangeEvent = (\n items: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n },\n ) => void;\n\n type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;\n type OnReorderEvent = (movedItem: Datum, metadata: OnReorderEventMetadata) => void;\n\n export type SelectionMap = Record<string, boolean>;\n type OnSelectionChange = (\n newSelection: SelectionMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n type OnSelectionDrilldown = (\n item: Datum,\n metainfo: { event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement> },\n ) => void;\n\n type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;\n type OnFilterChange = (\n newfilter: string | null,\n metainfo: { event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement> },\n ) => void;\n type OnSearchbarOpen = (\n newfilter: boolean,\n metainfo: { event: Parameters<Required<DSButtonT.Props>['onClick']>[0] },\n ) => void;\n\n export type SoftDeletedMap = Record<string, boolean>;\n type OnSoftDeletedChange = (\n newSoftDeleted: SoftDeletedMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n // =============================================================================\n // Zustand Store\n // =============================================================================\n export type FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\n export type FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\n export type FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n export type InternalAtoms = {\n focusRegion: FocusRegion;\n focusItem: FocusItem;\n focusItemAction: FocusItemAction;\n deferFocusUntilFirstRender: boolean;\n dropIndicatorPosition: number;\n overId: string;\n dndDraggingItem: ConfiguredDatum | null;\n dndDraggingItemMeta: ItemMeta | null;\n lastActiveId: string;\n isDropValid: boolean;\n sourcePanelLastSelectedItem: string | null | undefined;\n destinationPanelLastSelectedItem: string | null | undefined;\n };\n export type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;\n export type Selectors = {\n getIsDragAndDropHappening: () => boolean;\n getPanelLastSelectedItem: (isDestinationPanel: boolean) => string | null | undefined;\n };\n export type Reducers = Record<string, never>;\n export type ShuttleInternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;\n // =============================================================================\n // Final Props\n // =============================================================================\n export interface RequiredProps extends RequiredDatumHydraters, PrimaryKeyHydraters {\n sourceData: Datum[];\n sourceSelectedItems: SelectionMap;\n onSourceSelectionChange: OnSelectionChange;\n SourceHeader: React.ComponentType<unknown>;\n onSourceDrilldown: OnSelectionDrilldown;\n\n destinationData: Datum[];\n destinationSelectedItems: SelectionMap;\n onDestinationSelectionChange: OnSelectionChange;\n DestinationHeader: React.ComponentType<unknown>;\n onDestinationDrilldown: OnSelectionDrilldown;\n }\n\n export interface DefaultProps extends Required<FunctionalHydraters> {\n // load-more and loaders\n sourceIsLoading: boolean;\n sourceWithLoadMore: boolean;\n sourceIsLoadingMore: boolean;\n onSourceLoadMore: OnLoadMore;\n destinationIsLoading: boolean;\n destinationWithLoadMore: boolean;\n destinationIsLoadingMore: boolean;\n onDestinationLoadMore: OnLoadMore;\n\n // switch side\n onSourceAdd: OnChangeEvent;\n onSourceRemove: OnChangeEvent;\n onDestinationAdd: OnChangeEvent;\n onDestinationRemove: OnChangeEvent;\n\n // dnd\n addDragAndDropFromSource: boolean;\n removeDragAndDropFromDestination: boolean;\n onSourceReorder: OnReorderEvent;\n onDestinationReorder: OnReorderEvent;\n\n // soft delete\n sourceSoftDeletedItems: SoftDeletedMap;\n onSourceSoftDelete: OnSoftDeletedChange;\n destinationSoftDeletedItems: SoftDeletedMap;\n onDestinationSoftDelete: OnSoftDeletedChange;\n }\n\n export interface OptionalProps extends OptionalDatumHydraters {\n sourceItemProps?: Record<string, unknown>;\n destinationItemProps?: Record<string, unknown>;\n\n // filtering\n sourceShowSearchbar?: boolean;\n destinationShowSearchbar?: boolean;\n onSourceOpenSearchbar?: OnSearchbarOpen;\n onDesinationOpenSearchbar?: OnSearchbarOpen;\n\n sourceFilterValue?: string;\n destinationFilterValue?: string;\n onSourceFilterChange?: OnFilterChange;\n onDestinationFilterChange?: OnFilterChange;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSShuttleV2T.DefaultProps = {\n addDragAndDropFromSource: false,\n removeDragAndDropFromDestination: false,\n\n sourceIsLoading: false,\n destinationIsLoading: false,\n sourceWithLoadMore: false,\n destinationWithLoadMore: false,\n sourceIsLoadingMore: false,\n destinationIsLoadingMore: false,\n onSourceLoadMore: () => {},\n onDestinationLoadMore: () => {},\n\n onSourceAdd: () => {},\n onDestinationAdd: () => {},\n onSourceRemove: () => {},\n onDestinationRemove: () => {},\n onSourceReorder: () => {},\n onDestinationReorder: () => {},\n\n sourceSoftDeletedItems: {},\n onSourceSoftDelete: () => {},\n destinationSoftDeletedItems: {},\n onDestinationSoftDelete: () => {},\n\n getPreventMove: () => false,\n};\n\nconst DSShuttleV2PropTypes: DSPropTypesSchema<DSShuttleV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n sourceData: PropTypes.arrayOf(PropTypes.object).description(\n 'An array of objects representing the items in the source list',\n ).isRequired,\n sourceSelectedItems: PropTypes.object.description('An object representing the selected items in the source list')\n .isRequired,\n onSourceSelectionChange: PropTypes.func.description('A function called when the selection in the source list changes')\n .isRequired,\n SourceHeader: PropTypes.node.description('The header component for the source list').isRequired,\n onSourceDrilldown: PropTypes.func.description('A function called when an item in the source list is clicked')\n .isRequired,\n destinationData: PropTypes.arrayOf(PropTypes.object).description(\n 'An array of objects representing the items in the destination list',\n ).isRequired,\n destinationSelectedItems: PropTypes.object.description(\n 'An object representing the selected items in the destination list',\n ).isRequired,\n onDestinationSelectionChange: PropTypes.func.description(\n 'A function called when the selection in the destination list changes',\n ).isRequired,\n DestinationHeader: PropTypes.node.description('The header component for the destination list').isRequired,\n onDestinationDrilldown: PropTypes.func.description(\n 'A function called when an item in the destination list is clicked',\n ).isRequired,\n getId: PropTypes.func.description(\n 'A function that takes an item from the source/destination list and returns its unique identifier',\n ).isRequired,\n getLabel: PropTypes.func.description(\n 'A function that takes an item from the source/destination list and returns its display label',\n ).isRequired,\n sourceIsLoading: PropTypes.bool\n .description('A boolean indicating whether the source list is currently loading data')\n .defaultValue(false),\n destinationIsLoading: PropTypes.bool\n .description('A boolean indicating whether the destination list is currently loading data')\n .defaultValue(false),\n sourceWithLoadMore: PropTypes.bool\n .description('A boolean indicating whether the source list supports \"load more\" functionality')\n .defaultValue(false),\n destinationWithLoadMore: PropTypes.bool\n .description('A boolean indicating whether the destination list supports \"load more\" functionality')\n .defaultValue(false),\n sourceIsLoadingMore: PropTypes.bool\n .description('A boolean indicating whether the source list is currently loading more data')\n .defaultValue(false),\n destinationIsLoadingMore: PropTypes.bool\n .description('A boolean indicating whether the destination list is currently loading more data')\n .defaultValue(false),\n onSourceLoadMore: PropTypes.func\n .description('A function called when the \"load more\" button in the source list is clicked')\n .defaultValue(() => {}),\n onDestinationLoadMore: PropTypes.func\n .description('A function called when the \"load more\" button in the destination list is clicked')\n .defaultValue(() => {}),\n onSourceAdd: PropTypes.func\n .description('A function called when an item is added from the source list to the destination list')\n .defaultValue(() => {}),\n onDestinationAdd: PropTypes.func\n .description('A function called when an item is added from the destination list to the source list')\n .defaultValue(() => {}),\n onSourceRemove: PropTypes.func\n .description('A function called when an item is removed from the destination list')\n .defaultValue(() => {}),\n onDestinationRemove: PropTypes.func\n .description('Callback function to handle when an item is removed from the destination shuttle list. ')\n .defaultValue(() => {}),\n onSourceReorder: PropTypes.func\n .description('Callback function to handle when items are reordered in the source shuttle list.')\n .defaultValue(() => {}),\n onDestinationReorder: PropTypes.func\n .description('Callback function to handle when items are reordered in the destination shuttle list. ')\n .defaultValue(() => {}),\n sourceSoftDeletedItems: PropTypes.object\n .description(\n 'Object containing the soft deleted items in the source shuttle list, where the key is the item ID and the value is the deleted item.',\n )\n .defaultValue({}),\n onSourceSoftDelete: PropTypes.func\n .description('Callback function to handle when an item is soft deleted in the source shuttle list. ')\n .defaultValue(() => {}),\n destinationSoftDeletedItems: PropTypes.object\n .description(\n 'Object containing the soft deleted items in the destination shuttle list, where the key is the item ID and the value is the deleted item.',\n )\n .defaultValue({}),\n onDestinationSoftDelete: PropTypes.func\n .description('Callback function to handle when an item is soft deleted in the destination shuttle list.')\n .defaultValue(() => {}),\n getPreventMove: PropTypes.func\n .description('Function that determines whether a specific item can be moved to the destination shuttle list. ')\n .defaultValue(() => false),\n addDragAndDropFromSource: PropTypes.bool\n .description('Specifies whether items can be dragged from the source list and dropped into the destination list.')\n .defaultValue(false),\n removeDragAndDropFromDestination: PropTypes.bool\n .description('Specifies whether items can be removed from the destination list by dragging them out of the list.')\n .defaultValue(false),\n sourceItemProps: PropTypes.object\n .description('Specifies additional props to be applied to each item in the source list.')\n .defaultValue({}),\n destinationItemProps: PropTypes.object\n .description('Specifies additional props to be applied to each item in the destination list.')\n .defaultValue({}),\n sourceShowSearchbar: PropTypes.bool\n .description('Specifies whether the search bar should be shown in the source list.')\n .defaultValue(false),\n destinationShowSearchbar: PropTypes.bool\n .description('Specifies whether the search bar should be shown in the destination list.')\n .defaultValue(false),\n onSourceOpenSearchbar: PropTypes.func\n .description('Callback function that is called when the search bar in the source list is opened.')\n .defaultValue(() => {}),\n onDesinationOpenSearchbar: PropTypes.func\n .description('Callback function that is called when the search bar in the destination list is opened.')\n .defaultValue(() => {}),\n sourceFilterValue: PropTypes.string\n .description('Specifies the current value of the search filter in the source list.')\n .defaultValue(''),\n destinationFilterValue: PropTypes.string\n .description('Specifies the current value of the search filter in the destination list.')\n .defaultValue(''),\n onSourceFilterChange: PropTypes.func\n .description('Callback function that is called when the search filter in the source list is changed.')\n .defaultValue(() => {}),\n onDestinationFilterChange: PropTypes.func\n .description('Callback function that is called when the search filter in the destination list is changed.')\n .defaultValue(() => {}),\n getSubtitle: PropTypes.func\n .description('Callback function that returns the subtitle to be displayed for each item in the list.')\n .defaultValue(() => ''),\n getIcon: PropTypes.func\n .description('Callback function that returns the icon to be displayed for each item in the list.')\n .defaultValue(() => ''),\n getPreventDrilldown: PropTypes.func\n .description('Callback function that determines whether drilldown should be prevented for a particular item.')\n .defaultValue(() => false),\n getCustomRenderer: PropTypes.func\n .description('Callback function that returns a custom renderer for each item in the list.')\n .defaultValue(() => undefined),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as WeakValidationMap<DSShuttleV2T.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;AA+QhE,MAAM,eAA0C;AAAA,EACrD,0BAA0B;AAAA,EAC1B,kCAAkC;AAAA,EAElC,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,kBAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAE9B,aAAa,MAAM;AAAA,EAAC;AAAA,EACpB,kBAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,gBAAgB,MAAM;AAAA,EAAC;AAAA,EACvB,qBAAqB,MAAM;AAAA,EAAC;AAAA,EAC5B,iBAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,sBAAsB,MAAM;AAAA,EAAC;AAAA,EAE7B,wBAAwB,CAAC;AAAA,EACzB,oBAAoB,MAAM;AAAA,EAAC;AAAA,EAC3B,6BAA6B,CAAC;AAAA,EAC9B,yBAAyB,MAAM;AAAA,EAAC;AAAA,EAEhC,gBAAgB,MAAM;AACxB;AAEA,MAAM,uBAA8D;AAAA,EAClE,GAAG;AAAA,EACH,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ClB,qBAAqB,UAAU,KAC5B,YAAY,sEAAsE,EAClF,aAAa,KAAK;AAAA,EACrB,0BAA0B,UAAU,KACjC,YAAY,2EAA2E,EACvF,aAAa,KAAK;AAAA,EACrB,uBAAuB,UAAU,KAC9B,YAAY,oFAAoF,EAChG,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,2BAA2B,UAAU,KAClC,YAAY,yFAAyF,EACrG,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,mBAAmB,UAAU,OAC1B,YAAY,sEAAsE,EAClF,aAAa,EAAE;AAAA,EAClB,wBAAwB,UAAU,OAC/B,YAAY,2EAA2E,EACvF,aAAa,EAAE;AAAA,EAClB,sBAAsB,UAAU,KAC7B,YAAY,wFAAwF,EACpG,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,2BAA2B,UAAU,KAClC,YAAY,6FAA6F,EACzG,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACxB,aAAa,UAAU,KACpB,YAAY,wFAAwF,EACpG,aAAa,MAAM,EAAE;AAAA,EACxB,SAAS,UAAU,KAChB,YAAY,oFAAoF,EAChG,aAAa,MAAM,EAAE;AAAA,EACxB,qBAAqB,UAAU,KAC5B,YAAY,gGAAgG,EAC5G,aAAa,MAAM,KAAK;AAAA,EAC3B,mBAAmB,UAAU,KAC1B,YAAY,6EAA6E,EACzF,aAAa,MAAM,MAAS;AACjC;AAEO,MAAM,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -46,6 +46,7 @@ const useListData = (startingData) => {
|
|
|
46
46
|
const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
47
47
|
const displayedData = useMemo(
|
|
48
48
|
() => currentNode.children.map((node) => node.getJson()),
|
|
49
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
50
|
[currentNode, hash]
|
|
50
51
|
);
|
|
51
52
|
const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/basic.js"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item\n key={`${node.dsId}`}\n label={node.plainItem.label}\n onClick={() => setCurrentNode(node)}\n dataTestId=\"amigo\"\n />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return useMemo(\n () => ({\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n\n breadcrumbPath,\n displayedData,\n onDrilldown,\n }),\n [addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection],\n );\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),\n [addSourceNode, currentSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),\n [addDestinationNode, currentDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACkCf;AAjCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,SAAS,eAAe,GAAG;AAAA,IACrD,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,UAAU;AAAA,EACd,aAAa,CAAC,SAAS,KAAK;AAC9B;AAEA,MAAM,qBAAqB,cAAc,EAAE,QAAQ,SAAS,CAAC;AAC7D,MAAM,0BAA0B,cAAc,EAAE,QAAQ,cAAc,CAAC;AAEvE,MAAM,aAAa,CAAC,UAAU;AAC5B,QAAM,EAAE,gBAAgB,
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkCf;AAjCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,a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AC,UAAU,MAAM,QAAQ,CAAC,SAAS,iBAAiB,KAAK,IAAI,IAAI,CAAC;AAAA,IAClE,CAAC,gBAAgB;AAAA,EACnB;AAEA,QAAM,mBAAmB;AAAA,IACvB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,mBAAmB,MAAM,EAAE,QAAQ,uBAAuB,CAAC,CAAC;AAAA,IAC/F,CAAC,oBAAoB,sBAAsB;AAAA,EAC7C;AAEA,QAAM,sBAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -44,6 +44,7 @@ const useListData = (startingData) => {
|
|
|
44
44
|
const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
45
45
|
const displayedData = useMemo(
|
|
46
46
|
() => currentNode.children.map((node) => node.getJson()).filter((item) => matcheslenientStringSearch(filterValue, item.label)),
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
48
|
[currentNode, hash, filterValue]
|
|
48
49
|
);
|
|
49
50
|
const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/filter.js"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst matcheslenientStringSearch = (filter, str) => {\n const regexpString = `[\\\\s\\\\S]*${filter.replace(/\\s/g, '').split('').join('[\\\\s\\\\S]*')}[\\\\s\\\\S]*`;\n const regexpFilter = new RegExp(regexpString);\n return regexpFilter.test(str);\n};\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [filterValue, setFilterValue] = useState('');\n\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () =>\n currentNode.children\n .map((node) => node.getJson())\n .filter((item) => matcheslenientStringSearch(filterValue, item.label)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash, filterValue],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n filterValue,\n setFilterValue,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n filterValue: sourceFilterValue,\n setFilterValue: setSourceFilterValue,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n filterValue: destinationFilterValue,\n setFilterValue: setDestinationFilterValue,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return useMemo(\n () => ({\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n }),\n [\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n ],\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACwCf;AAvCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,SAAS,eAAe,GAAG;AAAA,IACrD,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ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mBAAmB,KAAK,MAAM,KAAK,uBAAuB,CAAC;AAAA,IAChG;AAAA,IACF,CAAC,oBAAoB,wBAAwB,kBAAkB;AAAA,EACjE;AAEA,QAAM,sBAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -39,6 +39,7 @@ const useListData = (startingData) => {
|
|
|
39
39
|
const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
40
40
|
const displayedData = useMemo(
|
|
41
41
|
() => currentNode.children.map((node) => node.getJson()),
|
|
42
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
43
|
[currentNode, hash]
|
|
43
44
|
);
|
|
44
45
|
const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/loadMore.js"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n const onLoadMore = useCallback(() => {\n setIsLoadingMore(true);\n setTimeout(() => {\n const newChildren = Array.from({ length: 1 }, (_, i) =>\n genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i }),\n );\n newChildren.forEach((child) => addNode(child, { parent: currentNode }));\n setIsLoadingMore(false);\n }, 1000);\n }, [addNode, currentNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n isLoadingMore,\n onLoadMore,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n isLoadingMore: isSourceLoadingMore,\n onLoadMore: onLoadMoreSource,\n } = useListData(startingSourceData, 'S');\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n isLoadingMore: isDestinationLoadingMore,\n onLoadMore: onLoadMoreDestination,\n } = useListData(startingDestinationData, 'D');\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n isSourceLoadingMore,\n onLoadMoreSource,\n isDestinationLoadingMore,\n onLoadMoreDestination,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACkCf;AAjCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,SAAS,eAAe,GAAG;AAAA,IACrD,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,UAAU;AAAA,EACd,aAAa,CAAC,SAAS,KAAK;AAC9B;AAEA,MAAM,qBAAqB,cAAc,EA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CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
declare const DSShuttleV2: (props: object) => JSX.Element;
|
|
2
|
+
declare const DSShuttleV2WithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<object>;
|
|
3
|
+
export { DSShuttleV2, DSShuttleV2WithSchema };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type DSButtonT } from '@elliemae/ds-button-v2';
|
|
3
|
-
import { type DSShuttleV2T } from '../react-desc-prop-types';
|
|
3
|
+
import { type DSShuttleV2T } from '../react-desc-prop-types.js';
|
|
4
4
|
export declare const useHandleMoveSelection: ({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => {
|
|
5
5
|
moveSelection: (event: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
2
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
3
3
|
export declare const useAutoCalculated: (propsWithDefaults: DSShuttleV2T.InternalProps) => {
|
|
4
4
|
sourceVirtualItems: import("react-virtual").VirtualItem[];
|
|
5
5
|
sourceTotalSize: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
1
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
2
2
|
export declare const useDataStructure: (propsFromUser: DSShuttleV2T.InternalProps) => {
|
|
3
3
|
destinationSelectedItemsMap: Record<string, {
|
|
4
4
|
datum: DSShuttleV2T.Datum;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type UseVirtualReturnType } from 'react-virtual';
|
|
3
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
3
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
4
4
|
type VirtualConfigT<T extends 'source' | 'destination'> = {
|
|
5
5
|
[key in keyof UseVirtualReturnType as `${T}${Capitalize<string & key>}`]: UseVirtualReturnType[key];
|
|
6
6
|
} & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useFocusActionTrackers } from './useFocusActionTrackers';
|
|
2
|
-
export { useFocusItemTracker } from './useFocusItemTracker';
|
|
3
|
-
export { useFocusRegionTrackers } from './useFocusRegionTrackers';
|
|
4
|
-
export { useFocusTracker } from './useFocusTracker';
|
|
1
|
+
export { useFocusActionTrackers } from './useFocusActionTrackers.js';
|
|
2
|
+
export { useFocusItemTracker } from './useFocusItemTracker.js';
|
|
3
|
+
export { useFocusRegionTrackers } from './useFocusRegionTrackers.js';
|
|
4
|
+
export { useFocusTracker } from './useFocusTracker.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
1
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
2
2
|
export declare const useFocusItemTracker: () => {
|
|
3
3
|
trackFocusItem: (item: DSShuttleV2T.ConfiguredDatum) => void;
|
|
4
4
|
trackFocusItemReset: () => void;
|
|
@@ -4,16 +4,16 @@ export declare const useFocusTracker: () => {
|
|
|
4
4
|
trackFocusActionDragAndDrop: () => void;
|
|
5
5
|
trackFocusActionParent: () => void;
|
|
6
6
|
trackFocusActionReset: () => void;
|
|
7
|
-
trackFocusPrevAction: ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }: import("../../react-desc-prop-types").DSShuttleV2T.ItemMeta) => void;
|
|
8
|
-
trackFocusNextAction: ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }: import("../../react-desc-prop-types").DSShuttleV2T.ItemMeta) => void;
|
|
9
|
-
trackFocusItem: (item: import("../../react-desc-prop-types").DSShuttleV2T.ConfiguredDatum) => void;
|
|
7
|
+
trackFocusPrevAction: ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }: import("../../react-desc-prop-types.js").DSShuttleV2T.ItemMeta) => void;
|
|
8
|
+
trackFocusNextAction: ({ isDestinationPanel, datumHydratables, datumInternalMeta: { hydratedPreventMove } }: import("../../react-desc-prop-types.js").DSShuttleV2T.ItemMeta) => void;
|
|
9
|
+
trackFocusItem: (item: import("../../react-desc-prop-types.js").DSShuttleV2T.ConfiguredDatum) => void;
|
|
10
10
|
trackFocusItemReset: () => void;
|
|
11
|
-
trackFocusItemFirst: ({ isDestinationPanel }: import("../../react-desc-prop-types").DSShuttleV2T.PanelMetaInfo) => void;
|
|
12
|
-
trackFocusItemLast: ({ isDestinationPanel }: import("../../react-desc-prop-types").DSShuttleV2T.PanelMetaInfo) => void;
|
|
11
|
+
trackFocusItemFirst: ({ isDestinationPanel }: import("../../react-desc-prop-types.js").DSShuttleV2T.PanelMetaInfo) => void;
|
|
12
|
+
trackFocusItemLast: ({ isDestinationPanel }: import("../../react-desc-prop-types.js").DSShuttleV2T.PanelMetaInfo) => void;
|
|
13
13
|
trackFocusLoadMoreBtnDestination: () => void;
|
|
14
14
|
trackFocusLoadMoreBtn: () => void;
|
|
15
|
-
trackFocusPrevItem: ({ isDestinationPanel }: import("../../react-desc-prop-types").DSShuttleV2T.PanelMetaInfo) => void;
|
|
16
|
-
trackFocusNextItem: ({ isDestinationPanel }: import("../../react-desc-prop-types").DSShuttleV2T.PanelMetaInfo) => void;
|
|
15
|
+
trackFocusPrevItem: ({ isDestinationPanel }: import("../../react-desc-prop-types.js").DSShuttleV2T.PanelMetaInfo) => void;
|
|
16
|
+
trackFocusNextItem: ({ isDestinationPanel }: import("../../react-desc-prop-types.js").DSShuttleV2T.PanelMetaInfo) => void;
|
|
17
17
|
trackFocusRegionSourceHeader: () => void;
|
|
18
18
|
trackFocusRegionSourcePanel: () => void;
|
|
19
19
|
trackFocusRegionSourceBottom: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './useStore';
|
|
1
|
+
export * from './useStore.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type ZustandT } from '@elliemae/ds-zustand-helpers';
|
|
3
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
3
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
4
4
|
export declare const PropsProvider: ({ createStore, children, }: {
|
|
5
5
|
createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
6
6
|
sourceVirtualItems: import("react-virtual").VirtualItem[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WeakValidationMap } from 'react';
|
|
2
|
-
import type { DSShuttleV2T } from '../react-desc-prop-types';
|
|
2
|
+
import type { DSShuttleV2T } from '../react-desc-prop-types.js';
|
|
3
3
|
export declare const useValidateProps: (props: DSShuttleV2T.Props, propTypes: WeakValidationMap<unknown>) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSShuttleV2T } from '../react-desc-prop-types.js';
|
|
3
|
+
export type ShuttleItemProps = React.PropsWithChildren<{
|
|
4
|
+
componentProps: DSShuttleV2T.ComponentProps;
|
|
5
|
+
shouldShowTooltip?: boolean;
|
|
6
|
+
TooltipContent?: React.ComponentType<DSShuttleV2T.ComponentProps>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const ShuttleItem: React.ComponentType<ShuttleItemProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ShuttleItemProps, ShuttleItem } from './ShuttleItem.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { DSShuttleV2Name, DSShuttleV2Slots, DSShuttleV2DataTestIds } from './config/DSShuttleV2Definitions';
|
|
2
|
-
export { DSShuttleV2 } from './DSShuttleV2';
|
|
1
|
+
export { DSShuttleV2Name, DSShuttleV2Slots, DSShuttleV2DataTestIds } from './config/DSShuttleV2Definitions.js';
|
|
2
|
+
export { DSShuttleV2, DSShuttleV2WithSchema } from './DSShuttleV2.js';
|
|
3
|
+
export { ShuttleItem, type ShuttleItemProps } from './exported-related/index.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type DSShuttleV2T } from '../react-desc-prop-types';
|
|
2
|
+
import { type DSShuttleV2T } from '../react-desc-prop-types.js';
|
|
3
3
|
export declare const Header: React.MemoExoticComponent<({ isDestinationPanel }: DSShuttleV2T.PanelMetaInfo) => JSX.Element>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useSortable } from '@elliemae/ds-drag-and-drop';
|
|
2
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
2
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
3
3
|
type HoCConfig = DSShuttleV2T.ItemMeta;
|
|
4
4
|
type ResultComponentProps = DSShuttleV2T.ItemMeta & {
|
|
5
5
|
useSortableHelpers: ReturnType<typeof useSortable>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type DSShuttleV2T } from '../../react-desc-prop-types';
|
|
2
|
+
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
3
3
|
export declare const Item: React.MemoExoticComponent<(itemMeta: DSShuttleV2T.ItemMeta) => JSX.Element>;
|
|
4
4
|
declare const ItemSortable: React.ComponentType<DSShuttleV2T.ItemMeta>;
|
|
5
5
|
export { ItemSortable };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type DSShuttleV2T } from '../../../react-desc-prop-types';
|
|
2
|
+
import { type DSShuttleV2T } from '../../../react-desc-prop-types.js';
|
|
3
3
|
export declare const ItemActions: React.MemoExoticComponent<(itemMeta: DSShuttleV2T.ItemMeta) => JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './ItemActions';
|
|
1
|
+
export * from './ItemActions.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type DSShuttleV2T } from '../../../react-desc-prop-types';
|
|
2
|
+
import { type DSShuttleV2T } from '../../../react-desc-prop-types.js';
|
|
3
3
|
export declare const useActionsHandlers: (itemMeta: DSShuttleV2T.ItemMeta) => {
|
|
4
4
|
handleClickDrilldown: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
5
5
|
handleClickSingleMove: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|