-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathDatePickerConfigGenerator.ts
119 lines (108 loc) · 5.71 KB
/
DatePickerConfigGenerator.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/* tslint:disable:object-literal-sort-keys */
// tslint:disable:max-line-length
import { IgxDatePickerModule, IgxIconModule, IgxInputGroupModule, IgxSnackbarModule } from "igniteui-angular";
import { DatepickerDropdownComponent } from "../../src/app/scheduling/datepicker/datepicker-dropdown/datepicker-dropdown.component";
import { DatepickerSample1Component } from "../../src/app/scheduling/datepicker/datepicker-sample-1/datepicker-sample-1.component";
import { DatepickerSample2Component } from "../../src/app/scheduling/datepicker/datepicker-sample-2/datepicker-sample-2.component";
import { DatepickerSample3Component } from "../../src/app/scheduling/datepicker/datepicker-sample-3/datepicker-sample-3.component";
import { DatepickerSample4Component } from "../../src/app/scheduling/datepicker/datepicker-sample-4/datepicker-sample-4.component";
import { DatepickerSample5Component } from "../../src/app/scheduling/datepicker/datepicker-sample-5/datepicker-sample-5.component";
import { DatepickerSample6Component } from "../../src/app/scheduling/datepicker/datepicker-sample-6/datepicker-sample-6.component";
import { DatepickerSample7Component } from "../../src/app/scheduling/datepicker/datepicker-sample-7/datepicker-sample-7.component";
import { DatepickerSample8Component } from "../../src/app/scheduling/datepicker/datepicker-sample-8/datepicker-sample-8.component";
import { AppModuleConfig } from "./core/AppModuleConfig";
import { Config } from "./core/Config";
import { IConfigGenerator } from "./core/IConfigGenerator";
// tslint:enable:max-line-length
export class DatePickerConfigGenerator implements IConfigGenerator {
public generateConfigs(): Config[] {
const configs = new Array<Config>();
// date picker sample 1
configs.push(new Config({
component: DatepickerSample1Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample1Component],
ngDeclarations: [DatepickerSample1Component],
ngImports: [IgxDatePickerModule]
}),
shortenComponentPathBy: "/scheduling/datepicker/"
}));
// date picker sample 2
configs.push(new Config({
component: DatepickerSample2Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample2Component],
ngDeclarations: [DatepickerSample2Component],
ngImports: [IgxDatePickerModule]
}),
shortenComponentPathBy: "/scheduling/datepicker/"
}));
// date picker sample 3
configs.push(new Config({
component: DatepickerSample3Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample3Component],
ngDeclarations: [DatepickerSample3Component],
ngImports: [IgxDatePickerModule]
}),
shortenComponentPathBy: "/scheduling/datepicker/"
}));
// date picker sample 4
configs.push(new Config({
component: DatepickerSample4Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample4Component],
ngDeclarations: [DatepickerSample4Component],
ngImports: [IgxDatePickerModule]
}),
shortenComponentPathBy: "/scheduling/datepicker/"
}));
// date picker sample 5
configs.push(new Config({
additionalFiles: ["/src/app/date-parser.ts"],
component: DatepickerSample5Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample5Component],
ngDeclarations: [DatepickerSample5Component],
ngImports: [IgxDatePickerModule]
})
}));
// date picker sample 6
configs.push(new Config({
component: DatepickerSample6Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample6Component, IgxIconModule, IgxInputGroupModule],
ngDeclarations: [DatepickerSample6Component],
ngImports: [IgxDatePickerModule, IgxIconModule, IgxInputGroupModule]
})
}));
// date picker sample `datepicker-dropdown`
configs.push(new Config({
component: DatepickerDropdownComponent,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerDropdownComponent, IgxIconModule, IgxInputGroupModule],
ngDeclarations: [DatepickerDropdownComponent],
ngImports: [IgxDatePickerModule, IgxIconModule, IgxInputGroupModule]
})
}));
configs.push(new Config({
component: DatepickerSample7Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample7Component, IgxIconModule,
IgxInputGroupModule, IgxSnackbarModule],
ngDeclarations: [DatepickerSample7Component],
ngImports: [IgxDatePickerModule, IgxIconModule, IgxInputGroupModule, IgxSnackbarModule]
})
}));
configs.push(new Config({
component: DatepickerSample8Component,
appModuleConfig: new AppModuleConfig({
imports: [IgxDatePickerModule, DatepickerSample8Component, IgxIconModule,
IgxInputGroupModule],
ngDeclarations: [DatepickerSample8Component],
ngImports: [IgxDatePickerModule, IgxIconModule, IgxInputGroupModule]
})
}));
return configs;
}
}