Skip to main content

TreeConfig <T>

Hierarchy

  • TreeConfigType<T>
    • TreeConfig

Index

Properties

optionalcanCheckFolders

canCheckFolders?: boolean

optionalcanDrag

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

Type declaration

optionalcanDragForeignDragObjectOver

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

Checks if a droppable visualization should be displayed when dragging a foreign object over a target. Since this is executed on a dragover event, dataTransfer.getData() is not available, so dataTransfer.effectAllowed or dataTransfer.types should be used instead. Before actually completing the drag, @{link canDropForeignDragObject} will be called by HT before applying the drop.


Type declaration

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

      Returns boolean

optionalcanDrop

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

Type declaration

optionalcanDropForeignDragObject

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

Checks if a foreign drag object can be dropped on a target, validating that an actual drop can commence based on the data in the DataTransfer object.


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; dropEffect?: none | copy | link | move; effectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized; format: string }

Type declaration

    • (items: ItemInstance<T>[]): { data: any; dropEffect?: none | copy | link | move; effectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized; format: string }
    • Parameters

      Returns { data: any; dropEffect?: none | copy | link | move; effectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized; format: string }

      • data: any
      • optionaldropEffect?: none | copy | link | move
      • optionaleffectAllowed?: none | copy | link | move | copyLink | copyMove | linkMove | all | uninitialized
      • 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>>>>

optionalignoreHotkeysOnInputs

ignoreHotkeysOnInputs?: boolean

Do not handle key inputs while an HTML input element is focused

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

optionalopenOnDropDelay

openOnDropDelay?: number

When dragging for this many ms on a closed folder, the folder will automatically open. Set to zero to disable.

optionalpropagateCheckedState

propagateCheckedState?: boolean

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>

optionalsetCheckedItems

setCheckedItems?: SetStateFn<string[]>

optionalsetDndState

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

optionalsetDragImage

setDragImage?: (items: ItemInstance<T>[]) => { imgElement: Element; xOffset?: number; yOffset?: number }

Type declaration

    • (items: ItemInstance<T>[]): { imgElement: Element; xOffset?: number; yOffset?: number }
    • Parameters

      Returns { imgElement: Element; xOffset?: number; yOffset?: number }

      • imgElement: Element
      • optionalxOffset?: number
      • optionalyOffset?: number

optionalsetExpandedItems

setExpandedItems?: SetStateFn<string[]>

optionalsetFocusedItem

setFocusedItem?: SetStateFn<null | string>

optionalsetLoadingCheckPropagationItems

setLoadingCheckPropagationItems?: SetStateFn<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>>