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