@kong-ui-public/dashboard-renderer 5.2.0 → 5.2.1
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.
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var It = Object.defineProperty;
|
|
2
|
+
var et = (u) => {
|
|
3
3
|
throw TypeError(u);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var Pt = (u, e, t) => e in u ? It(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
|
6
|
+
var tt = (u, e, t) => Pt(u, typeof e != "symbol" ? e + "" : e, t), Be = (u, e, t) => e.has(u) || et("Cannot " + t);
|
|
7
|
+
var v = (u, e, t) => (Be(u, e, "read from private field"), t ? t.call(u) : e.get(u)), M = (u, e, t) => e.has(u) ? et("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(u) : e.set(u, t), A = (u, e, t, i) => (Be(u, e, "write to private field"), i ? i.call(u, t) : e.set(u, t), t), I = (u, e, t) => (Be(u, e, "access private method"), t);
|
|
8
|
+
var be = (u, e, t, i) => ({
|
|
9
9
|
set _(s) {
|
|
10
10
|
A(u, e, s, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return
|
|
13
|
+
return v(u, e, i);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { ref as
|
|
17
|
-
import { stripUnknownFilters as
|
|
18
|
-
import { SimpleChart as
|
|
19
|
-
import
|
|
16
|
+
import { ref as F, watchEffect as pt, inject as _e, provide as qt, defineComponent as W, onUnmounted as Ue, computed as L, watch as Ge, resolveComponent as oe, unref as S, openBlock as C, createBlock as O, withCtx as P, createTextVNode as ce, toDisplayString as J, renderSlot as Ie, createCommentVNode as V, useCssVars as We, createElementVNode as fe, normalizeClass as Ve, createVNode as se, mergeProps as yt, createSlots as vt, createElementBlock as U, normalizeProps as Bt, guardReactiveProps as $t, defineAsyncComponent as Ft, onMounted as Ke, nextTick as _t, resolveDynamicComponent as wt, Fragment as bt, renderList as Et, normalizeStyle as it, mergeModels as st, useModel as Ut } from "vue";
|
|
17
|
+
import { stripUnknownFilters as Gt, Timeframe as Wt, TimePeriods as xt, TIMEFRAME_LOOKUP as Vt, formatTime as rt, msToGranularity as Kt } from "@kong-ui-public/analytics-utilities";
|
|
18
|
+
import { SimpleChart as Yt, AnalyticsChart as Xt, TopNTable as jt, CsvExportModal as Qt } from "@kong-ui-public/analytics-chart";
|
|
19
|
+
import Zt from "swrv";
|
|
20
20
|
import "axios";
|
|
21
|
-
import { createI18n as
|
|
22
|
-
import { useAnalyticsConfigStore as
|
|
23
|
-
import { MetricsProvider as
|
|
24
|
-
import { EditIcon as
|
|
25
|
-
var
|
|
26
|
-
const
|
|
21
|
+
import { createI18n as Jt, i18nTComponent as ei } from "@kong-ui-public/i18n";
|
|
22
|
+
import { useAnalyticsConfigStore as Ct } from "@kong-ui-public/analytics-config-store";
|
|
23
|
+
import { MetricsProvider as ti, MetricsConsumer as ii } from "@kong-ui-public/analytics-metric-provider";
|
|
24
|
+
import { EditIcon as si, MoreIcon as ri } from "@kong/icons";
|
|
25
|
+
var Rt = /* @__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))(Rt || {});
|
|
26
|
+
const ni = (u) => {
|
|
27
27
|
var e, t, i, s, r;
|
|
28
28
|
return u ? !!// TODO: revisit: currently only the first check ever matters?
|
|
29
29
|
((e = Object.keys(u)) != null && e.length || (t = u.data) != null && t.length || (s = (i = u.data) == null ? void 0 : i.data) != null && s.length || !((r = u.data) != null && r.data) && typeof u.data == "object" && Object.keys(u == null ? void 0 : u.data).length) : !1;
|
|
30
30
|
};
|
|
31
|
-
function
|
|
32
|
-
const s =
|
|
31
|
+
function oi(u = F({}), e, t, i = ni) {
|
|
32
|
+
const s = F(
|
|
33
33
|
"PENDING"
|
|
34
34
|
/* PENDING */
|
|
35
35
|
);
|
|
36
|
-
return
|
|
36
|
+
return pt(() => {
|
|
37
37
|
const r = i(u.value);
|
|
38
38
|
if (u.value && r && t.value) {
|
|
39
39
|
s.value = "VALIDATING_HAS_DATA";
|
|
@@ -62,10 +62,10 @@ function ri(u = U({}), e, t, i = si) {
|
|
|
62
62
|
u.value === void 0 && e && (s.value = "ERROR");
|
|
63
63
|
}), {
|
|
64
64
|
state: s,
|
|
65
|
-
swrvState:
|
|
65
|
+
swrvState: Rt
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const ai = {
|
|
69
69
|
noQueryBridge: "No query bridge provided. Unable to render dashboard.",
|
|
70
70
|
trendRange: {
|
|
71
71
|
"24h": "Last 24-Hour Summary",
|
|
@@ -75,36 +75,36 @@ const ni = {
|
|
|
75
75
|
edit: "Edit",
|
|
76
76
|
duplicateTile: "Duplicate",
|
|
77
77
|
remove: "Remove"
|
|
78
|
-
},
|
|
78
|
+
}, li = {
|
|
79
79
|
timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
|
|
80
|
-
},
|
|
80
|
+
}, hi = {
|
|
81
81
|
defaultFilename: "Chart Export",
|
|
82
82
|
exportAsCsv: "Export as CSV"
|
|
83
|
-
},
|
|
84
|
-
renderer:
|
|
85
|
-
queryDataProvider:
|
|
86
|
-
csvExport:
|
|
87
|
-
jumpToExplore:
|
|
83
|
+
}, di = "Explore", ui = {
|
|
84
|
+
renderer: ai,
|
|
85
|
+
queryDataProvider: li,
|
|
86
|
+
csvExport: hi,
|
|
87
|
+
jumpToExplore: di
|
|
88
88
|
};
|
|
89
|
-
function
|
|
90
|
-
const u =
|
|
89
|
+
function ci() {
|
|
90
|
+
const u = Jt("en-us", ui);
|
|
91
91
|
return {
|
|
92
92
|
i18n: u,
|
|
93
|
-
i18nT:
|
|
93
|
+
i18nT: ei(u)
|
|
94
94
|
// Translation component <i18n-t>
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
-
const
|
|
98
|
-
function
|
|
97
|
+
const Ye = 170, le = "analytics-query-provider", nt = "{entity-id}", fi = "{cp-id}", gi = "{timeframe}", mi = 30 * 1e3;
|
|
98
|
+
function pi() {
|
|
99
99
|
const u = _e(le);
|
|
100
100
|
return {
|
|
101
101
|
evaluateFeatureFlag: (t, i) => u ? u.evaluateFeatureFlagFn(t, i) : i
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function yi(u) {
|
|
105
105
|
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
106
106
|
}
|
|
107
|
-
var
|
|
107
|
+
var Tt = { exports: {} };
|
|
108
108
|
(function(u) {
|
|
109
109
|
var e = Object.prototype.hasOwnProperty, t = "~";
|
|
110
110
|
function i() {
|
|
@@ -116,8 +116,8 @@ var Rt = { exports: {} };
|
|
|
116
116
|
function r(d, h, a, l, f) {
|
|
117
117
|
if (typeof a != "function")
|
|
118
118
|
throw new TypeError("The listener must be a function");
|
|
119
|
-
var
|
|
120
|
-
return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p],
|
|
119
|
+
var g = new s(a, l || d, f), p = t ? t + h : h;
|
|
120
|
+
return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p], g] : d._events[p].push(g) : (d._events[p] = g, d._eventsCount++), d;
|
|
121
121
|
}
|
|
122
122
|
function o(d, h) {
|
|
123
123
|
--d._eventsCount === 0 ? d._events = new i() : delete d._events[h];
|
|
@@ -135,54 +135,54 @@ var Rt = { exports: {} };
|
|
|
135
135
|
var a = t ? t + h : h, l = this._events[a];
|
|
136
136
|
if (!l) return [];
|
|
137
137
|
if (l.fn) return [l.fn];
|
|
138
|
-
for (var f = 0,
|
|
138
|
+
for (var f = 0, g = l.length, p = new Array(g); f < g; f++)
|
|
139
139
|
p[f] = l[f].fn;
|
|
140
140
|
return p;
|
|
141
141
|
}, n.prototype.listenerCount = function(h) {
|
|
142
142
|
var a = t ? t + h : h, l = this._events[a];
|
|
143
143
|
return l ? l.fn ? 1 : l.length : 0;
|
|
144
|
-
}, n.prototype.emit = function(h, a, l, f,
|
|
144
|
+
}, n.prototype.emit = function(h, a, l, f, g, p) {
|
|
145
145
|
var y = t ? t + h : h;
|
|
146
146
|
if (!this._events[y]) return !1;
|
|
147
|
-
var
|
|
148
|
-
if (
|
|
149
|
-
switch (
|
|
147
|
+
var m = this._events[y], E = arguments.length, N, R;
|
|
148
|
+
if (m.fn) {
|
|
149
|
+
switch (m.once && this.removeListener(h, m.fn, void 0, !0), E) {
|
|
150
150
|
case 1:
|
|
151
|
-
return
|
|
151
|
+
return m.fn.call(m.context), !0;
|
|
152
152
|
case 2:
|
|
153
|
-
return
|
|
153
|
+
return m.fn.call(m.context, a), !0;
|
|
154
154
|
case 3:
|
|
155
|
-
return
|
|
155
|
+
return m.fn.call(m.context, a, l), !0;
|
|
156
156
|
case 4:
|
|
157
|
-
return
|
|
157
|
+
return m.fn.call(m.context, a, l, f), !0;
|
|
158
158
|
case 5:
|
|
159
|
-
return
|
|
159
|
+
return m.fn.call(m.context, a, l, f, g), !0;
|
|
160
160
|
case 6:
|
|
161
|
-
return
|
|
161
|
+
return m.fn.call(m.context, a, l, f, g, p), !0;
|
|
162
162
|
}
|
|
163
|
-
for (
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
for (R = 1, N = new Array(E - 1); R < E; R++)
|
|
164
|
+
N[R - 1] = arguments[R];
|
|
165
|
+
m.fn.apply(m.context, N);
|
|
166
166
|
} else {
|
|
167
|
-
var
|
|
168
|
-
for (
|
|
169
|
-
switch (
|
|
167
|
+
var H = m.length, z;
|
|
168
|
+
for (R = 0; R < H; R++)
|
|
169
|
+
switch (m[R].once && this.removeListener(h, m[R].fn, void 0, !0), E) {
|
|
170
170
|
case 1:
|
|
171
|
-
|
|
171
|
+
m[R].fn.call(m[R].context);
|
|
172
172
|
break;
|
|
173
173
|
case 2:
|
|
174
|
-
|
|
174
|
+
m[R].fn.call(m[R].context, a);
|
|
175
175
|
break;
|
|
176
176
|
case 3:
|
|
177
|
-
|
|
177
|
+
m[R].fn.call(m[R].context, a, l);
|
|
178
178
|
break;
|
|
179
179
|
case 4:
|
|
180
|
-
|
|
180
|
+
m[R].fn.call(m[R].context, a, l, f);
|
|
181
181
|
break;
|
|
182
182
|
default:
|
|
183
|
-
if (!
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
if (!N) for (z = 1, N = new Array(E - 1); z < E; z++)
|
|
184
|
+
N[z - 1] = arguments[z];
|
|
185
|
+
m[R].fn.apply(m[R].context, N);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
return !0;
|
|
@@ -191,41 +191,41 @@ var Rt = { exports: {} };
|
|
|
191
191
|
}, n.prototype.once = function(h, a, l) {
|
|
192
192
|
return r(this, h, a, l, !0);
|
|
193
193
|
}, n.prototype.removeListener = function(h, a, l, f) {
|
|
194
|
-
var
|
|
195
|
-
if (!this._events[
|
|
194
|
+
var g = t ? t + h : h;
|
|
195
|
+
if (!this._events[g]) return this;
|
|
196
196
|
if (!a)
|
|
197
|
-
return o(this,
|
|
198
|
-
var p = this._events[
|
|
197
|
+
return o(this, g), this;
|
|
198
|
+
var p = this._events[g];
|
|
199
199
|
if (p.fn)
|
|
200
|
-
p.fn === a && (!f || p.once) && (!l || p.context === l) && o(this,
|
|
200
|
+
p.fn === a && (!f || p.once) && (!l || p.context === l) && o(this, g);
|
|
201
201
|
else {
|
|
202
|
-
for (var y = 0,
|
|
203
|
-
(p[y].fn !== a || f && !p[y].once || l && p[y].context !== l) &&
|
|
204
|
-
|
|
202
|
+
for (var y = 0, m = [], E = p.length; y < E; y++)
|
|
203
|
+
(p[y].fn !== a || f && !p[y].once || l && p[y].context !== l) && m.push(p[y]);
|
|
204
|
+
m.length ? this._events[g] = m.length === 1 ? m[0] : m : o(this, g);
|
|
205
205
|
}
|
|
206
206
|
return this;
|
|
207
207
|
}, n.prototype.removeAllListeners = function(h) {
|
|
208
208
|
var a;
|
|
209
209
|
return h ? (a = t ? t + h : h, this._events[a] && o(this, a)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
210
210
|
}, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n, u.exports = n;
|
|
211
|
-
})(
|
|
212
|
-
var
|
|
213
|
-
const
|
|
214
|
-
class
|
|
211
|
+
})(Tt);
|
|
212
|
+
var vi = Tt.exports;
|
|
213
|
+
const _i = /* @__PURE__ */ yi(vi);
|
|
214
|
+
class zt extends Error {
|
|
215
215
|
constructor(e) {
|
|
216
216
|
super(e), this.name = "TimeoutError";
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
class
|
|
219
|
+
class wi extends Error {
|
|
220
220
|
constructor(e) {
|
|
221
221
|
super(), this.name = "AbortError", this.message = e;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
const
|
|
225
|
-
const e = u.reason === void 0 ?
|
|
226
|
-
return e instanceof Error ? e :
|
|
224
|
+
const ot = (u) => globalThis.DOMException === void 0 ? new wi(u) : new DOMException(u), at = (u) => {
|
|
225
|
+
const e = u.reason === void 0 ? ot("This operation was aborted.") : u.reason;
|
|
226
|
+
return e instanceof Error ? e : ot(e);
|
|
227
227
|
};
|
|
228
|
-
function
|
|
228
|
+
function bi(u, e) {
|
|
229
229
|
const {
|
|
230
230
|
milliseconds: t,
|
|
231
231
|
fallback: i,
|
|
@@ -237,22 +237,22 @@ function _i(u, e) {
|
|
|
237
237
|
if (typeof t != "number" || Math.sign(t) !== 1)
|
|
238
238
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
239
239
|
if (e.signal) {
|
|
240
|
-
const { signal:
|
|
241
|
-
|
|
242
|
-
l(
|
|
243
|
-
},
|
|
240
|
+
const { signal: g } = e;
|
|
241
|
+
g.aborted && l(at(g)), n = () => {
|
|
242
|
+
l(at(g));
|
|
243
|
+
}, g.addEventListener("abort", n, { once: !0 });
|
|
244
244
|
}
|
|
245
245
|
if (t === Number.POSITIVE_INFINITY) {
|
|
246
246
|
u.then(a, l);
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
|
-
const f = new
|
|
249
|
+
const f = new zt();
|
|
250
250
|
o = r.setTimeout.call(void 0, () => {
|
|
251
251
|
if (i) {
|
|
252
252
|
try {
|
|
253
253
|
a(i());
|
|
254
|
-
} catch (
|
|
255
|
-
l(
|
|
254
|
+
} catch (g) {
|
|
255
|
+
l(g);
|
|
256
256
|
}
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
@@ -260,8 +260,8 @@ function _i(u, e) {
|
|
|
260
260
|
}, t), (async () => {
|
|
261
261
|
try {
|
|
262
262
|
a(await u);
|
|
263
|
-
} catch (
|
|
264
|
-
l(
|
|
263
|
+
} catch (g) {
|
|
264
|
+
l(g);
|
|
265
265
|
}
|
|
266
266
|
})();
|
|
267
267
|
}).finally(() => {
|
|
@@ -271,7 +271,7 @@ function _i(u, e) {
|
|
|
271
271
|
r.clearTimeout.call(void 0, o), o = void 0;
|
|
272
272
|
}, h;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function Ei(u, e, t) {
|
|
275
275
|
let i = 0, s = u.length;
|
|
276
276
|
for (; s > 0; ) {
|
|
277
277
|
const r = Math.trunc(s / 2);
|
|
@@ -281,7 +281,7 @@ function wi(u, e, t) {
|
|
|
281
281
|
return i;
|
|
282
282
|
}
|
|
283
283
|
var K;
|
|
284
|
-
class
|
|
284
|
+
class xi {
|
|
285
285
|
constructor() {
|
|
286
286
|
M(this, K, []);
|
|
287
287
|
}
|
|
@@ -295,83 +295,83 @@ class bi {
|
|
|
295
295
|
id: t.id,
|
|
296
296
|
run: e
|
|
297
297
|
};
|
|
298
|
-
if (this.size === 0 ||
|
|
299
|
-
|
|
298
|
+
if (this.size === 0 || v(this, K)[this.size - 1].priority >= t.priority) {
|
|
299
|
+
v(this, K).push(i);
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
const s =
|
|
303
|
-
|
|
302
|
+
const s = Ei(v(this, K), i, (r, o) => o.priority - r.priority);
|
|
303
|
+
v(this, K).splice(s, 0, i);
|
|
304
304
|
}
|
|
305
305
|
setPriority(e, t) {
|
|
306
|
-
const i =
|
|
306
|
+
const i = v(this, K).findIndex((r) => r.id === e);
|
|
307
307
|
if (i === -1)
|
|
308
308
|
throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
|
|
309
|
-
const [s] =
|
|
309
|
+
const [s] = v(this, K).splice(i, 1);
|
|
310
310
|
this.enqueue(s.run, { priority: t, id: e });
|
|
311
311
|
}
|
|
312
312
|
dequeue() {
|
|
313
|
-
const e =
|
|
313
|
+
const e = v(this, K).shift();
|
|
314
314
|
return e == null ? void 0 : e.run;
|
|
315
315
|
}
|
|
316
316
|
filter(e) {
|
|
317
|
-
return
|
|
317
|
+
return v(this, K).filter((t) => t.priority === e.priority).map((t) => t.run);
|
|
318
318
|
}
|
|
319
319
|
get size() {
|
|
320
|
-
return
|
|
320
|
+
return v(this, K).length;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
K = new WeakMap();
|
|
324
|
-
var
|
|
325
|
-
class
|
|
324
|
+
var ge, me, ne, Ce, pe, Re, Y, ye, B, Te, X, ve, ie, ze, Me, T, Dt, St, kt, Nt, At, De, $e, Fe, Se, Ht, ke;
|
|
325
|
+
class Ci extends _i {
|
|
326
326
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
327
327
|
constructor(t) {
|
|
328
328
|
var i, s;
|
|
329
329
|
super();
|
|
330
330
|
M(this, T);
|
|
331
|
-
M(this, fe);
|
|
332
331
|
M(this, ge);
|
|
333
|
-
M(this, ne, 0);
|
|
334
|
-
M(this, xe);
|
|
335
332
|
M(this, me);
|
|
336
|
-
M(this,
|
|
337
|
-
M(this,
|
|
333
|
+
M(this, ne, 0);
|
|
334
|
+
M(this, Ce);
|
|
338
335
|
M(this, pe);
|
|
339
|
-
M(this,
|
|
340
|
-
M(this,
|
|
336
|
+
M(this, Re, 0);
|
|
337
|
+
M(this, Y);
|
|
338
|
+
M(this, ye);
|
|
339
|
+
M(this, B);
|
|
340
|
+
M(this, Te);
|
|
341
341
|
M(this, X, 0);
|
|
342
342
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
343
|
-
M(this,
|
|
343
|
+
M(this, ve);
|
|
344
344
|
M(this, ie);
|
|
345
|
-
M(this,
|
|
345
|
+
M(this, ze);
|
|
346
346
|
// Use to assign a unique identifier to a promise function, if not explicitly specified
|
|
347
|
-
M(this,
|
|
347
|
+
M(this, Me, 1n);
|
|
348
348
|
/**
|
|
349
349
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
350
350
|
|
|
351
351
|
Applies to each future operation.
|
|
352
352
|
*/
|
|
353
|
-
|
|
353
|
+
tt(this, "timeout");
|
|
354
354
|
if (t = {
|
|
355
355
|
carryoverConcurrencyCount: !1,
|
|
356
356
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
357
357
|
interval: 0,
|
|
358
358
|
concurrency: Number.POSITIVE_INFINITY,
|
|
359
359
|
autoStart: !0,
|
|
360
|
-
queueClass:
|
|
360
|
+
queueClass: xi,
|
|
361
361
|
...t
|
|
362
362
|
}, !(typeof t.intervalCap == "number" && t.intervalCap >= 1))
|
|
363
363
|
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})`);
|
|
364
364
|
if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
|
|
365
365
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s = t.interval) == null ? void 0 : s.toString()) ?? ""}\` (${typeof t.interval})`);
|
|
366
|
-
A(this,
|
|
366
|
+
A(this, ge, t.carryoverConcurrencyCount), A(this, me, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), A(this, Ce, t.intervalCap), A(this, pe, t.interval), A(this, B, new t.queueClass()), A(this, Te, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, A(this, ze, t.throwOnTimeout === !0), A(this, ie, t.autoStart === !1);
|
|
367
367
|
}
|
|
368
368
|
get concurrency() {
|
|
369
|
-
return
|
|
369
|
+
return v(this, ve);
|
|
370
370
|
}
|
|
371
371
|
set concurrency(t) {
|
|
372
372
|
if (!(typeof t == "number" && t >= 1))
|
|
373
373
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
|
|
374
|
-
A(this,
|
|
374
|
+
A(this, ve, t), I(this, T, Se).call(this);
|
|
375
375
|
}
|
|
376
376
|
/**
|
|
377
377
|
Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
|
|
@@ -410,33 +410,33 @@ class Ei extends yi {
|
|
|
410
410
|
Here, the promise function with `id: '🦀'` executes last.
|
|
411
411
|
*/
|
|
412
412
|
setPriority(t, i) {
|
|
413
|
-
|
|
413
|
+
v(this, B).setPriority(t, i);
|
|
414
414
|
}
|
|
415
415
|
async add(t, i = {}) {
|
|
416
|
-
return i.id ?? (i.id = (
|
|
416
|
+
return i.id ?? (i.id = (be(this, Me)._++).toString()), i = {
|
|
417
417
|
timeout: this.timeout,
|
|
418
|
-
throwOnTimeout:
|
|
418
|
+
throwOnTimeout: v(this, ze),
|
|
419
419
|
...i
|
|
420
420
|
}, new Promise((s, r) => {
|
|
421
|
-
|
|
421
|
+
v(this, B).enqueue(async () => {
|
|
422
422
|
var o;
|
|
423
|
-
|
|
423
|
+
be(this, X)._++, be(this, ne)._++;
|
|
424
424
|
try {
|
|
425
425
|
(o = i.signal) == null || o.throwIfAborted();
|
|
426
426
|
let n = t({ signal: i.signal });
|
|
427
|
-
i.timeout && (n =
|
|
427
|
+
i.timeout && (n = bi(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, I(this, T, Ht).call(this, i.signal)]));
|
|
428
428
|
const d = await n;
|
|
429
429
|
s(d), this.emit("completed", d);
|
|
430
430
|
} catch (n) {
|
|
431
|
-
if (n instanceof
|
|
431
|
+
if (n instanceof zt && !i.throwOnTimeout) {
|
|
432
432
|
s();
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
435
|
r(n), this.emit("error", n);
|
|
436
436
|
} finally {
|
|
437
|
-
I(this, T,
|
|
437
|
+
I(this, T, kt).call(this);
|
|
438
438
|
}
|
|
439
|
-
}, i), this.emit("add"), I(this, T,
|
|
439
|
+
}, i), this.emit("add"), I(this, T, De).call(this);
|
|
440
440
|
});
|
|
441
441
|
}
|
|
442
442
|
async addAll(t, i) {
|
|
@@ -446,7 +446,7 @@ class Ei extends yi {
|
|
|
446
446
|
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.)
|
|
447
447
|
*/
|
|
448
448
|
start() {
|
|
449
|
-
return
|
|
449
|
+
return v(this, ie) ? (A(this, ie, !1), I(this, T, Se).call(this), this) : this;
|
|
450
450
|
}
|
|
451
451
|
/**
|
|
452
452
|
Put queue execution on hold.
|
|
@@ -458,7 +458,7 @@ class Ei extends yi {
|
|
|
458
458
|
Clear the queue.
|
|
459
459
|
*/
|
|
460
460
|
clear() {
|
|
461
|
-
A(this,
|
|
461
|
+
A(this, B, new (v(this, Te))());
|
|
462
462
|
}
|
|
463
463
|
/**
|
|
464
464
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -466,7 +466,7 @@ class Ei extends yi {
|
|
|
466
466
|
@returns A promise that settles when the queue becomes empty.
|
|
467
467
|
*/
|
|
468
468
|
async onEmpty() {
|
|
469
|
-
|
|
469
|
+
v(this, B).size !== 0 && await I(this, T, ke).call(this, "empty");
|
|
470
470
|
}
|
|
471
471
|
/**
|
|
472
472
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -476,7 +476,7 @@ class Ei extends yi {
|
|
|
476
476
|
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.
|
|
477
477
|
*/
|
|
478
478
|
async onSizeLessThan(t) {
|
|
479
|
-
|
|
479
|
+
v(this, B).size < t || await I(this, T, ke).call(this, "next", () => v(this, B).size < t);
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
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.
|
|
@@ -484,13 +484,13 @@ class Ei extends yi {
|
|
|
484
484
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
485
485
|
*/
|
|
486
486
|
async onIdle() {
|
|
487
|
-
|
|
487
|
+
v(this, X) === 0 && v(this, B).size === 0 || await I(this, T, ke).call(this, "idle");
|
|
488
488
|
}
|
|
489
489
|
/**
|
|
490
490
|
Size of the queue, the number of queued items waiting to run.
|
|
491
491
|
*/
|
|
492
492
|
get size() {
|
|
493
|
-
return
|
|
493
|
+
return v(this, B).size;
|
|
494
494
|
}
|
|
495
495
|
/**
|
|
496
496
|
Size of the queue, filtered by the given options.
|
|
@@ -498,71 +498,71 @@ class Ei extends yi {
|
|
|
498
498
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
499
499
|
*/
|
|
500
500
|
sizeBy(t) {
|
|
501
|
-
return
|
|
501
|
+
return v(this, B).filter(t).length;
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
504
504
|
Number of running items (no longer in the queue).
|
|
505
505
|
*/
|
|
506
506
|
get pending() {
|
|
507
|
-
return
|
|
507
|
+
return v(this, X);
|
|
508
508
|
}
|
|
509
509
|
/**
|
|
510
510
|
Whether the queue is currently paused.
|
|
511
511
|
*/
|
|
512
512
|
get isPaused() {
|
|
513
|
-
return
|
|
513
|
+
return v(this, ie);
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
|
-
|
|
517
|
-
return
|
|
518
|
-
}, Dt = function() {
|
|
519
|
-
return _(this, X) < _(this, ye);
|
|
516
|
+
ge = new WeakMap(), me = new WeakMap(), ne = new WeakMap(), Ce = new WeakMap(), pe = new WeakMap(), Re = new WeakMap(), Y = new WeakMap(), ye = new WeakMap(), B = new WeakMap(), Te = new WeakMap(), X = new WeakMap(), ve = new WeakMap(), ie = new WeakMap(), ze = new WeakMap(), Me = new WeakMap(), T = new WeakSet(), Dt = function() {
|
|
517
|
+
return v(this, me) || v(this, ne) < v(this, Ce);
|
|
520
518
|
}, St = function() {
|
|
521
|
-
|
|
519
|
+
return v(this, X) < v(this, ve);
|
|
522
520
|
}, kt = function() {
|
|
523
|
-
|
|
521
|
+
be(this, X)._--, I(this, T, De).call(this), this.emit("next");
|
|
524
522
|
}, Nt = function() {
|
|
523
|
+
I(this, T, Fe).call(this), I(this, T, $e).call(this), A(this, ye, void 0);
|
|
524
|
+
}, At = function() {
|
|
525
525
|
const t = Date.now();
|
|
526
|
-
if (
|
|
527
|
-
const i =
|
|
526
|
+
if (v(this, Y) === void 0) {
|
|
527
|
+
const i = v(this, Re) - t;
|
|
528
528
|
if (i < 0)
|
|
529
|
-
A(this, ne,
|
|
529
|
+
A(this, ne, v(this, ge) ? v(this, X) : 0);
|
|
530
530
|
else
|
|
531
|
-
return
|
|
532
|
-
I(this, T,
|
|
531
|
+
return v(this, ye) === void 0 && A(this, ye, setTimeout(() => {
|
|
532
|
+
I(this, T, Nt).call(this);
|
|
533
533
|
}, i)), !0;
|
|
534
534
|
}
|
|
535
535
|
return !1;
|
|
536
|
-
},
|
|
537
|
-
if (
|
|
538
|
-
return
|
|
539
|
-
if (!
|
|
540
|
-
const t = !
|
|
541
|
-
if (
|
|
542
|
-
const i =
|
|
543
|
-
return i ? (this.emit("active"), i(), t && I(this, T,
|
|
536
|
+
}, De = function() {
|
|
537
|
+
if (v(this, B).size === 0)
|
|
538
|
+
return v(this, Y) && clearInterval(v(this, Y)), A(this, Y, void 0), this.emit("empty"), v(this, X) === 0 && this.emit("idle"), !1;
|
|
539
|
+
if (!v(this, ie)) {
|
|
540
|
+
const t = !v(this, T, At);
|
|
541
|
+
if (v(this, T, Dt) && v(this, T, St)) {
|
|
542
|
+
const i = v(this, B).dequeue();
|
|
543
|
+
return i ? (this.emit("active"), i(), t && I(this, T, $e).call(this), !0) : !1;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
546
|
return !1;
|
|
547
|
-
}, Be = function() {
|
|
548
|
-
_(this, ge) || _(this, Y) !== void 0 || (A(this, Y, setInterval(() => {
|
|
549
|
-
I(this, T, $e).call(this);
|
|
550
|
-
}, _(this, me))), A(this, Ce, Date.now() + _(this, me)));
|
|
551
547
|
}, $e = function() {
|
|
552
|
-
|
|
548
|
+
v(this, me) || v(this, Y) !== void 0 || (A(this, Y, setInterval(() => {
|
|
549
|
+
I(this, T, Fe).call(this);
|
|
550
|
+
}, v(this, pe))), A(this, Re, Date.now() + v(this, pe)));
|
|
551
|
+
}, Fe = function() {
|
|
552
|
+
v(this, ne) === 0 && v(this, X) === 0 && v(this, Y) && (clearInterval(v(this, Y)), A(this, Y, void 0)), A(this, ne, v(this, ge) ? v(this, X) : 0), I(this, T, Se).call(this);
|
|
553
553
|
}, /**
|
|
554
554
|
Executes all queued functions until it reaches the limit.
|
|
555
555
|
*/
|
|
556
|
-
|
|
557
|
-
for (; I(this, T,
|
|
556
|
+
Se = function() {
|
|
557
|
+
for (; I(this, T, De).call(this); )
|
|
558
558
|
;
|
|
559
|
-
},
|
|
559
|
+
}, Ht = async function(t) {
|
|
560
560
|
return new Promise((i, s) => {
|
|
561
561
|
t.addEventListener("abort", () => {
|
|
562
562
|
s(t.reason);
|
|
563
563
|
}, { once: !0 });
|
|
564
564
|
});
|
|
565
|
-
},
|
|
565
|
+
}, ke = async function(t, i) {
|
|
566
566
|
return new Promise((s) => {
|
|
567
567
|
const r = () => {
|
|
568
568
|
i && !i() || (this.off(t, r), s());
|
|
@@ -570,15 +570,15 @@ De = function() {
|
|
|
570
570
|
this.on(t, r);
|
|
571
571
|
});
|
|
572
572
|
};
|
|
573
|
-
const
|
|
574
|
-
const u =
|
|
573
|
+
const Ri = () => {
|
|
574
|
+
const u = Ct(), e = _e(le);
|
|
575
575
|
if (!e)
|
|
576
576
|
return;
|
|
577
577
|
if (e.queryFnOverride) {
|
|
578
578
|
console.warn("Detected incorrect use of useRequestQueue. This composable should not be used in nested components. Please discuss with team-data or report an issue if you feel you have a use case.");
|
|
579
579
|
return;
|
|
580
580
|
}
|
|
581
|
-
const t = new
|
|
581
|
+
const t = new Ci({
|
|
582
582
|
carryoverConcurrencyCount: !0,
|
|
583
583
|
concurrency: u.maxParallelRequests,
|
|
584
584
|
interval: u.requestInterval,
|
|
@@ -588,12 +588,12 @@ const xi = () => {
|
|
|
588
588
|
queryFnOverride: !0,
|
|
589
589
|
queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
|
|
590
590
|
};
|
|
591
|
-
|
|
592
|
-
},
|
|
593
|
-
useI18n:
|
|
594
|
-
useEvaluateFeatureFlag:
|
|
595
|
-
useRequestQueue:
|
|
596
|
-
},
|
|
591
|
+
qt(le, i);
|
|
592
|
+
}, he = {
|
|
593
|
+
useI18n: ci,
|
|
594
|
+
useEvaluateFeatureFlag: pi,
|
|
595
|
+
useRequestQueue: Ri
|
|
596
|
+
}, Xe = /* @__PURE__ */ W({
|
|
597
597
|
__name: "QueryDataProvider",
|
|
598
598
|
props: {
|
|
599
599
|
context: {},
|
|
@@ -603,73 +603,73 @@ const xi = () => {
|
|
|
603
603
|
},
|
|
604
604
|
emits: ["chart-data", "queryComplete"],
|
|
605
605
|
setup(u, { emit: e }) {
|
|
606
|
-
const t = u, i = e, { i18n: s } =
|
|
606
|
+
const t = u, i = e, { i18n: s } = he.useI18n(), r = _e(le), o = () => t.queryReady && r ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, n = new AbortController();
|
|
607
607
|
Ue(() => {
|
|
608
608
|
n.abort();
|
|
609
609
|
});
|
|
610
|
-
const d = (
|
|
611
|
-
const
|
|
612
|
-
return
|
|
613
|
-
}, { data: h, error: a, isValidating: l } =
|
|
614
|
-
var
|
|
610
|
+
const d = (E, N, R) => {
|
|
611
|
+
const H = [];
|
|
612
|
+
return N && H.push(...N), H.push(...Gt(E, R)), H;
|
|
613
|
+
}, { data: h, error: a, isValidating: l } = Zt(o, async () => {
|
|
614
|
+
var E, N, R, H;
|
|
615
615
|
try {
|
|
616
616
|
let {
|
|
617
|
-
datasource:
|
|
617
|
+
datasource: z,
|
|
618
618
|
...x
|
|
619
619
|
} = t.query;
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
let
|
|
623
|
-
|
|
624
|
-
...
|
|
620
|
+
z || (z = "basic");
|
|
621
|
+
const k = d(z, t.query.filters, t.context.filters);
|
|
622
|
+
let D = t.query.time_range;
|
|
623
|
+
D ? D.tz || (D = {
|
|
624
|
+
...D,
|
|
625
625
|
tz: t.context.tz
|
|
626
|
-
}) :
|
|
626
|
+
}) : D = {
|
|
627
627
|
...t.context.timeSpec,
|
|
628
628
|
tz: t.context.tz
|
|
629
629
|
};
|
|
630
|
-
const
|
|
631
|
-
datasource:
|
|
630
|
+
const $ = {
|
|
631
|
+
datasource: z,
|
|
632
632
|
query: {
|
|
633
633
|
...x,
|
|
634
|
-
time_range:
|
|
635
|
-
filters:
|
|
634
|
+
time_range: D,
|
|
635
|
+
filters: k
|
|
636
636
|
}
|
|
637
637
|
};
|
|
638
|
-
return r == null ? void 0 : r.queryFn(
|
|
639
|
-
} catch (
|
|
640
|
-
p.value = ((
|
|
638
|
+
return r == null ? void 0 : r.queryFn($, n);
|
|
639
|
+
} catch (z) {
|
|
640
|
+
p.value = ((N = (E = z == null ? void 0 : z.response) == null ? void 0 : E.data) == null ? void 0 : N.message) === "Range not allowed for this tier" ? s.t("queryDataProvider.timeRangeExceeded") : ((H = (R = z == null ? void 0 : z.response) == null ? void 0 : R.data) == null ? void 0 : H.message) || (z == null ? void 0 : z.message);
|
|
641
641
|
} finally {
|
|
642
642
|
i("queryComplete");
|
|
643
643
|
}
|
|
644
644
|
}, {
|
|
645
645
|
refreshInterval: t.context.refreshInterval,
|
|
646
646
|
revalidateOnFocus: !1
|
|
647
|
-
}), { state: f, swrvState:
|
|
648
|
-
return
|
|
649
|
-
|
|
650
|
-
}), (
|
|
651
|
-
const
|
|
652
|
-
return
|
|
647
|
+
}), { state: f, swrvState: g } = oi(h, a, l), p = F(null), y = L(() => f.value === g.ERROR || !!p.value), m = L(() => !t.queryReady || f.value === g.PENDING);
|
|
648
|
+
return Ge(h, (E) => {
|
|
649
|
+
E && i("chart-data", E);
|
|
650
|
+
}), (E, N) => {
|
|
651
|
+
const R = oe("KSkeleton"), H = oe("KEmptyState");
|
|
652
|
+
return m.value || !S(h) && !y.value ? (C(), O(R, {
|
|
653
653
|
key: 0,
|
|
654
654
|
class: "chart-skeleton",
|
|
655
655
|
type: "table"
|
|
656
|
-
})) : y.value ? (C(), H
|
|
656
|
+
})) : y.value ? (C(), O(H, {
|
|
657
657
|
key: 1,
|
|
658
658
|
"action-button-visible": !1,
|
|
659
659
|
"data-testid": "chart-empty-state",
|
|
660
660
|
"icon-variant": "error"
|
|
661
661
|
}, {
|
|
662
662
|
default: P(() => [
|
|
663
|
-
|
|
663
|
+
ce(J(p.value), 1)
|
|
664
664
|
]),
|
|
665
665
|
_: 1
|
|
666
|
-
})) : S(h) ?
|
|
666
|
+
})) : S(h) ? Ie(E.$slots, "default", {
|
|
667
667
|
key: 2,
|
|
668
668
|
data: S(h)
|
|
669
669
|
}) : V("", !0);
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
|
-
}),
|
|
672
|
+
}), Ti = /* @__PURE__ */ W({
|
|
673
673
|
__name: "SimpleChartRenderer",
|
|
674
674
|
props: {
|
|
675
675
|
query: {},
|
|
@@ -680,21 +680,21 @@ const xi = () => {
|
|
|
680
680
|
refreshCounter: {}
|
|
681
681
|
},
|
|
682
682
|
setup(u) {
|
|
683
|
-
|
|
683
|
+
We((i) => ({
|
|
684
684
|
"35a26ebf": `${i.height}px`
|
|
685
685
|
}));
|
|
686
|
-
const e = u, t =
|
|
687
|
-
return (i, s) => (C(),
|
|
686
|
+
const e = u, t = L(() => e.chartOptions.type === "single_value");
|
|
687
|
+
return (i, s) => (C(), O(Xe, {
|
|
688
688
|
context: i.context,
|
|
689
689
|
query: i.query,
|
|
690
690
|
"query-ready": i.queryReady,
|
|
691
691
|
"refresh-counter": i.refreshCounter
|
|
692
692
|
}, {
|
|
693
693
|
default: P(({ data: r }) => [
|
|
694
|
-
|
|
695
|
-
class:
|
|
694
|
+
fe("div", {
|
|
695
|
+
class: Ve(["analytics-chart", { "single-value": t.value }])
|
|
696
696
|
}, [
|
|
697
|
-
se(S(
|
|
697
|
+
se(S(Yt), {
|
|
698
698
|
"chart-data": r,
|
|
699
699
|
"chart-options": i.chartOptions,
|
|
700
700
|
"synthetics-data-key": t.value ? void 0 : i.chartOptions.syntheticsDataKey
|
|
@@ -704,12 +704,12 @@ const xi = () => {
|
|
|
704
704
|
_: 1
|
|
705
705
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
706
706
|
}
|
|
707
|
-
}),
|
|
707
|
+
}), de = (u, e) => {
|
|
708
708
|
const t = u.__vccOpts || u;
|
|
709
709
|
for (const [i, s] of e)
|
|
710
710
|
t[i] = s;
|
|
711
711
|
return t;
|
|
712
|
-
},
|
|
712
|
+
}, lt = /* @__PURE__ */ de(Ti, [["__scopeId", "data-v-65cc8607"]]), zi = { class: "analytics-chart" }, Di = /* @__PURE__ */ W({
|
|
713
713
|
__name: "BaseAnalyticsChartRenderer",
|
|
714
714
|
props: {
|
|
715
715
|
query: {},
|
|
@@ -722,7 +722,7 @@ const xi = () => {
|
|
|
722
722
|
},
|
|
723
723
|
emits: ["edit-tile", "chart-data", "zoom-time-range"],
|
|
724
724
|
setup(u, { emit: e }) {
|
|
725
|
-
const t = u, i = e, { i18n: s } =
|
|
725
|
+
const t = u, i = e, { i18n: s } = he.useI18n(), { evaluateFeatureFlag: r } = he.useEvaluateFeatureFlag(), o = r("explore-v4-fine-granularity", !1), n = L(() => ({
|
|
726
726
|
type: t.chartOptions.type,
|
|
727
727
|
stacked: t.chartOptions.stacked ?? !1,
|
|
728
728
|
chartDatasetColors: t.chartOptions.chartDatasetColors,
|
|
@@ -734,18 +734,18 @@ const xi = () => {
|
|
|
734
734
|
};
|
|
735
735
|
return (a, l) => {
|
|
736
736
|
const f = oe("KDropdownItem");
|
|
737
|
-
return C(),
|
|
737
|
+
return C(), O(Xe, {
|
|
738
738
|
context: a.context,
|
|
739
739
|
query: a.query,
|
|
740
740
|
"query-ready": a.queryReady,
|
|
741
741
|
"refresh-counter": a.refreshCounter,
|
|
742
742
|
onChartData: h
|
|
743
743
|
}, {
|
|
744
|
-
default: P(({ data:
|
|
745
|
-
|
|
746
|
-
se(S(
|
|
744
|
+
default: P(({ data: g }) => [
|
|
745
|
+
fe("div", zi, [
|
|
746
|
+
se(S(Xt), yt({
|
|
747
747
|
"allow-csv-export": a.chartOptions.allowCsvExport,
|
|
748
|
-
"chart-data":
|
|
748
|
+
"chart-data": g,
|
|
749
749
|
"chart-options": n.value,
|
|
750
750
|
"legend-position": "bottom",
|
|
751
751
|
"show-menu": a.context.editable,
|
|
@@ -754,13 +754,13 @@ const xi = () => {
|
|
|
754
754
|
"tooltip-title": ""
|
|
755
755
|
}, a.extraProps, {
|
|
756
756
|
onZoomTimeRange: l[0] || (l[0] = (p) => i("zoom-time-range", p))
|
|
757
|
-
}),
|
|
757
|
+
}), vt({ _: 2 }, [
|
|
758
758
|
a.context.editable ? {
|
|
759
759
|
name: "menu-items",
|
|
760
760
|
fn: P(() => [
|
|
761
761
|
se(f, { onClick: d }, {
|
|
762
762
|
default: P(() => [
|
|
763
|
-
|
|
763
|
+
ce(J(S(s).t("renderer.edit")), 1)
|
|
764
764
|
]),
|
|
765
765
|
_: 1
|
|
766
766
|
})
|
|
@@ -774,7 +774,7 @@ const xi = () => {
|
|
|
774
774
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
775
775
|
};
|
|
776
776
|
}
|
|
777
|
-
}),
|
|
777
|
+
}), je = /* @__PURE__ */ de(Di, [["__scopeId", "data-v-a9ee3db9"]]), ht = /* @__PURE__ */ W({
|
|
778
778
|
__name: "BarChartRenderer",
|
|
779
779
|
props: {
|
|
780
780
|
query: {},
|
|
@@ -785,7 +785,7 @@ const xi = () => {
|
|
|
785
785
|
refreshCounter: {}
|
|
786
786
|
},
|
|
787
787
|
setup(u) {
|
|
788
|
-
return (e, t) => (C(),
|
|
788
|
+
return (e, t) => (C(), O(je, {
|
|
789
789
|
"chart-options": e.chartOptions,
|
|
790
790
|
context: e.context,
|
|
791
791
|
"extra-props": { showAnnotations: !1 },
|
|
@@ -795,7 +795,7 @@ const xi = () => {
|
|
|
795
795
|
"refresh-counter": e.refreshCounter
|
|
796
796
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
797
797
|
}
|
|
798
|
-
}),
|
|
798
|
+
}), dt = /* @__PURE__ */ W({
|
|
799
799
|
__name: "TimeseriesChartRenderer",
|
|
800
800
|
props: {
|
|
801
801
|
query: {},
|
|
@@ -808,7 +808,7 @@ const xi = () => {
|
|
|
808
808
|
emits: ["zoom-time-range"],
|
|
809
809
|
setup(u, { emit: e }) {
|
|
810
810
|
const t = e;
|
|
811
|
-
return (i, s) => (C(),
|
|
811
|
+
return (i, s) => (C(), O(je, {
|
|
812
812
|
"chart-options": i.chartOptions,
|
|
813
813
|
context: i.context,
|
|
814
814
|
height: i.height,
|
|
@@ -818,7 +818,7 @@ const xi = () => {
|
|
|
818
818
|
onZoomTimeRange: s[0] || (s[0] = (r) => t("zoom-time-range", r))
|
|
819
819
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
820
820
|
}
|
|
821
|
-
}),
|
|
821
|
+
}), Si = { class: "metric-card-tile-wrapper" }, ki = /* @__PURE__ */ W({
|
|
822
822
|
__name: "GoldenSignalsRenderer",
|
|
823
823
|
props: {
|
|
824
824
|
query: {},
|
|
@@ -829,10 +829,10 @@ const xi = () => {
|
|
|
829
829
|
refreshCounter: {}
|
|
830
830
|
},
|
|
831
831
|
setup(u) {
|
|
832
|
-
const e = u, t =
|
|
832
|
+
const e = u, t = L(() => {
|
|
833
833
|
const s = e.context.timeSpec;
|
|
834
834
|
if (s.type === "absolute")
|
|
835
|
-
return new
|
|
835
|
+
return new Wt({
|
|
836
836
|
key: "custom",
|
|
837
837
|
timeframeText: "custom",
|
|
838
838
|
display: "custom",
|
|
@@ -844,11 +844,11 @@ const xi = () => {
|
|
|
844
844
|
isRelative: !1,
|
|
845
845
|
allowedTiers: ["free", "plus", "enterprise"]
|
|
846
846
|
});
|
|
847
|
-
const r =
|
|
847
|
+
const r = xt.get(s.time_range);
|
|
848
848
|
if (!r)
|
|
849
849
|
throw new Error("Unknown time range");
|
|
850
850
|
return r;
|
|
851
|
-
}), i =
|
|
851
|
+
}), i = L(() => {
|
|
852
852
|
var r, o;
|
|
853
853
|
const s = (r = e.query) == null ? void 0 : r.datasource;
|
|
854
854
|
if (s && s !== "advanced" && s !== "basic")
|
|
@@ -866,27 +866,27 @@ const xi = () => {
|
|
|
866
866
|
refreshCounter: e.refreshCounter
|
|
867
867
|
};
|
|
868
868
|
});
|
|
869
|
-
return (s, r) => (C(),
|
|
870
|
-
se(S(
|
|
869
|
+
return (s, r) => (C(), U("div", Si, [
|
|
870
|
+
se(S(ti), Bt($t(i.value)), {
|
|
871
871
|
default: P(() => [
|
|
872
|
-
se(S(
|
|
872
|
+
se(S(ii))
|
|
873
873
|
]),
|
|
874
874
|
_: 1
|
|
875
875
|
}, 16)
|
|
876
876
|
]));
|
|
877
877
|
}
|
|
878
|
-
}),
|
|
878
|
+
}), Ni = /* @__PURE__ */ de(ki, [["__scopeId", "data-v-bd5889d1"]]), ut = "#6c7489", ct = "20px", Ot = "20px", Ai = {
|
|
879
879
|
class: "fallback-entity-link",
|
|
880
880
|
"data-testid": "entity-link-parent"
|
|
881
|
-
},
|
|
881
|
+
}, ft = /* @__PURE__ */ W({
|
|
882
882
|
__name: "FallbackEntityLink",
|
|
883
883
|
props: {
|
|
884
884
|
entityLinkData: {}
|
|
885
885
|
},
|
|
886
886
|
setup(u) {
|
|
887
|
-
return (e, t) => (C(),
|
|
887
|
+
return (e, t) => (C(), U("div", Ai, J(e.entityLinkData.label), 1));
|
|
888
888
|
}
|
|
889
|
-
}),
|
|
889
|
+
}), Hi = /* @__PURE__ */ W({
|
|
890
890
|
__name: "TopNTableRenderer",
|
|
891
891
|
props: {
|
|
892
892
|
query: {},
|
|
@@ -897,35 +897,35 @@ const xi = () => {
|
|
|
897
897
|
refreshCounter: {}
|
|
898
898
|
},
|
|
899
899
|
setup(u) {
|
|
900
|
-
const e = u, t = _e(le), i =
|
|
900
|
+
const e = u, t = _e(le), i = Ft(async () => {
|
|
901
901
|
if (t != null && t.fetchComponent)
|
|
902
902
|
try {
|
|
903
903
|
return await t.fetchComponent("EntityLink");
|
|
904
904
|
} catch {
|
|
905
|
-
return
|
|
905
|
+
return ft;
|
|
906
906
|
}
|
|
907
|
-
return
|
|
907
|
+
return ft;
|
|
908
908
|
}), s = (r) => {
|
|
909
909
|
var o;
|
|
910
910
|
if ((o = e.chartOptions) != null && o.entityLink)
|
|
911
911
|
if (r.id.includes(":")) {
|
|
912
912
|
const [n, d] = r.id.split(":");
|
|
913
|
-
return e.chartOptions.entityLink.replace(
|
|
913
|
+
return e.chartOptions.entityLink.replace(fi, n).replace(nt, d);
|
|
914
914
|
} else
|
|
915
|
-
return e.chartOptions.entityLink.replace(
|
|
915
|
+
return e.chartOptions.entityLink.replace(nt, r.id);
|
|
916
916
|
return "";
|
|
917
917
|
};
|
|
918
|
-
return (r, o) => (C(),
|
|
918
|
+
return (r, o) => (C(), O(Xe, {
|
|
919
919
|
context: r.context,
|
|
920
920
|
query: r.query,
|
|
921
921
|
"query-ready": r.queryReady,
|
|
922
922
|
"refresh-counter": r.refreshCounter
|
|
923
923
|
}, {
|
|
924
924
|
default: P(({ data: n }) => [
|
|
925
|
-
se(S(
|
|
925
|
+
se(S(jt), {
|
|
926
926
|
data: n,
|
|
927
927
|
"synthetics-data-key": r.chartOptions.syntheticsDataKey
|
|
928
|
-
},
|
|
928
|
+
}, vt({ _: 2 }, [
|
|
929
929
|
e.chartOptions.entityLink ? {
|
|
930
930
|
name: "name",
|
|
931
931
|
fn: P(({ record: d }) => [
|
|
@@ -945,7 +945,7 @@ const xi = () => {
|
|
|
945
945
|
_: 1
|
|
946
946
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
947
947
|
}
|
|
948
|
-
}),
|
|
948
|
+
}), Oi = /* @__PURE__ */ W({
|
|
949
949
|
__name: "DonutChartRenderer",
|
|
950
950
|
props: {
|
|
951
951
|
query: {},
|
|
@@ -956,7 +956,7 @@ const xi = () => {
|
|
|
956
956
|
refreshCounter: {}
|
|
957
957
|
},
|
|
958
958
|
setup(u) {
|
|
959
|
-
return (e, t) => (C(),
|
|
959
|
+
return (e, t) => (C(), O(je, {
|
|
960
960
|
"chart-options": e.chartOptions,
|
|
961
961
|
context: e.context,
|
|
962
962
|
height: e.height,
|
|
@@ -965,60 +965,60 @@ const xi = () => {
|
|
|
965
965
|
"refresh-counter": e.refreshCounter
|
|
966
966
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
967
967
|
}
|
|
968
|
-
}),
|
|
968
|
+
}), Li = ["data-testid"], Mi = {
|
|
969
969
|
key: 0,
|
|
970
970
|
class: "tile-header"
|
|
971
|
-
},
|
|
971
|
+
}, Ii = ["data-testid"], Pi = ["data-testid"], qi = ["data-testid"], Bi = ["data-testid"], $i = /* @__PURE__ */ W({
|
|
972
972
|
__name: "DashboardTile",
|
|
973
973
|
props: {
|
|
974
974
|
definition: {},
|
|
975
975
|
context: {},
|
|
976
|
-
height: { default:
|
|
976
|
+
height: { default: Ye },
|
|
977
977
|
queryReady: { type: Boolean },
|
|
978
978
|
refreshCounter: {},
|
|
979
979
|
tileId: {}
|
|
980
980
|
},
|
|
981
981
|
emits: ["edit-tile", "duplicate-tile", "remove-tile", "zoom-time-range"],
|
|
982
982
|
setup(u, { emit: e }) {
|
|
983
|
-
|
|
984
|
-
"
|
|
983
|
+
We((w) => ({
|
|
984
|
+
"43b43292": `${w.height}px`
|
|
985
985
|
}));
|
|
986
|
-
const t = parseInt(
|
|
987
|
-
|
|
988
|
-
var
|
|
989
|
-
|
|
990
|
-
}),
|
|
991
|
-
await
|
|
986
|
+
const t = parseInt(Ot, 10), i = u, s = e, r = _e(le), { i18n: o } = he.useI18n(), { evaluateFeatureFlag: n } = he.useEvaluateFeatureFlag(), d = n("ma-3630-portal-v3", !1), h = F(), a = F(!1), l = F(), f = F(!1), g = F("");
|
|
987
|
+
Ke(async () => {
|
|
988
|
+
var w;
|
|
989
|
+
g.value = await ((w = r == null ? void 0 : r.exploreBaseUrl) == null ? void 0 : w.call(r)) ?? "";
|
|
990
|
+
}), Ge(() => i.definition, async () => {
|
|
991
|
+
await _t(), l.value && (f.value = l.value.scrollWidth > l.value.clientWidth);
|
|
992
992
|
}, { immediate: !0, deep: !0 });
|
|
993
|
-
const
|
|
994
|
-
if (!
|
|
993
|
+
const p = L(() => {
|
|
994
|
+
if (!g.value || !i.definition.query || !E.value)
|
|
995
995
|
return "";
|
|
996
|
-
const
|
|
997
|
-
if (
|
|
996
|
+
const w = [...i.context.filters, ...i.definition.query.filters ?? []], Z = i.definition.query.dimensions ?? [], j = new Set(d ? [] : ["portal", "api"]);
|
|
997
|
+
if (w.some((re) => "dimension" in re && j.has(re.dimension) || "field" in re && j.has(re.field)) || Z.some((re) => j.has(re)))
|
|
998
998
|
return "";
|
|
999
|
-
const
|
|
1000
|
-
filters:
|
|
999
|
+
const qe = {
|
|
1000
|
+
filters: w,
|
|
1001
1001
|
metrics: i.definition.query.metrics ?? [],
|
|
1002
1002
|
dimensions: Z,
|
|
1003
1003
|
time_range: i.definition.query.time_range || i.context.timeSpec,
|
|
1004
|
-
granularity: i.definition.query.granularity ||
|
|
1005
|
-
},
|
|
1006
|
-
return `${
|
|
1007
|
-
}),
|
|
1008
|
-
timeseries_line:
|
|
1009
|
-
timeseries_bar:
|
|
1010
|
-
horizontal_bar:
|
|
1011
|
-
vertical_bar:
|
|
1012
|
-
gauge:
|
|
1013
|
-
donut:
|
|
1014
|
-
golden_signals:
|
|
1015
|
-
top_n:
|
|
1004
|
+
granularity: i.definition.query.granularity || x.value
|
|
1005
|
+
}, ue = ["advanced", "ai"].includes(i.definition.query.datasource) ? i.definition.query.datasource : "advanced";
|
|
1006
|
+
return `${g.value}?q=${JSON.stringify(qe)}&d=${ue}&c=${i.definition.chart.type}`;
|
|
1007
|
+
}), y = L(() => o.t("csvExport.defaultFilename")), m = L(() => E.value && (N.value || i.context.editable) || !!z.value), E = L(() => !["golden_signals", "top_n", "gauge"].includes(i.definition.chart.type)), N = L(() => !!p.value || "allowCsvExport" in i.definition.chart && i.definition.chart.allowCsvExport || i.context.editable), R = {
|
|
1008
|
+
timeseries_line: dt,
|
|
1009
|
+
timeseries_bar: dt,
|
|
1010
|
+
horizontal_bar: ht,
|
|
1011
|
+
vertical_bar: ht,
|
|
1012
|
+
gauge: lt,
|
|
1013
|
+
donut: Oi,
|
|
1014
|
+
golden_signals: Ni,
|
|
1015
|
+
top_n: Hi,
|
|
1016
1016
|
slottable: void 0,
|
|
1017
|
-
single_value:
|
|
1018
|
-
},
|
|
1019
|
-
const
|
|
1020
|
-
return
|
|
1021
|
-
component:
|
|
1017
|
+
single_value: lt
|
|
1018
|
+
}, H = L(() => {
|
|
1019
|
+
const w = R[i.definition.chart.type];
|
|
1020
|
+
return w && {
|
|
1021
|
+
component: w,
|
|
1022
1022
|
rendererProps: {
|
|
1023
1023
|
query: i.definition.query,
|
|
1024
1024
|
context: i.context,
|
|
@@ -1028,154 +1028,154 @@ const xi = () => {
|
|
|
1028
1028
|
refreshCounter: i.refreshCounter
|
|
1029
1029
|
}
|
|
1030
1030
|
};
|
|
1031
|
-
}),
|
|
1031
|
+
}), z = L(() => {
|
|
1032
1032
|
var Z;
|
|
1033
|
-
const
|
|
1034
|
-
if ((
|
|
1035
|
-
const j =
|
|
1036
|
-
return j ? j.display : (console.warn("Did not recognize the given relative time range:",
|
|
1037
|
-
} else if ((
|
|
1038
|
-
const j =
|
|
1039
|
-
return `${
|
|
1033
|
+
const w = (Z = i.definition.query) == null ? void 0 : Z.time_range;
|
|
1034
|
+
if ((w == null ? void 0 : w.type) === "relative") {
|
|
1035
|
+
const j = xt.get(Vt[w.time_range]);
|
|
1036
|
+
return j ? j.display : (console.warn("Did not recognize the given relative time range:", w.time_range), w.time_range);
|
|
1037
|
+
} else if ((w == null ? void 0 : w.type) === "absolute") {
|
|
1038
|
+
const j = w.tz || "Etc/UTC";
|
|
1039
|
+
return `${rt(w.start, { short: !0, tz: j })} - ${rt(w.end, { short: !0, tz: j })}`;
|
|
1040
1040
|
}
|
|
1041
1041
|
return null;
|
|
1042
|
-
}),
|
|
1042
|
+
}), x = L(() => h.value ? Kt(h.value.meta.granularity_ms) : void 0), k = () => {
|
|
1043
1043
|
s("edit-tile", i.definition);
|
|
1044
|
-
},
|
|
1044
|
+
}, D = () => {
|
|
1045
1045
|
s("duplicate-tile", i.definition);
|
|
1046
|
-
},
|
|
1046
|
+
}, $ = () => {
|
|
1047
1047
|
s("remove-tile", i.definition);
|
|
1048
|
-
},
|
|
1049
|
-
|
|
1050
|
-
},
|
|
1051
|
-
|
|
1052
|
-
},
|
|
1053
|
-
|
|
1048
|
+
}, ae = (w) => {
|
|
1049
|
+
h.value = w;
|
|
1050
|
+
}, we = (w) => {
|
|
1051
|
+
a.value = w;
|
|
1052
|
+
}, Mt = () => {
|
|
1053
|
+
we(!0);
|
|
1054
1054
|
};
|
|
1055
|
-
return (
|
|
1056
|
-
const j = oe("KTooltip"),
|
|
1057
|
-
return C(),
|
|
1058
|
-
class:
|
|
1059
|
-
"data-testid": `tile-${
|
|
1055
|
+
return (w, Z) => {
|
|
1056
|
+
const j = oe("KTooltip"), qe = oe("KBadge"), ue = oe("KDropdownItem"), re = oe("KDropdown");
|
|
1057
|
+
return C(), U("div", {
|
|
1058
|
+
class: Ve(["tile-boundary", { editable: w.context.editable }]),
|
|
1059
|
+
"data-testid": `tile-${w.tileId}`
|
|
1060
1060
|
}, [
|
|
1061
|
-
|
|
1061
|
+
w.definition.chart.type !== "slottable" ? (C(), U("div", Mi, [
|
|
1062
1062
|
se(j, {
|
|
1063
1063
|
class: "title-tooltip",
|
|
1064
|
-
disabled: !
|
|
1064
|
+
disabled: !f.value,
|
|
1065
1065
|
"max-width": "500",
|
|
1066
|
-
text:
|
|
1066
|
+
text: w.definition.chart.chartTitle
|
|
1067
1067
|
}, {
|
|
1068
1068
|
default: P(() => [
|
|
1069
|
-
|
|
1069
|
+
fe("div", {
|
|
1070
1070
|
ref_key: "titleRef",
|
|
1071
|
-
ref:
|
|
1071
|
+
ref: l,
|
|
1072
1072
|
class: "title"
|
|
1073
|
-
}, J(
|
|
1073
|
+
}, J(w.definition.chart.chartTitle), 513)
|
|
1074
1074
|
]),
|
|
1075
1075
|
_: 1
|
|
1076
1076
|
}, 8, ["disabled", "text"]),
|
|
1077
|
-
|
|
1077
|
+
m.value ? (C(), U("div", {
|
|
1078
1078
|
key: 0,
|
|
1079
1079
|
class: "tile-actions",
|
|
1080
|
-
"data-testid": `tile-actions-${
|
|
1080
|
+
"data-testid": `tile-actions-${w.tileId}`
|
|
1081
1081
|
}, [
|
|
1082
|
-
|
|
1082
|
+
z.value ? (C(), O(qe, { key: 0 }, {
|
|
1083
1083
|
default: P(() => [
|
|
1084
|
-
|
|
1084
|
+
ce(J(z.value), 1)
|
|
1085
1085
|
]),
|
|
1086
1086
|
_: 1
|
|
1087
1087
|
})) : V("", !0),
|
|
1088
|
-
|
|
1088
|
+
E.value && w.context.editable ? (C(), O(S(si), {
|
|
1089
1089
|
key: 1,
|
|
1090
1090
|
class: "edit-icon",
|
|
1091
|
-
color: S(
|
|
1092
|
-
"data-testid": `edit-tile-${
|
|
1093
|
-
size: S(
|
|
1094
|
-
onClick:
|
|
1091
|
+
color: S(ut),
|
|
1092
|
+
"data-testid": `edit-tile-${w.tileId}`,
|
|
1093
|
+
size: S(ct),
|
|
1094
|
+
onClick: k
|
|
1095
1095
|
}, null, 8, ["color", "data-testid", "size"])) : V("", !0),
|
|
1096
|
-
|
|
1096
|
+
E.value && N.value ? (C(), O(re, {
|
|
1097
1097
|
key: 2,
|
|
1098
1098
|
class: "dropdown",
|
|
1099
|
-
"data-testid": `chart-action-menu-${
|
|
1099
|
+
"data-testid": `chart-action-menu-${w.tileId}`,
|
|
1100
1100
|
"kpop-attributes": { placement: "bottom-end" }
|
|
1101
1101
|
}, {
|
|
1102
1102
|
items: P(() => [
|
|
1103
|
-
|
|
1103
|
+
p.value ? (C(), O(ue, {
|
|
1104
1104
|
key: 0,
|
|
1105
|
-
"data-testid": `chart-jump-to-explore-${
|
|
1106
|
-
item: { label: S(o).t("jumpToExplore"), to:
|
|
1105
|
+
"data-testid": `chart-jump-to-explore-${w.tileId}`,
|
|
1106
|
+
item: { label: S(o).t("jumpToExplore"), to: p.value }
|
|
1107
1107
|
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1108
|
-
!("allowCsvExport" in
|
|
1108
|
+
!("allowCsvExport" in w.definition.chart) || w.definition.chart.allowCsvExport ? (C(), O(ue, {
|
|
1109
1109
|
key: 1,
|
|
1110
1110
|
class: "chart-export-button",
|
|
1111
|
-
"data-testid": `chart-csv-export-${
|
|
1112
|
-
onClick: Z[0] || (Z[0] = (
|
|
1111
|
+
"data-testid": `chart-csv-export-${w.tileId}`,
|
|
1112
|
+
onClick: Z[0] || (Z[0] = (Je) => Mt())
|
|
1113
1113
|
}, {
|
|
1114
1114
|
default: P(() => [
|
|
1115
|
-
|
|
1115
|
+
fe("span", {
|
|
1116
1116
|
class: "chart-export-trigger",
|
|
1117
|
-
"data-testid": `csv-export-button-${
|
|
1118
|
-
}, J(S(o).t("csvExport.exportAsCsv")), 9,
|
|
1117
|
+
"data-testid": `csv-export-button-${w.tileId}`
|
|
1118
|
+
}, J(S(o).t("csvExport.exportAsCsv")), 9, Pi)
|
|
1119
1119
|
]),
|
|
1120
1120
|
_: 1
|
|
1121
1121
|
}, 8, ["data-testid"])) : V("", !0),
|
|
1122
|
-
|
|
1122
|
+
w.context.editable ? (C(), O(ue, {
|
|
1123
1123
|
key: 2,
|
|
1124
|
-
"data-testid": `duplicate-tile-${
|
|
1125
|
-
onClick:
|
|
1124
|
+
"data-testid": `duplicate-tile-${w.tileId}`,
|
|
1125
|
+
onClick: D
|
|
1126
1126
|
}, {
|
|
1127
1127
|
default: P(() => [
|
|
1128
|
-
|
|
1128
|
+
ce(J(S(o).t("renderer.duplicateTile")), 1)
|
|
1129
1129
|
]),
|
|
1130
1130
|
_: 1
|
|
1131
1131
|
}, 8, ["data-testid"])) : V("", !0),
|
|
1132
|
-
|
|
1132
|
+
w.context.editable ? (C(), O(ue, {
|
|
1133
1133
|
key: 3,
|
|
1134
|
-
"data-testid": `remove-tile-${
|
|
1135
|
-
onClick:
|
|
1134
|
+
"data-testid": `remove-tile-${w.tileId}`,
|
|
1135
|
+
onClick: $
|
|
1136
1136
|
}, {
|
|
1137
1137
|
default: P(() => [
|
|
1138
|
-
|
|
1138
|
+
ce(J(S(o).t("renderer.remove")), 1)
|
|
1139
1139
|
]),
|
|
1140
1140
|
_: 1
|
|
1141
1141
|
}, 8, ["data-testid"])) : V("", !0)
|
|
1142
1142
|
]),
|
|
1143
1143
|
default: P(() => [
|
|
1144
|
-
se(S(
|
|
1144
|
+
se(S(ri), {
|
|
1145
1145
|
class: "kebab-action-menu",
|
|
1146
|
-
color: S(
|
|
1147
|
-
"data-testid": `kebab-action-menu-${
|
|
1148
|
-
size: S(
|
|
1146
|
+
color: S(ut),
|
|
1147
|
+
"data-testid": `kebab-action-menu-${w.tileId}`,
|
|
1148
|
+
size: S(ct)
|
|
1149
1149
|
}, null, 8, ["color", "data-testid", "size"])
|
|
1150
1150
|
]),
|
|
1151
1151
|
_: 1
|
|
1152
1152
|
}, 8, ["data-testid"])) : V("", !0)
|
|
1153
|
-
], 8,
|
|
1153
|
+
], 8, Ii)) : "description" in w.definition.chart ? (C(), U("div", {
|
|
1154
1154
|
key: 1,
|
|
1155
1155
|
class: "header-description",
|
|
1156
|
-
"data-testid": `tile-description-${
|
|
1157
|
-
}, J(
|
|
1158
|
-
|
|
1156
|
+
"data-testid": `tile-description-${w.tileId}`
|
|
1157
|
+
}, J(w.definition.chart.description), 9, qi)) : V("", !0),
|
|
1158
|
+
a.value ? (C(), O(S(Qt), {
|
|
1159
1159
|
key: 2,
|
|
1160
|
-
"chart-data":
|
|
1161
|
-
"data-testid": `csv-export-modal-${
|
|
1162
|
-
filename:
|
|
1163
|
-
onToggleModal:
|
|
1160
|
+
"chart-data": h.value,
|
|
1161
|
+
"data-testid": `csv-export-modal-${w.tileId}`,
|
|
1162
|
+
filename: y.value,
|
|
1163
|
+
onToggleModal: we
|
|
1164
1164
|
}, null, 8, ["chart-data", "data-testid", "filename"])) : V("", !0)
|
|
1165
1165
|
])) : V("", !0),
|
|
1166
|
-
|
|
1166
|
+
fe("div", {
|
|
1167
1167
|
class: "tile-content",
|
|
1168
|
-
"data-testid": `tile-content-${
|
|
1168
|
+
"data-testid": `tile-content-${w.tileId}`
|
|
1169
1169
|
}, [
|
|
1170
|
-
|
|
1171
|
-
onChartData:
|
|
1172
|
-
onZoomTimeRange: Z[1] || (Z[1] = (
|
|
1170
|
+
H.value ? (C(), O(wt(H.value.component), yt({ key: 0 }, H.value.rendererProps, {
|
|
1171
|
+
onChartData: ae,
|
|
1172
|
+
onZoomTimeRange: Z[1] || (Z[1] = (Je) => s("zoom-time-range", Je))
|
|
1173
1173
|
}), null, 16)) : V("", !0)
|
|
1174
|
-
], 8,
|
|
1175
|
-
], 10,
|
|
1174
|
+
], 8, Bi)
|
|
1175
|
+
], 10, Li);
|
|
1176
1176
|
};
|
|
1177
1177
|
}
|
|
1178
|
-
}),
|
|
1178
|
+
}), Fi = /* @__PURE__ */ de($i, [["__scopeId", "data-v-27a60ade"]]), Ui = (u, e, t) => {
|
|
1179
1179
|
const i = /* @__PURE__ */ new Map();
|
|
1180
1180
|
t.forEach((r) => {
|
|
1181
1181
|
const o = r.layout.position.row, n = i.get(o), d = r.layout.size.rows === 1 && !!r.layout.size.fitToContent;
|
|
@@ -1185,7 +1185,7 @@ const xi = () => {
|
|
|
1185
1185
|
for (let r = 0; r < u; r++)
|
|
1186
1186
|
i.get(r) ? s.push("auto") : s.push(`${e}px`);
|
|
1187
1187
|
return s;
|
|
1188
|
-
},
|
|
1188
|
+
}, Gi = /* @__PURE__ */ W({
|
|
1189
1189
|
__name: "GridLayout",
|
|
1190
1190
|
props: {
|
|
1191
1191
|
gridSize: {
|
|
@@ -1195,7 +1195,7 @@ const xi = () => {
|
|
|
1195
1195
|
tileHeight: {
|
|
1196
1196
|
type: Number,
|
|
1197
1197
|
required: !1,
|
|
1198
|
-
default: () =>
|
|
1198
|
+
default: () => Ye
|
|
1199
1199
|
},
|
|
1200
1200
|
tiles: {
|
|
1201
1201
|
type: Array,
|
|
@@ -1203,24 +1203,24 @@ const xi = () => {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
},
|
|
1205
1205
|
setup(u) {
|
|
1206
|
-
|
|
1206
|
+
We((n) => ({
|
|
1207
1207
|
"3bc5e939": u.gridSize.cols,
|
|
1208
1208
|
"77aa3028": r.value
|
|
1209
1209
|
}));
|
|
1210
|
-
const e = u, t =
|
|
1210
|
+
const e = u, t = F(null), i = F(0), s = new ResizeObserver((n) => {
|
|
1211
1211
|
window.requestAnimationFrame(() => {
|
|
1212
1212
|
!Array.isArray(n) || !n.length || (i.value = n[0].contentRect.width);
|
|
1213
1213
|
});
|
|
1214
1214
|
});
|
|
1215
|
-
|
|
1215
|
+
Ke(() => {
|
|
1216
1216
|
t.value && s.observe(t.value);
|
|
1217
1217
|
}), Ue(() => {
|
|
1218
1218
|
t.value && s.unobserve(t.value);
|
|
1219
1219
|
});
|
|
1220
|
-
const r =
|
|
1220
|
+
const r = L(() => {
|
|
1221
1221
|
var d;
|
|
1222
|
-
return
|
|
1223
|
-
}), o =
|
|
1222
|
+
return Ui((d = e.gridSize) == null ? void 0 : d.rows, e.tileHeight, e.tiles).join(" ");
|
|
1223
|
+
}), o = L(() => e.tiles.map((n, d) => ({
|
|
1224
1224
|
key: `tile-${d}`,
|
|
1225
1225
|
tile: n,
|
|
1226
1226
|
style: {
|
|
@@ -1230,27 +1230,27 @@ const xi = () => {
|
|
|
1230
1230
|
"grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
|
|
1231
1231
|
}
|
|
1232
1232
|
})));
|
|
1233
|
-
return (n, d) => (C(),
|
|
1233
|
+
return (n, d) => (C(), U("div", {
|
|
1234
1234
|
ref_key: "gridContainer",
|
|
1235
1235
|
ref: t,
|
|
1236
1236
|
class: "kong-ui-public-grid-layout"
|
|
1237
1237
|
}, [
|
|
1238
|
-
(C(!0),
|
|
1238
|
+
(C(!0), U(bt, null, Et(o.value, (h) => (C(), U("div", {
|
|
1239
1239
|
key: h.key,
|
|
1240
|
-
class:
|
|
1240
|
+
class: Ve(["grid-cell", {
|
|
1241
1241
|
"empty-cell": !h.tile
|
|
1242
1242
|
}]),
|
|
1243
|
-
style:
|
|
1243
|
+
style: it(h.style)
|
|
1244
1244
|
}, [
|
|
1245
|
-
|
|
1246
|
-
style:
|
|
1245
|
+
Ie(n.$slots, "tile", {
|
|
1246
|
+
style: it(h.style),
|
|
1247
1247
|
tile: h.tile
|
|
1248
1248
|
}, void 0, !0)
|
|
1249
1249
|
], 6))), 128))
|
|
1250
1250
|
], 512));
|
|
1251
1251
|
}
|
|
1252
|
-
}),
|
|
1253
|
-
function
|
|
1252
|
+
}), Wi = /* @__PURE__ */ de(Gi, [["__scopeId", "data-v-f43eb7b8"]]);
|
|
1253
|
+
function Vi(u, e, t, i, s) {
|
|
1254
1254
|
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));
|
|
1255
1255
|
return r.prototype = e.prototype, r;
|
|
1256
1256
|
}
|
|
@@ -1291,11 +1291,11 @@ class c {
|
|
|
1291
1291
|
const i = c.createDiv(["grid-stack-item", e]), s = c.createDiv(["grid-stack-item-content"], i);
|
|
1292
1292
|
return t.lazyLoad || ((n = (o = t.grid) == null ? void 0 : o.opts) == null ? void 0 : n.lazyLoad) && t.lazyLoad !== !1 ? t.visibleObservable || (t.visibleObservable = new IntersectionObserver(([d]) => {
|
|
1293
1293
|
var h;
|
|
1294
|
-
d.isIntersecting && ((h = t.visibleObservable) == null || h.disconnect(), delete t.visibleObservable,
|
|
1294
|
+
d.isIntersecting && ((h = t.visibleObservable) == null || h.disconnect(), delete t.visibleObservable, _.renderCB(s, t));
|
|
1295
1295
|
}), window.setTimeout(() => {
|
|
1296
1296
|
var d;
|
|
1297
1297
|
return (d = t.visibleObservable) == null ? void 0 : d.observe(i);
|
|
1298
|
-
})) :
|
|
1298
|
+
})) : _.renderCB(s, t), i;
|
|
1299
1299
|
}
|
|
1300
1300
|
/** create a div with the given classes */
|
|
1301
1301
|
static createDiv(e, t) {
|
|
@@ -1935,8 +1935,8 @@ class ee {
|
|
|
1935
1935
|
const l = e._moving && !t.nested;
|
|
1936
1936
|
let f = l ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
1937
1937
|
if (l && f && ((a = (h = e.grid) == null ? void 0 : h.opts) != null && a.subGridDynamic) && !e.grid._isTemp) {
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1938
|
+
const g = c.areaIntercept(t.rect, f._rect), p = c.area(t.rect), y = c.area(f._rect);
|
|
1939
|
+
g / (p < y ? p : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
|
|
1940
1940
|
}
|
|
1941
1941
|
f ? d = !this._fixCollisions(e, r, f, t) : (d = !1, i && delete t.pack);
|
|
1942
1942
|
}
|
|
@@ -2114,7 +2114,7 @@ class b {
|
|
|
2114
2114
|
const Q = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2115
2115
|
class te {
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2117
|
+
function Ne(u, e) {
|
|
2118
2118
|
if (u.touches.length > 1)
|
|
2119
2119
|
return;
|
|
2120
2120
|
u.cancelable && u.preventDefault();
|
|
@@ -2152,7 +2152,7 @@ function ke(u, e) {
|
|
|
2152
2152
|
// relatedTarget
|
|
2153
2153
|
), u.target.dispatchEvent(i);
|
|
2154
2154
|
}
|
|
2155
|
-
function
|
|
2155
|
+
function Lt(u, e) {
|
|
2156
2156
|
u.cancelable && u.preventDefault();
|
|
2157
2157
|
const t = document.createEvent("MouseEvents");
|
|
2158
2158
|
t.initMouseEvent(
|
|
@@ -2188,46 +2188,46 @@ function Ot(u, e) {
|
|
|
2188
2188
|
// relatedTarget
|
|
2189
2189
|
), u.target.dispatchEvent(t);
|
|
2190
2190
|
}
|
|
2191
|
-
function Ne(u) {
|
|
2192
|
-
te.touchHandled || (te.touchHandled = !0, ke(u, "mousedown"));
|
|
2193
|
-
}
|
|
2194
2191
|
function Ae(u) {
|
|
2195
|
-
te.touchHandled
|
|
2192
|
+
te.touchHandled || (te.touchHandled = !0, Ne(u, "mousedown"));
|
|
2196
2193
|
}
|
|
2197
2194
|
function He(u) {
|
|
2195
|
+
te.touchHandled && Ne(u, "mousemove");
|
|
2196
|
+
}
|
|
2197
|
+
function Oe(u) {
|
|
2198
2198
|
if (!te.touchHandled)
|
|
2199
2199
|
return;
|
|
2200
2200
|
te.pointerLeaveTimeout && (window.clearTimeout(te.pointerLeaveTimeout), delete te.pointerLeaveTimeout);
|
|
2201
2201
|
const e = !!b.dragElement;
|
|
2202
|
-
|
|
2202
|
+
Ne(u, "mouseup"), e || Ne(u, "click"), te.touchHandled = !1;
|
|
2203
2203
|
}
|
|
2204
|
-
function
|
|
2204
|
+
function Le(u) {
|
|
2205
2205
|
u.pointerType !== "mouse" && u.target.releasePointerCapture(u.pointerId);
|
|
2206
2206
|
}
|
|
2207
|
-
function ft(u) {
|
|
2208
|
-
b.dragElement && u.pointerType !== "mouse" && Ot(u, "mouseenter");
|
|
2209
|
-
}
|
|
2210
2207
|
function gt(u) {
|
|
2208
|
+
b.dragElement && u.pointerType !== "mouse" && Lt(u, "mouseenter");
|
|
2209
|
+
}
|
|
2210
|
+
function mt(u) {
|
|
2211
2211
|
b.dragElement && u.pointerType !== "mouse" && (te.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2212
|
-
delete te.pointerLeaveTimeout,
|
|
2212
|
+
delete te.pointerLeaveTimeout, Lt(u, "mouseleave");
|
|
2213
2213
|
}, 10));
|
|
2214
2214
|
}
|
|
2215
|
-
class
|
|
2215
|
+
class Pe {
|
|
2216
2216
|
constructor(e, t, i) {
|
|
2217
2217
|
this.host = e, this.dir = t, this.option = i, this.moving = !1, this._mouseDown = this._mouseDown.bind(this), this._mouseMove = this._mouseMove.bind(this), this._mouseUp = this._mouseUp.bind(this), this._keyEvent = this._keyEvent.bind(this), this._init();
|
|
2218
2218
|
}
|
|
2219
2219
|
/** @internal */
|
|
2220
2220
|
_init() {
|
|
2221
2221
|
const e = this.el = document.createElement("div");
|
|
2222
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${
|
|
2222
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${Pe.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), Q && (this.el.addEventListener("touchstart", Ae), this.el.addEventListener("pointerdown", Le)), this;
|
|
2223
2223
|
}
|
|
2224
2224
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2225
2225
|
destroy() {
|
|
2226
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), Q && (this.el.removeEventListener("touchstart",
|
|
2226
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), Q && (this.el.removeEventListener("touchstart", Ae), this.el.removeEventListener("pointerdown", Le)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2227
2227
|
}
|
|
2228
2228
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2229
2229
|
_mouseDown(e) {
|
|
2230
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), Q && (this.el.addEventListener("touchmove",
|
|
2230
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), Q && (this.el.addEventListener("touchmove", He), this.el.addEventListener("touchend", Oe)), e.stopPropagation(), e.preventDefault();
|
|
2231
2231
|
}
|
|
2232
2232
|
/** @internal */
|
|
2233
2233
|
_mouseMove(e) {
|
|
@@ -2236,7 +2236,7 @@ class Ie {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
/** @internal */
|
|
2238
2238
|
_mouseUp(e) {
|
|
2239
|
-
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Q && (this.el.removeEventListener("touchmove",
|
|
2239
|
+
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Q && (this.el.removeEventListener("touchmove", He), this.el.removeEventListener("touchend", Oe)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2240
2240
|
}
|
|
2241
2241
|
/** @internal call when keys are being pressed - use Esc to cancel */
|
|
2242
2242
|
_keyEvent(e) {
|
|
@@ -2248,8 +2248,8 @@ class Ie {
|
|
|
2248
2248
|
return this.option[e] && this.option[e](t), this;
|
|
2249
2249
|
}
|
|
2250
2250
|
}
|
|
2251
|
-
|
|
2252
|
-
class
|
|
2251
|
+
Pe.prefix = "ui-resizable-";
|
|
2252
|
+
class Qe {
|
|
2253
2253
|
constructor() {
|
|
2254
2254
|
this._eventRegister = {};
|
|
2255
2255
|
}
|
|
@@ -2277,7 +2277,7 @@ class je {
|
|
|
2277
2277
|
return this._eventRegister[e](t);
|
|
2278
2278
|
}
|
|
2279
2279
|
}
|
|
2280
|
-
class
|
|
2280
|
+
class Ee extends Qe {
|
|
2281
2281
|
// have to be public else complains for HTMLElementExtendOpt ?
|
|
2282
2282
|
constructor(e, t = {}) {
|
|
2283
2283
|
super(), this.el = e, this.option = t, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
@@ -2347,7 +2347,7 @@ class be extends je {
|
|
|
2347
2347
|
}
|
|
2348
2348
|
/** @internal */
|
|
2349
2349
|
_setupHandlers() {
|
|
2350
|
-
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new
|
|
2350
|
+
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new Pe(this.el, e, {
|
|
2351
2351
|
start: (t) => {
|
|
2352
2352
|
this._resizeStart(t);
|
|
2353
2353
|
},
|
|
@@ -2378,7 +2378,7 @@ class be extends je {
|
|
|
2378
2378
|
}
|
|
2379
2379
|
/** @internal */
|
|
2380
2380
|
_setupHelper() {
|
|
2381
|
-
this.elOriginStyleVal =
|
|
2381
|
+
this.elOriginStyleVal = Ee._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
|
|
2382
2382
|
const e = this.el.parentElement, t = c.getValuesFromTransformedElement(e);
|
|
2383
2383
|
return this.rectScale = {
|
|
2384
2384
|
x: t.xScale,
|
|
@@ -2387,7 +2387,7 @@ class be extends je {
|
|
|
2387
2387
|
}
|
|
2388
2388
|
/** @internal */
|
|
2389
2389
|
_cleanHelper() {
|
|
2390
|
-
return
|
|
2390
|
+
return Ee._originStyleProp.forEach((e, t) => {
|
|
2391
2391
|
this.el.style[e] = this.elOriginStyleVal[t] || null;
|
|
2392
2392
|
}), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
|
|
2393
2393
|
}
|
|
@@ -2426,9 +2426,9 @@ class be extends je {
|
|
|
2426
2426
|
return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
|
|
2427
2427
|
}
|
|
2428
2428
|
}
|
|
2429
|
-
|
|
2430
|
-
const
|
|
2431
|
-
class
|
|
2429
|
+
Ee._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
2430
|
+
const Ki = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
2431
|
+
class xe extends Qe {
|
|
2432
2432
|
constructor(e, t = {}) {
|
|
2433
2433
|
var r;
|
|
2434
2434
|
super(), this.el = e, this.option = t, this.dragTransform = {
|
|
@@ -2448,12 +2448,12 @@ class Ee extends je {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
enable() {
|
|
2450
2450
|
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
|
|
2451
|
-
e.addEventListener("mousedown", this._mouseDown), Q && (e.addEventListener("touchstart",
|
|
2451
|
+
e.addEventListener("mousedown", this._mouseDown), Q && (e.addEventListener("touchstart", Ae), e.addEventListener("pointerdown", Le));
|
|
2452
2452
|
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
2453
2453
|
}
|
|
2454
2454
|
disable(e = !1) {
|
|
2455
2455
|
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((t) => {
|
|
2456
|
-
t.removeEventListener("mousedown", this._mouseDown), Q && (t.removeEventListener("touchstart",
|
|
2456
|
+
t.removeEventListener("mousedown", this._mouseDown), Q && (t.removeEventListener("touchstart", Ae), t.removeEventListener("pointerdown", Le));
|
|
2457
2457
|
}), e || this.el.classList.add("ui-draggable-disabled"));
|
|
2458
2458
|
}
|
|
2459
2459
|
destroy() {
|
|
@@ -2465,7 +2465,7 @@ class Ee extends je {
|
|
|
2465
2465
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
2466
2466
|
_mouseDown(e) {
|
|
2467
2467
|
if (!b.mouseHandled)
|
|
2468
|
-
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(
|
|
2468
|
+
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Ki) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete b.dragElement, delete b.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), Q && (e.currentTarget.addEventListener("touchmove", He), e.currentTarget.addEventListener("touchend", Oe)), e.preventDefault(), document.activeElement && document.activeElement.blur(), b.mouseHandled = !0), !0;
|
|
2469
2469
|
}
|
|
2470
2470
|
/** @internal method to call actual drag event */
|
|
2471
2471
|
_callDrag(e) {
|
|
@@ -2496,7 +2496,7 @@ class Ee extends je {
|
|
|
2496
2496
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
2497
2497
|
_mouseUp(e) {
|
|
2498
2498
|
var t, i;
|
|
2499
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Q && e.currentTarget && (e.currentTarget.removeEventListener("touchmove",
|
|
2499
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), Q && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", He, !0), e.currentTarget.removeEventListener("touchend", Oe, !0)), this.dragging) {
|
|
2500
2500
|
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = b.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete b.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
2501
2501
|
const s = c.initEvent(e, { target: this.el, type: "dragstop" });
|
|
2502
2502
|
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), b.dropElement && b.dropElement.drop(e);
|
|
@@ -2518,7 +2518,7 @@ class Ee extends je {
|
|
|
2518
2518
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
2519
2519
|
_createHelper() {
|
|
2520
2520
|
let e = this.el;
|
|
2521
|
-
return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), document.body.contains(e) || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle =
|
|
2521
|
+
return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), document.body.contains(e) || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle = xe.originStyleProp.map((t) => this.el.style[t]), e;
|
|
2522
2522
|
}
|
|
2523
2523
|
/** @internal set the fix position of the dragged item */
|
|
2524
2524
|
_setupHelperStyle(e) {
|
|
@@ -2535,7 +2535,7 @@ class Ee extends je {
|
|
|
2535
2535
|
const e = (t = this.helper) == null ? void 0 : t.gridstackNode;
|
|
2536
2536
|
if (!(e != null && e._isAboutToRemove) && this.dragElementOriginStyle) {
|
|
2537
2537
|
const i = this.helper, s = this.dragElementOriginStyle.transition || null;
|
|
2538
|
-
i.style.transition = this.dragElementOriginStyle.transition = "none",
|
|
2538
|
+
i.style.transition = this.dragElementOriginStyle.transition = "none", xe.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
|
|
2539
2539
|
}
|
|
2540
2540
|
return delete this.dragElementOriginStyle, this;
|
|
2541
2541
|
}
|
|
@@ -2577,8 +2577,8 @@ class Ee extends je {
|
|
|
2577
2577
|
};
|
|
2578
2578
|
}
|
|
2579
2579
|
}
|
|
2580
|
-
|
|
2581
|
-
class
|
|
2580
|
+
xe.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
2581
|
+
class Yi extends Qe {
|
|
2582
2582
|
constructor(e, t = {}) {
|
|
2583
2583
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
2584
2584
|
}
|
|
@@ -2589,10 +2589,10 @@ class Vi extends je {
|
|
|
2589
2589
|
super.off(e);
|
|
2590
2590
|
}
|
|
2591
2591
|
enable() {
|
|
2592
|
-
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), Q && (this.el.addEventListener("pointerenter",
|
|
2592
|
+
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), Q && (this.el.addEventListener("pointerenter", gt), this.el.addEventListener("pointerleave", mt)));
|
|
2593
2593
|
}
|
|
2594
2594
|
disable(e = !1) {
|
|
2595
|
-
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), Q && (this.el.removeEventListener("pointerenter",
|
|
2595
|
+
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), Q && (this.el.removeEventListener("pointerenter", gt), this.el.removeEventListener("pointerleave", mt)));
|
|
2596
2596
|
}
|
|
2597
2597
|
destroy() {
|
|
2598
2598
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -2644,9 +2644,9 @@ class Vi extends je {
|
|
|
2644
2644
|
};
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
|
-
class
|
|
2647
|
+
class Ze {
|
|
2648
2648
|
static init(e) {
|
|
2649
|
-
return e.ddElement || (e.ddElement = new
|
|
2649
|
+
return e.ddElement || (e.ddElement = new Ze(e)), e.ddElement;
|
|
2650
2650
|
}
|
|
2651
2651
|
constructor(e) {
|
|
2652
2652
|
this.el = e;
|
|
@@ -2658,25 +2658,25 @@ class Qe {
|
|
|
2658
2658
|
return this.ddDraggable && ["drag", "dragstart", "dragstop"].indexOf(e) > -1 ? this.ddDraggable.off(e) : this.ddDroppable && ["drop", "dropover", "dropout"].indexOf(e) > -1 ? this.ddDroppable.off(e) : this.ddResizable && ["resizestart", "resize", "resizestop"].indexOf(e) > -1 && this.ddResizable.off(e), this;
|
|
2659
2659
|
}
|
|
2660
2660
|
setupDraggable(e) {
|
|
2661
|
-
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new
|
|
2661
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new xe(this.el, e), this;
|
|
2662
2662
|
}
|
|
2663
2663
|
cleanDraggable() {
|
|
2664
2664
|
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
2665
2665
|
}
|
|
2666
2666
|
setupResizable(e) {
|
|
2667
|
-
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new
|
|
2667
|
+
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new Ee(this.el, e), this;
|
|
2668
2668
|
}
|
|
2669
2669
|
cleanResizable() {
|
|
2670
2670
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
2671
2671
|
}
|
|
2672
2672
|
setupDroppable(e) {
|
|
2673
|
-
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new
|
|
2673
|
+
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new Yi(this.el, e), this;
|
|
2674
2674
|
}
|
|
2675
2675
|
cleanDroppable() {
|
|
2676
2676
|
return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
|
|
2677
2677
|
}
|
|
2678
2678
|
}
|
|
2679
|
-
class
|
|
2679
|
+
class Xi {
|
|
2680
2680
|
resizable(e, t, i, s) {
|
|
2681
2681
|
return this._getDDElements(e).forEach((r) => {
|
|
2682
2682
|
if (t === "disable" || t === "enable")
|
|
@@ -2757,7 +2757,7 @@ class Ki {
|
|
|
2757
2757
|
const i = c.getElements(e);
|
|
2758
2758
|
if (!i.length)
|
|
2759
2759
|
return [];
|
|
2760
|
-
const s = i.map((r) => r.ddElement || (t ?
|
|
2760
|
+
const s = i.map((r) => r.ddElement || (t ? Ze.init(r) : null));
|
|
2761
2761
|
return t || s.filter((r) => r), s;
|
|
2762
2762
|
}
|
|
2763
2763
|
}
|
|
@@ -2768,8 +2768,8 @@ class Ki {
|
|
|
2768
2768
|
* Copyright (c) 2021-2024 Alain Dumesny
|
|
2769
2769
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
2770
2770
|
*/
|
|
2771
|
-
const
|
|
2772
|
-
class
|
|
2771
|
+
const q = new Xi();
|
|
2772
|
+
class _ {
|
|
2773
2773
|
/**
|
|
2774
2774
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
2775
2775
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -2786,8 +2786,8 @@ class w {
|
|
|
2786
2786
|
static init(e = {}, t = ".grid-stack") {
|
|
2787
2787
|
if (typeof document > "u")
|
|
2788
2788
|
return null;
|
|
2789
|
-
const i =
|
|
2790
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
2789
|
+
const i = _.getGridElement(t);
|
|
2790
|
+
return i ? (i.gridstack || (i.gridstack = new _(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 ?
|
|
2791
2791
|
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);
|
|
2792
2792
|
}
|
|
2793
2793
|
/**
|
|
@@ -2801,8 +2801,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2801
2801
|
*/
|
|
2802
2802
|
static initAll(e = {}, t = ".grid-stack") {
|
|
2803
2803
|
const i = [];
|
|
2804
|
-
return typeof document > "u" || (
|
|
2805
|
-
s.gridstack || (s.gridstack = new
|
|
2804
|
+
return typeof document > "u" || (_.getGridElements(t).forEach((s) => {
|
|
2805
|
+
s.gridstack || (s.gridstack = new _(s, c.cloneDeep(e))), i.push(s.gridstack);
|
|
2806
2806
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
2807
2807
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)), i;
|
|
2808
2808
|
}
|
|
@@ -2821,14 +2821,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2821
2821
|
const o = i.gridstack;
|
|
2822
2822
|
return t && (o.opts = { ...o.opts, ...t }), t.children !== void 0 && o.load(t.children), o;
|
|
2823
2823
|
}
|
|
2824
|
-
return (!e.classList.contains("grid-stack") ||
|
|
2824
|
+
return (!e.classList.contains("grid-stack") || _.addRemoveCB) && (_.addRemoveCB ? i = _.addRemoveCB(e, t, !0, !0) : i = c.createDiv(["grid-stack", t.class], e)), _.init(t, i);
|
|
2825
2825
|
}
|
|
2826
2826
|
/** call this method to register your engine instead of the default one.
|
|
2827
2827
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
2828
2828
|
* replace just one instance.
|
|
2829
2829
|
*/
|
|
2830
2830
|
static registerEngine(e) {
|
|
2831
|
-
|
|
2831
|
+
_.engineClass = e;
|
|
2832
2832
|
}
|
|
2833
2833
|
/** @internal create placeholder DIV as needed */
|
|
2834
2834
|
get placeholder() {
|
|
@@ -2845,7 +2845,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2845
2845
|
* @param opts grid options - public for classes to access, but use methods to modify!
|
|
2846
2846
|
*/
|
|
2847
2847
|
constructor(e, t = {}) {
|
|
2848
|
-
var l, f,
|
|
2848
|
+
var l, f, g;
|
|
2849
2849
|
this.el = e, this.opts = t, this.animationDelay = 310, this._gsEventHandler = {}, this._extraDragRow = 0, this.dragTransform = { xScale: 1, yScale: 1, xOffset: 0, yOffset: 0 }, e.gridstack = this, this.opts = t = t || {}, e.classList.contains("grid-stack") || this.el.classList.add("grid-stack"), t.row && (t.minRow = t.maxRow = t.row, delete t.row);
|
|
2850
2850
|
const i = c.toNumber(e.getAttribute("gs-row"));
|
|
2851
2851
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
@@ -2854,7 +2854,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2854
2854
|
if (r.oneColumnModeDomSort && (delete r.oneColumnModeDomSort, console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")), r.oneColumnSize || r.disableOneColumnMode === !1) {
|
|
2855
2855
|
const p = r.oneColumnSize || 768;
|
|
2856
2856
|
delete r.oneColumnSize, delete r.disableOneColumnMode, t.columnOpts = t.columnOpts || {}, s = t.columnOpts.breakpoints = t.columnOpts.breakpoints || [];
|
|
2857
|
-
let y = s.find((
|
|
2857
|
+
let y = s.find((m) => m.c === 1);
|
|
2858
2858
|
y ? y.w = p : (y = { c: 1, w: p }, s.push(y, { c: 12, w: p + 1 }));
|
|
2859
2859
|
}
|
|
2860
2860
|
const o = t.columnOpts;
|
|
@@ -2877,25 +2877,25 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2877
2877
|
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");
|
|
2878
2878
|
const d = this.el.closest("." + G.itemClass), h = d == null ? void 0 : d.gridstackNode;
|
|
2879
2879
|
h && (h.subGrid = this, this.parentGridNode = h, this.el.classList.add("grid-stack-nested"), h.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 !== G.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = Q), this._styleSheetClass = "gs-id-" + ee._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
2880
|
-
const a = t.engineClass ||
|
|
2880
|
+
const a = t.engineClass || _.engineClass || ee;
|
|
2881
2881
|
if (this.engine = new a({
|
|
2882
2882
|
column: this.getColumn(),
|
|
2883
2883
|
float: t.float,
|
|
2884
2884
|
maxRow: t.maxRow,
|
|
2885
2885
|
onChange: (p) => {
|
|
2886
2886
|
let y = 0;
|
|
2887
|
-
this.engine.nodes.forEach((
|
|
2888
|
-
y = Math.max(y,
|
|
2889
|
-
}), p.forEach((
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2887
|
+
this.engine.nodes.forEach((m) => {
|
|
2888
|
+
y = Math.max(y, m.y + m.h);
|
|
2889
|
+
}), p.forEach((m) => {
|
|
2890
|
+
const E = m.el;
|
|
2891
|
+
E && (m._removeDOM ? (E && E.remove(), delete m._removeDOM) : this._writePosAttr(E, m));
|
|
2892
2892
|
}), this._updateStyles(!1, y);
|
|
2893
2893
|
}
|
|
2894
2894
|
}), this._updateStyles(!1, 0), t.auto && (this.batchUpdate(), this.engine._loading = !0, this.getGridItems().forEach((p) => this._prepareElement(p)), delete this.engine._loading, this.batchUpdate(!1)), t.children) {
|
|
2895
2895
|
const p = t.children;
|
|
2896
2896
|
delete t.children, p.length && this.load(p);
|
|
2897
2897
|
}
|
|
2898
|
-
this.setAnimation(), t.subGridDynamic && !b.pauseDrag && (b.pauseDrag = !0), ((
|
|
2898
|
+
this.setAnimation(), t.subGridDynamic && !b.pauseDrag && (b.pauseDrag = !0), ((g = t.draggable) == null ? void 0 : g.pause) !== void 0 && (b.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
2899
2899
|
}
|
|
2900
2900
|
/**
|
|
2901
2901
|
* add a new widget and returns it.
|
|
@@ -2918,7 +2918,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2918
2918
|
if (e.ELEMENT_NODE)
|
|
2919
2919
|
return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"), this.makeWidget(e);
|
|
2920
2920
|
let t, i = e;
|
|
2921
|
-
if (i.grid = this, i != null && i.el ? t = i.el :
|
|
2921
|
+
if (i.grid = this, i != null && i.el ? t = i.el : _.addRemoveCB ? t = _.addRemoveCB(this.el, e, !0, !1) : t = c.createWidgetDivs(this.opts.itemClass, i), !t)
|
|
2922
2922
|
return;
|
|
2923
2923
|
if (i = t.gridstackNode, i && t.parentElement === this.el && this.engine.nodes.find((r) => r._id === i._id))
|
|
2924
2924
|
return t;
|
|
@@ -2935,9 +2935,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2935
2935
|
* @returns newly created grid
|
|
2936
2936
|
*/
|
|
2937
2937
|
makeSubGrid(e, t, i, s = !0) {
|
|
2938
|
-
var
|
|
2938
|
+
var g, p, y;
|
|
2939
2939
|
let r = e.gridstackNode;
|
|
2940
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
2940
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (g = r.subGrid) != null && g.el)
|
|
2941
2941
|
return r.subGrid;
|
|
2942
2942
|
let o, n = this;
|
|
2943
2943
|
for (; n && !o; )
|
|
@@ -2957,11 +2957,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2957
2957
|
let d;
|
|
2958
2958
|
t.column === "auto" && (d = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
|
|
2959
2959
|
let h = r.el.querySelector(".grid-stack-item-content"), a, l;
|
|
2960
|
-
if (s && (this._removeDD(r.el), l = { ...r, x: 0, y: 0 }, c.removeInternalForSave(l), delete l.subGridOpts, r.content && (l.content = r.content, delete r.content),
|
|
2961
|
-
const
|
|
2962
|
-
|
|
2960
|
+
if (s && (this._removeDD(r.el), l = { ...r, x: 0, y: 0 }, c.removeInternalForSave(l), delete l.subGridOpts, r.content && (l.content = r.content, delete r.content), _.addRemoveCB ? a = _.addRemoveCB(this.el, l, !0, !1) : (a = c.createDiv(["grid-stack-item"]), a.appendChild(h), h = c.createDiv(["grid-stack-item-content"], r.el)), this._prepareDragDropByNode(r)), i) {
|
|
2961
|
+
const m = d ? t.column : r.w, E = r.h + i.h, N = r.el.style;
|
|
2962
|
+
N.transition = "none", this.update(r.el, { w: m, h: E }), setTimeout(() => N.transition = null);
|
|
2963
2963
|
}
|
|
2964
|
-
const f = r.subGrid =
|
|
2964
|
+
const f = r.subGrid = _.addGrid(h, t);
|
|
2965
2965
|
return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(a, l), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
|
|
2966
2966
|
}
|
|
2967
2967
|
/**
|
|
@@ -2984,7 +2984,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2984
2984
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
2985
2985
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
2986
2986
|
*/
|
|
2987
|
-
save(e = !0, t = !1, i =
|
|
2987
|
+
save(e = !0, t = !1, i = _.saveCB) {
|
|
2988
2988
|
const s = this.engine.save(e, i);
|
|
2989
2989
|
if (s.forEach((r) => {
|
|
2990
2990
|
var o;
|
|
@@ -3014,7 +3014,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3014
3014
|
* @example
|
|
3015
3015
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3016
3016
|
*/
|
|
3017
|
-
load(e, t =
|
|
3017
|
+
load(e, t = _.addRemoveCB || !0) {
|
|
3018
3018
|
var h;
|
|
3019
3019
|
e = c.cloneDeep(e);
|
|
3020
3020
|
const i = this.getColumn();
|
|
@@ -3025,15 +3025,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3025
3025
|
e.forEach((a) => {
|
|
3026
3026
|
s = Math.max(s, (a.x || 0) + a.w);
|
|
3027
3027
|
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
|
|
3028
|
-
const r =
|
|
3029
|
-
typeof t == "function" && (
|
|
3028
|
+
const r = _.addRemoveCB;
|
|
3029
|
+
typeof t == "function" && (_.addRemoveCB = t);
|
|
3030
3030
|
const o = [];
|
|
3031
3031
|
this.batchUpdate();
|
|
3032
3032
|
const n = !this.engine.nodes.length;
|
|
3033
3033
|
n && this.setAnimation(!1), !n && t && [...this.engine.nodes].forEach((l) => {
|
|
3034
3034
|
if (!l.id)
|
|
3035
3035
|
return;
|
|
3036
|
-
c.find(e, l.id) || (
|
|
3036
|
+
c.find(e, l.id) || (_.addRemoveCB && _.addRemoveCB(this.el, l, !1, !1), o.push(l), this.removeWidget(l.el, !0, !1));
|
|
3037
3037
|
}), this.engine._loading = !0;
|
|
3038
3038
|
const d = [];
|
|
3039
3039
|
return this.engine.nodes = this.engine.nodes.filter((a) => c.find(e, a.id) ? (d.push(a), !1) : !0), e.forEach((a) => {
|
|
@@ -3041,11 +3041,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3041
3041
|
const l = c.find(d, a.id);
|
|
3042
3042
|
if (l) {
|
|
3043
3043
|
if (c.shouldSizeToContent(l) && (a.h = l.h), this.engine.nodeBoundFix(a), (a.autoPosition || a.x === void 0 || a.y === void 0) && (a.w = a.w || l.w, a.h = a.h || l.h, this.engine.findEmptyPosition(a)), this.engine.nodes.push(l), c.samePos(l, a) && this.engine.nodes.length > 1 && (this.moveNode(l, { ...a, forceCollide: !0 }), c.copyPos(a, l)), this.update(l.el, a), (f = a.subGridOpts) != null && f.children) {
|
|
3044
|
-
const
|
|
3045
|
-
|
|
3044
|
+
const g = l.el.querySelector(".grid-stack");
|
|
3045
|
+
g && g.gridstack && g.gridstack.load(a.subGridOpts.children);
|
|
3046
3046
|
}
|
|
3047
3047
|
} else t && this.addWidget(a);
|
|
3048
|
-
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ?
|
|
3048
|
+
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? _.addRemoveCB = r : delete _.addRemoveCB, n && ((h = this.opts) != null && h.animate) && this.setAnimation(this.opts.animate, !0), this;
|
|
3049
3049
|
}
|
|
3050
3050
|
/**
|
|
3051
3051
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3234,7 +3234,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3234
3234
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3235
3235
|
*/
|
|
3236
3236
|
makeWidget(e, t) {
|
|
3237
|
-
const i =
|
|
3237
|
+
const i = _.getElement(e);
|
|
3238
3238
|
if (!i)
|
|
3239
3239
|
return;
|
|
3240
3240
|
i.parentElement || this.el.appendChild(i), this._prepareElement(i, !0, t);
|
|
@@ -3266,11 +3266,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3266
3266
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3267
3267
|
*/
|
|
3268
3268
|
removeWidget(e, t = !0, i = !0) {
|
|
3269
|
-
return e ? (
|
|
3269
|
+
return e ? (_.getElements(e).forEach((s) => {
|
|
3270
3270
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3271
3271
|
return;
|
|
3272
3272
|
let r = s.gridstackNode;
|
|
3273
|
-
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t &&
|
|
3273
|
+
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t && _.addRemoveCB && _.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3274
3274
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this) : (console.error("Error: GridStack.removeWidget(undefined) called"), this);
|
|
3275
3275
|
}
|
|
3276
3276
|
/**
|
|
@@ -3280,7 +3280,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3280
3280
|
*/
|
|
3281
3281
|
removeAll(e = !0, t = !0) {
|
|
3282
3282
|
return this.engine.nodes.forEach((i) => {
|
|
3283
|
-
e &&
|
|
3283
|
+
e && _.addRemoveCB && _.addRemoveCB(this.el, i, !1, !1), delete i.el.gridstackNode, this.opts.staticGrid || this._removeDD(i.el);
|
|
3284
3284
|
}), this.engine.removeAll(e, t), t && this._triggerRemoveEvent(), this;
|
|
3285
3285
|
}
|
|
3286
3286
|
/**
|
|
@@ -3321,7 +3321,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3321
3321
|
let s = 1;
|
|
3322
3322
|
return t = { x: i[s++], y: i[s++], w: i[s++], h: i[s++] }, this.update(e, t);
|
|
3323
3323
|
}
|
|
3324
|
-
return
|
|
3324
|
+
return _.getElements(e).forEach((i) => {
|
|
3325
3325
|
var a;
|
|
3326
3326
|
const s = i == null ? void 0 : i.gridstackNode;
|
|
3327
3327
|
if (!s)
|
|
@@ -3334,7 +3334,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3334
3334
|
n[l] = r[l] !== void 0 ? r[l] : s[l], delete r[l];
|
|
3335
3335
|
})), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
|
|
3336
3336
|
const l = i.querySelector(".grid-stack-item-content");
|
|
3337
|
-
l && l.textContent !== r.content && (s.content = r.content,
|
|
3337
|
+
l && l.textContent !== r.content && (s.content = r.content, _.renderCB(l, r), (a = s.subGrid) != null && a.el && (l.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
|
|
3338
3338
|
}
|
|
3339
3339
|
let d = !1, h = !1;
|
|
3340
3340
|
for (const l in r)
|
|
@@ -3357,7 +3357,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3357
3357
|
* @param useNodeH set to true if GridStackNode.h should be used instead of actual container height when we don't need to wait for animation to finish to get actual DOM heights
|
|
3358
3358
|
*/
|
|
3359
3359
|
resizeToContent(e) {
|
|
3360
|
-
var f,
|
|
3360
|
+
var f, g;
|
|
3361
3361
|
if (!e || (e.classList.remove("size-to-content-max"), !e.clientHeight))
|
|
3362
3362
|
return;
|
|
3363
3363
|
const t = e.gridstackNode;
|
|
@@ -3370,7 +3370,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3370
3370
|
if (!s)
|
|
3371
3371
|
return;
|
|
3372
3372
|
let r = t.h ? t.h * s : e.clientHeight, o;
|
|
3373
|
-
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(
|
|
3373
|
+
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(_.resizeToContentParent)), !o)
|
|
3374
3374
|
return;
|
|
3375
3375
|
const n = e.clientHeight - o.clientHeight, d = t.h ? t.h * s - n : o.clientHeight;
|
|
3376
3376
|
let h;
|
|
@@ -3379,12 +3379,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3379
3379
|
const p = t.subGrid.el.getBoundingClientRect(), y = t.subGrid.el.parentElement.getBoundingClientRect();
|
|
3380
3380
|
h += p.top - y.top;
|
|
3381
3381
|
} else {
|
|
3382
|
-
if ((
|
|
3382
|
+
if ((g = (f = t.subGridOpts) == null ? void 0 : f.children) != null && g.length)
|
|
3383
3383
|
return;
|
|
3384
3384
|
{
|
|
3385
3385
|
const p = o.firstElementChild;
|
|
3386
3386
|
if (!p) {
|
|
3387
|
-
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${
|
|
3387
|
+
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${_.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
3388
3388
|
return;
|
|
3389
3389
|
}
|
|
3390
3390
|
h = p.getBoundingClientRect().height || d;
|
|
@@ -3399,14 +3399,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3399
3399
|
}
|
|
3400
3400
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
3401
3401
|
resizeToContentCBCheck(e) {
|
|
3402
|
-
|
|
3402
|
+
_.resizeToContentCB ? _.resizeToContentCB(e) : this.resizeToContent(e);
|
|
3403
3403
|
}
|
|
3404
3404
|
/** rotate (by swapping w & h) the passed in node - called when user press 'r' during dragging
|
|
3405
3405
|
* @param els widget or selector of objects to modify
|
|
3406
3406
|
* @param relative optional pixel coord relative to upper/left corner to rotate around (will keep that cell under cursor)
|
|
3407
3407
|
*/
|
|
3408
3408
|
rotate(e, t) {
|
|
3409
|
-
return
|
|
3409
|
+
return _.getElements(e).forEach((i) => {
|
|
3410
3410
|
const s = i.gridstackNode;
|
|
3411
3411
|
if (!c.canBeRotated(s))
|
|
3412
3412
|
return;
|
|
@@ -3633,7 +3633,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3633
3633
|
}
|
|
3634
3634
|
/** @internal */
|
|
3635
3635
|
static getGridElement(e) {
|
|
3636
|
-
return
|
|
3636
|
+
return _.getElement(e);
|
|
3637
3637
|
}
|
|
3638
3638
|
/** @internal */
|
|
3639
3639
|
static getGridElements(e) {
|
|
@@ -3651,7 +3651,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3651
3651
|
*/
|
|
3652
3652
|
/** get the global (but static to this code) DD implementation */
|
|
3653
3653
|
static getDD() {
|
|
3654
|
-
return
|
|
3654
|
+
return q;
|
|
3655
3655
|
}
|
|
3656
3656
|
/**
|
|
3657
3657
|
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
@@ -3664,7 +3664,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3664
3664
|
*/
|
|
3665
3665
|
static setupDragIn(e, t, i, s = document) {
|
|
3666
3666
|
(t == null ? void 0 : t.pause) !== void 0 && (b.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((o, n) => {
|
|
3667
|
-
|
|
3667
|
+
q.isDraggable(o) || q.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
|
|
3668
3668
|
});
|
|
3669
3669
|
}
|
|
3670
3670
|
/**
|
|
@@ -3674,7 +3674,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3674
3674
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
3675
3675
|
*/
|
|
3676
3676
|
movable(e, t) {
|
|
3677
|
-
return this.opts.staticGrid ? this : (
|
|
3677
|
+
return this.opts.staticGrid ? this : (_.getElements(e).forEach((i) => {
|
|
3678
3678
|
const s = i.gridstackNode;
|
|
3679
3679
|
s && (t ? delete s.noMove : s.noMove = !0, this._prepareDragDropByNode(s));
|
|
3680
3680
|
}), this);
|
|
@@ -3685,7 +3685,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3685
3685
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
3686
3686
|
*/
|
|
3687
3687
|
resizable(e, t) {
|
|
3688
|
-
return this.opts.staticGrid ? this : (
|
|
3688
|
+
return this.opts.staticGrid ? this : (_.getElements(e).forEach((i) => {
|
|
3689
3689
|
const s = i.gridstackNode;
|
|
3690
3690
|
s && (t ? delete s.noResize : s.noResize = !0, this._prepareDragDropByNode(s));
|
|
3691
3691
|
}), this);
|
|
@@ -3739,16 +3739,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3739
3739
|
cancelDrag() {
|
|
3740
3740
|
var t;
|
|
3741
3741
|
const e = (t = this._placeholder) == null ? void 0 : t.gridstackNode;
|
|
3742
|
-
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove &&
|
|
3742
|
+
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove && _._itemRemoving(e.el, !1), this.engine.restoreInitial());
|
|
3743
3743
|
}
|
|
3744
3744
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
3745
3745
|
_removeDD(e) {
|
|
3746
|
-
return
|
|
3746
|
+
return q.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
|
|
3747
3747
|
}
|
|
3748
3748
|
/** @internal called to add drag over to support widgets being added externally */
|
|
3749
3749
|
_setupAcceptWidget() {
|
|
3750
3750
|
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
3751
|
-
return
|
|
3751
|
+
return q.droppable(this.el, "destroy"), this;
|
|
3752
3752
|
let e, t;
|
|
3753
3753
|
const i = (s, r, o) => {
|
|
3754
3754
|
var f;
|
|
@@ -3758,8 +3758,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3758
3758
|
return;
|
|
3759
3759
|
if (!((f = n.grid) != null && f.el)) {
|
|
3760
3760
|
o.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
|
|
3761
|
-
const
|
|
3762
|
-
o.style.left =
|
|
3761
|
+
const g = o.getBoundingClientRect();
|
|
3762
|
+
o.style.left = g.x + (this.dragTransform.xScale - 1) * (s.clientX - g.x) / this.dragTransform.xScale + "px", o.style.top = g.y + (this.dragTransform.yScale - 1) * (s.clientY - g.y) / this.dragTransform.yScale + "px", o.style.transformOrigin = "0px 0px";
|
|
3763
3763
|
}
|
|
3764
3764
|
let { top: d, left: h } = o.getBoundingClientRect();
|
|
3765
3765
|
const a = this.el.getBoundingClientRect();
|
|
@@ -3773,7 +3773,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3773
3773
|
if (n._temporaryRemoved) {
|
|
3774
3774
|
if (n.x = Math.max(0, Math.round(h / t)), n.y = Math.max(0, Math.round(d / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
|
|
3775
3775
|
if (n.autoPosition = !0, !this.engine.willItFit(n)) {
|
|
3776
|
-
|
|
3776
|
+
q.off(r, "drag");
|
|
3777
3777
|
return;
|
|
3778
3778
|
}
|
|
3779
3779
|
n._willFitPos && (c.copyPos(n, n._willFitPos), delete n._willFitPos);
|
|
@@ -3782,7 +3782,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3782
3782
|
} else
|
|
3783
3783
|
this._dragOrResize(o, s, l, n, t, e);
|
|
3784
3784
|
};
|
|
3785
|
-
return
|
|
3785
|
+
return q.droppable(this.el, {
|
|
3786
3786
|
accept: (s) => {
|
|
3787
3787
|
const r = s.gridstackNode || this._readAttr(s, !1);
|
|
3788
3788
|
if ((r == null ? void 0 : r.grid) === this)
|
|
@@ -3821,12 +3821,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3821
3821
|
n.grid || (n.el || (n = { ...n }), n._isExternal = !0, o.gridstackNode = n);
|
|
3822
3822
|
const d = n.w || Math.round(o.offsetWidth / t) || 1, h = n.h || Math.round(o.offsetHeight / e) || 1;
|
|
3823
3823
|
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h, 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
|
|
3824
|
-
n._temporaryRemoved = !0) : (n.w = d, n.h = h, n._temporaryRemoved = !0),
|
|
3824
|
+
n._temporaryRemoved = !0) : (n.w = d, n.h = h, n._temporaryRemoved = !0), _._itemRemoving(n.el, !1), q.on(r, "drag", i), i(s, r, o), !1;
|
|
3825
3825
|
}).on(this.el, "dropout", (s, r, o) => {
|
|
3826
3826
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3827
3827
|
return n && (!n.grid || n.grid === this) && (this._leave(r, o), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
3828
3828
|
}).on(this.el, "drop", (s, r, o) => {
|
|
3829
|
-
var
|
|
3829
|
+
var g, p, y;
|
|
3830
3830
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3831
3831
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
3832
3832
|
return !1;
|
|
@@ -3836,13 +3836,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3836
3836
|
a && this.setAnimation(!1);
|
|
3837
3837
|
const l = r._gridstackNodeOrig;
|
|
3838
3838
|
if (delete r._gridstackNodeOrig, d && (l != null && l.grid) && l.grid !== this) {
|
|
3839
|
-
const
|
|
3840
|
-
|
|
3839
|
+
const m = l.grid;
|
|
3840
|
+
m.engine.removeNodeFromLayoutCache(l), m.engine.removedNodes.push(l), m._triggerRemoveEvent()._triggerChangeEvent(), m.parentGridNode && !m.engine.nodes.length && m.opts.subGridDynamic && m.removeAsSubGrid();
|
|
3841
3841
|
}
|
|
3842
|
-
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (
|
|
3842
|
+
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (g = n.grid) == null || delete g._isTemp, q.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !d))
|
|
3843
3843
|
return !1;
|
|
3844
3844
|
const f = (y = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : y.gridstack;
|
|
3845
|
-
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), h && (n.content || n.subGridOpts ||
|
|
3845
|
+
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), h && (n.content || n.subGridOpts || _.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" }, l && l.grid ? l : void 0, n), a && this.setAnimation(this.opts.animate, !0), !1;
|
|
3846
3846
|
}), this;
|
|
3847
3847
|
}
|
|
3848
3848
|
/** @internal mark item for removal */
|
|
@@ -3857,7 +3857,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3857
3857
|
if (typeof this.opts.removable != "string")
|
|
3858
3858
|
return this;
|
|
3859
3859
|
const e = document.querySelector(this.opts.removable);
|
|
3860
|
-
return e ? (!this.opts.staticGrid && !
|
|
3860
|
+
return e ? (!this.opts.staticGrid && !q.isDroppable(e) && q.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => _._itemRemoving(i, !0)).on(e, "dropout", (t, i) => _._itemRemoving(i, !1)), this) : this;
|
|
3861
3861
|
}
|
|
3862
3862
|
/** @internal prepares the element for drag&drop */
|
|
3863
3863
|
_prepareDragDropByNode(e) {
|
|
@@ -3875,14 +3875,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3875
3875
|
const l = e.w !== e._orig.w, f = a.target;
|
|
3876
3876
|
if (!(!f.gridstackNode || f.gridstackNode.grid !== this)) {
|
|
3877
3877
|
if (e.el = f, e._isAboutToRemove) {
|
|
3878
|
-
const
|
|
3879
|
-
|
|
3878
|
+
const g = t.gridstackNode.grid;
|
|
3879
|
+
g._gsEventHandler[a.type] && g._gsEventHandler[a.type](a, f), g.engine.nodes.push(e), g.removeWidget(t, !0, !0);
|
|
3880
3880
|
} else
|
|
3881
3881
|
c.removePositioningStyles(f), e._temporaryRemoved ? (c.copyPos(e, e._orig), this._writePosAttr(f, e), this.engine.addNode(e)) : this._writePosAttr(f, e), this._gsEventHandler[a.type] && this._gsEventHandler[a.type](a, f);
|
|
3882
3882
|
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), a.type === "resizestop" && (Number.isInteger(e.sizeToContent) && (e.sizeToContent = e.h), this.resizeToContentCheck(l, e));
|
|
3883
3883
|
}
|
|
3884
3884
|
};
|
|
3885
|
-
|
|
3885
|
+
q.draggable(t, {
|
|
3886
3886
|
start: n,
|
|
3887
3887
|
stop: h,
|
|
3888
3888
|
drag: d
|
|
@@ -3892,7 +3892,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3892
3892
|
resize: d
|
|
3893
3893
|
}), e._initDD = !0;
|
|
3894
3894
|
}
|
|
3895
|
-
return
|
|
3895
|
+
return q.draggable(t, i ? "disable" : "enable").resizable(t, s ? "disable" : "enable"), this;
|
|
3896
3896
|
}
|
|
3897
3897
|
/** @internal handles actual drag/resize start */
|
|
3898
3898
|
_onStartMoving(e, t, i, s, r, o) {
|
|
@@ -3911,35 +3911,35 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3911
3911
|
};
|
|
3912
3912
|
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") {
|
|
3913
3913
|
const d = this.getColumn() - s.x, h = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
|
|
3914
|
-
|
|
3914
|
+
q.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, d)).resizable(e, "option", "minHeight", o * Math.min(s.minH || 1, h)).resizable(e, "option", "maxWidth", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, d)).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, h)).resizable(e, "option", "maxHeightMoveUp", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
|
|
3915
3915
|
}
|
|
3916
3916
|
}
|
|
3917
3917
|
/** @internal handles actual drag/resize */
|
|
3918
3918
|
_dragOrResize(e, t, i, s, r, o) {
|
|
3919
3919
|
const n = { ...s._orig };
|
|
3920
3920
|
let d, h = this.opts.marginLeft, a = this.opts.marginRight, l = this.opts.marginTop, f = this.opts.marginBottom;
|
|
3921
|
-
const
|
|
3922
|
-
if (h = Math.min(h, p), a = Math.min(a, p), l = Math.min(l,
|
|
3921
|
+
const g = Math.round(o * 0.1), p = Math.round(r * 0.1);
|
|
3922
|
+
if (h = Math.min(h, p), a = Math.min(a, p), l = Math.min(l, g), f = Math.min(f, g), t.type === "drag") {
|
|
3923
3923
|
if (s._temporaryRemoved)
|
|
3924
3924
|
return;
|
|
3925
|
-
const
|
|
3926
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position,
|
|
3927
|
-
const
|
|
3928
|
-
n.x = Math.round(
|
|
3929
|
-
const
|
|
3925
|
+
const m = i.position.top - s._prevYPix;
|
|
3926
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, m);
|
|
3927
|
+
const E = i.position.left + (i.position.left > s._lastUiPosition.left ? -a : h), N = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : l);
|
|
3928
|
+
n.x = Math.round(E / r), n.y = Math.round(N / o);
|
|
3929
|
+
const R = this._extraDragRow;
|
|
3930
3930
|
if (this.engine.collide(s, n)) {
|
|
3931
|
-
const
|
|
3932
|
-
let
|
|
3933
|
-
this.opts.maxRow &&
|
|
3931
|
+
const H = this.getRow();
|
|
3932
|
+
let z = Math.max(0, n.y + s.h - H);
|
|
3933
|
+
this.opts.maxRow && H + z > this.opts.maxRow && (z = Math.max(0, this.opts.maxRow - H)), this._extraDragRow = z;
|
|
3934
3934
|
} else
|
|
3935
3935
|
this._extraDragRow = 0;
|
|
3936
|
-
if (this._extraDragRow !==
|
|
3936
|
+
if (this._extraDragRow !== R && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
3937
3937
|
return;
|
|
3938
3938
|
} else if (t.type === "resize") {
|
|
3939
3939
|
if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width - h) / r), n.h = Math.round((i.size.height - l) / o), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
3940
3940
|
return;
|
|
3941
|
-
const
|
|
3942
|
-
n.x = Math.round(
|
|
3941
|
+
const m = i.position.left + h, E = i.position.top + l;
|
|
3942
|
+
n.x = Math.round(m / r), n.y = Math.round(E / o), d = !0;
|
|
3943
3943
|
}
|
|
3944
3944
|
s._event = t, s._lastTried = n;
|
|
3945
3945
|
const y = {
|
|
@@ -3950,8 +3950,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3950
3950
|
};
|
|
3951
3951
|
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: o, rect: y, resizing: d })) {
|
|
3952
3952
|
s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l, a, f, h), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
3953
|
-
const
|
|
3954
|
-
this._writePosAttr(
|
|
3953
|
+
const m = t.target;
|
|
3954
|
+
this._writePosAttr(m, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, m);
|
|
3955
3955
|
}
|
|
3956
3956
|
}
|
|
3957
3957
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -3961,21 +3961,21 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3961
3961
|
_leave(e, t) {
|
|
3962
3962
|
t = t || e;
|
|
3963
3963
|
const i = t.gridstackNode;
|
|
3964
|
-
i && (t.style.transform = t.style.transformOrigin = null,
|
|
3964
|
+
i && (t.style.transform = t.style.transformOrigin = null, q.off(e, "drag"), !i._temporaryRemoved && (i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e, i._isExternal && this.engine.cleanupNode(i), this.opts.removable === !0 && _._itemRemoving(e, !0), e._gridstackNodeOrig ? (e.gridstackNode = e._gridstackNodeOrig, delete e._gridstackNodeOrig) : i._isExternal && this.engine.restoreInitial()));
|
|
3965
3965
|
}
|
|
3966
3966
|
// legacy method removed
|
|
3967
3967
|
commit() {
|
|
3968
|
-
return
|
|
3968
|
+
return Vi(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
3969
3969
|
}
|
|
3970
3970
|
}
|
|
3971
|
-
|
|
3971
|
+
_.renderCB = (u, e) => {
|
|
3972
3972
|
u && (e != null && e.content) && (u.textContent = e.content);
|
|
3973
3973
|
};
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
const
|
|
3974
|
+
_.resizeToContentParent = ".grid-stack-item-content";
|
|
3975
|
+
_.Utils = c;
|
|
3976
|
+
_.Engine = ee;
|
|
3977
|
+
_.GDRev = "11.3.0";
|
|
3978
|
+
const ji = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qi = { class: "grid-stack-item-content" }, Zi = /* @__PURE__ */ W({
|
|
3979
3979
|
__name: "DraggableGridLayout",
|
|
3980
3980
|
props: {
|
|
3981
3981
|
tiles: {},
|
|
@@ -3984,11 +3984,11 @@ const Yi = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Xi = { cl
|
|
|
3984
3984
|
},
|
|
3985
3985
|
emits: ["update-tiles"],
|
|
3986
3986
|
setup(u, { expose: e, emit: t }) {
|
|
3987
|
-
const i = u, s = t, r =
|
|
3987
|
+
const i = u, s = t, r = F(null), o = F(new Map(i.tiles.map((g) => [`${g.id}`, g])));
|
|
3988
3988
|
let n = null;
|
|
3989
|
-
const d = (
|
|
3990
|
-
var
|
|
3991
|
-
const y = o.value.get(`${(
|
|
3989
|
+
const d = (g) => `[data-id="${g}"]`, h = (g) => g.map((p) => {
|
|
3990
|
+
var m;
|
|
3991
|
+
const y = o.value.get(`${(m = p.el) == null ? void 0 : m.getAttribute("data-id")}`);
|
|
3992
3992
|
if (y)
|
|
3993
3993
|
return {
|
|
3994
3994
|
...y,
|
|
@@ -3997,18 +3997,18 @@ const Yi = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Xi = { cl
|
|
|
3997
3997
|
size: { cols: Number(p.w), rows: Number(p.h) }
|
|
3998
3998
|
}
|
|
3999
3999
|
};
|
|
4000
|
-
}).filter((p) => p !== void 0), a = (
|
|
4001
|
-
n && (h(p).forEach((
|
|
4002
|
-
o.value.set(`${
|
|
4000
|
+
}).filter((p) => p !== void 0), a = (g, p) => {
|
|
4001
|
+
n && (h(p).forEach((m) => {
|
|
4002
|
+
o.value.set(`${m.id}`, m);
|
|
4003
4003
|
}), s("update-tiles", Array.from(o.value.values())));
|
|
4004
|
-
}, l = (
|
|
4004
|
+
}, l = (g, p) => {
|
|
4005
4005
|
p.forEach((y) => {
|
|
4006
|
-
var
|
|
4007
|
-
o.value.delete(`${(
|
|
4006
|
+
var m;
|
|
4007
|
+
o.value.delete(`${(m = y.el) == null ? void 0 : m.getAttribute("data-id")}`);
|
|
4008
4008
|
}), s("update-tiles", Array.from(o.value.values()));
|
|
4009
4009
|
};
|
|
4010
|
-
|
|
4011
|
-
r.value && (n =
|
|
4010
|
+
Ke(() => {
|
|
4011
|
+
r.value && (n = _.init({
|
|
4012
4012
|
column: i.gridSize.cols,
|
|
4013
4013
|
cellHeight: i.tileHeight,
|
|
4014
4014
|
resizable: { handles: "se, sw" },
|
|
@@ -4017,32 +4017,32 @@ const Yi = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Xi = { cl
|
|
|
4017
4017
|
}), Ue(() => {
|
|
4018
4018
|
n && n.destroy(!1);
|
|
4019
4019
|
});
|
|
4020
|
-
const f = (
|
|
4020
|
+
const f = (g) => {
|
|
4021
4021
|
if (n && r.value) {
|
|
4022
|
-
const p = r.value.querySelector(d(
|
|
4022
|
+
const p = r.value.querySelector(d(g));
|
|
4023
4023
|
p && n.removeWidget(p);
|
|
4024
4024
|
}
|
|
4025
4025
|
};
|
|
4026
|
-
return
|
|
4027
|
-
if (
|
|
4026
|
+
return Ge(() => i.tiles.length, async (g, p) => {
|
|
4027
|
+
if (g > p && n) {
|
|
4028
4028
|
const y = i.tiles.slice(p);
|
|
4029
|
-
for (const
|
|
4030
|
-
o.value.set(`${
|
|
4029
|
+
for (const m of y)
|
|
4030
|
+
o.value.set(`${m.id}`, m), await _t(), n.makeWidget(d(m.id), {
|
|
4031
4031
|
autoPosition: !0,
|
|
4032
|
-
w:
|
|
4033
|
-
h:
|
|
4032
|
+
w: m.layout.size.cols,
|
|
4033
|
+
h: m.layout.size.rows
|
|
4034
4034
|
});
|
|
4035
4035
|
}
|
|
4036
|
-
}),
|
|
4037
|
-
i.tiles.forEach((
|
|
4038
|
-
o.value.set(`${
|
|
4036
|
+
}), pt(() => {
|
|
4037
|
+
i.tiles.forEach((g) => {
|
|
4038
|
+
o.value.set(`${g.id}`, g);
|
|
4039
4039
|
});
|
|
4040
|
-
}), e({ removeWidget: f }), (
|
|
4040
|
+
}), e({ removeWidget: f }), (g, p) => (C(), U("div", {
|
|
4041
4041
|
ref_key: "gridContainer",
|
|
4042
4042
|
ref: r,
|
|
4043
4043
|
class: "grid-stack"
|
|
4044
4044
|
}, [
|
|
4045
|
-
(C(!0),
|
|
4045
|
+
(C(!0), U(bt, null, Et(i.tiles, (y) => (C(), U("div", {
|
|
4046
4046
|
key: y.id,
|
|
4047
4047
|
class: "grid-stack-item",
|
|
4048
4048
|
"data-id": `${y.id}`,
|
|
@@ -4053,46 +4053,46 @@ const Yi = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Xi = { cl
|
|
|
4053
4053
|
"gs-x": y.layout.position.col,
|
|
4054
4054
|
"gs-y": y.layout.position.row
|
|
4055
4055
|
}, [
|
|
4056
|
-
|
|
4057
|
-
|
|
4056
|
+
fe("div", Qi, [
|
|
4057
|
+
Ie(g.$slots, "tile", { tile: y }, void 0, !0)
|
|
4058
4058
|
])
|
|
4059
|
-
], 8,
|
|
4059
|
+
], 8, ji))), 128))
|
|
4060
4060
|
], 512));
|
|
4061
4061
|
}
|
|
4062
|
-
}),
|
|
4062
|
+
}), Ji = /* @__PURE__ */ de(Zi, [["__scopeId", "data-v-f4f87f74"]]), es = { class: "kong-ui-public-dashboard-renderer" }, ts = {
|
|
4063
4063
|
key: 0,
|
|
4064
4064
|
class: "tile-container slottable-tile"
|
|
4065
|
-
},
|
|
4065
|
+
}, is = /* @__PURE__ */ W({
|
|
4066
4066
|
__name: "DashboardRenderer",
|
|
4067
|
-
props: /* @__PURE__ */
|
|
4067
|
+
props: /* @__PURE__ */ st({
|
|
4068
4068
|
context: {}
|
|
4069
4069
|
}, {
|
|
4070
4070
|
modelValue: { required: !0 },
|
|
4071
4071
|
modelModifiers: {}
|
|
4072
4072
|
}),
|
|
4073
|
-
emits: /* @__PURE__ */
|
|
4073
|
+
emits: /* @__PURE__ */ st(["edit-tile", "zoom-time-range"], ["update:modelValue"]),
|
|
4074
4074
|
setup(u, { expose: e, emit: t }) {
|
|
4075
|
-
const i = u, s = t, r =
|
|
4076
|
-
h || (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")),
|
|
4077
|
-
const a =
|
|
4075
|
+
const i = u, s = t, r = Ut(u, "modelValue"), { i18n: o } = he.useI18n(), n = F(0), d = F(null), h = _e(le);
|
|
4076
|
+
h || (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")), he.useRequestQueue();
|
|
4077
|
+
const a = Ct(), l = L(() => i.context.timeSpec ? i.context.timeSpec : {
|
|
4078
4078
|
type: "relative",
|
|
4079
4079
|
time_range: a.defaultQueryTimeForOrg
|
|
4080
|
-
}), f =
|
|
4081
|
-
const
|
|
4082
|
-
return
|
|
4083
|
-
}, p =
|
|
4084
|
-
var
|
|
4085
|
-
let
|
|
4086
|
-
if ("description" in
|
|
4087
|
-
const
|
|
4088
|
-
const
|
|
4089
|
-
return o.te(
|
|
4080
|
+
}), f = L(() => !!i.context.timeSpec || !a.loading), g = (x, k) => {
|
|
4081
|
+
const D = x.layout.position.row - k.layout.position.row;
|
|
4082
|
+
return D !== 0 ? D : x.layout.position.col - k.layout.position.col;
|
|
4083
|
+
}, p = L(() => r.value.tiles.map((x) => {
|
|
4084
|
+
var D;
|
|
4085
|
+
let k = x.definition;
|
|
4086
|
+
if ("description" in k.chart) {
|
|
4087
|
+
const $ = (D = k.chart.description) == null ? void 0 : D.replace(gi, () => {
|
|
4088
|
+
const we = `renderer.trendRange.${l.value.type === "absolute" ? "custom" : l.value.time_range}`;
|
|
4089
|
+
return o.te(we) ? o.t(we) : "";
|
|
4090
4090
|
});
|
|
4091
|
-
|
|
4092
|
-
...
|
|
4091
|
+
k = {
|
|
4092
|
+
...k,
|
|
4093
4093
|
chart: {
|
|
4094
|
-
...
|
|
4095
|
-
description:
|
|
4094
|
+
...k.chart,
|
|
4095
|
+
description: $
|
|
4096
4096
|
}
|
|
4097
4097
|
};
|
|
4098
4098
|
}
|
|
@@ -4102,30 +4102,30 @@ const Yi = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Xi = { cl
|
|
|
4102
4102
|
x
|
|
4103
4103
|
), {
|
|
4104
4104
|
layout: x.layout,
|
|
4105
|
-
meta:
|
|
4105
|
+
meta: k,
|
|
4106
4106
|
// Add a unique key to each tile internally.
|
|
4107
4107
|
id: x.id ?? crypto.randomUUID()
|
|
4108
4108
|
};
|
|
4109
|
-
})), y =
|
|
4110
|
-
let { tz: x, refreshInterval:
|
|
4111
|
-
return x || (x = new Intl.DateTimeFormat().resolvedOptions().timeZone),
|
|
4109
|
+
})), y = L(() => {
|
|
4110
|
+
let { tz: x, refreshInterval: k, editable: D } = i.context;
|
|
4111
|
+
return x || (x = new Intl.DateTimeFormat().resolvedOptions().timeZone), k === void 0 && (k = mi), D === void 0 && (D = !1), {
|
|
4112
4112
|
...i.context,
|
|
4113
4113
|
tz: x,
|
|
4114
4114
|
timeSpec: l.value,
|
|
4115
|
-
refreshInterval:
|
|
4116
|
-
editable:
|
|
4115
|
+
refreshInterval: k,
|
|
4116
|
+
editable: D
|
|
4117
4117
|
};
|
|
4118
|
-
}),
|
|
4118
|
+
}), m = (x) => {
|
|
4119
4119
|
s("edit-tile", x);
|
|
4120
|
-
},
|
|
4121
|
-
const
|
|
4120
|
+
}, E = (x) => x.type === "slottable", N = (x) => {
|
|
4121
|
+
const k = E(x.meta.chart) ? { ...x.meta.chart } : {
|
|
4122
4122
|
...x.meta.chart,
|
|
4123
4123
|
chartTitle: x.meta.chart.chartTitle ? `Copy of ${x.meta.chart.chartTitle}` : ""
|
|
4124
|
-
},
|
|
4124
|
+
}, D = {
|
|
4125
4125
|
id: crypto.randomUUID(),
|
|
4126
4126
|
definition: {
|
|
4127
4127
|
...x.meta,
|
|
4128
|
-
chart:
|
|
4128
|
+
chart: k
|
|
4129
4129
|
},
|
|
4130
4130
|
layout: {
|
|
4131
4131
|
position: {
|
|
@@ -4135,70 +4135,70 @@ const Yi = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Xi = { cl
|
|
|
4135
4135
|
size: x.layout.size
|
|
4136
4136
|
}
|
|
4137
4137
|
};
|
|
4138
|
-
r.value.tiles.push(
|
|
4139
|
-
},
|
|
4138
|
+
r.value.tiles.push(D);
|
|
4139
|
+
}, R = (x) => {
|
|
4140
4140
|
d.value && d.value.removeWidget(x.id);
|
|
4141
|
-
},
|
|
4141
|
+
}, H = () => {
|
|
4142
4142
|
n.value++;
|
|
4143
|
-
},
|
|
4144
|
-
const
|
|
4145
|
-
id:
|
|
4146
|
-
layout:
|
|
4147
|
-
definition:
|
|
4143
|
+
}, z = (x) => {
|
|
4144
|
+
const k = x.map((D) => ({
|
|
4145
|
+
id: D.id,
|
|
4146
|
+
layout: D.layout,
|
|
4147
|
+
definition: D.meta
|
|
4148
4148
|
}));
|
|
4149
|
-
r.value.gridSize.rows = Math.max(1, ...
|
|
4149
|
+
r.value.gridSize.rows = Math.max(1, ...k.map((D) => D.layout.position.row + D.layout.size.rows)), r.value.tiles = k.sort(g);
|
|
4150
4150
|
};
|
|
4151
|
-
return e({ refresh:
|
|
4152
|
-
const
|
|
4153
|
-
return C(),
|
|
4154
|
-
S(h) ? (C(),
|
|
4151
|
+
return e({ refresh: H }), (x, k) => {
|
|
4152
|
+
const D = oe("KAlert");
|
|
4153
|
+
return C(), U("div", es, [
|
|
4154
|
+
S(h) ? (C(), O(wt(x.context.editable ? Ji : Wi), {
|
|
4155
4155
|
key: 1,
|
|
4156
4156
|
ref_key: "gridLayoutRef",
|
|
4157
4157
|
ref: d,
|
|
4158
4158
|
"grid-size": r.value.gridSize,
|
|
4159
4159
|
"tile-height": r.value.tileHeight,
|
|
4160
4160
|
tiles: p.value,
|
|
4161
|
-
onUpdateTiles:
|
|
4161
|
+
onUpdateTiles: z
|
|
4162
4162
|
}, {
|
|
4163
|
-
tile: P(({ tile:
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
])) : (C(),
|
|
4163
|
+
tile: P(({ tile: $ }) => [
|
|
4164
|
+
$.meta.chart.type === "slottable" ? (C(), U("div", ts, [
|
|
4165
|
+
Ie(x.$slots, $.meta.chart.id, {}, void 0, !0)
|
|
4166
|
+
])) : (C(), O(Fi, {
|
|
4167
4167
|
key: 1,
|
|
4168
4168
|
class: "tile-container",
|
|
4169
4169
|
context: y.value,
|
|
4170
|
-
definition:
|
|
4171
|
-
height:
|
|
4170
|
+
definition: $.meta,
|
|
4171
|
+
height: $.layout.size.rows * (r.value.tileHeight || S(Ye)) + parseInt(S(Ot), 10),
|
|
4172
4172
|
"query-ready": f.value,
|
|
4173
4173
|
"refresh-counter": n.value,
|
|
4174
|
-
"tile-id":
|
|
4175
|
-
onDuplicateTile: (ae) =>
|
|
4176
|
-
onEditTile: (ae) =>
|
|
4177
|
-
onRemoveTile: (ae) =>
|
|
4178
|
-
onZoomTimeRange:
|
|
4174
|
+
"tile-id": $.id,
|
|
4175
|
+
onDuplicateTile: (ae) => N($),
|
|
4176
|
+
onEditTile: (ae) => m($),
|
|
4177
|
+
onRemoveTile: (ae) => R($),
|
|
4178
|
+
onZoomTimeRange: k[0] || (k[0] = (ae) => s("zoom-time-range", ae))
|
|
4179
4179
|
}, null, 8, ["context", "definition", "height", "query-ready", "refresh-counter", "tile-id", "onDuplicateTile", "onEditTile", "onRemoveTile"]))
|
|
4180
4180
|
]),
|
|
4181
4181
|
_: 3
|
|
4182
|
-
}, 40, ["grid-size", "tile-height", "tiles"])) : (C(),
|
|
4182
|
+
}, 40, ["grid-size", "tile-height", "tiles"])) : (C(), O(D, {
|
|
4183
4183
|
key: 0,
|
|
4184
4184
|
appearance: "danger"
|
|
4185
4185
|
}, {
|
|
4186
4186
|
default: P(() => [
|
|
4187
|
-
|
|
4187
|
+
ce(J(S(o).t("renderer.noQueryBridge")), 1)
|
|
4188
4188
|
]),
|
|
4189
4189
|
_: 1
|
|
4190
4190
|
}))
|
|
4191
4191
|
]);
|
|
4192
4192
|
};
|
|
4193
4193
|
}
|
|
4194
|
-
}),
|
|
4194
|
+
}), fs = /* @__PURE__ */ de(is, [["__scopeId", "data-v-d31fa719"]]);
|
|
4195
4195
|
export {
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4196
|
+
fi as CP_ID_TOKEN,
|
|
4197
|
+
Ye as DEFAULT_TILE_HEIGHT,
|
|
4198
|
+
mi as DEFAULT_TILE_REFRESH_INTERVAL_MS,
|
|
4199
|
+
fs as DashboardRenderer,
|
|
4200
|
+
nt as ENTITY_ID_TOKEN,
|
|
4201
|
+
Wi as GridLayout,
|
|
4202
4202
|
le as INJECT_QUERY_PROVIDER,
|
|
4203
|
-
|
|
4203
|
+
gi as TIMEFRAME_TOKEN
|
|
4204
4204
|
};
|