foldkit 0.79.0 → 0.81.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/README.md +1 -0
- package/dist/html/index.d.ts +34 -27
- package/dist/html/index.d.ts.map +1 -1
- package/dist/html/index.js +31 -26
- package/dist/html/public.d.ts +1 -1
- package/dist/html/public.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/mount/index.d.ts +42 -0
- package/dist/mount/index.d.ts.map +1 -0
- package/dist/mount/index.js +38 -0
- package/dist/mount/public.d.ts +3 -0
- package/dist/mount/public.d.ts.map +1 -0
- package/dist/mount/public.js +1 -0
- package/dist/runtime/public.d.ts +1 -1
- package/dist/runtime/public.d.ts.map +1 -1
- package/dist/runtime/runtime.d.ts +1 -23
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +1 -2
- package/dist/ui/anchor.d.ts +13 -6
- package/dist/ui/anchor.d.ts.map +1 -1
- package/dist/ui/anchor.js +91 -86
- package/dist/ui/calendar/index.d.ts +117 -28
- package/dist/ui/calendar/index.d.ts.map +1 -1
- package/dist/ui/calendar/index.js +393 -105
- package/dist/ui/calendar/public.d.ts +2 -2
- package/dist/ui/calendar/public.d.ts.map +1 -1
- package/dist/ui/calendar/public.js +1 -1
- package/dist/ui/combobox/multi.d.ts +15 -3
- package/dist/ui/combobox/multi.d.ts.map +1 -1
- package/dist/ui/combobox/public.d.ts +2 -2
- package/dist/ui/combobox/public.d.ts.map +1 -1
- package/dist/ui/combobox/public.js +1 -1
- package/dist/ui/combobox/shared.d.ts +22 -7
- package/dist/ui/combobox/shared.d.ts.map +1 -1
- package/dist/ui/combobox/shared.js +73 -37
- package/dist/ui/combobox/single.d.ts +15 -3
- package/dist/ui/combobox/single.d.ts.map +1 -1
- package/dist/ui/datePicker/index.d.ts +7 -4
- package/dist/ui/datePicker/index.d.ts.map +1 -1
- package/dist/ui/datePicker/index.js +8 -2
- package/dist/ui/listbox/multi.d.ts +10 -2
- package/dist/ui/listbox/multi.d.ts.map +1 -1
- package/dist/ui/listbox/public.d.ts +2 -2
- package/dist/ui/listbox/public.d.ts.map +1 -1
- package/dist/ui/listbox/public.js +1 -1
- package/dist/ui/listbox/shared.d.ts +16 -6
- package/dist/ui/listbox/shared.d.ts.map +1 -1
- package/dist/ui/listbox/shared.js +37 -25
- package/dist/ui/listbox/single.d.ts +10 -2
- package/dist/ui/listbox/single.d.ts.map +1 -1
- package/dist/ui/menu/index.d.ts +11 -5
- package/dist/ui/menu/index.d.ts.map +1 -1
- package/dist/ui/menu/index.js +36 -24
- package/dist/ui/menu/public.d.ts +2 -2
- package/dist/ui/menu/public.d.ts.map +1 -1
- package/dist/ui/menu/public.js +1 -1
- package/dist/ui/popover/index.d.ts +8 -5
- package/dist/ui/popover/index.d.ts.map +1 -1
- package/dist/ui/popover/index.js +23 -16
- package/dist/ui/popover/public.d.ts +2 -2
- package/dist/ui/popover/public.d.ts.map +1 -1
- package/dist/ui/popover/public.js +1 -1
- package/dist/ui/tooltip/index.d.ts +5 -2
- package/dist/ui/tooltip/index.d.ts.map +1 -1
- package/dist/ui/tooltip/index.js +17 -10
- package/dist/ui/tooltip/public.d.ts +1 -1
- package/dist/ui/tooltip/public.d.ts.map +1 -1
- package/dist/ui/tooltip/public.js +1 -1
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,OAAO,EACP,MAAM,EAGN,KAAK,EAEL,MAAM,EAMN,MAAM,EAKP,MAAM,QAAQ,CAAA;AAGf,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAIlD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAA+B,MAAM,iBAAiB,CA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AAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,oBAAoB,CAC1B,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AAEpB,wBAAgB,WAAW,CACzB,KAAK,EACL,OAAO,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,KAAK,EACL,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,sBAAsB,CAC5B,KAAK,EACL,OAAO,EACP,aAAa,EACb,KAAK,EACL,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AAEpB,wBAAgB,WAAW,CACzB,KAAK,EACL,OAAO,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EAChC,aAAa,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACzD,SAAS,GAAG,KAAK,EACjB,uBAAuB,GAAG,KAAK,EAE/B,MAAM,EAAE,aAAa,CACnB,KAAK,EACL,OAAO,EACP,aAAa,EACb,SAAS,EACT,uBAAuB,CACxB,GACA,iBAAiB,CAAA;AAmLpB,kEAAkE;AAClE,eAAO,MAAM,GAAG,GAAI,gBAAgB,iBAAiB,KAAG,IA+BvD,CAAA"}
|
package/dist/runtime/runtime.js
CHANGED
|
@@ -14,7 +14,6 @@ const DEFAULT_DEV_TOOLS_POSITION = 'BottomRight';
|
|
|
14
14
|
const DEFAULT_DEV_TOOLS_MODE = 'TimeTravel';
|
|
15
15
|
const DEFAULT_SLOW_VIEW_SHOW = 'Development';
|
|
16
16
|
const DEFAULT_SLOW_VIEW_THRESHOLD_MS = 16;
|
|
17
|
-
const DEFAULT_FREEZE_MODEL_SHOW = 'Development';
|
|
18
17
|
const defaultSlowViewCallback = (context) => {
|
|
19
18
|
const trigger = Option.match(context.message, {
|
|
20
19
|
onNone: () => 'init',
|
|
@@ -35,7 +34,7 @@ const makeRuntime = ({ Model, flags: resolveFlags, init, update, view, subscript
|
|
|
35
34
|
thresholdMs: config.thresholdMs ?? DEFAULT_SLOW_VIEW_THRESHOLD_MS,
|
|
36
35
|
onSlowView: config.onSlowView ?? defaultSlowViewCallback,
|
|
37
36
|
})));
|
|
38
|
-
const isFreezeModelActive =
|
|
37
|
+
const isFreezeModelActive = freezeModel !== false && !!import.meta.hot;
|
|
39
38
|
const maybeFreezeModel = (model) => isFreezeModelActive ? deepFreeze(model) : model;
|
|
40
39
|
return (hmrModel) => Effect.scoped(Effect.gen(function* () {
|
|
41
40
|
const maybeResourceLayer = resources
|
package/dist/ui/anchor.d.ts
CHANGED
|
@@ -7,15 +7,22 @@ export type AnchorConfig = Readonly<{
|
|
|
7
7
|
padding?: number;
|
|
8
8
|
portal?: boolean;
|
|
9
9
|
}>;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/** Positions a floating element relative to its button using Floating UI, then
|
|
11
|
+
* returns a cleanup function. Designed to be called inside an `OnMount`
|
|
12
|
+
* action: the consumer wraps the call in `Effect.sync` and stashes the
|
|
13
|
+
* returned cleanup in the `Mount` result. When `interceptTab` is true
|
|
14
|
+
* (default), Tab key in portal mode refocuses the button — set to false for
|
|
15
|
+
* components like Popover where Tab should navigate naturally within the
|
|
16
|
+
* panel. When `focusAfterPosition` is true, the element is focused after the
|
|
17
|
+
* first position computation clears visibility — deferred via
|
|
18
|
+
* requestAnimationFrame so the element is painted before focus fires.
|
|
19
|
+
* `focusSelector` optionally targets a descendant (e.g. a calendar grid
|
|
20
|
+
* inside a popover panel) instead of the panel itself. */
|
|
21
|
+
export declare const anchorSetup: (config: {
|
|
12
22
|
buttonId: string;
|
|
13
23
|
anchor: AnchorConfig;
|
|
14
24
|
interceptTab?: boolean;
|
|
15
25
|
focusAfterPosition?: boolean;
|
|
16
26
|
focusSelector?: string;
|
|
17
|
-
}) =>
|
|
18
|
-
onInsert: (items: Element) => void;
|
|
19
|
-
onDestroy: (items: Element) => void;
|
|
20
|
-
}>;
|
|
27
|
+
}) => (items: Element) => (() => void);
|
|
21
28
|
//# sourceMappingURL=anchor.d.ts.map
|
package/dist/ui/anchor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/ui/anchor.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,oGAAoG;AACpG,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/ui/anchor.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,oGAAoG;AACpG,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAiBF;;;;;;;;;;2DAU2D;AAC3D,eAAO,MAAM,WAAW,GACrB,QAAQ;IACP,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,MACA,OAAO,OAAO,KAAG,CAAC,MAAM,IAAI,CAgG5B,CAAA"}
|
package/dist/ui/anchor.js
CHANGED
|
@@ -9,93 +9,98 @@ const getOrCreatePortalRoot = () => {
|
|
|
9
9
|
root.id = PORTAL_ROOT_ID;
|
|
10
10
|
return document.body.appendChild(root);
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
12
|
+
/** Positions a floating element relative to its button using Floating UI, then
|
|
13
|
+
* returns a cleanup function. Designed to be called inside an `OnMount`
|
|
14
|
+
* action: the consumer wraps the call in `Effect.sync` and stashes the
|
|
15
|
+
* returned cleanup in the `Mount` result. When `interceptTab` is true
|
|
16
|
+
* (default), Tab key in portal mode refocuses the button — set to false for
|
|
17
|
+
* components like Popover where Tab should navigate naturally within the
|
|
18
|
+
* panel. When `focusAfterPosition` is true, the element is focused after the
|
|
19
|
+
* first position computation clears visibility — deferred via
|
|
20
|
+
* requestAnimationFrame so the element is painted before focus fires.
|
|
21
|
+
* `focusSelector` optionally targets a descendant (e.g. a calendar grid
|
|
22
|
+
* inside a popover panel) instead of the panel itself. */
|
|
23
|
+
export const anchorSetup = (config) => (items) => {
|
|
24
|
+
const button = document.getElementById(config.buttonId);
|
|
25
|
+
if (!(button instanceof HTMLElement) || !(items instanceof HTMLElement)) {
|
|
26
|
+
return () => { };
|
|
27
|
+
}
|
|
28
|
+
const isPortal = config.anchor.portal ?? true;
|
|
29
|
+
if (isPortal) {
|
|
30
|
+
getOrCreatePortalRoot().appendChild(items);
|
|
31
|
+
}
|
|
32
|
+
const { placement, gap, offset: crossAxis, padding } = config.anchor;
|
|
33
|
+
const shouldInterceptTab = config.interceptTab ?? true;
|
|
34
|
+
let isFirstUpdate = true;
|
|
35
|
+
const floatingCleanup = autoUpdate(button, items, () => {
|
|
36
|
+
computePosition(button, items, {
|
|
37
|
+
placement: placement ?? 'bottom-start',
|
|
38
|
+
strategy: 'absolute',
|
|
39
|
+
middleware: [
|
|
40
|
+
floatingOffset({
|
|
41
|
+
mainAxis: gap ?? 0,
|
|
42
|
+
crossAxis: crossAxis ?? 0,
|
|
43
|
+
}),
|
|
44
|
+
flip({ padding: padding ?? 0 }),
|
|
45
|
+
shift({ padding: padding ?? 0 }),
|
|
46
|
+
size({
|
|
47
|
+
padding: padding ?? 0,
|
|
48
|
+
apply({ rects, availableHeight }) {
|
|
49
|
+
items.style.setProperty('--button-width', `${rects.reference.width}px`);
|
|
50
|
+
items.style.maxHeight = `${availableHeight}px`;
|
|
51
|
+
items.style.overflowY = 'auto';
|
|
52
|
+
items.style.overscrollBehavior = 'none';
|
|
53
|
+
},
|
|
54
|
+
}),
|
|
55
|
+
],
|
|
56
|
+
}).then(({ x, y }) => {
|
|
57
|
+
items.style.left = `${x}px`;
|
|
58
|
+
items.style.top = `${y}px`;
|
|
59
|
+
if (isFirstUpdate) {
|
|
60
|
+
isFirstUpdate = false;
|
|
61
|
+
items.style.visibility = '';
|
|
62
|
+
if (config.focusAfterPosition ?? false) {
|
|
63
|
+
requestAnimationFrame(() => {
|
|
64
|
+
const target = config.focusSelector
|
|
65
|
+
? document.querySelector(config.focusSelector)
|
|
66
|
+
: items;
|
|
67
|
+
if (target instanceof HTMLElement) {
|
|
68
|
+
target.focus();
|
|
69
|
+
}
|
|
70
|
+
});
|
|
64
71
|
}
|
|
65
|
-
}
|
|
72
|
+
}
|
|
66
73
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
});
|
|
75
|
+
const portalCleanup = isPortal
|
|
76
|
+
? () => {
|
|
77
|
+
try {
|
|
78
|
+
items.remove();
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// NOTE: a blur-triggered re-render may unmount the items element
|
|
82
|
+
// before this cleanup runs, so the remove() call can throw on a
|
|
83
|
+
// node that's already been removed. Swallow the error.
|
|
75
84
|
}
|
|
76
|
-
: undefined;
|
|
77
|
-
if (isPortal && shouldInterceptTab) {
|
|
78
|
-
const handleTabKey = (event) => {
|
|
79
|
-
if (event instanceof KeyboardEvent && event.key === 'Tab') {
|
|
80
|
-
button.focus();
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
items.addEventListener('keydown', handleTabKey);
|
|
84
|
-
anchorCleanups.set(items, () => {
|
|
85
|
-
floatingCleanup();
|
|
86
|
-
items.removeEventListener('keydown', handleTabKey);
|
|
87
|
-
portalCleanup?.();
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
anchorCleanups.set(items, () => {
|
|
92
|
-
floatingCleanup();
|
|
93
|
-
portalCleanup?.();
|
|
94
|
-
});
|
|
95
85
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
86
|
+
: undefined;
|
|
87
|
+
if (isPortal && shouldInterceptTab) {
|
|
88
|
+
const handleTabKey = (event) => {
|
|
89
|
+
if (event instanceof KeyboardEvent && event.key === 'Tab') {
|
|
90
|
+
button.focus();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
items.addEventListener('keydown', handleTabKey);
|
|
94
|
+
return () => {
|
|
95
|
+
floatingCleanup();
|
|
96
|
+
items.removeEventListener('keydown', handleTabKey);
|
|
97
|
+
portalCleanup?.();
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return () => {
|
|
102
|
+
floatingCleanup();
|
|
103
|
+
portalCleanup?.();
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
};
|
|
@@ -3,9 +3,15 @@ import * as Calendar from '../../calendar/index.js';
|
|
|
3
3
|
import type { CalendarDate } from '../../calendar/index.js';
|
|
4
4
|
import * as Command from '../../command/index.js';
|
|
5
5
|
import { type Attribute, type Html } from '../../html/index.js';
|
|
6
|
+
/** Which grid the calendar is currently displaying. `Days` is the standard
|
|
7
|
+
* 6×7 day grid; `Months` is a 3×4 month-name grid for fast month jumps;
|
|
8
|
+
* `Years` is a 3×4 year grid paged in 12-year windows for fast year jumps. */
|
|
9
|
+
export declare const ViewMode: S.Literal<["Days", "Months", "Years"]>;
|
|
10
|
+
export type ViewMode = typeof ViewMode.Type;
|
|
6
11
|
/** Schema for the calendar component's state. Tracks the visible month/year,
|
|
7
|
-
* the keyboard-focused and user-selected dates,
|
|
8
|
-
* governs navigation (locale, min/max, disabled
|
|
12
|
+
* the keyboard-focused and user-selected dates, the active view mode, and
|
|
13
|
+
* the configuration that governs navigation (locale, min/max, disabled
|
|
14
|
+
* days). */
|
|
9
15
|
export declare const Model: S.Struct<{
|
|
10
16
|
id: typeof S.String;
|
|
11
17
|
today: S.filter<S.Struct<{
|
|
@@ -15,6 +21,7 @@ export declare const Model: S.Struct<{
|
|
|
15
21
|
}>>;
|
|
16
22
|
viewYear: typeof S.Int;
|
|
17
23
|
viewMonth: S.filter<typeof S.Int>;
|
|
24
|
+
viewMode: S.Literal<["Days", "Months", "Years"]>;
|
|
18
25
|
maybeFocusedDate: S.OptionFromSelf<S.filter<S.Struct<{
|
|
19
26
|
year: typeof S.Int;
|
|
20
27
|
month: S.filter<typeof S.Int>;
|
|
@@ -65,18 +72,30 @@ export declare const PressedKeyOnGrid: import("../../schema/index.js").CallableT
|
|
|
65
72
|
key: typeof S.String;
|
|
66
73
|
isShift: typeof S.Boolean;
|
|
67
74
|
}>;
|
|
68
|
-
/** Sent when the user clicks the previous-month navigation button
|
|
75
|
+
/** Sent when the user clicks the previous-month navigation button in Days
|
|
76
|
+
* mode. (The Years mode prev/next-page buttons dispatch `PagedYears`.) */
|
|
69
77
|
export declare const ClickedPreviousMonthButton: import("../../schema/index.js").CallableTaggedStruct<"ClickedPreviousMonthButton", {}>;
|
|
70
|
-
/** Sent when the user clicks the next-month navigation button
|
|
78
|
+
/** Sent when the user clicks the next-month navigation button in Days
|
|
79
|
+
* mode. (The Years mode prev/next-page buttons dispatch `PagedYears`.) */
|
|
71
80
|
export declare const ClickedNextMonthButton: import("../../schema/index.js").CallableTaggedStruct<"ClickedNextMonthButton", {}>;
|
|
72
|
-
/** Sent when the user
|
|
73
|
-
|
|
81
|
+
/** Sent when the user clicks the calendar heading. Zooms out one mode
|
|
82
|
+
* level: Days → Months, Months → Years. Terminal in Years mode. */
|
|
83
|
+
export declare const ClickedHeading: import("../../schema/index.js").CallableTaggedStruct<"ClickedHeading", {}>;
|
|
84
|
+
/** Sent when the user picks a month from the months grid. Jumps the view
|
|
85
|
+
* to that month and returns the calendar to Days mode. */
|
|
86
|
+
export declare const SelectedMonth: import("../../schema/index.js").CallableTaggedStruct<"SelectedMonth", {
|
|
74
87
|
month: typeof S.Int;
|
|
75
88
|
}>;
|
|
76
|
-
/** Sent when the user picks a year from the
|
|
77
|
-
|
|
89
|
+
/** Sent when the user picks a year from the years grid. Jumps the view to
|
|
90
|
+
* that year and transitions the calendar to Months mode for further drilling. */
|
|
91
|
+
export declare const SelectedYear: import("../../schema/index.js").CallableTaggedStruct<"SelectedYear", {
|
|
78
92
|
year: typeof S.Int;
|
|
79
93
|
}>;
|
|
94
|
+
/** Sent when the user pages the years grid forward or backward by one
|
|
95
|
+
* window. Direction is `1` for next, `-1` for previous. */
|
|
96
|
+
export declare const PagedYears: import("../../schema/index.js").CallableTaggedStruct<"PagedYears", {
|
|
97
|
+
direction: S.Literal<[1, -1]>;
|
|
98
|
+
}>;
|
|
80
99
|
/** Sent when the grid container receives DOM focus. */
|
|
81
100
|
export declare const FocusedGrid: import("../../schema/index.js").CallableTaggedStruct<"FocusedGrid", {}>;
|
|
82
101
|
/** Sent when the grid container loses DOM focus. */
|
|
@@ -101,10 +120,12 @@ export declare const Message: S.Union<[import("../../schema/index.js").CallableT
|
|
|
101
120
|
}>, import("../../schema/index.js").CallableTaggedStruct<"PressedKeyOnGrid", {
|
|
102
121
|
key: typeof S.String;
|
|
103
122
|
isShift: typeof S.Boolean;
|
|
104
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedPreviousMonthButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedNextMonthButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"
|
|
123
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedPreviousMonthButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedNextMonthButton", {}>, import("../../schema/index.js").CallableTaggedStruct<"ClickedHeading", {}>, import("../../schema/index.js").CallableTaggedStruct<"SelectedMonth", {
|
|
105
124
|
month: typeof S.Int;
|
|
106
|
-
}>, import("../../schema/index.js").CallableTaggedStruct<"
|
|
125
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"SelectedYear", {
|
|
107
126
|
year: typeof S.Int;
|
|
127
|
+
}>, import("../../schema/index.js").CallableTaggedStruct<"PagedYears", {
|
|
128
|
+
direction: S.Literal<[1, -1]>;
|
|
108
129
|
}>, import("../../schema/index.js").CallableTaggedStruct<"FocusedGrid", {}>, import("../../schema/index.js").CallableTaggedStruct<"BlurredGrid", {}>, import("../../schema/index.js").CallableTaggedStruct<"RefreshedToday", {
|
|
109
130
|
today: S.filter<S.Struct<{
|
|
110
131
|
year: typeof S.Int;
|
|
@@ -183,6 +204,17 @@ export declare const setDisabledDates: (model: Model, disabledDates: ReadonlyArr
|
|
|
183
204
|
/** Sets the days of the week that are disabled (e.g. weekends). Pass an
|
|
184
205
|
* empty array to clear. Does NOT reconcile the current selection. */
|
|
185
206
|
export declare const setDisabledDaysOfWeek: (model: Model, disabledDaysOfWeek: ReadonlyArray<Calendar.DayOfWeek>) => Model;
|
|
207
|
+
/** Returns the calendar to Days mode regardless of current depth. Useful for
|
|
208
|
+
* standalone (non-popovered) consumers that want to wire their own back-out
|
|
209
|
+
* gesture. Popovered consumers like `Ui.DatePicker` don't need this — Escape
|
|
210
|
+
* closes the popover, and the calendar resets to Days on next open.
|
|
211
|
+
*
|
|
212
|
+
* Reconciles `maybeFocusedDate` to a date inside the visible (`viewYear`,
|
|
213
|
+
* `viewMonth`) — Months/Years navigation can leave the cursor on a date
|
|
214
|
+
* outside the days grid (paged-away year, etc.), which would otherwise
|
|
215
|
+
* cause `aria-activedescendant` to point at a non-rendered cell and the
|
|
216
|
+
* next ArrowLeft to jump to the cursor's stale year. */
|
|
217
|
+
export declare const dropToDays: (model: Model) => Model;
|
|
186
218
|
/** Processes a calendar message and returns the next model, commands, and
|
|
187
219
|
* optional OutMessage. */
|
|
188
220
|
export declare const update: (model: Model, message: Message) => UpdateReturn;
|
|
@@ -198,39 +230,93 @@ export type DayCell<ParentMessage> = Readonly<{
|
|
|
198
230
|
isInViewMonth: boolean;
|
|
199
231
|
isDisabled: boolean;
|
|
200
232
|
}>;
|
|
201
|
-
/** A column header for the grid's first row (day-of-week labels). */
|
|
233
|
+
/** A column header for the day grid's first row (day-of-week labels). */
|
|
202
234
|
export type ColumnHeader<ParentMessage> = Readonly<{
|
|
203
235
|
name: string;
|
|
204
236
|
attributes: ReadonlyArray<Attribute<ParentMessage>>;
|
|
205
237
|
}>;
|
|
206
|
-
/** A single week row in the
|
|
207
|
-
*
|
|
238
|
+
/** A single week row in the day grid, carrying its own row attributes (role,
|
|
239
|
+
* aria-rowindex) alongside its 7 day cells. */
|
|
208
240
|
export type Week<ParentMessage> = Readonly<{
|
|
209
241
|
attributes: ReadonlyArray<Attribute<ParentMessage>>;
|
|
210
242
|
cells: ReadonlyArray<DayCell<ParentMessage>>;
|
|
211
243
|
}>;
|
|
212
|
-
/**
|
|
213
|
-
*
|
|
214
|
-
|
|
244
|
+
/** Information about a single month cell in the rendered months grid.
|
|
245
|
+
* `label` is the locale-aware full month name (e.g. "September"); `shortLabel`
|
|
246
|
+
* is the locale-aware abbreviation (e.g. "Sep"). Render whichever fits the
|
|
247
|
+
* cell — never substring `label` to abbreviate, since that's not safe across
|
|
248
|
+
* locales. */
|
|
249
|
+
export type MonthCell<ParentMessage> = Readonly<{
|
|
250
|
+
month: number;
|
|
251
|
+
label: string;
|
|
252
|
+
shortLabel: string;
|
|
253
|
+
cellAttributes: ReadonlyArray<Attribute<ParentMessage>>;
|
|
254
|
+
buttonAttributes: ReadonlyArray<Attribute<ParentMessage>>;
|
|
255
|
+
isSelected: boolean;
|
|
256
|
+
isFocused: boolean;
|
|
257
|
+
isCurrentMonth: boolean;
|
|
258
|
+
isDisabled: boolean;
|
|
259
|
+
}>;
|
|
260
|
+
/** Information about a single year cell in the rendered years grid. */
|
|
261
|
+
export type YearCell<ParentMessage> = Readonly<{
|
|
262
|
+
year: number;
|
|
263
|
+
label: string;
|
|
264
|
+
cellAttributes: ReadonlyArray<Attribute<ParentMessage>>;
|
|
265
|
+
buttonAttributes: ReadonlyArray<Attribute<ParentMessage>>;
|
|
266
|
+
isSelected: boolean;
|
|
267
|
+
isFocused: boolean;
|
|
268
|
+
isCurrentYear: boolean;
|
|
269
|
+
isDisabled: boolean;
|
|
270
|
+
}>;
|
|
271
|
+
/** Attributes provided to the consumer when rendering the day grid. */
|
|
272
|
+
export type DaysModeAttributes<ParentMessage> = Readonly<{
|
|
273
|
+
_tag: 'Days';
|
|
215
274
|
root: ReadonlyArray<Attribute<ParentMessage>>;
|
|
216
275
|
previousMonthButton: ReadonlyArray<Attribute<ParentMessage>>;
|
|
217
276
|
nextMonthButton: ReadonlyArray<Attribute<ParentMessage>>;
|
|
277
|
+
headingButton: ReadonlyArray<Attribute<ParentMessage>>;
|
|
218
278
|
heading: Readonly<{
|
|
219
279
|
id: string;
|
|
220
280
|
text: string;
|
|
221
281
|
}>;
|
|
222
|
-
monthSelect: ReadonlyArray<Attribute<ParentMessage>>;
|
|
223
|
-
monthOptions: ReadonlyArray<Readonly<{
|
|
224
|
-
value: number;
|
|
225
|
-
label: string;
|
|
226
|
-
}>>;
|
|
227
|
-
yearSelect: ReadonlyArray<Attribute<ParentMessage>>;
|
|
228
|
-
yearOptions: ReadonlyArray<number>;
|
|
229
282
|
grid: ReadonlyArray<Attribute<ParentMessage>>;
|
|
230
283
|
headerRow: ReadonlyArray<Attribute<ParentMessage>>;
|
|
231
284
|
columnHeaders: ReadonlyArray<ColumnHeader<ParentMessage>>;
|
|
232
285
|
weeks: ReadonlyArray<Week<ParentMessage>>;
|
|
233
286
|
}>;
|
|
287
|
+
/** Attributes provided to the consumer when rendering the months grid. The
|
|
288
|
+
* 12 cells are pre-built in calendar (locale-ordered) — the consumer arranges
|
|
289
|
+
* them in whatever grid layout they prefer (3×4 is the typical choice). */
|
|
290
|
+
export type MonthsModeAttributes<ParentMessage> = Readonly<{
|
|
291
|
+
_tag: 'Months';
|
|
292
|
+
root: ReadonlyArray<Attribute<ParentMessage>>;
|
|
293
|
+
headingButton: ReadonlyArray<Attribute<ParentMessage>>;
|
|
294
|
+
heading: Readonly<{
|
|
295
|
+
id: string;
|
|
296
|
+
text: string;
|
|
297
|
+
}>;
|
|
298
|
+
grid: ReadonlyArray<Attribute<ParentMessage>>;
|
|
299
|
+
cells: ReadonlyArray<MonthCell<ParentMessage>>;
|
|
300
|
+
}>;
|
|
301
|
+
/** Attributes provided to the consumer when rendering the years grid. The
|
|
302
|
+
* 12 cells span one paged window; prev/next buttons page by 12 years. */
|
|
303
|
+
export type YearsModeAttributes<ParentMessage> = Readonly<{
|
|
304
|
+
_tag: 'Years';
|
|
305
|
+
root: ReadonlyArray<Attribute<ParentMessage>>;
|
|
306
|
+
previousPageButton: ReadonlyArray<Attribute<ParentMessage>>;
|
|
307
|
+
nextPageButton: ReadonlyArray<Attribute<ParentMessage>>;
|
|
308
|
+
heading: Readonly<{
|
|
309
|
+
id: string;
|
|
310
|
+
text: string;
|
|
311
|
+
}>;
|
|
312
|
+
grid: ReadonlyArray<Attribute<ParentMessage>>;
|
|
313
|
+
cells: ReadonlyArray<YearCell<ParentMessage>>;
|
|
314
|
+
}>;
|
|
315
|
+
/** Discriminated union of attribute groups and derived data the calendar
|
|
316
|
+
* component provides to the consumer's `toView` callback. The variant
|
|
317
|
+
* matches `model.viewMode` — pattern-match on `_tag` with `M.tagsExhaustive`
|
|
318
|
+
* to render each mode. */
|
|
319
|
+
export type CalendarAttributes<ParentMessage> = DaysModeAttributes<ParentMessage> | MonthsModeAttributes<ParentMessage> | YearsModeAttributes<ParentMessage>;
|
|
234
320
|
/** Configuration for rendering a calendar with `view`. */
|
|
235
321
|
export type ViewConfig<ParentMessage> = Readonly<{
|
|
236
322
|
model: Model;
|
|
@@ -245,12 +331,15 @@ export type ViewConfig<ParentMessage> = Readonly<{
|
|
|
245
331
|
onSelectedDate?: (date: CalendarDate) => ParentMessage;
|
|
246
332
|
previousMonthLabel?: string;
|
|
247
333
|
nextMonthLabel?: string;
|
|
248
|
-
|
|
249
|
-
|
|
334
|
+
previousYearsPageLabel?: string;
|
|
335
|
+
nextYearsPageLabel?: string;
|
|
336
|
+
daysHeadingButtonLabel?: string;
|
|
337
|
+
monthsHeadingButtonLabel?: string;
|
|
250
338
|
}>;
|
|
251
|
-
/** Renders an accessible calendar
|
|
252
|
-
*
|
|
253
|
-
*
|
|
339
|
+
/** Renders an accessible calendar. Builds mode-specific ARIA attribute
|
|
340
|
+
* groups and derived cell data, then delegates layout to the consumer's
|
|
341
|
+
* `toView` callback. The variant of `CalendarAttributes` passed to `toView`
|
|
342
|
+
* matches `model.viewMode`. */
|
|
254
343
|
export declare const view: <ParentMessage>(config: ViewConfig<ParentMessage>) => Html;
|
|
255
344
|
/** Creates a memoized calendar view. Static config is captured in a closure;
|
|
256
345
|
* only `model` and `toParentMessage` are compared per render via `createLazy`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAE7E,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAO5B;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/calendar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,MAAM,IAAI,CAAC,EAAQ,MAAM,QAAQ,CAAA;AAE7E,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,qBAAqB,CAAA;AAO5B;;8EAE8E;AAC9E,eAAO,MAAM,QAAQ,wCAAuC,CAAA;AAC5D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