API
Demo
@alinea/input.select
/**
Create a select field configuration
*/
export function
createSelect
(
label
:
Label
,
items
:
SelectItems
,
options
:
SelectOptions
)
:
SelectField
/**
Create a select field configuration
*/
export function
select
(
label
:
Label
,
items
:
SelectItems
,
options
:
SelectOptions
)
:
SelectField
/**
Internal representation of a select field
*/
export interface
SelectField
extends
Scalar
<
string
|
undefined
>
{
items
:
SelectItems
label
:
Label
options
:
SelectOptions
shape
:
Shape
<
|
undefined
|
string
,
{
}
>
view
:
FieldRenderer
<
|
undefined
|
string
,
{
}
,
Field
<
|
undefined
|
string
,
{
}
,
|
undefined
|
string
>
>
query
<
P
>
(
field
:
Expr
<
V
>
,
pages
:
Pages
<
P
>
)
:
undefined
|
Expr
<
Q
>
}
/**
A string record with option labels
*/
export type
SelectItems
=
{
[
key
extends
string
]:
Label
}
/**
Optional settings to configure a select field
*/
export type
SelectOptions
=
{
/**
Add instructional text to a field
*/
help
:
Label
/**
A default value
*/
initialValue
:
string
/**
Display a minimal version
*/
inline
:
boolean
/**
Field is optional
*/
optional
:
boolean
}