@elliemae/ds-shuttle-v2 3.16.0-next.11 → 3.16.0-next.13

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.
Files changed (166) hide show
  1. package/dist/cjs/DSShuttleV2.js +4 -0
  2. package/dist/cjs/DSShuttleV2.js.map +1 -1
  3. package/dist/cjs/config/DSShuttleV2Definitions.js +4 -0
  4. package/dist/cjs/config/DSShuttleV2Definitions.js.map +1 -1
  5. package/dist/cjs/config/itemMovementHelpers.js +4 -0
  6. package/dist/cjs/config/itemMovementHelpers.js.map +1 -1
  7. package/dist/cjs/config/useAutoCalculated/index.js +4 -0
  8. package/dist/cjs/config/useAutoCalculated/index.js.map +1 -1
  9. package/dist/cjs/config/useAutoCalculated/useDataStructure.js +4 -0
  10. package/dist/cjs/config/useAutoCalculated/useDataStructure.js.map +1 -1
  11. package/dist/cjs/config/useAutoCalculated/useShuttleVirtualized.js +4 -0
  12. package/dist/cjs/config/useAutoCalculated/useShuttleVirtualized.js.map +1 -1
  13. package/dist/cjs/config/useFocusTracker/index.js +4 -0
  14. package/dist/cjs/config/useFocusTracker/index.js.map +1 -1
  15. package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js +4 -0
  16. package/dist/cjs/config/useFocusTracker/useFocusActionTrackers.js.map +1 -1
  17. package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js +4 -0
  18. package/dist/cjs/config/useFocusTracker/useFocusItemTracker.js.map +1 -1
  19. package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js +4 -0
  20. package/dist/cjs/config/useFocusTracker/useFocusRegionTrackers.js.map +1 -1
  21. package/dist/cjs/config/useFocusTracker/useFocusTracker.js +4 -0
  22. package/dist/cjs/config/useFocusTracker/useFocusTracker.js.map +1 -1
  23. package/dist/cjs/config/useStore/focusAndTabIndexManager.js +7 -3
  24. package/dist/cjs/config/useStore/focusAndTabIndexManager.js.map +2 -2
  25. package/dist/cjs/config/useStore/index.js +4 -0
  26. package/dist/cjs/config/useStore/index.js.map +1 -1
  27. package/dist/cjs/config/useStore/useStore.js +5 -1
  28. package/dist/cjs/config/useStore/useStore.js.map +2 -2
  29. package/dist/cjs/config/useValidateProps.js +4 -0
  30. package/dist/cjs/config/useValidateProps.js.map +1 -1
  31. package/dist/cjs/constants/index.js +4 -0
  32. package/dist/cjs/constants/index.js.map +1 -1
  33. package/dist/cjs/exported-related/ShuttleItem.js +60 -0
  34. package/dist/cjs/exported-related/ShuttleItem.js.map +7 -0
  35. package/dist/cjs/exported-related/index.js +36 -0
  36. package/dist/cjs/exported-related/index.js.map +7 -0
  37. package/dist/cjs/index.js +7 -1
  38. package/dist/cjs/index.js.map +2 -2
  39. package/dist/cjs/parts/Dnd/DndHandle.js +4 -0
  40. package/dist/cjs/parts/Dnd/DndHandle.js.map +1 -1
  41. package/dist/cjs/parts/Dnd/DragOverlay.js +4 -0
  42. package/dist/cjs/parts/Dnd/DragOverlay.js.map +1 -1
  43. package/dist/cjs/parts/Dnd/DropIndicator.js +4 -0
  44. package/dist/cjs/parts/Dnd/DropIndicator.js.map +1 -1
  45. package/dist/cjs/parts/Header.js +4 -0
  46. package/dist/cjs/parts/Header.js.map +1 -1
  47. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +5 -0
  48. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +1 -1
  49. package/dist/cjs/parts/HoC/withConditionalUseSortable.js +4 -0
  50. package/dist/cjs/parts/HoC/withConditionalUseSortable.js.map +1 -1
  51. package/dist/cjs/parts/Item/Item.js +28 -18
  52. package/dist/cjs/parts/Item/Item.js.map +2 -2
  53. package/dist/cjs/parts/Item/ItemActions/ItemActions.js +11 -4
  54. package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +1 -1
  55. package/dist/cjs/parts/Item/ItemActions/index.js +4 -0
  56. package/dist/cjs/parts/Item/ItemActions/index.js.map +1 -1
  57. package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js +4 -0
  58. package/dist/cjs/parts/Item/ItemActions/useActionsHandlers.js.map +1 -1
  59. package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js +4 -0
  60. package/dist/cjs/parts/Item/ItemActions/useActionsLogicHandlers.js.map +1 -1
  61. package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js +4 -0
  62. package/dist/cjs/parts/Item/ItemActions/useInnerRefHandlers.js.map +1 -1
  63. package/dist/cjs/parts/Item/ItemMiddleSection.js +48 -28
  64. package/dist/cjs/parts/Item/ItemMiddleSection.js.map +2 -2
  65. package/dist/cjs/parts/Item/ItemOverlay.js +4 -0
  66. package/dist/cjs/parts/Item/ItemOverlay.js.map +1 -1
  67. package/dist/cjs/parts/Item/ItemSelection.js +4 -0
  68. package/dist/cjs/parts/Item/ItemSelection.js.map +1 -1
  69. package/dist/cjs/parts/Item/TextSection.js +4 -0
  70. package/dist/cjs/parts/Item/TextSection.js.map +1 -1
  71. package/dist/cjs/parts/Item/useItemArrowNavigation.js +4 -0
  72. package/dist/cjs/parts/Item/useItemArrowNavigation.js.map +1 -1
  73. package/dist/cjs/parts/Item/useItemKeyboardSelection.js +4 -0
  74. package/dist/cjs/parts/Item/useItemKeyboardSelection.js.map +1 -1
  75. package/dist/cjs/parts/Item/useSelectionLogic.js +4 -0
  76. package/dist/cjs/parts/Item/useSelectionLogic.js.map +1 -1
  77. package/dist/cjs/parts/Item/useThisItemIsFocused.js +47 -0
  78. package/dist/cjs/parts/Item/useThisItemIsFocused.js.map +7 -0
  79. package/dist/cjs/parts/MainContent.js +4 -0
  80. package/dist/cjs/parts/MainContent.js.map +1 -1
  81. package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +4 -0
  82. package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +1 -1
  83. package/dist/cjs/parts/Panel/bottom/LoadingMore.js +4 -0
  84. package/dist/cjs/parts/Panel/bottom/LoadingMore.js.map +1 -1
  85. package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js +4 -0
  86. package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js.map +1 -1
  87. package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js +4 -0
  88. package/dist/cjs/parts/Panel/bottom/useInnerRefHandlers.js.map +1 -1
  89. package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js +4 -0
  90. package/dist/cjs/parts/Panel/bottom/useLoadMoreBtnArrowNavigation.js.map +1 -1
  91. package/dist/cjs/parts/Panel/middle/EmptyItems.js +4 -0
  92. package/dist/cjs/parts/Panel/middle/EmptyItems.js.map +1 -1
  93. package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +4 -0
  94. package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +1 -1
  95. package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js +4 -0
  96. package/dist/cjs/parts/Panel/middle/ItemListWrapper/getDatumFlags.js.map +1 -1
  97. package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js +4 -0
  98. package/dist/cjs/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +1 -1
  99. package/dist/cjs/parts/Panel/middle/LoadingItems.js +4 -0
  100. package/dist/cjs/parts/Panel/middle/LoadingItems.js.map +1 -1
  101. package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +16 -0
  102. package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
  103. package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +4 -0
  104. package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +1 -1
  105. package/dist/cjs/parts/Panel/top/PanelContentTopSection.js +4 -0
  106. package/dist/cjs/parts/Panel/top/PanelContentTopSection.js.map +1 -1
  107. package/dist/cjs/parts/Panel/top/PanelFilterSection.js +4 -0
  108. package/dist/cjs/parts/Panel/top/PanelFilterSection.js.map +1 -1
  109. package/dist/cjs/parts/Panel/top/SelectionHeader.js +4 -0
  110. package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +1 -1
  111. package/dist/cjs/parts/PanelWrapper.js +4 -0
  112. package/dist/cjs/parts/PanelWrapper.js.map +1 -1
  113. package/dist/cjs/react-desc-prop-types.js +54 -50
  114. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  115. package/dist/cjs/tests/configs/basic.js +5 -0
  116. package/dist/cjs/tests/configs/basic.js.map +1 -1
  117. package/dist/cjs/tests/configs/filter.js +5 -0
  118. package/dist/cjs/tests/configs/filter.js.map +1 -1
  119. package/dist/cjs/tests/configs/loadMore.js +5 -0
  120. package/dist/cjs/tests/configs/loadMore.js.map +1 -1
  121. package/dist/esm/config/itemMovementHelpers.js.map +1 -1
  122. package/dist/esm/config/useAutoCalculated/useDataStructure.js.map +1 -1
  123. package/dist/esm/config/useFocusTracker/useFocusItemTracker.js.map +1 -1
  124. package/dist/esm/config/useStore/focusAndTabIndexManager.js +3 -3
  125. package/dist/esm/config/useStore/focusAndTabIndexManager.js.map +2 -2
  126. package/dist/esm/config/useStore/useStore.js +1 -1
  127. package/dist/esm/config/useStore/useStore.js.map +2 -2
  128. package/dist/esm/exported-related/ShuttleItem.js +30 -0
  129. package/dist/esm/exported-related/ShuttleItem.js.map +7 -0
  130. package/dist/esm/exported-related/index.js +6 -0
  131. package/dist/esm/exported-related/index.js.map +7 -0
  132. package/dist/esm/index.js +3 -1
  133. package/dist/esm/index.js.map +2 -2
  134. package/dist/esm/parts/Dnd/DropIndicator.js.map +1 -1
  135. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +1 -0
  136. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +1 -1
  137. package/dist/esm/parts/Item/Item.js +24 -18
  138. package/dist/esm/parts/Item/Item.js.map +2 -2
  139. package/dist/esm/parts/Item/ItemActions/ItemActions.js +7 -4
  140. package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +1 -1
  141. package/dist/esm/parts/Item/ItemMiddleSection.js +44 -28
  142. package/dist/esm/parts/Item/ItemMiddleSection.js.map +2 -2
  143. package/dist/esm/parts/Item/ItemSelection.js.map +1 -1
  144. package/dist/esm/parts/Item/useSelectionLogic.js.map +1 -1
  145. package/dist/esm/parts/Item/useThisItemIsFocused.js +17 -0
  146. package/dist/esm/parts/Item/useThisItemIsFocused.js.map +7 -0
  147. package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +1 -1
  148. package/dist/esm/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.js.map +1 -1
  149. package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +12 -0
  150. package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
  151. package/dist/esm/parts/Panel/top/SelectionHeader.js.map +1 -1
  152. package/dist/esm/react-desc-prop-types.js +1 -1
  153. package/dist/esm/react-desc-prop-types.js.map +2 -2
  154. package/dist/esm/tests/configs/basic.js +1 -0
  155. package/dist/esm/tests/configs/basic.js.map +1 -1
  156. package/dist/esm/tests/configs/filter.js +1 -0
  157. package/dist/esm/tests/configs/filter.js.map +1 -1
  158. package/dist/esm/tests/configs/loadMore.js +1 -0
  159. package/dist/esm/tests/configs/loadMore.js.map +1 -1
  160. package/dist/types/exported-related/ShuttleItem.d.ts +8 -0
  161. package/dist/types/exported-related/index.d.ts +1 -0
  162. package/dist/types/index.d.ts +1 -0
  163. package/dist/types/parts/Item/ItemMiddleSection.d.ts +3 -1
  164. package/dist/types/parts/Item/useThisItemIsFocused.d.ts +4 -0
  165. package/dist/types/react-desc-prop-types.d.ts +190 -0
  166. package/package.json +19 -18
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type {} from '@elliemae/ds-utilities';\nimport type { GlobalAttributesT, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type useSortable, type DnDKitTree } from '@elliemae/ds-drag-and-drop';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\n\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from './constants/index.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated/index.js';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection: boolean };\n type HydratedId = string;\n\n export type DatumInternalMeta = {\n isFirst: boolean;\n isLast: boolean;\n isSelected: boolean;\n softDeleted: boolean;\n localIndex: number;\n hydratedId: HydratedId;\n hydratedPreventMove: boolean;\n };\n export type DatumRenderFlags = {\n selectionPrevented: boolean;\n withActions: boolean;\n withMoveBtn: boolean;\n withDrilldownBtn: boolean;\n internallyDisabledMove: boolean;\n internallyDisabledDrilldown: boolean;\n };\n\n // =============================================================================\n // Hydratables section\n // Component-less\n // =============================================================================\n export type PrimaryKeyHydratables = {\n id: HydratedId;\n };\n type FunctionalHydratables = {\n preventMove?: boolean;\n };\n type RequiredDatumHydratablesWithoutComponents = {\n label: string;\n };\n type OptionalDatumHydratablesWithoutComponents = {\n subtitle?: string;\n preventDrilldown?: boolean;\n };\n type DatumHydratablesWithoutComponents = PrimaryKeyHydratables &\n FunctionalHydratables &\n RequiredDatumHydratablesWithoutComponents &\n OptionalDatumHydratablesWithoutComponents;\n // =============================================================================\n // Hydratables section\n // Component-only\n // =============================================================================\n export type ComponentProps = {\n datum: Datum;\n panelMetaInfo: PanelMetaInfo;\n datumInternalMeta: DatumInternalMeta;\n datumHydratables: DatumHydratablesWithoutComponents;\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n type RequiredDatumHydratablesComponents = {};\n type OptionalDatumHydratablesComponents = {\n Icon?: React.ComponentType<ComponentProps>;\n CustomRenderer?: React.ComponentType<ComponentProps>;\n };\n // =============================================================================\n // Hydratables section\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = RequiredDatumHydratables & OptionalDatumHydratables;\n\n // =============================================================================\n // Hydraters\n // =============================================================================\n export type PrimaryKeyHydraters = Hydraters<PrimaryKeyHydratables, [Datum]>;\n export type FunctionalHydraters = Hydraters<FunctionalHydratables, [Datum]>;\n type HydratersMeta = { datumMeta: DatumInternalMeta; panelMetaInfo: PanelMetaInfo };\n type RequiredDatumHydraters = Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;\n type OptionalDatumHydraters = Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;\n\n type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;\n\n // =============================================================================\n // Datum & Internals structures\n // =============================================================================\n export type ConfiguredDatum = DatumInternalMeta & { original: Datum };\n export interface ItemMeta extends PanelMetaInfo {\n datum: Datum;\n datumHydratables: DatumHydratables;\n datumInternalMeta: DatumInternalMeta;\n datumRenderFlags: DatumRenderFlags;\n withDragNDrop: boolean;\n useSortableHelpers?: ReturnType<typeof useSortable>;\n }\n\n // =============================================================================\n // Callbacks\n // =============================================================================\n type OnDataChange = (\n newData: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n item?: Datum;\n selectedItems?: Datum[];\n },\n ) => void;\n\n type OnChangeEvent = (\n items: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n },\n ) => void;\n\n type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;\n type OnReorderEvent = (movedItem: Datum, metadata: OnReorderEventMetadata) => void;\n\n export type SelectionMap = Record<string, boolean>;\n type OnSelectionChange = (\n newSelection: SelectionMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n type OnSelectionDrilldown = (\n item: Datum,\n metainfo: { event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement> },\n ) => void;\n\n type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;\n type OnFilterChange = (\n newfilter: string | null,\n metainfo: { event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement> },\n ) => void;\n type OnSearchbarOpen = (\n newfilter: boolean,\n metainfo: { event: Parameters<Required<DSButtonT.Props>['onClick']>[0] },\n ) => void;\n\n export type SoftDeletedMap = Record<string, boolean>;\n type OnSoftDeletedChange = (\n newSoftDeleted: SoftDeletedMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n // =============================================================================\n // Zustand Store\n // =============================================================================\n export type FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\n export type FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\n export type FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n export type InternalAtoms = {\n focusRegion: FocusRegion;\n focusItem: FocusItem;\n focusItemAction: FocusItemAction;\n shouldFocusItemOnRender: boolean;\n dropIndicatorPosition: number;\n overId: string;\n dndDraggingItem: ConfiguredDatum | null;\n dndDraggingItemMeta: ItemMeta | null;\n lastActiveId: string;\n isDropValid: boolean;\n sourcePanelLastSelectedItem: string | null | undefined;\n destinationPanelLastSelectedItem: string | null | undefined;\n };\n export type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;\n export type Selectors = {\n getIsDragAndDropHappening: () => boolean;\n getPanelLastSelectedItem: (isDestinationPanel: boolean) => string | null | undefined;\n };\n export type Reducers = Record<string, never>;\n export type ShuttleInternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;\n // =============================================================================\n // Final Props\n // =============================================================================\n export interface RequiredProps extends RequiredDatumHydraters, PrimaryKeyHydraters {\n sourceData: Datum[];\n sourceSelectedItems: SelectionMap;\n onSourceSelectionChange: OnSelectionChange;\n SourceHeader: React.ComponentType<unknown>;\n onSourceDrilldown: OnSelectionDrilldown;\n\n destinationData: Datum[];\n destinationSelectedItems: SelectionMap;\n onDestinationSelectionChange: OnSelectionChange;\n DestinationHeader: React.ComponentType<unknown>;\n onDestinationDrilldown: OnSelectionDrilldown;\n }\n\n export interface DefaultProps extends Required<FunctionalHydraters> {\n // load-more and loaders\n sourceIsLoading: boolean;\n sourceWithLoadMore: boolean;\n sourceIsLoadingMore: boolean;\n onSourceLoadMore: OnLoadMore;\n destinationIsLoading: boolean;\n destinationWithLoadMore: boolean;\n destinationIsLoadingMore: boolean;\n onDestinationLoadMore: OnLoadMore;\n\n // switch side\n onSourceAdd: OnChangeEvent;\n onSourceRemove: OnChangeEvent;\n onDestinationAdd: OnChangeEvent;\n onDestinationRemove: OnChangeEvent;\n\n // dnd\n addDragAndDropFromSource: boolean;\n removeDragAndDropFromDestination: boolean;\n onSourceReorder: OnReorderEvent;\n onDestinationReorder: OnReorderEvent;\n\n // soft delete\n sourceSoftDeletedItems: SoftDeletedMap;\n onSourceSoftDelete: OnSoftDeletedChange;\n destinationSoftDeletedItems: SoftDeletedMap;\n onDestinationSoftDelete: OnSoftDeletedChange;\n }\n\n export interface OptionalProps extends OptionalDatumHydraters {\n sourceItemProps?: Record<string, unknown>;\n destinationItemProps?: Record<string, unknown>;\n\n // filtering\n sourceShowSearchbar?: boolean;\n destinationShowSearchbar?: boolean;\n onSourceOpenSearchbar?: OnSearchbarOpen;\n onDesinationOpenSearchbar?: OnSearchbarOpen;\n\n sourceFilterValue?: string;\n destinationFilterValue?: string;\n onSourceFilterChange?: OnFilterChange;\n onDestinationFilterChange?: OnFilterChange;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSShuttleV2T.DefaultProps = {\n addDragAndDropFromSource: false,\n removeDragAndDropFromDestination: false,\n\n sourceIsLoading: false,\n destinationIsLoading: false,\n sourceWithLoadMore: false,\n destinationWithLoadMore: false,\n sourceIsLoadingMore: false,\n destinationIsLoadingMore: false,\n onSourceLoadMore: () => {},\n onDestinationLoadMore: () => {},\n\n onSourceAdd: () => {},\n onDestinationAdd: () => {},\n onSourceRemove: () => {},\n onDestinationRemove: () => {},\n onSourceReorder: () => {},\n onDestinationReorder: () => {},\n\n sourceSoftDeletedItems: {},\n onSourceSoftDelete: () => {},\n destinationSoftDeletedItems: {},\n onDestinationSoftDelete: () => {},\n\n getPreventMove: () => false,\n};\n\nconst DSShuttleV2PropTypes: DSPropTypesSchema<DSShuttleV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n sourceData: PropTypes.arrayOf(PropTypes.object).description('hello!').isRequired,\n sourceSelectedItems: PropTypes.object.description('hello!').isRequired,\n onSourceSelectionChange: PropTypes.func.description('hello!').isRequired,\n SourceHeader: PropTypes.node.description('hello!').isRequired,\n onSourceDrilldown: PropTypes.func.description('hello!').isRequired,\n\n destinationData: PropTypes.arrayOf(PropTypes.object).description('hello!').isRequired,\n destinationSelectedItems: PropTypes.object.description('hello!').isRequired,\n onDestinationSelectionChange: PropTypes.func.description('hello!').isRequired,\n DestinationHeader: PropTypes.node.description('hello!').isRequired,\n onDestinationDrilldown: PropTypes.func.description('hello!').isRequired,\n\n getId: PropTypes.func.description('hello!').isRequired,\n getLabel: PropTypes.func.description('hello!').isRequired,\n\n sourceIsLoading: PropTypes.bool.description('hello!').defaultValue(false),\n destinationIsLoading: PropTypes.bool.description('hello!').defaultValue(false),\n sourceWithLoadMore: PropTypes.bool.description('hello!').defaultValue(false),\n destinationWithLoadMore: PropTypes.bool.description('hello!').defaultValue(false),\n sourceIsLoadingMore: PropTypes.bool.description('hello!').defaultValue(false),\n destinationIsLoadingMore: PropTypes.bool.description('hello!').defaultValue(false),\n onSourceLoadMore: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationLoadMore: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceAdd: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationAdd: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceRemove: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationRemove: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceReorder: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationReorder: PropTypes.func.description('hello!').defaultValue(() => {}),\n sourceSoftDeletedItems: PropTypes.object.description('hello!').defaultValue({}),\n onSourceSoftDelete: PropTypes.func.description('hello!').defaultValue(() => {}),\n destinationSoftDeletedItems: PropTypes.object.description('hello!').defaultValue({}),\n onDestinationSoftDelete: PropTypes.func.description('hello!').defaultValue(() => {}),\n getPreventMove: PropTypes.func.description('hello!').defaultValue(() => false),\n\n addDragAndDropFromSource: PropTypes.bool.description('hello!').defaultValue(false),\n removeDragAndDropFromDestination: PropTypes.bool.description('hello!').defaultValue(false),\n\n sourceItemProps: PropTypes.object.description('hello!').defaultValue({}),\n destinationItemProps: PropTypes.object.description('hello!').defaultValue({}),\n\n sourceShowSearchbar: PropTypes.bool.description('hello!').defaultValue(false),\n destinationShowSearchbar: PropTypes.bool.description('hello!').defaultValue(false),\n onSourceOpenSearchbar: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDesinationOpenSearchbar: PropTypes.func.description('hello!').defaultValue(() => {}),\n sourceFilterValue: PropTypes.string.description('hello!').defaultValue(''),\n destinationFilterValue: PropTypes.string.description('hello!').defaultValue(''),\n onSourceFilterChange: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationFilterChange: PropTypes.func.description('hello!').defaultValue(() => {}),\n\n getSubtitle: PropTypes.func.description('hello!').defaultValue(() => ''),\n getIcon: PropTypes.func.description('hello!').defaultValue(() => ''),\n getPreventDrilldown: PropTypes.func.description('hello!').defaultValue(() => false),\n\n getCustomRenderer: PropTypes.func.description('hello!').defaultValue(() => undefined),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as WeakValidationMap<DSShuttleV2T.Props>;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,WAAW,2BAA2B,wBAAwB;AA6QhE,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,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AAK;AAAA,EACjF,kCAAkC,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,KAAK;AAAA,EAEzF,iBAAiB,UAAU,OAAO,YAAY,QAAQ,EAAE,aAAa,CAAC,CAAC;AAAA,EACvE,sBAAsB,UAAU,OAAO,YAAY,QAAQ,EAAE,aAAa,CAAC,CAAC;AAAA,EAE5E,qBAAqB,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,KAAK;AAAA,EAC5E,0BAA0B,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,KAAK;AAAA,EACjF,uBAAuB,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACjF,2BAA2B,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EACrF,mBAAmB,UAAU,OAAO,YAAY,QAAQ,EAAE,aAAa,EAAE;AAAA,EACzE,wBAAwB,UAAU,OAAO,YAAY,QAAQ,EAAE,aAAa,EAAE;AAAA,EAC9E,sBAAsB,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAChF,2BAA2B,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM;AAAA,EAAC,CAAC;AAAA,EAErF,aAAa,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM,EAAE;AAAA,EACvE,SAAS,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM,EAAE;AAAA,EACnE,qBAAqB,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM,KAAK;AAAA,EAElF,mBAAmB,UAAU,KAAK,YAAY,QAAQ,EAAE,aAAa,MAAM,MAAS;AACtF;AAEO,MAAM,6BAA6B;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { WeakValidationMap } from 'react';\nimport type React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, useHeadlessTooltip } from '@elliemae/ds-utilities';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { type DSButtonT } from '@elliemae/ds-button-v2';\nimport { type useSortable, type DnDKitTree } from '@elliemae/ds-drag-and-drop';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\n\nimport type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from './constants/index.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated/index.js';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection: boolean };\n type HydratedId = string;\n\n export type DatumInternalMeta = {\n isFirst: boolean;\n isLast: boolean;\n isSelected: boolean;\n softDeleted: boolean;\n localIndex: number;\n hydratedId: HydratedId;\n hydratedPreventMove: boolean;\n };\n export type DatumRenderFlags = {\n selectionPrevented: boolean;\n withActions: boolean;\n withMoveBtn: boolean;\n withDrilldownBtn: boolean;\n internallyDisabledMove: boolean;\n internallyDisabledDrilldown: boolean;\n };\n\n // =============================================================================\n // Hydratables section\n // Component-less\n // =============================================================================\n export type PrimaryKeyHydratables = {\n id: HydratedId;\n };\n type FunctionalHydratables = {\n preventMove?: boolean;\n };\n type RequiredDatumHydratablesWithoutComponents = {\n label: string;\n };\n type OptionalDatumHydratablesWithoutComponents = {\n subtitle?: string;\n preventDrilldown?: boolean;\n };\n type DatumHydratablesWithoutComponents = PrimaryKeyHydratables &\n FunctionalHydratables &\n RequiredDatumHydratablesWithoutComponents &\n OptionalDatumHydratablesWithoutComponents;\n // =============================================================================\n // Hydratables section\n // Component-only\n // =============================================================================\n export type ComponentProps = {\n datum: Datum;\n thisItemIsFocused: boolean;\n panelMetaInfo: PanelMetaInfo;\n datumInternalMeta: DatumInternalMeta;\n datumHydratables: DatumHydratablesWithoutComponents;\n tooltipHelpers: ReturnType<typeof useHeadlessTooltip>;\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n type RequiredDatumHydratablesComponents = {};\n type OptionalDatumHydratablesComponents = {\n Icon?: React.ComponentType<ComponentProps>;\n CustomRenderer?: React.ComponentType<ComponentProps>;\n };\n // =============================================================================\n // Hydratables section\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = RequiredDatumHydratables & OptionalDatumHydratables;\n\n // =============================================================================\n // Hydraters\n // =============================================================================\n export type PrimaryKeyHydraters = Hydraters<PrimaryKeyHydratables, [Datum]>;\n export type FunctionalHydraters = Hydraters<FunctionalHydratables, [Datum]>;\n type HydratersMeta = { datumMeta: DatumInternalMeta; panelMetaInfo: PanelMetaInfo };\n type RequiredDatumHydraters = Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;\n type OptionalDatumHydraters = Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;\n\n type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;\n\n // =============================================================================\n // Datum & Internals structures\n // =============================================================================\n export type ConfiguredDatum = DatumInternalMeta & { original: Datum };\n export interface ItemMeta extends PanelMetaInfo {\n datum: Datum;\n datumHydratables: DatumHydratables;\n datumInternalMeta: DatumInternalMeta;\n datumRenderFlags: DatumRenderFlags;\n withDragNDrop: boolean;\n useSortableHelpers?: ReturnType<typeof useSortable>;\n }\n\n // =============================================================================\n // Callbacks\n // =============================================================================\n type OnDataChange = (\n newData: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n item?: Datum;\n selectedItems?: Datum[];\n },\n ) => void;\n\n type OnChangeEvent = (\n items: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n },\n ) => void;\n\n type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;\n type OnReorderEvent = (movedItem: Datum, metadata: OnReorderEventMetadata) => void;\n\n export type SelectionMap = Record<string, boolean>;\n type OnSelectionChange = (\n newSelection: SelectionMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n type OnSelectionDrilldown = (\n item: Datum,\n metainfo: { event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement> },\n ) => void;\n\n type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;\n type OnFilterChange = (\n newfilter: string | null,\n metainfo: { event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement> },\n ) => void;\n type OnSearchbarOpen = (\n newfilter: boolean,\n metainfo: { event: Parameters<Required<DSButtonT.Props>['onClick']>[0] },\n ) => void;\n\n export type SoftDeletedMap = Record<string, boolean>;\n type OnSoftDeletedChange = (\n newSoftDeleted: SoftDeletedMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n // =============================================================================\n // Zustand Store\n // =============================================================================\n export type FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\n export type FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\n export type FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n export type InternalAtoms = {\n focusRegion: FocusRegion;\n focusItem: FocusItem;\n focusItemAction: FocusItemAction;\n deferFocusUntilFirstRender: boolean;\n dropIndicatorPosition: number;\n overId: string;\n dndDraggingItem: ConfiguredDatum | null;\n dndDraggingItemMeta: ItemMeta | null;\n lastActiveId: string;\n isDropValid: boolean;\n sourcePanelLastSelectedItem: string | null | undefined;\n destinationPanelLastSelectedItem: string | null | undefined;\n };\n export type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;\n export type Selectors = {\n getIsDragAndDropHappening: () => boolean;\n getPanelLastSelectedItem: (isDestinationPanel: boolean) => string | null | undefined;\n };\n export type Reducers = Record<string, never>;\n export type ShuttleInternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;\n // =============================================================================\n // Final Props\n // =============================================================================\n export interface RequiredProps extends RequiredDatumHydraters, PrimaryKeyHydraters {\n sourceData: Datum[];\n sourceSelectedItems: SelectionMap;\n onSourceSelectionChange: OnSelectionChange;\n SourceHeader: React.ComponentType<unknown>;\n onSourceDrilldown: OnSelectionDrilldown;\n\n destinationData: Datum[];\n destinationSelectedItems: SelectionMap;\n onDestinationSelectionChange: OnSelectionChange;\n DestinationHeader: React.ComponentType<unknown>;\n onDestinationDrilldown: OnSelectionDrilldown;\n }\n\n export interface DefaultProps extends Required<FunctionalHydraters> {\n // load-more and loaders\n sourceIsLoading: boolean;\n sourceWithLoadMore: boolean;\n sourceIsLoadingMore: boolean;\n onSourceLoadMore: OnLoadMore;\n destinationIsLoading: boolean;\n destinationWithLoadMore: boolean;\n destinationIsLoadingMore: boolean;\n onDestinationLoadMore: OnLoadMore;\n\n // switch side\n onSourceAdd: OnChangeEvent;\n onSourceRemove: OnChangeEvent;\n onDestinationAdd: OnChangeEvent;\n onDestinationRemove: OnChangeEvent;\n\n // dnd\n addDragAndDropFromSource: boolean;\n removeDragAndDropFromDestination: boolean;\n onSourceReorder: OnReorderEvent;\n onDestinationReorder: OnReorderEvent;\n\n // soft delete\n sourceSoftDeletedItems: SoftDeletedMap;\n onSourceSoftDelete: OnSoftDeletedChange;\n destinationSoftDeletedItems: SoftDeletedMap;\n onDestinationSoftDelete: OnSoftDeletedChange;\n }\n\n export interface OptionalProps extends OptionalDatumHydraters {\n sourceItemProps?: Record<string, unknown>;\n destinationItemProps?: Record<string, unknown>;\n\n // filtering\n sourceShowSearchbar?: boolean;\n destinationShowSearchbar?: boolean;\n onSourceOpenSearchbar?: OnSearchbarOpen;\n onDesinationOpenSearchbar?: OnSearchbarOpen;\n\n sourceFilterValue?: string;\n destinationFilterValue?: string;\n onSourceFilterChange?: OnFilterChange;\n onDestinationFilterChange?: OnFilterChange;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSShuttleV2T.DefaultProps = {\n addDragAndDropFromSource: false,\n removeDragAndDropFromDestination: false,\n\n sourceIsLoading: false,\n destinationIsLoading: false,\n sourceWithLoadMore: false,\n destinationWithLoadMore: false,\n sourceIsLoadingMore: false,\n destinationIsLoadingMore: false,\n onSourceLoadMore: () => {},\n onDestinationLoadMore: () => {},\n\n onSourceAdd: () => {},\n onDestinationAdd: () => {},\n onSourceRemove: () => {},\n onDestinationRemove: () => {},\n onSourceReorder: () => {},\n onDestinationReorder: () => {},\n\n sourceSoftDeletedItems: {},\n onSourceSoftDelete: () => {},\n destinationSoftDeletedItems: {},\n onDestinationSoftDelete: () => {},\n\n getPreventMove: () => false,\n};\n\nconst DSShuttleV2PropTypes: DSPropTypesSchema<DSShuttleV2T.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n sourceData: PropTypes.arrayOf(PropTypes.object).description('hello!').isRequired,\n sourceSelectedItems: PropTypes.object.description('hello!').isRequired,\n onSourceSelectionChange: PropTypes.func.description('hello!').isRequired,\n SourceHeader: PropTypes.node.description('hello!').isRequired,\n onSourceDrilldown: PropTypes.func.description('hello!').isRequired,\n\n destinationData: PropTypes.arrayOf(PropTypes.object).description('hello!').isRequired,\n destinationSelectedItems: PropTypes.object.description('hello!').isRequired,\n onDestinationSelectionChange: PropTypes.func.description('hello!').isRequired,\n DestinationHeader: PropTypes.node.description('hello!').isRequired,\n onDestinationDrilldown: PropTypes.func.description('hello!').isRequired,\n\n getId: PropTypes.func.description('hello!').isRequired,\n getLabel: PropTypes.func.description('hello!').isRequired,\n\n sourceIsLoading: PropTypes.bool.description('hello!').defaultValue(false),\n destinationIsLoading: PropTypes.bool.description('hello!').defaultValue(false),\n sourceWithLoadMore: PropTypes.bool.description('hello!').defaultValue(false),\n destinationWithLoadMore: PropTypes.bool.description('hello!').defaultValue(false),\n sourceIsLoadingMore: PropTypes.bool.description('hello!').defaultValue(false),\n destinationIsLoadingMore: PropTypes.bool.description('hello!').defaultValue(false),\n onSourceLoadMore: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationLoadMore: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceAdd: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationAdd: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceRemove: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationRemove: PropTypes.func.description('hello!').defaultValue(() => {}),\n onSourceReorder: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationReorder: PropTypes.func.description('hello!').defaultValue(() => {}),\n sourceSoftDeletedItems: PropTypes.object.description('hello!').defaultValue({}),\n onSourceSoftDelete: PropTypes.func.description('hello!').defaultValue(() => {}),\n destinationSoftDeletedItems: PropTypes.object.description('hello!').defaultValue({}),\n onDestinationSoftDelete: PropTypes.func.description('hello!').defaultValue(() => {}),\n getPreventMove: PropTypes.func.description('hello!').defaultValue(() => false),\n\n addDragAndDropFromSource: PropTypes.bool.description('hello!').defaultValue(false),\n removeDragAndDropFromDestination: PropTypes.bool.description('hello!').defaultValue(false),\n\n sourceItemProps: PropTypes.object.description('hello!').defaultValue({}),\n destinationItemProps: PropTypes.object.description('hello!').defaultValue({}),\n\n sourceShowSearchbar: PropTypes.bool.description('hello!').defaultValue(false),\n destinationShowSearchbar: PropTypes.bool.description('hello!').defaultValue(false),\n onSourceOpenSearchbar: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDesinationOpenSearchbar: PropTypes.func.description('hello!').defaultValue(() => {}),\n sourceFilterValue: PropTypes.string.description('hello!').defaultValue(''),\n destinationFilterValue: PropTypes.string.description('hello!').defaultValue(''),\n onSourceFilterChange: PropTypes.func.description('hello!').defaultValue(() => {}),\n onDestinationFilterChange: PropTypes.func.description('hello!').defaultValue(() => {}),\n\n getSubtitle: PropTypes.func.description('hello!').defaultValue(() => ''),\n getIcon: PropTypes.func.description('hello!').defaultValue(() => ''),\n getPreventDrilldown: PropTypes.func.description('hello!').defaultValue(() => false),\n\n getCustomRenderer: PropTypes.func.description('hello!').defaultValue(() => undefined),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as WeakValidationMap<DSShuttleV2T.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,WAAW,2BAA2B,wBAAwB;AA+QhE,MAAM,eAA0C;AAAA,EACrD,0BAA0B;AAAA,EAC1B,kCAAkC;AAAA,EAElC,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,kBAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,uBAAuB,MAAM;AAAA,EAAC;AAAA,EAE9B,aAAa,MAAM;AAAA,EAAC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Data = (startingData) => {
46
46
  const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
47
47
  const displayedData = useMemo(
48
48
  () => currentNode.children.map((node) => node.getJson()),
49
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
50
  [currentNode, hash]
50
51
  );
51
52
  const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/basic.js"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item\n key={`${node.dsId}`}\n label={node.plainItem.label}\n onClick={() => setCurrentNode(node)}\n dataTestId=\"amigo\"\n />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return useMemo(\n () => ({\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n\n breadcrumbPath,\n displayedData,\n onDrilldown,\n }),\n [addNode, breadcrumbPath, currentNode, displayedData, getNode, onDrilldown, removeNode, replaceNode, selection],\n );\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) => items.forEach((item) => addSourceNode(item, { parent: currentSourceNode })),\n [addSourceNode, currentSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) => items.forEach((item) => addDestinationNode(item, { parent: currentDestinationNode })),\n [addDestinationNode, currentDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkCf;AAjCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,SAAS,eAAe,GAAG;AAAA,IACrD,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAAQ,EAAE;AAAA,MAAG,CAAC,GAAG,MAC5C,cAAc,EAAE,QAAQ,OAAO,QAAQ,GAAG,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC;AAAA,IACrF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,UAAU;AAAA,EACd,aAAa,CAAC,SAAS,KAAK;AAC9B;AAEA,MAAM,qBAAqB,cAAc,EAAE,QAAQ,SAAS,CAAC;AAC7D,MAAM,0BAA0B,cAAc,EAAE,QAAQ,cAAc,CAAC;AAEvE,MAAM,aAAa,CAAC,UAAU;AAC5B,QAAM,EAAE,gBAAgB,mBAAmB,KAAK,IAAI;AAEp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,cAAc;AAAA,IAClB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,cAAc,MAAM,EAAE,QAAQ,kBAAkB,CAAC,CAAC;AAAA,IACrF,CAAC,eAAe,iBAAiB;AAAA,EACnC;AAEA,QAAM,iBAAiB;AAAA,IACrB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,iBAAiB,KAAK,IAAI,IAAI,CAAC;AAAA,IAClE,CAAC,gBAAgB;AAAA,EACnB;AAEA,QAAM,mBAAmB;AAAA,IACvB,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,mBAAmB,MAAM,EAAE,QAAQ,uBAAuB,CAAC,CAAC;AAAA,IAC/F,CAAC,oBAAoB,sBAAsB;AAAA,EAC7C;AAEA,QAAM,sBAAsB;AAAA,IAC1B,CAAC,UAAU,MAAM,QAAQ,CAAC,SAAS,sBAAsB,KAAK,EAAE,CAAC;AAAA,IACjE,CAAC,qBAAqB;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -44,6 +44,7 @@ const useListData = (startingData) => {
44
44
  const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
45
45
  const displayedData = useMemo(
46
46
  () => currentNode.children.map((node) => node.getJson()).filter((item) => matcheslenientStringSearch(filterValue, item.label)),
47
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47
48
  [currentNode, hash, filterValue]
48
49
  );
49
50
  const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/filter.js"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst matcheslenientStringSearch = (filter, str) => {\n const regexpString = `[\\\\s\\\\S]*${filter.replace(/\\s/g, '').split('').join('[\\\\s\\\\S]*')}[\\\\s\\\\S]*`;\n const regexpFilter = new RegExp(regexpString);\n return regexpFilter.test(str);\n};\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [filterValue, setFilterValue] = useState('');\n\n const [selection, setSelection] = useState({});\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () =>\n currentNode.children\n .map((node) => node.getJson())\n .filter((item) => matcheslenientStringSearch(filterValue, item.label)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash, filterValue],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n filterValue,\n setFilterValue,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n filterValue: sourceFilterValue,\n setFilterValue: setSourceFilterValue,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n } = useListData(startingSourceData);\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n filterValue: destinationFilterValue,\n setFilterValue: setDestinationFilterValue,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n } = useListData(startingDestinationData);\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return useMemo(\n () => ({\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n }),\n [\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n sourceFilterValue,\n destinationFilterValue,\n setSourceFilterValue,\n setDestinationFilterValue,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n\n currentSourceNode,\n currentDestinationNode,\n ],\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACwCf;AAvCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAAE,MAAM;AAC9F,QAAM,OAAO;AAAA,IACX,IAAI,IAAI;AAAA,IACR,OAAO,SAAS,GAAG,OAAO,SAAS,eAAe,GAAG;AAAA,IACrD,QAAQ,SAAS,OAAO,KAAK;AAAA,EAC/B;AAEA,MAAI,SAAS,YAAY;AACvB,SAAK,WAAW,MAAM;AAAA,MAAK,EAAE,QAA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,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -39,6 +39,7 @@ const useListData = (startingData) => {
39
39
  const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);
40
40
  const displayedData = useMemo(
41
41
  () => currentNode.children.map((node) => node.getJson()),
42
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
43
  [currentNode, hash]
43
44
  );
44
45
  const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/configs/loadMore.js"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useMemo, useState, useCallback } from 'react';\nimport { DSBreadcrumb } from '@elliemae/ds-breadcrumb';\nimport { useDSTree } from '@elliemae/ds-tree-model';\nimport { uid } from 'uid';\n\nconst genTreeOfData = ({ prefix, depth = 0, parent = null, childIndex = 0, finalDepth = 2 }) => {\n const node = {\n id: uid(),\n label: parent ? `${parent.label}.${childIndex}` : `${prefix} 0`,\n parent: parent ? parent.id : null,\n };\n\n if (depth <= finalDepth) {\n node.subitems = Array.from({ length: 2 }, (_, i) =>\n genTreeOfData({ prefix, depth: depth + 1, parent: node, childIndex: i, finalDepth }),\n );\n }\n return node;\n};\n\nconst options = {\n getUniqueId: (item) => item.id,\n};\n\nconst startingSourceData = genTreeOfData({ prefix: 'Source' });\nconst startingDestinationData = genTreeOfData({ prefix: 'Destination' });\n\nconst BreadCrumb = (props) => {\n const { breadCrumbPath, setCurrentNode, ...rest } = props;\n\n return (\n <DSBreadcrumb isTitle {...rest}>\n {breadCrumbPath.map((node) => (\n <DSBreadcrumb.Item key={`${node.dsId}`} label={node.plainItem.label} onClick={() => setCurrentNode(node)} />\n ))}\n </DSBreadcrumb>\n );\n};\n\nexport const BreadCrumbHoc = ({ path, setCurrentNode }) => {\n const WrappedBreadCrumb = (props) => <BreadCrumb {...props} breadCrumbPath={path} setCurrentNode={setCurrentNode} />;\n return WrappedBreadCrumb;\n};\n\nconst useListData = (startingData) => {\n const { hash, getRoot, getNode, getPath, addNode, replaceNode, removeNode } = useDSTree(startingData, options);\n const [currentNode, setCurrentNode] = useState(getRoot());\n const [selection, setSelection] = useState({});\n const [isLoadingMore, setIsLoadingMore] = useState(false);\n\n const breadcrumbPath = useMemo(() => getPath(currentNode.dsId), [currentNode, getPath]);\n\n const displayedData = useMemo(\n () => currentNode.children.map((node) => node.getJson()),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [currentNode, hash],\n );\n\n const onDrilldown = useCallback((item) => setCurrentNode(getNode(item.id)), [getNode]);\n\n const onLoadMore = useCallback(() => {\n setIsLoadingMore(true);\n setTimeout(() => {\n const newChildren = Array.from({ length: 1 }, (_, i) =>\n genTreeOfData({ parent: currentNode.plainItem, childIndex: currentNode.children.length + i }),\n );\n newChildren.forEach((child) => addNode(child, { parent: currentNode }));\n setIsLoadingMore(false);\n }, 1000);\n }, [addNode, currentNode]);\n\n return {\n getNode,\n addNode,\n replaceNode,\n removeNode,\n currentNode,\n setCurrentNode,\n selection,\n setSelection,\n isLoadingMore,\n onLoadMore,\n breadcrumbPath,\n displayedData,\n onDrilldown,\n };\n};\n\nexport const useShuttle = () => {\n const {\n currentNode: currentSourceNode,\n setCurrentNode: setCurrentSourceNode,\n selection: sourceSelection,\n setSelection: setSourceSelection,\n breadcrumbPath: sourceBreadCrumbPath,\n displayedData: sourceDisplayedData,\n onDrilldown: onSourceDrilldown,\n getNode: getSourceNode,\n addNode: addSourceNode,\n removeNode: removeSourceNode,\n isLoadingMore: isSourceLoadingMore,\n onLoadMore: onLoadMoreSource,\n } = useListData(startingSourceData, 'S');\n\n const {\n currentNode: currentDestinationNode,\n setCurrentNode: setCurrentDestinationNode,\n selection: destinationSelection,\n setSelection: setDestinationSelection,\n breadcrumbPath: destinationBreadCrumbPath,\n displayedData: destinationDisplayedData,\n onDrilldown: onDestinationDrilldown,\n getNode: getDestinationNode,\n addNode: addDestinationNode,\n removeNode: removeDestinationNode,\n isLoadingMore: isDestinationLoadingMore,\n onLoadMore: onLoadMoreDestination,\n } = useListData(startingDestinationData, 'D');\n\n const onSourceAdd = useCallback(\n (items) =>\n items.forEach((item) => addSourceNode(item, { parent: getSourceNode(item.parent) ?? currentSourceNode })),\n [addSourceNode, currentSourceNode, getSourceNode],\n );\n\n const onSourceRemove = useCallback(\n (items) => items.forEach((item) => removeSourceNode(item.id, item)),\n [removeSourceNode],\n );\n\n const onDestinationAdd = useCallback(\n (items) =>\n items.forEach((item) =>\n addDestinationNode(item, { parent: getDestinationNode(item.parent) ?? currentDestinationNode }),\n ),\n [addDestinationNode, currentDestinationNode, getDestinationNode],\n );\n\n const onDestinationRemove = useCallback(\n (items) => items.forEach((item) => removeDestinationNode(item.id)),\n [removeDestinationNode],\n );\n\n return {\n setCurrentSourceNode,\n setCurrentDestinationNode,\n sourceDisplayedData,\n destinationDisplayedData,\n sourceSelection,\n destinationSelection,\n setSourceSelection,\n setDestinationSelection,\n onSourceDrilldown,\n onDestinationDrilldown,\n onSourceAdd,\n onSourceRemove,\n onDestinationAdd,\n onDestinationRemove,\n sourceBreadCrumbPath,\n destinationBreadCrumbPath,\n isSourceLoadingMore,\n onLoadMoreSource,\n isDestinationLoadingMore,\n onLoadMoreDestination,\n\n currentSourceNode,\n currentDestinationNode,\n };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkCf;AAjCR,OAAOA,UAAS,SAAS,UAAU,mBAAmB;AACtD,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,WAAW;AAEpB,MAAM,gBAAgB,CAAC,EAAE,QAAQ,QAAQ,GAAG,SAAS,MAAM,aAAa,GAAG,aAAa,EAA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ACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": ["React"]
7
7
  }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { DSShuttleV2T } from '../react-desc-prop-types.js';
3
+ export type ShuttleItemProps = React.PropsWithChildren<{
4
+ componentProps: DSShuttleV2T.ComponentProps;
5
+ shouldShowTooltip?: boolean;
6
+ TooltipContent?: React.ComponentType<DSShuttleV2T.ComponentProps>;
7
+ }>;
8
+ export declare const ShuttleItem: React.ComponentType<ShuttleItemProps>;
@@ -0,0 +1 @@
1
+ export { type ShuttleItemProps, ShuttleItem } from './ShuttleItem.js';
@@ -1,2 +1,3 @@
1
1
  export { DSShuttleV2Name, DSShuttleV2Slots, DSShuttleV2DataTestIds } from './config/DSShuttleV2Definitions.js';
2
2
  export { DSShuttleV2 } from './DSShuttleV2.js';
3
+ export { ShuttleItem, type ShuttleItemProps } from './exported-related/index.js';
@@ -1,3 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
3
- export declare const ItemMiddleSection: React.MemoExoticComponent<(itemMeta: DSShuttleV2T.ItemMeta) => JSX.Element>;
3
+ export declare const ItemMiddleSection: React.MemoExoticComponent<(props: DSShuttleV2T.ItemMeta & {
4
+ tooltipHelpers: DSShuttleV2T.ComponentProps['tooltipHelpers'];
5
+ }) => JSX.Element>;
@@ -0,0 +1,4 @@
1
+ import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
2
+ type UseThisItemIsFocused = (itemMeta: DSShuttleV2T.ItemMeta) => boolean;
3
+ export declare const useThisItemIsFocused: UseThisItemIsFocused;
4
+ export {};
@@ -0,0 +1,190 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import type React from 'react';
3
+ import type { GlobalAttributesT, XstyledProps, useHeadlessTooltip } from '@elliemae/ds-utilities';
4
+ import { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';
5
+ import { type DSButtonT } from '@elliemae/ds-button-v2';
6
+ import { type useSortable, type DnDKitTree } from '@elliemae/ds-drag-and-drop';
7
+ import type { ZustandT } from '@elliemae/ds-zustand-helpers';
8
+ import type { REGIONS_FOCUSES, ACTIONS_FOCUSES, ITEMS_FOCUSES } from './constants/index.js';
9
+ import type { useAutoCalculated } from './config/useAutoCalculated/index.js';
10
+ export declare namespace DSShuttleV2T {
11
+ type Datum = Record<string, unknown>;
12
+ type PanelMetaInfo = {
13
+ isDestinationPanel: boolean;
14
+ hasMultipleSelection: boolean;
15
+ };
16
+ type HydratedId = string;
17
+ type DatumInternalMeta = {
18
+ isFirst: boolean;
19
+ isLast: boolean;
20
+ isSelected: boolean;
21
+ softDeleted: boolean;
22
+ localIndex: number;
23
+ hydratedId: HydratedId;
24
+ hydratedPreventMove: boolean;
25
+ };
26
+ type DatumRenderFlags = {
27
+ selectionPrevented: boolean;
28
+ withActions: boolean;
29
+ withMoveBtn: boolean;
30
+ withDrilldownBtn: boolean;
31
+ internallyDisabledMove: boolean;
32
+ internallyDisabledDrilldown: boolean;
33
+ };
34
+ type PrimaryKeyHydratables = {
35
+ id: HydratedId;
36
+ };
37
+ type FunctionalHydratables = {
38
+ preventMove?: boolean;
39
+ };
40
+ type RequiredDatumHydratablesWithoutComponents = {
41
+ label: string;
42
+ };
43
+ type OptionalDatumHydratablesWithoutComponents = {
44
+ subtitle?: string;
45
+ preventDrilldown?: boolean;
46
+ };
47
+ type DatumHydratablesWithoutComponents = PrimaryKeyHydratables & FunctionalHydratables & RequiredDatumHydratablesWithoutComponents & OptionalDatumHydratablesWithoutComponents;
48
+ type ComponentProps = {
49
+ datum: Datum;
50
+ thisItemIsFocused: boolean;
51
+ panelMetaInfo: PanelMetaInfo;
52
+ datumInternalMeta: DatumInternalMeta;
53
+ datumHydratables: DatumHydratablesWithoutComponents;
54
+ tooltipHelpers: ReturnType<typeof useHeadlessTooltip>;
55
+ };
56
+ type RequiredDatumHydratablesComponents = {};
57
+ type OptionalDatumHydratablesComponents = {
58
+ Icon?: React.ComponentType<ComponentProps>;
59
+ CustomRenderer?: React.ComponentType<ComponentProps>;
60
+ };
61
+ type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;
62
+ type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;
63
+ type DatumHydratables = RequiredDatumHydratables & OptionalDatumHydratables;
64
+ type PrimaryKeyHydraters = Hydraters<PrimaryKeyHydratables, [Datum]>;
65
+ type FunctionalHydraters = Hydraters<FunctionalHydratables, [Datum]>;
66
+ type HydratersMeta = {
67
+ datumMeta: DatumInternalMeta;
68
+ panelMetaInfo: PanelMetaInfo;
69
+ };
70
+ type RequiredDatumHydraters = Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;
71
+ type OptionalDatumHydraters = Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;
72
+ type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;
73
+ type ConfiguredDatum = DatumInternalMeta & {
74
+ original: Datum;
75
+ };
76
+ interface ItemMeta extends PanelMetaInfo {
77
+ datum: Datum;
78
+ datumHydratables: DatumHydratables;
79
+ datumInternalMeta: DatumInternalMeta;
80
+ datumRenderFlags: DatumRenderFlags;
81
+ withDragNDrop: boolean;
82
+ useSortableHelpers?: ReturnType<typeof useSortable>;
83
+ }
84
+ type OnDataChange = (newData: Datum[], metainfo: {
85
+ event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;
86
+ item?: Datum;
87
+ selectedItems?: Datum[];
88
+ }) => void;
89
+ type OnChangeEvent = (items: Datum[], metainfo: {
90
+ event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;
91
+ }) => void;
92
+ type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;
93
+ type OnReorderEvent = (movedItem: Datum, metadata: OnReorderEventMetadata) => void;
94
+ type SelectionMap = Record<string, boolean>;
95
+ type OnSelectionChange = (newSelection: SelectionMap, metainfo: {
96
+ event: Parameters<Required<DSButtonT.Props>['onClick']>[0] | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1] | React.MouseEvent<HTMLButtonElement | HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | React.ChangeEvent<HTMLInputElement>;
97
+ item?: Datum;
98
+ }) => void;
99
+ type OnSelectionDrilldown = (item: Datum, metainfo: {
100
+ event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;
101
+ }) => void;
102
+ type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;
103
+ type OnFilterChange = (newfilter: string | null, metainfo: {
104
+ event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>;
105
+ }) => void;
106
+ type OnSearchbarOpen = (newfilter: boolean, metainfo: {
107
+ event: Parameters<Required<DSButtonT.Props>['onClick']>[0];
108
+ }) => void;
109
+ type SoftDeletedMap = Record<string, boolean>;
110
+ type OnSoftDeletedChange = (newSoftDeleted: SoftDeletedMap, metainfo: {
111
+ event: Parameters<Required<DSButtonT.Props>['onClick']>[0] | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1] | React.MouseEvent<HTMLButtonElement | HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | React.ChangeEvent<HTMLInputElement>;
112
+ item?: Datum;
113
+ }) => void;
114
+ type FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];
115
+ type FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;
116
+ type FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];
117
+ type InternalAtoms = {
118
+ focusRegion: FocusRegion;
119
+ focusItem: FocusItem;
120
+ focusItemAction: FocusItemAction;
121
+ deferFocusUntilFirstRender: boolean;
122
+ dropIndicatorPosition: number;
123
+ overId: string;
124
+ dndDraggingItem: ConfiguredDatum | null;
125
+ dndDraggingItemMeta: ItemMeta | null;
126
+ lastActiveId: string;
127
+ isDropValid: boolean;
128
+ sourcePanelLastSelectedItem: string | null | undefined;
129
+ destinationPanelLastSelectedItem: string | null | undefined;
130
+ };
131
+ type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;
132
+ type Selectors = {
133
+ getIsDragAndDropHappening: () => boolean;
134
+ getPanelLastSelectedItem: (isDestinationPanel: boolean) => string | null | undefined;
135
+ };
136
+ type Reducers = Record<string, never>;
137
+ type ShuttleInternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;
138
+ interface RequiredProps extends RequiredDatumHydraters, PrimaryKeyHydraters {
139
+ sourceData: Datum[];
140
+ sourceSelectedItems: SelectionMap;
141
+ onSourceSelectionChange: OnSelectionChange;
142
+ SourceHeader: React.ComponentType<unknown>;
143
+ onSourceDrilldown: OnSelectionDrilldown;
144
+ destinationData: Datum[];
145
+ destinationSelectedItems: SelectionMap;
146
+ onDestinationSelectionChange: OnSelectionChange;
147
+ DestinationHeader: React.ComponentType<unknown>;
148
+ onDestinationDrilldown: OnSelectionDrilldown;
149
+ }
150
+ interface DefaultProps extends Required<FunctionalHydraters> {
151
+ sourceIsLoading: boolean;
152
+ sourceWithLoadMore: boolean;
153
+ sourceIsLoadingMore: boolean;
154
+ onSourceLoadMore: OnLoadMore;
155
+ destinationIsLoading: boolean;
156
+ destinationWithLoadMore: boolean;
157
+ destinationIsLoadingMore: boolean;
158
+ onDestinationLoadMore: OnLoadMore;
159
+ onSourceAdd: OnChangeEvent;
160
+ onSourceRemove: OnChangeEvent;
161
+ onDestinationAdd: OnChangeEvent;
162
+ onDestinationRemove: OnChangeEvent;
163
+ addDragAndDropFromSource: boolean;
164
+ removeDragAndDropFromDestination: boolean;
165
+ onSourceReorder: OnReorderEvent;
166
+ onDestinationReorder: OnReorderEvent;
167
+ sourceSoftDeletedItems: SoftDeletedMap;
168
+ onSourceSoftDelete: OnSoftDeletedChange;
169
+ destinationSoftDeletedItems: SoftDeletedMap;
170
+ onDestinationSoftDelete: OnSoftDeletedChange;
171
+ }
172
+ interface OptionalProps extends OptionalDatumHydraters {
173
+ sourceItemProps?: Record<string, unknown>;
174
+ destinationItemProps?: Record<string, unknown>;
175
+ sourceShowSearchbar?: boolean;
176
+ destinationShowSearchbar?: boolean;
177
+ onSourceOpenSearchbar?: OnSearchbarOpen;
178
+ onDesinationOpenSearchbar?: OnSearchbarOpen;
179
+ sourceFilterValue?: string;
180
+ destinationFilterValue?: string;
181
+ onSourceFilterChange?: OnFilterChange;
182
+ onDestinationFilterChange?: OnFilterChange;
183
+ }
184
+ interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>, XstyledProps, RequiredProps {
185
+ }
186
+ interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>, XstyledProps, RequiredProps {
187
+ }
188
+ }
189
+ export declare const defaultProps: DSShuttleV2T.DefaultProps;
190
+ export declare const DSShuttleV2PropTypesSchema: WeakValidationMap<DSShuttleV2T.Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-shuttle-v2",
3
- "version": "3.16.0-next.11",
3
+ "version": "3.16.0-next.13",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Shuttle v2",
6
6
  "files": [
@@ -37,29 +37,30 @@
37
37
  "dependencies": {
38
38
  "fast-deep-equal": "~3.1.3",
39
39
  "react-virtual": "~2.10.4",
40
- "uid": "~2.0.0",
41
- "@elliemae/ds-button-v2": "3.16.0-next.11",
42
- "@elliemae/ds-circular-progress-indicator": "3.16.0-next.11",
43
- "@elliemae/ds-drag-and-drop": "3.16.0-next.11",
44
- "@elliemae/ds-form-checkbox": "3.16.0-next.11",
45
- "@elliemae/ds-form-input-text": "3.16.0-next.11",
46
- "@elliemae/ds-grid": "3.16.0-next.11",
47
- "@elliemae/ds-indeterminate-progress-indicator": "3.16.0-next.11",
48
- "@elliemae/ds-icons": "3.16.0-next.11",
49
- "@elliemae/ds-props-helpers": "3.16.0-next.11",
50
- "@elliemae/ds-system": "3.16.0-next.11",
51
- "@elliemae/ds-typography": "3.16.0-next.11",
52
- "@elliemae/ds-utilities": "3.16.0-next.11",
53
- "@elliemae/ds-zustand-helpers": "3.16.0-next.11"
40
+ "uid": "~2.0.1",
41
+ "@elliemae/ds-button-v2": "3.16.0-next.13",
42
+ "@elliemae/ds-circular-progress-indicator": "3.16.0-next.13",
43
+ "@elliemae/ds-drag-and-drop": "3.16.0-next.13",
44
+ "@elliemae/ds-form-checkbox": "3.16.0-next.13",
45
+ "@elliemae/ds-form-input-text": "3.16.0-next.13",
46
+ "@elliemae/ds-grid": "3.16.0-next.13",
47
+ "@elliemae/ds-popperjs": "3.16.0-next.13",
48
+ "@elliemae/ds-icons": "3.16.0-next.13",
49
+ "@elliemae/ds-indeterminate-progress-indicator": "3.16.0-next.13",
50
+ "@elliemae/ds-props-helpers": "3.16.0-next.13",
51
+ "@elliemae/ds-system": "3.16.0-next.13",
52
+ "@elliemae/ds-typography": "3.16.0-next.13",
53
+ "@elliemae/ds-utilities": "3.16.0-next.13",
54
+ "@elliemae/ds-zustand-helpers": "3.16.0-next.13"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@testing-library/dom": "~8.19.0",
57
58
  "@testing-library/react": "~12.1.3",
58
59
  "@testing-library/user-event": "~13.5.0",
59
60
  "lodash": "^4.17.21",
60
- "styled-components": "~5.3.6",
61
- "@elliemae/ds-breadcrumb": "3.16.0-next.11",
62
- "@elliemae/ds-tree-model": "3.16.0-next.11"
61
+ "styled-components": "~5.3.9",
62
+ "@elliemae/ds-breadcrumb": "3.16.0-next.13",
63
+ "@elliemae/ds-tree-model": "3.16.0-next.13"
63
64
  },
64
65
  "peerDependencies": {
65
66
  "lodash": "^4.17.21",