@kong-ui-public/dashboard-renderer 1.2.1 → 1.2.2
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/dashboard-renderer.es.js +534 -541
- package/dist/dashboard-renderer.umd.js +4 -4
- package/dist/style.css +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/layout/DraggableGridLayout.vue.d.ts +1 -15
- package/dist/types/components/layout/DraggableGridLayout.vue.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -3,17 +3,17 @@ var Ye = (u) => {
|
|
|
3
3
|
throw TypeError(u);
|
|
4
4
|
};
|
|
5
5
|
var At = (u, e, t) => e in u ? Nt(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
6
|
-
var Xe = (u, e, t) => At(u, typeof e != "symbol" ? e + "" : e, t),
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var Xe = (u, e, t) => At(u, typeof e != "symbol" ? e + "" : e, t), Pe = (u, e, t) => e.has(u) || Ye("Cannot " + t);
|
|
7
|
+
var _ = (u, e, t) => (Pe(u, e, "read from private field"), t ? t.call(u) : e.get(u)), H = (u, e, t) => e.has(u) ? Ye("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(u) : e.set(u, t), k = (u, e, t, i) => (Pe(u, e, "write to private field"), i ? i.call(u, t) : e.set(u, t), t), O = (u, e, t) => (Pe(u, e, "access private method"), t);
|
|
8
|
+
var me = (u, e, t, i) => ({
|
|
9
9
|
set _(s) {
|
|
10
10
|
k(u, e, s, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return
|
|
13
|
+
return _(u, e, i);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { ref as
|
|
16
|
+
import { ref as F, watchEffect as Ht, inject as le, provide as Ot, defineComponent as U, onUnmounted as $e, computed as N, watch as Fe, resolveComponent as re, unref as D, openBlock as R, createBlock as A, withCtx as M, createTextVNode as ye, toDisplayString as Z, renderSlot as He, createCommentVNode as V, useCssVars as Oe, createElementVNode as de, createVNode as ee, mergeProps as lt, createSlots as ht, createElementBlock as B, normalizeProps as Lt, guardReactiveProps as Mt, defineAsyncComponent as It, nextTick as dt, normalizeClass as ut, resolveDynamicComponent as ct, onMounted as ft, Fragment as gt, renderList as pt, normalizeStyle as je } from "vue";
|
|
17
17
|
import { stripUnknownFilters as Pt, Timeframe as qt, TimePeriods as mt, TIMEFRAME_LOOKUP as Bt, formatTime as Qe, msToGranularity as $t } from "@kong-ui-public/analytics-utilities";
|
|
18
18
|
import { SimpleChart as Ft, AnalyticsChart as Ut, TopNTable as Gt, CsvExportModal as Wt } from "@kong-ui-public/analytics-chart";
|
|
19
19
|
import Kt from "swrv";
|
|
@@ -28,8 +28,8 @@ const Zt = (u) => {
|
|
|
28
28
|
return u ? !!// TODO: revisit: currently only the first check ever matters?
|
|
29
29
|
((e = Object.keys(u)) != null && e.length || (t = u.data) != null && t.length || (s = (i = u.data) == null ? void 0 : i.data) != null && s.length || !((r = u.data) != null && r.data) && typeof u.data == "object" && Object.keys(u == null ? void 0 : u.data).length) : !1;
|
|
30
30
|
};
|
|
31
|
-
function ei(u =
|
|
32
|
-
const s =
|
|
31
|
+
function ei(u = F({}), e, t, i = Zt) {
|
|
32
|
+
const s = F(
|
|
33
33
|
"PENDING"
|
|
34
34
|
/* PENDING */
|
|
35
35
|
);
|
|
@@ -93,9 +93,9 @@ function oi() {
|
|
|
93
93
|
// Translation component <i18n-t>
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
const Ue = 170,
|
|
96
|
+
const Ue = 170, ne = "analytics-query-provider", Je = "{entity-id}", ai = "{cp-id}", li = "{timeframe}", hi = 30 * 1e3;
|
|
97
97
|
function di() {
|
|
98
|
-
const u =
|
|
98
|
+
const u = le(ne);
|
|
99
99
|
return {
|
|
100
100
|
evaluateFeatureFlag: (t, i) => u ? u.evaluateFeatureFlagFn(t, i) : i
|
|
101
101
|
};
|
|
@@ -115,8 +115,8 @@ var _t = { exports: {} };
|
|
|
115
115
|
function r(d, l, a, h, f) {
|
|
116
116
|
if (typeof a != "function")
|
|
117
117
|
throw new TypeError("The listener must be a function");
|
|
118
|
-
var
|
|
119
|
-
return d._events[m] ? d._events[m].fn ? d._events[m] = [d._events[m],
|
|
118
|
+
var p = new s(a, h || d, f), m = t ? t + l : l;
|
|
119
|
+
return d._events[m] ? d._events[m].fn ? d._events[m] = [d._events[m], p] : d._events[m].push(p) : (d._events[m] = p, d._eventsCount++), d;
|
|
120
120
|
}
|
|
121
121
|
function o(d, l) {
|
|
122
122
|
--d._eventsCount === 0 ? d._events = new i() : delete d._events[l];
|
|
@@ -134,54 +134,54 @@ var _t = { exports: {} };
|
|
|
134
134
|
var a = t ? t + l : l, h = this._events[a];
|
|
135
135
|
if (!h) return [];
|
|
136
136
|
if (h.fn) return [h.fn];
|
|
137
|
-
for (var f = 0,
|
|
137
|
+
for (var f = 0, p = h.length, m = new Array(p); f < p; f++)
|
|
138
138
|
m[f] = h[f].fn;
|
|
139
139
|
return m;
|
|
140
140
|
}, n.prototype.listenerCount = function(l) {
|
|
141
141
|
var a = t ? t + l : l, h = this._events[a];
|
|
142
142
|
return h ? h.fn ? 1 : h.length : 0;
|
|
143
|
-
}, n.prototype.emit = function(l, a, h, f,
|
|
143
|
+
}, n.prototype.emit = function(l, a, h, f, p, m) {
|
|
144
144
|
var y = t ? t + l : l;
|
|
145
145
|
if (!this._events[y]) return !1;
|
|
146
|
-
var
|
|
147
|
-
if (
|
|
148
|
-
switch (
|
|
146
|
+
var g = this._events[y], C = arguments.length, S, v;
|
|
147
|
+
if (g.fn) {
|
|
148
|
+
switch (g.once && this.removeListener(l, g.fn, void 0, !0), C) {
|
|
149
149
|
case 1:
|
|
150
|
-
return
|
|
150
|
+
return g.fn.call(g.context), !0;
|
|
151
151
|
case 2:
|
|
152
|
-
return
|
|
152
|
+
return g.fn.call(g.context, a), !0;
|
|
153
153
|
case 3:
|
|
154
|
-
return
|
|
154
|
+
return g.fn.call(g.context, a, h), !0;
|
|
155
155
|
case 4:
|
|
156
|
-
return
|
|
156
|
+
return g.fn.call(g.context, a, h, f), !0;
|
|
157
157
|
case 5:
|
|
158
|
-
return
|
|
158
|
+
return g.fn.call(g.context, a, h, f, p), !0;
|
|
159
159
|
case 6:
|
|
160
|
-
return
|
|
160
|
+
return g.fn.call(g.context, a, h, f, p, m), !0;
|
|
161
161
|
}
|
|
162
|
-
for (
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
for (v = 1, S = new Array(C - 1); v < C; v++)
|
|
163
|
+
S[v - 1] = arguments[v];
|
|
164
|
+
g.fn.apply(g.context, S);
|
|
165
165
|
} else {
|
|
166
|
-
var
|
|
167
|
-
for (
|
|
168
|
-
switch (
|
|
166
|
+
var z = g.length, x;
|
|
167
|
+
for (v = 0; v < z; v++)
|
|
168
|
+
switch (g[v].once && this.removeListener(l, g[v].fn, void 0, !0), C) {
|
|
169
169
|
case 1:
|
|
170
|
-
|
|
170
|
+
g[v].fn.call(g[v].context);
|
|
171
171
|
break;
|
|
172
172
|
case 2:
|
|
173
|
-
|
|
173
|
+
g[v].fn.call(g[v].context, a);
|
|
174
174
|
break;
|
|
175
175
|
case 3:
|
|
176
|
-
|
|
176
|
+
g[v].fn.call(g[v].context, a, h);
|
|
177
177
|
break;
|
|
178
178
|
case 4:
|
|
179
|
-
|
|
179
|
+
g[v].fn.call(g[v].context, a, h, f);
|
|
180
180
|
break;
|
|
181
181
|
default:
|
|
182
|
-
if (!
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
if (!S) for (x = 1, S = new Array(C - 1); x < C; x++)
|
|
183
|
+
S[x - 1] = arguments[x];
|
|
184
|
+
g[v].fn.apply(g[v].context, S);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
return !0;
|
|
@@ -190,17 +190,17 @@ var _t = { exports: {} };
|
|
|
190
190
|
}, n.prototype.once = function(l, a, h) {
|
|
191
191
|
return r(this, l, a, h, !0);
|
|
192
192
|
}, n.prototype.removeListener = function(l, a, h, f) {
|
|
193
|
-
var
|
|
194
|
-
if (!this._events[
|
|
193
|
+
var p = t ? t + l : l;
|
|
194
|
+
if (!this._events[p]) return this;
|
|
195
195
|
if (!a)
|
|
196
|
-
return o(this,
|
|
197
|
-
var m = this._events[
|
|
196
|
+
return o(this, p), this;
|
|
197
|
+
var m = this._events[p];
|
|
198
198
|
if (m.fn)
|
|
199
|
-
m.fn === a && (!f || m.once) && (!h || m.context === h) && o(this,
|
|
199
|
+
m.fn === a && (!f || m.once) && (!h || m.context === h) && o(this, p);
|
|
200
200
|
else {
|
|
201
|
-
for (var y = 0,
|
|
202
|
-
(m[y].fn !== a || f && !m[y].once || h && m[y].context !== h) &&
|
|
203
|
-
|
|
201
|
+
for (var y = 0, g = [], C = m.length; y < C; y++)
|
|
202
|
+
(m[y].fn !== a || f && !m[y].once || h && m[y].context !== h) && g.push(m[y]);
|
|
203
|
+
g.length ? this._events[p] = g.length === 1 ? g[0] : g : o(this, p);
|
|
204
204
|
}
|
|
205
205
|
return this;
|
|
206
206
|
}, n.prototype.removeAllListeners = function(l) {
|
|
@@ -236,10 +236,10 @@ function pi(u, e) {
|
|
|
236
236
|
if (typeof t != "number" || Math.sign(t) !== 1)
|
|
237
237
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
238
238
|
if (e.signal) {
|
|
239
|
-
const { signal:
|
|
240
|
-
|
|
241
|
-
h(et(
|
|
242
|
-
},
|
|
239
|
+
const { signal: p } = e;
|
|
240
|
+
p.aborted && h(et(p)), n = () => {
|
|
241
|
+
h(et(p));
|
|
242
|
+
}, p.addEventListener("abort", n, { once: !0 });
|
|
243
243
|
}
|
|
244
244
|
if (t === Number.POSITIVE_INFINITY) {
|
|
245
245
|
u.then(a, h);
|
|
@@ -250,8 +250,8 @@ function pi(u, e) {
|
|
|
250
250
|
if (i) {
|
|
251
251
|
try {
|
|
252
252
|
a(i());
|
|
253
|
-
} catch (
|
|
254
|
-
h(
|
|
253
|
+
} catch (p) {
|
|
254
|
+
h(p);
|
|
255
255
|
}
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
@@ -259,8 +259,8 @@ function pi(u, e) {
|
|
|
259
259
|
}, t), (async () => {
|
|
260
260
|
try {
|
|
261
261
|
a(await u);
|
|
262
|
-
} catch (
|
|
263
|
-
h(
|
|
262
|
+
} catch (p) {
|
|
263
|
+
h(p);
|
|
264
264
|
}
|
|
265
265
|
})();
|
|
266
266
|
}).finally(() => {
|
|
@@ -279,10 +279,10 @@ function mi(u, e, t) {
|
|
|
279
279
|
}
|
|
280
280
|
return i;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var G;
|
|
283
283
|
class yi {
|
|
284
284
|
constructor() {
|
|
285
|
-
H(this,
|
|
285
|
+
H(this, G, []);
|
|
286
286
|
}
|
|
287
287
|
enqueue(e, t) {
|
|
288
288
|
t = {
|
|
@@ -294,56 +294,56 @@ class yi {
|
|
|
294
294
|
id: t.id,
|
|
295
295
|
run: e
|
|
296
296
|
};
|
|
297
|
-
if (this.size === 0 ||
|
|
298
|
-
|
|
297
|
+
if (this.size === 0 || _(this, G)[this.size - 1].priority >= t.priority) {
|
|
298
|
+
_(this, G).push(i);
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
const s = mi(
|
|
302
|
-
|
|
301
|
+
const s = mi(_(this, G), i, (r, o) => o.priority - r.priority);
|
|
302
|
+
_(this, G).splice(s, 0, i);
|
|
303
303
|
}
|
|
304
304
|
setPriority(e, t) {
|
|
305
|
-
const i =
|
|
305
|
+
const i = _(this, G).findIndex((r) => r.id === e);
|
|
306
306
|
if (i === -1)
|
|
307
307
|
throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
|
|
308
|
-
const [s] =
|
|
308
|
+
const [s] = _(this, G).splice(i, 1);
|
|
309
309
|
this.enqueue(s.run, { priority: t, id: e });
|
|
310
310
|
}
|
|
311
311
|
dequeue() {
|
|
312
|
-
const e =
|
|
312
|
+
const e = _(this, G).shift();
|
|
313
313
|
return e == null ? void 0 : e.run;
|
|
314
314
|
}
|
|
315
315
|
filter(e) {
|
|
316
|
-
return
|
|
316
|
+
return _(this, G).filter((t) => t.priority === e.priority).map((t) => t.run);
|
|
317
317
|
}
|
|
318
318
|
get size() {
|
|
319
|
-
return
|
|
319
|
+
return _(this, G).length;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
|
|
323
|
-
var
|
|
322
|
+
G = new WeakMap();
|
|
323
|
+
var ue, ce, se, be, fe, we, W, ge, P, Ee, K, pe, J, xe, Ae, T, wt, Et, xt, Ct, Rt, Ce, qe, Be, Re, Tt, Te;
|
|
324
324
|
class vi extends fi {
|
|
325
325
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
326
326
|
constructor(t) {
|
|
327
327
|
var i, s;
|
|
328
328
|
super();
|
|
329
|
-
H(this,
|
|
330
|
-
H(this, he);
|
|
331
|
-
H(this, de);
|
|
332
|
-
H(this, ie, 0);
|
|
333
|
-
H(this, ve);
|
|
329
|
+
H(this, T);
|
|
334
330
|
H(this, ue);
|
|
335
|
-
H(this, _e, 0);
|
|
336
|
-
H(this, G);
|
|
337
331
|
H(this, ce);
|
|
338
|
-
H(this,
|
|
332
|
+
H(this, se, 0);
|
|
339
333
|
H(this, be);
|
|
340
|
-
H(this, W, 0);
|
|
341
|
-
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
342
334
|
H(this, fe);
|
|
343
|
-
H(this,
|
|
344
|
-
H(this,
|
|
335
|
+
H(this, we, 0);
|
|
336
|
+
H(this, W);
|
|
337
|
+
H(this, ge);
|
|
338
|
+
H(this, P);
|
|
339
|
+
H(this, Ee);
|
|
340
|
+
H(this, K, 0);
|
|
341
|
+
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
342
|
+
H(this, pe);
|
|
343
|
+
H(this, J);
|
|
344
|
+
H(this, xe);
|
|
345
345
|
// Use to assign a unique identifier to a promise function, if not explicitly specified
|
|
346
|
-
H(this,
|
|
346
|
+
H(this, Ae, 1n);
|
|
347
347
|
/**
|
|
348
348
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
349
349
|
|
|
@@ -362,15 +362,15 @@ class vi extends fi {
|
|
|
362
362
|
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((i = t.intervalCap) == null ? void 0 : i.toString()) ?? ""}\` (${typeof t.intervalCap})`);
|
|
363
363
|
if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
|
|
364
364
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s = t.interval) == null ? void 0 : s.toString()) ?? ""}\` (${typeof t.interval})`);
|
|
365
|
-
k(this,
|
|
365
|
+
k(this, ue, t.carryoverConcurrencyCount), k(this, ce, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), k(this, be, t.intervalCap), k(this, fe, t.interval), k(this, P, new t.queueClass()), k(this, Ee, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, k(this, xe, t.throwOnTimeout === !0), k(this, J, t.autoStart === !1);
|
|
366
366
|
}
|
|
367
367
|
get concurrency() {
|
|
368
|
-
return
|
|
368
|
+
return _(this, pe);
|
|
369
369
|
}
|
|
370
370
|
set concurrency(t) {
|
|
371
371
|
if (!(typeof t == "number" && t >= 1))
|
|
372
372
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
|
|
373
|
-
k(this,
|
|
373
|
+
k(this, pe, t), O(this, T, Re).call(this);
|
|
374
374
|
}
|
|
375
375
|
/**
|
|
376
376
|
Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
|
|
@@ -409,21 +409,21 @@ class vi extends fi {
|
|
|
409
409
|
Here, the promise function with `id: '🦀'` executes last.
|
|
410
410
|
*/
|
|
411
411
|
setPriority(t, i) {
|
|
412
|
-
|
|
412
|
+
_(this, P).setPriority(t, i);
|
|
413
413
|
}
|
|
414
414
|
async add(t, i = {}) {
|
|
415
|
-
return i.id ?? (i.id = (
|
|
415
|
+
return i.id ?? (i.id = (me(this, Ae)._++).toString()), i = {
|
|
416
416
|
timeout: this.timeout,
|
|
417
|
-
throwOnTimeout:
|
|
417
|
+
throwOnTimeout: _(this, xe),
|
|
418
418
|
...i
|
|
419
419
|
}, new Promise((s, r) => {
|
|
420
|
-
|
|
420
|
+
_(this, P).enqueue(async () => {
|
|
421
421
|
var o;
|
|
422
|
-
|
|
422
|
+
me(this, K)._++, me(this, se)._++;
|
|
423
423
|
try {
|
|
424
424
|
(o = i.signal) == null || o.throwIfAborted();
|
|
425
425
|
let n = t({ signal: i.signal });
|
|
426
|
-
i.timeout && (n = pi(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, O(this,
|
|
426
|
+
i.timeout && (n = pi(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, O(this, T, Tt).call(this, i.signal)]));
|
|
427
427
|
const d = await n;
|
|
428
428
|
s(d), this.emit("completed", d);
|
|
429
429
|
} catch (n) {
|
|
@@ -433,9 +433,9 @@ class vi extends fi {
|
|
|
433
433
|
}
|
|
434
434
|
r(n), this.emit("error", n);
|
|
435
435
|
} finally {
|
|
436
|
-
O(this,
|
|
436
|
+
O(this, T, xt).call(this);
|
|
437
437
|
}
|
|
438
|
-
}, i), this.emit("add"), O(this,
|
|
438
|
+
}, i), this.emit("add"), O(this, T, Ce).call(this);
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
async addAll(t, i) {
|
|
@@ -445,19 +445,19 @@ class vi extends fi {
|
|
|
445
445
|
Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
|
|
446
446
|
*/
|
|
447
447
|
start() {
|
|
448
|
-
return
|
|
448
|
+
return _(this, J) ? (k(this, J, !1), O(this, T, Re).call(this), this) : this;
|
|
449
449
|
}
|
|
450
450
|
/**
|
|
451
451
|
Put queue execution on hold.
|
|
452
452
|
*/
|
|
453
453
|
pause() {
|
|
454
|
-
k(this,
|
|
454
|
+
k(this, J, !0);
|
|
455
455
|
}
|
|
456
456
|
/**
|
|
457
457
|
Clear the queue.
|
|
458
458
|
*/
|
|
459
459
|
clear() {
|
|
460
|
-
k(this, P, new (
|
|
460
|
+
k(this, P, new (_(this, Ee))());
|
|
461
461
|
}
|
|
462
462
|
/**
|
|
463
463
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -465,7 +465,7 @@ class vi extends fi {
|
|
|
465
465
|
@returns A promise that settles when the queue becomes empty.
|
|
466
466
|
*/
|
|
467
467
|
async onEmpty() {
|
|
468
|
-
|
|
468
|
+
_(this, P).size !== 0 && await O(this, T, Te).call(this, "empty");
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
471
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -475,7 +475,7 @@ class vi extends fi {
|
|
|
475
475
|
Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
|
|
476
476
|
*/
|
|
477
477
|
async onSizeLessThan(t) {
|
|
478
|
-
|
|
478
|
+
_(this, P).size < t || await O(this, T, Te).call(this, "next", () => _(this, P).size < t);
|
|
479
479
|
}
|
|
480
480
|
/**
|
|
481
481
|
The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
|
|
@@ -483,13 +483,13 @@ class vi extends fi {
|
|
|
483
483
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
484
484
|
*/
|
|
485
485
|
async onIdle() {
|
|
486
|
-
|
|
486
|
+
_(this, K) === 0 && _(this, P).size === 0 || await O(this, T, Te).call(this, "idle");
|
|
487
487
|
}
|
|
488
488
|
/**
|
|
489
489
|
Size of the queue, the number of queued items waiting to run.
|
|
490
490
|
*/
|
|
491
491
|
get size() {
|
|
492
|
-
return
|
|
492
|
+
return _(this, P).size;
|
|
493
493
|
}
|
|
494
494
|
/**
|
|
495
495
|
Size of the queue, filtered by the given options.
|
|
@@ -497,63 +497,63 @@ class vi extends fi {
|
|
|
497
497
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
498
498
|
*/
|
|
499
499
|
sizeBy(t) {
|
|
500
|
-
return
|
|
500
|
+
return _(this, P).filter(t).length;
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
Number of running items (no longer in the queue).
|
|
504
504
|
*/
|
|
505
505
|
get pending() {
|
|
506
|
-
return
|
|
506
|
+
return _(this, K);
|
|
507
507
|
}
|
|
508
508
|
/**
|
|
509
509
|
Whether the queue is currently paused.
|
|
510
510
|
*/
|
|
511
511
|
get isPaused() {
|
|
512
|
-
return
|
|
512
|
+
return _(this, J);
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
|
|
516
|
-
return
|
|
515
|
+
ue = new WeakMap(), ce = new WeakMap(), se = new WeakMap(), be = new WeakMap(), fe = new WeakMap(), we = new WeakMap(), W = new WeakMap(), ge = new WeakMap(), P = new WeakMap(), Ee = new WeakMap(), K = new WeakMap(), pe = new WeakMap(), J = new WeakMap(), xe = new WeakMap(), Ae = new WeakMap(), T = new WeakSet(), wt = function() {
|
|
516
|
+
return _(this, ce) || _(this, se) < _(this, be);
|
|
517
517
|
}, Et = function() {
|
|
518
|
-
return
|
|
518
|
+
return _(this, K) < _(this, pe);
|
|
519
519
|
}, xt = function() {
|
|
520
|
-
|
|
520
|
+
me(this, K)._--, O(this, T, Ce).call(this), this.emit("next");
|
|
521
521
|
}, Ct = function() {
|
|
522
|
-
O(this,
|
|
522
|
+
O(this, T, Be).call(this), O(this, T, qe).call(this), k(this, ge, void 0);
|
|
523
523
|
}, Rt = function() {
|
|
524
524
|
const t = Date.now();
|
|
525
|
-
if (
|
|
526
|
-
const i =
|
|
525
|
+
if (_(this, W) === void 0) {
|
|
526
|
+
const i = _(this, we) - t;
|
|
527
527
|
if (i < 0)
|
|
528
|
-
k(this,
|
|
528
|
+
k(this, se, _(this, ue) ? _(this, K) : 0);
|
|
529
529
|
else
|
|
530
|
-
return
|
|
531
|
-
O(this,
|
|
530
|
+
return _(this, ge) === void 0 && k(this, ge, setTimeout(() => {
|
|
531
|
+
O(this, T, Ct).call(this);
|
|
532
532
|
}, i)), !0;
|
|
533
533
|
}
|
|
534
534
|
return !1;
|
|
535
535
|
}, Ce = function() {
|
|
536
|
-
if (
|
|
537
|
-
return
|
|
538
|
-
if (!
|
|
539
|
-
const t = !
|
|
540
|
-
if (
|
|
541
|
-
const i =
|
|
542
|
-
return i ? (this.emit("active"), i(), t && O(this,
|
|
536
|
+
if (_(this, P).size === 0)
|
|
537
|
+
return _(this, W) && clearInterval(_(this, W)), k(this, W, void 0), this.emit("empty"), _(this, K) === 0 && this.emit("idle"), !1;
|
|
538
|
+
if (!_(this, J)) {
|
|
539
|
+
const t = !_(this, T, Rt);
|
|
540
|
+
if (_(this, T, wt) && _(this, T, Et)) {
|
|
541
|
+
const i = _(this, P).dequeue();
|
|
542
|
+
return i ? (this.emit("active"), i(), t && O(this, T, qe).call(this), !0) : !1;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
return !1;
|
|
546
|
+
}, qe = function() {
|
|
547
|
+
_(this, ce) || _(this, W) !== void 0 || (k(this, W, setInterval(() => {
|
|
548
|
+
O(this, T, Be).call(this);
|
|
549
|
+
}, _(this, fe))), k(this, we, Date.now() + _(this, fe)));
|
|
546
550
|
}, Be = function() {
|
|
547
|
-
|
|
548
|
-
O(this, z, $e).call(this);
|
|
549
|
-
}, v(this, ue))), k(this, _e, Date.now() + v(this, ue)));
|
|
550
|
-
}, $e = function() {
|
|
551
|
-
v(this, ie) === 0 && v(this, W) === 0 && v(this, G) && (clearInterval(v(this, G)), k(this, G, void 0)), k(this, ie, v(this, he) ? v(this, W) : 0), O(this, z, Re).call(this);
|
|
551
|
+
_(this, se) === 0 && _(this, K) === 0 && _(this, W) && (clearInterval(_(this, W)), k(this, W, void 0)), k(this, se, _(this, ue) ? _(this, K) : 0), O(this, T, Re).call(this);
|
|
552
552
|
}, /**
|
|
553
553
|
Executes all queued functions until it reaches the limit.
|
|
554
554
|
*/
|
|
555
555
|
Re = function() {
|
|
556
|
-
for (; O(this,
|
|
556
|
+
for (; O(this, T, Ce).call(this); )
|
|
557
557
|
;
|
|
558
558
|
}, Tt = async function(t) {
|
|
559
559
|
return new Promise((i, s) => {
|
|
@@ -570,7 +570,7 @@ Re = function() {
|
|
|
570
570
|
});
|
|
571
571
|
};
|
|
572
572
|
const _i = () => {
|
|
573
|
-
const u = yt(), e =
|
|
573
|
+
const u = yt(), e = le(ne);
|
|
574
574
|
if (!e)
|
|
575
575
|
return;
|
|
576
576
|
if (e.queryFnOverride) {
|
|
@@ -587,12 +587,12 @@ const _i = () => {
|
|
|
587
587
|
queryFnOverride: !0,
|
|
588
588
|
queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
|
|
589
589
|
};
|
|
590
|
-
Ot(
|
|
591
|
-
},
|
|
590
|
+
Ot(ne, i);
|
|
591
|
+
}, te = {
|
|
592
592
|
useI18n: oi,
|
|
593
593
|
useEvaluateFeatureFlag: di,
|
|
594
594
|
useRequestQueue: _i
|
|
595
|
-
}, Ge = /* @__PURE__ */
|
|
595
|
+
}, Ge = /* @__PURE__ */ U({
|
|
596
596
|
__name: "QueryDataProvider",
|
|
597
597
|
props: {
|
|
598
598
|
context: {},
|
|
@@ -602,73 +602,73 @@ const _i = () => {
|
|
|
602
602
|
},
|
|
603
603
|
emits: ["chart-data", "queryComplete"],
|
|
604
604
|
setup(u, { emit: e }) {
|
|
605
|
-
const t = u, i = e, { i18n: s } =
|
|
606
|
-
|
|
605
|
+
const t = u, i = e, { i18n: s } = te.useI18n(), r = le(ne), o = () => t.queryReady && r ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, n = new AbortController();
|
|
606
|
+
$e(() => {
|
|
607
607
|
n.abort();
|
|
608
608
|
});
|
|
609
|
-
const d = (C,
|
|
610
|
-
const
|
|
611
|
-
return
|
|
609
|
+
const d = (C, S, v) => {
|
|
610
|
+
const z = [];
|
|
611
|
+
return S && z.push(...S), z.push(...Pt(C, v)), z;
|
|
612
612
|
}, { data: l, error: a, isValidating: h } = Kt(o, async () => {
|
|
613
|
-
var C,
|
|
613
|
+
var C, S, v, z;
|
|
614
614
|
try {
|
|
615
615
|
let {
|
|
616
|
-
datasource:
|
|
617
|
-
...
|
|
616
|
+
datasource: x,
|
|
617
|
+
...q
|
|
618
618
|
} = t.query;
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
let
|
|
622
|
-
|
|
623
|
-
...
|
|
619
|
+
x || (x = "basic");
|
|
620
|
+
const oe = d(x, t.query.filters, t.context.filters);
|
|
621
|
+
let Q = t.query.time_range;
|
|
622
|
+
Q ? Q.tz || (Q = {
|
|
623
|
+
...Q,
|
|
624
624
|
tz: t.context.tz
|
|
625
|
-
}) :
|
|
625
|
+
}) : Q = {
|
|
626
626
|
...t.context.timeSpec,
|
|
627
627
|
tz: t.context.tz
|
|
628
628
|
};
|
|
629
|
-
const
|
|
630
|
-
datasource:
|
|
629
|
+
const ae = {
|
|
630
|
+
datasource: x,
|
|
631
631
|
query: {
|
|
632
|
-
...
|
|
633
|
-
time_range:
|
|
634
|
-
filters:
|
|
632
|
+
...q,
|
|
633
|
+
time_range: Q,
|
|
634
|
+
filters: oe
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
|
-
return r == null ? void 0 : r.queryFn(
|
|
638
|
-
} catch (
|
|
639
|
-
m.value = ((
|
|
637
|
+
return r == null ? void 0 : r.queryFn(ae, n);
|
|
638
|
+
} catch (x) {
|
|
639
|
+
m.value = ((S = (C = x == null ? void 0 : x.response) == null ? void 0 : C.data) == null ? void 0 : S.message) === "Range not allowed for this tier" ? s.t("queryDataProvider.timeRangeExceeded") : ((z = (v = x == null ? void 0 : x.response) == null ? void 0 : v.data) == null ? void 0 : z.message) || (x == null ? void 0 : x.message);
|
|
640
640
|
} finally {
|
|
641
641
|
i("queryComplete");
|
|
642
642
|
}
|
|
643
643
|
}, {
|
|
644
644
|
refreshInterval: t.context.refreshInterval,
|
|
645
645
|
revalidateOnFocus: !1
|
|
646
|
-
}), { state: f, swrvState:
|
|
647
|
-
return
|
|
646
|
+
}), { state: f, swrvState: p } = ei(l, a, h), m = F(null), y = N(() => f.value === p.ERROR || !!m.value), g = N(() => !t.queryReady || f.value === p.PENDING);
|
|
647
|
+
return Fe(l, (C) => {
|
|
648
648
|
C && i("chart-data", C);
|
|
649
|
-
}), (C,
|
|
650
|
-
const
|
|
651
|
-
return
|
|
649
|
+
}), (C, S) => {
|
|
650
|
+
const v = re("KSkeleton"), z = re("KEmptyState");
|
|
651
|
+
return g.value || !D(l) && !y.value ? (R(), A(v, {
|
|
652
652
|
key: 0,
|
|
653
653
|
class: "chart-skeleton",
|
|
654
654
|
type: "table"
|
|
655
|
-
})) : y.value ? (
|
|
655
|
+
})) : y.value ? (R(), A(z, {
|
|
656
656
|
key: 1,
|
|
657
657
|
"action-button-visible": !1,
|
|
658
658
|
"data-testid": "chart-empty-state",
|
|
659
659
|
"icon-variant": "error"
|
|
660
660
|
}, {
|
|
661
661
|
default: M(() => [
|
|
662
|
-
|
|
662
|
+
ye(Z(m.value), 1)
|
|
663
663
|
]),
|
|
664
664
|
_: 1
|
|
665
|
-
})) :
|
|
665
|
+
})) : D(l) ? He(C.$slots, "default", {
|
|
666
666
|
key: 2,
|
|
667
|
-
data:
|
|
667
|
+
data: D(l)
|
|
668
668
|
}) : V("", !0);
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
}), bi = { class: "analytics-chart" }, wi = /* @__PURE__ */
|
|
671
|
+
}), bi = { class: "analytics-chart" }, wi = /* @__PURE__ */ U({
|
|
672
672
|
__name: "SimpleChartRenderer",
|
|
673
673
|
props: {
|
|
674
674
|
query: {},
|
|
@@ -679,19 +679,19 @@ const _i = () => {
|
|
|
679
679
|
refreshCounter: {}
|
|
680
680
|
},
|
|
681
681
|
setup(u) {
|
|
682
|
-
|
|
682
|
+
Oe((t) => ({
|
|
683
683
|
c40c0e86: `${t.height}px`
|
|
684
684
|
}));
|
|
685
685
|
const e = u;
|
|
686
|
-
return (t, i) => (
|
|
686
|
+
return (t, i) => (R(), A(Ge, {
|
|
687
687
|
context: t.context,
|
|
688
688
|
query: t.query,
|
|
689
689
|
"query-ready": t.queryReady,
|
|
690
690
|
"refresh-counter": t.refreshCounter
|
|
691
691
|
}, {
|
|
692
692
|
default: M(({ data: s }) => [
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
de("div", bi, [
|
|
694
|
+
ee(D(Ft), {
|
|
695
695
|
"chart-data": s,
|
|
696
696
|
"chart-options": e.chartOptions,
|
|
697
697
|
"synthetics-data-key": t.chartOptions.syntheticsDataKey
|
|
@@ -701,12 +701,12 @@ const _i = () => {
|
|
|
701
701
|
_: 1
|
|
702
702
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
703
703
|
}
|
|
704
|
-
}),
|
|
704
|
+
}), he = (u, e) => {
|
|
705
705
|
const t = u.__vccOpts || u;
|
|
706
706
|
for (const [i, s] of e)
|
|
707
707
|
t[i] = s;
|
|
708
708
|
return t;
|
|
709
|
-
}, Ei = /* @__PURE__ */
|
|
709
|
+
}, Ei = /* @__PURE__ */ he(wi, [["__scopeId", "data-v-694cf637"]]), xi = { class: "analytics-chart" }, Ci = /* @__PURE__ */ U({
|
|
710
710
|
__name: "BaseAnalyticsChartRenderer",
|
|
711
711
|
props: {
|
|
712
712
|
query: {},
|
|
@@ -719,7 +719,7 @@ const _i = () => {
|
|
|
719
719
|
},
|
|
720
720
|
emits: ["edit-tile", "chart-data"],
|
|
721
721
|
setup(u, { emit: e }) {
|
|
722
|
-
const t = u, i = e, s =
|
|
722
|
+
const t = u, i = e, s = le(ne), { i18n: r } = te.useI18n(), { evaluateFeatureFlag: o } = te.useEvaluateFeatureFlag(), n = o("ma-3043-analytics-chart-kebab-menu", !1), d = N(() => ({
|
|
723
723
|
type: t.chartOptions.type,
|
|
724
724
|
stacked: t.chartOptions.stacked ?? !1,
|
|
725
725
|
chartDatasetColors: t.chartOptions.chartDatasetColors,
|
|
@@ -731,8 +731,8 @@ const _i = () => {
|
|
|
731
731
|
metrics: t.query.metrics ?? [],
|
|
732
732
|
dimensions: t.query.dimensions ?? [],
|
|
733
733
|
time_range: t.query.time_range || t.context.timeSpec
|
|
734
|
-
},
|
|
735
|
-
return `${s.exploreBaseUrl()}?q=${JSON.stringify(f)}&d=${
|
|
734
|
+
}, p = ["advanced", "ai"].includes(t.query.datasource) ? t.query.datasource : "advanced";
|
|
735
|
+
return `${s.exploreBaseUrl()}?q=${JSON.stringify(f)}&d=${p}&c=${t.chartOptions.type}`;
|
|
736
736
|
}
|
|
737
737
|
return "";
|
|
738
738
|
}), a = () => {
|
|
@@ -740,9 +740,9 @@ const _i = () => {
|
|
|
740
740
|
}, h = (f) => {
|
|
741
741
|
i("chart-data", f);
|
|
742
742
|
};
|
|
743
|
-
return (f,
|
|
744
|
-
const m =
|
|
745
|
-
return
|
|
743
|
+
return (f, p) => {
|
|
744
|
+
const m = re("KDropdownItem");
|
|
745
|
+
return R(), A(Ge, {
|
|
746
746
|
context: f.context,
|
|
747
747
|
query: f.query,
|
|
748
748
|
"query-ready": f.queryReady,
|
|
@@ -750,12 +750,12 @@ const _i = () => {
|
|
|
750
750
|
onChartData: h
|
|
751
751
|
}, {
|
|
752
752
|
default: M(({ data: y }) => [
|
|
753
|
-
|
|
754
|
-
|
|
753
|
+
de("div", xi, [
|
|
754
|
+
ee(D(Ut), lt({
|
|
755
755
|
"allow-csv-export": f.chartOptions.allowCsvExport,
|
|
756
756
|
"chart-data": y,
|
|
757
757
|
"chart-options": d.value,
|
|
758
|
-
"chart-title": !
|
|
758
|
+
"chart-title": !D(n) && f.chartOptions.chartTitle || "",
|
|
759
759
|
"go-to-explore": l.value,
|
|
760
760
|
"legend-position": "bottom",
|
|
761
761
|
"show-menu": f.context.editable,
|
|
@@ -765,9 +765,9 @@ const _i = () => {
|
|
|
765
765
|
f.context.editable ? {
|
|
766
766
|
name: "menu-items",
|
|
767
767
|
fn: M(() => [
|
|
768
|
-
|
|
768
|
+
ee(m, { onClick: a }, {
|
|
769
769
|
default: M(() => [
|
|
770
|
-
|
|
770
|
+
ye(Z(D(r).t("renderer.edit")), 1)
|
|
771
771
|
]),
|
|
772
772
|
_: 1
|
|
773
773
|
})
|
|
@@ -781,7 +781,7 @@ const _i = () => {
|
|
|
781
781
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
-
}), We = /* @__PURE__ */
|
|
784
|
+
}), We = /* @__PURE__ */ he(Ci, [["__scopeId", "data-v-9bca4ef8"]]), tt = /* @__PURE__ */ U({
|
|
785
785
|
__name: "BarChartRenderer",
|
|
786
786
|
props: {
|
|
787
787
|
query: {},
|
|
@@ -792,7 +792,7 @@ const _i = () => {
|
|
|
792
792
|
refreshCounter: {}
|
|
793
793
|
},
|
|
794
794
|
setup(u) {
|
|
795
|
-
return (e, t) => (
|
|
795
|
+
return (e, t) => (R(), A(We, {
|
|
796
796
|
"chart-options": e.chartOptions,
|
|
797
797
|
context: e.context,
|
|
798
798
|
"extra-props": { showAnnotations: !1 },
|
|
@@ -802,7 +802,7 @@ const _i = () => {
|
|
|
802
802
|
"refresh-counter": e.refreshCounter
|
|
803
803
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
804
804
|
}
|
|
805
|
-
}), it = /* @__PURE__ */
|
|
805
|
+
}), it = /* @__PURE__ */ U({
|
|
806
806
|
__name: "TimeseriesChartRenderer",
|
|
807
807
|
props: {
|
|
808
808
|
query: {},
|
|
@@ -813,7 +813,7 @@ const _i = () => {
|
|
|
813
813
|
refreshCounter: {}
|
|
814
814
|
},
|
|
815
815
|
setup(u) {
|
|
816
|
-
return (e, t) => (
|
|
816
|
+
return (e, t) => (R(), A(We, {
|
|
817
817
|
"chart-options": e.chartOptions,
|
|
818
818
|
context: e.context,
|
|
819
819
|
height: e.height,
|
|
@@ -822,7 +822,7 @@ const _i = () => {
|
|
|
822
822
|
"refresh-counter": e.refreshCounter
|
|
823
823
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
824
824
|
}
|
|
825
|
-
}), Ri = { class: "metric-card-tile-wrapper" }, Ti = /* @__PURE__ */
|
|
825
|
+
}), Ri = { class: "metric-card-tile-wrapper" }, Ti = /* @__PURE__ */ U({
|
|
826
826
|
__name: "GoldenSignalsRenderer",
|
|
827
827
|
props: {
|
|
828
828
|
query: {},
|
|
@@ -833,12 +833,12 @@ const _i = () => {
|
|
|
833
833
|
refreshCounter: {}
|
|
834
834
|
},
|
|
835
835
|
setup(u) {
|
|
836
|
-
|
|
837
|
-
"926e3b48":
|
|
838
|
-
"7be2893e":
|
|
839
|
-
"0d55c162":
|
|
836
|
+
Oe((o) => ({
|
|
837
|
+
"926e3b48": D(i) ? "90%" : "100%",
|
|
838
|
+
"7be2893e": D(i) ? "auto" : "100%",
|
|
839
|
+
"0d55c162": D(i) ? "100%" : "none"
|
|
840
840
|
}));
|
|
841
|
-
const e = u, { evaluateFeatureFlag: t } =
|
|
841
|
+
const e = u, { evaluateFeatureFlag: t } = te.useEvaluateFeatureFlag(), i = t("ma-3043-analytics-chart-kebab-menu", !1), s = N(() => {
|
|
842
842
|
const o = e.context.timeSpec;
|
|
843
843
|
if (o.type === "absolute")
|
|
844
844
|
return new qt({
|
|
@@ -877,27 +877,27 @@ const _i = () => {
|
|
|
877
877
|
refreshCounter: e.refreshCounter
|
|
878
878
|
};
|
|
879
879
|
});
|
|
880
|
-
return (o, n) => (
|
|
881
|
-
|
|
880
|
+
return (o, n) => (R(), B("div", Ri, [
|
|
881
|
+
ee(D(Xt), Lt(Mt(r.value)), {
|
|
882
882
|
default: M(() => [
|
|
883
|
-
|
|
883
|
+
ee(D(jt))
|
|
884
884
|
]),
|
|
885
885
|
_: 1
|
|
886
886
|
}, 16)
|
|
887
887
|
]));
|
|
888
888
|
}
|
|
889
|
-
}), Di = /* @__PURE__ */
|
|
889
|
+
}), Di = /* @__PURE__ */ he(Ti, [["__scopeId", "data-v-0f571079"]]), st = "#6c7489", rt = "20px", Dt = "20px", zi = {
|
|
890
890
|
class: "fallback-entity-link",
|
|
891
891
|
"data-testid": "entity-link-parent"
|
|
892
|
-
}, nt = /* @__PURE__ */
|
|
892
|
+
}, nt = /* @__PURE__ */ U({
|
|
893
893
|
__name: "FallbackEntityLink",
|
|
894
894
|
props: {
|
|
895
895
|
entityLinkData: {}
|
|
896
896
|
},
|
|
897
897
|
setup(u) {
|
|
898
|
-
return (e, t) => (
|
|
898
|
+
return (e, t) => (R(), B("div", zi, Z(e.entityLinkData.label), 1));
|
|
899
899
|
}
|
|
900
|
-
}), Si = /* @__PURE__ */
|
|
900
|
+
}), Si = /* @__PURE__ */ U({
|
|
901
901
|
__name: "TopNTableRenderer",
|
|
902
902
|
props: {
|
|
903
903
|
query: {},
|
|
@@ -908,7 +908,7 @@ const _i = () => {
|
|
|
908
908
|
refreshCounter: {}
|
|
909
909
|
},
|
|
910
910
|
setup(u) {
|
|
911
|
-
const e = u, { evaluateFeatureFlag: t } =
|
|
911
|
+
const e = u, { evaluateFeatureFlag: t } = te.useEvaluateFeatureFlag(), i = t("ma-3043-analytics-chart-kebab-menu", !1), s = le(ne), r = It(async () => {
|
|
912
912
|
if (s != null && s.fetchComponent)
|
|
913
913
|
try {
|
|
914
914
|
return await s.fetchComponent("EntityLink");
|
|
@@ -926,23 +926,23 @@ const _i = () => {
|
|
|
926
926
|
return e.chartOptions.entityLink.replace(Je, n.id);
|
|
927
927
|
return "";
|
|
928
928
|
};
|
|
929
|
-
return (n, d) => (
|
|
929
|
+
return (n, d) => (R(), A(Ge, {
|
|
930
930
|
context: n.context,
|
|
931
931
|
query: n.query,
|
|
932
932
|
"query-ready": n.queryReady,
|
|
933
933
|
"refresh-counter": n.refreshCounter
|
|
934
934
|
}, {
|
|
935
935
|
default: M(({ data: l }) => [
|
|
936
|
-
|
|
936
|
+
ee(D(Gt), {
|
|
937
937
|
data: l,
|
|
938
|
-
description: !
|
|
938
|
+
description: !D(i) && n.chartOptions.description || "",
|
|
939
939
|
"synthetics-data-key": n.chartOptions.syntheticsDataKey,
|
|
940
|
-
title: !
|
|
940
|
+
title: !D(i) && n.chartOptions.chartTitle || ""
|
|
941
941
|
}, ht({ _: 2 }, [
|
|
942
942
|
e.chartOptions.entityLink ? {
|
|
943
943
|
name: "name",
|
|
944
944
|
fn: M(({ record: a }) => [
|
|
945
|
-
|
|
945
|
+
ee(D(r), {
|
|
946
946
|
"entity-link-data": {
|
|
947
947
|
id: a.id,
|
|
948
948
|
label: a.name,
|
|
@@ -958,7 +958,7 @@ const _i = () => {
|
|
|
958
958
|
_: 1
|
|
959
959
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
960
960
|
}
|
|
961
|
-
}), ki = /* @__PURE__ */
|
|
961
|
+
}), ki = /* @__PURE__ */ U({
|
|
962
962
|
__name: "DoughnutChartRenderer",
|
|
963
963
|
props: {
|
|
964
964
|
query: {},
|
|
@@ -969,7 +969,7 @@ const _i = () => {
|
|
|
969
969
|
refreshCounter: {}
|
|
970
970
|
},
|
|
971
971
|
setup(u) {
|
|
972
|
-
return (e, t) => (
|
|
972
|
+
return (e, t) => (R(), A(We, {
|
|
973
973
|
"chart-options": e.chartOptions,
|
|
974
974
|
context: e.context,
|
|
975
975
|
height: e.height,
|
|
@@ -981,7 +981,7 @@ const _i = () => {
|
|
|
981
981
|
}), Ni = ["data-testid"], Ai = {
|
|
982
982
|
key: 0,
|
|
983
983
|
class: "tile-header"
|
|
984
|
-
}, Hi = ["data-testid"], Oi = ["data-testid"], Li = ["data-testid"], Mi = ["data-testid"], Ii = /* @__PURE__ */
|
|
984
|
+
}, Hi = ["data-testid"], Oi = ["data-testid"], Li = ["data-testid"], Mi = ["data-testid"], Ii = /* @__PURE__ */ U({
|
|
985
985
|
__name: "DashboardTile",
|
|
986
986
|
props: {
|
|
987
987
|
definition: {},
|
|
@@ -993,29 +993,29 @@ const _i = () => {
|
|
|
993
993
|
},
|
|
994
994
|
emits: ["edit-tile", "remove-tile"],
|
|
995
995
|
setup(u, { emit: e }) {
|
|
996
|
-
|
|
997
|
-
"315496d0": `${
|
|
996
|
+
Oe((E) => ({
|
|
997
|
+
"315496d0": `${E.height}px`
|
|
998
998
|
}));
|
|
999
|
-
const t = parseInt(Dt, 10), i = u, s = e, r =
|
|
1000
|
-
|
|
999
|
+
const t = parseInt(Dt, 10), i = u, s = e, r = le(ne), { evaluateFeatureFlag: o } = te.useEvaluateFeatureFlag(), { i18n: n } = te.useI18n(), d = o("ma-3043-analytics-chart-kebab-menu", !1), l = F(), a = F(!1), h = F(), f = F(!1);
|
|
1000
|
+
Fe(() => i.definition, async () => {
|
|
1001
1001
|
await dt(), h.value && (f.value = h.value.scrollWidth > h.value.clientWidth);
|
|
1002
1002
|
}, { immediate: !0, deep: !0 });
|
|
1003
|
-
const
|
|
1004
|
-
const
|
|
1005
|
-
if (
|
|
1003
|
+
const p = N(() => {
|
|
1004
|
+
const E = [...i.context.filters, ...i.definition.query.filters ?? []], ie = i.definition.query.dimensions ?? [];
|
|
1005
|
+
if (E.some((L) => "dimension" in L && L.dimension === "portal" || "field" in L && L.field === "portal") || ie.some((L) => L === "portal"))
|
|
1006
1006
|
return "";
|
|
1007
1007
|
if (r && r.exploreBaseUrl) {
|
|
1008
1008
|
const L = {
|
|
1009
|
-
filters:
|
|
1009
|
+
filters: E,
|
|
1010
1010
|
metrics: i.definition.query.metrics ?? [],
|
|
1011
|
-
dimensions:
|
|
1011
|
+
dimensions: ie,
|
|
1012
1012
|
time_range: i.definition.query.time_range || i.context.timeSpec,
|
|
1013
|
-
granularity: i.definition.query.granularity ||
|
|
1014
|
-
},
|
|
1015
|
-
return `${r.exploreBaseUrl()}?q=${JSON.stringify(L)}&d=${
|
|
1013
|
+
granularity: i.definition.query.granularity || x.value
|
|
1014
|
+
}, Me = ["advanced", "ai"].includes(i.definition.query.datasource) ? i.definition.query.datasource : "advanced";
|
|
1015
|
+
return `${r.exploreBaseUrl()}?q=${JSON.stringify(L)}&d=${Me}&c=${i.definition.chart.type}`;
|
|
1016
1016
|
}
|
|
1017
1017
|
return "";
|
|
1018
|
-
}), m = N(() => n.t("csvExport.defaultFilename")), y = N(() =>
|
|
1018
|
+
}), m = N(() => n.t("csvExport.defaultFilename")), y = N(() => g.value && (C.value || i.context.editable) || !!z.value), g = N(() => d && !["golden_signals", "top_n", "gauge"].includes(i.definition.chart.type)), C = N(() => !!p.value || "allowCsvExport" in i.definition.chart && i.definition.chart.allowCsvExport || i.context.editable), S = {
|
|
1019
1019
|
timeseries_line: it,
|
|
1020
1020
|
timeseries_bar: it,
|
|
1021
1021
|
horizontal_bar: tt,
|
|
@@ -1025,10 +1025,10 @@ const _i = () => {
|
|
|
1025
1025
|
golden_signals: Di,
|
|
1026
1026
|
top_n: Si,
|
|
1027
1027
|
slottable: void 0
|
|
1028
|
-
},
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1031
|
-
component:
|
|
1028
|
+
}, v = N(() => {
|
|
1029
|
+
const E = S[i.definition.chart.type];
|
|
1030
|
+
return E && {
|
|
1031
|
+
component: E,
|
|
1032
1032
|
rendererProps: {
|
|
1033
1033
|
query: i.definition.query,
|
|
1034
1034
|
context: i.context,
|
|
@@ -1038,139 +1038,139 @@ const _i = () => {
|
|
|
1038
1038
|
refreshCounter: i.refreshCounter
|
|
1039
1039
|
}
|
|
1040
1040
|
};
|
|
1041
|
-
}),
|
|
1042
|
-
var
|
|
1043
|
-
const
|
|
1044
|
-
if ((
|
|
1045
|
-
const L = mt.get(Bt[
|
|
1046
|
-
return L ? L.display : (console.warn("Did not recognize the given relative time range:",
|
|
1047
|
-
} else if ((
|
|
1048
|
-
const L =
|
|
1049
|
-
return `${Qe(
|
|
1041
|
+
}), z = N(() => {
|
|
1042
|
+
var ie;
|
|
1043
|
+
const E = (ie = i.definition.query) == null ? void 0 : ie.time_range;
|
|
1044
|
+
if ((E == null ? void 0 : E.type) === "relative") {
|
|
1045
|
+
const L = mt.get(Bt[E.time_range]);
|
|
1046
|
+
return L ? L.display : (console.warn("Did not recognize the given relative time range:", E.time_range), E.time_range);
|
|
1047
|
+
} else if ((E == null ? void 0 : E.type) === "absolute") {
|
|
1048
|
+
const L = E.tz || "Etc/UTC";
|
|
1049
|
+
return `${Qe(E.start, { short: !0, tz: L })} - ${Qe(E.end, { short: !0, tz: L })}`;
|
|
1050
1050
|
}
|
|
1051
1051
|
return null;
|
|
1052
|
-
}),
|
|
1052
|
+
}), x = N(() => l.value ? $t(l.value.meta.granularity_ms) : void 0), q = () => {
|
|
1053
1053
|
s("edit-tile", i.definition);
|
|
1054
|
-
},
|
|
1054
|
+
}, oe = () => {
|
|
1055
1055
|
s("remove-tile", i.definition);
|
|
1056
|
-
},
|
|
1057
|
-
l.value =
|
|
1058
|
-
},
|
|
1059
|
-
a.value =
|
|
1056
|
+
}, Q = (E) => {
|
|
1057
|
+
l.value = E;
|
|
1058
|
+
}, ae = (E) => {
|
|
1059
|
+
a.value = E;
|
|
1060
1060
|
}, St = () => {
|
|
1061
|
-
|
|
1061
|
+
ae(!0);
|
|
1062
1062
|
};
|
|
1063
|
-
return (
|
|
1064
|
-
const L =
|
|
1065
|
-
return
|
|
1066
|
-
class: ut(["tile-boundary", { editable:
|
|
1067
|
-
"data-testid": `tile-${
|
|
1063
|
+
return (E, ie) => {
|
|
1064
|
+
const L = re("KTooltip"), Me = re("KBadge"), Ie = re("KDropdownItem"), kt = re("KDropdown");
|
|
1065
|
+
return R(), B("div", {
|
|
1066
|
+
class: ut(["tile-boundary", { editable: E.context.editable }]),
|
|
1067
|
+
"data-testid": `tile-${E.tileId}`
|
|
1068
1068
|
}, [
|
|
1069
|
-
|
|
1070
|
-
|
|
1069
|
+
D(d) && E.definition.chart.type !== "slottable" ? (R(), B("div", Ai, [
|
|
1070
|
+
ee(L, {
|
|
1071
1071
|
class: "title-tooltip",
|
|
1072
1072
|
disabled: !f.value,
|
|
1073
1073
|
"max-width": "500",
|
|
1074
|
-
text:
|
|
1074
|
+
text: E.definition.chart.chartTitle
|
|
1075
1075
|
}, {
|
|
1076
1076
|
default: M(() => [
|
|
1077
|
-
|
|
1077
|
+
de("div", {
|
|
1078
1078
|
ref_key: "titleRef",
|
|
1079
1079
|
ref: h,
|
|
1080
1080
|
class: "title"
|
|
1081
|
-
},
|
|
1081
|
+
}, Z(E.definition.chart.chartTitle), 513)
|
|
1082
1082
|
]),
|
|
1083
1083
|
_: 1
|
|
1084
1084
|
}, 8, ["disabled", "text"]),
|
|
1085
|
-
y.value ? (
|
|
1085
|
+
y.value ? (R(), B("div", {
|
|
1086
1086
|
key: 0,
|
|
1087
1087
|
class: "tile-actions",
|
|
1088
|
-
"data-testid": `tile-actions-${
|
|
1088
|
+
"data-testid": `tile-actions-${E.tileId}`
|
|
1089
1089
|
}, [
|
|
1090
|
-
|
|
1090
|
+
z.value ? (R(), A(Me, { key: 0 }, {
|
|
1091
1091
|
default: M(() => [
|
|
1092
|
-
|
|
1092
|
+
ye(Z(z.value), 1)
|
|
1093
1093
|
]),
|
|
1094
1094
|
_: 1
|
|
1095
1095
|
})) : V("", !0),
|
|
1096
|
-
|
|
1096
|
+
g.value && E.context.editable ? (R(), A(D(Qt), {
|
|
1097
1097
|
key: 1,
|
|
1098
1098
|
class: "edit-icon",
|
|
1099
|
-
color:
|
|
1100
|
-
"data-testid": `edit-tile-${
|
|
1101
|
-
size:
|
|
1102
|
-
onClick:
|
|
1099
|
+
color: D(st),
|
|
1100
|
+
"data-testid": `edit-tile-${E.tileId}`,
|
|
1101
|
+
size: D(rt),
|
|
1102
|
+
onClick: q
|
|
1103
1103
|
}, null, 8, ["color", "data-testid", "size"])) : V("", !0),
|
|
1104
|
-
|
|
1104
|
+
g.value && C.value ? (R(), A(kt, {
|
|
1105
1105
|
key: 2,
|
|
1106
1106
|
class: "dropdown",
|
|
1107
|
-
"data-testid": `chart-action-menu-${
|
|
1107
|
+
"data-testid": `chart-action-menu-${E.tileId}`,
|
|
1108
1108
|
"kpop-attributes": { placement: "bottom-end" }
|
|
1109
1109
|
}, {
|
|
1110
1110
|
items: M(() => [
|
|
1111
|
-
|
|
1111
|
+
p.value ? (R(), A(Ie, {
|
|
1112
1112
|
key: 0,
|
|
1113
|
-
"data-testid": `chart-jump-to-explore-${
|
|
1114
|
-
item: { label:
|
|
1113
|
+
"data-testid": `chart-jump-to-explore-${E.tileId}`,
|
|
1114
|
+
item: { label: D(n).t("jumpToExplore"), to: p.value }
|
|
1115
1115
|
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1116
|
-
"allowCsvExport" in
|
|
1116
|
+
"allowCsvExport" in E.definition.chart && E.definition.chart.allowCsvExport ? (R(), A(Ie, {
|
|
1117
1117
|
key: 1,
|
|
1118
1118
|
class: "chart-export-button",
|
|
1119
|
-
"data-testid": `chart-csv-export-${
|
|
1120
|
-
onClick:
|
|
1119
|
+
"data-testid": `chart-csv-export-${E.tileId}`,
|
|
1120
|
+
onClick: ie[0] || (ie[0] = (Zi) => St())
|
|
1121
1121
|
}, {
|
|
1122
1122
|
default: M(() => [
|
|
1123
|
-
|
|
1123
|
+
de("span", {
|
|
1124
1124
|
class: "chart-export-trigger",
|
|
1125
|
-
"data-testid": `csv-export-button-${
|
|
1126
|
-
},
|
|
1125
|
+
"data-testid": `csv-export-button-${E.tileId}`
|
|
1126
|
+
}, Z(D(n).t("csvExport.exportAsCsv")), 9, Oi)
|
|
1127
1127
|
]),
|
|
1128
1128
|
_: 1
|
|
1129
1129
|
}, 8, ["data-testid"])) : V("", !0),
|
|
1130
|
-
|
|
1130
|
+
E.context.editable ? (R(), A(Ie, {
|
|
1131
1131
|
key: 2,
|
|
1132
|
-
"data-testid": `remove-tile-${
|
|
1133
|
-
onClick:
|
|
1132
|
+
"data-testid": `remove-tile-${E.tileId}`,
|
|
1133
|
+
onClick: oe
|
|
1134
1134
|
}, {
|
|
1135
1135
|
default: M(() => [
|
|
1136
|
-
|
|
1136
|
+
ye(Z(D(n).t("renderer.remove")), 1)
|
|
1137
1137
|
]),
|
|
1138
1138
|
_: 1
|
|
1139
1139
|
}, 8, ["data-testid"])) : V("", !0)
|
|
1140
1140
|
]),
|
|
1141
1141
|
default: M(() => [
|
|
1142
|
-
|
|
1142
|
+
ee(D(Jt), {
|
|
1143
1143
|
class: "kebab-action-menu",
|
|
1144
|
-
color:
|
|
1145
|
-
"data-testid": `kebab-action-menu-${
|
|
1146
|
-
size:
|
|
1144
|
+
color: D(st),
|
|
1145
|
+
"data-testid": `kebab-action-menu-${E.tileId}`,
|
|
1146
|
+
size: D(rt)
|
|
1147
1147
|
}, null, 8, ["color", "data-testid", "size"])
|
|
1148
1148
|
]),
|
|
1149
1149
|
_: 1
|
|
1150
1150
|
}, 8, ["data-testid"])) : V("", !0)
|
|
1151
|
-
], 8, Hi)) : "description" in
|
|
1151
|
+
], 8, Hi)) : "description" in E.definition.chart ? (R(), B("div", {
|
|
1152
1152
|
key: 1,
|
|
1153
1153
|
class: "header-description",
|
|
1154
|
-
"data-testid": `tile-description-${
|
|
1155
|
-
},
|
|
1156
|
-
a.value ? (
|
|
1154
|
+
"data-testid": `tile-description-${E.tileId}`
|
|
1155
|
+
}, Z(E.definition.chart.description), 9, Li)) : V("", !0),
|
|
1156
|
+
a.value ? (R(), A(D(Wt), {
|
|
1157
1157
|
key: 2,
|
|
1158
1158
|
"chart-data": l.value,
|
|
1159
|
-
"data-testid": `csv-export-modal-${
|
|
1159
|
+
"data-testid": `csv-export-modal-${E.tileId}`,
|
|
1160
1160
|
filename: m.value,
|
|
1161
|
-
onToggleModal:
|
|
1161
|
+
onToggleModal: ae
|
|
1162
1162
|
}, null, 8, ["chart-data", "data-testid", "filename"])) : V("", !0)
|
|
1163
1163
|
])) : V("", !0),
|
|
1164
|
-
|
|
1164
|
+
de("div", {
|
|
1165
1165
|
class: "tile-content",
|
|
1166
|
-
"data-testid": `tile-content-${
|
|
1166
|
+
"data-testid": `tile-content-${E.tileId}`
|
|
1167
1167
|
}, [
|
|
1168
|
-
|
|
1168
|
+
v.value ? (R(), A(ct(v.value.component), lt({ key: 0 }, v.value.rendererProps, { onChartData: Q }), null, 16)) : V("", !0)
|
|
1169
1169
|
], 8, Mi)
|
|
1170
1170
|
], 10, Ni);
|
|
1171
1171
|
};
|
|
1172
1172
|
}
|
|
1173
|
-
}), Pi = /* @__PURE__ */
|
|
1173
|
+
}), Pi = /* @__PURE__ */ he(Ii, [["__scopeId", "data-v-e8cb21ac"]]), qi = (u, e, t) => {
|
|
1174
1174
|
const i = /* @__PURE__ */ new Map();
|
|
1175
1175
|
t.forEach((r) => {
|
|
1176
1176
|
const o = r.layout.position.row, n = i.get(o), d = r.layout.size.rows === 1 && !!r.layout.size.fitToContent;
|
|
@@ -1180,7 +1180,7 @@ const _i = () => {
|
|
|
1180
1180
|
for (let r = 0; r < u; r++)
|
|
1181
1181
|
i.get(r) ? s.push("auto") : s.push(`${e}px`);
|
|
1182
1182
|
return s;
|
|
1183
|
-
}, Bi = /* @__PURE__ */
|
|
1183
|
+
}, Bi = /* @__PURE__ */ U({
|
|
1184
1184
|
__name: "GridLayout",
|
|
1185
1185
|
props: {
|
|
1186
1186
|
gridSize: {
|
|
@@ -1198,18 +1198,18 @@ const _i = () => {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
},
|
|
1200
1200
|
setup(u) {
|
|
1201
|
-
|
|
1201
|
+
Oe((n) => ({
|
|
1202
1202
|
"3bc5e939": u.gridSize.cols,
|
|
1203
1203
|
"77aa3028": r.value
|
|
1204
1204
|
}));
|
|
1205
|
-
const e = u, t =
|
|
1205
|
+
const e = u, t = F(null), i = F(0), s = new ResizeObserver((n) => {
|
|
1206
1206
|
window.requestAnimationFrame(() => {
|
|
1207
1207
|
!Array.isArray(n) || !n.length || (i.value = n[0].contentRect.width);
|
|
1208
1208
|
});
|
|
1209
1209
|
});
|
|
1210
1210
|
ft(() => {
|
|
1211
1211
|
t.value && s.observe(t.value);
|
|
1212
|
-
}),
|
|
1212
|
+
}), $e(() => {
|
|
1213
1213
|
t.value && s.unobserve(t.value);
|
|
1214
1214
|
});
|
|
1215
1215
|
const r = N(() => {
|
|
@@ -1225,26 +1225,26 @@ const _i = () => {
|
|
|
1225
1225
|
"grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
|
|
1226
1226
|
}
|
|
1227
1227
|
})));
|
|
1228
|
-
return (n, d) => (
|
|
1228
|
+
return (n, d) => (R(), B("div", {
|
|
1229
1229
|
ref_key: "gridContainer",
|
|
1230
1230
|
ref: t,
|
|
1231
1231
|
class: "kong-ui-public-grid-layout"
|
|
1232
1232
|
}, [
|
|
1233
|
-
(
|
|
1233
|
+
(R(!0), B(gt, null, pt(o.value, (l) => (R(), B("div", {
|
|
1234
1234
|
key: l.key,
|
|
1235
1235
|
class: ut(["grid-cell", {
|
|
1236
1236
|
"empty-cell": !l.tile
|
|
1237
1237
|
}]),
|
|
1238
1238
|
style: je(l.style)
|
|
1239
1239
|
}, [
|
|
1240
|
-
|
|
1240
|
+
He(n.$slots, "tile", {
|
|
1241
1241
|
style: je(l.style),
|
|
1242
1242
|
tile: l.tile
|
|
1243
1243
|
}, void 0, !0)
|
|
1244
1244
|
], 6))), 128))
|
|
1245
1245
|
], 512));
|
|
1246
1246
|
}
|
|
1247
|
-
}), $i = /* @__PURE__ */
|
|
1247
|
+
}), $i = /* @__PURE__ */ he(Bi, [["__scopeId", "data-v-f43eb7b8"]]);
|
|
1248
1248
|
function Fi(u, e, t, i, s) {
|
|
1249
1249
|
const r = (...o) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(u, o));
|
|
1250
1250
|
return r.prototype = e.prototype, r;
|
|
@@ -1286,11 +1286,11 @@ class c {
|
|
|
1286
1286
|
const i = c.createDiv(["grid-stack-item", e]), s = c.createDiv(["grid-stack-item-content"], i);
|
|
1287
1287
|
return t.lazyLoad || ((n = (o = t.grid) == null ? void 0 : o.opts) == null ? void 0 : n.lazyLoad) && t.lazyLoad !== !1 ? t.visibleObservable || (t.visibleObservable = new IntersectionObserver(([d]) => {
|
|
1288
1288
|
var l;
|
|
1289
|
-
d.isIntersecting && ((l = t.visibleObservable) == null || l.disconnect(), delete t.visibleObservable,
|
|
1289
|
+
d.isIntersecting && ((l = t.visibleObservable) == null || l.disconnect(), delete t.visibleObservable, b.renderCB(s, t));
|
|
1290
1290
|
}), window.setTimeout(() => {
|
|
1291
1291
|
var d;
|
|
1292
1292
|
return (d = t.visibleObservable) == null ? void 0 : d.observe(i);
|
|
1293
|
-
})) :
|
|
1293
|
+
})) : b.renderCB(s, t), i;
|
|
1294
1294
|
}
|
|
1295
1295
|
/** create a div with the given classes */
|
|
1296
1296
|
static createDiv(e, t) {
|
|
@@ -1930,8 +1930,8 @@ class X {
|
|
|
1930
1930
|
const h = e._moving && !t.nested;
|
|
1931
1931
|
let f = h ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
1932
1932
|
if (h && f && ((a = (l = e.grid) == null ? void 0 : l.opts) != null && a.subGridDynamic) && !e.grid._isTemp) {
|
|
1933
|
-
const
|
|
1934
|
-
|
|
1933
|
+
const p = c.areaIntercept(t.rect, f._rect), m = c.area(t.rect), y = c.area(f._rect);
|
|
1934
|
+
p / (m < y ? m : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
|
|
1935
1935
|
}
|
|
1936
1936
|
f ? d = !this._fixCollisions(e, r, f, t) : (d = !1, i && delete t.pack);
|
|
1937
1937
|
}
|
|
@@ -2074,7 +2074,7 @@ class X {
|
|
|
2074
2074
|
}
|
|
2075
2075
|
}
|
|
2076
2076
|
X._idSeq = 0;
|
|
2077
|
-
const
|
|
2077
|
+
const $ = {
|
|
2078
2078
|
alwaysShowResizeHandle: "mobile",
|
|
2079
2079
|
animate: !0,
|
|
2080
2080
|
auto: !0,
|
|
@@ -2104,12 +2104,12 @@ const B = {
|
|
|
2104
2104
|
// styleInHead: false,
|
|
2105
2105
|
//removable
|
|
2106
2106
|
};
|
|
2107
|
-
class
|
|
2107
|
+
class w {
|
|
2108
2108
|
}
|
|
2109
2109
|
const Y = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2110
2110
|
class j {
|
|
2111
2111
|
}
|
|
2112
|
-
function
|
|
2112
|
+
function De(u, e) {
|
|
2113
2113
|
if (u.touches.length > 1)
|
|
2114
2114
|
return;
|
|
2115
2115
|
u.cancelable && u.preventDefault();
|
|
@@ -2183,46 +2183,46 @@ function zt(u, e) {
|
|
|
2183
2183
|
// relatedTarget
|
|
2184
2184
|
), u.target.dispatchEvent(t);
|
|
2185
2185
|
}
|
|
2186
|
+
function ze(u) {
|
|
2187
|
+
j.touchHandled || (j.touchHandled = !0, De(u, "mousedown"));
|
|
2188
|
+
}
|
|
2186
2189
|
function Se(u) {
|
|
2187
|
-
j.touchHandled
|
|
2190
|
+
j.touchHandled && De(u, "mousemove");
|
|
2188
2191
|
}
|
|
2189
2192
|
function ke(u) {
|
|
2190
|
-
j.touchHandled && ze(u, "mousemove");
|
|
2191
|
-
}
|
|
2192
|
-
function Ne(u) {
|
|
2193
2193
|
if (!j.touchHandled)
|
|
2194
2194
|
return;
|
|
2195
2195
|
j.pointerLeaveTimeout && (window.clearTimeout(j.pointerLeaveTimeout), delete j.pointerLeaveTimeout);
|
|
2196
|
-
const e = !!
|
|
2197
|
-
|
|
2196
|
+
const e = !!w.dragElement;
|
|
2197
|
+
De(u, "mouseup"), e || De(u, "click"), j.touchHandled = !1;
|
|
2198
2198
|
}
|
|
2199
|
-
function
|
|
2199
|
+
function Ne(u) {
|
|
2200
2200
|
u.pointerType !== "mouse" && u.target.releasePointerCapture(u.pointerId);
|
|
2201
2201
|
}
|
|
2202
2202
|
function ot(u) {
|
|
2203
|
-
|
|
2203
|
+
w.dragElement && u.pointerType !== "mouse" && zt(u, "mouseenter");
|
|
2204
2204
|
}
|
|
2205
2205
|
function at(u) {
|
|
2206
|
-
|
|
2206
|
+
w.dragElement && u.pointerType !== "mouse" && (j.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2207
2207
|
delete j.pointerLeaveTimeout, zt(u, "mouseleave");
|
|
2208
2208
|
}, 10));
|
|
2209
2209
|
}
|
|
2210
|
-
class
|
|
2210
|
+
class Le {
|
|
2211
2211
|
constructor(e, t, i) {
|
|
2212
2212
|
this.host = e, this.dir = t, this.option = i, this.moving = !1, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._keyEvent = this._keyEvent.bind(this), this._init();
|
|
2213
2213
|
}
|
|
2214
2214
|
/** @internal */
|
|
2215
2215
|
_init() {
|
|
2216
2216
|
const e = this.el = document.createElement("div");
|
|
2217
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${
|
|
2217
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Le.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), Y && (this.el.addEventListener("touchstart", ze), this.el.addEventListener("pointerdown", Ne)), this;
|
|
2218
2218
|
}
|
|
2219
2219
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2220
2220
|
destroy() {
|
|
2221
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), Y && (this.el.removeEventListener("touchstart",
|
|
2221
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), Y && (this.el.removeEventListener("touchstart", ze), this.el.removeEventListener("pointerdown", Ne)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2222
2222
|
}
|
|
2223
2223
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2224
2224
|
_mouseDown(e) {
|
|
2225
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), Y && (this.el.addEventListener("touchmove",
|
|
2225
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), Y && (this.el.addEventListener("touchmove", Se), this.el.addEventListener("touchend", ke)), e.stopPropagation(), e.preventDefault();
|
|
2226
2226
|
}
|
|
2227
2227
|
/** @internal */
|
|
2228
2228
|
_mouseMove(e) {
|
|
@@ -2231,7 +2231,7 @@ class Me {
|
|
|
2231
2231
|
}
|
|
2232
2232
|
/** @internal */
|
|
2233
2233
|
_mouseUp(e) {
|
|
2234
|
-
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Y && (this.el.removeEventListener("touchmove",
|
|
2234
|
+
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Y && (this.el.removeEventListener("touchmove", Se), this.el.removeEventListener("touchend", ke)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2235
2235
|
}
|
|
2236
2236
|
/** @internal call when keys are being pressed - use Esc to cancel */
|
|
2237
2237
|
_keyEvent(e) {
|
|
@@ -2243,7 +2243,7 @@ class Me {
|
|
|
2243
2243
|
return this.option[e] && this.option[e](t), this;
|
|
2244
2244
|
}
|
|
2245
2245
|
}
|
|
2246
|
-
|
|
2246
|
+
Le.prefix = "ui-resizable-";
|
|
2247
2247
|
class Ke {
|
|
2248
2248
|
constructor() {
|
|
2249
2249
|
this._eventRegister = {};
|
|
@@ -2272,7 +2272,7 @@ class Ke {
|
|
|
2272
2272
|
return this._eventRegister[e](t);
|
|
2273
2273
|
}
|
|
2274
2274
|
}
|
|
2275
|
-
class
|
|
2275
|
+
class ve extends Ke {
|
|
2276
2276
|
// have to be public else complains for HTMLElementExtendOpt ?
|
|
2277
2277
|
constructor(e, t = {}) {
|
|
2278
2278
|
super(), this.el = e, this.option = t, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
@@ -2328,21 +2328,21 @@ class me extends Ke {
|
|
|
2328
2328
|
}
|
|
2329
2329
|
/** @internal turns auto hide on/off */
|
|
2330
2330
|
_setupAutoHide(e) {
|
|
2331
|
-
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut),
|
|
2331
|
+
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut), w.overResizeElement === this && delete w.overResizeElement), this;
|
|
2332
2332
|
}
|
|
2333
2333
|
/** @internal */
|
|
2334
2334
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2335
2335
|
_mouseOver(e) {
|
|
2336
|
-
|
|
2336
|
+
w.overResizeElement || w.dragElement || (w.overResizeElement = this, this.el.classList.remove("ui-resizable-autohide"));
|
|
2337
2337
|
}
|
|
2338
2338
|
/** @internal */
|
|
2339
2339
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2340
2340
|
_mouseOut(e) {
|
|
2341
|
-
|
|
2341
|
+
w.overResizeElement === this && (delete w.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
2342
2342
|
}
|
|
2343
2343
|
/** @internal */
|
|
2344
2344
|
_setupHandlers() {
|
|
2345
|
-
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new
|
|
2345
|
+
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new Le(this.el, e, {
|
|
2346
2346
|
start: (t) => {
|
|
2347
2347
|
this._resizeStart(t);
|
|
2348
2348
|
},
|
|
@@ -2373,7 +2373,7 @@ class me extends Ke {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
/** @internal */
|
|
2375
2375
|
_setupHelper() {
|
|
2376
|
-
this.elOriginStyleVal =
|
|
2376
|
+
this.elOriginStyleVal = ve._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
|
|
2377
2377
|
const e = this.el.parentElement, t = c.getValuesFromTransformedElement(e);
|
|
2378
2378
|
return this.rectScale = {
|
|
2379
2379
|
x: t.xScale,
|
|
@@ -2382,7 +2382,7 @@ class me extends Ke {
|
|
|
2382
2382
|
}
|
|
2383
2383
|
/** @internal */
|
|
2384
2384
|
_cleanHelper() {
|
|
2385
|
-
return
|
|
2385
|
+
return ve._originStyleProp.forEach((e, t) => {
|
|
2386
2386
|
this.el.style[e] = this.elOriginStyleVal[t] || null;
|
|
2387
2387
|
}), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
|
|
2388
2388
|
}
|
|
@@ -2421,9 +2421,9 @@ class me extends Ke {
|
|
|
2421
2421
|
return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
|
|
2422
2422
|
}
|
|
2423
2423
|
}
|
|
2424
|
-
|
|
2424
|
+
ve._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
2425
2425
|
const Ui = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
2426
|
-
class
|
|
2426
|
+
class _e extends Ke {
|
|
2427
2427
|
constructor(e, t = {}) {
|
|
2428
2428
|
var r;
|
|
2429
2429
|
super(), this.el = e, this.option = t, this.dragTransform = {
|
|
@@ -2443,12 +2443,12 @@ class ye extends Ke {
|
|
|
2443
2443
|
}
|
|
2444
2444
|
enable() {
|
|
2445
2445
|
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
|
|
2446
|
-
e.addEventListener("mousedown", this._mouseDown), Y && (e.addEventListener("touchstart",
|
|
2446
|
+
e.addEventListener("mousedown", this._mouseDown), Y && (e.addEventListener("touchstart", ze), e.addEventListener("pointerdown", Ne));
|
|
2447
2447
|
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
2448
2448
|
}
|
|
2449
2449
|
disable(e = !1) {
|
|
2450
2450
|
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((t) => {
|
|
2451
|
-
t.removeEventListener("mousedown", this._mouseDown), Y && (t.removeEventListener("touchstart",
|
|
2451
|
+
t.removeEventListener("mousedown", this._mouseDown), Y && (t.removeEventListener("touchstart", ze), t.removeEventListener("pointerdown", Ne));
|
|
2452
2452
|
}), e || this.el.classList.add("ui-draggable-disabled"));
|
|
2453
2453
|
}
|
|
2454
2454
|
destroy() {
|
|
@@ -2459,8 +2459,8 @@ class ye extends Ke {
|
|
|
2459
2459
|
}
|
|
2460
2460
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
2461
2461
|
_mouseDown(e) {
|
|
2462
|
-
if (!
|
|
2463
|
-
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Ui) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete
|
|
2462
|
+
if (!w.mouseHandled)
|
|
2463
|
+
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Ui) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete w.dragElement, delete w.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), Y && (e.currentTarget.addEventListener("touchmove", Se), e.currentTarget.addEventListener("touchend", ke)), e.preventDefault(), document.activeElement && document.activeElement.blur(), w.mouseHandled = !0), !0;
|
|
2464
2464
|
}
|
|
2465
2465
|
/** @internal method to call actual drag event */
|
|
2466
2466
|
_callDrag(e) {
|
|
@@ -2474,15 +2474,15 @@ class ye extends Ke {
|
|
|
2474
2474
|
var i;
|
|
2475
2475
|
const t = this.mouseDownEvent;
|
|
2476
2476
|
if (this.lastDrag = e, this.dragging)
|
|
2477
|
-
if (this._dragFollow(e),
|
|
2478
|
-
const s = Number.isInteger(
|
|
2477
|
+
if (this._dragFollow(e), w.pauseDrag) {
|
|
2478
|
+
const s = Number.isInteger(w.pauseDrag) ? w.pauseDrag : 100;
|
|
2479
2479
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), this.dragTimeout = window.setTimeout(() => this._callDrag(e), s);
|
|
2480
2480
|
} else
|
|
2481
2481
|
this._callDrag(e);
|
|
2482
2482
|
else if (Math.abs(e.x - t.x) + Math.abs(e.y - t.y) > 3) {
|
|
2483
|
-
this.dragging = !0,
|
|
2483
|
+
this.dragging = !0, w.dragElement = this;
|
|
2484
2484
|
const s = (i = this.el.gridstackNode) == null ? void 0 : i.grid;
|
|
2485
|
-
s ?
|
|
2485
|
+
s ? w.dropElement = s.el.ddElement.ddDroppable : delete w.dropElement, this.helper = this._createHelper(), this._setupHelperContainmentStyle(), this.dragTransform = c.getValuesFromTransformedElement(this.helperContainment), this.dragOffset = this._getDragOffset(e, this.el, this.helperContainment), this._setupHelperStyle(e);
|
|
2486
2486
|
const r = c.initEvent(e, { target: this.el, type: "dragstart" });
|
|
2487
2487
|
this.option.start && this.option.start(r, this.ui()), this.triggerEvent("dragstart", r), document.addEventListener("keydown", this._keyEvent);
|
|
2488
2488
|
}
|
|
@@ -2491,17 +2491,17 @@ class ye extends Ke {
|
|
|
2491
2491
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
2492
2492
|
_mouseUp(e) {
|
|
2493
2493
|
var t, i;
|
|
2494
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Y && e.currentTarget && (e.currentTarget.removeEventListener("touchmove",
|
|
2495
|
-
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i =
|
|
2494
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Y && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", Se, !0), e.currentTarget.removeEventListener("touchend", ke, !0)), this.dragging) {
|
|
2495
|
+
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = w.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete w.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
2496
2496
|
const s = c.initEvent(e, { target: this.el, type: "dragstop" });
|
|
2497
|
-
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s),
|
|
2497
|
+
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), w.dropElement && w.dropElement.drop(e);
|
|
2498
2498
|
}
|
|
2499
|
-
delete this.helper, delete this.mouseDownEvent, delete
|
|
2499
|
+
delete this.helper, delete this.mouseDownEvent, delete w.dragElement, delete w.dropElement, delete w.mouseHandled, e.preventDefault();
|
|
2500
2500
|
}
|
|
2501
2501
|
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
|
|
2502
2502
|
_keyEvent(e) {
|
|
2503
2503
|
var s, r;
|
|
2504
|
-
const t = this.el.gridstackNode, i = (t == null ? void 0 : t.grid) || ((r = (s =
|
|
2504
|
+
const t = this.el.gridstackNode, i = (t == null ? void 0 : t.grid) || ((r = (s = w.dropElement) == null ? void 0 : s.el) == null ? void 0 : r.gridstack);
|
|
2505
2505
|
if (e.key === "Escape")
|
|
2506
2506
|
t && t._origRotate && (t._orig = t._origRotate, delete t._origRotate), i == null || i.cancelDrag(), this._mouseUp(this.mouseDownEvent);
|
|
2507
2507
|
else if (t && i && (e.key === "r" || e.key === "R")) {
|
|
@@ -2513,7 +2513,7 @@ class ye extends Ke {
|
|
|
2513
2513
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
2514
2514
|
_createHelper() {
|
|
2515
2515
|
let e = this.el;
|
|
2516
|
-
return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), document.body.contains(e) || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle =
|
|
2516
|
+
return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), document.body.contains(e) || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle = _e.originStyleProp.map((t) => this.el.style[t]), e;
|
|
2517
2517
|
}
|
|
2518
2518
|
/** @internal set the fix position of the dragged item */
|
|
2519
2519
|
_setupHelperStyle(e) {
|
|
@@ -2530,7 +2530,7 @@ class ye extends Ke {
|
|
|
2530
2530
|
const e = (t = this.helper) == null ? void 0 : t.gridstackNode;
|
|
2531
2531
|
if (!(e != null && e._isAboutToRemove) && this.dragElementOriginStyle) {
|
|
2532
2532
|
const i = this.helper, s = this.dragElementOriginStyle.transition || null;
|
|
2533
|
-
i.style.transition = this.dragElementOriginStyle.transition = "none",
|
|
2533
|
+
i.style.transition = this.dragElementOriginStyle.transition = "none", _e.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
|
|
2534
2534
|
}
|
|
2535
2535
|
return delete this.dragElementOriginStyle, this;
|
|
2536
2536
|
}
|
|
@@ -2572,7 +2572,7 @@ class ye extends Ke {
|
|
|
2572
2572
|
};
|
|
2573
2573
|
}
|
|
2574
2574
|
}
|
|
2575
|
-
|
|
2575
|
+
_e.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
2576
2576
|
class Gi extends Ke {
|
|
2577
2577
|
constructor(e, t = {}) {
|
|
2578
2578
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
@@ -2597,20 +2597,20 @@ class Gi extends Ke {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
|
|
2599
2599
|
_mouseEnter(e) {
|
|
2600
|
-
if (!
|
|
2600
|
+
if (!w.dragElement || !this._canDrop(w.dragElement.el))
|
|
2601
2601
|
return;
|
|
2602
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2602
|
+
e.preventDefault(), e.stopPropagation(), w.dropElement && w.dropElement !== this && w.dropElement._mouseLeave(e, !0), w.dropElement = this;
|
|
2603
2603
|
const t = c.initEvent(e, { target: this.el, type: "dropover" });
|
|
2604
|
-
this.option.over && this.option.over(t, this._ui(
|
|
2604
|
+
this.option.over && this.option.over(t, this._ui(w.dragElement)), this.triggerEvent("dropover", t), this.el.classList.add("ui-droppable-over");
|
|
2605
2605
|
}
|
|
2606
2606
|
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
|
|
2607
2607
|
_mouseLeave(e, t = !1) {
|
|
2608
2608
|
var s;
|
|
2609
|
-
if (!
|
|
2609
|
+
if (!w.dragElement || w.dropElement !== this)
|
|
2610
2610
|
return;
|
|
2611
2611
|
e.preventDefault(), e.stopPropagation();
|
|
2612
2612
|
const i = c.initEvent(e, { target: this.el, type: "dropout" });
|
|
2613
|
-
if (this.option.out && this.option.out(i, this._ui(
|
|
2613
|
+
if (this.option.out && this.option.out(i, this._ui(w.dragElement)), this.triggerEvent("dropout", i), w.dropElement === this && (delete w.dropElement, !t)) {
|
|
2614
2614
|
let r, o = this.el.parentElement;
|
|
2615
2615
|
for (; !r && o; )
|
|
2616
2616
|
r = (s = o.ddElement) == null ? void 0 : s.ddDroppable, o = o.parentElement;
|
|
@@ -2621,7 +2621,7 @@ class Gi extends Ke {
|
|
|
2621
2621
|
drop(e) {
|
|
2622
2622
|
e.preventDefault();
|
|
2623
2623
|
const t = c.initEvent(e, { target: this.el, type: "drop" });
|
|
2624
|
-
this.option.drop && this.option.drop(t, this._ui(
|
|
2624
|
+
this.option.drop && this.option.drop(t, this._ui(w.dragElement)), this.triggerEvent("drop", t);
|
|
2625
2625
|
}
|
|
2626
2626
|
/** @internal true if element matches the string/method accept option */
|
|
2627
2627
|
_canDrop(e) {
|
|
@@ -2653,13 +2653,13 @@ class Ve {
|
|
|
2653
2653
|
return this.ddDraggable && ["drag", "dragstart", "dragstop"].indexOf(e) > -1 ? this.ddDraggable.off(e) : this.ddDroppable && ["drop", "dropover", "dropout"].indexOf(e) > -1 ? this.ddDroppable.off(e) : this.ddResizable && ["resizestart", "resize", "resizestop"].indexOf(e) > -1 && this.ddResizable.off(e), this;
|
|
2654
2654
|
}
|
|
2655
2655
|
setupDraggable(e) {
|
|
2656
|
-
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new
|
|
2656
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new _e(this.el, e), this;
|
|
2657
2657
|
}
|
|
2658
2658
|
cleanDraggable() {
|
|
2659
2659
|
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
2660
2660
|
}
|
|
2661
2661
|
setupResizable(e) {
|
|
2662
|
-
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new
|
|
2662
|
+
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new ve(this.el, e), this;
|
|
2663
2663
|
}
|
|
2664
2664
|
cleanResizable() {
|
|
2665
2665
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
@@ -2741,7 +2741,7 @@ class Wi {
|
|
|
2741
2741
|
}
|
|
2742
2742
|
on(e, t, i) {
|
|
2743
2743
|
return this._getDDElements(e).forEach((s) => s.on(t, (r) => {
|
|
2744
|
-
i(r,
|
|
2744
|
+
i(r, w.dragElement ? w.dragElement.el : r.target, w.dragElement ? w.dragElement.helper : null);
|
|
2745
2745
|
})), this;
|
|
2746
2746
|
}
|
|
2747
2747
|
off(e, t) {
|
|
@@ -2764,7 +2764,7 @@ class Wi {
|
|
|
2764
2764
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
2765
2765
|
*/
|
|
2766
2766
|
const I = new Wi();
|
|
2767
|
-
class
|
|
2767
|
+
class b {
|
|
2768
2768
|
/**
|
|
2769
2769
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
2770
2770
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -2781,8 +2781,8 @@ class _ {
|
|
|
2781
2781
|
static init(e = {}, t = ".grid-stack") {
|
|
2782
2782
|
if (typeof document > "u")
|
|
2783
2783
|
return null;
|
|
2784
|
-
const i =
|
|
2785
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
2784
|
+
const i = b.getGridElement(t);
|
|
2785
|
+
return i ? (i.gridstack || (i.gridstack = new b(i, c.cloneDeep(e))), i.gridstack) : (console.error(typeof t == "string" ? 'GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
2786
2786
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.` : "GridStack.init() no grid element was passed."), null);
|
|
2787
2787
|
}
|
|
2788
2788
|
/**
|
|
@@ -2796,8 +2796,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2796
2796
|
*/
|
|
2797
2797
|
static initAll(e = {}, t = ".grid-stack") {
|
|
2798
2798
|
const i = [];
|
|
2799
|
-
return typeof document > "u" || (
|
|
2800
|
-
s.gridstack || (s.gridstack = new
|
|
2799
|
+
return typeof document > "u" || (b.getGridElements(t).forEach((s) => {
|
|
2800
|
+
s.gridstack || (s.gridstack = new b(s, c.cloneDeep(e))), i.push(s.gridstack);
|
|
2801
2801
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
2802
2802
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)), i;
|
|
2803
2803
|
}
|
|
@@ -2816,19 +2816,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2816
2816
|
const o = i.gridstack;
|
|
2817
2817
|
return t && (o.opts = { ...o.opts, ...t }), t.children !== void 0 && o.load(t.children), o;
|
|
2818
2818
|
}
|
|
2819
|
-
return (!e.classList.contains("grid-stack") ||
|
|
2819
|
+
return (!e.classList.contains("grid-stack") || b.addRemoveCB) && (b.addRemoveCB ? i = b.addRemoveCB(e, t, !0, !0) : i = c.createDiv(["grid-stack", t.class], e)), b.init(t, i);
|
|
2820
2820
|
}
|
|
2821
2821
|
/** call this method to register your engine instead of the default one.
|
|
2822
2822
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
2823
2823
|
* replace just one instance.
|
|
2824
2824
|
*/
|
|
2825
2825
|
static registerEngine(e) {
|
|
2826
|
-
|
|
2826
|
+
b.engineClass = e;
|
|
2827
2827
|
}
|
|
2828
2828
|
/** @internal create placeholder DIV as needed */
|
|
2829
2829
|
get placeholder() {
|
|
2830
2830
|
if (!this._placeholder) {
|
|
2831
|
-
this._placeholder = c.createDiv([this.opts.placeholderClass,
|
|
2831
|
+
this._placeholder = c.createDiv([this.opts.placeholderClass, $.itemClass, this.opts.itemClass]);
|
|
2832
2832
|
const e = c.createDiv(["placeholder-content"], this._placeholder);
|
|
2833
2833
|
this.opts.placeholderText && (e.textContent = this.opts.placeholderText);
|
|
2834
2834
|
}
|
|
@@ -2840,7 +2840,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2840
2840
|
* @param opts grid options - public for classes to access, but use methods to modify!
|
|
2841
2841
|
*/
|
|
2842
2842
|
constructor(e, t = {}) {
|
|
2843
|
-
var h, f,
|
|
2843
|
+
var h, f, p;
|
|
2844
2844
|
this.el = e, this.opts = t, this.animationDelay = 310, this._gsEventHandler = {}, this._extraDragRow = 0, this.dragTransform = { xScale: 1, yScale: 1, xOffset: 0, yOffset: 0 }, e.gridstack = this, this.opts = t = t || {}, e.classList.contains("grid-stack") || this.el.classList.add("grid-stack"), t.row && (t.minRow = t.maxRow = t.row, delete t.row);
|
|
2845
2845
|
const i = c.toNumber(e.getAttribute("gs-row"));
|
|
2846
2846
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
@@ -2849,48 +2849,48 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2849
2849
|
if (r.oneColumnModeDomSort && (delete r.oneColumnModeDomSort, console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")), r.oneColumnSize || r.disableOneColumnMode === !1) {
|
|
2850
2850
|
const m = r.oneColumnSize || 768;
|
|
2851
2851
|
delete r.oneColumnSize, delete r.disableOneColumnMode, t.columnOpts = t.columnOpts || {}, s = t.columnOpts.breakpoints = t.columnOpts.breakpoints || [];
|
|
2852
|
-
let y = s.find((
|
|
2852
|
+
let y = s.find((g) => g.c === 1);
|
|
2853
2853
|
y ? y.w = m : (y = { c: 1, w: m }, s.push(y, { c: 12, w: m + 1 }));
|
|
2854
2854
|
}
|
|
2855
2855
|
const o = t.columnOpts;
|
|
2856
2856
|
o && (!o.columnWidth && !((f = o.breakpoints) != null && f.length) ? (delete t.columnOpts, s = void 0) : o.columnMax = o.columnMax || 12), (s == null ? void 0 : s.length) > 1 && s.sort((m, y) => (y.w || 0) - (m.w || 0));
|
|
2857
2857
|
const n = {
|
|
2858
|
-
...c.cloneDeep(
|
|
2859
|
-
column: c.toNumber(e.getAttribute("gs-column")) ||
|
|
2860
|
-
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) ||
|
|
2861
|
-
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) ||
|
|
2862
|
-
staticGrid: c.toBool(e.getAttribute("gs-static")) ||
|
|
2858
|
+
...c.cloneDeep($),
|
|
2859
|
+
column: c.toNumber(e.getAttribute("gs-column")) || $.column,
|
|
2860
|
+
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) || $.minRow,
|
|
2861
|
+
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) || $.maxRow,
|
|
2862
|
+
staticGrid: c.toBool(e.getAttribute("gs-static")) || $.staticGrid,
|
|
2863
2863
|
sizeToContent: c.toBool(e.getAttribute("gs-size-to-content")) || void 0,
|
|
2864
2864
|
draggable: {
|
|
2865
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
2865
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || $.draggable.handle
|
|
2866
2866
|
},
|
|
2867
2867
|
removableOptions: {
|
|
2868
|
-
accept: t.itemClass ||
|
|
2869
|
-
decline:
|
|
2868
|
+
accept: t.itemClass || $.removableOptions.accept,
|
|
2869
|
+
decline: $.removableOptions.decline
|
|
2870
2870
|
}
|
|
2871
2871
|
};
|
|
2872
2872
|
e.getAttribute("gs-animate") && (n.animate = c.toBool(e.getAttribute("gs-animate"))), t = c.defaults(t, n), this._initMargin(), this.checkDynamicColumn(), this.el.classList.add("gs-" + t.column), t.rtl === "auto" && (t.rtl = e.style.direction === "rtl"), t.rtl && this.el.classList.add("grid-stack-rtl");
|
|
2873
|
-
const d = this.el.closest("." +
|
|
2874
|
-
l && (l.subGrid = this, this.parentGridNode = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !==
|
|
2875
|
-
const a = t.engineClass ||
|
|
2873
|
+
const d = this.el.closest("." + $.itemClass), l = d == null ? void 0 : d.gridstackNode;
|
|
2874
|
+
l && (l.subGrid = this, this.parentGridNode = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !== $.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = Y), this._styleSheetClass = "gs-id-" + X._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
2875
|
+
const a = t.engineClass || b.engineClass || X;
|
|
2876
2876
|
if (this.engine = new a({
|
|
2877
2877
|
column: this.getColumn(),
|
|
2878
2878
|
float: t.float,
|
|
2879
2879
|
maxRow: t.maxRow,
|
|
2880
2880
|
onChange: (m) => {
|
|
2881
2881
|
let y = 0;
|
|
2882
|
-
this.engine.nodes.forEach((
|
|
2883
|
-
y = Math.max(y,
|
|
2884
|
-
}), m.forEach((
|
|
2885
|
-
const C =
|
|
2886
|
-
C && (
|
|
2882
|
+
this.engine.nodes.forEach((g) => {
|
|
2883
|
+
y = Math.max(y, g.y + g.h);
|
|
2884
|
+
}), m.forEach((g) => {
|
|
2885
|
+
const C = g.el;
|
|
2886
|
+
C && (g._removeDOM ? (C && C.remove(), delete g._removeDOM) : this._writePosAttr(C, g));
|
|
2887
2887
|
}), this._updateStyles(!1, y);
|
|
2888
2888
|
}
|
|
2889
2889
|
}), this._updateStyles(!1, 0), t.auto && (this.batchUpdate(), this.engine._loading = !0, this.getGridItems().forEach((m) => this._prepareElement(m)), delete this.engine._loading, this.batchUpdate(!1)), t.children) {
|
|
2890
2890
|
const m = t.children;
|
|
2891
2891
|
delete t.children, m.length && this.load(m);
|
|
2892
2892
|
}
|
|
2893
|
-
this.setAnimation(), t.subGridDynamic && !
|
|
2893
|
+
this.setAnimation(), t.subGridDynamic && !w.pauseDrag && (w.pauseDrag = !0), ((p = t.draggable) == null ? void 0 : p.pause) !== void 0 && (w.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
2894
2894
|
}
|
|
2895
2895
|
/**
|
|
2896
2896
|
* add a new widget and returns it.
|
|
@@ -2913,7 +2913,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2913
2913
|
if (e.ELEMENT_NODE)
|
|
2914
2914
|
return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"), this.makeWidget(e);
|
|
2915
2915
|
let t, i = e;
|
|
2916
|
-
if (i.grid = this, i != null && i.el ? t = i.el :
|
|
2916
|
+
if (i.grid = this, i != null && i.el ? t = i.el : b.addRemoveCB ? t = b.addRemoveCB(this.el, e, !0, !1) : t = c.createWidgetDivs(this.opts.itemClass, i), !t)
|
|
2917
2917
|
return;
|
|
2918
2918
|
if (i = t.gridstackNode, i && t.parentElement === this.el && this.engine.nodes.find((r) => r._id === i._id))
|
|
2919
2919
|
return t;
|
|
@@ -2930,9 +2930,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2930
2930
|
* @returns newly created grid
|
|
2931
2931
|
*/
|
|
2932
2932
|
makeSubGrid(e, t, i, s = !0) {
|
|
2933
|
-
var
|
|
2933
|
+
var p, m, y;
|
|
2934
2934
|
let r = e.gridstackNode;
|
|
2935
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
2935
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (p = r.subGrid) != null && p.el)
|
|
2936
2936
|
return r.subGrid;
|
|
2937
2937
|
let o, n = this;
|
|
2938
2938
|
for (; n && !o; )
|
|
@@ -2952,11 +2952,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2952
2952
|
let d;
|
|
2953
2953
|
t.column === "auto" && (d = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
|
|
2954
2954
|
let l = r.el.querySelector(".grid-stack-item-content"), a, h;
|
|
2955
|
-
if (s && (this._removeDD(r.el), h = { ...r, x: 0, y: 0 }, c.removeInternalForSave(h), delete h.subGridOpts, r.content && (h.content = r.content, delete r.content),
|
|
2956
|
-
const
|
|
2957
|
-
|
|
2955
|
+
if (s && (this._removeDD(r.el), h = { ...r, x: 0, y: 0 }, c.removeInternalForSave(h), delete h.subGridOpts, r.content && (h.content = r.content, delete r.content), b.addRemoveCB ? a = b.addRemoveCB(this.el, h, !0, !1) : (a = c.createDiv(["grid-stack-item"]), a.appendChild(l), l = c.createDiv(["grid-stack-item-content"], r.el)), this._prepareDragDropByNode(r)), i) {
|
|
2956
|
+
const g = d ? t.column : r.w, C = r.h + i.h, S = r.el.style;
|
|
2957
|
+
S.transition = "none", this.update(r.el, { w: g, h: C }), setTimeout(() => S.transition = null);
|
|
2958
2958
|
}
|
|
2959
|
-
const f = r.subGrid =
|
|
2959
|
+
const f = r.subGrid = b.addGrid(l, t);
|
|
2960
2960
|
return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(a, h), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
|
|
2961
2961
|
}
|
|
2962
2962
|
/**
|
|
@@ -2979,7 +2979,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2979
2979
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
2980
2980
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
2981
2981
|
*/
|
|
2982
|
-
save(e = !0, t = !1, i =
|
|
2982
|
+
save(e = !0, t = !1, i = b.saveCB) {
|
|
2983
2983
|
const s = this.engine.save(e, i);
|
|
2984
2984
|
if (s.forEach((r) => {
|
|
2985
2985
|
var o;
|
|
@@ -2995,7 +2995,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2995
2995
|
const r = c.cloneDeep(this.opts);
|
|
2996
2996
|
r.marginBottom === r.marginTop && r.marginRight === r.marginLeft && r.marginTop === r.marginRight && (r.margin = r.marginTop, delete r.marginTop, delete r.marginRight, delete r.marginBottom, delete r.marginLeft), r.rtl === (this.el.style.direction === "rtl") && (r.rtl = "auto"), this._isAutoCellHeight && (r.cellHeight = "auto"), this._autoColumn && (r.column = "auto");
|
|
2997
2997
|
const o = r._alwaysShowResizeHandle;
|
|
2998
|
-
return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r,
|
|
2998
|
+
return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r, $), r.children = s, r;
|
|
2999
2999
|
}
|
|
3000
3000
|
return s;
|
|
3001
3001
|
}
|
|
@@ -3009,7 +3009,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3009
3009
|
* @example
|
|
3010
3010
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3011
3011
|
*/
|
|
3012
|
-
load(e, t =
|
|
3012
|
+
load(e, t = b.addRemoveCB || !0) {
|
|
3013
3013
|
var l;
|
|
3014
3014
|
e = c.cloneDeep(e);
|
|
3015
3015
|
const i = this.getColumn();
|
|
@@ -3020,15 +3020,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3020
3020
|
e.forEach((a) => {
|
|
3021
3021
|
s = Math.max(s, (a.x || 0) + a.w);
|
|
3022
3022
|
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
|
|
3023
|
-
const r =
|
|
3024
|
-
typeof t == "function" && (
|
|
3023
|
+
const r = b.addRemoveCB;
|
|
3024
|
+
typeof t == "function" && (b.addRemoveCB = t);
|
|
3025
3025
|
const o = [];
|
|
3026
3026
|
this.batchUpdate();
|
|
3027
3027
|
const n = !this.engine.nodes.length;
|
|
3028
3028
|
n && this.setAnimation(!1), !n && t && [...this.engine.nodes].forEach((h) => {
|
|
3029
3029
|
if (!h.id)
|
|
3030
3030
|
return;
|
|
3031
|
-
c.find(e, h.id) || (
|
|
3031
|
+
c.find(e, h.id) || (b.addRemoveCB && b.addRemoveCB(this.el, h, !1, !1), o.push(h), this.removeWidget(h.el, !0, !1));
|
|
3032
3032
|
}), this.engine._loading = !0;
|
|
3033
3033
|
const d = [];
|
|
3034
3034
|
return this.engine.nodes = this.engine.nodes.filter((a) => c.find(e, a.id) ? (d.push(a), !1) : !0), e.forEach((a) => {
|
|
@@ -3036,11 +3036,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3036
3036
|
const h = c.find(d, a.id);
|
|
3037
3037
|
if (h) {
|
|
3038
3038
|
if (c.shouldSizeToContent(h) && (a.h = h.h), this.engine.nodeBoundFix(a), (a.autoPosition || a.x === void 0 || a.y === void 0) && (a.w = a.w || h.w, a.h = a.h || h.h, this.engine.findEmptyPosition(a)), this.engine.nodes.push(h), c.samePos(h, a) && this.engine.nodes.length > 1 && (this.moveNode(h, { ...a, forceCollide: !0 }), c.copyPos(a, h)), this.update(h.el, a), (f = a.subGridOpts) != null && f.children) {
|
|
3039
|
-
const
|
|
3040
|
-
|
|
3039
|
+
const p = h.el.querySelector(".grid-stack");
|
|
3040
|
+
p && p.gridstack && p.gridstack.load(a.subGridOpts.children);
|
|
3041
3041
|
}
|
|
3042
3042
|
} else t && this.addWidget(a);
|
|
3043
|
-
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ?
|
|
3043
|
+
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? b.addRemoveCB = r : delete b.addRemoveCB, n && ((l = this.opts) != null && l.animate) && this.setAnimation(this.opts.animate, !0), this;
|
|
3044
3044
|
}
|
|
3045
3045
|
/**
|
|
3046
3046
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3229,7 +3229,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3229
3229
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3230
3230
|
*/
|
|
3231
3231
|
makeWidget(e, t) {
|
|
3232
|
-
const i =
|
|
3232
|
+
const i = b.getElement(e);
|
|
3233
3233
|
if (!i)
|
|
3234
3234
|
return;
|
|
3235
3235
|
i.parentElement || this.el.appendChild(i), this._prepareElement(i, !0, t);
|
|
@@ -3261,11 +3261,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3261
3261
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3262
3262
|
*/
|
|
3263
3263
|
removeWidget(e, t = !0, i = !0) {
|
|
3264
|
-
return e ? (
|
|
3264
|
+
return e ? (b.getElements(e).forEach((s) => {
|
|
3265
3265
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3266
3266
|
return;
|
|
3267
3267
|
let r = s.gridstackNode;
|
|
3268
|
-
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t &&
|
|
3268
|
+
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t && b.addRemoveCB && b.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3269
3269
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this) : (console.error("Error: GridStack.removeWidget(undefined) called"), this);
|
|
3270
3270
|
}
|
|
3271
3271
|
/**
|
|
@@ -3275,7 +3275,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3275
3275
|
*/
|
|
3276
3276
|
removeAll(e = !0, t = !0) {
|
|
3277
3277
|
return this.engine.nodes.forEach((i) => {
|
|
3278
|
-
e &&
|
|
3278
|
+
e && b.addRemoveCB && b.addRemoveCB(this.el, i, !1, !1), delete i.el.gridstackNode, this.opts.staticGrid || this._removeDD(i.el);
|
|
3279
3279
|
}), this.engine.removeAll(e, t), t && this._triggerRemoveEvent(), this;
|
|
3280
3280
|
}
|
|
3281
3281
|
/**
|
|
@@ -3316,7 +3316,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3316
3316
|
let s = 1;
|
|
3317
3317
|
return t = { x: i[s++], y: i[s++], w: i[s++], h: i[s++] }, this.update(e, t);
|
|
3318
3318
|
}
|
|
3319
|
-
return
|
|
3319
|
+
return b.getElements(e).forEach((i) => {
|
|
3320
3320
|
var a;
|
|
3321
3321
|
const s = i == null ? void 0 : i.gridstackNode;
|
|
3322
3322
|
if (!s)
|
|
@@ -3329,7 +3329,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3329
3329
|
n[h] = r[h] !== void 0 ? r[h] : s[h], delete r[h];
|
|
3330
3330
|
})), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
|
|
3331
3331
|
const h = i.querySelector(".grid-stack-item-content");
|
|
3332
|
-
h && h.textContent !== r.content && (s.content = r.content,
|
|
3332
|
+
h && h.textContent !== r.content && (s.content = r.content, b.renderCB(h, r), (a = s.subGrid) != null && a.el && (h.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
|
|
3333
3333
|
}
|
|
3334
3334
|
let d = !1, l = !1;
|
|
3335
3335
|
for (const h in r)
|
|
@@ -3352,7 +3352,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3352
3352
|
* @param useNodeH set to true if GridStackNode.h should be used instead of actual container height when we don't need to wait for animation to finish to get actual DOM heights
|
|
3353
3353
|
*/
|
|
3354
3354
|
resizeToContent(e) {
|
|
3355
|
-
var f,
|
|
3355
|
+
var f, p;
|
|
3356
3356
|
if (!e || (e.classList.remove("size-to-content-max"), !e.clientHeight))
|
|
3357
3357
|
return;
|
|
3358
3358
|
const t = e.gridstackNode;
|
|
@@ -3365,7 +3365,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3365
3365
|
if (!s)
|
|
3366
3366
|
return;
|
|
3367
3367
|
let r = t.h ? t.h * s : e.clientHeight, o;
|
|
3368
|
-
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(
|
|
3368
|
+
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(b.resizeToContentParent)), !o)
|
|
3369
3369
|
return;
|
|
3370
3370
|
const n = e.clientHeight - o.clientHeight, d = t.h ? t.h * s - n : o.clientHeight;
|
|
3371
3371
|
let l;
|
|
@@ -3374,12 +3374,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3374
3374
|
const m = t.subGrid.el.getBoundingClientRect(), y = t.subGrid.el.parentElement.getBoundingClientRect();
|
|
3375
3375
|
l += m.top - y.top;
|
|
3376
3376
|
} else {
|
|
3377
|
-
if ((
|
|
3377
|
+
if ((p = (f = t.subGridOpts) == null ? void 0 : f.children) != null && p.length)
|
|
3378
3378
|
return;
|
|
3379
3379
|
{
|
|
3380
3380
|
const m = o.firstElementChild;
|
|
3381
3381
|
if (!m) {
|
|
3382
|
-
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${
|
|
3382
|
+
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${b.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
3383
3383
|
return;
|
|
3384
3384
|
}
|
|
3385
3385
|
l = m.getBoundingClientRect().height || d;
|
|
@@ -3394,14 +3394,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3394
3394
|
}
|
|
3395
3395
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
3396
3396
|
resizeToContentCBCheck(e) {
|
|
3397
|
-
|
|
3397
|
+
b.resizeToContentCB ? b.resizeToContentCB(e) : this.resizeToContent(e);
|
|
3398
3398
|
}
|
|
3399
3399
|
/** rotate (by swapping w & h) the passed in node - called when user press 'r' during dragging
|
|
3400
3400
|
* @param els widget or selector of objects to modify
|
|
3401
3401
|
* @param relative optional pixel coord relative to upper/left corner to rotate around (will keep that cell under cursor)
|
|
3402
3402
|
*/
|
|
3403
3403
|
rotate(e, t) {
|
|
3404
|
-
return
|
|
3404
|
+
return b.getElements(e).forEach((i) => {
|
|
3405
3405
|
const s = i.gridstackNode;
|
|
3406
3406
|
if (!c.canBeRotated(s))
|
|
3407
3407
|
return;
|
|
@@ -3542,7 +3542,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3542
3542
|
}
|
|
3543
3543
|
/** @internal */
|
|
3544
3544
|
_prepareElement(e, t = !1, i) {
|
|
3545
|
-
i = i || this._readAttr(e), e.gridstackNode = i, i.el = e, i.grid = this, i = this.engine.addNode(i, t), this._writeAttr(e, i), e.classList.add(
|
|
3545
|
+
i = i || this._readAttr(e), e.gridstackNode = i, i.el = e, i.grid = this, i = this.engine.addNode(i, t), this._writeAttr(e, i), e.classList.add($.itemClass, this.opts.itemClass);
|
|
3546
3546
|
const s = c.shouldSizeToContent(i);
|
|
3547
3547
|
return s ? e.classList.add("size-to-content") : e.classList.remove("size-to-content"), s && this.resizeToContentCheck(!1, i), this._prepareDragDropByNode(i), this;
|
|
3548
3548
|
}
|
|
@@ -3628,7 +3628,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3628
3628
|
}
|
|
3629
3629
|
/** @internal */
|
|
3630
3630
|
static getGridElement(e) {
|
|
3631
|
-
return
|
|
3631
|
+
return b.getElement(e);
|
|
3632
3632
|
}
|
|
3633
3633
|
/** @internal */
|
|
3634
3634
|
static getGridElements(e) {
|
|
@@ -3658,7 +3658,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3658
3658
|
* @param root optional root which defaults to document (for shadow dom pass the parent HTMLDocument)
|
|
3659
3659
|
*/
|
|
3660
3660
|
static setupDragIn(e, t, i, s = document) {
|
|
3661
|
-
(t == null ? void 0 : t.pause) !== void 0 && (
|
|
3661
|
+
(t == null ? void 0 : t.pause) !== void 0 && (w.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((o, n) => {
|
|
3662
3662
|
I.isDraggable(o) || I.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
|
|
3663
3663
|
});
|
|
3664
3664
|
}
|
|
@@ -3669,7 +3669,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3669
3669
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
3670
3670
|
*/
|
|
3671
3671
|
movable(e, t) {
|
|
3672
|
-
return this.opts.staticGrid ? this : (
|
|
3672
|
+
return this.opts.staticGrid ? this : (b.getElements(e).forEach((i) => {
|
|
3673
3673
|
const s = i.gridstackNode;
|
|
3674
3674
|
s && (t ? delete s.noMove : s.noMove = !0, this._prepareDragDropByNode(s));
|
|
3675
3675
|
}), this);
|
|
@@ -3680,7 +3680,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3680
3680
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
3681
3681
|
*/
|
|
3682
3682
|
resizable(e, t) {
|
|
3683
|
-
return this.opts.staticGrid ? this : (
|
|
3683
|
+
return this.opts.staticGrid ? this : (b.getElements(e).forEach((i) => {
|
|
3684
3684
|
const s = i.gridstackNode;
|
|
3685
3685
|
s && (t ? delete s.noResize : s.noResize = !0, this._prepareDragDropByNode(s));
|
|
3686
3686
|
}), this);
|
|
@@ -3734,7 +3734,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3734
3734
|
cancelDrag() {
|
|
3735
3735
|
var t;
|
|
3736
3736
|
const e = (t = this._placeholder) == null ? void 0 : t.gridstackNode;
|
|
3737
|
-
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove &&
|
|
3737
|
+
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove && b._itemRemoving(e.el, !1), this.engine.restoreInitial());
|
|
3738
3738
|
}
|
|
3739
3739
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
3740
3740
|
_removeDD(e) {
|
|
@@ -3753,8 +3753,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3753
3753
|
return;
|
|
3754
3754
|
if (!((f = n.grid) != null && f.el)) {
|
|
3755
3755
|
o.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
|
|
3756
|
-
const
|
|
3757
|
-
o.style.left =
|
|
3756
|
+
const p = o.getBoundingClientRect();
|
|
3757
|
+
o.style.left = p.x + (this.dragTransform.xScale - 1) * (s.clientX - p.x) / this.dragTransform.xScale + "px", o.style.top = p.y + (this.dragTransform.yScale - 1) * (s.clientY - p.y) / this.dragTransform.yScale + "px", o.style.transformOrigin = "0px 0px";
|
|
3758
3758
|
}
|
|
3759
3759
|
let { top: d, left: l } = o.getBoundingClientRect();
|
|
3760
3760
|
const a = this.el.getBoundingClientRect();
|
|
@@ -3816,12 +3816,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3816
3816
|
n.grid || (n.el || (n = { ...n }), n._isExternal = !0, o.gridstackNode = n);
|
|
3817
3817
|
const d = n.w || Math.round(o.offsetWidth / t) || 1, l = n.h || Math.round(o.offsetHeight / e) || 1;
|
|
3818
3818
|
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h: l, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
|
|
3819
|
-
n._temporaryRemoved = !0) : (n.w = d, n.h = l, n._temporaryRemoved = !0),
|
|
3819
|
+
n._temporaryRemoved = !0) : (n.w = d, n.h = l, n._temporaryRemoved = !0), b._itemRemoving(n.el, !1), I.on(r, "drag", i), i(s, r, o), !1;
|
|
3820
3820
|
}).on(this.el, "dropout", (s, r, o) => {
|
|
3821
3821
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3822
3822
|
return n && (!n.grid || n.grid === this) && (this._leave(r, o), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
3823
3823
|
}).on(this.el, "drop", (s, r, o) => {
|
|
3824
|
-
var
|
|
3824
|
+
var p, m, y;
|
|
3825
3825
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3826
3826
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
3827
3827
|
return !1;
|
|
@@ -3831,13 +3831,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3831
3831
|
a && this.setAnimation(!1);
|
|
3832
3832
|
const h = r._gridstackNodeOrig;
|
|
3833
3833
|
if (delete r._gridstackNodeOrig, d && (h != null && h.grid) && h.grid !== this) {
|
|
3834
|
-
const
|
|
3835
|
-
|
|
3834
|
+
const g = h.grid;
|
|
3835
|
+
g.engine.removeNodeFromLayoutCache(h), g.engine.removedNodes.push(h), g._triggerRemoveEvent()._triggerChangeEvent(), g.parentGridNode && !g.engine.nodes.length && g.opts.subGridDynamic && g.removeAsSubGrid();
|
|
3836
3836
|
}
|
|
3837
|
-
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (
|
|
3837
|
+
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (p = n.grid) == null || delete p._isTemp, I.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !d))
|
|
3838
3838
|
return !1;
|
|
3839
3839
|
const f = (y = (m = n.subGrid) == null ? void 0 : m.el) == null ? void 0 : y.gridstack;
|
|
3840
|
-
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), l && (n.content || n.subGridOpts ||
|
|
3840
|
+
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), l && (n.content || n.subGridOpts || b.addRemoveCB) ? (delete n.el, r = this.addWidget(n)) : (this._prepareElement(r, !0, n), this.el.appendChild(r), this.resizeToContentCheck(!1, n), f && (f.parentGridNode = n, f.opts.styleInHead || f._updateStyles(!0)), this._updateContainerHeight()), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, h && h.grid ? h : void 0, n), a && this.setAnimation(this.opts.animate, !0), !1;
|
|
3841
3841
|
}), this;
|
|
3842
3842
|
}
|
|
3843
3843
|
/** @internal mark item for removal */
|
|
@@ -3852,7 +3852,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3852
3852
|
if (typeof this.opts.removable != "string")
|
|
3853
3853
|
return this;
|
|
3854
3854
|
const e = document.querySelector(this.opts.removable);
|
|
3855
|
-
return e ? (!this.opts.staticGrid && !I.isDroppable(e) && I.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) =>
|
|
3855
|
+
return e ? (!this.opts.staticGrid && !I.isDroppable(e) && I.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => b._itemRemoving(i, !0)).on(e, "dropout", (t, i) => b._itemRemoving(i, !1)), this) : this;
|
|
3856
3856
|
}
|
|
3857
3857
|
/** @internal prepares the element for drag&drop */
|
|
3858
3858
|
_prepareDragDropByNode(e) {
|
|
@@ -3870,8 +3870,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3870
3870
|
const h = e.w !== e._orig.w, f = a.target;
|
|
3871
3871
|
if (!(!f.gridstackNode || f.gridstackNode.grid !== this)) {
|
|
3872
3872
|
if (e.el = f, e._isAboutToRemove) {
|
|
3873
|
-
const
|
|
3874
|
-
|
|
3873
|
+
const p = t.gridstackNode.grid;
|
|
3874
|
+
p._gsEventHandler[a.type] && p._gsEventHandler[a.type](a, f), p.engine.nodes.push(e), p.removeWidget(t, !0, !0);
|
|
3875
3875
|
} else
|
|
3876
3876
|
c.removePositioningStyles(f), e._temporaryRemoved ? (c.copyPos(e, e._orig), this._writePosAttr(f, e), this.engine.addNode(e)) : this._writePosAttr(f, e), this._gsEventHandler[a.type] && this._gsEventHandler[a.type](a, f);
|
|
3877
3877
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), a.type === "resizestop" && (Number.isInteger(e.sizeToContent) && (e.sizeToContent = e.h), this.resizeToContentCheck(h, e));
|
|
@@ -3913,28 +3913,28 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3913
3913
|
_dragOrResize(e, t, i, s, r, o) {
|
|
3914
3914
|
const n = { ...s._orig };
|
|
3915
3915
|
let d, l = this.opts.marginLeft, a = this.opts.marginRight, h = this.opts.marginTop, f = this.opts.marginBottom;
|
|
3916
|
-
const
|
|
3917
|
-
if (l = Math.min(l, m), a = Math.min(a, m), h = Math.min(h,
|
|
3916
|
+
const p = Math.round(o * 0.1), m = Math.round(r * 0.1);
|
|
3917
|
+
if (l = Math.min(l, m), a = Math.min(a, m), h = Math.min(h, p), f = Math.min(f, p), t.type === "drag") {
|
|
3918
3918
|
if (s._temporaryRemoved)
|
|
3919
3919
|
return;
|
|
3920
|
-
const
|
|
3921
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position,
|
|
3922
|
-
const C = i.position.left + (i.position.left > s._lastUiPosition.left ? -a : l),
|
|
3923
|
-
n.x = Math.round(C / r), n.y = Math.round(
|
|
3924
|
-
const
|
|
3920
|
+
const g = i.position.top - s._prevYPix;
|
|
3921
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, g);
|
|
3922
|
+
const C = i.position.left + (i.position.left > s._lastUiPosition.left ? -a : l), S = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : h);
|
|
3923
|
+
n.x = Math.round(C / r), n.y = Math.round(S / o);
|
|
3924
|
+
const v = this._extraDragRow;
|
|
3925
3925
|
if (this.engine.collide(s, n)) {
|
|
3926
|
-
const
|
|
3927
|
-
let
|
|
3928
|
-
this.opts.maxRow &&
|
|
3926
|
+
const z = this.getRow();
|
|
3927
|
+
let x = Math.max(0, n.y + s.h - z);
|
|
3928
|
+
this.opts.maxRow && z + x > this.opts.maxRow && (x = Math.max(0, this.opts.maxRow - z)), this._extraDragRow = x;
|
|
3929
3929
|
} else
|
|
3930
3930
|
this._extraDragRow = 0;
|
|
3931
|
-
if (this._extraDragRow !==
|
|
3931
|
+
if (this._extraDragRow !== v && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
3932
3932
|
return;
|
|
3933
3933
|
} else if (t.type === "resize") {
|
|
3934
3934
|
if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width - l) / r), n.h = Math.round((i.size.height - h) / o), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
3935
3935
|
return;
|
|
3936
|
-
const
|
|
3937
|
-
n.x = Math.round(
|
|
3936
|
+
const g = i.position.left + l, C = i.position.top + h;
|
|
3937
|
+
n.x = Math.round(g / r), n.y = Math.round(C / o), d = !0;
|
|
3938
3938
|
}
|
|
3939
3939
|
s._event = t, s._lastTried = n;
|
|
3940
3940
|
const y = {
|
|
@@ -3945,8 +3945,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3945
3945
|
};
|
|
3946
3946
|
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: o, rect: y, resizing: d })) {
|
|
3947
3947
|
s._lastUiPosition = i.position, this.engine.cacheRects(r, o, h, a, f, l), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
3948
|
-
const
|
|
3949
|
-
this._writePosAttr(
|
|
3948
|
+
const g = t.target;
|
|
3949
|
+
this._writePosAttr(g, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, g);
|
|
3950
3950
|
}
|
|
3951
3951
|
}
|
|
3952
3952
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -3956,21 +3956,21 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3956
3956
|
_leave(e, t) {
|
|
3957
3957
|
t = t || e;
|
|
3958
3958
|
const i = t.gridstackNode;
|
|
3959
|
-
i && (t.style.transform = t.style.transformOrigin = null, I.off(e, "drag"), !i._temporaryRemoved && (i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e, i._isExternal && this.engine.cleanupNode(i), this.opts.removable === !0 &&
|
|
3959
|
+
i && (t.style.transform = t.style.transformOrigin = null, I.off(e, "drag"), !i._temporaryRemoved && (i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e, i._isExternal && this.engine.cleanupNode(i), this.opts.removable === !0 && b._itemRemoving(e, !0), e._gridstackNodeOrig ? (e.gridstackNode = e._gridstackNodeOrig, delete e._gridstackNodeOrig) : i._isExternal && this.engine.restoreInitial()));
|
|
3960
3960
|
}
|
|
3961
3961
|
// legacy method removed
|
|
3962
3962
|
commit() {
|
|
3963
3963
|
return Fi(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
3964
3964
|
}
|
|
3965
3965
|
}
|
|
3966
|
-
|
|
3966
|
+
b.renderCB = (u, e) => {
|
|
3967
3967
|
u && (e != null && e.content) && (u.textContent = e.content);
|
|
3968
3968
|
};
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
const Ki = ["data-id", "gs-h", "gs-w", "gs-x", "gs-y"], Vi = { class: "grid-stack-item-content" }, Yi = /* @__PURE__ */
|
|
3969
|
+
b.resizeToContentParent = ".grid-stack-item-content";
|
|
3970
|
+
b.Utils = c;
|
|
3971
|
+
b.Engine = X;
|
|
3972
|
+
b.GDRev = "11.3.0";
|
|
3973
|
+
const Ki = ["data-id", "gs-h", "gs-w", "gs-x", "gs-y"], Vi = { class: "grid-stack-item-content" }, Yi = /* @__PURE__ */ U({
|
|
3974
3974
|
__name: "DraggableGridLayout",
|
|
3975
3975
|
props: {
|
|
3976
3976
|
tiles: {},
|
|
@@ -3979,71 +3979,61 @@ const Ki = ["data-id", "gs-h", "gs-w", "gs-x", "gs-y"], Vi = { class: "grid-stac
|
|
|
3979
3979
|
},
|
|
3980
3980
|
emits: ["update-tiles"],
|
|
3981
3981
|
setup(u, { expose: e, emit: t }) {
|
|
3982
|
-
const i = u, s = t, r =
|
|
3982
|
+
const i = u, s = t, r = F(null), o = F(new Map(i.tiles.map((p) => [`${p.id}`, p])));
|
|
3983
3983
|
let n = null;
|
|
3984
|
-
const d = (
|
|
3985
|
-
var
|
|
3986
|
-
const y =
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
}
|
|
4001
|
-
}, h = (g, m) => {
|
|
3984
|
+
const d = (p) => `[data-id="${p}"]`, l = (p) => p.map((m) => {
|
|
3985
|
+
var g;
|
|
3986
|
+
const y = o.value.get(`${(g = m.el) == null ? void 0 : g.getAttribute("data-id")}`);
|
|
3987
|
+
if (y)
|
|
3988
|
+
return {
|
|
3989
|
+
...y,
|
|
3990
|
+
layout: {
|
|
3991
|
+
position: { col: Number(m.x), row: Number(m.y) },
|
|
3992
|
+
size: { cols: Number(m.w), rows: Number(m.h) }
|
|
3993
|
+
}
|
|
3994
|
+
};
|
|
3995
|
+
}).filter((m) => m !== void 0), a = (p, m) => {
|
|
3996
|
+
n && (l(m).forEach((g) => {
|
|
3997
|
+
o.value.set(`${g.id}`, g);
|
|
3998
|
+
}), s("update-tiles", Array.from(o.value.values())));
|
|
3999
|
+
}, h = (p, m) => {
|
|
4002
4000
|
m.forEach((y) => {
|
|
4003
|
-
var
|
|
4004
|
-
o.value.delete(`${(
|
|
4001
|
+
var g;
|
|
4002
|
+
o.value.delete(`${(g = y.el) == null ? void 0 : g.getAttribute("data-id")}`);
|
|
4005
4003
|
}), s("update-tiles", Array.from(o.value.values()));
|
|
4006
4004
|
};
|
|
4007
4005
|
ft(() => {
|
|
4008
|
-
r.value && (n =
|
|
4006
|
+
r.value && (n = b.init({
|
|
4009
4007
|
column: i.gridSize.cols,
|
|
4010
4008
|
cellHeight: i.tileHeight,
|
|
4011
4009
|
resizable: { handles: "se, sw" },
|
|
4012
4010
|
handle: ".tile-header"
|
|
4013
4011
|
}, r.value), n.on("change", a), n.on("added", a), n.on("removed", h));
|
|
4014
|
-
}),
|
|
4012
|
+
}), $e(() => {
|
|
4015
4013
|
n && n.destroy(!1);
|
|
4016
4014
|
});
|
|
4017
|
-
const f = (
|
|
4015
|
+
const f = (p) => {
|
|
4018
4016
|
if (n && r.value) {
|
|
4019
|
-
const m = r.value.querySelector(d(
|
|
4017
|
+
const m = r.value.querySelector(d(p));
|
|
4020
4018
|
m && n.removeWidget(m);
|
|
4021
4019
|
}
|
|
4022
4020
|
};
|
|
4023
|
-
return
|
|
4024
|
-
if (
|
|
4021
|
+
return Fe(() => i.tiles.length, async (p, m) => {
|
|
4022
|
+
if (p > m && n) {
|
|
4025
4023
|
const y = i.tiles.slice(m);
|
|
4026
|
-
for (const
|
|
4027
|
-
o.value.set(`${
|
|
4024
|
+
for (const g of y)
|
|
4025
|
+
o.value.set(`${g.id}`, g), await dt(), n.makeWidget(d(g.id), {
|
|
4028
4026
|
autoPosition: !0,
|
|
4029
|
-
w:
|
|
4030
|
-
h:
|
|
4027
|
+
w: g.layout.size.cols,
|
|
4028
|
+
h: g.layout.size.rows
|
|
4031
4029
|
});
|
|
4032
4030
|
}
|
|
4033
|
-
}),
|
|
4034
|
-
g.length === m.length && g.forEach((y) => {
|
|
4035
|
-
const p = o.value.get(`${y.id}`);
|
|
4036
|
-
p && o.value.set(`${y.id}`, {
|
|
4037
|
-
...p,
|
|
4038
|
-
meta: y.meta
|
|
4039
|
-
});
|
|
4040
|
-
});
|
|
4041
|
-
}, { deep: !0 }), e({ removeWidget: f }), (g, m) => (D(), q("div", {
|
|
4031
|
+
}), e({ removeWidget: f }), (p, m) => (R(), B("div", {
|
|
4042
4032
|
ref_key: "gridContainer",
|
|
4043
4033
|
ref: r,
|
|
4044
4034
|
class: "grid-stack"
|
|
4045
4035
|
}, [
|
|
4046
|
-
(
|
|
4036
|
+
(R(!0), B(gt, null, pt(i.tiles, (y) => (R(), B("div", {
|
|
4047
4037
|
key: y.id,
|
|
4048
4038
|
class: "grid-stack-item",
|
|
4049
4039
|
"data-id": `${y.id}`,
|
|
@@ -4053,16 +4043,16 @@ const Ki = ["data-id", "gs-h", "gs-w", "gs-x", "gs-y"], Vi = { class: "grid-stac
|
|
|
4053
4043
|
"gs-x": y.layout.position.col,
|
|
4054
4044
|
"gs-y": y.layout.position.row
|
|
4055
4045
|
}, [
|
|
4056
|
-
|
|
4057
|
-
|
|
4046
|
+
de("div", Vi, [
|
|
4047
|
+
He(p.$slots, "tile", { tile: y }, void 0, !0)
|
|
4058
4048
|
])
|
|
4059
4049
|
], 8, Ki))), 128))
|
|
4060
4050
|
], 512));
|
|
4061
4051
|
}
|
|
4062
|
-
}), Xi = /* @__PURE__ */
|
|
4052
|
+
}), Xi = /* @__PURE__ */ he(Yi, [["__scopeId", "data-v-eecf4859"]]), ji = { class: "kong-ui-public-dashboard-renderer" }, Qi = {
|
|
4063
4053
|
key: 0,
|
|
4064
4054
|
class: "tile-container slottable-tile"
|
|
4065
|
-
}, Ji = /* @__PURE__ */
|
|
4055
|
+
}, Ji = /* @__PURE__ */ U({
|
|
4066
4056
|
__name: "DashboardRenderer",
|
|
4067
4057
|
props: {
|
|
4068
4058
|
context: {},
|
|
@@ -4070,102 +4060,105 @@ const Ki = ["data-id", "gs-h", "gs-w", "gs-x", "gs-y"], Vi = { class: "grid-stac
|
|
|
4070
4060
|
},
|
|
4071
4061
|
emits: ["edit-tile", "update-tiles"],
|
|
4072
4062
|
setup(u, { expose: e, emit: t }) {
|
|
4073
|
-
const i = u, s = t, { i18n: r } =
|
|
4074
|
-
d || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")),
|
|
4063
|
+
const i = u, s = t, { i18n: r } = te.useI18n(), o = F(0), n = F(null), d = le(ne);
|
|
4064
|
+
d || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")), te.useRequestQueue();
|
|
4075
4065
|
const l = yt(), a = N(() => i.context.timeSpec ? i.context.timeSpec : {
|
|
4076
4066
|
type: "relative",
|
|
4077
4067
|
time_range: l.defaultQueryTimeForOrg
|
|
4078
|
-
}), h = N(() => !!i.context.timeSpec || !l.loading), f =
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4068
|
+
}), h = N(() => !!i.context.timeSpec || !l.loading), f = (v, z) => {
|
|
4069
|
+
const x = v.layout.position.row - z.layout.position.row;
|
|
4070
|
+
return x !== 0 ? x : v.layout.position.col - z.layout.position.col;
|
|
4071
|
+
}, p = N(() => i.config.tiles.map((v, z) => {
|
|
4072
|
+
var q;
|
|
4073
|
+
let x = v.definition;
|
|
4074
|
+
if ("description" in x.chart) {
|
|
4075
|
+
const oe = (q = x.chart.description) == null ? void 0 : q.replace(li, () => {
|
|
4076
|
+
const ae = `renderer.trendRange.${a.value.type === "absolute" ? "custom" : a.value.time_range}`;
|
|
4077
|
+
return r.te(ae) ? r.t(ae) : "";
|
|
4085
4078
|
});
|
|
4086
|
-
|
|
4087
|
-
...
|
|
4079
|
+
x = {
|
|
4080
|
+
...x,
|
|
4088
4081
|
chart: {
|
|
4089
|
-
...
|
|
4090
|
-
description:
|
|
4082
|
+
...x.chart,
|
|
4083
|
+
description: oe
|
|
4091
4084
|
}
|
|
4092
4085
|
};
|
|
4093
4086
|
}
|
|
4094
|
-
return i.context.editable && !
|
|
4087
|
+
return i.context.editable && !v.id && console.warn(
|
|
4095
4088
|
"No id provided for tile. One will be generated automatically,",
|
|
4096
4089
|
"however tracking changes to this tile may not work as expected.",
|
|
4097
|
-
|
|
4090
|
+
v
|
|
4098
4091
|
), {
|
|
4099
|
-
layout:
|
|
4100
|
-
meta:
|
|
4092
|
+
layout: v.layout,
|
|
4093
|
+
meta: x,
|
|
4101
4094
|
// Add a unique key to each tile internally.
|
|
4102
|
-
id:
|
|
4095
|
+
id: v.id ?? crypto.randomUUID()
|
|
4103
4096
|
};
|
|
4104
|
-
})),
|
|
4105
|
-
let { tz:
|
|
4106
|
-
return
|
|
4097
|
+
})), m = N(() => {
|
|
4098
|
+
let { tz: v, refreshInterval: z, editable: x } = i.context;
|
|
4099
|
+
return v || (v = new Intl.DateTimeFormat().resolvedOptions().timeZone), z === void 0 && (z = hi), x === void 0 && (x = !1), {
|
|
4107
4100
|
...i.context,
|
|
4108
|
-
tz:
|
|
4101
|
+
tz: v,
|
|
4109
4102
|
timeSpec: a.value,
|
|
4110
|
-
refreshInterval:
|
|
4111
|
-
editable:
|
|
4103
|
+
refreshInterval: z,
|
|
4104
|
+
editable: x
|
|
4112
4105
|
};
|
|
4113
|
-
}),
|
|
4114
|
-
s("edit-tile",
|
|
4115
|
-
},
|
|
4116
|
-
n.value && n.value.removeWidget(
|
|
4117
|
-
},
|
|
4106
|
+
}), y = (v) => {
|
|
4107
|
+
s("edit-tile", v);
|
|
4108
|
+
}, g = (v) => {
|
|
4109
|
+
n.value && n.value.removeWidget(v.id);
|
|
4110
|
+
}, C = () => {
|
|
4118
4111
|
o.value++;
|
|
4119
|
-
},
|
|
4120
|
-
const
|
|
4121
|
-
id:
|
|
4122
|
-
layout:
|
|
4123
|
-
definition:
|
|
4112
|
+
}, S = (v) => {
|
|
4113
|
+
const z = v.map((x) => ({
|
|
4114
|
+
id: x.id,
|
|
4115
|
+
layout: x.layout,
|
|
4116
|
+
definition: x.meta
|
|
4124
4117
|
}));
|
|
4125
|
-
s("update-tiles",
|
|
4118
|
+
s("update-tiles", z.sort(f));
|
|
4126
4119
|
};
|
|
4127
|
-
return e({ refresh:
|
|
4128
|
-
const
|
|
4129
|
-
return
|
|
4130
|
-
|
|
4120
|
+
return e({ refresh: C }), (v, z) => {
|
|
4121
|
+
const x = re("KAlert");
|
|
4122
|
+
return R(), B("div", ji, [
|
|
4123
|
+
D(d) ? (R(), A(ct(v.context.editable ? Xi : $i), {
|
|
4131
4124
|
key: 1,
|
|
4132
4125
|
ref_key: "gridLayoutRef",
|
|
4133
4126
|
ref: n,
|
|
4134
|
-
"grid-size":
|
|
4135
|
-
"tile-height":
|
|
4136
|
-
tiles:
|
|
4137
|
-
onUpdateTiles:
|
|
4127
|
+
"grid-size": v.config.gridSize,
|
|
4128
|
+
"tile-height": v.config.tileHeight,
|
|
4129
|
+
tiles: p.value,
|
|
4130
|
+
onUpdateTiles: S
|
|
4138
4131
|
}, {
|
|
4139
|
-
tile: M(({ tile:
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
])) : (
|
|
4132
|
+
tile: M(({ tile: q }) => [
|
|
4133
|
+
q.meta.chart.type === "slottable" ? (R(), B("div", Qi, [
|
|
4134
|
+
He(v.$slots, q.meta.chart.id, {}, void 0, !0)
|
|
4135
|
+
])) : (R(), A(Pi, {
|
|
4143
4136
|
key: 1,
|
|
4144
4137
|
class: "tile-container",
|
|
4145
|
-
context:
|
|
4146
|
-
definition:
|
|
4147
|
-
height:
|
|
4138
|
+
context: m.value,
|
|
4139
|
+
definition: q.meta,
|
|
4140
|
+
height: q.layout.size.rows * (v.config.tileHeight || D(Ue)) + parseInt(D(Dt), 10),
|
|
4148
4141
|
"query-ready": h.value,
|
|
4149
4142
|
"refresh-counter": o.value,
|
|
4150
|
-
"tile-id":
|
|
4151
|
-
onEditTile: (
|
|
4152
|
-
onRemoveTile: (
|
|
4143
|
+
"tile-id": q.id,
|
|
4144
|
+
onEditTile: (oe) => y(q),
|
|
4145
|
+
onRemoveTile: (oe) => g(q)
|
|
4153
4146
|
}, null, 8, ["context", "definition", "height", "query-ready", "refresh-counter", "tile-id", "onEditTile", "onRemoveTile"]))
|
|
4154
4147
|
]),
|
|
4155
4148
|
_: 3
|
|
4156
|
-
}, 40, ["grid-size", "tile-height", "tiles"])) : (
|
|
4149
|
+
}, 40, ["grid-size", "tile-height", "tiles"])) : (R(), A(x, {
|
|
4157
4150
|
key: 0,
|
|
4158
4151
|
appearance: "danger"
|
|
4159
4152
|
}, {
|
|
4160
4153
|
default: M(() => [
|
|
4161
|
-
|
|
4154
|
+
ye(Z(D(r).t("renderer.noQueryBridge")), 1)
|
|
4162
4155
|
]),
|
|
4163
4156
|
_: 1
|
|
4164
4157
|
}))
|
|
4165
4158
|
]);
|
|
4166
4159
|
};
|
|
4167
4160
|
}
|
|
4168
|
-
}), ds = /* @__PURE__ */
|
|
4161
|
+
}), ds = /* @__PURE__ */ he(Ji, [["__scopeId", "data-v-1f29868e"]]);
|
|
4169
4162
|
export {
|
|
4170
4163
|
ai as CP_ID_TOKEN,
|
|
4171
4164
|
Ue as DEFAULT_TILE_HEIGHT,
|
|
@@ -4173,6 +4166,6 @@ export {
|
|
|
4173
4166
|
ds as DashboardRenderer,
|
|
4174
4167
|
Je as ENTITY_ID_TOKEN,
|
|
4175
4168
|
$i as GridLayout,
|
|
4176
|
-
|
|
4169
|
+
ne as INJECT_QUERY_PROVIDER,
|
|
4177
4170
|
li as TIMEFRAME_TOKEN
|
|
4178
4171
|
};
|