@kong-ui-public/dashboard-renderer 7.3.3 → 7.3.4
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/{GeoMapRenderer-Ct-nayUL.js → GeoMapRenderer-DYILqlnm.js} +1 -1
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +4 -4
- package/dist/{index-xMrKxWjm.js → index-CIqRDoFw.js} +553 -553
- package/dist/types/composables/useContextLinks.d.ts.map +1 -1
- package/dist/types/stores/tests/setupPiniaTestStore.d.ts +12 -0
- package/dist/types/stores/tests/setupPiniaTestStore.d.ts.map +1 -0
- package/package.json +6 -6
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var ni = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var bt = (u) => {
|
|
3
3
|
throw TypeError(u);
|
|
4
4
|
};
|
|
5
5
|
var oi = (u, e, t) => e in u ? ni(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var wt = (u, e, t) => oi(u, typeof e != "symbol" ? e + "" : e, t), tt = (u, e, t) => e.has(u) || bt("Cannot " + t);
|
|
7
|
+
var b = (u, e, t) => (tt(u, e, "read from private field"), t ? t.call(u) : e.get(u)), G = (u, e, t) => e.has(u) ? bt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(u) : e.set(u, t), O = (u, e, t, i) => (tt(u, e, "write to private field"), i ? i.call(u, t) : e.set(u, t), t), U = (u, e, t) => (tt(u, e, "access private method"), t);
|
|
8
8
|
var Te = (u, e, t, i) => ({
|
|
9
9
|
set _(s) {
|
|
10
10
|
O(u, e, s, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return
|
|
13
|
+
return b(u, e, i);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { ref as I, watchEffect as
|
|
17
|
-
import { msToGranularity as st, getFieldDataSources as
|
|
16
|
+
import { ref as I, watchEffect as It, inject as Ce, provide as ai, onMounted as ot, computed as D, defineComponent as j, onUnmounted as at, watch as lt, resolveComponent as ge, createBlock as M, renderSlot as ze, createCommentVNode as V, unref as R, openBlock as k, withCtx as P, createVNode as ae, createTextVNode as De, toDisplayString as ne, useCssVars as Ye, createElementVNode as ue, normalizeClass as Qe, mergeProps as qt, createSlots as ht, createElementBlock as K, normalizeProps as li, guardReactiveProps as hi, defineAsyncComponent as Pt, readonly as it, toRef as Et, nextTick as dt, resolveDynamicComponent as $t, toHandlers as di, Fragment as Ft, renderList as Gt, normalizeStyle as xt, mergeModels as Ct, useModel as ui, getCurrentInstance as ci } from "vue";
|
|
17
|
+
import { msToGranularity as st, getFieldDataSources as Ut, stripUnknownFilters as fi, Timeframe as gi, TimePeriods as Bt, TIMEFRAME_LOOKUP as mi, formatTime as Rt } from "@kong-ui-public/analytics-utilities";
|
|
18
18
|
import { SimpleChart as pi, AnalyticsChart as yi, TopNTable as vi, CsvExportModal as _i } from "@kong-ui-public/analytics-chart";
|
|
19
19
|
import bi from "swrv";
|
|
20
20
|
import "axios";
|
|
21
21
|
import { createI18n as wi, i18nTComponent as Ei } from "@kong-ui-public/i18n";
|
|
22
|
-
import { useAnalyticsConfigStore as
|
|
22
|
+
import { useAnalyticsConfigStore as ut } from "@kong-ui-public/analytics-config-store";
|
|
23
23
|
import { VisibilityOffIcon as xi, WarningIcon as Ci, EditIcon as Ri, MoreIcon as ki } from "@kong/icons";
|
|
24
24
|
import { MetricsProvider as Ti, MetricsConsumer as zi } from "@kong-ui-public/analytics-metric-provider";
|
|
25
25
|
var Wt = /* @__PURE__ */ ((u) => (u.VALIDATING = "VALIDATING", u.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", u.PENDING = "PENDING", u.SUCCESS = "SUCCESS", u.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", u.ERROR = "ERROR", u.STALE_IF_ERROR = "STALE_IF_ERROR", u))(Wt || {});
|
|
@@ -33,7 +33,7 @@ function Si(u = I({}), e, t, i = Di) {
|
|
|
33
33
|
"PENDING"
|
|
34
34
|
/* PENDING */
|
|
35
35
|
);
|
|
36
|
-
return
|
|
36
|
+
return It(() => {
|
|
37
37
|
const r = i(u.value);
|
|
38
38
|
if (u.value && r && t.value) {
|
|
39
39
|
s.value = "VALIDATING_HAS_DATA";
|
|
@@ -115,9 +115,9 @@ function Pi() {
|
|
|
115
115
|
// Translation component <i18n-t>
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
const je = 170, Kt = 6,
|
|
118
|
+
const je = 170, Kt = 6, pe = "analytics-query-provider", kt = "{entity-id}", $i = "{cp-id}", Fi = "{timeframe}", Gi = 30 * 1e3, Ui = 3e5, Bi = 36e5;
|
|
119
119
|
function Wi() {
|
|
120
|
-
const u =
|
|
120
|
+
const u = Ce(pe);
|
|
121
121
|
return {
|
|
122
122
|
evaluateFeatureFlag: (t, i) => u ? u.evaluateFeatureFlagFn(t, i) : i
|
|
123
123
|
};
|
|
@@ -165,7 +165,7 @@ var Vt = { exports: {} };
|
|
|
165
165
|
}, n.prototype.emit = function(l, d, a, f, p, g) {
|
|
166
166
|
var y = t ? t + l : l;
|
|
167
167
|
if (!this._events[y]) return !1;
|
|
168
|
-
var m = this._events[y], T = arguments.length,
|
|
168
|
+
var m = this._events[y], T = arguments.length, L, z;
|
|
169
169
|
if (m.fn) {
|
|
170
170
|
switch (m.once && this.removeListener(l, m.fn, void 0, !0), T) {
|
|
171
171
|
case 1:
|
|
@@ -181,29 +181,29 @@ var Vt = { exports: {} };
|
|
|
181
181
|
case 6:
|
|
182
182
|
return m.fn.call(m.context, d, a, f, p, g), !0;
|
|
183
183
|
}
|
|
184
|
-
for (
|
|
185
|
-
|
|
186
|
-
m.fn.apply(m.context,
|
|
184
|
+
for (z = 1, L = new Array(T - 1); z < T; z++)
|
|
185
|
+
L[z - 1] = arguments[z];
|
|
186
|
+
m.fn.apply(m.context, L);
|
|
187
187
|
} else {
|
|
188
|
-
var
|
|
189
|
-
for (
|
|
190
|
-
switch (m[
|
|
188
|
+
var x = m.length, _;
|
|
189
|
+
for (z = 0; z < x; z++)
|
|
190
|
+
switch (m[z].once && this.removeListener(l, m[z].fn, void 0, !0), T) {
|
|
191
191
|
case 1:
|
|
192
|
-
m[
|
|
192
|
+
m[z].fn.call(m[z].context);
|
|
193
193
|
break;
|
|
194
194
|
case 2:
|
|
195
|
-
m[
|
|
195
|
+
m[z].fn.call(m[z].context, d);
|
|
196
196
|
break;
|
|
197
197
|
case 3:
|
|
198
|
-
m[
|
|
198
|
+
m[z].fn.call(m[z].context, d, a);
|
|
199
199
|
break;
|
|
200
200
|
case 4:
|
|
201
|
-
m[
|
|
201
|
+
m[z].fn.call(m[z].context, d, a, f);
|
|
202
202
|
break;
|
|
203
203
|
default:
|
|
204
|
-
if (!
|
|
205
|
-
|
|
206
|
-
m[
|
|
204
|
+
if (!L) for (_ = 1, L = new Array(T - 1); _ < T; _++)
|
|
205
|
+
L[_ - 1] = arguments[_];
|
|
206
|
+
m[z].fn.apply(m[z].context, L);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
return !0;
|
|
@@ -242,9 +242,9 @@ class Qi extends Error {
|
|
|
242
242
|
super(), this.name = "AbortError", this.message = e;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
const
|
|
246
|
-
const e = u.reason === void 0 ?
|
|
247
|
-
return e instanceof Error ? e :
|
|
245
|
+
const Tt = (u) => globalThis.DOMException === void 0 ? new Qi(u) : new DOMException(u), zt = (u) => {
|
|
246
|
+
const e = u.reason === void 0 ? Tt("This operation was aborted.") : u.reason;
|
|
247
|
+
return e instanceof Error ? e : Tt(e);
|
|
248
248
|
};
|
|
249
249
|
function ji(u, e) {
|
|
250
250
|
const {
|
|
@@ -259,8 +259,8 @@ function ji(u, e) {
|
|
|
259
259
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
260
260
|
if (e.signal) {
|
|
261
261
|
const { signal: p } = e;
|
|
262
|
-
p.aborted && a(
|
|
263
|
-
a(
|
|
262
|
+
p.aborted && a(zt(p)), n = () => {
|
|
263
|
+
a(zt(p));
|
|
264
264
|
}, p.addEventListener("abort", n, { once: !0 });
|
|
265
265
|
}
|
|
266
266
|
if (t === Number.POSITIVE_INFINITY) {
|
|
@@ -301,10 +301,10 @@ function Xi(u, e, t) {
|
|
|
301
301
|
}
|
|
302
302
|
return i;
|
|
303
303
|
}
|
|
304
|
-
var
|
|
304
|
+
var Z;
|
|
305
305
|
class Zi {
|
|
306
306
|
constructor() {
|
|
307
|
-
|
|
307
|
+
G(this, Z, []);
|
|
308
308
|
}
|
|
309
309
|
enqueue(e, t) {
|
|
310
310
|
t = {
|
|
@@ -316,62 +316,62 @@ class Zi {
|
|
|
316
316
|
id: t.id,
|
|
317
317
|
run: e
|
|
318
318
|
};
|
|
319
|
-
if (this.size === 0 ||
|
|
320
|
-
|
|
319
|
+
if (this.size === 0 || b(this, Z)[this.size - 1].priority >= t.priority) {
|
|
320
|
+
b(this, Z).push(i);
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
const s = Xi(
|
|
324
|
-
|
|
323
|
+
const s = Xi(b(this, Z), i, (r, o) => o.priority - r.priority);
|
|
324
|
+
b(this, Z).splice(s, 0, i);
|
|
325
325
|
}
|
|
326
326
|
setPriority(e, t) {
|
|
327
|
-
const i =
|
|
327
|
+
const i = b(this, Z).findIndex((r) => r.id === e);
|
|
328
328
|
if (i === -1)
|
|
329
329
|
throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
|
|
330
|
-
const [s] =
|
|
330
|
+
const [s] = b(this, Z).splice(i, 1);
|
|
331
331
|
this.enqueue(s.run, { priority: t, id: e });
|
|
332
332
|
}
|
|
333
333
|
dequeue() {
|
|
334
|
-
const e =
|
|
334
|
+
const e = b(this, Z).shift();
|
|
335
335
|
return e == null ? void 0 : e.run;
|
|
336
336
|
}
|
|
337
337
|
filter(e) {
|
|
338
|
-
return
|
|
338
|
+
return b(this, Z).filter((t) => t.priority === e.priority).map((t) => t.run);
|
|
339
339
|
}
|
|
340
340
|
get size() {
|
|
341
|
-
return
|
|
341
|
+
return b(this, Z).length;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
|
|
345
|
-
var
|
|
344
|
+
Z = new WeakMap();
|
|
345
|
+
var _e, be, fe, Le, we, Ae, J, Ee, W, He, ee, xe, de, Oe, Ve, S, Qt, jt, Xt, Zt, Jt, Pe, rt, nt, $e, ei, Fe;
|
|
346
346
|
class Ji extends Yi {
|
|
347
347
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
348
348
|
constructor(t) {
|
|
349
349
|
var i, s;
|
|
350
350
|
super();
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
351
|
+
G(this, S);
|
|
352
|
+
G(this, _e);
|
|
353
|
+
G(this, be);
|
|
354
|
+
G(this, fe, 0);
|
|
355
|
+
G(this, Le);
|
|
356
|
+
G(this, we);
|
|
357
|
+
G(this, Ae, 0);
|
|
358
|
+
G(this, J);
|
|
359
|
+
G(this, Ee);
|
|
360
|
+
G(this, W);
|
|
361
|
+
G(this, He);
|
|
362
|
+
G(this, ee, 0);
|
|
363
363
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
G(this, xe);
|
|
365
|
+
G(this, de);
|
|
366
|
+
G(this, Oe);
|
|
367
367
|
// Use to assign a unique identifier to a promise function, if not explicitly specified
|
|
368
|
-
|
|
368
|
+
G(this, Ve, 1n);
|
|
369
369
|
/**
|
|
370
370
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
371
371
|
|
|
372
372
|
Applies to each future operation.
|
|
373
373
|
*/
|
|
374
|
-
|
|
374
|
+
wt(this, "timeout");
|
|
375
375
|
if (t = {
|
|
376
376
|
carryoverConcurrencyCount: !1,
|
|
377
377
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
@@ -384,15 +384,15 @@ class Ji extends Yi {
|
|
|
384
384
|
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})`);
|
|
385
385
|
if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
|
|
386
386
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s = t.interval) == null ? void 0 : s.toString()) ?? ""}\` (${typeof t.interval})`);
|
|
387
|
-
O(this,
|
|
387
|
+
O(this, _e, t.carryoverConcurrencyCount), O(this, be, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), O(this, Le, t.intervalCap), O(this, we, t.interval), O(this, W, new t.queueClass()), O(this, He, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, O(this, Oe, t.throwOnTimeout === !0), O(this, de, t.autoStart === !1);
|
|
388
388
|
}
|
|
389
389
|
get concurrency() {
|
|
390
|
-
return
|
|
390
|
+
return b(this, xe);
|
|
391
391
|
}
|
|
392
392
|
set concurrency(t) {
|
|
393
393
|
if (!(typeof t == "number" && t >= 1))
|
|
394
394
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
|
|
395
|
-
O(this,
|
|
395
|
+
O(this, xe, t), U(this, S, $e).call(this);
|
|
396
396
|
}
|
|
397
397
|
/**
|
|
398
398
|
Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
|
|
@@ -431,21 +431,21 @@ class Ji extends Yi {
|
|
|
431
431
|
Here, the promise function with `id: '🦀'` executes last.
|
|
432
432
|
*/
|
|
433
433
|
setPriority(t, i) {
|
|
434
|
-
|
|
434
|
+
b(this, W).setPriority(t, i);
|
|
435
435
|
}
|
|
436
436
|
async add(t, i = {}) {
|
|
437
437
|
return i.id ?? (i.id = (Te(this, Ve)._++).toString()), i = {
|
|
438
438
|
timeout: this.timeout,
|
|
439
|
-
throwOnTimeout:
|
|
439
|
+
throwOnTimeout: b(this, Oe),
|
|
440
440
|
...i
|
|
441
441
|
}, new Promise((s, r) => {
|
|
442
|
-
|
|
442
|
+
b(this, W).enqueue(async () => {
|
|
443
443
|
var o;
|
|
444
|
-
Te(this,
|
|
444
|
+
Te(this, ee)._++, Te(this, fe)._++;
|
|
445
445
|
try {
|
|
446
446
|
(o = i.signal) == null || o.throwIfAborted();
|
|
447
447
|
let n = t({ signal: i.signal });
|
|
448
|
-
i.timeout && (n = ji(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n,
|
|
448
|
+
i.timeout && (n = ji(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, U(this, S, ei).call(this, i.signal)]));
|
|
449
449
|
const h = await n;
|
|
450
450
|
s(h), this.emit("completed", h);
|
|
451
451
|
} catch (n) {
|
|
@@ -455,9 +455,9 @@ class Ji extends Yi {
|
|
|
455
455
|
}
|
|
456
456
|
r(n), this.emit("error", n);
|
|
457
457
|
} finally {
|
|
458
|
-
|
|
458
|
+
U(this, S, Xt).call(this);
|
|
459
459
|
}
|
|
460
|
-
}, i), this.emit("add"),
|
|
460
|
+
}, i), this.emit("add"), U(this, S, Pe).call(this);
|
|
461
461
|
});
|
|
462
462
|
}
|
|
463
463
|
async addAll(t, i) {
|
|
@@ -467,19 +467,19 @@ class Ji extends Yi {
|
|
|
467
467
|
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.)
|
|
468
468
|
*/
|
|
469
469
|
start() {
|
|
470
|
-
return
|
|
470
|
+
return b(this, de) ? (O(this, de, !1), U(this, S, $e).call(this), this) : this;
|
|
471
471
|
}
|
|
472
472
|
/**
|
|
473
473
|
Put queue execution on hold.
|
|
474
474
|
*/
|
|
475
475
|
pause() {
|
|
476
|
-
O(this,
|
|
476
|
+
O(this, de, !0);
|
|
477
477
|
}
|
|
478
478
|
/**
|
|
479
479
|
Clear the queue.
|
|
480
480
|
*/
|
|
481
481
|
clear() {
|
|
482
|
-
O(this,
|
|
482
|
+
O(this, W, new (b(this, He))());
|
|
483
483
|
}
|
|
484
484
|
/**
|
|
485
485
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -487,7 +487,7 @@ class Ji extends Yi {
|
|
|
487
487
|
@returns A promise that settles when the queue becomes empty.
|
|
488
488
|
*/
|
|
489
489
|
async onEmpty() {
|
|
490
|
-
|
|
490
|
+
b(this, W).size !== 0 && await U(this, S, Fe).call(this, "empty");
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
493
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -497,7 +497,7 @@ class Ji extends Yi {
|
|
|
497
497
|
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.
|
|
498
498
|
*/
|
|
499
499
|
async onSizeLessThan(t) {
|
|
500
|
-
|
|
500
|
+
b(this, W).size < t || await U(this, S, Fe).call(this, "next", () => b(this, W).size < t);
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
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.
|
|
@@ -505,13 +505,13 @@ class Ji extends Yi {
|
|
|
505
505
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
506
506
|
*/
|
|
507
507
|
async onIdle() {
|
|
508
|
-
|
|
508
|
+
b(this, ee) === 0 && b(this, W).size === 0 || await U(this, S, Fe).call(this, "idle");
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
Size of the queue, the number of queued items waiting to run.
|
|
512
512
|
*/
|
|
513
513
|
get size() {
|
|
514
|
-
return
|
|
514
|
+
return b(this, W).size;
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
Size of the queue, filtered by the given options.
|
|
@@ -519,63 +519,63 @@ class Ji extends Yi {
|
|
|
519
519
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
520
520
|
*/
|
|
521
521
|
sizeBy(t) {
|
|
522
|
-
return
|
|
522
|
+
return b(this, W).filter(t).length;
|
|
523
523
|
}
|
|
524
524
|
/**
|
|
525
525
|
Number of running items (no longer in the queue).
|
|
526
526
|
*/
|
|
527
527
|
get pending() {
|
|
528
|
-
return
|
|
528
|
+
return b(this, ee);
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
531
531
|
Whether the queue is currently paused.
|
|
532
532
|
*/
|
|
533
533
|
get isPaused() {
|
|
534
|
-
return
|
|
534
|
+
return b(this, de);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
|
|
538
|
-
return
|
|
537
|
+
_e = new WeakMap(), be = new WeakMap(), fe = new WeakMap(), Le = new WeakMap(), we = new WeakMap(), Ae = new WeakMap(), J = new WeakMap(), Ee = new WeakMap(), W = new WeakMap(), He = new WeakMap(), ee = new WeakMap(), xe = new WeakMap(), de = new WeakMap(), Oe = new WeakMap(), Ve = new WeakMap(), S = new WeakSet(), Qt = function() {
|
|
538
|
+
return b(this, be) || b(this, fe) < b(this, Le);
|
|
539
539
|
}, jt = function() {
|
|
540
|
-
return
|
|
540
|
+
return b(this, ee) < b(this, xe);
|
|
541
541
|
}, Xt = function() {
|
|
542
|
-
Te(this,
|
|
542
|
+
Te(this, ee)._--, U(this, S, Pe).call(this), this.emit("next");
|
|
543
543
|
}, Zt = function() {
|
|
544
|
-
|
|
544
|
+
U(this, S, nt).call(this), U(this, S, rt).call(this), O(this, Ee, void 0);
|
|
545
545
|
}, Jt = function() {
|
|
546
546
|
const t = Date.now();
|
|
547
|
-
if (
|
|
548
|
-
const i =
|
|
547
|
+
if (b(this, J) === void 0) {
|
|
548
|
+
const i = b(this, Ae) - t;
|
|
549
549
|
if (i < 0)
|
|
550
|
-
O(this,
|
|
550
|
+
O(this, fe, b(this, _e) ? b(this, ee) : 0);
|
|
551
551
|
else
|
|
552
|
-
return
|
|
553
|
-
|
|
552
|
+
return b(this, Ee) === void 0 && O(this, Ee, setTimeout(() => {
|
|
553
|
+
U(this, S, Zt).call(this);
|
|
554
554
|
}, i)), !0;
|
|
555
555
|
}
|
|
556
556
|
return !1;
|
|
557
557
|
}, Pe = function() {
|
|
558
|
-
if (
|
|
559
|
-
return
|
|
560
|
-
if (!
|
|
561
|
-
const t = !
|
|
562
|
-
if (
|
|
563
|
-
const i =
|
|
564
|
-
return i ? (this.emit("active"), i(), t &&
|
|
558
|
+
if (b(this, W).size === 0)
|
|
559
|
+
return b(this, J) && clearInterval(b(this, J)), O(this, J, void 0), this.emit("empty"), b(this, ee) === 0 && this.emit("idle"), !1;
|
|
560
|
+
if (!b(this, de)) {
|
|
561
|
+
const t = !b(this, S, Jt);
|
|
562
|
+
if (b(this, S, Qt) && b(this, S, jt)) {
|
|
563
|
+
const i = b(this, W).dequeue();
|
|
564
|
+
return i ? (this.emit("active"), i(), t && U(this, S, rt).call(this), !0) : !1;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
return !1;
|
|
568
568
|
}, rt = function() {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
},
|
|
569
|
+
b(this, be) || b(this, J) !== void 0 || (O(this, J, setInterval(() => {
|
|
570
|
+
U(this, S, nt).call(this);
|
|
571
|
+
}, b(this, we))), O(this, Ae, Date.now() + b(this, we)));
|
|
572
572
|
}, nt = function() {
|
|
573
|
-
|
|
573
|
+
b(this, fe) === 0 && b(this, ee) === 0 && b(this, J) && (clearInterval(b(this, J)), O(this, J, void 0)), O(this, fe, b(this, _e) ? b(this, ee) : 0), U(this, S, $e).call(this);
|
|
574
574
|
}, /**
|
|
575
575
|
Executes all queued functions until it reaches the limit.
|
|
576
576
|
*/
|
|
577
577
|
$e = function() {
|
|
578
|
-
for (;
|
|
578
|
+
for (; U(this, S, Pe).call(this); )
|
|
579
579
|
;
|
|
580
580
|
}, ei = async function(t) {
|
|
581
581
|
return new Promise((i, s) => {
|
|
@@ -592,7 +592,7 @@ $e = function() {
|
|
|
592
592
|
});
|
|
593
593
|
};
|
|
594
594
|
const es = () => {
|
|
595
|
-
const u =
|
|
595
|
+
const u = ut(), e = Ce(pe);
|
|
596
596
|
if (!e)
|
|
597
597
|
return;
|
|
598
598
|
if (e.queryFnOverride) {
|
|
@@ -609,7 +609,7 @@ const es = () => {
|
|
|
609
609
|
queryFnOverride: !0,
|
|
610
610
|
queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
|
|
611
611
|
};
|
|
612
|
-
ai(
|
|
612
|
+
ai(pe, i);
|
|
613
613
|
};
|
|
614
614
|
function ts({
|
|
615
615
|
queryBridge: u,
|
|
@@ -617,78 +617,78 @@ function ts({
|
|
|
617
617
|
definition: t,
|
|
618
618
|
chartData: i
|
|
619
619
|
}) {
|
|
620
|
-
const s = I(""), r = I("");
|
|
620
|
+
const s = I(""), r = I(""), o = ut();
|
|
621
621
|
ot(async () => {
|
|
622
|
-
var
|
|
623
|
-
s.value = await ((
|
|
622
|
+
var x, _;
|
|
623
|
+
s.value = await ((x = u == null ? void 0 : u.exploreBaseUrl) == null ? void 0 : x.call(u)) ?? "", r.value = await ((_ = u == null ? void 0 : u.requestsBaseUrl) == null ? void 0 : _.call(u)) ?? "";
|
|
624
624
|
});
|
|
625
|
-
const o =
|
|
626
|
-
var
|
|
627
|
-
const
|
|
628
|
-
return
|
|
629
|
-
}),
|
|
630
|
-
if (!
|
|
625
|
+
const n = D(() => o.analytics && o.percentiles), h = D(() => !["golden_signals", "top_n", "gauge"].includes(t.value.chart.type)), l = D(() => r.value && t.value.query && t.value.query.datasource !== "llm_usage" && n.value), d = D(() => s.value && t.value.query && ["basic", "api_usage", "llm_usage", void 0].includes(t.value.query.datasource) && n.value), a = D(() => i.value ? st(i.value.meta.granularity_ms) : void 0), f = D(() => {
|
|
626
|
+
var F;
|
|
627
|
+
const x = [...e.value.filters, ...t.value.query.filters ?? []], _ = ((F = t.value.query) == null ? void 0 : F.datasource) ?? "api_usage";
|
|
628
|
+
return x.filter((te) => Ut(te.field).some((me) => _ === me));
|
|
629
|
+
}), p = D(() => {
|
|
630
|
+
if (!d.value || !h.value)
|
|
631
631
|
return "";
|
|
632
|
-
const
|
|
633
|
-
return
|
|
634
|
-
}),
|
|
635
|
-
if (!
|
|
632
|
+
const x = f.value, _ = t.value.query.time_range || e.value.timeSpec, F = L(_, x);
|
|
633
|
+
return z(F);
|
|
634
|
+
}), g = D(() => {
|
|
635
|
+
if (!l.value || !h.value)
|
|
636
636
|
return "";
|
|
637
|
-
const
|
|
637
|
+
const x = f.value, _ = m(
|
|
638
638
|
t.value.query.time_range || e.value.timeSpec,
|
|
639
|
-
|
|
639
|
+
x
|
|
640
640
|
);
|
|
641
|
-
return
|
|
642
|
-
}),
|
|
643
|
-
var
|
|
641
|
+
return y(_);
|
|
642
|
+
}), y = (x) => l.value ? `${r.value}?q=${JSON.stringify(x)}` : "", m = (x, _) => {
|
|
643
|
+
var F, te;
|
|
644
644
|
return {
|
|
645
|
-
filter:
|
|
645
|
+
filter: _,
|
|
646
646
|
timeframe: {
|
|
647
|
-
timePeriodsKey:
|
|
648
|
-
start:
|
|
649
|
-
end:
|
|
647
|
+
timePeriodsKey: x.type === "relative" ? x.time_range : "custom",
|
|
648
|
+
start: x.type === "absolute" ? (F = i.value) == null ? void 0 : F.meta.start_ms : void 0,
|
|
649
|
+
end: x.type === "absolute" ? (te = i.value) == null ? void 0 : te.meta.end_ms : void 0
|
|
650
650
|
}
|
|
651
651
|
};
|
|
652
|
-
},
|
|
653
|
-
filter:
|
|
652
|
+
}, T = (x, _) => ({
|
|
653
|
+
filter: _,
|
|
654
654
|
timeframe: {
|
|
655
|
-
timePeriodsKey:
|
|
656
|
-
start:
|
|
657
|
-
end:
|
|
655
|
+
timePeriodsKey: x.type === "relative" ? x.time_range : "custom",
|
|
656
|
+
start: x.type === "absolute" ? x.start : void 0,
|
|
657
|
+
end: x.type === "absolute" ? x.end : void 0
|
|
658
658
|
}
|
|
659
|
-
}),
|
|
660
|
-
const
|
|
659
|
+
}), L = (x, _) => {
|
|
660
|
+
const F = t.value.query.dimensions ?? [];
|
|
661
661
|
return {
|
|
662
|
-
filters:
|
|
662
|
+
filters: _,
|
|
663
663
|
metrics: t.value.query.metrics ?? [],
|
|
664
|
-
dimensions:
|
|
665
|
-
time_range:
|
|
666
|
-
granularity: t.value.query.granularity ||
|
|
664
|
+
dimensions: F,
|
|
665
|
+
time_range: x,
|
|
666
|
+
granularity: t.value.query.granularity || a.value
|
|
667
667
|
};
|
|
668
|
-
},
|
|
669
|
-
if (!
|
|
668
|
+
}, z = (x) => {
|
|
669
|
+
if (!d.value)
|
|
670
670
|
return "";
|
|
671
|
-
const
|
|
672
|
-
return `${s.value}?q=${JSON.stringify(
|
|
671
|
+
const _ = ["api_usage", "llm_usage"].includes(t.value.query.datasource) ? t.value.query.datasource : "api_usage";
|
|
672
|
+
return `${s.value}?q=${JSON.stringify(x)}&d=${_}&c=${t.value.chart.type}`;
|
|
673
673
|
};
|
|
674
674
|
return {
|
|
675
|
-
exploreLinkKebabMenu:
|
|
676
|
-
requestsLinkKebabMenu:
|
|
677
|
-
canShowKebabMenu:
|
|
678
|
-
canGenerateRequestsLink:
|
|
679
|
-
canGenerateExploreLink:
|
|
680
|
-
buildExploreQuery:
|
|
681
|
-
buildRequestsQueryZoomActions:
|
|
682
|
-
buildExploreLink:
|
|
683
|
-
buildRequestLink:
|
|
675
|
+
exploreLinkKebabMenu: p,
|
|
676
|
+
requestsLinkKebabMenu: g,
|
|
677
|
+
canShowKebabMenu: h,
|
|
678
|
+
canGenerateRequestsLink: l,
|
|
679
|
+
canGenerateExploreLink: d,
|
|
680
|
+
buildExploreQuery: L,
|
|
681
|
+
buildRequestsQueryZoomActions: T,
|
|
682
|
+
buildExploreLink: z,
|
|
683
|
+
buildRequestLink: y
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
const
|
|
686
|
+
const ye = {
|
|
687
687
|
useI18n: Pi,
|
|
688
688
|
useEvaluateFeatureFlag: Wi,
|
|
689
689
|
useRequestQueue: es,
|
|
690
690
|
useContextLinks: ts
|
|
691
|
-
},
|
|
691
|
+
}, ct = /* @__PURE__ */ j({
|
|
692
692
|
__name: "QueryDataProvider",
|
|
693
693
|
props: {
|
|
694
694
|
context: {},
|
|
@@ -698,53 +698,53 @@ const pe = {
|
|
|
698
698
|
},
|
|
699
699
|
emits: ["chart-data", "queryComplete"],
|
|
700
700
|
setup(u, { emit: e }) {
|
|
701
|
-
const t = u, i = e, { i18n: s } =
|
|
701
|
+
const t = u, i = e, { i18n: s } = ye.useI18n(), r = Ce(pe), o = () => t.queryReady && r ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, n = new AbortController();
|
|
702
702
|
at(() => {
|
|
703
703
|
n.abort();
|
|
704
704
|
});
|
|
705
|
-
const h = (T,
|
|
706
|
-
const
|
|
707
|
-
return
|
|
705
|
+
const h = (T, L, z) => {
|
|
706
|
+
const x = [];
|
|
707
|
+
return L && x.push(...L), x.push(...fi(T, z)), x;
|
|
708
708
|
}, { data: l, error: d, isValidating: a } = bi(o, async () => {
|
|
709
|
-
var T,
|
|
709
|
+
var T, L, z, x;
|
|
710
710
|
try {
|
|
711
711
|
let {
|
|
712
|
-
datasource:
|
|
713
|
-
...
|
|
712
|
+
datasource: _,
|
|
713
|
+
...F
|
|
714
714
|
} = t.query;
|
|
715
|
-
|
|
716
|
-
const
|
|
717
|
-
let
|
|
718
|
-
|
|
719
|
-
...
|
|
715
|
+
_ || (_ = "basic");
|
|
716
|
+
const te = h(_, t.query.filters, t.context.filters);
|
|
717
|
+
let ie = t.query.time_range;
|
|
718
|
+
ie ? ie.tz || (ie = {
|
|
719
|
+
...ie,
|
|
720
720
|
tz: t.context.tz
|
|
721
|
-
}) :
|
|
721
|
+
}) : ie = {
|
|
722
722
|
...t.context.timeSpec,
|
|
723
723
|
tz: t.context.tz
|
|
724
724
|
};
|
|
725
|
-
const
|
|
726
|
-
datasource:
|
|
725
|
+
const me = {
|
|
726
|
+
datasource: _,
|
|
727
727
|
query: {
|
|
728
|
-
...
|
|
729
|
-
time_range:
|
|
730
|
-
filters:
|
|
728
|
+
...F,
|
|
729
|
+
time_range: ie,
|
|
730
|
+
filters: te
|
|
731
731
|
}
|
|
732
|
-
}, Re = await (r == null ? void 0 : r.queryFn(
|
|
732
|
+
}, Re = await (r == null ? void 0 : r.queryFn(me, n));
|
|
733
733
|
return g.value = null, Re;
|
|
734
|
-
} catch (
|
|
735
|
-
throw (
|
|
734
|
+
} catch (_) {
|
|
735
|
+
throw (_ == null ? void 0 : _.status) === 403 ? g.value = {
|
|
736
736
|
message: s.t("queryDataProvider.forbidden"),
|
|
737
737
|
type: "forbidden"
|
|
738
|
-
} : (
|
|
738
|
+
} : (_ == null ? void 0 : _.status) === 408 ? g.value = {
|
|
739
739
|
message: s.t("queryDataProvider.timeout"),
|
|
740
740
|
type: "timeout"
|
|
741
|
-
} : ((
|
|
741
|
+
} : ((L = (T = _ == null ? void 0 : _.response) == null ? void 0 : T.data) == null ? void 0 : L.message) === "Range not allowed for this tier" ? g.value = {
|
|
742
742
|
message: s.t("queryDataProvider.timeRangeExceeded"),
|
|
743
743
|
type: "range_exceeded"
|
|
744
744
|
} : g.value = {
|
|
745
|
-
message: ((
|
|
745
|
+
message: ((x = (z = _ == null ? void 0 : _.response) == null ? void 0 : z.data) == null ? void 0 : x.message) || (_ == null ? void 0 : _.message),
|
|
746
746
|
type: "other"
|
|
747
|
-
},
|
|
747
|
+
}, _;
|
|
748
748
|
} finally {
|
|
749
749
|
i("queryComplete");
|
|
750
750
|
}
|
|
@@ -752,48 +752,48 @@ const pe = {
|
|
|
752
752
|
refreshInterval: t.context.refreshInterval,
|
|
753
753
|
revalidateOnFocus: !1,
|
|
754
754
|
shouldRetryOnError: !1
|
|
755
|
-
}), { state: f, swrvState: p } = Si(l, d, a), g = I(null), y =
|
|
755
|
+
}), { state: f, swrvState: p } = Si(l, d, a), g = I(null), y = D(() => f.value === p.ERROR || !!g.value), m = D(() => !t.queryReady || f.value === p.PENDING);
|
|
756
756
|
return lt(l, (T) => {
|
|
757
757
|
T && i("chart-data", T);
|
|
758
|
-
}), (T,
|
|
759
|
-
var
|
|
760
|
-
const
|
|
761
|
-
return m.value || !
|
|
758
|
+
}), (T, L) => {
|
|
759
|
+
var _;
|
|
760
|
+
const z = ge("KSkeleton"), x = ge("KEmptyState");
|
|
761
|
+
return m.value || !R(l) && !y.value ? (k(), M(z, {
|
|
762
762
|
key: 0,
|
|
763
763
|
class: "chart-skeleton",
|
|
764
764
|
type: "table"
|
|
765
|
-
})) : y.value && ((
|
|
765
|
+
})) : y.value && ((_ = g.value) == null ? void 0 : _.type) === "forbidden" ? (k(), M(x, {
|
|
766
766
|
key: 1,
|
|
767
767
|
"action-button-visible": !1,
|
|
768
768
|
"data-testid": "chart-forbidden-state"
|
|
769
769
|
}, {
|
|
770
770
|
default: P(() => [
|
|
771
|
-
De(
|
|
771
|
+
De(ne(g.value.message), 1)
|
|
772
772
|
]),
|
|
773
773
|
icon: P(() => [
|
|
774
|
-
|
|
774
|
+
ae(R(xi))
|
|
775
775
|
]),
|
|
776
776
|
_: 1
|
|
777
|
-
})) : y.value ? (
|
|
777
|
+
})) : y.value ? (k(), M(x, {
|
|
778
778
|
key: 2,
|
|
779
779
|
"action-button-visible": !1,
|
|
780
780
|
"data-testid": "chart-empty-state",
|
|
781
781
|
"icon-variant": "error"
|
|
782
782
|
}, {
|
|
783
783
|
default: P(() => {
|
|
784
|
-
var
|
|
784
|
+
var F;
|
|
785
785
|
return [
|
|
786
|
-
De(
|
|
786
|
+
De(ne((F = g.value) == null ? void 0 : F.message), 1)
|
|
787
787
|
];
|
|
788
788
|
}),
|
|
789
789
|
_: 1
|
|
790
|
-
})) :
|
|
790
|
+
})) : R(l) ? ze(T.$slots, "default", {
|
|
791
791
|
key: 3,
|
|
792
|
-
data:
|
|
793
|
-
}) :
|
|
792
|
+
data: R(l)
|
|
793
|
+
}) : V("", !0);
|
|
794
794
|
};
|
|
795
795
|
}
|
|
796
|
-
}), is = /* @__PURE__ */
|
|
796
|
+
}), is = /* @__PURE__ */ j({
|
|
797
797
|
__name: "SimpleChartRenderer",
|
|
798
798
|
props: {
|
|
799
799
|
query: {},
|
|
@@ -809,18 +809,18 @@ const pe = {
|
|
|
809
809
|
Ye((i) => ({
|
|
810
810
|
"088169ae": `${i.height}px`
|
|
811
811
|
}));
|
|
812
|
-
const e = u, t =
|
|
813
|
-
return (i, s) => (
|
|
812
|
+
const e = u, t = D(() => e.chartOptions.type === "single_value");
|
|
813
|
+
return (i, s) => (k(), M(ct, {
|
|
814
814
|
context: i.context,
|
|
815
815
|
query: i.query,
|
|
816
816
|
"query-ready": i.queryReady,
|
|
817
817
|
"refresh-counter": i.refreshCounter
|
|
818
818
|
}, {
|
|
819
819
|
default: P(({ data: r }) => [
|
|
820
|
-
|
|
820
|
+
ue("div", {
|
|
821
821
|
class: Qe(["analytics-chart", { "single-value": t.value }])
|
|
822
822
|
}, [
|
|
823
|
-
|
|
823
|
+
ae(R(pi), {
|
|
824
824
|
"chart-data": r,
|
|
825
825
|
"chart-options": i.chartOptions,
|
|
826
826
|
"synthetics-data-key": t.value ? void 0 : i.chartOptions.synthetics_data_key
|
|
@@ -830,12 +830,12 @@ const pe = {
|
|
|
830
830
|
_: 1
|
|
831
831
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
832
832
|
}
|
|
833
|
-
}),
|
|
833
|
+
}), ve = (u, e) => {
|
|
834
834
|
const t = u.__vccOpts || u;
|
|
835
835
|
for (const [i, s] of e)
|
|
836
836
|
t[i] = s;
|
|
837
837
|
return t;
|
|
838
|
-
},
|
|
838
|
+
}, Dt = /* @__PURE__ */ ve(is, [["__scopeId", "data-v-1e9ff912"]]), ss = { class: "analytics-chart" }, rs = /* @__PURE__ */ j({
|
|
839
839
|
__name: "BaseAnalyticsChartRenderer",
|
|
840
840
|
props: {
|
|
841
841
|
query: {},
|
|
@@ -850,19 +850,19 @@ const pe = {
|
|
|
850
850
|
},
|
|
851
851
|
emits: ["edit-tile", "chart-data", "zoom-time-range", "view-requests", "select-chart-range"],
|
|
852
852
|
setup(u, { emit: e }) {
|
|
853
|
-
const t = u, i = e, { i18n: s } =
|
|
853
|
+
const t = u, i = e, { i18n: s } = ye.useI18n(), { evaluateFeatureFlag: r } = ye.useEvaluateFeatureFlag(), o = r("ma-4135-allow-zooming-all-dashboard-tiles", !1), n = D(() => ({
|
|
854
854
|
type: t.chartOptions.type,
|
|
855
855
|
stacked: t.chartOptions.stacked ?? !1,
|
|
856
856
|
chartDatasetColors: t.chartOptions.chart_dataset_colors,
|
|
857
857
|
threshold: t.chartOptions.threshold
|
|
858
|
-
})), h =
|
|
858
|
+
})), h = D(() => o ? t.context.zoomable : t.context.zoomable && !t.query.time_range), l = () => {
|
|
859
859
|
i("edit-tile");
|
|
860
860
|
}, d = (a) => {
|
|
861
861
|
i("chart-data", a);
|
|
862
862
|
};
|
|
863
863
|
return (a, f) => {
|
|
864
|
-
const p =
|
|
865
|
-
return
|
|
864
|
+
const p = ge("KDropdownItem");
|
|
865
|
+
return k(), M(ct, {
|
|
866
866
|
context: a.context,
|
|
867
867
|
query: a.query,
|
|
868
868
|
"query-ready": a.queryReady,
|
|
@@ -870,8 +870,8 @@ const pe = {
|
|
|
870
870
|
onChartData: d
|
|
871
871
|
}, {
|
|
872
872
|
default: P(({ data: g }) => [
|
|
873
|
-
|
|
874
|
-
|
|
873
|
+
ue("div", ss, [
|
|
874
|
+
ae(R(yi), qt({
|
|
875
875
|
"chart-data": g,
|
|
876
876
|
"chart-options": n.value,
|
|
877
877
|
"explore-link": a.exploreLink,
|
|
@@ -887,9 +887,9 @@ const pe = {
|
|
|
887
887
|
a.context.editable ? {
|
|
888
888
|
name: "menu-items",
|
|
889
889
|
fn: P(() => [
|
|
890
|
-
|
|
890
|
+
ae(p, { onClick: l }, {
|
|
891
891
|
default: P(() => [
|
|
892
|
-
De(
|
|
892
|
+
De(ne(R(s).t("renderer.edit")), 1)
|
|
893
893
|
]),
|
|
894
894
|
_: 1
|
|
895
895
|
})
|
|
@@ -903,7 +903,7 @@ const pe = {
|
|
|
903
903
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
904
904
|
};
|
|
905
905
|
}
|
|
906
|
-
}),
|
|
906
|
+
}), ft = /* @__PURE__ */ ve(rs, [["__scopeId", "data-v-965790dd"]]), St = /* @__PURE__ */ j({
|
|
907
907
|
__name: "BarChartRenderer",
|
|
908
908
|
props: {
|
|
909
909
|
query: {},
|
|
@@ -916,7 +916,7 @@ const pe = {
|
|
|
916
916
|
exploreLink: {}
|
|
917
917
|
},
|
|
918
918
|
setup(u) {
|
|
919
|
-
return (e, t) => (
|
|
919
|
+
return (e, t) => (k(), M(ft, {
|
|
920
920
|
"chart-options": e.chartOptions,
|
|
921
921
|
context: e.context,
|
|
922
922
|
"extra-props": { showAnnotations: !1 },
|
|
@@ -926,7 +926,7 @@ const pe = {
|
|
|
926
926
|
"refresh-counter": e.refreshCounter
|
|
927
927
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
928
928
|
}
|
|
929
|
-
}),
|
|
929
|
+
}), Nt = /* @__PURE__ */ j({
|
|
930
930
|
__name: "TimeseriesChartRenderer",
|
|
931
931
|
props: {
|
|
932
932
|
query: {},
|
|
@@ -941,7 +941,7 @@ const pe = {
|
|
|
941
941
|
emits: ["zoom-time-range", "select-chart-range"],
|
|
942
942
|
setup(u, { emit: e }) {
|
|
943
943
|
const t = e;
|
|
944
|
-
return (i, s) => (
|
|
944
|
+
return (i, s) => (k(), M(ft, {
|
|
945
945
|
"chart-options": i.chartOptions,
|
|
946
946
|
context: i.context,
|
|
947
947
|
"explore-link": i.exploreLink,
|
|
@@ -954,7 +954,7 @@ const pe = {
|
|
|
954
954
|
onZoomTimeRange: s[1] || (s[1] = (r) => t("zoom-time-range", r))
|
|
955
955
|
}, null, 8, ["chart-options", "context", "explore-link", "height", "query", "query-ready", "refresh-counter", "requests-link"]));
|
|
956
956
|
}
|
|
957
|
-
}), ns = { class: "metric-card-tile-wrapper" }, os = /* @__PURE__ */
|
|
957
|
+
}), ns = { class: "metric-card-tile-wrapper" }, os = /* @__PURE__ */ j({
|
|
958
958
|
__name: "GoldenSignalsRenderer",
|
|
959
959
|
props: {
|
|
960
960
|
query: {},
|
|
@@ -967,7 +967,7 @@ const pe = {
|
|
|
967
967
|
exploreLink: {}
|
|
968
968
|
},
|
|
969
969
|
setup(u) {
|
|
970
|
-
const e = u, t =
|
|
970
|
+
const e = u, t = D(() => {
|
|
971
971
|
const s = e.context.timeSpec;
|
|
972
972
|
if (s.type === "absolute")
|
|
973
973
|
return new gi({
|
|
@@ -982,11 +982,11 @@ const pe = {
|
|
|
982
982
|
isRelative: !1,
|
|
983
983
|
allowedTiers: ["free", "plus", "enterprise"]
|
|
984
984
|
});
|
|
985
|
-
const r =
|
|
985
|
+
const r = Bt.get(s.time_range);
|
|
986
986
|
if (!r)
|
|
987
987
|
throw new Error("Unknown time range");
|
|
988
988
|
return r;
|
|
989
|
-
}), i =
|
|
989
|
+
}), i = D(() => {
|
|
990
990
|
var r, o;
|
|
991
991
|
const s = (r = e.query) == null ? void 0 : r.datasource;
|
|
992
992
|
if (s && s !== "api_usage" && s !== "basic")
|
|
@@ -1004,27 +1004,27 @@ const pe = {
|
|
|
1004
1004
|
refreshCounter: e.refreshCounter
|
|
1005
1005
|
};
|
|
1006
1006
|
});
|
|
1007
|
-
return (s, r) => (
|
|
1008
|
-
|
|
1007
|
+
return (s, r) => (k(), K("div", ns, [
|
|
1008
|
+
ae(R(Ti), li(hi(i.value)), {
|
|
1009
1009
|
default: P(() => [
|
|
1010
|
-
|
|
1010
|
+
ae(R(zi))
|
|
1011
1011
|
]),
|
|
1012
1012
|
_: 1
|
|
1013
1013
|
}, 16)
|
|
1014
1014
|
]));
|
|
1015
1015
|
}
|
|
1016
|
-
}), as = /* @__PURE__ */
|
|
1016
|
+
}), as = /* @__PURE__ */ ve(os, [["__scopeId", "data-v-7e1b1cc1"]]), Lt = "#6c7489", ls = "12px", At = "20px", ti = "20px", hs = {
|
|
1017
1017
|
class: "fallback-entity-link",
|
|
1018
1018
|
"data-testid": "entity-link-parent"
|
|
1019
|
-
},
|
|
1019
|
+
}, Ht = /* @__PURE__ */ j({
|
|
1020
1020
|
__name: "FallbackEntityLink",
|
|
1021
1021
|
props: {
|
|
1022
1022
|
entityLinkData: {}
|
|
1023
1023
|
},
|
|
1024
1024
|
setup(u) {
|
|
1025
|
-
return (e, t) => (
|
|
1025
|
+
return (e, t) => (k(), K("div", hs, ne(e.entityLinkData.label), 1));
|
|
1026
1026
|
}
|
|
1027
|
-
}), ds = /* @__PURE__ */
|
|
1027
|
+
}), ds = /* @__PURE__ */ j({
|
|
1028
1028
|
__name: "TopNTableRenderer",
|
|
1029
1029
|
props: {
|
|
1030
1030
|
query: {},
|
|
@@ -1037,39 +1037,39 @@ const pe = {
|
|
|
1037
1037
|
exploreLink: {}
|
|
1038
1038
|
},
|
|
1039
1039
|
setup(u) {
|
|
1040
|
-
const e = u, t =
|
|
1040
|
+
const e = u, t = Ce(pe), i = Pt(async () => {
|
|
1041
1041
|
if (t != null && t.fetchComponent)
|
|
1042
1042
|
try {
|
|
1043
1043
|
return await t.fetchComponent("EntityLink");
|
|
1044
1044
|
} catch {
|
|
1045
|
-
return
|
|
1045
|
+
return Ht;
|
|
1046
1046
|
}
|
|
1047
|
-
return
|
|
1047
|
+
return Ht;
|
|
1048
1048
|
}), s = (r) => {
|
|
1049
1049
|
var o;
|
|
1050
1050
|
if ((o = e.chartOptions) != null && o.entity_link)
|
|
1051
1051
|
if (r.id.includes(":")) {
|
|
1052
1052
|
const [n, h] = r.id.split(":");
|
|
1053
|
-
return e.chartOptions.entity_link.replace($i, n).replace(
|
|
1053
|
+
return e.chartOptions.entity_link.replace($i, n).replace(kt, h);
|
|
1054
1054
|
} else
|
|
1055
|
-
return e.chartOptions.entity_link.replace(
|
|
1055
|
+
return e.chartOptions.entity_link.replace(kt, r.id);
|
|
1056
1056
|
return "";
|
|
1057
1057
|
};
|
|
1058
|
-
return (r, o) => (
|
|
1058
|
+
return (r, o) => (k(), M(ct, {
|
|
1059
1059
|
context: r.context,
|
|
1060
1060
|
query: r.query,
|
|
1061
1061
|
"query-ready": r.queryReady,
|
|
1062
1062
|
"refresh-counter": r.refreshCounter
|
|
1063
1063
|
}, {
|
|
1064
1064
|
default: P(({ data: n }) => [
|
|
1065
|
-
|
|
1065
|
+
ae(R(vi), {
|
|
1066
1066
|
data: n,
|
|
1067
1067
|
"synthetics-data-key": r.chartOptions.synthetics_data_key
|
|
1068
1068
|
}, ht({ _: 2 }, [
|
|
1069
1069
|
e.chartOptions.entity_link ? {
|
|
1070
1070
|
name: "name",
|
|
1071
1071
|
fn: P(({ record: h }) => [
|
|
1072
|
-
|
|
1072
|
+
ae(R(i), {
|
|
1073
1073
|
"entity-link-data": {
|
|
1074
1074
|
id: h.id,
|
|
1075
1075
|
label: h.name,
|
|
@@ -1085,7 +1085,7 @@ const pe = {
|
|
|
1085
1085
|
_: 1
|
|
1086
1086
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
1087
1087
|
}
|
|
1088
|
-
}), us = /* @__PURE__ */
|
|
1088
|
+
}), us = /* @__PURE__ */ j({
|
|
1089
1089
|
__name: "DonutChartRenderer",
|
|
1090
1090
|
props: {
|
|
1091
1091
|
query: {},
|
|
@@ -1098,7 +1098,7 @@ const pe = {
|
|
|
1098
1098
|
exploreLink: {}
|
|
1099
1099
|
},
|
|
1100
1100
|
setup(u) {
|
|
1101
|
-
return (e, t) => (
|
|
1101
|
+
return (e, t) => (k(), M(ft, {
|
|
1102
1102
|
"chart-options": e.chartOptions,
|
|
1103
1103
|
context: e.context,
|
|
1104
1104
|
height: e.height,
|
|
@@ -1110,7 +1110,7 @@ const pe = {
|
|
|
1110
1110
|
}), cs = ["data-testid"], fs = {
|
|
1111
1111
|
key: 0,
|
|
1112
1112
|
class: "tile-header"
|
|
1113
|
-
}, gs = ["data-testid"], ms = { class: "badge-text" }, ps = ["data-testid"], ys = { class: "delete-option" }, vs = ["data-testid"], _s = ["data-testid"], bs = /* @__PURE__ */
|
|
1113
|
+
}, gs = ["data-testid"], ms = { class: "badge-text" }, ps = ["data-testid"], ys = { class: "delete-option" }, vs = ["data-testid"], _s = ["data-testid"], bs = /* @__PURE__ */ j({
|
|
1114
1114
|
__name: "DashboardTile",
|
|
1115
1115
|
props: {
|
|
1116
1116
|
definition: {},
|
|
@@ -1126,46 +1126,46 @@ const pe = {
|
|
|
1126
1126
|
Ye((v) => ({
|
|
1127
1127
|
"35c8e872": `${v.height}px`
|
|
1128
1128
|
}));
|
|
1129
|
-
const t = parseInt(ti, 10), i = u, s = e, r =
|
|
1129
|
+
const t = parseInt(ti, 10), i = u, s = e, r = Pt(() => import("./GeoMapRenderer-DYILqlnm.js")), o = Ce(pe), n = o == null ? void 0 : o.evaluateFeatureFlagFn("analytics-chart-zoom-actions", !1), { i18n: h } = ye.useI18n(), l = I(), d = I(!1), a = I(), f = I(!1), p = I(void 0), g = I(void 0), y = I(!0), {
|
|
1130
1130
|
exploreLinkKebabMenu: m,
|
|
1131
1131
|
requestsLinkKebabMenu: T,
|
|
1132
|
-
canShowKebabMenu:
|
|
1133
|
-
canGenerateRequestsLink:
|
|
1134
|
-
canGenerateExploreLink:
|
|
1135
|
-
buildExploreQuery:
|
|
1136
|
-
buildExploreLink:
|
|
1137
|
-
buildRequestLink:
|
|
1138
|
-
buildRequestsQueryZoomActions:
|
|
1139
|
-
} =
|
|
1132
|
+
canShowKebabMenu: L,
|
|
1133
|
+
canGenerateRequestsLink: z,
|
|
1134
|
+
canGenerateExploreLink: x,
|
|
1135
|
+
buildExploreQuery: _,
|
|
1136
|
+
buildExploreLink: F,
|
|
1137
|
+
buildRequestLink: te,
|
|
1138
|
+
buildRequestsQueryZoomActions: ie
|
|
1139
|
+
} = ye.useContextLinks({
|
|
1140
1140
|
queryBridge: o,
|
|
1141
1141
|
chartData: it(l),
|
|
1142
|
-
definition: it(
|
|
1143
|
-
context: it(
|
|
1142
|
+
definition: it(Et(i, "definition")),
|
|
1143
|
+
context: it(Et(i, "context"))
|
|
1144
1144
|
});
|
|
1145
1145
|
lt(() => i.definition, async () => {
|
|
1146
1146
|
await dt(), a.value && (f.value = a.value.scrollWidth > a.value.clientWidth), y.value = !0;
|
|
1147
1147
|
}, { immediate: !0, deep: !0 });
|
|
1148
|
-
const
|
|
1149
|
-
timeseries_line:
|
|
1150
|
-
timeseries_bar:
|
|
1151
|
-
horizontal_bar:
|
|
1152
|
-
vertical_bar:
|
|
1153
|
-
gauge:
|
|
1148
|
+
const me = D(() => h.t("csvExport.defaultFilename")), Re = D(() => L.value && (se.value || i.context.editable) || !!A.value), se = D(() => !!m.value || ("allow_csv_export" in i.definition.chart ? i.definition.chart.allow_csv_export : !0) || i.context.editable), Ze = {
|
|
1149
|
+
timeseries_line: Nt,
|
|
1150
|
+
timeseries_bar: Nt,
|
|
1151
|
+
horizontal_bar: St,
|
|
1152
|
+
vertical_bar: St,
|
|
1153
|
+
gauge: Dt,
|
|
1154
1154
|
donut: us,
|
|
1155
1155
|
golden_signals: as,
|
|
1156
1156
|
top_n: ds,
|
|
1157
1157
|
slottable: void 0,
|
|
1158
|
-
single_value:
|
|
1158
|
+
single_value: Dt,
|
|
1159
1159
|
choropleth_map: r
|
|
1160
|
-
},
|
|
1160
|
+
}, C = D(() => {
|
|
1161
1161
|
var v, H;
|
|
1162
1162
|
return {
|
|
1163
|
-
...(v =
|
|
1164
|
-
...(H =
|
|
1163
|
+
...(v = N.value) != null && v.rendererEvents.supportsRequests ? { "select-chart-range": ri } : {},
|
|
1164
|
+
...(H = N.value) != null && H.rendererEvents.supportsZoom ? { "zoom-time-range": si } : {}
|
|
1165
1165
|
};
|
|
1166
|
-
}),
|
|
1167
|
-
var
|
|
1168
|
-
const v = Ze[i.definition.chart.type], H = !!((
|
|
1166
|
+
}), N = D(() => {
|
|
1167
|
+
var X, Y;
|
|
1168
|
+
const v = Ze[i.definition.chart.type], H = !!((X = v == null ? void 0 : v.emits) != null && X.includes("select-chart-range")), q = !!((Y = v == null ? void 0 : v.emits) != null && Y.includes("zoom-time-range"));
|
|
1169
1169
|
return v && {
|
|
1170
1170
|
component: v,
|
|
1171
1171
|
rendererProps: {
|
|
@@ -1183,45 +1183,45 @@ const pe = {
|
|
|
1183
1183
|
supportsZoom: q
|
|
1184
1184
|
}
|
|
1185
1185
|
};
|
|
1186
|
-
}), A =
|
|
1186
|
+
}), A = D(() => {
|
|
1187
1187
|
var H;
|
|
1188
1188
|
const v = (H = i.definition.query) == null ? void 0 : H.time_range;
|
|
1189
1189
|
if ((v == null ? void 0 : v.type) === "relative") {
|
|
1190
|
-
const q =
|
|
1190
|
+
const q = Bt.get(mi[v.time_range]);
|
|
1191
1191
|
return q ? q.display : (console.warn("Did not recognize the given relative time range:", v.time_range), v.time_range);
|
|
1192
1192
|
} else if ((v == null ? void 0 : v.type) === "absolute") {
|
|
1193
1193
|
const q = v.tz || "Etc/UTC";
|
|
1194
|
-
return `${
|
|
1194
|
+
return `${Rt(v.start, { short: !0, tz: q })} - ${Rt(v.end, { short: !0, tz: q })}`;
|
|
1195
1195
|
}
|
|
1196
1196
|
return null;
|
|
1197
|
-
}), $ =
|
|
1197
|
+
}), $ = D(() => l.value ? st(l.value.meta.granularity_ms) : void 0), re = D(() => ["timeseries_line", "timeseries_bar"].includes(i.definition.chart.type)), ce = D(() => {
|
|
1198
1198
|
var H, q;
|
|
1199
|
-
if (!
|
|
1199
|
+
if (!re.value || !i.queryReady || y.value)
|
|
1200
1200
|
return !1;
|
|
1201
1201
|
const v = (q = (H = i.definition) == null ? void 0 : H.query) == null ? void 0 : q.granularity;
|
|
1202
1202
|
return !v || !$.value ? !1 : v !== $.value;
|
|
1203
|
-
}), Me =
|
|
1204
|
-
var q,
|
|
1205
|
-
const v = st(((q = l.value) == null ? void 0 : q.meta.granularity_ms) ?? 0) ?? "unknown", H = ((
|
|
1203
|
+
}), Me = D(() => {
|
|
1204
|
+
var q, X, Y;
|
|
1205
|
+
const v = st(((q = l.value) == null ? void 0 : q.meta.granularity_ms) ?? 0) ?? "unknown", H = ((Y = (X = i.definition) == null ? void 0 : X.query) == null ? void 0 : Y.granularity) ?? "unknown";
|
|
1206
1206
|
return h.t("query_aged_out_warning", {
|
|
1207
1207
|
currentGranularity: h.t(`granularities.${v}`),
|
|
1208
1208
|
savedGranularity: h.t(`granularities.${H}`)
|
|
1209
1209
|
});
|
|
1210
|
-
}), Ie =
|
|
1211
|
-
var q,
|
|
1212
|
-
const v = [...i.context.filters, ...i.definition.query.filters ?? []], H = ((
|
|
1213
|
-
return v.filter((
|
|
1210
|
+
}), Ie = D(() => {
|
|
1211
|
+
var q, X;
|
|
1212
|
+
const v = [...i.context.filters, ...i.definition.query.filters ?? []], H = ((X = (q = i.definition) == null ? void 0 : q.query) == null ? void 0 : X.datasource) ?? "api_usage";
|
|
1213
|
+
return v.filter((Y) => Ut(Y.field).some((_t) => H === _t));
|
|
1214
1214
|
}), ke = () => {
|
|
1215
1215
|
s("edit-tile", i.definition);
|
|
1216
1216
|
}, Je = () => {
|
|
1217
1217
|
s("duplicate-tile", i.definition);
|
|
1218
|
-
},
|
|
1218
|
+
}, pt = () => {
|
|
1219
1219
|
s("remove-tile", i.definition);
|
|
1220
1220
|
}, et = (v) => {
|
|
1221
1221
|
l.value = v, y.value = !1;
|
|
1222
1222
|
}, qe = (v) => {
|
|
1223
1223
|
d.value = v;
|
|
1224
|
-
},
|
|
1224
|
+
}, yt = () => {
|
|
1225
1225
|
qe(!0);
|
|
1226
1226
|
}, si = (v) => {
|
|
1227
1227
|
const H = {
|
|
@@ -1230,148 +1230,148 @@ const pe = {
|
|
|
1230
1230
|
};
|
|
1231
1231
|
s("tile-time-range-zoom", H);
|
|
1232
1232
|
}, ri = (v) => {
|
|
1233
|
-
const H = Ie.value, q =
|
|
1234
|
-
p.value =
|
|
1233
|
+
const H = Ie.value, q = ie(v, H), X = _(v, H);
|
|
1234
|
+
p.value = z.value ? { href: te(q) } : void 0, g.value = x.value ? { href: F(X) } : void 0;
|
|
1235
1235
|
};
|
|
1236
1236
|
return (v, H) => {
|
|
1237
|
-
const q =
|
|
1238
|
-
return
|
|
1237
|
+
const q = ge("KTooltip"), X = ge("KBadge"), Y = ge("KDropdownItem"), vt = ge("KDropdown");
|
|
1238
|
+
return k(), K("div", {
|
|
1239
1239
|
class: Qe(["tile-boundary", { editable: v.context.editable }]),
|
|
1240
1240
|
"data-testid": `tile-${v.tileId}`
|
|
1241
1241
|
}, [
|
|
1242
|
-
v.definition.chart.type !== "slottable" ? (
|
|
1243
|
-
|
|
1242
|
+
v.definition.chart.type !== "slottable" ? (k(), K("div", fs, [
|
|
1243
|
+
ae(q, {
|
|
1244
1244
|
class: "title-tooltip",
|
|
1245
1245
|
disabled: !f.value,
|
|
1246
1246
|
"max-width": "500",
|
|
1247
1247
|
text: v.definition.chart.chart_title
|
|
1248
1248
|
}, {
|
|
1249
1249
|
default: P(() => [
|
|
1250
|
-
|
|
1250
|
+
ue("div", {
|
|
1251
1251
|
ref_key: "titleRef",
|
|
1252
1252
|
ref: a,
|
|
1253
1253
|
class: "title"
|
|
1254
|
-
},
|
|
1254
|
+
}, ne(v.definition.chart.chart_title), 513)
|
|
1255
1255
|
]),
|
|
1256
1256
|
_: 1
|
|
1257
1257
|
}, 8, ["disabled", "text"]),
|
|
1258
|
-
Re.value ? (
|
|
1258
|
+
Re.value ? (k(), K("div", {
|
|
1259
1259
|
key: 0,
|
|
1260
1260
|
class: "tile-actions",
|
|
1261
1261
|
"data-testid": `tile-actions-${v.tileId}`
|
|
1262
1262
|
}, [
|
|
1263
|
-
A.value ? (
|
|
1263
|
+
A.value ? (k(), M(X, {
|
|
1264
1264
|
key: 0,
|
|
1265
1265
|
"data-testid": "time-range-badge",
|
|
1266
|
-
tooltip:
|
|
1266
|
+
tooltip: ce.value ? Me.value : void 0,
|
|
1267
1267
|
"tooltip-attributes": { maxWidth: "320px" }
|
|
1268
1268
|
}, ht({
|
|
1269
1269
|
default: P(() => [
|
|
1270
|
-
|
|
1270
|
+
ue("span", ms, ne(A.value), 1)
|
|
1271
1271
|
]),
|
|
1272
1272
|
_: 2
|
|
1273
1273
|
}, [
|
|
1274
|
-
|
|
1274
|
+
ce.value ? {
|
|
1275
1275
|
name: "icon",
|
|
1276
1276
|
fn: P(() => [
|
|
1277
|
-
|
|
1277
|
+
ae(R(Ci), { size: R(ls) }, null, 8, ["size"])
|
|
1278
1278
|
]),
|
|
1279
1279
|
key: "0"
|
|
1280
1280
|
} : void 0
|
|
1281
|
-
]), 1032, ["tooltip"])) :
|
|
1282
|
-
|
|
1281
|
+
]), 1032, ["tooltip"])) : V("", !0),
|
|
1282
|
+
R(L) && v.context.editable && !v.isFullscreen ? (k(), M(R(Ri), {
|
|
1283
1283
|
key: 1,
|
|
1284
1284
|
class: "edit-icon",
|
|
1285
|
-
color:
|
|
1285
|
+
color: R(Lt),
|
|
1286
1286
|
"data-testid": `edit-tile-${v.tileId}`,
|
|
1287
|
-
size:
|
|
1287
|
+
size: R(At),
|
|
1288
1288
|
onClick: ke
|
|
1289
|
-
}, null, 8, ["color", "data-testid", "size"])) :
|
|
1290
|
-
|
|
1289
|
+
}, null, 8, ["color", "data-testid", "size"])) : V("", !0),
|
|
1290
|
+
R(L) && se.value && !v.isFullscreen ? (k(), M(vt, {
|
|
1291
1291
|
key: 2,
|
|
1292
1292
|
class: "dropdown",
|
|
1293
1293
|
"data-testid": `chart-action-menu-${v.tileId}`,
|
|
1294
1294
|
"kpop-attributes": { placement: "bottom-end" }
|
|
1295
1295
|
}, {
|
|
1296
1296
|
items: P(() => [
|
|
1297
|
-
|
|
1297
|
+
R(m) ? (k(), M(Y, {
|
|
1298
1298
|
key: 0,
|
|
1299
1299
|
"data-testid": `chart-jump-to-explore-${v.tileId}`,
|
|
1300
|
-
item: { label:
|
|
1301
|
-
}, null, 8, ["data-testid", "item"])) :
|
|
1302
|
-
|
|
1300
|
+
item: { label: R(h).t("jumpToExplore"), to: R(m) }
|
|
1301
|
+
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1302
|
+
R(n) && R(T) ? (k(), M(Y, {
|
|
1303
1303
|
key: 1,
|
|
1304
1304
|
"data-testid": `chart-jump-to-requests-${v.tileId}`,
|
|
1305
|
-
item: { label:
|
|
1306
|
-
}, null, 8, ["data-testid", "item"])) :
|
|
1307
|
-
!("allow_csv_export" in v.definition.chart) || v.definition.chart.allow_csv_export ? (
|
|
1305
|
+
item: { label: R(h).t("jumpToRequests"), to: R(T) }
|
|
1306
|
+
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1307
|
+
!("allow_csv_export" in v.definition.chart) || v.definition.chart.allow_csv_export ? (k(), M(Y, {
|
|
1308
1308
|
key: 2,
|
|
1309
1309
|
class: "chart-export-button",
|
|
1310
1310
|
"data-testid": `chart-csv-export-${v.tileId}`,
|
|
1311
|
-
onClick: H[0] || (H[0] = (
|
|
1311
|
+
onClick: H[0] || (H[0] = (_t) => yt())
|
|
1312
1312
|
}, {
|
|
1313
1313
|
default: P(() => [
|
|
1314
|
-
|
|
1314
|
+
ue("span", {
|
|
1315
1315
|
class: "chart-export-trigger",
|
|
1316
1316
|
"data-testid": `csv-export-button-${v.tileId}`
|
|
1317
|
-
},
|
|
1317
|
+
}, ne(R(h).t("csvExport.exportAsCsv")), 9, ps)
|
|
1318
1318
|
]),
|
|
1319
1319
|
_: 1
|
|
1320
|
-
}, 8, ["data-testid"])) :
|
|
1321
|
-
v.context.editable ? (
|
|
1320
|
+
}, 8, ["data-testid"])) : V("", !0),
|
|
1321
|
+
v.context.editable ? (k(), M(Y, {
|
|
1322
1322
|
key: 3,
|
|
1323
1323
|
"data-testid": `duplicate-tile-${v.tileId}`,
|
|
1324
1324
|
onClick: Je
|
|
1325
1325
|
}, {
|
|
1326
1326
|
default: P(() => [
|
|
1327
|
-
De(
|
|
1327
|
+
De(ne(R(h).t("renderer.duplicateTile")), 1)
|
|
1328
1328
|
]),
|
|
1329
1329
|
_: 1
|
|
1330
|
-
}, 8, ["data-testid"])) :
|
|
1331
|
-
v.context.editable ? (
|
|
1330
|
+
}, 8, ["data-testid"])) : V("", !0),
|
|
1331
|
+
v.context.editable ? (k(), M(Y, {
|
|
1332
1332
|
key: 4,
|
|
1333
1333
|
"data-testid": `remove-tile-${v.tileId}`,
|
|
1334
|
-
onClick:
|
|
1334
|
+
onClick: pt
|
|
1335
1335
|
}, {
|
|
1336
1336
|
default: P(() => [
|
|
1337
|
-
|
|
1337
|
+
ue("span", ys, ne(R(h).t("renderer.delete")), 1)
|
|
1338
1338
|
]),
|
|
1339
1339
|
_: 1
|
|
1340
|
-
}, 8, ["data-testid"])) :
|
|
1340
|
+
}, 8, ["data-testid"])) : V("", !0)
|
|
1341
1341
|
]),
|
|
1342
1342
|
default: P(() => [
|
|
1343
|
-
|
|
1343
|
+
ae(R(ki), {
|
|
1344
1344
|
class: "kebab-action-menu",
|
|
1345
|
-
color:
|
|
1345
|
+
color: R(Lt),
|
|
1346
1346
|
"data-testid": `kebab-action-menu-${v.tileId}`,
|
|
1347
|
-
size:
|
|
1347
|
+
size: R(At)
|
|
1348
1348
|
}, null, 8, ["color", "data-testid", "size"])
|
|
1349
1349
|
]),
|
|
1350
1350
|
_: 1
|
|
1351
|
-
}, 8, ["data-testid"])) :
|
|
1352
|
-
], 8, gs)) : "description" in v.definition.chart ? (
|
|
1351
|
+
}, 8, ["data-testid"])) : V("", !0)
|
|
1352
|
+
], 8, gs)) : "description" in v.definition.chart ? (k(), K("div", {
|
|
1353
1353
|
key: 1,
|
|
1354
1354
|
class: "header-description",
|
|
1355
1355
|
"data-testid": `tile-description-${v.tileId}`
|
|
1356
|
-
},
|
|
1357
|
-
d.value ? (
|
|
1356
|
+
}, ne(v.definition.chart.description), 9, vs)) : V("", !0),
|
|
1357
|
+
d.value ? (k(), M(R(_i), {
|
|
1358
1358
|
key: 2,
|
|
1359
1359
|
"chart-data": l.value,
|
|
1360
1360
|
"data-testid": `csv-export-modal-${v.tileId}`,
|
|
1361
|
-
filename:
|
|
1361
|
+
filename: me.value,
|
|
1362
1362
|
onToggleModal: qe
|
|
1363
|
-
}, null, 8, ["chart-data", "data-testid", "filename"])) :
|
|
1364
|
-
])) :
|
|
1365
|
-
|
|
1363
|
+
}, null, 8, ["chart-data", "data-testid", "filename"])) : V("", !0)
|
|
1364
|
+
])) : V("", !0),
|
|
1365
|
+
ue("div", {
|
|
1366
1366
|
class: "tile-content",
|
|
1367
1367
|
"data-testid": `tile-content-${v.tileId}`
|
|
1368
1368
|
}, [
|
|
1369
|
-
|
|
1369
|
+
N.value ? (k(), M($t(N.value.component), qt({ key: 0 }, N.value.rendererProps, di(C.value), { onChartData: et }), null, 16)) : V("", !0)
|
|
1370
1370
|
], 8, _s)
|
|
1371
1371
|
], 10, cs);
|
|
1372
1372
|
};
|
|
1373
1373
|
}
|
|
1374
|
-
}), ws = /* @__PURE__ */
|
|
1374
|
+
}), ws = /* @__PURE__ */ ve(bs, [["__scopeId", "data-v-c9bc38c8"]]), Es = (u, e) => {
|
|
1375
1375
|
let t = 0;
|
|
1376
1376
|
const i = /* @__PURE__ */ new Map();
|
|
1377
1377
|
e.forEach((r) => {
|
|
@@ -1382,7 +1382,7 @@ const pe = {
|
|
|
1382
1382
|
for (let r = 0; r < t; r++)
|
|
1383
1383
|
i.get(r) ? s.push("auto") : s.push(`${u}px`);
|
|
1384
1384
|
return s;
|
|
1385
|
-
}, xs = /* @__PURE__ */
|
|
1385
|
+
}, xs = /* @__PURE__ */ j({
|
|
1386
1386
|
__name: "GridLayout",
|
|
1387
1387
|
props: {
|
|
1388
1388
|
tileHeight: {
|
|
@@ -1397,7 +1397,7 @@ const pe = {
|
|
|
1397
1397
|
},
|
|
1398
1398
|
setup(u) {
|
|
1399
1399
|
Ye((n) => ({
|
|
1400
|
-
"2a38e79e":
|
|
1400
|
+
"2a38e79e": R(Kt),
|
|
1401
1401
|
"4cc71de6": r.value
|
|
1402
1402
|
}));
|
|
1403
1403
|
const e = u, t = I(null), i = I(0), s = new ResizeObserver((n) => {
|
|
@@ -1410,7 +1410,7 @@ const pe = {
|
|
|
1410
1410
|
}), at(() => {
|
|
1411
1411
|
t.value && s.unobserve(t.value);
|
|
1412
1412
|
});
|
|
1413
|
-
const r =
|
|
1413
|
+
const r = D(() => Es(e.tileHeight, e.tiles).join(" ")), o = D(() => e.tiles.map((n, h) => ({
|
|
1414
1414
|
key: `tile-${h}`,
|
|
1415
1415
|
tile: n,
|
|
1416
1416
|
style: {
|
|
@@ -1420,26 +1420,26 @@ const pe = {
|
|
|
1420
1420
|
"grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
|
|
1421
1421
|
}
|
|
1422
1422
|
})));
|
|
1423
|
-
return (n, h) => (
|
|
1423
|
+
return (n, h) => (k(), K("div", {
|
|
1424
1424
|
ref_key: "gridContainer",
|
|
1425
1425
|
ref: t,
|
|
1426
1426
|
class: "kong-ui-public-grid-layout"
|
|
1427
1427
|
}, [
|
|
1428
|
-
(
|
|
1428
|
+
(k(!0), K(Ft, null, Gt(o.value, (l) => (k(), K("div", {
|
|
1429
1429
|
key: l.key,
|
|
1430
1430
|
class: Qe(["grid-cell", {
|
|
1431
1431
|
"empty-cell": !l.tile
|
|
1432
1432
|
}]),
|
|
1433
|
-
style:
|
|
1433
|
+
style: xt(l.style)
|
|
1434
1434
|
}, [
|
|
1435
1435
|
ze(n.$slots, "tile", {
|
|
1436
|
-
style:
|
|
1436
|
+
style: xt(l.style),
|
|
1437
1437
|
tile: l.tile
|
|
1438
1438
|
}, void 0, !0)
|
|
1439
1439
|
], 6))), 128))
|
|
1440
1440
|
], 512));
|
|
1441
1441
|
}
|
|
1442
|
-
}), Cs = /* @__PURE__ */
|
|
1442
|
+
}), Cs = /* @__PURE__ */ ve(xs, [["__scopeId", "data-v-354b7177"]]);
|
|
1443
1443
|
function Rs(u, e, t, i, s) {
|
|
1444
1444
|
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));
|
|
1445
1445
|
return r.prototype = e.prototype, r;
|
|
@@ -1780,7 +1780,7 @@ class c {
|
|
|
1780
1780
|
return !(!e || e.w === e.h || e.locked || e.noResize || (t = e.grid) != null && t.opts.disableResize || e.minW && e.minW === e.maxW || e.minH && e.minH === e.maxH);
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
1783
|
-
class
|
|
1783
|
+
class le {
|
|
1784
1784
|
constructor(e = {}) {
|
|
1785
1785
|
this.addedNodes = [], this.removedNodes = [], this.defaultColumn = 12, this.column = e.column || this.defaultColumn, this.column > this.defaultColumn && (this.defaultColumn = this.column), this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
|
|
1786
1786
|
}
|
|
@@ -1958,7 +1958,7 @@ class oe {
|
|
|
1958
1958
|
* @param resizing if out of bound, resize down or move into the grid to fit ?
|
|
1959
1959
|
*/
|
|
1960
1960
|
prepareNode(e, t) {
|
|
1961
|
-
e._id = e._id ??
|
|
1961
|
+
e._id = e._id ?? le._idSeq++;
|
|
1962
1962
|
const i = e.id;
|
|
1963
1963
|
if (i) {
|
|
1964
1964
|
let r = 1;
|
|
@@ -2053,7 +2053,7 @@ class oe {
|
|
|
2053
2053
|
if (t.pack = !0, !this.maxRow)
|
|
2054
2054
|
return this.moveNode(e, t);
|
|
2055
2055
|
let i;
|
|
2056
|
-
const s = new
|
|
2056
|
+
const s = new le({
|
|
2057
2057
|
column: this.column,
|
|
2058
2058
|
float: this.float,
|
|
2059
2059
|
nodes: this.nodes.map((o) => o._id === e._id ? (i = { ...o }, i) : { ...o })
|
|
@@ -2075,7 +2075,7 @@ class oe {
|
|
|
2075
2075
|
willItFit(e) {
|
|
2076
2076
|
if (delete e._willFitPos, !this.maxRow)
|
|
2077
2077
|
return !0;
|
|
2078
|
-
const t = new
|
|
2078
|
+
const t = new le({
|
|
2079
2079
|
column: this.column,
|
|
2080
2080
|
float: this.float,
|
|
2081
2081
|
nodes: this.nodes.map((s) => ({ ...s }))
|
|
@@ -2211,7 +2211,7 @@ class oe {
|
|
|
2211
2211
|
return e.forEach((r, o) => {
|
|
2212
2212
|
if (r._id === void 0) {
|
|
2213
2213
|
const n = r.id ? this.nodes.find((h) => h.id === r.id) : void 0;
|
|
2214
|
-
r._id = (n == null ? void 0 : n._id) ??
|
|
2214
|
+
r._id = (n == null ? void 0 : n._id) ?? le._idSeq++;
|
|
2215
2215
|
}
|
|
2216
2216
|
s[o] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
2217
2217
|
}), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
|
|
@@ -2222,7 +2222,7 @@ class oe {
|
|
|
2222
2222
|
* @param column corresponding column index to save it under
|
|
2223
2223
|
*/
|
|
2224
2224
|
cacheOneLayout(e, t) {
|
|
2225
|
-
e._id = e._id ??
|
|
2225
|
+
e._id = e._id ?? le._idSeq++;
|
|
2226
2226
|
const i = { x: e.x, y: e.y, w: e.w, _id: e._id };
|
|
2227
2227
|
(e.autoPosition || e.x === void 0) && (delete i.x, delete i.y, e.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[t] = this._layouts[t] || [];
|
|
2228
2228
|
const s = this.findCacheLayout(e, t);
|
|
@@ -2246,8 +2246,8 @@ class oe {
|
|
|
2246
2246
|
return this;
|
|
2247
2247
|
}
|
|
2248
2248
|
}
|
|
2249
|
-
|
|
2250
|
-
const
|
|
2249
|
+
le._idSeq = 0;
|
|
2250
|
+
const Q = {
|
|
2251
2251
|
alwaysShowResizeHandle: "mobile",
|
|
2252
2252
|
animate: !0,
|
|
2253
2253
|
auto: !0,
|
|
@@ -2277,10 +2277,10 @@ const Y = {
|
|
|
2277
2277
|
// styleInHead: false,
|
|
2278
2278
|
//removable
|
|
2279
2279
|
};
|
|
2280
|
-
class
|
|
2280
|
+
class E {
|
|
2281
2281
|
}
|
|
2282
|
-
const
|
|
2283
|
-
class
|
|
2282
|
+
const oe = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2283
|
+
class he {
|
|
2284
2284
|
}
|
|
2285
2285
|
function Ge(u, e) {
|
|
2286
2286
|
u.touches.length > 1 || (u.cancelable && u.preventDefault(), c.simulateMouseEvent(u.changedTouches[0], e));
|
|
@@ -2289,27 +2289,27 @@ function ii(u, e) {
|
|
|
2289
2289
|
u.cancelable && u.preventDefault(), c.simulateMouseEvent(u, e);
|
|
2290
2290
|
}
|
|
2291
2291
|
function Ue(u) {
|
|
2292
|
-
|
|
2292
|
+
he.touchHandled || (he.touchHandled = !0, Ge(u, "mousedown"));
|
|
2293
2293
|
}
|
|
2294
2294
|
function Be(u) {
|
|
2295
|
-
|
|
2295
|
+
he.touchHandled && Ge(u, "mousemove");
|
|
2296
2296
|
}
|
|
2297
2297
|
function We(u) {
|
|
2298
|
-
if (!
|
|
2298
|
+
if (!he.touchHandled)
|
|
2299
2299
|
return;
|
|
2300
|
-
|
|
2301
|
-
const e = !!
|
|
2302
|
-
Ge(u, "mouseup"), e || Ge(u, "click"),
|
|
2300
|
+
he.pointerLeaveTimeout && (window.clearTimeout(he.pointerLeaveTimeout), delete he.pointerLeaveTimeout);
|
|
2301
|
+
const e = !!E.dragElement;
|
|
2302
|
+
Ge(u, "mouseup"), e || Ge(u, "click"), he.touchHandled = !1;
|
|
2303
2303
|
}
|
|
2304
2304
|
function Ke(u) {
|
|
2305
2305
|
u.pointerType !== "mouse" && u.target.releasePointerCapture(u.pointerId);
|
|
2306
2306
|
}
|
|
2307
|
-
function Ht(u) {
|
|
2308
|
-
x.dragElement && u.pointerType !== "mouse" && ii(u, "mouseenter");
|
|
2309
|
-
}
|
|
2310
2307
|
function Ot(u) {
|
|
2311
|
-
|
|
2312
|
-
|
|
2308
|
+
E.dragElement && u.pointerType !== "mouse" && ii(u, "mouseenter");
|
|
2309
|
+
}
|
|
2310
|
+
function Mt(u) {
|
|
2311
|
+
E.dragElement && u.pointerType !== "mouse" && (he.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2312
|
+
delete he.pointerLeaveTimeout, ii(u, "mouseleave");
|
|
2313
2313
|
}, 10));
|
|
2314
2314
|
}
|
|
2315
2315
|
class Xe {
|
|
@@ -2319,15 +2319,15 @@ class Xe {
|
|
|
2319
2319
|
/** @internal */
|
|
2320
2320
|
_init() {
|
|
2321
2321
|
const e = this.el = document.createElement("div");
|
|
2322
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Xe.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown),
|
|
2322
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Xe.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), oe && (this.el.addEventListener("touchstart", Ue), this.el.addEventListener("pointerdown", Ke)), this;
|
|
2323
2323
|
}
|
|
2324
2324
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2325
2325
|
destroy() {
|
|
2326
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
2326
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), oe && (this.el.removeEventListener("touchstart", Ue), this.el.removeEventListener("pointerdown", Ke)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2327
2327
|
}
|
|
2328
2328
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2329
2329
|
_mouseDown(e) {
|
|
2330
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2330
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), oe && (this.el.addEventListener("touchmove", Be), this.el.addEventListener("touchend", We)), e.stopPropagation(), e.preventDefault();
|
|
2331
2331
|
}
|
|
2332
2332
|
/** @internal */
|
|
2333
2333
|
_mouseMove(e) {
|
|
@@ -2336,7 +2336,7 @@ class Xe {
|
|
|
2336
2336
|
}
|
|
2337
2337
|
/** @internal */
|
|
2338
2338
|
_mouseUp(e) {
|
|
2339
|
-
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2339
|
+
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), oe && (this.el.removeEventListener("touchmove", Be), this.el.removeEventListener("touchend", We)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2340
2340
|
}
|
|
2341
2341
|
/** @internal call when keys are being pressed - use Esc to cancel */
|
|
2342
2342
|
_keyEvent(e) {
|
|
@@ -2349,7 +2349,7 @@ class Xe {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
}
|
|
2351
2351
|
Xe.prefix = "ui-resizable-";
|
|
2352
|
-
class
|
|
2352
|
+
class gt {
|
|
2353
2353
|
constructor() {
|
|
2354
2354
|
this._eventRegister = {};
|
|
2355
2355
|
}
|
|
@@ -2377,7 +2377,7 @@ class ft {
|
|
|
2377
2377
|
return this._eventRegister[e](t);
|
|
2378
2378
|
}
|
|
2379
2379
|
}
|
|
2380
|
-
class Se extends
|
|
2380
|
+
class Se extends gt {
|
|
2381
2381
|
// have to be public else complains for HTMLElementExtendOpt ?
|
|
2382
2382
|
constructor(e, t = {}) {
|
|
2383
2383
|
super(), this.el = e, this.option = t, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
@@ -2433,17 +2433,17 @@ class Se extends ft {
|
|
|
2433
2433
|
}
|
|
2434
2434
|
/** @internal turns auto hide on/off */
|
|
2435
2435
|
_setupAutoHide(e) {
|
|
2436
|
-
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),
|
|
2436
|
+
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), E.overResizeElement === this && delete E.overResizeElement), this;
|
|
2437
2437
|
}
|
|
2438
2438
|
/** @internal */
|
|
2439
2439
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2440
2440
|
_mouseOver(e) {
|
|
2441
|
-
|
|
2441
|
+
E.overResizeElement || E.dragElement || (E.overResizeElement = this, this.el.classList.remove("ui-resizable-autohide"));
|
|
2442
2442
|
}
|
|
2443
2443
|
/** @internal */
|
|
2444
2444
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2445
2445
|
_mouseOut(e) {
|
|
2446
|
-
|
|
2446
|
+
E.overResizeElement === this && (delete E.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
2447
2447
|
}
|
|
2448
2448
|
/** @internal */
|
|
2449
2449
|
_setupHandlers() {
|
|
@@ -2528,7 +2528,7 @@ class Se extends ft {
|
|
|
2528
2528
|
}
|
|
2529
2529
|
Se._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
2530
2530
|
const ks = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
2531
|
-
class Ne extends
|
|
2531
|
+
class Ne extends gt {
|
|
2532
2532
|
constructor(e, t = {}) {
|
|
2533
2533
|
var r;
|
|
2534
2534
|
super(), this.el = e, this.option = t, this.dragTransform = {
|
|
@@ -2548,12 +2548,12 @@ class Ne extends ft {
|
|
|
2548
2548
|
}
|
|
2549
2549
|
enable() {
|
|
2550
2550
|
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
|
|
2551
|
-
e.addEventListener("mousedown", this._mouseDown),
|
|
2551
|
+
e.addEventListener("mousedown", this._mouseDown), oe && (e.addEventListener("touchstart", Ue), e.addEventListener("pointerdown", Ke));
|
|
2552
2552
|
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
2553
2553
|
}
|
|
2554
2554
|
disable(e = !1) {
|
|
2555
2555
|
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((t) => {
|
|
2556
|
-
t.removeEventListener("mousedown", this._mouseDown),
|
|
2556
|
+
t.removeEventListener("mousedown", this._mouseDown), oe && (t.removeEventListener("touchstart", Ue), t.removeEventListener("pointerdown", Ke));
|
|
2557
2557
|
}), e || this.el.classList.add("ui-draggable-disabled"));
|
|
2558
2558
|
}
|
|
2559
2559
|
destroy() {
|
|
@@ -2564,8 +2564,8 @@ class Ne extends ft {
|
|
|
2564
2564
|
}
|
|
2565
2565
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
2566
2566
|
_mouseDown(e) {
|
|
2567
|
-
if (!
|
|
2568
|
-
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(ks) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete
|
|
2567
|
+
if (!E.mouseHandled)
|
|
2568
|
+
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(ks) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete E.dragElement, delete E.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), oe && (e.currentTarget.addEventListener("touchmove", Be), e.currentTarget.addEventListener("touchend", We)), e.preventDefault(), document.activeElement && document.activeElement.blur(), E.mouseHandled = !0), !0;
|
|
2569
2569
|
}
|
|
2570
2570
|
/** @internal method to call actual drag event */
|
|
2571
2571
|
_callDrag(e) {
|
|
@@ -2579,15 +2579,15 @@ class Ne extends ft {
|
|
|
2579
2579
|
var i;
|
|
2580
2580
|
const t = this.mouseDownEvent;
|
|
2581
2581
|
if (this.lastDrag = e, this.dragging)
|
|
2582
|
-
if (this._dragFollow(e),
|
|
2583
|
-
const s = Number.isInteger(
|
|
2582
|
+
if (this._dragFollow(e), E.pauseDrag) {
|
|
2583
|
+
const s = Number.isInteger(E.pauseDrag) ? E.pauseDrag : 100;
|
|
2584
2584
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), this.dragTimeout = window.setTimeout(() => this._callDrag(e), s);
|
|
2585
2585
|
} else
|
|
2586
2586
|
this._callDrag(e);
|
|
2587
2587
|
else if (Math.abs(e.x - t.x) + Math.abs(e.y - t.y) > 3) {
|
|
2588
|
-
this.dragging = !0,
|
|
2588
|
+
this.dragging = !0, E.dragElement = this;
|
|
2589
2589
|
const s = (i = this.el.gridstackNode) == null ? void 0 : i.grid;
|
|
2590
|
-
s ?
|
|
2590
|
+
s ? E.dropElement = s.el.ddElement.ddDroppable : delete E.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);
|
|
2591
2591
|
const r = c.initEvent(e, { target: this.el, type: "dragstart" });
|
|
2592
2592
|
this.option.start && this.option.start(r, this.ui()), this.triggerEvent("dragstart", r), document.addEventListener("keydown", this._keyEvent);
|
|
2593
2593
|
}
|
|
@@ -2596,17 +2596,17 @@ class Ne extends ft {
|
|
|
2596
2596
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
2597
2597
|
_mouseUp(e) {
|
|
2598
2598
|
var t, i;
|
|
2599
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2600
|
-
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i =
|
|
2599
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), oe && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", Be, !0), e.currentTarget.removeEventListener("touchend", We, !0)), this.dragging) {
|
|
2600
|
+
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = E.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete E.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
2601
2601
|
const s = c.initEvent(e, { target: this.el, type: "dragstop" });
|
|
2602
|
-
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s),
|
|
2602
|
+
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), E.dropElement && E.dropElement.drop(e);
|
|
2603
2603
|
}
|
|
2604
|
-
delete this.helper, delete this.mouseDownEvent, delete
|
|
2604
|
+
delete this.helper, delete this.mouseDownEvent, delete E.dragElement, delete E.dropElement, delete E.mouseHandled, e.preventDefault();
|
|
2605
2605
|
}
|
|
2606
2606
|
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
|
|
2607
2607
|
_keyEvent(e) {
|
|
2608
2608
|
var s, r;
|
|
2609
|
-
const t = this.el.gridstackNode, i = (t == null ? void 0 : t.grid) || ((r = (s =
|
|
2609
|
+
const t = this.el.gridstackNode, i = (t == null ? void 0 : t.grid) || ((r = (s = E.dropElement) == null ? void 0 : s.el) == null ? void 0 : r.gridstack);
|
|
2610
2610
|
if (e.key === "Escape")
|
|
2611
2611
|
t && t._origRotate && (t._orig = t._origRotate, delete t._origRotate), i == null || i.cancelDrag(), this._mouseUp(this.mouseDownEvent);
|
|
2612
2612
|
else if (t && i && (e.key === "r" || e.key === "R")) {
|
|
@@ -2678,7 +2678,7 @@ class Ne extends ft {
|
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
2680
|
Ne.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
2681
|
-
class Ts extends
|
|
2681
|
+
class Ts extends gt {
|
|
2682
2682
|
constructor(e, t = {}) {
|
|
2683
2683
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
2684
2684
|
}
|
|
@@ -2689,10 +2689,10 @@ class Ts extends ft {
|
|
|
2689
2689
|
super.off(e);
|
|
2690
2690
|
}
|
|
2691
2691
|
enable() {
|
|
2692
|
-
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave),
|
|
2692
|
+
this.disabled !== !1 && (super.enable(), this.el.classList.add("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), this.el.addEventListener("mouseenter", this._mouseEnter), this.el.addEventListener("mouseleave", this._mouseLeave), oe && (this.el.addEventListener("pointerenter", Ot), this.el.addEventListener("pointerleave", Mt)));
|
|
2693
2693
|
}
|
|
2694
2694
|
disable(e = !1) {
|
|
2695
|
-
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave),
|
|
2695
|
+
this.disabled !== !0 && (super.disable(), this.el.classList.remove("ui-droppable"), e || this.el.classList.add("ui-droppable-disabled"), this.el.removeEventListener("mouseenter", this._mouseEnter), this.el.removeEventListener("mouseleave", this._mouseLeave), oe && (this.el.removeEventListener("pointerenter", Ot), this.el.removeEventListener("pointerleave", Mt)));
|
|
2696
2696
|
}
|
|
2697
2697
|
destroy() {
|
|
2698
2698
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -2702,20 +2702,20 @@ class Ts extends ft {
|
|
|
2702
2702
|
}
|
|
2703
2703
|
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
|
|
2704
2704
|
_mouseEnter(e) {
|
|
2705
|
-
if (!
|
|
2705
|
+
if (!E.dragElement || !this._canDrop(E.dragElement.el))
|
|
2706
2706
|
return;
|
|
2707
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2707
|
+
e.preventDefault(), e.stopPropagation(), E.dropElement && E.dropElement !== this && E.dropElement._mouseLeave(e, !0), E.dropElement = this;
|
|
2708
2708
|
const t = c.initEvent(e, { target: this.el, type: "dropover" });
|
|
2709
|
-
this.option.over && this.option.over(t, this._ui(
|
|
2709
|
+
this.option.over && this.option.over(t, this._ui(E.dragElement)), this.triggerEvent("dropover", t), this.el.classList.add("ui-droppable-over");
|
|
2710
2710
|
}
|
|
2711
2711
|
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
|
|
2712
2712
|
_mouseLeave(e, t = !1) {
|
|
2713
2713
|
var s;
|
|
2714
|
-
if (!
|
|
2714
|
+
if (!E.dragElement || E.dropElement !== this)
|
|
2715
2715
|
return;
|
|
2716
2716
|
e.preventDefault(), e.stopPropagation();
|
|
2717
2717
|
const i = c.initEvent(e, { target: this.el, type: "dropout" });
|
|
2718
|
-
if (this.option.out && this.option.out(i, this._ui(
|
|
2718
|
+
if (this.option.out && this.option.out(i, this._ui(E.dragElement)), this.triggerEvent("dropout", i), E.dropElement === this && (delete E.dropElement, !t)) {
|
|
2719
2719
|
let r, o = this.el.parentElement;
|
|
2720
2720
|
for (; !r && o; )
|
|
2721
2721
|
r = (s = o.ddElement) == null ? void 0 : s.ddDroppable, o = o.parentElement;
|
|
@@ -2726,7 +2726,7 @@ class Ts extends ft {
|
|
|
2726
2726
|
drop(e) {
|
|
2727
2727
|
e.preventDefault();
|
|
2728
2728
|
const t = c.initEvent(e, { target: this.el, type: "drop" });
|
|
2729
|
-
this.option.drop && this.option.drop(t, this._ui(
|
|
2729
|
+
this.option.drop && this.option.drop(t, this._ui(E.dragElement)), this.triggerEvent("drop", t);
|
|
2730
2730
|
}
|
|
2731
2731
|
/** @internal true if element matches the string/method accept option */
|
|
2732
2732
|
_canDrop(e) {
|
|
@@ -2744,9 +2744,9 @@ class Ts extends ft {
|
|
|
2744
2744
|
};
|
|
2745
2745
|
}
|
|
2746
2746
|
}
|
|
2747
|
-
class
|
|
2747
|
+
class mt {
|
|
2748
2748
|
static init(e) {
|
|
2749
|
-
return e.ddElement || (e.ddElement = new
|
|
2749
|
+
return e.ddElement || (e.ddElement = new mt(e)), e.ddElement;
|
|
2750
2750
|
}
|
|
2751
2751
|
constructor(e) {
|
|
2752
2752
|
this.el = e;
|
|
@@ -2846,7 +2846,7 @@ class zs {
|
|
|
2846
2846
|
}
|
|
2847
2847
|
on(e, t, i) {
|
|
2848
2848
|
return this._getDDElements(e).forEach((s) => s.on(t, (r) => {
|
|
2849
|
-
i(r,
|
|
2849
|
+
i(r, E.dragElement ? E.dragElement.el : r.target, E.dragElement ? E.dragElement.helper : null);
|
|
2850
2850
|
})), this;
|
|
2851
2851
|
}
|
|
2852
2852
|
off(e, t) {
|
|
@@ -2855,7 +2855,7 @@ class zs {
|
|
|
2855
2855
|
/** @internal returns a list of DD elements, creating them on the fly by default unless option is to destroy or disable */
|
|
2856
2856
|
_getDDElements(e, t) {
|
|
2857
2857
|
const i = e.gridstack || t !== "destroy" && t !== "disable", s = c.getElements(e);
|
|
2858
|
-
return s.length ? s.map((o) => o.ddElement || (i ?
|
|
2858
|
+
return s.length ? s.map((o) => o.ddElement || (i ? mt.init(o) : null)).filter((o) => o) : [];
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
/*!
|
|
@@ -2865,8 +2865,8 @@ class zs {
|
|
|
2865
2865
|
* Copyright (c) 2021-2024 Alain Dumesny
|
|
2866
2866
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
2867
2867
|
*/
|
|
2868
|
-
const
|
|
2869
|
-
class
|
|
2868
|
+
const B = new zs();
|
|
2869
|
+
class w {
|
|
2870
2870
|
/**
|
|
2871
2871
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
2872
2872
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -2883,8 +2883,8 @@ class b {
|
|
|
2883
2883
|
static init(e = {}, t = ".grid-stack") {
|
|
2884
2884
|
if (typeof document > "u")
|
|
2885
2885
|
return null;
|
|
2886
|
-
const i =
|
|
2887
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
2886
|
+
const i = w.getGridElement(t);
|
|
2887
|
+
return i ? (i.gridstack || (i.gridstack = new w(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 ?
|
|
2888
2888
|
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);
|
|
2889
2889
|
}
|
|
2890
2890
|
/**
|
|
@@ -2898,8 +2898,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2898
2898
|
*/
|
|
2899
2899
|
static initAll(e = {}, t = ".grid-stack") {
|
|
2900
2900
|
const i = [];
|
|
2901
|
-
return typeof document > "u" || (
|
|
2902
|
-
s.gridstack || (s.gridstack = new
|
|
2901
|
+
return typeof document > "u" || (w.getGridElements(t).forEach((s) => {
|
|
2902
|
+
s.gridstack || (s.gridstack = new w(s, c.cloneDeep(e))), i.push(s.gridstack);
|
|
2903
2903
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
2904
2904
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)), i;
|
|
2905
2905
|
}
|
|
@@ -2918,19 +2918,19 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2918
2918
|
const o = i.gridstack;
|
|
2919
2919
|
return t && (o.opts = { ...o.opts, ...t }), t.children !== void 0 && o.load(t.children), o;
|
|
2920
2920
|
}
|
|
2921
|
-
return (!e.classList.contains("grid-stack") ||
|
|
2921
|
+
return (!e.classList.contains("grid-stack") || w.addRemoveCB) && (w.addRemoveCB ? i = w.addRemoveCB(e, t, !0, !0) : i = c.createDiv(["grid-stack", t.class], e)), w.init(t, i);
|
|
2922
2922
|
}
|
|
2923
2923
|
/** call this method to register your engine instead of the default one.
|
|
2924
2924
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
2925
2925
|
* replace just one instance.
|
|
2926
2926
|
*/
|
|
2927
2927
|
static registerEngine(e) {
|
|
2928
|
-
|
|
2928
|
+
w.engineClass = e;
|
|
2929
2929
|
}
|
|
2930
2930
|
/** @internal create placeholder DIV as needed */
|
|
2931
2931
|
get placeholder() {
|
|
2932
2932
|
if (!this._placeholder) {
|
|
2933
|
-
this._placeholder = c.createDiv([this.opts.placeholderClass,
|
|
2933
|
+
this._placeholder = c.createDiv([this.opts.placeholderClass, Q.itemClass, this.opts.itemClass]);
|
|
2934
2934
|
const e = c.createDiv(["placeholder-content"], this._placeholder);
|
|
2935
2935
|
this.opts.placeholderText && (e.textContent = this.opts.placeholderText);
|
|
2936
2936
|
}
|
|
@@ -2957,24 +2957,24 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2957
2957
|
const o = t.columnOpts;
|
|
2958
2958
|
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((g, y) => (y.w || 0) - (g.w || 0));
|
|
2959
2959
|
const n = {
|
|
2960
|
-
...c.cloneDeep(
|
|
2961
|
-
column: c.toNumber(e.getAttribute("gs-column")) ||
|
|
2962
|
-
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) ||
|
|
2963
|
-
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) ||
|
|
2964
|
-
staticGrid: c.toBool(e.getAttribute("gs-static")) ||
|
|
2960
|
+
...c.cloneDeep(Q),
|
|
2961
|
+
column: c.toNumber(e.getAttribute("gs-column")) || Q.column,
|
|
2962
|
+
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) || Q.minRow,
|
|
2963
|
+
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) || Q.maxRow,
|
|
2964
|
+
staticGrid: c.toBool(e.getAttribute("gs-static")) || Q.staticGrid,
|
|
2965
2965
|
sizeToContent: c.toBool(e.getAttribute("gs-size-to-content")) || void 0,
|
|
2966
2966
|
draggable: {
|
|
2967
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
2967
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || Q.draggable.handle
|
|
2968
2968
|
},
|
|
2969
2969
|
removableOptions: {
|
|
2970
|
-
accept: t.itemClass ||
|
|
2971
|
-
decline:
|
|
2970
|
+
accept: t.itemClass || Q.removableOptions.accept,
|
|
2971
|
+
decline: Q.removableOptions.decline
|
|
2972
2972
|
}
|
|
2973
2973
|
};
|
|
2974
2974
|
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");
|
|
2975
|
-
const h = this.el.closest("." +
|
|
2976
|
-
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 !==
|
|
2977
|
-
const d = t.engineClass ||
|
|
2975
|
+
const h = this.el.closest("." + Q.itemClass), l = h == null ? void 0 : h.gridstackNode;
|
|
2976
|
+
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 !== Q.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = oe), this._styleSheetClass = "gs-id-" + le._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
2977
|
+
const d = t.engineClass || w.engineClass || le;
|
|
2978
2978
|
if (this.engine = new d({
|
|
2979
2979
|
column: this.getColumn(),
|
|
2980
2980
|
float: t.float,
|
|
@@ -2992,7 +2992,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2992
2992
|
const g = t.children;
|
|
2993
2993
|
delete t.children, g.length && this.load(g);
|
|
2994
2994
|
}
|
|
2995
|
-
this.setAnimation(), t.subGridDynamic && !
|
|
2995
|
+
this.setAnimation(), t.subGridDynamic && !E.pauseDrag && (E.pauseDrag = !0), ((p = t.draggable) == null ? void 0 : p.pause) !== void 0 && (E.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
2996
2996
|
}
|
|
2997
2997
|
/**
|
|
2998
2998
|
* add a new widget and returns it.
|
|
@@ -3015,7 +3015,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3015
3015
|
if (e.ELEMENT_NODE)
|
|
3016
3016
|
return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"), this.makeWidget(e);
|
|
3017
3017
|
let t, i = e;
|
|
3018
|
-
if (i.grid = this, i != null && i.el ? t = i.el :
|
|
3018
|
+
if (i.grid = this, i != null && i.el ? t = i.el : w.addRemoveCB ? t = w.addRemoveCB(this.el, e, !0, !1) : t = this.createWidgetDivs(i), !t)
|
|
3019
3019
|
return;
|
|
3020
3020
|
if (i = t.gridstackNode, i && t.parentElement === this.el && this.engine.nodes.find((r) => r._id === i._id))
|
|
3021
3021
|
return t;
|
|
@@ -3027,11 +3027,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3027
3027
|
const t = c.createDiv(["grid-stack-item", this.opts.itemClass]), i = c.createDiv(["grid-stack-item-content"], t);
|
|
3028
3028
|
return c.lazyLoad(e) ? e.visibleObservable || (e.visibleObservable = new IntersectionObserver(([s]) => {
|
|
3029
3029
|
var r, o;
|
|
3030
|
-
s.isIntersecting && ((r = e.visibleObservable) == null || r.disconnect(), delete e.visibleObservable,
|
|
3030
|
+
s.isIntersecting && ((r = e.visibleObservable) == null || r.disconnect(), delete e.visibleObservable, w.renderCB(i, e), (o = e.grid) == null || o.prepareDragDrop(e.el));
|
|
3031
3031
|
}), window.setTimeout(() => {
|
|
3032
3032
|
var s;
|
|
3033
3033
|
return (s = e.visibleObservable) == null ? void 0 : s.observe(t);
|
|
3034
|
-
})) :
|
|
3034
|
+
})) : w.renderCB(i, e), t;
|
|
3035
3035
|
}
|
|
3036
3036
|
/**
|
|
3037
3037
|
* Convert an existing gridItem element into a sub-grid with the given (optional) options, else inherit them
|
|
@@ -3065,11 +3065,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3065
3065
|
let h;
|
|
3066
3066
|
t.column === "auto" && (h = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
|
|
3067
3067
|
let l = r.el.querySelector(".grid-stack-item-content"), d, a;
|
|
3068
|
-
if (s && (this._removeDD(r.el), a = { ...r, x: 0, y: 0 }, c.removeInternalForSave(a), delete a.subGridOpts, r.content && (a.content = r.content, delete r.content),
|
|
3069
|
-
const m = h ? t.column : r.w, T = r.h + i.h,
|
|
3070
|
-
|
|
3068
|
+
if (s && (this._removeDD(r.el), a = { ...r, x: 0, y: 0 }, c.removeInternalForSave(a), delete a.subGridOpts, r.content && (a.content = r.content, delete r.content), w.addRemoveCB ? d = w.addRemoveCB(this.el, a, !0, !1) : (d = c.createDiv(["grid-stack-item"]), d.appendChild(l), l = c.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
|
|
3069
|
+
const m = h ? t.column : r.w, T = r.h + i.h, L = r.el.style;
|
|
3070
|
+
L.transition = "none", this.update(r.el, { w: m, h: T }), setTimeout(() => L.transition = null);
|
|
3071
3071
|
}
|
|
3072
|
-
const f = r.subGrid =
|
|
3072
|
+
const f = r.subGrid = w.addGrid(l, t);
|
|
3073
3073
|
return i != null && i._moving && (f._isTemp = !0), h && (f._autoColumn = !0), s && f.makeWidget(d, a), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
|
|
3074
3074
|
}
|
|
3075
3075
|
/**
|
|
@@ -3092,7 +3092,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3092
3092
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
3093
3093
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
3094
3094
|
*/
|
|
3095
|
-
save(e = !0, t = !1, i =
|
|
3095
|
+
save(e = !0, t = !1, i = w.saveCB) {
|
|
3096
3096
|
const s = this.engine.save(e, i);
|
|
3097
3097
|
if (s.forEach((r) => {
|
|
3098
3098
|
var o;
|
|
@@ -3108,7 +3108,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3108
3108
|
const r = c.cloneDeep(this.opts);
|
|
3109
3109
|
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");
|
|
3110
3110
|
const o = r._alwaysShowResizeHandle;
|
|
3111
|
-
return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r,
|
|
3111
|
+
return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r, Q), r.children = s, r;
|
|
3112
3112
|
}
|
|
3113
3113
|
return s;
|
|
3114
3114
|
}
|
|
@@ -3122,7 +3122,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3122
3122
|
* @example
|
|
3123
3123
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3124
3124
|
*/
|
|
3125
|
-
load(e, t =
|
|
3125
|
+
load(e, t = w.addRemoveCB || !0) {
|
|
3126
3126
|
var l;
|
|
3127
3127
|
e = c.cloneDeep(e);
|
|
3128
3128
|
const i = this.getColumn();
|
|
@@ -3133,15 +3133,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3133
3133
|
e.forEach((d) => {
|
|
3134
3134
|
s = Math.max(s, (d.x || 0) + d.w);
|
|
3135
3135
|
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
|
|
3136
|
-
const r =
|
|
3137
|
-
typeof t == "function" && (
|
|
3136
|
+
const r = w.addRemoveCB;
|
|
3137
|
+
typeof t == "function" && (w.addRemoveCB = t);
|
|
3138
3138
|
const o = [];
|
|
3139
3139
|
this.batchUpdate();
|
|
3140
3140
|
const n = !this.engine.nodes.length;
|
|
3141
3141
|
n && this.setAnimation(!1), !n && t && [...this.engine.nodes].forEach((a) => {
|
|
3142
3142
|
if (!a.id)
|
|
3143
3143
|
return;
|
|
3144
|
-
c.find(e, a.id) || (
|
|
3144
|
+
c.find(e, a.id) || (w.addRemoveCB && w.addRemoveCB(this.el, a, !1, !1), o.push(a), this.removeWidget(a.el, !0, !1));
|
|
3145
3145
|
}), this.engine._loading = !0;
|
|
3146
3146
|
const h = [];
|
|
3147
3147
|
return this.engine.nodes = this.engine.nodes.filter((d) => c.find(e, d.id) ? (h.push(d), !1) : !0), e.forEach((d) => {
|
|
@@ -3153,7 +3153,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3153
3153
|
p && p.gridstack && p.gridstack.load(d.subGridOpts.children);
|
|
3154
3154
|
}
|
|
3155
3155
|
} else t && this.addWidget(d);
|
|
3156
|
-
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ?
|
|
3156
|
+
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? w.addRemoveCB = r : delete w.addRemoveCB, n && ((l = this.opts) != null && l.animate) && this.setAnimation(this.opts.animate, !0), this;
|
|
3157
3157
|
}
|
|
3158
3158
|
/**
|
|
3159
3159
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3342,7 +3342,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3342
3342
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3343
3343
|
*/
|
|
3344
3344
|
makeWidget(e, t) {
|
|
3345
|
-
const i =
|
|
3345
|
+
const i = w.getElement(e);
|
|
3346
3346
|
if (!i)
|
|
3347
3347
|
return;
|
|
3348
3348
|
i.parentElement || this.el.appendChild(i), this._prepareElement(i, !0, t);
|
|
@@ -3374,11 +3374,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3374
3374
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3375
3375
|
*/
|
|
3376
3376
|
removeWidget(e, t = !0, i = !0) {
|
|
3377
|
-
return e ? (
|
|
3377
|
+
return e ? (w.getElements(e).forEach((s) => {
|
|
3378
3378
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3379
3379
|
return;
|
|
3380
3380
|
let r = s.gridstackNode;
|
|
3381
|
-
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t &&
|
|
3381
|
+
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t && w.addRemoveCB && w.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3382
3382
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this) : (console.error("Error: GridStack.removeWidget(undefined) called"), this);
|
|
3383
3383
|
}
|
|
3384
3384
|
/**
|
|
@@ -3388,7 +3388,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3388
3388
|
*/
|
|
3389
3389
|
removeAll(e = !0, t = !0) {
|
|
3390
3390
|
return this.engine.nodes.forEach((i) => {
|
|
3391
|
-
e &&
|
|
3391
|
+
e && w.addRemoveCB && w.addRemoveCB(this.el, i, !1, !1), delete i.el.gridstackNode, this.opts.staticGrid || this._removeDD(i.el);
|
|
3392
3392
|
}), this.engine.removeAll(e, t), t && this._triggerRemoveEvent(), this;
|
|
3393
3393
|
}
|
|
3394
3394
|
/**
|
|
@@ -3433,7 +3433,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3433
3433
|
* @param opt new widget options (x,y,w,h, etc..). Only those set will be updated.
|
|
3434
3434
|
*/
|
|
3435
3435
|
update(e, t) {
|
|
3436
|
-
return
|
|
3436
|
+
return w.getElements(e).forEach((i) => {
|
|
3437
3437
|
var d;
|
|
3438
3438
|
const s = i == null ? void 0 : i.gridstackNode;
|
|
3439
3439
|
if (!s)
|
|
@@ -3446,7 +3446,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3446
3446
|
n[a] = r[a] !== void 0 ? r[a] : s[a], delete r[a];
|
|
3447
3447
|
})), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
|
|
3448
3448
|
const a = i.querySelector(".grid-stack-item-content");
|
|
3449
|
-
a && a.textContent !== r.content && (s.content = r.content,
|
|
3449
|
+
a && a.textContent !== r.content && (s.content = r.content, w.renderCB(a, r), (d = s.subGrid) != null && d.el && (a.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
|
|
3450
3450
|
}
|
|
3451
3451
|
let h = !1, l = !1;
|
|
3452
3452
|
for (const a in r)
|
|
@@ -3482,7 +3482,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3482
3482
|
if (!s)
|
|
3483
3483
|
return;
|
|
3484
3484
|
let r = t.h ? t.h * s : e.clientHeight, o;
|
|
3485
|
-
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(
|
|
3485
|
+
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(w.resizeToContentParent)), !o)
|
|
3486
3486
|
return;
|
|
3487
3487
|
const n = e.clientHeight - o.clientHeight, h = t.h ? t.h * s - n : o.clientHeight;
|
|
3488
3488
|
let l;
|
|
@@ -3496,7 +3496,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3496
3496
|
{
|
|
3497
3497
|
const g = o.firstElementChild;
|
|
3498
3498
|
if (!g) {
|
|
3499
|
-
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${
|
|
3499
|
+
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${w.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
3500
3500
|
return;
|
|
3501
3501
|
}
|
|
3502
3502
|
l = g.getBoundingClientRect().height || h;
|
|
@@ -3511,14 +3511,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3511
3511
|
}
|
|
3512
3512
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
3513
3513
|
resizeToContentCBCheck(e) {
|
|
3514
|
-
|
|
3514
|
+
w.resizeToContentCB ? w.resizeToContentCB(e) : this.resizeToContent(e);
|
|
3515
3515
|
}
|
|
3516
3516
|
/** rotate (by swapping w & h) the passed in node - called when user press 'r' during dragging
|
|
3517
3517
|
* @param els widget or selector of objects to modify
|
|
3518
3518
|
* @param relative optional pixel coord relative to upper/left corner to rotate around (will keep that cell under cursor)
|
|
3519
3519
|
*/
|
|
3520
3520
|
rotate(e, t) {
|
|
3521
|
-
return
|
|
3521
|
+
return w.getElements(e).forEach((i) => {
|
|
3522
3522
|
const s = i.gridstackNode;
|
|
3523
3523
|
if (!c.canBeRotated(s))
|
|
3524
3524
|
return;
|
|
@@ -3659,7 +3659,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3659
3659
|
}
|
|
3660
3660
|
/** @internal */
|
|
3661
3661
|
_prepareElement(e, t = !1, i) {
|
|
3662
|
-
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(
|
|
3662
|
+
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(Q.itemClass, this.opts.itemClass);
|
|
3663
3663
|
const s = c.shouldSizeToContent(i);
|
|
3664
3664
|
return s ? e.classList.add("size-to-content") : e.classList.remove("size-to-content"), s && this.resizeToContentCheck(!1, i), c.lazyLoad(i) || this.prepareDragDrop(i.el), this;
|
|
3665
3665
|
}
|
|
@@ -3747,7 +3747,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3747
3747
|
}
|
|
3748
3748
|
/** @internal */
|
|
3749
3749
|
static getGridElement(e) {
|
|
3750
|
-
return
|
|
3750
|
+
return w.getElement(e);
|
|
3751
3751
|
}
|
|
3752
3752
|
/** @internal */
|
|
3753
3753
|
static getGridElements(e) {
|
|
@@ -3765,7 +3765,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3765
3765
|
*/
|
|
3766
3766
|
/** get the global (but static to this code) DD implementation */
|
|
3767
3767
|
static getDD() {
|
|
3768
|
-
return
|
|
3768
|
+
return B;
|
|
3769
3769
|
}
|
|
3770
3770
|
/**
|
|
3771
3771
|
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
@@ -3777,8 +3777,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3777
3777
|
* @param root optional root which defaults to document (for shadow dom pass the parent HTMLDocument)
|
|
3778
3778
|
*/
|
|
3779
3779
|
static setupDragIn(e, t, i, s = document) {
|
|
3780
|
-
(t == null ? void 0 : t.pause) !== void 0 && (
|
|
3781
|
-
|
|
3780
|
+
(t == null ? void 0 : t.pause) !== void 0 && (E.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((o, n) => {
|
|
3781
|
+
B.isDraggable(o) || B.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
|
|
3782
3782
|
});
|
|
3783
3783
|
}
|
|
3784
3784
|
/**
|
|
@@ -3788,7 +3788,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3788
3788
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
3789
3789
|
*/
|
|
3790
3790
|
movable(e, t) {
|
|
3791
|
-
return this.opts.staticGrid ? this : (
|
|
3791
|
+
return this.opts.staticGrid ? this : (w.getElements(e).forEach((i) => {
|
|
3792
3792
|
const s = i.gridstackNode;
|
|
3793
3793
|
s && (t ? delete s.noMove : s.noMove = !0, this.prepareDragDrop(s.el));
|
|
3794
3794
|
}), this);
|
|
@@ -3799,7 +3799,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3799
3799
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
3800
3800
|
*/
|
|
3801
3801
|
resizable(e, t) {
|
|
3802
|
-
return this.opts.staticGrid ? this : (
|
|
3802
|
+
return this.opts.staticGrid ? this : (w.getElements(e).forEach((i) => {
|
|
3803
3803
|
const s = i.gridstackNode;
|
|
3804
3804
|
s && (t ? delete s.noResize : s.noResize = !0, this.prepareDragDrop(s.el));
|
|
3805
3805
|
}), this);
|
|
@@ -3853,16 +3853,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3853
3853
|
cancelDrag() {
|
|
3854
3854
|
var t;
|
|
3855
3855
|
const e = (t = this._placeholder) == null ? void 0 : t.gridstackNode;
|
|
3856
|
-
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove &&
|
|
3856
|
+
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove && w._itemRemoving(e.el, !1), this.engine.restoreInitial());
|
|
3857
3857
|
}
|
|
3858
3858
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
3859
3859
|
_removeDD(e) {
|
|
3860
|
-
return
|
|
3860
|
+
return B.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
|
|
3861
3861
|
}
|
|
3862
3862
|
/** @internal called to add drag over to support widgets being added externally */
|
|
3863
3863
|
_setupAcceptWidget() {
|
|
3864
3864
|
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
3865
|
-
return
|
|
3865
|
+
return B.droppable(this.el, "destroy"), this;
|
|
3866
3866
|
let e, t;
|
|
3867
3867
|
const i = (s, r, o) => {
|
|
3868
3868
|
var f;
|
|
@@ -3887,7 +3887,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3887
3887
|
if (n._temporaryRemoved) {
|
|
3888
3888
|
if (n.x = Math.max(0, Math.round(l / t)), n.y = Math.max(0, Math.round(h / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
|
|
3889
3889
|
if (n.autoPosition = !0, !this.engine.willItFit(n)) {
|
|
3890
|
-
|
|
3890
|
+
B.off(r, "drag");
|
|
3891
3891
|
return;
|
|
3892
3892
|
}
|
|
3893
3893
|
n._willFitPos && (c.copyPos(n, n._willFitPos), delete n._willFitPos);
|
|
@@ -3896,7 +3896,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3896
3896
|
} else
|
|
3897
3897
|
this._dragOrResize(o, s, a, n, t, e);
|
|
3898
3898
|
};
|
|
3899
|
-
return
|
|
3899
|
+
return B.droppable(this.el, {
|
|
3900
3900
|
accept: (s) => {
|
|
3901
3901
|
const r = s.gridstackNode || this._readAttr(s, !1);
|
|
3902
3902
|
if ((r == null ? void 0 : r.grid) === this)
|
|
@@ -3935,7 +3935,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3935
3935
|
n.grid || (n.el || (n = { ...n }), n._isExternal = !0, o.gridstackNode = n);
|
|
3936
3936
|
const h = n.w || Math.round(o.offsetWidth / t) || 1, l = n.h || Math.round(o.offsetHeight / e) || 1;
|
|
3937
3937
|
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: h, 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
|
|
3938
|
-
n._temporaryRemoved = !0) : (n.w = h, n.h = l, n._temporaryRemoved = !0),
|
|
3938
|
+
n._temporaryRemoved = !0) : (n.w = h, n.h = l, n._temporaryRemoved = !0), w._itemRemoving(n.el, !1), B.on(r, "drag", i), i(s, r, o), !1;
|
|
3939
3939
|
}).on(this.el, "dropout", (s, r, o) => {
|
|
3940
3940
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3941
3941
|
return n && (!n.grid || n.grid === this) && (this._leave(r, o), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
@@ -3953,10 +3953,10 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3953
3953
|
const m = a.grid;
|
|
3954
3954
|
m.engine.removeNodeFromLayoutCache(a), m.engine.removedNodes.push(a), m._triggerRemoveEvent()._triggerChangeEvent(), m.parentGridNode && !m.engine.nodes.length && m.opts.subGridDynamic && m.removeAsSubGrid();
|
|
3955
3955
|
}
|
|
3956
|
-
if (!n || (h && (this.engine.cleanupNode(n), n.grid = this), (p = n.grid) == null || delete p._isTemp,
|
|
3956
|
+
if (!n || (h && (this.engine.cleanupNode(n), n.grid = this), (p = n.grid) == null || delete p._isTemp, B.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !h))
|
|
3957
3957
|
return !1;
|
|
3958
3958
|
const f = (y = (g = n.subGrid) == null ? void 0 : g.el) == null ? void 0 : y.gridstack;
|
|
3959
|
-
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), l && (n.content || n.subGridOpts ||
|
|
3959
|
+
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), l && (n.content || n.subGridOpts || w.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" }, a && a.grid ? a : void 0, n), d && this.setAnimation(this.opts.animate, !0), !1;
|
|
3960
3960
|
}), this;
|
|
3961
3961
|
}
|
|
3962
3962
|
/** @internal mark item for removal */
|
|
@@ -3971,7 +3971,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3971
3971
|
if (typeof this.opts.removable != "string")
|
|
3972
3972
|
return this;
|
|
3973
3973
|
const e = document.querySelector(this.opts.removable);
|
|
3974
|
-
return e ? (!this.opts.staticGrid && !
|
|
3974
|
+
return e ? (!this.opts.staticGrid && !B.isDroppable(e) && B.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => w._itemRemoving(i, !0)).on(e, "dropout", (t, i) => w._itemRemoving(i, !1)), this) : this;
|
|
3975
3975
|
}
|
|
3976
3976
|
/**
|
|
3977
3977
|
* prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
|
|
@@ -4003,7 +4003,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4003
4003
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(p, i));
|
|
4004
4004
|
}
|
|
4005
4005
|
};
|
|
4006
|
-
|
|
4006
|
+
B.draggable(e, {
|
|
4007
4007
|
start: l,
|
|
4008
4008
|
stop: a,
|
|
4009
4009
|
drag: d
|
|
@@ -4013,7 +4013,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4013
4013
|
resize: d
|
|
4014
4014
|
}), i._initDD = !0;
|
|
4015
4015
|
}
|
|
4016
|
-
return
|
|
4016
|
+
return B.draggable(e, s ? "disable" : "enable").resizable(e, r ? "disable" : "enable"), this;
|
|
4017
4017
|
}
|
|
4018
4018
|
/** @internal handles actual drag/resize start */
|
|
4019
4019
|
_onStartMoving(e, t, i, s, r, o) {
|
|
@@ -4032,7 +4032,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4032
4032
|
};
|
|
4033
4033
|
if (s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, o, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart") {
|
|
4034
4034
|
const h = this.getColumn() - s.x, l = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
|
|
4035
|
-
|
|
4035
|
+
B.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, h)).resizable(e, "option", "minHeight", o * Math.min(s.minH || 1, l)).resizable(e, "option", "maxWidth", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, h)).resizable(e, "option", "maxWidthMoveLeft", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, s.x + s.w)).resizable(e, "option", "maxHeight", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, l)).resizable(e, "option", "maxHeightMoveUp", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
|
|
4036
4036
|
}
|
|
4037
4037
|
}
|
|
4038
4038
|
/** @internal handles actual drag/resize */
|
|
@@ -4045,16 +4045,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4045
4045
|
return;
|
|
4046
4046
|
const m = i.position.top - s._prevYPix;
|
|
4047
4047
|
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, m);
|
|
4048
|
-
const T = i.position.left + (i.position.left > s._lastUiPosition.left ? -d : l),
|
|
4049
|
-
n.x = Math.round(T / r), n.y = Math.round(
|
|
4050
|
-
const
|
|
4048
|
+
const T = i.position.left + (i.position.left > s._lastUiPosition.left ? -d : l), L = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : a);
|
|
4049
|
+
n.x = Math.round(T / r), n.y = Math.round(L / o);
|
|
4050
|
+
const z = this._extraDragRow;
|
|
4051
4051
|
if (this.engine.collide(s, n)) {
|
|
4052
|
-
const
|
|
4053
|
-
let
|
|
4054
|
-
this.opts.maxRow &&
|
|
4052
|
+
const x = this.getRow();
|
|
4053
|
+
let _ = Math.max(0, n.y + s.h - x);
|
|
4054
|
+
this.opts.maxRow && x + _ > this.opts.maxRow && (_ = Math.max(0, this.opts.maxRow - x)), this._extraDragRow = _;
|
|
4055
4055
|
} else
|
|
4056
4056
|
this._extraDragRow = 0;
|
|
4057
|
-
if (this._extraDragRow !==
|
|
4057
|
+
if (this._extraDragRow !== z && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
4058
4058
|
return;
|
|
4059
4059
|
} else if (t.type === "resize") {
|
|
4060
4060
|
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 - a) / o), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
@@ -4082,25 +4082,25 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4082
4082
|
_leave(e, t) {
|
|
4083
4083
|
t = t || e;
|
|
4084
4084
|
const i = t.gridstackNode;
|
|
4085
|
-
if (!i || (t.style.transform = t.style.transformOrigin = null,
|
|
4085
|
+
if (!i || (t.style.transform = t.style.transformOrigin = null, B.off(e, "drag"), i._temporaryRemoved))
|
|
4086
4086
|
return;
|
|
4087
4087
|
i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e;
|
|
4088
4088
|
const s = i._sidebarOrig;
|
|
4089
|
-
i._isExternal && this.engine.cleanupNode(i), i._sidebarOrig = s, this.opts.removable === !0 &&
|
|
4089
|
+
i._isExternal && this.engine.cleanupNode(i), i._sidebarOrig = s, this.opts.removable === !0 && w._itemRemoving(e, !0), e._gridstackNodeOrig ? (e.gridstackNode = e._gridstackNodeOrig, delete e._gridstackNodeOrig) : i._isExternal && this.engine.restoreInitial();
|
|
4090
4090
|
}
|
|
4091
4091
|
// legacy method removed
|
|
4092
4092
|
commit() {
|
|
4093
4093
|
return Rs(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4094
4094
|
}
|
|
4095
4095
|
}
|
|
4096
|
-
|
|
4096
|
+
w.renderCB = (u, e) => {
|
|
4097
4097
|
u && (e != null && e.content) && (u.textContent = e.content);
|
|
4098
4098
|
};
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { class: "grid-stack-item-content" }, Ns = /* @__PURE__ */
|
|
4099
|
+
w.resizeToContentParent = ".grid-stack-item-content";
|
|
4100
|
+
w.Utils = c;
|
|
4101
|
+
w.Engine = le;
|
|
4102
|
+
w.GDRev = "11.5.1";
|
|
4103
|
+
const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { class: "grid-stack-item-content" }, Ns = /* @__PURE__ */ j({
|
|
4104
4104
|
__name: "DraggableGridLayout",
|
|
4105
4105
|
props: {
|
|
4106
4106
|
tiles: {},
|
|
@@ -4132,7 +4132,7 @@ const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { cl
|
|
|
4132
4132
|
}), s("update-tiles", Array.from(o.value.values()));
|
|
4133
4133
|
};
|
|
4134
4134
|
ot(() => {
|
|
4135
|
-
r.value && (n =
|
|
4135
|
+
r.value && (n = w.init({
|
|
4136
4136
|
margin: 10,
|
|
4137
4137
|
column: Kt,
|
|
4138
4138
|
cellHeight: i.tileHeight,
|
|
@@ -4158,16 +4158,16 @@ const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { cl
|
|
|
4158
4158
|
h: m.layout.size.rows
|
|
4159
4159
|
});
|
|
4160
4160
|
}
|
|
4161
|
-
}),
|
|
4161
|
+
}), It(() => {
|
|
4162
4162
|
i.tiles.forEach((p) => {
|
|
4163
4163
|
o.value.set(`${p.id}`, p);
|
|
4164
4164
|
});
|
|
4165
|
-
}), e({ removeWidget: f }), (p, g) => (
|
|
4165
|
+
}), e({ removeWidget: f }), (p, g) => (k(), K("div", {
|
|
4166
4166
|
ref_key: "gridContainer",
|
|
4167
4167
|
ref: r,
|
|
4168
4168
|
class: "grid-stack"
|
|
4169
4169
|
}, [
|
|
4170
|
-
(
|
|
4170
|
+
(k(!0), K(Ft, null, Gt(i.tiles, (y) => (k(), K("div", {
|
|
4171
4171
|
key: y.id,
|
|
4172
4172
|
class: "grid-stack-item",
|
|
4173
4173
|
"data-id": `${y.id}`,
|
|
@@ -4178,71 +4178,71 @@ const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { cl
|
|
|
4178
4178
|
"gs-x": y.layout.position.col,
|
|
4179
4179
|
"gs-y": y.layout.position.row
|
|
4180
4180
|
}, [
|
|
4181
|
-
|
|
4181
|
+
ue("div", Ss, [
|
|
4182
4182
|
ze(p.$slots, "tile", { tile: y }, void 0, !0)
|
|
4183
4183
|
])
|
|
4184
4184
|
], 8, Ds))), 128))
|
|
4185
4185
|
], 512));
|
|
4186
4186
|
}
|
|
4187
|
-
}), Ls = /* @__PURE__ */
|
|
4187
|
+
}), Ls = /* @__PURE__ */ ve(Ns, [["__scopeId", "data-v-a68d6821"]]), As = {
|
|
4188
4188
|
key: 0,
|
|
4189
4189
|
class: "fullscreen-header"
|
|
4190
4190
|
}, Hs = {
|
|
4191
4191
|
key: 0,
|
|
4192
4192
|
class: "tile-container slottable-tile"
|
|
4193
|
-
}, Os = /* @__PURE__ */
|
|
4193
|
+
}, Os = /* @__PURE__ */ j({
|
|
4194
4194
|
__name: "DashboardRenderer",
|
|
4195
|
-
props: /* @__PURE__ */
|
|
4195
|
+
props: /* @__PURE__ */ Ct({
|
|
4196
4196
|
context: {}
|
|
4197
4197
|
}, {
|
|
4198
4198
|
modelValue: { required: !0 },
|
|
4199
4199
|
modelModifiers: {}
|
|
4200
4200
|
}),
|
|
4201
|
-
emits: /* @__PURE__ */
|
|
4201
|
+
emits: /* @__PURE__ */ Ct(["edit-tile", "tile-time-range-zoom"], ["update:modelValue"]),
|
|
4202
4202
|
setup(u, { expose: e, emit: t }) {
|
|
4203
|
-
Ye((
|
|
4203
|
+
Ye((C) => ({
|
|
4204
4204
|
"82baf22a": a.value
|
|
4205
4205
|
}));
|
|
4206
|
-
const i = u, s = t, r = ui(u, "modelValue"), { i18n: o } =
|
|
4207
|
-
f || (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")),
|
|
4208
|
-
const p =
|
|
4206
|
+
const i = u, s = t, r = ui(u, "modelValue"), { i18n: o } = ye.useI18n(), n = I(0), h = I(null), l = I(), d = I(), a = I("scale(1)"), f = Ce(pe);
|
|
4207
|
+
f || (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")), ye.useRequestQueue();
|
|
4208
|
+
const p = ut(), g = D(() => i.context.timeSpec ? i.context.timeSpec : {
|
|
4209
4209
|
type: "relative",
|
|
4210
4210
|
time_range: p.defaultQueryTimeForOrg
|
|
4211
|
-
}), y =
|
|
4212
|
-
const A =
|
|
4213
|
-
return A !== 0 ? A :
|
|
4214
|
-
}, T =
|
|
4211
|
+
}), y = D(() => !!i.context.timeSpec || !p.loading), m = (C, N) => {
|
|
4212
|
+
const A = C.layout.position.row - N.layout.position.row;
|
|
4213
|
+
return A !== 0 ? A : C.layout.position.col - N.layout.position.col;
|
|
4214
|
+
}, T = D(() => r.value.tiles.map((C) => {
|
|
4215
4215
|
var A;
|
|
4216
|
-
let
|
|
4217
|
-
if ("description" in
|
|
4218
|
-
const $ = (A =
|
|
4219
|
-
const
|
|
4220
|
-
return o.te(
|
|
4216
|
+
let N = C.definition;
|
|
4217
|
+
if ("description" in N.chart) {
|
|
4218
|
+
const $ = (A = N.chart.description) == null ? void 0 : A.replace(Fi, () => {
|
|
4219
|
+
const ce = `renderer.trendRange.${g.value.type === "absolute" ? "custom" : g.value.time_range}`;
|
|
4220
|
+
return o.te(ce) ? o.t(ce) : "";
|
|
4221
4221
|
});
|
|
4222
|
-
|
|
4223
|
-
...
|
|
4222
|
+
N = {
|
|
4223
|
+
...N,
|
|
4224
4224
|
chart: {
|
|
4225
|
-
...
|
|
4225
|
+
...N.chart,
|
|
4226
4226
|
description: $
|
|
4227
4227
|
}
|
|
4228
4228
|
};
|
|
4229
4229
|
}
|
|
4230
|
-
return i.context.editable && !
|
|
4230
|
+
return i.context.editable && !C.id && console.warn(
|
|
4231
4231
|
"No id provided for tile. One will be generated automatically,",
|
|
4232
4232
|
"however tracking changes to this tile may not work as expected.",
|
|
4233
|
-
|
|
4233
|
+
C
|
|
4234
4234
|
), {
|
|
4235
|
-
layout:
|
|
4236
|
-
meta:
|
|
4237
|
-
type:
|
|
4235
|
+
layout: C.layout,
|
|
4236
|
+
meta: N,
|
|
4237
|
+
type: C.type,
|
|
4238
4238
|
// Add a unique key to each tile internally.
|
|
4239
|
-
id:
|
|
4239
|
+
id: C.id ?? crypto.randomUUID()
|
|
4240
4240
|
};
|
|
4241
|
-
})),
|
|
4242
|
-
var
|
|
4243
|
-
let { tz:
|
|
4241
|
+
})), L = D(() => {
|
|
4242
|
+
var ce, Me, Ie;
|
|
4243
|
+
let { tz: C, refreshInterval: N, editable: A } = i.context;
|
|
4244
4244
|
const $ = [...i.context.filters ?? [], ...r.value.preset_filters ?? []];
|
|
4245
|
-
if (
|
|
4245
|
+
if (C || (C = new Intl.DateTimeFormat().resolvedOptions().timeZone), N === void 0 && (N = Gi), se.value) {
|
|
4246
4246
|
let ke = !1;
|
|
4247
4247
|
if (g.value.type === "relative")
|
|
4248
4248
|
ke = ["15m", "1h", "6h", "12h", "24h"].includes(g.value.time_range);
|
|
@@ -4251,115 +4251,115 @@ const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { cl
|
|
|
4251
4251
|
ke = Math.abs(qe - et) <= 864e5;
|
|
4252
4252
|
}
|
|
4253
4253
|
const Je = (/* @__PURE__ */ new Date()).getTime();
|
|
4254
|
-
g.value.type === "absolute" && g.value.end.getTime() < Je ?
|
|
4254
|
+
g.value.type === "absolute" && g.value.end.getTime() < Je ? N = 0 : ke ? N = Ui : N = Bi;
|
|
4255
4255
|
}
|
|
4256
4256
|
A === void 0 && (A = !1);
|
|
4257
|
-
const
|
|
4257
|
+
const re = !!((Ie = (Me = (ce = ci()) == null ? void 0 : ce.vnode) == null ? void 0 : Me.props) != null && Ie.onTileTimeRangeZoom);
|
|
4258
4258
|
return {
|
|
4259
4259
|
filters: $,
|
|
4260
|
-
tz:
|
|
4260
|
+
tz: C,
|
|
4261
4261
|
timeSpec: g.value,
|
|
4262
|
-
refreshInterval:
|
|
4262
|
+
refreshInterval: N,
|
|
4263
4263
|
editable: A,
|
|
4264
|
-
zoomable:
|
|
4264
|
+
zoomable: re
|
|
4265
4265
|
};
|
|
4266
|
-
}),
|
|
4267
|
-
s("edit-tile",
|
|
4268
|
-
},
|
|
4269
|
-
const
|
|
4270
|
-
...
|
|
4271
|
-
chart_title:
|
|
4266
|
+
}), z = (C) => {
|
|
4267
|
+
s("edit-tile", C);
|
|
4268
|
+
}, x = (C) => C.type === "slottable", _ = (C) => {
|
|
4269
|
+
const N = x(C.meta.chart) ? { ...C.meta.chart } : {
|
|
4270
|
+
...C.meta.chart,
|
|
4271
|
+
chart_title: C.meta.chart.chart_title ? `Copy of ${C.meta.chart.chart_title}` : ""
|
|
4272
4272
|
}, A = {
|
|
4273
4273
|
id: crypto.randomUUID(),
|
|
4274
4274
|
type: "chart",
|
|
4275
4275
|
definition: {
|
|
4276
|
-
...
|
|
4277
|
-
chart:
|
|
4276
|
+
...C.meta,
|
|
4277
|
+
chart: N
|
|
4278
4278
|
},
|
|
4279
4279
|
layout: {
|
|
4280
4280
|
position: {
|
|
4281
4281
|
col: 0,
|
|
4282
4282
|
row: 0
|
|
4283
4283
|
},
|
|
4284
|
-
size:
|
|
4284
|
+
size: C.layout.size
|
|
4285
4285
|
}
|
|
4286
4286
|
};
|
|
4287
4287
|
r.value.tiles.push(A);
|
|
4288
|
-
},
|
|
4289
|
-
h.value && h.value.removeWidget(
|
|
4290
|
-
},
|
|
4288
|
+
}, F = (C) => {
|
|
4289
|
+
h.value && h.value.removeWidget(C.id);
|
|
4290
|
+
}, te = () => {
|
|
4291
4291
|
n.value++;
|
|
4292
|
-
},
|
|
4293
|
-
const
|
|
4292
|
+
}, ie = (C) => {
|
|
4293
|
+
const N = C.map((A) => ({
|
|
4294
4294
|
id: A.id,
|
|
4295
4295
|
type: A.type,
|
|
4296
4296
|
layout: A.layout,
|
|
4297
4297
|
definition: A.meta
|
|
4298
4298
|
}));
|
|
4299
|
-
r.value.tiles =
|
|
4300
|
-
},
|
|
4299
|
+
r.value.tiles = N.sort(m);
|
|
4300
|
+
}, me = async () => {
|
|
4301
4301
|
if (a.value = "scale(1)", await dt(), d.value) {
|
|
4302
|
-
const { availWidth:
|
|
4303
|
-
a.value = `scale(${
|
|
4302
|
+
const { availWidth: C, availHeight: N } = window.screen, { width: A, height: $ } = d.value.getBoundingClientRect(), re = Math.min(N / $, C / A);
|
|
4303
|
+
a.value = `scale(${re})`;
|
|
4304
4304
|
}
|
|
4305
4305
|
}, Re = () => {
|
|
4306
4306
|
l.value && (document.fullscreenElement ? document.exitFullscreen() : l.value.requestFullscreen());
|
|
4307
|
-
},
|
|
4308
|
-
|
|
4307
|
+
}, se = I(!1), Ze = () => {
|
|
4308
|
+
se.value = document.fullscreenElement !== null, se.value && me();
|
|
4309
4309
|
};
|
|
4310
4310
|
return e({
|
|
4311
|
-
refresh:
|
|
4311
|
+
refresh: te,
|
|
4312
4312
|
toggleFullscreen: Re
|
|
4313
|
-
}), (
|
|
4314
|
-
const A =
|
|
4315
|
-
return
|
|
4313
|
+
}), (C, N) => {
|
|
4314
|
+
const A = ge("KAlert");
|
|
4315
|
+
return k(), K("div", {
|
|
4316
4316
|
ref_key: "dashboardContainer",
|
|
4317
4317
|
ref: l,
|
|
4318
|
-
class: Qe(["kong-ui-public-dashboard-renderer", { "is-fullscreen":
|
|
4318
|
+
class: Qe(["kong-ui-public-dashboard-renderer", { "is-fullscreen": se.value }]),
|
|
4319
4319
|
onFullscreenchange: Ze
|
|
4320
4320
|
}, [
|
|
4321
|
-
|
|
4321
|
+
ue("div", {
|
|
4322
4322
|
ref_key: "layoutContainer",
|
|
4323
4323
|
ref: d,
|
|
4324
4324
|
class: "layout"
|
|
4325
4325
|
}, [
|
|
4326
|
-
|
|
4327
|
-
ze(
|
|
4328
|
-
])) :
|
|
4329
|
-
|
|
4326
|
+
R(f) && se.value ? (k(), K("div", As, [
|
|
4327
|
+
ze(C.$slots, "fullscreenHeader", {}, void 0, !0)
|
|
4328
|
+
])) : V("", !0),
|
|
4329
|
+
R(f) ? (k(), M($t(C.context.editable && !se.value ? Ls : Cs), {
|
|
4330
4330
|
key: 2,
|
|
4331
4331
|
ref_key: "gridLayoutRef",
|
|
4332
4332
|
ref: h,
|
|
4333
4333
|
"tile-height": r.value.tile_height,
|
|
4334
4334
|
tiles: T.value,
|
|
4335
|
-
onUpdateTiles:
|
|
4335
|
+
onUpdateTiles: ie
|
|
4336
4336
|
}, {
|
|
4337
4337
|
tile: P(({ tile: $ }) => [
|
|
4338
|
-
$.meta.chart.type === "slottable" ? (
|
|
4339
|
-
ze(
|
|
4340
|
-
])) : (
|
|
4341
|
-
key:
|
|
4338
|
+
$.meta.chart.type === "slottable" ? (k(), K("div", Hs, [
|
|
4339
|
+
ze(C.$slots, $.meta.chart.id, {}, void 0, !0)
|
|
4340
|
+
])) : (k(), M(ws, {
|
|
4341
|
+
key: se.value ? `${$.id}-tile` : `${$.id}-tile-fullscreen`,
|
|
4342
4342
|
class: "tile-container",
|
|
4343
|
-
context:
|
|
4343
|
+
context: L.value,
|
|
4344
4344
|
definition: $.meta,
|
|
4345
|
-
height: $.layout.size.rows * (r.value.tile_height ||
|
|
4346
|
-
"is-fullscreen":
|
|
4345
|
+
height: $.layout.size.rows * (r.value.tile_height || R(je)) + parseInt(R(ti), 10),
|
|
4346
|
+
"is-fullscreen": se.value,
|
|
4347
4347
|
"query-ready": y.value,
|
|
4348
4348
|
"refresh-counter": n.value,
|
|
4349
4349
|
"tile-id": $.id,
|
|
4350
|
-
onDuplicateTile: (
|
|
4351
|
-
onEditTile: (
|
|
4352
|
-
onRemoveTile: (
|
|
4353
|
-
onTileTimeRangeZoom:
|
|
4350
|
+
onDuplicateTile: (re) => _($),
|
|
4351
|
+
onEditTile: (re) => z($),
|
|
4352
|
+
onRemoveTile: (re) => F($),
|
|
4353
|
+
onTileTimeRangeZoom: N[0] || (N[0] = (re) => s("tile-time-range-zoom", re))
|
|
4354
4354
|
}, null, 8, ["context", "definition", "height", "is-fullscreen", "query-ready", "refresh-counter", "tile-id", "onDuplicateTile", "onEditTile", "onRemoveTile"]))
|
|
4355
4355
|
]),
|
|
4356
4356
|
_: 3
|
|
4357
|
-
}, 40, ["tile-height", "tiles"])) : (
|
|
4357
|
+
}, 40, ["tile-height", "tiles"])) : (k(), M(A, {
|
|
4358
4358
|
key: 1,
|
|
4359
4359
|
appearance: "danger"
|
|
4360
4360
|
}, {
|
|
4361
4361
|
default: P(() => [
|
|
4362
|
-
De(
|
|
4362
|
+
De(ne(R(o).t("renderer.noQueryBridge")), 1)
|
|
4363
4363
|
]),
|
|
4364
4364
|
_: 1
|
|
4365
4365
|
}))
|
|
@@ -4367,16 +4367,16 @@ const Ds = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Ss = { cl
|
|
|
4367
4367
|
], 34);
|
|
4368
4368
|
};
|
|
4369
4369
|
}
|
|
4370
|
-
}), Ks = /* @__PURE__ */
|
|
4370
|
+
}), Ks = /* @__PURE__ */ ve(Os, [["__scopeId", "data-v-8d8a6181"]]);
|
|
4371
4371
|
export {
|
|
4372
4372
|
$i as C,
|
|
4373
4373
|
Ks as D,
|
|
4374
|
-
|
|
4374
|
+
kt as E,
|
|
4375
4375
|
Ui as F,
|
|
4376
4376
|
Cs as G,
|
|
4377
|
-
|
|
4377
|
+
pe as I,
|
|
4378
4378
|
Fi as T,
|
|
4379
|
-
|
|
4379
|
+
ct as _,
|
|
4380
4380
|
je as a,
|
|
4381
4381
|
Kt as b,
|
|
4382
4382
|
Gi as c,
|