ud-components 0.8.13 → 0.9.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/enums/feature-flag-key.enum.d.ts +2 -1
- package/fesm2022/ud-components.mjs +759 -344
- package/fesm2022/ud-components.mjs.map +1 -1
- package/lib/occupancy-grid/occupancy-grid.component.d.ts +25 -327
- package/lib/occupancy-grid/occupancy-grid.layout.d.ts +20 -4
- package/lib/occupancy-grid/timeline-grid.component.d.ts +357 -0
- package/lib/occupancy-grid/timeline-grid.interface.d.ts +115 -0
- package/lib/occupancy-grid/timeline-grid.layout.d.ts +59 -0
- package/lib/tooltip/tooltip.directive.d.ts +9 -1
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -417,6 +417,11 @@ class UdTooltipDirective {
|
|
|
417
417
|
udTooltipPosition = input('top');
|
|
418
418
|
udTooltipDisabled = input(false);
|
|
419
419
|
udTooltipShowDelay = input(300);
|
|
420
|
+
/**
|
|
421
|
+
* Anchors the tooltip at the cursor instead of the host's centre. For a long
|
|
422
|
+
* element (a bar on a timeline), the centre can be far from where the pointer is.
|
|
423
|
+
*/
|
|
424
|
+
udTooltipFollowPointer = input(false);
|
|
420
425
|
overlay = inject(Overlay);
|
|
421
426
|
host = inject(ElementRef);
|
|
422
427
|
viewContainerRef = inject(ViewContainerRef);
|
|
@@ -427,6 +432,8 @@ class UdTooltipDirective {
|
|
|
427
432
|
positionSub = null;
|
|
428
433
|
showTimer = null;
|
|
429
434
|
touchTimer = null;
|
|
435
|
+
strategy = null;
|
|
436
|
+
pointer = null;
|
|
430
437
|
onEscape = (event) => {
|
|
431
438
|
if (event.key === 'Escape') {
|
|
432
439
|
this.hide();
|
|
@@ -459,6 +466,13 @@ class UdTooltipDirective {
|
|
|
459
466
|
this.showTimer = setTimeout(() => this.show(), delay);
|
|
460
467
|
}
|
|
461
468
|
}
|
|
469
|
+
onPointerMove(event) {
|
|
470
|
+
this.pointer = { x: event.clientX, y: event.clientY };
|
|
471
|
+
if (this.strategy && this.udTooltipFollowPointer()) {
|
|
472
|
+
this.strategy.setOrigin(this.pointer);
|
|
473
|
+
this.overlayRef?.updatePosition();
|
|
474
|
+
}
|
|
475
|
+
}
|
|
462
476
|
onFocusIn() {
|
|
463
477
|
// The host may be a wrapper (ud-button) whose inner element takes focus.
|
|
464
478
|
const el = this.host.nativeElement;
|
|
@@ -486,13 +500,15 @@ class UdTooltipDirective {
|
|
|
486
500
|
return;
|
|
487
501
|
}
|
|
488
502
|
const preferred = this.udTooltipPosition();
|
|
503
|
+
const origin = this.udTooltipFollowPointer() && this.pointer ? this.pointer : this.host;
|
|
489
504
|
const strategy = this.overlay
|
|
490
505
|
.position()
|
|
491
|
-
.flexibleConnectedTo(
|
|
506
|
+
.flexibleConnectedTo(origin)
|
|
492
507
|
.withPositions([POSITIONS[preferred], POSITIONS[OPPOSITE[preferred]]])
|
|
493
508
|
.withFlexibleDimensions(false)
|
|
494
509
|
.withPush(false)
|
|
495
510
|
.withViewportMargin(8);
|
|
511
|
+
this.strategy = strategy;
|
|
496
512
|
this.overlayRef = this.overlay.create({
|
|
497
513
|
positionStrategy: strategy,
|
|
498
514
|
scrollStrategy: this.overlay.scrollStrategies.close(),
|
|
@@ -527,6 +543,7 @@ class UdTooltipDirective {
|
|
|
527
543
|
this.describe(false);
|
|
528
544
|
this.positionSub?.unsubscribe();
|
|
529
545
|
this.positionSub = null;
|
|
546
|
+
this.strategy = null;
|
|
530
547
|
const ref = this.overlayRef;
|
|
531
548
|
this.overlayRef = null;
|
|
532
549
|
this.panel = null;
|
|
@@ -559,7 +576,7 @@ class UdTooltipDirective {
|
|
|
559
576
|
}
|
|
560
577
|
}
|
|
561
578
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
562
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.19", type: UdTooltipDirective, isStandalone: true, selector: "[udTooltip]", inputs: { udTooltip: { classPropertyName: "udTooltip", publicName: "udTooltip", isSignal: true, isRequired: false, transformFunction: null }, udTooltipPosition: { classPropertyName: "udTooltipPosition", publicName: "udTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, udTooltipDisabled: { classPropertyName: "udTooltipDisabled", publicName: "udTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, udTooltipShowDelay: { classPropertyName: "udTooltipShowDelay", publicName: "udTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "scheduleShow()", "mouseleave": "hide()", "focusin": "onFocusIn()", "focusout": "hide()", "mousedown": "hide()", "touchstart": "onTouchStart()", "touchend": "onTouchEnd()", "touchcancel": "hide()" } }, ngImport: i0 });
|
|
579
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.19", type: UdTooltipDirective, isStandalone: true, selector: "[udTooltip]", inputs: { udTooltip: { classPropertyName: "udTooltip", publicName: "udTooltip", isSignal: true, isRequired: false, transformFunction: null }, udTooltipPosition: { classPropertyName: "udTooltipPosition", publicName: "udTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, udTooltipDisabled: { classPropertyName: "udTooltipDisabled", publicName: "udTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, udTooltipShowDelay: { classPropertyName: "udTooltipShowDelay", publicName: "udTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, udTooltipFollowPointer: { classPropertyName: "udTooltipFollowPointer", publicName: "udTooltipFollowPointer", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "scheduleShow()", "mousemove": "onPointerMove($event)", "mouseleave": "hide()", "focusin": "onFocusIn()", "focusout": "hide()", "mousedown": "hide()", "touchstart": "onTouchStart()", "touchend": "onTouchEnd()", "touchcancel": "hide()" } }, ngImport: i0 });
|
|
563
580
|
}
|
|
564
581
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UdTooltipDirective, decorators: [{
|
|
565
582
|
type: Directive,
|
|
@@ -568,6 +585,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
568
585
|
standalone: true,
|
|
569
586
|
host: {
|
|
570
587
|
'(mouseenter)': 'scheduleShow()',
|
|
588
|
+
'(mousemove)': 'onPointerMove($event)',
|
|
571
589
|
'(mouseleave)': 'hide()',
|
|
572
590
|
'(focusin)': 'onFocusIn()',
|
|
573
591
|
'(focusout)': 'hide()',
|
|
@@ -618,7 +636,7 @@ class SidenavComponent {
|
|
|
618
636
|
this.$moreBelow.set(scrollTop + clientHeight < scrollHeight - 1);
|
|
619
637
|
}
|
|
620
638
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SidenavComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
621
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: SidenavComponent, isStandalone: true, selector: "ud-sidenav", inputs: { groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: true, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, brandRoute: { classPropertyName: "brandRoute", publicName: "brandRoute", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoCollapsed: { classPropertyName: "logoCollapsed", publicName: "logoCollapsed", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sections", first: true, predicate: ["sections"], descendants: true, isSignal: true }, { propertyName: "sectionsList", first: true, predicate: ["sectionsList"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"sidenav\" [class.collapsed]=\"collapsed()\">\n <a class=\"brand\" [routerLink]=\"brandRoute()\">\n @if (collapsed()) {\n <img [src]=\"logoCollapsed()\" alt=\"UDorm\" class=\"logo-glyph\" />\n } @else {\n <img [src]=\"logo()\" alt=\"UDorm\" class=\"logo-wordmark\" />\n }\n </a>\n <!-- The frame carries the fade, so it stays put while the list scrolls. -->\n <div class=\"sections-frame\" [class.more-below]=\"$moreBelow()\">\n <div class=\"sections\" #sections (scroll)=\"updateMoreBelow()\">\n <div class=\"sections-list\" #sectionsList>\n @for (group of $navGroups(); track group.key) {\n <div class=\"nav-group\">\n <!-- Same height expanded and collapsed, so icons keep their\n place when the drawer toggles. -->\n @if (group.category) {\n @if (collapsed()) {\n <div class=\"divider\" aria-hidden=\"true\"></div>\n } @else {\n <p class=\"category\">\n {{ group.category | toObservable | async }}\n </p>\n }\n }\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if ($footerGroups().length) {\n <div class=\"footer\">\n @for (group of $footerGroups(); track group.key) {\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n }\n </div>\n }\n</nav>\n\n<ng-template #navItem let-child>\n @let label = child.label | toObservable | async | capitalize;\n <a\n class=\"nav-item\"\n [routerLink]=\"child.route\"\n [class.active]=\"child.route === $activeRoute()\"\n [attr.aria-current]=\"child.route === $activeRoute() ? 'page' : null\"\n [attr.aria-label]=\"collapsed() ? label : null\"\n udTooltipPosition=\"right\"\n [udTooltip]=\"collapsed() ? (label ?? '') : ''\">\n <mat-icon fontSet=\"material-icons-outlined\" aria-hidden=\"true\">\n {{ child.icon }}\n </mat-icon>\n @if (!collapsed()) {\n <span class=\"label\">{{ label }}</span>\n }\n @if (child.badge) {\n <span class=\"count\">{{ child.badge }}</span>\n }\n </a>\n</ng-template>\n", styles: [":host{display:block;height:100%}.sidenav{display:flex;flex-direction:column;height:100%;background:var(--primary-color);font-family:Sora,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sections-frame{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.sections-frame:after{content:\"\";position:absolute;inset:auto 0 0;height:40px;background:linear-gradient(transparent,var(--primary-color));pointer-events:none;opacity:0;transition:opacity .15s ease}.sections-frame.more-below:after{opacity:1}.sections{flex:1;min-height:0;padding:4px 8px 8px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.sections::-webkit-scrollbar{width:6px}.sections::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}.sections-list{display:flex;flex-direction:column;gap:12px}.footer{flex:none;padding:6px 8px;border-top:1px solid rgba(255,255,255,.1)}.brand{flex:none;display:flex;align-items:center;height:56px;margin:0 8px;padding-left:10px;border-radius:6px}.brand:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.logo-wordmark{height:24px;width:auto}.logo-glyph{height:28px;width:28px;object-fit:contain}.nav-group{display:flex;flex-direction:column;gap:2px}.category{display:flex;align-items:flex-end;min-height:22px;margin:0;padding:0 10px 6px;font-size:11px;font-weight:600;line-height:1.25;letter-spacing:.08em;text-transform:uppercase;color:#8a93a8}.divider{display:flex;align-items:center;justify-content:center;height:22px}.divider:before{content:\"\";width:20px;height:1px;background:#ffffff1a}.nav-item{position:relative;display:flex;align-items:center;gap:10px;height:30px;padding:0 10px;border-radius:6px;color:#dcdfe8;font-size:13.5px;line-height:1;letter-spacing:0;text-decoration:none;white-space:nowrap;transition:background-color .15s ease}.nav-item mat-icon{flex:none;width:18px;height:18px;font-size:18px;color:#939cb2}.nav-item:hover{background:#ffffff0f;color:#f5f6f7}.nav-item:hover mat-icon{color:#dcdfe8}.nav-item.active{background:#2a3768;color:#fff;font-weight:500}.nav-item.active mat-icon{color:#aeb8ff}.nav-item:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.label{overflow:hidden;text-overflow:ellipsis;line-height:1.35}.count{margin-left:auto;min-width:22px;height:18px;padding:0 5px;border-radius:9px;background:#ef6547;color:#1b2535;font-size:11px;font-weight:600;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}.collapsed .brand{justify-content:center;padding-left:0}.collapsed .nav-item{justify-content:center;padding:0}.collapsed .count{position:absolute;top:-2px;right:3px;min-width:16px;height:15px;padding:0 4px;font-size:9.5px;line-height:15px;box-shadow:0 0 0 2px var(--primary-color)}@media (prefers-reduced-motion: reduce){.nav-item,.sections-frame:after{transition:none}}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: ToObservablePipe, name: "toObservable" }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
639
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: SidenavComponent, isStandalone: true, selector: "ud-sidenav", inputs: { groups: { classPropertyName: "groups", publicName: "groups", isSignal: true, isRequired: true, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, brandRoute: { classPropertyName: "brandRoute", publicName: "brandRoute", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, logoCollapsed: { classPropertyName: "logoCollapsed", publicName: "logoCollapsed", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "sections", first: true, predicate: ["sections"], descendants: true, isSignal: true }, { propertyName: "sectionsList", first: true, predicate: ["sectionsList"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"sidenav\" [class.collapsed]=\"collapsed()\">\n <a class=\"brand\" [routerLink]=\"brandRoute()\">\n @if (collapsed()) {\n <img [src]=\"logoCollapsed()\" alt=\"UDorm\" class=\"logo-glyph\" />\n } @else {\n <img [src]=\"logo()\" alt=\"UDorm\" class=\"logo-wordmark\" />\n }\n </a>\n <!-- The frame carries the fade, so it stays put while the list scrolls. -->\n <div class=\"sections-frame\" [class.more-below]=\"$moreBelow()\">\n <div class=\"sections\" #sections (scroll)=\"updateMoreBelow()\">\n <div class=\"sections-list\" #sectionsList>\n @for (group of $navGroups(); track group.key) {\n <div class=\"nav-group\">\n <!-- Same height expanded and collapsed, so icons keep their\n place when the drawer toggles. -->\n @if (group.category) {\n @if (collapsed()) {\n <div class=\"divider\" aria-hidden=\"true\"></div>\n } @else {\n <p class=\"category\">\n {{ group.category | toObservable | async }}\n </p>\n }\n }\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n </div>\n }\n </div>\n </div>\n </div>\n @if ($footerGroups().length) {\n <div class=\"footer\">\n @for (group of $footerGroups(); track group.key) {\n @for (child of group.children; track child.route) {\n <ng-container\n *ngTemplateOutlet=\"navItem; context: { $implicit: child }\" />\n }\n }\n </div>\n }\n</nav>\n\n<ng-template #navItem let-child>\n @let label = child.label | toObservable | async | capitalize;\n <a\n class=\"nav-item\"\n [routerLink]=\"child.route\"\n [class.active]=\"child.route === $activeRoute()\"\n [attr.aria-current]=\"child.route === $activeRoute() ? 'page' : null\"\n [attr.aria-label]=\"collapsed() ? label : null\"\n udTooltipPosition=\"right\"\n [udTooltip]=\"collapsed() ? (label ?? '') : ''\">\n <mat-icon fontSet=\"material-icons-outlined\" aria-hidden=\"true\">\n {{ child.icon }}\n </mat-icon>\n @if (!collapsed()) {\n <span class=\"label\">{{ label }}</span>\n }\n @if (child.badge) {\n <span class=\"count\">{{ child.badge }}</span>\n }\n </a>\n</ng-template>\n", styles: [":host{display:block;height:100%}.sidenav{display:flex;flex-direction:column;height:100%;background:var(--primary-color);font-family:Sora,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sections-frame{position:relative;flex:1;min-height:0;display:flex;flex-direction:column}.sections-frame:after{content:\"\";position:absolute;inset:auto 0 0;height:40px;background:linear-gradient(transparent,var(--primary-color));pointer-events:none;opacity:0;transition:opacity .15s ease}.sections-frame.more-below:after{opacity:1}.sections{flex:1;min-height:0;padding:4px 8px 8px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.2) transparent}.sections::-webkit-scrollbar{width:6px}.sections::-webkit-scrollbar-thumb{background:#fff3;border-radius:3px}.sections-list{display:flex;flex-direction:column;gap:12px}.footer{flex:none;padding:6px 8px;border-top:1px solid rgba(255,255,255,.1)}.brand{flex:none;display:flex;align-items:center;height:56px;margin:0 8px;padding-left:10px;border-radius:6px}.brand:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.logo-wordmark{height:24px;width:auto}.logo-glyph{height:28px;width:28px;object-fit:contain}.nav-group{display:flex;flex-direction:column;gap:2px}.category{display:flex;align-items:flex-end;min-height:22px;margin:0;padding:0 10px 6px;font-size:11px;font-weight:600;line-height:1.25;letter-spacing:.08em;text-transform:uppercase;color:#8a93a8}.divider{display:flex;align-items:center;justify-content:center;height:22px}.divider:before{content:\"\";width:20px;height:1px;background:#ffffff1a}.nav-item{position:relative;display:flex;align-items:center;gap:10px;height:30px;padding:0 10px;border-radius:6px;color:#dcdfe8;font-size:13.5px;line-height:1;letter-spacing:0;text-decoration:none;white-space:nowrap;transition:background-color .15s ease}.nav-item mat-icon{flex:none;width:18px;height:18px;font-size:18px;color:#939cb2}.nav-item:hover{background:#ffffff0f;color:#f5f6f7}.nav-item:hover mat-icon{color:#dcdfe8}.nav-item.active{background:#2a3768;color:#fff;font-weight:500}.nav-item.active mat-icon{color:#aeb8ff}.nav-item:focus-visible{outline:2px solid #aeb8ff;outline-offset:-2px}.label{overflow:hidden;text-overflow:ellipsis;line-height:1.35}.count{margin-left:auto;min-width:22px;height:18px;padding:0 5px;border-radius:9px;background:#ef6547;color:#1b2535;font-size:11px;font-weight:600;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}.collapsed .brand{justify-content:center;padding-left:0}.collapsed .nav-item{justify-content:center;padding:0}.collapsed .count{position:absolute;top:-2px;right:3px;min-width:16px;height:15px;padding:0 4px;font-size:9.5px;line-height:15px;box-shadow:0 0 0 2px var(--primary-color)}@media (prefers-reduced-motion: reduce){.nav-item,.sections-frame:after{transition:none}}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: ToObservablePipe, name: "toObservable" }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay", "udTooltipFollowPointer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
622
640
|
}
|
|
623
641
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SidenavComponent, decorators: [{
|
|
624
642
|
type: Component,
|
|
@@ -1429,7 +1447,7 @@ class MultiSelectComponent {
|
|
|
1429
1447
|
this.options.forEach(o => this.labelMap.set(o.value, o.label));
|
|
1430
1448
|
}
|
|
1431
1449
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1432
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: MultiSelectComponent, isStandalone: true, selector: "ud-multi-select", inputs: { controlName: "controlName", label: "label", placeholder: "placeholder", icon: "icon", iconFontSet: "iconFontSet", options: "options", multiple: "multiple", maxChipsVisible: "maxChipsVisible", moreText: "moreText", size: "size", loading: "loading", disabled: "disabled", clearable: "clearable", hint: "hint" }, viewQueries: [{ propertyName: "selectRef", first: true, predicate: MatSelect, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"ud-input\" [class.ud-input--disabled]=\"control.disabled\">\n @if (label) {\n <label class=\"ud-input__label\">{{ label }}</label>\n }\n <mat-form-field [class]=\"'ud-ms-field ud-ms-field--' + size\" appearance=\"outline\" subscriptSizing=\"dynamic\">\n @if (icon) {\n <mat-icon matPrefix [fontSet]=\"iconFontSet\">{{ icon }}</mat-icon>\n }\n @if (loading) {\n <mat-icon matSuffix class=\"ud-loading-icon\" fontSet=\"material-icons-outlined\">sync</mat-icon>\n }\n @if (clearable && selectedValues.length > 0 && !loading) {\n <button matSuffix class=\"ud-ms-clear\" (click)=\"clearValue($event)\" type=\"button\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-select [formControlName]=\"controlName\" [multiple]=\"multiple\" [placeholder]=\"placeholder\" panelClass=\"ud-select-panel\" (openedChange)=\"onPanelToggled($event)\">\n <mat-select-trigger>\n @if (multiple) {\n <mat-chip-set class=\"ud-chip-trigger\" aria-label=\"Selected options\">\n @for (val of selectedValues.slice(0, maxChipsVisible); track val) {\n <mat-chip color=\"primary\" selected>{{ getLabelFor(val) }}</mat-chip>\n }\n @if (selectedValues.length > maxChipsVisible) {\n <mat-chip color=\"primary\">{{ getMoreText(selectedValues.length - maxChipsVisible) }}</mat-chip>\n }\n </mat-chip-set>\n } @else {\n {{ getLabelFor(control.value) }}\n }\n </mat-select-trigger>\n @for (option of options; track option.value; let i = $index) {\n <mat-option [value]=\"option.value\"\n [disabled]=\"!!option.disabled\"\n [class.ud-ms-row--stacked]=\"!!option.disabledReason\">\n <span class=\"ud-ms-option\">\n <span class=\"ud-ms-option__head\">\n @if (multiple) {\n <!-- Display only: inert, so the click lands on the option\n (which does the selecting) and the checkbox is neither\n focusable nor announced twice. -->\n <ud-checkbox\n class=\"ud-ms-option__check\"\n inert\n [checked]=\"selectedValues.includes(option.value)\"\n [disabled]=\"!!option.disabled\" />\n }\n <span class=\"ud-ms-option__label\"\n [udTooltip]=\"option.label\"\n [udTooltipDisabled]=\"!clippedLabels[i]\"\n [udTooltipShowDelay]=\"optionTooltipDelay\">{{ option.label }}</span>\n @if (option.disabled) {\n <mat-icon class=\"ud-ms-option__lock\" fontSet=\"material-icons-outlined\">lock</mat-icon>\n }\n </span>\n @if (option.disabledReason) {\n <span class=\"ud-ms-option__reason\"\n [udTooltip]=\"option.disabledReason\"\n [udTooltipDisabled]=\"!clippedReasons[i]\"\n [udTooltipShowDelay]=\"optionTooltipDelay\">{{ option.disabledReason }}</span>\n }\n </span>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (hint) {\n <span class=\"ud-input__hint\">{{ hint }}</span>\n }\n</div>\n", styles: [":host{display:block;width:100%}.ud-input{display:flex;flex-direction:column;gap:5px;width:100%}.ud-input__label{font-family:Sora,system-ui,sans-serif;font-size:13px;font-weight:500;color:#2a3548;line-height:1;padding-left:1px}.ud-input__hint{font-family:Sora,system-ui,sans-serif;font-size:12px;color:#6b7585;line-height:1.3}.ud-input--disabled{opacity:.6;cursor:not-allowed}::ng-deep .ud-ms-field{width:100%}::ng-deep .ud-ms-field .mat-mdc-text-field-wrapper{background:#f8fafc!important;padding:0 12px!important;transition:background .18s ease!important}::ng-deep .ud-ms-field:hover .mat-mdc-text-field-wrapper{background:#f3f6fa!important}::ng-deep .ud-ms-field.mat-focused .mat-mdc-text-field-wrapper{background:#fff!important}::ng-deep .ud-ms-field .mat-mdc-form-field-flex{align-items:center}::ng-deep .ud-ms-field .mat-mdc-form-field-infix{padding-top:9px!important;padding-bottom:9px!important;min-height:unset!important;border-top:0!important}::ng-deep .ud-ms-field .mdc-notched-outline__leading{border-color:#d8dde6!important;border-radius:8px 0 0 8px!important;min-width:8px!important;transition:border-color .18s ease!important}::ng-deep .ud-ms-field .mdc-notched-outline__notch{border-top:1px solid #d8dde6!important;border-bottom:1px solid #d8dde6!important;border-left:none!important;border-right:none!important;max-width:0!important;padding:0!important;transition:border-color .18s ease!important}::ng-deep .ud-ms-field .mdc-notched-outline__trailing{border-color:#d8dde6!important;border-radius:0 8px 8px 0!important;transition:border-color .18s ease!important}::ng-deep .ud-ms-field .mdc-notched-outline--notched .mdc-notched-outline__notch{border-left:none!important;max-width:0!important}::ng-deep .ud-ms-field.mat-focused .mdc-notched-outline__leading,::ng-deep .ud-ms-field.mat-focused .mdc-notched-outline__notch,::ng-deep .ud-ms-field.mat-focused .mdc-notched-outline__trailing{border-color:#1b2535!important;border-width:1.5px!important}::ng-deep .ud-ms-field.mat-focused .mat-mdc-text-field-wrapper{box-shadow:0 0 0 3px #1b253514!important;border-radius:8px!important}::ng-deep .ud-ms-field .mat-icon[matPrefix]{font-size:18px!important;width:18px!important;height:18px!important;color:#6b7585!important;margin-right:6px!important;transition:color .18s ease!important;padding:0!important}::ng-deep .ud-ms-field.mat-focused .mat-icon[matPrefix]{color:#1b2535!important}::ng-deep .ud-ms-field .mat-icon[matSuffix]{font-size:18px!important;width:18px!important;height:18px!important;color:#6b7585!important;align-self:center!important;padding:0!important}::ng-deep .ud-ms-field .mat-mdc-select-value,::ng-deep .ud-ms-field .mat-mdc-form-field-infix{font-family:Sora,system-ui,sans-serif!important;font-size:14px!important;color:#2a3548!important}::ng-deep .ud-ms-field .mat-mdc-select-arrow-wrapper{padding-left:2px}::ng-deep .ud-ms-field .mat-mdc-select-arrow{display:flex;align-items:center;justify-content:center}::ng-deep .ud-ms-field .mat-mdc-select-arrow svg{display:none}::ng-deep .ud-ms-field .mat-mdc-select-arrow:after{font-family:Material Icons Outlined,Material Icons,sans-serif;content:\"expand_more\";font-size:20px;line-height:1;color:#6b7585;display:block;transition:transform .2s ease,color .2s ease}::ng-deep .ud-ms-field .mat-mdc-select[aria-expanded=true] .mat-mdc-select-arrow:after{transform:rotate(180deg);color:#1b2535}::ng-deep .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none!important}@keyframes ud-spin{to{transform:rotate(360deg)}}.ud-loading-icon{animation:ud-spin .8s linear infinite}.ud-ms-clear{display:flex;align-items:center;justify-content:center;background:none;border:none;padding:2px;cursor:pointer;border-radius:50%;color:#6b7585;transition:background .15s ease,color .15s ease}.ud-ms-clear mat-icon{font-size:16px;width:16px;height:16px;line-height:16px}.ud-ms-clear:hover{background:#1b253514;color:#1b2535}::ng-deep .mat-mdc-chip.mat-mdc-standard-chip{background:#1b253514!important;color:#1b2535!important;font-family:Sora,system-ui,sans-serif;font-size:.78rem;font-weight:500;border:1px solid rgba(27,37,53,.18)!important;height:22px}::ng-deep .mat-mdc-chip.mat-mdc-standard-chip .mdc-evolution-chip__text-label{color:#1b2535!important;font-size:.78rem}::ng-deep .ud-ms-field.ud-ms-field .mat-mdc-form-field-infix{display:flex;align-items:center;padding-top:0!important;padding-bottom:0!important;background:transparent}::ng-deep .ud-select-panel{background:#fff!important;border-radius:10px!important;box-shadow:0 8px 24px #1b25351f,0 2px 8px #1b25350f!important;padding:6px 0!important;overflow:hidden}::ng-deep .ud-select-panel .mat-mdc-option{font-family:Sora,system-ui,sans-serif!important;font-size:.9rem!important;color:#1b2535!important;padding:0 1.25rem!important;min-height:44px!important;transition:background .12s ease}::ng-deep .ud-select-panel .mat-mdc-option:hover:not(.mdc-list-item--disabled){background:#f4f5f7!important}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--selected{background:#1b25350d!important}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--selected .mdc-list-item__primary-text{color:#1b2535!important;font-weight:600!important}::ng-deep .ud-select-panel .mat-mdc-option .mat-pseudo-checkbox-full{display:none!important}::ng-deep .ud-select-panel .mat-mdc-option .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked:after{color:#1b2535!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-mdc-text-field-wrapper{padding:0 10px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-mdc-form-field-infix{min-height:32px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-mdc-select-value{font-size:13px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mdc-notched-outline__leading{border-radius:7px 0 0 7px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mdc-notched-outline__trailing{border-radius:0 7px 7px 0!important}::ng-deep .ud-ms-field--small.ud-ms-field--small.mat-focused .mat-mdc-text-field-wrapper{border-radius:7px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-icon[matPrefix]{font-size:16px!important;width:16px!important;height:16px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-mdc-text-field-wrapper{padding:0 12px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-mdc-form-field-infix{min-height:40px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-mdc-select-value{font-size:14px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mdc-notched-outline__leading{border-radius:8px 0 0 8px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mdc-notched-outline__trailing{border-radius:0 8px 8px 0!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium.mat-focused .mat-mdc-text-field-wrapper{border-radius:8px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-icon[matPrefix]{font-size:18px!important;width:18px!important;height:18px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-mdc-text-field-wrapper{padding:0 14px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-mdc-form-field-infix{min-height:48px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-mdc-select-value{font-size:15px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mdc-notched-outline__leading{border-radius:9px 0 0 9px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mdc-notched-outline__trailing{border-radius:0 9px 9px 0!important}::ng-deep .ud-ms-field--large.ud-ms-field--large.mat-focused .mat-mdc-text-field-wrapper{border-radius:9px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-icon[matPrefix]{font-size:20px!important;width:20px!important;height:20px!important}::ng-deep .ud-select-panel .mat-mdc-option .mdc-list-item__primary-text{width:100%}::ng-deep .ud-select-panel .ud-ms-option{display:flex;flex-direction:column;justify-content:center;gap:3px;width:100%;min-width:0}::ng-deep .ud-select-panel .ud-ms-option__head{display:flex;align-items:center;gap:8px;min-width:0}::ng-deep .ud-select-panel .ud-ms-option__check{flex:none;margin-right:4px}::ng-deep .ud-select-panel .ud-ms-option__label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .ud-select-panel .ud-ms-option__lock{flex:none;margin-left:auto;width:14px;height:14px;font-size:14px;line-height:14px;color:#8b94a3}::ng-deep .ud-select-panel .ud-ms-option__reason{min-width:0;font-family:Sora,system-ui,sans-serif;font-size:11.5px;line-height:1.35;color:#6b7585;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .ud-select-panel .mat-mdc-option.ud-ms-row--stacked{height:auto;min-height:52px;padding-top:7px;padding-bottom:7px}::ng-deep .ud-select-panel .mat-mdc-option.ud-ms-row--stacked .mdc-list-item__primary-text{white-space:normal}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled{opacity:1;pointer-events:auto;cursor:default}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled:hover{background:transparent}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-ripple,::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .mat-ripple,::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled:before{display:none}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .ud-ms-option__label{opacity:.75}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .ud-ms-option__reason{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }, { kind: "component", type: CheckboxComponent, selector: "ud-checkbox", inputs: ["controlName", "size", "label", "labelPosition", "ariaLabel", "indeterminate", "checked", "disabled"], outputs: ["onChange"] }], viewProviders: [{ provide: ControlContainer, useFactory: () => inject(ControlContainer, { skipSelf: true }) }] });
|
|
1450
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: MultiSelectComponent, isStandalone: true, selector: "ud-multi-select", inputs: { controlName: "controlName", label: "label", placeholder: "placeholder", icon: "icon", iconFontSet: "iconFontSet", options: "options", multiple: "multiple", maxChipsVisible: "maxChipsVisible", moreText: "moreText", size: "size", loading: "loading", disabled: "disabled", clearable: "clearable", hint: "hint" }, viewQueries: [{ propertyName: "selectRef", first: true, predicate: MatSelect, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"ud-input\" [class.ud-input--disabled]=\"control.disabled\">\n @if (label) {\n <label class=\"ud-input__label\">{{ label }}</label>\n }\n <mat-form-field [class]=\"'ud-ms-field ud-ms-field--' + size\" appearance=\"outline\" subscriptSizing=\"dynamic\">\n @if (icon) {\n <mat-icon matPrefix [fontSet]=\"iconFontSet\">{{ icon }}</mat-icon>\n }\n @if (loading) {\n <mat-icon matSuffix class=\"ud-loading-icon\" fontSet=\"material-icons-outlined\">sync</mat-icon>\n }\n @if (clearable && selectedValues.length > 0 && !loading) {\n <button matSuffix class=\"ud-ms-clear\" (click)=\"clearValue($event)\" type=\"button\" tabindex=\"-1\">\n <mat-icon>close</mat-icon>\n </button>\n }\n <mat-select [formControlName]=\"controlName\" [multiple]=\"multiple\" [placeholder]=\"placeholder\" panelClass=\"ud-select-panel\" (openedChange)=\"onPanelToggled($event)\">\n <mat-select-trigger>\n @if (multiple) {\n <mat-chip-set class=\"ud-chip-trigger\" aria-label=\"Selected options\">\n @for (val of selectedValues.slice(0, maxChipsVisible); track val) {\n <mat-chip color=\"primary\" selected>{{ getLabelFor(val) }}</mat-chip>\n }\n @if (selectedValues.length > maxChipsVisible) {\n <mat-chip color=\"primary\">{{ getMoreText(selectedValues.length - maxChipsVisible) }}</mat-chip>\n }\n </mat-chip-set>\n } @else {\n {{ getLabelFor(control.value) }}\n }\n </mat-select-trigger>\n @for (option of options; track option.value; let i = $index) {\n <mat-option [value]=\"option.value\"\n [disabled]=\"!!option.disabled\"\n [class.ud-ms-row--stacked]=\"!!option.disabledReason\">\n <span class=\"ud-ms-option\">\n <span class=\"ud-ms-option__head\">\n @if (multiple) {\n <!-- Display only: inert, so the click lands on the option\n (which does the selecting) and the checkbox is neither\n focusable nor announced twice. -->\n <ud-checkbox\n class=\"ud-ms-option__check\"\n inert\n [checked]=\"selectedValues.includes(option.value)\"\n [disabled]=\"!!option.disabled\" />\n }\n <span class=\"ud-ms-option__label\"\n [udTooltip]=\"option.label\"\n [udTooltipDisabled]=\"!clippedLabels[i]\"\n [udTooltipShowDelay]=\"optionTooltipDelay\">{{ option.label }}</span>\n @if (option.disabled) {\n <mat-icon class=\"ud-ms-option__lock\" fontSet=\"material-icons-outlined\">lock</mat-icon>\n }\n </span>\n @if (option.disabledReason) {\n <span class=\"ud-ms-option__reason\"\n [udTooltip]=\"option.disabledReason\"\n [udTooltipDisabled]=\"!clippedReasons[i]\"\n [udTooltipShowDelay]=\"optionTooltipDelay\">{{ option.disabledReason }}</span>\n }\n </span>\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n @if (hint) {\n <span class=\"ud-input__hint\">{{ hint }}</span>\n }\n</div>\n", styles: [":host{display:block;width:100%}.ud-input{display:flex;flex-direction:column;gap:5px;width:100%}.ud-input__label{font-family:Sora,system-ui,sans-serif;font-size:13px;font-weight:500;color:#2a3548;line-height:1;padding-left:1px}.ud-input__hint{font-family:Sora,system-ui,sans-serif;font-size:12px;color:#6b7585;line-height:1.3}.ud-input--disabled{opacity:.6;cursor:not-allowed}::ng-deep .ud-ms-field{width:100%}::ng-deep .ud-ms-field .mat-mdc-text-field-wrapper{background:#f8fafc!important;padding:0 12px!important;transition:background .18s ease!important}::ng-deep .ud-ms-field:hover .mat-mdc-text-field-wrapper{background:#f3f6fa!important}::ng-deep .ud-ms-field.mat-focused .mat-mdc-text-field-wrapper{background:#fff!important}::ng-deep .ud-ms-field .mat-mdc-form-field-flex{align-items:center}::ng-deep .ud-ms-field .mat-mdc-form-field-infix{padding-top:9px!important;padding-bottom:9px!important;min-height:unset!important;border-top:0!important}::ng-deep .ud-ms-field .mdc-notched-outline__leading{border-color:#d8dde6!important;border-radius:8px 0 0 8px!important;min-width:8px!important;transition:border-color .18s ease!important}::ng-deep .ud-ms-field .mdc-notched-outline__notch{border-top:1px solid #d8dde6!important;border-bottom:1px solid #d8dde6!important;border-left:none!important;border-right:none!important;max-width:0!important;padding:0!important;transition:border-color .18s ease!important}::ng-deep .ud-ms-field .mdc-notched-outline__trailing{border-color:#d8dde6!important;border-radius:0 8px 8px 0!important;transition:border-color .18s ease!important}::ng-deep .ud-ms-field .mdc-notched-outline--notched .mdc-notched-outline__notch{border-left:none!important;max-width:0!important}::ng-deep .ud-ms-field.mat-focused .mdc-notched-outline__leading,::ng-deep .ud-ms-field.mat-focused .mdc-notched-outline__notch,::ng-deep .ud-ms-field.mat-focused .mdc-notched-outline__trailing{border-color:#1b2535!important;border-width:1.5px!important}::ng-deep .ud-ms-field.mat-focused .mat-mdc-text-field-wrapper{box-shadow:0 0 0 3px #1b253514!important;border-radius:8px!important}::ng-deep .ud-ms-field .mat-icon[matPrefix]{font-size:18px!important;width:18px!important;height:18px!important;color:#6b7585!important;margin-right:6px!important;transition:color .18s ease!important;padding:0!important}::ng-deep .ud-ms-field.mat-focused .mat-icon[matPrefix]{color:#1b2535!important}::ng-deep .ud-ms-field .mat-icon[matSuffix]{font-size:18px!important;width:18px!important;height:18px!important;color:#6b7585!important;align-self:center!important;padding:0!important}::ng-deep .ud-ms-field .mat-mdc-select-value,::ng-deep .ud-ms-field .mat-mdc-form-field-infix{font-family:Sora,system-ui,sans-serif!important;font-size:14px!important;color:#2a3548!important}::ng-deep .ud-ms-field .mat-mdc-select-arrow-wrapper{padding-left:2px}::ng-deep .ud-ms-field .mat-mdc-select-arrow{display:flex;align-items:center;justify-content:center}::ng-deep .ud-ms-field .mat-mdc-select-arrow svg{display:none}::ng-deep .ud-ms-field .mat-mdc-select-arrow:after{font-family:Material Icons Outlined,Material Icons,sans-serif;content:\"expand_more\";font-size:20px;line-height:1;color:#6b7585;display:block;transition:transform .2s ease,color .2s ease}::ng-deep .ud-ms-field .mat-mdc-select[aria-expanded=true] .mat-mdc-select-arrow:after{transform:rotate(180deg);color:#1b2535}::ng-deep .mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field.mat-mdc-form-field .mdc-notched-outline__notch{border-left:none!important}@keyframes ud-spin{to{transform:rotate(360deg)}}.ud-loading-icon{animation:ud-spin .8s linear infinite}.ud-ms-clear{display:flex;align-items:center;justify-content:center;background:none;border:none;padding:2px;cursor:pointer;border-radius:50%;color:#6b7585;transition:background .15s ease,color .15s ease}.ud-ms-clear mat-icon{font-size:16px;width:16px;height:16px;line-height:16px}.ud-ms-clear:hover{background:#1b253514;color:#1b2535}::ng-deep .mat-mdc-chip.mat-mdc-standard-chip{background:#1b253514!important;color:#1b2535!important;font-family:Sora,system-ui,sans-serif;font-size:.78rem;font-weight:500;border:1px solid rgba(27,37,53,.18)!important;height:22px}::ng-deep .mat-mdc-chip.mat-mdc-standard-chip .mdc-evolution-chip__text-label{color:#1b2535!important;font-size:.78rem}::ng-deep .ud-ms-field.ud-ms-field .mat-mdc-form-field-infix{display:flex;align-items:center;padding-top:0!important;padding-bottom:0!important;background:transparent}::ng-deep .ud-select-panel{background:#fff!important;border-radius:10px!important;box-shadow:0 8px 24px #1b25351f,0 2px 8px #1b25350f!important;padding:6px 0!important;overflow:hidden}::ng-deep .ud-select-panel .mat-mdc-option{font-family:Sora,system-ui,sans-serif!important;font-size:.9rem!important;color:#1b2535!important;padding:0 1.25rem!important;min-height:44px!important;transition:background .12s ease}::ng-deep .ud-select-panel .mat-mdc-option:hover:not(.mdc-list-item--disabled){background:#f4f5f7!important}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--selected{background:#1b25350d!important}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--selected .mdc-list-item__primary-text{color:#1b2535!important;font-weight:600!important}::ng-deep .ud-select-panel .mat-mdc-option .mat-pseudo-checkbox-full{display:none!important}::ng-deep .ud-select-panel .mat-mdc-option .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked:after{color:#1b2535!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-mdc-text-field-wrapper{padding:0 10px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-mdc-form-field-infix{min-height:32px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-mdc-select-value{font-size:13px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mdc-notched-outline__leading{border-radius:7px 0 0 7px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mdc-notched-outline__trailing{border-radius:0 7px 7px 0!important}::ng-deep .ud-ms-field--small.ud-ms-field--small.mat-focused .mat-mdc-text-field-wrapper{border-radius:7px!important}::ng-deep .ud-ms-field--small.ud-ms-field--small .mat-icon[matPrefix]{font-size:16px!important;width:16px!important;height:16px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-mdc-text-field-wrapper{padding:0 12px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-mdc-form-field-infix{min-height:40px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-mdc-select-value{font-size:14px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mdc-notched-outline__leading{border-radius:8px 0 0 8px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mdc-notched-outline__trailing{border-radius:0 8px 8px 0!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium.mat-focused .mat-mdc-text-field-wrapper{border-radius:8px!important}::ng-deep .ud-ms-field--medium.ud-ms-field--medium .mat-icon[matPrefix]{font-size:18px!important;width:18px!important;height:18px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-mdc-text-field-wrapper{padding:0 14px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-mdc-form-field-infix{min-height:48px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-mdc-select-value{font-size:15px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mdc-notched-outline__leading{border-radius:9px 0 0 9px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mdc-notched-outline__trailing{border-radius:0 9px 9px 0!important}::ng-deep .ud-ms-field--large.ud-ms-field--large.mat-focused .mat-mdc-text-field-wrapper{border-radius:9px!important}::ng-deep .ud-ms-field--large.ud-ms-field--large .mat-icon[matPrefix]{font-size:20px!important;width:20px!important;height:20px!important}::ng-deep .ud-select-panel .mat-mdc-option .mdc-list-item__primary-text{width:100%}::ng-deep .ud-select-panel .ud-ms-option{display:flex;flex-direction:column;justify-content:center;gap:3px;width:100%;min-width:0}::ng-deep .ud-select-panel .ud-ms-option__head{display:flex;align-items:center;gap:8px;min-width:0}::ng-deep .ud-select-panel .ud-ms-option__check{flex:none;margin-right:4px}::ng-deep .ud-select-panel .ud-ms-option__label{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .ud-select-panel .ud-ms-option__lock{flex:none;margin-left:auto;width:14px;height:14px;font-size:14px;line-height:14px;color:#8b94a3}::ng-deep .ud-select-panel .ud-ms-option__reason{min-width:0;font-family:Sora,system-ui,sans-serif;font-size:11.5px;line-height:1.35;color:#6b7585;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}::ng-deep .ud-select-panel .mat-mdc-option.ud-ms-row--stacked{height:auto;min-height:52px;padding-top:7px;padding-bottom:7px}::ng-deep .ud-select-panel .mat-mdc-option.ud-ms-row--stacked .mdc-list-item__primary-text{white-space:normal}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled{opacity:1;pointer-events:auto;cursor:default}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled:hover{background:transparent}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-ripple,::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .mat-ripple,::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled:before{display:none}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .ud-ms-option__label{opacity:.75}::ng-deep .ud-select-panel .mat-mdc-option.mdc-list-item--disabled .ud-ms-option__reason{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: MatChipSet, selector: "mat-chip-set", inputs: ["disabled", "role", "tabIndex"] }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay", "udTooltipFollowPointer"] }, { kind: "component", type: CheckboxComponent, selector: "ud-checkbox", inputs: ["controlName", "size", "label", "labelPosition", "ariaLabel", "indeterminate", "checked", "disabled"], outputs: ["onChange"] }], viewProviders: [{ provide: ControlContainer, useFactory: () => inject(ControlContainer, { skipSelf: true }) }] });
|
|
1433
1451
|
}
|
|
1434
1452
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
1435
1453
|
type: Component,
|
|
@@ -3893,7 +3911,7 @@ class CustomTableComponent {
|
|
|
3893
3911
|
TableDisplayColumnType = TableDisplayColumnType;
|
|
3894
3912
|
NumberOperator = NumberOperator;
|
|
3895
3913
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CustomTableComponent, deps: [{ token: TranslateWrapperService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3896
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: CustomTableComponent, isStandalone: true, selector: "ud-table", inputs: { id: "id", title: "title", icon: "icon", actions: "actions", haveCheckbox: "haveCheckbox", displayedColumns: "displayedColumns", dataSource: "dataSource", paginationSizeOptions: "paginationSizeOptions", initialPageSize: "initialPageSize", specificSelectRow: "specificSelectRow", hasFilter: "hasFilter", expandableRows: "expandableRows", expandedItem: "expandedItem", isLoading: "isLoading", separateFilters: "separateFilters", showPaginator: "showPaginator", noTableDataMessage: "noTableDataMessage", actionsMenuEnabled: "actionsMenuEnabled", menuItems: "menuItems", totalElements: "totalElements", serverSideFiltering: "serverSideFiltering", disableHeader: "disableHeader", columnVisibilityEnabled: "columnVisibilityEnabled", copyLabel: "copyLabel", copiedLabel: "copiedLabel" }, outputs: { actionClicked: "actionClicked", clicked: "clicked", queryChange: "queryChange", cellEdited: "cellEdited", columnVisibilityChanged: "columnVisibilityChanged" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "paginatorRef", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "allFilterInput", first: true, predicate: ["allFilterInput"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"table-div\">\n <mat-card\n appearance=\"outlined\"\n class=\"px-0 table-card\"\n [ngClass]=\"[actions.length === 0 ? 'pt-2' : 'pb-0']\"\n style=\"border-color: var(--accent-darker-color)\">\n @if (!disableHeader) {\n <mat-card-header\n class=\"d-flex justify-content-between align-items-center table-header\"\n [ngClass]=\"[actions.length === 0 ? 'pb-3' : 'pb-0']\">\n <div class=\"d-flex align-items-center\">\n @if (icon) {\n <mat-icon\n fontSet=\"material-icons-outlined\"\n class=\"table-header-icon ml-3\">\n {{ icon }}\n </mat-icon>\n }\n <h6 class=\"ml-2 table-title\">\n {{ title | toObservable | async | capitalize }}\n </h6>\n </div>\n <div class=\"d-flex align-items-center action-buttons-group pr-2\">\n @for (action of actions; track action.id) {\n <ud-button\n [attr.data-action-id]=\"action.id\"\n [variant]=\"action.variant ?? 'stroked'\"\n [color]=\"action.color ?? 'primary'\"\n [icon]=\"action.icon\"\n [disabled]=\"resolveBooleanInput(action?.disabled, selection)\"\n [loading]=\"resolveBooleanInput(action?.loading, selection)\"\n size=\"sm\"\n (buttonClick)=\"onActionClicked(action)\">\n {{ action.label | toObservable | async | capitalize }}\n </ud-button>\n }\n @if (actionsMenuEnabled && menuItems.length > 0) {\n <ud-menu\n [items]=\"tableMenuItems()\"\n triggerVariant=\"stroked\"\n triggerColor=\"primary\"\n triggerIcon=\"keyboard_arrow_down\"\n [triggerLabel]=\"'names.action' | translate | pluralize | capitalize\"\n xPosition=\"after\"\n [stopPropagation]=\"false\"\n (itemSelected)=\"onTableMenuItemSelected($event)\" />\n } @else if (actionsMenuEnabled) {\n <ud-button\n variant=\"stroked\"\n color=\"primary\"\n size=\"sm\"\n icon=\"keyboard_arrow_down\"\n iconPosition=\"right\"\n [matMenuTriggerFor]=\"menu\">\n {{ 'names.action' | translate | pluralize | capitalize }}\n </ud-button>\n <mat-menu #menu=\"matMenu\" class=\"ud-actions-menu\">\n <ng-container\n *ngTemplateOutlet=\"\n actionsTemplate;\n context: {\n selection: selection,\n data: dataSource.data,\n selectedRows: selection.selected,\n }\n \"></ng-container>\n </mat-menu>\n }\n </div>\n </mat-card-header>\n }\n <mat-card-content>\n <!--\n Filters and the column picker on one line. Both answer the same\n question \u2014 what am I looking at \u2014 where the header above is for acting\n on the rows. The picker sat up there with Add and Delete and read as a\n third action rather than a view control.\n -->\n <div class=\"table-controls\">\n @if (!separateFilters) {\n <mat-form-field\n class=\"ml-4\"\n appearance=\"outline\"\n [ngStyle]=\"{ display: hasFilter ? '' : 'none' }\">\n <mat-icon class=\"filter p-0\" matSuffix>filter_alt</mat-icon>\n <mat-label>{{ 'table.filter' | translate | capitalize }}</mat-label>\n <input\n #allFilterInput\n matInput\n (keyup)=\"applyFilterToAllColumns($event)\"\n [placeholder]=\"'table.sortOnAnyField' | translate | capitalize\" />\n </mat-form-field>\n } @else {\n <div class=\"separate-filters\">\n <form [formGroup]=\"filterByColumnFormGroup\" class=\"filters\">\n @for (filter of selectedFilters; track filter) {\n <!--\n The active marker lives on the wrapper so every filter type\n carries it. The dropdown triggers styled themselves, but a text\n input or a single select looked identical whether or not it was\n narrowing the table \u2014 which is how you end up staring at an\n empty table wondering where the rows went.\n -->\n <div class=\"filter\" [class.filter--active]=\"hasFilterValue(filter.property)\">\n @if (filter.filterOptions) {\n @if (filter.allowMultiSelectOnFilter) {\n <ud-button\n variant=\"stroked\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"keyboard_arrow_down\"\n iconPosition=\"right\"\n [class.filter-button-trigger--active]=\"\n hasFilterValue(filter.property)\n \"\n [matMenuTriggerFor]=\"multiSelectMenu\">\n {{ filter.name | toObservable | async | capitalize }}\n @if (hasFilterValue(filter.property)) {\n <mat-icon\n class=\"filter-clear-icon\"\n (click)=\"\n clearFilter(filter.property); $event.stopPropagation()\n \">\n close\n </mat-icon>\n }\n </ud-button>\n <mat-menu #multiSelectMenu=\"matMenu\" class=\"custom-dropdown\">\n <div\n class=\"dropdown-content multi-select-content\"\n [formGroupName]=\"controlKey(filter.property)\"\n (click)=\"$event.stopPropagation()\">\n <span class=\"dropdown-label\">\n {{ 'table.matchMode' | translate | capitalize }}\n </span>\n <ud-button-toggle\n formControlName=\"mode\"\n size=\"sm\"\n [options]=\"matchModeOptions\" />\n <ud-multi-select\n controlName=\"values\"\n [options]=\"filter.filterOptions\"\n [placeholder]=\"\n filter.name | toObservable | async | capitalize\n \"\n [multiple]=\"true\"\n [clearable]=\"true\"\n size=\"small\" />\n </div>\n </mat-menu>\n } @else {\n <ud-multi-select\n [controlName]=\"controlKey(filter.property)\"\n [options]=\"filter.filterOptions\"\n [placeholder]=\"\n filter.name | toObservable | async | capitalize\n \"\n [multiple]=\"false\"\n [clearable]=\"true\"\n size=\"small\" />\n }\n } @else if (\n filter.type === TableDisplayColumnType.HYPERLINK ||\n filter.type === TableDisplayColumnType.TEXT ||\n filter.type === TableDisplayColumnType.PHONE ||\n filter.type === TableDisplayColumnType.EMAIL ||\n filter.type === TableDisplayColumnType.CLICK ||\n filter.type === TableDisplayColumnType.ARRAY ||\n filter.type === TableDisplayColumnType.PILL\n ) {\n <ud-text-input\n [controlName]=\"controlKey(filter.property)\"\n [placeholder]=\"\n filter.name | toObservable | async | capitalize\n \"\n size=\"small\"\n [clearable]=\"true\" />\n } @else {\n <ud-button\n variant=\"stroked\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"keyboard_arrow_down\"\n iconPosition=\"right\"\n [class.filter-button-trigger--active]=\"\n hasFilterValue(filter.property)\n \"\n [matMenuTriggerFor]=\"dropdownMenu\">\n {{ filter.name | toObservable | async | capitalize }}\n @if (hasFilterValue(filter.property)) {\n <mat-icon\n class=\"filter-clear-icon\"\n (click)=\"\n clearFilter(filter.property); $event.stopPropagation()\n \">\n close\n </mat-icon>\n }\n </ud-button>\n <mat-menu #dropdownMenu=\"matMenu\" class=\"custom-dropdown\">\n <div\n class=\"dropdown-content\"\n (click)=\"$event.stopPropagation()\">\n @if (filter.type === TableDisplayColumnType.BOOLEAN) {\n <div class=\"boolean-content\">\n <span class=\"boolean-label\">\n {{\n filter.name | toObservable | async | capitalize\n }}\n </span>\n <ud-toggle\n [formControlName]=\"controlKey(filter.property)\"\n size=\"md\" />\n </div>\n } @else if (\n filter.type === TableDisplayColumnType.NUMBER ||\n filter.type === TableDisplayColumnType.MONEY\n ) {\n <div\n class=\"number-content\"\n [formGroupName]=\"controlKey(filter.property)\">\n <ud-multi-select\n controlName=\"operation\"\n [multiple]=\"false\"\n [label]=\"\n 'table.operationType' | translate | capitalize\n \"\n [options]=\"numberOperationOptions\" />\n @if (\n filterByColumnFormGroup.controls[controlKey(filter.property)]\n .value.operation &&\n filterByColumnFormGroup.controls[controlKey(filter.property)]\n .value.operation !== NumberOperator.BETWEEN\n ) {\n <ud-text-input\n controlName=\"value\"\n type=\"number\"\n [label]=\"\n 'operators.numbers.' +\n filterByColumnFormGroup.controls[\n controlKey(filter.property)\n ].value.operation\n | translate\n | capitalize\n \" />\n } @else if (\n filterByColumnFormGroup.controls[controlKey(filter.property)]\n .value.operation\n ) {\n <div class=\"number-range-row\">\n <ud-text-input\n controlName=\"min\"\n type=\"number\"\n [label]=\"\n 'operators.minimum' | translate | capitalize\n \" />\n <ud-text-input\n controlName=\"max\"\n type=\"number\"\n [min]=\"\n filterByColumnFormGroup.controls[\n controlKey(filter.property)\n ].value.min\n \"\n [label]=\"\n 'operators.maximum' | translate | capitalize\n \" />\n </div>\n }\n </div>\n } @else if (\n filter.type === TableDisplayColumnType.DATETIME ||\n filter.type === TableDisplayColumnType.DATE\n ) {\n <div\n [formGroupName]=\"controlKey(filter.property)\"\n class=\"date-content\">\n <ud-date-range-input\n startControlName=\"start\"\n endControlName=\"end\"\n [label]=\"'table.dateRange' | translate | capitalize\"\n [startPlaceholder]=\"\n 'table.startDate' | translate | capitalize\n \"\n [endPlaceholder]=\"\n 'table.endDate' | translate | capitalize\n \" />\n </div>\n }\n </div>\n </mat-menu>\n }\n </div>\n }\n\n <!--\n Inside the row so it reads as the end of the filter set rather\n than a separate control, and only once there is something to\n clear \u2014 a permanently present \"clear filters\" on an unfiltered\n table is a button that does nothing.\n -->\n @if (activeFilterCount > 0) {\n <button\n type=\"button\"\n class=\"filters-clear\"\n (click)=\"clearAllFilters()\">\n <!--\n Count as a separate numeral rather than interpolated into the\n sentence: \"Clear {{count}} filters\" reads wrong at one, and\n every consuming app would need a plural rule for a label this\n small. The mono numeral also lines up as the count changes.\n -->\n {{ 'table.clearFilters' | translate | capitalize }}\n <span class=\"filters-clear__count\">{{ activeFilterCount }}</span>\n </button>\n }\n </form>\n </div>\n }\n\n @if (columnVisibilityEnabled) {\n <ud-button\n class=\"column-picker\"\n [class.column-picker--active]=\"hiddenColumnCount > 0\"\n variant=\"stroked\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"view_week\"\n [udTooltip]=\"'table.chooseColumnsLede' | translate\"\n (buttonClick)=\"openColumnVisibility()\">\n {{ 'table.columns' | translate | capitalize }}\n </ud-button>\n }\n </div>\n <!--\n Which columns are off, by name, with the way back (UC-40). The tinted\n Columns button says only that something is hidden; once a list hides\n columns by default, \"where did Paid go\" needs an answer on the page.\n -->\n @if (columnVisibilityEnabled && hiddenColumnCount > 0) {\n <div class=\"hidden-columns\" role=\"status\">\n <span class=\"hidden-columns__label\">\n {{ 'table.columnsHidden' | translate }}\n </span>\n <span class=\"hidden-columns__names\">\n @for (col of hiddenColumns; track col.property; let last = $last) {\n {{ col.name | toObservable | async | capitalize }}{{ last ? '' : ', ' }}\n }\n </span>\n <button\n type=\"button\"\n class=\"hidden-columns__show\"\n (click)=\"showAllColumns()\">\n {{ 'table.showAllColumns' | translate | capitalize }}\n </button>\n </div>\n }\n @if (!isLoading) {\n <table\n mat-table\n matSort\n [matSortActive]=\"initSortedCol?.property!\"\n [matSortDirection]=\"initSortedCol?.initSort!\"\n [multiTemplateDataRows]=\"expandableRows\"\n [dataSource]=\"dataSource\">\n <!-- Checkbox Column -->\n @if (displayCheckbox) {\n <ng-container matColumnDef=\"select\">\n <th\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n class=\"checkbox-header\"\n mat-header-cell\n *matHeaderCellDef>\n <ud-checkbox\n (onChange)=\"toggleAllRows()\"\n [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\"\n [ariaLabel]=\"checkboxLabel()\">\n </ud-checkbox>\n </th>\n <td\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n class=\"checkbox-cell\"\n mat-cell\n *matCellDef=\"let row\">\n <ud-checkbox\n (click)=\"$event.stopPropagation()\"\n (onChange)=\"selection.toggle(row)\"\n [checked]=\"selection.isSelected(row)\"\n [ariaLabel]=\"checkboxLabel(row)\"\n class=\"mt-2 mr-2\">\n </ud-checkbox>\n </td>\n </ng-container>\n }\n @for (column of displayedColumnsWithoutSelect; track column) {\n <ng-container matColumnDef=\"{{ column.property }}\">\n <th\n [ngStyle]=\"{ width: getColumnWidth(column) }\"\n mat-header-cell\n *matHeaderCellDef>\n {{ column.name | toObservable | async | capitalize }}\n </th>\n <td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [ngStyle]=\"{ width: getColumnWidth(column) }\"\n [class.editable-cell]=\"column.editable\"\n (mouseenter)=\"\n column.editable &&\n (hoveredCell = {\n rowIndex: index,\n property: column.property,\n })\n \"\n (mouseleave)=\"hoveredCell = null\"\n (click)=\"column.dataCellTemplate && $event.stopPropagation()\">\n @if (\n column.editable &&\n editingCell?.rowIndex === index &&\n editingCell?.property === column.property\n ) {\n <div\n class=\"cell-edit-wrapper\"\n [formGroup]=\"editFormGroup\"\n (click)=\"$event.stopPropagation()\">\n @if (column.editOptions) {\n <ud-multi-select\n controlName=\"value\"\n [multiple]=\"column.allowMultiSelectOnEdit ?? false\"\n [options]=\"column.editOptions\"\n size=\"small\" />\n } @else {\n <ud-text-input\n controlName=\"value\"\n [type]=\"\n column.type === tableDisplayColumnType.NUMBER\n ? 'number'\n : 'text'\n \"\n size=\"small\" />\n }\n <div class=\"cell-edit-actions\">\n <ud-button\n variant=\"icon-only\"\n color=\"success\"\n icon=\"check\"\n size=\"sm\"\n (buttonClick)=\"\n confirmEdit(row, column); $event.stopPropagation()\n \" />\n <ud-button\n variant=\"icon-only\"\n color=\"danger\"\n icon=\"close\"\n size=\"sm\"\n (buttonClick)=\"cancelEdit(); $event.stopPropagation()\" />\n </div>\n </div>\n } @else {\n <div class=\"cell-display-wrapper\">\n @if (column.dataCellTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n column.dataCellTemplate;\n context: { $implicit: row, index }\n \" />\n } @else if (column.type) {\n @switch (column.type) {\n @case (tableDisplayColumnType.ARRAY) {\n <span>\n {{\n column.transformFn?.(row[column.property]) ??\n row[column.property].join(', ')\n }}\n </span>\n }\n @case (tableDisplayColumnType.TEXT) {\n <span\n [innerHTML]=\"\n column.transformFn?.(row[column.property]) ??\n row[column.property]\n \">\n </span>\n }\n @case (tableDisplayColumnType.NUMBER) {\n <span\n [innerHTML]=\"\n column.transformFn?.(row[column.property]) ??\n row[column.property]\n \">\n </span>\n }\n @case (tableDisplayColumnType.TEXT_OBSERVABLES) {\n <span>\n {{ row[column.property] | async | capitalize }}\n </span>\n }\n @case (tableDisplayColumnType.BOOLEAN) {\n <mat-icon\n class=\"mt-2\"\n [udTooltip]=\"\n (row[column.property]\n ? 'names.active'\n : 'names.inactive'\n )\n | translate\n | capitalize\n \"\n udTooltipPosition=\"right\">\n {{ row[column.property] ? 'check' : 'close' }}\n </mat-icon>\n }\n @case (tableDisplayColumnType.CLICK) {\n <span (click)=\"clickedAction(row)\" class=\"link\">\n {{ row[column.property] }}\n </span>\n }\n @case (tableDisplayColumnType.DATE) {\n {{ row[column.property] | date: 'MMMM dd, yyyy' }}\n }\n @case (tableDisplayColumnType.DATETIME) {\n {{\n row[column.property]\n | date: 'MMMM dd, yyyy h:mm a'\n }}\n }\n @case (tableDisplayColumnType.EMAIL) {\n @let email = row[column.property];\n @if (email) {\n <span class=\"email-cell\">\n <mat-icon class=\"email-icon\">mail_outline</mat-icon>\n <span>{{ email }}</span>\n <span\n class=\"email-copy\"\n [class.is-copied]=\"copiedEmailRow() === row\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n [icon]=\"copiedEmailRow() === row ? 'check' : 'content_copy'\"\n [udTooltip]=\"(copiedEmailRow() === row ? copiedLabel : copyLabel) | translate | capitalize\"\n (buttonClick)=\"copyEmail(row, email); $event.stopPropagation()\" />\n </span>\n </span>\n }\n }\n @case (tableDisplayColumnType.HYPERLINK) {\n <span\n class=\"link\"\n [routerLink]=\"getHyperlinkRoute(row, column)\"\n (click)=\"$event.stopPropagation()\">\n {{ row[column.property] }}\n </span>\n }\n @case (tableDisplayColumnType.ICON) {\n <mat-icon\n [ngStyle]=\"{\n color:\n column.icons![row[column.property]].color,\n }\">\n {{ column.icons![row[column.property]].name }}\n </mat-icon>\n }\n @case (tableDisplayColumnType.MONEY) {\n {{ formatMoneyCell(row, column) }}\n }\n @case (tableDisplayColumnType.PHONE) {\n @if (row[column.property].countryCode?.code) {\n <span>\n (+{{\n row[column.property].countryCode.code || ''\n }})\n </span>\n }\n {{\n formatPhoneNumber(\n row[column.property].phoneNumber\n )\n }}\n }\n @case (tableDisplayColumnType.PILL) {\n <ud-pill\n [text]=\"\n column.transformFn?.(row[column.property]) ??\n row[column.property]\n \"\n [type]=\"column.pillTypeFn!(row)\" />\n }\n }\n } @else {\n {{ row[column.property] }}\n }\n @if (column.editable) {\n <button\n mat-icon-button\n class=\"cell-edit-icon\"\n [class.cell-edit-icon--visible]=\"\n hoveredCell?.rowIndex === index &&\n hoveredCell?.property === column.property\n \"\n (click)=\"\n startEditing(row, index, column);\n $event.stopPropagation()\n \">\n <mat-icon>edit</mat-icon>\n </button>\n }\n </div>\n }\n </td>\n </ng-container>\n }\n <ng-container matColumnDef=\"expand\">\n <th\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n mat-header-cell\n *matHeaderCellDef\n aria-label=\"row actions\">\n \n </th>\n <td\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n mat-cell\n *matCellDef=\"let element\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n ariaLabel=\"expand row\"\n [icon]=\"\n expandedElement !== element\n ? 'keyboard_arrow_down'\n : 'keyboard_arrow_up'\n \"\n (buttonClick)=\"\n expandedElement =\n expandedElement === element ? null : element;\n $event.stopPropagation()\n \" />\n </td>\n </ng-container>\n\n <!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->\n <ng-container matColumnDef=\"expandedDetail\">\n <td\n mat-cell\n class=\"ml-auto\"\n *matCellDef=\"let element\"\n [attr.colspan]=\"columnsToDisplayWithExpand.length\">\n <div\n class=\"element-detail justify-content-center\"\n [@detailExpand]=\"\n element === expandedElement ? 'expanded' : 'collapsed'\n \">\n @if (expandedItem.type === 'image') {\n <img\n class=\"pb-4\"\n [src]=\"element[expandedItem.property]\"\n alt=\"\" />\n }\n </div>\n </td>\n </ng-container>\n\n @if (!expandableRows) {\n <ng-container>\n <tr\n mat-header-row\n *matHeaderRowDef=\"displayedColumnsProperty\"></tr>\n <tr\n mat-row\n *matRowDef=\"\n let row;\n columns: displayedColumnsProperty;\n let i = index\n \"\n (click)=\"selectRow(row)\"\n [ngClass]=\"getRowBackgroundColor(i)\"></tr>\n </ng-container>\n } @else {\n <ng-container>\n <tr\n mat-header-row\n *matHeaderRowDef=\"columnsToDisplayWithExpand\"></tr>\n <tr\n mat-row\n *matRowDef=\"\n let row;\n columns: columnsToDisplayWithExpand;\n let i = dataIndex\n \"\n [id]=\"i\"\n class=\"element-row\"\n [class.expanded-row]=\"expandedElement === row\"\n [ngClass]=\"getRowBackgroundColor(i)\"></tr>\n <tr\n mat-row\n *matRowDef=\"\n let row;\n columns: ['expandedDetail'];\n let i = dataIndex\n \"\n [id]=\"i\"\n [ngClass]=\"getRowBackgroundColor(i)\"\n [ngStyle]=\"{\n display: expandedElement === row ? 'contents' : 'none',\n }\"\n class=\"detail-row\"></tr>\n </ng-container>\n }\n\n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row no-data-row\" *matNoDataRow>\n <td class=\"mat-cell\" [attr.colspan]=\"displayedColumnsProperty.length\">\n <div class=\"no-data-found\">\n <mat-icon class=\"no-data-icon\">\n {{ dataSource.data.length > 0 ? 'search_off' : 'inbox' }}\n </mat-icon>\n <p class=\"no-data-text\">\n {{\n dataSource.data.length > 0\n ? ('messages.modifyFilter' | translate | capitalize)\n : noTableDataMessage\n }}\n </p>\n </div>\n </td>\n </tr>\n </table>\n } @else {\n <div class=\"loading-container\">\n <mat-progress-spinner\n class=\"mx-auto\"\n [diameter]=\"32\"\n color=\"primary\"\n mode=\"indeterminate\" />\n </div>\n }\n @if (showPaginator) {\n <div class=\"table-paginator\">\n <div class=\"table-paginator__size\">\n <span class=\"table-paginator__size-label\">\n {{ 'table.rowsPerPage' | translate | capitalize }}\n </span>\n <ud-menu\n [items]=\"pageSizeMenuItems\"\n triggerVariant=\"stroked\"\n triggerIcon=\"keyboard_arrow_down\"\n [triggerLabel]=\"pageSizeLabel\"\n [ariaLabel]=\"'table.rowsPerPage' | translate | capitalize\"\n xPosition=\"after\"\n yPosition=\"above\"\n [stopPropagation]=\"false\"\n (itemSelected)=\"onPageSizeSelected($event)\" />\n </div>\n <!-- Drives paging and dataSource.paginator; hidden, the controls below render it. -->\n <mat-paginator\n #pager\n [length]=\"totalElements ?? dataSource.data.length\"\n [pageSize]=\"initialPageSize\"\n [pageSizeOptions]=\"paginationSizeOptions\"\n (page)=\"onPageChange($event)\" />\n <span class=\"table-paginator__range\">\n {{ pager._intl.getRangeLabel(pager.pageIndex, pager.pageSize, pager.length) }}\n </span>\n <div class=\"table-paginator__nav\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"first_page\"\n [ariaLabel]=\"pager._intl.firstPageLabel\"\n [disabled]=\"!pager.hasPreviousPage()\"\n (buttonClick)=\"pager.firstPage()\" />\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"chevron_left\"\n [ariaLabel]=\"pager._intl.previousPageLabel\"\n [disabled]=\"!pager.hasPreviousPage()\"\n (buttonClick)=\"pager.previousPage()\" />\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"chevron_right\"\n [ariaLabel]=\"pager._intl.nextPageLabel\"\n [disabled]=\"!pager.hasNextPage()\"\n (buttonClick)=\"pager.nextPage()\" />\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"last_page\"\n [ariaLabel]=\"pager._intl.lastPageLabel\"\n [disabled]=\"!pager.hasNextPage()\"\n (buttonClick)=\"pager.lastPage()\" />\n </div>\n </div>\n }\n </mat-card-content>\n </mat-card>\n</div>\n", styles: [":host{--eu-navy: #1b2535;--eu-navy-soft: #253347;--eu-navy-dim: rgba(27, 37, 53, .08);--eu-navy-mid: rgba(27, 37, 53, .18);--eu-surface: #ffffff;--eu-bg: #f4f5f7;--eu-border: #e2e5ea;--eu-border-mid: #c9cdd6;--eu-text: #1b2535;--eu-muted: #6b7585;--eu-danger: var(--danger, #e53935);--eu-radius: 10px;--eu-radius-sm: 6px;--eu-shadow: 0 2px 12px rgba(27, 37, 53, .06), 0 1px 4px rgba(27, 37, 53, .04);--eu-shadow-btn: 0 4px 14px rgba(27, 37, 53, .22);font-family:Sora,system-ui,sans-serif;position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}input:-webkit-autofill,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-box-shadow:0 0 0 30px #fafafa inset!important;background-color:#fafafa!important}p{font:20px Roboto,Helvetica Neue,sans-serif}.bg-accent{background-color:var(--accent-color)}.table-div .separate-filters{display:flex;flex-direction:column}.table-div .separate-filters .filter-dropdown{width:fit-content}.table-div .separate-filters .filters{display:flex;flex-direction:row;gap:8px;margin:0 24px 1rem}.table-div .separate-filters .filters .filter mat-icon{margin-right:0!important}.table-div mat-card.table-card{border-radius:10px!important;overflow:hidden;box-shadow:0 2px 12px #373f4c1a!important;background:#fff!important}.table-div mat-card.table-card mat-card-header.table-header{padding:14px 16px 14px 12px;background:var(--accent-lightest-color);border-bottom:1px solid var(--accent-color);min-height:65px}.table-div mat-card.table-card mat-card-header.table-header ::ng-deep .mat-mdc-card-header-text{display:none}.table-div mat-card.table-card mat-card-header.table-header .table-header-icon{color:var(--primary-color);font-size:20px;width:20px;height:20px}.table-div mat-card.table-card mat-card-header.table-header .table-title{margin-bottom:0;font-size:.9375rem;font-weight:600;letter-spacing:.01em;color:#373f4c}.table-div mat-card.table-card mat-card-content{padding:0}.table-div mat-card.table-card mat-card-content .no-data-found{display:flex;flex-direction:column;justify-content:center;align-items:center;height:140px;gap:8px;background:#fff}.table-div mat-card.table-card mat-card-content .no-data-found .no-data-icon{font-size:40px;width:40px;height:40px;color:var(--accent-darker-color);opacity:.7}.table-div mat-card.table-card mat-card-content .no-data-found .no-data-text{font-size:.875rem;color:#373f4c;margin:0}.table-div mat-card.table-card mat-card-content .loading-container{display:flex;justify-content:center;align-items:center;padding:32px;background:#fff}.table-div mat-card.table-card mat-card-content .table-paginator{display:flex;align-items:center;justify-content:flex-end;gap:16px;border-radius:0 0 10px 10px;background-color:#dde3ec;border-top:1px solid #c8c8d4}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__size{display:flex;align-items:center;gap:8px}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__size-label{font-family:Sora,system-ui,sans-serif;font-size:.8125rem;color:#6b7585;white-space:nowrap}.table-div mat-card.table-card mat-card-content .table-paginator mat-paginator{display:none}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__range{font-family:Sora,system-ui,sans-serif;font-size:.8125rem;font-variant-numeric:tabular-nums;color:#6b7585;white-space:nowrap}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__nav{display:flex;align-items:center;gap:2px;padding:8px 12px 8px 0}.table-div .action-buttons-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.table-div tr td,.table-div tr th{border-bottom:1px solid var(--accent-color);color:#373f4c;padding:10px 8px}.table-div tr th{background-color:#dde3ec;font-weight:600;font-size:.9rem;letter-spacing:.05em}.table-div tr th:first-of-type,.table-div tr td:first-of-type{padding-left:20px}.table-div tr th:last-of-type,.table-div tr td:last-of-type{padding-right:20px}table{width:100%}.mat-mdc-form-field{font-size:14px}.mat-mdc-form-field ::ng-deep .mat-mdc-text-field-wrapper{max-height:45px;padding-left:4px}.mat-mdc-form-field ::ng-deep .mat-mdc-text-field-wrapper [class^=mdc-notched-outline__]{border:none;border-bottom:1px solid #929293;border-radius:0}.mat-mdc-form-field ::ng-deep .mat-mdc-text-field-wrapper [class^=mdc-notched-outline__]:first-of-type{display:none}.mat-mdc-icon-button.mat-mdc-button-base{padding:10px}.spacer{flex:1 1 auto}.link{color:#459fff;font-weight:600;cursor:pointer}.email-cell{display:inline-flex;align-items:center;gap:6px}.email-cell .email-icon{font-size:15px;width:15px;height:15px;opacity:.4;flex-shrink:0}.email-copy{display:inline-flex;align-items:center;height:1em;opacity:0;transition:opacity .12s ease}tr:hover .email-copy,.email-copy:focus-within,.email-copy.is-copied{opacity:1}@media (hover: none){.email-copy{opacity:1}}@media (prefers-reduced-motion: reduce){.email-copy{transition:none}}.filter{font-size:100%;border-top:.84375em solid rgba(0,0,0,0)}tr.detail-row{height:0}tr.no-data-row td{border-bottom:none;padding:0}.element-row td{border-bottom-width:0}.element-detail{overflow:hidden;display:flex}.element-detail>img{max-height:100%}.element-symbol{font-weight:700;font-size:40px;line-height:normal}.element-description{padding:16px}.element-description-attribution{opacity:.5}.pills{display:flex;flex-direction:column;gap:16px;margin:8px 2px}::ng-deep .ud-actions-menu{border-radius:10px!important;box-shadow:0 4px 20px #1b25351a,0 1px 4px #1b25350f!important;border:1px solid rgba(27,37,53,.08);overflow:hidden;min-width:200px!important}::ng-deep .ud-actions-menu .mat-mdc-menu-content{padding:4px!important}::ng-deep .ud-actions-menu .ud-menu-divider{height:1px;margin:4px 8px;background:#1b253514}::ng-deep .ud-actions-menu .ud-menu-item{display:flex;align-items:center;gap:0;height:auto;min-height:40px;padding:0 12px 0 0!important;border-radius:7px;margin:1px 0;position:relative;overflow:hidden;transition:background .15s ease}::ng-deep .ud-actions-menu .ud-menu-item .mat-mdc-menu-item-text{display:flex;align-items:center}::ng-deep .ud-actions-menu .ud-menu-item:before{content:\"\";position:absolute;left:0;top:6px;bottom:6px;width:3px;border-radius:0 2px 2px 0;background:#1b2535;transform:scaleY(0);transform-origin:center;transition:transform .18s cubic-bezier(.4,0,.2,1)}::ng-deep .ud-actions-menu .ud-menu-item:hover:not([disabled]):before{transform:scaleY(1)}::ng-deep .ud-actions-menu .ud-menu-item:hover:not([disabled]){background:#1b25350d!important}::ng-deep .ud-actions-menu .ud-menu-item[disabled]{opacity:1}::ng-deep .ud-actions-menu .ud-menu-item[disabled] .ud-menu-item__icon-wrap,::ng-deep .ud-actions-menu .ud-menu-item[disabled] .ud-menu-item__label{opacity:.38}::ng-deep .ud-actions-menu .ud-menu-item--no-icon{padding-left:12px!important}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__icon-wrap{display:flex;align-items:center;justify-content:center;width:40px;flex-shrink:0;align-self:stretch;max-height:40px}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__icon-wrap mat-icon{font-size:17px;width:17px;height:17px;margin:0;color:#6b7585;transition:color .15s ease}::ng-deep .ud-actions-menu .ud-menu-item:hover:not([disabled]) .ud-menu-item__icon-wrap mat-icon{color:#1b2535}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__text{display:flex;flex-direction:column;padding:8px 0;min-width:0}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__label{font-family:Sora,system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.25rem;color:#1b2535;letter-spacing:.01em;white-space:nowrap}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__description{font-family:Sora,system-ui,sans-serif;font-size:.75rem;line-height:1rem;color:#6b7585;white-space:normal}::ng-deep .ud-actions-menu .ud-menu-item--danger .ud-menu-item__label,::ng-deep .ud-actions-menu .ud-menu-item--danger .ud-menu-item__icon-wrap mat-icon,::ng-deep .ud-actions-menu .ud-menu-item--danger:hover:not([disabled]) .ud-menu-item__icon-wrap mat-icon{color:#e53935}::ng-deep .ud-actions-menu .ud-menu-item--danger:before{background:#e53935}::ng-deep .ud-actions-menu .ud-menu-item .mdc-list-item__primary-text{display:none!important}.filter--active{position:relative}.filter--active:after{content:\"\";position:absolute;left:0;right:0;bottom:-5px;height:2px;border-radius:2px;background:#459fff;pointer-events:none}.table-controls{display:flex;align-items:flex-start;gap:12px}.table-controls .separate-filters{flex:1 1 auto;min-width:0}.column-picker{flex:0 0 auto;margin:.84375em 24px 0 auto}.column-picker--active ::ng-deep .ud-btn.ud-btn--stroked{background:#459fff17!important;border-color:#459fff8c!important;color:#1b2535!important;font-weight:600!important}.column-picker--active ::ng-deep .ud-btn.ud-btn--stroked:hover:not(:disabled){background:#459fff24!important;border-color:#459fffbf!important;color:#1b2535!important}.hidden-columns{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px;padding:6px 24px 10px;font-family:var(--ud-field-font);font-size:.8125rem;color:#6b7585}.hidden-columns__label{font-family:JetBrains Mono,ui-monospace,monospace;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#1b2535}.hidden-columns__names{min-width:0}.hidden-columns__show{padding:0 2px;border:0;background:none;color:#459fff;font:inherit;font-weight:500;cursor:pointer}.hidden-columns__show:hover{text-decoration:underline}.hidden-columns__show:focus-visible{outline:2px solid #459fff;outline-offset:3px;border-radius:3px}.filters-clear{align-self:flex-start;margin-top:.84375em;padding:0 2px;border:0;background:none;color:#6b7585;font-family:var(--ud-field-font);font-size:.8125rem;font-weight:500;line-height:34px;cursor:pointer;white-space:nowrap;transition:color .15s ease}.filters-clear:hover,.filters-clear:focus-visible{color:#459fff}.filters-clear__count{margin-left:5px;font-family:JetBrains Mono,ui-monospace,monospace;font-weight:600;color:#1b2535}.filters-clear:focus-visible{outline:2px solid #459fff;outline-offset:3px;border-radius:3px}@media (prefers-reduced-motion: reduce){.filters-clear{transition:none}}.filter-button-trigger--active{background-color:#459fff17!important;border-color:#459fff8c!important;color:#1b2535!important;font-weight:600!important}.filter-button-trigger--active ::ng-deep .ud-btn__label{display:contents}.filter-button-trigger--active ::ng-deep .ud-btn__icon--right{order:1}.filter-button-trigger--active .filter-clear-icon{order:2;font-size:15px!important;width:15px!important;height:15px!important;line-height:15px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;border-radius:50%;transition:background .15s ease}.filter-button-trigger--active .filter-clear-icon:hover{background:#1b25351f}td.editable-cell .cell-display-wrapper{display:flex;align-items:center;gap:6px;min-height:32px}td.editable-cell .cell-display-wrapper .cell-edit-icon{opacity:0;transform:scale(.72) translateY(1px);transition:opacity .16s ease,transform .18s cubic-bezier(.34,1.4,.64,1);flex-shrink:0;width:30px!important;height:30px!important;line-height:30px!important;padding:4px!important;border-radius:6px!important;background:transparent;border:1px solid transparent;display:flex!important;align-items:center!important;justify-content:center!important}td.editable-cell .cell-display-wrapper .cell-edit-icon:hover{background:rgba(var(--primary-color-rgb, 63, 81, 181),.08)!important;border-color:rgba(var(--primary-color-rgb, 63, 81, 181),.22)!important}td.editable-cell .cell-display-wrapper .cell-edit-icon ::ng-deep .mat-mdc-button-persistent-ripple,td.editable-cell .cell-display-wrapper .cell-edit-icon ::ng-deep .mat-ripple{border-radius:6px}td.editable-cell .cell-display-wrapper .cell-edit-icon ::ng-deep .mat-mdc-button-touch-target{width:30px!important;height:30px!important}td.editable-cell .cell-display-wrapper .cell-edit-icon mat-icon{font-size:14px!important;width:14px!important;height:14px!important;color:var(--primary-color);line-height:14px;display:flex!important;align-items:center;justify-content:center}td.editable-cell .cell-display-wrapper .cell-edit-icon.cell-edit-icon--visible{opacity:1;transform:scale(1) translateY(0)}td.editable-cell .cell-edit-wrapper{display:flex;align-items:center;gap:4px;animation:cell-edit-enter .18s cubic-bezier(.22,1,.36,1) both}td.editable-cell .cell-edit-wrapper ud-multi-select,td.editable-cell .cell-edit-wrapper ud-text-input{flex:1;min-width:0}td.editable-cell .cell-edit-wrapper .cell-edit-actions{display:flex;flex-direction:row;gap:3px;flex-shrink:0}@keyframes cell-edit-enter{0%{opacity:0;transform:translateY(-3px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}::ng-deep .custom-dropdown{min-width:280px!important;max-width:650px!important;width:auto!important;max-height:none!important;overflow:visible!important;border-radius:10px!important;box-shadow:0 4px 20px #1b25351a,0 1px 4px #1b25350f!important}::ng-deep .custom-dropdown .mat-mdc-menu-content{padding:14px;width:100%;box-sizing:border-box}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content{box-sizing:border-box}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .boolean-content{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:200px;padding:4px 0}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .boolean-content .boolean-label{font-family:Sora,system-ui,sans-serif;font-size:.875rem;font-weight:500;color:#1b2535}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .date-content{width:320px}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .date-content ud-date-range-input{display:block;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .string-content{display:flex;gap:1rem}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content mat-form-field{width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content mat-form-field .mat-mdc-form-field{font-size:14px}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content mat-form-field input{width:100%;box-sizing:border-box}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content{display:flex;flex-direction:column;gap:12px;width:280px}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content .dropdown-label{font-family:inherit;font-size:.8125rem;font-weight:500;color:#1b2535}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content ud-button-toggle{display:block;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content ud-multi-select{display:block;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .number-content{display:flex;flex-direction:column;gap:8px;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .number-content ud-multi-select{width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .number-content .number-range-row{display:flex;gap:8px;width:100%}\n"], dependencies: [{ kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "pipe", type: ToObservablePipe, name: "toObservable" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "component", type: CheckboxComponent, selector: "ud-checkbox", inputs: ["controlName", "size", "label", "labelPosition", "ariaLabel", "indeterminate", "checked", "disabled"], outputs: ["onChange"] }, { kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: UdMenuComponent, selector: "ud-menu", inputs: ["items", "triggerVariant", "triggerIcon", "triggerLabel", "triggerColor", "triggerSize", "customTrigger", "ariaLabel", "disabled", "loading", "xPosition", "yPosition", "stopPropagation", "panelClass"], outputs: ["itemSelected", "opened", "closed"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "pipe", type: PluralizePipe, name: "pluralize" }, { kind: "component", type: ToggleComponent, selector: "ud-toggle", inputs: ["controlName", "size", "label", "labelPosition", "ariaLabel"], outputs: ["onChange"] }, { kind: "component", type: DateRangeInputComponent, selector: "ud-date-range-input", inputs: ["startControlName", "endControlName", "label", "icon", "iconFontSet", "startPlaceholder", "endPlaceholder", "min", "max", "disabled", "hint", "startAt", "startView"] }, { kind: "component", type: TextInputComponent, selector: "ud-text-input", inputs: ["controlName", "label", "placeholder", "type", "icon", "iconFontSet", "loading", "step", "min", "max", "disabled", "hint", "size", "clearable"] }, { kind: "component", type: MultiSelectComponent, selector: "ud-multi-select", inputs: ["controlName", "label", "placeholder", "icon", "iconFontSet", "options", "multiple", "maxChipsVisible", "moreText", "size", "loading", "disabled", "clearable", "hint"] }, { kind: "component", type: UdButtonComponent, selector: "ud-button", inputs: ["variant", "color", "size", "type", "icon", "iconPosition", "iconFontSet", "loading", "disabled", "ariaLabel", "fullWidth"], outputs: ["buttonClick"] }, { kind: "component", type: PillComponent, selector: "ud-pill", inputs: ["text", "type", "variant", "showDot", "value", "options", "disabled"], outputs: ["optionSelected"] }, { kind: "component", type: UdButtonToggleComponent, selector: "ud-button-toggle", inputs: ["options", "size", "disabled"] }], animations: [
|
|
3914
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: CustomTableComponent, isStandalone: true, selector: "ud-table", inputs: { id: "id", title: "title", icon: "icon", actions: "actions", haveCheckbox: "haveCheckbox", displayedColumns: "displayedColumns", dataSource: "dataSource", paginationSizeOptions: "paginationSizeOptions", initialPageSize: "initialPageSize", specificSelectRow: "specificSelectRow", hasFilter: "hasFilter", expandableRows: "expandableRows", expandedItem: "expandedItem", isLoading: "isLoading", separateFilters: "separateFilters", showPaginator: "showPaginator", noTableDataMessage: "noTableDataMessage", actionsMenuEnabled: "actionsMenuEnabled", menuItems: "menuItems", totalElements: "totalElements", serverSideFiltering: "serverSideFiltering", disableHeader: "disableHeader", columnVisibilityEnabled: "columnVisibilityEnabled", copyLabel: "copyLabel", copiedLabel: "copiedLabel" }, outputs: { actionClicked: "actionClicked", clicked: "clicked", queryChange: "queryChange", cellEdited: "cellEdited", columnVisibilityChanged: "columnVisibilityChanged" }, queries: [{ propertyName: "actionsTemplate", first: true, predicate: TemplateRef, descendants: true }], viewQueries: [{ propertyName: "paginatorRef", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }, { propertyName: "allFilterInput", first: true, predicate: ["allFilterInput"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"table-div\">\n <mat-card\n appearance=\"outlined\"\n class=\"px-0 table-card\"\n [ngClass]=\"[actions.length === 0 ? 'pt-2' : 'pb-0']\"\n style=\"border-color: var(--accent-darker-color)\">\n @if (!disableHeader) {\n <mat-card-header\n class=\"d-flex justify-content-between align-items-center table-header\"\n [ngClass]=\"[actions.length === 0 ? 'pb-3' : 'pb-0']\">\n <div class=\"d-flex align-items-center\">\n @if (icon) {\n <mat-icon\n fontSet=\"material-icons-outlined\"\n class=\"table-header-icon ml-3\">\n {{ icon }}\n </mat-icon>\n }\n <h6 class=\"ml-2 table-title\">\n {{ title | toObservable | async | capitalize }}\n </h6>\n </div>\n <div class=\"d-flex align-items-center action-buttons-group pr-2\">\n @for (action of actions; track action.id) {\n <ud-button\n [attr.data-action-id]=\"action.id\"\n [variant]=\"action.variant ?? 'stroked'\"\n [color]=\"action.color ?? 'primary'\"\n [icon]=\"action.icon\"\n [disabled]=\"resolveBooleanInput(action?.disabled, selection)\"\n [loading]=\"resolveBooleanInput(action?.loading, selection)\"\n size=\"sm\"\n (buttonClick)=\"onActionClicked(action)\">\n {{ action.label | toObservable | async | capitalize }}\n </ud-button>\n }\n @if (actionsMenuEnabled && menuItems.length > 0) {\n <ud-menu\n [items]=\"tableMenuItems()\"\n triggerVariant=\"stroked\"\n triggerColor=\"primary\"\n triggerIcon=\"keyboard_arrow_down\"\n [triggerLabel]=\"'names.action' | translate | pluralize | capitalize\"\n xPosition=\"after\"\n [stopPropagation]=\"false\"\n (itemSelected)=\"onTableMenuItemSelected($event)\" />\n } @else if (actionsMenuEnabled) {\n <ud-button\n variant=\"stroked\"\n color=\"primary\"\n size=\"sm\"\n icon=\"keyboard_arrow_down\"\n iconPosition=\"right\"\n [matMenuTriggerFor]=\"menu\">\n {{ 'names.action' | translate | pluralize | capitalize }}\n </ud-button>\n <mat-menu #menu=\"matMenu\" class=\"ud-actions-menu\">\n <ng-container\n *ngTemplateOutlet=\"\n actionsTemplate;\n context: {\n selection: selection,\n data: dataSource.data,\n selectedRows: selection.selected,\n }\n \"></ng-container>\n </mat-menu>\n }\n </div>\n </mat-card-header>\n }\n <mat-card-content>\n <!--\n Filters and the column picker on one line. Both answer the same\n question \u2014 what am I looking at \u2014 where the header above is for acting\n on the rows. The picker sat up there with Add and Delete and read as a\n third action rather than a view control.\n -->\n <div class=\"table-controls\">\n @if (!separateFilters) {\n <mat-form-field\n class=\"ml-4\"\n appearance=\"outline\"\n [ngStyle]=\"{ display: hasFilter ? '' : 'none' }\">\n <mat-icon class=\"filter p-0\" matSuffix>filter_alt</mat-icon>\n <mat-label>{{ 'table.filter' | translate | capitalize }}</mat-label>\n <input\n #allFilterInput\n matInput\n (keyup)=\"applyFilterToAllColumns($event)\"\n [placeholder]=\"'table.sortOnAnyField' | translate | capitalize\" />\n </mat-form-field>\n } @else {\n <div class=\"separate-filters\">\n <form [formGroup]=\"filterByColumnFormGroup\" class=\"filters\">\n @for (filter of selectedFilters; track filter) {\n <!--\n The active marker lives on the wrapper so every filter type\n carries it. The dropdown triggers styled themselves, but a text\n input or a single select looked identical whether or not it was\n narrowing the table \u2014 which is how you end up staring at an\n empty table wondering where the rows went.\n -->\n <div class=\"filter\" [class.filter--active]=\"hasFilterValue(filter.property)\">\n @if (filter.filterOptions) {\n @if (filter.allowMultiSelectOnFilter) {\n <ud-button\n variant=\"stroked\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"keyboard_arrow_down\"\n iconPosition=\"right\"\n [class.filter-button-trigger--active]=\"\n hasFilterValue(filter.property)\n \"\n [matMenuTriggerFor]=\"multiSelectMenu\">\n {{ filter.name | toObservable | async | capitalize }}\n @if (hasFilterValue(filter.property)) {\n <mat-icon\n class=\"filter-clear-icon\"\n (click)=\"\n clearFilter(filter.property); $event.stopPropagation()\n \">\n close\n </mat-icon>\n }\n </ud-button>\n <mat-menu #multiSelectMenu=\"matMenu\" class=\"custom-dropdown\">\n <div\n class=\"dropdown-content multi-select-content\"\n [formGroupName]=\"controlKey(filter.property)\"\n (click)=\"$event.stopPropagation()\">\n <span class=\"dropdown-label\">\n {{ 'table.matchMode' | translate | capitalize }}\n </span>\n <ud-button-toggle\n formControlName=\"mode\"\n size=\"sm\"\n [options]=\"matchModeOptions\" />\n <ud-multi-select\n controlName=\"values\"\n [options]=\"filter.filterOptions\"\n [placeholder]=\"\n filter.name | toObservable | async | capitalize\n \"\n [multiple]=\"true\"\n [clearable]=\"true\"\n size=\"small\" />\n </div>\n </mat-menu>\n } @else {\n <ud-multi-select\n [controlName]=\"controlKey(filter.property)\"\n [options]=\"filter.filterOptions\"\n [placeholder]=\"\n filter.name | toObservable | async | capitalize\n \"\n [multiple]=\"false\"\n [clearable]=\"true\"\n size=\"small\" />\n }\n } @else if (\n filter.type === TableDisplayColumnType.HYPERLINK ||\n filter.type === TableDisplayColumnType.TEXT ||\n filter.type === TableDisplayColumnType.PHONE ||\n filter.type === TableDisplayColumnType.EMAIL ||\n filter.type === TableDisplayColumnType.CLICK ||\n filter.type === TableDisplayColumnType.ARRAY ||\n filter.type === TableDisplayColumnType.PILL\n ) {\n <ud-text-input\n [controlName]=\"controlKey(filter.property)\"\n [placeholder]=\"\n filter.name | toObservable | async | capitalize\n \"\n size=\"small\"\n [clearable]=\"true\" />\n } @else {\n <ud-button\n variant=\"stroked\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"keyboard_arrow_down\"\n iconPosition=\"right\"\n [class.filter-button-trigger--active]=\"\n hasFilterValue(filter.property)\n \"\n [matMenuTriggerFor]=\"dropdownMenu\">\n {{ filter.name | toObservable | async | capitalize }}\n @if (hasFilterValue(filter.property)) {\n <mat-icon\n class=\"filter-clear-icon\"\n (click)=\"\n clearFilter(filter.property); $event.stopPropagation()\n \">\n close\n </mat-icon>\n }\n </ud-button>\n <mat-menu #dropdownMenu=\"matMenu\" class=\"custom-dropdown\">\n <div\n class=\"dropdown-content\"\n (click)=\"$event.stopPropagation()\">\n @if (filter.type === TableDisplayColumnType.BOOLEAN) {\n <div class=\"boolean-content\">\n <span class=\"boolean-label\">\n {{\n filter.name | toObservable | async | capitalize\n }}\n </span>\n <ud-toggle\n [formControlName]=\"controlKey(filter.property)\"\n size=\"md\" />\n </div>\n } @else if (\n filter.type === TableDisplayColumnType.NUMBER ||\n filter.type === TableDisplayColumnType.MONEY\n ) {\n <div\n class=\"number-content\"\n [formGroupName]=\"controlKey(filter.property)\">\n <ud-multi-select\n controlName=\"operation\"\n [multiple]=\"false\"\n [label]=\"\n 'table.operationType' | translate | capitalize\n \"\n [options]=\"numberOperationOptions\" />\n @if (\n filterByColumnFormGroup.controls[controlKey(filter.property)]\n .value.operation &&\n filterByColumnFormGroup.controls[controlKey(filter.property)]\n .value.operation !== NumberOperator.BETWEEN\n ) {\n <ud-text-input\n controlName=\"value\"\n type=\"number\"\n [label]=\"\n 'operators.numbers.' +\n filterByColumnFormGroup.controls[\n controlKey(filter.property)\n ].value.operation\n | translate\n | capitalize\n \" />\n } @else if (\n filterByColumnFormGroup.controls[controlKey(filter.property)]\n .value.operation\n ) {\n <div class=\"number-range-row\">\n <ud-text-input\n controlName=\"min\"\n type=\"number\"\n [label]=\"\n 'operators.minimum' | translate | capitalize\n \" />\n <ud-text-input\n controlName=\"max\"\n type=\"number\"\n [min]=\"\n filterByColumnFormGroup.controls[\n controlKey(filter.property)\n ].value.min\n \"\n [label]=\"\n 'operators.maximum' | translate | capitalize\n \" />\n </div>\n }\n </div>\n } @else if (\n filter.type === TableDisplayColumnType.DATETIME ||\n filter.type === TableDisplayColumnType.DATE\n ) {\n <div\n [formGroupName]=\"controlKey(filter.property)\"\n class=\"date-content\">\n <ud-date-range-input\n startControlName=\"start\"\n endControlName=\"end\"\n [label]=\"'table.dateRange' | translate | capitalize\"\n [startPlaceholder]=\"\n 'table.startDate' | translate | capitalize\n \"\n [endPlaceholder]=\"\n 'table.endDate' | translate | capitalize\n \" />\n </div>\n }\n </div>\n </mat-menu>\n }\n </div>\n }\n\n <!--\n Inside the row so it reads as the end of the filter set rather\n than a separate control, and only once there is something to\n clear \u2014 a permanently present \"clear filters\" on an unfiltered\n table is a button that does nothing.\n -->\n @if (activeFilterCount > 0) {\n <button\n type=\"button\"\n class=\"filters-clear\"\n (click)=\"clearAllFilters()\">\n <!--\n Count as a separate numeral rather than interpolated into the\n sentence: \"Clear {{count}} filters\" reads wrong at one, and\n every consuming app would need a plural rule for a label this\n small. The mono numeral also lines up as the count changes.\n -->\n {{ 'table.clearFilters' | translate | capitalize }}\n <span class=\"filters-clear__count\">{{ activeFilterCount }}</span>\n </button>\n }\n </form>\n </div>\n }\n\n @if (columnVisibilityEnabled) {\n <ud-button\n class=\"column-picker\"\n [class.column-picker--active]=\"hiddenColumnCount > 0\"\n variant=\"stroked\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"view_week\"\n [udTooltip]=\"'table.chooseColumnsLede' | translate\"\n (buttonClick)=\"openColumnVisibility()\">\n {{ 'table.columns' | translate | capitalize }}\n </ud-button>\n }\n </div>\n <!--\n Which columns are off, by name, with the way back (UC-40). The tinted\n Columns button says only that something is hidden; once a list hides\n columns by default, \"where did Paid go\" needs an answer on the page.\n -->\n @if (columnVisibilityEnabled && hiddenColumnCount > 0) {\n <div class=\"hidden-columns\" role=\"status\">\n <span class=\"hidden-columns__label\">\n {{ 'table.columnsHidden' | translate }}\n </span>\n <span class=\"hidden-columns__names\">\n @for (col of hiddenColumns; track col.property; let last = $last) {\n {{ col.name | toObservable | async | capitalize }}{{ last ? '' : ', ' }}\n }\n </span>\n <button\n type=\"button\"\n class=\"hidden-columns__show\"\n (click)=\"showAllColumns()\">\n {{ 'table.showAllColumns' | translate | capitalize }}\n </button>\n </div>\n }\n @if (!isLoading) {\n <table\n mat-table\n matSort\n [matSortActive]=\"initSortedCol?.property!\"\n [matSortDirection]=\"initSortedCol?.initSort!\"\n [multiTemplateDataRows]=\"expandableRows\"\n [dataSource]=\"dataSource\">\n <!-- Checkbox Column -->\n @if (displayCheckbox) {\n <ng-container matColumnDef=\"select\">\n <th\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n class=\"checkbox-header\"\n mat-header-cell\n *matHeaderCellDef>\n <ud-checkbox\n (onChange)=\"toggleAllRows()\"\n [checked]=\"selection.hasValue() && isAllSelected()\"\n [indeterminate]=\"selection.hasValue() && !isAllSelected()\"\n [ariaLabel]=\"checkboxLabel()\">\n </ud-checkbox>\n </th>\n <td\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n class=\"checkbox-cell\"\n mat-cell\n *matCellDef=\"let row\">\n <ud-checkbox\n (click)=\"$event.stopPropagation()\"\n (onChange)=\"selection.toggle(row)\"\n [checked]=\"selection.isSelected(row)\"\n [ariaLabel]=\"checkboxLabel(row)\"\n class=\"mt-2 mr-2\">\n </ud-checkbox>\n </td>\n </ng-container>\n }\n @for (column of displayedColumnsWithoutSelect; track column) {\n <ng-container matColumnDef=\"{{ column.property }}\">\n <th\n [ngStyle]=\"{ width: getColumnWidth(column) }\"\n mat-header-cell\n *matHeaderCellDef>\n {{ column.name | toObservable | async | capitalize }}\n </th>\n <td\n mat-cell\n *matCellDef=\"let row; let index = index\"\n [ngStyle]=\"{ width: getColumnWidth(column) }\"\n [class.editable-cell]=\"column.editable\"\n (mouseenter)=\"\n column.editable &&\n (hoveredCell = {\n rowIndex: index,\n property: column.property,\n })\n \"\n (mouseleave)=\"hoveredCell = null\"\n (click)=\"column.dataCellTemplate && $event.stopPropagation()\">\n @if (\n column.editable &&\n editingCell?.rowIndex === index &&\n editingCell?.property === column.property\n ) {\n <div\n class=\"cell-edit-wrapper\"\n [formGroup]=\"editFormGroup\"\n (click)=\"$event.stopPropagation()\">\n @if (column.editOptions) {\n <ud-multi-select\n controlName=\"value\"\n [multiple]=\"column.allowMultiSelectOnEdit ?? false\"\n [options]=\"column.editOptions\"\n size=\"small\" />\n } @else {\n <ud-text-input\n controlName=\"value\"\n [type]=\"\n column.type === tableDisplayColumnType.NUMBER\n ? 'number'\n : 'text'\n \"\n size=\"small\" />\n }\n <div class=\"cell-edit-actions\">\n <ud-button\n variant=\"icon-only\"\n color=\"success\"\n icon=\"check\"\n size=\"sm\"\n (buttonClick)=\"\n confirmEdit(row, column); $event.stopPropagation()\n \" />\n <ud-button\n variant=\"icon-only\"\n color=\"danger\"\n icon=\"close\"\n size=\"sm\"\n (buttonClick)=\"cancelEdit(); $event.stopPropagation()\" />\n </div>\n </div>\n } @else {\n <div class=\"cell-display-wrapper\">\n @if (column.dataCellTemplate) {\n <ng-container\n *ngTemplateOutlet=\"\n column.dataCellTemplate;\n context: { $implicit: row, index }\n \" />\n } @else if (column.type) {\n @switch (column.type) {\n @case (tableDisplayColumnType.ARRAY) {\n <span>\n {{\n column.transformFn?.(row[column.property]) ??\n row[column.property].join(', ')\n }}\n </span>\n }\n @case (tableDisplayColumnType.TEXT) {\n <span\n [innerHTML]=\"\n column.transformFn?.(row[column.property]) ??\n row[column.property]\n \">\n </span>\n }\n @case (tableDisplayColumnType.NUMBER) {\n <span\n [innerHTML]=\"\n column.transformFn?.(row[column.property]) ??\n row[column.property]\n \">\n </span>\n }\n @case (tableDisplayColumnType.TEXT_OBSERVABLES) {\n <span>\n {{ row[column.property] | async | capitalize }}\n </span>\n }\n @case (tableDisplayColumnType.BOOLEAN) {\n <mat-icon\n class=\"mt-2\"\n [udTooltip]=\"\n (row[column.property]\n ? 'names.active'\n : 'names.inactive'\n )\n | translate\n | capitalize\n \"\n udTooltipPosition=\"right\">\n {{ row[column.property] ? 'check' : 'close' }}\n </mat-icon>\n }\n @case (tableDisplayColumnType.CLICK) {\n <span (click)=\"clickedAction(row)\" class=\"link\">\n {{ row[column.property] }}\n </span>\n }\n @case (tableDisplayColumnType.DATE) {\n {{ row[column.property] | date: 'MMMM dd, yyyy' }}\n }\n @case (tableDisplayColumnType.DATETIME) {\n {{\n row[column.property]\n | date: 'MMMM dd, yyyy h:mm a'\n }}\n }\n @case (tableDisplayColumnType.EMAIL) {\n @let email = row[column.property];\n @if (email) {\n <span class=\"email-cell\">\n <mat-icon class=\"email-icon\">mail_outline</mat-icon>\n <span>{{ email }}</span>\n <span\n class=\"email-copy\"\n [class.is-copied]=\"copiedEmailRow() === row\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n [icon]=\"copiedEmailRow() === row ? 'check' : 'content_copy'\"\n [udTooltip]=\"(copiedEmailRow() === row ? copiedLabel : copyLabel) | translate | capitalize\"\n (buttonClick)=\"copyEmail(row, email); $event.stopPropagation()\" />\n </span>\n </span>\n }\n }\n @case (tableDisplayColumnType.HYPERLINK) {\n <span\n class=\"link\"\n [routerLink]=\"getHyperlinkRoute(row, column)\"\n (click)=\"$event.stopPropagation()\">\n {{ row[column.property] }}\n </span>\n }\n @case (tableDisplayColumnType.ICON) {\n <mat-icon\n [ngStyle]=\"{\n color:\n column.icons![row[column.property]].color,\n }\">\n {{ column.icons![row[column.property]].name }}\n </mat-icon>\n }\n @case (tableDisplayColumnType.MONEY) {\n {{ formatMoneyCell(row, column) }}\n }\n @case (tableDisplayColumnType.PHONE) {\n @if (row[column.property].countryCode?.code) {\n <span>\n (+{{\n row[column.property].countryCode.code || ''\n }})\n </span>\n }\n {{\n formatPhoneNumber(\n row[column.property].phoneNumber\n )\n }}\n }\n @case (tableDisplayColumnType.PILL) {\n <ud-pill\n [text]=\"\n column.transformFn?.(row[column.property]) ??\n row[column.property]\n \"\n [type]=\"column.pillTypeFn!(row)\" />\n }\n }\n } @else {\n {{ row[column.property] }}\n }\n @if (column.editable) {\n <button\n mat-icon-button\n class=\"cell-edit-icon\"\n [class.cell-edit-icon--visible]=\"\n hoveredCell?.rowIndex === index &&\n hoveredCell?.property === column.property\n \"\n (click)=\"\n startEditing(row, index, column);\n $event.stopPropagation()\n \">\n <mat-icon>edit</mat-icon>\n </button>\n }\n </div>\n }\n </td>\n </ng-container>\n }\n <ng-container matColumnDef=\"expand\">\n <th\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n mat-header-cell\n *matHeaderCellDef\n aria-label=\"row actions\">\n \n </th>\n <td\n [ngStyle]=\"{ width: actionColumnStyleWidth }\"\n mat-cell\n *matCellDef=\"let element\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n ariaLabel=\"expand row\"\n [icon]=\"\n expandedElement !== element\n ? 'keyboard_arrow_down'\n : 'keyboard_arrow_up'\n \"\n (buttonClick)=\"\n expandedElement =\n expandedElement === element ? null : element;\n $event.stopPropagation()\n \" />\n </td>\n </ng-container>\n\n <!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->\n <ng-container matColumnDef=\"expandedDetail\">\n <td\n mat-cell\n class=\"ml-auto\"\n *matCellDef=\"let element\"\n [attr.colspan]=\"columnsToDisplayWithExpand.length\">\n <div\n class=\"element-detail justify-content-center\"\n [@detailExpand]=\"\n element === expandedElement ? 'expanded' : 'collapsed'\n \">\n @if (expandedItem.type === 'image') {\n <img\n class=\"pb-4\"\n [src]=\"element[expandedItem.property]\"\n alt=\"\" />\n }\n </div>\n </td>\n </ng-container>\n\n @if (!expandableRows) {\n <ng-container>\n <tr\n mat-header-row\n *matHeaderRowDef=\"displayedColumnsProperty\"></tr>\n <tr\n mat-row\n *matRowDef=\"\n let row;\n columns: displayedColumnsProperty;\n let i = index\n \"\n (click)=\"selectRow(row)\"\n [ngClass]=\"getRowBackgroundColor(i)\"></tr>\n </ng-container>\n } @else {\n <ng-container>\n <tr\n mat-header-row\n *matHeaderRowDef=\"columnsToDisplayWithExpand\"></tr>\n <tr\n mat-row\n *matRowDef=\"\n let row;\n columns: columnsToDisplayWithExpand;\n let i = dataIndex\n \"\n [id]=\"i\"\n class=\"element-row\"\n [class.expanded-row]=\"expandedElement === row\"\n [ngClass]=\"getRowBackgroundColor(i)\"></tr>\n <tr\n mat-row\n *matRowDef=\"\n let row;\n columns: ['expandedDetail'];\n let i = dataIndex\n \"\n [id]=\"i\"\n [ngClass]=\"getRowBackgroundColor(i)\"\n [ngStyle]=\"{\n display: expandedElement === row ? 'contents' : 'none',\n }\"\n class=\"detail-row\"></tr>\n </ng-container>\n }\n\n <!-- Row shown when there is no matching data. -->\n <tr class=\"mat-row no-data-row\" *matNoDataRow>\n <td class=\"mat-cell\" [attr.colspan]=\"displayedColumnsProperty.length\">\n <div class=\"no-data-found\">\n <mat-icon class=\"no-data-icon\">\n {{ dataSource.data.length > 0 ? 'search_off' : 'inbox' }}\n </mat-icon>\n <p class=\"no-data-text\">\n {{\n dataSource.data.length > 0\n ? ('messages.modifyFilter' | translate | capitalize)\n : noTableDataMessage\n }}\n </p>\n </div>\n </td>\n </tr>\n </table>\n } @else {\n <div class=\"loading-container\">\n <mat-progress-spinner\n class=\"mx-auto\"\n [diameter]=\"32\"\n color=\"primary\"\n mode=\"indeterminate\" />\n </div>\n }\n @if (showPaginator) {\n <div class=\"table-paginator\">\n <div class=\"table-paginator__size\">\n <span class=\"table-paginator__size-label\">\n {{ 'table.rowsPerPage' | translate | capitalize }}\n </span>\n <ud-menu\n [items]=\"pageSizeMenuItems\"\n triggerVariant=\"stroked\"\n triggerIcon=\"keyboard_arrow_down\"\n [triggerLabel]=\"pageSizeLabel\"\n [ariaLabel]=\"'table.rowsPerPage' | translate | capitalize\"\n xPosition=\"after\"\n yPosition=\"above\"\n [stopPropagation]=\"false\"\n (itemSelected)=\"onPageSizeSelected($event)\" />\n </div>\n <!-- Drives paging and dataSource.paginator; hidden, the controls below render it. -->\n <mat-paginator\n #pager\n [length]=\"totalElements ?? dataSource.data.length\"\n [pageSize]=\"initialPageSize\"\n [pageSizeOptions]=\"paginationSizeOptions\"\n (page)=\"onPageChange($event)\" />\n <span class=\"table-paginator__range\">\n {{ pager._intl.getRangeLabel(pager.pageIndex, pager.pageSize, pager.length) }}\n </span>\n <div class=\"table-paginator__nav\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"first_page\"\n [ariaLabel]=\"pager._intl.firstPageLabel\"\n [disabled]=\"!pager.hasPreviousPage()\"\n (buttonClick)=\"pager.firstPage()\" />\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"chevron_left\"\n [ariaLabel]=\"pager._intl.previousPageLabel\"\n [disabled]=\"!pager.hasPreviousPage()\"\n (buttonClick)=\"pager.previousPage()\" />\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"chevron_right\"\n [ariaLabel]=\"pager._intl.nextPageLabel\"\n [disabled]=\"!pager.hasNextPage()\"\n (buttonClick)=\"pager.nextPage()\" />\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n icon=\"last_page\"\n [ariaLabel]=\"pager._intl.lastPageLabel\"\n [disabled]=\"!pager.hasNextPage()\"\n (buttonClick)=\"pager.lastPage()\" />\n </div>\n </div>\n }\n </mat-card-content>\n </mat-card>\n</div>\n", styles: [":host{--eu-navy: #1b2535;--eu-navy-soft: #253347;--eu-navy-dim: rgba(27, 37, 53, .08);--eu-navy-mid: rgba(27, 37, 53, .18);--eu-surface: #ffffff;--eu-bg: #f4f5f7;--eu-border: #e2e5ea;--eu-border-mid: #c9cdd6;--eu-text: #1b2535;--eu-muted: #6b7585;--eu-danger: var(--danger, #e53935);--eu-radius: 10px;--eu-radius-sm: 6px;--eu-shadow: 0 2px 12px rgba(27, 37, 53, .06), 0 1px 4px rgba(27, 37, 53, .04);--eu-shadow-btn: 0 4px 14px rgba(27, 37, 53, .22);font-family:Sora,system-ui,sans-serif;position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}input:-webkit-autofill,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-box-shadow:0 0 0 30px #fafafa inset!important;background-color:#fafafa!important}p{font:20px Roboto,Helvetica Neue,sans-serif}.bg-accent{background-color:var(--accent-color)}.table-div .separate-filters{display:flex;flex-direction:column}.table-div .separate-filters .filter-dropdown{width:fit-content}.table-div .separate-filters .filters{display:flex;flex-direction:row;gap:8px;margin:0 24px 1rem}.table-div .separate-filters .filters .filter mat-icon{margin-right:0!important}.table-div mat-card.table-card{border-radius:10px!important;overflow:hidden;box-shadow:0 2px 12px #373f4c1a!important;background:#fff!important}.table-div mat-card.table-card mat-card-header.table-header{padding:14px 16px 14px 12px;background:var(--accent-lightest-color);border-bottom:1px solid var(--accent-color);min-height:65px}.table-div mat-card.table-card mat-card-header.table-header ::ng-deep .mat-mdc-card-header-text{display:none}.table-div mat-card.table-card mat-card-header.table-header .table-header-icon{color:var(--primary-color);font-size:20px;width:20px;height:20px}.table-div mat-card.table-card mat-card-header.table-header .table-title{margin-bottom:0;font-size:.9375rem;font-weight:600;letter-spacing:.01em;color:#373f4c}.table-div mat-card.table-card mat-card-content{padding:0}.table-div mat-card.table-card mat-card-content .no-data-found{display:flex;flex-direction:column;justify-content:center;align-items:center;height:140px;gap:8px;background:#fff}.table-div mat-card.table-card mat-card-content .no-data-found .no-data-icon{font-size:40px;width:40px;height:40px;color:var(--accent-darker-color);opacity:.7}.table-div mat-card.table-card mat-card-content .no-data-found .no-data-text{font-size:.875rem;color:#373f4c;margin:0}.table-div mat-card.table-card mat-card-content .loading-container{display:flex;justify-content:center;align-items:center;padding:32px;background:#fff}.table-div mat-card.table-card mat-card-content .table-paginator{display:flex;align-items:center;justify-content:flex-end;gap:16px;border-radius:0 0 10px 10px;background-color:#dde3ec;border-top:1px solid #c8c8d4}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__size{display:flex;align-items:center;gap:8px}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__size-label{font-family:Sora,system-ui,sans-serif;font-size:.8125rem;color:#6b7585;white-space:nowrap}.table-div mat-card.table-card mat-card-content .table-paginator mat-paginator{display:none}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__range{font-family:Sora,system-ui,sans-serif;font-size:.8125rem;font-variant-numeric:tabular-nums;color:#6b7585;white-space:nowrap}.table-div mat-card.table-card mat-card-content .table-paginator .table-paginator__nav{display:flex;align-items:center;gap:2px;padding:8px 12px 8px 0}.table-div .action-buttons-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.table-div tr td,.table-div tr th{border-bottom:1px solid var(--accent-color);color:#373f4c;padding:10px 8px}.table-div tr th{background-color:#dde3ec;font-weight:600;font-size:.9rem;letter-spacing:.05em}.table-div tr th:first-of-type,.table-div tr td:first-of-type{padding-left:20px}.table-div tr th:last-of-type,.table-div tr td:last-of-type{padding-right:20px}table{width:100%}.mat-mdc-form-field{font-size:14px}.mat-mdc-form-field ::ng-deep .mat-mdc-text-field-wrapper{max-height:45px;padding-left:4px}.mat-mdc-form-field ::ng-deep .mat-mdc-text-field-wrapper [class^=mdc-notched-outline__]{border:none;border-bottom:1px solid #929293;border-radius:0}.mat-mdc-form-field ::ng-deep .mat-mdc-text-field-wrapper [class^=mdc-notched-outline__]:first-of-type{display:none}.mat-mdc-icon-button.mat-mdc-button-base{padding:10px}.spacer{flex:1 1 auto}.link{color:#459fff;font-weight:600;cursor:pointer}.email-cell{display:inline-flex;align-items:center;gap:6px}.email-cell .email-icon{font-size:15px;width:15px;height:15px;opacity:.4;flex-shrink:0}.email-copy{display:inline-flex;align-items:center;height:1em;opacity:0;transition:opacity .12s ease}tr:hover .email-copy,.email-copy:focus-within,.email-copy.is-copied{opacity:1}@media (hover: none){.email-copy{opacity:1}}@media (prefers-reduced-motion: reduce){.email-copy{transition:none}}.filter{font-size:100%;border-top:.84375em solid rgba(0,0,0,0)}tr.detail-row{height:0}tr.no-data-row td{border-bottom:none;padding:0}.element-row td{border-bottom-width:0}.element-detail{overflow:hidden;display:flex}.element-detail>img{max-height:100%}.element-symbol{font-weight:700;font-size:40px;line-height:normal}.element-description{padding:16px}.element-description-attribution{opacity:.5}.pills{display:flex;flex-direction:column;gap:16px;margin:8px 2px}::ng-deep .ud-actions-menu{border-radius:10px!important;box-shadow:0 4px 20px #1b25351a,0 1px 4px #1b25350f!important;border:1px solid rgba(27,37,53,.08);overflow:hidden;min-width:200px!important}::ng-deep .ud-actions-menu .mat-mdc-menu-content{padding:4px!important}::ng-deep .ud-actions-menu .ud-menu-divider{height:1px;margin:4px 8px;background:#1b253514}::ng-deep .ud-actions-menu .ud-menu-item{display:flex;align-items:center;gap:0;height:auto;min-height:40px;padding:0 12px 0 0!important;border-radius:7px;margin:1px 0;position:relative;overflow:hidden;transition:background .15s ease}::ng-deep .ud-actions-menu .ud-menu-item .mat-mdc-menu-item-text{display:flex;align-items:center}::ng-deep .ud-actions-menu .ud-menu-item:before{content:\"\";position:absolute;left:0;top:6px;bottom:6px;width:3px;border-radius:0 2px 2px 0;background:#1b2535;transform:scaleY(0);transform-origin:center;transition:transform .18s cubic-bezier(.4,0,.2,1)}::ng-deep .ud-actions-menu .ud-menu-item:hover:not([disabled]):before{transform:scaleY(1)}::ng-deep .ud-actions-menu .ud-menu-item:hover:not([disabled]){background:#1b25350d!important}::ng-deep .ud-actions-menu .ud-menu-item[disabled]{opacity:1}::ng-deep .ud-actions-menu .ud-menu-item[disabled] .ud-menu-item__icon-wrap,::ng-deep .ud-actions-menu .ud-menu-item[disabled] .ud-menu-item__label{opacity:.38}::ng-deep .ud-actions-menu .ud-menu-item--no-icon{padding-left:12px!important}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__icon-wrap{display:flex;align-items:center;justify-content:center;width:40px;flex-shrink:0;align-self:stretch;max-height:40px}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__icon-wrap mat-icon{font-size:17px;width:17px;height:17px;margin:0;color:#6b7585;transition:color .15s ease}::ng-deep .ud-actions-menu .ud-menu-item:hover:not([disabled]) .ud-menu-item__icon-wrap mat-icon{color:#1b2535}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__text{display:flex;flex-direction:column;padding:8px 0;min-width:0}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__label{font-family:Sora,system-ui,sans-serif;font-size:.875rem;font-weight:500;line-height:1.25rem;color:#1b2535;letter-spacing:.01em;white-space:nowrap}::ng-deep .ud-actions-menu .ud-menu-item .ud-menu-item__description{font-family:Sora,system-ui,sans-serif;font-size:.75rem;line-height:1rem;color:#6b7585;white-space:normal}::ng-deep .ud-actions-menu .ud-menu-item--danger .ud-menu-item__label,::ng-deep .ud-actions-menu .ud-menu-item--danger .ud-menu-item__icon-wrap mat-icon,::ng-deep .ud-actions-menu .ud-menu-item--danger:hover:not([disabled]) .ud-menu-item__icon-wrap mat-icon{color:#e53935}::ng-deep .ud-actions-menu .ud-menu-item--danger:before{background:#e53935}::ng-deep .ud-actions-menu .ud-menu-item .mdc-list-item__primary-text{display:none!important}.filter--active{position:relative}.filter--active:after{content:\"\";position:absolute;left:0;right:0;bottom:-5px;height:2px;border-radius:2px;background:#459fff;pointer-events:none}.table-controls{display:flex;align-items:flex-start;gap:12px}.table-controls .separate-filters{flex:1 1 auto;min-width:0}.column-picker{flex:0 0 auto;margin:.84375em 24px 0 auto}.column-picker--active ::ng-deep .ud-btn.ud-btn--stroked{background:#459fff17!important;border-color:#459fff8c!important;color:#1b2535!important;font-weight:600!important}.column-picker--active ::ng-deep .ud-btn.ud-btn--stroked:hover:not(:disabled){background:#459fff24!important;border-color:#459fffbf!important;color:#1b2535!important}.hidden-columns{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px;padding:6px 24px 10px;font-family:var(--ud-field-font);font-size:.8125rem;color:#6b7585}.hidden-columns__label{font-family:JetBrains Mono,ui-monospace,monospace;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#1b2535}.hidden-columns__names{min-width:0}.hidden-columns__show{padding:0 2px;border:0;background:none;color:#459fff;font:inherit;font-weight:500;cursor:pointer}.hidden-columns__show:hover{text-decoration:underline}.hidden-columns__show:focus-visible{outline:2px solid #459fff;outline-offset:3px;border-radius:3px}.filters-clear{align-self:flex-start;margin-top:.84375em;padding:0 2px;border:0;background:none;color:#6b7585;font-family:var(--ud-field-font);font-size:.8125rem;font-weight:500;line-height:34px;cursor:pointer;white-space:nowrap;transition:color .15s ease}.filters-clear:hover,.filters-clear:focus-visible{color:#459fff}.filters-clear__count{margin-left:5px;font-family:JetBrains Mono,ui-monospace,monospace;font-weight:600;color:#1b2535}.filters-clear:focus-visible{outline:2px solid #459fff;outline-offset:3px;border-radius:3px}@media (prefers-reduced-motion: reduce){.filters-clear{transition:none}}.filter-button-trigger--active{background-color:#459fff17!important;border-color:#459fff8c!important;color:#1b2535!important;font-weight:600!important}.filter-button-trigger--active ::ng-deep .ud-btn__label{display:contents}.filter-button-trigger--active ::ng-deep .ud-btn__icon--right{order:1}.filter-button-trigger--active .filter-clear-icon{order:2;font-size:15px!important;width:15px!important;height:15px!important;line-height:15px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;border-radius:50%;transition:background .15s ease}.filter-button-trigger--active .filter-clear-icon:hover{background:#1b25351f}td.editable-cell .cell-display-wrapper{display:flex;align-items:center;gap:6px;min-height:32px}td.editable-cell .cell-display-wrapper .cell-edit-icon{opacity:0;transform:scale(.72) translateY(1px);transition:opacity .16s ease,transform .18s cubic-bezier(.34,1.4,.64,1);flex-shrink:0;width:30px!important;height:30px!important;line-height:30px!important;padding:4px!important;border-radius:6px!important;background:transparent;border:1px solid transparent;display:flex!important;align-items:center!important;justify-content:center!important}td.editable-cell .cell-display-wrapper .cell-edit-icon:hover{background:rgba(var(--primary-color-rgb, 63, 81, 181),.08)!important;border-color:rgba(var(--primary-color-rgb, 63, 81, 181),.22)!important}td.editable-cell .cell-display-wrapper .cell-edit-icon ::ng-deep .mat-mdc-button-persistent-ripple,td.editable-cell .cell-display-wrapper .cell-edit-icon ::ng-deep .mat-ripple{border-radius:6px}td.editable-cell .cell-display-wrapper .cell-edit-icon ::ng-deep .mat-mdc-button-touch-target{width:30px!important;height:30px!important}td.editable-cell .cell-display-wrapper .cell-edit-icon mat-icon{font-size:14px!important;width:14px!important;height:14px!important;color:var(--primary-color);line-height:14px;display:flex!important;align-items:center;justify-content:center}td.editable-cell .cell-display-wrapper .cell-edit-icon.cell-edit-icon--visible{opacity:1;transform:scale(1) translateY(0)}td.editable-cell .cell-edit-wrapper{display:flex;align-items:center;gap:4px;animation:cell-edit-enter .18s cubic-bezier(.22,1,.36,1) both}td.editable-cell .cell-edit-wrapper ud-multi-select,td.editable-cell .cell-edit-wrapper ud-text-input{flex:1;min-width:0}td.editable-cell .cell-edit-wrapper .cell-edit-actions{display:flex;flex-direction:row;gap:3px;flex-shrink:0}@keyframes cell-edit-enter{0%{opacity:0;transform:translateY(-3px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}::ng-deep .custom-dropdown{min-width:280px!important;max-width:650px!important;width:auto!important;max-height:none!important;overflow:visible!important;border-radius:10px!important;box-shadow:0 4px 20px #1b25351a,0 1px 4px #1b25350f!important}::ng-deep .custom-dropdown .mat-mdc-menu-content{padding:14px;width:100%;box-sizing:border-box}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content{box-sizing:border-box}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .boolean-content{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:200px;padding:4px 0}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .boolean-content .boolean-label{font-family:Sora,system-ui,sans-serif;font-size:.875rem;font-weight:500;color:#1b2535}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .date-content{width:320px}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .date-content ud-date-range-input{display:block;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .string-content{display:flex;gap:1rem}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content mat-form-field{width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content mat-form-field .mat-mdc-form-field{font-size:14px}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content mat-form-field input{width:100%;box-sizing:border-box}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content{display:flex;flex-direction:column;gap:12px;width:280px}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content .dropdown-label{font-family:inherit;font-size:.8125rem;font-weight:500;color:#1b2535}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content ud-button-toggle{display:block;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content.multi-select-content ud-multi-select{display:block;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .number-content{display:flex;flex-direction:column;gap:8px;width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .number-content ud-multi-select{width:100%}::ng-deep .custom-dropdown .mat-mdc-menu-content .dropdown-content .number-content .number-range-row{display:flex;gap:8px;width:100%}\n"], dependencies: [{ kind: "component", type: MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "pipe", type: ToObservablePipe, name: "toObservable" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "directive", type: MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay", "udTooltipFollowPointer"] }, { kind: "directive", type: MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "component", type: CheckboxComponent, selector: "ud-checkbox", inputs: ["controlName", "size", "label", "labelPosition", "ariaLabel", "indeterminate", "checked", "disabled"], outputs: ["onChange"] }, { kind: "component", type: MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: UdMenuComponent, selector: "ud-menu", inputs: ["items", "triggerVariant", "triggerIcon", "triggerLabel", "triggerColor", "triggerSize", "customTrigger", "ariaLabel", "disabled", "loading", "xPosition", "yPosition", "stopPropagation", "panelClass"], outputs: ["itemSelected", "opened", "closed"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: MatCardContent, selector: "mat-card-content" }, { kind: "component", type: MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "pipe", type: PluralizePipe, name: "pluralize" }, { kind: "component", type: ToggleComponent, selector: "ud-toggle", inputs: ["controlName", "size", "label", "labelPosition", "ariaLabel"], outputs: ["onChange"] }, { kind: "component", type: DateRangeInputComponent, selector: "ud-date-range-input", inputs: ["startControlName", "endControlName", "label", "icon", "iconFontSet", "startPlaceholder", "endPlaceholder", "min", "max", "disabled", "hint", "startAt", "startView"] }, { kind: "component", type: TextInputComponent, selector: "ud-text-input", inputs: ["controlName", "label", "placeholder", "type", "icon", "iconFontSet", "loading", "step", "min", "max", "disabled", "hint", "size", "clearable"] }, { kind: "component", type: MultiSelectComponent, selector: "ud-multi-select", inputs: ["controlName", "label", "placeholder", "icon", "iconFontSet", "options", "multiple", "maxChipsVisible", "moreText", "size", "loading", "disabled", "clearable", "hint"] }, { kind: "component", type: UdButtonComponent, selector: "ud-button", inputs: ["variant", "color", "size", "type", "icon", "iconPosition", "iconFontSet", "loading", "disabled", "ariaLabel", "fullWidth"], outputs: ["buttonClick"] }, { kind: "component", type: PillComponent, selector: "ud-pill", inputs: ["text", "type", "variant", "showDot", "value", "options", "disabled"], outputs: ["optionSelected"] }, { kind: "component", type: UdButtonToggleComponent, selector: "ud-button-toggle", inputs: ["options", "size", "disabled"] }], animations: [
|
|
3897
3915
|
trigger('detailExpand', [
|
|
3898
3916
|
state('collapsed, void', style({ height: '0px', minHeight: '0' })),
|
|
3899
3917
|
state('expanded', style({ height: '*' })),
|
|
@@ -4448,7 +4466,7 @@ function minIso(a, b) {
|
|
|
4448
4466
|
return a <= b ? a : b;
|
|
4449
4467
|
}
|
|
4450
4468
|
|
|
4451
|
-
const numeric = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
|
|
4469
|
+
const numeric$1 = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
|
|
4452
4470
|
/** Greedy interval packing. Half-open, so a bar starting the day another ends shares its lane. */
|
|
4453
4471
|
function assignLanes(bars) {
|
|
4454
4472
|
const sorted = [...bars].sort((a, b) => a.startDate.localeCompare(b.startDate) ||
|
|
@@ -4489,7 +4507,7 @@ function buildRows(rooms, dormName, collapsed) {
|
|
|
4489
4507
|
list.push(room);
|
|
4490
4508
|
byFloor.set(room.floorLevel, list);
|
|
4491
4509
|
}
|
|
4492
|
-
for (const floorLevel of [...byFloor.keys()].sort(numeric)) {
|
|
4510
|
+
for (const floorLevel of [...byFloor.keys()].sort(numeric$1)) {
|
|
4493
4511
|
const floorRooms = byFloor.get(floorLevel);
|
|
4494
4512
|
const floorKey = `${dormKey}/floor:${floorLevel}`;
|
|
4495
4513
|
rows.push({
|
|
@@ -4508,7 +4526,7 @@ function buildRows(rooms, dormName, collapsed) {
|
|
|
4508
4526
|
list.push(room);
|
|
4509
4527
|
byType.set(room.type, list);
|
|
4510
4528
|
}
|
|
4511
|
-
for (const type of [...byType.keys()].sort(numeric)) {
|
|
4529
|
+
for (const type of [...byType.keys()].sort(numeric$1)) {
|
|
4512
4530
|
const typeRooms = byType.get(type);
|
|
4513
4531
|
const typeKey = `${floorKey}/type:${type}`;
|
|
4514
4532
|
rows.push({
|
|
@@ -4521,7 +4539,7 @@ function buildRows(rooms, dormName, collapsed) {
|
|
|
4521
4539
|
if (collapsed.has(typeKey)) {
|
|
4522
4540
|
continue;
|
|
4523
4541
|
}
|
|
4524
|
-
for (const room of [...typeRooms].sort((a, b) => numeric(a.number, b.number) || a.roomId.localeCompare(b.roomId))) {
|
|
4542
|
+
for (const room of [...typeRooms].sort((a, b) => numeric$1(a.number, b.number) || a.roomId.localeCompare(b.roomId))) {
|
|
4525
4543
|
const bars = assignLanes(room.bars);
|
|
4526
4544
|
const used = bars.reduce((max, b) => Math.max(max, b.lane + 1), 0);
|
|
4527
4545
|
// A room with spare beds gets one extra empty lane to create a stay
|
|
@@ -4755,21 +4773,195 @@ function overbooksRoom(room, bookingId, start, end) {
|
|
|
4755
4773
|
room.capacity);
|
|
4756
4774
|
}
|
|
4757
4775
|
|
|
4758
|
-
|
|
4776
|
+
/**
|
|
4777
|
+
* Stands in for an open-ended bar's end everywhere a date is compared, so the
|
|
4778
|
+
* packing, overlap and geometry code never needs a null branch. Never emitted:
|
|
4779
|
+
* the component turns it back into null on the way out.
|
|
4780
|
+
*/
|
|
4781
|
+
const OPEN_END = '9999-12-31';
|
|
4782
|
+
function endOf(bar) {
|
|
4783
|
+
return bar.endDate ?? OPEN_END;
|
|
4784
|
+
}
|
|
4785
|
+
/** Greedy interval packing. Half-open, so a bar starting the day another ends shares its slot. */
|
|
4786
|
+
function packBars(bars) {
|
|
4787
|
+
const sorted = [...bars].sort((a, b) => a.startDate.localeCompare(b.startDate) || a.id.localeCompare(b.id));
|
|
4788
|
+
const slotEnds = [];
|
|
4789
|
+
return sorted.map(bar => {
|
|
4790
|
+
let slot = slotEnds.findIndex(end => end <= bar.startDate);
|
|
4791
|
+
if (slot === -1) {
|
|
4792
|
+
slot = slotEnds.length;
|
|
4793
|
+
slotEnds.push(endOf(bar));
|
|
4794
|
+
}
|
|
4795
|
+
else {
|
|
4796
|
+
slotEnds[slot] = endOf(bar);
|
|
4797
|
+
}
|
|
4798
|
+
return { bar, slot };
|
|
4799
|
+
});
|
|
4800
|
+
}
|
|
4801
|
+
function laneCount(node) {
|
|
4802
|
+
let count = node.lanes.length;
|
|
4803
|
+
for (const child of node.children.values()) {
|
|
4804
|
+
count += laneCount(child);
|
|
4805
|
+
}
|
|
4806
|
+
return count;
|
|
4807
|
+
}
|
|
4808
|
+
/**
|
|
4809
|
+
* Lanes under their group headers (outer groups first), groups in the order
|
|
4810
|
+
* they first appear and lanes in input order. Collapsed groups hide everything
|
|
4811
|
+
* below them.
|
|
4812
|
+
*/
|
|
4813
|
+
function buildTimelineRows(lanes, collapsed) {
|
|
4814
|
+
const root = {
|
|
4815
|
+
key: '',
|
|
4816
|
+
label: '',
|
|
4817
|
+
children: new Map(),
|
|
4818
|
+
lanes: [],
|
|
4819
|
+
};
|
|
4820
|
+
for (const lane of lanes) {
|
|
4821
|
+
let node = root;
|
|
4822
|
+
for (const g of [
|
|
4823
|
+
...(lane.parentGroups ?? []),
|
|
4824
|
+
{ id: lane.groupId, label: lane.groupLabel },
|
|
4825
|
+
]) {
|
|
4826
|
+
let child = node.children.get(g.id);
|
|
4827
|
+
if (!child) {
|
|
4828
|
+
child = {
|
|
4829
|
+
key: node.key ? `${node.key}/${g.id}` : g.id,
|
|
4830
|
+
label: g.label,
|
|
4831
|
+
children: new Map(),
|
|
4832
|
+
lanes: [],
|
|
4833
|
+
};
|
|
4834
|
+
node.children.set(g.id, child);
|
|
4835
|
+
}
|
|
4836
|
+
node = child;
|
|
4837
|
+
}
|
|
4838
|
+
node.lanes.push(lane);
|
|
4839
|
+
}
|
|
4840
|
+
const rows = [];
|
|
4841
|
+
const walk = (node, depth) => {
|
|
4842
|
+
for (const child of node.children.values()) {
|
|
4843
|
+
rows.push({
|
|
4844
|
+
kind: 'group',
|
|
4845
|
+
key: child.key,
|
|
4846
|
+
depth,
|
|
4847
|
+
label: child.label,
|
|
4848
|
+
laneCount: laneCount(child),
|
|
4849
|
+
});
|
|
4850
|
+
if (!collapsed.has(child.key)) {
|
|
4851
|
+
walk(child, depth + 1);
|
|
4852
|
+
}
|
|
4853
|
+
}
|
|
4854
|
+
for (const lane of node.lanes) {
|
|
4855
|
+
const bars = packBars(lane.bars);
|
|
4856
|
+
const used = bars.reduce((max, b) => Math.max(max, b.slot + 1), 0);
|
|
4857
|
+
// A lane with spare capacity gets one extra empty slot to create in; an
|
|
4858
|
+
// empty lane already has its one slot.
|
|
4859
|
+
const freeSlot = used > 0 && (lane.capacity ?? 1) > used ? used : null;
|
|
4860
|
+
rows.push({
|
|
4861
|
+
kind: 'lane',
|
|
4862
|
+
key: `lane:${lane.id}`,
|
|
4863
|
+
lane,
|
|
4864
|
+
slots: freeSlot === null ? used : used + 1,
|
|
4865
|
+
freeSlot,
|
|
4866
|
+
bars,
|
|
4867
|
+
});
|
|
4868
|
+
}
|
|
4869
|
+
};
|
|
4870
|
+
walk(root, 0);
|
|
4871
|
+
return rows;
|
|
4872
|
+
}
|
|
4873
|
+
function positionTimelineRows(rows, laneHeight) {
|
|
4874
|
+
let top = 0;
|
|
4875
|
+
return rows.map(row => {
|
|
4876
|
+
const slots = row.kind === 'group' ? 0 : Math.max(1, row.slots);
|
|
4877
|
+
const height = row.kind === 'group'
|
|
4878
|
+
? GROUP_ROW_HEIGHT
|
|
4879
|
+
: 8 + slots * laneHeight + (slots - 1) * 4;
|
|
4880
|
+
const positioned = { row, top, height };
|
|
4881
|
+
top += height;
|
|
4882
|
+
return positioned;
|
|
4883
|
+
});
|
|
4884
|
+
}
|
|
4885
|
+
/** Bars whose days include `date`. */
|
|
4886
|
+
function takenOnLane(lane, date) {
|
|
4887
|
+
return lane.bars.filter(b => b.startDate <= date && date < endOf(b)).length;
|
|
4888
|
+
}
|
|
4889
|
+
/**
|
|
4890
|
+
* The nearest neighbouring bar's boundary on the given edge: the limit a drag
|
|
4891
|
+
* on that edge must not cross. Same slot only, unless `allSlots`.
|
|
4892
|
+
*/
|
|
4893
|
+
function neighborBound(laneBars, barId, edge, allSlots = false) {
|
|
4894
|
+
const mine = laneBars.find(lb => lb.bar.id === barId);
|
|
4895
|
+
if (!mine) {
|
|
4896
|
+
return null;
|
|
4897
|
+
}
|
|
4898
|
+
const others = laneBars.filter(lb => lb.bar.id !== barId && (allSlots || lb.slot === mine.slot));
|
|
4899
|
+
if (edge === 'start') {
|
|
4900
|
+
const before = others.filter(lb => endOf(lb.bar) <= mine.bar.startDate);
|
|
4901
|
+
if (before.length === 0) {
|
|
4902
|
+
return null;
|
|
4903
|
+
}
|
|
4904
|
+
return endOf(before.reduce((a, b) => (endOf(a.bar) > endOf(b.bar) ? a : b)).bar);
|
|
4905
|
+
}
|
|
4906
|
+
const after = others.filter(lb => lb.bar.startDate >= endOf(mine.bar));
|
|
4907
|
+
if (after.length === 0) {
|
|
4908
|
+
return null;
|
|
4909
|
+
}
|
|
4910
|
+
return after.reduce((a, b) => (a.bar.startDate < b.bar.startDate ? a : b)).bar
|
|
4911
|
+
.startDate;
|
|
4912
|
+
}
|
|
4913
|
+
/** Whether `[start, end)` overlaps any OTHER bar in the lane (half-open). */
|
|
4914
|
+
function overlapsLane(lane, barId, start, end) {
|
|
4915
|
+
return lane.bars.some(b => b.id !== barId && start < endOf(b) && b.startDate < end);
|
|
4916
|
+
}
|
|
4917
|
+
/**
|
|
4918
|
+
* The slot a bar over `[start, end)` would sit in: the first one clear of
|
|
4919
|
+
* other bars, or just below the last when none is. `ignoreBarId` ('' for a
|
|
4920
|
+
* new bar) is not an obstacle.
|
|
4921
|
+
*/
|
|
4922
|
+
function slotForSpan(row, start, end, ignoreBarId) {
|
|
4923
|
+
for (let slot = 0; slot < row.slots; slot++) {
|
|
4924
|
+
const taken = row.bars.some(lb => lb.slot === slot &&
|
|
4925
|
+
lb.bar.id !== ignoreBarId &&
|
|
4926
|
+
start < endOf(lb.bar) &&
|
|
4927
|
+
lb.bar.startDate < end);
|
|
4928
|
+
if (!taken) {
|
|
4929
|
+
return slot;
|
|
4930
|
+
}
|
|
4931
|
+
}
|
|
4932
|
+
return row.slots;
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
const TIMELINE_GRID_HEADER_HEIGHT = 52;
|
|
4759
4936
|
/** How far the pointer must move before a mousedown on a bar's body becomes a whole-bar drag rather than a click. */
|
|
4760
4937
|
const MOVE_DRAG_THRESHOLD_PX = 4;
|
|
4938
|
+
const TIMELINE_GRID_DEFAULT_LEGEND = [
|
|
4939
|
+
{ state: 'tentative', labelKey: 'occupancyGrid.states.tentative' },
|
|
4940
|
+
{ state: 'reserved', labelKey: 'occupancyGrid.states.reserved' },
|
|
4941
|
+
{ state: 'in_room', labelKey: 'occupancyGrid.states.in_room' },
|
|
4942
|
+
{ state: 'history', labelKey: 'occupancyGrid.states.history' },
|
|
4943
|
+
];
|
|
4944
|
+
/** An open-ended bar's internal end back to the public null. */
|
|
4945
|
+
function publicEnd(end) {
|
|
4946
|
+
return end === OPEN_END ? null : end;
|
|
4947
|
+
}
|
|
4761
4948
|
/**
|
|
4762
|
-
*
|
|
4763
|
-
*
|
|
4764
|
-
*
|
|
4765
|
-
*
|
|
4766
|
-
*
|
|
4767
|
-
*
|
|
4768
|
-
*
|
|
4769
|
-
*
|
|
4949
|
+
* Lanes as rows, days as columns, one bar per occupant (UC-11, made generic in
|
|
4950
|
+
* UC-42; `ud-occupancy-grid` is the rooms-and-stays wrapper around it). It
|
|
4951
|
+
* never writes anywhere — `lanes` is the only source of truth and this
|
|
4952
|
+
* component never mutates it — but it is not inert: a bar's edge can be
|
|
4953
|
+
* dragged (or, on a focused bar, Shift + arrow-keyed) to propose a new date,
|
|
4954
|
+
* reported via `barResize`; a bar's body can be dragged to a new date, a
|
|
4955
|
+
* different lane, or both, reported via `barMove`; an empty stretch can be
|
|
4956
|
+
* dragged across to propose a new bar (`barCreate`); something dragged in from
|
|
4957
|
+
* outside the grid can be dropped on a lane (`laneDrop`). Every gesture works
|
|
4958
|
+
* the same way: report what happened, apply nothing.
|
|
4770
4959
|
*
|
|
4771
|
-
*
|
|
4772
|
-
*
|
|
4960
|
+
* Inside a lane, overlapping bars are packed into slots (sub-rows); a lane
|
|
4961
|
+
* with spare `capacity` also offers one empty slot to create in.
|
|
4962
|
+
*
|
|
4963
|
+
* Owns its own row virtualization: rows have different heights (one slot per
|
|
4964
|
+
* overlapping bar), which the CDK's stable fixed-size strategy cannot do, and
|
|
4773
4965
|
* the autosize strategy is still experimental. Rows are positioned from a
|
|
4774
4966
|
* prefix sum of heights and only those intersecting the viewport are rendered.
|
|
4775
4967
|
*
|
|
@@ -4777,11 +4969,9 @@ const MOVE_DRAG_THRESHOLD_PX = 4;
|
|
|
4777
4969
|
* local-date.ts; `new Date(string)` is never used, so a column can never be
|
|
4778
4970
|
* off by one west of Greenwich.
|
|
4779
4971
|
*/
|
|
4780
|
-
class
|
|
4972
|
+
class TimelineGridComponent {
|
|
4781
4973
|
translate;
|
|
4782
|
-
|
|
4783
|
-
rooms = input([]);
|
|
4784
|
-
dormName = input('');
|
|
4974
|
+
lanes = input([]);
|
|
4785
4975
|
from = input.required();
|
|
4786
4976
|
to = input.required();
|
|
4787
4977
|
today = input(null);
|
|
@@ -4792,150 +4982,126 @@ class OccupancyGridComponent {
|
|
|
4792
4982
|
/** Days the ‹ / › nav buttons and the ArrowLeft/ArrowRight keys shift the window by. */
|
|
4793
4983
|
navStepDays = input(7);
|
|
4794
4984
|
/**
|
|
4795
|
-
* When true, a resize or
|
|
4796
|
-
*
|
|
4797
|
-
*
|
|
4798
|
-
*
|
|
4799
|
-
*
|
|
4800
|
-
*
|
|
4801
|
-
* so a drag simply cannot propose a second one over it: a resize clamps
|
|
4802
|
-
* at the nearest other bar in the room (not just its own lane), and a
|
|
4803
|
-
* move drag ignores any candidate date/room that would overlap, sticking
|
|
4804
|
-
* to the last placement that did not.
|
|
4985
|
+
* When true, a resize, move or create drag is never allowed to leave two
|
|
4986
|
+
* bars in the same lane overlapping in time: a resize clamps at the nearest
|
|
4987
|
+
* other bar in the lane (not just its own slot), and a move or create
|
|
4988
|
+
* ignores any candidate that would overlap, sticking to the last one that
|
|
4989
|
+
* did not. Off by default, because a lane with capacity legitimately holds
|
|
4990
|
+
* overlapping bars in different slots.
|
|
4805
4991
|
*/
|
|
4806
4992
|
preventOverlap = input(false);
|
|
4993
|
+
/** Translation keys for the corner header, the empty state and a lane's aria label (`{{lane}}` and `{{room}}` get the lane label). */
|
|
4994
|
+
cornerLabelKey = input('timelineGrid.lanes');
|
|
4995
|
+
emptyLabelKey = input('timelineGrid.empty');
|
|
4996
|
+
createCellLabelKey = input('timelineGrid.createCell');
|
|
4997
|
+
/** The bar states listed in the legend, and the label each one shows in a bar's tooltip. */
|
|
4998
|
+
legend = input(TIMELINE_GRID_DEFAULT_LEGEND);
|
|
4807
4999
|
/**
|
|
4808
|
-
*
|
|
4809
|
-
*
|
|
4810
|
-
*
|
|
4811
|
-
*
|
|
5000
|
+
* What is being dragged in from outside the grid, or null when nothing is.
|
|
5001
|
+
* The consumer sets it on its own `dragstart` and clears it on `dragend`:
|
|
5002
|
+
* an HTML5 drag's data cannot be read until the drop, so this is how the
|
|
5003
|
+
* grid knows, during the drag, which lanes can take it. Lanes only accept a
|
|
5004
|
+
* drop while it is set.
|
|
4812
5005
|
*/
|
|
4813
|
-
|
|
5006
|
+
dragPayload = input(null);
|
|
5007
|
+
/** Whether a lane can take `dragPayload`. Lanes that cannot are greyed out while the drag is live. Null = every lane can. */
|
|
5008
|
+
canDrop = input(null);
|
|
4814
5009
|
barClick = output();
|
|
4815
5010
|
closureClick = output();
|
|
4816
|
-
|
|
4817
|
-
|
|
5011
|
+
/** The lane's own header cell was clicked. */
|
|
5012
|
+
laneClick = output();
|
|
5013
|
+
/** An empty day cell was clicked: the lane and the date under the pointer. */
|
|
4818
5014
|
cellClick = output();
|
|
4819
5015
|
reachedEnd = output();
|
|
4820
5016
|
/**
|
|
4821
5017
|
* The nav buttons or an arrow key asked to move the window. The component
|
|
4822
|
-
* does not own `from`/`to
|
|
4823
|
-
*
|
|
4824
|
-
*
|
|
4825
|
-
* that wants the shift applied does
|
|
4826
|
-
* `from = addDays(from, delta); to = addDays(to, delta)`.
|
|
5018
|
+
* does not own `from`/`to`, so it reports the signed day delta — negative
|
|
5019
|
+
* for earlier, positive for later. A consumer that wants the shift applied
|
|
5020
|
+
* does `from = addDays(from, delta); to = addDays(to, delta)`.
|
|
4827
5021
|
*/
|
|
4828
5022
|
windowShift = output();
|
|
4829
|
-
/**
|
|
4830
|
-
* A bar's edge was dragged, or Shift + arrow-keyed, to a new date. See
|
|
4831
|
-
* `OccupancyBarResize` — this reports the proposal; it never applies it.
|
|
4832
|
-
*/
|
|
4833
5023
|
barResize = output();
|
|
4834
|
-
/**
|
|
4835
|
-
* A bar's body was dragged to new dates, a different room, or both. See
|
|
4836
|
-
* `OccupancyBarMove` — this reports the proposal; it never applies it.
|
|
4837
|
-
*/
|
|
4838
5024
|
barMove = output();
|
|
4839
|
-
/**
|
|
4840
|
-
* A new booking's dates were proposed by dragging across empty lane cells,
|
|
4841
|
-
* or by the keyboard-driven create flow (see `onLaneKeydown`). See
|
|
4842
|
-
* `OccupancyBarCreate` — this reports the proposal; it never creates a bar
|
|
4843
|
-
* itself.
|
|
4844
|
-
*/
|
|
4845
5025
|
barCreate = output();
|
|
4846
|
-
|
|
5026
|
+
laneDrop = output();
|
|
5027
|
+
headerHeight = TIMELINE_GRID_HEADER_HEIGHT;
|
|
4847
5028
|
scroller = viewChild.required('scroller');
|
|
4848
5029
|
collapsed = signal(new Set());
|
|
4849
5030
|
scrollTop = signal(0);
|
|
4850
5031
|
viewportHeight = signal(600);
|
|
4851
5032
|
lastEndEmittedFor = null;
|
|
4852
5033
|
/**
|
|
4853
|
-
* The in-progress drag, if any
|
|
4854
|
-
*
|
|
4855
|
-
*
|
|
4856
|
-
*
|
|
5034
|
+
* The in-progress edge drag, if any. `geometryOf` and `barTitle` read the
|
|
5035
|
+
* preview dates for whichever bar this names so the drag renders live;
|
|
5036
|
+
* nothing about `lanes` changes, since the component does not own it. An
|
|
5037
|
+
* open-ended bar's end is `OPEN_END` here and null again on the way out.
|
|
4857
5038
|
*/
|
|
4858
5039
|
resize = signal(null);
|
|
5040
|
+
/** Read-only view of `resize`, for a wrapper that surfaces it (ud-occupancy-grid). */
|
|
5041
|
+
activeResize = this.resize.asReadonly();
|
|
4859
5042
|
dragMoveListener = null;
|
|
4860
5043
|
dragUpListener = null;
|
|
4861
5044
|
dragKeyListener = null;
|
|
4862
5045
|
/**
|
|
4863
|
-
* The in-progress whole-bar drag, if any
|
|
4864
|
-
*
|
|
4865
|
-
*
|
|
4866
|
-
*
|
|
4867
|
-
* move. `targetRoom` starts as `fromRoom` and is re-resolved on every
|
|
4868
|
-
* mousemove from whatever `.occ__row--room` is actually under the
|
|
4869
|
-
* pointer — see `roomUnderPoint` — so dragging vertically onto another
|
|
4870
|
-
* room's row is exactly the gesture `roomUnderPoint` is built to read.
|
|
5046
|
+
* The in-progress whole-bar drag, if any. `dragging` only flips true once
|
|
5047
|
+
* the pointer clears a small threshold, so a plain click still reaches
|
|
5048
|
+
* `barClick`. `targetLane` is re-resolved on every mousemove from whatever
|
|
5049
|
+
* lane row is under the pointer — see `laneUnderPoint`.
|
|
4871
5050
|
*/
|
|
4872
5051
|
move = signal(null);
|
|
4873
5052
|
moveMoveListener = null;
|
|
4874
5053
|
moveUpListener = null;
|
|
4875
5054
|
moveKeyListener = null;
|
|
4876
5055
|
/**
|
|
4877
|
-
* The in-progress drag-to-create, if any
|
|
4878
|
-
*
|
|
4879
|
-
*
|
|
4880
|
-
*
|
|
4881
|
-
*
|
|
4882
|
-
* click-vs-drag threshold `move` uses, while a keyboard create is live the
|
|
4883
|
-
* instant Enter starts it (there is no "release" to wait for) and commits
|
|
4884
|
-
* on a second Enter.
|
|
5056
|
+
* The in-progress drag-to-create, if any. `startDate` is the anchor the
|
|
5057
|
+
* drag began from (mouse) or the focused cell it started from (keyboard). A
|
|
5058
|
+
* mouse create only commits on mouseup once it clears the click-vs-drag
|
|
5059
|
+
* threshold; a keyboard create is live the instant Enter starts it and
|
|
5060
|
+
* commits on a second Enter.
|
|
4885
5061
|
*/
|
|
4886
5062
|
create = signal(null);
|
|
4887
5063
|
createMoveListener = null;
|
|
4888
5064
|
createUpListener = null;
|
|
4889
5065
|
createKeyListener = null;
|
|
4890
5066
|
/**
|
|
4891
|
-
* The keyboard-focused empty cell, if any
|
|
4892
|
-
*
|
|
4893
|
-
*
|
|
4894
|
-
* so the highlighted cell does not vanish out from under an active
|
|
4895
|
-
* gesture.
|
|
5067
|
+
* The keyboard-focused empty cell, if any. Cleared on blur unless a
|
|
5068
|
+
* keyboard create is in progress, so the highlighted cell does not vanish
|
|
5069
|
+
* out from under an active gesture.
|
|
4896
5070
|
*/
|
|
4897
5071
|
laneFocus = signal(null);
|
|
4898
5072
|
/**
|
|
4899
|
-
* The day column under the pointer anywhere on the canvas
|
|
4900
|
-
*
|
|
4901
|
-
*
|
|
4902
|
-
* the pointer reads as a crosshair: which room, which night.
|
|
5073
|
+
* The day column under the pointer anywhere on the canvas, as an index into
|
|
5074
|
+
* days(), or null. Drawn as a full-height band, so together with the row
|
|
5075
|
+
* wash the pointer reads as a crosshair: which lane, which day.
|
|
4903
5076
|
*/
|
|
4904
5077
|
hoverDay = signal(null);
|
|
4905
5078
|
/**
|
|
4906
|
-
* The empty cell the mouse is
|
|
4907
|
-
* equivalent of `laneFocus
|
|
4908
|
-
*
|
|
4909
|
-
* whenever any gesture (create, resize, or a whole-bar move) is live, so
|
|
4910
|
-
* it never competes with that gesture's own preview.
|
|
5079
|
+
* The empty cell the mouse (or an external drag) is over, if any — the
|
|
5080
|
+
* pointer equivalent of `laneFocus`. Cleared whenever a create, resize or
|
|
5081
|
+
* move is live, so it never competes with that gesture's own preview.
|
|
4911
5082
|
*/
|
|
4912
5083
|
laneHover = signal(null);
|
|
5084
|
+
/** The lane an external drag is currently over. */
|
|
5085
|
+
dropTarget = signal(null);
|
|
4913
5086
|
/**
|
|
4914
5087
|
* The pointer is over a bar or closure. Suppresses the focus-cursor
|
|
4915
5088
|
* fallback in `laneCursorGeometry`, so a stale keyboard cell does not show
|
|
4916
|
-
* up elsewhere while the pointer is on a
|
|
5089
|
+
* up elsewhere while the pointer is on a bar.
|
|
4917
5090
|
*/
|
|
4918
5091
|
pointerOnBar = signal(false);
|
|
4919
|
-
// A drag that ends with the pointer over the lane
|
|
4920
|
-
// handle, or not back over the bar's own body) still makes the browser
|
|
5092
|
+
// A drag that ends with the pointer over the lane still makes the browser
|
|
4921
5093
|
// synthesize a `click` right after the `mouseup`, targeted at the nearest
|
|
4922
|
-
// common ancestor of the mousedown and mouseup elements
|
|
4923
|
-
//
|
|
4924
|
-
//
|
|
4925
|
-
//
|
|
4926
|
-
//
|
|
4927
|
-
// lands; the timer is a safety net for the rare case where no click
|
|
4928
|
-
// follows at all (e.g. the pointer left the window), so a stray flag never
|
|
4929
|
-
// survives to swallow some later, unrelated click.
|
|
5094
|
+
// common ancestor of the mousedown and mouseup elements. Left alone that
|
|
5095
|
+
// click would surface as a spurious cellClick or barClick the instant a
|
|
5096
|
+
// resize or move finishes. This flag is armed when a drag ends and consumed
|
|
5097
|
+
// by the one click that follows; the timer is a safety net for when no
|
|
5098
|
+
// click follows at all, so a stray flag never swallows a later click.
|
|
4930
5099
|
suppressNextClick = false;
|
|
4931
5100
|
suppressNextClickTimer = null;
|
|
4932
|
-
constructor(translate,
|
|
5101
|
+
constructor(translate, destroyRef) {
|
|
4933
5102
|
this.translate = translate;
|
|
4934
|
-
|
|
4935
|
-
//
|
|
4936
|
-
// consumer navigates away mid-drag) must not leave window-level
|
|
4937
|
-
// listeners behind — they would keep firing against a destroyed
|
|
4938
|
-
// component's signals otherwise, and never get cleaned up any other way.
|
|
5103
|
+
// A drag still active when the component is torn down must not leave
|
|
5104
|
+
// window-level listeners behind.
|
|
4939
5105
|
destroyRef.onDestroy(() => {
|
|
4940
5106
|
this.removeDragListeners();
|
|
4941
5107
|
this.removeMoveListeners();
|
|
@@ -4949,8 +5115,8 @@ class OccupancyGridComponent {
|
|
|
4949
5115
|
? Math.max(0, daysBetween(this.from(), this.to()))
|
|
4950
5116
|
: 0);
|
|
4951
5117
|
canvasWidth = computed(() => this.leftColumnWidth() + this.dayCount() * this.dayWidth());
|
|
4952
|
-
rows = computed(() =>
|
|
4953
|
-
positioned = computed(() =>
|
|
5118
|
+
rows = computed(() => buildTimelineRows(this.lanes(), this.collapsed()));
|
|
5119
|
+
positioned = computed(() => positionTimelineRows(this.rows(), this.laneHeight()));
|
|
4954
5120
|
bodyHeight = computed(() => totalHeight(this.positioned()));
|
|
4955
5121
|
visible = computed(() => {
|
|
4956
5122
|
const { first, last } = visibleRange(this.positioned(), this.scrollTop(), this.viewportHeight());
|
|
@@ -4971,23 +5137,18 @@ class OccupancyGridComponent {
|
|
|
4971
5137
|
}
|
|
4972
5138
|
return daysBetween(this.from(), today) * this.dayWidth();
|
|
4973
5139
|
});
|
|
4974
|
-
|
|
5140
|
+
lanesById = computed(() => {
|
|
4975
5141
|
const map = new Map();
|
|
4976
|
-
for (const
|
|
4977
|
-
map.set(
|
|
5142
|
+
for (const lane of this.lanes()) {
|
|
5143
|
+
map.set(lane.id, lane);
|
|
4978
5144
|
}
|
|
4979
5145
|
return map;
|
|
4980
5146
|
});
|
|
4981
5147
|
/**
|
|
4982
5148
|
* The floating copy of a bar being dragged by its body — null unless a
|
|
4983
5149
|
* move drag has cleared the click threshold. Positioned in canvas
|
|
4984
|
-
* coordinates
|
|
4985
|
-
*
|
|
4986
|
-
* in; `positioned()` already has every visible row's pixel `top`, so no
|
|
4987
|
-
* separate DOM lookup is needed to place it. Always drawn at lane 0 of the
|
|
4988
|
-
* target room — a simplification the consumer's own re-lane on save
|
|
4989
|
-
* supersedes anyway, same as the rest of this component's "report the
|
|
4990
|
-
* gesture, never own the data" contract.
|
|
5150
|
+
* coordinates because a move can target a lane other than the one the drag
|
|
5151
|
+
* started in; `positioned()` already has every visible row's pixel `top`.
|
|
4991
5152
|
*/
|
|
4992
5153
|
moveGhost = computed(() => {
|
|
4993
5154
|
const m = this.move();
|
|
@@ -4995,25 +5156,21 @@ class OccupancyGridComponent {
|
|
|
4995
5156
|
return null;
|
|
4996
5157
|
}
|
|
4997
5158
|
const geometry = barGeometry({ startDate: m.previewStartDate, endDate: m.previewEndDate }, this.from(), this.to(), this.dayWidth());
|
|
4998
|
-
const targetRow = this.
|
|
4999
|
-
p.row.room.roomId === m.targetRoom.roomId);
|
|
5159
|
+
const targetRow = this.laneRowOf(m.targetLane.id);
|
|
5000
5160
|
if (!geometry || !targetRow) {
|
|
5001
5161
|
return null;
|
|
5002
5162
|
}
|
|
5003
|
-
//
|
|
5004
|
-
//
|
|
5005
|
-
|
|
5006
|
-
const lane = laneForSpan(targetRow.row, m.previewStartDate, m.previewEndDate, m.bar.bookingId);
|
|
5163
|
+
// A span over another bar sits in a free slot, or just below the row,
|
|
5164
|
+
// instead of covering it. The moving bar itself is not an obstacle.
|
|
5165
|
+
const slot = slotForSpan(targetRow.row, m.previewStartDate, m.previewEndDate, m.bar.id);
|
|
5007
5166
|
return {
|
|
5008
5167
|
left: this.leftColumnWidth() + geometry.left + 1,
|
|
5009
|
-
top: this.headerHeight +
|
|
5010
|
-
targetRow.top +
|
|
5011
|
-
4 +
|
|
5012
|
-
lane * (this.laneHeight() + 4),
|
|
5168
|
+
top: this.headerHeight + targetRow.top + 4 + slot * (this.laneHeight() + 4),
|
|
5013
5169
|
width: geometry.width - 2,
|
|
5014
5170
|
height: this.laneHeight(),
|
|
5015
|
-
label: m.bar.
|
|
5171
|
+
label: m.bar.title,
|
|
5016
5172
|
state: m.bar.state,
|
|
5173
|
+
openEnded: m.bar.endDate === null,
|
|
5017
5174
|
};
|
|
5018
5175
|
});
|
|
5019
5176
|
/** The in-progress drag-to-create's preview span, once it clears the drag threshold (mouse) or as soon as it starts (keyboard). */
|
|
@@ -5022,17 +5179,15 @@ class OccupancyGridComponent {
|
|
|
5022
5179
|
if (!c || !c.dragging) {
|
|
5023
5180
|
return null;
|
|
5024
5181
|
}
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
: c.lane;
|
|
5031
|
-
return this.ghostGeometry(c.room, c.previewStart, c.previewEnd, lane);
|
|
5182
|
+
const row = this.laneRowOf(c.lane.id)?.row;
|
|
5183
|
+
const slot = row
|
|
5184
|
+
? slotForSpan(row, c.previewStart, c.previewEnd, '')
|
|
5185
|
+
: c.slot;
|
|
5186
|
+
return this.ghostGeometry(c.lane, c.previewStart, c.previewEnd, slot);
|
|
5032
5187
|
});
|
|
5033
5188
|
/**
|
|
5034
|
-
* The empty cell to outline — the
|
|
5035
|
-
*
|
|
5189
|
+
* The empty cell to outline — the pointer (or external drag) position if
|
|
5190
|
+
* there is one, otherwise the keyboard-focused cell — whenever no create
|
|
5036
5191
|
* gesture is overriding it with its own live preview.
|
|
5037
5192
|
*/
|
|
5038
5193
|
laneCursorGeometry = computed(() => {
|
|
@@ -5043,32 +5198,34 @@ class OccupancyGridComponent {
|
|
|
5043
5198
|
if (!f) {
|
|
5044
5199
|
return null;
|
|
5045
5200
|
}
|
|
5046
|
-
const
|
|
5047
|
-
if (!
|
|
5201
|
+
const lane = this.lanesById().get(f.laneId);
|
|
5202
|
+
if (!lane) {
|
|
5048
5203
|
return null;
|
|
5049
5204
|
}
|
|
5050
|
-
const
|
|
5051
|
-
return this.ghostGeometry(
|
|
5205
|
+
const slot = 'slot' in f ? f.slot : this.createSlot(lane);
|
|
5206
|
+
return this.ghostGeometry(lane, f.date, addDays(f.date, 1), slot);
|
|
5052
5207
|
});
|
|
5053
|
-
|
|
5054
|
-
|
|
5208
|
+
laneRowOf(laneId) {
|
|
5209
|
+
return this.positioned().find(p => p.row.kind === 'lane' && p.row.lane.id === laneId);
|
|
5210
|
+
}
|
|
5211
|
+
/** Canvas-coordinate box for a date span in a given lane's row; `slot` picks which of the row's slots it sits in. */
|
|
5212
|
+
ghostGeometry(lane, start, end, slot) {
|
|
5055
5213
|
const geometry = barGeometry({ startDate: start, endDate: end }, this.from(), this.to(), this.dayWidth());
|
|
5056
|
-
const targetRow = this.
|
|
5057
|
-
p.row.room.roomId === room.roomId);
|
|
5214
|
+
const targetRow = this.laneRowOf(lane.id);
|
|
5058
5215
|
if (!geometry || !targetRow) {
|
|
5059
5216
|
return null;
|
|
5060
5217
|
}
|
|
5061
5218
|
return {
|
|
5062
5219
|
left: this.leftColumnWidth() + geometry.left + 1,
|
|
5063
|
-
top: this.headerHeight + targetRow.top + 4 +
|
|
5220
|
+
top: this.headerHeight + targetRow.top + 4 + slot * (this.laneHeight() + 4),
|
|
5064
5221
|
width: geometry.width - 2,
|
|
5065
5222
|
height: this.laneHeight(),
|
|
5066
5223
|
};
|
|
5067
5224
|
}
|
|
5068
|
-
/** Where a keyboard create lands: the
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5225
|
+
/** Where a keyboard create lands: the lane's free slot when it has one, else slot 0. */
|
|
5226
|
+
createSlot(lane) {
|
|
5227
|
+
return (this.laneRowOf(lane.id)?.row?.freeSlot ??
|
|
5228
|
+
0);
|
|
5072
5229
|
}
|
|
5073
5230
|
monthLabels() {
|
|
5074
5231
|
const keys = [
|
|
@@ -5089,42 +5246,39 @@ class OccupancyGridComponent {
|
|
|
5089
5246
|
}
|
|
5090
5247
|
geometryOf(bar) {
|
|
5091
5248
|
const preview = this.previewDatesOf(bar);
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
: bar
|
|
5095
|
-
|
|
5249
|
+
return barGeometry({
|
|
5250
|
+
startDate: preview ? preview.start : bar.startDate,
|
|
5251
|
+
endDate: preview ? preview.end : endOf(bar),
|
|
5252
|
+
}, this.from(), this.to(), this.dayWidth());
|
|
5096
5253
|
}
|
|
5097
5254
|
/** The in-progress drag's proposed dates for this bar, or null if it is not the one being dragged. */
|
|
5098
5255
|
previewDatesOf(bar) {
|
|
5099
5256
|
const r = this.resize();
|
|
5100
|
-
if (!r || r.bar.
|
|
5257
|
+
if (!r || r.bar.id !== bar.id) {
|
|
5101
5258
|
return null;
|
|
5102
5259
|
}
|
|
5103
5260
|
return { start: r.previewStart, end: r.previewEnd };
|
|
5104
5261
|
}
|
|
5105
|
-
isResizing(
|
|
5106
|
-
return this.resize()?.bar.
|
|
5262
|
+
isResizing(barId) {
|
|
5263
|
+
return this.resize()?.bar.id === barId;
|
|
5107
5264
|
}
|
|
5108
|
-
/** True once a whole-bar drag on this
|
|
5109
|
-
isBeingMoved(
|
|
5265
|
+
/** True once a whole-bar drag on this bar has cleared the click threshold — see `move`. */
|
|
5266
|
+
isBeingMoved(barId) {
|
|
5110
5267
|
const m = this.move();
|
|
5111
|
-
return !!m && m.dragging && m.bar.
|
|
5268
|
+
return !!m && m.dragging && m.bar.id === barId;
|
|
5112
5269
|
}
|
|
5113
|
-
/** True while a whole-bar drag
|
|
5114
|
-
isMoveTarget(
|
|
5270
|
+
/** True while a whole-bar drag, or an accepted external drag, is hovering this lane. */
|
|
5271
|
+
isMoveTarget(laneId) {
|
|
5115
5272
|
const m = this.move();
|
|
5116
|
-
return !!m && m.dragging && m.
|
|
5273
|
+
return ((!!m && m.dragging && m.targetLane.id === laneId) ||
|
|
5274
|
+
(this.dragPayload() !== null && this.dropTarget() === laneId));
|
|
5117
5275
|
}
|
|
5118
5276
|
closureGeometryOf(closure) {
|
|
5119
|
-
return
|
|
5277
|
+
return barGeometry(closure, this.from(), this.to(), this.dayWidth());
|
|
5120
5278
|
}
|
|
5121
|
-
/**
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
* window did not include today; the first day shown is always loaded.
|
|
5125
|
-
*/
|
|
5126
|
-
takenOn(room) {
|
|
5127
|
-
return takenOn(room, this.from());
|
|
5279
|
+
/** Bars on the first day shown (UC-18), for lanes with a capacity; null hides the count. */
|
|
5280
|
+
takenOn(lane) {
|
|
5281
|
+
return lane.capacity === undefined ? null : takenOnLane(lane, this.from());
|
|
5128
5282
|
}
|
|
5129
5283
|
isCollapsed(key) {
|
|
5130
5284
|
return this.collapsed().has(key);
|
|
@@ -5142,13 +5296,16 @@ class OccupancyGridComponent {
|
|
|
5142
5296
|
barTitle(bar) {
|
|
5143
5297
|
const preview = this.previewDatesOf(bar);
|
|
5144
5298
|
const start = preview ? preview.start : bar.startDate;
|
|
5145
|
-
const end = preview ? preview.end : bar
|
|
5146
|
-
const
|
|
5147
|
-
|
|
5299
|
+
const end = publicEnd(preview ? preview.end : endOf(bar));
|
|
5300
|
+
const labelKey = this.legend().find(l => l.state === bar.state)?.labelKey ??
|
|
5301
|
+
`occupancyGrid.states.${bar.state}`;
|
|
5302
|
+
const state = this.translate.instant(labelKey);
|
|
5303
|
+
const until = end ?? this.translate.instant('timelineGrid.openEnded');
|
|
5304
|
+
return `${bar.title} · ${start} → ${until} · ${state}`;
|
|
5148
5305
|
}
|
|
5149
5306
|
closureTitle(closure) {
|
|
5150
5307
|
return (this.translate.instant('occupancyGrid.closedReason', {
|
|
5151
|
-
reason: closure.
|
|
5308
|
+
reason: closure.label,
|
|
5152
5309
|
}) + ` · ${closure.startDate} → ${closure.endDate}`);
|
|
5153
5310
|
}
|
|
5154
5311
|
onScroll() {
|
|
@@ -5164,7 +5321,7 @@ class OccupancyGridComponent {
|
|
|
5164
5321
|
trackRow(_, p) {
|
|
5165
5322
|
return p.row.key;
|
|
5166
5323
|
}
|
|
5167
|
-
|
|
5324
|
+
asLaneRow(row) {
|
|
5168
5325
|
return row;
|
|
5169
5326
|
}
|
|
5170
5327
|
/** ‹ / › nav buttons. Emits the signed day delta; see `windowShift`. */
|
|
@@ -5173,15 +5330,10 @@ class OccupancyGridComponent {
|
|
|
5173
5330
|
}
|
|
5174
5331
|
/**
|
|
5175
5332
|
* ArrowLeft/ArrowRight anywhere in the grid page the window, the same as
|
|
5176
|
-
* the nav buttons
|
|
5177
|
-
*
|
|
5178
|
-
* a bar, room cell or group header's own Enter handling is untouched.
|
|
5333
|
+
* the nav buttons. Shift+Arrow on a focused bar resizes it instead (bound on
|
|
5334
|
+
* the bar itself), so it is declined here.
|
|
5179
5335
|
*/
|
|
5180
5336
|
onGridKeydown(event) {
|
|
5181
|
-
// Shift+Arrow on a focused bar resizes it (onBarKeydownResize, bound on
|
|
5182
|
-
// the bar itself); this handler still sees the same bubbled keydown, so
|
|
5183
|
-
// it must decline plain-Arrow handling here or a resize would also page
|
|
5184
|
-
// the window on every keystroke.
|
|
5185
5337
|
if (event.shiftKey) {
|
|
5186
5338
|
return;
|
|
5187
5339
|
}
|
|
@@ -5195,43 +5347,42 @@ class OccupancyGridComponent {
|
|
|
5195
5347
|
}
|
|
5196
5348
|
}
|
|
5197
5349
|
/**
|
|
5198
|
-
* A click inside a
|
|
5199
|
-
*
|
|
5200
|
-
*
|
|
5350
|
+
* A click inside a lane that landed on neither a bar nor a closure (both
|
|
5351
|
+
* stop propagation before this fires) — the lane and the date under the
|
|
5352
|
+
* pointer.
|
|
5201
5353
|
*/
|
|
5202
|
-
onLaneClick(event,
|
|
5354
|
+
onLaneClick(event, lane) {
|
|
5203
5355
|
if (this.consumeSuppressNextClick()) {
|
|
5204
5356
|
return;
|
|
5205
5357
|
}
|
|
5206
5358
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
5207
5359
|
const date = dateAtOffset(event.clientX - rect.left, this.from(), this.dayWidth());
|
|
5208
|
-
this.cellClick.emit({
|
|
5360
|
+
this.cellClick.emit({ lane, date });
|
|
5209
5361
|
}
|
|
5210
|
-
/** The bar's own click handler routes through here so it shares the same
|
|
5211
|
-
onBarClick(bar,
|
|
5362
|
+
/** The bar's own click handler routes through here so it shares the same post-drag click guard as `onLaneClick`. */
|
|
5363
|
+
onBarClick(bar, lane) {
|
|
5212
5364
|
if (this.consumeSuppressNextClick()) {
|
|
5213
5365
|
return;
|
|
5214
5366
|
}
|
|
5215
|
-
this.barClick.emit({ bar,
|
|
5367
|
+
this.barClick.emit({ bar, lane });
|
|
5216
5368
|
}
|
|
5217
5369
|
// ─────────────────────────────────────────────────────── extend / shorten
|
|
5218
5370
|
/**
|
|
5219
|
-
* Mousedown on a bar's edge handle starts a drag. Listeners go on
|
|
5220
|
-
*
|
|
5221
|
-
*
|
|
5222
|
-
*
|
|
5223
|
-
* drawer) or on the lane underneath it (a `cellClick`).
|
|
5371
|
+
* Mousedown on a bar's edge handle starts a drag. Listeners go on `window`
|
|
5372
|
+
* because the pointer leaves an 8px handle the instant the drag starts;
|
|
5373
|
+
* `stopPropagation` keeps this from also reading as a click on the bar or
|
|
5374
|
+
* the lane underneath it.
|
|
5224
5375
|
*/
|
|
5225
|
-
startResize(event,
|
|
5376
|
+
startResize(event, lane, bar, edge, laneBars) {
|
|
5226
5377
|
event.stopPropagation();
|
|
5227
5378
|
event.preventDefault();
|
|
5228
|
-
const bound =
|
|
5379
|
+
const bound = neighborBound(laneBars, bar.id, edge, this.preventOverlap());
|
|
5229
5380
|
this.resize.set({
|
|
5230
|
-
|
|
5381
|
+
lane,
|
|
5231
5382
|
bar,
|
|
5232
5383
|
edge,
|
|
5233
5384
|
previewStart: bar.startDate,
|
|
5234
|
-
previewEnd: bar
|
|
5385
|
+
previewEnd: endOf(bar),
|
|
5235
5386
|
minBound: edge === 'start' ? bound : null,
|
|
5236
5387
|
maxBound: edge === 'end' ? bound : null,
|
|
5237
5388
|
});
|
|
@@ -5258,7 +5409,7 @@ class OccupancyGridComponent {
|
|
|
5258
5409
|
next = r.minBound;
|
|
5259
5410
|
}
|
|
5260
5411
|
if (next >= r.previewEnd) {
|
|
5261
|
-
next = addDays(r.previewEnd, -1); // never less than one
|
|
5412
|
+
next = addDays(r.previewEnd, -1); // never less than one day
|
|
5262
5413
|
}
|
|
5263
5414
|
this.resize.set({ ...r, previewStart: next });
|
|
5264
5415
|
}
|
|
@@ -5282,46 +5433,19 @@ class OccupancyGridComponent {
|
|
|
5282
5433
|
if (!r || !commit) {
|
|
5283
5434
|
return;
|
|
5284
5435
|
}
|
|
5285
|
-
if (r.previewStart === r.bar.startDate && r.previewEnd === r.bar
|
|
5286
|
-
return;
|
|
5287
|
-
}
|
|
5288
|
-
if (this.rejectIfOverbooked(r.room, r.bar.bookingId, r.previewStart, r.previewEnd)) {
|
|
5436
|
+
if (r.previewStart === r.bar.startDate && r.previewEnd === endOf(r.bar)) {
|
|
5289
5437
|
return;
|
|
5290
5438
|
}
|
|
5291
5439
|
this.barResize.emit({
|
|
5292
5440
|
bar: r.bar,
|
|
5293
|
-
|
|
5441
|
+
lane: r.lane,
|
|
5294
5442
|
edge: r.edge,
|
|
5295
5443
|
previousStartDate: r.bar.startDate,
|
|
5296
5444
|
previousEndDate: r.bar.endDate,
|
|
5297
5445
|
proposedStartDate: r.previewStart,
|
|
5298
|
-
proposedEndDate: r.previewEnd,
|
|
5446
|
+
proposedEndDate: publicEnd(r.previewEnd),
|
|
5299
5447
|
});
|
|
5300
5448
|
}
|
|
5301
|
-
/**
|
|
5302
|
-
* With `preventOverbooking`, a gesture that would put more stays in a room
|
|
5303
|
-
* than it has beds is dropped here, so the bar simply stays where it was,
|
|
5304
|
-
* with a snackbar saying why.
|
|
5305
|
-
*/
|
|
5306
|
-
rejectIfOverbooked(room, bookingId, start, end) {
|
|
5307
|
-
if (!this.preventOverbooking() ||
|
|
5308
|
-
!overbooksRoom(room, bookingId, start, end)) {
|
|
5309
|
-
return false;
|
|
5310
|
-
}
|
|
5311
|
-
this.snackBar.openFromComponent(CustomSnackbarComponent, {
|
|
5312
|
-
horizontalPosition: 'end',
|
|
5313
|
-
verticalPosition: 'top',
|
|
5314
|
-
panelClass: ['custom-snackbar-container'],
|
|
5315
|
-
data: {
|
|
5316
|
-
message: this.translate.instant('occupancyGrid.overbooked', {
|
|
5317
|
-
room: room.number,
|
|
5318
|
-
}),
|
|
5319
|
-
type: SnackbarType.WARNING,
|
|
5320
|
-
duration: 3000,
|
|
5321
|
-
},
|
|
5322
|
-
});
|
|
5323
|
-
return true;
|
|
5324
|
-
}
|
|
5325
5449
|
removeDragListeners() {
|
|
5326
5450
|
if (this.dragMoveListener) {
|
|
5327
5451
|
window.removeEventListener('mousemove', this.dragMoveListener);
|
|
@@ -5338,14 +5462,12 @@ class OccupancyGridComponent {
|
|
|
5338
5462
|
}
|
|
5339
5463
|
// ───────────────────────────────────────────────────────── move the bar
|
|
5340
5464
|
/**
|
|
5341
|
-
* Mousedown on a bar's
|
|
5342
|
-
* propagation
|
|
5343
|
-
*
|
|
5344
|
-
*
|
|
5345
|
-
* threshold. That is what lets a plain click still fall through to
|
|
5346
|
-
* `onBarClick` unchanged.
|
|
5465
|
+
* Mousedown on a bar's body (never the edge handles — those stop
|
|
5466
|
+
* propagation first) arms a possible whole-bar move, but nothing changes
|
|
5467
|
+
* until `onBarDragMove` sees the pointer clear a small threshold, so a plain
|
|
5468
|
+
* click still reaches `onBarClick`.
|
|
5347
5469
|
*/
|
|
5348
|
-
startBarMove(event,
|
|
5470
|
+
startBarMove(event, lane, bar) {
|
|
5349
5471
|
if (event.button !== 0) {
|
|
5350
5472
|
return;
|
|
5351
5473
|
}
|
|
@@ -5353,14 +5475,14 @@ class OccupancyGridComponent {
|
|
|
5353
5475
|
event.stopPropagation();
|
|
5354
5476
|
this.move.set({
|
|
5355
5477
|
bar,
|
|
5356
|
-
|
|
5478
|
+
fromLane: lane,
|
|
5357
5479
|
startClientX: event.clientX,
|
|
5358
5480
|
startClientY: event.clientY,
|
|
5359
5481
|
originalStartDate: bar.startDate,
|
|
5360
|
-
originalEndDate: bar
|
|
5482
|
+
originalEndDate: endOf(bar),
|
|
5361
5483
|
previewStartDate: bar.startDate,
|
|
5362
|
-
previewEndDate: bar
|
|
5363
|
-
|
|
5484
|
+
previewEndDate: endOf(bar),
|
|
5485
|
+
targetLane: lane,
|
|
5364
5486
|
dragging: false,
|
|
5365
5487
|
});
|
|
5366
5488
|
this.moveMoveListener = e => this.onBarDragMove(e);
|
|
@@ -5388,15 +5510,14 @@ class OccupancyGridComponent {
|
|
|
5388
5510
|
}
|
|
5389
5511
|
const dayDelta = Math.round(dx / this.dayWidth());
|
|
5390
5512
|
const previewStartDate = addDays(m.originalStartDate, dayDelta);
|
|
5391
|
-
const previewEndDate =
|
|
5392
|
-
|
|
5513
|
+
const previewEndDate = m.originalEndDate === OPEN_END
|
|
5514
|
+
? OPEN_END
|
|
5515
|
+
: addDays(m.originalEndDate, dayDelta);
|
|
5516
|
+
const targetLane = this.laneUnderPoint(event.clientX, event.clientY) ?? m.targetLane;
|
|
5393
5517
|
if (this.preventOverlap() &&
|
|
5394
|
-
|
|
5395
|
-
//
|
|
5396
|
-
//
|
|
5397
|
-
// stays at the last placement that did not overlap (the bar's
|
|
5398
|
-
// original spot, the first time a move ever conflicts) instead of
|
|
5399
|
-
// jumping onto an invalid one and back.
|
|
5518
|
+
overlapsLane(targetLane, m.bar.id, previewStartDate, previewEndDate)) {
|
|
5519
|
+
// Reject just this candidate, not the whole drag: the ghost stays at
|
|
5520
|
+
// the last placement that did not overlap.
|
|
5400
5521
|
this.move.set({ ...m, dragging: true });
|
|
5401
5522
|
return;
|
|
5402
5523
|
}
|
|
@@ -5405,7 +5526,7 @@ class OccupancyGridComponent {
|
|
|
5405
5526
|
dragging: true,
|
|
5406
5527
|
previewStartDate,
|
|
5407
5528
|
previewEndDate,
|
|
5408
|
-
|
|
5529
|
+
targetLane,
|
|
5409
5530
|
});
|
|
5410
5531
|
}
|
|
5411
5532
|
/** Mouseup (commit) or Escape (cancel). Emits `barMove` only on commit with an actual change. */
|
|
@@ -5424,20 +5545,17 @@ class OccupancyGridComponent {
|
|
|
5424
5545
|
}
|
|
5425
5546
|
if (m.previewStartDate === m.originalStartDate &&
|
|
5426
5547
|
m.previewEndDate === m.originalEndDate &&
|
|
5427
|
-
m.
|
|
5428
|
-
return;
|
|
5429
|
-
}
|
|
5430
|
-
if (this.rejectIfOverbooked(m.targetRoom, m.bar.bookingId, m.previewStartDate, m.previewEndDate)) {
|
|
5548
|
+
m.targetLane.id === m.fromLane.id) {
|
|
5431
5549
|
return;
|
|
5432
5550
|
}
|
|
5433
5551
|
this.barMove.emit({
|
|
5434
5552
|
bar: m.bar,
|
|
5435
|
-
|
|
5436
|
-
|
|
5553
|
+
fromLane: m.fromLane,
|
|
5554
|
+
toLane: m.targetLane,
|
|
5437
5555
|
previousStartDate: m.originalStartDate,
|
|
5438
|
-
previousEndDate: m.originalEndDate,
|
|
5556
|
+
previousEndDate: publicEnd(m.originalEndDate),
|
|
5439
5557
|
proposedStartDate: m.previewStartDate,
|
|
5440
|
-
proposedEndDate: m.previewEndDate,
|
|
5558
|
+
proposedEndDate: publicEnd(m.previewEndDate),
|
|
5441
5559
|
});
|
|
5442
5560
|
}
|
|
5443
5561
|
removeMoveListeners() {
|
|
@@ -5456,22 +5574,21 @@ class OccupancyGridComponent {
|
|
|
5456
5574
|
}
|
|
5457
5575
|
// ─────────────────────────────────────────────── create over empty cells
|
|
5458
5576
|
/**
|
|
5459
|
-
* Mousedown on a lane's empty background arms a possible drag-to-create,
|
|
5460
|
-
*
|
|
5461
|
-
*
|
|
5462
|
-
* `endCreate` only emits once `dragging` has flipped true.
|
|
5577
|
+
* Mousedown on a lane's empty background arms a possible drag-to-create, on
|
|
5578
|
+
* the same click-vs-drag threshold as `startBarMove` — a plain click still
|
|
5579
|
+
* falls through to `onLaneClick`'s `cellClick`.
|
|
5463
5580
|
*/
|
|
5464
|
-
startCreate(event,
|
|
5581
|
+
startCreate(event, lane, slot = 0) {
|
|
5465
5582
|
if (event.button !== 0) {
|
|
5466
5583
|
return;
|
|
5467
5584
|
}
|
|
5468
5585
|
const startDate = this.clientXToDate(event.clientX);
|
|
5469
|
-
if (overlapsClosure(
|
|
5586
|
+
if (overlapsClosure(lane, startDate, addDays(startDate, 1))) {
|
|
5470
5587
|
return;
|
|
5471
5588
|
}
|
|
5472
5589
|
this.create.set({
|
|
5473
|
-
room,
|
|
5474
5590
|
lane,
|
|
5591
|
+
slot,
|
|
5475
5592
|
startDate,
|
|
5476
5593
|
startClientX: event.clientX,
|
|
5477
5594
|
previewStart: startDate,
|
|
@@ -5499,24 +5616,27 @@ class OccupancyGridComponent {
|
|
|
5499
5616
|
if (!c.dragging && Math.abs(dx) < MOVE_DRAG_THRESHOLD_PX) {
|
|
5500
5617
|
return;
|
|
5501
5618
|
}
|
|
5502
|
-
const date = clampToClosures(c.
|
|
5619
|
+
const date = clampToClosures(c.lane, c.startDate, this.clientXToDate(event.clientX));
|
|
5503
5620
|
let start = c.startDate;
|
|
5504
5621
|
let end = date;
|
|
5505
5622
|
if (end < start) {
|
|
5506
|
-
// Dragged backwards from the anchor: the anchor becomes the
|
|
5623
|
+
// Dragged backwards from the anchor: the anchor becomes the end.
|
|
5507
5624
|
start = date;
|
|
5508
5625
|
end = c.startDate;
|
|
5509
5626
|
}
|
|
5510
5627
|
if (end <= start) {
|
|
5511
|
-
end = addDays(start, 1); // never less than one
|
|
5628
|
+
end = addDays(start, 1); // never less than one day
|
|
5512
5629
|
}
|
|
5513
|
-
if (this.preventOverlap() &&
|
|
5514
|
-
// Reject just this update, same as a whole-bar move's overlap check —
|
|
5515
|
-
// the preview stays at the last span that did not overlap.
|
|
5630
|
+
if (this.preventOverlap() && overlapsLane(c.lane, '', start, end)) {
|
|
5516
5631
|
this.create.set({ ...c, dragging: true });
|
|
5517
5632
|
return;
|
|
5518
5633
|
}
|
|
5519
|
-
this.create.set({
|
|
5634
|
+
this.create.set({
|
|
5635
|
+
...c,
|
|
5636
|
+
dragging: true,
|
|
5637
|
+
previewStart: start,
|
|
5638
|
+
previewEnd: end,
|
|
5639
|
+
});
|
|
5520
5640
|
}
|
|
5521
5641
|
/** Mouseup (commit) or Escape (cancel), for both the mouse and keyboard paths. Emits `barCreate` only once a drag actually cleared the threshold (or a keyboard create was started) and is committed. */
|
|
5522
5642
|
endCreate(commit) {
|
|
@@ -5530,21 +5650,17 @@ class OccupancyGridComponent {
|
|
|
5530
5650
|
this.armSuppressNextClick();
|
|
5531
5651
|
}
|
|
5532
5652
|
if (c.viaKeyboard) {
|
|
5533
|
-
// Keep the cell focused where the gesture left off
|
|
5534
|
-
// user's position on the grid does not just disappear.
|
|
5653
|
+
// Keep the cell focused where the gesture left off.
|
|
5535
5654
|
this.laneFocus.set({
|
|
5536
|
-
|
|
5655
|
+
laneId: c.lane.id,
|
|
5537
5656
|
date: commit ? c.previewStart : c.startDate,
|
|
5538
5657
|
});
|
|
5539
5658
|
}
|
|
5540
5659
|
if (!c.dragging || !commit) {
|
|
5541
5660
|
return;
|
|
5542
5661
|
}
|
|
5543
|
-
if (this.rejectIfOverbooked(c.room, '', c.previewStart, c.previewEnd)) {
|
|
5544
|
-
return;
|
|
5545
|
-
}
|
|
5546
5662
|
this.barCreate.emit({
|
|
5547
|
-
|
|
5663
|
+
lane: c.lane,
|
|
5548
5664
|
proposedStartDate: c.previewStart,
|
|
5549
5665
|
proposedEndDate: c.previewEnd,
|
|
5550
5666
|
});
|
|
@@ -5564,37 +5680,32 @@ class OccupancyGridComponent {
|
|
|
5564
5680
|
this.createKeyListener = null;
|
|
5565
5681
|
}
|
|
5566
5682
|
/**
|
|
5567
|
-
* Focus lands on an empty lane
|
|
5568
|
-
*
|
|
5569
|
-
*
|
|
5570
|
-
* create is in progress on this lane, so refocusing mid-gesture cannot
|
|
5571
|
-
* reset it.
|
|
5683
|
+
* Focus lands on an empty lane — arm a keyboard cursor at today (or the
|
|
5684
|
+
* window's first day) unless this lane already has one. Left alone while a
|
|
5685
|
+
* keyboard create is in progress, so refocusing mid-gesture cannot reset it.
|
|
5572
5686
|
*/
|
|
5573
|
-
onLaneFocus(
|
|
5687
|
+
onLaneFocus(lane) {
|
|
5574
5688
|
if (this.create()?.viaKeyboard) {
|
|
5575
5689
|
return;
|
|
5576
5690
|
}
|
|
5577
5691
|
const existing = this.laneFocus();
|
|
5578
|
-
const date = existing && existing.
|
|
5692
|
+
const date = existing && existing.laneId === lane.id
|
|
5579
5693
|
? existing.date
|
|
5580
5694
|
: this.defaultCursorDate();
|
|
5581
|
-
this.laneFocus.set({
|
|
5695
|
+
this.laneFocus.set({ laneId: lane.id, date });
|
|
5582
5696
|
}
|
|
5583
5697
|
/**
|
|
5584
5698
|
* The pointer moved over a lane's empty background — update the hover
|
|
5585
|
-
* cursor to the date under it. Ignored while a
|
|
5586
|
-
*
|
|
5587
|
-
* and when the event bubbled up from a bar or closure rather than
|
|
5588
|
-
* landing on the background itself, so hovering an existing booking does
|
|
5589
|
-
* not also outline the empty-cell cursor underneath it.
|
|
5699
|
+
* cursor to the date under it. Ignored while a gesture is live, and when
|
|
5700
|
+
* the event bubbled up from a bar or closure rather than the background.
|
|
5590
5701
|
*/
|
|
5591
|
-
onLaneMouseMove(event,
|
|
5702
|
+
onLaneMouseMove(event, lane, slot = 0) {
|
|
5592
5703
|
if (this.create() || this.resize() || this.move()?.dragging) {
|
|
5593
5704
|
this.laneHover.set(null);
|
|
5594
5705
|
return;
|
|
5595
5706
|
}
|
|
5596
5707
|
if (event.target !== event.currentTarget) {
|
|
5597
|
-
// The free
|
|
5708
|
+
// The free slot handles its own moves; its bubbled event is not a bar.
|
|
5598
5709
|
if (!event.target.classList.contains('occ__lane-free')) {
|
|
5599
5710
|
this.laneHover.set(null);
|
|
5600
5711
|
this.pointerOnBar.set(true);
|
|
@@ -5605,12 +5716,12 @@ class OccupancyGridComponent {
|
|
|
5605
5716
|
const date = this.clientXToDate(event.clientX);
|
|
5606
5717
|
const cur = this.laneHover();
|
|
5607
5718
|
if (cur &&
|
|
5608
|
-
cur.
|
|
5719
|
+
cur.laneId === lane.id &&
|
|
5609
5720
|
cur.date === date &&
|
|
5610
|
-
cur.
|
|
5721
|
+
cur.slot === slot) {
|
|
5611
5722
|
return;
|
|
5612
5723
|
}
|
|
5613
|
-
this.laneHover.set({
|
|
5724
|
+
this.laneHover.set({ laneId: lane.id, date, slot });
|
|
5614
5725
|
}
|
|
5615
5726
|
onCanvasMouseMove(event) {
|
|
5616
5727
|
const el = this.scroller().nativeElement;
|
|
@@ -5624,10 +5735,10 @@ class OccupancyGridComponent {
|
|
|
5624
5735
|
this.hoverDay.set(next);
|
|
5625
5736
|
}
|
|
5626
5737
|
}
|
|
5627
|
-
onLaneMouseLeave(
|
|
5738
|
+
onLaneMouseLeave(lane) {
|
|
5628
5739
|
this.pointerOnBar.set(false);
|
|
5629
5740
|
const cur = this.laneHover();
|
|
5630
|
-
if (cur && cur.
|
|
5741
|
+
if (cur && cur.laneId === lane.id) {
|
|
5631
5742
|
this.laneHover.set(null);
|
|
5632
5743
|
}
|
|
5633
5744
|
}
|
|
@@ -5647,14 +5758,12 @@ class OccupancyGridComponent {
|
|
|
5647
5758
|
/**
|
|
5648
5759
|
* Keyboard path for drag-to-create: with no create in progress, plain
|
|
5649
5760
|
* ArrowLeft/ArrowRight move the focused cell one day and Enter/Space marks
|
|
5650
|
-
* it as the start
|
|
5651
|
-
*
|
|
5652
|
-
* `onBarKeydownResize`'s departure-only convention) and a second Enter
|
|
5653
|
-
* commits, Escape cancels.
|
|
5761
|
+
* it as the start; once that create is live, the same arrow keys move the
|
|
5762
|
+
* end date, a second Enter commits and Escape cancels.
|
|
5654
5763
|
*/
|
|
5655
|
-
onLaneKeydown(event,
|
|
5764
|
+
onLaneKeydown(event, lane) {
|
|
5656
5765
|
const c = this.create();
|
|
5657
|
-
if (c && c.viaKeyboard && c.
|
|
5766
|
+
if (c && c.viaKeyboard && c.lane.id === lane.id) {
|
|
5658
5767
|
if (event.key === 'Escape') {
|
|
5659
5768
|
event.preventDefault();
|
|
5660
5769
|
this.endCreate(false);
|
|
@@ -5670,8 +5779,9 @@ class OccupancyGridComponent {
|
|
|
5670
5779
|
if (next <= c.previewStart) {
|
|
5671
5780
|
next = addDays(c.previewStart, 1);
|
|
5672
5781
|
}
|
|
5673
|
-
if (overlapsClosure(
|
|
5674
|
-
(this.preventOverlap() &&
|
|
5782
|
+
if (overlapsClosure(lane, c.previewStart, next) ||
|
|
5783
|
+
(this.preventOverlap() &&
|
|
5784
|
+
overlapsLane(lane, '', c.previewStart, next))) {
|
|
5675
5785
|
return;
|
|
5676
5786
|
}
|
|
5677
5787
|
this.create.set({ ...c, previewEnd: next });
|
|
@@ -5679,7 +5789,7 @@ class OccupancyGridComponent {
|
|
|
5679
5789
|
return;
|
|
5680
5790
|
}
|
|
5681
5791
|
const cur = this.laneFocus();
|
|
5682
|
-
if (!cur || cur.
|
|
5792
|
+
if (!cur || cur.laneId !== lane.id) {
|
|
5683
5793
|
return;
|
|
5684
5794
|
}
|
|
5685
5795
|
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
@@ -5692,16 +5802,16 @@ class OccupancyGridComponent {
|
|
|
5692
5802
|
else if (next >= this.to()) {
|
|
5693
5803
|
next = addDays(this.to(), -1);
|
|
5694
5804
|
}
|
|
5695
|
-
this.laneFocus.set({
|
|
5805
|
+
this.laneFocus.set({ laneId: lane.id, date: next });
|
|
5696
5806
|
}
|
|
5697
5807
|
else if (event.key === 'Enter' || event.key === ' ') {
|
|
5698
5808
|
event.preventDefault();
|
|
5699
|
-
if (overlapsClosure(
|
|
5809
|
+
if (overlapsClosure(lane, cur.date, addDays(cur.date, 1))) {
|
|
5700
5810
|
return;
|
|
5701
5811
|
}
|
|
5702
5812
|
this.create.set({
|
|
5703
|
-
|
|
5704
|
-
|
|
5813
|
+
lane,
|
|
5814
|
+
slot: this.createSlot(lane),
|
|
5705
5815
|
startDate: cur.date,
|
|
5706
5816
|
startClientX: 0,
|
|
5707
5817
|
previewStart: cur.date,
|
|
@@ -5711,12 +5821,64 @@ class OccupancyGridComponent {
|
|
|
5711
5821
|
});
|
|
5712
5822
|
}
|
|
5713
5823
|
}
|
|
5714
|
-
|
|
5715
|
-
|
|
5824
|
+
// ─────────────────────────────────────────── drop from outside the grid
|
|
5825
|
+
canDropOn(lane) {
|
|
5826
|
+
const payload = this.dragPayload();
|
|
5827
|
+
if (payload === null) {
|
|
5828
|
+
return false;
|
|
5829
|
+
}
|
|
5830
|
+
const can = this.canDrop();
|
|
5831
|
+
return !can || can(lane, payload);
|
|
5832
|
+
}
|
|
5833
|
+
isDropDisabled(lane) {
|
|
5834
|
+
return this.dragPayload() !== null && !this.canDropOn(lane);
|
|
5835
|
+
}
|
|
5836
|
+
/** Accepting the dragover (preventDefault) is what lets the browser drop here at all. */
|
|
5837
|
+
onLaneDragOver(event, lane) {
|
|
5838
|
+
if (!this.canDropOn(lane)) {
|
|
5839
|
+
return;
|
|
5840
|
+
}
|
|
5841
|
+
event.preventDefault();
|
|
5842
|
+
const date = this.clientXToDate(event.clientX);
|
|
5843
|
+
const cur = this.laneHover();
|
|
5844
|
+
if (this.dropTarget() !== lane.id) {
|
|
5845
|
+
this.dropTarget.set(lane.id);
|
|
5846
|
+
}
|
|
5847
|
+
if (!cur || cur.laneId !== lane.id || cur.date !== date) {
|
|
5848
|
+
this.laneHover.set({
|
|
5849
|
+
laneId: lane.id,
|
|
5850
|
+
date,
|
|
5851
|
+
slot: this.createSlot(lane),
|
|
5852
|
+
});
|
|
5853
|
+
}
|
|
5854
|
+
}
|
|
5855
|
+
onLaneDragLeave(event, lane) {
|
|
5856
|
+
const into = event.relatedTarget;
|
|
5857
|
+
if (into && event.currentTarget.contains(into)) {
|
|
5858
|
+
return;
|
|
5859
|
+
}
|
|
5860
|
+
if (this.dropTarget() === lane.id) {
|
|
5861
|
+
this.dropTarget.set(null);
|
|
5862
|
+
this.laneHover.set(null);
|
|
5863
|
+
}
|
|
5864
|
+
}
|
|
5865
|
+
onLaneDrop(event, lane) {
|
|
5866
|
+
if (!this.canDropOn(lane)) {
|
|
5867
|
+
return;
|
|
5868
|
+
}
|
|
5869
|
+
event.preventDefault();
|
|
5870
|
+
const date = this.clientXToDate(event.clientX);
|
|
5871
|
+
const payload = this.dragPayload();
|
|
5872
|
+
this.dropTarget.set(null);
|
|
5873
|
+
this.laneHover.set(null);
|
|
5874
|
+
this.laneDrop.emit({ lane, date, payload });
|
|
5875
|
+
}
|
|
5876
|
+
/** Whatever lane row (if any) is actually rendered under this point — see `.occ__row--room`'s `data-lane-id`. */
|
|
5877
|
+
laneUnderPoint(clientX, clientY) {
|
|
5716
5878
|
const el = document.elementFromPoint(clientX, clientY);
|
|
5717
5879
|
const rowEl = el?.closest('.occ__row--room');
|
|
5718
|
-
const
|
|
5719
|
-
return
|
|
5880
|
+
const laneId = rowEl?.dataset['laneId'];
|
|
5881
|
+
return laneId ? (this.lanesById().get(laneId) ?? null) : null;
|
|
5720
5882
|
}
|
|
5721
5883
|
armSuppressNextClick() {
|
|
5722
5884
|
this.suppressNextClick = true;
|
|
@@ -5746,22 +5908,21 @@ class OccupancyGridComponent {
|
|
|
5746
5908
|
return dateAtOffset(x, this.from(), this.dayWidth());
|
|
5747
5909
|
}
|
|
5748
5910
|
/**
|
|
5749
|
-
* The keyboard equivalent of dragging the
|
|
5750
|
-
* extends by a
|
|
5751
|
-
*
|
|
5752
|
-
* drag has). Scoped to the departure edge only — the more common "extend a
|
|
5753
|
-
* stay" gesture — so one binding covers the primary case without a second
|
|
5754
|
-
* modifier combination to document; the arrival edge is still reachable by
|
|
5755
|
-
* dragging its handle with a mouse.
|
|
5911
|
+
* The keyboard equivalent of dragging the end edge: Shift+ArrowRight
|
|
5912
|
+
* extends by a day, Shift+ArrowLeft shortens by one, each press committing
|
|
5913
|
+
* immediately. End edge only; an open-ended bar has none to move.
|
|
5756
5914
|
*/
|
|
5757
|
-
onBarKeydownResize(event,
|
|
5915
|
+
onBarKeydownResize(event, lane, bar, laneBars) {
|
|
5758
5916
|
if (!event.shiftKey ||
|
|
5759
5917
|
(event.key !== 'ArrowRight' && event.key !== 'ArrowLeft')) {
|
|
5760
5918
|
return;
|
|
5761
5919
|
}
|
|
5762
5920
|
event.preventDefault();
|
|
5763
5921
|
event.stopPropagation();
|
|
5764
|
-
|
|
5922
|
+
if (bar.endDate === null) {
|
|
5923
|
+
return;
|
|
5924
|
+
}
|
|
5925
|
+
const bound = neighborBound(laneBars, bar.id, 'end', this.preventOverlap());
|
|
5765
5926
|
let next = addDays(bar.endDate, event.key === 'ArrowRight' ? 1 : -1);
|
|
5766
5927
|
if (bound && next > bound) {
|
|
5767
5928
|
next = bound;
|
|
@@ -5772,12 +5933,9 @@ class OccupancyGridComponent {
|
|
|
5772
5933
|
if (next === bar.endDate) {
|
|
5773
5934
|
return;
|
|
5774
5935
|
}
|
|
5775
|
-
if (this.rejectIfOverbooked(room, bar.bookingId, bar.startDate, next)) {
|
|
5776
|
-
return;
|
|
5777
|
-
}
|
|
5778
5936
|
this.barResize.emit({
|
|
5779
5937
|
bar,
|
|
5780
|
-
|
|
5938
|
+
lane,
|
|
5781
5939
|
edge: 'end',
|
|
5782
5940
|
previousStartDate: bar.startDate,
|
|
5783
5941
|
previousEndDate: bar.endDate,
|
|
@@ -5785,13 +5943,256 @@ class OccupancyGridComponent {
|
|
|
5785
5943
|
proposedEndDate: next,
|
|
5786
5944
|
});
|
|
5787
5945
|
}
|
|
5788
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type:
|
|
5789
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: OccupancyGridComponent, isStandalone: true, selector: "ud-occupancy-grid", inputs: { rooms: { classPropertyName: "rooms", publicName: "rooms", isSignal: true, isRequired: false, transformFunction: null }, dormName: { classPropertyName: "dormName", publicName: "dormName", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, preventOverbooking: { classPropertyName: "preventOverbooking", publicName: "preventOverbooking", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", roomClick: "roomClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{\n 'occupancyGrid.rooms' | translate\n }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.roomCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!asRoomRow(p.row).room.active\"\n [class.is-move-target]=\"isMoveTarget(asRoomRow(p.row).room.roomId)\"\n [attr.data-room-id]=\"asRoomRow(p.row).room.roomId\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"roomClick.emit(asRoomRow(p.row).room)\"\n (keydown.enter)=\"roomClick.emit(asRoomRow(p.row).room)\">\n <span class=\"occ__room-number\">{{\n asRoomRow(p.row).room.number\n }}</span>\n <span class=\"occ__room-type\">{{\n asRoomRow(p.row).room.type\n }}</span>\n @if (takenOn(asRoomRow(p.row).room) !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"\n takenOn(asRoomRow(p.row).room)! >=\n asRoomRow(p.row).room.capacity\n \">\n {{ takenOn(asRoomRow(p.row).room) }}/{{\n asRoomRow(p.row).room.capacity\n }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @if (asRoomRow(p.row).freeLane !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"\n 4 + asRoomRow(p.row).freeLane! * (laneHeight() + 4)\n \"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"\n (mousemove)=\"\n onLaneMouseMove(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"></div>\n }\n @for (lb of asRoomRow(p.row).bars; track lb.bar.bookingId) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-resizing]=\"isResizing(lb.bar.bookingId)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.bookingId)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.lane * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"\n startBarMove($event, asRoomRow(p.row).room, lb.bar)\n \"\n (click)=\"\n $event.stopPropagation();\n onBarClick(lb.bar, asRoomRow(p.row).room)\n \"\n (keydown.enter)=\"\n barClick.emit({\n bar: lb.bar,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown)=\"\n onBarKeydownResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n asRoomRow(p.row).bars\n )\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'start',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.studentName }}</span>\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'end',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"], dependencies: [{ kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5946
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TimelineGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5947
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: TimelineGridComponent, isStandalone: true, selector: "ud-timeline-grid", inputs: { lanes: { classPropertyName: "lanes", publicName: "lanes", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, cornerLabelKey: { classPropertyName: "cornerLabelKey", publicName: "cornerLabelKey", isSignal: true, isRequired: false, transformFunction: null }, emptyLabelKey: { classPropertyName: "emptyLabelKey", publicName: "emptyLabelKey", isSignal: true, isRequired: false, transformFunction: null }, createCellLabelKey: { classPropertyName: "createCellLabelKey", publicName: "createCellLabelKey", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null }, dragPayload: { classPropertyName: "dragPayload", publicName: "dragPayload", isSignal: true, isRequired: false, transformFunction: null }, canDrop: { classPropertyName: "canDrop", publicName: "canDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", laneClick: "laneClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate", laneDrop: "laneDrop" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{ cornerLabelKey() | translate }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.laneCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n @let lr = asLaneRow(p.row);\n <!-- data-room-id mirrors data-lane-id for selectors written against the occupancy grid. -->\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!lr.lane.active\"\n [class.is-move-target]=\"isMoveTarget(lr.lane.id)\"\n [class.is-drop-disabled]=\"isDropDisabled(lr.lane)\"\n [attr.data-lane-id]=\"lr.lane.id\"\n [attr.data-room-id]=\"lr.lane.id\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"laneClick.emit(lr.lane)\"\n (keydown.enter)=\"laneClick.emit(lr.lane)\">\n <span class=\"occ__room-number\">{{ lr.lane.label }}</span>\n @if (lr.lane.sublabel) {\n <span class=\"occ__room-type\">{{ lr.lane.sublabel }}</span>\n }\n @for (tag of lr.lane.tags ?? []; track tag) {\n <span class=\"occ__lane-tag\">{{ tag }}</span>\n }\n @let taken = takenOn(lr.lane);\n @if (taken !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"taken >= lr.lane.capacity!\">\n {{ taken }}/{{ lr.lane.capacity }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n createCellLabelKey()\n | translate: { lane: lr.lane.label, room: lr.lane.label }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, lr.lane)\"\n (click)=\"onLaneClick($event, lr.lane)\"\n (mousemove)=\"onLaneMouseMove($event, lr.lane)\"\n (mouseleave)=\"onLaneMouseLeave(lr.lane)\"\n (focus)=\"onLaneFocus(lr.lane)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, lr.lane)\"\n (dragover)=\"onLaneDragOver($event, lr.lane)\"\n (dragleave)=\"onLaneDragLeave($event, lr.lane)\"\n (drop)=\"onLaneDrop($event, lr.lane)\">\n @for (c of lr.lane.closures; track c.id) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n [udTooltipFollowPointer]=\"true\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({ closure: c, lane: lr.lane })\n \"\n (keydown.enter)=\"\n closureClick.emit({ closure: c, lane: lr.lane })\n \">\n <span class=\"occ__closure-label\">{{ c.label }}</span>\n </div>\n }\n }\n @if (lr.freeSlot !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"4 + lr.freeSlot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate($event, lr.lane, lr.freeSlot)\n \"\n (mousemove)=\"\n onLaneMouseMove($event, lr.lane, lr.freeSlot)\n \"></div>\n }\n @for (lb of lr.bars; track lb.bar.id) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-open-ended]=\"lb.bar.endDate === null\"\n [class.is-resizing]=\"isResizing(lb.bar.id)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.id)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.slot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [udTooltipFollowPointer]=\"true\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"startBarMove($event, lr.lane, lb.bar)\"\n (click)=\"\n $event.stopPropagation(); onBarClick(lb.bar, lr.lane)\n \"\n (keydown.enter)=\"\n barClick.emit({ bar: lb.bar, lane: lr.lane })\n \"\n (keydown)=\"\n onBarKeydownResize($event, lr.lane, lb.bar, lr.bars)\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'start', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.title }}</span>\n @if (lb.bar.subtitle) {\n <span class=\"occ__bar-sub\">{{ lb.bar.subtitle }}</span>\n }\n @if (lb.bar.badge) {\n <span class=\"occ__bar-badge\">{{ lb.bar.badge }}</span>\n }\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'end', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [class.is-cut-right]=\"g.openEnded\"\n [class.is-open-ended]=\"g.openEnded\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ emptyLabelKey() | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of legend(); track s.state) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s.state\"></i\n >{{ s.labelKey | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-tag{flex-shrink:0;padding:0 5px;border-radius:999px;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);font-size:10px;line-height:15px;color:var(--ud-occ-muted)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar-sub{margin-left:6px;opacity:.7;overflow:hidden;text-overflow:ellipsis}.occ__bar-badge{margin-left:auto;padding-left:6px;font-size:10px;font-weight:600}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__row--room.is-drop-disabled{opacity:.4;filter:grayscale(1)}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__bar.is-open-ended{padding-right:16px}.occ__bar.is-open-ended:after{content:\"\\2192\";opacity:.9}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"], dependencies: [{ kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay", "udTooltipFollowPointer"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5948
|
+
}
|
|
5949
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TimelineGridComponent, decorators: [{
|
|
5950
|
+
type: Component,
|
|
5951
|
+
args: [{ selector: 'ud-timeline-grid', standalone: true, imports: [UdTooltipDirective, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{ cornerLabelKey() | translate }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.laneCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n @let lr = asLaneRow(p.row);\n <!-- data-room-id mirrors data-lane-id for selectors written against the occupancy grid. -->\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!lr.lane.active\"\n [class.is-move-target]=\"isMoveTarget(lr.lane.id)\"\n [class.is-drop-disabled]=\"isDropDisabled(lr.lane)\"\n [attr.data-lane-id]=\"lr.lane.id\"\n [attr.data-room-id]=\"lr.lane.id\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"laneClick.emit(lr.lane)\"\n (keydown.enter)=\"laneClick.emit(lr.lane)\">\n <span class=\"occ__room-number\">{{ lr.lane.label }}</span>\n @if (lr.lane.sublabel) {\n <span class=\"occ__room-type\">{{ lr.lane.sublabel }}</span>\n }\n @for (tag of lr.lane.tags ?? []; track tag) {\n <span class=\"occ__lane-tag\">{{ tag }}</span>\n }\n @let taken = takenOn(lr.lane);\n @if (taken !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"taken >= lr.lane.capacity!\">\n {{ taken }}/{{ lr.lane.capacity }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n createCellLabelKey()\n | translate: { lane: lr.lane.label, room: lr.lane.label }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, lr.lane)\"\n (click)=\"onLaneClick($event, lr.lane)\"\n (mousemove)=\"onLaneMouseMove($event, lr.lane)\"\n (mouseleave)=\"onLaneMouseLeave(lr.lane)\"\n (focus)=\"onLaneFocus(lr.lane)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, lr.lane)\"\n (dragover)=\"onLaneDragOver($event, lr.lane)\"\n (dragleave)=\"onLaneDragLeave($event, lr.lane)\"\n (drop)=\"onLaneDrop($event, lr.lane)\">\n @for (c of lr.lane.closures; track c.id) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n [udTooltipFollowPointer]=\"true\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({ closure: c, lane: lr.lane })\n \"\n (keydown.enter)=\"\n closureClick.emit({ closure: c, lane: lr.lane })\n \">\n <span class=\"occ__closure-label\">{{ c.label }}</span>\n </div>\n }\n }\n @if (lr.freeSlot !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"4 + lr.freeSlot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate($event, lr.lane, lr.freeSlot)\n \"\n (mousemove)=\"\n onLaneMouseMove($event, lr.lane, lr.freeSlot)\n \"></div>\n }\n @for (lb of lr.bars; track lb.bar.id) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-open-ended]=\"lb.bar.endDate === null\"\n [class.is-resizing]=\"isResizing(lb.bar.id)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.id)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.slot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [udTooltipFollowPointer]=\"true\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"startBarMove($event, lr.lane, lb.bar)\"\n (click)=\"\n $event.stopPropagation(); onBarClick(lb.bar, lr.lane)\n \"\n (keydown.enter)=\"\n barClick.emit({ bar: lb.bar, lane: lr.lane })\n \"\n (keydown)=\"\n onBarKeydownResize($event, lr.lane, lb.bar, lr.bars)\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'start', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.title }}</span>\n @if (lb.bar.subtitle) {\n <span class=\"occ__bar-sub\">{{ lb.bar.subtitle }}</span>\n }\n @if (lb.bar.badge) {\n <span class=\"occ__bar-badge\">{{ lb.bar.badge }}</span>\n }\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'end', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [class.is-cut-right]=\"g.openEnded\"\n [class.is-open-ended]=\"g.openEnded\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ emptyLabelKey() | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of legend(); track s.state) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s.state\"></i\n >{{ s.labelKey | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-tag{flex-shrink:0;padding:0 5px;border-radius:999px;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);font-size:10px;line-height:15px;color:var(--ud-occ-muted)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar-sub{margin-left:6px;opacity:.7;overflow:hidden;text-overflow:ellipsis}.occ__bar-badge{margin-left:auto;padding-left:6px;font-size:10px;font-weight:600}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__row--room.is-drop-disabled{opacity:.4;filter:grayscale(1)}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__bar.is-open-ended{padding-right:16px}.occ__bar.is-open-ended:after{content:\"\\2192\";opacity:.9}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"] }]
|
|
5952
|
+
}], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i0.DestroyRef }] });
|
|
5953
|
+
|
|
5954
|
+
const OCCUPANCY_GRID_HEADER_HEIGHT = TIMELINE_GRID_HEADER_HEIGHT;
|
|
5955
|
+
const numeric = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
|
|
5956
|
+
/** A room as a timeline lane under dorm › floor › type headers, numerically ordered. */
|
|
5957
|
+
function roomLanes(rooms, dormName) {
|
|
5958
|
+
return [...rooms]
|
|
5959
|
+
.sort((a, b) => numeric(a.floorLevel, b.floorLevel) ||
|
|
5960
|
+
numeric(a.type, b.type) ||
|
|
5961
|
+
numeric(a.number, b.number) ||
|
|
5962
|
+
a.roomId.localeCompare(b.roomId))
|
|
5963
|
+
.map(room => ({
|
|
5964
|
+
id: room.roomId,
|
|
5965
|
+
label: room.number,
|
|
5966
|
+
sublabel: room.type,
|
|
5967
|
+
groupId: `type:${room.type}`,
|
|
5968
|
+
groupLabel: room.type,
|
|
5969
|
+
parentGroups: [
|
|
5970
|
+
{ id: 'dorm', label: dormName },
|
|
5971
|
+
{ id: `floor:${room.floorLevel}`, label: room.floorLevel },
|
|
5972
|
+
],
|
|
5973
|
+
active: room.active,
|
|
5974
|
+
capacity: room.capacity,
|
|
5975
|
+
bars: room.bars.map((bar) => ({
|
|
5976
|
+
id: bar.bookingId,
|
|
5977
|
+
title: bar.studentName,
|
|
5978
|
+
startDate: bar.startDate,
|
|
5979
|
+
endDate: bar.endDate,
|
|
5980
|
+
continuesBefore: bar.continuesBefore,
|
|
5981
|
+
continuesAfter: bar.continuesAfter,
|
|
5982
|
+
state: bar.state,
|
|
5983
|
+
data: bar,
|
|
5984
|
+
})),
|
|
5985
|
+
closures: room.closures.map((closure) => ({
|
|
5986
|
+
id: closure.closureId,
|
|
5987
|
+
label: closure.reason,
|
|
5988
|
+
startDate: closure.startDate,
|
|
5989
|
+
endDate: closure.endDate,
|
|
5990
|
+
continuesBefore: closure.continuesBefore,
|
|
5991
|
+
continuesAfter: closure.continuesAfter,
|
|
5992
|
+
data: closure,
|
|
5993
|
+
})),
|
|
5994
|
+
data: room,
|
|
5995
|
+
}));
|
|
5996
|
+
}
|
|
5997
|
+
const roomOf = (lane) => lane.data;
|
|
5998
|
+
const barOf = (bar) => bar.data;
|
|
5999
|
+
/**
|
|
6000
|
+
* Rooms as rows, days as columns, one bar per stay (UC-11). Since UC-42 a thin
|
|
6001
|
+
* adapter over `ud-timeline-grid`: rooms become lanes (grouped dorm › floor ›
|
|
6002
|
+
* type), stays become bars, and every generic event is mapped back to the
|
|
6003
|
+
* room/stay one, so its inputs and outputs are what they always were. The one
|
|
6004
|
+
* room-only rule, capacity (`preventOverbooking`), is enforced here.
|
|
6005
|
+
*/
|
|
6006
|
+
class OccupancyGridComponent {
|
|
6007
|
+
translate;
|
|
6008
|
+
snackBar;
|
|
6009
|
+
rooms = input([]);
|
|
6010
|
+
dormName = input('');
|
|
6011
|
+
from = input.required();
|
|
6012
|
+
to = input.required();
|
|
6013
|
+
today = input(null);
|
|
6014
|
+
dayWidth = input(28);
|
|
6015
|
+
leftColumnWidth = input(220);
|
|
6016
|
+
laneHeight = input(22);
|
|
6017
|
+
loading = input(false);
|
|
6018
|
+
/** Days the ‹ / › nav buttons and the ArrowLeft/ArrowRight keys shift the window by. */
|
|
6019
|
+
navStepDays = input(7);
|
|
6020
|
+
/**
|
|
6021
|
+
* When true, a resize or whole-bar move drag is never allowed to leave
|
|
6022
|
+
* two bars in the same room overlapping in time. The default (false)
|
|
6023
|
+
* lets bars in different lanes of the same room legitimately overlap —
|
|
6024
|
+
* an outgoing stay's last few nights next to an incoming one's first, say.
|
|
6025
|
+
*/
|
|
6026
|
+
preventOverlap = input(false);
|
|
6027
|
+
/**
|
|
6028
|
+
* Off by default, like `preventOverlap`: the grid otherwise defers capacity
|
|
6029
|
+
* to the consumer. When set, a create, move or resize that would put more
|
|
6030
|
+
* stays in a room than it has beds on some night is dropped instead of
|
|
6031
|
+
* emitted, the bar stays where it was, and a snackbar says why.
|
|
6032
|
+
*/
|
|
6033
|
+
preventOverbooking = input(false);
|
|
6034
|
+
barClick = output();
|
|
6035
|
+
closureClick = output();
|
|
6036
|
+
roomClick = output();
|
|
6037
|
+
/** An empty day cell was clicked: the room and the date under the pointer. */
|
|
6038
|
+
cellClick = output();
|
|
6039
|
+
reachedEnd = output();
|
|
6040
|
+
/** The signed day delta the nav buttons or an arrow key asked for; see `TimelineGridComponent.windowShift`. */
|
|
6041
|
+
windowShift = output();
|
|
6042
|
+
/** See `OccupancyBarResize` — this reports the proposal; it never applies it. */
|
|
6043
|
+
barResize = output();
|
|
6044
|
+
/** See `OccupancyBarMove` — this reports the proposal; it never applies it. */
|
|
6045
|
+
barMove = output();
|
|
6046
|
+
/** See `OccupancyBarCreate` — this reports the proposal; it never creates a bar itself. */
|
|
6047
|
+
barCreate = output();
|
|
6048
|
+
lanes = computed(() => roomLanes(this.rooms(), this.dormName()));
|
|
6049
|
+
roomOf = roomOf;
|
|
6050
|
+
barOf = barOf;
|
|
6051
|
+
grid = viewChild.required(TimelineGridComponent);
|
|
6052
|
+
/** The live edge drag, as this component held it before UC-42 moved it into the timeline grid. */
|
|
6053
|
+
resize = computed(() => this.grid().activeResize());
|
|
6054
|
+
constructor(translate, snackBar) {
|
|
6055
|
+
this.translate = translate;
|
|
6056
|
+
this.snackBar = snackBar;
|
|
6057
|
+
}
|
|
6058
|
+
onClosureClick(closure, lane) {
|
|
6059
|
+
this.closureClick.emit({
|
|
6060
|
+
closure: closure.data,
|
|
6061
|
+
room: roomOf(lane),
|
|
6062
|
+
});
|
|
6063
|
+
}
|
|
6064
|
+
onBarResize(e) {
|
|
6065
|
+
const room = roomOf(e.lane);
|
|
6066
|
+
const bar = barOf(e.bar);
|
|
6067
|
+
const end = e.proposedEndDate;
|
|
6068
|
+
if (this.rejectIfOverbooked(room, bar.bookingId, e.proposedStartDate, end)) {
|
|
6069
|
+
return;
|
|
6070
|
+
}
|
|
6071
|
+
this.barResize.emit({
|
|
6072
|
+
bar,
|
|
6073
|
+
room,
|
|
6074
|
+
edge: e.edge,
|
|
6075
|
+
previousStartDate: e.previousStartDate,
|
|
6076
|
+
previousEndDate: e.previousEndDate,
|
|
6077
|
+
proposedStartDate: e.proposedStartDate,
|
|
6078
|
+
proposedEndDate: end,
|
|
6079
|
+
});
|
|
6080
|
+
}
|
|
6081
|
+
onBarMove(e) {
|
|
6082
|
+
const toRoom = roomOf(e.toLane);
|
|
6083
|
+
const bar = barOf(e.bar);
|
|
6084
|
+
const end = e.proposedEndDate;
|
|
6085
|
+
if (this.rejectIfOverbooked(toRoom, bar.bookingId, e.proposedStartDate, end)) {
|
|
6086
|
+
return;
|
|
6087
|
+
}
|
|
6088
|
+
this.barMove.emit({
|
|
6089
|
+
bar,
|
|
6090
|
+
fromRoom: roomOf(e.fromLane),
|
|
6091
|
+
toRoom,
|
|
6092
|
+
previousStartDate: e.previousStartDate,
|
|
6093
|
+
previousEndDate: e.previousEndDate,
|
|
6094
|
+
proposedStartDate: e.proposedStartDate,
|
|
6095
|
+
proposedEndDate: end,
|
|
6096
|
+
});
|
|
6097
|
+
}
|
|
6098
|
+
onBarCreate(e) {
|
|
6099
|
+
const room = roomOf(e.lane);
|
|
6100
|
+
if (this.rejectIfOverbooked(room, '', e.proposedStartDate, e.proposedEndDate)) {
|
|
6101
|
+
return;
|
|
6102
|
+
}
|
|
6103
|
+
this.barCreate.emit({
|
|
6104
|
+
room,
|
|
6105
|
+
proposedStartDate: e.proposedStartDate,
|
|
6106
|
+
proposedEndDate: e.proposedEndDate,
|
|
6107
|
+
});
|
|
6108
|
+
}
|
|
6109
|
+
/**
|
|
6110
|
+
* With `preventOverbooking`, a gesture that would put more stays in a room
|
|
6111
|
+
* than it has beds is dropped here, so the bar simply stays where it was,
|
|
6112
|
+
* with a snackbar saying why.
|
|
6113
|
+
*/
|
|
6114
|
+
rejectIfOverbooked(room, bookingId, start, end) {
|
|
6115
|
+
if (!this.preventOverbooking() ||
|
|
6116
|
+
!overbooksRoom(room, bookingId, start, end)) {
|
|
6117
|
+
return false;
|
|
6118
|
+
}
|
|
6119
|
+
this.snackBar.openFromComponent(CustomSnackbarComponent, {
|
|
6120
|
+
horizontalPosition: 'end',
|
|
6121
|
+
verticalPosition: 'top',
|
|
6122
|
+
panelClass: ['custom-snackbar-container'],
|
|
6123
|
+
data: {
|
|
6124
|
+
message: this.translate.instant('occupancyGrid.overbooked', {
|
|
6125
|
+
room: room.number,
|
|
6126
|
+
}),
|
|
6127
|
+
type: SnackbarType.WARNING,
|
|
6128
|
+
duration: 3000,
|
|
6129
|
+
},
|
|
6130
|
+
});
|
|
6131
|
+
return true;
|
|
6132
|
+
}
|
|
6133
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i1$2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
|
|
6134
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.19", type: OccupancyGridComponent, isStandalone: true, selector: "ud-occupancy-grid", inputs: { rooms: { classPropertyName: "rooms", publicName: "rooms", isSignal: true, isRequired: false, transformFunction: null }, dormName: { classPropertyName: "dormName", publicName: "dormName", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, preventOverbooking: { classPropertyName: "preventOverbooking", publicName: "preventOverbooking", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", roomClick: "roomClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate" }, viewQueries: [{ propertyName: "grid", first: true, predicate: TimelineGridComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
6135
|
+
<ud-timeline-grid
|
|
6136
|
+
[lanes]="lanes()"
|
|
6137
|
+
[from]="from()"
|
|
6138
|
+
[to]="to()"
|
|
6139
|
+
[today]="today()"
|
|
6140
|
+
[dayWidth]="dayWidth()"
|
|
6141
|
+
[leftColumnWidth]="leftColumnWidth()"
|
|
6142
|
+
[laneHeight]="laneHeight()"
|
|
6143
|
+
[loading]="loading()"
|
|
6144
|
+
[navStepDays]="navStepDays()"
|
|
6145
|
+
[preventOverlap]="preventOverlap()"
|
|
6146
|
+
cornerLabelKey="occupancyGrid.rooms"
|
|
6147
|
+
emptyLabelKey="occupancyGrid.empty"
|
|
6148
|
+
createCellLabelKey="occupancyGrid.createCell"
|
|
6149
|
+
(barClick)="
|
|
6150
|
+
barClick.emit({ bar: barOf($event.bar), room: roomOf($event.lane) })
|
|
6151
|
+
"
|
|
6152
|
+
(closureClick)="onClosureClick($event.closure, $event.lane)"
|
|
6153
|
+
(laneClick)="roomClick.emit(roomOf($event))"
|
|
6154
|
+
(cellClick)="
|
|
6155
|
+
cellClick.emit({ room: roomOf($event.lane), date: $event.date })
|
|
6156
|
+
"
|
|
6157
|
+
(reachedEnd)="reachedEnd.emit($event)"
|
|
6158
|
+
(windowShift)="windowShift.emit($event)"
|
|
6159
|
+
(barResize)="onBarResize($event)"
|
|
6160
|
+
(barMove)="onBarMove($event)"
|
|
6161
|
+
(barCreate)="onBarCreate($event)" />
|
|
6162
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:var(--ud-occ-height, 640px)}ud-timeline-grid{height:100%}\n"], dependencies: [{ kind: "component", type: TimelineGridComponent, selector: "ud-timeline-grid", inputs: ["lanes", "from", "to", "today", "dayWidth", "leftColumnWidth", "laneHeight", "loading", "navStepDays", "preventOverlap", "cornerLabelKey", "emptyLabelKey", "createCellLabelKey", "legend", "dragPayload", "canDrop"], outputs: ["barClick", "closureClick", "laneClick", "cellClick", "reachedEnd", "windowShift", "barResize", "barMove", "barCreate", "laneDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5790
6163
|
}
|
|
5791
6164
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, decorators: [{
|
|
5792
6165
|
type: Component,
|
|
5793
|
-
args: [{ selector: 'ud-occupancy-grid', standalone: true, imports: [UdTooltipDirective, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{\n 'occupancyGrid.rooms' | translate\n }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.roomCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!asRoomRow(p.row).room.active\"\n [class.is-move-target]=\"isMoveTarget(asRoomRow(p.row).room.roomId)\"\n [attr.data-room-id]=\"asRoomRow(p.row).room.roomId\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"roomClick.emit(asRoomRow(p.row).room)\"\n (keydown.enter)=\"roomClick.emit(asRoomRow(p.row).room)\">\n <span class=\"occ__room-number\">{{\n asRoomRow(p.row).room.number\n }}</span>\n <span class=\"occ__room-type\">{{\n asRoomRow(p.row).room.type\n }}</span>\n @if (takenOn(asRoomRow(p.row).room) !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"\n takenOn(asRoomRow(p.row).room)! >=\n asRoomRow(p.row).room.capacity\n \">\n {{ takenOn(asRoomRow(p.row).room) }}/{{\n asRoomRow(p.row).room.capacity\n }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @if (asRoomRow(p.row).freeLane !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"\n 4 + asRoomRow(p.row).freeLane! * (laneHeight() + 4)\n \"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"\n (mousemove)=\"\n onLaneMouseMove(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"></div>\n }\n @for (lb of asRoomRow(p.row).bars; track lb.bar.bookingId) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-resizing]=\"isResizing(lb.bar.bookingId)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.bookingId)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.lane * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"\n startBarMove($event, asRoomRow(p.row).room, lb.bar)\n \"\n (click)=\"\n $event.stopPropagation();\n onBarClick(lb.bar, asRoomRow(p.row).room)\n \"\n (keydown.enter)=\"\n barClick.emit({\n bar: lb.bar,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown)=\"\n onBarKeydownResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n asRoomRow(p.row).bars\n )\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'start',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.studentName }}</span>\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'end',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"] }]
|
|
5794
|
-
|
|
6166
|
+
args: [{ selector: 'ud-occupancy-grid', standalone: true, imports: [TimelineGridComponent], template: `
|
|
6167
|
+
<ud-timeline-grid
|
|
6168
|
+
[lanes]="lanes()"
|
|
6169
|
+
[from]="from()"
|
|
6170
|
+
[to]="to()"
|
|
6171
|
+
[today]="today()"
|
|
6172
|
+
[dayWidth]="dayWidth()"
|
|
6173
|
+
[leftColumnWidth]="leftColumnWidth()"
|
|
6174
|
+
[laneHeight]="laneHeight()"
|
|
6175
|
+
[loading]="loading()"
|
|
6176
|
+
[navStepDays]="navStepDays()"
|
|
6177
|
+
[preventOverlap]="preventOverlap()"
|
|
6178
|
+
cornerLabelKey="occupancyGrid.rooms"
|
|
6179
|
+
emptyLabelKey="occupancyGrid.empty"
|
|
6180
|
+
createCellLabelKey="occupancyGrid.createCell"
|
|
6181
|
+
(barClick)="
|
|
6182
|
+
barClick.emit({ bar: barOf($event.bar), room: roomOf($event.lane) })
|
|
6183
|
+
"
|
|
6184
|
+
(closureClick)="onClosureClick($event.closure, $event.lane)"
|
|
6185
|
+
(laneClick)="roomClick.emit(roomOf($event))"
|
|
6186
|
+
(cellClick)="
|
|
6187
|
+
cellClick.emit({ room: roomOf($event.lane), date: $event.date })
|
|
6188
|
+
"
|
|
6189
|
+
(reachedEnd)="reachedEnd.emit($event)"
|
|
6190
|
+
(windowShift)="windowShift.emit($event)"
|
|
6191
|
+
(barResize)="onBarResize($event)"
|
|
6192
|
+
(barMove)="onBarMove($event)"
|
|
6193
|
+
(barCreate)="onBarCreate($event)" />
|
|
6194
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:var(--ud-occ-height, 640px)}ud-timeline-grid{height:100%}\n"] }]
|
|
6195
|
+
}], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i1$2.MatSnackBar }] });
|
|
5795
6196
|
|
|
5796
6197
|
class SummaryViewComponent {
|
|
5797
6198
|
clipboard = inject(Clipboard);
|
|
@@ -5824,7 +6225,7 @@ class SummaryViewComponent {
|
|
|
5824
6225
|
clearTimeout(this.resetTimer);
|
|
5825
6226
|
}
|
|
5826
6227
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SummaryViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5827
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: SummaryViewComponent, isStandalone: true, selector: "ud-summary-view", inputs: { title: "title", actions: "actions", summaryFields: "summaryFields", loading: "loading", layout: "layout", skeletonTitleHeight: "skeletonTitleHeight", skeletonBodyHeight: "skeletonBodyHeight", copyLabel: "copyLabel", copiedLabel: "copiedLabel" }, ngImport: i0, template: "<div class=\"summary-view-container\">\n <div class=\"header\">\n @if (loading) {\n <ngx-skeleton-loader\n class=\"loading col-6\"\n [count]=\"1\"\n [theme]=\"{ height: skeletonTitleHeight }\" />\n } @else {\n <h5 class=\"header-title\">{{ title }}</h5>\n }\n <div class=\"header-actions\">\n @for (action of actions; track action.label) {\n @if (action.isAuthorized) {\n @if (action.path) {\n <ud-button\n variant=\"stroked\"\n color=\"primary\"\n size=\"sm\"\n [icon]=\"action.icon\"\n [routerLink]=\"action.path\">\n {{ action.label | translate | capitalize }}\n </ud-button>\n } @else if (action.onClick) {\n <ud-button\n variant=\"stroked\"\n color=\"primary\"\n size=\"sm\"\n [icon]=\"action.icon\"\n (buttonClick)=\"action.onClick!()\">\n {{ action.label | translate | capitalize }}\n </ud-button>\n }\n }\n }\n <ng-content select=\"[header-actions]\" />\n </div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{\n reverse: layout === 'text-right',\n 'flex-column': layout === 'text-top',\n }\">\n @if (loading) {\n <ngx-skeleton-loader\n class=\"col\"\n [count]=\"1\"\n [theme]=\"{ height: skeletonBodyHeight }\" />\n } @else {\n @if (layout !== 'text-none') {\n <div [ngClass]=\"layout === 'text-top' || layout === 'text-all' ? 'col-12' : 'col-6'\">\n <div class=\"summary\" [ngClass]=\"{ 'summary-row-wrap': layout === 'text-top' || layout === 'text-all' }\">\n @for (summaryField of summaryFields; track $index) {\n <div class=\"summary-field\">\n @if (summaryField.label) {\n <div class=\"summary-label\">\n <mat-icon fontSet=\"material-icons-outlined\">{{ summaryField.icon }}</mat-icon>\n <span>{{ summaryField.label | capitalize }}</span>\n </div>\n }\n <div class=\"summary-row\">\n @if (!summaryField.label) {\n <mat-icon fontSet=\"material-icons-outlined\">{{ summaryField.icon }}</mat-icon>\n }\n <mat-label>{{ summaryField.value }}</mat-label>\n @if (summaryField.copyable && hasValue(summaryField)) {\n <div class=\"summary-copy\" [class.is-copied]=\"copiedIndex() === $index\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n [icon]=\"copiedIndex() === $index ? 'check' : 'content_copy'\"\n [udTooltip]=\"(copiedIndex() === $index ? copiedLabel : copyLabel) | translate | capitalize\"\n (buttonClick)=\"copy(summaryField, $index)\" />\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (layout !== 'text-all') {\n <div\n class=\"content-body\"\n [ngClass]=\"{\n 'col-12': layout === 'text-none' || layout === 'text-top',\n 'col-6': layout !== 'text-none' && layout !== 'text-top',\n }\">\n <ng-content></ng-content>\n </div>\n }\n }\n </div>\n</div>\n", styles: [".summary-view-container{justify-self:center;width:100%;border-radius:12px;overflow:hidden;box-shadow:0 0 0 1px #1b253512,0 4px 16px #1b253514;font-family:Sora,system-ui,sans-serif}.header{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;background:#1b2535;min-height:52px}.header .header-title{margin:0;font-family:Sora,system-ui,sans-serif;font-size:.9rem;font-weight:600;color:#fff;letter-spacing:.02em}.header .header-actions{display:flex;align-items:center;gap:8px}.header .header-actions ::ng-deep .ud-btn{border-color:#ffffff4d!important;color:#ffffffd9!important}.header .header-actions ::ng-deep .ud-btn:hover{background:#ffffff1a!important;border-color:#ffffff80!important;color:#fff!important}.header .header-actions ::ng-deep .ud-btn .mat-icon{color:inherit!important}.header .loading{padding:.5rem;border-radius:4px}.header .loading ::ng-deep .skeleton-loader{background:#ffffff1f!important;background-image:linear-gradient(90deg,#ffffff1f,#ffffff38,#ffffff1f 80px)!important}.content{display:flex;flex-wrap:wrap;background:#fff}.content:not(.flex-column):has(.content-body>*)>.col-6:first-child{border-right:1px solid #e8eaee}.content.reverse:has(.content-body>*)>.col-6:last-child{border-right:1px solid #e8eaee;border-left:none}.summary{display:flex;flex-direction:column;gap:0;padding:20px 24px}.summary.summary-row-wrap{flex-direction:row;flex-wrap:wrap;gap:.25rem;padding:16px 8px}.summary-field{display:flex;flex-direction:column;gap:3px;padding:10px 16px;border-radius:8px;transition:background .15s ease}.summary-field:hover{background:#f4f5f7}.summary-row-wrap .summary-field{padding:12px 16px;min-width:140px;border:1px solid #e8eaee}.summary-label,.summary-row{display:flex;align-items:center;gap:6px}.summary-label mat-icon,.summary-row mat-icon{height:14px;width:14px;min-width:14px;font-size:14px;color:#6b7585;flex-shrink:0}.summary-label span{font-family:Sora,system-ui,sans-serif;font-size:.75rem;font-weight:500;color:#6b7585;line-height:1.4}mat-label{font-family:Sora,system-ui,sans-serif;font-size:.9375rem;font-weight:500;color:#1b2535;line-height:1.4}.content-body:has(>*){background:#f4f5f7;padding:20px 24px}.flex-column>.content-body:has(>*){border-top:1px solid #e8eaee}.summary-copy{display:inline-flex;align-items:center;height:1em;margin-left:2px;opacity:0;transition:opacity .12s ease}.summary-field:hover .summary-copy,.summary-copy:focus-within,.summary-copy.is-copied{opacity:1}@media (hover: none){.summary-copy{opacity:1}}@media (prefers-reduced-motion: reduce){.summary-copy{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: NgxSkeletonLoaderModule }, { kind: "component", type: i2$5.NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: ["count", "loadingText", "appearance", "animation", "ariaLabel", "theme"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: UdButtonComponent, selector: "ud-button", inputs: ["variant", "color", "size", "type", "icon", "iconPosition", "iconFontSet", "loading", "disabled", "ariaLabel", "fullWidth"], outputs: ["buttonClick"] }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }] });
|
|
6228
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: SummaryViewComponent, isStandalone: true, selector: "ud-summary-view", inputs: { title: "title", actions: "actions", summaryFields: "summaryFields", loading: "loading", layout: "layout", skeletonTitleHeight: "skeletonTitleHeight", skeletonBodyHeight: "skeletonBodyHeight", copyLabel: "copyLabel", copiedLabel: "copiedLabel" }, ngImport: i0, template: "<div class=\"summary-view-container\">\n <div class=\"header\">\n @if (loading) {\n <ngx-skeleton-loader\n class=\"loading col-6\"\n [count]=\"1\"\n [theme]=\"{ height: skeletonTitleHeight }\" />\n } @else {\n <h5 class=\"header-title\">{{ title }}</h5>\n }\n <div class=\"header-actions\">\n @for (action of actions; track action.label) {\n @if (action.isAuthorized) {\n @if (action.path) {\n <ud-button\n variant=\"stroked\"\n color=\"primary\"\n size=\"sm\"\n [icon]=\"action.icon\"\n [routerLink]=\"action.path\">\n {{ action.label | translate | capitalize }}\n </ud-button>\n } @else if (action.onClick) {\n <ud-button\n variant=\"stroked\"\n color=\"primary\"\n size=\"sm\"\n [icon]=\"action.icon\"\n (buttonClick)=\"action.onClick!()\">\n {{ action.label | translate | capitalize }}\n </ud-button>\n }\n }\n }\n <ng-content select=\"[header-actions]\" />\n </div>\n </div>\n <div\n class=\"content\"\n [ngClass]=\"{\n reverse: layout === 'text-right',\n 'flex-column': layout === 'text-top',\n }\">\n @if (loading) {\n <ngx-skeleton-loader\n class=\"col\"\n [count]=\"1\"\n [theme]=\"{ height: skeletonBodyHeight }\" />\n } @else {\n @if (layout !== 'text-none') {\n <div [ngClass]=\"layout === 'text-top' || layout === 'text-all' ? 'col-12' : 'col-6'\">\n <div class=\"summary\" [ngClass]=\"{ 'summary-row-wrap': layout === 'text-top' || layout === 'text-all' }\">\n @for (summaryField of summaryFields; track $index) {\n <div class=\"summary-field\">\n @if (summaryField.label) {\n <div class=\"summary-label\">\n <mat-icon fontSet=\"material-icons-outlined\">{{ summaryField.icon }}</mat-icon>\n <span>{{ summaryField.label | capitalize }}</span>\n </div>\n }\n <div class=\"summary-row\">\n @if (!summaryField.label) {\n <mat-icon fontSet=\"material-icons-outlined\">{{ summaryField.icon }}</mat-icon>\n }\n <mat-label>{{ summaryField.value }}</mat-label>\n @if (summaryField.copyable && hasValue(summaryField)) {\n <div class=\"summary-copy\" [class.is-copied]=\"copiedIndex() === $index\">\n <ud-button\n variant=\"icon-only\"\n color=\"secondary\"\n size=\"sm\"\n [icon]=\"copiedIndex() === $index ? 'check' : 'content_copy'\"\n [udTooltip]=\"(copiedIndex() === $index ? copiedLabel : copyLabel) | translate | capitalize\"\n (buttonClick)=\"copy(summaryField, $index)\" />\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (layout !== 'text-all') {\n <div\n class=\"content-body\"\n [ngClass]=\"{\n 'col-12': layout === 'text-none' || layout === 'text-top',\n 'col-6': layout !== 'text-none' && layout !== 'text-top',\n }\">\n <ng-content></ng-content>\n </div>\n }\n }\n </div>\n</div>\n", styles: [".summary-view-container{justify-self:center;width:100%;border-radius:12px;overflow:hidden;box-shadow:0 0 0 1px #1b253512,0 4px 16px #1b253514;font-family:Sora,system-ui,sans-serif}.header{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;background:#1b2535;min-height:52px}.header .header-title{margin:0;font-family:Sora,system-ui,sans-serif;font-size:.9rem;font-weight:600;color:#fff;letter-spacing:.02em}.header .header-actions{display:flex;align-items:center;gap:8px}.header .header-actions ::ng-deep .ud-btn{border-color:#ffffff4d!important;color:#ffffffd9!important}.header .header-actions ::ng-deep .ud-btn:hover{background:#ffffff1a!important;border-color:#ffffff80!important;color:#fff!important}.header .header-actions ::ng-deep .ud-btn .mat-icon{color:inherit!important}.header .loading{padding:.5rem;border-radius:4px}.header .loading ::ng-deep .skeleton-loader{background:#ffffff1f!important;background-image:linear-gradient(90deg,#ffffff1f,#ffffff38,#ffffff1f 80px)!important}.content{display:flex;flex-wrap:wrap;background:#fff}.content:not(.flex-column):has(.content-body>*)>.col-6:first-child{border-right:1px solid #e8eaee}.content.reverse:has(.content-body>*)>.col-6:last-child{border-right:1px solid #e8eaee;border-left:none}.summary{display:flex;flex-direction:column;gap:0;padding:20px 24px}.summary.summary-row-wrap{flex-direction:row;flex-wrap:wrap;gap:.25rem;padding:16px 8px}.summary-field{display:flex;flex-direction:column;gap:3px;padding:10px 16px;border-radius:8px;transition:background .15s ease}.summary-field:hover{background:#f4f5f7}.summary-row-wrap .summary-field{padding:12px 16px;min-width:140px;border:1px solid #e8eaee}.summary-label,.summary-row{display:flex;align-items:center;gap:6px}.summary-label mat-icon,.summary-row mat-icon{height:14px;width:14px;min-width:14px;font-size:14px;color:#6b7585;flex-shrink:0}.summary-label span{font-family:Sora,system-ui,sans-serif;font-size:.75rem;font-weight:500;color:#6b7585;line-height:1.4}mat-label{font-family:Sora,system-ui,sans-serif;font-size:.9375rem;font-weight:500;color:#1b2535;line-height:1.4}.content-body:has(>*){background:#f4f5f7;padding:20px 24px}.flex-column>.content-body:has(>*){border-top:1px solid #e8eaee}.summary-copy{display:inline-flex;align-items:center;height:1em;margin-left:2px;opacity:0;transition:opacity .12s ease}.summary-field:hover .summary-copy,.summary-copy:focus-within,.summary-copy.is-copied{opacity:1}@media (hover: none){.summary-copy{opacity:1}}@media (prefers-reduced-motion: reduce){.summary-copy{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: CapitalizePipe, name: "capitalize" }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "ngmodule", type: NgxSkeletonLoaderModule }, { kind: "component", type: i2$5.NgxSkeletonLoaderComponent, selector: "ngx-skeleton-loader", inputs: ["count", "loadingText", "appearance", "animation", "ariaLabel", "theme"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: UdButtonComponent, selector: "ud-button", inputs: ["variant", "color", "size", "type", "icon", "iconPosition", "iconFontSet", "loading", "disabled", "ariaLabel", "fullWidth"], outputs: ["buttonClick"] }, { kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay", "udTooltipFollowPointer"] }] });
|
|
5828
6229
|
}
|
|
5829
6230
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: SummaryViewComponent, decorators: [{
|
|
5830
6231
|
type: Component,
|
|
@@ -7102,7 +7503,7 @@ class CalendarComponent {
|
|
|
7102
7503
|
return `rgba(${r},${g},${b},${alpha})`;
|
|
7103
7504
|
}
|
|
7104
7505
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7105
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: CalendarComponent, isStandalone: true, selector: "ud-calendar", inputs: { slots: { classPropertyName: "slots", publicName: "slots", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, defaultView: { classPropertyName: "defaultView", publicName: "defaultView", isSignal: true, isRequired: false, transformFunction: null }, slotDuration: { classPropertyName: "slotDuration", publicName: "slotDuration", isSignal: true, isRequired: false, transformFunction: null }, minHour: { classPropertyName: "minHour", publicName: "minHour", isSignal: true, isRequired: false, transformFunction: null }, maxHour: { classPropertyName: "maxHour", publicName: "maxHour", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, bookableUsers: { classPropertyName: "bookableUsers", publicName: "bookableUsers", isSignal: true, isRequired: false, transformFunction: null }, minSlotStart: { classPropertyName: "minSlotStart", publicName: "minSlotStart", isSignal: true, isRequired: false, transformFunction: null }, defaultDate: { classPropertyName: "defaultDate", publicName: "defaultDate", isSignal: true, isRequired: false, transformFunction: null }, rescheduleContext: { classPropertyName: "rescheduleContext", publicName: "rescheduleContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { slotAdded: "slotAdded", slotUpdated: "slotUpdated", slotRemoved: "slotRemoved", slotBooked: "slotBooked", slotBlocked: "slotBlocked" }, host: { listeners: { "document:mousemove": "onDocMouseMove($event)", "document:mouseup": "onDocMouseUp($event)" } }, viewQueries: [{ propertyName: "hoverCardTpl", first: true, predicate: ["hoverCard"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ud-cal\" #calendarHost>\n\n <!-- Header -->\n <div class=\"ud-cal__header\">\n <div class=\"ud-cal__nav\">\n <ud-button variant=\"icon-only\" color=\"secondary\" size=\"sm\" icon=\"chevron_left\" (buttonClick)=\"navigate(-1)\" />\n <ud-button variant=\"icon-only\" color=\"secondary\" size=\"sm\" icon=\"chevron_right\" (buttonClick)=\"navigate(1)\" />\n <ud-button variant=\"stroked\" color=\"secondary\" size=\"sm\" (buttonClick)=\"goToday()\">{{ 'calendar.today' | translate }}</ud-button>\n </div>\n\n <span class=\"ud-cal__period\">{{ headerLabel() }}</span>\n\n <div class=\"ud-cal__header-right\">\n <div class=\"ud-cal__view-switcher\">\n @for (v of viewOptions; track v.id) {\n <button\n class=\"ud-cal__view-btn\"\n [class.ud-cal__view-btn--active]=\"activeView() === v.id\"\n (click)=\"switchView(v.id)\"\n type=\"button\">\n {{ v.label | translate }}\n </button>\n }\n </div>\n @if (mode() === 'admin') {\n <ud-button variant=\"flat\" color=\"primary\" size=\"sm\" icon=\"add\" (buttonClick)=\"openAddModal()\">\n {{ 'calendar.addSlot' | translate }}\n </ud-button>\n }\n </div>\n </div>\n\n <!-- \u2500\u2500 WEEK VIEW \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (activeView() === 'week') {\n <div class=\"ud-cal__week-scroll\" [style.max-height]=\"maxHeight()\">\n <div class=\"ud-cal__week-header\">\n <div class=\"ud-cal__time-gutter\"></div>\n @for (day of weekDays(); track day.toISOString()) {\n <div class=\"ud-cal__day-header\" [class.ud-cal__day-header--today]=\"isToday(day)\">\n <span class=\"ud-cal__day-name\">{{ dayLabel(day) }}</span>\n <span class=\"ud-cal__day-num\" [class.ud-cal__day-num--today]=\"isToday(day)\">{{ dayNum(day) }}</span>\n </div>\n }\n </div>\n <div class=\"ud-cal__week-grid\">\n <div class=\"ud-cal__time-col\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div class=\"ud-cal__time-cell\">\n @if (ts.label) {\n <span class=\"ud-cal__time-label\">{{ ts.label }}</span>\n }\n </div>\n }\n </div>\n @for (day of weekDays(); track day.toISOString()) {\n <div class=\"ud-cal__day-col\" [class.ud-cal__day-col--today]=\"isToday(day)\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div\n class=\"ud-cal__grid-cell\"\n [class.ud-cal__grid-cell--half]=\"ts.minute === 30\"\n [class.ud-cal__grid-cell--disabled]=\"isCellDisabled(day, ts.hour, ts.minute)\"\n (click)=\"onCellClick(day, ts.hour, ts.minute)\">\n </div>\n }\n @for (slot of slotsForDay(day); track slot.id) {\n <div\n class=\"ud-cal__slot\"\n [class]=\"'ud-cal__slot--' + slotDensity(slot)\"\n [class.ud-cal__slot--booked]=\"slot.booked\"\n [class.ud-cal__slot--clickable]=\"mode() === 'admin' || (mode() === 'student' && !slot.booked)\"\n [class.ud-cal__slot--dragging]=\"draggingSlot?.id === slot.id && dragMoved\"\n [style.top.px]=\"slotTop(slot)\"\n [style.height.px]=\"slotHeight(slot)\"\n [style.left.%]=\"slotLeft(slot)\"\n [style.width.%]=\"slotWidth(slot)\"\n [style.background]=\"slotBg(slot)\"\n [style.color]=\"slotTextColor(slot)\"\n [style.border-color]=\"slotBorderColor(slot)\"\n (mouseenter)=\"openHoverCard(slot, $event.currentTarget)\"\n (mouseleave)=\"closeHoverCard()\"\n (mousedown)=\"onSlotMouseDown($event, slot)\">\n <div class=\"ud-cal__slot-inner\">\n @if (slot.booked) {\n <mat-icon class=\"ud-cal__slot-lock\">person</mat-icon>\n }\n @if (slot.title) {\n <span class=\"ud-cal__slot-title\">{{ slot.title }}</span>\n } @else if (slotDensity(slot) === 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n </div>\n @if (slotDensity(slot) !== 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n @if (slotDensity(slot) === 'comfortable' && slot.booked && slot.bookedBy) {\n <span class=\"ud-cal__slot-booked-by\">{{ slot.bookedBy }}</span>\n }\n </div>\n }\n @if (draggingSlot && dragMoved && dragTarget && isSameDay(dragTarget.day, day)) {\n <div\n class=\"ud-cal__slot ud-cal__slot--drag-preview\"\n [style.top.px]=\"previewTop(dragTarget)\"\n [style.height.px]=\"previewHeight()\"\n [style.background]=\"slotBg(draggingSlot)\"\n [style.color]=\"slotTextColor(draggingSlot)\"\n [style.border-color]=\"slotBorderColor(draggingSlot)\">\n @if (draggingSlot.title) {\n <span class=\"ud-cal__slot-title\">{{ draggingSlot.title }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n\n <!-- \u2500\u2500 MONTH VIEW \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (activeView() === 'month') {\n <div class=\"ud-cal__month\">\n <div class=\"ud-cal__month-header\">\n @for (name of monthDayNames; track name) {\n <div class=\"ud-cal__month-day-name\">{{ name | translate }}</div>\n }\n </div>\n <div class=\"ud-cal__month-grid\">\n @for (week of monthWeeks(); track $index) {\n @for (day of week; track day.toISOString()) {\n <div\n class=\"ud-cal__month-cell\"\n [class.ud-cal__month-cell--today]=\"isToday(day)\"\n [class.ud-cal__month-cell--other]=\"!isCurrentMonth(day)\"\n [class.ud-cal__month-cell--disabled]=\"isDayDisabled(day)\"\n (click)=\"clickDay(day)\">\n <span class=\"ud-cal__month-num\" [class.ud-cal__month-num--today]=\"isToday(day)\">\n {{ dayNum(day) }}\n </span>\n <div class=\"ud-cal__month-dots\">\n @for (slot of slotsForDay(day).slice(0, 3); track slot.id) {\n <span\n class=\"ud-cal__month-dot\"\n [style.background]=\"slotBorderColor(slot)\"\n [udTooltip]=\"slot.title ?? formatSlotTime(slot)\">\n </span>\n }\n @if (slotsForDay(day).length > 3) {\n <span class=\"ud-cal__month-more\">+{{ slotsForDay(day).length - 3 }}</span>\n }\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n\n <!-- \u2500\u2500 DAY VIEW \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (activeView() === 'day') {\n <div class=\"ud-cal__week-scroll\" [style.max-height]=\"maxHeight()\">\n <div class=\"ud-cal__week-header\">\n <div class=\"ud-cal__time-gutter\"></div>\n <div class=\"ud-cal__day-header\" [class.ud-cal__day-header--today]=\"isToday(navDate())\">\n <span class=\"ud-cal__day-name\">{{ dayLabel(navDate()) }}</span>\n <span class=\"ud-cal__day-num\" [class.ud-cal__day-num--today]=\"isToday(navDate())\">{{ dayNum(navDate()) }}</span>\n </div>\n </div>\n <div class=\"ud-cal__week-grid\">\n <div class=\"ud-cal__time-col\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div class=\"ud-cal__time-cell\">\n @if (ts.label) {\n <span class=\"ud-cal__time-label\">{{ ts.label }}</span>\n }\n </div>\n }\n </div>\n <div class=\"ud-cal__day-col\" [class.ud-cal__day-col--today]=\"isToday(navDate())\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div\n class=\"ud-cal__grid-cell\"\n [class.ud-cal__grid-cell--half]=\"ts.minute === 30\"\n [class.ud-cal__grid-cell--disabled]=\"isCellDisabled(navDate(), ts.hour, ts.minute)\"\n (click)=\"onCellClick(navDate(), ts.hour, ts.minute)\">\n </div>\n }\n @for (slot of slotsForDay(navDate()); track slot.id) {\n <div\n class=\"ud-cal__slot\"\n [class]=\"'ud-cal__slot--' + slotDensity(slot)\"\n [class.ud-cal__slot--booked]=\"slot.booked\"\n [class.ud-cal__slot--clickable]=\"mode() === 'admin' || (mode() === 'student' && !slot.booked)\"\n [class.ud-cal__slot--dragging]=\"draggingSlot?.id === slot.id && dragMoved\"\n [style.top.px]=\"slotTop(slot)\"\n [style.height.px]=\"slotHeight(slot)\"\n [style.left.%]=\"slotLeft(slot)\"\n [style.width.%]=\"slotWidth(slot)\"\n [style.background]=\"slotBg(slot)\"\n [style.color]=\"slotTextColor(slot)\"\n [style.border-color]=\"slotBorderColor(slot)\"\n (mouseenter)=\"openHoverCard(slot, $event.currentTarget)\"\n (mouseleave)=\"closeHoverCard()\"\n (mousedown)=\"onSlotMouseDown($event, slot)\">\n <div class=\"ud-cal__slot-inner\">\n @if (slot.booked) {\n <mat-icon class=\"ud-cal__slot-lock\">person</mat-icon>\n }\n @if (slot.title) {\n <span class=\"ud-cal__slot-title\">{{ slot.title }}</span>\n } @else if (slotDensity(slot) === 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n </div>\n @if (slotDensity(slot) !== 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n @if (slotDensity(slot) === 'comfortable' && slot.booked && slot.bookedBy) {\n <span class=\"ud-cal__slot-booked-by\">{{ slot.bookedBy }}</span>\n }\n </div>\n }\n @if (draggingSlot && dragMoved && dragTarget) {\n <div\n class=\"ud-cal__slot ud-cal__slot--drag-preview\"\n [style.top.px]=\"previewTop(dragTarget)\"\n [style.height.px]=\"previewHeight()\"\n [style.background]=\"slotBg(draggingSlot)\"\n [style.color]=\"slotTextColor(draggingSlot)\"\n [style.border-color]=\"slotBorderColor(draggingSlot)\">\n @if (draggingSlot.title) {\n <span class=\"ud-cal__slot-title\">{{ draggingSlot.title }}</span>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n\n</div>\n\n<!-- \u2500\u2500 Rich hover card (rendered in a CDK overlay) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n<ng-template #hoverCard>\n @if (hoverSlot(); as s) {\n <div\n class=\"ud-cal__hovercard\"\n [class.ud-cal__hovercard--booked]=\"s.booked\"\n [style.--hc-accent]=\"slotBorderColor(s)\"\n (mouseenter)=\"cancelHoverClose()\"\n (mouseleave)=\"closeHoverCard()\">\n <span class=\"ud-cal__hovercard-bar\"></span>\n <div class=\"ud-cal__hovercard-body\">\n <div class=\"ud-cal__hovercard-head\">\n <span class=\"ud-cal__hovercard-title\">{{ s.title ? s.title : ('calendar.untitledSlot' | translate) }}</span>\n <span class=\"ud-cal__hovercard-pill\" [class.ud-cal__hovercard-pill--booked]=\"s.booked\">\n <span class=\"ud-cal__hovercard-pill-dot\"></span>\n {{ s.booked ? ('calendar.booked' | translate) : ('calendar.available' | translate) }}\n </span>\n </div>\n\n <div class=\"ud-cal__hovercard-row\">\n <mat-icon class=\"ud-cal__hovercard-ico\">schedule</mat-icon>\n <span class=\"ud-cal__hovercard-time\">{{ formatSlotTime(s) }}</span>\n <span class=\"ud-cal__hovercard-dur\">{{ slotDurationLabel(s) }}</span>\n </div>\n\n @if (s.booked && s.bookedBy) {\n <div class=\"ud-cal__hovercard-row ud-cal__hovercard-person\">\n <span class=\"ud-cal__hovercard-avatar\" [style.background]=\"slotBorderColor(s)\">\n {{ slotInitials(s.bookedBy) }}\n </span>\n <span class=\"ud-cal__hovercard-person-name\">{{ s.bookedBy }}</span>\n </div>\n }\n </div>\n </div>\n }\n</ng-template>\n\n", styles: [":host{display:block;width:100%;font-family:Sora,system-ui,sans-serif}.ud-cal{position:relative;background:#fff;border:1px solid var(--eu-border-mid, #d8dde6);border-radius:12px;box-shadow:0 2px 8px #1b25350f;overflow:hidden}.ud-cal__header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--eu-border-light, #e8eaef);gap:12px;flex-wrap:wrap}.ud-cal__nav{display:flex;align-items:center;gap:4px}.ud-cal__period{flex:1;text-align:center;font-size:14px;font-weight:600;color:var(--eu-text, #2a3548);white-space:nowrap}.ud-cal__header-right{display:flex;align-items:center;gap:10px}.ud-cal__view-switcher{display:flex;align-items:center;background:var(--eu-bg, #f4f5f7);border-radius:8px;padding:3px;gap:2px}.ud-cal__view-btn{padding:4px 12px;border:none;border-radius:6px;background:transparent;font-family:Sora,system-ui,sans-serif;font-size:12px;font-weight:500;color:var(--eu-muted, #6b7585);cursor:pointer;transition:background .15s,color .15s}.ud-cal__view-btn--active{background:var(--eu-navy, #1b2535);color:#fff}.ud-cal__view-btn:not(.ud-cal__view-btn--active):hover{background:#1b253514;color:var(--eu-text, #2a3548)}.ud-cal__week-scroll{overflow-y:auto;max-height:580px}.ud-cal__week-header{position:sticky;top:0;z-index:10;display:flex;background:#fafbfc;border-bottom:1px solid var(--eu-border-light, #e8eaef);flex-shrink:0}.ud-cal__time-gutter{width:52px;flex-shrink:0;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__day-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 4px;gap:2px;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__day-header:last-child{border-right:none}.ud-cal__day-header--today{background:#1b25350a}.ud-cal__day-name{font-size:10px;font-weight:600;color:var(--eu-muted, #6b7585);text-transform:uppercase;letter-spacing:.06em}.ud-cal__day-num{font-size:15px;font-weight:600;color:var(--eu-text, #2a3548)}.ud-cal__day-num--today{display:flex;align-items:center;justify-content:center;width:26px;height:26px;background:var(--eu-navy, #1b2535);color:#fff;border-radius:50%;font-size:13px}.ud-cal__week-grid{display:flex}.ud-cal__time-col{width:52px;flex-shrink:0;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__time-cell{height:56px;position:relative;display:flex;align-items:flex-start;justify-content:flex-end;padding:0 6px}.ud-cal__time-label{font-size:10px;color:var(--eu-muted, #9099a8);font-weight:500;white-space:nowrap;margin-top:-6px}.ud-cal__day-col{flex:1;position:relative;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__day-col:last-child{border-right:none}.ud-cal__day-col--today{background:#1b253506}.ud-cal__grid-cell{height:56px;border-bottom:1px solid var(--eu-border-light, #e8eaef);transition:background .1s;cursor:pointer}.ud-cal__grid-cell--half{border-bottom-style:dashed;border-bottom-color:#d8dde673}.ud-cal__grid-cell:hover{background:#1b253508}.ud-cal__grid-cell--disabled{cursor:not-allowed;background:repeating-linear-gradient(135deg,#1b253508,#1b253508 6px,#1b25350f 6px 12px)}.ud-cal__grid-cell--disabled:hover{background:repeating-linear-gradient(135deg,#1b253508,#1b253508 6px,#1b25350f 6px 12px)}.ud-cal__slot{position:absolute;margin-left:2px;box-sizing:border-box;border-left:3px solid;border-radius:6px;padding:3px 6px;display:flex;flex-direction:column;gap:1px;overflow:hidden;z-index:1;transition:filter .15s,transform .1s}.ud-cal__slot--clickable{cursor:grab}.ud-cal__slot--clickable:hover{filter:brightness(.93);transform:translate(1px)}.ud-cal__slot--cozy{padding:2px 6px;gap:0}.ud-cal__slot--compact{padding:1px 6px;gap:0;flex-direction:row;align-items:center;justify-content:flex-start}.ud-cal__slot-inner{display:flex;align-items:center;gap:3px;overflow:hidden;min-width:0}.ud-cal__slot-title{font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2;min-width:0}.ud-cal__slot-time{font-size:10px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.ud-cal__slot--dragging{opacity:.3;pointer-events:none}.ud-cal__slot--drag-preview{left:3px;right:3px;margin-left:0;pointer-events:none;opacity:.75;border-left-style:dashed;border-top:1px dashed currentColor;z-index:2}.ud-cal__slot--booked{border-left-width:4px;box-shadow:inset 0 0 0 1px #1b253514}.ud-cal__slot--booked .ud-cal__slot-title{font-weight:600}.ud-cal__slot:not(.ud-cal__slot--booked){border-left-style:dashed}.ud-cal__slot-lock{font-size:11px!important;width:11px!important;height:11px!important;line-height:11px!important;flex-shrink:0;opacity:.75}.ud-cal__slot-booked-by{font-size:9px;font-weight:500;opacity:.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.01em;margin-top:1px}.ud-cal__month{display:flex;flex-direction:column}.ud-cal__month-header{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--eu-border-light, #e8eaef);background:#fafbfc}.ud-cal__month-day-name{text-align:center;padding:8px 4px;font-size:10px;font-weight:600;color:var(--eu-muted, #6b7585);text-transform:uppercase;letter-spacing:.06em;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__month-day-name:last-child{border-right:none}.ud-cal__month-grid{display:grid;grid-template-columns:repeat(7,1fr)}.ud-cal__month-cell{min-height:80px;padding:6px;border-right:1px solid var(--eu-border-light, #e8eaef);border-bottom:1px solid var(--eu-border-light, #e8eaef);cursor:pointer;transition:background .12s}.ud-cal__month-cell:nth-child(7n){border-right:none}.ud-cal__month-cell:hover{background:#1b253508}.ud-cal__month-cell--today{background:#1b25350a}.ud-cal__month-cell--other{opacity:.4}.ud-cal__month-cell--disabled{cursor:not-allowed;color:#1b253559;background:repeating-linear-gradient(135deg,#1b253505,#1b253505 6px,#1b25350d 6px 12px)}.ud-cal__month-cell--disabled:hover{background:repeating-linear-gradient(135deg,#1b253505,#1b253505 6px,#1b25350d 6px 12px)}.ud-cal__month-num{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;font-size:12px;font-weight:600;color:var(--eu-text, #2a3548);border-radius:50%}.ud-cal__month-num--today{background:var(--eu-navy, #1b2535);color:#fff}.ud-cal__month-dots{display:flex;flex-wrap:wrap;align-items:center;gap:3px;margin-top:4px}.ud-cal__month-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.ud-cal__month-more{font-size:9px;font-weight:600;color:var(--eu-muted, #6b7585)}.ud-cal__hovercard{--hc-accent: var(--eu-navy, #1b2535);position:relative;display:flex;min-width:208px;max-width:288px;background:#fff;border:1px solid var(--eu-border-light, #e8eaef);border-radius:12px;overflow:hidden;font-family:Sora,system-ui,sans-serif;box-shadow:0 1px 2px #1b25350d,0 14px 30px -10px #1b25353d;transform-origin:top left;animation:ud-cal-hovercard-in .17s cubic-bezier(.16,1,.3,1) both}.ud-cal__hovercard:after{content:\"\";position:absolute;inset:0;pointer-events:none;background:linear-gradient(135deg,color-mix(in srgb,var(--hc-accent) 6%,transparent),transparent 55%)}@keyframes ud-cal-hovercard-in{0%{opacity:0;transform:translateY(5px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}.ud-cal__hovercard-bar{width:4px;flex-shrink:0;background:var(--hc-accent)}.ud-cal__hovercard-body{position:relative;z-index:1;flex:1;min-width:0;padding:12px 14px 13px;display:flex;flex-direction:column;gap:9px}.ud-cal__hovercard-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.ud-cal__hovercard-title{font-size:13.5px;font-weight:600;letter-spacing:-.01em;line-height:1.3;color:var(--eu-text, #2a3548);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.ud-cal__hovercard-pill{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;padding:3px 9px 3px 7px;border-radius:999px;font-size:9.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;background:#1b253512;color:#1b253599}.ud-cal__hovercard-pill--booked{background:#1b25351f;color:var(--eu-navy)}.ud-cal__hovercard-pill-dot{width:5px;height:5px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 22%,transparent)}.ud-cal__hovercard-row{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:500;color:var(--eu-muted, #6b7585)}.ud-cal__hovercard-ico{font-size:16px!important;width:16px!important;height:16px!important;line-height:16px!important;color:var(--hc-accent);opacity:.9}.ud-cal__hovercard-time{color:var(--eu-text, #2a3548);font-weight:600;font-variant-numeric:tabular-nums}.ud-cal__hovercard-dur{margin-left:auto;font-size:10px;font-weight:600;color:var(--eu-muted, #6b7585);background:var(--eu-bg, #f4f5f7);border:1px solid var(--eu-border-light, #e8eaef);padding:1px 8px;border-radius:6px;white-space:nowrap}.ud-cal__hovercard-person{padding-top:8px;border-top:1px dashed var(--eu-border-light, #e8eaef)}.ud-cal__hovercard-avatar{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--hc-accent);color:#fff;font-size:9px;font-weight:700;letter-spacing:.03em;flex-shrink:0}.ud-cal__hovercard-person-name{color:var(--eu-text, #2a3548);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: UdButtonComponent, selector: "ud-button", inputs: ["variant", "color", "size", "type", "icon", "iconPosition", "iconFontSet", "loading", "disabled", "ariaLabel", "fullWidth"], outputs: ["buttonClick"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
7506
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: CalendarComponent, isStandalone: true, selector: "ud-calendar", inputs: { slots: { classPropertyName: "slots", publicName: "slots", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, defaultView: { classPropertyName: "defaultView", publicName: "defaultView", isSignal: true, isRequired: false, transformFunction: null }, slotDuration: { classPropertyName: "slotDuration", publicName: "slotDuration", isSignal: true, isRequired: false, transformFunction: null }, minHour: { classPropertyName: "minHour", publicName: "minHour", isSignal: true, isRequired: false, transformFunction: null }, maxHour: { classPropertyName: "maxHour", publicName: "maxHour", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, bookableUsers: { classPropertyName: "bookableUsers", publicName: "bookableUsers", isSignal: true, isRequired: false, transformFunction: null }, minSlotStart: { classPropertyName: "minSlotStart", publicName: "minSlotStart", isSignal: true, isRequired: false, transformFunction: null }, defaultDate: { classPropertyName: "defaultDate", publicName: "defaultDate", isSignal: true, isRequired: false, transformFunction: null }, rescheduleContext: { classPropertyName: "rescheduleContext", publicName: "rescheduleContext", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { slotAdded: "slotAdded", slotUpdated: "slotUpdated", slotRemoved: "slotRemoved", slotBooked: "slotBooked", slotBlocked: "slotBlocked" }, host: { listeners: { "document:mousemove": "onDocMouseMove($event)", "document:mouseup": "onDocMouseUp($event)" } }, viewQueries: [{ propertyName: "hoverCardTpl", first: true, predicate: ["hoverCard"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ud-cal\" #calendarHost>\n\n <!-- Header -->\n <div class=\"ud-cal__header\">\n <div class=\"ud-cal__nav\">\n <ud-button variant=\"icon-only\" color=\"secondary\" size=\"sm\" icon=\"chevron_left\" (buttonClick)=\"navigate(-1)\" />\n <ud-button variant=\"icon-only\" color=\"secondary\" size=\"sm\" icon=\"chevron_right\" (buttonClick)=\"navigate(1)\" />\n <ud-button variant=\"stroked\" color=\"secondary\" size=\"sm\" (buttonClick)=\"goToday()\">{{ 'calendar.today' | translate }}</ud-button>\n </div>\n\n <span class=\"ud-cal__period\">{{ headerLabel() }}</span>\n\n <div class=\"ud-cal__header-right\">\n <div class=\"ud-cal__view-switcher\">\n @for (v of viewOptions; track v.id) {\n <button\n class=\"ud-cal__view-btn\"\n [class.ud-cal__view-btn--active]=\"activeView() === v.id\"\n (click)=\"switchView(v.id)\"\n type=\"button\">\n {{ v.label | translate }}\n </button>\n }\n </div>\n @if (mode() === 'admin') {\n <ud-button variant=\"flat\" color=\"primary\" size=\"sm\" icon=\"add\" (buttonClick)=\"openAddModal()\">\n {{ 'calendar.addSlot' | translate }}\n </ud-button>\n }\n </div>\n </div>\n\n <!-- \u2500\u2500 WEEK VIEW \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (activeView() === 'week') {\n <div class=\"ud-cal__week-scroll\" [style.max-height]=\"maxHeight()\">\n <div class=\"ud-cal__week-header\">\n <div class=\"ud-cal__time-gutter\"></div>\n @for (day of weekDays(); track day.toISOString()) {\n <div class=\"ud-cal__day-header\" [class.ud-cal__day-header--today]=\"isToday(day)\">\n <span class=\"ud-cal__day-name\">{{ dayLabel(day) }}</span>\n <span class=\"ud-cal__day-num\" [class.ud-cal__day-num--today]=\"isToday(day)\">{{ dayNum(day) }}</span>\n </div>\n }\n </div>\n <div class=\"ud-cal__week-grid\">\n <div class=\"ud-cal__time-col\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div class=\"ud-cal__time-cell\">\n @if (ts.label) {\n <span class=\"ud-cal__time-label\">{{ ts.label }}</span>\n }\n </div>\n }\n </div>\n @for (day of weekDays(); track day.toISOString()) {\n <div class=\"ud-cal__day-col\" [class.ud-cal__day-col--today]=\"isToday(day)\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div\n class=\"ud-cal__grid-cell\"\n [class.ud-cal__grid-cell--half]=\"ts.minute === 30\"\n [class.ud-cal__grid-cell--disabled]=\"isCellDisabled(day, ts.hour, ts.minute)\"\n (click)=\"onCellClick(day, ts.hour, ts.minute)\">\n </div>\n }\n @for (slot of slotsForDay(day); track slot.id) {\n <div\n class=\"ud-cal__slot\"\n [class]=\"'ud-cal__slot--' + slotDensity(slot)\"\n [class.ud-cal__slot--booked]=\"slot.booked\"\n [class.ud-cal__slot--clickable]=\"mode() === 'admin' || (mode() === 'student' && !slot.booked)\"\n [class.ud-cal__slot--dragging]=\"draggingSlot?.id === slot.id && dragMoved\"\n [style.top.px]=\"slotTop(slot)\"\n [style.height.px]=\"slotHeight(slot)\"\n [style.left.%]=\"slotLeft(slot)\"\n [style.width.%]=\"slotWidth(slot)\"\n [style.background]=\"slotBg(slot)\"\n [style.color]=\"slotTextColor(slot)\"\n [style.border-color]=\"slotBorderColor(slot)\"\n (mouseenter)=\"openHoverCard(slot, $event.currentTarget)\"\n (mouseleave)=\"closeHoverCard()\"\n (mousedown)=\"onSlotMouseDown($event, slot)\">\n <div class=\"ud-cal__slot-inner\">\n @if (slot.booked) {\n <mat-icon class=\"ud-cal__slot-lock\">person</mat-icon>\n }\n @if (slot.title) {\n <span class=\"ud-cal__slot-title\">{{ slot.title }}</span>\n } @else if (slotDensity(slot) === 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n </div>\n @if (slotDensity(slot) !== 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n @if (slotDensity(slot) === 'comfortable' && slot.booked && slot.bookedBy) {\n <span class=\"ud-cal__slot-booked-by\">{{ slot.bookedBy }}</span>\n }\n </div>\n }\n @if (draggingSlot && dragMoved && dragTarget && isSameDay(dragTarget.day, day)) {\n <div\n class=\"ud-cal__slot ud-cal__slot--drag-preview\"\n [style.top.px]=\"previewTop(dragTarget)\"\n [style.height.px]=\"previewHeight()\"\n [style.background]=\"slotBg(draggingSlot)\"\n [style.color]=\"slotTextColor(draggingSlot)\"\n [style.border-color]=\"slotBorderColor(draggingSlot)\">\n @if (draggingSlot.title) {\n <span class=\"ud-cal__slot-title\">{{ draggingSlot.title }}</span>\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n }\n\n <!-- \u2500\u2500 MONTH VIEW \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (activeView() === 'month') {\n <div class=\"ud-cal__month\">\n <div class=\"ud-cal__month-header\">\n @for (name of monthDayNames; track name) {\n <div class=\"ud-cal__month-day-name\">{{ name | translate }}</div>\n }\n </div>\n <div class=\"ud-cal__month-grid\">\n @for (week of monthWeeks(); track $index) {\n @for (day of week; track day.toISOString()) {\n <div\n class=\"ud-cal__month-cell\"\n [class.ud-cal__month-cell--today]=\"isToday(day)\"\n [class.ud-cal__month-cell--other]=\"!isCurrentMonth(day)\"\n [class.ud-cal__month-cell--disabled]=\"isDayDisabled(day)\"\n (click)=\"clickDay(day)\">\n <span class=\"ud-cal__month-num\" [class.ud-cal__month-num--today]=\"isToday(day)\">\n {{ dayNum(day) }}\n </span>\n <div class=\"ud-cal__month-dots\">\n @for (slot of slotsForDay(day).slice(0, 3); track slot.id) {\n <span\n class=\"ud-cal__month-dot\"\n [style.background]=\"slotBorderColor(slot)\"\n [udTooltip]=\"slot.title ?? formatSlotTime(slot)\">\n </span>\n }\n @if (slotsForDay(day).length > 3) {\n <span class=\"ud-cal__month-more\">+{{ slotsForDay(day).length - 3 }}</span>\n }\n </div>\n </div>\n }\n }\n </div>\n </div>\n }\n\n <!-- \u2500\u2500 DAY VIEW \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n @if (activeView() === 'day') {\n <div class=\"ud-cal__week-scroll\" [style.max-height]=\"maxHeight()\">\n <div class=\"ud-cal__week-header\">\n <div class=\"ud-cal__time-gutter\"></div>\n <div class=\"ud-cal__day-header\" [class.ud-cal__day-header--today]=\"isToday(navDate())\">\n <span class=\"ud-cal__day-name\">{{ dayLabel(navDate()) }}</span>\n <span class=\"ud-cal__day-num\" [class.ud-cal__day-num--today]=\"isToday(navDate())\">{{ dayNum(navDate()) }}</span>\n </div>\n </div>\n <div class=\"ud-cal__week-grid\">\n <div class=\"ud-cal__time-col\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div class=\"ud-cal__time-cell\">\n @if (ts.label) {\n <span class=\"ud-cal__time-label\">{{ ts.label }}</span>\n }\n </div>\n }\n </div>\n <div class=\"ud-cal__day-col\" [class.ud-cal__day-col--today]=\"isToday(navDate())\">\n @for (ts of timeSlots(); track ts.hour + ':' + ts.minute) {\n <div\n class=\"ud-cal__grid-cell\"\n [class.ud-cal__grid-cell--half]=\"ts.minute === 30\"\n [class.ud-cal__grid-cell--disabled]=\"isCellDisabled(navDate(), ts.hour, ts.minute)\"\n (click)=\"onCellClick(navDate(), ts.hour, ts.minute)\">\n </div>\n }\n @for (slot of slotsForDay(navDate()); track slot.id) {\n <div\n class=\"ud-cal__slot\"\n [class]=\"'ud-cal__slot--' + slotDensity(slot)\"\n [class.ud-cal__slot--booked]=\"slot.booked\"\n [class.ud-cal__slot--clickable]=\"mode() === 'admin' || (mode() === 'student' && !slot.booked)\"\n [class.ud-cal__slot--dragging]=\"draggingSlot?.id === slot.id && dragMoved\"\n [style.top.px]=\"slotTop(slot)\"\n [style.height.px]=\"slotHeight(slot)\"\n [style.left.%]=\"slotLeft(slot)\"\n [style.width.%]=\"slotWidth(slot)\"\n [style.background]=\"slotBg(slot)\"\n [style.color]=\"slotTextColor(slot)\"\n [style.border-color]=\"slotBorderColor(slot)\"\n (mouseenter)=\"openHoverCard(slot, $event.currentTarget)\"\n (mouseleave)=\"closeHoverCard()\"\n (mousedown)=\"onSlotMouseDown($event, slot)\">\n <div class=\"ud-cal__slot-inner\">\n @if (slot.booked) {\n <mat-icon class=\"ud-cal__slot-lock\">person</mat-icon>\n }\n @if (slot.title) {\n <span class=\"ud-cal__slot-title\">{{ slot.title }}</span>\n } @else if (slotDensity(slot) === 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n </div>\n @if (slotDensity(slot) !== 'compact') {\n <span class=\"ud-cal__slot-time\">{{ formatSlotTime(slot) }}</span>\n }\n @if (slotDensity(slot) === 'comfortable' && slot.booked && slot.bookedBy) {\n <span class=\"ud-cal__slot-booked-by\">{{ slot.bookedBy }}</span>\n }\n </div>\n }\n @if (draggingSlot && dragMoved && dragTarget) {\n <div\n class=\"ud-cal__slot ud-cal__slot--drag-preview\"\n [style.top.px]=\"previewTop(dragTarget)\"\n [style.height.px]=\"previewHeight()\"\n [style.background]=\"slotBg(draggingSlot)\"\n [style.color]=\"slotTextColor(draggingSlot)\"\n [style.border-color]=\"slotBorderColor(draggingSlot)\">\n @if (draggingSlot.title) {\n <span class=\"ud-cal__slot-title\">{{ draggingSlot.title }}</span>\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n\n</div>\n\n<!-- \u2500\u2500 Rich hover card (rendered in a CDK overlay) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 -->\n<ng-template #hoverCard>\n @if (hoverSlot(); as s) {\n <div\n class=\"ud-cal__hovercard\"\n [class.ud-cal__hovercard--booked]=\"s.booked\"\n [style.--hc-accent]=\"slotBorderColor(s)\"\n (mouseenter)=\"cancelHoverClose()\"\n (mouseleave)=\"closeHoverCard()\">\n <span class=\"ud-cal__hovercard-bar\"></span>\n <div class=\"ud-cal__hovercard-body\">\n <div class=\"ud-cal__hovercard-head\">\n <span class=\"ud-cal__hovercard-title\">{{ s.title ? s.title : ('calendar.untitledSlot' | translate) }}</span>\n <span class=\"ud-cal__hovercard-pill\" [class.ud-cal__hovercard-pill--booked]=\"s.booked\">\n <span class=\"ud-cal__hovercard-pill-dot\"></span>\n {{ s.booked ? ('calendar.booked' | translate) : ('calendar.available' | translate) }}\n </span>\n </div>\n\n <div class=\"ud-cal__hovercard-row\">\n <mat-icon class=\"ud-cal__hovercard-ico\">schedule</mat-icon>\n <span class=\"ud-cal__hovercard-time\">{{ formatSlotTime(s) }}</span>\n <span class=\"ud-cal__hovercard-dur\">{{ slotDurationLabel(s) }}</span>\n </div>\n\n @if (s.booked && s.bookedBy) {\n <div class=\"ud-cal__hovercard-row ud-cal__hovercard-person\">\n <span class=\"ud-cal__hovercard-avatar\" [style.background]=\"slotBorderColor(s)\">\n {{ slotInitials(s.bookedBy) }}\n </span>\n <span class=\"ud-cal__hovercard-person-name\">{{ s.bookedBy }}</span>\n </div>\n }\n </div>\n </div>\n }\n</ng-template>\n\n", styles: [":host{display:block;width:100%;font-family:Sora,system-ui,sans-serif}.ud-cal{position:relative;background:#fff;border:1px solid var(--eu-border-mid, #d8dde6);border-radius:12px;box-shadow:0 2px 8px #1b25350f;overflow:hidden}.ud-cal__header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--eu-border-light, #e8eaef);gap:12px;flex-wrap:wrap}.ud-cal__nav{display:flex;align-items:center;gap:4px}.ud-cal__period{flex:1;text-align:center;font-size:14px;font-weight:600;color:var(--eu-text, #2a3548);white-space:nowrap}.ud-cal__header-right{display:flex;align-items:center;gap:10px}.ud-cal__view-switcher{display:flex;align-items:center;background:var(--eu-bg, #f4f5f7);border-radius:8px;padding:3px;gap:2px}.ud-cal__view-btn{padding:4px 12px;border:none;border-radius:6px;background:transparent;font-family:Sora,system-ui,sans-serif;font-size:12px;font-weight:500;color:var(--eu-muted, #6b7585);cursor:pointer;transition:background .15s,color .15s}.ud-cal__view-btn--active{background:var(--eu-navy, #1b2535);color:#fff}.ud-cal__view-btn:not(.ud-cal__view-btn--active):hover{background:#1b253514;color:var(--eu-text, #2a3548)}.ud-cal__week-scroll{overflow-y:auto;max-height:580px}.ud-cal__week-header{position:sticky;top:0;z-index:10;display:flex;background:#fafbfc;border-bottom:1px solid var(--eu-border-light, #e8eaef);flex-shrink:0}.ud-cal__time-gutter{width:52px;flex-shrink:0;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__day-header{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 4px;gap:2px;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__day-header:last-child{border-right:none}.ud-cal__day-header--today{background:#1b25350a}.ud-cal__day-name{font-size:10px;font-weight:600;color:var(--eu-muted, #6b7585);text-transform:uppercase;letter-spacing:.06em}.ud-cal__day-num{font-size:15px;font-weight:600;color:var(--eu-text, #2a3548)}.ud-cal__day-num--today{display:flex;align-items:center;justify-content:center;width:26px;height:26px;background:var(--eu-navy, #1b2535);color:#fff;border-radius:50%;font-size:13px}.ud-cal__week-grid{display:flex}.ud-cal__time-col{width:52px;flex-shrink:0;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__time-cell{height:56px;position:relative;display:flex;align-items:flex-start;justify-content:flex-end;padding:0 6px}.ud-cal__time-label{font-size:10px;color:var(--eu-muted, #9099a8);font-weight:500;white-space:nowrap;margin-top:-6px}.ud-cal__day-col{flex:1;position:relative;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__day-col:last-child{border-right:none}.ud-cal__day-col--today{background:#1b253506}.ud-cal__grid-cell{height:56px;border-bottom:1px solid var(--eu-border-light, #e8eaef);transition:background .1s;cursor:pointer}.ud-cal__grid-cell--half{border-bottom-style:dashed;border-bottom-color:#d8dde673}.ud-cal__grid-cell:hover{background:#1b253508}.ud-cal__grid-cell--disabled{cursor:not-allowed;background:repeating-linear-gradient(135deg,#1b253508,#1b253508 6px,#1b25350f 6px 12px)}.ud-cal__grid-cell--disabled:hover{background:repeating-linear-gradient(135deg,#1b253508,#1b253508 6px,#1b25350f 6px 12px)}.ud-cal__slot{position:absolute;margin-left:2px;box-sizing:border-box;border-left:3px solid;border-radius:6px;padding:3px 6px;display:flex;flex-direction:column;gap:1px;overflow:hidden;z-index:1;transition:filter .15s,transform .1s}.ud-cal__slot--clickable{cursor:grab}.ud-cal__slot--clickable:hover{filter:brightness(.93);transform:translate(1px)}.ud-cal__slot--cozy{padding:2px 6px;gap:0}.ud-cal__slot--compact{padding:1px 6px;gap:0;flex-direction:row;align-items:center;justify-content:flex-start}.ud-cal__slot-inner{display:flex;align-items:center;gap:3px;overflow:hidden;min-width:0}.ud-cal__slot-title{font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2;min-width:0}.ud-cal__slot-time{font-size:10px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.ud-cal__slot--dragging{opacity:.3;pointer-events:none}.ud-cal__slot--drag-preview{left:3px;right:3px;margin-left:0;pointer-events:none;opacity:.75;border-left-style:dashed;border-top:1px dashed currentColor;z-index:2}.ud-cal__slot--booked{border-left-width:4px;box-shadow:inset 0 0 0 1px #1b253514}.ud-cal__slot--booked .ud-cal__slot-title{font-weight:600}.ud-cal__slot:not(.ud-cal__slot--booked){border-left-style:dashed}.ud-cal__slot-lock{font-size:11px!important;width:11px!important;height:11px!important;line-height:11px!important;flex-shrink:0;opacity:.75}.ud-cal__slot-booked-by{font-size:9px;font-weight:500;opacity:.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.01em;margin-top:1px}.ud-cal__month{display:flex;flex-direction:column}.ud-cal__month-header{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--eu-border-light, #e8eaef);background:#fafbfc}.ud-cal__month-day-name{text-align:center;padding:8px 4px;font-size:10px;font-weight:600;color:var(--eu-muted, #6b7585);text-transform:uppercase;letter-spacing:.06em;border-right:1px solid var(--eu-border-light, #e8eaef)}.ud-cal__month-day-name:last-child{border-right:none}.ud-cal__month-grid{display:grid;grid-template-columns:repeat(7,1fr)}.ud-cal__month-cell{min-height:80px;padding:6px;border-right:1px solid var(--eu-border-light, #e8eaef);border-bottom:1px solid var(--eu-border-light, #e8eaef);cursor:pointer;transition:background .12s}.ud-cal__month-cell:nth-child(7n){border-right:none}.ud-cal__month-cell:hover{background:#1b253508}.ud-cal__month-cell--today{background:#1b25350a}.ud-cal__month-cell--other{opacity:.4}.ud-cal__month-cell--disabled{cursor:not-allowed;color:#1b253559;background:repeating-linear-gradient(135deg,#1b253505,#1b253505 6px,#1b25350d 6px 12px)}.ud-cal__month-cell--disabled:hover{background:repeating-linear-gradient(135deg,#1b253505,#1b253505 6px,#1b25350d 6px 12px)}.ud-cal__month-num{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;font-size:12px;font-weight:600;color:var(--eu-text, #2a3548);border-radius:50%}.ud-cal__month-num--today{background:var(--eu-navy, #1b2535);color:#fff}.ud-cal__month-dots{display:flex;flex-wrap:wrap;align-items:center;gap:3px;margin-top:4px}.ud-cal__month-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.ud-cal__month-more{font-size:9px;font-weight:600;color:var(--eu-muted, #6b7585)}.ud-cal__hovercard{--hc-accent: var(--eu-navy, #1b2535);position:relative;display:flex;min-width:208px;max-width:288px;background:#fff;border:1px solid var(--eu-border-light, #e8eaef);border-radius:12px;overflow:hidden;font-family:Sora,system-ui,sans-serif;box-shadow:0 1px 2px #1b25350d,0 14px 30px -10px #1b25353d;transform-origin:top left;animation:ud-cal-hovercard-in .17s cubic-bezier(.16,1,.3,1) both}.ud-cal__hovercard:after{content:\"\";position:absolute;inset:0;pointer-events:none;background:linear-gradient(135deg,color-mix(in srgb,var(--hc-accent) 6%,transparent),transparent 55%)}@keyframes ud-cal-hovercard-in{0%{opacity:0;transform:translateY(5px) scale(.96)}to{opacity:1;transform:translateY(0) scale(1)}}.ud-cal__hovercard-bar{width:4px;flex-shrink:0;background:var(--hc-accent)}.ud-cal__hovercard-body{position:relative;z-index:1;flex:1;min-width:0;padding:12px 14px 13px;display:flex;flex-direction:column;gap:9px}.ud-cal__hovercard-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.ud-cal__hovercard-title{font-size:13.5px;font-weight:600;letter-spacing:-.01em;line-height:1.3;color:var(--eu-text, #2a3548);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.ud-cal__hovercard-pill{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;padding:3px 9px 3px 7px;border-radius:999px;font-size:9.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;background:#1b253512;color:#1b253599}.ud-cal__hovercard-pill--booked{background:#1b25351f;color:var(--eu-navy)}.ud-cal__hovercard-pill-dot{width:5px;height:5px;border-radius:50%;background:currentColor;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 22%,transparent)}.ud-cal__hovercard-row{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:500;color:var(--eu-muted, #6b7585)}.ud-cal__hovercard-ico{font-size:16px!important;width:16px!important;height:16px!important;line-height:16px!important;color:var(--hc-accent);opacity:.9}.ud-cal__hovercard-time{color:var(--eu-text, #2a3548);font-weight:600;font-variant-numeric:tabular-nums}.ud-cal__hovercard-dur{margin-left:auto;font-size:10px;font-weight:600;color:var(--eu-muted, #6b7585);background:var(--eu-bg, #f4f5f7);border:1px solid var(--eu-border-light, #e8eaef);padding:1px 8px;border-radius:6px;white-space:nowrap}.ud-cal__hovercard-person{padding-top:8px;border-top:1px dashed var(--eu-border-light, #e8eaef)}.ud-cal__hovercard-avatar{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--hc-accent);color:#fff;font-size:9px;font-weight:700;letter-spacing:.03em;flex-shrink:0}.ud-cal__hovercard-person-name{color:var(--eu-text, #2a3548);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay", "udTooltipFollowPointer"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: UdButtonComponent, selector: "ud-button", inputs: ["variant", "color", "size", "type", "icon", "iconPosition", "iconFontSet", "loading", "disabled", "ariaLabel", "fullWidth"], outputs: ["buttonClick"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
7106
7507
|
}
|
|
7107
7508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
7108
7509
|
type: Component,
|
|
@@ -7394,6 +7795,12 @@ const en = {
|
|
|
7394
7795
|
},
|
|
7395
7796
|
weekdays: { 0: 'S', 1: 'M', 2: 'T', 3: 'W', 4: 'T', 5: 'F', 6: 'S' },
|
|
7396
7797
|
},
|
|
7798
|
+
timelineGrid: {
|
|
7799
|
+
lanes: 'Lanes',
|
|
7800
|
+
empty: 'Nothing to show',
|
|
7801
|
+
createCell: '{{lane}}, press Enter to start a new entry',
|
|
7802
|
+
openEnded: 'open-ended',
|
|
7803
|
+
},
|
|
7397
7804
|
};
|
|
7398
7805
|
const fr = {
|
|
7399
7806
|
actions: {
|
|
@@ -7500,6 +7907,12 @@ const fr = {
|
|
|
7500
7907
|
},
|
|
7501
7908
|
weekdays: { 0: 'D', 1: 'L', 2: 'M', 3: 'M', 4: 'J', 5: 'V', 6: 'S' },
|
|
7502
7909
|
},
|
|
7910
|
+
timelineGrid: {
|
|
7911
|
+
lanes: 'Lignes',
|
|
7912
|
+
empty: 'Rien à afficher',
|
|
7913
|
+
createCell: '{{lane}}, appuyez sur Entrée pour créer une entrée',
|
|
7914
|
+
openEnded: 'sans fin',
|
|
7915
|
+
},
|
|
7503
7916
|
};
|
|
7504
7917
|
/** Languages the library ships strings for. */
|
|
7505
7918
|
const UD_COMPONENTS_TRANSLATIONS = {
|
|
@@ -7612,6 +8025,8 @@ var FeatureFlagKey;
|
|
|
7612
8025
|
FeatureFlagKey["UNIVERSITY_TIMEZONE"] = "UNIVERSITY_TIMEZONE";
|
|
7613
8026
|
// The quoted total on the student's stay summary in the student app.
|
|
7614
8027
|
FeatureFlagKey["SHOW_TOTAL_QUOTE_FOR_STUDENT"] = "SHOW_TOTAL_QUOTE_FOR_STUDENT";
|
|
8028
|
+
// Parking lots, spaces, assignments and the waitlist.
|
|
8029
|
+
FeatureFlagKey["PARKING"] = "PARKING";
|
|
7615
8030
|
})(FeatureFlagKey || (FeatureFlagKey = {}));
|
|
7616
8031
|
|
|
7617
8032
|
var LoadingStatus;
|
|
@@ -7679,5 +8094,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
|
|
|
7679
8094
|
* Generated bundle index. Do not edit.
|
|
7680
8095
|
*/
|
|
7681
8096
|
|
|
7682
|
-
export { AppShellComponent, ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, CheckboxComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, GROUP_ROW_HEIGHT, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MoneyInputComponent, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SIDENAV_LOGO, SIDENAV_LOGO_COLLAPSED, SafePipe, SidenavComponent, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdMenuComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, UdTooltipComponent, UdTooltipDirective, activeNavRoute, addDays, assignLanes, barGeometry, buildRows, capitalize, centsToMoney, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMoney, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, groupThousands, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, moneyToCents, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, parseMoney, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
|
|
8097
|
+
export { AppShellComponent, ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, CheckboxComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, GROUP_ROW_HEIGHT, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MoneyInputComponent, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SIDENAV_LOGO, SIDENAV_LOGO_COLLAPSED, SafePipe, SidenavComponent, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TIMELINE_GRID_DEFAULT_LEGEND, TIMELINE_GRID_HEADER_HEIGHT, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, TimelineGridComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdMenuComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, UdTooltipComponent, UdTooltipDirective, activeNavRoute, addDays, assignLanes, barGeometry, buildRows, capitalize, centsToMoney, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMoney, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, groupThousands, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, moneyToCents, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, parseMoney, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
|
|
7683
8098
|
//# sourceMappingURL=ud-components.mjs.map
|