View as Markdown

API reference: @salmonui/data-grid

DataGridEditorPropsinterface

import type { DataGridEditorProps } from '@salmonui/data-grid';
interface DataGridEditorProps {
    readonly options?: readonly (string | number | boolean | DataGridEditorOption)[];
    readonly placeholder?: string;
    readonly min?: string | number;
    readonly max?: string | number;
    readonly step?: string | number;
    readonly minLength?: number;
    readonly maxLength?: number;
    readonly autoComplete?: string;
    readonly spellCheck?: boolean;
    readonly multiline?: boolean;
    readonly firstDayOfWeek?: number;
    readonly calendar?: string;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly [key: string]: unknown;
}

Props of the built-in editors (column editorProps). Unknown keys are ignored.

DataGridEditorProps members (14)
NameSignatureDescription
optionsoptionalreadonly options?: readonly (string | number | boolean | DataGridEditorOption)[];

select: options; values are primitives or { value, label }. Lookup columns default to their local lookup rows.

placeholderoptionalreadonly placeholder?: string;

select: label of an empty first option (clears the value).

minoptionalreadonly min?: string | number;

number: the smallest and largest value: ArrowUp / ArrowDown stop there, and a typed plain number outside the range is clamped when the editor commits (Enter, Tab) or loses focus; also aria-valuemin / aria-valuemax. date / datetime: the earliest and latest day the date picker offers (days outside are disabled; typed text is not clamped). The text editor has no value range: use minLength / maxLength.

maxoptionalreadonly max?: string | number;
stepoptionalreadonly step?: string | number;

number: the ArrowUp / ArrowDown increment (default 1).

minLengthoptionalreadonly minLength?: number;

text: native minlength / maxlength of the input or textarea.

maxLengthoptionalreadonly maxLength?: number;
autoCompleteoptionalreadonly autoComplete?: string;
spellCheckoptionalreadonly spellCheck?: boolean;
multilineoptionalreadonly multiline?: boolean;

text: <textarea> instead of <input>.

firstDayOfWeekoptionalreadonly firstDayOfWeek?: number;

date / datetime: first day of the calendar week, 0 Sunday ... 6 Saturday. Default: from locale.

calendaroptionalreadonly calendar?: string;

date / datetime: Intl calendar of the picker labels ('japanese', 'buddhist', 'islamic-umalqura', ...). Default: the locale calendar.

classNameoptionalreadonly className?: string;
styleoptionalreadonly style?: CSSProperties;