@kong-ui-public/dashboard-renderer 8.9.10 → 8.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GeoMapRenderer-DwpwiD-Y.js → GeoMapRenderer-CTei4zeC.js} +1 -1
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +7 -3
- package/dist/{index-Df_ifG7X.js → index-DGAMoPpS.js} +1025 -980
- package/dist/style.css +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts +192 -84
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts +282 -120
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/dist/types/composables/useContextLinks.d.ts +7 -0
- package/dist/types/composables/useContextLinks.d.ts.map +1 -1
- package/dist/types/composables/useIssueQuery.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ei = Object.defineProperty;
|
|
2
|
+
var Ct = (a) => {
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var _ = (a, e, t) => (
|
|
5
|
+
var xi = (a, e, t) => e in a ? Ei(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
6
|
+
var Rt = (a, e, t) => xi(a, typeof e != "symbol" ? e + "" : e, t), nt = (a, e, t) => e.has(a) || Ct("Cannot " + t);
|
|
7
|
+
var _ = (a, e, t) => (nt(a, e, "read from private field"), t ? t.call(a) : e.get(a)), U = (a, e, t) => e.has(a) ? Ct("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), B = (a, e, t, i) => (nt(a, e, "write to private field"), i ? i.call(a, t) : e.set(a, t), t), G = (a, e, t) => (nt(a, e, "access private method"), t);
|
|
8
8
|
var Ne = (a, e, t, i) => ({
|
|
9
9
|
set _(s) {
|
|
10
|
-
|
|
10
|
+
B(a, e, s, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
13
|
return _(a, e, i);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { ref as
|
|
17
|
-
import { msToGranularity as
|
|
18
|
-
import { handleQueryError as
|
|
19
|
-
import
|
|
16
|
+
import { ref as M, watchEffect as Gt, inject as pe, provide as Ci, toRaw as Ri, computed as R, isRef as ki, isReactive as Ti, toRef as De, hasInjectionContext as kt, onMounted as et, watch as Le, onUnmounted as tt, getCurrentInstance as Si, defineComponent as Z, resolveComponent as ue, unref as x, openBlock as C, createBlock as I, createSlots as it, withCtx as P, createElementVNode as X, toDisplayString as ee, renderSlot as Ae, createCommentVNode as V, normalizeStyle as at, normalizeClass as ze, createVNode as oe, mergeProps as Wt, createTextVNode as dt, createElementBlock as W, normalizeProps as Di, guardReactiveProps as zi, defineAsyncComponent as Kt, useCssVars as ct, useModel as Vt, readonly as ot, nextTick as ft, resolveDynamicComponent as Qt, toHandlers as Ni, mergeModels as Ve, Fragment as Yt, renderList as jt, useTemplateRef as Tt } from "vue";
|
|
17
|
+
import { msToGranularity as lt, TimePeriods as Li, TIMEFRAME_LOOKUP as Ai, formatTime as St, EXPORT_RECORD_LIMIT as Oi } from "@kong-ui-public/analytics-utilities";
|
|
18
|
+
import { handleQueryError as Hi, SimpleChart as Ii, AnalyticsChart as Mi, TopNTable as qi, CsvExportModal as Pi } from "@kong-ui-public/analytics-chart";
|
|
19
|
+
import $i from "swrv";
|
|
20
20
|
import "axios";
|
|
21
|
-
import { createI18n as
|
|
22
|
-
import { useAnalyticsConfigStore as
|
|
23
|
-
import { VisibilityOffIcon as
|
|
24
|
-
import { MetricsProvider as
|
|
25
|
-
var
|
|
26
|
-
const
|
|
21
|
+
import { createI18n as Bi, i18nTComponent as Fi } from "@kong-ui-public/i18n";
|
|
22
|
+
import { useAnalyticsConfigStore as $e, useDatasourceConfigStore as gt } from "@kong-ui-public/analytics-config-store";
|
|
23
|
+
import { VisibilityOffIcon as Ui, WarningOutlineIcon as Gi, WarningIcon as Wi, ProgressIcon as Ki, RefreshIcon as Vi, EditIcon as Qi, MoreIcon as Yi } from "@kong/icons";
|
|
24
|
+
import { MetricsProvider as ji, MetricsConsumer as Xi } from "@kong-ui-public/analytics-metric-provider";
|
|
25
|
+
var Xt = /* @__PURE__ */ ((a) => (a.VALIDATING = "VALIDATING", a.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", a.PENDING = "PENDING", a.SUCCESS = "SUCCESS", a.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", a.ERROR = "ERROR", a.STALE_IF_ERROR = "STALE_IF_ERROR", a))(Xt || {});
|
|
26
|
+
const Zi = (a) => {
|
|
27
27
|
var e, t, i, s, r;
|
|
28
28
|
return a ? !!// TODO: revisit: currently only the first check ever matters?
|
|
29
29
|
((e = Object.keys(a)) != null && e.length || (t = a.data) != null && t.length || (s = (i = a.data) == null ? void 0 : i.data) != null && s.length || !((r = a.data) != null && r.data) && typeof a.data == "object" && Object.keys(a == null ? void 0 : a.data).length) : !1;
|
|
30
30
|
};
|
|
31
|
-
function
|
|
32
|
-
const s =
|
|
31
|
+
function Ji(a = M({}), e, t, i = Zi) {
|
|
32
|
+
const s = M(
|
|
33
33
|
"PENDING"
|
|
34
34
|
/* PENDING */
|
|
35
35
|
);
|
|
36
|
-
return
|
|
36
|
+
return Gt(() => {
|
|
37
37
|
const r = i(a.value);
|
|
38
38
|
if (a.value && r && t.value) {
|
|
39
39
|
s.value = "VALIDATING_HAS_DATA";
|
|
@@ -62,10 +62,10 @@ function Gi(a = A({}), e, t, i = Ui) {
|
|
|
62
62
|
a.value === void 0 && e && (s.value = "ERROR");
|
|
63
63
|
}), {
|
|
64
64
|
state: s,
|
|
65
|
-
swrvState:
|
|
65
|
+
swrvState: Xt
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const es = {
|
|
69
69
|
not_configured: {
|
|
70
70
|
title: "Chart is not fully configured",
|
|
71
71
|
description: "Begin by choosing at least one metric"
|
|
@@ -83,10 +83,10 @@ const Wi = {
|
|
|
83
83
|
fullscreen: "Fullscreen",
|
|
84
84
|
remove: "Remove",
|
|
85
85
|
delete: "Delete"
|
|
86
|
-
},
|
|
86
|
+
}, ts = {
|
|
87
87
|
defaultFilename: "Chart export",
|
|
88
88
|
exportAsCsv: "Export as CSV"
|
|
89
|
-
},
|
|
89
|
+
}, is = "Explore", ss = "View requests", rs = "This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.", ns = {
|
|
90
90
|
daily: "1 day",
|
|
91
91
|
fiveMinutely: "5 minutes",
|
|
92
92
|
hourly: "1 hour",
|
|
@@ -99,154 +99,154 @@ const Wi = {
|
|
|
99
99
|
twoHourly: "2 hours",
|
|
100
100
|
weekly: "1 week",
|
|
101
101
|
unknown: "Unknown"
|
|
102
|
-
},
|
|
103
|
-
renderer:
|
|
104
|
-
csvExport:
|
|
105
|
-
jumpToExplore:
|
|
106
|
-
jumpToRequests:
|
|
107
|
-
query_aged_out_warning:
|
|
108
|
-
granularities:
|
|
102
|
+
}, os = {
|
|
103
|
+
renderer: es,
|
|
104
|
+
csvExport: ts,
|
|
105
|
+
jumpToExplore: is,
|
|
106
|
+
jumpToRequests: ss,
|
|
107
|
+
query_aged_out_warning: rs,
|
|
108
|
+
granularities: ns
|
|
109
109
|
};
|
|
110
|
-
function
|
|
111
|
-
const a =
|
|
110
|
+
function as() {
|
|
111
|
+
const a = Bi("en-us", os);
|
|
112
112
|
return {
|
|
113
113
|
i18n: a,
|
|
114
|
-
i18nT:
|
|
114
|
+
i18nT: Fi(a)
|
|
115
115
|
// Translation component <i18n-t>
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
function
|
|
120
|
-
const a =
|
|
118
|
+
const Be = 170, mt = 6, ve = "analytics-query-provider", Dt = "{entity-id}", ls = "{cp-id}", hs = "{timeframe}", us = 30 * 1e3, ds = 3e5, cs = 36e5;
|
|
119
|
+
function fs() {
|
|
120
|
+
const a = pe(ve);
|
|
121
121
|
return {
|
|
122
122
|
evaluateFeatureFlag: (t, i) => a ? a.evaluateFeatureFlagFn(t, i) : i
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function gs(a) {
|
|
126
126
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
128
|
+
var Zt = { exports: {} };
|
|
129
129
|
(function(a) {
|
|
130
130
|
var e = Object.prototype.hasOwnProperty, t = "~";
|
|
131
131
|
function i() {
|
|
132
132
|
}
|
|
133
133
|
Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (t = !1));
|
|
134
|
-
function s(d,
|
|
135
|
-
this.fn = d, this.context =
|
|
134
|
+
function s(d, h, u) {
|
|
135
|
+
this.fn = d, this.context = h, this.once = u || !1;
|
|
136
136
|
}
|
|
137
|
-
function r(d,
|
|
138
|
-
if (typeof
|
|
137
|
+
function r(d, h, u, l, f) {
|
|
138
|
+
if (typeof u != "function")
|
|
139
139
|
throw new TypeError("The listener must be a function");
|
|
140
|
-
var
|
|
141
|
-
return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p],
|
|
140
|
+
var g = new s(u, l || d, f), p = t ? t + h : h;
|
|
141
|
+
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;
|
|
142
142
|
}
|
|
143
|
-
function o(d,
|
|
144
|
-
--d._eventsCount === 0 ? d._events = new i() : delete d._events[
|
|
143
|
+
function o(d, h) {
|
|
144
|
+
--d._eventsCount === 0 ? d._events = new i() : delete d._events[h];
|
|
145
145
|
}
|
|
146
146
|
function n() {
|
|
147
147
|
this._events = new i(), this._eventsCount = 0;
|
|
148
148
|
}
|
|
149
149
|
n.prototype.eventNames = function() {
|
|
150
|
-
var
|
|
151
|
-
if (this._eventsCount === 0) return
|
|
152
|
-
for (l in
|
|
153
|
-
e.call(
|
|
154
|
-
return Object.getOwnPropertySymbols ?
|
|
155
|
-
}, n.prototype.listeners = function(
|
|
156
|
-
var
|
|
150
|
+
var h = [], u, l;
|
|
151
|
+
if (this._eventsCount === 0) return h;
|
|
152
|
+
for (l in u = this._events)
|
|
153
|
+
e.call(u, l) && h.push(t ? l.slice(1) : l);
|
|
154
|
+
return Object.getOwnPropertySymbols ? h.concat(Object.getOwnPropertySymbols(u)) : h;
|
|
155
|
+
}, n.prototype.listeners = function(h) {
|
|
156
|
+
var u = t ? t + h : h, l = this._events[u];
|
|
157
157
|
if (!l) return [];
|
|
158
158
|
if (l.fn) return [l.fn];
|
|
159
|
-
for (var f = 0,
|
|
159
|
+
for (var f = 0, g = l.length, p = new Array(g); f < g; f++)
|
|
160
160
|
p[f] = l[f].fn;
|
|
161
161
|
return p;
|
|
162
|
-
}, n.prototype.listenerCount = function(
|
|
163
|
-
var
|
|
162
|
+
}, n.prototype.listenerCount = function(h) {
|
|
163
|
+
var u = t ? t + h : h, l = this._events[u];
|
|
164
164
|
return l ? l.fn ? 1 : l.length : 0;
|
|
165
|
-
}, n.prototype.emit = function(
|
|
166
|
-
var y = t ? t +
|
|
165
|
+
}, n.prototype.emit = function(h, u, l, f, g, p) {
|
|
166
|
+
var y = t ? t + h : h;
|
|
167
167
|
if (!this._events[y]) return !1;
|
|
168
|
-
var
|
|
169
|
-
if (
|
|
170
|
-
switch (
|
|
168
|
+
var m = this._events[y], k = arguments.length, L, w;
|
|
169
|
+
if (m.fn) {
|
|
170
|
+
switch (m.once && this.removeListener(h, m.fn, void 0, !0), k) {
|
|
171
171
|
case 1:
|
|
172
|
-
return
|
|
172
|
+
return m.fn.call(m.context), !0;
|
|
173
173
|
case 2:
|
|
174
|
-
return
|
|
174
|
+
return m.fn.call(m.context, u), !0;
|
|
175
175
|
case 3:
|
|
176
|
-
return
|
|
176
|
+
return m.fn.call(m.context, u, l), !0;
|
|
177
177
|
case 4:
|
|
178
|
-
return
|
|
178
|
+
return m.fn.call(m.context, u, l, f), !0;
|
|
179
179
|
case 5:
|
|
180
|
-
return
|
|
180
|
+
return m.fn.call(m.context, u, l, f, g), !0;
|
|
181
181
|
case 6:
|
|
182
|
-
return
|
|
182
|
+
return m.fn.call(m.context, u, l, f, g, p), !0;
|
|
183
183
|
}
|
|
184
|
-
for (w = 1,
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
for (w = 1, L = new Array(k - 1); w < k; w++)
|
|
185
|
+
L[w - 1] = arguments[w];
|
|
186
|
+
m.fn.apply(m.context, L);
|
|
187
187
|
} else {
|
|
188
|
-
var
|
|
189
|
-
for (w = 0; w <
|
|
190
|
-
switch (
|
|
188
|
+
var q = m.length, A;
|
|
189
|
+
for (w = 0; w < q; w++)
|
|
190
|
+
switch (m[w].once && this.removeListener(h, m[w].fn, void 0, !0), k) {
|
|
191
191
|
case 1:
|
|
192
|
-
|
|
192
|
+
m[w].fn.call(m[w].context);
|
|
193
193
|
break;
|
|
194
194
|
case 2:
|
|
195
|
-
|
|
195
|
+
m[w].fn.call(m[w].context, u);
|
|
196
196
|
break;
|
|
197
197
|
case 3:
|
|
198
|
-
|
|
198
|
+
m[w].fn.call(m[w].context, u, l);
|
|
199
199
|
break;
|
|
200
200
|
case 4:
|
|
201
|
-
|
|
201
|
+
m[w].fn.call(m[w].context, u, l, f);
|
|
202
202
|
break;
|
|
203
203
|
default:
|
|
204
|
-
if (!
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
if (!L) for (A = 1, L = new Array(k - 1); A < k; A++)
|
|
205
|
+
L[A - 1] = arguments[A];
|
|
206
|
+
m[w].fn.apply(m[w].context, L);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
return !0;
|
|
210
|
-
}, n.prototype.on = function(
|
|
211
|
-
return r(this,
|
|
212
|
-
}, n.prototype.once = function(
|
|
213
|
-
return r(this,
|
|
214
|
-
}, n.prototype.removeListener = function(
|
|
215
|
-
var
|
|
216
|
-
if (!this._events[
|
|
217
|
-
if (!
|
|
218
|
-
return o(this,
|
|
219
|
-
var p = this._events[
|
|
210
|
+
}, n.prototype.on = function(h, u, l) {
|
|
211
|
+
return r(this, h, u, l, !1);
|
|
212
|
+
}, n.prototype.once = function(h, u, l) {
|
|
213
|
+
return r(this, h, u, l, !0);
|
|
214
|
+
}, n.prototype.removeListener = function(h, u, l, f) {
|
|
215
|
+
var g = t ? t + h : h;
|
|
216
|
+
if (!this._events[g]) return this;
|
|
217
|
+
if (!u)
|
|
218
|
+
return o(this, g), this;
|
|
219
|
+
var p = this._events[g];
|
|
220
220
|
if (p.fn)
|
|
221
|
-
p.fn ===
|
|
221
|
+
p.fn === u && (!f || p.once) && (!l || p.context === l) && o(this, g);
|
|
222
222
|
else {
|
|
223
|
-
for (var y = 0,
|
|
224
|
-
(p[y].fn !==
|
|
225
|
-
|
|
223
|
+
for (var y = 0, m = [], k = p.length; y < k; y++)
|
|
224
|
+
(p[y].fn !== u || f && !p[y].once || l && p[y].context !== l) && m.push(p[y]);
|
|
225
|
+
m.length ? this._events[g] = m.length === 1 ? m[0] : m : o(this, g);
|
|
226
226
|
}
|
|
227
227
|
return this;
|
|
228
|
-
}, n.prototype.removeAllListeners = function(
|
|
229
|
-
var
|
|
230
|
-
return
|
|
228
|
+
}, n.prototype.removeAllListeners = function(h) {
|
|
229
|
+
var u;
|
|
230
|
+
return h ? (u = t ? t + h : h, this._events[u] && o(this, u)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
231
231
|
}, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n, a.exports = n;
|
|
232
|
-
})(
|
|
233
|
-
var
|
|
234
|
-
const
|
|
235
|
-
class
|
|
232
|
+
})(Zt);
|
|
233
|
+
var ms = Zt.exports;
|
|
234
|
+
const ps = /* @__PURE__ */ gs(ms);
|
|
235
|
+
class Jt extends Error {
|
|
236
236
|
constructor(e) {
|
|
237
237
|
super(e), this.name = "TimeoutError";
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
class
|
|
240
|
+
class ys extends Error {
|
|
241
241
|
constructor(e) {
|
|
242
242
|
super(), this.name = "AbortError", this.message = e;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
const
|
|
246
|
-
const e = a.reason === void 0 ?
|
|
247
|
-
return e instanceof Error ? e :
|
|
245
|
+
const zt = (a) => globalThis.DOMException === void 0 ? new ys(a) : new DOMException(a), Nt = (a) => {
|
|
246
|
+
const e = a.reason === void 0 ? zt("This operation was aborted.") : a.reason;
|
|
247
|
+
return e instanceof Error ? e : zt(e);
|
|
248
248
|
};
|
|
249
|
-
function
|
|
249
|
+
function vs(a, e) {
|
|
250
250
|
const {
|
|
251
251
|
milliseconds: t,
|
|
252
252
|
fallback: i,
|
|
@@ -254,45 +254,45 @@ function hs(a, e) {
|
|
|
254
254
|
customTimers: r = { setTimeout, clearTimeout }
|
|
255
255
|
} = e;
|
|
256
256
|
let o, n;
|
|
257
|
-
const
|
|
257
|
+
const h = new Promise((u, l) => {
|
|
258
258
|
if (typeof t != "number" || Math.sign(t) !== 1)
|
|
259
259
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
260
260
|
if (e.signal) {
|
|
261
|
-
const { signal:
|
|
262
|
-
|
|
263
|
-
l(
|
|
264
|
-
},
|
|
261
|
+
const { signal: g } = e;
|
|
262
|
+
g.aborted && l(Nt(g)), n = () => {
|
|
263
|
+
l(Nt(g));
|
|
264
|
+
}, g.addEventListener("abort", n, { once: !0 });
|
|
265
265
|
}
|
|
266
266
|
if (t === Number.POSITIVE_INFINITY) {
|
|
267
|
-
a.then(
|
|
267
|
+
a.then(u, l);
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
|
-
const f = new
|
|
270
|
+
const f = new Jt();
|
|
271
271
|
o = r.setTimeout.call(void 0, () => {
|
|
272
272
|
if (i) {
|
|
273
273
|
try {
|
|
274
|
-
|
|
275
|
-
} catch (
|
|
276
|
-
l(
|
|
274
|
+
u(i());
|
|
275
|
+
} catch (g) {
|
|
276
|
+
l(g);
|
|
277
277
|
}
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
|
-
typeof a.cancel == "function" && a.cancel(), s === !1 ?
|
|
280
|
+
typeof a.cancel == "function" && a.cancel(), s === !1 ? u() : s instanceof Error ? l(s) : (f.message = s ?? `Promise timed out after ${t} milliseconds`, l(f));
|
|
281
281
|
}, t), (async () => {
|
|
282
282
|
try {
|
|
283
|
-
|
|
284
|
-
} catch (
|
|
285
|
-
l(
|
|
283
|
+
u(await a);
|
|
284
|
+
} catch (g) {
|
|
285
|
+
l(g);
|
|
286
286
|
}
|
|
287
287
|
})();
|
|
288
288
|
}).finally(() => {
|
|
289
|
-
|
|
289
|
+
h.clear(), n && e.signal && e.signal.removeEventListener("abort", n);
|
|
290
290
|
});
|
|
291
|
-
return
|
|
291
|
+
return h.clear = () => {
|
|
292
292
|
r.clearTimeout.call(void 0, o), o = void 0;
|
|
293
|
-
},
|
|
293
|
+
}, h;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function _s(a, e, t) {
|
|
296
296
|
let i = 0, s = a.length;
|
|
297
297
|
for (; s > 0; ) {
|
|
298
298
|
const r = Math.trunc(s / 2);
|
|
@@ -301,10 +301,10 @@ function us(a, e, t) {
|
|
|
301
301
|
}
|
|
302
302
|
return i;
|
|
303
303
|
}
|
|
304
|
-
var
|
|
305
|
-
class
|
|
304
|
+
var te;
|
|
305
|
+
class bs {
|
|
306
306
|
constructor() {
|
|
307
|
-
|
|
307
|
+
U(this, te, []);
|
|
308
308
|
}
|
|
309
309
|
enqueue(e, t) {
|
|
310
310
|
t = {
|
|
@@ -316,83 +316,83 @@ class ds {
|
|
|
316
316
|
id: t.id,
|
|
317
317
|
run: e
|
|
318
318
|
};
|
|
319
|
-
if (this.size === 0 || _(this,
|
|
320
|
-
_(this,
|
|
319
|
+
if (this.size === 0 || _(this, te)[this.size - 1].priority >= t.priority) {
|
|
320
|
+
_(this, te).push(i);
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
const s =
|
|
324
|
-
_(this,
|
|
323
|
+
const s = _s(_(this, te), i, (r, o) => o.priority - r.priority);
|
|
324
|
+
_(this, te).splice(s, 0, i);
|
|
325
325
|
}
|
|
326
326
|
setPriority(e, t) {
|
|
327
|
-
const i = _(this,
|
|
327
|
+
const i = _(this, te).findIndex((r) => r.id === e);
|
|
328
328
|
if (i === -1)
|
|
329
329
|
throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
|
|
330
|
-
const [s] = _(this,
|
|
330
|
+
const [s] = _(this, te).splice(i, 1);
|
|
331
331
|
this.enqueue(s.run, { priority: t, id: e });
|
|
332
332
|
}
|
|
333
333
|
dequeue() {
|
|
334
|
-
const e = _(this,
|
|
334
|
+
const e = _(this, te).shift();
|
|
335
335
|
return e == null ? void 0 : e.run;
|
|
336
336
|
}
|
|
337
337
|
filter(e) {
|
|
338
|
-
return _(this,
|
|
338
|
+
return _(this, te).filter((t) => t.priority === e.priority).map((t) => t.run);
|
|
339
339
|
}
|
|
340
340
|
get size() {
|
|
341
|
-
return _(this,
|
|
341
|
+
return _(this, te).length;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
|
|
345
|
-
var
|
|
346
|
-
class
|
|
344
|
+
te = new WeakMap();
|
|
345
|
+
var Ce, Re, ye, Ie, ke, Me, ie, Te, Q, qe, se, Se, me, Pe, Je, D, ei, ti, ii, si, ri, Ge, ht, ut, We, ni, Ke;
|
|
346
|
+
class ws extends ps {
|
|
347
347
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
348
348
|
constructor(t) {
|
|
349
349
|
var i, s;
|
|
350
350
|
super();
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
351
|
+
U(this, D);
|
|
352
|
+
U(this, Ce);
|
|
353
|
+
U(this, Re);
|
|
354
|
+
U(this, ye, 0);
|
|
355
|
+
U(this, Ie);
|
|
356
|
+
U(this, ke);
|
|
357
|
+
U(this, Me, 0);
|
|
358
|
+
U(this, ie);
|
|
359
|
+
U(this, Te);
|
|
360
|
+
U(this, Q);
|
|
361
|
+
U(this, qe);
|
|
362
|
+
U(this, se, 0);
|
|
363
363
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
U(this, Se);
|
|
365
|
+
U(this, me);
|
|
366
|
+
U(this, Pe);
|
|
367
367
|
// Use to assign a unique identifier to a promise function, if not explicitly specified
|
|
368
|
-
|
|
368
|
+
U(this, Je, 1n);
|
|
369
369
|
/**
|
|
370
370
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
371
371
|
|
|
372
372
|
Applies to each future operation.
|
|
373
373
|
*/
|
|
374
|
-
|
|
374
|
+
Rt(this, "timeout");
|
|
375
375
|
if (t = {
|
|
376
376
|
carryoverConcurrencyCount: !1,
|
|
377
377
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
378
378
|
interval: 0,
|
|
379
379
|
concurrency: Number.POSITIVE_INFINITY,
|
|
380
380
|
autoStart: !0,
|
|
381
|
-
queueClass:
|
|
381
|
+
queueClass: bs,
|
|
382
382
|
...t
|
|
383
383
|
}, !(typeof t.intervalCap == "number" && t.intervalCap >= 1))
|
|
384
384
|
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((i = t.intervalCap) == null ? void 0 : i.toString()) ?? ""}\` (${typeof t.intervalCap})`);
|
|
385
385
|
if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
|
|
386
386
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s = t.interval) == null ? void 0 : s.toString()) ?? ""}\` (${typeof t.interval})`);
|
|
387
|
-
|
|
387
|
+
B(this, Ce, t.carryoverConcurrencyCount), B(this, Re, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), B(this, Ie, t.intervalCap), B(this, ke, t.interval), B(this, Q, new t.queueClass()), B(this, qe, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, B(this, Pe, t.throwOnTimeout === !0), B(this, me, t.autoStart === !1);
|
|
388
388
|
}
|
|
389
389
|
get concurrency() {
|
|
390
|
-
return _(this,
|
|
390
|
+
return _(this, Se);
|
|
391
391
|
}
|
|
392
392
|
set concurrency(t) {
|
|
393
393
|
if (!(typeof t == "number" && t >= 1))
|
|
394
394
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
|
|
395
|
-
|
|
395
|
+
B(this, Se, t), G(this, D, We).call(this);
|
|
396
396
|
}
|
|
397
397
|
/**
|
|
398
398
|
Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
|
|
@@ -431,33 +431,33 @@ class cs extends as {
|
|
|
431
431
|
Here, the promise function with `id: '🦀'` executes last.
|
|
432
432
|
*/
|
|
433
433
|
setPriority(t, i) {
|
|
434
|
-
_(this,
|
|
434
|
+
_(this, Q).setPriority(t, i);
|
|
435
435
|
}
|
|
436
436
|
async add(t, i = {}) {
|
|
437
|
-
return i.id ?? (i.id = (Ne(this,
|
|
437
|
+
return i.id ?? (i.id = (Ne(this, Je)._++).toString()), i = {
|
|
438
438
|
timeout: this.timeout,
|
|
439
|
-
throwOnTimeout: _(this,
|
|
439
|
+
throwOnTimeout: _(this, Pe),
|
|
440
440
|
...i
|
|
441
441
|
}, new Promise((s, r) => {
|
|
442
|
-
_(this,
|
|
442
|
+
_(this, Q).enqueue(async () => {
|
|
443
443
|
var o;
|
|
444
|
-
Ne(this,
|
|
444
|
+
Ne(this, se)._++;
|
|
445
445
|
try {
|
|
446
446
|
(o = i.signal) == null || o.throwIfAborted(), Ne(this, ye)._++;
|
|
447
447
|
let n = t({ signal: i.signal });
|
|
448
|
-
i.timeout && (n =
|
|
448
|
+
i.timeout && (n = vs(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, G(this, D, ni).call(this, i.signal)]));
|
|
449
449
|
const d = await n;
|
|
450
450
|
s(d), this.emit("completed", d);
|
|
451
451
|
} catch (n) {
|
|
452
|
-
if (n instanceof
|
|
452
|
+
if (n instanceof Jt && !i.throwOnTimeout) {
|
|
453
453
|
s();
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
456
456
|
r(n), this.emit("error", n);
|
|
457
457
|
} finally {
|
|
458
|
-
|
|
458
|
+
G(this, D, ii).call(this);
|
|
459
459
|
}
|
|
460
|
-
}, i), this.emit("add"),
|
|
460
|
+
}, i), this.emit("add"), G(this, D, Ge).call(this);
|
|
461
461
|
});
|
|
462
462
|
}
|
|
463
463
|
async addAll(t, i) {
|
|
@@ -467,19 +467,19 @@ class cs extends as {
|
|
|
467
467
|
Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
|
|
468
468
|
*/
|
|
469
469
|
start() {
|
|
470
|
-
return _(this,
|
|
470
|
+
return _(this, me) ? (B(this, me, !1), G(this, D, We).call(this), this) : this;
|
|
471
471
|
}
|
|
472
472
|
/**
|
|
473
473
|
Put queue execution on hold.
|
|
474
474
|
*/
|
|
475
475
|
pause() {
|
|
476
|
-
|
|
476
|
+
B(this, me, !0);
|
|
477
477
|
}
|
|
478
478
|
/**
|
|
479
479
|
Clear the queue.
|
|
480
480
|
*/
|
|
481
481
|
clear() {
|
|
482
|
-
|
|
482
|
+
B(this, Q, new (_(this, qe))());
|
|
483
483
|
}
|
|
484
484
|
/**
|
|
485
485
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -487,7 +487,7 @@ class cs extends as {
|
|
|
487
487
|
@returns A promise that settles when the queue becomes empty.
|
|
488
488
|
*/
|
|
489
489
|
async onEmpty() {
|
|
490
|
-
_(this,
|
|
490
|
+
_(this, Q).size !== 0 && await G(this, D, Ke).call(this, "empty");
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
493
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -497,7 +497,7 @@ class cs extends as {
|
|
|
497
497
|
Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
|
|
498
498
|
*/
|
|
499
499
|
async onSizeLessThan(t) {
|
|
500
|
-
_(this,
|
|
500
|
+
_(this, Q).size < t || await G(this, D, Ke).call(this, "next", () => _(this, Q).size < t);
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
|
|
@@ -505,13 +505,13 @@ class cs extends as {
|
|
|
505
505
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
506
506
|
*/
|
|
507
507
|
async onIdle() {
|
|
508
|
-
_(this,
|
|
508
|
+
_(this, se) === 0 && _(this, Q).size === 0 || await G(this, D, Ke).call(this, "idle");
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
Size of the queue, the number of queued items waiting to run.
|
|
512
512
|
*/
|
|
513
513
|
get size() {
|
|
514
|
-
return _(this,
|
|
514
|
+
return _(this, Q).size;
|
|
515
515
|
}
|
|
516
516
|
/**
|
|
517
517
|
Size of the queue, filtered by the given options.
|
|
@@ -519,71 +519,71 @@ class cs extends as {
|
|
|
519
519
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
520
520
|
*/
|
|
521
521
|
sizeBy(t) {
|
|
522
|
-
return _(this,
|
|
522
|
+
return _(this, Q).filter(t).length;
|
|
523
523
|
}
|
|
524
524
|
/**
|
|
525
525
|
Number of running items (no longer in the queue).
|
|
526
526
|
*/
|
|
527
527
|
get pending() {
|
|
528
|
-
return _(this,
|
|
528
|
+
return _(this, se);
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
531
531
|
Whether the queue is currently paused.
|
|
532
532
|
*/
|
|
533
533
|
get isPaused() {
|
|
534
|
-
return _(this,
|
|
534
|
+
return _(this, me);
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
-
|
|
538
|
-
return _(this,
|
|
539
|
-
},
|
|
540
|
-
return _(this,
|
|
541
|
-
},
|
|
542
|
-
Ne(this,
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
},
|
|
537
|
+
Ce = new WeakMap(), Re = new WeakMap(), ye = new WeakMap(), Ie = new WeakMap(), ke = new WeakMap(), Me = new WeakMap(), ie = new WeakMap(), Te = new WeakMap(), Q = new WeakMap(), qe = new WeakMap(), se = new WeakMap(), Se = new WeakMap(), me = new WeakMap(), Pe = new WeakMap(), Je = new WeakMap(), D = new WeakSet(), ei = function() {
|
|
538
|
+
return _(this, Re) || _(this, ye) < _(this, Ie);
|
|
539
|
+
}, ti = function() {
|
|
540
|
+
return _(this, se) < _(this, Se);
|
|
541
|
+
}, ii = function() {
|
|
542
|
+
Ne(this, se)._--, G(this, D, Ge).call(this), this.emit("next");
|
|
543
|
+
}, si = function() {
|
|
544
|
+
G(this, D, ut).call(this), G(this, D, ht).call(this), B(this, Te, void 0);
|
|
545
|
+
}, ri = function() {
|
|
546
546
|
const t = Date.now();
|
|
547
|
-
if (_(this,
|
|
548
|
-
const i = _(this,
|
|
547
|
+
if (_(this, ie) === void 0) {
|
|
548
|
+
const i = _(this, Me) - t;
|
|
549
549
|
if (i < 0)
|
|
550
|
-
|
|
550
|
+
B(this, ye, _(this, Ce) ? _(this, se) : 0);
|
|
551
551
|
else
|
|
552
|
-
return _(this,
|
|
553
|
-
|
|
552
|
+
return _(this, Te) === void 0 && B(this, Te, setTimeout(() => {
|
|
553
|
+
G(this, D, si).call(this);
|
|
554
554
|
}, i)), !0;
|
|
555
555
|
}
|
|
556
556
|
return !1;
|
|
557
|
-
},
|
|
558
|
-
if (_(this,
|
|
559
|
-
return _(this,
|
|
560
|
-
if (!_(this,
|
|
561
|
-
const t = !_(this,
|
|
562
|
-
if (_(this,
|
|
563
|
-
const i = _(this,
|
|
564
|
-
return i ? (this.emit("active"), i(), t &&
|
|
557
|
+
}, Ge = function() {
|
|
558
|
+
if (_(this, Q).size === 0)
|
|
559
|
+
return _(this, ie) && clearInterval(_(this, ie)), B(this, ie, void 0), this.emit("empty"), _(this, se) === 0 && this.emit("idle"), !1;
|
|
560
|
+
if (!_(this, me)) {
|
|
561
|
+
const t = !_(this, D, ri);
|
|
562
|
+
if (_(this, D, ei) && _(this, D, ti)) {
|
|
563
|
+
const i = _(this, Q).dequeue();
|
|
564
|
+
return i ? (this.emit("active"), i(), t && G(this, D, ht).call(this), !0) : !1;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
return !1;
|
|
568
|
-
},
|
|
569
|
-
_(this,
|
|
570
|
-
|
|
571
|
-
}, _(this, ke))),
|
|
572
|
-
},
|
|
573
|
-
_(this, ye) === 0 && _(this,
|
|
568
|
+
}, ht = function() {
|
|
569
|
+
_(this, Re) || _(this, ie) !== void 0 || (B(this, ie, setInterval(() => {
|
|
570
|
+
G(this, D, ut).call(this);
|
|
571
|
+
}, _(this, ke))), B(this, Me, Date.now() + _(this, ke)));
|
|
572
|
+
}, ut = function() {
|
|
573
|
+
_(this, ye) === 0 && _(this, se) === 0 && _(this, ie) && (clearInterval(_(this, ie)), B(this, ie, void 0)), B(this, ye, _(this, Ce) ? _(this, se) : 0), G(this, D, We).call(this);
|
|
574
574
|
}, /**
|
|
575
575
|
Executes all queued functions until it reaches the limit.
|
|
576
576
|
*/
|
|
577
|
-
|
|
578
|
-
for (;
|
|
577
|
+
We = function() {
|
|
578
|
+
for (; G(this, D, Ge).call(this); )
|
|
579
579
|
;
|
|
580
|
-
},
|
|
580
|
+
}, ni = async function(t) {
|
|
581
581
|
return new Promise((i, s) => {
|
|
582
582
|
t.addEventListener("abort", () => {
|
|
583
583
|
s(t.reason);
|
|
584
584
|
}, { once: !0 });
|
|
585
585
|
});
|
|
586
|
-
},
|
|
586
|
+
}, Ke = async function(t, i) {
|
|
587
587
|
return new Promise((s) => {
|
|
588
588
|
const r = () => {
|
|
589
589
|
i && !i() || (this.off(t, r), s());
|
|
@@ -591,15 +591,15 @@ Ge = function() {
|
|
|
591
591
|
this.on(t, r);
|
|
592
592
|
});
|
|
593
593
|
};
|
|
594
|
-
const
|
|
595
|
-
const a =
|
|
594
|
+
const Es = () => {
|
|
595
|
+
const a = $e(), e = pe(ve);
|
|
596
596
|
if (!e)
|
|
597
597
|
return;
|
|
598
598
|
if (e.queryFnOverride) {
|
|
599
599
|
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.");
|
|
600
600
|
return;
|
|
601
601
|
}
|
|
602
|
-
const t = new
|
|
602
|
+
const t = new ws({
|
|
603
603
|
carryoverConcurrencyCount: !0,
|
|
604
604
|
concurrency: a.maxParallelRequests,
|
|
605
605
|
interval: a.requestInterval,
|
|
@@ -609,8 +609,44 @@ const fs = () => {
|
|
|
609
609
|
queryFnOverride: !0,
|
|
610
610
|
queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
|
|
611
611
|
};
|
|
612
|
-
|
|
613
|
-
}
|
|
612
|
+
Ci(ve, i);
|
|
613
|
+
};
|
|
614
|
+
/*!
|
|
615
|
+
* pinia v3.0.4
|
|
616
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
617
|
+
* @license MIT
|
|
618
|
+
*/
|
|
619
|
+
const xs = typeof window < "u";
|
|
620
|
+
let Lt;
|
|
621
|
+
process.env.NODE_ENV;
|
|
622
|
+
const At = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
|
|
623
|
+
/* istanbul ignore next */
|
|
624
|
+
Symbol()
|
|
625
|
+
);
|
|
626
|
+
var Ot;
|
|
627
|
+
(function(a) {
|
|
628
|
+
a.direct = "direct", a.patchObject = "patch object", a.patchFunction = "patch function";
|
|
629
|
+
})(Ot || (Ot = {}));
|
|
630
|
+
process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
|
|
631
|
+
/* istanbul ignore next */
|
|
632
|
+
Symbol()
|
|
633
|
+
);
|
|
634
|
+
function oi(a) {
|
|
635
|
+
const e = Ri(a), t = {};
|
|
636
|
+
for (const i in e) {
|
|
637
|
+
const s = e[i];
|
|
638
|
+
s.effect ? t[i] = // ...
|
|
639
|
+
R({
|
|
640
|
+
get: () => a[i],
|
|
641
|
+
set(r) {
|
|
642
|
+
a[i] = r;
|
|
643
|
+
}
|
|
644
|
+
}) : (ki(s) || Ti(s)) && (t[i] = // ---
|
|
645
|
+
De(a, i));
|
|
646
|
+
}
|
|
647
|
+
return t;
|
|
648
|
+
}
|
|
649
|
+
const Cs = [
|
|
614
650
|
"basic",
|
|
615
651
|
"api_usage",
|
|
616
652
|
"llm_usage",
|
|
@@ -618,169 +654,174 @@ const fs = () => {
|
|
|
618
654
|
"platform",
|
|
619
655
|
void 0
|
|
620
656
|
];
|
|
621
|
-
function
|
|
657
|
+
function Rs({
|
|
622
658
|
queryBridge: a,
|
|
623
659
|
context: e,
|
|
624
660
|
definition: t,
|
|
625
661
|
chartData: i
|
|
626
662
|
}) {
|
|
627
|
-
const s =
|
|
628
|
-
|
|
629
|
-
var
|
|
630
|
-
s.value = await ((
|
|
663
|
+
const s = M(""), r = M(""), o = M(void 0), n = M(void 0), d = $e(), h = gt(), { stripUnknownFilters: u, loading: l } = oi(h);
|
|
664
|
+
et(async () => {
|
|
665
|
+
var T, z;
|
|
666
|
+
s.value = await ((T = a == null ? void 0 : a.exploreBaseUrl) == null ? void 0 : T.call(a)) ?? "", r.value = await ((z = a == null ? void 0 : a.requestsBaseUrl) == null ? void 0 : z.call(a)) ?? "";
|
|
631
667
|
});
|
|
632
|
-
const
|
|
633
|
-
const
|
|
634
|
-
return ["golden_signals", "gauge"].includes(
|
|
635
|
-
}),
|
|
636
|
-
var
|
|
637
|
-
const
|
|
638
|
-
return
|
|
639
|
-
|
|
640
|
-
|
|
668
|
+
const f = R(() => d.analytics && d.percentiles), g = R(() => {
|
|
669
|
+
const T = t.value.chart.type;
|
|
670
|
+
return ["golden_signals", "gauge"].includes(T) ? !1 : T === "top_n" ? e.value.editable || e.value.showTileActions : !0;
|
|
671
|
+
}), p = R(() => r.value && t.value.query && t.value.query.datasource !== "llm_usage" && t.value.query.datasource !== "platform" && f.value && !l.value), y = R(() => s.value && t.value.query && Cs.includes(t.value.query.datasource) && f.value && !l.value), m = R(() => i.value ? lt(i.value.meta.granularity_ms) : void 0), k = R(() => {
|
|
672
|
+
var ge;
|
|
673
|
+
const T = [...e.value.filters, ...t.value.query.filters ?? []], z = t.value.query.metrics, re = ((ge = t.value.query) == null ? void 0 : ge.datasource) ?? "api_usage";
|
|
674
|
+
return u.value({
|
|
675
|
+
datasource: re,
|
|
676
|
+
filters: T,
|
|
677
|
+
metrics: z
|
|
678
|
+
});
|
|
679
|
+
}), L = R(() => {
|
|
680
|
+
if (!y.value || !g.value)
|
|
641
681
|
return "";
|
|
642
|
-
const
|
|
643
|
-
return
|
|
644
|
-
}),
|
|
645
|
-
if (!
|
|
682
|
+
const T = k.value, z = t.value.query.time_range || e.value.timeSpec, re = we(z, T);
|
|
683
|
+
return _e(re);
|
|
684
|
+
}), w = R(() => {
|
|
685
|
+
if (!p.value || !g.value)
|
|
646
686
|
return "";
|
|
647
|
-
const
|
|
687
|
+
const T = k.value, z = A(
|
|
648
688
|
t.value.query.time_range || e.value.timeSpec,
|
|
649
|
-
|
|
689
|
+
T
|
|
650
690
|
);
|
|
651
|
-
return
|
|
652
|
-
}),
|
|
653
|
-
var
|
|
654
|
-
const
|
|
691
|
+
return q(z);
|
|
692
|
+
}), q = (T) => p.value ? `${r.value}?q=${JSON.stringify(T)}` : "", A = (T, z) => {
|
|
693
|
+
var Ee, S, O, $;
|
|
694
|
+
const re = (S = (Ee = i.value) == null ? void 0 : Ee.meta) != null && S.start ? new Date(i.value.meta.start) : void 0, ge = ($ = (O = i.value) == null ? void 0 : O.meta) != null && $.end ? new Date(i.value.meta.end) : void 0;
|
|
655
695
|
return {
|
|
656
|
-
filter:
|
|
696
|
+
filter: z,
|
|
657
697
|
timeframe: {
|
|
658
|
-
timePeriodsKey:
|
|
659
|
-
start:
|
|
660
|
-
end:
|
|
698
|
+
timePeriodsKey: T.type === "relative" ? T.time_range : "custom",
|
|
699
|
+
start: T.type === "absolute" ? re : void 0,
|
|
700
|
+
end: T.type === "absolute" ? ge : void 0
|
|
661
701
|
}
|
|
662
702
|
};
|
|
663
|
-
},
|
|
664
|
-
filter:
|
|
703
|
+
}, fe = (T, z) => ({
|
|
704
|
+
filter: z,
|
|
665
705
|
timeframe: {
|
|
666
|
-
timePeriodsKey:
|
|
667
|
-
start:
|
|
668
|
-
end:
|
|
706
|
+
timePeriodsKey: T.type === "relative" ? T.time_range : "custom",
|
|
707
|
+
start: T.type === "absolute" ? T.start : void 0,
|
|
708
|
+
end: T.type === "absolute" ? T.end : void 0
|
|
669
709
|
}
|
|
670
|
-
}),
|
|
671
|
-
const
|
|
710
|
+
}), we = (T, z) => {
|
|
711
|
+
const re = t.value.query.dimensions ?? [];
|
|
672
712
|
return {
|
|
673
|
-
filters:
|
|
713
|
+
filters: z,
|
|
674
714
|
metrics: t.value.query.metrics ?? [],
|
|
675
|
-
dimensions:
|
|
676
|
-
time_range:
|
|
715
|
+
dimensions: re,
|
|
716
|
+
time_range: T,
|
|
677
717
|
granularity: t.value.query.granularity || m.value
|
|
678
718
|
};
|
|
679
|
-
},
|
|
680
|
-
if (!
|
|
719
|
+
}, _e = (T) => {
|
|
720
|
+
if (!y.value)
|
|
681
721
|
return "";
|
|
682
|
-
const
|
|
683
|
-
return `${s.value}?q=${JSON.stringify(
|
|
722
|
+
const z = t.value.query.datasource && t.value.query.datasource !== "basic" ? t.value.query.datasource : "api_usage";
|
|
723
|
+
return `${s.value}?q=${JSON.stringify(T)}&d=${z}&c=${t.value.chart.type}`;
|
|
684
724
|
};
|
|
685
|
-
return Le([
|
|
686
|
-
|
|
725
|
+
return Le([p, y], ([T, z]) => {
|
|
726
|
+
T && (o.value = { href: "" }), z && (n.value = { href: "" });
|
|
687
727
|
}), {
|
|
688
|
-
exploreLinkKebabMenu:
|
|
689
|
-
requestsLinkKebabMenu:
|
|
690
|
-
canShowKebabMenu:
|
|
691
|
-
canGenerateRequestsLink:
|
|
692
|
-
canGenerateExploreLink:
|
|
728
|
+
exploreLinkKebabMenu: L,
|
|
729
|
+
requestsLinkKebabMenu: w,
|
|
730
|
+
canShowKebabMenu: g,
|
|
731
|
+
canGenerateRequestsLink: p,
|
|
732
|
+
canGenerateExploreLink: y,
|
|
693
733
|
requestsLinkZoomActions: o,
|
|
694
734
|
exploreLinkZoomActions: n,
|
|
695
|
-
buildExploreQuery:
|
|
696
|
-
buildRequestsQueryZoomActions:
|
|
697
|
-
buildExploreLink:
|
|
698
|
-
buildRequestLink:
|
|
735
|
+
buildExploreQuery: we,
|
|
736
|
+
buildRequestsQueryZoomActions: fe,
|
|
737
|
+
buildExploreLink: _e,
|
|
738
|
+
buildRequestLink: q
|
|
699
739
|
};
|
|
700
740
|
}
|
|
701
|
-
|
|
702
|
-
const
|
|
703
|
-
return
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
const a = _e(ve), e = new AbortController();
|
|
707
|
-
return et(() => {
|
|
708
|
-
e.abort();
|
|
709
|
-
}), { issueQuery: async (i, s, r) => {
|
|
741
|
+
function ks() {
|
|
742
|
+
const a = pe(ve), e = gt(), t = new AbortController();
|
|
743
|
+
return tt(() => {
|
|
744
|
+
t.abort();
|
|
745
|
+
}), { issueQuery: async (s, r, o) => {
|
|
710
746
|
if (!a)
|
|
711
747
|
throw new Error("Query bridge is not defined");
|
|
748
|
+
await e.isReady();
|
|
712
749
|
const {
|
|
713
|
-
datasource:
|
|
714
|
-
limit:
|
|
715
|
-
...
|
|
716
|
-
} =
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
750
|
+
datasource: n,
|
|
751
|
+
limit: d,
|
|
752
|
+
...h
|
|
753
|
+
} = s, u = n || "basic", l = [];
|
|
754
|
+
s.filters && l.push(...s.filters), l.push(...e.stripUnknownFilters({
|
|
755
|
+
datasource: u,
|
|
756
|
+
filters: r.filters
|
|
757
|
+
}));
|
|
758
|
+
let f = s.time_range;
|
|
759
|
+
f ? f.tz || (f = {
|
|
760
|
+
...f,
|
|
761
|
+
tz: r.tz
|
|
762
|
+
}) : f = {
|
|
763
|
+
...r.timeSpec,
|
|
764
|
+
tz: r.tz
|
|
724
765
|
};
|
|
725
|
-
const
|
|
766
|
+
const g = {
|
|
726
767
|
datasource: u,
|
|
727
768
|
query: {
|
|
728
|
-
...
|
|
729
|
-
time_range:
|
|
730
|
-
filters:
|
|
731
|
-
limit:
|
|
769
|
+
...h,
|
|
770
|
+
time_range: f,
|
|
771
|
+
filters: l,
|
|
772
|
+
limit: o ?? d
|
|
732
773
|
}
|
|
733
774
|
};
|
|
734
|
-
return a.queryFn(
|
|
775
|
+
return a.queryFn(g, t);
|
|
735
776
|
} };
|
|
736
777
|
}
|
|
737
|
-
function
|
|
778
|
+
function Ts({
|
|
738
779
|
context: a,
|
|
739
|
-
globalFilters: e =
|
|
740
|
-
isFullscreen: t =
|
|
780
|
+
globalFilters: e = M([]),
|
|
781
|
+
isFullscreen: t = M(!1)
|
|
741
782
|
}) {
|
|
742
|
-
const i =
|
|
783
|
+
const i = $e(), s = R(() => a.value.timeSpec ? a.value.timeSpec : {
|
|
743
784
|
type: "relative",
|
|
744
785
|
time_range: i.defaultQueryTimeForOrg
|
|
745
786
|
});
|
|
746
787
|
return {
|
|
747
|
-
internalContext:
|
|
748
|
-
var f,
|
|
749
|
-
let { tz: o, refreshInterval: n, editable: d, showTileActions:
|
|
750
|
-
const
|
|
751
|
-
if (o || (o = new Intl.DateTimeFormat().resolvedOptions().timeZone), n === void 0 && (n =
|
|
788
|
+
internalContext: R(() => {
|
|
789
|
+
var f, g, p;
|
|
790
|
+
let { tz: o, refreshInterval: n, editable: d, showTileActions: h } = a.value;
|
|
791
|
+
const u = [...a.value.filters ?? [], ...e.value];
|
|
792
|
+
if (o || (o = new Intl.DateTimeFormat().resolvedOptions().timeZone), n === void 0 && (n = us), t.value) {
|
|
752
793
|
let y = !1;
|
|
753
794
|
if (s.value.type === "relative")
|
|
754
795
|
y = ["15m", "1h", "6h", "12h", "24h"].includes(s.value.time_range);
|
|
755
796
|
else {
|
|
756
|
-
const
|
|
757
|
-
y = Math.abs(w -
|
|
797
|
+
const L = s.value.start.getTime(), w = s.value.end.getTime();
|
|
798
|
+
y = Math.abs(w - L) <= 864e5;
|
|
758
799
|
}
|
|
759
|
-
const
|
|
760
|
-
s.value.type === "absolute" && s.value.end.getTime() <
|
|
800
|
+
const m = (/* @__PURE__ */ new Date()).getTime();
|
|
801
|
+
s.value.type === "absolute" && s.value.end.getTime() < m || s.value.type === "relative" && ["previous_week", "previous_month"].includes(s.value.time_range) ? n = 0 : y ? n = ds : n = cs;
|
|
761
802
|
}
|
|
762
|
-
d === void 0 && (d = !1),
|
|
763
|
-
const l = !!((p = (
|
|
803
|
+
d === void 0 && (d = !1), h === void 0 && (h = !0);
|
|
804
|
+
const l = !!((p = (g = (f = Si()) == null ? void 0 : f.vnode) == null ? void 0 : g.props) != null && p.onTileTimeRangeZoom);
|
|
764
805
|
return {
|
|
765
|
-
filters:
|
|
806
|
+
filters: u,
|
|
766
807
|
tz: o,
|
|
767
808
|
timeSpec: s.value,
|
|
768
809
|
refreshInterval: n,
|
|
769
810
|
editable: d,
|
|
770
|
-
showTileActions:
|
|
811
|
+
showTileActions: h,
|
|
771
812
|
zoomable: l
|
|
772
813
|
};
|
|
773
814
|
})
|
|
774
815
|
};
|
|
775
816
|
}
|
|
776
|
-
const
|
|
777
|
-
useContextLinks:
|
|
778
|
-
useDashboardInternalContext:
|
|
779
|
-
useEvaluateFeatureFlag:
|
|
780
|
-
useI18n:
|
|
781
|
-
useIssueQuery:
|
|
782
|
-
useRequestQueue:
|
|
783
|
-
},
|
|
817
|
+
const le = {
|
|
818
|
+
useContextLinks: Rs,
|
|
819
|
+
useDashboardInternalContext: Ts,
|
|
820
|
+
useEvaluateFeatureFlag: fs,
|
|
821
|
+
useI18n: as,
|
|
822
|
+
useIssueQuery: ks,
|
|
823
|
+
useRequestQueue: Es
|
|
824
|
+
}, pt = /* @__PURE__ */ Z({
|
|
784
825
|
__name: "QueryDataProvider",
|
|
785
826
|
props: {
|
|
786
827
|
context: {},
|
|
@@ -791,12 +832,12 @@ const ue = {
|
|
|
791
832
|
},
|
|
792
833
|
emits: ["chart-data", "queryComplete"],
|
|
793
834
|
setup(a, { emit: e }) {
|
|
794
|
-
const t = a, i = e, { i18n: s } =
|
|
835
|
+
const t = a, i = e, { i18n: s } = le.useI18n(), { issueQuery: r } = le.useIssueQuery(), o = pe(ve), n = () => t.queryReady && o ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, { data: d, error: h, isValidating: u } = $i(n, async () => {
|
|
795
836
|
try {
|
|
796
|
-
const
|
|
797
|
-
return
|
|
798
|
-
} catch (
|
|
799
|
-
throw
|
|
837
|
+
const m = await r(t.query, t.context, t.limitOverride);
|
|
838
|
+
return g.value = null, m;
|
|
839
|
+
} catch (m) {
|
|
840
|
+
throw g.value = Hi(m), m;
|
|
800
841
|
} finally {
|
|
801
842
|
i("queryComplete");
|
|
802
843
|
}
|
|
@@ -804,49 +845,49 @@ const ue = {
|
|
|
804
845
|
refreshInterval: t.context.refreshInterval,
|
|
805
846
|
revalidateOnFocus: !1,
|
|
806
847
|
shouldRetryOnError: !1
|
|
807
|
-
}), { state: l, swrvState: f } =
|
|
808
|
-
return Le([() => d.value, () => l.value], ([
|
|
809
|
-
|
|
810
|
-
}), (
|
|
811
|
-
var
|
|
812
|
-
const
|
|
813
|
-
return y.value || !x(d) && !p.value ? (C(), L
|
|
848
|
+
}), { state: l, swrvState: f } = Ji(d, h, u), g = M(null), p = R(() => l.value === f.ERROR || !!g.value), y = R(() => !t.queryReady || l.value === f.PENDING);
|
|
849
|
+
return Le([() => d.value, () => l.value], ([m, k]) => {
|
|
850
|
+
m && (k === "SUCCESS_HAS_DATA" || k === "SUCCESS") && i("chart-data", m);
|
|
851
|
+
}), (m, k) => {
|
|
852
|
+
var q;
|
|
853
|
+
const L = ue("KSkeleton"), w = ue("KEmptyState");
|
|
854
|
+
return y.value || !x(d) && !p.value ? (C(), I(L, {
|
|
814
855
|
key: 0,
|
|
815
856
|
class: "chart-skeleton",
|
|
816
857
|
type: "table"
|
|
817
|
-
})) : p.value ? (C(),
|
|
858
|
+
})) : p.value ? (C(), I(w, {
|
|
818
859
|
key: 1,
|
|
819
860
|
"action-button-visible": !1,
|
|
820
861
|
"data-testid": "chart-empty-state"
|
|
821
|
-
},
|
|
862
|
+
}, it({
|
|
822
863
|
icon: P(() => {
|
|
823
|
-
var
|
|
864
|
+
var A;
|
|
824
865
|
return [
|
|
825
|
-
((
|
|
866
|
+
((A = g.value) == null ? void 0 : A.type) === "forbidden" ? (C(), I(x(Ui), { key: 0 })) : (C(), I(x(Gi), { key: 1 }))
|
|
826
867
|
];
|
|
827
868
|
}),
|
|
828
869
|
title: P(() => {
|
|
829
|
-
var
|
|
870
|
+
var A;
|
|
830
871
|
return [
|
|
831
|
-
|
|
872
|
+
X("p", null, ee(((A = g.value) == null ? void 0 : A.message) || x(s).t("renderer.unexpectedError")), 1)
|
|
832
873
|
];
|
|
833
874
|
}),
|
|
834
875
|
_: 2
|
|
835
876
|
}, [
|
|
836
|
-
(
|
|
877
|
+
(q = g.value) != null && q.details ? {
|
|
837
878
|
name: "default",
|
|
838
879
|
fn: P(() => [
|
|
839
|
-
|
|
880
|
+
X("p", null, ee(g.value.details), 1)
|
|
840
881
|
]),
|
|
841
882
|
key: "0"
|
|
842
883
|
} : void 0
|
|
843
|
-
]), 1024)) : x(d) ? Ae(
|
|
884
|
+
]), 1024)) : x(d) ? Ae(m.$slots, "default", {
|
|
844
885
|
key: 2,
|
|
845
886
|
data: x(d)
|
|
846
|
-
}) :
|
|
887
|
+
}) : V("", !0);
|
|
847
888
|
};
|
|
848
889
|
}
|
|
849
|
-
}),
|
|
890
|
+
}), Ss = /* @__PURE__ */ Z({
|
|
850
891
|
__name: "SimpleChartRenderer",
|
|
851
892
|
props: {
|
|
852
893
|
query: {},
|
|
@@ -859,19 +900,19 @@ const ue = {
|
|
|
859
900
|
exploreLink: {}
|
|
860
901
|
},
|
|
861
902
|
setup(a) {
|
|
862
|
-
const e = a, t =
|
|
863
|
-
return (i, s) => (C(),
|
|
903
|
+
const e = a, t = R(() => e.chartOptions.type === "single_value");
|
|
904
|
+
return (i, s) => (C(), I(pt, {
|
|
864
905
|
context: a.context,
|
|
865
906
|
query: a.query,
|
|
866
907
|
"query-ready": a.queryReady,
|
|
867
908
|
"refresh-counter": a.refreshCounter
|
|
868
909
|
}, {
|
|
869
910
|
default: P(({ data: r }) => [
|
|
870
|
-
|
|
871
|
-
class:
|
|
872
|
-
style:
|
|
911
|
+
X("div", {
|
|
912
|
+
class: ze(["analytics-chart", { "single-value": t.value }]),
|
|
913
|
+
style: at(t.value ? void 0 : { height: `${a.height}px` })
|
|
873
914
|
}, [
|
|
874
|
-
|
|
915
|
+
oe(x(Ii), {
|
|
875
916
|
"chart-data": r,
|
|
876
917
|
"chart-options": a.chartOptions,
|
|
877
918
|
"synthetics-data-key": t.value ? void 0 : a.chartOptions.synthetics_data_key
|
|
@@ -886,7 +927,7 @@ const ue = {
|
|
|
886
927
|
for (const [i, s] of e)
|
|
887
928
|
t[i] = s;
|
|
888
929
|
return t;
|
|
889
|
-
},
|
|
930
|
+
}, Ht = /* @__PURE__ */ be(Ss, [["__scopeId", "data-v-d4c69df4"]]), Ds = { class: "analytics-chart" }, zs = /* @__PURE__ */ Z({
|
|
890
931
|
__name: "BaseAnalyticsChartRenderer",
|
|
891
932
|
props: {
|
|
892
933
|
query: {},
|
|
@@ -901,20 +942,20 @@ const ue = {
|
|
|
901
942
|
},
|
|
902
943
|
emits: ["edit-tile", "chart-data", "zoom-time-range", "view-requests", "select-chart-range"],
|
|
903
944
|
setup(a, { emit: e }) {
|
|
904
|
-
const t = a, i = e, { i18n: s } =
|
|
945
|
+
const t = a, i = e, { i18n: s } = le.useI18n(), r = R(() => ({
|
|
905
946
|
type: t.chartOptions.type,
|
|
906
947
|
stacked: t.chartOptions.stacked ?? !1,
|
|
907
948
|
chartDatasetColors: t.chartOptions.chart_dataset_colors,
|
|
908
949
|
threshold: t.chartOptions.threshold,
|
|
909
950
|
hideTruncationWarning: t.query.limit !== void 0 && t.query.limit > 0
|
|
910
|
-
})), o =
|
|
951
|
+
})), o = R(() => t.context.zoomable), n = () => {
|
|
911
952
|
i("edit-tile");
|
|
912
|
-
}, d = (
|
|
913
|
-
i("chart-data",
|
|
953
|
+
}, d = (h) => {
|
|
954
|
+
i("chart-data", h);
|
|
914
955
|
};
|
|
915
|
-
return (
|
|
916
|
-
const l =
|
|
917
|
-
return C(),
|
|
956
|
+
return (h, u) => {
|
|
957
|
+
const l = ue("KDropdownItem");
|
|
958
|
+
return C(), I(pt, {
|
|
918
959
|
context: a.context,
|
|
919
960
|
query: a.query,
|
|
920
961
|
"query-ready": a.queryReady,
|
|
@@ -922,8 +963,8 @@ const ue = {
|
|
|
922
963
|
onChartData: d
|
|
923
964
|
}, {
|
|
924
965
|
default: P(({ data: f }) => [
|
|
925
|
-
|
|
926
|
-
|
|
966
|
+
X("div", Ds, [
|
|
967
|
+
oe(x(Mi), Wt({
|
|
927
968
|
"chart-data": f,
|
|
928
969
|
"chart-options": r.value,
|
|
929
970
|
"explore-link": a.exploreLink,
|
|
@@ -933,15 +974,15 @@ const ue = {
|
|
|
933
974
|
"timeseries-zoom": o.value,
|
|
934
975
|
"tooltip-title": ""
|
|
935
976
|
}, a.extraProps, {
|
|
936
|
-
onSelectChartRange:
|
|
937
|
-
onZoomTimeRange:
|
|
938
|
-
}),
|
|
977
|
+
onSelectChartRange: u[0] || (u[0] = (g) => i("select-chart-range", g)),
|
|
978
|
+
onZoomTimeRange: u[1] || (u[1] = (g) => i("zoom-time-range", g))
|
|
979
|
+
}), it({ _: 2 }, [
|
|
939
980
|
a.context.editable ? {
|
|
940
981
|
name: "menu-items",
|
|
941
982
|
fn: P(() => [
|
|
942
|
-
|
|
983
|
+
oe(l, { onClick: n }, {
|
|
943
984
|
default: P(() => [
|
|
944
|
-
|
|
985
|
+
dt(ee(x(s).t("renderer.edit")), 1)
|
|
945
986
|
]),
|
|
946
987
|
_: 1
|
|
947
988
|
})
|
|
@@ -955,7 +996,7 @@ const ue = {
|
|
|
955
996
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
956
997
|
};
|
|
957
998
|
}
|
|
958
|
-
}),
|
|
999
|
+
}), yt = /* @__PURE__ */ be(zs, [["__scopeId", "data-v-52357845"]]), It = /* @__PURE__ */ Z({
|
|
959
1000
|
__name: "BarChartRenderer",
|
|
960
1001
|
props: {
|
|
961
1002
|
query: {},
|
|
@@ -968,7 +1009,7 @@ const ue = {
|
|
|
968
1009
|
exploreLink: {}
|
|
969
1010
|
},
|
|
970
1011
|
setup(a) {
|
|
971
|
-
return (e, t) => (C(),
|
|
1012
|
+
return (e, t) => (C(), I(yt, {
|
|
972
1013
|
"chart-options": a.chartOptions,
|
|
973
1014
|
context: a.context,
|
|
974
1015
|
"extra-props": { showAnnotations: !1 },
|
|
@@ -978,7 +1019,7 @@ const ue = {
|
|
|
978
1019
|
"refresh-counter": a.refreshCounter
|
|
979
1020
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
980
1021
|
}
|
|
981
|
-
}),
|
|
1022
|
+
}), Mt = /* @__PURE__ */ Z({
|
|
982
1023
|
__name: "TimeseriesChartRenderer",
|
|
983
1024
|
props: {
|
|
984
1025
|
query: {},
|
|
@@ -993,7 +1034,7 @@ const ue = {
|
|
|
993
1034
|
emits: ["zoom-time-range", "select-chart-range"],
|
|
994
1035
|
setup(a, { emit: e }) {
|
|
995
1036
|
const t = e;
|
|
996
|
-
return (i, s) => (C(),
|
|
1037
|
+
return (i, s) => (C(), I(yt, {
|
|
997
1038
|
"chart-options": a.chartOptions,
|
|
998
1039
|
context: a.context,
|
|
999
1040
|
"explore-link": a.exploreLink,
|
|
@@ -1006,7 +1047,7 @@ const ue = {
|
|
|
1006
1047
|
onZoomTimeRange: s[1] || (s[1] = (r) => t("zoom-time-range", r))
|
|
1007
1048
|
}, null, 8, ["chart-options", "context", "explore-link", "height", "query", "query-ready", "refresh-counter", "requests-link"]));
|
|
1008
1049
|
}
|
|
1009
|
-
}),
|
|
1050
|
+
}), Ns = /* @__PURE__ */ Z({
|
|
1010
1051
|
__name: "GoldenSignalsRenderer",
|
|
1011
1052
|
props: {
|
|
1012
1053
|
query: {},
|
|
@@ -1019,7 +1060,7 @@ const ue = {
|
|
|
1019
1060
|
exploreLink: {}
|
|
1020
1061
|
},
|
|
1021
1062
|
setup(a) {
|
|
1022
|
-
const e = a, t =
|
|
1063
|
+
const e = a, t = R(() => {
|
|
1023
1064
|
var s, r;
|
|
1024
1065
|
const i = (s = e.query) == null ? void 0 : s.datasource;
|
|
1025
1066
|
if (i && i !== "api_usage" && i !== "basic")
|
|
@@ -1036,29 +1077,29 @@ const ue = {
|
|
|
1036
1077
|
refreshCounter: e.refreshCounter
|
|
1037
1078
|
};
|
|
1038
1079
|
});
|
|
1039
|
-
return (i, s) => (C(),
|
|
1040
|
-
class:
|
|
1080
|
+
return (i, s) => (C(), W("div", {
|
|
1081
|
+
class: ze(["metric-card-tile-wrapper", { titled: !!e.chartOptions.chart_title }])
|
|
1041
1082
|
}, [
|
|
1042
|
-
|
|
1083
|
+
oe(x(ji), Di(zi(t.value)), {
|
|
1043
1084
|
default: P(() => [
|
|
1044
|
-
|
|
1085
|
+
oe(x(Xi))
|
|
1045
1086
|
]),
|
|
1046
1087
|
_: 1
|
|
1047
1088
|
}, 16)
|
|
1048
1089
|
], 2));
|
|
1049
1090
|
}
|
|
1050
|
-
}),
|
|
1091
|
+
}), Ls = /* @__PURE__ */ be(Ns, [["__scopeId", "data-v-8a51fd28"]]), As = {
|
|
1051
1092
|
class: "fallback-entity-link",
|
|
1052
1093
|
"data-testid": "entity-link-parent"
|
|
1053
|
-
},
|
|
1094
|
+
}, qt = /* @__PURE__ */ Z({
|
|
1054
1095
|
__name: "FallbackEntityLink",
|
|
1055
1096
|
props: {
|
|
1056
1097
|
entityLinkData: {}
|
|
1057
1098
|
},
|
|
1058
1099
|
setup(a) {
|
|
1059
|
-
return (e, t) => (C(),
|
|
1100
|
+
return (e, t) => (C(), W("div", As, ee(a.entityLinkData.label), 1));
|
|
1060
1101
|
}
|
|
1061
|
-
}),
|
|
1102
|
+
}), Os = /* @__PURE__ */ Z({
|
|
1062
1103
|
__name: "TopNTableRenderer",
|
|
1063
1104
|
props: {
|
|
1064
1105
|
query: {},
|
|
@@ -1071,39 +1112,39 @@ const ue = {
|
|
|
1071
1112
|
exploreLink: {}
|
|
1072
1113
|
},
|
|
1073
1114
|
setup(a) {
|
|
1074
|
-
const e = a, t =
|
|
1115
|
+
const e = a, t = pe(ve), i = Kt(async () => {
|
|
1075
1116
|
if (t != null && t.fetchComponent)
|
|
1076
1117
|
try {
|
|
1077
1118
|
return await t.fetchComponent("EntityLink");
|
|
1078
1119
|
} catch {
|
|
1079
|
-
return
|
|
1120
|
+
return qt;
|
|
1080
1121
|
}
|
|
1081
|
-
return
|
|
1122
|
+
return qt;
|
|
1082
1123
|
}), s = (r) => {
|
|
1083
1124
|
var o;
|
|
1084
1125
|
if ((o = e.chartOptions) != null && o.entity_link)
|
|
1085
1126
|
if (r.id.includes(":")) {
|
|
1086
1127
|
const [n, d] = r.id.split(":");
|
|
1087
|
-
return e.chartOptions.entity_link.replace(
|
|
1128
|
+
return e.chartOptions.entity_link.replace(ls, n).replace(Dt, d);
|
|
1088
1129
|
} else
|
|
1089
|
-
return e.chartOptions.entity_link.replace(
|
|
1130
|
+
return e.chartOptions.entity_link.replace(Dt, r.id);
|
|
1090
1131
|
return "";
|
|
1091
1132
|
};
|
|
1092
|
-
return (r, o) => (C(),
|
|
1133
|
+
return (r, o) => (C(), I(pt, {
|
|
1093
1134
|
context: a.context,
|
|
1094
1135
|
query: a.query,
|
|
1095
1136
|
"query-ready": a.queryReady,
|
|
1096
1137
|
"refresh-counter": a.refreshCounter
|
|
1097
1138
|
}, {
|
|
1098
1139
|
default: P(({ data: n }) => [
|
|
1099
|
-
|
|
1140
|
+
oe(x(qi), {
|
|
1100
1141
|
data: n,
|
|
1101
1142
|
"synthetics-data-key": a.chartOptions.synthetics_data_key
|
|
1102
|
-
},
|
|
1143
|
+
}, it({ _: 2 }, [
|
|
1103
1144
|
e.chartOptions.entity_link ? {
|
|
1104
1145
|
name: "name",
|
|
1105
1146
|
fn: P(({ record: d }) => [
|
|
1106
|
-
|
|
1147
|
+
oe(x(i), {
|
|
1107
1148
|
"entity-link-data": {
|
|
1108
1149
|
id: d.id,
|
|
1109
1150
|
label: d.name,
|
|
@@ -1119,7 +1160,7 @@ const ue = {
|
|
|
1119
1160
|
_: 1
|
|
1120
1161
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
1121
1162
|
}
|
|
1122
|
-
}),
|
|
1163
|
+
}), Pt = "#6c7489", Hs = "12px", $t = "20px", Bt = "32px", ai = "20px", Is = /* @__PURE__ */ Z({
|
|
1123
1164
|
__name: "DonutChartRenderer",
|
|
1124
1165
|
props: {
|
|
1125
1166
|
query: {},
|
|
@@ -1132,7 +1173,7 @@ const ue = {
|
|
|
1132
1173
|
exploreLink: {}
|
|
1133
1174
|
},
|
|
1134
1175
|
setup(a) {
|
|
1135
|
-
return (e, t) => (C(),
|
|
1176
|
+
return (e, t) => (C(), I(yt, {
|
|
1136
1177
|
"chart-options": a.chartOptions,
|
|
1137
1178
|
context: a.context,
|
|
1138
1179
|
height: a.height,
|
|
@@ -1141,15 +1182,15 @@ const ue = {
|
|
|
1141
1182
|
"refresh-counter": a.refreshCounter
|
|
1142
1183
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
1143
1184
|
}
|
|
1144
|
-
}),
|
|
1185
|
+
}), Ms = ["data-testid"], qs = {
|
|
1145
1186
|
key: 0,
|
|
1146
1187
|
class: "tile-header"
|
|
1147
|
-
},
|
|
1188
|
+
}, Ps = { class: "badge-container" }, $s = { class: "badge-text" }, Bs = { key: 0 }, Fs = ["data-testid"], Us = ["data-testid"], Gs = { class: "delete-option" }, Ws = ["data-testid"], Ks = ["data-testid"], Vs = /* @__PURE__ */ Z({
|
|
1148
1189
|
__name: "DashboardTile",
|
|
1149
|
-
props: /* @__PURE__ */
|
|
1190
|
+
props: /* @__PURE__ */ Ve({
|
|
1150
1191
|
context: {},
|
|
1151
1192
|
definition: {},
|
|
1152
|
-
height: { default:
|
|
1193
|
+
height: { default: Be },
|
|
1153
1194
|
isFullscreen: { type: Boolean },
|
|
1154
1195
|
hideActions: { type: Boolean, default: !1 },
|
|
1155
1196
|
queryReady: { type: Boolean },
|
|
@@ -1159,60 +1200,60 @@ const ue = {
|
|
|
1159
1200
|
refreshCounter: { default: 0 },
|
|
1160
1201
|
refreshCounterModifiers: {}
|
|
1161
1202
|
}),
|
|
1162
|
-
emits: /* @__PURE__ */
|
|
1203
|
+
emits: /* @__PURE__ */ Ve(["chart-data", "edit-tile", "duplicate-tile", "remove-tile", "tile-time-range-zoom", "tile-bounds-change"], ["update:refreshCounter"]),
|
|
1163
1204
|
setup(a, { expose: e, emit: t }) {
|
|
1164
|
-
|
|
1165
|
-
|
|
1205
|
+
ct((v) => ({
|
|
1206
|
+
v57da23f2: `${v.height}px`
|
|
1166
1207
|
}));
|
|
1167
|
-
const i = parseInt(
|
|
1168
|
-
|
|
1169
|
-
}, n = t, d =
|
|
1170
|
-
exploreLinkKebabMenu:
|
|
1171
|
-
requestsLinkKebabMenu:
|
|
1172
|
-
canShowKebabMenu:
|
|
1173
|
-
canGenerateRequestsLink:
|
|
1174
|
-
canGenerateExploreLink:
|
|
1175
|
-
requestsLinkZoomActions:
|
|
1176
|
-
exploreLinkZoomActions:
|
|
1177
|
-
buildExploreQuery:
|
|
1178
|
-
buildExploreLink:
|
|
1179
|
-
buildRequestLink:
|
|
1180
|
-
buildRequestsQueryZoomActions:
|
|
1181
|
-
} =
|
|
1182
|
-
queryBridge:
|
|
1183
|
-
chartData:
|
|
1184
|
-
definition:
|
|
1185
|
-
context:
|
|
1186
|
-
}), { issueQuery:
|
|
1187
|
-
Le(() => s.definition, async (v,
|
|
1188
|
-
await
|
|
1208
|
+
const i = parseInt(ai, 10), s = a, r = Vt(a, "refreshCounter"), o = () => {
|
|
1209
|
+
L.value = !0, r.value++;
|
|
1210
|
+
}, n = t, d = Kt(() => import("./GeoMapRenderer-CTei4zeC.js")), h = pe(ve), u = gt(), { stripUnknownFilters: l } = oi(u), { i18n: f } = le.useI18n(), g = M(), p = M({ status: "loading" }), y = M(!1), m = M(), k = M(!1), L = M(!0), {
|
|
1211
|
+
exploreLinkKebabMenu: w,
|
|
1212
|
+
requestsLinkKebabMenu: q,
|
|
1213
|
+
canShowKebabMenu: A,
|
|
1214
|
+
canGenerateRequestsLink: fe,
|
|
1215
|
+
canGenerateExploreLink: we,
|
|
1216
|
+
requestsLinkZoomActions: _e,
|
|
1217
|
+
exploreLinkZoomActions: T,
|
|
1218
|
+
buildExploreQuery: z,
|
|
1219
|
+
buildExploreLink: re,
|
|
1220
|
+
buildRequestLink: ge,
|
|
1221
|
+
buildRequestsQueryZoomActions: Ee
|
|
1222
|
+
} = le.useContextLinks({
|
|
1223
|
+
queryBridge: h,
|
|
1224
|
+
chartData: ot(g),
|
|
1225
|
+
definition: ot(De(s, "definition")),
|
|
1226
|
+
context: ot(De(s, "context"))
|
|
1227
|
+
}), { issueQuery: S } = le.useIssueQuery();
|
|
1228
|
+
Le(() => s.definition, async (v, N) => {
|
|
1229
|
+
await ft(), m.value && (k.value = m.value.scrollWidth > m.value.clientWidth);
|
|
1189
1230
|
try {
|
|
1190
|
-
JSON.stringify(v == null ? void 0 : v.query) !== JSON.stringify(
|
|
1231
|
+
JSON.stringify(v == null ? void 0 : v.query) !== JSON.stringify(N == null ? void 0 : N.query) && (L.value = !0);
|
|
1191
1232
|
} catch {
|
|
1192
1233
|
}
|
|
1193
1234
|
}, { immediate: !0, deep: !0 });
|
|
1194
|
-
const
|
|
1195
|
-
timeseries_line:
|
|
1196
|
-
timeseries_bar:
|
|
1197
|
-
horizontal_bar:
|
|
1198
|
-
vertical_bar:
|
|
1199
|
-
gauge:
|
|
1200
|
-
donut:
|
|
1201
|
-
golden_signals:
|
|
1202
|
-
top_n:
|
|
1235
|
+
const O = R(() => f.t("csvExport.defaultFilename")), $ = R(() => A.value && !s.hideActions && (F.value || s.context.editable)), F = R(() => !!w.value || ("allow_csv_export" in s.definition.chart ? s.definition.chart.allow_csv_export : !0) || s.context.editable), ne = {
|
|
1236
|
+
timeseries_line: Mt,
|
|
1237
|
+
timeseries_bar: Mt,
|
|
1238
|
+
horizontal_bar: It,
|
|
1239
|
+
vertical_bar: It,
|
|
1240
|
+
gauge: Ht,
|
|
1241
|
+
donut: Is,
|
|
1242
|
+
golden_signals: Ls,
|
|
1243
|
+
top_n: Os,
|
|
1203
1244
|
slottable: void 0,
|
|
1204
|
-
single_value:
|
|
1245
|
+
single_value: Ht,
|
|
1205
1246
|
choropleth_map: d
|
|
1206
|
-
},
|
|
1207
|
-
var v,
|
|
1247
|
+
}, Fe = R(() => {
|
|
1248
|
+
var v, N, H;
|
|
1208
1249
|
return {
|
|
1209
|
-
...(v =
|
|
1210
|
-
...(
|
|
1211
|
-
...(
|
|
1250
|
+
...(v = xe.value) != null && v.rendererEvents.supportsRequests ? { "select-chart-range": wi } : {},
|
|
1251
|
+
...(N = xe.value) != null && N.rendererEvents.supportsZoom ? { "zoom-time-range": _i } : {},
|
|
1252
|
+
...(H = xe.value) != null && H.rendererEvents.supportsBounds ? { "bounds-change": bi } : {}
|
|
1212
1253
|
};
|
|
1213
|
-
}),
|
|
1214
|
-
var
|
|
1215
|
-
const v =
|
|
1254
|
+
}), xe = R(() => {
|
|
1255
|
+
var j, he;
|
|
1256
|
+
const v = ne[s.definition.chart.type], N = !!((j = v == null ? void 0 : v.emits) != null && j.includes("select-chart-range")), H = !!((he = v == null ? void 0 : v.emits) != null && he.includes("zoom-time-range")), Y = s.definition.chart.type === "choropleth_map";
|
|
1216
1257
|
return v && {
|
|
1217
1258
|
component: v,
|
|
1218
1259
|
rendererProps: {
|
|
@@ -1222,260 +1263,264 @@ const ue = {
|
|
|
1222
1263
|
chartOptions: s.definition.chart,
|
|
1223
1264
|
height: s.height - i * 2,
|
|
1224
1265
|
refreshCounter: r.value,
|
|
1225
|
-
requestsLink:
|
|
1226
|
-
exploreLink:
|
|
1266
|
+
requestsLink: _e.value,
|
|
1267
|
+
exploreLink: T.value
|
|
1227
1268
|
},
|
|
1228
1269
|
rendererEvents: {
|
|
1229
|
-
supportsRequests:
|
|
1230
|
-
supportsZoom:
|
|
1231
|
-
supportsBounds:
|
|
1270
|
+
supportsRequests: N,
|
|
1271
|
+
supportsZoom: H,
|
|
1272
|
+
supportsBounds: Y
|
|
1232
1273
|
}
|
|
1233
1274
|
};
|
|
1234
|
-
}),
|
|
1235
|
-
var
|
|
1236
|
-
const v = (
|
|
1275
|
+
}), rt = R(() => {
|
|
1276
|
+
var N;
|
|
1277
|
+
const v = (N = s.definition.query) == null ? void 0 : N.time_range;
|
|
1237
1278
|
if ((v == null ? void 0 : v.type) === "relative") {
|
|
1238
|
-
const
|
|
1239
|
-
return
|
|
1279
|
+
const H = Li.get(Ai[v.time_range]);
|
|
1280
|
+
return H ? H.display : (console.warn("Did not recognize the given relative time range:", v.time_range), v.time_range);
|
|
1240
1281
|
} else if ((v == null ? void 0 : v.type) === "absolute") {
|
|
1241
|
-
const
|
|
1242
|
-
return `${
|
|
1282
|
+
const H = v.tz || "Etc/UTC";
|
|
1283
|
+
return `${St(v.start, { short: !0, tz: H })} - ${St(v.end, { short: !0, tz: H })}`;
|
|
1243
1284
|
}
|
|
1244
1285
|
return null;
|
|
1245
|
-
}),
|
|
1286
|
+
}), bt = R(() => {
|
|
1246
1287
|
if (s.definition.chart.type === "slottable")
|
|
1247
1288
|
return !1;
|
|
1248
|
-
const v = !!s.definition.chart.chart_title,
|
|
1249
|
-
return v ||
|
|
1250
|
-
}),
|
|
1251
|
-
var
|
|
1252
|
-
if (!
|
|
1289
|
+
const v = !!s.definition.chart.chart_title, N = s.definition.chart.type === "golden_signals" && !!s.definition.chart.description, H = s.showRefresh, Y = $.value && F.value && !s.isFullscreen, j = !!rt.value;
|
|
1290
|
+
return v || Y || j || N || H;
|
|
1291
|
+
}), wt = R(() => g.value ? lt(g.value.meta.granularity_ms) : void 0), ui = R(() => ["timeseries_line", "timeseries_bar"].includes(s.definition.chart.type)), Et = R(() => {
|
|
1292
|
+
var N, H;
|
|
1293
|
+
if (!ui.value || !s.queryReady || L.value)
|
|
1253
1294
|
return !1;
|
|
1254
|
-
const v = (
|
|
1255
|
-
return !v || !
|
|
1256
|
-
}),
|
|
1257
|
-
var
|
|
1258
|
-
const v =
|
|
1259
|
-
return
|
|
1260
|
-
currentGranularity:
|
|
1261
|
-
savedGranularity:
|
|
1295
|
+
const v = (H = (N = s.definition) == null ? void 0 : N.query) == null ? void 0 : H.granularity;
|
|
1296
|
+
return !v || !wt.value ? !1 : v !== wt.value;
|
|
1297
|
+
}), di = R(() => {
|
|
1298
|
+
var H, Y, j;
|
|
1299
|
+
const v = lt(((H = g.value) == null ? void 0 : H.meta.granularity_ms) ?? 0) ?? "unknown", N = ((j = (Y = s.definition) == null ? void 0 : Y.query) == null ? void 0 : j.granularity) ?? "unknown";
|
|
1300
|
+
return f.t("query_aged_out_warning", {
|
|
1301
|
+
currentGranularity: f.t(`granularities.${v}`),
|
|
1302
|
+
savedGranularity: f.t(`granularities.${N}`)
|
|
1262
1303
|
});
|
|
1263
|
-
}),
|
|
1264
|
-
var
|
|
1265
|
-
const v = [...s.context.filters, ...s.definition.query.filters ?? []],
|
|
1266
|
-
return
|
|
1267
|
-
|
|
1304
|
+
}), ci = R(() => {
|
|
1305
|
+
var Y, j;
|
|
1306
|
+
const v = [...s.context.filters, ...s.definition.query.filters ?? []], N = s.definition.query.metrics, H = ((j = (Y = s.definition) == null ? void 0 : Y.query) == null ? void 0 : j.datasource) ?? "api_usage";
|
|
1307
|
+
return l.value({
|
|
1308
|
+
datasource: H,
|
|
1309
|
+
filters: v,
|
|
1310
|
+
metrics: N
|
|
1311
|
+
});
|
|
1312
|
+
}), fi = () => {
|
|
1268
1313
|
n("edit-tile", s.definition);
|
|
1269
|
-
},
|
|
1314
|
+
}, gi = () => {
|
|
1270
1315
|
n("duplicate-tile", s.definition);
|
|
1271
|
-
},
|
|
1316
|
+
}, mi = () => {
|
|
1272
1317
|
n("remove-tile", s.definition);
|
|
1273
|
-
},
|
|
1274
|
-
|
|
1275
|
-
},
|
|
1276
|
-
|
|
1277
|
-
},
|
|
1278
|
-
var
|
|
1279
|
-
const v = (
|
|
1280
|
-
return ((
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1318
|
+
}, pi = (v) => {
|
|
1319
|
+
g.value = v, L.value = !1, n("chart-data", v);
|
|
1320
|
+
}, yi = () => {
|
|
1321
|
+
y.value = !1;
|
|
1322
|
+
}, xt = () => {
|
|
1323
|
+
var H, Y;
|
|
1324
|
+
const v = (H = s.definition.query.datasource) == null ? void 0 : H.startsWith("goap");
|
|
1325
|
+
return ((Y = h == null ? void 0 : h.staticConfig) == null ? void 0 : Y.increaseCsvExportLimit) !== !1 && !v ? S(s.definition.query, s.context, Oi) : g.value ? Promise.resolve(g.value) : new Promise((j) => {
|
|
1326
|
+
const he = Le(g, (Ue) => {
|
|
1327
|
+
Ue && (j(Ue), he());
|
|
1283
1328
|
});
|
|
1284
1329
|
});
|
|
1285
|
-
},
|
|
1286
|
-
|
|
1330
|
+
}, vi = async () => {
|
|
1331
|
+
y.value = !0, p.value = { status: "loading" };
|
|
1287
1332
|
try {
|
|
1288
|
-
const v = await
|
|
1289
|
-
|
|
1333
|
+
const v = await xt();
|
|
1334
|
+
p.value = { status: "success", chartData: v };
|
|
1290
1335
|
} catch (v) {
|
|
1291
|
-
|
|
1336
|
+
p.value = { status: "error", error: v };
|
|
1292
1337
|
}
|
|
1293
|
-
},
|
|
1294
|
-
const
|
|
1338
|
+
}, _i = (v) => {
|
|
1339
|
+
const N = {
|
|
1295
1340
|
tileId: s.tileId.toString(),
|
|
1296
1341
|
timeRange: v
|
|
1297
1342
|
};
|
|
1298
|
-
n("tile-time-range-zoom",
|
|
1299
|
-
},
|
|
1300
|
-
const
|
|
1343
|
+
n("tile-time-range-zoom", N);
|
|
1344
|
+
}, bi = (v) => {
|
|
1345
|
+
const N = {
|
|
1301
1346
|
tileId: s.tileId.toString(),
|
|
1302
1347
|
bounds: v
|
|
1303
1348
|
};
|
|
1304
|
-
n("tile-bounds-change",
|
|
1305
|
-
},
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1349
|
+
n("tile-bounds-change", N);
|
|
1350
|
+
}, wi = (v) => {
|
|
1351
|
+
const N = ci.value, H = z(v, N);
|
|
1352
|
+
T.value = we.value ? { href: re(H) } : void 0, _e.value = fe.value ? { href: ge(Ee(v, N)) } : void 0;
|
|
1308
1353
|
};
|
|
1309
|
-
return e({ getExportData:
|
|
1310
|
-
const
|
|
1311
|
-
return C(),
|
|
1312
|
-
class:
|
|
1354
|
+
return e({ getExportData: xt }), (v, N) => {
|
|
1355
|
+
const H = ue("KTooltip"), Y = ue("KBadge"), j = ue("KButton"), he = ue("KDropdownItem"), Ue = ue("KDropdown");
|
|
1356
|
+
return C(), W("div", {
|
|
1357
|
+
class: ze(["tile-boundary", {
|
|
1313
1358
|
editable: a.context.editable,
|
|
1314
|
-
headless: !
|
|
1359
|
+
headless: !bt.value
|
|
1315
1360
|
}]),
|
|
1316
1361
|
"data-testid": `tile-${a.tileId}`
|
|
1317
1362
|
}, [
|
|
1318
|
-
|
|
1319
|
-
|
|
1363
|
+
bt.value && a.definition.chart.type !== "slottable" ? (C(), W("div", qs, [
|
|
1364
|
+
oe(H, {
|
|
1320
1365
|
class: "title-tooltip",
|
|
1321
|
-
disabled: !
|
|
1366
|
+
disabled: !k.value,
|
|
1322
1367
|
"max-width": "500",
|
|
1323
1368
|
text: a.definition.chart.chart_title
|
|
1324
1369
|
}, {
|
|
1325
1370
|
default: P(() => [
|
|
1326
|
-
|
|
1371
|
+
X("div", {
|
|
1327
1372
|
ref_key: "titleRef",
|
|
1328
|
-
ref:
|
|
1373
|
+
ref: m,
|
|
1329
1374
|
class: "title"
|
|
1330
|
-
},
|
|
1375
|
+
}, ee(a.definition.chart.chart_title), 513)
|
|
1331
1376
|
]),
|
|
1332
1377
|
_: 1
|
|
1333
1378
|
}, 8, ["disabled", "text"]),
|
|
1334
|
-
|
|
1335
|
-
|
|
1379
|
+
X("div", Ps, [
|
|
1380
|
+
rt.value ? (C(), I(Y, {
|
|
1336
1381
|
key: 0,
|
|
1337
1382
|
"data-testid": "time-range-badge",
|
|
1338
|
-
tooltip:
|
|
1383
|
+
tooltip: Et.value ? di.value : void 0,
|
|
1339
1384
|
"tooltip-attributes": { maxWidth: "320px" }
|
|
1340
|
-
},
|
|
1385
|
+
}, it({
|
|
1341
1386
|
default: P(() => [
|
|
1342
|
-
|
|
1387
|
+
X("span", $s, ee(rt.value), 1)
|
|
1343
1388
|
]),
|
|
1344
1389
|
_: 2
|
|
1345
1390
|
}, [
|
|
1346
|
-
|
|
1391
|
+
Et.value ? {
|
|
1347
1392
|
name: "icon",
|
|
1348
1393
|
fn: P(() => [
|
|
1349
|
-
|
|
1394
|
+
oe(x(Wi), { size: x(Hs) }, null, 8, ["size"])
|
|
1350
1395
|
]),
|
|
1351
1396
|
key: "0"
|
|
1352
1397
|
} : void 0
|
|
1353
|
-
]), 1032, ["tooltip"])) :
|
|
1398
|
+
]), 1032, ["tooltip"])) : V("", !0)
|
|
1354
1399
|
]),
|
|
1355
|
-
a.showRefresh ? (C(),
|
|
1356
|
-
|
|
1400
|
+
a.showRefresh ? (C(), W("div", Bs, [
|
|
1401
|
+
oe(j, {
|
|
1357
1402
|
appearance: "secondary",
|
|
1358
1403
|
class: "refresh-button",
|
|
1359
1404
|
"data-testid": `tile-refresh-button-${a.tileId}`,
|
|
1360
|
-
disabled:
|
|
1405
|
+
disabled: L.value,
|
|
1361
1406
|
icon: "",
|
|
1362
1407
|
size: "small",
|
|
1363
1408
|
onClick: o
|
|
1364
1409
|
}, {
|
|
1365
1410
|
default: P(() => [
|
|
1366
|
-
|
|
1411
|
+
L.value ? (C(), I(x(Ki), {
|
|
1367
1412
|
key: 0,
|
|
1368
1413
|
role: "button",
|
|
1369
|
-
size: x(
|
|
1414
|
+
size: x(Bt),
|
|
1370
1415
|
tabindex: "0"
|
|
1371
|
-
}, null, 8, ["size"])) : (C(),
|
|
1416
|
+
}, null, 8, ["size"])) : (C(), I(x(Vi), {
|
|
1372
1417
|
key: 1,
|
|
1373
1418
|
role: "button",
|
|
1374
|
-
size: x(
|
|
1419
|
+
size: x(Bt),
|
|
1375
1420
|
tabindex: "0"
|
|
1376
1421
|
}, null, 8, ["size"]))
|
|
1377
1422
|
]),
|
|
1378
1423
|
_: 1
|
|
1379
1424
|
}, 8, ["data-testid", "disabled"])
|
|
1380
|
-
])) :
|
|
1381
|
-
|
|
1425
|
+
])) : V("", !0),
|
|
1426
|
+
$.value ? (C(), W("div", {
|
|
1382
1427
|
key: 1,
|
|
1383
1428
|
class: "tile-actions",
|
|
1384
1429
|
"data-testid": `tile-actions-${a.tileId}`
|
|
1385
1430
|
}, [
|
|
1386
|
-
x(
|
|
1431
|
+
x(A) && a.context.editable && !a.isFullscreen ? (C(), I(x(Qi), {
|
|
1387
1432
|
key: 0,
|
|
1388
1433
|
class: "edit-icon",
|
|
1389
|
-
color: x(
|
|
1434
|
+
color: x(Pt),
|
|
1390
1435
|
"data-testid": `edit-tile-${a.tileId}`,
|
|
1391
|
-
size: x(
|
|
1392
|
-
onClick:
|
|
1393
|
-
}, null, 8, ["color", "data-testid", "size"])) :
|
|
1394
|
-
x(
|
|
1436
|
+
size: x($t),
|
|
1437
|
+
onClick: fi
|
|
1438
|
+
}, null, 8, ["color", "data-testid", "size"])) : V("", !0),
|
|
1439
|
+
x(A) && F.value && !a.isFullscreen ? (C(), I(Ue, {
|
|
1395
1440
|
key: 1,
|
|
1396
1441
|
class: "dropdown",
|
|
1397
1442
|
"data-testid": `chart-action-menu-${a.tileId}`,
|
|
1398
1443
|
"kpop-attributes": { placement: "bottom-end" }
|
|
1399
1444
|
}, {
|
|
1400
1445
|
items: P(() => [
|
|
1401
|
-
x(
|
|
1446
|
+
x(w) ? (C(), I(he, {
|
|
1402
1447
|
key: 0,
|
|
1403
1448
|
"data-testid": `chart-jump-to-explore-${a.tileId}`,
|
|
1404
|
-
item: { label: x(
|
|
1405
|
-
}, null, 8, ["data-testid", "item"])) :
|
|
1406
|
-
x(
|
|
1449
|
+
item: { label: x(f).t("jumpToExplore"), to: x(w) }
|
|
1450
|
+
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1451
|
+
x(q) ? (C(), I(he, {
|
|
1407
1452
|
key: 1,
|
|
1408
1453
|
"data-testid": `chart-jump-to-requests-${a.tileId}`,
|
|
1409
|
-
item: { label: x(
|
|
1410
|
-
}, null, 8, ["data-testid", "item"])) :
|
|
1411
|
-
!("allow_csv_export" in a.definition.chart) || a.definition.chart.allow_csv_export ? (C(),
|
|
1454
|
+
item: { label: x(f).t("jumpToRequests"), to: x(q) }
|
|
1455
|
+
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1456
|
+
!("allow_csv_export" in a.definition.chart) || a.definition.chart.allow_csv_export ? (C(), I(he, {
|
|
1412
1457
|
key: 2,
|
|
1413
1458
|
class: "chart-export-button",
|
|
1414
1459
|
"data-testid": `chart-csv-export-${a.tileId}`,
|
|
1415
|
-
onClick:
|
|
1460
|
+
onClick: vi
|
|
1416
1461
|
}, {
|
|
1417
1462
|
default: P(() => [
|
|
1418
|
-
|
|
1463
|
+
X("span", {
|
|
1419
1464
|
class: "chart-export-trigger",
|
|
1420
1465
|
"data-testid": `csv-export-button-${a.tileId}`
|
|
1421
|
-
},
|
|
1466
|
+
}, ee(x(f).t("csvExport.exportAsCsv")), 9, Us)
|
|
1422
1467
|
]),
|
|
1423
1468
|
_: 1
|
|
1424
|
-
}, 8, ["data-testid"])) :
|
|
1425
|
-
a.context.editable ? (C(),
|
|
1469
|
+
}, 8, ["data-testid"])) : V("", !0),
|
|
1470
|
+
a.context.editable ? (C(), I(he, {
|
|
1426
1471
|
key: 3,
|
|
1427
1472
|
"data-testid": `duplicate-tile-${a.tileId}`,
|
|
1428
|
-
onClick:
|
|
1473
|
+
onClick: gi
|
|
1429
1474
|
}, {
|
|
1430
1475
|
default: P(() => [
|
|
1431
|
-
|
|
1476
|
+
dt(ee(x(f).t("renderer.duplicateTile")), 1)
|
|
1432
1477
|
]),
|
|
1433
1478
|
_: 1
|
|
1434
|
-
}, 8, ["data-testid"])) :
|
|
1435
|
-
a.context.editable ? (C(),
|
|
1479
|
+
}, 8, ["data-testid"])) : V("", !0),
|
|
1480
|
+
a.context.editable ? (C(), I(he, {
|
|
1436
1481
|
key: 4,
|
|
1437
1482
|
"data-testid": `remove-tile-${a.tileId}`,
|
|
1438
|
-
onClick:
|
|
1483
|
+
onClick: mi
|
|
1439
1484
|
}, {
|
|
1440
1485
|
default: P(() => [
|
|
1441
|
-
|
|
1486
|
+
X("span", Gs, ee(x(f).t("renderer.delete")), 1)
|
|
1442
1487
|
]),
|
|
1443
1488
|
_: 1
|
|
1444
|
-
}, 8, ["data-testid"])) :
|
|
1489
|
+
}, 8, ["data-testid"])) : V("", !0)
|
|
1445
1490
|
]),
|
|
1446
1491
|
default: P(() => [
|
|
1447
|
-
|
|
1492
|
+
oe(x(Yi), {
|
|
1448
1493
|
class: "kebab-action-menu",
|
|
1449
|
-
color: x(
|
|
1494
|
+
color: x(Pt),
|
|
1450
1495
|
"data-testid": `kebab-action-menu-${a.tileId}`,
|
|
1451
|
-
size: x(
|
|
1496
|
+
size: x($t)
|
|
1452
1497
|
}, null, 8, ["color", "data-testid", "size"])
|
|
1453
1498
|
]),
|
|
1454
1499
|
_: 1
|
|
1455
|
-
}, 8, ["data-testid"])) :
|
|
1456
|
-
], 8,
|
|
1500
|
+
}, 8, ["data-testid"])) : V("", !0)
|
|
1501
|
+
], 8, Fs)) : "description" in a.definition.chart ? (C(), W("div", {
|
|
1457
1502
|
key: 2,
|
|
1458
1503
|
class: "header-description",
|
|
1459
1504
|
"data-testid": `tile-description-${a.tileId}`
|
|
1460
|
-
},
|
|
1461
|
-
|
|
1505
|
+
}, ee(a.definition.chart.description), 9, Ws)) : V("", !0),
|
|
1506
|
+
y.value ? (C(), I(x(Pi), {
|
|
1462
1507
|
key: 3,
|
|
1463
1508
|
"data-testid": `csv-export-modal-${a.tileId}`,
|
|
1464
|
-
"export-state":
|
|
1465
|
-
filename:
|
|
1466
|
-
onCloseModal:
|
|
1467
|
-
}, null, 8, ["data-testid", "export-state", "filename"])) :
|
|
1468
|
-
])) :
|
|
1469
|
-
|
|
1470
|
-
class:
|
|
1509
|
+
"export-state": p.value,
|
|
1510
|
+
filename: O.value,
|
|
1511
|
+
onCloseModal: yi
|
|
1512
|
+
}, null, 8, ["data-testid", "export-state", "filename"])) : V("", !0)
|
|
1513
|
+
])) : V("", !0),
|
|
1514
|
+
X("div", {
|
|
1515
|
+
class: ze(["tile-content", `type-${a.definition.chart.type}`]),
|
|
1471
1516
|
"data-testid": `tile-content-${a.tileId}`
|
|
1472
1517
|
}, [
|
|
1473
|
-
|
|
1474
|
-
], 10,
|
|
1475
|
-
], 10,
|
|
1518
|
+
xe.value ? (C(), I(Qt(xe.value.component), Wt({ key: 0 }, xe.value.rendererProps, Ni(Fe.value), { onChartData: pi }), null, 16)) : V("", !0)
|
|
1519
|
+
], 10, Ks)
|
|
1520
|
+
], 10, Ms);
|
|
1476
1521
|
};
|
|
1477
1522
|
}
|
|
1478
|
-
}),
|
|
1523
|
+
}), li = /* @__PURE__ */ be(Vs, [["__scopeId", "data-v-0b9bb668"]]), Qs = (a, e) => {
|
|
1479
1524
|
let t = 0;
|
|
1480
1525
|
const i = /* @__PURE__ */ new Map();
|
|
1481
1526
|
e.forEach((r) => {
|
|
@@ -1486,13 +1531,13 @@ const ue = {
|
|
|
1486
1531
|
for (let r = 0; r < t; r++)
|
|
1487
1532
|
i.get(r) ? s.push("auto") : s.push(`${a}px`);
|
|
1488
1533
|
return s;
|
|
1489
|
-
},
|
|
1534
|
+
}, Ys = /* @__PURE__ */ Z({
|
|
1490
1535
|
__name: "GridLayout",
|
|
1491
1536
|
props: {
|
|
1492
1537
|
tileHeight: {
|
|
1493
1538
|
type: Number,
|
|
1494
1539
|
required: !1,
|
|
1495
|
-
default: () =>
|
|
1540
|
+
default: () => Be
|
|
1496
1541
|
},
|
|
1497
1542
|
tiles: {
|
|
1498
1543
|
type: Array,
|
|
@@ -1500,21 +1545,21 @@ const ue = {
|
|
|
1500
1545
|
}
|
|
1501
1546
|
},
|
|
1502
1547
|
setup(a) {
|
|
1503
|
-
|
|
1504
|
-
v2a38e79e: x(
|
|
1548
|
+
ct((n) => ({
|
|
1549
|
+
v2a38e79e: x(mt),
|
|
1505
1550
|
v4cc71de6: r.value
|
|
1506
1551
|
}));
|
|
1507
|
-
const e = a, t =
|
|
1552
|
+
const e = a, t = M(null), i = M(0), s = new ResizeObserver((n) => {
|
|
1508
1553
|
window.requestAnimationFrame(() => {
|
|
1509
1554
|
!Array.isArray(n) || !n.length || (i.value = n[0].contentRect.width);
|
|
1510
1555
|
});
|
|
1511
1556
|
});
|
|
1512
|
-
|
|
1557
|
+
et(() => {
|
|
1513
1558
|
t.value && s.observe(t.value);
|
|
1514
|
-
}),
|
|
1559
|
+
}), tt(() => {
|
|
1515
1560
|
t.value && s.unobserve(t.value);
|
|
1516
1561
|
});
|
|
1517
|
-
const r =
|
|
1562
|
+
const r = R(() => Qs(e.tileHeight, e.tiles).join(" ")), o = R(() => e.tiles.map((n, d) => ({
|
|
1518
1563
|
key: `tile-${d}`,
|
|
1519
1564
|
tile: n,
|
|
1520
1565
|
style: {
|
|
@@ -1524,27 +1569,27 @@ const ue = {
|
|
|
1524
1569
|
"grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
|
|
1525
1570
|
}
|
|
1526
1571
|
})));
|
|
1527
|
-
return (n, d) => (C(),
|
|
1572
|
+
return (n, d) => (C(), W("div", {
|
|
1528
1573
|
ref_key: "gridContainer",
|
|
1529
1574
|
ref: t,
|
|
1530
1575
|
class: "kong-ui-public-grid-layout"
|
|
1531
1576
|
}, [
|
|
1532
|
-
(C(!0),
|
|
1533
|
-
key:
|
|
1534
|
-
class:
|
|
1535
|
-
"empty-cell": !
|
|
1577
|
+
(C(!0), W(Yt, null, jt(o.value, (h) => (C(), W("div", {
|
|
1578
|
+
key: h.key,
|
|
1579
|
+
class: ze(["grid-cell", {
|
|
1580
|
+
"empty-cell": !h.tile
|
|
1536
1581
|
}]),
|
|
1537
|
-
style:
|
|
1582
|
+
style: at(h.style)
|
|
1538
1583
|
}, [
|
|
1539
1584
|
Ae(n.$slots, "tile", {
|
|
1540
|
-
style:
|
|
1541
|
-
tile:
|
|
1585
|
+
style: at(h.style),
|
|
1586
|
+
tile: h.tile
|
|
1542
1587
|
}, void 0, !0)
|
|
1543
1588
|
], 6))), 128))
|
|
1544
1589
|
], 512));
|
|
1545
1590
|
}
|
|
1546
|
-
}),
|
|
1547
|
-
function
|
|
1591
|
+
}), js = /* @__PURE__ */ be(Ys, [["__scopeId", "data-v-354b7177"]]);
|
|
1592
|
+
function Xs(a, e, t, i, s) {
|
|
1548
1593
|
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(a, o));
|
|
1549
1594
|
return r.prototype = e.prototype, r;
|
|
1550
1595
|
}
|
|
@@ -1753,8 +1798,8 @@ class c {
|
|
|
1753
1798
|
if (s.top < 0 || s.bottom > r) {
|
|
1754
1799
|
const o = s.bottom - r, n = s.top, d = this.getScrollElement(e);
|
|
1755
1800
|
if (d !== null) {
|
|
1756
|
-
const
|
|
1757
|
-
s.top < 0 && i < 0 ? e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += Math.abs(n) > Math.abs(i) ? i : n : i > 0 && (e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += o > i ? i : o), t.top += d.scrollTop -
|
|
1801
|
+
const h = d.scrollTop;
|
|
1802
|
+
s.top < 0 && i < 0 ? e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += Math.abs(n) > Math.abs(i) ? i : n : i > 0 && (e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += o > i ? i : o), t.top += d.scrollTop - h;
|
|
1758
1803
|
}
|
|
1759
1804
|
}
|
|
1760
1805
|
}
|
|
@@ -1766,8 +1811,8 @@ class c {
|
|
|
1766
1811
|
* @param distance Distance from the V edges to start scrolling
|
|
1767
1812
|
*/
|
|
1768
1813
|
static updateScrollResize(e, t, i) {
|
|
1769
|
-
const s = this.getScrollElement(t), r = s.clientHeight, o = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - o, d = n < i,
|
|
1770
|
-
d ? s.scrollBy({ behavior: "smooth", top: n - i }) :
|
|
1814
|
+
const s = this.getScrollElement(t), r = s.clientHeight, o = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - o, d = n < i, h = n > r - i;
|
|
1815
|
+
d ? s.scrollBy({ behavior: "smooth", top: n - i }) : h && s.scrollBy({ behavior: "smooth", top: i - (r - n) });
|
|
1771
1816
|
}
|
|
1772
1817
|
/** single level clone, returning a new object with same top fields. This will share sub objects and arrays */
|
|
1773
1818
|
static clone(e) {
|
|
@@ -1884,7 +1929,7 @@ class c {
|
|
|
1884
1929
|
return !(!e || e.w === e.h || e.locked || e.noResize || (t = e.grid) != null && t.opts.disableResize || e.minW && e.minW === e.maxW || e.minH && e.minH === e.maxH);
|
|
1885
1930
|
}
|
|
1886
1931
|
}
|
|
1887
|
-
class
|
|
1932
|
+
class de {
|
|
1888
1933
|
constructor(e = {}) {
|
|
1889
1934
|
this.addedNodes = [], this.removedNodes = [], this.defaultColumn = 12, this.column = e.column || this.defaultColumn, this.column > this.defaultColumn && (this.defaultColumn = this.column), this.maxRow = e.maxRow, this._float = e.float, this.nodes = e.nodes || [], this.onChange = e.onChange;
|
|
1890
1935
|
}
|
|
@@ -1910,15 +1955,15 @@ class ce {
|
|
|
1910
1955
|
for (; i = i || this.collide(e, r, s.skip); ) {
|
|
1911
1956
|
if (d++ > this.nodes.length * 2)
|
|
1912
1957
|
throw new Error("Infinite collide check");
|
|
1913
|
-
let
|
|
1958
|
+
let h;
|
|
1914
1959
|
if (i.locked || this._loading || e._moving && !e._skipDown && t.y > e.y && !this.float && // can take space we had, or before where we're going
|
|
1915
1960
|
(!this.collide(i, { ...i, y: e.y }, e) || !this.collide(i, { ...i, y: t.y - i.h }, e))) {
|
|
1916
1961
|
e._skipDown = e._skipDown || t.y > e.y;
|
|
1917
|
-
const
|
|
1918
|
-
|
|
1962
|
+
const u = { ...t, y: i.y + i.h, ...n };
|
|
1963
|
+
h = this._loading && c.samePos(e, u) ? !0 : this.moveNode(e, u), (i.locked || this._loading) && h ? c.copyPos(t, e) : !i.locked && h && s.pack && (this._packNodes(), t.y = i.y + i.h, c.copyPos(e, t)), o = o || h;
|
|
1919
1964
|
} else
|
|
1920
|
-
|
|
1921
|
-
if (!
|
|
1965
|
+
h = this.moveNode(i, { ...i, y: t.y + t.h, skip: e, ...n });
|
|
1966
|
+
if (!h)
|
|
1922
1967
|
return o;
|
|
1923
1968
|
i = void 0;
|
|
1924
1969
|
}
|
|
@@ -1943,10 +1988,10 @@ class ce {
|
|
|
1943
1988
|
for (let d of i) {
|
|
1944
1989
|
if (d.locked || !d._rect)
|
|
1945
1990
|
break;
|
|
1946
|
-
const
|
|
1947
|
-
let
|
|
1948
|
-
s.y <
|
|
1949
|
-
const f = Math.min(l,
|
|
1991
|
+
const h = d._rect;
|
|
1992
|
+
let u = Number.MAX_VALUE, l = Number.MAX_VALUE;
|
|
1993
|
+
s.y < h.y ? u = (r.y + r.h - h.y) / h.h : s.y + s.h > h.y + h.h && (u = (h.y + h.h - r.y) / h.h), s.x < h.x ? l = (r.x + r.w - h.x) / h.w : s.x + s.w > h.x + h.w && (l = (h.x + h.w - r.x) / h.w);
|
|
1994
|
+
const f = Math.min(l, u);
|
|
1950
1995
|
f > n && (n = f, o = d);
|
|
1951
1996
|
}
|
|
1952
1997
|
return t.collide = o, o;
|
|
@@ -2022,8 +2067,8 @@ class ce {
|
|
|
2022
2067
|
s || (this._inColumnResize = !0);
|
|
2023
2068
|
const r = this.nodes;
|
|
2024
2069
|
return this.nodes = [], r.forEach((o, n, d) => {
|
|
2025
|
-
let
|
|
2026
|
-
o.locked || (o.autoPosition = !0, e === "list" && n && (
|
|
2070
|
+
let h;
|
|
2071
|
+
o.locked || (o.autoPosition = !0, e === "list" && n && (h = d[n - 1])), this.addNode(o, !1, h);
|
|
2027
2072
|
}), s || delete this._inColumnResize, i || this.batchUpdate(!1), this;
|
|
2028
2073
|
}
|
|
2029
2074
|
/** enable/disable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html) */
|
|
@@ -2062,7 +2107,7 @@ class ce {
|
|
|
2062
2107
|
* @param resizing if out of bound, resize down or move into the grid to fit ?
|
|
2063
2108
|
*/
|
|
2064
2109
|
prepareNode(e, t) {
|
|
2065
|
-
e._id = e._id ??
|
|
2110
|
+
e._id = e._id ?? de._idSeq++;
|
|
2066
2111
|
const i = e.id;
|
|
2067
2112
|
if (i) {
|
|
2068
2113
|
let r = 1;
|
|
@@ -2121,11 +2166,11 @@ class ce {
|
|
|
2121
2166
|
const r = s ? s.y * i + (s.x + s.w) : 0;
|
|
2122
2167
|
let o = !1;
|
|
2123
2168
|
for (let n = r; !o; ++n) {
|
|
2124
|
-
const d = n % i,
|
|
2169
|
+
const d = n % i, h = Math.floor(n / i);
|
|
2125
2170
|
if (d + e.w > i)
|
|
2126
2171
|
continue;
|
|
2127
|
-
const
|
|
2128
|
-
t.find((l) => c.isIntercepted(
|
|
2172
|
+
const u = { x: d, y: h, w: e.w, h: e.h };
|
|
2173
|
+
t.find((l) => c.isIntercepted(u, l)) || ((e.x !== d || e.y !== h) && (e._dirty = !0), e.x = d, e.y = h, delete e.autoPosition, o = !0);
|
|
2129
2174
|
}
|
|
2130
2175
|
return o;
|
|
2131
2176
|
}
|
|
@@ -2157,7 +2202,7 @@ class ce {
|
|
|
2157
2202
|
if (t.pack = !0, !this.maxRow)
|
|
2158
2203
|
return this.moveNode(e, t);
|
|
2159
2204
|
let i;
|
|
2160
|
-
const s = new
|
|
2205
|
+
const s = new de({
|
|
2161
2206
|
column: this.column,
|
|
2162
2207
|
float: this.float,
|
|
2163
2208
|
nodes: this.nodes.map((o) => o._id === e._id ? (i = { ...o }, i) : { ...o })
|
|
@@ -2179,7 +2224,7 @@ class ce {
|
|
|
2179
2224
|
willItFit(e) {
|
|
2180
2225
|
if (delete e._willFitPos, !this.maxRow)
|
|
2181
2226
|
return !0;
|
|
2182
|
-
const t = new
|
|
2227
|
+
const t = new de({
|
|
2183
2228
|
column: this.column,
|
|
2184
2229
|
float: this.float,
|
|
2185
2230
|
nodes: this.nodes.map((s) => ({ ...s }))
|
|
@@ -2192,7 +2237,7 @@ class ce {
|
|
|
2192
2237
|
}
|
|
2193
2238
|
/** return true if the passed in node was actually moved (checks for no-op and locked) */
|
|
2194
2239
|
moveNode(e, t) {
|
|
2195
|
-
var
|
|
2240
|
+
var h, u;
|
|
2196
2241
|
if (!e || /*node.locked ||*/
|
|
2197
2242
|
!t)
|
|
2198
2243
|
return !1;
|
|
@@ -2206,9 +2251,9 @@ class ce {
|
|
|
2206
2251
|
if (n.length) {
|
|
2207
2252
|
const l = e._moving && !t.nested;
|
|
2208
2253
|
let f = l ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
2209
|
-
if (l && f && ((
|
|
2210
|
-
const
|
|
2211
|
-
|
|
2254
|
+
if (l && f && ((u = (h = e.grid) == null ? void 0 : h.opts) != null && u.subGridDynamic) && !e.grid._isTemp) {
|
|
2255
|
+
const g = c.areaIntercept(t.rect, f._rect), p = c.area(t.rect), y = c.area(f._rect);
|
|
2256
|
+
g / (p < y ? p : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
|
|
2212
2257
|
}
|
|
2213
2258
|
f ? d = !this._fixCollisions(e, r, f, t) : (d = !1, i && delete t.pack);
|
|
2214
2259
|
}
|
|
@@ -2230,8 +2275,8 @@ class ce {
|
|
|
2230
2275
|
var o;
|
|
2231
2276
|
const i = (o = this._layouts) == null ? void 0 : o.length, s = i && this.column !== i - 1 ? this._layouts[i - 1] : null, r = [];
|
|
2232
2277
|
return this.sortNodes(), this.nodes.forEach((n) => {
|
|
2233
|
-
const d = s == null ? void 0 : s.find((
|
|
2234
|
-
c.removeInternalForSave(
|
|
2278
|
+
const d = s == null ? void 0 : s.find((u) => u._id === n._id), h = { ...n, ...d || {} };
|
|
2279
|
+
c.removeInternalForSave(h, !e), t && t(n, h), r.push(h);
|
|
2235
2280
|
}), r;
|
|
2236
2281
|
}
|
|
2237
2282
|
/** @internal called whenever a node is added or moved - updates the cached layouts */
|
|
@@ -2270,19 +2315,19 @@ class ce {
|
|
|
2270
2315
|
s && this.sortNodes(1), t < e && this.cacheLayout(this.nodes, e), this.batchUpdate();
|
|
2271
2316
|
let r = [], o = s ? this.nodes : c.sort(this.nodes, -1);
|
|
2272
2317
|
if (t > e && this._layouts) {
|
|
2273
|
-
const d = this._layouts[t] || [],
|
|
2274
|
-
!d.length && e !==
|
|
2275
|
-
const l = o.find((f) => f._id ===
|
|
2276
|
-
l && (!s && !
|
|
2277
|
-
})), d.forEach((
|
|
2278
|
-
const l = o.findIndex((f) => f._id ===
|
|
2318
|
+
const d = this._layouts[t] || [], h = this._layouts.length - 1;
|
|
2319
|
+
!d.length && e !== h && ((n = this._layouts[h]) != null && n.length) && (e = h, this._layouts[h].forEach((u) => {
|
|
2320
|
+
const l = o.find((f) => f._id === u._id);
|
|
2321
|
+
l && (!s && !u.autoPosition && (l.x = u.x ?? l.x, l.y = u.y ?? l.y), l.w = u.w ?? l.w, (u.x == null || u.y === void 0) && (l.autoPosition = !0));
|
|
2322
|
+
})), d.forEach((u) => {
|
|
2323
|
+
const l = o.findIndex((f) => f._id === u._id);
|
|
2279
2324
|
if (l !== -1) {
|
|
2280
2325
|
const f = o[l];
|
|
2281
2326
|
if (s) {
|
|
2282
|
-
f.w =
|
|
2327
|
+
f.w = u.w;
|
|
2283
2328
|
return;
|
|
2284
2329
|
}
|
|
2285
|
-
(
|
|
2330
|
+
(u.autoPosition || isNaN(u.x) || isNaN(u.y)) && this.findEmptyPosition(u, r), u.autoPosition || (f.x = u.x ?? f.x, f.y = u.y ?? f.y, f.w = u.w ?? f.w, r.push(f)), o.splice(l, 1);
|
|
2286
2331
|
}
|
|
2287
2332
|
});
|
|
2288
2333
|
}
|
|
@@ -2293,9 +2338,9 @@ class ce {
|
|
|
2293
2338
|
if (typeof i == "function")
|
|
2294
2339
|
i(t, e, r, o);
|
|
2295
2340
|
else {
|
|
2296
|
-
const d = s || i === "none" ? 1 : t / e,
|
|
2341
|
+
const d = s || i === "none" ? 1 : t / e, h = i === "move" || i === "moveScale", u = i === "scale" || i === "moveScale";
|
|
2297
2342
|
o.forEach((l) => {
|
|
2298
|
-
l.x = t === 1 ? 0 :
|
|
2343
|
+
l.x = t === 1 ? 0 : h ? Math.round(l.x * d) : Math.min(l.x, t - 1), l.w = t === 1 || e === 1 ? 1 : u ? Math.round(l.w * d) || 1 : Math.min(l.w, t), r.push(l);
|
|
2299
2344
|
}), o = [];
|
|
2300
2345
|
}
|
|
2301
2346
|
r = c.sort(r, -1), this._inColumnResize = !0, this.nodes = [], r.forEach((d) => {
|
|
@@ -2315,7 +2360,7 @@ class ce {
|
|
|
2315
2360
|
return e.forEach((r, o) => {
|
|
2316
2361
|
if (r._id === void 0) {
|
|
2317
2362
|
const n = r.id ? this.nodes.find((d) => d.id === r.id) : void 0;
|
|
2318
|
-
r._id = (n == null ? void 0 : n._id) ??
|
|
2363
|
+
r._id = (n == null ? void 0 : n._id) ?? de._idSeq++;
|
|
2319
2364
|
}
|
|
2320
2365
|
s[o] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
2321
2366
|
}), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
|
|
@@ -2326,7 +2371,7 @@ class ce {
|
|
|
2326
2371
|
* @param column corresponding column index to save it under
|
|
2327
2372
|
*/
|
|
2328
2373
|
cacheOneLayout(e, t) {
|
|
2329
|
-
e._id = e._id ??
|
|
2374
|
+
e._id = e._id ?? de._idSeq++;
|
|
2330
2375
|
const i = { x: e.x, y: e.y, w: e.w, _id: e._id };
|
|
2331
2376
|
(e.autoPosition || e.x === void 0) && (delete i.x, delete i.y, e.autoPosition && (i.autoPosition = !0)), this._layouts = this._layouts || [], this._layouts[t] = this._layouts[t] || [];
|
|
2332
2377
|
const s = this.findCacheLayout(e, t);
|
|
@@ -2350,8 +2395,8 @@ class ce {
|
|
|
2350
2395
|
return this;
|
|
2351
2396
|
}
|
|
2352
2397
|
}
|
|
2353
|
-
|
|
2354
|
-
const
|
|
2398
|
+
de._idSeq = 0;
|
|
2399
|
+
const J = {
|
|
2355
2400
|
alwaysShowResizeHandle: "mobile",
|
|
2356
2401
|
animate: !0,
|
|
2357
2402
|
auto: !0,
|
|
@@ -2383,55 +2428,55 @@ const te = {
|
|
|
2383
2428
|
};
|
|
2384
2429
|
class E {
|
|
2385
2430
|
}
|
|
2386
|
-
const
|
|
2387
|
-
class
|
|
2431
|
+
const ae = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2432
|
+
class ce {
|
|
2388
2433
|
}
|
|
2389
2434
|
function Qe(a, e) {
|
|
2390
2435
|
a.touches.length > 1 || (a.cancelable && a.preventDefault(), c.simulateMouseEvent(a.changedTouches[0], e));
|
|
2391
2436
|
}
|
|
2392
|
-
function
|
|
2437
|
+
function hi(a, e) {
|
|
2393
2438
|
a.cancelable && a.preventDefault(), c.simulateMouseEvent(a, e);
|
|
2394
2439
|
}
|
|
2395
|
-
function Ve(a) {
|
|
2396
|
-
fe.touchHandled || (fe.touchHandled = !0, Qe(a, "mousedown"));
|
|
2397
|
-
}
|
|
2398
2440
|
function Ye(a) {
|
|
2399
|
-
|
|
2441
|
+
ce.touchHandled || (ce.touchHandled = !0, Qe(a, "mousedown"));
|
|
2442
|
+
}
|
|
2443
|
+
function je(a) {
|
|
2444
|
+
ce.touchHandled && Qe(a, "mousemove");
|
|
2400
2445
|
}
|
|
2401
2446
|
function Xe(a) {
|
|
2402
|
-
if (!
|
|
2447
|
+
if (!ce.touchHandled)
|
|
2403
2448
|
return;
|
|
2404
|
-
|
|
2449
|
+
ce.pointerLeaveTimeout && (window.clearTimeout(ce.pointerLeaveTimeout), delete ce.pointerLeaveTimeout);
|
|
2405
2450
|
const e = !!E.dragElement;
|
|
2406
|
-
Qe(a, "mouseup"), e || Qe(a, "click"),
|
|
2451
|
+
Qe(a, "mouseup"), e || Qe(a, "click"), ce.touchHandled = !1;
|
|
2407
2452
|
}
|
|
2408
|
-
function
|
|
2453
|
+
function Ze(a) {
|
|
2409
2454
|
a.pointerType !== "mouse" && a.target.releasePointerCapture(a.pointerId);
|
|
2410
2455
|
}
|
|
2411
|
-
function
|
|
2412
|
-
E.dragElement && a.pointerType !== "mouse" &&
|
|
2456
|
+
function Ft(a) {
|
|
2457
|
+
E.dragElement && a.pointerType !== "mouse" && hi(a, "mouseenter");
|
|
2413
2458
|
}
|
|
2414
|
-
function
|
|
2415
|
-
E.dragElement && a.pointerType !== "mouse" && (
|
|
2416
|
-
delete
|
|
2459
|
+
function Ut(a) {
|
|
2460
|
+
E.dragElement && a.pointerType !== "mouse" && (ce.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2461
|
+
delete ce.pointerLeaveTimeout, hi(a, "mouseleave");
|
|
2417
2462
|
}, 10));
|
|
2418
2463
|
}
|
|
2419
|
-
class
|
|
2464
|
+
class st {
|
|
2420
2465
|
constructor(e, t, i) {
|
|
2421
2466
|
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();
|
|
2422
2467
|
}
|
|
2423
2468
|
/** @internal */
|
|
2424
2469
|
_init() {
|
|
2425
2470
|
const e = this.el = document.createElement("div");
|
|
2426
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${
|
|
2471
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${st.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), ae && (this.el.addEventListener("touchstart", Ye), this.el.addEventListener("pointerdown", Ze)), this;
|
|
2427
2472
|
}
|
|
2428
2473
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2429
2474
|
destroy() {
|
|
2430
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
2475
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), ae && (this.el.removeEventListener("touchstart", Ye), this.el.removeEventListener("pointerdown", Ze)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2431
2476
|
}
|
|
2432
2477
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2433
2478
|
_mouseDown(e) {
|
|
2434
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2479
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), ae && (this.el.addEventListener("touchmove", je), this.el.addEventListener("touchend", Xe)), e.stopPropagation(), e.preventDefault();
|
|
2435
2480
|
}
|
|
2436
2481
|
/** @internal */
|
|
2437
2482
|
_mouseMove(e) {
|
|
@@ -2440,7 +2485,7 @@ class it {
|
|
|
2440
2485
|
}
|
|
2441
2486
|
/** @internal */
|
|
2442
2487
|
_mouseUp(e) {
|
|
2443
|
-
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2488
|
+
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ae && (this.el.removeEventListener("touchmove", je), this.el.removeEventListener("touchend", Xe)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2444
2489
|
}
|
|
2445
2490
|
/** @internal call when keys are being pressed - use Esc to cancel */
|
|
2446
2491
|
_keyEvent(e) {
|
|
@@ -2452,8 +2497,8 @@ class it {
|
|
|
2452
2497
|
return this.option[e] && this.option[e](t), this;
|
|
2453
2498
|
}
|
|
2454
2499
|
}
|
|
2455
|
-
|
|
2456
|
-
class
|
|
2500
|
+
st.prefix = "ui-resizable-";
|
|
2501
|
+
class vt {
|
|
2457
2502
|
constructor() {
|
|
2458
2503
|
this._eventRegister = {};
|
|
2459
2504
|
}
|
|
@@ -2481,7 +2526,7 @@ class mt {
|
|
|
2481
2526
|
return this._eventRegister[e](t);
|
|
2482
2527
|
}
|
|
2483
2528
|
}
|
|
2484
|
-
class
|
|
2529
|
+
class Oe extends vt {
|
|
2485
2530
|
// have to be public else complains for HTMLElementExtendOpt ?
|
|
2486
2531
|
constructor(e, t = {}) {
|
|
2487
2532
|
super(), this.el = e, this.option = t, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
@@ -2551,7 +2596,7 @@ class He extends mt {
|
|
|
2551
2596
|
}
|
|
2552
2597
|
/** @internal */
|
|
2553
2598
|
_setupHandlers() {
|
|
2554
|
-
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new
|
|
2599
|
+
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new st(this.el, e, {
|
|
2555
2600
|
start: (t) => {
|
|
2556
2601
|
this._resizeStart(t);
|
|
2557
2602
|
},
|
|
@@ -2582,7 +2627,7 @@ class He extends mt {
|
|
|
2582
2627
|
}
|
|
2583
2628
|
/** @internal */
|
|
2584
2629
|
_setupHelper() {
|
|
2585
|
-
this.elOriginStyleVal =
|
|
2630
|
+
this.elOriginStyleVal = Oe._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
|
|
2586
2631
|
const e = this.el.parentElement, t = c.getValuesFromTransformedElement(e);
|
|
2587
2632
|
return this.rectScale = {
|
|
2588
2633
|
x: t.xScale,
|
|
@@ -2591,7 +2636,7 @@ class He extends mt {
|
|
|
2591
2636
|
}
|
|
2592
2637
|
/** @internal */
|
|
2593
2638
|
_cleanHelper() {
|
|
2594
|
-
return
|
|
2639
|
+
return Oe._originStyleProp.forEach((e, t) => {
|
|
2595
2640
|
this.el.style[e] = this.elOriginStyleVal[t] || null;
|
|
2596
2641
|
}), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
|
|
2597
2642
|
}
|
|
@@ -2605,13 +2650,13 @@ class He extends mt {
|
|
|
2605
2650
|
}, r = e.clientX - i.clientX, o = this.sizeToContent ? 0 : e.clientY - i.clientY;
|
|
2606
2651
|
let n, d;
|
|
2607
2652
|
t.indexOf("e") > -1 ? s.width += r : t.indexOf("w") > -1 && (s.width -= r, s.left += r, n = !0), t.indexOf("s") > -1 ? s.height += o : t.indexOf("n") > -1 && (s.height -= o, s.top += o, d = !0);
|
|
2608
|
-
const
|
|
2609
|
-
return Math.round(s.width) !== Math.round(
|
|
2653
|
+
const h = this._constrainSize(s.width, s.height, n, d);
|
|
2654
|
+
return Math.round(s.width) !== Math.round(h.width) && (t.indexOf("w") > -1 && (s.left += s.width - h.width), s.width = h.width), Math.round(s.height) !== Math.round(h.height) && (t.indexOf("n") > -1 && (s.top += s.height - h.height), s.height = h.height), s;
|
|
2610
2655
|
}
|
|
2611
2656
|
/** @internal constrain the size to the set min/max values */
|
|
2612
2657
|
_constrainSize(e, t, i, s) {
|
|
2613
|
-
const r = this.option, o = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, n = r.minWidth / this.rectScale.x || e, d = (s ? r.maxHeightMoveUp : r.maxHeight) || Number.MAX_SAFE_INTEGER,
|
|
2614
|
-
return { width:
|
|
2658
|
+
const r = this.option, o = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, n = r.minWidth / this.rectScale.x || e, d = (s ? r.maxHeightMoveUp : r.maxHeight) || Number.MAX_SAFE_INTEGER, h = r.minHeight / this.rectScale.y || t, u = Math.min(o, Math.max(n, e)), l = Math.min(d, Math.max(h, t));
|
|
2659
|
+
return { width: u, height: l };
|
|
2615
2660
|
}
|
|
2616
2661
|
/** @internal */
|
|
2617
2662
|
_applyChange() {
|
|
@@ -2630,9 +2675,9 @@ class He extends mt {
|
|
|
2630
2675
|
return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
|
|
2631
2676
|
}
|
|
2632
2677
|
}
|
|
2633
|
-
|
|
2634
|
-
const
|
|
2635
|
-
class
|
|
2678
|
+
Oe._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
2679
|
+
const Zs = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
2680
|
+
class He extends vt {
|
|
2636
2681
|
constructor(e, t = {}) {
|
|
2637
2682
|
var r;
|
|
2638
2683
|
super(), this.el = e, this.option = t, this.dragTransform = {
|
|
@@ -2652,12 +2697,12 @@ class Ie extends mt {
|
|
|
2652
2697
|
}
|
|
2653
2698
|
enable() {
|
|
2654
2699
|
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
|
|
2655
|
-
e.addEventListener("mousedown", this._mouseDown),
|
|
2700
|
+
e.addEventListener("mousedown", this._mouseDown), ae && (e.addEventListener("touchstart", Ye), e.addEventListener("pointerdown", Ze));
|
|
2656
2701
|
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
2657
2702
|
}
|
|
2658
2703
|
disable(e = !1) {
|
|
2659
2704
|
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((t) => {
|
|
2660
|
-
t.removeEventListener("mousedown", this._mouseDown),
|
|
2705
|
+
t.removeEventListener("mousedown", this._mouseDown), ae && (t.removeEventListener("touchstart", Ye), t.removeEventListener("pointerdown", Ze));
|
|
2661
2706
|
}), e || this.el.classList.add("ui-draggable-disabled"));
|
|
2662
2707
|
}
|
|
2663
2708
|
destroy() {
|
|
@@ -2669,7 +2714,7 @@ class Ie extends mt {
|
|
|
2669
2714
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
2670
2715
|
_mouseDown(e) {
|
|
2671
2716
|
if (!E.mouseHandled)
|
|
2672
|
-
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(
|
|
2717
|
+
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Zs) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete E.dragElement, delete E.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), ae && (e.currentTarget.addEventListener("touchmove", je), e.currentTarget.addEventListener("touchend", Xe)), e.preventDefault(), document.activeElement && document.activeElement.blur(), E.mouseHandled = !0), !0;
|
|
2673
2718
|
}
|
|
2674
2719
|
/** @internal method to call actual drag event */
|
|
2675
2720
|
_callDrag(e) {
|
|
@@ -2700,7 +2745,7 @@ class Ie extends mt {
|
|
|
2700
2745
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
2701
2746
|
_mouseUp(e) {
|
|
2702
2747
|
var t, i;
|
|
2703
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2748
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ae && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", je, !0), e.currentTarget.removeEventListener("touchend", Xe, !0)), this.dragging) {
|
|
2704
2749
|
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = E.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete E.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
2705
2750
|
const s = c.initEvent(e, { target: this.el, type: "dragstop" });
|
|
2706
2751
|
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), E.dropElement && E.dropElement.drop(e);
|
|
@@ -2722,7 +2767,7 @@ class Ie extends mt {
|
|
|
2722
2767
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
2723
2768
|
_createHelper() {
|
|
2724
2769
|
let e = this.el;
|
|
2725
|
-
return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), e.parentElement || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle =
|
|
2770
|
+
return typeof this.option.helper == "function" ? e = this.option.helper(this.el) : this.option.helper === "clone" && (e = c.cloneNode(this.el)), e.parentElement || c.appendTo(e, this.option.appendTo === "parent" ? this.el.parentElement : this.option.appendTo), this.dragElementOriginStyle = He.originStyleProp.map((t) => this.el.style[t]), e;
|
|
2726
2771
|
}
|
|
2727
2772
|
/** @internal set the fix position of the dragged item */
|
|
2728
2773
|
_setupHelperStyle(e) {
|
|
@@ -2739,7 +2784,7 @@ class Ie extends mt {
|
|
|
2739
2784
|
const e = (t = this.helper) == null ? void 0 : t.gridstackNode;
|
|
2740
2785
|
if (!(e != null && e._isAboutToRemove) && this.dragElementOriginStyle) {
|
|
2741
2786
|
const i = this.helper, s = this.dragElementOriginStyle.transition || null;
|
|
2742
|
-
i.style.transition = this.dragElementOriginStyle.transition = "none",
|
|
2787
|
+
i.style.transition = this.dragElementOriginStyle.transition = "none", He.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
|
|
2743
2788
|
}
|
|
2744
2789
|
return delete this.dragElementOriginStyle, this;
|
|
2745
2790
|
}
|
|
@@ -2781,8 +2826,8 @@ class Ie extends mt {
|
|
|
2781
2826
|
};
|
|
2782
2827
|
}
|
|
2783
2828
|
}
|
|
2784
|
-
|
|
2785
|
-
class
|
|
2829
|
+
He.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
2830
|
+
class Js extends vt {
|
|
2786
2831
|
constructor(e, t = {}) {
|
|
2787
2832
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
2788
2833
|
}
|
|
@@ -2793,10 +2838,10 @@ class Gs extends mt {
|
|
|
2793
2838
|
super.off(e);
|
|
2794
2839
|
}
|
|
2795
2840
|
enable() {
|
|
2796
|
-
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),
|
|
2841
|
+
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), ae && (this.el.addEventListener("pointerenter", Ft), this.el.addEventListener("pointerleave", Ut)));
|
|
2797
2842
|
}
|
|
2798
2843
|
disable(e = !1) {
|
|
2799
|
-
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),
|
|
2844
|
+
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), ae && (this.el.removeEventListener("pointerenter", Ft), this.el.removeEventListener("pointerleave", Ut)));
|
|
2800
2845
|
}
|
|
2801
2846
|
destroy() {
|
|
2802
2847
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -2848,9 +2893,9 @@ class Gs extends mt {
|
|
|
2848
2893
|
};
|
|
2849
2894
|
}
|
|
2850
2895
|
}
|
|
2851
|
-
class
|
|
2896
|
+
class _t {
|
|
2852
2897
|
static init(e) {
|
|
2853
|
-
return e.ddElement || (e.ddElement = new
|
|
2898
|
+
return e.ddElement || (e.ddElement = new _t(e)), e.ddElement;
|
|
2854
2899
|
}
|
|
2855
2900
|
constructor(e) {
|
|
2856
2901
|
this.el = e;
|
|
@@ -2862,25 +2907,25 @@ class pt {
|
|
|
2862
2907
|
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;
|
|
2863
2908
|
}
|
|
2864
2909
|
setupDraggable(e) {
|
|
2865
|
-
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new
|
|
2910
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new He(this.el, e), this;
|
|
2866
2911
|
}
|
|
2867
2912
|
cleanDraggable() {
|
|
2868
2913
|
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
2869
2914
|
}
|
|
2870
2915
|
setupResizable(e) {
|
|
2871
|
-
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new
|
|
2916
|
+
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new Oe(this.el, e), this;
|
|
2872
2917
|
}
|
|
2873
2918
|
cleanResizable() {
|
|
2874
2919
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
2875
2920
|
}
|
|
2876
2921
|
setupDroppable(e) {
|
|
2877
|
-
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new
|
|
2922
|
+
return this.ddDroppable ? this.ddDroppable.updateOption(e) : this.ddDroppable = new Js(this.el, e), this;
|
|
2878
2923
|
}
|
|
2879
2924
|
cleanDroppable() {
|
|
2880
2925
|
return this.ddDroppable && (this.ddDroppable.destroy(), delete this.ddDroppable), this;
|
|
2881
2926
|
}
|
|
2882
2927
|
}
|
|
2883
|
-
class
|
|
2928
|
+
class er {
|
|
2884
2929
|
resizable(e, t, i, s) {
|
|
2885
2930
|
return this._getDDElements(e, t).forEach((r) => {
|
|
2886
2931
|
if (t === "disable" || t === "enable")
|
|
@@ -2893,11 +2938,11 @@ class Ws {
|
|
|
2893
2938
|
const n = r.el.gridstackNode.grid;
|
|
2894
2939
|
let d = r.el.getAttribute("gs-resize-handles") || n.opts.resizable.handles || "e,s,se";
|
|
2895
2940
|
d === "all" && (d = "n,e,s,w,se,sw,ne,nw");
|
|
2896
|
-
const
|
|
2941
|
+
const h = !n.opts.alwaysShowResizeHandle;
|
|
2897
2942
|
r.setupResizable({
|
|
2898
2943
|
...n.opts.resizable,
|
|
2899
2944
|
handles: d,
|
|
2900
|
-
autoHide:
|
|
2945
|
+
autoHide: h,
|
|
2901
2946
|
start: t.start,
|
|
2902
2947
|
stop: t.stop,
|
|
2903
2948
|
resize: t.resize
|
|
@@ -2959,7 +3004,7 @@ class Ws {
|
|
|
2959
3004
|
/** @internal returns a list of DD elements, creating them on the fly by default unless option is to destroy or disable */
|
|
2960
3005
|
_getDDElements(e, t) {
|
|
2961
3006
|
const i = e.gridstack || t !== "destroy" && t !== "disable", s = c.getElements(e);
|
|
2962
|
-
return s.length ? s.map((o) => o.ddElement || (i ?
|
|
3007
|
+
return s.length ? s.map((o) => o.ddElement || (i ? _t.init(o) : null)).filter((o) => o) : [];
|
|
2963
3008
|
}
|
|
2964
3009
|
}
|
|
2965
3010
|
/*!
|
|
@@ -2969,7 +3014,7 @@ class Ws {
|
|
|
2969
3014
|
* Copyright (c) 2021-2024 Alain Dumesny
|
|
2970
3015
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
2971
3016
|
*/
|
|
2972
|
-
const
|
|
3017
|
+
const K = new er();
|
|
2973
3018
|
class b {
|
|
2974
3019
|
/**
|
|
2975
3020
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
@@ -3034,7 +3079,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3034
3079
|
/** @internal create placeholder DIV as needed */
|
|
3035
3080
|
get placeholder() {
|
|
3036
3081
|
if (!this._placeholder) {
|
|
3037
|
-
this._placeholder = c.createDiv([this.opts.placeholderClass,
|
|
3082
|
+
this._placeholder = c.createDiv([this.opts.placeholderClass, J.itemClass, this.opts.itemClass]);
|
|
3038
3083
|
const e = c.createDiv(["placeholder-content"], this._placeholder);
|
|
3039
3084
|
this.opts.placeholderText && (e.textContent = this.opts.placeholderText);
|
|
3040
3085
|
}
|
|
@@ -3046,7 +3091,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3046
3091
|
* @param opts grid options - public for classes to access, but use methods to modify!
|
|
3047
3092
|
*/
|
|
3048
3093
|
constructor(e, t = {}) {
|
|
3049
|
-
var l, f,
|
|
3094
|
+
var l, f, g;
|
|
3050
3095
|
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);
|
|
3051
3096
|
const i = c.toNumber(e.getAttribute("gs-row"));
|
|
3052
3097
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
@@ -3055,48 +3100,48 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3055
3100
|
if (r.oneColumnModeDomSort && (delete r.oneColumnModeDomSort, console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")), r.oneColumnSize || r.disableOneColumnMode === !1) {
|
|
3056
3101
|
const p = r.oneColumnSize || 768;
|
|
3057
3102
|
delete r.oneColumnSize, delete r.disableOneColumnMode, t.columnOpts = t.columnOpts || {}, s = t.columnOpts.breakpoints = t.columnOpts.breakpoints || [];
|
|
3058
|
-
let y = s.find((
|
|
3103
|
+
let y = s.find((m) => m.c === 1);
|
|
3059
3104
|
y ? y.w = p : (y = { c: 1, w: p }, s.push(y, { c: 12, w: p + 1 }));
|
|
3060
3105
|
}
|
|
3061
3106
|
const o = t.columnOpts;
|
|
3062
3107
|
o && (!o.columnWidth && !((f = o.breakpoints) != null && f.length) ? (delete t.columnOpts, s = void 0) : o.columnMax = o.columnMax || 12), (s == null ? void 0 : s.length) > 1 && s.sort((p, y) => (y.w || 0) - (p.w || 0));
|
|
3063
3108
|
const n = {
|
|
3064
|
-
...c.cloneDeep(
|
|
3065
|
-
column: c.toNumber(e.getAttribute("gs-column")) ||
|
|
3066
|
-
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) ||
|
|
3067
|
-
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) ||
|
|
3068
|
-
staticGrid: c.toBool(e.getAttribute("gs-static")) ||
|
|
3109
|
+
...c.cloneDeep(J),
|
|
3110
|
+
column: c.toNumber(e.getAttribute("gs-column")) || J.column,
|
|
3111
|
+
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) || J.minRow,
|
|
3112
|
+
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) || J.maxRow,
|
|
3113
|
+
staticGrid: c.toBool(e.getAttribute("gs-static")) || J.staticGrid,
|
|
3069
3114
|
sizeToContent: c.toBool(e.getAttribute("gs-size-to-content")) || void 0,
|
|
3070
3115
|
draggable: {
|
|
3071
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
3116
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || J.draggable.handle
|
|
3072
3117
|
},
|
|
3073
3118
|
removableOptions: {
|
|
3074
|
-
accept: t.itemClass ||
|
|
3075
|
-
decline:
|
|
3119
|
+
accept: t.itemClass || J.removableOptions.accept,
|
|
3120
|
+
decline: J.removableOptions.decline
|
|
3076
3121
|
}
|
|
3077
3122
|
};
|
|
3078
3123
|
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");
|
|
3079
|
-
const d = this.el.closest("." +
|
|
3080
|
-
|
|
3081
|
-
const
|
|
3082
|
-
if (this.engine = new
|
|
3124
|
+
const d = this.el.closest("." + J.itemClass), h = d == null ? void 0 : d.gridstackNode;
|
|
3125
|
+
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 !== J.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = ae), this._styleSheetClass = "gs-id-" + de._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
3126
|
+
const u = t.engineClass || b.engineClass || de;
|
|
3127
|
+
if (this.engine = new u({
|
|
3083
3128
|
column: this.getColumn(),
|
|
3084
3129
|
float: t.float,
|
|
3085
3130
|
maxRow: t.maxRow,
|
|
3086
3131
|
onChange: (p) => {
|
|
3087
3132
|
let y = 0;
|
|
3088
|
-
this.engine.nodes.forEach((
|
|
3089
|
-
y = Math.max(y,
|
|
3090
|
-
}), p.forEach((
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3133
|
+
this.engine.nodes.forEach((m) => {
|
|
3134
|
+
y = Math.max(y, m.y + m.h);
|
|
3135
|
+
}), p.forEach((m) => {
|
|
3136
|
+
const k = m.el;
|
|
3137
|
+
k && (m._removeDOM ? (k && k.remove(), delete m._removeDOM) : this._writePosAttr(k, m));
|
|
3093
3138
|
}), this._updateStyles(!1, y);
|
|
3094
3139
|
}
|
|
3095
3140
|
}), 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) {
|
|
3096
3141
|
const p = t.children;
|
|
3097
3142
|
delete t.children, p.length && this.load(p);
|
|
3098
3143
|
}
|
|
3099
|
-
this.setAnimation(), t.subGridDynamic && !E.pauseDrag && (E.pauseDrag = !0), ((
|
|
3144
|
+
this.setAnimation(), t.subGridDynamic && !E.pauseDrag && (E.pauseDrag = !0), ((g = t.draggable) == null ? void 0 : g.pause) !== void 0 && (E.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
3100
3145
|
}
|
|
3101
3146
|
/**
|
|
3102
3147
|
* add a new widget and returns it.
|
|
@@ -3147,9 +3192,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3147
3192
|
* @returns newly created grid
|
|
3148
3193
|
*/
|
|
3149
3194
|
makeSubGrid(e, t, i, s = !0) {
|
|
3150
|
-
var
|
|
3195
|
+
var g, p, y;
|
|
3151
3196
|
let r = e.gridstackNode;
|
|
3152
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
3197
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (g = r.subGrid) != null && g.el)
|
|
3153
3198
|
return r.subGrid;
|
|
3154
3199
|
let o, n = this;
|
|
3155
3200
|
for (; n && !o; )
|
|
@@ -3168,13 +3213,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3168
3213
|
}), r.subGridOpts = t;
|
|
3169
3214
|
let d;
|
|
3170
3215
|
t.column === "auto" && (d = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
|
|
3171
|
-
let
|
|
3172
|
-
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), b.addRemoveCB ?
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3216
|
+
let h = r.el.querySelector(".grid-stack-item-content"), u, l;
|
|
3217
|
+
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), b.addRemoveCB ? u = b.addRemoveCB(this.el, l, !0, !1) : (u = c.createDiv(["grid-stack-item"]), u.appendChild(h), h = c.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
|
|
3218
|
+
const m = d ? t.column : r.w, k = r.h + i.h, L = r.el.style;
|
|
3219
|
+
L.transition = "none", this.update(r.el, { w: m, h: k }), setTimeout(() => L.transition = null);
|
|
3175
3220
|
}
|
|
3176
|
-
const f = r.subGrid = b.addGrid(
|
|
3177
|
-
return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(
|
|
3221
|
+
const f = r.subGrid = b.addGrid(h, t);
|
|
3222
|
+
return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(u, l), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
|
|
3178
3223
|
}
|
|
3179
3224
|
/**
|
|
3180
3225
|
* called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
|
|
@@ -3212,7 +3257,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3212
3257
|
const r = c.cloneDeep(this.opts);
|
|
3213
3258
|
r.marginBottom === r.marginTop && r.marginRight === r.marginLeft && r.marginTop === r.marginRight && (r.margin = r.marginTop, delete r.marginTop, delete r.marginRight, delete r.marginBottom, delete r.marginLeft), r.rtl === (this.el.style.direction === "rtl") && (r.rtl = "auto"), this._isAutoCellHeight && (r.cellHeight = "auto"), this._autoColumn && (r.column = "auto");
|
|
3214
3259
|
const o = r._alwaysShowResizeHandle;
|
|
3215
|
-
return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r,
|
|
3260
|
+
return delete r._alwaysShowResizeHandle, o !== void 0 ? r.alwaysShowResizeHandle = o : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r, J), r.children = s, r;
|
|
3216
3261
|
}
|
|
3217
3262
|
return s;
|
|
3218
3263
|
}
|
|
@@ -3227,15 +3272,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3227
3272
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3228
3273
|
*/
|
|
3229
3274
|
load(e, t = b.addRemoveCB || !0) {
|
|
3230
|
-
var
|
|
3275
|
+
var h;
|
|
3231
3276
|
e = c.cloneDeep(e);
|
|
3232
3277
|
const i = this.getColumn();
|
|
3233
|
-
e.forEach((
|
|
3234
|
-
|
|
3278
|
+
e.forEach((u) => {
|
|
3279
|
+
u.w = u.w || 1, u.h = u.h || 1;
|
|
3235
3280
|
}), e = c.sort(e), this.engine.skipCacheUpdate = this._ignoreLayoutsNodeChange = !0;
|
|
3236
3281
|
let s = 0;
|
|
3237
|
-
e.forEach((
|
|
3238
|
-
s = Math.max(s, (
|
|
3282
|
+
e.forEach((u) => {
|
|
3283
|
+
s = Math.max(s, (u.x || 0) + u.w);
|
|
3239
3284
|
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
|
|
3240
3285
|
const r = b.addRemoveCB;
|
|
3241
3286
|
typeof t == "function" && (b.addRemoveCB = t);
|
|
@@ -3248,16 +3293,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3248
3293
|
c.find(e, l.id) || (b.addRemoveCB && b.addRemoveCB(this.el, l, !1, !1), o.push(l), this.removeWidget(l.el, !0, !1));
|
|
3249
3294
|
}), this.engine._loading = !0;
|
|
3250
3295
|
const d = [];
|
|
3251
|
-
return this.engine.nodes = this.engine.nodes.filter((
|
|
3296
|
+
return this.engine.nodes = this.engine.nodes.filter((u) => c.find(e, u.id) ? (d.push(u), !1) : !0), e.forEach((u) => {
|
|
3252
3297
|
var f;
|
|
3253
|
-
const l = c.find(d,
|
|
3298
|
+
const l = c.find(d, u.id);
|
|
3254
3299
|
if (l) {
|
|
3255
|
-
if (c.shouldSizeToContent(l) && (
|
|
3256
|
-
const
|
|
3257
|
-
|
|
3300
|
+
if (c.shouldSizeToContent(l) && (u.h = l.h), this.engine.nodeBoundFix(u), (u.autoPosition || u.x === void 0 || u.y === void 0) && (u.w = u.w || l.w, u.h = u.h || l.h, this.engine.findEmptyPosition(u)), this.engine.nodes.push(l), c.samePos(l, u) && this.engine.nodes.length > 1 && (this.moveNode(l, { ...u, forceCollide: !0 }), c.copyPos(u, l)), this.update(l.el, u), (f = u.subGridOpts) != null && f.children) {
|
|
3301
|
+
const g = l.el.querySelector(".grid-stack");
|
|
3302
|
+
g && g.gridstack && g.gridstack.load(u.subGridOpts.children);
|
|
3258
3303
|
}
|
|
3259
|
-
} else t && this.addWidget(
|
|
3260
|
-
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? b.addRemoveCB = r : delete b.addRemoveCB, n && ((
|
|
3304
|
+
} else t && this.addWidget(u);
|
|
3305
|
+
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? b.addRemoveCB = r : delete b.addRemoveCB, n && ((h = this.opts) != null && h.animate) && this.setAnimation(this.opts.animate, !0), this;
|
|
3261
3306
|
}
|
|
3262
3307
|
/**
|
|
3263
3308
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3538,7 +3583,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3538
3583
|
*/
|
|
3539
3584
|
update(e, t) {
|
|
3540
3585
|
return b.getElements(e).forEach((i) => {
|
|
3541
|
-
var
|
|
3586
|
+
var u;
|
|
3542
3587
|
const s = i == null ? void 0 : i.gridstackNode;
|
|
3543
3588
|
if (!s)
|
|
3544
3589
|
return;
|
|
@@ -3550,16 +3595,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3550
3595
|
n[l] = r[l] !== void 0 ? r[l] : s[l], delete r[l];
|
|
3551
3596
|
})), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
|
|
3552
3597
|
const l = i.querySelector(".grid-stack-item-content");
|
|
3553
|
-
l && l.textContent !== r.content && (s.content = r.content, b.renderCB(l, r), (
|
|
3598
|
+
l && l.textContent !== r.content && (s.content = r.content, b.renderCB(l, r), (u = s.subGrid) != null && u.el && (l.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
|
|
3554
3599
|
}
|
|
3555
|
-
let d = !1,
|
|
3600
|
+
let d = !1, h = !1;
|
|
3556
3601
|
for (const l in r)
|
|
3557
|
-
l[0] !== "_" && s[l] !== r[l] && (s[l] = r[l], d = !0,
|
|
3602
|
+
l[0] !== "_" && s[l] !== r[l] && (s[l] = r[l], d = !0, h = h || !this.opts.staticGrid && (l === "noResize" || l === "noMove" || l === "locked"));
|
|
3558
3603
|
if (c.sanitizeMinMax(s), n) {
|
|
3559
3604
|
const l = n.w !== void 0 && n.w !== s.w;
|
|
3560
3605
|
this.moveNode(s, n), l && s.subGrid ? s.subGrid.onResize(this.hasAnimationCSS() ? s.w : void 0) : this.resizeToContentCheck(l, s), delete s._orig;
|
|
3561
3606
|
}
|
|
3562
|
-
(n || d) && this._writeAttr(i, s),
|
|
3607
|
+
(n || d) && this._writeAttr(i, s), h && this.prepareDragDrop(s.el);
|
|
3563
3608
|
}), this;
|
|
3564
3609
|
}
|
|
3565
3610
|
moveNode(e, t) {
|
|
@@ -3573,7 +3618,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3573
3618
|
* @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
|
|
3574
3619
|
*/
|
|
3575
3620
|
resizeToContent(e) {
|
|
3576
|
-
var f,
|
|
3621
|
+
var f, g;
|
|
3577
3622
|
if (!e || (e.classList.remove("size-to-content-max"), !e.clientHeight))
|
|
3578
3623
|
return;
|
|
3579
3624
|
const t = e.gridstackNode;
|
|
@@ -3589,13 +3634,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3589
3634
|
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(b.resizeToContentParent)), !o)
|
|
3590
3635
|
return;
|
|
3591
3636
|
const n = e.clientHeight - o.clientHeight, d = t.h ? t.h * s - n : o.clientHeight;
|
|
3592
|
-
let
|
|
3637
|
+
let h;
|
|
3593
3638
|
if (t.subGrid) {
|
|
3594
|
-
|
|
3639
|
+
h = t.subGrid.getRow() * t.subGrid.getCellHeight(!0);
|
|
3595
3640
|
const p = t.subGrid.el.getBoundingClientRect(), y = t.subGrid.el.parentElement.getBoundingClientRect();
|
|
3596
|
-
|
|
3641
|
+
h += p.top - y.top;
|
|
3597
3642
|
} else {
|
|
3598
|
-
if ((
|
|
3643
|
+
if ((g = (f = t.subGridOpts) == null ? void 0 : f.children) != null && g.length)
|
|
3599
3644
|
return;
|
|
3600
3645
|
{
|
|
3601
3646
|
const p = o.firstElementChild;
|
|
@@ -3603,15 +3648,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3603
3648
|
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${b.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
3604
3649
|
return;
|
|
3605
3650
|
}
|
|
3606
|
-
|
|
3651
|
+
h = p.getBoundingClientRect().height || d;
|
|
3607
3652
|
}
|
|
3608
3653
|
}
|
|
3609
|
-
if (d ===
|
|
3654
|
+
if (d === h)
|
|
3610
3655
|
return;
|
|
3611
|
-
r +=
|
|
3612
|
-
let
|
|
3656
|
+
r += h - d;
|
|
3657
|
+
let u = Math.ceil(r / s);
|
|
3613
3658
|
const l = Number.isInteger(t.sizeToContent) ? t.sizeToContent : 0;
|
|
3614
|
-
l &&
|
|
3659
|
+
l && u > l && (u = l, e.classList.add("size-to-content-max")), t.minH && u < t.minH ? u = t.minH : t.maxH && u > t.maxH && (u = t.maxH), u !== t.h && (i._ignoreLayoutsNodeChange = !0, i.moveNode(t, { h: u }), delete i._ignoreLayoutsNodeChange);
|
|
3615
3660
|
}
|
|
3616
3661
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
3617
3662
|
resizeToContentCBCheck(e) {
|
|
@@ -3732,8 +3777,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3732
3777
|
}), !this._styles)
|
|
3733
3778
|
return this;
|
|
3734
3779
|
this._styles._max = 0, c.addCSSRule(this._styles, r, `height: ${i}${s}`);
|
|
3735
|
-
const n = this.opts.marginTop + this.opts.marginUnit, d = this.opts.marginBottom + this.opts.marginUnit,
|
|
3736
|
-
c.addCSSRule(this._styles, l, `top: ${n}; right: ${
|
|
3780
|
+
const n = this.opts.marginTop + this.opts.marginUnit, d = this.opts.marginBottom + this.opts.marginUnit, h = this.opts.marginRight + this.opts.marginUnit, u = this.opts.marginLeft + this.opts.marginUnit, l = `${r} > .grid-stack-item-content`, f = `.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;
|
|
3781
|
+
c.addCSSRule(this._styles, l, `top: ${n}; right: ${h}; bottom: ${d}; left: ${u};`), c.addCSSRule(this._styles, f, `top: ${n}; right: ${h}; bottom: ${d}; left: ${u};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-n`, `top: ${n};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-s`, `bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-ne`, `right: ${h}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${h}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${h}; bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${u}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${u}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${u}; bottom: ${d}`);
|
|
3737
3782
|
}
|
|
3738
3783
|
if (t = t || this._styles._max, t > this._styles._max) {
|
|
3739
3784
|
const o = (n) => i * n + s;
|
|
@@ -3763,7 +3808,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3763
3808
|
}
|
|
3764
3809
|
/** @internal */
|
|
3765
3810
|
_prepareElement(e, t = !1, i) {
|
|
3766
|
-
i = i || this._readAttr(e), e.gridstackNode = i, i.el = e, i.grid = this, i = this.engine.addNode(i, t), this._writeAttr(e, i), e.classList.add(
|
|
3811
|
+
i = i || this._readAttr(e), e.gridstackNode = i, i.el = e, i.grid = this, i = this.engine.addNode(i, t), this._writeAttr(e, i), e.classList.add(J.itemClass, this.opts.itemClass);
|
|
3767
3812
|
const s = c.shouldSizeToContent(i);
|
|
3768
3813
|
return s ? e.classList.add("size-to-content") : e.classList.remove("size-to-content"), s && this.resizeToContentCheck(!1, i), c.lazyLoad(i) || this.prepareDragDrop(i.el), this;
|
|
3769
3814
|
}
|
|
@@ -3869,7 +3914,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3869
3914
|
*/
|
|
3870
3915
|
/** get the global (but static to this code) DD implementation */
|
|
3871
3916
|
static getDD() {
|
|
3872
|
-
return
|
|
3917
|
+
return K;
|
|
3873
3918
|
}
|
|
3874
3919
|
/**
|
|
3875
3920
|
* call to setup dragging in from the outside (say toolbar), by specifying the class selection and options.
|
|
@@ -3882,7 +3927,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3882
3927
|
*/
|
|
3883
3928
|
static setupDragIn(e, t, i, s = document) {
|
|
3884
3929
|
(t == null ? void 0 : t.pause) !== void 0 && (E.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((o, n) => {
|
|
3885
|
-
|
|
3930
|
+
K.isDraggable(o) || K.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
|
|
3886
3931
|
});
|
|
3887
3932
|
}
|
|
3888
3933
|
/**
|
|
@@ -3961,12 +4006,12 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3961
4006
|
}
|
|
3962
4007
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
3963
4008
|
_removeDD(e) {
|
|
3964
|
-
return
|
|
4009
|
+
return K.draggable(e, "destroy").resizable(e, "destroy"), e.gridstackNode && delete e.gridstackNode._initDD, delete e.ddElement, this;
|
|
3965
4010
|
}
|
|
3966
4011
|
/** @internal called to add drag over to support widgets being added externally */
|
|
3967
4012
|
_setupAcceptWidget() {
|
|
3968
4013
|
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
3969
|
-
return
|
|
4014
|
+
return K.droppable(this.el, "destroy"), this;
|
|
3970
4015
|
let e, t;
|
|
3971
4016
|
const i = (s, r, o) => {
|
|
3972
4017
|
var f;
|
|
@@ -3976,22 +4021,22 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3976
4021
|
return;
|
|
3977
4022
|
if (!((f = n.grid) != null && f.el)) {
|
|
3978
4023
|
o.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
|
|
3979
|
-
const
|
|
3980
|
-
o.style.left =
|
|
4024
|
+
const g = o.getBoundingClientRect();
|
|
4025
|
+
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";
|
|
3981
4026
|
}
|
|
3982
|
-
let { top: d, left:
|
|
3983
|
-
const
|
|
3984
|
-
|
|
4027
|
+
let { top: d, left: h } = o.getBoundingClientRect();
|
|
4028
|
+
const u = this.el.getBoundingClientRect();
|
|
4029
|
+
h -= u.left, d -= u.top;
|
|
3985
4030
|
const l = {
|
|
3986
4031
|
position: {
|
|
3987
4032
|
top: d * this.dragTransform.xScale,
|
|
3988
|
-
left:
|
|
4033
|
+
left: h * this.dragTransform.yScale
|
|
3989
4034
|
}
|
|
3990
4035
|
};
|
|
3991
4036
|
if (n._temporaryRemoved) {
|
|
3992
|
-
if (n.x = Math.max(0, Math.round(
|
|
4037
|
+
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)) {
|
|
3993
4038
|
if (n.autoPosition = !0, !this.engine.willItFit(n)) {
|
|
3994
|
-
|
|
4039
|
+
K.off(r, "drag");
|
|
3995
4040
|
return;
|
|
3996
4041
|
}
|
|
3997
4042
|
n._willFitPos && (c.copyPos(n, n._willFitPos), delete n._willFitPos);
|
|
@@ -4000,7 +4045,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4000
4045
|
} else
|
|
4001
4046
|
this._dragOrResize(o, s, l, n, t, e);
|
|
4002
4047
|
};
|
|
4003
|
-
return
|
|
4048
|
+
return K.droppable(this.el, {
|
|
4004
4049
|
accept: (s) => {
|
|
4005
4050
|
const r = s.gridstackNode || this._readAttr(s, !1);
|
|
4006
4051
|
if ((r == null ? void 0 : r.grid) === this)
|
|
@@ -4025,42 +4070,42 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4025
4070
|
if ((n == null ? void 0 : n.grid) === this && !n._temporaryRemoved)
|
|
4026
4071
|
return !1;
|
|
4027
4072
|
if (n != null && n._sidebarOrig && (n.w = n._sidebarOrig.w, n.h = n._sidebarOrig.h), n != null && n.grid && n.grid !== this && !n._temporaryRemoved && n.grid._leave(r, o), o = o || r, t = this.cellWidth(), e = this.getCellHeight(!0), !n) {
|
|
4028
|
-
const
|
|
4029
|
-
if (
|
|
4073
|
+
const u = o.getAttribute("data-gs-widget") || o.getAttribute("gridstacknode");
|
|
4074
|
+
if (u) {
|
|
4030
4075
|
try {
|
|
4031
|
-
n = JSON.parse(
|
|
4076
|
+
n = JSON.parse(u);
|
|
4032
4077
|
} catch {
|
|
4033
|
-
console.error("Gridstack dropover: Bad JSON format: ",
|
|
4078
|
+
console.error("Gridstack dropover: Bad JSON format: ", u);
|
|
4034
4079
|
}
|
|
4035
4080
|
o.removeAttribute("data-gs-widget"), o.removeAttribute("gridstacknode");
|
|
4036
4081
|
}
|
|
4037
4082
|
n || (n = this._readAttr(o)), n._sidebarOrig = { w: n.w, h: n.h };
|
|
4038
4083
|
}
|
|
4039
4084
|
n.grid || (n.el || (n = { ...n }), n._isExternal = !0, o.gridstackNode = n);
|
|
4040
|
-
const d = n.w || Math.round(o.offsetWidth / t) || 1,
|
|
4041
|
-
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h
|
|
4042
|
-
n._temporaryRemoved = !0) : (n.w = d, n.h =
|
|
4085
|
+
const d = n.w || Math.round(o.offsetWidth / t) || 1, h = n.h || Math.round(o.offsetHeight / e) || 1;
|
|
4086
|
+
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
|
|
4087
|
+
n._temporaryRemoved = !0) : (n.w = d, n.h = h, n._temporaryRemoved = !0), b._itemRemoving(n.el, !1), K.on(r, "drag", i), i(s, r, o), !1;
|
|
4043
4088
|
}).on(this.el, "dropout", (s, r, o) => {
|
|
4044
4089
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
4045
4090
|
return n && (!n.grid || n.grid === this) && (this._leave(r, o), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
4046
4091
|
}).on(this.el, "drop", (s, r, o) => {
|
|
4047
|
-
var
|
|
4092
|
+
var g, p, y;
|
|
4048
4093
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
4049
4094
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
4050
4095
|
return !1;
|
|
4051
|
-
const d = !!this.placeholder.parentElement,
|
|
4096
|
+
const d = !!this.placeholder.parentElement, h = r !== o;
|
|
4052
4097
|
this.placeholder.remove(), delete this.placeholder.gridstackNode;
|
|
4053
|
-
const
|
|
4054
|
-
|
|
4098
|
+
const u = d && this.opts.animate;
|
|
4099
|
+
u && this.setAnimation(!1);
|
|
4055
4100
|
const l = r._gridstackNodeOrig;
|
|
4056
4101
|
if (delete r._gridstackNodeOrig, d && (l != null && l.grid) && l.grid !== this) {
|
|
4057
|
-
const
|
|
4058
|
-
|
|
4102
|
+
const m = l.grid;
|
|
4103
|
+
m.engine.removeNodeFromLayoutCache(l), m.engine.removedNodes.push(l), m._triggerRemoveEvent()._triggerChangeEvent(), m.parentGridNode && !m.engine.nodes.length && m.opts.subGridDynamic && m.removeAsSubGrid();
|
|
4059
4104
|
}
|
|
4060
|
-
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (
|
|
4105
|
+
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (g = n.grid) == null || delete g._isTemp, K.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !d))
|
|
4061
4106
|
return !1;
|
|
4062
4107
|
const f = (y = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : y.gridstack;
|
|
4063
|
-
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r),
|
|
4108
|
+
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), h && (n.content || n.subGridOpts || b.addRemoveCB) ? (delete n.el, r = this.addWidget(n)) : (this._prepareElement(r, !0, n), this.el.appendChild(r), this.resizeToContentCheck(!1, n), f && (f.parentGridNode = n, f.opts.styleInHead || f._updateStyles(!0)), this._updateContainerHeight()), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, l && l.grid ? l : void 0, n), u && this.setAnimation(this.opts.animate, !0), !1;
|
|
4064
4109
|
}), this;
|
|
4065
4110
|
}
|
|
4066
4111
|
/** @internal mark item for removal */
|
|
@@ -4075,7 +4120,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4075
4120
|
if (typeof this.opts.removable != "string")
|
|
4076
4121
|
return this;
|
|
4077
4122
|
const e = document.querySelector(this.opts.removable);
|
|
4078
|
-
return e ? (!this.opts.staticGrid && !
|
|
4123
|
+
return e ? (!this.opts.staticGrid && !K.isDroppable(e) && K.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => b._itemRemoving(i, !0)).on(e, "dropout", (t, i) => b._itemRemoving(i, !1)), this) : this;
|
|
4079
4124
|
}
|
|
4080
4125
|
/**
|
|
4081
4126
|
* prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
|
|
@@ -4091,33 +4136,33 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4091
4136
|
return this;
|
|
4092
4137
|
if (!i._initDD) {
|
|
4093
4138
|
let n, d;
|
|
4094
|
-
const
|
|
4095
|
-
this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(e, f,
|
|
4096
|
-
},
|
|
4097
|
-
this._dragOrResize(e, f,
|
|
4139
|
+
const h = (f, g) => {
|
|
4140
|
+
this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(e, f, g, i, n, d);
|
|
4141
|
+
}, u = (f, g) => {
|
|
4142
|
+
this._dragOrResize(e, f, g, i, n, d);
|
|
4098
4143
|
}, l = (f) => {
|
|
4099
4144
|
this.placeholder.remove(), delete this.placeholder.gridstackNode, delete i._moving, delete i._event, delete i._lastTried;
|
|
4100
|
-
const
|
|
4145
|
+
const g = i.w !== i._orig.w, p = f.target;
|
|
4101
4146
|
if (!(!p.gridstackNode || p.gridstackNode.grid !== this)) {
|
|
4102
4147
|
if (i.el = p, i._isAboutToRemove) {
|
|
4103
4148
|
const y = e.gridstackNode.grid;
|
|
4104
4149
|
y._gsEventHandler[f.type] && y._gsEventHandler[f.type](f, p), y.engine.nodes.push(i), y.removeWidget(e, !0, !0);
|
|
4105
4150
|
} else
|
|
4106
4151
|
c.removePositioningStyles(p), i._temporaryRemoved ? (c.copyPos(i, i._orig), this._writePosAttr(p, i), this.engine.addNode(i)) : this._writePosAttr(p, i), this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, p);
|
|
4107
|
-
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(
|
|
4152
|
+
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(g, i));
|
|
4108
4153
|
}
|
|
4109
4154
|
};
|
|
4110
|
-
|
|
4111
|
-
start:
|
|
4155
|
+
K.draggable(e, {
|
|
4156
|
+
start: h,
|
|
4112
4157
|
stop: l,
|
|
4113
|
-
drag:
|
|
4158
|
+
drag: u
|
|
4114
4159
|
}).resizable(e, {
|
|
4115
|
-
start:
|
|
4160
|
+
start: h,
|
|
4116
4161
|
stop: l,
|
|
4117
|
-
resize:
|
|
4162
|
+
resize: u
|
|
4118
4163
|
}), i._initDD = !0;
|
|
4119
4164
|
}
|
|
4120
|
-
return
|
|
4165
|
+
return K.draggable(e, s ? "disable" : "enable").resizable(e, r ? "disable" : "enable"), this;
|
|
4121
4166
|
}
|
|
4122
4167
|
/** @internal handles actual drag/resize start */
|
|
4123
4168
|
_onStartMoving(e, t, i, s, r, o) {
|
|
@@ -4135,48 +4180,48 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4135
4180
|
yOffset: 0
|
|
4136
4181
|
};
|
|
4137
4182
|
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") {
|
|
4138
|
-
const d = this.getColumn() - s.x,
|
|
4139
|
-
|
|
4183
|
+
const d = this.getColumn() - s.x, h = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
|
|
4184
|
+
K.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));
|
|
4140
4185
|
}
|
|
4141
4186
|
}
|
|
4142
4187
|
/** @internal handles actual drag/resize */
|
|
4143
4188
|
_dragOrResize(e, t, i, s, r, o) {
|
|
4144
4189
|
const n = { ...s._orig };
|
|
4145
|
-
let d,
|
|
4146
|
-
const
|
|
4147
|
-
if (
|
|
4190
|
+
let d, h = this.opts.marginLeft, u = this.opts.marginRight, l = this.opts.marginTop, f = this.opts.marginBottom;
|
|
4191
|
+
const g = Math.round(o * 0.1), p = Math.round(r * 0.1);
|
|
4192
|
+
if (h = Math.min(h, p), u = Math.min(u, p), l = Math.min(l, g), f = Math.min(f, g), t.type === "drag") {
|
|
4148
4193
|
if (s._temporaryRemoved)
|
|
4149
4194
|
return;
|
|
4150
|
-
const
|
|
4151
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position,
|
|
4152
|
-
const
|
|
4153
|
-
n.x = Math.round(
|
|
4195
|
+
const m = i.position.top - s._prevYPix;
|
|
4196
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, m);
|
|
4197
|
+
const k = i.position.left + (i.position.left > s._lastUiPosition.left ? -u : h), L = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : l);
|
|
4198
|
+
n.x = Math.round(k / r), n.y = Math.round(L / o);
|
|
4154
4199
|
const w = this._extraDragRow;
|
|
4155
4200
|
if (this.engine.collide(s, n)) {
|
|
4156
|
-
const
|
|
4157
|
-
let
|
|
4158
|
-
this.opts.maxRow &&
|
|
4201
|
+
const q = this.getRow();
|
|
4202
|
+
let A = Math.max(0, n.y + s.h - q);
|
|
4203
|
+
this.opts.maxRow && q + A > this.opts.maxRow && (A = Math.max(0, this.opts.maxRow - q)), this._extraDragRow = A;
|
|
4159
4204
|
} else
|
|
4160
4205
|
this._extraDragRow = 0;
|
|
4161
4206
|
if (this._extraDragRow !== w && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
4162
4207
|
return;
|
|
4163
4208
|
} else if (t.type === "resize") {
|
|
4164
|
-
if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width -
|
|
4209
|
+
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)
|
|
4165
4210
|
return;
|
|
4166
|
-
const
|
|
4167
|
-
n.x = Math.round(
|
|
4211
|
+
const m = i.position.left + h, k = i.position.top + l;
|
|
4212
|
+
n.x = Math.round(m / r), n.y = Math.round(k / o), d = !0;
|
|
4168
4213
|
}
|
|
4169
4214
|
s._event = t, s._lastTried = n;
|
|
4170
4215
|
const y = {
|
|
4171
|
-
x: i.position.left +
|
|
4216
|
+
x: i.position.left + h,
|
|
4172
4217
|
y: i.position.top + l,
|
|
4173
|
-
w: (i.size ? i.size.width : s.w * r) -
|
|
4218
|
+
w: (i.size ? i.size.width : s.w * r) - h - u,
|
|
4174
4219
|
h: (i.size ? i.size.height : s.h * o) - l - f
|
|
4175
4220
|
};
|
|
4176
4221
|
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: o, rect: y, resizing: d })) {
|
|
4177
|
-
s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l,
|
|
4178
|
-
const
|
|
4179
|
-
s._sidebarOrig || this._writePosAttr(
|
|
4222
|
+
s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l, u, f, h), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4223
|
+
const m = t.target;
|
|
4224
|
+
s._sidebarOrig || this._writePosAttr(m, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, m);
|
|
4180
4225
|
}
|
|
4181
4226
|
}
|
|
4182
4227
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4186,7 +4231,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4186
4231
|
_leave(e, t) {
|
|
4187
4232
|
t = t || e;
|
|
4188
4233
|
const i = t.gridstackNode;
|
|
4189
|
-
if (!i || (t.style.transform = t.style.transformOrigin = null,
|
|
4234
|
+
if (!i || (t.style.transform = t.style.transformOrigin = null, K.off(e, "drag"), i._temporaryRemoved))
|
|
4190
4235
|
return;
|
|
4191
4236
|
i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e;
|
|
4192
4237
|
const s = i._sidebarOrig;
|
|
@@ -4194,7 +4239,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4194
4239
|
}
|
|
4195
4240
|
// legacy method removed
|
|
4196
4241
|
commit() {
|
|
4197
|
-
return
|
|
4242
|
+
return Xs(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4198
4243
|
}
|
|
4199
4244
|
}
|
|
4200
4245
|
b.renderCB = (a, e) => {
|
|
@@ -4202,21 +4247,21 @@ b.renderCB = (a, e) => {
|
|
|
4202
4247
|
};
|
|
4203
4248
|
b.resizeToContentParent = ".grid-stack-item-content";
|
|
4204
4249
|
b.Utils = c;
|
|
4205
|
-
b.Engine =
|
|
4250
|
+
b.Engine = de;
|
|
4206
4251
|
b.GDRev = "11.5.1";
|
|
4207
|
-
const
|
|
4252
|
+
const tr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], ir = { class: "grid-stack-item-content" }, sr = /* @__PURE__ */ Z({
|
|
4208
4253
|
__name: "DraggableGridLayout",
|
|
4209
4254
|
props: {
|
|
4210
4255
|
tiles: {},
|
|
4211
|
-
tileHeight: { default:
|
|
4256
|
+
tileHeight: { default: Be }
|
|
4212
4257
|
},
|
|
4213
4258
|
emits: ["update-tiles"],
|
|
4214
4259
|
setup(a, { expose: e, emit: t }) {
|
|
4215
|
-
const i = a, s = t, r =
|
|
4260
|
+
const i = a, s = t, r = M(null), o = M(new Map(i.tiles.map((g) => [`${g.id}`, g])));
|
|
4216
4261
|
let n = null;
|
|
4217
|
-
const d = (
|
|
4218
|
-
var
|
|
4219
|
-
const y = o.value.get(`${(
|
|
4262
|
+
const d = (g) => `[data-id="${g}"]`, h = (g) => g.map((p) => {
|
|
4263
|
+
var m;
|
|
4264
|
+
const y = o.value.get(`${(m = p.el) == null ? void 0 : m.getAttribute("data-id")}`);
|
|
4220
4265
|
if (y)
|
|
4221
4266
|
return {
|
|
4222
4267
|
...y,
|
|
@@ -4225,53 +4270,53 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4225
4270
|
size: { cols: Number(p.w), rows: Number(p.h) }
|
|
4226
4271
|
}
|
|
4227
4272
|
};
|
|
4228
|
-
}).filter((p) => p !== void 0),
|
|
4229
|
-
n && (
|
|
4230
|
-
o.value.set(`${
|
|
4273
|
+
}).filter((p) => p !== void 0), u = (g, p) => {
|
|
4274
|
+
n && (h(p).forEach((m) => {
|
|
4275
|
+
o.value.set(`${m.id}`, m);
|
|
4231
4276
|
}), s("update-tiles", Array.from(o.value.values())));
|
|
4232
|
-
}, l = (
|
|
4277
|
+
}, l = (g, p) => {
|
|
4233
4278
|
p.forEach((y) => {
|
|
4234
|
-
var
|
|
4235
|
-
o.value.delete(`${(
|
|
4279
|
+
var m;
|
|
4280
|
+
o.value.delete(`${(m = y.el) == null ? void 0 : m.getAttribute("data-id")}`);
|
|
4236
4281
|
}), s("update-tiles", Array.from(o.value.values()));
|
|
4237
4282
|
};
|
|
4238
|
-
|
|
4283
|
+
et(() => {
|
|
4239
4284
|
r.value && (n = b.init({
|
|
4240
4285
|
margin: 10,
|
|
4241
|
-
column:
|
|
4286
|
+
column: mt,
|
|
4242
4287
|
cellHeight: i.tileHeight,
|
|
4243
4288
|
resizable: { handles: "se, sw" },
|
|
4244
4289
|
handle: ".tile-header"
|
|
4245
|
-
}, r.value), n.on("change",
|
|
4246
|
-
}),
|
|
4290
|
+
}, r.value), n.on("change", u), n.on("added", u), n.on("removed", l));
|
|
4291
|
+
}), tt(() => {
|
|
4247
4292
|
n && n.destroy(!1);
|
|
4248
4293
|
});
|
|
4249
|
-
const f = (
|
|
4294
|
+
const f = (g) => {
|
|
4250
4295
|
if (n && r.value) {
|
|
4251
|
-
const p = r.value.querySelector(d(
|
|
4296
|
+
const p = r.value.querySelector(d(g));
|
|
4252
4297
|
p && n.removeWidget(p);
|
|
4253
4298
|
}
|
|
4254
4299
|
};
|
|
4255
|
-
return Le(() => i.tiles.length, async (
|
|
4256
|
-
if (
|
|
4300
|
+
return Le(() => i.tiles.length, async (g, p) => {
|
|
4301
|
+
if (g > p && n) {
|
|
4257
4302
|
const y = i.tiles.slice(p);
|
|
4258
|
-
for (const
|
|
4259
|
-
o.value.set(`${
|
|
4303
|
+
for (const m of y)
|
|
4304
|
+
o.value.set(`${m.id}`, m), await ft(), n.makeWidget(d(m.id), {
|
|
4260
4305
|
autoPosition: !0,
|
|
4261
|
-
w:
|
|
4262
|
-
h:
|
|
4306
|
+
w: m.layout.size.cols,
|
|
4307
|
+
h: m.layout.size.rows
|
|
4263
4308
|
});
|
|
4264
4309
|
}
|
|
4265
|
-
}),
|
|
4266
|
-
i.tiles.forEach((
|
|
4267
|
-
o.value.set(`${
|
|
4310
|
+
}), Gt(() => {
|
|
4311
|
+
i.tiles.forEach((g) => {
|
|
4312
|
+
o.value.set(`${g.id}`, g);
|
|
4268
4313
|
});
|
|
4269
|
-
}), e({ removeWidget: f }), (
|
|
4314
|
+
}), e({ removeWidget: f }), (g, p) => (C(), W("div", {
|
|
4270
4315
|
ref_key: "gridContainer",
|
|
4271
4316
|
ref: r,
|
|
4272
4317
|
class: "grid-stack"
|
|
4273
4318
|
}, [
|
|
4274
|
-
(C(!0),
|
|
4319
|
+
(C(!0), W(Yt, null, jt(i.tiles, (y) => (C(), W("div", {
|
|
4275
4320
|
key: y.id,
|
|
4276
4321
|
class: "grid-stack-item",
|
|
4277
4322
|
"data-id": `${y.id}`,
|
|
@@ -4282,52 +4327,52 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4282
4327
|
"gs-x": y.layout.position.col,
|
|
4283
4328
|
"gs-y": y.layout.position.row
|
|
4284
4329
|
}, [
|
|
4285
|
-
|
|
4286
|
-
Ae(
|
|
4330
|
+
X("div", ir, [
|
|
4331
|
+
Ae(g.$slots, "tile", { tile: y }, void 0, !0)
|
|
4287
4332
|
])
|
|
4288
|
-
], 8,
|
|
4333
|
+
], 8, tr))), 128))
|
|
4289
4334
|
], 512));
|
|
4290
4335
|
}
|
|
4291
|
-
}),
|
|
4336
|
+
}), rr = /* @__PURE__ */ be(sr, [["__scopeId", "data-v-a68d6821"]]), nr = {
|
|
4292
4337
|
key: 0,
|
|
4293
4338
|
class: "fullscreen-header"
|
|
4294
|
-
},
|
|
4339
|
+
}, or = {
|
|
4295
4340
|
key: 0,
|
|
4296
4341
|
class: "tile-container slottable-tile"
|
|
4297
|
-
},
|
|
4342
|
+
}, ar = /* @__PURE__ */ Z({
|
|
4298
4343
|
__name: "DashboardRenderer",
|
|
4299
|
-
props: /* @__PURE__ */
|
|
4344
|
+
props: /* @__PURE__ */ Ve({
|
|
4300
4345
|
context: {}
|
|
4301
4346
|
}, {
|
|
4302
4347
|
modelValue: { required: !0 },
|
|
4303
4348
|
modelModifiers: {}
|
|
4304
4349
|
}),
|
|
4305
|
-
emits: /* @__PURE__ */
|
|
4350
|
+
emits: /* @__PURE__ */ Ve(["edit-tile", "tile-time-range-zoom"], ["update:modelValue"]),
|
|
4306
4351
|
setup(a, { expose: e, emit: t }) {
|
|
4307
|
-
|
|
4352
|
+
ct((S) => ({
|
|
4308
4353
|
v3a012eda: l.value
|
|
4309
4354
|
}));
|
|
4310
|
-
const i = a, s = t, r =
|
|
4311
|
-
f || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")),
|
|
4312
|
-
const
|
|
4355
|
+
const i = a, s = t, r = Vt(a, "modelValue"), { i18n: o } = le.useI18n(), n = M(0), d = M(null), h = M(), u = M(), l = M("scale(1)"), f = pe(ve);
|
|
4356
|
+
f || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")), le.useRequestQueue();
|
|
4357
|
+
const g = $e(), p = R(() => i.context.timeSpec ? i.context.timeSpec : {
|
|
4313
4358
|
type: "relative",
|
|
4314
|
-
time_range:
|
|
4315
|
-
}), y =
|
|
4316
|
-
const
|
|
4317
|
-
return
|
|
4318
|
-
},
|
|
4319
|
-
var
|
|
4320
|
-
let
|
|
4321
|
-
if ("description" in
|
|
4322
|
-
const
|
|
4323
|
-
const
|
|
4324
|
-
return o.te(
|
|
4359
|
+
time_range: g.defaultQueryTimeForOrg
|
|
4360
|
+
}), y = R(() => !!i.context.timeSpec || !g.loading), m = (S, O) => {
|
|
4361
|
+
const $ = S.layout.position.row - O.layout.position.row;
|
|
4362
|
+
return $ !== 0 ? $ : S.layout.position.col - O.layout.position.col;
|
|
4363
|
+
}, k = R(() => r.value.tiles.map((S) => {
|
|
4364
|
+
var $;
|
|
4365
|
+
let O = S.definition;
|
|
4366
|
+
if ("description" in O.chart) {
|
|
4367
|
+
const F = ($ = O.chart.description) == null ? void 0 : $.replace(hs, () => {
|
|
4368
|
+
const Fe = `renderer.trendRange.${p.value.type === "absolute" ? "custom" : p.value.time_range}`;
|
|
4369
|
+
return o.te(Fe) ? o.t(Fe) : "";
|
|
4325
4370
|
});
|
|
4326
|
-
|
|
4327
|
-
...
|
|
4371
|
+
O = {
|
|
4372
|
+
...O,
|
|
4328
4373
|
chart: {
|
|
4329
|
-
...
|
|
4330
|
-
description:
|
|
4374
|
+
...O.chart,
|
|
4375
|
+
description: F
|
|
4331
4376
|
}
|
|
4332
4377
|
};
|
|
4333
4378
|
}
|
|
@@ -4337,24 +4382,24 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4337
4382
|
S
|
|
4338
4383
|
), {
|
|
4339
4384
|
layout: S.layout,
|
|
4340
|
-
meta:
|
|
4385
|
+
meta: O,
|
|
4341
4386
|
type: S.type,
|
|
4342
4387
|
// Add a unique key to each tile internally.
|
|
4343
4388
|
id: S.id ?? crypto.randomUUID()
|
|
4344
4389
|
};
|
|
4345
|
-
})),
|
|
4390
|
+
})), L = (S) => {
|
|
4346
4391
|
s("edit-tile", S);
|
|
4347
|
-
}, w = (S) => S.type === "slottable",
|
|
4392
|
+
}, w = (S) => S.type === "slottable", q = (S) => {
|
|
4348
4393
|
try {
|
|
4349
|
-
const
|
|
4394
|
+
const O = w(S.meta.chart) ? { ...S.meta.chart } : {
|
|
4350
4395
|
...S.meta.chart,
|
|
4351
4396
|
chart_title: S.meta.chart.chart_title ? `Copy of ${S.meta.chart.chart_title}` : ""
|
|
4352
|
-
},
|
|
4397
|
+
}, $ = {
|
|
4353
4398
|
id: crypto.randomUUID(),
|
|
4354
4399
|
type: "chart",
|
|
4355
4400
|
definition: {
|
|
4356
4401
|
...S.meta,
|
|
4357
|
-
chart:
|
|
4402
|
+
chart: O
|
|
4358
4403
|
},
|
|
4359
4404
|
layout: {
|
|
4360
4405
|
position: {
|
|
@@ -4364,90 +4409,90 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4364
4409
|
size: S.layout.size
|
|
4365
4410
|
}
|
|
4366
4411
|
};
|
|
4367
|
-
r.value.tiles.push(JSON.parse(JSON.stringify(
|
|
4368
|
-
} catch (
|
|
4369
|
-
console.warn(
|
|
4412
|
+
r.value.tiles.push(JSON.parse(JSON.stringify($)));
|
|
4413
|
+
} catch (O) {
|
|
4414
|
+
console.warn(O);
|
|
4370
4415
|
}
|
|
4371
|
-
},
|
|
4416
|
+
}, A = (S) => {
|
|
4372
4417
|
d.value && d.value.removeWidget(S.id);
|
|
4373
|
-
},
|
|
4418
|
+
}, fe = () => {
|
|
4374
4419
|
n.value++;
|
|
4375
|
-
},
|
|
4376
|
-
const
|
|
4377
|
-
id:
|
|
4378
|
-
type:
|
|
4379
|
-
layout:
|
|
4380
|
-
definition:
|
|
4420
|
+
}, we = (S) => {
|
|
4421
|
+
const O = S.map(($) => ({
|
|
4422
|
+
id: $.id,
|
|
4423
|
+
type: $.type,
|
|
4424
|
+
layout: $.layout,
|
|
4425
|
+
definition: $.meta
|
|
4381
4426
|
}));
|
|
4382
|
-
r.value.tiles =
|
|
4383
|
-
},
|
|
4384
|
-
if (l.value = "scale(1)", await
|
|
4385
|
-
const { availWidth: S, availHeight:
|
|
4386
|
-
l.value = `scale(${
|
|
4427
|
+
r.value.tiles = O.sort(m);
|
|
4428
|
+
}, _e = async () => {
|
|
4429
|
+
if (l.value = "scale(1)", await ft(), u.value) {
|
|
4430
|
+
const { availWidth: S, availHeight: O } = window.screen, { width: $, height: F } = u.value.getBoundingClientRect(), ne = Math.min(O / F, S / $);
|
|
4431
|
+
l.value = `scale(${ne})`;
|
|
4387
4432
|
}
|
|
4388
|
-
},
|
|
4389
|
-
|
|
4390
|
-
},
|
|
4391
|
-
|
|
4392
|
-
},
|
|
4393
|
-
globalFilters:
|
|
4394
|
-
context:
|
|
4395
|
-
isFullscreen:
|
|
4433
|
+
}, T = () => {
|
|
4434
|
+
h.value && (document.fullscreenElement ? document.exitFullscreen() : h.value.requestFullscreen());
|
|
4435
|
+
}, z = M(!1), re = () => {
|
|
4436
|
+
z.value = document.fullscreenElement !== null, z.value && _e();
|
|
4437
|
+
}, ge = R(() => r.value.preset_filters ?? []), { internalContext: Ee } = le.useDashboardInternalContext({
|
|
4438
|
+
globalFilters: ge,
|
|
4439
|
+
context: De(i, "context"),
|
|
4440
|
+
isFullscreen: z
|
|
4396
4441
|
});
|
|
4397
4442
|
return e({
|
|
4398
|
-
refresh:
|
|
4399
|
-
toggleFullscreen:
|
|
4400
|
-
}), (S,
|
|
4401
|
-
const
|
|
4402
|
-
return C(),
|
|
4443
|
+
refresh: fe,
|
|
4444
|
+
toggleFullscreen: T
|
|
4445
|
+
}), (S, O) => {
|
|
4446
|
+
const $ = ue("KAlert");
|
|
4447
|
+
return C(), W("div", {
|
|
4403
4448
|
ref_key: "dashboardContainer",
|
|
4404
|
-
ref:
|
|
4405
|
-
class:
|
|
4406
|
-
onFullscreenchange:
|
|
4449
|
+
ref: h,
|
|
4450
|
+
class: ze(["kong-ui-public-dashboard-renderer", { "is-fullscreen": z.value }]),
|
|
4451
|
+
onFullscreenchange: re
|
|
4407
4452
|
}, [
|
|
4408
|
-
|
|
4453
|
+
X("div", {
|
|
4409
4454
|
ref_key: "layoutContainer",
|
|
4410
|
-
ref:
|
|
4455
|
+
ref: u,
|
|
4411
4456
|
class: "layout"
|
|
4412
4457
|
}, [
|
|
4413
|
-
x(f) &&
|
|
4458
|
+
x(f) && z.value ? (C(), W("div", nr, [
|
|
4414
4459
|
Ae(S.$slots, "fullscreenHeader", {}, void 0, !0)
|
|
4415
|
-
])) :
|
|
4416
|
-
x(f) ? (C(),
|
|
4460
|
+
])) : V("", !0),
|
|
4461
|
+
x(f) ? (C(), I(Qt(a.context.editable && !z.value ? rr : js), {
|
|
4417
4462
|
key: 2,
|
|
4418
4463
|
ref_key: "gridLayoutRef",
|
|
4419
4464
|
ref: d,
|
|
4420
4465
|
"tile-height": r.value.tile_height,
|
|
4421
|
-
tiles:
|
|
4422
|
-
onUpdateTiles:
|
|
4466
|
+
tiles: k.value,
|
|
4467
|
+
onUpdateTiles: we
|
|
4423
4468
|
}, {
|
|
4424
|
-
tile: P(({ tile:
|
|
4425
|
-
|
|
4426
|
-
Ae(S.$slots,
|
|
4427
|
-
])) : (C(),
|
|
4428
|
-
key:
|
|
4469
|
+
tile: P(({ tile: F }) => [
|
|
4470
|
+
F.meta.chart.type === "slottable" ? (C(), W("div", or, [
|
|
4471
|
+
Ae(S.$slots, F.meta.chart.id, {}, void 0, !0)
|
|
4472
|
+
])) : (C(), I(li, {
|
|
4473
|
+
key: z.value ? `${F.id}-tile` : `${F.id}-tile-fullscreen`,
|
|
4429
4474
|
"refresh-counter": n.value,
|
|
4430
|
-
"onUpdate:refreshCounter":
|
|
4475
|
+
"onUpdate:refreshCounter": O[0] || (O[0] = (ne) => n.value = ne),
|
|
4431
4476
|
class: "tile-container",
|
|
4432
4477
|
context: x(Ee),
|
|
4433
|
-
definition:
|
|
4434
|
-
height:
|
|
4435
|
-
"is-fullscreen":
|
|
4478
|
+
definition: F.meta,
|
|
4479
|
+
height: F.layout.size.rows * (r.value.tile_height || x(Be)) + parseInt(x(ai), 10),
|
|
4480
|
+
"is-fullscreen": z.value,
|
|
4436
4481
|
"query-ready": y.value,
|
|
4437
|
-
"tile-id":
|
|
4438
|
-
onDuplicateTile: (
|
|
4439
|
-
onEditTile: (
|
|
4440
|
-
onRemoveTile: (
|
|
4441
|
-
onTileTimeRangeZoom:
|
|
4482
|
+
"tile-id": F.id,
|
|
4483
|
+
onDuplicateTile: (ne) => q(F),
|
|
4484
|
+
onEditTile: (ne) => L(F),
|
|
4485
|
+
onRemoveTile: (ne) => A(F),
|
|
4486
|
+
onTileTimeRangeZoom: O[1] || (O[1] = (ne) => s("tile-time-range-zoom", ne))
|
|
4442
4487
|
}, null, 8, ["refresh-counter", "context", "definition", "height", "is-fullscreen", "query-ready", "tile-id", "onDuplicateTile", "onEditTile", "onRemoveTile"]))
|
|
4443
4488
|
]),
|
|
4444
4489
|
_: 3
|
|
4445
|
-
}, 40, ["tile-height", "tiles"])) : (C(),
|
|
4490
|
+
}, 40, ["tile-height", "tiles"])) : (C(), I($, {
|
|
4446
4491
|
key: 1,
|
|
4447
4492
|
appearance: "danger"
|
|
4448
4493
|
}, {
|
|
4449
4494
|
default: P(() => [
|
|
4450
|
-
|
|
4495
|
+
dt(ee(x(o).t("renderer.noQueryBridge")), 1)
|
|
4451
4496
|
]),
|
|
4452
4497
|
_: 1
|
|
4453
4498
|
}))
|
|
@@ -4455,7 +4500,7 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4455
4500
|
], 34);
|
|
4456
4501
|
};
|
|
4457
4502
|
}
|
|
4458
|
-
}),
|
|
4503
|
+
}), wr = /* @__PURE__ */ be(ar, [["__scopeId", "data-v-50c8588f"]]), Er = /* @__PURE__ */ Z({
|
|
4459
4504
|
__name: "DashboardTilePreview",
|
|
4460
4505
|
props: {
|
|
4461
4506
|
context: {},
|
|
@@ -4464,61 +4509,61 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4464
4509
|
},
|
|
4465
4510
|
emits: ["chart-data", "tile-time-range-zoom", "tile-bounds-change"],
|
|
4466
4511
|
setup(a, { expose: e, emit: t }) {
|
|
4467
|
-
const i =
|
|
4512
|
+
const i = Tt("root"), s = Tt("dashboard-tile"), r = crypto.randomUUID(), o = t, n = (w) => {
|
|
4468
4513
|
o("tile-time-range-zoom", w);
|
|
4469
4514
|
}, d = (w) => {
|
|
4470
4515
|
o("chart-data", w);
|
|
4471
|
-
},
|
|
4516
|
+
}, h = (w) => {
|
|
4472
4517
|
o("tile-bounds-change", w);
|
|
4473
|
-
}, { i18n:
|
|
4474
|
-
globalFilters:
|
|
4475
|
-
context:
|
|
4476
|
-
}), f =
|
|
4477
|
-
var w,
|
|
4478
|
-
return !((
|
|
4479
|
-
}), y =
|
|
4480
|
-
let
|
|
4481
|
-
|
|
4482
|
-
var
|
|
4483
|
-
const w = (
|
|
4484
|
-
w && (y.value = w.getBoundingClientRect().height,
|
|
4485
|
-
const { height:
|
|
4486
|
-
y.value =
|
|
4487
|
-
}),
|
|
4488
|
-
}),
|
|
4489
|
-
const
|
|
4518
|
+
}, { i18n: u } = le.useI18n(), { internalContext: l } = le.useDashboardInternalContext({
|
|
4519
|
+
globalFilters: De(() => a.globalFilters),
|
|
4520
|
+
context: De(() => a.context)
|
|
4521
|
+
}), f = $e(), g = R(() => !!a.context.timeSpec || !f.loading), p = R(() => {
|
|
4522
|
+
var w, q;
|
|
4523
|
+
return !((q = (w = a.definition) == null ? void 0 : w.query) != null && q.metrics) || a.definition.query.metrics.length === 0;
|
|
4524
|
+
}), y = M(Be);
|
|
4525
|
+
let m;
|
|
4526
|
+
et(() => {
|
|
4527
|
+
var q;
|
|
4528
|
+
const w = (q = i.value) == null ? void 0 : q.parentElement;
|
|
4529
|
+
w && (y.value = w.getBoundingClientRect().height, m = new ResizeObserver(([A]) => {
|
|
4530
|
+
const { height: fe } = A.contentRect;
|
|
4531
|
+
y.value = fe;
|
|
4532
|
+
}), m.observe(w));
|
|
4533
|
+
}), tt(() => m == null ? void 0 : m.disconnect());
|
|
4534
|
+
const k = M(0);
|
|
4490
4535
|
return e({
|
|
4491
4536
|
refresh: () => {
|
|
4492
|
-
|
|
4537
|
+
k.value++;
|
|
4493
4538
|
},
|
|
4494
4539
|
getExportData: () => {
|
|
4495
4540
|
var w;
|
|
4496
4541
|
return (w = s.value) == null ? void 0 : w.getExportData();
|
|
4497
4542
|
}
|
|
4498
|
-
}), (w,
|
|
4499
|
-
const
|
|
4500
|
-
return C(),
|
|
4543
|
+
}), (w, q) => {
|
|
4544
|
+
const A = ue("KEmptyState");
|
|
4545
|
+
return C(), W("div", {
|
|
4501
4546
|
ref_key: "root",
|
|
4502
4547
|
ref: i,
|
|
4503
4548
|
"data-testid": "dashboard-tile-preview-root"
|
|
4504
4549
|
}, [
|
|
4505
|
-
p.value ? (C(),
|
|
4550
|
+
p.value ? (C(), I(A, {
|
|
4506
4551
|
key: 0,
|
|
4507
4552
|
"action-button-visible": !1,
|
|
4508
4553
|
"data-testid": "chart-not-configured-empty-state"
|
|
4509
4554
|
}, {
|
|
4510
4555
|
title: P(() => [
|
|
4511
|
-
|
|
4556
|
+
X("p", null, ee(x(u).t("renderer.not_configured.title")), 1)
|
|
4512
4557
|
]),
|
|
4513
4558
|
default: P(() => [
|
|
4514
|
-
|
|
4559
|
+
X("p", null, ee(x(u).t("renderer.not_configured.description")), 1)
|
|
4515
4560
|
]),
|
|
4516
4561
|
_: 1
|
|
4517
|
-
})) : (C(),
|
|
4562
|
+
})) : (C(), I(li, {
|
|
4518
4563
|
key: 1,
|
|
4519
4564
|
ref: "dashboard-tile",
|
|
4520
|
-
"refresh-counter":
|
|
4521
|
-
"onUpdate:refreshCounter":
|
|
4565
|
+
"refresh-counter": k.value,
|
|
4566
|
+
"onUpdate:refreshCounter": q[0] || (q[0] = (fe) => k.value = fe),
|
|
4522
4567
|
context: {
|
|
4523
4568
|
...x(l),
|
|
4524
4569
|
editable: !1
|
|
@@ -4526,17 +4571,17 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4526
4571
|
definition: a.definition,
|
|
4527
4572
|
height: y.value,
|
|
4528
4573
|
"hide-actions": "",
|
|
4529
|
-
"query-ready":
|
|
4574
|
+
"query-ready": g.value,
|
|
4530
4575
|
"show-refresh": "",
|
|
4531
4576
|
"tile-id": x(r),
|
|
4532
4577
|
onChartData: d,
|
|
4533
|
-
onTileBoundsChange:
|
|
4578
|
+
onTileBoundsChange: h,
|
|
4534
4579
|
onTileTimeRangeZoom: n
|
|
4535
4580
|
}, null, 8, ["refresh-counter", "context", "definition", "height", "query-ready", "tile-id"]))
|
|
4536
4581
|
], 512);
|
|
4537
4582
|
};
|
|
4538
4583
|
}
|
|
4539
|
-
}),
|
|
4584
|
+
}), lr = (a) => {
|
|
4540
4585
|
var t;
|
|
4541
4586
|
const e = (t = a.definition) == null ? void 0 : t.query;
|
|
4542
4587
|
if (!e)
|
|
@@ -4546,7 +4591,7 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4546
4591
|
return;
|
|
4547
4592
|
}
|
|
4548
4593
|
return a;
|
|
4549
|
-
},
|
|
4594
|
+
}, hr = (a) => {
|
|
4550
4595
|
var i;
|
|
4551
4596
|
const e = (i = a.definition) == null ? void 0 : i.query;
|
|
4552
4597
|
if (!e)
|
|
@@ -4562,56 +4607,56 @@ const Ks = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Qs = { cl
|
|
|
4562
4607
|
query: t
|
|
4563
4608
|
}
|
|
4564
4609
|
};
|
|
4565
|
-
},
|
|
4566
|
-
var r, o, n, d,
|
|
4610
|
+
}, ur = (a) => {
|
|
4611
|
+
var r, o, n, d, h;
|
|
4567
4612
|
if (!a.length)
|
|
4568
4613
|
return [];
|
|
4569
4614
|
let e = 0, t = 0, i = 0;
|
|
4570
4615
|
const s = [];
|
|
4571
|
-
for (const
|
|
4572
|
-
const l = ((o = (r =
|
|
4573
|
-
t + l >
|
|
4574
|
-
const
|
|
4575
|
-
...
|
|
4616
|
+
for (const u of a) {
|
|
4617
|
+
const l = ((o = (r = u.layout) == null ? void 0 : r.size) == null ? void 0 : o.cols) ?? 1, f = ((d = (n = u.layout) == null ? void 0 : n.size) == null ? void 0 : d.rows) ?? 1;
|
|
4618
|
+
t + l > mt && (e += i, t = 0, i = 0);
|
|
4619
|
+
const g = {
|
|
4620
|
+
...u,
|
|
4576
4621
|
layout: {
|
|
4577
|
-
...
|
|
4622
|
+
...u.layout,
|
|
4578
4623
|
position: {
|
|
4579
|
-
...((
|
|
4624
|
+
...((h = u.layout) == null ? void 0 : h.position) ?? {},
|
|
4580
4625
|
col: t,
|
|
4581
4626
|
row: e
|
|
4582
4627
|
}
|
|
4583
4628
|
}
|
|
4584
4629
|
};
|
|
4585
|
-
s.push(
|
|
4630
|
+
s.push(g), t += l, i = Math.max(i, f);
|
|
4586
4631
|
}
|
|
4587
4632
|
return s;
|
|
4588
|
-
},
|
|
4633
|
+
}, xr = (a, e) => {
|
|
4589
4634
|
if (e) {
|
|
4590
|
-
const s = a.tiles.map(
|
|
4635
|
+
const s = a.tiles.map(hr);
|
|
4591
4636
|
return {
|
|
4592
4637
|
...a,
|
|
4593
4638
|
tiles: s
|
|
4594
4639
|
};
|
|
4595
4640
|
}
|
|
4596
|
-
const t = a.tiles.map(
|
|
4641
|
+
const t = a.tiles.map(lr).filter((s) => s !== void 0), i = ur(t);
|
|
4597
4642
|
return {
|
|
4598
4643
|
...a,
|
|
4599
4644
|
tiles: i
|
|
4600
4645
|
};
|
|
4601
4646
|
};
|
|
4602
4647
|
export {
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4648
|
+
ls as C,
|
|
4649
|
+
mt as D,
|
|
4650
|
+
Dt as E,
|
|
4651
|
+
cs as F,
|
|
4652
|
+
js as G,
|
|
4608
4653
|
ve as I,
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4654
|
+
hs as T,
|
|
4655
|
+
pt as _,
|
|
4656
|
+
Be as a,
|
|
4657
|
+
us as b,
|
|
4658
|
+
wr as c,
|
|
4659
|
+
Er as d,
|
|
4660
|
+
ds as e,
|
|
4661
|
+
xr as f
|
|
4617
4662
|
};
|