UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

64 lines (63 loc) 4.03 kB
import { BarStyleCellTextHorizontalAlignment, BarStyleCellTextLayout, BarStyleCellTextPlacement, BarStyleCellTextProperties, BarStyleCellTextVerticalAlignment } from '../../../AdaptableState/StyledColumns/Common/BarStyleProperties'; import { CellTextOption, CellTextOptions } from '../../../AdaptableState/StyledColumns/Common/CellTextOptions'; export type BarStyleCellTextLabels = { cellValue?: string; percentage?: string; }; export declare const resolveBarStyleCellTextLayout: (props: BarStyleCellTextProperties | undefined) => BarStyleCellTextLayout; /** True when any value is configured for display. */ export declare const hasBarStyleCellTextConfigured: (props: BarStyleCellTextProperties | undefined) => boolean; /** Set of value tokens that currently have a placement. */ export declare const getActiveBarStyleCellTextTokens: (props: BarStyleCellTextProperties | undefined) => CellTextOptions; export declare const mergeBarStyleCellTextProperties: (current: BarStyleCellTextProperties | undefined, patch: Partial<BarStyleCellTextProperties>) => BarStyleCellTextProperties | undefined; /** * Set or clear a value's placement. Passing `placement: undefined` removes the value. */ export declare const setBarStyleCellTextPlacement: (current: BarStyleCellTextProperties | undefined, token: CellTextOption, placement: BarStyleCellTextPlacement | undefined) => BarStyleCellTextProperties | undefined; /** * Patch a single axis of a value's placement (creating the value with defaults if * needed). Used by the wizard's placement pickers. */ export declare const patchBarStyleCellTextPlacement: (current: BarStyleCellTextProperties | undefined, token: CellTextOption, patch: Partial<BarStyleCellTextPlacement>) => BarStyleCellTextProperties | undefined; /** * Toggle whether a value is displayed. When turning on a previously-hidden * value we use the default placement (Left / Below). */ export declare const toggleBarStyleCellTextToken: (current: BarStyleCellTextProperties | undefined, token: CellTextOption, show: boolean) => { CellTextProperties: BarStyleCellTextProperties | undefined; }; export declare const buildBarStyleCellTextLabels: (props: BarStyleCellTextProperties | undefined, cellValueLabel: string | undefined, percentageLabel: string | undefined) => BarStyleCellTextLabels; export declare const hasBarStyleCellTextLabels: (labels: BarStyleCellTextLabels) => boolean; /** Join active labels with a space, Cell Value first then Percent Value. */ export declare const joinBarStyleCellTextLabels: (labels: BarStyleCellTextLabels) => string; export type BarStyleCellTextSlotEntry = { vertical: BarStyleCellTextVerticalAlignment; horizontal: BarStyleCellTextHorizontalAlignment; /** Labels in render order (Cell Value first, then Percent Value). */ parts: string[]; /** The joined text, ready to render. */ text: string; }; /** * Resolve which placements are populated and what text goes in each cell of * the 3 × 3 grid. Empty slots are omitted. Two values landing on the same * (vertical, horizontal) slot are concatenated with a single space, Cell * Value before Percent Value. */ export declare const resolveBarStyleCellTextSlots: (props: BarStyleCellTextProperties | undefined, labels: BarStyleCellTextLabels) => BarStyleCellTextSlotEntry[]; export type BarStyleCellTextSlotPresence = { hasAbove: boolean; hasBelow: boolean; hasMerged: boolean; }; export declare const getBarStyleCellTextSlotPresence: (props: BarStyleCellTextProperties | undefined) => BarStyleCellTextSlotPresence; export declare const formatBarStyleCellTextLayoutSummary: (layout: BarStyleCellTextLayout) => string | undefined; export type MountBarStyleCellTextArgs = { wrapperEl: HTMLElement; mergedOverlayEl?: HTMLElement; textClassName: string; cellTextProperties?: BarStyleCellTextProperties; labels: BarStyleCellTextLabels; mergedPointerEventsNone?: boolean; }; export declare const mountBarStyleCellText: (args: MountBarStyleCellTextArgs) => void;