@kong-ui-public/dashboard-renderer 8.12.14 → 8.12.16
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/README.md +20 -16
- package/dist/{GeoMapRenderer-azbs6_67.js → GeoMapRenderer-CDCvLcNv.js} +1 -1
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +5 -5
- package/dist/{index-B-sUo98c.js → index-DxrhvuyE.js} +1171 -1195
- package/dist/style.css +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts +18 -44
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts +18 -12
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTilePreview.vue.d.ts.map +1 -1
- package/dist/types/composables/useContextLinks.d.ts +4 -4
- package/dist/types/composables/useContextLinks.d.ts.map +1 -1
- package/dist/types/utils/configure-definition.d.ts.map +1 -1
- package/dist/types/utils/duplicate-tile.d.ts +1 -9
- package/dist/types/utils/duplicate-tile.d.ts.map +1 -1
- package/dist/types/utils/tile-definition.d.ts +3 -0
- package/dist/types/utils/tile-definition.d.ts.map +1 -0
- package/package.json +14 -14
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Ii = Object.defineProperty;
|
|
2
|
+
var Lt = (o) => {
|
|
3
|
+
throw TypeError(o);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var _ = (
|
|
8
|
-
var
|
|
5
|
+
var Mi = (o, e, t) => e in o ? Ii(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
6
|
+
var At = (o, e, t) => Mi(o, typeof e != "symbol" ? e + "" : e, t), ht = (o, e, t) => e.has(o) || Lt("Cannot " + t);
|
|
7
|
+
var _ = (o, e, t) => (ht(o, e, "read from private field"), t ? t.call(o) : e.get(o)), U = (o, e, t) => e.has(o) ? Lt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(o) : e.set(o, t), $ = (o, e, t, i) => (ht(o, e, "write to private field"), i ? i.call(o, t) : e.set(o, t), t), K = (o, e, t) => (ht(o, e, "access private method"), t);
|
|
8
|
+
var Le = (o, e, t, i) => ({
|
|
9
9
|
set _(s) {
|
|
10
|
-
$(
|
|
10
|
+
$(o, e, s, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return _(
|
|
13
|
+
return _(o, e, i);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { ref as
|
|
17
|
-
import { msToGranularity as
|
|
18
|
-
import { handleQueryError as
|
|
19
|
-
import
|
|
16
|
+
import { ref as H, watchEffect as Jt, inject as ge, provide as qi, toRaw as Pi, computed as E, isRef as $i, isReactive as Bi, toRef as Ae, hasInjectionContext as Ot, onMounted as st, watch as Oe, onUnmounted as Fe, getCurrentInstance as Fi, defineComponent as ee, resolveComponent as ue, unref as w, openBlock as C, createBlock as O, createSlots as rt, withCtx as q, createElementVNode as te, toDisplayString as J, renderSlot as He, createCommentVNode as X, normalizeStyle as Ye, normalizeClass as ze, createVNode as fe, mergeProps as ei, createTextVNode as gt, createElementBlock as B, normalizeProps as Gi, guardReactiveProps as Ui, defineAsyncComponent as ti, Fragment as mt, useCssVars as pt, useModel as ii, readonly as Ht, nextTick as yt, resolveDynamicComponent as si, toHandlers as Wi, mergeModels as je, renderList as ri, useTemplateRef as It } from "vue";
|
|
17
|
+
import { msToGranularity as dt, TimePeriods as Ki, TIMEFRAME_LOOKUP as Qi, formatTime as Mt, EXPORT_RECORD_LIMIT as Vi } from "@kong-ui-public/analytics-utilities";
|
|
18
|
+
import { handleQueryError as Yi, SimpleChart as ji, AnalyticsChart as Xi, TopNTable as Zi, CsvExportModal as Ji } from "@kong-ui-public/analytics-chart";
|
|
19
|
+
import es from "swrv";
|
|
20
20
|
import "axios";
|
|
21
|
-
import { createI18n as
|
|
22
|
-
import { useAnalyticsConfigStore as
|
|
23
|
-
import { VisibilityOffIcon as
|
|
24
|
-
import { MetricsProvider as
|
|
25
|
-
import { TableDataGrid as
|
|
26
|
-
var
|
|
27
|
-
const
|
|
21
|
+
import { createI18n as ts, i18nTComponent as is } from "@kong-ui-public/i18n";
|
|
22
|
+
import { useAnalyticsConfigStore as vt, useDatasourceConfigStore as nt } from "@kong-ui-public/analytics-config-store";
|
|
23
|
+
import { VisibilityOffIcon as ss, WarningOutlineIcon as rs, WarningIcon as ns, ProgressIcon as os, RefreshIcon as as, EditIcon as ls, MoreIcon as us } from "@kong/icons";
|
|
24
|
+
import { MetricsProvider as hs, MetricsConsumer as ds } from "@kong-ui-public/analytics-metric-provider";
|
|
25
|
+
import { TableDataGrid as cs } from "@kong-ui-public/table-data-grid";
|
|
26
|
+
var ni = /* @__PURE__ */ ((o) => (o.VALIDATING = "VALIDATING", o.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", o.PENDING = "PENDING", o.SUCCESS = "SUCCESS", o.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", o.ERROR = "ERROR", o.STALE_IF_ERROR = "STALE_IF_ERROR", o))(ni || {});
|
|
27
|
+
const fs = (o) => {
|
|
28
28
|
var e, t, i, s, r;
|
|
29
|
-
return
|
|
30
|
-
((e = Object.keys(
|
|
29
|
+
return o ? !!// TODO: revisit: currently only the first check ever matters?
|
|
30
|
+
((e = Object.keys(o)) != null && e.length || (t = o.data) != null && t.length || (s = (i = o.data) == null ? void 0 : i.data) != null && s.length || !((r = o.data) != null && r.data) && typeof o.data == "object" && Object.keys(o == null ? void 0 : o.data).length) : !1;
|
|
31
31
|
};
|
|
32
|
-
function
|
|
33
|
-
const s =
|
|
32
|
+
function gs(o = H({}), e, t, i = fs) {
|
|
33
|
+
const s = H(
|
|
34
34
|
"PENDING"
|
|
35
35
|
/* PENDING */
|
|
36
36
|
);
|
|
37
|
-
return
|
|
38
|
-
const r = i(
|
|
39
|
-
if (
|
|
37
|
+
return Jt(() => {
|
|
38
|
+
const r = i(o.value);
|
|
39
|
+
if (o.value && r && t.value) {
|
|
40
40
|
s.value = "VALIDATING_HAS_DATA";
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
if (
|
|
43
|
+
if (o.value && t.value) {
|
|
44
44
|
s.value = "VALIDATING";
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
if (
|
|
47
|
+
if (o.value && e.value) {
|
|
48
48
|
s.value = "STALE_IF_ERROR";
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
if (
|
|
51
|
+
if (o.value === void 0 && !e.value) {
|
|
52
52
|
s.value = "PENDING";
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
if (
|
|
55
|
+
if (o.value && !e.value && r) {
|
|
56
56
|
s.value = "SUCCESS_HAS_DATA";
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
if (
|
|
59
|
+
if (o.value && !e.value) {
|
|
60
60
|
s.value = "SUCCESS";
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
o.value === void 0 && e && (s.value = "ERROR");
|
|
64
64
|
}), {
|
|
65
65
|
state: s,
|
|
66
|
-
swrvState:
|
|
66
|
+
swrvState: ni
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const ms = {
|
|
70
70
|
not_configured: {
|
|
71
71
|
title: "Chart is not fully configured",
|
|
72
72
|
description: "Begin by choosing at least one metric"
|
|
@@ -85,10 +85,10 @@ const ps = {
|
|
|
85
85
|
remove: "Remove",
|
|
86
86
|
delete: "Delete",
|
|
87
87
|
as_of_today: "As of today"
|
|
88
|
-
},
|
|
88
|
+
}, ps = {
|
|
89
89
|
defaultFilename: "Chart export",
|
|
90
90
|
exportAsCsv: "Export as CSV"
|
|
91
|
-
},
|
|
91
|
+
}, ys = {
|
|
92
92
|
control_plane: "Control plane",
|
|
93
93
|
data_plane_node_version: "Data plane node version",
|
|
94
94
|
env: "Environment",
|
|
@@ -103,7 +103,7 @@ const ps = {
|
|
|
103
103
|
status_code: "Status code",
|
|
104
104
|
team: "Team",
|
|
105
105
|
name: "Name"
|
|
106
|
-
},
|
|
106
|
+
}, vs = "Explore", _s = "View requests", bs = "This tile was configured with {savedGranularity} granularity, which is no longer available. It now shows {currentGranularity} data, the closest available granularity.", ws = {
|
|
107
107
|
daily: "1 day",
|
|
108
108
|
fiveMinutely: "5 minutes",
|
|
109
109
|
hourly: "1 hour",
|
|
@@ -116,35 +116,35 @@ const ps = {
|
|
|
116
116
|
twoHourly: "2 hours",
|
|
117
117
|
weekly: "1 week",
|
|
118
118
|
unknown: "Unknown"
|
|
119
|
-
},
|
|
120
|
-
renderer:
|
|
121
|
-
csvExport:
|
|
122
|
-
chartLabels:
|
|
123
|
-
jumpToExplore:
|
|
124
|
-
jumpToRequests:
|
|
125
|
-
query_aged_out_warning:
|
|
126
|
-
granularities:
|
|
119
|
+
}, Es = {
|
|
120
|
+
renderer: ms,
|
|
121
|
+
csvExport: ps,
|
|
122
|
+
chartLabels: ys,
|
|
123
|
+
jumpToExplore: vs,
|
|
124
|
+
jumpToRequests: _s,
|
|
125
|
+
query_aged_out_warning: bs,
|
|
126
|
+
granularities: ws
|
|
127
127
|
};
|
|
128
|
-
function
|
|
129
|
-
const
|
|
128
|
+
function xs() {
|
|
129
|
+
const o = ts("en-us", Es);
|
|
130
130
|
return {
|
|
131
|
-
i18n:
|
|
132
|
-
i18nT:
|
|
131
|
+
i18n: o,
|
|
132
|
+
i18nT: is(o)
|
|
133
133
|
// Translation component <i18n-t>
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
138
|
-
const
|
|
136
|
+
const Ge = 170, _t = 6, ye = "analytics-query-provider", qt = "{entity-id}", Cs = "{cp-id}", Rs = "{timeframe}", ks = 30 * 1e3, Ts = 3e5, Ss = 36e5;
|
|
137
|
+
function Ds() {
|
|
138
|
+
const o = ge(ye);
|
|
139
139
|
return {
|
|
140
|
-
evaluateFeatureFlag: (t, i) =>
|
|
140
|
+
evaluateFeatureFlag: (t, i) => o ? o.evaluateFeatureFlagFn(t, i) : i
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
143
|
+
function zs(o) {
|
|
144
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
145
145
|
}
|
|
146
|
-
var
|
|
147
|
-
(function(
|
|
146
|
+
var oi = { exports: {} };
|
|
147
|
+
(function(o) {
|
|
148
148
|
var e = Object.prototype.hasOwnProperty, t = "~";
|
|
149
149
|
function i() {
|
|
150
150
|
}
|
|
@@ -155,10 +155,10 @@ var ri = { exports: {} };
|
|
|
155
155
|
function r(d, l, h, u, f) {
|
|
156
156
|
if (typeof h != "function")
|
|
157
157
|
throw new TypeError("The listener must be a function");
|
|
158
|
-
var
|
|
159
|
-
return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p],
|
|
158
|
+
var m = new s(h, u || d, f), p = t ? t + l : l;
|
|
159
|
+
return d._events[p] ? d._events[p].fn ? d._events[p] = [d._events[p], m] : d._events[p].push(m) : (d._events[p] = m, d._eventsCount++), d;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function a(d, l) {
|
|
162
162
|
--d._eventsCount === 0 ? d._events = new i() : delete d._events[l];
|
|
163
163
|
}
|
|
164
164
|
function n() {
|
|
@@ -174,54 +174,54 @@ var ri = { exports: {} };
|
|
|
174
174
|
var h = t ? t + l : l, u = this._events[h];
|
|
175
175
|
if (!u) return [];
|
|
176
176
|
if (u.fn) return [u.fn];
|
|
177
|
-
for (var f = 0,
|
|
177
|
+
for (var f = 0, m = u.length, p = new Array(m); f < m; f++)
|
|
178
178
|
p[f] = u[f].fn;
|
|
179
179
|
return p;
|
|
180
180
|
}, n.prototype.listenerCount = function(l) {
|
|
181
181
|
var h = t ? t + l : l, u = this._events[h];
|
|
182
182
|
return u ? u.fn ? 1 : u.length : 0;
|
|
183
|
-
}, n.prototype.emit = function(l, h, u, f,
|
|
183
|
+
}, n.prototype.emit = function(l, h, u, f, m, p) {
|
|
184
184
|
var y = t ? t + l : l;
|
|
185
185
|
if (!this._events[y]) return !1;
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
188
|
-
switch (
|
|
186
|
+
var g = this._events[y], k = arguments.length, N, v;
|
|
187
|
+
if (g.fn) {
|
|
188
|
+
switch (g.once && this.removeListener(l, g.fn, void 0, !0), k) {
|
|
189
189
|
case 1:
|
|
190
|
-
return
|
|
190
|
+
return g.fn.call(g.context), !0;
|
|
191
191
|
case 2:
|
|
192
|
-
return
|
|
192
|
+
return g.fn.call(g.context, h), !0;
|
|
193
193
|
case 3:
|
|
194
|
-
return
|
|
194
|
+
return g.fn.call(g.context, h, u), !0;
|
|
195
195
|
case 4:
|
|
196
|
-
return
|
|
196
|
+
return g.fn.call(g.context, h, u, f), !0;
|
|
197
197
|
case 5:
|
|
198
|
-
return
|
|
198
|
+
return g.fn.call(g.context, h, u, f, m), !0;
|
|
199
199
|
case 6:
|
|
200
|
-
return
|
|
200
|
+
return g.fn.call(g.context, h, u, f, m, p), !0;
|
|
201
201
|
}
|
|
202
|
-
for (
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
for (v = 1, N = new Array(k - 1); v < k; v++)
|
|
203
|
+
N[v - 1] = arguments[v];
|
|
204
|
+
g.fn.apply(g.context, N);
|
|
205
205
|
} else {
|
|
206
|
-
var
|
|
207
|
-
for (
|
|
208
|
-
switch (
|
|
206
|
+
var M = g.length, A;
|
|
207
|
+
for (v = 0; v < M; v++)
|
|
208
|
+
switch (g[v].once && this.removeListener(l, g[v].fn, void 0, !0), k) {
|
|
209
209
|
case 1:
|
|
210
|
-
|
|
210
|
+
g[v].fn.call(g[v].context);
|
|
211
211
|
break;
|
|
212
212
|
case 2:
|
|
213
|
-
|
|
213
|
+
g[v].fn.call(g[v].context, h);
|
|
214
214
|
break;
|
|
215
215
|
case 3:
|
|
216
|
-
|
|
216
|
+
g[v].fn.call(g[v].context, h, u);
|
|
217
217
|
break;
|
|
218
218
|
case 4:
|
|
219
|
-
|
|
219
|
+
g[v].fn.call(g[v].context, h, u, f);
|
|
220
220
|
break;
|
|
221
221
|
default:
|
|
222
|
-
if (!
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
if (!N) for (A = 1, N = new Array(k - 1); A < k; A++)
|
|
223
|
+
N[A - 1] = arguments[A];
|
|
224
|
+
g[v].fn.apply(g[v].context, N);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
return !0;
|
|
@@ -230,99 +230,99 @@ var ri = { exports: {} };
|
|
|
230
230
|
}, n.prototype.once = function(l, h, u) {
|
|
231
231
|
return r(this, l, h, u, !0);
|
|
232
232
|
}, n.prototype.removeListener = function(l, h, u, f) {
|
|
233
|
-
var
|
|
234
|
-
if (!this._events[
|
|
233
|
+
var m = t ? t + l : l;
|
|
234
|
+
if (!this._events[m]) return this;
|
|
235
235
|
if (!h)
|
|
236
|
-
return
|
|
237
|
-
var p = this._events[
|
|
236
|
+
return a(this, m), this;
|
|
237
|
+
var p = this._events[m];
|
|
238
238
|
if (p.fn)
|
|
239
|
-
p.fn === h && (!f || p.once) && (!u || p.context === u) &&
|
|
239
|
+
p.fn === h && (!f || p.once) && (!u || p.context === u) && a(this, m);
|
|
240
240
|
else {
|
|
241
|
-
for (var y = 0,
|
|
242
|
-
(p[y].fn !== h || f && !p[y].once || u && p[y].context !== u) &&
|
|
243
|
-
|
|
241
|
+
for (var y = 0, g = [], k = p.length; y < k; y++)
|
|
242
|
+
(p[y].fn !== h || f && !p[y].once || u && p[y].context !== u) && g.push(p[y]);
|
|
243
|
+
g.length ? this._events[m] = g.length === 1 ? g[0] : g : a(this, m);
|
|
244
244
|
}
|
|
245
245
|
return this;
|
|
246
246
|
}, n.prototype.removeAllListeners = function(l) {
|
|
247
247
|
var h;
|
|
248
|
-
return l ? (h = t ? t + l : l, this._events[h] &&
|
|
249
|
-
}, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n,
|
|
250
|
-
})(
|
|
251
|
-
var
|
|
252
|
-
const
|
|
253
|
-
class
|
|
248
|
+
return l ? (h = t ? t + l : l, this._events[h] && a(this, h)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
249
|
+
}, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n, o.exports = n;
|
|
250
|
+
})(oi);
|
|
251
|
+
var Ns = oi.exports;
|
|
252
|
+
const Ls = /* @__PURE__ */ zs(Ns);
|
|
253
|
+
class ai extends Error {
|
|
254
254
|
constructor(e) {
|
|
255
255
|
super(e), this.name = "TimeoutError";
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
class
|
|
258
|
+
class As extends Error {
|
|
259
259
|
constructor(e) {
|
|
260
260
|
super(), this.name = "AbortError", this.message = e;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
const
|
|
264
|
-
const e =
|
|
265
|
-
return e instanceof Error ? e :
|
|
263
|
+
const Pt = (o) => globalThis.DOMException === void 0 ? new As(o) : new DOMException(o), $t = (o) => {
|
|
264
|
+
const e = o.reason === void 0 ? Pt("This operation was aborted.") : o.reason;
|
|
265
|
+
return e instanceof Error ? e : Pt(e);
|
|
266
266
|
};
|
|
267
|
-
function
|
|
267
|
+
function Os(o, e) {
|
|
268
268
|
const {
|
|
269
269
|
milliseconds: t,
|
|
270
270
|
fallback: i,
|
|
271
271
|
message: s,
|
|
272
272
|
customTimers: r = { setTimeout, clearTimeout }
|
|
273
273
|
} = e;
|
|
274
|
-
let
|
|
274
|
+
let a, n;
|
|
275
275
|
const l = new Promise((h, u) => {
|
|
276
276
|
if (typeof t != "number" || Math.sign(t) !== 1)
|
|
277
277
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
278
278
|
if (e.signal) {
|
|
279
|
-
const { signal:
|
|
280
|
-
|
|
281
|
-
u(
|
|
282
|
-
},
|
|
279
|
+
const { signal: m } = e;
|
|
280
|
+
m.aborted && u($t(m)), n = () => {
|
|
281
|
+
u($t(m));
|
|
282
|
+
}, m.addEventListener("abort", n, { once: !0 });
|
|
283
283
|
}
|
|
284
284
|
if (t === Number.POSITIVE_INFINITY) {
|
|
285
|
-
|
|
285
|
+
o.then(h, u);
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
const f = new
|
|
289
|
-
|
|
288
|
+
const f = new ai();
|
|
289
|
+
a = r.setTimeout.call(void 0, () => {
|
|
290
290
|
if (i) {
|
|
291
291
|
try {
|
|
292
292
|
h(i());
|
|
293
|
-
} catch (
|
|
294
|
-
u(
|
|
293
|
+
} catch (m) {
|
|
294
|
+
u(m);
|
|
295
295
|
}
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
typeof
|
|
298
|
+
typeof o.cancel == "function" && o.cancel(), s === !1 ? h() : s instanceof Error ? u(s) : (f.message = s ?? `Promise timed out after ${t} milliseconds`, u(f));
|
|
299
299
|
}, t), (async () => {
|
|
300
300
|
try {
|
|
301
|
-
h(await
|
|
302
|
-
} catch (
|
|
303
|
-
u(
|
|
301
|
+
h(await o);
|
|
302
|
+
} catch (m) {
|
|
303
|
+
u(m);
|
|
304
304
|
}
|
|
305
305
|
})();
|
|
306
306
|
}).finally(() => {
|
|
307
307
|
l.clear(), n && e.signal && e.signal.removeEventListener("abort", n);
|
|
308
308
|
});
|
|
309
309
|
return l.clear = () => {
|
|
310
|
-
r.clearTimeout.call(void 0,
|
|
310
|
+
r.clearTimeout.call(void 0, a), a = void 0;
|
|
311
311
|
}, l;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
let i = 0, s =
|
|
313
|
+
function Hs(o, e, t) {
|
|
314
|
+
let i = 0, s = o.length;
|
|
315
315
|
for (; s > 0; ) {
|
|
316
316
|
const r = Math.trunc(s / 2);
|
|
317
|
-
let
|
|
318
|
-
t(a
|
|
317
|
+
let a = i + r;
|
|
318
|
+
t(o[a], e) <= 0 ? (i = ++a, s -= r + 1) : s = r;
|
|
319
319
|
}
|
|
320
320
|
return i;
|
|
321
321
|
}
|
|
322
|
-
var
|
|
323
|
-
class
|
|
322
|
+
var se;
|
|
323
|
+
class Is {
|
|
324
324
|
constructor() {
|
|
325
|
-
U(this,
|
|
325
|
+
U(this, se, []);
|
|
326
326
|
}
|
|
327
327
|
enqueue(e, t) {
|
|
328
328
|
t = {
|
|
@@ -334,83 +334,83 @@ class Ms {
|
|
|
334
334
|
id: t.id,
|
|
335
335
|
run: e
|
|
336
336
|
};
|
|
337
|
-
if (this.size === 0 || _(this,
|
|
338
|
-
_(this,
|
|
337
|
+
if (this.size === 0 || _(this, se)[this.size - 1].priority >= t.priority) {
|
|
338
|
+
_(this, se).push(i);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
const s =
|
|
342
|
-
_(this,
|
|
341
|
+
const s = Hs(_(this, se), i, (r, a) => a.priority - r.priority);
|
|
342
|
+
_(this, se).splice(s, 0, i);
|
|
343
343
|
}
|
|
344
344
|
setPriority(e, t) {
|
|
345
|
-
const i = _(this,
|
|
345
|
+
const i = _(this, se).findIndex((r) => r.id === e);
|
|
346
346
|
if (i === -1)
|
|
347
347
|
throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
|
|
348
|
-
const [s] = _(this,
|
|
348
|
+
const [s] = _(this, se).splice(i, 1);
|
|
349
349
|
this.enqueue(s.run, { priority: t, id: e });
|
|
350
350
|
}
|
|
351
351
|
dequeue() {
|
|
352
|
-
const e = _(this,
|
|
352
|
+
const e = _(this, se).shift();
|
|
353
353
|
return e == null ? void 0 : e.run;
|
|
354
354
|
}
|
|
355
355
|
filter(e) {
|
|
356
|
-
return _(this,
|
|
356
|
+
return _(this, se).filter((t) => t.priority === e.priority).map((t) => t.run);
|
|
357
357
|
}
|
|
358
358
|
get size() {
|
|
359
|
-
return _(this,
|
|
359
|
+
return _(this, se).length;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
|
|
363
|
-
var
|
|
364
|
-
class
|
|
362
|
+
se = new WeakMap();
|
|
363
|
+
var Re, ke, _e, qe, Te, Pe, re, Se, Z, $e, ne, De, pe, Be, it, L, li, ui, hi, di, ci, Ke, ct, ft, Qe, fi, Ve;
|
|
364
|
+
class Ms extends Ls {
|
|
365
365
|
// TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
|
|
366
366
|
constructor(t) {
|
|
367
367
|
var i, s;
|
|
368
368
|
super();
|
|
369
|
-
U(this,
|
|
370
|
-
U(this, xe);
|
|
371
|
-
U(this, Ce);
|
|
372
|
-
U(this, ve, 0);
|
|
373
|
-
U(this, He);
|
|
369
|
+
U(this, L);
|
|
374
370
|
U(this, Re);
|
|
375
|
-
U(this, Ie, 0);
|
|
376
|
-
U(this, ne);
|
|
377
371
|
U(this, ke);
|
|
372
|
+
U(this, _e, 0);
|
|
373
|
+
U(this, qe);
|
|
374
|
+
U(this, Te);
|
|
375
|
+
U(this, Pe, 0);
|
|
376
|
+
U(this, re);
|
|
377
|
+
U(this, Se);
|
|
378
378
|
U(this, Z);
|
|
379
|
-
U(this,
|
|
380
|
-
U(this,
|
|
379
|
+
U(this, $e);
|
|
380
|
+
U(this, ne, 0);
|
|
381
381
|
// The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
|
|
382
|
-
U(this,
|
|
382
|
+
U(this, De);
|
|
383
383
|
U(this, pe);
|
|
384
|
-
U(this,
|
|
384
|
+
U(this, Be);
|
|
385
385
|
// Use to assign a unique identifier to a promise function, if not explicitly specified
|
|
386
|
-
U(this,
|
|
386
|
+
U(this, it, 1n);
|
|
387
387
|
/**
|
|
388
388
|
Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
|
|
389
389
|
|
|
390
390
|
Applies to each future operation.
|
|
391
391
|
*/
|
|
392
|
-
|
|
392
|
+
At(this, "timeout");
|
|
393
393
|
if (t = {
|
|
394
394
|
carryoverConcurrencyCount: !1,
|
|
395
395
|
intervalCap: Number.POSITIVE_INFINITY,
|
|
396
396
|
interval: 0,
|
|
397
397
|
concurrency: Number.POSITIVE_INFINITY,
|
|
398
398
|
autoStart: !0,
|
|
399
|
-
queueClass:
|
|
399
|
+
queueClass: Is,
|
|
400
400
|
...t
|
|
401
401
|
}, !(typeof t.intervalCap == "number" && t.intervalCap >= 1))
|
|
402
402
|
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})`);
|
|
403
403
|
if (t.interval === void 0 || !(Number.isFinite(t.interval) && t.interval >= 0))
|
|
404
404
|
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((s = t.interval) == null ? void 0 : s.toString()) ?? ""}\` (${typeof t.interval})`);
|
|
405
|
-
$(this,
|
|
405
|
+
$(this, Re, t.carryoverConcurrencyCount), $(this, ke, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), $(this, qe, t.intervalCap), $(this, Te, t.interval), $(this, Z, new t.queueClass()), $(this, $e, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, $(this, Be, t.throwOnTimeout === !0), $(this, pe, t.autoStart === !1);
|
|
406
406
|
}
|
|
407
407
|
get concurrency() {
|
|
408
|
-
return _(this,
|
|
408
|
+
return _(this, De);
|
|
409
409
|
}
|
|
410
410
|
set concurrency(t) {
|
|
411
411
|
if (!(typeof t == "number" && t >= 1))
|
|
412
412
|
throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);
|
|
413
|
-
$(this,
|
|
413
|
+
$(this, De, t), K(this, L, Qe).call(this);
|
|
414
414
|
}
|
|
415
415
|
/**
|
|
416
416
|
Updates the priority of a promise function by its id, affecting its execution order. Requires a defined concurrency limit to take effect.
|
|
@@ -452,30 +452,30 @@ class qs extends As {
|
|
|
452
452
|
_(this, Z).setPriority(t, i);
|
|
453
453
|
}
|
|
454
454
|
async add(t, i = {}) {
|
|
455
|
-
return i.id ?? (i.id = (
|
|
455
|
+
return i.id ?? (i.id = (Le(this, it)._++).toString()), i = {
|
|
456
456
|
timeout: this.timeout,
|
|
457
|
-
throwOnTimeout: _(this,
|
|
457
|
+
throwOnTimeout: _(this, Be),
|
|
458
458
|
...i
|
|
459
459
|
}, new Promise((s, r) => {
|
|
460
460
|
_(this, Z).enqueue(async () => {
|
|
461
|
-
var
|
|
462
|
-
|
|
461
|
+
var a;
|
|
462
|
+
Le(this, ne)._++;
|
|
463
463
|
try {
|
|
464
|
-
(
|
|
464
|
+
(a = i.signal) == null || a.throwIfAborted(), Le(this, _e)._++;
|
|
465
465
|
let n = t({ signal: i.signal });
|
|
466
|
-
i.timeout && (n =
|
|
466
|
+
i.timeout && (n = Os(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, K(this, L, fi).call(this, i.signal)]));
|
|
467
467
|
const d = await n;
|
|
468
468
|
s(d), this.emit("completed", d);
|
|
469
469
|
} catch (n) {
|
|
470
|
-
if (n instanceof
|
|
470
|
+
if (n instanceof ai && !i.throwOnTimeout) {
|
|
471
471
|
s();
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
474
|
r(n), this.emit("error", n);
|
|
475
475
|
} finally {
|
|
476
|
-
K(this,
|
|
476
|
+
K(this, L, hi).call(this);
|
|
477
477
|
}
|
|
478
|
-
}, i), this.emit("add"), K(this,
|
|
478
|
+
}, i), this.emit("add"), K(this, L, Ke).call(this);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
async addAll(t, i) {
|
|
@@ -485,7 +485,7 @@ class qs extends As {
|
|
|
485
485
|
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.)
|
|
486
486
|
*/
|
|
487
487
|
start() {
|
|
488
|
-
return _(this, pe) ? ($(this, pe, !1), K(this,
|
|
488
|
+
return _(this, pe) ? ($(this, pe, !1), K(this, L, Qe).call(this), this) : this;
|
|
489
489
|
}
|
|
490
490
|
/**
|
|
491
491
|
Put queue execution on hold.
|
|
@@ -497,7 +497,7 @@ class qs extends As {
|
|
|
497
497
|
Clear the queue.
|
|
498
498
|
*/
|
|
499
499
|
clear() {
|
|
500
|
-
$(this, Z, new (_(this,
|
|
500
|
+
$(this, Z, new (_(this, $e))());
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -505,7 +505,7 @@ class qs extends As {
|
|
|
505
505
|
@returns A promise that settles when the queue becomes empty.
|
|
506
506
|
*/
|
|
507
507
|
async onEmpty() {
|
|
508
|
-
_(this, Z).size !== 0 && await K(this,
|
|
508
|
+
_(this, Z).size !== 0 && await K(this, L, Ve).call(this, "empty");
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -515,7 +515,7 @@ class qs extends As {
|
|
|
515
515
|
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.
|
|
516
516
|
*/
|
|
517
517
|
async onSizeLessThan(t) {
|
|
518
|
-
_(this, Z).size < t || await K(this,
|
|
518
|
+
_(this, Z).size < t || await K(this, L, Ve).call(this, "next", () => _(this, Z).size < t);
|
|
519
519
|
}
|
|
520
520
|
/**
|
|
521
521
|
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.
|
|
@@ -523,7 +523,7 @@ class qs extends As {
|
|
|
523
523
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
524
524
|
*/
|
|
525
525
|
async onIdle() {
|
|
526
|
-
_(this,
|
|
526
|
+
_(this, ne) === 0 && _(this, Z).size === 0 || await K(this, L, Ve).call(this, "idle");
|
|
527
527
|
}
|
|
528
528
|
/**
|
|
529
529
|
Size of the queue, the number of queued items waiting to run.
|
|
@@ -543,7 +543,7 @@ class qs extends As {
|
|
|
543
543
|
Number of running items (no longer in the queue).
|
|
544
544
|
*/
|
|
545
545
|
get pending() {
|
|
546
|
-
return _(this,
|
|
546
|
+
return _(this, ne);
|
|
547
547
|
}
|
|
548
548
|
/**
|
|
549
549
|
Whether the queue is currently paused.
|
|
@@ -552,50 +552,50 @@ class qs extends As {
|
|
|
552
552
|
return _(this, pe);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
|
|
556
|
-
return _(this,
|
|
557
|
-
}, ai = function() {
|
|
558
|
-
return _(this, oe) < _(this, Te);
|
|
559
|
-
}, li = function() {
|
|
560
|
-
ze(this, oe)._--, K(this, N, Ke).call(this), this.emit("next");
|
|
555
|
+
Re = new WeakMap(), ke = new WeakMap(), _e = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), Pe = new WeakMap(), re = new WeakMap(), Se = new WeakMap(), Z = new WeakMap(), $e = new WeakMap(), ne = new WeakMap(), De = new WeakMap(), pe = new WeakMap(), Be = new WeakMap(), it = new WeakMap(), L = new WeakSet(), li = function() {
|
|
556
|
+
return _(this, ke) || _(this, _e) < _(this, qe);
|
|
561
557
|
}, ui = function() {
|
|
562
|
-
|
|
558
|
+
return _(this, ne) < _(this, De);
|
|
563
559
|
}, hi = function() {
|
|
560
|
+
Le(this, ne)._--, K(this, L, Ke).call(this), this.emit("next");
|
|
561
|
+
}, di = function() {
|
|
562
|
+
K(this, L, ft).call(this), K(this, L, ct).call(this), $(this, Se, void 0);
|
|
563
|
+
}, ci = function() {
|
|
564
564
|
const t = Date.now();
|
|
565
|
-
if (_(this,
|
|
566
|
-
const i = _(this,
|
|
565
|
+
if (_(this, re) === void 0) {
|
|
566
|
+
const i = _(this, Pe) - t;
|
|
567
567
|
if (i < 0)
|
|
568
|
-
$(this,
|
|
568
|
+
$(this, _e, _(this, Re) ? _(this, ne) : 0);
|
|
569
569
|
else
|
|
570
|
-
return _(this,
|
|
571
|
-
K(this,
|
|
570
|
+
return _(this, Se) === void 0 && $(this, Se, setTimeout(() => {
|
|
571
|
+
K(this, L, di).call(this);
|
|
572
572
|
}, i)), !0;
|
|
573
573
|
}
|
|
574
574
|
return !1;
|
|
575
575
|
}, Ke = function() {
|
|
576
576
|
if (_(this, Z).size === 0)
|
|
577
|
-
return _(this,
|
|
577
|
+
return _(this, re) && clearInterval(_(this, re)), $(this, re, void 0), this.emit("empty"), _(this, ne) === 0 && this.emit("idle"), !1;
|
|
578
578
|
if (!_(this, pe)) {
|
|
579
|
-
const t = !_(this,
|
|
580
|
-
if (_(this,
|
|
579
|
+
const t = !_(this, L, ci);
|
|
580
|
+
if (_(this, L, li) && _(this, L, ui)) {
|
|
581
581
|
const i = _(this, Z).dequeue();
|
|
582
|
-
return i ? (this.emit("active"), i(), t && K(this,
|
|
582
|
+
return i ? (this.emit("active"), i(), t && K(this, L, ct).call(this), !0) : !1;
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
return !1;
|
|
586
|
+
}, ct = function() {
|
|
587
|
+
_(this, ke) || _(this, re) !== void 0 || ($(this, re, setInterval(() => {
|
|
588
|
+
K(this, L, ft).call(this);
|
|
589
|
+
}, _(this, Te))), $(this, Pe, Date.now() + _(this, Te)));
|
|
586
590
|
}, ft = function() {
|
|
587
|
-
_(this,
|
|
588
|
-
K(this, N, gt).call(this);
|
|
589
|
-
}, _(this, Re))), $(this, Ie, Date.now() + _(this, Re)));
|
|
590
|
-
}, gt = function() {
|
|
591
|
-
_(this, ve) === 0 && _(this, oe) === 0 && _(this, ne) && (clearInterval(_(this, ne)), $(this, ne, void 0)), $(this, ve, _(this, xe) ? _(this, oe) : 0), K(this, N, Qe).call(this);
|
|
591
|
+
_(this, _e) === 0 && _(this, ne) === 0 && _(this, re) && (clearInterval(_(this, re)), $(this, re, void 0)), $(this, _e, _(this, Re) ? _(this, ne) : 0), K(this, L, Qe).call(this);
|
|
592
592
|
}, /**
|
|
593
593
|
Executes all queued functions until it reaches the limit.
|
|
594
594
|
*/
|
|
595
595
|
Qe = function() {
|
|
596
|
-
for (; K(this,
|
|
596
|
+
for (; K(this, L, Ke).call(this); )
|
|
597
597
|
;
|
|
598
|
-
},
|
|
598
|
+
}, fi = async function(t) {
|
|
599
599
|
return new Promise((i, s) => {
|
|
600
600
|
t.addEventListener("abort", () => {
|
|
601
601
|
s(t.reason);
|
|
@@ -609,159 +609,171 @@ Qe = function() {
|
|
|
609
609
|
this.on(t, r);
|
|
610
610
|
});
|
|
611
611
|
};
|
|
612
|
-
const
|
|
613
|
-
const
|
|
612
|
+
const qs = () => {
|
|
613
|
+
const o = vt(), e = ge(ye);
|
|
614
614
|
if (!e)
|
|
615
615
|
return;
|
|
616
616
|
if (e.queryFnOverride) {
|
|
617
617
|
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.");
|
|
618
618
|
return;
|
|
619
619
|
}
|
|
620
|
-
const t = new
|
|
620
|
+
const t = new Ms({
|
|
621
621
|
carryoverConcurrencyCount: !0,
|
|
622
|
-
concurrency:
|
|
623
|
-
interval:
|
|
624
|
-
intervalCap:
|
|
622
|
+
concurrency: o.maxParallelRequests,
|
|
623
|
+
interval: o.requestInterval,
|
|
624
|
+
intervalCap: o.requestIntervalCap
|
|
625
625
|
}), i = {
|
|
626
626
|
...e,
|
|
627
627
|
queryFnOverride: !0,
|
|
628
628
|
queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
|
|
629
629
|
};
|
|
630
|
-
|
|
630
|
+
qi(ye, i);
|
|
631
631
|
};
|
|
632
632
|
/*!
|
|
633
633
|
* pinia v3.0.4
|
|
634
634
|
* (c) 2025 Eduardo San Martin Morote
|
|
635
635
|
* @license MIT
|
|
636
636
|
*/
|
|
637
|
-
const
|
|
638
|
-
let
|
|
637
|
+
const Ps = typeof window < "u";
|
|
638
|
+
let Bt;
|
|
639
639
|
process.env.NODE_ENV;
|
|
640
|
-
const
|
|
640
|
+
const Ft = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
|
|
641
641
|
/* istanbul ignore next */
|
|
642
642
|
Symbol()
|
|
643
643
|
);
|
|
644
|
-
var
|
|
645
|
-
(function(
|
|
646
|
-
|
|
647
|
-
})(
|
|
644
|
+
var Gt;
|
|
645
|
+
(function(o) {
|
|
646
|
+
o.direct = "direct", o.patchObject = "patch object", o.patchFunction = "patch function";
|
|
647
|
+
})(Gt || (Gt = {}));
|
|
648
648
|
process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
|
|
649
649
|
/* istanbul ignore next */
|
|
650
650
|
Symbol()
|
|
651
651
|
);
|
|
652
|
-
function
|
|
653
|
-
const e =
|
|
652
|
+
function bt(o) {
|
|
653
|
+
const e = Pi(o), t = {};
|
|
654
654
|
for (const i in e) {
|
|
655
655
|
const s = e[i];
|
|
656
656
|
s.effect ? t[i] = // ...
|
|
657
|
-
|
|
658
|
-
get: () =>
|
|
657
|
+
E({
|
|
658
|
+
get: () => o[i],
|
|
659
659
|
set(r) {
|
|
660
|
-
|
|
660
|
+
o[i] = r;
|
|
661
661
|
}
|
|
662
|
-
}) : (
|
|
663
|
-
|
|
662
|
+
}) : ($i(s) || Bi(s)) && (t[i] = // ---
|
|
663
|
+
Ae(o, i));
|
|
664
664
|
}
|
|
665
665
|
return t;
|
|
666
666
|
}
|
|
667
|
-
const
|
|
667
|
+
const oe = (o) => (o == null ? void 0 : o.chart.type) === "table", $s = [
|
|
668
668
|
"basic",
|
|
669
669
|
"api_usage",
|
|
670
670
|
"llm_usage",
|
|
671
671
|
"agentic_usage",
|
|
672
672
|
"platform",
|
|
673
673
|
void 0
|
|
674
|
-
];
|
|
674
|
+
], Bs = (o) => $s.includes(o);
|
|
675
675
|
function Fs({
|
|
676
|
-
queryBridge:
|
|
676
|
+
queryBridge: o,
|
|
677
677
|
context: e,
|
|
678
678
|
definition: t,
|
|
679
679
|
chartData: i
|
|
680
680
|
}) {
|
|
681
|
-
const s =
|
|
682
|
-
|
|
683
|
-
var
|
|
684
|
-
s.value = await ((
|
|
681
|
+
const s = H(""), r = H(""), a = H(void 0), n = H(void 0), d = vt(), l = nt(), { stripUnknownFilters: h, loading: u } = bt(l), f = E(() => oe(t.value));
|
|
682
|
+
st(async () => {
|
|
683
|
+
var S, I;
|
|
684
|
+
s.value = await ((S = o == null ? void 0 : o.exploreBaseUrl) == null ? void 0 : S.call(o)) ?? "", r.value = await ((I = o == null ? void 0 : o.requestsBaseUrl) == null ? void 0 : I.call(o)) ?? "";
|
|
685
685
|
});
|
|
686
|
-
const
|
|
687
|
-
const
|
|
688
|
-
return ["golden_signals", "gauge"].includes(
|
|
689
|
-
}),
|
|
690
|
-
var
|
|
691
|
-
const
|
|
686
|
+
const m = E(() => d.analytics && d.percentiles), p = E(() => {
|
|
687
|
+
const S = t.value.chart.type;
|
|
688
|
+
return ["golden_signals", "gauge"].includes(S) ? !1 : S === "top_n" ? e.value.editable || e.value.showTileActions : !0;
|
|
689
|
+
}), y = E(() => r.value && t.value.query && !f.value && t.value.query.datasource !== "llm_usage" && t.value.query.datasource !== "platform" && m.value && !u.value), g = E(() => s.value && t.value.query && Bs(t.value.query.datasource) && m.value && !u.value), k = E(() => i.value ? dt(i.value.meta.granularity_ms) : void 0), N = E(() => {
|
|
690
|
+
var z;
|
|
691
|
+
const S = t.value, I = [...e.value.filters, ...S.query.filters ?? []], Q = "metrics" in S.query ? S.query.metrics : void 0, D = ((z = S.query) == null ? void 0 : z.datasource) ?? "api_usage";
|
|
692
692
|
return h.value({
|
|
693
|
-
datasource:
|
|
694
|
-
filters:
|
|
695
|
-
metrics:
|
|
693
|
+
datasource: D,
|
|
694
|
+
filters: I,
|
|
695
|
+
metrics: Q
|
|
696
696
|
});
|
|
697
|
-
}),
|
|
698
|
-
if (!
|
|
697
|
+
}), v = E(() => {
|
|
698
|
+
if (!g.value || !p.value)
|
|
699
|
+
return "";
|
|
700
|
+
const S = t.value;
|
|
701
|
+
if (oe(S))
|
|
702
|
+
return ve({
|
|
703
|
+
...S.query,
|
|
704
|
+
filters: N.value
|
|
705
|
+
});
|
|
706
|
+
const I = S.query.time_range || e.value.timeSpec, Q = Y(I, N.value);
|
|
707
|
+
return ve(Q);
|
|
708
|
+
}), M = E(() => {
|
|
709
|
+
if (!y.value || !p.value)
|
|
699
710
|
return "";
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
}), w = v(() => {
|
|
703
|
-
if (!p.value || !g.value)
|
|
711
|
+
const S = N.value, I = t.value;
|
|
712
|
+
if (oe(I))
|
|
704
713
|
return "";
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
|
|
714
|
+
const Q = le(
|
|
715
|
+
I.query.time_range || e.value.timeSpec,
|
|
716
|
+
S
|
|
708
717
|
);
|
|
709
|
-
return
|
|
710
|
-
}),
|
|
711
|
-
var
|
|
712
|
-
const
|
|
718
|
+
return A(Q);
|
|
719
|
+
}), A = (S) => y.value ? `${r.value}?q=${JSON.stringify(S)}` : "", le = (S, I) => {
|
|
720
|
+
var z, F, P, V;
|
|
721
|
+
const Q = (F = (z = i.value) == null ? void 0 : z.meta) != null && F.start ? new Date(i.value.meta.start) : void 0, D = (V = (P = i.value) == null ? void 0 : P.meta) != null && V.end ? new Date(i.value.meta.end) : void 0;
|
|
713
722
|
return {
|
|
714
|
-
filter:
|
|
723
|
+
filter: I,
|
|
715
724
|
timeframe: {
|
|
716
|
-
timePeriodsKey:
|
|
717
|
-
start:
|
|
718
|
-
end:
|
|
725
|
+
timePeriodsKey: S.type === "relative" ? S.time_range : "custom",
|
|
726
|
+
start: S.type === "absolute" ? Q : void 0,
|
|
727
|
+
end: S.type === "absolute" ? D : void 0
|
|
719
728
|
}
|
|
720
729
|
};
|
|
721
|
-
},
|
|
722
|
-
filter:
|
|
730
|
+
}, xe = (S, I) => ({
|
|
731
|
+
filter: I,
|
|
723
732
|
timeframe: {
|
|
724
|
-
timePeriodsKey:
|
|
725
|
-
start:
|
|
726
|
-
end:
|
|
733
|
+
timePeriodsKey: S.type === "relative" ? S.time_range : "custom",
|
|
734
|
+
start: S.type === "absolute" ? S.start : void 0,
|
|
735
|
+
end: S.type === "absolute" ? S.end : void 0
|
|
727
736
|
}
|
|
728
|
-
}),
|
|
729
|
-
const
|
|
737
|
+
}), Y = (S, I) => {
|
|
738
|
+
const Q = t.value;
|
|
739
|
+
if (oe(Q))
|
|
740
|
+
throw new Error("Cannot build a chart explore query for table chart definitions");
|
|
741
|
+
const D = [...Q.query.dimensions ?? []], z = [...Q.query.metrics ?? []];
|
|
730
742
|
return {
|
|
731
|
-
filters:
|
|
732
|
-
metrics:
|
|
733
|
-
dimensions:
|
|
734
|
-
time_range:
|
|
735
|
-
granularity:
|
|
743
|
+
filters: I,
|
|
744
|
+
metrics: z,
|
|
745
|
+
dimensions: D,
|
|
746
|
+
time_range: S,
|
|
747
|
+
granularity: Q.query.granularity || k.value || void 0
|
|
736
748
|
};
|
|
737
|
-
},
|
|
738
|
-
if (!
|
|
749
|
+
}, ve = (S) => {
|
|
750
|
+
if (!g.value)
|
|
739
751
|
return "";
|
|
740
|
-
const
|
|
741
|
-
return `${s.value}?q=${JSON.stringify(
|
|
752
|
+
const I = t.value.query.datasource && t.value.query.datasource !== "basic" ? t.value.query.datasource : "api_usage";
|
|
753
|
+
return `${s.value}?q=${JSON.stringify(S)}&d=${I}&c=${t.value.chart.type}`;
|
|
742
754
|
};
|
|
743
|
-
return
|
|
744
|
-
|
|
755
|
+
return Oe([y, g], ([S, I]) => {
|
|
756
|
+
S && (a.value = { href: "" }), I && (n.value = { href: "" });
|
|
745
757
|
}), {
|
|
746
|
-
exploreLinkKebabMenu:
|
|
747
|
-
requestsLinkKebabMenu:
|
|
748
|
-
canShowKebabMenu:
|
|
749
|
-
canGenerateRequestsLink:
|
|
750
|
-
canGenerateExploreLink:
|
|
751
|
-
requestsLinkZoomActions:
|
|
758
|
+
exploreLinkKebabMenu: v,
|
|
759
|
+
requestsLinkKebabMenu: M,
|
|
760
|
+
canShowKebabMenu: p,
|
|
761
|
+
canGenerateRequestsLink: y,
|
|
762
|
+
canGenerateExploreLink: g,
|
|
763
|
+
requestsLinkZoomActions: a,
|
|
752
764
|
exploreLinkZoomActions: n,
|
|
753
|
-
buildExploreQuery:
|
|
754
|
-
buildRequestsQueryZoomActions:
|
|
755
|
-
buildExploreLink:
|
|
756
|
-
buildRequestLink:
|
|
765
|
+
buildExploreQuery: Y,
|
|
766
|
+
buildRequestsQueryZoomActions: xe,
|
|
767
|
+
buildExploreLink: ve,
|
|
768
|
+
buildRequestLink: A
|
|
757
769
|
};
|
|
758
770
|
}
|
|
759
771
|
function Gs() {
|
|
760
|
-
const
|
|
761
|
-
return
|
|
772
|
+
const o = ge(ye), e = nt(), { stripUnknownFilters: t } = bt(e), i = new AbortController();
|
|
773
|
+
return Fe(() => {
|
|
762
774
|
i.abort();
|
|
763
|
-
}), { issueQuery: async (r,
|
|
764
|
-
if (!
|
|
775
|
+
}), { issueQuery: async (r, a, n) => {
|
|
776
|
+
if (!o)
|
|
765
777
|
throw new Error("Query bridge is not defined");
|
|
766
778
|
await e.isReady();
|
|
767
779
|
const {
|
|
@@ -772,56 +784,56 @@ function Gs() {
|
|
|
772
784
|
datasource: u,
|
|
773
785
|
filters: [
|
|
774
786
|
...r.filters ?? [],
|
|
775
|
-
...
|
|
787
|
+
...a.filters
|
|
776
788
|
],
|
|
777
789
|
metrics: r.metrics
|
|
778
790
|
});
|
|
779
|
-
let
|
|
780
|
-
|
|
781
|
-
...
|
|
782
|
-
tz:
|
|
783
|
-
}) :
|
|
784
|
-
...
|
|
785
|
-
tz:
|
|
791
|
+
let m = r.time_range;
|
|
792
|
+
m ? m.tz || (m = {
|
|
793
|
+
...m,
|
|
794
|
+
tz: a.tz
|
|
795
|
+
}) : m = {
|
|
796
|
+
...a.timeSpec,
|
|
797
|
+
tz: a.tz
|
|
786
798
|
};
|
|
787
799
|
const p = {
|
|
788
800
|
datasource: u,
|
|
789
801
|
query: {
|
|
790
802
|
...h,
|
|
791
|
-
time_range:
|
|
803
|
+
time_range: m,
|
|
792
804
|
filters: f,
|
|
793
805
|
limit: n ?? l
|
|
794
806
|
}
|
|
795
807
|
};
|
|
796
|
-
return
|
|
808
|
+
return o.queryFn(p, i);
|
|
797
809
|
} };
|
|
798
810
|
}
|
|
799
811
|
function Us({
|
|
800
|
-
context:
|
|
801
|
-
globalFilters: e =
|
|
802
|
-
isFullscreen: t =
|
|
803
|
-
preview: i =
|
|
812
|
+
context: o,
|
|
813
|
+
globalFilters: e = H([]),
|
|
814
|
+
isFullscreen: t = H(!1),
|
|
815
|
+
preview: i = H(!1)
|
|
804
816
|
}) {
|
|
805
|
-
const s =
|
|
817
|
+
const s = vt(), r = E(() => o.value.timeSpec ? o.value.timeSpec : {
|
|
806
818
|
type: "relative",
|
|
807
819
|
time_range: s.defaultQueryTimeForOrg
|
|
808
|
-
}),
|
|
809
|
-
var p, y,
|
|
810
|
-
let { tz: d, refreshInterval: l, editable: h, showTileActions: u } =
|
|
811
|
-
const f = [...
|
|
812
|
-
if (d || (d = new Intl.DateTimeFormat().resolvedOptions().timeZone), l === void 0 && (l =
|
|
813
|
-
let
|
|
820
|
+
}), a = E(() => {
|
|
821
|
+
var p, y, g;
|
|
822
|
+
let { tz: d, refreshInterval: l, editable: h, showTileActions: u } = o.value;
|
|
823
|
+
const f = [...o.value.filters ?? [], ...e.value];
|
|
824
|
+
if (d || (d = new Intl.DateTimeFormat().resolvedOptions().timeZone), l === void 0 && (l = ks), t.value) {
|
|
825
|
+
let k = !1;
|
|
814
826
|
if (r.value.type === "relative")
|
|
815
|
-
|
|
827
|
+
k = ["15m", "1h", "6h", "12h", "24h"].includes(r.value.time_range);
|
|
816
828
|
else {
|
|
817
|
-
const
|
|
818
|
-
|
|
829
|
+
const M = r.value.start.getTime(), A = r.value.end.getTime();
|
|
830
|
+
k = Math.abs(A - M) <= 864e5;
|
|
819
831
|
}
|
|
820
|
-
const
|
|
821
|
-
r.value.type === "absolute" && r.value.end.getTime() <
|
|
832
|
+
const N = (/* @__PURE__ */ new Date()).getTime();
|
|
833
|
+
r.value.type === "absolute" && r.value.end.getTime() < N || r.value.type === "relative" && ["previous_week", "previous_month"].includes(r.value.time_range) ? l = 0 : k ? l = Ts : l = Ss;
|
|
822
834
|
}
|
|
823
835
|
(h === void 0 || i.value) && (h = !1), u === void 0 && (u = !0);
|
|
824
|
-
const
|
|
836
|
+
const m = !i.value && !!((g = (y = (p = Fi()) == null ? void 0 : p.vnode) == null ? void 0 : y.props) != null && g.onTileTimeRangeZoom);
|
|
825
837
|
return {
|
|
826
838
|
filters: f,
|
|
827
839
|
tz: d,
|
|
@@ -830,22 +842,22 @@ function Us({
|
|
|
830
842
|
editable: h,
|
|
831
843
|
showTileActions: u && !i.value,
|
|
832
844
|
showTileZoomActions: !i.value,
|
|
833
|
-
zoomable:
|
|
845
|
+
zoomable: m
|
|
834
846
|
};
|
|
835
|
-
}), n =
|
|
847
|
+
}), n = E(() => !!o.value.timeSpec || !s.loading);
|
|
836
848
|
return {
|
|
837
|
-
internalContext:
|
|
849
|
+
internalContext: a,
|
|
838
850
|
queryReady: n
|
|
839
851
|
};
|
|
840
852
|
}
|
|
841
853
|
const ae = {
|
|
842
854
|
useContextLinks: Fs,
|
|
843
855
|
useDashboardInternalContext: Us,
|
|
844
|
-
useEvaluateFeatureFlag:
|
|
845
|
-
useI18n:
|
|
856
|
+
useEvaluateFeatureFlag: Ds,
|
|
857
|
+
useI18n: xs,
|
|
846
858
|
useIssueQuery: Gs,
|
|
847
|
-
useRequestQueue:
|
|
848
|
-
},
|
|
859
|
+
useRequestQueue: qs
|
|
860
|
+
}, wt = /* @__PURE__ */ ee({
|
|
849
861
|
__name: "QueryDataProvider",
|
|
850
862
|
props: {
|
|
851
863
|
context: {},
|
|
@@ -855,13 +867,13 @@ const ae = {
|
|
|
855
867
|
refreshCounter: {}
|
|
856
868
|
},
|
|
857
869
|
emits: ["chart-data", "queryComplete"],
|
|
858
|
-
setup(
|
|
859
|
-
const t =
|
|
870
|
+
setup(o, { emit: e }) {
|
|
871
|
+
const t = o, i = e, { i18n: s } = ae.useI18n(), { issueQuery: r } = ae.useIssueQuery(), a = ge(ye), n = () => t.queryReady && a ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, { data: d, error: l, isValidating: h } = es(n, async () => {
|
|
860
872
|
try {
|
|
861
|
-
const
|
|
862
|
-
return
|
|
863
|
-
} catch (
|
|
864
|
-
throw
|
|
873
|
+
const g = await r(t.query, t.context, t.limitOverride);
|
|
874
|
+
return m.value = null, g;
|
|
875
|
+
} catch (g) {
|
|
876
|
+
throw m.value = Yi(g), g;
|
|
865
877
|
} finally {
|
|
866
878
|
i("queryComplete");
|
|
867
879
|
}
|
|
@@ -869,45 +881,45 @@ const ae = {
|
|
|
869
881
|
refreshInterval: t.context.refreshInterval,
|
|
870
882
|
revalidateOnFocus: !1,
|
|
871
883
|
shouldRetryOnError: !1
|
|
872
|
-
}), { state: u, swrvState: f } =
|
|
873
|
-
return
|
|
874
|
-
|
|
875
|
-
}), (
|
|
876
|
-
var
|
|
877
|
-
const
|
|
878
|
-
return y.value || !
|
|
884
|
+
}), { state: u, swrvState: f } = gs(d, l, h), m = H(null), p = E(() => u.value === f.ERROR || !!m.value), y = E(() => !t.queryReady || u.value === f.PENDING);
|
|
885
|
+
return Oe([() => d.value, () => u.value], ([g, k]) => {
|
|
886
|
+
g && (k === "SUCCESS_HAS_DATA" || k === "SUCCESS") && i("chart-data", g);
|
|
887
|
+
}), (g, k) => {
|
|
888
|
+
var M;
|
|
889
|
+
const N = ue("KSkeleton"), v = ue("KEmptyState");
|
|
890
|
+
return y.value || !w(d) && !p.value ? (C(), O(N, {
|
|
879
891
|
key: 0,
|
|
880
892
|
class: "chart-skeleton",
|
|
881
893
|
type: "table"
|
|
882
|
-
})) : p.value ? (
|
|
894
|
+
})) : p.value ? (C(), O(v, {
|
|
883
895
|
key: 1,
|
|
884
896
|
"action-button-visible": !1,
|
|
885
897
|
"data-testid": "chart-empty-state"
|
|
886
|
-
},
|
|
887
|
-
icon:
|
|
888
|
-
var
|
|
898
|
+
}, rt({
|
|
899
|
+
icon: q(() => {
|
|
900
|
+
var A;
|
|
889
901
|
return [
|
|
890
|
-
((
|
|
902
|
+
((A = m.value) == null ? void 0 : A.type) === "forbidden" ? (C(), O(w(ss), { key: 0 })) : (C(), O(w(rs), { key: 1 }))
|
|
891
903
|
];
|
|
892
904
|
}),
|
|
893
|
-
title:
|
|
894
|
-
var
|
|
905
|
+
title: q(() => {
|
|
906
|
+
var A;
|
|
895
907
|
return [
|
|
896
|
-
te("p", null, J(((
|
|
908
|
+
te("p", null, J(((A = m.value) == null ? void 0 : A.message) || w(s).t("renderer.unexpectedError")), 1)
|
|
897
909
|
];
|
|
898
910
|
}),
|
|
899
911
|
_: 2
|
|
900
912
|
}, [
|
|
901
|
-
(
|
|
913
|
+
(M = m.value) != null && M.details ? {
|
|
902
914
|
name: "default",
|
|
903
|
-
fn:
|
|
904
|
-
te("p", null, J(
|
|
915
|
+
fn: q(() => [
|
|
916
|
+
te("p", null, J(m.value.details), 1)
|
|
905
917
|
]),
|
|
906
918
|
key: "0"
|
|
907
919
|
} : void 0
|
|
908
|
-
]), 1024)) :
|
|
920
|
+
]), 1024)) : w(d) ? He(g.$slots, "default", {
|
|
909
921
|
key: 2,
|
|
910
|
-
data:
|
|
922
|
+
data: w(d)
|
|
911
923
|
}) : X("", !0);
|
|
912
924
|
};
|
|
913
925
|
}
|
|
@@ -923,35 +935,35 @@ const ae = {
|
|
|
923
935
|
requestsLink: {},
|
|
924
936
|
exploreLink: {}
|
|
925
937
|
},
|
|
926
|
-
setup(
|
|
927
|
-
const e =
|
|
928
|
-
return (i, s) => (
|
|
929
|
-
context:
|
|
930
|
-
query:
|
|
931
|
-
"query-ready":
|
|
932
|
-
"refresh-counter":
|
|
938
|
+
setup(o) {
|
|
939
|
+
const e = o, t = E(() => e.chartOptions.type === "single_value");
|
|
940
|
+
return (i, s) => (C(), O(wt, {
|
|
941
|
+
context: o.context,
|
|
942
|
+
query: o.query,
|
|
943
|
+
"query-ready": o.queryReady,
|
|
944
|
+
"refresh-counter": o.refreshCounter
|
|
933
945
|
}, {
|
|
934
|
-
default:
|
|
946
|
+
default: q(({ data: r }) => [
|
|
935
947
|
te("div", {
|
|
936
|
-
class:
|
|
937
|
-
style:
|
|
948
|
+
class: ze(["analytics-chart", { "single-value": t.value }]),
|
|
949
|
+
style: Ye(t.value ? void 0 : { height: `${o.height}px` })
|
|
938
950
|
}, [
|
|
939
|
-
|
|
951
|
+
fe(w(ji), {
|
|
940
952
|
"chart-data": r,
|
|
941
|
-
"chart-options":
|
|
942
|
-
"synthetics-data-key": t.value ? void 0 :
|
|
953
|
+
"chart-options": o.chartOptions,
|
|
954
|
+
"synthetics-data-key": t.value ? void 0 : o.chartOptions.synthetics_data_key
|
|
943
955
|
}, null, 8, ["chart-data", "chart-options", "synthetics-data-key"])
|
|
944
956
|
], 6)
|
|
945
957
|
]),
|
|
946
958
|
_: 1
|
|
947
959
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
948
960
|
}
|
|
949
|
-
}),
|
|
950
|
-
const t =
|
|
961
|
+
}), be = (o, e) => {
|
|
962
|
+
const t = o.__vccOpts || o;
|
|
951
963
|
for (const [i, s] of e)
|
|
952
964
|
t[i] = s;
|
|
953
965
|
return t;
|
|
954
|
-
},
|
|
966
|
+
}, Ut = /* @__PURE__ */ be(Ws, [["__scopeId", "data-v-2cbfac70"]]), Ks = { class: "analytics-chart" }, Qs = /* @__PURE__ */ ee({
|
|
955
967
|
__name: "BaseAnalyticsChartRenderer",
|
|
956
968
|
props: {
|
|
957
969
|
query: {},
|
|
@@ -965,48 +977,48 @@ const ae = {
|
|
|
965
977
|
extraProps: {}
|
|
966
978
|
},
|
|
967
979
|
emits: ["edit-tile", "chart-data", "zoom-time-range", "view-requests", "select-chart-range"],
|
|
968
|
-
setup(
|
|
969
|
-
const t =
|
|
980
|
+
setup(o, { emit: e }) {
|
|
981
|
+
const t = o, i = e, { i18n: s } = ae.useI18n(), r = E(() => ({
|
|
970
982
|
type: t.chartOptions.type,
|
|
971
983
|
stacked: t.chartOptions.stacked ?? !1,
|
|
972
984
|
chartDatasetColors: t.chartOptions.chart_dataset_colors,
|
|
973
985
|
threshold: t.chartOptions.threshold,
|
|
974
986
|
hideTruncationWarning: t.query.limit !== void 0 && t.query.limit > 0
|
|
975
|
-
})),
|
|
987
|
+
})), a = E(() => t.context.zoomable), n = () => {
|
|
976
988
|
i("edit-tile");
|
|
977
989
|
}, d = (l) => {
|
|
978
990
|
i("chart-data", l);
|
|
979
991
|
};
|
|
980
992
|
return (l, h) => {
|
|
981
|
-
const u =
|
|
982
|
-
return
|
|
983
|
-
context:
|
|
984
|
-
query:
|
|
985
|
-
"query-ready":
|
|
986
|
-
"refresh-counter":
|
|
993
|
+
const u = ue("KDropdownItem");
|
|
994
|
+
return C(), O(wt, {
|
|
995
|
+
context: o.context,
|
|
996
|
+
query: o.query,
|
|
997
|
+
"query-ready": o.queryReady,
|
|
998
|
+
"refresh-counter": o.refreshCounter,
|
|
987
999
|
onChartData: d
|
|
988
1000
|
}, {
|
|
989
|
-
default:
|
|
1001
|
+
default: q(({ data: f }) => [
|
|
990
1002
|
te("div", Ks, [
|
|
991
|
-
|
|
1003
|
+
fe(w(Xi), ei({
|
|
992
1004
|
"chart-data": f,
|
|
993
1005
|
"chart-options": r.value,
|
|
994
|
-
"explore-link":
|
|
1006
|
+
"explore-link": o.exploreLink,
|
|
995
1007
|
"legend-position": "bottom",
|
|
996
|
-
"requests-link":
|
|
997
|
-
"synthetics-data-key":
|
|
998
|
-
"timeseries-zoom":
|
|
1008
|
+
"requests-link": o.requestsLink,
|
|
1009
|
+
"synthetics-data-key": o.chartOptions.synthetics_data_key,
|
|
1010
|
+
"timeseries-zoom": a.value,
|
|
999
1011
|
"tooltip-title": ""
|
|
1000
|
-
},
|
|
1001
|
-
onSelectChartRange: h[0] || (h[0] = (
|
|
1002
|
-
onZoomTimeRange: h[1] || (h[1] = (
|
|
1003
|
-
}),
|
|
1004
|
-
|
|
1012
|
+
}, o.extraProps, {
|
|
1013
|
+
onSelectChartRange: h[0] || (h[0] = (m) => i("select-chart-range", m)),
|
|
1014
|
+
onZoomTimeRange: h[1] || (h[1] = (m) => i("zoom-time-range", m))
|
|
1015
|
+
}), rt({ _: 2 }, [
|
|
1016
|
+
o.context.editable ? {
|
|
1005
1017
|
name: "menu-items",
|
|
1006
|
-
fn:
|
|
1007
|
-
|
|
1008
|
-
default:
|
|
1009
|
-
|
|
1018
|
+
fn: q(() => [
|
|
1019
|
+
fe(u, { onClick: n }, {
|
|
1020
|
+
default: q(() => [
|
|
1021
|
+
gt(J(w(s).t("renderer.edit")), 1)
|
|
1010
1022
|
]),
|
|
1011
1023
|
_: 1
|
|
1012
1024
|
})
|
|
@@ -1020,7 +1032,7 @@ const ae = {
|
|
|
1020
1032
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
1021
1033
|
};
|
|
1022
1034
|
}
|
|
1023
|
-
}),
|
|
1035
|
+
}), Et = /* @__PURE__ */ be(Qs, [["__scopeId", "data-v-e1e7f610"]]), Wt = /* @__PURE__ */ ee({
|
|
1024
1036
|
__name: "BarChartRenderer",
|
|
1025
1037
|
props: {
|
|
1026
1038
|
query: {},
|
|
@@ -1032,18 +1044,18 @@ const ae = {
|
|
|
1032
1044
|
requestsLink: {},
|
|
1033
1045
|
exploreLink: {}
|
|
1034
1046
|
},
|
|
1035
|
-
setup(
|
|
1036
|
-
return (e, t) => (
|
|
1037
|
-
"chart-options":
|
|
1038
|
-
context:
|
|
1047
|
+
setup(o) {
|
|
1048
|
+
return (e, t) => (C(), O(Et, {
|
|
1049
|
+
"chart-options": o.chartOptions,
|
|
1050
|
+
context: o.context,
|
|
1039
1051
|
"extra-props": { showAnnotations: !1 },
|
|
1040
|
-
height:
|
|
1041
|
-
query:
|
|
1042
|
-
"query-ready":
|
|
1043
|
-
"refresh-counter":
|
|
1052
|
+
height: o.height,
|
|
1053
|
+
query: o.query,
|
|
1054
|
+
"query-ready": o.queryReady,
|
|
1055
|
+
"refresh-counter": o.refreshCounter
|
|
1044
1056
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
1045
1057
|
}
|
|
1046
|
-
}),
|
|
1058
|
+
}), Kt = /* @__PURE__ */ ee({
|
|
1047
1059
|
__name: "TimeseriesChartRenderer",
|
|
1048
1060
|
props: {
|
|
1049
1061
|
query: {},
|
|
@@ -1056,17 +1068,17 @@ const ae = {
|
|
|
1056
1068
|
exploreLink: {}
|
|
1057
1069
|
},
|
|
1058
1070
|
emits: ["zoom-time-range", "select-chart-range"],
|
|
1059
|
-
setup(
|
|
1071
|
+
setup(o, { emit: e }) {
|
|
1060
1072
|
const t = e;
|
|
1061
|
-
return (i, s) => (
|
|
1062
|
-
"chart-options":
|
|
1063
|
-
context:
|
|
1064
|
-
"explore-link":
|
|
1065
|
-
height:
|
|
1066
|
-
query:
|
|
1067
|
-
"query-ready":
|
|
1068
|
-
"refresh-counter":
|
|
1069
|
-
"requests-link":
|
|
1073
|
+
return (i, s) => (C(), O(Et, {
|
|
1074
|
+
"chart-options": o.chartOptions,
|
|
1075
|
+
context: o.context,
|
|
1076
|
+
"explore-link": o.exploreLink,
|
|
1077
|
+
height: o.height,
|
|
1078
|
+
query: o.query,
|
|
1079
|
+
"query-ready": o.queryReady,
|
|
1080
|
+
"refresh-counter": o.refreshCounter,
|
|
1081
|
+
"requests-link": o.requestsLink,
|
|
1070
1082
|
onSelectChartRange: s[0] || (s[0] = (r) => t("select-chart-range", r)),
|
|
1071
1083
|
onZoomTimeRange: s[1] || (s[1] = (r) => t("zoom-time-range", r))
|
|
1072
1084
|
}, null, 8, ["chart-options", "context", "explore-link", "height", "query", "query-ready", "refresh-counter", "requests-link"]));
|
|
@@ -1083,8 +1095,8 @@ const ae = {
|
|
|
1083
1095
|
requestsLink: {},
|
|
1084
1096
|
exploreLink: {}
|
|
1085
1097
|
},
|
|
1086
|
-
setup(
|
|
1087
|
-
const e =
|
|
1098
|
+
setup(o) {
|
|
1099
|
+
const e = o, t = E(() => {
|
|
1088
1100
|
var s, r;
|
|
1089
1101
|
const i = (s = e.query) == null ? void 0 : s.datasource;
|
|
1090
1102
|
if (i && i !== "api_usage" && i !== "basic")
|
|
@@ -1101,27 +1113,27 @@ const ae = {
|
|
|
1101
1113
|
refreshCounter: e.refreshCounter
|
|
1102
1114
|
};
|
|
1103
1115
|
});
|
|
1104
|
-
return (i, s) => (
|
|
1105
|
-
class:
|
|
1116
|
+
return (i, s) => (C(), B("div", {
|
|
1117
|
+
class: ze(["metric-card-tile-wrapper", { titled: !!e.chartOptions.chart_title }])
|
|
1106
1118
|
}, [
|
|
1107
|
-
|
|
1108
|
-
default:
|
|
1109
|
-
|
|
1119
|
+
fe(w(hs), Gi(Ui(t.value)), {
|
|
1120
|
+
default: q(() => [
|
|
1121
|
+
fe(w(ds))
|
|
1110
1122
|
]),
|
|
1111
1123
|
_: 1
|
|
1112
1124
|
}, 16)
|
|
1113
1125
|
], 2));
|
|
1114
1126
|
}
|
|
1115
|
-
}), Ys = /* @__PURE__ */
|
|
1127
|
+
}), Ys = /* @__PURE__ */ be(Vs, [["__scopeId", "data-v-b77f52b8"]]), js = {
|
|
1116
1128
|
class: "fallback-entity-link",
|
|
1117
1129
|
"data-testid": "entity-link-parent"
|
|
1118
|
-
},
|
|
1130
|
+
}, Qt = /* @__PURE__ */ ee({
|
|
1119
1131
|
__name: "FallbackEntityLink",
|
|
1120
1132
|
props: {
|
|
1121
1133
|
entityLinkData: {}
|
|
1122
1134
|
},
|
|
1123
|
-
setup(
|
|
1124
|
-
return (e, t) => (
|
|
1135
|
+
setup(o) {
|
|
1136
|
+
return (e, t) => (C(), B("div", js, J(o.entityLinkData.label), 1));
|
|
1125
1137
|
}
|
|
1126
1138
|
}), Xs = { key: 0 }, Zs = { key: 1 }, Js = /* @__PURE__ */ ee({
|
|
1127
1139
|
__name: "TopNTableRenderer",
|
|
@@ -1135,48 +1147,48 @@ const ae = {
|
|
|
1135
1147
|
requestsLink: {},
|
|
1136
1148
|
exploreLink: {}
|
|
1137
1149
|
},
|
|
1138
|
-
setup(
|
|
1139
|
-
const e =
|
|
1150
|
+
setup(o) {
|
|
1151
|
+
const e = o, t = ge(ye), i = ti(async () => {
|
|
1140
1152
|
if (t != null && t.fetchComponent)
|
|
1141
1153
|
try {
|
|
1142
1154
|
return await t.fetchComponent("EntityLink");
|
|
1143
1155
|
} catch {
|
|
1144
|
-
return
|
|
1156
|
+
return Qt;
|
|
1145
1157
|
}
|
|
1146
|
-
return
|
|
1147
|
-
}), s =
|
|
1158
|
+
return Qt;
|
|
1159
|
+
}), s = E(() => !!e.chartOptions.entity_link || !!Object.keys(e.chartOptions.entity_links || {}).length), r = (l) => {
|
|
1148
1160
|
var u;
|
|
1149
1161
|
const h = e.chartOptions.entity_links;
|
|
1150
1162
|
return h && (h[l] || ((u = Object.entries(h).find(([f]) => f.toLowerCase() === l.toLowerCase())) == null ? void 0 : u[1])) || "";
|
|
1151
|
-
},
|
|
1163
|
+
}, a = (l) => {
|
|
1152
1164
|
var u, f;
|
|
1153
1165
|
const h = (f = (u = l.dimensions) == null ? void 0 : u[0]) == null ? void 0 : f.dimension;
|
|
1154
1166
|
return !h || h === l.dimension;
|
|
1155
|
-
}, n = (l) => r(l.dimension) ||
|
|
1167
|
+
}, n = (l) => r(l.dimension) || a(l) && e.chartOptions.entity_link || "", d = (l) => {
|
|
1156
1168
|
const h = n(l);
|
|
1157
1169
|
if (h)
|
|
1158
1170
|
if (l.id.includes(":")) {
|
|
1159
1171
|
const [u, f] = l.id.split(":");
|
|
1160
|
-
return h.replace(
|
|
1172
|
+
return h.replace(Cs, u).replace(qt, f);
|
|
1161
1173
|
} else
|
|
1162
|
-
return h.replace(
|
|
1174
|
+
return h.replace(qt, l.id);
|
|
1163
1175
|
return "";
|
|
1164
1176
|
};
|
|
1165
|
-
return (l, h) => (
|
|
1166
|
-
context:
|
|
1167
|
-
query:
|
|
1168
|
-
"query-ready":
|
|
1169
|
-
"refresh-counter":
|
|
1177
|
+
return (l, h) => (C(), O(wt, {
|
|
1178
|
+
context: o.context,
|
|
1179
|
+
query: o.query,
|
|
1180
|
+
"query-ready": o.queryReady,
|
|
1181
|
+
"refresh-counter": o.refreshCounter
|
|
1170
1182
|
}, {
|
|
1171
|
-
default:
|
|
1172
|
-
|
|
1183
|
+
default: q(({ data: u }) => [
|
|
1184
|
+
fe(w(Zi), {
|
|
1173
1185
|
data: u,
|
|
1174
|
-
"synthetics-data-key":
|
|
1175
|
-
},
|
|
1186
|
+
"synthetics-data-key": o.chartOptions.synthetics_data_key
|
|
1187
|
+
}, rt({ _: 2 }, [
|
|
1176
1188
|
s.value ? {
|
|
1177
1189
|
name: "name",
|
|
1178
|
-
fn:
|
|
1179
|
-
!f.isEmpty && n(f) ? (
|
|
1190
|
+
fn: q(({ record: f }) => [
|
|
1191
|
+
!f.isEmpty && n(f) ? (C(), O(w(i), {
|
|
1180
1192
|
key: 0,
|
|
1181
1193
|
"entity-link-data": {
|
|
1182
1194
|
id: f.id,
|
|
@@ -1184,8 +1196,8 @@ const ae = {
|
|
|
1184
1196
|
deleted: f.deleted
|
|
1185
1197
|
},
|
|
1186
1198
|
"external-link": d(f)
|
|
1187
|
-
}, null, 8, ["entity-link-data", "external-link"])) : (
|
|
1188
|
-
f.name === "empty" ? (
|
|
1199
|
+
}, null, 8, ["entity-link-data", "external-link"])) : (C(), B(mt, { key: 1 }, [
|
|
1200
|
+
f.name === "empty" ? (C(), B("i", Xs, J(f.name), 1)) : (C(), B("span", Zs, J(f.name), 1))
|
|
1189
1201
|
], 64))
|
|
1190
1202
|
]),
|
|
1191
1203
|
key: "0"
|
|
@@ -1195,13 +1207,13 @@ const ae = {
|
|
|
1195
1207
|
_: 1
|
|
1196
1208
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
1197
1209
|
}
|
|
1198
|
-
}), er = (
|
|
1210
|
+
}), er = (o) => o.records.map((e) => {
|
|
1199
1211
|
const t = { ...e };
|
|
1200
1212
|
return Object.entries(e).forEach(([i, s]) => {
|
|
1201
|
-
var
|
|
1213
|
+
var a, n, d;
|
|
1202
1214
|
if (s === null)
|
|
1203
1215
|
return;
|
|
1204
|
-
const r = (d = (n = (
|
|
1216
|
+
const r = (d = (n = (a = o.meta.display) == null ? void 0 : a[i]) == null ? void 0 : n[String(s)]) == null ? void 0 : d.name;
|
|
1205
1217
|
r && (t[i] = r);
|
|
1206
1218
|
}), t;
|
|
1207
1219
|
}), tr = {
|
|
@@ -1216,14 +1228,14 @@ const ae = {
|
|
|
1216
1228
|
* @returns TableDataGrid header definitions for the provided columns.
|
|
1217
1229
|
*/
|
|
1218
1230
|
platform: ({
|
|
1219
|
-
canTranslate:
|
|
1231
|
+
canTranslate: o,
|
|
1220
1232
|
columns: e,
|
|
1221
1233
|
translate: t
|
|
1222
1234
|
}) => e.map((i) => {
|
|
1223
1235
|
const s = `chartLabels.${i}`;
|
|
1224
1236
|
return {
|
|
1225
1237
|
key: i,
|
|
1226
|
-
label:
|
|
1238
|
+
label: o(s) ? t(s) : i
|
|
1227
1239
|
};
|
|
1228
1240
|
})
|
|
1229
1241
|
}, ir = {
|
|
@@ -1243,19 +1255,19 @@ const ae = {
|
|
|
1243
1255
|
* @returns A TableDataGrid page result with rows, the next cursor, and whether more pages are available.
|
|
1244
1256
|
*/
|
|
1245
1257
|
platform: async ({
|
|
1246
|
-
abortController:
|
|
1258
|
+
abortController: o,
|
|
1247
1259
|
context: e,
|
|
1248
1260
|
cursor: t,
|
|
1249
1261
|
pageSize: i,
|
|
1250
1262
|
query: s,
|
|
1251
1263
|
onResponseColumns: r,
|
|
1252
|
-
stripUnknownFilters:
|
|
1264
|
+
stripUnknownFilters: a,
|
|
1253
1265
|
tabularQueryFn: n
|
|
1254
1266
|
}) => {
|
|
1255
1267
|
var u;
|
|
1256
1268
|
if (!n)
|
|
1257
1269
|
throw new Error("AnalyticsBridge.tabularQueryFn is not defined");
|
|
1258
|
-
const d = s.query, l =
|
|
1270
|
+
const d = s.query, l = a({
|
|
1259
1271
|
datasource: "platform",
|
|
1260
1272
|
filters: [
|
|
1261
1273
|
...d.filters ?? [],
|
|
@@ -1270,7 +1282,7 @@ const ae = {
|
|
|
1270
1282
|
filters: l,
|
|
1271
1283
|
page_size: i
|
|
1272
1284
|
}
|
|
1273
|
-
},
|
|
1285
|
+
}, o);
|
|
1274
1286
|
return (u = h.meta.columns) != null && u.length && (r == null || r(h.meta.columns)), {
|
|
1275
1287
|
data: er(h),
|
|
1276
1288
|
cursor: h.meta.cursor,
|
|
@@ -1287,8 +1299,8 @@ const ae = {
|
|
|
1287
1299
|
refreshCounter: {}
|
|
1288
1300
|
},
|
|
1289
1301
|
emits: ["loading-change"],
|
|
1290
|
-
setup(
|
|
1291
|
-
const t =
|
|
1302
|
+
setup(o, { emit: e }) {
|
|
1303
|
+
const t = o, i = e, s = ge(ye), r = nt(), { i18n: a } = ae.useI18n(), n = new AbortController(), d = H([]), l = H(!1), h = E(() => t.height === void 0 ? void 0 : { height: `${t.height}px` }), u = E(() => ({
|
|
1292
1304
|
datasource: t.query.datasource,
|
|
1293
1305
|
query: {
|
|
1294
1306
|
columns: t.query.columns,
|
|
@@ -1298,58 +1310,58 @@ const ae = {
|
|
|
1298
1310
|
page_size: t.query.page_size
|
|
1299
1311
|
}
|
|
1300
1312
|
}));
|
|
1301
|
-
|
|
1313
|
+
Fe(() => {
|
|
1302
1314
|
n.abort();
|
|
1303
1315
|
});
|
|
1304
|
-
const f =
|
|
1316
|
+
const f = E(() => {
|
|
1305
1317
|
var y;
|
|
1306
1318
|
return tr[t.query.datasource]({
|
|
1307
1319
|
// query.columns are optional in the API. If not provided, backend will return default columns.
|
|
1308
1320
|
// If query columns are not provided, fallback to using columns from the response metadata for header configuration.
|
|
1309
1321
|
columns: (y = t.query.columns) != null && y.length ? t.query.columns : d.value,
|
|
1310
|
-
translate: (
|
|
1311
|
-
canTranslate: (
|
|
1322
|
+
translate: (g) => a.t(g),
|
|
1323
|
+
canTranslate: (g) => a.te(g)
|
|
1312
1324
|
});
|
|
1313
|
-
}),
|
|
1325
|
+
}), m = E(() => async ({ cursor: y, pageSize: g }) => {
|
|
1314
1326
|
try {
|
|
1315
1327
|
await r.isReady();
|
|
1316
|
-
const
|
|
1317
|
-
if (!
|
|
1328
|
+
const k = ir[u.value.datasource];
|
|
1329
|
+
if (!k)
|
|
1318
1330
|
throw new Error(`No table data grid fetcher found for datasource: ${u.value.datasource}`);
|
|
1319
|
-
const
|
|
1331
|
+
const N = await k({
|
|
1320
1332
|
abortController: n,
|
|
1321
1333
|
context: t.context,
|
|
1322
1334
|
cursor: y,
|
|
1323
|
-
pageSize:
|
|
1335
|
+
pageSize: g,
|
|
1324
1336
|
query: u.value,
|
|
1325
|
-
onResponseColumns: (
|
|
1326
|
-
d.value =
|
|
1337
|
+
onResponseColumns: (v) => {
|
|
1338
|
+
d.value = v;
|
|
1327
1339
|
},
|
|
1328
1340
|
stripUnknownFilters: r.stripUnknownFilters,
|
|
1329
1341
|
tabularQueryFn: s == null ? void 0 : s.tabularQueryFn
|
|
1330
1342
|
});
|
|
1331
|
-
return l.value = !1,
|
|
1332
|
-
} catch (
|
|
1333
|
-
throw l.value = !0,
|
|
1343
|
+
return l.value = !1, N;
|
|
1344
|
+
} catch (k) {
|
|
1345
|
+
throw l.value = !0, k;
|
|
1334
1346
|
}
|
|
1335
1347
|
}), p = (y) => {
|
|
1336
1348
|
y.state === "error" && (l.value = !0), i("loading-change", y.state === "loading");
|
|
1337
1349
|
};
|
|
1338
|
-
return (y,
|
|
1339
|
-
const
|
|
1340
|
-
return
|
|
1350
|
+
return (y, g) => {
|
|
1351
|
+
const k = ue("KSkeleton");
|
|
1352
|
+
return C(), B("div", {
|
|
1341
1353
|
class: "table-data-grid-renderer",
|
|
1342
|
-
style:
|
|
1354
|
+
style: Ye(h.value)
|
|
1343
1355
|
}, [
|
|
1344
|
-
|
|
1356
|
+
o.queryReady ? (C(), O(w(cs), {
|
|
1345
1357
|
key: 1,
|
|
1346
1358
|
error: l.value,
|
|
1347
|
-
fetcher:
|
|
1359
|
+
fetcher: m.value,
|
|
1348
1360
|
headers: f.value,
|
|
1349
|
-
"page-size":
|
|
1350
|
-
"refresh-key":
|
|
1361
|
+
"page-size": o.query.page_size,
|
|
1362
|
+
"refresh-key": o.refreshCounter,
|
|
1351
1363
|
onState: p
|
|
1352
|
-
}, null, 8, ["error", "fetcher", "headers", "page-size", "refresh-key"])) : (
|
|
1364
|
+
}, null, 8, ["error", "fetcher", "headers", "page-size", "refresh-key"])) : (C(), O(k, {
|
|
1353
1365
|
key: 0,
|
|
1354
1366
|
"data-testid": "table-skeleton",
|
|
1355
1367
|
type: "table"
|
|
@@ -1357,7 +1369,7 @@ const ae = {
|
|
|
1357
1369
|
], 4);
|
|
1358
1370
|
};
|
|
1359
1371
|
}
|
|
1360
|
-
}), rr = /* @__PURE__ */
|
|
1372
|
+
}), rr = /* @__PURE__ */ be(sr, [["__scopeId", "data-v-9127c323"]]), Vt = "#6c7489", nr = "12px", Yt = "20px", jt = "32px", gi = "20px", or = /* @__PURE__ */ ee({
|
|
1361
1373
|
__name: "DonutChartRenderer",
|
|
1362
1374
|
props: {
|
|
1363
1375
|
query: {},
|
|
@@ -1369,14 +1381,14 @@ const ae = {
|
|
|
1369
1381
|
requestsLink: {},
|
|
1370
1382
|
exploreLink: {}
|
|
1371
1383
|
},
|
|
1372
|
-
setup(
|
|
1373
|
-
return (e, t) => (
|
|
1374
|
-
"chart-options":
|
|
1375
|
-
context:
|
|
1376
|
-
height:
|
|
1377
|
-
query:
|
|
1378
|
-
"query-ready":
|
|
1379
|
-
"refresh-counter":
|
|
1384
|
+
setup(o) {
|
|
1385
|
+
return (e, t) => (C(), O(Et, {
|
|
1386
|
+
"chart-options": o.chartOptions,
|
|
1387
|
+
context: o.context,
|
|
1388
|
+
height: o.height,
|
|
1389
|
+
query: o.query,
|
|
1390
|
+
"query-ready": o.queryReady,
|
|
1391
|
+
"refresh-counter": o.refreshCounter
|
|
1380
1392
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
1381
1393
|
}
|
|
1382
1394
|
}), ar = ["data-testid"], lr = {
|
|
@@ -1384,10 +1396,10 @@ const ae = {
|
|
|
1384
1396
|
class: "tile-header"
|
|
1385
1397
|
}, ur = { class: "badge-container" }, hr = { class: "badge-text" }, dr = { key: 0 }, cr = ["data-testid"], fr = ["data-testid"], gr = { class: "delete-option" }, mr = ["data-testid"], pr = ["data-testid"], yr = /* @__PURE__ */ ee({
|
|
1386
1398
|
__name: "DashboardTile",
|
|
1387
|
-
props: /* @__PURE__ */
|
|
1399
|
+
props: /* @__PURE__ */ je({
|
|
1388
1400
|
context: {},
|
|
1389
1401
|
definition: {},
|
|
1390
|
-
height: { default:
|
|
1402
|
+
height: { default: Ge },
|
|
1391
1403
|
isFullscreen: { type: Boolean },
|
|
1392
1404
|
hideActions: { type: Boolean, default: !1 },
|
|
1393
1405
|
hideZoomActions: { type: Boolean, default: !1 },
|
|
@@ -1399,366 +1411,350 @@ const ae = {
|
|
|
1399
1411
|
refreshCounter: { default: 0 },
|
|
1400
1412
|
refreshCounterModifiers: {}
|
|
1401
1413
|
}),
|
|
1402
|
-
emits: /* @__PURE__ */
|
|
1403
|
-
setup(
|
|
1404
|
-
|
|
1405
|
-
|
|
1414
|
+
emits: /* @__PURE__ */ je(["chart-data", "edit-tile", "duplicate-tile", "remove-tile", "tile-time-range-zoom", "tile-bounds-change"], ["update:refreshCounter"]),
|
|
1415
|
+
setup(o, { expose: e, emit: t }) {
|
|
1416
|
+
pt((x) => ({
|
|
1417
|
+
v76e9feba: `${x.height}px`
|
|
1406
1418
|
}));
|
|
1407
|
-
const i = parseInt(
|
|
1408
|
-
|
|
1409
|
-
}, n = t, d =
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
buildExploreLink: kt,
|
|
1422
|
-
buildRequestLink: Ue,
|
|
1423
|
-
buildRequestsQueryZoomActions: mi
|
|
1419
|
+
const i = parseInt(gi, 10), s = o, r = ii(o, "refreshCounter"), a = () => {
|
|
1420
|
+
N.value = !0, r.value++;
|
|
1421
|
+
}, n = t, d = ti(() => import("./GeoMapRenderer-CDCvLcNv.js")), l = ge(ye), h = nt(), { stripUnknownFilters: u } = bt(h), { i18n: f } = ae.useI18n(), m = H(), p = H({ status: "loading" }), y = H(!1), g = H(), k = H(!1), N = H(!0), v = E(() => s.definition.chart), M = E(() => "chart_title" in v.value ? v.value.chart_title : void 0), A = E(() => "description" in v.value ? v.value.description : void 0), le = E(() => v.value.type === "slottable"), xe = E(() => oe(s.definition) ? !1 : !("allow_csv_export" in v.value) || v.value.allow_csv_export !== !1), {
|
|
1422
|
+
exploreLinkKebabMenu: Y,
|
|
1423
|
+
requestsLinkKebabMenu: ve,
|
|
1424
|
+
canShowKebabMenu: S,
|
|
1425
|
+
canGenerateRequestsLink: I,
|
|
1426
|
+
canGenerateExploreLink: Q,
|
|
1427
|
+
requestsLinkZoomActions: D,
|
|
1428
|
+
exploreLinkZoomActions: z,
|
|
1429
|
+
buildExploreQuery: F,
|
|
1430
|
+
buildExploreLink: P,
|
|
1431
|
+
buildRequestLink: V,
|
|
1432
|
+
buildRequestsQueryZoomActions: at
|
|
1424
1433
|
} = ae.useContextLinks({
|
|
1425
1434
|
queryBridge: l,
|
|
1426
|
-
chartData:
|
|
1427
|
-
definition:
|
|
1428
|
-
context:
|
|
1429
|
-
}), { issueQuery:
|
|
1430
|
-
|
|
1431
|
-
await
|
|
1435
|
+
chartData: Ht(m),
|
|
1436
|
+
definition: Ae(s, "definition"),
|
|
1437
|
+
context: Ht(Ae(s, "context"))
|
|
1438
|
+
}), { issueQuery: lt } = ae.useIssueQuery();
|
|
1439
|
+
Oe(() => s.definition, async (x, T) => {
|
|
1440
|
+
await yt(), g.value && (k.value = g.value.scrollWidth > g.value.clientWidth);
|
|
1432
1441
|
try {
|
|
1433
|
-
JSON.stringify(
|
|
1442
|
+
JSON.stringify(x == null ? void 0 : x.query) !== JSON.stringify(T == null ? void 0 : T.query) && (N.value = !0);
|
|
1434
1443
|
} catch {
|
|
1435
1444
|
}
|
|
1436
1445
|
}, { immediate: !0, deep: !0 });
|
|
1437
|
-
const
|
|
1438
|
-
timeseries_line:
|
|
1439
|
-
timeseries_bar:
|
|
1440
|
-
horizontal_bar:
|
|
1441
|
-
vertical_bar:
|
|
1442
|
-
gauge:
|
|
1446
|
+
const Ue = E(() => f.t("csvExport.defaultFilename")), We = E(() => !!Y.value || xe.value || s.context.editable), we = E(() => !s.hideActions && S.value && We.value), yi = E(() => we.value && We.value && !s.isFullscreen), vi = E(() => v.value.type === "golden_signals" && !!A.value), _i = {
|
|
1447
|
+
timeseries_line: Kt,
|
|
1448
|
+
timeseries_bar: Kt,
|
|
1449
|
+
horizontal_bar: Wt,
|
|
1450
|
+
vertical_bar: Wt,
|
|
1451
|
+
gauge: Ut,
|
|
1443
1452
|
donut: or,
|
|
1444
1453
|
golden_signals: Ys,
|
|
1445
1454
|
top_n: Js,
|
|
1455
|
+
table: rr,
|
|
1446
1456
|
slottable: void 0,
|
|
1447
|
-
single_value:
|
|
1457
|
+
single_value: Ut,
|
|
1448
1458
|
choropleth_map: d
|
|
1449
|
-
},
|
|
1450
|
-
var
|
|
1459
|
+
}, bi = E(() => {
|
|
1460
|
+
var x, T, G, W;
|
|
1451
1461
|
return {
|
|
1452
|
-
...(
|
|
1453
|
-
...(
|
|
1454
|
-
...(G =
|
|
1455
|
-
...(
|
|
1462
|
+
...(x = Ee.value) != null && x.rendererEvents.supportsRequests ? { "select-chart-range": Ai } : {},
|
|
1463
|
+
...(T = Ee.value) != null && T.rendererEvents.supportsZoom ? { "zoom-time-range": Ni } : {},
|
|
1464
|
+
...(G = Ee.value) != null && G.rendererEvents.supportsBounds ? { "bounds-change": Li } : {},
|
|
1465
|
+
...(W = Ee.value) != null && W.rendererEvents.supportsLoadingChange ? { "loading-change": Si } : {}
|
|
1456
1466
|
};
|
|
1457
|
-
}),
|
|
1458
|
-
var
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
supportsLoadingChange: !0
|
|
1473
|
-
}
|
|
1474
|
-
};
|
|
1475
|
-
const C = O.value, S = Ei[C.chart.type], G = !!((de = S == null ? void 0 : S.emits) != null && de.includes("select-chart-range")), Y = !!((we = S == null ? void 0 : S.emits) != null && we.includes("zoom-time-range")), De = C.chart.type === "choropleth_map";
|
|
1476
|
-
return S && {
|
|
1477
|
-
component: S,
|
|
1467
|
+
}), Ee = E(() => {
|
|
1468
|
+
var Dt, zt, Nt;
|
|
1469
|
+
const x = s.definition, T = _i[x.chart.type], G = oe(x), W = !!((Dt = T == null ? void 0 : T.emits) != null && Dt.includes("select-chart-range")), Ne = !!((zt = T == null ? void 0 : T.emits) != null && zt.includes("zoom-time-range")), me = x.chart.type === "choropleth_map", Ce = !!((Nt = T == null ? void 0 : T.emits) != null && Nt.includes("loading-change")), Oi = {
|
|
1470
|
+
query: x.query,
|
|
1471
|
+
context: s.context,
|
|
1472
|
+
queryReady: s.queryReady,
|
|
1473
|
+
height: s.height - i * 2,
|
|
1474
|
+
refreshCounter: r.value
|
|
1475
|
+
}, Hi = {
|
|
1476
|
+
chartOptions: x.chart,
|
|
1477
|
+
requestsLink: s.hideZoomActions ? void 0 : D.value,
|
|
1478
|
+
exploreLink: s.hideZoomActions ? void 0 : z.value
|
|
1479
|
+
};
|
|
1480
|
+
return T && {
|
|
1481
|
+
component: T,
|
|
1478
1482
|
rendererProps: {
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
queryReady: s.queryReady,
|
|
1482
|
-
chartOptions: C.chart,
|
|
1483
|
-
height: s.height - i * 2,
|
|
1484
|
-
refreshCounter: r.value,
|
|
1485
|
-
requestsLink: s.hideZoomActions ? void 0 : Be.value,
|
|
1486
|
-
exploreLink: s.hideZoomActions ? void 0 : Fe.value
|
|
1483
|
+
...Oi,
|
|
1484
|
+
...G ? {} : Hi
|
|
1487
1485
|
},
|
|
1488
1486
|
rendererEvents: {
|
|
1489
|
-
supportsRequests:
|
|
1490
|
-
supportsZoom:
|
|
1491
|
-
supportsBounds:
|
|
1492
|
-
supportsLoadingChange:
|
|
1487
|
+
supportsRequests: W,
|
|
1488
|
+
supportsZoom: Ne,
|
|
1489
|
+
supportsBounds: me,
|
|
1490
|
+
supportsLoadingChange: Ce
|
|
1493
1491
|
}
|
|
1494
1492
|
};
|
|
1495
|
-
}), ut =
|
|
1493
|
+
}), ut = E(() => {
|
|
1496
1494
|
var G;
|
|
1497
|
-
if (
|
|
1495
|
+
if (oe(s.definition))
|
|
1498
1496
|
return null;
|
|
1499
|
-
const
|
|
1500
|
-
if ((
|
|
1497
|
+
const x = s.definition.query, T = x == null ? void 0 : x.time_range;
|
|
1498
|
+
if ((x == null ? void 0 : x.datasource) === "platform" && !((G = x.dimensions) != null && G.includes("time")))
|
|
1501
1499
|
return f.t("renderer.as_of_today");
|
|
1502
|
-
if ((
|
|
1503
|
-
const
|
|
1504
|
-
return
|
|
1505
|
-
} else if ((
|
|
1506
|
-
const
|
|
1507
|
-
return `${
|
|
1500
|
+
if ((T == null ? void 0 : T.type) === "relative") {
|
|
1501
|
+
const W = Ki.get(Qi[T.time_range]);
|
|
1502
|
+
return W ? W.display : (console.warn("Did not recognize the given relative time range:", T.time_range), T.time_range);
|
|
1503
|
+
} else if ((T == null ? void 0 : T.type) === "absolute") {
|
|
1504
|
+
const W = T.tz || "Etc/UTC";
|
|
1505
|
+
return `${Mt(T.start, { short: !0, tz: W })} - ${Mt(T.end, { short: !0, tz: W })}`;
|
|
1508
1506
|
}
|
|
1509
1507
|
return null;
|
|
1510
|
-
}),
|
|
1511
|
-
!!
|
|
1512
|
-
|
|
1508
|
+
}), Rt = E(() => le.value ? !1 : [
|
|
1509
|
+
!!M.value,
|
|
1510
|
+
yi.value,
|
|
1513
1511
|
!!ut.value,
|
|
1514
|
-
|
|
1512
|
+
vi.value,
|
|
1515
1513
|
s.showRefresh
|
|
1516
|
-
].some(Boolean)),
|
|
1517
|
-
if (!
|
|
1514
|
+
].some(Boolean)), kt = E(() => m.value ? dt(m.value.meta.granularity_ms) : void 0), wi = E(() => ["timeseries_line", "timeseries_bar"].includes(v.value.type)), Tt = E(() => {
|
|
1515
|
+
if (oe(s.definition) || !wi.value || !s.queryReady || N.value)
|
|
1518
1516
|
return !1;
|
|
1519
|
-
const
|
|
1520
|
-
return !
|
|
1521
|
-
}),
|
|
1517
|
+
const x = s.definition.query.granularity;
|
|
1518
|
+
return !x || !kt.value ? !1 : x !== kt.value;
|
|
1519
|
+
}), Ei = E(() => {
|
|
1522
1520
|
var G;
|
|
1523
|
-
const
|
|
1521
|
+
const x = dt(((G = m.value) == null ? void 0 : G.meta.granularity_ms) ?? 0) ?? "unknown", T = oe(s.definition) ? "unknown" : s.definition.query.granularity ?? "unknown";
|
|
1524
1522
|
return f.t("query_aged_out_warning", {
|
|
1525
|
-
currentGranularity: f.t(`granularities.${
|
|
1526
|
-
savedGranularity: f.t(`granularities.${
|
|
1523
|
+
currentGranularity: f.t(`granularities.${x}`),
|
|
1524
|
+
savedGranularity: f.t(`granularities.${T}`)
|
|
1527
1525
|
});
|
|
1528
|
-
}),
|
|
1529
|
-
|
|
1530
|
-
return [];
|
|
1531
|
-
const C = [...s.context.filters, ...O.value.query.filters ?? []], S = O.value.query.metrics, G = O.value.query.datasource ?? "api_usage";
|
|
1526
|
+
}), xi = E(() => {
|
|
1527
|
+
const x = s.definition, T = [...s.context.filters, ...x.query.filters ?? []], G = "metrics" in x.query ? x.query.metrics : void 0, W = x.query.datasource ?? "api_usage";
|
|
1532
1528
|
return u.value({
|
|
1533
|
-
datasource:
|
|
1534
|
-
filters:
|
|
1535
|
-
metrics:
|
|
1529
|
+
datasource: W,
|
|
1530
|
+
filters: T,
|
|
1531
|
+
metrics: G
|
|
1536
1532
|
});
|
|
1537
|
-
}),
|
|
1533
|
+
}), Ci = () => {
|
|
1538
1534
|
n("edit-tile", s.definition);
|
|
1539
|
-
},
|
|
1535
|
+
}, Ri = () => {
|
|
1540
1536
|
n("duplicate-tile", s.definition);
|
|
1541
|
-
},
|
|
1537
|
+
}, ki = () => {
|
|
1542
1538
|
n("remove-tile", s.definition);
|
|
1543
|
-
},
|
|
1544
|
-
|
|
1545
|
-
},
|
|
1546
|
-
|
|
1547
|
-
},
|
|
1539
|
+
}, Ti = (x) => {
|
|
1540
|
+
m.value = x, N.value = !1, n("chart-data", x);
|
|
1541
|
+
}, Si = (x) => {
|
|
1542
|
+
N.value = x;
|
|
1543
|
+
}, Di = () => {
|
|
1548
1544
|
y.value = !1;
|
|
1549
|
-
},
|
|
1550
|
-
var G,
|
|
1551
|
-
const
|
|
1552
|
-
return ((
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1545
|
+
}, St = () => {
|
|
1546
|
+
var G, W;
|
|
1547
|
+
const x = (G = s.definition.query.datasource) == null ? void 0 : G.startsWith("goap");
|
|
1548
|
+
return ((W = l == null ? void 0 : l.staticConfig) == null ? void 0 : W.increaseCsvExportLimit) !== !1 && !x ? lt(s.definition.query, s.context, Vi) : m.value ? Promise.resolve(m.value) : new Promise((Ne) => {
|
|
1549
|
+
const me = Oe(m, (Ce) => {
|
|
1550
|
+
Ce && (Ne(Ce), me());
|
|
1555
1551
|
});
|
|
1556
1552
|
});
|
|
1557
|
-
},
|
|
1553
|
+
}, zi = async () => {
|
|
1558
1554
|
y.value = !0, p.value = { status: "loading" };
|
|
1559
1555
|
try {
|
|
1560
|
-
const
|
|
1561
|
-
p.value = { status: "success", chartData:
|
|
1562
|
-
} catch (
|
|
1563
|
-
p.value = { status: "error", error:
|
|
1556
|
+
const x = await St();
|
|
1557
|
+
p.value = { status: "success", chartData: x };
|
|
1558
|
+
} catch (x) {
|
|
1559
|
+
p.value = { status: "error", error: x };
|
|
1564
1560
|
}
|
|
1565
|
-
},
|
|
1566
|
-
const
|
|
1561
|
+
}, Ni = (x) => {
|
|
1562
|
+
const T = {
|
|
1567
1563
|
tileId: s.tileId.toString(),
|
|
1568
|
-
timeRange:
|
|
1564
|
+
timeRange: x
|
|
1569
1565
|
};
|
|
1570
|
-
n("tile-time-range-zoom",
|
|
1571
|
-
},
|
|
1572
|
-
const
|
|
1566
|
+
n("tile-time-range-zoom", T);
|
|
1567
|
+
}, Li = (x) => {
|
|
1568
|
+
const T = {
|
|
1573
1569
|
tileId: s.tileId.toString(),
|
|
1574
|
-
bounds:
|
|
1570
|
+
bounds: x
|
|
1575
1571
|
};
|
|
1576
|
-
n("tile-bounds-change",
|
|
1577
|
-
},
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1572
|
+
n("tile-bounds-change", T);
|
|
1573
|
+
}, Ai = (x) => {
|
|
1574
|
+
const T = xi.value, G = F(x, T);
|
|
1575
|
+
z.value = Q.value ? { href: P(G) } : void 0, D.value = I.value ? { href: V(at(x, T)) } : void 0;
|
|
1580
1576
|
};
|
|
1581
|
-
return e({ getExportData:
|
|
1582
|
-
const G =
|
|
1583
|
-
return
|
|
1584
|
-
class:
|
|
1585
|
-
editable:
|
|
1586
|
-
headless: !
|
|
1577
|
+
return e({ getExportData: St }), (x, T) => {
|
|
1578
|
+
const G = ue("KTooltip"), W = ue("KBadge"), Ne = ue("KButton"), me = ue("KDropdownItem"), Ce = ue("KDropdown");
|
|
1579
|
+
return C(), B("div", {
|
|
1580
|
+
class: ze(["tile-boundary", {
|
|
1581
|
+
editable: o.context.editable,
|
|
1582
|
+
headless: !Rt.value
|
|
1587
1583
|
}]),
|
|
1588
|
-
"data-testid": `tile-${
|
|
1584
|
+
"data-testid": `tile-${o.tileId}`
|
|
1589
1585
|
}, [
|
|
1590
|
-
|
|
1591
|
-
|
|
1586
|
+
Rt.value && !le.value ? (C(), B("div", lr, [
|
|
1587
|
+
fe(G, {
|
|
1592
1588
|
class: "title-tooltip",
|
|
1593
|
-
disabled: !
|
|
1589
|
+
disabled: !k.value,
|
|
1594
1590
|
"max-width": "500",
|
|
1595
|
-
text:
|
|
1591
|
+
text: M.value
|
|
1596
1592
|
}, {
|
|
1597
|
-
default:
|
|
1593
|
+
default: q(() => [
|
|
1598
1594
|
te("div", {
|
|
1599
1595
|
ref_key: "titleRef",
|
|
1600
|
-
ref:
|
|
1596
|
+
ref: g,
|
|
1601
1597
|
class: "title"
|
|
1602
|
-
}, J(
|
|
1598
|
+
}, J(M.value), 513)
|
|
1603
1599
|
]),
|
|
1604
1600
|
_: 1
|
|
1605
1601
|
}, 8, ["disabled", "text"]),
|
|
1606
1602
|
te("div", ur, [
|
|
1607
|
-
ut.value ? (
|
|
1603
|
+
ut.value ? (C(), O(W, {
|
|
1608
1604
|
key: 0,
|
|
1609
1605
|
"data-testid": "time-range-badge",
|
|
1610
|
-
tooltip:
|
|
1606
|
+
tooltip: Tt.value ? Ei.value : void 0,
|
|
1611
1607
|
"tooltip-attributes": { maxWidth: "320px" }
|
|
1612
|
-
},
|
|
1613
|
-
default:
|
|
1608
|
+
}, rt({
|
|
1609
|
+
default: q(() => [
|
|
1614
1610
|
te("span", hr, J(ut.value), 1)
|
|
1615
1611
|
]),
|
|
1616
1612
|
_: 2
|
|
1617
1613
|
}, [
|
|
1618
|
-
|
|
1614
|
+
Tt.value ? {
|
|
1619
1615
|
name: "icon",
|
|
1620
|
-
fn:
|
|
1621
|
-
|
|
1622
|
-
size: `var(--kui-icon-size-20, ${
|
|
1616
|
+
fn: q(() => [
|
|
1617
|
+
fe(w(ns), {
|
|
1618
|
+
size: `var(--kui-icon-size-20, ${w(nr)})`
|
|
1623
1619
|
}, null, 8, ["size"])
|
|
1624
1620
|
]),
|
|
1625
1621
|
key: "0"
|
|
1626
1622
|
} : void 0
|
|
1627
1623
|
]), 1032, ["tooltip"])) : X("", !0)
|
|
1628
1624
|
]),
|
|
1629
|
-
|
|
1630
|
-
|
|
1625
|
+
o.showRefresh ? (C(), B("div", dr, [
|
|
1626
|
+
fe(Ne, {
|
|
1631
1627
|
appearance: "secondary",
|
|
1632
1628
|
class: "refresh-button",
|
|
1633
|
-
"data-testid": `tile-refresh-button-${
|
|
1634
|
-
disabled:
|
|
1629
|
+
"data-testid": `tile-refresh-button-${o.tileId}`,
|
|
1630
|
+
disabled: N.value,
|
|
1635
1631
|
icon: "",
|
|
1636
1632
|
size: "small",
|
|
1637
|
-
onClick:
|
|
1633
|
+
onClick: a
|
|
1638
1634
|
}, {
|
|
1639
|
-
default:
|
|
1640
|
-
|
|
1635
|
+
default: q(() => [
|
|
1636
|
+
N.value ? (C(), O(w(os), {
|
|
1641
1637
|
key: 0,
|
|
1642
1638
|
role: "button",
|
|
1643
|
-
size: `var(--kui-icon-size-60, ${
|
|
1639
|
+
size: `var(--kui-icon-size-60, ${w(jt)})`,
|
|
1644
1640
|
tabindex: "0"
|
|
1645
|
-
}, null, 8, ["size"])) : (
|
|
1641
|
+
}, null, 8, ["size"])) : (C(), O(w(as), {
|
|
1646
1642
|
key: 1,
|
|
1647
1643
|
role: "button",
|
|
1648
|
-
size: `var(--kui-icon-size-60, ${
|
|
1644
|
+
size: `var(--kui-icon-size-60, ${w(jt)})`,
|
|
1649
1645
|
tabindex: "0"
|
|
1650
1646
|
}, null, 8, ["size"]))
|
|
1651
1647
|
]),
|
|
1652
1648
|
_: 1
|
|
1653
1649
|
}, 8, ["data-testid", "disabled"])
|
|
1654
1650
|
])) : X("", !0),
|
|
1655
|
-
|
|
1651
|
+
we.value ? (C(), B("div", {
|
|
1656
1652
|
key: 1,
|
|
1657
1653
|
class: "tile-actions",
|
|
1658
|
-
"data-testid": `tile-actions-${
|
|
1654
|
+
"data-testid": `tile-actions-${o.tileId}`
|
|
1659
1655
|
}, [
|
|
1660
|
-
|
|
1656
|
+
we.value && o.context.editable && !o.isFullscreen ? (C(), O(w(ls), {
|
|
1661
1657
|
key: 0,
|
|
1662
1658
|
class: "edit-icon",
|
|
1663
|
-
color: `var(--kui-color-text-neutral, ${
|
|
1664
|
-
"data-testid": `edit-tile-${
|
|
1665
|
-
size: `var(--kui-icon-size-40, ${
|
|
1666
|
-
onClick:
|
|
1659
|
+
color: `var(--kui-color-text-neutral, ${w(Vt)})`,
|
|
1660
|
+
"data-testid": `edit-tile-${o.tileId}`,
|
|
1661
|
+
size: `var(--kui-icon-size-40, ${w(Yt)})`,
|
|
1662
|
+
onClick: Ci
|
|
1667
1663
|
}, null, 8, ["color", "data-testid", "size"])) : X("", !0),
|
|
1668
|
-
|
|
1664
|
+
we.value && We.value && !o.isFullscreen ? (C(), O(Ce, {
|
|
1669
1665
|
key: 1,
|
|
1670
1666
|
class: "dropdown",
|
|
1671
|
-
"data-testid": `chart-action-menu-${
|
|
1667
|
+
"data-testid": `chart-action-menu-${o.tileId}`,
|
|
1672
1668
|
"kpop-attributes": { placement: "bottom-end" }
|
|
1673
1669
|
}, {
|
|
1674
|
-
items:
|
|
1675
|
-
|
|
1670
|
+
items: q(() => [
|
|
1671
|
+
w(Y) ? (C(), O(me, {
|
|
1676
1672
|
key: 0,
|
|
1677
|
-
"data-testid": `chart-jump-to-explore-${
|
|
1678
|
-
item: { label:
|
|
1673
|
+
"data-testid": `chart-jump-to-explore-${o.tileId}`,
|
|
1674
|
+
item: { label: w(f).t("jumpToExplore"), to: w(Y) }
|
|
1679
1675
|
}, null, 8, ["data-testid", "item"])) : X("", !0),
|
|
1680
|
-
!w.
|
|
1676
|
+
!w(oe)(o.definition) && w(ve) ? (C(), O(me, {
|
|
1681
1677
|
key: 1,
|
|
1682
|
-
"data-testid": `chart-jump-to-requests-${
|
|
1683
|
-
item: { label:
|
|
1678
|
+
"data-testid": `chart-jump-to-requests-${o.tileId}`,
|
|
1679
|
+
item: { label: w(f).t("jumpToRequests"), to: w(ve) }
|
|
1684
1680
|
}, null, 8, ["data-testid", "item"])) : X("", !0),
|
|
1685
|
-
|
|
1681
|
+
xe.value ? (C(), O(me, {
|
|
1686
1682
|
key: 2,
|
|
1687
1683
|
class: "chart-export-button",
|
|
1688
|
-
"data-testid": `chart-csv-export-${
|
|
1689
|
-
onClick:
|
|
1684
|
+
"data-testid": `chart-csv-export-${o.tileId}`,
|
|
1685
|
+
onClick: zi
|
|
1690
1686
|
}, {
|
|
1691
|
-
default:
|
|
1687
|
+
default: q(() => [
|
|
1692
1688
|
te("span", {
|
|
1693
1689
|
class: "chart-export-trigger",
|
|
1694
|
-
"data-testid": `csv-export-button-${
|
|
1695
|
-
}, J(
|
|
1690
|
+
"data-testid": `csv-export-button-${o.tileId}`
|
|
1691
|
+
}, J(w(f).t("csvExport.exportAsCsv")), 9, fr)
|
|
1696
1692
|
]),
|
|
1697
1693
|
_: 1
|
|
1698
1694
|
}, 8, ["data-testid"])) : X("", !0),
|
|
1699
|
-
|
|
1695
|
+
o.context.editable ? (C(), O(me, {
|
|
1700
1696
|
key: 3,
|
|
1701
|
-
"data-testid": `duplicate-tile-${
|
|
1702
|
-
onClick:
|
|
1697
|
+
"data-testid": `duplicate-tile-${o.tileId}`,
|
|
1698
|
+
onClick: Ri
|
|
1703
1699
|
}, {
|
|
1704
|
-
default:
|
|
1705
|
-
|
|
1700
|
+
default: q(() => [
|
|
1701
|
+
gt(J(w(f).t("renderer.duplicateTile")), 1)
|
|
1706
1702
|
]),
|
|
1707
1703
|
_: 1
|
|
1708
1704
|
}, 8, ["data-testid"])) : X("", !0),
|
|
1709
|
-
|
|
1705
|
+
o.context.editable ? (C(), O(me, {
|
|
1710
1706
|
key: 4,
|
|
1711
|
-
"data-testid": `remove-tile-${
|
|
1712
|
-
onClick:
|
|
1707
|
+
"data-testid": `remove-tile-${o.tileId}`,
|
|
1708
|
+
onClick: ki
|
|
1713
1709
|
}, {
|
|
1714
|
-
default:
|
|
1715
|
-
te("span", gr, J(
|
|
1710
|
+
default: q(() => [
|
|
1711
|
+
te("span", gr, J(w(f).t("renderer.delete")), 1)
|
|
1716
1712
|
]),
|
|
1717
1713
|
_: 1
|
|
1718
1714
|
}, 8, ["data-testid"])) : X("", !0)
|
|
1719
1715
|
]),
|
|
1720
|
-
default:
|
|
1721
|
-
|
|
1716
|
+
default: q(() => [
|
|
1717
|
+
fe(w(us), {
|
|
1722
1718
|
class: "kebab-action-menu",
|
|
1723
|
-
color: `var(--kui-color-text-neutral, ${
|
|
1724
|
-
"data-testid": `kebab-action-menu-${
|
|
1725
|
-
size: `var(--kui-icon-size-40, ${
|
|
1719
|
+
color: `var(--kui-color-text-neutral, ${w(Vt)})`,
|
|
1720
|
+
"data-testid": `kebab-action-menu-${o.tileId}`,
|
|
1721
|
+
size: `var(--kui-icon-size-40, ${w(Yt)})`
|
|
1726
1722
|
}, null, 8, ["color", "data-testid", "size"])
|
|
1727
1723
|
]),
|
|
1728
1724
|
_: 1
|
|
1729
1725
|
}, 8, ["data-testid"])) : X("", !0)
|
|
1730
|
-
], 8, cr)) :
|
|
1726
|
+
], 8, cr)) : A.value ? (C(), B("div", {
|
|
1731
1727
|
key: 2,
|
|
1732
1728
|
class: "header-description",
|
|
1733
|
-
"data-testid": `tile-description-${
|
|
1734
|
-
}, J(
|
|
1735
|
-
y.value ? (
|
|
1729
|
+
"data-testid": `tile-description-${o.tileId}`
|
|
1730
|
+
}, J(A.value), 9, mr)) : X("", !0),
|
|
1731
|
+
y.value ? (C(), O(w(Ji), {
|
|
1736
1732
|
key: 3,
|
|
1737
|
-
"data-testid": `csv-export-modal-${
|
|
1733
|
+
"data-testid": `csv-export-modal-${o.tileId}`,
|
|
1738
1734
|
"export-state": p.value,
|
|
1739
|
-
filename:
|
|
1740
|
-
onCloseModal:
|
|
1735
|
+
filename: Ue.value,
|
|
1736
|
+
onCloseModal: Di
|
|
1741
1737
|
}, null, 8, ["data-testid", "export-state", "filename"])) : X("", !0)
|
|
1742
1738
|
])) : X("", !0),
|
|
1743
1739
|
te("div", {
|
|
1744
|
-
class:
|
|
1745
|
-
"data-testid": `tile-content-${
|
|
1740
|
+
class: ze(["tile-content", `type-${o.tileType}-${v.value.type}`]),
|
|
1741
|
+
"data-testid": `tile-content-${o.tileId}`
|
|
1746
1742
|
}, [
|
|
1747
|
-
|
|
1743
|
+
Ee.value ? (C(), O(si(Ee.value.component), ei({ key: 0 }, Ee.value.rendererProps, Wi(bi.value), { onChartData: Ti }), null, 16)) : X("", !0)
|
|
1748
1744
|
], 10, pr)
|
|
1749
1745
|
], 10, ar);
|
|
1750
1746
|
};
|
|
1751
1747
|
}
|
|
1752
|
-
}),
|
|
1748
|
+
}), mi = /* @__PURE__ */ be(yr, [["__scopeId", "data-v-14541de0"]]), vr = (o, e) => {
|
|
1753
1749
|
let t = 0;
|
|
1754
1750
|
const i = /* @__PURE__ */ new Map();
|
|
1755
1751
|
e.forEach((r) => {
|
|
1756
|
-
const
|
|
1757
|
-
t = Math.max(t,
|
|
1752
|
+
const a = r.layout.position.row, n = i.get(a), d = r.layout.size.rows === 1 && !!r.layout.size.fit_to_content;
|
|
1753
|
+
t = Math.max(t, a + r.layout.size.rows), n === void 0 ? i.set(a, d) : i.set(a, n && d);
|
|
1758
1754
|
});
|
|
1759
1755
|
const s = [];
|
|
1760
1756
|
for (let r = 0; r < t; r++)
|
|
1761
|
-
i.get(r) ? s.push("auto") : s.push(`${
|
|
1757
|
+
i.get(r) ? s.push("auto") : s.push(`${o}px`);
|
|
1762
1758
|
return s;
|
|
1763
1759
|
}, _r = /* @__PURE__ */ ee({
|
|
1764
1760
|
__name: "GridLayout",
|
|
@@ -1766,34 +1762,34 @@ const ae = {
|
|
|
1766
1762
|
tileHeight: {
|
|
1767
1763
|
type: Number,
|
|
1768
1764
|
required: !1,
|
|
1769
|
-
default: () =>
|
|
1765
|
+
default: () => Ge
|
|
1770
1766
|
},
|
|
1771
1767
|
columns: {
|
|
1772
1768
|
type: Number,
|
|
1773
1769
|
required: !1,
|
|
1774
|
-
default: () =>
|
|
1770
|
+
default: () => _t
|
|
1775
1771
|
},
|
|
1776
1772
|
tiles: {
|
|
1777
1773
|
type: Array,
|
|
1778
1774
|
required: !0
|
|
1779
1775
|
}
|
|
1780
1776
|
},
|
|
1781
|
-
setup(
|
|
1782
|
-
|
|
1777
|
+
setup(o) {
|
|
1778
|
+
pt((n) => ({
|
|
1783
1779
|
v821fda82: e.columns,
|
|
1784
1780
|
v0870d42d: r.value
|
|
1785
1781
|
}));
|
|
1786
|
-
const e =
|
|
1782
|
+
const e = o, t = H(null), i = H(0), s = new ResizeObserver((n) => {
|
|
1787
1783
|
window.requestAnimationFrame(() => {
|
|
1788
1784
|
!Array.isArray(n) || !n.length || (i.value = n[0].contentRect.width);
|
|
1789
1785
|
});
|
|
1790
1786
|
});
|
|
1791
|
-
|
|
1787
|
+
st(() => {
|
|
1792
1788
|
t.value && s.observe(t.value);
|
|
1793
|
-
}),
|
|
1789
|
+
}), Fe(() => {
|
|
1794
1790
|
t.value && s.unobserve(t.value);
|
|
1795
1791
|
});
|
|
1796
|
-
const r =
|
|
1792
|
+
const r = E(() => vr(e.tileHeight, e.tiles).join(" ")), a = E(() => e.tiles.map((n, d) => ({
|
|
1797
1793
|
key: `tile-${d}`,
|
|
1798
1794
|
tile: n,
|
|
1799
1795
|
style: {
|
|
@@ -1803,28 +1799,28 @@ const ae = {
|
|
|
1803
1799
|
"grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
|
|
1804
1800
|
}
|
|
1805
1801
|
})));
|
|
1806
|
-
return (n, d) => (
|
|
1802
|
+
return (n, d) => (C(), B("div", {
|
|
1807
1803
|
ref_key: "gridContainer",
|
|
1808
1804
|
ref: t,
|
|
1809
1805
|
class: "kong-ui-public-grid-layout"
|
|
1810
1806
|
}, [
|
|
1811
|
-
(
|
|
1807
|
+
(C(!0), B(mt, null, ri(a.value, (l) => (C(), B("div", {
|
|
1812
1808
|
key: l.key,
|
|
1813
|
-
class:
|
|
1809
|
+
class: ze(["grid-cell", {
|
|
1814
1810
|
"empty-cell": !l.tile
|
|
1815
1811
|
}]),
|
|
1816
|
-
style:
|
|
1812
|
+
style: Ye(l.style)
|
|
1817
1813
|
}, [
|
|
1818
|
-
|
|
1819
|
-
style:
|
|
1814
|
+
He(n.$slots, "tile", {
|
|
1815
|
+
style: Ye(l.style),
|
|
1820
1816
|
tile: l.tile
|
|
1821
1817
|
}, void 0, !0)
|
|
1822
1818
|
], 6))), 128))
|
|
1823
1819
|
], 512));
|
|
1824
1820
|
}
|
|
1825
|
-
}), br = /* @__PURE__ */
|
|
1826
|
-
function wr(
|
|
1827
|
-
const r = (...
|
|
1821
|
+
}), br = /* @__PURE__ */ be(_r, [["__scopeId", "data-v-0271a8b9"]]);
|
|
1822
|
+
function wr(o, e, t, i, s) {
|
|
1823
|
+
const r = (...a) => (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(o, a));
|
|
1828
1824
|
return r.prototype = e.prototype, r;
|
|
1829
1825
|
}
|
|
1830
1826
|
class c {
|
|
@@ -1887,8 +1883,8 @@ class c {
|
|
|
1887
1883
|
const i = e.x > t.x ? e.x : t.x, s = e.x + e.w < t.x + t.w ? e.x + e.w : t.x + t.w;
|
|
1888
1884
|
if (s <= i)
|
|
1889
1885
|
return 0;
|
|
1890
|
-
const r = e.y > t.y ? e.y : t.y,
|
|
1891
|
-
return
|
|
1886
|
+
const r = e.y > t.y ? e.y : t.y, a = e.y + e.h < t.y + t.h ? e.y + e.h : t.y + t.h;
|
|
1887
|
+
return a <= r ? 0 : (s - i) * (a - r);
|
|
1892
1888
|
}
|
|
1893
1889
|
/** returns the area */
|
|
1894
1890
|
static area(e) {
|
|
@@ -1901,8 +1897,8 @@ class c {
|
|
|
1901
1897
|
**/
|
|
1902
1898
|
static sort(e, t = 1) {
|
|
1903
1899
|
return e.sort((s, r) => {
|
|
1904
|
-
const
|
|
1905
|
-
return
|
|
1900
|
+
const a = t * ((s.y ?? 1e4) - (r.y ?? 1e4));
|
|
1901
|
+
return a === 0 ? t * ((s.x ?? 1e4) - (r.x ?? 1e4)) : a;
|
|
1906
1902
|
});
|
|
1907
1903
|
}
|
|
1908
1904
|
/** find an item by id */
|
|
@@ -2030,10 +2026,10 @@ class c {
|
|
|
2030
2026
|
static updateScrollPosition(e, t, i) {
|
|
2031
2027
|
const s = e.getBoundingClientRect(), r = window.innerHeight || document.documentElement.clientHeight;
|
|
2032
2028
|
if (s.top < 0 || s.bottom > r) {
|
|
2033
|
-
const
|
|
2029
|
+
const a = s.bottom - r, n = s.top, d = this.getScrollElement(e);
|
|
2034
2030
|
if (d !== null) {
|
|
2035
2031
|
const l = d.scrollTop;
|
|
2036
|
-
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 +=
|
|
2032
|
+
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 += a > i ? i : a), t.top += d.scrollTop - l;
|
|
2037
2033
|
}
|
|
2038
2034
|
}
|
|
2039
2035
|
}
|
|
@@ -2045,7 +2041,7 @@ class c {
|
|
|
2045
2041
|
* @param distance Distance from the V edges to start scrolling
|
|
2046
2042
|
*/
|
|
2047
2043
|
static updateScrollResize(e, t, i) {
|
|
2048
|
-
const s = this.getScrollElement(t), r = s.clientHeight,
|
|
2044
|
+
const s = this.getScrollElement(t), r = s.clientHeight, a = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - a, d = n < i, l = n > r - i;
|
|
2049
2045
|
d ? s.scrollBy({ behavior: "smooth", top: n - i }) : l && s.scrollBy({ behavior: "smooth", top: i - (r - n) });
|
|
2050
2046
|
}
|
|
2051
2047
|
/** single level clone, returning a new object with same top fields. This will share sub objects and arrays */
|
|
@@ -2163,7 +2159,7 @@ class c {
|
|
|
2163
2159
|
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);
|
|
2164
2160
|
}
|
|
2165
2161
|
}
|
|
2166
|
-
class
|
|
2162
|
+
class de {
|
|
2167
2163
|
constructor(e = {}) {
|
|
2168
2164
|
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;
|
|
2169
2165
|
}
|
|
@@ -2183,7 +2179,7 @@ class ce {
|
|
|
2183
2179
|
return !0;
|
|
2184
2180
|
let r = t;
|
|
2185
2181
|
!this._loading && this._useEntireRowArea(e, t) && (r = { x: 0, w: this.column, y: t.y, h: t.h }, i = this.collide(e, r, s.skip));
|
|
2186
|
-
let
|
|
2182
|
+
let a = !1;
|
|
2187
2183
|
const n = { nested: !0, pack: !1 };
|
|
2188
2184
|
let d = 0;
|
|
2189
2185
|
for (; i = i || this.collide(e, r, s.skip); ) {
|
|
@@ -2194,23 +2190,23 @@ class ce {
|
|
|
2194
2190
|
(!this.collide(i, { ...i, y: e.y }, e) || !this.collide(i, { ...i, y: t.y - i.h }, e))) {
|
|
2195
2191
|
e._skipDown = e._skipDown || t.y > e.y;
|
|
2196
2192
|
const h = { ...t, y: i.y + i.h, ...n };
|
|
2197
|
-
l = this._loading && c.samePos(e, h) ? !0 : this.moveNode(e, h), (i.locked || this._loading) && l ? c.copyPos(t, e) : !i.locked && l && s.pack && (this._packNodes(), t.y = i.y + i.h, c.copyPos(e, t)),
|
|
2193
|
+
l = this._loading && c.samePos(e, h) ? !0 : this.moveNode(e, h), (i.locked || this._loading) && l ? c.copyPos(t, e) : !i.locked && l && s.pack && (this._packNodes(), t.y = i.y + i.h, c.copyPos(e, t)), a = a || l;
|
|
2198
2194
|
} else
|
|
2199
2195
|
l = this.moveNode(i, { ...i, y: t.y + t.h, skip: e, ...n });
|
|
2200
2196
|
if (!l)
|
|
2201
|
-
return
|
|
2197
|
+
return a;
|
|
2202
2198
|
i = void 0;
|
|
2203
2199
|
}
|
|
2204
|
-
return
|
|
2200
|
+
return a;
|
|
2205
2201
|
}
|
|
2206
2202
|
/** return the nodes that intercept the given node. Optionally a different area can be used, as well as a second node to skip */
|
|
2207
2203
|
collide(e, t = e, i) {
|
|
2208
2204
|
const s = e._id, r = i == null ? void 0 : i._id;
|
|
2209
|
-
return this.nodes.find((
|
|
2205
|
+
return this.nodes.find((a) => a._id !== s && a._id !== r && c.isIntercepted(a, t));
|
|
2210
2206
|
}
|
|
2211
2207
|
collideAll(e, t = e, i) {
|
|
2212
2208
|
const s = e._id, r = i == null ? void 0 : i._id;
|
|
2213
|
-
return this.nodes.filter((
|
|
2209
|
+
return this.nodes.filter((a) => a._id !== s && a._id !== r && c.isIntercepted(a, t));
|
|
2214
2210
|
}
|
|
2215
2211
|
/** does a pixel coverage collision based on where we started, returning the node that has the most coverage that is >50% mid line */
|
|
2216
2212
|
directionCollideCoverage(e, t, i) {
|
|
@@ -2218,7 +2214,7 @@ class ce {
|
|
|
2218
2214
|
return;
|
|
2219
2215
|
const s = e._rect, r = { ...t.rect };
|
|
2220
2216
|
r.y > s.y ? (r.h += r.y - s.y, r.y = s.y) : r.h += s.y - r.y, r.x > s.x ? (r.w += r.x - s.x, r.x = s.x) : r.w += s.x - r.x;
|
|
2221
|
-
let
|
|
2217
|
+
let a, n = 0.5;
|
|
2222
2218
|
for (let d of i) {
|
|
2223
2219
|
if (d.locked || !d._rect)
|
|
2224
2220
|
break;
|
|
@@ -2226,9 +2222,9 @@ class ce {
|
|
|
2226
2222
|
let h = Number.MAX_VALUE, u = Number.MAX_VALUE;
|
|
2227
2223
|
s.y < l.y ? h = (r.y + r.h - l.y) / l.h : s.y + s.h > l.y + l.h && (h = (l.y + l.h - r.y) / l.h), s.x < l.x ? u = (r.x + r.w - l.x) / l.w : s.x + s.w > l.x + l.w && (u = (l.x + l.w - r.x) / l.w);
|
|
2228
2224
|
const f = Math.min(u, h);
|
|
2229
|
-
f > n && (n = f,
|
|
2225
|
+
f > n && (n = f, a = d);
|
|
2230
2226
|
}
|
|
2231
|
-
return t.collide =
|
|
2227
|
+
return t.collide = a, a;
|
|
2232
2228
|
}
|
|
2233
2229
|
/** does a pixel coverage returning the node that has the most coverage by area */
|
|
2234
2230
|
/*
|
|
@@ -2247,11 +2243,11 @@ class ce {
|
|
|
2247
2243
|
}
|
|
2248
2244
|
*/
|
|
2249
2245
|
/** called to cache the nodes pixel rectangles used for collision detection during drag */
|
|
2250
|
-
cacheRects(e, t, i, s, r,
|
|
2246
|
+
cacheRects(e, t, i, s, r, a) {
|
|
2251
2247
|
return this.nodes.forEach((n) => n._rect = {
|
|
2252
2248
|
y: n.y * t + i,
|
|
2253
|
-
x: n.x * e +
|
|
2254
|
-
w: n.w * e -
|
|
2249
|
+
x: n.x * e + a,
|
|
2250
|
+
w: n.w * e - a - s,
|
|
2255
2251
|
h: n.h * t - i - r
|
|
2256
2252
|
}), this;
|
|
2257
2253
|
}
|
|
@@ -2260,8 +2256,8 @@ class ce {
|
|
|
2260
2256
|
if (!t || t.locked || !e || e.locked)
|
|
2261
2257
|
return !1;
|
|
2262
2258
|
function i() {
|
|
2263
|
-
const r = t.x,
|
|
2264
|
-
return t.x = e.x, t.y = e.y, e.h != t.h ? (e.x = r, e.y = t.y + t.h) : e.w != t.w ? (e.x = t.x + t.w, e.y =
|
|
2259
|
+
const r = t.x, a = t.y;
|
|
2260
|
+
return t.x = e.x, t.y = e.y, e.h != t.h ? (e.x = r, e.y = t.y + t.h) : e.w != t.w ? (e.x = t.x + t.w, e.y = a) : (e.x = r, e.y = a), e._dirty = t._dirty = !0, !0;
|
|
2265
2261
|
}
|
|
2266
2262
|
let s;
|
|
2267
2263
|
if (e.w === t.w && e.h === t.h && (e.x === t.x || e.y === t.y) && (s = c.isTouching(e, t)))
|
|
@@ -2300,9 +2296,9 @@ class ce {
|
|
|
2300
2296
|
const s = this._inColumnResize;
|
|
2301
2297
|
s || (this._inColumnResize = !0);
|
|
2302
2298
|
const r = this.nodes;
|
|
2303
|
-
return this.nodes = [], r.forEach((
|
|
2299
|
+
return this.nodes = [], r.forEach((a, n, d) => {
|
|
2304
2300
|
let l;
|
|
2305
|
-
|
|
2301
|
+
a.locked || (a.autoPosition = !0, e === "list" && n && (l = d[n - 1])), this.addNode(a, !1, l);
|
|
2306
2302
|
}), s || delete this._inColumnResize, i || this.batchUpdate(!1), this;
|
|
2307
2303
|
}
|
|
2308
2304
|
/** enable/disable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html) */
|
|
@@ -2341,11 +2337,11 @@ class ce {
|
|
|
2341
2337
|
* @param resizing if out of bound, resize down or move into the grid to fit ?
|
|
2342
2338
|
*/
|
|
2343
2339
|
prepareNode(e, t) {
|
|
2344
|
-
e._id = e._id ??
|
|
2340
|
+
e._id = e._id ?? de._idSeq++;
|
|
2345
2341
|
const i = e.id;
|
|
2346
2342
|
if (i) {
|
|
2347
2343
|
let r = 1;
|
|
2348
|
-
for (; this.nodes.find((
|
|
2344
|
+
for (; this.nodes.find((a) => a.id === e.id && a !== e); )
|
|
2349
2345
|
e.id = i + "_" + r++;
|
|
2350
2346
|
}
|
|
2351
2347
|
(e.x === void 0 || e.y === void 0 || e.x === null || e.y === null) && (e.autoPosition = !0);
|
|
@@ -2398,19 +2394,19 @@ class ce {
|
|
|
2398
2394
|
*/
|
|
2399
2395
|
findEmptyPosition(e, t = this.nodes, i = this.column, s) {
|
|
2400
2396
|
const r = s ? s.y * i + (s.x + s.w) : 0;
|
|
2401
|
-
let
|
|
2402
|
-
for (let n = r; !
|
|
2397
|
+
let a = !1;
|
|
2398
|
+
for (let n = r; !a; ++n) {
|
|
2403
2399
|
const d = n % i, l = Math.floor(n / i);
|
|
2404
2400
|
if (d + e.w > i)
|
|
2405
2401
|
continue;
|
|
2406
2402
|
const h = { x: d, y: l, w: e.w, h: e.h };
|
|
2407
|
-
t.find((u) => c.isIntercepted(h, u)) || ((e.x !== d || e.y !== l) && (e._dirty = !0), e.x = d, e.y = l, delete e.autoPosition,
|
|
2403
|
+
t.find((u) => c.isIntercepted(h, u)) || ((e.x !== d || e.y !== l) && (e._dirty = !0), e.x = d, e.y = l, delete e.autoPosition, a = !0);
|
|
2408
2404
|
}
|
|
2409
|
-
return
|
|
2405
|
+
return a;
|
|
2410
2406
|
}
|
|
2411
2407
|
/** call to add the given node to our list, fixing collision and re-packing */
|
|
2412
2408
|
addNode(e, t = !1, i) {
|
|
2413
|
-
const s = this.nodes.find((
|
|
2409
|
+
const s = this.nodes.find((a) => a._id === e._id);
|
|
2414
2410
|
if (s)
|
|
2415
2411
|
return s;
|
|
2416
2412
|
this._inColumnResize ? this.nodeBoundFix(e) : this.prepareNode(e), delete e._temporaryRemoved, delete e._removeDOM;
|
|
@@ -2436,29 +2432,29 @@ class ce {
|
|
|
2436
2432
|
if (t.pack = !0, !this.maxRow)
|
|
2437
2433
|
return this.moveNode(e, t);
|
|
2438
2434
|
let i;
|
|
2439
|
-
const s = new
|
|
2435
|
+
const s = new de({
|
|
2440
2436
|
column: this.column,
|
|
2441
2437
|
float: this.float,
|
|
2442
|
-
nodes: this.nodes.map((
|
|
2438
|
+
nodes: this.nodes.map((a) => a._id === e._id ? (i = { ...a }, i) : { ...a })
|
|
2443
2439
|
});
|
|
2444
2440
|
if (!i)
|
|
2445
2441
|
return !1;
|
|
2446
2442
|
const r = s.moveNode(i, t) && s.getRow() <= Math.max(this.getRow(), this.maxRow);
|
|
2447
2443
|
if (!r && !t.resizing && t.collide) {
|
|
2448
|
-
const
|
|
2449
|
-
if (this.swap(e,
|
|
2444
|
+
const a = t.collide.el.gridstackNode;
|
|
2445
|
+
if (this.swap(e, a))
|
|
2450
2446
|
return this._notify(), !0;
|
|
2451
2447
|
}
|
|
2452
|
-
return r ? (s.nodes.filter((
|
|
2453
|
-
const n = this.nodes.find((d) => d._id ===
|
|
2454
|
-
n && (c.copyPos(n,
|
|
2448
|
+
return r ? (s.nodes.filter((a) => a._dirty).forEach((a) => {
|
|
2449
|
+
const n = this.nodes.find((d) => d._id === a._id);
|
|
2450
|
+
n && (c.copyPos(n, a), n._dirty = !0);
|
|
2455
2451
|
}), this._notify(), !0) : !1;
|
|
2456
2452
|
}
|
|
2457
2453
|
/** return true if can fit in grid height constrain only (always true if no maxRow) */
|
|
2458
2454
|
willItFit(e) {
|
|
2459
2455
|
if (delete e._willFitPos, !this.maxRow)
|
|
2460
2456
|
return !0;
|
|
2461
|
-
const t = new
|
|
2457
|
+
const t = new de({
|
|
2462
2458
|
column: this.column,
|
|
2463
2459
|
float: this.float,
|
|
2464
2460
|
nodes: this.nodes.map((s) => ({ ...s }))
|
|
@@ -2480,18 +2476,18 @@ class ce {
|
|
|
2480
2476
|
const s = e.w !== t.w || e.h !== t.h, r = c.copyPos({}, e, !0);
|
|
2481
2477
|
if (c.copyPos(r, t), this.nodeBoundFix(r, s), c.copyPos(t, r), !t.forceCollide && c.samePos(e, t))
|
|
2482
2478
|
return !1;
|
|
2483
|
-
const
|
|
2479
|
+
const a = c.copyPos({}, e), n = this.collideAll(e, r, t.skip);
|
|
2484
2480
|
let d = !0;
|
|
2485
2481
|
if (n.length) {
|
|
2486
2482
|
const u = e._moving && !t.nested;
|
|
2487
2483
|
let f = u ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
2488
2484
|
if (u && f && ((h = (l = e.grid) == null ? void 0 : l.opts) != null && h.subGridDynamic) && !e.grid._isTemp) {
|
|
2489
|
-
const
|
|
2490
|
-
|
|
2485
|
+
const m = c.areaIntercept(t.rect, f._rect), p = c.area(t.rect), y = c.area(f._rect);
|
|
2486
|
+
m / (p < y ? p : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
|
|
2491
2487
|
}
|
|
2492
2488
|
f ? d = !this._fixCollisions(e, r, f, t) : (d = !1, i && delete t.pack);
|
|
2493
2489
|
}
|
|
2494
|
-
return d && !c.samePos(e, r) && (e._dirty = !0, c.copyPos(e, r)), t.pack && this._packNodes()._notify(), !c.samePos(e,
|
|
2490
|
+
return d && !c.samePos(e, r) && (e._dirty = !0, c.copyPos(e, r)), t.pack && this._packNodes()._notify(), !c.samePos(e, a);
|
|
2495
2491
|
}
|
|
2496
2492
|
getRow() {
|
|
2497
2493
|
return this.nodes.reduce((e, t) => Math.max(e, t.y + t.h), 0);
|
|
@@ -2506,8 +2502,8 @@ class ce {
|
|
|
2506
2502
|
/** saves a copy of the largest column layout (eg 12 even when rendering oneColumnMode) so we don't loose orig layout,
|
|
2507
2503
|
* returning a list of widgets for serialization */
|
|
2508
2504
|
save(e = !0, t) {
|
|
2509
|
-
var
|
|
2510
|
-
const i = (
|
|
2505
|
+
var a;
|
|
2506
|
+
const i = (a = this._layouts) == null ? void 0 : a.length, s = i && this.column !== i - 1 ? this._layouts[i - 1] : null, r = [];
|
|
2511
2507
|
return this.sortNodes(), this.nodes.forEach((n) => {
|
|
2512
2508
|
const d = s == null ? void 0 : s.find((h) => h._id === n._id), l = { ...n, ...d || {} };
|
|
2513
2509
|
c.removeInternalForSave(l, !e), t && t(n, l), r.push(l);
|
|
@@ -2525,8 +2521,8 @@ class ce {
|
|
|
2525
2521
|
e.forEach((r) => {
|
|
2526
2522
|
if (!r._orig)
|
|
2527
2523
|
return;
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2524
|
+
const a = t.find((n) => n._id === r._id);
|
|
2525
|
+
a && (a.y >= 0 && r.y !== r._orig.y && (a.y += r.y - r._orig.y), r.x !== r._orig.x && (a.x = Math.round(r.x * s)), r.w !== r._orig.w && (a.w = Math.round(r.w * s)));
|
|
2530
2526
|
});
|
|
2531
2527
|
}
|
|
2532
2528
|
}), this);
|
|
@@ -2547,35 +2543,35 @@ class ce {
|
|
|
2547
2543
|
return this;
|
|
2548
2544
|
const s = i === "compact" || i === "list";
|
|
2549
2545
|
s && this.sortNodes(1), t < e && this.cacheLayout(this.nodes, e), this.batchUpdate();
|
|
2550
|
-
let r = [],
|
|
2546
|
+
let r = [], a = s ? this.nodes : c.sort(this.nodes, -1);
|
|
2551
2547
|
if (t > e && this._layouts) {
|
|
2552
2548
|
const d = this._layouts[t] || [], l = this._layouts.length - 1;
|
|
2553
2549
|
!d.length && e !== l && ((n = this._layouts[l]) != null && n.length) && (e = l, this._layouts[l].forEach((h) => {
|
|
2554
|
-
const u =
|
|
2550
|
+
const u = a.find((f) => f._id === h._id);
|
|
2555
2551
|
u && (!s && !h.autoPosition && (u.x = h.x ?? u.x, u.y = h.y ?? u.y), u.w = h.w ?? u.w, (h.x == null || h.y === void 0) && (u.autoPosition = !0));
|
|
2556
2552
|
})), d.forEach((h) => {
|
|
2557
|
-
const u =
|
|
2553
|
+
const u = a.findIndex((f) => f._id === h._id);
|
|
2558
2554
|
if (u !== -1) {
|
|
2559
|
-
const f =
|
|
2555
|
+
const f = a[u];
|
|
2560
2556
|
if (s) {
|
|
2561
2557
|
f.w = h.w;
|
|
2562
2558
|
return;
|
|
2563
2559
|
}
|
|
2564
|
-
(h.autoPosition || isNaN(h.x) || isNaN(h.y)) && this.findEmptyPosition(h, r), h.autoPosition || (f.x = h.x ?? f.x, f.y = h.y ?? f.y, f.w = h.w ?? f.w, r.push(f)),
|
|
2560
|
+
(h.autoPosition || isNaN(h.x) || isNaN(h.y)) && this.findEmptyPosition(h, r), h.autoPosition || (f.x = h.x ?? f.x, f.y = h.y ?? f.y, f.w = h.w ?? f.w, r.push(f)), a.splice(u, 1);
|
|
2565
2561
|
}
|
|
2566
2562
|
});
|
|
2567
2563
|
}
|
|
2568
2564
|
if (s)
|
|
2569
2565
|
this.compact(i, !1);
|
|
2570
2566
|
else {
|
|
2571
|
-
if (
|
|
2567
|
+
if (a.length)
|
|
2572
2568
|
if (typeof i == "function")
|
|
2573
|
-
i(t, e, r,
|
|
2569
|
+
i(t, e, r, a);
|
|
2574
2570
|
else {
|
|
2575
2571
|
const d = s || i === "none" ? 1 : t / e, l = i === "move" || i === "moveScale", h = i === "scale" || i === "moveScale";
|
|
2576
|
-
|
|
2572
|
+
a.forEach((u) => {
|
|
2577
2573
|
u.x = t === 1 ? 0 : l ? Math.round(u.x * d) : Math.min(u.x, t - 1), u.w = t === 1 || e === 1 ? 1 : h ? Math.round(u.w * d) || 1 : Math.min(u.w, t), r.push(u);
|
|
2578
|
-
}),
|
|
2574
|
+
}), a = [];
|
|
2579
2575
|
}
|
|
2580
2576
|
r = c.sort(r, -1), this._inColumnResize = !0, this.nodes = [], r.forEach((d) => {
|
|
2581
2577
|
this.addNode(d, !1), delete d._orig;
|
|
@@ -2591,12 +2587,12 @@ class ce {
|
|
|
2591
2587
|
*/
|
|
2592
2588
|
cacheLayout(e, t, i = !1) {
|
|
2593
2589
|
const s = [];
|
|
2594
|
-
return e.forEach((r,
|
|
2590
|
+
return e.forEach((r, a) => {
|
|
2595
2591
|
if (r._id === void 0) {
|
|
2596
2592
|
const n = r.id ? this.nodes.find((d) => d.id === r.id) : void 0;
|
|
2597
|
-
r._id = (n == null ? void 0 : n._id) ??
|
|
2593
|
+
r._id = (n == null ? void 0 : n._id) ?? de._idSeq++;
|
|
2598
2594
|
}
|
|
2599
|
-
s[
|
|
2595
|
+
s[a] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
2600
2596
|
}), this._layouts = i ? [] : this._layouts || [], this._layouts[t] = s, this;
|
|
2601
2597
|
}
|
|
2602
2598
|
/**
|
|
@@ -2605,7 +2601,7 @@ class ce {
|
|
|
2605
2601
|
* @param column corresponding column index to save it under
|
|
2606
2602
|
*/
|
|
2607
2603
|
cacheOneLayout(e, t) {
|
|
2608
|
-
e._id = e._id ??
|
|
2604
|
+
e._id = e._id ?? de._idSeq++;
|
|
2609
2605
|
const i = { x: e.x, y: e.y, w: e.w, _id: e._id };
|
|
2610
2606
|
(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] || [];
|
|
2611
2607
|
const s = this.findCacheLayout(e, t);
|
|
@@ -2629,8 +2625,8 @@ class ce {
|
|
|
2629
2625
|
return this;
|
|
2630
2626
|
}
|
|
2631
2627
|
}
|
|
2632
|
-
|
|
2633
|
-
const
|
|
2628
|
+
de._idSeq = 0;
|
|
2629
|
+
const ie = {
|
|
2634
2630
|
alwaysShowResizeHandle: "mobile",
|
|
2635
2631
|
animate: !0,
|
|
2636
2632
|
auto: !0,
|
|
@@ -2662,55 +2658,55 @@ const se = {
|
|
|
2662
2658
|
};
|
|
2663
2659
|
class R {
|
|
2664
2660
|
}
|
|
2665
|
-
const
|
|
2666
|
-
class
|
|
2661
|
+
const he = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2662
|
+
class ce {
|
|
2667
2663
|
}
|
|
2668
|
-
function
|
|
2669
|
-
|
|
2664
|
+
function Xe(o, e) {
|
|
2665
|
+
o.touches.length > 1 || (o.cancelable && o.preventDefault(), c.simulateMouseEvent(o.changedTouches[0], e));
|
|
2670
2666
|
}
|
|
2671
|
-
function
|
|
2672
|
-
|
|
2667
|
+
function pi(o, e) {
|
|
2668
|
+
o.cancelable && o.preventDefault(), c.simulateMouseEvent(o, e);
|
|
2673
2669
|
}
|
|
2674
|
-
function
|
|
2675
|
-
|
|
2670
|
+
function Ze(o) {
|
|
2671
|
+
ce.touchHandled || (ce.touchHandled = !0, Xe(o, "mousedown"));
|
|
2676
2672
|
}
|
|
2677
|
-
function
|
|
2678
|
-
|
|
2673
|
+
function Je(o) {
|
|
2674
|
+
ce.touchHandled && Xe(o, "mousemove");
|
|
2679
2675
|
}
|
|
2680
|
-
function
|
|
2681
|
-
if (!
|
|
2676
|
+
function et(o) {
|
|
2677
|
+
if (!ce.touchHandled)
|
|
2682
2678
|
return;
|
|
2683
|
-
|
|
2679
|
+
ce.pointerLeaveTimeout && (window.clearTimeout(ce.pointerLeaveTimeout), delete ce.pointerLeaveTimeout);
|
|
2684
2680
|
const e = !!R.dragElement;
|
|
2685
|
-
|
|
2681
|
+
Xe(o, "mouseup"), e || Xe(o, "click"), ce.touchHandled = !1;
|
|
2686
2682
|
}
|
|
2687
|
-
function
|
|
2688
|
-
|
|
2683
|
+
function tt(o) {
|
|
2684
|
+
o.pointerType !== "mouse" && o.target.releasePointerCapture(o.pointerId);
|
|
2689
2685
|
}
|
|
2690
|
-
function
|
|
2691
|
-
R.dragElement &&
|
|
2686
|
+
function Xt(o) {
|
|
2687
|
+
R.dragElement && o.pointerType !== "mouse" && pi(o, "mouseenter");
|
|
2692
2688
|
}
|
|
2693
|
-
function
|
|
2694
|
-
R.dragElement &&
|
|
2695
|
-
delete
|
|
2689
|
+
function Zt(o) {
|
|
2690
|
+
R.dragElement && o.pointerType !== "mouse" && (ce.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2691
|
+
delete ce.pointerLeaveTimeout, pi(o, "mouseleave");
|
|
2696
2692
|
}, 10));
|
|
2697
2693
|
}
|
|
2698
|
-
class
|
|
2694
|
+
class ot {
|
|
2699
2695
|
constructor(e, t, i) {
|
|
2700
2696
|
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();
|
|
2701
2697
|
}
|
|
2702
2698
|
/** @internal */
|
|
2703
2699
|
_init() {
|
|
2704
2700
|
const e = this.el = document.createElement("div");
|
|
2705
|
-
return e.classList.add("ui-resizable-handle"), e.classList.add(`${
|
|
2701
|
+
return e.classList.add("ui-resizable-handle"), e.classList.add(`${ot.prefix}${this.dir}`), e.style.zIndex = "100", e.style.userSelect = "none", this.host.appendChild(this.el), this.el.addEventListener("mousedown", this._mouseDown), he && (this.el.addEventListener("touchstart", Ze), this.el.addEventListener("pointerdown", tt)), this;
|
|
2706
2702
|
}
|
|
2707
2703
|
/** call this when resize handle needs to be removed and cleaned up */
|
|
2708
2704
|
destroy() {
|
|
2709
|
-
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown),
|
|
2705
|
+
return this.moving && this._mouseUp(this.mouseDownEvent), this.el.removeEventListener("mousedown", this._mouseDown), he && (this.el.removeEventListener("touchstart", Ze), this.el.removeEventListener("pointerdown", tt)), this.host.removeChild(this.el), delete this.el, delete this.host, this;
|
|
2710
2706
|
}
|
|
2711
2707
|
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
|
|
2712
2708
|
_mouseDown(e) {
|
|
2713
|
-
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2709
|
+
this.mouseDownEvent = e, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), he && (this.el.addEventListener("touchmove", Je), this.el.addEventListener("touchend", et)), e.stopPropagation(), e.preventDefault();
|
|
2714
2710
|
}
|
|
2715
2711
|
/** @internal */
|
|
2716
2712
|
_mouseMove(e) {
|
|
@@ -2719,7 +2715,7 @@ class at {
|
|
|
2719
2715
|
}
|
|
2720
2716
|
/** @internal */
|
|
2721
2717
|
_mouseUp(e) {
|
|
2722
|
-
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2718
|
+
this.moving && (this._triggerEvent("stop", e), document.removeEventListener("keydown", this._keyEvent)), document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), he && (this.el.removeEventListener("touchmove", Je), this.el.removeEventListener("touchend", et)), delete this.moving, delete this.mouseDownEvent, e.stopPropagation(), e.preventDefault();
|
|
2723
2719
|
}
|
|
2724
2720
|
/** @internal call when keys are being pressed - use Esc to cancel */
|
|
2725
2721
|
_keyEvent(e) {
|
|
@@ -2731,8 +2727,8 @@ class at {
|
|
|
2731
2727
|
return this.option[e] && this.option[e](t), this;
|
|
2732
2728
|
}
|
|
2733
2729
|
}
|
|
2734
|
-
|
|
2735
|
-
class
|
|
2730
|
+
ot.prefix = "ui-resizable-";
|
|
2731
|
+
class xt {
|
|
2736
2732
|
constructor() {
|
|
2737
2733
|
this._eventRegister = {};
|
|
2738
2734
|
}
|
|
@@ -2760,7 +2756,7 @@ class Ct {
|
|
|
2760
2756
|
return this._eventRegister[e](t);
|
|
2761
2757
|
}
|
|
2762
2758
|
}
|
|
2763
|
-
class
|
|
2759
|
+
class Ie extends xt {
|
|
2764
2760
|
// have to be public else complains for HTMLElementExtendOpt ?
|
|
2765
2761
|
constructor(e, t = {}) {
|
|
2766
2762
|
super(), this.el = e, this.option = t, this.rectScale = { x: 1, y: 1 }, this._ui = () => {
|
|
@@ -2769,15 +2765,15 @@ class Ae extends Ct {
|
|
|
2769
2765
|
height: this.originalRect.height + this.scrolled,
|
|
2770
2766
|
left: this.originalRect.left,
|
|
2771
2767
|
top: this.originalRect.top - this.scrolled
|
|
2772
|
-
},
|
|
2768
|
+
}, a = this.temporalRect || r;
|
|
2773
2769
|
return {
|
|
2774
2770
|
position: {
|
|
2775
|
-
left: (
|
|
2776
|
-
top: (
|
|
2771
|
+
left: (a.left - s.left) * this.rectScale.x,
|
|
2772
|
+
top: (a.top - s.top) * this.rectScale.y
|
|
2777
2773
|
},
|
|
2778
2774
|
size: {
|
|
2779
|
-
width:
|
|
2780
|
-
height:
|
|
2775
|
+
width: a.width * this.rectScale.x,
|
|
2776
|
+
height: a.height * this.rectScale.y
|
|
2781
2777
|
}
|
|
2782
2778
|
/* Gridstack ONLY needs position set above... keep around in case.
|
|
2783
2779
|
element: [this.el], // The object representing the element to be resized
|
|
@@ -2830,7 +2826,7 @@ class Ae extends Ct {
|
|
|
2830
2826
|
}
|
|
2831
2827
|
/** @internal */
|
|
2832
2828
|
_setupHandlers() {
|
|
2833
|
-
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new
|
|
2829
|
+
return this.handlers = this.option.handles.split(",").map((e) => e.trim()).map((e) => new ot(this.el, e, {
|
|
2834
2830
|
start: (t) => {
|
|
2835
2831
|
this._resizeStart(t);
|
|
2836
2832
|
},
|
|
@@ -2861,7 +2857,7 @@ class Ae extends Ct {
|
|
|
2861
2857
|
}
|
|
2862
2858
|
/** @internal */
|
|
2863
2859
|
_setupHelper() {
|
|
2864
|
-
this.elOriginStyleVal =
|
|
2860
|
+
this.elOriginStyleVal = Ie._originStyleProp.map((i) => this.el.style[i]), this.parentOriginStylePosition = this.el.parentElement.style.position;
|
|
2865
2861
|
const e = this.el.parentElement, t = c.getValuesFromTransformedElement(e);
|
|
2866
2862
|
return this.rectScale = {
|
|
2867
2863
|
x: t.xScale,
|
|
@@ -2870,7 +2866,7 @@ class Ae extends Ct {
|
|
|
2870
2866
|
}
|
|
2871
2867
|
/** @internal */
|
|
2872
2868
|
_cleanHelper() {
|
|
2873
|
-
return
|
|
2869
|
+
return Ie._originStyleProp.forEach((e, t) => {
|
|
2874
2870
|
this.el.style[e] = this.elOriginStyleVal[t] || null;
|
|
2875
2871
|
}), this.el.parentElement.style.position = this.parentOriginStylePosition || null, this;
|
|
2876
2872
|
}
|
|
@@ -2881,15 +2877,15 @@ class Ae extends Ct {
|
|
|
2881
2877
|
height: this.originalRect.height + this.scrolled,
|
|
2882
2878
|
left: this.originalRect.left,
|
|
2883
2879
|
top: this.originalRect.top - this.scrolled
|
|
2884
|
-
}, r = e.clientX - i.clientX,
|
|
2880
|
+
}, r = e.clientX - i.clientX, a = this.sizeToContent ? 0 : e.clientY - i.clientY;
|
|
2885
2881
|
let n, d;
|
|
2886
|
-
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 +=
|
|
2882
|
+
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 += a : t.indexOf("n") > -1 && (s.height -= a, s.top += a, d = !0);
|
|
2887
2883
|
const l = this._constrainSize(s.width, s.height, n, d);
|
|
2888
2884
|
return Math.round(s.width) !== Math.round(l.width) && (t.indexOf("w") > -1 && (s.left += s.width - l.width), s.width = l.width), Math.round(s.height) !== Math.round(l.height) && (t.indexOf("n") > -1 && (s.top += s.height - l.height), s.height = l.height), s;
|
|
2889
2885
|
}
|
|
2890
2886
|
/** @internal constrain the size to the set min/max values */
|
|
2891
2887
|
_constrainSize(e, t, i, s) {
|
|
2892
|
-
const r = this.option,
|
|
2888
|
+
const r = this.option, a = (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, l = r.minHeight / this.rectScale.y || t, h = Math.min(a, Math.max(n, e)), u = Math.min(d, Math.max(l, t));
|
|
2893
2889
|
return { width: h, height: u };
|
|
2894
2890
|
}
|
|
2895
2891
|
/** @internal */
|
|
@@ -2909,9 +2905,9 @@ class Ae extends Ct {
|
|
|
2909
2905
|
return this.handlers.forEach((e) => e.destroy()), delete this.handlers, this;
|
|
2910
2906
|
}
|
|
2911
2907
|
}
|
|
2912
|
-
|
|
2908
|
+
Ie._originStyleProp = ["width", "height", "position", "left", "top", "opacity", "zIndex"];
|
|
2913
2909
|
const Er = 'input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';
|
|
2914
|
-
class
|
|
2910
|
+
class Me extends xt {
|
|
2915
2911
|
constructor(e, t = {}) {
|
|
2916
2912
|
var r;
|
|
2917
2913
|
super(), this.el = e, this.option = t, this.dragTransform = {
|
|
@@ -2931,12 +2927,12 @@ class Oe extends Ct {
|
|
|
2931
2927
|
}
|
|
2932
2928
|
enable() {
|
|
2933
2929
|
this.disabled !== !1 && (super.enable(), this.dragEls.forEach((e) => {
|
|
2934
|
-
e.addEventListener("mousedown", this._mouseDown),
|
|
2930
|
+
e.addEventListener("mousedown", this._mouseDown), he && (e.addEventListener("touchstart", Ze), e.addEventListener("pointerdown", tt));
|
|
2935
2931
|
}), this.el.classList.remove("ui-draggable-disabled"));
|
|
2936
2932
|
}
|
|
2937
2933
|
disable(e = !1) {
|
|
2938
2934
|
this.disabled !== !0 && (super.disable(), this.dragEls.forEach((t) => {
|
|
2939
|
-
t.removeEventListener("mousedown", this._mouseDown),
|
|
2935
|
+
t.removeEventListener("mousedown", this._mouseDown), he && (t.removeEventListener("touchstart", Ze), t.removeEventListener("pointerdown", tt));
|
|
2940
2936
|
}), e || this.el.classList.add("ui-draggable-disabled"));
|
|
2941
2937
|
}
|
|
2942
2938
|
destroy() {
|
|
@@ -2948,7 +2944,7 @@ class Oe extends Ct {
|
|
|
2948
2944
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
2949
2945
|
_mouseDown(e) {
|
|
2950
2946
|
if (!R.mouseHandled)
|
|
2951
|
-
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Er) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete R.dragElement, delete R.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0),
|
|
2947
|
+
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Er) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete R.dragElement, delete R.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), he && (e.currentTarget.addEventListener("touchmove", Je), e.currentTarget.addEventListener("touchend", et)), e.preventDefault(), document.activeElement && document.activeElement.blur(), R.mouseHandled = !0), !0;
|
|
2952
2948
|
}
|
|
2953
2949
|
/** @internal method to call actual drag event */
|
|
2954
2950
|
_callDrag(e) {
|
|
@@ -2979,7 +2975,7 @@ class Oe extends Ct {
|
|
|
2979
2975
|
/** @internal call when the mouse gets released to drop the item at current location */
|
|
2980
2976
|
_mouseUp(e) {
|
|
2981
2977
|
var t, i;
|
|
2982
|
-
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0),
|
|
2978
|
+
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), he && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", Je, !0), e.currentTarget.removeEventListener("touchend", et, !0)), this.dragging) {
|
|
2983
2979
|
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = R.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete R.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
2984
2980
|
const s = c.initEvent(e, { target: this.el, type: "dragstop" });
|
|
2985
2981
|
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), R.dropElement && R.dropElement.drop(e);
|
|
@@ -3001,7 +2997,7 @@ class Oe extends Ct {
|
|
|
3001
2997
|
/** @internal create a clone copy (or user defined method) of the original drag item if set */
|
|
3002
2998
|
_createHelper() {
|
|
3003
2999
|
let e = this.el;
|
|
3004
|
-
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 =
|
|
3000
|
+
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 = Me.originStyleProp.map((t) => this.el.style[t]), e;
|
|
3005
3001
|
}
|
|
3006
3002
|
/** @internal set the fix position of the dragged item */
|
|
3007
3003
|
_setupHelperStyle(e) {
|
|
@@ -3018,7 +3014,7 @@ class Oe extends Ct {
|
|
|
3018
3014
|
const e = (t = this.helper) == null ? void 0 : t.gridstackNode;
|
|
3019
3015
|
if (!(e != null && e._isAboutToRemove) && this.dragElementOriginStyle) {
|
|
3020
3016
|
const i = this.helper, s = this.dragElementOriginStyle.transition || null;
|
|
3021
|
-
i.style.transition = this.dragElementOriginStyle.transition = "none",
|
|
3017
|
+
i.style.transition = this.dragElementOriginStyle.transition = "none", Me.originStyleProp.forEach((r) => i.style[r] = this.dragElementOriginStyle[r] || null), setTimeout(() => i.style.transition = s, 50);
|
|
3022
3018
|
}
|
|
3023
3019
|
return delete this.dragElementOriginStyle, this;
|
|
3024
3020
|
}
|
|
@@ -3035,14 +3031,14 @@ class Oe extends Ct {
|
|
|
3035
3031
|
_getDragOffset(e, t, i) {
|
|
3036
3032
|
let s = 0, r = 0;
|
|
3037
3033
|
i && (s = this.dragTransform.xOffset, r = this.dragTransform.yOffset);
|
|
3038
|
-
const
|
|
3034
|
+
const a = t.getBoundingClientRect();
|
|
3039
3035
|
return {
|
|
3040
|
-
left:
|
|
3041
|
-
top:
|
|
3042
|
-
offsetLeft: -e.clientX +
|
|
3043
|
-
offsetTop: -e.clientY +
|
|
3044
|
-
width:
|
|
3045
|
-
height:
|
|
3036
|
+
left: a.left,
|
|
3037
|
+
top: a.top,
|
|
3038
|
+
offsetLeft: -e.clientX + a.left - s,
|
|
3039
|
+
offsetTop: -e.clientY + a.top - r,
|
|
3040
|
+
width: a.width * this.dragTransform.xScale,
|
|
3041
|
+
height: a.height * this.dragTransform.yScale
|
|
3046
3042
|
};
|
|
3047
3043
|
}
|
|
3048
3044
|
/** @internal TODO: set to public as called by DDDroppable! */
|
|
@@ -3060,8 +3056,8 @@ class Oe extends Ct {
|
|
|
3060
3056
|
};
|
|
3061
3057
|
}
|
|
3062
3058
|
}
|
|
3063
|
-
|
|
3064
|
-
class xr extends
|
|
3059
|
+
Me.originStyleProp = ["width", "height", "transform", "transform-origin", "transition", "pointerEvents", "position", "left", "top", "minWidth", "willChange"];
|
|
3060
|
+
class xr extends xt {
|
|
3065
3061
|
constructor(e, t = {}) {
|
|
3066
3062
|
super(), this.el = e, this.option = t, this._mouseEnter = this._mouseEnter.bind(this), this._mouseLeave = this._mouseLeave.bind(this), this.enable(), this._setupAccept();
|
|
3067
3063
|
}
|
|
@@ -3072,10 +3068,10 @@ class xr extends Ct {
|
|
|
3072
3068
|
super.off(e);
|
|
3073
3069
|
}
|
|
3074
3070
|
enable() {
|
|
3075
|
-
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),
|
|
3071
|
+
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), he && (this.el.addEventListener("pointerenter", Xt), this.el.addEventListener("pointerleave", Zt)));
|
|
3076
3072
|
}
|
|
3077
3073
|
disable(e = !1) {
|
|
3078
|
-
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),
|
|
3074
|
+
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), he && (this.el.removeEventListener("pointerenter", Xt), this.el.removeEventListener("pointerleave", Zt)));
|
|
3079
3075
|
}
|
|
3080
3076
|
destroy() {
|
|
3081
3077
|
this.disable(!0), this.el.classList.remove("ui-droppable"), this.el.classList.remove("ui-droppable-disabled"), super.destroy();
|
|
@@ -3099,9 +3095,9 @@ class xr extends Ct {
|
|
|
3099
3095
|
e.preventDefault(), e.stopPropagation();
|
|
3100
3096
|
const i = c.initEvent(e, { target: this.el, type: "dropout" });
|
|
3101
3097
|
if (this.option.out && this.option.out(i, this._ui(R.dragElement)), this.triggerEvent("dropout", i), R.dropElement === this && (delete R.dropElement, !t)) {
|
|
3102
|
-
let r,
|
|
3103
|
-
for (; !r &&
|
|
3104
|
-
r = (s =
|
|
3098
|
+
let r, a = this.el.parentElement;
|
|
3099
|
+
for (; !r && a; )
|
|
3100
|
+
r = (s = a.ddElement) == null ? void 0 : s.ddDroppable, a = a.parentElement;
|
|
3105
3101
|
r && r._mouseEnter(e);
|
|
3106
3102
|
}
|
|
3107
3103
|
}
|
|
@@ -3127,9 +3123,9 @@ class xr extends Ct {
|
|
|
3127
3123
|
};
|
|
3128
3124
|
}
|
|
3129
3125
|
}
|
|
3130
|
-
class
|
|
3126
|
+
class Ct {
|
|
3131
3127
|
static init(e) {
|
|
3132
|
-
return e.ddElement || (e.ddElement = new
|
|
3128
|
+
return e.ddElement || (e.ddElement = new Ct(e)), e.ddElement;
|
|
3133
3129
|
}
|
|
3134
3130
|
constructor(e) {
|
|
3135
3131
|
this.el = e;
|
|
@@ -3141,13 +3137,13 @@ class Rt {
|
|
|
3141
3137
|
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;
|
|
3142
3138
|
}
|
|
3143
3139
|
setupDraggable(e) {
|
|
3144
|
-
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new
|
|
3140
|
+
return this.ddDraggable ? this.ddDraggable.updateOption(e) : this.ddDraggable = new Me(this.el, e), this;
|
|
3145
3141
|
}
|
|
3146
3142
|
cleanDraggable() {
|
|
3147
3143
|
return this.ddDraggable && (this.ddDraggable.destroy(), delete this.ddDraggable), this;
|
|
3148
3144
|
}
|
|
3149
3145
|
setupResizable(e) {
|
|
3150
|
-
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new
|
|
3146
|
+
return this.ddResizable ? this.ddResizable.updateOption(e) : this.ddResizable = new Ie(this.el, e), this;
|
|
3151
3147
|
}
|
|
3152
3148
|
cleanResizable() {
|
|
3153
3149
|
return this.ddResizable && (this.ddResizable.destroy(), delete this.ddResizable), this;
|
|
@@ -3193,9 +3189,9 @@ class Cr {
|
|
|
3193
3189
|
else if (t === "option")
|
|
3194
3190
|
r.setupDraggable({ [i]: s });
|
|
3195
3191
|
else {
|
|
3196
|
-
const
|
|
3192
|
+
const a = r.el.gridstackNode.grid;
|
|
3197
3193
|
r.setupDraggable({
|
|
3198
|
-
...
|
|
3194
|
+
...a.opts.draggable,
|
|
3199
3195
|
// containment: (grid.parentGridNode && grid.opts.dragOut === false) ? grid.el.parentElement : (grid.opts.draggable.containment || null),
|
|
3200
3196
|
start: t.start,
|
|
3201
3197
|
stop: t.stop,
|
|
@@ -3238,7 +3234,7 @@ class Cr {
|
|
|
3238
3234
|
/** @internal returns a list of DD elements, creating them on the fly by default unless option is to destroy or disable */
|
|
3239
3235
|
_getDDElements(e, t) {
|
|
3240
3236
|
const i = e.gridstack || t !== "destroy" && t !== "disable", s = c.getElements(e);
|
|
3241
|
-
return s.length ? s.map((
|
|
3237
|
+
return s.length ? s.map((a) => a.ddElement || (i ? Ct.init(a) : null)).filter((a) => a) : [];
|
|
3242
3238
|
}
|
|
3243
3239
|
}
|
|
3244
3240
|
/*!
|
|
@@ -3298,8 +3294,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3298
3294
|
return null;
|
|
3299
3295
|
let i = e;
|
|
3300
3296
|
if (i.gridstack) {
|
|
3301
|
-
const
|
|
3302
|
-
return t && (
|
|
3297
|
+
const a = i.gridstack;
|
|
3298
|
+
return t && (a.opts = { ...a.opts, ...t }), t.children !== void 0 && a.load(t.children), a;
|
|
3303
3299
|
}
|
|
3304
3300
|
return (!e.classList.contains("grid-stack") || b.addRemoveCB) && (b.addRemoveCB ? i = b.addRemoveCB(e, t, !0, !0) : i = c.createDiv(["grid-stack", t.class], e)), b.init(t, i);
|
|
3305
3301
|
}
|
|
@@ -3313,7 +3309,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3313
3309
|
/** @internal create placeholder DIV as needed */
|
|
3314
3310
|
get placeholder() {
|
|
3315
3311
|
if (!this._placeholder) {
|
|
3316
|
-
this._placeholder = c.createDiv([this.opts.placeholderClass,
|
|
3312
|
+
this._placeholder = c.createDiv([this.opts.placeholderClass, ie.itemClass, this.opts.itemClass]);
|
|
3317
3313
|
const e = c.createDiv(["placeholder-content"], this._placeholder);
|
|
3318
3314
|
this.opts.placeholderText && (e.textContent = this.opts.placeholderText);
|
|
3319
3315
|
}
|
|
@@ -3325,7 +3321,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3325
3321
|
* @param opts grid options - public for classes to access, but use methods to modify!
|
|
3326
3322
|
*/
|
|
3327
3323
|
constructor(e, t = {}) {
|
|
3328
|
-
var u, f,
|
|
3324
|
+
var u, f, m;
|
|
3329
3325
|
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);
|
|
3330
3326
|
const i = c.toNumber(e.getAttribute("gs-row"));
|
|
3331
3327
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
@@ -3334,48 +3330,48 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3334
3330
|
if (r.oneColumnModeDomSort && (delete r.oneColumnModeDomSort, console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")), r.oneColumnSize || r.disableOneColumnMode === !1) {
|
|
3335
3331
|
const p = r.oneColumnSize || 768;
|
|
3336
3332
|
delete r.oneColumnSize, delete r.disableOneColumnMode, t.columnOpts = t.columnOpts || {}, s = t.columnOpts.breakpoints = t.columnOpts.breakpoints || [];
|
|
3337
|
-
let y = s.find((
|
|
3333
|
+
let y = s.find((g) => g.c === 1);
|
|
3338
3334
|
y ? y.w = p : (y = { c: 1, w: p }, s.push(y, { c: 12, w: p + 1 }));
|
|
3339
3335
|
}
|
|
3340
|
-
const
|
|
3341
|
-
|
|
3336
|
+
const a = t.columnOpts;
|
|
3337
|
+
a && (!a.columnWidth && !((f = a.breakpoints) != null && f.length) ? (delete t.columnOpts, s = void 0) : a.columnMax = a.columnMax || 12), (s == null ? void 0 : s.length) > 1 && s.sort((p, y) => (y.w || 0) - (p.w || 0));
|
|
3342
3338
|
const n = {
|
|
3343
|
-
...c.cloneDeep(
|
|
3344
|
-
column: c.toNumber(e.getAttribute("gs-column")) ||
|
|
3345
|
-
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) ||
|
|
3346
|
-
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) ||
|
|
3347
|
-
staticGrid: c.toBool(e.getAttribute("gs-static")) ||
|
|
3339
|
+
...c.cloneDeep(ie),
|
|
3340
|
+
column: c.toNumber(e.getAttribute("gs-column")) || ie.column,
|
|
3341
|
+
minRow: i || c.toNumber(e.getAttribute("gs-min-row")) || ie.minRow,
|
|
3342
|
+
maxRow: i || c.toNumber(e.getAttribute("gs-max-row")) || ie.maxRow,
|
|
3343
|
+
staticGrid: c.toBool(e.getAttribute("gs-static")) || ie.staticGrid,
|
|
3348
3344
|
sizeToContent: c.toBool(e.getAttribute("gs-size-to-content")) || void 0,
|
|
3349
3345
|
draggable: {
|
|
3350
|
-
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") ||
|
|
3346
|
+
handle: (t.handleClass ? "." + t.handleClass : t.handle ? t.handle : "") || ie.draggable.handle
|
|
3351
3347
|
},
|
|
3352
3348
|
removableOptions: {
|
|
3353
|
-
accept: t.itemClass ||
|
|
3354
|
-
decline:
|
|
3349
|
+
accept: t.itemClass || ie.removableOptions.accept,
|
|
3350
|
+
decline: ie.removableOptions.decline
|
|
3355
3351
|
}
|
|
3356
3352
|
};
|
|
3357
3353
|
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");
|
|
3358
|
-
const d = this.el.closest("." +
|
|
3359
|
-
l && (l.subGrid = this, this.parentGridNode = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !==
|
|
3360
|
-
const h = t.engineClass || b.engineClass ||
|
|
3354
|
+
const d = this.el.closest("." + ie.itemClass), l = d == null ? void 0 : d.gridstackNode;
|
|
3355
|
+
l && (l.subGrid = this, this.parentGridNode = l, this.el.classList.add("grid-stack-nested"), l.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !== ie.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = he), this._styleSheetClass = "gs-id-" + de._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
3356
|
+
const h = t.engineClass || b.engineClass || de;
|
|
3361
3357
|
if (this.engine = new h({
|
|
3362
3358
|
column: this.getColumn(),
|
|
3363
3359
|
float: t.float,
|
|
3364
3360
|
maxRow: t.maxRow,
|
|
3365
3361
|
onChange: (p) => {
|
|
3366
3362
|
let y = 0;
|
|
3367
|
-
this.engine.nodes.forEach((
|
|
3368
|
-
y = Math.max(y,
|
|
3369
|
-
}), p.forEach((
|
|
3370
|
-
const
|
|
3371
|
-
|
|
3363
|
+
this.engine.nodes.forEach((g) => {
|
|
3364
|
+
y = Math.max(y, g.y + g.h);
|
|
3365
|
+
}), p.forEach((g) => {
|
|
3366
|
+
const k = g.el;
|
|
3367
|
+
k && (g._removeDOM ? (k && k.remove(), delete g._removeDOM) : this._writePosAttr(k, g));
|
|
3372
3368
|
}), this._updateStyles(!1, y);
|
|
3373
3369
|
}
|
|
3374
3370
|
}), 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) {
|
|
3375
3371
|
const p = t.children;
|
|
3376
3372
|
delete t.children, p.length && this.load(p);
|
|
3377
3373
|
}
|
|
3378
|
-
this.setAnimation(), t.subGridDynamic && !R.pauseDrag && (R.pauseDrag = !0), ((
|
|
3374
|
+
this.setAnimation(), t.subGridDynamic && !R.pauseDrag && (R.pauseDrag = !0), ((m = t.draggable) == null ? void 0 : m.pause) !== void 0 && (R.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
3379
3375
|
}
|
|
3380
3376
|
/**
|
|
3381
3377
|
* add a new widget and returns it.
|
|
@@ -3409,8 +3405,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3409
3405
|
createWidgetDivs(e) {
|
|
3410
3406
|
const t = c.createDiv(["grid-stack-item", this.opts.itemClass]), i = c.createDiv(["grid-stack-item-content"], t);
|
|
3411
3407
|
return c.lazyLoad(e) ? e.visibleObservable || (e.visibleObservable = new IntersectionObserver(([s]) => {
|
|
3412
|
-
var r,
|
|
3413
|
-
s.isIntersecting && ((r = e.visibleObservable) == null || r.disconnect(), delete e.visibleObservable, b.renderCB(i, e), (
|
|
3408
|
+
var r, a;
|
|
3409
|
+
s.isIntersecting && ((r = e.visibleObservable) == null || r.disconnect(), delete e.visibleObservable, b.renderCB(i, e), (a = e.grid) == null || a.prepareDragDrop(e.el));
|
|
3414
3410
|
}), window.setTimeout(() => {
|
|
3415
3411
|
var s;
|
|
3416
3412
|
return (s = e.visibleObservable) == null ? void 0 : s.observe(t);
|
|
@@ -3426,13 +3422,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3426
3422
|
* @returns newly created grid
|
|
3427
3423
|
*/
|
|
3428
3424
|
makeSubGrid(e, t, i, s = !0) {
|
|
3429
|
-
var
|
|
3425
|
+
var m, p, y;
|
|
3430
3426
|
let r = e.gridstackNode;
|
|
3431
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
3427
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (m = r.subGrid) != null && m.el)
|
|
3432
3428
|
return r.subGrid;
|
|
3433
|
-
let
|
|
3434
|
-
for (; n && !
|
|
3435
|
-
|
|
3429
|
+
let a, n = this;
|
|
3430
|
+
for (; n && !a; )
|
|
3431
|
+
a = (p = n.opts) == null ? void 0 : p.subGridOpts, n = (y = n.parentGridNode) == null ? void 0 : y.grid;
|
|
3436
3432
|
t = c.cloneDeep({
|
|
3437
3433
|
// by default sub-grid inherit from us | parent, other than id, children, etc...
|
|
3438
3434
|
...this.opts,
|
|
@@ -3442,15 +3438,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3442
3438
|
columnOpts: void 0,
|
|
3443
3439
|
layout: "list",
|
|
3444
3440
|
subGridOpts: void 0,
|
|
3445
|
-
...
|
|
3441
|
+
...a || {},
|
|
3446
3442
|
...t || r.subGridOpts || {}
|
|
3447
3443
|
}), r.subGridOpts = t;
|
|
3448
3444
|
let d;
|
|
3449
3445
|
t.column === "auto" && (d = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
|
|
3450
3446
|
let l = r.el.querySelector(".grid-stack-item-content"), h, u;
|
|
3451
3447
|
if (s && (this._removeDD(r.el), u = { ...r, x: 0, y: 0 }, c.removeInternalForSave(u), delete u.subGridOpts, r.content && (u.content = r.content, delete r.content), b.addRemoveCB ? h = b.addRemoveCB(this.el, u, !0, !1) : (h = c.createDiv(["grid-stack-item"]), h.appendChild(l), l = c.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3448
|
+
const g = d ? t.column : r.w, k = r.h + i.h, N = r.el.style;
|
|
3449
|
+
N.transition = "none", this.update(r.el, { w: g, h: k }), setTimeout(() => N.transition = null);
|
|
3454
3450
|
}
|
|
3455
3451
|
const f = r.subGrid = b.addGrid(l, t);
|
|
3456
3452
|
return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(h, u), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
|
|
@@ -3478,11 +3474,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3478
3474
|
save(e = !0, t = !1, i = b.saveCB) {
|
|
3479
3475
|
const s = this.engine.save(e, i);
|
|
3480
3476
|
if (s.forEach((r) => {
|
|
3481
|
-
var
|
|
3477
|
+
var a;
|
|
3482
3478
|
if (e && r.el && !r.subGrid && !i) {
|
|
3483
3479
|
const n = r.el.querySelector(".grid-stack-item-content");
|
|
3484
3480
|
r.content = n == null ? void 0 : n.innerHTML, r.content || delete r.content;
|
|
3485
|
-
} else if (!e && !i && delete r.content, (
|
|
3481
|
+
} else if (!e && !i && delete r.content, (a = r.subGrid) != null && a.el) {
|
|
3486
3482
|
const n = r.subGrid.save(e, t, i);
|
|
3487
3483
|
r.subGridOpts = t ? n : { children: n }, delete r.subGrid;
|
|
3488
3484
|
}
|
|
@@ -3490,8 +3486,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3490
3486
|
}), t) {
|
|
3491
3487
|
const r = c.cloneDeep(this.opts);
|
|
3492
3488
|
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");
|
|
3493
|
-
const
|
|
3494
|
-
return delete r._alwaysShowResizeHandle,
|
|
3489
|
+
const a = r._alwaysShowResizeHandle;
|
|
3490
|
+
return delete r._alwaysShowResizeHandle, a !== void 0 ? r.alwaysShowResizeHandle = a : delete r.alwaysShowResizeHandle, c.removeInternalAndSame(r, ie), r.children = s, r;
|
|
3495
3491
|
}
|
|
3496
3492
|
return s;
|
|
3497
3493
|
}
|
|
@@ -3518,13 +3514,13 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3518
3514
|
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
|
|
3519
3515
|
const r = b.addRemoveCB;
|
|
3520
3516
|
typeof t == "function" && (b.addRemoveCB = t);
|
|
3521
|
-
const
|
|
3517
|
+
const a = [];
|
|
3522
3518
|
this.batchUpdate();
|
|
3523
3519
|
const n = !this.engine.nodes.length;
|
|
3524
3520
|
n && this.setAnimation(!1), !n && t && [...this.engine.nodes].forEach((u) => {
|
|
3525
3521
|
if (!u.id)
|
|
3526
3522
|
return;
|
|
3527
|
-
c.find(e, u.id) || (b.addRemoveCB && b.addRemoveCB(this.el, u, !1, !1),
|
|
3523
|
+
c.find(e, u.id) || (b.addRemoveCB && b.addRemoveCB(this.el, u, !1, !1), a.push(u), this.removeWidget(u.el, !0, !1));
|
|
3528
3524
|
}), this.engine._loading = !0;
|
|
3529
3525
|
const d = [];
|
|
3530
3526
|
return this.engine.nodes = this.engine.nodes.filter((h) => c.find(e, h.id) ? (d.push(h), !1) : !0), e.forEach((h) => {
|
|
@@ -3532,11 +3528,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3532
3528
|
const u = c.find(d, h.id);
|
|
3533
3529
|
if (u) {
|
|
3534
3530
|
if (c.shouldSizeToContent(u) && (h.h = u.h), this.engine.nodeBoundFix(h), (h.autoPosition || h.x === void 0 || h.y === void 0) && (h.w = h.w || u.w, h.h = h.h || u.h, this.engine.findEmptyPosition(h)), this.engine.nodes.push(u), c.samePos(u, h) && this.engine.nodes.length > 1 && (this.moveNode(u, { ...h, forceCollide: !0 }), c.copyPos(h, u)), this.update(u.el, h), (f = h.subGridOpts) != null && f.children) {
|
|
3535
|
-
const
|
|
3536
|
-
|
|
3531
|
+
const m = u.el.querySelector(".grid-stack");
|
|
3532
|
+
m && m.gridstack && m.gridstack.load(h.subGridOpts.children);
|
|
3537
3533
|
}
|
|
3538
3534
|
} else t && this.addWidget(h);
|
|
3539
|
-
}), delete this.engine._loading, this.engine.removedNodes =
|
|
3535
|
+
}), delete this.engine._loading, this.engine.removedNodes = a, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? b.addRemoveCB = r : delete b.addRemoveCB, n && ((l = this.opts) != null && l.animate) && this.setAnimation(this.opts.animate, !0), this;
|
|
3540
3536
|
}
|
|
3541
3537
|
/**
|
|
3542
3538
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3600,7 +3596,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3600
3596
|
}
|
|
3601
3597
|
/** checks for dynamic column count for our current size, returning true if changed */
|
|
3602
3598
|
checkDynamicColumn() {
|
|
3603
|
-
var r,
|
|
3599
|
+
var r, a;
|
|
3604
3600
|
const e = this.opts.columnOpts;
|
|
3605
3601
|
if (!e || !e.columnWidth && !((r = e.breakpoints) != null && r.length))
|
|
3606
3602
|
return !1;
|
|
@@ -3616,7 +3612,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3616
3612
|
i = e.breakpoints[n++].c || t;
|
|
3617
3613
|
}
|
|
3618
3614
|
if (i !== t) {
|
|
3619
|
-
const n = (
|
|
3615
|
+
const n = (a = e.breakpoints) == null ? void 0 : a.find((d) => d.c === i);
|
|
3620
3616
|
return this.column(i, (n == null ? void 0 : n.layout) || e.layout), !0;
|
|
3621
3617
|
}
|
|
3622
3618
|
return !1;
|
|
@@ -3694,8 +3690,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3694
3690
|
const i = this.el.getBoundingClientRect();
|
|
3695
3691
|
let s;
|
|
3696
3692
|
t ? s = { top: i.top + document.documentElement.scrollTop, left: i.left } : s = { top: this.el.offsetTop, left: this.el.offsetLeft };
|
|
3697
|
-
const r = e.left - s.left,
|
|
3698
|
-
return { x: Math.floor(r / n), y: Math.floor(
|
|
3693
|
+
const r = e.left - s.left, a = e.top - s.top, n = i.width / this.getColumn(), d = i.height / parseInt(this.el.getAttribute("gs-current-row"));
|
|
3694
|
+
return { x: Math.floor(r / n), y: Math.floor(a / d) };
|
|
3699
3695
|
}
|
|
3700
3696
|
/** returns the current number of rows, which will be at least `minRow` if set */
|
|
3701
3697
|
getRow() {
|
|
@@ -3761,7 +3757,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3761
3757
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3762
3758
|
return;
|
|
3763
3759
|
let r = s.gridstackNode;
|
|
3764
|
-
r || (r = this.engine.nodes.find((
|
|
3760
|
+
r || (r = this.engine.nodes.find((a) => s === a.el)), r && (t && b.addRemoveCB && b.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3765
3761
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this) : (console.error("Error: GridStack.removeWidget(undefined) called"), this);
|
|
3766
3762
|
}
|
|
3767
3763
|
/**
|
|
@@ -3823,9 +3819,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3823
3819
|
return;
|
|
3824
3820
|
const r = { ...c.copyPos({}, s), ...c.cloneDeep(t) };
|
|
3825
3821
|
this.engine.nodeBoundFix(r), delete r.autoPosition;
|
|
3826
|
-
const
|
|
3822
|
+
const a = ["x", "y", "w", "h"];
|
|
3827
3823
|
let n;
|
|
3828
|
-
if (
|
|
3824
|
+
if (a.some((u) => r[u] !== void 0 && r[u] !== s[u]) && (n = {}, a.forEach((u) => {
|
|
3829
3825
|
n[u] = r[u] !== void 0 ? r[u] : s[u], delete r[u];
|
|
3830
3826
|
})), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
|
|
3831
3827
|
const u = i.querySelector(".grid-stack-item-content");
|
|
@@ -3852,7 +3848,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3852
3848
|
* @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
|
|
3853
3849
|
*/
|
|
3854
3850
|
resizeToContent(e) {
|
|
3855
|
-
var f,
|
|
3851
|
+
var f, m;
|
|
3856
3852
|
if (!e || (e.classList.remove("size-to-content-max"), !e.clientHeight))
|
|
3857
3853
|
return;
|
|
3858
3854
|
const t = e.gridstackNode;
|
|
@@ -3864,20 +3860,20 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3864
3860
|
const s = i.getCellHeight(!0);
|
|
3865
3861
|
if (!s)
|
|
3866
3862
|
return;
|
|
3867
|
-
let r = t.h ? t.h * s : e.clientHeight,
|
|
3868
|
-
if (t.resizeToContentParent && (
|
|
3863
|
+
let r = t.h ? t.h * s : e.clientHeight, a;
|
|
3864
|
+
if (t.resizeToContentParent && (a = e.querySelector(t.resizeToContentParent)), a || (a = e.querySelector(b.resizeToContentParent)), !a)
|
|
3869
3865
|
return;
|
|
3870
|
-
const n = e.clientHeight -
|
|
3866
|
+
const n = e.clientHeight - a.clientHeight, d = t.h ? t.h * s - n : a.clientHeight;
|
|
3871
3867
|
let l;
|
|
3872
3868
|
if (t.subGrid) {
|
|
3873
3869
|
l = t.subGrid.getRow() * t.subGrid.getCellHeight(!0);
|
|
3874
3870
|
const p = t.subGrid.el.getBoundingClientRect(), y = t.subGrid.el.parentElement.getBoundingClientRect();
|
|
3875
3871
|
l += p.top - y.top;
|
|
3876
3872
|
} else {
|
|
3877
|
-
if ((
|
|
3873
|
+
if ((m = (f = t.subGridOpts) == null ? void 0 : f.children) != null && m.length)
|
|
3878
3874
|
return;
|
|
3879
3875
|
{
|
|
3880
|
-
const p =
|
|
3876
|
+
const p = a.firstElementChild;
|
|
3881
3877
|
if (!p) {
|
|
3882
3878
|
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${b.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
3883
3879
|
return;
|
|
@@ -3913,8 +3909,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3913
3909
|
Object.keys(r).forEach((n) => {
|
|
3914
3910
|
r[n] === void 0 && delete r[n];
|
|
3915
3911
|
});
|
|
3916
|
-
const
|
|
3917
|
-
this.update(i, r), s._orig =
|
|
3912
|
+
const a = s._orig;
|
|
3913
|
+
this.update(i, r), s._orig = a;
|
|
3918
3914
|
}), this;
|
|
3919
3915
|
}
|
|
3920
3916
|
/**
|
|
@@ -4005,8 +4001,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4005
4001
|
return this;
|
|
4006
4002
|
const i = this.opts.cellHeight, s = this.opts.cellHeightUnit, r = `.${this._styleSheetClass} > .${this.opts.itemClass}`;
|
|
4007
4003
|
if (!this._styles) {
|
|
4008
|
-
const
|
|
4009
|
-
if (this._styles = c.createStylesheet(this._styleSheetClass,
|
|
4004
|
+
const a = this.opts.styleInHead ? void 0 : this.el.parentNode;
|
|
4005
|
+
if (this._styles = c.createStylesheet(this._styleSheetClass, a, {
|
|
4010
4006
|
nonce: this.opts.nonce
|
|
4011
4007
|
}), !this._styles)
|
|
4012
4008
|
return this;
|
|
@@ -4015,9 +4011,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4015
4011
|
c.addCSSRule(this._styles, u, `top: ${n}; right: ${l}; bottom: ${d}; left: ${h};`), c.addCSSRule(this._styles, f, `top: ${n}; right: ${l}; bottom: ${d}; left: ${h};`), 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: ${l}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${l}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${l}; bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${h}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${h}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${h}; bottom: ${d}`);
|
|
4016
4012
|
}
|
|
4017
4013
|
if (t = t || this._styles._max, t > this._styles._max) {
|
|
4018
|
-
const
|
|
4014
|
+
const a = (n) => i * n + s;
|
|
4019
4015
|
for (let n = this._styles._max + 1; n <= t; n++)
|
|
4020
|
-
c.addCSSRule(this._styles, `${r}[gs-y="${n}"]`, `top: ${
|
|
4016
|
+
c.addCSSRule(this._styles, `${r}[gs-y="${n}"]`, `top: ${a(n)}`), c.addCSSRule(this._styles, `${r}[gs-h="${n + 1}"]`, `height: ${a(n + 1)}`);
|
|
4021
4017
|
this._styles._max = t;
|
|
4022
4018
|
}
|
|
4023
4019
|
return this;
|
|
@@ -4034,15 +4030,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4034
4030
|
if (!e) {
|
|
4035
4031
|
const r = c.parseHeight(getComputedStyle(this.el).minHeight);
|
|
4036
4032
|
if (r.h > 0 && r.unit === s) {
|
|
4037
|
-
const
|
|
4038
|
-
t <
|
|
4033
|
+
const a = Math.floor(r.h / i);
|
|
4034
|
+
t < a && (t = a);
|
|
4039
4035
|
}
|
|
4040
4036
|
}
|
|
4041
4037
|
return this.el.setAttribute("gs-current-row", String(t)), this.el.style.removeProperty("min-height"), this.el.style.removeProperty("height"), t && (this.el.style[e ? "minHeight" : "height"] = t * i + s), e && !e.grid.engine.batchMode && c.shouldSizeToContent(e) && e.grid.resizeToContentCBCheck(e.el), this;
|
|
4042
4038
|
}
|
|
4043
4039
|
/** @internal */
|
|
4044
4040
|
_prepareElement(e, t = !1, i) {
|
|
4045
|
-
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(
|
|
4041
|
+
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(ie.itemClass, this.opts.itemClass);
|
|
4046
4042
|
const s = c.shouldSizeToContent(i);
|
|
4047
4043
|
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;
|
|
4048
4044
|
}
|
|
@@ -4160,8 +4156,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4160
4156
|
* @param root optional root which defaults to document (for shadow dom pass the parent HTMLDocument)
|
|
4161
4157
|
*/
|
|
4162
4158
|
static setupDragIn(e, t, i, s = document) {
|
|
4163
|
-
(t == null ? void 0 : t.pause) !== void 0 && (R.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((
|
|
4164
|
-
j.isDraggable(
|
|
4159
|
+
(t == null ? void 0 : t.pause) !== void 0 && (R.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((a, n) => {
|
|
4160
|
+
j.isDraggable(a) || j.dragIn(a, t), i != null && i[n] && (a.gridstackNode = i[n]);
|
|
4165
4161
|
});
|
|
4166
4162
|
}
|
|
4167
4163
|
/**
|
|
@@ -4247,18 +4243,18 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4247
4243
|
if (this.opts.staticGrid || !this.opts.acceptWidgets && !this.opts.removable)
|
|
4248
4244
|
return j.droppable(this.el, "destroy"), this;
|
|
4249
4245
|
let e, t;
|
|
4250
|
-
const i = (s, r,
|
|
4246
|
+
const i = (s, r, a) => {
|
|
4251
4247
|
var f;
|
|
4252
|
-
|
|
4253
|
-
const n =
|
|
4248
|
+
a = a || r;
|
|
4249
|
+
const n = a.gridstackNode;
|
|
4254
4250
|
if (!n)
|
|
4255
4251
|
return;
|
|
4256
4252
|
if (!((f = n.grid) != null && f.el)) {
|
|
4257
|
-
|
|
4258
|
-
const
|
|
4259
|
-
|
|
4253
|
+
a.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
|
|
4254
|
+
const m = a.getBoundingClientRect();
|
|
4255
|
+
a.style.left = m.x + (this.dragTransform.xScale - 1) * (s.clientX - m.x) / this.dragTransform.xScale + "px", a.style.top = m.y + (this.dragTransform.yScale - 1) * (s.clientY - m.y) / this.dragTransform.yScale + "px", a.style.transformOrigin = "0px 0px";
|
|
4260
4256
|
}
|
|
4261
|
-
let { top: d, left: l } =
|
|
4257
|
+
let { top: d, left: l } = a.getBoundingClientRect();
|
|
4262
4258
|
const h = this.el.getBoundingClientRect();
|
|
4263
4259
|
l -= h.left, d -= h.top;
|
|
4264
4260
|
const u = {
|
|
@@ -4275,9 +4271,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4275
4271
|
}
|
|
4276
4272
|
n._willFitPos && (c.copyPos(n, n._willFitPos), delete n._willFitPos);
|
|
4277
4273
|
}
|
|
4278
|
-
this._onStartMoving(
|
|
4274
|
+
this._onStartMoving(a, s, u, n, t, e);
|
|
4279
4275
|
} else
|
|
4280
|
-
this._dragOrResize(
|
|
4276
|
+
this._dragOrResize(a, s, u, n, t, e);
|
|
4281
4277
|
};
|
|
4282
4278
|
return j.droppable(this.el, {
|
|
4283
4279
|
accept: (s) => {
|
|
@@ -4286,57 +4282,57 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4286
4282
|
return !0;
|
|
4287
4283
|
if (!this.opts.acceptWidgets)
|
|
4288
4284
|
return !1;
|
|
4289
|
-
let
|
|
4285
|
+
let a = !0;
|
|
4290
4286
|
if (typeof this.opts.acceptWidgets == "function")
|
|
4291
|
-
|
|
4287
|
+
a = this.opts.acceptWidgets(s);
|
|
4292
4288
|
else {
|
|
4293
4289
|
const n = this.opts.acceptWidgets === !0 ? ".grid-stack-item" : this.opts.acceptWidgets;
|
|
4294
|
-
|
|
4290
|
+
a = s.matches(n);
|
|
4295
4291
|
}
|
|
4296
|
-
if (
|
|
4292
|
+
if (a && r && this.opts.maxRow) {
|
|
4297
4293
|
const n = { w: r.w, h: r.h, minW: r.minW, minH: r.minH };
|
|
4298
|
-
|
|
4294
|
+
a = this.engine.willItFit(n);
|
|
4299
4295
|
}
|
|
4300
|
-
return
|
|
4296
|
+
return a;
|
|
4301
4297
|
}
|
|
4302
|
-
}).on(this.el, "dropover", (s, r,
|
|
4303
|
-
let n = (
|
|
4298
|
+
}).on(this.el, "dropover", (s, r, a) => {
|
|
4299
|
+
let n = (a == null ? void 0 : a.gridstackNode) || r.gridstackNode;
|
|
4304
4300
|
if ((n == null ? void 0 : n.grid) === this && !n._temporaryRemoved)
|
|
4305
4301
|
return !1;
|
|
4306
|
-
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,
|
|
4307
|
-
const h =
|
|
4302
|
+
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, a), a = a || r, t = this.cellWidth(), e = this.getCellHeight(!0), !n) {
|
|
4303
|
+
const h = a.getAttribute("data-gs-widget") || a.getAttribute("gridstacknode");
|
|
4308
4304
|
if (h) {
|
|
4309
4305
|
try {
|
|
4310
4306
|
n = JSON.parse(h);
|
|
4311
4307
|
} catch {
|
|
4312
4308
|
console.error("Gridstack dropover: Bad JSON format: ", h);
|
|
4313
4309
|
}
|
|
4314
|
-
|
|
4310
|
+
a.removeAttribute("data-gs-widget"), a.removeAttribute("gridstacknode");
|
|
4315
4311
|
}
|
|
4316
|
-
n || (n = this._readAttr(
|
|
4312
|
+
n || (n = this._readAttr(a)), n._sidebarOrig = { w: n.w, h: n.h };
|
|
4317
4313
|
}
|
|
4318
|
-
n.grid || (n.el || (n = { ...n }), n._isExternal = !0,
|
|
4319
|
-
const d = n.w || Math.round(
|
|
4314
|
+
n.grid || (n.el || (n = { ...n }), n._isExternal = !0, a.gridstackNode = n);
|
|
4315
|
+
const d = n.w || Math.round(a.offsetWidth / t) || 1, l = n.h || Math.round(a.offsetHeight / e) || 1;
|
|
4320
4316
|
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h: l, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
|
|
4321
|
-
n._temporaryRemoved = !0) : (n.w = d, n.h = l, n._temporaryRemoved = !0), b._itemRemoving(n.el, !1), j.on(r, "drag", i), i(s, r,
|
|
4322
|
-
}).on(this.el, "dropout", (s, r,
|
|
4323
|
-
const n = (
|
|
4324
|
-
return n && (!n.grid || n.grid === this) && (this._leave(r,
|
|
4325
|
-
}).on(this.el, "drop", (s, r,
|
|
4326
|
-
var
|
|
4327
|
-
const n = (
|
|
4317
|
+
n._temporaryRemoved = !0) : (n.w = d, n.h = l, n._temporaryRemoved = !0), b._itemRemoving(n.el, !1), j.on(r, "drag", i), i(s, r, a), !1;
|
|
4318
|
+
}).on(this.el, "dropout", (s, r, a) => {
|
|
4319
|
+
const n = (a == null ? void 0 : a.gridstackNode) || r.gridstackNode;
|
|
4320
|
+
return n && (!n.grid || n.grid === this) && (this._leave(r, a), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
4321
|
+
}).on(this.el, "drop", (s, r, a) => {
|
|
4322
|
+
var m, p, y;
|
|
4323
|
+
const n = (a == null ? void 0 : a.gridstackNode) || r.gridstackNode;
|
|
4328
4324
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
4329
4325
|
return !1;
|
|
4330
|
-
const d = !!this.placeholder.parentElement, l = r !==
|
|
4326
|
+
const d = !!this.placeholder.parentElement, l = r !== a;
|
|
4331
4327
|
this.placeholder.remove(), delete this.placeholder.gridstackNode;
|
|
4332
4328
|
const h = d && this.opts.animate;
|
|
4333
4329
|
h && this.setAnimation(!1);
|
|
4334
4330
|
const u = r._gridstackNodeOrig;
|
|
4335
4331
|
if (delete r._gridstackNodeOrig, d && (u != null && u.grid) && u.grid !== this) {
|
|
4336
|
-
const
|
|
4337
|
-
|
|
4332
|
+
const g = u.grid;
|
|
4333
|
+
g.engine.removeNodeFromLayoutCache(u), g.engine.removedNodes.push(u), g._triggerRemoveEvent()._triggerChangeEvent(), g.parentGridNode && !g.engine.nodes.length && g.opts.subGridDynamic && g.removeAsSubGrid();
|
|
4338
4334
|
}
|
|
4339
|
-
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (
|
|
4335
|
+
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (m = n.grid) == null || delete m._isTemp, j.off(r, "drag"), a !== r ? (a.remove(), r = a) : r.remove(), this._removeDD(r), !d))
|
|
4340
4336
|
return !1;
|
|
4341
4337
|
const f = (y = (p = n.subGrid) == null ? void 0 : p.el) == null ? void 0 : y.gridstack;
|
|
4342
4338
|
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), l && (n.content || n.subGridOpts || b.addRemoveCB) ? (delete n.el, r = this.addWidget(n)) : (this._prepareElement(r, !0, n), this.el.appendChild(r), this.resizeToContentCheck(!1, n), f && (f.parentGridNode = n, f.opts.styleInHead || f._updateStyles(!0)), this._updateContainerHeight()), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, u && u.grid ? u : void 0, n), h && this.setAnimation(this.opts.animate, !0), !1;
|
|
@@ -4365,25 +4361,25 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4365
4361
|
const i = e == null ? void 0 : e.gridstackNode;
|
|
4366
4362
|
if (!i)
|
|
4367
4363
|
return;
|
|
4368
|
-
const s = i.noMove || this.opts.disableDrag, r = i.noResize || this.opts.disableResize,
|
|
4369
|
-
if ((t ||
|
|
4364
|
+
const s = i.noMove || this.opts.disableDrag, r = i.noResize || this.opts.disableResize, a = this.opts.staticGrid || s && r;
|
|
4365
|
+
if ((t || a) && (i._initDD && (this._removeDD(e), delete i._initDD), a && e.classList.add("ui-draggable-disabled", "ui-resizable-disabled"), !t))
|
|
4370
4366
|
return this;
|
|
4371
4367
|
if (!i._initDD) {
|
|
4372
4368
|
let n, d;
|
|
4373
|
-
const l = (f,
|
|
4374
|
-
this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(e, f,
|
|
4375
|
-
}, h = (f,
|
|
4376
|
-
this._dragOrResize(e, f,
|
|
4369
|
+
const l = (f, m) => {
|
|
4370
|
+
this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(), d = this.getCellHeight(!0), this._onStartMoving(e, f, m, i, n, d);
|
|
4371
|
+
}, h = (f, m) => {
|
|
4372
|
+
this._dragOrResize(e, f, m, i, n, d);
|
|
4377
4373
|
}, u = (f) => {
|
|
4378
4374
|
this.placeholder.remove(), delete this.placeholder.gridstackNode, delete i._moving, delete i._event, delete i._lastTried;
|
|
4379
|
-
const
|
|
4375
|
+
const m = i.w !== i._orig.w, p = f.target;
|
|
4380
4376
|
if (!(!p.gridstackNode || p.gridstackNode.grid !== this)) {
|
|
4381
4377
|
if (i.el = p, i._isAboutToRemove) {
|
|
4382
4378
|
const y = e.gridstackNode.grid;
|
|
4383
4379
|
y._gsEventHandler[f.type] && y._gsEventHandler[f.type](f, p), y.engine.nodes.push(i), y.removeWidget(e, !0, !0);
|
|
4384
4380
|
} else
|
|
4385
4381
|
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);
|
|
4386
|
-
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(
|
|
4382
|
+
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(m, i));
|
|
4387
4383
|
}
|
|
4388
4384
|
};
|
|
4389
4385
|
j.draggable(e, {
|
|
@@ -4399,7 +4395,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4399
4395
|
return j.draggable(e, s ? "disable" : "enable").resizable(e, r ? "disable" : "enable"), this;
|
|
4400
4396
|
}
|
|
4401
4397
|
/** @internal handles actual drag/resize start */
|
|
4402
|
-
_onStartMoving(e, t, i, s, r,
|
|
4398
|
+
_onStartMoving(e, t, i, s, r, a) {
|
|
4403
4399
|
var n;
|
|
4404
4400
|
if (this.engine.cleanNodes().beginUpdate(s), this._writePosAttr(this.placeholder, s), this.el.appendChild(this.placeholder), this.placeholder.gridstackNode = s, (n = s.grid) != null && n.el)
|
|
4405
4401
|
this.dragTransform = c.getValuesFromTransformedElement(e);
|
|
@@ -4413,49 +4409,49 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4413
4409
|
yScale: 1,
|
|
4414
4410
|
yOffset: 0
|
|
4415
4411
|
};
|
|
4416
|
-
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,
|
|
4412
|
+
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, a, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart") {
|
|
4417
4413
|
const d = this.getColumn() - s.x, l = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
|
|
4418
|
-
j.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, d)).resizable(e, "option", "minHeight",
|
|
4414
|
+
j.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, d)).resizable(e, "option", "minHeight", a * Math.min(s.minH || 1, l)).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", a * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, l)).resizable(e, "option", "maxHeightMoveUp", a * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
|
|
4419
4415
|
}
|
|
4420
4416
|
}
|
|
4421
4417
|
/** @internal handles actual drag/resize */
|
|
4422
|
-
_dragOrResize(e, t, i, s, r,
|
|
4418
|
+
_dragOrResize(e, t, i, s, r, a) {
|
|
4423
4419
|
const n = { ...s._orig };
|
|
4424
4420
|
let d, l = this.opts.marginLeft, h = this.opts.marginRight, u = this.opts.marginTop, f = this.opts.marginBottom;
|
|
4425
|
-
const
|
|
4426
|
-
if (l = Math.min(l, p), h = Math.min(h, p), u = Math.min(u,
|
|
4421
|
+
const m = Math.round(a * 0.1), p = Math.round(r * 0.1);
|
|
4422
|
+
if (l = Math.min(l, p), h = Math.min(h, p), u = Math.min(u, m), f = Math.min(f, m), t.type === "drag") {
|
|
4427
4423
|
if (s._temporaryRemoved)
|
|
4428
4424
|
return;
|
|
4429
|
-
const
|
|
4430
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position,
|
|
4431
|
-
const
|
|
4432
|
-
n.x = Math.round(
|
|
4433
|
-
const
|
|
4425
|
+
const g = i.position.top - s._prevYPix;
|
|
4426
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, g);
|
|
4427
|
+
const k = i.position.left + (i.position.left > s._lastUiPosition.left ? -h : l), N = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : u);
|
|
4428
|
+
n.x = Math.round(k / r), n.y = Math.round(N / a);
|
|
4429
|
+
const v = this._extraDragRow;
|
|
4434
4430
|
if (this.engine.collide(s, n)) {
|
|
4435
|
-
const
|
|
4436
|
-
let
|
|
4437
|
-
this.opts.maxRow &&
|
|
4431
|
+
const M = this.getRow();
|
|
4432
|
+
let A = Math.max(0, n.y + s.h - M);
|
|
4433
|
+
this.opts.maxRow && M + A > this.opts.maxRow && (A = Math.max(0, this.opts.maxRow - M)), this._extraDragRow = A;
|
|
4438
4434
|
} else
|
|
4439
4435
|
this._extraDragRow = 0;
|
|
4440
|
-
if (this._extraDragRow !==
|
|
4436
|
+
if (this._extraDragRow !== v && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
4441
4437
|
return;
|
|
4442
4438
|
} else if (t.type === "resize") {
|
|
4443
|
-
if (n.x < 0 || (c.updateScrollResize(t, e,
|
|
4439
|
+
if (n.x < 0 || (c.updateScrollResize(t, e, a), n.w = Math.round((i.size.width - l) / r), n.h = Math.round((i.size.height - u) / a), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
4444
4440
|
return;
|
|
4445
|
-
const
|
|
4446
|
-
n.x = Math.round(
|
|
4441
|
+
const g = i.position.left + l, k = i.position.top + u;
|
|
4442
|
+
n.x = Math.round(g / r), n.y = Math.round(k / a), d = !0;
|
|
4447
4443
|
}
|
|
4448
4444
|
s._event = t, s._lastTried = n;
|
|
4449
4445
|
const y = {
|
|
4450
4446
|
x: i.position.left + l,
|
|
4451
4447
|
y: i.position.top + u,
|
|
4452
4448
|
w: (i.size ? i.size.width : s.w * r) - l - h,
|
|
4453
|
-
h: (i.size ? i.size.height : s.h *
|
|
4449
|
+
h: (i.size ? i.size.height : s.h * a) - u - f
|
|
4454
4450
|
};
|
|
4455
|
-
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight:
|
|
4456
|
-
s._lastUiPosition = i.position, this.engine.cacheRects(r,
|
|
4457
|
-
const
|
|
4458
|
-
s._sidebarOrig || this._writePosAttr(
|
|
4451
|
+
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: a, rect: y, resizing: d })) {
|
|
4452
|
+
s._lastUiPosition = i.position, this.engine.cacheRects(r, a, u, h, f, l), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4453
|
+
const g = t.target;
|
|
4454
|
+
s._sidebarOrig || this._writePosAttr(g, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, g);
|
|
4459
4455
|
}
|
|
4460
4456
|
}
|
|
4461
4457
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4476,27 +4472,27 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4476
4472
|
return wr(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4477
4473
|
}
|
|
4478
4474
|
}
|
|
4479
|
-
b.renderCB = (
|
|
4480
|
-
|
|
4475
|
+
b.renderCB = (o, e) => {
|
|
4476
|
+
o && (e != null && e.content) && (o.textContent = e.content);
|
|
4481
4477
|
};
|
|
4482
4478
|
b.resizeToContentParent = ".grid-stack-item-content";
|
|
4483
4479
|
b.Utils = c;
|
|
4484
|
-
b.Engine =
|
|
4480
|
+
b.Engine = de;
|
|
4485
4481
|
b.GDRev = "11.5.1";
|
|
4486
4482
|
const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { class: "grid-stack-item-content" }, Tr = /* @__PURE__ */ ee({
|
|
4487
4483
|
__name: "DraggableGridLayout",
|
|
4488
4484
|
props: {
|
|
4489
4485
|
tiles: {},
|
|
4490
|
-
tileHeight: { default:
|
|
4491
|
-
columns: { default:
|
|
4486
|
+
tileHeight: { default: Ge },
|
|
4487
|
+
columns: { default: _t }
|
|
4492
4488
|
},
|
|
4493
4489
|
emits: ["update-tiles"],
|
|
4494
|
-
setup(
|
|
4495
|
-
const i =
|
|
4490
|
+
setup(o, { expose: e, emit: t }) {
|
|
4491
|
+
const i = o, s = t, r = H(null), a = H(new Map(i.tiles.map((m) => [`${m.id}`, m])));
|
|
4496
4492
|
let n = null;
|
|
4497
|
-
const d = (
|
|
4498
|
-
var
|
|
4499
|
-
const y =
|
|
4493
|
+
const d = (m) => `[data-id="${m}"]`, l = (m) => m.map((p) => {
|
|
4494
|
+
var g;
|
|
4495
|
+
const y = a.value.get(`${(g = p.el) == null ? void 0 : g.getAttribute("data-id")}`);
|
|
4500
4496
|
if (y)
|
|
4501
4497
|
return {
|
|
4502
4498
|
...y,
|
|
@@ -4505,17 +4501,17 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4505
4501
|
size: { cols: Number(p.w), rows: Number(p.h) }
|
|
4506
4502
|
}
|
|
4507
4503
|
};
|
|
4508
|
-
}).filter((p) => p !== void 0), h = (
|
|
4509
|
-
n && (l(p).forEach((
|
|
4510
|
-
|
|
4511
|
-
}), s("update-tiles", Array.from(
|
|
4512
|
-
}, u = (
|
|
4504
|
+
}).filter((p) => p !== void 0), h = (m, p) => {
|
|
4505
|
+
n && (l(p).forEach((g) => {
|
|
4506
|
+
a.value.set(`${g.id}`, g);
|
|
4507
|
+
}), s("update-tiles", Array.from(a.value.values())));
|
|
4508
|
+
}, u = (m, p) => {
|
|
4513
4509
|
p.forEach((y) => {
|
|
4514
|
-
var
|
|
4515
|
-
|
|
4516
|
-
}), s("update-tiles", Array.from(
|
|
4510
|
+
var g;
|
|
4511
|
+
a.value.delete(`${(g = y.el) == null ? void 0 : g.getAttribute("data-id")}`);
|
|
4512
|
+
}), s("update-tiles", Array.from(a.value.values()));
|
|
4517
4513
|
};
|
|
4518
|
-
|
|
4514
|
+
st(() => {
|
|
4519
4515
|
r.value && (n = b.init({
|
|
4520
4516
|
margin: 10,
|
|
4521
4517
|
column: i.columns,
|
|
@@ -4523,35 +4519,35 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4523
4519
|
resizable: { handles: "se, sw" },
|
|
4524
4520
|
handle: ".tile-header"
|
|
4525
4521
|
}, r.value), n.on("change", h), n.on("added", h), n.on("removed", u));
|
|
4526
|
-
}),
|
|
4522
|
+
}), Fe(() => {
|
|
4527
4523
|
n && n.destroy(!1);
|
|
4528
4524
|
});
|
|
4529
|
-
const f = (
|
|
4525
|
+
const f = (m) => {
|
|
4530
4526
|
if (n && r.value) {
|
|
4531
|
-
const p = r.value.querySelector(d(
|
|
4527
|
+
const p = r.value.querySelector(d(m));
|
|
4532
4528
|
p && n.removeWidget(p);
|
|
4533
4529
|
}
|
|
4534
4530
|
};
|
|
4535
|
-
return
|
|
4536
|
-
if (
|
|
4531
|
+
return Oe(() => i.tiles.length, async (m, p) => {
|
|
4532
|
+
if (m > p && n) {
|
|
4537
4533
|
const y = i.tiles.slice(p);
|
|
4538
|
-
for (const
|
|
4539
|
-
|
|
4534
|
+
for (const g of y)
|
|
4535
|
+
a.value.set(`${g.id}`, g), await yt(), n.makeWidget(d(g.id), {
|
|
4540
4536
|
autoPosition: !0,
|
|
4541
|
-
w:
|
|
4542
|
-
h:
|
|
4537
|
+
w: g.layout.size.cols,
|
|
4538
|
+
h: g.layout.size.rows
|
|
4543
4539
|
});
|
|
4544
4540
|
}
|
|
4545
|
-
}),
|
|
4546
|
-
i.tiles.forEach((
|
|
4547
|
-
|
|
4541
|
+
}), Jt(() => {
|
|
4542
|
+
i.tiles.forEach((m) => {
|
|
4543
|
+
a.value.set(`${m.id}`, m);
|
|
4548
4544
|
});
|
|
4549
|
-
}), e({ removeWidget: f }), (
|
|
4545
|
+
}), e({ removeWidget: f }), (m, p) => (C(), B("div", {
|
|
4550
4546
|
ref_key: "gridContainer",
|
|
4551
4547
|
ref: r,
|
|
4552
4548
|
class: "grid-stack"
|
|
4553
4549
|
}, [
|
|
4554
|
-
(
|
|
4550
|
+
(C(!0), B(mt, null, ri(i.tiles, (y) => (C(), B("div", {
|
|
4555
4551
|
key: y.id,
|
|
4556
4552
|
class: "grid-stack-item",
|
|
4557
4553
|
"data-id": `${y.id}`,
|
|
@@ -4563,201 +4559,178 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4563
4559
|
"gs-y": y.layout.position.row
|
|
4564
4560
|
}, [
|
|
4565
4561
|
te("div", kr, [
|
|
4566
|
-
|
|
4562
|
+
He(m.$slots, "tile", { tile: y }, void 0, !0)
|
|
4567
4563
|
])
|
|
4568
4564
|
], 8, Rr))), 128))
|
|
4569
4565
|
], 512));
|
|
4570
4566
|
}
|
|
4571
|
-
}), Sr = /* @__PURE__ */
|
|
4572
|
-
const e =
|
|
4573
|
-
...
|
|
4574
|
-
|
|
4575
|
-
};
|
|
4576
|
-
return {
|
|
4577
|
-
id: crypto.randomUUID(),
|
|
4578
|
-
type: "table",
|
|
4579
|
-
definition: {
|
|
4580
|
-
...e,
|
|
4581
|
-
config: t
|
|
4582
|
-
},
|
|
4583
|
-
layout: {
|
|
4584
|
-
position: {
|
|
4585
|
-
col: 0,
|
|
4586
|
-
row: 0
|
|
4587
|
-
},
|
|
4588
|
-
size: a.layout.size
|
|
4589
|
-
}
|
|
4590
|
-
};
|
|
4591
|
-
}, Nr = (a) => {
|
|
4592
|
-
const e = a.meta, t = Dr(e.chart) ? { ...e.chart } : {
|
|
4593
|
-
...e.chart,
|
|
4594
|
-
chart_title: e.chart.chart_title ? `Copy of ${e.chart.chart_title}` : ""
|
|
4567
|
+
}), Sr = /* @__PURE__ */ be(Tr, [["__scopeId", "data-v-1fdec94c"]]), Dr = (o) => {
|
|
4568
|
+
const e = {
|
|
4569
|
+
...o.meta,
|
|
4570
|
+
chart: { ...o.meta.chart }
|
|
4595
4571
|
};
|
|
4596
|
-
return {
|
|
4572
|
+
return "chart_title" in e.chart && (e.chart.chart_title = e.chart.chart_title ? `Copy of ${e.chart.chart_title}` : ""), {
|
|
4597
4573
|
id: crypto.randomUUID(),
|
|
4598
4574
|
type: "chart",
|
|
4599
|
-
definition:
|
|
4600
|
-
...e,
|
|
4601
|
-
chart: t
|
|
4602
|
-
},
|
|
4575
|
+
definition: e,
|
|
4603
4576
|
layout: {
|
|
4604
4577
|
position: {
|
|
4605
4578
|
col: 0,
|
|
4606
4579
|
row: 0
|
|
4607
4580
|
},
|
|
4608
|
-
size:
|
|
4581
|
+
size: o.layout.size
|
|
4609
4582
|
}
|
|
4610
4583
|
};
|
|
4611
|
-
},
|
|
4584
|
+
}, zr = {
|
|
4612
4585
|
key: 0,
|
|
4613
4586
|
class: "fullscreen-header"
|
|
4614
|
-
},
|
|
4587
|
+
}, Nr = {
|
|
4615
4588
|
key: 0,
|
|
4616
4589
|
class: "tile-container slottable-tile"
|
|
4617
|
-
},
|
|
4590
|
+
}, Lr = /* @__PURE__ */ ee({
|
|
4618
4591
|
__name: "DashboardRenderer",
|
|
4619
|
-
props: /* @__PURE__ */
|
|
4592
|
+
props: /* @__PURE__ */ je({
|
|
4620
4593
|
context: {},
|
|
4621
4594
|
preview: { type: Boolean, default: !1 }
|
|
4622
4595
|
}, {
|
|
4623
4596
|
modelValue: { required: !0 },
|
|
4624
4597
|
modelModifiers: {}
|
|
4625
4598
|
}),
|
|
4626
|
-
emits: /* @__PURE__ */
|
|
4627
|
-
setup(
|
|
4628
|
-
|
|
4629
|
-
|
|
4599
|
+
emits: /* @__PURE__ */ je(["edit-tile", "tile-time-range-zoom"], ["update:modelValue"]),
|
|
4600
|
+
setup(o, { expose: e, emit: t }) {
|
|
4601
|
+
pt((D) => ({
|
|
4602
|
+
v39442668: h.value
|
|
4630
4603
|
}));
|
|
4631
|
-
const i = t, s =
|
|
4604
|
+
const i = t, s = ii(o, "modelValue"), { i18n: r } = ae.useI18n(), a = H(0), n = H(null), d = H(), l = H(), h = H("scale(1)"), u = ge(ye);
|
|
4632
4605
|
u || (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")), ae.useRequestQueue();
|
|
4633
|
-
const f = (D,
|
|
4634
|
-
const F = D.layout.position.row -
|
|
4635
|
-
return F !== 0 ? F : D.layout.position.col -
|
|
4636
|
-
},
|
|
4637
|
-
var
|
|
4638
|
-
let
|
|
4639
|
-
const F = D.type ?? "chart", P =
|
|
4606
|
+
const f = (D, z) => {
|
|
4607
|
+
const F = D.layout.position.row - z.layout.position.row;
|
|
4608
|
+
return F !== 0 ? F : D.layout.position.col - z.layout.position.col;
|
|
4609
|
+
}, m = E(() => s.value.tiles.map((D) => {
|
|
4610
|
+
var V;
|
|
4611
|
+
let z = D.definition;
|
|
4612
|
+
const F = D.type ?? "chart", P = z.chart;
|
|
4640
4613
|
if (F === "chart" && "description" in P) {
|
|
4641
|
-
const
|
|
4642
|
-
const { timeSpec:
|
|
4643
|
-
return r.te(
|
|
4614
|
+
const at = z, lt = (V = P.description) == null ? void 0 : V.replace(Rs, () => {
|
|
4615
|
+
const { timeSpec: Ue } = I.value, we = `renderer.trendRange.${Ue.type === "absolute" ? "custom" : Ue.time_range}`;
|
|
4616
|
+
return r.te(we) ? r.t(we) : "";
|
|
4644
4617
|
});
|
|
4645
|
-
|
|
4646
|
-
...
|
|
4618
|
+
z = {
|
|
4619
|
+
...at,
|
|
4647
4620
|
chart: {
|
|
4648
4621
|
...P,
|
|
4649
|
-
description:
|
|
4622
|
+
description: lt
|
|
4650
4623
|
}
|
|
4651
4624
|
};
|
|
4652
4625
|
}
|
|
4653
|
-
return
|
|
4626
|
+
return I.value.editable && !D.id && console.warn(
|
|
4654
4627
|
"No id provided for tile. One will be generated automatically,",
|
|
4655
4628
|
"however tracking changes to this tile may not work as expected.",
|
|
4656
4629
|
D
|
|
4657
4630
|
), {
|
|
4658
4631
|
layout: D.layout,
|
|
4659
|
-
meta:
|
|
4632
|
+
meta: z,
|
|
4660
4633
|
type: F,
|
|
4661
4634
|
// Add a unique key to each tile internally.
|
|
4662
4635
|
id: D.id ?? crypto.randomUUID()
|
|
4663
4636
|
};
|
|
4664
4637
|
})), p = (D) => {
|
|
4665
4638
|
i("edit-tile", D);
|
|
4666
|
-
}, y = (D) => D.type === "chart" && D.meta.chart.type === "slottable",
|
|
4667
|
-
const
|
|
4668
|
-
return
|
|
4669
|
-
},
|
|
4639
|
+
}, y = (D) => D.type === "chart" && D.meta.chart.type === "slottable", g = (D) => D.type === "slottable", k = (D) => {
|
|
4640
|
+
const z = D.meta.chart;
|
|
4641
|
+
return g(z) ? z.id : void 0;
|
|
4642
|
+
}, N = (D) => {
|
|
4670
4643
|
try {
|
|
4671
|
-
const
|
|
4672
|
-
s.value.tiles.push(JSON.parse(JSON.stringify(
|
|
4673
|
-
} catch (
|
|
4674
|
-
console.warn(
|
|
4644
|
+
const z = Dr(D);
|
|
4645
|
+
s.value.tiles.push(JSON.parse(JSON.stringify(z)));
|
|
4646
|
+
} catch (z) {
|
|
4647
|
+
console.warn(z);
|
|
4675
4648
|
}
|
|
4676
|
-
},
|
|
4649
|
+
}, v = (D) => {
|
|
4677
4650
|
n.value && n.value.removeWidget(D.id);
|
|
4678
|
-
},
|
|
4679
|
-
|
|
4680
|
-
},
|
|
4681
|
-
const
|
|
4651
|
+
}, M = () => {
|
|
4652
|
+
a.value++;
|
|
4653
|
+
}, A = (D) => {
|
|
4654
|
+
const z = D.map((F) => ({
|
|
4682
4655
|
id: F.id,
|
|
4683
4656
|
type: F.type,
|
|
4684
4657
|
layout: F.layout,
|
|
4685
4658
|
definition: F.meta
|
|
4686
4659
|
}));
|
|
4687
|
-
s.value.tiles =
|
|
4688
|
-
},
|
|
4689
|
-
if (h.value = "scale(1)", await
|
|
4690
|
-
const { availWidth: D, availHeight:
|
|
4691
|
-
h.value = `scale(${
|
|
4660
|
+
s.value.tiles = z.sort(f);
|
|
4661
|
+
}, le = async () => {
|
|
4662
|
+
if (h.value = "scale(1)", await yt(), l.value) {
|
|
4663
|
+
const { availWidth: D, availHeight: z } = window.screen, { width: F, height: P } = l.value.getBoundingClientRect(), V = Math.min(z / P, D / F);
|
|
4664
|
+
h.value = `scale(${V})`;
|
|
4692
4665
|
}
|
|
4693
|
-
},
|
|
4666
|
+
}, xe = () => {
|
|
4694
4667
|
d.value && (document.fullscreenElement ? document.exitFullscreen() : d.value.requestFullscreen());
|
|
4695
|
-
},
|
|
4696
|
-
|
|
4697
|
-
},
|
|
4698
|
-
globalFilters:
|
|
4699
|
-
context:
|
|
4700
|
-
isFullscreen:
|
|
4701
|
-
preview:
|
|
4668
|
+
}, Y = H(!1), ve = () => {
|
|
4669
|
+
Y.value = document.fullscreenElement !== null, Y.value && le();
|
|
4670
|
+
}, S = E(() => s.value.preset_filters ?? []), { internalContext: I, queryReady: Q } = ae.useDashboardInternalContext({
|
|
4671
|
+
globalFilters: S,
|
|
4672
|
+
context: E(() => o.context),
|
|
4673
|
+
isFullscreen: Y,
|
|
4674
|
+
preview: E(() => o.preview)
|
|
4702
4675
|
});
|
|
4703
4676
|
return e({
|
|
4704
|
-
refresh:
|
|
4705
|
-
toggleFullscreen:
|
|
4706
|
-
}), (D,
|
|
4707
|
-
const F =
|
|
4708
|
-
return
|
|
4677
|
+
refresh: M,
|
|
4678
|
+
toggleFullscreen: xe
|
|
4679
|
+
}), (D, z) => {
|
|
4680
|
+
const F = ue("KAlert");
|
|
4681
|
+
return C(), B("div", {
|
|
4709
4682
|
ref_key: "dashboardContainer",
|
|
4710
4683
|
ref: d,
|
|
4711
|
-
class:
|
|
4712
|
-
onFullscreenchange:
|
|
4684
|
+
class: ze(["kong-ui-public-dashboard-renderer", { "is-fullscreen": Y.value }]),
|
|
4685
|
+
onFullscreenchange: ve
|
|
4713
4686
|
}, [
|
|
4714
4687
|
te("div", {
|
|
4715
4688
|
ref_key: "layoutContainer",
|
|
4716
4689
|
ref: l,
|
|
4717
4690
|
class: "layout"
|
|
4718
4691
|
}, [
|
|
4719
|
-
|
|
4720
|
-
|
|
4692
|
+
w(u) && Y.value ? (C(), B("div", zr, [
|
|
4693
|
+
He(D.$slots, "fullscreenHeader", {}, void 0, !0)
|
|
4721
4694
|
])) : X("", !0),
|
|
4722
|
-
|
|
4695
|
+
w(u) ? (C(), O(si(w(I).editable && !Y.value ? Sr : br), {
|
|
4723
4696
|
key: 2,
|
|
4724
4697
|
ref_key: "gridLayoutRef",
|
|
4725
4698
|
ref: n,
|
|
4726
4699
|
columns: s.value.columns,
|
|
4727
4700
|
"tile-height": s.value.tile_height,
|
|
4728
|
-
tiles:
|
|
4729
|
-
onUpdateTiles:
|
|
4701
|
+
tiles: m.value,
|
|
4702
|
+
onUpdateTiles: A
|
|
4730
4703
|
}, {
|
|
4731
|
-
tile:
|
|
4732
|
-
y(P) ? (
|
|
4733
|
-
|
|
4734
|
-
])) : (
|
|
4735
|
-
key:
|
|
4736
|
-
"refresh-counter":
|
|
4737
|
-
"onUpdate:refreshCounter":
|
|
4704
|
+
tile: q(({ tile: P }) => [
|
|
4705
|
+
y(P) ? (C(), B("div", Nr, [
|
|
4706
|
+
He(D.$slots, k(P), {}, void 0, !0)
|
|
4707
|
+
])) : (C(), O(mi, {
|
|
4708
|
+
key: Y.value ? `${P.id}-tile` : `${P.id}-tile-fullscreen`,
|
|
4709
|
+
"refresh-counter": a.value,
|
|
4710
|
+
"onUpdate:refreshCounter": z[0] || (z[0] = (V) => a.value = V),
|
|
4738
4711
|
class: "tile-container",
|
|
4739
|
-
context:
|
|
4712
|
+
context: w(I),
|
|
4740
4713
|
definition: P.meta,
|
|
4741
|
-
height: P.layout.size.rows * (s.value.tile_height ||
|
|
4742
|
-
"hide-actions": !
|
|
4743
|
-
"hide-zoom-actions": !
|
|
4744
|
-
"is-fullscreen":
|
|
4745
|
-
"query-ready":
|
|
4714
|
+
height: P.layout.size.rows * (s.value.tile_height || w(Ge)) + parseInt(w(gi), 10),
|
|
4715
|
+
"hide-actions": !w(I).showTileActions,
|
|
4716
|
+
"hide-zoom-actions": !w(I).showTileZoomActions,
|
|
4717
|
+
"is-fullscreen": Y.value,
|
|
4718
|
+
"query-ready": w(Q),
|
|
4746
4719
|
"tile-id": P.id,
|
|
4747
4720
|
"tile-type": P.type,
|
|
4748
|
-
onDuplicateTile: (
|
|
4749
|
-
onEditTile: (
|
|
4750
|
-
onRemoveTile: (
|
|
4751
|
-
onTileTimeRangeZoom:
|
|
4721
|
+
onDuplicateTile: (V) => N(P),
|
|
4722
|
+
onEditTile: (V) => p(P),
|
|
4723
|
+
onRemoveTile: (V) => v(P),
|
|
4724
|
+
onTileTimeRangeZoom: z[1] || (z[1] = (V) => i("tile-time-range-zoom", V))
|
|
4752
4725
|
}, null, 8, ["refresh-counter", "context", "definition", "height", "hide-actions", "hide-zoom-actions", "is-fullscreen", "query-ready", "tile-id", "tile-type", "onDuplicateTile", "onEditTile", "onRemoveTile"]))
|
|
4753
4726
|
]),
|
|
4754
4727
|
_: 3
|
|
4755
|
-
}, 40, ["columns", "tile-height", "tiles"])) : (
|
|
4728
|
+
}, 40, ["columns", "tile-height", "tiles"])) : (C(), O(F, {
|
|
4756
4729
|
key: 1,
|
|
4757
4730
|
appearance: "danger"
|
|
4758
4731
|
}, {
|
|
4759
|
-
default:
|
|
4760
|
-
|
|
4732
|
+
default: q(() => [
|
|
4733
|
+
gt(J(w(r).t("renderer.noQueryBridge")), 1)
|
|
4761
4734
|
]),
|
|
4762
4735
|
_: 1
|
|
4763
4736
|
}))
|
|
@@ -4765,7 +4738,7 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4765
4738
|
], 34);
|
|
4766
4739
|
};
|
|
4767
4740
|
}
|
|
4768
|
-
}),
|
|
4741
|
+
}), Qr = /* @__PURE__ */ be(Lr, [["__scopeId", "data-v-33404a87"]]), Vr = /* @__PURE__ */ ee({
|
|
4769
4742
|
__name: "DashboardTilePreview",
|
|
4770
4743
|
props: {
|
|
4771
4744
|
context: {},
|
|
@@ -4774,70 +4747,73 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4774
4747
|
preview: { type: Boolean, default: !1 }
|
|
4775
4748
|
},
|
|
4776
4749
|
emits: ["chart-data", "tile-time-range-zoom", "tile-bounds-change"],
|
|
4777
|
-
setup(
|
|
4778
|
-
const i =
|
|
4779
|
-
|
|
4780
|
-
}, d = (
|
|
4781
|
-
|
|
4782
|
-
}, l = (
|
|
4783
|
-
|
|
4750
|
+
setup(o, { expose: e, emit: t }) {
|
|
4751
|
+
const i = It("root"), s = It("dashboard-tile"), r = crypto.randomUUID(), a = t, n = (v) => {
|
|
4752
|
+
a("tile-time-range-zoom", v);
|
|
4753
|
+
}, d = (v) => {
|
|
4754
|
+
a("chart-data", v);
|
|
4755
|
+
}, l = (v) => {
|
|
4756
|
+
a("tile-bounds-change", v);
|
|
4784
4757
|
}, { i18n: h } = ae.useI18n(), { internalContext: u, queryReady: f } = ae.useDashboardInternalContext({
|
|
4785
|
-
globalFilters:
|
|
4786
|
-
context:
|
|
4787
|
-
preview:
|
|
4788
|
-
}),
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4758
|
+
globalFilters: Ae(() => o.globalFilters),
|
|
4759
|
+
context: Ae(() => o.context),
|
|
4760
|
+
preview: E(() => o.preview)
|
|
4761
|
+
}), m = E(() => oe(o.definition)), p = E(() => {
|
|
4762
|
+
var v;
|
|
4763
|
+
return m.value ? "columns" in o.definition.query && !((v = o.definition.query.columns) != null && v.length) : !("metrics" in o.definition.query) || !o.definition.query.metrics || o.definition.query.metrics.length === 0;
|
|
4764
|
+
}), y = H(Ge);
|
|
4765
|
+
let g;
|
|
4766
|
+
st(() => {
|
|
4767
|
+
var M;
|
|
4768
|
+
const v = (M = i.value) == null ? void 0 : M.parentElement;
|
|
4769
|
+
v && (y.value = v.getBoundingClientRect().height, g = new ResizeObserver(([A]) => {
|
|
4770
|
+
const { height: le } = A.contentRect;
|
|
4771
|
+
y.value = le;
|
|
4772
|
+
}), g.observe(v));
|
|
4773
|
+
}), Fe(() => g == null ? void 0 : g.disconnect());
|
|
4774
|
+
const k = H(0);
|
|
4799
4775
|
return e({
|
|
4800
4776
|
refresh: () => {
|
|
4801
|
-
|
|
4777
|
+
k.value++;
|
|
4802
4778
|
},
|
|
4803
4779
|
getExportData: () => {
|
|
4804
|
-
var
|
|
4805
|
-
return (
|
|
4780
|
+
var v;
|
|
4781
|
+
return (v = s.value) == null ? void 0 : v.getExportData();
|
|
4806
4782
|
}
|
|
4807
|
-
}), (
|
|
4808
|
-
const
|
|
4809
|
-
return
|
|
4783
|
+
}), (v, M) => {
|
|
4784
|
+
const A = ue("KEmptyState");
|
|
4785
|
+
return C(), B("div", {
|
|
4810
4786
|
ref_key: "root",
|
|
4811
4787
|
ref: i,
|
|
4812
4788
|
"data-testid": "dashboard-tile-preview-root"
|
|
4813
4789
|
}, [
|
|
4814
|
-
|
|
4790
|
+
p.value ? (C(), O(A, {
|
|
4815
4791
|
key: 0,
|
|
4816
4792
|
"action-button-visible": !1,
|
|
4817
4793
|
"data-testid": "chart-not-configured-empty-state"
|
|
4818
4794
|
}, {
|
|
4819
|
-
title:
|
|
4820
|
-
te("p", null, J(
|
|
4795
|
+
title: q(() => [
|
|
4796
|
+
te("p", null, J(w(h).t("renderer.not_configured.title")), 1)
|
|
4821
4797
|
]),
|
|
4822
|
-
default:
|
|
4823
|
-
te("p", null, J(
|
|
4798
|
+
default: q(() => [
|
|
4799
|
+
te("p", null, J(w(h).t("renderer.not_configured.description")), 1)
|
|
4824
4800
|
]),
|
|
4825
4801
|
_: 1
|
|
4826
|
-
})) : (
|
|
4802
|
+
})) : (C(), O(mi, {
|
|
4827
4803
|
key: 1,
|
|
4828
4804
|
ref: "dashboard-tile",
|
|
4829
|
-
"refresh-counter":
|
|
4830
|
-
"onUpdate:refreshCounter":
|
|
4805
|
+
"refresh-counter": k.value,
|
|
4806
|
+
"onUpdate:refreshCounter": M[0] || (M[0] = (le) => k.value = le),
|
|
4831
4807
|
context: {
|
|
4832
|
-
...
|
|
4808
|
+
...w(u),
|
|
4833
4809
|
editable: !1
|
|
4834
4810
|
},
|
|
4835
|
-
definition:
|
|
4836
|
-
height:
|
|
4811
|
+
definition: o.definition,
|
|
4812
|
+
height: y.value,
|
|
4837
4813
|
"hide-actions": "",
|
|
4838
|
-
"query-ready":
|
|
4814
|
+
"query-ready": w(f),
|
|
4839
4815
|
"show-refresh": "",
|
|
4840
|
-
"tile-id":
|
|
4816
|
+
"tile-id": w(r),
|
|
4841
4817
|
onChartData: d,
|
|
4842
4818
|
onTileBoundsChange: l,
|
|
4843
4819
|
onTileTimeRangeZoom: n
|
|
@@ -4845,42 +4821,42 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4845
4821
|
], 512);
|
|
4846
4822
|
};
|
|
4847
4823
|
}
|
|
4848
|
-
}),
|
|
4824
|
+
}), Ar = (o) => {
|
|
4849
4825
|
var t;
|
|
4850
|
-
const e = (t =
|
|
4826
|
+
const e = (t = o.definition) == null ? void 0 : t.query;
|
|
4851
4827
|
if (!e)
|
|
4852
|
-
return
|
|
4828
|
+
return o;
|
|
4853
4829
|
if (e.datasource === "api_usage") {
|
|
4854
|
-
console.warn("[@kong-ui-public/dashboard-renderer] A tile was filtered out for the Basic Tier",
|
|
4830
|
+
console.warn("[@kong-ui-public/dashboard-renderer] A tile was filtered out for the Basic Tier", o);
|
|
4855
4831
|
return;
|
|
4856
4832
|
}
|
|
4857
|
-
return
|
|
4858
|
-
},
|
|
4833
|
+
return o;
|
|
4834
|
+
}, Or = (o) => {
|
|
4859
4835
|
var i;
|
|
4860
|
-
if (
|
|
4861
|
-
return
|
|
4862
|
-
const e = (i =
|
|
4836
|
+
if (oe(o.definition))
|
|
4837
|
+
return o;
|
|
4838
|
+
const e = (i = o.definition) == null ? void 0 : i.query;
|
|
4863
4839
|
if (!e)
|
|
4864
|
-
return
|
|
4840
|
+
return o;
|
|
4865
4841
|
const t = {
|
|
4866
4842
|
...e,
|
|
4867
4843
|
datasource: e.datasource === "basic" ? "api_usage" : e.datasource
|
|
4868
4844
|
};
|
|
4869
4845
|
return {
|
|
4870
|
-
...
|
|
4846
|
+
...o,
|
|
4871
4847
|
definition: {
|
|
4872
|
-
...
|
|
4848
|
+
...o.definition,
|
|
4873
4849
|
query: t
|
|
4874
4850
|
}
|
|
4875
4851
|
};
|
|
4876
|
-
},
|
|
4877
|
-
var
|
|
4878
|
-
if (!
|
|
4852
|
+
}, Hr = (o, e = _t) => {
|
|
4853
|
+
var a, n, d, l, h;
|
|
4854
|
+
if (!o.length)
|
|
4879
4855
|
return [];
|
|
4880
4856
|
let t = 0, i = 0, s = 0;
|
|
4881
4857
|
const r = [];
|
|
4882
|
-
for (const u of
|
|
4883
|
-
const f = ((n = (
|
|
4858
|
+
for (const u of o) {
|
|
4859
|
+
const f = ((n = (a = u.layout) == null ? void 0 : a.size) == null ? void 0 : n.cols) ?? 1, m = ((l = (d = u.layout) == null ? void 0 : d.size) == null ? void 0 : l.rows) ?? 1;
|
|
4884
4860
|
i + f > e && (t += s, i = 0, s = 0);
|
|
4885
4861
|
const p = {
|
|
4886
4862
|
...u,
|
|
@@ -4893,36 +4869,36 @@ const Rr = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], kr = { cl
|
|
|
4893
4869
|
}
|
|
4894
4870
|
}
|
|
4895
4871
|
};
|
|
4896
|
-
r.push(p), i += f, s = Math.max(s,
|
|
4872
|
+
r.push(p), i += f, s = Math.max(s, m);
|
|
4897
4873
|
}
|
|
4898
4874
|
return r;
|
|
4899
|
-
},
|
|
4875
|
+
}, Yr = (o, e) => {
|
|
4900
4876
|
if (e) {
|
|
4901
|
-
const s =
|
|
4877
|
+
const s = o.tiles.map(Or);
|
|
4902
4878
|
return {
|
|
4903
|
-
...
|
|
4879
|
+
...o,
|
|
4904
4880
|
tiles: s
|
|
4905
4881
|
};
|
|
4906
4882
|
}
|
|
4907
|
-
const t =
|
|
4883
|
+
const t = o.tiles.map(Ar).filter((s) => s !== void 0), i = Hr(t, o.columns);
|
|
4908
4884
|
return {
|
|
4909
|
-
...
|
|
4885
|
+
...o,
|
|
4910
4886
|
tiles: i
|
|
4911
4887
|
};
|
|
4912
4888
|
};
|
|
4913
4889
|
export {
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4890
|
+
Cs as C,
|
|
4891
|
+
_t as D,
|
|
4892
|
+
qt as E,
|
|
4893
|
+
Ss as F,
|
|
4918
4894
|
br as G,
|
|
4919
4895
|
ye as I,
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4896
|
+
Rs as T,
|
|
4897
|
+
wt as _,
|
|
4898
|
+
Ge as a,
|
|
4899
|
+
ks as b,
|
|
4900
|
+
Qr as c,
|
|
4901
|
+
Vr as d,
|
|
4902
|
+
Ts as e,
|
|
4903
|
+
Yr as f
|
|
4928
4904
|
};
|