@elliemae/ds-shuttle-v2 3.57.0-next.2 → 3.57.0-next.22
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 +3 -1
- package/dist/cjs/DSShuttleV2.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/index.js.map +2 -2
- package/dist/cjs/config/useAutoCalculated/useDataStructure.js.map +2 -2
- package/dist/cjs/config/useStore/useStore.js +3 -1
- package/dist/cjs/config/useStore/useStore.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js.map +2 -2
- package/dist/cjs/constants/index.js +44 -1
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/Dnd/DndHandle.js +2 -3
- package/dist/cjs/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/cjs/parts/Header.js +6 -2
- package/dist/cjs/parts/Header.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +1 -1
- package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js +1 -1
- package/dist/cjs/parts/HoC/withConditionalUseSortable.js.map +2 -2
- package/dist/cjs/parts/Item/Item.js +2 -3
- package/dist/cjs/parts/Item/Item.js.map +2 -2
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js +10 -10
- package/dist/cjs/parts/Item/ItemActions/ItemActions.js.map +2 -2
- package/dist/cjs/parts/Item/ItemMiddleSection.js +4 -4
- package/dist/cjs/parts/Item/ItemMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Item/ItemOverlay.js +2 -2
- package/dist/cjs/parts/Item/ItemOverlay.js.map +2 -2
- package/dist/cjs/parts/Item/ItemSelection.js +2 -2
- package/dist/cjs/parts/Item/ItemSelection.js.map +2 -2
- package/dist/cjs/parts/Item/TextSection.js +2 -2
- package/dist/cjs/parts/Item/TextSection.js.map +2 -2
- package/dist/cjs/parts/MainContent.js +2 -2
- package/dist/cjs/parts/MainContent.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js +3 -3
- package/dist/cjs/parts/Panel/bottom/LoadMoreBtn.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js +3 -3
- package/dist/cjs/parts/Panel/bottom/LoadingMore.js.map +2 -2
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js +2 -2
- package/dist/cjs/parts/Panel/bottom/PanelContentBottomSection.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/EmptyItems.js +2 -2
- package/dist/cjs/parts/Panel/middle/EmptyItems.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js +2 -2
- package/dist/cjs/parts/Panel/middle/ItemListWrapper/Index.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/LoadingItems.js +2 -2
- package/dist/cjs/parts/Panel/middle/LoadingItems.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js +8 -9
- package/dist/cjs/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js +11 -13
- package/dist/cjs/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/cjs/parts/Panel/middle/ShuttleLoadingAnnouncement.js +38 -0
- package/dist/cjs/parts/Panel/middle/ShuttleLoadingAnnouncement.js.map +7 -0
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js +2 -2
- package/dist/cjs/parts/Panel/top/PanelContentTopSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js +6 -4
- package/dist/cjs/parts/Panel/top/PanelFilterSection.js.map +2 -2
- package/dist/cjs/parts/Panel/top/SelectionHeader.js +5 -5
- package/dist/cjs/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/cjs/parts/PanelWrapper.js +3 -3
- package/dist/cjs/parts/PanelWrapper.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +3 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid.js +142 -0
- package/dist/cjs/typescript-testing/typescript-shuttle-v2-valid.js.map +7 -0
- package/dist/esm/DSShuttleV2.js +3 -1
- package/dist/esm/DSShuttleV2.js.map +2 -2
- package/dist/esm/config/useAutoCalculated/index.js.map +2 -2
- package/dist/esm/config/useAutoCalculated/useDataStructure.js.map +2 -2
- package/dist/esm/config/useStore/useStore.js +3 -1
- package/dist/esm/config/useStore/useStore.js.map +2 -2
- package/dist/esm/config/useValidateProps.js.map +2 -2
- package/dist/esm/constants/index.js +44 -1
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parts/Dnd/DndHandle.js +1 -2
- package/dist/esm/parts/Dnd/DndHandle.js.map +2 -2
- package/dist/esm/parts/Header.js +6 -2
- package/dist/esm/parts/Header.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +2 -2
- package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
- package/dist/esm/parts/HoC/withConditionalUseSortable.js +1 -1
- package/dist/esm/parts/HoC/withConditionalUseSortable.js.map +2 -2
- package/dist/esm/parts/Item/Item.js +1 -2
- package/dist/esm/parts/Item/Item.js.map +2 -2
- package/dist/esm/parts/Item/ItemActions/ItemActions.js +1 -1
- package/dist/esm/parts/Item/ItemActions/ItemActions.js.map +1 -1
- package/dist/esm/parts/Item/ItemMiddleSection.js +1 -1
- package/dist/esm/parts/Item/ItemMiddleSection.js.map +1 -1
- package/dist/esm/parts/Item/ItemOverlay.js +1 -1
- package/dist/esm/parts/Item/ItemOverlay.js.map +1 -1
- package/dist/esm/parts/Item/ItemSelection.js +1 -1
- package/dist/esm/parts/Item/ItemSelection.js.map +1 -1
- package/dist/esm/parts/Item/TextSection.js +1 -1
- package/dist/esm/parts/Item/TextSection.js.map +1 -1
- package/dist/esm/parts/MainContent.js +1 -1
- package/dist/esm/parts/MainContent.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js +1 -1
- package/dist/esm/parts/Panel/bottom/LoadMoreBtn.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/LoadingMore.js +1 -1
- package/dist/esm/parts/Panel/bottom/LoadingMore.js.map +1 -1
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js +1 -1
- package/dist/esm/parts/Panel/bottom/PanelContentBottomSection.js.map +1 -1
- package/dist/esm/parts/Panel/middle/EmptyItems.js +1 -1
- package/dist/esm/parts/Panel/middle/EmptyItems.js.map +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js +1 -1
- package/dist/esm/parts/Panel/middle/ItemListWrapper/Index.js.map +1 -1
- package/dist/esm/parts/Panel/middle/LoadingItems.js +1 -1
- package/dist/esm/parts/Panel/middle/LoadingItems.js.map +1 -1
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js +1 -2
- package/dist/esm/parts/Panel/middle/MultipleSelectionAction.js.map +2 -2
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js +11 -13
- package/dist/esm/parts/Panel/middle/PanelContentMiddleSection.js.map +2 -2
- package/dist/esm/parts/Panel/middle/ShuttleLoadingAnnouncement.js +8 -0
- package/dist/esm/parts/Panel/middle/ShuttleLoadingAnnouncement.js.map +7 -0
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js +1 -1
- package/dist/esm/parts/Panel/top/PanelContentTopSection.js.map +1 -1
- package/dist/esm/parts/Panel/top/PanelFilterSection.js +5 -3
- package/dist/esm/parts/Panel/top/PanelFilterSection.js.map +2 -2
- package/dist/esm/parts/Panel/top/SelectionHeader.js +1 -1
- package/dist/esm/parts/Panel/top/SelectionHeader.js.map +2 -2
- package/dist/esm/parts/PanelWrapper.js +1 -1
- package/dist/esm/parts/PanelWrapper.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +1 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid.js +119 -0
- package/dist/esm/typescript-testing/typescript-shuttle-v2-valid.js.map +7 -0
- package/dist/types/DSShuttleV2.d.ts +5 -3
- package/dist/types/config/useAutoCalculated/index.d.ts +1 -1
- package/dist/types/config/useAutoCalculated/useDataStructure.d.ts +1 -1
- package/dist/types/config/useStore/useStore.d.ts +10 -10
- package/dist/types/config/useValidateProps.d.ts +1 -1
- package/dist/types/constants/index.d.ts +72 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parts/Panel/middle/ItemListWrapper/useGetDatumHydratables.d.ts +1 -1
- package/dist/types/parts/Panel/middle/ShuttleLoadingAnnouncement.d.ts +3 -0
- package/dist/types/react-desc-prop-types.d.ts +20 -19
- package/dist/types/tests/configs/ControlledTestRender.d.ts +1 -0
- package/dist/types/tests/configs/basic.d.ts +4 -5
- package/dist/types/tests/configs/filter.d.ts +9 -8
- package/dist/types/tests/configs/loadMore.d.ts +4 -5
- package/dist/types/tests/shuttle-v2.events.test.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.exports.test.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.get-owner-props.test.d.ts +1 -0
- package/dist/types/tests/shuttle-v2.keyboard.test.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-shuttle-v2-valid.d.ts +1 -0
- package/package.json +26 -25
- package/dist/cjs/config/DSShuttleV2Definitions.js +0 -74
- package/dist/cjs/config/DSShuttleV2Definitions.js.map +0 -7
- package/dist/esm/config/DSShuttleV2Definitions.js +0 -44
- package/dist/esm/config/DSShuttleV2Definitions.js.map +0 -7
- package/dist/types/config/DSShuttleV2Definitions.d.ts +0 -69
- /package/dist/types/tests/{shuttle-v2.load-more.test.d.ts → loadMore/shuttle-v2.load-more.test.d.ts} +0 -0
- /package/dist/types/tests/{shuttle-v2.basic.test.d.ts → shuttle-v2.a11y.test.d.ts} +0 -0
- /package/dist/types/tests/{shuttle-v2.filter.test.d.ts → shuttle-v2.data-testid.test.d.ts} +0 -0
|
@@ -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 DSButtonT, type DSButtonV3T } from '@elliemae/ds-button-v2';\nimport { type DnDKitTree, type useSortable } from '@elliemae/ds-drag-and-drop';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { type DSInputTextT } from '@elliemae/ds-form-input-text';\nimport { type useHeadlessTooltip } from '@elliemae/ds-hooks-headless-tooltip';\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerDatatestIdPropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\nimport type React from 'react';\nimport { DSShuttleV2DataTestIds, DSShuttleV2Name, DSShuttleV2Slots } from './config/DSShuttleV2Definitions.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated/index.js';\nimport type { ACTIONS_FOCUSES, DropIndicatorPosition, ITEMS_FOCUSES, REGIONS_FOCUSES } from './constants/index.js';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection?: boolean; height?: number };\n type HydratedId = string;\n\n export type DatumInternalMeta = {\n isFirst: boolean;\n isLast: boolean;\n isSelected: boolean;\n softDeleted: boolean;\n localIndex: number;\n hydratedId: HydratedId;\n hydratedPreventMove: boolean;\n };\n export type DatumRenderFlags = {\n selectionPrevented: boolean;\n withActions: boolean;\n withMoveBtn: boolean;\n withDrilldownBtn: boolean;\n internallyDisabledMove: boolean;\n internallyDisabledDrilldown: boolean;\n };\n\n export type DropIndicatorPositionValues = TypescriptHelpersT.ObjectValues<typeof DropIndicatorPosition>;\n\n // =============================================================================\n // Hydratables section - panel level hydratables\n // =============================================================================\n type RequiredPanelHydratables = Record<string, never>;\n type OptionalPanelHydratables = {\n batchActionableButtonProps: Record<string, unknown>;\n };\n export type PanelHydratables = RequiredPanelHydratables & OptionalPanelHydratables;\n\n // =============================================================================\n // Hydratables section - datum level hydratables\n // shared usage between internal and custom component\n // =============================================================================\n export type PrimaryKeyHydratables = {\n id: HydratedId;\n };\n type FunctionalHydratables = {\n preventMove?: boolean;\n };\n type RequiredDatumHydratablesWithoutComponents = {\n label: string;\n };\n type OptionalDatumHydratablesWithoutComponents = {\n subtitle?: string;\n preventDrilldown?: boolean;\n };\n type DatumHydratablesWithoutComponents = PrimaryKeyHydratables &\n FunctionalHydratables &\n RequiredDatumHydratablesWithoutComponents &\n OptionalDatumHydratablesWithoutComponents;\n // =============================================================================\n // Hydratables section - datum level hydratables\n // Custom component-only\n // =============================================================================\n export type ComponentProps = {\n datum: Datum;\n thisItemIsFocused: boolean;\n panelMetaInfo: PanelMetaInfo;\n datumInternalMeta: DatumInternalMeta;\n datumHydratables: DatumHydratablesWithoutComponents;\n tooltipHelpers?: ReturnType<typeof useHeadlessTooltip>;\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n type RequiredDatumHydratablesComponents = {};\n type OptionalDatumHydratablesComponents = {\n Icon?: React.ComponentType<ComponentProps>;\n CustomRenderer?: React.ComponentType<ComponentProps>;\n };\n // =============================================================================\n // Hydratables section - datum level hydratables\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = PrimaryKeyHydratables & RequiredDatumHydratables & OptionalDatumHydratables;\n\n // =============================================================================\n // Hydraters\n // =============================================================================\n export type PrimaryKeyHydraters = TypescriptHelpersT.Hydraters<PrimaryKeyHydratables, [Datum]>;\n export type FunctionalHydraters = TypescriptHelpersT.Hydraters<\n FunctionalHydratables,\n [Datum, Partial<PanelMetaInfo>]\n >;\n type HydratersMeta = { datumMeta: DatumInternalMeta; panelMetaInfo: PanelMetaInfo };\n type RequiredDatumHydraters = TypescriptHelpersT.Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;\n type OptionalDatumHydraters = TypescriptHelpersT.Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;\n\n type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;\n\n type RequiredPanelHydraters = TypescriptHelpersT.Hydraters<RequiredPanelHydratables, [PanelMetaInfo]>;\n type OptionalPanelHydraters = Partial<TypescriptHelpersT.Hydraters<OptionalPanelHydratables, [PanelMetaInfo]>>;\n type PanelHydraters = RequiredPanelHydraters & OptionalPanelHydraters;\n\n // =============================================================================\n // Datum & Internals structures\n // =============================================================================\n export type ConfiguredDatum = DatumInternalMeta & { original: Datum };\n export interface ItemMeta extends PanelMetaInfo {\n datum: Datum;\n datumHydratables: DatumHydratables;\n datumInternalMeta: DatumInternalMeta;\n datumRenderFlags: DatumRenderFlags;\n withDragNDrop: boolean;\n useSortableHelpers?: ReturnType<typeof useSortable>;\n }\n\n // =============================================================================\n // Callbacks\n // =============================================================================\n type OnDataChange = (\n newData: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n item?: Datum;\n selectedItems?: Datum[];\n },\n ) => void;\n\n type OnChangeEvent = (\n items: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n },\n ) => void;\n\n type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;\n type OnReorderEvent = (movedItem: Datum, metadata: OnReorderEventMetadata) => void;\n\n export type SelectionMap = Record<string, boolean>;\n type OnSelectionChange = (\n newSelection: SelectionMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n type OnSelectionDrilldown = (\n item: Datum,\n metainfo: { event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement> },\n ) => void;\n\n type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;\n type OnFilterChange = (\n newfilter: string | null,\n metainfo: { event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement> },\n ) => void;\n type OnSearchbarOpen = (\n newfilter: boolean,\n metainfo: { event: Parameters<Required<DSButtonT.Props>['onClick']>[0] },\n ) => void;\n\n export type SoftDeletedMap = Record<string, boolean>;\n type OnSoftDeletedChange = (\n newSoftDeleted: SoftDeletedMap,\n metainfo: {\n event:\n | Parameters<Required<DSButtonT.Props>['onClick']>[0]\n | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1]\n | React.MouseEvent<HTMLButtonElement | HTMLDivElement>\n | React.KeyboardEvent<HTMLDivElement>\n | React.ChangeEvent<HTMLInputElement>;\n item?: Datum;\n },\n ) => void;\n // =============================================================================\n // Zustand Store\n // =============================================================================\n export type FocusRegion = (typeof REGIONS_FOCUSES)[keyof typeof REGIONS_FOCUSES];\n export type FocusItem = Omit<(typeof ITEMS_FOCUSES)[keyof typeof ITEMS_FOCUSES], 'GET_SPECIFIC_ITEM'> & string;\n export type FocusItemAction = (typeof ACTIONS_FOCUSES)[keyof typeof ACTIONS_FOCUSES];\n export type InternalAtoms = {\n focusRegion: FocusRegion;\n focusItem: FocusItem;\n focusItemAction: FocusItemAction;\n deferFocusUntilFirstRender: boolean;\n dropIndicatorPosition: DropIndicatorPositionValues;\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<Record<string, unknown>>;\n onSourceDrilldown: OnSelectionDrilldown;\n\n destinationData: Datum[];\n destinationSelectedItems: SelectionMap;\n onDestinationSelectionChange: OnSelectionChange;\n DestinationHeader: React.ComponentType<Record<string, 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 destinationNoOptionsMessage: string;\n sourceNoOptionsMessage: string;\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 export interface OptionalProps\n extends OptionalDatumHydraters,\n OptionalPanelHydraters,\n TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSShuttleV2Name, typeof DSShuttleV2Slots> {\n sourceItemProps?: Record<string, unknown>;\n destinationItemProps?: Record<string, unknown>;\n sourceHeaderProps?: Record<string, unknown>;\n destinationHeaderProps?: Record<string, unknown>;\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 moveButtonProps?: ({\n itemMeta,\n isDestinationPanel,\n }: {\n itemMeta: ItemMeta;\n isDestinationPanel: boolean;\n }) => Omit<DSButtonV3T.Props, 'children'>;\n drillDownButtonProps?: ({\n itemMeta,\n isDestinationPanel,\n }: {\n itemMeta: ItemMeta;\n isDestinationPanel: boolean;\n }) => Omit<DSButtonV3T.Props, 'children'>;\n\n checkboxSelectAllProps?: (metainfo: PanelMetaInfo) => DSControlledCheckboxT.Props;\n dsShuttleV2ListWrapperMid?: (metaInfo: PanelMetaInfo) => Record<string, unknown>;\n areaSearchBarProps?: (metaInfo: PanelMetaInfo) => DSInputTextT.Props;\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 destinationNoOptionsMessage: 'There are no items to display',\n sourceNoOptionsMessage: 'There are no items to display',\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 ...getPropsPerSlotPropTypes(DSShuttleV2Name, DSShuttleV2Slots),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n sourceData: PropTypes.arrayOf(PropTypes.object).description(\n 'An array of objects representing the items in the source list',\n ).isRequired,\n sourceSelectedItems: PropTypes.object.description('An object representing the selected items in the source list')\n .isRequired,\n onSourceSelectionChange: PropTypes.func.description('A function called when the selection in the source list changes')\n .isRequired,\n SourceHeader: PropTypes.func.description('The header component for the source list').isRequired,\n sourceHeaderProps: PropTypes.object.description('Props to be passed to the source header').defaultValue({}),\n onSourceDrilldown: PropTypes.func.description('A function called when an item in the source list is clicked')\n .isRequired,\n destinationData: PropTypes.arrayOf(PropTypes.object).description(\n 'An array of objects representing the items in the destination list',\n ).isRequired,\n destinationSelectedItems: PropTypes.object.description(\n 'An object representing the selected items in the destination list',\n ).isRequired,\n onDestinationSelectionChange: PropTypes.func.description(\n 'A function called when the selection in the destination list changes',\n ).isRequired,\n DestinationHeader: PropTypes.func.description('The header component for the destination list').isRequired,\n destinationHeaderProps: PropTypes.object.description('Props to be passed to the destination header').defaultValue({}),\n onDestinationDrilldown: PropTypes.func.description(\n 'A function called when an item in the destination list is clicked',\n ).isRequired,\n getId: PropTypes.func.description(\n 'A function that takes an item from the source/destination list and returns its unique identifier',\n ).isRequired,\n getLabel: PropTypes.func.description(\n 'A function that takes an item from the source/destination list and returns its display label',\n ).isRequired,\n sourceIsLoading: PropTypes.bool\n .description('A boolean indicating whether the source list is currently loading data')\n .defaultValue(false),\n destinationIsLoading: PropTypes.bool\n .description('A boolean indicating whether the destination list is currently loading data')\n .defaultValue(false),\n sourceWithLoadMore: PropTypes.bool\n .description('A boolean indicating whether the source list supports \"load more\" functionality')\n .defaultValue(false),\n destinationWithLoadMore: PropTypes.bool\n .description('A boolean indicating whether the destination list supports \"load more\" functionality')\n .defaultValue(false),\n sourceIsLoadingMore: PropTypes.bool\n .description('A boolean indicating whether the source list is currently loading more data')\n .defaultValue(false),\n destinationIsLoadingMore: PropTypes.bool\n .description('A boolean indicating whether the destination list is currently loading more data')\n .defaultValue(false),\n onSourceLoadMore: PropTypes.func\n .description('A function called when the \"load more\" button in the source list is clicked')\n .defaultValue(() => {}),\n onDestinationLoadMore: PropTypes.func\n .description('A function called when the \"load more\" button in the destination list is clicked')\n .defaultValue(() => {}),\n onSourceAdd: PropTypes.func\n .description('A function called when an item is added from the source list to the destination list')\n .defaultValue(() => {}),\n onDestinationAdd: PropTypes.func\n .description('A function called when an item is added from the destination list to the source list')\n .defaultValue(() => {}),\n onSourceRemove: PropTypes.func\n .description('A function called when an item is removed from the destination list')\n .defaultValue(() => {}),\n onDestinationRemove: PropTypes.func\n .description('Callback function to handle when an item is removed from the destination shuttle list. ')\n .defaultValue(() => {}),\n onSourceReorder: PropTypes.func\n .description('Callback function to handle when items are reordered in the source shuttle list.')\n .defaultValue(() => {}),\n onDestinationReorder: PropTypes.func\n .description('Callback function to handle when items are reordered in the destination shuttle list. ')\n .defaultValue(() => {}),\n sourceSoftDeletedItems: PropTypes.object\n .description(\n 'Object containing the soft deleted items in the source shuttle list, where the key is the item ID and the value is the deleted item.',\n )\n .defaultValue({}),\n onSourceSoftDelete: PropTypes.func\n .description('Callback function to handle when an item is soft deleted in the source shuttle list. ')\n .defaultValue(() => {}),\n destinationSoftDeletedItems: PropTypes.object\n .description(\n 'Object containing the soft deleted items in the destination shuttle list, where the key is the item ID and the value is the deleted item.',\n )\n .defaultValue({}),\n onDestinationSoftDelete: PropTypes.func\n .description('Callback function to handle when an item is soft deleted in the destination shuttle list.')\n .defaultValue(() => {}),\n getPreventMove: PropTypes.func\n .description('Function that determines whether a specific item can be moved to the destination shuttle list. ')\n .defaultValue(() => false),\n addDragAndDropFromSource: PropTypes.bool\n .description('Specifies whether items can be dragged from the source list and dropped into the destination list.')\n .defaultValue(false),\n removeDragAndDropFromDestination: PropTypes.bool\n .description('Specifies whether items can be removed from the destination list by dragging them out of the list.')\n .defaultValue(false),\n sourceItemProps: PropTypes.object\n .description('Specifies additional props to be applied to each item in the source list.')\n .defaultValue({}),\n destinationItemProps: PropTypes.object\n .description('Specifies additional props to be applied to each item in the destination list.')\n .defaultValue({}),\n sourceShowSearchbar: PropTypes.bool\n .description('Specifies whether the search bar should be shown in the source list.')\n .defaultValue(false),\n destinationShowSearchbar: PropTypes.bool\n .description('Specifies whether the search bar should be shown in the destination list.')\n .defaultValue(false),\n onSourceOpenSearchbar: PropTypes.func\n .description('Callback function that is called when the search bar in the source list is opened.')\n .defaultValue(() => {}),\n onDesinationOpenSearchbar: PropTypes.func\n .description('Callback function that is called when the search bar in the destination list is opened.')\n .defaultValue(() => {}),\n sourceFilterValue: PropTypes.string\n .description('Specifies the current value of the search filter in the source list.')\n .defaultValue(''),\n destinationFilterValue: PropTypes.string\n .description('Specifies the current value of the search filter in the destination list.')\n .defaultValue(''),\n onSourceFilterChange: PropTypes.func\n .description('Callback function that is called when the search filter in the source list is changed.')\n .defaultValue(() => {}),\n onDestinationFilterChange: PropTypes.func\n .description('Callback function that is called when the search filter in the destination list is changed.')\n .defaultValue(() => {}),\n getSubtitle: PropTypes.func\n .description('Callback function that returns the subtitle to be displayed for each item in the list.')\n .defaultValue(() => ''),\n getIcon: PropTypes.func\n .description('Callback function that returns the icon to be displayed for each item in the list.')\n .defaultValue(() => ''),\n getPreventDrilldown: PropTypes.func\n .description('Callback function that determines whether drilldown should be prevented for a particular item.')\n .defaultValue(() => false),\n getCustomRenderer: PropTypes.func\n .description('Callback function that returns a custom renderer for each item in the list.')\n .defaultValue(() => undefined),\n getBatchActionableButtonProps: PropTypes.func\n .description('Callback function that returns the props for the batch actionable button in the destination list.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n ...getPropsPerDatatestIdPropTypes(DSShuttleV2DataTestIds),\n destinationNoOptionsMessage: PropTypes.string\n .description('Custome message to be display when no matches found after filtering in destination panel')\n .defaultValue('There are no items to display'),\n sourceNoOptionsMessage: PropTypes.string\n .description('Custome message to be display when no matches found after filtering in source panel')\n .defaultValue('There are no items to display'),\n checkboxSelectAllProps: PropTypes.func\n .description('Function that returns props for the select all checkbox in the source panel.')\n .defaultValue({}),\n moveButtonProps: PropTypes.func\n .description('Function that returns props for the move button.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n drillDownButtonProps: PropTypes.func\n .description('Function that returns props for the drilldown button.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n areaSearchBarProps: PropTypes.func\n .description('Function that returns props for the area search bar.')\n .defaultValue(() => ({})),\n dsShuttleV2ListWrapperMid: PropTypes.func\n .description('Function that returns props for the list wrapper.')\n .defaultValue(() => ({})),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as ValidationMap<DSShuttleV2T.Props>;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACOvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,wBAAwB,iBAAiB,wBAAwB;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { type DSButtonT, type DSButtonV3T } from '@elliemae/ds-button-v2';\nimport { type DnDKitTree, type useSortable } from '@elliemae/ds-drag-and-drop';\nimport { type DSControlledCheckboxT } from '@elliemae/ds-form-checkbox';\nimport { type DSInputTextT } from '@elliemae/ds-form-input-text';\nimport { type useHeadlessTooltip } from '@elliemae/ds-hooks-headless-tooltip';\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerDatatestIdPropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { ZustandT } from '@elliemae/ds-zustand-helpers';\nimport type React from 'react';\nimport { DSShuttleV2DataTestIds, DSShuttleV2Name, DSShuttleV2Slots } from './constants/index.js';\nimport type { useAutoCalculated } from './config/useAutoCalculated/index.js';\nimport type { ACTIONS_FOCUSES, DropIndicatorPosition, ITEMS_FOCUSES, REGIONS_FOCUSES } from './constants/index.js';\n\nexport declare namespace DSShuttleV2T {\n export type Datum = Record<string, unknown>;\n export type PanelMetaInfo = { isDestinationPanel: boolean; hasMultipleSelection?: boolean; height?: number };\n type HydratedId = string;\n\n export type DatumInternalMeta = {\n isFirst: boolean;\n isLast: boolean;\n isSelected: boolean;\n softDeleted: boolean;\n localIndex: number;\n hydratedId: HydratedId;\n hydratedPreventMove: boolean;\n };\n export type DatumRenderFlags = {\n selectionPrevented: boolean;\n withActions: boolean;\n withMoveBtn: boolean;\n withDrilldownBtn: boolean;\n internallyDisabledMove: boolean;\n internallyDisabledDrilldown: boolean;\n };\n\n export type DropIndicatorPositionValues = TypescriptHelpersT.ObjectValues<typeof DropIndicatorPosition>;\n\n // =============================================================================\n // Hydratables section - panel level hydratables\n // =============================================================================\n type RequiredPanelHydratables = Record<string, never>;\n type OptionalPanelHydratables = {\n batchActionableButtonProps: Record<string, unknown>;\n };\n export type PanelHydratables = RequiredPanelHydratables & OptionalPanelHydratables;\n\n // =============================================================================\n // Hydratables section - datum level hydratables\n // shared usage between internal and custom component\n // =============================================================================\n export type PrimaryKeyHydratables = {\n id: HydratedId;\n };\n type FunctionalHydratables = {\n preventMove?: boolean;\n };\n type RequiredDatumHydratablesWithoutComponents = {\n label: string;\n };\n type OptionalDatumHydratablesWithoutComponents = {\n subtitle?: string;\n preventDrilldown?: boolean;\n };\n type DatumHydratablesWithoutComponents = PrimaryKeyHydratables &\n FunctionalHydratables &\n RequiredDatumHydratablesWithoutComponents &\n OptionalDatumHydratablesWithoutComponents;\n // =============================================================================\n // Hydratables section - datum level hydratables\n // Custom component-only\n // =============================================================================\n export type ComponentProps = {\n datum: Datum;\n thisItemIsFocused: boolean;\n panelMetaInfo: PanelMetaInfo;\n datumInternalMeta: DatumInternalMeta;\n datumHydratables: DatumHydratablesWithoutComponents;\n tooltipHelpers?: ReturnType<typeof useHeadlessTooltip>;\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n type RequiredDatumHydratablesComponents = {};\n type OptionalDatumHydratablesComponents = {\n Icon?: React.ComponentType<ComponentProps>;\n CustomRenderer?: React.ComponentType<ComponentProps> | null;\n };\n // =============================================================================\n // Hydratables section - datum level hydratables\n // Finals\n // =============================================================================\n type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;\n type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;\n export type DatumHydratables = PrimaryKeyHydratables & RequiredDatumHydratables & OptionalDatumHydratables;\n\n // =============================================================================\n // Hydraters\n // =============================================================================\n export type PrimaryKeyHydraters = TypescriptHelpersT.Hydraters<PrimaryKeyHydratables, [Datum]>;\n export type FunctionalHydraters = TypescriptHelpersT.Hydraters<\n FunctionalHydratables,\n [Datum, Partial<PanelMetaInfo>]\n >;\n type HydratersMeta = { datumMeta: DatumInternalMeta; panelMetaInfo: PanelMetaInfo };\n type RequiredDatumHydraters = TypescriptHelpersT.Hydraters<RequiredDatumHydratables, [Datum, HydratersMeta]>;\n type OptionalDatumHydraters = TypescriptHelpersT.Hydraters<OptionalDatumHydratables, [Datum, HydratersMeta]>;\n\n type DatumHydraters = PrimaryKeyHydraters & FunctionalHydraters & RequiredDatumHydraters & OptionalDatumHydraters;\n\n type RequiredPanelHydraters = TypescriptHelpersT.Hydraters<RequiredPanelHydratables, [PanelMetaInfo]>;\n type OptionalPanelHydraters = Partial<TypescriptHelpersT.Hydraters<OptionalPanelHydratables, [PanelMetaInfo]>>;\n type PanelHydraters = RequiredPanelHydraters & OptionalPanelHydraters;\n\n // =============================================================================\n // Datum & Internals structures\n // =============================================================================\n export type ConfiguredDatum = DatumInternalMeta & { original: Datum };\n export interface ItemMeta extends PanelMetaInfo {\n datum: Datum;\n datumHydratables: DatumHydratables;\n datumInternalMeta: DatumInternalMeta;\n datumRenderFlags: DatumRenderFlags;\n withDragNDrop: boolean;\n useSortableHelpers?: ReturnType<typeof useSortable>;\n }\n\n // =============================================================================\n // Callbacks\n // =============================================================================\n type OnDataChange = (\n newData: Datum[],\n metainfo: {\n event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;\n item?: Datum;\n selectedItems?: Datum[];\n },\n ) => void;\n\n type OnChangeEvent<T> = (\n items: T,\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\n type OnSelectionDrilldown<T> = (\n item: T,\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,\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: DropIndicatorPositionValues;\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 shuttleInternalId: string;\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<T, H, K> extends RequiredDatumHydraters, PrimaryKeyHydraters {\n sourceData: Datum[];\n sourceSelectedItems: SelectionMap;\n onSourceSelectionChange: OnSelectionChange;\n SourceHeader: React.ComponentType<T>;\n onSourceDrilldown: OnSelectionDrilldown<K>;\n\n destinationData: Datum[];\n destinationSelectedItems: SelectionMap;\n onDestinationSelectionChange: OnSelectionChange;\n DestinationHeader: React.ComponentType<H>;\n onDestinationDrilldown: OnSelectionDrilldown<K>;\n }\n\n export interface DefaultProps<T> 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 destinationNoOptionsMessage: string;\n sourceNoOptionsMessage: string;\n // switch side\n onSourceAdd: OnChangeEvent<T>;\n onSourceRemove: OnChangeEvent<T>;\n onDestinationAdd: OnChangeEvent<T>;\n onDestinationRemove: OnChangeEvent<T>;\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 export interface OptionalProps\n extends OptionalDatumHydraters,\n OptionalPanelHydraters,\n TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSShuttleV2Name, typeof DSShuttleV2Slots> {\n sourceItemProps?: Record<string, unknown>;\n destinationItemProps?: Record<string, unknown>;\n sourceHeaderProps?: Record<string, unknown>;\n destinationHeaderProps?: Record<string, unknown>;\n // filtering\n sourceShowSearchbar?: boolean;\n destinationShowSearchbar?: boolean;\n onSourceOpenSearchbar?: OnSearchbarOpen;\n onDesinationOpenSearchbar?: OnSearchbarOpen;\n sourceFilterValue?: string;\n destinationFilterValue?: string;\n onSourceFilterChange?: OnFilterChange;\n onDestinationFilterChange?: OnFilterChange;\n\n moveButtonProps?: ({\n itemMeta,\n isDestinationPanel,\n }: {\n itemMeta: ItemMeta;\n isDestinationPanel: boolean;\n }) => Omit<DSButtonV3T.Props, 'children'>;\n drillDownButtonProps?: ({\n itemMeta,\n isDestinationPanel,\n }: {\n itemMeta: ItemMeta;\n isDestinationPanel: boolean;\n }) => Omit<DSButtonV3T.Props, 'children'>;\n\n checkboxSelectAllProps?: (metainfo: PanelMetaInfo) => DSControlledCheckboxT.Props;\n dsShuttleV2ListWrapperMid?: (metaInfo: PanelMetaInfo) => Record<string, unknown>;\n areaSearchBarProps?: (metaInfo: PanelMetaInfo) => DSInputTextT.Props;\n }\n\n export interface Props<T, H, N, K>\n extends Partial<DefaultProps<N>>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps<N> | keyof OptionalProps | keyof RequiredProps<T, H, K>\n >,\n XstyledProps,\n RequiredProps<T, H, K> {}\n\n export interface InternalProps<T, H, N, K>\n extends DefaultProps<N>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLButtonElement>,\n keyof DefaultProps<N> | keyof OptionalProps | keyof RequiredProps<T, H, K>\n >,\n XstyledProps,\n RequiredProps<T, H, K> {}\n}\n\nexport const defaultProps: DSShuttleV2T.DefaultProps<object> = {\n addDragAndDropFromSource: false,\n removeDragAndDropFromDestination: false,\n destinationNoOptionsMessage: 'There are no items to display',\n sourceNoOptionsMessage: 'There are no items to display',\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<object, object, object, object>> = {\n ...getPropsPerSlotPropTypes(DSShuttleV2Name, DSShuttleV2Slots),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n\n sourceData: PropTypes.arrayOf(PropTypes.object).description(\n 'An array of objects representing the items in the source list',\n ).isRequired,\n sourceSelectedItems: PropTypes.object.description('An object representing the selected items in the source list')\n .isRequired,\n onSourceSelectionChange: PropTypes.func.description('A function called when the selection in the source list changes')\n .isRequired,\n SourceHeader: PropTypes.func.description('The header component for the source list').isRequired,\n sourceHeaderProps: PropTypes.object.description('Props to be passed to the source header').defaultValue({}),\n onSourceDrilldown: PropTypes.func.description('A function called when an item in the source list is clicked')\n .isRequired,\n destinationData: PropTypes.arrayOf(PropTypes.object).description(\n 'An array of objects representing the items in the destination list',\n ).isRequired,\n destinationSelectedItems: PropTypes.object.description(\n 'An object representing the selected items in the destination list',\n ).isRequired,\n onDestinationSelectionChange: PropTypes.func.description(\n 'A function called when the selection in the destination list changes',\n ).isRequired,\n DestinationHeader: PropTypes.func.description('The header component for the destination list').isRequired,\n destinationHeaderProps: PropTypes.object.description('Props to be passed to the destination header').defaultValue({}),\n onDestinationDrilldown: PropTypes.func.description(\n 'A function called when an item in the destination list is clicked',\n ).isRequired,\n getId: PropTypes.func.description(\n 'A function that takes an item from the source/destination list and returns its unique identifier',\n ).isRequired,\n getLabel: PropTypes.func.description(\n 'A function that takes an item from the source/destination list and returns its display label',\n ).isRequired,\n sourceIsLoading: PropTypes.bool\n .description('A boolean indicating whether the source list is currently loading data')\n .defaultValue(false),\n destinationIsLoading: PropTypes.bool\n .description('A boolean indicating whether the destination list is currently loading data')\n .defaultValue(false),\n sourceWithLoadMore: PropTypes.bool\n .description('A boolean indicating whether the source list supports \"load more\" functionality')\n .defaultValue(false),\n destinationWithLoadMore: PropTypes.bool\n .description('A boolean indicating whether the destination list supports \"load more\" functionality')\n .defaultValue(false),\n sourceIsLoadingMore: PropTypes.bool\n .description('A boolean indicating whether the source list is currently loading more data')\n .defaultValue(false),\n destinationIsLoadingMore: PropTypes.bool\n .description('A boolean indicating whether the destination list is currently loading more data')\n .defaultValue(false),\n onSourceLoadMore: PropTypes.func\n .description('A function called when the \"load more\" button in the source list is clicked')\n .defaultValue(() => {}),\n onDestinationLoadMore: PropTypes.func\n .description('A function called when the \"load more\" button in the destination list is clicked')\n .defaultValue(() => {}),\n onSourceAdd: PropTypes.func\n .description('A function called when an item is added from the source list to the destination list')\n .defaultValue(() => {}),\n onDestinationAdd: PropTypes.func\n .description('A function called when an item is added from the destination list to the source list')\n .defaultValue(() => {}),\n onSourceRemove: PropTypes.func\n .description('A function called when an item is removed from the destination list')\n .defaultValue(() => {}),\n onDestinationRemove: PropTypes.func\n .description('Callback function to handle when an item is removed from the destination shuttle list. ')\n .defaultValue(() => {}),\n onSourceReorder: PropTypes.func\n .description('Callback function to handle when items are reordered in the source shuttle list.')\n .defaultValue(() => {}),\n onDestinationReorder: PropTypes.func\n .description('Callback function to handle when items are reordered in the destination shuttle list. ')\n .defaultValue(() => {}),\n sourceSoftDeletedItems: PropTypes.object\n .description(\n 'Object containing the soft deleted items in the source shuttle list, where the key is the item ID and the value is the deleted item.',\n )\n .defaultValue({}),\n onSourceSoftDelete: PropTypes.func\n .description('Callback function to handle when an item is soft deleted in the source shuttle list. ')\n .defaultValue(() => {}),\n destinationSoftDeletedItems: PropTypes.object\n .description(\n 'Object containing the soft deleted items in the destination shuttle list, where the key is the item ID and the value is the deleted item.',\n )\n .defaultValue({}),\n onDestinationSoftDelete: PropTypes.func\n .description('Callback function to handle when an item is soft deleted in the destination shuttle list.')\n .defaultValue(() => {}),\n getPreventMove: PropTypes.func\n .description('Function that determines whether a specific item can be moved to the destination shuttle list. ')\n .defaultValue(() => false),\n addDragAndDropFromSource: PropTypes.bool\n .description('Specifies whether items can be dragged from the source list and dropped into the destination list.')\n .defaultValue(false),\n removeDragAndDropFromDestination: PropTypes.bool\n .description('Specifies whether items can be removed from the destination list by dragging them out of the list.')\n .defaultValue(false),\n sourceItemProps: PropTypes.object\n .description('Specifies additional props to be applied to each item in the source list.')\n .defaultValue({}),\n destinationItemProps: PropTypes.object\n .description('Specifies additional props to be applied to each item in the destination list.')\n .defaultValue({}),\n sourceShowSearchbar: PropTypes.bool\n .description('Specifies whether the search bar should be shown in the source list.')\n .defaultValue(false),\n destinationShowSearchbar: PropTypes.bool\n .description('Specifies whether the search bar should be shown in the destination list.')\n .defaultValue(false),\n onSourceOpenSearchbar: PropTypes.func\n .description('Callback function that is called when the search bar in the source list is opened.')\n .defaultValue(() => {}),\n onDesinationOpenSearchbar: PropTypes.func\n .description('Callback function that is called when the search bar in the destination list is opened.')\n .defaultValue(() => {}),\n sourceFilterValue: PropTypes.string\n .description('Specifies the current value of the search filter in the source list.')\n .defaultValue(''),\n destinationFilterValue: PropTypes.string\n .description('Specifies the current value of the search filter in the destination list.')\n .defaultValue(''),\n onSourceFilterChange: PropTypes.func\n .description('Callback function that is called when the search filter in the source list is changed.')\n .defaultValue(() => {}),\n onDestinationFilterChange: PropTypes.func\n .description('Callback function that is called when the search filter in the destination list is changed.')\n .defaultValue(() => {}),\n getSubtitle: PropTypes.func\n .description('Callback function that returns the subtitle to be displayed for each item in the list.')\n .defaultValue(() => ''),\n getIcon: PropTypes.func\n .description('Callback function that returns the icon to be displayed for each item in the list.')\n .defaultValue(() => ''),\n getPreventDrilldown: PropTypes.func\n .description('Callback function that determines whether drilldown should be prevented for a particular item.')\n .defaultValue(() => false),\n getCustomRenderer: PropTypes.func\n .description('Callback function that returns a custom renderer for each item in the list.')\n .defaultValue(() => undefined),\n getBatchActionableButtonProps: PropTypes.func\n .description('Callback function that returns the props for the batch actionable button in the destination list.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n ...getPropsPerDatatestIdPropTypes(DSShuttleV2DataTestIds),\n destinationNoOptionsMessage: PropTypes.string\n .description('Custome message to be display when no matches found after filtering in destination panel')\n .defaultValue('There are no items to display'),\n sourceNoOptionsMessage: PropTypes.string\n .description('Custome message to be display when no matches found after filtering in source panel')\n .defaultValue('There are no items to display'),\n checkboxSelectAllProps: PropTypes.func\n .description('Function that returns props for the select all checkbox in the source panel.')\n .defaultValue({}),\n moveButtonProps: PropTypes.func\n .description('Function that returns props for the move button.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n drillDownButtonProps: PropTypes.func\n .description('Function that returns props for the drilldown button.')\n .defaultValue(() => ({}))\n .signature(`(({ isDestionationPanel: boolean }) => ({ \"aria-label\": string }))`),\n areaSearchBarProps: PropTypes.func\n .description('Function that returns props for the area search bar.')\n .defaultValue(() => ({})),\n dsShuttleV2ListWrapperMid: PropTypes.func\n .description('Function that returns props for the list wrapper.')\n .defaultValue(() => ({})),\n};\n\nexport const DSShuttleV2PropTypesSchema = DSShuttleV2PropTypes as unknown as ValidationMap<\n DSShuttleV2T.Props<object, object, object, object>\n>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACOvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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Aa,OAAO,CAAC,EAAE;AAAA,EAC1B,2BAA2B,UAAU,KAClC,YAAY,mDAAmD,EAC/D,aAAa,OAAO,CAAC,EAAE;AAC5B;AAEO,MAAM,6BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DSShuttleV2 } from "../index.js";
|
|
4
|
+
import { defaultProps } from "../react-desc-prop-types.js";
|
|
5
|
+
const testRequiredProps = {
|
|
6
|
+
destinationData: [],
|
|
7
|
+
sourceData: [],
|
|
8
|
+
DestinationHeader: () => /* @__PURE__ */ jsx("div", { children: "Destination" }),
|
|
9
|
+
SourceHeader: () => /* @__PURE__ */ jsx("div", { children: "Source" }),
|
|
10
|
+
destinationSelectedItems: {},
|
|
11
|
+
sourceSelectedItems: {},
|
|
12
|
+
onDestinationSelectionChange: () => null,
|
|
13
|
+
onSourceSelectionChange: () => null,
|
|
14
|
+
getId: (item) => item.dsId,
|
|
15
|
+
getLabel: (item) => item.label,
|
|
16
|
+
onDestinationDrilldown: () => null,
|
|
17
|
+
onSourceDrilldown: () => null
|
|
18
|
+
};
|
|
19
|
+
const testOptionalProps = {
|
|
20
|
+
sourceItemProps: {},
|
|
21
|
+
destinationItemProps: {},
|
|
22
|
+
sourceHeaderProps: {},
|
|
23
|
+
destinationHeaderProps: {},
|
|
24
|
+
// filtering
|
|
25
|
+
sourceShowSearchbar: true,
|
|
26
|
+
destinationShowSearchbar: true,
|
|
27
|
+
onSourceOpenSearchbar: () => null,
|
|
28
|
+
onDesinationOpenSearchbar: () => null,
|
|
29
|
+
sourceFilterValue: "",
|
|
30
|
+
destinationFilterValue: "",
|
|
31
|
+
onSourceFilterChange: (value) => null,
|
|
32
|
+
onDestinationFilterChange: (value) => null,
|
|
33
|
+
moveButtonProps: () => ({}),
|
|
34
|
+
drillDownButtonProps: () => ({}),
|
|
35
|
+
checkboxSelectAllProps: () => ({}),
|
|
36
|
+
dsShuttleV2ListWrapperMid: () => ({}),
|
|
37
|
+
areaSearchBarProps: () => ({})
|
|
38
|
+
};
|
|
39
|
+
const testPartialDefaults = defaultProps;
|
|
40
|
+
const testProps = {
|
|
41
|
+
...testRequiredProps,
|
|
42
|
+
...testOptionalProps,
|
|
43
|
+
...testPartialDefaults
|
|
44
|
+
};
|
|
45
|
+
const testPropsAsSyntax = {
|
|
46
|
+
...testRequiredProps,
|
|
47
|
+
...testOptionalProps,
|
|
48
|
+
...testPartialDefaults
|
|
49
|
+
};
|
|
50
|
+
const testCompleteDefaults = defaultProps;
|
|
51
|
+
const testInternalProps = {
|
|
52
|
+
...testRequiredProps,
|
|
53
|
+
...testOptionalProps,
|
|
54
|
+
...testCompleteDefaults
|
|
55
|
+
};
|
|
56
|
+
const testInternalPropsAsSyntax = {
|
|
57
|
+
...testRequiredProps,
|
|
58
|
+
...testOptionalProps,
|
|
59
|
+
...testCompleteDefaults
|
|
60
|
+
};
|
|
61
|
+
const testExplicitDefinition = {
|
|
62
|
+
destinationData: [],
|
|
63
|
+
sourceData: [],
|
|
64
|
+
DestinationHeader: () => /* @__PURE__ */ jsx("div", { children: "Destination" }),
|
|
65
|
+
SourceHeader: () => /* @__PURE__ */ jsx("div", { children: "Source" }),
|
|
66
|
+
destinationSelectedItems: {},
|
|
67
|
+
sourceSelectedItems: {},
|
|
68
|
+
onDestinationSelectionChange: () => null,
|
|
69
|
+
onSourceSelectionChange: () => null,
|
|
70
|
+
getId: (item) => item.dsId,
|
|
71
|
+
getLabel: (item) => item.label,
|
|
72
|
+
onDestinationDrilldown: () => null,
|
|
73
|
+
onSourceDrilldown: () => null
|
|
74
|
+
};
|
|
75
|
+
const testInferedTypeCompatibility = {
|
|
76
|
+
destinationData: [],
|
|
77
|
+
sourceData: [],
|
|
78
|
+
DestinationHeader: () => /* @__PURE__ */ jsx("div", { children: "Destination" }),
|
|
79
|
+
SourceHeader: () => /* @__PURE__ */ jsx("div", { children: "Source" }),
|
|
80
|
+
destinationSelectedItems: {},
|
|
81
|
+
sourceSelectedItems: {},
|
|
82
|
+
onDestinationSelectionChange: () => null,
|
|
83
|
+
onSourceSelectionChange: () => null,
|
|
84
|
+
getId: (item) => item.dsId,
|
|
85
|
+
getLabel: (item) => item.label,
|
|
86
|
+
onDestinationDrilldown: () => null,
|
|
87
|
+
onSourceDrilldown: () => null
|
|
88
|
+
};
|
|
89
|
+
const BreadCrumb = () => /* @__PURE__ */ jsx("div", { children: "Breadcrumb" });
|
|
90
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
+
/* @__PURE__ */ jsx(DSShuttleV2, { ...testExplicitDefinition }),
|
|
92
|
+
/* @__PURE__ */ jsx(DSShuttleV2, { ...testInferedTypeCompatibility }),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
DSShuttleV2,
|
|
95
|
+
{
|
|
96
|
+
destinationData: [],
|
|
97
|
+
sourceData: [],
|
|
98
|
+
DestinationHeader: BreadCrumb,
|
|
99
|
+
SourceHeader: BreadCrumb,
|
|
100
|
+
destinationSelectedItems: {},
|
|
101
|
+
sourceSelectedItems: {},
|
|
102
|
+
onDestinationSelectionChange: () => null,
|
|
103
|
+
onSourceSelectionChange: () => null,
|
|
104
|
+
getId: (item) => item.dsId,
|
|
105
|
+
getLabel: (item) => item.label,
|
|
106
|
+
onDestinationDrilldown: () => null,
|
|
107
|
+
onSourceDrilldown: () => null,
|
|
108
|
+
sourceShowSearchbar: true,
|
|
109
|
+
destinationShowSearchbar: true,
|
|
110
|
+
onSourceOpenSearchbar: () => null,
|
|
111
|
+
onDesinationOpenSearchbar: () => null,
|
|
112
|
+
sourceFilterValue: "",
|
|
113
|
+
destinationFilterValue: "",
|
|
114
|
+
onSourceFilterChange: (value) => null,
|
|
115
|
+
onDestinationFilterChange: (value) => null
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
//# sourceMappingURL=typescript-shuttle-v2-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-shuttle-v2-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSShuttleV2 } from '../index.js';\nimport type { DSShuttleV2T } from '../index.js';\nimport { defaultProps } from '../react-desc-prop-types.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSShuttleV2T.Props<object, object, object, object>;\ntype ComponentPropsInternals = DSShuttleV2T.InternalProps<object, object, object, object>;\ntype ComponentPropsDefaultProps = DSShuttleV2T.DefaultProps<object>;\ntype ComponentPropsOptionalProps = DSShuttleV2T.OptionalProps;\ntype ComponentPropsRequiredProps = DSShuttleV2T.RequiredProps<object, object, object>;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n destinationData: [],\n sourceData: [],\n DestinationHeader: () => <div>Destination</div>,\n SourceHeader: () => <div>Source</div>,\n destinationSelectedItems: {},\n sourceSelectedItems: {},\n onDestinationSelectionChange: () => null,\n onSourceSelectionChange: () => null,\n getId: (item) => (item as { dsId: string }).dsId,\n getLabel: (item) => (item as { label: string }).label,\n onDestinationDrilldown: () => null,\n onSourceDrilldown: () => null,\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {\n sourceItemProps: {},\n destinationItemProps: {},\n sourceHeaderProps: {},\n destinationHeaderProps: {},\n // filtering\n sourceShowSearchbar: true,\n destinationShowSearchbar: true,\n onSourceOpenSearchbar: () => null,\n onDesinationOpenSearchbar: () => null,\n sourceFilterValue: '',\n destinationFilterValue: '',\n onSourceFilterChange: (value: string) => null,\n onDestinationFilterChange: (value: string) => null,\n\n moveButtonProps: () => ({}),\n drillDownButtonProps: () => ({}),\n\n checkboxSelectAllProps: () => ({}),\n dsShuttleV2ListWrapperMid: () => ({}),\n areaSearchBarProps: () => ({}),\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = defaultProps;\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = defaultProps;\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n destinationData: [],\n sourceData: [],\n DestinationHeader: () => <div>Destination</div>,\n SourceHeader: () => <div>Source</div>,\n destinationSelectedItems: {},\n sourceSelectedItems: {},\n onDestinationSelectionChange: () => null,\n onSourceSelectionChange: () => null,\n getId: (item) => (item as { dsId: string }).dsId,\n getLabel: (item) => (item as { label: string }).label,\n onDestinationDrilldown: () => null,\n onSourceDrilldown: () => null,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n destinationData: [],\n sourceData: [],\n DestinationHeader: () => <div>Destination</div>,\n SourceHeader: () => <div>Source</div>,\n destinationSelectedItems: {},\n sourceSelectedItems: {},\n onDestinationSelectionChange: () => null,\n onSourceSelectionChange: () => null,\n getId: (item) => (item as { dsId: string }).dsId,\n getLabel: (item) => (item as { label: string }).label,\n onDestinationDrilldown: () => null,\n onSourceDrilldown: () => null,\n} as ComponentPropsForApp;\n\nconst BreadCrumb = () => <div>Breadcrumb</div>;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSShuttleV2 {...testExplicitDefinition} />\n <DSShuttleV2 {...testInferedTypeCompatibility} />\n {/* works with inline values */}\n <DSShuttleV2\n destinationData={[]}\n sourceData={[]}\n DestinationHeader={BreadCrumb}\n SourceHeader={BreadCrumb}\n destinationSelectedItems={{}}\n sourceSelectedItems={{}}\n onDestinationSelectionChange={() => null}\n onSourceSelectionChange={() => null}\n getId={(item) => (item as { dsId: string }).dsId}\n getLabel={(item) => (item as { label: string }).label}\n onDestinationDrilldown={() => null}\n onSourceDrilldown={() => null}\n sourceShowSearchbar\n destinationShowSearchbar\n onSourceOpenSearchbar={() => null}\n onDesinationOpenSearchbar={() => null}\n sourceFilterValue=\"\"\n destinationFilterValue=\"\"\n onSourceFilterChange={(value: string) => null}\n onDestinationFilterChange={(value: string) => null}\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACeI,SA+FzB,UA/FyB,KA+FzB,YA/FyB;AAd3B,SAAS,mBAAmB;AAE5B,SAAS,oBAAoB;AAS7B,MAAM,oBAAiD;AAAA,EACrD,iBAAiB,CAAC;AAAA,EAClB,YAAY,CAAC;AAAA,EACb,mBAAmB,MAAM,oBAAC,SAAI,yBAAW;AAAA,EACzC,cAAc,MAAM,oBAAC,SAAI,oBAAM;AAAA,EAC/B,0BAA0B,CAAC;AAAA,EAC3B,qBAAqB,CAAC;AAAA,EACtB,8BAA8B,MAAM;AAAA,EACpC,yBAAyB,MAAM;AAAA,EAC/B,OAAO,CAAC,SAAU,KAA0B;AAAA,EAC5C,UAAU,CAAC,SAAU,KAA2B;AAAA,EAChD,wBAAwB,MAAM;AAAA,EAC9B,mBAAmB,MAAM;AAC3B;AACA,MAAM,oBAAiD;AAAA,EACrD,iBAAiB,CAAC;AAAA,EAClB,sBAAsB,CAAC;AAAA,EACvB,mBAAmB,CAAC;AAAA,EACpB,wBAAwB,CA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AAM,oBAAC,SAAI,yBAAW;AAAA,EACzC,cAAc,MAAM,oBAAC,SAAI,oBAAM;AAAA,EAC/B,0BAA0B,CAAC;AAAA,EAC3B,qBAAqB,CAAC;AAAA,EACtB,8BAA8B,MAAM;AAAA,EACpC,yBAAyB,MAAM;AAAA,EAC/B,OAAO,CAAC,SAAU,KAA0B;AAAA,EAC5C,UAAU,CAAC,SAAU,KAA2B;AAAA,EAChD,wBAAwB,MAAM;AAAA,EAC9B,mBAAmB,MAAM;AAC3B;AAEA,MAAM,aAAa,MAAM,oBAAC,SAAI,wBAAU;AAExC,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,eAAa,GAAG,wBAAwB;AAAA,EACzC,oBAAC,eAAa,GAAG,8BAA8B;AAAA,EAE/C;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB,CAAC;AAAA,MAClB,YAAY,CAAC;AAAA,MACb,mBAAmB;AAAA,MACnB,cAAc;AAAA,MACd,0BAA0B,CAAC;AAAA,MAC3B,qBAAqB,CAAC;AAAA,MACtB,8BAA8B,MAAM;AAAA,MACpC,yBAAyB,MAAM;AAAA,MAC/B,OAAO,CAAC,SAAU,KAA0B;AAAA,MAC5C,UAAU,CAAC,SAAU,KAA2B;AAAA,MAChD,wBAAwB,MAAM;AAAA,MAC9B,mBAAmB,MAAM;AAAA,MACzB,qBAAmB;AAAA,MACnB,0BAAwB;AAAA,MACxB,uBAAuB,MAAM;AAAA,MAC7B,2BAA2B,MAAM;AAAA,MACjC,mBAAkB;AAAA,MAClB,wBAAuB;AAAA,MACvB,sBAAsB,CAAC,UAAkB;AAAA,MACzC,2BAA2B,CAAC,UAAkB;AAAA;AAAA,EAChD;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { DSShuttleV2T } from './react-desc-prop-types.js';
|
|
3
|
-
declare const DSShuttleV2:
|
|
4
|
-
|
|
2
|
+
declare const DSShuttleV2: {
|
|
3
|
+
<T extends object, H extends object, N extends object, K extends object>(props: DSShuttleV2T.Props<T, H, N, K>): React.JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
declare const DSShuttleV2WithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSShuttleV2T.Props<object, object, object, object>>;
|
|
5
7
|
export { DSShuttleV2, DSShuttleV2WithSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
2
|
-
export declare const useAutoCalculated: (propsWithDefaults: DSShuttleV2T.InternalProps) => {
|
|
2
|
+
export declare const useAutoCalculated: <T extends object, H extends object, N extends object, K extends object>(propsWithDefaults: DSShuttleV2T.InternalProps<T, H, N, K>) => {
|
|
3
3
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
4
4
|
scrollTo: (index: number) => void;
|
|
5
5
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
2
|
-
export declare const useDataStructure: (propsFromUser: DSShuttleV2T.InternalProps) => {
|
|
2
|
+
export declare const useDataStructure: <T extends object, H extends object, N extends object, K extends object>(propsFromUser: DSShuttleV2T.InternalProps<T, H, N, K>) => {
|
|
3
3
|
destinationSelectedItemsMap: Record<string, {
|
|
4
4
|
datum: DSShuttleV2T.Datum;
|
|
5
5
|
index: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ZustandT } from '@elliemae/ds-zustand-helpers';
|
|
2
2
|
import { type DSShuttleV2T } from '../../react-desc-prop-types.js';
|
|
3
3
|
export declare const PropsProvider: ({ createStore, children, }: {
|
|
4
|
-
createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
4
|
+
createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
5
5
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
6
6
|
scrollTo: (index: number) => void;
|
|
7
7
|
}>;
|
|
@@ -32,7 +32,7 @@ export declare const PropsProvider: ({ createStore, children, }: {
|
|
|
32
32
|
sourceSelectionableIds: string;
|
|
33
33
|
}>>;
|
|
34
34
|
children: import("react").ReactNode;
|
|
35
|
-
}) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
35
|
+
}) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
36
36
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
37
37
|
scrollTo: (index: number) => void;
|
|
38
38
|
}>;
|
|
@@ -62,7 +62,7 @@ export declare const PropsProvider: ({ createStore, children, }: {
|
|
|
62
62
|
sourceSelectionableDataIds: string[];
|
|
63
63
|
sourceSelectionableIds: string;
|
|
64
64
|
}>> | undefined>>, usePropsStore: {
|
|
65
|
-
(): ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
65
|
+
(): ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
66
66
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
67
67
|
scrollTo: (index: number) => void;
|
|
68
68
|
}>;
|
|
@@ -92,7 +92,7 @@ export declare const PropsProvider: ({ createStore, children, }: {
|
|
|
92
92
|
sourceSelectionableDataIds: string[];
|
|
93
93
|
sourceSelectionableIds: string;
|
|
94
94
|
}>;
|
|
95
|
-
<U>(selector: (state: ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
95
|
+
<U>(selector: (state: ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
96
96
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
97
97
|
scrollTo: (index: number) => void;
|
|
98
98
|
}>;
|
|
@@ -130,9 +130,9 @@ export declare const PropsProvider: ({ createStore, children, }: {
|
|
|
130
130
|
<U>(selector: (state: ZustandT.InternalStore<DSShuttleV2T.InternalAtoms, DSShuttleV2T.Selectors, DSShuttleV2T.Reducers>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined): U;
|
|
131
131
|
};
|
|
132
132
|
export declare const config: {
|
|
133
|
-
defaultProps: DSShuttleV2T.InternalProps
|
|
133
|
+
defaultProps: DSShuttleV2T.InternalProps<object, object, object, object>;
|
|
134
134
|
internalAtomDefaultValues: DSShuttleV2T.InternalAtoms;
|
|
135
|
-
useAutoCalculated: (propsWithDefaults: DSShuttleV2T.InternalProps) => {
|
|
135
|
+
useAutoCalculated: <T extends object, H extends object, N extends object, K extends object>(propsWithDefaults: DSShuttleV2T.InternalProps<T, H, N, K>) => {
|
|
136
136
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
137
137
|
scrollTo: (index: number) => void;
|
|
138
138
|
}>;
|
|
@@ -166,7 +166,7 @@ export declare const config: {
|
|
|
166
166
|
reducers: ZustandT.ReducerObject<DSShuttleV2T.ShuttleInternalStore, DSShuttleV2T.Reducers>;
|
|
167
167
|
subscribers: ZustandT.Subscribers<DSShuttleV2T.ShuttleInternalStore>;
|
|
168
168
|
PropsProvider: ({ createStore, children, }: {
|
|
169
|
-
createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
169
|
+
createStore: () => ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
170
170
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
171
171
|
scrollTo: (index: number) => void;
|
|
172
172
|
}>;
|
|
@@ -197,7 +197,7 @@ export declare const config: {
|
|
|
197
197
|
sourceSelectionableIds: string;
|
|
198
198
|
}>>;
|
|
199
199
|
children: import("react").ReactNode;
|
|
200
|
-
}) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
200
|
+
}) => import("react").FunctionComponentElement<import("react").ProviderProps<ZustandT.ZustandStore<ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
201
201
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
202
202
|
scrollTo: (index: number) => void;
|
|
203
203
|
}>;
|
|
@@ -228,7 +228,7 @@ export declare const config: {
|
|
|
228
228
|
sourceSelectionableIds: string;
|
|
229
229
|
}>> | undefined>>;
|
|
230
230
|
usePropsStore: {
|
|
231
|
-
(): ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
231
|
+
(): ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
232
232
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
233
233
|
scrollTo: (index: number) => void;
|
|
234
234
|
}>;
|
|
@@ -258,7 +258,7 @@ export declare const config: {
|
|
|
258
258
|
sourceSelectionableDataIds: string[];
|
|
259
259
|
sourceSelectionableIds: string;
|
|
260
260
|
}>;
|
|
261
|
-
<U>(selector: (state: ZustandT.PropsStore<DSShuttleV2T.InternalProps & {
|
|
261
|
+
<U>(selector: (state: ZustandT.PropsStore<DSShuttleV2T.InternalProps<object, object, object, object> & {
|
|
262
262
|
destinationVirtualRef: import("react").MutableRefObject<{
|
|
263
263
|
scrollTo: (index: number) => void;
|
|
264
264
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { WeakValidationMap } from 'react';
|
|
2
2
|
import type { DSShuttleV2T } from '../react-desc-prop-types.js';
|
|
3
|
-
export declare const useValidateProps: (props: DSShuttleV2T.Props, propTypes: WeakValidationMap<unknown>) => void;
|
|
3
|
+
export declare const useValidateProps: <T extends object, H extends object, N extends object, K extends object>(props: DSShuttleV2T.Props<T, H, N, K>, propTypes: WeakValidationMap<unknown>) => void;
|
|
@@ -1,4 +1,76 @@
|
|
|
1
1
|
export declare const DSShuttleV2Name = "DSShuttlev2";
|
|
2
|
+
export declare const DSShuttleV2Slots: {
|
|
3
|
+
readonly HEADER_SEARCH_ICON: "header-search-icon";
|
|
4
|
+
readonly WRAPPER: "wrapper";
|
|
5
|
+
readonly PANEL_WRAPPER: "panel-wrapper";
|
|
6
|
+
readonly LIST_WRAPPER: "list-wrapper";
|
|
7
|
+
readonly ITEM_WRAPPER: "item-wrapper";
|
|
8
|
+
readonly ITEM_CHECKBOX: "item-checkbox";
|
|
9
|
+
readonly ITEM_ICON_WRAPPER: "item-icon-wrapper";
|
|
10
|
+
readonly ITEM_LABEL_WRAPPER: "item-label-wrapper";
|
|
11
|
+
readonly ITEM_MIDSECTION_WRAPPER: "item-midsection-wrapper";
|
|
12
|
+
readonly ITEM_SELECTION: "item-selection";
|
|
13
|
+
readonly ITEM_ACTIONS_WRAPPER: "item-actions-wrapper";
|
|
14
|
+
readonly ITEM_ACTION_WRAPPER: "item-action-wrapper";
|
|
15
|
+
readonly ITEM_ACTION_BTN: "item-action-btn";
|
|
16
|
+
readonly ITEM_ACTION_BTN_DRILLDOWN_ICON: "item-action-btn-drilldown-icon";
|
|
17
|
+
readonly ITEM_ACTION_BTN_TO_SOURCE_ICON: "item-action-btn-to-source-icon";
|
|
18
|
+
readonly ITEM_ACTION_BTN_TO_DESTINATION_ICON: "item-action-btn-to-destination-icon";
|
|
19
|
+
readonly LIST_BOTTOM_LOADING_MORE: "list-bottom-loading-more";
|
|
20
|
+
readonly LIST_BOTTOM_LOAD_MORE_BTN: "list-bottom-load-more-btn";
|
|
21
|
+
readonly LIST_WRAPPER_BOTTOM: "list-wrapper-bottom";
|
|
22
|
+
readonly EMPTY_LIST_WRAPPER: "empty-list-wrapper";
|
|
23
|
+
readonly ITEMS_WRAPPER: "items-wrapper";
|
|
24
|
+
readonly LOADING_LIST_WRAPPER: "loading-list-wrapper";
|
|
25
|
+
readonly MOVE_MULTIPLE_WRAPPER: "move-multiple-wrapper";
|
|
26
|
+
readonly MOVE_MULTIPLE_BTN: "move-multiple-btn";
|
|
27
|
+
readonly LIST_WRAPPER_MID: "list-wrapper-mid";
|
|
28
|
+
readonly LIST_WRAPPER_MID_SCROLLER: "list-wrapper-mid-scroller";
|
|
29
|
+
readonly LIST_WRAPPER_TOP: "list-wrapper-top";
|
|
30
|
+
readonly AREA_SEARCH_WRAPPER: "area-search-wrapper";
|
|
31
|
+
readonly AREA_SEARCH_BAR: "area-search-bar";
|
|
32
|
+
readonly AREA_SELECTION_HEADER: "area-selection-header";
|
|
33
|
+
readonly AREA_SELECTION_HEADER_COUNT_LABEL: "area-selection-header-count-label";
|
|
34
|
+
readonly DRAG_AND_DROP_HANDLE: "drag-and-drop-handle";
|
|
35
|
+
};
|
|
36
|
+
export declare const SHUTTLE_IDS: {
|
|
37
|
+
readonly SOURCE_PANEL_SEARCH: "ds-shuttle-v2-source-panel-search";
|
|
38
|
+
readonly DESTINATION_PANEL_SEARCH: "ds-shuttle-v2-destination-panel-search";
|
|
39
|
+
};
|
|
40
|
+
export declare const DSShuttleV2DataTestIds: {
|
|
41
|
+
readonly HEADER_SEARCH_ICON: "ds-shuttlev2-header-search-icon";
|
|
42
|
+
readonly WRAPPER: "ds-shuttlev2-wrapper";
|
|
43
|
+
readonly PANEL_WRAPPER: "ds-shuttlev2-panel-wrapper";
|
|
44
|
+
readonly LIST_WRAPPER: "ds-shuttlev2-list-wrapper";
|
|
45
|
+
readonly ITEM_WRAPPER: "ds-shuttlev2-item-wrapper";
|
|
46
|
+
readonly ITEM_CHECKBOX: "ds-shuttlev2-item-checkbox";
|
|
47
|
+
readonly ITEM_ICON_WRAPPER: "ds-shuttlev2-item-icon-wrapper";
|
|
48
|
+
readonly ITEM_LABEL_WRAPPER: "ds-shuttlev2-item-label-wrapper";
|
|
49
|
+
readonly ITEM_MIDSECTION_WRAPPER: "ds-shuttlev2-item-midsection-wrapper";
|
|
50
|
+
readonly ITEM_SELECTION: "ds-shuttlev2-item-selection";
|
|
51
|
+
readonly ITEM_ACTIONS_WRAPPER: "ds-shuttlev2-item-actions-wrapper";
|
|
52
|
+
readonly ITEM_ACTION_WRAPPER: "ds-shuttlev2-item-action-wrapper";
|
|
53
|
+
readonly ITEM_ACTION_BTN: "ds-shuttlev2-item-action-btn";
|
|
54
|
+
readonly ITEM_ACTION_BTN_DRILLDOWN_ICON: "ds-shuttlev2-item-action-btn-drilldown-icon";
|
|
55
|
+
readonly ITEM_ACTION_BTN_TO_SOURCE_ICON: "ds-shuttlev2-item-action-btn-to-source-icon";
|
|
56
|
+
readonly ITEM_ACTION_BTN_TO_DESTINATION_ICON: "ds-shuttlev2-item-action-btn-to-destination-icon";
|
|
57
|
+
readonly LIST_BOTTOM_LOADING_MORE: "ds-shuttlev2-list-bottom-loading-more";
|
|
58
|
+
readonly LIST_BOTTOM_LOAD_MORE_BTN: "ds-shuttlev2-list-bottom-load-more-btn";
|
|
59
|
+
readonly LIST_WRAPPER_BOTTOM: "ds-shuttlev2-list-wrapper-bottom";
|
|
60
|
+
readonly EMPTY_LIST_WRAPPER: "ds-shuttlev2-empty-list-wrapper";
|
|
61
|
+
readonly ITEMS_WRAPPER: "ds-shuttlev2-items-wrapper";
|
|
62
|
+
readonly LOADING_LIST_WRAPPER: "ds-shuttlev2-loading-list-wrapper";
|
|
63
|
+
readonly MOVE_MULTIPLE_WRAPPER: "ds-shuttlev2-move-multiple-wrapper";
|
|
64
|
+
readonly MOVE_MULTIPLE_BTN: "ds-shuttlev2-move-multiple-btn";
|
|
65
|
+
readonly LIST_WRAPPER_MID: "ds-shuttlev2-list-wrapper-mid";
|
|
66
|
+
readonly LIST_WRAPPER_MID_SCROLLER: "ds-shuttlev2-list-wrapper-mid-scroller";
|
|
67
|
+
readonly LIST_WRAPPER_TOP: "ds-shuttlev2-list-wrapper-top";
|
|
68
|
+
readonly AREA_SEARCH_WRAPPER: "ds-shuttlev2-area-search-wrapper";
|
|
69
|
+
readonly AREA_SEARCH_BAR: "ds-shuttlev2-area-search-bar";
|
|
70
|
+
readonly AREA_SELECTION_HEADER: "ds-shuttlev2-area-selection-header";
|
|
71
|
+
readonly AREA_SELECTION_HEADER_COUNT_LABEL: "ds-shuttlev2-area-selection-header-count-label";
|
|
72
|
+
readonly DRAG_AND_DROP_HANDLE: "ds-shuttlev2-drag-and-drop-handle";
|
|
73
|
+
};
|
|
2
74
|
export declare const REGIONS_FOCUSES: {
|
|
3
75
|
readonly SOURCE_HEADER: "source-header";
|
|
4
76
|
readonly SOURCE_PANEL: "source-panel";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DSShuttleV2Name, DSShuttleV2Slots, DSShuttleV2DataTestIds } from './
|
|
1
|
+
export { DSShuttleV2Name, DSShuttleV2Slots, DSShuttleV2DataTestIds } from './constants/index.js';
|
|
2
2
|
export { DSShuttleV2, DSShuttleV2WithSchema } from './DSShuttleV2.js';
|
|
3
3
|
export { ShuttleItem, type ShuttleItemProps } from './exported-related/index.js';
|
|
4
4
|
export { type DSShuttleV2T } from './react-desc-prop-types.js';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type DSShuttleV2T } from '../../../../react-desc-prop-types.js';
|
|
3
3
|
export declare const useGetDatumHydratables: (panelMetaInfo: DSShuttleV2T.PanelMetaInfo) => (item: DSShuttleV2T.ConfiguredDatum) => {
|
|
4
4
|
preventDrilldown?: boolean | undefined;
|
|
5
|
-
CustomRenderer?: React.ComponentType<DSShuttleV2T.ComponentProps> | undefined;
|
|
5
|
+
CustomRenderer?: React.ComponentType<DSShuttleV2T.ComponentProps> | null | undefined;
|
|
6
6
|
Icon?: React.ComponentType<DSShuttleV2T.ComponentProps> | undefined;
|
|
7
7
|
subtitle?: string | undefined;
|
|
8
8
|
id: string;
|
|
@@ -7,7 +7,7 @@ import type { GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/d
|
|
|
7
7
|
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
8
8
|
import type { ZustandT } from '@elliemae/ds-zustand-helpers';
|
|
9
9
|
import type React from 'react';
|
|
10
|
-
import { DSShuttleV2Name, DSShuttleV2Slots } from './
|
|
10
|
+
import { DSShuttleV2Name, DSShuttleV2Slots } from './constants/index.js';
|
|
11
11
|
import type { useAutoCalculated } from './config/useAutoCalculated/index.js';
|
|
12
12
|
import type { ACTIONS_FOCUSES, DropIndicatorPosition, ITEMS_FOCUSES, REGIONS_FOCUSES } from './constants/index.js';
|
|
13
13
|
export declare namespace DSShuttleV2T {
|
|
@@ -66,7 +66,7 @@ export declare namespace DSShuttleV2T {
|
|
|
66
66
|
type RequiredDatumHydratablesComponents = {};
|
|
67
67
|
type OptionalDatumHydratablesComponents = {
|
|
68
68
|
Icon?: React.ComponentType<ComponentProps>;
|
|
69
|
-
CustomRenderer?: React.ComponentType<ComponentProps
|
|
69
|
+
CustomRenderer?: React.ComponentType<ComponentProps> | null;
|
|
70
70
|
};
|
|
71
71
|
type RequiredDatumHydratables = RequiredDatumHydratablesWithoutComponents & RequiredDatumHydratablesComponents;
|
|
72
72
|
type OptionalDatumHydratables = OptionalDatumHydratablesWithoutComponents & OptionalDatumHydratablesComponents;
|
|
@@ -102,7 +102,7 @@ export declare namespace DSShuttleV2T {
|
|
|
102
102
|
item?: Datum;
|
|
103
103
|
selectedItems?: Datum[];
|
|
104
104
|
}) => void;
|
|
105
|
-
type OnChangeEvent = (items:
|
|
105
|
+
type OnChangeEvent<T> = (items: T, metainfo: {
|
|
106
106
|
event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;
|
|
107
107
|
}) => void;
|
|
108
108
|
type OnReorderEventMetadata = Omit<DnDKitTree.OnReorder<DSShuttleV2T.Datum>, 'considerExpanding'>;
|
|
@@ -112,11 +112,11 @@ export declare namespace DSShuttleV2T {
|
|
|
112
112
|
event: Parameters<Required<DSButtonT.Props>['onClick']>[0] | Parameters<DSControlledCheckboxT.InternalProps['onChange']>[1] | React.MouseEvent<HTMLButtonElement | HTMLDivElement> | React.KeyboardEvent<HTMLDivElement> | React.ChangeEvent<HTMLInputElement>;
|
|
113
113
|
item?: Datum;
|
|
114
114
|
}) => void;
|
|
115
|
-
type OnSelectionDrilldown = (item:
|
|
115
|
+
type OnSelectionDrilldown<T> = (item: T, metainfo: {
|
|
116
116
|
event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>;
|
|
117
117
|
}) => void;
|
|
118
118
|
type OnLoadMore = (e: Parameters<Required<DSButtonT.Props>['onClick']>[0]) => void;
|
|
119
|
-
type OnFilterChange = (newfilter: string
|
|
119
|
+
type OnFilterChange = (newfilter: string, metainfo: {
|
|
120
120
|
event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>;
|
|
121
121
|
}) => void;
|
|
122
122
|
type OnSearchbarOpen = (newfilter: boolean, metainfo: {
|
|
@@ -143,6 +143,7 @@ export declare namespace DSShuttleV2T {
|
|
|
143
143
|
isDropValid: boolean;
|
|
144
144
|
sourcePanelLastSelectedItem: string | null | undefined;
|
|
145
145
|
destinationPanelLastSelectedItem: string | null | undefined;
|
|
146
|
+
shuttleInternalId: string;
|
|
146
147
|
};
|
|
147
148
|
type UseAutoCalculatedT = ReturnType<typeof useAutoCalculated>;
|
|
148
149
|
type Selectors = {
|
|
@@ -151,19 +152,19 @@ export declare namespace DSShuttleV2T {
|
|
|
151
152
|
};
|
|
152
153
|
type Reducers = Record<string, never>;
|
|
153
154
|
type ShuttleInternalStore = ZustandT.InternalStore<InternalAtoms, Selectors, Reducers>;
|
|
154
|
-
interface RequiredProps extends RequiredDatumHydraters, PrimaryKeyHydraters {
|
|
155
|
+
interface RequiredProps<T, H, K> extends RequiredDatumHydraters, PrimaryKeyHydraters {
|
|
155
156
|
sourceData: Datum[];
|
|
156
157
|
sourceSelectedItems: SelectionMap;
|
|
157
158
|
onSourceSelectionChange: OnSelectionChange;
|
|
158
|
-
SourceHeader: React.ComponentType<
|
|
159
|
-
onSourceDrilldown: OnSelectionDrilldown
|
|
159
|
+
SourceHeader: React.ComponentType<T>;
|
|
160
|
+
onSourceDrilldown: OnSelectionDrilldown<K>;
|
|
160
161
|
destinationData: Datum[];
|
|
161
162
|
destinationSelectedItems: SelectionMap;
|
|
162
163
|
onDestinationSelectionChange: OnSelectionChange;
|
|
163
|
-
DestinationHeader: React.ComponentType<
|
|
164
|
-
onDestinationDrilldown: OnSelectionDrilldown
|
|
164
|
+
DestinationHeader: React.ComponentType<H>;
|
|
165
|
+
onDestinationDrilldown: OnSelectionDrilldown<K>;
|
|
165
166
|
}
|
|
166
|
-
interface DefaultProps extends Required<FunctionalHydraters> {
|
|
167
|
+
interface DefaultProps<T> extends Required<FunctionalHydraters> {
|
|
167
168
|
sourceIsLoading: boolean;
|
|
168
169
|
sourceWithLoadMore: boolean;
|
|
169
170
|
sourceIsLoadingMore: boolean;
|
|
@@ -174,10 +175,10 @@ export declare namespace DSShuttleV2T {
|
|
|
174
175
|
onDestinationLoadMore: OnLoadMore;
|
|
175
176
|
destinationNoOptionsMessage: string;
|
|
176
177
|
sourceNoOptionsMessage: string;
|
|
177
|
-
onSourceAdd: OnChangeEvent
|
|
178
|
-
onSourceRemove: OnChangeEvent
|
|
179
|
-
onDestinationAdd: OnChangeEvent
|
|
180
|
-
onDestinationRemove: OnChangeEvent
|
|
178
|
+
onSourceAdd: OnChangeEvent<T>;
|
|
179
|
+
onSourceRemove: OnChangeEvent<T>;
|
|
180
|
+
onDestinationAdd: OnChangeEvent<T>;
|
|
181
|
+
onDestinationRemove: OnChangeEvent<T>;
|
|
181
182
|
addDragAndDropFromSource: boolean;
|
|
182
183
|
removeDragAndDropFromDestination: boolean;
|
|
183
184
|
onSourceReorder: OnReorderEvent;
|
|
@@ -212,10 +213,10 @@ export declare namespace DSShuttleV2T {
|
|
|
212
213
|
dsShuttleV2ListWrapperMid?: (metaInfo: PanelMetaInfo) => Record<string, unknown>;
|
|
213
214
|
areaSearchBarProps?: (metaInfo: PanelMetaInfo) => DSInputTextT.Props;
|
|
214
215
|
}
|
|
215
|
-
interface Props extends Partial<DefaultProps
|
|
216
|
+
interface Props<T, H, N, K> extends Partial<DefaultProps<N>>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps<N> | keyof OptionalProps | keyof RequiredProps<T, H, K>>, XstyledProps, RequiredProps<T, H, K> {
|
|
216
217
|
}
|
|
217
|
-
interface InternalProps extends DefaultProps
|
|
218
|
+
interface InternalProps<T, H, N, K> extends DefaultProps<N>, OptionalProps, Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps<N> | keyof OptionalProps | keyof RequiredProps<T, H, K>>, XstyledProps, RequiredProps<T, H, K> {
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
|
-
export declare const defaultProps: DSShuttleV2T.DefaultProps
|
|
221
|
-
export declare const DSShuttleV2PropTypesSchema: ValidationMap<DSShuttleV2T.Props
|
|
221
|
+
export declare const defaultProps: DSShuttleV2T.DefaultProps<object>;
|
|
222
|
+
export declare const DSShuttleV2PropTypesSchema: ValidationMap<DSShuttleV2T.Props<object, object, object, object>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function ControlledTestRender(): import("react/jsx-runtime").JSX.Element;
|