@kong-ui-public/page-layout 0.5.6 → 0.5.7-pr.3569.99a6e147b.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/package.json +1 -1
- package/dist/page-layout.es.js +0 -389
- package/dist/page-layout.umd.js +0 -1
- package/dist/style.css +0 -1
- package/dist/types/components/PageLayout.vue.d.ts +0 -12
- package/dist/types/components/PageLayout.vue.d.ts.map +0 -1
- package/dist/types/components/PageLayoutTabs.vue.d.ts +0 -21
- package/dist/types/components/PageLayoutTabs.vue.d.ts.map +0 -1
- package/dist/types/composables/index.d.ts +0 -6
- package/dist/types/composables/index.d.ts.map +0 -1
- package/dist/types/composables/useI18n.d.ts +0 -9
- package/dist/types/composables/useI18n.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/symbols.d.ts +0 -2
- package/dist/types/symbols.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -3
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/types/page-layout-tabs.d.ts +0 -22
- package/dist/types/types/page-layout-tabs.d.ts.map +0 -1
- package/dist/types/types/page-layout.d.ts +0 -50
- package/dist/types/types/page-layout.d.ts.map +0 -1
package/package.json
CHANGED
package/dist/page-layout.es.js
DELETED
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
import { getCurrentScope as rt, onScopeDispose as ut, toValue as F, watch as j, computed as g, shallowRef as lt, getCurrentInstance as ct, onMounted as Q, defineComponent as X, useCssVars as dt, unref as c, inject as L, useTemplateRef as U, ref as B, onBeforeUnmount as vt, resolveComponent as I, openBlock as s, createElementBlock as b, createElementVNode as w, normalizeClass as N, Fragment as O, renderList as R, createBlock as $, resolveDynamicComponent as W, mergeProps as Y, withKeys as tt, withModifiers as x, withCtx as C, renderSlot as _, createTextVNode as V, toDisplayString as z, createVNode as K, createCommentVNode as h, nextTick as Z, provide as ft, onUnmounted as bt, createSlots as pt, normalizeProps as yt, guardReactiveProps as mt } from "vue";
|
|
2
|
-
import { useRouter as et, useRoute as ht } from "vue-router";
|
|
3
|
-
import { createI18n as gt, i18nTComponent as kt } from "@kong-ui-public/i18n";
|
|
4
|
-
import { ChevronDownIcon as Tt, ArrowTopLeftIcon as wt, StarFillIcon as St, StarIcon as $t } from "@kong/icons";
|
|
5
|
-
const _t = "Go back", Ct = { save_shortcut: "Save page to shortcuts", remove_shortcut: "Remove page from shortcuts" }, It = { more_button: { label: "More", aria_label: "More tabs" } }, Dt = {
|
|
6
|
-
back_button: _t,
|
|
7
|
-
favorite_button: Ct,
|
|
8
|
-
tabs: It
|
|
9
|
-
};
|
|
10
|
-
function Pt() {
|
|
11
|
-
const t = gt("en-us", Dt);
|
|
12
|
-
return {
|
|
13
|
-
i18n: t,
|
|
14
|
-
i18nT: kt(t)
|
|
15
|
-
// Translation component <i18n-t>
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const at = {
|
|
19
|
-
useI18n: Pt
|
|
20
|
-
}, M = "16px", Bt = "16px";
|
|
21
|
-
function Kt(t, o) {
|
|
22
|
-
return rt() ? (ut(t, o), !0) : !1;
|
|
23
|
-
}
|
|
24
|
-
const Lt = typeof window < "u" && typeof document < "u";
|
|
25
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
26
|
-
const H = () => {
|
|
27
|
-
};
|
|
28
|
-
function Rt(t, o) {
|
|
29
|
-
function e(...n) {
|
|
30
|
-
return new Promise((d, i) => {
|
|
31
|
-
Promise.resolve(t(() => o.apply(this, n), {
|
|
32
|
-
fn: o,
|
|
33
|
-
thisArg: this,
|
|
34
|
-
args: n
|
|
35
|
-
})).then(d).catch(i);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return e;
|
|
39
|
-
}
|
|
40
|
-
function zt(t, o = {}) {
|
|
41
|
-
let e, n, d = H;
|
|
42
|
-
const i = (r) => {
|
|
43
|
-
clearTimeout(r), d(), d = H;
|
|
44
|
-
};
|
|
45
|
-
let p;
|
|
46
|
-
return (r) => {
|
|
47
|
-
const f = F(t), l = F(o.maxWait);
|
|
48
|
-
return e && i(e), f <= 0 || l !== void 0 && l <= 0 ? (n && (i(n), n = void 0), Promise.resolve(r())) : new Promise((u, T) => {
|
|
49
|
-
d = o.rejectOnCancel ? T : u, p = r, l && !n && (n = setTimeout(() => {
|
|
50
|
-
e && i(e), n = void 0, u(p());
|
|
51
|
-
}, l)), e = setTimeout(() => {
|
|
52
|
-
n && i(n), n = void 0, u(r());
|
|
53
|
-
}, f);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
// @__NO_SIDE_EFFECTS__
|
|
58
|
-
function Ft(t, o = 200, e = {}) {
|
|
59
|
-
return Rt(zt(o, e), t);
|
|
60
|
-
}
|
|
61
|
-
const Nt = Lt ? window : void 0;
|
|
62
|
-
function q(t) {
|
|
63
|
-
var o;
|
|
64
|
-
const e = F(t);
|
|
65
|
-
return (o = e?.$el) !== null && o !== void 0 ? o : e;
|
|
66
|
-
}
|
|
67
|
-
// @__NO_SIDE_EFFECTS__
|
|
68
|
-
function xt() {
|
|
69
|
-
const t = lt(!1), o = ct();
|
|
70
|
-
return o && Q(() => {
|
|
71
|
-
t.value = !0;
|
|
72
|
-
}, o), t;
|
|
73
|
-
}
|
|
74
|
-
// @__NO_SIDE_EFFECTS__
|
|
75
|
-
function Et(t) {
|
|
76
|
-
const o = /* @__PURE__ */ xt();
|
|
77
|
-
return g(() => (o.value, !!t()));
|
|
78
|
-
}
|
|
79
|
-
function At(t, o, e = {}) {
|
|
80
|
-
const { window: n = Nt, ...d } = e;
|
|
81
|
-
let i;
|
|
82
|
-
const p = /* @__PURE__ */ Et(() => n && "ResizeObserver" in n), y = () => {
|
|
83
|
-
i && (i.disconnect(), i = void 0);
|
|
84
|
-
}, r = j(g(() => {
|
|
85
|
-
const l = F(t);
|
|
86
|
-
return Array.isArray(l) ? l.map((u) => q(u)) : [q(l)];
|
|
87
|
-
}), (l) => {
|
|
88
|
-
if (y(), p.value && n) {
|
|
89
|
-
i = new ResizeObserver(o);
|
|
90
|
-
for (const u of l) u && i.observe(u, d);
|
|
91
|
-
}
|
|
92
|
-
}, {
|
|
93
|
-
immediate: !0,
|
|
94
|
-
flush: "post"
|
|
95
|
-
}), f = () => {
|
|
96
|
-
y(), r();
|
|
97
|
-
};
|
|
98
|
-
return Kt(f), {
|
|
99
|
-
isSupported: p,
|
|
100
|
-
stop: f
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const Ot = {
|
|
104
|
-
ref: "page-layout-tabs",
|
|
105
|
-
class: "page-layout-tabs",
|
|
106
|
-
"data-testid": "page-layout-tabs"
|
|
107
|
-
}, Vt = { key: 0 }, Wt = ["aria-label"], Mt = {
|
|
108
|
-
key: 0,
|
|
109
|
-
class: "layout-loader-container"
|
|
110
|
-
}, jt = /* @__PURE__ */ X({
|
|
111
|
-
__name: "PageLayoutTabs",
|
|
112
|
-
props: {
|
|
113
|
-
tabs: { default: () => [] }
|
|
114
|
-
},
|
|
115
|
-
setup(t) {
|
|
116
|
-
dt((v) => ({
|
|
117
|
-
v94e59ca2: c(i)
|
|
118
|
-
}));
|
|
119
|
-
const { i18n: { t: o } } = at.useI18n(), e = et(), n = L("app:navigateTo", null), d = (v) => {
|
|
120
|
-
if (typeof v.to != "string") {
|
|
121
|
-
e.push(v.to);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (typeof n != "function") {
|
|
125
|
-
window.location.href = v.to;
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
n(v.to);
|
|
129
|
-
}, i = Bt, p = U("page-layout-tabs"), y = U("page-layout-tabs-list"), r = B(t.tabs.length), f = B(!1), l = g(() => t.tabs.slice(0, r.value)), u = g(() => t.tabs.slice(r.value)), T = async () => {
|
|
130
|
-
if (!p.value || !y.value)
|
|
131
|
-
return;
|
|
132
|
-
f.value = !1, r.value = t.tabs.length, await Z();
|
|
133
|
-
const v = p.value?.getBoundingClientRect().width - parseInt(i) * 2;
|
|
134
|
-
let S = y.value?.getBoundingClientRect().width;
|
|
135
|
-
if (!v || !S) {
|
|
136
|
-
f.value = !0;
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
const P = 50;
|
|
140
|
-
for (; S + P > v && r.value > 1; )
|
|
141
|
-
r.value--, await Z(), S = y.value?.getBoundingClientRect().width || 0;
|
|
142
|
-
f.value = !0;
|
|
143
|
-
};
|
|
144
|
-
let k = null;
|
|
145
|
-
const D = () => {
|
|
146
|
-
k && clearTimeout(k), k = setTimeout(() => {
|
|
147
|
-
T();
|
|
148
|
-
}, 150);
|
|
149
|
-
};
|
|
150
|
-
return Q(() => {
|
|
151
|
-
T(), At(p, D);
|
|
152
|
-
}), vt(() => {
|
|
153
|
-
k && clearTimeout(k);
|
|
154
|
-
}), j(() => t.tabs, () => {
|
|
155
|
-
T();
|
|
156
|
-
}, { deep: !0 }), (v, S) => {
|
|
157
|
-
const P = I("KDropdownItem"), E = I("KDropdown"), m = I("KSkeletonBox");
|
|
158
|
-
return s(), b("nav", Ot, [
|
|
159
|
-
w("ul", {
|
|
160
|
-
ref: "page-layout-tabs-list",
|
|
161
|
-
class: N({ "layout-computing": !f.value })
|
|
162
|
-
}, [
|
|
163
|
-
(s(!0), b(O, null, R(l.value, (a) => (s(), b("li", {
|
|
164
|
-
key: `${a.key}-tab`
|
|
165
|
-
}, [
|
|
166
|
-
(s(), $(W(typeof a.to == "string" ? "a" : "router-link"), Y({ ref_for: !0 }, typeof a.to == "string" ? { href: a.to } : { to: a.to }, {
|
|
167
|
-
"aria-current": a.active ? "page" : void 0,
|
|
168
|
-
class: ["tab-link", { active: a.active }],
|
|
169
|
-
"data-testid": a.dataTestId ? a.dataTestId : `page-layout-tab-${a.key}`,
|
|
170
|
-
tabindex: "0",
|
|
171
|
-
onClick: x((A) => d(a), ["prevent"]),
|
|
172
|
-
onKeydown: tt(x((A) => d(a), ["prevent"]), ["enter"])
|
|
173
|
-
}), {
|
|
174
|
-
default: C(() => [
|
|
175
|
-
_(v.$slots, `tab-${a.key}`, { tab: a }, () => [
|
|
176
|
-
V(z(a.label), 1)
|
|
177
|
-
], !0)
|
|
178
|
-
]),
|
|
179
|
-
_: 2
|
|
180
|
-
}, 1040, ["aria-current", "class", "data-testid", "onClick", "onKeydown"]))
|
|
181
|
-
]))), 128)),
|
|
182
|
-
t.tabs.length > r.value ? (s(), b("li", Vt, [
|
|
183
|
-
K(E, { "kpop-attributes": {
|
|
184
|
-
placement: "bottom-end",
|
|
185
|
-
popoverElementAttributes: { "data-testid": "tabs-overflow-dropdown-popover" }
|
|
186
|
-
} }, {
|
|
187
|
-
items: C(() => [
|
|
188
|
-
(s(!0), b(O, null, R(u.value, (a) => (s(), $(P, {
|
|
189
|
-
key: `${a.key}-dropdown-item`,
|
|
190
|
-
"aria-current": a.active ? "page" : void 0,
|
|
191
|
-
"data-testid": a.dataTestId ? a.dataTestId : `page-layout-tab-${a.key}`,
|
|
192
|
-
item: {
|
|
193
|
-
label: a.label,
|
|
194
|
-
value: a.key,
|
|
195
|
-
to: a.to
|
|
196
|
-
},
|
|
197
|
-
selected: a.active
|
|
198
|
-
}, {
|
|
199
|
-
default: C(() => [
|
|
200
|
-
_(v.$slots, `tab-${a.key}`, { tab: a }, () => [
|
|
201
|
-
V(z(a.label), 1)
|
|
202
|
-
], !0)
|
|
203
|
-
]),
|
|
204
|
-
_: 2
|
|
205
|
-
}, 1032, ["aria-current", "data-testid", "item", "selected"]))), 128))
|
|
206
|
-
]),
|
|
207
|
-
default: C(() => [
|
|
208
|
-
w("button", {
|
|
209
|
-
"aria-label": c(o)("tabs.more_button.aria_label"),
|
|
210
|
-
class: N(["tab-link", { active: u.value.find((a) => a.active) }]),
|
|
211
|
-
"data-testid": "tabs-overflow-dropdown-button"
|
|
212
|
-
}, [
|
|
213
|
-
V(z(c(o)("tabs.more_button.label")) + " ", 1),
|
|
214
|
-
K(c(Tt), {
|
|
215
|
-
decorative: "",
|
|
216
|
-
size: `var(--kui-icon-size-30, ${c(M)})`
|
|
217
|
-
}, null, 8, ["size"])
|
|
218
|
-
], 10, Wt)
|
|
219
|
-
]),
|
|
220
|
-
_: 3
|
|
221
|
-
})
|
|
222
|
-
])) : h("", !0)
|
|
223
|
-
], 2),
|
|
224
|
-
f.value ? h("", !0) : (s(), b("div", Mt, [
|
|
225
|
-
(s(), b(O, null, R(3, (a) => K(m, {
|
|
226
|
-
key: `layout-loader-${a}`,
|
|
227
|
-
height: "1",
|
|
228
|
-
width: "5"
|
|
229
|
-
})), 64))
|
|
230
|
-
]))
|
|
231
|
-
], 512);
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
}), ot = (t, o) => {
|
|
235
|
-
const e = t.__vccOpts || t;
|
|
236
|
-
for (const [n, d] of o)
|
|
237
|
-
e[n] = d;
|
|
238
|
-
return e;
|
|
239
|
-
}, Gt = /* @__PURE__ */ ot(jt, [["__scopeId", "data-v-014ad9b1"]]), J = /* @__PURE__ */ Symbol("nested-page-layout-detection"), Ut = {
|
|
240
|
-
class: "kong-ui-public-page-layout",
|
|
241
|
-
"data-testid": "kong-ui-public-page-layout"
|
|
242
|
-
}, Zt = {
|
|
243
|
-
key: 0,
|
|
244
|
-
class: "page-layout-header",
|
|
245
|
-
"data-testid": "page-layout-header"
|
|
246
|
-
}, Ht = { class: "page-header-container" }, qt = { class: "page-header-start" }, Jt = { class: "title-container" }, Qt = {
|
|
247
|
-
key: 1,
|
|
248
|
-
class: "page-layout-title-wrapper"
|
|
249
|
-
}, Xt = {
|
|
250
|
-
class: "page-layout-title",
|
|
251
|
-
"data-testid": "page-layout-title"
|
|
252
|
-
}, Yt = ["aria-label"], te = {
|
|
253
|
-
key: 3,
|
|
254
|
-
class: "title-after-container"
|
|
255
|
-
}, ee = {
|
|
256
|
-
key: 0,
|
|
257
|
-
class: "page-header-actions-container"
|
|
258
|
-
}, ae = /* @__PURE__ */ X({
|
|
259
|
-
__name: "PageLayout",
|
|
260
|
-
props: {
|
|
261
|
-
breadcrumbs: { default: () => [] },
|
|
262
|
-
title: {},
|
|
263
|
-
backTo: {},
|
|
264
|
-
tabs: { default: () => [] },
|
|
265
|
-
pageShortcutData: {}
|
|
266
|
-
},
|
|
267
|
-
setup(t) {
|
|
268
|
-
const o = L("app:navigateTo", null), e = L("app:pageShortcutsContext", null), { i18n: { t: n } } = at.useI18n(), d = et(), i = ht(), p = g(() => !!(t.tabs && t.tabs.length)), y = g(() => typeof t.backTo == "string"), r = g(() => !!t.pageShortcutData && !!t.pageShortcutData.entityType && !!t.pageShortcutData.label), f = g(() => r.value && !!e && "onFavoriteToggle" in e && typeof e.onFavoriteToggle == "function"), l = B(0), u = g(() => !!e && "isFavorite" in e && typeof e.isFavorite == "function" && e.isFavorite(t.pageShortcutData) === !0), T = async () => {
|
|
269
|
-
if (t.backTo) {
|
|
270
|
-
if (typeof t.backTo == "object") {
|
|
271
|
-
d.push(t.backTo);
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
if (typeof o != "function") {
|
|
275
|
-
window.location.href = t.backTo;
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
await o(t.backTo);
|
|
279
|
-
}
|
|
280
|
-
}, k = B(0), D = g(() => k.value > 0);
|
|
281
|
-
ft(J, () => (k.value++, () => {
|
|
282
|
-
k.value--;
|
|
283
|
-
}));
|
|
284
|
-
const v = L(J, null), S = B(null);
|
|
285
|
-
typeof v == "function" && (S.value = v());
|
|
286
|
-
const P = () => {
|
|
287
|
-
e.onFavoriteToggle({ ...t.pageShortcutData, path: t.pageShortcutData?.path || i.fullPath });
|
|
288
|
-
};
|
|
289
|
-
bt(() => {
|
|
290
|
-
S.value?.();
|
|
291
|
-
});
|
|
292
|
-
const E = /* @__PURE__ */ Ft(() => {
|
|
293
|
-
!D.value && r.value && e && "onEntityPageVisit" in e && typeof e.onEntityPageVisit == "function" && (e.onEntityPageVisit({ ...t.pageShortcutData, path: t.pageShortcutData?.path || i?.fullPath }), l.value++);
|
|
294
|
-
}, 500);
|
|
295
|
-
return j([() => t.pageShortcutData, () => i?.fullPath], () => {
|
|
296
|
-
E();
|
|
297
|
-
}, { immediate: !0, deep: !0 }), (m, a) => {
|
|
298
|
-
const A = I("KBreadcrumbs"), nt = I("KTooltip"), st = I("router-view");
|
|
299
|
-
return s(), b("div", Ut, [
|
|
300
|
-
D.value ? h("", !0) : (s(), b("div", Zt, [
|
|
301
|
-
w("div", Ht, [
|
|
302
|
-
w("div", qt, [
|
|
303
|
-
t.breadcrumbs && t.breadcrumbs.length ? (s(), $(A, {
|
|
304
|
-
key: 0,
|
|
305
|
-
class: "header-breadcrumbs",
|
|
306
|
-
"data-testid": "page-layout-breadcrumbs",
|
|
307
|
-
"item-max-width": "25ch",
|
|
308
|
-
items: t.breadcrumbs
|
|
309
|
-
}, null, 8, ["items"])) : h("", !0),
|
|
310
|
-
w("div", Jt, [
|
|
311
|
-
t.backTo ? (s(), $(W(y.value ? "a" : "router-link"), Y({ key: 0 }, y.value ? { href: t.backTo } : { to: t.backTo }, {
|
|
312
|
-
"aria-label": c(n)("back_button"),
|
|
313
|
-
class: "navigate-back",
|
|
314
|
-
"data-testid": "page-layout-navigate-back",
|
|
315
|
-
tabindex: "0",
|
|
316
|
-
onClick: x(T, ["prevent"]),
|
|
317
|
-
onKeydown: tt(x(T, ["prevent"]), ["enter"])
|
|
318
|
-
}), {
|
|
319
|
-
default: C(() => [
|
|
320
|
-
K(c(wt), {
|
|
321
|
-
decorative: "",
|
|
322
|
-
size: `var(--kui-icon-size-30, ${c(M)})`
|
|
323
|
-
}, null, 8, ["size"])
|
|
324
|
-
]),
|
|
325
|
-
_: 1
|
|
326
|
-
}, 16, ["aria-label", "onKeydown"])) : h("", !0),
|
|
327
|
-
t.title || m.$slots.title ? (s(), b("span", Qt, [
|
|
328
|
-
_(m.$slots, "title", {}, () => [
|
|
329
|
-
w("h1", Xt, z(t.title), 1)
|
|
330
|
-
], !0)
|
|
331
|
-
])) : h("", !0),
|
|
332
|
-
f.value ? (s(), b("div", {
|
|
333
|
-
key: l.value,
|
|
334
|
-
class: "favorite-button-container"
|
|
335
|
-
}, [
|
|
336
|
-
K(nt, {
|
|
337
|
-
placement: "right",
|
|
338
|
-
text: u.value ? c(n)("favorite_button.remove_shortcut") : c(n)("favorite_button.save_shortcut")
|
|
339
|
-
}, {
|
|
340
|
-
default: C(() => [
|
|
341
|
-
w("button", {
|
|
342
|
-
"aria-label": u.value ? c(n)("favorite_button.remove_shortcut") : c(n)("favorite_button.save_shortcut"),
|
|
343
|
-
class: N(["favorite-button", { active: u.value }]),
|
|
344
|
-
"data-testid": "page-layout-favorite-button",
|
|
345
|
-
type: "button",
|
|
346
|
-
onClick: P
|
|
347
|
-
}, [
|
|
348
|
-
(s(), $(W(u.value ? c(St) : c($t)), {
|
|
349
|
-
decorative: "",
|
|
350
|
-
size: `var(--kui-icon-size-30, ${c(M)})`
|
|
351
|
-
}, null, 8, ["size"]))
|
|
352
|
-
], 10, Yt)
|
|
353
|
-
]),
|
|
354
|
-
_: 1
|
|
355
|
-
}, 8, ["text"])
|
|
356
|
-
])) : h("", !0),
|
|
357
|
-
m.$slots["title-after"] ? (s(), b("div", te, [
|
|
358
|
-
_(m.$slots, "title-after", {}, void 0, !0)
|
|
359
|
-
])) : h("", !0)
|
|
360
|
-
])
|
|
361
|
-
]),
|
|
362
|
-
m.$slots.actions ? (s(), b("div", ee, [
|
|
363
|
-
_(m.$slots, "actions", {}, void 0, !0)
|
|
364
|
-
])) : h("", !0)
|
|
365
|
-
]),
|
|
366
|
-
p.value ? (s(), $(Gt, {
|
|
367
|
-
key: 0,
|
|
368
|
-
tabs: t.tabs
|
|
369
|
-
}, pt({ _: 2 }, [
|
|
370
|
-
R(t.tabs, (G) => ({
|
|
371
|
-
name: `tab-${G.key}`,
|
|
372
|
-
fn: C((it) => [
|
|
373
|
-
_(m.$slots, `tab-${G.key}`, yt(mt(it)), void 0, !0)
|
|
374
|
-
])
|
|
375
|
-
}))
|
|
376
|
-
]), 1032, ["tabs"])) : h("", !0)
|
|
377
|
-
])),
|
|
378
|
-
w("div", {
|
|
379
|
-
class: N(["page-layout-content", { "has-nested-page-layout": D.value }])
|
|
380
|
-
}, [
|
|
381
|
-
p.value ? (s(), $(st, { key: 0 })) : _(m.$slots, "default", { key: 1 }, void 0, !0)
|
|
382
|
-
], 2)
|
|
383
|
-
]);
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
}), re = /* @__PURE__ */ ot(ae, [["__scopeId", "data-v-6a6363c7"]]);
|
|
387
|
-
export {
|
|
388
|
-
re as PageLayout
|
|
389
|
-
};
|
package/dist/page-layout.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n","@kong/icons"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f["kong-ui-public-page-layout"]={},f.Vue,f.VueRouter,f["kong-ui-public-i18n"],f.KongIcons))})(this,(function(f,t,w,_,T){"use strict";const K={back_button:"Go back",favorite_button:{save_shortcut:"Save page to shortcuts",remove_shortcut:"Remove page from shortcuts"},tabs:{more_button:{label:"More",aria_label:"More tabs"}}};function L(){const e=_.createI18n("en-us",K);return{i18n:e,i18nT:_.i18nTComponent(e)}}const $={useI18n:L},S="16px",z="16px";function R(e,n){return t.getCurrentScope()?(t.onScopeDispose(e,n),!0):!1}const F=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const D=()=>{};function M(e,n){function o(...r){return new Promise((d,i)=>{Promise.resolve(e(()=>n.apply(this,r),{fn:n,thisArg:this,args:r})).then(d).catch(i)})}return o}function O(e,n={}){let o,r,d=D;const i=s=>{clearTimeout(s),d(),d=D};let p;return s=>{const m=t.toValue(e),l=t.toValue(n.maxWait);return o&&i(o),m<=0||l!==void 0&&l<=0?(r&&(i(r),r=void 0),Promise.resolve(s())):new Promise((c,h)=>{d=n.rejectOnCancel?h:c,p=s,l&&!r&&(r=setTimeout(()=>{o&&i(o),r=void 0,c(p())},l)),o=setTimeout(()=>{r&&i(r),r=void 0,c(s())},m)})}}function A(e,n=200,o={}){return M(O(n,o),e)}const j=F?window:void 0;function E(e){var n;const o=t.toValue(e);return(n=o?.$el)!==null&&n!==void 0?n:o}function W(){const e=t.shallowRef(!1),n=t.getCurrentInstance();return n&&t.onMounted(()=>{e.value=!0},n),e}function G(e){const n=W();return t.computed(()=>(n.value,!!e()))}function q(e,n,o={}){const{window:r=j,...d}=o;let i;const p=G(()=>r&&"ResizeObserver"in r),y=()=>{i&&(i.disconnect(),i=void 0)},s=t.watch(t.computed(()=>{const l=t.toValue(e);return Array.isArray(l)?l.map(c=>E(c)):[E(l)]}),l=>{if(y(),p.value&&r){i=new ResizeObserver(n);for(const c of l)c&&i.observe(c,d)}},{immediate:!0,flush:"post"}),m=()=>{y(),s()};return R(m),{isSupported:p,stop:m}}const U={ref:"page-layout-tabs",class:"page-layout-tabs","data-testid":"page-layout-tabs"},Z={key:0},H=["aria-label"],J={key:0,class:"layout-loader-container"},Q=t.defineComponent({__name:"PageLayoutTabs",props:{tabs:{default:()=>[]}},setup(e){t.useCssVars(u=>({v94e59ca2:t.unref(i)}));const{i18n:{t:n}}=$.useI18n(),o=w.useRouter(),r=t.inject("app:navigateTo",null),d=u=>{if(typeof u.to!="string"){o.push(u.to);return}if(typeof r!="function"){window.location.href=u.to;return}r(u.to)},i=z,p=t.useTemplateRef("page-layout-tabs"),y=t.useTemplateRef("page-layout-tabs-list"),s=t.ref(e.tabs.length),m=t.ref(!1),l=t.computed(()=>e.tabs.slice(0,s.value)),c=t.computed(()=>e.tabs.slice(s.value)),h=async()=>{if(!p.value||!y.value)return;m.value=!1,s.value=e.tabs.length,await t.nextTick();const u=p.value?.getBoundingClientRect().width-parseInt(i)*2;let g=y.value?.getBoundingClientRect().width;if(!u||!g){m.value=!0;return}const C=50;for(;g+C>u&&s.value>1;)s.value--,await t.nextTick(),g=y.value?.getBoundingClientRect().width||0;m.value=!0};let k=null;const B=()=>{k&&clearTimeout(k),k=setTimeout(()=>{h()},150)};return t.onMounted(()=>{h(),q(p,B)}),t.onBeforeUnmount(()=>{k&&clearTimeout(k)}),t.watch(()=>e.tabs,()=>{h()},{deep:!0}),(u,g)=>{const C=t.resolveComponent("KDropdownItem"),V=t.resolveComponent("KDropdown"),b=t.resolveComponent("KSkeletonBox");return t.openBlock(),t.createElementBlock("nav",U,[t.createElementVNode("ul",{ref:"page-layout-tabs-list",class:t.normalizeClass({"layout-computing":!m.value})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,a=>(t.openBlock(),t.createElementBlock("li",{key:`${a.key}-tab`},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(typeof a.to=="string"?"a":"router-link"),t.mergeProps({ref_for:!0},typeof a.to=="string"?{href:a.to}:{to:a.to},{"aria-current":a.active?"page":void 0,class:["tab-link",{active:a.active}],"data-testid":a.dataTestId?a.dataTestId:`page-layout-tab-${a.key}`,tabindex:"0",onClick:t.withModifiers(N=>d(a),["prevent"]),onKeydown:t.withKeys(t.withModifiers(N=>d(a),["prevent"]),["enter"])}),{default:t.withCtx(()=>[t.renderSlot(u.$slots,`tab-${a.key}`,{tab:a},()=>[t.createTextVNode(t.toDisplayString(a.label),1)],!0)]),_:2},1040,["aria-current","class","data-testid","onClick","onKeydown"]))]))),128)),e.tabs.length>s.value?(t.openBlock(),t.createElementBlock("li",Z,[t.createVNode(V,{"kpop-attributes":{placement:"bottom-end",popoverElementAttributes:{"data-testid":"tabs-overflow-dropdown-popover"}}},{items:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,a=>(t.openBlock(),t.createBlock(C,{key:`${a.key}-dropdown-item`,"aria-current":a.active?"page":void 0,"data-testid":a.dataTestId?a.dataTestId:`page-layout-tab-${a.key}`,item:{label:a.label,value:a.key,to:a.to},selected:a.active},{default:t.withCtx(()=>[t.renderSlot(u.$slots,`tab-${a.key}`,{tab:a},()=>[t.createTextVNode(t.toDisplayString(a.label),1)],!0)]),_:2},1032,["aria-current","data-testid","item","selected"]))),128))]),default:t.withCtx(()=>[t.createElementVNode("button",{"aria-label":t.unref(n)("tabs.more_button.aria_label"),class:t.normalizeClass(["tab-link",{active:c.value.find(a=>a.active)}]),"data-testid":"tabs-overflow-dropdown-button"},[t.createTextVNode(t.toDisplayString(t.unref(n)("tabs.more_button.label"))+" ",1),t.createVNode(t.unref(T.ChevronDownIcon),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(S)})`},null,8,["size"])],10,H)]),_:3})])):t.createCommentVNode("",!0)],2),m.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",J,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(3,a=>t.createVNode(b,{key:`layout-loader-${a}`,height:"1",width:"5"})),64))]))],512)}}}),I=(e,n)=>{const o=e.__vccOpts||e;for(const[r,d]of n)o[r]=d;return o},X=I(Q,[["__scopeId","data-v-014ad9b1"]]),P=Symbol("nested-page-layout-detection"),Y={class:"kong-ui-public-page-layout","data-testid":"kong-ui-public-page-layout"},v={key:0,class:"page-layout-header","data-testid":"page-layout-header"},tt={class:"page-header-container"},et={class:"page-header-start"},ot={class:"title-container"},at={key:1,class:"page-layout-title-wrapper"},nt={class:"page-layout-title","data-testid":"page-layout-title"},rt=["aria-label"],it={key:3,class:"title-after-container"},st={key:0,class:"page-header-actions-container"},ct=I(t.defineComponent({__name:"PageLayout",props:{breadcrumbs:{default:()=>[]},title:{},backTo:{},tabs:{default:()=>[]},pageShortcutData:{}},setup(e){const n=t.inject("app:navigateTo",null),o=t.inject("app:pageShortcutsContext",null),{i18n:{t:r}}=$.useI18n(),d=w.useRouter(),i=w.useRoute(),p=t.computed(()=>!!(e.tabs&&e.tabs.length)),y=t.computed(()=>typeof e.backTo=="string"),s=t.computed(()=>!!e.pageShortcutData&&!!e.pageShortcutData.entityType&&!!e.pageShortcutData.label),m=t.computed(()=>s.value&&!!o&&"onFavoriteToggle"in o&&typeof o.onFavoriteToggle=="function"),l=t.ref(0),c=t.computed(()=>!!o&&"isFavorite"in o&&typeof o.isFavorite=="function"&&o.isFavorite(e.pageShortcutData)===!0),h=async()=>{if(e.backTo){if(typeof e.backTo=="object"){d.push(e.backTo);return}if(typeof n!="function"){window.location.href=e.backTo;return}await n(e.backTo)}},k=t.ref(0),B=t.computed(()=>k.value>0);t.provide(P,()=>(k.value++,()=>{k.value--}));const u=t.inject(P,null),g=t.ref(null);typeof u=="function"&&(g.value=u());const C=()=>{o.onFavoriteToggle({...e.pageShortcutData,path:e.pageShortcutData?.path||i.fullPath})};t.onUnmounted(()=>{g.value?.()});const V=A(()=>{!B.value&&s.value&&o&&"onEntityPageVisit"in o&&typeof o.onEntityPageVisit=="function"&&(o.onEntityPageVisit({...e.pageShortcutData,path:e.pageShortcutData?.path||i?.fullPath}),l.value++)},500);return t.watch([()=>e.pageShortcutData,()=>i?.fullPath],()=>{V()},{immediate:!0,deep:!0}),(b,a)=>{const N=t.resolveComponent("KBreadcrumbs"),lt=t.resolveComponent("KTooltip"),dt=t.resolveComponent("router-view");return t.openBlock(),t.createElementBlock("div",Y,[B.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",v,[t.createElementVNode("div",tt,[t.createElementVNode("div",et,[e.breadcrumbs&&e.breadcrumbs.length?(t.openBlock(),t.createBlock(N,{key:0,class:"header-breadcrumbs","data-testid":"page-layout-breadcrumbs","item-max-width":"25ch",items:e.breadcrumbs},null,8,["items"])):t.createCommentVNode("",!0),t.createElementVNode("div",ot,[e.backTo?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(y.value?"a":"router-link"),t.mergeProps({key:0},y.value?{href:e.backTo}:{to:e.backTo},{"aria-label":t.unref(r)("back_button"),class:"navigate-back","data-testid":"page-layout-navigate-back",tabindex:"0",onClick:t.withModifiers(h,["prevent"]),onKeydown:t.withKeys(t.withModifiers(h,["prevent"]),["enter"])}),{default:t.withCtx(()=>[t.createVNode(t.unref(T.ArrowTopLeftIcon),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(S)})`},null,8,["size"])]),_:1},16,["aria-label","onKeydown"])):t.createCommentVNode("",!0),e.title||b.$slots.title?(t.openBlock(),t.createElementBlock("span",at,[t.renderSlot(b.$slots,"title",{},()=>[t.createElementVNode("h1",nt,t.toDisplayString(e.title),1)],!0)])):t.createCommentVNode("",!0),m.value?(t.openBlock(),t.createElementBlock("div",{key:l.value,class:"favorite-button-container"},[t.createVNode(lt,{placement:"right",text:c.value?t.unref(r)("favorite_button.remove_shortcut"):t.unref(r)("favorite_button.save_shortcut")},{default:t.withCtx(()=>[t.createElementVNode("button",{"aria-label":c.value?t.unref(r)("favorite_button.remove_shortcut"):t.unref(r)("favorite_button.save_shortcut"),class:t.normalizeClass(["favorite-button",{active:c.value}]),"data-testid":"page-layout-favorite-button",type:"button",onClick:C},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(c.value?t.unref(T.StarFillIcon):t.unref(T.StarIcon)),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(S)})`},null,8,["size"]))],10,rt)]),_:1},8,["text"])])):t.createCommentVNode("",!0),b.$slots["title-after"]?(t.openBlock(),t.createElementBlock("div",it,[t.renderSlot(b.$slots,"title-after",{},void 0,!0)])):t.createCommentVNode("",!0)])]),b.$slots.actions?(t.openBlock(),t.createElementBlock("div",st,[t.renderSlot(b.$slots,"actions",{},void 0,!0)])):t.createCommentVNode("",!0)]),p.value?(t.openBlock(),t.createBlock(X,{key:0,tabs:e.tabs},t.createSlots({_:2},[t.renderList(e.tabs,x=>({name:`tab-${x.key}`,fn:t.withCtx(ut=>[t.renderSlot(b.$slots,`tab-${x.key}`,t.normalizeProps(t.guardReactiveProps(ut)),void 0,!0)])}))]),1032,["tabs"])):t.createCommentVNode("",!0)])),t.createElementVNode("div",{class:t.normalizeClass(["page-layout-content",{"has-nested-page-layout":B.value}])},[p.value?(t.openBlock(),t.createBlock(dt,{key:0})):t.renderSlot(b.$slots,"default",{key:1},void 0,!0)],2)])}}}),[["__scopeId","data-v-6a6363c7"]]);f.PageLayout=ct,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/style.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.page-layout-tabs[data-v-014ad9b1]{align-items:flex-end;border-bottom:1px solid #e0e4ea;border-bottom:var(--kui-border-width-10, 1px) solid var(--kui-color-border, #e0e4ea);box-sizing:border-box;display:flex;height:34px;overflow-x:clip;padding:0px var(--v94e59ca2);padding:var(--kui-space-0, 0px) var(--v94e59ca2);position:relative;width:100%}.page-layout-tabs a[data-v-014ad9b1],.page-layout-tabs button[data-v-014ad9b1]{background-color:#0000;background-color:var(--kui-color-background-transparent, rgba(0, 0, 0, 0));border:none;color:inherit;cursor:pointer;outline:none;padding:0;padding:var(--kui-space-0, 0px);text-decoration:none}.page-layout-tabs ul[data-v-014ad9b1]{display:flex;gap:20px;gap:var(--kui-space-70, 20px);list-style:none;margin:0;margin:var(--kui-space-0, 0px);margin-bottom:-1px;margin-bottom:calc(-1 * var(--kui-border-width-10, 1px));max-width:100%;padding:0;padding:var(--kui-space-0, 0px)}.page-layout-tabs ul.layout-computing[data-v-014ad9b1]{height:0;visibility:hidden}.page-layout-tabs ul li[data-v-014ad9b1]{display:flex}.page-layout-tabs ul li .tab-link[data-v-014ad9b1]{align-items:center;border-bottom:2px solid rgba(0,0,0,0);border-bottom:var(--kui-border-width-20, 2px) solid var(--kui-color-border-transparent, rgba(0, 0, 0, 0));border-radius:4px 4px 0 0;border-radius:var(--kui-border-radius-20, 4px) var(--kui-border-radius-20, 4px) var(--kui-border-radius-0, 0px) var(--kui-border-radius-0, 0px);color:#52596e;color:var(--kui-color-text-neutral-strong, #52596e);cursor:pointer;display:flex;font-size:12px;font-size:var(--kui-font-size-20, 12px);font-weight:500;font-weight:var(--kui-font-weight-medium, 500);gap:6px;gap:var(--kui-space-30, 6px);line-height:20px;line-height:var(--kui-line-height-30, 20px);padding:6px 0;padding:var(--kui-space-30, 6px) var(--kui-space-0, 0px);text-decoration:none;transition:color .2s ease-in,border-color .2s ease-in,font-weight .2s ease-in;white-space:nowrap}.page-layout-tabs ul li .tab-link[data-v-014ad9b1]:hover{border-bottom:2px solid #afb7c5;border-bottom:var(--kui-border-width-20, 2px) solid var(--kui-color-border-neutral-weak, #afb7c5);color:#000933;color:var(--kui-color-text, #000933);text-decoration:none}.page-layout-tabs ul li .tab-link[data-v-014ad9b1]:focus-visible{box-shadow:0 0 0 4px #0044f433;box-shadow:var(--kui-shadow-focus, 0px 0px 0px 4px rgba(0, 68, 244, .2));text-decoration:none}.page-layout-tabs ul li .tab-link.active[data-v-014ad9b1]{border-bottom:2px solid #0044f4;border-bottom:var(--kui-border-width-20, 2px) solid var(--kui-color-border-primary, #0044f4);color:#0044f4!important;color:var(--kui-color-text-primary, #0044f4)!important;font-weight:600;font-weight:var(--kui-font-weight-semibold, 600);text-decoration:none}.page-layout-tabs .layout-loader-container[data-v-014ad9b1]{align-items:center;display:flex;gap:20px;gap:var(--kui-space-70, 20px);height:34px;inset:0;left:var(--v94e59ca2);position:absolute}.kong-ui-public-page-layout[data-v-6a6363c7]{box-sizing:border-box;font-family:Inter,Roboto,Helvetica,sans-serif;font-family:var(--kui-font-family-text, "Inter", Roboto, Helvetica, sans-serif)}.kong-ui-public-page-layout .page-layout-header[data-v-6a6363c7]{background-color:#fff;background-color:var(--kui-color-background, #ffffff);display:flex;flex-direction:column;gap:8px;gap:var(--kui-space-40, 8px)}.kong-ui-public-page-layout .page-layout-header .page-header-container[data-v-6a6363c7]{align-items:flex-end;display:flex;gap:6px;gap:var(--kui-space-30, 6px);justify-content:space-between;padding:16px 16px 0;padding:var(--kui-space-60, 16px) var(--kui-space-60, 16px) var(--kui-space-0, 0px) var(--kui-space-60, 16px)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start[data-v-6a6363c7]{min-width:0}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .header-breadcrumbs[data-v-6a6363c7] .breadcrumbs-item-container:first-child .breadcrumbs-item{padding-left:0;padding-left:var(--kui-space-0, 0px)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .header-breadcrumbs[data-v-6a6363c7] .breadcrumbs-item-container .breadcrumbs-item.active .breadcrumbs-text{color:#6c7489;color:var(--kui-color-text-neutral, #6c7489)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container[data-v-6a6363c7]{align-items:flex-end;display:flex;gap:4px;gap:var(--kui-space-20, 4px)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .navigate-back[data-v-6a6363c7],.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button[data-v-6a6363c7]{background-color:#0000;background-color:var(--kui-color-background-transparent, rgba(0, 0, 0, 0));border:none;border-radius:4px;border-radius:var(--kui-border-radius-20, 4px);color:#6c7489;color:var(--kui-color-text-neutral, #6c7489);cursor:pointer;outline:none;padding:4px;padding:var(--kui-space-20, 4px);transition:background-color .2s ease-in,color .2s ease-in}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .navigate-back[data-v-6a6363c7]:hover,.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button[data-v-6a6363c7]:hover{color:#000933;color:var(--kui-color-text, #000933)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .navigate-back[data-v-6a6363c7]:focus-visible,.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button[data-v-6a6363c7]:focus-visible{box-shadow:0 0 0 4px #0044f433;box-shadow:var(--kui-shadow-focus, 0px 0px 0px 4px rgba(0, 68, 244, .2))}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .page-layout-title-wrapper[data-v-6a6363c7]{min-width:0;overflow:hidden}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .page-layout-title-wrapper[data-v-6a6363c7]>*{color:#000933;color:var(--kui-color-text, #000933);font-size:18px;font-size:var(--kui-font-size-50, 18px);font-weight:600;font-weight:var(--kui-font-weight-semibold, 600);line-height:24px;line-height:var(--kui-line-height-40, 24px);margin:0;margin:var(--kui-space-0, 0px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button-container[data-v-6a6363c7]{align-self:center;display:flex;margin-left:4px;margin-left:var(--kui-space-20, 4px)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button-container .favorite-button[data-v-6a6363c7]{color:#afb7c5;color:var(--kui-color-text-neutral-weak, #afb7c5);padding:0;padding:var(--kui-space-0, 0px)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button-container .favorite-button[data-v-6a6363c7]:hover{color:#6c7489;color:var(--kui-color-text-neutral, #6c7489)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button-container .favorite-button.active[data-v-6a6363c7]{color:#ffc400;color:var(--kui-color-text-warning-weak, #ffc400)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .title-after-container[data-v-6a6363c7]{align-items:flex-end;display:flex;gap:6px;gap:var(--kui-space-30, 6px);margin-left:4px;margin-left:var(--kui-space-20, 4px)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-actions-container[data-v-6a6363c7]{align-items:center;display:flex;gap:6px;gap:var(--kui-space-30, 6px)}.kong-ui-public-page-layout .page-layout-header:not(:has(.page-layout-tabs)) .page-header-container[data-v-6a6363c7]{border-bottom:1px solid #e0e4ea;border-bottom:var(--kui-border-width-10, 1px) solid var(--kui-color-border, #e0e4ea);padding:16px;padding:var(--kui-space-60, 16px)}.kong-ui-public-page-layout .page-layout-content[data-v-6a6363c7]{background-color:#f9fafb;background-color:var(--kui-color-background-neutral-weakest, #f9fafb);display:flex;flex-direction:column;gap:12px;gap:var(--kui-space-50, 12px);padding:16px;padding:var(--kui-space-60, 16px)}.kong-ui-public-page-layout .page-layout-content.has-nested-page-layout[data-v-6a6363c7]{padding:0;padding:var(--kui-space-0, 0px)}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PageLayoutProps, PageLayoutSlots } from '../types';
|
|
2
|
-
type __VLS_Slots = PageLayoutSlots;
|
|
3
|
-
declare const __VLS_base: import("vue").DefineComponent<PageLayoutProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageLayoutProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
4
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
5
|
-
declare const _default: typeof __VLS_export;
|
|
6
|
-
export default _default;
|
|
7
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
8
|
-
new (): {
|
|
9
|
-
$slots: S;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=PageLayout.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayout.vue"],"names":[],"mappings":"AA+XA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAoB,MAAM,UAAU,CAAA;AAmBlF,KAAK,WAAW,GAAG,eAAe,CAAC;AAmXnC,QAAA,MAAM,UAAU,0SAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { PageLayoutTabsProps, PageLayoutTab } from '../types';
|
|
2
|
-
declare var __VLS_11: `tab-${string}`, __VLS_12: {
|
|
3
|
-
tab: PageLayoutTab;
|
|
4
|
-
}, __VLS_33: `tab-${string}`, __VLS_34: {
|
|
5
|
-
tab: PageLayoutTab;
|
|
6
|
-
};
|
|
7
|
-
type __VLS_Slots = {} & {
|
|
8
|
-
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
9
|
-
} & {
|
|
10
|
-
[K in NonNullable<typeof __VLS_33>]?: (props: typeof __VLS_34) => any;
|
|
11
|
-
};
|
|
12
|
-
declare const __VLS_base: import("vue").DefineComponent<PageLayoutTabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageLayoutTabsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
16
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
-
new (): {
|
|
18
|
-
$slots: S;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=PageLayoutTabs.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayoutTabs.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayoutTabs.vue"],"names":[],"mappings":"AA6SA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAqUlE,QAAA,IAAI,QAAQ,iBAAW,EAAE,QAAQ;;CAAU,EAAE,QAAQ,iBAAW,EAAE,QAAQ;;CAAY,CAAE;AACxF,KAAK,WAAW,GAAG,EAAE,GACnB;KAAG,CAAC,IAAI,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG;CAAE,GACzE;KAAG,CAAC,IAAI,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG;CAAE,CAAC;AAQ5E,QAAA,MAAM,UAAU,kTAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAA;;;;AAE/B,wBAEC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createI18n, i18nTComponent } from '@kong-ui-public/i18n';
|
|
2
|
-
import english from '../locales/en.json';
|
|
3
|
-
interface UseI18nReturn {
|
|
4
|
-
i18n: ReturnType<typeof createI18n<typeof english>>;
|
|
5
|
-
i18nT: ReturnType<typeof i18nTComponent<typeof english>>;
|
|
6
|
-
}
|
|
7
|
-
export default function useI18n(): UseI18nReturn;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=useI18n.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../src/composables/useI18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,OAAO,MAAM,oBAAoB,CAAA;AAExC,UAAU,aAAa;IACrB,IAAI,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;IACnD,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,CAAA;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,aAAa,CAO/C"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,6BAA6B,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB,cAAc,SAAS,CAAA"}
|
package/dist/types/symbols.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/symbols.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,eAAyC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { RouteLocationRaw } from 'vue-router';
|
|
2
|
-
export interface PageLayoutTab {
|
|
3
|
-
/** The unique kebab-case key of the tab */
|
|
4
|
-
key: string;
|
|
5
|
-
/** The display text of the navbar tab */
|
|
6
|
-
label: string;
|
|
7
|
-
/** The [Vue Router `to` object](https://router.vuejs.org/api/interfaces/RouterLinkProps.html#to) or a URL path (relative or absolute) to navigate to on click */
|
|
8
|
-
to: string | RouteLocationRaw;
|
|
9
|
-
/** Is the navbar tab active */
|
|
10
|
-
active?: boolean;
|
|
11
|
-
/** The data-testid attribute to apply to the navbar tab. Auto-generated if not provided */
|
|
12
|
-
dataTestId?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface PageLayoutTabsProps {
|
|
15
|
-
tabs?: PageLayoutTab[];
|
|
16
|
-
}
|
|
17
|
-
export interface PageLayoutTabsSlots {
|
|
18
|
-
[key: `tab-${string}`]: (props: {
|
|
19
|
-
tab: PageLayoutTab;
|
|
20
|
-
}) => any;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=page-layout-tabs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-layout-tabs.d.ts","sourceRoot":"","sources":["../../../src/types/page-layout-tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAA;IACX,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,iKAAiK;IACjK,EAAE,EAAE,MAAM,GAAG,gBAAgB,CAAA;IAC7B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,2FAA2F;IAC3F,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,aAAa,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,CAAC,GAAG,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,aAAa,CAAA;KAAE,KAAK,GAAG,CAAA;CAC/D"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { BreadcrumbItem } from '@kong/kongponents';
|
|
2
|
-
import type { PageLayoutTab } from './';
|
|
3
|
-
import type { RouteLocationRaw } from 'vue-router';
|
|
4
|
-
export interface PageShortcutData {
|
|
5
|
-
/** The display label of the page shortcut */
|
|
6
|
-
label: string;
|
|
7
|
-
/** The URL path of the page shortcut */
|
|
8
|
-
path?: string;
|
|
9
|
-
/** The entity type of the page shortcut (snake_case, e.g. "gateway_service") */
|
|
10
|
-
entityType: string;
|
|
11
|
-
/** The display label of the parent entity */
|
|
12
|
-
parentLabel?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface PageLayoutProps {
|
|
15
|
-
/** Breadcrumb items */
|
|
16
|
-
breadcrumbs?: BreadcrumbItem[];
|
|
17
|
-
/** Page title */
|
|
18
|
-
title?: string;
|
|
19
|
-
/** The URL to navigate back to when the back button is clicked */
|
|
20
|
-
backTo?: string | RouteLocationRaw;
|
|
21
|
-
/** Tabs */
|
|
22
|
-
tabs?: PageLayoutTab[];
|
|
23
|
-
/** Providing this prop "marks" the current page as an entity page that can be added to shortcuts (favorites and recents) */
|
|
24
|
-
pageShortcutData?: PageShortcutData;
|
|
25
|
-
}
|
|
26
|
-
export interface PageLayoutSlots {
|
|
27
|
-
/**
|
|
28
|
-
* Default slot for page content
|
|
29
|
-
*/
|
|
30
|
-
default?(): any;
|
|
31
|
-
/**
|
|
32
|
-
* Actions slot for page actions
|
|
33
|
-
*/
|
|
34
|
-
actions?(): any;
|
|
35
|
-
/**
|
|
36
|
-
* Title slot for page title
|
|
37
|
-
*/
|
|
38
|
-
title?(): any;
|
|
39
|
-
/**
|
|
40
|
-
* Title after slot for page title after content
|
|
41
|
-
*/
|
|
42
|
-
'title-after'?(): any;
|
|
43
|
-
/**
|
|
44
|
-
* Per-tab slot for customizing the rendering of a specific tab. Slot name is `tab-${tab.key}`.
|
|
45
|
-
*/
|
|
46
|
-
[key: `tab-${string}`]: (props: {
|
|
47
|
-
tab: PageLayoutTab;
|
|
48
|
-
}) => any;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=page-layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page-layout.d.ts","sourceRoot":"","sources":["../../../src/types/page-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAA;IAC9B,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAA;IAClC,WAAW;IACX,IAAI,CAAC,EAAE,aAAa,EAAE,CAAA;IACtB,4HAA4H;IAC5H,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,CAAC,IAAI,GAAG,CAAA;IACf;;OAEG;IACH,OAAO,CAAC,IAAI,GAAG,CAAA;IACf;;OAEG;IACH,KAAK,CAAC,IAAI,GAAG,CAAA;IACb;;OAEG;IACH,aAAa,CAAC,IAAI,GAAG,CAAA;IACrB;;OAEG;IACH,CAAC,GAAG,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE;QAAE,GAAG,EAAE,aAAa,CAAA;KAAE,KAAK,GAAG,CAAA;CAC/D"}
|