@kong-ui-public/page-layout 0.2.43 → 0.3.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 +210 -197
- package/dist/page-layout.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/PageLayout.vue.d.ts.map +1 -1
- package/dist/types/components/PageLayoutTabs.vue.d.ts +18 -2
- package/dist/types/components/PageLayoutTabs.vue.d.ts.map +1 -1
- package/dist/types/types/page-layout-tabs.d.ts +5 -0
- package/dist/types/types/page-layout-tabs.d.ts.map +1 -1
- package/dist/types/types/page-layout.d.ts +7 -1
- package/dist/types/types/page-layout.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/page-layout.es.js
CHANGED
|
@@ -1,201 +1,200 @@
|
|
|
1
|
-
import { getCurrentScope as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { createI18n as
|
|
4
|
-
import { ArrowTopLeftIcon as
|
|
5
|
-
const
|
|
1
|
+
import { getCurrentScope as rt, onScopeDispose as ut, toValue as x, watch as j, computed as h, shallowRef as lt, getCurrentInstance as ct, onMounted as Q, defineComponent as X, useCssVars as dt, unref as d, inject as z, useTemplateRef as U, ref as K, onBeforeUnmount as vt, resolveComponent as P, openBlock as r, createElementBlock as p, createElementVNode as S, normalizeClass as E, Fragment as O, renderList as F, createBlock as _, resolveDynamicComponent as W, mergeProps as Y, withKeys as tt, withModifiers as A, withCtx as C, renderSlot as $, createTextVNode as V, toDisplayString as L, createVNode as R, createCommentVNode as g, 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 gt } from "vue-router";
|
|
3
|
+
import { createI18n as ht, 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 = {
|
|
6
6
|
save_shortcut: "Save page to shortcuts",
|
|
7
7
|
remove_shortcut: "Remove page from shortcuts"
|
|
8
|
-
},
|
|
8
|
+
}, It = {
|
|
9
9
|
more_button: {
|
|
10
10
|
label: "More",
|
|
11
11
|
aria_label: "More tabs"
|
|
12
12
|
}
|
|
13
|
-
},
|
|
14
|
-
back_button:
|
|
15
|
-
favorite_button:
|
|
16
|
-
tabs:
|
|
13
|
+
}, Pt = {
|
|
14
|
+
back_button: $t,
|
|
15
|
+
favorite_button: Ct,
|
|
16
|
+
tabs: It
|
|
17
17
|
};
|
|
18
|
-
function
|
|
19
|
-
const t =
|
|
18
|
+
function Dt() {
|
|
19
|
+
const t = ht("en-us", Pt);
|
|
20
20
|
return {
|
|
21
21
|
i18n: t,
|
|
22
|
-
i18nT:
|
|
22
|
+
i18nT: kt(t)
|
|
23
23
|
// Translation component <i18n-t>
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
useI18n:
|
|
28
|
-
},
|
|
29
|
-
function
|
|
30
|
-
return
|
|
26
|
+
const at = {
|
|
27
|
+
useI18n: Dt
|
|
28
|
+
}, M = "16px", Bt = "16px";
|
|
29
|
+
function Kt(t, o) {
|
|
30
|
+
return rt() ? (ut(t, o), !0) : !1;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Rt = typeof window < "u" && typeof document < "u";
|
|
33
33
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
34
34
|
const H = () => {
|
|
35
35
|
};
|
|
36
|
-
function
|
|
36
|
+
function zt(t, o) {
|
|
37
37
|
function e(...n) {
|
|
38
|
-
return new Promise((
|
|
38
|
+
return new Promise((v, s) => {
|
|
39
39
|
Promise.resolve(t(() => o.apply(this, n), {
|
|
40
40
|
fn: o,
|
|
41
41
|
thisArg: this,
|
|
42
42
|
args: n
|
|
43
|
-
})).then(
|
|
43
|
+
})).then(v).catch(s);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
return e;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
let e, n,
|
|
50
|
-
const
|
|
51
|
-
clearTimeout(u),
|
|
48
|
+
function Ft(t, o = {}) {
|
|
49
|
+
let e, n, v = H;
|
|
50
|
+
const s = (u) => {
|
|
51
|
+
clearTimeout(u), v(), v = H;
|
|
52
52
|
};
|
|
53
|
-
let
|
|
53
|
+
let y;
|
|
54
54
|
return (u) => {
|
|
55
|
-
const
|
|
56
|
-
return e &&
|
|
57
|
-
|
|
58
|
-
e &&
|
|
59
|
-
},
|
|
60
|
-
n &&
|
|
61
|
-
},
|
|
55
|
+
const b = x(t), c = x(o.maxWait);
|
|
56
|
+
return e && s(e), b <= 0 || c !== void 0 && c <= 0 ? (n && (s(n), n = void 0), Promise.resolve(u())) : new Promise((l, w) => {
|
|
57
|
+
v = o.rejectOnCancel ? w : l, y = u, c && !n && (n = setTimeout(() => {
|
|
58
|
+
e && s(e), n = void 0, l(y());
|
|
59
|
+
}, c)), e = setTimeout(() => {
|
|
60
|
+
n && s(n), n = void 0, l(u());
|
|
61
|
+
}, b);
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
// @__NO_SIDE_EFFECTS__
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function Lt(t, o = 200, e = {}) {
|
|
67
|
+
return zt(Ft(o, e), t);
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const xt = Rt ? window : void 0;
|
|
70
70
|
function q(t) {
|
|
71
71
|
var o;
|
|
72
|
-
const e =
|
|
72
|
+
const e = x(t);
|
|
73
73
|
return (o = e == null ? void 0 : e.$el) !== null && o !== void 0 ? o : e;
|
|
74
74
|
}
|
|
75
75
|
// @__NO_SIDE_EFFECTS__
|
|
76
|
-
function
|
|
77
|
-
const t =
|
|
76
|
+
function Et() {
|
|
77
|
+
const t = lt(!1), o = ct();
|
|
78
78
|
return o && Q(() => {
|
|
79
79
|
t.value = !0;
|
|
80
80
|
}, o), t;
|
|
81
81
|
}
|
|
82
82
|
// @__NO_SIDE_EFFECTS__
|
|
83
|
-
function
|
|
84
|
-
const o = /* @__PURE__ */
|
|
85
|
-
return
|
|
83
|
+
function At(t) {
|
|
84
|
+
const o = /* @__PURE__ */ Et();
|
|
85
|
+
return h(() => (o.value, !!t()));
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const { window: n =
|
|
89
|
-
let
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
}, u =
|
|
93
|
-
const
|
|
94
|
-
return Array.isArray(
|
|
95
|
-
}), (
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
for (const l of
|
|
87
|
+
function Nt(t, o, e = {}) {
|
|
88
|
+
const { window: n = xt, ...v } = e;
|
|
89
|
+
let s;
|
|
90
|
+
const y = /* @__PURE__ */ At(() => n && "ResizeObserver" in n), m = () => {
|
|
91
|
+
s && (s.disconnect(), s = void 0);
|
|
92
|
+
}, u = j(h(() => {
|
|
93
|
+
const c = x(t);
|
|
94
|
+
return Array.isArray(c) ? c.map((l) => q(l)) : [q(c)];
|
|
95
|
+
}), (c) => {
|
|
96
|
+
if (m(), y.value && n) {
|
|
97
|
+
s = new ResizeObserver(o);
|
|
98
|
+
for (const l of c) l && s.observe(l, v);
|
|
99
99
|
}
|
|
100
100
|
}, {
|
|
101
101
|
immediate: !0,
|
|
102
102
|
flush: "post"
|
|
103
|
-
}),
|
|
104
|
-
|
|
103
|
+
}), b = () => {
|
|
104
|
+
m(), u();
|
|
105
105
|
};
|
|
106
|
-
return
|
|
107
|
-
isSupported:
|
|
108
|
-
stop:
|
|
106
|
+
return Kt(b), {
|
|
107
|
+
isSupported: y,
|
|
108
|
+
stop: b
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const Ot = {
|
|
112
112
|
ref: "page-layout-tabs",
|
|
113
113
|
class: "page-layout-tabs",
|
|
114
114
|
"data-testid": "page-layout-tabs"
|
|
115
|
-
},
|
|
115
|
+
}, Vt = { key: 0 }, Wt = ["aria-label"], Mt = {
|
|
116
116
|
key: 0,
|
|
117
117
|
class: "layout-loader-container"
|
|
118
|
-
},
|
|
118
|
+
}, jt = /* @__PURE__ */ X({
|
|
119
119
|
__name: "PageLayoutTabs",
|
|
120
120
|
props: {
|
|
121
121
|
tabs: { default: () => [] }
|
|
122
122
|
},
|
|
123
123
|
setup(t) {
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
dt((f) => ({
|
|
125
|
+
v5db9dc57: d(s)
|
|
126
126
|
}));
|
|
127
|
-
const { i18n: { t: o } } =
|
|
128
|
-
if (typeof
|
|
129
|
-
e.push(
|
|
127
|
+
const { i18n: { t: o } } = at.useI18n(), e = et(), n = z("app:navigateTo", null), v = (f) => {
|
|
128
|
+
if (typeof f.to != "string") {
|
|
129
|
+
e.push(f.to);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
if (typeof n != "function") {
|
|
133
|
-
window.location.href =
|
|
133
|
+
window.location.href = f.to;
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
|
-
n(
|
|
137
|
-
},
|
|
138
|
-
var
|
|
139
|
-
if (!
|
|
136
|
+
n(f.to);
|
|
137
|
+
}, s = Bt, y = U("page-layout-tabs"), m = U("page-layout-tabs-list"), u = K(t.tabs.length), b = K(!1), c = h(() => t.tabs.slice(0, u.value)), l = h(() => t.tabs.slice(u.value)), w = async () => {
|
|
138
|
+
var I, i, a;
|
|
139
|
+
if (!y.value || !m.value)
|
|
140
140
|
return;
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
let
|
|
144
|
-
if (!
|
|
145
|
-
|
|
141
|
+
b.value = !1, u.value = t.tabs.length, await Z();
|
|
142
|
+
const f = ((I = y.value) == null ? void 0 : I.getBoundingClientRect().width) - parseInt(s) * 2;
|
|
143
|
+
let T = (i = m.value) == null ? void 0 : i.getBoundingClientRect().width;
|
|
144
|
+
if (!f || !T) {
|
|
145
|
+
b.value = !0;
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
|
-
const
|
|
149
|
-
for (;
|
|
150
|
-
u.value--, await
|
|
151
|
-
|
|
148
|
+
const B = 50;
|
|
149
|
+
for (; T + B > f && u.value > 1; )
|
|
150
|
+
u.value--, await Z(), T = ((a = m.value) == null ? void 0 : a.getBoundingClientRect().width) || 0;
|
|
151
|
+
b.value = !0;
|
|
152
152
|
};
|
|
153
|
-
let
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
let k = null;
|
|
154
|
+
const D = () => {
|
|
155
|
+
k && clearTimeout(k), k = setTimeout(() => {
|
|
156
|
+
w();
|
|
157
157
|
}, 150);
|
|
158
158
|
};
|
|
159
159
|
return Q(() => {
|
|
160
|
-
|
|
161
|
-
}),
|
|
162
|
-
|
|
163
|
-
}),
|
|
164
|
-
|
|
165
|
-
}, { deep: !0 }), (
|
|
166
|
-
const
|
|
167
|
-
return r(),
|
|
168
|
-
|
|
160
|
+
w(), Nt(y, D);
|
|
161
|
+
}), vt(() => {
|
|
162
|
+
k && clearTimeout(k);
|
|
163
|
+
}), j(() => t.tabs, () => {
|
|
164
|
+
w();
|
|
165
|
+
}, { deep: !0 }), (f, T) => {
|
|
166
|
+
const B = P("KDropdownItem"), I = P("KDropdown"), i = P("KSkeletonBox");
|
|
167
|
+
return r(), p("nav", Ot, [
|
|
168
|
+
S("ul", {
|
|
169
169
|
ref: "page-layout-tabs-list",
|
|
170
|
-
class: E({ "layout-computing": !
|
|
170
|
+
class: E({ "layout-computing": !b.value })
|
|
171
171
|
}, [
|
|
172
|
-
(r(!0),
|
|
172
|
+
(r(!0), p(O, null, F(c.value, (a) => (r(), p("li", {
|
|
173
173
|
key: `${a.key}-tab`
|
|
174
174
|
}, [
|
|
175
|
-
(r(),
|
|
175
|
+
(r(), _(W(typeof a.to == "string" ? "a" : "router-link"), Y({ ref_for: !0 }, typeof a.to == "string" ? { href: a.to } : { to: a.to }, {
|
|
176
176
|
"aria-current": a.active ? "page" : void 0,
|
|
177
177
|
class: ["tab-link", { active: a.active }],
|
|
178
178
|
"data-testid": a.dataTestId ? a.dataTestId : `page-layout-tab-${a.key}`,
|
|
179
179
|
tabindex: "0",
|
|
180
|
-
onClick:
|
|
181
|
-
onKeydown: [
|
|
182
|
-
A(D((F) => c(a), ["prevent"]), ["enter"]),
|
|
183
|
-
A(D((F) => c(a), ["prevent"]), ["space"])
|
|
184
|
-
]
|
|
180
|
+
onClick: A((N) => v(a), ["prevent"]),
|
|
181
|
+
onKeydown: tt(A((N) => v(a), ["prevent"]), ["enter"])
|
|
185
182
|
}), {
|
|
186
|
-
default:
|
|
187
|
-
|
|
183
|
+
default: C(() => [
|
|
184
|
+
$(f.$slots, `tab-${a.key}`, { tab: a }, () => [
|
|
185
|
+
V(L(a.label), 1)
|
|
186
|
+
], !0)
|
|
188
187
|
]),
|
|
189
188
|
_: 2
|
|
190
189
|
}, 1040, ["aria-current", "class", "data-testid", "onClick", "onKeydown"]))
|
|
191
190
|
]))), 128)),
|
|
192
|
-
t.tabs.length > u.value ? (r(),
|
|
193
|
-
|
|
191
|
+
t.tabs.length > u.value ? (r(), p("li", Vt, [
|
|
192
|
+
R(I, { "kpop-attributes": {
|
|
194
193
|
placement: "bottom-end",
|
|
195
194
|
popoverElementAttributes: { "data-testid": "tabs-overflow-dropdown-popover" }
|
|
196
195
|
} }, {
|
|
197
|
-
items:
|
|
198
|
-
(r(!0),
|
|
196
|
+
items: C(() => [
|
|
197
|
+
(r(!0), p(O, null, F(l.value, (a) => (r(), _(B, {
|
|
199
198
|
key: `${a.key}-dropdown-item`,
|
|
200
199
|
"aria-current": a.active ? "page" : void 0,
|
|
201
200
|
"data-testid": a.dataTestId ? a.dataTestId : `page-layout-tab-${a.key}`,
|
|
@@ -205,24 +204,34 @@ const xt = {
|
|
|
205
204
|
to: a.to
|
|
206
205
|
},
|
|
207
206
|
selected: a.active
|
|
208
|
-
},
|
|
207
|
+
}, {
|
|
208
|
+
default: C(() => [
|
|
209
|
+
$(f.$slots, `tab-${a.key}`, { tab: a }, () => [
|
|
210
|
+
V(L(a.label), 1)
|
|
211
|
+
], !0)
|
|
212
|
+
]),
|
|
213
|
+
_: 2
|
|
214
|
+
}, 1032, ["aria-current", "data-testid", "item", "selected"]))), 128))
|
|
209
215
|
]),
|
|
210
|
-
default:
|
|
211
|
-
|
|
212
|
-
"aria-label":
|
|
216
|
+
default: C(() => [
|
|
217
|
+
S("button", {
|
|
218
|
+
"aria-label": d(o)("tabs.more_button.aria_label"),
|
|
213
219
|
class: E(["tab-link overflow-dropdown-trigger", { active: l.value.find((a) => a.active) }]),
|
|
214
220
|
"data-testid": "tabs-overflow-dropdown-button"
|
|
215
221
|
}, [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
222
|
+
V(L(d(o)("tabs.more_button.label")) + " ", 1),
|
|
223
|
+
R(d(Tt), {
|
|
224
|
+
decorative: "",
|
|
225
|
+
size: `var(--kui-icon-size-30, ${d(M)})`
|
|
226
|
+
}, null, 8, ["size"])
|
|
227
|
+
], 10, Wt)
|
|
219
228
|
]),
|
|
220
|
-
_:
|
|
229
|
+
_: 3
|
|
221
230
|
})
|
|
222
|
-
])) :
|
|
231
|
+
])) : g("", !0)
|
|
223
232
|
], 2),
|
|
224
|
-
|
|
225
|
-
(r(),
|
|
233
|
+
b.value ? g("", !0) : (r(), p("div", Mt, [
|
|
234
|
+
(r(), p(O, null, F(3, (a) => R(i, {
|
|
226
235
|
key: `layout-loader-${a}`,
|
|
227
236
|
height: "1",
|
|
228
237
|
width: "5"
|
|
@@ -231,31 +240,31 @@ const xt = {
|
|
|
231
240
|
], 512);
|
|
232
241
|
};
|
|
233
242
|
}
|
|
234
|
-
}),
|
|
243
|
+
}), ot = (t, o) => {
|
|
235
244
|
const e = t.__vccOpts || t;
|
|
236
|
-
for (const [n,
|
|
237
|
-
e[n] =
|
|
245
|
+
for (const [n, v] of o)
|
|
246
|
+
e[n] = v;
|
|
238
247
|
return e;
|
|
239
|
-
},
|
|
248
|
+
}, Gt = /* @__PURE__ */ ot(jt, [["__scopeId", "data-v-31debc7a"]]), J = Symbol("nested-page-layout-detection"), Ut = {
|
|
240
249
|
class: "kong-ui-public-page-layout",
|
|
241
250
|
"data-testid": "kong-ui-public-page-layout"
|
|
242
|
-
},
|
|
251
|
+
}, Zt = {
|
|
243
252
|
key: 0,
|
|
244
253
|
class: "page-layout-header",
|
|
245
254
|
"data-testid": "page-layout-header"
|
|
246
|
-
},
|
|
255
|
+
}, Ht = { class: "page-header-container" }, qt = { class: "page-header-start" }, Jt = { class: "title-container" }, Qt = {
|
|
247
256
|
key: 1,
|
|
248
257
|
class: "page-layout-title-wrapper"
|
|
249
|
-
},
|
|
258
|
+
}, Xt = {
|
|
250
259
|
class: "page-layout-title",
|
|
251
260
|
"data-testid": "page-layout-title"
|
|
252
|
-
},
|
|
261
|
+
}, Yt = ["aria-label"], te = {
|
|
253
262
|
key: 3,
|
|
254
263
|
class: "title-after-container"
|
|
255
|
-
},
|
|
264
|
+
}, ee = {
|
|
256
265
|
key: 0,
|
|
257
266
|
class: "page-header-actions-container"
|
|
258
|
-
},
|
|
267
|
+
}, ae = /* @__PURE__ */ X({
|
|
259
268
|
__name: "PageLayout",
|
|
260
269
|
props: {
|
|
261
270
|
breadcrumbs: { default: () => [] },
|
|
@@ -265,10 +274,10 @@ const xt = {
|
|
|
265
274
|
pageShortcutData: {}
|
|
266
275
|
},
|
|
267
276
|
setup(t) {
|
|
268
|
-
const o =
|
|
277
|
+
const o = z("app:navigateTo", null), e = z("app:pageShortcutsContext", null), { i18n: { t: n } } = at.useI18n(), v = et(), s = gt(), y = h(() => !!(t.tabs && t.tabs.length)), m = h(() => typeof t.backTo == "string"), u = h(() => !!t.pageShortcutData && !!t.pageShortcutData.entityType && !!t.pageShortcutData.label), b = h(() => u.value && !!e && "onFavoriteToggle" in e && typeof e.onFavoriteToggle == "function"), c = K(0), l = h(() => !!e && ("isFavorite" in e && e.isFavorite === !0 || "isPageFavorite" in e && typeof e.isPageFavorite == "function" && e.isPageFavorite(t.pageShortcutData) === !0)), w = async () => {
|
|
269
278
|
if (t.backTo) {
|
|
270
279
|
if (typeof t.backTo == "object") {
|
|
271
|
-
|
|
280
|
+
v.push(t.backTo);
|
|
272
281
|
return;
|
|
273
282
|
}
|
|
274
283
|
if (typeof o != "function") {
|
|
@@ -277,112 +286,116 @@ const xt = {
|
|
|
277
286
|
}
|
|
278
287
|
await o(t.backTo);
|
|
279
288
|
}
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
|
|
289
|
+
}, k = K(0), D = h(() => k.value > 0);
|
|
290
|
+
ft(J, () => (k.value++, () => {
|
|
291
|
+
k.value--;
|
|
283
292
|
}));
|
|
284
|
-
const
|
|
285
|
-
typeof
|
|
286
|
-
const
|
|
287
|
-
var
|
|
288
|
-
e.onFavoriteToggle({ ...t.pageShortcutData, path: ((
|
|
293
|
+
const f = z(J, null), T = K(null);
|
|
294
|
+
typeof f == "function" && (T.value = f());
|
|
295
|
+
const B = () => {
|
|
296
|
+
var i;
|
|
297
|
+
e.onFavoriteToggle({ ...t.pageShortcutData, path: ((i = t.pageShortcutData) == null ? void 0 : i.path) || s.fullPath });
|
|
289
298
|
};
|
|
290
|
-
|
|
291
|
-
var
|
|
292
|
-
(
|
|
299
|
+
bt(() => {
|
|
300
|
+
var i;
|
|
301
|
+
(i = T.value) == null || i.call(T);
|
|
293
302
|
});
|
|
294
|
-
const
|
|
295
|
-
var
|
|
296
|
-
!
|
|
303
|
+
const I = /* @__PURE__ */ Lt(() => {
|
|
304
|
+
var i;
|
|
305
|
+
!D.value && u.value && e && "onEntityPageVisit" in e && typeof e.onEntityPageVisit == "function" && e.onEntityPageVisit({ ...t.pageShortcutData, path: ((i = t.pageShortcutData) == null ? void 0 : i.path) || (s == null ? void 0 : s.fullPath) });
|
|
297
306
|
}, 500);
|
|
298
|
-
return
|
|
299
|
-
|
|
300
|
-
}, { immediate: !0, deep: !0 }), (
|
|
301
|
-
const
|
|
302
|
-
return r(),
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
t.breadcrumbs && t.breadcrumbs.length ? (r(),
|
|
307
|
+
return j([() => t.pageShortcutData, () => s == null ? void 0 : s.fullPath], () => {
|
|
308
|
+
I(), c.value++;
|
|
309
|
+
}, { immediate: !0, deep: !0 }), (i, a) => {
|
|
310
|
+
const N = P("KBreadcrumbs"), nt = P("KTooltip"), st = P("router-view");
|
|
311
|
+
return r(), p("div", Ut, [
|
|
312
|
+
D.value ? g("", !0) : (r(), p("div", Zt, [
|
|
313
|
+
S("div", Ht, [
|
|
314
|
+
S("div", qt, [
|
|
315
|
+
t.breadcrumbs && t.breadcrumbs.length ? (r(), _(N, {
|
|
307
316
|
key: 0,
|
|
308
317
|
class: "header-breadcrumbs",
|
|
309
318
|
"data-testid": "page-layout-breadcrumbs",
|
|
310
319
|
"item-max-width": "25ch",
|
|
311
320
|
items: t.breadcrumbs
|
|
312
|
-
}, null, 8, ["items"])) :
|
|
313
|
-
|
|
314
|
-
t.backTo ? (r(),
|
|
315
|
-
"aria-label":
|
|
321
|
+
}, null, 8, ["items"])) : g("", !0),
|
|
322
|
+
S("div", Jt, [
|
|
323
|
+
t.backTo ? (r(), _(W(m.value ? "a" : "router-link"), Y({ key: 0 }, m.value ? { href: t.backTo } : { to: t.backTo }, {
|
|
324
|
+
"aria-label": d(n)("back_button"),
|
|
316
325
|
class: "navigate-back",
|
|
317
326
|
"data-testid": "page-layout-navigate-back",
|
|
318
327
|
tabindex: "0",
|
|
319
|
-
onClick:
|
|
320
|
-
onKeydown: [
|
|
321
|
-
A(D(k, ["prevent"]), ["enter"]),
|
|
322
|
-
A(D(k, ["prevent"]), ["space"])
|
|
323
|
-
]
|
|
328
|
+
onClick: A(w, ["prevent"]),
|
|
329
|
+
onKeydown: tt(A(w, ["prevent"]), ["enter"])
|
|
324
330
|
}), {
|
|
325
|
-
default:
|
|
326
|
-
|
|
331
|
+
default: C(() => [
|
|
332
|
+
R(d(wt), {
|
|
327
333
|
decorative: "",
|
|
328
|
-
size: `var(--kui-icon-size-30, ${
|
|
334
|
+
size: `var(--kui-icon-size-30, ${d(M)})`
|
|
329
335
|
}, null, 8, ["size"])
|
|
330
336
|
]),
|
|
331
337
|
_: 1
|
|
332
|
-
}, 16, ["aria-label", "onKeydown"])) :
|
|
333
|
-
t.title ||
|
|
334
|
-
|
|
335
|
-
|
|
338
|
+
}, 16, ["aria-label", "onKeydown"])) : g("", !0),
|
|
339
|
+
t.title || i.$slots.title ? (r(), p("span", Qt, [
|
|
340
|
+
$(i.$slots, "title", {}, () => [
|
|
341
|
+
S("h1", Xt, L(t.title), 1)
|
|
336
342
|
], !0)
|
|
337
|
-
])) :
|
|
338
|
-
|
|
339
|
-
key:
|
|
343
|
+
])) : g("", !0),
|
|
344
|
+
b.value ? (r(), p("div", {
|
|
345
|
+
key: c.value,
|
|
340
346
|
class: "favorite-button-container"
|
|
341
347
|
}, [
|
|
342
|
-
|
|
348
|
+
R(nt, {
|
|
343
349
|
placement: "right",
|
|
344
|
-
text: l.value ?
|
|
350
|
+
text: l.value ? d(n)("favorite_button.remove_shortcut") : d(n)("favorite_button.save_shortcut")
|
|
345
351
|
}, {
|
|
346
|
-
default:
|
|
347
|
-
|
|
348
|
-
"aria-label": l.value ?
|
|
352
|
+
default: C(() => [
|
|
353
|
+
S("button", {
|
|
354
|
+
"aria-label": l.value ? d(n)("favorite_button.remove_shortcut") : d(n)("favorite_button.save_shortcut"),
|
|
349
355
|
class: E(["favorite-button", { active: l.value }]),
|
|
350
356
|
"data-testid": "page-layout-favorite-button",
|
|
351
357
|
type: "button",
|
|
352
|
-
onClick:
|
|
358
|
+
onClick: B
|
|
353
359
|
}, [
|
|
354
|
-
(r(),
|
|
360
|
+
(r(), _(W(l.value ? d(St) : d(_t)), {
|
|
355
361
|
decorative: "",
|
|
356
|
-
size: `var(--kui-icon-size-30, ${
|
|
362
|
+
size: `var(--kui-icon-size-30, ${d(M)})`
|
|
357
363
|
}, null, 8, ["size"]))
|
|
358
|
-
], 10,
|
|
364
|
+
], 10, Yt)
|
|
359
365
|
]),
|
|
360
366
|
_: 1
|
|
361
367
|
}, 8, ["text"])
|
|
362
|
-
])) :
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
])) :
|
|
368
|
+
])) : g("", !0),
|
|
369
|
+
i.$slots["title-after"] ? (r(), p("div", te, [
|
|
370
|
+
$(i.$slots, "title-after", {}, void 0, !0)
|
|
371
|
+
])) : g("", !0)
|
|
366
372
|
])
|
|
367
373
|
]),
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
])) :
|
|
374
|
+
i.$slots.actions ? (r(), p("div", ee, [
|
|
375
|
+
$(i.$slots, "actions", {}, void 0, !0)
|
|
376
|
+
])) : g("", !0)
|
|
371
377
|
]),
|
|
372
|
-
|
|
378
|
+
y.value ? (r(), _(Gt, {
|
|
373
379
|
key: 0,
|
|
374
380
|
tabs: t.tabs
|
|
375
|
-
},
|
|
381
|
+
}, pt({ _: 2 }, [
|
|
382
|
+
F(t.tabs, (G) => ({
|
|
383
|
+
name: `tab-${G.key}`,
|
|
384
|
+
fn: C((it) => [
|
|
385
|
+
$(i.$slots, `tab-${G.key}`, yt(mt(it)), void 0, !0)
|
|
386
|
+
])
|
|
387
|
+
}))
|
|
388
|
+
]), 1032, ["tabs"])) : g("", !0)
|
|
376
389
|
])),
|
|
377
|
-
|
|
378
|
-
class: E(["page-layout-content", { "has-nested-page-layout":
|
|
390
|
+
S("div", {
|
|
391
|
+
class: E(["page-layout-content", { "has-nested-page-layout": D.value }])
|
|
379
392
|
}, [
|
|
380
|
-
|
|
393
|
+
y.value ? (r(), _(st, { key: 0 })) : $(i.$slots, "default", { key: 1 }, void 0, !0)
|
|
381
394
|
], 2)
|
|
382
395
|
]);
|
|
383
396
|
};
|
|
384
397
|
}
|
|
385
|
-
}),
|
|
398
|
+
}), re = /* @__PURE__ */ ot(ae, [["__scopeId", "data-v-464d0154"]]);
|
|
386
399
|
export {
|
|
387
|
-
|
|
400
|
+
re as PageLayout
|
|
388
401
|
};
|
package/dist/page-layout.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(b,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):(b=typeof globalThis<"u"?globalThis:b||self,t(b["kong-ui-public-page-layout"]={},b.Vue,b.VueRouter,b["kong-ui-public-i18n"],b.KongIcons))})(this,function(b,t,S,V,_){"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 x(){const e=V.createI18n("en-us",K);return{i18n:e,i18nT:V.i18nTComponent(e)}}const E={useI18n:x},N="16px",F="16px";function L(e,a){return t.getCurrentScope()?(t.onScopeDispose(e,a),!0):!1}const R=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const D=()=>{};function z(e,a){function o(...i){return new Promise((d,r)=>{Promise.resolve(e(()=>a.apply(this,i),{fn:a,thisArg:this,args:i})).then(d).catch(r)})}return o}function M(e,a={}){let o,i,d=D;const r=s=>{clearTimeout(s),d(),d=D};let m;return s=>{const p=t.toValue(e),u=t.toValue(a.maxWait);return o&&r(o),p<=0||u!==void 0&&u<=0?(i&&(r(i),i=void 0),Promise.resolve(s())):new Promise((l,g)=>{d=a.rejectOnCancel?g:l,m=s,u&&!i&&(i=setTimeout(()=>{o&&r(o),i=void 0,l(m())},u)),o=setTimeout(()=>{i&&r(i),i=void 0,l(s())},p)})}}function O(e,a=200,o={}){return z(M(a,o),e)}const A=R?window:void 0;function I(e){var a;const o=t.toValue(e);return(a=o==null?void 0:o.$el)!==null&&a!==void 0?a:o}function j(){const e=t.shallowRef(!1),a=t.getCurrentInstance();return a&&t.onMounted(()=>{e.value=!0},a),e}function W(e){const a=j();return t.computed(()=>(a.value,!!e()))}function G(e,a,o={}){const{window:i=A,...d}=o;let r;const m=W(()=>i&&"ResizeObserver"in i),h=()=>{r&&(r.disconnect(),r=void 0)},s=t.watch(t.computed(()=>{const u=t.toValue(e);return Array.isArray(u)?u.map(l=>I(l)):[I(u)]}),u=>{if(h(),m.value&&i){r=new ResizeObserver(a);for(const l of u)l&&r.observe(l,d)}},{immediate:!0,flush:"post"}),p=()=>{h(),s()};return L(p),{isSupported:m,stop:p}}const q={ref:"page-layout-tabs",class:"page-layout-tabs","data-testid":"page-layout-tabs"},U={key:0},Z=["aria-label"],H={class:"overflowing-items-count"},J={key:0,class:"layout-loader-container"},Q=t.defineComponent({__name:"PageLayoutTabs",props:{tabs:{default:()=>[]}},setup(e){t.useCssVars(f=>({v0584f280:t.unref(r)}));const{i18n:{t:a}}=E.useI18n(),o=S.useRouter(),i=t.inject("app:navigateTo",null),d=f=>{if(typeof f.to!="string"){o.push(f.to);return}if(typeof i!="function"){window.location.href=f.to;return}i(f.to)},r=F,m=t.useTemplateRef("page-layout-tabs"),h=t.useTemplateRef("page-layout-tabs-list"),s=t.ref(e.tabs.length),p=t.ref(!1),u=t.computed(()=>e.tabs.slice(0,s.value)),l=t.computed(()=>e.tabs.slice(s.value)),g=async()=>{var w,c,n;if(!m.value||!h.value)return;p.value=!1,s.value=e.tabs.length,await t.nextTick();const f=((w=m.value)==null?void 0:w.getBoundingClientRect().width)-parseInt(r)*2;let k=(c=h.value)==null?void 0:c.getBoundingClientRect().width;if(!f||!k){p.value=!0;return}const T=50;for(;k+T>f&&s.value>1;)s.value--,await t.nextTick(),k=((n=h.value)==null?void 0:n.getBoundingClientRect().width)||0;p.value=!0};let y=null;const B=()=>{y&&clearTimeout(y),y=setTimeout(()=>{g()},150)};return t.onMounted(()=>{g(),G(m,B)}),t.onBeforeUnmount(()=>{y&&clearTimeout(y)}),t.watch(()=>e.tabs,()=>{g()},{deep:!0}),(f,k)=>{const T=t.resolveComponent("KDropdownItem"),w=t.resolveComponent("KDropdown"),c=t.resolveComponent("KSkeletonBox");return t.openBlock(),t.createElementBlock("nav",q,[t.createElementVNode("ul",{ref:"page-layout-tabs-list",class:t.normalizeClass({"layout-computing":!p.value})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,n=>(t.openBlock(),t.createElementBlock("li",{key:`${n.key}-tab`},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(typeof n.to=="string"?"a":"router-link"),t.mergeProps({ref_for:!0},typeof n.to=="string"?{href:n.to}:{to:n.to},{"aria-current":n.active?"page":void 0,class:["tab-link",{active:n.active}],"data-testid":n.dataTestId?n.dataTestId:`page-layout-tab-${n.key}`,tabindex:"0",onClick:t.withModifiers(C=>d(n),["prevent"]),onKeydown:[t.withKeys(t.withModifiers(C=>d(n),["prevent"]),["enter"]),t.withKeys(t.withModifiers(C=>d(n),["prevent"]),["space"])]}),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.label),1)]),_:2},1040,["aria-current","class","data-testid","onClick","onKeydown"]))]))),128)),e.tabs.length>s.value?(t.openBlock(),t.createElementBlock("li",U,[t.createVNode(w,{"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(l.value,n=>(t.openBlock(),t.createBlock(T,{key:`${n.key}-dropdown-item`,"aria-current":n.active?"page":void 0,"data-testid":n.dataTestId?n.dataTestId:`page-layout-tab-${n.key}`,item:{label:n.label,value:n.key,to:n.to},selected:n.active},null,8,["aria-current","data-testid","item","selected"]))),128))]),default:t.withCtx(()=>[t.createElementVNode("button",{"aria-label":t.unref(a)("tabs.more_button.aria_label"),class:t.normalizeClass(["tab-link overflow-dropdown-trigger",{active:l.value.find(n=>n.active)}]),"data-testid":"tabs-overflow-dropdown-button"},[t.createTextVNode(t.toDisplayString(t.unref(a)("tabs.more_button.label"))+" ",1),t.createElementVNode("span",H,t.toDisplayString(e.tabs.length-s.value),1)],10,Z)]),_:1})])):t.createCommentVNode("",!0)],2),p.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",J,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(3,n=>t.createVNode(c,{key:`layout-loader-${n}`,height:"1",width:"5"})),64))]))],512)}}}),P=(e,a)=>{const o=e.__vccOpts||e;for(const[i,d]of a)o[i]=d;return o},X=P(Q,[["__scopeId","data-v-6e49955f"]]),$=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"},nt={key:1,class:"page-layout-title-wrapper"},at={class:"page-layout-title","data-testid":"page-layout-title"},it=["aria-label"],rt={key:3,class:"title-after-container"},ct={key:0,class:"page-header-actions-container"},st=P(t.defineComponent({__name:"PageLayout",props:{breadcrumbs:{default:()=>[]},title:{},backTo:{},tabs:{default:()=>[]},pageShortcutData:{}},setup(e){const a=t.inject("app:navigateTo",null),o=t.inject("app:pageShortcutsContext",null),{i18n:{t:i}}=E.useI18n(),d=S.useRouter(),r=S.useRoute(),m=t.computed(()=>!!(e.tabs&&e.tabs.length)),h=t.computed(()=>typeof e.backTo=="string"),s=t.computed(()=>!!e.pageShortcutData&&!!e.pageShortcutData.entityType&&!!e.pageShortcutData.label),p=t.computed(()=>s.value&&!!o&&"onFavoriteToggle"in o&&typeof o.onFavoriteToggle=="function"),u=t.ref(0),l=t.computed(()=>!!o&&("isFavorite"in o&&o.isFavorite===!0||"isPageFavorite"in o&&typeof o.isPageFavorite=="function"&&o.isPageFavorite(e.pageShortcutData)===!0)),g=async()=>{if(e.backTo){if(typeof e.backTo=="object"){d.push(e.backTo);return}if(typeof a!="function"){window.location.href=e.backTo;return}await a(e.backTo)}},y=t.ref(0),B=t.computed(()=>y.value>0);t.provide($,()=>(y.value++,()=>{y.value--}));const f=t.inject($,null),k=t.ref(null);typeof f=="function"&&(k.value=f());const T=()=>{var c;o.onFavoriteToggle({...e.pageShortcutData,path:((c=e.pageShortcutData)==null?void 0:c.path)||r.fullPath})};t.onUnmounted(()=>{var c;(c=k.value)==null||c.call(k)});const w=O(()=>{var c;!B.value&&s.value&&o&&"onEntityPageVisit"in o&&typeof o.onEntityPageVisit=="function"&&o.onEntityPageVisit({...e.pageShortcutData,path:((c=e.pageShortcutData)==null?void 0:c.path)||(r==null?void 0:r.fullPath)})},500);return t.watch([()=>e.pageShortcutData,()=>r==null?void 0:r.fullPath],()=>{w(),u.value++},{immediate:!0,deep:!0}),(c,n)=>{const C=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(C,{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(h.value?"a":"router-link"),t.mergeProps({key:0},h.value?{href:e.backTo}:{to:e.backTo},{"aria-label":t.unref(i)("back_button"),class:"navigate-back","data-testid":"page-layout-navigate-back",tabindex:"0",onClick:t.withModifiers(g,["prevent"]),onKeydown:[t.withKeys(t.withModifiers(g,["prevent"]),["enter"]),t.withKeys(t.withModifiers(g,["prevent"]),["space"])]}),{default:t.withCtx(()=>[t.createVNode(t.unref(_.ArrowTopLeftIcon),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(N)})`},null,8,["size"])]),_:1},16,["aria-label","onKeydown"])):t.createCommentVNode("",!0),e.title||c.$slots.title?(t.openBlock(),t.createElementBlock("span",nt,[t.renderSlot(c.$slots,"title",{},()=>[t.createElementVNode("h1",at,t.toDisplayString(e.title),1)],!0)])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createElementBlock("div",{key:u.value,class:"favorite-button-container"},[t.createVNode(lt,{placement:"right",text:l.value?t.unref(i)("favorite_button.remove_shortcut"):t.unref(i)("favorite_button.save_shortcut")},{default:t.withCtx(()=>[t.createElementVNode("button",{"aria-label":l.value?t.unref(i)("favorite_button.remove_shortcut"):t.unref(i)("favorite_button.save_shortcut"),class:t.normalizeClass(["favorite-button",{active:l.value}]),"data-testid":"page-layout-favorite-button",type:"button",onClick:T},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.value?t.unref(_.StarFillIcon):t.unref(_.StarIcon)),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(N)})`},null,8,["size"]))],10,it)]),_:1},8,["text"])])):t.createCommentVNode("",!0),c.$slots["title-after"]?(t.openBlock(),t.createElementBlock("div",rt,[t.renderSlot(c.$slots,"title-after",{},void 0,!0)])):t.createCommentVNode("",!0)])]),c.$slots.actions?(t.openBlock(),t.createElementBlock("div",ct,[t.renderSlot(c.$slots,"actions",{},void 0,!0)])):t.createCommentVNode("",!0)]),m.value?(t.openBlock(),t.createBlock(X,{key:0,tabs:e.tabs},null,8,["tabs"])):t.createCommentVNode("",!0)])),t.createElementVNode("div",{class:t.normalizeClass(["page-layout-content",{"has-nested-page-layout":B.value}])},[m.value?(t.openBlock(),t.createBlock(dt,{key:0})):t.renderSlot(c.$slots,"default",{key:1},void 0,!0)],2)])}}}),[["__scopeId","data-v-cbdb2eef"]]);b.PageLayout=st,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(b,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):(b=typeof globalThis<"u"?globalThis:b||self,t(b["kong-ui-public-page-layout"]={},b.Vue,b.VueRouter,b["kong-ui-public-i18n"],b.KongIcons))})(this,function(b,t,S,N,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 z(){const e=N.createI18n("en-us",K);return{i18n:e,i18nT:N.i18nTComponent(e)}}const $={useI18n:z},V="16px",L="16px";function F(e,n){return t.getCurrentScope()?(t.onScopeDispose(e,n),!0):!1}const R=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const D=()=>{};function M(e,n){function o(...r){return new Promise((u,i)=>{Promise.resolve(e(()=>n.apply(this,r),{fn:n,thisArg:this,args:r})).then(u).catch(i)})}return o}function O(e,n={}){let o,r,u=D;const i=s=>{clearTimeout(s),u(),u=D};let f;return s=>{const p=t.toValue(e),d=t.toValue(n.maxWait);return o&&i(o),p<=0||d!==void 0&&d<=0?(r&&(i(r),r=void 0),Promise.resolve(s())):new Promise((l,g)=>{u=n.rejectOnCancel?g:l,f=s,d&&!r&&(r=setTimeout(()=>{o&&i(o),r=void 0,l(f())},d)),o=setTimeout(()=>{r&&i(r),r=void 0,l(s())},p)})}}function A(e,n=200,o={}){return M(O(n,o),e)}const j=R?window:void 0;function E(e){var n;const o=t.toValue(e);return(n=o==null?void 0: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,...u}=o;let i;const f=G(()=>r&&"ResizeObserver"in r),y=()=>{i&&(i.disconnect(),i=void 0)},s=t.watch(t.computed(()=>{const d=t.toValue(e);return Array.isArray(d)?d.map(l=>E(l)):[E(d)]}),d=>{if(y(),f.value&&r){i=new ResizeObserver(n);for(const l of d)l&&i.observe(l,u)}},{immediate:!0,flush:"post"}),p=()=>{y(),s()};return F(p),{isSupported:f,stop:p}}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(m=>({v5db9dc57:t.unref(i)}));const{i18n:{t:n}}=$.useI18n(),o=S.useRouter(),r=t.inject("app:navigateTo",null),u=m=>{if(typeof m.to!="string"){o.push(m.to);return}if(typeof r!="function"){window.location.href=m.to;return}r(m.to)},i=L,f=t.useTemplateRef("page-layout-tabs"),y=t.useTemplateRef("page-layout-tabs-list"),s=t.ref(e.tabs.length),p=t.ref(!1),d=t.computed(()=>e.tabs.slice(0,s.value)),l=t.computed(()=>e.tabs.slice(s.value)),g=async()=>{var B,c,a;if(!f.value||!y.value)return;p.value=!1,s.value=e.tabs.length,await t.nextTick();const m=((B=f.value)==null?void 0:B.getBoundingClientRect().width)-parseInt(i)*2;let h=(c=y.value)==null?void 0:c.getBoundingClientRect().width;if(!m||!h){p.value=!0;return}const w=50;for(;h+w>m&&s.value>1;)s.value--,await t.nextTick(),h=((a=y.value)==null?void 0:a.getBoundingClientRect().width)||0;p.value=!0};let k=null;const C=()=>{k&&clearTimeout(k),k=setTimeout(()=>{g()},150)};return t.onMounted(()=>{g(),q(f,C)}),t.onBeforeUnmount(()=>{k&&clearTimeout(k)}),t.watch(()=>e.tabs,()=>{g()},{deep:!0}),(m,h)=>{const w=t.resolveComponent("KDropdownItem"),B=t.resolveComponent("KDropdown"),c=t.resolveComponent("KSkeletonBox");return t.openBlock(),t.createElementBlock("nav",U,[t.createElementVNode("ul",{ref:"page-layout-tabs-list",class:t.normalizeClass({"layout-computing":!p.value})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.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(_=>u(a),["prevent"]),onKeydown:t.withKeys(t.withModifiers(_=>u(a),["prevent"]),["enter"])}),{default:t.withCtx(()=>[t.renderSlot(m.$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(B,{"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(l.value,a=>(t.openBlock(),t.createBlock(w,{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(m.$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 overflow-dropdown-trigger",{active:l.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(V)})`},null,8,["size"])],10,H)]),_:3})])):t.createCommentVNode("",!0)],2),p.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",J,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(3,a=>t.createVNode(c,{key:`layout-loader-${a}`,height:"1",width:"5"})),64))]))],512)}}}),P=(e,n)=>{const o=e.__vccOpts||e;for(const[r,u]of n)o[r]=u;return o},X=P(Q,[["__scopeId","data-v-31debc7a"]]),I=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"},ct={key:0,class:"page-header-actions-container"},st=P(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(),u=S.useRouter(),i=S.useRoute(),f=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),p=t.computed(()=>s.value&&!!o&&"onFavoriteToggle"in o&&typeof o.onFavoriteToggle=="function"),d=t.ref(0),l=t.computed(()=>!!o&&("isFavorite"in o&&o.isFavorite===!0||"isPageFavorite"in o&&typeof o.isPageFavorite=="function"&&o.isPageFavorite(e.pageShortcutData)===!0)),g=async()=>{if(e.backTo){if(typeof e.backTo=="object"){u.push(e.backTo);return}if(typeof n!="function"){window.location.href=e.backTo;return}await n(e.backTo)}},k=t.ref(0),C=t.computed(()=>k.value>0);t.provide(I,()=>(k.value++,()=>{k.value--}));const m=t.inject(I,null),h=t.ref(null);typeof m=="function"&&(h.value=m());const w=()=>{var c;o.onFavoriteToggle({...e.pageShortcutData,path:((c=e.pageShortcutData)==null?void 0:c.path)||i.fullPath})};t.onUnmounted(()=>{var c;(c=h.value)==null||c.call(h)});const B=A(()=>{var c;!C.value&&s.value&&o&&"onEntityPageVisit"in o&&typeof o.onEntityPageVisit=="function"&&o.onEntityPageVisit({...e.pageShortcutData,path:((c=e.pageShortcutData)==null?void 0:c.path)||(i==null?void 0:i.fullPath)})},500);return t.watch([()=>e.pageShortcutData,()=>i==null?void 0:i.fullPath],()=>{B(),d.value++},{immediate:!0,deep:!0}),(c,a)=>{const _=t.resolveComponent("KBreadcrumbs"),lt=t.resolveComponent("KTooltip"),dt=t.resolveComponent("router-view");return t.openBlock(),t.createElementBlock("div",Y,[C.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(_,{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(g,["prevent"]),onKeydown:t.withKeys(t.withModifiers(g,["prevent"]),["enter"])}),{default:t.withCtx(()=>[t.createVNode(t.unref(T.ArrowTopLeftIcon),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(V)})`},null,8,["size"])]),_:1},16,["aria-label","onKeydown"])):t.createCommentVNode("",!0),e.title||c.$slots.title?(t.openBlock(),t.createElementBlock("span",at,[t.renderSlot(c.$slots,"title",{},()=>[t.createElementVNode("h1",nt,t.toDisplayString(e.title),1)],!0)])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createElementBlock("div",{key:d.value,class:"favorite-button-container"},[t.createVNode(lt,{placement:"right",text:l.value?t.unref(r)("favorite_button.remove_shortcut"):t.unref(r)("favorite_button.save_shortcut")},{default:t.withCtx(()=>[t.createElementVNode("button",{"aria-label":l.value?t.unref(r)("favorite_button.remove_shortcut"):t.unref(r)("favorite_button.save_shortcut"),class:t.normalizeClass(["favorite-button",{active:l.value}]),"data-testid":"page-layout-favorite-button",type:"button",onClick:w},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.value?t.unref(T.StarFillIcon):t.unref(T.StarIcon)),{decorative:"",size:`var(--kui-icon-size-30, ${t.unref(V)})`},null,8,["size"]))],10,rt)]),_:1},8,["text"])])):t.createCommentVNode("",!0),c.$slots["title-after"]?(t.openBlock(),t.createElementBlock("div",it,[t.renderSlot(c.$slots,"title-after",{},void 0,!0)])):t.createCommentVNode("",!0)])]),c.$slots.actions?(t.openBlock(),t.createElementBlock("div",ct,[t.renderSlot(c.$slots,"actions",{},void 0,!0)])):t.createCommentVNode("",!0)]),f.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(c.$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":C.value}])},[f.value?(t.openBlock(),t.createBlock(dt,{key:0})):t.renderSlot(c.$slots,"default",{key:1},void 0,!0)],2)])}}}),[["__scopeId","data-v-464d0154"]]);b.PageLayout=st,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.page-layout-tabs[data-v-
|
|
1
|
+
.page-layout-tabs[data-v-31debc7a]{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(--v5db9dc57);padding:var(--kui-space-0, 0px) var(--v5db9dc57);position:relative;width:100%}.page-layout-tabs a[data-v-31debc7a],.page-layout-tabs button[data-v-31debc7a]{background-color:transparent;background-color:var(--kui-color-background-transparent, transparent);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-31debc7a]{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-31debc7a]{height:0;visibility:hidden}.page-layout-tabs ul li[data-v-31debc7a]{display:flex}.page-layout-tabs ul li .tab-link[data-v-31debc7a]{align-items:center;border-bottom:2px solid transparent;border-bottom:var(--kui-border-width-20, 2px) solid var(--kui-color-border-transparent, transparent);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);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-31debc7a]: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)}.page-layout-tabs ul li .tab-link[data-v-31debc7a]:focus-visible{box-shadow:0 0 0 4px #0044f433;box-shadow:var(--kui-shadow-focus, 0px 0px 0px 4px rgba(0, 68, 244, .2))}.page-layout-tabs ul li .tab-link.active[data-v-31debc7a]{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)}.page-layout-tabs ul li .tab-link.overflow-dropdown-trigger[data-v-31debc7a]{font-weight:500!important;font-weight:var(--kui-font-weight-medium, 500)!important}.page-layout-tabs .layout-loader-container[data-v-31debc7a]{align-items:center;display:flex;gap:20px;gap:var(--kui-space-70, 20px);height:34px;top:0;right:0;bottom:0;left:0;left:var(--v5db9dc57);position:absolute}.kong-ui-public-page-layout[data-v-464d0154]{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-464d0154]{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-464d0154]{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 .header-breadcrumbs[data-v-464d0154] .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-464d0154] .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-464d0154]{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-464d0154],.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button[data-v-464d0154]{background-color:transparent;background-color:var(--kui-color-background-transparent, transparent);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-464d0154]:hover,.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button[data-v-464d0154]: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-464d0154]:focus-visible,.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button[data-v-464d0154]: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-464d0154]>*{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)}.kong-ui-public-page-layout .page-layout-header .page-header-container .page-header-start .title-container .favorite-button-container[data-v-464d0154]{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-464d0154]{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-464d0154]: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-464d0154]{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-464d0154]{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-464d0154]{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-464d0154]{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-464d0154]{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-464d0154]{padding:0;padding:var(--kui-space-0, 0px)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayout.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayout.vue"],"names":[],"mappings":"AA2XA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAoB,MAAM,UAAU,CAAA;AAmBlF,KAAK,WAAW,GAAG,eAAe,CAAC;AA2XnC,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,5 +1,21 @@
|
|
|
1
|
-
import type { PageLayoutTabsProps } from '../types';
|
|
2
|
-
declare
|
|
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>;
|
|
3
14
|
declare const _default: typeof __VLS_export;
|
|
4
15
|
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
5
21
|
//# sourceMappingURL=PageLayoutTabs.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayoutTabs.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayoutTabs.vue"],"names":[],"mappings":"
|
|
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;AAuUlE,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"}
|
|
@@ -14,4 +14,9 @@ export interface PageLayoutTab {
|
|
|
14
14
|
export interface PageLayoutTabsProps {
|
|
15
15
|
tabs?: PageLayoutTab[];
|
|
16
16
|
}
|
|
17
|
+
export interface PageLayoutTabsSlots {
|
|
18
|
+
[key: `tab-${string}`]: (props: {
|
|
19
|
+
tab: PageLayoutTab;
|
|
20
|
+
}) => any;
|
|
21
|
+
}
|
|
17
22
|
//# sourceMappingURL=page-layout-tabs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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"}
|
|
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"}
|
|
@@ -39,6 +39,12 @@ export interface PageLayoutSlots {
|
|
|
39
39
|
/**
|
|
40
40
|
* Title after slot for page title after content
|
|
41
41
|
*/
|
|
42
|
-
'title-after'(): any;
|
|
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;
|
|
43
49
|
}
|
|
44
50
|
//# sourceMappingURL=page-layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,IAAI,GAAG,CAAA;
|
|
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"}
|