merge angular-17 into dev to upgrade from Angular v16 to v17
This commit is contained in:
@@ -50,14 +50,12 @@
|
||||
<mat-label>{{ formfield.label }}</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[ngxMatDatetimePicker]="datetimePicker"
|
||||
type="datetime-local"
|
||||
[min]="formfield.minDate"
|
||||
[max]="formfield.maxDate"
|
||||
[formControlName]="formfield.controlName"
|
||||
[required]="formfield.required"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="datetimePicker"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #datetimePicker [enableMeridian]="true"></ngx-mat-datetime-picker>
|
||||
<mat-error *ngIf="form.controls[formfield.controlName].hasError('required')">
|
||||
{{ formfield.label }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
import { FormfieldBase } from './formfield-base';
|
||||
|
||||
interface DatepickerOptions {
|
||||
minDate?: Date;
|
||||
maxDate?: Date;
|
||||
controlType?: string;
|
||||
controlName?: string;
|
||||
label?: string;
|
||||
value?: any;
|
||||
required?: boolean;
|
||||
order?: number;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export class DatepickerBase extends FormfieldBase {
|
||||
controlType = 'datepicker';
|
||||
minDate: Date;
|
||||
maxDate: Date;
|
||||
|
||||
constructor(options: {} = {}) {
|
||||
constructor(options: DatepickerOptions = {}) {
|
||||
super(options);
|
||||
this.minDate = options['minDate'] || new Date(2000, 0, 1);
|
||||
this.maxDate = options['maxDate'] || new Date();
|
||||
this.minDate = options.minDate || new Date(2000, 0, 1);
|
||||
this.maxDate = options.maxDate || new Date();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,29 @@
|
||||
import { FormfieldBase } from './formfield-base';
|
||||
|
||||
// Define the base options interface based on FormfieldBase requirements
|
||||
interface FormfieldBaseOptions {
|
||||
controlType?: string;
|
||||
controlName?: string;
|
||||
label?: string;
|
||||
value?: any;
|
||||
required?: boolean;
|
||||
order?: number;
|
||||
}
|
||||
|
||||
// Extend the base options for DateTimePicker
|
||||
interface DateTimePickerOptions extends FormfieldBaseOptions {
|
||||
minDate?: Date;
|
||||
maxDate?: Date;
|
||||
}
|
||||
|
||||
export class DateTimepickerBase extends FormfieldBase {
|
||||
controlType = 'datetimepicker';
|
||||
minDate: Date;
|
||||
maxDate: Date;
|
||||
|
||||
constructor(options: {} = {}) {
|
||||
constructor(options: DateTimePickerOptions = {}) {
|
||||
super(options);
|
||||
this.minDate = options['minDate'] || new Date(2000, 0, 1);
|
||||
this.maxDate = options['maxDate'] || new Date();
|
||||
this.minDate = options.minDate || new Date(2000, 0, 1);
|
||||
this.maxDate = options.maxDate || new Date();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
import { FormfieldBase } from './formfield-base';
|
||||
|
||||
interface InputBaseOptions extends FormfieldBaseOptions {
|
||||
type?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface FormfieldBaseOptions {
|
||||
controlType?: string;
|
||||
controlName?: string;
|
||||
label?: string;
|
||||
value?: any;
|
||||
required?: boolean;
|
||||
order?: number;
|
||||
}
|
||||
|
||||
export class InputBase extends FormfieldBase {
|
||||
controlType = 'input';
|
||||
type: string;
|
||||
|
||||
constructor(options: {} = {}) {
|
||||
constructor(options: InputBaseOptions = {}) {
|
||||
super(options);
|
||||
this.type = options['type'] || 'text';
|
||||
this.type = options.type || 'text';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
import { FormfieldBase } from './formfield-base';
|
||||
|
||||
interface SelectOption {
|
||||
label: string;
|
||||
value: string;
|
||||
data: {}[];
|
||||
}
|
||||
|
||||
interface SelectBaseOptions {
|
||||
options?: SelectOption;
|
||||
controlType?: string;
|
||||
controlName?: string;
|
||||
label?: string;
|
||||
value?: any;
|
||||
required?: boolean;
|
||||
order?: number;
|
||||
}
|
||||
|
||||
export class SelectBase extends FormfieldBase {
|
||||
controlType = 'select';
|
||||
options: {
|
||||
label: string;
|
||||
value: string;
|
||||
data: {}[];
|
||||
};
|
||||
options: SelectOption;
|
||||
|
||||
constructor(options: {} = {}) {
|
||||
constructor(options: SelectBaseOptions = {}) {
|
||||
super(options);
|
||||
this.options = options['options'];
|
||||
this.options = options.options || { label: '', value: '', data: [] };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user