@shtabapp/ui-kit 1.30.0 → 1.32.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/CHANGELOG.md +12 -0
- package/dist/{SChartHorizontalBar-CCn6L_Du.js → SChartHorizontalBar-DIn1sVoi.js} +1 -1
- package/dist/{SChartHorizontalBar-CLXp8bvq.cjs → SChartHorizontalBar-tfgmCHtk.cjs} +1 -1
- package/dist/{SChartLegend-CLTLJeRH.cjs → SChartLegend-BFwzIA4x.cjs} +1 -1
- package/dist/{SChartLegend-CcbzWNuw.js → SChartLegend-DW16AfUz.js} +1 -1
- package/dist/{SChartLine-BaOJ7lmv.js → SChartLine-G5CeC01A.js} +1 -1
- package/dist/{SChartLine-C_16iDsx.cjs → SChartLine-xql-HCwK.cjs} +1 -1
- package/dist/{SChartPie-qCJdztmc.js → SChartPie-_6ij1EVn.js} +18 -18
- package/dist/{SChartPie-BdKc6EbI.cjs → SChartPie-xu1fcWMy.cjs} +1 -1
- package/dist/SChartProgress-C08fiO6U.cjs +1 -0
- package/dist/SChartProgress-CofVafO6.js +207 -0
- package/dist/{SChartSkeletonHost-BnYGg6WN.js → SChartSkeletonHost-CnfMevXX.js} +86 -67
- package/dist/SChartSkeletonHost-YmLC5zOX.cjs +1 -0
- package/dist/{SChartStackedArea-ByOgW4Mi.cjs → SChartStackedArea-BUy47veO.cjs} +1 -1
- package/dist/{SChartStackedArea-B-E5tLfo.js → SChartStackedArea-RKK7aT7x.js} +20 -20
- package/dist/{SChartStackedBar-CbOLEjHH.cjs → SChartStackedBar-1HNyHP8J.cjs} +1 -1
- package/dist/{SChartStackedBar-DmtysTnY.js → SChartStackedBar-CJunMhyb.js} +23 -23
- package/dist/SSelect-CgL7ECfS.cjs +1 -0
- package/dist/{SSelect-MzZwivEY.js → SSelect-iBb45tet.js} +254 -220
- package/dist/{buildChartSeriesPoints-Cj8ooXn5.js → buildChartSeriesPoints-D-j16fMh.js} +1 -1
- package/dist/{buildChartSeriesPoints-DXgWMMZH.cjs → buildChartSeriesPoints-lASMQmBx.cjs} +1 -1
- package/dist/components/SChartProgress/SChartProgress.types.d.ts +15 -0
- package/dist/components/SChartProgress/SChartProgress.types.d.ts.map +1 -0
- package/dist/components/SChartProgress/SChartProgress.vue.d.ts +5 -0
- package/dist/components/SChartProgress/SChartProgress.vue.d.ts.map +1 -0
- package/dist/components/SChartProgress/index.d.ts +3 -0
- package/dist/components/SChartProgress/index.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/buildProgressChartConfig.d.ts +16 -0
- package/dist/components/SChartProgress/utils/buildProgressChartConfig.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/buildProgressChartData.d.ts +18 -0
- package/dist/components/SChartProgress/utils/buildProgressChartData.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/demoProgressSnapshots.d.ts +5 -0
- package/dist/components/SChartProgress/utils/demoProgressSnapshots.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/formatProgressChartDate.d.ts +2 -0
- package/dist/components/SChartProgress/utils/formatProgressChartDate.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/productionProgressSnapshots.d.ts +4 -0
- package/dist/components/SChartProgress/utils/productionProgressSnapshots.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/resolveProgressChartPointStyle.d.ts +10 -0
- package/dist/components/SChartProgress/utils/resolveProgressChartPointStyle.d.ts.map +1 -0
- package/dist/components/SChartProgress/utils/skeletonProgressSnapshots.d.ts +6 -0
- package/dist/components/SChartProgress/utils/skeletonProgressSnapshots.d.ts.map +1 -0
- package/dist/components/SDropdownMenu/SDropdownMenu.types.d.ts +12 -0
- package/dist/components/SDropdownMenu/SDropdownMenu.types.d.ts.map +1 -0
- package/dist/components/SDropdownMenu/SDropdownMenu.vue.d.ts +16 -0
- package/dist/components/SDropdownMenu/SDropdownMenu.vue.d.ts.map +1 -0
- package/dist/components/SDropdownMenu/index.d.ts +3 -0
- package/dist/components/SDropdownMenu/index.d.ts.map +1 -0
- package/dist/components/SSelect/SSelect.vue.d.ts.map +1 -1
- package/dist/entries/chart-horizontal-bar.cjs +1 -1
- package/dist/entries/chart-horizontal-bar.js +1 -1
- package/dist/entries/chart-line.cjs +1 -1
- package/dist/entries/chart-line.js +1 -1
- package/dist/entries/chart-pie.cjs +1 -1
- package/dist/entries/chart-pie.js +1 -1
- package/dist/entries/chart-progress.cjs +1 -0
- package/dist/entries/chart-progress.d.ts +3 -0
- package/dist/entries/chart-progress.d.ts.map +1 -0
- package/dist/entries/chart-progress.js +2 -0
- package/dist/entries/chart-stacked-area.cjs +1 -1
- package/dist/entries/chart-stacked-area.js +1 -1
- package/dist/entries/chart-stacked-bar.cjs +1 -1
- package/dist/entries/chart-stacked-bar.js +1 -1
- package/dist/entries/dropdown-menu.d.ts +3 -0
- package/dist/entries/dropdown-menu.d.ts.map +1 -0
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/separator.d.ts +3 -0
- package/dist/entries/separator.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -13
- package/dist/uikit-components.css +1 -1
- package/dist/utils/chart/chart.types.d.ts +4 -0
- package/dist/utils/chart/chart.types.d.ts.map +1 -1
- package/dist/utils/chart/chartJsAugmentation.d.ts +1 -0
- package/dist/utils/chart/chartJsAugmentation.d.ts.map +1 -1
- package/dist/utils/chart/core/chartCssVariables.d.ts +2 -0
- package/dist/utils/chart/core/chartCssVariables.d.ts.map +1 -1
- package/dist/utils/chart/core/chartSkeletonConfig.d.ts +2 -1
- package/dist/utils/chart/core/chartSkeletonConfig.d.ts.map +1 -1
- package/dist/utils/chart/core/registerChartJs.d.ts.map +1 -1
- package/dist/utils/chart/progress/createProgressChartTooltipPositioner.d.ts +4 -0
- package/dist/utils/chart/progress/createProgressChartTooltipPositioner.d.ts.map +1 -0
- package/package.json +18 -3
- package/dist/SChartSkeletonHost-CixHLD65.cjs +0 -1
- package/dist/SSelect-CTxBjl2J.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [@shtabapp/ui-kit-v1.32.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.31.0...@shtabapp/ui-kit@1.32.0) (2026-06-30)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- schartprogress ([4155ed0](https://gitlab.com/mstikharev/shtab-ui-kit/commit/4155ed08aecc4856eae301d0c238b8191fdbf50a))
|
|
6
|
+
|
|
7
|
+
## [@shtabapp/ui-kit-v1.31.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.30.0...@shtabapp/ui-kit@1.31.0) (2026-06-30)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- dropdown menu + change custom panel in select to dropdown menu + separator ([3efd9d7](https://gitlab.com/mstikharev/shtab-ui-kit/commit/3efd9d73911e39374657de9ee4e7d2d5bc95f4e3))
|
|
12
|
+
|
|
1
13
|
## [@shtabapp/ui-kit-v1.30.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.29.0...@shtabapp/ui-kit@1.30.0) (2026-06-29)
|
|
2
14
|
|
|
3
15
|
### Features
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t,
|
|
1
|
+
import { a as e, i as t, m as n, r, t as i, y as a } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
2
|
import { computed as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, unref as p, useTemplateRef as m, withCtx as h } from "vue";
|
|
3
3
|
//#region src/utils/chart/horizontalBar/buildHorizontalBarChartScales.ts
|
|
4
4
|
var g = 10, _ = 14, v = ({ axisLabelColor: e, categoryLabelColor: t, gridColor: n, xMin: r, xMax: i, xStep: a }) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs");let t=require("vue");var n=10,r=14,i=({axisLabelColor:e,categoryLabelColor:t,gridColor:i,xMin:a,xMax:o,xStep:s})=>({x:{type:`linear`,min:a,max:o,border:{display:!1},grid:{color:i,drawTicks:!1},ticks:{color:e,stepSize:s,font:{size:n,weight:500},padding:8}},y:{border:{display:!1},grid:{display:!1},ticks:{color:t,font:{size:r,weight:400},padding:8,crossAlign:`far`,autoSkip:!1}}}),a=(t,n,r)=>r?e.y(e.m.barHorizontalSkeletonFill,n):t?e.y(t,n):e.y(e.m.barHorizontalFillDefault,n),o=(e,t,n)=>{if(t)return t;let r=0;for(let t of e)r=Math.max(r,t.value);let i=Math.ceil(r/n)*n;return i>0?i:n*6},s=10,c=0,l=36,u=4,d=({items:t,colorHostElement:n,xMax:r,xMin:d=c,xStep:f=s,skeleton:p=!1})=>{if(t.length===0)return null;let m=e.y(e.m.axisLabel,n),h=e.y(e.m.grid,n),g=e.y(e.m.tooltipBackground,n),_=e.y(e.m.tooltipText,n),v=e.y(p?e.m.barHorizontalCategoryLabelSkeleton:e.m.barHorizontalCategoryLabel,n),y=o(t,r,f),b=t.map(e=>a(e.color,n,p));return{type:`bar`,data:{labels:t.map(e=>e.label),datasets:[{data:t.map(e=>e.value),backgroundColor:b,hoverBackgroundColor:b,borderWidth:0,hoverBorderWidth:0,barThickness:l,borderRadius:{topRight:u,bottomRight:u}}]},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,interaction:e.i(p,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.a(p),backgroundColor:g,titleColor:_,bodyColor:_}},scales:i({axisLabelColor:m,categoryLabelColor:v,gridColor:h,xMin:d,xMax:y,xStep:f})}}},f=e=>d(e),p=[{label:`Открыта`,value:48},{label:`В процессе`,value:32},{label:`Ревью`,value:53},{label:`Готова для QA`,value:18},{label:`QA`,value:25},{label:`Готова`,value:0}],m={class:`s-ui-chart-horizontal-bar__canvas-wrap`},h=(0,t.defineComponent)({__name:`SChartHorizontalBar`,props:{items:{default:()=>[]},loading:{type:Boolean,default:!1},xMin:{},xMax:{},xStep:{}},setup(n){let r=(0,t.useTemplateRef)(`chartRootRef`),i=(0,t.useTemplateRef)(`chartCanvasRef`),a=(0,t.computed)(()=>n.loading?p:n.items);return e.r({canvasRef:i,config:(0,t.computed)(()=>!n.loading&&n.items.length===0?null:f({items:a.value,colorHostElement:r.value,xMax:n.loading?60:n.xMax,xMin:n.loading?0:n.xMin,xStep:n.loading?10:n.xStep,skeleton:n.loading})),enabled:(0,t.computed)(()=>n.loading||n.items.length>0)}),(a,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:r,class:(0,t.normalizeClass)([`s-ui-chart-horizontal-bar`,{"s-ui-chart-horizontal-bar--skeleton":n.loading}])},[(0,t.createElementVNode)(`div`,m,[(0,t.createVNode)((0,t.unref)(e.t),{loading:n.loading},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:i,class:`s-ui-chart-horizontal-bar__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs");let t=require("vue");var n=(t,n)=>t.startsWith(`--`)?e.y(t,n):t,r=(t,r,i,a,o)=>{if(i)return n(i,r);let s=a?o.skeletonPalette:o.palette,c=a?o.skeletonFallback:o.paletteFallback;return e.y(s[t%s.length]??c,r)},i={class:`s-ui-chart-legend__swatch-slot`,"aria-hidden":`true`},a={class:`s-ui-chart-legend__label`},o=(0,t.defineComponent)({__name:`SChartLegend`,props:{items:{},disabled:{type:Boolean,default:!1},direction:{default:`row`}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`ul`,{class:(0,t.normalizeClass)([`s-ui-chart-legend`,{"s-ui-chart-legend--disabled":e.disabled,"s-ui-chart-legend--column":e.direction===`column`}])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e.label,class:`s-ui-chart-legend__item`},[(0,t.createElementVNode)(`span`,i,[(0,t.createElementVNode)(`span`,{class:`s-ui-chart-legend__swatch`,style:(0,t.normalizeStyle)({backgroundColor:e.color})},null,4)]),(0,t.createElementVNode)(`span`,a,`— `+(0,t.toDisplayString)(e.label),1)]))),128))],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as e } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
2
|
import { Fragment as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderList as c, toDisplayString as l } from "vue";
|
|
3
3
|
//#region src/utils/chart/core/resolveSeriesPaletteColor.ts
|
|
4
4
|
var u = (t, n) => t.startsWith("--") ? e(t, n) : t, d = (t, n, r, i, a) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t,
|
|
1
|
+
import { a as e, i as t, m as n, r, t as i, y as a } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
2
|
import { t as o } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
3
3
|
import { computed as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, unref as m, useTemplateRef as h, withCtx as g } from "vue";
|
|
4
4
|
//#region src/utils/chart/css/applyOpacityToCssColor.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs");let n=require("vue");var r=(e,t)=>!e||t>=1?e:t<=0?`transparent`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`,i=(e,t,n=1)=>{if(typeof window>`u`)return n;let r=t??document.documentElement,i=getComputedStyle(r).getPropertyValue(e).trim(),a=Number.parseFloat(i);return Number.isNaN(a)?n:a},a=172,o=.0643,s=.8972,c=(e,t)=>{let n=e.right-e.left,r=e.bottom-e.top,i=(t-90)*Math.PI/180,a=Math.abs(n*Math.sin(i))+Math.abs(r*Math.cos(i)),o=(e.left+e.right)/2,s=(e.top+e.bottom)/2,c=Math.cos(i)*a/2,l=Math.sin(i)*a/2;return{x0:o-c,y0:s-l,x1:o+c,y1:s+l}},l=(e,t,n,i=1)=>{let{chart:l}=e,{ctx:u,chartArea:d}=l;if(!d)return t;let f=r(t,i),p=r(n,i),{x0:m,y0:h,x1:g,y1:_}=c(d,a),v=u.createLinearGradient(m,h,g,_);return v.addColorStop(0,f),v.addColorStop(o,f),v.addColorStop(s,p),v.addColorStop(1,p),v},u=5,d=5,f=(e,t,n)=>{if(t)return t;let r=e.reduce((e,t)=>Math.max(e,t.value),0),i=Math.ceil(r/n)*n;return i>0?i:n*5},p=(e,t)=>!t||typeof e!=`number`?e:`${e}%`,m=({points:n,seriesLabel:r,colorHostElement:a,yMax:o,yMin:s,yStep:c=d,skeleton:m=!1})=>{let h=e.y(e.m.axisLabel,a),g=e.y(e.m.grid,a),_=e.y(m?e.m.skeletonSeries:e.m.seriesPrimary,a),v=e.y(m?e.m.skeletonFillStart:e.m.seriesFillStart,a),y=e.y(m?e.m.skeletonFillEnd:e.m.seriesFillEnd,a),b=e.y(e.m.tooltipBackground,a),x=e.y(e.m.tooltipText,a),S=i(m?e.m.skeletonFillOpacity:e.m.seriesFillOpacity,a,.8),C=m&&o?o:f(n,o,c),w=m&&s!==void 0?s:0;return{type:`line`,data:{labels:n.map(e=>e.label),datasets:[{label:r,data:n.map(e=>e.value),borderColor:_,backgroundColor:e=>l(e,v,y,S),borderWidth:u,fill:!0,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.i(m,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.a(m),backgroundColor:b,titleColor:x,bodyColor:x,displayColors:!1}},scales:t.t({axisLabelColor:h,gridColor:g,yMin:w,yMax:C,yStep:c,formatYAxisTick:e=>p(e,m)})}}},h=[{label:`ноябрь 2025`,value:63},{label:`декабрь 2025`,value:77},{label:`январь 2026`,value:75},{label:`февраль 2026`,value:81},{label:`март 2026`,value:91},{label:`апрель 2026`,value:87}],g={class:`s-ui-chart-line__canvas-wrap`},_=(0,n.defineComponent)({__name:`SChartLine`,props:{points:{default:()=>[]},seriesLabel:{default:`Series`},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},setup(t){let r=(0,n.useTemplateRef)(`chartRootRef`),i=(0,n.useTemplateRef)(`chartCanvasRef`),a=(0,n.computed)(()=>t.loading?h:t.points);return e.r({canvasRef:i,config:(0,n.computed)(()=>!t.loading&&t.points.length===0?null:m({points:a.value,seriesLabel:t.seriesLabel,colorHostElement:r.value,yMax:t.loading?100:t.yMax,yMin:t.loading?50:void 0,yStep:t.loading?10:t.yStep,skeleton:t.loading})),enabled:(0,n.computed)(()=>t.loading||t.points.length>0)}),(a,o)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:r,class:(0,n.normalizeClass)([`s-ui-chart-line`,{"s-ui-chart-line--skeleton":t.loading}])},[(0,n.createElementVNode)(`div`,g,[(0,n.createVNode)((0,n.unref)(e.t),{loading:t.loading},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:i,class:`s-ui-chart-line__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return _}});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import { n as u, t as d } from "./SChartLegend-
|
|
1
|
+
import { a as e, g as t, h as n, i as r, m as i, n as a, o, r as s, t as c, y as l } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
|
+
import { n as u, t as d } from "./SChartLegend-DW16AfUz.js";
|
|
3
3
|
import { computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createVNode as _, defineComponent as v, normalizeClass as y, openBlock as b, unref as x, useTemplateRef as S, withCtx as C } from "vue";
|
|
4
4
|
//#region src/utils/chart/pie/resolvePieSliceColor.ts
|
|
5
|
-
var w = (e,
|
|
5
|
+
var w = (e, r, a, o = !1) => u(e, r, a, o, {
|
|
6
6
|
palette: t,
|
|
7
|
-
paletteFallback:
|
|
8
|
-
skeletonPalette:
|
|
9
|
-
skeletonFallback:
|
|
7
|
+
paletteFallback: i.piePalette1,
|
|
8
|
+
skeletonPalette: n,
|
|
9
|
+
skeletonFallback: i.pieSkeletonPalette1
|
|
10
10
|
}), T = () => ({
|
|
11
11
|
title: () => "",
|
|
12
12
|
label: (e) => `${e.label ?? ""} – ${e.parsed ?? 0}`
|
|
@@ -18,20 +18,20 @@ var w = (e, n, i, a = !1) => u(e, n, i, a, {
|
|
|
18
18
|
afterDatasetsDraw(t) {
|
|
19
19
|
let n = t.getDatasetMeta(0);
|
|
20
20
|
if (!n) return;
|
|
21
|
-
let r = l(
|
|
21
|
+
let r = l(i.pieBadgeBackground, e), a = l(i.pieBadgeBorder, e), o = l(i.pieBadgeText, e), { ctx: s } = t;
|
|
22
22
|
s.save(), s.font = k, s.textAlign = "center", s.textBaseline = "middle";
|
|
23
23
|
for (let e = 0; e < n.data.length; e += 1) {
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
24
|
+
let i = n.data[e], c = t.data.datasets[0]?.data[e], l = i ? j(i) : null;
|
|
25
|
+
if (i && typeof c == "number" && c > 0 && l) {
|
|
26
26
|
let e = `${c}`, t = s.measureText(e).width + E * 2;
|
|
27
|
-
A(s, l.x - t / 2, l.y - 20 / 2, t, 20, D), s.fillStyle = r, s.fill(), s.lineWidth = O, s.strokeStyle =
|
|
27
|
+
A(s, l.x - t / 2, l.y - 20 / 2, t, 20, D), s.fillStyle = r, s.fill(), s.lineWidth = O, s.strokeStyle = a, s.stroke(), s.fillStyle = o, s.fillText(e, l.x, l.y);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
s.restore();
|
|
31
31
|
}
|
|
32
|
-
}), N = ({ sliceList: t, colorHostElement:
|
|
32
|
+
}), N = ({ sliceList: t, colorHostElement: n, skeleton: a = !1 }) => {
|
|
33
33
|
if (t.length === 0) return null;
|
|
34
|
-
let s = l(
|
|
34
|
+
let s = l(i.pieSegmentBorder, n), c = l(i.tooltipBackground, n), u = l(i.tooltipText, n), d = t.map((e, t) => w(t, n, e.fillColor, a));
|
|
35
35
|
return {
|
|
36
36
|
type: "pie",
|
|
37
37
|
data: {
|
|
@@ -55,14 +55,14 @@ var w = (e, n, i, a = !1) => u(e, n, i, a, {
|
|
|
55
55
|
cutout: "58%",
|
|
56
56
|
rotation: 115,
|
|
57
57
|
layout: { padding: 26 },
|
|
58
|
-
interaction:
|
|
58
|
+
interaction: r(a, {
|
|
59
59
|
mode: "nearest",
|
|
60
60
|
intersect: !0
|
|
61
61
|
}),
|
|
62
62
|
plugins: {
|
|
63
63
|
legend: { display: !1 },
|
|
64
64
|
tooltip: {
|
|
65
|
-
enabled: e(
|
|
65
|
+
enabled: e(a),
|
|
66
66
|
backgroundColor: c,
|
|
67
67
|
titleColor: u,
|
|
68
68
|
bodyColor: u,
|
|
@@ -71,7 +71,7 @@ var w = (e, n, i, a = !1) => u(e, n, i, a, {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
plugins: a
|
|
74
|
+
plugins: o(a, [M(n)])
|
|
75
75
|
};
|
|
76
76
|
}, P = [
|
|
77
77
|
"Series 1",
|
|
@@ -104,11 +104,11 @@ var w = (e, n, i, a = !1) => u(e, n, i, a, {
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
setup(e) {
|
|
107
|
-
let t =
|
|
108
|
-
sliceList:
|
|
107
|
+
let t = a, n = S("chartRootRef"), r = S("chartCanvasRef"), i = f(() => e.loading ? I : e.slices), o = f(() => !e.loading && e.slices.length === 0 ? null : N({
|
|
108
|
+
sliceList: i.value,
|
|
109
109
|
colorHostElement: n.value,
|
|
110
110
|
skeleton: e.loading
|
|
111
|
-
})), l = f(() =>
|
|
111
|
+
})), l = f(() => i.value.map((t, r) => ({
|
|
112
112
|
label: t.label,
|
|
113
113
|
color: w(r, n.value, t.fillColor, e.loading)
|
|
114
114
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs"),t=require("./SChartLegend-BFwzIA4x.cjs");let n=require("vue");var r=(n,r,i,a=!1)=>t.n(n,r,i,a,{palette:e.g,paletteFallback:e.m.piePalette1,skeletonPalette:e.h,skeletonFallback:e.m.pieSkeletonPalette1}),i=()=>({title:()=>``,label:e=>`${e.label??``} – ${e.parsed??0}`}),a=4,o=4,s=1,c=`400 12px var(--s-ui-font-family-label)`,l=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i/2);e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.arcTo(t+r,n,t+r,n+o,o),e.lineTo(t+r,n+i-o),e.arcTo(t+r,n+i,t+r-o,n+i,o),e.lineTo(t+o,n+i),e.arcTo(t,n+i,t,n+i-o,o),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.closePath()},u=e=>!(`getCenterPoint`in e)||typeof e.getCenterPoint!=`function`?null:e.getCenterPoint(!1),d=t=>({id:`pieSegmentBadge`,afterDatasetsDraw(n){let r=n.getDatasetMeta(0);if(!r)return;let i=e.y(e.m.pieBadgeBackground,t),d=e.y(e.m.pieBadgeBorder,t),f=e.y(e.m.pieBadgeText,t),{ctx:p}=n;p.save(),p.font=c,p.textAlign=`center`,p.textBaseline=`middle`;for(let e=0;e<r.data.length;e+=1){let t=r.data[e],c=n.data.datasets[0]?.data[e],m=t?u(t):null;if(t&&typeof c==`number`&&c>0&&m){let e=`${c}`,t=p.measureText(e).width+a*2;l(p,m.x-t/2,m.y-20/2,t,20,o),p.fillStyle=i,p.fill(),p.lineWidth=s,p.strokeStyle=d,p.stroke(),p.fillStyle=f,p.fillText(e,m.x,m.y)}}p.restore()}}),f=({sliceList:t,colorHostElement:n,skeleton:a=!1})=>{if(t.length===0)return null;let o=e.y(e.m.pieSegmentBorder,n),s=e.y(e.m.tooltipBackground,n),c=e.y(e.m.tooltipText,n),l=t.map((e,t)=>r(t,n,e.fillColor,a));return{type:`pie`,data:{labels:t.map(e=>e.label),datasets:[{data:t.map(e=>e.value),backgroundColor:l,hoverBackgroundColor:l,borderColor:o,hoverBorderColor:o,borderWidth:4,hoverBorderWidth:4,hoverOffset:26,spacing:0,borderRadius:8}]},options:{responsive:!0,maintainAspectRatio:!0,cutout:`58%`,rotation:115,layout:{padding:26},interaction:e.i(a,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:e.a(a),backgroundColor:s,titleColor:c,bodyColor:c,displayColors:!1,callbacks:i()}}},plugins:e.o(a,[d(n)])}},p=[`Series 1`,`Series 2`,`Series 3`,`Series 4`,`Series 5`,`Series 6`,`Series 7`,`Series 8`],m=[4,1,1,1,1,1,1,1],h=p.map((e,t)=>({label:e,value:m[t]??1})),g={class:`s-ui-chart-pie__canvas-wrap`},_=(0,n.defineComponent)({__name:`SChartPie`,props:{slices:{default:()=>[]},loading:{type:Boolean,default:!1}},setup(i){let a=e.n,o=(0,n.useTemplateRef)(`chartRootRef`),s=(0,n.useTemplateRef)(`chartCanvasRef`),c=(0,n.computed)(()=>i.loading?h:i.slices),l=(0,n.computed)(()=>!i.loading&&i.slices.length===0?null:f({sliceList:c.value,colorHostElement:o.value,skeleton:i.loading})),u=(0,n.computed)(()=>c.value.map((e,t)=>({label:e.label,color:r(t,o.value,e.fillColor,i.loading)})));return e.r({canvasRef:s,config:l,enabled:(0,n.computed)(()=>i.loading||i.slices.length>0)}),(r,c)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:o,class:(0,n.normalizeClass)([`s-ui-chart-pie`,{"s-ui-chart-pie--skeleton":i.loading}])},[(0,n.createElementVNode)(`div`,g,[(0,n.createVNode)((0,n.unref)(e.t),{loading:i.loading,type:(0,n.unref)(a).PIE},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:s,class:`s-ui-chart-pie__canvas`},null,512)]),_:1},8,[`loading`,`type`])]),u.value.length>0?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(t.t),{key:0,items:u.value,disabled:i.loading,direction:`column`},null,8,[`items`,`disabled`])):(0,n.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return _}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs");let t=require("vue");var n=4,r=12,i=24,a=e=>{let t=e<=15;return{pointRadius:t?n:0,pointHoverRadius:n,pointHitRadius:t?r:i}},o=e=>e<=15?{mode:`nearest`,intersect:!0}:{mode:`nearest`,axis:`x`,intersect:!1},s=.3,c=1,l=({labels:t,progressValues:n,referenceValues:r,seriesLabel:i,valuePrefix:l,minValue:u,maxValue:d,stepSize:f,progressSnapshotCount:p,colorHostElement:m,skeleton:h=!1})=>{let g=e.y(e.m.axisLabel,m),_=e.y(e.m.grid,m),v=e.y(h?e.m.skeletonSeries:e.m.progressLine,m),y=e.y(h?e.m.skeletonFillStart:e.m.referenceFill,m),b=e.y(e.m.tooltipBackground,m),x=e.y(e.m.tooltipText,m),S=s,C=a(p),w=o(p);return{type:`line`,data:{labels:t,datasets:[{data:r,borderColor:`transparent`,backgroundColor:y,pointRadius:0,pointHoverRadius:0,pointHitRadius:0,fill:`start`,order:0},{label:i,data:n,borderColor:v,backgroundColor:v,tension:S,pointRadius:C.pointRadius,pointHoverRadius:C.pointHoverRadius,pointHitRadius:C.pointHitRadius,pointBackgroundColor:v,pointBorderColor:v,fill:!1,order:1}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.i(h,w),plugins:{legend:{display:!1},tooltip:{enabled:e.a(h),backgroundColor:b,titleColor:x,bodyColor:x,position:e.l,filter:e=>e.datasetIndex===c,callbacks:{label:e=>{let t=e.parsed.y;return t===null?``:`${t}${l}`}}}},scales:{x:{type:`category`,border:{display:!1},grid:{color:_,drawTicks:!0},ticks:{color:g,font:{family:`var(--s-ui-font-family-label)`,size:10,weight:500},padding:8}},y:{type:`linear`,min:u,max:d,border:{display:!1},grid:{color:_,drawTicks:!0},ticks:{color:g,stepSize:f,callback:e=>`${e}${l}`,font:{family:`var(--s-ui-font-family-label)`,size:10,weight:500},padding:8}}}}}},u=e=>{let t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);return t?`${t[3]}.${t[2]}.${t[1]}`:e},d=e=>Math.round(e*10)/10,f=({progressSnapshots:e,deadline:t=null,minValue:n=0,maxValue:r=100})=>{let i=e.map(e=>u(e.date)),a=e.map(e=>e.progress),o=t?u(t):null,s=a.length===1?[``,i[0]??``,``]:o?[...i,o]:i,c=a.length===1?[null,a[0]??null,null]:o?[...a,null]:a,l=s.length;return{labels:s,progressValues:c,referenceValues:l===0?[]:l===1?[n]:Array.from({length:l},(e,t)=>d(n+t*((r-n)/(l-1)))),minValue:n,maxValue:r,stepSize:d((r-n)/4),progressSnapshotCount:e.length}},p=[{date:`2025-11-01`,progress:20},{date:`2025-12-01`,progress:35},{date:`2026-01-01`,progress:42},{date:`2026-02-01`,progress:58},{date:`2026-03-01`,progress:71},{date:`2026-04-01`,progress:84}],m={class:`s-ui-chart-progress__canvas-wrap`},h=(0,t.defineComponent)({__name:`SChartProgress`,props:{progressSnapshots:{default:()=>[]},deadline:{default:null},minValue:{},maxValue:{},prefix:{},seriesLabel:{default:`Progress`},loading:{type:Boolean,default:!1}},setup(n){let r=(0,t.useTemplateRef)(`chartRootRef`),i=(0,t.useTemplateRef)(`chartCanvasRef`),a=(0,t.computed)(()=>n.minValue??0),o=(0,t.computed)(()=>n.maxValue??100),s=(0,t.computed)(()=>n.prefix??`%`),c=(0,t.computed)(()=>n.loading?p:n.progressSnapshots),u=(0,t.computed)(()=>f({progressSnapshots:c.value,deadline:n.loading?`2026-06-28`:n.deadline,minValue:n.loading?0:a.value,maxValue:n.loading?100:o.value}));return e.r({canvasRef:i,config:(0,t.computed)(()=>!n.loading&&n.progressSnapshots.length===0?null:l({labels:u.value.labels,progressValues:u.value.progressValues,referenceValues:u.value.referenceValues,seriesLabel:n.seriesLabel,valuePrefix:s.value,minValue:u.value.minValue,maxValue:u.value.maxValue,stepSize:n.loading?25:u.value.stepSize,progressSnapshotCount:u.value.progressSnapshotCount,colorHostElement:r.value,skeleton:n.loading})),enabled:(0,t.computed)(()=>n.loading||n.progressSnapshots.length>0)}),(a,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:r,class:(0,t.normalizeClass)([`s-ui-chart-progress`,{"s-ui-chart-progress--skeleton":n.loading}])},[(0,t.createElementVNode)(`div`,m,[(0,t.createVNode)((0,t.unref)(e.t),{loading:n.loading},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:i,class:`s-ui-chart-progress__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { a as e, i as t, l as n, m as r, r as i, t as a, y as o } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
|
+
import { computed as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, unref as m, useTemplateRef as h, withCtx as g } from "vue";
|
|
3
|
+
var _ = 4, v = 12, y = 24, b = (e) => {
|
|
4
|
+
let t = e <= 15;
|
|
5
|
+
return {
|
|
6
|
+
pointRadius: t ? _ : 0,
|
|
7
|
+
pointHoverRadius: _,
|
|
8
|
+
pointHitRadius: t ? v : y
|
|
9
|
+
};
|
|
10
|
+
}, x = (e) => e <= 15 ? {
|
|
11
|
+
mode: "nearest",
|
|
12
|
+
intersect: !0
|
|
13
|
+
} : {
|
|
14
|
+
mode: "nearest",
|
|
15
|
+
axis: "x",
|
|
16
|
+
intersect: !1
|
|
17
|
+
}, S = .3, C = 1, w = ({ labels: i, progressValues: a, referenceValues: s, seriesLabel: c, valuePrefix: l, minValue: u, maxValue: d, stepSize: f, progressSnapshotCount: p, colorHostElement: m, skeleton: h = !1 }) => {
|
|
18
|
+
let g = o(r.axisLabel, m), _ = o(r.grid, m), v = o(h ? r.skeletonSeries : r.progressLine, m), y = o(h ? r.skeletonFillStart : r.referenceFill, m), w = o(r.tooltipBackground, m), T = o(r.tooltipText, m), E = S, D = b(p), O = x(p);
|
|
19
|
+
return {
|
|
20
|
+
type: "line",
|
|
21
|
+
data: {
|
|
22
|
+
labels: i,
|
|
23
|
+
datasets: [{
|
|
24
|
+
data: s,
|
|
25
|
+
borderColor: "transparent",
|
|
26
|
+
backgroundColor: y,
|
|
27
|
+
pointRadius: 0,
|
|
28
|
+
pointHoverRadius: 0,
|
|
29
|
+
pointHitRadius: 0,
|
|
30
|
+
fill: "start",
|
|
31
|
+
order: 0
|
|
32
|
+
}, {
|
|
33
|
+
label: c,
|
|
34
|
+
data: a,
|
|
35
|
+
borderColor: v,
|
|
36
|
+
backgroundColor: v,
|
|
37
|
+
tension: E,
|
|
38
|
+
pointRadius: D.pointRadius,
|
|
39
|
+
pointHoverRadius: D.pointHoverRadius,
|
|
40
|
+
pointHitRadius: D.pointHitRadius,
|
|
41
|
+
pointBackgroundColor: v,
|
|
42
|
+
pointBorderColor: v,
|
|
43
|
+
fill: !1,
|
|
44
|
+
order: 1
|
|
45
|
+
}]
|
|
46
|
+
},
|
|
47
|
+
options: {
|
|
48
|
+
responsive: !0,
|
|
49
|
+
maintainAspectRatio: !1,
|
|
50
|
+
interaction: t(h, O),
|
|
51
|
+
plugins: {
|
|
52
|
+
legend: { display: !1 },
|
|
53
|
+
tooltip: {
|
|
54
|
+
enabled: e(h),
|
|
55
|
+
backgroundColor: w,
|
|
56
|
+
titleColor: T,
|
|
57
|
+
bodyColor: T,
|
|
58
|
+
position: n,
|
|
59
|
+
filter: (e) => e.datasetIndex === C,
|
|
60
|
+
callbacks: { label: (e) => {
|
|
61
|
+
let t = e.parsed.y;
|
|
62
|
+
return t === null ? "" : `${t}${l}`;
|
|
63
|
+
} }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
scales: {
|
|
67
|
+
x: {
|
|
68
|
+
type: "category",
|
|
69
|
+
border: { display: !1 },
|
|
70
|
+
grid: {
|
|
71
|
+
color: _,
|
|
72
|
+
drawTicks: !0
|
|
73
|
+
},
|
|
74
|
+
ticks: {
|
|
75
|
+
color: g,
|
|
76
|
+
font: {
|
|
77
|
+
family: "var(--s-ui-font-family-label)",
|
|
78
|
+
size: 10,
|
|
79
|
+
weight: 500
|
|
80
|
+
},
|
|
81
|
+
padding: 8
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
y: {
|
|
85
|
+
type: "linear",
|
|
86
|
+
min: u,
|
|
87
|
+
max: d,
|
|
88
|
+
border: { display: !1 },
|
|
89
|
+
grid: {
|
|
90
|
+
color: _,
|
|
91
|
+
drawTicks: !0
|
|
92
|
+
},
|
|
93
|
+
ticks: {
|
|
94
|
+
color: g,
|
|
95
|
+
stepSize: f,
|
|
96
|
+
callback: (e) => `${e}${l}`,
|
|
97
|
+
font: {
|
|
98
|
+
family: "var(--s-ui-font-family-label)",
|
|
99
|
+
size: 10,
|
|
100
|
+
weight: 500
|
|
101
|
+
},
|
|
102
|
+
padding: 8
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}, T = (e) => {
|
|
109
|
+
let t = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
110
|
+
return t ? `${t[3]}.${t[2]}.${t[1]}` : e;
|
|
111
|
+
}, E = (e) => Math.round(e * 10) / 10, D = ({ progressSnapshots: e, deadline: t = null, minValue: n = 0, maxValue: r = 100 }) => {
|
|
112
|
+
let i = e.map((e) => T(e.date)), a = e.map((e) => e.progress), o = t ? T(t) : null, s = a.length === 1 ? [
|
|
113
|
+
"",
|
|
114
|
+
i[0] ?? "",
|
|
115
|
+
""
|
|
116
|
+
] : o ? [...i, o] : i, c = a.length === 1 ? [
|
|
117
|
+
null,
|
|
118
|
+
a[0] ?? null,
|
|
119
|
+
null
|
|
120
|
+
] : o ? [...a, null] : a, l = s.length;
|
|
121
|
+
return {
|
|
122
|
+
labels: s,
|
|
123
|
+
progressValues: c,
|
|
124
|
+
referenceValues: l === 0 ? [] : l === 1 ? [n] : Array.from({ length: l }, (e, t) => E(n + t * ((r - n) / (l - 1)))),
|
|
125
|
+
minValue: n,
|
|
126
|
+
maxValue: r,
|
|
127
|
+
stepSize: E((r - n) / 4),
|
|
128
|
+
progressSnapshotCount: e.length
|
|
129
|
+
};
|
|
130
|
+
}, O = [
|
|
131
|
+
{
|
|
132
|
+
date: "2025-11-01",
|
|
133
|
+
progress: 20
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
date: "2025-12-01",
|
|
137
|
+
progress: 35
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
date: "2026-01-01",
|
|
141
|
+
progress: 42
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
date: "2026-02-01",
|
|
145
|
+
progress: 58
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
date: "2026-03-01",
|
|
149
|
+
progress: 71
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
date: "2026-04-01",
|
|
153
|
+
progress: 84
|
|
154
|
+
}
|
|
155
|
+
], k = { class: "s-ui-chart-progress__canvas-wrap" }, A = /* @__PURE__ */ d({
|
|
156
|
+
__name: "SChartProgress",
|
|
157
|
+
props: {
|
|
158
|
+
progressSnapshots: { default: () => [] },
|
|
159
|
+
deadline: { default: null },
|
|
160
|
+
minValue: {},
|
|
161
|
+
maxValue: {},
|
|
162
|
+
prefix: {},
|
|
163
|
+
seriesLabel: { default: "Progress" },
|
|
164
|
+
loading: {
|
|
165
|
+
type: Boolean,
|
|
166
|
+
default: !1
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
setup(e) {
|
|
170
|
+
let t = h("chartRootRef"), n = h("chartCanvasRef"), r = s(() => e.minValue ?? 0), o = s(() => e.maxValue ?? 100), d = s(() => e.prefix ?? "%"), _ = s(() => e.loading ? O : e.progressSnapshots), v = s(() => D({
|
|
171
|
+
progressSnapshots: _.value,
|
|
172
|
+
deadline: e.loading ? "2026-06-28" : e.deadline,
|
|
173
|
+
minValue: e.loading ? 0 : r.value,
|
|
174
|
+
maxValue: e.loading ? 100 : o.value
|
|
175
|
+
}));
|
|
176
|
+
return i({
|
|
177
|
+
canvasRef: n,
|
|
178
|
+
config: s(() => !e.loading && e.progressSnapshots.length === 0 ? null : w({
|
|
179
|
+
labels: v.value.labels,
|
|
180
|
+
progressValues: v.value.progressValues,
|
|
181
|
+
referenceValues: v.value.referenceValues,
|
|
182
|
+
seriesLabel: e.seriesLabel,
|
|
183
|
+
valuePrefix: d.value,
|
|
184
|
+
minValue: v.value.minValue,
|
|
185
|
+
maxValue: v.value.maxValue,
|
|
186
|
+
stepSize: e.loading ? 25 : v.value.stepSize,
|
|
187
|
+
progressSnapshotCount: v.value.progressSnapshotCount,
|
|
188
|
+
colorHostElement: t.value,
|
|
189
|
+
skeleton: e.loading
|
|
190
|
+
})),
|
|
191
|
+
enabled: s(() => e.loading || e.progressSnapshots.length > 0)
|
|
192
|
+
}), (r, i) => (p(), c("div", {
|
|
193
|
+
ref_key: "chartRootRef",
|
|
194
|
+
ref: t,
|
|
195
|
+
class: f(["s-ui-chart-progress", { "s-ui-chart-progress--skeleton": e.loading }])
|
|
196
|
+
}, [l("div", k, [u(m(a), { loading: e.loading }, {
|
|
197
|
+
default: g(() => [l("canvas", {
|
|
198
|
+
ref_key: "chartCanvasRef",
|
|
199
|
+
ref: n,
|
|
200
|
+
class: "s-ui-chart-progress__canvas"
|
|
201
|
+
}, null, 512)]),
|
|
202
|
+
_: 1
|
|
203
|
+
}, 8, ["loading"])])], 2));
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
//#endregion
|
|
207
|
+
export { A as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as e, createBlock as t, defineComponent as n, onBeforeUnmount as r, onMounted as i, openBlock as a, renderSlot as o, shallowRef as s, toValue as c, unref as l, watch as u, withCtx as d } from "vue";
|
|
2
2
|
import { ESSkeletonType as f, SSkeleton as p } from "@shtabapp/ui-kit-primitives";
|
|
3
3
|
import { useResizeObserver as m } from "@vueuse/core";
|
|
4
|
-
import { ArcElement as
|
|
4
|
+
import { ArcElement as ee, BarController as h, BarElement as g, CategoryScale as _, Chart as v, Filler as y, LineController as b, LineElement as x, LinearScale as S, PieController as C, PointElement as w, Tooltip as T } from "chart.js";
|
|
5
5
|
//#region src/utils/chart/css/readCssColor.ts
|
|
6
|
-
var
|
|
6
|
+
var E = (e, t) => {
|
|
7
7
|
if (typeof window > "u") return "";
|
|
8
8
|
let n = t ?? document.documentElement;
|
|
9
9
|
return getComputedStyle(n).getPropertyValue(e).trim();
|
|
10
|
-
},
|
|
10
|
+
}, D = {
|
|
11
11
|
axisLabel: "--s-ui-chart-axis-label",
|
|
12
12
|
grid: "--s-ui-chart-grid",
|
|
13
13
|
crosshair: "--s-ui-chart-crosshair",
|
|
@@ -71,67 +71,69 @@ var D = (e, t) => {
|
|
|
71
71
|
barHorizontalFillDefault: "--s-ui-chart-bar-horizontal-fill-default",
|
|
72
72
|
barHorizontalSkeletonFill: "--s-ui-chart-bar-horizontal-skeleton-fill",
|
|
73
73
|
barHorizontalCategoryLabel: "--s-ui-chart-bar-horizontal-category-label",
|
|
74
|
-
barHorizontalCategoryLabelSkeleton: "--s-ui-chart-bar-horizontal-category-label-skeleton"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
barHorizontalCategoryLabelSkeleton: "--s-ui-chart-bar-horizontal-category-label-skeleton",
|
|
75
|
+
progressLine: "--s-ui-chart-progress-line",
|
|
76
|
+
referenceFill: "--s-ui-chart-reference-fill"
|
|
77
|
+
}, O = [
|
|
78
|
+
D.stackedPalette1,
|
|
79
|
+
D.stackedPalette2,
|
|
80
|
+
D.stackedPalette3,
|
|
81
|
+
D.stackedPalette4,
|
|
82
|
+
D.stackedPalette5,
|
|
83
|
+
D.stackedPalette6
|
|
84
|
+
], k = [
|
|
85
|
+
D.skeletonPalette1,
|
|
86
|
+
D.skeletonPalette2,
|
|
87
|
+
D.skeletonPalette3,
|
|
88
|
+
D.skeletonPalette4,
|
|
89
|
+
D.skeletonPalette5,
|
|
90
|
+
D.skeletonPalette6
|
|
82
91
|
], A = [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
D.barStackedPalette1,
|
|
93
|
+
D.barStackedPalette2,
|
|
94
|
+
D.barStackedPalette3,
|
|
95
|
+
D.barStackedPalette4,
|
|
96
|
+
D.barStackedPalette5,
|
|
97
|
+
D.barStackedPalette6
|
|
89
98
|
], j = [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
D.barSkeletonPalette1,
|
|
100
|
+
D.barSkeletonPalette2,
|
|
101
|
+
D.barSkeletonPalette3,
|
|
102
|
+
D.barSkeletonPalette4,
|
|
103
|
+
D.barSkeletonPalette5,
|
|
104
|
+
D.barSkeletonPalette6
|
|
96
105
|
], M = [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
D.piePalette1,
|
|
107
|
+
D.piePalette2,
|
|
108
|
+
D.piePalette3,
|
|
109
|
+
D.piePalette4,
|
|
110
|
+
D.piePalette5,
|
|
111
|
+
D.piePalette6,
|
|
112
|
+
D.piePalette7,
|
|
113
|
+
D.piePalette8
|
|
103
114
|
], N = [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
], P =
|
|
113
|
-
O.pieSkeletonPalette1,
|
|
114
|
-
O.pieSkeletonPalette2,
|
|
115
|
-
O.pieSkeletonPalette3,
|
|
116
|
-
O.pieSkeletonPalette4,
|
|
117
|
-
O.pieSkeletonPalette5,
|
|
118
|
-
O.pieSkeletonPalette6,
|
|
119
|
-
O.pieSkeletonPalette7,
|
|
120
|
-
O.pieSkeletonPalette8
|
|
121
|
-
], ee = (e) => "captions" in e, F = (e, t) => {
|
|
115
|
+
D.pieSkeletonPalette1,
|
|
116
|
+
D.pieSkeletonPalette2,
|
|
117
|
+
D.pieSkeletonPalette3,
|
|
118
|
+
D.pieSkeletonPalette4,
|
|
119
|
+
D.pieSkeletonPalette5,
|
|
120
|
+
D.pieSkeletonPalette6,
|
|
121
|
+
D.pieSkeletonPalette7,
|
|
122
|
+
D.pieSkeletonPalette8
|
|
123
|
+
], P = (e) => "captions" in e, te = (e, t) => {
|
|
122
124
|
let n = e.data.datasets[0];
|
|
123
|
-
if (!n || !
|
|
125
|
+
if (!n || !P(n)) return;
|
|
124
126
|
let r = n.captions?.[t];
|
|
125
127
|
if (r) return r;
|
|
126
|
-
},
|
|
128
|
+
}, F = () => ({
|
|
127
129
|
title: (e) => {
|
|
128
130
|
let t = e[0];
|
|
129
131
|
if (!t) return "";
|
|
130
|
-
let n =
|
|
132
|
+
let n = te(t.chart, t.dataIndex), r = [`${t.label}`];
|
|
131
133
|
return n && r.push(n), r;
|
|
132
134
|
},
|
|
133
135
|
label: (e) => `${e.dataset.label ?? ""} – ${e.parsed.y ?? 0}`
|
|
134
|
-
}),
|
|
136
|
+
}), I = "stackedBarTop", L = function(e, t) {
|
|
135
137
|
if (e.length === 0) return {
|
|
136
138
|
x: t.x,
|
|
137
139
|
y: t.y
|
|
@@ -149,7 +151,22 @@ var D = (e, t) => {
|
|
|
149
151
|
x: (r + i) / 2,
|
|
150
152
|
y: n
|
|
151
153
|
};
|
|
152
|
-
},
|
|
154
|
+
}, R = "progressChartPoint", z = 1, B = (e, t) => {
|
|
155
|
+
let n = e.data.datasets[z]?.data[t];
|
|
156
|
+
return typeof n == "number" ? n : null;
|
|
157
|
+
}, V = function(e) {
|
|
158
|
+
let t = e.find((e) => e.datasetIndex === z) ?? e[0];
|
|
159
|
+
if (!t) return !1;
|
|
160
|
+
let n = this.chart.scales.y;
|
|
161
|
+
if (!n) return !1;
|
|
162
|
+
let r = B(this.chart, t.index);
|
|
163
|
+
return r === null ? !1 : {
|
|
164
|
+
x: t.element.x,
|
|
165
|
+
y: n.getPixelForValue(r),
|
|
166
|
+
xAlign: "center",
|
|
167
|
+
yAlign: "bottom"
|
|
168
|
+
};
|
|
169
|
+
}, H = ({ total: e } = {}) => ({
|
|
153
170
|
title: (e) => {
|
|
154
171
|
let t = e[0];
|
|
155
172
|
return t ? `${t.label}` : "";
|
|
@@ -159,7 +176,7 @@ var D = (e, t) => {
|
|
|
159
176
|
let n = t.reduce((e, t) => e + (t.parsed.y ?? 0), 0);
|
|
160
177
|
return e ? `${e} – ${n}` : `${n}`;
|
|
161
178
|
}
|
|
162
|
-
}),
|
|
179
|
+
}), U = "stackedAreaTop", W = function(e, t) {
|
|
163
180
|
let n = this.chart.chartArea;
|
|
164
181
|
return !n || e.length === 0 ? {
|
|
165
182
|
x: t.x,
|
|
@@ -168,16 +185,18 @@ var D = (e, t) => {
|
|
|
168
185
|
x: t.x,
|
|
169
186
|
y: n.top
|
|
170
187
|
};
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
},
|
|
188
|
+
}, G = !1, K = !1, q = !1, J = !1, Y = () => {
|
|
189
|
+
K ||= (T.positioners.stackedAreaTop = W, !0);
|
|
190
|
+
}, X = () => {
|
|
191
|
+
q ||= (T.positioners.stackedBarTop = L, !0);
|
|
192
|
+
}, Z = () => {
|
|
193
|
+
J ||= (T.positioners.progressChartPoint = V, !0);
|
|
194
|
+
}, Q = () => {
|
|
195
|
+
G ||= (v.register(b, x, w, h, g, C, ee, S, _, T, y), Y(), X(), Z(), !0);
|
|
196
|
+
}, ne = (e, t) => e ? {
|
|
178
197
|
mode: "nearest",
|
|
179
198
|
intersect: !1
|
|
180
|
-
} : t,
|
|
199
|
+
} : t, re = (e) => !e, ie = (e, t) => e ? [] : t, ae = ({ canvasRef: e, config: t, enabled: n }) => {
|
|
181
200
|
let a = s(), o = () => {
|
|
182
201
|
a.value &&= (a.value.destroy(), void 0);
|
|
183
202
|
}, l = () => {
|
|
@@ -190,7 +209,7 @@ var D = (e, t) => {
|
|
|
190
209
|
o();
|
|
191
210
|
return;
|
|
192
211
|
}
|
|
193
|
-
|
|
212
|
+
Q(), a.value &&= (a.value.destroy(), void 0), a.value = new v(r, i);
|
|
194
213
|
};
|
|
195
214
|
return i(() => {
|
|
196
215
|
l();
|
|
@@ -205,19 +224,19 @@ var D = (e, t) => {
|
|
|
205
224
|
}), r(() => {
|
|
206
225
|
o();
|
|
207
226
|
}), { chartInstance: a };
|
|
208
|
-
},
|
|
227
|
+
}, $ = /* @__PURE__ */ function(e) {
|
|
209
228
|
return e.CARTESIAN = "cartesian", e.PIE = "pie", e;
|
|
210
|
-
}({}),
|
|
229
|
+
}({}), oe = /* @__PURE__ */ n({
|
|
211
230
|
__name: "SChartSkeletonHost",
|
|
212
231
|
props: {
|
|
213
232
|
loading: {
|
|
214
233
|
type: Boolean,
|
|
215
234
|
default: !1
|
|
216
235
|
},
|
|
217
|
-
type: { default: () =>
|
|
236
|
+
type: { default: () => $.CARTESIAN }
|
|
218
237
|
},
|
|
219
238
|
setup(n) {
|
|
220
|
-
let r = e(() => n.type ===
|
|
239
|
+
let r = e(() => n.type === $.PIE ? f.CHART_PIE : f.CHART_CARTESIAN);
|
|
221
240
|
return (e, i) => n.loading ? (a(), t(l(p), {
|
|
222
241
|
key: 0,
|
|
223
242
|
type: r.value,
|
|
@@ -229,4 +248,4 @@ var D = (e, t) => {
|
|
|
229
248
|
}
|
|
230
249
|
});
|
|
231
250
|
//#endregion
|
|
232
|
-
export { k as _,
|
|
251
|
+
export { k as _, re as a, H as c, F as d, j as f, M as g, N as h, ne as i, R as l, D as m, $ as n, ie as o, A as p, ae as r, U as s, oe as t, I as u, O as v, E as y };
|