@spicainternational/ngx-sds-components 6.15.0 → 6.16.1
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/esm2020/src/lib/table-actions/table-actions.component.mjs +2 -2
- package/esm2020/src/lib/timeline/components/timeline.component.mjs +79 -17
- package/esm2020/src/lib/timeline/models/timeline.model.mjs +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs +2 -2
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-timeline.mjs +80 -17
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-timeline.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs +2 -2
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-timeline.mjs +78 -16
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-timeline.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/timeline/components/timeline.component.d.ts +31 -5
- package/src/lib/timeline/models/timeline.model.d.ts +19 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
|
|
@@ -135,13 +135,21 @@ class SdsTimelineComponent {
|
|
|
135
135
|
*/
|
|
136
136
|
this.end = new Date();
|
|
137
137
|
/**
|
|
138
|
-
* The items to be displayed on the timeline. Specify data if you need
|
|
138
|
+
* The period based items to be displayed on the timeline. Specify data if you need
|
|
139
139
|
* additional data for custom rendering of the items.
|
|
140
140
|
*
|
|
141
141
|
* @type {TimelineItem[]}
|
|
142
142
|
* @memberof SdsTimelineComponent
|
|
143
143
|
*/
|
|
144
144
|
this.items = [];
|
|
145
|
+
/**
|
|
146
|
+
* Items to be displayed on the timeline at a specific point in time.
|
|
147
|
+
* Specify data if you need additional data for custom rendering of the items.
|
|
148
|
+
*
|
|
149
|
+
* @type {TimelinePointInTimeItem[]}
|
|
150
|
+
* @memberof SdsTimelineComponent
|
|
151
|
+
*/
|
|
152
|
+
this.pointInTimeItems = [];
|
|
145
153
|
/**
|
|
146
154
|
* The template to be used for custom rendering of the items.
|
|
147
155
|
*
|
|
@@ -149,6 +157,13 @@ class SdsTimelineComponent {
|
|
|
149
157
|
* @memberof SdsTimelineComponent
|
|
150
158
|
*/
|
|
151
159
|
this.itemTemplate = undefined;
|
|
160
|
+
/**
|
|
161
|
+
* The template to be used for custom rendering of the poin-in-time items.
|
|
162
|
+
*
|
|
163
|
+
* @type {(TemplateRef<any> | undefined)}
|
|
164
|
+
* @memberof SdsTimelineComponent
|
|
165
|
+
*/
|
|
166
|
+
this.pointInTimeTemplate = undefined;
|
|
152
167
|
/**
|
|
153
168
|
* The frequency of the ticks on the timeline.
|
|
154
169
|
*
|
|
@@ -163,6 +178,16 @@ class SdsTimelineComponent {
|
|
|
163
178
|
* @memberof SdsTimelineComponent
|
|
164
179
|
*/
|
|
165
180
|
this.zoomPercent = 100;
|
|
181
|
+
this.zoomPercentChange = new EventEmitter();
|
|
182
|
+
/**
|
|
183
|
+
* Initial offset of the viewport in percent. This is used in scenarios
|
|
184
|
+
* with multiple days when you want to show non-first day as defult.
|
|
185
|
+
*
|
|
186
|
+
* @type {number}
|
|
187
|
+
* @memberof SdsTimelineComponent
|
|
188
|
+
*/
|
|
189
|
+
this.viewOffsetPercent = 0;
|
|
190
|
+
this.viewOffsetPercentChange = new EventEmitter();
|
|
166
191
|
/**
|
|
167
192
|
* The maximum allowed zoom level of the timeline. In percent.
|
|
168
193
|
*
|
|
@@ -211,7 +236,7 @@ class SdsTimelineComponent {
|
|
|
211
236
|
this.dayLabels = [];
|
|
212
237
|
this._timelineService = new SdsTimelineService(this.start, this.end, this.offSetMinutes);
|
|
213
238
|
this.presentationItems = [];
|
|
214
|
-
this.
|
|
239
|
+
this.presentationPointInTimeItems = [];
|
|
215
240
|
this.isDragging = false;
|
|
216
241
|
this.initialDragX = 0;
|
|
217
242
|
this.viewOffsetPercentDragStart = 0;
|
|
@@ -231,8 +256,11 @@ class SdsTimelineComponent {
|
|
|
231
256
|
if (changes['items']) {
|
|
232
257
|
this.generateInternalTimelineItems();
|
|
233
258
|
}
|
|
259
|
+
if (changes['pointInTimeItems']) {
|
|
260
|
+
this.generateInternalTimelinePointInTimeItems();
|
|
261
|
+
}
|
|
234
262
|
if (changes['zoomPercent']) {
|
|
235
|
-
this.viewOffsetPercent = (this.zoomPercent - 100) / -2;
|
|
263
|
+
// this.viewOffsetPercent = (this.zoomPercent - 100) / -2;
|
|
236
264
|
}
|
|
237
265
|
if (changes['showDayLabels'] || changes['showHourLabels']) {
|
|
238
266
|
this.generateTicks();
|
|
@@ -248,17 +276,18 @@ class SdsTimelineComponent {
|
|
|
248
276
|
const newZoomPercent = Math.min(Math.max(this.zoomPercent + -delta * 20, 100), this.maxZoomPercent);
|
|
249
277
|
const deltaZoomPercent = newZoomPercent - this.zoomPercent;
|
|
250
278
|
this.zoomPercent = newZoomPercent;
|
|
279
|
+
this.zoomPercentChange.emit(this.zoomPercent);
|
|
251
280
|
// get the relative position of the cursor on the viewport so we can zoom in into this position
|
|
252
281
|
const x = event.clientX - ((_a = this._viewport) === null || _a === void 0 ? void 0 : _a.nativeElement.getBoundingClientRect().left);
|
|
253
282
|
const cursorRelativePosition = x / ((_b = this._viewport) === null || _b === void 0 ? void 0 : _b.nativeElement.getBoundingClientRect().width);
|
|
254
|
-
this.viewOffsetPercent = this.viewOffsetPercent - deltaZoomPercent * cursorRelativePosition;
|
|
255
|
-
this.constrainOffset();
|
|
283
|
+
// this.viewOffsetPercent = this.viewOffsetPercent - deltaZoomPercent * cursorRelativePosition;
|
|
284
|
+
this.constrainOffset(this.viewOffsetPercent - deltaZoomPercent * cursorRelativePosition);
|
|
256
285
|
}
|
|
257
286
|
}
|
|
258
287
|
//#endregion
|
|
259
288
|
//#region dragging
|
|
260
289
|
onDragStart(event) {
|
|
261
|
-
if (this.enableZoomAndDrag) {
|
|
290
|
+
if (this.enableZoomAndDrag && this.zoomPercent > 100) {
|
|
262
291
|
event.preventDefault();
|
|
263
292
|
this.isDragging = true;
|
|
264
293
|
this.viewOffsetPercentDragStart = this.viewOffsetPercent;
|
|
@@ -296,16 +325,20 @@ class SdsTimelineComponent {
|
|
|
296
325
|
const diff = currentX - this.initialDragX;
|
|
297
326
|
if (this._viewport && this._viewport.nativeElement) {
|
|
298
327
|
const diffInPercent = (diff / ((_a = this._viewport) === null || _a === void 0 ? void 0 : _a.nativeElement.getBoundingClientRect().width)) * 100;
|
|
299
|
-
this.viewOffsetPercent = this.viewOffsetPercentDragStart + diffInPercent;
|
|
300
|
-
this.constrainOffset();
|
|
328
|
+
// this.viewOffsetPercent = this.viewOffsetPercentDragStart + diffInPercent;
|
|
329
|
+
this.constrainOffset(this.viewOffsetPercentDragStart + diffInPercent);
|
|
301
330
|
}
|
|
302
331
|
}
|
|
303
332
|
//#endregion
|
|
304
|
-
constrainOffset() {
|
|
305
|
-
if (this.zoomPercent +
|
|
306
|
-
|
|
333
|
+
constrainOffset(newOffset) {
|
|
334
|
+
if (this.zoomPercent + newOffset < 100) {
|
|
335
|
+
newOffset = -this.zoomPercent + 100;
|
|
336
|
+
}
|
|
337
|
+
newOffset = Math.min(0, newOffset);
|
|
338
|
+
if (newOffset != this.viewOffsetPercent) {
|
|
339
|
+
this.viewOffsetPercent = newOffset;
|
|
340
|
+
this.viewOffsetPercentChange.emit(this.viewOffsetPercent);
|
|
307
341
|
}
|
|
308
|
-
this.viewOffsetPercent = Math.min(0, this.viewOffsetPercent);
|
|
309
342
|
}
|
|
310
343
|
generateTicks() {
|
|
311
344
|
this.hourTicks = this._timelineService.getHourTicks(this.tickFrequency);
|
|
@@ -314,7 +347,7 @@ class SdsTimelineComponent {
|
|
|
314
347
|
}
|
|
315
348
|
generateInternalTimelineItems() {
|
|
316
349
|
this.presentationItems = this.items.map((item) => {
|
|
317
|
-
var _a;
|
|
350
|
+
var _a, _b, _c;
|
|
318
351
|
const startTime = new Date(item.start).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });
|
|
319
352
|
const endTime = new Date(item.end).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });
|
|
320
353
|
const timeRange = `${startTime} - ${endTime}`;
|
|
@@ -322,28 +355,58 @@ class SdsTimelineComponent {
|
|
|
322
355
|
data: item.data,
|
|
323
356
|
x: this._timelineService.getX(item.start),
|
|
324
357
|
width: this._timelineService.getWidthFromTime(item.start, item.end),
|
|
325
|
-
hint: (_a = item.hint) !== null && _a !== void 0 ? _a : timeRange
|
|
358
|
+
hint: (_a = item.hint) !== null && _a !== void 0 ? _a : timeRange,
|
|
359
|
+
backgroundColor: item.backgroundColor,
|
|
360
|
+
top: (_b = item.top) !== null && _b !== void 0 ? _b : '50%',
|
|
361
|
+
height: (_c = item.height) !== null && _c !== void 0 ? _c : '60%',
|
|
362
|
+
class: item.class,
|
|
363
|
+
};
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
generateInternalTimelinePointInTimeItems() {
|
|
367
|
+
this.presentationPointInTimeItems = this.pointInTimeItems.map((item) => {
|
|
368
|
+
var _a, _b, _c, _d;
|
|
369
|
+
const timePointString = new Date(item.date).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });
|
|
370
|
+
return {
|
|
371
|
+
data: item.data,
|
|
372
|
+
x: this._timelineService.getX(item.date),
|
|
373
|
+
hint: (_a = item.hint) !== null && _a !== void 0 ? _a : timePointString,
|
|
374
|
+
top: (_b = item.top) !== null && _b !== void 0 ? _b : '20%',
|
|
375
|
+
height: (_c = item.height) !== null && _c !== void 0 ? _c : '1rem',
|
|
376
|
+
width: (_d = item.width) !== null && _d !== void 0 ? _d : '1rem',
|
|
377
|
+
class: item.class,
|
|
378
|
+
backgroundColor: item.backgroundColor,
|
|
326
379
|
};
|
|
327
380
|
});
|
|
328
381
|
}
|
|
329
382
|
}
|
|
330
383
|
SdsTimelineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsTimelineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
331
|
-
SdsTimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SdsTimelineComponent, selector: "sds-timeline", inputs: { start: "start", end: "end", items: "items", itemTemplate: "itemTemplate", tickFrequency: "tickFrequency", zoomPercent: "zoomPercent", maxZoomPercent: "maxZoomPercent", showHourLabels: "showHourLabels", showDayLabels: "showDayLabels", timelineHeight: "timelineHeight", enableZoomAndDrag: "enableZoomAndDrag" }, host: { listeners: { "window:mousemove": "onDragMove($event)", "window:touchmove": "onDragMoveTouch($event)", "window:mouseup": "onDragEnd($event)", "window:touchend": "onDragEnd($event)" } }, viewQueries: [{ propertyName: "_viewport", first: true, predicate: ["viewport"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template #defaultItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<div \r\n #viewport\r\n class=\"sds-timeline-viewport\"\r\n (wheel)=\"onScroll($event)\"\r\n\r\n (mousedown)=\"onDragStart($event)\"\r\n (touchstart)=\"onDragStart($event)\"\r\n >\r\n\r\n <div \r\n class=\"sds-timeline-container d-flex flex-column\"\r\n [style.left.%]=\"viewOffsetPercent\"\r\n [style.width.%]=\"zoomPercent\"\r\n [style.cursor]=\"isDragging ? 'ew-resize' : 'default'\"\r\n >\r\n\r\n <div\r\n *ngIf=\"showDayLabels\" \r\n class=\"sds-timeline-day-header\">\r\n\r\n <div \r\n *ngFor=\"let label of dayLabels\"\r\n class=\"sds-day-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n *ngIf=\"showHourLabels\" \r\n class=\"sds-timeline-hour-header\">\r\n\r\n <div \r\n *ngFor=\"let label of hourLabels;\"\r\n class=\"sds-hour-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n class=\"sds-timeline flex-grow-1\"\r\n [style.height]=\"timelineHeight\"\r\n >\r\n\r\n <div \r\n *ngFor=\"let tick of hourTicks\"\r\n class=\"sds-timeline-tick\" \r\n [ngStyle]=\"tick.x == 100 ? {'left': 'calc(' + tick.x +'% - 1px)'} : {'left': 'calc(' + tick.x + '% - 0.5px)'}\"\r\n >\r\n </div>\r\n\r\n
|
|
384
|
+
SdsTimelineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SdsTimelineComponent, selector: "sds-timeline", inputs: { start: "start", end: "end", items: "items", pointInTimeItems: "pointInTimeItems", itemTemplate: "itemTemplate", pointInTimeTemplate: "pointInTimeTemplate", tickFrequency: "tickFrequency", zoomPercent: "zoomPercent", viewOffsetPercent: "viewOffsetPercent", maxZoomPercent: "maxZoomPercent", showHourLabels: "showHourLabels", showDayLabels: "showDayLabels", timelineHeight: "timelineHeight", enableZoomAndDrag: "enableZoomAndDrag" }, outputs: { zoomPercentChange: "zoomPercentChange", viewOffsetPercentChange: "viewOffsetPercentChange" }, host: { listeners: { "window:mousemove": "onDragMove($event)", "window:touchmove": "onDragMoveTouch($event)", "window:mouseup": "onDragEnd($event)", "window:touchend": "onDragEnd($event)" } }, viewQueries: [{ propertyName: "_viewport", first: true, predicate: ["viewport"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template #defaultItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item h-100\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultPointInTimeItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item h-100\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<div \r\n #viewport\r\n class=\"sds-timeline-viewport\"\r\n (wheel)=\"onScroll($event)\"\r\n\r\n (mousedown)=\"onDragStart($event)\"\r\n (touchstart)=\"onDragStart($event)\"\r\n >\r\n\r\n <div \r\n class=\"sds-timeline-container d-flex flex-column\"\r\n [style.left.%]=\"viewOffsetPercent\"\r\n [style.width.%]=\"zoomPercent\"\r\n [style.cursor]=\"isDragging ? 'ew-resize' : 'default'\"\r\n >\r\n\r\n <div\r\n *ngIf=\"showDayLabels\" \r\n class=\"sds-timeline-day-header\">\r\n\r\n <div \r\n *ngFor=\"let label of dayLabels\"\r\n class=\"sds-day-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n *ngIf=\"showHourLabels\" \r\n class=\"sds-timeline-hour-header\">\r\n\r\n <div \r\n *ngFor=\"let label of hourLabels;\"\r\n class=\"sds-hour-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n class=\"sds-timeline flex-grow-1\"\r\n [style.height]=\"timelineHeight\"\r\n >\r\n\r\n <div \r\n *ngFor=\"let tick of hourTicks\"\r\n class=\"sds-timeline-tick\" \r\n [ngStyle]=\"tick.x == 100 ? {'left': 'calc(' + tick.x +'% - 1px)'} : {'left': 'calc(' + tick.x + '% - 0.5px)'}\"\r\n >\r\n </div>\r\n\r\n <div \r\n *ngFor=\"let item of presentationItems\"\r\n class=\"sds-timeline-item-container\"\r\n [ngStyle]=\"{\r\n 'width': 'max(' + item.width +'%, 1px)',\r\n 'top': 'calc(' + item.top + ' - max(calc(' + item.height +'/2), 1px))', \r\n }\"\r\n\r\n [style.left.%]=\"item.x\"\r\n [style.height]=\"item.height\"\r\n [style.backgroundColor]=\"item.backgroundColor\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n </div>\r\n\r\n\r\n <div *ngFor=\"let item of presentationPointInTimeItems\"\r\n class=\"sds-timeline-point-in-time-item-container\"\r\n [ngClass]=\"item.class\"\t\r\n [style.height]=\"item.height\"\r\n [style.width]=\"item.width\"\r\n [ngStyle]=\"{\r\n 'top': 'calc(' + item.top + ' - max(calc(' + item.height +'/2), 1px))', \r\n 'left': 'calc(' + item.x + '% - max( calc(' + item.width +'/2), 1px))',\r\n \r\n }\"\r\n [style.backgroundColor]=\"item.backgroundColor\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"pointInTimeTemplate ? pointInTimeTemplate : defaultPointInTimeItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sds-timeline-viewport{overflow:hidden}.sds-timeline-viewport .sds-timeline-container{width:100%;min-height:0;position:relative;-webkit-user-select:none;user-select:none}.sds-timeline-viewport .sds-timeline-container .sds-timeline-day-header{height:1.6rem;position:relative}.sds-timeline-viewport .sds-timeline-container .sds-timeline-day-header .sds-day-label{position:absolute;display:inline;text-align:center}.sds-timeline-viewport .sds-timeline-container .sds-timeline-hour-header{height:1.6rem;position:relative}.sds-timeline-viewport .sds-timeline-container .sds-timeline-hour-header .sds-hour-label{position:absolute;display:inline;text-align:center}.sds-timeline-viewport .sds-timeline-container .sds-timeline{position:relative}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-tick{border-left:1px solid rgb(187,187,187);height:100%;position:absolute;display:inline}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-item-container{height:100%;position:absolute;display:inline;top:20%;height:60%}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-item-container .sds-timeline-item{position:relative;width:100%}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-point-in-time-item-container{width:1px;height:1px;position:absolute}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-point-in-time-item-container .sds-timeline-item{position:relative;width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
332
385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsTimelineComponent, decorators: [{
|
|
333
386
|
type: Component,
|
|
334
|
-
args: [{ selector: 'sds-timeline', template: "<ng-template #defaultItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<div \r\n #viewport\r\n class=\"sds-timeline-viewport\"\r\n (wheel)=\"onScroll($event)\"\r\n\r\n (mousedown)=\"onDragStart($event)\"\r\n (touchstart)=\"onDragStart($event)\"\r\n >\r\n\r\n <div \r\n class=\"sds-timeline-container d-flex flex-column\"\r\n [style.left.%]=\"viewOffsetPercent\"\r\n [style.width.%]=\"zoomPercent\"\r\n [style.cursor]=\"isDragging ? 'ew-resize' : 'default'\"\r\n >\r\n\r\n <div\r\n *ngIf=\"showDayLabels\" \r\n class=\"sds-timeline-day-header\">\r\n\r\n <div \r\n *ngFor=\"let label of dayLabels\"\r\n class=\"sds-day-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n *ngIf=\"showHourLabels\" \r\n class=\"sds-timeline-hour-header\">\r\n\r\n <div \r\n *ngFor=\"let label of hourLabels;\"\r\n class=\"sds-hour-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n class=\"sds-timeline flex-grow-1\"\r\n [style.height]=\"timelineHeight\"\r\n >\r\n\r\n <div \r\n *ngFor=\"let tick of hourTicks\"\r\n class=\"sds-timeline-tick\" \r\n [ngStyle]=\"tick.x == 100 ? {'left': 'calc(' + tick.x +'% - 1px)'} : {'left': 'calc(' + tick.x + '% - 0.5px)'}\"\r\n >\r\n </div>\r\n\r\n
|
|
387
|
+
args: [{ selector: 'sds-timeline', template: "<ng-template #defaultItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item h-100\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultPointInTimeItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item h-100\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<div \r\n #viewport\r\n class=\"sds-timeline-viewport\"\r\n (wheel)=\"onScroll($event)\"\r\n\r\n (mousedown)=\"onDragStart($event)\"\r\n (touchstart)=\"onDragStart($event)\"\r\n >\r\n\r\n <div \r\n class=\"sds-timeline-container d-flex flex-column\"\r\n [style.left.%]=\"viewOffsetPercent\"\r\n [style.width.%]=\"zoomPercent\"\r\n [style.cursor]=\"isDragging ? 'ew-resize' : 'default'\"\r\n >\r\n\r\n <div\r\n *ngIf=\"showDayLabels\" \r\n class=\"sds-timeline-day-header\">\r\n\r\n <div \r\n *ngFor=\"let label of dayLabels\"\r\n class=\"sds-day-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n *ngIf=\"showHourLabels\" \r\n class=\"sds-timeline-hour-header\">\r\n\r\n <div \r\n *ngFor=\"let label of hourLabels;\"\r\n class=\"sds-hour-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n class=\"sds-timeline flex-grow-1\"\r\n [style.height]=\"timelineHeight\"\r\n >\r\n\r\n <div \r\n *ngFor=\"let tick of hourTicks\"\r\n class=\"sds-timeline-tick\" \r\n [ngStyle]=\"tick.x == 100 ? {'left': 'calc(' + tick.x +'% - 1px)'} : {'left': 'calc(' + tick.x + '% - 0.5px)'}\"\r\n >\r\n </div>\r\n\r\n <div \r\n *ngFor=\"let item of presentationItems\"\r\n class=\"sds-timeline-item-container\"\r\n [ngStyle]=\"{\r\n 'width': 'max(' + item.width +'%, 1px)',\r\n 'top': 'calc(' + item.top + ' - max(calc(' + item.height +'/2), 1px))', \r\n }\"\r\n\r\n [style.left.%]=\"item.x\"\r\n [style.height]=\"item.height\"\r\n [style.backgroundColor]=\"item.backgroundColor\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n </div>\r\n\r\n\r\n <div *ngFor=\"let item of presentationPointInTimeItems\"\r\n class=\"sds-timeline-point-in-time-item-container\"\r\n [ngClass]=\"item.class\"\t\r\n [style.height]=\"item.height\"\r\n [style.width]=\"item.width\"\r\n [ngStyle]=\"{\r\n 'top': 'calc(' + item.top + ' - max(calc(' + item.height +'/2), 1px))', \r\n 'left': 'calc(' + item.x + '% - max( calc(' + item.width +'/2), 1px))',\r\n \r\n }\"\r\n [style.backgroundColor]=\"item.backgroundColor\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"pointInTimeTemplate ? pointInTimeTemplate : defaultPointInTimeItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".sds-timeline-viewport{overflow:hidden}.sds-timeline-viewport .sds-timeline-container{width:100%;min-height:0;position:relative;-webkit-user-select:none;user-select:none}.sds-timeline-viewport .sds-timeline-container .sds-timeline-day-header{height:1.6rem;position:relative}.sds-timeline-viewport .sds-timeline-container .sds-timeline-day-header .sds-day-label{position:absolute;display:inline;text-align:center}.sds-timeline-viewport .sds-timeline-container .sds-timeline-hour-header{height:1.6rem;position:relative}.sds-timeline-viewport .sds-timeline-container .sds-timeline-hour-header .sds-hour-label{position:absolute;display:inline;text-align:center}.sds-timeline-viewport .sds-timeline-container .sds-timeline{position:relative}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-tick{border-left:1px solid rgb(187,187,187);height:100%;position:absolute;display:inline}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-item-container{height:100%;position:absolute;display:inline;top:20%;height:60%}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-item-container .sds-timeline-item{position:relative;width:100%}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-point-in-time-item-container{width:1px;height:1px;position:absolute}.sds-timeline-viewport .sds-timeline-container .sds-timeline .sds-timeline-point-in-time-item-container .sds-timeline-item{position:relative;width:100%}\n"] }]
|
|
335
388
|
}], ctorParameters: function () { return []; }, propDecorators: { start: [{
|
|
336
389
|
type: Input
|
|
337
390
|
}], end: [{
|
|
338
391
|
type: Input
|
|
339
392
|
}], items: [{
|
|
340
393
|
type: Input
|
|
394
|
+
}], pointInTimeItems: [{
|
|
395
|
+
type: Input
|
|
341
396
|
}], itemTemplate: [{
|
|
342
397
|
type: Input
|
|
398
|
+
}], pointInTimeTemplate: [{
|
|
399
|
+
type: Input
|
|
343
400
|
}], tickFrequency: [{
|
|
344
401
|
type: Input
|
|
345
402
|
}], zoomPercent: [{
|
|
346
403
|
type: Input
|
|
404
|
+
}], zoomPercentChange: [{
|
|
405
|
+
type: Output
|
|
406
|
+
}], viewOffsetPercent: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}], viewOffsetPercentChange: [{
|
|
409
|
+
type: Output
|
|
347
410
|
}], maxZoomPercent: [{
|
|
348
411
|
type: Input
|
|
349
412
|
}], showHourLabels: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-timeline.mjs","sources":["../../../projects/ngx-sds-components/src/lib/timeline/services/timeline.service.ts","../../../projects/ngx-sds-components/src/lib/timeline/components/timeline.component.ts","../../../projects/ngx-sds-components/src/lib/timeline/components/timeline.component.html","../../../projects/ngx-sds-components/src/lib/timeline/timeline.module.ts","../../../projects/ngx-sds-components/src/lib/timeline/spicainternational-ngx-sds-components-src-lib-timeline.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { TimelineIntervalLabel, TimelineTick } from '../models/timeline.model';\r\nimport { TimelineTickFrequency } from '../types/timeline.types';\r\n\r\nexport class SdsTimelineService {\r\n\r\n private start: Date = new Date();\r\n private end: Date = new Date();\r\n\r\n private widthPercentPerMinute: number;\r\n\r\n private hourTicks: TimelineTick[] = [];\r\n public dayLabels: TimelineIntervalLabel[] = [];\r\n public hourLabels: TimelineIntervalLabel[] = [];\r\n \r\n constructor(start: Date, end: Date, offSetMinutes: number) {\r\n this.start = new Date(start);\r\n this.start.setMinutes(this.start.getMinutes() - offSetMinutes);\r\n this.end = new Date(end); \r\n this.end.setMinutes(this.end.getMinutes() + offSetMinutes);\r\n this.widthPercentPerMinute = (100 / this.diffInMinutes(start, end));\r\n\r\n this.initHourTicks();\r\n this.initDayLabels();\r\n this.initHourLabels();\r\n }\r\n\r\n public getX(time: Date): number {\r\n return this.diffInMinutes(this.start, time) * this.widthPercentPerMinute; \r\n }\r\n\r\n public getWidthFromMinutes(minutes: number): number {\r\n return minutes * this.widthPercentPerMinute;\r\n }\r\n\r\n public getWidthFromTime(start: Date, end: Date): number {\r\n return this.getWidthFromMinutes(this.diffInMinutes(start, end));\r\n }\r\n\r\n public getTick(time: Date): TimelineTick {\r\n return {\r\n date: new Date(time),\r\n x: this.getX(time),\r\n } \r\n }\r\n \r\n public getHourTicks(frequency: TimelineTickFrequency = 'hourly'): TimelineTick[] {\r\n if (frequency == 'hourly') {\r\n return this.hourTicks;\r\n } else if (frequency == '3hrs') {\r\n return this.hourTicks.filter((tick, index) => index % 3 == 0)\r\n } else if (frequency == '6hrs') {\r\n return this.hourTicks.filter((tick, index) => index % 6 == 0)\r\n }\r\n return []\r\n }\r\n\r\n\r\n //#region Private Methods\r\n\r\n private diffInMinutes(start: Date, end: Date): number {\r\n return (end.getTime() - start.getTime()) / (1000 * 60);\r\n }\r\n\r\n private roundHoursUp(time: Date): Date {\r\n \r\n let newTime = new Date(time);\r\n \r\n if (newTime.getMinutes() > 0 || newTime.getSeconds() > 0 || newTime.getMilliseconds() > 0) {\r\n newTime.setHours(newTime.getHours() + 1);\r\n }\r\n newTime.setMinutes(0, 0, 0);\r\n return newTime;\r\n }\r\n\r\n\r\n private roundHoursDown(time: Date) {\r\n let newTime = new Date(time);\r\n newTime.setMinutes(0, 0, 0);\r\n return newTime;\r\n }\r\n \r\n\r\n private initHourTicks(): void {\r\n this.hourTicks = [];\r\n\r\n // get first whole hour from start date\r\n let startHour = this.roundHoursUp(this.start);\r\n\r\n // get last whole hour from end date\r\n let endHour = this.roundHoursDown(this.end);\r\n\r\n let currentHour = new Date(startHour)\r\n while (currentHour <= endHour) {\r\n this.hourTicks.push(this.getTick(currentHour));\r\n currentHour.setHours(currentHour.getHours() + 1);\r\n }\r\n }\r\n\r\n private initDayLabels(): void {\r\n this.dayLabels = [];\r\n\r\n // get start date at the beginning of the day\r\n let startDate = new Date(this.start);\r\n startDate.setHours(0, 0, 0, 0);\r\n\r\n // get end date at the end of the day\r\n let endDate = new Date(this.end);\r\n endDate.setHours(23, 59, 59, 999);\r\n\r\n let currentDate = new Date(startDate);\r\n while (currentDate <= endDate) {\r\n let endOfCurrentDay = new Date(currentDate);\r\n endOfCurrentDay.setHours(23, 59, 59, 999);\r\n\r\n this.dayLabels.push({\r\n // date: new Date(currentDate),\r\n x: this.getX(new Date(currentDate)),\r\n width: this.getWidthFromTime(currentDate, endOfCurrentDay),\r\n label: currentDate.toLocaleDateString([], { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })\r\n });\r\n currentDate.setDate(currentDate.getDate() + 1); \r\n }\r\n } \r\n \r\n private initHourLabels(): void {\r\n\r\n // get first whole hour from start date\r\n let startHour = this.roundHoursUp(this.start);\r\n // get last whole hour from end date\r\n let endHour = this.roundHoursDown(this.end);\r\n\r\n let currentHour = new Date(startHour)\r\n while (currentHour <= endHour) {\r\n if (currentHour.getHours() % 3 === 0) {\r\n let labelStartTime = new Date(currentHour);\r\n labelStartTime.setMinutes(-30);\r\n this.hourLabels.push(\r\n {\r\n x: this.getX(labelStartTime),\r\n width: this.getWidthFromMinutes(60),\r\n label: currentHour.getHours().toString() //currentHour.toLocaleTimeString([], { hour: 'numeric'})\r\n }\r\n );\r\n currentHour.setHours(currentHour.getHours() + 2);\r\n }\r\n currentHour.setHours(currentHour.getHours() + 1);\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n ElementRef,\r\n HostListener,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n SimpleChanges,\r\n TemplateRef,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { TimelineTickFrequency } from '../types/timeline.types';\r\nimport { SdsTimelineService } from '../services/timeline.service';\r\nimport {\r\n TimelineIntervalLabel,\r\n TimelineItem,\r\n TimelineItemPresentation,\r\n TimelineTick,\r\n} from '../models/timeline.model';\r\n\r\n@Component({\r\n selector: 'sds-timeline',\r\n templateUrl: './timeline.component.html',\r\n styleUrls: ['./timeline.component.scss'],\r\n})\r\nexport class SdsTimelineComponent implements OnInit, OnChanges, AfterViewInit {\r\n /**\r\n * The start date and time for the timeline.\r\n *\r\n * @type {Date}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() start: Date = new Date();\r\n\r\n /**\r\n * The end date and time for the timeline.\r\n *\r\n * @type {Date}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() end: Date = new Date();\r\n\r\n /**\r\n * The items to be displayed on the timeline. Specify data if you need \r\n * additional data for custom rendering of the items.\r\n *\r\n * @type {TimelineItem[]}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() items: TimelineItem[] = [];\r\n\r\n /**\r\n * The template to be used for custom rendering of the items.\r\n *\r\n * @type {(TemplateRef<any> | undefined)}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() itemTemplate: TemplateRef<any> | undefined = undefined;\r\n\r\n /**\r\n * The frequency of the ticks on the timeline.\r\n *\r\n * @type {TimelineTickFrequency}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() tickFrequency: TimelineTickFrequency = 'hourly';\r\n /**\r\n * The current zoom level of the timeline. In percent.\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() zoomPercent: number = 100;\r\n\r\n /**\r\n * The maximum allowed zoom level of the timeline. In percent.\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() maxZoomPercent: number = 500;\r\n\r\n /**\r\n * Whether to show hour labels.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() showHourLabels: boolean = true;\r\n\r\n /**\r\n * Whether to show day labels. \r\n *\r\n * @type {boolean}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() showDayLabels: boolean = false;\r\n\r\n /**\r\n * The height of the timeline. Default is 2rem.\r\n *\r\n * @type {string}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() timelineHeight: string = '2rem';\r\n\r\n /**\r\n * Whether to enable zoom and drag functionality.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() enableZoomAndDrag: boolean = true;\r\n\r\n /**\r\n * Number of minutes added to start and stop to fit the data on the edges\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n offSetMinutes: number = 15;\r\n\r\n // protected\r\n hourTicks: TimelineTick[] = [];\r\n hourLabels: TimelineIntervalLabel[] = [];\r\n dayLabels: TimelineIntervalLabel[] = [];\r\n\r\n private _timelineService: SdsTimelineService = new SdsTimelineService(\r\n this.start,\r\n this.end,\r\n this.offSetMinutes\r\n );\r\n\r\n public presentationItems: TimelineItemPresentation[] = [];\r\n\r\n public viewOffsetPercent = 0;\r\n\r\n public isDragging = false;\r\n public initialDragX = 0;\r\n\r\n private viewOffsetPercentDragStart = 0;\r\n\r\n @ViewChild('viewport', { static: true }) _viewport: ElementRef | undefined;\r\n\r\n constructor() {}\r\n\r\n ngAfterViewInit(): void {\r\n this.generateTicks();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (this.start && this.end) {\r\n this._timelineService = new SdsTimelineService(\r\n this.start,\r\n this.end,\r\n this.offSetMinutes\r\n );\r\n this.generateTicks();\r\n this.generateInternalTimelineItems();\r\n }\r\n\r\n if (changes['start'] || changes['end']) {\r\n this._timelineService = new SdsTimelineService(\r\n this.start,\r\n this.end,\r\n this.offSetMinutes\r\n );\r\n }\r\n\r\n if (changes['items']) {\r\n this.generateInternalTimelineItems();\r\n }\r\n\r\n if (changes['zoomPercent']) {\r\n this.viewOffsetPercent = (this.zoomPercent - 100) / -2;\r\n }\r\n\r\n if (changes['showDayLabels'] || changes['showHourLabels']) {\r\n this.generateTicks();\r\n } \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n //#region mouse wheel zoom\r\n onScroll(event: WheelEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n\r\n event.preventDefault();\r\n\r\n const delta = Math.sign(event.deltaY);\r\n const newZoomPercent = Math.min(\r\n Math.max(this.zoomPercent + -delta * 20, 100),\r\n this.maxZoomPercent\r\n );\r\n const deltaZoomPercent = newZoomPercent - this.zoomPercent;\r\n this.zoomPercent = newZoomPercent;\r\n \r\n // get the relative position of the cursor on the viewport so we can zoom in into this position\r\n const x = event.clientX - this._viewport?.nativeElement.getBoundingClientRect().left;\r\n const cursorRelativePosition = x / this._viewport?.nativeElement.getBoundingClientRect().width;\r\n this.viewOffsetPercent = this.viewOffsetPercent - deltaZoomPercent * cursorRelativePosition;\r\n\r\n this.constrainOffset();\r\n }\r\n }\r\n //#endregion\r\n\r\n //#region dragging\r\n \r\n public onDragStart(event: MouseEvent | TouchEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n event.preventDefault();\r\n this.isDragging = true;\r\n this.viewOffsetPercentDragStart = this.viewOffsetPercent;\r\n\r\n if (event instanceof MouseEvent) {\r\n this.initialDragX = event.clientX;\r\n } else if (event instanceof TouchEvent) {\r\n this.initialDragX = event.touches[0].clientX;\r\n }\r\n }\r\n }\r\n\r\n @HostListener('window:mousemove', ['$event'])\r\n public onDragMove(event: MouseEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n if (this.isDragging) {\r\n const currentX = event.clientX;\r\n this.moveElement(currentX);\r\n }\r\n }\r\n }\r\n\r\n @HostListener('window:touchmove', ['$event'])\r\n onDragMoveTouch(event: TouchEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n if (this.isDragging) {\r\n const currentX = event.touches[0].clientX;\r\n this.moveElement(currentX);\r\n }\r\n }\r\n }\r\n\r\n @HostListener('window:mouseup', ['$event'])\r\n @HostListener('window:touchend', ['$event'])\r\n public onDragEnd(event: MouseEvent | TouchEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n this.isDragging = false;\r\n }\r\n }\r\n\r\n private moveElement(currentX: number): void {\r\n const diff = currentX - this.initialDragX;\r\n if (this._viewport && this._viewport.nativeElement) {\r\n const diffInPercent = (diff / this._viewport?.nativeElement.getBoundingClientRect().width) * 100;\r\n this.viewOffsetPercent = this.viewOffsetPercentDragStart + diffInPercent;\r\n this.constrainOffset();\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n private constrainOffset(): void {\r\n if (this.zoomPercent + this.viewOffsetPercent < 100) {\r\n this.viewOffsetPercent = -this.zoomPercent + 100;\r\n }\r\n this.viewOffsetPercent = Math.min(0, this.viewOffsetPercent);\r\n }\r\n\r\n private generateTicks(): void {\r\n this.hourTicks = this._timelineService.getHourTicks(this.tickFrequency);\r\n this.dayLabels = this._timelineService.dayLabels;\r\n this.hourLabels = this._timelineService.hourLabels;\r\n }\r\n\r\n private generateInternalTimelineItems(): void {\r\n this.presentationItems = this.items.map((item) => {\r\n\r\n const startTime = new Date(item.start).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\r\n const endTime = new Date(item.end).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\r\n const timeRange = `${startTime} - ${endTime}`;\r\n \r\n return {\r\n data: item.data,\r\n x: this._timelineService.getX(item.start),\r\n width: this._timelineService.getWidthFromTime(\r\n item.start,\r\n item.end\r\n ),\r\n hint: item.hint ?? timeRange\r\n };\r\n });\r\n }\r\n}\r\n","<ng-template #defaultItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<div \r\n #viewport\r\n class=\"sds-timeline-viewport\"\r\n (wheel)=\"onScroll($event)\"\r\n\r\n (mousedown)=\"onDragStart($event)\"\r\n (touchstart)=\"onDragStart($event)\"\r\n >\r\n\r\n <div \r\n class=\"sds-timeline-container d-flex flex-column\"\r\n [style.left.%]=\"viewOffsetPercent\"\r\n [style.width.%]=\"zoomPercent\"\r\n [style.cursor]=\"isDragging ? 'ew-resize' : 'default'\"\r\n >\r\n\r\n <div\r\n *ngIf=\"showDayLabels\" \r\n class=\"sds-timeline-day-header\">\r\n\r\n <div \r\n *ngFor=\"let label of dayLabels\"\r\n class=\"sds-day-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n *ngIf=\"showHourLabels\" \r\n class=\"sds-timeline-hour-header\">\r\n\r\n <div \r\n *ngFor=\"let label of hourLabels;\"\r\n class=\"sds-hour-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n class=\"sds-timeline flex-grow-1\"\r\n [style.height]=\"timelineHeight\"\r\n >\r\n\r\n <div \r\n *ngFor=\"let tick of hourTicks\"\r\n class=\"sds-timeline-tick\" \r\n [ngStyle]=\"tick.x == 100 ? {'left': 'calc(' + tick.x +'% - 1px)'} : {'left': 'calc(' + tick.x + '% - 0.5px)'}\"\r\n >\r\n </div>\r\n\r\n\r\n <div \r\n *ngFor=\"let item of presentationItems\"\r\n class=\"sds-timeline-item-container\"\r\n [ngStyle]=\"{'width': 'max(' + item.width +'%, 1px)'}\"\r\n [style.left.%]=\"item.x\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsTimelineComponent } from './components/timeline.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsTimelineComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n SdsTimelineComponent\r\n ],\r\n})\r\nexport class SdsTimelineModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAIa,kBAAkB,CAAA;AAW3B,IAAA,WAAA,CAAY,KAAW,EAAE,GAAS,EAAE,aAAqB,EAAA;AATjD,QAAA,IAAA,CAAA,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;AACzB,QAAA,IAAA,CAAA,GAAG,GAAS,IAAI,IAAI,EAAE,CAAC;AAIvB,QAAA,IAAS,CAAA,SAAA,GAAmB,EAAE,CAAC;AAChC,QAAA,IAAS,CAAA,SAAA,GAA4B,EAAE,CAAC;AACxC,QAAA,IAAU,CAAA,UAAA,GAA4B,EAAE,CAAC;QAG5C,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7B,QAAA,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,aAAa,CAAC,CAAC;QAC/D,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,QAAA,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,aAAa,CAAC,CAAC;AAC3D,QAAA,IAAI,CAAC,qBAAqB,IAAI,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAEpE,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,cAAc,EAAE,CAAC;KACzB;AAEM,IAAA,IAAI,CAAC,IAAU,EAAA;AAClB,QAAA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;kBAX7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;wBACV,oBAAoB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;AACf,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,oBAAoB;AACvB,qBAAA;iBACJ,CAAA;;;ACdD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-timeline.mjs","sources":["../../../projects/ngx-sds-components/src/lib/timeline/services/timeline.service.ts","../../../projects/ngx-sds-components/src/lib/timeline/components/timeline.component.ts","../../../projects/ngx-sds-components/src/lib/timeline/components/timeline.component.html","../../../projects/ngx-sds-components/src/lib/timeline/timeline.module.ts","../../../projects/ngx-sds-components/src/lib/timeline/spicainternational-ngx-sds-components-src-lib-timeline.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { TimelineIntervalLabel, TimelineTick } from '../models/timeline.model';\r\nimport { TimelineTickFrequency } from '../types/timeline.types';\r\n\r\nexport class SdsTimelineService {\r\n\r\n private start: Date = new Date();\r\n private end: Date = new Date();\r\n\r\n private widthPercentPerMinute: number;\r\n\r\n private hourTicks: TimelineTick[] = [];\r\n public dayLabels: TimelineIntervalLabel[] = [];\r\n public hourLabels: TimelineIntervalLabel[] = [];\r\n \r\n constructor(start: Date, end: Date, offSetMinutes: number) {\r\n this.start = new Date(start);\r\n this.start.setMinutes(this.start.getMinutes() - offSetMinutes);\r\n this.end = new Date(end); \r\n this.end.setMinutes(this.end.getMinutes() + offSetMinutes);\r\n this.widthPercentPerMinute = (100 / this.diffInMinutes(start, end));\r\n\r\n this.initHourTicks();\r\n this.initDayLabels();\r\n this.initHourLabels();\r\n }\r\n\r\n public getX(time: Date): number {\r\n return this.diffInMinutes(this.start, time) * this.widthPercentPerMinute; \r\n }\r\n\r\n public getWidthFromMinutes(minutes: number): number {\r\n return minutes * this.widthPercentPerMinute;\r\n }\r\n\r\n public getWidthFromTime(start: Date, end: Date): number {\r\n return this.getWidthFromMinutes(this.diffInMinutes(start, end));\r\n }\r\n\r\n public getTick(time: Date): TimelineTick {\r\n return {\r\n date: new Date(time),\r\n x: this.getX(time),\r\n } \r\n }\r\n \r\n public getHourTicks(frequency: TimelineTickFrequency = 'hourly'): TimelineTick[] {\r\n if (frequency == 'hourly') {\r\n return this.hourTicks;\r\n } else if (frequency == '3hrs') {\r\n return this.hourTicks.filter((tick, index) => index % 3 == 0)\r\n } else if (frequency == '6hrs') {\r\n return this.hourTicks.filter((tick, index) => index % 6 == 0)\r\n }\r\n return []\r\n }\r\n\r\n\r\n //#region Private Methods\r\n\r\n private diffInMinutes(start: Date, end: Date): number {\r\n return (end.getTime() - start.getTime()) / (1000 * 60);\r\n }\r\n\r\n private roundHoursUp(time: Date): Date {\r\n \r\n let newTime = new Date(time);\r\n \r\n if (newTime.getMinutes() > 0 || newTime.getSeconds() > 0 || newTime.getMilliseconds() > 0) {\r\n newTime.setHours(newTime.getHours() + 1);\r\n }\r\n newTime.setMinutes(0, 0, 0);\r\n return newTime;\r\n }\r\n\r\n\r\n private roundHoursDown(time: Date) {\r\n let newTime = new Date(time);\r\n newTime.setMinutes(0, 0, 0);\r\n return newTime;\r\n }\r\n \r\n\r\n private initHourTicks(): void {\r\n this.hourTicks = [];\r\n\r\n // get first whole hour from start date\r\n let startHour = this.roundHoursUp(this.start);\r\n\r\n // get last whole hour from end date\r\n let endHour = this.roundHoursDown(this.end);\r\n\r\n let currentHour = new Date(startHour)\r\n while (currentHour <= endHour) {\r\n this.hourTicks.push(this.getTick(currentHour));\r\n currentHour.setHours(currentHour.getHours() + 1);\r\n }\r\n }\r\n\r\n private initDayLabels(): void {\r\n this.dayLabels = [];\r\n\r\n // get start date at the beginning of the day\r\n let startDate = new Date(this.start);\r\n startDate.setHours(0, 0, 0, 0);\r\n\r\n // get end date at the end of the day\r\n let endDate = new Date(this.end);\r\n endDate.setHours(23, 59, 59, 999);\r\n\r\n let currentDate = new Date(startDate);\r\n while (currentDate <= endDate) {\r\n let endOfCurrentDay = new Date(currentDate);\r\n endOfCurrentDay.setHours(23, 59, 59, 999);\r\n\r\n this.dayLabels.push({\r\n // date: new Date(currentDate),\r\n x: this.getX(new Date(currentDate)),\r\n width: this.getWidthFromTime(currentDate, endOfCurrentDay),\r\n label: currentDate.toLocaleDateString([], { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' })\r\n });\r\n currentDate.setDate(currentDate.getDate() + 1); \r\n }\r\n } \r\n \r\n private initHourLabels(): void {\r\n\r\n // get first whole hour from start date\r\n let startHour = this.roundHoursUp(this.start);\r\n // get last whole hour from end date\r\n let endHour = this.roundHoursDown(this.end);\r\n\r\n let currentHour = new Date(startHour)\r\n while (currentHour <= endHour) {\r\n if (currentHour.getHours() % 3 === 0) {\r\n let labelStartTime = new Date(currentHour);\r\n labelStartTime.setMinutes(-30);\r\n this.hourLabels.push(\r\n {\r\n x: this.getX(labelStartTime),\r\n width: this.getWidthFromMinutes(60),\r\n label: currentHour.getHours().toString() //currentHour.toLocaleTimeString([], { hour: 'numeric'})\r\n }\r\n );\r\n currentHour.setHours(currentHour.getHours() + 2);\r\n }\r\n currentHour.setHours(currentHour.getHours() + 1);\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n ElementRef,\r\n HostListener,\r\n Input,\r\n OnChanges,\r\n OnInit,\r\n Output,\r\n SimpleChanges,\r\n TemplateRef,\r\n ViewChild,\r\n EventEmitter\r\n} from '@angular/core';\r\nimport { TimelineTickFrequency } from '../types/timeline.types';\r\nimport { SdsTimelineService } from '../services/timeline.service';\r\nimport {\r\n TimelineIntervalLabel,\r\n TimelineItem,\r\n TimelineItemPresentation,\r\n TimelinePointInTimeItem,\r\n TimelinePointInTimeItemPresentation,\r\n TimelineTick,\r\n} from '../models/timeline.model';\r\n\r\n@Component({\r\n selector: 'sds-timeline',\r\n templateUrl: './timeline.component.html',\r\n styleUrls: ['./timeline.component.scss'],\r\n})\r\nexport class SdsTimelineComponent implements OnInit, OnChanges, AfterViewInit {\r\n /**\r\n * The start date and time for the timeline.\r\n *\r\n * @type {Date}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() start: Date = new Date();\r\n\r\n /**\r\n * The end date and time for the timeline.\r\n *\r\n * @type {Date}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() end: Date = new Date();\r\n\r\n /**\r\n * The period based items to be displayed on the timeline. Specify data if you need \r\n * additional data for custom rendering of the items.\r\n *\r\n * @type {TimelineItem[]}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() items: TimelineItem[] = [];\r\n\r\n /**\r\n * Items to be displayed on the timeline at a specific point in time.\r\n * Specify data if you need additional data for custom rendering of the items.\r\n *\r\n * @type {TimelinePointInTimeItem[]}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() pointInTimeItems: TimelinePointInTimeItem[] = [];\r\n\r\n /**\r\n * The template to be used for custom rendering of the items.\r\n *\r\n * @type {(TemplateRef<any> | undefined)}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() itemTemplate: TemplateRef<any> | undefined = undefined;\r\n\r\n /**\r\n * The template to be used for custom rendering of the poin-in-time items.\r\n *\r\n * @type {(TemplateRef<any> | undefined)}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() pointInTimeTemplate: TemplateRef<any> | undefined = undefined;\r\n\r\n\r\n /**\r\n * The frequency of the ticks on the timeline.\r\n *\r\n * @type {TimelineTickFrequency}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() tickFrequency: TimelineTickFrequency = 'hourly';\r\n /**\r\n * The current zoom level of the timeline. In percent.\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() zoomPercent: number = 100;\r\n @Output() zoomPercentChange = new EventEmitter<number>();\r\n\r\n /**\r\n * Initial offset of the viewport in percent. This is used in scenarios \r\n * with multiple days when you want to show non-first day as defult.\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() viewOffsetPercent: number = 0;\r\n @Output() viewOffsetPercentChange = new EventEmitter<number>();\r\n\r\n /**\r\n * The maximum allowed zoom level of the timeline. In percent.\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() maxZoomPercent: number = 500;\r\n\r\n /**\r\n * Whether to show hour labels.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() showHourLabels: boolean = true;\r\n\r\n /**\r\n * Whether to show day labels. \r\n *\r\n * @type {boolean}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() showDayLabels: boolean = false;\r\n\r\n /**\r\n * The height of the timeline. Default is 2rem.\r\n *\r\n * @type {string}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() timelineHeight: string = '2rem';\r\n\r\n /**\r\n * Whether to enable zoom and drag functionality.\r\n *\r\n * @type {boolean}\r\n * @memberof SdsTimelineComponent\r\n */\r\n @Input() enableZoomAndDrag: boolean = true;\r\n\r\n /**\r\n * Number of minutes added to start and stop to fit the data on the edges\r\n *\r\n * @type {number}\r\n * @memberof SdsTimelineComponent\r\n */\r\n offSetMinutes: number = 15;\r\n\r\n // protected\r\n hourTicks: TimelineTick[] = [];\r\n hourLabels: TimelineIntervalLabel[] = [];\r\n dayLabels: TimelineIntervalLabel[] = [];\r\n\r\n private _timelineService: SdsTimelineService = new SdsTimelineService(\r\n this.start,\r\n this.end,\r\n this.offSetMinutes\r\n );\r\n\r\n public presentationItems: TimelineItemPresentation[] = [];\r\n public presentationPointInTimeItems: TimelinePointInTimeItemPresentation[] = [];\r\n\r\n public isDragging = false;\r\n public initialDragX = 0;\r\n\r\n private viewOffsetPercentDragStart = 0;\r\n\r\n @ViewChild('viewport', { static: true }) _viewport: ElementRef | undefined;\r\n\r\n constructor() {}\r\n\r\n ngAfterViewInit(): void {\r\n this.generateTicks();\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (this.start && this.end) {\r\n this._timelineService = new SdsTimelineService(\r\n this.start,\r\n this.end,\r\n this.offSetMinutes\r\n );\r\n this.generateTicks();\r\n this.generateInternalTimelineItems();\r\n }\r\n\r\n if (changes['start'] || changes['end']) {\r\n this._timelineService = new SdsTimelineService(\r\n this.start,\r\n this.end,\r\n this.offSetMinutes\r\n );\r\n }\r\n\r\n if (changes['items']) {\r\n this.generateInternalTimelineItems();\r\n }\r\n\r\n if (changes['pointInTimeItems']) {\r\n this.generateInternalTimelinePointInTimeItems();\r\n }\r\n\r\n if (changes['zoomPercent']) {\r\n // this.viewOffsetPercent = (this.zoomPercent - 100) / -2;\r\n }\r\n\r\n if (changes['showDayLabels'] || changes['showHourLabels']) {\r\n this.generateTicks();\r\n } \r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n //#region mouse wheel zoom\r\n onScroll(event: WheelEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n\r\n event.preventDefault();\r\n\r\n const delta = Math.sign(event.deltaY);\r\n const newZoomPercent = Math.min(\r\n Math.max(this.zoomPercent + -delta * 20, 100),\r\n this.maxZoomPercent\r\n );\r\n const deltaZoomPercent = newZoomPercent - this.zoomPercent;\r\n this.zoomPercent = newZoomPercent;\r\n this.zoomPercentChange.emit(this.zoomPercent);\r\n \r\n // get the relative position of the cursor on the viewport so we can zoom in into this position\r\n const x = event.clientX - this._viewport?.nativeElement.getBoundingClientRect().left;\r\n const cursorRelativePosition = x / this._viewport?.nativeElement.getBoundingClientRect().width;\r\n // this.viewOffsetPercent = this.viewOffsetPercent - deltaZoomPercent * cursorRelativePosition;\r\n\r\n this.constrainOffset(this.viewOffsetPercent - deltaZoomPercent * cursorRelativePosition);\r\n }\r\n }\r\n //#endregion\r\n\r\n //#region dragging\r\n \r\n public onDragStart(event: MouseEvent | TouchEvent): void {\r\n if (this.enableZoomAndDrag && this.zoomPercent > 100) {\r\n event.preventDefault();\r\n this.isDragging = true;\r\n this.viewOffsetPercentDragStart = this.viewOffsetPercent;\r\n\r\n if (event instanceof MouseEvent) {\r\n this.initialDragX = event.clientX;\r\n } else if (event instanceof TouchEvent) {\r\n this.initialDragX = event.touches[0].clientX;\r\n }\r\n }\r\n }\r\n\r\n @HostListener('window:mousemove', ['$event'])\r\n public onDragMove(event: MouseEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n if (this.isDragging) {\r\n const currentX = event.clientX;\r\n this.moveElement(currentX);\r\n }\r\n }\r\n }\r\n\r\n @HostListener('window:touchmove', ['$event'])\r\n onDragMoveTouch(event: TouchEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n if (this.isDragging) {\r\n const currentX = event.touches[0].clientX;\r\n this.moveElement(currentX);\r\n }\r\n }\r\n }\r\n\r\n @HostListener('window:mouseup', ['$event'])\r\n @HostListener('window:touchend', ['$event'])\r\n public onDragEnd(event: MouseEvent | TouchEvent): void {\r\n if (this.enableZoomAndDrag) {\r\n this.isDragging = false;\r\n }\r\n }\r\n\r\n private moveElement(currentX: number): void {\r\n const diff = currentX - this.initialDragX;\r\n if (this._viewport && this._viewport.nativeElement) {\r\n const diffInPercent = (diff / this._viewport?.nativeElement.getBoundingClientRect().width) * 100;\r\n // this.viewOffsetPercent = this.viewOffsetPercentDragStart + diffInPercent;\r\n this.constrainOffset(this.viewOffsetPercentDragStart + diffInPercent);\r\n }\r\n }\r\n\r\n //#endregion\r\n\r\n private constrainOffset(newOffset: number): void { \r\n if (this.zoomPercent + newOffset < 100) {\r\n newOffset = -this.zoomPercent + 100;\r\n }\r\n newOffset = Math.min(0, newOffset);\r\n if (newOffset != this.viewOffsetPercent) {\r\n this.viewOffsetPercent = newOffset;\r\n this.viewOffsetPercentChange.emit(this.viewOffsetPercent);\r\n }\r\n }\r\n\r\n private generateTicks(): void {\r\n this.hourTicks = this._timelineService.getHourTicks(this.tickFrequency);\r\n this.dayLabels = this._timelineService.dayLabels;\r\n this.hourLabels = this._timelineService.hourLabels;\r\n }\r\n\r\n private generateInternalTimelineItems(): void {\r\n this.presentationItems = this.items.map((item) => {\r\n\r\n const startTime = new Date(item.start).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\r\n const endTime = new Date(item.end).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\r\n const timeRange = `${startTime} - ${endTime}`;\r\n \r\n return {\r\n data: item.data,\r\n x: this._timelineService.getX(item.start),\r\n width: this._timelineService.getWidthFromTime(\r\n item.start,\r\n item.end\r\n ),\r\n hint: item.hint ?? timeRange,\r\n backgroundColor: item.backgroundColor,\r\n top: item.top ?? '50%',\r\n height: item.height ?? '60%',\r\n class: item.class,\r\n };\r\n });\r\n }\r\n\r\n\r\n private generateInternalTimelinePointInTimeItems(): void {\r\n this.presentationPointInTimeItems = this.pointInTimeItems.map((item) => {\r\n\r\n const timePointString = new Date(item.date).toLocaleTimeString([], { hour: 'numeric', minute: '2-digit' });\r\n \r\n return {\r\n data: item.data,\r\n x: this._timelineService.getX(item.date),\r\n hint: item.hint ?? timePointString,\r\n top: item.top ?? '20%',\r\n height: item.height ?? '1rem',\r\n width: item.width ?? '1rem',\r\n class: item.class,\r\n backgroundColor: item.backgroundColor,\r\n };\r\n });\r\n }\r\n}\r\n","<ng-template #defaultItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item h-100\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #defaultPointInTimeItemTemplate let-item=\"item\">\r\n <div \r\n class=\"sds-timeline-item h-100\"\r\n [title]=\"item.hint\"\r\n >\r\n </div>\r\n</ng-template>\r\n\r\n<div \r\n #viewport\r\n class=\"sds-timeline-viewport\"\r\n (wheel)=\"onScroll($event)\"\r\n\r\n (mousedown)=\"onDragStart($event)\"\r\n (touchstart)=\"onDragStart($event)\"\r\n >\r\n\r\n <div \r\n class=\"sds-timeline-container d-flex flex-column\"\r\n [style.left.%]=\"viewOffsetPercent\"\r\n [style.width.%]=\"zoomPercent\"\r\n [style.cursor]=\"isDragging ? 'ew-resize' : 'default'\"\r\n >\r\n\r\n <div\r\n *ngIf=\"showDayLabels\" \r\n class=\"sds-timeline-day-header\">\r\n\r\n <div \r\n *ngFor=\"let label of dayLabels\"\r\n class=\"sds-day-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n *ngIf=\"showHourLabels\" \r\n class=\"sds-timeline-hour-header\">\r\n\r\n <div \r\n *ngFor=\"let label of hourLabels;\"\r\n class=\"sds-hour-label font-monospace\" \r\n [style.left.%]=\"label.x\"\r\n [style.width.%]=\"label.width\"\r\n >\r\n <small>\r\n {{label.label}}\r\n </small>\r\n </div>\r\n </div>\r\n\r\n <div \r\n class=\"sds-timeline flex-grow-1\"\r\n [style.height]=\"timelineHeight\"\r\n >\r\n\r\n <div \r\n *ngFor=\"let tick of hourTicks\"\r\n class=\"sds-timeline-tick\" \r\n [ngStyle]=\"tick.x == 100 ? {'left': 'calc(' + tick.x +'% - 1px)'} : {'left': 'calc(' + tick.x + '% - 0.5px)'}\"\r\n >\r\n </div>\r\n\r\n <div \r\n *ngFor=\"let item of presentationItems\"\r\n class=\"sds-timeline-item-container\"\r\n [ngStyle]=\"{\r\n 'width': 'max(' + item.width +'%, 1px)',\r\n 'top': 'calc(' + item.top + ' - max(calc(' + item.height +'/2), 1px))', \r\n }\"\r\n\r\n [style.left.%]=\"item.x\"\r\n [style.height]=\"item.height\"\r\n [style.backgroundColor]=\"item.backgroundColor\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"itemTemplate ? itemTemplate : defaultItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n </div>\r\n\r\n\r\n <div *ngFor=\"let item of presentationPointInTimeItems\"\r\n class=\"sds-timeline-point-in-time-item-container\"\r\n [ngClass]=\"item.class\"\t\r\n [style.height]=\"item.height\"\r\n [style.width]=\"item.width\"\r\n [ngStyle]=\"{\r\n 'top': 'calc(' + item.top + ' - max(calc(' + item.height +'/2), 1px))', \r\n 'left': 'calc(' + item.x + '% - max( calc(' + item.width +'/2), 1px))',\r\n \r\n }\"\r\n [style.backgroundColor]=\"item.backgroundColor\"\r\n >\r\n\r\n <ng-container \r\n [ngTemplateOutlet]=\"pointInTimeTemplate ? pointInTimeTemplate : defaultPointInTimeItemTemplate\"\r\n [ngTemplateOutletContext]=\"{item: item}\">\r\n </ng-container> \r\n\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsTimelineComponent } from './components/timeline.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsTimelineComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n SdsTimelineComponent\r\n ],\r\n})\r\nexport class SdsTimelineModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAIa,kBAAkB,CAAA;AAW3B,IAAA,WAAA,CAAY,KAAW,EAAE,GAAS,EAAE,aAAqB,EAAA;AATjD,QAAA,IAAA,CAAA,KAAK,GAAS,IAAI,IAAI,EAAE,CAAC;AACzB,QAAA,IAAA,CAAA,GAAG,GAAS,IAAI,IAAI,EAAE,CAAC;AAIvB,QAAA,IAAS,CAAA,SAAA,GAAmB,EAAE,CAAC;AAChC,QAAA,IAAS,CAAA,SAAA,GAA4B,EAAE,CAAC;AACxC,QAAA,IAAU,CAAA,UAAA,GAA4B,EAAE,CAAC;QAG5C,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7B,QAAA,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,aAAa,CAAC,CAAC;QAC/D,IAAI,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,C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;wBACL,YAAY;AACf,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,oBAAoB;AACvB,qBAAA;iBACJ,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -25,10 +25,10 @@ class SdsTableActionsComponent {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
SdsTableActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsTableActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
SdsTableActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SdsTableActionsComponent, selector: "sds-table-actions", inputs: { dropdownIcon: "dropdownIcon", dropDownAutoClose: "dropDownAutoClose", dropdownMinWidth: "dropdownMinWidth" }, host: { properties: { "class.actions-dropdown-open": "this.showDropdown" } }, ngImport: i0, template: "<div class=\"sds-actions-container me-2\">\r\n <div class=\"btn-group sds-actions-wrapper\">\r\n <ng-content select=\"quickActions\"></ng-content>\r\n\r\n <button\r\n #dropdownButton\r\n class=\"sds-actions-dropdown-button sds-btn-table\"\r\n type=\"button\"\r\n (click)=\"toggleDropdownMenu()\"\r\n >\r\n <fa-icon [icon]=\"dropdownIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\">\r\n </fa-icon>\r\n </button>\r\n\r\n <dx-popover\r\n [target]=\"dropdownButton\"\r\n [(visible)]=\"showDropdown\"\r\n [minWidth]=\"dropdownMinWidth\"\r\n [wrapperAttr]=\"{ class: 'sds-actions-dropdown' }\"\r\n >\r\n <dxo-position\r\n my=\"right top\"\r\n at=\"right bottom\"\r\n [of]=\"dropdownButton\"\r\n >\r\n <dxo-offset [y]=\"-7\"></dxo-offset>\r\n </dxo-position>\r\n\r\n <ul class=\"sds-table-dropdown-menu\" (click)=\"closeDropdownMenu()\">\r\n <ng-content></ng-content>\r\n </ul>\r\n </dx-popover>\r\n </div>\r\n</div>\r\n", styles: ["::ng-deep .dx-datagrid-rowsview:has(sds-table-actions){overflow:visible}.sds-actions-dropdown-container{list-style:none}::ng-deep .sds-actions-dropdown .dx-popover-arrow{display:none}::ng-deep .sds-actions-dropdown .dx-popup-content{padding:0rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu{list-style:none;padding-left:0;margin-bottom:.25rem;margin-top:.25rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item{padding:.5rem 1rem;font-size:.9rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:hover{background-color:var(--bs-gray-200)}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:active{background-color:var(--bs-primary);color:#fff}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-divider{background-color:var(--bs-border-color-translucent);height:1px;margin-top:.
|
|
28
|
+
SdsTableActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: SdsTableActionsComponent, selector: "sds-table-actions", inputs: { dropdownIcon: "dropdownIcon", dropDownAutoClose: "dropDownAutoClose", dropdownMinWidth: "dropdownMinWidth" }, host: { properties: { "class.actions-dropdown-open": "this.showDropdown" } }, ngImport: i0, template: "<div class=\"sds-actions-container me-2\">\r\n <div class=\"btn-group sds-actions-wrapper\">\r\n <ng-content select=\"quickActions\"></ng-content>\r\n\r\n <button\r\n #dropdownButton\r\n class=\"sds-actions-dropdown-button sds-btn-table\"\r\n type=\"button\"\r\n (click)=\"toggleDropdownMenu()\"\r\n >\r\n <fa-icon [icon]=\"dropdownIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\">\r\n </fa-icon>\r\n </button>\r\n\r\n <dx-popover\r\n [target]=\"dropdownButton\"\r\n [(visible)]=\"showDropdown\"\r\n [minWidth]=\"dropdownMinWidth\"\r\n [wrapperAttr]=\"{ class: 'sds-actions-dropdown' }\"\r\n >\r\n <dxo-position\r\n my=\"right top\"\r\n at=\"right bottom\"\r\n [of]=\"dropdownButton\"\r\n >\r\n <dxo-offset [y]=\"-7\"></dxo-offset>\r\n </dxo-position>\r\n\r\n <ul class=\"sds-table-dropdown-menu\" (click)=\"closeDropdownMenu()\">\r\n <ng-content></ng-content>\r\n </ul>\r\n </dx-popover>\r\n </div>\r\n</div>\r\n", styles: ["::ng-deep .dx-datagrid-rowsview:has(sds-table-actions){overflow:visible}.sds-actions-dropdown-container{list-style:none}::ng-deep .sds-actions-dropdown .dx-popover-arrow{display:none}::ng-deep .sds-actions-dropdown .dx-popup-content{padding:0rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu{list-style:none;padding-left:0;margin-bottom:.25rem;margin-top:.25rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item{padding:.5rem 1rem;font-size:.9rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:hover{background-color:var(--bs-gray-200)}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:active{background-color:var(--bs-primary);color:#fff}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-divider{background-color:var(--bs-border-color-translucent);height:1px;margin-top:.25rem;margin-bottom:.25rem}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open),.sds-row:has(sds-table-actions.actions-dropdown-open){background-color:var(--bs-gray-300)!important}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) td,.sds-row:has(sds-table-actions.actions-dropdown-open) td{background-color:var(--bs-gray-300)!important}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-action-button,::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button,.sds-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-action-button,.sds-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button{border-color:var(--bs-gray-500)!important}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button,.sds-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button{background-color:var(--bs-gray-200)!important}\n"], dependencies: [{ kind: "component", type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "animation", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }, { kind: "component", type: i2.DxPopoverComponent, selector: "dx-popover", inputs: ["animation", "closeOnOutsideClick", "container", "contentTemplate", "copyRootClassesToWrapper", "deferRendering", "disabled", "elementAttr", "height", "hideEvent", "hideOnOutsideClick", "hideOnParentScroll", "hint", "hoverStateEnabled", "maxHeight", "maxWidth", "minHeight", "minWidth", "position", "rtlEnabled", "shading", "shadingColor", "showCloseButton", "showEvent", "showTitle", "target", "title", "titleTemplate", "toolbarItems", "visible", "width", "wrapperAttr"], outputs: ["onContentReady", "onDisposing", "onHidden", "onHiding", "onInitialized", "onOptionChanged", "onShowing", "onShown", "onTitleRendered", "animationChange", "closeOnOutsideClickChange", "containerChange", "contentTemplateChange", "copyRootClassesToWrapperChange", "deferRenderingChange", "disabledChange", "elementAttrChange", "heightChange", "hideEventChange", "hideOnOutsideClickChange", "hideOnParentScrollChange", "hintChange", "hoverStateEnabledChange", "maxHeightChange", "maxWidthChange", "minHeightChange", "minWidthChange", "positionChange", "rtlEnabledChange", "shadingChange", "shadingColorChange", "showCloseButtonChange", "showEventChange", "showTitleChange", "targetChange", "titleChange", "titleTemplateChange", "toolbarItemsChange", "visibleChange", "widthChange", "wrapperAttrChange"] }, { kind: "component", type: i3.DxoPositionComponent, selector: "dxo-position", inputs: ["at", "boundary", "boundaryOffset", "collision", "my", "of", "offset"] }, { kind: "component", type: i3.DxoOffsetComponent, selector: "dxo-offset", inputs: ["x", "y"] }] });
|
|
29
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsTableActionsComponent, decorators: [{
|
|
30
30
|
type: Component,
|
|
31
|
-
args: [{ selector: 'sds-table-actions', template: "<div class=\"sds-actions-container me-2\">\r\n <div class=\"btn-group sds-actions-wrapper\">\r\n <ng-content select=\"quickActions\"></ng-content>\r\n\r\n <button\r\n #dropdownButton\r\n class=\"sds-actions-dropdown-button sds-btn-table\"\r\n type=\"button\"\r\n (click)=\"toggleDropdownMenu()\"\r\n >\r\n <fa-icon [icon]=\"dropdownIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\">\r\n </fa-icon>\r\n </button>\r\n\r\n <dx-popover\r\n [target]=\"dropdownButton\"\r\n [(visible)]=\"showDropdown\"\r\n [minWidth]=\"dropdownMinWidth\"\r\n [wrapperAttr]=\"{ class: 'sds-actions-dropdown' }\"\r\n >\r\n <dxo-position\r\n my=\"right top\"\r\n at=\"right bottom\"\r\n [of]=\"dropdownButton\"\r\n >\r\n <dxo-offset [y]=\"-7\"></dxo-offset>\r\n </dxo-position>\r\n\r\n <ul class=\"sds-table-dropdown-menu\" (click)=\"closeDropdownMenu()\">\r\n <ng-content></ng-content>\r\n </ul>\r\n </dx-popover>\r\n </div>\r\n</div>\r\n", styles: ["::ng-deep .dx-datagrid-rowsview:has(sds-table-actions){overflow:visible}.sds-actions-dropdown-container{list-style:none}::ng-deep .sds-actions-dropdown .dx-popover-arrow{display:none}::ng-deep .sds-actions-dropdown .dx-popup-content{padding:0rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu{list-style:none;padding-left:0;margin-bottom:.25rem;margin-top:.25rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item{padding:.5rem 1rem;font-size:.9rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:hover{background-color:var(--bs-gray-200)}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:active{background-color:var(--bs-primary);color:#fff}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-divider{background-color:var(--bs-border-color-translucent);height:1px;margin-top:.
|
|
31
|
+
args: [{ selector: 'sds-table-actions', template: "<div class=\"sds-actions-container me-2\">\r\n <div class=\"btn-group sds-actions-wrapper\">\r\n <ng-content select=\"quickActions\"></ng-content>\r\n\r\n <button\r\n #dropdownButton\r\n class=\"sds-actions-dropdown-button sds-btn-table\"\r\n type=\"button\"\r\n (click)=\"toggleDropdownMenu()\"\r\n >\r\n <fa-icon [icon]=\"dropdownIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\">\r\n </fa-icon>\r\n </button>\r\n\r\n <dx-popover\r\n [target]=\"dropdownButton\"\r\n [(visible)]=\"showDropdown\"\r\n [minWidth]=\"dropdownMinWidth\"\r\n [wrapperAttr]=\"{ class: 'sds-actions-dropdown' }\"\r\n >\r\n <dxo-position\r\n my=\"right top\"\r\n at=\"right bottom\"\r\n [of]=\"dropdownButton\"\r\n >\r\n <dxo-offset [y]=\"-7\"></dxo-offset>\r\n </dxo-position>\r\n\r\n <ul class=\"sds-table-dropdown-menu\" (click)=\"closeDropdownMenu()\">\r\n <ng-content></ng-content>\r\n </ul>\r\n </dx-popover>\r\n </div>\r\n</div>\r\n", styles: ["::ng-deep .dx-datagrid-rowsview:has(sds-table-actions){overflow:visible}.sds-actions-dropdown-container{list-style:none}::ng-deep .sds-actions-dropdown .dx-popover-arrow{display:none}::ng-deep .sds-actions-dropdown .dx-popup-content{padding:0rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu{list-style:none;padding-left:0;margin-bottom:.25rem;margin-top:.25rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item{padding:.5rem 1rem;font-size:.9rem}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:hover{background-color:var(--bs-gray-200)}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-item:active{background-color:var(--bs-primary);color:#fff}::ng-deep .sds-actions-dropdown .sds-table-dropdown-menu .dropdown-divider{background-color:var(--bs-border-color-translucent);height:1px;margin-top:.25rem;margin-bottom:.25rem}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open),.sds-row:has(sds-table-actions.actions-dropdown-open){background-color:var(--bs-gray-300)!important}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) td,.sds-row:has(sds-table-actions.actions-dropdown-open) td{background-color:var(--bs-gray-300)!important}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-action-button,::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button,.sds-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-action-button,.sds-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button{border-color:var(--bs-gray-500)!important}::ng-deep .dx-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button,.sds-row:has(sds-table-actions.actions-dropdown-open) sds-table-actions .sds-actions-dropdown-button{background-color:var(--bs-gray-200)!important}\n"] }]
|
|
32
32
|
}], ctorParameters: function () { return []; }, propDecorators: { dropdownIcon: [{
|
|
33
33
|
type: Input
|
|
34
34
|
}], dropDownAutoClose: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-table-actions.mjs","sources":["../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.component.ts","../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.component.html","../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.module.ts","../../../projects/ngx-sds-components/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.ts"],"sourcesContent":["import { Component, ElementRef, HostBinding, Input, OnChanges, OnInit, Renderer2, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\r\nimport { faEllipsis } from '@fortawesome/pro-regular-svg-icons';\r\nimport { HidingEvent } from 'devextreme/ui/popover';\r\n\r\n@Component({\r\n selector: 'sds-table-actions',\r\n templateUrl: './table-actions.component.html',\r\n styleUrls: ['./table-actions.component.scss'],\r\n})\r\nexport class SdsTableActionsComponent implements OnInit {\r\n\r\n @Input() dropdownIcon: IconProp = faEllipsis;\r\n // @Input() showShadow: boolean = false;\r\n @Input() dropDownAutoClose: 'true' | 'false' | 'inside' | 'outside' = 'true';\r\n @Input() dropdownMinWidth: string = '10rem';\r\n\r\n @HostBinding('class.actions-dropdown-open') protected showDropdown: boolean = false;\r\n\r\n constructor(\r\n\r\n ) {}\r\n\r\n ngOnInit(): void {}\r\n\r\n protected toggleDropdownMenu(): void {\r\n this.showDropdown = !this.showDropdown;\r\n }\r\n\r\n protected closeDropdownMenu(): void {\r\n this.showDropdown = false;\r\n }\r\n\r\n}\r\n","<div class=\"sds-actions-container me-2\">\r\n <div class=\"btn-group sds-actions-wrapper\">\r\n <ng-content select=\"quickActions\"></ng-content>\r\n\r\n <button\r\n #dropdownButton\r\n class=\"sds-actions-dropdown-button sds-btn-table\"\r\n type=\"button\"\r\n (click)=\"toggleDropdownMenu()\"\r\n >\r\n <fa-icon [icon]=\"dropdownIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\">\r\n </fa-icon>\r\n </button>\r\n\r\n <dx-popover\r\n [target]=\"dropdownButton\"\r\n [(visible)]=\"showDropdown\"\r\n [minWidth]=\"dropdownMinWidth\"\r\n [wrapperAttr]=\"{ class: 'sds-actions-dropdown' }\"\r\n >\r\n <dxo-position\r\n my=\"right top\"\r\n at=\"right bottom\"\r\n [of]=\"dropdownButton\"\r\n >\r\n <dxo-offset [y]=\"-7\"></dxo-offset>\r\n </dxo-position>\r\n\r\n <ul class=\"sds-table-dropdown-menu\" (click)=\"closeDropdownMenu()\">\r\n <ng-content></ng-content>\r\n </ul>\r\n </dx-popover>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsTableActionsComponent } from './table-actions.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { DxPopoverModule } from 'devextreme-angular';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsTableActionsComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule,\r\n DxPopoverModule\r\n ],\r\n exports: [\r\n SdsTableActionsComponent\r\n ]\r\n})\r\nexport class SdsTableActionsModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAUa,wBAAwB,CAAA;AASjC,IAAA,WAAA,GAAA;QAPS,IAAY,CAAA,YAAA,GAAa,UAAU,CAAC;;QAEpC,IAAiB,CAAA,iBAAA,GAA4C,MAAM,CAAC;QACpE,IAAgB,CAAA,gBAAA,GAAW,OAAO,CAAC;QAEU,IAAY,CAAA,YAAA,GAAY,KAAK,CAAC;KAIhF;AAEJ,IAAA,QAAQ,MAAW;IAET,kBAAkB,GAAA;AACxB,QAAA,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;KAC1C;IAES,iBAAiB,GAAA;AACvB,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;KAC7B;;sHArBQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,wBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,wBAAwB,+PCVrC,srCAkCA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-table-actions.mjs","sources":["../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.component.ts","../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.component.html","../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.module.ts","../../../projects/ngx-sds-components/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.ts"],"sourcesContent":["import { Component, ElementRef, HostBinding, Input, OnChanges, OnInit, Renderer2, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\r\nimport { faEllipsis } from '@fortawesome/pro-regular-svg-icons';\r\nimport { HidingEvent } from 'devextreme/ui/popover';\r\n\r\n@Component({\r\n selector: 'sds-table-actions',\r\n templateUrl: './table-actions.component.html',\r\n styleUrls: ['./table-actions.component.scss'],\r\n})\r\nexport class SdsTableActionsComponent implements OnInit {\r\n\r\n @Input() dropdownIcon: IconProp = faEllipsis;\r\n // @Input() showShadow: boolean = false;\r\n @Input() dropDownAutoClose: 'true' | 'false' | 'inside' | 'outside' = 'true';\r\n @Input() dropdownMinWidth: string = '10rem';\r\n\r\n @HostBinding('class.actions-dropdown-open') protected showDropdown: boolean = false;\r\n\r\n constructor(\r\n\r\n ) {}\r\n\r\n ngOnInit(): void {}\r\n\r\n protected toggleDropdownMenu(): void {\r\n this.showDropdown = !this.showDropdown;\r\n }\r\n\r\n protected closeDropdownMenu(): void {\r\n this.showDropdown = false;\r\n }\r\n\r\n}\r\n","<div class=\"sds-actions-container me-2\">\r\n <div class=\"btn-group sds-actions-wrapper\">\r\n <ng-content select=\"quickActions\"></ng-content>\r\n\r\n <button\r\n #dropdownButton\r\n class=\"sds-actions-dropdown-button sds-btn-table\"\r\n type=\"button\"\r\n (click)=\"toggleDropdownMenu()\"\r\n >\r\n <fa-icon [icon]=\"dropdownIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\">\r\n </fa-icon>\r\n </button>\r\n\r\n <dx-popover\r\n [target]=\"dropdownButton\"\r\n [(visible)]=\"showDropdown\"\r\n [minWidth]=\"dropdownMinWidth\"\r\n [wrapperAttr]=\"{ class: 'sds-actions-dropdown' }\"\r\n >\r\n <dxo-position\r\n my=\"right top\"\r\n at=\"right bottom\"\r\n [of]=\"dropdownButton\"\r\n >\r\n <dxo-offset [y]=\"-7\"></dxo-offset>\r\n </dxo-position>\r\n\r\n <ul class=\"sds-table-dropdown-menu\" (click)=\"closeDropdownMenu()\">\r\n <ng-content></ng-content>\r\n </ul>\r\n </dx-popover>\r\n </div>\r\n</div>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsTableActionsComponent } from './table-actions.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { DxPopoverModule } from 'devextreme-angular';\r\n\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n SdsTableActionsComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FontAwesomeModule,\r\n DxPopoverModule\r\n ],\r\n exports: [\r\n SdsTableActionsComponent\r\n ]\r\n})\r\nexport class SdsTableActionsModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAUa,wBAAwB,CAAA;AASjC,IAAA,WAAA,GAAA;QAPS,IAAY,CAAA,YAAA,GAAa,UAAU,CAAC;;QAEpC,IAAiB,CAAA,iBAAA,GAA4C,MAAM,CAAC;QACpE,IAAgB,CAAA,gBAAA,GAAW,OAAO,CAAC;QAEU,IAAY,CAAA,YAAA,GAAY,KAAK,CAAC;KAIhF;AAEJ,IAAA,QAAQ,MAAW;IAET,kBAAkB,GAAA;AACxB,QAAA,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;KAC1C;IAES,iBAAiB,GAAA;AACvB,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;KAC7B;;sHArBQ,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,wBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,wBAAwB,+PCVrC,srCAkCA,EAAA,MAAA,EAAA,CAAA,64DAAA,CAAA,EAAA,YAA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