ud-components 0.8.13 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4448,7 +4448,7 @@ function minIso(a, b) {
4448
4448
  return a <= b ? a : b;
4449
4449
  }
4450
4450
 
4451
- const numeric = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
4451
+ const numeric$1 = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
4452
4452
  /** Greedy interval packing. Half-open, so a bar starting the day another ends shares its lane. */
4453
4453
  function assignLanes(bars) {
4454
4454
  const sorted = [...bars].sort((a, b) => a.startDate.localeCompare(b.startDate) ||
@@ -4489,7 +4489,7 @@ function buildRows(rooms, dormName, collapsed) {
4489
4489
  list.push(room);
4490
4490
  byFloor.set(room.floorLevel, list);
4491
4491
  }
4492
- for (const floorLevel of [...byFloor.keys()].sort(numeric)) {
4492
+ for (const floorLevel of [...byFloor.keys()].sort(numeric$1)) {
4493
4493
  const floorRooms = byFloor.get(floorLevel);
4494
4494
  const floorKey = `${dormKey}/floor:${floorLevel}`;
4495
4495
  rows.push({
@@ -4508,7 +4508,7 @@ function buildRows(rooms, dormName, collapsed) {
4508
4508
  list.push(room);
4509
4509
  byType.set(room.type, list);
4510
4510
  }
4511
- for (const type of [...byType.keys()].sort(numeric)) {
4511
+ for (const type of [...byType.keys()].sort(numeric$1)) {
4512
4512
  const typeRooms = byType.get(type);
4513
4513
  const typeKey = `${floorKey}/type:${type}`;
4514
4514
  rows.push({
@@ -4521,7 +4521,7 @@ function buildRows(rooms, dormName, collapsed) {
4521
4521
  if (collapsed.has(typeKey)) {
4522
4522
  continue;
4523
4523
  }
4524
- for (const room of [...typeRooms].sort((a, b) => numeric(a.number, b.number) || a.roomId.localeCompare(b.roomId))) {
4524
+ for (const room of [...typeRooms].sort((a, b) => numeric$1(a.number, b.number) || a.roomId.localeCompare(b.roomId))) {
4525
4525
  const bars = assignLanes(room.bars);
4526
4526
  const used = bars.reduce((max, b) => Math.max(max, b.lane + 1), 0);
4527
4527
  // A room with spare beds gets one extra empty lane to create a stay
@@ -4755,21 +4755,195 @@ function overbooksRoom(room, bookingId, start, end) {
4755
4755
  room.capacity);
4756
4756
  }
4757
4757
 
4758
- const OCCUPANCY_GRID_HEADER_HEIGHT = 52;
4758
+ /**
4759
+ * Stands in for an open-ended bar's end everywhere a date is compared, so the
4760
+ * packing, overlap and geometry code never needs a null branch. Never emitted:
4761
+ * the component turns it back into null on the way out.
4762
+ */
4763
+ const OPEN_END = '9999-12-31';
4764
+ function endOf(bar) {
4765
+ return bar.endDate ?? OPEN_END;
4766
+ }
4767
+ /** Greedy interval packing. Half-open, so a bar starting the day another ends shares its slot. */
4768
+ function packBars(bars) {
4769
+ const sorted = [...bars].sort((a, b) => a.startDate.localeCompare(b.startDate) || a.id.localeCompare(b.id));
4770
+ const slotEnds = [];
4771
+ return sorted.map(bar => {
4772
+ let slot = slotEnds.findIndex(end => end <= bar.startDate);
4773
+ if (slot === -1) {
4774
+ slot = slotEnds.length;
4775
+ slotEnds.push(endOf(bar));
4776
+ }
4777
+ else {
4778
+ slotEnds[slot] = endOf(bar);
4779
+ }
4780
+ return { bar, slot };
4781
+ });
4782
+ }
4783
+ function laneCount(node) {
4784
+ let count = node.lanes.length;
4785
+ for (const child of node.children.values()) {
4786
+ count += laneCount(child);
4787
+ }
4788
+ return count;
4789
+ }
4790
+ /**
4791
+ * Lanes under their group headers (outer groups first), groups in the order
4792
+ * they first appear and lanes in input order. Collapsed groups hide everything
4793
+ * below them.
4794
+ */
4795
+ function buildTimelineRows(lanes, collapsed) {
4796
+ const root = {
4797
+ key: '',
4798
+ label: '',
4799
+ children: new Map(),
4800
+ lanes: [],
4801
+ };
4802
+ for (const lane of lanes) {
4803
+ let node = root;
4804
+ for (const g of [
4805
+ ...(lane.parentGroups ?? []),
4806
+ { id: lane.groupId, label: lane.groupLabel },
4807
+ ]) {
4808
+ let child = node.children.get(g.id);
4809
+ if (!child) {
4810
+ child = {
4811
+ key: node.key ? `${node.key}/${g.id}` : g.id,
4812
+ label: g.label,
4813
+ children: new Map(),
4814
+ lanes: [],
4815
+ };
4816
+ node.children.set(g.id, child);
4817
+ }
4818
+ node = child;
4819
+ }
4820
+ node.lanes.push(lane);
4821
+ }
4822
+ const rows = [];
4823
+ const walk = (node, depth) => {
4824
+ for (const child of node.children.values()) {
4825
+ rows.push({
4826
+ kind: 'group',
4827
+ key: child.key,
4828
+ depth,
4829
+ label: child.label,
4830
+ laneCount: laneCount(child),
4831
+ });
4832
+ if (!collapsed.has(child.key)) {
4833
+ walk(child, depth + 1);
4834
+ }
4835
+ }
4836
+ for (const lane of node.lanes) {
4837
+ const bars = packBars(lane.bars);
4838
+ const used = bars.reduce((max, b) => Math.max(max, b.slot + 1), 0);
4839
+ // A lane with spare capacity gets one extra empty slot to create in; an
4840
+ // empty lane already has its one slot.
4841
+ const freeSlot = used > 0 && (lane.capacity ?? 1) > used ? used : null;
4842
+ rows.push({
4843
+ kind: 'lane',
4844
+ key: `lane:${lane.id}`,
4845
+ lane,
4846
+ slots: freeSlot === null ? used : used + 1,
4847
+ freeSlot,
4848
+ bars,
4849
+ });
4850
+ }
4851
+ };
4852
+ walk(root, 0);
4853
+ return rows;
4854
+ }
4855
+ function positionTimelineRows(rows, laneHeight) {
4856
+ let top = 0;
4857
+ return rows.map(row => {
4858
+ const slots = row.kind === 'group' ? 0 : Math.max(1, row.slots);
4859
+ const height = row.kind === 'group'
4860
+ ? GROUP_ROW_HEIGHT
4861
+ : 8 + slots * laneHeight + (slots - 1) * 4;
4862
+ const positioned = { row, top, height };
4863
+ top += height;
4864
+ return positioned;
4865
+ });
4866
+ }
4867
+ /** Bars whose days include `date`. */
4868
+ function takenOnLane(lane, date) {
4869
+ return lane.bars.filter(b => b.startDate <= date && date < endOf(b)).length;
4870
+ }
4871
+ /**
4872
+ * The nearest neighbouring bar's boundary on the given edge: the limit a drag
4873
+ * on that edge must not cross. Same slot only, unless `allSlots`.
4874
+ */
4875
+ function neighborBound(laneBars, barId, edge, allSlots = false) {
4876
+ const mine = laneBars.find(lb => lb.bar.id === barId);
4877
+ if (!mine) {
4878
+ return null;
4879
+ }
4880
+ const others = laneBars.filter(lb => lb.bar.id !== barId && (allSlots || lb.slot === mine.slot));
4881
+ if (edge === 'start') {
4882
+ const before = others.filter(lb => endOf(lb.bar) <= mine.bar.startDate);
4883
+ if (before.length === 0) {
4884
+ return null;
4885
+ }
4886
+ return endOf(before.reduce((a, b) => (endOf(a.bar) > endOf(b.bar) ? a : b)).bar);
4887
+ }
4888
+ const after = others.filter(lb => lb.bar.startDate >= endOf(mine.bar));
4889
+ if (after.length === 0) {
4890
+ return null;
4891
+ }
4892
+ return after.reduce((a, b) => (a.bar.startDate < b.bar.startDate ? a : b)).bar
4893
+ .startDate;
4894
+ }
4895
+ /** Whether `[start, end)` overlaps any OTHER bar in the lane (half-open). */
4896
+ function overlapsLane(lane, barId, start, end) {
4897
+ return lane.bars.some(b => b.id !== barId && start < endOf(b) && b.startDate < end);
4898
+ }
4899
+ /**
4900
+ * The slot a bar over `[start, end)` would sit in: the first one clear of
4901
+ * other bars, or just below the last when none is. `ignoreBarId` ('' for a
4902
+ * new bar) is not an obstacle.
4903
+ */
4904
+ function slotForSpan(row, start, end, ignoreBarId) {
4905
+ for (let slot = 0; slot < row.slots; slot++) {
4906
+ const taken = row.bars.some(lb => lb.slot === slot &&
4907
+ lb.bar.id !== ignoreBarId &&
4908
+ start < endOf(lb.bar) &&
4909
+ lb.bar.startDate < end);
4910
+ if (!taken) {
4911
+ return slot;
4912
+ }
4913
+ }
4914
+ return row.slots;
4915
+ }
4916
+
4917
+ const TIMELINE_GRID_HEADER_HEIGHT = 52;
4759
4918
  /** How far the pointer must move before a mousedown on a bar's body becomes a whole-bar drag rather than a click. */
4760
4919
  const MOVE_DRAG_THRESHOLD_PX = 4;
4920
+ const TIMELINE_GRID_DEFAULT_LEGEND = [
4921
+ { state: 'tentative', labelKey: 'occupancyGrid.states.tentative' },
4922
+ { state: 'reserved', labelKey: 'occupancyGrid.states.reserved' },
4923
+ { state: 'in_room', labelKey: 'occupancyGrid.states.in_room' },
4924
+ { state: 'history', labelKey: 'occupancyGrid.states.history' },
4925
+ ];
4926
+ /** An open-ended bar's internal end back to the public null. */
4927
+ function publicEnd(end) {
4928
+ return end === OPEN_END ? null : end;
4929
+ }
4761
4930
  /**
4762
- * Rooms as rows, days as columns, one bar per stay (UC-11). It never writes
4763
- * anywhere — `rooms` is the only source of truth and this component never
4764
- * mutates it — but it is not read-only in the sense of being inert: a bar's
4765
- * edge can be dragged (or, on a focused bar, Shift + arrow-keyed) to propose
4766
- * a new date, reported via `barResize`; a bar's body can be dragged to a new
4767
- * date, a different room, or both, reported via `barMove`. Every other
4768
- * gesture (clicks, the nav buttons) works the same way: report what
4769
- * happened, apply nothing.
4931
+ * Lanes as rows, days as columns, one bar per occupant (UC-11, made generic in
4932
+ * UC-42; `ud-occupancy-grid` is the rooms-and-stays wrapper around it). It
4933
+ * never writes anywhere — `lanes` is the only source of truth and this
4934
+ * component never mutates it — but it is not inert: a bar's edge can be
4935
+ * dragged (or, on a focused bar, Shift + arrow-keyed) to propose a new date,
4936
+ * reported via `barResize`; a bar's body can be dragged to a new date, a
4937
+ * different lane, or both, reported via `barMove`; an empty stretch can be
4938
+ * dragged across to propose a new bar (`barCreate`); something dragged in from
4939
+ * outside the grid can be dropped on a lane (`laneDrop`). Every gesture works
4940
+ * the same way: report what happened, apply nothing.
4941
+ *
4942
+ * Inside a lane, overlapping bars are packed into slots (sub-rows); a lane
4943
+ * with spare `capacity` also offers one empty slot to create in.
4770
4944
  *
4771
- * Owns its own row virtualization: rows have different heights (one lane per
4772
- * overlapping stay), which the CDK's stable fixed-size strategy cannot do, and
4945
+ * Owns its own row virtualization: rows have different heights (one slot per
4946
+ * overlapping bar), which the CDK's stable fixed-size strategy cannot do, and
4773
4947
  * the autosize strategy is still experimental. Rows are positioned from a
4774
4948
  * prefix sum of heights and only those intersecting the viewport are rendered.
4775
4949
  *
@@ -4777,11 +4951,9 @@ const MOVE_DRAG_THRESHOLD_PX = 4;
4777
4951
  * local-date.ts; `new Date(string)` is never used, so a column can never be
4778
4952
  * off by one west of Greenwich.
4779
4953
  */
4780
- class OccupancyGridComponent {
4954
+ class TimelineGridComponent {
4781
4955
  translate;
4782
- snackBar;
4783
- rooms = input([]);
4784
- dormName = input('');
4956
+ lanes = input([]);
4785
4957
  from = input.required();
4786
4958
  to = input.required();
4787
4959
  today = input(null);
@@ -4792,150 +4964,126 @@ class OccupancyGridComponent {
4792
4964
  /** Days the ‹ / › nav buttons and the ArrowLeft/ArrowRight keys shift the window by. */
4793
4965
  navStepDays = input(7);
4794
4966
  /**
4795
- * When true, a resize or whole-bar move drag is never allowed to leave
4796
- * two bars in the same room overlapping in time. The default (false)
4797
- * lets bars in different lanes of the same room legitimately overlap —
4798
- * an outgoing stay's last few nights next to an incoming one's first, say
4799
- * — which is exactly what the lane system exists to display. A strict
4800
- * room grid, where a room can hold only one booking at a time, sets this
4801
- * so a drag simply cannot propose a second one over it: a resize clamps
4802
- * at the nearest other bar in the room (not just its own lane), and a
4803
- * move drag ignores any candidate date/room that would overlap, sticking
4804
- * to the last placement that did not.
4967
+ * When true, a resize, move or create drag is never allowed to leave two
4968
+ * bars in the same lane overlapping in time: a resize clamps at the nearest
4969
+ * other bar in the lane (not just its own slot), and a move or create
4970
+ * ignores any candidate that would overlap, sticking to the last one that
4971
+ * did not. Off by default, because a lane with capacity legitimately holds
4972
+ * overlapping bars in different slots.
4805
4973
  */
4806
4974
  preventOverlap = input(false);
4975
+ /** Translation keys for the corner header, the empty state and a lane's aria label (`{{lane}}` and `{{room}}` get the lane label). */
4976
+ cornerLabelKey = input('timelineGrid.lanes');
4977
+ emptyLabelKey = input('timelineGrid.empty');
4978
+ createCellLabelKey = input('timelineGrid.createCell');
4979
+ /** The bar states listed in the legend, and the label each one shows in a bar's tooltip. */
4980
+ legend = input(TIMELINE_GRID_DEFAULT_LEGEND);
4807
4981
  /**
4808
- * Off by default, like `preventOverlap`: the grid otherwise defers capacity
4809
- * to the consumer. When set, a create, move or resize that would put more
4810
- * stays in a room than it has beds on some night is dropped instead of
4811
- * emitted, the bar stays where it was, and a snackbar says why.
4982
+ * What is being dragged in from outside the grid, or null when nothing is.
4983
+ * The consumer sets it on its own `dragstart` and clears it on `dragend`:
4984
+ * an HTML5 drag's data cannot be read until the drop, so this is how the
4985
+ * grid knows, during the drag, which lanes can take it. Lanes only accept a
4986
+ * drop while it is set.
4812
4987
  */
4813
- preventOverbooking = input(false);
4988
+ dragPayload = input(null);
4989
+ /** Whether a lane can take `dragPayload`. Lanes that cannot are greyed out while the drag is live. Null = every lane can. */
4990
+ canDrop = input(null);
4814
4991
  barClick = output();
4815
4992
  closureClick = output();
4816
- roomClick = output();
4817
- /** An empty day cell was clicked: the room and the date under the pointer. */
4993
+ /** The lane's own header cell was clicked. */
4994
+ laneClick = output();
4995
+ /** An empty day cell was clicked: the lane and the date under the pointer. */
4818
4996
  cellClick = output();
4819
4997
  reachedEnd = output();
4820
4998
  /**
4821
4999
  * The nav buttons or an arrow key asked to move the window. The component
4822
- * does not own `from`/`to` (the consumer does, same as every other input
4823
- * here), so it reports the signed day delta — negative for earlier,
4824
- * positive for later — rather than computing new dates itself. A consumer
4825
- * that wants the shift applied does
4826
- * `from = addDays(from, delta); to = addDays(to, delta)`.
5000
+ * does not own `from`/`to`, so it reports the signed day delta — negative
5001
+ * for earlier, positive for later. A consumer that wants the shift applied
5002
+ * does `from = addDays(from, delta); to = addDays(to, delta)`.
4827
5003
  */
4828
5004
  windowShift = output();
4829
- /**
4830
- * A bar's edge was dragged, or Shift + arrow-keyed, to a new date. See
4831
- * `OccupancyBarResize` — this reports the proposal; it never applies it.
4832
- */
4833
5005
  barResize = output();
4834
- /**
4835
- * A bar's body was dragged to new dates, a different room, or both. See
4836
- * `OccupancyBarMove` — this reports the proposal; it never applies it.
4837
- */
4838
5006
  barMove = output();
4839
- /**
4840
- * A new booking's dates were proposed by dragging across empty lane cells,
4841
- * or by the keyboard-driven create flow (see `onLaneKeydown`). See
4842
- * `OccupancyBarCreate` — this reports the proposal; it never creates a bar
4843
- * itself.
4844
- */
4845
5007
  barCreate = output();
4846
- headerHeight = OCCUPANCY_GRID_HEADER_HEIGHT;
5008
+ laneDrop = output();
5009
+ headerHeight = TIMELINE_GRID_HEADER_HEIGHT;
4847
5010
  scroller = viewChild.required('scroller');
4848
5011
  collapsed = signal(new Set());
4849
5012
  scrollTop = signal(0);
4850
5013
  viewportHeight = signal(600);
4851
5014
  lastEndEmittedFor = null;
4852
5015
  /**
4853
- * The in-progress drag, if any — null the rest of the time. `geometryOf`
4854
- * and `barTitle` read the preview dates for whichever bar this names so
4855
- * the drag renders live; nothing else about `rooms` changes, since the
4856
- * component does not own that input.
5016
+ * The in-progress edge drag, if any. `geometryOf` and `barTitle` read the
5017
+ * preview dates for whichever bar this names so the drag renders live;
5018
+ * nothing about `lanes` changes, since the component does not own it. An
5019
+ * open-ended bar's end is `OPEN_END` here and null again on the way out.
4857
5020
  */
4858
5021
  resize = signal(null);
5022
+ /** Read-only view of `resize`, for a wrapper that surfaces it (ud-occupancy-grid). */
5023
+ activeResize = this.resize.asReadonly();
4859
5024
  dragMoveListener = null;
4860
5025
  dragUpListener = null;
4861
5026
  dragKeyListener = null;
4862
5027
  /**
4863
- * The in-progress whole-bar drag, if any — null the rest of the time.
4864
- * `dragging` only flips true once the pointer clears a small threshold, so
4865
- * a plain click (mousedown + mouseup with no real movement) still opens
4866
- * the drawer as `barClick` instead of being swallowed as a zero-distance
4867
- * move. `targetRoom` starts as `fromRoom` and is re-resolved on every
4868
- * mousemove from whatever `.occ__row--room` is actually under the
4869
- * pointer — see `roomUnderPoint` — so dragging vertically onto another
4870
- * room's row is exactly the gesture `roomUnderPoint` is built to read.
5028
+ * The in-progress whole-bar drag, if any. `dragging` only flips true once
5029
+ * the pointer clears a small threshold, so a plain click still reaches
5030
+ * `barClick`. `targetLane` is re-resolved on every mousemove from whatever
5031
+ * lane row is under the pointer — see `laneUnderPoint`.
4871
5032
  */
4872
5033
  move = signal(null);
4873
5034
  moveMoveListener = null;
4874
5035
  moveUpListener = null;
4875
5036
  moveKeyListener = null;
4876
5037
  /**
4877
- * The in-progress drag-to-create, if any — null the rest of the time.
4878
- * `startDate` is the anchor the drag began from (mouse) or the focused
4879
- * cell it started from (keyboard); `previewStart`/`previewEnd` are what
4880
- * gets emitted. `viaKeyboard` distinguishes the two sources: a mouse
4881
- * create only commits on mouseup and only once it clears the same
4882
- * click-vs-drag threshold `move` uses, while a keyboard create is live the
4883
- * instant Enter starts it (there is no "release" to wait for) and commits
4884
- * on a second Enter.
5038
+ * The in-progress drag-to-create, if any. `startDate` is the anchor the
5039
+ * drag began from (mouse) or the focused cell it started from (keyboard). A
5040
+ * mouse create only commits on mouseup once it clears the click-vs-drag
5041
+ * threshold; a keyboard create is live the instant Enter starts it and
5042
+ * commits on a second Enter.
4885
5043
  */
4886
5044
  create = signal(null);
4887
5045
  createMoveListener = null;
4888
5046
  createUpListener = null;
4889
5047
  createKeyListener = null;
4890
5048
  /**
4891
- * The keyboard-focused empty cell, if any — a room and a date, tracked so
4892
- * Tab can reach an empty lane and arrow keys have somewhere to move from.
4893
- * Cleared on blur unless a keyboard create (see `create`) is in progress,
4894
- * so the highlighted cell does not vanish out from under an active
4895
- * gesture.
5049
+ * The keyboard-focused empty cell, if any. Cleared on blur unless a
5050
+ * keyboard create is in progress, so the highlighted cell does not vanish
5051
+ * out from under an active gesture.
4896
5052
  */
4897
5053
  laneFocus = signal(null);
4898
5054
  /**
4899
- * The day column under the pointer anywhere on the canvas (header, lanes,
4900
- * bars), as an index into days(), or null. Drawn as a full-height band in
4901
- * every visible row and a tinted header cell, so together with the row wash
4902
- * the pointer reads as a crosshair: which room, which night.
5055
+ * The day column under the pointer anywhere on the canvas, as an index into
5056
+ * days(), or null. Drawn as a full-height band, so together with the row
5057
+ * wash the pointer reads as a crosshair: which lane, which day.
4903
5058
  */
4904
5059
  hoverDay = signal(null);
4905
5060
  /**
4906
- * The empty cell the mouse is currently over, if any — the pointer
4907
- * equivalent of `laneFocus`, so a mouse user gets the same "here's what
4908
- * you're about to create on" cue a keyboard user gets from Tab. Cleared
4909
- * whenever any gesture (create, resize, or a whole-bar move) is live, so
4910
- * it never competes with that gesture's own preview.
5061
+ * The empty cell the mouse (or an external drag) is over, if any — the
5062
+ * pointer equivalent of `laneFocus`. Cleared whenever a create, resize or
5063
+ * move is live, so it never competes with that gesture's own preview.
4911
5064
  */
4912
5065
  laneHover = signal(null);
5066
+ /** The lane an external drag is currently over. */
5067
+ dropTarget = signal(null);
4913
5068
  /**
4914
5069
  * The pointer is over a bar or closure. Suppresses the focus-cursor
4915
5070
  * fallback in `laneCursorGeometry`, so a stale keyboard cell does not show
4916
- * up elsewhere while the pointer is on a stay.
5071
+ * up elsewhere while the pointer is on a bar.
4917
5072
  */
4918
5073
  pointerOnBar = signal(false);
4919
- // A drag that ends with the pointer over the lane (not back over the
4920
- // handle, or not back over the bar's own body) still makes the browser
5074
+ // A drag that ends with the pointer over the lane still makes the browser
4921
5075
  // synthesize a `click` right after the `mouseup`, targeted at the nearest
4922
- // common ancestor of the mousedown and mouseup elements — which is the
4923
- // room's lane row, or the bar itself if the drag never left it. Left alone
4924
- // that click would surface as a spurious cellClick or barClick the instant
4925
- // a resize or a whole-bar move finishes. This flag is armed in endResize
4926
- // and endBarMove and consumed by the one click that follows, wherever it
4927
- // lands; the timer is a safety net for the rare case where no click
4928
- // follows at all (e.g. the pointer left the window), so a stray flag never
4929
- // survives to swallow some later, unrelated click.
5076
+ // common ancestor of the mousedown and mouseup elements. Left alone that
5077
+ // click would surface as a spurious cellClick or barClick the instant a
5078
+ // resize or move finishes. This flag is armed when a drag ends and consumed
5079
+ // by the one click that follows; the timer is a safety net for when no
5080
+ // click follows at all, so a stray flag never swallows a later click.
4930
5081
  suppressNextClick = false;
4931
5082
  suppressNextClickTimer = null;
4932
- constructor(translate, snackBar, destroyRef) {
5083
+ constructor(translate, destroyRef) {
4933
5084
  this.translate = translate;
4934
- this.snackBar = snackBar;
4935
- // A drag that is still active when the component is torn down (e.g. the
4936
- // consumer navigates away mid-drag) must not leave window-level
4937
- // listeners behind — they would keep firing against a destroyed
4938
- // component's signals otherwise, and never get cleaned up any other way.
5085
+ // A drag still active when the component is torn down must not leave
5086
+ // window-level listeners behind.
4939
5087
  destroyRef.onDestroy(() => {
4940
5088
  this.removeDragListeners();
4941
5089
  this.removeMoveListeners();
@@ -4949,8 +5097,8 @@ class OccupancyGridComponent {
4949
5097
  ? Math.max(0, daysBetween(this.from(), this.to()))
4950
5098
  : 0);
4951
5099
  canvasWidth = computed(() => this.leftColumnWidth() + this.dayCount() * this.dayWidth());
4952
- rows = computed(() => buildRows(this.rooms(), this.dormName(), this.collapsed()));
4953
- positioned = computed(() => positionRows(this.rows(), this.laneHeight()));
5100
+ rows = computed(() => buildTimelineRows(this.lanes(), this.collapsed()));
5101
+ positioned = computed(() => positionTimelineRows(this.rows(), this.laneHeight()));
4954
5102
  bodyHeight = computed(() => totalHeight(this.positioned()));
4955
5103
  visible = computed(() => {
4956
5104
  const { first, last } = visibleRange(this.positioned(), this.scrollTop(), this.viewportHeight());
@@ -4971,23 +5119,18 @@ class OccupancyGridComponent {
4971
5119
  }
4972
5120
  return daysBetween(this.from(), today) * this.dayWidth();
4973
5121
  });
4974
- roomsById = computed(() => {
5122
+ lanesById = computed(() => {
4975
5123
  const map = new Map();
4976
- for (const room of this.rooms()) {
4977
- map.set(room.roomId, room);
5124
+ for (const lane of this.lanes()) {
5125
+ map.set(lane.id, lane);
4978
5126
  }
4979
5127
  return map;
4980
5128
  });
4981
5129
  /**
4982
5130
  * The floating copy of a bar being dragged by its body — null unless a
4983
5131
  * move drag has cleared the click threshold. Positioned in canvas
4984
- * coordinates (like `.occ__today`) rather than inside a room's own lane,
4985
- * because a move can target a room other than the one the drag started
4986
- * in; `positioned()` already has every visible row's pixel `top`, so no
4987
- * separate DOM lookup is needed to place it. Always drawn at lane 0 of the
4988
- * target room — a simplification the consumer's own re-lane on save
4989
- * supersedes anyway, same as the rest of this component's "report the
4990
- * gesture, never own the data" contract.
5132
+ * coordinates because a move can target a lane other than the one the drag
5133
+ * started in; `positioned()` already has every visible row's pixel `top`.
4991
5134
  */
4992
5135
  moveGhost = computed(() => {
4993
5136
  const m = this.move();
@@ -4995,25 +5138,21 @@ class OccupancyGridComponent {
4995
5138
  return null;
4996
5139
  }
4997
5140
  const geometry = barGeometry({ startDate: m.previewStartDate, endDate: m.previewEndDate }, this.from(), this.to(), this.dayWidth());
4998
- const targetRow = this.positioned().find(p => p.row.kind === 'room' &&
4999
- p.row.room.roomId === m.targetRoom.roomId);
5141
+ const targetRow = this.laneRowOf(m.targetLane.id);
5000
5142
  if (!geometry || !targetRow) {
5001
5143
  return null;
5002
5144
  }
5003
- // Like the create ghost: a span over another stay sits in a free lane, or
5004
- // just below the row, instead of covering it. The moving bar itself is
5005
- // not an obstacle.
5006
- const lane = laneForSpan(targetRow.row, m.previewStartDate, m.previewEndDate, m.bar.bookingId);
5145
+ // A span over another bar sits in a free slot, or just below the row,
5146
+ // instead of covering it. The moving bar itself is not an obstacle.
5147
+ const slot = slotForSpan(targetRow.row, m.previewStartDate, m.previewEndDate, m.bar.id);
5007
5148
  return {
5008
5149
  left: this.leftColumnWidth() + geometry.left + 1,
5009
- top: this.headerHeight +
5010
- targetRow.top +
5011
- 4 +
5012
- lane * (this.laneHeight() + 4),
5150
+ top: this.headerHeight + targetRow.top + 4 + slot * (this.laneHeight() + 4),
5013
5151
  width: geometry.width - 2,
5014
5152
  height: this.laneHeight(),
5015
- label: m.bar.studentName,
5153
+ label: m.bar.title,
5016
5154
  state: m.bar.state,
5155
+ openEnded: m.bar.endDate === null,
5017
5156
  };
5018
5157
  });
5019
5158
  /** The in-progress drag-to-create's preview span, once it clears the drag threshold (mouse) or as soon as it starts (keyboard). */
@@ -5022,17 +5161,15 @@ class OccupancyGridComponent {
5022
5161
  if (!c || !c.dragging) {
5023
5162
  return null;
5024
5163
  }
5025
- // A span that runs over an existing bar moves into a free lane, or just
5026
- // below the row when none is free, instead of covering the bar.
5027
- const row = this.positioned().find(p => p.row.kind === 'room' && p.row.room.roomId === c.room.roomId)?.row;
5028
- const lane = row
5029
- ? laneForSpan(row, c.previewStart, c.previewEnd, '')
5030
- : c.lane;
5031
- return this.ghostGeometry(c.room, c.previewStart, c.previewEnd, lane);
5164
+ const row = this.laneRowOf(c.lane.id)?.row;
5165
+ const slot = row
5166
+ ? slotForSpan(row, c.previewStart, c.previewEnd, '')
5167
+ : c.slot;
5168
+ return this.ghostGeometry(c.lane, c.previewStart, c.previewEnd, slot);
5032
5169
  });
5033
5170
  /**
5034
- * The empty cell to outline — the mouse hover position if the pointer is
5035
- * over one, otherwise the keyboard-focused cell — whenever no create
5171
+ * The empty cell to outline — the pointer (or external drag) position if
5172
+ * there is one, otherwise the keyboard-focused cell — whenever no create
5036
5173
  * gesture is overriding it with its own live preview.
5037
5174
  */
5038
5175
  laneCursorGeometry = computed(() => {
@@ -5043,32 +5180,34 @@ class OccupancyGridComponent {
5043
5180
  if (!f) {
5044
5181
  return null;
5045
5182
  }
5046
- const room = this.roomsById().get(f.roomId);
5047
- if (!room) {
5183
+ const lane = this.lanesById().get(f.laneId);
5184
+ if (!lane) {
5048
5185
  return null;
5049
5186
  }
5050
- const lane = 'lane' in f ? f.lane : this.createLane(room);
5051
- return this.ghostGeometry(room, f.date, addDays(f.date, 1), lane);
5187
+ const slot = 'slot' in f ? f.slot : this.createSlot(lane);
5188
+ return this.ghostGeometry(lane, f.date, addDays(f.date, 1), slot);
5052
5189
  });
5053
- /** 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. */
5054
- ghostGeometry(room, start, end, lane) {
5190
+ laneRowOf(laneId) {
5191
+ return this.positioned().find(p => p.row.kind === 'lane' && p.row.lane.id === laneId);
5192
+ }
5193
+ /** Canvas-coordinate box for a date span in a given lane's row; `slot` picks which of the row's slots it sits in. */
5194
+ ghostGeometry(lane, start, end, slot) {
5055
5195
  const geometry = barGeometry({ startDate: start, endDate: end }, this.from(), this.to(), this.dayWidth());
5056
- const targetRow = this.positioned().find(p => p.row.kind === 'room' &&
5057
- p.row.room.roomId === room.roomId);
5196
+ const targetRow = this.laneRowOf(lane.id);
5058
5197
  if (!geometry || !targetRow) {
5059
5198
  return null;
5060
5199
  }
5061
5200
  return {
5062
5201
  left: this.leftColumnWidth() + geometry.left + 1,
5063
- top: this.headerHeight + targetRow.top + 4 + lane * (this.laneHeight() + 4),
5202
+ top: this.headerHeight + targetRow.top + 4 + slot * (this.laneHeight() + 4),
5064
5203
  width: geometry.width - 2,
5065
5204
  height: this.laneHeight(),
5066
5205
  };
5067
5206
  }
5068
- /** Where a keyboard create lands: the room's free lane when it has one, else lane 0. */
5069
- createLane(room) {
5070
- const row = this.positioned().find(p => p.row.kind === 'room' && p.row.room.roomId === room.roomId);
5071
- return row?.row?.freeLane ?? 0;
5207
+ /** Where a keyboard create lands: the lane's free slot when it has one, else slot 0. */
5208
+ createSlot(lane) {
5209
+ return (this.laneRowOf(lane.id)?.row?.freeSlot ??
5210
+ 0);
5072
5211
  }
5073
5212
  monthLabels() {
5074
5213
  const keys = [
@@ -5089,42 +5228,39 @@ class OccupancyGridComponent {
5089
5228
  }
5090
5229
  geometryOf(bar) {
5091
5230
  const preview = this.previewDatesOf(bar);
5092
- const effective = preview
5093
- ? { ...bar, startDate: preview.start, endDate: preview.end }
5094
- : bar;
5095
- return barGeometry(effective, this.from(), this.to(), this.dayWidth());
5231
+ return barGeometry({
5232
+ startDate: preview ? preview.start : bar.startDate,
5233
+ endDate: preview ? preview.end : endOf(bar),
5234
+ }, this.from(), this.to(), this.dayWidth());
5096
5235
  }
5097
5236
  /** The in-progress drag's proposed dates for this bar, or null if it is not the one being dragged. */
5098
5237
  previewDatesOf(bar) {
5099
5238
  const r = this.resize();
5100
- if (!r || r.bar.bookingId !== bar.bookingId) {
5239
+ if (!r || r.bar.id !== bar.id) {
5101
5240
  return null;
5102
5241
  }
5103
5242
  return { start: r.previewStart, end: r.previewEnd };
5104
5243
  }
5105
- isResizing(bookingId) {
5106
- return this.resize()?.bar.bookingId === bookingId;
5244
+ isResizing(barId) {
5245
+ return this.resize()?.bar.id === barId;
5107
5246
  }
5108
- /** True once a whole-bar drag on this booking has cleared the click threshold — see `move`. */
5109
- isBeingMoved(bookingId) {
5247
+ /** True once a whole-bar drag on this bar has cleared the click threshold — see `move`. */
5248
+ isBeingMoved(barId) {
5110
5249
  const m = this.move();
5111
- return !!m && m.dragging && m.bar.bookingId === bookingId;
5250
+ return !!m && m.dragging && m.bar.id === barId;
5112
5251
  }
5113
- /** True while a whole-bar drag is hovering this room as its drop target. */
5114
- isMoveTarget(roomId) {
5252
+ /** True while a whole-bar drag, or an accepted external drag, is hovering this lane. */
5253
+ isMoveTarget(laneId) {
5115
5254
  const m = this.move();
5116
- return !!m && m.dragging && m.targetRoom.roomId === roomId;
5255
+ return ((!!m && m.dragging && m.targetLane.id === laneId) ||
5256
+ (this.dragPayload() !== null && this.dropTarget() === laneId));
5117
5257
  }
5118
5258
  closureGeometryOf(closure) {
5119
- return closureGeometry(closure, this.from(), this.to(), this.dayWidth());
5259
+ return barGeometry(closure, this.from(), this.to(), this.dayWidth());
5120
5260
  }
5121
- /**
5122
- * Beds taken on the first day shown, not today (UC-18). The consumer loads
5123
- * only the bars overlapping the window, so today's count was 0 whenever the
5124
- * window did not include today; the first day shown is always loaded.
5125
- */
5126
- takenOn(room) {
5127
- return takenOn(room, this.from());
5261
+ /** Bars on the first day shown (UC-18), for lanes with a capacity; null hides the count. */
5262
+ takenOn(lane) {
5263
+ return lane.capacity === undefined ? null : takenOnLane(lane, this.from());
5128
5264
  }
5129
5265
  isCollapsed(key) {
5130
5266
  return this.collapsed().has(key);
@@ -5142,13 +5278,16 @@ class OccupancyGridComponent {
5142
5278
  barTitle(bar) {
5143
5279
  const preview = this.previewDatesOf(bar);
5144
5280
  const start = preview ? preview.start : bar.startDate;
5145
- const end = preview ? preview.end : bar.endDate;
5146
- const state = this.translate.instant(`occupancyGrid.states.${bar.state}`);
5147
- return `${bar.studentName} · ${start} → ${end} · ${state}`;
5281
+ const end = publicEnd(preview ? preview.end : endOf(bar));
5282
+ const labelKey = this.legend().find(l => l.state === bar.state)?.labelKey ??
5283
+ `occupancyGrid.states.${bar.state}`;
5284
+ const state = this.translate.instant(labelKey);
5285
+ const until = end ?? this.translate.instant('timelineGrid.openEnded');
5286
+ return `${bar.title} · ${start} → ${until} · ${state}`;
5148
5287
  }
5149
5288
  closureTitle(closure) {
5150
5289
  return (this.translate.instant('occupancyGrid.closedReason', {
5151
- reason: closure.reason,
5290
+ reason: closure.label,
5152
5291
  }) + ` · ${closure.startDate} → ${closure.endDate}`);
5153
5292
  }
5154
5293
  onScroll() {
@@ -5164,7 +5303,7 @@ class OccupancyGridComponent {
5164
5303
  trackRow(_, p) {
5165
5304
  return p.row.key;
5166
5305
  }
5167
- asRoomRow(row) {
5306
+ asLaneRow(row) {
5168
5307
  return row;
5169
5308
  }
5170
5309
  /** ‹ / › nav buttons. Emits the signed day delta; see `windowShift`. */
@@ -5173,15 +5312,10 @@ class OccupancyGridComponent {
5173
5312
  }
5174
5313
  /**
5175
5314
  * ArrowLeft/ArrowRight anywhere in the grid page the window, the same as
5176
- * the nav buttons — a keyboard user reaching a bar via Tab should not have
5177
- * to find the buttons to keep moving through time. Left alone otherwise:
5178
- * a bar, room cell or group header's own Enter handling is untouched.
5315
+ * the nav buttons. Shift+Arrow on a focused bar resizes it instead (bound on
5316
+ * the bar itself), so it is declined here.
5179
5317
  */
5180
5318
  onGridKeydown(event) {
5181
- // Shift+Arrow on a focused bar resizes it (onBarKeydownResize, bound on
5182
- // the bar itself); this handler still sees the same bubbled keydown, so
5183
- // it must decline plain-Arrow handling here or a resize would also page
5184
- // the window on every keystroke.
5185
5319
  if (event.shiftKey) {
5186
5320
  return;
5187
5321
  }
@@ -5195,43 +5329,42 @@ class OccupancyGridComponent {
5195
5329
  }
5196
5330
  }
5197
5331
  /**
5198
- * A click inside a room's lane that landed on neither a bar nor a closure
5199
- * (both stop propagation before this fires) — the room and the date under
5200
- * the pointer. See `OccupancyCellClick`.
5332
+ * A click inside a lane that landed on neither a bar nor a closure (both
5333
+ * stop propagation before this fires) — the lane and the date under the
5334
+ * pointer.
5201
5335
  */
5202
- onLaneClick(event, room) {
5336
+ onLaneClick(event, lane) {
5203
5337
  if (this.consumeSuppressNextClick()) {
5204
5338
  return;
5205
5339
  }
5206
5340
  const rect = event.currentTarget.getBoundingClientRect();
5207
5341
  const date = dateAtOffset(event.clientX - rect.left, this.from(), this.dayWidth());
5208
- this.cellClick.emit({ room, date });
5342
+ this.cellClick.emit({ lane, date });
5209
5343
  }
5210
- /** The bar's own click handler routes through here so it shares the same resize-click guard as `onLaneClick`. */
5211
- onBarClick(bar, room) {
5344
+ /** The bar's own click handler routes through here so it shares the same post-drag click guard as `onLaneClick`. */
5345
+ onBarClick(bar, lane) {
5212
5346
  if (this.consumeSuppressNextClick()) {
5213
5347
  return;
5214
5348
  }
5215
- this.barClick.emit({ bar, room });
5349
+ this.barClick.emit({ bar, lane });
5216
5350
  }
5217
5351
  // ─────────────────────────────────────────────────────── extend / shorten
5218
5352
  /**
5219
- * Mousedown on a bar's edge handle starts a drag. Listeners go on
5220
- * `window`, not the handle, because the pointer will move well outside
5221
- * an 8px-wide handle the instant the drag starts; `stopPropagation` keeps
5222
- * this from also being read as a click on the bar (which would open the
5223
- * drawer) or on the lane underneath it (a `cellClick`).
5353
+ * Mousedown on a bar's edge handle starts a drag. Listeners go on `window`
5354
+ * because the pointer leaves an 8px handle the instant the drag starts;
5355
+ * `stopPropagation` keeps this from also reading as a click on the bar or
5356
+ * the lane underneath it.
5224
5357
  */
5225
- startResize(event, room, bar, edge, laneBars) {
5358
+ startResize(event, lane, bar, edge, laneBars) {
5226
5359
  event.stopPropagation();
5227
5360
  event.preventDefault();
5228
- const bound = laneNeighborBound(laneBars, bar.bookingId, edge, this.preventOverlap());
5361
+ const bound = neighborBound(laneBars, bar.id, edge, this.preventOverlap());
5229
5362
  this.resize.set({
5230
- room,
5363
+ lane,
5231
5364
  bar,
5232
5365
  edge,
5233
5366
  previewStart: bar.startDate,
5234
- previewEnd: bar.endDate,
5367
+ previewEnd: endOf(bar),
5235
5368
  minBound: edge === 'start' ? bound : null,
5236
5369
  maxBound: edge === 'end' ? bound : null,
5237
5370
  });
@@ -5258,7 +5391,7 @@ class OccupancyGridComponent {
5258
5391
  next = r.minBound;
5259
5392
  }
5260
5393
  if (next >= r.previewEnd) {
5261
- next = addDays(r.previewEnd, -1); // never less than one night
5394
+ next = addDays(r.previewEnd, -1); // never less than one day
5262
5395
  }
5263
5396
  this.resize.set({ ...r, previewStart: next });
5264
5397
  }
@@ -5282,46 +5415,19 @@ class OccupancyGridComponent {
5282
5415
  if (!r || !commit) {
5283
5416
  return;
5284
5417
  }
5285
- if (r.previewStart === r.bar.startDate && r.previewEnd === r.bar.endDate) {
5286
- return;
5287
- }
5288
- if (this.rejectIfOverbooked(r.room, r.bar.bookingId, r.previewStart, r.previewEnd)) {
5418
+ if (r.previewStart === r.bar.startDate && r.previewEnd === endOf(r.bar)) {
5289
5419
  return;
5290
5420
  }
5291
5421
  this.barResize.emit({
5292
5422
  bar: r.bar,
5293
- room: r.room,
5423
+ lane: r.lane,
5294
5424
  edge: r.edge,
5295
5425
  previousStartDate: r.bar.startDate,
5296
5426
  previousEndDate: r.bar.endDate,
5297
5427
  proposedStartDate: r.previewStart,
5298
- proposedEndDate: r.previewEnd,
5428
+ proposedEndDate: publicEnd(r.previewEnd),
5299
5429
  });
5300
5430
  }
5301
- /**
5302
- * With `preventOverbooking`, a gesture that would put more stays in a room
5303
- * than it has beds is dropped here, so the bar simply stays where it was,
5304
- * with a snackbar saying why.
5305
- */
5306
- rejectIfOverbooked(room, bookingId, start, end) {
5307
- if (!this.preventOverbooking() ||
5308
- !overbooksRoom(room, bookingId, start, end)) {
5309
- return false;
5310
- }
5311
- this.snackBar.openFromComponent(CustomSnackbarComponent, {
5312
- horizontalPosition: 'end',
5313
- verticalPosition: 'top',
5314
- panelClass: ['custom-snackbar-container'],
5315
- data: {
5316
- message: this.translate.instant('occupancyGrid.overbooked', {
5317
- room: room.number,
5318
- }),
5319
- type: SnackbarType.WARNING,
5320
- duration: 3000,
5321
- },
5322
- });
5323
- return true;
5324
- }
5325
5431
  removeDragListeners() {
5326
5432
  if (this.dragMoveListener) {
5327
5433
  window.removeEventListener('mousemove', this.dragMoveListener);
@@ -5338,14 +5444,12 @@ class OccupancyGridComponent {
5338
5444
  }
5339
5445
  // ───────────────────────────────────────────────────────── move the bar
5340
5446
  /**
5341
- * Mousedown on a bar's own body (never the edge handles — those stop
5342
- * propagation before this fires) arms a possible whole-bar move, but does
5343
- * not yet commit to one: `dragging` stays false, and nothing is rendered
5344
- * differently, until `onBarDragMove` sees the pointer clear a small
5345
- * threshold. That is what lets a plain click still fall through to
5346
- * `onBarClick` unchanged.
5447
+ * Mousedown on a bar's body (never the edge handles — those stop
5448
+ * propagation first) arms a possible whole-bar move, but nothing changes
5449
+ * until `onBarDragMove` sees the pointer clear a small threshold, so a plain
5450
+ * click still reaches `onBarClick`.
5347
5451
  */
5348
- startBarMove(event, room, bar) {
5452
+ startBarMove(event, lane, bar) {
5349
5453
  if (event.button !== 0) {
5350
5454
  return;
5351
5455
  }
@@ -5353,14 +5457,14 @@ class OccupancyGridComponent {
5353
5457
  event.stopPropagation();
5354
5458
  this.move.set({
5355
5459
  bar,
5356
- fromRoom: room,
5460
+ fromLane: lane,
5357
5461
  startClientX: event.clientX,
5358
5462
  startClientY: event.clientY,
5359
5463
  originalStartDate: bar.startDate,
5360
- originalEndDate: bar.endDate,
5464
+ originalEndDate: endOf(bar),
5361
5465
  previewStartDate: bar.startDate,
5362
- previewEndDate: bar.endDate,
5363
- targetRoom: room,
5466
+ previewEndDate: endOf(bar),
5467
+ targetLane: lane,
5364
5468
  dragging: false,
5365
5469
  });
5366
5470
  this.moveMoveListener = e => this.onBarDragMove(e);
@@ -5388,15 +5492,14 @@ class OccupancyGridComponent {
5388
5492
  }
5389
5493
  const dayDelta = Math.round(dx / this.dayWidth());
5390
5494
  const previewStartDate = addDays(m.originalStartDate, dayDelta);
5391
- const previewEndDate = addDays(m.originalEndDate, dayDelta);
5392
- const targetRoom = this.roomUnderPoint(event.clientX, event.clientY) ?? m.targetRoom;
5495
+ const previewEndDate = m.originalEndDate === OPEN_END
5496
+ ? OPEN_END
5497
+ : addDays(m.originalEndDate, dayDelta);
5498
+ const targetLane = this.laneUnderPoint(event.clientX, event.clientY) ?? m.targetLane;
5393
5499
  if (this.preventOverlap() &&
5394
- overlapsRoom(targetRoom, m.bar.bookingId, previewStartDate, previewEndDate)) {
5395
- // This candidate would overlap another bar in the target room — reject
5396
- // just this update rather than the whole drag, so the ghost simply
5397
- // stays at the last placement that did not overlap (the bar's
5398
- // original spot, the first time a move ever conflicts) instead of
5399
- // jumping onto an invalid one and back.
5500
+ overlapsLane(targetLane, m.bar.id, previewStartDate, previewEndDate)) {
5501
+ // Reject just this candidate, not the whole drag: the ghost stays at
5502
+ // the last placement that did not overlap.
5400
5503
  this.move.set({ ...m, dragging: true });
5401
5504
  return;
5402
5505
  }
@@ -5405,7 +5508,7 @@ class OccupancyGridComponent {
5405
5508
  dragging: true,
5406
5509
  previewStartDate,
5407
5510
  previewEndDate,
5408
- targetRoom,
5511
+ targetLane,
5409
5512
  });
5410
5513
  }
5411
5514
  /** Mouseup (commit) or Escape (cancel). Emits `barMove` only on commit with an actual change. */
@@ -5424,20 +5527,17 @@ class OccupancyGridComponent {
5424
5527
  }
5425
5528
  if (m.previewStartDate === m.originalStartDate &&
5426
5529
  m.previewEndDate === m.originalEndDate &&
5427
- m.targetRoom.roomId === m.fromRoom.roomId) {
5428
- return;
5429
- }
5430
- if (this.rejectIfOverbooked(m.targetRoom, m.bar.bookingId, m.previewStartDate, m.previewEndDate)) {
5530
+ m.targetLane.id === m.fromLane.id) {
5431
5531
  return;
5432
5532
  }
5433
5533
  this.barMove.emit({
5434
5534
  bar: m.bar,
5435
- fromRoom: m.fromRoom,
5436
- toRoom: m.targetRoom,
5535
+ fromLane: m.fromLane,
5536
+ toLane: m.targetLane,
5437
5537
  previousStartDate: m.originalStartDate,
5438
- previousEndDate: m.originalEndDate,
5538
+ previousEndDate: publicEnd(m.originalEndDate),
5439
5539
  proposedStartDate: m.previewStartDate,
5440
- proposedEndDate: m.previewEndDate,
5540
+ proposedEndDate: publicEnd(m.previewEndDate),
5441
5541
  });
5442
5542
  }
5443
5543
  removeMoveListeners() {
@@ -5456,22 +5556,21 @@ class OccupancyGridComponent {
5456
5556
  }
5457
5557
  // ─────────────────────────────────────────────── create over empty cells
5458
5558
  /**
5459
- * Mousedown on a lane's empty background arms a possible drag-to-create,
5460
- * on the same click-vs-drag threshold as `startBarMove` — a plain click
5461
- * still falls through to `onLaneClick`'s `cellClick` unchanged, since
5462
- * `endCreate` only emits once `dragging` has flipped true.
5559
+ * Mousedown on a lane's empty background arms a possible drag-to-create, on
5560
+ * the same click-vs-drag threshold as `startBarMove` — a plain click still
5561
+ * falls through to `onLaneClick`'s `cellClick`.
5463
5562
  */
5464
- startCreate(event, room, lane = 0) {
5563
+ startCreate(event, lane, slot = 0) {
5465
5564
  if (event.button !== 0) {
5466
5565
  return;
5467
5566
  }
5468
5567
  const startDate = this.clientXToDate(event.clientX);
5469
- if (overlapsClosure(room, startDate, addDays(startDate, 1))) {
5568
+ if (overlapsClosure(lane, startDate, addDays(startDate, 1))) {
5470
5569
  return;
5471
5570
  }
5472
5571
  this.create.set({
5473
- room,
5474
5572
  lane,
5573
+ slot,
5475
5574
  startDate,
5476
5575
  startClientX: event.clientX,
5477
5576
  previewStart: startDate,
@@ -5499,24 +5598,27 @@ class OccupancyGridComponent {
5499
5598
  if (!c.dragging && Math.abs(dx) < MOVE_DRAG_THRESHOLD_PX) {
5500
5599
  return;
5501
5600
  }
5502
- const date = clampToClosures(c.room, c.startDate, this.clientXToDate(event.clientX));
5601
+ const date = clampToClosures(c.lane, c.startDate, this.clientXToDate(event.clientX));
5503
5602
  let start = c.startDate;
5504
5603
  let end = date;
5505
5604
  if (end < start) {
5506
- // Dragged backwards from the anchor: the anchor becomes the departure.
5605
+ // Dragged backwards from the anchor: the anchor becomes the end.
5507
5606
  start = date;
5508
5607
  end = c.startDate;
5509
5608
  }
5510
5609
  if (end <= start) {
5511
- end = addDays(start, 1); // never less than one night
5610
+ end = addDays(start, 1); // never less than one day
5512
5611
  }
5513
- if (this.preventOverlap() && overlapsRoom(c.room, '', start, end)) {
5514
- // Reject just this update, same as a whole-bar move's overlap check —
5515
- // the preview stays at the last span that did not overlap.
5612
+ if (this.preventOverlap() && overlapsLane(c.lane, '', start, end)) {
5516
5613
  this.create.set({ ...c, dragging: true });
5517
5614
  return;
5518
5615
  }
5519
- this.create.set({ ...c, dragging: true, previewStart: start, previewEnd: end });
5616
+ this.create.set({
5617
+ ...c,
5618
+ dragging: true,
5619
+ previewStart: start,
5620
+ previewEnd: end,
5621
+ });
5520
5622
  }
5521
5623
  /** Mouseup (commit) or Escape (cancel), for both the mouse and keyboard paths. Emits `barCreate` only once a drag actually cleared the threshold (or a keyboard create was started) and is committed. */
5522
5624
  endCreate(commit) {
@@ -5530,21 +5632,17 @@ class OccupancyGridComponent {
5530
5632
  this.armSuppressNextClick();
5531
5633
  }
5532
5634
  if (c.viaKeyboard) {
5533
- // Keep the cell focused where the gesture left off, so the keyboard
5534
- // user's position on the grid does not just disappear.
5635
+ // Keep the cell focused where the gesture left off.
5535
5636
  this.laneFocus.set({
5536
- roomId: c.room.roomId,
5637
+ laneId: c.lane.id,
5537
5638
  date: commit ? c.previewStart : c.startDate,
5538
5639
  });
5539
5640
  }
5540
5641
  if (!c.dragging || !commit) {
5541
5642
  return;
5542
5643
  }
5543
- if (this.rejectIfOverbooked(c.room, '', c.previewStart, c.previewEnd)) {
5544
- return;
5545
- }
5546
5644
  this.barCreate.emit({
5547
- room: c.room,
5645
+ lane: c.lane,
5548
5646
  proposedStartDate: c.previewStart,
5549
5647
  proposedEndDate: c.previewEnd,
5550
5648
  });
@@ -5564,37 +5662,32 @@ class OccupancyGridComponent {
5564
5662
  this.createKeyListener = null;
5565
5663
  }
5566
5664
  /**
5567
- * Focus lands on an empty lane (Tab, or a mouse click on it) — arm a
5568
- * keyboard cursor at today (or the window's first day, if today is out of
5569
- * view) unless this room already has one. Left alone while a keyboard
5570
- * create is in progress on this lane, so refocusing mid-gesture cannot
5571
- * reset it.
5665
+ * Focus lands on an empty lane — arm a keyboard cursor at today (or the
5666
+ * window's first day) unless this lane already has one. Left alone while a
5667
+ * keyboard create is in progress, so refocusing mid-gesture cannot reset it.
5572
5668
  */
5573
- onLaneFocus(room) {
5669
+ onLaneFocus(lane) {
5574
5670
  if (this.create()?.viaKeyboard) {
5575
5671
  return;
5576
5672
  }
5577
5673
  const existing = this.laneFocus();
5578
- const date = existing && existing.roomId === room.roomId
5674
+ const date = existing && existing.laneId === lane.id
5579
5675
  ? existing.date
5580
5676
  : this.defaultCursorDate();
5581
- this.laneFocus.set({ roomId: room.roomId, date });
5677
+ this.laneFocus.set({ laneId: lane.id, date });
5582
5678
  }
5583
5679
  /**
5584
5680
  * The pointer moved over a lane's empty background — update the hover
5585
- * cursor to the date under it. Ignored while a create, resize, or
5586
- * whole-bar move is live (that gesture already draws its own preview),
5587
- * and when the event bubbled up from a bar or closure rather than
5588
- * landing on the background itself, so hovering an existing booking does
5589
- * not also outline the empty-cell cursor underneath it.
5681
+ * cursor to the date under it. Ignored while a gesture is live, and when
5682
+ * the event bubbled up from a bar or closure rather than the background.
5590
5683
  */
5591
- onLaneMouseMove(event, room, lane = 0) {
5684
+ onLaneMouseMove(event, lane, slot = 0) {
5592
5685
  if (this.create() || this.resize() || this.move()?.dragging) {
5593
5686
  this.laneHover.set(null);
5594
5687
  return;
5595
5688
  }
5596
5689
  if (event.target !== event.currentTarget) {
5597
- // The free lane handles its own moves; its bubbled event is not a bar.
5690
+ // The free slot handles its own moves; its bubbled event is not a bar.
5598
5691
  if (!event.target.classList.contains('occ__lane-free')) {
5599
5692
  this.laneHover.set(null);
5600
5693
  this.pointerOnBar.set(true);
@@ -5605,12 +5698,12 @@ class OccupancyGridComponent {
5605
5698
  const date = this.clientXToDate(event.clientX);
5606
5699
  const cur = this.laneHover();
5607
5700
  if (cur &&
5608
- cur.roomId === room.roomId &&
5701
+ cur.laneId === lane.id &&
5609
5702
  cur.date === date &&
5610
- cur.lane === lane) {
5703
+ cur.slot === slot) {
5611
5704
  return;
5612
5705
  }
5613
- this.laneHover.set({ roomId: room.roomId, date, lane });
5706
+ this.laneHover.set({ laneId: lane.id, date, slot });
5614
5707
  }
5615
5708
  onCanvasMouseMove(event) {
5616
5709
  const el = this.scroller().nativeElement;
@@ -5624,10 +5717,10 @@ class OccupancyGridComponent {
5624
5717
  this.hoverDay.set(next);
5625
5718
  }
5626
5719
  }
5627
- onLaneMouseLeave(room) {
5720
+ onLaneMouseLeave(lane) {
5628
5721
  this.pointerOnBar.set(false);
5629
5722
  const cur = this.laneHover();
5630
- if (cur && cur.roomId === room.roomId) {
5723
+ if (cur && cur.laneId === lane.id) {
5631
5724
  this.laneHover.set(null);
5632
5725
  }
5633
5726
  }
@@ -5647,14 +5740,12 @@ class OccupancyGridComponent {
5647
5740
  /**
5648
5741
  * Keyboard path for drag-to-create: with no create in progress, plain
5649
5742
  * ArrowLeft/ArrowRight move the focused cell one day and Enter/Space marks
5650
- * it as the start of a new booking; once that create is live, the same
5651
- * arrow keys extend or shorten the departure date (mirroring
5652
- * `onBarKeydownResize`'s departure-only convention) and a second Enter
5653
- * commits, Escape cancels.
5743
+ * it as the start; once that create is live, the same arrow keys move the
5744
+ * end date, a second Enter commits and Escape cancels.
5654
5745
  */
5655
- onLaneKeydown(event, room) {
5746
+ onLaneKeydown(event, lane) {
5656
5747
  const c = this.create();
5657
- if (c && c.viaKeyboard && c.room.roomId === room.roomId) {
5748
+ if (c && c.viaKeyboard && c.lane.id === lane.id) {
5658
5749
  if (event.key === 'Escape') {
5659
5750
  event.preventDefault();
5660
5751
  this.endCreate(false);
@@ -5670,8 +5761,9 @@ class OccupancyGridComponent {
5670
5761
  if (next <= c.previewStart) {
5671
5762
  next = addDays(c.previewStart, 1);
5672
5763
  }
5673
- if (overlapsClosure(room, c.previewStart, next) ||
5674
- (this.preventOverlap() && overlapsRoom(room, '', c.previewStart, next))) {
5764
+ if (overlapsClosure(lane, c.previewStart, next) ||
5765
+ (this.preventOverlap() &&
5766
+ overlapsLane(lane, '', c.previewStart, next))) {
5675
5767
  return;
5676
5768
  }
5677
5769
  this.create.set({ ...c, previewEnd: next });
@@ -5679,7 +5771,7 @@ class OccupancyGridComponent {
5679
5771
  return;
5680
5772
  }
5681
5773
  const cur = this.laneFocus();
5682
- if (!cur || cur.roomId !== room.roomId) {
5774
+ if (!cur || cur.laneId !== lane.id) {
5683
5775
  return;
5684
5776
  }
5685
5777
  if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
@@ -5692,16 +5784,16 @@ class OccupancyGridComponent {
5692
5784
  else if (next >= this.to()) {
5693
5785
  next = addDays(this.to(), -1);
5694
5786
  }
5695
- this.laneFocus.set({ roomId: room.roomId, date: next });
5787
+ this.laneFocus.set({ laneId: lane.id, date: next });
5696
5788
  }
5697
5789
  else if (event.key === 'Enter' || event.key === ' ') {
5698
5790
  event.preventDefault();
5699
- if (overlapsClosure(room, cur.date, addDays(cur.date, 1))) {
5791
+ if (overlapsClosure(lane, cur.date, addDays(cur.date, 1))) {
5700
5792
  return;
5701
5793
  }
5702
5794
  this.create.set({
5703
- room,
5704
- lane: this.createLane(room),
5795
+ lane,
5796
+ slot: this.createSlot(lane),
5705
5797
  startDate: cur.date,
5706
5798
  startClientX: 0,
5707
5799
  previewStart: cur.date,
@@ -5711,12 +5803,64 @@ class OccupancyGridComponent {
5711
5803
  });
5712
5804
  }
5713
5805
  }
5714
- /** Whatever room row (if any) is actually rendered under this point — see `.occ__row--room`'s `data-room-id`. */
5715
- roomUnderPoint(clientX, clientY) {
5806
+ // ─────────────────────────────────────────── drop from outside the grid
5807
+ canDropOn(lane) {
5808
+ const payload = this.dragPayload();
5809
+ if (payload === null) {
5810
+ return false;
5811
+ }
5812
+ const can = this.canDrop();
5813
+ return !can || can(lane, payload);
5814
+ }
5815
+ isDropDisabled(lane) {
5816
+ return this.dragPayload() !== null && !this.canDropOn(lane);
5817
+ }
5818
+ /** Accepting the dragover (preventDefault) is what lets the browser drop here at all. */
5819
+ onLaneDragOver(event, lane) {
5820
+ if (!this.canDropOn(lane)) {
5821
+ return;
5822
+ }
5823
+ event.preventDefault();
5824
+ const date = this.clientXToDate(event.clientX);
5825
+ const cur = this.laneHover();
5826
+ if (this.dropTarget() !== lane.id) {
5827
+ this.dropTarget.set(lane.id);
5828
+ }
5829
+ if (!cur || cur.laneId !== lane.id || cur.date !== date) {
5830
+ this.laneHover.set({
5831
+ laneId: lane.id,
5832
+ date,
5833
+ slot: this.createSlot(lane),
5834
+ });
5835
+ }
5836
+ }
5837
+ onLaneDragLeave(event, lane) {
5838
+ const into = event.relatedTarget;
5839
+ if (into && event.currentTarget.contains(into)) {
5840
+ return;
5841
+ }
5842
+ if (this.dropTarget() === lane.id) {
5843
+ this.dropTarget.set(null);
5844
+ this.laneHover.set(null);
5845
+ }
5846
+ }
5847
+ onLaneDrop(event, lane) {
5848
+ if (!this.canDropOn(lane)) {
5849
+ return;
5850
+ }
5851
+ event.preventDefault();
5852
+ const date = this.clientXToDate(event.clientX);
5853
+ const payload = this.dragPayload();
5854
+ this.dropTarget.set(null);
5855
+ this.laneHover.set(null);
5856
+ this.laneDrop.emit({ lane, date, payload });
5857
+ }
5858
+ /** Whatever lane row (if any) is actually rendered under this point — see `.occ__row--room`'s `data-lane-id`. */
5859
+ laneUnderPoint(clientX, clientY) {
5716
5860
  const el = document.elementFromPoint(clientX, clientY);
5717
5861
  const rowEl = el?.closest('.occ__row--room');
5718
- const roomId = rowEl?.dataset['roomId'];
5719
- return roomId ? (this.roomsById().get(roomId) ?? null) : null;
5862
+ const laneId = rowEl?.dataset['laneId'];
5863
+ return laneId ? (this.lanesById().get(laneId) ?? null) : null;
5720
5864
  }
5721
5865
  armSuppressNextClick() {
5722
5866
  this.suppressNextClick = true;
@@ -5746,22 +5890,21 @@ class OccupancyGridComponent {
5746
5890
  return dateAtOffset(x, this.from(), this.dayWidth());
5747
5891
  }
5748
5892
  /**
5749
- * The keyboard equivalent of dragging the departure edge: Shift+ArrowRight
5750
- * extends by a night, Shift+ArrowLeft shortens by one, each key press
5751
- * committing immediately (there is nothing to "release" the way a mouse
5752
- * drag has). Scoped to the departure edge only — the more common "extend a
5753
- * stay" gesture — so one binding covers the primary case without a second
5754
- * modifier combination to document; the arrival edge is still reachable by
5755
- * dragging its handle with a mouse.
5893
+ * The keyboard equivalent of dragging the end edge: Shift+ArrowRight
5894
+ * extends by a day, Shift+ArrowLeft shortens by one, each press committing
5895
+ * immediately. End edge only; an open-ended bar has none to move.
5756
5896
  */
5757
- onBarKeydownResize(event, room, bar, laneBars) {
5897
+ onBarKeydownResize(event, lane, bar, laneBars) {
5758
5898
  if (!event.shiftKey ||
5759
5899
  (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft')) {
5760
5900
  return;
5761
5901
  }
5762
5902
  event.preventDefault();
5763
5903
  event.stopPropagation();
5764
- const bound = laneNeighborBound(laneBars, bar.bookingId, 'end', this.preventOverlap());
5904
+ if (bar.endDate === null) {
5905
+ return;
5906
+ }
5907
+ const bound = neighborBound(laneBars, bar.id, 'end', this.preventOverlap());
5765
5908
  let next = addDays(bar.endDate, event.key === 'ArrowRight' ? 1 : -1);
5766
5909
  if (bound && next > bound) {
5767
5910
  next = bound;
@@ -5772,12 +5915,9 @@ class OccupancyGridComponent {
5772
5915
  if (next === bar.endDate) {
5773
5916
  return;
5774
5917
  }
5775
- if (this.rejectIfOverbooked(room, bar.bookingId, bar.startDate, next)) {
5776
- return;
5777
- }
5778
5918
  this.barResize.emit({
5779
5919
  bar,
5780
- room,
5920
+ lane,
5781
5921
  edge: 'end',
5782
5922
  previousStartDate: bar.startDate,
5783
5923
  previousEndDate: bar.endDate,
@@ -5785,13 +5925,256 @@ class OccupancyGridComponent {
5785
5925
  proposedEndDate: next,
5786
5926
  });
5787
5927
  }
5788
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i1$2.MatSnackBar }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
5789
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: OccupancyGridComponent, isStandalone: true, selector: "ud-occupancy-grid", inputs: { rooms: { classPropertyName: "rooms", publicName: "rooms", isSignal: true, isRequired: false, transformFunction: null }, dormName: { classPropertyName: "dormName", publicName: "dormName", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, preventOverbooking: { classPropertyName: "preventOverbooking", publicName: "preventOverbooking", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", roomClick: "roomClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{\n 'occupancyGrid.rooms' | translate\n }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.roomCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!asRoomRow(p.row).room.active\"\n [class.is-move-target]=\"isMoveTarget(asRoomRow(p.row).room.roomId)\"\n [attr.data-room-id]=\"asRoomRow(p.row).room.roomId\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"roomClick.emit(asRoomRow(p.row).room)\"\n (keydown.enter)=\"roomClick.emit(asRoomRow(p.row).room)\">\n <span class=\"occ__room-number\">{{\n asRoomRow(p.row).room.number\n }}</span>\n <span class=\"occ__room-type\">{{\n asRoomRow(p.row).room.type\n }}</span>\n @if (takenOn(asRoomRow(p.row).room) !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"\n takenOn(asRoomRow(p.row).room)! >=\n asRoomRow(p.row).room.capacity\n \">\n {{ takenOn(asRoomRow(p.row).room) }}/{{\n asRoomRow(p.row).room.capacity\n }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @if (asRoomRow(p.row).freeLane !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"\n 4 + asRoomRow(p.row).freeLane! * (laneHeight() + 4)\n \"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"\n (mousemove)=\"\n onLaneMouseMove(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"></div>\n }\n @for (lb of asRoomRow(p.row).bars; track lb.bar.bookingId) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-resizing]=\"isResizing(lb.bar.bookingId)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.bookingId)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.lane * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"\n startBarMove($event, asRoomRow(p.row).room, lb.bar)\n \"\n (click)=\"\n $event.stopPropagation();\n onBarClick(lb.bar, asRoomRow(p.row).room)\n \"\n (keydown.enter)=\"\n barClick.emit({\n bar: lb.bar,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown)=\"\n onBarKeydownResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n asRoomRow(p.row).bars\n )\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'start',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.studentName }}</span>\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'end',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"], dependencies: [{ kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5928
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TimelineGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
5929
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: TimelineGridComponent, isStandalone: true, selector: "ud-timeline-grid", inputs: { lanes: { classPropertyName: "lanes", publicName: "lanes", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, cornerLabelKey: { classPropertyName: "cornerLabelKey", publicName: "cornerLabelKey", isSignal: true, isRequired: false, transformFunction: null }, emptyLabelKey: { classPropertyName: "emptyLabelKey", publicName: "emptyLabelKey", isSignal: true, isRequired: false, transformFunction: null }, createCellLabelKey: { classPropertyName: "createCellLabelKey", publicName: "createCellLabelKey", isSignal: true, isRequired: false, transformFunction: null }, legend: { classPropertyName: "legend", publicName: "legend", isSignal: true, isRequired: false, transformFunction: null }, dragPayload: { classPropertyName: "dragPayload", publicName: "dragPayload", isSignal: true, isRequired: false, transformFunction: null }, canDrop: { classPropertyName: "canDrop", publicName: "canDrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", laneClick: "laneClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate", laneDrop: "laneDrop" }, viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{ cornerLabelKey() | translate }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.laneCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n @let lr = asLaneRow(p.row);\n <!-- data-room-id mirrors data-lane-id for selectors written against the occupancy grid. -->\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!lr.lane.active\"\n [class.is-move-target]=\"isMoveTarget(lr.lane.id)\"\n [class.is-drop-disabled]=\"isDropDisabled(lr.lane)\"\n [attr.data-lane-id]=\"lr.lane.id\"\n [attr.data-room-id]=\"lr.lane.id\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"laneClick.emit(lr.lane)\"\n (keydown.enter)=\"laneClick.emit(lr.lane)\">\n <span class=\"occ__room-number\">{{ lr.lane.label }}</span>\n @if (lr.lane.sublabel) {\n <span class=\"occ__room-type\">{{ lr.lane.sublabel }}</span>\n }\n @for (tag of lr.lane.tags ?? []; track tag) {\n <span class=\"occ__lane-tag\">{{ tag }}</span>\n }\n @let taken = takenOn(lr.lane);\n @if (taken !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"taken >= lr.lane.capacity!\">\n {{ taken }}/{{ lr.lane.capacity }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n createCellLabelKey()\n | translate: { lane: lr.lane.label, room: lr.lane.label }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, lr.lane)\"\n (click)=\"onLaneClick($event, lr.lane)\"\n (mousemove)=\"onLaneMouseMove($event, lr.lane)\"\n (mouseleave)=\"onLaneMouseLeave(lr.lane)\"\n (focus)=\"onLaneFocus(lr.lane)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, lr.lane)\"\n (dragover)=\"onLaneDragOver($event, lr.lane)\"\n (dragleave)=\"onLaneDragLeave($event, lr.lane)\"\n (drop)=\"onLaneDrop($event, lr.lane)\">\n @for (c of lr.lane.closures; track c.id) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({ closure: c, lane: lr.lane })\n \"\n (keydown.enter)=\"\n closureClick.emit({ closure: c, lane: lr.lane })\n \">\n <span class=\"occ__closure-label\">{{ c.label }}</span>\n </div>\n }\n }\n @if (lr.freeSlot !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"4 + lr.freeSlot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate($event, lr.lane, lr.freeSlot)\n \"\n (mousemove)=\"\n onLaneMouseMove($event, lr.lane, lr.freeSlot)\n \"></div>\n }\n @for (lb of lr.bars; track lb.bar.id) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-open-ended]=\"lb.bar.endDate === null\"\n [class.is-resizing]=\"isResizing(lb.bar.id)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.id)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.slot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"startBarMove($event, lr.lane, lb.bar)\"\n (click)=\"\n $event.stopPropagation(); onBarClick(lb.bar, lr.lane)\n \"\n (keydown.enter)=\"\n barClick.emit({ bar: lb.bar, lane: lr.lane })\n \"\n (keydown)=\"\n onBarKeydownResize($event, lr.lane, lb.bar, lr.bars)\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'start', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.title }}</span>\n @if (lb.bar.subtitle) {\n <span class=\"occ__bar-sub\">{{ lb.bar.subtitle }}</span>\n }\n @if (lb.bar.badge) {\n <span class=\"occ__bar-badge\">{{ lb.bar.badge }}</span>\n }\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'end', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [class.is-cut-right]=\"g.openEnded\"\n [class.is-open-ended]=\"g.openEnded\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ emptyLabelKey() | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of legend(); track s.state) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s.state\"></i\n >{{ s.labelKey | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-tag{flex-shrink:0;padding:0 5px;border-radius:999px;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);font-size:10px;line-height:15px;color:var(--ud-occ-muted)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar-sub{margin-left:6px;opacity:.7;overflow:hidden;text-overflow:ellipsis}.occ__bar-badge{margin-left:auto;padding-left:6px;font-size:10px;font-weight:600}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__row--room.is-drop-disabled{opacity:.4;filter:grayscale(1)}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__bar.is-open-ended{padding-right:16px}.occ__bar.is-open-ended:after{content:\"\\2192\";opacity:.9}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"], dependencies: [{ kind: "directive", type: UdTooltipDirective, selector: "[udTooltip]", inputs: ["udTooltip", "udTooltipPosition", "udTooltipDisabled", "udTooltipShowDelay"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5930
+ }
5931
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: TimelineGridComponent, decorators: [{
5932
+ type: Component,
5933
+ args: [{ selector: 'ud-timeline-grid', standalone: true, imports: [UdTooltipDirective, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{ cornerLabelKey() | translate }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.laneCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n @let lr = asLaneRow(p.row);\n <!-- data-room-id mirrors data-lane-id for selectors written against the occupancy grid. -->\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!lr.lane.active\"\n [class.is-move-target]=\"isMoveTarget(lr.lane.id)\"\n [class.is-drop-disabled]=\"isDropDisabled(lr.lane)\"\n [attr.data-lane-id]=\"lr.lane.id\"\n [attr.data-room-id]=\"lr.lane.id\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"laneClick.emit(lr.lane)\"\n (keydown.enter)=\"laneClick.emit(lr.lane)\">\n <span class=\"occ__room-number\">{{ lr.lane.label }}</span>\n @if (lr.lane.sublabel) {\n <span class=\"occ__room-type\">{{ lr.lane.sublabel }}</span>\n }\n @for (tag of lr.lane.tags ?? []; track tag) {\n <span class=\"occ__lane-tag\">{{ tag }}</span>\n }\n @let taken = takenOn(lr.lane);\n @if (taken !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"taken >= lr.lane.capacity!\">\n {{ taken }}/{{ lr.lane.capacity }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n createCellLabelKey()\n | translate: { lane: lr.lane.label, room: lr.lane.label }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, lr.lane)\"\n (click)=\"onLaneClick($event, lr.lane)\"\n (mousemove)=\"onLaneMouseMove($event, lr.lane)\"\n (mouseleave)=\"onLaneMouseLeave(lr.lane)\"\n (focus)=\"onLaneFocus(lr.lane)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, lr.lane)\"\n (dragover)=\"onLaneDragOver($event, lr.lane)\"\n (dragleave)=\"onLaneDragLeave($event, lr.lane)\"\n (drop)=\"onLaneDrop($event, lr.lane)\">\n @for (c of lr.lane.closures; track c.id) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({ closure: c, lane: lr.lane })\n \"\n (keydown.enter)=\"\n closureClick.emit({ closure: c, lane: lr.lane })\n \">\n <span class=\"occ__closure-label\">{{ c.label }}</span>\n </div>\n }\n }\n @if (lr.freeSlot !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"4 + lr.freeSlot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate($event, lr.lane, lr.freeSlot)\n \"\n (mousemove)=\"\n onLaneMouseMove($event, lr.lane, lr.freeSlot)\n \"></div>\n }\n @for (lb of lr.bars; track lb.bar.id) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-open-ended]=\"lb.bar.endDate === null\"\n [class.is-resizing]=\"isResizing(lb.bar.id)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.id)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.slot * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"startBarMove($event, lr.lane, lb.bar)\"\n (click)=\"\n $event.stopPropagation(); onBarClick(lb.bar, lr.lane)\n \"\n (keydown.enter)=\"\n barClick.emit({ bar: lb.bar, lane: lr.lane })\n \"\n (keydown)=\"\n onBarKeydownResize($event, lr.lane, lb.bar, lr.bars)\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'start', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.title }}</span>\n @if (lb.bar.subtitle) {\n <span class=\"occ__bar-sub\">{{ lb.bar.subtitle }}</span>\n }\n @if (lb.bar.badge) {\n <span class=\"occ__bar-badge\">{{ lb.bar.badge }}</span>\n }\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize($event, lr.lane, lb.bar, 'end', lr.bars)\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [class.is-cut-right]=\"g.openEnded\"\n [class.is-open-ended]=\"g.openEnded\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ emptyLabelKey() | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of legend(); track s.state) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s.state\"></i\n >{{ s.labelKey | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-tag{flex-shrink:0;padding:0 5px;border-radius:999px;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);font-size:10px;line-height:15px;color:var(--ud-occ-muted)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar-sub{margin-left:6px;opacity:.7;overflow:hidden;text-overflow:ellipsis}.occ__bar-badge{margin-left:auto;padding-left:6px;font-size:10px;font-weight:600}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__row--room.is-drop-disabled{opacity:.4;filter:grayscale(1)}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__bar.is-open-ended{padding-right:16px}.occ__bar.is-open-ended:after{content:\"\\2192\";opacity:.9}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"] }]
5934
+ }], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i0.DestroyRef }] });
5935
+
5936
+ const OCCUPANCY_GRID_HEADER_HEIGHT = TIMELINE_GRID_HEADER_HEIGHT;
5937
+ const numeric = (a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: 'base' });
5938
+ /** A room as a timeline lane under dorm › floor › type headers, numerically ordered. */
5939
+ function roomLanes(rooms, dormName) {
5940
+ return [...rooms]
5941
+ .sort((a, b) => numeric(a.floorLevel, b.floorLevel) ||
5942
+ numeric(a.type, b.type) ||
5943
+ numeric(a.number, b.number) ||
5944
+ a.roomId.localeCompare(b.roomId))
5945
+ .map(room => ({
5946
+ id: room.roomId,
5947
+ label: room.number,
5948
+ sublabel: room.type,
5949
+ groupId: `type:${room.type}`,
5950
+ groupLabel: room.type,
5951
+ parentGroups: [
5952
+ { id: 'dorm', label: dormName },
5953
+ { id: `floor:${room.floorLevel}`, label: room.floorLevel },
5954
+ ],
5955
+ active: room.active,
5956
+ capacity: room.capacity,
5957
+ bars: room.bars.map((bar) => ({
5958
+ id: bar.bookingId,
5959
+ title: bar.studentName,
5960
+ startDate: bar.startDate,
5961
+ endDate: bar.endDate,
5962
+ continuesBefore: bar.continuesBefore,
5963
+ continuesAfter: bar.continuesAfter,
5964
+ state: bar.state,
5965
+ data: bar,
5966
+ })),
5967
+ closures: room.closures.map((closure) => ({
5968
+ id: closure.closureId,
5969
+ label: closure.reason,
5970
+ startDate: closure.startDate,
5971
+ endDate: closure.endDate,
5972
+ continuesBefore: closure.continuesBefore,
5973
+ continuesAfter: closure.continuesAfter,
5974
+ data: closure,
5975
+ })),
5976
+ data: room,
5977
+ }));
5978
+ }
5979
+ const roomOf = (lane) => lane.data;
5980
+ const barOf = (bar) => bar.data;
5981
+ /**
5982
+ * Rooms as rows, days as columns, one bar per stay (UC-11). Since UC-42 a thin
5983
+ * adapter over `ud-timeline-grid`: rooms become lanes (grouped dorm › floor ›
5984
+ * type), stays become bars, and every generic event is mapped back to the
5985
+ * room/stay one, so its inputs and outputs are what they always were. The one
5986
+ * room-only rule, capacity (`preventOverbooking`), is enforced here.
5987
+ */
5988
+ class OccupancyGridComponent {
5989
+ translate;
5990
+ snackBar;
5991
+ rooms = input([]);
5992
+ dormName = input('');
5993
+ from = input.required();
5994
+ to = input.required();
5995
+ today = input(null);
5996
+ dayWidth = input(28);
5997
+ leftColumnWidth = input(220);
5998
+ laneHeight = input(22);
5999
+ loading = input(false);
6000
+ /** Days the ‹ / › nav buttons and the ArrowLeft/ArrowRight keys shift the window by. */
6001
+ navStepDays = input(7);
6002
+ /**
6003
+ * When true, a resize or whole-bar move drag is never allowed to leave
6004
+ * two bars in the same room overlapping in time. The default (false)
6005
+ * lets bars in different lanes of the same room legitimately overlap —
6006
+ * an outgoing stay's last few nights next to an incoming one's first, say.
6007
+ */
6008
+ preventOverlap = input(false);
6009
+ /**
6010
+ * Off by default, like `preventOverlap`: the grid otherwise defers capacity
6011
+ * to the consumer. When set, a create, move or resize that would put more
6012
+ * stays in a room than it has beds on some night is dropped instead of
6013
+ * emitted, the bar stays where it was, and a snackbar says why.
6014
+ */
6015
+ preventOverbooking = input(false);
6016
+ barClick = output();
6017
+ closureClick = output();
6018
+ roomClick = output();
6019
+ /** An empty day cell was clicked: the room and the date under the pointer. */
6020
+ cellClick = output();
6021
+ reachedEnd = output();
6022
+ /** The signed day delta the nav buttons or an arrow key asked for; see `TimelineGridComponent.windowShift`. */
6023
+ windowShift = output();
6024
+ /** See `OccupancyBarResize` — this reports the proposal; it never applies it. */
6025
+ barResize = output();
6026
+ /** See `OccupancyBarMove` — this reports the proposal; it never applies it. */
6027
+ barMove = output();
6028
+ /** See `OccupancyBarCreate` — this reports the proposal; it never creates a bar itself. */
6029
+ barCreate = output();
6030
+ lanes = computed(() => roomLanes(this.rooms(), this.dormName()));
6031
+ roomOf = roomOf;
6032
+ barOf = barOf;
6033
+ grid = viewChild.required(TimelineGridComponent);
6034
+ /** The live edge drag, as this component held it before UC-42 moved it into the timeline grid. */
6035
+ resize = computed(() => this.grid().activeResize());
6036
+ constructor(translate, snackBar) {
6037
+ this.translate = translate;
6038
+ this.snackBar = snackBar;
6039
+ }
6040
+ onClosureClick(closure, lane) {
6041
+ this.closureClick.emit({
6042
+ closure: closure.data,
6043
+ room: roomOf(lane),
6044
+ });
6045
+ }
6046
+ onBarResize(e) {
6047
+ const room = roomOf(e.lane);
6048
+ const bar = barOf(e.bar);
6049
+ const end = e.proposedEndDate;
6050
+ if (this.rejectIfOverbooked(room, bar.bookingId, e.proposedStartDate, end)) {
6051
+ return;
6052
+ }
6053
+ this.barResize.emit({
6054
+ bar,
6055
+ room,
6056
+ edge: e.edge,
6057
+ previousStartDate: e.previousStartDate,
6058
+ previousEndDate: e.previousEndDate,
6059
+ proposedStartDate: e.proposedStartDate,
6060
+ proposedEndDate: end,
6061
+ });
6062
+ }
6063
+ onBarMove(e) {
6064
+ const toRoom = roomOf(e.toLane);
6065
+ const bar = barOf(e.bar);
6066
+ const end = e.proposedEndDate;
6067
+ if (this.rejectIfOverbooked(toRoom, bar.bookingId, e.proposedStartDate, end)) {
6068
+ return;
6069
+ }
6070
+ this.barMove.emit({
6071
+ bar,
6072
+ fromRoom: roomOf(e.fromLane),
6073
+ toRoom,
6074
+ previousStartDate: e.previousStartDate,
6075
+ previousEndDate: e.previousEndDate,
6076
+ proposedStartDate: e.proposedStartDate,
6077
+ proposedEndDate: end,
6078
+ });
6079
+ }
6080
+ onBarCreate(e) {
6081
+ const room = roomOf(e.lane);
6082
+ if (this.rejectIfOverbooked(room, '', e.proposedStartDate, e.proposedEndDate)) {
6083
+ return;
6084
+ }
6085
+ this.barCreate.emit({
6086
+ room,
6087
+ proposedStartDate: e.proposedStartDate,
6088
+ proposedEndDate: e.proposedEndDate,
6089
+ });
6090
+ }
6091
+ /**
6092
+ * With `preventOverbooking`, a gesture that would put more stays in a room
6093
+ * than it has beds is dropped here, so the bar simply stays where it was,
6094
+ * with a snackbar saying why.
6095
+ */
6096
+ rejectIfOverbooked(room, bookingId, start, end) {
6097
+ if (!this.preventOverbooking() ||
6098
+ !overbooksRoom(room, bookingId, start, end)) {
6099
+ return false;
6100
+ }
6101
+ this.snackBar.openFromComponent(CustomSnackbarComponent, {
6102
+ horizontalPosition: 'end',
6103
+ verticalPosition: 'top',
6104
+ panelClass: ['custom-snackbar-container'],
6105
+ data: {
6106
+ message: this.translate.instant('occupancyGrid.overbooked', {
6107
+ room: room.number,
6108
+ }),
6109
+ type: SnackbarType.WARNING,
6110
+ duration: 3000,
6111
+ },
6112
+ });
6113
+ return true;
6114
+ }
6115
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, deps: [{ token: i1$4.TranslateService }, { token: i1$2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
6116
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.19", type: OccupancyGridComponent, isStandalone: true, selector: "ud-occupancy-grid", inputs: { rooms: { classPropertyName: "rooms", publicName: "rooms", isSignal: true, isRequired: false, transformFunction: null }, dormName: { classPropertyName: "dormName", publicName: "dormName", isSignal: true, isRequired: false, transformFunction: null }, from: { classPropertyName: "from", publicName: "from", isSignal: true, isRequired: true, transformFunction: null }, to: { classPropertyName: "to", publicName: "to", isSignal: true, isRequired: true, transformFunction: null }, today: { classPropertyName: "today", publicName: "today", isSignal: true, isRequired: false, transformFunction: null }, dayWidth: { classPropertyName: "dayWidth", publicName: "dayWidth", isSignal: true, isRequired: false, transformFunction: null }, leftColumnWidth: { classPropertyName: "leftColumnWidth", publicName: "leftColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, laneHeight: { classPropertyName: "laneHeight", publicName: "laneHeight", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, navStepDays: { classPropertyName: "navStepDays", publicName: "navStepDays", isSignal: true, isRequired: false, transformFunction: null }, preventOverlap: { classPropertyName: "preventOverlap", publicName: "preventOverlap", isSignal: true, isRequired: false, transformFunction: null }, preventOverbooking: { classPropertyName: "preventOverbooking", publicName: "preventOverbooking", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick", closureClick: "closureClick", roomClick: "roomClick", cellClick: "cellClick", reachedEnd: "reachedEnd", windowShift: "windowShift", barResize: "barResize", barMove: "barMove", barCreate: "barCreate" }, viewQueries: [{ propertyName: "grid", first: true, predicate: TimelineGridComponent, descendants: true, isSignal: true }], ngImport: i0, template: `
6117
+ <ud-timeline-grid
6118
+ [lanes]="lanes()"
6119
+ [from]="from()"
6120
+ [to]="to()"
6121
+ [today]="today()"
6122
+ [dayWidth]="dayWidth()"
6123
+ [leftColumnWidth]="leftColumnWidth()"
6124
+ [laneHeight]="laneHeight()"
6125
+ [loading]="loading()"
6126
+ [navStepDays]="navStepDays()"
6127
+ [preventOverlap]="preventOverlap()"
6128
+ cornerLabelKey="occupancyGrid.rooms"
6129
+ emptyLabelKey="occupancyGrid.empty"
6130
+ createCellLabelKey="occupancyGrid.createCell"
6131
+ (barClick)="
6132
+ barClick.emit({ bar: barOf($event.bar), room: roomOf($event.lane) })
6133
+ "
6134
+ (closureClick)="onClosureClick($event.closure, $event.lane)"
6135
+ (laneClick)="roomClick.emit(roomOf($event))"
6136
+ (cellClick)="
6137
+ cellClick.emit({ room: roomOf($event.lane), date: $event.date })
6138
+ "
6139
+ (reachedEnd)="reachedEnd.emit($event)"
6140
+ (windowShift)="windowShift.emit($event)"
6141
+ (barResize)="onBarResize($event)"
6142
+ (barMove)="onBarMove($event)"
6143
+ (barCreate)="onBarCreate($event)" />
6144
+ `, isInline: true, styles: [":host{display:block;width:100%;height:var(--ud-occ-height, 640px)}ud-timeline-grid{height:100%}\n"], dependencies: [{ kind: "component", type: TimelineGridComponent, selector: "ud-timeline-grid", inputs: ["lanes", "from", "to", "today", "dayWidth", "leftColumnWidth", "laneHeight", "loading", "navStepDays", "preventOverlap", "cornerLabelKey", "emptyLabelKey", "createCellLabelKey", "legend", "dragPayload", "canDrop"], outputs: ["barClick", "closureClick", "laneClick", "cellClick", "reachedEnd", "windowShift", "barResize", "barMove", "barCreate", "laneDrop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
5790
6145
  }
5791
6146
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: OccupancyGridComponent, decorators: [{
5792
6147
  type: Component,
5793
- args: [{ selector: 'ud-occupancy-grid', standalone: true, imports: [UdTooltipDirective, TranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"occ\"\n [class.is-loading]=\"loading()\"\n [class.is-dragging-active]=\"\n resize() !== null || move()?.dragging || create()?.dragging\n \"\n [style.--dw]=\"dayWidth() + 'px'\"\n (keydown)=\"onGridKeydown($event)\">\n <div #scroller class=\"occ__scroller\" (scroll)=\"onScroll()\">\n <div\n class=\"occ__canvas\"\n [style.width.px]=\"canvasWidth()\"\n [style.height.px]=\"bodyHeight() + headerHeight\"\n (mousemove)=\"onCanvasMouseMove($event)\"\n (mouseleave)=\"hoverDay.set(null)\">\n <!-- Sticky two-tier header -->\n <div class=\"occ__header\" [style.height.px]=\"headerHeight\">\n <div class=\"occ__corner\" [style.width.px]=\"leftColumnWidth()\">\n <span class=\"occ__eyebrow\">{{\n 'occupancyGrid.rooms' | translate\n }}</span>\n <div class=\"occ__nav\">\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.prev' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.prev' | translate\"\n (click)=\"shiftWindow(-1)\">\n \u2039\n </button>\n <button\n type=\"button\"\n class=\"occ__nav-btn\"\n [attr.aria-label]=\"'occupancyGrid.nav.next' | translate\"\n [udTooltip]=\"'occupancyGrid.nav.next' | translate\"\n (click)=\"shiftWindow(1)\">\n \u203A\n </button>\n </div>\n </div>\n <div class=\"occ__months\" [style.left.px]=\"leftColumnWidth()\">\n @for (m of months(); track m.label) {\n <div\n class=\"occ__month\"\n [style.left.px]=\"m.left\"\n [style.width.px]=\"m.width\">\n {{ m.label }}\n </div>\n }\n </div>\n <div class=\"occ__days\" [style.left.px]=\"leftColumnWidth()\">\n @for (d of days(); track d.iso) {\n <div\n class=\"occ__day\"\n [class.is-weekend]=\"d.isWeekend\"\n [class.is-today]=\"d.iso === today()\"\n [class.is-hovered]=\"$index === hoverDay()\"\n [style.left.px]=\"d.left\"\n [style.width.px]=\"dayWidth()\">\n <span class=\"occ__day-num\">{{ d.dayOfMonth }}</span>\n <span class=\"occ__day-wd\">{{\n 'occupancyGrid.weekdays.' + d.weekday | translate\n }}</span>\n </div>\n }\n </div>\n </div>\n\n <!-- Today column, behind rows -->\n @if (todayLeft() !== null) {\n <div\n class=\"occ__today\"\n [style.left.px]=\"leftColumnWidth() + todayLeft()!\"\n [style.top.px]=\"headerHeight\"\n [style.width.px]=\"dayWidth()\"\n [style.height.px]=\"bodyHeight()\"></div>\n }\n\n <!-- Virtualized rows -->\n @for (p of visible(); track trackRow($index, p)) {\n @if (p.row.kind === 'group') {\n <div\n class=\"occ__row occ__row--group\"\n [attr.data-depth]=\"p.row.depth\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"toggleGroup(p.row.key)\"\n (keydown.enter)=\"toggleGroup(p.row.key)\">\n <div\n class=\"occ__cell occ__cell--sticky\"\n [style.width.px]=\"leftColumnWidth()\">\n <span\n class=\"occ__chevron\"\n [class.is-collapsed]=\"isCollapsed(p.row.key)\"\n >\u25BE</span\n >\n <span class=\"occ__eyebrow\">{{ p.row.label }}</span>\n <span class=\"occ__count\">{{ p.row.roomCount }}</span>\n </div>\n <div\n class=\"occ__lane-bg\"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n } @else {\n <div\n class=\"occ__row occ__row--room\"\n [class.is-inactive]=\"!asRoomRow(p.row).room.active\"\n [class.is-move-target]=\"isMoveTarget(asRoomRow(p.row).room.roomId)\"\n [attr.data-room-id]=\"asRoomRow(p.row).room.roomId\"\n [style.top.px]=\"headerHeight + p.top\"\n [style.height.px]=\"p.height\">\n <div\n class=\"occ__cell occ__cell--sticky occ__room\"\n [style.width.px]=\"leftColumnWidth()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"roomClick.emit(asRoomRow(p.row).room)\"\n (keydown.enter)=\"roomClick.emit(asRoomRow(p.row).room)\">\n <span class=\"occ__room-number\">{{\n asRoomRow(p.row).room.number\n }}</span>\n <span class=\"occ__room-type\">{{\n asRoomRow(p.row).room.type\n }}</span>\n @if (takenOn(asRoomRow(p.row).room) !== null) {\n <span\n class=\"occ__room-occ\"\n [udTooltip]=\"\n 'occupancyGrid.takenOn' | translate: { date: from() }\n \"\n [class.is-full]=\"\n takenOn(asRoomRow(p.row).room)! >=\n asRoomRow(p.row).room.capacity\n \">\n {{ takenOn(asRoomRow(p.row).room) }}/{{\n asRoomRow(p.row).room.capacity\n }}\n </span>\n }\n </div>\n <div\n class=\"occ__lane-bg\"\n tabindex=\"0\"\n [attr.aria-label]=\"\n 'occupancyGrid.createCell'\n | translate: { room: asRoomRow(p.row).room.number }\n \"\n [style.left.px]=\"leftColumnWidth()\"\n [style.width.px]=\"dayCount() * dayWidth()\"\n [style.--weekend-offset]=\"weekendOffsetPx() + 'px'\"\n (mousedown)=\"startCreate($event, asRoomRow(p.row).room)\"\n (click)=\"onLaneClick($event, asRoomRow(p.row).room)\"\n (mousemove)=\"onLaneMouseMove($event, asRoomRow(p.row).room)\"\n (mouseleave)=\"onLaneMouseLeave(asRoomRow(p.row).room)\"\n (focus)=\"onLaneFocus(asRoomRow(p.row).room)\"\n (blur)=\"onLaneBlur()\"\n (keydown)=\"onLaneKeydown($event, asRoomRow(p.row).room)\">\n @for (c of asRoomRow(p.row).room.closures; track c.closureId) {\n @if (closureGeometryOf(c); as g) {\n <div\n class=\"occ__closure\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [style.left.px]=\"g.left\"\n [style.width.px]=\"g.width\"\n [udTooltip]=\"closureTitle(c)\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"$event.stopPropagation()\"\n (click)=\"\n $event.stopPropagation();\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown.enter)=\"\n closureClick.emit({\n closure: c,\n room: asRoomRow(p.row).room,\n })\n \">\n <span class=\"occ__closure-label\">{{ c.reason }}</span>\n </div>\n }\n }\n @if (asRoomRow(p.row).freeLane !== null) {\n <div\n class=\"occ__lane-free\"\n [style.top.px]=\"\n 4 + asRoomRow(p.row).freeLane! * (laneHeight() + 4)\n \"\n [style.height.px]=\"laneHeight()\"\n (mousedown)=\"\n $event.stopPropagation();\n startCreate(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"\n (mousemove)=\"\n onLaneMouseMove(\n $event,\n asRoomRow(p.row).room,\n asRoomRow(p.row).freeLane!\n )\n \"></div>\n }\n @for (lb of asRoomRow(p.row).bars; track lb.bar.bookingId) {\n @if (geometryOf(lb.bar); as g) {\n <div\n class=\"occ__bar\"\n [attr.data-state]=\"lb.bar.state\"\n [class.is-cut-left]=\"g.cutLeft\"\n [class.is-cut-right]=\"g.cutRight\"\n [class.is-resizing]=\"isResizing(lb.bar.bookingId)\"\n [class.is-moving]=\"isBeingMoved(lb.bar.bookingId)\"\n [style.left.px]=\"g.left + 1\"\n [style.width.px]=\"g.width - 2\"\n [style.top.px]=\"4 + lb.lane * (laneHeight() + 4)\"\n [style.height.px]=\"laneHeight()\"\n [udTooltip]=\"barTitle(lb.bar)\"\n [attr.aria-keyshortcuts]=\"'Shift+ArrowRight Shift+ArrowLeft'\"\n role=\"button\"\n tabindex=\"0\"\n (mousedown)=\"\n startBarMove($event, asRoomRow(p.row).room, lb.bar)\n \"\n (click)=\"\n $event.stopPropagation();\n onBarClick(lb.bar, asRoomRow(p.row).room)\n \"\n (keydown.enter)=\"\n barClick.emit({\n bar: lb.bar,\n room: asRoomRow(p.row).room,\n })\n \"\n (keydown)=\"\n onBarKeydownResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n asRoomRow(p.row).bars\n )\n \">\n @if (!g.cutLeft) {\n <span\n class=\"occ__bar-handle occ__bar-handle--start\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'start',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n <span class=\"occ__bar-label\">{{ lb.bar.studentName }}</span>\n @if (!g.cutRight) {\n <span\n class=\"occ__bar-handle occ__bar-handle--end\"\n aria-hidden=\"true\"\n (mousedown)=\"\n startResize(\n $event,\n asRoomRow(p.row).room,\n lb.bar,\n 'end',\n asRoomRow(p.row).bars\n )\n \"\n (click)=\"$event.stopPropagation()\"></span>\n }\n </div>\n }\n }\n </div>\n <div class=\"occ__row-hover\" aria-hidden=\"true\"></div>\n @if (hoverDay() !== null) {\n <div\n class=\"occ__col-hover\"\n aria-hidden=\"true\"\n [style.left.px]=\"leftColumnWidth() + hoverDay()! * dayWidth()\"\n [style.width.px]=\"dayWidth()\"></div>\n }\n </div>\n }\n }\n\n <!-- The floating copy of a bar being dragged by its body \u2014 see `moveGhost`. -->\n @if (moveGhost(); as g) {\n <div\n class=\"occ__bar occ__bar--ghost\"\n aria-hidden=\"true\"\n [attr.data-state]=\"g.state\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\">\n <span class=\"occ__bar-label\">{{ g.label }}</span>\n </div>\n }\n\n <!-- The in-progress drag-to-create's preview span \u2014 see `createGhost`. -->\n @if (createGhost(); as g) {\n <div\n class=\"occ__bar--create\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n <!-- The hovered or keyboard-focused empty cell \u2014 see `laneCursorGeometry`. -->\n @if (laneCursorGeometry(); as g) {\n <div\n class=\"occ__lane-cursor\"\n aria-hidden=\"true\"\n [style.left.px]=\"g.left\"\n [style.top.px]=\"g.top\"\n [style.width.px]=\"g.width\"\n [style.height.px]=\"g.height\"></div>\n }\n\n @if (rows().length === 0 && !loading()) {\n <div class=\"occ__empty\" [style.top.px]=\"headerHeight\">\n {{ 'occupancyGrid.empty' | translate }}\n </div>\n }\n </div>\n </div>\n\n <div class=\"occ__legend\">\n @for (s of ['tentative', 'reserved', 'in_room', 'history']; track s) {\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch\" [attr.data-state]=\"s\"></i\n >{{ 'occupancyGrid.states.' + s | translate }}</span\n >\n }\n <span class=\"occ__legend-item\"\n ><i class=\"occ__swatch occ__swatch--closed\"></i\n >{{ 'occupancyGrid.states.closed' | translate }}</span\n >\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:host{display:block;width:100%;height:var(--ud-occ-height, 640px);--ud-occ-paper: #f5f4f0;--ud-occ-surface: #ffffff;--ud-occ-ink: #1b2535;--ud-occ-muted: #6b7585;--ud-occ-rule: #ebe9e3;--ud-occ-rule-strong: #d9d5cb;--ud-occ-weekend: rgba(27, 37, 53, .035);--ud-occ-today: rgba(74, 127, 232, .1);--ud-occ-accent: #4a7fe8;--ud-occ-crosshair: rgba(27, 37, 53, .06);--ud-occ-tentative-bg: #fff4d6;--ud-occ-tentative-rail: #d97706;--ud-occ-reserved-bg: #dbeafe;--ud-occ-reserved-rail: #1d4ed8;--ud-occ-inroom-bg: #1b2535;--ud-occ-inroom-rail: #4a7fe8;--ud-occ-inroom-ink: #f5f6f7;--ud-occ-history-bg: #ececec;--ud-occ-history-rail: #9aa1ad;--ud-occ-closed: rgba(220, 38, 38, .1);--ud-occ-closed-rail: #dc2626;--ud-occ-radius: 6px;--ud-occ-font: \"Sora\", system-ui, sans-serif;font-family:var(--ud-occ-font);color:var(--ud-occ-ink)}.occ{display:flex;flex-direction:column;height:100%;background:var(--ud-occ-paper);border:1px solid var(--ud-occ-rule-strong);border-radius:10px;overflow:hidden}.occ.is-loading .occ__canvas{opacity:.55}.occ.is-dragging-active{-webkit-user-select:none;user-select:none}.occ__scroller{position:relative;flex:1;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--ud-occ-rule-strong) transparent}.occ__scroller::-webkit-scrollbar{width:10px;height:10px}.occ__scroller::-webkit-scrollbar-track{background:transparent}.occ__scroller::-webkit-scrollbar-thumb{background-color:var(--ud-occ-rule-strong);border-radius:6px;border:2px solid var(--ud-occ-surface)}.occ__scroller::-webkit-scrollbar-thumb:hover{background-color:var(--ud-occ-muted)}.occ__canvas{position:relative}.occ__eyebrow{font-family:var(--ud-occ-font);font-weight:700;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--ud-occ-muted)}.occ__header{position:sticky;top:0;z-index:4;background:var(--ud-occ-surface);border-bottom:1px solid var(--ud-occ-rule-strong);width:100%}.occ__corner{position:sticky;left:0;z-index:5;height:100%;display:flex;align-items:center;justify-content:space-between;padding:0 8px 0 12px;background:var(--ud-occ-surface);border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350d;box-sizing:border-box}.occ__nav{display:flex;gap:2px}.occ__nav-btn{width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--ud-occ-rule-strong);border-radius:var(--ud-occ-radius);background:var(--ud-occ-surface);color:var(--ud-occ-muted);font-size:14px;line-height:1;cursor:pointer;padding:0;transition:background .12s ease,color .12s ease,transform 80ms ease}.occ__nav-btn:hover{background:var(--ud-occ-weekend);color:var(--ud-occ-ink)}.occ__nav-btn:active{transform:scale(.92)}.occ__nav-btn:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:1px}.occ__months,.occ__days{position:absolute;top:0;height:26px}.occ__days{top:26px}.occ__month{position:absolute;top:0;height:26px;line-height:26px;padding-left:8px;font-size:12px;font-weight:600;border-left:1px solid var(--ud-occ-rule-strong);box-sizing:border-box;white-space:nowrap;overflow:hidden}.occ__day{position:absolute;top:0;height:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;font-variant-numeric:tabular-nums;font-size:11px;line-height:1;border-left:1px solid var(--ud-occ-rule);box-sizing:border-box}.occ__day.is-weekend{background:var(--ud-occ-weekend)}.occ__day.is-today{font-weight:700}.occ__day.is-hovered{background:var(--ud-occ-crosshair);box-shadow:inset 0 -2px 0 var(--ud-occ-accent);color:var(--ud-occ-ink);font-weight:700}.occ__day-num{display:inline-flex}.occ__day.is-today .occ__day-num{align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--ud-occ-accent);color:#fff}.occ__day-wd{font-size:9px;color:var(--ud-occ-muted);margin-top:2px}.occ__today{position:absolute;z-index:1;background:var(--ud-occ-today);border-left:1px solid var(--ud-occ-accent);border-right:1px solid var(--ud-occ-accent);box-sizing:border-box;pointer-events:none}.occ__row{position:absolute;left:0;width:100%;box-sizing:border-box;border-bottom:1px solid var(--ud-occ-rule)}.occ__row--group{cursor:pointer;background:var(--ud-occ-paper);z-index:3}.occ__row--group[data-depth=\"0\"] .occ__eyebrow{color:var(--ud-occ-ink)}.occ__row--group[data-depth=\"1\"] .occ__cell--sticky{padding-left:20px}.occ__row--group[data-depth=\"2\"] .occ__cell--sticky{padding-left:32px}.occ__row--room{background:var(--ud-occ-surface);z-index:2}.occ__row--room.is-inactive .occ__room{opacity:.55}.occ__row-hover{position:absolute;inset:0;background:transparent;pointer-events:none;transition:background .1s ease}.occ__row--room:hover .occ__row-hover{background:var(--ud-occ-crosshair)}.occ__row--room:hover .occ__room{background-image:linear-gradient(var(--ud-occ-crosshair),var(--ud-occ-crosshair));box-shadow:inset 3px 0 0 var(--ud-occ-accent)}.occ__col-hover{position:absolute;top:0;bottom:0;background:var(--ud-occ-crosshair);pointer-events:none}.occ__cell--sticky{position:sticky;left:0;z-index:3;height:100%;display:flex;align-items:center;gap:8px;padding:0 12px;background:inherit;border-right:1px solid var(--ud-occ-rule-strong);box-shadow:2px 0 5px #1b25350a;box-sizing:border-box}.occ__chevron{display:inline-block;transition:transform .15s;font-size:12px}.occ__chevron.is-collapsed{transform:rotate(-90deg)}.occ__count{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-variant-numeric:tabular-nums;font-size:11px;color:var(--ud-occ-muted)}.occ__room{cursor:pointer}.occ__room-number{font-weight:600;font-size:13px}.occ__room-type{font-size:11px;color:var(--ud-occ-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.occ__room-occ{margin-left:auto;font-family:var(--ud-occ-font);font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}.occ__room-occ.is-full{color:var(--ud-occ-closed-rail)}.occ__lane-bg{position:absolute;top:0;height:100%;background-image:linear-gradient(to right,var(--ud-occ-rule) 1px,transparent 1px),repeating-linear-gradient(to right,var(--ud-occ-weekend) 0 calc(var(--dw) * 2),transparent calc(var(--dw) * 2) calc(var(--dw) * 7));background-size:var(--dw) 100%,calc(var(--dw) * 7) 100%;background-position:0 0,var(--weekend-offset, 0px) 0}.occ__row--room .occ__lane-bg{cursor:pointer}.occ__lane-free{position:absolute;left:0;right:0;z-index:0;box-sizing:border-box;border-radius:var(--ud-occ-radius);border:1px dashed var(--ud-occ-rule)}.occ__bar{position:absolute;z-index:2;display:flex;align-items:center;padding:0 6px 0 8px;box-sizing:border-box;border-radius:var(--ud-occ-radius);border-left:4px solid var(--ud-occ-accent);font-size:12px;cursor:grab;overflow:hidden;white-space:nowrap;box-shadow:0 1px 2px #1b253514;transition:box-shadow .12s ease,transform .12s ease}.occ__bar:hover{box-shadow:0 3px 8px #1b25352e;transform:translateY(-1px)}.occ__bar-label{overflow:hidden;text-overflow:ellipsis}.occ__bar.is-moving{opacity:.35;cursor:grabbing}.occ__bar--ghost{z-index:6;cursor:grabbing;pointer-events:none;outline:2px dashed var(--ud-occ-accent);outline-offset:2px;box-shadow:0 8px 20px #1b253552}.occ__row--room.is-move-target .occ__lane-bg{background-color:#4a7fe814}.occ__bar--create{position:absolute;z-index:6;box-sizing:border-box;border-radius:var(--ud-occ-radius);background:#4a7fe82e;border:2px dashed var(--ud-occ-accent);pointer-events:none}.occ__lane-cursor{position:absolute;z-index:3;box-sizing:border-box;border-radius:var(--ud-occ-radius);outline:2px solid var(--ud-occ-accent);outline-offset:-2px;pointer-events:none}.occ__bar-handle{position:absolute;top:0;bottom:0;width:8px;cursor:ew-resize;opacity:0;transition:opacity .12s ease}.occ__bar-handle--start{left:0}.occ__bar-handle--end{right:0}.occ__bar:hover .occ__bar-handle,.occ__bar:focus-visible .occ__bar-handle{opacity:1}.occ__bar[data-state=in_room] .occ__bar-handle{background:#ffffff4d}.occ__bar:not([data-state=in_room]) .occ__bar-handle{background:#1b253524}.occ__bar.is-resizing{z-index:5;box-shadow:0 4px 14px #1b253547;outline:2px dashed var(--ud-occ-accent);outline-offset:2px}.occ__bar.is-resizing .occ__bar-handle{opacity:1}.occ__bar[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail);border-top:1px dashed var(--ud-occ-tentative-rail);border-bottom:1px dashed var(--ud-occ-tentative-rail);border-right:1px dashed var(--ud-occ-tentative-rail)}.occ__bar[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__bar[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail);color:var(--ud-occ-inroom-ink)}.occ__bar[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__bar.is-cut-left{border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0;padding-left:10px}.occ__bar.is-cut-right{border-top-right-radius:0;border-bottom-right-radius:0}.occ__bar.is-cut-left:before,.occ__bar.is-cut-right:after{content:\"\\203a\";position:absolute;top:0;bottom:0;display:flex;align-items:center;font-size:12px;opacity:.7}.occ__bar.is-cut-left:before{left:2px;content:\"\\2039\"}.occ__bar.is-cut-right:after{right:2px}.occ__closure{position:absolute;top:0;height:100%;z-index:1;box-sizing:border-box;cursor:pointer;background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 6px,transparent 6px 12px);border-left:3px solid var(--ud-occ-closed-rail);border-right:1px solid var(--ud-occ-closed-rail);display:flex;align-items:center;padding-left:8px;font-size:11px;color:var(--ud-occ-closed-rail);overflow:hidden;white-space:nowrap}.occ__closure.is-cut-left{border-left-width:0}.occ__closure.is-cut-right{border-right-width:0}.occ__empty{position:absolute;left:0;right:0;padding:32px;text-align:center;color:var(--ud-occ-muted)}.occ__legend{display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 12px;border-top:1px solid var(--ud-occ-rule-strong);background:var(--ud-occ-surface);font-size:12px;color:var(--ud-occ-muted)}.occ__legend-item{display:inline-flex;align-items:center;gap:6px}.occ__swatch{width:14px;height:10px;border-radius:2px;border-left:3px solid var(--ud-occ-accent);display:inline-block}.occ__swatch[data-state=tentative]{background:var(--ud-occ-tentative-bg);border-left-color:var(--ud-occ-tentative-rail)}.occ__swatch[data-state=reserved]{background:var(--ud-occ-reserved-bg);border-left-color:var(--ud-occ-reserved-rail)}.occ__swatch[data-state=in_room]{background:var(--ud-occ-inroom-bg);border-left-color:var(--ud-occ-inroom-rail)}.occ__swatch[data-state=history]{background:var(--ud-occ-history-bg);border-left-color:var(--ud-occ-history-rail)}.occ__swatch--closed{background:repeating-linear-gradient(135deg,var(--ud-occ-closed) 0 3px,transparent 3px 6px);border-left-color:var(--ud-occ-closed-rail)}.occ__cell--sticky:focus-visible,.occ__row--group:focus-visible,.occ__bar:focus-visible,.occ__closure:focus-visible{outline:2px solid var(--ud-occ-accent);outline-offset:-2px;z-index:6}.occ__lane-bg:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.occ__chevron,.occ__nav-btn,.occ__bar,.occ__bar-handle,.occ__row-hover{transition:none}.occ__bar:hover,.occ__nav-btn:active{transform:none}}\n"] }]
5794
- }], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i1$2.MatSnackBar }, { type: i0.DestroyRef }] });
6148
+ args: [{ selector: 'ud-occupancy-grid', standalone: true, imports: [TimelineGridComponent], template: `
6149
+ <ud-timeline-grid
6150
+ [lanes]="lanes()"
6151
+ [from]="from()"
6152
+ [to]="to()"
6153
+ [today]="today()"
6154
+ [dayWidth]="dayWidth()"
6155
+ [leftColumnWidth]="leftColumnWidth()"
6156
+ [laneHeight]="laneHeight()"
6157
+ [loading]="loading()"
6158
+ [navStepDays]="navStepDays()"
6159
+ [preventOverlap]="preventOverlap()"
6160
+ cornerLabelKey="occupancyGrid.rooms"
6161
+ emptyLabelKey="occupancyGrid.empty"
6162
+ createCellLabelKey="occupancyGrid.createCell"
6163
+ (barClick)="
6164
+ barClick.emit({ bar: barOf($event.bar), room: roomOf($event.lane) })
6165
+ "
6166
+ (closureClick)="onClosureClick($event.closure, $event.lane)"
6167
+ (laneClick)="roomClick.emit(roomOf($event))"
6168
+ (cellClick)="
6169
+ cellClick.emit({ room: roomOf($event.lane), date: $event.date })
6170
+ "
6171
+ (reachedEnd)="reachedEnd.emit($event)"
6172
+ (windowShift)="windowShift.emit($event)"
6173
+ (barResize)="onBarResize($event)"
6174
+ (barMove)="onBarMove($event)"
6175
+ (barCreate)="onBarCreate($event)" />
6176
+ `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:var(--ud-occ-height, 640px)}ud-timeline-grid{height:100%}\n"] }]
6177
+ }], ctorParameters: () => [{ type: i1$4.TranslateService }, { type: i1$2.MatSnackBar }] });
5795
6178
 
5796
6179
  class SummaryViewComponent {
5797
6180
  clipboard = inject(Clipboard);
@@ -7394,6 +7777,12 @@ const en = {
7394
7777
  },
7395
7778
  weekdays: { 0: 'S', 1: 'M', 2: 'T', 3: 'W', 4: 'T', 5: 'F', 6: 'S' },
7396
7779
  },
7780
+ timelineGrid: {
7781
+ lanes: 'Lanes',
7782
+ empty: 'Nothing to show',
7783
+ createCell: '{{lane}}, press Enter to start a new entry',
7784
+ openEnded: 'open-ended',
7785
+ },
7397
7786
  };
7398
7787
  const fr = {
7399
7788
  actions: {
@@ -7500,6 +7889,12 @@ const fr = {
7500
7889
  },
7501
7890
  weekdays: { 0: 'D', 1: 'L', 2: 'M', 3: 'M', 4: 'J', 5: 'V', 6: 'S' },
7502
7891
  },
7892
+ timelineGrid: {
7893
+ lanes: 'Lignes',
7894
+ empty: 'Rien à afficher',
7895
+ createCell: '{{lane}}, appuyez sur Entrée pour créer une entrée',
7896
+ openEnded: 'sans fin',
7897
+ },
7503
7898
  };
7504
7899
  /** Languages the library ships strings for. */
7505
7900
  const UD_COMPONENTS_TRANSLATIONS = {
@@ -7612,6 +8007,8 @@ var FeatureFlagKey;
7612
8007
  FeatureFlagKey["UNIVERSITY_TIMEZONE"] = "UNIVERSITY_TIMEZONE";
7613
8008
  // The quoted total on the student's stay summary in the student app.
7614
8009
  FeatureFlagKey["SHOW_TOTAL_QUOTE_FOR_STUDENT"] = "SHOW_TOTAL_QUOTE_FOR_STUDENT";
8010
+ // Parking lots, spaces, assignments and the waitlist.
8011
+ FeatureFlagKey["PARKING"] = "PARKING";
7615
8012
  })(FeatureFlagKey || (FeatureFlagKey = {}));
7616
8013
 
7617
8014
  var LoadingStatus;
@@ -7679,5 +8076,5 @@ const generateTimeOptions = (start, end, intervalMinutes = 5) => {
7679
8076
  * Generated bundle index. Do not edit.
7680
8077
  */
7681
8078
 
7682
- export { AppShellComponent, ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, CheckboxComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, GROUP_ROW_HEIGHT, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MoneyInputComponent, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SIDENAV_LOGO, SIDENAV_LOGO_COLLAPSED, SafePipe, SidenavComponent, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdMenuComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, UdTooltipComponent, UdTooltipDirective, activeNavRoute, addDays, assignLanes, barGeometry, buildRows, capitalize, centsToMoney, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMoney, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, groupThousands, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, moneyToCents, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, parseMoney, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
8079
+ export { AppShellComponent, ApplicationStatus, AutocompleteComponent, CalendarComponent, CalendarSlotColor, CapitalizePipe, CarouselComponent, CheckboxComponent, ChipInputComponent, ColumnVisibilityModalComponent, CustomInputComponent, CustomSnackbarComponent, CustomTableComponent, DateInputComponent, DateOperator, DateRangeInputComponent, DynamicComponentComponent, EditViewComponent, EditViewSectionDirective, FeatureFlagKey, FileInputComponent, FilterType, GROUP_ROW_HEIGHT, IconColor, KpiComponent, KpiDataType, KpiPillType, KpiProgressBarType, KpiVariant, LoadingStatus, ModalComponent, ModalInputType, MoneyInputComponent, MultiSelectComponent, MultiSelectMatchMode, NumberOperator, OCCUPANCY_GRID_HEADER_HEIGHT, OccupancyGridComponent, PhoneInputComponent, PillComponent, PillToggleComponent, PluralizePipe, ProgressBarComponent, SIDENAV_LOGO, SIDENAV_LOGO_COLLAPSED, SafePipe, SidenavComponent, SingularPipe, SnackbarType, StringOperator, SummaryViewComponent, TIMELINE_GRID_DEFAULT_LEGEND, TIMELINE_GRID_HEADER_HEIGHT, TableDisplayColumnType, TabsComponent, TelInputComponent, TextInputComponent, TextareaComponent, TimePickerComponent, TimelineGridComponent, ToObservablePipe, ToggleComponent, ToggleOptionComponent, TranslateWrapperService, UD_COMPONENTS_TRANSLATIONS, UdButtonComponent, UdButtonToggleComponent, UdMenuComponent, UdPreviewContainerComponent, UdStepContentDirective, UdStepperComponent, UdTooltipComponent, UdTooltipDirective, activeNavRoute, addDays, assignLanes, barGeometry, buildRows, capitalize, centsToMoney, clampToClosures, closureGeometry, dateAtOffset, dayColumns, dayOfMonth, daysBetween, epochDay, formatLocalDate, formatLocalDateTime, formatLocalDateTimeLongForm, formatLocalTime, formatLocalTimeWithMinutes, formatLocalTimeWithMinutesAmPm, formatMoney, formatMonthYear, formatPhoneNumber, formatStringDate, formatStringDateTime, generateTimeOptions, groupThousands, inListValidator, isIsoDate, laneForSpan, laneNeighborBound, maxIso, minIso, moneyToCents, monthOf, monthSegments, overbooksRoom, overlapsClosure, overlapsRoom, parseLocalDate, parseMoney, pluralize, positionRows, rowHeight, spaceCase, takenOn, totalHeight, udComponentsOnlyTranslateLoader, udComponentsTranslationsFor, updateArray, visibleRange, weekday, weekendOffsetDays, withLoadingState, withUdComponentsTranslations, yearOf };
7683
8080
  //# sourceMappingURL=ud-components.mjs.map