@shtabapp/ui-kit 1.47.0 → 1.49.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 (113) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{SAvatar-q1HSZPqy.js → SAvatar-BK8cEzGY.js} +1 -1
  3. package/dist/{SAvatar-D5SreJLe.cjs → SAvatar-DTG0odWX.cjs} +1 -1
  4. package/dist/{SAvatarGroup-CdVjv8sb.cjs → SAvatarGroup-CaqcKGIq.cjs} +1 -1
  5. package/dist/{SAvatarGroup-By-5Ub6i.js → SAvatarGroup-MuTqzfYS.js} +1 -1
  6. package/dist/{SChartBurnup-BhCS06uF.cjs → SChartBurnup-C4x5kik6.cjs} +1 -1
  7. package/dist/{SChartBurnup-CG239MJx.js → SChartBurnup-Dxi0MBwo.js} +2 -2
  8. package/dist/{SChartHorizontalBar-DnKbf_9E.cjs → SChartHorizontalBar-4H-lgfO4.cjs} +1 -1
  9. package/dist/{SChartHorizontalBar-DqTZ4H-9.js → SChartHorizontalBar-XNasKzaO.js} +1 -1
  10. package/dist/{SChartLine-CEnRbnVo.cjs → SChartLine-BF6Klm4j.cjs} +1 -1
  11. package/dist/{SChartLine-CQhbtAjJ.js → SChartLine-DSQaezYq.js} +1 -1
  12. package/dist/{SChartMultiLine-CPEglksk.js → SChartMultiLine-CrMmphFe.js} +3 -3
  13. package/dist/{SChartMultiLine-B6GldTYv.cjs → SChartMultiLine-Ddvfmf__.cjs} +1 -1
  14. package/dist/{SChartPie-DXHCXNEs.js → SChartPie-bN8rY-y5.js} +2 -2
  15. package/dist/{SChartPie-CQyENNM6.cjs → SChartPie-namQTFla.cjs} +1 -1
  16. package/dist/{SChartProgress-BwDuidgB.js → SChartProgress-BtwqE4xL.js} +1 -1
  17. package/dist/{SChartProgress-CMcM6yvT.cjs → SChartProgress-DsFHotRv.cjs} +1 -1
  18. package/dist/{SChartSkeletonHost-DSFyP_DN.js → SChartSkeletonHost-BT96eWSF.js} +70 -45
  19. package/dist/SChartSkeletonHost-Dt5EjQr5.cjs +1 -0
  20. package/dist/{SChartStackedArea-DHSamqau.cjs → SChartStackedArea-BLHs3sSH.cjs} +1 -1
  21. package/dist/{SChartStackedArea-BR7W44h6.js → SChartStackedArea-BxUex_Di.js} +4 -4
  22. package/dist/{SChartStackedBar-BbYna5KB.js → SChartStackedBar-BJ9LOgSP.js} +40 -35
  23. package/dist/SChartStackedBar-CWNyvUj9.cjs +1 -0
  24. package/dist/{SPhotoEdit-bXKHcP3x.js → SPhotoEdit-BJXa6mh4.js} +29 -29
  25. package/dist/SPhotoEdit-vg58q6I7.cjs +1 -0
  26. package/dist/buildWorkTimeLegendItems-ChGHTwbn.js +361 -0
  27. package/dist/buildWorkTimeLegendItems-DjhLKbAP.cjs +1 -0
  28. package/dist/components/SCalendar/index.d.ts +12 -0
  29. package/dist/components/SCalendar/index.d.ts.map +1 -0
  30. package/dist/components/SCalendar/utils/buildWorkTimeLegendItems.d.ts +4 -0
  31. package/dist/components/SCalendar/utils/buildWorkTimeLegendItems.d.ts.map +1 -0
  32. package/dist/components/SCalendar/utils/calendar.const.d.ts +4 -0
  33. package/dist/components/SCalendar/utils/calendar.const.d.ts.map +1 -0
  34. package/dist/components/SCalendar/utils/calendar.types.d.ts +8 -0
  35. package/dist/components/SCalendar/utils/calendar.types.d.ts.map +1 -0
  36. package/dist/components/SCalendar/utils/demoCalendarMonthWeeks.d.ts +4 -0
  37. package/dist/components/SCalendar/utils/demoCalendarMonthWeeks.d.ts.map +1 -0
  38. package/dist/components/SCalendar/utils/demoCalendarWeekDays.d.ts +10 -0
  39. package/dist/components/SCalendar/utils/demoCalendarWeekDays.d.ts.map +1 -0
  40. package/dist/components/SCalendar/utils/demoDayTimelineIntervals.d.ts +4 -0
  41. package/dist/components/SCalendar/utils/demoDayTimelineIntervals.d.ts.map +1 -0
  42. package/dist/components/SCalendar/utils/formatDurationHM.d.ts +2 -0
  43. package/dist/components/SCalendar/utils/formatDurationHM.d.ts.map +1 -0
  44. package/dist/components/SCalendarMonth/SCalendarMonth.types.d.ts +45 -0
  45. package/dist/components/SCalendarMonth/SCalendarMonth.types.d.ts.map +1 -0
  46. package/dist/components/SCalendarMonth/SCalendarMonth.vue.d.ts +21 -0
  47. package/dist/components/SCalendarMonth/SCalendarMonth.vue.d.ts.map +1 -0
  48. package/dist/components/SCalendarMonth/index.d.ts +3 -0
  49. package/dist/components/SCalendarMonth/index.d.ts.map +1 -0
  50. package/dist/components/SCalendarWeekGrid/SCalendarWeekGrid.types.d.ts +31 -0
  51. package/dist/components/SCalendarWeekGrid/SCalendarWeekGrid.types.d.ts.map +1 -0
  52. package/dist/components/SCalendarWeekGrid/SCalendarWeekGrid.vue.d.ts +18 -0
  53. package/dist/components/SCalendarWeekGrid/SCalendarWeekGrid.vue.d.ts.map +1 -0
  54. package/dist/components/SCalendarWeekGrid/index.d.ts +4 -0
  55. package/dist/components/SCalendarWeekGrid/index.d.ts.map +1 -0
  56. package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts +3 -1
  57. package/dist/components/SChartStackedBar/SChartStackedBar.vue.d.ts.map +1 -1
  58. package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts +2 -1
  59. package/dist/components/SChartStackedBar/utils/buildStackedBarChartConfig.d.ts.map +1 -1
  60. package/dist/components/SDayTimeline/SDayTimeline.types.d.ts +43 -0
  61. package/dist/components/SDayTimeline/SDayTimeline.types.d.ts.map +1 -0
  62. package/dist/components/SDayTimeline/SDayTimeline.vue.d.ts +19 -0
  63. package/dist/components/SDayTimeline/SDayTimeline.vue.d.ts.map +1 -0
  64. package/dist/components/SDayTimeline/index.d.ts +4 -0
  65. package/dist/components/SDayTimeline/index.d.ts.map +1 -0
  66. package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
  67. package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
  68. package/dist/components/SPhotoEdit/SPhotoEdit.types.d.ts +1 -0
  69. package/dist/components/SPhotoEdit/SPhotoEdit.types.d.ts.map +1 -1
  70. package/dist/components/SPhotoEdit/SPhotoEdit.vue.d.ts.map +1 -1
  71. package/dist/{createChartCrosshairPlugin-q3U4ePnf.js → createChartCrosshairPlugin-DwFOncWI.js} +1 -1
  72. package/dist/{createChartCrosshairPlugin-DdLyEWI0.cjs → createChartCrosshairPlugin-ZZwKUQm8.cjs} +1 -1
  73. package/dist/entries/avatar-group.cjs +1 -1
  74. package/dist/entries/avatar-group.js +1 -1
  75. package/dist/entries/avatar.cjs +1 -1
  76. package/dist/entries/avatar.js +1 -1
  77. package/dist/entries/calendar.cjs +1 -0
  78. package/dist/entries/calendar.d.ts +3 -0
  79. package/dist/entries/calendar.d.ts.map +1 -0
  80. package/dist/entries/calendar.js +2 -0
  81. package/dist/entries/chart-burnup.cjs +1 -1
  82. package/dist/entries/chart-burnup.js +1 -1
  83. package/dist/entries/chart-horizontal-bar.cjs +1 -1
  84. package/dist/entries/chart-horizontal-bar.js +1 -1
  85. package/dist/entries/chart-line.cjs +1 -1
  86. package/dist/entries/chart-line.js +1 -1
  87. package/dist/entries/chart-multi-line.cjs +1 -1
  88. package/dist/entries/chart-multi-line.js +1 -1
  89. package/dist/entries/chart-pie.cjs +1 -1
  90. package/dist/entries/chart-pie.js +1 -1
  91. package/dist/entries/chart-progress.cjs +1 -1
  92. package/dist/entries/chart-progress.js +1 -1
  93. package/dist/entries/chart-stacked-area.cjs +1 -1
  94. package/dist/entries/chart-stacked-area.js +1 -1
  95. package/dist/entries/chart-stacked-bar.cjs +1 -1
  96. package/dist/entries/chart-stacked-bar.js +1 -1
  97. package/dist/entries/photo-edit.cjs +1 -1
  98. package/dist/entries/photo-edit.js +1 -1
  99. package/dist/index.cjs +1 -1
  100. package/dist/index.d.ts +4 -0
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +146 -145
  103. package/dist/{resolveSeriesPaletteColor-fuhGbjFO.js → resolveSeriesPaletteColor-BdvGT-PI.js} +1 -1
  104. package/dist/{resolveSeriesPaletteColor-YACKW1NO.cjs → resolveSeriesPaletteColor-hI4YDdUg.cjs} +1 -1
  105. package/dist/{resolveStackedChartContext-BiIGZ2or.js → resolveStackedChartContext-DFre3tt0.js} +1 -1
  106. package/dist/{resolveStackedChartContext-Bp75eU_I.cjs → resolveStackedChartContext-Dsxhhhel.cjs} +1 -1
  107. package/dist/uikit-components.css +1 -1
  108. package/dist/utils/chart/core/chartInteractivity.d.ts +17 -4
  109. package/dist/utils/chart/core/chartInteractivity.d.ts.map +1 -1
  110. package/package.json +8 -3
  111. package/dist/SChartSkeletonHost-BlIYGj-7.cjs +0 -1
  112. package/dist/SChartStackedBar-B3HcO4UQ.cjs +0 -1
  113. package/dist/SPhotoEdit-VW9-n1yU.cjs +0 -1
@@ -1,8 +1,8 @@
1
- import { _ as e, a as t, c as n, g as r, h as i, i as a, m as o, o as s, r as c, s as l, t as u, v as d, w as f } from "./SChartSkeletonHost-DSFyP_DN.js";
1
+ import { _ as e, a as t, c as n, g as r, h as i, i as a, m as o, o as s, r as c, s as l, t as u, v as d, w as f } from "./SChartSkeletonHost-BT96eWSF.js";
2
2
  import { t as p } from "./buildCartesianChartScales-EofFq3ry.js";
3
3
  import { n as m, t as h } from "./buildChartSeriesPoints-D8Xpfwp7.js";
4
- import { t as g } from "./resolveStackedChartContext-BiIGZ2or.js";
5
- import { t as _ } from "./resolveSeriesPaletteColor-fuhGbjFO.js";
4
+ import { t as g } from "./resolveStackedChartContext-DFre3tt0.js";
5
+ import { t as _ } from "./resolveSeriesPaletteColor-BdvGT-PI.js";
6
6
  import { t as v } from "./SChartLegend-oZoF8XK7.js";
7
7
  import { t as y } from "./useHasListener-RSjlUyqH.js";
8
8
  import { computed as b, createBlock as x, createCommentVNode as S, createElementBlock as C, createElementVNode as w, createVNode as T, defineComponent as E, normalizeClass as D, openBlock as O, unref as k, useTemplateRef as A, withCtx as j } from "vue";
@@ -35,8 +35,8 @@ var M = (t, n, i, a = !1) => _(t, n, i, a, {
35
35
  let y = Math.max(0, P - u);
36
36
  c.save(), c.strokeStyle = s, c.lineWidth = N, F(c, h, g, _, v, y), c.restore();
37
37
  }
38
- }), L = 5, R = "stack0", z = 36, B = 4, V = 12, H = ({ seriesList: e, colorHostElement: r, yMax: a, yMin: c, yStep: u = L, skeleton: d = !1, onSeriesClick: f }) => {
39
- let m = g({
38
+ }), L = 5, R = "stack0", z = 36, B = 4, V = 12, H = ({ seriesList: e, colorHostElement: r, yMax: a, yMin: c, yStep: u = L, skeleton: d = !1, onSeriesClick: f, onSegmentClick: m }) => {
39
+ let h = g({
40
40
  seriesList: e,
41
41
  colorHostElement: r,
42
42
  yMax: a,
@@ -44,17 +44,18 @@ var M = (t, n, i, a = !1) => _(t, n, i, a, {
44
44
  yStep: u,
45
45
  skeleton: d
46
46
  });
47
- if (!m) return null;
48
- let { axisLabelColor: h, gridColor: _, tooltipBackgroundColor: v, tooltipTextColor: y, resolvedYMax: b, resolvedYMin: x, chartLabels: S, pointCaptions: C, topSeriesIndex: w } = m, T = t({
49
- kind: "series",
47
+ if (!h) return null;
48
+ let { axisLabelColor: _, gridColor: v, tooltipBackgroundColor: y, tooltipTextColor: b, resolvedYMax: x, resolvedYMin: S, chartLabels: C, pointCaptions: w, topSeriesIndex: T } = h, E = t({
49
+ kind: "segment",
50
50
  skeleton: d,
51
51
  colorHostElement: r,
52
- onIndexClick: f
52
+ onIndexClick: f,
53
+ onElementIndexClick: m
53
54
  });
54
55
  return {
55
56
  type: "bar",
56
57
  data: {
57
- labels: S,
58
+ labels: C,
58
59
  datasets: e.map((e, t) => {
59
60
  let n = M(t, r, e.fillColor, d);
60
61
  return {
@@ -66,34 +67,34 @@ var M = (t, n, i, a = !1) => _(t, n, i, a, {
66
67
  hoverBorderWidth: 0,
67
68
  stack: R,
68
69
  barThickness: z,
69
- borderRadius: t === w ? {
70
+ borderRadius: t === T ? {
70
71
  topLeft: B,
71
72
  topRight: B
72
73
  } : 0,
73
- ...t === 0 ? { captions: C } : {}
74
+ ...t === 0 ? { captions: w } : {}
74
75
  };
75
76
  })
76
77
  },
77
78
  options: {
78
79
  responsive: !0,
79
80
  maintainAspectRatio: !1,
80
- onHover: T.onHover,
81
- onClick: T.onClick,
81
+ onHover: E.onHover,
82
+ onClick: E.onClick,
82
83
  hover: d ? void 0 : {
83
84
  mode: "nearest",
84
85
  intersect: !0
85
86
  },
86
87
  interaction: s(d, {
87
- mode: "index",
88
- intersect: !1
88
+ mode: "nearest",
89
+ intersect: !0
89
90
  }),
90
91
  plugins: {
91
92
  legend: { display: !1 },
92
93
  tooltip: {
93
94
  enabled: l(d),
94
- backgroundColor: v,
95
- titleColor: y,
96
- bodyColor: y,
95
+ backgroundColor: y,
96
+ titleColor: b,
97
+ bodyColor: b,
97
98
  displayColors: !1,
98
99
  position: o,
99
100
  yAlign: "bottom",
@@ -103,16 +104,16 @@ var M = (t, n, i, a = !1) => _(t, n, i, a, {
103
104
  }
104
105
  },
105
106
  scales: p({
106
- axisLabelColor: h,
107
- gridColor: _,
108
- yMin: x,
109
- yMax: b,
107
+ axisLabelColor: _,
108
+ gridColor: v,
109
+ yMin: S,
110
+ yMax: x,
110
111
  yStep: u,
111
112
  stacked: !0,
112
113
  xTickFontSize: V
113
114
  })
114
115
  },
115
- plugins: n(d, [I(r), ...T.plugins])
116
+ plugins: n(d, [I(r), ...E.plugins])
116
117
  };
117
118
  }, U = [
118
119
  "5 неделя",
@@ -194,29 +195,33 @@ var M = (t, n, i, a = !1) => _(t, n, i, a, {
194
195
  yMax: {},
195
196
  yStep: {}
196
197
  },
197
- emits: ["seriesClick"],
198
+ emits: ["seriesClick", "segmentClick"],
198
199
  setup(e, { expose: t, emit: n }) {
199
200
  let r = n, i = A("chartRootRef"), o = A("chartCanvasRef"), s = b(() => e.loading ? J : e.series), l = (t) => {
200
201
  let n = e.series[t];
201
202
  n && r("seriesClick", t, n);
202
- }, d = y("onSeriesClick"), f = b(() => !e.loading && e.series.length === 0 ? null : H({
203
+ }, d = (t, n) => {
204
+ let i = e.series[n], a = i?.points[t];
205
+ i && a && r("segmentClick", t, n, a, i);
206
+ }, f = y("onSeriesClick"), p = y("onSegmentClick"), h = b(() => !e.loading && e.series.length === 0 ? null : H({
203
207
  seriesList: s.value,
204
208
  colorHostElement: i.value,
205
209
  yMax: e.loading ? 50 : e.yMax,
206
210
  yMin: e.loading ? 0 : void 0,
207
211
  yStep: e.loading ? 5 : e.yStep,
208
212
  skeleton: e.loading,
209
- onSeriesClick: d() ? l : void 0
210
- })), p = b(() => m(s.value, (t, n) => M(t, i.value, n, e.loading))), { chartInstance: h } = a({
213
+ onSeriesClick: f() ? l : void 0,
214
+ onSegmentClick: p() ? d : void 0
215
+ })), g = b(() => m(s.value, (t, n) => M(t, i.value, n, e.loading))), { chartInstance: _ } = a({
211
216
  canvasRef: o,
212
- config: f,
217
+ config: h,
213
218
  enabled: b(() => e.loading || e.series.length > 0)
214
- }), { exportImage: g, handleLegendItemHover: _ } = c({
215
- chartInstance: h,
219
+ }), { exportImage: E, handleLegendItemHover: N } = c({
220
+ chartInstance: _,
216
221
  canvasRef: o,
217
222
  colorHostElement: i
218
223
  });
219
- return t({ exportImage: g }), (t, n) => (O(), C("div", {
224
+ return t({ exportImage: E }), (t, n) => (O(), C("div", {
220
225
  ref_key: "chartRootRef",
221
226
  ref: i,
222
227
  class: D(["s-ui-chart-stacked-bar", { "s-ui-chart-stacked-bar--skeleton": e.loading }])
@@ -227,12 +232,12 @@ var M = (t, n, i, a = !1) => _(t, n, i, a, {
227
232
  class: "s-ui-chart-stacked-bar__canvas"
228
233
  }, null, 512)]),
229
234
  _: 1
230
- }, 8, ["loading"])]), p.value.length ? (O(), x(k(v), {
235
+ }, 8, ["loading"])]), g.value.length ? (O(), x(k(v), {
231
236
  key: 0,
232
- items: p.value,
237
+ items: g.value,
233
238
  disabled: e.loading,
234
239
  interactive: !e.loading,
235
- onItemHover: k(_)
240
+ onItemHover: k(N)
236
241
  }, null, 8, [
237
242
  "items",
238
243
  "disabled",
@@ -0,0 +1 @@
1
+ const e=require("./SChartSkeletonHost-Dt5EjQr5.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-Bv3nXvSu.cjs"),r=require("./resolveStackedChartContext-Dsxhhhel.cjs"),i=require("./resolveSeriesPaletteColor-hI4YDdUg.cjs"),a=require("./SChartLegend-DGtjd6zV.cjs"),o=require("./useHasListener-BPgtbbo6.cjs");let s=require("vue");var c=(t,n,r,a=!1)=>i.t(t,n,r,a,{palette:e._,paletteFallback:e.v.barStackedPalette1,skeletonPalette:e.g,skeletonFallback:e.v.barSkeletonPalette1}),l=3,u=4,d=(e,t,n,r,i,a)=>{let o=Math.min(a,r/2,i),s=o;e.beginPath(),e.moveTo(t,n+i),e.lineTo(t,n+o),e.arcTo(t,n,t+o,n,o),e.lineTo(t+r-s,n),e.arcTo(t+r,n,t+r,n+s,s),e.lineTo(t+r,n+i),e.closePath(),e.stroke()},f=t=>({id:`stackedBarHoverOutline`,afterDatasetsDraw(n){let r=n.tooltip?.getActiveElements()??[];if(r.length===0)return;let i=1/0,a=1/0,o=-1/0,s=-1/0;for(let e of r){let{x:t,y:n,width:r,base:c}=e.element.getProps([`x`,`y`,`width`,`base`]),l=t-r/2,u=t+r/2,d=n,f=c;i=Math.min(i,l),o=Math.max(o,u),a=Math.min(a,d),s=Math.max(s,f)}let c=e.w(e.v.barHoverOutline,t),{ctx:f,chartArea:p}=n,m=l/2,h=p?.bottom??s,g=Math.min(s,h),_=i+m,v=a+m,y=o-i-l,b=g-a-l;if(y<=0||b<=0)return;let x=Math.max(0,u-m);f.save(),f.strokeStyle=c,f.lineWidth=l,d(f,_,v,y,b,x),f.restore()}}),p=5,m=`stack0`,h=36,g=4,_=12,v=({seriesList:n,colorHostElement:i,yMax:a,yMin:o,yStep:s=p,skeleton:l=!1,onSeriesClick:u,onSegmentClick:d})=>{let v=r.t({seriesList:n,colorHostElement:i,yMax:a,yMin:o,yStep:s,skeleton:l});if(!v)return null;let{axisLabelColor:y,gridColor:b,tooltipBackgroundColor:x,tooltipTextColor:S,resolvedYMax:C,resolvedYMin:w,chartLabels:T,pointCaptions:E,topSeriesIndex:D}=v,O=e.a({kind:`segment`,skeleton:l,colorHostElement:i,onIndexClick:u,onElementIndexClick:d});return{type:`bar`,data:{labels:T,datasets:n.map((e,t)=>{let n=c(t,i,e.fillColor,l);return{label:e.label,data:e.points.map(e=>e.value),backgroundColor:n,hoverBackgroundColor:n,borderWidth:0,hoverBorderWidth:0,stack:m,barThickness:h,borderRadius:t===D?{topLeft:g,topRight:g}:0,...t===0?{captions:E}:{}}})},options:{responsive:!0,maintainAspectRatio:!1,onHover:O.onHover,onClick:O.onClick,hover:l?void 0:{mode:`nearest`,intersect:!0},interaction:e.o(l,{mode:`nearest`,intersect:!0}),plugins:{legend:{display:!1},tooltip:{enabled:e.s(l),backgroundColor:x,titleColor:S,bodyColor:S,displayColors:!1,position:e.m,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.h()}},scales:t.t({axisLabelColor:y,gridColor:b,yMin:w,yMax:C,yStep:s,stacked:!0,xTickFontSize:_})},plugins:e.c(l,[f(i),...O.plugins])}},y=[`5 неделя`,`6 неделя`,`7 неделя`,`8 неделя`,`9 неделя`,`10 неделя`,`11 неделя`,`12 неделя`,`13 неделя`,`14 неделя`,`15 неделя`,`16 неделя`],b=[12,14,15,16,18,17,16,15,14,13,12,11],x=[6,7,8,8,9,8,7,7,6,6,5,5],S=[4,5,5,6,6,5,5,4,4,3,3,3],C=[`Series 1`,`Series 2`,`Series 3`],w=[{label:C[0]??`Series 1`,points:n.t(y,b)},{label:C[1]??`Series 2`,points:n.t(y,x)},{label:C[2]??`Series 3`,points:n.t(y,S)}],T={class:`s-ui-chart-stacked-bar__canvas-wrap`},E=(0,s.defineComponent)({__name:`SChartStackedBar`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},emits:[`seriesClick`,`segmentClick`],setup(t,{expose:r,emit:i}){let l=i,u=(0,s.useTemplateRef)(`chartRootRef`),d=(0,s.useTemplateRef)(`chartCanvasRef`),f=(0,s.computed)(()=>t.loading?w:t.series),p=e=>{let n=t.series[e];n&&l(`seriesClick`,e,n)},m=(e,n)=>{let r=t.series[n],i=r?.points[e];r&&i&&l(`segmentClick`,e,n,i,r)},h=o.t(`onSeriesClick`),g=o.t(`onSegmentClick`),_=(0,s.computed)(()=>!t.loading&&t.series.length===0?null:v({seriesList:f.value,colorHostElement:u.value,yMax:t.loading?50:t.yMax,yMin:t.loading?0:void 0,yStep:t.loading?5:t.yStep,skeleton:t.loading,onSeriesClick:h()?p:void 0,onSegmentClick:g()?m:void 0})),y=(0,s.computed)(()=>n.n(f.value,(e,n)=>c(e,u.value,n,t.loading))),{chartInstance:b}=e.i({canvasRef:d,config:_,enabled:(0,s.computed)(()=>t.loading||t.series.length>0)}),{exportImage:x,handleLegendItemHover:S}=e.r({chartInstance:b,canvasRef:d,colorHostElement:u});return r({exportImage:x}),(n,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:u,class:(0,s.normalizeClass)([`s-ui-chart-stacked-bar`,{"s-ui-chart-stacked-bar--skeleton":t.loading}])},[(0,s.createElementVNode)(`div`,T,[(0,s.createVNode)((0,s.unref)(e.t),{loading:t.loading},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:d,class:`s-ui-chart-stacked-bar__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:t.loading,interactive:!t.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 E}});
@@ -4,7 +4,7 @@ import { computed as i, createCommentVNode as a, createElementBlock as o, create
4
4
  import { SIcon as x, useUiKitI18n as S } from "@shtabapp/ui-kit-primitives";
5
5
  //#region src/components/SPhotoEdit/SPhotoEdit.types.ts
6
6
  var C = /* @__PURE__ */ function(e) {
7
- return e.SMALL = "small", e.BIG = "big", e;
7
+ return e.X_SMALL = "x-small", e.SMALL = "small", e.BIG = "big", e;
8
8
  }({}), w = /* @__PURE__ */ function(e) {
9
9
  return e.CIRCLE = "circle", e.SQUARE = "square", e;
10
10
  }({}), T = {
@@ -17,7 +17,7 @@ var C = /* @__PURE__ */ function(e) {
17
17
  ], O = ["src", "alt"], k = {
18
18
  key: 1,
19
19
  class: "s-ui-photo-edit__placeholder"
20
- }, A = { class: "s-ui-photo-edit__camera" }, j = { class: "s-ui-photo-edit__overlay" }, M = { class: "s-ui-photo-edit__label s-ui-typography-label-12-medium" }, N = ["accept", "disabled"], P = /* @__PURE__ */ l({
20
+ }, A = { class: "s-ui-photo-edit__camera" }, j = { class: "s-ui-photo-edit__overlay" }, M = ["accept", "disabled"], N = /* @__PURE__ */ l({
21
21
  __name: "SPhotoEdit",
22
22
  props: /*@__PURE__*/ u({
23
23
  accept: { default: "image/jpeg,image/png,image/jpg" },
@@ -34,44 +34,44 @@ var C = /* @__PURE__ */ function(e) {
34
34
  }),
35
35
  emits: /*@__PURE__*/ u(["change", "remove"], ["update:modelValue"]),
36
36
  setup(l, { emit: u }) {
37
- let C = _(l, "modelValue"), w = u, { t: P } = S(), F = v("fileInputRef"), I = m(null), L = () => {
37
+ let w = _(l, "modelValue"), N = u, { t: P } = S(), F = v("fileInputRef"), I = m(null), L = () => {
38
38
  I.value &&= (URL.revokeObjectURL(I.value), null);
39
39
  };
40
- y(() => C.value, (e) => {
40
+ y(() => w.value, (e) => {
41
41
  L(), e instanceof File && (I.value = URL.createObjectURL(e));
42
42
  }, { immediate: !0 }), f(L);
43
43
  let R = i(() => {
44
- let e = C.value;
44
+ let e = w.value;
45
45
  return e instanceof File ? I.value ?? "" : typeof e == "string" ? e : "";
46
46
  }), z = i(() => {
47
- let e = C.value;
47
+ let e = w.value;
48
48
  return e instanceof File ? !0 : typeof e == "string" ? e.length > 0 : !1;
49
49
  }), B = i(() => ({
50
50
  [`s-ui-photo-edit--size-${l.size}`]: !0,
51
51
  [`s-ui-photo-edit--shape-${l.shape}`]: !0,
52
52
  "s-ui-photo-edit--filled": z.value,
53
53
  "s-ui-photo-edit--disabled": l.disabled
54
- })), V = i(() => z.value ? P("photoEdit.changePhoto") : P("photoEdit.uploadPhoto")), H = i(() => z.value ? P("photoEdit.changePhoto") : P("photoEdit.pickPhoto")), U = i(() => l.disabled ? -1 : 0), W = () => {
54
+ })), V = i(() => l.size === C.X_SMALL ? "s-ui-typography-label-10-medium" : "s-ui-typography-label-12-medium"), H = i(() => z.value ? P("photoEdit.changePhoto") : P("photoEdit.uploadPhoto")), U = i(() => z.value ? P("photoEdit.changePhoto") : P("photoEdit.pickPhoto")), W = i(() => l.disabled ? -1 : 0), G = () => {
55
55
  F.value && (F.value.value = "");
56
- }, G = () => {
57
- C.value = null, L(), W();
58
- }, K = (e) => {
59
- w("change", {
56
+ }, K = () => {
57
+ w.value = null, L(), G();
58
+ }, q = (e) => {
59
+ N("change", {
60
60
  file: e,
61
- abort: G
61
+ abort: K
62
62
  });
63
- }, q = () => {
64
- l.disabled || F.value?.click();
65
63
  }, J = () => {
66
- q();
67
- }, Y = (e) => {
68
- l.disabled || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), q());
64
+ l.disabled || F.value?.click();
65
+ }, Y = () => {
66
+ J();
69
67
  }, X = (e) => {
68
+ l.disabled || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), J());
69
+ }, Z = (e) => {
70
70
  if (!(e.target instanceof HTMLInputElement)) return;
71
71
  let t = e.target.files?.[0];
72
- t && (C.value = t, K(t), W());
73
- }, Z = () => {
74
- l.disabled || (w("remove"), C.value = null, L(), W(), K(null));
72
+ t && (w.value = t, q(t), G());
73
+ }, Q = () => {
74
+ l.disabled || (N("remove"), w.value = null, L(), G(), q(null));
75
75
  };
76
76
  return (i, u) => (p(), o("div", { class: d(["s-ui-photo-edit", B.value]) }, [
77
77
  z.value ? (p(), o("span", T, [c(g(r), {
@@ -82,7 +82,7 @@ var C = /* @__PURE__ */ function(e) {
82
82
  tabindex: -1,
83
83
  icon: "closeMini",
84
84
  "aria-label": g(P)("photoEdit.removePhoto"),
85
- onClick: b(Z, ["stop"])
85
+ onClick: b(Q, ["stop"])
86
86
  }, null, 8, [
87
87
  "appearance",
88
88
  "variant",
@@ -93,11 +93,11 @@ var C = /* @__PURE__ */ function(e) {
93
93
  s("div", E, [s("div", {
94
94
  class: "s-ui-photo-edit__trigger",
95
95
  role: "button",
96
- tabindex: U.value,
96
+ tabindex: W.value,
97
97
  "aria-disabled": l.disabled || void 0,
98
- "aria-label": H.value,
99
- onClick: J,
100
- onKeydown: Y
98
+ "aria-label": U.value,
99
+ onClick: Y,
100
+ onKeydown: X
101
101
  }, [R.value ? (p(), o("img", {
102
102
  key: 0,
103
103
  class: "s-ui-photo-edit__preview",
@@ -106,7 +106,7 @@ var C = /* @__PURE__ */ function(e) {
106
106
  }, null, 8, O)) : (p(), o("div", k, [s("span", A, [c(g(x), {
107
107
  name: "camera",
108
108
  size: 40
109
- })])])), s("div", j, [s("span", M, h(V.value), 1)])], 40, D)]),
109
+ })])])), s("div", j, [s("span", { class: d(["s-ui-photo-edit__label", V.value]) }, h(H.value), 3)])], 40, D)]),
110
110
  s("input", {
111
111
  ref_key: "fileInputRef",
112
112
  ref: F,
@@ -114,10 +114,10 @@ var C = /* @__PURE__ */ function(e) {
114
114
  type: "file",
115
115
  accept: l.accept,
116
116
  disabled: l.disabled,
117
- onChange: X
118
- }, null, 40, N)
117
+ onChange: Z
118
+ }, null, 40, M)
119
119
  ], 2));
120
120
  }
121
121
  });
122
122
  //#endregion
123
- export { w as n, C as r, P as t };
123
+ export { w as n, C as r, N as t };
@@ -0,0 +1 @@
1
+ const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs");let n=require("vue"),r=require("@shtabapp/ui-kit-primitives");var i=function(e){return e.X_SMALL=`x-small`,e.SMALL=`small`,e.BIG=`big`,e}({}),a=function(e){return e.CIRCLE=`circle`,e.SQUARE=`square`,e}({}),o={key:0,class:`s-ui-photo-edit__remove`},s={class:`s-ui-photo-edit__wrapper`},c=[`tabindex`,`aria-disabled`,`aria-label`],l=[`src`,`alt`],u={key:1,class:`s-ui-photo-edit__placeholder`},d={class:`s-ui-photo-edit__camera`},f={class:`s-ui-photo-edit__overlay`},p=[`accept`,`disabled`],m=(0,n.defineComponent)({__name:`SPhotoEdit`,props:(0,n.mergeModels)({accept:{default:`image/jpeg,image/png,image/jpg`},alt:{},disabled:{type:Boolean,default:!1},shape:{default:()=>a.CIRCLE},size:{default:()=>i.SMALL}},{modelValue:{default:null},modelModifiers:{}}),emits:(0,n.mergeModels)([`change`,`remove`],[`update:modelValue`]),setup(a,{emit:m}){let h=(0,n.useModel)(a,`modelValue`),g=m,{t:_}=(0,r.useUiKitI18n)(),v=(0,n.useTemplateRef)(`fileInputRef`),y=(0,n.ref)(null),b=()=>{y.value&&=(URL.revokeObjectURL(y.value),null)};(0,n.watch)(()=>h.value,e=>{b(),e instanceof File&&(y.value=URL.createObjectURL(e))},{immediate:!0}),(0,n.onScopeDispose)(b);let x=(0,n.computed)(()=>{let e=h.value;return e instanceof File?y.value??``:typeof e==`string`?e:``}),S=(0,n.computed)(()=>{let e=h.value;return e instanceof File?!0:typeof e==`string`?e.length>0:!1}),C=(0,n.computed)(()=>({[`s-ui-photo-edit--size-${a.size}`]:!0,[`s-ui-photo-edit--shape-${a.shape}`]:!0,"s-ui-photo-edit--filled":S.value,"s-ui-photo-edit--disabled":a.disabled})),w=(0,n.computed)(()=>a.size===i.X_SMALL?`s-ui-typography-label-10-medium`:`s-ui-typography-label-12-medium`),T=(0,n.computed)(()=>S.value?_(`photoEdit.changePhoto`):_(`photoEdit.uploadPhoto`)),E=(0,n.computed)(()=>S.value?_(`photoEdit.changePhoto`):_(`photoEdit.pickPhoto`)),D=(0,n.computed)(()=>a.disabled?-1:0),O=()=>{v.value&&(v.value.value=``)},k=()=>{h.value=null,b(),O()},A=e=>{g(`change`,{file:e,abort:k})},j=()=>{a.disabled||v.value?.click()},M=()=>{j()},N=e=>{a.disabled||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),j())},P=e=>{if(!(e.target instanceof HTMLInputElement))return;let t=e.target.files?.[0];t&&(h.value=t,A(t),O())},F=()=>{a.disabled||(g(`remove`),h.value=null,b(),O(),A(null))};return(i,m)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`s-ui-photo-edit`,C.value])},[S.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,o,[(0,n.createVNode)((0,n.unref)(t.t),{appearance:(0,n.unref)(e.t).BARE,variant:(0,n.unref)(e.r).NEUTRAL,size:(0,n.unref)(e.n).SMALL,disabled:a.disabled,tabindex:-1,icon:`closeMini`,"aria-label":(0,n.unref)(_)(`photoEdit.removePhoto`),onClick:(0,n.withModifiers)(F,[`stop`])},null,8,[`appearance`,`variant`,`size`,`disabled`,`aria-label`])])):(0,n.createCommentVNode)(``,!0),(0,n.createElementVNode)(`div`,s,[(0,n.createElementVNode)(`div`,{class:`s-ui-photo-edit__trigger`,role:`button`,tabindex:D.value,"aria-disabled":a.disabled||void 0,"aria-label":E.value,onClick:M,onKeydown:N},[x.value?((0,n.openBlock)(),(0,n.createElementBlock)(`img`,{key:0,class:`s-ui-photo-edit__preview`,src:x.value,alt:a.alt??``},null,8,l)):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,[(0,n.createElementVNode)(`span`,d,[(0,n.createVNode)((0,n.unref)(r.SIcon),{name:`camera`,size:40})])])),(0,n.createElementVNode)(`div`,f,[(0,n.createElementVNode)(`span`,{class:(0,n.normalizeClass)([`s-ui-photo-edit__label`,w.value])},(0,n.toDisplayString)(T.value),3)])],40,c)]),(0,n.createElementVNode)(`input`,{ref_key:`fileInputRef`,ref:v,class:`s-ui-photo-edit__input`,type:`file`,accept:a.accept,disabled:a.disabled,onChange:P},null,40,p)],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});