Farmbot-Web-App/frontend/ui/fb_select.ts

19 lines
733 B
TypeScript
Raw Normal View History

2018-02-22 14:36:19 -07:00
export interface DropDownItem {
/** Name of the item shown in the list. */
label: string;
/** Value passed to the onClick cb and also determines the "chosen" option. */
value: number | string;
/** To determine group-by styling on rendered lists. */
heading?: boolean;
/** A unique ID to group headings by. */
headingId?: string | undefined;
2018-12-04 10:53:48 -07:00
/** Mostly for legacy reasons. Indicates that the current object is the
* NULL_CHOICE ddi */
isNull?: true;
2018-02-22 14:36:19 -07:00
}
2018-08-28 08:38:55 -06:00
export interface NullChoice extends DropDownItem { label: "None"; value: ""; }
const nc: NullChoice = { label: "None", value: "" };
2018-02-22 14:36:19 -07:00
/** Used as a placeholder for a selection of "none" when allowEmpty is true. */
2018-08-28 08:38:55 -06:00
export const NULL_CHOICE = Object.freeze(nc);