@kong-ui-public/split-pane 0.6.5 → 0.6.7-pr.4063.b6bcc4076.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,546 +1,508 @@
1
- import { watch as Y, onMounted as ee, nextTick as G, getCurrentScope as xe, onScopeDispose as Ce, getCurrentInstance as he, computed as R, toValue as B, shallowRef as Q, watchEffect as We, unref as u, ref as P, readonly as te, defineComponent as ge, useCssVars as be, resolveComponent as oe, openBlock as x, createElementBlock as L, createElementVNode as C, Fragment as we, renderList as ye, createBlock as K, withCtx as Z, createVNode as le, withModifiers as ne, normalizeClass as N, resolveDynamicComponent as re, createCommentVNode as E, useSlots as Le, useTemplateRef as $, renderSlot as T, withDirectives as ue, vShow as de } from "vue";
2
- import { ChevronDoubleLeftIcon as _e, ChevronDoubleRightIcon as ke } from "@kong/icons";
3
- import { useRouter as ze } from "vue-router";
4
- import { createI18n as De, i18nTComponent as $e } from "@kong-ui-public/i18n";
5
- const Ie = "260px", ae = "500px", ce = "50%", fe = "50%";
6
- function ie(e, a) {
7
- return xe() ? (Ce(e, a), !0) : !1;
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, getCurrentInstance as c, getCurrentScope as l, nextTick as u, normalizeClass as d, onMounted as f, onScopeDispose as p, openBlock as m, readonly as h, ref as g, renderList as _, renderSlot as v, resolveComponent as y, resolveDynamicComponent as b, shallowRef as x, toValue as S, unref as C, useCssVars as w, useSlots as T, useTemplateRef as E, vShow as D, watch as O, watchEffect as k, withCtx as A, withDirectives as ee, withModifiers as j } from "vue";
2
+ import { ChevronDoubleLeftIcon as M, ChevronDoubleRightIcon as N } from "@kong/icons";
3
+ import { useRouter as P } from "vue-router";
4
+ import { createI18n as F, i18nTComponent as I } from "@kong-ui-public/i18n";
5
+ // src/constants/split-pane.ts
6
+ var L = "260px", R = "500px";
7
+ // ../../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.45_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
8
+ function z(e, t) {
9
+ return l() ? (p(e, t), !0) : !1;
8
10
  }
9
- const Ne = typeof window < "u" && typeof document < "u";
11
+ var B = typeof window < "u" && typeof document < "u";
10
12
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
11
- const Ee = (e) => e != null, Te = Object.prototype.toString, Se = (e) => Te.call(e) === "[object Object]", Me = () => {
12
- };
13
- function U(e) {
14
- return Array.isArray(e) ? e : [e];
13
+ var V = (e) => e != null, te = Object.prototype.toString, ne = (e) => te.call(e) === "[object Object]", re = () => {};
14
+ function H(e) {
15
+ return Array.isArray(e) ? e : [e];
15
16
  }
16
- function Be(e) {
17
- return he();
17
+ function ie(e) {
18
+ return e || c();
18
19
  }
19
- function Oe(e, a = !0, r) {
20
- Be() ? ee(e, r) : a ? e() : G(e);
20
+ function ae(e, t = !0, n) {
21
+ ie(n) ? f(e, n) : t ? e() : u(e);
21
22
  }
22
- function Ae(e, a, r) {
23
- return Y(e, a, {
24
- ...r,
25
- immediate: !0
26
- });
23
+ function oe(e, t, n) {
24
+ return O(e, t, {
25
+ ...n,
26
+ immediate: !0
27
+ });
27
28
  }
28
- const O = Ne ? window : void 0;
29
- function _(e) {
30
- var a;
31
- const r = B(e);
32
- return (a = r?.$el) !== null && a !== void 0 ? a : r;
29
+ // ../../../node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.45_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
30
+ var U = B ? window : void 0;
31
+ B && window.document, B && window.navigator, B && window.location;
32
+ function W(e) {
33
+ let t = S(e);
34
+ return t?.$el ?? t;
33
35
  }
34
- function j(...e) {
35
- const a = (t, n, o, s) => (t.addEventListener(n, o, s), () => t.removeEventListener(n, o, s)), r = R(() => {
36
- const t = U(B(e[0])).filter((n) => n != null);
37
- return t.every((n) => typeof n != "string") ? t : void 0;
38
- });
39
- return Ae(() => {
40
- var t, n;
41
- return [
42
- (t = (n = r.value) === null || n === void 0 ? void 0 : n.map((o) => _(o))) !== null && t !== void 0 ? t : [O].filter((o) => o != null),
43
- U(B(r.value ? e[1] : e[0])),
44
- U(u(r.value ? e[2] : e[1])),
45
- B(r.value ? e[3] : e[2])
46
- ];
47
- }, ([t, n, o, s], l, p) => {
48
- if (!t?.length || !n?.length || !o?.length) return;
49
- const h = Se(s) ? { ...s } : s, c = t.flatMap((i) => n.flatMap((d) => o.map((v) => a(i, d, v, h))));
50
- p(() => {
51
- c.forEach((i) => i());
52
- });
53
- }, { flush: "post" });
36
+ function G(...e) {
37
+ let n = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), r = t(() => {
38
+ let t = H(S(e[0])).filter((e) => e != null);
39
+ return t.every((e) => typeof e != "string") ? t : void 0;
40
+ });
41
+ return oe(() => [
42
+ r.value?.map((e) => W(e)) ?? [U].filter((e) => e != null),
43
+ H(S(r.value ? e[1] : e[0])),
44
+ H(C(r.value ? e[2] : e[1])),
45
+ S(r.value ? e[3] : e[2])
46
+ ], ([e, t, r, i], a, o) => {
47
+ if (!e?.length || !t?.length || !r?.length) return;
48
+ let s = ne(i) ? { ...i } : i, c = e.flatMap((e) => t.flatMap((t) => r.map((r) => n(e, t, r, s))));
49
+ o(() => {
50
+ c.forEach((e) => e());
51
+ });
52
+ }, { flush: "post" });
54
53
  }
55
- // @__NO_SIDE_EFFECTS__
56
- function Fe() {
57
- const e = Q(!1), a = he();
58
- return a && ee(() => {
59
- e.value = !0;
60
- }, a), e;
54
+ function se() {
55
+ let e = x(!1), t = c();
56
+ return t && f(() => {
57
+ e.value = !0;
58
+ }, t), e;
61
59
  }
62
- // @__NO_SIDE_EFFECTS__
63
- function me(e) {
64
- const a = /* @__PURE__ */ Fe();
65
- return R(() => (a.value, !!e()));
60
+ /* @__NO_SIDE_EFFECTS__ */
61
+ function K(e) {
62
+ let n = se();
63
+ return t(() => (n.value, !!e()));
66
64
  }
67
- function He(e, a, r = {}) {
68
- const { window: t = O, ...n } = r;
69
- let o;
70
- const s = /* @__PURE__ */ me(() => t && "MutationObserver" in t), l = () => {
71
- o && (o.disconnect(), o = void 0);
72
- }, p = Y(R(() => {
73
- const i = U(B(e)).map(_).filter(Ee);
74
- return new Set(i);
75
- }), (i) => {
76
- l(), s.value && i.size && (o = new MutationObserver(a), i.forEach((d) => o.observe(d, n)));
77
- }, {
78
- immediate: !0,
79
- flush: "post"
80
- }), h = () => o?.takeRecords(), c = () => {
81
- p(), l();
82
- };
83
- return ie(c), {
84
- isSupported: s,
85
- stop: c,
86
- takeRecords: h
87
- };
65
+ function ce(e, n, r = {}) {
66
+ let { window: i = U, ...a } = r, o, s = /* @__PURE__ */ K(() => i && "MutationObserver" in i), c = () => {
67
+ o &&= (o.disconnect(), void 0);
68
+ }, l = O(t(() => {
69
+ let t = H(S(e)).map(W).filter(V);
70
+ return new Set(t);
71
+ }), (e) => {
72
+ c(), s.value && e.size && (o = new MutationObserver(n), e.forEach((e) => o.observe(e, a)));
73
+ }, {
74
+ immediate: !0,
75
+ flush: "post"
76
+ }), u = () => o?.takeRecords(), d = () => {
77
+ l(), c();
78
+ };
79
+ return z(d), {
80
+ isSupported: s,
81
+ stop: d,
82
+ takeRecords: u
83
+ };
88
84
  }
89
- function Xe(e, a, r = {}) {
90
- const { window: t = O, document: n = t?.document, flush: o = "sync" } = r;
91
- if (!t || !n) return Me;
92
- let s;
93
- const l = (c) => {
94
- s?.(), s = c;
95
- }, p = We(() => {
96
- const c = _(e);
97
- if (c) {
98
- const { stop: i } = He(n, (d) => {
99
- d.map((v) => [...v.removedNodes]).flat().some((v) => v === c || v.contains(c)) && a(d);
100
- }, {
101
- window: t,
102
- childList: !0,
103
- subtree: !0
104
- });
105
- l(i);
106
- }
107
- }, { flush: o }), h = () => {
108
- p(), l();
109
- };
110
- return ie(h), h;
85
+ function le(e, t, n = {}) {
86
+ let { window: r = U, document: i = r?.document, flush: a = "sync" } = n;
87
+ if (!r || !i) return re;
88
+ let o, s = (e) => {
89
+ o?.(), o = e;
90
+ }, c = k(() => {
91
+ let n = W(e);
92
+ if (n) {
93
+ let { stop: e } = ce(i, (e) => {
94
+ e.map((e) => [...e.removedNodes]).flat().some((e) => e === n || e.contains(n)) && t(e);
95
+ }, {
96
+ window: r,
97
+ childList: !0,
98
+ subtree: !0
99
+ });
100
+ s(e);
101
+ }
102
+ }, { flush: a }), l = () => {
103
+ c(), s();
104
+ };
105
+ return z(l), l;
111
106
  }
112
- function Ve(e, a, r = {}) {
113
- const { window: t = O, ...n } = r;
114
- let o;
115
- const s = /* @__PURE__ */ me(() => t && "ResizeObserver" in t), l = () => {
116
- o && (o.disconnect(), o = void 0);
117
- }, p = Y(R(() => {
118
- const c = B(e);
119
- return Array.isArray(c) ? c.map((i) => _(i)) : [_(c)];
120
- }), (c) => {
121
- if (l(), s.value && t) {
122
- o = new ResizeObserver(a);
123
- for (const i of c) i && o.observe(i, n);
124
- }
125
- }, {
126
- immediate: !0,
127
- flush: "post"
128
- }), h = () => {
129
- l(), p();
130
- };
131
- return ie(h), {
132
- isSupported: s,
133
- stop: h
134
- };
107
+ function ue(e, n, r = {}) {
108
+ let { window: i = U, ...a } = r, o, s = /* @__PURE__ */ K(() => i && "ResizeObserver" in i), c = () => {
109
+ o &&= (o.disconnect(), void 0);
110
+ }, l = O(t(() => {
111
+ let t = S(e);
112
+ return Array.isArray(t) ? t.map((e) => W(e)) : [W(t)];
113
+ }), (e) => {
114
+ if (c(), s.value && i) {
115
+ o = new ResizeObserver(n);
116
+ for (let t of e) t && o.observe(t, a);
117
+ }
118
+ }, {
119
+ immediate: !0,
120
+ flush: "post"
121
+ }), u = () => {
122
+ c(), l();
123
+ };
124
+ return z(u), {
125
+ isSupported: s,
126
+ stop: u
127
+ };
135
128
  }
136
- function ve(e, a = {}) {
137
- const { delayEnter: r = 0, delayLeave: t = 0, triggerOnRemoval: n = !1, window: o = O } = a, s = Q(!1);
138
- let l;
139
- const p = (h) => {
140
- const c = h ? r : t;
141
- l && (clearTimeout(l), l = void 0), c ? l = setTimeout(() => s.value = h, c) : s.value = h;
142
- };
143
- return o && (j(e, "mouseenter", () => p(!0), { passive: !0 }), j(e, "mouseleave", () => p(!1), { passive: !0 }), n && Xe(R(() => _(e)), () => p(!1))), s;
129
+ function q(e, n = {}) {
130
+ let { delayEnter: r = 0, delayLeave: i = 0, triggerOnRemoval: a = !1, window: o = U } = n, s = x(!1), c, l = (e) => {
131
+ let t = e ? r : i;
132
+ c &&= (clearTimeout(c), void 0), t ? c = setTimeout(() => s.value = e, t) : s.value = e;
133
+ };
134
+ return o && (G(e, "mouseenter", () => l(!0), { passive: !0 }), G(e, "mouseleave", () => l(!1), { passive: !0 }), a && le(t(() => W(e)), () => l(!1))), s;
144
135
  }
145
- function Ke(e, a = {
146
- width: 0,
147
- height: 0
136
+ function de(e, n = {
137
+ width: 0,
138
+ height: 0
148
139
  }, r = {}) {
149
- const { window: t = O, box: n = "content-box" } = r, o = R(() => {
150
- var i;
151
- return (i = _(e)) === null || i === void 0 || (i = i.namespaceURI) === null || i === void 0 ? void 0 : i.includes("svg");
152
- }), s = Q(a.width), l = Q(a.height), { stop: p } = Ve(e, ([i]) => {
153
- const d = n === "border-box" ? i.borderBoxSize : n === "content-box" ? i.contentBoxSize : i.devicePixelContentBoxSize;
154
- if (t && o.value) {
155
- const v = _(e);
156
- if (v) {
157
- const g = v.getBoundingClientRect();
158
- s.value = g.width, l.value = g.height;
159
- }
160
- } else if (d) {
161
- const v = U(d);
162
- s.value = v.reduce((g, { inlineSize: W }) => g + W, 0), l.value = v.reduce((g, { blockSize: W }) => g + W, 0);
163
- } else
164
- s.value = i.contentRect.width, l.value = i.contentRect.height;
165
- }, r);
166
- Oe(() => {
167
- const i = _(e);
168
- if (i && "offsetWidth" in i) if (n === "content-box" && t) {
169
- const d = t.getComputedStyle(i), v = Number.parseFloat(d.paddingLeft) + Number.parseFloat(d.paddingRight), g = Number.parseFloat(d.paddingTop) + Number.parseFloat(d.paddingBottom), W = Number.parseFloat(d.borderLeftWidth) + Number.parseFloat(d.borderRightWidth), b = Number.parseFloat(d.borderTopWidth) + Number.parseFloat(d.borderBottomWidth);
170
- s.value = i.offsetWidth - v - W, l.value = i.offsetHeight - g - b;
171
- } else
172
- s.value = i.offsetWidth, l.value = i.offsetHeight;
173
- else i && (s.value = a.width, l.value = a.height);
174
- });
175
- const h = Y(() => _(e), (i) => {
176
- s.value = i ? a.width : 0, l.value = i ? a.height : 0;
177
- });
178
- function c() {
179
- p(), h();
180
- }
181
- return {
182
- width: s,
183
- height: l,
184
- stop: c
185
- };
140
+ let { window: i = U, box: a = "content-box" } = r, o = t(() => {
141
+ var t;
142
+ return (t = W(e)) == null || (t = t.namespaceURI) == null ? void 0 : t.includes("svg");
143
+ }), s = x(n.width), c = x(n.height), { stop: l } = ue(e, ([t]) => {
144
+ let n = a === "border-box" ? t.borderBoxSize : a === "content-box" ? t.contentBoxSize : t.devicePixelContentBoxSize;
145
+ if (i && o.value) {
146
+ let t = W(e);
147
+ if (t) {
148
+ let e = t.getBoundingClientRect();
149
+ s.value = e.width, c.value = e.height;
150
+ }
151
+ } else if (n) {
152
+ let e = H(n);
153
+ s.value = e.reduce((e, { inlineSize: t }) => e + t, 0), c.value = e.reduce((e, { blockSize: t }) => e + t, 0);
154
+ } else s.value = t.contentRect.width, c.value = t.contentRect.height;
155
+ }, r);
156
+ ae(() => {
157
+ let t = W(e);
158
+ if (t && "offsetWidth" in t) {
159
+ if (a === "content-box" && i) {
160
+ let e = i.getComputedStyle(t), n = Number.parseFloat(e.paddingLeft) + Number.parseFloat(e.paddingRight), r = Number.parseFloat(e.paddingTop) + Number.parseFloat(e.paddingBottom), a = Number.parseFloat(e.borderLeftWidth) + Number.parseFloat(e.borderRightWidth), o = Number.parseFloat(e.borderTopWidth) + Number.parseFloat(e.borderBottomWidth);
161
+ s.value = t.offsetWidth - n - a, c.value = t.offsetHeight - r - o;
162
+ } else s.value = t.offsetWidth, c.value = t.offsetHeight;
163
+ } else t && (s.value = n.width, c.value = n.height);
164
+ });
165
+ let u = O(() => W(e), (e) => {
166
+ s.value = e ? n.width : 0, c.value = e ? n.height : 0;
167
+ });
168
+ function d() {
169
+ l(), u();
170
+ }
171
+ return {
172
+ width: s,
173
+ height: c,
174
+ stop: d
175
+ };
186
176
  }
187
- const pe = "20px", M = P(!1), I = P(!1), J = P(!0), V = P(0);
188
- function Pe(e) {
189
- const a = e?.verticalNavRef || P(null), r = e?.innerPanesContainerRef || P(null), t = e?.paneLeftRef || P(null), n = e?.paneCenterRef || P(null), o = e?.paneRightRef || P(null), s = (f) => {
190
- switch (f) {
191
- case "verticalNav":
192
- return a.value?.offsetWidth || 0;
193
- case "innerPanesContainer":
194
- return r.value?.offsetWidth || 0;
195
- case "paneLeft":
196
- return t.value?.offsetWidth || 0;
197
- case "paneCenter":
198
- return n.value?.offsetWidth || 0;
199
- case "paneRight":
200
- return o.value?.offsetWidth || 0;
201
- default:
202
- return 0;
203
- }
204
- }, l = P(50), p = P(0), h = P(0), c = P(0), i = P(0), d = (f) => {
205
- if (n.value) {
206
- if (f) {
207
- n.value.style.width = `${f}%`, V.value = s("paneCenter");
208
- return;
209
- } else (typeof l.value != "number" || !isFinite(l.value)) && (l.value = 38);
210
- n.value.style.width = `${l.value}%`, V.value = s("paneCenter");
211
- }
212
- }, v = () => {
213
- n.value && o.value?.style.display === "none" ? (n.value.style.flex = "1", d(100)) : (n.value && (n.value.style.flex = ""), d());
214
- }, g = () => {
215
- if (!r.value || !n.value) return;
216
- const f = 100, m = s("innerPanesContainer") - s("verticalNav") - s("paneLeft") - f, k = l.value / 100 * s("innerPanesContainer");
217
- if (k < f ? l.value = f / s("innerPanesContainer") * 100 : k > m && (l.value = m / s("innerPanesContainer") * 100), n.value && o.value && o.value?.style.display === "none") {
218
- d(100);
219
- return;
220
- }
221
- d();
222
- }, W = (f) => {
223
- !n.value || f.button !== 0 || (I.value = !0, p.value = f.clientX, h.value = n.value.offsetWidth || 0);
224
- }, b = (f) => {
225
- if (!I.value || !r.value || !n.value) return;
226
- const m = r.value.offsetWidth, k = f.clientX - p.value, w = (h.value + k) / m * 100, y = 100 / m * 100, X = (m - 100) / m * 100;
227
- l.value = Math.min(Math.max(y, w), X), d();
228
- }, z = () => {
229
- I.value = !1;
230
- }, S = (f) => {
231
- !t.value || !J.value || f.button !== 0 || (M.value = !0, c.value = f.clientX, i.value = t.value.offsetWidth || 0);
232
- }, q = (f) => {
233
- if (!M.value || !t.value) return;
234
- let m = i.value + (f.clientX - c.value);
235
- const k = Number(Ie.replace(/px$/i, "")), H = Number(ae.replace(/px$/i, ""));
236
- m < k && (m = k), m > H && (m = H), t.value.style.width = `${m}px`, c.value = f.clientX, i.value = m, V.value = s("paneCenter");
237
- }, D = () => {
238
- M.value = !1;
239
- }, A = () => {
240
- I.value || g();
241
- }, F = async () => {
242
- J.value = !J.value;
243
- };
244
- return j(window, "resize", A), ee(async () => {
245
- await G(), n.value && (g(), await G(), d(), requestAnimationFrame(() => {
246
- V.value = s("paneCenter");
247
- }));
248
- }), j(document, "mousemove", (f) => {
249
- I.value && b(f), M.value && q(f);
250
- }), j(document, "mouseup", () => {
251
- I.value && z(), M.value && D();
252
- }), {
253
- isDraggingPaneLeft: te(M),
254
- isDraggingInnerPanes: te(I),
255
- startDraggingInnerPanes: W,
256
- refreshInnerPaneSizes: v,
257
- // Toggle the left pane
258
- paneLeftExpanded: te(J),
259
- togglePaneLeft: F,
260
- startDraggingPaneLeft: S,
261
- centerPaneWidth: V
262
- };
177
+ // ../../../node_modules/.pnpm/@kong+design-tokens@3.5.1/node_modules/@kong/design-tokens/dist/tokens/js/index.mjs
178
+ var J = "20px", Y = g(!1), X = g(!1), Z = g(!0), Q = g(0);
179
+ function fe(e) {
180
+ let t = e?.verticalNavRef || g(null), n = e?.innerPanesContainerRef || g(null), r = e?.paneLeftRef || g(null), i = e?.paneCenterRef || g(null), a = e?.paneRightRef || g(null), o = (e) => {
181
+ switch (e) {
182
+ case "verticalNav": return t.value?.offsetWidth || 0;
183
+ case "innerPanesContainer": return n.value?.offsetWidth || 0;
184
+ case "paneLeft": return r.value?.offsetWidth || 0;
185
+ case "paneCenter": return i.value?.offsetWidth || 0;
186
+ case "paneRight": return a.value?.offsetWidth || 0;
187
+ default: return 0;
188
+ }
189
+ }, s = g(50), c = g(0), l = g(0), d = g(0), p = g(0), m = (e) => {
190
+ if (i.value) {
191
+ if (e) {
192
+ i.value.style.width = `${e}%`, Q.value = o("paneCenter");
193
+ return;
194
+ }
195
+ typeof s.value == "number" && isFinite(s.value) || (s.value = 38), i.value.style.width = `${s.value}%`, Q.value = o("paneCenter");
196
+ }
197
+ }, _ = () => {
198
+ i.value && a.value?.style.display === "none" ? (i.value.style.flex = "1", m(100)) : (i.value && (i.value.style.flex = ""), m());
199
+ }, v = () => {
200
+ if (!n.value || !i.value) return;
201
+ let e = o("innerPanesContainer") - o("verticalNav") - o("paneLeft") - 100, t = s.value / 100 * o("innerPanesContainer");
202
+ t < 100 ? s.value = 100 / o("innerPanesContainer") * 100 : t > e && (s.value = e / o("innerPanesContainer") * 100), i.value && a.value && a.value?.style.display === "none" ? m(100) : m();
203
+ }, y = (e) => {
204
+ i.value && e.button === 0 && (X.value = !0, c.value = e.clientX, l.value = i.value.offsetWidth || 0);
205
+ }, b = (e) => {
206
+ if (!X.value || !n.value || !i.value) return;
207
+ let t = n.value.offsetWidth, r = e.clientX - c.value, a = (l.value + r) / t * 100, o = 100 / t * 100, u = (t - 100) / t * 100;
208
+ s.value = Math.min(Math.max(o, a), u), m();
209
+ }, x = () => {
210
+ X.value = !1;
211
+ }, S = (e) => {
212
+ r.value && Z.value && e.button === 0 && (Y.value = !0, d.value = e.clientX, p.value = r.value.offsetWidth || 0);
213
+ }, C = (e) => {
214
+ if (!Y.value || !r.value) return;
215
+ let t = p.value + (e.clientX - d.value), n = Number(L.replace(/px$/i, "")), i = Number(R.replace(/px$/i, ""));
216
+ t < n && (t = n), t > i && (t = i), r.value.style.width = `${t}px`, d.value = e.clientX, p.value = t, Q.value = o("paneCenter");
217
+ }, w = () => {
218
+ Y.value = !1;
219
+ };
220
+ return G(window, "resize", () => {
221
+ X.value || v();
222
+ }), f(async () => {
223
+ await u(), i.value && (v(), await u(), m(), requestAnimationFrame(() => {
224
+ Q.value = o("paneCenter");
225
+ }));
226
+ }), G(document, "mousemove", (e) => {
227
+ X.value && b(e), Y.value && C(e);
228
+ }), G(document, "mouseup", () => {
229
+ X.value && x(), Y.value && w();
230
+ }), {
231
+ isDraggingPaneLeft: h(Y),
232
+ isDraggingInnerPanes: h(X),
233
+ startDraggingInnerPanes: y,
234
+ refreshInnerPaneSizes: _,
235
+ paneLeftExpanded: h(Z),
236
+ togglePaneLeft: async () => {
237
+ Z.value = !Z.value;
238
+ },
239
+ startDraggingPaneLeft: S,
240
+ centerPaneWidth: Q
241
+ };
263
242
  }
264
- const Ue = { return: "Return", collapse_panel: "Collapse panel", expand_panel: "Expand panel", drag_to_resize: "Click and drag to resize" }, je = {
265
- actions: Ue
266
- };
267
- function Re() {
268
- const e = De("en-us", je);
269
- return {
270
- i18n: e,
271
- i18nT: $e(e)
272
- // Translation component <i18n-t>
273
- };
243
+ var pe = { actions: {
244
+ return: "Return",
245
+ collapse_panel: "Collapse panel",
246
+ expand_panel: "Expand panel",
247
+ drag_to_resize: "Click and drag to resize"
248
+ } };
249
+ // src/composable/useI18n.ts
250
+ function me() {
251
+ let e = F("en-us", pe);
252
+ return {
253
+ i18n: e,
254
+ i18nT: I(e)
255
+ };
274
256
  }
275
- const Ge = { class: "kong-ui-public-split-pane-vertical-navigation" }, Ye = { class: "split-pane-nav" }, qe = { class: "top" }, Ze = { class: "bottom" }, Je = /* @__PURE__ */ ge({
276
- __name: "VerticalNavigation",
277
- props: {
278
- paneLeftWidth: { default: 0 },
279
- paneLeftVisible: { type: Boolean, default: !0 },
280
- items: { default: () => [] }
281
- },
282
- setup(e) {
283
- be((d) => ({
284
- eaa86402: c.value
285
- }));
286
- const { i18n: a } = Re(), r = ze(), { paneLeftExpanded: t, togglePaneLeft: n, isDraggingPaneLeft: o, isDraggingInnerPanes: s } = Pe(), l = P(!1), p = P(!1), h = R(() => l.value || o.value || s.value), c = R(() => `${e.paneLeftWidth - 8}px`), i = (d) => {
287
- t.value || n(), !d.active && d.to && r.push(d.to);
288
- };
289
- return ee(async () => {
290
- await G(), await new Promise((d) => setTimeout(d, 500)), p.value = !0;
291
- }), (d, v) => {
292
- const g = oe("KButton"), W = oe("KTooltip");
293
- return x(), L("div", Ge, [
294
- C("nav", Ye, [
295
- C("div", qe, [
296
- (x(!0), L(we, null, ye(e.items, (b) => (x(), K(W, {
297
- key: b.tooltip,
298
- "kpop-attributes": { offset: "10px" },
299
- label: b.tooltip,
300
- placement: "right"
301
- }, {
302
- default: Z(() => [
303
- le(g, {
304
- appearance: "none",
305
- "aria-label": b.tooltip,
306
- class: N(["split-pane-nav-item", { active: b.active }]),
307
- "data-testid": `kong-ui-public-split-pane-vertical-navigation-nav-item-${b.testid}`,
308
- icon: "",
309
- size: "large",
310
- style: { cursor: "pointer" },
311
- to: b.to,
312
- onClickCapture: ne((z) => i(b), ["prevent"])
313
- }, {
314
- default: Z(() => [
315
- (x(), K(re(b.icon), {
316
- decorative: "",
317
- size: `var(--kui-icon-size-40, ${u(pe)})`
318
- }, null, 8, ["size"]))
319
- ]),
320
- _: 2
321
- }, 1032, ["aria-label", "class", "data-testid", "to", "onClickCapture"])
322
- ]),
323
- _: 2
324
- }, 1032, ["label"]))), 128))
325
- ]),
326
- C("div", Ze, [
327
- e.paneLeftVisible ? (x(), L("div", {
328
- key: 0,
329
- class: N(["toggle-left-panel-control", {
330
- expanded: u(t),
331
- "disable-animation": !p.value || u(o) || u(s)
332
- }]),
333
- onTransitionend: v[0] || (v[0] = ne((b) => l.value = !1, ["self"])),
334
- onTransitionstart: v[1] || (v[1] = ne((b) => l.value = !0, ["self"]))
335
- }, [
336
- (x(), K(W, {
337
- key: String(u(t)),
338
- "kpop-attributes": u(t) ? void 0 : { offset: "10px" },
339
- label: h.value ? void 0 : u(t) ? u(a).t("actions.collapse_panel") : u(a).t("actions.expand_panel"),
340
- placement: u(t) ? "left" : "right"
341
- }, {
342
- default: Z(() => [
343
- le(g, {
344
- appearance: "none",
345
- "aria-controls": "left-pane",
346
- "aria-expanded": u(t),
347
- "aria-label": u(t) ? u(a).t("actions.collapse_panel") : u(a).t("actions.expand_panel"),
348
- class: "split-pane-nav-item toggle-left-panel",
349
- "data-testid": "kong-ui-public-split-pane-toggle-left-panel-button",
350
- icon: "",
351
- size: "large",
352
- onClick: u(n)
353
- }, {
354
- default: Z(() => [
355
- (x(), K(re(u(t) ? u(_e) : u(ke)), {
356
- decorative: "",
357
- size: `var(--kui-icon-size-40, ${u(pe)})`
358
- }, null, 8, ["size"]))
359
- ]),
360
- _: 1
361
- }, 8, ["aria-expanded", "aria-label", "onClick"])
362
- ]),
363
- _: 1
364
- }, 8, ["kpop-attributes", "label", "placement"]))
365
- ], 34)) : E("", !0)
366
- ])
367
- ])
368
- ]);
369
- };
370
- }
371
- }), se = (e, a) => {
372
- const r = e.__vccOpts || e;
373
- for (const [t, n] of a)
374
- r[t] = n;
375
- return r;
376
- }, Qe = /* @__PURE__ */ se(Je, [["__scopeId", "data-v-59e8017f"]]), et = { class: "split-pane-container" }, tt = { class: "split-pane-container-inner" }, nt = { class: "panes" }, at = ["aria-hidden", "tabindex"], it = ["title"], st = { class: "split-pane-container-inner-content" }, ot = ["aria-hidden", "tabindex"], lt = ["title"], rt = ["aria-hidden", "tabindex"], ut = /* @__PURE__ */ ge({
377
- __name: "SplitPane",
378
- props: {
379
- resizable: { type: Boolean, default: !0 },
380
- showResizeHandle: { type: Boolean, default: !0 },
381
- showNavigation: { type: Boolean, default: !0 },
382
- navigationItems: { default: () => [] },
383
- paneLeft: { default: () => ({
384
- /** Pass false to hide the panel even if it contains slot content */
385
- visible: !0,
386
- maxWidth: ae
387
- }) },
388
- paneCenter: { default: () => ({
389
- /** Pass false to hide the panel even if it contains slot content */
390
- visible: !0,
391
- maxWidth: ce
392
- }) },
393
- paneRight: { default: () => ({
394
- /** Pass false to hide the panel even if it contains slot content */
395
- visible: !0,
396
- maxWidth: fe
397
- }) }
398
- },
399
- setup(e) {
400
- be((w) => ({
401
- v1300c9c8: t.value,
402
- v183c98aa: n.value,
403
- bf8b5faa: o.value
404
- }));
405
- const a = Le(), r = (w) => w === "left" ? e.paneLeft.maxWidth !== void 0 ? e.paneLeft.maxWidth : ae : w === "center" ? e.resizable ? "none" : e.paneCenter.maxWidth !== void 0 ? e.paneCenter.maxWidth : ce : w === "right" ? e.resizable ? "none" : e.paneRight.maxWidth !== void 0 ? e.paneRight.maxWidth : fe : "none", t = R(() => r("left")), n = R(() => r("center")), o = R(() => r("right")), s = $("verticalNavRef"), l = $("innerPanesContainerRef"), p = $("paneLeftRef"), h = $("paneCenterRef"), c = $("paneRightRef"), i = $("paneLeftDivider"), d = $("innerPanesDivider"), { startDraggingInnerPanes: v, startDraggingPaneLeft: g, refreshInnerPaneSizes: W, paneLeftExpanded: b, isDraggingPaneLeft: z, isDraggingInnerPanes: S } = Pe({
406
- verticalNavRef: s,
407
- innerPanesContainerRef: l,
408
- paneLeftRef: p,
409
- paneCenterRef: h,
410
- paneRightRef: c
411
- }), { i18n: q } = Re(), D = R(() => !!a["pane-left"] && e.paneLeft.visible !== !1 && b.value), A = R(() => !!a["pane-center"] && e.paneCenter.visible !== !1), F = R(() => !!a["pane-right"] && e.paneRight.visible !== !1), f = R(() => e.resizable && e.showResizeHandle && !!a["pane-center"] && e.paneCenter.visible !== !1 && !!a["pane-right"] && e.paneRight.visible !== !1), m = ve(i), k = ve(d), { width: H } = Ke(p);
412
- return Y(() => e.paneRight.visible, async () => {
413
- e.resizable && (await G(), W());
414
- }, { flush: "post" }), (w, y) => (x(), L("div", {
415
- class: N(["kong-ui-public-split-pane", { "has-navigation": e.showNavigation }]),
416
- "data-testid": "split-pane"
417
- }, [
418
- C("div", et, [
419
- e.showNavigation ? (x(), K(Qe, {
420
- key: 0,
421
- ref_key: "verticalNavRef",
422
- ref: s,
423
- items: e.navigationItems,
424
- "pane-left-visible": e.paneLeft.visible !== !1,
425
- "pane-left-width": u(H)
426
- }, null, 8, ["items", "pane-left-visible", "pane-left-width"])) : E("", !0),
427
- C("div", tt, [
428
- C("div", nt, [
429
- C("div", {
430
- ref_key: "paneLeftRef",
431
- ref: p,
432
- "aria-hidden": D.value ? void 0 : "true",
433
- class: N(["split-pane-left", [{ expanded: u(b), "show-resize-border": u(m) }, { "is-dragging-pane-left": u(z) }, { "is-dragging-pane": u(z) || u(S) }]]),
434
- "data-testid": "split-pane-left",
435
- tabindex: D.value ? 0 : -1
436
- }, [
437
- T(w.$slots, "pane-left", {}, void 0, !0)
438
- ], 10, at),
439
- D.value ? (x(), L("div", {
440
- key: 0,
441
- ref_key: "paneLeftDivider",
442
- ref: i,
443
- class: "split-pane-resize-divider left",
444
- "data-testid": "split-pane-resize-divider-left",
445
- tabindex: "0",
446
- title: u(q).t("actions.drag_to_resize"),
447
- onMousedown: y[0] || (y[0] = //@ts-ignore
448
- (...X) => u(g) && u(g)(...X))
449
- }, [...y[2] || (y[2] = [
450
- C("div", { class: "split-pane-drag-handle" }, null, -1)
451
- ])], 40, it)) : E("", !0),
452
- C("div", st, [
453
- a.toolbar ? (x(), L("div", {
454
- key: 0,
455
- class: N(["split-pane-toolbar-container", { "has-resize-divider-left": D.value }]),
456
- "data-testid": "split-pane-toolbar"
457
- }, [
458
- T(w.$slots, "toolbar", {}, void 0, !0)
459
- ], 2)) : E("", !0),
460
- C("div", {
461
- ref_key: "innerPanesContainerRef",
462
- ref: l,
463
- class: "split-pane-inner-panes"
464
- }, [
465
- ue(C("div", {
466
- ref_key: "paneCenterRef",
467
- ref: h,
468
- "aria-hidden": A.value ? void 0 : "true",
469
- class: N(["split-pane-center", [{ "has-resize-divider-left": D.value }, { "has-resize-divider-right": f.value }, { "is-dragging-pane": u(z) || u(S) }]]),
470
- "data-testid": "split-pane-center",
471
- tabindex: A.value ? 0 : -1
472
- }, [
473
- T(w.$slots, "pane-center", {}, void 0, !0)
474
- ], 10, ot), [
475
- [de, A.value]
476
- ]),
477
- f.value ? (x(), L("div", {
478
- key: 0,
479
- ref_key: "innerPanesDivider",
480
- ref: d,
481
- class: "split-pane-resize-divider right",
482
- "data-testid": "split-pane-resize-divider-right",
483
- tabindex: "0",
484
- title: u(q).t("actions.drag_to_resize"),
485
- onMousedown: y[1] || (y[1] = //@ts-ignore
486
- (...X) => u(v) && u(v)(...X))
487
- }, [...y[3] || (y[3] = [
488
- C("div", { class: "split-pane-drag-handle" }, null, -1)
489
- ])], 40, lt)) : E("", !0),
490
- ue(C("div", {
491
- ref_key: "paneRightRef",
492
- ref: c,
493
- "aria-hidden": F.value ? void 0 : "true",
494
- class: N(["split-pane-right", [
495
- { "has-toolbar": !!a.toolbar },
496
- { "show-resize-border": u(k) },
497
- { "is-dragging-inner-panes": u(S) },
498
- { "is-dragging-pane": u(z) || u(S) }
499
- ]]),
500
- "data-testid": "split-pane-right",
501
- tabindex: F.value ? 0 : -1
502
- }, [
503
- T(w.$slots, "pane-right", {}, void 0, !0)
504
- ], 10, rt), [
505
- [de, F.value]
506
- ])
507
- ], 512)
508
- ])
509
- ])
510
- ])
511
- ])
512
- ], 2));
513
- }
514
- }), Rt = /* @__PURE__ */ se(ut, [["__scopeId", "data-v-a19fbade"]]), dt = {}, ct = {
515
- class: "kong-ui-public-split-pane-toolbar",
516
- "data-testid": "kong-ui-public-split-pane-toolbar"
517
- }, ft = {
518
- class: "left",
519
- "data-testid": "split-toolbar-left"
520
- }, vt = {
521
- key: 0,
522
- class: "center",
523
- "data-testid": "split-toolbar-center"
524
- }, pt = {
525
- key: 1,
526
- class: "right",
527
- "data-testid": "split-toolbar-right"
257
+ // src/components/VerticalNavigation.vue?vue&type=script&setup=true&lang.ts
258
+ var he = { class: "kong-ui-public-split-pane-vertical-navigation" }, ge = { class: "split-pane-nav" }, _e = { class: "top" }, ve = { class: "bottom" }, ye = /*@__PURE__*/ s({
259
+ __name: "VerticalNavigation",
260
+ props: {
261
+ paneLeftWidth: { default: 0 },
262
+ paneLeftVisible: {
263
+ type: Boolean,
264
+ default: !0
265
+ },
266
+ items: { default: () => [] }
267
+ },
268
+ setup(s) {
269
+ w((e) => ({ eaa86402: D.value }));
270
+ let { i18n: c } = me(), l = P(), { paneLeftExpanded: p, togglePaneLeft: h, isDraggingPaneLeft: v, isDraggingInnerPanes: x } = fe(), S = g(!1), T = g(!1), E = t(() => S.value || v.value || x.value), D = t(() => `${s.paneLeftWidth - 8}px`), O = (e) => {
271
+ p.value || h(), !e.active && e.to && l.push(e.to);
272
+ };
273
+ return f(async () => {
274
+ await u(), await new Promise((e) => setTimeout(e, 500)), T.value = !0;
275
+ }), (t, l) => {
276
+ let u = y("KButton"), f = y("KTooltip");
277
+ return m(), i("div", he, [a("nav", ge, [a("div", _e, [(m(!0), i(e, null, _(s.items, (e) => (m(), n(f, {
278
+ key: e.tooltip,
279
+ "kpop-attributes": { offset: "10px" },
280
+ label: e.tooltip,
281
+ placement: "right"
282
+ }, {
283
+ default: A(() => [o(u, {
284
+ appearance: "none",
285
+ "aria-label": e.tooltip,
286
+ class: d(["split-pane-nav-item", { active: e.active }]),
287
+ "data-testid": `kong-ui-public-split-pane-vertical-navigation-nav-item-${e.testid}`,
288
+ icon: "",
289
+ size: "large",
290
+ style: { cursor: "pointer" },
291
+ to: e.to,
292
+ onClickCapture: j((t) => O(e), ["prevent"])
293
+ }, {
294
+ default: A(() => [(m(), n(b(e.icon), {
295
+ decorative: "",
296
+ size: `var(--kui-icon-size-40, ${C(J)})`
297
+ }, null, 8, ["size"]))]),
298
+ _: 2
299
+ }, 1032, [
300
+ "aria-label",
301
+ "class",
302
+ "data-testid",
303
+ "to",
304
+ "onClickCapture"
305
+ ])]),
306
+ _: 2
307
+ }, 1032, ["label"]))), 128))]), a("div", ve, [s.paneLeftVisible ? (m(), i("div", {
308
+ key: 0,
309
+ class: d(["toggle-left-panel-control", {
310
+ expanded: C(p),
311
+ "disable-animation": !T.value || C(v) || C(x)
312
+ }]),
313
+ onTransitionend: l[0] ||= j((e) => S.value = !1, ["self"]),
314
+ onTransitionstart: l[1] ||= j((e) => S.value = !0, ["self"])
315
+ }, [(m(), n(f, {
316
+ key: String(C(p)),
317
+ "kpop-attributes": C(p) ? void 0 : { offset: "10px" },
318
+ label: E.value ? void 0 : C(p) ? C(c).t("actions.collapse_panel") : C(c).t("actions.expand_panel"),
319
+ placement: C(p) ? "left" : "right"
320
+ }, {
321
+ default: A(() => [o(u, {
322
+ appearance: "none",
323
+ "aria-controls": "left-pane",
324
+ "aria-expanded": C(p),
325
+ "aria-label": C(p) ? C(c).t("actions.collapse_panel") : C(c).t("actions.expand_panel"),
326
+ class: "split-pane-nav-item toggle-left-panel",
327
+ "data-testid": "kong-ui-public-split-pane-toggle-left-panel-button",
328
+ icon: "",
329
+ size: "large",
330
+ onClick: C(h)
331
+ }, {
332
+ default: A(() => [(m(), n(b(C(p) ? C(M) : C(N)), {
333
+ decorative: "",
334
+ size: `var(--kui-icon-size-40, ${C(J)})`
335
+ }, null, 8, ["size"]))]),
336
+ _: 1
337
+ }, 8, [
338
+ "aria-expanded",
339
+ "aria-label",
340
+ "onClick"
341
+ ])]),
342
+ _: 1
343
+ }, 8, [
344
+ "kpop-attributes",
345
+ "label",
346
+ "placement"
347
+ ]))], 34)) : r("", !0)])])]);
348
+ };
349
+ }
350
+ }), $ = (e, t) => {
351
+ let n = e.__vccOpts || e;
352
+ for (let [e, r] of t) n[e] = r;
353
+ return n;
354
+ }, be = /*#__PURE__*/ $(ye, [["__scopeId", "data-v-59e8017f"]]), xe = { class: "split-pane-container" }, Se = { class: "split-pane-container-inner" }, Ce = { class: "panes" }, we = ["aria-hidden", "tabindex"], Te = ["title"], Ee = { class: "split-pane-container-inner-content" }, De = ["aria-hidden", "tabindex"], Oe = ["title"], ke = ["aria-hidden", "tabindex"], Ae = /*#__PURE__*/ $(/* @__PURE__ */ s({
355
+ __name: "SplitPane",
356
+ props: {
357
+ resizable: {
358
+ type: Boolean,
359
+ default: !0
360
+ },
361
+ showResizeHandle: {
362
+ type: Boolean,
363
+ default: !0
364
+ },
365
+ showNavigation: {
366
+ type: Boolean,
367
+ default: !0
368
+ },
369
+ navigationItems: { default: () => [] },
370
+ paneLeft: { default: () => ({
371
+ visible: !0,
372
+ maxWidth: R
373
+ }) },
374
+ paneCenter: { default: () => ({
375
+ visible: !0,
376
+ maxWidth: "50%"
377
+ }) },
378
+ paneRight: { default: () => ({
379
+ visible: !0,
380
+ maxWidth: "50%"
381
+ }) }
382
+ },
383
+ setup(e) {
384
+ w((e) => ({
385
+ v1300c9c8: c.value,
386
+ v183c98aa: l.value,
387
+ bf8b5faa: f.value
388
+ }));
389
+ let o = T(), s = (t) => t === "left" ? e.paneLeft.maxWidth === void 0 ? R : e.paneLeft.maxWidth : t === "center" ? e.resizable ? "none" : e.paneCenter.maxWidth === void 0 ? "50%" : e.paneCenter.maxWidth : t === "right" ? e.resizable ? "none" : e.paneRight.maxWidth === void 0 ? "50%" : e.paneRight.maxWidth : "none", c = t(() => s("left")), l = t(() => s("center")), f = t(() => s("right")), p = E("verticalNavRef"), h = E("innerPanesContainerRef"), g = E("paneLeftRef"), _ = E("paneCenterRef"), y = E("paneRightRef"), b = E("paneLeftDivider"), x = E("innerPanesDivider"), { startDraggingInnerPanes: S, startDraggingPaneLeft: k, refreshInnerPaneSizes: A, paneLeftExpanded: j, isDraggingPaneLeft: M, isDraggingInnerPanes: N } = fe({
390
+ verticalNavRef: p,
391
+ innerPanesContainerRef: h,
392
+ paneLeftRef: g,
393
+ paneCenterRef: _,
394
+ paneRightRef: y
395
+ }), { i18n: P } = me(), F = t(() => !!o["pane-left"] && e.paneLeft.visible !== !1 && j.value), I = t(() => !!o["pane-center"] && e.paneCenter.visible !== !1), L = t(() => !!o["pane-right"] && e.paneRight.visible !== !1), z = t(() => e.resizable && e.showResizeHandle && !!o["pane-center"] && e.paneCenter.visible !== !1 && !!o["pane-right"] && e.paneRight.visible !== !1), B = q(b), V = q(x), { width: te } = de(g);
396
+ return O(() => e.paneRight.visible, async () => {
397
+ e.resizable && (await u(), A());
398
+ }, { flush: "post" }), (t, s) => (m(), i("div", {
399
+ class: d(["kong-ui-public-split-pane", { "has-navigation": e.showNavigation }]),
400
+ "data-testid": "split-pane"
401
+ }, [a("div", xe, [e.showNavigation ? (m(), n(be, {
402
+ key: 0,
403
+ ref_key: "verticalNavRef",
404
+ ref: p,
405
+ items: e.navigationItems,
406
+ "pane-left-visible": e.paneLeft.visible !== !1,
407
+ "pane-left-width": C(te)
408
+ }, null, 8, [
409
+ "items",
410
+ "pane-left-visible",
411
+ "pane-left-width"
412
+ ])) : r("", !0), a("div", Se, [a("div", Ce, [
413
+ a("div", {
414
+ ref_key: "paneLeftRef",
415
+ ref: g,
416
+ "aria-hidden": F.value ? void 0 : "true",
417
+ class: d(["split-pane-left", [
418
+ {
419
+ expanded: C(j),
420
+ "show-resize-border": C(B)
421
+ },
422
+ { "is-dragging-pane-left": C(M) },
423
+ { "is-dragging-pane": C(M) || C(N) }
424
+ ]]),
425
+ "data-testid": "split-pane-left",
426
+ tabindex: F.value ? 0 : -1
427
+ }, [v(t.$slots, "pane-left", {}, void 0, !0)], 10, we),
428
+ F.value ? (m(), i("div", {
429
+ key: 0,
430
+ ref_key: "paneLeftDivider",
431
+ ref: b,
432
+ class: "split-pane-resize-divider left",
433
+ "data-testid": "split-pane-resize-divider-left",
434
+ tabindex: "0",
435
+ title: C(P).t("actions.drag_to_resize"),
436
+ onMousedown: s[0] ||= (...e) => C(k) && C(k)(...e)
437
+ }, [...s[2] ||= [a("div", { class: "split-pane-drag-handle" }, null, -1)]], 40, Te)) : r("", !0),
438
+ a("div", Ee, [o.toolbar ? (m(), i("div", {
439
+ key: 0,
440
+ class: d(["split-pane-toolbar-container", { "has-resize-divider-left": F.value }]),
441
+ "data-testid": "split-pane-toolbar"
442
+ }, [v(t.$slots, "toolbar", {}, void 0, !0)], 2)) : r("", !0), a("div", {
443
+ ref_key: "innerPanesContainerRef",
444
+ ref: h,
445
+ class: "split-pane-inner-panes"
446
+ }, [
447
+ ee(a("div", {
448
+ ref_key: "paneCenterRef",
449
+ ref: _,
450
+ "aria-hidden": I.value ? void 0 : "true",
451
+ class: d(["split-pane-center", [
452
+ { "has-resize-divider-left": F.value },
453
+ { "has-resize-divider-right": z.value },
454
+ { "is-dragging-pane": C(M) || C(N) }
455
+ ]]),
456
+ "data-testid": "split-pane-center",
457
+ tabindex: I.value ? 0 : -1
458
+ }, [v(t.$slots, "pane-center", {}, void 0, !0)], 10, De), [[D, I.value]]),
459
+ z.value ? (m(), i("div", {
460
+ key: 0,
461
+ ref_key: "innerPanesDivider",
462
+ ref: x,
463
+ class: "split-pane-resize-divider right",
464
+ "data-testid": "split-pane-resize-divider-right",
465
+ tabindex: "0",
466
+ title: C(P).t("actions.drag_to_resize"),
467
+ onMousedown: s[1] ||= (...e) => C(S) && C(S)(...e)
468
+ }, [...s[3] ||= [a("div", { class: "split-pane-drag-handle" }, null, -1)]], 40, Oe)) : r("", !0),
469
+ ee(a("div", {
470
+ ref_key: "paneRightRef",
471
+ ref: y,
472
+ "aria-hidden": L.value ? void 0 : "true",
473
+ class: d(["split-pane-right", [
474
+ { "has-toolbar": !!o.toolbar },
475
+ { "show-resize-border": C(V) },
476
+ { "is-dragging-inner-panes": C(N) },
477
+ { "is-dragging-pane": C(M) || C(N) }
478
+ ]]),
479
+ "data-testid": "split-pane-right",
480
+ tabindex: L.value ? 0 : -1
481
+ }, [v(t.$slots, "pane-right", {}, void 0, !0)], 10, ke), [[D, L.value]])
482
+ ], 512)])
483
+ ])])])], 2));
484
+ }
485
+ }), [["__scopeId", "data-v-a19fbade"]]), je = {}, Me = {
486
+ class: "kong-ui-public-split-pane-toolbar",
487
+ "data-testid": "kong-ui-public-split-pane-toolbar"
488
+ }, Ne = {
489
+ class: "left",
490
+ "data-testid": "split-toolbar-left"
491
+ }, Pe = {
492
+ key: 0,
493
+ class: "center",
494
+ "data-testid": "split-toolbar-center"
495
+ }, Fe = {
496
+ key: 1,
497
+ class: "right",
498
+ "data-testid": "split-toolbar-right"
528
499
  };
529
- function ht(e, a) {
530
- return x(), L("div", ct, [
531
- C("div", ft, [
532
- T(e.$slots, "left", {}, void 0, !0)
533
- ]),
534
- e.$slots.center ? (x(), L("div", vt, [
535
- T(e.$slots, "center", {}, void 0, !0)
536
- ])) : E("", !0),
537
- e.$slots.right ? (x(), L("div", pt, [
538
- T(e.$slots, "right", {}, void 0, !0)
539
- ])) : E("", !0)
540
- ]);
500
+ function Ie(e, t) {
501
+ return m(), i("div", Me, [
502
+ a("div", Ne, [v(e.$slots, "left", {}, void 0, !0)]),
503
+ e.$slots.center ? (m(), i("div", Pe, [v(e.$slots, "center", {}, void 0, !0)])) : r("", !0),
504
+ e.$slots.right ? (m(), i("div", Fe, [v(e.$slots, "right", {}, void 0, !0)])) : r("", !0)
505
+ ]);
541
506
  }
542
- const xt = /* @__PURE__ */ se(dt, [["render", ht], ["__scopeId", "data-v-44b95676"]]);
543
- export {
544
- Rt as SplitPane,
545
- xt as SplitToolbar
546
- };
507
+ var Le = /*#__PURE__*/ $(je, [["render", Ie], ["__scopeId", "data-v-44b95676"]]);
508
+ export { Ae as SplitPane, Le as SplitToolbar };
@@ -1 +1 @@
1
- (function(C,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong/icons"),require("vue-router"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","vue-router","@kong-ui-public/i18n"],e):(C=typeof globalThis<"u"?globalThis:C||self,e(C["kong-ui-public-split-pane"]={},C.Vue,C.KongIcons,C.VueRouter,C["kong-ui-public-i18n"]))})(this,(function(C,e,O,Y,X){"use strict";const Z="260px",A="500px";function F(t,i){return e.getCurrentScope()?(e.onScopeDispose(t,i),!0):!1}const J=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Q=t=>t!=null,ee=Object.prototype.toString,te=t=>ee.call(t)==="[object Object]",ne=()=>{};function L(t){return Array.isArray(t)?t:[t]}function ae(t){return e.getCurrentInstance()}function ie(t,i=!0,c){ae()?e.onMounted(t,c):i?t():e.nextTick(t)}function oe(t,i,c){return e.watch(t,i,{...c,immediate:!0})}const y=J?window:void 0;function P(t){var i;const c=e.toValue(t);return(i=c?.$el)!==null&&i!==void 0?i:c}function z(...t){const i=(n,a,l,s)=>(n.addEventListener(a,l,s),()=>n.removeEventListener(a,l,s)),c=e.computed(()=>{const n=L(e.toValue(t[0])).filter(a=>a!=null);return n.every(a=>typeof a!="string")?n:void 0});return oe(()=>{var n,a;return[(n=(a=c.value)===null||a===void 0?void 0:a.map(l=>P(l)))!==null&&n!==void 0?n:[y].filter(l=>l!=null),L(e.toValue(c.value?t[1]:t[0])),L(e.unref(c.value?t[2]:t[1])),e.toValue(c.value?t[3]:t[2])]},([n,a,l,s],r,h)=>{if(!n?.length||!a?.length||!l?.length)return;const g=te(s)?{...s}:s,f=n.flatMap(o=>a.flatMap(d=>l.map(u=>i(o,d,u,g))));h(()=>{f.forEach(o=>o())})},{flush:"post"})}function se(){const t=e.shallowRef(!1),i=e.getCurrentInstance();return i&&e.onMounted(()=>{t.value=!0},i),t}function U(t){const i=se();return e.computed(()=>(i.value,!!t()))}function le(t,i,c={}){const{window:n=y,...a}=c;let l;const s=U(()=>n&&"MutationObserver"in n),r=()=>{l&&(l.disconnect(),l=void 0)},h=e.watch(e.computed(()=>{const o=L(e.toValue(t)).map(P).filter(Q);return new Set(o)}),o=>{r(),s.value&&o.size&&(l=new MutationObserver(i),o.forEach(d=>l.observe(d,a)))},{immediate:!0,flush:"post"}),g=()=>l?.takeRecords(),f=()=>{h(),r()};return F(f),{isSupported:s,stop:f,takeRecords:g}}function re(t,i,c={}){const{window:n=y,document:a=n?.document,flush:l="sync"}=c;if(!n||!a)return ne;let s;const r=f=>{s?.(),s=f},h=e.watchEffect(()=>{const f=P(t);if(f){const{stop:o}=le(a,d=>{d.map(u=>[...u.removedNodes]).flat().some(u=>u===f||u.contains(f))&&i(d)},{window:n,childList:!0,subtree:!0});r(o)}},{flush:l}),g=()=>{h(),r()};return F(g),g}function ce(t,i,c={}){const{window:n=y,...a}=c;let l;const s=U(()=>n&&"ResizeObserver"in n),r=()=>{l&&(l.disconnect(),l=void 0)},h=e.watch(e.computed(()=>{const f=e.toValue(t);return Array.isArray(f)?f.map(o=>P(o)):[P(f)]}),f=>{if(r(),s.value&&n){l=new ResizeObserver(i);for(const o of f)o&&l.observe(o,a)}},{immediate:!0,flush:"post"}),g=()=>{r(),h()};return F(g),{isSupported:s,stop:g}}function j(t,i={}){const{delayEnter:c=0,delayLeave:n=0,triggerOnRemoval:a=!1,window:l=y}=i,s=e.shallowRef(!1);let r;const h=g=>{const f=g?c:n;r&&(clearTimeout(r),r=void 0),f?r=setTimeout(()=>s.value=g,f):s.value=g};return l&&(z(t,"mouseenter",()=>h(!0),{passive:!0}),z(t,"mouseleave",()=>h(!1),{passive:!0}),a&&re(e.computed(()=>P(t)),()=>h(!1))),s}function de(t,i={width:0,height:0},c={}){const{window:n=y,box:a="content-box"}=c,l=e.computed(()=>{var o;return(o=P(t))===null||o===void 0||(o=o.namespaceURI)===null||o===void 0?void 0:o.includes("svg")}),s=e.shallowRef(i.width),r=e.shallowRef(i.height),{stop:h}=ce(t,([o])=>{const d=a==="border-box"?o.borderBoxSize:a==="content-box"?o.contentBoxSize:o.devicePixelContentBoxSize;if(n&&l.value){const u=P(t);if(u){const m=u.getBoundingClientRect();s.value=m.width,r.value=m.height}}else if(d){const u=L(d);s.value=u.reduce((m,{inlineSize:k})=>m+k,0),r.value=u.reduce((m,{blockSize:k})=>m+k,0)}else s.value=o.contentRect.width,r.value=o.contentRect.height},c);ie(()=>{const o=P(t);if(o&&"offsetWidth"in o)if(a==="content-box"&&n){const d=n.getComputedStyle(o),u=Number.parseFloat(d.paddingLeft)+Number.parseFloat(d.paddingRight),m=Number.parseFloat(d.paddingTop)+Number.parseFloat(d.paddingBottom),k=Number.parseFloat(d.borderLeftWidth)+Number.parseFloat(d.borderRightWidth),b=Number.parseFloat(d.borderTopWidth)+Number.parseFloat(d.borderBottomWidth);s.value=o.offsetWidth-u-k,r.value=o.offsetHeight-m-b}else s.value=o.offsetWidth,r.value=o.offsetHeight;else o&&(s.value=i.width,r.value=i.height)});const g=e.watch(()=>P(t),o=>{s.value=o?i.width:0,r.value=o?i.height:0});function f(){h(),g()}return{width:s,height:r,stop:f}}const G="20px",W=e.ref(!1),E=e.ref(!1),S=e.ref(!0),D=e.ref(0);function K(t){const i=t?.verticalNavRef||e.ref(null),c=t?.innerPanesContainerRef||e.ref(null),n=t?.paneLeftRef||e.ref(null),a=t?.paneCenterRef||e.ref(null),l=t?.paneRightRef||e.ref(null),s=p=>{switch(p){case"verticalNav":return i.value?.offsetWidth||0;case"innerPanesContainer":return c.value?.offsetWidth||0;case"paneLeft":return n.value?.offsetWidth||0;case"paneCenter":return a.value?.offsetWidth||0;case"paneRight":return l.value?.offsetWidth||0;default:return 0}},r=e.ref(50),h=e.ref(0),g=e.ref(0),f=e.ref(0),o=e.ref(0),d=p=>{if(a.value){if(p){a.value.style.width=`${p}%`,D.value=s("paneCenter");return}else(typeof r.value!="number"||!isFinite(r.value))&&(r.value=38);a.value.style.width=`${r.value}%`,D.value=s("paneCenter")}},u=()=>{a.value&&l.value?.style.display==="none"?(a.value.style.flex="1",d(100)):(a.value&&(a.value.style.flex=""),d())},m=()=>{if(!c.value||!a.value)return;const p=100,v=s("innerPanesContainer")-s("verticalNav")-s("paneLeft")-p,x=r.value/100*s("innerPanesContainer");if(x<p?r.value=p/s("innerPanesContainer")*100:x>v&&(r.value=v/s("innerPanesContainer")*100),a.value&&l.value&&l.value?.style.display==="none"){d(100);return}d()},k=p=>{!a.value||p.button!==0||(E.value=!0,h.value=p.clientX,g.value=a.value.offsetWidth||0)},b=p=>{if(!E.value||!c.value||!a.value)return;const v=c.value.offsetWidth,x=p.clientX-h.value,R=(g.value+x)/v*100,w=100/v*100,$=(v-100)/v*100;r.value=Math.min(Math.max(w,R),$),d()},_=()=>{E.value=!1},T=p=>{!n.value||!S.value||p.button!==0||(W.value=!0,f.value=p.clientX,o.value=n.value.offsetWidth||0)},M=p=>{if(!W.value||!n.value)return;let v=o.value+(p.clientX-f.value);const x=Number(Z.replace(/px$/i,"")),V=Number(A.replace(/px$/i,""));v<x&&(v=x),v>V&&(v=V),n.value.style.width=`${v}px`,f.value=p.clientX,o.value=v,D.value=s("paneCenter")},N=()=>{W.value=!1},B=()=>{E.value||m()},I=async()=>{S.value=!S.value};return z(window,"resize",B),e.onMounted(async()=>{await e.nextTick(),a.value&&(m(),await e.nextTick(),d(),requestAnimationFrame(()=>{D.value=s("paneCenter")}))}),z(document,"mousemove",p=>{E.value&&b(p),W.value&&M(p)}),z(document,"mouseup",()=>{E.value&&_(),W.value&&N()}),{isDraggingPaneLeft:e.readonly(W),isDraggingInnerPanes:e.readonly(E),startDraggingInnerPanes:k,refreshInnerPaneSizes:u,paneLeftExpanded:e.readonly(S),togglePaneLeft:I,startDraggingPaneLeft:T,centerPaneWidth:D}}const fe={actions:{return:"Return",collapse_panel:"Collapse panel",expand_panel:"Expand panel",drag_to_resize:"Click and drag to resize"}};function q(){const t=X.createI18n("en-us",fe);return{i18n:t,i18nT:X.i18nTComponent(t)}}const pe={class:"kong-ui-public-split-pane-vertical-navigation"},ue={class:"split-pane-nav"},he={class:"top"},ge={class:"bottom"},me=e.defineComponent({__name:"VerticalNavigation",props:{paneLeftWidth:{default:0},paneLeftVisible:{type:Boolean,default:!0},items:{default:()=>[]}},setup(t){e.useCssVars(d=>({eaa86402:f.value}));const{i18n:i}=q(),c=Y.useRouter(),{paneLeftExpanded:n,togglePaneLeft:a,isDraggingPaneLeft:l,isDraggingInnerPanes:s}=K(),r=e.ref(!1),h=e.ref(!1),g=e.computed(()=>r.value||l.value||s.value),f=e.computed(()=>`${t.paneLeftWidth-8}px`),o=d=>{n.value||a(),!d.active&&d.to&&c.push(d.to)};return e.onMounted(async()=>{await e.nextTick(),await new Promise(d=>setTimeout(d,500)),h.value=!0}),(d,u)=>{const m=e.resolveComponent("KButton"),k=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("nav",ue,[e.createElementVNode("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,b=>(e.openBlock(),e.createBlock(k,{key:b.tooltip,"kpop-attributes":{offset:"10px"},label:b.tooltip,placement:"right"},{default:e.withCtx(()=>[e.createVNode(m,{appearance:"none","aria-label":b.tooltip,class:e.normalizeClass(["split-pane-nav-item",{active:b.active}]),"data-testid":`kong-ui-public-split-pane-vertical-navigation-nav-item-${b.testid}`,icon:"",size:"large",style:{cursor:"pointer"},to:b.to,onClickCapture:e.withModifiers(_=>o(b),["prevent"])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b.icon),{decorative:"",size:`var(--kui-icon-size-40, ${e.unref(G)})`},null,8,["size"]))]),_:2},1032,["aria-label","class","data-testid","to","onClickCapture"])]),_:2},1032,["label"]))),128))]),e.createElementVNode("div",ge,[t.paneLeftVisible?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["toggle-left-panel-control",{expanded:e.unref(n),"disable-animation":!h.value||e.unref(l)||e.unref(s)}]),onTransitionend:u[0]||(u[0]=e.withModifiers(b=>r.value=!1,["self"])),onTransitionstart:u[1]||(u[1]=e.withModifiers(b=>r.value=!0,["self"]))},[(e.openBlock(),e.createBlock(k,{key:String(e.unref(n)),"kpop-attributes":e.unref(n)?void 0:{offset:"10px"},label:g.value?void 0:e.unref(n)?e.unref(i).t("actions.collapse_panel"):e.unref(i).t("actions.expand_panel"),placement:e.unref(n)?"left":"right"},{default:e.withCtx(()=>[e.createVNode(m,{appearance:"none","aria-controls":"left-pane","aria-expanded":e.unref(n),"aria-label":e.unref(n)?e.unref(i).t("actions.collapse_panel"):e.unref(i).t("actions.expand_panel"),class:"split-pane-nav-item toggle-left-panel","data-testid":"kong-ui-public-split-pane-toggle-left-panel-button",icon:"",size:"large",onClick:e.unref(a)},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)?e.unref(O.ChevronDoubleLeftIcon):e.unref(O.ChevronDoubleRightIcon)),{decorative:"",size:`var(--kui-icon-size-40, ${e.unref(G)})`},null,8,["size"]))]),_:1},8,["aria-expanded","aria-label","onClick"])]),_:1},8,["kpop-attributes","label","placement"]))],34)):e.createCommentVNode("",!0)])])])}}}),H=(t,i)=>{const c=t.__vccOpts||t;for(const[n,a]of i)c[n]=a;return c},be=H(me,[["__scopeId","data-v-59e8017f"]]),ve={class:"split-pane-container"},ke={class:"split-pane-container-inner"},Ce={class:"panes"},Re=["aria-hidden","tabindex"],Pe=["title"],we={class:"split-pane-container-inner-content"},xe=["aria-hidden","tabindex"],Ee=["title"],_e=["aria-hidden","tabindex"],Ne=H(e.defineComponent({__name:"SplitPane",props:{resizable:{type:Boolean,default:!0},showResizeHandle:{type:Boolean,default:!0},showNavigation:{type:Boolean,default:!0},navigationItems:{default:()=>[]},paneLeft:{default:()=>({visible:!0,maxWidth:A})},paneCenter:{default:()=>({visible:!0,maxWidth:"50%"})},paneRight:{default:()=>({visible:!0,maxWidth:"50%"})}},setup(t){e.useCssVars(R=>({v1300c9c8:n.value,v183c98aa:a.value,bf8b5faa:l.value}));const i=e.useSlots(),c=R=>R==="left"?t.paneLeft.maxWidth!==void 0?t.paneLeft.maxWidth:A:R==="center"?t.resizable?"none":t.paneCenter.maxWidth!==void 0?t.paneCenter.maxWidth:"50%":R==="right"?t.resizable?"none":t.paneRight.maxWidth!==void 0?t.paneRight.maxWidth:"50%":"none",n=e.computed(()=>c("left")),a=e.computed(()=>c("center")),l=e.computed(()=>c("right")),s=e.useTemplateRef("verticalNavRef"),r=e.useTemplateRef("innerPanesContainerRef"),h=e.useTemplateRef("paneLeftRef"),g=e.useTemplateRef("paneCenterRef"),f=e.useTemplateRef("paneRightRef"),o=e.useTemplateRef("paneLeftDivider"),d=e.useTemplateRef("innerPanesDivider"),{startDraggingInnerPanes:u,startDraggingPaneLeft:m,refreshInnerPaneSizes:k,paneLeftExpanded:b,isDraggingPaneLeft:_,isDraggingInnerPanes:T}=K({verticalNavRef:s,innerPanesContainerRef:r,paneLeftRef:h,paneCenterRef:g,paneRightRef:f}),{i18n:M}=q(),N=e.computed(()=>!!i["pane-left"]&&t.paneLeft.visible!==!1&&b.value),B=e.computed(()=>!!i["pane-center"]&&t.paneCenter.visible!==!1),I=e.computed(()=>!!i["pane-right"]&&t.paneRight.visible!==!1),p=e.computed(()=>t.resizable&&t.showResizeHandle&&!!i["pane-center"]&&t.paneCenter.visible!==!1&&!!i["pane-right"]&&t.paneRight.visible!==!1),v=j(o),x=j(d),{width:V}=de(h);return e.watch(()=>t.paneRight.visible,async()=>{t.resizable&&(await e.nextTick(),k())},{flush:"post"}),(R,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["kong-ui-public-split-pane",{"has-navigation":t.showNavigation}]),"data-testid":"split-pane"},[e.createElementVNode("div",ve,[t.showNavigation?(e.openBlock(),e.createBlock(be,{key:0,ref_key:"verticalNavRef",ref:s,items:t.navigationItems,"pane-left-visible":t.paneLeft.visible!==!1,"pane-left-width":e.unref(V)},null,8,["items","pane-left-visible","pane-left-width"])):e.createCommentVNode("",!0),e.createElementVNode("div",ke,[e.createElementVNode("div",Ce,[e.createElementVNode("div",{ref_key:"paneLeftRef",ref:h,"aria-hidden":N.value?void 0:"true",class:e.normalizeClass(["split-pane-left",[{expanded:e.unref(b),"show-resize-border":e.unref(v)},{"is-dragging-pane-left":e.unref(_)},{"is-dragging-pane":e.unref(_)||e.unref(T)}]]),"data-testid":"split-pane-left",tabindex:N.value?0:-1},[e.renderSlot(R.$slots,"pane-left",{},void 0,!0)],10,Re),N.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"paneLeftDivider",ref:o,class:"split-pane-resize-divider left","data-testid":"split-pane-resize-divider-left",tabindex:"0",title:e.unref(M).t("actions.drag_to_resize"),onMousedown:w[0]||(w[0]=(...$)=>e.unref(m)&&e.unref(m)(...$))},[...w[2]||(w[2]=[e.createElementVNode("div",{class:"split-pane-drag-handle"},null,-1)])],40,Pe)):e.createCommentVNode("",!0),e.createElementVNode("div",we,[i.toolbar?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["split-pane-toolbar-container",{"has-resize-divider-left":N.value}]),"data-testid":"split-pane-toolbar"},[e.renderSlot(R.$slots,"toolbar",{},void 0,!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"innerPanesContainerRef",ref:r,class:"split-pane-inner-panes"},[e.withDirectives(e.createElementVNode("div",{ref_key:"paneCenterRef",ref:g,"aria-hidden":B.value?void 0:"true",class:e.normalizeClass(["split-pane-center",[{"has-resize-divider-left":N.value},{"has-resize-divider-right":p.value},{"is-dragging-pane":e.unref(_)||e.unref(T)}]]),"data-testid":"split-pane-center",tabindex:B.value?0:-1},[e.renderSlot(R.$slots,"pane-center",{},void 0,!0)],10,xe),[[e.vShow,B.value]]),p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"innerPanesDivider",ref:d,class:"split-pane-resize-divider right","data-testid":"split-pane-resize-divider-right",tabindex:"0",title:e.unref(M).t("actions.drag_to_resize"),onMousedown:w[1]||(w[1]=(...$)=>e.unref(u)&&e.unref(u)(...$))},[...w[3]||(w[3]=[e.createElementVNode("div",{class:"split-pane-drag-handle"},null,-1)])],40,Ee)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"paneRightRef",ref:f,"aria-hidden":I.value?void 0:"true",class:e.normalizeClass(["split-pane-right",[{"has-toolbar":!!i.toolbar},{"show-resize-border":e.unref(x)},{"is-dragging-inner-panes":e.unref(T)},{"is-dragging-pane":e.unref(_)||e.unref(T)}]]),"data-testid":"split-pane-right",tabindex:I.value?0:-1},[e.renderSlot(R.$slots,"pane-right",{},void 0,!0)],10,_e),[[e.vShow,I.value]])],512)])])])])],2))}}),[["__scopeId","data-v-a19fbade"]]),ye={},We={class:"kong-ui-public-split-pane-toolbar","data-testid":"kong-ui-public-split-pane-toolbar"},Te={class:"left","data-testid":"split-toolbar-left"},Le={key:0,class:"center","data-testid":"split-toolbar-center"},ze={key:1,class:"right","data-testid":"split-toolbar-right"};function De(t,i){return e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Te,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),t.$slots.center?(e.openBlock(),e.createElementBlock("div",Le,[e.renderSlot(t.$slots,"center",{},void 0,!0)])):e.createCommentVNode("",!0),t.$slots.right?(e.openBlock(),e.createElementBlock("div",ze,[e.renderSlot(t.$slots,"right",{},void 0,!0)])):e.createCommentVNode("",!0)])}const Be=H(ye,[["render",De],["__scopeId","data-v-44b95676"]]);C.SplitPane=Ne,C.SplitToolbar=Be,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("@kong/icons"),require("vue-router"),require("@kong-ui-public/i18n")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`@kong/icons`,`vue-router`,`@kong-ui-public/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`kong-ui-public-split-pane`]={},e.Vue,e.KongIcons,e.VueRouter,e[`kong-ui-public-i18n`]))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=`260px`,o=`500px`;function s(e,n){return(0,t.getCurrentScope)()?((0,t.onScopeDispose)(e,n),!0):!1}var c=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var l=e=>e!=null,u=Object.prototype.toString,d=e=>u.call(e)===`[object Object]`,f=()=>{};function p(e){return Array.isArray(e)?e:[e]}function m(e){return e||(0,t.getCurrentInstance)()}function h(e,n=!0,r){m(r)?(0,t.onMounted)(e,r):n?e():(0,t.nextTick)(e)}function g(e,n,r){return(0,t.watch)(e,n,{...r,immediate:!0})}var _=c?window:void 0;c&&window.document,c&&window.navigator,c&&window.location;function v(e){let n=(0,t.toValue)(e);return n?.$el??n}function y(...e){let n=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),r=(0,t.computed)(()=>{let n=p((0,t.toValue)(e[0])).filter(e=>e!=null);return n.every(e=>typeof e!=`string`)?n:void 0});return g(()=>[r.value?.map(e=>v(e))??[_].filter(e=>e!=null),p((0,t.toValue)(r.value?e[1]:e[0])),p((0,t.unref)(r.value?e[2]:e[1])),(0,t.toValue)(r.value?e[3]:e[2])],([e,t,r,i],a,o)=>{if(!e?.length||!t?.length||!r?.length)return;let s=d(i)?{...i}:i,c=e.flatMap(e=>t.flatMap(t=>r.map(r=>n(e,t,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function b(){let e=(0,t.shallowRef)(!1),n=(0,t.getCurrentInstance)();return n&&(0,t.onMounted)(()=>{e.value=!0},n),e}function x(e){let n=b();return(0,t.computed)(()=>(n.value,!!e()))}function S(e,n,r={}){let{window:i=_,...a}=r,o,c=x(()=>i&&`MutationObserver`in i),u=()=>{o&&=(o.disconnect(),void 0)},d=(0,t.watch)((0,t.computed)(()=>{let n=p((0,t.toValue)(e)).map(v).filter(l);return new Set(n)}),e=>{u(),c.value&&e.size&&(o=new MutationObserver(n),e.forEach(e=>o.observe(e,a)))},{immediate:!0,flush:`post`}),f=()=>o?.takeRecords(),m=()=>{d(),u()};return s(m),{isSupported:c,stop:m,takeRecords:f}}function C(e,n,r={}){let{window:i=_,document:a=i?.document,flush:o=`sync`}=r;if(!i||!a)return f;let c,l=e=>{c?.(),c=e},u=(0,t.watchEffect)(()=>{let t=v(e);if(t){let{stop:e}=S(a,e=>{e.map(e=>[...e.removedNodes]).flat().some(e=>e===t||e.contains(t))&&n(e)},{window:i,childList:!0,subtree:!0});l(e)}},{flush:o}),d=()=>{u(),l()};return s(d),d}function w(e,n,r={}){let{window:i=_,...a}=r,o,c=x(()=>i&&`ResizeObserver`in i),l=()=>{o&&=(o.disconnect(),void 0)},u=(0,t.watch)((0,t.computed)(()=>{let n=(0,t.toValue)(e);return Array.isArray(n)?n.map(e=>v(e)):[v(n)]}),e=>{if(l(),c.value&&i){o=new ResizeObserver(n);for(let t of e)t&&o.observe(t,a)}},{immediate:!0,flush:`post`}),d=()=>{l(),u()};return s(d),{isSupported:c,stop:d}}function T(e,n={}){let{delayEnter:r=0,delayLeave:i=0,triggerOnRemoval:a=!1,window:o=_}=n,s=(0,t.shallowRef)(!1),c,l=e=>{let t=e?r:i;c&&=(clearTimeout(c),void 0),t?c=setTimeout(()=>s.value=e,t):s.value=e};return o&&(y(e,`mouseenter`,()=>l(!0),{passive:!0}),y(e,`mouseleave`,()=>l(!1),{passive:!0}),a&&C((0,t.computed)(()=>v(e)),()=>l(!1))),s}function E(e,n={width:0,height:0},r={}){let{window:i=_,box:a=`content-box`}=r,o=(0,t.computed)(()=>{var t;return(t=v(e))==null||(t=t.namespaceURI)==null?void 0:t.includes(`svg`)}),s=(0,t.shallowRef)(n.width),c=(0,t.shallowRef)(n.height),{stop:l}=w(e,([t])=>{let n=a===`border-box`?t.borderBoxSize:a===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(i&&o.value){let t=v(e);if(t){let e=t.getBoundingClientRect();s.value=e.width,c.value=e.height}}else if(n){let e=p(n);s.value=e.reduce((e,{inlineSize:t})=>e+t,0),c.value=e.reduce((e,{blockSize:t})=>e+t,0)}else s.value=t.contentRect.width,c.value=t.contentRect.height},r);h(()=>{let t=v(e);if(t&&`offsetWidth`in t){if(a===`content-box`&&i){let e=i.getComputedStyle(t),n=Number.parseFloat(e.paddingLeft)+Number.parseFloat(e.paddingRight),r=Number.parseFloat(e.paddingTop)+Number.parseFloat(e.paddingBottom),a=Number.parseFloat(e.borderLeftWidth)+Number.parseFloat(e.borderRightWidth),o=Number.parseFloat(e.borderTopWidth)+Number.parseFloat(e.borderBottomWidth);s.value=t.offsetWidth-n-a,c.value=t.offsetHeight-r-o}else s.value=t.offsetWidth,c.value=t.offsetHeight}else t&&(s.value=n.width,c.value=n.height)});let u=(0,t.watch)(()=>v(e),e=>{s.value=e?n.width:0,c.value=e?n.height:0});function d(){l(),u()}return{width:s,height:c,stop:d}}var D=`20px`,O=(0,t.ref)(!1),k=(0,t.ref)(!1),A=(0,t.ref)(!0),j=(0,t.ref)(0);function M(e){let n=e?.verticalNavRef||(0,t.ref)(null),r=e?.innerPanesContainerRef||(0,t.ref)(null),i=e?.paneLeftRef||(0,t.ref)(null),s=e?.paneCenterRef||(0,t.ref)(null),c=e?.paneRightRef||(0,t.ref)(null),l=e=>{switch(e){case`verticalNav`:return n.value?.offsetWidth||0;case`innerPanesContainer`:return r.value?.offsetWidth||0;case`paneLeft`:return i.value?.offsetWidth||0;case`paneCenter`:return s.value?.offsetWidth||0;case`paneRight`:return c.value?.offsetWidth||0;default:return 0}},u=(0,t.ref)(50),d=(0,t.ref)(0),f=(0,t.ref)(0),p=(0,t.ref)(0),m=(0,t.ref)(0),h=e=>{if(s.value){if(e){s.value.style.width=`${e}%`,j.value=l(`paneCenter`);return}typeof u.value==`number`&&isFinite(u.value)||(u.value=38),s.value.style.width=`${u.value}%`,j.value=l(`paneCenter`)}},g=()=>{s.value&&c.value?.style.display===`none`?(s.value.style.flex=`1`,h(100)):(s.value&&(s.value.style.flex=``),h())},_=()=>{if(!r.value||!s.value)return;let e=l(`innerPanesContainer`)-l(`verticalNav`)-l(`paneLeft`)-100,t=u.value/100*l(`innerPanesContainer`);t<100?u.value=100/l(`innerPanesContainer`)*100:t>e&&(u.value=e/l(`innerPanesContainer`)*100),s.value&&c.value&&c.value?.style.display===`none`?h(100):h()},v=e=>{s.value&&e.button===0&&(k.value=!0,d.value=e.clientX,f.value=s.value.offsetWidth||0)},b=e=>{if(!k.value||!r.value||!s.value)return;let t=r.value.offsetWidth,n=e.clientX-d.value,i=(f.value+n)/t*100,a=100/t*100,o=(t-100)/t*100;u.value=Math.min(Math.max(a,i),o),h()},x=()=>{k.value=!1},S=e=>{i.value&&A.value&&e.button===0&&(O.value=!0,p.value=e.clientX,m.value=i.value.offsetWidth||0)},C=e=>{if(!O.value||!i.value)return;let t=m.value+(e.clientX-p.value),n=Number(a.replace(/px$/i,``)),r=Number(o.replace(/px$/i,``));t<n&&(t=n),t>r&&(t=r),i.value.style.width=`${t}px`,p.value=e.clientX,m.value=t,j.value=l(`paneCenter`)},w=()=>{O.value=!1};return y(window,`resize`,()=>{k.value||_()}),(0,t.onMounted)(async()=>{await(0,t.nextTick)(),s.value&&(_(),await(0,t.nextTick)(),h(),requestAnimationFrame(()=>{j.value=l(`paneCenter`)}))}),y(document,`mousemove`,e=>{k.value&&b(e),O.value&&C(e)}),y(document,`mouseup`,()=>{k.value&&x(),O.value&&w()}),{isDraggingPaneLeft:(0,t.readonly)(O),isDraggingInnerPanes:(0,t.readonly)(k),startDraggingInnerPanes:v,refreshInnerPaneSizes:g,paneLeftExpanded:(0,t.readonly)(A),togglePaneLeft:async()=>{A.value=!A.value},startDraggingPaneLeft:S,centerPaneWidth:j}}var N={actions:{return:`Return`,collapse_panel:`Collapse panel`,expand_panel:`Expand panel`,drag_to_resize:`Click and drag to resize`}};function P(){let e=(0,i.createI18n)(`en-us`,N);return{i18n:e,i18nT:(0,i.i18nTComponent)(e)}}var F={class:`kong-ui-public-split-pane-vertical-navigation`},I={class:`split-pane-nav`},L={class:`top`},R={class:`bottom`},z=(0,t.defineComponent)({__name:`VerticalNavigation`,props:{paneLeftWidth:{default:0},paneLeftVisible:{type:Boolean,default:!0},items:{default:()=>[]}},setup(e){(0,t.useCssVars)(e=>({eaa86402:p.value}));let{i18n:i}=P(),a=(0,r.useRouter)(),{paneLeftExpanded:o,togglePaneLeft:s,isDraggingPaneLeft:c,isDraggingInnerPanes:l}=M(),u=(0,t.ref)(!1),d=(0,t.ref)(!1),f=(0,t.computed)(()=>u.value||c.value||l.value),p=(0,t.computed)(()=>`${e.paneLeftWidth-8}px`),m=e=>{o.value||s(),!e.active&&e.to&&a.push(e.to)};return(0,t.onMounted)(async()=>{await(0,t.nextTick)(),await new Promise(e=>setTimeout(e,500)),d.value=!0}),(r,a)=>{let p=(0,t.resolveComponent)(`KButton`),h=(0,t.resolveComponent)(`KTooltip`);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,F,[(0,t.createElementVNode)(`nav`,I,[(0,t.createElementVNode)(`div`,L,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createBlock)(h,{key:e.tooltip,"kpop-attributes":{offset:`10px`},label:e.tooltip,placement:`right`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(p,{appearance:`none`,"aria-label":e.tooltip,class:(0,t.normalizeClass)([`split-pane-nav-item`,{active:e.active}]),"data-testid":`kong-ui-public-split-pane-vertical-navigation-nav-item-${e.testid}`,icon:``,size:`large`,style:{cursor:`pointer`},to:e.to,onClickCapture:(0,t.withModifiers)(t=>m(e),[`prevent`])},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{decorative:``,size:`var(--kui-icon-size-40, ${(0,t.unref)(D)})`},null,8,[`size`]))]),_:2},1032,[`aria-label`,`class`,`data-testid`,`to`,`onClickCapture`])]),_:2},1032,[`label`]))),128))]),(0,t.createElementVNode)(`div`,R,[e.paneLeftVisible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`toggle-left-panel-control`,{expanded:(0,t.unref)(o),"disable-animation":!d.value||(0,t.unref)(c)||(0,t.unref)(l)}]),onTransitionend:a[0]||=(0,t.withModifiers)(e=>u.value=!1,[`self`]),onTransitionstart:a[1]||=(0,t.withModifiers)(e=>u.value=!0,[`self`])},[((0,t.openBlock)(),(0,t.createBlock)(h,{key:String((0,t.unref)(o)),"kpop-attributes":(0,t.unref)(o)?void 0:{offset:`10px`},label:f.value?void 0:(0,t.unref)(o)?(0,t.unref)(i).t(`actions.collapse_panel`):(0,t.unref)(i).t(`actions.expand_panel`),placement:(0,t.unref)(o)?`left`:`right`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(p,{appearance:`none`,"aria-controls":`left-pane`,"aria-expanded":(0,t.unref)(o),"aria-label":(0,t.unref)(o)?(0,t.unref)(i).t(`actions.collapse_panel`):(0,t.unref)(i).t(`actions.expand_panel`),class:`split-pane-nav-item toggle-left-panel`,"data-testid":`kong-ui-public-split-pane-toggle-left-panel-button`,icon:``,size:`large`,onClick:(0,t.unref)(s)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)((0,t.unref)(o)?(0,t.unref)(n.ChevronDoubleLeftIcon):(0,t.unref)(n.ChevronDoubleRightIcon)),{decorative:``,size:`var(--kui-icon-size-40, ${(0,t.unref)(D)})`},null,8,[`size`]))]),_:1},8,[`aria-expanded`,`aria-label`,`onClick`])]),_:1},8,[`kpop-attributes`,`label`,`placement`]))],34)):(0,t.createCommentVNode)(``,!0)])])])}}}),B=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},V=B(z,[[`__scopeId`,`data-v-59e8017f`]]),H={class:`split-pane-container`},U={class:`split-pane-container-inner`},W={class:`panes`},G=[`aria-hidden`,`tabindex`],K=[`title`],q={class:`split-pane-container-inner-content`},J=[`aria-hidden`,`tabindex`],Y=[`title`],X=[`aria-hidden`,`tabindex`],Z=B((0,t.defineComponent)({__name:`SplitPane`,props:{resizable:{type:Boolean,default:!0},showResizeHandle:{type:Boolean,default:!0},showNavigation:{type:Boolean,default:!0},navigationItems:{default:()=>[]},paneLeft:{default:()=>({visible:!0,maxWidth:o})},paneCenter:{default:()=>({visible:!0,maxWidth:`50%`})},paneRight:{default:()=>({visible:!0,maxWidth:`50%`})}},setup(e){(0,t.useCssVars)(e=>({v1300c9c8:i.value,v183c98aa:a.value,bf8b5faa:s.value}));let n=(0,t.useSlots)(),r=t=>t===`left`?e.paneLeft.maxWidth===void 0?o:e.paneLeft.maxWidth:t===`center`?e.resizable?`none`:e.paneCenter.maxWidth===void 0?`50%`:e.paneCenter.maxWidth:t===`right`?e.resizable?`none`:e.paneRight.maxWidth===void 0?`50%`:e.paneRight.maxWidth:`none`,i=(0,t.computed)(()=>r(`left`)),a=(0,t.computed)(()=>r(`center`)),s=(0,t.computed)(()=>r(`right`)),c=(0,t.useTemplateRef)(`verticalNavRef`),l=(0,t.useTemplateRef)(`innerPanesContainerRef`),u=(0,t.useTemplateRef)(`paneLeftRef`),d=(0,t.useTemplateRef)(`paneCenterRef`),f=(0,t.useTemplateRef)(`paneRightRef`),p=(0,t.useTemplateRef)(`paneLeftDivider`),m=(0,t.useTemplateRef)(`innerPanesDivider`),{startDraggingInnerPanes:h,startDraggingPaneLeft:g,refreshInnerPaneSizes:_,paneLeftExpanded:v,isDraggingPaneLeft:y,isDraggingInnerPanes:b}=M({verticalNavRef:c,innerPanesContainerRef:l,paneLeftRef:u,paneCenterRef:d,paneRightRef:f}),{i18n:x}=P(),S=(0,t.computed)(()=>!!n[`pane-left`]&&e.paneLeft.visible!==!1&&v.value),C=(0,t.computed)(()=>!!n[`pane-center`]&&e.paneCenter.visible!==!1),w=(0,t.computed)(()=>!!n[`pane-right`]&&e.paneRight.visible!==!1),D=(0,t.computed)(()=>e.resizable&&e.showResizeHandle&&!!n[`pane-center`]&&e.paneCenter.visible!==!1&&!!n[`pane-right`]&&e.paneRight.visible!==!1),O=T(p),k=T(m),{width:A}=E(u);return(0,t.watch)(()=>e.paneRight.visible,async()=>{e.resizable&&(await(0,t.nextTick)(),_())},{flush:`post`}),(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`kong-ui-public-split-pane`,{"has-navigation":e.showNavigation}]),"data-testid":`split-pane`},[(0,t.createElementVNode)(`div`,H,[e.showNavigation?((0,t.openBlock)(),(0,t.createBlock)(V,{key:0,ref_key:`verticalNavRef`,ref:c,items:e.navigationItems,"pane-left-visible":e.paneLeft.visible!==!1,"pane-left-width":(0,t.unref)(A)},null,8,[`items`,`pane-left-visible`,`pane-left-width`])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,U,[(0,t.createElementVNode)(`div`,W,[(0,t.createElementVNode)(`div`,{ref_key:`paneLeftRef`,ref:u,"aria-hidden":S.value?void 0:`true`,class:(0,t.normalizeClass)([`split-pane-left`,[{expanded:(0,t.unref)(v),"show-resize-border":(0,t.unref)(O)},{"is-dragging-pane-left":(0,t.unref)(y)},{"is-dragging-pane":(0,t.unref)(y)||(0,t.unref)(b)}]]),"data-testid":`split-pane-left`,tabindex:S.value?0:-1},[(0,t.renderSlot)(r.$slots,`pane-left`,{},void 0,!0)],10,G),S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`paneLeftDivider`,ref:p,class:`split-pane-resize-divider left`,"data-testid":`split-pane-resize-divider-left`,tabindex:`0`,title:(0,t.unref)(x).t(`actions.drag_to_resize`),onMousedown:i[0]||=(...e)=>(0,t.unref)(g)&&(0,t.unref)(g)(...e)},[...i[2]||=[(0,t.createElementVNode)(`div`,{class:`split-pane-drag-handle`},null,-1)]],40,K)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,q,[n.toolbar?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`split-pane-toolbar-container`,{"has-resize-divider-left":S.value}]),"data-testid":`split-pane-toolbar`},[(0,t.renderSlot)(r.$slots,`toolbar`,{},void 0,!0)],2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,{ref_key:`innerPanesContainerRef`,ref:l,class:`split-pane-inner-panes`},[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{ref_key:`paneCenterRef`,ref:d,"aria-hidden":C.value?void 0:`true`,class:(0,t.normalizeClass)([`split-pane-center`,[{"has-resize-divider-left":S.value},{"has-resize-divider-right":D.value},{"is-dragging-pane":(0,t.unref)(y)||(0,t.unref)(b)}]]),"data-testid":`split-pane-center`,tabindex:C.value?0:-1},[(0,t.renderSlot)(r.$slots,`pane-center`,{},void 0,!0)],10,J),[[t.vShow,C.value]]),D.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`innerPanesDivider`,ref:m,class:`split-pane-resize-divider right`,"data-testid":`split-pane-resize-divider-right`,tabindex:`0`,title:(0,t.unref)(x).t(`actions.drag_to_resize`),onMousedown:i[1]||=(...e)=>(0,t.unref)(h)&&(0,t.unref)(h)(...e)},[...i[3]||=[(0,t.createElementVNode)(`div`,{class:`split-pane-drag-handle`},null,-1)]],40,Y)):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{ref_key:`paneRightRef`,ref:f,"aria-hidden":w.value?void 0:`true`,class:(0,t.normalizeClass)([`split-pane-right`,[{"has-toolbar":!!n.toolbar},{"show-resize-border":(0,t.unref)(k)},{"is-dragging-inner-panes":(0,t.unref)(b)},{"is-dragging-pane":(0,t.unref)(y)||(0,t.unref)(b)}]]),"data-testid":`split-pane-right`,tabindex:w.value?0:-1},[(0,t.renderSlot)(r.$slots,`pane-right`,{},void 0,!0)],10,X),[[t.vShow,w.value]])],512)])])])])],2))}}),[[`__scopeId`,`data-v-a19fbade`]]),Q={},$={class:`kong-ui-public-split-pane-toolbar`,"data-testid":`kong-ui-public-split-pane-toolbar`},ee={class:`left`,"data-testid":`split-toolbar-left`},te={key:0,class:`center`,"data-testid":`split-toolbar-center`},ne={key:1,class:`right`,"data-testid":`split-toolbar-right`};function re(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,$,[(0,t.createElementVNode)(`div`,ee,[(0,t.renderSlot)(e.$slots,`left`,{},void 0,!0)]),e.$slots.center?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,te,[(0,t.renderSlot)(e.$slots,`center`,{},void 0,!0)])):(0,t.createCommentVNode)(``,!0),e.$slots.right?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ne,[(0,t.renderSlot)(e.$slots,`right`,{},void 0,!0)])):(0,t.createCommentVNode)(``,!0)])}var ie=B(Q,[[`render`,re],[`__scopeId`,`data-v-44b95676`]]);e.SplitPane=Z,e.SplitToolbar=ie});
package/dist/style.css CHANGED
@@ -1 +1,2 @@
1
- .kong-ui-public-split-pane-vertical-navigation[data-v-59e8017f]{color:#bee2ff;color:var(--kui-navigation-color-text, #bee2ff);display:flex;height:100%;justify-content:center;padding:8px;padding:var(--kui-space-40, 8px);position:relative;width:52px;z-index:1}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav[data-v-59e8017f]{align-items:center;display:flex;flex-direction:column;gap:12px;gap:var(--kui-space-50, 12px);justify-content:space-between;width:100%}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .top[data-v-59e8017f],.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .bottom[data-v-59e8017f]{display:flex;flex-direction:column;flex-grow:1;gap:12px;gap:var(--kui-space-50, 12px);position:relative;width:100%}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .top[data-v-59e8017f]{align-items:center;justify-content:flex-start}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .bottom[data-v-59e8017f]{align-items:center;justify-content:flex-end}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav[data-v-59e8017f] .k-popover .popover{pointer-events:none}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]{align-items:center;background-color:#000933;background-color:var(--kui-navigation-color-background, #000933);border:1px solid rgba(0,0,0,0);border:var(--kui-border-width-10, 1px) solid var(--kui-color-border-transparent, rgba(0, 0, 0, 0));border-radius:6px;border-radius:var(--kui-border-radius-30, 6px);color:#bee2ff;color:var(--kui-navigation-color-text, #bee2ff);cursor:pointer;display:flex;justify-content:center;justify-content:space-between;text-decoration:none;transition:color .2s ease;white-space:nowrap}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:hover,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:focus-visible{color:#eefaff;color:var(--kui-navigation-color-text-hover, #eefaff)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:hover svg,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:focus-visible svg{color:#eefaff;color:var(--kui-navigation-color-text-hover, #eefaff)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:focus-visible{box-shadow:0 0 0 1px #fff9 inset;box-shadow:var(--kui-navigation-shadow-focus, 0 0 0 1px rgba(255, 255, 255, .6) inset);outline:none}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f] svg path{color:currentColor;fill:currentColor;transition:all .2s ease-out}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]{background-color:#ffffff1f;background-color:var(--kui-navigation-color-background-selected, rgba(255, 255, 255, .12));border-color:#ffffff1f;border-color:var(--kui-navigation-color-border, rgba(255, 255, 255, .12));color:#00fabe;color:var(--kui-navigation-color-text-selected, #00fabe)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:hover,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:focus-visible{color:#00fabe!important;color:var(--kui-navigation-color-text-selected, #00fabe)!important}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:hover svg,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:focus-visible svg{color:#00fabe;color:var(--kui-navigation-color-text-selected, #00fabe)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.toggle-left-panel[data-v-59e8017f]{border-color:#ffffff1f;border-color:var(--kui-navigation-color-border, rgba(255, 255, 255, .12))}.toggle-left-panel-control[data-v-59e8017f]{left:0;position:absolute;z-index:1}.toggle-left-panel-control[data-v-59e8017f]:not(.disable-animation){transition:left .2s ease-out}.toggle-left-panel-control.expanded[data-v-59e8017f]{left:var(--eaa86402)}[data-v-a19fbade],[data-v-a19fbade] *{box-sizing:border-box}.kong-ui-public-split-pane[data-v-a19fbade]{height:100%}.kong-ui-public-split-pane.has-navigation[data-v-a19fbade]{background-color:#000933;background-color:var(--kui-navigation-color-background, #000933);inset:0;position:fixed;z-index:2000}.kong-ui-public-split-pane.has-navigation .split-pane-container-inner[data-v-a19fbade]{padding-top:6px;padding-top:var(--kui-space-30, 6px)}.kong-ui-public-split-pane .split-pane-container[data-v-a19fbade]{display:flex;flex-direction:row;height:100%;width:100%}.kong-ui-public-split-pane .split-pane-container-inner[data-v-a19fbade]{display:flex;flex-direction:column;width:100%}.kong-ui-public-split-pane .split-pane-container-inner-content[data-v-a19fbade]{display:flex;flex:1 1 auto;flex-direction:column;height:100%;max-height:calc(100vh - 6px);min-width:0;position:relative;width:100%}.kong-ui-public-split-pane .split-pane-inner-panes[data-v-a19fbade]{display:flex;height:100%;width:100%}.kong-ui-public-split-pane .panes[data-v-a19fbade]{align-items:stretch;background-color:#fff;background-color:var(--kui-color-background, #ffffff);border-top-left-radius:6px;border-top-left-radius:var(--kui-border-radius-30, 6px);display:flex;flex:1 1 auto;flex-direction:row;overflow:hidden;z-index:0}.kong-ui-public-split-pane .split-pane-left[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-center[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right[data-v-a19fbade]{overflow-x:hidden;overflow-y:auto;position:relative;scrollbar-width:thin}.kong-ui-public-split-pane .split-pane-left.has-toolbar[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-center.has-toolbar[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right.has-toolbar[data-v-a19fbade]{max-height:calc(100vh - 44px);z-index:1}.kong-ui-public-split-pane .split-pane-left.is-dragging-pane[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-center.is-dragging-pane[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right.is-dragging-pane[data-v-a19fbade]{pointer-events:none;transition:none;-webkit-user-select:none;user-select:none}.kong-ui-public-split-pane .split-pane-left[data-v-a19fbade]{border-right:1px solid rgba(0,0,0,0);border-right:var(--kui-border-width-10, 1px) solid var(--kui-color-border-transparent, rgba(0, 0, 0, 0));border-top-left-radius:6px;border-top-left-radius:var(--kui-border-radius-30, 6px);flex:0 0 auto;max-height:none!important;max-width:0;overflow:hidden;pointer-events:none;position:relative;transition:border-color .1s ease-in-out,max-width .1s ease-in-out;width:260px;will-change:border-color,max-width,min-width;z-index:5}.kong-ui-public-split-pane .split-pane-left.expanded[data-v-a19fbade]{border-right-color:#e0e4ea;border-right-color:var(--kui-color-border, #e0e4ea);max-width:var(--v1300c9c8);pointer-events:auto}.kong-ui-public-split-pane .split-pane-left.is-dragging-pane-left[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-left.expanded.show-resize-border[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-left.show-resize-border[data-v-a19fbade]{border-right-color:#0044f4;border-right-color:var(--kui-color-border-primary, #0044f4)}.kong-ui-public-split-pane .split-pane-center[data-v-a19fbade]{max-width:var(--v183c98aa);min-width:300px;width:300px}.kong-ui-public-split-pane .split-pane-center.has-resize-divider-left[data-v-a19fbade]{margin-left:-3px}.kong-ui-public-split-pane .split-pane-center.has-resize-divider-right[data-v-a19fbade]{margin-right:-3px}.kong-ui-public-split-pane .split-pane-right[data-v-a19fbade]{border-left:1px solid #e0e4ea;border-left:var(--kui-border-width-10, 1px) solid var(--kui-color-border, #e0e4ea);flex:1;max-width:var(--bf8b5faa);min-width:300px;transition:border-color .1s ease-in-out}.kong-ui-public-split-pane .split-pane-right.is-dragging-inner-panes[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right.show-resize-border[data-v-a19fbade]{border-left-color:#0044f4;border-left-color:var(--kui-color-border-primary, #0044f4)}.kong-ui-public-split-pane .split-pane-toolbar-container.has-resize-divider-left[data-v-a19fbade]{margin-left:-3px}.kong-ui-public-split-pane .split-pane-resize-divider[data-v-a19fbade]{align-self:flex-end;background-color:#0000;background-color:var(--kui-color-background-transparent, rgba(0, 0, 0, 0));cursor:col-resize;height:calc(100% - 43px);position:relative;transition:all .1s ease-in-out;width:3px;z-index:4}.kong-ui-public-split-pane .split-pane-resize-divider.left[data-v-a19fbade]{margin-left:0}.kong-ui-public-split-pane .split-pane-resize-divider.right[data-v-a19fbade]{right:-3px}.kong-ui-public-split-pane-toolbar[data-v-44b95676]{align-items:center;background:#fff;background:var(--kui-color-background, #ffffff);border-bottom:1px solid #e0e4ea;border-bottom:var(--kui-border-width-10, 1px) solid var(--kui-color-border, #e0e4ea);display:flex;flex:0 0 44px;justify-content:space-between;min-height:44px;overflow-x:auto;overflow-y:hidden;padding-left:8px;padding-left:var(--kui-space-40, 8px);padding-right:8px;padding-right:var(--kui-space-40, 8px);position:sticky;scrollbar-width:thin;top:0;z-index:3}.left[data-v-44b95676],.right[data-v-44b95676],.center[data-v-44b95676]{align-items:center;display:flex;gap:8px;gap:var(--kui-space-40, 8px);height:100%}.left[data-v-44b95676],.right[data-v-44b95676]{flex:1 1 0%}.right[data-v-44b95676]{justify-content:flex-end}
1
+ .kong-ui-public-split-pane-vertical-navigation[data-v-59e8017f]{color:var(--kui-navigation-color-text,#bee2ff);height:100%;padding:8px;padding:var(--kui-space-40,8px);z-index:1;justify-content:center;width:52px;display:flex;position:relative}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav[data-v-59e8017f]{align-items:center;gap:12px;gap:var(--kui-space-50,12px);flex-direction:column;justify-content:space-between;width:100%;display:flex}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .top[data-v-59e8017f],.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .bottom[data-v-59e8017f]{gap:12px;gap:var(--kui-space-50,12px);flex-direction:column;flex-grow:1;width:100%;display:flex;position:relative}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .top[data-v-59e8017f]{justify-content:flex-start;align-items:center}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav .bottom[data-v-59e8017f]{justify-content:flex-end;align-items:center}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav[data-v-59e8017f] .k-popover .popover{pointer-events:none}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]{background-color:#000933;background-color:var(--kui-navigation-color-background,#000933);border:1px solid #0000;border:var(--kui-border-width-10,1px) solid var(--kui-color-border-transparent,#0000);border-radius:6px;border-radius:var(--kui-border-radius-30,6px);color:var(--kui-navigation-color-text,#bee2ff);cursor:pointer;white-space:nowrap;justify-content:space-between;align-items:center;text-decoration:none;transition:color .2s;display:flex}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:hover,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:focus-visible,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:hover svg,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:focus-visible svg{color:var(--kui-navigation-color-text-hover,#eefaff)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f]:focus-visible{box-shadow:inset 0 0 0 1px #fff9;box-shadow:var(--kui-navigation-shadow-focus,0 0 0 1px #fff9 inset);outline:none}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item[data-v-59e8017f] svg path{color:currentColor;fill:currentColor;transition:all .2s ease-out}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]{background-color:#ffffff1f;background-color:var(--kui-navigation-color-background-selected,#ffffff1f);border-color:#ffffff1f;border-color:var(--kui-navigation-color-border,#ffffff1f);color:var(--kui-navigation-color-text-selected,#00fabe)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:hover,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:focus-visible{color:var(--kui-navigation-color-text-selected,#00fabe)!important}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:hover svg,.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.active[data-v-59e8017f]:focus-visible svg{color:var(--kui-navigation-color-text-selected,#00fabe)}.kong-ui-public-split-pane-vertical-navigation .split-pane-nav-item.toggle-left-panel[data-v-59e8017f]{border-color:#ffffff1f;border-color:var(--kui-navigation-color-border,#ffffff1f)}.toggle-left-panel-control[data-v-59e8017f]{z-index:1;position:absolute;left:0}.toggle-left-panel-control[data-v-59e8017f]:not(.disable-animation){transition:left .2s ease-out}.toggle-left-panel-control.expanded[data-v-59e8017f]{left:var(--eaa86402)}[data-v-a19fbade],[data-v-a19fbade] *{box-sizing:border-box}.kong-ui-public-split-pane[data-v-a19fbade]{height:100%}.kong-ui-public-split-pane.has-navigation[data-v-a19fbade]{background-color:#000933;background-color:var(--kui-navigation-color-background,#000933);z-index:2000;position:fixed;inset:0}.kong-ui-public-split-pane.has-navigation .split-pane-container-inner[data-v-a19fbade]{padding-top:6px;padding-top:var(--kui-space-30,6px)}.kong-ui-public-split-pane .split-pane-container[data-v-a19fbade]{flex-direction:row;width:100%;height:100%;display:flex}.kong-ui-public-split-pane .split-pane-container-inner[data-v-a19fbade]{flex-direction:column;width:100%;display:flex}.kong-ui-public-split-pane .split-pane-container-inner-content[data-v-a19fbade]{flex-direction:column;flex:auto;width:100%;min-width:0;height:100%;max-height:calc(100vh - 6px);display:flex;position:relative}.kong-ui-public-split-pane .split-pane-inner-panes[data-v-a19fbade]{width:100%;height:100%;display:flex}.kong-ui-public-split-pane .panes[data-v-a19fbade]{background-color:#fff;background-color:var(--kui-color-background,#fff);border-top-left-radius:6px;border-top-left-radius:var(--kui-border-radius-30,6px);z-index:0;flex-direction:row;flex:auto;align-items:stretch;display:flex;overflow:hidden}.kong-ui-public-split-pane .split-pane-left[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-center[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right[data-v-a19fbade]{scrollbar-width:thin;position:relative;overflow:hidden auto}.kong-ui-public-split-pane .split-pane-left.has-toolbar[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-center.has-toolbar[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right.has-toolbar[data-v-a19fbade]{z-index:1;max-height:calc(100vh - 44px)}.kong-ui-public-split-pane .split-pane-left.is-dragging-pane[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-center.is-dragging-pane[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right.is-dragging-pane[data-v-a19fbade]{pointer-events:none;-webkit-user-select:none;user-select:none;transition:none}.kong-ui-public-split-pane .split-pane-left[data-v-a19fbade]{border-right:1px solid #0000;border-right:var(--kui-border-width-10,1px) solid var(--kui-color-border-transparent,#0000);border-top-left-radius:6px;border-top-left-radius:var(--kui-border-radius-30,6px);pointer-events:none;will-change:border-color, max-width, min-width;z-index:5;flex:none;width:260px;max-width:0;transition:border-color .1s ease-in-out,max-width .1s ease-in-out;position:relative;overflow:hidden;max-height:none!important}.kong-ui-public-split-pane .split-pane-left.expanded[data-v-a19fbade]{border-right-color:#e0e4ea;border-right-color:var(--kui-color-border,#e0e4ea);max-width:var(--v1300c9c8);pointer-events:auto}.kong-ui-public-split-pane .split-pane-left.is-dragging-pane-left[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-left.expanded.show-resize-border[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-left.show-resize-border[data-v-a19fbade]{border-right-color:#0044f4;border-right-color:var(--kui-color-border-primary,#0044f4)}.kong-ui-public-split-pane .split-pane-center[data-v-a19fbade]{max-width:var(--v183c98aa);width:300px;min-width:300px}.kong-ui-public-split-pane .split-pane-center.has-resize-divider-left[data-v-a19fbade]{margin-left:-3px}.kong-ui-public-split-pane .split-pane-center.has-resize-divider-right[data-v-a19fbade]{margin-right:-3px}.kong-ui-public-split-pane .split-pane-right[data-v-a19fbade]{border-left:1px solid #e0e4ea;border-left:var(--kui-border-width-10,1px) solid var(--kui-color-border,#e0e4ea);max-width:var(--bf8b5faa);flex:1;min-width:300px;transition:border-color .1s ease-in-out}.kong-ui-public-split-pane .split-pane-right.is-dragging-inner-panes[data-v-a19fbade],.kong-ui-public-split-pane .split-pane-right.show-resize-border[data-v-a19fbade]{border-left-color:#0044f4;border-left-color:var(--kui-color-border-primary,#0044f4)}.kong-ui-public-split-pane .split-pane-toolbar-container.has-resize-divider-left[data-v-a19fbade]{margin-left:-3px}.kong-ui-public-split-pane .split-pane-resize-divider[data-v-a19fbade]{background-color:#0000;background-color:var(--kui-color-background-transparent,#0000);cursor:col-resize;z-index:4;align-self:flex-end;width:3px;height:calc(100% - 43px);transition:all .1s ease-in-out;position:relative}.kong-ui-public-split-pane .split-pane-resize-divider.left[data-v-a19fbade]{margin-left:0}.kong-ui-public-split-pane .split-pane-resize-divider.right[data-v-a19fbade]{right:-3px}.kong-ui-public-split-pane-toolbar[data-v-44b95676]{background:#fff;background:var(--kui-color-background,#fff);border-bottom:1px solid #e0e4ea;border-bottom:var(--kui-border-width-10,1px) solid var(--kui-color-border,#e0e4ea);min-height:44px;padding-left:8px;padding-left:var(--kui-space-40,8px);padding-right:8px;padding-right:var(--kui-space-40,8px);scrollbar-width:thin;z-index:3;flex:0 0 44px;justify-content:space-between;align-items:center;display:flex;position:sticky;top:0;overflow:auto hidden}.left[data-v-44b95676],.right[data-v-44b95676],.center[data-v-44b95676]{align-items:center;gap:8px;gap:var(--kui-space-40,8px);height:100%;display:flex}.left[data-v-44b95676],.right[data-v-44b95676]{flex:1}.right[data-v-44b95676]{justify-content:flex-end}
2
+ /*$vite$:1*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kong-ui-public/split-pane",
3
- "version": "0.6.5",
3
+ "version": "0.6.7-pr.4063.b6bcc4076.0",
4
4
  "type": "module",
5
5
  "description": "A shared SplitPane layout component for Vue 3 applications.",
6
6
  "main": "./dist/split-pane.umd.js",
@@ -24,8 +24,8 @@
24
24
  "devDependencies": {
25
25
  "@kong-ui-public/i18n": "^2.5.1",
26
26
  "@kong/design-tokens": "3.5.1",
27
- "@kong/kongponents": "9.66.11",
28
- "vue": "^3.5.43"
27
+ "@kong/kongponents": "9.66.12",
28
+ "vue": "^3.5.44"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",