Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
{
"label": "<",
"value": "lt"
},
{
"label": "<",
"value": "le"
}
],
"flex" : 10
};
let nodeDS :ITdDynamicElementConfig = {
"label": param.name + ' - '+param.documentation,
"name" : param.type+'-'+seq + '-2-'+param.name ,
"type": TdDynamicElement.Datepicker,
"required": true,
"flex" : 90
};
this.elements.push(nodeDSQ);
this.elements.push(nodeDS);
break;
case 'token' :
// add matches
let nodeT1 :ITdDynamicElementConfig = {
"label": 'System - '+param.name + ' - '+param.documentation,
"name" : param.type+'-'+seq + '-1-'+param.name,
"type": TdDynamicElement.Input,
"flex" : 50
};
isDate(type: TdDynamicElement | TdDynamicType): boolean {
return type === TdDynamicElement.Datepicker;
}
fileElements: ITdDynamicElementConfig[] = [
{
name: 'file-input',
label: 'Browse a file',
hint: 'this is a file input hint',
type: TdDynamicElement.FileInput,
},
];
dateElements: ITdDynamicElementConfig[] = [
{
name: 'date-input',
label: 'Select a date',
hint: 'this is a datepicker hint',
type: TdDynamicElement.Datepicker,
min: new Date(2018, 1, 1).setHours(0, 0, 0, 0),
},
];
dynamicElements: ITdDynamicElementConfig[] = [
{
name: 'element-0',
type: TdDynamicType.Text,
required: true,
flex: 80,
},
{
name: 'element-1',
type: TdDynamicType.Number,
required: false,
max: 30,
isDate(type: TdDynamicElement | TdDynamicType): boolean {
return type === TdDynamicElement.Datepicker;
}
flex: 100,
validators: [
{
validator: (control: AbstractControl) => {
const isValid: boolean = control.value.length <= 2;
return !isValid ? { invalidChips: true } : undefined;
},
},
],
},
];
elementOptions: any[] = [
TdDynamicElement.Input,
TdDynamicType.Number,
TdDynamicElement.Datepicker,
TdDynamicElement.Password,
TdDynamicElement.Textarea,
TdDynamicElement.Slider,
TdDynamicElement.Checkbox,
TdDynamicElement.SlideToggle,
TdDynamicElement.FileInput,
];
showDynamicCode: boolean = false;
type: any;
count: number = 2;
customValidationElements: ITdDynamicElementConfig[] = [
{
fileElements: ITdDynamicElementConfig[] = [
{
name: 'file-input',
label: 'Browse a file',
hint: 'this is a file input hint',
type: TdDynamicElement.FileInput,
},
];
dateElements: ITdDynamicElementConfig[] = [
{
name: 'date-input',
label: 'Select a date',
hint: 'this is a datepicker hint',
type: TdDynamicElement.Datepicker,
min: new Date(2018, 1, 1).setHours(0, 0, 0, 0),
},
];
dynamicElements: ITdDynamicElementConfig[] = [
{
name: 'element-0',
type: TdDynamicType.Text,
required: true,
flex: 80,
},
{
name: 'element-1',
type: TdDynamicType.Number,
required: false,
max: 30,
flex: 100,
validators: [
{
validator: (control: AbstractControl) => {
let isValid: boolean = control.value.length <= 2;
return !isValid ? { invalidChips: true } : undefined;
},
},
],
},
];
elementOptions: any[] = [
TdDynamicElement.Input,
TdDynamicType.Number,
TdDynamicElement.Datepicker,
TdDynamicElement.Password,
TdDynamicElement.Textarea,
TdDynamicElement.Slider,
TdDynamicElement.Checkbox,
TdDynamicElement.SlideToggle,
TdDynamicElement.FileInput,
];
showDynamicCode: boolean = false;
type: any;
count: number = 2;
customValidationElements: ITdDynamicElementConfig[] = [
{