@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue"),t=require("@shtabapp/ui-kit-primitives"),n=require("@vueuse/core"),r=require("chart.js");var i=(e,t)=>{if(typeof window>`u`)return``;let n=t??document.documentElement;return getComputedStyle(n).getPropertyValue(e).trim()},a={axisLabel:`--s-ui-chart-axis-label`,grid:`--s-ui-chart-grid`,crosshair:`--s-ui-chart-crosshair`,legendLabel:`--s-ui-chart-legend-label`,seriesPrimary:`--s-ui-chart-series-primary`,seriesFillStart:`--s-ui-chart-series-fill-start`,seriesFillEnd:`--s-ui-chart-series-fill-end`,seriesFillOpacity:`--s-ui-chart-series-fill-opacity`,skeletonSeries:`--s-ui-chart-skeleton-series`,skeletonPalette1:`--s-ui-chart-skeleton-palette-1`,skeletonPalette2:`--s-ui-chart-skeleton-palette-2`,skeletonPalette3:`--s-ui-chart-skeleton-palette-3`,skeletonPalette4:`--s-ui-chart-skeleton-palette-4`,skeletonPalette5:`--s-ui-chart-skeleton-palette-5`,skeletonPalette6:`--s-ui-chart-skeleton-palette-6`,skeletonFillStart:`--s-ui-chart-skeleton-fill-start`,skeletonFillEnd:`--s-ui-chart-skeleton-fill-end`,skeletonFillOpacity:`--s-ui-chart-skeleton-fill-opacity`,tooltipBackground:`--s-ui-chart-tooltip-background`,tooltipText:`--s-ui-chart-tooltip-text`,stackedPalette1:`--s-ui-chart-stacked-palette-1`,stackedPalette2:`--s-ui-chart-stacked-palette-2`,stackedPalette3:`--s-ui-chart-stacked-palette-3`,stackedPalette4:`--s-ui-chart-stacked-palette-4`,stackedPalette5:`--s-ui-chart-stacked-palette-5`,stackedPalette6:`--s-ui-chart-stacked-palette-6`,barStackedPalette1:`--s-ui-chart-bar-stacked-palette-1`,barStackedPalette2:`--s-ui-chart-bar-stacked-palette-2`,barStackedPalette3:`--s-ui-chart-bar-stacked-palette-3`,barStackedPalette4:`--s-ui-chart-bar-stacked-palette-4`,barStackedPalette5:`--s-ui-chart-bar-stacked-palette-5`,barStackedPalette6:`--s-ui-chart-bar-stacked-palette-6`,barHoverOutline:`--s-ui-chart-bar-hover-outline`,barSkeletonPalette1:`--s-ui-chart-bar-skeleton-palette-1`,barSkeletonPalette2:`--s-ui-chart-bar-skeleton-palette-2`,barSkeletonPalette3:`--s-ui-chart-bar-skeleton-palette-3`,barSkeletonPalette4:`--s-ui-chart-bar-skeleton-palette-4`,barSkeletonPalette5:`--s-ui-chart-bar-skeleton-palette-5`,barSkeletonPalette6:`--s-ui-chart-bar-skeleton-palette-6`,piePalette1:`--s-ui-chart-pie-palette-1`,piePalette2:`--s-ui-chart-pie-palette-2`,piePalette3:`--s-ui-chart-pie-palette-3`,piePalette4:`--s-ui-chart-pie-palette-4`,piePalette5:`--s-ui-chart-pie-palette-5`,piePalette6:`--s-ui-chart-pie-palette-6`,piePalette7:`--s-ui-chart-pie-palette-7`,piePalette8:`--s-ui-chart-pie-palette-8`,pieSegmentBorder:`--s-ui-chart-pie-segment-border`,pieBadgeBackground:`--s-ui-chart-pie-badge-background`,pieBadgeBorder:`--s-ui-chart-pie-badge-border`,pieBadgeText:`--s-ui-chart-pie-badge-text`,pieHoverShadow:`--s-ui-chart-pie-hover-shadow`,pieSkeletonPalette1:`--s-ui-chart-pie-skeleton-palette-1`,pieSkeletonPalette2:`--s-ui-chart-pie-skeleton-palette-2`,pieSkeletonPalette3:`--s-ui-chart-pie-skeleton-palette-3`,pieSkeletonPalette4:`--s-ui-chart-pie-skeleton-palette-4`,pieSkeletonPalette5:`--s-ui-chart-pie-skeleton-palette-5`,pieSkeletonPalette6:`--s-ui-chart-pie-skeleton-palette-6`,pieSkeletonPalette7:`--s-ui-chart-pie-skeleton-palette-7`,pieSkeletonPalette8:`--s-ui-chart-pie-skeleton-palette-8`,barHorizontalFillDefault:`--s-ui-chart-bar-horizontal-fill-default`,barHorizontalSkeletonFill:`--s-ui-chart-bar-horizontal-skeleton-fill`,barHorizontalCategoryLabel:`--s-ui-chart-bar-horizontal-category-label`,barHorizontalCategoryLabelSkeleton:`--s-ui-chart-bar-horizontal-category-label-skeleton`,progressLine:`--s-ui-chart-progress-line`,referenceFill:`--s-ui-chart-reference-fill`},o=[a.stackedPalette1,a.stackedPalette2,a.stackedPalette3,a.stackedPalette4,a.stackedPalette5,a.stackedPalette6],s=[a.skeletonPalette1,a.skeletonPalette2,a.skeletonPalette3,a.skeletonPalette4,a.skeletonPalette5,a.skeletonPalette6],c=[a.barStackedPalette1,a.barStackedPalette2,a.barStackedPalette3,a.barStackedPalette4,a.barStackedPalette5,a.barStackedPalette6],l=[a.barSkeletonPalette1,a.barSkeletonPalette2,a.barSkeletonPalette3,a.barSkeletonPalette4,a.barSkeletonPalette5,a.barSkeletonPalette6],u=[a.piePalette1,a.piePalette2,a.piePalette3,a.piePalette4,a.piePalette5,a.piePalette6,a.piePalette7,a.piePalette8],d=[a.pieSkeletonPalette1,a.pieSkeletonPalette2,a.pieSkeletonPalette3,a.pieSkeletonPalette4,a.pieSkeletonPalette5,a.pieSkeletonPalette6,a.pieSkeletonPalette7,a.pieSkeletonPalette8],f=e=>`captions`in e,p=(e,t)=>{let n=e.data.datasets[0];if(!n||!f(n))return;let r=n.captions?.[t];if(r)return r},m=()=>({title:e=>{let t=e[0];if(!t)return``;let n=p(t.chart,t.dataIndex),r=[`${t.label}`];return n&&r.push(n),r},label:e=>`${e.dataset.label??``} – ${e.parsed.y??0}`}),h=`stackedBarTop`,g=function(e,t){if(e.length===0)return{x:t.x,y:t.y};let n=1/0,r=1/0,i=-1/0;for(let t of e){let{x:e,y:a,width:o}=t.element.getProps([`x`,`y`,`width`]);n=Math.min(n,a),r=Math.min(r,e-o/2),i=Math.max(i,e+o/2)}return{x:(r+i)/2,y:n}},_=`progressChartPoint`,v=1,y=(e,t)=>{let n=e.data.datasets[v]?.data[t];return typeof n==`number`?n:null},b=function(e){let t=e.find(e=>e.datasetIndex===v)??e[0];if(!t)return!1;let n=this.chart.scales.y;if(!n)return!1;let r=y(this.chart,t.index);return r===null?!1:{x:t.element.x,y:n.getPixelForValue(r),xAlign:`center`,yAlign:`bottom`}},x=({total:e}={})=>({title:e=>{let t=e[0];return t?`${t.label}`:``},label:e=>`${e.dataset.label??``} – ${e.parsed.y??0}`,footer:t=>{let n=t.reduce((e,t)=>e+(t.parsed.y??0),0);return e?`${e} – ${n}`:`${n}`}}),S=`stackedAreaTop`,C=function(e,t){let n=this.chart.chartArea;return!n||e.length===0?{x:t.x,y:t.y}:{x:t.x,y:n.top}},w=!1,T=!1,E=!1,D=!1,O=()=>{T||=(r.Tooltip.positioners.stackedAreaTop=C,!0)},k=()=>{E||=(r.Tooltip.positioners.stackedBarTop=g,!0)},A=()=>{D||=(r.Tooltip.positioners.progressChartPoint=b,!0)},j=()=>{w||=(r.Chart.register(r.LineController,r.LineElement,r.PointElement,r.BarController,r.BarElement,r.PieController,r.ArcElement,r.LinearScale,r.CategoryScale,r.Tooltip,r.Filler),O(),k(),A(),!0)},M=(e,t)=>e?{mode:`nearest`,intersect:!1}:t,N=e=>!e,P=(e,t)=>e?[]:t,F=({canvasRef:t,config:i,enabled:a})=>{let o=(0,e.shallowRef)(),s=()=>{o.value&&=(o.value.destroy(),void 0)},c=()=>{if(!(0,e.toValue)(a)){s();return}let n=(0,e.toValue)(t),c=(0,e.toValue)(i);if(!n||!c){s();return}j(),o.value&&=(o.value.destroy(),void 0),o.value=new r.Chart(n,c)};return(0,e.onMounted)(()=>{c()}),(0,e.watch)(()=>[(0,e.toValue)(a),(0,e.toValue)(t),(0,e.toValue)(i)],()=>{c()},{deep:!0}),(0,n.useResizeObserver)(t,()=>{o.value?.resize()}),(0,e.onBeforeUnmount)(()=>{s()}),{chartInstance:o}},I=function(e){return e.CARTESIAN=`cartesian`,e.PIE=`pie`,e}({}),L=(0,e.defineComponent)({__name:`SChartSkeletonHost`,props:{loading:{type:Boolean,default:!1},type:{default:()=>I.CARTESIAN}},setup(n){let r=(0,e.computed)(()=>n.type===I.PIE?t.ESSkeletonType.CHART_PIE:t.ESSkeletonType.CHART_CARTESIAN);return(i,a)=>n.loading?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.SSkeleton),{key:0,type:r.value,class:`s-ui-chart-skeleton-host`},{default:(0,e.withCtx)(()=>[(0,e.renderSlot)(i.$slots,`default`)]),_:3},8,[`type`])):(0,e.renderSlot)(i.$slots,`default`,{key:1})}});Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return i}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-lASMQmBx.cjs"),r=require("./SChartLegend-BFwzIA4x.cjs");let i=require("vue");var a=t=>({id:`sUiChartCrosshair`,afterDatasetsDraw(n){if((n.tooltip?.getActiveElements()??[]).length===0)return;let{ctx:r,chartArea:i}=n;if(!i||!n.tooltip)return;let a=e.y(e.m.crosshair,t),o=n.tooltip.caretX;r.save(),r.beginPath(),r.moveTo(o,i.top),r.lineTo(o,i.bottom),r.lineWidth=1,r.strokeStyle=a,r.stroke(),r.restore()}}),o=(t,n,i,a=!1)=>r.n(t,n,i,a,{palette:e.v,paletteFallback:e.m.stackedPalette1,skeletonPalette:e._,skeletonFallback:e.m.skeletonPalette1}),s=20,c=`stack0`,l=({seriesList:r,colorHostElement:i,yMax:l,yMin:u,yStep:d=s,skeleton:f=!1,totalLabel:p})=>{let m=n.r({seriesList:r,colorHostElement:i,yMax:l,yMin:u,yStep:d,skeleton:f});if(!m)return null;let{axisLabelColor:h,gridColor:g,tooltipBackgroundColor:_,tooltipTextColor:v,resolvedYMax:y,resolvedYMin:b,chartLabels:x}=m;return{type:`line`,data:{labels:x,datasets:r.map((e,t)=>({label:e.label,data:e.points.map(e=>e.value),borderColor:o(t,i,e.fillColor,f),backgroundColor:o(t,i,e.fillColor,f),borderWidth:0,fill:!0,pointRadius:0,pointHoverRadius:0,tension:0,stack:c}))},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.i(f,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.a(f),backgroundColor:_,titleColor:v,bodyColor:v,footerColor:v,displayColors:!1,position:e.s,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.c({total:p})}},scales:t.t({axisLabelColor:h,gridColor:g,yMin:b,yMax:y,yStep:d,stacked:!0})},plugins:e.o(f,[a(i)])}},u=[`24.02`,`28.02`,`04.03`,`08.03`,`12.03`,`16.03`,`20.03`,`24.03`,`28.03`,`01.04`,`05.04`,`09.04`,`13.04`,`17.04`],d=[18,22,26,30,34,38,42,44,46,48,49,50,51,52],f=[6,6,7,7,7,7,7,7,7,7,7,7,7,7],p=[10,11,12,12,11,10,10,10,10,10,10,10,10,10],m=[32,30,28,26,28,30,29,28,27,26,26,27,28,28],h=[`Готово`,`На ревью`,`В процессе`,`Бэклог`],g=[{label:h[0]??`Series 1`,points:n.t(u,d)},{label:h[1]??`Series 2`,points:n.t(u,f)},{label:h[2]??`Series 3`,points:n.t(u,p)},{label:h[3]??`Series 4`,points:n.t(u,m)}],_={class:`s-ui-chart-stacked-area__canvas-wrap`},v=(0,i.defineComponent)({__name:`SChartStackedArea`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{},totalLabel:{}},setup(t){let a=(0,i.useTemplateRef)(`chartRootRef`),s=(0,i.useTemplateRef)(`chartCanvasRef`),c=(0,i.computed)(()=>t.loading?g:t.series),u=(0,i.computed)(()=>!t.loading&&t.series.length===0?null:l({seriesList:c.value,colorHostElement:a.value,yMax:t.loading?160:t.yMax,yMin:t.loading?0:void 0,yStep:t.loading?20:t.yStep,skeleton:t.loading,totalLabel:t.totalLabel})),d=(0,i.computed)(()=>n.n(c.value,(e,n)=>o(e,a.value,n,t.loading)));return e.r({canvasRef:s,config:u,enabled:(0,i.computed)(()=>t.loading||t.series.length>0)}),(n,o)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:a,class:(0,i.normalizeClass)([`s-ui-chart-stacked-area`,{"s-ui-chart-stacked-area--skeleton":t.loading}])},[(0,i.createElementVNode)(`div`,_,[(0,i.createVNode)((0,i.unref)(e.t),{loading:t.loading},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:s,class:`s-ui-chart-stacked-area__canvas`},null,512)]),_:1},8,[`loading`])]),d.value.length>0?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(r.t),{key:0,items:d.value,disabled:t.loading},null,8,[`items`,`disabled`])):(0,i.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { _ as e, a as t, c as n,
|
|
1
|
+
import { _ as e, a as t, c as n, i as r, m as i, o as a, r as o, s, t as c, v as l, y as u } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
2
|
import { t as d } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
3
|
-
import { n as f, r as p, t as m } from "./buildChartSeriesPoints-
|
|
4
|
-
import { n as h, t as g } from "./SChartLegend-
|
|
3
|
+
import { n as f, r as p, t as m } from "./buildChartSeriesPoints-D-j16fMh.js";
|
|
4
|
+
import { n as h, t as g } from "./SChartLegend-DW16AfUz.js";
|
|
5
5
|
import { computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createVNode as S, defineComponent as C, normalizeClass as w, openBlock as T, unref as E, useTemplateRef as D, withCtx as O } from "vue";
|
|
6
6
|
//#region src/utils/chart/stacked/createChartCrosshairPlugin.ts
|
|
7
7
|
var k = (e) => ({
|
|
@@ -10,20 +10,20 @@ var k = (e) => ({
|
|
|
10
10
|
if ((t.tooltip?.getActiveElements() ?? []).length === 0) return;
|
|
11
11
|
let { ctx: n, chartArea: r } = t;
|
|
12
12
|
if (!r || !t.tooltip) return;
|
|
13
|
-
let
|
|
14
|
-
n.save(), n.beginPath(), n.moveTo(
|
|
13
|
+
let a = u(i.crosshair, e), o = t.tooltip.caretX;
|
|
14
|
+
n.save(), n.beginPath(), n.moveTo(o, r.top), n.lineTo(o, r.bottom), n.lineWidth = 1, n.strokeStyle = a, n.stroke(), n.restore();
|
|
15
15
|
}
|
|
16
|
-
}), A = (t, n,
|
|
17
|
-
palette:
|
|
18
|
-
paletteFallback:
|
|
19
|
-
skeletonPalette:
|
|
20
|
-
skeletonFallback:
|
|
21
|
-
}), j = 20, M = "stack0", N = ({ seriesList: e, colorHostElement:
|
|
16
|
+
}), A = (t, n, r, a = !1) => h(t, n, r, a, {
|
|
17
|
+
palette: l,
|
|
18
|
+
paletteFallback: i.stackedPalette1,
|
|
19
|
+
skeletonPalette: e,
|
|
20
|
+
skeletonFallback: i.skeletonPalette1
|
|
21
|
+
}), j = 20, M = "stack0", N = ({ seriesList: e, colorHostElement: i, yMax: o, yMin: c, yStep: l = j, skeleton: u = !1, totalLabel: f }) => {
|
|
22
22
|
let m = p({
|
|
23
23
|
seriesList: e,
|
|
24
|
-
colorHostElement:
|
|
24
|
+
colorHostElement: i,
|
|
25
25
|
yMax: o,
|
|
26
|
-
yMin:
|
|
26
|
+
yMin: c,
|
|
27
27
|
yStep: l,
|
|
28
28
|
skeleton: u
|
|
29
29
|
});
|
|
@@ -36,8 +36,8 @@ var k = (e) => ({
|
|
|
36
36
|
datasets: e.map((e, t) => ({
|
|
37
37
|
label: e.label,
|
|
38
38
|
data: e.points.map((e) => e.value),
|
|
39
|
-
borderColor: A(t,
|
|
40
|
-
backgroundColor: A(t,
|
|
39
|
+
borderColor: A(t, i, e.fillColor, u),
|
|
40
|
+
backgroundColor: A(t, i, e.fillColor, u),
|
|
41
41
|
borderWidth: 0,
|
|
42
42
|
fill: !0,
|
|
43
43
|
pointRadius: 0,
|
|
@@ -49,7 +49,7 @@ var k = (e) => ({
|
|
|
49
49
|
options: {
|
|
50
50
|
responsive: !0,
|
|
51
51
|
maintainAspectRatio: !1,
|
|
52
|
-
interaction:
|
|
52
|
+
interaction: r(u, {
|
|
53
53
|
mode: "index",
|
|
54
54
|
intersect: !1
|
|
55
55
|
}),
|
|
@@ -62,7 +62,7 @@ var k = (e) => ({
|
|
|
62
62
|
bodyColor: v,
|
|
63
63
|
footerColor: v,
|
|
64
64
|
displayColors: !1,
|
|
65
|
-
position:
|
|
65
|
+
position: s,
|
|
66
66
|
yAlign: "bottom",
|
|
67
67
|
xAlign: "center",
|
|
68
68
|
caretPadding: 8,
|
|
@@ -78,7 +78,7 @@ var k = (e) => ({
|
|
|
78
78
|
stacked: !0
|
|
79
79
|
})
|
|
80
80
|
},
|
|
81
|
-
plugins: a(u, [k(
|
|
81
|
+
plugins: a(u, [k(i)])
|
|
82
82
|
};
|
|
83
83
|
}, P = [
|
|
84
84
|
"24.02",
|
|
@@ -199,7 +199,7 @@ var k = (e) => ({
|
|
|
199
199
|
skeleton: e.loading,
|
|
200
200
|
totalLabel: e.totalLabel
|
|
201
201
|
})), a = _(() => f(r.value, (n, r) => A(n, t.value, r, e.loading)));
|
|
202
|
-
return
|
|
202
|
+
return o({
|
|
203
203
|
canvasRef: n,
|
|
204
204
|
config: i,
|
|
205
205
|
enabled: _(() => e.loading || e.series.length > 0)
|
|
@@ -207,7 +207,7 @@ var k = (e) => ({
|
|
|
207
207
|
ref_key: "chartRootRef",
|
|
208
208
|
ref: t,
|
|
209
209
|
class: w(["s-ui-chart-stacked-area", { "s-ui-chart-stacked-area--skeleton": e.loading }])
|
|
210
|
-
}, [x("div", V, [S(E(
|
|
210
|
+
}, [x("div", V, [S(E(c), { loading: e.loading }, {
|
|
211
211
|
default: O(() => [x("canvas", {
|
|
212
212
|
ref_key: "chartCanvasRef",
|
|
213
213
|
ref: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./SChartSkeletonHost-
|
|
1
|
+
const e=require("./SChartSkeletonHost-YmLC5zOX.cjs"),t=require("./buildCartesianChartScales-Dck5yBMo.cjs"),n=require("./buildChartSeriesPoints-lASMQmBx.cjs"),r=require("./SChartLegend-BFwzIA4x.cjs");let i=require("vue");var a=(t,n,i,a=!1)=>r.n(t,n,i,a,{palette:e.p,paletteFallback:e.m.barStackedPalette1,skeletonPalette:e.f,skeletonFallback:e.m.barSkeletonPalette1}),o=3,s=4,c=(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()},l=t=>({id:`stackedBarHoverOutline`,afterDatasetsDraw(n){let r=n.tooltip?.getActiveElements()??[];if(r.length===0)return;let i=1/0,a=1/0,l=-1/0,u=-1/0;for(let e of r){let{x:t,y:n,width:r,base:o}=e.element.getProps([`x`,`y`,`width`,`base`]),s=t-r/2,c=t+r/2,d=n,f=o;i=Math.min(i,s),l=Math.max(l,c),a=Math.min(a,d),u=Math.max(u,f)}let d=e.y(e.m.barHoverOutline,t),{ctx:f,chartArea:p}=n,m=o/2,h=p?.bottom??u,g=Math.min(u,h),_=i+m,v=a+m,y=l-i-o,b=g-a-o;if(y<=0||b<=0)return;let x=Math.max(0,s-m);f.save(),f.strokeStyle=d,f.lineWidth=o,c(f,_,v,y,b,x),f.restore()}}),u=5,d=`stack0`,f=36,p=4,m=12,h=({seriesList:r,colorHostElement:i,yMax:o,yMin:s,yStep:c=u,skeleton:h=!1})=>{let g=n.r({seriesList:r,colorHostElement:i,yMax:o,yMin:s,yStep:c,skeleton:h});if(!g)return null;let{axisLabelColor:_,gridColor:v,tooltipBackgroundColor:y,tooltipTextColor:b,resolvedYMax:x,resolvedYMin:S,chartLabels:C,pointCaptions:w,topSeriesIndex:T}=g;return{type:`bar`,data:{labels:C,datasets:r.map((e,t)=>{let n=a(t,i,e.fillColor,h);return{label:e.label,data:e.points.map(e=>e.value),backgroundColor:n,hoverBackgroundColor:n,borderWidth:0,hoverBorderWidth:0,stack:d,barThickness:f,borderRadius:t===T?{topLeft:p,topRight:p}:0,...t===0?{captions:w}:{}}})},options:{responsive:!0,maintainAspectRatio:!1,interaction:e.i(h,{mode:`index`,intersect:!1}),plugins:{legend:{display:!1},tooltip:{enabled:e.a(h),backgroundColor:y,titleColor:b,bodyColor:b,displayColors:!1,position:e.u,yAlign:`bottom`,xAlign:`center`,caretPadding:8,callbacks:e.d()}},scales:t.t({axisLabelColor:_,gridColor:v,yMin:S,yMax:x,yStep:c,stacked:!0,xTickFontSize:m})},plugins:e.o(h,[l(i)])}},g=[`5 неделя`,`6 неделя`,`7 неделя`,`8 неделя`,`9 неделя`,`10 неделя`,`11 неделя`,`12 неделя`,`13 неделя`,`14 неделя`,`15 неделя`,`16 неделя`],_=[12,14,15,16,18,17,16,15,14,13,12,11],v=[6,7,8,8,9,8,7,7,6,6,5,5],y=[4,5,5,6,6,5,5,4,4,3,3,3],b=[`Series 1`,`Series 2`,`Series 3`],x=[{label:b[0]??`Series 1`,points:n.t(g,_)},{label:b[1]??`Series 2`,points:n.t(g,v)},{label:b[2]??`Series 3`,points:n.t(g,y)}],S={class:`s-ui-chart-stacked-bar__canvas-wrap`},C=(0,i.defineComponent)({__name:`SChartStackedBar`,props:{series:{default:()=>[]},loading:{type:Boolean,default:!1},yMax:{},yStep:{}},setup(t){let o=(0,i.useTemplateRef)(`chartRootRef`),s=(0,i.useTemplateRef)(`chartCanvasRef`),c=(0,i.computed)(()=>t.loading?x:t.series),l=(0,i.computed)(()=>!t.loading&&t.series.length===0?null:h({seriesList:c.value,colorHostElement:o.value,yMax:t.loading?50:t.yMax,yMin:t.loading?0:void 0,yStep:t.loading?5:t.yStep,skeleton:t.loading})),u=(0,i.computed)(()=>n.n(c.value,(e,n)=>a(e,o.value,n,t.loading)));return e.r({canvasRef:s,config:l,enabled:(0,i.computed)(()=>t.loading||t.series.length>0)}),(n,a)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{ref_key:`chartRootRef`,ref:o,class:(0,i.normalizeClass)([`s-ui-chart-stacked-bar`,{"s-ui-chart-stacked-bar--skeleton":t.loading}])},[(0,i.createElementVNode)(`div`,S,[(0,i.createVNode)((0,i.unref)(e.t),{loading:t.loading},{default:(0,i.withCtx)(()=>[(0,i.createElementVNode)(`canvas`,{ref_key:`chartCanvasRef`,ref:s,class:`s-ui-chart-stacked-bar__canvas`},null,512)]),_:1},8,[`loading`])]),u.value.length>0?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(r.t),{key:0,items:u.value,disabled:t.loading},null,8,[`items`,`disabled`])):(0,i.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return C}});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as e, d as t, f as n, i as r,
|
|
1
|
+
import { a as e, d as t, f as n, i as r, m as i, o as a, p as o, r as s, t as c, u as l, y as u } from "./SChartSkeletonHost-CnfMevXX.js";
|
|
2
2
|
import { t as d } from "./buildCartesianChartScales-EofFq3ry.js";
|
|
3
|
-
import { n as f, r as p, t as m } from "./buildChartSeriesPoints-
|
|
4
|
-
import { n as h, t as g } from "./SChartLegend-
|
|
3
|
+
import { n as f, r as p, t as m } from "./buildChartSeriesPoints-D-j16fMh.js";
|
|
4
|
+
import { n as h, t as g } from "./SChartLegend-DW16AfUz.js";
|
|
5
5
|
import { computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createVNode as S, defineComponent as C, normalizeClass as w, openBlock as T, unref as E, useTemplateRef as D, withCtx as O } from "vue";
|
|
6
6
|
//#region src/utils/chart/bar/resolveBarStackedSeriesColor.ts
|
|
7
|
-
var k = (e,
|
|
8
|
-
palette:
|
|
9
|
-
paletteFallback:
|
|
10
|
-
skeletonPalette:
|
|
11
|
-
skeletonFallback:
|
|
7
|
+
var k = (e, t, r, a = !1) => h(e, t, r, a, {
|
|
8
|
+
palette: o,
|
|
9
|
+
paletteFallback: i.barStackedPalette1,
|
|
10
|
+
skeletonPalette: n,
|
|
11
|
+
skeletonFallback: i.barSkeletonPalette1
|
|
12
12
|
}), A = 3, j = 4, M = (e, t, n, r, i, a) => {
|
|
13
13
|
let o = Math.min(a, r / 2, i), s = o;
|
|
14
14
|
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();
|
|
@@ -17,25 +17,25 @@ var k = (e, r, i, a = !1) => h(e, r, i, a, {
|
|
|
17
17
|
afterDatasetsDraw(t) {
|
|
18
18
|
let n = t.tooltip?.getActiveElements() ?? [];
|
|
19
19
|
if (n.length === 0) return;
|
|
20
|
-
let r = Infinity,
|
|
20
|
+
let r = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
|
|
21
21
|
for (let e of n) {
|
|
22
|
-
let { x: t, y: n, width:
|
|
22
|
+
let { x: t, y: n, width: i, base: c } = e.element.getProps([
|
|
23
23
|
"x",
|
|
24
24
|
"y",
|
|
25
25
|
"width",
|
|
26
26
|
"base"
|
|
27
|
-
]), l = t -
|
|
28
|
-
r = Math.min(r, l),
|
|
27
|
+
]), l = t - i / 2, u = t + i / 2, d = n, f = c;
|
|
28
|
+
r = Math.min(r, l), o = Math.max(o, u), a = Math.min(a, d), s = Math.max(s, f);
|
|
29
29
|
}
|
|
30
|
-
let c = u(
|
|
30
|
+
let c = u(i.barHoverOutline, e), { ctx: l, chartArea: d } = t, f = A / 2, p = d?.bottom ?? s, m = Math.min(s, p), h = r + f, g = a + f, _ = o - r - A, v = m - a - A;
|
|
31
31
|
if (_ <= 0 || v <= 0) return;
|
|
32
32
|
let y = Math.max(0, j - f);
|
|
33
33
|
l.save(), l.strokeStyle = c, l.lineWidth = A, M(l, h, g, _, v, y), l.restore();
|
|
34
34
|
}
|
|
35
|
-
}), P = 5, F = "stack0", I = 36, L = 4, R = 12, z = ({ seriesList:
|
|
35
|
+
}), P = 5, F = "stack0", I = 36, L = 4, R = 12, z = ({ seriesList: n, colorHostElement: i, yMax: o, yMin: s, yStep: c = P, skeleton: u = !1 }) => {
|
|
36
36
|
let f = p({
|
|
37
|
-
seriesList:
|
|
38
|
-
colorHostElement:
|
|
37
|
+
seriesList: n,
|
|
38
|
+
colorHostElement: i,
|
|
39
39
|
yMax: o,
|
|
40
40
|
yMin: s,
|
|
41
41
|
yStep: c,
|
|
@@ -47,13 +47,13 @@ var k = (e, r, i, a = !1) => h(e, r, i, a, {
|
|
|
47
47
|
type: "bar",
|
|
48
48
|
data: {
|
|
49
49
|
labels: b,
|
|
50
|
-
datasets:
|
|
51
|
-
let
|
|
50
|
+
datasets: n.map((e, t) => {
|
|
51
|
+
let n = k(t, i, e.fillColor, u);
|
|
52
52
|
return {
|
|
53
53
|
label: e.label,
|
|
54
54
|
data: e.points.map((e) => e.value),
|
|
55
|
-
backgroundColor:
|
|
56
|
-
hoverBackgroundColor:
|
|
55
|
+
backgroundColor: n,
|
|
56
|
+
hoverBackgroundColor: n,
|
|
57
57
|
borderWidth: 0,
|
|
58
58
|
hoverBorderWidth: 0,
|
|
59
59
|
stack: F,
|
|
@@ -81,11 +81,11 @@ var k = (e, r, i, a = !1) => h(e, r, i, a, {
|
|
|
81
81
|
titleColor: _,
|
|
82
82
|
bodyColor: _,
|
|
83
83
|
displayColors: !1,
|
|
84
|
-
position:
|
|
84
|
+
position: l,
|
|
85
85
|
yAlign: "bottom",
|
|
86
86
|
xAlign: "center",
|
|
87
87
|
caretPadding: 8,
|
|
88
|
-
callbacks:
|
|
88
|
+
callbacks: t()
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
scales: d({
|
|
@@ -98,7 +98,7 @@ var k = (e, r, i, a = !1) => h(e, r, i, a, {
|
|
|
98
98
|
xTickFontSize: R
|
|
99
99
|
})
|
|
100
100
|
},
|
|
101
|
-
plugins: a(u, [N(
|
|
101
|
+
plugins: a(u, [N(i)])
|
|
102
102
|
};
|
|
103
103
|
}, B = [
|
|
104
104
|
"5 неделя",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs"),n=require("./useSelectionGroup-TaektE-I.cjs"),r=require("./SInput-DYS84eMS.cjs"),i=require("./SDropdown-B6b7IDjp.cjs"),a=require("./SList-CU2Sy9Md.cjs"),o=require("./SListItem-BDkldLVt.cjs");let s=require("vue"),c=require("@shtabapp/ui-kit-primitives");var l={key:0,class:`s-ui-dropdown-menu__header`},u={key:1,class:`s-ui-dropdown-menu__footer`},d=(0,s.defineComponent)({__name:`SDropdownMenu`,props:{width:{},maxHeight:{},accent:{type:Boolean,default:!1}},setup(e){let t=(0,s.useSlots)(),n=e=>typeof e==`number`?`${e}px`:e,r=(0,s.computed)(()=>({"s-ui-dropdown-menu--accent":e.accent,"s-ui-dropdown-menu--bounded":!!e.maxHeight})),i=(0,s.computed)(()=>({"s-ui-dropdown-menu__body--scrollable":!!e.maxHeight})),a=(0,s.computed)(()=>({"--s-ui-dropdown-menu-width":n(e.width),"--s-ui-dropdown-menu-max-height":n(e.maxHeight)}));return(e,n)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-dropdown-menu`,r.value]),style:(0,s.normalizeStyle)(a.value)},[(0,s.unref)(t).header?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,l,[(0,s.renderSlot)(e.$slots,`header`)])):(0,s.createCommentVNode)(``,!0),(0,s.createElementVNode)(`div`,{class:(0,s.normalizeClass)([`s-ui-dropdown-menu__body`,i.value])},[(0,s.renderSlot)(e.$slots,`default`)],2),(0,s.unref)(t).footer?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,u,[(0,s.renderSlot)(e.$slots,`footer`)])):(0,s.createCommentVNode)(``,!0)],6))}}),f=({listItemScope:e,itemTitle:t,itemSubtitle:n,itemDisabled:r,itemIconLeft:i,listActiveKey:o,isOptionSelected:s})=>{let c=e.item;return{rowKey:e.key,title:a.i(c,t),subtitle:a.i(c,n),disabled:a.n(c,r),iconLeft:a.r(c,i),selected:s,active:o===e.key,revealRight:e.revealRight,tiny:!0}},p=e=>typeof e==`string`||typeof e==`number`,m=(e,t)=>{let n=e[t];if(p(n))return n},h=e=>typeof e==`string`?e:String(e),g=e=>e==null?!1:typeof e==`string`?e.length>0:!0,_=(e,t,n)=>t.find(t=>h(m(t,n)??``)===e),v=e=>typeof e==`object`&&!!e,y=(e,t,n)=>{let r=_(e,t,n);if(r)return m(r,n)},b=function(e){return e.INPUT=`input`,e.CONTENT=`content`,e}({}),x=(e,t,n)=>{if(!e)return!0;let r=e.toLocaleLowerCase(),i=a.i(t,n.itemTitle)?.toLocaleLowerCase()??``,o=h(m(t,n.itemValue)??``).toLocaleLowerCase();return i.includes(r)||o.includes(r)},S=(e,t,n,r)=>{let i=r??((e,t)=>x(e,t,n));return t?e.filter(e=>i(t,e)):[...e]},C=e=>typeof e==`string`&&g(e),w=e=>typeof e==`number`&&g(e),T=(e,t,n)=>{if(t){if(!v(e))return;let t=m(e,n);return C(t)||w(t)?t:void 0}let r=typeof e==`string`||typeof e==`number`?e:void 0;if(C(r)||w(r))return r},E=(e,t,n)=>e?(Array.isArray(e)?e:[e]).flatMap(e=>{let r=T(e,t,n);return g(r)?[r]:[]}):[],D=(e,t)=>{if(C(t)){e.value=t;return}if(w(t)){e.value=t;return}e.value=void 0},O=(e,t,n)=>t.flatMap(t=>{let r=h(t),i=e.find(e=>h(m(e,n)??``)===r);return i?[i]:[]}),k=({modelValue:e,options:t,itemFields:r,multiple:i,returnObject:o,searchable:c,filterOption:l,isDropdownOpen:u,searchQuery:d})=>{let f=(0,s.computed)(()=>(0,s.toValue)(i)),p=(0,s.computed)(()=>(0,s.toValue)(o)),v=(0,s.computed)(()=>(0,s.toValue)(c)===b.INPUT),x=(0,s.computed)(()=>(0,s.toValue)(c)===b.CONTENT),C=(0,s.computed)(()=>!!(0,s.toValue)(c)),w=(0,s.computed)(()=>{let t=(0,s.toValue)(r);return E(e.value,p.value,t.itemValue)}),T=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return S(e,C.value?d.value:``,n,(0,s.toValue)(l))}),k=(0,s.computed)(()=>f.value?n.n.MULTIPLE:n.n.SINGLE),A=(t,n,r)=>{if(p.value){e.value=O(n,t,r);return}e.value=t},ee=(t,n,r)=>{if(!t){e.value=void 0;return}if(p.value){e.value=_(t,n,r)??void 0;return}D(e,y(t,n,r))},te=(0,s.computed)({get:()=>{if(f.value)return w.value.map(e=>h(e));let e=w.value[0];if(g(e))return h(e)},set:e=>{let n=(0,s.toValue)(t),i=(0,s.toValue)(r);if(f.value){A((Array.isArray(e)?e:[]).map(e=>y(e,n,i.itemValue)).filter(e=>g(e)),n,i.itemValue);return}ee(typeof e==`string`?e:void 0,n,i.itemValue)}}),j=(0,s.computed)(()=>w.value.length>0),M=(e,t,n)=>{let r=h(t);return e.find(e=>h(m(e,n)??``)===r)},N=(0,s.computed)(()=>{let e=w.value[0];if(!g(e))return``;let n=(0,s.toValue)(r),i=M((0,s.toValue)(t),e,n.itemValue);return i?a.i(i,n.itemTitle)??``:h(e)}),P=(0,s.computed)(()=>{let e=(0,s.toValue)(t),n=(0,s.toValue)(r);return w.value.map(t=>{let r=M(e,t,n.itemValue);return r?a.i(r,n.itemTitle)??``:h(t)})}),ne=(0,s.computed)(()=>P.value.join(`, `)),re=(0,s.computed)(()=>f.value?w.value.length===0:!N.value),F=(0,s.computed)(()=>v.value&&(u.value||f.value)),I=()=>{d.value=``};return(0,s.watch)(u,e=>{e||I()}),(0,s.watch)(()=>(0,s.toValue)(c),()=>{I()}),{searchQuery:d,selectedValues:w,filteredOptions:T,listSelectionMode:k,listSelectedModel:te,hasSelectedValues:j,singleDisplayLabel:N,multipleDisplayLabels:P,multipleDisplayText:ne,showPlaceholder:re,showInputSearchField:F,isSearchableMode:C,isSearchableInputMode:v,isSearchableContentMode:x,isMultipleMode:f,isReturnObjectMode:p,clearSelection:()=>{e.value=void 0,I()},removeSelectedValue:e=>{let n=h(e);A(w.value.filter(e=>h(e)!==n),(0,s.toValue)(t),(0,s.toValue)(r).itemValue)},resetSearchQuery:I,formatSelectListKey:h,resolveValueFromListKey:e=>y(e,(0,s.toValue)(t),(0,s.toValue)(r).itemValue)}},A={key:1,class:`s-ui-select__empty s-ui-typography-body-14-regular`},ee=[`id`,`aria-expanded`,`aria-controls`,`aria-disabled`,`aria-readonly`,`aria-autocomplete`,`tabindex`],te={key:0,class:`s-ui-select__value`},j={key:1,class:`s-ui-select__placeholder`},M={key:1,class:`s-ui-select__placeholder`},N={key:2,class:`s-ui-select__value`},P={key:3,class:`s-ui-select__value-suffix`},ne=[`name`,`placeholder`,`disabled`,`readonly`],re=20,F=20,I=(0,s.defineComponent)({inheritAttrs:!1,__name:`SSelect`,props:(0,s.mergeModels)({options:{},itemValue:{default:`value`},itemTitle:{default:`label`},itemSubtitle:{default:`subtitle`},itemId:{},itemDisabled:{default:`disabled`},itemIconLeft:{default:`iconLeft`},multiple:{type:Boolean,default:!1},returnObject:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},closableOptions:{type:Boolean,default:!1},searchable:{type:[String,Boolean],default:!1},closeOnSelect:{type:Boolean,default:!0},listHeight:{default:320},searchPlaceholder:{default:`Search`},filterOption:{type:Function},label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iconLeft:{},customize:{default:()=>r.n.NONE},name:{},id:{}},{modelValue:{},modelModifiers:{},searchQuery:{default:``},searchQueryModifiers:{}}),emits:(0,s.mergeModels)([`clear`,`focus`,`blur`,`open`,`close`],[`update:modelValue`,`update:searchQuery`]),setup(n,{expose:l,emit:u}){let p=(0,s.useModel)(n,`modelValue`),m=(0,s.useModel)(n,`searchQuery`),h=u,_=(0,s.useSlots)(),v=(0,s.useId)(),y=(0,s.useId)(),b=(0,s.useTemplateRef)(`triggerInputRef`),x=(0,s.ref)(``),S=(0,s.useTemplateRef)(`searchInputElementRef`),C=(0,s.useTemplateRef)(`panelSearchInputElementRef`),w=(0,s.useTemplateRef)(`listElementRef`),T=(0,s.ref)(),E=(0,s.ref)(!1),D=(0,s.ref)(!1),O=(0,s.computed)(()=>n.itemId??n.itemValue),I=(0,s.computed)(()=>({itemValue:n.itemValue,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemId:O.value})),{selectedValues:L,filteredOptions:R,listSelectionMode:ie,listSelectedModel:z,hasSelectedValues:B,singleDisplayLabel:ae,multipleDisplayLabels:oe,multipleDisplayText:V,showPlaceholder:H,showInputSearchField:U,isSearchableMode:se,isSearchableInputMode:W,isSearchableContentMode:G,isMultipleMode:K,clearSelection:ce,removeSelectedValue:q,resolveValueFromListKey:le,formatSelectListKey:J}=k({modelValue:p,options:()=>n.options,itemFields:()=>I.value,multiple:()=>n.multiple,returnObject:()=>n.returnObject,searchable:()=>n.searchable,filterOption:()=>n.filterOption,isDropdownOpen:E,searchQuery:m}),ue=(0,s.computed)(()=>!!_[`value-suffix`]),de=(0,s.computed)(()=>({disabled:n.disabled,displayLabel:ae.value})),Y=(0,s.computed)(()=>R.value.length>F),fe=(0,s.computed)(()=>G.value||Y.value?n.listHeight:`auto`),pe=(0,s.computed)(()=>{if(!(G.value||Y.value))return n.listHeight}),me=(0,s.computed)(()=>L.value.map(e=>J(e))),he=e=>me.value.includes(e),ge=()=>({tiny:!0}),_e=e=>f({listItemScope:e,itemTitle:n.itemTitle,itemSubtitle:n.itemSubtitle,itemDisabled:n.itemDisabled,itemIconLeft:n.itemIconLeft,listActiveKey:T.value,isOptionSelected:he(e.key)}),ve=e=>{let t=le(e);if(g(t)){if(K.value){q(t);return}p.value=void 0}},ye=(0,s.computed)(()=>n.id??v),be=(0,s.computed)(()=>y),xe=(0,s.computed)(()=>b.value?.fieldElementRef??null),Se=(0,s.computed)(()=>({labels:oe.value,values:L.value,displayText:V.value,disabled:n.disabled||n.readonly,removeValue:q})),Ce=(0,s.computed)(()=>{if(!n.disabled&&(n.readonly&&!W.value||!W.value))return 0}),we=(0,s.computed)(()=>({"s-ui-select--disabled":n.disabled,"s-ui-select--readonly":n.readonly,"s-ui-select--multiple":K.value,"s-ui-select--open":E.value})),Te=()=>{if(G.value){C.value?.focus();return}S.value?.focus()},Ee=async()=>{await(0,s.nextTick)(),C.value?.focus()},De=async()=>{await(0,s.nextTick)(),await w.value?.focusNavigation()},X=async()=>{if(!(n.disabled||n.readonly)&&!E.value){if(E.value=!0,h(`open`),G.value){await Ee();return}if(W.value){await(0,s.nextTick)(),S.value?.focus();return}await De()}},Oe=async()=>{n.disabled||n.readonly||E.value||await X()};(0,s.watch)(m,async e=>{W.value&&(n.disabled||n.readonly||e&&(E.value||await X()))});let Z=()=>{E.value&&(E.value=!1,T.value=void 0,h(`close`))},Q=()=>{!n.closeOnSelect||K.value||Z()};(0,s.watch)(p,(e,t)=>{!n.closeOnSelect||K.value||!E.value||!e||e===t||Z()});let ke=e=>{E.value&&e.target instanceof Element&&e.target.closest(`.s-ui-list-item`)&&Q()},Ae=async e=>{e.key!==`Enter`&&e.key!==` `&&e.key!==`Spacebar`||E.value&&(await(0,s.nextTick)(),Q())},$=async()=>{if(E.value){Z();return}await X()},je=async e=>{if(!(n.disabled||n.readonly)&&e.target instanceof HTMLElement){if(e.target.closest(`.s-ui-select__search-input`)){E.value||await X();return}await $()}},Me=async e=>e.key!==`ArrowDown`&&e.key!==`ArrowUp`?!1:(e.preventDefault(),e.stopPropagation(),E.value||await X(),await De(),await w.value?.handleKeyboardNavigation(e),!0),Ne=e=>{let t=le(e);if(t){if(K.value){L.value.some(t=>J(t)===e)?q(t):z.value=[...L.value.map(e=>J(e)),e];return}z.value=e,Q()}},Pe=async e=>{if(!(n.disabled||n.readonly)&&!await Me(e)){if(e.key===`Escape`){e.preventDefault(),Z();return}if(e.key===`Enter`||e.key===` `){if(e.preventDefault(),E.value&&T.value){Ne(T.value);return}await $()}}},Fe=async e=>{if(e.key===`Escape`){e.preventDefault(),Z();return}await Me(e)},Ie=Fe,Le=e=>{n.disabled||(D.value||h(`focus`,e),D.value=!0)},Re=e=>{if(!(e.currentTarget instanceof HTMLElement))return;let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||(D.value=!1,h(`blur`,e))},ze=()=>{ce(),h(`clear`)};return l({open:X,close:Z,toggle:$,focusSearchInput:Te}),(l,u)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{class:(0,s.normalizeClass)([`s-ui-select`,we.value])},[(0,s.createVNode)((0,s.unref)(i.t),{modelValue:E.value,"onUpdate:modelValue":u[4]||=e=>E.value=e,reference:xe.value,disabled:n.disabled,"match-reference-width":!0,"fit-viewport":!0,"content-id":be.value,"dismiss-on-click-outside":!0,"dismiss-on-escape":!0},{content:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(d),{class:`s-ui-select__menu`,width:`100%`},(0,s.createSlots)({default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{class:`s-ui-select__menu-body`,onClick:ke,onKeydown:Ae},[(0,s.unref)(R).length>0?((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(a.t),{key:0,ref_key:`listElementRef`,ref:w,modelValue:T.value,"onUpdate:modelValue":u[2]||=e=>T.value=e,selected:(0,s.unref)(z),"onUpdate:selected":u[3]||=e=>(0,s.isRef)(z)?z.value=e:null,items:(0,s.unref)(R),"item-key":O.value,"title-key":n.itemTitle,"subtitle-key":n.itemSubtitle,"icon-left-key":n.itemIconLeft,"disabled-key":n.itemDisabled,"selection-mode":(0,s.unref)(ie),mandatory:!n.multiple,height:fe.value,"max-height":pe.value,virtual:Y.value,"item-props":ge},(0,s.createSlots)({_:2},[(0,s.unref)(_).option?{name:`item`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`option`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`0`}:n.closableOptions?{name:`item`,fn:(0,s.withCtx)(n=>[(0,s.createVNode)((0,s.unref)(o.t),(0,s.normalizeProps)((0,s.guardReactiveProps)(_e(n))),(0,s.createSlots)({_:2},[he(n.key)?{name:`right`,fn:(0,s.withCtx)(r=>[(0,s.createVNode)((0,s.unref)(t.t),{appearance:(0,s.unref)(e.t).BARE,variant:(0,s.unref)(e.r).NEUTRAL,size:(0,s.unref)(e.n).SMALL,icon:`closeMini`,disabled:r.disabled||r.readonly,tabindex:-1,onClick:(0,s.withModifiers)(e=>ve(n.key),[`stop`])},null,8,[`appearance`,`variant`,`size`,`disabled`,`onClick`])]),key:`0`}:void 0]),1040)]),key:`1`}:void 0]),1032,[`modelValue`,`selected`,`items`,`item-key`,`title-key`,`subtitle-key`,`icon-left-key`,`disabled-key`,`selection-mode`,`mandatory`,`height`,`max-height`,`virtual`])):((0,s.openBlock)(),(0,s.createElementBlock)(`div`,A,[(0,s.renderSlot)(l.$slots,`empty`,{},()=>[u[8]||=(0,s.createTextVNode)(`No options`,-1)])]))],32)]),_:2},[(0,s.unref)(G)?{name:`header`,fn:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.t),{ref_key:`panelSearchInputElementRef`,ref:C,modelValue:m.value,"onUpdate:modelValue":u[0]||=e=>m.value=e,placeholder:n.searchPlaceholder,disabled:n.disabled,clearable:!1,"icon-left":`search`,onClick:u[1]||=(0,s.withModifiers)(()=>{},[`stop`]),onKeydown:(0,s.unref)(Ie)},null,8,[`modelValue`,`placeholder`,`disabled`,`onKeydown`])]),key:`0`}:void 0,(0,s.unref)(_)[`panel-footer`]?{name:`footer`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`panel-footer`)]),key:`1`}:void 0]),1024)]),_:3},8,[`modelValue`,`reference`,`disabled`,`content-id`]),(0,s.createVNode)((0,s.unref)(r.t),{ref_key:`triggerInputRef`,ref:b,modelValue:x.value,"onUpdate:modelValue":u[7]||=e=>x.value=e,label:n.label,"label-props":n.labelProps,placeholder:n.placeholder,"help-messages":n.helpMessages,"error-messages":n.errorMessages,bordered:n.bordered,disabled:n.disabled,readonly:n.readonly,clearable:n.clearable,"has-value":(0,s.unref)(B),focused:D.value||E.value,"icon-left":n.iconLeft,customize:n.customize,name:n.name,id:ye.value,onClear:ze,onFocus:Le,onBlur:Re},(0,s.createSlots)({control:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,{id:ye.value,class:(0,s.normalizeClass)([`s-ui-select__control s-ui-typography-body-14-regular`,{"s-ui-select__control--multiple":(0,s.unref)(K),"s-ui-select__control--empty":(0,s.unref)(K)&&!(0,s.unref)(B)&&!(0,s.unref)(U),"s-ui-select__control--with-value-suffix":ue.value&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)}]),role:`combobox`,"aria-expanded":E.value,"aria-controls":be.value,"aria-haspopup":`listbox`,"aria-disabled":n.disabled?!0:void 0,"aria-readonly":n.readonly?!0:void 0,"aria-autocomplete":(0,s.unref)(se)?`list`:void 0,tabindex:Ce.value,onClick:je,onKeydown:Pe},[(0,s.unref)(K)?(0,s.renderSlot)(l.$slots,`selection`,(0,s.normalizeProps)((0,s.mergeProps)({key:0},Se.value)),()=>[(0,s.unref)(V)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,te,(0,s.toDisplayString)((0,s.unref)(V)),1)):(0,s.unref)(H)&&!(0,s.unref)(U)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,j,(0,s.toDisplayString)(n.placeholder),1)):(0,s.createCommentVNode)(``,!0)]):(0,s.unref)(H)&&!(0,s.unref)(U)?((0,s.openBlock)(),(0,s.createElementBlock)(`span`,M,(0,s.toDisplayString)(n.placeholder),1)):(0,s.unref)(U)?(0,s.createCommentVNode)(``,!0):((0,s.openBlock)(),(0,s.createElementBlock)(`span`,N,(0,s.toDisplayString)((0,s.unref)(ae)),1)),ue.value&&!(0,s.unref)(K)&&!(0,s.unref)(U)&&!(0,s.unref)(H)?((0,s.openBlock)(),(0,s.createElementBlock)(`div`,P,[(0,s.renderSlot)(l.$slots,`value-suffix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(de.value)))])):(0,s.createCommentVNode)(``,!0),(0,s.unref)(U)?(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)(`input`,{key:4,ref_key:`searchInputElementRef`,ref:S,"onUpdate:modelValue":u[5]||=e=>m.value=e,class:`s-ui-select__search-input`,type:`text`,name:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:`off`,onClick:u[6]||=(0,s.withModifiers)(()=>{},[`stop`]),onFocus:Oe,onKeydown:Fe},null,40,ne)),[[s.vModelText,m.value]]):(0,s.createCommentVNode)(``,!0)],42,ee)]),action:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(c.SIcon),{name:`chevronMiniDown`,size:re,class:`s-ui-select__chevron`})]),_:2},[(0,s.unref)(_).label?{name:`label`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`label`)]),key:`0`}:void 0,(0,s.unref)(_).prefix?{name:`prefix`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prefix`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`1`}:void 0,(0,s.unref)(_).prepend?{name:`prepend`,fn:(0,s.withCtx)(e=>[(0,s.renderSlot)(l.$slots,`prepend`,(0,s.normalizeProps)((0,s.guardReactiveProps)(e)))]),key:`2`}:void 0,(0,s.unref)(_).message?{name:`message`,fn:(0,s.withCtx)(()=>[(0,s.renderSlot)(l.$slots,`message`)]),key:`3`}:void 0]),1032,[`modelValue`,`label`,`label-props`,`placeholder`,`help-messages`,`error-messages`,`bordered`,`disabled`,`readonly`,`clearable`,`has-value`,`focused`,`icon-left`,`customize`,`name`,`id`])],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return I}});
|