@svar-ui/svelte-calendar 2.6.0 → 2.7.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.
Files changed (60) hide show
  1. package/dist/components/Calendar.svelte +13 -4
  2. package/dist/components/Calendar.svelte.d.ts +50 -19
  3. package/dist/components/ContextMenu.svelte +13 -5
  4. package/dist/components/Editor.svelte +29 -34
  5. package/dist/components/EventDatesForm.svelte +121 -0
  6. package/dist/components/EventDatesForm.svelte.d.ts +15 -0
  7. package/dist/components/Layout.svelte +18 -5
  8. package/dist/components/Layout.svelte.d.ts +2 -0
  9. package/dist/components/Navigation.svelte +20 -12
  10. package/dist/components/Navigation.svelte.d.ts +1 -0
  11. package/dist/components/Render/BarSection.svelte +3 -0
  12. package/dist/components/Render/EventProjection.svelte +36 -0
  13. package/dist/components/Render/EventProjection.svelte.d.ts +9 -0
  14. package/dist/components/Render/GridSection.svelte +5 -2
  15. package/dist/components/Render/GridSection.svelte.d.ts +2 -1
  16. package/dist/components/Render/ScrollableSection.svelte +22 -3
  17. package/dist/components/Render/ScrollableSection.svelte.d.ts +1 -0
  18. package/dist/components/Render/SectionContent.svelte +1 -0
  19. package/dist/components/Render/Sections.svelte +46 -9
  20. package/dist/components/Render/Sections.svelte.d.ts +1 -0
  21. package/dist/components/Render/YearSection.svelte +8 -1
  22. package/dist/components/Render/resolveEventPosition.d.ts +5 -0
  23. package/dist/components/Render/resolveEventPosition.js +35 -0
  24. package/dist/components/pro_RecurringForm.svelte +346 -0
  25. package/dist/components/pro_RecurringForm.svelte.d.ts +15 -0
  26. package/dist/components/pro_rrule-form.d.ts +23 -0
  27. package/dist/components/pro_rrule-form.js +121 -0
  28. package/dist/components/{Render/useEventOverlay.svelte.d.ts → useEventOverlay.svelte.d.ts} +1 -1
  29. package/dist/components/{Render/useEventOverlay.svelte.js → useEventOverlay.svelte.js} +1 -1
  30. package/dist/context.tx +0 -0
  31. package/dist/defaults.d.ts +18 -0
  32. package/dist/defaults.js +15 -0
  33. package/dist/directives/clickevent.d.ts +1 -0
  34. package/dist/directives/clickevent.js +11 -8
  35. package/dist/directives/drag.js +11 -7
  36. package/dist/directives/dragresize.js +6 -3
  37. package/dist/helpers/pro_export.d.ts +5 -0
  38. package/dist/helpers/pro_export.js +22 -0
  39. package/dist/index.d.ts +5 -4
  40. package/dist/index.js +4 -2
  41. package/dist/pro_export/Calendar.svelte +30 -0
  42. package/dist/pro_export/Calendar.svelte.d.ts +16 -0
  43. package/dist/pro_export/Event.svelte +5 -0
  44. package/dist/pro_export/Event.svelte.d.ts +11 -0
  45. package/dist/pro_export.d.ts +3 -0
  46. package/dist/pro_export.js +15 -0
  47. package/dist/themes/Print.svelte +89 -0
  48. package/dist/themes/Print.svelte.d.ts +13 -0
  49. package/dist/themes/PrintBW.svelte +111 -0
  50. package/dist/themes/PrintBW.svelte.d.ts +13 -0
  51. package/dist/{components/types.d.ts → types.d.ts} +5 -0
  52. package/package.json +17 -17
  53. package/readme.md +2 -2
  54. package/dist/Demo.svelte +0 -7
  55. package/dist/Demo.svelte.d.ts +0 -26
  56. package/dist/components/editorItems.d.ts +0 -15
  57. package/dist/components/editorItems.js +0 -20
  58. package/dist/init.d.ts +0 -1
  59. package/dist/init.js +0 -5
  60. /package/dist/{components/types.js → types.js} +0 -0
@@ -0,0 +1,111 @@
1
+ <script>
2
+ import Willow from "./Willow.svelte";
3
+ let { fonts = true, children } = $props();
4
+ </script>
5
+
6
+ {#if children}
7
+ <Willow {fonts}>
8
+ <div class="wx-bw-theme">
9
+ {@render children()}
10
+ </div>
11
+ </Willow>
12
+ {:else}
13
+ <Willow {fonts} />
14
+ {/if}
15
+
16
+ <style>
17
+ :global {
18
+ .wx-bw-theme {
19
+ height: 100%;
20
+ width: 100%;
21
+ box-sizing: border-box;
22
+
23
+ /* base palette - black with gray shades for print legibility */
24
+ --wx-background: #ffffff;
25
+ --wx-background-alt: #ffffff;
26
+ --wx-background-hover: transparent;
27
+ --wx-color-font: #000000;
28
+ --wx-color-font-alt: #555555;
29
+ --wx-color-font-disabled: #888888;
30
+ --wx-color-primary: #000000;
31
+ --wx-color-primary-font: #000000;
32
+ --wx-color-primary-selected: transparent;
33
+ --wx-color-secondary-hover: transparent;
34
+ --wx-color-link: #000000;
35
+ --wx-color-danger: #000000;
36
+ --wx-icon-color: #000000;
37
+
38
+ /* calendar surfaces */
39
+ --wx-calendar-grid-color: #999999;
40
+ --wx-calendar-weekend-background: #f2f2f2;
41
+ }
42
+
43
+ .wx-bw-theme .wx-calendar,
44
+ .wx-bw-theme .wx-calendar-content,
45
+ .wx-bw-theme .wx-calendar-main,
46
+ .wx-bw-theme .wx-calendar-sidebar,
47
+ .wx-bw-theme .wx-scroll-grid,
48
+ .wx-bw-theme .wx-scroll-inner,
49
+ .wx-bw-theme .wx-sections,
50
+ .wx-bw-theme .wx-section {
51
+ background: #ffffff;
52
+ }
53
+
54
+ /* events - white body, gray outline; grayscale neutralizes any custom fill */
55
+ .wx-bw-theme .wx-bar-event:not(.wx-bar-single-day),
56
+ .wx-bw-theme .wx-box-event {
57
+ background-color: #ffffff;
58
+ color: #000000;
59
+ border: 1px solid #999999;
60
+ box-shadow: none;
61
+ break-inside: avoid;
62
+ filter: grayscale(1);
63
+ }
64
+
65
+ .wx-bw-theme .wx-bar-event:hover,
66
+ .wx-bw-theme .wx-box-event:hover {
67
+ box-shadow: none;
68
+ opacity: 1;
69
+ }
70
+
71
+ .wx-bw-theme .wx-bar-single-day,
72
+ .wx-bw-theme .wx-list-event,
73
+ .wx-bw-theme .wx-event-dot,
74
+ .wx-bw-theme .wx-bar-marker {
75
+ filter: grayscale(1);
76
+ }
77
+
78
+ .wx-bw-theme .wx-bar-single-day:hover {
79
+ background-color: transparent;
80
+ }
81
+
82
+ /* now-line reads as a dashed black rule without color */
83
+ .wx-bw-theme .wx-now-line::after {
84
+ background: #000000;
85
+ }
86
+
87
+ .wx-bw-theme .wx-now-dot {
88
+ background: #000000;
89
+ }
90
+
91
+ /* today marker - outline the day number instead of filling it */
92
+ .wx-bw-theme .wx-month-day.wx-today .wx-day-num {
93
+ background: #ffffff;
94
+ color: #000000;
95
+ border: 1px solid #000000;
96
+ }
97
+
98
+ .wx-bw-theme .wx-event-placeholder {
99
+ background: transparent;
100
+ border: 1px dashed #000000;
101
+ }
102
+
103
+ .wx-bw-theme .wx-list-event:hover {
104
+ background-color: transparent;
105
+ }
106
+
107
+ .wx-bw-theme .wx-navigation button {
108
+ display: none;
109
+ }
110
+ }
111
+ </style>
@@ -0,0 +1,13 @@
1
+ export default PrintBW;
2
+ type PrintBW = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const PrintBW: import("svelte").Component<{
7
+ fonts?: boolean;
8
+ children: any;
9
+ }, {}, "">;
10
+ type $$ComponentProps = {
11
+ fonts?: boolean;
12
+ children: any;
13
+ };
@@ -4,6 +4,10 @@ export type ViewOption = {
4
4
  id: string;
5
5
  label: string;
6
6
  };
7
+ export type CalendarPoint = {
8
+ clientX: number;
9
+ clientY: number;
10
+ };
7
11
  type CalendarEventBus = EventBus<StoreActions, keyof StoreActions>;
8
12
  type CalendarApi = {
9
13
  getState: CalendarStore["getState"];
@@ -14,6 +18,7 @@ type CalendarApi = {
14
18
  };
15
19
  export type CalendarContextApi = CalendarApi & {
16
20
  getBrandmark: () => Brandmark | null;
21
+ isSmall: () => boolean;
17
22
  };
18
23
  export type CalendarInstanceApi = CalendarApi & {
19
24
  getStores: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svar-ui/svelte-calendar",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "SVAR UI Event Calendar widget",
5
5
  "homepage": "https://svar.dev/svelte/calendar/",
6
6
  "bugs": {
@@ -27,34 +27,34 @@
27
27
  "./package.json": "./package.json"
28
28
  },
29
29
  "dependencies": {
30
- "@svar-ui/core-locales": "2.5.0",
31
- "@svar-ui/lib-dom": "0.12.1",
32
- "@svar-ui/lib-state": "1.9.6",
33
- "@svar-ui/svelte-core": "2.5.3",
34
- "@svar-ui/svelte-editor": "2.5.3",
35
- "@svar-ui/svelte-layout": "2.5.0",
36
- "@svar-ui/svelte-menu": "2.5.3",
37
- "@svar-ui/svelte-toolbar": "2.5.3",
30
+ "@svar-ui/core-locales": "2.6.1",
31
+ "@svar-ui/lib-dom": "0.14.0",
32
+ "@svar-ui/lib-state": "1.9.7",
33
+ "@svar-ui/svelte-core": "2.6.1",
34
+ "@svar-ui/svelte-editor": "2.7.0",
35
+ "@svar-ui/svelte-menu": "2.6.1",
36
+ "@svar-ui/svelte-toolbar": "2.6.1",
38
37
  "svelte-check": "^4.4.6",
39
- "@svar-ui/calendar-locales": "2.6.0",
40
- "@svar-ui/calendar-provider": "2.6.0",
41
- "@svar-ui/calendar-store": "2.6.0",
42
- "@svar-ui/calendar-ical": "2.6.0"
38
+ "@svar-ui/calendar-ical": "2.7.0",
39
+ "@svar-ui/calendar-store": "2.7.0",
40
+ "@svar-ui/calendar-locales": "2.7.0",
41
+ "@svar-ui/calendar-provider": "2.7.0"
43
42
  },
44
43
  "devDependencies": {
45
44
  "@sveltejs/package": "^2.5.7",
46
- "@sveltejs/vite-plugin-svelte": "^7.0.0",
47
- "svelte": "^5.54.0"
45
+ "@sveltejs/vite-plugin-svelte": "^7.1.2",
46
+ "svelte": "^5.54.0",
47
+ "svelte-check": "^4.4.6"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "svelte": "^5.54.0"
51
51
  },
52
- "productTag": "calendar",
53
52
  "scripts": {
54
53
  "check": "svelte-check --tsconfig ./tsconfig.json",
55
54
  "build": "svelte-package -i ./src",
55
+ "build:export": "vp build --mode export",
56
56
  "lint": "vp lint ./demos ./src",
57
57
  "start": "vp dev --open",
58
- "watch": "svelte-package -i ./src --watch"
58
+ "dev": "svelte-package -i ./src --watch"
59
59
  }
60
60
  }
package/readme.md CHANGED
@@ -18,9 +18,9 @@
18
18
 
19
19
  </div>
20
20
 
21
- [SVAR Svelte Calendar](https://svar.dev/svelte/calendar/) is an interactive event calendar and scheduler component for Svelte and SvelteKit apps. It supports Day, Week, and Month views, drag-and-drop event editing, a ready-to-use event edit form, and rich customization options.
21
+ [SVAR Svelte Calendar](https://svar.dev/svelte/calendar/) is an interactive event calendar and scheduler component for Svelte and SvelteKit apps. It supports Day, Week, and Month views, drag-and-drop event editing, a ready-to-use event edit form, and rich customization options.
22
22
 
23
- The calendar comes with full TypeScript support, extensible API, and flexible CSS styling. The PRO Edition offers additional views (Year, Agenda, Timeline, Resources) and recurring event support.
23
+ The calendar comes with full TypeScript support, extensible API, and flexible CSS styling. The PRO Edition offers additional views (Year, Agenda, Timeline, Resources) and recurring event support.
24
24
 
25
25
  <div align="center">
26
26
  <img src="https://svar.dev/images/github/github-calendar.gif" alt="SVAR Svelte Calendar Preview">
package/dist/Demo.svelte DELETED
@@ -1,7 +0,0 @@
1
- <script>
2
- import { Calendar, Willow } from "./index.js";
3
- </script>
4
-
5
- <Willow>
6
- <Calendar />
7
- </Willow>
@@ -1,26 +0,0 @@
1
- export default Demo;
2
- type Demo = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const Demo: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
- $$bindings?: Bindings;
17
- } & Exports;
18
- (internal: unknown, props: {
19
- $$events?: Events;
20
- $$slots?: Slots;
21
- }): Exports & {
22
- $set?: any;
23
- $on?: any;
24
- };
25
- z_$$bindings?: Bindings;
26
- }
@@ -1,15 +0,0 @@
1
- export declare function getEditorItems(): ({
2
- comp: string;
3
- key: string;
4
- label: string;
5
- time?: undefined;
6
- config?: undefined;
7
- } | {
8
- comp: string;
9
- key: string;
10
- label: string;
11
- time: boolean;
12
- config: {
13
- buttons: boolean;
14
- };
15
- })[];
@@ -1,20 +0,0 @@
1
- export function getEditorItems() {
2
- return [
3
- { comp: "text", key: "text", label: "Text" },
4
- {
5
- comp: "date-time-picker",
6
- key: "start",
7
- label: "Start date",
8
- time: true,
9
- config: { buttons: false },
10
- },
11
- {
12
- comp: "date-time-picker",
13
- key: "end",
14
- label: "End date",
15
- time: true,
16
- config: { buttons: false },
17
- },
18
- { comp: "checkbox", key: "allDay", label: "All day" },
19
- ];
20
- }
package/dist/init.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/init.js DELETED
@@ -1,5 +0,0 @@
1
- import { mount } from "svelte";
2
- import Demo from "./Demo.svelte";
3
- mount(Demo, {
4
- target: document.querySelector("#wx_demo_area") || document.body,
5
- });
File without changes