convert date picker to standalone component
This commit is contained in:
@@ -64,7 +64,6 @@ import { MarkdownModule } from "ngx-markdown";
|
|||||||
MainPageComponent,
|
MainPageComponent,
|
||||||
HelpPageComponent,
|
HelpPageComponent,
|
||||||
UploadPageComponent,
|
UploadPageComponent,
|
||||||
DatePickerComponent,
|
|
||||||
VisualizationPageComponent,
|
VisualizationPageComponent,
|
||||||
YAxisDefinitionComponent,
|
YAxisDefinitionComponent,
|
||||||
QueryAutocompleteComponent,
|
QueryAutocompleteComponent,
|
||||||
@@ -91,6 +90,7 @@ import { MarkdownModule } from "ngx-markdown";
|
|||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
DatePickerComponent,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
MatAutocompleteModule,
|
MatAutocompleteModule,
|
||||||
MatBadgeModule,
|
MatBadgeModule,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { OverlayModule } from "@angular/cdk/overlay";
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
@@ -8,9 +9,18 @@ import {
|
|||||||
import {
|
import {
|
||||||
ControlValueAccessor,
|
ControlValueAccessor,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
FormsModule,
|
||||||
NG_VALUE_ACCESSOR,
|
NG_VALUE_ACCESSOR,
|
||||||
|
ReactiveFormsModule,
|
||||||
Validators,
|
Validators,
|
||||||
} from "@angular/forms";
|
} from "@angular/forms";
|
||||||
|
import { MatButtonModule } from "@angular/material/button";
|
||||||
|
import { MAT_DIALOG_DEFAULT_OPTIONS } from "@angular/material/dialog";
|
||||||
|
import { MatFormFieldModule } from "@angular/material/form-field";
|
||||||
|
import { MatInputModule } from "@angular/material/input";
|
||||||
|
import { MatTabsModule } from "@angular/material/tabs";
|
||||||
|
import { BrowserModule } from "@angular/platform-browser";
|
||||||
|
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
|
||||||
|
|
||||||
export type DateType = "QUICK" | "RELATIVE" | "ABSOLUTE";
|
export type DateType = "QUICK" | "RELATIVE" | "ABSOLUTE";
|
||||||
|
|
||||||
@@ -29,12 +39,27 @@ export class DatePickerChange {
|
|||||||
@Component({
|
@Component({
|
||||||
selector: "app-date-picker",
|
selector: "app-date-picker",
|
||||||
templateUrl: "./date-picker.component.html",
|
templateUrl: "./date-picker.component.html",
|
||||||
|
standalone: true,
|
||||||
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatFormFieldModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatTabsModule,
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
OverlayModule
|
||||||
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: NG_VALUE_ACCESSOR,
|
provide: NG_VALUE_ACCESSOR,
|
||||||
useExisting: forwardRef(() => DatePickerComponent),
|
useExisting: forwardRef(() => DatePickerComponent),
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
provide: MAT_DIALOG_DEFAULT_OPTIONS,
|
||||||
|
useValue: { hasBackdrop: true },
|
||||||
|
}
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class DatePickerComponent implements ControlValueAccessor {
|
export class DatePickerComponent implements ControlValueAccessor {
|
||||||
|
|||||||
Reference in New Issue
Block a user