@blinkk/selective-edit
Version:
Selective structured text editor.
58 lines (57 loc) • 2.69 kB
TypeScript
import { ColorsConfig, Option } from '../../mixins/option';
import { Field, FieldConfig } from '../field';
import { GlobalConfig, SelectiveEditor } from '../editor';
import { TemplateResult } from 'lit-html';
import { DeepObject } from '../../utility/deepObject';
import { Types } from '../types';
export interface CheckboxFieldConfig extends FieldConfig {
/**
* Color for the color hint.
*/
color?: string;
/**
* Gradient color hint.
*/
gradient?: ColorsConfig;
/**
* Value when checked. If not defined the value is true when
* the checkbox is checked.
*/
value?: any;
/**
* Value when the field is not checked.
*/
valueUnchecked?: any;
}
declare const CheckboxField_base: {
new (...args: any[]): {
ariaLabelForOptionDot(config: import("../../mixins/option").OptionUIConfig, option: Option): string;
classesForOptions(config: import("../../mixins/option").OptionUIConfig, options: Option[]): Record<string, boolean>; /**
* Label on the checkbox field is shown with the checkbox.
*
* @param editor Selective editor used to render the template.
* @param data Data provided to render the template.
*/
classesForOption(config: import("../../mixins/option").OptionUIConfig, option: Option): Record<string, boolean>;
hasColorHints(options: Option[]): boolean;
stylesForOptionDot(config: import("../../mixins/option").OptionUIConfig, option: Option): Record<string, string>;
templateColorSwatch(editor: SelectiveEditor, data: DeepObject, config: import("../../mixins/option").OptionUIConfig, option: Option): TemplateResult<1 | 2>;
templateOption(editor: SelectiveEditor, data: DeepObject, config: import("../../mixins/option").OptionUIConfig, option: Option): TemplateResult<1 | 2>;
templateOptions(editor: SelectiveEditor, data: DeepObject, config: import("../../mixins/option").OptionUIConfig, options: Option[]): TemplateResult<1 | 2>;
};
} & typeof Field;
export declare class CheckboxField extends CheckboxField_base {
config: CheckboxFieldConfig;
constructor(types: Types, config: CheckboxFieldConfig, globalConfig: GlobalConfig, fieldType?: string);
get isChecked(): boolean;
handleInput(): void;
templateInput(editor: SelectiveEditor, data: DeepObject): TemplateResult;
/**
* Label on the checkbox field is shown with the checkbox.
*
* @param editor Selective editor used to render the template.
* @param data Data provided to render the template.
*/
templateLabel(editor: SelectiveEditor, data: DeepObject): TemplateResult;
}
export {};