ud-components 0.7.1 → 0.7.2
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.
|
@@ -3634,12 +3634,16 @@ function buildRows(rooms, dormName, collapsed) {
|
|
|
3634
3634
|
}
|
|
3635
3635
|
for (const room of [...typeRooms].sort((a, b) => numeric(a.number, b.number) || a.roomId.localeCompare(b.roomId))) {
|
|
3636
3636
|
const bars = assignLanes(room.bars);
|
|
3637
|
-
const
|
|
3637
|
+
const used = bars.reduce((max, b) => Math.max(max, b.lane + 1), 0);
|
|
3638
|
+
// A room with spare beds gets one extra empty lane to create a stay
|
|
3639
|
+
// in — an empty room already has its one lane, so it never needs one.
|
|
3640
|
+
const freeLane = used > 0 && room.capacity > used ? used : null;
|
|
3638
3641
|
rows.push({
|
|
3639
3642
|
kind: 'room',
|
|
3640
3643
|
key: `room:${room.roomId}`,
|
|
3641
3644
|
room,
|
|
3642
|
-
lanes,
|
|
3645
|
+
lanes: freeLane === null ? used : used + 1,
|
|
3646
|
+
freeLane,
|
|
3643
3647
|
bars,
|
|
3644
3648
|
});
|
|
3645
3649
|
}
|
|
@@ -3816,6 +3820,51 @@ function laneNeighborBound(laneBars, bookingId, edge, allLanes = false) {
|
|
|
3816
3820
|
function overlapsRoom(room, bookingId, start, end) {
|
|
3817
3821
|
return room.bars.some(b => b.bookingId !== bookingId && start < b.endDate && b.startDate < end);
|
|
3818
3822
|
}
|
|
3823
|
+
/** Whether `[start, end)` overlaps any closed period of the room (half-open, like `overlapsRoom`). */
|
|
3824
|
+
function overlapsClosure(room, start, end) {
|
|
3825
|
+
return room.closures.some(c => start < c.endDate && c.startDate < end);
|
|
3826
|
+
}
|
|
3827
|
+
/**
|
|
3828
|
+
* Pulls a create drag's moving edge back to the nearest closed period between
|
|
3829
|
+
* it and the anchor, so a drag can stop at a closure but never cross it.
|
|
3830
|
+
*/
|
|
3831
|
+
function clampToClosures(room, anchor, date) {
|
|
3832
|
+
if (date > anchor) {
|
|
3833
|
+
return room.closures.reduce((edge, c) => c.startDate >= anchor && c.startDate < edge ? c.startDate : edge, date);
|
|
3834
|
+
}
|
|
3835
|
+
return room.closures.reduce((edge, c) => (c.endDate <= anchor && c.endDate > edge ? c.endDate : edge), date);
|
|
3836
|
+
}
|
|
3837
|
+
/**
|
|
3838
|
+
* The lane a new stay over `[start, end)` would sit in: the first lane of the
|
|
3839
|
+
* row with no bar in that span (the same greedy rule `assignLanes` uses), or,
|
|
3840
|
+
* when every lane is taken, the position just below the last one. The stay
|
|
3841
|
+
* being moved (`ignoreBookingId`, '' for a new one) is not an obstacle.
|
|
3842
|
+
*/
|
|
3843
|
+
function laneForSpan(row, start, end, ignoreBookingId) {
|
|
3844
|
+
for (let lane = 0; lane < row.lanes; lane++) {
|
|
3845
|
+
const taken = row.bars.some(lb => lb.lane === lane &&
|
|
3846
|
+
lb.bar.bookingId !== ignoreBookingId &&
|
|
3847
|
+
start < lb.bar.endDate &&
|
|
3848
|
+
lb.bar.startDate < end);
|
|
3849
|
+
if (!taken) {
|
|
3850
|
+
return lane;
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
return row.lanes;
|
|
3854
|
+
}
|
|
3855
|
+
/**
|
|
3856
|
+
* Whether putting a stay over `[start, end)` in this room would leave any
|
|
3857
|
+
* night with more stays than beds. `bookingId` is the stay being moved or
|
|
3858
|
+
* resized, so it does not count against itself (pass '' for a new stay).
|
|
3859
|
+
*/
|
|
3860
|
+
function overbooksRoom(room, bookingId, start, end) {
|
|
3861
|
+
const others = room.bars.filter(b => b.bookingId !== bookingId && start < b.endDate && b.startDate < end);
|
|
3862
|
+
// Occupancy only rises where a stay starts, so those are the nights to check.
|
|
3863
|
+
return [start, ...others.map(b => b.startDate)].some(night => night >= start &&
|
|
3864
|
+
night < end &&
|
|
3865
|
+
others.filter(b => b.startDate <= night && night < b.endDate).length >=
|
|
3866
|
+
room.capacity);
|
|
3867
|
+
}
|
|
3819
3868
|
|
|
3820
3869
|
const OCCUPANCY_GRID_HEADER_HEIGHT = 52;
|
|
3821
3870
|
/** How far the pointer must move before a mousedown on a bar's body becomes a whole-bar drag rather than a click. */
|
|
@@ -3841,6 +3890,7 @@ const MOVE_DRAG_THRESHOLD_PX = 4;
|
|
|
3841
3890
|
*/
|
|
3842
3891
|
class OccupancyGridComponent {
|
|
3843
3892
|
translate;
|
|
3893
|
+
snackBar;
|
|
3844
3894
|
rooms = input([]);
|
|
3845
3895
|
dormName = input('');
|
|
3846
3896
|
from = input.required();
|
|
@@ -3865,6 +3915,13 @@ class OccupancyGridComponent {
|
|
|
3865
3915
|
* to the last placement that did not.
|
|
3866
3916
|
*/
|
|
3867
3917
|
preventOverlap = input(false);
|
|
3918
|
+
/**
|
|
3919
|
+
* Off by default, like `preventOverlap`: the grid otherwise defers capacity
|
|
3920
|
+
* to the consumer. When set, a create, move or resize that would put more
|
|
3921
|
+
* stays in a room than it has beds on some night is dropped instead of
|
|
3922
|
+
* emitted, the bar stays where it was, and a snackbar says why.
|
|
3923
|
+
*/
|
|
3924
|
+
preventOverbooking = input(false);
|
|
3868
3925
|
barClick = output();
|
|
3869
3926
|
closureClick = output();
|
|
3870
3927
|
roomClick = output();
|
|
@@ -3957,6 +4014,12 @@ class OccupancyGridComponent {
|
|
|
3957
4014
|
* it never competes with that gesture's own preview.
|
|
3958
4015
|
*/
|
|
3959
4016
|
laneHover = signal(null);
|
|
4017
|
+
/**
|
|
4018
|
+
* The pointer is over a bar or closure. Suppresses the focus-cursor
|
|
4019
|
+
* fallback in `laneCursorGeometry`, so a stale keyboard cell does not show
|
|
4020
|
+
* up elsewhere while the pointer is on a stay.
|
|
4021
|
+
*/
|
|
4022
|
+
pointerOnBar = signal(false);
|
|
3960
4023
|
// A drag that ends with the pointer over the lane (not back over the
|
|
3961
4024
|
// handle, or not back over the bar's own body) still makes the browser
|
|
3962
4025
|
// synthesize a `click` right after the `mouseup`, targeted at the nearest
|
|
@@ -3970,8 +4033,9 @@ class OccupancyGridComponent {
|
|
|
3970
4033
|
// survives to swallow some later, unrelated click.
|
|
3971
4034
|
suppressNextClick = false;
|
|
3972
4035
|
suppressNextClickTimer = null;
|
|
3973
|
-
constructor(translate, destroyRef) {
|
|
4036
|
+
constructor(translate, snackBar, destroyRef) {
|
|
3974
4037
|
this.translate = translate;
|
|
4038
|
+
this.snackBar = snackBar;
|
|
3975
4039
|
// A drag that is still active when the component is torn down (e.g. the
|
|
3976
4040
|
// consumer navigates away mid-drag) must not leave window-level
|
|
3977
4041
|
// listeners behind — they would keep firing against a destroyed
|
|
@@ -4040,9 +4104,16 @@ class OccupancyGridComponent {
|
|
|
4040
4104
|
if (!geometry || !targetRow) {
|
|
4041
4105
|
return null;
|
|
4042
4106
|
}
|
|
4107
|
+
// Like the create ghost: a span over another stay sits in a free lane, or
|
|
4108
|
+
// just below the row, instead of covering it. The moving bar itself is
|
|
4109
|
+
// not an obstacle.
|
|
4110
|
+
const lane = laneForSpan(targetRow.row, m.previewStartDate, m.previewEndDate, m.bar.bookingId);
|
|
4043
4111
|
return {
|
|
4044
4112
|
left: this.leftColumnWidth() + geometry.left + 1,
|
|
4045
|
-
top: this.headerHeight +
|
|
4113
|
+
top: this.headerHeight +
|
|
4114
|
+
targetRow.top +
|
|
4115
|
+
4 +
|
|
4116
|
+
lane * (this.laneHeight() + 4),
|
|
4046
4117
|
width: geometry.width - 2,
|
|
4047
4118
|
height: this.laneHeight(),
|
|
4048
4119
|
label: m.bar.studentName,
|
|
@@ -4055,7 +4126,13 @@ class OccupancyGridComponent {
|
|
|
4055
4126
|
if (!c || !c.dragging) {
|
|
4056
4127
|
return null;
|
|
4057
4128
|
}
|
|
4058
|
-
|
|
4129
|
+
// A span that runs over an existing bar moves into a free lane, or just
|
|
4130
|
+
// below the row when none is free, instead of covering the bar.
|
|
4131
|
+
const row = this.positioned().find(p => p.row.kind === 'room' && p.row.room.roomId === c.room.roomId)?.row;
|
|
4132
|
+
const lane = row
|
|
4133
|
+
? laneForSpan(row, c.previewStart, c.previewEnd, '')
|
|
4134
|
+
: c.lane;
|
|
4135
|
+
return this.ghostGeometry(c.room, c.previewStart, c.previewEnd, lane);
|
|
4059
4136
|
});
|
|
4060
4137
|
/**
|
|
4061
4138
|
* The empty cell to outline — the mouse hover position if the pointer is
|
|
@@ -4066,7 +4143,7 @@ class OccupancyGridComponent {
|
|
|
4066
4143
|
if (this.create()) {
|
|
4067
4144
|
return null;
|
|
4068
4145
|
}
|
|
4069
|
-
const f = this.laneHover() ?? this.laneFocus();
|
|
4146
|
+
const f = this.laneHover() ?? (this.pointerOnBar() ? null : this.laneFocus());
|
|
4070
4147
|
if (!f) {
|
|
4071
4148
|
return null;
|
|
4072
4149
|
}
|
|
@@ -4074,10 +4151,11 @@ class OccupancyGridComponent {
|
|
|
4074
4151
|
if (!room) {
|
|
4075
4152
|
return null;
|
|
4076
4153
|
}
|
|
4077
|
-
|
|
4154
|
+
const lane = 'lane' in f ? f.lane : this.createLane(room);
|
|
4155
|
+
return this.ghostGeometry(room, f.date, addDays(f.date, 1), lane);
|
|
4078
4156
|
});
|
|
4079
|
-
/** Canvas-coordinate box for a date span in a given room's row — shared by `createGhost` and `laneCursorGeometry
|
|
4080
|
-
ghostGeometry(room, start, end) {
|
|
4157
|
+
/** Canvas-coordinate box for a date span in a given room's row — shared by `createGhost` and `laneCursorGeometry`; `lane` picks which of the row's lanes it sits in. */
|
|
4158
|
+
ghostGeometry(room, start, end, lane) {
|
|
4081
4159
|
const geometry = barGeometry({ startDate: start, endDate: end }, this.from(), this.to(), this.dayWidth());
|
|
4082
4160
|
const targetRow = this.positioned().find(p => p.row.kind === 'room' &&
|
|
4083
4161
|
p.row.room.roomId === room.roomId);
|
|
@@ -4086,11 +4164,16 @@ class OccupancyGridComponent {
|
|
|
4086
4164
|
}
|
|
4087
4165
|
return {
|
|
4088
4166
|
left: this.leftColumnWidth() + geometry.left + 1,
|
|
4089
|
-
top: this.headerHeight + targetRow.top + 4,
|
|
4167
|
+
top: this.headerHeight + targetRow.top + 4 + lane * (this.laneHeight() + 4),
|
|
4090
4168
|
width: geometry.width - 2,
|
|
4091
4169
|
height: this.laneHeight(),
|
|
4092
4170
|
};
|
|
4093
4171
|
}
|
|
4172
|
+
/** Where a keyboard create lands: the room's free lane when it has one, else lane 0. */
|
|
4173
|
+
createLane(room) {
|
|
4174
|
+
const row = this.positioned().find(p => p.row.kind === 'room' && p.row.room.roomId === room.roomId);
|
|
4175
|
+
return row?.row?.freeLane ?? 0;
|
|
4176
|
+
}
|
|
4094
4177
|
monthLabels() {
|
|
4095
4178
|
const keys = [
|
|
4096
4179
|
'jan',
|
|
@@ -4301,6 +4384,9 @@ class OccupancyGridComponent {
|
|
|
4301
4384
|
if (r.previewStart === r.bar.startDate && r.previewEnd === r.bar.endDate) {
|
|
4302
4385
|
return;
|
|
4303
4386
|
}
|
|
4387
|
+
if (this.rejectIfOverbooked(r.room, r.bar.bookingId, r.previewStart, r.previewEnd)) {
|
|
4388
|
+
return;
|
|
4389
|
+
}
|
|
4304
4390
|
this.barResize.emit({
|
|
4305
4391
|
bar: r.bar,
|
|
4306
4392
|
room: r.room,
|
|
@@ -4311,6 +4397,30 @@ class OccupancyGridComponent {
|
|
|
4311
4397
|
proposedEndDate: r.previewEnd,
|
|
4312
4398
|
});
|
|
4313
4399
|
}
|
|
4400
|
+
/**
|
|
4401
|
+
* With `preventOverbooking`, a gesture that would put more stays in a room
|
|
4402
|
+
* than it has beds is dropped here, so the bar simply stays where it was,
|
|
4403
|
+
* with a snackbar saying why.
|
|
4404
|
+
*/
|
|
4405
|
+
rejectIfOverbooked(room, bookingId, start, end) {
|
|
4406
|
+
if (!this.preventOverbooking() ||
|
|
4407
|
+
!overbooksRoom(room, bookingId, start, end)) {
|
|
4408
|
+
return false;
|
|
4409
|
+
}
|
|
4410
|
+
this.snackBar.openFromComponent(CustomSnackbarComponent, {
|
|
4411
|
+
horizontalPosition: 'end',
|
|
4412
|
+
verticalPosition: 'top',
|
|
4413
|
+
panelClass: ['custom-snackbar-container'],
|
|
4414
|
+
data: {
|
|
4415
|
+
message: this.translate.instant('occupancyGrid.overbooked', {
|
|
4416
|
+
room: room.number,
|
|
4417
|
+
}),
|
|
4418
|
+
type: SnackbarType.WARNING,
|
|
4419
|
+
duration: 3000,
|
|
4420
|
+
},
|
|
4421
|
+
});
|
|
4422
|
+
return true;
|
|
4423
|
+
}
|
|
4314
4424
|
removeDragListeners() {
|
|
4315
4425
|
if (this.dragMoveListener) {
|
|
4316
4426
|
window.removeEventListener('mousemove', this.dragMoveListener);
|
|
@@ -4416,6 +4526,9 @@ class OccupancyGridComponent {
|
|
|
4416
4526
|
m.targetRoom.roomId === m.fromRoom.roomId) {
|
|
4417
4527
|
return;
|
|
4418
4528
|
}
|
|
4529
|
+
if (this.rejectIfOverbooked(m.targetRoom, m.bar.bookingId, m.previewStartDate, m.previewEndDate)) {
|
|
4530
|
+
return;
|
|
4531
|
+
}
|
|
4419
4532
|
this.barMove.emit({
|
|
4420
4533
|
bar: m.bar,
|
|
4421
4534
|
fromRoom: m.fromRoom,
|
|
@@ -4447,13 +4560,17 @@ class OccupancyGridComponent {
|
|
|
4447
4560
|
* still falls through to `onLaneClick`'s `cellClick` unchanged, since
|
|
4448
4561
|
* `endCreate` only emits once `dragging` has flipped true.
|
|
4449
4562
|
*/
|
|
4450
|
-
startCreate(event, room) {
|
|
4563
|
+
startCreate(event, room, lane = 0) {
|
|
4451
4564
|
if (event.button !== 0) {
|
|
4452
4565
|
return;
|
|
4453
4566
|
}
|
|
4454
4567
|
const startDate = this.clientXToDate(event.clientX);
|
|
4568
|
+
if (overlapsClosure(room, startDate, addDays(startDate, 1))) {
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4455
4571
|
this.create.set({
|
|
4456
4572
|
room,
|
|
4573
|
+
lane,
|
|
4457
4574
|
startDate,
|
|
4458
4575
|
startClientX: event.clientX,
|
|
4459
4576
|
previewStart: startDate,
|
|
@@ -4481,7 +4598,7 @@ class OccupancyGridComponent {
|
|
|
4481
4598
|
if (!c.dragging && Math.abs(dx) < MOVE_DRAG_THRESHOLD_PX) {
|
|
4482
4599
|
return;
|
|
4483
4600
|
}
|
|
4484
|
-
const date = this.clientXToDate(event.clientX);
|
|
4601
|
+
const date = clampToClosures(c.room, c.startDate, this.clientXToDate(event.clientX));
|
|
4485
4602
|
let start = c.startDate;
|
|
4486
4603
|
let end = date;
|
|
4487
4604
|
if (end < start) {
|
|
@@ -4522,6 +4639,9 @@ class OccupancyGridComponent {
|
|
|
4522
4639
|
if (!c.dragging || !commit) {
|
|
4523
4640
|
return;
|
|
4524
4641
|
}
|
|
4642
|
+
if (this.rejectIfOverbooked(c.room, '', c.previewStart, c.previewEnd)) {
|
|
4643
|
+
return;
|
|
4644
|
+
}
|
|
4525
4645
|
this.barCreate.emit({
|
|
4526
4646
|
room: c.room,
|
|
4527
4647
|
proposedStartDate: c.previewStart,
|
|
@@ -4567,23 +4687,32 @@ class OccupancyGridComponent {
|
|
|
4567
4687
|
* landing on the background itself, so hovering an existing booking does
|
|
4568
4688
|
* not also outline the empty-cell cursor underneath it.
|
|
4569
4689
|
*/
|
|
4570
|
-
onLaneMouseMove(event, room) {
|
|
4690
|
+
onLaneMouseMove(event, room, lane = 0) {
|
|
4571
4691
|
if (this.create() || this.resize() || this.move()?.dragging) {
|
|
4572
4692
|
this.laneHover.set(null);
|
|
4573
4693
|
return;
|
|
4574
4694
|
}
|
|
4575
4695
|
if (event.target !== event.currentTarget) {
|
|
4576
|
-
|
|
4696
|
+
// The free lane handles its own moves; its bubbled event is not a bar.
|
|
4697
|
+
if (!event.target.classList.contains('occ__lane-free')) {
|
|
4698
|
+
this.laneHover.set(null);
|
|
4699
|
+
this.pointerOnBar.set(true);
|
|
4700
|
+
}
|
|
4577
4701
|
return;
|
|
4578
4702
|
}
|
|
4703
|
+
this.pointerOnBar.set(false);
|
|
4579
4704
|
const date = this.clientXToDate(event.clientX);
|
|
4580
4705
|
const cur = this.laneHover();
|
|
4581
|
-
if (cur &&
|
|
4706
|
+
if (cur &&
|
|
4707
|
+
cur.roomId === room.roomId &&
|
|
4708
|
+
cur.date === date &&
|
|
4709
|
+
cur.lane === lane) {
|
|
4582
4710
|
return;
|
|
4583
4711
|
}
|
|
4584
|
-
this.laneHover.set({ roomId: room.roomId, date });
|
|
4712
|
+
this.laneHover.set({ roomId: room.roomId, date, lane });
|
|
4585
4713
|
}
|
|
4586
4714
|
onLaneMouseLeave(room) {
|
|
4715
|
+
this.pointerOnBar.set(false);
|
|
4587
4716
|
const cur = this.laneHover();
|
|
4588
4717
|
if (cur && cur.roomId === room.roomId) {
|
|
4589
4718
|
this.laneHover.set(null);
|
|
@@ -4628,7 +4757,8 @@ class OccupancyGridComponent {
|
|
|
4628
4757
|
if (next <= c.previewStart) {
|
|
4629
4758
|
next = addDays(c.previewStart, 1);
|
|
4630
4759
|
}
|
|
4631
|
-
if (
|
|
4760
|
+
if (overlapsClosure(room, c.previewStart, next) ||
|
|
4761
|
+
(this.preventOverlap() && overlapsRoom(room, '', c.previewStart, next))) {
|
|
4632
4762
|
return;
|
|
4633
4763
|
}
|
|
4634
4764
|
this.create.set({ ...c, previewEnd: next });
|
|
@@ -4653,8 +4783,12 @@ class OccupancyGridComponent {
|
|
|
4653
4783
|
}
|
|
4654
4784
|
else if (event.key === 'Enter' || event.key === ' ') {
|
|
4655
4785
|
event.preventDefault();
|
|
4786
|
+
if (overlapsClosure(room, cur.date, addDays(cur.date, 1))) {
|
|
4787
|
+
return;
|
|
4788
|
+
}
|
|
4656
4789
|
this.create.set({
|
|
4657
4790
|
room,
|
|
4791
|
+
lane: this.createLane(room),
|
|
4658
4792
|
startDate: cur.date,
|
|
4659
4793
|
startClientX: 0,
|
|
4660
4794
|
previewStart: cur.date,
|
|
@@ -4725,6 +4859,9 @@ class OccupancyGridComponent {
|
|
|
4725
4859
|
if (next === bar.endDate) {
|
|
4726
4860
|
return;
|
|
4727
4861
|
}
|
|
4862
|
+
if (this.rejectIfOverbooked(room, bar.bookingId, bar.startDate, next)) {
|
|
4863
|
+
return;
|
|
4864
|
+
}
|
|
4728
4865
|
this.barResize.emit({
|
|
4729
4866
|
bar,
|
|
4730
4867
|
room,
|
|
@@ -4735,13 +4872,13 @@ class OccupancyGridComponent {
|
|
|
4735
4872
|
proposedEndDate: next,
|
|
4736
4873
|
});
|
|
4737
4874
|
}
|
|
4738
|
-
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 });
|
|
4739
|
-
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", barCreate: "barCreate" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\">\n <!-- 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 tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [title]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @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 <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-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--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4875
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i1$1.MatSnackBar }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4876
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: OccupancyGridComponent, isStandalone: true, selector: "ud-occupancy-grid", inputs: { rooms: { classPropertyName: "rooms", publicName: "rooms", isSignal: true, isRequired: false, transformFunction: null }, dormName: { classPropertyName: "dormName", publicName: "dormName", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, preventOverbooking: { classPropertyName: "preventOverbooking", publicName: "preventOverbooking", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", roomClick: "roomClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\">\n <!-- 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 tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [title]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @if (asRoomRow(p.row).freeLane !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"\n 4 + asRoomRow(p.row).freeLane! * (laneHeight() + 4)\n \"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"\n (mousemove)=\"\n onLaneMouseMove(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"></div>\n }\n @for (lb of asRoomRow(p.row).bars; track lb.bar.bookingId) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-resizing]=\"isResizing(lb.bar.bookingId)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.bookingId)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.lane * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [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 <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-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__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"], dependencies: [{ kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4740
4877
|
}
|
|
4741
4878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, decorators: [{
|
|
4742
4879
|
type: Component,
|
|
4743
|
-
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]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\">\n <!-- 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 tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [title]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @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 <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-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--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"] }]
|
|
4744
|
-
}], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i0.DestroyRef }] });
|
|
4880
|
+
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]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\">\n <!-- 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 tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [title]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @if (asRoomRow(p.row).freeLane !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"\n 4 + asRoomRow(p.row).freeLane! * (laneHeight() + 4)\n \"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"\n (mousemove)=\"\n onLaneMouseMove(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"></div>\n }\n @for (lb of asRoomRow(p.row).bars; track lb.bar.bookingId) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-resizing]=\"isResizing(lb.bar.bookingId)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.bookingId)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.lane * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [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 <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-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__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"] }]
|
|
4881
|
+
}], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i1$1.MatSnackBar }, { type: i0.DestroyRef }] });
|
|
4745
4882
|
|
|
4746
4883
|
class SummaryViewComponent {
|
|
4747
4884
|
title = '';
|
|
@@ -6148,6 +6285,7 @@ const en = {
|
|
|
6148
6285
|
empty: 'No rooms to show',
|
|
6149
6286
|
closedReason: 'Closed: {{reason}}',
|
|
6150
6287
|
createCell: 'Room {{room}}, press Enter to start a new booking',
|
|
6288
|
+
overbooked: 'Room {{room}} would be overbooked, so the change was not made',
|
|
6151
6289
|
nav: { prev: 'Earlier', next: 'Later' },
|
|
6152
6290
|
states: {
|
|
6153
6291
|
tentative: 'Tentative',
|
|
@@ -6249,6 +6387,7 @@ const fr = {
|
|
|
6249
6387
|
empty: 'Aucune chambre à afficher',
|
|
6250
6388
|
closedReason: 'Fermée : {{reason}}',
|
|
6251
6389
|
createCell: 'Chambre {{room}}, appuyez sur Entrée pour créer une réservation',
|
|
6390
|
+
overbooked: 'La chambre {{room}} serait en surréservation, la modification n’a pas été faite',
|
|
6252
6391
|
nav: { prev: 'Plus tôt', next: 'Plus tard' },
|
|
6253
6392
|
states: {
|
|
6254
6393
|
tentative: 'Provisoire',
|
|
@@ -6442,5 +6581,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
|
|
|
6442
6581
|
* Generated bundle index. Do not edit.
|
|
6443
6582
|
*/
|
|
6444
6583
|
|
|
6445
|
-
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 };
|
|
6584
|
+
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, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
|
|
6446
6585
|
//# sourceMappingURL=ud-components.mjs.map
|