@vadem/ui 0.0.3 → 0.2.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.
- package/fesm2022/vadem-ui-chart.mjs +25 -25
- package/fesm2022/vadem-ui-chart.mjs.map +1 -1
- package/fesm2022/vadem-ui-field.mjs +7 -3
- package/fesm2022/vadem-ui-field.mjs.map +1 -1
- package/fesm2022/vadem-ui-kanban.mjs +1021 -0
- package/fesm2022/vadem-ui-kanban.mjs.map +1 -0
- package/fesm2022/vadem-ui-locale.mjs +78 -0
- package/fesm2022/vadem-ui-locale.mjs.map +1 -1
- package/fesm2022/vadem-ui-schedule.mjs +1836 -0
- package/fesm2022/vadem-ui-schedule.mjs.map +1 -0
- package/fesm2022/vadem-ui.mjs +1 -1
- package/fesm2022/vadem-ui.mjs.map +1 -1
- package/package.json +9 -1
- package/styles/components/index.css +2 -0
- package/styles/components/kanban.css +220 -0
- package/styles/components/schedule.css +604 -0
- package/styles/components/slider.css +6 -0
- package/types/vadem-ui-chart.d.ts +9 -9
- package/types/vadem-ui-field.d.ts +3 -0
- package/types/vadem-ui-kanban.d.ts +222 -0
- package/types/vadem-ui-locale.d.ts +31 -0
- package/types/vadem-ui-schedule.d.ts +402 -0
- package/types/vadem-ui.d.ts +1 -1
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { TemplateRef } from "@angular/core";
|
|
3
|
+
/** Framework-agnostic board logic: validation, drop targets and immutable moves. */
|
|
4
|
+
interface VdKanbanCardData {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
/** Plain text used in announcements and the move menu's accessible name. */
|
|
7
|
+
readonly label: string;
|
|
8
|
+
}
|
|
9
|
+
interface VdKanbanColumn<T extends VdKanbanCardData = VdKanbanCardData> {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly cards: readonly T[];
|
|
13
|
+
}
|
|
14
|
+
/** A requested move. `toIndex` is the card's index in the target column after the move. */
|
|
15
|
+
interface VdKanbanMove {
|
|
16
|
+
readonly cardId: string;
|
|
17
|
+
readonly fromColumnId: string;
|
|
18
|
+
readonly toColumnId: string;
|
|
19
|
+
readonly fromIndex: number;
|
|
20
|
+
readonly toIndex: number;
|
|
21
|
+
readonly method: 'menu' | 'pointer';
|
|
22
|
+
}
|
|
23
|
+
interface VdKanbanPosition {
|
|
24
|
+
readonly columnId: string;
|
|
25
|
+
readonly index: number;
|
|
26
|
+
}
|
|
27
|
+
/** Column and card IDs must be non-empty and unique across the whole board. */
|
|
28
|
+
declare function vdKanbanValid(columns: readonly VdKanbanColumn[]): boolean;
|
|
29
|
+
declare function vdKanbanFind(columns: readonly VdKanbanColumn[], cardId: string): VdKanbanPosition | null;
|
|
30
|
+
/**
|
|
31
|
+
* Builds a move request, or null when it changes nothing or is out of range.
|
|
32
|
+
* `toIndex` is clamped to the target column (after removing the card from its source).
|
|
33
|
+
*/
|
|
34
|
+
declare function vdKanbanMoveRequest(columns: readonly VdKanbanColumn[], cardId: string, to: VdKanbanPosition, method: VdKanbanMove['method']): VdKanbanMove | null;
|
|
35
|
+
/**
|
|
36
|
+
* Applies a move immutably: untouched columns keep their identity. Returns the same array when
|
|
37
|
+
* the move no longer matches the board (stale request), so callers can detect a no-op.
|
|
38
|
+
*/
|
|
39
|
+
export declare function vdKanbanApplyMove<T extends VdKanbanCardData, C extends VdKanbanColumn<T>>(columns: readonly C[], move: Pick<VdKanbanMove, 'cardId' | 'toColumnId' | 'toIndex'>): readonly C[];
|
|
40
|
+
/**
|
|
41
|
+
* Insertion index for a pointer at `y` among the other cards of a column (the dragged card's own
|
|
42
|
+
* rectangle excluded): the number of cards whose vertical middle lies above the pointer.
|
|
43
|
+
*/
|
|
44
|
+
declare function vdKanbanInsertIndex(y: number, cards: readonly {
|
|
45
|
+
top: number;
|
|
46
|
+
bottom: number;
|
|
47
|
+
}[]): number;
|
|
48
|
+
/** The column under a horizontal pointer position, or -1 outside every column. */
|
|
49
|
+
declare function vdKanbanColumnAt(x: number, columns: readonly {
|
|
50
|
+
left: number;
|
|
51
|
+
right: number;
|
|
52
|
+
}[]): number;
|
|
53
|
+
/** Template context for `ng-template[vdKanbanCard]` and `ng-template[vdKanbanColumnHeader]`. */
|
|
54
|
+
interface VdKanbanCardContext<T extends VdKanbanCardData = VdKanbanCardData> {
|
|
55
|
+
$implicit: T;
|
|
56
|
+
column: VdKanbanColumn<T>;
|
|
57
|
+
index: number;
|
|
58
|
+
}
|
|
59
|
+
interface VdKanbanColumnContext<T extends VdKanbanCardData = VdKanbanCardData> {
|
|
60
|
+
$implicit: VdKanbanColumn<T>;
|
|
61
|
+
}
|
|
62
|
+
/** Card content. Without it, a card shows its `label`. */
|
|
63
|
+
export declare class VdKanbanCard {
|
|
64
|
+
readonly template: TemplateRef<VdKanbanCardContext<VdKanbanCardData>>;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VdKanbanCard, never>;
|
|
66
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VdKanbanCard, "ng-template[vdKanbanCard]", never, {}, {}, never, never, true, never>;
|
|
67
|
+
}
|
|
68
|
+
/** Extra column header content after the title and count (for example a total). */
|
|
69
|
+
export declare class VdKanbanColumnHeader {
|
|
70
|
+
readonly template: TemplateRef<VdKanbanColumnContext<VdKanbanCardData>>;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VdKanbanColumnHeader, never>;
|
|
72
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VdKanbanColumnHeader, "ng-template[vdKanbanColumnHeader]", never, {}, {}, never, never, true, never>;
|
|
73
|
+
}
|
|
74
|
+
interface Drop {
|
|
75
|
+
columnId: string;
|
|
76
|
+
index: number;
|
|
77
|
+
cardId: string | null;
|
|
78
|
+
edge: 'before' | 'after' | null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A board of columns and cards. The application owns the data: the board never changes
|
|
82
|
+
* `columns` itself, it emits `cardMove` requests (from the Move menu or a pointer drag) and the
|
|
83
|
+
* application applies them (for example with `vdKanbanApplyMove`). Spec: specs/kanban.md
|
|
84
|
+
*/
|
|
85
|
+
export declare class VdKanban<T extends VdKanbanCardData = VdKanbanCardData> {
|
|
86
|
+
readonly columns: import("@angular/core").InputSignal<readonly VdKanbanColumn<T>[]>;
|
|
87
|
+
/** Disables every move (menus and dragging). Card content stays interactive. */
|
|
88
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
89
|
+
readonly label: import("@angular/core").InputSignal<string | undefined>;
|
|
90
|
+
readonly instructions: import("@angular/core").InputSignal<string | undefined>;
|
|
91
|
+
readonly emptyText: import("@angular/core").InputSignal<string | undefined>;
|
|
92
|
+
readonly invalidText: import("@angular/core").InputSignal<string | undefined>;
|
|
93
|
+
readonly countText: import("@angular/core").InputSignal<((count: number) => string) | undefined>;
|
|
94
|
+
readonly moveLabel: import("@angular/core").InputSignal<((card: string) => string) | undefined>;
|
|
95
|
+
readonly upText: import("@angular/core").InputSignal<string | undefined>;
|
|
96
|
+
readonly downText: import("@angular/core").InputSignal<string | undefined>;
|
|
97
|
+
readonly moveToText: import("@angular/core").InputSignal<string | undefined>;
|
|
98
|
+
readonly movedText: import("@angular/core").InputSignal<((card: string, column: string, position: number, total: number) => string) | undefined>;
|
|
99
|
+
readonly canceledText: import("@angular/core").InputSignal<((card: string) => string) | undefined>;
|
|
100
|
+
/** A move request. Apply it to `columns` to make it happen; ignore it to reject it. */
|
|
101
|
+
readonly cardMove: import("@angular/core").OutputEmitterRef<VdKanbanMove>;
|
|
102
|
+
protected readonly t: import("@angular/core").Signal<Pick<{
|
|
103
|
+
label: string;
|
|
104
|
+
instructions: string;
|
|
105
|
+
emptyText: string;
|
|
106
|
+
invalidText: string;
|
|
107
|
+
countText: (count: number) => string;
|
|
108
|
+
moveLabel: (card: string) => string;
|
|
109
|
+
upText: string;
|
|
110
|
+
downText: string;
|
|
111
|
+
moveToText: string;
|
|
112
|
+
movedText: (card: string, column: string, position: number, total: number) => string;
|
|
113
|
+
canceledText: (card: string) => string;
|
|
114
|
+
}, "label" | "instructions" | "emptyText" | "invalidText" | "countText" | "moveLabel" | "upText" | "downText" | "moveToText" | "movedText" | "canceledText">>;
|
|
115
|
+
protected readonly cardTemplate: import("@angular/core").Signal<VdKanbanCard | undefined>;
|
|
116
|
+
protected readonly columnHeader: import("@angular/core").Signal<VdKanbanColumnHeader | undefined>;
|
|
117
|
+
protected readonly valid: import("@angular/core").Signal<boolean>;
|
|
118
|
+
protected readonly baseId: string;
|
|
119
|
+
protected readonly instructionsId: string;
|
|
120
|
+
protected readonly draggingId: import("@angular/core").WritableSignal<string | null>;
|
|
121
|
+
protected readonly drop: import("@angular/core").WritableSignal<Drop | null>;
|
|
122
|
+
protected readonly messages: import("@angular/core").WritableSignal<readonly {
|
|
123
|
+
serial: number;
|
|
124
|
+
text: string;
|
|
125
|
+
}[]>;
|
|
126
|
+
private readonly host;
|
|
127
|
+
private drag;
|
|
128
|
+
/** Card whose Move button should get focus once the moved card renders in its new place. */
|
|
129
|
+
private pendingFocus;
|
|
130
|
+
/** The click that follows a finished drag must not follow a link or activate content. */
|
|
131
|
+
private suppressClick;
|
|
132
|
+
private serial;
|
|
133
|
+
constructor();
|
|
134
|
+
protected moveTo(cardId: string, columnId: string, index: number): void;
|
|
135
|
+
private request;
|
|
136
|
+
protected start(event: PointerEvent, card: T): void;
|
|
137
|
+
protected pointerMove(event: PointerEvent): void;
|
|
138
|
+
protected end(event: PointerEvent): void;
|
|
139
|
+
protected pointerCancel(event: PointerEvent): void;
|
|
140
|
+
protected key(event: KeyboardEvent): void;
|
|
141
|
+
/** Lifts the card: a floating copy follows the pointer, the card itself becomes a slot. */
|
|
142
|
+
private activate;
|
|
143
|
+
/** Moves the floating copy, updates the drop marker and edge auto-scroll. */
|
|
144
|
+
private track;
|
|
145
|
+
/** Column and insertion index under the pointer, with the card that shows the marker. */
|
|
146
|
+
private target;
|
|
147
|
+
private finish;
|
|
148
|
+
private announce;
|
|
149
|
+
private cardElement;
|
|
150
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VdKanban<any>, never>;
|
|
151
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VdKanban<any>, "vd-kanban", never, {
|
|
152
|
+
"columns": {
|
|
153
|
+
"alias": "columns";
|
|
154
|
+
"required": false;
|
|
155
|
+
"isSignal": true;
|
|
156
|
+
};
|
|
157
|
+
"disabled": {
|
|
158
|
+
"alias": "disabled";
|
|
159
|
+
"required": false;
|
|
160
|
+
"isSignal": true;
|
|
161
|
+
};
|
|
162
|
+
"label": {
|
|
163
|
+
"alias": "label";
|
|
164
|
+
"required": false;
|
|
165
|
+
"isSignal": true;
|
|
166
|
+
};
|
|
167
|
+
"instructions": {
|
|
168
|
+
"alias": "instructions";
|
|
169
|
+
"required": false;
|
|
170
|
+
"isSignal": true;
|
|
171
|
+
};
|
|
172
|
+
"emptyText": {
|
|
173
|
+
"alias": "emptyText";
|
|
174
|
+
"required": false;
|
|
175
|
+
"isSignal": true;
|
|
176
|
+
};
|
|
177
|
+
"invalidText": {
|
|
178
|
+
"alias": "invalidText";
|
|
179
|
+
"required": false;
|
|
180
|
+
"isSignal": true;
|
|
181
|
+
};
|
|
182
|
+
"countText": {
|
|
183
|
+
"alias": "countText";
|
|
184
|
+
"required": false;
|
|
185
|
+
"isSignal": true;
|
|
186
|
+
};
|
|
187
|
+
"moveLabel": {
|
|
188
|
+
"alias": "moveLabel";
|
|
189
|
+
"required": false;
|
|
190
|
+
"isSignal": true;
|
|
191
|
+
};
|
|
192
|
+
"upText": {
|
|
193
|
+
"alias": "upText";
|
|
194
|
+
"required": false;
|
|
195
|
+
"isSignal": true;
|
|
196
|
+
};
|
|
197
|
+
"downText": {
|
|
198
|
+
"alias": "downText";
|
|
199
|
+
"required": false;
|
|
200
|
+
"isSignal": true;
|
|
201
|
+
};
|
|
202
|
+
"moveToText": {
|
|
203
|
+
"alias": "moveToText";
|
|
204
|
+
"required": false;
|
|
205
|
+
"isSignal": true;
|
|
206
|
+
};
|
|
207
|
+
"movedText": {
|
|
208
|
+
"alias": "movedText";
|
|
209
|
+
"required": false;
|
|
210
|
+
"isSignal": true;
|
|
211
|
+
};
|
|
212
|
+
"canceledText": {
|
|
213
|
+
"alias": "canceledText";
|
|
214
|
+
"required": false;
|
|
215
|
+
"isSignal": true;
|
|
216
|
+
};
|
|
217
|
+
}, {
|
|
218
|
+
"cardMove": "cardMove";
|
|
219
|
+
}, ["cardTemplate", "columnHeader"], never, true, never>;
|
|
220
|
+
}
|
|
221
|
+
export declare const VD_KANBAN: readonly [typeof VdKanban, typeof VdKanbanCard, typeof VdKanbanColumnHeader];
|
|
222
|
+
export type { VdKanbanCardContext, VdKanbanCardData, VdKanbanColumn, VdKanbanColumnContext, VdKanbanMove, VdKanbanPosition };
|
|
@@ -121,6 +121,19 @@ interface VdLocale {
|
|
|
121
121
|
title: string;
|
|
122
122
|
description: string;
|
|
123
123
|
};
|
|
124
|
+
kanban: {
|
|
125
|
+
label: string;
|
|
126
|
+
instructions: string;
|
|
127
|
+
emptyText: string;
|
|
128
|
+
invalidText: string;
|
|
129
|
+
countText: (count: number) => string;
|
|
130
|
+
moveLabel: (card: string) => string;
|
|
131
|
+
upText: string;
|
|
132
|
+
downText: string;
|
|
133
|
+
moveToText: string;
|
|
134
|
+
movedText: (card: string, column: string, position: number, total: number) => string;
|
|
135
|
+
canceledText: (card: string) => string;
|
|
136
|
+
};
|
|
124
137
|
kbd: {
|
|
125
138
|
thenLabel: string;
|
|
126
139
|
};
|
|
@@ -164,6 +177,24 @@ interface VdLocale {
|
|
|
164
177
|
movedText: (label: string, position: number, total: number) => string;
|
|
165
178
|
canceledText: (label: string) => string;
|
|
166
179
|
};
|
|
180
|
+
schedule: {
|
|
181
|
+
label: string;
|
|
182
|
+
todayText: string;
|
|
183
|
+
previousLabel: string;
|
|
184
|
+
nextLabel: string;
|
|
185
|
+
viewLabel: string;
|
|
186
|
+
monthText: string;
|
|
187
|
+
weekText: string;
|
|
188
|
+
dayText: string;
|
|
189
|
+
agendaText: string;
|
|
190
|
+
allDayText: string;
|
|
191
|
+
emptyText: string;
|
|
192
|
+
invalidText: string;
|
|
193
|
+
moreText: (count: number) => string;
|
|
194
|
+
eventsText: (count: number) => string;
|
|
195
|
+
changedText: (title: string, when: string) => string;
|
|
196
|
+
canceledText: (title: string) => string;
|
|
197
|
+
};
|
|
167
198
|
searchInput: {
|
|
168
199
|
clearLabel: string;
|
|
169
200
|
loadingLabel: string;
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Framework-agnostic schedule logic. Times are local wall-clock strings without a time zone
|
|
4
|
+
* ("2026-10-21T14:30"): the application converts from its storage zone. All arithmetic runs on
|
|
5
|
+
* minutes counted as if UTC, so a day always has 1440 minutes and nothing shifts around DST.
|
|
6
|
+
*/
|
|
7
|
+
/** "YYYY-MM-DD" calendar date. */
|
|
8
|
+
type VdIsoDate = string;
|
|
9
|
+
type VdScheduleView = 'month' | 'week' | 'day' | 'agenda';
|
|
10
|
+
type VdScheduleColor = 'accent' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
11
|
+
interface VdScheduleEvent {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly title: string;
|
|
14
|
+
/** Timed: "YYYY-MM-DDTHH:mm". All-day: "YYYY-MM-DD". */
|
|
15
|
+
readonly start: string;
|
|
16
|
+
/** Timed: exclusive end "YYYY-MM-DDTHH:mm". All-day: last day, inclusive, "YYYY-MM-DD". */
|
|
17
|
+
readonly end: string;
|
|
18
|
+
readonly allDay?: boolean;
|
|
19
|
+
readonly color?: VdScheduleColor;
|
|
20
|
+
}
|
|
21
|
+
/** A requested change of an event's time (from dragging or resizing). Same formats as the event. */
|
|
22
|
+
interface VdScheduleEventChange {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly start: string;
|
|
25
|
+
readonly end: string;
|
|
26
|
+
readonly allDay: boolean;
|
|
27
|
+
readonly kind: 'move' | 'resize';
|
|
28
|
+
}
|
|
29
|
+
/** A normalized event: minutes since the epoch (wall clock), exclusive end. */
|
|
30
|
+
interface VdScheduleItem<E extends VdScheduleEvent = VdScheduleEvent> {
|
|
31
|
+
readonly event: E;
|
|
32
|
+
readonly allDay: boolean;
|
|
33
|
+
readonly startMin: number;
|
|
34
|
+
readonly endMin: number;
|
|
35
|
+
/** First and last day the event touches (inclusive). */
|
|
36
|
+
readonly startDate: VdIsoDate;
|
|
37
|
+
readonly endDate: VdIsoDate;
|
|
38
|
+
}
|
|
39
|
+
declare const VD_DAY_MINUTES = 1440;
|
|
40
|
+
/** Minutes since the epoch for "YYYY-MM-DD" (midnight) or "YYYY-MM-DDTHH:mm"; null if invalid. */
|
|
41
|
+
declare function vdScheduleMinutes(value: string): number | null;
|
|
42
|
+
declare function vdScheduleDateTime(minutes: number): string;
|
|
43
|
+
declare function vdScheduleDate(minutes: number): VdIsoDate;
|
|
44
|
+
/** Minutes since midnight of the day that contains `minutes`. */
|
|
45
|
+
declare function vdScheduleTimeOfDay(minutes: number): number;
|
|
46
|
+
declare function vdScheduleNormalize<E extends VdScheduleEvent>(event: E): VdScheduleItem<E> | null;
|
|
47
|
+
/** IDs unique and non-empty; every event parses and ends after it starts. */
|
|
48
|
+
declare function vdScheduleValid(events: readonly VdScheduleEvent[]): boolean;
|
|
49
|
+
/** Normalized events sorted by start, all-day first, then longer first. */
|
|
50
|
+
declare function vdScheduleItems<E extends VdScheduleEvent>(events: readonly E[]): VdScheduleItem<E>[];
|
|
51
|
+
/** Items touching `date`. */
|
|
52
|
+
declare function vdScheduleOnDay<E extends VdScheduleEvent>(items: readonly VdScheduleItem<E>[], date: VdIsoDate): VdScheduleItem<E>[];
|
|
53
|
+
/** The dates a view shows for an anchor date. Month: 6 full weeks. */
|
|
54
|
+
declare function vdScheduleDays(view: VdScheduleView, date: VdIsoDate, firstDay: number, agendaDays?: number): VdIsoDate[];
|
|
55
|
+
/** The anchor date one period earlier or later. */
|
|
56
|
+
declare function vdScheduleStep(view: VdScheduleView, date: VdIsoDate, direction: 1 | -1, agendaDays?: number): VdIsoDate;
|
|
57
|
+
interface VdSchedulePlacement<E extends VdScheduleEvent = VdScheduleEvent> {
|
|
58
|
+
readonly item: VdScheduleItem<E>;
|
|
59
|
+
/** Minutes from the visible range start, clipped to the range. */
|
|
60
|
+
readonly top: number;
|
|
61
|
+
readonly bottom: number;
|
|
62
|
+
readonly column: number;
|
|
63
|
+
readonly columns: number;
|
|
64
|
+
/** The event continues before/after the visible part of this day. */
|
|
65
|
+
readonly clippedStart: boolean;
|
|
66
|
+
readonly clippedEnd: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Lays out the timed events of one day between `fromMinute` and `toMinute` (minutes after
|
|
70
|
+
* midnight). Overlapping events share the width: each cluster of transitively overlapping events
|
|
71
|
+
* gets the smallest number of columns and every event takes the first free column.
|
|
72
|
+
*/
|
|
73
|
+
declare function vdScheduleLayout<E extends VdScheduleEvent>(items: readonly VdScheduleItem<E>[], date: VdIsoDate, fromMinute?: number, toMinute?: number): VdSchedulePlacement<E>[];
|
|
74
|
+
declare function vdScheduleSnap(minutes: number, step: number): number;
|
|
75
|
+
/** Moves an event by whole days (all-day) or minutes (timed), keeping its duration. */
|
|
76
|
+
declare function vdScheduleMove(item: VdScheduleItem, deltaMinutes: number): VdScheduleEventChange;
|
|
77
|
+
/** Sets a timed event's end, keeping at least `minimum` minutes of duration. */
|
|
78
|
+
declare function vdScheduleResize(item: VdScheduleItem, endMin: number, minimum: number): VdScheduleEventChange;
|
|
79
|
+
/** Applies a change immutably; returns the same array when the event is not found. */
|
|
80
|
+
export declare function vdScheduleApplyChange<E extends VdScheduleEvent>(events: readonly E[], change: VdScheduleEventChange): readonly E[];
|
|
81
|
+
/** A click on empty space: a day (month) or a day and snapped time (week/day). */
|
|
82
|
+
interface VdScheduleSlot {
|
|
83
|
+
readonly date: VdIsoDate;
|
|
84
|
+
/** "HH:mm", or null for a whole day. */
|
|
85
|
+
readonly time: string | null;
|
|
86
|
+
}
|
|
87
|
+
interface Preview {
|
|
88
|
+
change: VdScheduleEventChange;
|
|
89
|
+
item: VdScheduleItem;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Month, week, day and agenda views of application-owned events. The schedule never edits
|
|
93
|
+
* `events`: dragging or resizing emits `eventChange` requests that the application applies
|
|
94
|
+
* (for example with `vdScheduleApplyChange`). Spec: specs/schedule.md
|
|
95
|
+
*/
|
|
96
|
+
export declare class VdSchedule<E extends VdScheduleEvent = VdScheduleEvent> {
|
|
97
|
+
readonly events: import("@angular/core").InputSignal<readonly E[]>;
|
|
98
|
+
readonly view: import("@angular/core").ModelSignal<VdScheduleView>;
|
|
99
|
+
/** Any date inside the shown period ("YYYY-MM-DD"). Defaults to today. */
|
|
100
|
+
readonly date: import("@angular/core").ModelSignal<string>;
|
|
101
|
+
readonly views: import("@angular/core").InputSignal<readonly VdScheduleView[]>;
|
|
102
|
+
/** BCP 47 locale for names, week start, dates and times. Defaults to the app's LOCALE_ID. */
|
|
103
|
+
readonly locale: import("@angular/core").InputSignal<string>;
|
|
104
|
+
/** 0 = Sunday ... 6 = Saturday. Defaults to the locale's week start. */
|
|
105
|
+
readonly firstDayOfWeek: import("@angular/core").InputSignal<number | undefined>;
|
|
106
|
+
/** Visible hours in week/day views. */
|
|
107
|
+
readonly dayStartHour: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
108
|
+
readonly dayEndHour: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
109
|
+
/** Hour scrolled into view when a week/day view appears. */
|
|
110
|
+
readonly scrollToHour: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
111
|
+
/** Snapping step for dragging, resizing and empty-slot clicks, in minutes. */
|
|
112
|
+
readonly slotMinutes: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
113
|
+
readonly maxEventsPerDay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
114
|
+
readonly agendaDays: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
115
|
+
/** Current local time "YYYY-MM-DDTHH:mm" for the now line; omit to hide it. */
|
|
116
|
+
readonly now: import("@angular/core").InputSignal<string | null>;
|
|
117
|
+
/** Allows dragging and resizing (pointer). Activation and slot clicks always work. */
|
|
118
|
+
readonly editable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
119
|
+
readonly label: import("@angular/core").InputSignal<string | undefined>;
|
|
120
|
+
readonly todayText: import("@angular/core").InputSignal<string | undefined>;
|
|
121
|
+
readonly previousLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
122
|
+
readonly nextLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
123
|
+
readonly viewLabel: import("@angular/core").InputSignal<string | undefined>;
|
|
124
|
+
readonly monthText: import("@angular/core").InputSignal<string | undefined>;
|
|
125
|
+
readonly weekText: import("@angular/core").InputSignal<string | undefined>;
|
|
126
|
+
readonly dayText: import("@angular/core").InputSignal<string | undefined>;
|
|
127
|
+
readonly agendaText: import("@angular/core").InputSignal<string | undefined>;
|
|
128
|
+
readonly allDayText: import("@angular/core").InputSignal<string | undefined>;
|
|
129
|
+
readonly emptyText: import("@angular/core").InputSignal<string | undefined>;
|
|
130
|
+
readonly invalidText: import("@angular/core").InputSignal<string | undefined>;
|
|
131
|
+
readonly moreText: import("@angular/core").InputSignal<((count: number) => string) | undefined>;
|
|
132
|
+
readonly eventsText: import("@angular/core").InputSignal<((count: number) => string) | undefined>;
|
|
133
|
+
readonly changedText: import("@angular/core").InputSignal<((title: string, when: string) => string) | undefined>;
|
|
134
|
+
readonly canceledText: import("@angular/core").InputSignal<((title: string) => string) | undefined>;
|
|
135
|
+
/** An event was clicked or activated with the keyboard (open it, edit it...). */
|
|
136
|
+
readonly eventActivate: import("@angular/core").OutputEmitterRef<E>;
|
|
137
|
+
/** Empty space was clicked (create an event there). */
|
|
138
|
+
readonly slotActivate: import("@angular/core").OutputEmitterRef<VdScheduleSlot>;
|
|
139
|
+
/** A drag or resize asks to change an event's time. Apply it to `events` or ignore it. */
|
|
140
|
+
readonly eventChange: import("@angular/core").OutputEmitterRef<VdScheduleEventChange>;
|
|
141
|
+
protected readonly t: import("@angular/core").Signal<Pick<{
|
|
142
|
+
label: string;
|
|
143
|
+
todayText: string;
|
|
144
|
+
previousLabel: string;
|
|
145
|
+
nextLabel: string;
|
|
146
|
+
viewLabel: string;
|
|
147
|
+
monthText: string;
|
|
148
|
+
weekText: string;
|
|
149
|
+
dayText: string;
|
|
150
|
+
agendaText: string;
|
|
151
|
+
allDayText: string;
|
|
152
|
+
emptyText: string;
|
|
153
|
+
invalidText: string;
|
|
154
|
+
moreText: (count: number) => string;
|
|
155
|
+
eventsText: (count: number) => string;
|
|
156
|
+
changedText: (title: string, when: string) => string;
|
|
157
|
+
canceledText: (title: string) => string;
|
|
158
|
+
}, "label" | "todayText" | "previousLabel" | "nextLabel" | "viewLabel" | "monthText" | "weekText" | "dayText" | "agendaText" | "allDayText" | "emptyText" | "invalidText" | "moreText" | "eventsText" | "changedText" | "canceledText">>;
|
|
159
|
+
protected readonly baseId: string;
|
|
160
|
+
protected readonly today: import("@angular/core").Signal<string>;
|
|
161
|
+
protected readonly valid: import("@angular/core").Signal<boolean>;
|
|
162
|
+
protected readonly items: import("@angular/core").Signal<VdScheduleItem<E>[]>;
|
|
163
|
+
protected readonly firstDay: import("@angular/core").Signal<number>;
|
|
164
|
+
protected readonly days: import("@angular/core").Signal<string[]>;
|
|
165
|
+
protected readonly weeks: import("@angular/core").Signal<string[][]>;
|
|
166
|
+
protected readonly weekdays: import("@angular/core").Signal<{
|
|
167
|
+
short: string;
|
|
168
|
+
long: string;
|
|
169
|
+
}[]>;
|
|
170
|
+
protected readonly hours: import("@angular/core").Signal<number[]>;
|
|
171
|
+
/** Month cells: visible events and the overflow count per day. */
|
|
172
|
+
protected readonly month: import("@angular/core").Signal<Map<string, {
|
|
173
|
+
visible: VdScheduleItem<E>[];
|
|
174
|
+
more: number;
|
|
175
|
+
}>>;
|
|
176
|
+
protected readonly layout: import("@angular/core").Signal<Map<string, VdSchedulePlacement<E>[]>>;
|
|
177
|
+
protected readonly agenda: import("@angular/core").Signal<{
|
|
178
|
+
date: string;
|
|
179
|
+
items: VdScheduleItem<E>[];
|
|
180
|
+
}[]>;
|
|
181
|
+
protected readonly title: import("@angular/core").Signal<string>;
|
|
182
|
+
protected readonly focusDate: import("@angular/core").WritableSignal<string>;
|
|
183
|
+
protected readonly draggingId: import("@angular/core").WritableSignal<string | null>;
|
|
184
|
+
protected readonly preview: import("@angular/core").WritableSignal<Preview | null>;
|
|
185
|
+
protected readonly messages: import("@angular/core").WritableSignal<readonly {
|
|
186
|
+
serial: number;
|
|
187
|
+
text: string;
|
|
188
|
+
}[]>;
|
|
189
|
+
private readonly host;
|
|
190
|
+
private drag;
|
|
191
|
+
private moveFocus;
|
|
192
|
+
private suppressClick;
|
|
193
|
+
private serial;
|
|
194
|
+
private scrolledView;
|
|
195
|
+
constructor();
|
|
196
|
+
protected goToday(): void;
|
|
197
|
+
protected step(direction: 1 | -1): void;
|
|
198
|
+
protected openDay(date: VdIsoDate): void;
|
|
199
|
+
private monthKey;
|
|
200
|
+
protected activate(event: E): void;
|
|
201
|
+
/**
|
|
202
|
+
* Pointer convenience on empty space (keyboard users create events with the application's own
|
|
203
|
+
* controls): a month cell or all-day cell gives a day, a time-grid column a snapped time.
|
|
204
|
+
*/
|
|
205
|
+
protected emptyClick(event: MouseEvent): void;
|
|
206
|
+
private slotClick;
|
|
207
|
+
protected dragStart(event: PointerEvent, item: VdScheduleItem<E>, kind: 'move' | 'resize'): void;
|
|
208
|
+
protected dragMove(event: PointerEvent): void;
|
|
209
|
+
protected dragEnd(event: PointerEvent): void;
|
|
210
|
+
protected dragCancel(event: PointerEvent): void;
|
|
211
|
+
protected key(event: KeyboardEvent): void;
|
|
212
|
+
/** The change a pointer position asks for, or null when it changes nothing. */
|
|
213
|
+
private changeAt;
|
|
214
|
+
/** Date (and minute in time grids) under a viewport point. */
|
|
215
|
+
private pointAt;
|
|
216
|
+
/** Minute of the day for a y position inside a time-grid column. */
|
|
217
|
+
private minuteAt;
|
|
218
|
+
private finish;
|
|
219
|
+
/** Dashed preview of a timed change inside a time-grid column. */
|
|
220
|
+
protected ghost(day: VdIsoDate): {
|
|
221
|
+
top: number;
|
|
222
|
+
span: number;
|
|
223
|
+
startMin: number;
|
|
224
|
+
} | null;
|
|
225
|
+
protected nowLine(day: VdIsoDate): number | null;
|
|
226
|
+
protected allDay(day: VdIsoDate): VdScheduleItem<E>[];
|
|
227
|
+
protected viewText(view: VdScheduleView): string;
|
|
228
|
+
protected sameMonth(day: VdIsoDate): boolean;
|
|
229
|
+
protected dayNumber(day: VdIsoDate): string;
|
|
230
|
+
protected weekdayShort(day: VdIsoDate): string;
|
|
231
|
+
protected longDate(day: VdIsoDate): string;
|
|
232
|
+
protected dayLabel(day: VdIsoDate): string;
|
|
233
|
+
protected time(minutes: number): string;
|
|
234
|
+
protected hourLabel(hour: number): string;
|
|
235
|
+
/** Time range shown for an event on a given day ("All day" for all-day events). */
|
|
236
|
+
protected rangeText(item: VdScheduleItem, day: VdIsoDate): string;
|
|
237
|
+
protected eventLabel(item: VdScheduleItem): string;
|
|
238
|
+
private whenText;
|
|
239
|
+
private clock;
|
|
240
|
+
private slot;
|
|
241
|
+
private announce;
|
|
242
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VdSchedule<any>, never>;
|
|
243
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VdSchedule<any>, "vd-schedule", never, {
|
|
244
|
+
"events": {
|
|
245
|
+
"alias": "events";
|
|
246
|
+
"required": false;
|
|
247
|
+
"isSignal": true;
|
|
248
|
+
};
|
|
249
|
+
"view": {
|
|
250
|
+
"alias": "view";
|
|
251
|
+
"required": false;
|
|
252
|
+
"isSignal": true;
|
|
253
|
+
};
|
|
254
|
+
"date": {
|
|
255
|
+
"alias": "date";
|
|
256
|
+
"required": false;
|
|
257
|
+
"isSignal": true;
|
|
258
|
+
};
|
|
259
|
+
"views": {
|
|
260
|
+
"alias": "views";
|
|
261
|
+
"required": false;
|
|
262
|
+
"isSignal": true;
|
|
263
|
+
};
|
|
264
|
+
"locale": {
|
|
265
|
+
"alias": "locale";
|
|
266
|
+
"required": false;
|
|
267
|
+
"isSignal": true;
|
|
268
|
+
};
|
|
269
|
+
"firstDayOfWeek": {
|
|
270
|
+
"alias": "firstDayOfWeek";
|
|
271
|
+
"required": false;
|
|
272
|
+
"isSignal": true;
|
|
273
|
+
};
|
|
274
|
+
"dayStartHour": {
|
|
275
|
+
"alias": "dayStartHour";
|
|
276
|
+
"required": false;
|
|
277
|
+
"isSignal": true;
|
|
278
|
+
};
|
|
279
|
+
"dayEndHour": {
|
|
280
|
+
"alias": "dayEndHour";
|
|
281
|
+
"required": false;
|
|
282
|
+
"isSignal": true;
|
|
283
|
+
};
|
|
284
|
+
"scrollToHour": {
|
|
285
|
+
"alias": "scrollToHour";
|
|
286
|
+
"required": false;
|
|
287
|
+
"isSignal": true;
|
|
288
|
+
};
|
|
289
|
+
"slotMinutes": {
|
|
290
|
+
"alias": "slotMinutes";
|
|
291
|
+
"required": false;
|
|
292
|
+
"isSignal": true;
|
|
293
|
+
};
|
|
294
|
+
"maxEventsPerDay": {
|
|
295
|
+
"alias": "maxEventsPerDay";
|
|
296
|
+
"required": false;
|
|
297
|
+
"isSignal": true;
|
|
298
|
+
};
|
|
299
|
+
"agendaDays": {
|
|
300
|
+
"alias": "agendaDays";
|
|
301
|
+
"required": false;
|
|
302
|
+
"isSignal": true;
|
|
303
|
+
};
|
|
304
|
+
"now": {
|
|
305
|
+
"alias": "now";
|
|
306
|
+
"required": false;
|
|
307
|
+
"isSignal": true;
|
|
308
|
+
};
|
|
309
|
+
"editable": {
|
|
310
|
+
"alias": "editable";
|
|
311
|
+
"required": false;
|
|
312
|
+
"isSignal": true;
|
|
313
|
+
};
|
|
314
|
+
"label": {
|
|
315
|
+
"alias": "label";
|
|
316
|
+
"required": false;
|
|
317
|
+
"isSignal": true;
|
|
318
|
+
};
|
|
319
|
+
"todayText": {
|
|
320
|
+
"alias": "todayText";
|
|
321
|
+
"required": false;
|
|
322
|
+
"isSignal": true;
|
|
323
|
+
};
|
|
324
|
+
"previousLabel": {
|
|
325
|
+
"alias": "previousLabel";
|
|
326
|
+
"required": false;
|
|
327
|
+
"isSignal": true;
|
|
328
|
+
};
|
|
329
|
+
"nextLabel": {
|
|
330
|
+
"alias": "nextLabel";
|
|
331
|
+
"required": false;
|
|
332
|
+
"isSignal": true;
|
|
333
|
+
};
|
|
334
|
+
"viewLabel": {
|
|
335
|
+
"alias": "viewLabel";
|
|
336
|
+
"required": false;
|
|
337
|
+
"isSignal": true;
|
|
338
|
+
};
|
|
339
|
+
"monthText": {
|
|
340
|
+
"alias": "monthText";
|
|
341
|
+
"required": false;
|
|
342
|
+
"isSignal": true;
|
|
343
|
+
};
|
|
344
|
+
"weekText": {
|
|
345
|
+
"alias": "weekText";
|
|
346
|
+
"required": false;
|
|
347
|
+
"isSignal": true;
|
|
348
|
+
};
|
|
349
|
+
"dayText": {
|
|
350
|
+
"alias": "dayText";
|
|
351
|
+
"required": false;
|
|
352
|
+
"isSignal": true;
|
|
353
|
+
};
|
|
354
|
+
"agendaText": {
|
|
355
|
+
"alias": "agendaText";
|
|
356
|
+
"required": false;
|
|
357
|
+
"isSignal": true;
|
|
358
|
+
};
|
|
359
|
+
"allDayText": {
|
|
360
|
+
"alias": "allDayText";
|
|
361
|
+
"required": false;
|
|
362
|
+
"isSignal": true;
|
|
363
|
+
};
|
|
364
|
+
"emptyText": {
|
|
365
|
+
"alias": "emptyText";
|
|
366
|
+
"required": false;
|
|
367
|
+
"isSignal": true;
|
|
368
|
+
};
|
|
369
|
+
"invalidText": {
|
|
370
|
+
"alias": "invalidText";
|
|
371
|
+
"required": false;
|
|
372
|
+
"isSignal": true;
|
|
373
|
+
};
|
|
374
|
+
"moreText": {
|
|
375
|
+
"alias": "moreText";
|
|
376
|
+
"required": false;
|
|
377
|
+
"isSignal": true;
|
|
378
|
+
};
|
|
379
|
+
"eventsText": {
|
|
380
|
+
"alias": "eventsText";
|
|
381
|
+
"required": false;
|
|
382
|
+
"isSignal": true;
|
|
383
|
+
};
|
|
384
|
+
"changedText": {
|
|
385
|
+
"alias": "changedText";
|
|
386
|
+
"required": false;
|
|
387
|
+
"isSignal": true;
|
|
388
|
+
};
|
|
389
|
+
"canceledText": {
|
|
390
|
+
"alias": "canceledText";
|
|
391
|
+
"required": false;
|
|
392
|
+
"isSignal": true;
|
|
393
|
+
};
|
|
394
|
+
}, {
|
|
395
|
+
"view": "viewChange";
|
|
396
|
+
"date": "dateChange";
|
|
397
|
+
"eventActivate": "eventActivate";
|
|
398
|
+
"slotActivate": "slotActivate";
|
|
399
|
+
"eventChange": "eventChange";
|
|
400
|
+
}, never, never, true, never>;
|
|
401
|
+
}
|
|
402
|
+
export type { VdIsoDate, VdScheduleColor, VdScheduleEvent, VdScheduleEventChange, VdScheduleSlot, VdScheduleView };
|
package/types/vadem-ui.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VD_VERSION = "0.0
|
|
1
|
+
export declare const VD_VERSION = "0.2.0";
|