@ganpatiinfo/gids-core-web 10.0.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/index.css +59 -0
- package/dist/css/index.css.map +1 -1
- package/dist/gids-action-bar.d.ts +11 -0
- package/dist/gids-action-bar.js +1 -0
- package/dist/gids-activity-gauge.d.ts +1 -1
- package/dist/gids-activity-gauge.js +1 -1
- package/dist/gids-bar-chart.d.ts +1 -1
- package/dist/gids-bar-chart.js +1 -1
- package/dist/gids-calendar-header-panel.d.ts +1 -1
- package/dist/gids-calendar-header-panel.js +1 -1
- package/dist/gids-calendar-month-list.d.ts +1 -1
- package/dist/gids-calendar-month-list.js +1 -1
- package/dist/gids-calendar-year-list.d.ts +1 -1
- package/dist/gids-calendar-year-list.js +1 -1
- package/dist/gids-calendar.d.ts +1 -1
- package/dist/gids-calendar.js +1 -1
- package/dist/gids-chart-legend-item.d.ts +1 -1
- package/dist/gids-chart-legend-item.js +1 -1
- package/dist/gids-chart-legend.d.ts +1 -1
- package/dist/gids-chart-legend.js +1 -1
- package/dist/gids-chart.d.ts +1 -1
- package/dist/gids-chart.js +1 -1
- package/dist/gids-chevron-button.d.ts +1 -1
- package/dist/gids-chevron-button.js +1 -1
- package/dist/gids-dot.d.ts +1 -1
- package/dist/gids-dot.js +1 -1
- package/dist/gids-dropdown-field.d.ts +1 -1
- package/dist/gids-dropdown-field.js +1 -1
- package/dist/gids-dropdown-picker.d.ts +1 -1
- package/dist/gids-dropdown-picker.js +1 -1
- package/dist/gids-dropdown.d.ts +1 -1
- package/dist/gids-dropdown.js +1 -1
- package/dist/gids-field.d.ts +1 -1
- package/dist/gids-field.js +1 -1
- package/dist/gids-filter.d.ts +11 -0
- package/dist/gids-filter.js +1 -0
- package/dist/gids-icon.d.ts +1 -1
- package/dist/gids-icon.js +1 -1
- package/dist/gids-input.d.ts +1 -1
- package/dist/gids-input.js +1 -1
- package/dist/gids-level-gauge.d.ts +1 -1
- package/dist/gids-level-gauge.js +1 -1
- package/dist/gids-line-chart.d.ts +1 -1
- package/dist/gids-line-chart.js +1 -1
- package/dist/gids-notification.d.ts +1 -1
- package/dist/gids-notification.js +1 -1
- package/dist/gids-overflow-container.d.ts +1 -1
- package/dist/gids-overflow-container.js +1 -1
- package/dist/gids-overlay-provider.d.ts +1 -1
- package/dist/gids-overlay-provider.js +1 -1
- package/dist/gids-password-field.d.ts +1 -1
- package/dist/gids-password-field.js +1 -1
- package/dist/gids-pie-chart.d.ts +1 -1
- package/dist/gids-pie-chart.js +1 -1
- package/dist/gids-popover.d.ts +1 -1
- package/dist/gids-popover.js +1 -1
- package/dist/gids-progress-circle.d.ts +1 -1
- package/dist/gids-progress-circle.js +1 -1
- package/dist/gids-scrim.d.ts +1 -1
- package/dist/gids-scrim.js +1 -1
- package/dist/gids-snackbar.d.ts +1 -1
- package/dist/gids-snackbar.js +1 -1
- package/dist/gids-text-field.d.ts +1 -1
- package/dist/gids-text-field.js +1 -1
- package/dist/gids-toggle-button.d.ts +1 -1
- package/dist/gids-toggle-button.js +1 -1
- package/dist/gids-tooltip.d.ts +1 -1
- package/dist/gids-tooltip.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{p-DfFqFdmS.js → p-BQ-ZnlnH.js} +1 -1
- package/dist/{p-9_mrQ7ac.js → p-BZCJlqVe.js} +1 -1
- package/dist/p-Bf3p-DY2.js +1 -0
- package/dist/{p-CIP0xyhD.js → p-BpQB6ncp.js} +1 -1
- package/dist/p-CHGTBObD.js +1 -0
- package/dist/{p-CPSHPtGE.js → p-CP1wz2PI.js} +1 -1
- package/dist/{p-D93TNeOt.js → p-CQH7eAs3.js} +1 -1
- package/dist/{p-CJzporPT.js → p-CW7tw1Fb.js} +1 -1
- package/dist/{p-D_wcwB7E.js → p-CaauwQNd.js} +1 -1
- package/dist/p-Cn3-K5eR.js +1 -0
- package/dist/{p-quZYWCxU.js → p-CoS0NuDU.js} +1 -1
- package/dist/{p-BnL97lOW.js → p-D4Pimu_8.js} +1 -1
- package/dist/p-D6lxqcxP.js +1 -0
- package/dist/p-DMNS1d8v.js +1 -0
- package/dist/{p-BvYnawkJ.js → p-DNTv2BQ5.js} +1 -1
- package/dist/{p-tyIgTtUC.js → p-DPIK2ayL.js} +1 -1
- package/dist/{p-BiPAgxAQ.js → p-Db62Pz3n.js} +1 -1
- package/dist/{p-uqSjmNkw.js → p-Degg_WJz.js} +1 -1
- package/dist/{p-h6alWGT8.js → p-DfxTsSdZ.js} +1 -1
- package/dist/p-Dg2yoUxw.js +1 -0
- package/dist/p-DmLoB2Dn.js +1 -0
- package/dist/p-DoCwI_bx.js +1 -0
- package/dist/p-H1JIMJ2t.js +1 -0
- package/dist/p-JjN8U9B5.js +1 -0
- package/dist/p-UVmSPzTd.js +1 -0
- package/dist/p-UxDcM-C5.js +1 -0
- package/dist/{p-Bmb-HiXg.js → p-V48JyMbP.js} +1 -1
- package/dist/{p-B81J5HCC.js → p-mZJdpfOo.js} +1 -1
- package/dist/types/components/html/GidsButtonGroup/GidsButtonGroup.d.ts +2 -2
- package/dist/types/components/webComponents/GidsActionBar/GidsActionBar.d.ts +59 -0
- package/dist/types/components/webComponents/GidsFilter/GidsFilter.d.ts +55 -0
- package/dist/types/components/webComponents/GidsToggleButton/GidsToggleButton.d.ts +5 -3
- package/dist/types/components.d.ts +260 -5
- package/dist-bundled/es/gids-action-bar.js +177 -0
- package/dist-bundled/es/gids-activity-gauge.js +1 -1
- package/dist-bundled/es/gids-bar-chart.js +3 -3
- package/dist-bundled/es/gids-calendar-header-panel.js +4 -4
- package/dist-bundled/es/gids-calendar-month-list.js +3 -3
- package/dist-bundled/es/gids-calendar-year-list.js +4 -4
- package/dist-bundled/es/gids-calendar.js +22 -22
- package/dist-bundled/es/gids-chart-legend-item.js +4 -4
- package/dist-bundled/es/gids-chart-legend.js +4 -4
- package/dist-bundled/es/gids-chart.js +22 -22
- package/dist-bundled/es/gids-chevron-button.js +10 -10
- package/dist-bundled/es/gids-dot.js +3 -3
- package/dist-bundled/es/gids-dropdown-field.js +8 -8
- package/dist-bundled/es/gids-dropdown-picker.js +1 -1
- package/dist-bundled/es/gids-dropdown.js +4 -4
- package/dist-bundled/es/gids-field.js +1 -1
- package/dist-bundled/es/gids-filter.js +6 -0
- package/dist-bundled/es/gids-icon.js +4 -4
- package/dist-bundled/es/gids-input.js +1 -1
- package/dist-bundled/es/gids-level-gauge.js +4 -4
- package/dist-bundled/es/gids-line-chart.js +4 -4
- package/dist-bundled/es/gids-notification.js +1 -1
- package/dist-bundled/es/gids-overflow-container.js +2 -2
- package/dist-bundled/es/gids-overlay-provider.js +12 -12
- package/dist-bundled/es/gids-password-field.js +36 -36
- package/dist-bundled/es/gids-pie-chart.js +4 -4
- package/dist-bundled/es/gids-popover.js +5 -5
- package/dist-bundled/es/gids-progress-circle.js +1 -1
- package/dist-bundled/es/gids-scrim.js +2 -2
- package/dist-bundled/es/gids-snackbar.js +1 -1
- package/dist-bundled/es/gids-text-field.js +12 -12
- package/dist-bundled/es/gids-toggle-button.js +4 -44
- package/dist-bundled/es/gids-tooltip.js +5 -5
- package/dist-bundled/es/index.js +3 -3
- package/dist-bundled/es/{p-DfFqFdmS-DjI2pk-0.js → p-BQ-ZnlnH-CUVdDHzX.js} +6 -6
- package/dist-bundled/es/{p-9_mrQ7ac-If6e6cvJ.js → p-BZCJlqVe-BcSwze-q.js} +6 -6
- package/dist-bundled/es/p-Bf3p-DY2-CPqEc-vc.js +672 -0
- package/dist-bundled/es/{p-CIP0xyhD-D6y5soLj.js → p-BpQB6ncp-C2AWddf-.js} +11 -11
- package/dist-bundled/es/{p-DKsrt7dx-ImYLc4xz.js → p-CHGTBObD-EN4cCwtX.js} +3 -3
- package/dist-bundled/es/{p-CPSHPtGE-C7baJgXR.js → p-CP1wz2PI-DhVAsHFS.js} +4 -4
- package/dist-bundled/es/{p-D93TNeOt-Vvshbux8.js → p-CQH7eAs3-BVowyVGn.js} +14 -14
- package/dist-bundled/es/{p-CJzporPT-I_OdjJsQ.js → p-CW7tw1Fb-DtJ5TwCU.js} +18 -18
- package/dist-bundled/es/{p-D_wcwB7E-d3jYxfod.js → p-CaauwQNd-D6_PbcRr.js} +1 -1
- package/dist-bundled/es/{p-BaO-kEWS-ZITkeP-j.js → p-Cn3-K5eR-tQ1EOnDF.js} +22 -20
- package/dist-bundled/es/{p-quZYWCxU-CPyWW0nv.js → p-CoS0NuDU-CqmDcRWj.js} +9 -9
- package/dist-bundled/es/{p-BnL97lOW-BO0p4EdC.js → p-D4Pimu_8-DfEGRQGf.js} +1 -1
- package/dist-bundled/es/p-D6lxqcxP-DWrZi1Xi.js +74 -0
- package/dist-bundled/es/{p-Dehss-X0-Di5vMgvd.js → p-DMNS1d8v-CHF62UXm.js} +3 -3
- package/dist-bundled/es/{p-BvYnawkJ-DohV9UNG.js → p-DNTv2BQ5-Bwgd30mM.js} +6 -6
- package/dist-bundled/es/{p-tyIgTtUC-C8jR4A5G.js → p-DPIK2ayL-DPEbctqo.js} +4 -4
- package/dist-bundled/es/{p-BiPAgxAQ-BtMBQpJY.js → p-Db62Pz3n-DpQjwBYb.js} +5 -5
- package/dist-bundled/es/{p-uqSjmNkw-Cz2T86sC.js → p-Degg_WJz-BLua06el.js} +3 -3
- package/dist-bundled/es/{p-h6alWGT8-CSY2g3c8.js → p-DfxTsSdZ-C2Afv1lS.js} +8 -8
- package/dist-bundled/es/{p-CRngHsR7-DL9wz3Z3.js → p-Dg2yoUxw-Cca8ROd_.js} +4 -4
- package/dist-bundled/es/p-DmLoB2Dn-D-FSoCvI.js +44 -0
- package/dist-bundled/es/{p-B_HaXpJZ-a2SDgQ0E.js → p-DoCwI_bx-BXHlZI7-.js} +7 -7
- package/dist-bundled/es/p-H1JIMJ2t-DEXp7M4I.js +152 -0
- package/dist-bundled/es/{p-BFHWXEeg-ByjSjz8i.js → p-JjN8U9B5-GeWjfJBY.js} +23 -21
- package/dist-bundled/es/{p-KxRqlvSh-JOFDmT0B.js → p-UVmSPzTd-DiTxS9kW.js} +8 -8
- package/dist-bundled/es/{p-DZWWuJac-DNQvnHAr.js → p-UxDcM-C5-Dr5d_WpJ.js} +2 -2
- package/dist-bundled/es/{p-Bmb-HiXg-MyHWdhpw.js → p-V48JyMbP-Bx-0od-Z.js} +12 -12
- package/dist-bundled/es/{p-B81J5HCC-Bkt2yXKi.js → p-mZJdpfOo-DicbKil0.js} +7 -7
- package/dist-bundled/umd/gids-action-bar.umd.js +7 -0
- package/dist-bundled/umd/gids-activity-gauge.umd.js +2 -2
- package/dist-bundled/umd/gids-bar-chart.umd.js +3 -3
- package/dist-bundled/umd/gids-calendar-header-panel.umd.js +2 -2
- package/dist-bundled/umd/gids-calendar-month-list.umd.js +2 -2
- package/dist-bundled/umd/gids-calendar-year-list.umd.js +2 -2
- package/dist-bundled/umd/gids-calendar.umd.js +2 -2
- package/dist-bundled/umd/gids-chart-legend-item.umd.js +2 -2
- package/dist-bundled/umd/gids-chart-legend.umd.js +2 -2
- package/dist-bundled/umd/gids-chart.umd.js +3 -3
- package/dist-bundled/umd/gids-chevron-button.umd.js +2 -2
- package/dist-bundled/umd/gids-dot.umd.js +2 -2
- package/dist-bundled/umd/gids-dropdown-field.umd.js +2 -2
- package/dist-bundled/umd/gids-dropdown-picker.umd.js +2 -2
- package/dist-bundled/umd/gids-dropdown.umd.js +2 -2
- package/dist-bundled/umd/gids-field.umd.js +2 -2
- package/dist-bundled/umd/gids-filter.umd.js +7 -0
- package/dist-bundled/umd/gids-icon.umd.js +2 -2
- package/dist-bundled/umd/gids-input.umd.js +2 -2
- package/dist-bundled/umd/gids-level-gauge.umd.js +2 -2
- package/dist-bundled/umd/gids-line-chart.umd.js +2 -2
- package/dist-bundled/umd/gids-notification.umd.js +2 -2
- package/dist-bundled/umd/gids-overflow-container.umd.js +2 -2
- package/dist-bundled/umd/gids-overlay-provider.umd.js +2 -2
- package/dist-bundled/umd/gids-password-field.umd.js +2 -2
- package/dist-bundled/umd/gids-pie-chart.umd.js +2 -2
- package/dist-bundled/umd/gids-popover.umd.js +2 -2
- package/dist-bundled/umd/gids-progress-circle.umd.js +2 -2
- package/dist-bundled/umd/gids-scrim.umd.js +2 -2
- package/dist-bundled/umd/gids-snackbar.umd.js +2 -2
- package/dist-bundled/umd/gids-text-field.umd.js +2 -2
- package/dist-bundled/umd/gids-toggle-button.umd.js +3 -3
- package/dist-bundled/umd/gids-tooltip.umd.js +2 -2
- package/dist-bundled/umd/index.umd.js +2 -2
- package/dist-bundled/umd-complete/gids-core-web.umd.js +8 -8
- package/package.json +20 -4
- package/dist/p-BFHWXEeg.js +0 -1
- package/dist/p-B_HaXpJZ.js +0 -1
- package/dist/p-BaO-kEWS.js +0 -1
- package/dist/p-CRngHsR7.js +0 -1
- package/dist/p-Ct3Ixgvf.js +0 -1
- package/dist/p-DKsrt7dx.js +0 -1
- package/dist/p-DZWWuJac.js +0 -1
- package/dist/p-Dehss-X0.js +0 -1
- package/dist/p-KxRqlvSh.js +0 -1
- package/dist/p-MgTlrSP_.js +0 -1
- package/dist-bundled/es/p-Ct3Ixgvf-CNP_PKwP.js +0 -646
- package/dist-bundled/es/p-MgTlrSP_-DifRVv94.js +0 -70
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as a,H as i,h as e}from"./p-
|
|
1
|
+
import{t,p as a,H as i,h as e}from"./p-Bf3p-DY2.js";import{GidsBarChartWebUtils as r}from"@ganpatiinfo/gids-web-shared";import{G as s}from"./p-DMNS1d8v.js";import{d as l}from"./p-DoCwI_bx.js";import{d as n}from"./p-mZJdpfOo.js";const{getGidsBarChartClassNames:o}=r,d=a(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.breakpoint="desktop",this.legend="none",this.chartData=[],this.yAxisVisible=!1,this.dataPoints=[],this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}chartDataChanged(){this.updateDimensions()}dataPointsChanged(t){this.dataPoints=t}legendChanged(t){this.legend=t}yAxisVisibilityChanged(t){this.yAxisVisible=t}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const t=this.hostElement.getBoundingClientRect();this.width=t.width,this.height=t.height>0?t.height:300}render(){if(this.chartLoading)return e("div",{class:"gids-bar-chart__no-data"},e(s,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const t=this?.chartData?.[0]?.data?.map((t=>t.label))??[],a=t.length,i=Array(a).fill(0);this.chartData.forEach((t=>{Array.isArray(t?.data)&&t.data.forEach(((t,e)=>{e<a&&(i[e]=(i[e]??0)+(t?.value||0))}))}));const r=i.length>0?Math.max(...i):10,l=Math.pow(10,Math.floor(Math.log10(r||1)));let n=l;r/l<=2?n=l/5:r/l<=5&&(n=l/2);const d=Math.ceil(r/n)*n,g=[];if(Array.isArray(this.dataPoints)&&this.dataPoints.length>0){const t=[...this.dataPoints].sort(((t,a)=>t-a)),a=t.length>1?(t[1]??200)-(t[0]??0):200,e=Math.max(...t,d,...i),r=Math.ceil(e/(a||1));for(let t=0;t<=r;t++)g.push(t*a)}else{const t=5,a=d/(t-1);for(let i=0;i<t;i++)g.push(Math.round(0+i*a))}const h=Math.max(...g)-0||1,c=o({breakpoint:this.breakpoint});let b=!1,p=!1;"mobile"===this.breakpoint?"none"!==this.legend&&(b=!0):"top"===this.legend?b=!0:"right"===this.legend&&(p=!0);const _=100/a,y=.4*_;return e("div",{class:c},b?e("div",{class:"gids-bar-chart__header"},e("gids-chart-legend",{orientation:"horizontal"},this.chartData.map(((t,a)=>e("gids-chart-legend-item",{key:t.label,seriesType:`${a+1}`,orientation:"horizontal"},t.label))))):null,e("div",{class:"gids-bar-chart__main-container"},e("div",{class:"gids-bar-chart__grid-layout"},e("span",{class:"gids-bar-chart__y-axis-label"},this.yAxisLabel),e("div",{class:"gids-bar-chart__chart-stage-container"},this.yAxisVisible?e("div",{class:"gids-bar-chart__y-axis-scale-container"},g.map((t=>e("span",{class:"gids-bar-chart__scale-text gids-bar-chart__y-axis-scale-value",key:t,style:{bottom:(t-0)/h*100+"%"}},t)))):null,e("div",{class:"gids-bar-chart__chart-stage"},e("svg",{viewBox:"0 0 100 100",class:"gids-bar-chart__chart-vector",preserveAspectRatio:"none"},g.map((t=>{const a=100-(t-0)/h*100;return e("line",{x1:"0",y1:a,x2:"100",y2:a,class:"gids-bar-chart__grid-line",key:t})})),t.map(((t,a)=>{const i=a*_+(_-y)/2;let r=0;const s=[...this.chartData.map(((t,i)=>{if(!Array.isArray(t.data))return null;const e=t.data[a];if(!e)return null;const s=(e.value||0)/h*100,l=100-s-r;return r+=s,{seriesIdx:i,crownY:l,height:s}})).filter((t=>null!==t&&t.height>0))].sort(((t,a)=>a.seriesIdx-t.seriesIdx));return e("g",{key:a},s.map((t=>{const a=.3*y,r=`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tM ${i},${t.crownY+a}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQ ${i},${t.crownY} ${i+a},${t.crownY}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tH ${i+y-a}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQ ${i+y},${t.crownY} ${i+y},${t.crownY+a}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tV 100\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tH ${i}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tZ\n\t\t\t\t\t\t\t\t\t\t\t\t\t`.replace(/\s+/g," ").trim();return e("path",{key:t.seriesIdx,d:r,class:`gids-bar-chart__bar gids-bar-chart__series-bar-${t.seriesIdx+1}`})})))}))))),e("div",{class:"gids-bar-chart__x-axis-scale-container"},t.map(((t,a)=>e("span",{class:"gids-bar-chart__scale-text",key:a},t)))),e("span",{class:"gids-bar-chart__x-axis-label"},this.xAxisLabel)),p?e("gids-chart-legend",{orientation:"vertical"},this.chartData.map(((t,a)=>e("gids-chart-legend-item",{key:t.label,seriesType:`${a+1}`,orientation:"vertical"},t.label)))):null))}get hostElement(){return this}static get watchers(){return{chartData:[{chartDataChanged:0}],dataPoints:[{dataPointsChanged:0}],legend:[{legendChanged:0}],yAxisVisible:[{yAxisVisibilityChanged:0}]}}static get style(){return":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-bar-chart{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}.gids-bar-chart--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-bar-chart__main-container{display:flex;gap:var(--gids-gap-200)}.gids-bar-chart__header{display:flex;justify-content:flex-end;align-items:center;width:100%;margin-bottom:var(--gids-padding-vertical-edge-to-element-200)}.gids-bar-chart__grid-layout{display:grid;grid-template-columns:auto 1fr;grid-template-rows:minmax(180px, 280px) auto auto;flex:1;width:100%;height:100%;box-sizing:border-box}.gids-bar-chart__y-axis-label{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:center;margin-right:var(--gids-padding-horizontal-edge-to-element-150);font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap}.gids-bar-chart__chart-stage-container{grid-column:2;grid-row:1;position:relative;width:100%;height:100%;padding-left:var(--gids-container-padding-desktop);box-sizing:border-box}.gids-bar-chart__y-axis-scale-container{position:absolute;top:0;bottom:0;left:0;width:calc(var(--gids-container-padding-desktop) - var(--gids-padding-horizontal-edge-to-element-100));pointer-events:none}.gids-bar-chart__y-axis-scale-value{position:absolute;right:0;transform:translateY(50%)}.gids-bar-chart__chart-stage{position:relative;width:100%;height:100%;border-bottom:var(--gids-border-width-thin) solid var(--gids-color-border-default);box-sizing:border-box}.gids-bar-chart__chart-vector{display:block;width:100%;height:100%;overflow:visible}.gids-bar-chart__grid-line{stroke:var(--gids-color-border-default);stroke-width:0.5;fill:none}.gids-bar-chart{}.gids-bar-chart__bar{vector-effect:non-scaling-stroke;}.gids-bar-chart__bar.gids-bar-chart__series-bar-1{fill:var(--gids-color-icon-subtle)}.gids-bar-chart__bar.gids-bar-chart__series-bar-2{fill:var(--gids-color-icon-warning)}.gids-bar-chart__bar.gids-bar-chart__series-bar-3{fill:var(--gids-color-icon-danger)}.gids-bar-chart{}.gids-bar-chart__x-axis-scale-container{display:flex;grid-column:2;grid-row:2;justify-content:space-around;align-items:center;padding-left:var(--gids-container-padding-desktop);padding-top:var(--gids-padding-vertical-edge-to-element-100);box-sizing:border-box}.gids-bar-chart__x-axis-label{grid-column:2;grid-row:3;display:flex;justify-content:center;align-items:center;padding-top:var(--gids-padding-vertical-edge-to-element-100);font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);white-space:nowrap}.gids-bar-chart__scale-text{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);user-select:none;white-space:nowrap}.gids-bar-chart__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-bar-chart",{breakpoint:[1],legend:[1],chartData:[16],yAxisVisible:[4,"y-axis-visible"],xAxisLabel:[1,"x-axis-label"],yAxisLabel:[1,"y-axis-label"],dataPoints:[16],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{chartData:[{chartDataChanged:0}],dataPoints:[{dataPointsChanged:0}],legend:[{legendChanged:0}],yAxisVisible:[{yAxisVisibilityChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["gids-bar-chart","gids-chart-legend","gids-chart-legend-item"].forEach((a=>{switch(a){case"gids-bar-chart":customElements.get(t(a))||customElements.define(t(a),d);break;case"gids-chart-legend":customElements.get(t(a))||l();break;case"gids-chart-legend-item":customElements.get(t(a))||n()}}))}g();export{d as G,g as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as e,h as a}from"./p-Ct3Ixgvf.js";import{GidsLineChartWebUtils as s}from"@ganpatiinfo/gids-web-shared";import{G as r}from"./p-Dehss-X0.js";import{d as l}from"./p-B_HaXpJZ.js";import{d as n}from"./p-B81J5HCC.js";const{getGidsLineChartClassNames:o}=s,d=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.breakpoint="desktop",this.legend="none",this.chartData=[],this.yAxisVisible=!1,this.dataPoints=[],this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}chartDataChanged(){this.updateDimensions()}dataPointsChanged(t){this.dataPoints=t}legendChanged(t){this.legend=t}yAxisVisibilityChanged(t){this.yAxisVisible=t}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const t=this.hostElement.getBoundingClientRect();this.width=t.width,this.height=t.height>0?t.height:300}render(){if(this.chartLoading)return a("div",{class:"gids-line-chart__no-data"},a(r,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const t=this.chartData.flatMap((t=>Array.isArray(t?.data)?t.data.map((t=>t.value)):[])),i=t.length>0?Math.max(...t):10,e=Math.pow(10,Math.floor(Math.log10(i||1)));let s=e;i/e<=2?s=e/5:i/e<=5&&(s=e/2);const l=Math.ceil(i/s)*s;let n=[];if(Array.isArray(this.dataPoints)&&this.dataPoints.length>0)n=[...this.dataPoints].sort(((t,i)=>t-i));else{const t=5,i=l/(t-1);for(let e=0;e<t;e++)n.push(Math.round(0+e*i))}const d=Math.max(...n,l)-0||1,g=this?.chartData?.[0]?.data?.map((t=>t.label))??[],h=g.length,c=o({breakpoint:this.breakpoint});let p=!1,_=!1;return"mobile"===this.breakpoint?"none"!==this.legend&&(p=!0):"top"===this.legend?p=!0:"right"===this.legend&&(_=!0),a("div",{class:c},p?a("div",{class:"gids-line-chart__header"},a("gids-chart-legend",{orientation:"horizontal"},this.chartData.map(((t,i)=>a("gids-chart-legend-item",{key:t.label,seriesType:`${i+1}`,orientation:"horizontal"},t.label))))):null,a("div",{class:"gids-line-chart__main-container"},a("div",{class:"gids-line-chart__grid-layout"},a("span",{class:"gids-line-chart__y-axis-label"},this.yAxisLabel),a("div",{class:"gids-line-chart__chart-stage-container"},this.yAxisVisible?a("div",{class:"gids-line-chart__y-axis-scale-container"},n.map((t=>a("span",{class:"gids-line-chart__scale-text gids-line-chart__y-axis-scale-value",key:t,style:{bottom:(t-0)/d*100+"%"}},t)))):null,a("div",{class:"gids-line-chart__chart-stage"},a("svg",{viewBox:"0 0 100 100",class:"gids-line-chart__chart-vector",preserveAspectRatio:"none"},a("defs",null,this.chartData.map(((t,i)=>a("linearGradient",{id:`areaGradient-${i}`,x1:"0",y1:"0",x2:"0",y2:"1",key:i},a("stop",{offset:"0%",class:`gids-line-chart__gradient-start-${i}`}),a("stop",{offset:"100%",class:`gids-line-chart__gradient-end-${i}`}))))),n.map((t=>{const i=100-(t-0)/d*100;return a("line",{x1:"0",y1:i,x2:"100",y2:i,class:"gids-line-chart__grid-line",key:t})})),this.chartData.map(((t,i)=>{if(!Array.isArray(t.data)||t.data.length<2)return null;const e=t.data.map(((t,i)=>`${0===i?"M":"L"} ${i/(h-1)*100} ${100-(t.value-0)/d*100}`)).join(" ");return a("g",{key:t.label||i},a("path",{d:`${e} L 100 100 L 0 100 Z`,fill:`url(#areaGradient-${i})`,class:"gids-line-chart__chart-area"}),a("path",{d:e,class:`gids-line-chart__chart-line gids-line-chart__series-line-${i+1}`}))}))))),a("div",{class:"gids-line-chart__x-axis-scale-container"},g.map(((t,i)=>a("span",{class:"gids-line-chart__scale-text",key:i},t)))),a("span",{class:"gids-line-chart__x-axis-label"},this.xAxisLabel)),_?a("gids-chart-legend",{orientation:"vertical"},this.chartData.map(((t,i)=>a("gids-chart-legend-item",{key:t.label,seriesType:`${i+1}`,orientation:"vertical"},t.label)))):null))}get hostElement(){return this}static get watchers(){return{chartData:[{chartDataChanged:0}],dataPoints:[{dataPointsChanged:0}],legend:[{legendChanged:0}],yAxisVisible:[{yAxisVisibilityChanged:0}]}}static get style(){return":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-line-chart{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}.gids-line-chart--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-line-chart__main-container{display:flex;gap:var(--gids-gap-200)}.gids-line-chart__header{display:flex;justify-content:flex-end;align-items:center;width:100%;margin-bottom:var(--gids-padding-vertical-edge-to-element-200)}.gids-line-chart__grid-layout{display:grid;grid-template-columns:auto 1fr;grid-template-rows:minmax(180px, 280px) auto auto;flex:1;width:100%;height:100%;box-sizing:border-box}.gids-line-chart__y-axis-label{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:center;margin-right:var(--gids-padding-horizontal-edge-to-element-150);font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap}.gids-line-chart__chart-stage-container{grid-column:2;grid-row:1;position:relative;width:100%;height:100%;padding-left:var(--gids-container-padding-desktop);box-sizing:border-box}.gids-line-chart__y-axis-scale-container{position:absolute;top:0;bottom:0;left:0;width:calc(var(--gids-container-padding-desktop) - var(--gids-padding-horizontal-edge-to-element-100));pointer-events:none}.gids-line-chart__y-axis-scale-value{position:absolute;right:0;transform:translateY(50%)}.gids-line-chart__chart-stage{position:relative;width:100%;height:100%;border-bottom:var(--gids-border-width-thin) solid var(--gids-color-border-default);box-sizing:border-box}.gids-line-chart__chart-vector{display:block;width:100%;height:100%;overflow:visible}.gids-line-chart__grid-line{stroke:var(--gids-color-border-default);stroke-width:0.5;fill:none}.gids-line-chart__chart-area{stroke:none}.gids-line-chart__chart-line{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.gids-line-chart__chart-line.gids-line-chart__series-line-1{stroke:var(--gids-color-icon-subtle)}.gids-line-chart__chart-line.gids-line-chart__series-line-2{stroke:var(--gids-color-icon-warning)}.gids-line-chart__chart-line.gids-line-chart__series-line-3{stroke:var(--gids-color-icon-danger)}.gids-line-chart__gradient-start-0{stop-color:rgba(127, 86, 217, 0.09);stop-opacity:1}.gids-line-chart__gradient-end-0{stop-color:rgba(127, 86, 217, 0.09);stop-opacity:0}.gids-line-chart__gradient-start-1{stop-color:rgba(127, 86, 217, 0.1);stop-opacity:1}.gids-line-chart__gradient-end-1{stop-color:rgba(127, 86, 217, 0.1);stop-opacity:0}.gids-line-chart__gradient-start-2{stop-color:rgba(127, 86, 217, 0.12);stop-opacity:1}.gids-line-chart__gradient-end-2{stop-color:rgba(127, 86, 217, 0.12);stop-opacity:0}.gids-line-chart__x-axis-scale-container{display:flex;grid-column:2;grid-row:2;justify-content:space-between;align-items:center;padding-left:var(--gids-container-padding-desktop);padding-top:var(--gids-padding-vertical-edge-to-element-100);box-sizing:border-box}.gids-line-chart__x-axis-label{grid-column:2;grid-row:3;display:flex;justify-content:center;align-items:center;padding-top:var(--gids-padding-vertical-edge-to-element-100);font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);white-space:nowrap}.gids-line-chart__scale-text{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);user-select:none;white-space:nowrap}.gids-line-chart__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-line-chart",{breakpoint:[1],legend:[1],chartData:[16],yAxisVisible:[4,"y-axis-visible"],xAxisLabel:[1,"x-axis-label"],yAxisLabel:[1,"y-axis-label"],dataPoints:[16],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{chartData:[{chartDataChanged:0}],dataPoints:[{dataPointsChanged:0}],legend:[{legendChanged:0}],yAxisVisible:[{yAxisVisibilityChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["gids-line-chart","gids-chart-legend","gids-chart-legend-item"].forEach((i=>{switch(i){case"gids-line-chart":customElements.get(t(i))||customElements.define(t(i),d);break;case"gids-chart-legend":customElements.get(t(i))||l();break;case"gids-chart-legend-item":customElements.get(t(i))||n()}}))}g();export{d as G,g as d}
|
|
1
|
+
import{t,p as i,H as e,h as a}from"./p-Bf3p-DY2.js";import{GidsLineChartWebUtils as s}from"@ganpatiinfo/gids-web-shared";import{G as r}from"./p-DMNS1d8v.js";import{d as l}from"./p-DoCwI_bx.js";import{d as n}from"./p-mZJdpfOo.js";const{getGidsLineChartClassNames:o}=s,d=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.breakpoint="desktop",this.legend="none",this.chartData=[],this.yAxisVisible=!1,this.dataPoints=[],this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}chartDataChanged(){this.updateDimensions()}dataPointsChanged(t){this.dataPoints=t}legendChanged(t){this.legend=t}yAxisVisibilityChanged(t){this.yAxisVisible=t}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const t=this.hostElement.getBoundingClientRect();this.width=t.width,this.height=t.height>0?t.height:300}render(){if(this.chartLoading)return a("div",{class:"gids-line-chart__no-data"},a(r,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const t=this.chartData.flatMap((t=>Array.isArray(t?.data)?t.data.map((t=>t.value)):[])),i=t.length>0?Math.max(...t):10,e=Math.pow(10,Math.floor(Math.log10(i||1)));let s=e;i/e<=2?s=e/5:i/e<=5&&(s=e/2);const l=Math.ceil(i/s)*s;let n=[];if(Array.isArray(this.dataPoints)&&this.dataPoints.length>0)n=[...this.dataPoints].sort(((t,i)=>t-i));else{const t=5,i=l/(t-1);for(let e=0;e<t;e++)n.push(Math.round(0+e*i))}const d=Math.max(...n,l)-0||1,g=this?.chartData?.[0]?.data?.map((t=>t.label))??[],h=g.length,c=o({breakpoint:this.breakpoint});let p=!1,_=!1;return"mobile"===this.breakpoint?"none"!==this.legend&&(p=!0):"top"===this.legend?p=!0:"right"===this.legend&&(_=!0),a("div",{class:c},p?a("div",{class:"gids-line-chart__header"},a("gids-chart-legend",{orientation:"horizontal"},this.chartData.map(((t,i)=>a("gids-chart-legend-item",{key:t.label,seriesType:`${i+1}`,orientation:"horizontal"},t.label))))):null,a("div",{class:"gids-line-chart__main-container"},a("div",{class:"gids-line-chart__grid-layout"},a("span",{class:"gids-line-chart__y-axis-label"},this.yAxisLabel),a("div",{class:"gids-line-chart__chart-stage-container"},this.yAxisVisible?a("div",{class:"gids-line-chart__y-axis-scale-container"},n.map((t=>a("span",{class:"gids-line-chart__scale-text gids-line-chart__y-axis-scale-value",key:t,style:{bottom:(t-0)/d*100+"%"}},t)))):null,a("div",{class:"gids-line-chart__chart-stage"},a("svg",{viewBox:"0 0 100 100",class:"gids-line-chart__chart-vector",preserveAspectRatio:"none"},a("defs",null,this.chartData.map(((t,i)=>a("linearGradient",{id:`areaGradient-${i}`,x1:"0",y1:"0",x2:"0",y2:"1",key:i},a("stop",{offset:"0%",class:`gids-line-chart__gradient-start-${i}`}),a("stop",{offset:"100%",class:`gids-line-chart__gradient-end-${i}`}))))),n.map((t=>{const i=100-(t-0)/d*100;return a("line",{x1:"0",y1:i,x2:"100",y2:i,class:"gids-line-chart__grid-line",key:t})})),this.chartData.map(((t,i)=>{if(!Array.isArray(t.data)||t.data.length<2)return null;const e=t.data.map(((t,i)=>`${0===i?"M":"L"} ${i/(h-1)*100} ${100-(t.value-0)/d*100}`)).join(" ");return a("g",{key:t.label||i},a("path",{d:`${e} L 100 100 L 0 100 Z`,fill:`url(#areaGradient-${i})`,class:"gids-line-chart__chart-area"}),a("path",{d:e,class:`gids-line-chart__chart-line gids-line-chart__series-line-${i+1}`}))}))))),a("div",{class:"gids-line-chart__x-axis-scale-container"},g.map(((t,i)=>a("span",{class:"gids-line-chart__scale-text",key:i},t)))),a("span",{class:"gids-line-chart__x-axis-label"},this.xAxisLabel)),_?a("gids-chart-legend",{orientation:"vertical"},this.chartData.map(((t,i)=>a("gids-chart-legend-item",{key:t.label,seriesType:`${i+1}`,orientation:"vertical"},t.label)))):null))}get hostElement(){return this}static get watchers(){return{chartData:[{chartDataChanged:0}],dataPoints:[{dataPointsChanged:0}],legend:[{legendChanged:0}],yAxisVisible:[{yAxisVisibilityChanged:0}]}}static get style(){return":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-line-chart{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}.gids-line-chart--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-line-chart__main-container{display:flex;gap:var(--gids-gap-200)}.gids-line-chart__header{display:flex;justify-content:flex-end;align-items:center;width:100%;margin-bottom:var(--gids-padding-vertical-edge-to-element-200)}.gids-line-chart__grid-layout{display:grid;grid-template-columns:auto 1fr;grid-template-rows:minmax(180px, 280px) auto auto;flex:1;width:100%;height:100%;box-sizing:border-box}.gids-line-chart__y-axis-label{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:center;margin-right:var(--gids-padding-horizontal-edge-to-element-150);font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);writing-mode:vertical-rl;transform:rotate(180deg);white-space:nowrap}.gids-line-chart__chart-stage-container{grid-column:2;grid-row:1;position:relative;width:100%;height:100%;padding-left:var(--gids-container-padding-desktop);box-sizing:border-box}.gids-line-chart__y-axis-scale-container{position:absolute;top:0;bottom:0;left:0;width:calc(var(--gids-container-padding-desktop) - var(--gids-padding-horizontal-edge-to-element-100));pointer-events:none}.gids-line-chart__y-axis-scale-value{position:absolute;right:0;transform:translateY(50%)}.gids-line-chart__chart-stage{position:relative;width:100%;height:100%;border-bottom:var(--gids-border-width-thin) solid var(--gids-color-border-default);box-sizing:border-box}.gids-line-chart__chart-vector{display:block;width:100%;height:100%;overflow:visible}.gids-line-chart__grid-line{stroke:var(--gids-color-border-default);stroke-width:0.5;fill:none}.gids-line-chart__chart-area{stroke:none}.gids-line-chart__chart-line{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.gids-line-chart__chart-line.gids-line-chart__series-line-1{stroke:var(--gids-color-icon-subtle)}.gids-line-chart__chart-line.gids-line-chart__series-line-2{stroke:var(--gids-color-icon-warning)}.gids-line-chart__chart-line.gids-line-chart__series-line-3{stroke:var(--gids-color-icon-danger)}.gids-line-chart__gradient-start-0{stop-color:rgba(127, 86, 217, 0.09);stop-opacity:1}.gids-line-chart__gradient-end-0{stop-color:rgba(127, 86, 217, 0.09);stop-opacity:0}.gids-line-chart__gradient-start-1{stop-color:rgba(127, 86, 217, 0.1);stop-opacity:1}.gids-line-chart__gradient-end-1{stop-color:rgba(127, 86, 217, 0.1);stop-opacity:0}.gids-line-chart__gradient-start-2{stop-color:rgba(127, 86, 217, 0.12);stop-opacity:1}.gids-line-chart__gradient-end-2{stop-color:rgba(127, 86, 217, 0.12);stop-opacity:0}.gids-line-chart__x-axis-scale-container{display:flex;grid-column:2;grid-row:2;justify-content:space-between;align-items:center;padding-left:var(--gids-container-padding-desktop);padding-top:var(--gids-padding-vertical-edge-to-element-100);box-sizing:border-box}.gids-line-chart__x-axis-label{grid-column:2;grid-row:3;display:flex;justify-content:center;align-items:center;padding-top:var(--gids-padding-vertical-edge-to-element-100);font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);white-space:nowrap}.gids-line-chart__scale-text{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit);color:var(--gids-color-text-subtlest);user-select:none;white-space:nowrap}.gids-line-chart__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-line-chart",{breakpoint:[1],legend:[1],chartData:[16],yAxisVisible:[4,"y-axis-visible"],xAxisLabel:[1,"x-axis-label"],yAxisLabel:[1,"y-axis-label"],dataPoints:[16],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{chartData:[{chartDataChanged:0}],dataPoints:[{dataPointsChanged:0}],legend:[{legendChanged:0}],yAxisVisible:[{yAxisVisibilityChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["gids-line-chart","gids-chart-legend","gids-chart-legend-item"].forEach((i=>{switch(i){case"gids-line-chart":customElements.get(t(i))||customElements.define(t(i),d);break;case"gids-chart-legend":customElements.get(t(i))||l();break;case"gids-chart-legend-item":customElements.get(t(i))||n()}}))}g();export{d as G,g as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as t,H as s,h as i}from"./p-
|
|
1
|
+
import{t as e,p as t,H as s,h as i}from"./p-Bf3p-DY2.js";import{GidsCalendarYearListWebUtils as a}from"@ganpatiinfo/gids-web-shared";import{a as r,b as n,c as d}from"./p-D6lxqcxP.js";const{getGidsCalendarYearListClassNames:h,getGidsCalendarYearListYears:o,isValidFourDigitYear:c}=a,l=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.type="default",this.disabledIndices=[],this.divider=!1,this.newStartYear=(new Date).getFullYear(),this.newEndYear=(new Date).getFullYear()+100,this.hasItemListener=!1,this.suppressNextMenuClickSelection=!1,this.handleCalendarMenuItemSelect=e=>{const{title:t,value:s,selectedIndex:i,disabled:a,id:r}=e.detail;a||"string"!=typeof t||(this.suppressNextMenuClickSelection=!0,queueMicrotask((()=>{this.suppressNextMenuClickSelection=!1})),this.applySelection({id:r,year:Number(s),disabled:!1,selectedIndex:i,startYear:this.newStartYear,endYear:this.newEndYear}))},this.handleMenuClick=e=>{if(this.suppressNextMenuClickSelection)return;const t=e?.detail;this.applySelection({id:t.id,year:Number(t.value),disabled:!1,selectedIndex:t.selectedIndex,startYear:this.newStartYear,endYear:this.newEndYear})},this.yearsList=()=>o({startYear:this.newStartYear,endYear:this.newEndYear}),this.getSelectedItem=()=>{const e=this.selectedYear,t=this.yearsList(),s=t.findIndex((t=>t.value===e));let i;return null!=s&&-1!==s&&(i=t[s]),{foundItem:i,foundIndex:s}},this.isItemSelected=e=>{const{foundIndex:t}=this.getSelectedItem();return t===e}}connectedCallback(){this.attachItemListener(),this.handleStartAndEndYear()}disconnectedCallback(){this.detachItemListener()}getItemElements(){return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"))}attachItemListener(){this.hasItemListener||(this.hostElement.addEventListener("onPressDropdownItem",this.handleCalendarMenuItemSelect),this.hasItemListener=!0)}detachItemListener(){this.hasItemListener&&(this.hostElement.removeEventListener("onPressDropdownItem",this.handleCalendarMenuItemSelect),this.hasItemListener=!1)}handleStartAndEndYear(){const e=this.startYear,t=this.endYear;return this.newStartYear=e&&e>0&&c(e)?e:(new Date).getFullYear(),this.newEndYear=t&&t>0&&c(t)?t:this.newStartYear+100,{newStartYear:this.newStartYear,newEndYear:this.newEndYear}}applySelection(e){this.clearActive(),this.onSelectionYearChange?.(e),this.hostElement.dispatchEvent(new CustomEvent("gidsCalendarYearChange",{bubbles:!0,composed:!0,detail:e}))}clearActive(){this.getItemElements().forEach((e=>e.classList.remove("gids-dropdown-item--active")))}render(){const e=h();return i("div",{key:"6f7e9060d5bae75255f0c82d6e39c59350e115db",class:e},i(r,{key:"6d8c2cf5f688ed922abb21d2243c8101ea3a2e45",type:this.type,supportingText:this.noOptionsText},i(n,{key:"f832e544140b66b74c64e306eb23f7c42a2db960",sectionLabel:"Years"},this.yearsList().map(((e,t)=>{const s=`${t+1}`,a=this.disabledIndices?.includes(e.value);return i(d,{title:e.title,value:`${e.value}`,key:`${t.toString()}`,index:t,id:s,selected:this.isItemSelected(t),onPressDropdownItem:this.handleMenuClick,disabled:a,divider:this.divider,isPlaceholderItem:!1})})))))}get hostElement(){return this}},[0,"gids-calendar-year-list",{type:[1],noOptionsText:[1,"no-options-text"],disabledIndices:[16],divider:[4],selectedYear:[2,"selected-year"],startYear:[2,"start-year"],endYear:[2,"end-year"],onSelectionYearChange:[16],newStartYear:[32],newEndYear:[32]}]);function u(){"undefined"!=typeof customElements&&["gids-calendar-year-list"].forEach((t=>{"gids-calendar-year-list"===t&&(customElements.get(e(t))||customElements.define(e(t),l))}))}u();export{l as G,u as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s}from"./p-
|
|
1
|
+
import{h as s}from"./p-Bf3p-DY2.js";import{GidsButtonDockWebUtils as i,GidsFeedbackBlockWebUtils as a}from"@ganpatiinfo/gids-web-shared";const{getGidsButtonDockClassNames:e}=i,d=({class:i,primaryChildren:a,secondaryChildren:d,...c})=>s("div",{class:e(i),...c},s("div",{class:"gids-button-dock__secondary-area"},d),s("div",{class:"gids-button-dock__primary-area"},a)),{getGidsFeedbackBlockClassNames:c}=a,r=({title:i,supportingText:a,image:e,children:r})=>s("div",{class:c()},s("div",{class:"gids-feedback-block__inner-container"},e&&s("div",{class:"gids-feedback-block__image-container"},e),s("p",{class:"gids-feedback-block__title"},s("strong",null,i)),s("div",{class:"gids-feedback-block__supporting-text"},a),r&&s(d,{primaryChildren:r})));export{r as G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as i,H as e,h as s}from"./p-Bf3p-DY2.js";import{GidsDropdownWebUtils as n}from"@ganpatiinfo/gids-web-shared";import{G as o}from"./p-D4Pimu_8.js";import{d}from"./p-BQ-ZnlnH.js";const{getGidsDropdownClassNames:a,getGidsChevronButtonControlClassNames:h}=n,r="gids-dropdown-item--active",l=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.appearance="default",this.expanded=!1,this.filterValue="",this.isFilterEditing=!1,this.hasLeadingIcon=!1,this.hasLeadingAccessory=!1,this.activeIndex=-1,this.hasItemListener=!1,this.suppressNextMenuClickSelection=!1,this.hasDocumentListeners=!1,this.hasPendingControlRevalidation=!1,this.handleDropdownItemSelect=t=>{const{value:i,title:e,disabled:s,id:n,isPlaceholderItem:o}=t.detail;s||"string"!=typeof i||(this.suppressNextMenuClickSelection=!0,queueMicrotask((()=>{this.suppressNextMenuClickSelection=!1})),this.applySelection({id:n,value:i,title:e,disabled:!1,originalEvent:t,isPlaceholderItem:o}))},this.handleMenuClick=t=>{if(this.suppressNextMenuClickSelection)return;const i=t.target;if(!(i instanceof Element))return;const e=i.closest(".gids-dropdown-item");if(!e||!this.hostElement.contains(e))return;if(e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled"))return;const s=e instanceof HTMLButtonElement?e.value:e.getAttribute("value")??"";if("string"!=typeof s||0===s.length)return;const n=e instanceof HTMLButtonElement?e.id:e.getAttribute("id")??"";if("string"!=typeof n||0===n.length)return;const o=e.getAttribute("is-placeholder-item")??"";this.applySelection({id:n,value:s,title:e.textContent?.trim()??"",disabled:!1,originalEvent:t,isPlaceholderItem:!(!o||"true"!==o)})},this.handleFilterInput=t=>{const i=t.target;this.filterValue=i?.value??"",this.isFilterEditing=!0,this.clearActive(),this.expanded||this.setExpandedState(!0,t),this.applyFilter()},this.handleInputKeyDown=t=>{if(!this.isInteractive())return;const i=t.key,e="ArrowDown"===i;if((e||"ArrowUp"===i)&&!t.metaKey&&!t.ctrlKey)return t.preventDefault(),this.expanded||this.setExpandedState(!0,t),void this.moveActive(e?1:-1);if("Home"===i&&this.expanded)return t.preventDefault(),void this.setActiveByIndex(0);if("End"===i&&this.expanded)return t.preventDefault(),void this.setActiveByIndex(this.getVisibleEnabledItems().length-1);if("Enter"===i){if(!this.expanded)return t.preventDefault(),this.setExpandedState(!0,t),void this.setActiveByIndex(0);this.selectActive()&&t.preventDefault()}},this.handleTriggerToggle=t=>{this.isInteractive()&&this.setExpandedState(!this.expanded,t)},this.handleInputFocusAndBlur=t=>{this.hostElement.dispatchEvent(new FocusEvent(t.type,{relatedTarget:t.relatedTarget}))},this.handleInputClickToggle=t=>{t.defaultPrevented||this.handleTriggerToggle(t)},this.handleChevronClickToggle=t=>{t.defaultPrevented||(t.stopPropagation(),this.handleTriggerToggle(t))},this.handleDocumentPointerDown=t=>{2!==t.button&&this.expanded&&(("function"==typeof t.composedPath?t.composedPath():[]).includes(this.hostElement)||this.hostElement.contains(t.target)||this.setExpandedState(!1,t))},this.handleDocumentKeyDown=t=>{if(!this.expanded)return;const i=t.key;if("Escape"===i||"Esc"===i)return t.preventDefault(),void this.setExpandedState(!1,t);"Tab"===i&&this.setExpandedState(!1,t)},this.handleFormReset=()=>{this.value=this.initialValue,this.selectedItemTitle=void 0,this.isFilterEditing=!1,this.filterValue="",this.setExpandedState(!1)}}handleExpandedChange(t){t&&!this.isInteractive()&&(this.expanded=!1)}handleInteractivityChange(){!this.isInteractive()&&this.expanded&&this.setExpandedState(!1)}connectedCallback(){this.initialValue=this.value,this.attachItemListener(),this.attachDocumentListeners(),this.attachFormListener()}disconnectedCallback(){this.detachItemListener(),this.detachDocumentListeners(),this.detachFormListener()}componentWillLoad(){this.checkSlots()}componentWillUpdate(){this.checkSlots()}checkSlots(){this.hasLeadingIcon=!!this.hostElement.querySelector('[slot="leadingIconDropdown"]'),this.hasLeadingAccessory=!!this.hostElement.querySelector('[slot="leadingAccessoryDropdown"]')}getItemElements(){return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"))}getVisibleEnabledItems(){return this.getItemElements().filter((t=>"none"!==t.style.display&&!t.hasAttribute("disabled")&&"true"!==t.getAttribute("aria-disabled")))}attachItemListener(){this.hasItemListener||(this.hostElement.addEventListener("onPressDropdownItem",this.handleDropdownItemSelect),this.hasItemListener=!0)}detachItemListener(){this.hasItemListener&&(this.hostElement.removeEventListener("onPressDropdownItem",this.handleDropdownItemSelect),this.hasItemListener=!1)}applySelection(t){this.value=t.value,this.selectedItemTitle="string"==typeof t.title?t.title:void 0,this.isFilterEditing=!1,this.filterValue="",this.clearActive(),this.emitNativeSelectionEvents(this.selectedItemTitle??""),this.setExpandedState(!1,this.coerceEvent(t.originalEvent)),this.onSelectionChange?.(t),this.hostElement.dispatchEvent(new CustomEvent("gidsDropdownChange",{bubbles:!0,composed:!0,detail:t}))}getInputControl(){return this.hostElement.querySelector(".gids-input__control")}emitNativeSelectionEvents(t){const i=this.getInputControl();i&&(i.value=t,i.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),i.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}clearActive(){this.activeIndex=-1,this.getItemElements().forEach((t=>t.classList.remove(r))),this.setActiveDescendant(void 0)}setActiveByIndex(t){const i=this.getVisibleEnabledItems();if(this.getItemElements().forEach((t=>t.classList.remove(r))),0===i.length)return this.activeIndex=-1,void this.setActiveDescendant(void 0);const e=Math.max(0,Math.min(t,i.length-1)),s=i[e];if(!s)return this.activeIndex=-1,void this.setActiveDescendant(void 0);this.activeIndex=e,s.classList.add(r),s.scrollIntoView({block:"nearest"}),this.setActiveDescendant(s.id||void 0)}moveActive(t){const i=this.getVisibleEnabledItems();0!==i.length?this.setActiveByIndex(-1===this.activeIndex?t>0?0:i.length-1:(this.activeIndex+t+i.length)%i.length):this.clearActive()}selectActive(){const t=this.getVisibleEnabledItems();if(0===t.length)return!1;const i=this.activeIndex>=0?t[this.activeIndex]:t[0];return!!i&&(i.click(),this.getInputControl()?.focus(),!0)}applyFilter(){const t=this.filterValue.trim().toLowerCase();this.getItemElements().forEach((i=>{const e=(i.textContent??"").toLowerCase(),s=0===t.length||e.includes(t);i.style.display=s?"":"none"}))}setActiveDescendant(t){const i=this.getInputControl();i&&(t?i.setAttribute("aria-activedescendant",t):i.removeAttribute("aria-activedescendant"))}setExpandedState(t,i){const e=Boolean(t);e&&!this.isInteractive()||this.expanded!==e&&(this.expanded=e,e||(this.isFilterEditing=!1,this.filterValue="",this.clearActive(),this.applyFilter(),this.syncInputDisplayValue()),this.hostElement.dispatchEvent(new CustomEvent("gidsDropdownToggle",{bubbles:!0,composed:!0,detail:{expanded:e,originalEvent:i}})))}syncInputDisplayValue(){const t=this.getInputControl();t&&t.value!==(this.selectedItemTitle??"")&&(t.value=this.selectedItemTitle??"")}attachDocumentListeners(){this.hasDocumentListeners||"undefined"==typeof document||(document.addEventListener("pointerdown",this.handleDocumentPointerDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.hasDocumentListeners=!0)}detachDocumentListeners(){this.hasDocumentListeners&&"undefined"!=typeof document&&(document.removeEventListener("pointerdown",this.handleDocumentPointerDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.hasDocumentListeners=!1)}attachFormListener(){const t=this.hostElement.closest("form");this.patternForm!==t&&(this.patternForm&&this.patternForm.removeEventListener("reset",this.handleFormReset),this.patternForm=t??void 0,this.patternForm?.addEventListener("reset",this.handleFormReset))}detachFormListener(){this.patternForm&&(this.patternForm.removeEventListener("reset",this.handleFormReset),this.patternForm=void 0)}get form(){return this.getInputControl()?.form??this.patternForm??null}get validity(){return this.getInputControl()?.validity??{}}get validationMessage(){return this.getInputControl()?.validationMessage??""}get willValidate(){return this.getInputControl()?.willValidate??!1}async checkValidity(){return this.getInputControl()?.checkValidity()??!0}async reportValidity(){return this.getInputControl()?.reportValidity()??!0}async setCustomValidity(t){return this.getInputControl()?.setCustomValidity(t)}isInteractive(){return!(this.disabled||this.readOnly)}coerceEvent(t){if("undefined"!=typeof Event&&null!==t)return t instanceof Event?t:void 0}scheduleControlRevalidation(){if(this.hasPendingControlRevalidation)return;this.hasPendingControlRevalidation=!0;const t=()=>{this.hasPendingControlRevalidation=!1,this.checkValidity()};"function"!=typeof requestAnimationFrame?t():requestAnimationFrame(t)}getEnhancedInputProps(){const t={...this.inputProps??{}};"string"==typeof t.autoComplete&&0!==t?.autoComplete?.trim?.()?.length||(t.autoComplete="off");const i=t.onInput;t.onInput=t=>{i?.(t),this.handleFilterInput(t)};const e=t.onBlur;t.onBlur=t=>{e?.(t),this.scheduleControlRevalidation()};const s=t.onKeyDown;return t.onKeyDown=t=>{s?.(t),t.defaultPrevented||this.handleInputKeyDown(t)},t}render(){const t=this.expanded&&this.isInteractive(),i=a({expanded:t}),e=this.getEnhancedInputProps(),n="string"==typeof e.id?e.id:void 0,d=n?`${n}__menu`:void 0;e.role="combobox",e["aria-expanded"]=t?"true":"false",e["aria-haspopup"]="listbox",e["aria-autocomplete"]="list",d&&(e["aria-controls"]=d);const r=this.isFilterEditing?this.filterValue:this.selectedItemTitle??this.value??"",l=t?"true":"false",c=s("button",{key:"7308fb3cd3804b1945e023107018d16bafd166b3",class:h({size:"lg"}),slot:"trailingAccessory",type:"button",onClick:this.handleChevronClickToggle,"aria-label":t?"Collapse options":"Expanded options","aria-expanded":l,"aria-haspopup":"listbox","aria-controls":d,disabled:this.disabled||this.readOnly,tabIndex:-1},s("span",{key:"39816bde9d3e2e43f3f0b19bd6abda300e1362c4",class:"gids-button__content"},s(o,{key:"95d25d7a9f0b9e0ee2f7dcd9bad178580198184b",name:"chevron-vertical",alt:""})));return s("div",{key:"c86f983fe0481939441ef4750ac3af7f41ba1334",class:i},s("gids-input",{key:"00f171ce20bd3dca41c799993259e19c86ad9df5",appearance:this.appearance,loading:this.loading,disabled:this.disabled,readOnly:this.readOnly,required:this.required,value:r,name:this.name,inputProps:e,onClick:this.handleInputClickToggle,onFocus:this.handleInputFocusAndBlur,onBlur:this.handleInputFocusAndBlur},this.hasLeadingIcon&&s("slot",{key:"fbeb48c6376fb0d35f989bbc97bb7b186a237029",name:"leadingIconDropdown",slot:"leadingIcon"}),this.hasLeadingAccessory&&s("slot",{key:"32bd6bea5335946f1e78efe067be89dead314ea9",name:"leadingAccessoryDropdown",slot:"leadingAccessory"}),c),s("div",{key:"0ea93131baf32b00593992131a4eb866a87af1bf",class:"gids-dropdown__menu",id:d,role:"listbox",onClick:this.handleMenuClick},s("slot",{key:"d2b232c3a364e9e467340b45f4ad08e9b5431cf7"})))}get hostElement(){return this}static get watchers(){return{expanded:[{handleExpandedChange:0}],disabled:[{handleInteractivityChange:0}],readOnly:[{handleInteractivityChange:0}]}}static get style(){return'@charset "UTF-8";.gids-dropdown{position:relative}.gids-dropdown__menu{position:absolute;inset-inline:0;top:calc(100% + var(--gids-gap-050));z-index:3;display:none;flex-direction:column;min-height:55px;max-height:20rem;overflow-x:hidden;overflow-y:auto;background-color:var(--gids-elevation-surface-overlay-default);box-shadow:var(--gids-elevation-shadow-overlay);border-radius:var(--gids-border-radius-lg)}.gids-dropdown__menu>*{flex-shrink:0}.gids-dropdown--expanded .gids-dropdown__menu{display:flex}.gids-dropdown__leading-icon{display:flex;align-items:center}.gids-dropdown__accessory{display:flex;align-items:center}'}},[260,"gids-dropdown",{appearance:[1],expanded:[1540],inputProps:[16],disabled:[516],readOnly:[516,"read-only"],loading:[516],value:[513],name:[1],onSelectionChange:[16],required:[4],filterValue:[32],isFilterEditing:[32],selectedItemTitle:[32],hasLeadingIcon:[32],hasLeadingAccessory:[32],checkValidity:[64],reportValidity:[64],setCustomValidity:[64]},void 0,{expanded:[{handleExpandedChange:0}],disabled:[{handleInteractivityChange:0}],readOnly:[{handleInteractivityChange:0}]}]);function c(){"undefined"!=typeof customElements&&["gids-dropdown","gids-input"].forEach((i=>{switch(i){case"gids-dropdown":customElements.get(t(i))||customElements.define(t(i),l);break;case"gids-input":customElements.get(t(i))||d()}}))}c();export{l as G,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as s,p as e,H as i,h as r}from"./p-Ct3Ixgvf.js";import{GidsProgressCircleWebUtils as t}from"@ganpatiinfo/gids-web-shared";import{CIRCLE_VAL_LESS_MAX_VAL_SUPPORTING_TEXT as a,CIRCLE_VAL_LESS_MAX_VAL_TITLE as l,HALF_CIRCLE_MAX_VAL as g,FULL_CIRCLE_MAX_VAL as o}from"@ganpatiinfo/gids-core-shared";import{G as p}from"./p-D_wcwB7E.js";import{G as n}from"./p-Dehss-X0.js";const{getGidsProgressCircleClassNames:c}=t,h=e(class extends i{constructor(s){super(),!1!==s&&this.__registerHost(),this.breakpoint="desktop",this.value=0,this.shape="circle",this.label="",this.size="xs",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}valueChanged(){this.updateDimensions()}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const s=this.hostElement.getBoundingClientRect();this.width=s.width,this.height=s.height>0?s.height:240}render(){if(this.chartLoading)return r("div",{class:"gids-progress-circle__no-data"},r(n,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const s="half-circle"===this.shape?g:o;if(!("number"==typeof this.value&&!isNaN(this.value)&&this.value<=s&&this.value>=0))return r("div",{class:"gids-progress-circle__no-data"},r(p,{title:l,supportingText:a(s)}));const e=this.value/s,i=`${this.value}%`,t=c({breakpoint:this.breakpoint}),h="half-circle"===this.shape;let d=2*Math.PI*40,_=e*d,y=0,m="0 0 100 100",f="rotate(-90 50 50)";h&&(d=40*Math.PI,_=e*d,y=0,m="0 0 100 50",f="");const v="xxs"===this.size,x="string"==typeof this.label&&""!==this.label.trim();return r("div",{class:t},r("div",{class:"gids-progress-circle__main-container"},r("div",{class:`gids-progress-circle__svg-wrapper gids-progress-circle__svg-wrapper--shape-${this.shape}--size-${this.size}`},r("svg",{viewBox:m,class:"gids-progress-circle__chart-vector"},h?r("g",null,r("path",{d:"M 10,50 A 40,40 0 0,1 90,50",fill:"none",class:"gids-progress-circle__track-background"}),r("path",{d:"M 10,50 A 40,40 0 0,1 90,50",fill:"none",class:"gids-progress-circle__segment","stroke-dasharray":`${_} ${d}`,"stroke-dashoffset":y})):r("g",null,r("circle",{cx:"50",cy:"50",r:40,class:"gids-progress-circle__track-background"}),r("circle",{cx:"50",cy:"50",r:40,class:"gids-progress-circle__segment","stroke-dasharray":`${_} ${d}`,"stroke-dashoffset":y,transform:f}))),r("div",{class:`gids-progress-circle__center-content gids-progress-circle__shape-${this.shape}`},x&&!v?r("span",{class:`gids-progress-circle__label-common gids-progress-circle__label-${this.size}`},this.label):null,r("span",{class:`gids-progress-circle__percentage-common gids-progress-circle__percentage-${this.size}`},i))),v&&x?r("div",{class:"gids-progress-circle__bottom-content"},r("span",{class:`gids-progress-circle__label-common gids-progress-circle__label-${this.size}`},this.label)):null))}get hostElement(){return this}static get watchers(){return{value:[{valueChanged:0}],shape:[{valueChanged:0}]}}static get style(){return":host{display:block;box-sizing:border-box}.gids-progress-circle{display:block;box-sizing:border-box}.gids-progress-circle--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-progress-circle__main-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.gids-progress-circle{}.gids-progress-circle__svg-wrapper{position:relative;display:block;flex-shrink:0;}.gids-progress-circle__svg-wrapper--shape-circle--size-xxs{width:180px;height:180px}.gids-progress-circle__svg-wrapper--shape-circle--size-xs{width:220px;height:220px}.gids-progress-circle__svg-wrapper--shape-circle--size-sm{width:260px;height:260px}.gids-progress-circle__svg-wrapper--shape-circle--size-md{width:300px;height:300px}.gids-progress-circle__svg-wrapper--shape-circle--size-lg{width:340px;height:340px}.gids-progress-circle__svg-wrapper{}.gids-progress-circle__svg-wrapper--shape-half-circle--size-xxs{width:180px;height:144px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-xs{width:220px;height:130px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-sm{width:260px;height:152px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-md{width:300px;height:174px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-lg{width:340px;height:194px}.gids-progress-circle__chart-vector{display:block;width:100%;height:100%}.gids-progress-circle{}.gids-progress-circle__track-background{fill:none;stroke:var(--gids-color-background-neutral-default);stroke-width:6;stroke-linecap:round}.gids-progress-circle{}.gids-progress-circle__segment{fill:none;stroke:var(--gids-color-text-brand);stroke-width:6;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out, stroke-dashoffset 0.4s ease-out}.gids-progress-circle{}.gids-progress-circle__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}.gids-progress-circle__shape-half-circle{justify-content:flex-end;align-items:center;bottom:var(--gids-padding-vertical-edge-to-element-300)}.gids-progress-circle__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-progress-circle__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-progress-circle__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-progress-circle__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-progress-circle__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-progress-circle__label-common{color:var(--gids-color-text-subtlest)}.gids-progress-circle__percentage-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-common{color:var(--gids-color-text-default)}.gids-progress-circle{}.gids-progress-circle__bottom-content{display:flex;justify-content:center;text-align:center}.gids-progress-circle__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-progress-circle",{breakpoint:[1],value:[2],shape:[1],label:[1],size:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{value:[{valueChanged:0}],shape:[{valueChanged:0}]}]);function d(){"undefined"!=typeof customElements&&["gids-progress-circle"].forEach((e=>{"gids-progress-circle"===e&&(customElements.get(s(e))||customElements.define(s(e),h))}))}d();export{h as G,d}
|
|
1
|
+
import{t as s,p as e,H as i,h as r}from"./p-Bf3p-DY2.js";import{GidsProgressCircleWebUtils as t}from"@ganpatiinfo/gids-web-shared";import{CIRCLE_VAL_LESS_MAX_VAL_SUPPORTING_TEXT as a,CIRCLE_VAL_LESS_MAX_VAL_TITLE as l,HALF_CIRCLE_MAX_VAL as g,FULL_CIRCLE_MAX_VAL as o}from"@ganpatiinfo/gids-core-shared";import{G as p}from"./p-CaauwQNd.js";import{G as n}from"./p-DMNS1d8v.js";const{getGidsProgressCircleClassNames:c}=t,h=e(class extends i{constructor(s){super(),!1!==s&&this.__registerHost(),this.breakpoint="desktop",this.value=0,this.shape="circle",this.label="",this.size="xs",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}valueChanged(){this.updateDimensions()}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const s=this.hostElement.getBoundingClientRect();this.width=s.width,this.height=s.height>0?s.height:240}render(){if(this.chartLoading)return r("div",{class:"gids-progress-circle__no-data"},r(n,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const s="half-circle"===this.shape?g:o;if(!("number"==typeof this.value&&!isNaN(this.value)&&this.value<=s&&this.value>=0))return r("div",{class:"gids-progress-circle__no-data"},r(p,{title:l,supportingText:a(s)}));const e=this.value/s,i=`${this.value}%`,t=c({breakpoint:this.breakpoint}),h="half-circle"===this.shape;let d=2*Math.PI*40,_=e*d,y=0,m="0 0 100 100",f="rotate(-90 50 50)";h&&(d=40*Math.PI,_=e*d,y=0,m="0 0 100 50",f="");const v="xxs"===this.size,x="string"==typeof this.label&&""!==this.label.trim();return r("div",{class:t},r("div",{class:"gids-progress-circle__main-container"},r("div",{class:`gids-progress-circle__svg-wrapper gids-progress-circle__svg-wrapper--shape-${this.shape}--size-${this.size}`},r("svg",{viewBox:m,class:"gids-progress-circle__chart-vector"},h?r("g",null,r("path",{d:"M 10,50 A 40,40 0 0,1 90,50",fill:"none",class:"gids-progress-circle__track-background"}),r("path",{d:"M 10,50 A 40,40 0 0,1 90,50",fill:"none",class:"gids-progress-circle__segment","stroke-dasharray":`${_} ${d}`,"stroke-dashoffset":y})):r("g",null,r("circle",{cx:"50",cy:"50",r:40,class:"gids-progress-circle__track-background"}),r("circle",{cx:"50",cy:"50",r:40,class:"gids-progress-circle__segment","stroke-dasharray":`${_} ${d}`,"stroke-dashoffset":y,transform:f}))),r("div",{class:`gids-progress-circle__center-content gids-progress-circle__shape-${this.shape}`},x&&!v?r("span",{class:`gids-progress-circle__label-common gids-progress-circle__label-${this.size}`},this.label):null,r("span",{class:`gids-progress-circle__percentage-common gids-progress-circle__percentage-${this.size}`},i))),v&&x?r("div",{class:"gids-progress-circle__bottom-content"},r("span",{class:`gids-progress-circle__label-common gids-progress-circle__label-${this.size}`},this.label)):null))}get hostElement(){return this}static get watchers(){return{value:[{valueChanged:0}],shape:[{valueChanged:0}]}}static get style(){return":host{display:block;box-sizing:border-box}.gids-progress-circle{display:block;box-sizing:border-box}.gids-progress-circle--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-progress-circle__main-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.gids-progress-circle{}.gids-progress-circle__svg-wrapper{position:relative;display:block;flex-shrink:0;}.gids-progress-circle__svg-wrapper--shape-circle--size-xxs{width:180px;height:180px}.gids-progress-circle__svg-wrapper--shape-circle--size-xs{width:220px;height:220px}.gids-progress-circle__svg-wrapper--shape-circle--size-sm{width:260px;height:260px}.gids-progress-circle__svg-wrapper--shape-circle--size-md{width:300px;height:300px}.gids-progress-circle__svg-wrapper--shape-circle--size-lg{width:340px;height:340px}.gids-progress-circle__svg-wrapper{}.gids-progress-circle__svg-wrapper--shape-half-circle--size-xxs{width:180px;height:144px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-xs{width:220px;height:130px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-sm{width:260px;height:152px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-md{width:300px;height:174px}.gids-progress-circle__svg-wrapper--shape-half-circle--size-lg{width:340px;height:194px}.gids-progress-circle__chart-vector{display:block;width:100%;height:100%}.gids-progress-circle{}.gids-progress-circle__track-background{fill:none;stroke:var(--gids-color-background-neutral-default);stroke-width:6;stroke-linecap:round}.gids-progress-circle{}.gids-progress-circle__segment{fill:none;stroke:var(--gids-color-text-brand);stroke-width:6;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out, stroke-dashoffset 0.4s ease-out}.gids-progress-circle{}.gids-progress-circle__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}.gids-progress-circle__shape-half-circle{justify-content:flex-end;align-items:center;bottom:var(--gids-padding-vertical-edge-to-element-300)}.gids-progress-circle__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-progress-circle__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-progress-circle__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-progress-circle__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-progress-circle__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-progress-circle__label-common{color:var(--gids-color-text-subtlest)}.gids-progress-circle__percentage-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-progress-circle__percentage-common{color:var(--gids-color-text-default)}.gids-progress-circle{}.gids-progress-circle__bottom-content{display:flex;justify-content:center;text-align:center}.gids-progress-circle__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-progress-circle",{breakpoint:[1],value:[2],shape:[1],label:[1],size:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{value:[{valueChanged:0}],shape:[{valueChanged:0}]}]);function d(){"undefined"!=typeof customElements&&["gids-progress-circle"].forEach((e=>{"gids-progress-circle"===e&&(customElements.get(s(e))||customElements.define(s(e),h))}))}d();export{h as G,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e}from"./p-
|
|
1
|
+
import{h as e}from"./p-Bf3p-DY2.js";import{getIconGlyphUrl as i}from"@ganpatiinfo/gids-web-theme-interface";import{generateId as t,haveGidsAssetPathsBeenSet as r,getGidsAssetFilePath as s,GidsIconWebUtils as o,onGidsAssetPathsSet as a}from"@ganpatiinfo/gids-web-shared";const{getGidsIconClassNames:n}=o,d=({name:o,size:d,appearance:l,alt:f,class:c,titleId:m,src:p,...g})=>{const h=t(m);let u=p;return void 0===u&&r()&&(u=i(o,l,s)),e("svg",{ref:e=>{void 0===u&&a((()=>{!function(e,t,r){if(!e)return;const o=document.createElementNS("http://www.w3.org/2000/svg","use");o.setAttribute("href",i(t,r,s)),e.appendChild(o)}(e,o,l)}))},width:"16",height:"16",class:n({size:d},c),role:"img","aria-hidden":""===f?"true":void 0,"aria-labelledby":""===f?void 0:h,...g},""!==f&&e("title",{id:h},f||o),void 0!==u?e("use",{href:u}):null)};export{d as G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,F as e}from"./p-Bf3p-DY2.js";import{GidsButtonGroupWebUtils as i,GidsDropdownMenuGroupWebUtils as s,GidsHeadingWebUtils as n,GidsDropdownMenuWebUtils as l,GidsEditButtonWebUtils as a,GidsDividerWebUtils as d,GidsListItemWebUtils as o,GidsDropdownItemWebUtils as r}from"@ganpatiinfo/gids-web-shared";import{G as c}from"./p-DMNS1d8v.js";import{G as g}from"./p-D4Pimu_8.js";const{getGidsButtonGroupClassNames:u}=i,p=({layout:e,class:i},s)=>t("span",{class:u({layout:e},i)},s),{getGidsDropdownMenuGroupClassNames:_}=s,m=({type:e="no-options",supportingText:i="No options",class:s,...n},l)=>t("div",{class:_({type:e},s),...n},"loading"===e?t(c,{indeterminate:!0,size:"md"}):null,"no-options"===e?t("span",null,i):null,"default"===e&&null!=l?l:null),{getGidsHeadingClassNames:b,getGidsHeadingSupportingTextTypographyClass:y}=n,v=({heading:e,supportingText:i,level:s="section",children:n,supportingTextTypography:l,class:a})=>t("div",{class:b(a)},t("div",{class:"gids-heading__content-container"},null!=e&&""!==e?"string"==typeof e?""!==e?t("span",{class:"section"===s?"gids-heading__heading-text-section":"gids-heading__heading-text-group"},e):null:e:null,null!=i&&""!==i?"string"==typeof i?""!==i?t("span",{class:`${"section"===s?"gids-heading__supporting-text-section":"gids-heading__supporting-text-group"} ${y(l)}`},i):null:i:null),n?t(p,{layout:"wrap"},n):null),{getGidsDropdownMenuClassNames:f}=l,x=({sectionLabel:e,class:i,...s},n)=>t("div",{class:f(i),...s},null!=e&&""!==e?t(v,{supportingText:e,supportingTextTypography:"eyebrow-medium"}):null,null!=n?t("div",{class:"gids-dropdown-menu__children"},n):null),{getGidsEditButtonClassNames:h}=a,P=({disabled:e,children:i,size:s="md",editButtonType:n="add",onPressEditButton:l,class:a,...d})=>t("button",{class:h({size:s},a),...d,onClick:l,disabled:e},"custom"===n&&i?t("div",null,i):"add"===n?t("div",{class:e?"gids-edit-button__add gids-edit-button__disabled":"gids-edit-button__add"},t(g,{name:"add",appearance:"filled",size:s})):"remove"===n?t("div",{class:e?"gids-edit-button__remove gids-edit-button__disabled":"gids-edit-button__remove"},t(g,{appearance:"filled",name:"remove",size:s})):void 0),{getGidsDividerClassNames:I}=d,C=({orientation:e})=>t("hr",{class:I({orientation:e})}),{getGidsListItemClassNames:G}=o,w=({id:i,value:s,index:n,defaultSelected:l,disabled:a,selected:d,editButton:o,onPressEditButton:r,onPressListItem:c,leadingAccessory:u,leadingSupport:p,leadingParagraph:_,trailingContent:m,trailingAccessory:b,trailingSupport:y,trailingParagraph:v,divider:f,role:x="list-item-option",isPlaceholderItem:h,class:I,...w},T)=>{const N=d||l;return t("button",{type:"button",id:i,class:G({selected:N,disabled:a},I),role:x,"aria-selected":N?"true":"false",disabled:a,value:(()=>{if("string"==typeof s&&""!==s.trim())return s;const t=T;return t?(Array.isArray(t)?t:[t]).map((t=>"string"==typeof t||"number"==typeof t?String(t):t&&"object"==typeof t&&"text"in t?t.text??"":"")).join("").trim():""})(),tabIndex:n,onClick:t=>{const e=t.currentTarget;if(!e)return;if(t.defaultPrevented||e.disabled)return;const i=new CustomEvent("onPressListItem",{bubbles:!0,composed:!0,detail:{selectedIndex:n,defaultSelected:l,isPlaceholderItem:h}});c?.(i)},"is-placeholder-item":h?"true":"false",...w},t("div",{class:"gids-list-item__main-container"},null==o||"none"===o||a?null:t(P,{size:"md",editButtonType:o,onPressEditButton:r}),null!=u?t("div",{class:a?"gids-list-item__leading-accessory-container gids-list-item__accessory-content-disabled":"gids-list-item__leading-accessory-container"},u):null,t("div",{class:"gids-list-item__middle-content-container"},t("div",{class:"gids-list-item__leading-content-container"},t(e,null,null!=T?t("span",{class:a?"gids-list-item__leading-content-label gids-list-item__text-content-disabled":"gids-list-item__leading-content-label"},T):null,t("div",{class:"gids-list-item__leading-support-content"},null!=p?"string"==typeof p?t("p",{class:a?"gids-list-item__leading-content-supporting-text gids-list-item__text-content-disabled":"gids-list-item__leading-content-supporting-text"},p):p:null,null!=_?"string"==typeof _?t("p",{class:a?"gids-list-item__leading-content-paragraph-text gids-list-item__text-content-disabled":"gids-list-item__leading-content-paragraph-text"},_):_:null))),t("div",{class:"gids-list-item__trailing-content-container"},t(e,null,null!=m?"string"==typeof m?t("span",{class:a?"gids-list-item__trailing-content-label gids-list-item__text-content-disabled":"gids-list-item__trailing-content-label"},m):m:null,t("div",{class:"gids-list-item__trailing-support-content"},null!=y?"string"==typeof y?t("p",{class:a?"gids-list-item__trailing-content-supporting-text gids-list-item__text-content-disabled":"gids-list-item__trailing-content-supporting-text"},y):y:null,null!=v?"string"==typeof v?t("p",{class:a?"gids-list-item__trailing-content-paragraph-text gids-list-item__text-content-disabled":"gids-list-item__trailing-content-paragraph-text"},v):v:null)))),N?t("div",{class:a?"gids-list-item__trailing-accessory-container gids-list-item__accessory-content-disabled":"gids-list-item__trailing-accessory-container"},t(g,{name:"checkmark",size:"md",appearance:"regular"})):null,N||null==b?null:t("div",{class:a?"gids-list-item__trailing-accessory-container gids-list-item__accessory-content-disabled":"gids-list-item__trailing-accessory-container"},b)),f&&!N?t("div",{class:"gids-list-item__divider"},t(C,{orientation:"horizontal"})):null)},{getGidsDropdownItemClassNames:T}=r,N=({id:e,title:i,class:s,selected:n=!1,disabled:l=!1,role:a="list-item-option",value:d,name:o,onPressDropdownItem:r,index:c,defaultSelected:g,leadingAccessory:u,divider:p,isPlaceholderItem:_,...m})=>{const b=T("string"==typeof s?s:void 0);return t(w,{id:e,index:c??0,defaultSelected:g,selected:n,disabled:l,role:a,value:d,name:o,leadingAccessory:u,class:b,onPressListItem:t=>{if(t.defaultPrevented)return;const s=new CustomEvent("onPressDropdownItem",{bubbles:!0,composed:!0,detail:{id:e,title:i,value:d,disabled:l,selectedIndex:c,defaultSelected:g,isPlaceholderItem:_}});r?.(s)},divider:p,isPlaceholderItem:_,...m},i)};export{p as G,m as a,x as b,N as c}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s}from"./p-Bf3p-DY2.js";import{GidsSpinnerCommonUtils as e}from"@ganpatiinfo/gids-core-shared";import{GidsSpinnerWebUtils as i}from"@ganpatiinfo/gids-web-shared";import{G as a}from"./p-CHGTBObD.js";const{getGidsSpinnerClassNames:t}=i,{getElementVisibility:n}=e,p=({label:e,supportingText:i,size:p,indeterminate:r,value:o,max:l,class:m,...g})=>{const{hasLabel:d,hasSupportingText:b}=n({label:e,supportingText:i});return s("span",{class:t({size:p},m),...g},s(a,{size:p,indeterminate:r,value:o,max:l}),d&&s("span",{class:"gids-spinner__label"},e),b&&s("span",{class:"gids-spinner__supporting-text"},i))};export{p as G}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as s,h as e,d as a}from"./p-Ct3Ixgvf.js";import{GidsFieldWebUtils as o}from"@ganpatiinfo/gids-web-shared";import{G as r}from"./p-BnL97lOW.js";import{g as n}from"./p-B2zUuNXz.js";const{getGidsFieldClassNames:l}=o,d=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.status="implicit",this._hasLabel=!1,this._controlListenerTargets=[],this._controlTouched=!1,this._handleLabelSlotChange=()=>{this._hasLabel=(this._labelSlot?.assignedElements()?.length??0)>0},this._setLabelSlot=t=>{this._labelSlot=t??void 0,this._handleLabelSlotChange()},this._setControlSlot=t=>{this._controlSlot=t??void 0,this._handleControlSlotChange()},this._handleControlSlotChange=()=>{const t=this._controlSlot?.assignedNodes({flatten:!0})??[],i=this._findTextControl(t);this._attachControlElement(i)},this._handleControlValueInput=t=>{if(!this._controlTouched){const i=t.target;i instanceof HTMLInputElement&&("checkbox"===i.type||"radio"===i.type)&&(this._controlTouched=!0)}this._updateControlValidationState()},this._handleControlBlur=()=>{this._controlTouched=!0,this._updateControlValidationState()},this._handleControlInvalid=()=>{this._controlTouched=!0,this._updateControlValidationState()},this._handleFormReset=()=>{this._controlTouched=!1,this._updateControlValidationState()},this._handleFormSubmit=()=>{this._controlTouched=!0,this._updateControlValidationState()}}_handleStatusChange(){this._isImplicitStatus()||void 0===this._controlValidationMessage?this._updateControlValidationState():this._controlValidationMessage=void 0}connectedCallback(){const t=n();void 0!==t&&this._el.shadowRoot?.adoptedStyleSheets.push(t)}componentDidLoad(){setTimeout((()=>{this._handleControlSlotChange(),this._handleLabelSlotChange()}))}async reScanControl(){this._handleControlSlotChange()}disconnectedCallback(){this._detachControlElement(),this._detachFormListeners()}render(){const t=this._hasStatusText(),i=void 0!==this._controlValidationMessage?this._controlValidationMessage:this._shouldRenderExplicitStatusText()?this.statusText:void 0,s=this._getCurrentStatus(),o=["gids-field__status-text"];if(t){const t=this._getStatusModifierClass(s,"gids-field__status-text");null!=t&&o.push(t)}return e(a,{key:"98078538f6970b0cf756c7a172e635f3302381b2"},e("div",{key:"6751ea942c38270fce42e025ca17e29a38207028",class:l()},e("div",{key:"5c4969bedfd54b42603ff3de69c72bc513aeaeb6",class:"gids-field__header",hidden:!this._hasLabelContent()},e("slot",{key:"9f98f47e3285551c67f7a350d058a55953c88756",ref:this._setLabelSlot,name:"label",onSlotchange:this._handleControlSlotChange}),e("div",{key:"6660ed1c29faf2ca838ba8714dee7feb79257187",class:"gids-field__count","aria-live":"polite"},this.count)),e("div",{key:"ab2bb081db7e8e8caddcc515580e02f32d4c054a",class:"gids-field__control"},e("slot",{key:"5df4538b894f7daedcb03bcab1316c9452e65caf",ref:this._setControlSlot,onSlotchange:this._handleControlSlotChange})),e("p",{key:"d7dce2f4a0b03b056ac8888a918e88b15931c8e5",class:"gids-field__supporting-text",hidden:!this._shouldShowHelperText()},this.helperText),t?e("p",{class:o.join(" "),role:"status","aria-live":"polite"},this._renderStatusIcon(s),void 0!==i?e("span",null,i):null):null))}_hasLabelContent(){return this._hasLabel}_hasHelperText(){return this._hasText(this.helperText)}_shouldShowHelperText(){return!!this._hasHelperText()&&!this._hasStatusText()}_hasStatusText(){return this._isImplicitStatus()?void 0!==this._controlValidationMessage:this._shouldRenderExplicitStatusText()}_shouldRenderExplicitStatusText(){return!this._isImplicitStatus()&&"default"!==this.status&&this._hasText(this.statusText)}_renderStatusIcon(t){if(!this._hasStatusText())return;const i=this._getStatusIconName(t);if(void 0===i)return;const s=["gids-field__status-icon"],a=this._getStatusModifierClass(t,"gids-field__status-icon");null!=a&&s.push(a);let o=t;return"error"===t&&(o="danger"),"success"===t&&(o="positive"),e(r,{appearance:"filled",size:"sm",alt:"",name:i,class:s.join(" "),style:{"--gidsIcon-color":`var(--gids-color-icon-${o})`}})}_getCurrentStatus(){return this._isImplicitStatus()&&null!=this._controlValidationMessage?"error":this.status??"implicit"}_getStatusIconName(t){if("implicit"!==t)return"success"===t?"positive":"error"===t?"danger":void 0}_isImplicitStatus(){return"implicit"===this.status||void 0===this.status}_hasText(t){return"string"==typeof t&&t.trim().length>0}_getStatusModifierClass(t,i){if("implicit"!==t)return`${i}--${t}`}_attachControlElement(t){if(this._controlElement===t)return this._updateControlValidationState(),void this._attachFormListeners(t?.form??this._el.closest("form"));if(this._detachControlElement(),this._controlElement=t,this._resetControlValidationState(),this._controlListenerTargets=[],t){const i=this._getControlListenerTargets(t);this._controlListenerTargets=i,i.forEach((t=>{t.addEventListener("input",this._handleControlValueInput),t.addEventListener("change",this._handleControlValueInput),t.addEventListener("blur",this._handleControlBlur,!0),t.addEventListener("invalid",this._handleControlInvalid)})),this._attachFormListeners(t.form??this._el.closest("form"))}this._updateControlValidationState()}_detachControlElement(){this._controlListenerTargets.length>0&&(this._controlListenerTargets?.forEach((t=>{t.removeEventListener("input",this._handleControlValueInput),t.removeEventListener("change",this._handleControlValueInput),t.removeEventListener("blur",this._handleControlBlur,!0),t.removeEventListener("invalid",this._handleControlInvalid)})),this._controlListenerTargets=[]),this._controlElement=null,this._resetControlValidationState(),this._detachFormListeners()}_getControlListenerTargets(t){return t instanceof HTMLInputElement&&"radio"===t.type&&null!=t.name?this._getRadioGroupControls(t):[t]}_getRadioGroupControls(t){const i=t.form;if(i&&null!=t.name){const s=i.elements.namedItem(t.name);if(s instanceof RadioNodeList){const t=Array.from(s).filter((t=>t instanceof HTMLInputElement&&"radio"===t.type&&this._el.contains(t)));if(t.length>0)return t}}if(null!=t.name){const i=`input[type="radio"][name="${CSS.escape(t.name)}"]`,s=Array.from(this._el.querySelectorAll(i));if(s.length>0)return s}return[t]}_attachFormListeners(t){void 0!==t&&(null!==t?t!==this._formElement&&(this._detachFormListeners(),this._formElement=t,this._formElement.addEventListener("reset",this._handleFormReset),this._formElement.addEventListener("submit",this._handleFormSubmit)):this._detachFormListeners())}_detachFormListeners(){this._formElement&&(this._formElement.removeEventListener("reset",this._handleFormReset),this._formElement.removeEventListener("submit",this._handleFormSubmit),this._formElement=null)}_findTextControl(t){for(const i of t){if(i.nodeType!==Node.ELEMENT_NODE)continue;const t=i,s=this._asTextControl(t);if(null!==s)return s;const e=t.querySelector("input, textarea");if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)return e}return null}_asTextControl(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}_resetControlValidationState(){this._controlTouched=!1,void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0)}_updateControlValidationState(){if(!this._isImplicitStatus())return void(void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0));const t=this._controlElement;if(!t||t.disabled)return void(void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0));const i=t.validationMessage?.trim()??"";this._controlTouched&&t.matches(":user-invalid")&&i.length>0?this._controlValidationMessage!==i&&(this._controlValidationMessage=i):void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0)}get _el(){return this}static get watchers(){return{status:[{_handleStatusChange:0}]}}static get style(){return".gids-field{display:flex;flex-direction:column;gap:var(--gids-gap-075)}.gids-field__header{display:flex;gap:var(--gids-gap-100);align-items:flex-start}.gids-field__header[hidden]{display:none}.gids-field__count{margin-left:auto;color:var(--gids-color-text-subtle);text-align:right;white-space:nowrap;font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}:host([disabled]) .gids-field__count{color:var(--gids-color-text-disabled)}.gids-field__control{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-field__supporting-text,.gids-field__status-text{margin:0;padding-top:var(--gids-padding-vertical-edge-to-element-050);font-family:var(--gids-typography-paragraph-x-small__font-family);font-size:var(--gids-typography-paragraph-x-small__font-size);font-weight:var(--gids-typography-paragraph-x-small__font-weight);letter-spacing:var(--gids-typography-paragraph-x-small__letter-spacing);line-height:var(--gids-typography-paragraph-x-small__line-height);text-transform:var(--gids-typography-paragraph-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-paragraph-x-small__font-variant-caps, inherit)}.gids-field__supporting-text{color:var(--gids-color-text-subtlest)}.gids-field__status-text{display:flex;align-items:flex-start;gap:var(--gids-gap-050)}.gids-field__status-text .gids-field__status-icon{margin-top:max(0px, -1 * (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-text>span{margin-top:max(0px, (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-icon{flex-shrink:0}.gids-field__status-text--information{color:var(--gids-color-text-information);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--information{--gidsIcon-color:$icon-color}.gids-field__status-text--success{color:var(--gids-color-text-positive);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--success{--gidsIcon-color:$icon-color}.gids-field__status-text--warning{color:var(--gids-color-text-warning);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--warning{--gidsIcon-color:$icon-color}.gids-field__status-text--error{color:var(--gids-color-text-danger);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--error{--gidsIcon-color:$icon-color}"}},[257,"gids-field",{disabled:[516],count:[513],helperText:[513,"helper-text"],statusText:[513,"status-text"],status:[513],_controlValidationMessage:[32],_hasLabel:[32],reScanControl:[64]},void 0,{status:[{_handleStatusChange:0}]}]);function h(){"undefined"!=typeof customElements&&["gids-field"].forEach((i=>{"gids-field"===i&&(customElements.get(t(i))||customElements.define(t(i),d))}))}h();export{d as G,h as d}
|
|
1
|
+
import{t,p as i,H as s,h as e,d as a}from"./p-Bf3p-DY2.js";import{GidsFieldWebUtils as o}from"@ganpatiinfo/gids-web-shared";import{G as r}from"./p-D4Pimu_8.js";import{g as n}from"./p-B2zUuNXz.js";const{getGidsFieldClassNames:l}=o,d=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.status="implicit",this._hasLabel=!1,this._controlListenerTargets=[],this._controlTouched=!1,this._handleLabelSlotChange=()=>{this._hasLabel=(this._labelSlot?.assignedElements()?.length??0)>0},this._setLabelSlot=t=>{this._labelSlot=t??void 0,this._handleLabelSlotChange()},this._setControlSlot=t=>{this._controlSlot=t??void 0,this._handleControlSlotChange()},this._handleControlSlotChange=()=>{const t=this._controlSlot?.assignedNodes({flatten:!0})??[],i=this._findTextControl(t);this._attachControlElement(i)},this._handleControlValueInput=t=>{if(!this._controlTouched){const i=t.target;i instanceof HTMLInputElement&&("checkbox"===i.type||"radio"===i.type)&&(this._controlTouched=!0)}this._updateControlValidationState()},this._handleControlBlur=()=>{this._controlTouched=!0,this._updateControlValidationState()},this._handleControlInvalid=()=>{this._controlTouched=!0,this._updateControlValidationState()},this._handleFormReset=()=>{this._controlTouched=!1,this._updateControlValidationState()},this._handleFormSubmit=()=>{this._controlTouched=!0,this._updateControlValidationState()}}_handleStatusChange(){this._isImplicitStatus()||void 0===this._controlValidationMessage?this._updateControlValidationState():this._controlValidationMessage=void 0}connectedCallback(){const t=n();void 0!==t&&this._el.shadowRoot?.adoptedStyleSheets.push(t)}componentDidLoad(){setTimeout((()=>{this._handleControlSlotChange(),this._handleLabelSlotChange()}))}async reScanControl(){this._handleControlSlotChange()}disconnectedCallback(){this._detachControlElement(),this._detachFormListeners()}render(){const t=this._hasStatusText(),i=void 0!==this._controlValidationMessage?this._controlValidationMessage:this._shouldRenderExplicitStatusText()?this.statusText:void 0,s=this._getCurrentStatus(),o=["gids-field__status-text"];if(t){const t=this._getStatusModifierClass(s,"gids-field__status-text");null!=t&&o.push(t)}return e(a,{key:"f830ae3da5de21c80d9fd5b7161fa3f2845a82df"},e("div",{key:"8c6c4af1b4ebe897873a49c42975a8730905cf27",class:l()},e("div",{key:"3afa55c23b729296ff65fb03b501919dcaa420d3",class:"gids-field__header",hidden:!this._hasLabelContent()},e("slot",{key:"6d8c9adf2b04d19a446fdd2707259d931dbc2eb9",ref:this._setLabelSlot,name:"label",onSlotchange:this._handleControlSlotChange}),e("div",{key:"46cc09d9414bb88622f95e7ccffba84b602b25f0",class:"gids-field__count","aria-live":"polite"},this.count)),e("div",{key:"0e6ddf85cf459c53f2cfc5f453cd4fe35e532d9b",class:"gids-field__control"},e("slot",{key:"d2d007d50a5f7001872b368dee5d648a8751c1af",ref:this._setControlSlot,onSlotchange:this._handleControlSlotChange})),e("p",{key:"09e08e474051efd8bb9e526311cd8d3bb14f8671",class:"gids-field__supporting-text",hidden:!this._shouldShowHelperText()},this.helperText),t?e("p",{class:o.join(" "),role:"status","aria-live":"polite"},this._renderStatusIcon(s),void 0!==i?e("span",null,i):null):null))}_hasLabelContent(){return this._hasLabel}_hasHelperText(){return this._hasText(this.helperText)}_shouldShowHelperText(){return!!this._hasHelperText()&&!this._hasStatusText()}_hasStatusText(){return this._isImplicitStatus()?void 0!==this._controlValidationMessage:this._shouldRenderExplicitStatusText()}_shouldRenderExplicitStatusText(){return!this._isImplicitStatus()&&"default"!==this.status&&this._hasText(this.statusText)}_renderStatusIcon(t){if(!this._hasStatusText())return;const i=this._getStatusIconName(t);if(void 0===i)return;const s=["gids-field__status-icon"],a=this._getStatusModifierClass(t,"gids-field__status-icon");null!=a&&s.push(a);let o=t;return"error"===t&&(o="danger"),"success"===t&&(o="positive"),e(r,{appearance:"filled",size:"sm",alt:"",name:i,class:s.join(" "),style:{"--gidsIcon-color":`var(--gids-color-icon-${o})`}})}_getCurrentStatus(){return this._isImplicitStatus()&&null!=this._controlValidationMessage?"error":this.status??"implicit"}_getStatusIconName(t){if("implicit"!==t)return"success"===t?"positive":"error"===t?"danger":void 0}_isImplicitStatus(){return"implicit"===this.status||void 0===this.status}_hasText(t){return"string"==typeof t&&t.trim().length>0}_getStatusModifierClass(t,i){if("implicit"!==t)return`${i}--${t}`}_attachControlElement(t){if(this._controlElement===t)return this._updateControlValidationState(),void this._attachFormListeners(t?.form??this._el.closest("form"));if(this._detachControlElement(),this._controlElement=t,this._resetControlValidationState(),this._controlListenerTargets=[],t){const i=this._getControlListenerTargets(t);this._controlListenerTargets=i,i.forEach((t=>{t.addEventListener("input",this._handleControlValueInput),t.addEventListener("change",this._handleControlValueInput),t.addEventListener("blur",this._handleControlBlur,!0),t.addEventListener("invalid",this._handleControlInvalid)})),this._attachFormListeners(t.form??this._el.closest("form"))}this._updateControlValidationState()}_detachControlElement(){this._controlListenerTargets.length>0&&(this._controlListenerTargets?.forEach((t=>{t.removeEventListener("input",this._handleControlValueInput),t.removeEventListener("change",this._handleControlValueInput),t.removeEventListener("blur",this._handleControlBlur,!0),t.removeEventListener("invalid",this._handleControlInvalid)})),this._controlListenerTargets=[]),this._controlElement=null,this._resetControlValidationState(),this._detachFormListeners()}_getControlListenerTargets(t){return t instanceof HTMLInputElement&&"radio"===t.type&&null!=t.name?this._getRadioGroupControls(t):[t]}_getRadioGroupControls(t){const i=t.form;if(i&&null!=t.name){const s=i.elements.namedItem(t.name);if(s instanceof RadioNodeList){const t=Array.from(s).filter((t=>t instanceof HTMLInputElement&&"radio"===t.type&&this._el.contains(t)));if(t.length>0)return t}}if(null!=t.name){const i=`input[type="radio"][name="${CSS.escape(t.name)}"]`,s=Array.from(this._el.querySelectorAll(i));if(s.length>0)return s}return[t]}_attachFormListeners(t){void 0!==t&&(null!==t?t!==this._formElement&&(this._detachFormListeners(),this._formElement=t,this._formElement.addEventListener("reset",this._handleFormReset),this._formElement.addEventListener("submit",this._handleFormSubmit)):this._detachFormListeners())}_detachFormListeners(){this._formElement&&(this._formElement.removeEventListener("reset",this._handleFormReset),this._formElement.removeEventListener("submit",this._handleFormSubmit),this._formElement=null)}_findTextControl(t){for(const i of t){if(i.nodeType!==Node.ELEMENT_NODE)continue;const t=i,s=this._asTextControl(t);if(null!==s)return s;const e=t.querySelector("input, textarea");if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)return e}return null}_asTextControl(t){return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}_resetControlValidationState(){this._controlTouched=!1,void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0)}_updateControlValidationState(){if(!this._isImplicitStatus())return void(void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0));const t=this._controlElement;if(!t||t.disabled)return void(void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0));const i=t.validationMessage?.trim()??"";this._controlTouched&&t.matches(":user-invalid")&&i.length>0?this._controlValidationMessage!==i&&(this._controlValidationMessage=i):void 0!==this._controlValidationMessage&&(this._controlValidationMessage=void 0)}get _el(){return this}static get watchers(){return{status:[{_handleStatusChange:0}]}}static get style(){return".gids-field{display:flex;flex-direction:column;gap:var(--gids-gap-075)}.gids-field__header{display:flex;gap:var(--gids-gap-100);align-items:flex-start}.gids-field__header[hidden]{display:none}.gids-field__count{margin-left:auto;color:var(--gids-color-text-subtle);text-align:right;white-space:nowrap;font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}:host([disabled]) .gids-field__count{color:var(--gids-color-text-disabled)}.gids-field__control{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-field__supporting-text,.gids-field__status-text{margin:0;padding-top:var(--gids-padding-vertical-edge-to-element-050);font-family:var(--gids-typography-paragraph-x-small__font-family);font-size:var(--gids-typography-paragraph-x-small__font-size);font-weight:var(--gids-typography-paragraph-x-small__font-weight);letter-spacing:var(--gids-typography-paragraph-x-small__letter-spacing);line-height:var(--gids-typography-paragraph-x-small__line-height);text-transform:var(--gids-typography-paragraph-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-paragraph-x-small__font-variant-caps, inherit)}.gids-field__supporting-text{color:var(--gids-color-text-subtlest)}.gids-field__status-text{display:flex;align-items:flex-start;gap:var(--gids-gap-050)}.gids-field__status-text .gids-field__status-icon{margin-top:max(0px, -1 * (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-text>span{margin-top:max(0px, (var(--gids-size-160) - var(--gids-typograpy-paragraph-x-small__line-height) * var(--gids-typograpy-paragraph-x-small__font-size)) / 2)}.gids-field__status-icon{flex-shrink:0}.gids-field__status-text--information{color:var(--gids-color-text-information);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--information{--gidsIcon-color:$icon-color}.gids-field__status-text--success{color:var(--gids-color-text-positive);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--success{--gidsIcon-color:$icon-color}.gids-field__status-text--warning{color:var(--gids-color-text-warning);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--warning{--gidsIcon-color:$icon-color}.gids-field__status-text--error{color:var(--gids-color-text-danger);--gids-field-status-icon-color:$icon-color}.gids-field__status-icon--error{--gidsIcon-color:$icon-color}"}},[257,"gids-field",{disabled:[516],count:[513],helperText:[513,"helper-text"],statusText:[513,"status-text"],status:[513],_controlValidationMessage:[32],_hasLabel:[32],reScanControl:[64]},void 0,{status:[{_handleStatusChange:0}]}]);function h(){"undefined"!=typeof customElements&&["gids-field"].forEach((i=>{"gids-field"===i&&(customElements.get(t(i))||customElements.define(t(i),d))}))}h();export{d as G,h as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as i,H as t,h as s}from"./p-
|
|
1
|
+
import{t as e,p as i,H as t,h as s}from"./p-Bf3p-DY2.js";import{GidsPieChartWebUtils as r}from"@ganpatiinfo/gids-web-shared";import{G as a}from"./p-DMNS1d8v.js";import{d}from"./p-DoCwI_bx.js";import{d as h}from"./p-mZJdpfOo.js";const{getGidsPieChartClassNames:g}=r,n=i(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.breakpoint="desktop",this.legendVisible=!1,this.chartData=[],this.size="xxs",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}chartDataChanged(){this.updateDimensions()}legendVisibilityChanged(e){this.legendVisible=e}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const e=this.hostElement.getBoundingClientRect();this.width=e.width,this.height=e.height>0?e.height:240}render(){if(this.chartLoading)return s("div",{class:"gids-pie-chart__no-data"},s(a,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const e=this.chartData.length,i=this.chartData.reduce(((e,i)=>e+(i.value||0)),0);let t=i;e<6&&e>0&&(t=i+i/e*(6-e));const r=t>0?t:1,d=g({breakpoint:this.breakpoint}),h=2*Math.PI*25;let n=0;return s("div",{class:d},s("div",{class:"gids-pie-chart__main-container"},s("div",{class:"gids-pie-chart__chart-stage-container"},s("div",{class:`gids-pie-chart__svg-wrapper gids-pie-chart__svg-wrapper--size-${this.size}`},s("svg",{viewBox:"0 0 100 100",class:"gids-pie-chart__chart-vector"},s("circle",{cx:"50",cy:"50",r:25,class:"gids-pie-chart__track-background"}),this.chartData.map(((e,i)=>{const t=(e.value||0)/r,a=`${t*h} ${h}`,d=-n*h;return n+=t,s("circle",{key:e.label||i,cx:"50",cy:"50",r:25,class:`gids-pie-chart__segment gids-pie-chart__segment-series-${i+1}`,"stroke-dasharray":a,"stroke-dashoffset":d,transform:"rotate(-90 50 50)"})}))))),this.legendVisible?s("div",{class:"gids-pie-chart__legend-container"},s("gids-chart-legend",{orientation:"vertical"},this.chartData.map(((e,i)=>s("gids-chart-legend-item",{key:e.label,seriesType:`${i+1}`,orientation:"vertical"},e.label))))):null))}get hostElement(){return this}static get watchers(){return{chartData:[{chartDataChanged:0}],legendVisible:[{legendVisibilityChanged:0}]}}static get style(){return":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-pie-chart{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box}.gids-pie-chart--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-pie-chart__main-container{display:inline-flex;justify-content:center;gap:var(--gids-gap-200);width:100%;height:100%}.gids-pie-chart__chart-stage-container{display:flex;justify-content:center;align-items:center}.gids-pie-chart{}.gids-pie-chart__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-pie-chart__svg-wrapper--size-xxs{width:180px;height:180px}.gids-pie-chart__svg-wrapper--size-xs{width:220px;height:220px}.gids-pie-chart__svg-wrapper--size-sm{width:260px;height:260px}.gids-pie-chart__svg-wrapper--size-md{width:300px;height:300px}.gids-pie-chart__svg-wrapper--size-lg{width:340px;height:340px}.gids-pie-chart__chart-vector{display:block;width:100%;height:100%}.gids-pie-chart{}.gids-pie-chart__track-background{fill:none;stroke:var(--gids-color-background-neutral-default);stroke-width:12;}.gids-pie-chart__segment{fill:none;stroke-width:12;stroke-linecap:butt;transition:stroke-dashoffset 0.3s ease;}.gids-pie-chart__segment.gids-pie-chart__segment-series-1{stroke:var(--gids-color-icon-subtle);}.gids-pie-chart__segment.gids-pie-chart__segment-series-2{stroke:var(--gids-color-icon-warning);}.gids-pie-chart__segment.gids-pie-chart__segment-series-3{stroke:var(--gids-color-icon-danger);}.gids-pie-chart__segment.gids-pie-chart__segment-series-4{stroke:var(--gids-color-background-positive-bold-hovered);}.gids-pie-chart__segment.gids-pie-chart__segment-series-5{stroke:var(--gids-color-background-information-bold-default);}.gids-pie-chart__segment.gids-pie-chart__segment-series-6{stroke:rgb(238, 70, 188);}.gids-pie-chart__legend-container{display:inline-flex;align-items:flex-start}.gids-pie-chart__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-pie-chart",{breakpoint:[1],legendVisible:[4,"legend-visible"],chartData:[16],size:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{chartData:[{chartDataChanged:0}],legendVisible:[{legendVisibilityChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["gids-pie-chart","gids-chart-legend","gids-chart-legend-item"].forEach((i=>{switch(i){case"gids-pie-chart":customElements.get(e(i))||customElements.define(e(i),n);break;case"gids-chart-legend":customElements.get(e(i))||d();break;case"gids-chart-legend-item":customElements.get(e(i))||h()}}))}c();export{n as G,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as i,p as s,H as t,h as e}from"./p-
|
|
1
|
+
import{t as i,p as s,H as t,h as e}from"./p-Bf3p-DY2.js";import{g as o}from"./p-B2zUuNXz.js";import{G as n}from"./p-D4Pimu_8.js";const c=s(class extends t{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow()}connectedCallback(){const i=o();void 0!==i&&this._el.shadowRoot?.adoptedStyleSheets.push(i)}render(){return e(n,{key:"38a60d81d2e4682272e7892c137bad482b471f52",name:this.name,size:this.size,appearance:this.appearance,alt:this.alt,titleId:this.titleId})}get _el(){return this}static get style(){return".gids-icon{color:var(--gidsIcon-color, var(--gids-color-icon-default));fill:var(--gidsIcon-color, var(--gids-color-icon-default));width:auto;height:var(--gidsIcon-height, 100%);flex-shrink:0}.gids-icon--xs{--gidsIcon-height:var(--gids-size-120)}.gids-icon--sm{--gidsIcon-height:var(--gids-size-160)}.gids-icon--md{--gidsIcon-height:var(--gids-size-240)}.gids-icon--lg{--gidsIcon-height:var(--gids-size-320)}"}},[1,"gids-icon",{name:[1],size:[1],appearance:[1],alt:[1],titleId:[1,"title-id"]}]);function d(){"undefined"!=typeof customElements&&["gids-icon"].forEach((s=>{"gids-icon"===s&&(customElements.get(i(s))||customElements.define(i(s),c))}))}d();export{c as G,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a,p as e,H as t,h as l}from"./p-Ct3Ixgvf.js";import{GidsLevelGaugeWebUtils as i}from"@ganpatiinfo/gids-web-shared";import{CIRCLE_VAL_LESS_MAX_VAL_SUPPORTING_TEXT as s,CIRCLE_VAL_LESS_MAX_VAL_TITLE as g,FULL_CIRCLE_MAX_VAL as r}from"@ganpatiinfo/gids-core-shared";import{G as n}from"./p-D_wcwB7E.js";import{G as o}from"./p-Dehss-X0.js";const{getGidsLevelGaugeClassNames:p}=i,d=e(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.breakpoint="desktop",this.value=0,this.label="Completed",this.size="xxs",this.color="amber",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}valueChanged(){this.updateDimensions()}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const a=this.hostElement.getBoundingClientRect();this.width=a.width,this.height=a.height>0?a.height:240}render(){if(this.chartLoading)return l("div",{class:"gids-level-gauge__no-data"},l(o,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));let a=0;"number"==typeof this.value&&!isNaN(this.value)&&(a=this.value);const e=r;if(!("number"==typeof this.value&&!isNaN(this.value)&&this.value<=e&&this.value>=0))return l("div",{class:"gids-level-gauge__no-data"},l(n,{title:g,supportingText:s(100),image:l("slot",{name:"chartFeedbackBlockImage"})}));const t=Math.min(Math.max(a/e,0),1),i=`${Math.round(100*t)}%`,d=p({breakpoint:this.breakpoint}),h=2*Math.PI*40,_=`${t*h} ${h}`,y="xxs"===this.size;return l("div",{class:d},l("div",{class:`gids-level-gauge__main-container gids-level-gauge__main-container--variant-${this.color}`},l("div",{class:`gids-level-gauge__svg-wrapper gids-level-gauge__svg-wrapper--size-${this.size}`},l("svg",{viewBox:"0 0 100 100",class:"gids-level-gauge__chart-vector"},l("circle",{cx:"50",cy:"50",r:40,class:"gids-level-gauge__track-background"}),l("circle",{cx:"50",cy:"50",r:40,class:`gids-level-gauge__segment gids-level-gauge__segment--variant-${this.color}`,"stroke-dasharray":_,"stroke-dashoffset":"0",transform:"rotate(-90 50 50)"})),l("div",{class:"gids-level-gauge__center-content"},y?null:l("span",{class:`gids-level-gauge__label-common gids-level-gauge__label-${this.size}`},this.label),l("span",{class:`gids-level-gauge__percentage-common gids-level-gauge__percentage-${this.size}`},i))),y?l("div",{class:"gids-level-gauge__bottom-content"},l("span",{class:`gids-level-gauge__label-common gids-level-gauge__label-${this.size}`},this.label)):null))}get hostElement(){return this}static get watchers(){return{value:[{valueChanged:0}],max:[{valueChanged:0}]}}static get style(){return":host{display:block;box-sizing:border-box}.gids-level-gauge{display:block;box-sizing:border-box}.gids-level-gauge--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-level-gauge__main-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.gids-level-gauge{}.gids-level-gauge__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-level-gauge__svg-wrapper--size-xxs{width:180px;height:180px}.gids-level-gauge__svg-wrapper--size-xs{width:220px;height:220px}.gids-level-gauge__svg-wrapper--size-sm{width:260px;height:260px}.gids-level-gauge__svg-wrapper--size-md{width:300px;height:300px}.gids-level-gauge__svg-wrapper--size-lg{width:340px;height:340px}.gids-level-gauge__chart-vector{display:block;width:100%;height:100%}.gids-level-gauge{}.gids-level-gauge__main-container{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-level-gauge__main-container--variant-amber .gids-level-gauge__track-background{stroke:rgb(248, 248, 248)}.gids-level-gauge__main-container--variant-burgundy .gids-level-gauge__track-background{stroke:rgb(246, 243, 243)}.gids-level-gauge__main-container--variant-teal .gids-level-gauge__track-background{stroke:rgb(232, 245, 250)}.gids-level-gauge__track-background{fill:none;stroke-width:6}.gids-level-gauge__segment{fill:none;stroke-width:6;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out}.gids-level-gauge__segment--variant-amber{stroke:rgb(80, 82, 88)}.gids-level-gauge__segment--variant-burgundy{stroke:rgb(132, 84, 95)}.gids-level-gauge__segment--variant-teal{stroke:rgb(23, 60, 102)}.gids-level-gauge{}.gids-level-gauge__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;gap:var(--gids-gap-025)}.gids-level-gauge__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__label-common{color:var(--gids-color-text-subtlest)}.gids-level-gauge__percentage-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-common{color:var(--gids-color-text-default)}.gids-level-gauge{}.gids-level-gauge__bottom-content{display:flex;justify-content:center;text-align:center}.gids-level-gauge__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[260,"gids-level-gauge",{breakpoint:[1],value:[2],label:[1],size:[1],color:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{value:[{valueChanged:0}],max:[{valueChanged:0}]}]);function h(){"undefined"!=typeof customElements&&["gids-level-gauge"].forEach((e=>{"gids-level-gauge"===e&&(customElements.get(a(e))||customElements.define(a(e),d))}))}h();export{d as G,h as d}
|
|
1
|
+
import{t as a,p as e,H as t,h as l}from"./p-Bf3p-DY2.js";import{GidsLevelGaugeWebUtils as i}from"@ganpatiinfo/gids-web-shared";import{CIRCLE_VAL_LESS_MAX_VAL_SUPPORTING_TEXT as s,CIRCLE_VAL_LESS_MAX_VAL_TITLE as g,FULL_CIRCLE_MAX_VAL as r}from"@ganpatiinfo/gids-core-shared";import{G as n}from"./p-CaauwQNd.js";import{G as o}from"./p-DMNS1d8v.js";const{getGidsLevelGaugeClassNames:p}=i,d=e(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.breakpoint="desktop",this.value=0,this.label="Completed",this.size="xxs",this.color="amber",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}valueChanged(){this.updateDimensions()}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const a=this.hostElement.getBoundingClientRect();this.width=a.width,this.height=a.height>0?a.height:240}render(){if(this.chartLoading)return l("div",{class:"gids-level-gauge__no-data"},l(o,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));let a=0;"number"==typeof this.value&&!isNaN(this.value)&&(a=this.value);const e=r;if(!("number"==typeof this.value&&!isNaN(this.value)&&this.value<=e&&this.value>=0))return l("div",{class:"gids-level-gauge__no-data"},l(n,{title:g,supportingText:s(100),image:l("slot",{name:"chartFeedbackBlockImage"})}));const t=Math.min(Math.max(a/e,0),1),i=`${Math.round(100*t)}%`,d=p({breakpoint:this.breakpoint}),h=2*Math.PI*40,_=`${t*h} ${h}`,y="xxs"===this.size;return l("div",{class:d},l("div",{class:`gids-level-gauge__main-container gids-level-gauge__main-container--variant-${this.color}`},l("div",{class:`gids-level-gauge__svg-wrapper gids-level-gauge__svg-wrapper--size-${this.size}`},l("svg",{viewBox:"0 0 100 100",class:"gids-level-gauge__chart-vector"},l("circle",{cx:"50",cy:"50",r:40,class:"gids-level-gauge__track-background"}),l("circle",{cx:"50",cy:"50",r:40,class:`gids-level-gauge__segment gids-level-gauge__segment--variant-${this.color}`,"stroke-dasharray":_,"stroke-dashoffset":"0",transform:"rotate(-90 50 50)"})),l("div",{class:"gids-level-gauge__center-content"},y?null:l("span",{class:`gids-level-gauge__label-common gids-level-gauge__label-${this.size}`},this.label),l("span",{class:`gids-level-gauge__percentage-common gids-level-gauge__percentage-${this.size}`},i))),y?l("div",{class:"gids-level-gauge__bottom-content"},l("span",{class:`gids-level-gauge__label-common gids-level-gauge__label-${this.size}`},this.label)):null))}get hostElement(){return this}static get watchers(){return{value:[{valueChanged:0}],max:[{valueChanged:0}]}}static get style(){return":host{display:block;box-sizing:border-box}.gids-level-gauge{display:block;box-sizing:border-box}.gids-level-gauge--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-level-gauge__main-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.gids-level-gauge{}.gids-level-gauge__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-level-gauge__svg-wrapper--size-xxs{width:180px;height:180px}.gids-level-gauge__svg-wrapper--size-xs{width:220px;height:220px}.gids-level-gauge__svg-wrapper--size-sm{width:260px;height:260px}.gids-level-gauge__svg-wrapper--size-md{width:300px;height:300px}.gids-level-gauge__svg-wrapper--size-lg{width:340px;height:340px}.gids-level-gauge__chart-vector{display:block;width:100%;height:100%}.gids-level-gauge{}.gids-level-gauge__main-container{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-level-gauge__main-container--variant-amber .gids-level-gauge__track-background{stroke:rgb(248, 248, 248)}.gids-level-gauge__main-container--variant-burgundy .gids-level-gauge__track-background{stroke:rgb(246, 243, 243)}.gids-level-gauge__main-container--variant-teal .gids-level-gauge__track-background{stroke:rgb(232, 245, 250)}.gids-level-gauge__track-background{fill:none;stroke-width:6}.gids-level-gauge__segment{fill:none;stroke-width:6;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out}.gids-level-gauge__segment--variant-amber{stroke:rgb(80, 82, 88)}.gids-level-gauge__segment--variant-burgundy{stroke:rgb(132, 84, 95)}.gids-level-gauge__segment--variant-teal{stroke:rgb(23, 60, 102)}.gids-level-gauge{}.gids-level-gauge__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;gap:var(--gids-gap-025)}.gids-level-gauge__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__label-common{color:var(--gids-color-text-subtlest)}.gids-level-gauge__percentage-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-common{color:var(--gids-color-text-default)}.gids-level-gauge{}.gids-level-gauge__bottom-content{display:flex;justify-content:center;text-align:center}.gids-level-gauge__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[260,"gids-level-gauge",{breakpoint:[1],value:[2],label:[1],size:[1],color:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{value:[{valueChanged:0}],max:[{valueChanged:0}]}]);function h(){"undefined"!=typeof customElements&&["gids-level-gauge"].forEach((e=>{"gids-level-gauge"===e&&(customElements.get(a(e))||customElements.define(a(e),d))}))}h();export{d as G,h as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as a,H as i,h as e}from"./p-Ct3Ixgvf.js";import{GidsActivityGaugeWebUtils as s}from"@ganpatiinfo/gids-web-shared";import{G as g}from"./p-Dehss-X0.js";import{d as l}from"./p-B_HaXpJZ.js";import{d as r}from"./p-B81J5HCC.js";const{getGidsActivityGaugeClassNames:n}=s,o=a(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.breakpoint="desktop",this.chartData=[],this.label="",this.size="xs",this.legend="none",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}chartDataChanged(){this.updateDimensions()}legendChanged(t){this.legend=t}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const t=this.hostElement.getBoundingClientRect();this.width=t.width,this.height=t.height>0?t.height:240}render(){if(this.chartLoading)return e("div",{class:"gids-activity-gauge__no-data"},e(g,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const t=this.chartData.map((t=>t.value||0)),a=t.length>0?Math.max(...t):0,i=Math.max(1e3,a),s=i.toLocaleString(),l=n({breakpoint:this.breakpoint}),r=[{radius:42,strokeWidth:5.5},{radius:34,strokeWidth:5.5},{radius:26,strokeWidth:5.5}],o="xxs"===this.size,d="string"==typeof this.label&&""!==this.label.trim(),h=this.legend&&"right"===this.legend&&"mobile"!==this.breakpoint,p=this.legend&&("bottom"===this.legend||"mobile"===this.breakpoint);return e("div",{class:l},e("div",{class:"gids-activity-gauge__main-container"},e("div",{class:"gids-activity-gauge__chart-stage-container"},e("div",{class:`gids-activity-gauge__svg-wrapper gids-activity-gauge--size-${this.size}`},e("svg",{viewBox:"0 0 100 100",class:"gids-activity-gauge__chart-vector"},this.chartData.slice(0,3).map(((t,a)=>{const s=r[a]||r[0]||{radius:26,strokeWidth:5.5},g=i>0?Math.min(Math.max((t.value||0)/i,0),1):0,l=2*Math.PI*s.radius,n=`${g*l} ${l}`;return e("g",{key:t.label||a},e("circle",{cx:"50",cy:"50",r:s.radius,"stroke-width":s.strokeWidth,class:"gids-activity-gauge__track-background"}),e("circle",{cx:"50",cy:"50",r:s.radius,"stroke-width":s.strokeWidth,class:`gids-activity-gauge__segment gids-activity-gauge__segment-series-${a+1}`,"stroke-dasharray":n,"stroke-dashoffset":"0",transform:"rotate(-90 50 50)"}))}))),e("div",{class:"gids-activity-gauge__center-content"},d&&!o?e("span",{class:`gids-activity-gauge__label-common gids-activity-gauge__label-${this.size}`},this.label):null,e("span",{class:`gids-activity-gauge__value-common gids-activity-gauge__value-${this.size}`},s)))),h?e("div",{class:"gids-activity-gauge__sidebar"},e("gids-chart-legend",{orientation:"vertical"},this.chartData.slice(0,3).map(((t,a)=>e("gids-chart-legend-item",{key:t.label,seriesType:`${a+1}`,orientation:"vertical"},t.label))))):null),o&&d?e("div",{class:"gids-activity-gauge__bottom-content"},e("span",{class:`gids-activity-gauge__label-common gids-activity-gauge__label-${this.size}`},this.label)):null,p?e("div",{class:"gids-activity-gauge__legend-container gids-activity-gauge__legend-container--bottom"},e("gids-chart-legend",{orientation:"horizontal"},this.chartData.slice(0,3).map(((t,a)=>e("gids-chart-legend-item",{key:t.label,seriesType:`${a+1}`,orientation:"horizontal"},t.label))))):null)}get hostElement(){return this}static get watchers(){return{chartData:[{chartDataChanged:0}],legend:[{legendChanged:0}]}}static get style(){return":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-activity-gauge{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.gids-activity-gauge--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-activity-gauge__main-container{display:inline-flex;justify-content:center;gap:var(--gids-gap-200);width:100%;height:100%}.gids-activity-gauge__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-activity-gauge--size-xxs{width:180px;height:180px}.gids-activity-gauge--size-xs{width:220px;height:220px}.gids-activity-gauge--size-sm{width:260px;height:260px}.gids-activity-gauge--size-md{width:300px;height:300px}.gids-activity-gauge--size-lg{width:340px;height:340px}.gids-activity-gauge__chart-stage-container{display:flex;justify-content:center;align-items:center}.gids-activity-gauge__chart-vector{display:block;width:100%;height:100%}.gids-activity-gauge__track-background{fill:none;stroke:var(--gids-color-background-brand-subtlest-default);stroke-linecap:round}.gids-activity-gauge__segment{fill:none;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-1{stroke:var(--gids-color-icon-subtle)}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-2{stroke:var(--gids-color-icon-warning)}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-3{stroke:var(--gids-color-icon-danger)}.gids-activity-gauge__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}.gids-activity-gauge__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__label-common{color:var(--gids-color-text-subtlest)}.gids-activity-gauge__value-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__value-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-activity-gauge__value-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-activity-gauge__value-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-activity-gauge__value-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-activity-gauge__value-common{color:var(--gids-color-text-default)}.gids-activity-gauge__bottom-content{display:flex;justify-content:center;align-items:center;text-align:center}.gids-activity-gauge__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-activity-gauge",{breakpoint:[1],chartData:[16],label:[1],size:[1],legend:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{chartData:[{chartDataChanged:0}],legend:[{legendChanged:0}]}]);function d(){"undefined"!=typeof customElements&&["gids-activity-gauge","gids-chart-legend","gids-chart-legend-item"].forEach((a=>{switch(a){case"gids-activity-gauge":customElements.get(t(a))||customElements.define(t(a),o);break;case"gids-chart-legend":customElements.get(t(a))||l();break;case"gids-chart-legend-item":customElements.get(t(a))||r()}}))}d();export{o as G,d}
|
|
1
|
+
import{t,p as a,H as i,h as e}from"./p-Bf3p-DY2.js";import{GidsActivityGaugeWebUtils as s}from"@ganpatiinfo/gids-web-shared";import{G as g}from"./p-DMNS1d8v.js";import{d as l}from"./p-DoCwI_bx.js";import{d as r}from"./p-mZJdpfOo.js";const{getGidsActivityGaugeClassNames:n}=s,o=a(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.breakpoint="desktop",this.chartData=[],this.label="",this.size="xs",this.legend="none",this.chartLoaderSize="lg",this.chartLoading=!1,this.width=0,this.height=0}chartDataChanged(){this.updateDimensions()}legendChanged(t){this.legend=t}componentDidLoad(){this.updateDimensions(),this.resizeObserver=new ResizeObserver((()=>this.updateDimensions())),this.hostElement.parentElement&&this.resizeObserver.observe(this.hostElement.parentElement)}disconnectedCallback(){this.resizeObserver&&this.resizeObserver.disconnect()}updateDimensions(){const t=this.hostElement.getBoundingClientRect();this.width=t.width,this.height=t.height>0?t.height:240}render(){if(this.chartLoading)return e("div",{class:"gids-activity-gauge__no-data"},e(g,{label:this.chartLoadingTitle,supportingText:this.chartLoadingSupportingText,size:this?.chartLoaderSize??"lg"}));const t=this.chartData.map((t=>t.value||0)),a=t.length>0?Math.max(...t):0,i=Math.max(1e3,a),s=i.toLocaleString(),l=n({breakpoint:this.breakpoint}),r=[{radius:42,strokeWidth:5.5},{radius:34,strokeWidth:5.5},{radius:26,strokeWidth:5.5}],o="xxs"===this.size,d="string"==typeof this.label&&""!==this.label.trim(),h=this.legend&&"right"===this.legend&&"mobile"!==this.breakpoint,p=this.legend&&("bottom"===this.legend||"mobile"===this.breakpoint);return e("div",{class:l},e("div",{class:"gids-activity-gauge__main-container"},e("div",{class:"gids-activity-gauge__chart-stage-container"},e("div",{class:`gids-activity-gauge__svg-wrapper gids-activity-gauge--size-${this.size}`},e("svg",{viewBox:"0 0 100 100",class:"gids-activity-gauge__chart-vector"},this.chartData.slice(0,3).map(((t,a)=>{const s=r[a]||r[0]||{radius:26,strokeWidth:5.5},g=i>0?Math.min(Math.max((t.value||0)/i,0),1):0,l=2*Math.PI*s.radius,n=`${g*l} ${l}`;return e("g",{key:t.label||a},e("circle",{cx:"50",cy:"50",r:s.radius,"stroke-width":s.strokeWidth,class:"gids-activity-gauge__track-background"}),e("circle",{cx:"50",cy:"50",r:s.radius,"stroke-width":s.strokeWidth,class:`gids-activity-gauge__segment gids-activity-gauge__segment-series-${a+1}`,"stroke-dasharray":n,"stroke-dashoffset":"0",transform:"rotate(-90 50 50)"}))}))),e("div",{class:"gids-activity-gauge__center-content"},d&&!o?e("span",{class:`gids-activity-gauge__label-common gids-activity-gauge__label-${this.size}`},this.label):null,e("span",{class:`gids-activity-gauge__value-common gids-activity-gauge__value-${this.size}`},s)))),h?e("div",{class:"gids-activity-gauge__sidebar"},e("gids-chart-legend",{orientation:"vertical"},this.chartData.slice(0,3).map(((t,a)=>e("gids-chart-legend-item",{key:t.label,seriesType:`${a+1}`,orientation:"vertical"},t.label))))):null),o&&d?e("div",{class:"gids-activity-gauge__bottom-content"},e("span",{class:`gids-activity-gauge__label-common gids-activity-gauge__label-${this.size}`},this.label)):null,p?e("div",{class:"gids-activity-gauge__legend-container gids-activity-gauge__legend-container--bottom"},e("gids-chart-legend",{orientation:"horizontal"},this.chartData.slice(0,3).map(((t,a)=>e("gids-chart-legend-item",{key:t.label,seriesType:`${a+1}`,orientation:"horizontal"},t.label))))):null)}get hostElement(){return this}static get watchers(){return{chartData:[{chartDataChanged:0}],legend:[{legendChanged:0}]}}static get style(){return":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-activity-gauge{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.gids-activity-gauge--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-activity-gauge__main-container{display:inline-flex;justify-content:center;gap:var(--gids-gap-200);width:100%;height:100%}.gids-activity-gauge__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-activity-gauge--size-xxs{width:180px;height:180px}.gids-activity-gauge--size-xs{width:220px;height:220px}.gids-activity-gauge--size-sm{width:260px;height:260px}.gids-activity-gauge--size-md{width:300px;height:300px}.gids-activity-gauge--size-lg{width:340px;height:340px}.gids-activity-gauge__chart-stage-container{display:flex;justify-content:center;align-items:center}.gids-activity-gauge__chart-vector{display:block;width:100%;height:100%}.gids-activity-gauge__track-background{fill:none;stroke:var(--gids-color-background-brand-subtlest-default);stroke-linecap:round}.gids-activity-gauge__segment{fill:none;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-1{stroke:var(--gids-color-icon-subtle)}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-2{stroke:var(--gids-color-icon-warning)}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-3{stroke:var(--gids-color-icon-danger)}.gids-activity-gauge__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}.gids-activity-gauge__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__label-common{color:var(--gids-color-text-subtlest)}.gids-activity-gauge__value-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__value-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-activity-gauge__value-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-activity-gauge__value-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-activity-gauge__value-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-activity-gauge__value-common{color:var(--gids-color-text-default)}.gids-activity-gauge__bottom-content{display:flex;justify-content:center;align-items:center;text-align:center}.gids-activity-gauge__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}"}},[0,"gids-activity-gauge",{breakpoint:[1],chartData:[16],label:[1],size:[1],legend:[1],chartLoaderSize:[1,"chart-loader-size"],chartLoading:[4,"chart-loading"],chartLoadingTitle:[1,"chart-loading-title"],chartLoadingSupportingText:[1,"chart-loading-supporting-text"],width:[32],height:[32]},void 0,{chartData:[{chartDataChanged:0}],legend:[{legendChanged:0}]}]);function d(){"undefined"!=typeof customElements&&["gids-activity-gauge","gids-chart-legend","gids-chart-legend-item"].forEach((a=>{switch(a){case"gids-activity-gauge":customElements.get(t(a))||customElements.define(t(a),o);break;case"gids-chart-legend":customElements.get(t(a))||l();break;case"gids-chart-legend-item":customElements.get(t(a))||r()}}))}d();export{o as G,d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e}from"./p-Bf3p-DY2.js";import{GidsLabelCommonUtils as i}from"@ganpatiinfo/gids-core-shared";import{GidsLabelWebUtils as t}from"@ganpatiinfo/gids-web-shared";const{getIndicatorText:l}=i,{getGidsLabelClassNames:r}=t,a=({disabled:i,fieldRequirement:t,fieldRequirementOptionalText:a,fieldRequirementRequiredText:d,info:n,htmlFor:s,labelId:o,class:m,isLabelSentence:f,...p},c)=>{const u=l({children:c,fieldRequirement:t,fieldRequirementOptionalText:a,fieldRequirementRequiredText:d,isLabelSentence:f});return e("div",{class:r({disabled:i},m),...p},e("label",{htmlFor:s,id:o},c,u&&e("span",{class:"gids-label__field-requirement"},u)),n)};export{a as G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as s,c as i,h as n,d}from"./p-Bf3p-DY2.js";import{G as c}from"./p-UVmSPzTd.js";import{g as a}from"./p-B2zUuNXz.js";const l=t(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.select=i(this,"select"),this._toggle=this._toggle.bind(this)}handleSelctedChange(e){this.selected=e}connectedCallback(){const e=a();void 0!==e&&this._el.shadowRoot?.adoptedStyleSheets.push(e)}_toggle(){const e=!this.selected;this._el.selected=this.selected,this.select?.emit(e),this.selected=this.selected}render(){return n(d,{key:"f7fe1215b0945a6d71c23d3644121dd73ff653cf"},n("style",{key:"78195ef784f5f4df916d0a61e9b988233db31fef"},`:host {\n display: ${"full"===this.width?"block":"inline-block"}\n }`),n(c,{key:"c0ae6269f93d930064073e1091cd145e453b7e7f",appearance:this.appearance,size:this.size,width:this.width,disabled:this.disabled,onClick:this._toggle,"aria-pressed":this.selected?"true":"false",leadingIcon:n("slot",{name:"leadingIcon"}),trailingIcon:n("slot",{name:"trailingIcon"}),forceIconOnly:this._onlyHasLeadingIcon()},n("slot",{key:"1e8fd27fe3a99d3957b0cc4d6334cd297bc8fb21"})))}_onlyHasLeadingIcon(){const e=this._el.childNodes;return 1===e.length&&e[0]instanceof window.Element&&"leadingIcon"===e[0].slot}get _el(){return this}static get watchers(){return{selected:[{handleSelctedChange:0}]}}},[257,"gids-toggle-button",{disabled:[516],appearance:[513],size:[513],width:[513],defaultSelected:[516,"default-selected"],selected:[1540]},void 0,{selected:[{handleSelctedChange:0}]}]);function o(){"undefined"!=typeof customElements&&["gids-toggle-button"].forEach((t=>{"gids-toggle-button"===t&&(customElements.get(e(t))||customElements.define(e(t),l))}))}o();export{l as G,o as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as n,h as a}from"./p-Bf3p-DY2.js";import{GidsChartLegendWebUtils as i}from"@ganpatiinfo/gids-web-shared";const{getGidsChartLegendClassNames:s}=i,r=t(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.orientation="horizontal"}handleOrientationChange(e){this.orientation=e}render(){const e=s({orientation:this.orientation});return a("div",{key:"91b00cc799a723fe520513e41dc67df2b19c871e",class:e},a("slot",{key:"83968874a18a0fb86706516b4083d6582a3341fb"}))}static get watchers(){return{orientation:[{handleOrientationChange:0}]}}static get style(){return".gids-chart-legend{display:inline-flex;align-items:flex-start;gap:var(--gids-gap-150)}.gids-chart-legend--orientation-vertical{flex-direction:column;gap:var(--gids-gap-050)}"}},[260,"gids-chart-legend",{orientation:[1]},void 0,{orientation:[{handleOrientationChange:0}]}]);function o(){"undefined"!=typeof customElements&&["gids-chart-legend"].forEach((t=>{"gids-chart-legend"===t&&(customElements.get(e(t))||customElements.define(e(t),r))}))}o();export{r as G,o as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as t,H as i,h as s}from"./p-Bf3p-DY2.js";import{GidsFilterWebUtils as n}from"@ganpatiinfo/gids-web-shared";import{G as l}from"./p-D4Pimu_8.js";import{d}from"./p-DmLoB2Dn.js";const{getGidsFilterClassNames:r}=n,h=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.expanded=!1,this.type="none",this.filterItemType="primary",this.filterSelected=!1,this.filterDefaultSelected=!1,this.disabled=!1,this.size="sm",this.loading=!1,this.filterIndex=0,this.hasSlottedMenu=!1,this.hasItemListener=!1,this.suppressNextMenuClickSelection=!1,this.handleFilterPickerItemSelect=e=>{const{value:t,title:i,disabled:s,id:n,selectedIndex:l,isPlaceholderItem:d,defaultSelected:r}=e.detail;s||"string"!=typeof t||(this.suppressNextMenuClickSelection=!0,queueMicrotask((()=>{this.suppressNextMenuClickSelection=!1})),this.applySelection({id:n,filterId:this?.filterId,value:t,title:i,disabled:!1,selectedFilterMenuIndex:l,defaultSelected:r,filterType:this.type,filterItemType:this.filterItemType,filterTitle:i,filterIndex:this.filterIndex,hasFilterMenu:!0,originalEvent:e,filterSelected:!d,isPlaceholderItem:d||!1}))},this.handleMenuClick=e=>{if(this.suppressNextMenuClickSelection)return;const t=e.target;if(!(t instanceof Element))return;const i=t.closest(".gids-dropdown-item");if(!i||!this.hostElement.contains(i))return;if(i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;const s=i instanceof HTMLButtonElement?i.value:i.getAttribute("value")??"";if("string"!=typeof s||0===s.length)return;const n=i instanceof HTMLButtonElement?i.id:i.getAttribute("id")??"";if("string"!=typeof n||0===n.length)return;const l=i instanceof HTMLButtonElement?i.tabIndex:i.getAttribute("tabIndex")??"",d=i.getAttribute("is-placeholder-item")??"",r=i.querySelector(".gids-dropdown-item__label")||i.querySelector("span"),h=r?r.textContent?.trim():i.firstChild?.textContent?.trim()||s,a=!(!d||"true"!==d);this.applySelection({id:n,filterId:this.filterId,value:s,title:h,disabled:!1,selectedFilterMenuIndex:Number(l),defaultSelected:this.filterDefaultSelected,filterType:this.type,filterItemType:this.filterItemType,filterTitle:h,filterIndex:this.filterIndex,hasFilterMenu:!0,originalEvent:e,filterSelected:!a,isPlaceholderItem:a})},this.handleTriggerToggle=e=>{this.isInteractive()&&this.setExpandedState(!this.expanded,e)},this.handleFilterButtonClickToggle=e=>{if(!e.defaultPrevented)if(e.stopPropagation(),this.isMenuToggler())this.handleTriggerToggle(e);else{this.filterSelected=e.detail,!1===e?.detail&&this.handleFormReset(),this.applySelection({id:"1",filterId:this.filterId,value:this.value,title:this.value,disabled:this.disabled,selectedFilterMenuIndex:void 0,filterType:this.type,filterItemType:this.filterItemType,filterTitle:this.value,filterIndex:this.filterIndex,originalEvent:e,filterSelected:e.detail,hasFilterMenu:!1,isPlaceholderItem:!1});const t={expanded:!1,originalEvent:e};this.onToggle?.(t)}},this.handleFormReset=()=>{this.value=this.initialValue,this.selectedItemTitle=this.initialValue,this.filterSelected=!1,this.isMenuToggler()?this.setExpandedState(!1):this.expanded=!1},this.setFilterDropdownPosition=()=>{if(!this.hostElement)return;const e=this.hostElement.querySelector(".gids-filter__menu");if(!e)return;const t=window.innerWidth/2,i=this.hostElement.getBoundingClientRect();i.left+i.width/2>t?e.classList.add("gids-filter__menu--align-right"):e.classList.remove("gids-filter__menu--align-right")}}handleExpandedChange(e){e&&!this.isInteractive()&&(this.expanded=!1)}handleInteractivityChange(){!this.isInteractive()&&this.expanded&&this.setExpandedState(!1)}handleFilterTypeChange(e){this.type=e}handleFilterSelectedChange(e){this.filterSelected=e}connectedCallback(){this.attachItemListener(),this.attachFormListener()}componentDidLoad(){this.initialValue=this.value,this.evaluateSlottedMenuExistence()}disconnectedCallback(){this.detachItemListener(),this.detachFormListener()}getFilterButtonControl(){return this.hostElement.querySelector(".gids-button")}getItemElements(){return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"))}evaluateSlottedMenuExistence(){const e=this.hostElement.querySelector(".gids-filter__menu");if(!e)return void(this.hasSlottedMenu=!1);const t=Array.from(e.childNodes).filter((e=>e.nodeType!==Node.COMMENT_NODE&&!(e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim())));this.hasSlottedMenu=t.length>0}attachItemListener(){this.hasItemListener||(this.hostElement.addEventListener("onPressDropdownItem",this.handleFilterPickerItemSelect),this.hasItemListener=!0)}detachItemListener(){this.hasItemListener&&(this.hostElement.removeEventListener("onPressDropdownItem",this.handleFilterPickerItemSelect),this.hasItemListener=!1)}applySelection(e){this.value=e.value,this.selectedItemTitle="string"==typeof e.title?e.title:void 0,this.clearActive(),this.isMenuToggler()?this.setExpandedState(!1,this.coerceEvent(e.originalEvent)):this.expanded=!1,this.onFilterMenuItemChange?.(e),this.hostElement.dispatchEvent(new CustomEvent("gidsFilterPickerChange",{bubbles:!0,composed:!0,detail:e}))}clearActive(){this.getItemElements().forEach((e=>e.classList.remove("gids-dropdown-item--active")))}setExpandedState(e,t){const i=Boolean(e);if(this.setFilterDropdownPosition(),i&&!this.isInteractive())return;if(this.expanded===i)return;this.expanded=i,i||(this.clearActive(),this.syncFilterDisplayValue());const s={expanded:i,originalEvent:t};this.onToggle?.(s)}syncFilterDisplayValue(){const e=this.getFilterButtonControl();e&&e.value!==(this.selectedItemTitle??"")&&(e.value=this.selectedItemTitle??"")}attachFormListener(){const e=this.hostElement.closest("form");this.patternForm!==e&&(this.patternForm&&this.patternForm.removeEventListener("reset",this.handleFormReset),this.patternForm=e??void 0,this.patternForm?.addEventListener("reset",this.handleFormReset))}detachFormListener(){this.patternForm&&(this.patternForm.removeEventListener("reset",this.handleFormReset),this.patternForm=void 0)}isInteractive(){return!this.disabled}coerceEvent(e){if("undefined"!=typeof Event&&null!==e)return e instanceof Event?e:void 0}isMenuToggler(){return("none"===this.type||"more"===this.type)&&this.hasSlottedMenu}handleWindowClick(e){this.expanded&&(e.composedPath().includes(this.hostElement)||this.setExpandedState(!1,e))}render(){const e=this.expanded&&this.isInteractive(),t=r({expanded:e}),i=this.isMenuToggler(),n="string"==typeof this.filterPickerId?this.filterPickerId:void 0,d=n?`${n}__menu`:void 0,h=this.selectedItemTitle??this.value??"",a="more"===this.type,o="all"===this.type,c="none"===this.type;return s("div",{key:"278b8b3901a5c836c7e078aeafb2c6338726d76a",class:t,"aria-control":d??""},s("gids-toggle-button",{key:"b35f6770a815537932f617318e31df74a8031b3c",id:n,name:this.name,expanded:e,value:h,disabled:this.disabled,size:this.size,loading:this.loading,tabIndex:this.filterIndex,defaultSelected:this.filterDefaultSelected,selected:this.filterSelected||this.filterDefaultSelected,onSelect:this.handleFilterButtonClickToggle},a||o?s(l,{name:a?"options":"filter",size:this.size,appearance:"regular",alt:"",slot:"leadingIcon"}):void 0,c||o?h:void 0,i&&!a?s(l,{name:"chevron-down",size:this.size,appearance:"regular",alt:"",slot:"trailingIcon"}):void 0),s("div",{key:"d6b40dcae48bfb4b4f6654e2126c707afd2b0801",class:"gids-filter__menu",id:d,role:"pickerbox",onClick:this.handleMenuClick},s("slot",{key:"32c88f98018ebad487c6acdd02cf5c1e0cc00050",onSlotchange:()=>this.evaluateSlottedMenuExistence()})))}get hostElement(){return this}static get watchers(){return{expanded:[{handleExpandedChange:0}],disabled:[{handleInteractivityChange:0}],type:[{handleFilterTypeChange:0}],filterSelected:[{handleFilterSelectedChange:0}]}}static get style(){return".gids-filter{position:relative}.gids-filter__menu{position:absolute;top:calc(100% + var(--gids-gap-050));z-index:3;display:none;flex-direction:column;align-self:stretch;min-width:var(--gids-width-2-xs);min-height:55px;max-height:15rem;overflow-x:hidden;overflow-y:auto;background-color:var(--gids-elevation-surface-overlay-default);box-shadow:var(--gids-elevation-shadow-overlay);border-radius:var(--gids-border-radius-lg);left:0;right:auto}.gids-filter__menu--align-right{left:auto !important;right:0 !important}.gids-filter__menu>*{flex-shrink:0}.gids-filter--expanded .gids-filter__menu{display:flex}"}},[260,"gids-filter",{name:[1],filterId:[1,"filter-id"],filterPickerId:[1,"filter-picker-id"],expanded:[4],type:[1],filterItemType:[1,"filter-item-type"],value:[1],filterSelected:[1540,"filter-selected"],filterDefaultSelected:[4,"filter-default-selected"],disabled:[4],size:[1],loading:[4],filterIndex:[2,"filter-index"],onFilterMenuItemChange:[16],onToggle:[16],selectedItemTitle:[32],hasSlottedMenu:[32]},[[8,"click","handleWindowClick"]],{expanded:[{handleExpandedChange:0}],disabled:[{handleInteractivityChange:0}],type:[{handleFilterTypeChange:0}],filterSelected:[{handleFilterSelectedChange:0}]}]);function a(){"undefined"!=typeof customElements&&["gids-filter","gids-toggle-button"].forEach((t=>{switch(t){case"gids-filter":customElements.get(e(t))||customElements.define(e(t),h);break;case"gids-toggle-button":customElements.get(e(t))||d()}}))}a();export{h as G,a as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as e,H as i,h as s}from"./p-Bf3p-DY2.js";import{GidsDropdownPickerWebUtils as n}from"@ganpatiinfo/gids-web-shared";import{G as o}from"./p-UVmSPzTd.js";import{G as d}from"./p-D4Pimu_8.js";const{getGidsDropdownPickerClassNames:a}=n,r=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.appearance="subtle",this.size="sm",this.idPicker="",this.expanded=!1,this.hasLeadingIcon=!1,this.hasItemListener=!1,this.suppressNextMenuClickSelection=!1,this.hasDocumentListeners=!1,this.handleDropdownPickerItemSelect=t=>{const{value:e,title:i,disabled:s,id:n,isPlaceholderItem:o}=t.detail;s||"string"!=typeof e||(this.suppressNextMenuClickSelection=!0,queueMicrotask((()=>{this.suppressNextMenuClickSelection=!1})),this.applySelection({id:n,value:e,title:i,disabled:!1,originalEvent:t,isPlaceholderItem:o}))},this.handleMenuClick=t=>{if(this.suppressNextMenuClickSelection)return;const e=t.target;if(!(e instanceof Element))return;const i=e.closest(".gids-dropdown-item");if(!i||!this.hostElement.contains(i))return;if(i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled"))return;const s=i instanceof HTMLButtonElement?i.value:i.getAttribute("value")??"";if("string"!=typeof s||0===s.length)return;const n=i instanceof HTMLButtonElement?i.id:i.getAttribute("id")??"";if("string"!=typeof n||0===n.length)return;const o=i.getAttribute("is-placeholder-item")??"";this.applySelection({id:n,value:s,title:i.textContent?.trim()??"",disabled:!1,originalEvent:t,isPlaceholderItem:!(!o||"true"!==o)})},this.handleTriggerToggle=t=>{this.isInteractive()&&this.setExpandedState(!this.expanded,t)},this.handleDropdownButtonClickToggle=t=>{t.defaultPrevented||(t.stopPropagation(),this.handleTriggerToggle(t))},this.handleOutSpaceClickOfDropdownButtonToggle=t=>{this.expanded&&(t.stopPropagation(),this.setExpandedState(!1))},this.handleDocumentPointerDown=t=>{2!==t.button&&this.expanded&&(("function"==typeof t.composedPath?t.composedPath():[]).includes(this.hostElement)||this.hostElement.contains(t.target)||this.setExpandedState(!1,t))},this.handleDocumentKeyDown=t=>{if(!this.expanded)return;const e=t.key;if("Escape"===e||"Esc"===e)return t.preventDefault(),void this.setExpandedState(!1,t);"Tab"===e&&this.setExpandedState(!1,t)},this.handleFormReset=()=>{this.value=this.initialValue,this.selectedItemTitle=void 0,this.setExpandedState(!1)}}handleExpandedChange(t){t&&!this.isInteractive()&&(this.expanded=!1)}handleInteractivityChange(){!this.isInteractive()&&this.expanded&&this.setExpandedState(!1)}connectedCallback(){this.initialValue=this.value,this.attachItemListener(),this.attachDocumentListeners(),this.attachFormListener()}disconnectedCallback(){this.detachItemListener(),this.detachDocumentListeners(),this.detachFormListener()}componentWillLoad(){this.checkSlots()}componentWillUpdate(){this.checkSlots()}checkSlots(){this.hasLeadingIcon=!!this.hostElement.querySelector('[slot="leadingIconDropdownPicker"]')}getDropdownButtonControl(){return this.hostElement.querySelector(".gids-button")}getItemElements(){return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"))}attachItemListener(){this.hasItemListener||(this.hostElement.addEventListener("onPressDropdownItem",this.handleDropdownPickerItemSelect),this.hasItemListener=!0)}detachItemListener(){this.hasItemListener&&(this.hostElement.removeEventListener("onPressDropdownItem",this.handleDropdownPickerItemSelect),this.hasItemListener=!1)}applySelection(t){this.value=t.value,this.selectedItemTitle="string"==typeof t.title?t.title:void 0,this.clearActive(),this.setExpandedState(!1,this.coerceEvent(t.originalEvent)),this.onSelectionChange?.(t),this.hostElement.dispatchEvent(new CustomEvent("gidsDropdownPickerChange",{bubbles:!0,composed:!0,detail:t}))}clearActive(){this.getItemElements().forEach((t=>t.classList.remove("gids-dropdown-item--active")))}setExpandedState(t,e){const i=Boolean(t);i&&!this.isInteractive()||this.expanded!==i&&(this.expanded=i,i||(this.clearActive(),this.syncInputDisplayValue()),this.hostElement.dispatchEvent(new CustomEvent("gidsDropdownPickerToggle",{bubbles:!0,composed:!0,detail:{expanded:i,originalEvent:e}})))}syncInputDisplayValue(){const t=this.getDropdownButtonControl();t&&t.value!==(this.selectedItemTitle??"")&&(t.value=this.selectedItemTitle??"")}attachDocumentListeners(){this.hasDocumentListeners||"undefined"==typeof document||(document.addEventListener("pointerdown",this.handleDocumentPointerDown),document.addEventListener("keydown",this.handleDocumentKeyDown),this.hasDocumentListeners=!0)}detachDocumentListeners(){this.hasDocumentListeners&&"undefined"!=typeof document&&(document.removeEventListener("pointerdown",this.handleDocumentPointerDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.hasDocumentListeners=!1)}attachFormListener(){const t=this.hostElement.closest("form");this.patternForm!==t&&(this.patternForm&&this.patternForm.removeEventListener("reset",this.handleFormReset),this.patternForm=t??void 0,this.patternForm?.addEventListener("reset",this.handleFormReset))}detachFormListener(){this.patternForm&&(this.patternForm.removeEventListener("reset",this.handleFormReset),this.patternForm=void 0)}isInteractive(){return!this.disabled}coerceEvent(t){if("undefined"!=typeof Event&&null!==t)return t instanceof Event?t:void 0}render(){const t=this.expanded&&this.isInteractive(),e=a({expanded:t}),i="string"==typeof this.idPicker?this.idPicker:void 0,n=i?`${i}__menu`:void 0;return s("div",{key:"fd8821be1aecb1e5ba7f725d9ebec0f6222a16cd",class:e,onClick:this.handleOutSpaceClickOfDropdownButtonToggle},s(o,{key:"63016b4e74dfeaa3f9c29139f69a2d46ca97ae76",role:"pickerbox","aria-expanded":t?"true":"false","aria-haspopup":"pickerlistbox","aria-controls":n??"",onClick:this.handleDropdownButtonClickToggle,disabled:this.disabled,value:this.selectedItemTitle??this.value??"",loading:this.loading,appearance:this.appearance,size:this.size},this.hasLeadingIcon?s("slot",{name:"leadingIconDropdownPicker",slot:"leadingIcon"}):s(d,{name:"chevron-down",size:this.size,appearance:"regular",alt:"",slot:"leadingIcon"})),s("div",{key:"4f463a8f04de48e3b8b6ceeab69c90cbc8ba7631",class:"gids-dropdown-picker__menu",id:n,role:"pickerbox",onClick:this.handleMenuClick},s("slot",{key:"1fab2b1bd8cd2bcd0fd7031712d0585635620be1"})))}get hostElement(){return this}static get watchers(){return{expanded:[{handleExpandedChange:0}],disabled:[{handleInteractivityChange:0}]}}static get style(){return".gids-dropdown-picker{position:relative}.gids-dropdown-picker__menu{position:absolute;inset-inline:0;top:calc(100% + var(--gids-gap-050));z-index:3;display:none;flex-direction:column;align-self:stretch;min-width:var(--gids-width-2-xs);min-height:55px;max-height:15rem;overflow-x:hidden;overflow-y:auto;background-color:var(--gids-elevation-surface-overlay-default);box-shadow:var(--gids-elevation-shadow-overlay);border-radius:var(--gids-border-radius-lg)}.gids-dropdown-picker__menu>*{flex-shrink:0}.gids-dropdown-picker--expanded .gids-dropdown-picker__menu{display:flex}"}},[260,"gids-dropdown-picker",{appearance:[1],size:[1],idPicker:[1,"id-picker"],expanded:[1540],disabled:[516],loading:[516],value:[513],name:[1],onSelectionChange:[16],selectedItemTitle:[32],hasLeadingIcon:[32]},void 0,{expanded:[{handleExpandedChange:0}],disabled:[{handleInteractivityChange:0}]}]);function h(){"undefined"!=typeof customElements&&["gids-dropdown-picker"].forEach((e=>{"gids-dropdown-picker"===e&&(customElements.get(t(e))||customElements.define(t(e),r))}))}h();export{r as G,h as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t}from"./p-Bf3p-DY2.js";import{GidsButtonWebUtils as i,nonEmpty as s}from"@ganpatiinfo/gids-web-shared";import{G as e}from"./p-CHGTBObD.js";const{getGidsButtonClassNames:n}=i,o=({appearance:i,size:o,destructive:a,positive:d,loading:r,width:p,leadingIcon:c,trailingIcon:l,as:b,disabled:g,class:m,forceIconOnly:u=!1,...f},v)=>{const G=b||"button",h="lg"===o||void 0===o?"md":o;return"button"!==G||"type"in f||(f.type="button"),t(G,{class:n({appearance:i,size:o,destructive:a,loading:r,width:p,positive:d},u||0===v.length&&s(c)&&!s(l),m),disabled:"button"===G?g:void 0,...f},t("span",{class:"gids-button__content"},c,v),r&&t(e,{size:h,indeterminate:!0}),l)};export{o as G}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s}from"./p-Bf3p-DY2.js";import{GidsDismissButtonWebUtils as a}from"@ganpatiinfo/gids-web-shared";import{G as e}from"./p-D4Pimu_8.js";const{getGidsDismissButtonClassNames:i}=a,r=({appearance:a="subtle",size:r="md",disabled:o=!1,class:p,onPressDismiss:l,label:m,...t})=>s("button",{class:i({appearance:a,size:r},p),onClick:l,disabled:o,"aria-label":m,...t},s(e,{name:"cross",appearance:"regular"}));export{r as G}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as e,H as s,h as i}from"./p-
|
|
1
|
+
import{t,p as e,H as s,h as i}from"./p-Bf3p-DY2.js";import{GidsCalendarMonthListWebUtils as n}from"@ganpatiinfo/gids-web-shared";import{a as d,b as o,c as h}from"./p-D6lxqcxP.js";const{getGidsCalendarMonthListClassNames:a,getGidsCalendarMonthListMonths:r}=n,l=e(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.type="default",this.disabledIndices=[],this.divider=!1,this.hasItemListener=!1,this.suppressNextMenuClickSelection=!1,this.handleCalendarMenuItemSelect=t=>{const{title:e,value:s,selectedIndex:i,disabled:n,id:d}=t.detail;n||"string"!=typeof e||(this.suppressNextMenuClickSelection=!0,queueMicrotask((()=>{this.suppressNextMenuClickSelection=!1})),this.applySelection({id:d,month:e,monthInNumber:Number(s),disabled:!1,selectedIndex:i}))},this.handleMenuClick=t=>{if(this.suppressNextMenuClickSelection)return;const e=t?.detail;this.applySelection({id:e.id,monthInNumber:Number(e.value),month:e.title,disabled:!1,selectedIndex:e.selectedIndex})},this.monthsList=()=>r(),this.getSelectedItem=()=>{const t=this.selectedMonthNumber,e=this.monthsList(),s=e.findIndex((e=>e.value===t));let i;return null!=s&&-1!==s&&(i=e[s]),{foundItem:i,foundIndex:s}},this.isItemSelected=t=>{const{foundIndex:e}=this.getSelectedItem();return e===t}}connectedCallback(){this.attachItemListener()}disconnectedCallback(){this.detachItemListener()}getItemElements(){return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"))}attachItemListener(){this.hasItemListener||(this.hostElement.addEventListener("onPressDropdownItem",this.handleCalendarMenuItemSelect),this.hasItemListener=!0)}detachItemListener(){this.hasItemListener&&(this.hostElement.removeEventListener("onPressDropdownItem",this.handleCalendarMenuItemSelect),this.hasItemListener=!1)}applySelection(t){this.clearActive(),this.onSelectionMonthChange?.(t),this.hostElement.dispatchEvent(new CustomEvent("gidsCalendarMonthChange",{bubbles:!0,composed:!0,detail:t}))}clearActive(){this.getItemElements().forEach((t=>t.classList.remove("gids-dropdown-item--active")))}render(){const t=a();return i("div",{key:"a4c3d291302079299a702892a7feb47fecdc0ab3",class:t},i(d,{key:"57a34a46ff0d264d11faf29a1c852385d20f4303",type:this.type,supportingText:this.noOptionsText},i(o,{key:"f6bed17740192c11aabd7de928396147e8da7dfd",sectionLabel:"Months"},this.monthsList().map(((t,e)=>{const s=`${e+1}`,n=this.disabledIndices?.includes(e);return i(h,{title:t.title,value:`${t.value}`,key:`${e.toString()}`,index:e,id:s,selected:this.isItemSelected(e),onPressDropdownItem:this.handleMenuClick,disabled:n,divider:this.divider,isPlaceholderItem:!1})})))))}get hostElement(){return this}},[0,"gids-calendar-month-list",{type:[1],noOptionsText:[1,"no-options-text"],disabledIndices:[16],divider:[4],selectedMonthNumber:[2,"selected-month-number"],onSelectionMonthChange:[16]}]);function c(){"undefined"!=typeof customElements&&["gids-calendar-month-list"].forEach((e=>{"gids-calendar-month-list"===e&&(customElements.get(t(e))||customElements.define(t(e),l))}))}c();export{l as G,c as d}
|