@shtabapp/ui-kit 1.45.0 → 1.47.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.
Files changed (129) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{SChartBurnup-DhuCNXhU.cjs → SChartBurnup-BhCS06uF.cjs} +1 -1
  3. package/dist/SChartBurnup-CG239MJx.js +251 -0
  4. package/dist/SChartHorizontalBar-DnKbf_9E.cjs +1 -0
  5. package/dist/SChartHorizontalBar-DqTZ4H-9.js +175 -0
  6. package/dist/SChartLegend-DGtjd6zV.cjs +1 -0
  7. package/dist/SChartLegend-oZoF8XK7.js +42 -0
  8. package/dist/SChartLine-CEnRbnVo.cjs +1 -0
  9. package/dist/SChartLine-CQhbtAjJ.js +129 -0
  10. package/dist/SChartMultiLine-B6GldTYv.cjs +1 -0
  11. package/dist/SChartMultiLine-CPEglksk.js +198 -0
  12. package/dist/SChartPie-CQyENNM6.cjs +1 -0
  13. package/dist/SChartPie-DXHCXNEs.js +168 -0
  14. package/dist/{SChartProgress-Zdphet8I.js → SChartProgress-BwDuidgB.js} +54 -50
  15. package/dist/{SChartProgress-QsGTZ8kT.cjs → SChartProgress-CMcM6yvT.cjs} +1 -1
  16. package/dist/SChartSkeletonHost-BlIYGj-7.cjs +1 -0
  17. package/dist/{SChartSkeletonHost-CecfQ3Ye.js → SChartSkeletonHost-DSFyP_DN.js} +150 -89
  18. package/dist/SChartStackedArea-BR7W44h6.js +254 -0
  19. package/dist/SChartStackedArea-DHSamqau.cjs +1 -0
  20. package/dist/SChartStackedBar-B3HcO4UQ.cjs +1 -0
  21. package/dist/SChartStackedBar-BbYna5KB.js +245 -0
  22. package/dist/{SColorPicker-ksmNupJa.js → SColorPicker-BqsD-5xA.js} +1 -1
  23. package/dist/{SColorPicker-BIrkgFys.cjs → SColorPicker-CeKB3QS1.cjs} +1 -1
  24. package/dist/SList-DAzztC-7.js +514 -0
  25. package/dist/SList-S18K8mlH.cjs +1 -0
  26. package/dist/{SSelect-DS2EGmjV.js → SSelect-Bntb-dgY.js} +1 -1
  27. package/dist/{SSelect-CkV6gq4S.cjs → SSelect-DcTEwHx6.cjs} +1 -1
  28. package/dist/components/SChartBurnup/SChartBurnup.vue.d.ts +4 -1
  29. package/dist/components/SChartBurnup/SChartBurnup.vue.d.ts.map +1 -1
  30. package/dist/components/SChartHorizontalBar/SChartHorizontalBar.vue.d.ts +9 -2
  31. package/dist/components/SChartHorizontalBar/SChartHorizontalBar.vue.d.ts.map +1 -1
  32. package/dist/components/SChartHorizontalBar/utils/buildSChartHorizontalBarConfig.d.ts +1 -0
  33. package/dist/components/SChartHorizontalBar/utils/buildSChartHorizontalBarConfig.d.ts.map +1 -1
  34. package/dist/components/SChartLegend/SChartLegend.types.d.ts +2 -0
  35. package/dist/components/SChartLegend/SChartLegend.types.d.ts.map +1 -1
  36. package/dist/components/SChartLegend/SChartLegend.vue.d.ts +5 -1
  37. package/dist/components/SChartLegend/SChartLegend.vue.d.ts.map +1 -1
  38. package/dist/components/SChartLine/SChartLine.vue.d.ts +4 -1
  39. package/dist/components/SChartLine/SChartLine.vue.d.ts.map +1 -1
  40. package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts +9 -2
  41. package/dist/components/SChartMultiLine/SChartMultiLine.vue.d.ts.map +1 -1
  42. package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts +2 -1
  43. package/dist/components/SChartMultiLine/utils/buildMultiLineChartConfig.d.ts.map +1 -1
  44. package/dist/components/SChartPie/SChartPie.vue.d.ts +9 -2
  45. package/dist/components/SChartPie/SChartPie.vue.d.ts.map +1 -1
  46. package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts +2 -1
  47. package/dist/components/SChartPie/utils/buildPieChartConfig.d.ts.map +1 -1
  48. package/dist/components/SChartProgress/SChartProgress.vue.d.ts +4 -1
  49. package/dist/components/SChartProgress/SChartProgress.vue.d.ts.map +1 -1
  50. package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts +9 -2
  51. package/dist/components/SChartSegmentedBar/SChartSegmentedBar.vue.d.ts.map +1 -1
  52. package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts +2 -1
  53. package/dist/components/SChartSegmentedBar/utils/buildSegmentedBarChartConfig.d.ts.map +1 -1
  54. package/dist/components/SChartStackedArea/SChartStackedArea.vue.d.ts +9 -2
  55. package/dist/components/SChartStackedArea/SChartStackedArea.vue.d.ts.map +1 -1
  56. package/dist/components/SChartStackedArea/utils/buildStackedAreaChartConfig.d.ts +2 -1
  57. package/dist/components/SChartStackedArea/utils/buildStackedAreaChartConfig.d.ts.map +1 -1
  58. package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts +9 -2
  59. package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts.map +1 -1
  60. package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts +2 -1
  61. package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts.map +1 -1
  62. package/dist/components/SList/SList.types.d.ts +11 -0
  63. package/dist/components/SList/SList.types.d.ts.map +1 -1
  64. package/dist/components/SList/SList.vue.d.ts +11 -3
  65. package/dist/components/SList/SList.vue.d.ts.map +1 -1
  66. package/dist/composables/useChartInteractivity.d.ts +14 -0
  67. package/dist/composables/useChartInteractivity.d.ts.map +1 -0
  68. package/dist/composables/useFlatTreeList.d.ts +4 -1
  69. package/dist/composables/useFlatTreeList.d.ts.map +1 -1
  70. package/dist/composables/useHasListener.d.ts +2 -0
  71. package/dist/composables/useHasListener.d.ts.map +1 -0
  72. package/dist/{createChartCrosshairPlugin-HfMMUP5O.cjs → createChartCrosshairPlugin-DdLyEWI0.cjs} +1 -1
  73. package/dist/{createChartCrosshairPlugin-BC0IDCn3.js → createChartCrosshairPlugin-q3U4ePnf.js} +2 -2
  74. package/dist/entries/chart-burnup.cjs +1 -1
  75. package/dist/entries/chart-burnup.js +1 -1
  76. package/dist/entries/chart-horizontal-bar.cjs +1 -1
  77. package/dist/entries/chart-horizontal-bar.js +1 -1
  78. package/dist/entries/chart-line.cjs +1 -1
  79. package/dist/entries/chart-line.js +1 -1
  80. package/dist/entries/chart-multi-line.cjs +1 -1
  81. package/dist/entries/chart-multi-line.js +1 -1
  82. package/dist/entries/chart-pie.cjs +1 -1
  83. package/dist/entries/chart-pie.js +1 -1
  84. package/dist/entries/chart-progress.cjs +1 -1
  85. package/dist/entries/chart-progress.js +1 -1
  86. package/dist/entries/chart-stacked-area.cjs +1 -1
  87. package/dist/entries/chart-stacked-area.js +1 -1
  88. package/dist/entries/chart-stacked-bar.cjs +1 -1
  89. package/dist/entries/chart-stacked-bar.js +1 -1
  90. package/dist/entries/color-picker.cjs +1 -1
  91. package/dist/entries/color-picker.js +1 -1
  92. package/dist/entries/list.cjs +1 -1
  93. package/dist/entries/list.js +1 -1
  94. package/dist/entries/select.cjs +1 -1
  95. package/dist/entries/select.js +1 -1
  96. package/dist/index.cjs +1 -1
  97. package/dist/index.js +184 -140
  98. package/dist/resolveSeriesPaletteColor-YACKW1NO.cjs +1 -0
  99. package/dist/{resolveSeriesPaletteColor-m8HQ9qwV.js → resolveSeriesPaletteColor-fuhGbjFO.js} +1 -1
  100. package/dist/{resolveStackedChartContext-DdraOueU.js → resolveStackedChartContext-BiIGZ2or.js} +5 -5
  101. package/dist/{resolveStackedChartContext-BywAnZUu.cjs → resolveStackedChartContext-Bp75eU_I.cjs} +1 -1
  102. package/dist/useHasListener-BPgtbbo6.cjs +1 -0
  103. package/dist/useHasListener-RSjlUyqH.js +8 -0
  104. package/dist/utils/chart/core/chartCssVariables.d.ts +2 -0
  105. package/dist/utils/chart/core/chartCssVariables.d.ts.map +1 -1
  106. package/dist/utils/chart/core/chartInteractivity.d.ts +41 -0
  107. package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -0
  108. package/dist/utils/chart/horizontalBar/buildHorizontalBarChartConfig.d.ts +2 -1
  109. package/dist/utils/chart/horizontalBar/buildHorizontalBarChartConfig.d.ts.map +1 -1
  110. package/package.json +3 -3
  111. package/dist/SChartBurnup-DYBnJMnm.js +0 -247
  112. package/dist/SChartHorizontalBar-DMBzyz9x.cjs +0 -1
  113. package/dist/SChartHorizontalBar-bm3Jexa3.js +0 -156
  114. package/dist/SChartLegend-Chr0IZWN.js +0 -30
  115. package/dist/SChartLegend-DXFXKXCm.cjs +0 -1
  116. package/dist/SChartLine-CiREb4H_.js +0 -125
  117. package/dist/SChartLine-P57XRR2o.cjs +0 -1
  118. package/dist/SChartMultiLine-3cdB0U12.js +0 -166
  119. package/dist/SChartMultiLine-BW1kITlR.cjs +0 -1
  120. package/dist/SChartPie-55wx2zRi.cjs +0 -1
  121. package/dist/SChartPie-Dc_gjzIl.js +0 -143
  122. package/dist/SChartSkeletonHost-CfM0zolj.cjs +0 -1
  123. package/dist/SChartStackedArea-BaJ963lU.cjs +0 -1
  124. package/dist/SChartStackedArea-cjN9gECV.js +0 -219
  125. package/dist/SChartStackedBar-0jGICBA0.js +0 -217
  126. package/dist/SChartStackedBar-j9WyOnsL.cjs +0 -1
  127. package/dist/SList-BtfUntkw.js +0 -437
  128. package/dist/SList-fZQdPkFG.cjs +0 -1
  129. package/dist/resolveSeriesPaletteColor-BcFyrhh0.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [@shtabapp/ui-kit-v1.47.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.46.0...@shtabapp/ui-kit@1.47.0) (2026-07-14)
2
+
3
+ ### Features
4
+
5
+ - load more subtree ([61b17e9](https://gitlab.com/mstikharev/shtab-ui-kit/commit/61b17e9fb1db17f6d5a86e359de937279a44f81f))
6
+
7
+ ## [@shtabapp/ui-kit-v1.46.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.45.0...@shtabapp/ui-kit@1.46.0) (2026-07-13)
8
+
9
+ ### Features
10
+
11
+ - chart fixes, hover interactive, widget implementation ([0e4681d](https://gitlab.com/mstikharev/shtab-ui-kit/commit/0e4681da9c0e3210dcab3cc062d32600225d4626))
12
+ - interactivity coment fixes ([a84eee5](https://gitlab.com/mstikharev/shtab-ui-kit/commit/a84eee50c6586200915f5e0d19a817124b1f2d33))
13
+
1
14
  ## [@shtabapp/ui-kit-v1.45.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.44.0...@shtabapp/ui-kit@1.45.0) (2026-07-10)
2
15
 
3
16
  ### Features
@@ -1 +1 @@
1
- const e=require("./createChartAreaFillGradient-BwsojVzU.cjs"),t=require("./SChartSkeletonHost-CfM0zolj.cjs"),n=require("./createChartCrosshairPlugin-HfMMUP5O.cjs"),r=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),i=require("./SChartLegend-DXFXKXCm.cjs");let a=require("vue");var o=(e,n)=>({id:`sUiChartBurnupTodayLine`,beforeDatasetsDraw(r){if(e<0)return;let{ctx:i,chartArea:a}=r,o=r.scales.x;if(!a||!o)return;let s=t.S(t.g.burnupToday,n),c=o.getPixelForValue(e);i.save(),i.beginPath(),i.moveTo(c,a.top),i.lineTo(c,a.bottom),i.lineWidth=1,i.strokeStyle=s,i.stroke(),i.restore()}}),s=8,c=4,l=5,u=12,d=12,f=60,p=12,m=e=>{if(typeof window>`u`)return`500 10px sans-serif`;let t=e??document.documentElement;return`500 10px ${getComputedStyle(t).getPropertyValue(`--s-ui-font-family-label`).trim()||`sans-serif`}`},h=(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()},g=({tagLines:e,factDatasetIndex:n,todayIndex:r},i)=>({id:`sUiChartBurnupTag`,afterDatasetsDraw(a){if(r<0||e.length===0)return;let o=a.getDatasetMeta(n)?.data[r],{chartArea:g}=a;if(!o||!g)return;let _=t.S(t.g.burnupToday,i),v=t.S(t.g.burnupTagBackground,i),{ctx:y}=a;y.save(),y.font=m(i),y.textAlign=`center`,y.textBaseline=`middle`;let b=e.reduce((e,t)=>Math.max(e,y.measureText(t).width),0),x=Math.max(f,b+s*2),S=e.length*d+c+l,C=Math.min(Math.max(o.x-x/2,g.left),g.right-x),w=Math.max(o.y-p-S,g.top);h(y,C,w,x,S,u),y.fillStyle=v,y.fill(),y.lineWidth=1,y.strokeStyle=_,y.stroke(),y.fillStyle=_,e.forEach((e,t)=>{y.fillText(e,C+x/2,w+c+d*(t+.5))}),y.restore()}}),_=(e,t)=>t>=0&&e>t,v=({todayIndex:e,futureLabel:t})=>({title:t=>{let n=t[0];return!n||_(n.dataIndex,e)?``:`${n.label}`},label:n=>_(n.dataIndex,e)?t:`${n.dataset.label??``}: ${n.parsed.y??0}%`}),y=e=>t=>!_(t.dataIndex,e)||t.datasetIndex===0,b=1,x=1,S=2,C=[8,8],w=[9,9],T=2,E=25,D=e=>e.reduce((e,t,n)=>t.fact===null?e:n,-1),O=(e,t,n)=>{let r=e.reduce((e,t)=>Math.max(e,t.plan,t.fact??0),t);return Math.ceil(r/n)*n},k=({points:i,colorHostElement:a,goalValue:s=100,goalLabel:c=`Цель`,planLabel:l=`План`,factLabel:u=`Факт`,futureLabel:d=`Этот день ещё не наступил`,yStep:f=E,mirrorYAxis:p=!0,showTag:m=!0,skeleton:h=!1})=>{if(i.length===0)return null;let _=t.S(t.g.axisLabel,a),k=t.S(t.g.grid,a),A=t.S(t.g.tooltipBackground,a),j=t.S(t.g.tooltipText,a),M=t.S(t.g.skeletonSeries,a),N=h?M:t.S(t.g.burnupGoal,a),P=h?M:t.S(t.g.burnupPlan,a),F=h?M:t.S(t.g.burnupFact,a),I=t.S(t.g.burnupFactFillStart,a),L=t.S(t.g.burnupFactFillEnd,a),R=D(i),z=R>=0?i[R]:void 0,B=z?[`${u.toLowerCase()} ${z.fact}%`,`${l.toLowerCase()} ${z.plan}%`]:[];return{type:`line`,data:{labels:i.map(e=>e.label),datasets:[{label:c,data:i.map(()=>s),borderColor:N,backgroundColor:N,borderWidth:b,borderDash:C,fill:!1,pointRadius:0,pointHoverRadius:0,tension:0},{label:l,data:i.map(e=>e.plan),borderColor:P,backgroundColor:P,borderWidth:x,borderDash:w,fill:!1,pointRadius:0,pointHoverRadius:0,tension:.4},{label:u,data:i.map(e=>e.fact??null),borderColor:F,backgroundColor:h?F:t=>e.t(t,I,L),borderWidth:S,fill:!h,spanGaps:!1,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.i(h,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.a(h),backgroundColor:A,titleColor:j,bodyColor:j,displayColors:!1,position:t.u,yAlign:`bottom`,xAlign:`center`,caretPadding:8,filter:y(R),callbacks:v({todayIndex:R,futureLabel:d})}},scales:r.t({axisLabelColor:_,gridColor:k,yMin:0,yMax:O(i,s,f),yStep:f,mirrorYAxis:p,formatYAxisTick:e=>`${e}%`})},plugins:t.o(h,[n.t(a),o(R,a),...m?[g({tagLines:B,factDatasetIndex:T,todayIndex:R},a)]:[]])}},A=[8,15,23,31,38,46,54,62,69,77,85,92,96,100],j=[5,10,16,22,28,34,40,45,50,54,57,60,null,null],M=A.map((e,t)=>({label:`Д${t+1}`,plan:e,fact:j[t]})),N={class:`s-ui-chart-burnup__canvas-wrap`},P=(0,a.defineComponent)({__name:`SChartBurnup`,props:{points:{default:()=>[]},loading:{type:Boolean,default:!1},goalValue:{default:100},goalLabel:{default:`Цель`},planLabel:{default:`План`},factLabel:{default:`Факт`},futureLabel:{default:`Этот день ещё не наступил`},yStep:{default:25},mirrorYAxis:{type:Boolean,default:!0},showTag:{type:Boolean,default:!0}},setup(e){let n=(0,a.useTemplateRef)(`chartRootRef`),r=(0,a.useTemplateRef)(`chartCanvasRef`),o=(0,a.computed)(()=>e.loading?M:e.points),s=(0,a.computed)(()=>!e.loading&&e.points.length===0?null:k({points:o.value,colorHostElement:n.value,goalValue:e.goalValue,goalLabel:e.goalLabel,planLabel:e.planLabel,factLabel:e.factLabel,futureLabel:e.futureLabel,yStep:e.yStep,mirrorYAxis:e.mirrorYAxis,showTag:e.showTag,skeleton:e.loading})),c=(0,a.computed)(()=>[{label:e.goalLabel,cssVariable:t.g.burnupGoal},{label:e.planLabel,cssVariable:t.g.burnupPlan},{label:e.factLabel,cssVariable:t.g.burnupFact}].map(r=>({label:r.label.toLowerCase(),color:t.S(e.loading?t.g.skeletonSeries:r.cssVariable,n.value)})));return t.r({canvasRef:r,config:s,enabled:(0,a.computed)(()=>e.loading||e.points.length>0)}),(o,s)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:n,class:(0,a.normalizeClass)([`s-ui-chart-burnup`,{"s-ui-chart-burnup--skeleton":e.loading}])},[(0,a.createElementVNode)(`div`,N,[(0,a.createVNode)((0,a.unref)(t.t),{loading:e.loading},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:r,class:`s-ui-chart-burnup__canvas`},null,512)]),_:1},8,[`loading`])]),(0,a.createVNode)((0,a.unref)(i.t),{items:c.value,disabled:e.loading},null,8,[`items`,`disabled`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}});
1
+ const e=require("./createChartAreaFillGradient-BwsojVzU.cjs"),t=require("./SChartSkeletonHost-BlIYGj-7.cjs"),n=require("./createChartCrosshairPlugin-DdLyEWI0.cjs"),r=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),i=require("./SChartLegend-DGtjd6zV.cjs");let a=require("vue");var o=(e,n)=>({id:`sUiChartBurnupTodayLine`,beforeDatasetsDraw(r){if(e<0)return;let{ctx:i,chartArea:a}=r,o=r.scales.x;if(!a||!o)return;let s=t.w(t.v.burnupToday,n),c=o.getPixelForValue(e);i.save(),i.beginPath(),i.moveTo(c,a.top),i.lineTo(c,a.bottom),i.lineWidth=1,i.strokeStyle=s,i.stroke(),i.restore()}}),s=8,c=4,l=5,u=12,d=12,f=60,p=12,m=e=>{if(typeof window>`u`)return`500 10px sans-serif`;let t=e??document.documentElement;return`500 10px ${getComputedStyle(t).getPropertyValue(`--s-ui-font-family-label`).trim()||`sans-serif`}`},h=(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()},g=({tagLines:e,factDatasetIndex:n,todayIndex:r},i)=>({id:`sUiChartBurnupTag`,afterDatasetsDraw(a){if(r<0||e.length===0)return;let o=a.getDatasetMeta(n)?.data[r],{chartArea:g}=a;if(!o||!g)return;let _=t.w(t.v.burnupToday,i),v=t.w(t.v.burnupTagBackground,i),{ctx:y}=a;y.save(),y.font=m(i),y.textAlign=`center`,y.textBaseline=`middle`;let b=e.reduce((e,t)=>Math.max(e,y.measureText(t).width),0),x=Math.max(f,b+s*2),S=e.length*d+c+l,C=Math.min(Math.max(o.x-x/2,g.left),g.right-x),w=Math.max(o.y-p-S,g.top);h(y,C,w,x,S,u),y.fillStyle=v,y.fill(),y.lineWidth=1,y.strokeStyle=_,y.stroke(),y.fillStyle=_,e.forEach((e,t)=>{y.fillText(e,C+x/2,w+c+d*(t+.5))}),y.restore()}}),_=(e,t)=>t>=0&&e>t,v=({todayIndex:e,futureLabel:t})=>({title:t=>{let n=t[0];return!n||_(n.dataIndex,e)?``:`${n.label}`},label:n=>_(n.dataIndex,e)?t:`${n.dataset.label??``}: ${n.parsed.y??0}%`}),y=e=>t=>!_(t.dataIndex,e)||t.datasetIndex===0,b=1,x=1,S=2,C=[8,8],w=[9,9],T=2,E=25,D=e=>e.reduce((e,t,n)=>t.fact===null?e:n,-1),O=(e,t,n)=>{let r=e.reduce((e,t)=>Math.max(e,t.plan,t.fact??0),t);return Math.ceil(r/n)*n},k=({points:i,colorHostElement:a,goalValue:s=100,goalLabel:c=`Цель`,planLabel:l=`План`,factLabel:u=`Факт`,futureLabel:d=`Этот день ещё не наступил`,yStep:f=E,mirrorYAxis:p=!0,showTag:m=!0,skeleton:h=!1})=>{if(i.length===0)return null;let _=t.w(t.v.axisLabel,a),k=t.w(t.v.grid,a),A=t.w(t.v.tooltipBackground,a),j=t.w(t.v.tooltipText,a),M=t.w(t.v.skeletonSeries,a),N=h?M:t.w(t.v.burnupGoal,a),P=h?M:t.w(t.v.burnupPlan,a),F=h?M:t.w(t.v.burnupFact,a),I=t.w(t.v.burnupFactFillStart,a),L=t.w(t.v.burnupFactFillEnd,a),R=D(i),z=R>=0?i[R]:void 0,B=z?[`${u.toLowerCase()} ${z.fact}%`,`${l.toLowerCase()} ${z.plan}%`]:[];return{type:`line`,data:{labels:i.map(e=>e.label),datasets:[{label:c,data:i.map(()=>s),borderColor:N,backgroundColor:N,borderWidth:b,borderDash:C,fill:!1,pointRadius:0,pointHoverRadius:0,tension:0},{label:l,data:i.map(e=>e.plan),borderColor:P,backgroundColor:P,borderWidth:x,borderDash:w,fill:!1,pointRadius:0,pointHoverRadius:0,tension:.4},{label:u,data:i.map(e=>e.fact??null),borderColor:F,backgroundColor:h?F:t=>e.t(t,I,L),borderWidth:S,fill:!h,spanGaps:!1,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.o(h,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.s(h),backgroundColor:A,titleColor:j,bodyColor:j,displayColors:!1,position:t.f,yAlign:`bottom`,xAlign:`center`,caretPadding:8,filter:y(R),callbacks:v({todayIndex:R,futureLabel:d})}},scales:r.t({axisLabelColor:_,gridColor:k,yMin:0,yMax:O(i,s,f),yStep:f,mirrorYAxis:p,formatYAxisTick:e=>`${e}%`})},plugins:t.c(h,[n.t(a),o(R,a),...m?[g({tagLines:B,factDatasetIndex:T,todayIndex:R},a)]:[]])}},A=[8,15,23,31,38,46,54,62,69,77,85,92,96,100],j=[5,10,16,22,28,34,40,45,50,54,57,60,null,null],M=A.map((e,t)=>({label:`Д${t+1}`,plan:e,fact:j[t]})),N={class:`s-ui-chart-burnup__canvas-wrap`},P=(0,a.defineComponent)({__name:`SChartBurnup`,props:{points:{default:()=>[]},loading:{type:Boolean,default:!1},goalValue:{default:100},goalLabel:{default:`Цель`},planLabel:{default:`План`},factLabel:{default:`Факт`},futureLabel:{default:`Этот день ещё не наступил`},yStep:{default:25},mirrorYAxis:{type:Boolean,default:!0},showTag:{type:Boolean,default:!0}},setup(e,{expose:n}){let r=(0,a.useTemplateRef)(`chartRootRef`),o=(0,a.useTemplateRef)(`chartCanvasRef`),s=(0,a.computed)(()=>e.loading?M:e.points),c=(0,a.computed)(()=>!e.loading&&e.points.length===0?null:k({points:s.value,colorHostElement:r.value,goalValue:e.goalValue,goalLabel:e.goalLabel,planLabel:e.planLabel,factLabel:e.factLabel,futureLabel:e.futureLabel,yStep:e.yStep,mirrorYAxis:e.mirrorYAxis,showTag:e.showTag,skeleton:e.loading})),l=(0,a.computed)(()=>[{label:e.goalLabel,cssVariable:t.v.burnupGoal},{label:e.planLabel,cssVariable:t.v.burnupPlan},{label:e.factLabel,cssVariable:t.v.burnupFact}].map(n=>({label:n.label.toLowerCase(),color:t.w(e.loading?t.v.skeletonSeries:n.cssVariable,r.value)}))),{chartInstance:u}=t.i({canvasRef:o,config:c,enabled:(0,a.computed)(()=>e.loading||e.points.length>0)}),{exportImage:d}=t.r({chartInstance:u,canvasRef:o,colorHostElement:r});return n({exportImage:d}),(n,s)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:r,class:(0,a.normalizeClass)([`s-ui-chart-burnup`,{"s-ui-chart-burnup--skeleton":e.loading}])},[(0,a.createElementVNode)(`div`,N,[(0,a.createVNode)((0,a.unref)(t.t),{loading:e.loading},{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:o,class:`s-ui-chart-burnup__canvas`},null,512)]),_:1},8,[`loading`])]),(0,a.createVNode)((0,a.unref)(i.t),{items:l.value,disabled:e.loading},null,8,[`items`,`disabled`])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return P}});
@@ -0,0 +1,251 @@
1
+ import { t as e } from "./createChartAreaFillGradient-BDmME9Gy.js";
2
+ import { c as t, f as n, i as r, o as i, r as a, s as o, t as s, v as c, w as l } from "./SChartSkeletonHost-DSFyP_DN.js";
3
+ import { t as u } from "./createChartCrosshairPlugin-q3U4ePnf.js";
4
+ import { t as d } from "./buildMultiLineChartScales-CFZ8YVeJ.js";
5
+ import { t as f } from "./SChartLegend-oZoF8XK7.js";
6
+ import { computed as p, createElementBlock as m, createElementVNode as h, createVNode as g, defineComponent as _, normalizeClass as v, openBlock as y, unref as b, useTemplateRef as x, withCtx as S } from "vue";
7
+ //#region src/utils/chart/burnup/createBurnupTodayLinePlugin.ts
8
+ var C = (e, t) => ({
9
+ id: "sUiChartBurnupTodayLine",
10
+ beforeDatasetsDraw(n) {
11
+ if (e < 0) return;
12
+ let { ctx: r, chartArea: i } = n, a = n.scales.x;
13
+ if (!i || !a) return;
14
+ let o = l(c.burnupToday, t), s = a.getPixelForValue(e);
15
+ r.save(), r.beginPath(), r.moveTo(s, i.top), r.lineTo(s, i.bottom), r.lineWidth = 1, r.strokeStyle = o, r.stroke(), r.restore();
16
+ }
17
+ }), w = 8, T = 4, E = 5, D = 12, O = 12, k = 60, A = 12, j = (e) => {
18
+ if (typeof window > "u") return "500 10px sans-serif";
19
+ let t = e ?? document.documentElement;
20
+ return `500 10px ${getComputedStyle(t).getPropertyValue("--s-ui-font-family-label").trim() || "sans-serif"}`;
21
+ }, M = (e, t, n, r, i, a) => {
22
+ let o = Math.min(a, r / 2, i / 2);
23
+ 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();
24
+ }, N = ({ tagLines: e, factDatasetIndex: t, todayIndex: n }, r) => ({
25
+ id: "sUiChartBurnupTag",
26
+ afterDatasetsDraw(i) {
27
+ if (n < 0 || e.length === 0) return;
28
+ let a = i.getDatasetMeta(t)?.data[n], { chartArea: o } = i;
29
+ if (!a || !o) return;
30
+ let s = l(c.burnupToday, r), u = l(c.burnupTagBackground, r), { ctx: d } = i;
31
+ d.save(), d.font = j(r), d.textAlign = "center", d.textBaseline = "middle";
32
+ let f = e.reduce((e, t) => Math.max(e, d.measureText(t).width), 0), p = Math.max(k, f + w * 2), m = e.length * O + T + E, h = Math.min(Math.max(a.x - p / 2, o.left), o.right - p), g = Math.max(a.y - A - m, o.top);
33
+ M(d, h, g, p, m, D), d.fillStyle = u, d.fill(), d.lineWidth = 1, d.strokeStyle = s, d.stroke(), d.fillStyle = s, e.forEach((e, t) => {
34
+ d.fillText(e, h + p / 2, g + T + O * (t + .5));
35
+ }), d.restore();
36
+ }
37
+ }), P = (e, t) => t >= 0 && e > t, F = ({ todayIndex: e, futureLabel: t }) => ({
38
+ title: (t) => {
39
+ let n = t[0];
40
+ return !n || P(n.dataIndex, e) ? "" : `${n.label}`;
41
+ },
42
+ label: (n) => P(n.dataIndex, e) ? t : `${n.dataset.label ?? ""}: ${n.parsed.y ?? 0}%`
43
+ }), I = (e) => (t) => !P(t.dataIndex, e) || t.datasetIndex === 0, L = 1, R = 1, z = 2, B = [8, 8], V = [9, 9], H = 2, U = 25, W = (e) => e.reduce((e, t, n) => t.fact === null ? e : n, -1), G = (e, t, n) => {
44
+ let r = e.reduce((e, t) => Math.max(e, t.plan, t.fact ?? 0), t);
45
+ return Math.ceil(r / n) * n;
46
+ }, K = ({ points: r, colorHostElement: a, goalValue: s = 100, goalLabel: f = "Цель", planLabel: p = "План", factLabel: m = "Факт", futureLabel: h = "Этот день ещё не наступил", yStep: g = U, mirrorYAxis: _ = !0, showTag: v = !0, skeleton: y = !1 }) => {
47
+ if (r.length === 0) return null;
48
+ let b = l(c.axisLabel, a), x = l(c.grid, a), S = l(c.tooltipBackground, a), w = l(c.tooltipText, a), T = l(c.skeletonSeries, a), E = y ? T : l(c.burnupGoal, a), D = y ? T : l(c.burnupPlan, a), O = y ? T : l(c.burnupFact, a), k = l(c.burnupFactFillStart, a), A = l(c.burnupFactFillEnd, a), j = W(r), M = j >= 0 ? r[j] : void 0, P = M ? [`${m.toLowerCase()} ${M.fact}%`, `${p.toLowerCase()} ${M.plan}%`] : [];
49
+ return {
50
+ type: "line",
51
+ data: {
52
+ labels: r.map((e) => e.label),
53
+ datasets: [
54
+ {
55
+ label: f,
56
+ data: r.map(() => s),
57
+ borderColor: E,
58
+ backgroundColor: E,
59
+ borderWidth: L,
60
+ borderDash: B,
61
+ fill: !1,
62
+ pointRadius: 0,
63
+ pointHoverRadius: 0,
64
+ tension: 0
65
+ },
66
+ {
67
+ label: p,
68
+ data: r.map((e) => e.plan),
69
+ borderColor: D,
70
+ backgroundColor: D,
71
+ borderWidth: R,
72
+ borderDash: V,
73
+ fill: !1,
74
+ pointRadius: 0,
75
+ pointHoverRadius: 0,
76
+ tension: .4
77
+ },
78
+ {
79
+ label: m,
80
+ data: r.map((e) => e.fact ?? null),
81
+ borderColor: O,
82
+ backgroundColor: y ? O : (t) => e(t, k, A),
83
+ borderWidth: z,
84
+ fill: !y,
85
+ spanGaps: !1,
86
+ pointRadius: 0,
87
+ pointHoverRadius: 4,
88
+ tension: .4
89
+ }
90
+ ]
91
+ },
92
+ options: {
93
+ responsive: !0,
94
+ maintainAspectRatio: !1,
95
+ interaction: i(y, {
96
+ mode: "index",
97
+ intersect: !1
98
+ }),
99
+ plugins: {
100
+ legend: { display: !1 },
101
+ tooltip: {
102
+ enabled: o(y),
103
+ backgroundColor: S,
104
+ titleColor: w,
105
+ bodyColor: w,
106
+ displayColors: !1,
107
+ position: n,
108
+ yAlign: "bottom",
109
+ xAlign: "center",
110
+ caretPadding: 8,
111
+ filter: I(j),
112
+ callbacks: F({
113
+ todayIndex: j,
114
+ futureLabel: h
115
+ })
116
+ }
117
+ },
118
+ scales: d({
119
+ axisLabelColor: b,
120
+ gridColor: x,
121
+ yMin: 0,
122
+ yMax: G(r, s, g),
123
+ yStep: g,
124
+ mirrorYAxis: _,
125
+ formatYAxisTick: (e) => `${e}%`
126
+ })
127
+ },
128
+ plugins: t(y, [
129
+ u(a),
130
+ C(j, a),
131
+ ...v ? [N({
132
+ tagLines: P,
133
+ factDatasetIndex: H,
134
+ todayIndex: j
135
+ }, a)] : []
136
+ ])
137
+ };
138
+ }, q = [
139
+ 8,
140
+ 15,
141
+ 23,
142
+ 31,
143
+ 38,
144
+ 46,
145
+ 54,
146
+ 62,
147
+ 69,
148
+ 77,
149
+ 85,
150
+ 92,
151
+ 96,
152
+ 100
153
+ ], J = [
154
+ 5,
155
+ 10,
156
+ 16,
157
+ 22,
158
+ 28,
159
+ 34,
160
+ 40,
161
+ 45,
162
+ 50,
163
+ 54,
164
+ 57,
165
+ 60,
166
+ null,
167
+ null
168
+ ], Y = q.map((e, t) => ({
169
+ label: `Д${t + 1}`,
170
+ plan: e,
171
+ fact: J[t]
172
+ })), X = { class: "s-ui-chart-burnup__canvas-wrap" }, Z = /* @__PURE__ */ _({
173
+ __name: "SChartBurnup",
174
+ props: {
175
+ points: { default: () => [] },
176
+ loading: {
177
+ type: Boolean,
178
+ default: !1
179
+ },
180
+ goalValue: { default: 100 },
181
+ goalLabel: { default: "Цель" },
182
+ planLabel: { default: "План" },
183
+ factLabel: { default: "Факт" },
184
+ futureLabel: { default: "Этот день ещё не наступил" },
185
+ yStep: { default: 25 },
186
+ mirrorYAxis: {
187
+ type: Boolean,
188
+ default: !0
189
+ },
190
+ showTag: {
191
+ type: Boolean,
192
+ default: !0
193
+ }
194
+ },
195
+ setup(e, { expose: t }) {
196
+ let n = x("chartRootRef"), i = x("chartCanvasRef"), o = p(() => e.loading ? Y : e.points), u = p(() => !e.loading && e.points.length === 0 ? null : K({
197
+ points: o.value,
198
+ colorHostElement: n.value,
199
+ goalValue: e.goalValue,
200
+ goalLabel: e.goalLabel,
201
+ planLabel: e.planLabel,
202
+ factLabel: e.factLabel,
203
+ futureLabel: e.futureLabel,
204
+ yStep: e.yStep,
205
+ mirrorYAxis: e.mirrorYAxis,
206
+ showTag: e.showTag,
207
+ skeleton: e.loading
208
+ })), d = p(() => [
209
+ {
210
+ label: e.goalLabel,
211
+ cssVariable: c.burnupGoal
212
+ },
213
+ {
214
+ label: e.planLabel,
215
+ cssVariable: c.burnupPlan
216
+ },
217
+ {
218
+ label: e.factLabel,
219
+ cssVariable: c.burnupFact
220
+ }
221
+ ].map((t) => ({
222
+ label: t.label.toLowerCase(),
223
+ color: l(e.loading ? c.skeletonSeries : t.cssVariable, n.value)
224
+ }))), { chartInstance: _ } = r({
225
+ canvasRef: i,
226
+ config: u,
227
+ enabled: p(() => e.loading || e.points.length > 0)
228
+ }), { exportImage: C } = a({
229
+ chartInstance: _,
230
+ canvasRef: i,
231
+ colorHostElement: n
232
+ });
233
+ return t({ exportImage: C }), (t, r) => (y(), m("div", {
234
+ ref_key: "chartRootRef",
235
+ ref: n,
236
+ class: v(["s-ui-chart-burnup", { "s-ui-chart-burnup--skeleton": e.loading }])
237
+ }, [h("div", X, [g(b(s), { loading: e.loading }, {
238
+ default: S(() => [h("canvas", {
239
+ ref_key: "chartCanvasRef",
240
+ ref: i,
241
+ class: "s-ui-chart-burnup__canvas"
242
+ }, null, 512)]),
243
+ _: 1
244
+ }, 8, ["loading"])]), g(b(f), {
245
+ items: d.value,
246
+ disabled: e.loading
247
+ }, null, 8, ["items", "disabled"])], 2));
248
+ }
249
+ });
250
+ //#endregion
251
+ export { Z as t };
@@ -0,0 +1 @@
1
+ const e=require("./SChartSkeletonHost-BlIYGj-7.cjs"),t=require("./useHasListener-BPgtbbo6.cjs");let n=require("vue");var r=10,i=14,a=({axisLabelColor:e,categoryLabelColor:t,gridColor:n,xMin:a,xMax:o,xStep:s})=>({x:{type:`linear`,min:a,max:o,border:{display:!1},grid:{color:n,drawTicks:!1},ticks:{color:e,stepSize:s,font:{size:r,weight:500},padding:8}},y:{border:{display:!1},grid:{display:!1},ticks:{color:t,font:{size:i,weight:400},padding:8,crossAlign:`far`,autoSkip:!1}}}),o=(t,n,r)=>r?e.w(e.v.barHorizontalSkeletonFill,n):t?e.w(t,n):e.w(e.v.barHorizontalFillDefault,n),s=(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},c=10,l=0,u=36,d=4,f=({items:t,colorHostElement:n,xMax:r,xMin:i=l,xStep:f=c,skeleton:p=!1,onBarClick:m})=>{if(t.length===0)return null;let h=e.w(e.v.axisLabel,n),g=e.w(e.v.grid,n),_=e.w(e.v.tooltipBackground,n),v=e.w(e.v.tooltipText,n),y=e.w(p?e.v.barHorizontalCategoryLabelSkeleton:e.v.barHorizontalCategoryLabel,n),b=s(t,r,f),x=t.map(e=>o(e.color,n,p)),S=e.a({kind:`element`,skeleton:p,colorHostElement:n,onIndexClick:m});return{type:`bar`,data:{labels:t.map(e=>e.label),datasets:[{data:t.map(e=>e.value),backgroundColor:x,hoverBackgroundColor:x,borderWidth:0,hoverBorderWidth:0,barThickness:u,borderRadius:{topRight:d,bottomRight:d}}]},options:{indexAxis:`y`,responsive:!0,maintainAspectRatio:!1,onHover:S.onHover,onClick:S.onClick,interaction:e.o(p,{mode:`index`,axis:`y`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(p),backgroundColor:_,titleColor:v,bodyColor:v}},scales:a({axisLabelColor:h,categoryLabelColor:y,gridColor:g,xMin:i,xMax:b,xStep:f})},plugins:S.plugins}},p=e=>f(e),m=[{label:`Открыта`,value:48},{label:`В процессе`,value:32},{label:`Ревью`,value:53},{label:`Готова для QA`,value:18},{label:`QA`,value:25},{label:`Готова`,value:0}],h={class:`s-ui-chart-horizontal-bar__canvas-wrap`},g=(0,n.defineComponent)({__name:`SChartHorizontalBar`,props:{items:{default:()=>[]},loading:{type:Boolean,default:!1},xMin:{},xMax:{},xStep:{}},emits:[`barClick`],setup(r,{expose:i,emit:a}){let o=a,s=(0,n.useTemplateRef)(`chartRootRef`),c=(0,n.useTemplateRef)(`chartCanvasRef`),l=(0,n.computed)(()=>r.loading?m:r.items),u=e=>{let t=r.items[e];t&&o(`barClick`,e,t)},d=t.t(`onBarClick`),{chartInstance:f}=e.i({canvasRef:c,config:(0,n.computed)(()=>!r.loading&&r.items.length===0?null:p({items:l.value,colorHostElement:s.value,xMax:r.loading?60:r.xMax,xMin:r.loading?0:r.xMin,xStep:r.loading?10:r.xStep,skeleton:r.loading,onBarClick:d()?u:void 0})),enabled:(0,n.computed)(()=>r.loading||r.items.length>0)}),{exportImage:g}=e.r({chartInstance:f,canvasRef:c,colorHostElement:s});return i({exportImage:g}),(t,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:s,class:(0,n.normalizeClass)([`s-ui-chart-horizontal-bar`,{"s-ui-chart-horizontal-bar--skeleton":r.loading}])},[(0,n.createElementVNode)(`div`,h,[(0,n.createVNode)((0,n.unref)(e.t),{loading:r.loading},{default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:c,class:`s-ui-chart-horizontal-bar__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
@@ -0,0 +1,175 @@
1
+ import { a as e, i as t, o as n, r, s as i, t as a, v as o, w as s } from "./SChartSkeletonHost-DSFyP_DN.js";
2
+ import { t as c } from "./useHasListener-RSjlUyqH.js";
3
+ import { computed as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, unref as g, useTemplateRef as _, withCtx as v } from "vue";
4
+ //#region src/utils/chart/horizontalBar/buildHorizontalBarChartScales.ts
5
+ var y = 10, b = 14, x = ({ axisLabelColor: e, categoryLabelColor: t, gridColor: n, xMin: r, xMax: i, xStep: a }) => ({
6
+ x: {
7
+ type: "linear",
8
+ min: r,
9
+ max: i,
10
+ border: { display: !1 },
11
+ grid: {
12
+ color: n,
13
+ drawTicks: !1
14
+ },
15
+ ticks: {
16
+ color: e,
17
+ stepSize: a,
18
+ font: {
19
+ size: y,
20
+ weight: 500
21
+ },
22
+ padding: 8
23
+ }
24
+ },
25
+ y: {
26
+ border: { display: !1 },
27
+ grid: { display: !1 },
28
+ ticks: {
29
+ color: t,
30
+ font: {
31
+ size: b,
32
+ weight: 400
33
+ },
34
+ padding: 8,
35
+ crossAlign: "far",
36
+ autoSkip: !1
37
+ }
38
+ }
39
+ }), S = (e, t, n) => s(n ? o.barHorizontalSkeletonFill : e || o.barHorizontalFillDefault, t), C = (e, t, n) => {
40
+ if (t) return t;
41
+ let r = 0;
42
+ for (let t of e) r = Math.max(r, t.value);
43
+ let i = Math.ceil(r / n) * n;
44
+ return i > 0 ? i : n * 6;
45
+ }, w = 10, T = 0, E = 36, D = 4, O = ({ items: t, colorHostElement: r, xMax: a, xMin: c = T, xStep: l = w, skeleton: u = !1, onBarClick: d }) => {
46
+ if (t.length === 0) return null;
47
+ let f = s(o.axisLabel, r), p = s(o.grid, r), m = s(o.tooltipBackground, r), h = s(o.tooltipText, r), g = s(u ? o.barHorizontalCategoryLabelSkeleton : o.barHorizontalCategoryLabel, r), _ = C(t, a, l), v = t.map((e) => S(e.color, r, u)), y = e({
48
+ kind: "element",
49
+ skeleton: u,
50
+ colorHostElement: r,
51
+ onIndexClick: d
52
+ });
53
+ return {
54
+ type: "bar",
55
+ data: {
56
+ labels: t.map((e) => e.label),
57
+ datasets: [{
58
+ data: t.map((e) => e.value),
59
+ backgroundColor: v,
60
+ hoverBackgroundColor: v,
61
+ borderWidth: 0,
62
+ hoverBorderWidth: 0,
63
+ barThickness: E,
64
+ borderRadius: {
65
+ topRight: D,
66
+ bottomRight: D
67
+ }
68
+ }]
69
+ },
70
+ options: {
71
+ indexAxis: "y",
72
+ responsive: !0,
73
+ maintainAspectRatio: !1,
74
+ onHover: y.onHover,
75
+ onClick: y.onClick,
76
+ interaction: n(u, {
77
+ mode: "index",
78
+ axis: "y",
79
+ intersect: !1
80
+ }),
81
+ plugins: {
82
+ legend: { display: !1 },
83
+ tooltip: {
84
+ enabled: i(u),
85
+ backgroundColor: m,
86
+ titleColor: h,
87
+ bodyColor: h
88
+ }
89
+ },
90
+ scales: x({
91
+ axisLabelColor: f,
92
+ categoryLabelColor: g,
93
+ gridColor: p,
94
+ xMin: c,
95
+ xMax: _,
96
+ xStep: l
97
+ })
98
+ },
99
+ plugins: y.plugins
100
+ };
101
+ }, k = (e) => O(e), A = [
102
+ {
103
+ label: "Открыта",
104
+ value: 48
105
+ },
106
+ {
107
+ label: "В процессе",
108
+ value: 32
109
+ },
110
+ {
111
+ label: "Ревью",
112
+ value: 53
113
+ },
114
+ {
115
+ label: "Готова для QA",
116
+ value: 18
117
+ },
118
+ {
119
+ label: "QA",
120
+ value: 25
121
+ },
122
+ {
123
+ label: "Готова",
124
+ value: 0
125
+ }
126
+ ], j = { class: "s-ui-chart-horizontal-bar__canvas-wrap" }, M = /* @__PURE__ */ p({
127
+ __name: "SChartHorizontalBar",
128
+ props: {
129
+ items: { default: () => [] },
130
+ loading: {
131
+ type: Boolean,
132
+ default: !1
133
+ },
134
+ xMin: {},
135
+ xMax: {},
136
+ xStep: {}
137
+ },
138
+ emits: ["barClick"],
139
+ setup(e, { expose: n, emit: i }) {
140
+ let o = i, s = _("chartRootRef"), p = _("chartCanvasRef"), y = l(() => e.loading ? A : e.items), b = (t) => {
141
+ let n = e.items[t];
142
+ n && o("barClick", t, n);
143
+ }, x = c("onBarClick"), { chartInstance: S } = t({
144
+ canvasRef: p,
145
+ config: l(() => !e.loading && e.items.length === 0 ? null : k({
146
+ items: y.value,
147
+ colorHostElement: s.value,
148
+ xMax: e.loading ? 60 : e.xMax,
149
+ xMin: e.loading ? 0 : e.xMin,
150
+ xStep: e.loading ? 10 : e.xStep,
151
+ skeleton: e.loading,
152
+ onBarClick: x() ? b : void 0
153
+ })),
154
+ enabled: l(() => e.loading || e.items.length > 0)
155
+ }), { exportImage: C } = r({
156
+ chartInstance: S,
157
+ canvasRef: p,
158
+ colorHostElement: s
159
+ });
160
+ return n({ exportImage: C }), (t, n) => (h(), u("div", {
161
+ ref_key: "chartRootRef",
162
+ ref: s,
163
+ class: m(["s-ui-chart-horizontal-bar", { "s-ui-chart-horizontal-bar--skeleton": e.loading }])
164
+ }, [d("div", j, [f(g(a), { loading: e.loading }, {
165
+ default: v(() => [d("canvas", {
166
+ ref_key: "chartCanvasRef",
167
+ ref: p,
168
+ class: "s-ui-chart-horizontal-bar__canvas"
169
+ }, null, 512)]),
170
+ _: 1
171
+ }, 8, ["loading"])])], 2));
172
+ }
173
+ });
174
+ //#endregion
175
+ export { M as t };
@@ -0,0 +1 @@
1
+ let e=require("vue");var t=[`onMouseenter`],n={class:`s-ui-chart-legend__swatch-slot`,"aria-hidden":`true`},r={class:`s-ui-chart-legend__label`},i=(0,e.defineComponent)({__name:`SChartLegend`,props:{items:{},disabled:{type:Boolean,default:!1},direction:{default:`row`},interactive:{type:Boolean,default:!1}},emits:[`itemHover`],setup(i,{emit:a}){let o=a,s=e=>{i.interactive&&o(`itemHover`,e)};return(a,o)=>((0,e.openBlock)(),(0,e.createElementBlock)(`ul`,{class:(0,e.normalizeClass)([`s-ui-chart-legend`,{"s-ui-chart-legend--disabled":i.disabled,"s-ui-chart-legend--column":i.direction===`column`}]),onMouseleave:o[0]||=e=>s(null)},[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(i.items,(i,a)=>((0,e.openBlock)(),(0,e.createElementBlock)(`li`,{key:i.label,class:`s-ui-chart-legend__item`,onMouseenter:e=>s(a)},[(0,e.createElementVNode)(`span`,n,[(0,e.createElementVNode)(`span`,{class:`s-ui-chart-legend__swatch`,style:(0,e.normalizeStyle)({backgroundColor:i.color})},null,4)]),(0,e.createElementVNode)(`span`,r,`— `+(0,e.toDisplayString)(i.label),1)],40,t))),128))],34))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1,42 @@
1
+ import { Fragment as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, normalizeStyle as a, openBlock as o, renderList as s, toDisplayString as c } from "vue";
2
+ //#region src/components/SChartLegend/SChartLegend.vue?vue&type=script&setup=true&lang.ts
3
+ var l = ["onMouseenter"], u = {
4
+ class: "s-ui-chart-legend__swatch-slot",
5
+ "aria-hidden": "true"
6
+ }, d = { class: "s-ui-chart-legend__label" }, f = /* @__PURE__ */ r({
7
+ __name: "SChartLegend",
8
+ props: {
9
+ items: {},
10
+ disabled: {
11
+ type: Boolean,
12
+ default: !1
13
+ },
14
+ direction: { default: "row" },
15
+ interactive: {
16
+ type: Boolean,
17
+ default: !1
18
+ }
19
+ },
20
+ emits: ["itemHover"],
21
+ setup(r, { emit: f }) {
22
+ let p = f, m = (e) => {
23
+ r.interactive && p("itemHover", e);
24
+ };
25
+ return (f, p) => (o(), t("ul", {
26
+ class: i(["s-ui-chart-legend", {
27
+ "s-ui-chart-legend--disabled": r.disabled,
28
+ "s-ui-chart-legend--column": r.direction === "column"
29
+ }]),
30
+ onMouseleave: p[0] ||= (e) => m(null)
31
+ }, [(o(!0), t(e, null, s(r.items, (e, r) => (o(), t("li", {
32
+ key: e.label,
33
+ class: "s-ui-chart-legend__item",
34
+ onMouseenter: (e) => m(r)
35
+ }, [n("span", u, [n("span", {
36
+ class: "s-ui-chart-legend__swatch",
37
+ style: a({ backgroundColor: e.color })
38
+ }, null, 4)]), n("span", d, "— " + c(e.label), 1)], 40, l))), 128))], 34));
39
+ }
40
+ });
41
+ //#endregion
42
+ export { f as t };
@@ -0,0 +1 @@
1
+ const e=require("./createChartAreaFillGradient-BwsojVzU.cjs"),t=require("./SChartSkeletonHost-BlIYGj-7.cjs"),n=require("./buildCartesianChartScales-Dck5yBMo.cjs");let r=require("vue");var 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=5,o=5,s=(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},c=(e,t)=>!t||typeof e!=`number`?e:`${e}%`,l=({points:r,seriesLabel:l,colorHostElement:u,yMax:d,yMin:f,yStep:p=o,skeleton:m=!1})=>{let h=t.w(t.v.axisLabel,u),g=t.w(t.v.grid,u),_=t.w(m?t.v.skeletonSeries:t.v.seriesPrimary,u),v=t.w(m?t.v.skeletonFillStart:t.v.seriesFillStart,u),y=t.w(m?t.v.skeletonFillEnd:t.v.seriesFillEnd,u),b=t.w(t.v.tooltipBackground,u),x=t.w(t.v.tooltipText,u),S=i(m?t.v.skeletonFillOpacity:t.v.seriesFillOpacity,u,.8),C=m&&d?d:s(r,d,p),w=m&&f!==void 0?f:0;return{type:`line`,data:{labels:r.map(e=>e.label),datasets:[{label:l,data:r.map(e=>e.value),borderColor:_,backgroundColor:t=>e.t(t,v,y,S),borderWidth:a,fill:!0,pointRadius:0,pointHoverRadius:4,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:t.o(m,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:t.s(m),backgroundColor:b,titleColor:x,bodyColor:x,displayColors:!1}},scales:n.t({axisLabelColor:h,gridColor:g,yMin:w,yMax:C,yStep:p,formatYAxisTick:e=>c(e,m)})}}},u=[{label:`ноябрь 2025`,value:63},{label:`декабрь 2025`,value:77},{label:`январь 2026`,value:75},{label:`февраль 2026`,value:81},{label:`март 2026`,value:91},{label:`апрель 2026`,value:87}],d={class:`s-ui-chart-line__canvas-wrap`},f=(0,r.defineComponent)({__name:`SChartLine`,props:{points:{default:()=>[]},seriesLabel:{default:`Series`},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},setup(e,{expose:n}){let i=(0,r.useTemplateRef)(`chartRootRef`),a=(0,r.useTemplateRef)(`chartCanvasRef`),o=(0,r.computed)(()=>e.loading?u:e.points),{chartInstance:s}=t.i({canvasRef:a,config:(0,r.computed)(()=>!e.loading&&e.points.length===0?null:l({points:o.value,seriesLabel:e.seriesLabel,colorHostElement:i.value,yMax:e.loading?100:e.yMax,yMin:e.loading?50:void 0,yStep:e.loading?10:e.yStep,skeleton:e.loading})),enabled:(0,r.computed)(()=>e.loading||e.points.length>0)}),{exportImage:c}=t.r({chartInstance:s,canvasRef:a,colorHostElement:i});return n({exportImage:c}),(n,o)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:i,class:(0,r.normalizeClass)([`s-ui-chart-line`,{"s-ui-chart-line--skeleton":e.loading}])},[(0,r.createElementVNode)(`div`,d,[(0,r.createVNode)((0,r.unref)(t.t),{loading:e.loading},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:a,class:`s-ui-chart-line__canvas`},null,512)]),_:1},8,[`loading`])])],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -0,0 +1,129 @@
1
+ import { t as e } from "./createChartAreaFillGradient-BDmME9Gy.js";
2
+ import { i as t, o as n, r, s as i, t as a, v as o, w as s } from "./SChartSkeletonHost-DSFyP_DN.js";
3
+ import { t as c } from "./buildCartesianChartScales-EofFq3ry.js";
4
+ import { computed as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, unref as g, useTemplateRef as _, withCtx as v } from "vue";
5
+ //#region src/utils/chart/css/readCssNumber.ts
6
+ var y = (e, t, n = 1) => {
7
+ if (typeof window > "u") return n;
8
+ let r = t ?? document.documentElement, i = getComputedStyle(r).getPropertyValue(e).trim(), a = Number.parseFloat(i);
9
+ return Number.isNaN(a) ? n : a;
10
+ }, b = 5, x = 5, S = (e, t, n) => {
11
+ if (t) return t;
12
+ let r = e.reduce((e, t) => Math.max(e, t.value), 0), i = Math.ceil(r / n) * n;
13
+ return i > 0 ? i : n * 5;
14
+ }, C = (e, t) => !t || typeof e != "number" ? e : `${e}%`, w = ({ points: t, seriesLabel: r, colorHostElement: a, yMax: l, yMin: u, yStep: d = x, skeleton: f = !1 }) => {
15
+ let p = s(o.axisLabel, a), m = s(o.grid, a), h = s(f ? o.skeletonSeries : o.seriesPrimary, a), g = s(f ? o.skeletonFillStart : o.seriesFillStart, a), _ = s(f ? o.skeletonFillEnd : o.seriesFillEnd, a), v = s(o.tooltipBackground, a), w = s(o.tooltipText, a), T = y(f ? o.skeletonFillOpacity : o.seriesFillOpacity, a, .8), E = f && l ? l : S(t, l, d), D = f && u !== void 0 ? u : 0;
16
+ return {
17
+ type: "line",
18
+ data: {
19
+ labels: t.map((e) => e.label),
20
+ datasets: [{
21
+ label: r,
22
+ data: t.map((e) => e.value),
23
+ borderColor: h,
24
+ backgroundColor: (t) => e(t, g, _, T),
25
+ borderWidth: b,
26
+ fill: !0,
27
+ pointRadius: 0,
28
+ pointHoverRadius: 4,
29
+ tension: .4
30
+ }]
31
+ },
32
+ options: {
33
+ responsive: !0,
34
+ maintainAspectRatio: !1,
35
+ interaction: n(f, {
36
+ mode: "index",
37
+ intersect: !1
38
+ }),
39
+ plugins: {
40
+ legend: { display: !1 },
41
+ tooltip: {
42
+ enabled: i(f),
43
+ backgroundColor: v,
44
+ titleColor: w,
45
+ bodyColor: w,
46
+ displayColors: !1
47
+ }
48
+ },
49
+ scales: c({
50
+ axisLabelColor: p,
51
+ gridColor: m,
52
+ yMin: D,
53
+ yMax: E,
54
+ yStep: d,
55
+ formatYAxisTick: (e) => C(e, f)
56
+ })
57
+ }
58
+ };
59
+ }, T = [
60
+ {
61
+ label: "ноябрь 2025",
62
+ value: 63
63
+ },
64
+ {
65
+ label: "декабрь 2025",
66
+ value: 77
67
+ },
68
+ {
69
+ label: "январь 2026",
70
+ value: 75
71
+ },
72
+ {
73
+ label: "февраль 2026",
74
+ value: 81
75
+ },
76
+ {
77
+ label: "март 2026",
78
+ value: 91
79
+ },
80
+ {
81
+ label: "апрель 2026",
82
+ value: 87
83
+ }
84
+ ], E = { class: "s-ui-chart-line__canvas-wrap" }, D = /* @__PURE__ */ p({
85
+ __name: "SChartLine",
86
+ props: {
87
+ points: { default: () => [] },
88
+ seriesLabel: { default: "Series" },
89
+ loading: {
90
+ type: Boolean,
91
+ default: !1
92
+ },
93
+ yMax: {},
94
+ yStep: {}
95
+ },
96
+ setup(e, { expose: n }) {
97
+ let i = _("chartRootRef"), o = _("chartCanvasRef"), s = l(() => e.loading ? T : e.points), { chartInstance: c } = t({
98
+ canvasRef: o,
99
+ config: l(() => !e.loading && e.points.length === 0 ? null : w({
100
+ points: s.value,
101
+ seriesLabel: e.seriesLabel,
102
+ colorHostElement: i.value,
103
+ yMax: e.loading ? 100 : e.yMax,
104
+ yMin: e.loading ? 50 : void 0,
105
+ yStep: e.loading ? 10 : e.yStep,
106
+ skeleton: e.loading
107
+ })),
108
+ enabled: l(() => e.loading || e.points.length > 0)
109
+ }), { exportImage: p } = r({
110
+ chartInstance: c,
111
+ canvasRef: o,
112
+ colorHostElement: i
113
+ });
114
+ return n({ exportImage: p }), (t, n) => (h(), u("div", {
115
+ ref_key: "chartRootRef",
116
+ ref: i,
117
+ class: m(["s-ui-chart-line", { "s-ui-chart-line--skeleton": e.loading }])
118
+ }, [d("div", E, [f(g(a), { loading: e.loading }, {
119
+ default: v(() => [d("canvas", {
120
+ ref_key: "chartCanvasRef",
121
+ ref: o,
122
+ class: "s-ui-chart-line__canvas"
123
+ }, null, 512)]),
124
+ _: 1
125
+ }, 8, ["loading"])])], 2));
126
+ }
127
+ });
128
+ //#endregion
129
+ export { D as t };
@@ -0,0 +1 @@
1
+ const e=require("./SChartSkeletonHost-BlIYGj-7.cjs"),t=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),n=require("./createChartCrosshairPlugin-DdLyEWI0.cjs"),r=require("./resolveSeriesPaletteColor-YACKW1NO.cjs"),i=require("./buildMultiLineChartScales-7mcIfRVG.cjs"),a=require("./SChartLegend-DGtjd6zV.cjs"),o=require("./useHasListener-BPgtbbo6.cjs");let s=require("vue");var c=(t,n,i,a=!1)=>r.t(t,n,i,a,{palette:e.y,paletteFallback:e.v.multiLinePalette1,skeletonPalette:e.S,skeletonFallback:e.v.skeletonPalette1}),l=(e,t,n)=>{if(t)return t;let r=e.reduce((e,t)=>{let n=t.points.reduce((e,t)=>Math.max(e,t.value),0);return Math.max(e,n)},0),i=Math.ceil(r/n)*n;return i>0?i:n*5},u=4,d=5,f=({seriesList:r,colorHostElement:a,yMax:o,yMin:s,yStep:f=d,mirrorYAxis:p=!0,skeleton:m=!1,onSeriesClick:h})=>{if(!t.r(r))return null;let g=e.w(e.v.axisLabel,a),_=e.w(e.v.grid,a),v=e.w(e.v.tooltipBackground,a),y=e.w(e.v.tooltipText,a),b=m&&o?o:l(r,o,f),x=m&&s!==void 0?s:0,S=r[0]?.points.map(e=>e.label)??[],C=e.a({kind:`series`,skeleton:m,colorHostElement:a,onIndexClick:h});return{type:`line`,data:{labels:S,datasets:r.map((e,t)=>{let n=c(t,a,e.fillColor,m);return{label:e.label,data:e.points.map(e=>e.value),borderColor:n,backgroundColor:n,...m?{}:{hoverBorderColor:n,hoverBackgroundColor:n},borderWidth:u,fill:!1,pointRadius:0,pointHoverRadius:4,tension:.4}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:C.onHover,onClick:C.onClick,interaction:e.o(m,{mode:`index`,intersect:!1}),hover:m?void 0:{mode:`nearest`,intersect:!1},plugins:{legend:{display:!1},tooltip:{enabled:e.s(m),backgroundColor:v,titleColor:y,bodyColor:y,footerColor:y,displayColors:!1,position:e.f,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.p()}},scales:i.t({axisLabelColor:g,gridColor:_,yMin:x,yMax:b,yStep:f,mirrorYAxis:p})},plugins:e.c(m,[n.t(a),...C.plugins])}},p=[`26.01`,`2.02`,`9.02`,`16.02`,`23.02`,`2.03`,`9.03`,`16.03`,`23.03`,`30.03`,`6.04`],m=[{label:`Series 1`,points:t.t(p,[30,34,38,44,46,50,54,56,58,60,62])},{label:`Series 2`,points:t.t(p,[22,24,26,28,30,32,33,35,36,38,40])}],h={class:`s-ui-chart-multi-line__canvas-wrap`},g=(0,s.defineComponent)({__name:`SChartMultiLine`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{},mirrorYAxis:{type:Boolean,default:!0}},emits:[`seriesClick`],setup(n,{expose:r,emit:i}){let l=i,u=(0,s.useTemplateRef)(`chartRootRef`),d=(0,s.useTemplateRef)(`chartCanvasRef`),p=(0,s.computed)(()=>n.loading?m:n.series),g=e=>{let t=n.series[e];t&&l(`seriesClick`,e,t)},_=o.t(`onSeriesClick`),v=(0,s.computed)(()=>!n.loading&&n.series.length===0?null:f({seriesList:p.value,colorHostElement:u.value,yMax:n.yMax,yStep:n.yStep,mirrorYAxis:n.mirrorYAxis,skeleton:n.loading,onSeriesClick:_()?g:void 0})),y=(0,s.computed)(()=>t.n(p.value,(e,t)=>c(e,u.value,t,n.loading))),{chartInstance:b}=e.i({canvasRef:d,config:v,enabled:(0,s.computed)(()=>n.loading||n.series.length>0)}),{exportImage:x,handleLegendItemHover:S}=e.r({chartInstance:b,canvasRef:d,colorHostElement:u});return r({exportImage:x}),(t,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,s.normalizeClass)([`s-ui-chart-multi-line`,{"s-ui-chart-multi-line--skeleton":n.loading}])},[(0,s.createElementVNode)(`div`,h,[(0,s.createVNode)((0,s.unref)(e.t),{loading:n.loading},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-multi-line__canvas`},null,512)]),_:1},8,[`loading`])]),y.value.length?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,items:y.value,disabled:n.loading,interactive:!n.loading,onItemHover:(0,s.unref)(S)},null,8,[`items`,`disabled`,`interactive`,`onItemHover`])):(0,s.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});