ud-components 0.7.5 → 0.7.7

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.
@@ -11,7 +11,8 @@ export interface SnackbarData {
11
11
  export declare class CustomSnackbarComponent implements OnInit, OnDestroy {
12
12
  data: SnackbarData;
13
13
  private snackBarRef;
14
- progress: number;
14
+ /** A signal so each tick schedules change detection in zoneless apps too. */
15
+ readonly progress: import("@angular/core").WritableSignal<number>;
15
16
  private subscription?;
16
17
  private isPaused;
17
18
  private elapsedTime;
@@ -94,10 +94,9 @@ export declare class MultiSelectComponent implements OnInit, OnChanges, OnDestro
94
94
  /**
95
95
  * Measures once the panel opens, rather than when a row is hovered.
96
96
  *
97
- * Hover is too late by construction: matTooltip reads matTooltipDisabled at
98
- * the instant it receives the mouseenter, so anything computed during that
99
- * same event lands a change-detection tick after the decision it was meant to
100
- * inform. Every option is laid out the moment the panel opens, which is well
97
+ * Hover is too late: the tooltip reads udTooltipDisabled when it shows, and
98
+ * anything computed from a hover event can land a change-detection tick after
99
+ * that decision. Every option is laid out the moment the panel opens, which is well
101
100
  * before any pointer arrives — so measuring there has no race to lose.
102
101
  *
103
102
  * Measured per opening, so a viewport resized while the panel is still open
@@ -173,6 +173,13 @@ export declare class OccupancyGridComponent {
173
173
  roomId: string;
174
174
  date: string;
175
175
  } | null>;
176
+ /**
177
+ * The day column under the pointer anywhere on the canvas (header, lanes,
178
+ * bars), as an index into days(), or null. Drawn as a full-height band in
179
+ * every visible row and a tinted header cell, so together with the row wash
180
+ * the pointer reads as a crosshair: which room, which night.
181
+ */
182
+ protected readonly hoverDay: import("@angular/core").WritableSignal<number | null>;
176
183
  /**
177
184
  * The empty cell the mouse is currently over, if any — the pointer
178
185
  * equivalent of `laneFocus`, so a mouse user gets the same "here's what
@@ -256,6 +263,11 @@ export declare class OccupancyGridComponent {
256
263
  /** True while a whole-bar drag is hovering this room as its drop target. */
257
264
  protected isMoveTarget(roomId: string): boolean;
258
265
  protected closureGeometryOf(closure: OccupancyClosure): BarGeometry | null;
266
+ /**
267
+ * Beds taken on the first day shown, not today (UC-18). The consumer loads
268
+ * only the bars overlapping the window, so today's count was 0 whenever the
269
+ * window did not include today; the first day shown is always loaded.
270
+ */
259
271
  protected takenOn(room: OccupancyRoom): number | null;
260
272
  protected isCollapsed(key: string): boolean;
261
273
  protected toggleGroup(key: string): void;
@@ -340,6 +352,7 @@ export declare class OccupancyGridComponent {
340
352
  * not also outline the empty-cell cursor underneath it.
341
353
  */
342
354
  protected onLaneMouseMove(event: MouseEvent, room: OccupancyRoom, lane?: number): void;
355
+ protected onCanvasMouseMove(event: MouseEvent): void;
343
356
  protected onLaneMouseLeave(room: OccupancyRoom): void;
344
357
  protected onLaneBlur(): void;
345
358
  private defaultCursorDate;
@@ -0,0 +1,17 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /** Which side of its host the tooltip ended up on, after any flip. */
4
+ export type UdTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
5
+ /**
6
+ * The panel `udTooltip` attaches to the overlay. Not meant to be used on its
7
+ * own. Unencapsulated so the `.ud-tooltip-title` / `.ud-tooltip-meta` helper
8
+ * classes reach rich content that comes from the consumer's template.
9
+ */
10
+ export declare class UdTooltipComponent {
11
+ readonly content: import("@angular/core").InputSignal<string | TemplateRef<unknown> | null>;
12
+ readonly tooltipId: import("@angular/core").InputSignal<string>;
13
+ readonly placement: import("@angular/core").InputSignal<UdTooltipPlacement>;
14
+ protected readonly template: import("@angular/core").Signal<TemplateRef<unknown> | null>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<UdTooltipComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<UdTooltipComponent, "ud-tooltip", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "tooltipId": { "alias": "tooltipId"; "required": true; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
17
+ }
@@ -0,0 +1,45 @@
1
+ import { OnDestroy, TemplateRef } from '@angular/core';
2
+ import { UdTooltipPlacement } from './tooltip.component';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * The library's tooltip (UC-19), replacing both native `title` hints and
6
+ * `matTooltip`: `<ud-button udTooltip="Export as CSV">`.
7
+ *
8
+ * Shows on hover, on keyboard focus (focus-visible only, so a mouse click does
9
+ * not leave one hanging) and on a long press; hides on leave, blur, Escape,
10
+ * press, and scroll. Flips to the opposite side when there is no room. While
11
+ * shown, the host's `aria-describedby` names it.
12
+ */
13
+ export declare class UdTooltipDirective implements OnDestroy {
14
+ /** Text, or a template for rich content. Empty shows nothing. */
15
+ readonly udTooltip: import("@angular/core").InputSignal<string | TemplateRef<unknown> | null | undefined>;
16
+ readonly udTooltipPosition: import("@angular/core").InputSignal<UdTooltipPlacement>;
17
+ readonly udTooltipDisabled: import("@angular/core").InputSignal<boolean>;
18
+ readonly udTooltipShowDelay: import("@angular/core").InputSignal<number>;
19
+ private readonly overlay;
20
+ private readonly host;
21
+ private readonly viewContainerRef;
22
+ private readonly document;
23
+ private readonly id;
24
+ private overlayRef;
25
+ private panel;
26
+ private positionSub;
27
+ private showTimer;
28
+ private touchTimer;
29
+ private readonly onEscape;
30
+ constructor();
31
+ protected scheduleShow(): void;
32
+ protected onFocusIn(): void;
33
+ protected onTouchStart(): void;
34
+ protected onTouchEnd(): void;
35
+ show(): void;
36
+ hide(): void;
37
+ ngOnDestroy(): void;
38
+ /** Tear-down for every way a tooltip goes away, including the scroll strategy closing it. */
39
+ private dispose;
40
+ /** Adds or removes this tooltip's id in the host's aria-describedby, keeping any other ids. */
41
+ private describe;
42
+ private clearTimers;
43
+ static ɵfac: i0.ɵɵFactoryDeclaration<UdTooltipDirective, never>;
44
+ static ɵdir: i0.ɵɵDirectiveDeclaration<UdTooltipDirective, "[udTooltip]", never, { "udTooltip": { "alias": "udTooltip"; "required": false; "isSignal": true; }; "udTooltipPosition": { "alias": "udTooltipPosition"; "required": false; "isSignal": true; }; "udTooltipDisabled": { "alias": "udTooltipDisabled"; "required": false; "isSignal": true; }; "udTooltipShowDelay": { "alias": "udTooltipShowDelay"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ud-components",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=19",
6
6
  "@angular/common": ">=19",
package/public-api.d.ts CHANGED
@@ -33,6 +33,8 @@ export * from './lib/form-fields/textarea/textarea.component';
33
33
  export * from './lib/form-fields/phone-input/phone-input.component';
34
34
  export * from './lib/form-fields/chip-input/chip-input.component';
35
35
  export * from './lib/calendar/calendar.component';
36
+ export * from './lib/tooltip/tooltip.component';
37
+ export * from './lib/tooltip/tooltip.directive';
36
38
  export * from './lib/calendar/calendar.interface';
37
39
  export * from './lib/button/button.component';
38
40
  export * from './lib/button-toggle/button-toggle.component';