magtool 1.3.5 → 1.3.6
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/composition.js +54 -42
- package/package.json +1 -1
package/dist/composition.js
CHANGED
|
@@ -114,13 +114,13 @@ const C = (t) => {
|
|
|
114
114
|
};
|
|
115
115
|
t.forEach((l, d) => {
|
|
116
116
|
s[l.property] && (s[l.property].i = d);
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
|
|
117
|
+
const m = o[l.property];
|
|
118
|
+
if (m) {
|
|
119
|
+
m.i = d;
|
|
120
120
|
let g = window.$bigNumber(0);
|
|
121
|
-
e.forEach((
|
|
122
|
-
g = g.plus(
|
|
123
|
-
}), g = g.toNumber(),
|
|
121
|
+
e.forEach((w) => {
|
|
122
|
+
g = g.plus(w[l.property] || 0);
|
|
123
|
+
}), g = g.toNumber(), m.total = g, a.push(g);
|
|
124
124
|
} else
|
|
125
125
|
a.push("");
|
|
126
126
|
}), Object.keys(o).forEach((l) => {
|
|
@@ -129,17 +129,17 @@ const C = (t) => {
|
|
|
129
129
|
});
|
|
130
130
|
const c = o.taps.total ? window.$fa(o.spend.total / o.taps.total) : "0.00";
|
|
131
131
|
a[s.avgCPT.i] = c;
|
|
132
|
-
const
|
|
133
|
-
if (a[s.avgCPA.i] =
|
|
132
|
+
const u = o.installs.total ? window.$fa(o.spend.total / o.installs.total) : "0.00";
|
|
133
|
+
if (a[s.avgCPA.i] = u, s.avgCPM.i !== void 0) {
|
|
134
134
|
const l = o.impressions.total ? window.$fa(o.spend.total / (o.impressions.total / 1e3)) : "0.00";
|
|
135
135
|
a[s.avgCPM.i] = l;
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
a[s.cr.i] =
|
|
139
|
-
const
|
|
140
|
-
a[s.ttr.i] =
|
|
141
|
-
const
|
|
142
|
-
return a[s.IPM.i] =
|
|
137
|
+
const p = o.taps.total ? window.$fa(o.installs.total / o.taps.total * 100) : "0.00";
|
|
138
|
+
a[s.cr.i] = p;
|
|
139
|
+
const b = o.impressions.total ? window.$fa(o.taps.total / o.impressions.total * 100) : "0.00";
|
|
140
|
+
a[s.ttr.i] = b;
|
|
141
|
+
const h = o.impressions.total ? window.$fa(o.installs.total * 1e3 / o.impressions.total) : "0.00";
|
|
142
|
+
return a[s.IPM.i] = h, a;
|
|
143
143
|
}, H = (t) => {
|
|
144
144
|
const e = window.$map.asa.allMetric.obj;
|
|
145
145
|
return Object.keys(t).forEach((n) => {
|
|
@@ -160,7 +160,7 @@ const C = (t) => {
|
|
|
160
160
|
top: r + o.y - e,
|
|
161
161
|
behavior: "smooth"
|
|
162
162
|
});
|
|
163
|
-
},
|
|
163
|
+
}, P = async ({ app: t, langs: e, langObj: n }) => new Promise((r) => {
|
|
164
164
|
const o = [];
|
|
165
165
|
e.forEach((i) => {
|
|
166
166
|
i.use && o.push(i);
|
|
@@ -172,10 +172,10 @@ const C = (t) => {
|
|
|
172
172
|
const s = (i, c) => {
|
|
173
173
|
if (i)
|
|
174
174
|
if (c && globalThis.$getType(c) === "Object") {
|
|
175
|
-
let
|
|
176
|
-
return Object.keys(c).forEach((
|
|
177
|
-
|
|
178
|
-
}),
|
|
175
|
+
let u = a[i] || i;
|
|
176
|
+
return Object.keys(c).forEach((p) => {
|
|
177
|
+
u[`$${p}$`] = c[p];
|
|
178
|
+
}), u;
|
|
179
179
|
} else
|
|
180
180
|
return a[i] || i;
|
|
181
181
|
else
|
|
@@ -187,27 +187,27 @@ const C = (t) => {
|
|
|
187
187
|
}), x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
188
188
|
__proto__: null,
|
|
189
189
|
pageScrollTo: k,
|
|
190
|
-
useLang:
|
|
191
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
192
|
-
let
|
|
193
|
-
const
|
|
194
|
-
|
|
190
|
+
useLang: P
|
|
191
|
+
}, Symbol.toStringTag, { value: "Module" })), f = [];
|
|
192
|
+
let T = 0;
|
|
193
|
+
const v = function(t) {
|
|
194
|
+
f.forEach((e) => {
|
|
195
195
|
if (e.time === void 0 || e.lastTime === 0 || t - e.lastTime >= e.time) {
|
|
196
196
|
e.cb(t), e.lastTime = t;
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
}),
|
|
199
|
+
}), f.length && window.requestAnimationFrame(v);
|
|
200
200
|
}, W = function(t, e = 1e3) {
|
|
201
|
-
return
|
|
201
|
+
return T++, f.push({
|
|
202
202
|
cb: t,
|
|
203
203
|
time: e,
|
|
204
204
|
lastTime: 0,
|
|
205
|
-
id:
|
|
206
|
-
}),
|
|
205
|
+
id: T
|
|
206
|
+
}), f.length === 1 && window.requestAnimationFrame(v), T;
|
|
207
207
|
}, q = function(t) {
|
|
208
|
-
for (let e = 0; e <
|
|
209
|
-
if (
|
|
210
|
-
|
|
208
|
+
for (let e = 0; e < f.length; e++)
|
|
209
|
+
if (f[e].id === t) {
|
|
210
|
+
f.splice(e, 1);
|
|
211
211
|
break;
|
|
212
212
|
}
|
|
213
213
|
}, N = { useRaf: W, clearRaf: q }, z = async (t) => new Promise((e) => {
|
|
@@ -222,27 +222,39 @@ const T = function(t) {
|
|
|
222
222
|
a.setAttribute("lang", `${i[0]}-${i[1].toUpperCase()}`);
|
|
223
223
|
const c = i.includes("ar") ? "rtl" : "ltr";
|
|
224
224
|
if (a.setAttribute("dir", c), a.classList.add(localStorage.getItem("theme") || n), o)
|
|
225
|
-
await
|
|
225
|
+
await P({ app: o, langs: globalThis.config.langs || [] });
|
|
226
226
|
else
|
|
227
227
|
throw new Error(
|
|
228
228
|
"app is not defined, please check your vue app create from createApp() function"
|
|
229
229
|
);
|
|
230
230
|
e();
|
|
231
231
|
}), Q = async () => new Promise(async (t) => {
|
|
232
|
-
const { availWidth: e, availHeight: n } = globalThis.screen, { clientHeight: r } = globalThis.document.body, o = globalThis.config.page.paddingLeft || 32, a = globalThis.config.page.paddingRight || 32, s = e - o - a, i = globalThis.config.page.frameHeader || 82, c = globalThis.config.page.frameFooter || 36,
|
|
232
|
+
const { availWidth: e, availHeight: n } = globalThis.screen, { clientHeight: r } = globalThis.document.body, o = globalThis.config.page.paddingLeft || 32, a = globalThis.config.page.paddingRight || 32, s = e - o - a, i = globalThis.config.page.frameHeader || 82, c = globalThis.config.page.frameFooter || 36, u = r - i - c, p = globalThis.config.page.contentPaddingLeft || 16, b = globalThis.config.page.contentPaddingLeft || 16, h = s - p - b, l = globalThis.config.page.tableHeader || 56, d = globalThis.config.page.tableFooter || 56, m = r - i - l - d, g = globalThis.config.page.drawerHeader || 64, w = r - g, $ = globalThis.navigator.userAgent.match(
|
|
233
233
|
/(phone|pad|pod|iPhone|iPod|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
234
|
-
) ? "h5" : "pc",
|
|
235
|
-
|
|
234
|
+
) ? "h5" : "pc", y = /iPhone|iPad|iPod/i.test(globalThis.navigator.userAgent);
|
|
235
|
+
globalThis.config ? globalThis.config.options = {
|
|
236
236
|
screenWidth: e,
|
|
237
237
|
screenHeight: n,
|
|
238
238
|
pageWidth: s,
|
|
239
|
-
pageHeight:
|
|
240
|
-
contentWidth:
|
|
241
|
-
tableHeight:
|
|
242
|
-
drawerHeight:
|
|
243
|
-
device:
|
|
244
|
-
isIOS:
|
|
245
|
-
}
|
|
239
|
+
pageHeight: u,
|
|
240
|
+
contentWidth: h,
|
|
241
|
+
tableHeight: m,
|
|
242
|
+
drawerHeight: w,
|
|
243
|
+
device: $,
|
|
244
|
+
isIOS: y
|
|
245
|
+
} : globalThis.config = {
|
|
246
|
+
options: {
|
|
247
|
+
screenWidth: e,
|
|
248
|
+
screenHeight: n,
|
|
249
|
+
pageWidth: s,
|
|
250
|
+
pageHeight: u,
|
|
251
|
+
contentWidth: h,
|
|
252
|
+
tableHeight: m,
|
|
253
|
+
drawerHeight: w,
|
|
254
|
+
device: $,
|
|
255
|
+
isIOS: y
|
|
256
|
+
}
|
|
257
|
+
}, t();
|
|
246
258
|
}), V = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
247
259
|
__proto__: null,
|
|
248
260
|
initColorfulIcon: z,
|