ud-components 0.6.0 → 0.7.0
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/fesm2022/ud-components.mjs +1230 -2
- package/fesm2022/ud-components.mjs.map +1 -1
- package/i18n/ud-components-translate-loader.d.ts +32 -0
- package/i18n/ud-components.translations.d.ts +32 -0
- package/lib/occupancy-grid/local-date.d.ts +13 -0
- package/lib/occupancy-grid/occupancy-grid.component.d.ts +236 -0
- package/lib/occupancy-grid/occupancy-grid.interface.d.ts +105 -0
- package/lib/occupancy-grid/occupancy-grid.layout.d.ts +98 -0
- package/package.json +2 -26
- package/public-api.d.ts +6 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1$2 from '@angular/common';
|
|
2
2
|
import { CommonModule, formatDate, NgClass, AsyncPipe, NgStyle, DatePipe, NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { ViewChild, Input, CUSTOM_ELEMENTS_SCHEMA, Component, Inject, Pipe, inject, EventEmitter, forwardRef, Output, HostBinding, Optional, Injectable, DestroyRef, isSignal, TemplateRef, ContentChild, ViewContainerRef, Directive, ContentChildren, input, effect,
|
|
4
|
+
import { ViewChild, Input, CUSTOM_ELEMENTS_SCHEMA, Component, Inject, Pipe, inject, EventEmitter, forwardRef, Output, HostBinding, Optional, Injectable, DestroyRef, isSignal, TemplateRef, ContentChild, ViewContainerRef, Directive, ContentChildren, input, effect, output, viewChild, signal, computed, ChangeDetectionStrategy, ViewChildren, ElementRef, HostListener } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, ControlContainer, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl, FormGroupDirective, FormGroup, Validators } from '@angular/forms';
|
|
7
7
|
import * as i1$1 from '@angular/material/snack-bar';
|
|
@@ -1260,6 +1260,18 @@ class AutocompleteComponent {
|
|
|
1260
1260
|
this.formControl.valueChanges
|
|
1261
1261
|
.pipe(takeUntil(this.destroy$))
|
|
1262
1262
|
.subscribe(value => {
|
|
1263
|
+
// Cleared is a value like any other, and it used to be the one case
|
|
1264
|
+
// this ignored: labelMap has no entry for null, so the guard below fell
|
|
1265
|
+
// through and left the previous selection's text sitting in the box.
|
|
1266
|
+
// A parent that resets the control — because the choice above it
|
|
1267
|
+
// changed and this one no longer applies — got a field that still named
|
|
1268
|
+
// the old answer while holding none.
|
|
1269
|
+
if (value === null || value === undefined || value === '') {
|
|
1270
|
+
if (this.searchControl.value) {
|
|
1271
|
+
this.searchControl.setValue('', { emitEvent: false });
|
|
1272
|
+
}
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1263
1275
|
const label = this.labelMap.get(value);
|
|
1264
1276
|
if (label !== undefined && this.searchControl.value !== label) {
|
|
1265
1277
|
this.searchControl.setValue(label, { emitEvent: false });
|
|
@@ -3497,6 +3509,935 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
3497
3509
|
type: Input
|
|
3498
3510
|
}] } });
|
|
3499
3511
|
|
|
3512
|
+
/**
|
|
3513
|
+
* Calendar-date arithmetic on YYYY-MM-DD strings, with no `new Date(string)`.
|
|
3514
|
+
*
|
|
3515
|
+
* A bare date parses as UTC midnight in JavaScript, which west of Greenwich is
|
|
3516
|
+
* the previous evening, and a grid column that is off by one is exactly the
|
|
3517
|
+
* bug this component exists to make visible. Days are counted on UTC epoch
|
|
3518
|
+
* days from numeric parts, so DST transitions cannot move a column either.
|
|
3519
|
+
*/
|
|
3520
|
+
const MS_PER_DAY = 86_400_000;
|
|
3521
|
+
const ISO = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
3522
|
+
function isIsoDate(value) {
|
|
3523
|
+
return typeof value === 'string' && ISO.test(value);
|
|
3524
|
+
}
|
|
3525
|
+
/** Days since 1970-01-01 for a YYYY-MM-DD string. Throws on anything else. */
|
|
3526
|
+
function epochDay(iso) {
|
|
3527
|
+
const m = ISO.exec(iso);
|
|
3528
|
+
if (!m) {
|
|
3529
|
+
throw new Error(`Not a YYYY-MM-DD date: '${iso}'`);
|
|
3530
|
+
}
|
|
3531
|
+
return Math.round(Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3])) / MS_PER_DAY);
|
|
3532
|
+
}
|
|
3533
|
+
/** `b - a` in whole days. Positive when b is after a. */
|
|
3534
|
+
function daysBetween(a, b) {
|
|
3535
|
+
return epochDay(b) - epochDay(a);
|
|
3536
|
+
}
|
|
3537
|
+
function addDays(iso, days) {
|
|
3538
|
+
const d = new Date((epochDay(iso) + days) * MS_PER_DAY);
|
|
3539
|
+
return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}-${String(d.getUTCDate()).padStart(2, '0')}`;
|
|
3540
|
+
}
|
|
3541
|
+
/** 0 = Sunday … 6 = Saturday, for the calendar date itself. */
|
|
3542
|
+
function weekday(iso) {
|
|
3543
|
+
// 1970-01-01 was a Thursday (4).
|
|
3544
|
+
return (((epochDay(iso) + 4) % 7) + 7) % 7;
|
|
3545
|
+
}
|
|
3546
|
+
function monthOf(iso) {
|
|
3547
|
+
return Number(iso.slice(5, 7));
|
|
3548
|
+
}
|
|
3549
|
+
function yearOf(iso) {
|
|
3550
|
+
return Number(iso.slice(0, 4));
|
|
3551
|
+
}
|
|
3552
|
+
function dayOfMonth(iso) {
|
|
3553
|
+
return Number(iso.slice(8, 10));
|
|
3554
|
+
}
|
|
3555
|
+
function maxIso(a, b) {
|
|
3556
|
+
return a >= b ? a : b;
|
|
3557
|
+
}
|
|
3558
|
+
function minIso(a, b) {
|
|
3559
|
+
return a <= b ? a : b;
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3562
|
+
const numeric = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
|
|
3563
|
+
/** Greedy interval packing. Half-open, so a bar starting the day another ends shares its lane. */
|
|
3564
|
+
function assignLanes(bars) {
|
|
3565
|
+
const sorted = [...bars].sort((a, b) => a.startDate.localeCompare(b.startDate) ||
|
|
3566
|
+
a.bookingId.localeCompare(b.bookingId));
|
|
3567
|
+
const laneEnds = [];
|
|
3568
|
+
return sorted.map(bar => {
|
|
3569
|
+
let lane = laneEnds.findIndex(end => end <= bar.startDate);
|
|
3570
|
+
if (lane === -1) {
|
|
3571
|
+
lane = laneEnds.length;
|
|
3572
|
+
laneEnds.push(bar.endDate);
|
|
3573
|
+
}
|
|
3574
|
+
else {
|
|
3575
|
+
laneEnds[lane] = bar.endDate;
|
|
3576
|
+
}
|
|
3577
|
+
return { bar, lane };
|
|
3578
|
+
});
|
|
3579
|
+
}
|
|
3580
|
+
/** dorm › floor › type › rooms, as a flat list with group headers. Collapsed groups hide their rooms. */
|
|
3581
|
+
function buildRows(rooms, dormName, collapsed) {
|
|
3582
|
+
const rows = [];
|
|
3583
|
+
if (rooms.length === 0) {
|
|
3584
|
+
return rows;
|
|
3585
|
+
}
|
|
3586
|
+
const dormKey = `dorm:${dormName}`;
|
|
3587
|
+
rows.push({
|
|
3588
|
+
kind: 'group',
|
|
3589
|
+
key: dormKey,
|
|
3590
|
+
depth: 0,
|
|
3591
|
+
label: dormName,
|
|
3592
|
+
roomCount: rooms.length,
|
|
3593
|
+
});
|
|
3594
|
+
if (collapsed.has(dormKey)) {
|
|
3595
|
+
return rows;
|
|
3596
|
+
}
|
|
3597
|
+
const byFloor = new Map();
|
|
3598
|
+
for (const room of rooms) {
|
|
3599
|
+
const list = byFloor.get(room.floorLevel) ?? [];
|
|
3600
|
+
list.push(room);
|
|
3601
|
+
byFloor.set(room.floorLevel, list);
|
|
3602
|
+
}
|
|
3603
|
+
for (const floorLevel of [...byFloor.keys()].sort(numeric)) {
|
|
3604
|
+
const floorRooms = byFloor.get(floorLevel);
|
|
3605
|
+
const floorKey = `${dormKey}/floor:${floorLevel}`;
|
|
3606
|
+
rows.push({
|
|
3607
|
+
kind: 'group',
|
|
3608
|
+
key: floorKey,
|
|
3609
|
+
depth: 1,
|
|
3610
|
+
label: floorLevel,
|
|
3611
|
+
roomCount: floorRooms.length,
|
|
3612
|
+
});
|
|
3613
|
+
if (collapsed.has(floorKey)) {
|
|
3614
|
+
continue;
|
|
3615
|
+
}
|
|
3616
|
+
const byType = new Map();
|
|
3617
|
+
for (const room of floorRooms) {
|
|
3618
|
+
const list = byType.get(room.type) ?? [];
|
|
3619
|
+
list.push(room);
|
|
3620
|
+
byType.set(room.type, list);
|
|
3621
|
+
}
|
|
3622
|
+
for (const type of [...byType.keys()].sort(numeric)) {
|
|
3623
|
+
const typeRooms = byType.get(type);
|
|
3624
|
+
const typeKey = `${floorKey}/type:${type}`;
|
|
3625
|
+
rows.push({
|
|
3626
|
+
kind: 'group',
|
|
3627
|
+
key: typeKey,
|
|
3628
|
+
depth: 2,
|
|
3629
|
+
label: type,
|
|
3630
|
+
roomCount: typeRooms.length,
|
|
3631
|
+
});
|
|
3632
|
+
if (collapsed.has(typeKey)) {
|
|
3633
|
+
continue;
|
|
3634
|
+
}
|
|
3635
|
+
for (const room of [...typeRooms].sort((a, b) => numeric(a.number, b.number) || a.roomId.localeCompare(b.roomId))) {
|
|
3636
|
+
const bars = assignLanes(room.bars);
|
|
3637
|
+
const lanes = bars.reduce((max, b) => Math.max(max, b.lane + 1), 0);
|
|
3638
|
+
rows.push({
|
|
3639
|
+
kind: 'room',
|
|
3640
|
+
key: `room:${room.roomId}`,
|
|
3641
|
+
room,
|
|
3642
|
+
lanes,
|
|
3643
|
+
bars,
|
|
3644
|
+
});
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
return rows;
|
|
3649
|
+
}
|
|
3650
|
+
const GROUP_ROW_HEIGHT = 28;
|
|
3651
|
+
function rowHeight(row, laneHeight) {
|
|
3652
|
+
if (row.kind === 'group') {
|
|
3653
|
+
return GROUP_ROW_HEIGHT;
|
|
3654
|
+
}
|
|
3655
|
+
const lanes = Math.max(1, row.lanes);
|
|
3656
|
+
return 8 + lanes * laneHeight + (lanes - 1) * 4;
|
|
3657
|
+
}
|
|
3658
|
+
function positionRows(rows, laneHeight) {
|
|
3659
|
+
let top = 0;
|
|
3660
|
+
return rows.map(row => {
|
|
3661
|
+
const height = rowHeight(row, laneHeight);
|
|
3662
|
+
const positioned = { row, top, height };
|
|
3663
|
+
top += height;
|
|
3664
|
+
return positioned;
|
|
3665
|
+
});
|
|
3666
|
+
}
|
|
3667
|
+
function totalHeight(positioned) {
|
|
3668
|
+
const last = positioned[positioned.length - 1];
|
|
3669
|
+
return last ? last.top + last.height : 0;
|
|
3670
|
+
}
|
|
3671
|
+
/** Indices [first, last] of rows intersecting the viewport, with overscan. Binary search on top. */
|
|
3672
|
+
function visibleRange(positioned, scrollTop, viewportHeight, overscan = 400) {
|
|
3673
|
+
if (positioned.length === 0) {
|
|
3674
|
+
return { first: 0, last: -1 };
|
|
3675
|
+
}
|
|
3676
|
+
const minTop = Math.max(0, scrollTop - overscan);
|
|
3677
|
+
const maxTop = scrollTop + viewportHeight + overscan;
|
|
3678
|
+
let lo = 0;
|
|
3679
|
+
let hi = positioned.length - 1;
|
|
3680
|
+
while (lo < hi) {
|
|
3681
|
+
const mid = (lo + hi) >> 1;
|
|
3682
|
+
if (positioned[mid].top + positioned[mid].height <= minTop) {
|
|
3683
|
+
lo = mid + 1;
|
|
3684
|
+
}
|
|
3685
|
+
else {
|
|
3686
|
+
hi = mid;
|
|
3687
|
+
}
|
|
3688
|
+
}
|
|
3689
|
+
const first = lo;
|
|
3690
|
+
let last = first;
|
|
3691
|
+
while (last + 1 < positioned.length && positioned[last + 1].top < maxTop) {
|
|
3692
|
+
last++;
|
|
3693
|
+
}
|
|
3694
|
+
return { first, last };
|
|
3695
|
+
}
|
|
3696
|
+
/** Clip to the window and convert to pixels. Returns null when the bar is entirely outside. */
|
|
3697
|
+
function barGeometry(bar, from, to, dayWidth) {
|
|
3698
|
+
const clipStart = maxIso(bar.startDate, from);
|
|
3699
|
+
const clipEnd = minIso(bar.endDate, to);
|
|
3700
|
+
const days = daysBetween(clipStart, clipEnd);
|
|
3701
|
+
if (days <= 0) {
|
|
3702
|
+
return null;
|
|
3703
|
+
}
|
|
3704
|
+
return {
|
|
3705
|
+
left: daysBetween(from, clipStart) * dayWidth,
|
|
3706
|
+
width: days * dayWidth,
|
|
3707
|
+
cutLeft: bar.startDate < from,
|
|
3708
|
+
cutRight: bar.endDate > to,
|
|
3709
|
+
};
|
|
3710
|
+
}
|
|
3711
|
+
function dayColumns(from, to, dayWidth) {
|
|
3712
|
+
const count = daysBetween(from, to);
|
|
3713
|
+
const columns = [];
|
|
3714
|
+
for (let i = 0; i < count; i++) {
|
|
3715
|
+
const iso = addDays(from, i);
|
|
3716
|
+
const wd = weekday(iso);
|
|
3717
|
+
columns.push({
|
|
3718
|
+
iso,
|
|
3719
|
+
left: i * dayWidth,
|
|
3720
|
+
dayOfMonth: dayOfMonth(iso),
|
|
3721
|
+
weekday: wd,
|
|
3722
|
+
isWeekend: wd === 0 || wd === 6,
|
|
3723
|
+
});
|
|
3724
|
+
}
|
|
3725
|
+
return columns;
|
|
3726
|
+
}
|
|
3727
|
+
function monthSegments(from, to, dayWidth, monthLabels) {
|
|
3728
|
+
const segments = [];
|
|
3729
|
+
const count = daysBetween(from, to);
|
|
3730
|
+
let i = 0;
|
|
3731
|
+
while (i < count) {
|
|
3732
|
+
const iso = addDays(from, i);
|
|
3733
|
+
const year = yearOf(iso);
|
|
3734
|
+
const month = monthOf(iso);
|
|
3735
|
+
let j = i;
|
|
3736
|
+
while (j < count) {
|
|
3737
|
+
const next = addDays(from, j);
|
|
3738
|
+
if (yearOf(next) !== year || monthOf(next) !== month) {
|
|
3739
|
+
break;
|
|
3740
|
+
}
|
|
3741
|
+
j++;
|
|
3742
|
+
}
|
|
3743
|
+
segments.push({
|
|
3744
|
+
label: `${monthLabels[month - 1]} ${year}`,
|
|
3745
|
+
year,
|
|
3746
|
+
month,
|
|
3747
|
+
left: i * dayWidth,
|
|
3748
|
+
width: (j - i) * dayWidth,
|
|
3749
|
+
});
|
|
3750
|
+
i = j;
|
|
3751
|
+
}
|
|
3752
|
+
return segments;
|
|
3753
|
+
}
|
|
3754
|
+
/** Offset in days from `from` to the first Saturday on or after it (0..6). */
|
|
3755
|
+
function weekendOffsetDays(from) {
|
|
3756
|
+
return (6 - weekday(from) + 7) % 7;
|
|
3757
|
+
}
|
|
3758
|
+
/** Bars whose nights include `today`. */
|
|
3759
|
+
function takenOn(room, today) {
|
|
3760
|
+
if (!today) {
|
|
3761
|
+
return null;
|
|
3762
|
+
}
|
|
3763
|
+
return room.bars.filter(b => b.startDate <= today && today < b.endDate)
|
|
3764
|
+
.length;
|
|
3765
|
+
}
|
|
3766
|
+
function closureGeometry(closure, from, to, dayWidth) {
|
|
3767
|
+
return barGeometry(closure, from, to, dayWidth);
|
|
3768
|
+
}
|
|
3769
|
+
/** The calendar date under a pixel offset inside the day canvas (an empty-cell click). */
|
|
3770
|
+
function dateAtOffset(offsetX, from, dayWidth) {
|
|
3771
|
+
return addDays(from, Math.max(0, Math.floor(offsetX / dayWidth)));
|
|
3772
|
+
}
|
|
3773
|
+
/**
|
|
3774
|
+
* The nearest neighboring bar's boundary on the given edge — the local
|
|
3775
|
+
* limit a drag on that edge must not cross without visually overlapping
|
|
3776
|
+
* another bar. By default only bars in the same lane count (the rule
|
|
3777
|
+
* `assignLanes` used to decide they belong in that slot in the first
|
|
3778
|
+
* place); pass `allLanes: true` (see the grid's `preventOverlap` input) to
|
|
3779
|
+
* widen that to every other bar in the room, so a resize can never create
|
|
3780
|
+
* an overlap even across lanes that are normally allowed to overlap. Not a
|
|
3781
|
+
* capacity or closure check: this component knows nothing about either,
|
|
3782
|
+
* and the consumer's own save is still the real gate — this only stops the
|
|
3783
|
+
* drag from proposing something the grid's own rendering model already
|
|
3784
|
+
* knows is wrong.
|
|
3785
|
+
*/
|
|
3786
|
+
function laneNeighborBound(laneBars, bookingId, edge, allLanes = false) {
|
|
3787
|
+
const mine = laneBars.find(lb => lb.bar.bookingId === bookingId);
|
|
3788
|
+
if (!mine) {
|
|
3789
|
+
return null;
|
|
3790
|
+
}
|
|
3791
|
+
const others = laneBars.filter(lb => lb.bar.bookingId !== bookingId && (allLanes || lb.lane === mine.lane));
|
|
3792
|
+
if (edge === 'start') {
|
|
3793
|
+
const before = others.filter(lb => lb.bar.endDate <= mine.bar.startDate);
|
|
3794
|
+
if (before.length === 0) {
|
|
3795
|
+
return null;
|
|
3796
|
+
}
|
|
3797
|
+
return before.reduce((a, b) => (a.bar.endDate > b.bar.endDate ? a : b)).bar
|
|
3798
|
+
.endDate;
|
|
3799
|
+
}
|
|
3800
|
+
const after = others.filter(lb => lb.bar.startDate >= mine.bar.endDate);
|
|
3801
|
+
if (after.length === 0) {
|
|
3802
|
+
return null;
|
|
3803
|
+
}
|
|
3804
|
+
return after.reduce((a, b) => (a.bar.startDate < b.bar.startDate ? a : b)).bar
|
|
3805
|
+
.startDate;
|
|
3806
|
+
}
|
|
3807
|
+
/**
|
|
3808
|
+
* Whether `[start, end)` would overlap any OTHER bar already in the room
|
|
3809
|
+
* (half-open ranges, so a stay starting the day another ends does not
|
|
3810
|
+
* count). Used by a whole-bar move when `preventOverlap` is set — unlike
|
|
3811
|
+
* `laneNeighborBound`, a move can jump to any date or any room in one
|
|
3812
|
+
* gesture, so there is no adjacent "boundary" to clamp to; the drag either
|
|
3813
|
+
* lands clear of every other bar in the target room or it does not move
|
|
3814
|
+
* there at all.
|
|
3815
|
+
*/
|
|
3816
|
+
function overlapsRoom(room, bookingId, start, end) {
|
|
3817
|
+
return room.bars.some(b => b.bookingId !== bookingId && start < b.endDate && b.startDate < end);
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
const OCCUPANCY_GRID_HEADER_HEIGHT = 52;
|
|
3821
|
+
/** How far the pointer must move before a mousedown on a bar's body becomes a whole-bar drag rather than a click. */
|
|
3822
|
+
const MOVE_DRAG_THRESHOLD_PX = 4;
|
|
3823
|
+
/**
|
|
3824
|
+
* Rooms as rows, days as columns, one bar per stay (UC-11). It never writes
|
|
3825
|
+
* anywhere — `rooms` is the only source of truth and this component never
|
|
3826
|
+
* mutates it — but it is not read-only in the sense of being inert: a bar's
|
|
3827
|
+
* edge can be dragged (or, on a focused bar, Shift + arrow-keyed) to propose
|
|
3828
|
+
* a new date, reported via `barResize`; a bar's body can be dragged to a new
|
|
3829
|
+
* date, a different room, or both, reported via `barMove`. Every other
|
|
3830
|
+
* gesture (clicks, the nav buttons) works the same way: report what
|
|
3831
|
+
* happened, apply nothing.
|
|
3832
|
+
*
|
|
3833
|
+
* Owns its own row virtualization: rows have different heights (one lane per
|
|
3834
|
+
* overlapping stay), which the CDK's stable fixed-size strategy cannot do, and
|
|
3835
|
+
* the autosize strategy is still experimental. Rows are positioned from a
|
|
3836
|
+
* prefix sum of heights and only those intersecting the viewport are rendered.
|
|
3837
|
+
*
|
|
3838
|
+
* Every date is a YYYY-MM-DD string and every column is computed by
|
|
3839
|
+
* local-date.ts; `new Date(string)` is never used, so a column can never be
|
|
3840
|
+
* off by one west of Greenwich.
|
|
3841
|
+
*/
|
|
3842
|
+
class OccupancyGridComponent {
|
|
3843
|
+
translate;
|
|
3844
|
+
rooms = input([]);
|
|
3845
|
+
dormName = input('');
|
|
3846
|
+
from = input.required();
|
|
3847
|
+
to = input.required();
|
|
3848
|
+
today = input(null);
|
|
3849
|
+
dayWidth = input(28);
|
|
3850
|
+
leftColumnWidth = input(220);
|
|
3851
|
+
laneHeight = input(22);
|
|
3852
|
+
loading = input(false);
|
|
3853
|
+
/** Days the ‹ / › nav buttons and the ArrowLeft/ArrowRight keys shift the window by. */
|
|
3854
|
+
navStepDays = input(7);
|
|
3855
|
+
/**
|
|
3856
|
+
* When true, a resize or whole-bar move drag is never allowed to leave
|
|
3857
|
+
* two bars in the same room overlapping in time. The default (false)
|
|
3858
|
+
* lets bars in different lanes of the same room legitimately overlap —
|
|
3859
|
+
* an outgoing stay's last few nights next to an incoming one's first, say
|
|
3860
|
+
* — which is exactly what the lane system exists to display. A strict
|
|
3861
|
+
* room grid, where a room can hold only one booking at a time, sets this
|
|
3862
|
+
* so a drag simply cannot propose a second one over it: a resize clamps
|
|
3863
|
+
* at the nearest other bar in the room (not just its own lane), and a
|
|
3864
|
+
* move drag ignores any candidate date/room that would overlap, sticking
|
|
3865
|
+
* to the last placement that did not.
|
|
3866
|
+
*/
|
|
3867
|
+
preventOverlap = input(false);
|
|
3868
|
+
barClick = output();
|
|
3869
|
+
closureClick = output();
|
|
3870
|
+
roomClick = output();
|
|
3871
|
+
/** An empty day cell was clicked: the room and the date under the pointer. */
|
|
3872
|
+
cellClick = output();
|
|
3873
|
+
reachedEnd = output();
|
|
3874
|
+
/**
|
|
3875
|
+
* The nav buttons or an arrow key asked to move the window. The component
|
|
3876
|
+
* does not own `from`/`to` (the consumer does, same as every other input
|
|
3877
|
+
* here), so it reports the signed day delta — negative for earlier,
|
|
3878
|
+
* positive for later — rather than computing new dates itself. A consumer
|
|
3879
|
+
* that wants the shift applied does
|
|
3880
|
+
* `from = addDays(from, delta); to = addDays(to, delta)`.
|
|
3881
|
+
*/
|
|
3882
|
+
windowShift = output();
|
|
3883
|
+
/**
|
|
3884
|
+
* A bar's edge was dragged, or Shift + arrow-keyed, to a new date. See
|
|
3885
|
+
* `OccupancyBarResize` — this reports the proposal; it never applies it.
|
|
3886
|
+
*/
|
|
3887
|
+
barResize = output();
|
|
3888
|
+
/**
|
|
3889
|
+
* A bar's body was dragged to new dates, a different room, or both. See
|
|
3890
|
+
* `OccupancyBarMove` — this reports the proposal; it never applies it.
|
|
3891
|
+
*/
|
|
3892
|
+
barMove = output();
|
|
3893
|
+
headerHeight = OCCUPANCY_GRID_HEADER_HEIGHT;
|
|
3894
|
+
scroller = viewChild.required('scroller');
|
|
3895
|
+
collapsed = signal(new Set());
|
|
3896
|
+
scrollTop = signal(0);
|
|
3897
|
+
viewportHeight = signal(600);
|
|
3898
|
+
lastEndEmittedFor = null;
|
|
3899
|
+
/**
|
|
3900
|
+
* The in-progress drag, if any — null the rest of the time. `geometryOf`
|
|
3901
|
+
* and `barTitle` read the preview dates for whichever bar this names so
|
|
3902
|
+
* the drag renders live; nothing else about `rooms` changes, since the
|
|
3903
|
+
* component does not own that input.
|
|
3904
|
+
*/
|
|
3905
|
+
resize = signal(null);
|
|
3906
|
+
dragMoveListener = null;
|
|
3907
|
+
dragUpListener = null;
|
|
3908
|
+
dragKeyListener = null;
|
|
3909
|
+
/**
|
|
3910
|
+
* The in-progress whole-bar drag, if any — null the rest of the time.
|
|
3911
|
+
* `dragging` only flips true once the pointer clears a small threshold, so
|
|
3912
|
+
* a plain click (mousedown + mouseup with no real movement) still opens
|
|
3913
|
+
* the drawer as `barClick` instead of being swallowed as a zero-distance
|
|
3914
|
+
* move. `targetRoom` starts as `fromRoom` and is re-resolved on every
|
|
3915
|
+
* mousemove from whatever `.occ__row--room` is actually under the
|
|
3916
|
+
* pointer — see `roomUnderPoint` — so dragging vertically onto another
|
|
3917
|
+
* room's row is exactly the gesture `roomUnderPoint` is built to read.
|
|
3918
|
+
*/
|
|
3919
|
+
move = signal(null);
|
|
3920
|
+
moveMoveListener = null;
|
|
3921
|
+
moveUpListener = null;
|
|
3922
|
+
moveKeyListener = null;
|
|
3923
|
+
// A drag that ends with the pointer over the lane (not back over the
|
|
3924
|
+
// handle, or not back over the bar's own body) still makes the browser
|
|
3925
|
+
// synthesize a `click` right after the `mouseup`, targeted at the nearest
|
|
3926
|
+
// common ancestor of the mousedown and mouseup elements — which is the
|
|
3927
|
+
// room's lane row, or the bar itself if the drag never left it. Left alone
|
|
3928
|
+
// that click would surface as a spurious cellClick or barClick the instant
|
|
3929
|
+
// a resize or a whole-bar move finishes. This flag is armed in endResize
|
|
3930
|
+
// and endBarMove and consumed by the one click that follows, wherever it
|
|
3931
|
+
// lands; the timer is a safety net for the rare case where no click
|
|
3932
|
+
// follows at all (e.g. the pointer left the window), so a stray flag never
|
|
3933
|
+
// survives to swallow some later, unrelated click.
|
|
3934
|
+
suppressNextClick = false;
|
|
3935
|
+
suppressNextClickTimer = null;
|
|
3936
|
+
constructor(translate, destroyRef) {
|
|
3937
|
+
this.translate = translate;
|
|
3938
|
+
// A drag that is still active when the component is torn down (e.g. the
|
|
3939
|
+
// consumer navigates away mid-drag) must not leave window-level
|
|
3940
|
+
// listeners behind — they would keep firing against a destroyed
|
|
3941
|
+
// component's signals otherwise, and never get cleaned up any other way.
|
|
3942
|
+
destroyRef.onDestroy(() => {
|
|
3943
|
+
this.removeDragListeners();
|
|
3944
|
+
this.removeMoveListeners();
|
|
3945
|
+
if (this.suppressNextClickTimer) {
|
|
3946
|
+
clearTimeout(this.suppressNextClickTimer);
|
|
3947
|
+
}
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
dayCount = computed(() => isIsoDate(this.from()) && isIsoDate(this.to())
|
|
3951
|
+
? Math.max(0, daysBetween(this.from(), this.to()))
|
|
3952
|
+
: 0);
|
|
3953
|
+
canvasWidth = computed(() => this.leftColumnWidth() + this.dayCount() * this.dayWidth());
|
|
3954
|
+
rows = computed(() => buildRows(this.rooms(), this.dormName(), this.collapsed()));
|
|
3955
|
+
positioned = computed(() => positionRows(this.rows(), this.laneHeight()));
|
|
3956
|
+
bodyHeight = computed(() => totalHeight(this.positioned()));
|
|
3957
|
+
visible = computed(() => {
|
|
3958
|
+
const { first, last } = visibleRange(this.positioned(), this.scrollTop(), this.viewportHeight());
|
|
3959
|
+
return this.positioned().slice(first, last + 1);
|
|
3960
|
+
});
|
|
3961
|
+
days = computed(() => this.dayCount() ? dayColumns(this.from(), this.to(), this.dayWidth()) : []);
|
|
3962
|
+
months = computed(() => this.dayCount()
|
|
3963
|
+
? monthSegments(this.from(), this.to(), this.dayWidth(), this.monthLabels())
|
|
3964
|
+
: []);
|
|
3965
|
+
weekendOffsetPx = computed(() => this.dayCount() ? weekendOffsetDays(this.from()) * this.dayWidth() : 0);
|
|
3966
|
+
todayLeft = computed(() => {
|
|
3967
|
+
const today = this.today();
|
|
3968
|
+
if (!today ||
|
|
3969
|
+
!this.dayCount() ||
|
|
3970
|
+
today < this.from() ||
|
|
3971
|
+
today >= this.to()) {
|
|
3972
|
+
return null;
|
|
3973
|
+
}
|
|
3974
|
+
return daysBetween(this.from(), today) * this.dayWidth();
|
|
3975
|
+
});
|
|
3976
|
+
roomsById = computed(() => {
|
|
3977
|
+
const map = new Map();
|
|
3978
|
+
for (const room of this.rooms()) {
|
|
3979
|
+
map.set(room.roomId, room);
|
|
3980
|
+
}
|
|
3981
|
+
return map;
|
|
3982
|
+
});
|
|
3983
|
+
/**
|
|
3984
|
+
* The floating copy of a bar being dragged by its body — null unless a
|
|
3985
|
+
* move drag has cleared the click threshold. Positioned in canvas
|
|
3986
|
+
* coordinates (like `.occ__today`) rather than inside a room's own lane,
|
|
3987
|
+
* because a move can target a room other than the one the drag started
|
|
3988
|
+
* in; `positioned()` already has every visible row's pixel `top`, so no
|
|
3989
|
+
* separate DOM lookup is needed to place it. Always drawn at lane 0 of the
|
|
3990
|
+
* target room — a simplification the consumer's own re-lane on save
|
|
3991
|
+
* supersedes anyway, same as the rest of this component's "report the
|
|
3992
|
+
* gesture, never own the data" contract.
|
|
3993
|
+
*/
|
|
3994
|
+
moveGhost = computed(() => {
|
|
3995
|
+
const m = this.move();
|
|
3996
|
+
if (!m || !m.dragging) {
|
|
3997
|
+
return null;
|
|
3998
|
+
}
|
|
3999
|
+
const geometry = barGeometry({ startDate: m.previewStartDate, endDate: m.previewEndDate }, this.from(), this.to(), this.dayWidth());
|
|
4000
|
+
const targetRow = this.positioned().find(p => p.row.kind === 'room' &&
|
|
4001
|
+
p.row.room.roomId === m.targetRoom.roomId);
|
|
4002
|
+
if (!geometry || !targetRow) {
|
|
4003
|
+
return null;
|
|
4004
|
+
}
|
|
4005
|
+
return {
|
|
4006
|
+
left: this.leftColumnWidth() + geometry.left + 1,
|
|
4007
|
+
top: this.headerHeight + targetRow.top + 4,
|
|
4008
|
+
width: geometry.width - 2,
|
|
4009
|
+
height: this.laneHeight(),
|
|
4010
|
+
label: m.bar.studentName,
|
|
4011
|
+
state: m.bar.state,
|
|
4012
|
+
};
|
|
4013
|
+
});
|
|
4014
|
+
monthLabels() {
|
|
4015
|
+
const keys = [
|
|
4016
|
+
'jan',
|
|
4017
|
+
'feb',
|
|
4018
|
+
'mar',
|
|
4019
|
+
'apr',
|
|
4020
|
+
'may',
|
|
4021
|
+
'jun',
|
|
4022
|
+
'jul',
|
|
4023
|
+
'aug',
|
|
4024
|
+
'sep',
|
|
4025
|
+
'oct',
|
|
4026
|
+
'nov',
|
|
4027
|
+
'dec',
|
|
4028
|
+
];
|
|
4029
|
+
return keys.map(k => this.translate.instant(`occupancyGrid.months.${k}`));
|
|
4030
|
+
}
|
|
4031
|
+
geometryOf(bar) {
|
|
4032
|
+
const preview = this.previewDatesOf(bar);
|
|
4033
|
+
const effective = preview
|
|
4034
|
+
? { ...bar, startDate: preview.start, endDate: preview.end }
|
|
4035
|
+
: bar;
|
|
4036
|
+
return barGeometry(effective, this.from(), this.to(), this.dayWidth());
|
|
4037
|
+
}
|
|
4038
|
+
/** The in-progress drag's proposed dates for this bar, or null if it is not the one being dragged. */
|
|
4039
|
+
previewDatesOf(bar) {
|
|
4040
|
+
const r = this.resize();
|
|
4041
|
+
if (!r || r.bar.bookingId !== bar.bookingId) {
|
|
4042
|
+
return null;
|
|
4043
|
+
}
|
|
4044
|
+
return { start: r.previewStart, end: r.previewEnd };
|
|
4045
|
+
}
|
|
4046
|
+
isResizing(bookingId) {
|
|
4047
|
+
return this.resize()?.bar.bookingId === bookingId;
|
|
4048
|
+
}
|
|
4049
|
+
/** True once a whole-bar drag on this booking has cleared the click threshold — see `move`. */
|
|
4050
|
+
isBeingMoved(bookingId) {
|
|
4051
|
+
const m = this.move();
|
|
4052
|
+
return !!m && m.dragging && m.bar.bookingId === bookingId;
|
|
4053
|
+
}
|
|
4054
|
+
/** True while a whole-bar drag is hovering this room as its drop target. */
|
|
4055
|
+
isMoveTarget(roomId) {
|
|
4056
|
+
const m = this.move();
|
|
4057
|
+
return !!m && m.dragging && m.targetRoom.roomId === roomId;
|
|
4058
|
+
}
|
|
4059
|
+
closureGeometryOf(closure) {
|
|
4060
|
+
return closureGeometry(closure, this.from(), this.to(), this.dayWidth());
|
|
4061
|
+
}
|
|
4062
|
+
takenOn(room) {
|
|
4063
|
+
return takenOn(room, this.today());
|
|
4064
|
+
}
|
|
4065
|
+
isCollapsed(key) {
|
|
4066
|
+
return this.collapsed().has(key);
|
|
4067
|
+
}
|
|
4068
|
+
toggleGroup(key) {
|
|
4069
|
+
const next = new Set(this.collapsed());
|
|
4070
|
+
if (next.has(key)) {
|
|
4071
|
+
next.delete(key);
|
|
4072
|
+
}
|
|
4073
|
+
else {
|
|
4074
|
+
next.add(key);
|
|
4075
|
+
}
|
|
4076
|
+
this.collapsed.set(next);
|
|
4077
|
+
}
|
|
4078
|
+
barTitle(bar) {
|
|
4079
|
+
const preview = this.previewDatesOf(bar);
|
|
4080
|
+
const start = preview ? preview.start : bar.startDate;
|
|
4081
|
+
const end = preview ? preview.end : bar.endDate;
|
|
4082
|
+
const state = this.translate.instant(`occupancyGrid.states.${bar.state}`);
|
|
4083
|
+
return `${bar.studentName} · ${start} → ${end} · ${state}`;
|
|
4084
|
+
}
|
|
4085
|
+
closureTitle(closure) {
|
|
4086
|
+
return (this.translate.instant('occupancyGrid.closedReason', {
|
|
4087
|
+
reason: closure.reason,
|
|
4088
|
+
}) + ` · ${closure.startDate} → ${closure.endDate}`);
|
|
4089
|
+
}
|
|
4090
|
+
onScroll() {
|
|
4091
|
+
const el = this.scroller().nativeElement;
|
|
4092
|
+
this.scrollTop.set(el.scrollTop);
|
|
4093
|
+
this.viewportHeight.set(el.clientHeight);
|
|
4094
|
+
const nearEnd = el.scrollLeft + el.clientWidth >= el.scrollWidth - 2 * this.dayWidth();
|
|
4095
|
+
if (nearEnd && this.lastEndEmittedFor !== this.to()) {
|
|
4096
|
+
this.lastEndEmittedFor = this.to();
|
|
4097
|
+
this.reachedEnd.emit(this.to());
|
|
4098
|
+
}
|
|
4099
|
+
}
|
|
4100
|
+
trackRow(_, p) {
|
|
4101
|
+
return p.row.key;
|
|
4102
|
+
}
|
|
4103
|
+
asRoomRow(row) {
|
|
4104
|
+
return row;
|
|
4105
|
+
}
|
|
4106
|
+
/** ‹ / › nav buttons. Emits the signed day delta; see `windowShift`. */
|
|
4107
|
+
shiftWindow(direction) {
|
|
4108
|
+
this.windowShift.emit(direction * this.navStepDays());
|
|
4109
|
+
}
|
|
4110
|
+
/**
|
|
4111
|
+
* ArrowLeft/ArrowRight anywhere in the grid page the window, the same as
|
|
4112
|
+
* the nav buttons — a keyboard user reaching a bar via Tab should not have
|
|
4113
|
+
* to find the buttons to keep moving through time. Left alone otherwise:
|
|
4114
|
+
* a bar, room cell or group header's own Enter handling is untouched.
|
|
4115
|
+
*/
|
|
4116
|
+
onGridKeydown(event) {
|
|
4117
|
+
// Shift+Arrow on a focused bar resizes it (onBarKeydownResize, bound on
|
|
4118
|
+
// the bar itself); this handler still sees the same bubbled keydown, so
|
|
4119
|
+
// it must decline plain-Arrow handling here or a resize would also page
|
|
4120
|
+
// the window on every keystroke.
|
|
4121
|
+
if (event.shiftKey) {
|
|
4122
|
+
return;
|
|
4123
|
+
}
|
|
4124
|
+
if (event.key === 'ArrowLeft') {
|
|
4125
|
+
event.preventDefault();
|
|
4126
|
+
this.shiftWindow(-1);
|
|
4127
|
+
}
|
|
4128
|
+
else if (event.key === 'ArrowRight') {
|
|
4129
|
+
event.preventDefault();
|
|
4130
|
+
this.shiftWindow(1);
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
/**
|
|
4134
|
+
* A click inside a room's lane that landed on neither a bar nor a closure
|
|
4135
|
+
* (both stop propagation before this fires) — the room and the date under
|
|
4136
|
+
* the pointer. See `OccupancyCellClick`.
|
|
4137
|
+
*/
|
|
4138
|
+
onLaneClick(event, room) {
|
|
4139
|
+
if (this.consumeSuppressNextClick()) {
|
|
4140
|
+
return;
|
|
4141
|
+
}
|
|
4142
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
4143
|
+
const date = dateAtOffset(event.clientX - rect.left, this.from(), this.dayWidth());
|
|
4144
|
+
this.cellClick.emit({ room, date });
|
|
4145
|
+
}
|
|
4146
|
+
/** The bar's own click handler routes through here so it shares the same resize-click guard as `onLaneClick`. */
|
|
4147
|
+
onBarClick(bar, room) {
|
|
4148
|
+
if (this.consumeSuppressNextClick()) {
|
|
4149
|
+
return;
|
|
4150
|
+
}
|
|
4151
|
+
this.barClick.emit({ bar, room });
|
|
4152
|
+
}
|
|
4153
|
+
// ─────────────────────────────────────────────────────── extend / shorten
|
|
4154
|
+
/**
|
|
4155
|
+
* Mousedown on a bar's edge handle starts a drag. Listeners go on
|
|
4156
|
+
* `window`, not the handle, because the pointer will move well outside
|
|
4157
|
+
* an 8px-wide handle the instant the drag starts; `stopPropagation` keeps
|
|
4158
|
+
* this from also being read as a click on the bar (which would open the
|
|
4159
|
+
* drawer) or on the lane underneath it (a `cellClick`).
|
|
4160
|
+
*/
|
|
4161
|
+
startResize(event, room, bar, edge, laneBars) {
|
|
4162
|
+
event.stopPropagation();
|
|
4163
|
+
event.preventDefault();
|
|
4164
|
+
const bound = laneNeighborBound(laneBars, bar.bookingId, edge, this.preventOverlap());
|
|
4165
|
+
this.resize.set({
|
|
4166
|
+
room,
|
|
4167
|
+
bar,
|
|
4168
|
+
edge,
|
|
4169
|
+
previewStart: bar.startDate,
|
|
4170
|
+
previewEnd: bar.endDate,
|
|
4171
|
+
minBound: edge === 'start' ? bound : null,
|
|
4172
|
+
maxBound: edge === 'end' ? bound : null,
|
|
4173
|
+
});
|
|
4174
|
+
this.dragMoveListener = e => this.onDragMove(e);
|
|
4175
|
+
this.dragUpListener = () => this.endResize(true);
|
|
4176
|
+
this.dragKeyListener = e => {
|
|
4177
|
+
if (e.key === 'Escape') {
|
|
4178
|
+
this.endResize(false);
|
|
4179
|
+
}
|
|
4180
|
+
};
|
|
4181
|
+
window.addEventListener('mousemove', this.dragMoveListener);
|
|
4182
|
+
window.addEventListener('mouseup', this.dragUpListener);
|
|
4183
|
+
window.addEventListener('keydown', this.dragKeyListener);
|
|
4184
|
+
}
|
|
4185
|
+
onDragMove(event) {
|
|
4186
|
+
const r = this.resize();
|
|
4187
|
+
if (!r) {
|
|
4188
|
+
return;
|
|
4189
|
+
}
|
|
4190
|
+
const date = this.clientXToDate(event.clientX);
|
|
4191
|
+
if (r.edge === 'start') {
|
|
4192
|
+
let next = date;
|
|
4193
|
+
if (r.minBound && next < r.minBound) {
|
|
4194
|
+
next = r.minBound;
|
|
4195
|
+
}
|
|
4196
|
+
if (next >= r.previewEnd) {
|
|
4197
|
+
next = addDays(r.previewEnd, -1); // never less than one night
|
|
4198
|
+
}
|
|
4199
|
+
this.resize.set({ ...r, previewStart: next });
|
|
4200
|
+
}
|
|
4201
|
+
else {
|
|
4202
|
+
let next = date;
|
|
4203
|
+
if (r.maxBound && next > r.maxBound) {
|
|
4204
|
+
next = r.maxBound;
|
|
4205
|
+
}
|
|
4206
|
+
if (next <= r.previewStart) {
|
|
4207
|
+
next = addDays(r.previewStart, 1);
|
|
4208
|
+
}
|
|
4209
|
+
this.resize.set({ ...r, previewEnd: next });
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
/** Mouseup (commit) or Escape (cancel). Emits `barResize` only on commit with an actual change. */
|
|
4213
|
+
endResize(commit) {
|
|
4214
|
+
const r = this.resize();
|
|
4215
|
+
this.removeDragListeners();
|
|
4216
|
+
this.resize.set(null);
|
|
4217
|
+
this.armSuppressNextClick();
|
|
4218
|
+
if (!r || !commit) {
|
|
4219
|
+
return;
|
|
4220
|
+
}
|
|
4221
|
+
if (r.previewStart === r.bar.startDate && r.previewEnd === r.bar.endDate) {
|
|
4222
|
+
return;
|
|
4223
|
+
}
|
|
4224
|
+
this.barResize.emit({
|
|
4225
|
+
bar: r.bar,
|
|
4226
|
+
room: r.room,
|
|
4227
|
+
edge: r.edge,
|
|
4228
|
+
previousStartDate: r.bar.startDate,
|
|
4229
|
+
previousEndDate: r.bar.endDate,
|
|
4230
|
+
proposedStartDate: r.previewStart,
|
|
4231
|
+
proposedEndDate: r.previewEnd,
|
|
4232
|
+
});
|
|
4233
|
+
}
|
|
4234
|
+
removeDragListeners() {
|
|
4235
|
+
if (this.dragMoveListener) {
|
|
4236
|
+
window.removeEventListener('mousemove', this.dragMoveListener);
|
|
4237
|
+
}
|
|
4238
|
+
if (this.dragUpListener) {
|
|
4239
|
+
window.removeEventListener('mouseup', this.dragUpListener);
|
|
4240
|
+
}
|
|
4241
|
+
if (this.dragKeyListener) {
|
|
4242
|
+
window.removeEventListener('keydown', this.dragKeyListener);
|
|
4243
|
+
}
|
|
4244
|
+
this.dragMoveListener = null;
|
|
4245
|
+
this.dragUpListener = null;
|
|
4246
|
+
this.dragKeyListener = null;
|
|
4247
|
+
}
|
|
4248
|
+
// ───────────────────────────────────────────────────────── move the bar
|
|
4249
|
+
/**
|
|
4250
|
+
* Mousedown on a bar's own body (never the edge handles — those stop
|
|
4251
|
+
* propagation before this fires) arms a possible whole-bar move, but does
|
|
4252
|
+
* not yet commit to one: `dragging` stays false, and nothing is rendered
|
|
4253
|
+
* differently, until `onBarDragMove` sees the pointer clear a small
|
|
4254
|
+
* threshold. That is what lets a plain click still fall through to
|
|
4255
|
+
* `onBarClick` unchanged.
|
|
4256
|
+
*/
|
|
4257
|
+
startBarMove(event, room, bar) {
|
|
4258
|
+
if (event.button !== 0) {
|
|
4259
|
+
return;
|
|
4260
|
+
}
|
|
4261
|
+
event.preventDefault();
|
|
4262
|
+
this.move.set({
|
|
4263
|
+
bar,
|
|
4264
|
+
fromRoom: room,
|
|
4265
|
+
startClientX: event.clientX,
|
|
4266
|
+
startClientY: event.clientY,
|
|
4267
|
+
originalStartDate: bar.startDate,
|
|
4268
|
+
originalEndDate: bar.endDate,
|
|
4269
|
+
previewStartDate: bar.startDate,
|
|
4270
|
+
previewEndDate: bar.endDate,
|
|
4271
|
+
targetRoom: room,
|
|
4272
|
+
dragging: false,
|
|
4273
|
+
});
|
|
4274
|
+
this.moveMoveListener = e => this.onBarDragMove(e);
|
|
4275
|
+
this.moveUpListener = () => this.endBarMove(true);
|
|
4276
|
+
this.moveKeyListener = e => {
|
|
4277
|
+
if (e.key === 'Escape') {
|
|
4278
|
+
this.endBarMove(false);
|
|
4279
|
+
}
|
|
4280
|
+
};
|
|
4281
|
+
window.addEventListener('mousemove', this.moveMoveListener);
|
|
4282
|
+
window.addEventListener('mouseup', this.moveUpListener);
|
|
4283
|
+
window.addEventListener('keydown', this.moveKeyListener);
|
|
4284
|
+
}
|
|
4285
|
+
onBarDragMove(event) {
|
|
4286
|
+
const m = this.move();
|
|
4287
|
+
if (!m) {
|
|
4288
|
+
return;
|
|
4289
|
+
}
|
|
4290
|
+
const dx = event.clientX - m.startClientX;
|
|
4291
|
+
const dy = event.clientY - m.startClientY;
|
|
4292
|
+
if (!m.dragging &&
|
|
4293
|
+
Math.abs(dx) < MOVE_DRAG_THRESHOLD_PX &&
|
|
4294
|
+
Math.abs(dy) < MOVE_DRAG_THRESHOLD_PX) {
|
|
4295
|
+
return;
|
|
4296
|
+
}
|
|
4297
|
+
const dayDelta = Math.round(dx / this.dayWidth());
|
|
4298
|
+
const previewStartDate = addDays(m.originalStartDate, dayDelta);
|
|
4299
|
+
const previewEndDate = addDays(m.originalEndDate, dayDelta);
|
|
4300
|
+
const targetRoom = this.roomUnderPoint(event.clientX, event.clientY) ?? m.targetRoom;
|
|
4301
|
+
if (this.preventOverlap() &&
|
|
4302
|
+
overlapsRoom(targetRoom, m.bar.bookingId, previewStartDate, previewEndDate)) {
|
|
4303
|
+
// This candidate would overlap another bar in the target room — reject
|
|
4304
|
+
// just this update rather than the whole drag, so the ghost simply
|
|
4305
|
+
// stays at the last placement that did not overlap (the bar's
|
|
4306
|
+
// original spot, the first time a move ever conflicts) instead of
|
|
4307
|
+
// jumping onto an invalid one and back.
|
|
4308
|
+
this.move.set({ ...m, dragging: true });
|
|
4309
|
+
return;
|
|
4310
|
+
}
|
|
4311
|
+
this.move.set({
|
|
4312
|
+
...m,
|
|
4313
|
+
dragging: true,
|
|
4314
|
+
previewStartDate,
|
|
4315
|
+
previewEndDate,
|
|
4316
|
+
targetRoom,
|
|
4317
|
+
});
|
|
4318
|
+
}
|
|
4319
|
+
/** Mouseup (commit) or Escape (cancel). Emits `barMove` only on commit with an actual change. */
|
|
4320
|
+
endBarMove(commit) {
|
|
4321
|
+
const m = this.move();
|
|
4322
|
+
this.removeMoveListeners();
|
|
4323
|
+
this.move.set(null);
|
|
4324
|
+
if (!m) {
|
|
4325
|
+
return;
|
|
4326
|
+
}
|
|
4327
|
+
if (m.dragging) {
|
|
4328
|
+
this.armSuppressNextClick();
|
|
4329
|
+
}
|
|
4330
|
+
if (!m.dragging || !commit) {
|
|
4331
|
+
return;
|
|
4332
|
+
}
|
|
4333
|
+
if (m.previewStartDate === m.originalStartDate &&
|
|
4334
|
+
m.previewEndDate === m.originalEndDate &&
|
|
4335
|
+
m.targetRoom.roomId === m.fromRoom.roomId) {
|
|
4336
|
+
return;
|
|
4337
|
+
}
|
|
4338
|
+
this.barMove.emit({
|
|
4339
|
+
bar: m.bar,
|
|
4340
|
+
fromRoom: m.fromRoom,
|
|
4341
|
+
toRoom: m.targetRoom,
|
|
4342
|
+
previousStartDate: m.originalStartDate,
|
|
4343
|
+
previousEndDate: m.originalEndDate,
|
|
4344
|
+
proposedStartDate: m.previewStartDate,
|
|
4345
|
+
proposedEndDate: m.previewEndDate,
|
|
4346
|
+
});
|
|
4347
|
+
}
|
|
4348
|
+
removeMoveListeners() {
|
|
4349
|
+
if (this.moveMoveListener) {
|
|
4350
|
+
window.removeEventListener('mousemove', this.moveMoveListener);
|
|
4351
|
+
}
|
|
4352
|
+
if (this.moveUpListener) {
|
|
4353
|
+
window.removeEventListener('mouseup', this.moveUpListener);
|
|
4354
|
+
}
|
|
4355
|
+
if (this.moveKeyListener) {
|
|
4356
|
+
window.removeEventListener('keydown', this.moveKeyListener);
|
|
4357
|
+
}
|
|
4358
|
+
this.moveMoveListener = null;
|
|
4359
|
+
this.moveUpListener = null;
|
|
4360
|
+
this.moveKeyListener = null;
|
|
4361
|
+
}
|
|
4362
|
+
/** Whatever room row (if any) is actually rendered under this point — see `.occ__row--room`'s `data-room-id`. */
|
|
4363
|
+
roomUnderPoint(clientX, clientY) {
|
|
4364
|
+
const el = document.elementFromPoint(clientX, clientY);
|
|
4365
|
+
const rowEl = el?.closest('.occ__row--room');
|
|
4366
|
+
const roomId = rowEl?.dataset['roomId'];
|
|
4367
|
+
return roomId ? (this.roomsById().get(roomId) ?? null) : null;
|
|
4368
|
+
}
|
|
4369
|
+
armSuppressNextClick() {
|
|
4370
|
+
this.suppressNextClick = true;
|
|
4371
|
+
if (this.suppressNextClickTimer) {
|
|
4372
|
+
clearTimeout(this.suppressNextClickTimer);
|
|
4373
|
+
}
|
|
4374
|
+
this.suppressNextClickTimer = setTimeout(() => {
|
|
4375
|
+
this.suppressNextClick = false;
|
|
4376
|
+
this.suppressNextClickTimer = null;
|
|
4377
|
+
}, 0);
|
|
4378
|
+
}
|
|
4379
|
+
consumeSuppressNextClick() {
|
|
4380
|
+
if (!this.suppressNextClick) {
|
|
4381
|
+
return false;
|
|
4382
|
+
}
|
|
4383
|
+
this.suppressNextClick = false;
|
|
4384
|
+
if (this.suppressNextClickTimer) {
|
|
4385
|
+
clearTimeout(this.suppressNextClickTimer);
|
|
4386
|
+
this.suppressNextClickTimer = null;
|
|
4387
|
+
}
|
|
4388
|
+
return true;
|
|
4389
|
+
}
|
|
4390
|
+
clientXToDate(clientX) {
|
|
4391
|
+
const el = this.scroller().nativeElement;
|
|
4392
|
+
const rect = el.getBoundingClientRect();
|
|
4393
|
+
const x = clientX - rect.left + el.scrollLeft - this.leftColumnWidth();
|
|
4394
|
+
return dateAtOffset(x, this.from(), this.dayWidth());
|
|
4395
|
+
}
|
|
4396
|
+
/**
|
|
4397
|
+
* The keyboard equivalent of dragging the departure edge: Shift+ArrowRight
|
|
4398
|
+
* extends by a night, Shift+ArrowLeft shortens by one, each key press
|
|
4399
|
+
* committing immediately (there is nothing to "release" the way a mouse
|
|
4400
|
+
* drag has). Scoped to the departure edge only — the more common "extend a
|
|
4401
|
+
* stay" gesture — so one binding covers the primary case without a second
|
|
4402
|
+
* modifier combination to document; the arrival edge is still reachable by
|
|
4403
|
+
* dragging its handle with a mouse.
|
|
4404
|
+
*/
|
|
4405
|
+
onBarKeydownResize(event, room, bar, laneBars) {
|
|
4406
|
+
if (!event.shiftKey ||
|
|
4407
|
+
(event.key !== 'ArrowRight' && event.key !== 'ArrowLeft')) {
|
|
4408
|
+
return;
|
|
4409
|
+
}
|
|
4410
|
+
event.preventDefault();
|
|
4411
|
+
event.stopPropagation();
|
|
4412
|
+
const bound = laneNeighborBound(laneBars, bar.bookingId, 'end', this.preventOverlap());
|
|
4413
|
+
let next = addDays(bar.endDate, event.key === 'ArrowRight' ? 1 : -1);
|
|
4414
|
+
if (bound && next > bound) {
|
|
4415
|
+
next = bound;
|
|
4416
|
+
}
|
|
4417
|
+
if (next <= bar.startDate) {
|
|
4418
|
+
next = addDays(bar.startDate, 1);
|
|
4419
|
+
}
|
|
4420
|
+
if (next === bar.endDate) {
|
|
4421
|
+
return;
|
|
4422
|
+
}
|
|
4423
|
+
this.barResize.emit({
|
|
4424
|
+
bar,
|
|
4425
|
+
room,
|
|
4426
|
+
edge: 'end',
|
|
4427
|
+
previousStartDate: bar.startDate,
|
|
4428
|
+
previousEndDate: bar.endDate,
|
|
4429
|
+
proposedStartDate: bar.startDate,
|
|
4430
|
+
proposedEndDate: next,
|
|
4431
|
+
});
|
|
4432
|
+
}
|
|
4433
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4434
|
+
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 } }, outputs: { barClick: "barClick", closureClick: "closureClick", roomClick: "roomClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove" }, 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]=\"resize() !== null || move()?.dragging\"\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 <!-- 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 [title]=\"'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 [title]=\"'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 [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 </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 [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 [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (click)=\"onLaneClick($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 [title]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\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 @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 [title]=\"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 </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 @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-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: \"DM Sans\", 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-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:#1b253507}.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__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-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}@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: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4435
|
+
}
|
|
4436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, decorators: [{
|
|
4437
|
+
type: Component,
|
|
4438
|
+
args: [{ selector: 'ud-occupancy-grid', standalone: true, imports: [TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"resize() !== null || move()?.dragging\"\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 <!-- 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 [title]=\"'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 [title]=\"'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 [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 </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 [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 [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (click)=\"onLaneClick($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 [title]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\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 @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 [title]=\"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 </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 @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-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: \"DM Sans\", 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-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:#1b253507}.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__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-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}@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"] }]
|
|
4439
|
+
}], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i0.DestroyRef }] });
|
|
4440
|
+
|
|
3500
4441
|
class SummaryViewComponent {
|
|
3501
4442
|
title = '';
|
|
3502
4443
|
actions = [];
|
|
@@ -4823,6 +5764,293 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
4823
5764
|
type: Output
|
|
4824
5765
|
}] } });
|
|
4825
5766
|
|
|
5767
|
+
const en = {
|
|
5768
|
+
actions: {
|
|
5769
|
+
save: 'Save',
|
|
5770
|
+
cancel: 'Cancel',
|
|
5771
|
+
},
|
|
5772
|
+
names: {
|
|
5773
|
+
// Singular | plural, split on the pipe by TranslateWrapperService.
|
|
5774
|
+
action: 'action | actions',
|
|
5775
|
+
of: 'of',
|
|
5776
|
+
phone: 'phone',
|
|
5777
|
+
},
|
|
5778
|
+
table: {
|
|
5779
|
+
filter: 'Filter',
|
|
5780
|
+
sortOnAnyField: 'Sort on any field',
|
|
5781
|
+
operationType: 'Operation type',
|
|
5782
|
+
matchMode: 'Match mode',
|
|
5783
|
+
dateRange: 'Date range',
|
|
5784
|
+
startDate: 'Start date',
|
|
5785
|
+
endDate: 'End date',
|
|
5786
|
+
columns: 'Columns',
|
|
5787
|
+
chooseColumns: 'Choose columns',
|
|
5788
|
+
chooseColumnsLede: "Turn off the columns you don't need. This only changes your view.",
|
|
5789
|
+
columnsShown: '{{shown}} of {{total}} shown',
|
|
5790
|
+
showAllColumns: 'Show all',
|
|
5791
|
+
atLeastOneColumn: 'Keep at least one column visible.',
|
|
5792
|
+
clearFilters: 'Clear filters',
|
|
5793
|
+
roomIsFull: 'This room is full.',
|
|
5794
|
+
},
|
|
5795
|
+
operators: {
|
|
5796
|
+
minimum: 'Minimum',
|
|
5797
|
+
maximum: 'Maximum',
|
|
5798
|
+
// Keyed by NumberOperator; the table builds the key from the enum value.
|
|
5799
|
+
numbers: {
|
|
5800
|
+
EQUAL: 'Equal',
|
|
5801
|
+
NOT_EQUAL: 'Not equal',
|
|
5802
|
+
GREATER_THAN: 'Greater than',
|
|
5803
|
+
GREATER_THAN_OR_EQUAL: 'Greater than or equal',
|
|
5804
|
+
LESS_THAN: 'Less than',
|
|
5805
|
+
LESS_THAN_OR_EQUAL: 'Less than or equal',
|
|
5806
|
+
BETWEEN: 'Between',
|
|
5807
|
+
},
|
|
5808
|
+
// Keyed by the lowercased MultiSelectMatchMode name, not its value.
|
|
5809
|
+
matchModes: {
|
|
5810
|
+
any: 'Any',
|
|
5811
|
+
all: 'All',
|
|
5812
|
+
exact: 'Exact',
|
|
5813
|
+
},
|
|
5814
|
+
},
|
|
5815
|
+
calendar: {
|
|
5816
|
+
today: 'Today',
|
|
5817
|
+
addSlot: 'Add slot',
|
|
5818
|
+
untitledSlot: 'Untitled slot',
|
|
5819
|
+
booked: 'Booked',
|
|
5820
|
+
available: 'Available',
|
|
5821
|
+
views: { day: 'Day', week: 'Week', month: 'Month' },
|
|
5822
|
+
days: {
|
|
5823
|
+
mon: 'Mon',
|
|
5824
|
+
tue: 'Tue',
|
|
5825
|
+
wed: 'Wed',
|
|
5826
|
+
thu: 'Thu',
|
|
5827
|
+
fri: 'Fri',
|
|
5828
|
+
sat: 'Sat',
|
|
5829
|
+
sun: 'Sun',
|
|
5830
|
+
},
|
|
5831
|
+
},
|
|
5832
|
+
fileInput: {
|
|
5833
|
+
orDropHere: 'or drop files here',
|
|
5834
|
+
},
|
|
5835
|
+
messages: {
|
|
5836
|
+
modifyFilter: 'No results match your filter',
|
|
5837
|
+
validation: {
|
|
5838
|
+
validPhoneNumber: 'Please enter a valid phone number.',
|
|
5839
|
+
},
|
|
5840
|
+
},
|
|
5841
|
+
occupancyGrid: {
|
|
5842
|
+
rooms: 'Rooms',
|
|
5843
|
+
empty: 'No rooms to show',
|
|
5844
|
+
closedReason: 'Closed: {{reason}}',
|
|
5845
|
+
nav: { prev: 'Earlier', next: 'Later' },
|
|
5846
|
+
states: {
|
|
5847
|
+
tentative: 'Tentative',
|
|
5848
|
+
reserved: 'Reserved',
|
|
5849
|
+
in_room: 'In room',
|
|
5850
|
+
history: 'History',
|
|
5851
|
+
closed: 'Closed',
|
|
5852
|
+
},
|
|
5853
|
+
months: {
|
|
5854
|
+
jan: 'Jan',
|
|
5855
|
+
feb: 'Feb',
|
|
5856
|
+
mar: 'Mar',
|
|
5857
|
+
apr: 'Apr',
|
|
5858
|
+
may: 'May',
|
|
5859
|
+
jun: 'Jun',
|
|
5860
|
+
jul: 'Jul',
|
|
5861
|
+
aug: 'Aug',
|
|
5862
|
+
sep: 'Sep',
|
|
5863
|
+
oct: 'Oct',
|
|
5864
|
+
nov: 'Nov',
|
|
5865
|
+
dec: 'Dec',
|
|
5866
|
+
},
|
|
5867
|
+
weekdays: { 0: 'S', 1: 'M', 2: 'T', 3: 'W', 4: 'T', 5: 'F', 6: 'S' },
|
|
5868
|
+
},
|
|
5869
|
+
};
|
|
5870
|
+
const fr = {
|
|
5871
|
+
actions: {
|
|
5872
|
+
save: 'enregistrer',
|
|
5873
|
+
cancel: 'annuler',
|
|
5874
|
+
},
|
|
5875
|
+
names: {
|
|
5876
|
+
action: 'action | actions',
|
|
5877
|
+
of: 'de',
|
|
5878
|
+
phone: 'téléphone',
|
|
5879
|
+
},
|
|
5880
|
+
table: {
|
|
5881
|
+
filter: 'Filtrer',
|
|
5882
|
+
sortOnAnyField: "Trier sur n'importe quel champ",
|
|
5883
|
+
operationType: "Type d'opération",
|
|
5884
|
+
matchMode: 'Mode de correspondance',
|
|
5885
|
+
dateRange: 'Plage de dates',
|
|
5886
|
+
startDate: 'Date de début',
|
|
5887
|
+
endDate: 'Date de fin',
|
|
5888
|
+
columns: 'Colonnes',
|
|
5889
|
+
chooseColumns: 'Choisir les colonnes',
|
|
5890
|
+
chooseColumnsLede: "Désactivez les colonnes dont vous n'avez pas besoin. Cela ne change que votre affichage.",
|
|
5891
|
+
columnsShown: '{{shown}} sur {{total}} affichées',
|
|
5892
|
+
showAllColumns: 'Tout afficher',
|
|
5893
|
+
atLeastOneColumn: 'Gardez au moins une colonne visible.',
|
|
5894
|
+
clearFilters: 'Effacer les filtres',
|
|
5895
|
+
roomIsFull: 'Cette chambre est complète.',
|
|
5896
|
+
},
|
|
5897
|
+
operators: {
|
|
5898
|
+
minimum: 'Minimum',
|
|
5899
|
+
maximum: 'Maximum',
|
|
5900
|
+
numbers: {
|
|
5901
|
+
EQUAL: 'Égal',
|
|
5902
|
+
NOT_EQUAL: 'Différent',
|
|
5903
|
+
GREATER_THAN: 'Supérieur à',
|
|
5904
|
+
GREATER_THAN_OR_EQUAL: 'Supérieur ou égal à',
|
|
5905
|
+
LESS_THAN: 'Inférieur à',
|
|
5906
|
+
LESS_THAN_OR_EQUAL: 'Inférieur ou égal à',
|
|
5907
|
+
BETWEEN: 'Entre',
|
|
5908
|
+
},
|
|
5909
|
+
matchModes: {
|
|
5910
|
+
any: 'Au moins un',
|
|
5911
|
+
all: 'Tous',
|
|
5912
|
+
exact: 'Exact',
|
|
5913
|
+
},
|
|
5914
|
+
},
|
|
5915
|
+
calendar: {
|
|
5916
|
+
today: "Aujourd'hui",
|
|
5917
|
+
addSlot: 'Ajouter un créneau',
|
|
5918
|
+
untitledSlot: 'Créneau sans titre',
|
|
5919
|
+
booked: 'Réservé',
|
|
5920
|
+
available: 'Disponible',
|
|
5921
|
+
views: { day: 'Jour', week: 'Semaine', month: 'Mois' },
|
|
5922
|
+
days: {
|
|
5923
|
+
mon: 'Lun',
|
|
5924
|
+
tue: 'Mar',
|
|
5925
|
+
wed: 'Mer',
|
|
5926
|
+
thu: 'Jeu',
|
|
5927
|
+
fri: 'Ven',
|
|
5928
|
+
sat: 'Sam',
|
|
5929
|
+
sun: 'Dim',
|
|
5930
|
+
},
|
|
5931
|
+
},
|
|
5932
|
+
fileInput: {
|
|
5933
|
+
orDropHere: 'ou déposez les fichiers ici',
|
|
5934
|
+
},
|
|
5935
|
+
messages: {
|
|
5936
|
+
modifyFilter: 'Aucun résultat ne correspond à votre filtre',
|
|
5937
|
+
validation: {
|
|
5938
|
+
validPhoneNumber: 'Veuillez entrer un numéro de téléphone valide.',
|
|
5939
|
+
},
|
|
5940
|
+
},
|
|
5941
|
+
occupancyGrid: {
|
|
5942
|
+
rooms: 'Chambres',
|
|
5943
|
+
empty: 'Aucune chambre à afficher',
|
|
5944
|
+
closedReason: 'Fermée : {{reason}}',
|
|
5945
|
+
nav: { prev: 'Plus tôt', next: 'Plus tard' },
|
|
5946
|
+
states: {
|
|
5947
|
+
tentative: 'Provisoire',
|
|
5948
|
+
reserved: 'Réservée',
|
|
5949
|
+
in_room: 'Occupée',
|
|
5950
|
+
history: 'Historique',
|
|
5951
|
+
closed: 'Fermée',
|
|
5952
|
+
},
|
|
5953
|
+
months: {
|
|
5954
|
+
jan: 'janv.',
|
|
5955
|
+
feb: 'févr.',
|
|
5956
|
+
mar: 'mars',
|
|
5957
|
+
apr: 'avr.',
|
|
5958
|
+
may: 'mai',
|
|
5959
|
+
jun: 'juin',
|
|
5960
|
+
jul: 'juil.',
|
|
5961
|
+
aug: 'août',
|
|
5962
|
+
sep: 'sept.',
|
|
5963
|
+
oct: 'oct.',
|
|
5964
|
+
nov: 'nov.',
|
|
5965
|
+
dec: 'déc.',
|
|
5966
|
+
},
|
|
5967
|
+
weekdays: { 0: 'D', 1: 'L', 2: 'M', 3: 'M', 4: 'J', 5: 'V', 6: 'S' },
|
|
5968
|
+
},
|
|
5969
|
+
};
|
|
5970
|
+
/** Languages the library ships strings for. */
|
|
5971
|
+
const UD_COMPONENTS_TRANSLATIONS = {
|
|
5972
|
+
en,
|
|
5973
|
+
fr,
|
|
5974
|
+
};
|
|
5975
|
+
/**
|
|
5976
|
+
* The library's strings for one language.
|
|
5977
|
+
*
|
|
5978
|
+
* Falls back to the base tag, so `fr-CA` gets the French strings rather than
|
|
5979
|
+
* none. An unknown language returns nothing at all: shipping English under a
|
|
5980
|
+
* label that says otherwise is worse than a visible missing key, because it
|
|
5981
|
+
* looks translated.
|
|
5982
|
+
*/
|
|
5983
|
+
function udComponentsTranslationsFor(lang) {
|
|
5984
|
+
return (UD_COMPONENTS_TRANSLATIONS[lang] ??
|
|
5985
|
+
UD_COMPONENTS_TRANSLATIONS[lang?.split('-')[0]] ??
|
|
5986
|
+
{});
|
|
5987
|
+
}
|
|
5988
|
+
|
|
5989
|
+
/**
|
|
5990
|
+
* Deep merge where the second argument wins.
|
|
5991
|
+
*
|
|
5992
|
+
* Per key, not per namespace: an app that defines `table.filter` must not lose
|
|
5993
|
+
* the other thirteen `table.*` strings the library provides, which is what a
|
|
5994
|
+
* shallow merge of namespaces would do.
|
|
5995
|
+
*/
|
|
5996
|
+
function mergeDeep(base, override) {
|
|
5997
|
+
if (override === null || override === undefined)
|
|
5998
|
+
return base;
|
|
5999
|
+
if (typeof base !== 'object' ||
|
|
6000
|
+
typeof override !== 'object' ||
|
|
6001
|
+
Array.isArray(base) ||
|
|
6002
|
+
Array.isArray(override)) {
|
|
6003
|
+
return override;
|
|
6004
|
+
}
|
|
6005
|
+
const out = { ...base };
|
|
6006
|
+
for (const key of Object.keys(override)) {
|
|
6007
|
+
out[key] = key in base ? mergeDeep(base[key], override[key]) : override[key];
|
|
6008
|
+
}
|
|
6009
|
+
return out;
|
|
6010
|
+
}
|
|
6011
|
+
/**
|
|
6012
|
+
* Wraps a consumer's TranslateLoader so the library's own strings are there
|
|
6013
|
+
* without every app copying them into its en.json.
|
|
6014
|
+
*
|
|
6015
|
+
* Layered rather than merged after the fact: the app's loader is asynchronous,
|
|
6016
|
+
* and racing setTranslation against an HTTP response is how precedence bugs are
|
|
6017
|
+
* born. Here the order is structural — the library is the base, the app's
|
|
6018
|
+
* translations are laid over it — so an app override wins by construction
|
|
6019
|
+
* whenever the app's file happens to arrive.
|
|
6020
|
+
*
|
|
6021
|
+
* The app always wins. `actions.save` and `names.phone` are generic enough that
|
|
6022
|
+
* an app may legitimately want its own wording, and a library that could not be
|
|
6023
|
+
* overridden would be reserving six namespaces across every consumer.
|
|
6024
|
+
*
|
|
6025
|
+
* ```ts
|
|
6026
|
+
* TranslateModule.forRoot({
|
|
6027
|
+
* loader: {
|
|
6028
|
+
* provide: TranslateLoader,
|
|
6029
|
+
* useFactory: (http: HttpClient) =>
|
|
6030
|
+
* withUdComponentsTranslations(new TranslateHttpLoader(http)),
|
|
6031
|
+
* deps: [HttpClient],
|
|
6032
|
+
* },
|
|
6033
|
+
* })
|
|
6034
|
+
* ```
|
|
6035
|
+
*/
|
|
6036
|
+
function withUdComponentsTranslations(appLoader) {
|
|
6037
|
+
return {
|
|
6038
|
+
getTranslation(lang) {
|
|
6039
|
+
const base = udComponentsTranslationsFor(lang);
|
|
6040
|
+
return appLoader.getTranslation(lang).pipe(map(appTranslations => mergeDeep(base, appTranslations ?? {})));
|
|
6041
|
+
},
|
|
6042
|
+
};
|
|
6043
|
+
}
|
|
6044
|
+
/**
|
|
6045
|
+
* For an app with no translation files of its own — the library's strings and
|
|
6046
|
+
* nothing else. Mostly useful in tests and in the explorer.
|
|
6047
|
+
*/
|
|
6048
|
+
function udComponentsOnlyTranslateLoader() {
|
|
6049
|
+
return {
|
|
6050
|
+
getTranslation: (lang) => of(udComponentsTranslationsFor(lang)),
|
|
6051
|
+
};
|
|
6052
|
+
}
|
|
6053
|
+
|
|
4826
6054
|
var FeatureFlagKey;
|
|
4827
6055
|
(function (FeatureFlagKey) {
|
|
4828
6056
|
FeatureFlagKey["ABSENCES"] = "ABSENCES";
|
|
@@ -4907,5 +6135,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
|
|
|
4907
6135
|
* Generated bundle index. Do not edit.
|
|
4908
6136
|
*/
|
|
4909
6137
|
|
|
4910
|
-
export { ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UdButtonComponent, UdButtonToggleComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, capitalize, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, parseLocalDate, pluralize, spaceCase, updateArray, withLoadingState };
|
|
6138
|
+
export { ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, 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, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SafePipe, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, addDays, assignLanes, barGeometry, buildRows, capitalize, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, isIsoDate, laneNeighborBound, maxIso, minIso, monthOf, monthSegments, overlapsRoom, parseLocalDate, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
|
|
4911
6139
|
//# sourceMappingURL=ud-components.mjs.map
|