@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,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/tests/configs/basic.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCf;AAjCR,mBAAsD;AACtD,kCAA6B;AAC7B,kCAA0B;AAC1B,iBAAoB;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,QAAI,gBAAI;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,4CAAC,4CAAa,SAAO,MAAE,GAAG,MACvB,yBAAe,IAAI,CAAC,SACnB;AAAA,IAAC,yCA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object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var filter_exports = {};
|
|
30
|
+
__export(filter_exports, {
|
|
31
|
+
BreadCrumbHoc: () => BreadCrumbHoc,
|
|
32
|
+
useShuttle: () => useShuttle
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(filter_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_ds_legacy_breadcrumb = require("@elliemae/ds-legacy-breadcrumb");
|
|
39
|
+
var import_ds_legacy_tree_model = require("@elliemae/ds-legacy-tree-model");
|
|
40
|
+
var import_uid = require("uid");
|
|
41
|
+
const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
|
|
42
|
+
const node = {
|
|
43
|
+
id: (0, import_uid.uid)(),
|
|
44
|
+
label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
|
|
45
|
+
parent: parent ? parent.id : null
|
|
46
|
+
};
|
|
47
|
+
if (depth <= finalDepth) {
|
|
48
|
+
node.subitems = Array.from(
|
|
49
|
+
{ length: 2 },
|
|
50
|
+
(_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return node;
|
|
54
|
+
};
|
|
55
|
+
const options = {
|
|
56
|
+
getUniqueId: (item) => item.id
|
|
57
|
+
};
|
|
58
|
+
const startingSourceData = genTreeOfData({ prefix: "Source" });
|
|
59
|
+
const startingDestinationData = genTreeOfData({ prefix: "Destination" });
|
|
60
|
+
const matcheslenientStringSearch = (filter, str) => {
|
|
61
|
+
const regexpString = `[\\s\\S]*${filter.replace(/\s/g, "").split("").join("[\\s\\S]*")}[\\s\\S]*`;
|
|
62
|
+
const regexpFilter = new RegExp(regexpString);
|
|
63
|
+
return regexpFilter.test(str);
|
|
64
|
+
};
|
|
65
|
+
const BreadCrumb = (props) => {
|
|
66
|
+
const { breadCrumbPath, setCurrentNode, ...rest } = props;
|
|
67
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_breadcrumb.DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_breadcrumb.DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
|
|
68
|
+
};
|
|
69
|
+
const BreadCrumbHoc = ({ path, setCurrentNode }) => {
|
|
70
|
+
const WrappedBreadCrumb = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
|
|
71
|
+
return WrappedBreadCrumb;
|
|
72
|
+
};
|
|
73
|
+
const useListData = (startingData) => {
|
|
74
|
+
const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = (0, import_ds_legacy_tree_model.useDSTree)(startingData, options);
|
|
75
|
+
const [currentNode, setCurrentNode] = (0, import_react.useState)(getRoot());
|
|
76
|
+
const [filterValue, setFilterValue] = (0, import_react.useState)("");
|
|
77
|
+
const [selection, setSelection] = (0, import_react.useState)({});
|
|
78
|
+
const breadcrumbPath = (0, import_react.useMemo)(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
79
|
+
const displayedData = (0, import_react.useMemo)(
|
|
80
|
+
() => currentNode.children.map((node) => node.getJson()).filter((item) => matcheslenientStringSearch(filterValue, item.label)),
|
|
81
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
82
|
+
[currentNode, hash, filterValue]
|
|
83
|
+
);
|
|
84
|
+
const onDrilldown = (0, import_react.useCallback)((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
85
|
+
return {
|
|
86
|
+
getNode,
|
|
87
|
+
addNode,
|
|
88
|
+
replaceNode,
|
|
89
|
+
removeNode,
|
|
90
|
+
currentNode,
|
|
91
|
+
setCurrentNode,
|
|
92
|
+
selection,
|
|
93
|
+
setSelection,
|
|
94
|
+
filterValue,
|
|
95
|
+
setFilterValue,
|
|
96
|
+
breadcrumbPath,
|
|
97
|
+
displayedData,
|
|
98
|
+
onDrilldown
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
const useShuttle = () => {
|
|
102
|
+
const {
|
|
103
|
+
currentNode: currentSourceNode,
|
|
104
|
+
setCurrentNode: setCurrentSourceNode,
|
|
105
|
+
selection: sourceSelection,
|
|
106
|
+
setSelection: setSourceSelection,
|
|
107
|
+
breadcrumbPath: sourceBreadCrumbPath,
|
|
108
|
+
displayedData: sourceDisplayedData,
|
|
109
|
+
filterValue: sourceFilterValue,
|
|
110
|
+
setFilterValue: setSourceFilterValue,
|
|
111
|
+
onDrilldown: onSourceDrilldown,
|
|
112
|
+
getNode: getSourceNode,
|
|
113
|
+
addNode: addSourceNode,
|
|
114
|
+
removeNode: removeSourceNode
|
|
115
|
+
} = useListData(startingSourceData);
|
|
116
|
+
const {
|
|
117
|
+
currentNode: currentDestinationNode,
|
|
118
|
+
setCurrentNode: setCurrentDestinationNode,
|
|
119
|
+
selection: destinationSelection,
|
|
120
|
+
setSelection: setDestinationSelection,
|
|
121
|
+
breadcrumbPath: destinationBreadCrumbPath,
|
|
122
|
+
displayedData: destinationDisplayedData,
|
|
123
|
+
filterValue: destinationFilterValue,
|
|
124
|
+
setFilterValue: setDestinationFilterValue,
|
|
125
|
+
onDrilldown: onDestinationDrilldown,
|
|
126
|
+
getNode: getDestinationNode,
|
|
127
|
+
addNode: addDestinationNode,
|
|
128
|
+
removeNode: removeDestinationNode
|
|
129
|
+
} = useListData(startingDestinationData);
|
|
130
|
+
const onSourceAdd = (0, import_react.useCallback)(
|
|
131
|
+
(items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
|
|
132
|
+
[addSourceNode, currentSourceNode, getSourceNode]
|
|
133
|
+
);
|
|
134
|
+
const onSourceRemove = (0, import_react.useCallback)(
|
|
135
|
+
(items) => items.forEach((item) => removeSourceNode(item.id, item)),
|
|
136
|
+
[removeSourceNode]
|
|
137
|
+
);
|
|
138
|
+
const onDestinationAdd = (0, import_react.useCallback)(
|
|
139
|
+
(items) => items.forEach(
|
|
140
|
+
(item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
|
|
141
|
+
),
|
|
142
|
+
[addDestinationNode, currentDestinationNode, getDestinationNode]
|
|
143
|
+
);
|
|
144
|
+
const onDestinationRemove = (0, import_react.useCallback)(
|
|
145
|
+
(items) => items.forEach((item) => removeDestinationNode(item.id)),
|
|
146
|
+
[removeDestinationNode]
|
|
147
|
+
);
|
|
148
|
+
return (0, import_react.useMemo)(
|
|
149
|
+
() => ({
|
|
150
|
+
setCurrentSourceNode,
|
|
151
|
+
setCurrentDestinationNode,
|
|
152
|
+
sourceDisplayedData,
|
|
153
|
+
destinationDisplayedData,
|
|
154
|
+
sourceSelection,
|
|
155
|
+
destinationSelection,
|
|
156
|
+
setSourceSelection,
|
|
157
|
+
setDestinationSelection,
|
|
158
|
+
sourceFilterValue,
|
|
159
|
+
destinationFilterValue,
|
|
160
|
+
setSourceFilterValue,
|
|
161
|
+
setDestinationFilterValue,
|
|
162
|
+
onSourceDrilldown,
|
|
163
|
+
onDestinationDrilldown,
|
|
164
|
+
onSourceAdd,
|
|
165
|
+
onSourceRemove,
|
|
166
|
+
onDestinationAdd,
|
|
167
|
+
onDestinationRemove,
|
|
168
|
+
sourceBreadCrumbPath,
|
|
169
|
+
destinationBreadCrumbPath,
|
|
170
|
+
currentSourceNode,
|
|
171
|
+
currentDestinationNode
|
|
172
|
+
}),
|
|
173
|
+
[
|
|
174
|
+
setCurrentSourceNode,
|
|
175
|
+
setCurrentDestinationNode,
|
|
176
|
+
sourceDisplayedData,
|
|
177
|
+
destinationDisplayedData,
|
|
178
|
+
sourceSelection,
|
|
179
|
+
destinationSelection,
|
|
180
|
+
setSourceSelection,
|
|
181
|
+
setDestinationSelection,
|
|
182
|
+
sourceFilterValue,
|
|
183
|
+
destinationFilterValue,
|
|
184
|
+
setSourceFilterValue,
|
|
185
|
+
setDestinationFilterValue,
|
|
186
|
+
onSourceDrilldown,
|
|
187
|
+
onDestinationDrilldown,
|
|
188
|
+
onSourceAdd,
|
|
189
|
+
onSourceRemove,
|
|
190
|
+
onDestinationAdd,
|
|
191
|
+
onDestinationRemove,
|
|
192
|
+
sourceBreadCrumbPath,
|
|
193
|
+
destinationBreadCrumbPath,
|
|
194
|
+
currentSourceNode,
|
|
195
|
+
currentDestinationNode
|
|
196
|
+
]
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=filter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/tests/configs/filter.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwCf;AAvCR,mBAAsD;AACtD,kCAA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A;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
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var loadMore_exports = {};
|
|
30
|
+
__export(loadMore_exports, {
|
|
31
|
+
BreadCrumbHoc: () => BreadCrumbHoc,
|
|
32
|
+
useShuttle: () => useShuttle
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(loadMore_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_ds_legacy_breadcrumb = require("@elliemae/ds-legacy-breadcrumb");
|
|
39
|
+
var import_ds_legacy_tree_model = require("@elliemae/ds-legacy-tree-model");
|
|
40
|
+
var import_uid = require("uid");
|
|
41
|
+
const genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {
|
|
42
|
+
const node = {
|
|
43
|
+
id: (0, import_uid.uid)(),
|
|
44
|
+
label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,
|
|
45
|
+
parent: parent ? parent.id : null
|
|
46
|
+
};
|
|
47
|
+
if (depth <= finalDepth) {
|
|
48
|
+
node.subitems = Array.from(
|
|
49
|
+
{ length: 2 },
|
|
50
|
+
(_, i) => genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth })
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return node;
|
|
54
|
+
};
|
|
55
|
+
const options = {
|
|
56
|
+
getUniqueId: (item) => item.id
|
|
57
|
+
};
|
|
58
|
+
const startingSourceData = genTreeOfData({ prefix: "Source" });
|
|
59
|
+
const startingDestinationData = genTreeOfData({ prefix: "Destination" });
|
|
60
|
+
const BreadCrumb = (props) => {
|
|
61
|
+
const { breadCrumbPath, setCurrentNode, ...rest } = props;
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_breadcrumb.DSBreadcrumb, { isTitle: true, ...rest, children: breadCrumbPath.map((node) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_breadcrumb.DSBreadcrumb.Item, { label: node.plainItem.label, onClick: () => setCurrentNode(node) }, `${node.dsId}`)) });
|
|
63
|
+
};
|
|
64
|
+
const BreadCrumbHoc = ({ path, setCurrentNode }) => {
|
|
65
|
+
const WrappedBreadCrumb = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreadCrumb, { ...props, breadCrumbPath: path, setCurrentNode });
|
|
66
|
+
return WrappedBreadCrumb;
|
|
67
|
+
};
|
|
68
|
+
const useListData = (startingData) => {
|
|
69
|
+
const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = (0, import_ds_legacy_tree_model.useDSTree)(startingData, options);
|
|
70
|
+
const [currentNode, setCurrentNode] = (0, import_react.useState)(getRoot());
|
|
71
|
+
const [selection, setSelection] = (0, import_react.useState)({});
|
|
72
|
+
const [isLoadingMore, setIsLoadingMore] = (0, import_react.useState)(false);
|
|
73
|
+
const breadcrumbPath = (0, import_react.useMemo)(() => getPath(currentNode.dsId), [currentNode, getPath]);
|
|
74
|
+
const displayedData = (0, import_react.useMemo)(
|
|
75
|
+
() => currentNode.children.map((node) => node.getJson()),
|
|
76
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77
|
+
[currentNode, hash]
|
|
78
|
+
);
|
|
79
|
+
const onDrilldown = (0, import_react.useCallback)((item) => setCurrentNode(getNode(item.id)), [getNode]);
|
|
80
|
+
const onLoadMore = (0, import_react.useCallback)(() => {
|
|
81
|
+
setIsLoadingMore(true);
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
const newChildren = Array.from(
|
|
84
|
+
{ length: 1 },
|
|
85
|
+
(_, i) => genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i })
|
|
86
|
+
);
|
|
87
|
+
newChildren.forEach((child) => addNode(child, { parent: currentNode }));
|
|
88
|
+
setIsLoadingMore(false);
|
|
89
|
+
}, 1e3);
|
|
90
|
+
}, [addNode, currentNode]);
|
|
91
|
+
return {
|
|
92
|
+
getNode,
|
|
93
|
+
addNode,
|
|
94
|
+
replaceNode,
|
|
95
|
+
removeNode,
|
|
96
|
+
currentNode,
|
|
97
|
+
setCurrentNode,
|
|
98
|
+
selection,
|
|
99
|
+
setSelection,
|
|
100
|
+
isLoadingMore,
|
|
101
|
+
onLoadMore,
|
|
102
|
+
breadcrumbPath,
|
|
103
|
+
displayedData,
|
|
104
|
+
onDrilldown
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
const useShuttle = () => {
|
|
108
|
+
const {
|
|
109
|
+
currentNode: currentSourceNode,
|
|
110
|
+
setCurrentNode: setCurrentSourceNode,
|
|
111
|
+
selection: sourceSelection,
|
|
112
|
+
setSelection: setSourceSelection,
|
|
113
|
+
breadcrumbPath: sourceBreadCrumbPath,
|
|
114
|
+
displayedData: sourceDisplayedData,
|
|
115
|
+
onDrilldown: onSourceDrilldown,
|
|
116
|
+
getNode: getSourceNode,
|
|
117
|
+
addNode: addSourceNode,
|
|
118
|
+
removeNode: removeSourceNode,
|
|
119
|
+
isLoadingMore: isSourceLoadingMore,
|
|
120
|
+
onLoadMore: onLoadMoreSource
|
|
121
|
+
} = useListData(startingSourceData, "S");
|
|
122
|
+
const {
|
|
123
|
+
currentNode: currentDestinationNode,
|
|
124
|
+
setCurrentNode: setCurrentDestinationNode,
|
|
125
|
+
selection: destinationSelection,
|
|
126
|
+
setSelection: setDestinationSelection,
|
|
127
|
+
breadcrumbPath: destinationBreadCrumbPath,
|
|
128
|
+
displayedData: destinationDisplayedData,
|
|
129
|
+
onDrilldown: onDestinationDrilldown,
|
|
130
|
+
getNode: getDestinationNode,
|
|
131
|
+
addNode: addDestinationNode,
|
|
132
|
+
removeNode: removeDestinationNode,
|
|
133
|
+
isLoadingMore: isDestinationLoadingMore,
|
|
134
|
+
onLoadMore: onLoadMoreDestination
|
|
135
|
+
} = useListData(startingDestinationData, "D");
|
|
136
|
+
const onSourceAdd = (0, import_react.useCallback)(
|
|
137
|
+
(items) => items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),
|
|
138
|
+
[addSourceNode, currentSourceNode, getSourceNode]
|
|
139
|
+
);
|
|
140
|
+
const onSourceRemove = (0, import_react.useCallback)(
|
|
141
|
+
(items) => items.forEach((item) => removeSourceNode(item.id, item)),
|
|
142
|
+
[removeSourceNode]
|
|
143
|
+
);
|
|
144
|
+
const onDestinationAdd = (0, import_react.useCallback)(
|
|
145
|
+
(items) => items.forEach(
|
|
146
|
+
(item) => addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode })
|
|
147
|
+
),
|
|
148
|
+
[addDestinationNode, currentDestinationNode, getDestinationNode]
|
|
149
|
+
);
|
|
150
|
+
const onDestinationRemove = (0, import_react.useCallback)(
|
|
151
|
+
(items) => items.forEach((item) => removeDestinationNode(item.id)),
|
|
152
|
+
[removeDestinationNode]
|
|
153
|
+
);
|
|
154
|
+
return {
|
|
155
|
+
setCurrentSourceNode,
|
|
156
|
+
setCurrentDestinationNode,
|
|
157
|
+
sourceDisplayedData,
|
|
158
|
+
destinationDisplayedData,
|
|
159
|
+
sourceSelection,
|
|
160
|
+
destinationSelection,
|
|
161
|
+
setSourceSelection,
|
|
162
|
+
setDestinationSelection,
|
|
163
|
+
onSourceDrilldown,
|
|
164
|
+
onDestinationDrilldown,
|
|
165
|
+
onSourceAdd,
|
|
166
|
+
onSourceRemove,
|
|
167
|
+
onDestinationAdd,
|
|
168
|
+
onDestinationRemove,
|
|
169
|
+
sourceBreadCrumbPath,
|
|
170
|
+
destinationBreadCrumbPath,
|
|
171
|
+
isSourceLoadingMore,
|
|
172
|
+
onLoadMoreSource,
|
|
173
|
+
isDestinationLoadingMore,
|
|
174
|
+
onLoadMoreDestination,
|
|
175
|
+
currentSourceNode,
|
|
176
|
+
currentDestinationNode
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=loadMore.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/tests/configs/loadMore.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* 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 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", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkCf;AAjCR,mBAAsD;AACtD,kCAA6B;AAC7B,kCAA0B;AAC1B,iBAAoB;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,QAAI,gBAAI;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,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Ac,KAAK,MAAM,KAAK,kBAAkB,CAAC,CAAC;AAAA,IAC1G,CAAC,eAAe,mBAAmB,aAAa;AAAA,EAClD;AAEA,QAAM,qBAAiB;AAAA,IACrB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,iBAAiB,KAAK,IAAI,IAAI,CAAC;AAAA,IAClE,CAAC,gBAAgB;AAAA,EACnB;AAEA,QAAM,uBAAmB;AAAA,IACvB,CAAC,UACC,MAAM;AAAA,MAAQ,CAAC,SACb,mBAAmB,MAAM,EAAE,QAAQ,mBAAmB,KAAK,MAAM,KAAK,uBAAuB,CAAC;AAAA,IAChG;AAAA,IACF,CAAC,oBAAoB,wBAAwB,kBAAkB;AAAA,EACjE;AAEA,QAAM,0BAAsB;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,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { describe } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
import { withZustand } from "@elliemae/ds-legacy-zustand-helpers";
|
|
4
|
+
import { MainContent } from "./parts/MainContent.js";
|
|
5
|
+
import { config } from "./config/useStore/index.js";
|
|
6
|
+
import { DSShuttleV2PropTypesSchema } from "./react-desc-prop-types.js";
|
|
7
|
+
const DSShuttleV2 = withZustand(MainContent, config);
|
|
8
|
+
DSShuttleV2.propTypes = DSShuttleV2PropTypesSchema;
|
|
9
|
+
DSShuttleV2.displayName = "DSShuttleV2";
|
|
10
|
+
const DSShuttleV2WithSchema = describe(DSShuttleV2);
|
|
11
|
+
DSShuttleV2WithSchema.propTypes = DSShuttleV2PropTypesSchema;
|
|
12
|
+
export {
|
|
13
|
+
DSShuttleV2,
|
|
14
|
+
DSShuttleV2WithSchema
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=DSShuttleV2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSShuttleV2.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from '@elliemae/ds-legacy-props-helpers';\nimport { withZustand } from '@elliemae/ds-legacy-zustand-helpers';\nimport { MainContent } from './parts/MainContent.js';\nimport { config } from './config/useStore/index.js';\nimport { DSShuttleV2PropTypesSchema } from './react-desc-prop-types.js';\n\nconst DSShuttleV2 = withZustand(MainContent, config);\n\nDSShuttleV2.propTypes = DSShuttleV2PropTypesSchema;\nDSShuttleV2.displayName = 'DSShuttleV2';\nconst DSShuttleV2WithSchema = describe(DSShuttleV2);\n\nDSShuttleV2WithSchema.propTypes = DSShuttleV2PropTypesSchema;\n\nexport { DSShuttleV2, DSShuttleV2WithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB,SAAS,kCAAkC;AAE3C,MAAM,cAAc,YAAY,aAAa,MAAM;AAEnD,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAElD,sBAAsB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-legacy-system";
|
|
3
|
+
const DSShuttleV2Name = "DSShuttleV2";
|
|
4
|
+
const DSShuttleV2Slots = {
|
|
5
|
+
HEADER_SEARCH_ICON: "header-search-icon",
|
|
6
|
+
WRAPPER: "wrapper",
|
|
7
|
+
PANEL_WRAPPER: "panel-wrapper",
|
|
8
|
+
LIST_WRAPPER: "list-wrapper",
|
|
9
|
+
ITEM_WRAPPER: "item-wrapper",
|
|
10
|
+
ITEM_CHECKBOX: "item-checkbox",
|
|
11
|
+
ITEM_ICON_WRAPPER: "item-icon-wrapper",
|
|
12
|
+
ITEM_LABEL_WRAPPER: "item-label-wrapper",
|
|
13
|
+
ITEM_MIDSECTION_WRAPPER: "item-midsection-wrapper",
|
|
14
|
+
ITEM_SELECTION: "item-selection",
|
|
15
|
+
ITEM_ACTIONS_WRAPPER: "item-actions-wrapper",
|
|
16
|
+
ITEM_ACTION_WRAPPER: "item-action-wrapper",
|
|
17
|
+
ITEM_ACTION_BTN: "item-action-btn",
|
|
18
|
+
ITEM_ACTION_BTN_DRILLDOWN_ICON: "item-action-btn-drilldown-icon",
|
|
19
|
+
ITEM_ACTION_BTN_TO_SOURCE_ICON: "item-action-btn-to-source-icon",
|
|
20
|
+
ITEM_ACTION_BTN_TO_DESTINATION_ICON: "item-action-btn-to-destination-icon",
|
|
21
|
+
LIST_BOTTOM_LOADING_MORE: "list-bottom-loading-more",
|
|
22
|
+
LIST_BOTTOM_LOAD_MORE_BTN: "list-bottom-load-more-btn",
|
|
23
|
+
LIST_WRAPPER_BOTTOM: "list-wrapper-bottom",
|
|
24
|
+
EMPTY_LIST_WRAPPER: "empty-list-wrapper",
|
|
25
|
+
ITEMS_WRAPPER: "items-wrapper",
|
|
26
|
+
LOADING_LIST_WRAPPER: "loading-list-wrapper",
|
|
27
|
+
MOVE_MULTIPLE_WRAPPER: "move-multiple-wrapper",
|
|
28
|
+
MOVE_MULTIPLE_BTN: "move-multiple-btn",
|
|
29
|
+
LIST_WRAPPER_MID: "list-wrapper-mid",
|
|
30
|
+
LIST_WRAPPER_MID_SCROLLER: "list-wrapper-mid-scroller",
|
|
31
|
+
LIST_WRAPPER_TOP: "list-wrapper-top",
|
|
32
|
+
AREA_SEARCH_WRAPPER: "area-search-wrapper",
|
|
33
|
+
AREA_SEARCH_BAR: "area-search-bar",
|
|
34
|
+
AREA_SELECTION_HEADER: "area-selection-header",
|
|
35
|
+
AREA_SELECTION_HEADER_COUNT_LABEL: "area-selection-header-count-label",
|
|
36
|
+
DRAG_AND_DROP_HANDLE: "drag-and-drop-handle"
|
|
37
|
+
};
|
|
38
|
+
const DSShuttleV2DataTestIds = slotObjectToDataTestIds(DSShuttleV2Name, DSShuttleV2Slots);
|
|
39
|
+
export {
|
|
40
|
+
DSShuttleV2DataTestIds,
|
|
41
|
+
DSShuttleV2Name,
|
|
42
|
+
DSShuttleV2Slots
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=DSShuttleV2Definitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/DSShuttleV2Definitions.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-legacy-system';\n\nexport const DSShuttleV2Name = 'DSShuttleV2' as const;\n\nexport const DSShuttleV2Slots = {\n HEADER_SEARCH_ICON: 'header-search-icon',\n WRAPPER: 'wrapper',\n PANEL_WRAPPER: 'panel-wrapper',\n LIST_WRAPPER: 'list-wrapper',\n ITEM_WRAPPER: 'item-wrapper',\n ITEM_CHECKBOX: 'item-checkbox',\n ITEM_ICON_WRAPPER: 'item-icon-wrapper',\n ITEM_LABEL_WRAPPER: 'item-label-wrapper',\n ITEM_MIDSECTION_WRAPPER: 'item-midsection-wrapper',\n ITEM_SELECTION: 'item-selection',\n ITEM_ACTIONS_WRAPPER: 'item-actions-wrapper',\n ITEM_ACTION_WRAPPER: 'item-action-wrapper',\n ITEM_ACTION_BTN: 'item-action-btn',\n ITEM_ACTION_BTN_DRILLDOWN_ICON: 'item-action-btn-drilldown-icon',\n ITEM_ACTION_BTN_TO_SOURCE_ICON: 'item-action-btn-to-source-icon',\n ITEM_ACTION_BTN_TO_DESTINATION_ICON: 'item-action-btn-to-destination-icon',\n LIST_BOTTOM_LOADING_MORE: 'list-bottom-loading-more',\n LIST_BOTTOM_LOAD_MORE_BTN: 'list-bottom-load-more-btn',\n LIST_WRAPPER_BOTTOM: 'list-wrapper-bottom',\n EMPTY_LIST_WRAPPER: 'empty-list-wrapper',\n ITEMS_WRAPPER: 'items-wrapper',\n LOADING_LIST_WRAPPER: 'loading-list-wrapper',\n MOVE_MULTIPLE_WRAPPER: 'move-multiple-wrapper',\n MOVE_MULTIPLE_BTN: 'move-multiple-btn',\n LIST_WRAPPER_MID: 'list-wrapper-mid',\n LIST_WRAPPER_MID_SCROLLER: 'list-wrapper-mid-scroller',\n LIST_WRAPPER_TOP: 'list-wrapper-top',\n AREA_SEARCH_WRAPPER: 'area-search-wrapper',\n AREA_SEARCH_BAR: 'area-search-bar',\n AREA_SELECTION_HEADER: 'area-selection-header',\n AREA_SELECTION_HEADER_COUNT_LABEL: 'area-selection-header-count-label',\n DRAG_AND_DROP_HANDLE: 'drag-and-drop-handle',\n} as const;\n\nexport const DSShuttleV2DataTestIds = slotObjectToDataTestIds(DSShuttleV2Name, DSShuttleV2Slots);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,kBAAkB;AAExB,MAAM,mBAAmB;AAAA,EAC9B,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AAAA,EACd,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,gCAAgC;AAAA,EAChC,gCAAgC;AAAA,EAChC,qCAAqC;AAAA,EACrC,0BAA0B;AAAA,EAC1B,2BAA2B;AAAA,EAC3B,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,2BAA2B;AAAA,EAC3B,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,mCAAmC;AAAA,EACnC,sBAAsB;AACxB;AAEO,MAAM,yBAAyB,wBAAwB,iBAAiB,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { usePropsStore } from "./useStore/index.js";
|
|
4
|
+
const useHandleMoveSelection = ({ isDestinationPanel }) => {
|
|
5
|
+
const currOnRemove = usePropsStore(
|
|
6
|
+
(state) => isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove
|
|
7
|
+
);
|
|
8
|
+
const currSoftDeletedItems = usePropsStore(
|
|
9
|
+
(state) => isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems
|
|
10
|
+
);
|
|
11
|
+
const currOnSoftDelete = usePropsStore(
|
|
12
|
+
(state) => isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete
|
|
13
|
+
);
|
|
14
|
+
const otherSoftDeletedItems = usePropsStore(
|
|
15
|
+
(state) => isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems
|
|
16
|
+
);
|
|
17
|
+
const otherOnSoftDelete = usePropsStore(
|
|
18
|
+
(state) => isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete
|
|
19
|
+
);
|
|
20
|
+
const currSelectionMap = usePropsStore(
|
|
21
|
+
(store) => isDestinationPanel ? store.destinationSelectionArray : store.sourceSelectionArray
|
|
22
|
+
);
|
|
23
|
+
const currOnSelectionChange = usePropsStore(
|
|
24
|
+
(state) => isDestinationPanel ? state.onDestinationSelectionChange : state.onSourceSelectionChange
|
|
25
|
+
);
|
|
26
|
+
const otherPanelOnAdd = usePropsStore((state) => isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd);
|
|
27
|
+
const destinationSelectionArray = usePropsStore((store) => store.destinationSelectionItemArray);
|
|
28
|
+
const sourceSelectionArray = usePropsStore((store) => store.sourceSelectionItemArray);
|
|
29
|
+
const selectedItems = isDestinationPanel ? destinationSelectionArray : sourceSelectionArray;
|
|
30
|
+
const moveSelection = React2.useCallback(
|
|
31
|
+
(event) => {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
currOnRemove(selectedItems, { event });
|
|
35
|
+
otherPanelOnAdd(selectedItems, { event });
|
|
36
|
+
const currSoftDeletedMap = {};
|
|
37
|
+
const otherSoftDeletedMap = {};
|
|
38
|
+
currSelectionMap.forEach((id) => {
|
|
39
|
+
currSoftDeletedMap[id] = true;
|
|
40
|
+
otherSoftDeletedMap[id] = false;
|
|
41
|
+
});
|
|
42
|
+
currOnSoftDelete({ ...currSoftDeletedItems, ...currSoftDeletedMap }, { event });
|
|
43
|
+
otherOnSoftDelete({ ...otherSoftDeletedItems, ...otherSoftDeletedMap }, { event });
|
|
44
|
+
currOnSelectionChange({}, { event });
|
|
45
|
+
},
|
|
46
|
+
[
|
|
47
|
+
currOnRemove,
|
|
48
|
+
selectedItems,
|
|
49
|
+
otherPanelOnAdd,
|
|
50
|
+
currSelectionMap,
|
|
51
|
+
currOnSoftDelete,
|
|
52
|
+
currSoftDeletedItems,
|
|
53
|
+
otherOnSoftDelete,
|
|
54
|
+
otherSoftDeletedItems,
|
|
55
|
+
currOnSelectionChange
|
|
56
|
+
]
|
|
57
|
+
);
|
|
58
|
+
return React2.useMemo(() => ({ moveSelection }), [moveSelection]);
|
|
59
|
+
};
|
|
60
|
+
const useHandleMoveItem = ({ datum, datumInternalMeta, isDestinationPanel }) => {
|
|
61
|
+
const currSoftDeletedItems = usePropsStore(
|
|
62
|
+
(state) => isDestinationPanel ? state.destinationSoftDeletedItems : state.sourceSoftDeletedItems
|
|
63
|
+
);
|
|
64
|
+
const otherSoftDeletedItems = usePropsStore(
|
|
65
|
+
(state) => isDestinationPanel ? state.sourceSoftDeletedItems : state.destinationSoftDeletedItems
|
|
66
|
+
);
|
|
67
|
+
const currOnSoftDelete = usePropsStore(
|
|
68
|
+
(state) => isDestinationPanel ? state.onDestinationSoftDelete : state.onSourceSoftDelete
|
|
69
|
+
);
|
|
70
|
+
const otherOnSoftDelete = usePropsStore(
|
|
71
|
+
(state) => isDestinationPanel ? state.onSourceSoftDelete : state.onDestinationSoftDelete
|
|
72
|
+
);
|
|
73
|
+
const currOnRemove = usePropsStore(
|
|
74
|
+
(state) => isDestinationPanel ? state.onDestinationRemove : state.onSourceRemove
|
|
75
|
+
);
|
|
76
|
+
const otherPanelOnAdd = usePropsStore((state) => isDestinationPanel ? state.onSourceAdd : state.onDestinationAdd);
|
|
77
|
+
const moveItem = React2.useCallback(
|
|
78
|
+
(event) => {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
currOnRemove([datum], { event });
|
|
82
|
+
otherPanelOnAdd([datum], { event });
|
|
83
|
+
currOnSoftDelete({ ...currSoftDeletedItems, [datumInternalMeta.hydratedId]: true }, { event });
|
|
84
|
+
otherOnSoftDelete({ ...otherSoftDeletedItems, [datumInternalMeta.hydratedId]: false }, { event });
|
|
85
|
+
},
|
|
86
|
+
[
|
|
87
|
+
currOnRemove,
|
|
88
|
+
currOnSoftDelete,
|
|
89
|
+
currSoftDeletedItems,
|
|
90
|
+
datum,
|
|
91
|
+
datumInternalMeta.hydratedId,
|
|
92
|
+
otherOnSoftDelete,
|
|
93
|
+
otherPanelOnAdd,
|
|
94
|
+
otherSoftDeletedItems
|
|
95
|
+
]
|
|
96
|
+
);
|
|
97
|
+
return moveItem;
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
useHandleMoveItem,
|
|
101
|
+
useHandleMoveSelection
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=itemMovementHelpers.js.map
|