Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
isMinMaxSupported(type: TdDynamicElement | TdDynamicType): boolean {
return type === TdDynamicElement.Slider || type === TdDynamicType.Number || this.isDate(type);
}
isMinMaxSupported(type: TdDynamicElement | TdDynamicType): boolean {
return type === TdDynamicElement.Slider || type === TdDynamicType.Number || this.isDate(type);
}
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[] = [
{
name: 'evenElement',
label: 'Even Number',
type: TdDynamicType.Number,
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[] = [
{
name: 'evenElement',
label: 'Even Number',
type: TdDynamicType.Number,
required: true,
},
];
numberElements: ITdDynamicElementConfig[] = [
{
name: 'number',
label: 'Number',
type: TdDynamicType.Number,
required: true,
min: 18,
max: 70,
},
{
name: 'slider',
type: TdDynamicElement.Slider,
hint: 'this is a slider hint',
min: 18,
max: 70,
},
];
booleanElements: ITdDynamicElementConfig[] = [
{
name: 'boolean',
label: 'Boolean Label',
type: TdDynamicType.Boolean,
hint: 'this is a boolean',
default: false,
},
{
name: 'slide-toggle',
required: true,
},
];
numberElements: ITdDynamicElementConfig[] = [
{
name: 'number',
label: 'Number',
type: TdDynamicType.Number,
required: true,
min: 18,
max: 70,
},
{
name: 'slider',
type: TdDynamicElement.Slider,
hint: 'this is a slider hint',
min: 18,
max: 70,
},
];
booleanElements: ITdDynamicElementConfig[] = [
{
name: 'boolean',
label: 'Boolean Label',
type: TdDynamicType.Boolean,
hint: 'this is a boolean',
default: false,
},
{
name: 'slide-toggle',