@forcecalendar/interface 1.0.44 → 1.0.46
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 +558 -555
- package/dist/force-calendar-interface.esm.js.map +1 -1
- package/dist/force-calendar-interface.umd.js +13 -13
- package/dist/force-calendar-interface.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ForceCalendar.js +18 -3
- package/src/core/StateManager.js +4 -0
package/package.json
CHANGED
|
@@ -50,8 +50,8 @@ export class ForceCalendar extends BaseComponent {
|
|
|
50
50
|
|
|
51
51
|
this.stateManager = new StateManager(config);
|
|
52
52
|
|
|
53
|
-
// Subscribe to state changes
|
|
54
|
-
this.stateManager.subscribe(this.handleStateChange.bind(this));
|
|
53
|
+
// Subscribe to state changes (store unsubscribe for cleanup)
|
|
54
|
+
this._stateUnsubscribe = this.stateManager.subscribe(this.handleStateChange.bind(this));
|
|
55
55
|
|
|
56
56
|
// Listen for events
|
|
57
57
|
this.setupEventListeners();
|
|
@@ -827,7 +827,7 @@ export class ForceCalendar extends BaseComponent {
|
|
|
827
827
|
}
|
|
828
828
|
|
|
829
829
|
getTitle(date, view) {
|
|
830
|
-
const locale = this.stateManager.
|
|
830
|
+
const locale = this.stateManager.getState().config.locale;
|
|
831
831
|
|
|
832
832
|
switch (view) {
|
|
833
833
|
case 'month':
|
|
@@ -903,10 +903,25 @@ export class ForceCalendar extends BaseComponent {
|
|
|
903
903
|
this.stateManager.today();
|
|
904
904
|
}
|
|
905
905
|
|
|
906
|
+
unmount() {
|
|
907
|
+
// Called by disconnectedCallback — clean up all subscriptions
|
|
908
|
+
this.destroy();
|
|
909
|
+
}
|
|
910
|
+
|
|
906
911
|
destroy() {
|
|
907
912
|
this._busUnsubscribers.forEach(unsub => unsub());
|
|
908
913
|
this._busUnsubscribers = [];
|
|
909
914
|
|
|
915
|
+
if (this._stateUnsubscribe) {
|
|
916
|
+
this._stateUnsubscribe();
|
|
917
|
+
this._stateUnsubscribe = null;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
if (this._currentViewInstance && this._currentViewInstance.cleanup) {
|
|
921
|
+
this._currentViewInstance.cleanup();
|
|
922
|
+
this._currentViewInstance = null;
|
|
923
|
+
}
|
|
924
|
+
|
|
910
925
|
if (this.stateManager) {
|
|
911
926
|
this.stateManager.destroy();
|
|
912
927
|
}
|
package/src/core/StateManager.js
CHANGED