@okdoc-ai-community/simple-calendar 0.0.5
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
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Calendar
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.1.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build calendar
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/calendar
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, signal, computed, Component } from '@angular/core';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { IonSelect, IonSelectOption } from '@ionic/angular/standalone';
|
|
6
|
+
import { McpTool, OkDocPlugin } from '@okdoc-ai/plugin-sdk';
|
|
7
|
+
import { OkDocNotifier } from '@okdoc-ai/plugin-sdk/angular';
|
|
8
|
+
|
|
9
|
+
let OdcSimpleCalendar = class OdcSimpleCalendar {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.notifier = inject(OkDocNotifier);
|
|
12
|
+
this.selectedMonth = signal(new Date().getMonth(), ...(ngDevMode ? [{ debugName: "selectedMonth" }] : []));
|
|
13
|
+
this.selectedYear = signal(new Date().getFullYear(), ...(ngDevMode ? [{ debugName: "selectedYear" }] : []));
|
|
14
|
+
this.selectedDate = signal(null, ...(ngDevMode ? [{ debugName: "selectedDate" }] : []));
|
|
15
|
+
this.months = [
|
|
16
|
+
{ value: 0, label: 'January' },
|
|
17
|
+
{ value: 1, label: 'February' },
|
|
18
|
+
{ value: 2, label: 'March' },
|
|
19
|
+
{ value: 3, label: 'April' },
|
|
20
|
+
{ value: 4, label: 'May' },
|
|
21
|
+
{ value: 5, label: 'June' },
|
|
22
|
+
{ value: 6, label: 'July' },
|
|
23
|
+
{ value: 7, label: 'August' },
|
|
24
|
+
{ value: 8, label: 'September' },
|
|
25
|
+
{ value: 9, label: 'October' },
|
|
26
|
+
{ value: 10, label: 'November' },
|
|
27
|
+
{ value: 11, label: 'December' },
|
|
28
|
+
];
|
|
29
|
+
this.weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
30
|
+
this.years = Array.from({ length: 21 }, (_, i) => new Date().getFullYear() - 10 + i);
|
|
31
|
+
this.calendarDays = computed(() => {
|
|
32
|
+
const year = this.selectedYear();
|
|
33
|
+
const month = this.selectedMonth();
|
|
34
|
+
const firstDay = new Date(year, month, 1);
|
|
35
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
36
|
+
const firstDayOfWeek = firstDay.getDay();
|
|
37
|
+
const daysInMonth = lastDay.getDate();
|
|
38
|
+
const days = [];
|
|
39
|
+
for (let i = 0; i < firstDayOfWeek; i++) {
|
|
40
|
+
const prevMonthDay = new Date(year, month, -firstDayOfWeek + i + 1);
|
|
41
|
+
days.push({
|
|
42
|
+
date: prevMonthDay,
|
|
43
|
+
day: prevMonthDay.getDate(),
|
|
44
|
+
isCurrentMonth: false,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
for (let day = 1; day <= daysInMonth; day++) {
|
|
48
|
+
days.push({
|
|
49
|
+
date: new Date(year, month, day),
|
|
50
|
+
day,
|
|
51
|
+
isCurrentMonth: true,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const remainingDays = 42 - days.length;
|
|
55
|
+
for (let i = 1; i <= remainingDays; i++) {
|
|
56
|
+
const nextMonthDay = new Date(year, month + 1, i);
|
|
57
|
+
days.push({
|
|
58
|
+
date: nextMonthDay,
|
|
59
|
+
day: i,
|
|
60
|
+
isCurrentMonth: false,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return days;
|
|
64
|
+
}, ...(ngDevMode ? [{ debugName: "calendarDays" }] : []));
|
|
65
|
+
}
|
|
66
|
+
onMonthChange(event) {
|
|
67
|
+
this.selectedMonth.set(event.detail.value);
|
|
68
|
+
}
|
|
69
|
+
onYearChange(event) {
|
|
70
|
+
this.selectedYear.set(event.detail.value);
|
|
71
|
+
}
|
|
72
|
+
selectDate(date) {
|
|
73
|
+
if (!date)
|
|
74
|
+
return;
|
|
75
|
+
this.selectedDate.set(date);
|
|
76
|
+
const formattedDate = this.formatDate(date);
|
|
77
|
+
this.notifier.notify(`Date selected: ${formattedDate}`, 'calendar');
|
|
78
|
+
}
|
|
79
|
+
isSelected(date) {
|
|
80
|
+
if (!date || !this.selectedDate())
|
|
81
|
+
return false;
|
|
82
|
+
const selected = this.selectedDate();
|
|
83
|
+
return date.toDateString() === selected.toDateString();
|
|
84
|
+
}
|
|
85
|
+
formatDate(date) {
|
|
86
|
+
return date.toLocaleDateString('en-US', {
|
|
87
|
+
year: 'numeric',
|
|
88
|
+
month: 'long',
|
|
89
|
+
day: 'numeric',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
async selectDateTool(args) {
|
|
93
|
+
const dateString = args['date'];
|
|
94
|
+
try {
|
|
95
|
+
const date = new Date(dateString);
|
|
96
|
+
if (isNaN(date.getTime())) {
|
|
97
|
+
return {
|
|
98
|
+
content: [{ type: 'text', text: `Invalid date format: ${dateString}` }],
|
|
99
|
+
isError: true,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
this.selectedDate.set(date);
|
|
103
|
+
this.selectedMonth.set(date.getMonth());
|
|
104
|
+
this.selectedYear.set(date.getFullYear());
|
|
105
|
+
const formattedDate = this.formatDate(date);
|
|
106
|
+
return {
|
|
107
|
+
content: [{ type: 'text', text: `Date selected: ${formattedDate}` }],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return {
|
|
112
|
+
content: [{ type: 'text', text: `Error selecting date: ${error}` }],
|
|
113
|
+
isError: true,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OdcSimpleCalendar, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
118
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: OdcSimpleCalendar, isStandalone: true, selector: "odc-simple-calendar", ngImport: i0, template: "<div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <ion-select [value]=\"selectedMonth()\" (ionChange)=\"onMonthChange($event)\">\n @for (month of months; track month.value) {\n <ion-select-option [value]=\"month.value\">{{ month.label }}</ion-select-option>\n }\n </ion-select>\n\n <ion-select [value]=\"selectedYear()\" (ionChange)=\"onYearChange($event)\">\n @for (year of years; track year) {\n <ion-select-option [value]=\"year\">{{ year }}</ion-select-option>\n }\n </ion-select>\n </div>\n\n <div class=\"calendar-grid\">\n <div class=\"calendar-weekdays\">\n @for (day of weekDays; track day) {\n <div class=\"weekday\">{{ day }}</div>\n }\n </div>\n\n <div class=\"calendar-days\">\n @for (day of calendarDays(); track $index) {\n <button class=\"day-cell\" [class.other-month]=\"!day.isCurrentMonth\" [class.selected]=\"isSelected(day.date)\"\n [disabled]=\"!day.date\" (click)=\"selectDate(day.date!)\">\n {{ day.day || '' }}\n </button>\n }\n </div>\n </div>\n\n @if (selectedDate()) {\n <div class=\"selected-date-display\">\n Selected: {{ formatDate(selectedDate()!) }}\n </div>\n }\n</div>", styles: [".calendar-container{max-width:400px;padding:16px;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a}.calendar-header{display:flex;gap:12px;margin-bottom:16px;justify-content:space-between}.calendar-header ion-select{flex:1}.calendar-grid{display:flex;flex-direction:column;gap:8px}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:4px}.weekday{text-align:center;font-weight:600;font-size:12px;color:#666;padding:8px 0}.calendar-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.day-cell{aspect-ratio:1;border:1px solid #e0e0e0;background:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s;padding:0}.day-cell:hover:not(:disabled){background:#f5f5f5;border-color:#007aff}.day-cell.selected{background:#007aff;color:#fff;border-color:#007aff}.day-cell.other-month{color:#ccc}.day-cell:disabled{cursor:default;background:transparent}.selected-date-display{margin-top:16px;text-align:center;font-size:14px;color:#666}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }] }); }
|
|
119
|
+
};
|
|
120
|
+
__decorate([
|
|
121
|
+
McpTool({
|
|
122
|
+
name: 'select_date',
|
|
123
|
+
description: 'Select a specific date on the calendar',
|
|
124
|
+
inputSchema: {
|
|
125
|
+
type: 'object',
|
|
126
|
+
properties: {
|
|
127
|
+
date: {
|
|
128
|
+
type: 'string',
|
|
129
|
+
description: 'Date to select in ISO format (YYYY-MM-DD)',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
required: ['date'],
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
], OdcSimpleCalendar.prototype, "selectDateTool", null);
|
|
136
|
+
OdcSimpleCalendar = __decorate([
|
|
137
|
+
OkDocPlugin({
|
|
138
|
+
id: 'odc-okdoc-simple-calendar',
|
|
139
|
+
name: 'Simple Calendar',
|
|
140
|
+
description: 'A simple calendar component for selecting dates',
|
|
141
|
+
version: '0.0.1',
|
|
142
|
+
icon: 'calendar-outline',
|
|
143
|
+
namespace: 'odc-okdoc-simple-calendar',
|
|
144
|
+
})
|
|
145
|
+
], OdcSimpleCalendar);
|
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: OdcSimpleCalendar, decorators: [{
|
|
147
|
+
type: Component,
|
|
148
|
+
args: [{ selector: 'odc-simple-calendar', standalone: true, imports: [CommonModule, IonSelect, IonSelectOption], template: "<div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <ion-select [value]=\"selectedMonth()\" (ionChange)=\"onMonthChange($event)\">\n @for (month of months; track month.value) {\n <ion-select-option [value]=\"month.value\">{{ month.label }}</ion-select-option>\n }\n </ion-select>\n\n <ion-select [value]=\"selectedYear()\" (ionChange)=\"onYearChange($event)\">\n @for (year of years; track year) {\n <ion-select-option [value]=\"year\">{{ year }}</ion-select-option>\n }\n </ion-select>\n </div>\n\n <div class=\"calendar-grid\">\n <div class=\"calendar-weekdays\">\n @for (day of weekDays; track day) {\n <div class=\"weekday\">{{ day }}</div>\n }\n </div>\n\n <div class=\"calendar-days\">\n @for (day of calendarDays(); track $index) {\n <button class=\"day-cell\" [class.other-month]=\"!day.isCurrentMonth\" [class.selected]=\"isSelected(day.date)\"\n [disabled]=\"!day.date\" (click)=\"selectDate(day.date!)\">\n {{ day.day || '' }}\n </button>\n }\n </div>\n </div>\n\n @if (selectedDate()) {\n <div class=\"selected-date-display\">\n Selected: {{ formatDate(selectedDate()!) }}\n </div>\n }\n</div>", styles: [".calendar-container{max-width:400px;padding:16px;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a}.calendar-header{display:flex;gap:12px;margin-bottom:16px;justify-content:space-between}.calendar-header ion-select{flex:1}.calendar-grid{display:flex;flex-direction:column;gap:8px}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:4px}.weekday{text-align:center;font-weight:600;font-size:12px;color:#666;padding:8px 0}.calendar-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}.day-cell{aspect-ratio:1;border:1px solid #e0e0e0;background:#fff;border-radius:4px;cursor:pointer;font-size:14px;transition:all .2s;padding:0}.day-cell:hover:not(:disabled){background:#f5f5f5;border-color:#007aff}.day-cell.selected{background:#007aff;color:#fff;border-color:#007aff}.day-cell.other-month{color:#ccc}.day-cell:disabled{cursor:default;background:transparent}.selected-date-display{margin-top:16px;text-align:center;font-size:14px;color:#666}\n"] }]
|
|
149
|
+
}], propDecorators: { selectDateTool: [] } });
|
|
150
|
+
|
|
151
|
+
/*
|
|
152
|
+
* Public API Surface of calendar
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Generated bundle index. Do not edit.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
export { OdcSimpleCalendar };
|
|
160
|
+
//# sourceMappingURL=okdoc-ai-community-simple-calendar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okdoc-ai-community-simple-calendar.mjs","sources":["../../../projects/calendar/src/lib/calendar.ts","../../../projects/calendar/src/lib/calendar.html","../../../projects/calendar/src/public-api.ts","../../../projects/calendar/src/okdoc-ai-community-simple-calendar.ts"],"sourcesContent":["import { Component, inject, signal, computed } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { IonSelect, IonSelectOption } from '@ionic/angular/standalone';\nimport { OkDocPlugin, McpTool, McpToolResult } from '@okdoc-ai/plugin-sdk';\nimport { OkDocNotifier } from '@okdoc-ai/plugin-sdk/angular';\n\ninterface CalendarDay {\n date: Date | null;\n day: number | null;\n isCurrentMonth: boolean;\n}\n\n@OkDocPlugin({\n id: 'odc-okdoc-simple-calendar',\n name: 'Simple Calendar',\n description: 'A simple calendar component for selecting dates',\n version: '0.0.1',\n icon: 'calendar-outline',\n namespace: 'odc-okdoc-simple-calendar',\n})\n@Component({\n selector: 'odc-simple-calendar',\n standalone: true,\n imports: [CommonModule, IonSelect, IonSelectOption],\n templateUrl: './calendar.html',\n styleUrls: ['./calendar.css'],\n})\nexport class OdcSimpleCalendar {\n private notifier = inject(OkDocNotifier);\n\n selectedMonth = signal(new Date().getMonth());\n selectedYear = signal(new Date().getFullYear());\n selectedDate = signal<Date | null>(null);\n\n months = [\n { value: 0, label: 'January' },\n { value: 1, label: 'February' },\n { value: 2, label: 'March' },\n { value: 3, label: 'April' },\n { value: 4, label: 'May' },\n { value: 5, label: 'June' },\n { value: 6, label: 'July' },\n { value: 7, label: 'August' },\n { value: 8, label: 'September' },\n { value: 9, label: 'October' },\n { value: 10, label: 'November' },\n { value: 11, label: 'December' },\n ];\n\n weekDays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n years = Array.from({ length: 21 }, (_, i) => new Date().getFullYear() - 10 + i);\n\n calendarDays = computed(() => {\n const year = this.selectedYear();\n const month = this.selectedMonth();\n\n const firstDay = new Date(year, month, 1);\n const lastDay = new Date(year, month + 1, 0);\n const firstDayOfWeek = firstDay.getDay();\n const daysInMonth = lastDay.getDate();\n\n const days: CalendarDay[] = [];\n\n for (let i = 0; i < firstDayOfWeek; i++) {\n const prevMonthDay = new Date(year, month, -firstDayOfWeek + i + 1);\n days.push({\n date: prevMonthDay,\n day: prevMonthDay.getDate(),\n isCurrentMonth: false,\n });\n }\n\n for (let day = 1; day <= daysInMonth; day++) {\n days.push({\n date: new Date(year, month, day),\n day,\n isCurrentMonth: true,\n });\n }\n\n const remainingDays = 42 - days.length;\n for (let i = 1; i <= remainingDays; i++) {\n const nextMonthDay = new Date(year, month + 1, i);\n days.push({\n date: nextMonthDay,\n day: i,\n isCurrentMonth: false,\n });\n }\n\n return days;\n });\n\n onMonthChange(event: any) {\n this.selectedMonth.set(event.detail.value);\n }\n\n onYearChange(event: any) {\n this.selectedYear.set(event.detail.value);\n }\n\n selectDate(date: Date) {\n if (!date) return;\n\n this.selectedDate.set(date);\n const formattedDate = this.formatDate(date);\n this.notifier.notify(`Date selected: ${formattedDate}`, 'calendar');\n }\n\n isSelected(date: Date | null): boolean {\n if (!date || !this.selectedDate()) return false;\n const selected = this.selectedDate()!;\n return date.toDateString() === selected.toDateString();\n }\n\n formatDate(date: Date): string {\n return date.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n }\n\n @McpTool({\n name: 'select_date',\n description: 'Select a specific date on the calendar',\n inputSchema: {\n type: 'object',\n properties: {\n date: {\n type: 'string',\n description: 'Date to select in ISO format (YYYY-MM-DD)',\n },\n },\n required: ['date'],\n },\n })\n async selectDateTool(args: Record<string, unknown>): Promise<McpToolResult> {\n const dateString = args['date'] as string;\n\n try {\n const date = new Date(dateString);\n if (isNaN(date.getTime())) {\n return {\n content: [{ type: 'text', text: `Invalid date format: ${dateString}` }],\n isError: true,\n };\n }\n\n this.selectedDate.set(date);\n this.selectedMonth.set(date.getMonth());\n this.selectedYear.set(date.getFullYear());\n\n const formattedDate = this.formatDate(date);\n return {\n content: [{ type: 'text', text: `Date selected: ${formattedDate}` }],\n };\n } catch (error) {\n return {\n content: [{ type: 'text', text: `Error selecting date: ${error}` }],\n isError: true,\n };\n }\n }\n}\n","<div class=\"calendar-container\">\n <div class=\"calendar-header\">\n <ion-select [value]=\"selectedMonth()\" (ionChange)=\"onMonthChange($event)\">\n @for (month of months; track month.value) {\n <ion-select-option [value]=\"month.value\">{{ month.label }}</ion-select-option>\n }\n </ion-select>\n\n <ion-select [value]=\"selectedYear()\" (ionChange)=\"onYearChange($event)\">\n @for (year of years; track year) {\n <ion-select-option [value]=\"year\">{{ year }}</ion-select-option>\n }\n </ion-select>\n </div>\n\n <div class=\"calendar-grid\">\n <div class=\"calendar-weekdays\">\n @for (day of weekDays; track day) {\n <div class=\"weekday\">{{ day }}</div>\n }\n </div>\n\n <div class=\"calendar-days\">\n @for (day of calendarDays(); track $index) {\n <button class=\"day-cell\" [class.other-month]=\"!day.isCurrentMonth\" [class.selected]=\"isSelected(day.date)\"\n [disabled]=\"!day.date\" (click)=\"selectDate(day.date!)\">\n {{ day.day || '' }}\n </button>\n }\n </div>\n </div>\n\n @if (selectedDate()) {\n <div class=\"selected-date-display\">\n Selected: {{ formatDate(selectedDate()!) }}\n </div>\n }\n</div>","/*\n * Public API Surface of calendar\n */\n\nexport * from './lib/calendar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names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,2CAA2C;AACzD,iBAAA;AACF,aAAA;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;AACnB,SAAA;KACF;AA2BA,CAAA,EAAA,iBAAA,CAAA,SAAA,EAAA,gBAAA,EAAA,IAAA,CAAA;AAzIU,iBAAiB,GAAA,UAAA,CAAA;AAf7B,IAAA,WAAW,CAAC;AACX,QAAA,EAAE,EAAE,2BAA2B;AAC/B,QAAA,IAAI,EAAE,iBAAiB;AACvB,QAAA,WAAW,EAAE,iDAAiD;AAC9D,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,IAAI,EAAE,kBAAkB;AACxB,QAAA,SAAS,EAAE,2BAA2B;KACvC;AAQY,CAAA,EAAA,iBAAiB,CA0I7B;2FA1IY,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAP7B,SAAS;+BACE,qBAAqB,EAAA,UAAA,EACnB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,SAAS,EAAE,eAAe,CAAC,EAAA,QAAA,EAAA,02CAAA,EAAA,MAAA,EAAA,CAAA,6+BAAA,CAAA,EAAA;;;AEvBrD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@okdoc-ai-community/simple-calendar",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": ">=20.0.0",
|
|
6
|
+
"@angular/core": ">=20.0.0",
|
|
7
|
+
"@ionic/angular": "^8.0.0",
|
|
8
|
+
"@okdoc-ai/plugin-sdk": ">=1.0.0",
|
|
9
|
+
"ionicons": "^7.0.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"tslib": "^2.3.0"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/OkDoc-AI-Community/simple-calendar.git"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"module": "fesm2022/okdoc-ai-community-simple-calendar.mjs",
|
|
20
|
+
"typings": "types/okdoc-ai-community-simple-calendar.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package.json": {
|
|
23
|
+
"default": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./types/okdoc-ai-community-simple-calendar.d.ts",
|
|
27
|
+
"default": "./fesm2022/okdoc-ai-community-simple-calendar.mjs"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { McpToolResult } from '@okdoc-ai/plugin-sdk';
|
|
3
|
+
|
|
4
|
+
interface CalendarDay {
|
|
5
|
+
date: Date | null;
|
|
6
|
+
day: number | null;
|
|
7
|
+
isCurrentMonth: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare class OdcSimpleCalendar {
|
|
10
|
+
private notifier;
|
|
11
|
+
selectedMonth: _angular_core.WritableSignal<number>;
|
|
12
|
+
selectedYear: _angular_core.WritableSignal<number>;
|
|
13
|
+
selectedDate: _angular_core.WritableSignal<Date | null>;
|
|
14
|
+
months: {
|
|
15
|
+
value: number;
|
|
16
|
+
label: string;
|
|
17
|
+
}[];
|
|
18
|
+
weekDays: string[];
|
|
19
|
+
years: number[];
|
|
20
|
+
calendarDays: _angular_core.Signal<CalendarDay[]>;
|
|
21
|
+
onMonthChange(event: any): void;
|
|
22
|
+
onYearChange(event: any): void;
|
|
23
|
+
selectDate(date: Date): void;
|
|
24
|
+
isSelected(date: Date | null): boolean;
|
|
25
|
+
formatDate(date: Date): string;
|
|
26
|
+
selectDateTool(args: Record<string, unknown>): Promise<McpToolResult>;
|
|
27
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OdcSimpleCalendar, never>;
|
|
28
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OdcSimpleCalendar, "odc-simple-calendar", never, {}, {}, never, never, true, never>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { OdcSimpleCalendar };
|