import IdsCheckbox from '../ids-checkbox/ids-checkbox'; import IdsDropdown from '../ids-dropdown/ids-dropdown'; import IdsDropdownList from '../ids-dropdown/ids-dropdown-list'; import IdsInput from '../ids-input/ids-input'; import IdsTriggerField from '../ids-trigger-field/ids-trigger-field'; import type IdsButton from '../ids-button/ids-button'; import type IdsDataGridCell from './ids-data-grid-cell'; import type IdsDatePicker from '../ids-date-picker/ids-date-picker'; import type IdsDatePickerPopup from '../ids-date-picker/ids-date-picker-popup'; import type IdsLookup from '../ids-lookup/ids-lookup'; import type IdsModal from '../ids-modal/ids-modal'; import type IdsTimePicker from '../ids-time-picker/ids-time-picker'; import type IdsTimePickerPopup from '../ids-time-picker/ids-time-picker-popup'; import type IdsMultiselect from '../ids-multiselect/ids-multiselect'; import '../ids-time-picker/ids-time-picker'; import '../ids-date-picker/ids-date-picker'; import '../ids-lookup/ids-lookup'; import '../ids-multiselect/ids-multiselect'; import { IdsDropdownOptions } from '../ids-dropdown/ids-dropdown-common'; export interface IdsDataGridEditorOptions { /** The type of editor (i.e. text, data, time, dropdown, checkbox, number ect) */ type: string; /** The field in the data set to show */ field: string; /** If true the editor will remain visible */ inline: boolean; } export interface IdsDataGridSaveValue { value?: string | number | boolean | null | IdsDropdownOptions; dirtyCheckValue?: string | number | boolean | null | IdsDropdownOptions; } export interface IdsDataGridEditor { /** The type of editor (i.e. input, dropdown, checkbox ect) */ type: string; /** The main editor element */ input?: IdsInput | IdsCheckbox | IdsDropdown | IdsDatePicker | IdsTimePicker | IdsLookup; /** Optional Popup interface for some cell types */ popup?: IdsDatePickerPopup | IdsTimePickerPopup | IdsModal; /** The function that invokes and sets values on the input */ init: (cell?: IdsDataGridCell) => void; /** Optional callback function that runs after the editor initialization is complete */ onEndCellEdit?: (cell?: IdsDataGridCell) => void; /** The function that transforms and saved the editor */ save: (cell?: IdsDataGridCell) => IdsDataGridSaveValue | undefined | null; /** The function that tears down all aspects of the editor */ destroy: (cell?: IdsDataGridCell) => void; /** MouseEvent if click was used to edit */ clickEvent?: MouseEvent; /** The function that returns the input-element's value */ value: () => boolean | number | string; /** The function that changes the input-element's value */ change: (newValue: boolean | number | string) => void; } export declare class InputEditor implements IdsDataGridEditor { /** The type of editor (i.e. input, dropdown, checkbox ect) */ type: string; /** Holds the Editor */ input?: IdsInput; /** * Create an input and set the value and focus states * @param {IdsDataGridCell} cell the cell element */ init(cell?: IdsDataGridCell): void; save(): { value: string | undefined; }; destroy(): void; value(): string; change(newValue: boolean | number | string): void; } /** * Password Input Editor for IDS Data Grid * Shows masked input with revealed last characters and toggle button */ export declare class PasswordInputEditor extends InputEditor { #private; type: string; /** * Create a password input and set the value and focus states * @param {IdsDataGridCell} cell the cell element */ init(cell?: IdsDataGridCell): void; /** * Transform the value for saving * @returns {IdsDataGridSaveValue} The value to save */ save(): { value: string | undefined; }; /** * Destroy the editor */ destroy(): void; } export declare class CheckboxEditor implements IdsDataGridEditor { #private; /** The type of editor (i.e. input, dropdown, checkbox ect) */ type: string; /** Holds the Editor */ input?: IdsCheckbox; /** MouseEvent if click was used to edit */ clickEvent?: MouseEvent; /** * Create an input and set the value and focus states * @param {IdsDataGridCell} cell the cell element */ init(cell?: IdsDataGridCell): void; save(): { value: any; }; destroy(): void; value(): boolean; change(newValue: boolean | number | string): void; } export declare class DropdownEditor implements IdsDataGridEditor { #private; /** The type of editor (i.e. input, dropdown, checkbox ect) */ type: string; /** Holds the Editor */ input?: IdsDropdown; /** Holds the separate Dropdown List */ list?: IdsDropdownList; /** MouseEvent if click was used to edit */ clickEvent?: MouseEvent; init(cell?: IdsDataGridCell): Promise; /** * Overrides data grid cell's focusout event handling * @param {FocusEvent} evt focus event */ stopPropagation(evt: FocusEvent): void; save(): { value: string | null | undefined; dirtyCheckValue: string | null | undefined; }; /** * Destroy dropdown editor */ destroy(): void; value(): string; change(newValue: boolean | number | string): void; } export declare class DatePickerEditor implements IdsDataGridEditor { #private; type: string; input?: IdsTriggerField; popup?: IdsDatePickerPopup; clickEvent?: MouseEvent; init(cell?: IdsDataGridCell): void; save(cell?: IdsDataGridCell): { value: string; dirtyCheckValue: string; }; destroy(): void; value(): string; change(newValue: boolean | number | string): void; } export declare class TimePickerEditor implements IdsDataGridEditor { #private; type: string; input?: IdsTriggerField; popup?: IdsTimePickerPopup; clickEvent?: MouseEvent; init(cell?: IdsDataGridCell | undefined): void; save(cell?: IdsDataGridCell): { value: string; dirtyCheckValue: string; }; destroy(): void; value(): string; change(newValue: boolean | number | string): void; } export declare class TreeEditor extends InputEditor { #private; expandButton?: IdsButton; fieldContainer?: HTMLElement; /** * Adds extra button element for mimicking the tree formatter's display * @param {IdsDataGridCell} cell the cell element */ init(cell?: IdsDataGridCell): void; destroy(): void; } export declare class MultiselectEditor implements IdsDataGridEditor { #private; type: string; input?: IdsMultiselect; clickEvent?: MouseEvent; init(cell?: IdsDataGridCell): Promise; onEndCellEdit(cell?: IdsDataGridCell): void; save(): { value: { value: string; label: string; }[]; dirtyCheckValue: { value: string; label: string; }[]; }; destroy(): void; value(): any; change(newValue: boolean | number | string): void; } export declare class LookupEditor implements IdsDataGridEditor { type: string; input?: IdsLookup; popup?: IdsModal; clickEvent?: MouseEvent; /** * Create an input and set the value and focus states * @param {IdsDataGridCell} cell the cell element */ init(cell?: IdsDataGridCell): void; value(): string; change(newValue: boolean | number | string): void; save(): IdsDataGridSaveValue | undefined | null; destroy(): void; } export declare const editors: Array<{ type: string; editor?: IdsDataGridEditor; }>;