import { whisper } from '@oliveai/ldk';
import {
DateTimeType,
WhisperComponentType,
} from '@oliveai/ldk/dist/whisper/types';
export const dateTimeWhisper = async () => {
await whisper.create({
label: 'Time Input',
components: [
{
type: WhisperComponentType.DateTimeInput,
dateTimeType: DateTimeType.Date,
label: 'Date Input',
onBlur: (error) => {
console.log('onBlur', error);
},
onChange: (error, value) => {
console.log('onChange', error, value);
},
onFocus: (error) => {
console.log('onFocus', error);
},
tooltip: 'Tooltip Text',
validationError: '',
value: '',
},
{
type: whisper.WhisperComponentType.DateTimeInput,
dateTimeType: DateTimeType.Date,
label: 'Date Input',
onBlur: (error) => {
console.log('onBlur', error);
},
onChange: (error, value) => {
console.log('onChange', error, value);
},
onFocus: (error) => {
console.log('onFocus', error);
},
tooltip: 'Tooltip Text',
validationError: 'Validation Error',
value: '',
},
{
type: whisper.WhisperComponentType.DateTimeInput,
dateTimeType: DateTimeType.DateTime,
label: 'DateTime Input',
onBlur: (error) => {
console.log('onBlur', error);
},
onChange: (error, value) => {
console.log('onChange', error, value);
},
onFocus: (error) => {
console.log('onFocus', error);
},
tooltip: 'Tooltip Text',
validationError: '',
value: '',
},
{
type: whisper.WhisperComponentType.DateTimeInput,
dateTimeType: DateTimeType.DateTime,
label: 'DateTime Input',
onBlur: (error) => {
console.log('onBlur', error);
},
onChange: (error, value) => {
console.log('onChange', error, value);
},
onFocus: (error) => {
console.log('onFocus', error);
},
tooltip: 'Tooltip Text',
validationError: 'Validation Error',
value: '',
},
{
type: whisper.WhisperComponentType.DateTimeInput,
dateTimeType: DateTimeType.Time,
label: 'Time Input',
onBlur: (error) => {
console.log('onBlur', error);
},
onChange: (error, value) => {
console.log('onChange', error, value);
},
onFocus: (error) => {
console.log('onFocus', error);
},
tooltip: 'Tooltip Text',
validationError: '',
value: '',
},
{
type: whisper.WhisperComponentType.DateTimeInput,
dateTimeType: DateTimeType.Date,
label: 'Time Input',
onBlur: (error) => {
console.log('onBlur', error);
},
onChange: (error, value) => {
console.log('onChange', error, value);
},
onFocus: (error) => {
console.log('onFocus', error);
},
tooltip: 'Tooltip Text',
validationError: 'Validation Error',
value: '',
},
],
});
}