libs/core/dynamic-form/dropdown/src/dropdown.model.ts
Configuration for a dynamic dropdown field.
Properties |
|
autoPrefill (Optional) | |
Type |
boolean
|
Description
|
If there is only one option, pre-fill the field. Default is not to prefill. |
clearOptionLabel (Optional) | |
Type |
string
|
Description
|
The label for the option to clear the currently selected value. If this label is set, the clear option will be displayed when the dropdown has a value. It's translatable by default and supports string interpolation. |
filterPlaceholder (Optional) | |
Type |
string
|
Description
|
Placeholder text for the dropdown filter field. This is what is displayed when no filter expression has been entered yet. |
inputPrefix (Optional) | |
Type |
string
|
Description
|
Prefix text to place at the start of this field's input. It's translatable by default and supports string interpolation. |
inputSuffix (Optional) | |
Type |
string
|
Description
|
Suffix text to place at the end of this field's input. It's translatable by default and supports string interpolation. |
placeholder (Optional) | |
Type |
string
|
Description
|
Placeholder to be displayed in the field when the input is empty. It's translatable by default and supports string interpolation.
|
showFilter (Optional) | |
Type |
boolean
|
Description
|
Whether the dropdown should be filterable or not. If set and If not set or |
type | |
Description
|
Specifies the type of the field as |
import { DfInteractiveBaseConfig, DfOptions } from '@allianz/taly-core/dynamic-form';
/**
* The value to use for the `type` attribute of dropdown
* formfield configs.
*/
export const DfDropdownTypeName = 'DROPDOWN';
/**
* Configuration for a dynamic dropdown field.
*
* @additionalProperties false
*/
export interface DfDropdownConfig extends DfInteractiveBaseConfig {
/**
* Specifies the type of the field as `DROPDOWN`.
*/
type: typeof DfDropdownTypeName;
/**
* Placeholder to be displayed in the field when the input is empty.
* It's translatable by default and supports string interpolation.
* @examples ["Placeholder", "Placeholder with dynamic value {$['bb-pgr-simple'].date}"]
*/
placeholder?: string;
/**
* The "options" property can take one of two forms:
* 1. A hardcoded array of objects for direct display in a dropdown menu. Each object must have a "label" to display and a corresponding "value".
* 2. A string that represents an expression. This expression is used by an option provider service to dynamically fetch the dropdown options.
*
* @examples [[{"label": "The first option", "value": "1"}], "$.myExpression"]
*/
options: DfOptions[] | string;
/**
* Whether the dropdown should be filterable or not.
*
* If set and `true` the dropdown values can be filtered.
*
* If not set or `false`, the dropdown will not be filterable.
*/
showFilter?: boolean;
/**
* Placeholder text for the dropdown filter field.
*
* This is what is displayed when no filter expression has been entered yet.
*/
filterPlaceholder?: string;
/**
* If there is only one option, pre-fill the field. Default is not to prefill.
*/
autoPrefill?: boolean;
/**
* The label for the option to clear the currently selected value.
* If this label is set, the clear option will be displayed when the dropdown has a value.
* It's translatable by default and supports string interpolation.
*/
clearOptionLabel?: string;
/**
* Prefix text to place at the start of this field's input.
* It's translatable by default and supports string interpolation.
*/
inputPrefix?: string;
/**
* Suffix text to place at the end of this field's input.
* It's translatable by default and supports string interpolation.
*/
inputSuffix?: string;
}