Skip to content

Commit c92395e

Browse files
committed
Smart UI R1 2023
1 parent 92ae591 commit c92395e

File tree

4,553 files changed

+360327
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,553 files changed

+360327
-668
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
html, body {
2+
width: 100%;
3+
height: 100%;
4+
margin: 0 auto;
5+
}
6+
7+
.smart-scheduler {
8+
height: 100%;
9+
--smart-scheduler-timeline-cell-width: 100px;
10+
--smart-scheduler-timeline-header-horizontal-group-size: 160px;
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<smart-scheduler #scheduler id="scheduler" [dataSource]="dataSource" [view]="view" [dateCurrent]="dateCurrent"
2+
[firstDayOfWeek]="firstDayOfWeek" [hourStart]="hourStart" [hourEnd]="hourEnd" [groups]="groups"
3+
[resources]="resources" ></smart-scheduler>
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
import { Component, ViewChild, OnInit, AfterViewInit, ViewEncapsulation } from '@angular/core';
2+
import { SchedulerComponent, SchedulerEvent, SchedulerResource, SchedulerViews, SchedulerViewType } from 'smart-webcomponents-angular/scheduler';
3+
4+
5+
@Component({
6+
selector: 'app-root',
7+
templateUrl: './app.component.html',
8+
styleUrls: ['./app.component.css'],
9+
encapsulation: ViewEncapsulation.None
10+
})
11+
12+
export class AppComponent implements AfterViewInit, OnInit {
13+
@ViewChild('scheduler', { read: SchedulerComponent, static: false }) scheduler!: SchedulerComponent;
14+
15+
today = new Date();
16+
17+
dataSource: SchedulerEvent[] = (() => {
18+
const currentYear = this.today.getFullYear(),
19+
currentMonth = this.today.getMonth(),
20+
todayDate = this.today.getDate();
21+
22+
return [
23+
{
24+
label: 'Protect the Mind Stone',
25+
movieId: 1,
26+
priorityId: 2,
27+
heroId: 3,
28+
dateStart: new Date(currentYear, currentMonth, todayDate + 5, 9, 30),
29+
dateEnd: new Date(currentYear, currentMonth, todayDate + 5, 11, 30)
30+
},
31+
{
32+
label: 'Craft Stormbreaker',
33+
movieId: 2,
34+
priorityId: 3,
35+
heroId: 2,
36+
dateStart: new Date(currentYear, currentMonth, todayDate + 5, 12, 30),
37+
dateEnd: new Date(currentYear, currentMonth, todayDate + 5, 11, 30)
38+
}, {
39+
label: 'Find the Thanos',
40+
movieId: 2,
41+
priorityId: 3,
42+
heroId: 1,
43+
dateStart: new Date(currentYear, currentMonth, todayDate + 7, 10, 0),
44+
dateEnd: new Date(currentYear, currentMonth, todayDate + 7, 12, 0),
45+
},
46+
{
47+
label: 'Find the Thanos',
48+
movieId: 2,
49+
priorityId: 3,
50+
heroId: 2,
51+
dateStart: new Date(currentYear, currentMonth, todayDate + 7, 10, 0),
52+
dateEnd: new Date(currentYear, currentMonth, todayDate + 7, 12, 0),
53+
},
54+
{
55+
label: 'Time Heist',
56+
movieId: 2,
57+
priorityId: 3,
58+
heroId: 1,
59+
dateStart: new Date(currentYear, currentMonth + 3, todayDate + 7, 10, 0),
60+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate + 8, 12, 0),
61+
},
62+
{
63+
label: 'Time Heist',
64+
movieId: 2,
65+
priorityId: 3,
66+
heroId: 2,
67+
dateStart: new Date(currentYear, currentMonth + 3, todayDate + 7, 10, 0),
68+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate + 8, 12, 0),
69+
},
70+
{
71+
label: 'Time Heist',
72+
movieId: 2,
73+
priorityId: 3,
74+
heroId: 3,
75+
dateStart: new Date(currentYear, currentMonth + 3, todayDate, 10, 0),
76+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate + 1, 12, 0),
77+
}, {
78+
label: 'Collect The Space Stone',
79+
movieId: 1,
80+
priorityId: 1,
81+
heroId: 4,
82+
dateStart: new Date(currentYear, currentMonth - 2, todayDate - 5, 13),
83+
dateEnd: new Date(currentYear, currentMonth - 2, todayDate - 5, 21, 30)
84+
},
85+
{
86+
label: 'Collect The Mind Stone',
87+
movieId: 1,
88+
priorityId: 2,
89+
heroId: 4,
90+
dateStart: new Date(currentYear, currentMonth - 1, todayDate - 5, 13),
91+
dateEnd: new Date(currentYear, currentMonth - 1, todayDate - 4, 15, 30)
92+
},
93+
{
94+
label: 'Collect The Reality Stone',
95+
movieId: 1,
96+
priorityId: 1,
97+
heroId: 4,
98+
dateStart: new Date(currentYear, currentMonth, 1, 13),
99+
dateEnd: new Date(currentYear, currentMonth, 3, 15, 30)
100+
},
101+
{
102+
label: 'Collect The Power Stone',
103+
movieId: 1,
104+
priorityId: 1,
105+
heroId: 4,
106+
dateStart: new Date(currentYear, currentMonth + 1, 1, 13),
107+
dateEnd: new Date(currentYear, currentMonth + 1, 2, 15, 30)
108+
},
109+
{
110+
label: 'Collect The Time Stone',
111+
movieId: 1,
112+
priorityId: 2,
113+
dateStart: new Date(currentYear, currentMonth + 2, todayDate, 13),
114+
dateEnd: new Date(currentYear, currentMonth + 2, todayDate + 3, 15, 30)
115+
},
116+
{
117+
label: 'Collect The Soul Stone',
118+
movieId: 1,
119+
priorityId: 3,
120+
heroId: 4,
121+
dateStart: new Date(currentYear, currentMonth + 3, 1, 13),
122+
dateEnd: new Date(currentYear, currentMonth + 3, 1, 15, 30)
123+
},
124+
{
125+
label: 'Execute The Snap',
126+
movieId: 1,
127+
priorityId: 3,
128+
heroId: 4,
129+
dateStart: new Date(currentYear, currentMonth + 3, todayDate - 1, 13),
130+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate - 1, 15, 30)
131+
},
132+
{
133+
label: 'Prevent The Snap',
134+
movieId: 1,
135+
priorityId: 3,
136+
heroId: 1,
137+
dateStart: new Date(currentYear, currentMonth + 3, todayDate - 1, 13),
138+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate - 1, 15, 30)
139+
},
140+
{
141+
label: 'Prevent The Snap',
142+
movieId: 1,
143+
priorityId: 3,
144+
heroId: 2,
145+
dateStart: new Date(currentYear, currentMonth + 3, todayDate - 1, 13),
146+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate - 1, 15, 30)
147+
},
148+
{
149+
label: 'Prevent The Snap',
150+
movieId: 1,
151+
priorityId: 3,
152+
heroId: 3,
153+
dateStart: new Date(currentYear, currentMonth + 3, todayDate - 1, 13),
154+
dateEnd: new Date(currentYear, currentMonth + 3, todayDate - 1, 15, 30)
155+
}
156+
];
157+
})();
158+
159+
view: SchedulerViewType = 'month';
160+
161+
dateCurrent: Date = new Date(2020, 10, 1);
162+
163+
views: SchedulerViews[] = ['day', 'week', 'month'];
164+
165+
firstDayOfWeek: number = 1;
166+
167+
hourStart: number = 6;
168+
169+
hourEnd: number = 20;
170+
171+
groups: string[] = ['movieId', 'heroId', 'priorityId'];
172+
173+
resources: SchedulerResource[] = [
174+
{
175+
label: 'Priority',
176+
value: 'priorityId',
177+
dataSource: [
178+
{
179+
label: 'Low',
180+
id: 1,
181+
backgroundColor: '#0288D1'
182+
}, {
183+
label: 'Normal',
184+
id: 2,
185+
backgroundColor: '#FFB74D'
186+
},
187+
{
188+
label: 'Critical',
189+
id: 3,
190+
backgroundColor: '#26A69A'
191+
}
192+
],
193+
},
194+
{
195+
value: 'heroId',
196+
dataSource: [
197+
{
198+
label: 'Tony Stark',
199+
id: 1,
200+
backgroundColor: '#D32F2F'
201+
}, {
202+
label: 'Thor',
203+
id: 2,
204+
backgroundColor: '#7986CB'
205+
},
206+
{
207+
label: 'Steven Rogers',
208+
id: 3,
209+
backgroundColor: '#F9A825'
210+
},
211+
{
212+
label: 'Thanos',
213+
id: 4,
214+
backgroundColor: '#5D4037'
215+
}
216+
],
217+
label: 'Employee'
218+
},
219+
{
220+
value: 'movieId',
221+
dataSource: [
222+
{
223+
label: 'Infinity War',
224+
id: 1,
225+
backgroundColor: '#FF4081'
226+
}, {
227+
label: 'Endgame',
228+
id: 2,
229+
backgroundColor: '#00B0FF'
230+
}
231+
],
232+
label: 'Movies'
233+
}
234+
];
235+
236+
ngOnInit(): void {
237+
// onInit code.
238+
}
239+
240+
ngAfterViewInit(): void {
241+
// afterViewInit code.
242+
this.init();
243+
}
244+
245+
init(): void {
246+
// init code.
247+
const currentYear = this.today.getFullYear(),
248+
currentMonth = this.today.getMonth(),
249+
todayDate = this.today.getDate();
250+
251+
this.scheduler.scrollToEvent({
252+
label: 'Collect The Reality Stone',
253+
movieId: 1,
254+
priorityId: 1,
255+
heroId: 4,
256+
dateStart: new Date(currentYear, currentMonth, 1, 13),
257+
dateEnd: new Date(currentYear, currentMonth, 3, 15, 30)
258+
});
259+
};
260+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
4+
import { SchedulerModule } from 'smart-webcomponents-angular/scheduler';
5+
6+
import { AppComponent } from './app.component';
7+
8+
@NgModule({
9+
declarations: [ AppComponent ],
10+
imports: [ BrowserModule, SchedulerModule ],
11+
bootstrap: [ AppComponent ],
12+
entryComponents: [ AppComponent ]
13+
})
14+
15+
export class AppModule { }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
import { enableProdMode } from '@angular/core';
3+
import { AppModule } from './app.module';
4+
5+
enableProdMode();
6+
platformBrowserDynamic().bootstrapModule(AppModule);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
html, body {
2+
width: 100%;
3+
height: 100%;
4+
margin: 0 auto;
5+
}
6+
7+
.smart-scheduler {
8+
height: 100%;
9+
--smart-scheduler-timeline-cell-width: 100px;
10+
--smart-scheduler-timeline-header-vertical-group-size: 250px;
11+
--smart-scheduler-timeline-group-white-space: normal;
12+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<smart-scheduler #scheduler id="scheduler" [dataSource]="dataSource" [view]="view" [views]="views" [dateCurrent]="dateCurrent"
2+
[firstDayOfWeek]="firstDayOfWeek" [hourStart]="hourStart" [hourEnd]="hourEnd" [groups]="groups"
3+
[groupOrientation]="groupOrientation" [resources]="resources"></smart-scheduler>

0 commit comments

Comments
 (0)