@forcecalendar/interface 1.0.23 → 1.0.24
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/dist/force-calendar-interface.esm.js +44 -30
- package/dist/force-calendar-interface.esm.js.map +1 -1
- package/dist/force-calendar-interface.umd.js +3 -3
- package/dist/force-calendar-interface.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ForceCalendar.js +25 -3
- package/src/core/StateManager.js +4 -1
package/package.json
CHANGED
|
@@ -68,9 +68,31 @@ export class ForceCalendar extends BaseComponent {
|
|
|
68
68
|
this.emit('calendar-view-change', data);
|
|
69
69
|
}));
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const forwardEventAction = (action, data) => {
|
|
72
|
+
this.emit(`calendar-event-${action}`, data);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Event management events (canonical + backward-compatible aliases)
|
|
76
|
+
this._busUnsubscribers.push(eventBus.on('event:add', (data) => {
|
|
77
|
+
forwardEventAction('add', data);
|
|
78
|
+
}));
|
|
79
|
+
this._busUnsubscribers.push(eventBus.on('event:update', (data) => {
|
|
80
|
+
forwardEventAction('update', data);
|
|
81
|
+
}));
|
|
82
|
+
this._busUnsubscribers.push(eventBus.on('event:remove', (data) => {
|
|
83
|
+
forwardEventAction('remove', data);
|
|
84
|
+
}));
|
|
85
|
+
this._busUnsubscribers.push(eventBus.on('event:added', (data) => {
|
|
86
|
+
forwardEventAction('add', data);
|
|
87
|
+
this.emit('calendar-event-added', data);
|
|
88
|
+
}));
|
|
89
|
+
this._busUnsubscribers.push(eventBus.on('event:updated', (data) => {
|
|
90
|
+
forwardEventAction('update', data);
|
|
91
|
+
this.emit('calendar-event-updated', data);
|
|
92
|
+
}));
|
|
93
|
+
this._busUnsubscribers.push(eventBus.on('event:deleted', (data) => {
|
|
94
|
+
forwardEventAction('remove', data);
|
|
95
|
+
this.emit('calendar-event-deleted', data);
|
|
74
96
|
}));
|
|
75
97
|
|
|
76
98
|
// Date selection events
|
package/src/core/StateManager.js
CHANGED
|
@@ -215,6 +215,7 @@ class StateManager {
|
|
|
215
215
|
}
|
|
216
216
|
// Sync from Core to ensure consistency (single source of truth)
|
|
217
217
|
this._syncEventsFromCore();
|
|
218
|
+
eventBus.emit('event:add', { event: addedEvent });
|
|
218
219
|
eventBus.emit('event:added', { event: addedEvent });
|
|
219
220
|
return addedEvent;
|
|
220
221
|
}
|
|
@@ -232,6 +233,7 @@ class StateManager {
|
|
|
232
233
|
|
|
233
234
|
// Sync from Core to ensure consistency (single source of truth)
|
|
234
235
|
this._syncEventsFromCore();
|
|
236
|
+
eventBus.emit('event:update', { event });
|
|
235
237
|
eventBus.emit('event:updated', { event });
|
|
236
238
|
return event;
|
|
237
239
|
}
|
|
@@ -248,6 +250,7 @@ class StateManager {
|
|
|
248
250
|
}
|
|
249
251
|
// Sync from Core to ensure consistency (single source of truth)
|
|
250
252
|
this._syncEventsFromCore();
|
|
253
|
+
eventBus.emit('event:remove', { eventId });
|
|
251
254
|
eventBus.emit('event:deleted', { eventId });
|
|
252
255
|
return true;
|
|
253
256
|
}
|
|
@@ -409,4 +412,4 @@ class StateManager {
|
|
|
409
412
|
}
|
|
410
413
|
|
|
411
414
|
// Export StateManager
|
|
412
|
-
export default StateManager;
|
|
415
|
+
export default StateManager;
|