@elliemae/ds-legacy-shuttle-v2 1.0.0-rc.1
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 +46 -0
- package/dist/cjs/DSShuttleV2.js.map +7 -0
- package/dist/cjs/config/DSShuttleV2Definitions.js +74 -0
- package/dist/cjs/config/DSShuttleV2Definitions.js.map +7 -0
- package/dist/cjs/config/itemMovementHelpers.js +133 -0
- package/dist/cjs/config/itemMovementHelpers.js.map +7 -0
- package/dist/cjs/config/useAutoCalculated/index.js +43 -0
- package/dist/cjs/config/useAutoCalculated/index.js.map +7 -0
- package/dist/cjs/config/useAutoCalculated/useDataStructure.js +182 -0
- package/dist/cjs/config/useAutoCalculated/useDataStructure.js.map +7 -0
- package/dist/cjs/config/useAutoCalculated/useShuttleVirtualized.js +51 -0
- package/dist/cjs/config/useAutoCalculated/useShuttleVirtualized.js.map +7 -0
- package/dist/cjs/config/useFocusTracker/index.js +42 -0
- package/dist/cjs/config/useFocusTracker/index.js.map +7 -0
- package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js +149 -0
- package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js.map +7 -0
- package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js +103 -0
- package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js.map +7 -0
- package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js +87 -0
- package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js.map +7 -0
- package/dist/cjs/config/useFocusTracker/useFocusTracker.js +52 -0
- package/dist/cjs/config/useFocusTracker/useFocusTracker.js.map +7 -0
- package/dist/cjs/config/useStore/focusAndTabIndexManager.js +77 -0
- package/dist/cjs/config/useStore/focusAndTabIndexManager.js.map +7 -0
- package/dist/cjs/config/useStore/index.js +30 -0
- package/dist/cjs/config/useStore/index.js.map +7 -0
- package/dist/cjs/config/useStore/useStore.js +86 -0
- package/dist/cjs/config/useStore/useStore.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +40 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +69 -0
- package/dist/cjs/constants/index.js.map +7 -0
- 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 +43 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/Dnd/DndHandle.js +89 -0
- package/dist/cjs/parts/Dnd/DndHandle.js.map +7 -0
- package/dist/cjs/parts/Dnd/DragOverlay.js +51 -0
- package/dist/cjs/parts/Dnd/DragOverlay.js.map +7 -0
- package/dist/cjs/parts/Dnd/DropIndicator.js +92 -0
- package/dist/cjs/parts/Dnd/DropIndicator.js.map +7 -0
- package/dist/cjs/parts/Header.js +91 -0
- package/dist/cjs/parts/Header.js.map +7 -0
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +121 -0
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +7 -0
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js +43 -0
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js.map +7 -0
- package/dist/cjs/parts/Item/Item.js +222 -0
- package/dist/cjs/parts/Item/Item.js.map +7 -0
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js +164 -0
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +7 -0
- package/dist/cjs/parts/Item/ItemActions/index.js +30 -0
- package/dist/cjs/parts/Item/ItemActions/index.js.map +7 -0
- package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js +54 -0
- package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js.map +7 -0
- package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js +82 -0
- package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js.map +7 -0
- package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js +69 -0
- package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js.map +7 -0
- package/dist/cjs/parts/Item/ItemMiddleSection.js +140 -0
- package/dist/cjs/parts/Item/ItemMiddleSection.js.map +7 -0
- package/dist/cjs/parts/Item/ItemOverlay.js +76 -0
- package/dist/cjs/parts/Item/ItemOverlay.js.map +7 -0
- package/dist/cjs/parts/Item/ItemSelection.js +70 -0
- package/dist/cjs/parts/Item/ItemSelection.js.map +7 -0
- package/dist/cjs/parts/Item/TextSection.js +56 -0
- package/dist/cjs/parts/Item/TextSection.js.map +7 -0
- package/dist/cjs/parts/Item/useItemArrowNavigation.js +104 -0
- package/dist/cjs/parts/Item/useItemArrowNavigation.js.map +7 -0
- package/dist/cjs/parts/Item/useItemKeyboardSelection.js +61 -0
- package/dist/cjs/parts/Item/useItemKeyboardSelection.js.map +7 -0
- package/dist/cjs/parts/Item/useSelectionLogic.js +128 -0
- package/dist/cjs/parts/Item/useSelectionLogic.js.map +7 -0
- 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 +116 -0
- package/dist/cjs/parts/MainContent.js.map +7 -0
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +81 -0
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +7 -0
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js +59 -0
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js.map +7 -0
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js +97 -0
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js.map +7 -0
- package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js +51 -0
- package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js.map +7 -0
- package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js +77 -0
- package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/EmptyItems.js +58 -0
- package/dist/cjs/parts/Panel/middle/EmptyItems.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +93 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js +48 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +60 -0
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/LoadingItems.js +68 -0
- package/dist/cjs/parts/Panel/middle/LoadingItems.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +186 -0
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +7 -0
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +174 -0
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +7 -0
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js +71 -0
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js.map +7 -0
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js +79 -0
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js.map +7 -0
- package/dist/cjs/parts/Panel/top/SelectionHeader.js +137 -0
- package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +7 -0
- package/dist/cjs/parts/PanelWrapper.js +83 -0
- package/dist/cjs/parts/PanelWrapper.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +157 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/tests/configs/basic.js +164 -0
- package/dist/cjs/tests/configs/basic.js.map +7 -0
- package/dist/cjs/tests/configs/filter.js +199 -0
- package/dist/cjs/tests/configs/filter.js.map +7 -0
- package/dist/cjs/tests/configs/loadMore.js +179 -0
- package/dist/cjs/tests/configs/loadMore.js.map +7 -0
- package/dist/esm/DSShuttleV2.js +16 -0
- package/dist/esm/DSShuttleV2.js.map +7 -0
- package/dist/esm/config/DSShuttleV2Definitions.js +44 -0
- package/dist/esm/config/DSShuttleV2Definitions.js.map +7 -0
- package/dist/esm/config/itemMovementHelpers.js +103 -0
- package/dist/esm/config/itemMovementHelpers.js.map +7 -0
- package/dist/esm/config/useAutoCalculated/index.js +13 -0
- package/dist/esm/config/useAutoCalculated/index.js.map +7 -0
- package/dist/esm/config/useAutoCalculated/useDataStructure.js +152 -0
- package/dist/esm/config/useAutoCalculated/useDataStructure.js.map +7 -0
- package/dist/esm/config/useAutoCalculated/useShuttleVirtualized.js +21 -0
- package/dist/esm/config/useAutoCalculated/useShuttleVirtualized.js.map +7 -0
- package/dist/esm/config/useFocusTracker/index.js +12 -0
- package/dist/esm/config/useFocusTracker/index.js.map +7 -0
- package/dist/esm/config/useFocusTracker/useFocusActionTrackers.js +119 -0
- package/dist/esm/config/useFocusTracker/useFocusActionTrackers.js.map +7 -0
- package/dist/esm/config/useFocusTracker/useFocusItemTracker.js +73 -0
- package/dist/esm/config/useFocusTracker/useFocusItemTracker.js.map +7 -0
- package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js +57 -0
- package/dist/esm/config/useFocusTracker/useFocusRegionTrackers.js.map +7 -0
- package/dist/esm/config/useFocusTracker/useFocusTracker.js +22 -0
- package/dist/esm/config/useFocusTracker/useFocusTracker.js.map +7 -0
- package/dist/esm/config/useStore/focusAndTabIndexManager.js +47 -0
- package/dist/esm/config/useStore/focusAndTabIndexManager.js.map +7 -0
- package/dist/esm/config/useStore/index.js +3 -0
- package/dist/esm/config/useStore/index.js.map +7 -0
- package/dist/esm/config/useStore/useStore.js +56 -0
- package/dist/esm/config/useStore/useStore.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +39 -0
- package/dist/esm/constants/index.js.map +7 -0
- 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 +13 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/Dnd/DndHandle.js +59 -0
- package/dist/esm/parts/Dnd/DndHandle.js.map +7 -0
- package/dist/esm/parts/Dnd/DragOverlay.js +21 -0
- package/dist/esm/parts/Dnd/DragOverlay.js.map +7 -0
- package/dist/esm/parts/Dnd/DropIndicator.js +62 -0
- package/dist/esm/parts/Dnd/DropIndicator.js.map +7 -0
- package/dist/esm/parts/Header.js +63 -0
- package/dist/esm/parts/Header.js.map +7 -0
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +91 -0
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +7 -0
- package/dist/esm/parts/HoC/withConditionalUseSortable.js +13 -0
- package/dist/esm/parts/HoC/withConditionalUseSortable.js.map +7 -0
- package/dist/esm/parts/Item/Item.js +192 -0
- package/dist/esm/parts/Item/Item.js.map +7 -0
- package/dist/esm/parts/Item/ItemActions/ItemActions.js +134 -0
- package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +7 -0
- package/dist/esm/parts/Item/ItemActions/index.js +3 -0
- package/dist/esm/parts/Item/ItemActions/index.js.map +7 -0
- package/dist/esm/parts/Item/ItemActions/useActionsHandlers.js +24 -0
- package/dist/esm/parts/Item/ItemActions/useActionsHandlers.js.map +7 -0
- package/dist/esm/parts/Item/ItemActions/useActionsLogicHandlers.js +52 -0
- package/dist/esm/parts/Item/ItemActions/useActionsLogicHandlers.js.map +7 -0
- package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js +39 -0
- package/dist/esm/parts/Item/ItemActions/useInnerRefHandlers.js.map +7 -0
- package/dist/esm/parts/Item/ItemMiddleSection.js +110 -0
- package/dist/esm/parts/Item/ItemMiddleSection.js.map +7 -0
- package/dist/esm/parts/Item/ItemOverlay.js +46 -0
- package/dist/esm/parts/Item/ItemOverlay.js.map +7 -0
- package/dist/esm/parts/Item/ItemSelection.js +40 -0
- package/dist/esm/parts/Item/ItemSelection.js.map +7 -0
- package/dist/esm/parts/Item/TextSection.js +26 -0
- package/dist/esm/parts/Item/TextSection.js.map +7 -0
- package/dist/esm/parts/Item/useItemArrowNavigation.js +78 -0
- package/dist/esm/parts/Item/useItemArrowNavigation.js.map +7 -0
- package/dist/esm/parts/Item/useItemKeyboardSelection.js +31 -0
- package/dist/esm/parts/Item/useItemKeyboardSelection.js.map +7 -0
- package/dist/esm/parts/Item/useSelectionLogic.js +98 -0
- package/dist/esm/parts/Item/useSelectionLogic.js.map +7 -0
- 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 +86 -0
- package/dist/esm/parts/MainContent.js.map +7 -0
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +51 -0
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +7 -0
- package/dist/esm/parts/Panel/bottom/LoadingMore.js +29 -0
- package/dist/esm/parts/Panel/bottom/LoadingMore.js.map +7 -0
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js +67 -0
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js.map +7 -0
- package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js +21 -0
- package/dist/esm/parts/Panel/bottom/useInnerRefHandlers.js.map +7 -0
- package/dist/esm/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js +51 -0
- package/dist/esm/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js.map +7 -0
- package/dist/esm/parts/Panel/middle/EmptyItems.js +28 -0
- package/dist/esm/parts/Panel/middle/EmptyItems.js.map +7 -0
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js +63 -0
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +7 -0
- package/dist/esm/parts/Panel/middle/ItemListWrapper/getDatumFlags.js +18 -0
- package/dist/esm/parts/Panel/middle/ItemListWrapper/getDatumFlags.js.map +7 -0
- package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +30 -0
- package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +7 -0
- package/dist/esm/parts/Panel/middle/LoadingItems.js +38 -0
- package/dist/esm/parts/Panel/middle/LoadingItems.js.map +7 -0
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +156 -0
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +7 -0
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +144 -0
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +7 -0
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js +41 -0
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js.map +7 -0
- package/dist/esm/parts/Panel/top/PanelFilterSection.js +49 -0
- package/dist/esm/parts/Panel/top/PanelFilterSection.js.map +7 -0
- package/dist/esm/parts/Panel/top/SelectionHeader.js +107 -0
- package/dist/esm/parts/Panel/top/SelectionHeader.js.map +7 -0
- package/dist/esm/parts/PanelWrapper.js +53 -0
- package/dist/esm/parts/PanelWrapper.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +132 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/tests/configs/basic.js +134 -0
- package/dist/esm/tests/configs/basic.js.map +7 -0
- package/dist/esm/tests/configs/filter.js +169 -0
- package/dist/esm/tests/configs/filter.js.map +7 -0
- package/dist/esm/tests/configs/loadMore.js +149 -0
- package/dist/esm/tests/configs/loadMore.js.map +7 -0
- package/dist/types/DSShuttleV2.d.ts +4 -0
- package/dist/types/config/DSShuttleV2Definitions.d.ts +36 -0
- package/dist/types/config/itemMovementHelpers.d.ts +7 -0
- package/dist/types/config/useAutoCalculated/index.d.ts +32 -0
- package/dist/types/config/useAutoCalculated/useDataStructure.d.ts +25 -0
- package/dist/types/config/useAutoCalculated/useShuttleVirtualized.d.ts +9 -0
- package/dist/types/config/useFocusTracker/index.d.ts +4 -0
- package/dist/types/config/useFocusTracker/useFocusActionTrackers.d.ts +10 -0
- package/dist/types/config/useFocusTracker/useFocusItemTracker.d.ts +11 -0
- package/dist/types/config/useFocusTracker/useFocusRegionTrackers.d.ts +18 -0
- package/dist/types/config/useFocusTracker/useFocusTracker.d.ts +33 -0
- package/dist/types/config/useStore/focusAndTabIndexManager.d.ts +10 -0
- package/dist/types/config/useStore/index.d.ts +1 -0
- package/dist/types/config/useStore/useStore.d.ts +301 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +32 -0
- 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 -0
- package/dist/types/parts/Dnd/DndHandle.d.ts +15 -0
- package/dist/types/parts/Dnd/DragOverlay.d.ts +6 -0
- package/dist/types/parts/Dnd/DropIndicator.d.ts +15 -0
- package/dist/types/parts/Header.d.ts +3 -0
- package/dist/types/parts/HoC/withConditionalDnDRowContext.d.ts +10 -0
- package/dist/types/parts/HoC/withConditionalUseSortable.d.ts +8 -0
- package/dist/types/parts/Item/Item.d.ts +6 -0
- package/dist/types/parts/Item/ItemActions/ItemActions.d.ts +3 -0
- package/dist/types/parts/Item/ItemActions/index.d.ts +1 -0
- package/dist/types/parts/Item/ItemActions/useActionsHandlers.d.ts +7 -0
- package/dist/types/parts/Item/ItemActions/useActionsLogicHandlers.d.ts +7 -0
- package/dist/types/parts/Item/ItemActions/useInnerRefHandlers.d.ts +6 -0
- package/dist/types/parts/Item/ItemMiddleSection.d.ts +5 -0
- package/dist/types/parts/Item/ItemOverlay.d.ts +5 -0
- package/dist/types/parts/Item/ItemSelection.d.ts +3 -0
- package/dist/types/parts/Item/TextSection.d.ts +3 -0
- package/dist/types/parts/Item/useItemArrowNavigation.d.ts +5 -0
- package/dist/types/parts/Item/useItemKeyboardSelection.d.ts +5 -0
- package/dist/types/parts/Item/useSelectionLogic.d.ts +6 -0
- package/dist/types/parts/Item/useThisItemIsFocused.d.ts +4 -0
- package/dist/types/parts/MainContent.d.ts +2 -0
- package/dist/types/parts/Panel/bottom/LoadMoreBtn.d.ts +2 -0
- package/dist/types/parts/Panel/bottom/LoadingMore.d.ts +2 -0
- package/dist/types/parts/Panel/bottom/PanelContentBottomSection.d.ts +3 -0
- package/dist/types/parts/Panel/bottom/useInnerRefHandlers.d.ts +4 -0
- package/dist/types/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.d.ts +5 -0
- package/dist/types/parts/Panel/middle/EmptyItems.d.ts +2 -0
- package/dist/types/parts/Panel/middle/ItemListWrapper/Index.d.ts +4 -0
- package/dist/types/parts/Panel/middle/ItemListWrapper/getDatumFlags.d.ts +15 -0
- package/dist/types/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.d.ts +11 -0
- package/dist/types/parts/Panel/middle/LoadingItems.d.ts +2 -0
- package/dist/types/parts/Panel/middle/MultipleSelectionAction.d.ts +3 -0
- package/dist/types/parts/Panel/middle/PanelContentMiddleSection.d.ts +3 -0
- package/dist/types/parts/Panel/top/PanelContentTopSection.d.ts +2 -0
- package/dist/types/parts/Panel/top/PanelFilterSection.d.ts +2 -0
- package/dist/types/parts/Panel/top/SelectionHeader.d.ts +3 -0
- package/dist/types/parts/PanelWrapper.d.ts +3 -0
- package/dist/types/react-desc-prop-types.d.ts +199 -0
- package/dist/types/tests/configs/basic.d.ts +25 -0
- package/dist/types/tests/configs/filter.d.ts +29 -0
- package/dist/types/tests/configs/loadMore.d.ts +29 -0
- package/dist/types/tests/shuttle-v2.basic.test.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.filter.test.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.load-more.test.d.ts +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React2, { useCallback } from "react";
|
|
4
|
+
import { styled } from "@elliemae/ds-legacy-system";
|
|
5
|
+
import { Grid } from "@elliemae/ds-legacy-grid";
|
|
6
|
+
import { Header } from "./Header.js";
|
|
7
|
+
import { PanelContentTopSection } from "./Panel/top/PanelContentTopSection.js";
|
|
8
|
+
import { PanelContentMiddleSection } from "./Panel/middle/PanelContentMiddleSection.js";
|
|
9
|
+
import { PanelContentBottomSection } from "./Panel/bottom/PanelContentBottomSection.js";
|
|
10
|
+
import { DSShuttleV2Name, DSShuttleV2Slots } from "../config/DSShuttleV2Definitions.js";
|
|
11
|
+
import { usePropsStore } from "../config/useStore/useStore.js";
|
|
12
|
+
const StyledPanelWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.PANEL_WRAPPER })`
|
|
13
|
+
min-width: 300px;
|
|
14
|
+
`;
|
|
15
|
+
const StyledListWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.LIST_WRAPPER })`
|
|
16
|
+
border: 1px solid neutral-400;
|
|
17
|
+
height: 100%;
|
|
18
|
+
`;
|
|
19
|
+
const panelWrapperRows = ["auto", "1fr"];
|
|
20
|
+
const listWrapperRows = ["auto", "1fr", "auto"];
|
|
21
|
+
const PanelWrapper = React2.memo((panelMetaInfo) => {
|
|
22
|
+
const getOwnerProps = usePropsStore((store) => store.get);
|
|
23
|
+
const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
StyledPanelWrapper,
|
|
26
|
+
{
|
|
27
|
+
rows: panelWrapperRows,
|
|
28
|
+
gutter: "xxxs",
|
|
29
|
+
getOwnerProps,
|
|
30
|
+
getOwnerPropsArguments,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(Header, { ...panelMetaInfo }),
|
|
33
|
+
/* @__PURE__ */ jsxs(
|
|
34
|
+
StyledListWrapper,
|
|
35
|
+
{
|
|
36
|
+
rows: listWrapperRows,
|
|
37
|
+
getOwnerProps,
|
|
38
|
+
getOwnerPropsArguments,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx(PanelContentTopSection, { ...panelMetaInfo }),
|
|
41
|
+
/* @__PURE__ */ jsx(PanelContentMiddleSection, { ...panelMetaInfo }),
|
|
42
|
+
/* @__PURE__ */ jsx(PanelContentBottomSection, { ...panelMetaInfo })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
PanelWrapper
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=PanelWrapper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/PanelWrapper.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { styled } from '@elliemae/ds-legacy-system';\nimport { Grid } from '@elliemae/ds-legacy-grid';\nimport { type DSShuttleV2T } from '../react-desc-prop-types.js';\nimport { Header } from './Header.js';\nimport { PanelContentTopSection } from './Panel/top/PanelContentTopSection.js';\nimport { PanelContentMiddleSection } from './Panel/middle/PanelContentMiddleSection.js';\nimport { PanelContentBottomSection } from './Panel/bottom/PanelContentBottomSection.js';\nimport { DSShuttleV2Name, DSShuttleV2Slots } from '../config/DSShuttleV2Definitions.js';\nimport { usePropsStore } from '../config/useStore/useStore.js';\n\nconst StyledPanelWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.PANEL_WRAPPER })`\n min-width: 300px;\n`;\nconst StyledListWrapper = styled(Grid, { name: DSShuttleV2Name, slot: DSShuttleV2Slots.LIST_WRAPPER })`\n border: 1px solid neutral-400;\n height: 100%;\n`;\nconst panelWrapperRows = ['auto', '1fr'];\nconst listWrapperRows = ['auto', '1fr', 'auto'];\n\nexport const PanelWrapper = React.memo((panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => {\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = useCallback(() => panelMetaInfo, [panelMetaInfo]);\n return (\n <StyledPanelWrapper\n rows={panelWrapperRows}\n gutter=\"xxxs\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Header {...panelMetaInfo} />\n <StyledListWrapper\n rows={listWrapperRows}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <PanelContentTopSection {...panelMetaInfo} />\n <PanelContentMiddleSection {...panelMetaInfo} />\n <PanelContentBottomSection {...panelMetaInfo} />\n </StyledListWrapper>\n </StyledPanelWrapper>\n );\n});\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+BjB,cACA,YADA;AA/BN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,cAAc;AACvB,SAAS,YAAY;AAErB,SAAS,cAAc;AACvB,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAC1C,SAAS,iCAAiC;AAC1C,SAAS,iBAAiB,wBAAwB;AAClD,SAAS,qBAAqB;AAE9B,MAAM,qBAAqB,OAAO,MAAM,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,cAAc,CAAC;AAAA;AAAA;AAGvG,MAAM,oBAAoB,OAAO,MAAM,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,aAAa,CAAC;AAAA;AAAA;AAAA;AAIrG,MAAM,mBAAmB,CAAC,QAAQ,KAAK;AACvC,MAAM,kBAAkB,CAAC,QAAQ,OAAO,MAAM;AAEvC,MAAM,eAAeA,OAAM,KAAK,CAAC,kBAA8C;AACpF,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,yBAAyB,YAAY,MAAM,eAAe,CAAC,aAAa,CAAC;AAC/E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,UAAQ,GAAG,eAAe;AAAA,QAC3B;AAAA,UAAC;AAAA;AAAA,YACC,MAAM;AAAA,YACN;AAAA,YACA;AAAA,YAEA;AAAA,kCAAC,0BAAwB,GAAG,eAAe;AAAA,cAC3C,oBAAC,6BAA2B,GAAG,eAAe;AAAA,cAC9C,oBAAC,6BAA2B,GAAG,eAAe;AAAA;AAAA;AAAA,QAChD;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import {
|
|
3
|
+
PropTypes,
|
|
4
|
+
globalAttributesPropTypes,
|
|
5
|
+
xstyledPropTypes,
|
|
6
|
+
getPropsPerDatatestIdPropTypes
|
|
7
|
+
} from "@elliemae/ds-legacy-utilities";
|
|
8
|
+
import { DSShuttleV2DataTestIds } from "./config/DSShuttleV2Definitions.js";
|
|
9
|
+
const defaultProps = {
|
|
10
|
+
addDragAndDropFromSource: false,
|
|
11
|
+
removeDragAndDropFromDestination: false,
|
|
12
|
+
sourceIsLoading: false,
|
|
13
|
+
destinationIsLoading: false,
|
|
14
|
+
sourceWithLoadMore: false,
|
|
15
|
+
destinationWithLoadMore: false,
|
|
16
|
+
sourceIsLoadingMore: false,
|
|
17
|
+
destinationIsLoadingMore: false,
|
|
18
|
+
onSourceLoadMore: () => {
|
|
19
|
+
},
|
|
20
|
+
onDestinationLoadMore: () => {
|
|
21
|
+
},
|
|
22
|
+
onSourceAdd: () => {
|
|
23
|
+
},
|
|
24
|
+
onDestinationAdd: () => {
|
|
25
|
+
},
|
|
26
|
+
onSourceRemove: () => {
|
|
27
|
+
},
|
|
28
|
+
onDestinationRemove: () => {
|
|
29
|
+
},
|
|
30
|
+
onSourceReorder: () => {
|
|
31
|
+
},
|
|
32
|
+
onDestinationReorder: () => {
|
|
33
|
+
},
|
|
34
|
+
sourceSoftDeletedItems: {},
|
|
35
|
+
onSourceSoftDelete: () => {
|
|
36
|
+
},
|
|
37
|
+
destinationSoftDeletedItems: {},
|
|
38
|
+
onDestinationSoftDelete: () => {
|
|
39
|
+
},
|
|
40
|
+
getPreventMove: () => false
|
|
41
|
+
};
|
|
42
|
+
const DSShuttleV2PropTypes = {
|
|
43
|
+
...globalAttributesPropTypes,
|
|
44
|
+
...xstyledPropTypes,
|
|
45
|
+
sourceData: PropTypes.arrayOf(PropTypes.object).description(
|
|
46
|
+
"An array of objects representing the items in the source list"
|
|
47
|
+
).isRequired,
|
|
48
|
+
sourceSelectedItems: PropTypes.object.description("An object representing the selected items in the source list").isRequired,
|
|
49
|
+
onSourceSelectionChange: PropTypes.func.description("A function called when the selection in the source list changes").isRequired,
|
|
50
|
+
SourceHeader: PropTypes.node.description("The header component for the source list").isRequired,
|
|
51
|
+
onSourceDrilldown: PropTypes.func.description("A function called when an item in the source list is clicked").isRequired,
|
|
52
|
+
destinationData: PropTypes.arrayOf(PropTypes.object).description(
|
|
53
|
+
"An array of objects representing the items in the destination list"
|
|
54
|
+
).isRequired,
|
|
55
|
+
destinationSelectedItems: PropTypes.object.description(
|
|
56
|
+
"An object representing the selected items in the destination list"
|
|
57
|
+
).isRequired,
|
|
58
|
+
onDestinationSelectionChange: PropTypes.func.description(
|
|
59
|
+
"A function called when the selection in the destination list changes"
|
|
60
|
+
).isRequired,
|
|
61
|
+
DestinationHeader: PropTypes.node.description("The header component for the destination list").isRequired,
|
|
62
|
+
onDestinationDrilldown: PropTypes.func.description(
|
|
63
|
+
"A function called when an item in the destination list is clicked"
|
|
64
|
+
).isRequired,
|
|
65
|
+
getId: PropTypes.func.description(
|
|
66
|
+
"A function that takes an item from the source/destination list and returns its unique identifier"
|
|
67
|
+
).isRequired,
|
|
68
|
+
getLabel: PropTypes.func.description(
|
|
69
|
+
"A function that takes an item from the source/destination list and returns its display label"
|
|
70
|
+
).isRequired,
|
|
71
|
+
sourceIsLoading: PropTypes.bool.description("A boolean indicating whether the source list is currently loading data").defaultValue(false),
|
|
72
|
+
destinationIsLoading: PropTypes.bool.description("A boolean indicating whether the destination list is currently loading data").defaultValue(false),
|
|
73
|
+
sourceWithLoadMore: PropTypes.bool.description('A boolean indicating whether the source list supports "load more" functionality').defaultValue(false),
|
|
74
|
+
destinationWithLoadMore: PropTypes.bool.description('A boolean indicating whether the destination list supports "load more" functionality').defaultValue(false),
|
|
75
|
+
sourceIsLoadingMore: PropTypes.bool.description("A boolean indicating whether the source list is currently loading more data").defaultValue(false),
|
|
76
|
+
destinationIsLoadingMore: PropTypes.bool.description("A boolean indicating whether the destination list is currently loading more data").defaultValue(false),
|
|
77
|
+
onSourceLoadMore: PropTypes.func.description('A function called when the "load more" button in the source list is clicked').defaultValue(() => {
|
|
78
|
+
}),
|
|
79
|
+
onDestinationLoadMore: PropTypes.func.description('A function called when the "load more" button in the destination list is clicked').defaultValue(() => {
|
|
80
|
+
}),
|
|
81
|
+
onSourceAdd: PropTypes.func.description("A function called when an item is added from the source list to the destination list").defaultValue(() => {
|
|
82
|
+
}),
|
|
83
|
+
onDestinationAdd: PropTypes.func.description("A function called when an item is added from the destination list to the source list").defaultValue(() => {
|
|
84
|
+
}),
|
|
85
|
+
onSourceRemove: PropTypes.func.description("A function called when an item is removed from the destination list").defaultValue(() => {
|
|
86
|
+
}),
|
|
87
|
+
onDestinationRemove: PropTypes.func.description("Callback function to handle when an item is removed from the destination shuttle list. ").defaultValue(() => {
|
|
88
|
+
}),
|
|
89
|
+
onSourceReorder: PropTypes.func.description("Callback function to handle when items are reordered in the source shuttle list.").defaultValue(() => {
|
|
90
|
+
}),
|
|
91
|
+
onDestinationReorder: PropTypes.func.description("Callback function to handle when items are reordered in the destination shuttle list. ").defaultValue(() => {
|
|
92
|
+
}),
|
|
93
|
+
sourceSoftDeletedItems: PropTypes.object.description(
|
|
94
|
+
"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."
|
|
95
|
+
).defaultValue({}),
|
|
96
|
+
onSourceSoftDelete: PropTypes.func.description("Callback function to handle when an item is soft deleted in the source shuttle list. ").defaultValue(() => {
|
|
97
|
+
}),
|
|
98
|
+
destinationSoftDeletedItems: PropTypes.object.description(
|
|
99
|
+
"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."
|
|
100
|
+
).defaultValue({}),
|
|
101
|
+
onDestinationSoftDelete: PropTypes.func.description("Callback function to handle when an item is soft deleted in the destination shuttle list.").defaultValue(() => {
|
|
102
|
+
}),
|
|
103
|
+
getPreventMove: PropTypes.func.description("Function that determines whether a specific item can be moved to the destination shuttle list. ").defaultValue(() => false),
|
|
104
|
+
addDragAndDropFromSource: PropTypes.bool.description("Specifies whether items can be dragged from the source list and dropped into the destination list.").defaultValue(false),
|
|
105
|
+
removeDragAndDropFromDestination: PropTypes.bool.description("Specifies whether items can be removed from the destination list by dragging them out of the list.").defaultValue(false),
|
|
106
|
+
sourceItemProps: PropTypes.object.description("Specifies additional props to be applied to each item in the source list.").defaultValue({}),
|
|
107
|
+
destinationItemProps: PropTypes.object.description("Specifies additional props to be applied to each item in the destination list.").defaultValue({}),
|
|
108
|
+
sourceShowSearchbar: PropTypes.bool.description("Specifies whether the search bar should be shown in the source list.").defaultValue(false),
|
|
109
|
+
destinationShowSearchbar: PropTypes.bool.description("Specifies whether the search bar should be shown in the destination list.").defaultValue(false),
|
|
110
|
+
onSourceOpenSearchbar: PropTypes.func.description("Callback function that is called when the search bar in the source list is opened.").defaultValue(() => {
|
|
111
|
+
}),
|
|
112
|
+
onDesinationOpenSearchbar: PropTypes.func.description("Callback function that is called when the search bar in the destination list is opened.").defaultValue(() => {
|
|
113
|
+
}),
|
|
114
|
+
sourceFilterValue: PropTypes.string.description("Specifies the current value of the search filter in the source list.").defaultValue(""),
|
|
115
|
+
destinationFilterValue: PropTypes.string.description("Specifies the current value of the search filter in the destination list.").defaultValue(""),
|
|
116
|
+
onSourceFilterChange: PropTypes.func.description("Callback function that is called when the search filter in the source list is changed.").defaultValue(() => {
|
|
117
|
+
}),
|
|
118
|
+
onDestinationFilterChange: PropTypes.func.description("Callback function that is called when the search filter in the destination list is changed.").defaultValue(() => {
|
|
119
|
+
}),
|
|
120
|
+
getSubtitle: PropTypes.func.description("Callback function that returns the subtitle to be displayed for each item in the list.").defaultValue(() => ""),
|
|
121
|
+
getIcon: PropTypes.func.description("Callback function that returns the icon to be displayed for each item in the list.").defaultValue(() => ""),
|
|
122
|
+
getPreventDrilldown: PropTypes.func.description("Callback function that determines whether drilldown should be prevented for a particular item.").defaultValue(() => false),
|
|
123
|
+
getCustomRenderer: PropTypes.func.description("Callback function that returns a custom renderer for each item in the list.").defaultValue(() => void 0),
|
|
124
|
+
getBatchActionableButtonProps: PropTypes.func.description("Callback function that returns the props for the batch actionable button in the destination list.").defaultValue(() => ({})).signature(`(({ isDestionationPanel: boolean }) => ({ "aria-label": string }))`),
|
|
125
|
+
...getPropsPerDatatestIdPropTypes(DSShuttleV2DataTestIds)
|
|
126
|
+
};
|
|
127
|
+
const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes;
|
|
128
|
+
export {
|
|
129
|
+
DSShuttleV2PropTypesSchema,
|
|
130
|
+
defaultProps
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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, useHeadlessTooltip } from '@elliemae/ds-legacy-utilities';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n getPropsPerDatatestIdPropTypes,\n} from '@elliemae/ds-legacy-utilities';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-legacy-form-checkbox';\nimport { type DSButtonT } from '@elliemae/ds-legacy-button-v2';\nimport { type useSortable, type DnDKitTree } from '@elliemae/ds-legacy-drag-and-drop';\nimport type { ZustandT } from '@elliemae/ds-legacy-zustand-helpers';\n\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from './constants/index.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated/index.js';\nimport { DSShuttleV2DataTestIds } from './config/DSShuttleV2Definitions.js';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection: boolean; height?: number };\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 - panel level hydratables\n // =============================================================================\n type RequiredPanelHydratables = Record<string, never>;\n type OptionalPanelHydratables = {\n batchActionableButtonProps: DSButtonT.Props;\n };\n export type PanelHydratables = RequiredPanelHydratables & OptionalPanelHydratables;\n\n // =============================================================================\n // Hydratables section - datum level hydratables\n // shared usage between internal and custom component\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 - datum level hydratables\n // Custom 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 - datum level hydratables\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = PrimaryKeyHydratables & 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 type RequiredPanelHydraters = Hydraters<RequiredPanelHydratables, [PanelMetaInfo]>;\n type OptionalPanelHydraters = Partial<Hydraters<OptionalPanelHydratables, [PanelMetaInfo]>>;\n type PanelHydraters = RequiredPanelHydraters & OptionalPanelHydraters;\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, OptionalPanelHydraters {\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 getBatchActionableButtonProps: PropTypes.func\n .description('Callback function that returns the props for the batch actionable button in the destination list.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n ...getPropsPerDatatestIdPropTypes(DSShuttleV2DataTestIds),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as WeakValidationMap<DSShuttleV2T.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP,SAAS,8BAA8B;AAqRhC,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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AClB,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;AAAA,EAC/B,+BAA+B,UAAU,KACtC,YAAY,mGAAmG,EAC/G,aAAa,OAAO,CAAC,EAAE,EACvB,UAAU,oEAAoE;AAAA,EACjF,GAAG,+BAA+B,sBAAsB;AAC1D;AAEO,MAAM,6BAA6B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import React2, { useMemo, useState, useCallback } from "react";
|
|
4
|
+
import { DSBreadcrumb } from "@elliemae/ds-legacy-breadcrumb";
|
|
5
|
+
import { useDSTree } from "@elliemae/ds-legacy-tree-model";
|
|
6
|
+
import { uid } from "uid";
|
|
7
|
+
const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
|
|
8
|
+
const node = {
|
|
9
|
+
id: uid(),
|
|
10
|
+
label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
|
|
11
|
+
parent: parent ? parent.id : null
|
|
12
|
+
};
|
|
13
|
+
if (depth <= finalDepth) {
|
|
14
|
+
node.subitems = Array.from(
|
|
15
|
+
{ length: 2 },
|
|
16
|
+
(_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return node;
|
|
20
|
+
};
|
|
21
|
+
const options = {
|
|
22
|
+
getUniqueId: (item) => item.id
|
|
23
|
+
};
|
|
24
|
+
const startingSourceData = genTreeOfData({ prefix: "Source" });
|
|
25
|
+
const startingDestinationData = genTreeOfData({ prefix: "Destination" });
|
|
26
|
+
const BreadCrumb = (props) => {
|
|
27
|
+
const { breadCrumbPath, setCurrentNode, ...rest } = props;
|
|
28
|
+
return /* @__PURE__ */ jsx(DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ jsx(
|
|
29
|
+
DSBreadcrumb.Item,
|
|
30
|
+
{
|
|
31
|
+
label: node.plainItem.label,
|
|
32
|
+
onClick: () => setCurrentNode(node),
|
|
33
|
+
dataTestId: "amigo"
|
|
34
|
+
},
|
|
35
|
+
`${node.dsId}`
|
|
36
|
+
)) });
|
|
37
|
+
};
|
|
38
|
+
const BreadCrumbHoc = ({ path, setCurrentNode }) => {
|
|
39
|
+
const WrappedBreadCrumb = (props) => /* @__PURE__ */ jsx(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
|
|
40
|
+
return WrappedBreadCrumb;
|
|
41
|
+
};
|
|
42
|
+
const useListData = (startingData) => {
|
|
43
|
+
const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);
|
|
44
|
+
const [currentNode, setCurrentNode] = useState(getRoot());
|
|
45
|
+
const [selection, setSelection] = useState({});
|
|
46
|
+
const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
47
|
+
const displayedData = useMemo(
|
|
48
|
+
() => currentNode.children.map((node) => node.getJson()),
|
|
49
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
+
[currentNode, hash]
|
|
51
|
+
);
|
|
52
|
+
const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
53
|
+
return useMemo(
|
|
54
|
+
() => ({
|
|
55
|
+
getNode,
|
|
56
|
+
addNode,
|
|
57
|
+
replaceNode,
|
|
58
|
+
removeNode,
|
|
59
|
+
currentNode,
|
|
60
|
+
setCurrentNode,
|
|
61
|
+
selection,
|
|
62
|
+
setSelection,
|
|
63
|
+
breadcrumbPath,
|
|
64
|
+
displayedData,
|
|
65
|
+
onDrilldown
|
|
66
|
+
}),
|
|
67
|
+
[addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection]
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
const useShuttle = () => {
|
|
71
|
+
const {
|
|
72
|
+
currentNode: currentSourceNode,
|
|
73
|
+
setCurrentNode: setCurrentSourceNode,
|
|
74
|
+
selection: sourceSelection,
|
|
75
|
+
setSelection: setSourceSelection,
|
|
76
|
+
breadcrumbPath: sourceBreadCrumbPath,
|
|
77
|
+
displayedData: sourceDisplayedData,
|
|
78
|
+
onDrilldown: onSourceDrilldown,
|
|
79
|
+
addNode: addSourceNode,
|
|
80
|
+
removeNode: removeSourceNode
|
|
81
|
+
} = useListData(startingSourceData);
|
|
82
|
+
const {
|
|
83
|
+
currentNode: currentDestinationNode,
|
|
84
|
+
setCurrentNode: setCurrentDestinationNode,
|
|
85
|
+
selection: destinationSelection,
|
|
86
|
+
setSelection: setDestinationSelection,
|
|
87
|
+
breadcrumbPath: destinationBreadCrumbPath,
|
|
88
|
+
displayedData: destinationDisplayedData,
|
|
89
|
+
onDrilldown: onDestinationDrilldown,
|
|
90
|
+
addNode: addDestinationNode,
|
|
91
|
+
removeNode: removeDestinationNode
|
|
92
|
+
} = useListData(startingDestinationData);
|
|
93
|
+
const onSourceAdd = useCallback(
|
|
94
|
+
(items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),
|
|
95
|
+
[addSourceNode, currentSourceNode]
|
|
96
|
+
);
|
|
97
|
+
const onSourceRemove = useCallback(
|
|
98
|
+
(items) => items.forEach((item) => removeSourceNode(item.id, item)),
|
|
99
|
+
[removeSourceNode]
|
|
100
|
+
);
|
|
101
|
+
const onDestinationAdd = useCallback(
|
|
102
|
+
(items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),
|
|
103
|
+
[addDestinationNode, currentDestinationNode]
|
|
104
|
+
);
|
|
105
|
+
const onDestinationRemove = useCallback(
|
|
106
|
+
(items) => items.forEach((item) => removeDestinationNode(item.id)),
|
|
107
|
+
[removeDestinationNode]
|
|
108
|
+
);
|
|
109
|
+
return {
|
|
110
|
+
setCurrentSourceNode,
|
|
111
|
+
setCurrentDestinationNode,
|
|
112
|
+
sourceDisplayedData,
|
|
113
|
+
destinationDisplayedData,
|
|
114
|
+
sourceSelection,
|
|
115
|
+
destinationSelection,
|
|
116
|
+
setSourceSelection,
|
|
117
|
+
setDestinationSelection,
|
|
118
|
+
onSourceDrilldown,
|
|
119
|
+
onDestinationDrilldown,
|
|
120
|
+
onSourceAdd,
|
|
121
|
+
onSourceRemove,
|
|
122
|
+
onDestinationAdd,
|
|
123
|
+
onDestinationRemove,
|
|
124
|
+
sourceBreadCrumbPath,
|
|
125
|
+
destinationBreadCrumbPath,
|
|
126
|
+
currentSourceNode,
|
|
127
|
+
currentDestinationNode
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
BreadCrumbHoc,
|
|
132
|
+
useShuttle
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=basic.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/basic.js"],
|
|
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-legacy-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-legacy-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,gBAAgB,GAAG,KAAK,IAAI;AAEpD,SACE,oBAAC,gBAAa,SAAO,MAAE,GAAG,MACvB,yBAAe,IAAI,CAAC,SACnB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|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import React2, { useMemo, useState, useCallback } from "react";
|
|
4
|
+
import { DSBreadcrumb } from "@elliemae/ds-legacy-breadcrumb";
|
|
5
|
+
import { useDSTree } from "@elliemae/ds-legacy-tree-model";
|
|
6
|
+
import { uid } from "uid";
|
|
7
|
+
const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
|
|
8
|
+
const node = {
|
|
9
|
+
id: uid(),
|
|
10
|
+
label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
|
|
11
|
+
parent: parent ? parent.id : null
|
|
12
|
+
};
|
|
13
|
+
if (depth <= finalDepth) {
|
|
14
|
+
node.subitems = Array.from(
|
|
15
|
+
{ length: 2 },
|
|
16
|
+
(_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return node;
|
|
20
|
+
};
|
|
21
|
+
const options = {
|
|
22
|
+
getUniqueId: (item) => item.id
|
|
23
|
+
};
|
|
24
|
+
const startingSourceData = genTreeOfData({ prefix: "Source" });
|
|
25
|
+
const startingDestinationData = genTreeOfData({ prefix: "Destination" });
|
|
26
|
+
const matcheslenientStringSearch = (filter, str) => {
|
|
27
|
+
const regexpString = `[\\s\\S]*${filter.replace(/\s/g, "").split("").join("[\\s\\S]*")}[\\s\\S]*`;
|
|
28
|
+
const regexpFilter = new RegExp(regexpString);
|
|
29
|
+
return regexpFilter.test(str);
|
|
30
|
+
};
|
|
31
|
+
const BreadCrumb = (props) => {
|
|
32
|
+
const { breadCrumbPath, setCurrentNode, ...rest } = props;
|
|
33
|
+
return /* @__PURE__ */ jsx(DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ jsx(DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
|
|
34
|
+
};
|
|
35
|
+
const BreadCrumbHoc = ({ path, setCurrentNode }) => {
|
|
36
|
+
const WrappedBreadCrumb = (props) => /* @__PURE__ */ jsx(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
|
|
37
|
+
return WrappedBreadCrumb;
|
|
38
|
+
};
|
|
39
|
+
const useListData = (startingData) => {
|
|
40
|
+
const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);
|
|
41
|
+
const [currentNode, setCurrentNode] = useState(getRoot());
|
|
42
|
+
const [filterValue, setFilterValue] = useState("");
|
|
43
|
+
const [selection, setSelection] = useState({});
|
|
44
|
+
const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
45
|
+
const displayedData = useMemo(
|
|
46
|
+
() => currentNode.children.map((node) => node.getJson()).filter((item) => matcheslenientStringSearch(filterValue, item.label)),
|
|
47
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
[currentNode, hash, filterValue]
|
|
49
|
+
);
|
|
50
|
+
const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
51
|
+
return {
|
|
52
|
+
getNode,
|
|
53
|
+
addNode,
|
|
54
|
+
replaceNode,
|
|
55
|
+
removeNode,
|
|
56
|
+
currentNode,
|
|
57
|
+
setCurrentNode,
|
|
58
|
+
selection,
|
|
59
|
+
setSelection,
|
|
60
|
+
filterValue,
|
|
61
|
+
setFilterValue,
|
|
62
|
+
breadcrumbPath,
|
|
63
|
+
displayedData,
|
|
64
|
+
onDrilldown
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const useShuttle = () => {
|
|
68
|
+
const {
|
|
69
|
+
currentNode: currentSourceNode,
|
|
70
|
+
setCurrentNode: setCurrentSourceNode,
|
|
71
|
+
selection: sourceSelection,
|
|
72
|
+
setSelection: setSourceSelection,
|
|
73
|
+
breadcrumbPath: sourceBreadCrumbPath,
|
|
74
|
+
displayedData: sourceDisplayedData,
|
|
75
|
+
filterValue: sourceFilterValue,
|
|
76
|
+
setFilterValue: setSourceFilterValue,
|
|
77
|
+
onDrilldown: onSourceDrilldown,
|
|
78
|
+
getNode: getSourceNode,
|
|
79
|
+
addNode: addSourceNode,
|
|
80
|
+
removeNode: removeSourceNode
|
|
81
|
+
} = useListData(startingSourceData);
|
|
82
|
+
const {
|
|
83
|
+
currentNode: currentDestinationNode,
|
|
84
|
+
setCurrentNode: setCurrentDestinationNode,
|
|
85
|
+
selection: destinationSelection,
|
|
86
|
+
setSelection: setDestinationSelection,
|
|
87
|
+
breadcrumbPath: destinationBreadCrumbPath,
|
|
88
|
+
displayedData: destinationDisplayedData,
|
|
89
|
+
filterValue: destinationFilterValue,
|
|
90
|
+
setFilterValue: setDestinationFilterValue,
|
|
91
|
+
onDrilldown: onDestinationDrilldown,
|
|
92
|
+
getNode: getDestinationNode,
|
|
93
|
+
addNode: addDestinationNode,
|
|
94
|
+
removeNode: removeDestinationNode
|
|
95
|
+
} = useListData(startingDestinationData);
|
|
96
|
+
const onSourceAdd = useCallback(
|
|
97
|
+
(items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
|
|
98
|
+
[addSourceNode, currentSourceNode, getSourceNode]
|
|
99
|
+
);
|
|
100
|
+
const onSourceRemove = useCallback(
|
|
101
|
+
(items) => items.forEach((item) => removeSourceNode(item.id, item)),
|
|
102
|
+
[removeSourceNode]
|
|
103
|
+
);
|
|
104
|
+
const onDestinationAdd = useCallback(
|
|
105
|
+
(items) => items.forEach(
|
|
106
|
+
(item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
|
|
107
|
+
),
|
|
108
|
+
[addDestinationNode, currentDestinationNode, getDestinationNode]
|
|
109
|
+
);
|
|
110
|
+
const onDestinationRemove = useCallback(
|
|
111
|
+
(items) => items.forEach((item) => removeDestinationNode(item.id)),
|
|
112
|
+
[removeDestinationNode]
|
|
113
|
+
);
|
|
114
|
+
return useMemo(
|
|
115
|
+
() => ({
|
|
116
|
+
setCurrentSourceNode,
|
|
117
|
+
setCurrentDestinationNode,
|
|
118
|
+
sourceDisplayedData,
|
|
119
|
+
destinationDisplayedData,
|
|
120
|
+
sourceSelection,
|
|
121
|
+
destinationSelection,
|
|
122
|
+
setSourceSelection,
|
|
123
|
+
setDestinationSelection,
|
|
124
|
+
sourceFilterValue,
|
|
125
|
+
destinationFilterValue,
|
|
126
|
+
setSourceFilterValue,
|
|
127
|
+
setDestinationFilterValue,
|
|
128
|
+
onSourceDrilldown,
|
|
129
|
+
onDestinationDrilldown,
|
|
130
|
+
onSourceAdd,
|
|
131
|
+
onSourceRemove,
|
|
132
|
+
onDestinationAdd,
|
|
133
|
+
onDestinationRemove,
|
|
134
|
+
sourceBreadCrumbPath,
|
|
135
|
+
destinationBreadCrumbPath,
|
|
136
|
+
currentSourceNode,
|
|
137
|
+
currentDestinationNode
|
|
138
|
+
}),
|
|
139
|
+
[
|
|
140
|
+
setCurrentSourceNode,
|
|
141
|
+
setCurrentDestinationNode,
|
|
142
|
+
sourceDisplayedData,
|
|
143
|
+
destinationDisplayedData,
|
|
144
|
+
sourceSelection,
|
|
145
|
+
destinationSelection,
|
|
146
|
+
setSourceSelection,
|
|
147
|
+
setDestinationSelection,
|
|
148
|
+
sourceFilterValue,
|
|
149
|
+
destinationFilterValue,
|
|
150
|
+
setSourceFilterValue,
|
|
151
|
+
setDestinationFilterValue,
|
|
152
|
+
onSourceDrilldown,
|
|
153
|
+
onDestinationDrilldown,
|
|
154
|
+
onSourceAdd,
|
|
155
|
+
onSourceRemove,
|
|
156
|
+
onDestinationAdd,
|
|
157
|
+
onDestinationRemove,
|
|
158
|
+
sourceBreadCrumbPath,
|
|
159
|
+
destinationBreadCrumbPath,
|
|
160
|
+
currentSourceNode,
|
|
161
|
+
currentDestinationNode
|
|
162
|
+
]
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
export {
|
|
166
|
+
BreadCrumbHoc,
|
|
167
|
+
useShuttle
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/filter.js"],
|
|
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-legacy-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-legacy-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;AAA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