@pindoba/core-calendar 0.0.0-alpha-20260426220647

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.
Files changed (58) hide show
  1. package/LICENSE +12 -0
  2. package/dist/index.d.ts +7 -0
  3. package/dist/index.js +6 -0
  4. package/dist/src/connect-calendar.d.ts +22 -0
  5. package/dist/src/connect-calendar.d.ts.map +1 -0
  6. package/dist/src/connect-calendar.js +99 -0
  7. package/dist/src/connect-calendar.js.map +1 -0
  8. package/dist/src/correct-today.d.ts +12 -0
  9. package/dist/src/correct-today.d.ts.map +1 -0
  10. package/dist/src/correct-today.js +65 -0
  11. package/dist/src/correct-today.js.map +1 -0
  12. package/dist/src/create-calendar.d.ts +11 -0
  13. package/dist/src/create-calendar.d.ts.map +1 -0
  14. package/dist/src/create-calendar.js +25 -0
  15. package/dist/src/create-calendar.js.map +1 -0
  16. package/dist/src/format-month-year.d.ts +45 -0
  17. package/dist/src/format-month-year.d.ts.map +1 -0
  18. package/dist/src/format-month-year.js +67 -0
  19. package/dist/src/format-month-year.js.map +1 -0
  20. package/dist/src/mount-calendar.d.ts +31 -0
  21. package/dist/src/mount-calendar.d.ts.map +1 -0
  22. package/dist/src/mount-calendar.js +224 -0
  23. package/dist/src/mount-calendar.js.map +1 -0
  24. package/dist/src/types.d.ts +2 -0
  25. package/dist/src/types.js +1 -0
  26. package/dist/types-B2fbdL5n.d.ts +738 -0
  27. package/dist/types-B2fbdL5n.d.ts.map +1 -0
  28. package/dist/types-C07_K9Vw.d.ts +742 -0
  29. package/dist/types-C07_K9Vw.d.ts.map +1 -0
  30. package/dist/types-C16HSMmD.d.ts +736 -0
  31. package/dist/types-C16HSMmD.d.ts.map +1 -0
  32. package/dist/types-C3oj58JZ.d.ts +753 -0
  33. package/dist/types-C3oj58JZ.d.ts.map +1 -0
  34. package/dist/types-C5hQjToP.d.ts +705 -0
  35. package/dist/types-C5hQjToP.d.ts.map +1 -0
  36. package/dist/types-CBLfu1hf.d.ts +734 -0
  37. package/dist/types-CBLfu1hf.d.ts.map +1 -0
  38. package/dist/types-CHT1tNCk.d.ts +750 -0
  39. package/dist/types-CHT1tNCk.d.ts.map +1 -0
  40. package/dist/types-CoFo2Oxk.d.ts +748 -0
  41. package/dist/types-CoFo2Oxk.d.ts.map +1 -0
  42. package/dist/types-CqWt3N8V.d.ts +705 -0
  43. package/dist/types-CqWt3N8V.d.ts.map +1 -0
  44. package/dist/types-CqcnncLn.d.ts +707 -0
  45. package/dist/types-CqcnncLn.d.ts.map +1 -0
  46. package/dist/types-D90SBBOh.d.ts +744 -0
  47. package/dist/types-D90SBBOh.d.ts.map +1 -0
  48. package/dist/types-D_lmDzHp.d.ts +736 -0
  49. package/dist/types-D_lmDzHp.d.ts.map +1 -0
  50. package/dist/types-Dt5Sm8UB.d.ts +737 -0
  51. package/dist/types-Dt5Sm8UB.d.ts.map +1 -0
  52. package/dist/types-IMW4EX3p.d.ts +735 -0
  53. package/dist/types-IMW4EX3p.d.ts.map +1 -0
  54. package/dist/types-TNo79I7x.d.ts +746 -0
  55. package/dist/types-TNo79I7x.d.ts.map +1 -0
  56. package/dist/types-xM9W1J2Z.d.ts +740 -0
  57. package/dist/types-xM9W1J2Z.d.ts.map +1 -0
  58. package/package.json +37 -0
package/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright 2025 Eduardo Lopes
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
8
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
9
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
10
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
11
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
12
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ import { _ as CalendarSlotPassThrough, a as CalendarClasses, b as ConnectCalendarOptions, c as CalendarFeedback, d as CalendarPadding, f as CalendarPassThrough, h as CalendarShadow, i as CalendarBorder, l as CalendarJsInstance, m as CalendarRootProps, n as CalendarBackground, o as CalendarController, p as CalendarRadius, r as CalendarBaseProps, s as CalendarEmphasis, t as CalendarApi, u as CalendarJsOptions, v as CalendarSlotProps, x as ElementAttributes, y as CalendarView } from "./types-C3oj58JZ.js";
2
+ import { calendarDefaults, connectCalendar } from "./src/connect-calendar.js";
3
+ import { createCalendar } from "./src/create-calendar.js";
4
+ import { CalendarSelection, addMonths, formatDay, formatFullDate, formatMonth, formatMonthYear, formatRange, formatSelection, formatYear, toLocalISODate, toUTCDate } from "./src/format-month-year.js";
5
+ import { clearSelectionAttrs, correctTodayAttr, watchToday } from "./src/correct-today.js";
6
+ import { CalendarActions, CalendarMount, MountCalendarOptions, mountCalendar, parseSelection } from "./src/mount-calendar.js";
7
+ export { type CalendarActions, type CalendarApi, type CalendarBackground, type CalendarBaseProps, type CalendarBorder, type CalendarClasses, type CalendarController, type CalendarEmphasis, type CalendarFeedback, type CalendarJsInstance, type CalendarJsOptions, type CalendarMount, type CalendarPadding, type CalendarPassThrough, type CalendarRadius, type CalendarRootProps, type CalendarSelection, type CalendarShadow, type CalendarSlotPassThrough, type CalendarSlotProps, type CalendarView, type ConnectCalendarOptions, type ElementAttributes, type MountCalendarOptions, addMonths, calendarDefaults, clearSelectionAttrs, connectCalendar, correctTodayAttr, createCalendar, formatDay, formatFullDate, formatMonth, formatMonthYear, formatRange, formatSelection, formatYear, mountCalendar, parseSelection, toLocalISODate, toUTCDate, watchToday };
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { calendarDefaults, connectCalendar } from "./src/connect-calendar.js";
2
+ import { createCalendar } from "./src/create-calendar.js";
3
+ import { addMonths, formatDay, formatFullDate, formatMonth, formatMonthYear, formatRange, formatSelection, formatYear, toLocalISODate, toUTCDate } from "./src/format-month-year.js";
4
+ import { clearSelectionAttrs, correctTodayAttr, watchToday } from "./src/correct-today.js";
5
+ import { mountCalendar, parseSelection } from "./src/mount-calendar.js";
6
+ export { addMonths, calendarDefaults, clearSelectionAttrs, connectCalendar, correctTodayAttr, createCalendar, formatDay, formatFullDate, formatMonth, formatMonthYear, formatRange, formatSelection, formatYear, mountCalendar, parseSelection, toLocalISODate, toUTCDate, watchToday };
@@ -0,0 +1,22 @@
1
+ import { b as ConnectCalendarOptions, t as CalendarApi } from "../types-C3oj58JZ.js";
2
+
3
+ //#region src/connect-calendar.d.ts
4
+ declare const calendarDefaults: {
5
+ readonly size: "md";
6
+ readonly background: "surface.soft";
7
+ readonly feedback: "neutral";
8
+ readonly accent: false;
9
+ readonly translucent: false;
10
+ readonly padding: "sm";
11
+ readonly radius: "lg";
12
+ readonly border: "default";
13
+ readonly shadow: "none";
14
+ readonly showControls: true;
15
+ readonly showFooter: true;
16
+ readonly showToday: true;
17
+ readonly showReset: false;
18
+ };
19
+ declare function connectCalendar(options: ConnectCalendarOptions): CalendarApi;
20
+ //#endregion
21
+ export { calendarDefaults, connectCalendar };
22
+ //# sourceMappingURL=connect-calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-calendar.d.ts","names":[],"sources":["../../src/connect-calendar.ts"],"mappings":";;;cASa,gBAAA;EAAA;;;;;;;;;;;;;;iBAgBG,eAAA,CAAgB,OAAA,EAAS,sBAAA,GAAyB,WAAA"}
@@ -0,0 +1,99 @@
1
+ import { css } from "@pindoba/styled-system/css";
2
+ import { connectPanel } from "@pindoba/core-panel";
3
+ import { calendarStyles } from "@pindoba/styles-calendar";
4
+ //#region src/connect-calendar.ts
5
+ const calendarDefaults = {
6
+ size: "md",
7
+ background: "surface.soft",
8
+ feedback: "neutral",
9
+ accent: false,
10
+ translucent: false,
11
+ padding: "sm",
12
+ radius: "lg",
13
+ border: "default",
14
+ shadow: "none",
15
+ showControls: true,
16
+ showFooter: true,
17
+ showToday: true,
18
+ showReset: false
19
+ };
20
+ function connectCalendar(options) {
21
+ const { size = calendarDefaults.size, background = calendarDefaults.background, feedback = calendarDefaults.feedback, emphasis, accent = calendarDefaults.accent, translucent = calendarDefaults.translucent, padding = calendarDefaults.padding, radius = calendarDefaults.radius, border = calendarDefaults.border, shadow = calendarDefaults.shadow, showControls = calendarDefaults.showControls, showFooter = calendarDefaults.showFooter, showToday = calendarDefaults.showToday, showReset = calendarDefaults.showReset, locale, passThrough, class: className, options: _calendarJsOptions, id: _id, ...restProps } = options;
22
+ const slotClasses = calendarStyles.raw({ size });
23
+ const panelApi = connectPanel({
24
+ dataComponent: "calendar",
25
+ background,
26
+ feedback,
27
+ emphasis,
28
+ accent,
29
+ translucent,
30
+ padding,
31
+ radius,
32
+ border,
33
+ shadow,
34
+ passThrough: { root: {
35
+ style: css.raw(slotClasses.root, passThrough?.root?.style),
36
+ props: passThrough?.root?.props
37
+ } },
38
+ class: className,
39
+ ...restProps
40
+ });
41
+ const headerClass = css(slotClasses.header, passThrough?.header?.style);
42
+ const labelsClass = css(slotClasses.labels, passThrough?.labels?.style);
43
+ const navClass = css(slotClasses.nav, passThrough?.nav?.style);
44
+ const bodyClass = css(slotClasses.body, passThrough?.body?.style);
45
+ const footerClass = css(slotClasses.footer, passThrough?.footer?.style);
46
+ const labelClass = css(slotClasses.label, passThrough?.label?.style);
47
+ return {
48
+ rootProps: panelApi.rootProps,
49
+ headerProps: {
50
+ class: headerClass,
51
+ "data-calendar-slot": "header",
52
+ ...passThrough?.header?.props
53
+ },
54
+ labelsProps: {
55
+ class: labelsClass,
56
+ "data-calendar-slot": "labels",
57
+ ...passThrough?.labels?.props
58
+ },
59
+ navProps: {
60
+ class: navClass,
61
+ "data-calendar-slot": "nav",
62
+ ...passThrough?.nav?.props
63
+ },
64
+ bodyProps: {
65
+ class: bodyClass,
66
+ "data-calendar-slot": "body",
67
+ "data-calendar-container": "",
68
+ ...passThrough?.body?.props
69
+ },
70
+ footerProps: {
71
+ class: footerClass,
72
+ "data-calendar-slot": "footer",
73
+ ...passThrough?.footer?.props
74
+ },
75
+ labelProps: {
76
+ class: labelClass,
77
+ "data-calendar-slot": "label",
78
+ ...passThrough?.label?.props
79
+ },
80
+ classes: {
81
+ root: panelApi.rootProps.class,
82
+ header: headerClass,
83
+ labels: labelsClass,
84
+ nav: navClass,
85
+ body: bodyClass,
86
+ footer: footerClass,
87
+ label: labelClass
88
+ },
89
+ showControls,
90
+ showFooter,
91
+ showToday,
92
+ showReset,
93
+ locale
94
+ };
95
+ }
96
+ //#endregion
97
+ export { calendarDefaults, connectCalendar };
98
+
99
+ //# sourceMappingURL=connect-calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-calendar.js","names":[],"sources":["../../src/connect-calendar.ts"],"sourcesContent":["import { css } from \"@pindoba/styled-system/css\";\nimport { connectPanel } from \"@pindoba/core-panel\";\nimport { calendarStyles } from \"@pindoba/styles-calendar\";\nimport type {\n CalendarApi,\n CalendarBaseProps,\n ConnectCalendarOptions,\n} from \"./types.js\";\n\nexport const calendarDefaults = {\n size: \"md\",\n background: \"surface.soft\",\n feedback: \"neutral\",\n accent: false,\n translucent: false,\n padding: \"sm\",\n radius: \"lg\",\n border: \"default\",\n shadow: \"none\",\n showControls: true,\n showFooter: true,\n showToday: true,\n showReset: false,\n} as const satisfies Partial<CalendarBaseProps>;\n\nexport function connectCalendar(options: ConnectCalendarOptions): CalendarApi {\n const {\n size = calendarDefaults.size,\n background = calendarDefaults.background,\n feedback = calendarDefaults.feedback,\n emphasis,\n accent = calendarDefaults.accent,\n translucent = calendarDefaults.translucent,\n padding = calendarDefaults.padding,\n radius = calendarDefaults.radius,\n border = calendarDefaults.border,\n shadow = calendarDefaults.shadow,\n showControls = calendarDefaults.showControls,\n showFooter = calendarDefaults.showFooter,\n showToday = calendarDefaults.showToday,\n showReset = calendarDefaults.showReset,\n locale,\n passThrough,\n class: className,\n // options (calendar.js config) is passed through by the framework wrapper,\n // not by this connector.\n options: _calendarJsOptions,\n id: _id,\n ...restProps\n } = options;\n\n const slotClasses = calendarStyles.raw({ size });\n\n const panelApi = connectPanel({\n dataComponent: \"calendar\",\n background,\n feedback,\n emphasis,\n accent,\n translucent,\n padding,\n radius,\n border,\n shadow,\n passThrough: {\n root: {\n style: css.raw(slotClasses.root, passThrough?.root?.style),\n props: passThrough?.root?.props,\n },\n },\n class: className,\n ...restProps,\n });\n\n const headerClass = css(slotClasses.header, passThrough?.header?.style);\n const labelsClass = css(slotClasses.labels, passThrough?.labels?.style);\n const navClass = css(slotClasses.nav, passThrough?.nav?.style);\n const bodyClass = css(slotClasses.body, passThrough?.body?.style);\n const footerClass = css(slotClasses.footer, passThrough?.footer?.style);\n const labelClass = css(slotClasses.label, passThrough?.label?.style);\n\n return {\n rootProps: panelApi.rootProps as CalendarApi[\"rootProps\"],\n headerProps: {\n class: headerClass,\n \"data-calendar-slot\": \"header\",\n ...passThrough?.header?.props,\n },\n labelsProps: {\n class: labelsClass,\n \"data-calendar-slot\": \"labels\",\n ...passThrough?.labels?.props,\n },\n navProps: {\n class: navClass,\n \"data-calendar-slot\": \"nav\",\n ...passThrough?.nav?.props,\n },\n bodyProps: {\n class: bodyClass,\n \"data-calendar-slot\": \"body\",\n \"data-calendar-container\": \"\",\n ...passThrough?.body?.props,\n },\n footerProps: {\n class: footerClass,\n \"data-calendar-slot\": \"footer\",\n ...passThrough?.footer?.props,\n },\n labelProps: {\n class: labelClass,\n \"data-calendar-slot\": \"label\",\n ...passThrough?.label?.props,\n },\n classes: {\n root: panelApi.rootProps.class,\n header: headerClass,\n labels: labelsClass,\n nav: navClass,\n body: bodyClass,\n footer: footerClass,\n label: labelClass,\n },\n showControls,\n showFooter,\n showToday,\n showReset,\n locale,\n };\n}\n"],"mappings":";;;;AASA,MAAa,mBAAmB;CAC9B,MAAM;CACN,YAAY;CACZ,UAAU;CACV,QAAQ;CACR,aAAa;CACb,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,cAAc;CACd,YAAY;CACZ,WAAW;CACX,WAAW;CACZ;AAED,SAAgB,gBAAgB,SAA8C;CAC5E,MAAM,EACJ,OAAO,iBAAiB,MACxB,aAAa,iBAAiB,YAC9B,WAAW,iBAAiB,UAC5B,UACA,SAAS,iBAAiB,QAC1B,cAAc,iBAAiB,aAC/B,UAAU,iBAAiB,SAC3B,SAAS,iBAAiB,QAC1B,SAAS,iBAAiB,QAC1B,SAAS,iBAAiB,QAC1B,eAAe,iBAAiB,cAChC,aAAa,iBAAiB,YAC9B,YAAY,iBAAiB,WAC7B,YAAY,iBAAiB,WAC7B,QACA,aACA,OAAO,WAGP,SAAS,oBACT,IAAI,KACJ,GAAG,cACD;CAEJ,MAAM,cAAc,eAAe,IAAI,EAAE,MAAM,CAAC;CAEhD,MAAM,WAAW,aAAa;EAC5B,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,EACX,MAAM;GACJ,OAAO,IAAI,IAAI,YAAY,MAAM,aAAa,MAAM,MAAM;GAC1D,OAAO,aAAa,MAAM;GAC3B,EACF;EACD,OAAO;EACP,GAAG;EACJ,CAAC;CAEF,MAAM,cAAc,IAAI,YAAY,QAAQ,aAAa,QAAQ,MAAM;CACvE,MAAM,cAAc,IAAI,YAAY,QAAQ,aAAa,QAAQ,MAAM;CACvE,MAAM,WAAW,IAAI,YAAY,KAAK,aAAa,KAAK,MAAM;CAC9D,MAAM,YAAY,IAAI,YAAY,MAAM,aAAa,MAAM,MAAM;CACjE,MAAM,cAAc,IAAI,YAAY,QAAQ,aAAa,QAAQ,MAAM;CACvE,MAAM,aAAa,IAAI,YAAY,OAAO,aAAa,OAAO,MAAM;AAEpE,QAAO;EACL,WAAW,SAAS;EACpB,aAAa;GACX,OAAO;GACP,sBAAsB;GACtB,GAAG,aAAa,QAAQ;GACzB;EACD,aAAa;GACX,OAAO;GACP,sBAAsB;GACtB,GAAG,aAAa,QAAQ;GACzB;EACD,UAAU;GACR,OAAO;GACP,sBAAsB;GACtB,GAAG,aAAa,KAAK;GACtB;EACD,WAAW;GACT,OAAO;GACP,sBAAsB;GACtB,2BAA2B;GAC3B,GAAG,aAAa,MAAM;GACvB;EACD,aAAa;GACX,OAAO;GACP,sBAAsB;GACtB,GAAG,aAAa,QAAQ;GACzB;EACD,YAAY;GACV,OAAO;GACP,sBAAsB;GACtB,GAAG,aAAa,OAAO;GACxB;EACD,SAAS;GACP,MAAM,SAAS,UAAU;GACzB,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,MAAM;GACN,QAAQ;GACR,OAAO;GACR;EACD;EACA;EACA;EACA;EACA;EACD"}
@@ -0,0 +1,12 @@
1
+ //#region src/correct-today.d.ts
2
+ interface WatchTodayOptions {
3
+ getVisibleDate?: () => Date;
4
+ getSelectedValue?: () => string | number | unknown[] | null;
5
+ }
6
+ declare function stripPhantomSelection(body: HTMLElement, getSelectedValue?: () => string | number | unknown[] | null | undefined): void;
7
+ declare function correctTodayAttr(body: HTMLElement, opts?: WatchTodayOptions): void;
8
+ declare function watchToday(body: HTMLElement, opts?: WatchTodayOptions): () => void;
9
+ declare function clearSelectionAttrs(body: HTMLElement): void;
10
+ //#endregion
11
+ export { WatchTodayOptions, clearSelectionAttrs, correctTodayAttr, stripPhantomSelection, watchToday };
12
+ //# sourceMappingURL=correct-today.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correct-today.d.ts","names":[],"sources":["../../src/correct-today.ts"],"mappings":";UAAiB,iBAAA;EAKf,cAAA,SAAuB,IAAA;EAIvB,gBAAA;AAAA;AAAA,iBAWc,qBAAA,CACd,IAAA,EAAM,WAAA,EACN,gBAAA;AAAA,iBAqBc,gBAAA,CACd,IAAA,EAAM,WAAA,EACN,IAAA,GAAM,iBAAA;AAAA,iBAuCQ,UAAA,CACd,IAAA,EAAM,WAAA,EACN,IAAA,GAAM,iBAAA;AAAA,iBAwCQ,mBAAA,CAAoB,IAAA,EAAM,WAAA"}
@@ -0,0 +1,65 @@
1
+ //#region src/correct-today.ts
2
+ function hasRealSelection(val) {
3
+ if (val === null || val === void 0 || val === "") return false;
4
+ if (Array.isArray(val) && val.length === 0) return false;
5
+ return true;
6
+ }
7
+ function stripPhantomSelection(body, getSelectedValue) {
8
+ if (!getSelectedValue) return;
9
+ if (hasRealSelection(getSelectedValue())) return;
10
+ body.querySelectorAll(".lm-calendar-content > div[data-selected='true']").forEach((el) => el.removeAttribute("data-selected"));
11
+ }
12
+ function correctTodayAttr(body, opts = {}) {
13
+ const view = body.querySelector(".lm-calendar-container[data-view]")?.getAttribute("data-view") ?? "days";
14
+ stripPhantomSelection(body, opts.getSelectedValue);
15
+ body.querySelectorAll(".lm-calendar-content > div[data-today='true']").forEach((c) => c.removeAttribute("data-today"));
16
+ if (view !== "days") return;
17
+ const today = /* @__PURE__ */ new Date();
18
+ const visible = opts.getVisibleDate?.();
19
+ if (visible && (visible.getFullYear() !== today.getFullYear() || visible.getMonth() !== today.getMonth())) return;
20
+ const todayDay = String(today.getDate());
21
+ const match = Array.from(body.querySelectorAll(".lm-calendar-content > div")).find((el) => el.getAttribute("data-grey") !== "true" && el.textContent?.trim() === todayDay);
22
+ if (match) match.setAttribute("data-today", "true");
23
+ }
24
+ function watchToday(body, opts = {}) {
25
+ correctTodayAttr(body, opts);
26
+ let scheduled = false;
27
+ const run = () => {
28
+ if (scheduled) return;
29
+ scheduled = true;
30
+ queueMicrotask(() => {
31
+ scheduled = false;
32
+ correctTodayAttr(body, opts);
33
+ });
34
+ };
35
+ const observer = new MutationObserver(run);
36
+ observer.observe(body, {
37
+ childList: true,
38
+ subtree: true,
39
+ characterData: true,
40
+ attributes: true,
41
+ attributeFilter: [
42
+ "data-selected",
43
+ "data-grey",
44
+ "data-start",
45
+ "data-end",
46
+ "data-range",
47
+ "data-view"
48
+ ]
49
+ });
50
+ return () => observer.disconnect();
51
+ }
52
+ function clearSelectionAttrs(body) {
53
+ const attrs = [
54
+ "data-selected",
55
+ "data-start",
56
+ "data-end",
57
+ "data-range",
58
+ "data-last"
59
+ ];
60
+ body.querySelectorAll(".lm-calendar-content > div").forEach((el) => attrs.forEach((a) => el.removeAttribute(a)));
61
+ }
62
+ //#endregion
63
+ export { clearSelectionAttrs, correctTodayAttr, stripPhantomSelection, watchToday };
64
+
65
+ //# sourceMappingURL=correct-today.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correct-today.js","names":[],"sources":["../../src/correct-today.ts"],"sourcesContent":["export interface WatchTodayOptions {\n // Returns the month/year currently visible in the calendar. When provided,\n // today is only marked if it falls in that visible month. Without it we\n // fall back to \"always mark the matching day number\", which is correct for\n // the initial view but over-matches after navigation.\n getVisibleDate?: () => Date;\n // Returns the calendar's current value (what instance.getValue() returns).\n // When empty / null, calendar.js's auto-selection of the cursor cell is\n // phantom — nothing has actually been selected — so we strip data-selected.\n getSelectedValue?: () => string | number | unknown[] | null;\n}\n\nfunction hasRealSelection(\n val: string | number | unknown[] | null | undefined,\n): boolean {\n if (val === null || val === undefined || val === \"\") return false;\n if (Array.isArray(val) && val.length === 0) return false;\n return true;\n}\n\nexport function stripPhantomSelection(\n body: HTMLElement,\n getSelectedValue?: () => string | number | unknown[] | null | undefined,\n): void {\n if (!getSelectedValue) return;\n if (hasRealSelection(getSelectedValue())) return;\n body\n .querySelectorAll<HTMLElement>(\n \".lm-calendar-content > div[data-selected='true']\",\n )\n .forEach((el) => el.removeAttribute(\"data-selected\"));\n}\n\n// calendar.js has a timezone bug: its `isToday` check compares local getters\n// against a UTC-offset-adjusted Date, so in timezones offset from UTC the\n// `data-today=\"true\"` attribute lands on the wrong cell. We correct it\n// post-render by re-applying the flag to the cell whose day text matches the\n// user's local today, gated on the visible month matching local today.\n//\n// Separately, calendar.js always initializes its cursor to today and marks\n// that cell as data-selected on mount — even when nothing has been selected.\n// Strip that phantom data-selected so the cell reads as \"today (ring)\" rather\n// than \"selected (filled)\" until the user actually picks a date.\nexport function correctTodayAttr(\n body: HTMLElement,\n opts: WatchTodayOptions = {},\n): void {\n const container = body.querySelector<HTMLElement>(\n \".lm-calendar-container[data-view]\",\n );\n const view = container?.getAttribute(\"data-view\") ?? \"days\";\n\n stripPhantomSelection(body, opts.getSelectedValue);\n\n const cells = body.querySelectorAll<HTMLElement>(\n \".lm-calendar-content > div[data-today='true']\",\n );\n cells.forEach((c) => c.removeAttribute(\"data-today\"));\n\n if (view !== \"days\") return;\n\n const today = new Date();\n const visible = opts.getVisibleDate?.();\n if (\n visible &&\n (visible.getFullYear() !== today.getFullYear() ||\n visible.getMonth() !== today.getMonth())\n ) {\n return;\n }\n\n const todayDay = String(today.getDate());\n const all = Array.from(\n body.querySelectorAll<HTMLElement>(\".lm-calendar-content > div\"),\n );\n // data-grey=\"true\" marks leading/trailing cells (previous/next month).\n const match = all.find(\n (el) =>\n el.getAttribute(\"data-grey\") !== \"true\" &&\n el.textContent?.trim() === todayDay,\n );\n if (match) match.setAttribute(\"data-today\", \"true\");\n}\n\nexport function watchToday(\n body: HTMLElement,\n opts: WatchTodayOptions = {},\n): () => void {\n correctTodayAttr(body, opts);\n let scheduled = false;\n const run = () => {\n if (scheduled) return;\n scheduled = true;\n queueMicrotask(() => {\n scheduled = false;\n correctTodayAttr(body, opts);\n });\n };\n // Observe every mutation type calendar.js performs: it re-uses the same 42\n // day cells across month navigations, mutating text (`characterData` on the\n // text node, or childList when a node replaces it) and bound attributes\n // (`data-selected`, `data-grey`, etc.). Without characterData + attributes\n // the observer misses re-renders and stale data-today / data-selected\n // carry over to the wrong cell.\n const observer = new MutationObserver(run);\n observer.observe(body, {\n childList: true,\n subtree: true,\n characterData: true,\n attributes: true,\n attributeFilter: [\n \"data-selected\",\n \"data-grey\",\n \"data-start\",\n \"data-end\",\n \"data-range\",\n \"data-view\",\n ],\n });\n return () => observer.disconnect();\n}\n\n// calendar.js's reset() / setValue('') falls back to `new Date()` and marks\n// today as the cursor, leaving it visually \"selected\". Call this after reset\n// to strip selection/range flags from every cell so the calendar reads as\n// truly cleared.\nexport function clearSelectionAttrs(body: HTMLElement): void {\n const attrs = [\n \"data-selected\",\n \"data-start\",\n \"data-end\",\n \"data-range\",\n \"data-last\",\n ];\n const cells = body.querySelectorAll<HTMLElement>(\n \".lm-calendar-content > div\",\n );\n cells.forEach((el) => attrs.forEach((a) => el.removeAttribute(a)));\n}\n"],"mappings":";AAYA,SAAS,iBACP,KACS;AACT,KAAI,QAAQ,QAAQ,QAAQ,KAAA,KAAa,QAAQ,GAAI,QAAO;AAC5D,KAAI,MAAM,QAAQ,IAAI,IAAI,IAAI,WAAW,EAAG,QAAO;AACnD,QAAO;;AAGT,SAAgB,sBACd,MACA,kBACM;AACN,KAAI,CAAC,iBAAkB;AACvB,KAAI,iBAAiB,kBAAkB,CAAC,CAAE;AAC1C,MACG,iBACC,mDACD,CACA,SAAS,OAAO,GAAG,gBAAgB,gBAAgB,CAAC;;AAazD,SAAgB,iBACd,MACA,OAA0B,EAAE,EACtB;CAIN,MAAM,OAHY,KAAK,cACrB,oCAEoB,EAAE,aAAa,YAAY,IAAI;AAErD,uBAAsB,MAAM,KAAK,iBAAiB;AAEpC,MAAK,iBACjB,gDAEG,CAAC,SAAS,MAAM,EAAE,gBAAgB,aAAa,CAAC;AAErD,KAAI,SAAS,OAAQ;CAErB,MAAM,wBAAQ,IAAI,MAAM;CACxB,MAAM,UAAU,KAAK,kBAAkB;AACvC,KACE,YACC,QAAQ,aAAa,KAAK,MAAM,aAAa,IAC5C,QAAQ,UAAU,KAAK,MAAM,UAAU,EAEzC;CAGF,MAAM,WAAW,OAAO,MAAM,SAAS,CAAC;CAKxC,MAAM,QAJM,MAAM,KAChB,KAAK,iBAA8B,6BAA6B,CAGjD,CAAC,MACf,OACC,GAAG,aAAa,YAAY,KAAK,UACjC,GAAG,aAAa,MAAM,KAAK,SAC9B;AACD,KAAI,MAAO,OAAM,aAAa,cAAc,OAAO;;AAGrD,SAAgB,WACd,MACA,OAA0B,EAAE,EAChB;AACZ,kBAAiB,MAAM,KAAK;CAC5B,IAAI,YAAY;CAChB,MAAM,YAAY;AAChB,MAAI,UAAW;AACf,cAAY;AACZ,uBAAqB;AACnB,eAAY;AACZ,oBAAiB,MAAM,KAAK;IAC5B;;CAQJ,MAAM,WAAW,IAAI,iBAAiB,IAAI;AAC1C,UAAS,QAAQ,MAAM;EACrB,WAAW;EACX,SAAS;EACT,eAAe;EACf,YAAY;EACZ,iBAAiB;GACf;GACA;GACA;GACA;GACA;GACA;GACD;EACF,CAAC;AACF,cAAa,SAAS,YAAY;;AAOpC,SAAgB,oBAAoB,MAAyB;CAC3D,MAAM,QAAQ;EACZ;EACA;EACA;EACA;EACA;EACD;AACa,MAAK,iBACjB,6BAEG,CAAC,SAAS,OAAO,MAAM,SAAS,MAAM,GAAG,gBAAgB,EAAE,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { o as CalendarController, u as CalendarJsOptions } from "../types-C3oj58JZ.js";
2
+ //#region src/create-calendar.d.ts
3
+ /**
4
+ * Instantiate @calendarjs/ce against a container element and return the live
5
+ * instance plus a teardown helper. Intended to be called from the client only
6
+ * (Astro + Svelte wrappers call it after hydration).
7
+ */
8
+ declare function createCalendar(element: HTMLElement, options?: CalendarJsOptions): CalendarController;
9
+ //#endregion
10
+ export { createCalendar };
11
+ //# sourceMappingURL=create-calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-calendar.d.ts","names":[],"sources":["../../src/create-calendar.ts"],"mappings":";;;;AAaA;;;iBAAgB,cAAA,CACd,OAAA,EAAS,WAAA,EACT,OAAA,GAAS,iBAAA,GACR,kBAAA"}
@@ -0,0 +1,25 @@
1
+ import calendarjs from "@calendarjs/ce";
2
+ import "@calendarjs/ce/dist/style.css";
3
+ //#region src/create-calendar.ts
4
+ /**
5
+ * Instantiate @calendarjs/ce against a container element and return the live
6
+ * instance plus a teardown helper. Intended to be called from the client only
7
+ * (Astro + Svelte wrappers call it after hydration).
8
+ */
9
+ function createCalendar(element, options = {}) {
10
+ const instance = calendarjs.Calendar(element, options);
11
+ const destroy = () => {
12
+ try {
13
+ instance.close?.();
14
+ } catch {}
15
+ while (element.firstChild) element.removeChild(element.firstChild);
16
+ };
17
+ return {
18
+ instance,
19
+ destroy
20
+ };
21
+ }
22
+ //#endregion
23
+ export { createCalendar };
24
+
25
+ //# sourceMappingURL=create-calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-calendar.js","names":[],"sources":["../../src/create-calendar.ts"],"sourcesContent":["import calendarjs from \"@calendarjs/ce\";\nimport \"@calendarjs/ce/dist/style.css\";\nimport type {\n CalendarController,\n CalendarJsInstance,\n CalendarJsOptions,\n} from \"./types.js\";\n\n/**\n * Instantiate @calendarjs/ce against a container element and return the live\n * instance plus a teardown helper. Intended to be called from the client only\n * (Astro + Svelte wrappers call it after hydration).\n */\nexport function createCalendar(\n element: HTMLElement,\n options: CalendarJsOptions = {},\n): CalendarController {\n const instance = calendarjs.Calendar(\n element,\n options as Parameters<typeof calendarjs.Calendar>[1],\n ) as CalendarJsInstance;\n\n const destroy = () => {\n try {\n instance.close?.();\n } catch {\n /* ignore */\n }\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n };\n\n return { instance, destroy };\n}\n"],"mappings":";;;;;;;;AAaA,SAAgB,eACd,SACA,UAA6B,EAAE,EACX;CACpB,MAAM,WAAW,WAAW,SAC1B,SACA,QACD;CAED,MAAM,gBAAgB;AACpB,MAAI;AACF,YAAS,SAAS;UACZ;AAGR,SAAO,QAAQ,WACb,SAAQ,YAAY,QAAQ,WAAW;;AAI3C,QAAO;EAAE;EAAU;EAAS"}
@@ -0,0 +1,45 @@
1
+ //#region src/format-month-year.d.ts
2
+ /** Format the day-of-month portion (e.g. "14") of a date in the given locale. */
3
+ declare function formatDay(date: Date, locale?: string): string;
4
+ /** Format the month portion (e.g. "April") of a date in the given locale. */
5
+ declare function formatMonth(date: Date, locale?: string): string;
6
+ /** Format the year portion (e.g. "2026") of a date in the given locale. */
7
+ declare function formatYear(date: Date, locale?: string): string;
8
+ /** Format a date as "Month YYYY" in the given locale. */
9
+ declare function formatMonthYear(date: Date, locale?: string): string;
10
+ /** Add months to a date, returning a new Date (does not mutate). */
11
+ declare function addMonths(date: Date, delta: number): Date;
12
+ declare function toUTCDate(date?: Date): Date;
13
+ declare function toLocalISODate(date?: Date): string;
14
+ /**
15
+ * Normalized calendar selection: either nothing is selected, a single date,
16
+ * or a start/end range. calendar.js stores the raw selection as a string or
17
+ * a `[startIso, endIso]` array on `instance.value`; consumers should never
18
+ * have to parse that shape themselves.
19
+ */
20
+ type CalendarSelection = null | {
21
+ kind: "single";
22
+ date: Date;
23
+ } | {
24
+ kind: "range";
25
+ start: Date;
26
+ end: Date;
27
+ };
28
+ /** Format a full date like "April 14, 2026" in the given locale. */
29
+ declare function formatFullDate(date: Date, locale?: string): string;
30
+ /**
31
+ * Format a date range using Intl.DateTimeFormat.prototype.formatRange(),
32
+ * which natively collapses same-month / cross-month / cross-year ranges
33
+ * and respects the locale.
34
+ */
35
+ declare function formatRange(start: Date, end: Date, locale?: string): string;
36
+ /**
37
+ * Produce the selection-summary label. Returns an empty string when there
38
+ * is no selection — the calling component should keep a separate always-on
39
+ * label for navigation context (focused month/year), and render the result
40
+ * of this call only when it is non-empty.
41
+ */
42
+ declare function formatSelection(selection: CalendarSelection, locale?: string): string;
43
+ //#endregion
44
+ export { CalendarSelection, addMonths, formatDay, formatFullDate, formatMonth, formatMonthYear, formatRange, formatSelection, formatYear, toLocalISODate, toUTCDate };
45
+ //# sourceMappingURL=format-month-year.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-month-year.d.ts","names":[],"sources":["../../src/format-month-year.ts"],"mappings":";;iBACgB,SAAA,CAAU,IAAA,EAAM,IAAA,EAAM,MAAA;;iBAKtB,WAAA,CAAY,IAAA,EAAM,IAAA,EAAM,MAAA;;iBAKxB,UAAA,CAAW,IAAA,EAAM,IAAA,EAAM,MAAA;;iBAKvB,eAAA,CAAgB,IAAA,EAAM,IAAA,EAAM,MAAA;;iBAQ5B,SAAA,CAAU,IAAA,EAAM,IAAA,EAAM,KAAA,WAAgB,IAAA;AAAA,iBAUtC,SAAA,CAAU,IAAA,GAAM,IAAA,GAAoB,IAAA;AAAA,iBAUpC,cAAA,CAAe,IAAA,GAAM,IAAA;;;;;;;KAazB,iBAAA;EAEN,IAAA;EAAgB,IAAA,EAAM,IAAA;AAAA;EACtB,IAAA;EAAe,KAAA,EAAO,IAAA;EAAM,GAAA,EAAK,IAAA;AAAA;;iBAGvB,cAAA,CAAe,IAAA,EAAM,IAAA,EAAM,MAAA;AA/C3C;;;;;AAAA,iBA4DgB,WAAA,CAAY,KAAA,EAAO,IAAA,EAAM,GAAA,EAAK,IAAA,EAAM,MAAA;;;;AApDpD;;;iBAmEgB,eAAA,CACd,SAAA,EAAW,iBAAA,EACX,MAAA"}
@@ -0,0 +1,67 @@
1
+ //#region src/format-month-year.ts
2
+ /** Format the day-of-month portion (e.g. "14") of a date in the given locale. */
3
+ function formatDay(date, locale) {
4
+ return new Intl.DateTimeFormat(locale, { day: "numeric" }).format(date);
5
+ }
6
+ /** Format the month portion (e.g. "April") of a date in the given locale. */
7
+ function formatMonth(date, locale) {
8
+ return new Intl.DateTimeFormat(locale, { month: "long" }).format(date);
9
+ }
10
+ /** Format the year portion (e.g. "2026") of a date in the given locale. */
11
+ function formatYear(date, locale) {
12
+ return new Intl.DateTimeFormat(locale, { year: "numeric" }).format(date);
13
+ }
14
+ /** Format a date as "Month YYYY" in the given locale. */
15
+ function formatMonthYear(date, locale) {
16
+ return new Intl.DateTimeFormat(locale, {
17
+ month: "long",
18
+ year: "numeric"
19
+ }).format(date);
20
+ }
21
+ /** Add months to a date, returning a new Date (does not mutate). */
22
+ function addMonths(date, delta) {
23
+ const next = new Date(date.getTime());
24
+ next.setMonth(next.getMonth() + delta);
25
+ return next;
26
+ }
27
+ function toUTCDate(date = /* @__PURE__ */ new Date()) {
28
+ return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
29
+ }
30
+ function toLocalISODate(date = /* @__PURE__ */ new Date()) {
31
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
32
+ }
33
+ /** Format a full date like "April 14, 2026" in the given locale. */
34
+ function formatFullDate(date, locale) {
35
+ return new Intl.DateTimeFormat(locale, {
36
+ year: "numeric",
37
+ month: "long",
38
+ day: "numeric"
39
+ }).format(date);
40
+ }
41
+ /**
42
+ * Format a date range using Intl.DateTimeFormat.prototype.formatRange(),
43
+ * which natively collapses same-month / cross-month / cross-year ranges
44
+ * and respects the locale.
45
+ */
46
+ function formatRange(start, end, locale) {
47
+ return new Intl.DateTimeFormat(locale, {
48
+ year: "numeric",
49
+ month: "long",
50
+ day: "numeric"
51
+ }).formatRange(start, end);
52
+ }
53
+ /**
54
+ * Produce the selection-summary label. Returns an empty string when there
55
+ * is no selection — the calling component should keep a separate always-on
56
+ * label for navigation context (focused month/year), and render the result
57
+ * of this call only when it is non-empty.
58
+ */
59
+ function formatSelection(selection, locale) {
60
+ if (selection === null) return "";
61
+ if (selection.kind === "single") return formatFullDate(selection.date, locale);
62
+ return formatRange(selection.start, selection.end, locale);
63
+ }
64
+ //#endregion
65
+ export { addMonths, formatDay, formatFullDate, formatMonth, formatMonthYear, formatRange, formatSelection, formatYear, toLocalISODate, toUTCDate };
66
+
67
+ //# sourceMappingURL=format-month-year.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-month-year.js","names":[],"sources":["../../src/format-month-year.ts"],"sourcesContent":["/** Format the day-of-month portion (e.g. \"14\") of a date in the given locale. */\nexport function formatDay(date: Date, locale?: string): string {\n return new Intl.DateTimeFormat(locale, { day: \"numeric\" }).format(date);\n}\n\n/** Format the month portion (e.g. \"April\") of a date in the given locale. */\nexport function formatMonth(date: Date, locale?: string): string {\n return new Intl.DateTimeFormat(locale, { month: \"long\" }).format(date);\n}\n\n/** Format the year portion (e.g. \"2026\") of a date in the given locale. */\nexport function formatYear(date: Date, locale?: string): string {\n return new Intl.DateTimeFormat(locale, { year: \"numeric\" }).format(date);\n}\n\n/** Format a date as \"Month YYYY\" in the given locale. */\nexport function formatMonthYear(date: Date, locale?: string): string {\n return new Intl.DateTimeFormat(locale, {\n month: \"long\",\n year: \"numeric\",\n }).format(date);\n}\n\n/** Add months to a date, returning a new Date (does not mutate). */\nexport function addMonths(date: Date, delta: number): Date {\n const next = new Date(date.getTime());\n next.setMonth(next.getMonth() + delta);\n return next;\n}\n\n// calendar.js reads dates via UTC getters (getUTCFullYear/Month/Date) and ISO\n// strings, so a plain `new Date()` in timezones offset from UTC can resolve to\n// the wrong calendar day. Wrap the local date into a Date whose *UTC* fields\n// match the user's local Y/M/D, so calendar.js renders the correct \"today\".\nexport function toUTCDate(date: Date = new Date()): Date {\n return new Date(\n Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()),\n );\n}\n\n// calendar.js's setValue does `new Date(v + ' GMT+0')`, which stringifies a\n// Date using LOCAL time and then mis-parses it — so Date arguments land on the\n// wrong day in offset timezones. Passing an ISO date string (YYYY-MM-DD) makes\n// that concat parse cleanly as UTC midnight, giving the selection we intended.\nexport function toLocalISODate(date: Date = new Date()): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, \"0\");\n const d = String(date.getDate()).padStart(2, \"0\");\n return `${y}-${m}-${d}`;\n}\n\n/**\n * Normalized calendar selection: either nothing is selected, a single date,\n * or a start/end range. calendar.js stores the raw selection as a string or\n * a `[startIso, endIso]` array on `instance.value`; consumers should never\n * have to parse that shape themselves.\n */\nexport type CalendarSelection =\n | null\n | { kind: \"single\"; date: Date }\n | { kind: \"range\"; start: Date; end: Date };\n\n/** Format a full date like \"April 14, 2026\" in the given locale. */\nexport function formatFullDate(date: Date, locale?: string): string {\n return new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n }).format(date);\n}\n\n/**\n * Format a date range using Intl.DateTimeFormat.prototype.formatRange(),\n * which natively collapses same-month / cross-month / cross-year ranges\n * and respects the locale.\n */\nexport function formatRange(start: Date, end: Date, locale?: string): string {\n const formatter = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n });\n return formatter.formatRange(start, end);\n}\n\n/**\n * Produce the selection-summary label. Returns an empty string when there\n * is no selection — the calling component should keep a separate always-on\n * label for navigation context (focused month/year), and render the result\n * of this call only when it is non-empty.\n */\nexport function formatSelection(\n selection: CalendarSelection,\n locale?: string,\n): string {\n if (selection === null) return \"\";\n if (selection.kind === \"single\")\n return formatFullDate(selection.date, locale);\n return formatRange(selection.start, selection.end, locale);\n}\n"],"mappings":";;AACA,SAAgB,UAAU,MAAY,QAAyB;AAC7D,QAAO,IAAI,KAAK,eAAe,QAAQ,EAAE,KAAK,WAAW,CAAC,CAAC,OAAO,KAAK;;;AAIzE,SAAgB,YAAY,MAAY,QAAyB;AAC/D,QAAO,IAAI,KAAK,eAAe,QAAQ,EAAE,OAAO,QAAQ,CAAC,CAAC,OAAO,KAAK;;;AAIxE,SAAgB,WAAW,MAAY,QAAyB;AAC9D,QAAO,IAAI,KAAK,eAAe,QAAQ,EAAE,MAAM,WAAW,CAAC,CAAC,OAAO,KAAK;;;AAI1E,SAAgB,gBAAgB,MAAY,QAAyB;AACnE,QAAO,IAAI,KAAK,eAAe,QAAQ;EACrC,OAAO;EACP,MAAM;EACP,CAAC,CAAC,OAAO,KAAK;;;AAIjB,SAAgB,UAAU,MAAY,OAAqB;CACzD,MAAM,OAAO,IAAI,KAAK,KAAK,SAAS,CAAC;AACrC,MAAK,SAAS,KAAK,UAAU,GAAG,MAAM;AACtC,QAAO;;AAOT,SAAgB,UAAU,uBAAa,IAAI,MAAM,EAAQ;AACvD,QAAO,IAAI,KACT,KAAK,IAAI,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,CAAC,CAC9D;;AAOH,SAAgB,eAAe,uBAAa,IAAI,MAAM,EAAU;AAI9D,QAAO,GAHG,KAAK,aAGJ,CAAC,GAFF,OAAO,KAAK,UAAU,GAAG,EAAE,CAAC,SAAS,GAAG,IAElC,CAAC,GADP,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS,GAAG,IACxB;;;AAevB,SAAgB,eAAe,MAAY,QAAyB;AAClE,QAAO,IAAI,KAAK,eAAe,QAAQ;EACrC,MAAM;EACN,OAAO;EACP,KAAK;EACN,CAAC,CAAC,OAAO,KAAK;;;;;;;AAQjB,SAAgB,YAAY,OAAa,KAAW,QAAyB;AAM3E,QAAO,IALe,KAAK,eAAe,QAAQ;EAChD,MAAM;EACN,OAAO;EACP,KAAK;EACN,CACe,CAAC,YAAY,OAAO,IAAI;;;;;;;;AAS1C,SAAgB,gBACd,WACA,QACQ;AACR,KAAI,cAAc,KAAM,QAAO;AAC/B,KAAI,UAAU,SAAS,SACrB,QAAO,eAAe,UAAU,MAAM,OAAO;AAC/C,QAAO,YAAY,UAAU,OAAO,UAAU,KAAK,OAAO"}
@@ -0,0 +1,31 @@
1
+ import { l as CalendarJsInstance, u as CalendarJsOptions, y as CalendarView } from "../types-C3oj58JZ.js";
2
+ import { CalendarSelection } from "./format-month-year.js";
3
+
4
+ //#region src/mount-calendar.d.ts
5
+ interface MountCalendarOptions {
6
+ initialDate?: Date;
7
+ locale?: string;
8
+ calendarOptions?: CalendarJsOptions;
9
+ onDisplayDateChange?: (date: Date) => void;
10
+ onViewChange?: (view: CalendarView) => void;
11
+ onSelectionChange?: (selection: CalendarSelection) => void;
12
+ }
13
+ declare function parseSelection(raw: unknown): CalendarSelection;
14
+ interface CalendarActions {
15
+ prev: () => void;
16
+ next: () => void;
17
+ today: () => void;
18
+ reset: () => void;
19
+ setView: (view: CalendarView) => void;
20
+ }
21
+ interface CalendarMount {
22
+ instance: CalendarJsInstance;
23
+ actions: CalendarActions;
24
+ getDisplayDate: () => Date;
25
+ getView: () => CalendarView;
26
+ destroy: () => void;
27
+ }
28
+ declare function mountCalendar(body: HTMLElement, options?: MountCalendarOptions): CalendarMount;
29
+ //#endregion
30
+ export { CalendarActions, CalendarMount, MountCalendarOptions, mountCalendar, parseSelection };
31
+ //# sourceMappingURL=mount-calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount-calendar.d.ts","names":[],"sources":["../../src/mount-calendar.ts"],"mappings":";;;;UAUiB,oBAAA;EACf,WAAA,GAAc,IAAA;EACd,MAAA;EACA,eAAA,GAAkB,iBAAA;EAClB,mBAAA,IAAuB,IAAA,EAAM,IAAA;EAC7B,YAAA,IAAgB,IAAA,EAAM,YAAA;EACtB,iBAAA,IAAqB,SAAA,EAAW,iBAAA;AAAA;AAAA,iBAQlB,cAAA,CAAe,GAAA,YAAe,iBAAA;AAAA,UA+E7B,eAAA;EACf,IAAA;EACA,IAAA;EACA,KAAA;EACA,KAAA;EACA,OAAA,GAAU,IAAA,EAAM,YAAA;AAAA;AAAA,UAGD,aAAA;EACf,QAAA,EAAU,kBAAA;EACV,OAAA,EAAS,eAAA;EACT,cAAA,QAAsB,IAAA;EACtB,OAAA,QAAe,YAAA;EACf,OAAA;AAAA;AAAA,iBA+Cc,aAAA,CACd,IAAA,EAAM,WAAA,EACN,OAAA,GAAS,oBAAA,GACR,aAAA"}