@bimetal/calendar-angular-components 0.29.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/LICENSE +129 -0
- package/README.md +56 -0
- package/dist/binding/config.d.ts +6 -0
- package/dist/binding/config.d.ts.map +1 -0
- package/dist/binding/config.js +6 -0
- package/dist/binding/config.js.map +1 -0
- package/dist/binding/controller.d.ts +22 -0
- package/dist/binding/controller.d.ts.map +1 -0
- package/dist/binding/controller.js +17 -0
- package/dist/binding/controller.js.map +1 -0
- package/dist/binding/index.d.ts +24 -0
- package/dist/binding/index.d.ts.map +1 -0
- package/dist/binding/index.js +26 -0
- package/dist/binding/index.js.map +1 -0
- package/dist/binding/services/event-render.service.d.ts +40 -0
- package/dist/binding/services/event-render.service.d.ts.map +1 -0
- package/dist/binding/services/event-render.service.js +58 -0
- package/dist/binding/services/event-render.service.js.map +1 -0
- package/dist/binding/types.d.ts +128 -0
- package/dist/binding/types.d.ts.map +1 -0
- package/dist/binding/types.js +12 -0
- package/dist/binding/types.js.map +1 -0
- package/dist/binding/utils/date-strings.d.ts +16 -0
- package/dist/binding/utils/date-strings.d.ts.map +1 -0
- package/dist/binding/utils/date-strings.js +30 -0
- package/dist/binding/utils/date-strings.js.map +1 -0
- package/dist/binding/utils/gridUtils.d.ts +6 -0
- package/dist/binding/utils/gridUtils.d.ts.map +1 -0
- package/dist/binding/utils/gridUtils.js +13 -0
- package/dist/binding/utils/gridUtils.js.map +1 -0
- package/dist/binding/view-configs.d.ts +6 -0
- package/dist/binding/view-configs.d.ts.map +1 -0
- package/dist/binding/view-configs.js +6 -0
- package/dist/binding/view-configs.js.map +1 -0
- package/dist/components/Calendar.d.ts +110 -0
- package/dist/components/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar.js +554 -0
- package/dist/components/Calendar.js.map +1 -0
- package/dist/components/CalendarHeader.d.ts +17 -0
- package/dist/components/CalendarHeader.d.ts.map +1 -0
- package/dist/components/CalendarHeader.js +105 -0
- package/dist/components/CalendarHeader.js.map +1 -0
- package/dist/components/CategoryFilter.d.ts +11 -0
- package/dist/components/CategoryFilter.d.ts.map +1 -0
- package/dist/components/CategoryFilter.js +66 -0
- package/dist/components/CategoryFilter.js.map +1 -0
- package/dist/components/EventBar.d.ts +56 -0
- package/dist/components/EventBar.d.ts.map +1 -0
- package/dist/components/EventBar.js +328 -0
- package/dist/components/EventBar.js.map +1 -0
- package/dist/components/EventDialog.d.ts +52 -0
- package/dist/components/EventDialog.d.ts.map +1 -0
- package/dist/components/EventDialog.js +557 -0
- package/dist/components/EventDialog.js.map +1 -0
- package/dist/components/EventHistory.d.ts +17 -0
- package/dist/components/EventHistory.d.ts.map +1 -0
- package/dist/components/EventHistory.js +166 -0
- package/dist/components/EventHistory.js.map +1 -0
- package/dist/components/ResourceFilter.d.ts +12 -0
- package/dist/components/ResourceFilter.d.ts.map +1 -0
- package/dist/components/ResourceFilter.js +67 -0
- package/dist/components/ResourceFilter.js.map +1 -0
- package/dist/components/UndoToast.d.ts +20 -0
- package/dist/components/UndoToast.d.ts.map +1 -0
- package/dist/components/UndoToast.js +90 -0
- package/dist/components/UndoToast.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/index.css +1 -0
- package/dist/views/agenda/AgendaView.d.ts +54 -0
- package/dist/views/agenda/AgendaView.d.ts.map +1 -0
- package/dist/views/agenda/AgendaView.js +309 -0
- package/dist/views/agenda/AgendaView.js.map +1 -0
- package/dist/views/day/DayView.d.ts +85 -0
- package/dist/views/day/DayView.d.ts.map +1 -0
- package/dist/views/day/DayView.js +422 -0
- package/dist/views/day/DayView.js.map +1 -0
- package/dist/views/month/MonthView.d.ts +51 -0
- package/dist/views/month/MonthView.d.ts.map +1 -0
- package/dist/views/month/MonthView.js +184 -0
- package/dist/views/month/MonthView.js.map +1 -0
- package/dist/views/month/WeekRow.d.ts +89 -0
- package/dist/views/month/WeekRow.d.ts.map +1 -0
- package/dist/views/month/WeekRow.js +548 -0
- package/dist/views/month/WeekRow.js.map +1 -0
- package/dist/views/resource/ResourceView.d.ts +85 -0
- package/dist/views/resource/ResourceView.d.ts.map +1 -0
- package/dist/views/resource/ResourceView.js +388 -0
- package/dist/views/resource/ResourceView.js.map +1 -0
- package/dist/views/timeline/TimelineView.d.ts +69 -0
- package/dist/views/timeline/TimelineView.d.ts.map +1 -0
- package/dist/views/timeline/TimelineView.js +314 -0
- package/dist/views/timeline/TimelineView.js.map +1 -0
- package/dist/views/week/AllDayRow.d.ts +38 -0
- package/dist/views/week/AllDayRow.d.ts.map +1 -0
- package/dist/views/week/AllDayRow.js +149 -0
- package/dist/views/week/AllDayRow.js.map +1 -0
- package/dist/views/week/TimeEvent.d.ts +77 -0
- package/dist/views/week/TimeEvent.d.ts.map +1 -0
- package/dist/views/week/TimeEvent.js +279 -0
- package/dist/views/week/TimeEvent.js.map +1 -0
- package/dist/views/week/WeekView.d.ts +79 -0
- package/dist/views/week/WeekView.d.ts.map +1 -0
- package/dist/views/week/WeekView.js +370 -0
- package/dist/views/week/WeekView.js.map +1 -0
- package/dist/views/year/YearView.d.ts +37 -0
- package/dist/views/year/YearView.d.ts.map +1 -0
- package/dist/views/year/YearView.js +162 -0
- package/dist/views/year/YearView.js.map +1 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree
|
|
8
|
+
to them as both strict obligations and conditions to all
|
|
9
|
+
your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the
|
|
14
|
+
software to do everything you might do with the software
|
|
15
|
+
that would otherwise infringe the licensor's copyright
|
|
16
|
+
in it for any permitted purpose. However, you may
|
|
17
|
+
only distribute the software according to [Distribution
|
|
18
|
+
License](#distribution-license) and make changes or new works
|
|
19
|
+
based on the software according to [Changes and New Works
|
|
20
|
+
License](#changes-and-new-works-license).
|
|
21
|
+
|
|
22
|
+
## Distribution License
|
|
23
|
+
|
|
24
|
+
The licensor grants you an additional copyright license
|
|
25
|
+
to distribute copies of the software. Your license
|
|
26
|
+
to distribute covers distributing the software with
|
|
27
|
+
changes and new works permitted by [Changes and New Works
|
|
28
|
+
License](#changes-and-new-works-license).
|
|
29
|
+
|
|
30
|
+
## Notices
|
|
31
|
+
|
|
32
|
+
You must ensure that anyone who gets a copy of any part of
|
|
33
|
+
the software from you also gets a copy of these terms or the
|
|
34
|
+
URL for them above, as well as copies of any plain-text lines
|
|
35
|
+
beginning with `Required Notice:` that the licensor provided
|
|
36
|
+
with the software. For example:
|
|
37
|
+
|
|
38
|
+
> Required Notice: Copyright Andreas Biederbeck (https://bimetal.dev)
|
|
39
|
+
|
|
40
|
+
## Changes and New Works License
|
|
41
|
+
|
|
42
|
+
The licensor grants you an additional copyright license to
|
|
43
|
+
make changes and new works based on the software for any
|
|
44
|
+
permitted purpose.
|
|
45
|
+
|
|
46
|
+
## Patent License
|
|
47
|
+
|
|
48
|
+
The licensor grants you a patent license for the software that
|
|
49
|
+
covers patent claims the licensor can license, or becomes able
|
|
50
|
+
to license, that you would infringe by using the software.
|
|
51
|
+
|
|
52
|
+
## Noncommercial Purposes
|
|
53
|
+
|
|
54
|
+
Any noncommercial purpose is a permitted purpose.
|
|
55
|
+
|
|
56
|
+
## Personal Uses
|
|
57
|
+
|
|
58
|
+
Personal use for research, experiment, and testing for
|
|
59
|
+
the benefit of public knowledge, personal study, private
|
|
60
|
+
entertainment, hobby projects, amateur pursuits, or religious
|
|
61
|
+
observance, without any anticipated commercial application,
|
|
62
|
+
is use for a permitted purpose.
|
|
63
|
+
|
|
64
|
+
## Noncommercial Organizations
|
|
65
|
+
|
|
66
|
+
Use by any charitable organization, educational institution,
|
|
67
|
+
public research organization, public safety or health
|
|
68
|
+
organization, environmental protection organization,
|
|
69
|
+
or government institution is use for a permitted purpose
|
|
70
|
+
regardless of the source of funding or obligations resulting
|
|
71
|
+
from the funding.
|
|
72
|
+
|
|
73
|
+
## Fair Use
|
|
74
|
+
|
|
75
|
+
You may have "fair use" rights for the software under the
|
|
76
|
+
law. These terms do not limit them.
|
|
77
|
+
|
|
78
|
+
## No Other Rights
|
|
79
|
+
|
|
80
|
+
These terms do not allow you to sublicense or transfer any of
|
|
81
|
+
your licenses to anyone else, or prevent the licensor from
|
|
82
|
+
granting licenses to anyone else. These terms do not imply
|
|
83
|
+
any other licenses.
|
|
84
|
+
|
|
85
|
+
## Patent Defense
|
|
86
|
+
|
|
87
|
+
If you make any written claim that the software infringes or
|
|
88
|
+
contributes to infringement of any patent, your patent license
|
|
89
|
+
for the software granted under these terms ends immediately. If
|
|
90
|
+
your company makes such a claim, your patent license ends
|
|
91
|
+
immediately for work on behalf of your company.
|
|
92
|
+
|
|
93
|
+
## Violations
|
|
94
|
+
|
|
95
|
+
The first time you are notified in writing that you have
|
|
96
|
+
violated any of these terms, or any agreement made under them,
|
|
97
|
+
you have 32 calendar days to come into compliance. If you come
|
|
98
|
+
into compliance, your licenses revive and continue as if you had
|
|
99
|
+
never violated.
|
|
100
|
+
|
|
101
|
+
## No Liability
|
|
102
|
+
|
|
103
|
+
***As far as the law allows, the software comes as is, without
|
|
104
|
+
any warranty or condition, and the licensor will not be liable
|
|
105
|
+
to you for any damages arising out of these terms or the use
|
|
106
|
+
or nature of the software, under any kind of legal claim.***
|
|
107
|
+
|
|
108
|
+
## Definitions
|
|
109
|
+
|
|
110
|
+
The **licensor** is the individual or entity offering these
|
|
111
|
+
terms, and the **software** is the software the licensor makes
|
|
112
|
+
available under these terms.
|
|
113
|
+
|
|
114
|
+
**You** refers to the individual or entity agreeing to these
|
|
115
|
+
terms.
|
|
116
|
+
|
|
117
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
118
|
+
or other kind of organization that you work for, plus all
|
|
119
|
+
organizations that have control over, are under the control of,
|
|
120
|
+
or are under common control with that organization. **Control**
|
|
121
|
+
means ownership of substantially all the assets of an entity,
|
|
122
|
+
or the power to direct its management and policies by vote,
|
|
123
|
+
contract, or otherwise. Control can be direct or indirect.
|
|
124
|
+
|
|
125
|
+
**Your licenses** are all the licenses granted to you for the
|
|
126
|
+
software under these terms.
|
|
127
|
+
|
|
128
|
+
**Use** means anything you do with the software requiring one
|
|
129
|
+
of your licenses.
|
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @bimetal/calendar-angular-components
|
|
2
|
+
|
|
3
|
+
Angular calendar UI components — month, week, day, and agenda views with drag & drop, event dialog, undo, and category filtering.
|
|
4
|
+
|
|
5
|
+
Built on the same headless architecture as `@bimetal/calendar-react-components`, `@bimetal/calendar-vue-components`, and `@bimetal/calendar-svelte-components`.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @bimetal/calendar-angular-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { Component } from '@angular/core';
|
|
17
|
+
import { CalendarComponent } from '@bimetal/calendar-angular-components';
|
|
18
|
+
import { createCalendarStore } from '@bimetal/calendar-data';
|
|
19
|
+
import '@bimetal/calendar-angular-components/styles';
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'app-root',
|
|
23
|
+
standalone: true,
|
|
24
|
+
imports: [CalendarComponent],
|
|
25
|
+
template: `<cal-calendar [store]="store"></cal-calendar>`,
|
|
26
|
+
})
|
|
27
|
+
export class AppComponent {
|
|
28
|
+
store = createCalendarStore();
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Inputs
|
|
33
|
+
|
|
34
|
+
| Input | Type | Description |
|
|
35
|
+
|-------|------|-------------|
|
|
36
|
+
| `store` | `CalendarStore` | Required. The event store. |
|
|
37
|
+
| `rules` | `CalendarRule[]` | Optional. Rules evaluated before dispatch. |
|
|
38
|
+
| `config` | `CalendarConfigInput` | Optional. Locale, timezone, categories, granularity. |
|
|
39
|
+
| `darkMode` | `boolean` | Optional. Dark theme. |
|
|
40
|
+
| `showCategoryFilter` | `boolean` | Optional. Show/hide category filter. Default: true. |
|
|
41
|
+
|
|
42
|
+
> Hinweis: Der Input heißt einheitlich `config` (früher `configInput`) — identisch zu React/Vue/Svelte.
|
|
43
|
+
|
|
44
|
+
## Architecture
|
|
45
|
+
|
|
46
|
+
Sämtliche Interaktionslogik liegt im kanonischen `createCalendarController` aus `@bimetal/calendar-headless`. Die Angular-Komponenten sind ein reines Binding: Sie konstruieren den Controller, abonnieren seinen Snapshot über den Angular-eigenen Service-/Signal-Layer (`@bimetal/angular`) und übersetzen Template-Events in Controller-Intents. Kein `if` in der Komponente — jede Entscheidung gehört dem Controller:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
@bimetal/event-sourcing → @bimetal/calendar-data → @bimetal/calendar-rules → @bimetal/calendar-headless
|
|
50
|
+
@bimetal/core ───────────────────┘ ↓
|
|
51
|
+
@bimetal/angular (services)
|
|
52
|
+
↓
|
|
53
|
+
@bimetal/calendar-angular-components (UI)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Components are standalone (no NgModules), use Angular template syntax, and share CSS class names with React/Vue/Svelte for theme compatibility via `@bimetal/calendar-themes`.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar config defaults + merge — re-exported from the canonical
|
|
3
|
+
* `@bimetal/calendar-headless` source. Previously a per-framework copy that drifted.
|
|
4
|
+
*/
|
|
5
|
+
export { defaultLocale, defaultCalendarConfig, mergeCalendarConfig } from '@bimetal/calendar-headless';
|
|
6
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/binding/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar config defaults + merge — re-exported from the canonical
|
|
3
|
+
* `@bimetal/calendar-headless` source. Previously a per-framework copy that drifted.
|
|
4
|
+
*/
|
|
5
|
+
export { defaultLocale, defaultCalendarConfig, mergeCalendarConfig } from '@bimetal/calendar-headless';
|
|
6
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/binding/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Signal, type NgZone } from '@angular/core';
|
|
2
|
+
import type { CalendarController, CalendarControllerOptions, CalendarControllerSnapshot } from '@bimetal/calendar-headless';
|
|
3
|
+
/**
|
|
4
|
+
* Angular binding for the canonical calendar controller.
|
|
5
|
+
*
|
|
6
|
+
* The controller owns all interaction state and semantics; this binding does
|
|
7
|
+
* nothing but bridge it into Angular via a signal and push reactive option
|
|
8
|
+
* updates (config/rules/customViews) through `setConfig` / `setRules` /
|
|
9
|
+
* `setCustomViews` — exactly like the React `useCalendarController` hook.
|
|
10
|
+
*
|
|
11
|
+
* `zone.run` wraps every snapshot update so change detection fires when an
|
|
12
|
+
* async intent (save/delete/drop/undo) resolves outside Angular's zone. When
|
|
13
|
+
* no zone is supplied (unit tests instantiate without DI) the listener runs
|
|
14
|
+
* the update directly.
|
|
15
|
+
*/
|
|
16
|
+
export interface CalendarControllerBinding {
|
|
17
|
+
readonly snapshot: Signal<CalendarControllerSnapshot>;
|
|
18
|
+
readonly ctrl: CalendarController;
|
|
19
|
+
destroy(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function createCalendarControllerBinding(options: CalendarControllerOptions, zone?: NgZone): CalendarControllerBinding;
|
|
22
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/binding/controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,0BAA0B,CAAC,CAAC;IACtD,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,yBAAyB,EAClC,IAAI,CAAC,EAAE,MAAM,GACZ,yBAAyB,CAc3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { signal } from '@angular/core';
|
|
2
|
+
import { createCalendarController } from '@bimetal/calendar-headless';
|
|
3
|
+
export function createCalendarControllerBinding(options, zone) {
|
|
4
|
+
const ctrl = createCalendarController(options);
|
|
5
|
+
const snapshot = signal(ctrl.getSnapshot());
|
|
6
|
+
const run = zone ? (fn) => zone.run(fn) : (fn) => fn();
|
|
7
|
+
const unsub = ctrl.subscribe(() => run(() => snapshot.set(ctrl.getSnapshot())));
|
|
8
|
+
return {
|
|
9
|
+
snapshot,
|
|
10
|
+
ctrl,
|
|
11
|
+
destroy() {
|
|
12
|
+
unsub();
|
|
13
|
+
ctrl.destroy();
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/binding/controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA4B,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AA0BtE,MAAM,UAAU,+BAA+B,CAC7C,OAAkC,EAClC,IAAa;IAEb,MAAM,IAAI,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,MAAM,CAA6B,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACxE,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAAc,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAc,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;IAC/E,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAEhF,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,OAAO;YACL,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular Calendar binding — the calendar-specific Angular adapter (the
|
|
3
|
+
* calendar controller binding, the EventRenderService, calendar config,
|
|
4
|
+
* calendar types + drag helpers, view-configs and date/grid utilities).
|
|
5
|
+
* Lives in the calendar component package, NOT in the generic `@bimetal/angular`
|
|
6
|
+
* binding: the calendar is a peer of the component family, not a privileged
|
|
7
|
+
* citizen of the framework layer. The generic `createControllerBinding`
|
|
8
|
+
* primitive is re-exported from `@bimetal/angular`.
|
|
9
|
+
*/
|
|
10
|
+
export { createCalendarControllerBinding } from './controller.js';
|
|
11
|
+
export type { CalendarControllerBinding } from './controller.js';
|
|
12
|
+
export { createCalendarController } from '@bimetal/calendar-headless';
|
|
13
|
+
export type { CalendarController, CalendarControllerOptions, CalendarControllerSnapshot, CustomViewSpec, SelectionState, } from '@bimetal/calendar-headless';
|
|
14
|
+
export { EventRenderService } from './services/event-render.service.js';
|
|
15
|
+
export type { CalendarConfig, CalendarConfigInput, CalendarLocale, Category, ViewConfig, AnchorRect, CustomViewDefinition, CustomViewInputs, EventDialogInputs, EventDialogMode, EventRenderContext, EventRenderTemplateContext, EventRenderTemplate, EventClassNameFn, EventStyleFn, EventTitleFn, } from './types.js';
|
|
16
|
+
export type { DragPreview, DragInfo } from '@bimetal/calendar-headless';
|
|
17
|
+
export { snapTimeFromMouseY, parseDragInfo, DRAG_MIME, findExpandedEvent, buildDragInfo, writeCalendarDragData, installTransparentDragImage } from '@bimetal/calendar-headless';
|
|
18
|
+
export { WEEK_NUM_COL_WIDTH, getColFromX, ZERO_RECT } from '@bimetal/calendar-headless';
|
|
19
|
+
export { defaultLocale, defaultCalendarConfig, mergeCalendarConfig } from './config.js';
|
|
20
|
+
export { createViewConfigs } from './view-configs.js';
|
|
21
|
+
export { toDateStr, toTimeStr, parseDateStr, parseDateTimeStr } from '@bimetal/calendar-headless';
|
|
22
|
+
export * from '@bimetal/calendar-data';
|
|
23
|
+
export * from '@bimetal/calendar-rules';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/binding/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAClE,YAAY,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EACV,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,cAAc,EACd,cAAc,GACf,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAGxE,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAChL,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAGxF,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGlG,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular Calendar binding — the calendar-specific Angular adapter (the
|
|
3
|
+
* calendar controller binding, the EventRenderService, calendar config,
|
|
4
|
+
* calendar types + drag helpers, view-configs and date/grid utilities).
|
|
5
|
+
* Lives in the calendar component package, NOT in the generic `@bimetal/angular`
|
|
6
|
+
* binding: the calendar is a peer of the component family, not a privileged
|
|
7
|
+
* citizen of the framework layer. The generic `createControllerBinding`
|
|
8
|
+
* primitive is re-exported from `@bimetal/angular`.
|
|
9
|
+
*/
|
|
10
|
+
// ── Controller binding ─────────────────────────────────────────
|
|
11
|
+
export { createCalendarControllerBinding } from './controller.js';
|
|
12
|
+
// ── Canonical controller (re-exported for convenience) ──────────
|
|
13
|
+
export { createCalendarController } from '@bimetal/calendar-headless';
|
|
14
|
+
// ── Services ───────────────────────────────────────────────────
|
|
15
|
+
export { EventRenderService } from './services/event-render.service.js';
|
|
16
|
+
export { snapTimeFromMouseY, parseDragInfo, DRAG_MIME, findExpandedEvent, buildDragInfo, writeCalendarDragData, installTransparentDragImage } from '@bimetal/calendar-headless';
|
|
17
|
+
export { WEEK_NUM_COL_WIDTH, getColFromX, ZERO_RECT } from '@bimetal/calendar-headless';
|
|
18
|
+
// ── Config ──────────────────────────────────────────────────────
|
|
19
|
+
export { defaultLocale, defaultCalendarConfig, mergeCalendarConfig } from './config.js';
|
|
20
|
+
export { createViewConfigs } from './view-configs.js';
|
|
21
|
+
// ── Utilities ───────────────────────────────────────────────────
|
|
22
|
+
export { toDateStr, toTimeStr, parseDateStr, parseDateTimeStr } from '@bimetal/calendar-headless';
|
|
23
|
+
// ── Re-export calendar data + rules for convenience ─────────────
|
|
24
|
+
export * from '@bimetal/calendar-data';
|
|
25
|
+
export * from '@bimetal/calendar-rules';
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/binding/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kEAAkE;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,iBAAiB,CAAC;AAGlE,mEAAmE;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAStE,kEAAkE;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAsBxE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAChL,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAExF,mEAAmE;AACnE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,mEAAmE;AACnE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAElG,mEAAmE;AACnE,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type TemplateRef } from '@angular/core';
|
|
2
|
+
import type { CalendarEvent, ViewType } from '@bimetal/calendar-core';
|
|
3
|
+
import type { EventClassNameFn, EventRenderContext, EventRenderTemplateContext, EventStyleFn, EventTitleFn } from '../types.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Shared state for the per-event render hook in Angular.
|
|
7
|
+
*
|
|
8
|
+
* CalendarComponent owns one instance of this service and writes its @Input
|
|
9
|
+
* values onto it. Leaf render sites (TimeEvent, EventBar, inline cells) read
|
|
10
|
+
* the values when rendering.
|
|
11
|
+
*
|
|
12
|
+
* This intentionally avoids prop-drilling the template refs and callbacks
|
|
13
|
+
* through every view component. The service is provided at the Calendar
|
|
14
|
+
* level (not the root), so multiple Calendars in the same app stay isolated.
|
|
15
|
+
*/
|
|
16
|
+
export declare class EventRenderService {
|
|
17
|
+
/** The currently active view. Set by Calendar whenever the user switches views. */
|
|
18
|
+
view: ViewType;
|
|
19
|
+
eventBadgesTpl?: TemplateRef<EventRenderTemplateContext>;
|
|
20
|
+
eventContentTpl?: TemplateRef<EventRenderTemplateContext>;
|
|
21
|
+
eventClassName?: EventClassNameFn;
|
|
22
|
+
eventStyle?: EventStyleFn;
|
|
23
|
+
eventTitle?: EventTitleFn;
|
|
24
|
+
/**
|
|
25
|
+
* Compute the render context for an event: which view, and which instance
|
|
26
|
+
* (for recurring events).
|
|
27
|
+
*/
|
|
28
|
+
buildContext(event: CalendarEvent): EventRenderContext;
|
|
29
|
+
/** Convenience: title to display (override or event.title). */
|
|
30
|
+
resolveTitle(event: CalendarEvent): string;
|
|
31
|
+
/** Convenience: className suffix to append. Empty string if none. */
|
|
32
|
+
resolveClassName(event: CalendarEvent): string;
|
|
33
|
+
/** Convenience: extra style object (or undefined). */
|
|
34
|
+
resolveStyle(event: CalendarEvent): Record<string, string | number> | undefined;
|
|
35
|
+
/** Build ngTemplateOutletContext for badges/content templates. */
|
|
36
|
+
buildTemplateContext(event: CalendarEvent): EventRenderTemplateContext;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EventRenderService, never>;
|
|
38
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EventRenderService>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=event-render.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-render.service.d.ts","sourceRoot":"","sources":["../../../src/binding/services/event-render.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAoB,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACZ,YAAY,EACb,MAAM,aAAa,CAAC;;AAErB;;;;;;;;;;GAUG;AACH,qBACa,kBAAkB;IAC7B,mFAAmF;IACnF,IAAI,EAAE,QAAQ,CAAW;IAEzB,cAAc,CAAC,EAAE,WAAW,CAAC,0BAA0B,CAAC,CAAC;IACzD,eAAe,CAAC,EAAE,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAC1D,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,UAAU,CAAC,EAAE,YAAY,CAAC;IAE1B;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,kBAAkB;IAStD,+DAA+D;IAC/D,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM;IAK1C,qEAAqE;IACrE,gBAAgB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM;IAI9C,sDAAsD;IACtD,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,SAAS;IAI/E,kEAAkE;IAClE,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,0BAA0B;yCAxC3D,kBAAkB;6CAAlB,kBAAkB;CA4C9B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { getRecurrenceInstanceMetadata } from '@bimetal/calendar-core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Shared state for the per-event render hook in Angular.
|
|
6
|
+
*
|
|
7
|
+
* CalendarComponent owns one instance of this service and writes its @Input
|
|
8
|
+
* values onto it. Leaf render sites (TimeEvent, EventBar, inline cells) read
|
|
9
|
+
* the values when rendering.
|
|
10
|
+
*
|
|
11
|
+
* This intentionally avoids prop-drilling the template refs and callbacks
|
|
12
|
+
* through every view component. The service is provided at the Calendar
|
|
13
|
+
* level (not the root), so multiple Calendars in the same app stay isolated.
|
|
14
|
+
*/
|
|
15
|
+
export class EventRenderService {
|
|
16
|
+
/** The currently active view. Set by Calendar whenever the user switches views. */
|
|
17
|
+
view = 'month';
|
|
18
|
+
eventBadgesTpl;
|
|
19
|
+
eventContentTpl;
|
|
20
|
+
eventClassName;
|
|
21
|
+
eventStyle;
|
|
22
|
+
eventTitle;
|
|
23
|
+
/**
|
|
24
|
+
* Compute the render context for an event: which view, and which instance
|
|
25
|
+
* (for recurring events).
|
|
26
|
+
*/
|
|
27
|
+
buildContext(event) {
|
|
28
|
+
const markers = getRecurrenceInstanceMetadata(event);
|
|
29
|
+
const instanceDate = markers !== null
|
|
30
|
+
? { epochMs: markers.instanceDate, timezone: event.timeRange.start.timezone }
|
|
31
|
+
: undefined;
|
|
32
|
+
return { view: this.view, instanceDate };
|
|
33
|
+
}
|
|
34
|
+
/** Convenience: title to display (override or event.title). */
|
|
35
|
+
resolveTitle(event) {
|
|
36
|
+
const override = this.eventTitle?.(event, this.buildContext(event));
|
|
37
|
+
return override ?? event.title;
|
|
38
|
+
}
|
|
39
|
+
/** Convenience: className suffix to append. Empty string if none. */
|
|
40
|
+
resolveClassName(event) {
|
|
41
|
+
return this.eventClassName?.(event, this.buildContext(event)) ?? '';
|
|
42
|
+
}
|
|
43
|
+
/** Convenience: extra style object (or undefined). */
|
|
44
|
+
resolveStyle(event) {
|
|
45
|
+
return this.eventStyle?.(event, this.buildContext(event));
|
|
46
|
+
}
|
|
47
|
+
/** Build ngTemplateOutletContext for badges/content templates. */
|
|
48
|
+
buildTemplateContext(event) {
|
|
49
|
+
const ctx = this.buildContext(event);
|
|
50
|
+
return { $implicit: { event, ctx }, event, ctx };
|
|
51
|
+
}
|
|
52
|
+
static ɵfac = function EventRenderService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EventRenderService)(); };
|
|
53
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventRenderService, factory: EventRenderService.ɵfac });
|
|
54
|
+
}
|
|
55
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventRenderService, [{
|
|
56
|
+
type: Injectable
|
|
57
|
+
}], null, null); })();
|
|
58
|
+
//# sourceMappingURL=event-render.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-render.service.js","sourceRoot":"","sources":["../../../src/binding/services/event-render.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAoB,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;;AASvE;;;;;;;;;;GAUG;AAEH,MAAM,OAAO,kBAAkB;IAC7B,mFAAmF;IACnF,IAAI,GAAa,OAAO,CAAC;IAEzB,cAAc,CAA2C;IACzD,eAAe,CAA2C;IAC1D,cAAc,CAAoB;IAClC,UAAU,CAAgB;IAC1B,UAAU,CAAgB;IAE1B;;;OAGG;IACH,YAAY,CAAC,KAAoB;QAC/B,MAAM,OAAO,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;QACrD,MAAM,YAAY,GAChB,OAAO,KAAK,IAAI;YACd,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC7E,CAAC,CAAC,SAAS,CAAC;QAChB,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED,+DAA+D;IAC/D,YAAY,CAAC,KAAoB;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QACpE,OAAO,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,qEAAqE;IACrE,gBAAgB,CAAC,KAAoB;QACnC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IACtE,CAAC;IAED,sDAAsD;IACtD,YAAY,CAAC,KAAoB;QAC/B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,kEAAkE;IAClE,oBAAoB,CAAC,KAAoB;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACnD,CAAC;4GA3CU,kBAAkB;gEAAlB,kBAAkB,WAAlB,kBAAkB;;iFAAlB,kBAAkB;cAD9B,UAAU"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular-specific calendar types.
|
|
3
|
+
*
|
|
4
|
+
* The framework-agnostic core (CalendarConfig, CalendarLocale, Category,
|
|
5
|
+
* ViewConfig, DragInfo, DragPreview, …) now lives in `@bimetal/calendar-headless` and
|
|
6
|
+
* is re-exported here. Only the types that carry an *Angular component
|
|
7
|
+
* reference* (custom-view component, custom dialog component) or Angular
|
|
8
|
+
* TemplateRef-based render slots stay framework-specific.
|
|
9
|
+
*/
|
|
10
|
+
import type { Type, TemplateRef } from '@angular/core';
|
|
11
|
+
import type { CalendarEvent, CalendarDateTime, ViewType } from '@bimetal/calendar-core';
|
|
12
|
+
import type { CalendarConfig, CustomViewSpec, AnchorRect } from '@bimetal/calendar-headless';
|
|
13
|
+
export type { CalendarLocale, Category, ViewConfig, CalendarConfig, CalendarConfigInput, AnchorRect, } from '@bimetal/calendar-headless';
|
|
14
|
+
export type { DragPreview, DragInfo } from '@bimetal/calendar-headless';
|
|
15
|
+
/**
|
|
16
|
+
* Inputs delivered to a Custom View Angular component via *ngComponentOutlet.
|
|
17
|
+
*
|
|
18
|
+
* Note: the contract uses callback Inputs (not @Outputs) so the Calendar can
|
|
19
|
+
* pass them through ngComponentOutlet's `inputs` map. The custom view should
|
|
20
|
+
* declare these as @Input() properties and call them when the user creates
|
|
21
|
+
* a new event or clicks an existing one.
|
|
22
|
+
*/
|
|
23
|
+
export interface CustomViewInputs {
|
|
24
|
+
currentDate: CalendarDateTime;
|
|
25
|
+
events: readonly CalendarEvent[];
|
|
26
|
+
config: CalendarConfig;
|
|
27
|
+
onNewEvent: (defaultDate: CalendarDateTime, anchorRect?: AnchorRect) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Open the edit dialog for an existing event. `instanceDate` (epochMs)
|
|
30
|
+
* addresses a specific recurring occurrence — pass it through when the
|
|
31
|
+
* event was expanded from a recurrence series.
|
|
32
|
+
*/
|
|
33
|
+
onEventClick: (eventId: string, anchorRect: AnchorRect, instanceDate?: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Currently selected event id (or `null`). `instanceDate` narrows the
|
|
36
|
+
* selection to a specific recurring occurrence. Matches the click-vs-
|
|
37
|
+
* doubleclick UX so custom views can render selection highlights and let
|
|
38
|
+
* Phase-10 keyboard navigation operate over them.
|
|
39
|
+
*/
|
|
40
|
+
selectedEventId: string | null;
|
|
41
|
+
selectedInstanceDate: number | undefined;
|
|
42
|
+
onSelectEvent: (eventId: string, instanceDate?: number) => void;
|
|
43
|
+
onClearSelection: () => void;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A custom view registered via the Calendar `customViews` input. Extends the
|
|
48
|
+
* agnostic `CustomViewSpec` (id / label / step / formatTitle / visibleRange)
|
|
49
|
+
* with the Angular component to render when the tab is selected.
|
|
50
|
+
*/
|
|
51
|
+
export interface CustomViewDefinition extends CustomViewSpec {
|
|
52
|
+
/**
|
|
53
|
+
* Angular component class. Receives all fields of CustomViewInputs as
|
|
54
|
+
* @Inputs (data inputs `currentDate`/`events`/`config` plus the callback
|
|
55
|
+
* inputs `onNewEvent` and `onEventClick`).
|
|
56
|
+
*/
|
|
57
|
+
readonly component: Type<unknown>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Inputs delivered to a custom Event-Dialog Angular component via
|
|
61
|
+
* *ngComponentOutlet. The custom dialog component should declare these as
|
|
62
|
+
* @Input() properties and call onSave/onDelete/onClose to commit through the
|
|
63
|
+
* standard pipeline (recurrence-instance-aware and rule-validated).
|
|
64
|
+
*/
|
|
65
|
+
export interface EventDialogInputs {
|
|
66
|
+
event: CalendarEvent | null;
|
|
67
|
+
defaultDate: CalendarDateTime;
|
|
68
|
+
anchorRect: AnchorRect;
|
|
69
|
+
defaultResourceId?: string;
|
|
70
|
+
config: CalendarConfig;
|
|
71
|
+
onClose: () => void;
|
|
72
|
+
onSave: (event: CalendarEvent) => void;
|
|
73
|
+
onDelete: (eventId: string) => void;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Selects the dialog behavior on `<cal-calendar>`.
|
|
78
|
+
* - `'builtin'` (default) renders the standard EventDialog.
|
|
79
|
+
* - `'none'` renders nothing; click intents go to onEventClick / onNewEventRequested.
|
|
80
|
+
* - `'custom'` renders the supplied Angular component instead of the built-in dialog.
|
|
81
|
+
*/
|
|
82
|
+
export type EventDialogMode = {
|
|
83
|
+
kind: 'builtin';
|
|
84
|
+
} | {
|
|
85
|
+
kind: 'none';
|
|
86
|
+
} | {
|
|
87
|
+
kind: 'custom';
|
|
88
|
+
component: Type<unknown>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Context delivered to per-event render Inputs.
|
|
92
|
+
*/
|
|
93
|
+
export interface EventRenderContext {
|
|
94
|
+
readonly view: ViewType;
|
|
95
|
+
readonly instanceDate?: CalendarDateTime;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Angular variant of the per-event render hook.
|
|
99
|
+
*
|
|
100
|
+
* Unlike React/Vue/Svelte which expose a single `renderEvent` function that
|
|
101
|
+
* returns slot data, Angular uses idiomatic template inputs:
|
|
102
|
+
*
|
|
103
|
+
* - `eventBadgesTpl` / `eventContentTpl`: TemplateRef inputs (typed via
|
|
104
|
+
* {@link EventRenderTemplateContext}) projected after / instead of the
|
|
105
|
+
* default content zone.
|
|
106
|
+
* - `eventClassName` / `eventStyle` / `eventTitle`: function inputs that
|
|
107
|
+
* return the corresponding slot value per event.
|
|
108
|
+
*
|
|
109
|
+
* Semantically equivalent to the function-based API in the other frameworks.
|
|
110
|
+
*/
|
|
111
|
+
export interface EventRenderTemplateContext {
|
|
112
|
+
/** Implicit context (use `let-ctx`) — convenience for the consumer. */
|
|
113
|
+
readonly $implicit: {
|
|
114
|
+
event: CalendarEvent;
|
|
115
|
+
ctx: EventRenderContext;
|
|
116
|
+
};
|
|
117
|
+
readonly event: CalendarEvent;
|
|
118
|
+
readonly ctx: EventRenderContext;
|
|
119
|
+
}
|
|
120
|
+
/** Function input: returns an additional class string (or undefined). */
|
|
121
|
+
export type EventClassNameFn = (event: CalendarEvent, ctx: EventRenderContext) => string | undefined;
|
|
122
|
+
/** Function input: returns extra inline styles (or undefined). */
|
|
123
|
+
export type EventStyleFn = (event: CalendarEvent, ctx: EventRenderContext) => Record<string, string | number> | undefined;
|
|
124
|
+
/** Function input: returns a title override string (or undefined to keep default). */
|
|
125
|
+
export type EventTitleFn = (event: CalendarEvent, ctx: EventRenderContext) => string | undefined;
|
|
126
|
+
/** TemplateRef alias — keeps consumer imports framework-local. */
|
|
127
|
+
export type EventRenderTemplate = TemplateRef<EventRenderTemplateContext>;
|
|
128
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/binding/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG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AClE,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular-specific calendar types.
|
|
3
|
+
*
|
|
4
|
+
* The framework-agnostic core (CalendarConfig, CalendarLocale, Category,
|
|
5
|
+
* ViewConfig, DragInfo, DragPreview, …) now lives in `@bimetal/calendar-headless` and
|
|
6
|
+
* is re-exported here. Only the types that carry an *Angular component
|
|
7
|
+
* reference* (custom-view component, custom dialog component) or Angular
|
|
8
|
+
* TemplateRef-based render slots stay framework-specific.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
// ── Layout constant ─────────────────────────────────────────────
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/binding/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;AA2IH,mEAAmE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CalendarDateTime } from '@bimetal/core';
|
|
2
|
+
/** Convert CalendarDateTime to a date string "YYYY-MM-DD". */
|
|
3
|
+
export declare function toDateStr(dt: CalendarDateTime): string;
|
|
4
|
+
/** Convert CalendarDateTime to a time string "HH:MM". */
|
|
5
|
+
export declare function toTimeStr(dt: CalendarDateTime): string;
|
|
6
|
+
/**
|
|
7
|
+
* Parse a date string "YYYY-MM-DD" to CalendarDateTime (at midnight).
|
|
8
|
+
* Validation is delegated to createDateTime() — invalid dates throw CalendarValidationError.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseDateStr(dateStr: string, timezone?: string): CalendarDateTime;
|
|
11
|
+
/**
|
|
12
|
+
* Parse date + time strings into a single CalendarDateTime.
|
|
13
|
+
* Validation is delegated to createDateTime() — invalid values throw CalendarValidationError.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseDateTimeStr(dateStr: string, timeStr: string, timezone?: string): CalendarDateTime;
|
|
16
|
+
//# sourceMappingURL=date-strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-strings.d.ts","sourceRoot":"","sources":["../../../src/binding/utils/date-strings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAKtD;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAc,GAAG,gBAAgB,CAGxF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,MAAc,GACvB,gBAAgB,CAIlB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { getYear, getMonth, getDayOfMonth, getHours, getMinutes, createDateTime } from '@bimetal/core';
|
|
2
|
+
/** Convert CalendarDateTime to a date string "YYYY-MM-DD". */
|
|
3
|
+
export function toDateStr(dt) {
|
|
4
|
+
const y = getYear(dt);
|
|
5
|
+
const m = getMonth(dt) + 1;
|
|
6
|
+
const d = getDayOfMonth(dt);
|
|
7
|
+
return `${y}-${String(m).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
|
|
8
|
+
}
|
|
9
|
+
/** Convert CalendarDateTime to a time string "HH:MM". */
|
|
10
|
+
export function toTimeStr(dt) {
|
|
11
|
+
return `${String(getHours(dt)).padStart(2, '0')}:${String(getMinutes(dt)).padStart(2, '0')}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parse a date string "YYYY-MM-DD" to CalendarDateTime (at midnight).
|
|
15
|
+
* Validation is delegated to createDateTime() — invalid dates throw CalendarValidationError.
|
|
16
|
+
*/
|
|
17
|
+
export function parseDateStr(dateStr, timezone = 'UTC') {
|
|
18
|
+
const [y, m, d] = dateStr.split('-').map(Number);
|
|
19
|
+
return createDateTime(y, m - 1, d, 0, 0, timezone);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Parse date + time strings into a single CalendarDateTime.
|
|
23
|
+
* Validation is delegated to createDateTime() — invalid values throw CalendarValidationError.
|
|
24
|
+
*/
|
|
25
|
+
export function parseDateTimeStr(dateStr, timeStr, timezone = 'UTC') {
|
|
26
|
+
const [y, mo, d] = dateStr.split('-').map(Number);
|
|
27
|
+
const [h, mi] = timeStr.split(':').map(Number);
|
|
28
|
+
return createDateTime(y, mo - 1, d, h, mi, timezone);
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=date-strings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-strings.js","sourceRoot":"","sources":["../../../src/binding/utils/date-strings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvG,8DAA8D;AAC9D,MAAM,UAAU,SAAS,CAAC,EAAoB;IAC5C,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IACtB,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC5B,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AAC5E,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,SAAS,CAAC,EAAoB;IAC5C,OAAO,GAAG,MAAM,C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