libs/core/dynamic-form/time/src/time.model.ts
DfInteractiveBaseConfig,SingleInputFieldLayout
Properties |
|
| label | |
| Type |
string
|
|
Description
|
This field's label. It's translatable by default and supports string interpolation. Example : |
| optionalLabel (Optional) | |
| Type |
string
|
|
Description
|
Text that is additionally displayed in the label if the field is not mandatory and supports string interpolation. Example : |
| placeholderHours (Optional) | |
| Type |
string
|
|
Description
|
Sets the placeholder of hours field.
Default: |
| placeholderMinutes (Optional) | |
| Type |
string
|
|
Description
|
Sets the placeholder of minutes field.
Default: |
| type | |
| Type |
typeof DfTimeTypeName
|
|
Description
|
Specifies the type of the field as |
| value (Optional) | |
| Type |
string
|
|
Description
|
The field's initial value, in HH:mm format (e.g. '14:30'). If set, the field will be pre-filled with / pre-set to this value. ^\d{2}:\d{2}$ Example : |
| hint (Optional) | |
| Type |
string
|
|
Description
|
The hint text to be displayed under the field. It's translatable by default and supports string interpolation. Example : |
| note (Optional) | |
| Type |
string
|
|
Description
|
The note text is displayed in an info message box below the field. It's translatable by default and supports string interpolation. Example : |
| onBlurEvent (Optional) | |
| Type |
DfInteractiveEventConfig
|
|
Description
|
Configure either a PFE action or service activator configuration handler for the field's |
| onValueChangesEvent (Optional) | |
| Type |
DfInteractiveEventConfig
|
|
Description
|
Configure either a PFE action or service activator configuration handler for the field's |
| validators (Optional) | |
| Type |
DynamicFormValidationConfig[]
|
|
Description
|
Validators to set on this form field. |
| acl (Optional) | |
| Type |
DfFieldAcl[]
|
|
Description
|
ACL rules to be applied to this field. |
| columnSpan (Optional) | |
| Type |
number
|
|
Description
|
This field's custom size. Number of column(s) the element should span. It's only applicable with the "CUSTOM_COLUMN" layout. The value can be 1-12, following the 12-column grid system. The default value is 12. |
| id | |
| Type |
string
|
|
Description
|
This field's ID. The ID will serve as the ACL resource name for the form field. If the field is a form element, it will also be used as a form control name within the FormGroup to which it is added. IDs must be unique within your form. Example : |
| infoIcon (Optional) | |
| Type |
DfInfoIconConfig
|
|
Description
|
Info icon with associated pop-over. |
| onInitEvent (Optional) | |
| Type |
DfInteractiveEventConfig
|
|
Description
|
Configure either a PFE action or service activator configuration handler when the field's |
| renderName (Optional) | |
| Type |
string
|
|
Description
|
The optional renderName is added as the attribute "data-render-name" to the df-formfield elements in the DOM. It can be used to find the rendered element of a specific field of a form. |
| spacing (Optional) | |
| Type |
DfFormfieldSpacing
|
|
Description
|
This field's custom spacing. If defined, it will be used to set the spacing between this field and the next one. |
| testId (Optional) | |
| Type |
string
|
|
Description
|
The id used to select the element in the tests (unit test, e2e testing) |
import { DfInteractiveBaseConfig, SingleInputFieldLayout } from '@allianz/taly-core/dynamic-form';
export const DfTimeTypeName = 'TIME';
interface DfTimeBaseConfig extends DfInteractiveBaseConfig, SingleInputFieldLayout {
/**
* Specifies the type of the field as `TIME`.
*/
type: typeof DfTimeTypeName;
/**
* This field's label.
* It's translatable by default and supports string interpolation.
* @examples ["Select a time", "My label {$['bb-pgr-simple'].person.firstName}"]
*/
label: string;
/**
* Text that is additionally displayed in the label if the field is not mandatory and supports string interpolation.
* @examples ["Optional"]
*/
optionalLabel?: string;
/**
* Sets the placeholder of hours field.
* Default: `"hh"`.
*/
placeholderHours?: string;
/**
* Sets the placeholder of minutes field.
* Default: `"mm"`.
*/
placeholderMinutes?: string;
/**
* The field's initial value, in HH:mm format (e.g. '14:30').
* If set, the field will be pre-filled with / pre-set to this value.
* @TJS-pattern ^\d{2}:\d{2}$
* @examples ["14:30", "09:15"]
*/
value?: string;
}
interface DfTime24HourConfig {
/**
* Whether to show the time in 12-hour format with AM/PM toggle.
* Default: `false`
*/
twelveHourFormat?: false;
}
interface DfTime12HourConfig {
/**
* Whether to show the time in 12-hour format with AM/PM toggle.
* Default: `false`
*/
twelveHourFormat: true;
/**
* Sets the AM button label.
* Default: `"AM"`.
* @examples ["AM"]
*/
labelAM?: string;
/**
* Sets the PM button label.
* Default: `"PM"`.
* @examples ["PM"]
*/
labelPM?: string;
}
interface DfTimeNoTimepickerConfig {
/**
* Whether to show the timepicker dropdown toggle button.
* Default: `false`
*/
withTimepicker?: false;
}
interface DfTimeWithTimepickerConfig {
/**
* Whether to show the timepicker dropdown toggle button.
* Default: `false`
*/
withTimepicker: true;
/**
* The earliest time shown in the timepicker dropdown, in HH:mm format.
* Default: `"00:00"`.
* @TJS-pattern ^\d{2}:\d{2}$
* @examples ["08:00", "09:30"]
*/
pickerStartTime?: string;
/**
* The latest time shown in the timepicker dropdown, in HH:mm format.
* Default: `"24:00"`.
* @TJS-pattern ^\d{2}:\d{2}$
* @examples ["18:00", "22:00"]
*/
pickerEndTime?: string;
/**
* The interval in minutes between options in the timepicker dropdown.
* Must be at least 1 minute.
* Default: `30`.
* @TJS-minimum 1
* @examples [15, 30, 60]
*/
pickerTimeInterval?: number;
}
export type DfTime24HourNoPickerConfig = DfTimeBaseConfig &
DfTime24HourConfig &
DfTimeNoTimepickerConfig;
export type DfTime12HourNoPickerConfig = DfTimeBaseConfig &
DfTime12HourConfig &
DfTimeNoTimepickerConfig;
export type DfTime24HourWithPickerConfig = DfTimeBaseConfig &
DfTime24HourConfig &
DfTimeWithTimepickerConfig;
export type DfTime12HourWithPickerConfig = DfTimeBaseConfig &
DfTime12HourConfig &
DfTimeWithTimepickerConfig;
export type DfTimeConfig =
| DfTime24HourNoPickerConfig
| DfTime12HourNoPickerConfig
| DfTime24HourWithPickerConfig
| DfTime12HourWithPickerConfig;