@forcecalendar/interface 1.0.6 → 1.0.7
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 +1539 -1493
- package/dist/force-calendar-interface.esm.js.map +1 -1
- package/dist/force-calendar-interface.umd.js +8 -8
- package/dist/force-calendar-interface.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ForceCalendar.js +10 -10
- package/src/components/views/DayView.js +22 -1
- package/src/components/views/MonthView.js +28 -0
- package/src/components/views/WeekView.js +22 -1
package/package.json
CHANGED
|
@@ -430,20 +430,20 @@ export class ForceCalendar extends BaseComponent {
|
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
afterRender() {
|
|
433
|
-
// Set up view component
|
|
433
|
+
// Set up view component using global registry for Locker Service compatibility
|
|
434
434
|
const viewElement = this.$('#calendar-view');
|
|
435
435
|
console.log('[ForceCalendar] afterRender - viewElement:', viewElement);
|
|
436
436
|
console.log('[ForceCalendar] afterRender - stateManager:', !!this.stateManager);
|
|
437
|
+
|
|
437
438
|
if (viewElement && this.stateManager) {
|
|
438
|
-
//
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}
|
|
439
|
+
// Store stateManager in global registry (bypasses Locker Service proxy issues)
|
|
440
|
+
const registryId = this._registryId || (this._registryId = 'fc-' + Math.random().toString(36).substr(2, 9));
|
|
441
|
+
window.__forceCalendarRegistry = window.__forceCalendarRegistry || {};
|
|
442
|
+
window.__forceCalendarRegistry[registryId] = this.stateManager;
|
|
443
|
+
|
|
444
|
+
// Pass registry ID via attribute (attributes work through Locker Service)
|
|
445
|
+
viewElement.setAttribute('data-state-registry', registryId);
|
|
446
|
+
console.log('[ForceCalendar] Set registry ID:', registryId);
|
|
447
447
|
} else {
|
|
448
448
|
console.log('[ForceCalendar] Could not set stateManager - viewElement:', !!viewElement, 'stateManager:', !!this.stateManager);
|
|
449
449
|
}
|
|
@@ -10,6 +10,10 @@ import { StyleUtils } from '../../utils/StyleUtils.js';
|
|
|
10
10
|
import { DOMUtils } from '../../utils/DOMUtils.js';
|
|
11
11
|
|
|
12
12
|
export class DayView extends BaseComponent {
|
|
13
|
+
static get observedAttributes() {
|
|
14
|
+
return ['data-state-registry'];
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
constructor() {
|
|
14
18
|
super();
|
|
15
19
|
this._stateManager = null;
|
|
@@ -17,11 +21,28 @@ export class DayView extends BaseComponent {
|
|
|
17
21
|
this.hours = Array.from({ length: 24 }, (_, i) => i);
|
|
18
22
|
}
|
|
19
23
|
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback();
|
|
26
|
+
this._checkRegistry();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
30
|
+
if (name === 'data-state-registry' && newValue) {
|
|
31
|
+
this._checkRegistry();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_checkRegistry() {
|
|
36
|
+
const registryId = this.getAttribute('data-state-registry');
|
|
37
|
+
if (registryId && window.__forceCalendarRegistry && window.__forceCalendarRegistry[registryId]) {
|
|
38
|
+
this.setStateManager(window.__forceCalendarRegistry[registryId]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
20
42
|
set stateManager(manager) {
|
|
21
43
|
this.setStateManager(manager);
|
|
22
44
|
}
|
|
23
45
|
|
|
24
|
-
// Method alternative for Salesforce Locker Service compatibility
|
|
25
46
|
setStateManager(manager) {
|
|
26
47
|
if (this._stateManager === manager) return;
|
|
27
48
|
this._stateManager = manager;
|
|
@@ -10,6 +10,11 @@ import { DateUtils } from '../../utils/DateUtils.js';
|
|
|
10
10
|
import { StyleUtils } from '../../utils/StyleUtils.js';
|
|
11
11
|
|
|
12
12
|
export class MonthView extends BaseComponent {
|
|
13
|
+
// Observe data-state-registry attribute for Locker Service compatibility
|
|
14
|
+
static get observedAttributes() {
|
|
15
|
+
return ['data-state-registry'];
|
|
16
|
+
}
|
|
17
|
+
|
|
13
18
|
constructor() {
|
|
14
19
|
super();
|
|
15
20
|
this._stateManager = null;
|
|
@@ -19,6 +24,29 @@ export class MonthView extends BaseComponent {
|
|
|
19
24
|
};
|
|
20
25
|
}
|
|
21
26
|
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
// Check for registry ID on connect (may already be set)
|
|
30
|
+
this._checkRegistry();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
34
|
+
console.log('[MonthView] attributeChangedCallback:', name, oldValue, '->', newValue);
|
|
35
|
+
if (name === 'data-state-registry' && newValue) {
|
|
36
|
+
this._checkRegistry();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_checkRegistry() {
|
|
41
|
+
const registryId = this.getAttribute('data-state-registry');
|
|
42
|
+
console.log('[MonthView] Checking registry for ID:', registryId);
|
|
43
|
+
if (registryId && window.__forceCalendarRegistry && window.__forceCalendarRegistry[registryId]) {
|
|
44
|
+
const manager = window.__forceCalendarRegistry[registryId];
|
|
45
|
+
console.log('[MonthView] Found stateManager in registry');
|
|
46
|
+
this.setStateManager(manager);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
22
50
|
set stateManager(manager) {
|
|
23
51
|
console.log('[MonthView] stateManager setter called with:', !!manager);
|
|
24
52
|
this.setStateManager(manager);
|
|
@@ -10,6 +10,10 @@ import { StyleUtils } from '../../utils/StyleUtils.js';
|
|
|
10
10
|
import { DOMUtils } from '../../utils/DOMUtils.js';
|
|
11
11
|
|
|
12
12
|
export class WeekView extends BaseComponent {
|
|
13
|
+
static get observedAttributes() {
|
|
14
|
+
return ['data-state-registry'];
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
constructor() {
|
|
14
18
|
super();
|
|
15
19
|
this._stateManager = null;
|
|
@@ -17,11 +21,28 @@ export class WeekView extends BaseComponent {
|
|
|
17
21
|
this.hours = Array.from({ length: 24 }, (_, i) => i); // 0-23
|
|
18
22
|
}
|
|
19
23
|
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback();
|
|
26
|
+
this._checkRegistry();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
30
|
+
if (name === 'data-state-registry' && newValue) {
|
|
31
|
+
this._checkRegistry();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_checkRegistry() {
|
|
36
|
+
const registryId = this.getAttribute('data-state-registry');
|
|
37
|
+
if (registryId && window.__forceCalendarRegistry && window.__forceCalendarRegistry[registryId]) {
|
|
38
|
+
this.setStateManager(window.__forceCalendarRegistry[registryId]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
20
42
|
set stateManager(manager) {
|
|
21
43
|
this.setStateManager(manager);
|
|
22
44
|
}
|
|
23
45
|
|
|
24
|
-
// Method alternative for Salesforce Locker Service compatibility
|
|
25
46
|
setStateManager(manager) {
|
|
26
47
|
if (this._stateManager === manager) return;
|
|
27
48
|
this._stateManager = manager;
|