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