Skip to main content

TreeConfig <T>

Hierarchy

  • TreeConfigType<T>
    • TreeConfig

Index

Properties

optionalasyncDataLoader

asyncDataLoader?: AsyncTreeDataLoader<T>

optionalbottomLinePercentage

bottomLinePercentage?: number

optionalcanDrag

canDrag?: (items: ItemInstance<T>[]) => boolean

Type declaration

optionalcanDrop

canDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => boolean

Type declaration

optionalcanDropForeignDragObject

canDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => boolean

Type declaration

    • (dataTransfer: DataTransfer, target: DropTarget<T>): boolean
    • Parameters

      Returns boolean

optionalcanDropInbetween

canDropInbetween?: boolean

optionalcanRename

canRename?: (item: ItemInstance<T>) => boolean

Type declaration

optionalcreateForeignDragObject

createForeignDragObject?: (items: ItemInstance<T>[]) => { data: any; format: string }

Type declaration

    • Parameters

      Returns { data: any; format: string }

      • data: any
      • format: string

optionalcreateLoadingItemData

createLoadingItemData?: () => T

Type declaration

    • (): T
    • Returns T

optionaldataLoader

dataLoader?: SyncTreeDataLoader<T>

optionalfeatures

features?: FeatureImplementation<any>[]

getItemName

getItemName: (item: ItemInstance<T>) => string

Type declaration

optionalhotkeys

hotkeys?: Partial<Record<`custom${string}` | focusNextItem | focusPreviousItem | expandOrDown | collapseOrUp | focusFirstItem | focusLastItem | toggleSelectItem | selectUpwards | selectDownwards | selectUpwardsCtrl | selectDownwardsCtrl | selectAll | openSearch | closeSearch | submitSearch | nextSearchItem | previousSearchItem | renameItem | abortRenaming | completeRenaming, Partial<HotkeyConfig<T>>>>

optionalinitialState

initialState?: Partial<TreeState<any>>

optionalinstanceBuilder

instanceBuilder?: InstanceBuilder

optionalisItemDraggable

isItemDraggable?: (item: ItemInstance<T>) => boolean

Type declaration

isItemFolder

isItemFolder: (item: ItemInstance<T>) => boolean

Type declaration

optionalisSearchMatchingItem

isSearchMatchingItem?: (search: string, item: ItemInstance<T>) => boolean

Type declaration

optionalonCloseSearch

onCloseSearch?: () => void

Type declaration

    • (): void
    • Returns void

optionalonCompleteForeignDrop

onCompleteForeignDrop?: (items: ItemInstance<T>[]) => void

Runs in the onDragEnd event, if ev.dataTransfer.dropEffect is not none, i.e. the drop was not aborted. No target is provided as parameter since the target may be a foreign drop target. This is useful to seperate out the logic to move dragged items out of their previous parents. Use onDrop to handle drop-related logic.

This ignores the canDrop handler, since the drop target is unknown in this handler.


Type declaration

optionalonDrop

onDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => void

Type declaration

optionalonDropForeignDragObject

onDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => void

Type declaration

    • (dataTransfer: DataTransfer, target: DropTarget<T>): void
    • Parameters

      Returns void

optionalonItemHotkey

onItemHotkey?: (name: string, item: ItemInstance<T>, element: HTMLElement) => void

Type declaration

    • (name: string, item: ItemInstance<T>, element: HTMLElement): void
    • Parameters

      Returns void

optionalonLoadedChildren

onLoadedChildren?: (itemId: string, childrenIds: string[]) => void

Type declaration

    • (itemId: string, childrenIds: string[]): void
    • Parameters

      • itemId: string
      • childrenIds: string[]

      Returns void

optionalonLoadedItem

onLoadedItem?: (itemId: string, item: T) => void

Type declaration

    • (itemId: string, item: T): void
    • Parameters

      • itemId: string
      • item: T

      Returns void

optionalonOpenSearch

onOpenSearch?: () => void

Type declaration

    • (): void
    • Returns void

optionalonPrimaryAction

onPrimaryAction?: (item: ItemInstance<T>) => void

Type declaration

optionalonRename

onRename?: (item: ItemInstance<T>, value: string) => void

Type declaration

optionalonSearchMatchesItems

onSearchMatchesItems?: (search: string, items: ItemInstance<T>[]) => void

Type declaration

optionalonTreeHotkey

onTreeHotkey?: (name: string, element: HTMLElement) => void

Type declaration

    • (name: string, element: HTMLElement): void
    • Parameters

      • name: string
      • element: HTMLElement

      Returns void

rootItemId

rootItemId: string

optionalscrollToItem

scrollToItem?: (item: ItemInstance<T>) => void

Type declaration

optionalsetDndState

setDndState?: SetStateFn<null | DndState<T>>

optionalsetExpandedItems

setExpandedItems?: SetStateFn<string[]>

optionalsetFocusedItem

setFocusedItem?: SetStateFn<null | string>

optionalsetLoadingItems

setLoadingItems?: SetStateFn<string[]>

optionalsetRenamingItem

setRenamingItem?: SetStateFn<null | string>

optionalsetRenamingValue

setRenamingValue?: SetStateFn<undefined | string>

optionalsetSearch

setSearch?: SetStateFn<null | string>

optionalsetSelectedItems

setSelectedItems?: SetStateFn<string[]>

optionalsetState

setState?: SetStateFn<TreeState<any>>

optionalstate

state?: Partial<TreeState<any>>

optionaltopLinePercentage

topLinePercentage?: number