50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
import { executeOnSingleOrMultiple } from "../../../../Utils/Utils";
|
|
export class DivEvent {
|
|
constructor() {
|
|
this.selectors = [];
|
|
this.enable = false;
|
|
this.mode = [];
|
|
this.type = "circle";
|
|
}
|
|
get el() {
|
|
return this.elementId;
|
|
}
|
|
set el(value) {
|
|
this.elementId = value;
|
|
}
|
|
get elementId() {
|
|
return this.ids;
|
|
}
|
|
set elementId(value) {
|
|
this.ids = value;
|
|
}
|
|
get ids() {
|
|
return executeOnSingleOrMultiple(this.selectors, (t) => t.replace("#", ""));
|
|
}
|
|
set ids(value) {
|
|
this.selectors = executeOnSingleOrMultiple(value, (t) => `#${t}`);
|
|
}
|
|
load(data) {
|
|
var _a, _b;
|
|
if (!data) {
|
|
return;
|
|
}
|
|
const ids = (_b = (_a = data.ids) !== null && _a !== void 0 ? _a : data.elementId) !== null && _b !== void 0 ? _b : data.el;
|
|
if (ids !== undefined) {
|
|
this.ids = ids;
|
|
}
|
|
if (data.selectors !== undefined) {
|
|
this.selectors = data.selectors;
|
|
}
|
|
if (data.enable !== undefined) {
|
|
this.enable = data.enable;
|
|
}
|
|
if (data.mode !== undefined) {
|
|
this.mode = data.mode;
|
|
}
|
|
if (data.type !== undefined) {
|
|
this.type = data.type;
|
|
}
|
|
}
|
|
}
|