ud-components 0.5.18 → 0.5.20
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 +437 -185
- package/fesm2022/ud-components.mjs.map +1 -1
- package/lib/calendar/calendar.component.d.ts +44 -5
- 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/package.json +26 -2
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
+
import { CalendarMode, CalendarSlot, CalendarUser, CalendarView } from './calendar.interface';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class CalendarComponent {
|
|
4
|
+
export declare class CalendarComponent implements OnDestroy {
|
|
4
5
|
slots: import("@angular/core").InputSignal<CalendarSlot[]>;
|
|
5
6
|
mode: import("@angular/core").InputSignal<CalendarMode>;
|
|
6
7
|
defaultView: import("@angular/core").InputSignal<CalendarView>;
|
|
7
8
|
slotDuration: import("@angular/core").InputSignal<number>;
|
|
8
9
|
minHour: import("@angular/core").InputSignal<number>;
|
|
9
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[]>;
|
|
10
23
|
slotAdded: import("@angular/core").OutputEmitterRef<CalendarSlot>;
|
|
11
24
|
slotUpdated: import("@angular/core").OutputEmitterRef<CalendarSlot>;
|
|
12
25
|
slotRemoved: import("@angular/core").OutputEmitterRef<string>;
|
|
@@ -19,8 +32,12 @@ export declare class CalendarComponent {
|
|
|
19
32
|
}[];
|
|
20
33
|
private readonly CELL_H;
|
|
21
34
|
private readonly TIME_COL_W;
|
|
35
|
+
/** Drag snapping granularity, in minutes. */
|
|
36
|
+
private readonly SNAP_MIN;
|
|
22
37
|
private dialog;
|
|
23
38
|
private elRef;
|
|
39
|
+
private overlay;
|
|
40
|
+
private vcr;
|
|
24
41
|
draggingSlot: CalendarSlot | null;
|
|
25
42
|
dragMoved: boolean;
|
|
26
43
|
dragTarget: {
|
|
@@ -30,7 +47,12 @@ export declare class CalendarComponent {
|
|
|
30
47
|
} | null;
|
|
31
48
|
private dragSlotDurationMin;
|
|
32
49
|
private dragStartPos;
|
|
50
|
+
hoverCardTpl: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
51
|
+
hoverSlot: import("@angular/core").WritableSignal<CalendarSlot | null>;
|
|
52
|
+
private hoverRef;
|
|
53
|
+
private hoverCloseTimer;
|
|
33
54
|
constructor();
|
|
55
|
+
ngOnDestroy(): void;
|
|
34
56
|
timeSlots: import("@angular/core").Signal<{
|
|
35
57
|
hour: number;
|
|
36
58
|
minute: number;
|
|
@@ -44,6 +66,21 @@ export declare class CalendarComponent {
|
|
|
44
66
|
switchView(view: CalendarView): void;
|
|
45
67
|
clickDay(day: Date): void;
|
|
46
68
|
slotsForDay(day: Date): CalendarSlot[];
|
|
69
|
+
private readonly COL_GAP_PCT;
|
|
70
|
+
slotLayout: import("@angular/core").Signal<Map<string, {
|
|
71
|
+
leftPct: number;
|
|
72
|
+
widthPct: number;
|
|
73
|
+
}>>;
|
|
74
|
+
private layoutCluster;
|
|
75
|
+
slotLeft(slot: CalendarSlot): number;
|
|
76
|
+
slotWidth(slot: CalendarSlot): number;
|
|
77
|
+
slotDensity(slot: CalendarSlot): 'comfortable' | 'cozy' | 'compact';
|
|
78
|
+
slotDurationLabel(slot: CalendarSlot): string;
|
|
79
|
+
slotInitials(name: string): string;
|
|
80
|
+
openHoverCard(slot: CalendarSlot, anchor: EventTarget | null): void;
|
|
81
|
+
closeHoverCard(): void;
|
|
82
|
+
cancelHoverClose(): void;
|
|
83
|
+
private disposeHoverCard;
|
|
47
84
|
slotTop(slot: CalendarSlot): number;
|
|
48
85
|
slotHeight(slot: CalendarSlot): number;
|
|
49
86
|
slotBg(slot: CalendarSlot): string;
|
|
@@ -66,16 +103,18 @@ export declare class CalendarComponent {
|
|
|
66
103
|
private getGridTarget;
|
|
67
104
|
openAddModal(day?: Date, hour?: number, minute?: number): void;
|
|
68
105
|
openEditModal(slot: CalendarSlot): void;
|
|
106
|
+
private get slotFormErrors();
|
|
107
|
+
private slotTimeValidator;
|
|
69
108
|
private buildForm;
|
|
70
109
|
private slotForms;
|
|
71
110
|
private buildSlot;
|
|
72
|
-
private
|
|
73
|
-
private
|
|
111
|
+
private combineDateTime;
|
|
112
|
+
private shiftTime;
|
|
74
113
|
private getMonday;
|
|
75
114
|
isSameDay(a: Date, b: Date): boolean;
|
|
76
115
|
private formatHour;
|
|
77
116
|
private formatTime;
|
|
78
117
|
private hexToRgba;
|
|
79
118
|
static ɵfac: i0.ɵɵFactoryDeclaration<CalendarComponent, never>;
|
|
80
|
-
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>;
|
|
81
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ud-components",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.20",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/cdk": ">=19",
|
|
6
6
|
"@angular/common": ">=19",
|
|
@@ -21,6 +21,30 @@
|
|
|
21
21
|
".": {
|
|
22
22
|
"types": "./index.d.ts",
|
|
23
23
|
"default": "./fesm2022/ud-components.mjs"
|
|
24
|
+
},
|
|
25
|
+
"./enums/role.enum": {
|
|
26
|
+
"types": "./enums/role.enum.d.ts",
|
|
27
|
+
"default": "./enums/role.enum.js"
|
|
28
|
+
},
|
|
29
|
+
"./lib/kpi/kpi.enum": {
|
|
30
|
+
"types": "./lib/kpi/kpi.enum.d.ts",
|
|
31
|
+
"default": "./lib/kpi/kpi.enum.js"
|
|
32
|
+
},
|
|
33
|
+
"./lib/edit-view/edit-view-section.directive": {
|
|
34
|
+
"types": "./lib/edit-view/edit-view-section.directive.d.ts",
|
|
35
|
+
"default": "./lib/edit-view/edit-view-section.directive.js"
|
|
36
|
+
},
|
|
37
|
+
"./interfaces/page-request.interface": {
|
|
38
|
+
"types": "./interfaces/page-request.interface.d.ts",
|
|
39
|
+
"default": "./interfaces/page-request.interface.js"
|
|
40
|
+
},
|
|
41
|
+
"./interfaces/table.interface": {
|
|
42
|
+
"types": "./interfaces/table.interface.d.ts",
|
|
43
|
+
"default": "./interfaces/table.interface.js"
|
|
44
|
+
},
|
|
45
|
+
"./interfaces/table-display-column.interface": {
|
|
46
|
+
"types": "./interfaces/table-display-column.interface.d.ts",
|
|
47
|
+
"default": "./interfaces/table-display-column.interface.js"
|
|
24
48
|
}
|
|
25
49
|
}
|
|
26
|
-
}
|
|
50
|
+
}
|