ud-components 0.5.19 → 0.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ud-components.mjs +177 -71
- package/fesm2022/ud-components.mjs.map +1 -1
- package/lib/calendar/calendar.component.d.ts +20 -4
- package/lib/calendar/calendar.interface.d.ts +27 -0
- package/lib/form-fields/time-picker/time-picker.component.d.ts +9 -1
- package/lib/modal/modal.component.d.ts +4 -0
- package/lib/preview-container/preview-container.component.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
-
import { CalendarMode, CalendarSlot, CalendarView } from './calendar.interface';
|
|
2
|
+
import { CalendarMode, CalendarSlot, CalendarUser, CalendarView } from './calendar.interface';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class CalendarComponent implements OnDestroy {
|
|
5
5
|
slots: import("@angular/core").InputSignal<CalendarSlot[]>;
|
|
@@ -8,6 +8,18 @@ export declare class CalendarComponent implements OnDestroy {
|
|
|
8
8
|
slotDuration: import("@angular/core").InputSignal<number>;
|
|
9
9
|
minHour: import("@angular/core").InputSignal<number>;
|
|
10
10
|
maxHour: import("@angular/core").InputSignal<number>;
|
|
11
|
+
/**
|
|
12
|
+
* Max height of the scrollable week/day grid as any CSS length (e.g. '720px',
|
|
13
|
+
* '80vh', 'none'). Defaults to '580px'. Use 'none' to let the grid grow with
|
|
14
|
+
* its content / the host's height.
|
|
15
|
+
*/
|
|
16
|
+
maxHeight: import("@angular/core").InputSignal<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Optional list of users an admin can book a slot on behalf of. When provided,
|
|
19
|
+
* the "Booked By" field becomes a searchable autocomplete; otherwise it stays a
|
|
20
|
+
* free-text input.
|
|
21
|
+
*/
|
|
22
|
+
bookableUsers: import("@angular/core").InputSignal<CalendarUser[]>;
|
|
11
23
|
slotAdded: import("@angular/core").OutputEmitterRef<CalendarSlot>;
|
|
12
24
|
slotUpdated: import("@angular/core").OutputEmitterRef<CalendarSlot>;
|
|
13
25
|
slotRemoved: import("@angular/core").OutputEmitterRef<string>;
|
|
@@ -20,6 +32,8 @@ export declare class CalendarComponent implements OnDestroy {
|
|
|
20
32
|
}[];
|
|
21
33
|
private readonly CELL_H;
|
|
22
34
|
private readonly TIME_COL_W;
|
|
35
|
+
/** Drag snapping granularity, in minutes. */
|
|
36
|
+
private readonly SNAP_MIN;
|
|
23
37
|
private dialog;
|
|
24
38
|
private elRef;
|
|
25
39
|
private overlay;
|
|
@@ -89,16 +103,18 @@ export declare class CalendarComponent implements OnDestroy {
|
|
|
89
103
|
private getGridTarget;
|
|
90
104
|
openAddModal(day?: Date, hour?: number, minute?: number): void;
|
|
91
105
|
openEditModal(slot: CalendarSlot): void;
|
|
106
|
+
private get slotFormErrors();
|
|
107
|
+
private slotTimeValidator;
|
|
92
108
|
private buildForm;
|
|
93
109
|
private slotForms;
|
|
94
110
|
private buildSlot;
|
|
95
|
-
private
|
|
96
|
-
private
|
|
111
|
+
private combineDateTime;
|
|
112
|
+
private shiftTime;
|
|
97
113
|
private getMonday;
|
|
98
114
|
isSameDay(a: Date, b: Date): boolean;
|
|
99
115
|
private formatHour;
|
|
100
116
|
private formatTime;
|
|
101
117
|
private hexToRgba;
|
|
102
118
|
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarComponent, never>;
|
|
103
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent, "ud-calendar", never, { "slots": { "alias": "slots"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "defaultView": { "alias": "defaultView"; "required": false; "isSignal": true; }; "slotDuration": { "alias": "slotDuration"; "required": false; "isSignal": true; }; "minHour": { "alias": "minHour"; "required": false; "isSignal": true; }; "maxHour": { "alias": "maxHour"; "required": false; "isSignal": true; }; }, { "slotAdded": "slotAdded"; "slotUpdated": "slotUpdated"; "slotRemoved": "slotRemoved"; "slotBooked": "slotBooked"; }, never, never, true, never>;
|
|
119
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CalendarComponent, "ud-calendar", never, { "slots": { "alias": "slots"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "defaultView": { "alias": "defaultView"; "required": false; "isSignal": true; }; "slotDuration": { "alias": "slotDuration"; "required": false; "isSignal": true; }; "minHour": { "alias": "minHour"; "required": false; "isSignal": true; }; "maxHour": { "alias": "maxHour"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "bookableUsers": { "alias": "bookableUsers"; "required": false; "isSignal": true; }; }, { "slotAdded": "slotAdded"; "slotUpdated": "slotUpdated"; "slotRemoved": "slotRemoved"; "slotBooked": "slotBooked"; }, never, never, true, never>;
|
|
104
120
|
}
|
|
@@ -4,8 +4,35 @@ export interface CalendarSlot {
|
|
|
4
4
|
start: Date;
|
|
5
5
|
end: Date;
|
|
6
6
|
booked?: boolean;
|
|
7
|
+
/** Display name of who booked the slot. */
|
|
7
8
|
bookedBy?: string;
|
|
9
|
+
/** Optional id of the booked user when chosen from `bookableUsers`. */
|
|
10
|
+
bookedById?: string;
|
|
8
11
|
color?: string;
|
|
9
12
|
}
|
|
13
|
+
/** A selectable user for the admin "book on behalf of" autocomplete. */
|
|
14
|
+
export interface CalendarUser {
|
|
15
|
+
/** Stable id stored on the slot as `bookedById`. */
|
|
16
|
+
value: string;
|
|
17
|
+
/** Human-readable name shown in the field and on the slot. */
|
|
18
|
+
label: string;
|
|
19
|
+
}
|
|
10
20
|
export type CalendarView = 'week' | 'month' | 'day';
|
|
11
21
|
export type CalendarMode = 'admin' | 'student' | 'readonly';
|
|
22
|
+
/**
|
|
23
|
+
* Curated slot colours. Assign one to `CalendarSlot.color` for a consistent,
|
|
24
|
+
* on-brand palette instead of hand-picking hex values — the calendar tints these
|
|
25
|
+
* automatically for the slot fill, border and text. `Navy` is the default brand
|
|
26
|
+
* tone used for booked appointments.
|
|
27
|
+
*/
|
|
28
|
+
export declare enum CalendarSlotColor {
|
|
29
|
+
Navy = "#1b2535",
|
|
30
|
+
Blue = "#2563eb",
|
|
31
|
+
Teal = "#0d9488",
|
|
32
|
+
Green = "#16a34a",
|
|
33
|
+
Amber = "#d97706",
|
|
34
|
+
Red = "#dc2626",
|
|
35
|
+
Purple = "#7c3aed",
|
|
36
|
+
Pink = "#db2777",
|
|
37
|
+
Slate = "#475569"
|
|
38
|
+
}
|
|
@@ -13,14 +13,22 @@ export declare class TimePickerComponent implements OnInit, OnChanges {
|
|
|
13
13
|
}[] | null;
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
hint: string;
|
|
16
|
+
/** Earliest selectable hour (0–23). Restricts both the dropdown and typed input. */
|
|
17
|
+
minHour?: number;
|
|
18
|
+
/** Latest selectable hour (0–24). Restricts both the dropdown and typed input. */
|
|
19
|
+
maxHour?: number;
|
|
16
20
|
focused: boolean;
|
|
17
21
|
matOptions: MatTimepickerOption<Date>[];
|
|
22
|
+
minTime: Date | null;
|
|
23
|
+
maxTime: Date | null;
|
|
18
24
|
protected controlContainer: ControlContainer;
|
|
19
25
|
get control(): FormControl;
|
|
20
26
|
ngOnInit(): void;
|
|
21
27
|
ngOnChanges(changes: SimpleChanges): void;
|
|
28
|
+
private updateBounds;
|
|
22
29
|
private buildOptions;
|
|
30
|
+
private atHour;
|
|
23
31
|
private formatTime;
|
|
24
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<TimePickerComponent, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent, "ud-time-picker", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "intervalMinutes": { "alias": "intervalMinutes"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; }, {}, never, never, true, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimePickerComponent, "ud-time-picker", never, { "controlName": { "alias": "controlName"; "required": true; }; "label": { "alias": "label"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "intervalMinutes": { "alias": "intervalMinutes"; "required": false; }; "options": { "alias": "options"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "minHour": { "alias": "minHour"; "required": false; }; "maxHour": { "alias": "maxHour"; "required": false; }; }, {}, never, never, true, never>;
|
|
26
34
|
}
|
|
@@ -28,6 +28,10 @@ export declare class ModalComponent {
|
|
|
28
28
|
cancel: EventEmitter<void>;
|
|
29
29
|
protected form?: FormGroup;
|
|
30
30
|
protected modalInputType: typeof ModalInputType;
|
|
31
|
+
protected objectKeys: {
|
|
32
|
+
(o: object): string[];
|
|
33
|
+
(o: {}): string[];
|
|
34
|
+
};
|
|
31
35
|
protected pictureUrls?: string[];
|
|
32
36
|
protected currentPictureIndex?: number;
|
|
33
37
|
data: any;
|
|
@@ -3,6 +3,9 @@ export declare class UdPreviewContainerComponent {
|
|
|
3
3
|
title: string;
|
|
4
4
|
icon?: string;
|
|
5
5
|
padding: string;
|
|
6
|
+
/** Whether the panel starts collapsed. */
|
|
7
|
+
collapsed: boolean;
|
|
8
|
+
toggle(): void;
|
|
6
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<UdPreviewContainerComponent, never>;
|
|
7
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<UdPreviewContainerComponent, "ud-preview-container", never, { "title": { "alias": "title"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UdPreviewContainerComponent, "ud-preview-container", never, { "title": { "alias": "title"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; "collapsed": { "alias": "collapsed"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
11
|
}
|