- 1 :
import { ABaseMelEvent } from '../../../../mel_metapage/js/lib/html/JsHtml/CustomAttributes/events.js';
- 2 :
- 3 :
/**
- 4 :
* @callback EventSourceCallback
- 5 :
* @param {external:moment} start
- 6 :
* @param {external:moment} end
- 7 :
* @param {string} timezone
- 8 :
* @param {function} callback
- 9 :
*/
- 10 :
- 11 :
export class SourceEvent extends ABaseMelEvent {
- 12 :
#events = [];
- 13 :
constructor(args) {
- 14 :
super('fc.loading.source', args.caller);
- 15 :
- 16 :
this.sourceID = args.id;
- 17 :
this.start = args.start;
- 18 :
this.end = args.end;
- 19 :
this.timezone = args.timezone;
- 20 :
}
- 21 :
- 22 :
addEvent(data) {
- 23 :
return this.addEvents(data);
- 24 :
}
- 25 :
- 26 :
addEvents(...events) {
- 27 :
return this.#events.push(...events);
- 28 :
}
- 29 :
- 30 :
get events() {
- 31 :
return this.#events;
- 32 :
}
- 33 :
}
- 34 :
//api:fc.render.event
- 35 :
//api:fc.render.resource
- 36 :
export class RenderEvent extends ABaseMelEvent {
- 37 :
constructor(type, caller, obj, node) {
- 38 :
super(`fc.render.${type}`, caller);
- 39 :
this.itemData = obj;
- 40 :
this.itemNode = node;
- 41 :
}
- 42 :
}
- 43 :
- 44 :
export class ViewRender extends ABaseMelEvent {
- 45 :
#view = null;
- 46 :
#element = null;
- 47 :
constructor(view, element, caller) {
- 48 :
super('view.render', caller);
- 49 :
- 50 :
this.#view = view;
- 51 :
this.#element = element;
- 52 :
}
- 53 :
- 54 :
get view() {
- 55 :
return this.#view;
- 56 :
}
- 57 :
- 58 :
get viewNode() {
- 59 :
return this.#element;
- 60 :
}
- 61 :
- 62 :
get viewTitle() {
- 63 :
return this.view.title;
- 64 :
}
- 65 :
- 66 :
get start() {
- 67 :
return this.view.start;
- 68 :
}
- 69 :
- 70 :
get end() {
- 71 :
return this.view.end;
- 72 :
}
- 73 :
- 74 :
static get EventType() {
- 75 :
return 'api:view.render';
- 76 :
}
- 77 :
}