@kong-ui-public/page-layout 1.3.10 → 1.3.11-pr.4063.bf809a10e.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.
- package/dist/page-layout.es.js +681 -796
- package/dist/page-layout.umd.js +1 -1
- package/dist/style.css +2 -1
- package/package.json +3 -3
package/dist/page-layout.es.js
CHANGED
|
@@ -1,811 +1,696 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createI18n as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, getCurrentInstance as u, getCurrentScope as d, guardReactiveProps as f, inject as p, mergeProps as m, nextTick as h, normalizeClass as g, normalizeProps as _, onBeforeUnmount as v, onMounted as y, onScopeDispose as b, onUnmounted as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveComponent as D, resolveDynamicComponent as ee, shallowReadonly as O, shallowRef as k, toDisplayString as A, toValue as j, unref as M, useCssVars as N, useSlots as te, useTemplateRef as P, watch as F, withCtx as I, withKeys as ne, withModifiers as L } from "vue";
|
|
2
|
+
import { useRoute as R, useRouter as z } from "vue-router";
|
|
3
|
+
import { createI18n as B, i18nTComponent as V } from "@kong-ui-public/i18n";
|
|
4
|
+
import { ArrowTopLeftIcon as re, ChevronDownIcon as H, ChevronRightIcon as ie, InfoIcon as U, StarFillIcon as ae, StarIcon as oe } from "@kong/icons";
|
|
5
|
+
var W = {
|
|
6
|
+
back_button: "Go back",
|
|
7
|
+
favorite_button: {
|
|
8
|
+
save_shortcut: "Save page to shortcuts",
|
|
9
|
+
remove_shortcut: "Remove page from shortcuts"
|
|
10
|
+
},
|
|
11
|
+
tabs: { more_button: {
|
|
12
|
+
label: "More",
|
|
13
|
+
aria_label: "More tabs"
|
|
14
|
+
} },
|
|
15
|
+
anchor_navigation: {
|
|
16
|
+
aria_label: "Page sections",
|
|
17
|
+
more_button: { aria_label: "More page sections" }
|
|
18
|
+
}
|
|
10
19
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
// src/composables/useI18n.ts
|
|
21
|
+
function se() {
|
|
22
|
+
let e = B("en-us", W);
|
|
23
|
+
return {
|
|
24
|
+
i18n: e,
|
|
25
|
+
i18nT: V(e)
|
|
26
|
+
};
|
|
18
27
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
28
|
+
// src/composables/index.ts
|
|
29
|
+
var ce = { useI18n: se }, G = "12px", K = "16px", le = "16px";
|
|
30
|
+
// ../../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.45_typescript@5.9.3_/node_modules/@vueuse/shared/dist/index.js
|
|
31
|
+
function ue(e, t) {
|
|
32
|
+
return d() ? (b(e, t), !0) : !1;
|
|
24
33
|
}
|
|
25
|
-
|
|
34
|
+
var q = typeof window < "u" && typeof document < "u";
|
|
26
35
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}), a;
|
|
36
|
+
var J = () => {};
|
|
37
|
+
function Y(e, t) {
|
|
38
|
+
function n(...n) {
|
|
39
|
+
return new Promise((r, i) => {
|
|
40
|
+
Promise.resolve(e(() => t.apply(this, n), {
|
|
41
|
+
fn: t,
|
|
42
|
+
thisArg: this,
|
|
43
|
+
args: n
|
|
44
|
+
})).then(r).catch(i);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return "cancel" in e && Object.assign(n, {
|
|
48
|
+
cancel: e.cancel,
|
|
49
|
+
flush: e.flush,
|
|
50
|
+
isPending: e.isPending
|
|
51
|
+
}), n;
|
|
44
52
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
isPending: je(d)
|
|
72
|
-
});
|
|
53
|
+
function X(e, t = {}) {
|
|
54
|
+
let n, r, i = J, a = J, o = k(!1), s = (e) => {
|
|
55
|
+
clearTimeout(e), i(), i = J;
|
|
56
|
+
}, c;
|
|
57
|
+
return Object.assign((l) => {
|
|
58
|
+
let u = j(e), d = j(t.maxWait);
|
|
59
|
+
return n && s(n), u <= 0 || d !== void 0 && d <= 0 ? (r &&= (s(r), void 0), o.value = !1, Promise.resolve(l())) : (o.value = !0, new Promise((e, f) => {
|
|
60
|
+
i = t.rejectOnCancel ? f : e, a = e, c = l, d && !r && (r = setTimeout(() => {
|
|
61
|
+
n && s(n), r = void 0, o.value = !1, e(c());
|
|
62
|
+
}, d)), n = setTimeout(() => {
|
|
63
|
+
r && s(r), r = void 0, o.value = !1, e(l());
|
|
64
|
+
}, u);
|
|
65
|
+
}));
|
|
66
|
+
}, {
|
|
67
|
+
cancel: () => {
|
|
68
|
+
n &&= (s(n), void 0), r &&= (s(r), void 0), o.value = !1, a = J;
|
|
69
|
+
},
|
|
70
|
+
flush: () => {
|
|
71
|
+
if (o.value) {
|
|
72
|
+
n &&= (clearTimeout(n), void 0), r &&= (clearTimeout(r), void 0), o.value = !1;
|
|
73
|
+
let e = a;
|
|
74
|
+
i = J, a = J, e(c());
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
isPending: O(o)
|
|
78
|
+
});
|
|
73
79
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
80
|
+
function Z(e) {
|
|
81
|
+
return Array.isArray(e) ? e : [e];
|
|
76
82
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
83
|
+
function Q(e) {
|
|
84
|
+
return e || u();
|
|
79
85
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
86
|
+
function de(e, t = 200, n = {}) {
|
|
87
|
+
return Y(X(t, n), e);
|
|
82
88
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
89
|
+
function fe(e, t = !0, n) {
|
|
90
|
+
Q(n) ? y(e, n) : t ? e() : h(e);
|
|
85
91
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
// ../../../node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.45_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
|
|
93
|
+
var pe = q ? window : void 0;
|
|
94
|
+
q && window.document, q && window.navigator, q && window.location;
|
|
95
|
+
function $(e) {
|
|
96
|
+
let t = j(e);
|
|
97
|
+
return t?.$el ?? t;
|
|
91
98
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, l), e;
|
|
99
|
+
function me() {
|
|
100
|
+
let e = k(!1), t = u();
|
|
101
|
+
return t && y(() => {
|
|
102
|
+
e.value = !0;
|
|
103
|
+
}, t), e;
|
|
98
104
|
}
|
|
99
|
-
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
106
|
+
function he(e) {
|
|
107
|
+
let n = me();
|
|
108
|
+
return t(() => (n.value, !!e()));
|
|
103
109
|
}
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
stop: A
|
|
126
|
-
};
|
|
110
|
+
function ge(e, n, r = {}) {
|
|
111
|
+
let { window: i = pe, ...a } = r, o, s = /* @__PURE__ */ he(() => i && "ResizeObserver" in i), c = () => {
|
|
112
|
+
o &&= (o.disconnect(), void 0);
|
|
113
|
+
}, l = F(t(() => {
|
|
114
|
+
let t = j(e);
|
|
115
|
+
return Array.isArray(t) ? t.map((e) => $(e)) : [$(t)];
|
|
116
|
+
}), (e) => {
|
|
117
|
+
if (c(), s.value && i) {
|
|
118
|
+
o = new ResizeObserver(n);
|
|
119
|
+
for (let t of e) t && o.observe(t, a);
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
immediate: !0,
|
|
123
|
+
flush: "post"
|
|
124
|
+
}), u = () => {
|
|
125
|
+
c(), l();
|
|
126
|
+
};
|
|
127
|
+
return ue(u), {
|
|
128
|
+
isSupported: s,
|
|
129
|
+
stop: u
|
|
130
|
+
};
|
|
127
131
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
};
|
|
132
|
+
function _e(e, n = {
|
|
133
|
+
width: 0,
|
|
134
|
+
height: 0
|
|
135
|
+
}, r = {}) {
|
|
136
|
+
let { window: i = pe, box: a = "content-box" } = r, o = t(() => {
|
|
137
|
+
var t;
|
|
138
|
+
return (t = $(e)) == null || (t = t.namespaceURI) == null ? void 0 : t.includes("svg");
|
|
139
|
+
}), s = k(n.width), c = k(n.height), { stop: l } = ge(e, ([t]) => {
|
|
140
|
+
let n = a === "border-box" ? t.borderBoxSize : a === "content-box" ? t.contentBoxSize : t.devicePixelContentBoxSize;
|
|
141
|
+
if (i && o.value) {
|
|
142
|
+
let t = $(e);
|
|
143
|
+
if (t) {
|
|
144
|
+
let e = t.getBoundingClientRect();
|
|
145
|
+
s.value = e.width, c.value = e.height;
|
|
146
|
+
}
|
|
147
|
+
} else if (n) {
|
|
148
|
+
let e = Z(n);
|
|
149
|
+
s.value = e.reduce((e, { inlineSize: t }) => e + t, 0), c.value = e.reduce((e, { blockSize: t }) => e + t, 0);
|
|
150
|
+
} else s.value = t.contentRect.width, c.value = t.contentRect.height;
|
|
151
|
+
}, r);
|
|
152
|
+
fe(() => {
|
|
153
|
+
let t = $(e);
|
|
154
|
+
if (t && "offsetWidth" in t) {
|
|
155
|
+
if (a === "content-box" && i) {
|
|
156
|
+
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);
|
|
157
|
+
s.value = t.offsetWidth - n - a, c.value = t.offsetHeight - r - o;
|
|
158
|
+
} else s.value = t.offsetWidth, c.value = t.offsetHeight;
|
|
159
|
+
} else t && (s.value = n.width, c.value = n.height);
|
|
160
|
+
});
|
|
161
|
+
let u = F(() => $(e), (e) => {
|
|
162
|
+
s.value = e ? n.width : 0, c.value = e ? n.height : 0;
|
|
163
|
+
});
|
|
164
|
+
function d() {
|
|
165
|
+
l(), u();
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
width: s,
|
|
169
|
+
height: c,
|
|
170
|
+
stop: d
|
|
171
|
+
};
|
|
169
172
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
},
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
])
|
|
695
|
-
], 2)
|
|
696
|
-
], 2);
|
|
697
|
-
};
|
|
698
|
-
}
|
|
699
|
-
}), ga = /* @__PURE__ */ Te(ea, [["__scopeId", "data-v-fa3bd24a"]]), ta = {
|
|
700
|
-
key: 0,
|
|
701
|
-
class: "about-card-description",
|
|
702
|
-
"data-testid": "about-card-description"
|
|
703
|
-
}, aa = {
|
|
704
|
-
key: 1,
|
|
705
|
-
class: "about-card-skeleton",
|
|
706
|
-
"data-testid": "about-card-skeleton"
|
|
707
|
-
}, oa = {
|
|
708
|
-
key: 2,
|
|
709
|
-
class: "about-card-rows",
|
|
710
|
-
"data-testid": "about-card-rows"
|
|
711
|
-
}, na = ["data-testid"], sa = { class: "about-card-row-label" }, ia = { class: "about-card-row-text" }, la = ["aria-label", "data-testid"], ra = { class: "about-card-row-value" }, ua = { class: "about-card-row-text" }, ca = {
|
|
712
|
-
key: 3,
|
|
713
|
-
class: "about-card-content",
|
|
714
|
-
"data-testid": "about-card-content"
|
|
715
|
-
}, da = /* @__PURE__ */ ke({
|
|
716
|
-
__name: "AboutCard",
|
|
717
|
-
props: {
|
|
718
|
-
title: { default: "" },
|
|
719
|
-
titleTag: { default: "h2" },
|
|
720
|
-
description: { default: "" },
|
|
721
|
-
rows: { default: () => [] },
|
|
722
|
-
isLoading: { type: Boolean, default: !1 }
|
|
723
|
-
},
|
|
724
|
-
setup(e) {
|
|
725
|
-
const l = w(() => e.rows.length || 4);
|
|
726
|
-
return (a, o) => {
|
|
727
|
-
const u = B("KSkeletonBox"), v = B("KTooltip"), d = B("KCard");
|
|
728
|
-
return r(), D(d, {
|
|
729
|
-
class: "kong-ui-public-about-card",
|
|
730
|
-
title: e.title,
|
|
731
|
-
"title-tag": e.titleTag
|
|
732
|
-
}, Ae({
|
|
733
|
-
default: I(() => [
|
|
734
|
-
a.$slots.description || e.description ? (r(), f("p", ta, [
|
|
735
|
-
R(a.$slots, "description", {}, () => [
|
|
736
|
-
oe(x(e.description), 1)
|
|
737
|
-
], !0)
|
|
738
|
-
])) : k("", !0),
|
|
739
|
-
e.isLoading ? (r(), f("div", aa, [
|
|
740
|
-
(r(!0), f(Z, null, G(l.value, (n) => (r(), D(u, {
|
|
741
|
-
key: n,
|
|
742
|
-
height: "2",
|
|
743
|
-
width: "100"
|
|
744
|
-
}))), 128))
|
|
745
|
-
])) : e.rows.length ? (r(), f("dl", oa, [
|
|
746
|
-
(r(!0), f(Z, null, G(e.rows, (n) => (r(), f("div", {
|
|
747
|
-
key: n.key,
|
|
748
|
-
class: "about-card-row",
|
|
749
|
-
"data-testid": `about-card-row-${n.key}`
|
|
750
|
-
}, [
|
|
751
|
-
$("dt", sa, [
|
|
752
|
-
R(a.$slots, `label-${n.key}`, { row: n }, () => [
|
|
753
|
-
$("span", ia, x(n.label), 1)
|
|
754
|
-
], !0),
|
|
755
|
-
n.tooltip ? (r(), D(v, {
|
|
756
|
-
key: 0,
|
|
757
|
-
text: n.tooltip
|
|
758
|
-
}, {
|
|
759
|
-
default: I(() => [
|
|
760
|
-
$("button", {
|
|
761
|
-
"aria-label": n.tooltip,
|
|
762
|
-
class: "about-card-row-tooltip-trigger",
|
|
763
|
-
"data-testid": `about-card-row-${n.key}-tooltip`,
|
|
764
|
-
type: "button"
|
|
765
|
-
}, [
|
|
766
|
-
z(m(rt), {
|
|
767
|
-
size: `var(--kui-icon-size-20, ${m(pt)})`
|
|
768
|
-
}, null, 8, ["size"])
|
|
769
|
-
], 8, la)
|
|
770
|
-
]),
|
|
771
|
-
_: 2
|
|
772
|
-
}, 1032, ["text"])) : k("", !0)
|
|
773
|
-
]),
|
|
774
|
-
$("dd", ra, [
|
|
775
|
-
R(a.$slots, `row-${n.key}`, { row: n }, () => [
|
|
776
|
-
$("span", ua, x(n.value), 1)
|
|
777
|
-
], !0)
|
|
778
|
-
])
|
|
779
|
-
], 8, na))), 128))
|
|
780
|
-
])) : k("", !0),
|
|
781
|
-
a.$slots.default ? (r(), f("div", ca, [
|
|
782
|
-
R(a.$slots, "default", {}, void 0, !0)
|
|
783
|
-
])) : k("", !0)
|
|
784
|
-
]),
|
|
785
|
-
_: 2
|
|
786
|
-
}, [
|
|
787
|
-
a.$slots.title || e.title ? {
|
|
788
|
-
name: "title",
|
|
789
|
-
fn: I(() => [
|
|
790
|
-
R(a.$slots, "title", {}, () => [
|
|
791
|
-
oe(x(e.title), 1)
|
|
792
|
-
], !0)
|
|
793
|
-
]),
|
|
794
|
-
key: "0"
|
|
795
|
-
} : void 0,
|
|
796
|
-
a.$slots.actions ? {
|
|
797
|
-
name: "actions",
|
|
798
|
-
fn: I(() => [
|
|
799
|
-
R(a.$slots, "actions", {}, void 0, !0)
|
|
800
|
-
]),
|
|
801
|
-
key: "1"
|
|
802
|
-
} : void 0
|
|
803
|
-
]), 1032, ["title", "title-tag"]);
|
|
804
|
-
};
|
|
805
|
-
}
|
|
806
|
-
}), ba = /* @__PURE__ */ Te(da, [["__scopeId", "data-v-48c05270"]]);
|
|
807
|
-
export {
|
|
808
|
-
ba as AboutCard,
|
|
809
|
-
Mt as NEW_APPEARANCE_INJECTION_KEY,
|
|
810
|
-
ga as PageLayout
|
|
811
|
-
};
|
|
173
|
+
// src/components/PageLayoutTabs.vue?vue&type=script&setup=true&lang.ts
|
|
174
|
+
var ve = {
|
|
175
|
+
ref: "page-layout-tabs",
|
|
176
|
+
class: "page-layout-tabs",
|
|
177
|
+
"data-testid": "page-layout-tabs"
|
|
178
|
+
}, ye = { key: 0 }, be = ["aria-label"], xe = {
|
|
179
|
+
key: 0,
|
|
180
|
+
class: "layout-loader-container"
|
|
181
|
+
}, Se = /*@__PURE__*/ l({
|
|
182
|
+
__name: "PageLayoutTabs",
|
|
183
|
+
props: { tabs: { default: () => [] } },
|
|
184
|
+
setup(o) {
|
|
185
|
+
let { i18n: { t: l } } = ce.useI18n(), u = z(), d = p("app:navigateTo", null), f = (e) => {
|
|
186
|
+
typeof e.to == "string" ? typeof d == "function" ? d(e.to) : window.location.href = e.to : u.push(e.to);
|
|
187
|
+
}, _ = P("page-layout-tabs"), b = P("page-layout-tabs-list"), x = w(o.tabs.length), C = w(!1), O = t(() => o.tabs.slice(0, x.value)), k = t(() => o.tabs.slice(x.value)), j = async () => {
|
|
188
|
+
if (!_.value || !b.value) return;
|
|
189
|
+
C.value = !1, x.value = o.tabs.length, await h();
|
|
190
|
+
let e = _.value?.getBoundingClientRect().width - parseInt(le) * 2, t = b.value?.getBoundingClientRect().width;
|
|
191
|
+
if (!e || !t) C.value = !0;
|
|
192
|
+
else {
|
|
193
|
+
for (; t + 50 > e && x.value > 1;) x.value--, await h(), t = b.value?.getBoundingClientRect().width || 0;
|
|
194
|
+
C.value = !0;
|
|
195
|
+
}
|
|
196
|
+
}, N = null, te = () => {
|
|
197
|
+
N && clearTimeout(N), N = setTimeout(() => {
|
|
198
|
+
j();
|
|
199
|
+
}, 150);
|
|
200
|
+
};
|
|
201
|
+
return y(() => {
|
|
202
|
+
j(), ge(_, te);
|
|
203
|
+
}), v(() => {
|
|
204
|
+
N && clearTimeout(N);
|
|
205
|
+
}), F(() => o.tabs, () => {
|
|
206
|
+
j();
|
|
207
|
+
}, { deep: !0 }), (t, u) => {
|
|
208
|
+
let d = D("KDropdownItem"), p = D("KDropdown"), h = D("KSkeletonBox");
|
|
209
|
+
return S(), i("nav", ve, [a("ul", {
|
|
210
|
+
ref: "page-layout-tabs-list",
|
|
211
|
+
class: g({ "layout-computing": !C.value })
|
|
212
|
+
}, [(S(!0), i(e, null, T(O.value, (e) => (S(), i("li", { key: `${e.key}-tab` }, [(S(), n(ee(typeof e.to == "string" ? "a" : "router-link"), m({ ref_for: !0 }, typeof e.to == "string" ? { href: e.to } : { to: e.to }, {
|
|
213
|
+
"aria-current": e.active ? "page" : void 0,
|
|
214
|
+
class: ["tab-link", { active: e.active }],
|
|
215
|
+
"data-testid": e.dataTestId ? e.dataTestId : `page-layout-tab-${e.key}`,
|
|
216
|
+
tabindex: "0",
|
|
217
|
+
onClick: L((t) => f(e), ["prevent"]),
|
|
218
|
+
onKeydown: ne(L((t) => f(e), ["prevent"]), ["enter"])
|
|
219
|
+
}), {
|
|
220
|
+
default: I(() => [E(t.$slots, `tab-${e.key}`, { tab: e }, () => [s(A(e.label), 1)], !0)]),
|
|
221
|
+
_: 2
|
|
222
|
+
}, 1040, [
|
|
223
|
+
"aria-current",
|
|
224
|
+
"class",
|
|
225
|
+
"data-testid",
|
|
226
|
+
"onClick",
|
|
227
|
+
"onKeydown"
|
|
228
|
+
]))]))), 128)), o.tabs.length > x.value ? (S(), i("li", ye, [c(p, { "kpop-attributes": {
|
|
229
|
+
placement: "bottom-end",
|
|
230
|
+
popoverElementAttributes: { "data-testid": "tabs-overflow-dropdown-popover" }
|
|
231
|
+
} }, {
|
|
232
|
+
items: I(() => [(S(!0), i(e, null, T(k.value, (e) => (S(), n(d, {
|
|
233
|
+
key: `${e.key}-dropdown-item`,
|
|
234
|
+
"aria-current": e.active ? "page" : void 0,
|
|
235
|
+
"data-testid": e.dataTestId ? e.dataTestId : `page-layout-tab-${e.key}`,
|
|
236
|
+
item: {
|
|
237
|
+
label: e.label,
|
|
238
|
+
value: e.key,
|
|
239
|
+
to: e.to
|
|
240
|
+
},
|
|
241
|
+
selected: e.active
|
|
242
|
+
}, {
|
|
243
|
+
default: I(() => [E(t.$slots, `tab-${e.key}`, { tab: e }, () => [s(A(e.label), 1)], !0)]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1032, [
|
|
246
|
+
"aria-current",
|
|
247
|
+
"data-testid",
|
|
248
|
+
"item",
|
|
249
|
+
"selected"
|
|
250
|
+
]))), 128))]),
|
|
251
|
+
default: I(() => [a("button", {
|
|
252
|
+
"aria-label": M(l)("tabs.more_button.aria_label"),
|
|
253
|
+
class: g(["tab-link", { active: k.value.find((e) => e.active) }]),
|
|
254
|
+
"data-testid": "tabs-overflow-dropdown-button"
|
|
255
|
+
}, [s(A(M(l)("tabs.more_button.label")) + " ", 1), c(M(H), {
|
|
256
|
+
decorative: "",
|
|
257
|
+
size: `var(--kui-icon-size-30, ${M(K)})`
|
|
258
|
+
}, null, 8, ["size"])], 10, be)]),
|
|
259
|
+
_: 3
|
|
260
|
+
})])) : r("", !0)], 2), C.value ? r("", !0) : (S(), i("div", xe, [(S(), i(e, null, T(3, (e) => c(h, {
|
|
261
|
+
key: `layout-loader-${e}`,
|
|
262
|
+
height: "1",
|
|
263
|
+
width: "5"
|
|
264
|
+
})), 64))]))], 512);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
}), Ce = (e, t) => {
|
|
268
|
+
let n = e.__vccOpts || e;
|
|
269
|
+
for (let [e, r] of t) n[e] = r;
|
|
270
|
+
return n;
|
|
271
|
+
}, we = /*#__PURE__*/ Ce(Se, [["__scopeId", "data-v-02891bc1"]]), Te = ["aria-label", "data-fit"], Ee = {
|
|
272
|
+
key: 0,
|
|
273
|
+
"aria-hidden": "true",
|
|
274
|
+
class: "anchor-ellipsis",
|
|
275
|
+
"data-testid": "anchor-navigation-leading-ellipsis"
|
|
276
|
+
}, De = [
|
|
277
|
+
"aria-current",
|
|
278
|
+
"data-testid",
|
|
279
|
+
"title",
|
|
280
|
+
"onClick"
|
|
281
|
+
], Oe = {
|
|
282
|
+
key: 1,
|
|
283
|
+
"aria-hidden": "true",
|
|
284
|
+
class: "anchor-ellipsis",
|
|
285
|
+
"data-testid": "anchor-navigation-trailing-ellipsis"
|
|
286
|
+
}, ke = { key: 2 }, Ae = 140, je = 22, Me = 16, Ne = "data-anchor-attention", Pe = 1200, Fe = 1600, Ie = /*#__PURE__*/ Ce(/* @__PURE__ */ l({
|
|
287
|
+
__name: "PageLayoutAnchorNavigation",
|
|
288
|
+
props: { anchors: { default: () => [] } },
|
|
289
|
+
setup(o) {
|
|
290
|
+
let { i18n: { t: l } } = ce.useI18n(), u = P("page-layout-anchor-navigation"), d = P("page-layout-anchor-navigation-list"), f = w("all"), p = w(""), m = w([]), _ = t(() => o.anchors.filter((e) => m.value.includes(e.id))), b = t(() => {
|
|
291
|
+
let e = _.value.findIndex((e) => e.id === p.value);
|
|
292
|
+
return e === -1 ? 0 : e;
|
|
293
|
+
}), x = t(() => {
|
|
294
|
+
let e = _.value, t = e.length, n = b.value;
|
|
295
|
+
if (f.value === "all") return {
|
|
296
|
+
anchors: e,
|
|
297
|
+
hasLeadingEllipsis: !1,
|
|
298
|
+
hasTrailingEllipsis: !1,
|
|
299
|
+
hasOverflowDropdown: !1
|
|
300
|
+
};
|
|
301
|
+
if (f.value === "hidden") return {
|
|
302
|
+
anchors: [],
|
|
303
|
+
hasLeadingEllipsis: !1,
|
|
304
|
+
hasTrailingEllipsis: !1,
|
|
305
|
+
hasOverflowDropdown: !1
|
|
306
|
+
};
|
|
307
|
+
if (f.value === "active-only") return {
|
|
308
|
+
anchors: e.slice(n, n + 1),
|
|
309
|
+
hasLeadingEllipsis: !1,
|
|
310
|
+
hasTrailingEllipsis: !1,
|
|
311
|
+
hasOverflowDropdown: !0
|
|
312
|
+
};
|
|
313
|
+
let r = f.value === "window-3" ? 3 : 2;
|
|
314
|
+
if (t <= r) return {
|
|
315
|
+
anchors: e,
|
|
316
|
+
hasLeadingEllipsis: !1,
|
|
317
|
+
hasTrailingEllipsis: !1,
|
|
318
|
+
hasOverflowDropdown: !0
|
|
319
|
+
};
|
|
320
|
+
let i = n < r ? 0 : n >= t - r ? t - r : n - 1;
|
|
321
|
+
return {
|
|
322
|
+
anchors: e.slice(i, i + r),
|
|
323
|
+
hasLeadingEllipsis: i > 0,
|
|
324
|
+
hasTrailingEllipsis: i + r < t,
|
|
325
|
+
hasOverflowDropdown: !0
|
|
326
|
+
};
|
|
327
|
+
}), C = (e) => e.dataTestId ?? `page-layout-anchor-${e.id.replace(/[^\w-]+/g, "-").replace(/^-+|-+$/g, "")}`, E = w(null), ee = () => {
|
|
328
|
+
let e = u.value?.parentElement ?? null;
|
|
329
|
+
for (; e;) {
|
|
330
|
+
let { overflowY: t } = getComputedStyle(e);
|
|
331
|
+
if (t === "auto" || t === "scroll" || t === "overlay") return e;
|
|
332
|
+
e = e.parentElement;
|
|
333
|
+
}
|
|
334
|
+
return null;
|
|
335
|
+
}, O = (e) => {
|
|
336
|
+
if (e.element) return e.element.isConnected ? e.element : null;
|
|
337
|
+
let t = E.value ?? document;
|
|
338
|
+
try {
|
|
339
|
+
return t.querySelector(e.id) ?? t.querySelector(`#${CSS.escape(e.id)}`);
|
|
340
|
+
} catch {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
}, k = () => ((u.value?.closest(".page-layout-header"))?.getBoundingClientRect().height ?? 0) + parseInt(le, 10), j = parseInt(K, 10), N = (e) => e * Ae + 2 * j + je + (e + 2) * 2 + Me, te = () => 164 + Me, ne = 0, L = async () => {
|
|
344
|
+
if (!_.value.length) {
|
|
345
|
+
f.value = "hidden";
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
let e = ++ne;
|
|
349
|
+
if (f.value = "all", await h(), e !== ne || !u.value || !d.value) return;
|
|
350
|
+
let t = u.value.getBoundingClientRect().width, n = d.value.getBoundingClientRect().width;
|
|
351
|
+
t <= 0 || n <= 0 || n + Me <= t || (N(3) <= t ? f.value = "window-3" : N(2) <= t ? f.value = "window-2" : te() <= t ? f.value = "active-only" : f.value = "hidden");
|
|
352
|
+
}, R = null;
|
|
353
|
+
ge(u, () => {
|
|
354
|
+
R && clearTimeout(R), R = setTimeout(() => {
|
|
355
|
+
J(), L();
|
|
356
|
+
}, 150);
|
|
357
|
+
});
|
|
358
|
+
let z = null, B = null, V = 0, re = 0, ie = null, U = null, ae = (e) => {
|
|
359
|
+
let t = String(++V);
|
|
360
|
+
oe(), U = e, e.removeAttribute(Ne), re = requestAnimationFrame(() => {
|
|
361
|
+
e.setAttribute(Ne, t), ie = setTimeout(() => {
|
|
362
|
+
e.getAttribute(Ne) === t && e.removeAttribute(Ne);
|
|
363
|
+
}, Pe);
|
|
364
|
+
});
|
|
365
|
+
}, oe = () => {
|
|
366
|
+
cancelAnimationFrame(re), ie &&= (clearTimeout(ie), null), U?.removeAttribute(Ne), U = null;
|
|
367
|
+
}, W = () => E.value ?? window, se = /* @__PURE__ */ new Set([
|
|
368
|
+
"ArrowUp",
|
|
369
|
+
"ArrowDown",
|
|
370
|
+
"PageUp",
|
|
371
|
+
"PageDown",
|
|
372
|
+
"Home",
|
|
373
|
+
"End",
|
|
374
|
+
" "
|
|
375
|
+
]), G = (e) => {
|
|
376
|
+
if (e instanceof KeyboardEvent && !se.has(e.key)) return;
|
|
377
|
+
e && e.type !== "scrollend" && V++, z = null, B &&= (clearTimeout(B), null);
|
|
378
|
+
let t = W();
|
|
379
|
+
t.removeEventListener("scrollend", G), t.removeEventListener("wheel", G), t.removeEventListener("touchstart", G), t.removeEventListener("keydown", G);
|
|
380
|
+
}, ue = (e) => {
|
|
381
|
+
G(), z = e;
|
|
382
|
+
let t = W();
|
|
383
|
+
t.addEventListener("scrollend", G, { once: !0 }), t.addEventListener("wheel", G, { passive: !0 }), t.addEventListener("touchstart", G, { passive: !0 }), t.addEventListener("keydown", G, { passive: !0 }), B = setTimeout(G, 1e3);
|
|
384
|
+
}, q = () => {
|
|
385
|
+
let e = E.value;
|
|
386
|
+
return {
|
|
387
|
+
top: e ? e.getBoundingClientRect().top : 0,
|
|
388
|
+
scrollTop: e ? e.scrollTop : window.scrollY,
|
|
389
|
+
clientHeight: e ? e.clientHeight : window.innerHeight,
|
|
390
|
+
scrollHeight: e ? e.scrollHeight : document.documentElement.scrollHeight
|
|
391
|
+
};
|
|
392
|
+
}, J = () => {
|
|
393
|
+
let { top: e, scrollTop: t, clientHeight: n, scrollHeight: r } = q(), i = k(), a = [], s = null, c = null;
|
|
394
|
+
for (let t of o.anchors) {
|
|
395
|
+
let n = O(t);
|
|
396
|
+
n && (a.push(t.id), c = t.id, s ??= t.id, n.getBoundingClientRect().top - e <= (t.offset ?? i) + 8 && (s = t.id));
|
|
397
|
+
}
|
|
398
|
+
let l = a.length !== m.value.length || a.some((e, t) => e !== m.value[t]);
|
|
399
|
+
return l && (m.value = a), z || (c && t > 0 && t + n >= r - 2 && (s = c), p.value = s ?? ""), l;
|
|
400
|
+
}, Y = !1, X = () => {
|
|
401
|
+
Y || (Y = !0, requestAnimationFrame(() => {
|
|
402
|
+
Y = !1, J() && L();
|
|
403
|
+
}));
|
|
404
|
+
}, Z = (e) => {
|
|
405
|
+
let t = W(), n = !1, r = () => {
|
|
406
|
+
n || (n = !0, t.removeEventListener("scrollend", r), e());
|
|
407
|
+
};
|
|
408
|
+
t.addEventListener("scrollend", r, { once: !0 }), window.setTimeout(r, Fe);
|
|
409
|
+
}, Q = (e) => {
|
|
410
|
+
let t = O(e);
|
|
411
|
+
if (!t) return;
|
|
412
|
+
p.value = e.id, ue(e.id);
|
|
413
|
+
let n = e.offset ?? k(), { scrollTop: r, clientHeight: i, scrollHeight: a } = q(), o = E.value, s = o ? t.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop - n : t.getBoundingClientRect().top + window.scrollY - n, c = Math.min(Math.max(s, 0), Math.max(a - i, 0)), l = Math.abs(c - r) >= 2, u = ++V;
|
|
414
|
+
(o ?? window).scrollTo({
|
|
415
|
+
behavior: "smooth",
|
|
416
|
+
top: s
|
|
417
|
+
}), l ? Z(() => {
|
|
418
|
+
u === V && ae(t);
|
|
419
|
+
}) : ae(t);
|
|
420
|
+
}, de = (e, t) => {
|
|
421
|
+
t(), Q(e);
|
|
422
|
+
};
|
|
423
|
+
return y(() => {
|
|
424
|
+
E.value = ee(), W().addEventListener("scroll", X, { passive: !0 }), J(), L(), requestAnimationFrame(() => {
|
|
425
|
+
J(), L();
|
|
426
|
+
});
|
|
427
|
+
}), v(() => {
|
|
428
|
+
W().removeEventListener("scroll", X), G(), V++, oe(), R && clearTimeout(R);
|
|
429
|
+
}), F(() => o.anchors, () => {
|
|
430
|
+
o.anchors.some((e) => e.id === p.value) || (p.value = ""), J(), L();
|
|
431
|
+
}, { deep: !0 }), (t, o) => {
|
|
432
|
+
let u = D("KButton"), d = D("KDropdownItem"), m = D("KDropdown");
|
|
433
|
+
return S(), i("nav", {
|
|
434
|
+
ref: "page-layout-anchor-navigation",
|
|
435
|
+
"aria-label": M(l)("anchor_navigation.aria_label"),
|
|
436
|
+
class: "page-layout-anchor-navigation",
|
|
437
|
+
"data-fit": f.value,
|
|
438
|
+
"data-testid": "page-layout-anchor-navigation"
|
|
439
|
+
}, [a("ul", {
|
|
440
|
+
ref: "page-layout-anchor-navigation-list",
|
|
441
|
+
class: g({ "layout-hidden": f.value === "hidden" })
|
|
442
|
+
}, [
|
|
443
|
+
x.value.hasLeadingEllipsis ? (S(), i("li", Ee, " … ")) : r("", !0),
|
|
444
|
+
(S(!0), i(e, null, T(x.value.anchors, (e) => (S(), i("li", { key: `${e.id}-anchor` }, [a("button", {
|
|
445
|
+
"aria-current": e.id === p.value ? "location" : void 0,
|
|
446
|
+
class: g(["anchor-link", { active: e.id === p.value }]),
|
|
447
|
+
"data-testid": C(e),
|
|
448
|
+
title: e.label,
|
|
449
|
+
type: "button",
|
|
450
|
+
onClick: (t) => Q(e)
|
|
451
|
+
}, A(e.label), 11, De)]))), 128)),
|
|
452
|
+
x.value.hasTrailingEllipsis ? (S(), i("li", Oe, " … ")) : r("", !0),
|
|
453
|
+
x.value.hasOverflowDropdown ? (S(), i("li", ke, [c(m, { "kpop-attributes": {
|
|
454
|
+
placement: "bottom-end",
|
|
455
|
+
popoverElementAttributes: { "data-testid": "anchor-navigation-overflow-dropdown-popover" }
|
|
456
|
+
} }, {
|
|
457
|
+
items: I(({ closeDropdown: t }) => [(S(!0), i(e, null, T(_.value, (e) => (S(), n(d, {
|
|
458
|
+
key: `${e.id}-dropdown-item`,
|
|
459
|
+
"aria-current": e.id === p.value ? "location" : void 0,
|
|
460
|
+
"data-testid": C(e),
|
|
461
|
+
selected: e.id === p.value,
|
|
462
|
+
onClick: (n) => de(e, t)
|
|
463
|
+
}, {
|
|
464
|
+
default: I(() => [s(A(e.label), 1)]),
|
|
465
|
+
_: 2
|
|
466
|
+
}, 1032, [
|
|
467
|
+
"aria-current",
|
|
468
|
+
"data-testid",
|
|
469
|
+
"selected",
|
|
470
|
+
"onClick"
|
|
471
|
+
]))), 128))]),
|
|
472
|
+
default: I(() => [c(u, {
|
|
473
|
+
appearance: "tertiary",
|
|
474
|
+
"aria-label": M(l)("anchor_navigation.more_button.aria_label"),
|
|
475
|
+
class: "anchor-overflow-button",
|
|
476
|
+
"data-testid": "anchor-navigation-overflow-dropdown-button",
|
|
477
|
+
icon: "",
|
|
478
|
+
size: "small"
|
|
479
|
+
}, {
|
|
480
|
+
default: I(() => [c(M(H), {
|
|
481
|
+
decorative: "",
|
|
482
|
+
size: `var(--kui-icon-size-30, ${M(K)})`
|
|
483
|
+
}, null, 8, ["size"])]),
|
|
484
|
+
_: 1
|
|
485
|
+
}, 8, ["aria-label"])]),
|
|
486
|
+
_: 1
|
|
487
|
+
})])) : r("", !0)
|
|
488
|
+
], 2)], 8, Te);
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
}), [["__scopeId", "data-v-f6d370c5"]]), Le = Symbol("nested-page-layout-detection"), Re = "page-layout:new-appearance", ze = { class: "page-header-container" }, Be = {
|
|
492
|
+
key: 0,
|
|
493
|
+
class: "page-header-start"
|
|
494
|
+
}, Ve = { class: "title-container" }, He = {
|
|
495
|
+
key: 1,
|
|
496
|
+
class: "page-layout-title-wrapper"
|
|
497
|
+
}, Ue = {
|
|
498
|
+
class: "page-layout-title",
|
|
499
|
+
"data-testid": "page-layout-title"
|
|
500
|
+
}, We = ["aria-label"], Ge = {
|
|
501
|
+
key: 3,
|
|
502
|
+
class: "title-after-container"
|
|
503
|
+
}, Ke = { class: "page-header-actions-container" }, qe = {
|
|
504
|
+
key: 0,
|
|
505
|
+
class: "page-layout-aside-container",
|
|
506
|
+
"data-testid": "page-layout-aside"
|
|
507
|
+
}, Je = { class: "page-layout-content" }, Ye = /*#__PURE__*/ Ce(/* @__PURE__ */ l({
|
|
508
|
+
__name: "PageLayout",
|
|
509
|
+
props: {
|
|
510
|
+
breadcrumbs: { default: () => [] },
|
|
511
|
+
title: {},
|
|
512
|
+
backTo: {},
|
|
513
|
+
tabs: { default: () => [] },
|
|
514
|
+
anchors: { default: () => [] },
|
|
515
|
+
pageShortcutData: {}
|
|
516
|
+
},
|
|
517
|
+
setup(e) {
|
|
518
|
+
N((e) => ({ a3279be2: G.value }));
|
|
519
|
+
let s = p("app:navigateTo", null), l = p(Re, null), u = p("app:pageShortcutsContext", null), { i18n: { t: d } } = ce.useI18n(), h = z(), v = R(), y = te(), b = () => !!e.title || !!y.title, O = t(() => !!(e.breadcrumbs && e.breadcrumbs.length)), k = t(() => !!(e.tabs && e.tabs.length)), B = t(() => typeof e.backTo == "string"), V = t(() => j(l) === !0), H = () => V.value && !b() && !O.value, U = () => k.value && !H(), W = t(() => V.value && !k.value && !!(e.anchors && e.anchors.length)), { height: se } = _e(P("page-layout-header"), void 0, { box: "border-box" }), G = t(() => `calc(${se.value}px + var(--kui-space-60, ${le}))`), ue = t(() => !!e.pageShortcutData && !!e.pageShortcutData.entityType && !!e.pageShortcutData.label), q = t(() => ue.value && !!u && "onFavoriteToggle" in u && typeof u.onFavoriteToggle == "function"), J = w(0), Y = t(() => !!u && "isFavorite" in u && typeof u.isFavorite == "function" && u.isFavorite(e.pageShortcutData) === !0), X = async () => {
|
|
520
|
+
e.backTo && (typeof e.backTo == "object" ? h.push(e.backTo) : typeof s == "function" ? await s(e.backTo) : window.location.href = e.backTo);
|
|
521
|
+
}, Z = w(0), Q = t(() => Z.value > 0);
|
|
522
|
+
C(Le, () => (Z.value++, () => {
|
|
523
|
+
Z.value--;
|
|
524
|
+
}));
|
|
525
|
+
let fe = p(Le, null), pe = w(null);
|
|
526
|
+
typeof fe == "function" && (pe.value = fe());
|
|
527
|
+
let $ = () => {
|
|
528
|
+
u.onFavoriteToggle({
|
|
529
|
+
...e.pageShortcutData,
|
|
530
|
+
path: e.pageShortcutData?.path || v.fullPath
|
|
531
|
+
});
|
|
532
|
+
};
|
|
533
|
+
x(() => {
|
|
534
|
+
pe.value?.();
|
|
535
|
+
});
|
|
536
|
+
let me = de(() => {
|
|
537
|
+
!Q.value && ue.value && u && "onEntityPageVisit" in u && typeof u.onEntityPageVisit == "function" && (u.onEntityPageVisit({
|
|
538
|
+
...e.pageShortcutData,
|
|
539
|
+
path: e.pageShortcutData?.path || v?.fullPath
|
|
540
|
+
}), J.value++);
|
|
541
|
+
}, 500);
|
|
542
|
+
return F([() => e.pageShortcutData, () => v?.fullPath], () => {
|
|
543
|
+
me();
|
|
544
|
+
}, {
|
|
545
|
+
immediate: !0,
|
|
546
|
+
deep: !0
|
|
547
|
+
}), (t, s) => {
|
|
548
|
+
let l = D("KBreadcrumbs"), u = D("KTooltip"), p = D("router-view");
|
|
549
|
+
return S(), i("div", {
|
|
550
|
+
class: g(["kong-ui-public-page-layout", { "new-appearance": V.value }]),
|
|
551
|
+
"data-testid": "kong-ui-public-page-layout"
|
|
552
|
+
}, [Q.value ? r("", !0) : (S(), i("div", {
|
|
553
|
+
key: 0,
|
|
554
|
+
ref: "page-layout-header",
|
|
555
|
+
class: g(["page-layout-header", { "is-empty": H() }]),
|
|
556
|
+
"data-testid": "page-layout-header"
|
|
557
|
+
}, [a("div", ze, [
|
|
558
|
+
H() ? r("", !0) : (S(), i("div", Be, [O.value ? (S(), n(l, {
|
|
559
|
+
key: 0,
|
|
560
|
+
class: "header-breadcrumbs",
|
|
561
|
+
"data-testid": "page-layout-breadcrumbs",
|
|
562
|
+
"item-max-width": "25ch",
|
|
563
|
+
items: e.breadcrumbs
|
|
564
|
+
}, o({ _: 2 }, [V.value ? {
|
|
565
|
+
name: "divider",
|
|
566
|
+
fn: I(() => [c(M(ie), {
|
|
567
|
+
decorative: "",
|
|
568
|
+
size: `var(--kui-icon-size-30, ${M(K)})`
|
|
569
|
+
}, null, 8, ["size"])]),
|
|
570
|
+
key: "0"
|
|
571
|
+
} : void 0]), 1032, ["items"])) : r("", !0), a("div", Ve, [
|
|
572
|
+
e.backTo && !V.value ? (S(), n(ee(B.value ? "a" : "router-link"), m({ key: 0 }, B.value ? { href: e.backTo } : { to: e.backTo }, {
|
|
573
|
+
"aria-label": M(d)("back_button"),
|
|
574
|
+
class: "navigate-back",
|
|
575
|
+
"data-testid": "page-layout-navigate-back",
|
|
576
|
+
tabindex: "0",
|
|
577
|
+
onClick: L(X, ["prevent"]),
|
|
578
|
+
onKeydown: ne(L(X, ["prevent"]), ["enter"])
|
|
579
|
+
}), {
|
|
580
|
+
default: I(() => [c(M(re), {
|
|
581
|
+
decorative: "",
|
|
582
|
+
size: `var(--kui-icon-size-30, ${M(K)})`
|
|
583
|
+
}, null, 8, ["size"])]),
|
|
584
|
+
_: 1
|
|
585
|
+
}, 16, ["aria-label", "onKeydown"])) : r("", !0),
|
|
586
|
+
b() ? (S(), i("span", He, [E(t.$slots, "title", {}, () => [a("h1", Ue, A(e.title), 1)], !0)])) : r("", !0),
|
|
587
|
+
q.value ? (S(), i("div", {
|
|
588
|
+
key: J.value,
|
|
589
|
+
class: "favorite-button-container"
|
|
590
|
+
}, [c(u, {
|
|
591
|
+
placement: "right",
|
|
592
|
+
text: Y.value ? M(d)("favorite_button.remove_shortcut") : M(d)("favorite_button.save_shortcut")
|
|
593
|
+
}, {
|
|
594
|
+
default: I(() => [a("button", {
|
|
595
|
+
"aria-label": Y.value ? M(d)("favorite_button.remove_shortcut") : M(d)("favorite_button.save_shortcut"),
|
|
596
|
+
class: g(["favorite-button", { active: Y.value }]),
|
|
597
|
+
"data-testid": "page-layout-favorite-button",
|
|
598
|
+
type: "button",
|
|
599
|
+
onClick: $
|
|
600
|
+
}, [(S(), n(ee(Y.value ? M(ae) : M(oe)), {
|
|
601
|
+
decorative: "",
|
|
602
|
+
size: `var(--kui-icon-size-30, ${M(K)})`
|
|
603
|
+
}, null, 8, ["size"]))], 10, We)]),
|
|
604
|
+
_: 1
|
|
605
|
+
}, 8, ["text"])])) : r("", !0),
|
|
606
|
+
t.$slots["title-after"] && b() ? (S(), i("div", Ge, [E(t.$slots, "title-after", {}, void 0, !0)])) : r("", !0)
|
|
607
|
+
])])),
|
|
608
|
+
W.value && !H() ? (S(), n(Ie, {
|
|
609
|
+
key: 1,
|
|
610
|
+
anchors: e.anchors
|
|
611
|
+
}, null, 8, ["anchors"])) : r("", !0),
|
|
612
|
+
a("div", Ke, [E(t.$slots, "actions", {}, void 0, !0), s[0] ||= a("div", { "data-teleport-target": "ask-kai" }, null, -1)])
|
|
613
|
+
]), U() ? (S(), n(we, {
|
|
614
|
+
key: 0,
|
|
615
|
+
tabs: e.tabs
|
|
616
|
+
}, o({ _: 2 }, [T(e.tabs, (e) => ({
|
|
617
|
+
name: `tab-${e.key}`,
|
|
618
|
+
fn: I((n) => [E(t.$slots, `tab-${e.key}`, _(f(n)), void 0, !0)])
|
|
619
|
+
}))]), 1032, ["tabs"])) : r("", !0)], 2)), a("div", { class: g(["page-layout-content-container", { "has-nested-page-layout": Q.value }]) }, [V.value && t.$slots.aside ? (S(), i("div", qe, [E(t.$slots, "aside", {}, void 0, !0)])) : r("", !0), a("div", Je, [U() ? (S(), n(p, { key: 0 })) : E(t.$slots, "default", {}, void 0, !0, 1)])], 2)], 2);
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
}), [["__scopeId", "data-v-fa3bd24a"]]), Xe = {
|
|
623
|
+
key: 0,
|
|
624
|
+
class: "about-card-description",
|
|
625
|
+
"data-testid": "about-card-description"
|
|
626
|
+
}, Ze = {
|
|
627
|
+
key: 1,
|
|
628
|
+
class: "about-card-skeleton",
|
|
629
|
+
"data-testid": "about-card-skeleton"
|
|
630
|
+
}, Qe = {
|
|
631
|
+
key: 2,
|
|
632
|
+
class: "about-card-rows",
|
|
633
|
+
"data-testid": "about-card-rows"
|
|
634
|
+
}, $e = ["data-testid"], et = { class: "about-card-row-label" }, tt = { class: "about-card-row-text" }, nt = ["aria-label", "data-testid"], rt = { class: "about-card-row-value" }, it = { class: "about-card-row-text" }, at = {
|
|
635
|
+
key: 3,
|
|
636
|
+
class: "about-card-content",
|
|
637
|
+
"data-testid": "about-card-content"
|
|
638
|
+
}, ot = /*#__PURE__*/ Ce(/* @__PURE__ */ l({
|
|
639
|
+
__name: "AboutCard",
|
|
640
|
+
props: {
|
|
641
|
+
title: { default: "" },
|
|
642
|
+
titleTag: { default: "h2" },
|
|
643
|
+
description: { default: "" },
|
|
644
|
+
rows: { default: () => [] },
|
|
645
|
+
isLoading: {
|
|
646
|
+
type: Boolean,
|
|
647
|
+
default: !1
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
setup(l) {
|
|
651
|
+
let u = t(() => l.rows.length || 4);
|
|
652
|
+
return (t, d) => {
|
|
653
|
+
let f = D("KSkeletonBox"), p = D("KTooltip"), m = D("KCard");
|
|
654
|
+
return S(), n(m, {
|
|
655
|
+
class: "kong-ui-public-about-card",
|
|
656
|
+
title: l.title,
|
|
657
|
+
"title-tag": l.titleTag
|
|
658
|
+
}, o({
|
|
659
|
+
default: I(() => [
|
|
660
|
+
t.$slots.description || l.description ? (S(), i("p", Xe, [E(t.$slots, "description", {}, () => [s(A(l.description), 1)], !0)])) : r("", !0),
|
|
661
|
+
l.isLoading ? (S(), i("div", Ze, [(S(!0), i(e, null, T(u.value, (e) => (S(), n(f, {
|
|
662
|
+
key: e,
|
|
663
|
+
height: "2",
|
|
664
|
+
width: "100"
|
|
665
|
+
}))), 128))])) : l.rows.length ? (S(), i("dl", Qe, [(S(!0), i(e, null, T(l.rows, (e) => (S(), i("div", {
|
|
666
|
+
key: e.key,
|
|
667
|
+
class: "about-card-row",
|
|
668
|
+
"data-testid": `about-card-row-${e.key}`
|
|
669
|
+
}, [a("dt", et, [E(t.$slots, `label-${e.key}`, { row: e }, () => [a("span", tt, A(e.label), 1)], !0), e.tooltip ? (S(), n(p, {
|
|
670
|
+
key: 0,
|
|
671
|
+
text: e.tooltip
|
|
672
|
+
}, {
|
|
673
|
+
default: I(() => [a("button", {
|
|
674
|
+
"aria-label": e.tooltip,
|
|
675
|
+
class: "about-card-row-tooltip-trigger",
|
|
676
|
+
"data-testid": `about-card-row-${e.key}-tooltip`,
|
|
677
|
+
type: "button"
|
|
678
|
+
}, [c(M(U), { size: `var(--kui-icon-size-20, ${M(G)})` }, null, 8, ["size"])], 8, nt)]),
|
|
679
|
+
_: 2
|
|
680
|
+
}, 1032, ["text"])) : r("", !0)]), a("dd", rt, [E(t.$slots, `row-${e.key}`, { row: e }, () => [a("span", it, A(e.value), 1)], !0)])], 8, $e))), 128))])) : r("", !0),
|
|
681
|
+
t.$slots.default ? (S(), i("div", at, [E(t.$slots, "default", {}, void 0, !0)])) : r("", !0)
|
|
682
|
+
]),
|
|
683
|
+
_: 2
|
|
684
|
+
}, [t.$slots.title || l.title ? {
|
|
685
|
+
name: "title",
|
|
686
|
+
fn: I(() => [E(t.$slots, "title", {}, () => [s(A(l.title), 1)], !0)]),
|
|
687
|
+
key: "0"
|
|
688
|
+
} : void 0, t.$slots.actions ? {
|
|
689
|
+
name: "actions",
|
|
690
|
+
fn: I(() => [E(t.$slots, "actions", {}, void 0, !0)]),
|
|
691
|
+
key: "1"
|
|
692
|
+
} : void 0]), 1032, ["title", "title-tag"]);
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
}), [["__scopeId", "data-v-48c05270"]]);
|
|
696
|
+
export { ot as AboutCard, Re as NEW_APPEARANCE_INJECTION_KEY, Ye as PageLayout };
|