export interface DropDownOption extends Array < any > { [ 0 ] : string | number ; [ 1 ] : string | number ; [ 2 ] ? : boolean ; } export interface DropDownOptionGroup extends Array < any > { [ 0 ] : { label ? : string ; [ id ] : any ; } ; [ 1 ] : DropDownOption [ ] ; } export const option = ( [ value , label , disabled ] , sel ) => [ "option" , { value , disabled : ! ! disabled , selected : value === sel } , label , ] ; export const optgroup = ( attribs , options , sel ? ) => [ "optgroup" , { ... attribs , label : attribs . label || "--" } , ... options . map ( ( o ) => option ( o , sel ) ) , ] ; export const dropdown = ( _ , attribs , options , sel ? ) => [ "select" , attribs , ... options . map ( ( o ) => option ( o , sel ) ) ] ; export const groupedDropdown = ( _ , attribs , groups , sel ? ) => [ "select" , attribs , ... groups . map ( ( o ) => optgroup ( o [ 0 ] , o [ 1 ] , sel ) ) ] ;