import { ID } from "../../types/index.mjs"; import { ComputedRef, MaybeRefOrGetter, Ref } from "vue"; //#region src/composables/createDataGrid/spanning.d.ts interface SpanEntry { rowSpan: number; hidden: boolean; } /** * Options for {@link createRowSpanning}. * * @template T Row value type. * * @example * ```ts * const options: RowSpanningOptions = { * items: computed(() => grid.items.value), * columns: ['group', 'ticker', 'value'], * span: (item, column) => column === 'group' ? 3 : 1, * } * ``` */ interface RowSpanningOptions> { items: Ref | ComputedRef; columns: MaybeRefOrGetter; /** * Projects the row key from its item and index. Takes precedence over * `itemKey` — the grid passes the registry ticket id so the span map shares * identity with the rest of the grid. Rows whose projected key is * `undefined` are skipped, since their spans can't be addressed. */ key?: (item: T, index: number) => ID | undefined; /** * Property used to identify each row in the span map when `key` is absent. * Rows whose value for this key is `undefined` are skipped, since their * spans can't be addressed. */ itemKey?: string; /** * Resolves the row span for a cell. Return a value < 1 (or `NaN`) to span a * single row. When absent, no spans are produced. */ span?: (item: T, column: string) => number; } //#endregion export { RowSpanningOptions, SpanEntry };