@kong-ui-public/dashboard-renderer 7.7.3 → 7.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GeoMapRenderer-BRvbFVZX.js +54 -0
- package/dist/dashboard-renderer.es.js +1 -1
- package/dist/dashboard-renderer.umd.js +4 -4
- package/dist/{index-BoHeOFji.js → index-BnpMzNRB.js} +703 -703
- package/dist/style.css +1 -1
- package/package.json +16 -16
- package/dist/GeoMapRenderer-Do3o2zvx.js +0 -54
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
var oi = Object.defineProperty;
|
|
2
|
-
var _t = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var _t = (a) => {
|
|
3
|
+
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var ai = (
|
|
6
|
-
var bt = (
|
|
7
|
-
var
|
|
8
|
-
var Te = (
|
|
5
|
+
var ai = (a, e, t) => e in a ? oi(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
6
|
+
var bt = (a, e, t) => ai(a, typeof e != "symbol" ? e + "" : e, t), it = (a, e, t) => e.has(a) || _t("Cannot " + t);
|
|
7
|
+
var v = (a, e, t) => (it(a, e, "read from private field"), t ? t.call(a) : e.get(a)), G = (a, e, t) => e.has(a) ? _t("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, t), I = (a, e, t, i) => (it(a, e, "write to private field"), i ? i.call(a, t) : e.set(a, t), t), F = (a, e, t) => (it(a, e, "access private method"), t);
|
|
8
|
+
var Te = (a, e, t, i) => ({
|
|
9
9
|
set _(s) {
|
|
10
|
-
I(
|
|
10
|
+
I(a, e, s, t);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return
|
|
13
|
+
return v(a, e, i);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { ref as H, watchEffect as Mt, inject as ve, provide as li, onMounted as at, computed as k, watch as ze, onUnmounted as lt, defineComponent as Z, resolveComponent as ge, createBlock as O, renderSlot as De, createCommentVNode as V, unref as
|
|
17
|
-
import { msToGranularity as rt, getFieldDataSources as Ft, stripUnknownFilters as gi, Timeframe as
|
|
16
|
+
import { ref as H, watchEffect as Mt, inject as ve, provide as li, onMounted as at, computed as k, watch as ze, onUnmounted as lt, defineComponent as Z, resolveComponent as ge, createBlock as O, renderSlot as De, createCommentVNode as V, unref as E, openBlock as x, createSlots as Qe, withCtx as $, createElementVNode as oe, toDisplayString as ne, useCssVars as Ye, normalizeClass as je, createVNode as ue, mergeProps as It, createTextVNode as ht, createElementBlock as K, normalizeProps as hi, guardReactiveProps as ui, defineAsyncComponent as Pt, readonly as st, toRef as wt, nextTick as ut, resolveDynamicComponent as qt, toHandlers as di, Fragment as $t, renderList as Gt, normalizeStyle as Et, mergeModels as xt, useModel as ci, getCurrentInstance as fi } from "vue";
|
|
17
|
+
import { msToGranularity as rt, getFieldDataSources as Ft, stripUnknownFilters as gi, Timeframe as mi, TimePeriods as Bt, TIMEFRAME_LOOKUP as pi, formatTime as Ct, EXPORT_RECORD_LIMIT as yi } from "@kong-ui-public/analytics-utilities";
|
|
18
18
|
import { handleQueryError as vi, SimpleChart as _i, AnalyticsChart as bi, TopNTable as wi, CsvExportModal as Ei } from "@kong-ui-public/analytics-chart";
|
|
19
19
|
import xi from "swrv";
|
|
20
20
|
import "axios";
|
|
@@ -22,44 +22,44 @@ import { createI18n as Ci, i18nTComponent as Ri } from "@kong-ui-public/i18n";
|
|
|
22
22
|
import { useAnalyticsConfigStore as dt } from "@kong-ui-public/analytics-config-store";
|
|
23
23
|
import { VisibilityOffIcon as ki, WarningOutlineIcon as Ti, WarningIcon as zi, EditIcon as Di, MoreIcon as Si } from "@kong/icons";
|
|
24
24
|
import { MetricsProvider as Ni, MetricsConsumer as Li } from "@kong-ui-public/analytics-metric-provider";
|
|
25
|
-
var Ut = /* @__PURE__ */ ((
|
|
26
|
-
const Ai = (
|
|
25
|
+
var Ut = /* @__PURE__ */ ((a) => (a.VALIDATING = "VALIDATING", a.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", a.PENDING = "PENDING", a.SUCCESS = "SUCCESS", a.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", a.ERROR = "ERROR", a.STALE_IF_ERROR = "STALE_IF_ERROR", a))(Ut || {});
|
|
26
|
+
const Ai = (a) => {
|
|
27
27
|
var e, t, i, s, r;
|
|
28
|
-
return
|
|
29
|
-
((e = Object.keys(
|
|
28
|
+
return a ? !!// TODO: revisit: currently only the first check ever matters?
|
|
29
|
+
((e = Object.keys(a)) != null && e.length || (t = a.data) != null && t.length || (s = (i = a.data) == null ? void 0 : i.data) != null && s.length || !((r = a.data) != null && r.data) && typeof a.data == "object" && Object.keys(a == null ? void 0 : a.data).length) : !1;
|
|
30
30
|
};
|
|
31
|
-
function Oi(
|
|
31
|
+
function Oi(a = H({}), e, t, i = Ai) {
|
|
32
32
|
const s = H(
|
|
33
33
|
"PENDING"
|
|
34
34
|
/* PENDING */
|
|
35
35
|
);
|
|
36
36
|
return Mt(() => {
|
|
37
|
-
const r = i(
|
|
38
|
-
if (
|
|
37
|
+
const r = i(a.value);
|
|
38
|
+
if (a.value && r && t.value) {
|
|
39
39
|
s.value = "VALIDATING_HAS_DATA";
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
42
|
+
if (a.value && t.value) {
|
|
43
43
|
s.value = "VALIDATING";
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
if (
|
|
46
|
+
if (a.value && e.value) {
|
|
47
47
|
s.value = "STALE_IF_ERROR";
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
if (
|
|
50
|
+
if (a.value === void 0 && !e.value) {
|
|
51
51
|
s.value = "PENDING";
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (a.value && !e.value && r) {
|
|
55
55
|
s.value = "SUCCESS_HAS_DATA";
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
58
|
+
if (a.value && !e.value) {
|
|
59
59
|
s.value = "SUCCESS";
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
a.value === void 0 && e && (s.value = "ERROR");
|
|
63
63
|
}), {
|
|
64
64
|
state: s,
|
|
65
65
|
swrvState: Ut
|
|
@@ -103,127 +103,127 @@ const Hi = {
|
|
|
103
103
|
granularities: $i
|
|
104
104
|
};
|
|
105
105
|
function Fi() {
|
|
106
|
-
const
|
|
106
|
+
const a = Ci("en-us", Gi);
|
|
107
107
|
return {
|
|
108
|
-
i18n:
|
|
109
|
-
i18nT: Ri(
|
|
108
|
+
i18n: a,
|
|
109
|
+
i18nT: Ri(a)
|
|
110
110
|
// Translation component <i18n-t>
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
const Xe = 170, Wt = 6,
|
|
113
|
+
const Xe = 170, Wt = 6, me = "analytics-query-provider", Rt = "{entity-id}", Bi = "{cp-id}", Ui = "{timeframe}", Wi = 30 * 1e3, Ki = 3e5, Vi = 36e5;
|
|
114
114
|
function Qi() {
|
|
115
|
-
const
|
|
115
|
+
const a = ve(me);
|
|
116
116
|
return {
|
|
117
|
-
evaluateFeatureFlag: (t, i) =>
|
|
117
|
+
evaluateFeatureFlag: (t, i) => a ? a.evaluateFeatureFlagFn(t, i) : i
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function Yi(
|
|
121
|
-
return
|
|
120
|
+
function Yi(a) {
|
|
121
|
+
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
122
122
|
}
|
|
123
123
|
var Kt = { exports: {} };
|
|
124
|
-
(function(
|
|
124
|
+
(function(a) {
|
|
125
125
|
var e = Object.prototype.hasOwnProperty, t = "~";
|
|
126
126
|
function i() {
|
|
127
127
|
}
|
|
128
128
|
Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (t = !1));
|
|
129
|
-
function s(
|
|
130
|
-
this.fn =
|
|
129
|
+
function s(d, h, u) {
|
|
130
|
+
this.fn = d, this.context = h, this.once = u || !1;
|
|
131
131
|
}
|
|
132
|
-
function r(
|
|
133
|
-
if (typeof
|
|
132
|
+
function r(d, h, u, l, f) {
|
|
133
|
+
if (typeof u != "function")
|
|
134
134
|
throw new TypeError("The listener must be a function");
|
|
135
|
-
var
|
|
136
|
-
return
|
|
135
|
+
var m = new s(u, l || d, f), g = t ? t + h : h;
|
|
136
|
+
return d._events[g] ? d._events[g].fn ? d._events[g] = [d._events[g], m] : d._events[g].push(m) : (d._events[g] = m, d._eventsCount++), d;
|
|
137
137
|
}
|
|
138
|
-
function o(
|
|
139
|
-
--
|
|
138
|
+
function o(d, h) {
|
|
139
|
+
--d._eventsCount === 0 ? d._events = new i() : delete d._events[h];
|
|
140
140
|
}
|
|
141
141
|
function n() {
|
|
142
142
|
this._events = new i(), this._eventsCount = 0;
|
|
143
143
|
}
|
|
144
144
|
n.prototype.eventNames = function() {
|
|
145
|
-
var
|
|
146
|
-
if (this._eventsCount === 0) return
|
|
147
|
-
for (l in
|
|
148
|
-
e.call(
|
|
149
|
-
return Object.getOwnPropertySymbols ?
|
|
150
|
-
}, n.prototype.listeners = function(
|
|
151
|
-
var
|
|
145
|
+
var h = [], u, l;
|
|
146
|
+
if (this._eventsCount === 0) return h;
|
|
147
|
+
for (l in u = this._events)
|
|
148
|
+
e.call(u, l) && h.push(t ? l.slice(1) : l);
|
|
149
|
+
return Object.getOwnPropertySymbols ? h.concat(Object.getOwnPropertySymbols(u)) : h;
|
|
150
|
+
}, n.prototype.listeners = function(h) {
|
|
151
|
+
var u = t ? t + h : h, l = this._events[u];
|
|
152
152
|
if (!l) return [];
|
|
153
153
|
if (l.fn) return [l.fn];
|
|
154
|
-
for (var f = 0,
|
|
154
|
+
for (var f = 0, m = l.length, g = new Array(m); f < m; f++)
|
|
155
155
|
g[f] = l[f].fn;
|
|
156
156
|
return g;
|
|
157
|
-
}, n.prototype.listenerCount = function(
|
|
158
|
-
var
|
|
157
|
+
}, n.prototype.listenerCount = function(h) {
|
|
158
|
+
var u = t ? t + h : h, l = this._events[u];
|
|
159
159
|
return l ? l.fn ? 1 : l.length : 0;
|
|
160
|
-
}, n.prototype.emit = function(
|
|
161
|
-
var y = t ? t +
|
|
160
|
+
}, n.prototype.emit = function(h, u, l, f, m, g) {
|
|
161
|
+
var y = t ? t + h : h;
|
|
162
162
|
if (!this._events[y]) return !1;
|
|
163
|
-
var
|
|
164
|
-
if (
|
|
165
|
-
switch (
|
|
163
|
+
var p = this._events[y], D = arguments.length, P, z;
|
|
164
|
+
if (p.fn) {
|
|
165
|
+
switch (p.once && this.removeListener(h, p.fn, void 0, !0), D) {
|
|
166
166
|
case 1:
|
|
167
|
-
return
|
|
167
|
+
return p.fn.call(p.context), !0;
|
|
168
168
|
case 2:
|
|
169
|
-
return
|
|
169
|
+
return p.fn.call(p.context, u), !0;
|
|
170
170
|
case 3:
|
|
171
|
-
return
|
|
171
|
+
return p.fn.call(p.context, u, l), !0;
|
|
172
172
|
case 4:
|
|
173
|
-
return
|
|
173
|
+
return p.fn.call(p.context, u, l, f), !0;
|
|
174
174
|
case 5:
|
|
175
|
-
return
|
|
175
|
+
return p.fn.call(p.context, u, l, f, m), !0;
|
|
176
176
|
case 6:
|
|
177
|
-
return
|
|
177
|
+
return p.fn.call(p.context, u, l, f, m, g), !0;
|
|
178
178
|
}
|
|
179
179
|
for (z = 1, P = new Array(D - 1); z < D; z++)
|
|
180
180
|
P[z - 1] = arguments[z];
|
|
181
|
-
|
|
181
|
+
p.fn.apply(p.context, P);
|
|
182
182
|
} else {
|
|
183
|
-
var Q =
|
|
183
|
+
var Q = p.length, B;
|
|
184
184
|
for (z = 0; z < Q; z++)
|
|
185
|
-
switch (
|
|
185
|
+
switch (p[z].once && this.removeListener(h, p[z].fn, void 0, !0), D) {
|
|
186
186
|
case 1:
|
|
187
|
-
|
|
187
|
+
p[z].fn.call(p[z].context);
|
|
188
188
|
break;
|
|
189
189
|
case 2:
|
|
190
|
-
|
|
190
|
+
p[z].fn.call(p[z].context, u);
|
|
191
191
|
break;
|
|
192
192
|
case 3:
|
|
193
|
-
|
|
193
|
+
p[z].fn.call(p[z].context, u, l);
|
|
194
194
|
break;
|
|
195
195
|
case 4:
|
|
196
|
-
|
|
196
|
+
p[z].fn.call(p[z].context, u, l, f);
|
|
197
197
|
break;
|
|
198
198
|
default:
|
|
199
199
|
if (!P) for (B = 1, P = new Array(D - 1); B < D; B++)
|
|
200
200
|
P[B - 1] = arguments[B];
|
|
201
|
-
|
|
201
|
+
p[z].fn.apply(p[z].context, P);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
return !0;
|
|
205
|
-
}, n.prototype.on = function(
|
|
206
|
-
return r(this,
|
|
207
|
-
}, n.prototype.once = function(
|
|
208
|
-
return r(this,
|
|
209
|
-
}, n.prototype.removeListener = function(
|
|
210
|
-
var
|
|
211
|
-
if (!this._events[
|
|
212
|
-
if (!
|
|
213
|
-
return o(this,
|
|
214
|
-
var g = this._events[
|
|
205
|
+
}, n.prototype.on = function(h, u, l) {
|
|
206
|
+
return r(this, h, u, l, !1);
|
|
207
|
+
}, n.prototype.once = function(h, u, l) {
|
|
208
|
+
return r(this, h, u, l, !0);
|
|
209
|
+
}, n.prototype.removeListener = function(h, u, l, f) {
|
|
210
|
+
var m = t ? t + h : h;
|
|
211
|
+
if (!this._events[m]) return this;
|
|
212
|
+
if (!u)
|
|
213
|
+
return o(this, m), this;
|
|
214
|
+
var g = this._events[m];
|
|
215
215
|
if (g.fn)
|
|
216
|
-
g.fn ===
|
|
216
|
+
g.fn === u && (!f || g.once) && (!l || g.context === l) && o(this, m);
|
|
217
217
|
else {
|
|
218
|
-
for (var y = 0,
|
|
219
|
-
(g[y].fn !==
|
|
220
|
-
|
|
218
|
+
for (var y = 0, p = [], D = g.length; y < D; y++)
|
|
219
|
+
(g[y].fn !== u || f && !g[y].once || l && g[y].context !== l) && p.push(g[y]);
|
|
220
|
+
p.length ? this._events[m] = p.length === 1 ? p[0] : p : o(this, m);
|
|
221
221
|
}
|
|
222
222
|
return this;
|
|
223
|
-
}, n.prototype.removeAllListeners = function(
|
|
224
|
-
var
|
|
225
|
-
return
|
|
226
|
-
}, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n,
|
|
223
|
+
}, n.prototype.removeAllListeners = function(h) {
|
|
224
|
+
var u;
|
|
225
|
+
return h ? (u = t ? t + h : h, this._events[u] && o(this, u)) : (this._events = new i(), this._eventsCount = 0), this;
|
|
226
|
+
}, n.prototype.off = n.prototype.removeListener, n.prototype.addListener = n.prototype.on, n.prefixed = t, n.EventEmitter = n, a.exports = n;
|
|
227
227
|
})(Kt);
|
|
228
228
|
var ji = Kt.exports;
|
|
229
229
|
const Xi = /* @__PURE__ */ Yi(ji);
|
|
@@ -237,11 +237,11 @@ class Zi extends Error {
|
|
|
237
237
|
super(), this.name = "AbortError", this.message = e;
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
const kt = (
|
|
241
|
-
const e =
|
|
240
|
+
const kt = (a) => globalThis.DOMException === void 0 ? new Zi(a) : new DOMException(a), Tt = (a) => {
|
|
241
|
+
const e = a.reason === void 0 ? kt("This operation was aborted.") : a.reason;
|
|
242
242
|
return e instanceof Error ? e : kt(e);
|
|
243
243
|
};
|
|
244
|
-
function Ji(
|
|
244
|
+
function Ji(a, e) {
|
|
245
245
|
const {
|
|
246
246
|
milliseconds: t,
|
|
247
247
|
fallback: i,
|
|
@@ -249,50 +249,50 @@ function Ji(d, e) {
|
|
|
249
249
|
customTimers: r = { setTimeout, clearTimeout }
|
|
250
250
|
} = e;
|
|
251
251
|
let o, n;
|
|
252
|
-
const
|
|
252
|
+
const h = new Promise((u, l) => {
|
|
253
253
|
if (typeof t != "number" || Math.sign(t) !== 1)
|
|
254
254
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);
|
|
255
255
|
if (e.signal) {
|
|
256
|
-
const { signal:
|
|
257
|
-
|
|
258
|
-
l(Tt(
|
|
259
|
-
},
|
|
256
|
+
const { signal: m } = e;
|
|
257
|
+
m.aborted && l(Tt(m)), n = () => {
|
|
258
|
+
l(Tt(m));
|
|
259
|
+
}, m.addEventListener("abort", n, { once: !0 });
|
|
260
260
|
}
|
|
261
261
|
if (t === Number.POSITIVE_INFINITY) {
|
|
262
|
-
|
|
262
|
+
a.then(u, l);
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
const f = new Vt();
|
|
266
266
|
o = r.setTimeout.call(void 0, () => {
|
|
267
267
|
if (i) {
|
|
268
268
|
try {
|
|
269
|
-
|
|
270
|
-
} catch (
|
|
271
|
-
l(
|
|
269
|
+
u(i());
|
|
270
|
+
} catch (m) {
|
|
271
|
+
l(m);
|
|
272
272
|
}
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
|
-
typeof
|
|
275
|
+
typeof a.cancel == "function" && a.cancel(), s === !1 ? u() : s instanceof Error ? l(s) : (f.message = s ?? `Promise timed out after ${t} milliseconds`, l(f));
|
|
276
276
|
}, t), (async () => {
|
|
277
277
|
try {
|
|
278
|
-
|
|
279
|
-
} catch (
|
|
280
|
-
l(
|
|
278
|
+
u(await a);
|
|
279
|
+
} catch (m) {
|
|
280
|
+
l(m);
|
|
281
281
|
}
|
|
282
282
|
})();
|
|
283
283
|
}).finally(() => {
|
|
284
|
-
|
|
284
|
+
h.clear(), n && e.signal && e.signal.removeEventListener("abort", n);
|
|
285
285
|
});
|
|
286
|
-
return
|
|
286
|
+
return h.clear = () => {
|
|
287
287
|
r.clearTimeout.call(void 0, o), o = void 0;
|
|
288
|
-
},
|
|
288
|
+
}, h;
|
|
289
289
|
}
|
|
290
|
-
function es(
|
|
291
|
-
let i = 0, s =
|
|
290
|
+
function es(a, e, t) {
|
|
291
|
+
let i = 0, s = a.length;
|
|
292
292
|
for (; s > 0; ) {
|
|
293
293
|
const r = Math.trunc(s / 2);
|
|
294
294
|
let o = i + r;
|
|
295
|
-
t(
|
|
295
|
+
t(a[o], e) <= 0 ? (i = ++o, s -= r + 1) : s = r;
|
|
296
296
|
}
|
|
297
297
|
return i;
|
|
298
298
|
}
|
|
@@ -311,29 +311,29 @@ class ts {
|
|
|
311
311
|
id: t.id,
|
|
312
312
|
run: e
|
|
313
313
|
};
|
|
314
|
-
if (this.size === 0 ||
|
|
315
|
-
|
|
314
|
+
if (this.size === 0 || v(this, ie)[this.size - 1].priority >= t.priority) {
|
|
315
|
+
v(this, ie).push(i);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
const s = es(
|
|
319
|
-
|
|
318
|
+
const s = es(v(this, ie), i, (r, o) => o.priority - r.priority);
|
|
319
|
+
v(this, ie).splice(s, 0, i);
|
|
320
320
|
}
|
|
321
321
|
setPriority(e, t) {
|
|
322
|
-
const i =
|
|
322
|
+
const i = v(this, ie).findIndex((r) => r.id === e);
|
|
323
323
|
if (i === -1)
|
|
324
324
|
throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);
|
|
325
|
-
const [s] =
|
|
325
|
+
const [s] = v(this, ie).splice(i, 1);
|
|
326
326
|
this.enqueue(s.run, { priority: t, id: e });
|
|
327
327
|
}
|
|
328
328
|
dequeue() {
|
|
329
|
-
const e =
|
|
329
|
+
const e = v(this, ie).shift();
|
|
330
330
|
return e == null ? void 0 : e.run;
|
|
331
331
|
}
|
|
332
332
|
filter(e) {
|
|
333
|
-
return
|
|
333
|
+
return v(this, ie).filter((t) => t.priority === e.priority).map((t) => t.run);
|
|
334
334
|
}
|
|
335
335
|
get size() {
|
|
336
|
-
return
|
|
336
|
+
return v(this, ie).length;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
ie = new WeakMap();
|
|
@@ -382,7 +382,7 @@ class is extends Xi {
|
|
|
382
382
|
I(this, be, t.carryoverConcurrencyCount), I(this, we, t.intervalCap === Number.POSITIVE_INFINITY || t.interval === 0), I(this, Le, t.intervalCap), I(this, Ee, t.interval), I(this, W, new t.queueClass()), I(this, Oe, t.queueClass), this.concurrency = t.concurrency, this.timeout = t.timeout, I(this, He, t.throwOnTimeout === !0), I(this, ce, t.autoStart === !1);
|
|
383
383
|
}
|
|
384
384
|
get concurrency() {
|
|
385
|
-
return
|
|
385
|
+
return v(this, Ce);
|
|
386
386
|
}
|
|
387
387
|
set concurrency(t) {
|
|
388
388
|
if (!(typeof t == "number" && t >= 1))
|
|
@@ -426,23 +426,23 @@ class is extends Xi {
|
|
|
426
426
|
Here, the promise function with `id: '🦀'` executes last.
|
|
427
427
|
*/
|
|
428
428
|
setPriority(t, i) {
|
|
429
|
-
|
|
429
|
+
v(this, W).setPriority(t, i);
|
|
430
430
|
}
|
|
431
431
|
async add(t, i = {}) {
|
|
432
432
|
return i.id ?? (i.id = (Te(this, Ve)._++).toString()), i = {
|
|
433
433
|
timeout: this.timeout,
|
|
434
|
-
throwOnTimeout:
|
|
434
|
+
throwOnTimeout: v(this, He),
|
|
435
435
|
...i
|
|
436
436
|
}, new Promise((s, r) => {
|
|
437
|
-
|
|
437
|
+
v(this, W).enqueue(async () => {
|
|
438
438
|
var o;
|
|
439
439
|
Te(this, re)._++, Te(this, fe)._++;
|
|
440
440
|
try {
|
|
441
441
|
(o = i.signal) == null || o.throwIfAborted();
|
|
442
442
|
let n = t({ signal: i.signal });
|
|
443
443
|
i.timeout && (n = Ji(Promise.resolve(n), { milliseconds: i.timeout })), i.signal && (n = Promise.race([n, F(this, T, Jt).call(this, i.signal)]));
|
|
444
|
-
const
|
|
445
|
-
s(
|
|
444
|
+
const d = await n;
|
|
445
|
+
s(d), this.emit("completed", d);
|
|
446
446
|
} catch (n) {
|
|
447
447
|
if (n instanceof Vt && !i.throwOnTimeout) {
|
|
448
448
|
s();
|
|
@@ -462,7 +462,7 @@ class is extends Xi {
|
|
|
462
462
|
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.)
|
|
463
463
|
*/
|
|
464
464
|
start() {
|
|
465
|
-
return
|
|
465
|
+
return v(this, ce) ? (I(this, ce, !1), F(this, T, $e).call(this), this) : this;
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
468
468
|
Put queue execution on hold.
|
|
@@ -474,7 +474,7 @@ class is extends Xi {
|
|
|
474
474
|
Clear the queue.
|
|
475
475
|
*/
|
|
476
476
|
clear() {
|
|
477
|
-
I(this, W, new (
|
|
477
|
+
I(this, W, new (v(this, Oe))());
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
480
|
Can be called multiple times. Useful if you for example add additional items at a later time.
|
|
@@ -482,7 +482,7 @@ class is extends Xi {
|
|
|
482
482
|
@returns A promise that settles when the queue becomes empty.
|
|
483
483
|
*/
|
|
484
484
|
async onEmpty() {
|
|
485
|
-
|
|
485
|
+
v(this, W).size !== 0 && await F(this, T, Ge).call(this, "empty");
|
|
486
486
|
}
|
|
487
487
|
/**
|
|
488
488
|
@returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
|
|
@@ -492,7 +492,7 @@ class is extends Xi {
|
|
|
492
492
|
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.
|
|
493
493
|
*/
|
|
494
494
|
async onSizeLessThan(t) {
|
|
495
|
-
|
|
495
|
+
v(this, W).size < t || await F(this, T, Ge).call(this, "next", () => v(this, W).size < t);
|
|
496
496
|
}
|
|
497
497
|
/**
|
|
498
498
|
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.
|
|
@@ -500,13 +500,13 @@ class is extends Xi {
|
|
|
500
500
|
@returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
|
|
501
501
|
*/
|
|
502
502
|
async onIdle() {
|
|
503
|
-
|
|
503
|
+
v(this, re) === 0 && v(this, W).size === 0 || await F(this, T, Ge).call(this, "idle");
|
|
504
504
|
}
|
|
505
505
|
/**
|
|
506
506
|
Size of the queue, the number of queued items waiting to run.
|
|
507
507
|
*/
|
|
508
508
|
get size() {
|
|
509
|
-
return
|
|
509
|
+
return v(this, W).size;
|
|
510
510
|
}
|
|
511
511
|
/**
|
|
512
512
|
Size of the queue, filtered by the given options.
|
|
@@ -514,58 +514,58 @@ class is extends Xi {
|
|
|
514
514
|
For example, this can be used to find the number of items remaining in the queue with a specific priority level.
|
|
515
515
|
*/
|
|
516
516
|
sizeBy(t) {
|
|
517
|
-
return
|
|
517
|
+
return v(this, W).filter(t).length;
|
|
518
518
|
}
|
|
519
519
|
/**
|
|
520
520
|
Number of running items (no longer in the queue).
|
|
521
521
|
*/
|
|
522
522
|
get pending() {
|
|
523
|
-
return
|
|
523
|
+
return v(this, re);
|
|
524
524
|
}
|
|
525
525
|
/**
|
|
526
526
|
Whether the queue is currently paused.
|
|
527
527
|
*/
|
|
528
528
|
get isPaused() {
|
|
529
|
-
return
|
|
529
|
+
return v(this, ce);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
be = new WeakMap(), we = new WeakMap(), fe = new WeakMap(), Le = new WeakMap(), Ee = new WeakMap(), Ae = new WeakMap(), se = new WeakMap(), xe = new WeakMap(), W = new WeakMap(), Oe = new WeakMap(), re = new WeakMap(), Ce = new WeakMap(), ce = new WeakMap(), He = new WeakMap(), Ve = new WeakMap(), T = new WeakSet(), Qt = function() {
|
|
533
|
-
return
|
|
533
|
+
return v(this, we) || v(this, fe) < v(this, Le);
|
|
534
534
|
}, Yt = function() {
|
|
535
|
-
return
|
|
535
|
+
return v(this, re) < v(this, Ce);
|
|
536
536
|
}, jt = function() {
|
|
537
537
|
Te(this, re)._--, F(this, T, qe).call(this), this.emit("next");
|
|
538
538
|
}, Xt = function() {
|
|
539
539
|
F(this, T, ot).call(this), F(this, T, nt).call(this), I(this, xe, void 0);
|
|
540
540
|
}, Zt = function() {
|
|
541
541
|
const t = Date.now();
|
|
542
|
-
if (
|
|
543
|
-
const i =
|
|
542
|
+
if (v(this, se) === void 0) {
|
|
543
|
+
const i = v(this, Ae) - t;
|
|
544
544
|
if (i < 0)
|
|
545
|
-
I(this, fe,
|
|
545
|
+
I(this, fe, v(this, be) ? v(this, re) : 0);
|
|
546
546
|
else
|
|
547
|
-
return
|
|
547
|
+
return v(this, xe) === void 0 && I(this, xe, setTimeout(() => {
|
|
548
548
|
F(this, T, Xt).call(this);
|
|
549
549
|
}, i)), !0;
|
|
550
550
|
}
|
|
551
551
|
return !1;
|
|
552
552
|
}, qe = function() {
|
|
553
|
-
if (
|
|
554
|
-
return
|
|
555
|
-
if (!
|
|
556
|
-
const t = !
|
|
557
|
-
if (
|
|
558
|
-
const i =
|
|
553
|
+
if (v(this, W).size === 0)
|
|
554
|
+
return v(this, se) && clearInterval(v(this, se)), I(this, se, void 0), this.emit("empty"), v(this, re) === 0 && this.emit("idle"), !1;
|
|
555
|
+
if (!v(this, ce)) {
|
|
556
|
+
const t = !v(this, T, Zt);
|
|
557
|
+
if (v(this, T, Qt) && v(this, T, Yt)) {
|
|
558
|
+
const i = v(this, W).dequeue();
|
|
559
559
|
return i ? (this.emit("active"), i(), t && F(this, T, nt).call(this), !0) : !1;
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
return !1;
|
|
563
563
|
}, nt = function() {
|
|
564
|
-
|
|
564
|
+
v(this, we) || v(this, se) !== void 0 || (I(this, se, setInterval(() => {
|
|
565
565
|
F(this, T, ot).call(this);
|
|
566
|
-
},
|
|
566
|
+
}, v(this, Ee))), I(this, Ae, Date.now() + v(this, Ee)));
|
|
567
567
|
}, ot = function() {
|
|
568
|
-
|
|
568
|
+
v(this, fe) === 0 && v(this, re) === 0 && v(this, se) && (clearInterval(v(this, se)), I(this, se, void 0)), I(this, fe, v(this, be) ? v(this, re) : 0), F(this, T, $e).call(this);
|
|
569
569
|
}, /**
|
|
570
570
|
Executes all queued functions until it reaches the limit.
|
|
571
571
|
*/
|
|
@@ -587,7 +587,7 @@ $e = function() {
|
|
|
587
587
|
});
|
|
588
588
|
};
|
|
589
589
|
const ss = () => {
|
|
590
|
-
const
|
|
590
|
+
const a = dt(), e = ve(me);
|
|
591
591
|
if (!e)
|
|
592
592
|
return;
|
|
593
593
|
if (e.queryFnOverride) {
|
|
@@ -596,38 +596,38 @@ const ss = () => {
|
|
|
596
596
|
}
|
|
597
597
|
const t = new is({
|
|
598
598
|
carryoverConcurrencyCount: !0,
|
|
599
|
-
concurrency:
|
|
600
|
-
interval:
|
|
601
|
-
intervalCap:
|
|
599
|
+
concurrency: a.maxParallelRequests,
|
|
600
|
+
interval: a.requestInterval,
|
|
601
|
+
intervalCap: a.requestIntervalCap
|
|
602
602
|
}), i = {
|
|
603
603
|
...e,
|
|
604
604
|
queryFnOverride: !0,
|
|
605
605
|
queryFn: (s, r) => t.add(() => e.queryFn(s, r), { throwOnTimeout: !0 })
|
|
606
606
|
};
|
|
607
|
-
li(
|
|
607
|
+
li(me, i);
|
|
608
608
|
};
|
|
609
609
|
function rs({
|
|
610
|
-
queryBridge:
|
|
610
|
+
queryBridge: a,
|
|
611
611
|
context: e,
|
|
612
612
|
definition: t,
|
|
613
613
|
chartData: i
|
|
614
614
|
}) {
|
|
615
|
-
const s = H(""), r = H(""), o = H(void 0), n = H(void 0),
|
|
615
|
+
const s = H(""), r = H(""), o = H(void 0), n = H(void 0), d = dt();
|
|
616
616
|
at(async () => {
|
|
617
617
|
var R, M;
|
|
618
|
-
s.value = await ((R =
|
|
618
|
+
s.value = await ((R = a == null ? void 0 : a.exploreBaseUrl) == null ? void 0 : R.call(a)) ?? "", r.value = await ((M = a == null ? void 0 : a.requestsBaseUrl) == null ? void 0 : M.call(a)) ?? "";
|
|
619
619
|
});
|
|
620
|
-
const
|
|
620
|
+
const h = k(() => d.analytics && d.percentiles), u = k(() => !["golden_signals", "top_n", "gauge"].includes(t.value.chart.type)), l = k(() => r.value && t.value.query && t.value.query.datasource !== "llm_usage" && h.value), f = k(() => s.value && t.value.query && ["basic", "api_usage", "llm_usage", void 0].includes(t.value.query.datasource) && h.value), m = k(() => i.value ? rt(i.value.meta.granularity_ms) : void 0), g = k(() => {
|
|
621
621
|
var Y;
|
|
622
622
|
const R = [...e.value.filters, ...t.value.query.filters ?? []], M = ((Y = t.value.query) == null ? void 0 : Y.datasource) ?? "api_usage";
|
|
623
623
|
return R.filter((de) => Ft(de.field).some((J) => M === J));
|
|
624
624
|
}), y = k(() => {
|
|
625
|
-
if (!f.value || !
|
|
625
|
+
if (!f.value || !u.value)
|
|
626
626
|
return "";
|
|
627
627
|
const R = g.value, M = t.value.query.time_range || e.value.timeSpec, Y = Q(M, R);
|
|
628
628
|
return B(Y);
|
|
629
|
-
}),
|
|
630
|
-
if (!l.value || !
|
|
629
|
+
}), p = k(() => {
|
|
630
|
+
if (!l.value || !u.value)
|
|
631
631
|
return "";
|
|
632
632
|
const R = g.value, M = P(
|
|
633
633
|
t.value.query.time_range || e.value.timeSpec,
|
|
@@ -658,7 +658,7 @@ function rs({
|
|
|
658
658
|
metrics: t.value.query.metrics ?? [],
|
|
659
659
|
dimensions: Y,
|
|
660
660
|
time_range: R,
|
|
661
|
-
granularity: t.value.query.granularity ||
|
|
661
|
+
granularity: t.value.query.granularity || m.value
|
|
662
662
|
};
|
|
663
663
|
}, B = (R) => {
|
|
664
664
|
if (!f.value)
|
|
@@ -670,8 +670,8 @@ function rs({
|
|
|
670
670
|
R && (o.value = { href: "" }), M && (n.value = { href: "" });
|
|
671
671
|
}), {
|
|
672
672
|
exploreLinkKebabMenu: y,
|
|
673
|
-
requestsLinkKebabMenu:
|
|
674
|
-
canShowKebabMenu:
|
|
673
|
+
requestsLinkKebabMenu: p,
|
|
674
|
+
canShowKebabMenu: u,
|
|
675
675
|
canGenerateRequestsLink: l,
|
|
676
676
|
canGenerateExploreLink: f,
|
|
677
677
|
requestsLinkZoomActions: o,
|
|
@@ -682,22 +682,22 @@ function rs({
|
|
|
682
682
|
buildRequestLink: D
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
const ns = (
|
|
685
|
+
const ns = (a, e, t) => {
|
|
686
686
|
const i = [];
|
|
687
|
-
return e && i.push(...e), i.push(...gi(
|
|
687
|
+
return e && i.push(...e), i.push(...gi(a, t)), i;
|
|
688
688
|
};
|
|
689
689
|
function os() {
|
|
690
|
-
const
|
|
690
|
+
const a = ve(me), e = new AbortController();
|
|
691
691
|
return lt(() => {
|
|
692
692
|
e.abort();
|
|
693
693
|
}), { issueQuery: async (i, s, r) => {
|
|
694
|
-
if (!
|
|
694
|
+
if (!a)
|
|
695
695
|
throw new Error("Query bridge is not defined");
|
|
696
696
|
const {
|
|
697
697
|
datasource: o,
|
|
698
698
|
limit: n,
|
|
699
|
-
...
|
|
700
|
-
} = i,
|
|
699
|
+
...d
|
|
700
|
+
} = i, h = o || "basic", u = ns(h, i.filters, s.filters);
|
|
701
701
|
let l = i.time_range;
|
|
702
702
|
l ? l.tz || (l = {
|
|
703
703
|
...l,
|
|
@@ -707,15 +707,15 @@ function os() {
|
|
|
707
707
|
tz: s.tz
|
|
708
708
|
};
|
|
709
709
|
const f = {
|
|
710
|
-
datasource:
|
|
710
|
+
datasource: h,
|
|
711
711
|
query: {
|
|
712
|
-
...
|
|
712
|
+
...d,
|
|
713
713
|
time_range: l,
|
|
714
|
-
filters:
|
|
714
|
+
filters: u,
|
|
715
715
|
limit: r ?? n
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
return
|
|
718
|
+
return a.queryFn(f, e);
|
|
719
719
|
} };
|
|
720
720
|
}
|
|
721
721
|
const ye = {
|
|
@@ -734,8 +734,8 @@ const ye = {
|
|
|
734
734
|
refreshCounter: {}
|
|
735
735
|
},
|
|
736
736
|
emits: ["chart-data", "queryComplete"],
|
|
737
|
-
setup(
|
|
738
|
-
const t =
|
|
737
|
+
setup(a, { emit: e }) {
|
|
738
|
+
const t = a, i = e, { issueQuery: s } = ye.useIssueQuery(), r = ve(me), o = () => t.queryReady && r ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, { data: n, error: d, isValidating: h } = xi(o, async () => {
|
|
739
739
|
try {
|
|
740
740
|
const y = await s(t.query, t.context, t.limitOverride);
|
|
741
741
|
return f.value = null, y;
|
|
@@ -748,22 +748,22 @@ const ye = {
|
|
|
748
748
|
refreshInterval: t.context.refreshInterval,
|
|
749
749
|
revalidateOnFocus: !1,
|
|
750
750
|
shouldRetryOnError: !1
|
|
751
|
-
}), { state:
|
|
751
|
+
}), { state: u, swrvState: l } = Oi(n, d, h), f = H(null), m = k(() => u.value === l.ERROR || !!f.value), g = k(() => !t.queryReady || u.value === l.PENDING);
|
|
752
752
|
return ze(n, (y) => {
|
|
753
753
|
y && i("chart-data", y);
|
|
754
|
-
}), (y,
|
|
754
|
+
}), (y, p) => {
|
|
755
755
|
const D = ge("KSkeleton"), P = ge("KEmptyState");
|
|
756
|
-
return g.value || !
|
|
756
|
+
return g.value || !E(n) && !m.value ? (x(), O(D, {
|
|
757
757
|
key: 0,
|
|
758
758
|
class: "chart-skeleton",
|
|
759
759
|
type: "table"
|
|
760
|
-
})) :
|
|
760
|
+
})) : m.value && f.value ? (x(), O(P, {
|
|
761
761
|
key: 1,
|
|
762
762
|
"action-button-visible": !1,
|
|
763
763
|
"data-testid": "chart-empty-state"
|
|
764
764
|
}, Qe({
|
|
765
765
|
icon: $(() => [
|
|
766
|
-
f.value.type === "forbidden" ? (
|
|
766
|
+
f.value.type === "forbidden" ? (x(), O(E(ki), { key: 0 })) : (x(), O(E(Ti), { key: 1 }))
|
|
767
767
|
]),
|
|
768
768
|
title: $(() => [
|
|
769
769
|
oe("p", null, ne(f.value.message), 1)
|
|
@@ -777,9 +777,9 @@ const ye = {
|
|
|
777
777
|
]),
|
|
778
778
|
key: "0"
|
|
779
779
|
} : void 0
|
|
780
|
-
]), 1024)) :
|
|
780
|
+
]), 1024)) : E(n) ? De(y.$slots, "default", {
|
|
781
781
|
key: 2,
|
|
782
|
-
data:
|
|
782
|
+
data: E(n)
|
|
783
783
|
}) : V("", !0);
|
|
784
784
|
};
|
|
785
785
|
}
|
|
@@ -795,33 +795,33 @@ const ye = {
|
|
|
795
795
|
requestsLink: {},
|
|
796
796
|
exploreLink: {}
|
|
797
797
|
},
|
|
798
|
-
setup(
|
|
798
|
+
setup(a) {
|
|
799
799
|
Ye((i) => ({
|
|
800
|
-
|
|
800
|
+
v088169ae: `${i.height}px`
|
|
801
801
|
}));
|
|
802
|
-
const e =
|
|
803
|
-
return (i, s) => (
|
|
804
|
-
context:
|
|
805
|
-
query:
|
|
806
|
-
"query-ready":
|
|
807
|
-
"refresh-counter":
|
|
802
|
+
const e = a, t = k(() => e.chartOptions.type === "single_value");
|
|
803
|
+
return (i, s) => (x(), O(ct, {
|
|
804
|
+
context: a.context,
|
|
805
|
+
query: a.query,
|
|
806
|
+
"query-ready": a.queryReady,
|
|
807
|
+
"refresh-counter": a.refreshCounter
|
|
808
808
|
}, {
|
|
809
809
|
default: $(({ data: r }) => [
|
|
810
810
|
oe("div", {
|
|
811
811
|
class: je(["analytics-chart", { "single-value": t.value }])
|
|
812
812
|
}, [
|
|
813
|
-
ue(
|
|
813
|
+
ue(E(_i), {
|
|
814
814
|
"chart-data": r,
|
|
815
|
-
"chart-options":
|
|
816
|
-
"synthetics-data-key": t.value ? void 0 :
|
|
815
|
+
"chart-options": a.chartOptions,
|
|
816
|
+
"synthetics-data-key": t.value ? void 0 : a.chartOptions.synthetics_data_key
|
|
817
817
|
}, null, 8, ["chart-data", "chart-options", "synthetics-data-key"])
|
|
818
818
|
], 2)
|
|
819
819
|
]),
|
|
820
820
|
_: 1
|
|
821
821
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
822
822
|
}
|
|
823
|
-
}), _e = (
|
|
824
|
-
const t =
|
|
823
|
+
}), _e = (a, e) => {
|
|
824
|
+
const t = a.__vccOpts || a;
|
|
825
825
|
for (const [i, s] of e)
|
|
826
826
|
t[i] = s;
|
|
827
827
|
return t;
|
|
@@ -839,29 +839,29 @@ const ye = {
|
|
|
839
839
|
extraProps: {}
|
|
840
840
|
},
|
|
841
841
|
emits: ["edit-tile", "chart-data", "zoom-time-range", "view-requests", "select-chart-range"],
|
|
842
|
-
setup(
|
|
843
|
-
const t =
|
|
842
|
+
setup(a, { emit: e }) {
|
|
843
|
+
const t = a, i = e, { i18n: s } = ye.useI18n(), r = k(() => ({
|
|
844
844
|
type: t.chartOptions.type,
|
|
845
845
|
stacked: t.chartOptions.stacked ?? !1,
|
|
846
846
|
chartDatasetColors: t.chartOptions.chart_dataset_colors,
|
|
847
847
|
threshold: t.chartOptions.threshold
|
|
848
848
|
})), o = k(() => t.context.zoomable), n = () => {
|
|
849
849
|
i("edit-tile");
|
|
850
|
-
},
|
|
851
|
-
i("chart-data",
|
|
850
|
+
}, d = (h) => {
|
|
851
|
+
i("chart-data", h);
|
|
852
852
|
};
|
|
853
|
-
return (
|
|
853
|
+
return (h, u) => {
|
|
854
854
|
const l = ge("KDropdownItem");
|
|
855
|
-
return
|
|
855
|
+
return x(), O(ct, {
|
|
856
856
|
context: a.context,
|
|
857
857
|
query: a.query,
|
|
858
858
|
"query-ready": a.queryReady,
|
|
859
859
|
"refresh-counter": a.refreshCounter,
|
|
860
|
-
onChartData:
|
|
860
|
+
onChartData: d
|
|
861
861
|
}, {
|
|
862
862
|
default: $(({ data: f }) => [
|
|
863
863
|
oe("div", ls, [
|
|
864
|
-
ue(
|
|
864
|
+
ue(E(bi), It({
|
|
865
865
|
"chart-data": f,
|
|
866
866
|
"chart-options": r.value,
|
|
867
867
|
"explore-link": a.exploreLink,
|
|
@@ -871,15 +871,15 @@ const ye = {
|
|
|
871
871
|
"timeseries-zoom": o.value,
|
|
872
872
|
"tooltip-title": ""
|
|
873
873
|
}, a.extraProps, {
|
|
874
|
-
onSelectChartRange:
|
|
875
|
-
onZoomTimeRange:
|
|
874
|
+
onSelectChartRange: u[0] || (u[0] = (m) => i("select-chart-range", m)),
|
|
875
|
+
onZoomTimeRange: u[1] || (u[1] = (m) => i("zoom-time-range", m))
|
|
876
876
|
}), Qe({ _: 2 }, [
|
|
877
877
|
a.context.editable ? {
|
|
878
878
|
name: "menu-items",
|
|
879
879
|
fn: $(() => [
|
|
880
880
|
ue(l, { onClick: n }, {
|
|
881
881
|
default: $(() => [
|
|
882
|
-
ht(ne(
|
|
882
|
+
ht(ne(E(s).t("renderer.edit")), 1)
|
|
883
883
|
]),
|
|
884
884
|
_: 1
|
|
885
885
|
})
|
|
@@ -905,15 +905,15 @@ const ye = {
|
|
|
905
905
|
requestsLink: {},
|
|
906
906
|
exploreLink: {}
|
|
907
907
|
},
|
|
908
|
-
setup(
|
|
909
|
-
return (e, t) => (
|
|
910
|
-
"chart-options":
|
|
911
|
-
context:
|
|
908
|
+
setup(a) {
|
|
909
|
+
return (e, t) => (x(), O(ft, {
|
|
910
|
+
"chart-options": a.chartOptions,
|
|
911
|
+
context: a.context,
|
|
912
912
|
"extra-props": { showAnnotations: !1 },
|
|
913
|
-
height:
|
|
914
|
-
query:
|
|
915
|
-
"query-ready":
|
|
916
|
-
"refresh-counter":
|
|
913
|
+
height: a.height,
|
|
914
|
+
query: a.query,
|
|
915
|
+
"query-ready": a.queryReady,
|
|
916
|
+
"refresh-counter": a.refreshCounter
|
|
917
917
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
918
918
|
}
|
|
919
919
|
}), St = /* @__PURE__ */ Z({
|
|
@@ -929,17 +929,17 @@ const ye = {
|
|
|
929
929
|
exploreLink: {}
|
|
930
930
|
},
|
|
931
931
|
emits: ["zoom-time-range", "select-chart-range"],
|
|
932
|
-
setup(
|
|
932
|
+
setup(a, { emit: e }) {
|
|
933
933
|
const t = e;
|
|
934
|
-
return (i, s) => (
|
|
935
|
-
"chart-options":
|
|
936
|
-
context:
|
|
937
|
-
"explore-link":
|
|
938
|
-
height:
|
|
939
|
-
query:
|
|
940
|
-
"query-ready":
|
|
941
|
-
"refresh-counter":
|
|
942
|
-
"requests-link":
|
|
934
|
+
return (i, s) => (x(), O(ft, {
|
|
935
|
+
"chart-options": a.chartOptions,
|
|
936
|
+
context: a.context,
|
|
937
|
+
"explore-link": a.exploreLink,
|
|
938
|
+
height: a.height,
|
|
939
|
+
query: a.query,
|
|
940
|
+
"query-ready": a.queryReady,
|
|
941
|
+
"refresh-counter": a.refreshCounter,
|
|
942
|
+
"requests-link": a.requestsLink,
|
|
943
943
|
onSelectChartRange: s[0] || (s[0] = (r) => t("select-chart-range", r)),
|
|
944
944
|
onZoomTimeRange: s[1] || (s[1] = (r) => t("zoom-time-range", r))
|
|
945
945
|
}, null, 8, ["chart-options", "context", "explore-link", "height", "query", "query-ready", "refresh-counter", "requests-link"]));
|
|
@@ -956,11 +956,11 @@ const ye = {
|
|
|
956
956
|
requestsLink: {},
|
|
957
957
|
exploreLink: {}
|
|
958
958
|
},
|
|
959
|
-
setup(
|
|
960
|
-
const e =
|
|
959
|
+
setup(a) {
|
|
960
|
+
const e = a, t = k(() => {
|
|
961
961
|
const s = e.context.timeSpec;
|
|
962
962
|
if (s.type === "absolute")
|
|
963
|
-
return new
|
|
963
|
+
return new mi({
|
|
964
964
|
key: "custom",
|
|
965
965
|
timeframeText: "custom",
|
|
966
966
|
display: "custom",
|
|
@@ -994,10 +994,10 @@ const ye = {
|
|
|
994
994
|
refreshCounter: e.refreshCounter
|
|
995
995
|
};
|
|
996
996
|
});
|
|
997
|
-
return (s, r) => (
|
|
998
|
-
ue(
|
|
997
|
+
return (s, r) => (x(), K("div", us, [
|
|
998
|
+
ue(E(Ni), hi(ui(i.value)), {
|
|
999
999
|
default: $(() => [
|
|
1000
|
-
ue(
|
|
1000
|
+
ue(E(Li))
|
|
1001
1001
|
]),
|
|
1002
1002
|
_: 1
|
|
1003
1003
|
}, 16)
|
|
@@ -1011,10 +1011,10 @@ const ye = {
|
|
|
1011
1011
|
props: {
|
|
1012
1012
|
entityLinkData: {}
|
|
1013
1013
|
},
|
|
1014
|
-
setup(
|
|
1015
|
-
return (e, t) => (
|
|
1014
|
+
setup(a) {
|
|
1015
|
+
return (e, t) => (x(), K("div", gs, ne(a.entityLinkData.label), 1));
|
|
1016
1016
|
}
|
|
1017
|
-
}),
|
|
1017
|
+
}), ms = /* @__PURE__ */ Z({
|
|
1018
1018
|
__name: "TopNTableRenderer",
|
|
1019
1019
|
props: {
|
|
1020
1020
|
query: {},
|
|
@@ -1026,8 +1026,8 @@ const ye = {
|
|
|
1026
1026
|
requestsLink: {},
|
|
1027
1027
|
exploreLink: {}
|
|
1028
1028
|
},
|
|
1029
|
-
setup(
|
|
1030
|
-
const e =
|
|
1029
|
+
setup(a) {
|
|
1030
|
+
const e = a, t = ve(me), i = Pt(async () => {
|
|
1031
1031
|
if (t != null && t.fetchComponent)
|
|
1032
1032
|
try {
|
|
1033
1033
|
return await t.fetchComponent("EntityLink");
|
|
@@ -1039,33 +1039,33 @@ const ye = {
|
|
|
1039
1039
|
var o;
|
|
1040
1040
|
if ((o = e.chartOptions) != null && o.entity_link)
|
|
1041
1041
|
if (r.id.includes(":")) {
|
|
1042
|
-
const [n,
|
|
1043
|
-
return e.chartOptions.entity_link.replace(Bi, n).replace(Rt,
|
|
1042
|
+
const [n, d] = r.id.split(":");
|
|
1043
|
+
return e.chartOptions.entity_link.replace(Bi, n).replace(Rt, d);
|
|
1044
1044
|
} else
|
|
1045
1045
|
return e.chartOptions.entity_link.replace(Rt, r.id);
|
|
1046
1046
|
return "";
|
|
1047
1047
|
};
|
|
1048
|
-
return (r, o) => (
|
|
1049
|
-
context:
|
|
1050
|
-
query:
|
|
1051
|
-
"query-ready":
|
|
1052
|
-
"refresh-counter":
|
|
1048
|
+
return (r, o) => (x(), O(ct, {
|
|
1049
|
+
context: a.context,
|
|
1050
|
+
query: a.query,
|
|
1051
|
+
"query-ready": a.queryReady,
|
|
1052
|
+
"refresh-counter": a.refreshCounter
|
|
1053
1053
|
}, {
|
|
1054
1054
|
default: $(({ data: n }) => [
|
|
1055
|
-
ue(
|
|
1055
|
+
ue(E(wi), {
|
|
1056
1056
|
data: n,
|
|
1057
|
-
"synthetics-data-key":
|
|
1057
|
+
"synthetics-data-key": a.chartOptions.synthetics_data_key
|
|
1058
1058
|
}, Qe({ _: 2 }, [
|
|
1059
1059
|
e.chartOptions.entity_link ? {
|
|
1060
1060
|
name: "name",
|
|
1061
|
-
fn: $(({ record:
|
|
1062
|
-
ue(
|
|
1061
|
+
fn: $(({ record: d }) => [
|
|
1062
|
+
ue(E(i), {
|
|
1063
1063
|
"entity-link-data": {
|
|
1064
|
-
id:
|
|
1065
|
-
label:
|
|
1066
|
-
deleted:
|
|
1064
|
+
id: d.id,
|
|
1065
|
+
label: d.name,
|
|
1066
|
+
deleted: d.deleted
|
|
1067
1067
|
},
|
|
1068
|
-
"external-link": s(
|
|
1068
|
+
"external-link": s(d)
|
|
1069
1069
|
}, null, 8, ["entity-link-data", "external-link"])
|
|
1070
1070
|
]),
|
|
1071
1071
|
key: "0"
|
|
@@ -1075,7 +1075,7 @@ const ye = {
|
|
|
1075
1075
|
_: 1
|
|
1076
1076
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
1077
1077
|
}
|
|
1078
|
-
}),
|
|
1078
|
+
}), ps = /* @__PURE__ */ Z({
|
|
1079
1079
|
__name: "DonutChartRenderer",
|
|
1080
1080
|
props: {
|
|
1081
1081
|
query: {},
|
|
@@ -1087,14 +1087,14 @@ const ye = {
|
|
|
1087
1087
|
requestsLink: {},
|
|
1088
1088
|
exploreLink: {}
|
|
1089
1089
|
},
|
|
1090
|
-
setup(
|
|
1091
|
-
return (e, t) => (
|
|
1092
|
-
"chart-options":
|
|
1093
|
-
context:
|
|
1094
|
-
height:
|
|
1095
|
-
query:
|
|
1096
|
-
"query-ready":
|
|
1097
|
-
"refresh-counter":
|
|
1090
|
+
setup(a) {
|
|
1091
|
+
return (e, t) => (x(), O(ft, {
|
|
1092
|
+
"chart-options": a.chartOptions,
|
|
1093
|
+
context: a.context,
|
|
1094
|
+
height: a.height,
|
|
1095
|
+
query: a.query,
|
|
1096
|
+
"query-ready": a.queryReady,
|
|
1097
|
+
"refresh-counter": a.refreshCounter
|
|
1098
1098
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
1099
1099
|
}
|
|
1100
1100
|
}), ys = ["data-testid"], vs = {
|
|
@@ -1112,14 +1112,14 @@ const ye = {
|
|
|
1112
1112
|
tileId: {}
|
|
1113
1113
|
},
|
|
1114
1114
|
emits: ["edit-tile", "duplicate-tile", "remove-tile", "tile-time-range-zoom"],
|
|
1115
|
-
setup(
|
|
1116
|
-
Ye((
|
|
1117
|
-
|
|
1115
|
+
setup(a, { emit: e }) {
|
|
1116
|
+
Ye((w) => ({
|
|
1117
|
+
v1eb84fc4: `${w.height}px`
|
|
1118
1118
|
}));
|
|
1119
|
-
const t = parseInt(ei, 10), i =
|
|
1119
|
+
const t = parseInt(ei, 10), i = a, s = e, r = Pt(() => import("./GeoMapRenderer-BRvbFVZX.js")), o = ve(me), { i18n: n } = ye.useI18n(), d = H(), h = H({ status: "loading" }), u = H(!1), l = H(), f = H(!1), m = H(!0), {
|
|
1120
1120
|
exploreLinkKebabMenu: g,
|
|
1121
1121
|
requestsLinkKebabMenu: y,
|
|
1122
|
-
canShowKebabMenu:
|
|
1122
|
+
canShowKebabMenu: p,
|
|
1123
1123
|
canGenerateRequestsLink: D,
|
|
1124
1124
|
canGenerateExploreLink: P,
|
|
1125
1125
|
requestsLinkZoomActions: z,
|
|
@@ -1130,36 +1130,36 @@ const ye = {
|
|
|
1130
1130
|
buildRequestsQueryZoomActions: Y
|
|
1131
1131
|
} = ye.useContextLinks({
|
|
1132
1132
|
queryBridge: o,
|
|
1133
|
-
chartData: st(
|
|
1133
|
+
chartData: st(d),
|
|
1134
1134
|
definition: st(wt(i, "definition")),
|
|
1135
1135
|
context: st(wt(i, "context"))
|
|
1136
1136
|
}), { issueQuery: de } = ye.useIssueQuery();
|
|
1137
1137
|
ze(() => i.definition, async () => {
|
|
1138
|
-
await ut(), l.value && (f.value = l.value.scrollWidth > l.value.clientWidth),
|
|
1138
|
+
await ut(), l.value && (f.value = l.value.scrollWidth > l.value.clientWidth), m.value = !0;
|
|
1139
1139
|
}, { immediate: !0, deep: !0 });
|
|
1140
|
-
const Me = k(() => n.t("csvExport.defaultFilename")), J = k(() =>
|
|
1140
|
+
const Me = k(() => n.t("csvExport.defaultFilename")), J = k(() => p.value && (Ie.value || i.context.editable) || !!q.value), Ie = k(() => !!g.value || ("allow_csv_export" in i.definition.chart ? i.definition.chart.allow_csv_export : !0) || i.context.editable), C = {
|
|
1141
1141
|
timeseries_line: St,
|
|
1142
1142
|
timeseries_bar: St,
|
|
1143
1143
|
horizontal_bar: Dt,
|
|
1144
1144
|
vertical_bar: Dt,
|
|
1145
1145
|
gauge: zt,
|
|
1146
|
-
donut:
|
|
1146
|
+
donut: ps,
|
|
1147
1147
|
golden_signals: cs,
|
|
1148
|
-
top_n:
|
|
1148
|
+
top_n: ms,
|
|
1149
1149
|
slottable: void 0,
|
|
1150
1150
|
single_value: zt,
|
|
1151
1151
|
choropleth_map: r
|
|
1152
1152
|
}, S = k(() => {
|
|
1153
|
-
var
|
|
1153
|
+
var w, L;
|
|
1154
1154
|
return {
|
|
1155
|
-
...(
|
|
1155
|
+
...(w = N.value) != null && w.rendererEvents.supportsRequests ? { "select-chart-range": ri } : {},
|
|
1156
1156
|
...(L = N.value) != null && L.rendererEvents.supportsZoom ? { "zoom-time-range": si } : {}
|
|
1157
1157
|
};
|
|
1158
1158
|
}), N = k(() => {
|
|
1159
1159
|
var te, j;
|
|
1160
|
-
const
|
|
1161
|
-
return
|
|
1162
|
-
component:
|
|
1160
|
+
const w = C[i.definition.chart.type], L = !!((te = w == null ? void 0 : w.emits) != null && te.includes("select-chart-range")), A = !!((j = w == null ? void 0 : w.emits) != null && j.includes("zoom-time-range"));
|
|
1161
|
+
return w && {
|
|
1162
|
+
component: w,
|
|
1163
1163
|
rendererProps: {
|
|
1164
1164
|
query: i.definition.query,
|
|
1165
1165
|
context: i.context,
|
|
@@ -1177,95 +1177,95 @@ const ye = {
|
|
|
1177
1177
|
};
|
|
1178
1178
|
}), q = k(() => {
|
|
1179
1179
|
var L;
|
|
1180
|
-
const
|
|
1181
|
-
if ((
|
|
1182
|
-
const A = Bt.get(
|
|
1183
|
-
return A ? A.display : (console.warn("Did not recognize the given relative time range:",
|
|
1184
|
-
} else if ((
|
|
1185
|
-
const A =
|
|
1186
|
-
return `${Ct(
|
|
1180
|
+
const w = (L = i.definition.query) == null ? void 0 : L.time_range;
|
|
1181
|
+
if ((w == null ? void 0 : w.type) === "relative") {
|
|
1182
|
+
const A = Bt.get(pi[w.time_range]);
|
|
1183
|
+
return A ? A.display : (console.warn("Did not recognize the given relative time range:", w.time_range), w.time_range);
|
|
1184
|
+
} else if ((w == null ? void 0 : w.type) === "absolute") {
|
|
1185
|
+
const A = w.tz || "Etc/UTC";
|
|
1186
|
+
return `${Ct(w.start, { short: !0, tz: A })} - ${Ct(w.end, { short: !0, tz: A })}`;
|
|
1187
1187
|
}
|
|
1188
1188
|
return null;
|
|
1189
|
-
}), ee = k(() =>
|
|
1189
|
+
}), ee = k(() => d.value ? rt(d.value.meta.granularity_ms) : void 0), pe = k(() => ["timeseries_line", "timeseries_bar"].includes(i.definition.chart.type)), Re = k(() => {
|
|
1190
1190
|
var L, A;
|
|
1191
|
-
if (!
|
|
1191
|
+
if (!pe.value || !i.queryReady || m.value)
|
|
1192
1192
|
return !1;
|
|
1193
|
-
const
|
|
1194
|
-
return !
|
|
1193
|
+
const w = (A = (L = i.definition) == null ? void 0 : L.query) == null ? void 0 : A.granularity;
|
|
1194
|
+
return !w || !ee.value ? !1 : w !== ee.value;
|
|
1195
1195
|
}), Pe = k(() => {
|
|
1196
1196
|
var A, te, j;
|
|
1197
|
-
const
|
|
1197
|
+
const w = rt(((A = d.value) == null ? void 0 : A.meta.granularity_ms) ?? 0) ?? "unknown", L = ((j = (te = i.definition) == null ? void 0 : te.query) == null ? void 0 : j.granularity) ?? "unknown";
|
|
1198
1198
|
return n.t("query_aged_out_warning", {
|
|
1199
|
-
currentGranularity: n.t(`granularities.${
|
|
1199
|
+
currentGranularity: n.t(`granularities.${w}`),
|
|
1200
1200
|
savedGranularity: n.t(`granularities.${L}`)
|
|
1201
1201
|
});
|
|
1202
1202
|
}), ke = k(() => {
|
|
1203
1203
|
var A, te;
|
|
1204
|
-
const
|
|
1205
|
-
return
|
|
1204
|
+
const w = [...i.context.filters, ...i.definition.query.filters ?? []], L = ((te = (A = i.definition) == null ? void 0 : A.query) == null ? void 0 : te.datasource) ?? "api_usage";
|
|
1205
|
+
return w.filter((j) => Ft(j.field).some((ni) => L === ni));
|
|
1206
1206
|
}), Je = () => {
|
|
1207
1207
|
s("edit-tile", i.definition);
|
|
1208
|
-
},
|
|
1208
|
+
}, pt = () => {
|
|
1209
1209
|
s("duplicate-tile", i.definition);
|
|
1210
1210
|
}, et = () => {
|
|
1211
1211
|
s("remove-tile", i.definition);
|
|
1212
|
-
}, tt = (
|
|
1213
|
-
|
|
1212
|
+
}, tt = (w) => {
|
|
1213
|
+
d.value = w, m.value = !1;
|
|
1214
1214
|
}, yt = () => {
|
|
1215
|
-
|
|
1215
|
+
u.value = !1;
|
|
1216
1216
|
}, ii = async () => {
|
|
1217
|
-
var
|
|
1218
|
-
if (
|
|
1217
|
+
var w;
|
|
1218
|
+
if (u.value = !0, h.value = { status: "loading" }, ((w = o == null ? void 0 : o.staticConfig) == null ? void 0 : w.increaseCsvExportLimit) ?? !0)
|
|
1219
1219
|
de(i.definition.query, i.context, yi).then((L) => {
|
|
1220
|
-
|
|
1220
|
+
h.value = { status: "success", chartData: L };
|
|
1221
1221
|
}).catch((L) => {
|
|
1222
|
-
|
|
1222
|
+
h.value = { status: "error", error: L };
|
|
1223
1223
|
});
|
|
1224
|
-
else if (
|
|
1225
|
-
|
|
1224
|
+
else if (d.value)
|
|
1225
|
+
h.value = { status: "success", chartData: d.value };
|
|
1226
1226
|
else {
|
|
1227
|
-
const L = ze(
|
|
1228
|
-
A && (
|
|
1227
|
+
const L = ze(d, (A) => {
|
|
1228
|
+
A && (h.value = { status: "success", chartData: A }, L());
|
|
1229
1229
|
});
|
|
1230
1230
|
}
|
|
1231
|
-
}, si = (
|
|
1231
|
+
}, si = (w) => {
|
|
1232
1232
|
const L = {
|
|
1233
1233
|
tileId: i.tileId.toString(),
|
|
1234
|
-
timeRange:
|
|
1234
|
+
timeRange: w
|
|
1235
1235
|
};
|
|
1236
1236
|
s("tile-time-range-zoom", L);
|
|
1237
|
-
}, ri = (
|
|
1238
|
-
const L = ke.value, A = Y(
|
|
1237
|
+
}, ri = (w) => {
|
|
1238
|
+
const L = ke.value, A = Y(w, L), te = B(w, L);
|
|
1239
1239
|
z.value = D.value ? { href: M(A) } : void 0, Q.value = P.value ? { href: R(te) } : void 0;
|
|
1240
1240
|
};
|
|
1241
|
-
return (
|
|
1241
|
+
return (w, L) => {
|
|
1242
1242
|
const A = ge("KTooltip"), te = ge("KBadge"), j = ge("KDropdownItem"), vt = ge("KDropdown");
|
|
1243
|
-
return
|
|
1244
|
-
class: je(["tile-boundary", { editable:
|
|
1245
|
-
"data-testid": `tile-${
|
|
1243
|
+
return x(), K("div", {
|
|
1244
|
+
class: je(["tile-boundary", { editable: a.context.editable }]),
|
|
1245
|
+
"data-testid": `tile-${a.tileId}`
|
|
1246
1246
|
}, [
|
|
1247
|
-
|
|
1247
|
+
a.definition.chart.type !== "slottable" ? (x(), K("div", vs, [
|
|
1248
1248
|
ue(A, {
|
|
1249
1249
|
class: "title-tooltip",
|
|
1250
1250
|
disabled: !f.value,
|
|
1251
1251
|
"max-width": "500",
|
|
1252
|
-
text:
|
|
1252
|
+
text: a.definition.chart.chart_title
|
|
1253
1253
|
}, {
|
|
1254
1254
|
default: $(() => [
|
|
1255
1255
|
oe("div", {
|
|
1256
1256
|
ref_key: "titleRef",
|
|
1257
1257
|
ref: l,
|
|
1258
1258
|
class: "title"
|
|
1259
|
-
}, ne(
|
|
1259
|
+
}, ne(a.definition.chart.chart_title), 513)
|
|
1260
1260
|
]),
|
|
1261
1261
|
_: 1
|
|
1262
1262
|
}, 8, ["disabled", "text"]),
|
|
1263
|
-
J.value ? (
|
|
1263
|
+
J.value ? (x(), K("div", {
|
|
1264
1264
|
key: 0,
|
|
1265
1265
|
class: "tile-actions",
|
|
1266
|
-
"data-testid": `tile-actions-${
|
|
1266
|
+
"data-testid": `tile-actions-${a.tileId}`
|
|
1267
1267
|
}, [
|
|
1268
|
-
q.value ? (
|
|
1268
|
+
q.value ? (x(), O(te, {
|
|
1269
1269
|
key: 0,
|
|
1270
1270
|
"data-testid": "time-range-badge",
|
|
1271
1271
|
tooltip: Re.value ? Pe.value : void 0,
|
|
@@ -1279,113 +1279,113 @@ const ye = {
|
|
|
1279
1279
|
Re.value ? {
|
|
1280
1280
|
name: "icon",
|
|
1281
1281
|
fn: $(() => [
|
|
1282
|
-
ue(
|
|
1282
|
+
ue(E(zi), { size: E(fs) }, null, 8, ["size"])
|
|
1283
1283
|
]),
|
|
1284
1284
|
key: "0"
|
|
1285
1285
|
} : void 0
|
|
1286
1286
|
]), 1032, ["tooltip"])) : V("", !0),
|
|
1287
|
-
|
|
1287
|
+
E(p) && a.context.editable && !a.isFullscreen ? (x(), O(E(Di), {
|
|
1288
1288
|
key: 1,
|
|
1289
1289
|
class: "edit-icon",
|
|
1290
|
-
color:
|
|
1291
|
-
"data-testid": `edit-tile-${
|
|
1292
|
-
size:
|
|
1290
|
+
color: E(Nt),
|
|
1291
|
+
"data-testid": `edit-tile-${a.tileId}`,
|
|
1292
|
+
size: E(Lt),
|
|
1293
1293
|
onClick: Je
|
|
1294
1294
|
}, null, 8, ["color", "data-testid", "size"])) : V("", !0),
|
|
1295
|
-
|
|
1295
|
+
E(p) && Ie.value && !a.isFullscreen ? (x(), O(vt, {
|
|
1296
1296
|
key: 2,
|
|
1297
1297
|
class: "dropdown",
|
|
1298
|
-
"data-testid": `chart-action-menu-${
|
|
1298
|
+
"data-testid": `chart-action-menu-${a.tileId}`,
|
|
1299
1299
|
"kpop-attributes": { placement: "bottom-end" }
|
|
1300
1300
|
}, {
|
|
1301
1301
|
items: $(() => [
|
|
1302
|
-
|
|
1302
|
+
E(g) ? (x(), O(j, {
|
|
1303
1303
|
key: 0,
|
|
1304
|
-
"data-testid": `chart-jump-to-explore-${
|
|
1305
|
-
item: { label:
|
|
1304
|
+
"data-testid": `chart-jump-to-explore-${a.tileId}`,
|
|
1305
|
+
item: { label: E(n).t("jumpToExplore"), to: E(g) }
|
|
1306
1306
|
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1307
|
-
|
|
1307
|
+
E(y) ? (x(), O(j, {
|
|
1308
1308
|
key: 1,
|
|
1309
|
-
"data-testid": `chart-jump-to-requests-${
|
|
1310
|
-
item: { label:
|
|
1309
|
+
"data-testid": `chart-jump-to-requests-${a.tileId}`,
|
|
1310
|
+
item: { label: E(n).t("jumpToRequests"), to: E(y) }
|
|
1311
1311
|
}, null, 8, ["data-testid", "item"])) : V("", !0),
|
|
1312
|
-
!("allow_csv_export" in
|
|
1312
|
+
!("allow_csv_export" in a.definition.chart) || a.definition.chart.allow_csv_export ? (x(), O(j, {
|
|
1313
1313
|
key: 2,
|
|
1314
1314
|
class: "chart-export-button",
|
|
1315
|
-
"data-testid": `chart-csv-export-${
|
|
1315
|
+
"data-testid": `chart-csv-export-${a.tileId}`,
|
|
1316
1316
|
onClick: ii
|
|
1317
1317
|
}, {
|
|
1318
1318
|
default: $(() => [
|
|
1319
1319
|
oe("span", {
|
|
1320
1320
|
class: "chart-export-trigger",
|
|
1321
|
-
"data-testid": `csv-export-button-${
|
|
1322
|
-
}, ne(
|
|
1321
|
+
"data-testid": `csv-export-button-${a.tileId}`
|
|
1322
|
+
}, ne(E(n).t("csvExport.exportAsCsv")), 9, ws)
|
|
1323
1323
|
]),
|
|
1324
1324
|
_: 1
|
|
1325
1325
|
}, 8, ["data-testid"])) : V("", !0),
|
|
1326
|
-
|
|
1326
|
+
a.context.editable ? (x(), O(j, {
|
|
1327
1327
|
key: 3,
|
|
1328
|
-
"data-testid": `duplicate-tile-${
|
|
1329
|
-
onClick:
|
|
1328
|
+
"data-testid": `duplicate-tile-${a.tileId}`,
|
|
1329
|
+
onClick: pt
|
|
1330
1330
|
}, {
|
|
1331
1331
|
default: $(() => [
|
|
1332
|
-
ht(ne(
|
|
1332
|
+
ht(ne(E(n).t("renderer.duplicateTile")), 1)
|
|
1333
1333
|
]),
|
|
1334
1334
|
_: 1
|
|
1335
1335
|
}, 8, ["data-testid"])) : V("", !0),
|
|
1336
|
-
|
|
1336
|
+
a.context.editable ? (x(), O(j, {
|
|
1337
1337
|
key: 4,
|
|
1338
|
-
"data-testid": `remove-tile-${
|
|
1338
|
+
"data-testid": `remove-tile-${a.tileId}`,
|
|
1339
1339
|
onClick: et
|
|
1340
1340
|
}, {
|
|
1341
1341
|
default: $(() => [
|
|
1342
|
-
oe("span", Es, ne(
|
|
1342
|
+
oe("span", Es, ne(E(n).t("renderer.delete")), 1)
|
|
1343
1343
|
]),
|
|
1344
1344
|
_: 1
|
|
1345
1345
|
}, 8, ["data-testid"])) : V("", !0)
|
|
1346
1346
|
]),
|
|
1347
1347
|
default: $(() => [
|
|
1348
|
-
ue(
|
|
1348
|
+
ue(E(Si), {
|
|
1349
1349
|
class: "kebab-action-menu",
|
|
1350
|
-
color:
|
|
1351
|
-
"data-testid": `kebab-action-menu-${
|
|
1352
|
-
size:
|
|
1350
|
+
color: E(Nt),
|
|
1351
|
+
"data-testid": `kebab-action-menu-${a.tileId}`,
|
|
1352
|
+
size: E(Lt)
|
|
1353
1353
|
}, null, 8, ["color", "data-testid", "size"])
|
|
1354
1354
|
]),
|
|
1355
1355
|
_: 1
|
|
1356
1356
|
}, 8, ["data-testid"])) : V("", !0)
|
|
1357
|
-
], 8, _s)) : "description" in
|
|
1357
|
+
], 8, _s)) : "description" in a.definition.chart ? (x(), K("div", {
|
|
1358
1358
|
key: 1,
|
|
1359
1359
|
class: "header-description",
|
|
1360
|
-
"data-testid": `tile-description-${
|
|
1361
|
-
}, ne(
|
|
1362
|
-
|
|
1360
|
+
"data-testid": `tile-description-${a.tileId}`
|
|
1361
|
+
}, ne(a.definition.chart.description), 9, xs)) : V("", !0),
|
|
1362
|
+
u.value ? (x(), O(E(Ei), {
|
|
1363
1363
|
key: 2,
|
|
1364
|
-
"data-testid": `csv-export-modal-${
|
|
1365
|
-
"export-state":
|
|
1364
|
+
"data-testid": `csv-export-modal-${a.tileId}`,
|
|
1365
|
+
"export-state": h.value,
|
|
1366
1366
|
filename: Me.value,
|
|
1367
1367
|
onCloseModal: yt
|
|
1368
1368
|
}, null, 8, ["data-testid", "export-state", "filename"])) : V("", !0)
|
|
1369
1369
|
])) : V("", !0),
|
|
1370
1370
|
oe("div", {
|
|
1371
1371
|
class: "tile-content",
|
|
1372
|
-
"data-testid": `tile-content-${
|
|
1372
|
+
"data-testid": `tile-content-${a.tileId}`
|
|
1373
1373
|
}, [
|
|
1374
|
-
N.value ? (
|
|
1374
|
+
N.value ? (x(), O(qt(N.value.component), It({ key: 0 }, N.value.rendererProps, di(S.value), { onChartData: tt }), null, 16)) : V("", !0)
|
|
1375
1375
|
], 8, Cs)
|
|
1376
1376
|
], 10, ys);
|
|
1377
1377
|
};
|
|
1378
1378
|
}
|
|
1379
|
-
}), ks = /* @__PURE__ */ _e(Rs, [["__scopeId", "data-v-543445fd"]]), Ts = (
|
|
1379
|
+
}), ks = /* @__PURE__ */ _e(Rs, [["__scopeId", "data-v-543445fd"]]), Ts = (a, e) => {
|
|
1380
1380
|
let t = 0;
|
|
1381
1381
|
const i = /* @__PURE__ */ new Map();
|
|
1382
1382
|
e.forEach((r) => {
|
|
1383
|
-
const o = r.layout.position.row, n = i.get(o),
|
|
1384
|
-
t = Math.max(t, o + r.layout.size.rows), n === void 0 ? i.set(o,
|
|
1383
|
+
const o = r.layout.position.row, n = i.get(o), d = r.layout.size.rows === 1 && !!r.layout.size.fit_to_content;
|
|
1384
|
+
t = Math.max(t, o + r.layout.size.rows), n === void 0 ? i.set(o, d) : i.set(o, n && d);
|
|
1385
1385
|
});
|
|
1386
1386
|
const s = [];
|
|
1387
1387
|
for (let r = 0; r < t; r++)
|
|
1388
|
-
i.get(r) ? s.push("auto") : s.push(`${
|
|
1388
|
+
i.get(r) ? s.push("auto") : s.push(`${a}px`);
|
|
1389
1389
|
return s;
|
|
1390
1390
|
}, zs = /* @__PURE__ */ Z({
|
|
1391
1391
|
__name: "GridLayout",
|
|
@@ -1400,12 +1400,12 @@ const ye = {
|
|
|
1400
1400
|
required: !0
|
|
1401
1401
|
}
|
|
1402
1402
|
},
|
|
1403
|
-
setup(
|
|
1403
|
+
setup(a) {
|
|
1404
1404
|
Ye((n) => ({
|
|
1405
|
-
|
|
1406
|
-
|
|
1405
|
+
v2a38e79e: E(Wt),
|
|
1406
|
+
v4cc71de6: r.value
|
|
1407
1407
|
}));
|
|
1408
|
-
const e =
|
|
1408
|
+
const e = a, t = H(null), i = H(0), s = new ResizeObserver((n) => {
|
|
1409
1409
|
window.requestAnimationFrame(() => {
|
|
1410
1410
|
!Array.isArray(n) || !n.length || (i.value = n[0].contentRect.width);
|
|
1411
1411
|
});
|
|
@@ -1415,8 +1415,8 @@ const ye = {
|
|
|
1415
1415
|
}), lt(() => {
|
|
1416
1416
|
t.value && s.unobserve(t.value);
|
|
1417
1417
|
});
|
|
1418
|
-
const r = k(() => Ts(e.tileHeight, e.tiles).join(" ")), o = k(() => e.tiles.map((n,
|
|
1419
|
-
key: `tile-${
|
|
1418
|
+
const r = k(() => Ts(e.tileHeight, e.tiles).join(" ")), o = k(() => e.tiles.map((n, d) => ({
|
|
1419
|
+
key: `tile-${d}`,
|
|
1420
1420
|
tile: n,
|
|
1421
1421
|
style: {
|
|
1422
1422
|
"grid-column-start": n.layout.position.col + 1,
|
|
@@ -1425,28 +1425,28 @@ const ye = {
|
|
|
1425
1425
|
"grid-row-end": n.layout.position.row + 1 + n.layout.size.rows
|
|
1426
1426
|
}
|
|
1427
1427
|
})));
|
|
1428
|
-
return (n,
|
|
1428
|
+
return (n, d) => (x(), K("div", {
|
|
1429
1429
|
ref_key: "gridContainer",
|
|
1430
1430
|
ref: t,
|
|
1431
1431
|
class: "kong-ui-public-grid-layout"
|
|
1432
1432
|
}, [
|
|
1433
|
-
(
|
|
1434
|
-
key:
|
|
1433
|
+
(x(!0), K($t, null, Gt(o.value, (h) => (x(), K("div", {
|
|
1434
|
+
key: h.key,
|
|
1435
1435
|
class: je(["grid-cell", {
|
|
1436
|
-
"empty-cell": !
|
|
1436
|
+
"empty-cell": !h.tile
|
|
1437
1437
|
}]),
|
|
1438
|
-
style: Et(
|
|
1438
|
+
style: Et(h.style)
|
|
1439
1439
|
}, [
|
|
1440
1440
|
De(n.$slots, "tile", {
|
|
1441
|
-
style: Et(
|
|
1442
|
-
tile:
|
|
1441
|
+
style: Et(h.style),
|
|
1442
|
+
tile: h.tile
|
|
1443
1443
|
}, void 0, !0)
|
|
1444
1444
|
], 6))), 128))
|
|
1445
1445
|
], 512));
|
|
1446
1446
|
}
|
|
1447
1447
|
}), Ds = /* @__PURE__ */ _e(zs, [["__scopeId", "data-v-354b7177"]]);
|
|
1448
|
-
function Ss(
|
|
1449
|
-
const r = (...o) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(
|
|
1448
|
+
function Ss(a, e, t, i, s) {
|
|
1449
|
+
const r = (...o) => (console.warn("gridstack.js: Function `" + t + "` is deprecated in " + s + " and has been replaced with `" + i + "`. It will be **removed** in a future release"), e.apply(a, o));
|
|
1450
1450
|
return r.prototype = e.prototype, r;
|
|
1451
1451
|
}
|
|
1452
1452
|
class c {
|
|
@@ -1652,10 +1652,10 @@ class c {
|
|
|
1652
1652
|
static updateScrollPosition(e, t, i) {
|
|
1653
1653
|
const s = e.getBoundingClientRect(), r = window.innerHeight || document.documentElement.clientHeight;
|
|
1654
1654
|
if (s.top < 0 || s.bottom > r) {
|
|
1655
|
-
const o = s.bottom - r, n = s.top,
|
|
1656
|
-
if (
|
|
1657
|
-
const
|
|
1658
|
-
s.top < 0 && i < 0 ? e.offsetHeight > r ?
|
|
1655
|
+
const o = s.bottom - r, n = s.top, d = this.getScrollElement(e);
|
|
1656
|
+
if (d !== null) {
|
|
1657
|
+
const h = d.scrollTop;
|
|
1658
|
+
s.top < 0 && i < 0 ? e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += Math.abs(n) > Math.abs(i) ? i : n : i > 0 && (e.offsetHeight > r ? d.scrollTop += i : d.scrollTop += o > i ? i : o), t.top += d.scrollTop - h;
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
1661
1661
|
}
|
|
@@ -1667,8 +1667,8 @@ class c {
|
|
|
1667
1667
|
* @param distance Distance from the V edges to start scrolling
|
|
1668
1668
|
*/
|
|
1669
1669
|
static updateScrollResize(e, t, i) {
|
|
1670
|
-
const s = this.getScrollElement(t), r = s.clientHeight, o = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - o,
|
|
1671
|
-
|
|
1670
|
+
const s = this.getScrollElement(t), r = s.clientHeight, o = s === this.getScrollElement() ? 0 : s.getBoundingClientRect().top, n = e.clientY - o, d = n < i, h = n > r - i;
|
|
1671
|
+
d ? s.scrollBy({ behavior: "smooth", top: n - i }) : h && s.scrollBy({ behavior: "smooth", top: i - (r - n) });
|
|
1672
1672
|
}
|
|
1673
1673
|
/** single level clone, returning a new object with same top fields. This will share sub objects and arrays */
|
|
1674
1674
|
static clone(e) {
|
|
@@ -1807,19 +1807,19 @@ class le {
|
|
|
1807
1807
|
!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));
|
|
1808
1808
|
let o = !1;
|
|
1809
1809
|
const n = { nested: !0, pack: !1 };
|
|
1810
|
-
let
|
|
1810
|
+
let d = 0;
|
|
1811
1811
|
for (; i = i || this.collide(e, r, s.skip); ) {
|
|
1812
|
-
if (
|
|
1812
|
+
if (d++ > this.nodes.length * 2)
|
|
1813
1813
|
throw new Error("Infinite collide check");
|
|
1814
|
-
let
|
|
1814
|
+
let h;
|
|
1815
1815
|
if (i.locked || this._loading || e._moving && !e._skipDown && t.y > e.y && !this.float && // can take space we had, or before where we're going
|
|
1816
1816
|
(!this.collide(i, { ...i, y: e.y }, e) || !this.collide(i, { ...i, y: t.y - i.h }, e))) {
|
|
1817
1817
|
e._skipDown = e._skipDown || t.y > e.y;
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1818
|
+
const u = { ...t, y: i.y + i.h, ...n };
|
|
1819
|
+
h = this._loading && c.samePos(e, u) ? !0 : this.moveNode(e, u), (i.locked || this._loading) && h ? c.copyPos(t, e) : !i.locked && h && s.pack && (this._packNodes(), t.y = i.y + i.h, c.copyPos(e, t)), o = o || h;
|
|
1820
1820
|
} else
|
|
1821
|
-
|
|
1822
|
-
if (!
|
|
1821
|
+
h = this.moveNode(i, { ...i, y: t.y + t.h, skip: e, ...n });
|
|
1822
|
+
if (!h)
|
|
1823
1823
|
return o;
|
|
1824
1824
|
i = void 0;
|
|
1825
1825
|
}
|
|
@@ -1841,14 +1841,14 @@ class le {
|
|
|
1841
1841
|
const s = e._rect, r = { ...t.rect };
|
|
1842
1842
|
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;
|
|
1843
1843
|
let o, n = 0.5;
|
|
1844
|
-
for (let
|
|
1845
|
-
if (
|
|
1844
|
+
for (let d of i) {
|
|
1845
|
+
if (d.locked || !d._rect)
|
|
1846
1846
|
break;
|
|
1847
|
-
const
|
|
1848
|
-
let
|
|
1849
|
-
s.y <
|
|
1850
|
-
const f = Math.min(l,
|
|
1851
|
-
f > n && (n = f, o =
|
|
1847
|
+
const h = d._rect;
|
|
1848
|
+
let u = Number.MAX_VALUE, l = Number.MAX_VALUE;
|
|
1849
|
+
s.y < h.y ? u = (r.y + r.h - h.y) / h.h : s.y + s.h > h.y + h.h && (u = (h.y + h.h - r.y) / h.h), s.x < h.x ? l = (r.x + r.w - h.x) / h.w : s.x + s.w > h.x + h.w && (l = (h.x + h.w - r.x) / h.w);
|
|
1850
|
+
const f = Math.min(l, u);
|
|
1851
|
+
f > n && (n = f, o = d);
|
|
1852
1852
|
}
|
|
1853
1853
|
return t.collide = o, o;
|
|
1854
1854
|
}
|
|
@@ -1922,9 +1922,9 @@ class le {
|
|
|
1922
1922
|
const s = this._inColumnResize;
|
|
1923
1923
|
s || (this._inColumnResize = !0);
|
|
1924
1924
|
const r = this.nodes;
|
|
1925
|
-
return this.nodes = [], r.forEach((o, n,
|
|
1926
|
-
let
|
|
1927
|
-
o.locked || (o.autoPosition = !0, e === "list" && n && (
|
|
1925
|
+
return this.nodes = [], r.forEach((o, n, d) => {
|
|
1926
|
+
let h;
|
|
1927
|
+
o.locked || (o.autoPosition = !0, e === "list" && n && (h = d[n - 1])), this.addNode(o, !1, h);
|
|
1928
1928
|
}), s || delete this._inColumnResize, i || this.batchUpdate(!1), this;
|
|
1929
1929
|
}
|
|
1930
1930
|
/** enable/disable floating widgets (default: `false`) See [example](http://gridstackjs.com/demo/float.html) */
|
|
@@ -2022,11 +2022,11 @@ class le {
|
|
|
2022
2022
|
const r = s ? s.y * i + (s.x + s.w) : 0;
|
|
2023
2023
|
let o = !1;
|
|
2024
2024
|
for (let n = r; !o; ++n) {
|
|
2025
|
-
const
|
|
2026
|
-
if (
|
|
2025
|
+
const d = n % i, h = Math.floor(n / i);
|
|
2026
|
+
if (d + e.w > i)
|
|
2027
2027
|
continue;
|
|
2028
|
-
const
|
|
2029
|
-
t.find((l) => c.isIntercepted(
|
|
2028
|
+
const u = { x: d, y: h, w: e.w, h: e.h };
|
|
2029
|
+
t.find((l) => c.isIntercepted(u, l)) || ((e.x !== d || e.y !== h) && (e._dirty = !0), e.x = d, e.y = h, delete e.autoPosition, o = !0);
|
|
2030
2030
|
}
|
|
2031
2031
|
return o;
|
|
2032
2032
|
}
|
|
@@ -2072,7 +2072,7 @@ class le {
|
|
|
2072
2072
|
return this._notify(), !0;
|
|
2073
2073
|
}
|
|
2074
2074
|
return r ? (s.nodes.filter((o) => o._dirty).forEach((o) => {
|
|
2075
|
-
const n = this.nodes.find((
|
|
2075
|
+
const n = this.nodes.find((d) => d._id === o._id);
|
|
2076
2076
|
n && (c.copyPos(n, o), n._dirty = !0);
|
|
2077
2077
|
}), this._notify(), !0) : !1;
|
|
2078
2078
|
}
|
|
@@ -2093,7 +2093,7 @@ class le {
|
|
|
2093
2093
|
}
|
|
2094
2094
|
/** return true if the passed in node was actually moved (checks for no-op and locked) */
|
|
2095
2095
|
moveNode(e, t) {
|
|
2096
|
-
var
|
|
2096
|
+
var h, u;
|
|
2097
2097
|
if (!e || /*node.locked ||*/
|
|
2098
2098
|
!t)
|
|
2099
2099
|
return !1;
|
|
@@ -2103,17 +2103,17 @@ class le {
|
|
|
2103
2103
|
if (c.copyPos(r, t), this.nodeBoundFix(r, s), c.copyPos(t, r), !t.forceCollide && c.samePos(e, t))
|
|
2104
2104
|
return !1;
|
|
2105
2105
|
const o = c.copyPos({}, e), n = this.collideAll(e, r, t.skip);
|
|
2106
|
-
let
|
|
2106
|
+
let d = !0;
|
|
2107
2107
|
if (n.length) {
|
|
2108
2108
|
const l = e._moving && !t.nested;
|
|
2109
2109
|
let f = l ? this.directionCollideCoverage(e, t, n) : n[0];
|
|
2110
|
-
if (l && f && ((
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2110
|
+
if (l && f && ((u = (h = e.grid) == null ? void 0 : h.opts) != null && u.subGridDynamic) && !e.grid._isTemp) {
|
|
2111
|
+
const m = c.areaIntercept(t.rect, f._rect), g = c.area(t.rect), y = c.area(f._rect);
|
|
2112
|
+
m / (g < y ? g : y) > 0.8 && (f.grid.makeSubGrid(f.el, void 0, e), f = void 0);
|
|
2113
2113
|
}
|
|
2114
|
-
f ?
|
|
2114
|
+
f ? d = !this._fixCollisions(e, r, f, t) : (d = !1, i && delete t.pack);
|
|
2115
2115
|
}
|
|
2116
|
-
return
|
|
2116
|
+
return d && !c.samePos(e, r) && (e._dirty = !0, c.copyPos(e, r)), t.pack && this._packNodes()._notify(), !c.samePos(e, o);
|
|
2117
2117
|
}
|
|
2118
2118
|
getRow() {
|
|
2119
2119
|
return this.nodes.reduce((e, t) => Math.max(e, t.y + t.h), 0);
|
|
@@ -2131,8 +2131,8 @@ class le {
|
|
|
2131
2131
|
var o;
|
|
2132
2132
|
const i = (o = this._layouts) == null ? void 0 : o.length, s = i && this.column !== i - 1 ? this._layouts[i - 1] : null, r = [];
|
|
2133
2133
|
return this.sortNodes(), this.nodes.forEach((n) => {
|
|
2134
|
-
const
|
|
2135
|
-
c.removeInternalForSave(
|
|
2134
|
+
const d = s == null ? void 0 : s.find((u) => u._id === n._id), h = { ...n, ...d || {} };
|
|
2135
|
+
c.removeInternalForSave(h, !e), t && t(n, h), r.push(h);
|
|
2136
2136
|
}), r;
|
|
2137
2137
|
}
|
|
2138
2138
|
/** @internal called whenever a node is added or moved - updates the cached layouts */
|
|
@@ -2171,19 +2171,19 @@ class le {
|
|
|
2171
2171
|
s && this.sortNodes(1), t < e && this.cacheLayout(this.nodes, e), this.batchUpdate();
|
|
2172
2172
|
let r = [], o = s ? this.nodes : c.sort(this.nodes, -1);
|
|
2173
2173
|
if (t > e && this._layouts) {
|
|
2174
|
-
const
|
|
2175
|
-
!
|
|
2176
|
-
const l = o.find((f) => f._id ===
|
|
2177
|
-
l && (!s && !
|
|
2178
|
-
})),
|
|
2179
|
-
const l = o.findIndex((f) => f._id ===
|
|
2174
|
+
const d = this._layouts[t] || [], h = this._layouts.length - 1;
|
|
2175
|
+
!d.length && e !== h && ((n = this._layouts[h]) != null && n.length) && (e = h, this._layouts[h].forEach((u) => {
|
|
2176
|
+
const l = o.find((f) => f._id === u._id);
|
|
2177
|
+
l && (!s && !u.autoPosition && (l.x = u.x ?? l.x, l.y = u.y ?? l.y), l.w = u.w ?? l.w, (u.x == null || u.y === void 0) && (l.autoPosition = !0));
|
|
2178
|
+
})), d.forEach((u) => {
|
|
2179
|
+
const l = o.findIndex((f) => f._id === u._id);
|
|
2180
2180
|
if (l !== -1) {
|
|
2181
2181
|
const f = o[l];
|
|
2182
2182
|
if (s) {
|
|
2183
|
-
f.w =
|
|
2183
|
+
f.w = u.w;
|
|
2184
2184
|
return;
|
|
2185
2185
|
}
|
|
2186
|
-
(
|
|
2186
|
+
(u.autoPosition || isNaN(u.x) || isNaN(u.y)) && this.findEmptyPosition(u, r), u.autoPosition || (f.x = u.x ?? f.x, f.y = u.y ?? f.y, f.w = u.w ?? f.w, r.push(f)), o.splice(l, 1);
|
|
2187
2187
|
}
|
|
2188
2188
|
});
|
|
2189
2189
|
}
|
|
@@ -2194,16 +2194,16 @@ class le {
|
|
|
2194
2194
|
if (typeof i == "function")
|
|
2195
2195
|
i(t, e, r, o);
|
|
2196
2196
|
else {
|
|
2197
|
-
const
|
|
2197
|
+
const d = s || i === "none" ? 1 : t / e, h = i === "move" || i === "moveScale", u = i === "scale" || i === "moveScale";
|
|
2198
2198
|
o.forEach((l) => {
|
|
2199
|
-
l.x = t === 1 ? 0 :
|
|
2199
|
+
l.x = t === 1 ? 0 : h ? Math.round(l.x * d) : Math.min(l.x, t - 1), l.w = t === 1 || e === 1 ? 1 : u ? Math.round(l.w * d) || 1 : Math.min(l.w, t), r.push(l);
|
|
2200
2200
|
}), o = [];
|
|
2201
2201
|
}
|
|
2202
|
-
r = c.sort(r, -1), this._inColumnResize = !0, this.nodes = [], r.forEach((
|
|
2203
|
-
this.addNode(
|
|
2202
|
+
r = c.sort(r, -1), this._inColumnResize = !0, this.nodes = [], r.forEach((d) => {
|
|
2203
|
+
this.addNode(d, !1), delete d._orig;
|
|
2204
2204
|
});
|
|
2205
2205
|
}
|
|
2206
|
-
return this.nodes.forEach((
|
|
2206
|
+
return this.nodes.forEach((d) => delete d._orig), this.batchUpdate(!1, !s), delete this._inColumnResize, this;
|
|
2207
2207
|
}
|
|
2208
2208
|
/**
|
|
2209
2209
|
* call to cache the given layout internally to the given location so we can restore back when column changes size
|
|
@@ -2215,7 +2215,7 @@ class le {
|
|
|
2215
2215
|
const s = [];
|
|
2216
2216
|
return e.forEach((r, o) => {
|
|
2217
2217
|
if (r._id === void 0) {
|
|
2218
|
-
const n = r.id ? this.nodes.find((
|
|
2218
|
+
const n = r.id ? this.nodes.find((d) => d.id === r.id) : void 0;
|
|
2219
2219
|
r._id = (n == null ? void 0 : n._id) ?? le._idSeq++;
|
|
2220
2220
|
}
|
|
2221
2221
|
s[o] = { x: r.x, y: r.y, w: r.w, _id: r._id };
|
|
@@ -2282,39 +2282,39 @@ const X = {
|
|
|
2282
2282
|
// styleInHead: false,
|
|
2283
2283
|
//removable
|
|
2284
2284
|
};
|
|
2285
|
-
class
|
|
2285
|
+
class b {
|
|
2286
2286
|
}
|
|
2287
2287
|
const ae = typeof window < "u" && typeof document < "u" && ("ontouchstart" in document || "ontouchstart" in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0);
|
|
2288
2288
|
class he {
|
|
2289
2289
|
}
|
|
2290
|
-
function Fe(
|
|
2291
|
-
|
|
2290
|
+
function Fe(a, e) {
|
|
2291
|
+
a.touches.length > 1 || (a.cancelable && a.preventDefault(), c.simulateMouseEvent(a.changedTouches[0], e));
|
|
2292
2292
|
}
|
|
2293
|
-
function ti(
|
|
2294
|
-
|
|
2293
|
+
function ti(a, e) {
|
|
2294
|
+
a.cancelable && a.preventDefault(), c.simulateMouseEvent(a, e);
|
|
2295
2295
|
}
|
|
2296
|
-
function Be(
|
|
2297
|
-
he.touchHandled || (he.touchHandled = !0, Fe(
|
|
2296
|
+
function Be(a) {
|
|
2297
|
+
he.touchHandled || (he.touchHandled = !0, Fe(a, "mousedown"));
|
|
2298
2298
|
}
|
|
2299
|
-
function Ue(
|
|
2300
|
-
he.touchHandled && Fe(
|
|
2299
|
+
function Ue(a) {
|
|
2300
|
+
he.touchHandled && Fe(a, "mousemove");
|
|
2301
2301
|
}
|
|
2302
|
-
function We(
|
|
2302
|
+
function We(a) {
|
|
2303
2303
|
if (!he.touchHandled)
|
|
2304
2304
|
return;
|
|
2305
2305
|
he.pointerLeaveTimeout && (window.clearTimeout(he.pointerLeaveTimeout), delete he.pointerLeaveTimeout);
|
|
2306
|
-
const e = !!
|
|
2307
|
-
Fe(
|
|
2306
|
+
const e = !!b.dragElement;
|
|
2307
|
+
Fe(a, "mouseup"), e || Fe(a, "click"), he.touchHandled = !1;
|
|
2308
2308
|
}
|
|
2309
|
-
function Ke(
|
|
2310
|
-
|
|
2309
|
+
function Ke(a) {
|
|
2310
|
+
a.pointerType !== "mouse" && a.target.releasePointerCapture(a.pointerId);
|
|
2311
2311
|
}
|
|
2312
|
-
function Ot(
|
|
2313
|
-
|
|
2312
|
+
function Ot(a) {
|
|
2313
|
+
b.dragElement && a.pointerType !== "mouse" && ti(a, "mouseenter");
|
|
2314
2314
|
}
|
|
2315
|
-
function Ht(
|
|
2316
|
-
|
|
2317
|
-
delete he.pointerLeaveTimeout, ti(
|
|
2315
|
+
function Ht(a) {
|
|
2316
|
+
b.dragElement && a.pointerType !== "mouse" && (he.pointerLeaveTimeout = window.setTimeout(() => {
|
|
2317
|
+
delete he.pointerLeaveTimeout, ti(a, "mouseleave");
|
|
2318
2318
|
}, 10));
|
|
2319
2319
|
}
|
|
2320
2320
|
class Ze {
|
|
@@ -2438,17 +2438,17 @@ class Se extends gt {
|
|
|
2438
2438
|
}
|
|
2439
2439
|
/** @internal turns auto hide on/off */
|
|
2440
2440
|
_setupAutoHide(e) {
|
|
2441
|
-
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut),
|
|
2441
|
+
return e ? (this.el.classList.add("ui-resizable-autohide"), this.el.addEventListener("mouseover", this._mouseOver), this.el.addEventListener("mouseout", this._mouseOut)) : (this.el.classList.remove("ui-resizable-autohide"), this.el.removeEventListener("mouseover", this._mouseOver), this.el.removeEventListener("mouseout", this._mouseOut), b.overResizeElement === this && delete b.overResizeElement), this;
|
|
2442
2442
|
}
|
|
2443
2443
|
/** @internal */
|
|
2444
2444
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2445
2445
|
_mouseOver(e) {
|
|
2446
|
-
|
|
2446
|
+
b.overResizeElement || b.dragElement || (b.overResizeElement = this, this.el.classList.remove("ui-resizable-autohide"));
|
|
2447
2447
|
}
|
|
2448
2448
|
/** @internal */
|
|
2449
2449
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2450
2450
|
_mouseOut(e) {
|
|
2451
|
-
|
|
2451
|
+
b.overResizeElement === this && (delete b.overResizeElement, this.el.classList.add("ui-resizable-autohide"));
|
|
2452
2452
|
}
|
|
2453
2453
|
/** @internal */
|
|
2454
2454
|
_setupHandlers() {
|
|
@@ -2504,15 +2504,15 @@ class Se extends gt {
|
|
|
2504
2504
|
left: this.originalRect.left,
|
|
2505
2505
|
top: this.originalRect.top - this.scrolled
|
|
2506
2506
|
}, r = e.clientX - i.clientX, o = this.sizeToContent ? 0 : e.clientY - i.clientY;
|
|
2507
|
-
let n,
|
|
2508
|
-
t.indexOf("e") > -1 ? s.width += r : t.indexOf("w") > -1 && (s.width -= r, s.left += r, n = !0), t.indexOf("s") > -1 ? s.height += o : t.indexOf("n") > -1 && (s.height -= o, s.top += o,
|
|
2509
|
-
const
|
|
2510
|
-
return Math.round(s.width) !== Math.round(
|
|
2507
|
+
let n, d;
|
|
2508
|
+
t.indexOf("e") > -1 ? s.width += r : t.indexOf("w") > -1 && (s.width -= r, s.left += r, n = !0), t.indexOf("s") > -1 ? s.height += o : t.indexOf("n") > -1 && (s.height -= o, s.top += o, d = !0);
|
|
2509
|
+
const h = this._constrainSize(s.width, s.height, n, d);
|
|
2510
|
+
return Math.round(s.width) !== Math.round(h.width) && (t.indexOf("w") > -1 && (s.left += s.width - h.width), s.width = h.width), Math.round(s.height) !== Math.round(h.height) && (t.indexOf("n") > -1 && (s.top += s.height - h.height), s.height = h.height), s;
|
|
2511
2511
|
}
|
|
2512
2512
|
/** @internal constrain the size to the set min/max values */
|
|
2513
2513
|
_constrainSize(e, t, i, s) {
|
|
2514
|
-
const r = this.option, o = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, n = r.minWidth / this.rectScale.x || e,
|
|
2515
|
-
return { width:
|
|
2514
|
+
const r = this.option, o = (i ? r.maxWidthMoveLeft : r.maxWidth) || Number.MAX_SAFE_INTEGER, n = r.minWidth / this.rectScale.x || e, d = (s ? r.maxHeightMoveUp : r.maxHeight) || Number.MAX_SAFE_INTEGER, h = r.minHeight / this.rectScale.y || t, u = Math.min(o, Math.max(n, e)), l = Math.min(d, Math.max(h, t));
|
|
2515
|
+
return { width: u, height: l };
|
|
2516
2516
|
}
|
|
2517
2517
|
/** @internal */
|
|
2518
2518
|
_applyChange() {
|
|
@@ -2569,8 +2569,8 @@ class Ne extends gt {
|
|
|
2569
2569
|
}
|
|
2570
2570
|
/** @internal call when mouse goes down before a dragstart happens */
|
|
2571
2571
|
_mouseDown(e) {
|
|
2572
|
-
if (!
|
|
2573
|
-
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Ns) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete
|
|
2572
|
+
if (!b.mouseHandled)
|
|
2573
|
+
return e.button !== 0 || !this.dragEls.find((t) => t === e.target) && e.target.closest(Ns) || this.option.cancel && e.target.closest(this.option.cancel) || (this.mouseDownEvent = e, delete this.dragging, delete b.dragElement, delete b.dropElement, document.addEventListener("mousemove", this._mouseMove, { capture: !0, passive: !0 }), document.addEventListener("mouseup", this._mouseUp, !0), ae && (e.currentTarget.addEventListener("touchmove", Ue), e.currentTarget.addEventListener("touchend", We)), e.preventDefault(), document.activeElement && document.activeElement.blur(), b.mouseHandled = !0), !0;
|
|
2574
2574
|
}
|
|
2575
2575
|
/** @internal method to call actual drag event */
|
|
2576
2576
|
_callDrag(e) {
|
|
@@ -2584,15 +2584,15 @@ class Ne extends gt {
|
|
|
2584
2584
|
var i;
|
|
2585
2585
|
const t = this.mouseDownEvent;
|
|
2586
2586
|
if (this.lastDrag = e, this.dragging)
|
|
2587
|
-
if (this._dragFollow(e),
|
|
2588
|
-
const s = Number.isInteger(
|
|
2587
|
+
if (this._dragFollow(e), b.pauseDrag) {
|
|
2588
|
+
const s = Number.isInteger(b.pauseDrag) ? b.pauseDrag : 100;
|
|
2589
2589
|
this.dragTimeout && window.clearTimeout(this.dragTimeout), this.dragTimeout = window.setTimeout(() => this._callDrag(e), s);
|
|
2590
2590
|
} else
|
|
2591
2591
|
this._callDrag(e);
|
|
2592
2592
|
else if (Math.abs(e.x - t.x) + Math.abs(e.y - t.y) > 3) {
|
|
2593
|
-
this.dragging = !0,
|
|
2593
|
+
this.dragging = !0, b.dragElement = this;
|
|
2594
2594
|
const s = (i = this.el.gridstackNode) == null ? void 0 : i.grid;
|
|
2595
|
-
s ?
|
|
2595
|
+
s ? b.dropElement = s.el.ddElement.ddDroppable : delete b.dropElement, this.helper = this._createHelper(), this._setupHelperContainmentStyle(), this.dragTransform = c.getValuesFromTransformedElement(this.helperContainment), this.dragOffset = this._getDragOffset(e, this.el, this.helperContainment), this._setupHelperStyle(e);
|
|
2596
2596
|
const r = c.initEvent(e, { target: this.el, type: "dragstart" });
|
|
2597
2597
|
this.option.start && this.option.start(r, this.ui()), this.triggerEvent("dragstart", r), document.addEventListener("keydown", this._keyEvent);
|
|
2598
2598
|
}
|
|
@@ -2602,16 +2602,16 @@ class Ne extends gt {
|
|
|
2602
2602
|
_mouseUp(e) {
|
|
2603
2603
|
var t, i;
|
|
2604
2604
|
if (document.removeEventListener("mousemove", this._mouseMove, !0), document.removeEventListener("mouseup", this._mouseUp, !0), ae && e.currentTarget && (e.currentTarget.removeEventListener("touchmove", Ue, !0), e.currentTarget.removeEventListener("touchend", We, !0)), this.dragging) {
|
|
2605
|
-
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i =
|
|
2605
|
+
delete this.dragging, (t = this.el.gridstackNode) == null || delete t._origRotate, document.removeEventListener("keydown", this._keyEvent), ((i = b.dropElement) == null ? void 0 : i.el) === this.el.parentElement && delete b.dropElement, this.helperContainment.style.position = this.parentOriginStylePosition || null, this.helper !== this.el && this.helper.remove(), this._removeHelperStyle();
|
|
2606
2606
|
const s = c.initEvent(e, { target: this.el, type: "dragstop" });
|
|
2607
|
-
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s),
|
|
2607
|
+
this.option.stop && this.option.stop(s), this.triggerEvent("dragstop", s), b.dropElement && b.dropElement.drop(e);
|
|
2608
2608
|
}
|
|
2609
|
-
delete this.helper, delete this.mouseDownEvent, delete
|
|
2609
|
+
delete this.helper, delete this.mouseDownEvent, delete b.dragElement, delete b.dropElement, delete b.mouseHandled, e.preventDefault();
|
|
2610
2610
|
}
|
|
2611
2611
|
/** @internal call when keys are being pressed - use Esc to cancel, R to rotate */
|
|
2612
2612
|
_keyEvent(e) {
|
|
2613
2613
|
var s, r;
|
|
2614
|
-
const t = this.el.gridstackNode, i = (t == null ? void 0 : t.grid) || ((r = (s =
|
|
2614
|
+
const t = this.el.gridstackNode, i = (t == null ? void 0 : t.grid) || ((r = (s = b.dropElement) == null ? void 0 : s.el) == null ? void 0 : r.gridstack);
|
|
2615
2615
|
if (e.key === "Escape")
|
|
2616
2616
|
t && t._origRotate && (t._orig = t._origRotate, delete t._origRotate), i == null || i.cancelDrag(), this._mouseUp(this.mouseDownEvent);
|
|
2617
2617
|
else if (t && i && (e.key === "r" || e.key === "R")) {
|
|
@@ -2707,20 +2707,20 @@ class Ls extends gt {
|
|
|
2707
2707
|
}
|
|
2708
2708
|
/** @internal called when the cursor enters our area - prepare for a possible drop and track leaving */
|
|
2709
2709
|
_mouseEnter(e) {
|
|
2710
|
-
if (!
|
|
2710
|
+
if (!b.dragElement || !this._canDrop(b.dragElement.el))
|
|
2711
2711
|
return;
|
|
2712
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2712
|
+
e.preventDefault(), e.stopPropagation(), b.dropElement && b.dropElement !== this && b.dropElement._mouseLeave(e, !0), b.dropElement = this;
|
|
2713
2713
|
const t = c.initEvent(e, { target: this.el, type: "dropover" });
|
|
2714
|
-
this.option.over && this.option.over(t, this._ui(
|
|
2714
|
+
this.option.over && this.option.over(t, this._ui(b.dragElement)), this.triggerEvent("dropover", t), this.el.classList.add("ui-droppable-over");
|
|
2715
2715
|
}
|
|
2716
2716
|
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
|
|
2717
2717
|
_mouseLeave(e, t = !1) {
|
|
2718
2718
|
var s;
|
|
2719
|
-
if (!
|
|
2719
|
+
if (!b.dragElement || b.dropElement !== this)
|
|
2720
2720
|
return;
|
|
2721
2721
|
e.preventDefault(), e.stopPropagation();
|
|
2722
2722
|
const i = c.initEvent(e, { target: this.el, type: "dropout" });
|
|
2723
|
-
if (this.option.out && this.option.out(i, this._ui(
|
|
2723
|
+
if (this.option.out && this.option.out(i, this._ui(b.dragElement)), this.triggerEvent("dropout", i), b.dropElement === this && (delete b.dropElement, !t)) {
|
|
2724
2724
|
let r, o = this.el.parentElement;
|
|
2725
2725
|
for (; !r && o; )
|
|
2726
2726
|
r = (s = o.ddElement) == null ? void 0 : s.ddDroppable, o = o.parentElement;
|
|
@@ -2731,7 +2731,7 @@ class Ls extends gt {
|
|
|
2731
2731
|
drop(e) {
|
|
2732
2732
|
e.preventDefault();
|
|
2733
2733
|
const t = c.initEvent(e, { target: this.el, type: "drop" });
|
|
2734
|
-
this.option.drop && this.option.drop(t, this._ui(
|
|
2734
|
+
this.option.drop && this.option.drop(t, this._ui(b.dragElement)), this.triggerEvent("drop", t);
|
|
2735
2735
|
}
|
|
2736
2736
|
/** @internal true if element matches the string/method accept option */
|
|
2737
2737
|
_canDrop(e) {
|
|
@@ -2749,9 +2749,9 @@ class Ls extends gt {
|
|
|
2749
2749
|
};
|
|
2750
2750
|
}
|
|
2751
2751
|
}
|
|
2752
|
-
class
|
|
2752
|
+
class mt {
|
|
2753
2753
|
static init(e) {
|
|
2754
|
-
return e.ddElement || (e.ddElement = new
|
|
2754
|
+
return e.ddElement || (e.ddElement = new mt(e)), e.ddElement;
|
|
2755
2755
|
}
|
|
2756
2756
|
constructor(e) {
|
|
2757
2757
|
this.el = e;
|
|
@@ -2792,13 +2792,13 @@ class As {
|
|
|
2792
2792
|
r.setupResizable({ [i]: s });
|
|
2793
2793
|
else {
|
|
2794
2794
|
const n = r.el.gridstackNode.grid;
|
|
2795
|
-
let
|
|
2796
|
-
|
|
2797
|
-
const
|
|
2795
|
+
let d = r.el.getAttribute("gs-resize-handles") || n.opts.resizable.handles || "e,s,se";
|
|
2796
|
+
d === "all" && (d = "n,e,s,w,se,sw,ne,nw");
|
|
2797
|
+
const h = !n.opts.alwaysShowResizeHandle;
|
|
2798
2798
|
r.setupResizable({
|
|
2799
2799
|
...n.opts.resizable,
|
|
2800
|
-
handles:
|
|
2801
|
-
autoHide:
|
|
2800
|
+
handles: d,
|
|
2801
|
+
autoHide: h,
|
|
2802
2802
|
start: t.start,
|
|
2803
2803
|
stop: t.stop,
|
|
2804
2804
|
resize: t.resize
|
|
@@ -2851,7 +2851,7 @@ class As {
|
|
|
2851
2851
|
}
|
|
2852
2852
|
on(e, t, i) {
|
|
2853
2853
|
return this._getDDElements(e).forEach((s) => s.on(t, (r) => {
|
|
2854
|
-
i(r,
|
|
2854
|
+
i(r, b.dragElement ? b.dragElement.el : r.target, b.dragElement ? b.dragElement.helper : null);
|
|
2855
2855
|
})), this;
|
|
2856
2856
|
}
|
|
2857
2857
|
off(e, t) {
|
|
@@ -2860,7 +2860,7 @@ class As {
|
|
|
2860
2860
|
/** @internal returns a list of DD elements, creating them on the fly by default unless option is to destroy or disable */
|
|
2861
2861
|
_getDDElements(e, t) {
|
|
2862
2862
|
const i = e.gridstack || t !== "destroy" && t !== "disable", s = c.getElements(e);
|
|
2863
|
-
return s.length ? s.map((o) => o.ddElement || (i ?
|
|
2863
|
+
return s.length ? s.map((o) => o.ddElement || (i ? mt.init(o) : null)).filter((o) => o) : [];
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
/*!
|
|
@@ -2871,7 +2871,7 @@ class As {
|
|
|
2871
2871
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
2872
2872
|
*/
|
|
2873
2873
|
const U = new As();
|
|
2874
|
-
class
|
|
2874
|
+
class _ {
|
|
2875
2875
|
/**
|
|
2876
2876
|
* initializing the HTML element, or selector string, into a grid will return the grid. Calling it again will
|
|
2877
2877
|
* simply return the existing instance (ignore any passed options). There is also an initAll() version that support
|
|
@@ -2888,8 +2888,8 @@ class b {
|
|
|
2888
2888
|
static init(e = {}, t = ".grid-stack") {
|
|
2889
2889
|
if (typeof document > "u")
|
|
2890
2890
|
return null;
|
|
2891
|
-
const i =
|
|
2892
|
-
return i ? (i.gridstack || (i.gridstack = new
|
|
2891
|
+
const i = _.getGridElement(t);
|
|
2892
|
+
return i ? (i.gridstack || (i.gridstack = new _(i, c.cloneDeep(e))), i.gridstack) : (console.error(typeof t == "string" ? 'GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
2893
2893
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.` : "GridStack.init() no grid element was passed."), null);
|
|
2894
2894
|
}
|
|
2895
2895
|
/**
|
|
@@ -2903,8 +2903,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2903
2903
|
*/
|
|
2904
2904
|
static initAll(e = {}, t = ".grid-stack") {
|
|
2905
2905
|
const i = [];
|
|
2906
|
-
return typeof document > "u" || (
|
|
2907
|
-
s.gridstack || (s.gridstack = new
|
|
2906
|
+
return typeof document > "u" || (_.getGridElements(t).forEach((s) => {
|
|
2907
|
+
s.gridstack || (s.gridstack = new _(s, c.cloneDeep(e))), i.push(s.gridstack);
|
|
2908
2908
|
}), i.length === 0 && console.error('GridStack.initAll() no grid was found with selector "' + t + `" - element missing or wrong selector ?
|
|
2909
2909
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)), i;
|
|
2910
2910
|
}
|
|
@@ -2923,14 +2923,14 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2923
2923
|
const o = i.gridstack;
|
|
2924
2924
|
return t && (o.opts = { ...o.opts, ...t }), t.children !== void 0 && o.load(t.children), o;
|
|
2925
2925
|
}
|
|
2926
|
-
return (!e.classList.contains("grid-stack") ||
|
|
2926
|
+
return (!e.classList.contains("grid-stack") || _.addRemoveCB) && (_.addRemoveCB ? i = _.addRemoveCB(e, t, !0, !0) : i = c.createDiv(["grid-stack", t.class], e)), _.init(t, i);
|
|
2927
2927
|
}
|
|
2928
2928
|
/** call this method to register your engine instead of the default one.
|
|
2929
2929
|
* See instead `GridStackOptions.engineClass` if you only need to
|
|
2930
2930
|
* replace just one instance.
|
|
2931
2931
|
*/
|
|
2932
2932
|
static registerEngine(e) {
|
|
2933
|
-
|
|
2933
|
+
_.engineClass = e;
|
|
2934
2934
|
}
|
|
2935
2935
|
/** @internal create placeholder DIV as needed */
|
|
2936
2936
|
get placeholder() {
|
|
@@ -2947,7 +2947,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2947
2947
|
* @param opts grid options - public for classes to access, but use methods to modify!
|
|
2948
2948
|
*/
|
|
2949
2949
|
constructor(e, t = {}) {
|
|
2950
|
-
var l, f,
|
|
2950
|
+
var l, f, m;
|
|
2951
2951
|
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);
|
|
2952
2952
|
const i = c.toNumber(e.getAttribute("gs-row"));
|
|
2953
2953
|
t.column === "auto" && delete t.column, t.alwaysShowResizeHandle !== void 0 && (t._alwaysShowResizeHandle = t.alwaysShowResizeHandle);
|
|
@@ -2956,7 +2956,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2956
2956
|
if (r.oneColumnModeDomSort && (delete r.oneColumnModeDomSort, console.log("warning: Gridstack oneColumnModeDomSort no longer supported. Use GridStackOptions.columnOpts instead.")), r.oneColumnSize || r.disableOneColumnMode === !1) {
|
|
2957
2957
|
const g = r.oneColumnSize || 768;
|
|
2958
2958
|
delete r.oneColumnSize, delete r.disableOneColumnMode, t.columnOpts = t.columnOpts || {}, s = t.columnOpts.breakpoints = t.columnOpts.breakpoints || [];
|
|
2959
|
-
let y = s.find((
|
|
2959
|
+
let y = s.find((p) => p.c === 1);
|
|
2960
2960
|
y ? y.w = g : (y = { c: 1, w: g }, s.push(y, { c: 12, w: g + 1 }));
|
|
2961
2961
|
}
|
|
2962
2962
|
const o = t.columnOpts;
|
|
@@ -2977,27 +2977,27 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
2977
2977
|
}
|
|
2978
2978
|
};
|
|
2979
2979
|
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");
|
|
2980
|
-
const
|
|
2981
|
-
|
|
2982
|
-
const
|
|
2983
|
-
if (this.engine = new
|
|
2980
|
+
const d = this.el.closest("." + X.itemClass), h = d == null ? void 0 : d.gridstackNode;
|
|
2981
|
+
h && (h.subGrid = this, this.parentGridNode = h, this.el.classList.add("grid-stack-nested"), h.el.classList.add("grid-stack-sub-grid")), this._isAutoCellHeight = t.cellHeight === "auto", this._isAutoCellHeight || t.cellHeight === "initial" ? this.cellHeight(void 0, !1) : (typeof t.cellHeight == "number" && t.cellHeightUnit && t.cellHeightUnit !== X.cellHeightUnit && (t.cellHeight = t.cellHeight + t.cellHeightUnit, delete t.cellHeightUnit), this.cellHeight(t.cellHeight, !1)), t.alwaysShowResizeHandle === "mobile" && (t.alwaysShowResizeHandle = ae), this._styleSheetClass = "gs-id-" + le._idSeq++, this.el.classList.add(this._styleSheetClass), this._setStaticClass();
|
|
2982
|
+
const u = t.engineClass || _.engineClass || le;
|
|
2983
|
+
if (this.engine = new u({
|
|
2984
2984
|
column: this.getColumn(),
|
|
2985
2985
|
float: t.float,
|
|
2986
2986
|
maxRow: t.maxRow,
|
|
2987
2987
|
onChange: (g) => {
|
|
2988
2988
|
let y = 0;
|
|
2989
|
-
this.engine.nodes.forEach((
|
|
2990
|
-
y = Math.max(y,
|
|
2991
|
-
}), g.forEach((
|
|
2992
|
-
const D =
|
|
2993
|
-
D && (
|
|
2989
|
+
this.engine.nodes.forEach((p) => {
|
|
2990
|
+
y = Math.max(y, p.y + p.h);
|
|
2991
|
+
}), g.forEach((p) => {
|
|
2992
|
+
const D = p.el;
|
|
2993
|
+
D && (p._removeDOM ? (D && D.remove(), delete p._removeDOM) : this._writePosAttr(D, p));
|
|
2994
2994
|
}), this._updateStyles(!1, y);
|
|
2995
2995
|
}
|
|
2996
2996
|
}), this._updateStyles(!1, 0), t.auto && (this.batchUpdate(), this.engine._loading = !0, this.getGridItems().forEach((g) => this._prepareElement(g)), delete this.engine._loading, this.batchUpdate(!1)), t.children) {
|
|
2997
2997
|
const g = t.children;
|
|
2998
2998
|
delete t.children, g.length && this.load(g);
|
|
2999
2999
|
}
|
|
3000
|
-
this.setAnimation(), t.subGridDynamic && !
|
|
3000
|
+
this.setAnimation(), t.subGridDynamic && !b.pauseDrag && (b.pauseDrag = !0), ((m = t.draggable) == null ? void 0 : m.pause) !== void 0 && (b.pauseDrag = t.draggable.pause), this._setupRemoveDrop(), this._setupAcceptWidget(), this._updateResizeEvent();
|
|
3001
3001
|
}
|
|
3002
3002
|
/**
|
|
3003
3003
|
* add a new widget and returns it.
|
|
@@ -3020,7 +3020,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3020
3020
|
if (e.ELEMENT_NODE)
|
|
3021
3021
|
return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"), this.makeWidget(e);
|
|
3022
3022
|
let t, i = e;
|
|
3023
|
-
if (i.grid = this, i != null && i.el ? t = i.el :
|
|
3023
|
+
if (i.grid = this, i != null && i.el ? t = i.el : _.addRemoveCB ? t = _.addRemoveCB(this.el, e, !0, !1) : t = this.createWidgetDivs(i), !t)
|
|
3024
3024
|
return;
|
|
3025
3025
|
if (i = t.gridstackNode, i && t.parentElement === this.el && this.engine.nodes.find((r) => r._id === i._id))
|
|
3026
3026
|
return t;
|
|
@@ -3032,11 +3032,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3032
3032
|
const t = c.createDiv(["grid-stack-item", this.opts.itemClass]), i = c.createDiv(["grid-stack-item-content"], t);
|
|
3033
3033
|
return c.lazyLoad(e) ? e.visibleObservable || (e.visibleObservable = new IntersectionObserver(([s]) => {
|
|
3034
3034
|
var r, o;
|
|
3035
|
-
s.isIntersecting && ((r = e.visibleObservable) == null || r.disconnect(), delete e.visibleObservable,
|
|
3035
|
+
s.isIntersecting && ((r = e.visibleObservable) == null || r.disconnect(), delete e.visibleObservable, _.renderCB(i, e), (o = e.grid) == null || o.prepareDragDrop(e.el));
|
|
3036
3036
|
}), window.setTimeout(() => {
|
|
3037
3037
|
var s;
|
|
3038
3038
|
return (s = e.visibleObservable) == null ? void 0 : s.observe(t);
|
|
3039
|
-
})) :
|
|
3039
|
+
})) : _.renderCB(i, e), t;
|
|
3040
3040
|
}
|
|
3041
3041
|
/**
|
|
3042
3042
|
* Convert an existing gridItem element into a sub-grid with the given (optional) options, else inherit them
|
|
@@ -3048,9 +3048,9 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3048
3048
|
* @returns newly created grid
|
|
3049
3049
|
*/
|
|
3050
3050
|
makeSubGrid(e, t, i, s = !0) {
|
|
3051
|
-
var
|
|
3051
|
+
var m, g, y;
|
|
3052
3052
|
let r = e.gridstackNode;
|
|
3053
|
-
if (r || (r = this.makeWidget(e).gridstackNode), (
|
|
3053
|
+
if (r || (r = this.makeWidget(e).gridstackNode), (m = r.subGrid) != null && m.el)
|
|
3054
3054
|
return r.subGrid;
|
|
3055
3055
|
let o, n = this;
|
|
3056
3056
|
for (; n && !o; )
|
|
@@ -3067,15 +3067,15 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3067
3067
|
...o || {},
|
|
3068
3068
|
...t || r.subGridOpts || {}
|
|
3069
3069
|
}), r.subGridOpts = t;
|
|
3070
|
-
let
|
|
3071
|
-
t.column === "auto" && (
|
|
3072
|
-
let
|
|
3073
|
-
if (s && (this._removeDD(r.el), l = { ...r, x: 0, y: 0 }, c.removeInternalForSave(l), delete l.subGridOpts, r.content && (l.content = r.content, delete r.content),
|
|
3074
|
-
const
|
|
3075
|
-
P.transition = "none", this.update(r.el, { w:
|
|
3070
|
+
let d;
|
|
3071
|
+
t.column === "auto" && (d = !0, t.column = Math.max(r.w || 1, (i == null ? void 0 : i.w) || 1), delete t.columnOpts);
|
|
3072
|
+
let h = r.el.querySelector(".grid-stack-item-content"), u, l;
|
|
3073
|
+
if (s && (this._removeDD(r.el), l = { ...r, x: 0, y: 0 }, c.removeInternalForSave(l), delete l.subGridOpts, r.content && (l.content = r.content, delete r.content), _.addRemoveCB ? u = _.addRemoveCB(this.el, l, !0, !1) : (u = c.createDiv(["grid-stack-item"]), u.appendChild(h), h = c.createDiv(["grid-stack-item-content"], r.el)), this.prepareDragDrop(r.el)), i) {
|
|
3074
|
+
const p = d ? t.column : r.w, D = r.h + i.h, P = r.el.style;
|
|
3075
|
+
P.transition = "none", this.update(r.el, { w: p, h: D }), setTimeout(() => P.transition = null);
|
|
3076
3076
|
}
|
|
3077
|
-
const f = r.subGrid =
|
|
3078
|
-
return i != null && i._moving && (f._isTemp = !0),
|
|
3077
|
+
const f = r.subGrid = _.addGrid(h, t);
|
|
3078
|
+
return i != null && i._moving && (f._isTemp = !0), d && (f._autoColumn = !0), s && f.makeWidget(u, l), i && (i._moving ? window.setTimeout(() => c.simulateMouseEvent(i._event, "mouseenter", f.el), 0) : f.makeWidget(r.el, r)), this.resizeToContentCheck(!1, r), f;
|
|
3079
3079
|
}
|
|
3080
3080
|
/**
|
|
3081
3081
|
* called when an item was converted into a nested grid to accommodate a dragged over item, but then item leaves - return back
|
|
@@ -3097,7 +3097,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3097
3097
|
* @param saveCB callback for each node -> widget, so application can insert additional data to be saved into the widget data structure.
|
|
3098
3098
|
* @returns list of widgets or full grid option, including .children list of widgets
|
|
3099
3099
|
*/
|
|
3100
|
-
save(e = !0, t = !1, i =
|
|
3100
|
+
save(e = !0, t = !1, i = _.saveCB) {
|
|
3101
3101
|
const s = this.engine.save(e, i);
|
|
3102
3102
|
if (s.forEach((r) => {
|
|
3103
3103
|
var o;
|
|
@@ -3127,38 +3127,38 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3127
3127
|
* @example
|
|
3128
3128
|
* see http://gridstackjs.com/demo/serialization.html
|
|
3129
3129
|
*/
|
|
3130
|
-
load(e, t =
|
|
3131
|
-
var
|
|
3130
|
+
load(e, t = _.addRemoveCB || !0) {
|
|
3131
|
+
var h;
|
|
3132
3132
|
e = c.cloneDeep(e);
|
|
3133
3133
|
const i = this.getColumn();
|
|
3134
|
-
e.forEach((
|
|
3135
|
-
|
|
3134
|
+
e.forEach((u) => {
|
|
3135
|
+
u.w = u.w || 1, u.h = u.h || 1;
|
|
3136
3136
|
}), e = c.sort(e), this.engine.skipCacheUpdate = this._ignoreLayoutsNodeChange = !0;
|
|
3137
3137
|
let s = 0;
|
|
3138
|
-
e.forEach((
|
|
3139
|
-
s = Math.max(s, (
|
|
3138
|
+
e.forEach((u) => {
|
|
3139
|
+
s = Math.max(s, (u.x || 0) + u.w);
|
|
3140
3140
|
}), s > this.engine.defaultColumn && (this.engine.defaultColumn = s), s > i && this.engine.cacheLayout(e, s, !0);
|
|
3141
|
-
const r =
|
|
3142
|
-
typeof t == "function" && (
|
|
3141
|
+
const r = _.addRemoveCB;
|
|
3142
|
+
typeof t == "function" && (_.addRemoveCB = t);
|
|
3143
3143
|
const o = [];
|
|
3144
3144
|
this.batchUpdate();
|
|
3145
3145
|
const n = !this.engine.nodes.length;
|
|
3146
3146
|
n && this.setAnimation(!1), !n && t && [...this.engine.nodes].forEach((l) => {
|
|
3147
3147
|
if (!l.id)
|
|
3148
3148
|
return;
|
|
3149
|
-
c.find(e, l.id) || (
|
|
3149
|
+
c.find(e, l.id) || (_.addRemoveCB && _.addRemoveCB(this.el, l, !1, !1), o.push(l), this.removeWidget(l.el, !0, !1));
|
|
3150
3150
|
}), this.engine._loading = !0;
|
|
3151
|
-
const
|
|
3152
|
-
return this.engine.nodes = this.engine.nodes.filter((
|
|
3151
|
+
const d = [];
|
|
3152
|
+
return this.engine.nodes = this.engine.nodes.filter((u) => c.find(e, u.id) ? (d.push(u), !1) : !0), e.forEach((u) => {
|
|
3153
3153
|
var f;
|
|
3154
|
-
const l = c.find(
|
|
3154
|
+
const l = c.find(d, u.id);
|
|
3155
3155
|
if (l) {
|
|
3156
|
-
if (c.shouldSizeToContent(l) && (
|
|
3157
|
-
const
|
|
3158
|
-
|
|
3156
|
+
if (c.shouldSizeToContent(l) && (u.h = l.h), this.engine.nodeBoundFix(u), (u.autoPosition || u.x === void 0 || u.y === void 0) && (u.w = u.w || l.w, u.h = u.h || l.h, this.engine.findEmptyPosition(u)), this.engine.nodes.push(l), c.samePos(l, u) && this.engine.nodes.length > 1 && (this.moveNode(l, { ...u, forceCollide: !0 }), c.copyPos(u, l)), this.update(l.el, u), (f = u.subGridOpts) != null && f.children) {
|
|
3157
|
+
const m = l.el.querySelector(".grid-stack");
|
|
3158
|
+
m && m.gridstack && m.gridstack.load(u.subGridOpts.children);
|
|
3159
3159
|
}
|
|
3160
|
-
} else t && this.addWidget(
|
|
3161
|
-
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ?
|
|
3160
|
+
} else t && this.addWidget(u);
|
|
3161
|
+
}), delete this.engine._loading, this.engine.removedNodes = o, this.batchUpdate(!1), delete this._ignoreLayoutsNodeChange, delete this.engine.skipCacheUpdate, r ? _.addRemoveCB = r : delete _.addRemoveCB, n && ((h = this.opts) != null && h.animate) && this.setAnimation(this.opts.animate, !0), this;
|
|
3162
3162
|
}
|
|
3163
3163
|
/**
|
|
3164
3164
|
* use before calling a bunch of `addWidget()` to prevent un-necessary relayouts in between (more efficient)
|
|
@@ -3238,7 +3238,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3238
3238
|
i = e.breakpoints[n++].c || t;
|
|
3239
3239
|
}
|
|
3240
3240
|
if (i !== t) {
|
|
3241
|
-
const n = (o = e.breakpoints) == null ? void 0 : o.find((
|
|
3241
|
+
const n = (o = e.breakpoints) == null ? void 0 : o.find((d) => d.c === i);
|
|
3242
3242
|
return this.column(i, (n == null ? void 0 : n.layout) || e.layout), !0;
|
|
3243
3243
|
}
|
|
3244
3244
|
return !1;
|
|
@@ -3316,8 +3316,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3316
3316
|
const i = this.el.getBoundingClientRect();
|
|
3317
3317
|
let s;
|
|
3318
3318
|
t ? s = { top: i.top + document.documentElement.scrollTop, left: i.left } : s = { top: this.el.offsetTop, left: this.el.offsetLeft };
|
|
3319
|
-
const r = e.left - s.left, o = e.top - s.top, n = i.width / this.getColumn(),
|
|
3320
|
-
return { x: Math.floor(r / n), y: Math.floor(o /
|
|
3319
|
+
const r = e.left - s.left, o = e.top - s.top, n = i.width / this.getColumn(), d = i.height / parseInt(this.el.getAttribute("gs-current-row"));
|
|
3320
|
+
return { x: Math.floor(r / n), y: Math.floor(o / d) };
|
|
3321
3321
|
}
|
|
3322
3322
|
/** returns the current number of rows, which will be at least `minRow` if set */
|
|
3323
3323
|
getRow() {
|
|
@@ -3347,7 +3347,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3347
3347
|
* grid.makeWidget('2', {w:2, content: 'hello'});
|
|
3348
3348
|
*/
|
|
3349
3349
|
makeWidget(e, t) {
|
|
3350
|
-
const i =
|
|
3350
|
+
const i = _.getElement(e);
|
|
3351
3351
|
if (!i)
|
|
3352
3352
|
return;
|
|
3353
3353
|
i.parentElement || this.el.appendChild(i), this._prepareElement(i, !0, t);
|
|
@@ -3379,11 +3379,11 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3379
3379
|
* @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
|
|
3380
3380
|
*/
|
|
3381
3381
|
removeWidget(e, t = !0, i = !0) {
|
|
3382
|
-
return e ? (
|
|
3382
|
+
return e ? (_.getElements(e).forEach((s) => {
|
|
3383
3383
|
if (s.parentElement && s.parentElement !== this.el)
|
|
3384
3384
|
return;
|
|
3385
3385
|
let r = s.gridstackNode;
|
|
3386
|
-
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t &&
|
|
3386
|
+
r || (r = this.engine.nodes.find((o) => s === o.el)), r && (t && _.addRemoveCB && _.addRemoveCB(this.el, r, !1, !1), delete s.gridstackNode, this._removeDD(s), this.engine.removeNode(r, t, i), t && s.parentElement && s.remove());
|
|
3387
3387
|
}), i && (this._triggerRemoveEvent(), this._triggerChangeEvent()), this) : (console.error("Error: GridStack.removeWidget(undefined) called"), this);
|
|
3388
3388
|
}
|
|
3389
3389
|
/**
|
|
@@ -3393,7 +3393,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3393
3393
|
*/
|
|
3394
3394
|
removeAll(e = !0, t = !0) {
|
|
3395
3395
|
return this.engine.nodes.forEach((i) => {
|
|
3396
|
-
e &&
|
|
3396
|
+
e && _.addRemoveCB && _.addRemoveCB(this.el, i, !1, !1), delete i.el.gridstackNode, this.opts.staticGrid || this._removeDD(i.el);
|
|
3397
3397
|
}), this.engine.removeAll(e, t), t && this._triggerRemoveEvent(), this;
|
|
3398
3398
|
}
|
|
3399
3399
|
/**
|
|
@@ -3438,8 +3438,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3438
3438
|
* @param opt new widget options (x,y,w,h, etc..). Only those set will be updated.
|
|
3439
3439
|
*/
|
|
3440
3440
|
update(e, t) {
|
|
3441
|
-
return
|
|
3442
|
-
var
|
|
3441
|
+
return _.getElements(e).forEach((i) => {
|
|
3442
|
+
var u;
|
|
3443
3443
|
const s = i == null ? void 0 : i.gridstackNode;
|
|
3444
3444
|
if (!s)
|
|
3445
3445
|
return;
|
|
@@ -3451,16 +3451,16 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3451
3451
|
n[l] = r[l] !== void 0 ? r[l] : s[l], delete r[l];
|
|
3452
3452
|
})), !n && (r.minW || r.minH || r.maxW || r.maxH) && (n = {}), r.content !== void 0) {
|
|
3453
3453
|
const l = i.querySelector(".grid-stack-item-content");
|
|
3454
|
-
l && l.textContent !== r.content && (s.content = r.content,
|
|
3454
|
+
l && l.textContent !== r.content && (s.content = r.content, _.renderCB(l, r), (u = s.subGrid) != null && u.el && (l.appendChild(s.subGrid.el), s.subGrid.opts.styleInHead || s.subGrid._updateStyles(!0))), delete r.content;
|
|
3455
3455
|
}
|
|
3456
|
-
let
|
|
3456
|
+
let d = !1, h = !1;
|
|
3457
3457
|
for (const l in r)
|
|
3458
|
-
l[0] !== "_" && s[l] !== r[l] && (s[l] = r[l],
|
|
3458
|
+
l[0] !== "_" && s[l] !== r[l] && (s[l] = r[l], d = !0, h = h || !this.opts.staticGrid && (l === "noResize" || l === "noMove" || l === "locked"));
|
|
3459
3459
|
if (c.sanitizeMinMax(s), n) {
|
|
3460
3460
|
const l = n.w !== void 0 && n.w !== s.w;
|
|
3461
3461
|
this.moveNode(s, n), l && s.subGrid ? s.subGrid.onResize(this.hasAnimationCSS() ? s.w : void 0) : this.resizeToContentCheck(l, s), delete s._orig;
|
|
3462
3462
|
}
|
|
3463
|
-
(n ||
|
|
3463
|
+
(n || d) && this._writeAttr(i, s), h && this.prepareDragDrop(s.el);
|
|
3464
3464
|
}), this;
|
|
3465
3465
|
}
|
|
3466
3466
|
moveNode(e, t) {
|
|
@@ -3474,7 +3474,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3474
3474
|
* @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
|
|
3475
3475
|
*/
|
|
3476
3476
|
resizeToContent(e) {
|
|
3477
|
-
var f,
|
|
3477
|
+
var f, m;
|
|
3478
3478
|
if (!e || (e.classList.remove("size-to-content-max"), !e.clientHeight))
|
|
3479
3479
|
return;
|
|
3480
3480
|
const t = e.gridstackNode;
|
|
@@ -3487,50 +3487,50 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3487
3487
|
if (!s)
|
|
3488
3488
|
return;
|
|
3489
3489
|
let r = t.h ? t.h * s : e.clientHeight, o;
|
|
3490
|
-
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(
|
|
3490
|
+
if (t.resizeToContentParent && (o = e.querySelector(t.resizeToContentParent)), o || (o = e.querySelector(_.resizeToContentParent)), !o)
|
|
3491
3491
|
return;
|
|
3492
|
-
const n = e.clientHeight - o.clientHeight,
|
|
3493
|
-
let
|
|
3492
|
+
const n = e.clientHeight - o.clientHeight, d = t.h ? t.h * s - n : o.clientHeight;
|
|
3493
|
+
let h;
|
|
3494
3494
|
if (t.subGrid) {
|
|
3495
|
-
|
|
3495
|
+
h = t.subGrid.getRow() * t.subGrid.getCellHeight(!0);
|
|
3496
3496
|
const g = t.subGrid.el.getBoundingClientRect(), y = t.subGrid.el.parentElement.getBoundingClientRect();
|
|
3497
|
-
|
|
3497
|
+
h += g.top - y.top;
|
|
3498
3498
|
} else {
|
|
3499
|
-
if ((
|
|
3499
|
+
if ((m = (f = t.subGridOpts) == null ? void 0 : f.children) != null && m.length)
|
|
3500
3500
|
return;
|
|
3501
3501
|
{
|
|
3502
3502
|
const g = o.firstElementChild;
|
|
3503
3503
|
if (!g) {
|
|
3504
|
-
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${
|
|
3504
|
+
console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${_.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);
|
|
3505
3505
|
return;
|
|
3506
3506
|
}
|
|
3507
|
-
|
|
3507
|
+
h = g.getBoundingClientRect().height || d;
|
|
3508
3508
|
}
|
|
3509
3509
|
}
|
|
3510
|
-
if (
|
|
3510
|
+
if (d === h)
|
|
3511
3511
|
return;
|
|
3512
|
-
r +=
|
|
3513
|
-
let
|
|
3512
|
+
r += h - d;
|
|
3513
|
+
let u = Math.ceil(r / s);
|
|
3514
3514
|
const l = Number.isInteger(t.sizeToContent) ? t.sizeToContent : 0;
|
|
3515
|
-
l &&
|
|
3515
|
+
l && u > l && (u = l, e.classList.add("size-to-content-max")), t.minH && u < t.minH ? u = t.minH : t.maxH && u > t.maxH && (u = t.maxH), u !== t.h && (i._ignoreLayoutsNodeChange = !0, i.moveNode(t, { h: u }), delete i._ignoreLayoutsNodeChange);
|
|
3516
3516
|
}
|
|
3517
3517
|
/** call the user resize (so they can do extra work) else our build in version */
|
|
3518
3518
|
resizeToContentCBCheck(e) {
|
|
3519
|
-
|
|
3519
|
+
_.resizeToContentCB ? _.resizeToContentCB(e) : this.resizeToContent(e);
|
|
3520
3520
|
}
|
|
3521
3521
|
/** rotate (by swapping w & h) the passed in node - called when user press 'r' during dragging
|
|
3522
3522
|
* @param els widget or selector of objects to modify
|
|
3523
3523
|
* @param relative optional pixel coord relative to upper/left corner to rotate around (will keep that cell under cursor)
|
|
3524
3524
|
*/
|
|
3525
3525
|
rotate(e, t) {
|
|
3526
|
-
return
|
|
3526
|
+
return _.getElements(e).forEach((i) => {
|
|
3527
3527
|
const s = i.gridstackNode;
|
|
3528
3528
|
if (!c.canBeRotated(s))
|
|
3529
3529
|
return;
|
|
3530
3530
|
const r = { w: s.h, h: s.w, minH: s.minW, minW: s.minH, maxH: s.maxW, maxW: s.maxH };
|
|
3531
3531
|
if (t) {
|
|
3532
|
-
const n = t.left > 0 ? Math.floor(t.left / this.cellWidth()) : 0,
|
|
3533
|
-
r.x = s.x + n - (s.h - (
|
|
3532
|
+
const n = t.left > 0 ? Math.floor(t.left / this.cellWidth()) : 0, d = t.top > 0 ? Math.floor(t.top / this.opts.cellHeight) : 0;
|
|
3533
|
+
r.x = s.x + n - (s.h - (d + 1)), r.y = s.y + d - n;
|
|
3534
3534
|
}
|
|
3535
3535
|
Object.keys(r).forEach((n) => {
|
|
3536
3536
|
r[n] === void 0 && delete r[n];
|
|
@@ -3633,8 +3633,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3633
3633
|
}), !this._styles)
|
|
3634
3634
|
return this;
|
|
3635
3635
|
this._styles._max = 0, c.addCSSRule(this._styles, r, `height: ${i}${s}`);
|
|
3636
|
-
const n = this.opts.marginTop + this.opts.marginUnit,
|
|
3637
|
-
c.addCSSRule(this._styles, l, `top: ${n}; right: ${
|
|
3636
|
+
const n = this.opts.marginTop + this.opts.marginUnit, d = this.opts.marginBottom + this.opts.marginUnit, h = this.opts.marginRight + this.opts.marginUnit, u = this.opts.marginLeft + this.opts.marginUnit, l = `${r} > .grid-stack-item-content`, f = `.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;
|
|
3637
|
+
c.addCSSRule(this._styles, l, `top: ${n}; right: ${h}; bottom: ${d}; left: ${u};`), c.addCSSRule(this._styles, f, `top: ${n}; right: ${h}; bottom: ${d}; left: ${u};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-n`, `top: ${n};`), c.addCSSRule(this._styles, `${r} > .ui-resizable-s`, `bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-ne`, `right: ${h}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-e`, `right: ${h}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-se`, `right: ${h}; bottom: ${d}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-nw`, `left: ${u}; top: ${n}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-w`, `left: ${u}`), c.addCSSRule(this._styles, `${r} > .ui-resizable-sw`, `left: ${u}; bottom: ${d}`);
|
|
3638
3638
|
}
|
|
3639
3639
|
if (t = t || this._styles._max, t > this._styles._max) {
|
|
3640
3640
|
const o = (n) => i * n + s;
|
|
@@ -3752,7 +3752,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3752
3752
|
}
|
|
3753
3753
|
/** @internal */
|
|
3754
3754
|
static getGridElement(e) {
|
|
3755
|
-
return
|
|
3755
|
+
return _.getElement(e);
|
|
3756
3756
|
}
|
|
3757
3757
|
/** @internal */
|
|
3758
3758
|
static getGridElements(e) {
|
|
@@ -3782,7 +3782,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3782
3782
|
* @param root optional root which defaults to document (for shadow dom pass the parent HTMLDocument)
|
|
3783
3783
|
*/
|
|
3784
3784
|
static setupDragIn(e, t, i, s = document) {
|
|
3785
|
-
(t == null ? void 0 : t.pause) !== void 0 && (
|
|
3785
|
+
(t == null ? void 0 : t.pause) !== void 0 && (b.pauseDrag = t.pause), t = { appendTo: "body", helper: "clone", ...t || {} }, (typeof e == "string" ? c.getElements(e, s) : e).forEach((o, n) => {
|
|
3786
3786
|
U.isDraggable(o) || U.dragIn(o, t), i != null && i[n] && (o.gridstackNode = i[n]);
|
|
3787
3787
|
});
|
|
3788
3788
|
}
|
|
@@ -3793,7 +3793,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3793
3793
|
* @param val if true widget will be draggable, assuming the parent grid isn't noMove or static.
|
|
3794
3794
|
*/
|
|
3795
3795
|
movable(e, t) {
|
|
3796
|
-
return this.opts.staticGrid ? this : (
|
|
3796
|
+
return this.opts.staticGrid ? this : (_.getElements(e).forEach((i) => {
|
|
3797
3797
|
const s = i.gridstackNode;
|
|
3798
3798
|
s && (t ? delete s.noMove : s.noMove = !0, this.prepareDragDrop(s.el));
|
|
3799
3799
|
}), this);
|
|
@@ -3804,7 +3804,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3804
3804
|
* @param val if true widget will be resizable, assuming the parent grid isn't noResize or static.
|
|
3805
3805
|
*/
|
|
3806
3806
|
resizable(e, t) {
|
|
3807
|
-
return this.opts.staticGrid ? this : (
|
|
3807
|
+
return this.opts.staticGrid ? this : (_.getElements(e).forEach((i) => {
|
|
3808
3808
|
const s = i.gridstackNode;
|
|
3809
3809
|
s && (t ? delete s.noResize : s.noResize = !0, this.prepareDragDrop(s.el));
|
|
3810
3810
|
}), this);
|
|
@@ -3858,7 +3858,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3858
3858
|
cancelDrag() {
|
|
3859
3859
|
var t;
|
|
3860
3860
|
const e = (t = this._placeholder) == null ? void 0 : t.gridstackNode;
|
|
3861
|
-
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove &&
|
|
3861
|
+
e && (e._isExternal ? (e._isAboutToRemove = !0, this.engine.removeNode(e)) : e._isAboutToRemove && _._itemRemoving(e.el, !1), this.engine.restoreInitial());
|
|
3862
3862
|
}
|
|
3863
3863
|
/** @internal removes any drag&drop present (called during destroy) */
|
|
3864
3864
|
_removeDD(e) {
|
|
@@ -3877,20 +3877,20 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3877
3877
|
return;
|
|
3878
3878
|
if (!((f = n.grid) != null && f.el)) {
|
|
3879
3879
|
o.style.transform = `scale(${1 / this.dragTransform.xScale},${1 / this.dragTransform.yScale})`;
|
|
3880
|
-
const
|
|
3881
|
-
o.style.left =
|
|
3880
|
+
const m = o.getBoundingClientRect();
|
|
3881
|
+
o.style.left = m.x + (this.dragTransform.xScale - 1) * (s.clientX - m.x) / this.dragTransform.xScale + "px", o.style.top = m.y + (this.dragTransform.yScale - 1) * (s.clientY - m.y) / this.dragTransform.yScale + "px", o.style.transformOrigin = "0px 0px";
|
|
3882
3882
|
}
|
|
3883
|
-
let { top:
|
|
3884
|
-
const
|
|
3885
|
-
|
|
3883
|
+
let { top: d, left: h } = o.getBoundingClientRect();
|
|
3884
|
+
const u = this.el.getBoundingClientRect();
|
|
3885
|
+
h -= u.left, d -= u.top;
|
|
3886
3886
|
const l = {
|
|
3887
3887
|
position: {
|
|
3888
|
-
top:
|
|
3889
|
-
left:
|
|
3888
|
+
top: d * this.dragTransform.xScale,
|
|
3889
|
+
left: h * this.dragTransform.yScale
|
|
3890
3890
|
}
|
|
3891
3891
|
};
|
|
3892
3892
|
if (n._temporaryRemoved) {
|
|
3893
|
-
if (n.x = Math.max(0, Math.round(
|
|
3893
|
+
if (n.x = Math.max(0, Math.round(h / t)), n.y = Math.max(0, Math.round(d / e)), delete n.autoPosition, this.engine.nodeBoundFix(n), !this.engine.willItFit(n)) {
|
|
3894
3894
|
if (n.autoPosition = !0, !this.engine.willItFit(n)) {
|
|
3895
3895
|
U.off(r, "drag");
|
|
3896
3896
|
return;
|
|
@@ -3926,42 +3926,42 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3926
3926
|
if ((n == null ? void 0 : n.grid) === this && !n._temporaryRemoved)
|
|
3927
3927
|
return !1;
|
|
3928
3928
|
if (n != null && n._sidebarOrig && (n.w = n._sidebarOrig.w, n.h = n._sidebarOrig.h), n != null && n.grid && n.grid !== this && !n._temporaryRemoved && n.grid._leave(r, o), o = o || r, t = this.cellWidth(), e = this.getCellHeight(!0), !n) {
|
|
3929
|
-
const
|
|
3930
|
-
if (
|
|
3929
|
+
const u = o.getAttribute("data-gs-widget") || o.getAttribute("gridstacknode");
|
|
3930
|
+
if (u) {
|
|
3931
3931
|
try {
|
|
3932
|
-
n = JSON.parse(
|
|
3932
|
+
n = JSON.parse(u);
|
|
3933
3933
|
} catch {
|
|
3934
|
-
console.error("Gridstack dropover: Bad JSON format: ",
|
|
3934
|
+
console.error("Gridstack dropover: Bad JSON format: ", u);
|
|
3935
3935
|
}
|
|
3936
3936
|
o.removeAttribute("data-gs-widget"), o.removeAttribute("gridstacknode");
|
|
3937
3937
|
}
|
|
3938
3938
|
n || (n = this._readAttr(o)), n._sidebarOrig = { w: n.w, h: n.h };
|
|
3939
3939
|
}
|
|
3940
3940
|
n.grid || (n.el || (n = { ...n }), n._isExternal = !0, o.gridstackNode = n);
|
|
3941
|
-
const
|
|
3942
|
-
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w:
|
|
3943
|
-
n._temporaryRemoved = !0) : (n.w =
|
|
3941
|
+
const d = n.w || Math.round(o.offsetWidth / t) || 1, h = n.h || Math.round(o.offsetHeight / e) || 1;
|
|
3942
|
+
return n.grid && n.grid !== this ? (r._gridstackNodeOrig || (r._gridstackNodeOrig = n), r.gridstackNode = n = { ...n, w: d, h, grid: this }, delete n.x, delete n.y, this.engine.cleanupNode(n).nodeBoundFix(n), n._initDD = n._isExternal = // DOM needs to be re-parented on a drop
|
|
3943
|
+
n._temporaryRemoved = !0) : (n.w = d, n.h = h, n._temporaryRemoved = !0), _._itemRemoving(n.el, !1), U.on(r, "drag", i), i(s, r, o), !1;
|
|
3944
3944
|
}).on(this.el, "dropout", (s, r, o) => {
|
|
3945
3945
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3946
3946
|
return n && (!n.grid || n.grid === this) && (this._leave(r, o), this._isTemp && this.removeAsSubGrid(n)), !1;
|
|
3947
3947
|
}).on(this.el, "drop", (s, r, o) => {
|
|
3948
|
-
var
|
|
3948
|
+
var m, g, y;
|
|
3949
3949
|
const n = (o == null ? void 0 : o.gridstackNode) || r.gridstackNode;
|
|
3950
3950
|
if ((n == null ? void 0 : n.grid) === this && !n._isExternal)
|
|
3951
3951
|
return !1;
|
|
3952
|
-
const
|
|
3952
|
+
const d = !!this.placeholder.parentElement, h = r !== o;
|
|
3953
3953
|
this.placeholder.remove(), delete this.placeholder.gridstackNode;
|
|
3954
|
-
const
|
|
3955
|
-
|
|
3954
|
+
const u = d && this.opts.animate;
|
|
3955
|
+
u && this.setAnimation(!1);
|
|
3956
3956
|
const l = r._gridstackNodeOrig;
|
|
3957
|
-
if (delete r._gridstackNodeOrig,
|
|
3958
|
-
const
|
|
3959
|
-
|
|
3957
|
+
if (delete r._gridstackNodeOrig, d && (l != null && l.grid) && l.grid !== this) {
|
|
3958
|
+
const p = l.grid;
|
|
3959
|
+
p.engine.removeNodeFromLayoutCache(l), p.engine.removedNodes.push(l), p._triggerRemoveEvent()._triggerChangeEvent(), p.parentGridNode && !p.engine.nodes.length && p.opts.subGridDynamic && p.removeAsSubGrid();
|
|
3960
3960
|
}
|
|
3961
|
-
if (!n || (
|
|
3961
|
+
if (!n || (d && (this.engine.cleanupNode(n), n.grid = this), (m = n.grid) == null || delete m._isTemp, U.off(r, "drag"), o !== r ? (o.remove(), r = o) : r.remove(), this._removeDD(r), !d))
|
|
3962
3962
|
return !1;
|
|
3963
3963
|
const f = (y = (g = n.subGrid) == null ? void 0 : g.el) == null ? void 0 : y.gridstack;
|
|
3964
|
-
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r),
|
|
3964
|
+
return c.copyPos(n, this._readAttr(this.placeholder)), c.removePositioningStyles(r), h && (n.content || n.subGridOpts || _.addRemoveCB) ? (delete n.el, r = this.addWidget(n)) : (this._prepareElement(r, !0, n), this.el.appendChild(r), this.resizeToContentCheck(!1, n), f && (f.parentGridNode = n, f.opts.styleInHead || f._updateStyles(!0)), this._updateContainerHeight()), this.engine.addedNodes.push(n), this._triggerAddEvent(), this._triggerChangeEvent(), this.engine.endUpdate(), this._gsEventHandler.dropped && this._gsEventHandler.dropped({ ...s, type: "dropped" }, l && l.grid ? l : void 0, n), u && this.setAnimation(this.opts.animate, !0), !1;
|
|
3965
3965
|
}), this;
|
|
3966
3966
|
}
|
|
3967
3967
|
/** @internal mark item for removal */
|
|
@@ -3976,7 +3976,7 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3976
3976
|
if (typeof this.opts.removable != "string")
|
|
3977
3977
|
return this;
|
|
3978
3978
|
const e = document.querySelector(this.opts.removable);
|
|
3979
|
-
return e ? (!this.opts.staticGrid && !U.isDroppable(e) && U.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) =>
|
|
3979
|
+
return e ? (!this.opts.staticGrid && !U.isDroppable(e) && U.droppable(e, this.opts.removableOptions).on(e, "dropover", (t, i) => _._itemRemoving(i, !0)).on(e, "dropout", (t, i) => _._itemRemoving(i, !1)), this) : this;
|
|
3980
3980
|
}
|
|
3981
3981
|
/**
|
|
3982
3982
|
* prepares the element for drag&drop - this is normally called by makeWidget() unless are are delay loading
|
|
@@ -3991,31 +3991,31 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
3991
3991
|
if ((t || o) && (i._initDD && (this._removeDD(e), delete i._initDD), o && e.classList.add("ui-draggable-disabled", "ui-resizable-disabled"), !t))
|
|
3992
3992
|
return this;
|
|
3993
3993
|
if (!i._initDD) {
|
|
3994
|
-
let n,
|
|
3995
|
-
const
|
|
3996
|
-
this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, f.target), n = this.cellWidth(),
|
|
3997
|
-
},
|
|
3998
|
-
this._dragOrResize(e, f,
|
|
3994
|
+
let n, d;
|
|
3995
|
+
const h = (f, m) => {
|
|
3996
|
+
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);
|
|
3997
|
+
}, u = (f, m) => {
|
|
3998
|
+
this._dragOrResize(e, f, m, i, n, d);
|
|
3999
3999
|
}, l = (f) => {
|
|
4000
4000
|
this.placeholder.remove(), delete this.placeholder.gridstackNode, delete i._moving, delete i._event, delete i._lastTried;
|
|
4001
|
-
const
|
|
4001
|
+
const m = i.w !== i._orig.w, g = f.target;
|
|
4002
4002
|
if (!(!g.gridstackNode || g.gridstackNode.grid !== this)) {
|
|
4003
4003
|
if (i.el = g, i._isAboutToRemove) {
|
|
4004
4004
|
const y = e.gridstackNode.grid;
|
|
4005
4005
|
y._gsEventHandler[f.type] && y._gsEventHandler[f.type](f, g), y.engine.nodes.push(i), y.removeWidget(e, !0, !0);
|
|
4006
4006
|
} else
|
|
4007
4007
|
c.removePositioningStyles(g), i._temporaryRemoved ? (c.copyPos(i, i._orig), this._writePosAttr(g, i), this.engine.addNode(i)) : this._writePosAttr(g, i), this._gsEventHandler[f.type] && this._gsEventHandler[f.type](f, g);
|
|
4008
|
-
this._extraDragRow = 0, this._updateContainerHeight(), this._triggerChangeEvent(), this.engine.endUpdate(), f.type === "resizestop" && (Number.isInteger(i.sizeToContent) && (i.sizeToContent = i.h), this.resizeToContentCheck(
|
|
4008
|
+
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));
|
|
4009
4009
|
}
|
|
4010
4010
|
};
|
|
4011
4011
|
U.draggable(e, {
|
|
4012
|
-
start:
|
|
4012
|
+
start: h,
|
|
4013
4013
|
stop: l,
|
|
4014
|
-
drag:
|
|
4014
|
+
drag: u
|
|
4015
4015
|
}).resizable(e, {
|
|
4016
|
-
start:
|
|
4016
|
+
start: h,
|
|
4017
4017
|
stop: l,
|
|
4018
|
-
resize:
|
|
4018
|
+
resize: u
|
|
4019
4019
|
}), i._initDD = !0;
|
|
4020
4020
|
}
|
|
4021
4021
|
return U.draggable(e, s ? "disable" : "enable").resizable(e, r ? "disable" : "enable"), this;
|
|
@@ -4026,8 +4026,8 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4026
4026
|
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)
|
|
4027
4027
|
this.dragTransform = c.getValuesFromTransformedElement(e);
|
|
4028
4028
|
else if (this.placeholder && this.placeholder.closest(".grid-stack")) {
|
|
4029
|
-
const
|
|
4030
|
-
this.dragTransform = c.getValuesFromTransformedElement(
|
|
4029
|
+
const d = this.placeholder.closest(".grid-stack");
|
|
4030
|
+
this.dragTransform = c.getValuesFromTransformedElement(d);
|
|
4031
4031
|
} else
|
|
4032
4032
|
this.dragTransform = {
|
|
4033
4033
|
xScale: 1,
|
|
@@ -4036,21 +4036,21 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4036
4036
|
yOffset: 0
|
|
4037
4037
|
};
|
|
4038
4038
|
if (s.el = this.placeholder, s._lastUiPosition = i.position, s._prevYPix = i.position.top, s._moving = t.type === "dragstart", delete s._lastTried, t.type === "dropover" && s._temporaryRemoved && (this.engine.addNode(s), s._moving = !0), this.engine.cacheRects(r, o, this.opts.marginTop, this.opts.marginRight, this.opts.marginBottom, this.opts.marginLeft), t.type === "resizestart") {
|
|
4039
|
-
const
|
|
4040
|
-
U.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1,
|
|
4039
|
+
const d = this.getColumn() - s.x, h = (this.opts.maxRow || Number.MAX_SAFE_INTEGER) - s.y;
|
|
4040
|
+
U.resizable(e, "option", "minWidth", r * Math.min(s.minW || 1, d)).resizable(e, "option", "minHeight", o * Math.min(s.minH || 1, h)).resizable(e, "option", "maxWidth", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, d)).resizable(e, "option", "maxWidthMoveLeft", r * Math.min(s.maxW || Number.MAX_SAFE_INTEGER, s.x + s.w)).resizable(e, "option", "maxHeight", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, h)).resizable(e, "option", "maxHeightMoveUp", o * Math.min(s.maxH || Number.MAX_SAFE_INTEGER, s.y + s.h));
|
|
4041
4041
|
}
|
|
4042
4042
|
}
|
|
4043
4043
|
/** @internal handles actual drag/resize */
|
|
4044
4044
|
_dragOrResize(e, t, i, s, r, o) {
|
|
4045
4045
|
const n = { ...s._orig };
|
|
4046
|
-
let
|
|
4047
|
-
const
|
|
4048
|
-
if (
|
|
4046
|
+
let d, h = this.opts.marginLeft, u = this.opts.marginRight, l = this.opts.marginTop, f = this.opts.marginBottom;
|
|
4047
|
+
const m = Math.round(o * 0.1), g = Math.round(r * 0.1);
|
|
4048
|
+
if (h = Math.min(h, g), u = Math.min(u, g), l = Math.min(l, m), f = Math.min(f, m), t.type === "drag") {
|
|
4049
4049
|
if (s._temporaryRemoved)
|
|
4050
4050
|
return;
|
|
4051
|
-
const
|
|
4052
|
-
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position,
|
|
4053
|
-
const D = i.position.left + (i.position.left > s._lastUiPosition.left ? -
|
|
4051
|
+
const p = i.position.top - s._prevYPix;
|
|
4052
|
+
s._prevYPix = i.position.top, this.opts.draggable.scroll !== !1 && c.updateScrollPosition(e, i.position, p);
|
|
4053
|
+
const D = i.position.left + (i.position.left > s._lastUiPosition.left ? -u : h), P = i.position.top + (i.position.top > s._lastUiPosition.top ? -f : l);
|
|
4054
4054
|
n.x = Math.round(D / r), n.y = Math.round(P / o);
|
|
4055
4055
|
const z = this._extraDragRow;
|
|
4056
4056
|
if (this.engine.collide(s, n)) {
|
|
@@ -4062,22 +4062,22 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4062
4062
|
if (this._extraDragRow !== z && this._updateContainerHeight(), s.x === n.x && s.y === n.y)
|
|
4063
4063
|
return;
|
|
4064
4064
|
} else if (t.type === "resize") {
|
|
4065
|
-
if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width -
|
|
4065
|
+
if (n.x < 0 || (c.updateScrollResize(t, e, o), n.w = Math.round((i.size.width - h) / r), n.h = Math.round((i.size.height - l) / o), s.w === n.w && s.h === n.h) || s._lastTried && s._lastTried.w === n.w && s._lastTried.h === n.h)
|
|
4066
4066
|
return;
|
|
4067
|
-
const
|
|
4068
|
-
n.x = Math.round(
|
|
4067
|
+
const p = i.position.left + h, D = i.position.top + l;
|
|
4068
|
+
n.x = Math.round(p / r), n.y = Math.round(D / o), d = !0;
|
|
4069
4069
|
}
|
|
4070
4070
|
s._event = t, s._lastTried = n;
|
|
4071
4071
|
const y = {
|
|
4072
|
-
x: i.position.left +
|
|
4072
|
+
x: i.position.left + h,
|
|
4073
4073
|
y: i.position.top + l,
|
|
4074
|
-
w: (i.size ? i.size.width : s.w * r) -
|
|
4074
|
+
w: (i.size ? i.size.width : s.w * r) - h - u,
|
|
4075
4075
|
h: (i.size ? i.size.height : s.h * o) - l - f
|
|
4076
4076
|
};
|
|
4077
|
-
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: o, rect: y, resizing:
|
|
4078
|
-
s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l,
|
|
4079
|
-
const
|
|
4080
|
-
s._sidebarOrig || this._writePosAttr(
|
|
4077
|
+
if (this.engine.moveNodeCheck(s, { ...n, cellWidth: r, cellHeight: o, rect: y, resizing: d })) {
|
|
4078
|
+
s._lastUiPosition = i.position, this.engine.cacheRects(r, o, l, u, f, h), delete s._skipDown, d && s.subGrid && s.subGrid.onResize(), this._extraDragRow = 0, this._updateContainerHeight();
|
|
4079
|
+
const p = t.target;
|
|
4080
|
+
s._sidebarOrig || this._writePosAttr(p, s), this._gsEventHandler[t.type] && this._gsEventHandler[t.type](t, p);
|
|
4081
4081
|
}
|
|
4082
4082
|
}
|
|
4083
4083
|
/** @internal called when item leaving our area by either cursor dropout event
|
|
@@ -4091,20 +4091,20 @@ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the
|
|
|
4091
4091
|
return;
|
|
4092
4092
|
i._temporaryRemoved = !0, this.engine.removeNode(i), i.el = i._isExternal && t ? t : e;
|
|
4093
4093
|
const s = i._sidebarOrig;
|
|
4094
|
-
i._isExternal && this.engine.cleanupNode(i), i._sidebarOrig = s, this.opts.removable === !0 &&
|
|
4094
|
+
i._isExternal && this.engine.cleanupNode(i), i._sidebarOrig = s, this.opts.removable === !0 && _._itemRemoving(e, !0), e._gridstackNodeOrig ? (e.gridstackNode = e._gridstackNodeOrig, delete e._gridstackNodeOrig) : i._isExternal && this.engine.restoreInitial();
|
|
4095
4095
|
}
|
|
4096
4096
|
// legacy method removed
|
|
4097
4097
|
commit() {
|
|
4098
4098
|
return Ss(this, this.batchUpdate(!1), "commit", "batchUpdate", "5.2"), this;
|
|
4099
4099
|
}
|
|
4100
4100
|
}
|
|
4101
|
-
|
|
4102
|
-
|
|
4101
|
+
_.renderCB = (a, e) => {
|
|
4102
|
+
a && (e != null && e.content) && (a.textContent = e.content);
|
|
4103
4103
|
};
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4104
|
+
_.resizeToContentParent = ".grid-stack-item-content";
|
|
4105
|
+
_.Utils = c;
|
|
4106
|
+
_.Engine = le;
|
|
4107
|
+
_.GDRev = "11.5.1";
|
|
4108
4108
|
const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { class: "grid-stack-item-content" }, Ms = /* @__PURE__ */ Z({
|
|
4109
4109
|
__name: "DraggableGridLayout",
|
|
4110
4110
|
props: {
|
|
@@ -4112,12 +4112,12 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4112
4112
|
tileHeight: { default: Xe }
|
|
4113
4113
|
},
|
|
4114
4114
|
emits: ["update-tiles"],
|
|
4115
|
-
setup(
|
|
4116
|
-
const i =
|
|
4115
|
+
setup(a, { expose: e, emit: t }) {
|
|
4116
|
+
const i = a, s = t, r = H(null), o = H(new Map(i.tiles.map((m) => [`${m.id}`, m])));
|
|
4117
4117
|
let n = null;
|
|
4118
|
-
const
|
|
4119
|
-
var
|
|
4120
|
-
const y = o.value.get(`${(
|
|
4118
|
+
const d = (m) => `[data-id="${m}"]`, h = (m) => m.map((g) => {
|
|
4119
|
+
var p;
|
|
4120
|
+
const y = o.value.get(`${(p = g.el) == null ? void 0 : p.getAttribute("data-id")}`);
|
|
4121
4121
|
if (y)
|
|
4122
4122
|
return {
|
|
4123
4123
|
...y,
|
|
@@ -4126,53 +4126,53 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4126
4126
|
size: { cols: Number(g.w), rows: Number(g.h) }
|
|
4127
4127
|
}
|
|
4128
4128
|
};
|
|
4129
|
-
}).filter((g) => g !== void 0),
|
|
4130
|
-
n && (
|
|
4131
|
-
o.value.set(`${
|
|
4129
|
+
}).filter((g) => g !== void 0), u = (m, g) => {
|
|
4130
|
+
n && (h(g).forEach((p) => {
|
|
4131
|
+
o.value.set(`${p.id}`, p);
|
|
4132
4132
|
}), s("update-tiles", Array.from(o.value.values())));
|
|
4133
|
-
}, l = (
|
|
4133
|
+
}, l = (m, g) => {
|
|
4134
4134
|
g.forEach((y) => {
|
|
4135
|
-
var
|
|
4136
|
-
o.value.delete(`${(
|
|
4135
|
+
var p;
|
|
4136
|
+
o.value.delete(`${(p = y.el) == null ? void 0 : p.getAttribute("data-id")}`);
|
|
4137
4137
|
}), s("update-tiles", Array.from(o.value.values()));
|
|
4138
4138
|
};
|
|
4139
4139
|
at(() => {
|
|
4140
|
-
r.value && (n =
|
|
4140
|
+
r.value && (n = _.init({
|
|
4141
4141
|
margin: 10,
|
|
4142
4142
|
column: Wt,
|
|
4143
4143
|
cellHeight: i.tileHeight,
|
|
4144
4144
|
resizable: { handles: "se, sw" },
|
|
4145
4145
|
handle: ".tile-header"
|
|
4146
|
-
}, r.value), n.on("change",
|
|
4146
|
+
}, r.value), n.on("change", u), n.on("added", u), n.on("removed", l));
|
|
4147
4147
|
}), lt(() => {
|
|
4148
4148
|
n && n.destroy(!1);
|
|
4149
4149
|
});
|
|
4150
|
-
const f = (
|
|
4150
|
+
const f = (m) => {
|
|
4151
4151
|
if (n && r.value) {
|
|
4152
|
-
const g = r.value.querySelector(
|
|
4152
|
+
const g = r.value.querySelector(d(m));
|
|
4153
4153
|
g && n.removeWidget(g);
|
|
4154
4154
|
}
|
|
4155
4155
|
};
|
|
4156
|
-
return ze(() => i.tiles.length, async (
|
|
4157
|
-
if (
|
|
4156
|
+
return ze(() => i.tiles.length, async (m, g) => {
|
|
4157
|
+
if (m > g && n) {
|
|
4158
4158
|
const y = i.tiles.slice(g);
|
|
4159
|
-
for (const
|
|
4160
|
-
o.value.set(`${
|
|
4159
|
+
for (const p of y)
|
|
4160
|
+
o.value.set(`${p.id}`, p), await ut(), n.makeWidget(d(p.id), {
|
|
4161
4161
|
autoPosition: !0,
|
|
4162
|
-
w:
|
|
4163
|
-
h:
|
|
4162
|
+
w: p.layout.size.cols,
|
|
4163
|
+
h: p.layout.size.rows
|
|
4164
4164
|
});
|
|
4165
4165
|
}
|
|
4166
4166
|
}), Mt(() => {
|
|
4167
|
-
i.tiles.forEach((
|
|
4168
|
-
o.value.set(`${
|
|
4167
|
+
i.tiles.forEach((m) => {
|
|
4168
|
+
o.value.set(`${m.id}`, m);
|
|
4169
4169
|
});
|
|
4170
|
-
}), e({ removeWidget: f }), (
|
|
4170
|
+
}), e({ removeWidget: f }), (m, g) => (x(), K("div", {
|
|
4171
4171
|
ref_key: "gridContainer",
|
|
4172
4172
|
ref: r,
|
|
4173
4173
|
class: "grid-stack"
|
|
4174
4174
|
}, [
|
|
4175
|
-
(
|
|
4175
|
+
(x(!0), K($t, null, Gt(i.tiles, (y) => (x(), K("div", {
|
|
4176
4176
|
key: y.id,
|
|
4177
4177
|
class: "grid-stack-item",
|
|
4178
4178
|
"data-id": `${y.id}`,
|
|
@@ -4184,7 +4184,7 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4184
4184
|
"gs-y": y.layout.position.row
|
|
4185
4185
|
}, [
|
|
4186
4186
|
oe("div", Hs, [
|
|
4187
|
-
De(
|
|
4187
|
+
De(m.$slots, "tile", { tile: y }, void 0, !0)
|
|
4188
4188
|
])
|
|
4189
4189
|
], 8, Os))), 128))
|
|
4190
4190
|
], 512));
|
|
@@ -4204,25 +4204,25 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4204
4204
|
modelModifiers: {}
|
|
4205
4205
|
}),
|
|
4206
4206
|
emits: /* @__PURE__ */ xt(["edit-tile", "tile-time-range-zoom"], ["update:modelValue"]),
|
|
4207
|
-
setup(
|
|
4208
|
-
Ye((
|
|
4209
|
-
|
|
4207
|
+
setup(a, { expose: e, emit: t }) {
|
|
4208
|
+
Ye((C) => ({
|
|
4209
|
+
v82baf22a: l.value
|
|
4210
4210
|
}));
|
|
4211
|
-
const i =
|
|
4211
|
+
const i = a, s = t, r = ci(a, "modelValue"), { i18n: o } = ye.useI18n(), n = H(0), d = H(null), h = H(), u = H(), l = H("scale(1)"), f = ve(me);
|
|
4212
4212
|
f || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements")), ye.useRequestQueue();
|
|
4213
|
-
const
|
|
4213
|
+
const m = dt(), g = k(() => i.context.timeSpec ? i.context.timeSpec : {
|
|
4214
4214
|
type: "relative",
|
|
4215
|
-
time_range:
|
|
4216
|
-
}), y = k(() => !!i.context.timeSpec || !
|
|
4217
|
-
const N =
|
|
4218
|
-
return N !== 0 ? N :
|
|
4219
|
-
}, D = k(() => r.value.tiles.map((
|
|
4215
|
+
time_range: m.defaultQueryTimeForOrg
|
|
4216
|
+
}), y = k(() => !!i.context.timeSpec || !m.loading), p = (C, S) => {
|
|
4217
|
+
const N = C.layout.position.row - S.layout.position.row;
|
|
4218
|
+
return N !== 0 ? N : C.layout.position.col - S.layout.position.col;
|
|
4219
|
+
}, D = k(() => r.value.tiles.map((C) => {
|
|
4220
4220
|
var N;
|
|
4221
|
-
let S =
|
|
4221
|
+
let S = C.definition;
|
|
4222
4222
|
if ("description" in S.chart) {
|
|
4223
4223
|
const q = (N = S.chart.description) == null ? void 0 : N.replace(Ui, () => {
|
|
4224
|
-
const
|
|
4225
|
-
return o.te(
|
|
4224
|
+
const pe = `renderer.trendRange.${g.value.type === "absolute" ? "custom" : g.value.time_range}`;
|
|
4225
|
+
return o.te(pe) ? o.t(pe) : "";
|
|
4226
4226
|
});
|
|
4227
4227
|
S = {
|
|
4228
4228
|
...S,
|
|
@@ -4232,22 +4232,22 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4232
4232
|
}
|
|
4233
4233
|
};
|
|
4234
4234
|
}
|
|
4235
|
-
return i.context.editable && !
|
|
4235
|
+
return i.context.editable && !C.id && console.warn(
|
|
4236
4236
|
"No id provided for tile. One will be generated automatically,",
|
|
4237
4237
|
"however tracking changes to this tile may not work as expected.",
|
|
4238
|
-
|
|
4238
|
+
C
|
|
4239
4239
|
), {
|
|
4240
|
-
layout:
|
|
4240
|
+
layout: C.layout,
|
|
4241
4241
|
meta: S,
|
|
4242
|
-
type:
|
|
4242
|
+
type: C.type,
|
|
4243
4243
|
// Add a unique key to each tile internally.
|
|
4244
|
-
id:
|
|
4244
|
+
id: C.id ?? crypto.randomUUID()
|
|
4245
4245
|
};
|
|
4246
4246
|
})), P = k(() => {
|
|
4247
|
-
var
|
|
4248
|
-
let { tz:
|
|
4247
|
+
var pe, Re, Pe;
|
|
4248
|
+
let { tz: C, refreshInterval: S, editable: N } = i.context;
|
|
4249
4249
|
const q = [...i.context.filters ?? [], ...r.value.preset_filters ?? []];
|
|
4250
|
-
if (
|
|
4250
|
+
if (C || (C = new Intl.DateTimeFormat().resolvedOptions().timeZone), S === void 0 && (S = Wi), J.value) {
|
|
4251
4251
|
let ke = !1;
|
|
4252
4252
|
if (g.value.type === "relative")
|
|
4253
4253
|
ke = ["15m", "1h", "6h", "12h", "24h"].includes(g.value.time_range);
|
|
@@ -4259,26 +4259,26 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4259
4259
|
g.value.type === "absolute" && g.value.end.getTime() < Je ? S = 0 : ke ? S = Ki : S = Vi;
|
|
4260
4260
|
}
|
|
4261
4261
|
N === void 0 && (N = !1);
|
|
4262
|
-
const ee = !!((Pe = (Re = (
|
|
4262
|
+
const ee = !!((Pe = (Re = (pe = fi()) == null ? void 0 : pe.vnode) == null ? void 0 : Re.props) != null && Pe.onTileTimeRangeZoom);
|
|
4263
4263
|
return {
|
|
4264
4264
|
filters: q,
|
|
4265
|
-
tz:
|
|
4265
|
+
tz: C,
|
|
4266
4266
|
timeSpec: g.value,
|
|
4267
4267
|
refreshInterval: S,
|
|
4268
4268
|
editable: N,
|
|
4269
4269
|
zoomable: ee
|
|
4270
4270
|
};
|
|
4271
|
-
}), z = (
|
|
4272
|
-
s("edit-tile",
|
|
4273
|
-
}, Q = (
|
|
4274
|
-
const S = Q(
|
|
4275
|
-
...
|
|
4276
|
-
chart_title:
|
|
4271
|
+
}), z = (C) => {
|
|
4272
|
+
s("edit-tile", C);
|
|
4273
|
+
}, Q = (C) => C.type === "slottable", B = (C) => {
|
|
4274
|
+
const S = Q(C.meta.chart) ? { ...C.meta.chart } : {
|
|
4275
|
+
...C.meta.chart,
|
|
4276
|
+
chart_title: C.meta.chart.chart_title ? `Copy of ${C.meta.chart.chart_title}` : ""
|
|
4277
4277
|
}, N = {
|
|
4278
4278
|
id: crypto.randomUUID(),
|
|
4279
4279
|
type: "chart",
|
|
4280
4280
|
definition: {
|
|
4281
|
-
...
|
|
4281
|
+
...C.meta,
|
|
4282
4282
|
chart: S
|
|
4283
4283
|
},
|
|
4284
4284
|
layout: {
|
|
@@ -4286,68 +4286,68 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4286
4286
|
col: 0,
|
|
4287
4287
|
row: 0
|
|
4288
4288
|
},
|
|
4289
|
-
size:
|
|
4289
|
+
size: C.layout.size
|
|
4290
4290
|
}
|
|
4291
4291
|
};
|
|
4292
4292
|
r.value.tiles.push(N);
|
|
4293
|
-
}, R = (
|
|
4294
|
-
|
|
4293
|
+
}, R = (C) => {
|
|
4294
|
+
d.value && d.value.removeWidget(C.id);
|
|
4295
4295
|
}, M = () => {
|
|
4296
4296
|
n.value++;
|
|
4297
|
-
}, Y = (
|
|
4298
|
-
const S =
|
|
4297
|
+
}, Y = (C) => {
|
|
4298
|
+
const S = C.map((N) => ({
|
|
4299
4299
|
id: N.id,
|
|
4300
4300
|
type: N.type,
|
|
4301
4301
|
layout: N.layout,
|
|
4302
4302
|
definition: N.meta
|
|
4303
4303
|
}));
|
|
4304
|
-
r.value.tiles = S.sort(
|
|
4304
|
+
r.value.tiles = S.sort(p);
|
|
4305
4305
|
}, de = async () => {
|
|
4306
|
-
if (l.value = "scale(1)", await ut(),
|
|
4307
|
-
const { availWidth:
|
|
4306
|
+
if (l.value = "scale(1)", await ut(), u.value) {
|
|
4307
|
+
const { availWidth: C, availHeight: S } = window.screen, { width: N, height: q } = u.value.getBoundingClientRect(), ee = Math.min(S / q, C / N);
|
|
4308
4308
|
l.value = `scale(${ee})`;
|
|
4309
4309
|
}
|
|
4310
4310
|
}, Me = () => {
|
|
4311
|
-
|
|
4311
|
+
h.value && (document.fullscreenElement ? document.exitFullscreen() : h.value.requestFullscreen());
|
|
4312
4312
|
}, J = H(!1), Ie = () => {
|
|
4313
4313
|
J.value = document.fullscreenElement !== null, J.value && de();
|
|
4314
4314
|
};
|
|
4315
4315
|
return e({
|
|
4316
4316
|
refresh: M,
|
|
4317
4317
|
toggleFullscreen: Me
|
|
4318
|
-
}), (
|
|
4318
|
+
}), (C, S) => {
|
|
4319
4319
|
const N = ge("KAlert");
|
|
4320
|
-
return
|
|
4320
|
+
return x(), K("div", {
|
|
4321
4321
|
ref_key: "dashboardContainer",
|
|
4322
|
-
ref:
|
|
4322
|
+
ref: h,
|
|
4323
4323
|
class: je(["kong-ui-public-dashboard-renderer", { "is-fullscreen": J.value }]),
|
|
4324
4324
|
onFullscreenchange: Ie
|
|
4325
4325
|
}, [
|
|
4326
4326
|
oe("div", {
|
|
4327
4327
|
ref_key: "layoutContainer",
|
|
4328
|
-
ref:
|
|
4328
|
+
ref: u,
|
|
4329
4329
|
class: "layout"
|
|
4330
4330
|
}, [
|
|
4331
|
-
|
|
4332
|
-
De(
|
|
4331
|
+
E(f) && J.value ? (x(), K("div", Ps, [
|
|
4332
|
+
De(C.$slots, "fullscreenHeader", {}, void 0, !0)
|
|
4333
4333
|
])) : V("", !0),
|
|
4334
|
-
|
|
4334
|
+
E(f) ? (x(), O(qt(a.context.editable && !J.value ? Is : Ds), {
|
|
4335
4335
|
key: 2,
|
|
4336
4336
|
ref_key: "gridLayoutRef",
|
|
4337
|
-
ref:
|
|
4337
|
+
ref: d,
|
|
4338
4338
|
"tile-height": r.value.tile_height,
|
|
4339
4339
|
tiles: D.value,
|
|
4340
4340
|
onUpdateTiles: Y
|
|
4341
4341
|
}, {
|
|
4342
4342
|
tile: $(({ tile: q }) => [
|
|
4343
|
-
q.meta.chart.type === "slottable" ? (
|
|
4344
|
-
De(
|
|
4345
|
-
])) : (
|
|
4343
|
+
q.meta.chart.type === "slottable" ? (x(), K("div", qs, [
|
|
4344
|
+
De(C.$slots, q.meta.chart.id, {}, void 0, !0)
|
|
4345
|
+
])) : (x(), O(ks, {
|
|
4346
4346
|
key: J.value ? `${q.id}-tile` : `${q.id}-tile-fullscreen`,
|
|
4347
4347
|
class: "tile-container",
|
|
4348
4348
|
context: P.value,
|
|
4349
4349
|
definition: q.meta,
|
|
4350
|
-
height: q.layout.size.rows * (r.value.tile_height ||
|
|
4350
|
+
height: q.layout.size.rows * (r.value.tile_height || E(Xe)) + parseInt(E(ei), 10),
|
|
4351
4351
|
"is-fullscreen": J.value,
|
|
4352
4352
|
"query-ready": y.value,
|
|
4353
4353
|
"refresh-counter": n.value,
|
|
@@ -4359,12 +4359,12 @@ const Os = ["data-id", "data-testid", "gs-h", "gs-w", "gs-x", "gs-y"], Hs = { cl
|
|
|
4359
4359
|
}, null, 8, ["context", "definition", "height", "is-fullscreen", "query-ready", "refresh-counter", "tile-id", "onDuplicateTile", "onEditTile", "onRemoveTile"]))
|
|
4360
4360
|
]),
|
|
4361
4361
|
_: 3
|
|
4362
|
-
}, 40, ["tile-height", "tiles"])) : (
|
|
4362
|
+
}, 40, ["tile-height", "tiles"])) : (x(), O(N, {
|
|
4363
4363
|
key: 1,
|
|
4364
4364
|
appearance: "danger"
|
|
4365
4365
|
}, {
|
|
4366
4366
|
default: $(() => [
|
|
4367
|
-
ht(ne(
|
|
4367
|
+
ht(ne(E(o).t("renderer.noQueryBridge")), 1)
|
|
4368
4368
|
]),
|
|
4369
4369
|
_: 1
|
|
4370
4370
|
}))
|
|
@@ -4379,7 +4379,7 @@ export {
|
|
|
4379
4379
|
Rt as E,
|
|
4380
4380
|
Ki as F,
|
|
4381
4381
|
Ds as G,
|
|
4382
|
-
|
|
4382
|
+
me as I,
|
|
4383
4383
|
Ui as T,
|
|
4384
4384
|
ct as _,
|
|
4385
4385
|
Xe as a,
|