@nova-kits/components 1.0.2-alpha.0 → 1.0.3-alpha.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.
@@ -1,11 +1,4 @@
1
- import { type ClassValue, type StyleValue } from 'vue';
2
- export interface LayoutProps {
3
- defaultSidebarWidth?: number;
4
- collapsed?: boolean;
5
- activeKey?: string;
6
- class?: ClassValue;
7
- style?: StyleValue;
8
- }
1
+ import type { LayoutProps } from './typing';
9
2
  declare var __VLS_1: {}, __VLS_13: {}, __VLS_15: {}, __VLS_17: {};
10
3
  type __VLS_Slots = {} & {
11
4
  header?: (props: typeof __VLS_1) => any;
@@ -25,8 +18,8 @@ declare const __VLS_base: import("vue").DefineComponent<LayoutProps, {}, {}, {},
25
18
  }>, {
26
19
  defaultSidebarWidth: number;
27
20
  collapsed: boolean;
28
- style: string | false | import("vue").CSSProperties | StyleValue[] | null;
29
- class: string | false | Record<string, any> | ClassValue[] | null;
21
+ style: string | false | import("vue").CSSProperties | import("vue").StyleValue[] | null;
22
+ class: string | false | Record<string, any> | import("vue").ClassValue[] | null;
30
23
  activeKey: string;
31
24
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
25
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,9 +1,5 @@
1
1
  import 'splitpanes/dist/splitpanes.css';
2
- type __VLS_Props = {
3
- defaultSidebarWidth?: number;
4
- collapsed?: boolean;
5
- containerWidth?: number;
6
- };
2
+ import type { LayoutContentProps } from './typing';
7
3
  declare var __VLS_15: {}, __VLS_23: {}, __VLS_25: {};
8
4
  type __VLS_Slots = {} & {
9
5
  left?: (props: typeof __VLS_15) => any;
@@ -12,11 +8,11 @@ type __VLS_Slots = {} & {
12
8
  } & {
13
9
  default?: (props: typeof __VLS_25) => any;
14
10
  };
15
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ declare const __VLS_base: import("vue").DefineComponent<LayoutContentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
12
  "update:sidebarWidth": (value: number) => any;
17
13
  "update:collapsed": (value: boolean) => any;
18
14
  collapse: (value: boolean) => any;
19
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ }, string, import("vue").PublicProps, Readonly<LayoutContentProps> & Readonly<{
20
16
  "onUpdate:sidebarWidth"?: ((value: number) => any) | undefined;
21
17
  "onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
22
18
  onCollapse?: ((value: boolean) => any) | undefined;
@@ -1,11 +1,9 @@
1
- type __VLS_Props = {
2
- to: 'header' | 'footer';
3
- };
1
+ import type { LayoutPortalProps } from './typing';
4
2
  declare var __VLS_7: {};
5
3
  type __VLS_Slots = {} & {
6
4
  default?: (props: typeof __VLS_7) => any;
7
5
  };
8
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const __VLS_base: import("vue").DefineComponent<LayoutPortalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<LayoutPortalProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
7
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
8
  declare const _default: typeof __VLS_export;
11
9
  export default _default;
@@ -1,16 +1,4 @@
1
- import { type ClassValue, type StyleValue } from 'vue';
2
- export interface Tab {
3
- label?: string;
4
- key: string;
5
- }
6
- export interface LayoutTabsProps {
7
- tabs?: Tab[];
8
- activeKey?: string;
9
- defaultSidebarWidth?: number;
10
- collapsed?: boolean;
11
- class?: ClassValue;
12
- style?: StyleValue;
13
- }
1
+ import type { Tab, LayoutTabsProps } from './typing';
14
2
  declare var __VLS_1: {}, __VLS_27: {}, __VLS_30: string, __VLS_31: {}, __VLS_33: {};
15
3
  type __VLS_Slots = {} & {
16
4
  [K in NonNullable<typeof __VLS_30>]?: (props: typeof __VLS_31) => any;
@@ -34,8 +22,8 @@ declare const __VLS_base: import("vue").DefineComponent<LayoutTabsProps, {}, {},
34
22
  }>, {
35
23
  defaultSidebarWidth: number;
36
24
  collapsed: boolean;
37
- style: string | false | import("vue").CSSProperties | StyleValue[] | null;
38
- class: string | false | Record<string, any> | ClassValue[] | null;
25
+ style: string | false | import("vue").CSSProperties | import("vue").StyleValue[] | null;
26
+ class: string | false | Record<string, any> | import("vue").ClassValue[] | null;
39
27
  activeKey: string;
40
28
  tabs: Tab[];
41
29
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -3,6 +3,7 @@ export { default as NLayoutTabs } from './LayoutTabs.vue';
3
3
  export { default as NLayoutPortal } from './LayoutPortal.vue';
4
4
  export { default as NLayoutContent } from './LayoutContent.vue';
5
5
  export { useTabFocus } from './composables/useLayoutContext';
6
+ export type * from './typing';
6
7
  import _NLayout from './Layout.vue';
7
8
  import _NLayoutTabs from './LayoutTabs.vue';
8
9
  import _NLayoutPortal from './LayoutPortal.vue';
@@ -0,0 +1,28 @@
1
+ import type { ClassValue, StyleValue } from 'vue';
2
+ export interface LayoutProps {
3
+ defaultSidebarWidth?: number;
4
+ collapsed?: boolean;
5
+ activeKey?: string;
6
+ class?: ClassValue;
7
+ style?: StyleValue;
8
+ }
9
+ export interface Tab {
10
+ label?: string;
11
+ key: string;
12
+ }
13
+ export interface LayoutTabsProps {
14
+ tabs?: Tab[];
15
+ activeKey?: string;
16
+ defaultSidebarWidth?: number;
17
+ collapsed?: boolean;
18
+ class?: ClassValue;
19
+ style?: StyleValue;
20
+ }
21
+ export interface LayoutContentProps {
22
+ defaultSidebarWidth?: number;
23
+ collapsed?: boolean;
24
+ containerWidth?: number;
25
+ }
26
+ export interface LayoutPortalProps {
27
+ to: 'header' | 'footer';
28
+ }
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import { App } from 'vue';
2
2
  export * from 'element-plus';
3
3
  import 'element-plus/dist/index.css';
4
4
  import './styles/scrollbar.scss';
5
+ import './styles/_variables.scss';
5
6
  export { NLayoutWithSub as NLayout, NLayoutTabs, NLayoutPortal, useTabFocus } from './Layout/index';
6
7
  export declare function install(app: App): void;
7
8
  declare const _default: {
package/dist/index.esm.js CHANGED
@@ -104,7 +104,7 @@ const J = /* @__PURE__ */ S({
104
104
  for (const [s, r] of a)
105
105
  t[s] = r;
106
106
  return t;
107
- }, K = /* @__PURE__ */ g(J, [["__scopeId", "data-v-a8a5b082"]]), P = /* @__PURE__ */ Symbol("layout-context");
107
+ }, K = /* @__PURE__ */ g(J, [["__scopeId", "data-v-565c92bc"]]), P = /* @__PURE__ */ Symbol("layout-context");
108
108
  function E() {
109
109
  return X(P, null);
110
110
  }
@@ -176,7 +176,7 @@ const Q = ["id"], Z = ["id"], x = /* @__PURE__ */ S({
176
176
  ], 2)) : $("", !0)
177
177
  ], 6));
178
178
  }
179
- }), _ = /* @__PURE__ */ g(x, [["__scopeId", "data-v-c90dad87"]]), ee = ["id"], te = ["id"], oe = /* @__PURE__ */ S({
179
+ }), _ = /* @__PURE__ */ g(x, [["__scopeId", "data-v-d9758f9b"]]), ee = ["id"], te = ["id"], oe = /* @__PURE__ */ S({
180
180
  __name: "LayoutTabs",
181
181
  props: {
182
182
  tabs: { default: () => [] },
@@ -268,7 +268,7 @@ const Q = ["id"], Z = ["id"], x = /* @__PURE__ */ S({
268
268
  ], 2)) : $("", !0)
269
269
  ], 6));
270
270
  }
271
- }), j = /* @__PURE__ */ g(oe, [["__scopeId", "data-v-12d97b4e"]]), A = /* @__PURE__ */ S({
271
+ }), j = /* @__PURE__ */ g(oe, [["__scopeId", "data-v-09cbd4e3"]]), A = /* @__PURE__ */ S({
272
272
  __name: "LayoutPortal",
273
273
  props: {
274
274
  to: {}
@@ -1 +1 @@
1
- (function(r,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("element-plus"),require("vue"),require("splitpanes")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","splitpanes"],f):(r=typeof globalThis<"u"?globalThis:r||self,f(r.NovaKits={},r.ElementPlus,r.Vue,r.splitpanes))})(this,(function(r,f,e,h){"use strict";const w="nova";function C(t){return a=>`${w}-${t}`+(a?`-${a}`:"")}const L=e.defineComponent({__name:"LayoutContent",props:{defaultSidebarWidth:{default:242},collapsed:{type:Boolean,default:!1},containerWidth:{default:1e3}},emits:["update:sidebarWidth","update:collapsed","collapse"],setup(t,{emit:a}){const o=C("layout"),n=t,d=a,s=e.ref(n.defaultSidebarWidth),p=e.computed(()=>Math.min(50,Math.max(10,s.value/n.containerWidth*100)));function m(l){if(n.collapsed)return;const i=l.panes[0].size,c=Math.round(i/100*n.containerWidth);s.value=c,d("update:sidebarWidth",c)}function y(){const l=!n.collapsed;d("update:collapsed",l),d("collapse",l)}return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o)("content-wrapper")])},[l.$slots.left?(e.openBlock(),e.createBlock(e.unref(h.Splitpanes),{key:0,class:e.normalizeClass(["default-theme",[e.unref(o)("splitpanes")]]),onResize:m},{default:e.withCtx(()=>[e.createVNode(e.unref(h.Pane),{size:t.collapsed?0:p.value,"min-size":t.collapsed?0:10,"max-size":t.collapsed?0:50,class:e.normalizeClass([e.unref(o)("left"),{[e.unref(o)("left-collapsed")]:t.collapsed}])},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("left-body")])},[e.renderSlot(l.$slots,"left",{},void 0,!0)],2)]),_:3},8,["size","min-size","max-size","class"]),e.createVNode(e.unref(h.Pane),{size:t.collapsed?100:100-p.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("content")])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("content-scroll")])},[e.renderSlot(l.$slots,"default",{},void 0,!0)],2)],2)]),_:3},8,["size"])]),_:3},8,["class"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(o)("content")])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("content-scroll")])},[e.renderSlot(l.$slots,"default",{},void 0,!0)],2)],2)),l.$slots.left?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(o)("left-collapse-btn"),{[e.unref(o)("left-collapse-btn-collapsed")]:t.collapsed}]),onClick:y},[...i[0]||(i[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M8 1L4 6L8 11",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)):e.createCommentVNode("",!0)],2))}}),k=(t,a)=>{const o=t.__vccOpts||t;for(const[n,d]of a)o[n]=d;return o},S=k(L,[["__scopeId","data-v-a8a5b082"]]),B=Symbol("layout-context");function z(){return e.inject(B,null)}function V(t){e.provide(B,t)}function T(t){const a=z();return a?e.computed(()=>a.activeKey.value===t):e.computed(()=>!0)}const W=["id"],g=["id"],I=k(e.defineComponent({__name:"Layout",props:{defaultSidebarWidth:{default:242},collapsed:{type:Boolean,default:!1},activeKey:{default:void 0},class:{type:[Boolean,null,String,Object,Array],default:void 0},style:{type:[Boolean,null,String,Object,Array],default:void 0}},emits:["update:collapsed","collapse"],setup(t){const a=C("layout"),o=t,n=e.useId(),d={header:`nova-layout-header-${n}`,footer:`nova-layout-footer-${n}`};return V({teleportIds:d,activeKey:e.computed(()=>o.activeKey)}),(s,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(a)(),o.class]),style:e.normalizeStyle(t.style)},[s.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(a)("header")])},[e.renderSlot(s.$slots,"header",{},void 0,!0),e.createElementVNode("div",{id:d.header},null,8,W)],2)):e.createCommentVNode("",!0),e.createVNode(S,{"default-sidebar-width":t.defaultSidebarWidth,collapsed:t.collapsed,"onUpdate:collapsed":p[0]||(p[0]=m=>s.$emit("update:collapsed",m)),onCollapse:p[1]||(p[1]=m=>s.$emit("collapse",m))},e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},void 0,!0)]),_:2},[s.$slots.left?{name:"left",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"left",{},void 0,!0)]),key:"0"}:void 0]),1032,["default-sidebar-width","collapsed"]),s.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(a)("footer")])},[e.renderSlot(s.$slots,"footer",{},void 0,!0),e.createElementVNode("div",{id:d.footer},null,8,g)],2)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-c90dad87"]]),K=["id"],O=["id"],b=k(e.defineComponent({__name:"LayoutTabs",props:{tabs:{default:()=>[]},activeKey:{default:void 0},defaultSidebarWidth:{default:242},collapsed:{type:Boolean,default:!1},class:{type:[Boolean,null,String,Object,Array],default:void 0},style:{type:[Boolean,null,String,Object,Array],default:void 0}},emits:["update:activeKey","update:collapsed","tab-click","collapse"],setup(t,{emit:a}){const o=C("layout"),n=t,d=a,s=e.computed({get:()=>n.activeKey??n.tabs[0]?.key,set:l=>d("update:activeKey",l)});function p(l,i){d("tab-click",String(l.paneName??""))}const m=e.useId(),y={header:`nova-layout-header-${m}`,footer:`nova-layout-footer-${m}`};return V({teleportIds:y,activeKey:s}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o)("tabs-layout"),n.class]),style:e.normalizeStyle(t.style)},[l.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(o)("header")])},[e.renderSlot(l.$slots,"header",{},void 0,!0),e.createElementVNode("div",{id:y.header},null,8,K)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("tabs-wrapper")])},[e.createVNode(e.unref(f.ElTabs),{modelValue:s.value,"onUpdate:modelValue":i[2]||(i[2]=c=>s.value=c),class:e.normalizeClass(e.unref(o)("tabs")),onTabClick:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,c=>(e.openBlock(),e.createBlock(e.unref(f.ElTabPane),{key:c.key,label:c.label||c.key,name:c.key},{default:e.withCtx(()=>[e.createVNode(S,{"default-sidebar-width":t.defaultSidebarWidth,collapsed:t.collapsed,"onUpdate:collapsed":i[0]||(i[0]=N=>l.$emit("update:collapsed",N)),onCollapse:i[1]||(i[1]=N=>l.$emit("collapse",N))},e.createSlots({default:e.withCtx(()=>[e.renderSlot(l.$slots,c.key,{},void 0,!0)]),_:2},[l.$slots.left?{name:"left",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"left",{},void 0,!0)]),key:"0"}:void 0]),1032,["default-sidebar-width","collapsed"])]),_:2},1032,["label","name"]))),128))]),_:3},8,["modelValue","class"])],2),l.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(o)("footer")])},[e.renderSlot(l.$slots,"footer",{},void 0,!0),e.createElementVNode("div",{id:y.footer},null,8,O)],2)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-12d97b4e"]]),$=e.defineComponent({__name:"LayoutPortal",props:{to:{}},setup(t){const a=t,o=z(),n=e.computed(()=>o?a.to==="header"?o.teleportIds.header:o.teleportIds.footer:null);return(d,s)=>n.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:`#${n.value}`},[e.renderSlot(d.$slots,"default")],8,["to"])):e.createCommentVNode("",!0)}}),u=I;u.Tabs=b,u.Portal=$;function E(t){t.component("NLayout",u),t.component("NLayoutTabs",b),t.component("NLayoutPortal",$),t.use(f)}const j={install:E};r.NLayout=u,r.NLayoutPortal=$,r.NLayoutTabs=b,r.default=j,r.install=E,r.useTabFocus=T,Object.keys(f).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:()=>f[t]})}),Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(r,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("element-plus"),require("vue"),require("splitpanes")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","splitpanes"],f):(r=typeof globalThis<"u"?globalThis:r||self,f(r.NovaKits={},r.ElementPlus,r.Vue,r.splitpanes))})(this,(function(r,f,e,h){"use strict";const w="nova";function C(t){return a=>`${w}-${t}`+(a?`-${a}`:"")}const L=e.defineComponent({__name:"LayoutContent",props:{defaultSidebarWidth:{default:242},collapsed:{type:Boolean,default:!1},containerWidth:{default:1e3}},emits:["update:sidebarWidth","update:collapsed","collapse"],setup(t,{emit:a}){const o=C("layout"),n=t,d=a,s=e.ref(n.defaultSidebarWidth),p=e.computed(()=>Math.min(50,Math.max(10,s.value/n.containerWidth*100)));function m(l){if(n.collapsed)return;const i=l.panes[0].size,c=Math.round(i/100*n.containerWidth);s.value=c,d("update:sidebarWidth",c)}function y(){const l=!n.collapsed;d("update:collapsed",l),d("collapse",l)}return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o)("content-wrapper")])},[l.$slots.left?(e.openBlock(),e.createBlock(e.unref(h.Splitpanes),{key:0,class:e.normalizeClass(["default-theme",[e.unref(o)("splitpanes")]]),onResize:m},{default:e.withCtx(()=>[e.createVNode(e.unref(h.Pane),{size:t.collapsed?0:p.value,"min-size":t.collapsed?0:10,"max-size":t.collapsed?0:50,class:e.normalizeClass([e.unref(o)("left"),{[e.unref(o)("left-collapsed")]:t.collapsed}])},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("left-body")])},[e.renderSlot(l.$slots,"left",{},void 0,!0)],2)]),_:3},8,["size","min-size","max-size","class"]),e.createVNode(e.unref(h.Pane),{size:t.collapsed?100:100-p.value},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("content")])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("content-scroll")])},[e.renderSlot(l.$slots,"default",{},void 0,!0)],2)],2)]),_:3},8,["size"])]),_:3},8,["class"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(o)("content")])},[e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("content-scroll")])},[e.renderSlot(l.$slots,"default",{},void 0,!0)],2)],2)),l.$slots.left?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(o)("left-collapse-btn"),{[e.unref(o)("left-collapse-btn-collapsed")]:t.collapsed}]),onClick:y},[...i[0]||(i[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M8 1L4 6L8 11",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)):e.createCommentVNode("",!0)],2))}}),k=(t,a)=>{const o=t.__vccOpts||t;for(const[n,d]of a)o[n]=d;return o},S=k(L,[["__scopeId","data-v-565c92bc"]]),B=Symbol("layout-context");function z(){return e.inject(B,null)}function V(t){e.provide(B,t)}function T(t){const a=z();return a?e.computed(()=>a.activeKey.value===t):e.computed(()=>!0)}const W=["id"],g=["id"],I=k(e.defineComponent({__name:"Layout",props:{defaultSidebarWidth:{default:242},collapsed:{type:Boolean,default:!1},activeKey:{default:void 0},class:{type:[Boolean,null,String,Object,Array],default:void 0},style:{type:[Boolean,null,String,Object,Array],default:void 0}},emits:["update:collapsed","collapse"],setup(t){const a=C("layout"),o=t,n=e.useId(),d={header:`nova-layout-header-${n}`,footer:`nova-layout-footer-${n}`};return V({teleportIds:d,activeKey:e.computed(()=>o.activeKey)}),(s,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(a)(),o.class]),style:e.normalizeStyle(t.style)},[s.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(a)("header")])},[e.renderSlot(s.$slots,"header",{},void 0,!0),e.createElementVNode("div",{id:d.header},null,8,W)],2)):e.createCommentVNode("",!0),e.createVNode(S,{"default-sidebar-width":t.defaultSidebarWidth,collapsed:t.collapsed,"onUpdate:collapsed":p[0]||(p[0]=m=>s.$emit("update:collapsed",m)),onCollapse:p[1]||(p[1]=m=>s.$emit("collapse",m))},e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},void 0,!0)]),_:2},[s.$slots.left?{name:"left",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"left",{},void 0,!0)]),key:"0"}:void 0]),1032,["default-sidebar-width","collapsed"]),s.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(a)("footer")])},[e.renderSlot(s.$slots,"footer",{},void 0,!0),e.createElementVNode("div",{id:d.footer},null,8,g)],2)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-d9758f9b"]]),K=["id"],O=["id"],b=k(e.defineComponent({__name:"LayoutTabs",props:{tabs:{default:()=>[]},activeKey:{default:void 0},defaultSidebarWidth:{default:242},collapsed:{type:Boolean,default:!1},class:{type:[Boolean,null,String,Object,Array],default:void 0},style:{type:[Boolean,null,String,Object,Array],default:void 0}},emits:["update:activeKey","update:collapsed","tab-click","collapse"],setup(t,{emit:a}){const o=C("layout"),n=t,d=a,s=e.computed({get:()=>n.activeKey??n.tabs[0]?.key,set:l=>d("update:activeKey",l)});function p(l,i){d("tab-click",String(l.paneName??""))}const m=e.useId(),y={header:`nova-layout-header-${m}`,footer:`nova-layout-footer-${m}`};return V({teleportIds:y,activeKey:s}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(o)("tabs-layout"),n.class]),style:e.normalizeStyle(t.style)},[l.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(o)("header")])},[e.renderSlot(l.$slots,"header",{},void 0,!0),e.createElementVNode("div",{id:y.header},null,8,K)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(o)("tabs-wrapper")])},[e.createVNode(e.unref(f.ElTabs),{modelValue:s.value,"onUpdate:modelValue":i[2]||(i[2]=c=>s.value=c),class:e.normalizeClass(e.unref(o)("tabs")),onTabClick:p},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,c=>(e.openBlock(),e.createBlock(e.unref(f.ElTabPane),{key:c.key,label:c.label||c.key,name:c.key},{default:e.withCtx(()=>[e.createVNode(S,{"default-sidebar-width":t.defaultSidebarWidth,collapsed:t.collapsed,"onUpdate:collapsed":i[0]||(i[0]=N=>l.$emit("update:collapsed",N)),onCollapse:i[1]||(i[1]=N=>l.$emit("collapse",N))},e.createSlots({default:e.withCtx(()=>[e.renderSlot(l.$slots,c.key,{},void 0,!0)]),_:2},[l.$slots.left?{name:"left",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"left",{},void 0,!0)]),key:"0"}:void 0]),1032,["default-sidebar-width","collapsed"])]),_:2},1032,["label","name"]))),128))]),_:3},8,["modelValue","class"])],2),l.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass([e.unref(o)("footer")])},[e.renderSlot(l.$slots,"footer",{},void 0,!0),e.createElementVNode("div",{id:y.footer},null,8,O)],2)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-09cbd4e3"]]),$=e.defineComponent({__name:"LayoutPortal",props:{to:{}},setup(t){const a=t,o=z(),n=e.computed(()=>o?a.to==="header"?o.teleportIds.header:o.teleportIds.footer:null);return(d,s)=>n.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:`#${n.value}`},[e.renderSlot(d.$slots,"default")],8,["to"])):e.createCommentVNode("",!0)}}),u=I;u.Tabs=b,u.Portal=$;function E(t){t.component("NLayout",u),t.component("NLayoutTabs",b),t.component("NLayoutPortal",$),t.use(f)}const j={install:E};r.NLayout=u,r.NLayoutPortal=$,r.NLayoutTabs=b,r.default=j,r.install=E,r.useTabFocus=T,Object.keys(f).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:()=>f[t]})}),Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));