Skip to main content

TreeConfig <T>

Hierarchy

  • TreeConfigType<T>
    • TreeConfig

Index

Properties

optionalcanDrag

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

Type declaration

optionalcanDrop

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

Type declaration

optionalcanDropForeignDragObject

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

Type declaration

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

      Returns boolean

optionalcanRename

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

Type declaration

optionalcanReorder

canReorder?: boolean

optionalcreateForeignDragObject

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

Type declaration

    • Parameters

      Returns { data: any; format: string }

      • data: any
      • format: string

optionalcreateLoadingItemData

createLoadingItemData?: () => T

Will be called when HT retrieves item data for an item whose item data is asynchronously being loaded. Can be used to create placeholder data to use for rendering the tree item while it is loaded. If not defined, the tree item data will be null.


Type declaration

    • (): T
    • Returns T

dataLoader

dataLoader: TreeDataLoader<T>

optionalfeatures

features?: FeatureImplementation<any>[]

getItemName

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

Type declaration

optionalhotkeys

hotkeys?: Partial<Record<expandSelected | collapseSelected | focusNextItem | focusPreviousItem | expandOrDown | collapseOrUp | focusFirstItem | focusLastItem | toggleSelectedItem | selectUpwards | selectDownwards | selectAll | startDrag | cancelDrag | completeDrag | dragUp | dragDown | openSearch | closeSearch | submitSearch | nextSearchItem | previousSearchItem | renameItem | abortRenaming | completeRenaming | `custom${string}`, Partial<HotkeyConfig<T>>>>

optionalindent

indent?: number

optionalinitialState

initialState?: Partial<TreeState<T>>

optionalinstanceBuilder

instanceBuilder?: InstanceBuilder

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

Type declaration

optionalonDrop

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

Type declaration

optionalonDropForeignDragObject

onDropForeignDragObject?: (dataTransfer: DataTransfer, target: DragTarget<T>) => void | Promise<void>

Type declaration

    • (dataTransfer: DataTransfer, target: DragTarget<T>): void | Promise<void>
    • Parameters

      Returns void | Promise<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

optionalonStartKeyboardDrag

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

Type declaration

optionalonTreeHotkey

onTreeHotkey?: (name: string, e: KeyboardEvent) => void

Type declaration

    • (name: string, e: KeyboardEvent): void
    • Parameters

      • name: string
      • e: KeyboardEvent

      Returns void

optionalreorderAreaPercentage

reorderAreaPercentage?: number

Defines the size of the area at the top and bottom of an item where, when an item is dropped, the item willö be placed above or below the item within the same parent, as opposed to being placed inside the item. If canReorder is false, this is ignored.

rootItemId

rootItemId: string

optionalscrollToItem

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

Type declaration

optionalsetAssistiveDndState

setAssistiveDndState?: SetStateFn<undefined | null | AssistiveDndState>

optionalsetDndState

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

optionalsetExpandedItems

setExpandedItems?: SetStateFn<string[]>

optionalsetFocusedItem

setFocusedItem?: SetStateFn<null | string>

optionalsetLoadingItemChildrens

setLoadingItemChildrens?: SetStateFn<string[]>

optionalsetLoadingItemData

setLoadingItemData?: SetStateFn<string[]>

optionalsetRenamingItem

setRenamingItem?: SetStateFn<undefined | null | string>

optionalsetRenamingValue

setRenamingValue?: SetStateFn<undefined | string>

optionalsetSearch

setSearch?: SetStateFn<null | string>

optionalsetSelectedItems

setSelectedItems?: SetStateFn<string[]>

optionalsetState

setState?: SetStateFn<Partial<TreeState<T>>>

optionalstate

state?: Partial<TreeState<T>>