@kong-ui-public/page-layout 0.2.2-pr.2968.f8a532bf6.0 → 0.2.2
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 +242 -0
- package/dist/page-layout.umd.js +1 -0
- package/dist/style.css +1 -0
- package/dist/types/components/PageLayout.vue.d.ts +12 -0
- package/dist/types/components/PageLayout.vue.d.ts.map +1 -0
- package/dist/types/components/PageLayoutTabs.vue.d.ts +5 -0
- package/dist/types/components/PageLayoutTabs.vue.d.ts.map +1 -0
- package/dist/types/composables/index.d.ts +6 -0
- package/dist/types/composables/index.d.ts.map +1 -0
- package/dist/types/composables/useI18n.d.ts +9 -0
- package/dist/types/composables/useI18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/symbols.d.ts +2 -0
- package/dist/types/symbols.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +3 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/page-layout-tabs.d.ts +17 -0
- package/dist/types/types/page-layout-tabs.d.ts.map +1 -0
- package/dist/types/types/page-layout.d.ts +17 -0
- package/dist/types/types/page-layout.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { watch as Z, computed as B, toValue as I, unref as C, defineComponent as G, useCssVars as q, inject as H, useTemplateRef as O, ref as E, onMounted as J, onBeforeUnmount as Q, resolveComponent as b, openBlock as i, createElementBlock as r, createElementVNode as g, normalizeClass as L, Fragment as S, renderList as x, createBlock as h, resolveDynamicComponent as X, withKeys as j, withModifiers as D, withCtx as N, createTextVNode as M, toDisplayString as $, createVNode as V, createCommentVNode as f, nextTick as W, provide as Y, renderSlot as ee } from "vue";
|
|
2
|
+
import { useRouter as te } from "vue-router";
|
|
3
|
+
import { createI18n as ae, i18nTComponent as oe } from "@kong-ui-public/i18n";
|
|
4
|
+
const ne = {
|
|
5
|
+
more_button: {
|
|
6
|
+
label: "More",
|
|
7
|
+
aria_label: "More tabs"
|
|
8
|
+
}
|
|
9
|
+
}, se = {
|
|
10
|
+
tabs: ne
|
|
11
|
+
};
|
|
12
|
+
function le() {
|
|
13
|
+
const e = ae("en-us", se);
|
|
14
|
+
return {
|
|
15
|
+
i18n: e,
|
|
16
|
+
i18nT: oe(e)
|
|
17
|
+
// Translation component <i18n-t>
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
const ie = {
|
|
21
|
+
useI18n: le
|
|
22
|
+
}, ue = "16px", re = typeof window < "u" && typeof document < "u";
|
|
23
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
24
|
+
const ce = Object.prototype.toString, de = (e) => ce.call(e) === "[object Object]";
|
|
25
|
+
function A(e) {
|
|
26
|
+
return Array.isArray(e) ? e : [e];
|
|
27
|
+
}
|
|
28
|
+
function ve(e, s, n) {
|
|
29
|
+
return Z(e, s, {
|
|
30
|
+
...n,
|
|
31
|
+
immediate: !0
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const pe = re ? window : void 0;
|
|
35
|
+
function ye(e) {
|
|
36
|
+
var s;
|
|
37
|
+
const n = I(e);
|
|
38
|
+
return (s = n == null ? void 0 : n.$el) !== null && s !== void 0 ? s : n;
|
|
39
|
+
}
|
|
40
|
+
function me(...e) {
|
|
41
|
+
const s = (o, a, l, u) => (o.addEventListener(a, l, u), () => o.removeEventListener(a, l, u)), n = B(() => {
|
|
42
|
+
const o = A(I(e[0])).filter((a) => a != null);
|
|
43
|
+
return o.every((a) => typeof a != "string") ? o : void 0;
|
|
44
|
+
});
|
|
45
|
+
return ve(() => {
|
|
46
|
+
var o, a;
|
|
47
|
+
return [
|
|
48
|
+
(o = (a = n.value) === null || a === void 0 ? void 0 : a.map((l) => ye(l))) !== null && o !== void 0 ? o : [pe].filter((l) => l != null),
|
|
49
|
+
A(I(n.value ? e[1] : e[0])),
|
|
50
|
+
A(C(n.value ? e[2] : e[1])),
|
|
51
|
+
I(n.value ? e[3] : e[2])
|
|
52
|
+
];
|
|
53
|
+
}, ([o, a, l, u], y, c) => {
|
|
54
|
+
if (!(o != null && o.length) || !(a != null && a.length) || !(l != null && l.length)) return;
|
|
55
|
+
const v = de(u) ? { ...u } : u, K = o.flatMap((m) => a.flatMap((k) => l.map((p) => s(m, k, p, v))));
|
|
56
|
+
c(() => {
|
|
57
|
+
K.forEach((m) => m());
|
|
58
|
+
});
|
|
59
|
+
}, { flush: "post" });
|
|
60
|
+
}
|
|
61
|
+
const fe = {
|
|
62
|
+
ref: "page-layout-tabs",
|
|
63
|
+
class: "page-layout-tabs",
|
|
64
|
+
"data-testid": "page-layout-tabs"
|
|
65
|
+
}, be = { key: 0 }, ge = ["aria-label"], he = { class: "overflowing-items-count" }, ke = {
|
|
66
|
+
key: 0,
|
|
67
|
+
class: "layout-loader-container"
|
|
68
|
+
}, _e = /* @__PURE__ */ G({
|
|
69
|
+
__name: "PageLayoutTabs",
|
|
70
|
+
props: {
|
|
71
|
+
tabs: { default: () => [] }
|
|
72
|
+
},
|
|
73
|
+
setup(e) {
|
|
74
|
+
q((d) => ({
|
|
75
|
+
e372aee6: C(l)
|
|
76
|
+
}));
|
|
77
|
+
const { i18n: { t: s } } = ie.useI18n(), n = te(), o = H("app:navigateTo", null), a = (d) => {
|
|
78
|
+
if (typeof d.to != "string") {
|
|
79
|
+
n.push(d.to);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (typeof o != "function") {
|
|
83
|
+
window.location.href = d.to;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
o(d.to);
|
|
87
|
+
}, l = ue, u = O("page-layout-tabs"), y = O("page-layout-tabs-list"), c = E(e.tabs.length), v = E(!1), K = B(() => e.tabs.slice(0, c.value)), m = B(() => e.tabs.slice(c.value)), k = async () => {
|
|
88
|
+
var T, w, t;
|
|
89
|
+
if (!u.value || !y.value)
|
|
90
|
+
return;
|
|
91
|
+
v.value = !1, c.value = e.tabs.length, await W();
|
|
92
|
+
const d = ((T = u.value) == null ? void 0 : T.getBoundingClientRect().width) - parseInt(l) * 2;
|
|
93
|
+
let _ = (w = y.value) == null ? void 0 : w.getBoundingClientRect().width;
|
|
94
|
+
if (!d || !_) {
|
|
95
|
+
v.value = !0;
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const P = 50;
|
|
99
|
+
for (; _ + P > d && c.value > 1; )
|
|
100
|
+
c.value--, await W(), _ = ((t = y.value) == null ? void 0 : t.getBoundingClientRect().width) || 0;
|
|
101
|
+
v.value = !0;
|
|
102
|
+
};
|
|
103
|
+
let p = null;
|
|
104
|
+
const F = () => {
|
|
105
|
+
p && clearTimeout(p), p = setTimeout(() => {
|
|
106
|
+
k();
|
|
107
|
+
}, 150);
|
|
108
|
+
};
|
|
109
|
+
return J(() => {
|
|
110
|
+
k(), me(window, "resize", F);
|
|
111
|
+
}), Q(() => {
|
|
112
|
+
p && clearTimeout(p);
|
|
113
|
+
}), (d, _) => {
|
|
114
|
+
const P = b("KDropdownItem"), T = b("KDropdown"), w = b("KSkeletonBox");
|
|
115
|
+
return i(), r("nav", fe, [
|
|
116
|
+
g("ul", {
|
|
117
|
+
ref: "page-layout-tabs-list",
|
|
118
|
+
class: L({ "layout-computing": !v.value })
|
|
119
|
+
}, [
|
|
120
|
+
(i(!0), r(S, null, x(K.value, (t) => (i(), r("li", {
|
|
121
|
+
key: `${t.key}-tab`
|
|
122
|
+
}, [
|
|
123
|
+
(i(), h(X(typeof t.to == "string" ? "a" : "router-link"), {
|
|
124
|
+
"aria-current": t.active ? "page" : void 0,
|
|
125
|
+
class: L(["tab-link", { active: t.active }]),
|
|
126
|
+
"data-testid": t.dataTestId ? t.dataTestId : `page-layout-tab-${t.key}`,
|
|
127
|
+
href: typeof t.to == "string" ? t.to : void 0,
|
|
128
|
+
tabindex: "0",
|
|
129
|
+
to: typeof t.to == "string" ? void 0 : t.to,
|
|
130
|
+
onClick: D((R) => a(t), ["prevent"]),
|
|
131
|
+
onKeydown: [
|
|
132
|
+
j(D((R) => a(t), ["prevent"]), ["enter"]),
|
|
133
|
+
j(D((R) => a(t), ["prevent"]), ["space"])
|
|
134
|
+
]
|
|
135
|
+
}, {
|
|
136
|
+
default: N(() => [
|
|
137
|
+
M($(t.label), 1)
|
|
138
|
+
]),
|
|
139
|
+
_: 2
|
|
140
|
+
}, 1064, ["aria-current", "class", "data-testid", "href", "to", "onClick", "onKeydown"]))
|
|
141
|
+
]))), 128)),
|
|
142
|
+
e.tabs.length > c.value ? (i(), r("li", be, [
|
|
143
|
+
V(T, { "kpop-attributes": {
|
|
144
|
+
placement: "bottom-end",
|
|
145
|
+
popoverElementAttributes: { "data-testid": "tabs-overflow-dropdown-popover" }
|
|
146
|
+
} }, {
|
|
147
|
+
items: N(() => [
|
|
148
|
+
(i(!0), r(S, null, x(m.value, (t) => (i(), h(P, {
|
|
149
|
+
key: `${t.key}-dropdown-item`,
|
|
150
|
+
"aria-current": t.active ? "page" : void 0,
|
|
151
|
+
"data-testid": t.dataTestId ? t.dataTestId : `page-layout-tab-${t.key}`,
|
|
152
|
+
item: {
|
|
153
|
+
label: t.label,
|
|
154
|
+
value: t.key,
|
|
155
|
+
to: t.to
|
|
156
|
+
},
|
|
157
|
+
selected: t.active
|
|
158
|
+
}, null, 8, ["aria-current", "data-testid", "item", "selected"]))), 128))
|
|
159
|
+
]),
|
|
160
|
+
default: N(() => [
|
|
161
|
+
g("button", {
|
|
162
|
+
"aria-label": C(s)("tabs.more_button.aria_label"),
|
|
163
|
+
class: L(["tab-link overflow-dropdown-trigger", { active: m.value.find((t) => t.active) }]),
|
|
164
|
+
"data-testid": "tabs-overflow-dropdown-button"
|
|
165
|
+
}, [
|
|
166
|
+
M($(C(s)("tabs.more_button.label")) + " ", 1),
|
|
167
|
+
g("span", he, $(e.tabs.length - c.value), 1)
|
|
168
|
+
], 10, ge)
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
})
|
|
172
|
+
])) : f("", !0)
|
|
173
|
+
], 2),
|
|
174
|
+
v.value ? f("", !0) : (i(), r("div", ke, [
|
|
175
|
+
(i(), r(S, null, x(3, (t) => V(w, {
|
|
176
|
+
key: `layout-loader-${t}`,
|
|
177
|
+
height: "1",
|
|
178
|
+
width: "5"
|
|
179
|
+
})), 64))
|
|
180
|
+
]))
|
|
181
|
+
], 512);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}), U = (e, s) => {
|
|
185
|
+
const n = e.__vccOpts || e;
|
|
186
|
+
for (const [o, a] of s)
|
|
187
|
+
n[o] = a;
|
|
188
|
+
return n;
|
|
189
|
+
}, Te = /* @__PURE__ */ U(_e, [["__scopeId", "data-v-a0346736"]]), z = /* @__PURE__ */ Symbol("nested-page-layout-detection"), we = {
|
|
190
|
+
class: "kong-ui-public-page-layout",
|
|
191
|
+
"data-testid": "kong-ui-public-page-layout"
|
|
192
|
+
}, Ie = {
|
|
193
|
+
key: 0,
|
|
194
|
+
class: "page-layout-header",
|
|
195
|
+
"data-testid": "page-layout-header"
|
|
196
|
+
}, Ce = { class: "page-header-container" }, Le = {
|
|
197
|
+
key: 1,
|
|
198
|
+
class: "page-layout-title",
|
|
199
|
+
"data-testid": "page-layout-title"
|
|
200
|
+
}, $e = /* @__PURE__ */ G({
|
|
201
|
+
__name: "PageLayout",
|
|
202
|
+
props: {
|
|
203
|
+
breadcrumbs: { default: () => [] },
|
|
204
|
+
title: {},
|
|
205
|
+
tabs: { default: () => [] }
|
|
206
|
+
},
|
|
207
|
+
setup(e) {
|
|
208
|
+
const s = B(() => !!(e.tabs && e.tabs.length)), n = E(!1);
|
|
209
|
+
Y(z, () => {
|
|
210
|
+
n.value = !0;
|
|
211
|
+
});
|
|
212
|
+
const o = H(z, null);
|
|
213
|
+
return typeof o == "function" && o(), (a, l) => {
|
|
214
|
+
const u = b("KBreadcrumbs"), y = b("router-view");
|
|
215
|
+
return i(), r("div", we, [
|
|
216
|
+
n.value ? f("", !0) : (i(), r("div", Ie, [
|
|
217
|
+
g("div", Ce, [
|
|
218
|
+
e.breadcrumbs && e.breadcrumbs.length ? (i(), h(u, {
|
|
219
|
+
key: 0,
|
|
220
|
+
class: "header-breadcrumbs",
|
|
221
|
+
"data-testid": "page-layout-breadcrumbs",
|
|
222
|
+
items: e.breadcrumbs
|
|
223
|
+
}, null, 8, ["items"])) : f("", !0),
|
|
224
|
+
e.title ? (i(), r("h1", Le, $(e.title), 1)) : f("", !0)
|
|
225
|
+
]),
|
|
226
|
+
s.value ? (i(), h(Te, {
|
|
227
|
+
key: 0,
|
|
228
|
+
tabs: e.tabs
|
|
229
|
+
}, null, 8, ["tabs"])) : f("", !0)
|
|
230
|
+
])),
|
|
231
|
+
g("div", {
|
|
232
|
+
class: L(["page-layout-content", { "has-nested-page-layout": n.value }])
|
|
233
|
+
}, [
|
|
234
|
+
s.value ? (i(), h(y, { key: 0 })) : ee(a.$slots, "default", { key: 1 }, void 0, !0)
|
|
235
|
+
], 2)
|
|
236
|
+
]);
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}), Se = /* @__PURE__ */ U($e, [["__scopeId", "data-v-5059a86f"]]);
|
|
240
|
+
export {
|
|
241
|
+
Se as PageLayout
|
|
242
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vue-router"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router","@kong-ui-public/i18n"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r["kong-ui-public-page-layout"]={},r.Vue,r.VueRouter,r["kong-ui-public-i18n"]))})(this,(function(r,e,V,T){"use strict";const L={tabs:{more_button:{label:"More",aria_label:"More tabs"}}};function I(){const t=T.createI18n("en-us",L);return{i18n:t,i18nT:T.i18nTComponent(t)}}const $={useI18n:I},S="16px",x=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const P=Object.prototype.toString,D=t=>P.call(t)==="[object Object]";function B(t){return Array.isArray(t)?t:[t]}function K(t,i,l){return e.watch(t,i,{...l,immediate:!0})}const R=x?window:void 0;function A(t){var i;const l=e.toValue(t);return(i=l==null?void 0:l.$el)!==null&&i!==void 0?i:l}function j(...t){const i=(a,n,s,c)=>(a.addEventListener(n,s,c),()=>a.removeEventListener(n,s,c)),l=e.computed(()=>{const a=B(e.toValue(t[0])).filter(n=>n!=null);return a.every(n=>typeof n!="string")?a:void 0});return K(()=>{var a,n;return[(a=(n=l.value)===null||n===void 0?void 0:n.map(s=>A(s)))!==null&&a!==void 0?a:[R].filter(s=>s!=null),B(e.toValue(l.value?t[1]:t[0])),B(e.unref(l.value?t[2]:t[1])),e.toValue(l.value?t[3]:t[2])]},([a,n,s,c],f,d)=>{if(!(a!=null&&a.length)||!(n!=null&&n.length)||!(s!=null&&s.length))return;const p=D(c)?{...c}:c,_=a.flatMap(y=>n.flatMap(b=>s.map(m=>i(y,b,m,p))));d(()=>{_.forEach(y=>y())})},{flush:"post"})}const M={ref:"page-layout-tabs",class:"page-layout-tabs","data-testid":"page-layout-tabs"},O={key:0},z=["aria-label"],W={class:"overflowing-items-count"},G={key:0,class:"layout-loader-container"},q=e.defineComponent({__name:"PageLayoutTabs",props:{tabs:{default:()=>[]}},setup(t){e.useCssVars(u=>({e372aee6:e.unref(s)}));const{i18n:{t:i}}=$.useI18n(),l=V.useRouter(),a=e.inject("app:navigateTo",null),n=u=>{if(typeof u.to!="string"){l.push(u.to);return}if(typeof a!="function"){window.location.href=u.to;return}a(u.to)},s=S,c=e.useTemplateRef("page-layout-tabs"),f=e.useTemplateRef("page-layout-tabs-list"),d=e.ref(t.tabs.length),p=e.ref(!1),_=e.computed(()=>t.tabs.slice(0,d.value)),y=e.computed(()=>t.tabs.slice(d.value)),b=async()=>{var k,h,o;if(!c.value||!f.value)return;p.value=!1,d.value=t.tabs.length,await e.nextTick();const u=((k=c.value)==null?void 0:k.getBoundingClientRect().width)-parseInt(s)*2;let g=(h=f.value)==null?void 0:h.getBoundingClientRect().width;if(!u||!g){p.value=!0;return}const C=50;for(;g+C>u&&d.value>1;)d.value--,await e.nextTick(),g=((o=f.value)==null?void 0:o.getBoundingClientRect().width)||0;p.value=!0};let m=null;const X=()=>{m&&clearTimeout(m),m=setTimeout(()=>{b()},150)};return e.onMounted(()=>{b(),j(window,"resize",X)}),e.onBeforeUnmount(()=>{m&&clearTimeout(m)}),(u,g)=>{const C=e.resolveComponent("KDropdownItem"),k=e.resolveComponent("KDropdown"),h=e.resolveComponent("KSkeletonBox");return e.openBlock(),e.createElementBlock("nav",M,[e.createElementVNode("ul",{ref:"page-layout-tabs-list",class:e.normalizeClass({"layout-computing":!p.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,o=>(e.openBlock(),e.createElementBlock("li",{key:`${o.key}-tab`},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(typeof o.to=="string"?"a":"router-link"),{"aria-current":o.active?"page":void 0,class:e.normalizeClass(["tab-link",{active:o.active}]),"data-testid":o.dataTestId?o.dataTestId:`page-layout-tab-${o.key}`,href:typeof o.to=="string"?o.to:void 0,tabindex:"0",to:typeof o.to=="string"?void 0:o.to,onClick:e.withModifiers(N=>n(o),["prevent"]),onKeydown:[e.withKeys(e.withModifiers(N=>n(o),["prevent"]),["enter"]),e.withKeys(e.withModifiers(N=>n(o),["prevent"]),["space"])]},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1064,["aria-current","class","data-testid","href","to","onClick","onKeydown"]))]))),128)),t.tabs.length>d.value?(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(k,{"kpop-attributes":{placement:"bottom-end",popoverElementAttributes:{"data-testid":"tabs-overflow-dropdown-popover"}}},{items:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,o=>(e.openBlock(),e.createBlock(C,{key:`${o.key}-dropdown-item`,"aria-current":o.active?"page":void 0,"data-testid":o.dataTestId?o.dataTestId:`page-layout-tab-${o.key}`,item:{label:o.label,value:o.key,to:o.to},selected:o.active},null,8,["aria-current","data-testid","item","selected"]))),128))]),default:e.withCtx(()=>[e.createElementVNode("button",{"aria-label":e.unref(i)("tabs.more_button.aria_label"),class:e.normalizeClass(["tab-link overflow-dropdown-trigger",{active:y.value.find(o=>o.active)}]),"data-testid":"tabs-overflow-dropdown-button"},[e.createTextVNode(e.toDisplayString(e.unref(i)("tabs.more_button.label"))+" ",1),e.createElementVNode("span",W,e.toDisplayString(t.tabs.length-d.value),1)],10,z)]),_:1})])):e.createCommentVNode("",!0)],2),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createVNode(h,{key:`layout-loader-${o}`,height:"1",width:"5"})),64))]))],512)}}}),w=(t,i)=>{const l=t.__vccOpts||t;for(const[a,n]of i)l[a]=n;return l},F=w(q,[["__scopeId","data-v-a0346736"]]),E=Symbol("nested-page-layout-detection"),H={class:"kong-ui-public-page-layout","data-testid":"kong-ui-public-page-layout"},U={key:0,class:"page-layout-header","data-testid":"page-layout-header"},Z={class:"page-header-container"},J={key:1,class:"page-layout-title","data-testid":"page-layout-title"},Q=w(e.defineComponent({__name:"PageLayout",props:{breadcrumbs:{default:()=>[]},title:{},tabs:{default:()=>[]}},setup(t){const i=e.computed(()=>!!(t.tabs&&t.tabs.length)),l=e.ref(!1);e.provide(E,()=>{l.value=!0});const a=e.inject(E,null);return typeof a=="function"&&a(),(n,s)=>{const c=e.resolveComponent("KBreadcrumbs"),f=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",H,[l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",Z,[t.breadcrumbs&&t.breadcrumbs.length?(e.openBlock(),e.createBlock(c,{key:0,class:"header-breadcrumbs","data-testid":"page-layout-breadcrumbs",items:t.breadcrumbs},null,8,["items"])):e.createCommentVNode("",!0),t.title?(e.openBlock(),e.createElementBlock("h1",J,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0)]),i.value?(e.openBlock(),e.createBlock(F,{key:0,tabs:t.tabs},null,8,["tabs"])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["page-layout-content",{"has-nested-page-layout":l.value}])},[i.value?(e.openBlock(),e.createBlock(f,{key:0})):e.renderSlot(n.$slots,"default",{key:1},void 0,!0)],2)])}}}),[["__scopeId","data-v-5059a86f"]]);r.PageLayout=Q,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.page-layout-tabs[data-v-a0346736]{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(--e372aee6);padding:var(--kui-space-0, 0px) var(--e372aee6);position:relative;width:100%}.page-layout-tabs a[data-v-a0346736],.page-layout-tabs button[data-v-a0346736]{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-a0346736]{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-a0346736]{height:0;visibility:hidden}.page-layout-tabs ul li[data-v-a0346736]{display:flex}.page-layout-tabs ul li .tab-link[data-v-a0346736]{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-a0346736]: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-a0346736]: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-a0346736]{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-a0346736]{color:#000933;color:var(--kui-color-text, #000933);font-weight:500!important;font-weight:var(--kui-font-weight-medium, 500)!important}.page-layout-tabs ul li .tab-link.overflow-dropdown-trigger .overflowing-items-count[data-v-a0346736]{background-color:#e0e4ea;background-color:var(--kui-color-background-neutral-weaker, #e0e4ea);border-radius:100px;border-radius:var(--kui-border-radius-round, 100px);color:#52596e;color:var(--kui-color-text-neutral-strong, #52596e);font-size:11px;font-weight:600;font-weight:var(--kui-font-weight-semibold, 600);line-height:12px;padding:2px 6px;padding:var(--kui-space-10, 2px) var(--kui-space-30, 6px)}.page-layout-tabs ul li .tab-link.overflow-dropdown-trigger.active .overflowing-items-count[data-v-a0346736]{background-color:#eefaff;background-color:var(--kui-color-background-primary-weakest, #eefaff);color:#0044f4;color:var(--kui-color-text-primary, #0044f4)}.page-layout-tabs .layout-loader-container[data-v-a0346736]{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(--e372aee6);position:absolute}.kong-ui-public-page-layout[data-v-5059a86f]{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-5059a86f]{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-5059a86f]{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 .header-breadcrumbs[data-v-5059a86f] .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 .header-breadcrumbs[data-v-5059a86f] .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-layout-title[data-v-5059a86f]{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:not(:has(.page-layout-tabs)) .page-header-container[data-v-5059a86f]{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-5059a86f]{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-5059a86f]{padding:0;padding:var(--kui-space-0, 0px)}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLayout.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayout.vue"],"names":[],"mappings":"AAiJA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAYhE,KAAK,WAAW,GAAG,eAAe,CAAC;AAsInC,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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PageLayoutTabsProps } from '../types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<PageLayoutTabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PageLayoutTabsProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=PageLayoutTabs.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageLayoutTabs.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PageLayoutTabs.vue"],"names":[],"mappings":"AA+SA,OAAO,KAAK,EAAE,mBAAmB,EAAiB,MAAM,UAAU,CAAA;AA8TlE,QAAA,MAAM,YAAY,kTAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAA;;;;AAE/B,wBAEC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/symbols.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,eAAyC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
//# sourceMappingURL=page-layout-tabs.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BreadcrumbItem } from '@kong/kongponents';
|
|
2
|
+
import type { PageLayoutTab } from './';
|
|
3
|
+
export interface PageLayoutProps {
|
|
4
|
+
/** Breadcrumb items */
|
|
5
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
6
|
+
/** Page title */
|
|
7
|
+
title: string;
|
|
8
|
+
/** Tabs */
|
|
9
|
+
tabs?: PageLayoutTab[];
|
|
10
|
+
}
|
|
11
|
+
export interface PageLayoutSlots {
|
|
12
|
+
/**
|
|
13
|
+
* Default slot for page content
|
|
14
|
+
*/
|
|
15
|
+
default?(): any;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=page-layout.d.ts.map
|
|
@@ -0,0 +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;AAEvC,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAA;IAC9B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW;IACX,IAAI,CAAC,EAAE,aAAa,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,CAAC,IAAI,GAAG,CAAA;CAChB"}
|