tltv-timeline-element 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/model/DefaultLocaleDataProvider.d.ts +27 -27
- package/dist/src/model/DefaultLocaleDataProvider.js +111 -110
- package/dist/src/model/DefaultLocaleDataProvider.js.map +1 -1
- package/dist/src/model/ILocaleDataProvider.d.ts +62 -62
- package/dist/src/model/ILocaleDataProvider.js +1 -1
- package/dist/src/model/IResolutionBlockFiller.d.ts +4 -4
- package/dist/src/model/IResolutionBlockFiller.js +1 -1
- package/dist/src/model/IResolutionBlockRegisterer.d.ts +3 -3
- package/dist/src/model/IResolutionBlockRegisterer.js +1 -1
- package/dist/src/model/Resolution.d.ts +5 -5
- package/dist/src/model/Resolution.js +6 -6
- package/dist/src/model/Weekday.d.ts +5 -5
- package/dist/src/model/Weekday.js +6 -6
- package/dist/src/model/blockRowData.d.ts +11 -11
- package/dist/src/model/blockRowData.js +28 -28
- package/dist/src/timeline-element.d.ts +369 -352
- package/dist/src/timeline-element.js +1707 -1632
- package/dist/src/timeline-element.js.map +1 -1
- package/dist/src/util/dateTimeUtil.d.ts +14 -14
- package/dist/src/util/dateTimeUtil.js +55 -55
- package/dist/src/util/elementUtil.d.ts +4 -4
- package/dist/src/util/elementUtil.js +48 -48
- package/package.json +3 -3
- package/src/index.html +35 -2
- package/src/model/DefaultLocaleDataProvider.ts +6 -5
- package/src/timeline-element.ts +82 -3
|
@@ -1,352 +1,369 @@
|
|
|
1
|
-
import { LitElement, nothing } from 'lit';
|
|
2
|
-
import { Resolution } from './model/Resolution';
|
|
3
|
-
import { Weekday } from './model/Weekday';
|
|
4
|
-
import { BlockRowData } from './model/blockRowData';
|
|
5
|
-
import { ILocaleDataProvider } from './model/ILocaleDataProvider';
|
|
6
|
-
import { IResolutionBlockFiller } from './model/IResolutionBlockFiller';
|
|
7
|
-
import { IResolutionBlockRegisterer } from './model/IResolutionBlockRegisterer';
|
|
8
|
-
/**
|
|
9
|
-
* Scalable timeline web component that supports more than one
|
|
10
|
-
* resolutions ({@link Resolution}). When timeline element doesn't overflow
|
|
11
|
-
* horizontally in it's parent element, it scales the content width up to fit in
|
|
12
|
-
* the space available.
|
|
13
|
-
* <p>
|
|
14
|
-
* When this component scales up, all widths are calculated as percentages.
|
|
15
|
-
* Pixel widths are used otherwise. Some browsers may not support percentages
|
|
16
|
-
* accurately enough, and for those it's best to call
|
|
17
|
-
* {@link #setAlwaysCalculatePixelWidths(boolean)} with 'true' to disable
|
|
18
|
-
* percentage values.
|
|
19
|
-
* <p>
|
|
20
|
-
* There's always a minimum width calculated and updated to the timeline
|
|
21
|
-
* element. Percentage values set some limitation for the component's width.
|
|
22
|
-
* Wider the component (> 4000px), bigger the chance to get year, month and
|
|
23
|
-
* date blocks not being vertically in-line with each others.
|
|
24
|
-
* <p>
|
|
25
|
-
* Supports setting a scroll left position.
|
|
26
|
-
* <p>
|
|
27
|
-
* After construction, attach the component to it's parent and call update
|
|
28
|
-
* method with a required parameters and the timeline is ready. After that, all
|
|
29
|
-
* widths are calculated and all other API methods available can be used safely.
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
export declare class TimelineElement extends LitElement {
|
|
33
|
-
private static readonly STYLE_ROW;
|
|
34
|
-
private static readonly STYLE_COL;
|
|
35
|
-
private static readonly STYLE_MONTH;
|
|
36
|
-
private static readonly STYLE_YEAR;
|
|
37
|
-
private static readonly STYLE_DAY;
|
|
38
|
-
private static readonly STYLE_WEEK;
|
|
39
|
-
private static readonly STYLE_RESOLUTION;
|
|
40
|
-
private static readonly STYLE_EVEN;
|
|
41
|
-
private static readonly STYLE_WEEKEND;
|
|
42
|
-
private static readonly STYLE_SPACER;
|
|
43
|
-
private static readonly STYLE_FIRST;
|
|
44
|
-
private static readonly STYLE_CENTER;
|
|
45
|
-
private static readonly STYLE_LAST;
|
|
46
|
-
private static readonly STYLE_MEASURE;
|
|
47
|
-
private readonly
|
|
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
|
-
private
|
|
76
|
-
private
|
|
77
|
-
private
|
|
78
|
-
private
|
|
79
|
-
private
|
|
80
|
-
private
|
|
81
|
-
private
|
|
82
|
-
|
|
83
|
-
private
|
|
84
|
-
private
|
|
85
|
-
private
|
|
86
|
-
private
|
|
87
|
-
private
|
|
88
|
-
|
|
89
|
-
private
|
|
90
|
-
private
|
|
91
|
-
private
|
|
92
|
-
private
|
|
93
|
-
private
|
|
94
|
-
private
|
|
95
|
-
private
|
|
96
|
-
private
|
|
97
|
-
private
|
|
98
|
-
private
|
|
99
|
-
private
|
|
100
|
-
private
|
|
101
|
-
private
|
|
102
|
-
private
|
|
103
|
-
private
|
|
104
|
-
private
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* @
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* @param
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
* @
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*
|
|
215
|
-
* @
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
*
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
*
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*/
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1
|
+
import { LitElement, nothing } from 'lit';
|
|
2
|
+
import { Resolution } from './model/Resolution';
|
|
3
|
+
import { Weekday } from './model/Weekday';
|
|
4
|
+
import { BlockRowData } from './model/blockRowData';
|
|
5
|
+
import { ILocaleDataProvider } from './model/ILocaleDataProvider';
|
|
6
|
+
import { IResolutionBlockFiller } from './model/IResolutionBlockFiller';
|
|
7
|
+
import { IResolutionBlockRegisterer } from './model/IResolutionBlockRegisterer';
|
|
8
|
+
/**
|
|
9
|
+
* Scalable timeline web component that supports more than one
|
|
10
|
+
* resolutions ({@link Resolution}). When timeline element doesn't overflow
|
|
11
|
+
* horizontally in it's parent element, it scales the content width up to fit in
|
|
12
|
+
* the space available.
|
|
13
|
+
* <p>
|
|
14
|
+
* When this component scales up, all widths are calculated as percentages.
|
|
15
|
+
* Pixel widths are used otherwise. Some browsers may not support percentages
|
|
16
|
+
* accurately enough, and for those it's best to call
|
|
17
|
+
* {@link #setAlwaysCalculatePixelWidths(boolean)} with 'true' to disable
|
|
18
|
+
* percentage values.
|
|
19
|
+
* <p>
|
|
20
|
+
* There's always a minimum width calculated and updated to the timeline
|
|
21
|
+
* element. Percentage values set some limitation for the component's width.
|
|
22
|
+
* Wider the component (> 4000px), bigger the chance to get year, month and
|
|
23
|
+
* date blocks not being vertically in-line with each others.
|
|
24
|
+
* <p>
|
|
25
|
+
* Supports setting a scroll left position.
|
|
26
|
+
* <p>
|
|
27
|
+
* After construction, attach the component to it's parent and call update
|
|
28
|
+
* method with a required parameters and the timeline is ready. After that, all
|
|
29
|
+
* widths are calculated and all other API methods available can be used safely.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export declare class TimelineElement extends LitElement {
|
|
33
|
+
private static readonly STYLE_ROW;
|
|
34
|
+
private static readonly STYLE_COL;
|
|
35
|
+
private static readonly STYLE_MONTH;
|
|
36
|
+
private static readonly STYLE_YEAR;
|
|
37
|
+
private static readonly STYLE_DAY;
|
|
38
|
+
private static readonly STYLE_WEEK;
|
|
39
|
+
private static readonly STYLE_RESOLUTION;
|
|
40
|
+
private static readonly STYLE_EVEN;
|
|
41
|
+
private static readonly STYLE_WEEKEND;
|
|
42
|
+
private static readonly STYLE_SPACER;
|
|
43
|
+
private static readonly STYLE_FIRST;
|
|
44
|
+
private static readonly STYLE_CENTER;
|
|
45
|
+
private static readonly STYLE_LAST;
|
|
46
|
+
private static readonly STYLE_MEASURE;
|
|
47
|
+
private static readonly STYLE_CURRENT;
|
|
48
|
+
private static readonly CURRENT_DAY_FORMAT;
|
|
49
|
+
private static readonly CURRENT_HOUR_FORMAT;
|
|
50
|
+
private readonly resolutionWeekDayblockWidth;
|
|
51
|
+
resolution: Resolution;
|
|
52
|
+
startDateTime: string;
|
|
53
|
+
endDateTime: string;
|
|
54
|
+
/** Start Date of the timeline. Native Date object can be in "wrong" time zone, as it matches browser's time zone. */
|
|
55
|
+
internalInclusiveStartDateTime: Date;
|
|
56
|
+
/** End Date of the timeline. */
|
|
57
|
+
internalInclusiveEndDateTime: Date;
|
|
58
|
+
/** Timezone for date and time formatting. Doesn't match with actual start and end Date object's time zone. */
|
|
59
|
+
timeZone: string;
|
|
60
|
+
locale: string;
|
|
61
|
+
firstDayOfWeek: number;
|
|
62
|
+
twelveHourClock: boolean;
|
|
63
|
+
minWidth: number;
|
|
64
|
+
normalStartDate: Date;
|
|
65
|
+
normalEndDate: Date;
|
|
66
|
+
lastDayOfWeek: number;
|
|
67
|
+
firstDayOfRange: number;
|
|
68
|
+
firstHourOfRange: number;
|
|
69
|
+
scrollContainerId: string;
|
|
70
|
+
monthRowVisible: boolean;
|
|
71
|
+
yearRowVisible: boolean;
|
|
72
|
+
monthNames: string[];
|
|
73
|
+
weekdayNames: string[];
|
|
74
|
+
currentDateVisible: boolean;
|
|
75
|
+
private localeDataProvider;
|
|
76
|
+
private currentDayString;
|
|
77
|
+
private currentHourString;
|
|
78
|
+
private blocksInRange;
|
|
79
|
+
private resolutionBlockCount;
|
|
80
|
+
private firstResBlockCount;
|
|
81
|
+
private lastResBlockCount;
|
|
82
|
+
private firstDay;
|
|
83
|
+
private timelineOverflowingHorizontally;
|
|
84
|
+
private monthFormat;
|
|
85
|
+
private yearFormat;
|
|
86
|
+
private weekFormat;
|
|
87
|
+
private dayFormat;
|
|
88
|
+
resolutionDiv: HTMLDivElement;
|
|
89
|
+
private resSpacerDiv;
|
|
90
|
+
private spacerBlocks;
|
|
91
|
+
private yearRowData;
|
|
92
|
+
private monthRowData;
|
|
93
|
+
private dayRowData;
|
|
94
|
+
private dayWidthPercentage;
|
|
95
|
+
private dayOrHourWidthPx;
|
|
96
|
+
private resBlockMinWidthPx;
|
|
97
|
+
private resBlockWidthPx;
|
|
98
|
+
private resBlockWidthPercentage;
|
|
99
|
+
private minResolutionWidth;
|
|
100
|
+
private calcPixels;
|
|
101
|
+
private positionLeft;
|
|
102
|
+
private setPositionForEachBlock;
|
|
103
|
+
private firstWeekBlockHidden;
|
|
104
|
+
private ie;
|
|
105
|
+
private lazyResolutionPaint;
|
|
106
|
+
private directlyInsideScrollContainer;
|
|
107
|
+
private scrollHandler;
|
|
108
|
+
private scrollContainer;
|
|
109
|
+
private previousContainerScrollLeft;
|
|
110
|
+
private previousContainerScrollTop;
|
|
111
|
+
connectedCallback(): void;
|
|
112
|
+
disconnectedCallback(): void;
|
|
113
|
+
static get styles(): import("lit").CSSResult;
|
|
114
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
115
|
+
yearBlocks(): typeof nothing | import("lit-html").TemplateResult<1>[];
|
|
116
|
+
monthBlocks(): typeof nothing | import("lit-html").TemplateResult<1>[];
|
|
117
|
+
dayBlocks(): typeof nothing | import("lit-html").TemplateResult<1>[];
|
|
118
|
+
shouldUpdate(changedProperties: any): any;
|
|
119
|
+
willUpdate(changedProps: any): void;
|
|
120
|
+
protected updated(changedProps: any): void;
|
|
121
|
+
/**
|
|
122
|
+
* <p>
|
|
123
|
+
* Updates the content of this component. Builds the time-line and calculates
|
|
124
|
+
* width and heights for the content (calls in the end
|
|
125
|
+
* {@link #updateWidths()}). This should be called explicitly. Otherwise the
|
|
126
|
+
* component will be empty.
|
|
127
|
+
* <p>
|
|
128
|
+
* Date values should always follow specification in {@link Date#getTime()}.
|
|
129
|
+
* Start and end date is always required.
|
|
130
|
+
*
|
|
131
|
+
* @param resolution
|
|
132
|
+
* Resolution enum (not null)
|
|
133
|
+
* @param startDate
|
|
134
|
+
* Time-line's start date. (inclusive; not null)
|
|
135
|
+
* @param endDate
|
|
136
|
+
* Time-line's end date. (inclusive; not null)
|
|
137
|
+
* @param localeDataProvider
|
|
138
|
+
* Data provider for locale specific data. month names, first day
|
|
139
|
+
* of week etc.
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
updateTimeLine(resolution: Resolution, startDate: Date, endDate: Date, localeDataProvider: ILocaleDataProvider): void;
|
|
143
|
+
resetDateRange(startDate: Date, endDate: Date): void;
|
|
144
|
+
registerScrollHandler(): void;
|
|
145
|
+
setupScrollContainer(): HTMLElement | Window;
|
|
146
|
+
clear(): void;
|
|
147
|
+
calculateResolutionMinWidth(): number;
|
|
148
|
+
registerHourResolutionBlock(): void;
|
|
149
|
+
registerDayResolutionBlock(): void;
|
|
150
|
+
registerWeekResolutionBlock(index: number, weekDay: Weekday, lastBlock: boolean, firstWeek: boolean): void;
|
|
151
|
+
timelineBlocks(rowData: BlockRowData, style: string): import("lit-html").TemplateResult<1>[];
|
|
152
|
+
/**
|
|
153
|
+
* Returns true if Widget is set to calculate widths by itself. Default is
|
|
154
|
+
* false.
|
|
155
|
+
*
|
|
156
|
+
* @return
|
|
157
|
+
*/
|
|
158
|
+
isAlwaysCalculatePixelWidths(): boolean;
|
|
159
|
+
createSpacerBlock(className: string): HTMLDivElement;
|
|
160
|
+
/** Clears Daylight saving time adjustment from the given time. */
|
|
161
|
+
toNormalDate(zonedDate: Date): Date;
|
|
162
|
+
getDSTAdjustedDate(previousIsDST: boolean, zonedDate: Date): Date;
|
|
163
|
+
getParentElement(node: any): any;
|
|
164
|
+
getDay(date: Date): string;
|
|
165
|
+
getYear(date: Date): string;
|
|
166
|
+
getMonth(date: Date): number;
|
|
167
|
+
isWeekEnd(dayCounter: number): boolean;
|
|
168
|
+
key(prefix: string, rowData: BlockRowData): string;
|
|
169
|
+
newKey(prefix: string, rowData: BlockRowData): string;
|
|
170
|
+
addBlock(current: string, target: string, date: Date, rowData: BlockRowData, operation: (target: string, value: string, date: Date) => void): string;
|
|
171
|
+
addDayBlock(currentDay: string, date: Date): string;
|
|
172
|
+
addMonthBlock(currentMonth: string, date: Date): string;
|
|
173
|
+
addYearBlock(currentYear: string, date: Date): string;
|
|
174
|
+
addMonthBlockElement(key: string, text: string): void;
|
|
175
|
+
addYearBlockElement(key: string, text: string): void;
|
|
176
|
+
addDayBlockElement(key: string, text: string): HTMLDivElement;
|
|
177
|
+
createTimelineBlock(key: string, text: string, styleSuffix: string, rowData: BlockRowData): HTMLDivElement;
|
|
178
|
+
formatDayCaption(day: string, date: Date): string;
|
|
179
|
+
formatYearCaption(year: string, date: Date): string;
|
|
180
|
+
formatWeekCaption(date: Date): string;
|
|
181
|
+
formatMonthCaption(month: number, date: Date): string;
|
|
182
|
+
getWeekday(dayCounter: number): Weekday;
|
|
183
|
+
prepareTimelineForHourResolution(startDate: Date, endDate: Date): void;
|
|
184
|
+
prepareTimelineForHour(interval: number, startDate: Date, endDate: Date, resBlockRegisterer: IResolutionBlockRegisterer): void;
|
|
185
|
+
prepareTimelineForDayOrWeekResolution(startDate: Date, endDate: Date): void;
|
|
186
|
+
prepareTimelineForDayOrWeek(interval: number, startDate: Date, endDate: Date, resBlockRegisterer: IResolutionBlockRegisterer): void;
|
|
187
|
+
isDayRowVisible(): boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Get actual width of the timeline.
|
|
190
|
+
*
|
|
191
|
+
* @return
|
|
192
|
+
*/
|
|
193
|
+
getResolutionWidth(): number;
|
|
194
|
+
/**
|
|
195
|
+
* Calculate the exact width of the timeline. Excludes any spacers in the
|
|
196
|
+
* end.
|
|
197
|
+
*
|
|
198
|
+
* @return
|
|
199
|
+
*/
|
|
200
|
+
calculateTimelineWidth(): number;
|
|
201
|
+
private getResolutionDivWidth;
|
|
202
|
+
/**
|
|
203
|
+
* Calculate matching left offset in percentage for a date (
|
|
204
|
+
* {@link Date#getTime()}).
|
|
205
|
+
*
|
|
206
|
+
* @param date
|
|
207
|
+
* Target date in milliseconds.
|
|
208
|
+
* @param contentWidth
|
|
209
|
+
* Width of the content that the given 'date' is relative to.
|
|
210
|
+
* @return Left offset in percentage.
|
|
211
|
+
*/
|
|
212
|
+
getLeftPositionPercentageForDate(date: Date, contentWidth: number): number;
|
|
213
|
+
/**
|
|
214
|
+
* Calculate CSS value for 'left' property matching left offset in
|
|
215
|
+
* percentage for a date ( {@link Date#getTime()}).
|
|
216
|
+
* <p>
|
|
217
|
+
* May return '2.123456%' or 'calc(2.123456%)' if IE;
|
|
218
|
+
*
|
|
219
|
+
* @param date
|
|
220
|
+
* Target date in milliseconds.
|
|
221
|
+
* @param contentWidth
|
|
222
|
+
* Width of the content that the given 'date' is relative to.
|
|
223
|
+
* @return Left offset as a String value.
|
|
224
|
+
*/
|
|
225
|
+
getLeftPositionPercentageStringForDate(date: Date, contentWidth: number): string;
|
|
226
|
+
getLeftPositionPercentageStringForDateRange(date: Date, rangeWidth: number, rangeStartDate: Date, rangeEndDate: Date): string;
|
|
227
|
+
/**
|
|
228
|
+
* Calculate CSS value for 'width' property matching date interval inside
|
|
229
|
+
* the time-line. Returns percentage value. Interval is in milliseconds.
|
|
230
|
+
* <p>
|
|
231
|
+
* May return '2.123456%' or 'calc(2.123456%)' if IE;
|
|
232
|
+
*
|
|
233
|
+
* @param interval
|
|
234
|
+
* Date interval in milliseconds.
|
|
235
|
+
* @return
|
|
236
|
+
*/
|
|
237
|
+
getWidthPercentageStringForDateInterval(interval: number): string;
|
|
238
|
+
/** @see #getWidthPercentageStringForDateInterval(long) */
|
|
239
|
+
getWidthPercentageStringForDateIntervalForRange(interval: number, range: number): string;
|
|
240
|
+
/**
|
|
241
|
+
* Calculate matching left offset in pixels for a date (
|
|
242
|
+
* {@link Date#getTime()}).
|
|
243
|
+
*
|
|
244
|
+
* @param date
|
|
245
|
+
* Target date in milliseconds.
|
|
246
|
+
* @return Left offset in pixels.
|
|
247
|
+
*/
|
|
248
|
+
getLeftPositionForDate(date: Date): number;
|
|
249
|
+
getLeftPositionForDateRange(date: Date, rangeWidth: number, rangeStartDate: Date, rangeEndDate: Date): number;
|
|
250
|
+
/**
|
|
251
|
+
* Calculate matching date ({@link Date#getTime()}) for the target left
|
|
252
|
+
* pixel offset.
|
|
253
|
+
*
|
|
254
|
+
* @param left
|
|
255
|
+
* Left offset in pixels.
|
|
256
|
+
* @return Date in a milliseconds or null if timeline width is invalid (<=0).
|
|
257
|
+
*/
|
|
258
|
+
getDateForLeftPosition(left: number): Date;
|
|
259
|
+
getDateForLeftPositionNoticeDST(left: number, noticeDST: boolean): Date;
|
|
260
|
+
/**
|
|
261
|
+
* Convert left position for other relative target width.
|
|
262
|
+
*
|
|
263
|
+
* @param left
|
|
264
|
+
* @param contentWidthToConvertFor
|
|
265
|
+
* @return
|
|
266
|
+
*/
|
|
267
|
+
convertRelativeLeftPosition(left: number, contentWidthToConvertFor: number): number;
|
|
268
|
+
adjustDateRangeByDST(range: number): number;
|
|
269
|
+
/**
|
|
270
|
+
* Set horizontal scroll position for the time-line.
|
|
271
|
+
*
|
|
272
|
+
* @param left
|
|
273
|
+
* Scroll position in pixels.
|
|
274
|
+
*/
|
|
275
|
+
setScrollLeft(left: number): void;
|
|
276
|
+
/**
|
|
277
|
+
* Re-calculates required widths for this widget.
|
|
278
|
+
* <p>
|
|
279
|
+
* Re-creates and fills the visible part of the resolution element.
|
|
280
|
+
*/
|
|
281
|
+
updateWidths(): void;
|
|
282
|
+
updateBlockWidths(rowData: BlockRowData): void;
|
|
283
|
+
updateSpacerBlocks(dayWidthPx: number): void;
|
|
284
|
+
hideSpacerBlocks(): void;
|
|
285
|
+
/**
|
|
286
|
+
* Set minimum width (pixels) of this widget's root DIV element. Default is
|
|
287
|
+
* -1. Notice that
|
|
288
|
+
* {@link #update(Resolution, long, long, int, int, LocaleDataProvider)}
|
|
289
|
+
* will calculate min-width and call this internally.
|
|
290
|
+
*
|
|
291
|
+
* @param minWidth
|
|
292
|
+
* Minimum width in pixels.
|
|
293
|
+
*/
|
|
294
|
+
setMinWidth(minWidth: number): void;
|
|
295
|
+
/**
|
|
296
|
+
* Returns true if the timeline is overflowing the parent's width. This
|
|
297
|
+
* works only when this widget is attached to some parent.
|
|
298
|
+
*
|
|
299
|
+
* @return True when timeline width is more than the parent's width (@see
|
|
300
|
+
* {@link Element#getClientWidth()}).
|
|
301
|
+
*/
|
|
302
|
+
isTimelineOverflowingHorizontally(): boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Update horizontal overflow state.
|
|
305
|
+
*/
|
|
306
|
+
updateTimelineOverflowingHorizontally(): void;
|
|
307
|
+
createTimelineElementsOnVisibleArea(): void;
|
|
308
|
+
calculateMinimumResolutionBlockWidth(): number;
|
|
309
|
+
createResolutionBlock(): HTMLDivElement;
|
|
310
|
+
createHourResolutionBlock(): HTMLDivElement;
|
|
311
|
+
createDayResolutionBlock(): HTMLDivElement;
|
|
312
|
+
createWeekResolutionBlock(): HTMLDivElement;
|
|
313
|
+
fillVisibleTimeline(): void;
|
|
314
|
+
showResolutionBlocksOnView(): void;
|
|
315
|
+
showAllResolutionBlocks(): void;
|
|
316
|
+
/**
|
|
317
|
+
* Re-applies 'current' style to the currently shown resolution blocks and day
|
|
318
|
+
* row blocks without rebuilding the timeline. Call this when the current day
|
|
319
|
+
* or hour changes.
|
|
320
|
+
*/
|
|
321
|
+
refreshCurrentDate(): void;
|
|
322
|
+
updateCurrentDayString(): void;
|
|
323
|
+
isCurrentDay(date: Date): boolean;
|
|
324
|
+
isCurrentHour(date: Date): boolean;
|
|
325
|
+
setCurrentStyle(element: HTMLElement, current: boolean): void;
|
|
326
|
+
updateDayRowCurrentStyles(): void;
|
|
327
|
+
fillTimelineForResolution(startDate: Date, endDate: Date, left: number): void;
|
|
328
|
+
isFirstResBlockShort(): boolean;
|
|
329
|
+
isLastResBlockShort(): boolean;
|
|
330
|
+
getScrollOverflowForResolutionBlock(positionLeftSnapshot: number, left: number, firstResBlockShort: boolean): number;
|
|
331
|
+
getScrollOverflowForRegularResoultionBlock(positionLeftSnapshot: number, firstResBlockShort: boolean): number;
|
|
332
|
+
getScrollOverflowForShortFirstResolutionBlock(positionLeftSnapshot: number): number;
|
|
333
|
+
/**
|
|
334
|
+
* Returns a width of the first resolution block.
|
|
335
|
+
*
|
|
336
|
+
* @return
|
|
337
|
+
*/
|
|
338
|
+
getFirstResolutionElementWidth(): number;
|
|
339
|
+
getFirstResolutionElement(): HTMLElement;
|
|
340
|
+
getLastResolutionElement(): HTMLElement;
|
|
341
|
+
containsResBlockSpacer(): boolean;
|
|
342
|
+
removeResolutionSpacerBlock(): void;
|
|
343
|
+
calculateDayOrHourResolutionBlockWidthPx(blockCount: number): number;
|
|
344
|
+
calculateActualResolutionBlockWidthPx(dayOrHourBlockWidthPx: number): number;
|
|
345
|
+
/**
|
|
346
|
+
* Adjust left position for optimal position to detect accurate date with
|
|
347
|
+
* the current resolution.
|
|
348
|
+
*/
|
|
349
|
+
adjustLeftPositionForDateDetection(left: number): number;
|
|
350
|
+
createCalcCssValue(v: number, multiplier: number): string;
|
|
351
|
+
updateResolutionBlockWidths(pct: string): void;
|
|
352
|
+
getWidth(multiplier: number): string;
|
|
353
|
+
setWidth(element: HTMLElement, multiplier: number): void;
|
|
354
|
+
setWidthPct(resBlockWidthPx: number, pct: string, element: HTMLElement): void;
|
|
355
|
+
setCssPercentageWidth(element: HTMLElement, daysInRange: number, width: number, position: number): void;
|
|
356
|
+
getCssPercentageWidth(daysInRange: number, width: number, position: number): string;
|
|
357
|
+
setCssPercentageWidthFor(element: HTMLElement, nValue: number, pct: string): void;
|
|
358
|
+
getPercentageWidthString(nValue: number, pct: string): string;
|
|
359
|
+
getWidthStyleValue(pct: string): string;
|
|
360
|
+
fillTimelineForHourResolution(startDate: Date, endDate: Date, left: number): void;
|
|
361
|
+
fillTimelineForDayResolution(startDate: Date, endDate: Date, left: number): void;
|
|
362
|
+
logIndexOutOfBounds(indexName: string, index: number, childCount: number): void;
|
|
363
|
+
fillTimelineForHour(interval: number, startDate: Date, endDate: Date, resBlockFiller: IResolutionBlockFiller): void;
|
|
364
|
+
fillTimelineForDayOrWeek(interval: number, startDate: Date, endDate: Date, resBlockFiller: IResolutionBlockFiller): void;
|
|
365
|
+
isValidChildIndex(index: number, childCount: number): boolean;
|
|
366
|
+
fillDayResolutionBlock(resBlock: HTMLDivElement, date: Date, index: number, weekend: boolean, left: number): void;
|
|
367
|
+
fillWeekResolutionBlock(resBlock: HTMLDivElement, date: Date, index: number, weekDay: Weekday, firstWeek: boolean, lastBlock: boolean, left: number, even: boolean): void;
|
|
368
|
+
fillHourResolutionBlock(resBlock: HTMLDivElement, date: Date, index: number, hourCounter: number, lastBlock: boolean, left: number, even: boolean): void;
|
|
369
|
+
}
|