@tasknotes/calendar 0.1.7 → 0.1.8
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/CHANGELOG.md +14 -0
- package/README.md +6 -0
- package/dist/calendar.css +341 -44
- package/dist/cjs/index.cjs +279 -58
- package/dist/cjs/react.cjs +279 -58
- package/dist/esm/{chunk-EDRCVOY7.js → chunk-EXKFHPW2.js} +279 -58
- package/dist/esm/index.js +1 -1
- package/dist/esm/react.js +1 -1
- package/dist/types/core/types.d.cts +1 -0
- package/dist/types/core/types.d.ts +1 -0
- package/dist/types/dom/calendar.d.cts +10 -1
- package/dist/types/dom/calendar.d.ts +10 -1
- package/dist/types/dom/options.d.cts +2 -2
- package/dist/types/dom/options.d.ts +2 -2
- package/dist/types/dom/views/daygrid.d.cts +1 -1
- package/dist/types/dom/views/daygrid.d.ts +1 -1
- package/dist/types/dom/views/year.d.cts +1 -0
- package/dist/types/dom/views/year.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
package/dist/esm/react.js
CHANGED
|
@@ -25,6 +25,7 @@ export interface CalendarItem<D = unknown> {
|
|
|
25
25
|
backgroundColor?: string;
|
|
26
26
|
borderColor?: string;
|
|
27
27
|
textColor?: string;
|
|
28
|
+
timeDisplay?: "start" | "range";
|
|
28
29
|
className?: string | string[];
|
|
29
30
|
/** Host-managed temporary placement: inert, mirror-styled and never hidden by event limits. */
|
|
30
31
|
preview?: boolean;
|
|
@@ -25,6 +25,7 @@ export interface CalendarItem<D = unknown> {
|
|
|
25
25
|
backgroundColor?: string;
|
|
26
26
|
borderColor?: string;
|
|
27
27
|
textColor?: string;
|
|
28
|
+
timeDisplay?: "start" | "range";
|
|
28
29
|
className?: string | string[];
|
|
29
30
|
/** Host-managed temporary placement: inert, mirror-styled and never hidden by event limits. */
|
|
30
31
|
preview?: boolean;
|
|
@@ -37,6 +37,11 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
37
37
|
scroll: number;
|
|
38
38
|
};
|
|
39
39
|
draggingId: string | null;
|
|
40
|
+
private listDragPreview;
|
|
41
|
+
private dragSources;
|
|
42
|
+
private dragScrollFrame;
|
|
43
|
+
private readonly dragScrollOrigins;
|
|
44
|
+
private readonly itemWriteStates;
|
|
40
45
|
dragRow: {
|
|
41
46
|
id: string;
|
|
42
47
|
rowId: string;
|
|
@@ -53,6 +58,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
53
58
|
private session;
|
|
54
59
|
private selection;
|
|
55
60
|
private suppressClick;
|
|
61
|
+
private cancelledPointerId;
|
|
56
62
|
private selectedIds;
|
|
57
63
|
private popover;
|
|
58
64
|
private timer;
|
|
@@ -136,7 +142,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
136
142
|
suppressNextClick(): void;
|
|
137
143
|
dayArg(day: Day): DayArg;
|
|
138
144
|
dayClasses(day: Day): string[];
|
|
139
|
-
isEditable(n: NormalizedItem<D>, what: "start" | "duration"): boolean;
|
|
145
|
+
isEditable(n: NormalizedItem<D>, what: "start" | "duration", presentation?: boolean): boolean;
|
|
140
146
|
navLink(day: Day, label: Node | string, cls: string): HTMLElement;
|
|
141
147
|
navigate(day: Day, jsEvent: MouseEvent | KeyboardEvent, view?: "day" | "month"): void;
|
|
142
148
|
createItemEl(meta: ElMeta<D>): HTMLElement;
|
|
@@ -197,6 +203,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
197
203
|
private readonly onDocPointerDown;
|
|
198
204
|
private readonly onPointerDown;
|
|
199
205
|
private activate;
|
|
206
|
+
private startDragScroll;
|
|
200
207
|
private readonly onTouchMove;
|
|
201
208
|
private readonly onPointerMove;
|
|
202
209
|
private readonly onPointerUp;
|
|
@@ -204,6 +211,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
204
211
|
private readonly onDocKeyDown;
|
|
205
212
|
/** Proposal for the current pointer position. */
|
|
206
213
|
private track;
|
|
214
|
+
private invalidateProposal;
|
|
207
215
|
private trackExternal;
|
|
208
216
|
private externalItem;
|
|
209
217
|
private timelineSnap;
|
|
@@ -222,6 +230,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
222
230
|
/** Ends the current pointer session, committing unless `cancel`. */
|
|
223
231
|
private endSession;
|
|
224
232
|
private commit;
|
|
233
|
+
private applyItemWriteState;
|
|
225
234
|
/** Runs in the capture phase so the click ending a drag never reaches content inside the calendar, React portals included. */
|
|
226
235
|
private readonly onClickCapture;
|
|
227
236
|
private readonly onClick;
|
|
@@ -37,6 +37,11 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
37
37
|
scroll: number;
|
|
38
38
|
};
|
|
39
39
|
draggingId: string | null;
|
|
40
|
+
private listDragPreview;
|
|
41
|
+
private dragSources;
|
|
42
|
+
private dragScrollFrame;
|
|
43
|
+
private readonly dragScrollOrigins;
|
|
44
|
+
private readonly itemWriteStates;
|
|
40
45
|
dragRow: {
|
|
41
46
|
id: string;
|
|
42
47
|
rowId: string;
|
|
@@ -53,6 +58,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
53
58
|
private session;
|
|
54
59
|
private selection;
|
|
55
60
|
private suppressClick;
|
|
61
|
+
private cancelledPointerId;
|
|
56
62
|
private selectedIds;
|
|
57
63
|
private popover;
|
|
58
64
|
private timer;
|
|
@@ -136,7 +142,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
136
142
|
suppressNextClick(): void;
|
|
137
143
|
dayArg(day: Day): DayArg;
|
|
138
144
|
dayClasses(day: Day): string[];
|
|
139
|
-
isEditable(n: NormalizedItem<D>, what: "start" | "duration"): boolean;
|
|
145
|
+
isEditable(n: NormalizedItem<D>, what: "start" | "duration", presentation?: boolean): boolean;
|
|
140
146
|
navLink(day: Day, label: Node | string, cls: string): HTMLElement;
|
|
141
147
|
navigate(day: Day, jsEvent: MouseEvent | KeyboardEvent, view?: "day" | "month"): void;
|
|
142
148
|
createItemEl(meta: ElMeta<D>): HTMLElement;
|
|
@@ -197,6 +203,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
197
203
|
private readonly onDocPointerDown;
|
|
198
204
|
private readonly onPointerDown;
|
|
199
205
|
private activate;
|
|
206
|
+
private startDragScroll;
|
|
200
207
|
private readonly onTouchMove;
|
|
201
208
|
private readonly onPointerMove;
|
|
202
209
|
private readonly onPointerUp;
|
|
@@ -204,6 +211,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
204
211
|
private readonly onDocKeyDown;
|
|
205
212
|
/** Proposal for the current pointer position. */
|
|
206
213
|
private track;
|
|
214
|
+
private invalidateProposal;
|
|
207
215
|
private trackExternal;
|
|
208
216
|
private externalItem;
|
|
209
217
|
private timelineSnap;
|
|
@@ -222,6 +230,7 @@ export declare class Calendar<D = unknown> implements ViewContext<D> {
|
|
|
222
230
|
/** Ends the current pointer session, committing unless `cancel`. */
|
|
223
231
|
private endSession;
|
|
224
232
|
private commit;
|
|
233
|
+
private applyItemWriteState;
|
|
225
234
|
/** Runs in the capture phase so the click ending a drag never reaches content inside the calendar, React portals included. */
|
|
226
235
|
private readonly onClickCapture;
|
|
227
236
|
private readonly onClick;
|
|
@@ -16,7 +16,7 @@ export interface ViewInfo {
|
|
|
16
16
|
title: string;
|
|
17
17
|
/**
|
|
18
18
|
* The days whose items the calendar can show: `range`, extended to the
|
|
19
|
-
*
|
|
19
|
+
* full window of days a date strip is showing so their dots are right. Load
|
|
20
20
|
* items for this range; `onRangeChange` fires when it changes too.
|
|
21
21
|
*/
|
|
22
22
|
dataRange: DateRange;
|
|
@@ -332,7 +332,7 @@ export interface CalendarOptions<D = unknown> {
|
|
|
332
332
|
* the tap target: dots ignore the pointer and are hidden from assistive
|
|
333
333
|
* technology, and the cell is labelled with its item count.
|
|
334
334
|
*/
|
|
335
|
-
monthDisplay: "full" | "dots";
|
|
335
|
+
monthDisplay: "full" | "dots" | "chips";
|
|
336
336
|
/** "local" or an IANA name. */
|
|
337
337
|
timeZone: string;
|
|
338
338
|
locale: string | undefined;
|
|
@@ -16,7 +16,7 @@ export interface ViewInfo {
|
|
|
16
16
|
title: string;
|
|
17
17
|
/**
|
|
18
18
|
* The days whose items the calendar can show: `range`, extended to the
|
|
19
|
-
*
|
|
19
|
+
* full window of days a date strip is showing so their dots are right. Load
|
|
20
20
|
* items for this range; `onRangeChange` fires when it changes too.
|
|
21
21
|
*/
|
|
22
22
|
dataRange: DateRange;
|
|
@@ -332,7 +332,7 @@ export interface CalendarOptions<D = unknown> {
|
|
|
332
332
|
* the tap target: dots ignore the pointer and are hidden from assistive
|
|
333
333
|
* technology, and the cell is labelled with its item count.
|
|
334
334
|
*/
|
|
335
|
-
monthDisplay: "full" | "dots";
|
|
335
|
+
monthDisplay: "full" | "dots" | "chips";
|
|
336
336
|
/** "local" or an IANA name. */
|
|
337
337
|
timeZone: string;
|
|
338
338
|
locale: string | undefined;
|
package/package.json
CHANGED