@nubisco/ui 4.0.1 → 4.1.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/BarChart-Ce1FARbr.cjs +1 -0
- package/dist/BarChart-DTu-Md40.js +290 -0
- package/dist/{BlueprintControls-Bo8iODBv.js → BlueprintControls-CJAKrQ6U.js} +1 -1
- package/dist/{BlueprintControls-BSFwzxjG.cjs → BlueprintControls-aF11uokn.cjs} +1 -1
- package/dist/{Button-C6VXnkFB.js → Button-Cegx6vaT.js} +16 -17
- package/dist/Button-Dqtcr4i0.cjs +1 -0
- package/dist/{Confirm-B2fEiMQw.cjs → Confirm-CW160zEF.cjs} +1 -1
- package/dist/{Confirm-BmI_VsqK.js → Confirm-pgn2HajX.js} +1 -1
- package/dist/{DataTable-DcQGGdbB.cjs → DataTable-BbiDmA1X.cjs} +1 -1
- package/dist/{DataTable-BRCaCVAA.js → DataTable-c0ltF6wT.js} +1 -1
- package/dist/{FileUploader-DsY6Agi1.js → FileUploader-BLwR6H3f.js} +1 -1
- package/dist/{FileUploader-Bn_iCgXm.cjs → FileUploader-Lzy4bFn7.cjs} +1 -1
- package/dist/{NotificationCenter-CiewkoQ-.cjs → NotificationCenter-CrCoVe8p.cjs} +1 -1
- package/dist/{NotificationCenter-CuwEhh08.js → NotificationCenter-CrwDwpt6.js} +1 -1
- package/dist/{Pagination-DDYLKW17.js → Pagination-B6a62qvI.js} +1 -1
- package/dist/{Pagination-P0P1-0ca.cjs → Pagination-CkBe9Naz.cjs} +1 -1
- package/dist/PieChart-D_POVa0d.cjs +1 -0
- package/dist/PieChart-Drnh7d1y.js +181 -0
- package/dist/SidebarLink-CngTvuB6.cjs +1 -0
- package/dist/{SidebarLink-BlQ50jgX.js → SidebarLink-y2If8dtl.js} +10 -11
- package/dist/SidebarMenuItem-DBINoxeA.js +170 -0
- package/dist/SidebarMenuItem-DoyuIs3w.cjs +1 -0
- package/dist/{Walkthrough-H1vr3r1p.cjs → Walkthrough-DHtLDsOk.cjs} +1 -1
- package/dist/{Walkthrough-CV6HLOnv.js → Walkthrough-l7HOZths.js} +1 -1
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +12 -12
- package/dist/components/BlueprintCard.vue.d.ts +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Button.vue.d.ts +1 -1
- package/dist/components/Button.vue.d.ts.map +1 -1
- package/dist/components/Charts/BarChart.cjs +1 -1
- package/dist/components/Charts/BarChart.d.ts +2 -0
- package/dist/components/Charts/BarChart.mjs +1 -1
- package/dist/components/Charts/BarChart.vue.d.ts +7 -2
- package/dist/components/Charts/BarChart.vue.d.ts.map +1 -1
- package/dist/components/Charts/PieChart.cjs +1 -1
- package/dist/components/Charts/PieChart.mjs +1 -1
- package/dist/components/Charts/PieChart.vue.d.ts +7 -2
- package/dist/components/Charts/PieChart.vue.d.ts.map +1 -1
- package/dist/components/Charts/shared/types.d.ts +39 -0
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/SidebarLink.cjs +1 -1
- package/dist/components/SidebarLink.mjs +1 -1
- package/dist/components/SidebarLink.vue.d.ts.map +1 -1
- package/dist/components/SidebarMenuItem.cjs +1 -1
- package/dist/components/SidebarMenuItem.mjs +1 -1
- package/dist/components/SidebarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +12 -12
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/BarChart.css +1 -1
- package/dist/styles/Button.css +1 -1
- package/dist/styles/PieChart.css +1 -1
- package/dist/styles/SidebarLink.css +1 -1
- package/dist/styles/SidebarMenuItem.css +1 -1
- package/dist/ui.css +5 -5
- package/package.json +2 -1
- package/dist/BarChart-B3WKey-r.cjs +0 -1
- package/dist/BarChart-DYgJdP0G.js +0 -185
- package/dist/Button-6GNkKckU.cjs +0 -1
- package/dist/PieChart-Ddw9Ixu2.cjs +0 -1
- package/dist/PieChart-E0Q6WOuT.js +0 -157
- package/dist/SidebarLink-B857d6tr.cjs +0 -1
- package/dist/SidebarMenuItem-BUqF3qLa.js +0 -171
- package/dist/SidebarMenuItem-DRtFtvJK.cjs +0 -1
package/dist/Button-6GNkKckU.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Size.d-GBIblj2D.cjs`),n=require(`./Icon-C8R_r_In.cjs`),r=require(`./composables/useRouterLink.composable.cjs`);let i=require(`vue`);var a=function(e){return e.Button=`button`,e.Submit=`submit`,e.Reset=`reset`,e}(a||{}),o={key:0,class:`nb-button__decorations`},s={key:0,class:`nb-button__spinner`,"aria-hidden":`true`},c=(0,i.defineComponent)({__name:`Button`,props:{variant:{default:void 0},outlined:{type:Boolean,default:!1},size:{default:t.t.Medium},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},icon:{default:void 0},type:{default:a.Button},href:{default:void 0},target:{default:void 0},rel:{default:void 0},to:{default:void 0}},emits:[`click`],setup(e){let t=e,a=(0,i.useSlots)(),c=(0,i.computed)(()=>!a.default&&!!(t.icon||t.loading)),l=r.useRouterLink(),u=(0,i.computed)(()=>t.to!=null&&!!l.value),d=(0,i.computed)(()=>{if(typeof t.to==`string`)return t.to;if(t.href)return t.href}),f=(0,i.computed)(()=>u.value?l.value:d.value?`a`:`button`),p={xxs:10,xs:12,sm:12,md:14,lg:16,xl:16,xxl:20},m=(0,i.computed)(()=>p[t.size??`md`]??14);return(t,r)=>((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(f.value),{class:(0,i.normalizeClass)([`nb-button`,`nb-button--${e.variant}`,`nb-button--${e.size}`,{"nb-button--outlined":e.outlined},{"nb-button--loading":e.loading},{"nb-button--icon-only":c.value}]),to:u.value?e.to:void 0,href:f.value===`a`?d.value:void 0,target:f.value===`a`?e.target:void 0,rel:f.value===`a`?e.rel:void 0,disabled:f.value===`button`?e.disabled||e.loading:void 0,"aria-disabled":f.value!==`button`&&(e.disabled||e.loading)?!0:void 0,type:f.value===`button`?e.type:void 0,onClick:r[0]||=n=>e.disabled||e.loading?void 0:t.$emit(`click`,n)},{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(t.$slots,`default`,{},void 0,!0),e.loading||e.icon?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,o,[e.loading?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,s)):e.icon?((0,i.openBlock)(),(0,i.createBlock)(n.t,{key:1,name:e.icon,size:m.value,class:`nb-button__icon`},null,8,[`name`,`size`])):(0,i.createCommentVNode)(``,!0)])):(0,i.createCommentVNode)(``,!0)]),_:3},8,[`class`,`to`,`href`,`target`,`rel`,`disabled`,`aria-disabled`,`type`]))}}),l=e.t(c,[[`__scopeId`,`data-v-9cc29817`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-73dy8s3C.cjs`),n=require(`./ChartLegend-CkL6V-U_.cjs`),r=require(`./useChartSize-xKPzLmex.cjs`);let i=require(`vue`);var a=[`width`,`height`,`aria-label`],o=[`transform`],s=[`d`,`fill`,`onMouseenter`],c=[`x`,`y`],l=(0,i.defineComponent)({__name:`PieChart`,props:{data:{default:()=>[]},innerRadius:{default:0},labels:{default:`percent`},title:{default:void 0},subtitle:{default:void 0},height:{default:280},showLegend:{type:Boolean,default:!0},showTooltip:{type:Boolean,default:!0},colors:{default:()=>t.n}},setup(e){let l=e,u=(0,i.ref)(null),d=r.t(u,{width:280,height:240}),f=(0,i.computed)(()=>l.data.map((e,n)=>({label:e.label,value:e.value,color:e.color??t.i(n,l.colors)}))),p=(0,i.computed)(()=>f.value.reduce((e,t)=>e+Math.max(0,t.value),0)),m=(0,i.computed)(()=>d.value.width/2),h=(0,i.computed)(()=>d.value.height/2),g=(0,i.computed)(()=>Math.max(0,Math.min(d.value.width,d.value.height)/2-8)),_=(0,i.computed)(()=>Math.max(0,Math.min(.95,l.innerRadius))*g.value),v=(0,i.computed)(()=>{if(!p.value)return[];let e=-Math.PI/2,t=[];for(let n=0;n<f.value.length;n++){let r=f.value[n],i=Math.max(0,r.value)/p.value,a=e,o=e+i*Math.PI*2;e=o;let s=y(a,o,_.value,g.value),c=(a+o)/2,u=_.value>0?(_.value+g.value)/2:g.value*.65,d=Math.cos(c)*u,m=Math.sin(c)*u,h=l.labels===`percent`?`${Math.round(i*100)}%`:l.labels===`value`?String(r.value):``;t.push({path:s,color:r.color,labelX:d,labelY:m,labelText:h,labelColor:`var(--nb-c-white)`,startAngle:a,endAngle:o,value:r.value,label:r.label})}return t}),y=(e,t,n,r)=>{if(Math.abs(t-e)>=Math.PI*2-1e-6){let e=`M ${r} 0 A ${r} ${r} 0 1 1 ${-r} 0 A ${r} ${r} 0 1 1 ${r} 0 Z`;return n<=0?e:`${e} ${`M ${n} 0 A ${n} ${n} 0 1 0 ${-n} 0 A ${n} ${n} 0 1 0 ${n} 0 Z`}`}let i=Math.cos(e)*r,a=Math.sin(e)*r,o=Math.cos(t)*r,s=Math.sin(t)*r,c=t-e>Math.PI?1:0;if(n<=0)return`M 0 0 L ${i} ${a} A ${r} ${r} 0 ${c} 1 ${o} ${s} Z`;let l=Math.cos(t)*n,u=Math.sin(t)*n,d=Math.cos(e)*n,f=Math.sin(e)*n;return[`M ${i} ${a}`,`A ${r} ${r} 0 ${c} 1 ${o} ${s}`,`L ${l} ${u}`,`A ${n} ${n} 0 ${c} 0 ${d} ${f}`,`Z`].join(` `)},b=(0,i.ref)(null),x=(0,i.ref)({x:0,y:0}),S=e=>{let t=e.currentTarget.ownerSVGElement;if(!t)return;let n=t.getBoundingClientRect();x.value={x:e.clientX-n.left+12,y:e.clientY-n.top+12}},C=(0,i.computed)(()=>{if(b.value===null)return[];let e=v.value[b.value];if(!e)return[];let t=p.value?Math.round(e.value/p.value*100):0;return[{label:e.label,value:`${e.value} (${t}%)`,color:e.color}]});return(r,l)=>((0,i.openBlock)(),(0,i.createBlock)(t.u,{title:e.title,subtitle:e.subtitle,height:e.height,"show-legend":e.showLegend&&f.value.length>0},{legend:(0,i.withCtx)(()=>[(0,i.createVNode)(n.t,{items:f.value.map(e=>({label:e.label,color:e.color}))},null,8,[`items`])]),default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`div`,{ref_key:`root`,ref:u,class:`nb-pie-chart`},[((0,i.openBlock)(),(0,i.createElementBlock)(`svg`,{width:(0,i.unref)(d).width,height:(0,i.unref)(d).height,class:`nb-chart__svg`,role:`img`,"aria-label":e.title||`Pie chart`,onMouseleave:l[1]||=e=>b.value=null},[(0,i.createElementVNode)(`g`,{transform:`translate(${m.value}, ${h.value})`},[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(v.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`path`,{key:`slice-${t}`,class:(0,i.normalizeClass)([`nb-chart__slice`,{"is-dim":b.value!==null&&b.value!==t}]),d:e.path,fill:e.color,onMouseenter:e=>b.value=t,onMousemove:l[0]||=e=>S(e)},null,42,s))),128)),e.labels===`none`?(0,i.createCommentVNode)(``,!0):((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,{key:0},(0,i.renderList)(v.value,(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(`text`,{key:`lab-${t}`,class:`nb-chart__slice-label`,x:e.labelX,y:e.labelY,"text-anchor":`middle`,"dominant-baseline":`middle`,style:(0,i.normalizeStyle)({fill:e.labelColor})},(0,i.toDisplayString)(e.labelText),13,c))),128))],8,o)],40,a)),(0,i.createVNode)(t.l,{visible:e.showTooltip&&b.value!==null,x:x.value.x,y:x.value.y,rows:C.value},null,8,[`visible`,`x`,`y`,`rows`])],512)]),_:1},8,[`title`,`subtitle`,`height`,`show-legend`]))}}),u=e.t(l,[[`__scopeId`,`data-v-26bfcb67`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { i as t, l as n, n as r, u as i } from "./palette-DpTb1uUD.js";
|
|
3
|
-
import { t as a } from "./ChartLegend-DvjSe_3l.js";
|
|
4
|
-
import { t as o } from "./useChartSize-B6TdJSnI.js";
|
|
5
|
-
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, normalizeClass as h, normalizeStyle as g, openBlock as _, ref as v, renderList as y, toDisplayString as b, unref as x, withCtx as S } from "vue";
|
|
6
|
-
//#region src/components/Charts/PieChart.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var C = [
|
|
8
|
-
"width",
|
|
9
|
-
"height",
|
|
10
|
-
"aria-label"
|
|
11
|
-
], w = ["transform"], T = [
|
|
12
|
-
"d",
|
|
13
|
-
"fill",
|
|
14
|
-
"onMouseenter"
|
|
15
|
-
], E = ["x", "y"], D = /* @__PURE__ */ e(/* @__PURE__ */ m({
|
|
16
|
-
__name: "PieChart",
|
|
17
|
-
props: {
|
|
18
|
-
data: { default: () => [] },
|
|
19
|
-
innerRadius: { default: 0 },
|
|
20
|
-
labels: { default: "percent" },
|
|
21
|
-
title: { default: void 0 },
|
|
22
|
-
subtitle: { default: void 0 },
|
|
23
|
-
height: { default: 280 },
|
|
24
|
-
showLegend: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: !0
|
|
27
|
-
},
|
|
28
|
-
showTooltip: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: !0
|
|
31
|
-
},
|
|
32
|
-
colors: { default: () => r }
|
|
33
|
-
},
|
|
34
|
-
setup(e) {
|
|
35
|
-
let r = e, m = v(null), D = o(m, {
|
|
36
|
-
width: 280,
|
|
37
|
-
height: 240
|
|
38
|
-
}), O = c(() => r.data.map((e, n) => ({
|
|
39
|
-
label: e.label,
|
|
40
|
-
value: e.value,
|
|
41
|
-
color: e.color ?? t(n, r.colors)
|
|
42
|
-
}))), k = c(() => O.value.reduce((e, t) => e + Math.max(0, t.value), 0)), A = c(() => D.value.width / 2), j = c(() => D.value.height / 2), M = c(() => Math.max(0, Math.min(D.value.width, D.value.height) / 2 - 8)), N = c(() => Math.max(0, Math.min(.95, r.innerRadius)) * M.value), P = c(() => {
|
|
43
|
-
if (!k.value) return [];
|
|
44
|
-
let e = -Math.PI / 2, t = [];
|
|
45
|
-
for (let n = 0; n < O.value.length; n++) {
|
|
46
|
-
let i = O.value[n], a = Math.max(0, i.value) / k.value, o = e, s = e + a * Math.PI * 2;
|
|
47
|
-
e = s;
|
|
48
|
-
let c = F(o, s, N.value, M.value), l = (o + s) / 2, u = N.value > 0 ? (N.value + M.value) / 2 : M.value * .65, d = Math.cos(l) * u, f = Math.sin(l) * u, p = r.labels === "percent" ? `${Math.round(a * 100)}%` : r.labels === "value" ? String(i.value) : "";
|
|
49
|
-
t.push({
|
|
50
|
-
path: c,
|
|
51
|
-
color: i.color,
|
|
52
|
-
labelX: d,
|
|
53
|
-
labelY: f,
|
|
54
|
-
labelText: p,
|
|
55
|
-
labelColor: "var(--nb-c-white)",
|
|
56
|
-
startAngle: o,
|
|
57
|
-
endAngle: s,
|
|
58
|
-
value: i.value,
|
|
59
|
-
label: i.label
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return t;
|
|
63
|
-
}), F = (e, t, n, r) => {
|
|
64
|
-
if (Math.abs(t - e) >= Math.PI * 2 - 1e-6) {
|
|
65
|
-
let e = `M ${r} 0 A ${r} ${r} 0 1 1 ${-r} 0 A ${r} ${r} 0 1 1 ${r} 0 Z`;
|
|
66
|
-
return n <= 0 ? e : `${e} ${`M ${n} 0 A ${n} ${n} 0 1 0 ${-n} 0 A ${n} ${n} 0 1 0 ${n} 0 Z`}`;
|
|
67
|
-
}
|
|
68
|
-
let i = Math.cos(e) * r, a = Math.sin(e) * r, o = Math.cos(t) * r, s = Math.sin(t) * r, c = t - e > Math.PI ? 1 : 0;
|
|
69
|
-
if (n <= 0) return `M 0 0 L ${i} ${a} A ${r} ${r} 0 ${c} 1 ${o} ${s} Z`;
|
|
70
|
-
let l = Math.cos(t) * n, u = Math.sin(t) * n, d = Math.cos(e) * n, f = Math.sin(e) * n;
|
|
71
|
-
return [
|
|
72
|
-
`M ${i} ${a}`,
|
|
73
|
-
`A ${r} ${r} 0 ${c} 1 ${o} ${s}`,
|
|
74
|
-
`L ${l} ${u}`,
|
|
75
|
-
`A ${n} ${n} 0 ${c} 0 ${d} ${f}`,
|
|
76
|
-
"Z"
|
|
77
|
-
].join(" ");
|
|
78
|
-
}, I = v(null), L = v({
|
|
79
|
-
x: 0,
|
|
80
|
-
y: 0
|
|
81
|
-
}), R = (e) => {
|
|
82
|
-
let t = e.currentTarget.ownerSVGElement;
|
|
83
|
-
if (!t) return;
|
|
84
|
-
let n = t.getBoundingClientRect();
|
|
85
|
-
L.value = {
|
|
86
|
-
x: e.clientX - n.left + 12,
|
|
87
|
-
y: e.clientY - n.top + 12
|
|
88
|
-
};
|
|
89
|
-
}, z = c(() => {
|
|
90
|
-
if (I.value === null) return [];
|
|
91
|
-
let e = P.value[I.value];
|
|
92
|
-
if (!e) return [];
|
|
93
|
-
let t = k.value ? Math.round(e.value / k.value * 100) : 0;
|
|
94
|
-
return [{
|
|
95
|
-
label: e.label,
|
|
96
|
-
value: `${e.value} (${t}%)`,
|
|
97
|
-
color: e.color
|
|
98
|
-
}];
|
|
99
|
-
});
|
|
100
|
-
return (t, r) => (_(), l(i, {
|
|
101
|
-
title: e.title,
|
|
102
|
-
subtitle: e.subtitle,
|
|
103
|
-
height: e.height,
|
|
104
|
-
"show-legend": e.showLegend && O.value.length > 0
|
|
105
|
-
}, {
|
|
106
|
-
legend: S(() => [p(a, { items: O.value.map((e) => ({
|
|
107
|
-
label: e.label,
|
|
108
|
-
color: e.color
|
|
109
|
-
})) }, null, 8, ["items"])]),
|
|
110
|
-
default: S(() => [f("div", {
|
|
111
|
-
ref_key: "root",
|
|
112
|
-
ref: m,
|
|
113
|
-
class: "nb-pie-chart"
|
|
114
|
-
}, [(_(), d("svg", {
|
|
115
|
-
width: x(D).width,
|
|
116
|
-
height: x(D).height,
|
|
117
|
-
class: "nb-chart__svg",
|
|
118
|
-
role: "img",
|
|
119
|
-
"aria-label": e.title || "Pie chart",
|
|
120
|
-
onMouseleave: r[1] ||= (e) => I.value = null
|
|
121
|
-
}, [f("g", { transform: `translate(${A.value}, ${j.value})` }, [(_(!0), d(s, null, y(P.value, (e, t) => (_(), d("path", {
|
|
122
|
-
key: `slice-${t}`,
|
|
123
|
-
class: h(["nb-chart__slice", { "is-dim": I.value !== null && I.value !== t }]),
|
|
124
|
-
d: e.path,
|
|
125
|
-
fill: e.color,
|
|
126
|
-
onMouseenter: (e) => I.value = t,
|
|
127
|
-
onMousemove: r[0] ||= (e) => R(e)
|
|
128
|
-
}, null, 42, T))), 128)), e.labels === "none" ? u("", !0) : (_(!0), d(s, { key: 0 }, y(P.value, (e, t) => (_(), d("text", {
|
|
129
|
-
key: `lab-${t}`,
|
|
130
|
-
class: "nb-chart__slice-label",
|
|
131
|
-
x: e.labelX,
|
|
132
|
-
y: e.labelY,
|
|
133
|
-
"text-anchor": "middle",
|
|
134
|
-
"dominant-baseline": "middle",
|
|
135
|
-
style: g({ fill: e.labelColor })
|
|
136
|
-
}, b(e.labelText), 13, E))), 128))], 8, w)], 40, C)), p(n, {
|
|
137
|
-
visible: e.showTooltip && I.value !== null,
|
|
138
|
-
x: L.value.x,
|
|
139
|
-
y: L.value.y,
|
|
140
|
-
rows: z.value
|
|
141
|
-
}, null, 8, [
|
|
142
|
-
"visible",
|
|
143
|
-
"x",
|
|
144
|
-
"y",
|
|
145
|
-
"rows"
|
|
146
|
-
])], 512)]),
|
|
147
|
-
_: 1
|
|
148
|
-
}, 8, [
|
|
149
|
-
"title",
|
|
150
|
-
"subtitle",
|
|
151
|
-
"height",
|
|
152
|
-
"show-legend"
|
|
153
|
-
]));
|
|
154
|
-
}
|
|
155
|
-
}), [["__scopeId", "data-v-26bfcb67"]]);
|
|
156
|
-
//#endregion
|
|
157
|
-
export { D as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./composables/useRouterLink.composable.cjs`);let n=require(`vue`);var r=(0,n.defineComponent)({__name:`SidebarLink`,props:{to:{default:void 0},href:{default:void 0},tooltip:{default:void 0},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1}},emits:[`click`],setup(e){let r=e,i=t.useRouterLink(),a=(0,n.computed)(()=>r.to!=null&&!!i.value),o=(0,n.computed)(()=>{if(typeof r.to==`string`)return r.to;if(r.href)return r.href}),s=(0,n.computed)(()=>a.value?i.value:o.value?`a`:`button`);return(t,r)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(s.value),{class:(0,n.normalizeClass)([`nb-sidebar-link`,{"nb-sidebar-link--active":e.active,"nb-sidebar-link--danger":e.danger,"nb-sidebar-link--disabled":e.disabled}]),to:a.value?e.to:void 0,href:s.value===`a`?o.value:void 0,disabled:s.value===`button`&&e.disabled||void 0,"aria-disabled":s.value!==`button`&&e.disabled?!0:void 0,"data-tooltip":e.tooltip||void 0,onClick:r[0]||=n=>e.disabled?void 0:t.$emit(`click`,n)},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`default`,{},void 0,!0)]),_:3},8,[`class`,`to`,`href`,`disabled`,`aria-disabled`,`data-tooltip`]))}}),i=e.t(r,[[`__scopeId`,`data-v-584769b4`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { t } from "./Icon-rREAqsu0.js";
|
|
3
|
-
import { useRouterLink as n } from "./composables/useRouterLink.composable.mjs";
|
|
4
|
-
import { hasRenderableContent as r } from "./utils/slotContent.helper.mjs";
|
|
5
|
-
import { Fragment as i, Teleport as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, defineComponent as d, inject as f, normalizeClass as p, normalizeStyle as m, openBlock as h, provide as g, ref as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, toRef as x, unref as S, useSlots as C, vShow as w, withCtx as T, withDirectives as E } from "vue";
|
|
6
|
-
import { regular as D } from "@nubisco/ui/icons/caret-right";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/components/SidebarVariantScope.vue
|
|
9
|
-
var O = /* @__PURE__ */ d({
|
|
10
|
-
__name: "SidebarVariantScope",
|
|
11
|
-
props: { variant: {} },
|
|
12
|
-
setup(e) {
|
|
13
|
-
return g("nb-shell-sidebar-variant", x(e, "variant")), (e, t) => v(e.$slots, "default");
|
|
14
|
-
}
|
|
15
|
-
}), k = { class: "nb-sidebar-menu-item__label" }, A = ["title"], j = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "nb-sidebar-menu-item__children",
|
|
18
|
-
role: "group"
|
|
19
|
-
}, M = { class: "nb-sidebar-menu-item__flyout-header" }, N = { class: "nb-sidebar-menu-item__flyout-label" }, P = { class: "nb-sidebar-menu-item__flyout-children" }, F = /* @__PURE__ */ e(/* @__PURE__ */ d({
|
|
20
|
-
__name: "SidebarMenuItem",
|
|
21
|
-
props: {
|
|
22
|
-
label: {},
|
|
23
|
-
icon: { default: void 0 },
|
|
24
|
-
to: { default: void 0 },
|
|
25
|
-
href: { default: void 0 },
|
|
26
|
-
active: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
default: !1
|
|
29
|
-
},
|
|
30
|
-
disabled: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
34
|
-
defaultExpanded: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: !1
|
|
37
|
-
},
|
|
38
|
-
badge: { default: void 0 },
|
|
39
|
-
badgeVariant: { default: "neutral" }
|
|
40
|
-
},
|
|
41
|
-
emits: ["click"],
|
|
42
|
-
setup(e, { emit: d }) {
|
|
43
|
-
let g = e, x = d, F = f("nb-shell-sidebar-variant", _("verbose")), I = o(() => F.value), L = C(), R = o(() => {
|
|
44
|
-
let e = L.default?.();
|
|
45
|
-
return e ? r(e) : !1;
|
|
46
|
-
}), z = _(g.defaultExpanded || g.active), B = n(), V = o(() => {
|
|
47
|
-
if (typeof g.to == "string") return g.to;
|
|
48
|
-
if (g.href) return g.href;
|
|
49
|
-
}), H = o(() => R.value), U = o(() => g.to != null && !H.value && !!B.value), W = o(() => H.value ? "button" : U.value ? B.value : V.value ? "a" : "button");
|
|
50
|
-
function G(e) {
|
|
51
|
-
if (g.disabled) {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (H.value && I.value === "verbose") {
|
|
56
|
-
z.value = !z.value;
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
x("click", e);
|
|
60
|
-
}
|
|
61
|
-
let K = _(null), q = _(!1), J = _({}), Y = null;
|
|
62
|
-
function X() {
|
|
63
|
-
if (I.value !== "compact") return;
|
|
64
|
-
Y &&= (clearTimeout(Y), null);
|
|
65
|
-
let e = K.value;
|
|
66
|
-
if (!e) return;
|
|
67
|
-
let t = e.getBoundingClientRect();
|
|
68
|
-
J.value = {
|
|
69
|
-
top: `${t.top}px`,
|
|
70
|
-
left: `${t.right + 8}px`
|
|
71
|
-
}, q.value = !0;
|
|
72
|
-
}
|
|
73
|
-
function Z() {
|
|
74
|
-
Y && clearTimeout(Y), Y = setTimeout(() => {
|
|
75
|
-
q.value = !1, Y = null;
|
|
76
|
-
}, 120);
|
|
77
|
-
}
|
|
78
|
-
function Q() {
|
|
79
|
-
X();
|
|
80
|
-
}
|
|
81
|
-
function $() {
|
|
82
|
-
Z();
|
|
83
|
-
}
|
|
84
|
-
function ee() {
|
|
85
|
-
Y &&= (clearTimeout(Y), null);
|
|
86
|
-
}
|
|
87
|
-
function te() {
|
|
88
|
-
Z();
|
|
89
|
-
}
|
|
90
|
-
return (n, r) => (h(), l("li", {
|
|
91
|
-
class: p(["nb-sidebar-menu-item", [`nb-sidebar-menu-item--${I.value}`]]),
|
|
92
|
-
role: "none",
|
|
93
|
-
onMouseenter: Q,
|
|
94
|
-
onMouseleave: $
|
|
95
|
-
}, [
|
|
96
|
-
(h(), s(y(W.value), {
|
|
97
|
-
ref_key: "rowRef",
|
|
98
|
-
ref: K,
|
|
99
|
-
class: p(["nb-sidebar-menu-item__row", {
|
|
100
|
-
"nb-sidebar-menu-item__row--active": e.active,
|
|
101
|
-
"nb-sidebar-menu-item__row--disabled": e.disabled,
|
|
102
|
-
"nb-sidebar-menu-item__row--expandable": R.value && I.value === "verbose",
|
|
103
|
-
"nb-sidebar-menu-item__row--compact": I.value === "compact"
|
|
104
|
-
}]),
|
|
105
|
-
type: W.value === "button" ? "button" : void 0,
|
|
106
|
-
to: U.value ? e.to : void 0,
|
|
107
|
-
href: W.value === "a" ? V.value : void 0,
|
|
108
|
-
disabled: W.value === "button" && !R.value && e.disabled || void 0,
|
|
109
|
-
"aria-disabled": e.disabled || void 0,
|
|
110
|
-
"aria-expanded": R.value && I.value === "verbose" ? z.value : void 0,
|
|
111
|
-
"aria-label": I.value === "compact" ? e.label : void 0,
|
|
112
|
-
role: "menuitem",
|
|
113
|
-
onClick: G
|
|
114
|
-
}, {
|
|
115
|
-
default: T(() => [e.icon ? (h(), s(t, {
|
|
116
|
-
key: 0,
|
|
117
|
-
class: "nb-sidebar-menu-item__icon",
|
|
118
|
-
name: e.icon,
|
|
119
|
-
size: I.value === "compact" ? 18 : 16
|
|
120
|
-
}, null, 8, ["name", "size"])) : c("", !0), I.value === "verbose" ? (h(), l(i, { key: 1 }, [
|
|
121
|
-
u("span", k, b(e.label), 1),
|
|
122
|
-
e.badge === void 0 ? c("", !0) : (h(), l("span", {
|
|
123
|
-
key: 0,
|
|
124
|
-
class: p(["nb-sidebar-menu-item__badge", [`nb-sidebar-menu-item__badge--${e.badgeVariant}`]])
|
|
125
|
-
}, b(e.badge), 3)),
|
|
126
|
-
R.value ? (h(), s(t, {
|
|
127
|
-
key: 1,
|
|
128
|
-
class: p(["nb-sidebar-menu-item__caret", { "nb-sidebar-menu-item__caret--expanded": z.value }]),
|
|
129
|
-
name: S(D),
|
|
130
|
-
size: 12
|
|
131
|
-
}, null, 8, ["class", "name"])) : c("", !0)
|
|
132
|
-
], 64)) : e.badge === void 0 ? c("", !0) : (h(), l("span", {
|
|
133
|
-
key: 2,
|
|
134
|
-
class: p(["nb-sidebar-menu-item__badge-dot", [`nb-sidebar-menu-item__badge-dot--${e.badgeVariant}`]]),
|
|
135
|
-
title: String(e.badge)
|
|
136
|
-
}, null, 10, A))]),
|
|
137
|
-
_: 1
|
|
138
|
-
}, 8, [
|
|
139
|
-
"class",
|
|
140
|
-
"type",
|
|
141
|
-
"to",
|
|
142
|
-
"href",
|
|
143
|
-
"disabled",
|
|
144
|
-
"aria-disabled",
|
|
145
|
-
"aria-expanded",
|
|
146
|
-
"aria-label"
|
|
147
|
-
])),
|
|
148
|
-
R.value && I.value === "verbose" ? E((h(), l("ul", j, [v(n.$slots, "default", {}, void 0, !0)], 512)), [[w, z.value]]) : c("", !0),
|
|
149
|
-
I.value === "compact" && q.value ? (h(), s(a, {
|
|
150
|
-
key: 1,
|
|
151
|
-
to: "body"
|
|
152
|
-
}, [u("div", {
|
|
153
|
-
class: "nb-sidebar-menu-item__flyout",
|
|
154
|
-
style: m(J.value),
|
|
155
|
-
onMouseenter: ee,
|
|
156
|
-
onMouseleave: te
|
|
157
|
-
}, [u("div", M, [u("span", N, b(e.label), 1), e.badge === void 0 ? c("", !0) : (h(), l("span", {
|
|
158
|
-
key: 0,
|
|
159
|
-
class: p(["nb-sidebar-menu-item__badge", [`nb-sidebar-menu-item__badge--${e.badgeVariant}`]])
|
|
160
|
-
}, b(e.badge), 3))]), R.value ? (h(), s(O, {
|
|
161
|
-
key: 0,
|
|
162
|
-
variant: "verbose"
|
|
163
|
-
}, {
|
|
164
|
-
default: T(() => [u("ul", P, [v(n.$slots, "default", {}, void 0, !0)])]),
|
|
165
|
-
_: 3
|
|
166
|
-
})) : c("", !0)], 36)])) : c("", !0)
|
|
167
|
-
], 34));
|
|
168
|
-
}
|
|
169
|
-
}), [["__scopeId", "data-v-153976d1"]]);
|
|
170
|
-
//#endregion
|
|
171
|
-
export { F as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Icon-C8R_r_In.cjs`),n=require(`./composables/useRouterLink.composable.cjs`),r=require(`./utils/slotContent.helper.cjs`);let i=require(`vue`),a=require(`@nubisco/ui/icons/caret-right`);var o=(0,i.defineComponent)({__name:`SidebarVariantScope`,props:{variant:{}},setup(e){return(0,i.provide)(`nb-shell-sidebar-variant`,(0,i.toRef)(e,`variant`)),(e,t)=>(0,i.renderSlot)(e.$slots,`default`)}}),s={class:`nb-sidebar-menu-item__label`},c=[`title`],l={key:0,class:`nb-sidebar-menu-item__children`,role:`group`},u={class:`nb-sidebar-menu-item__flyout-header`},d={class:`nb-sidebar-menu-item__flyout-label`},f={class:`nb-sidebar-menu-item__flyout-children`},p=(0,i.defineComponent)({__name:`SidebarMenuItem`,props:{label:{},icon:{default:void 0},to:{default:void 0},href:{default:void 0},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},defaultExpanded:{type:Boolean,default:!1},badge:{default:void 0},badgeVariant:{default:`neutral`}},emits:[`click`],setup(e,{emit:p}){let m=e,h=p,g=(0,i.inject)(`nb-shell-sidebar-variant`,(0,i.ref)(`verbose`)),_=(0,i.computed)(()=>g.value),v=(0,i.useSlots)(),y=(0,i.computed)(()=>{let e=v.default?.();return e?r.hasRenderableContent(e):!1}),b=(0,i.ref)(m.defaultExpanded||m.active),x=n.useRouterLink(),S=(0,i.computed)(()=>{if(typeof m.to==`string`)return m.to;if(m.href)return m.href}),C=(0,i.computed)(()=>y.value),w=(0,i.computed)(()=>m.to!=null&&!C.value&&!!x.value),T=(0,i.computed)(()=>C.value?`button`:w.value?x.value:S.value?`a`:`button`);function E(e){if(m.disabled){e.preventDefault();return}if(C.value&&_.value===`verbose`){b.value=!b.value;return}h(`click`,e)}let D=(0,i.ref)(null),O=(0,i.ref)(!1),k=(0,i.ref)({}),A=null;function j(){if(_.value!==`compact`)return;A&&=(clearTimeout(A),null);let e=D.value;if(!e)return;let t=e.getBoundingClientRect();k.value={top:`${t.top}px`,left:`${t.right+8}px`},O.value=!0}function M(){A&&clearTimeout(A),A=setTimeout(()=>{O.value=!1,A=null},120)}function N(){j()}function P(){M()}function F(){A&&=(clearTimeout(A),null)}function I(){M()}return(n,r)=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{class:(0,i.normalizeClass)([`nb-sidebar-menu-item`,[`nb-sidebar-menu-item--${_.value}`]]),role:`none`,onMouseenter:N,onMouseleave:P},[((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(T.value),{ref_key:`rowRef`,ref:D,class:(0,i.normalizeClass)([`nb-sidebar-menu-item__row`,{"nb-sidebar-menu-item__row--active":e.active,"nb-sidebar-menu-item__row--disabled":e.disabled,"nb-sidebar-menu-item__row--expandable":y.value&&_.value===`verbose`,"nb-sidebar-menu-item__row--compact":_.value===`compact`}]),type:T.value===`button`?`button`:void 0,to:w.value?e.to:void 0,href:T.value===`a`?S.value:void 0,disabled:T.value===`button`&&!y.value&&e.disabled||void 0,"aria-disabled":e.disabled||void 0,"aria-expanded":y.value&&_.value===`verbose`?b.value:void 0,"aria-label":_.value===`compact`?e.label:void 0,role:`menuitem`,onClick:E},{default:(0,i.withCtx)(()=>[e.icon?((0,i.openBlock)(),(0,i.createBlock)(t.t,{key:0,class:`nb-sidebar-menu-item__icon`,name:e.icon,size:_.value===`compact`?18:16},null,8,[`name`,`size`])):(0,i.createCommentVNode)(``,!0),_.value===`verbose`?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createElementVNode)(`span`,s,(0,i.toDisplayString)(e.label),1),e.badge===void 0?(0,i.createCommentVNode)(``,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:0,class:(0,i.normalizeClass)([`nb-sidebar-menu-item__badge`,[`nb-sidebar-menu-item__badge--${e.badgeVariant}`]])},(0,i.toDisplayString)(e.badge),3)),y.value?((0,i.openBlock)(),(0,i.createBlock)(t.t,{key:1,class:(0,i.normalizeClass)([`nb-sidebar-menu-item__caret`,{"nb-sidebar-menu-item__caret--expanded":b.value}]),name:(0,i.unref)(a.regular),size:12},null,8,[`class`,`name`])):(0,i.createCommentVNode)(``,!0)],64)):e.badge===void 0?(0,i.createCommentVNode)(``,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:2,class:(0,i.normalizeClass)([`nb-sidebar-menu-item__badge-dot`,[`nb-sidebar-menu-item__badge-dot--${e.badgeVariant}`]]),title:String(e.badge)},null,10,c))]),_:1},8,[`class`,`type`,`to`,`href`,`disabled`,`aria-disabled`,`aria-expanded`,`aria-label`])),y.value&&_.value===`verbose`?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,l,[(0,i.renderSlot)(n.$slots,`default`,{},void 0,!0)],512)),[[i.vShow,b.value]]):(0,i.createCommentVNode)(``,!0),_.value===`compact`&&O.value?((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{key:1,to:`body`},[(0,i.createElementVNode)(`div`,{class:`nb-sidebar-menu-item__flyout`,style:(0,i.normalizeStyle)(k.value),onMouseenter:F,onMouseleave:I},[(0,i.createElementVNode)(`div`,u,[(0,i.createElementVNode)(`span`,d,(0,i.toDisplayString)(e.label),1),e.badge===void 0?(0,i.createCommentVNode)(``,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`span`,{key:0,class:(0,i.normalizeClass)([`nb-sidebar-menu-item__badge`,[`nb-sidebar-menu-item__badge--${e.badgeVariant}`]])},(0,i.toDisplayString)(e.badge),3))]),y.value?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,variant:`verbose`},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`ul`,f,[(0,i.renderSlot)(n.$slots,`default`,{},void 0,!0)])]),_:3})):(0,i.createCommentVNode)(``,!0)],36)])):(0,i.createCommentVNode)(``,!0)],34))}}),m=e.t(p,[[`__scopeId`,`data-v-153976d1`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return m}});
|