@devgateway/dvz-ui-react 1.8.0 → 1.8.2
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/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/download/index.js +5 -5
- package/dist/cjs/embeddable/measures/index.js +1 -1
- package/dist/cjs/layout/SearchControl.js +1 -1
- package/dist/esm/embeddable/chart/Line.js +1 -1
- package/dist/esm/embeddable/download/index.js +93 -89
- package/dist/esm/embeddable/measures/index.js +28 -28
- package/dist/esm/layout/SearchControl.js +111 -108
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),j=require("react"),lt=require("react-intl"),ct=require("@nivo/line"),it=require("./Tooltip.js"),pe=require("d3-shape"),ot=require("@nivo/theming"),dt=require("../../layout/FlexWrapDetector.js"),V=require("../../utils/deviceType.js"),ht="#66676d",G="#f0f0f1",ye=["mobile","tablet","midTablet"].includes(V.default()),ge=V.default()==="mobile",be=["tablet","midTablet"].includes(V.default()),ut=(d,p)=>{const v=document.createElement("canvas").getContext("2d");return v.font=p,v.measureText(d).width},mt=({editing:d,previewMode:p,app:Y,legends:v,tooltip:k,tooltipEnabled:je,options:h,intl:D,groupMode:J,reverse:xt,marginLeft:ve,lineLabelPosition:Ee,marginTop:K,marginRight:Ne,marginBottom:Z,format:E,colors:pt,offsetY:Oe,height:Me,showLegends:P,legendPosition:u,tickRotation:y,offsetText:_,tickColor:w,legendLabel:Q,xLabelColor:N,colorGenerator:X,legendCheckBack:z,legendLabelBack:Te,legendLabelColor:C,highlightXAxisLine:ke,showTickLine:A,showRightAxis:De,valueScale:yt,enableArea:Ie,areaShadingCriteria:ee,areaLowerBound:te,areaUpperBound:ae,showPoints:$e,maxValue:Fe,fixedMinValue:B,fixedMaxValue:q,offsetBottom:Le,yAxisTickValues:Se,enableGridY:We,enableGridX:_e,overrideTickColor:H,offsetRight:we,selectedMeasures:ze,tooltipEnableMarkdown:Ae,minMaxClamp:Be,reverseLegend:qe,customAxisFormat:I,mobileCustomization:He,lineCurve:Re,customLabels:R,lineXAxisTickMode:se,lineXAxisTickCount:Ue,lineXAxisTickEvery:Ge})=>{var me,fe,xe;const c=JSON.parse(decodeURIComponent(He)),ne=ye&&((c==null?void 0:c.showCustomization)??!1),$=ne&&p!=="Desktop",F=!d&&ne,[re,Ve]=j.useState(50),[le,Ye]=j.useState(K),[gt,ce]=j.useState(0),[ie,Je]=j.useState(Z),[O,Ke]=j.useState([]),L=h.data.map(e=>({id:e.id,label:R&&R[e.id]?R[e.id]:e.label||e.id,color:X.getColor(e.id,e)})),oe=()=>(qe&&L.reverse(),n.jsx(n.Fragment,{children:P&&L.map((e,a)=>n.jsxs("div",{className:"legend item",onClick:()=>Qe(e.id),children:[n.jsx("input",{className:"ignore",type:"checkbox",checked:O.length===0||!O.includes(e.id),readOnly:!0,style:{backgroundColor:z===!0?e.color:"none",color:C}}),n.jsx("span",{className:z===!0?"checkmark-with-bg":"checkmark",style:{backgroundColor:z===!0?e.color:"transparent"}}),n.jsx("label",{style:{backgroundColor:Te===!0?e.color:"transparent",color:C},children:e.label})]},a))}));j.useEffect(()=>{(()=>{const l=5*Math.max(L.length-5,0);Ve(l)})()},[L]);const Ze={bottom:`-${re}px`},Pe={bottom:`-${re}px`,gap:"0px",top:"0px"},S=e=>O.length?e.filter(a=>O.indexOf(a.id)===-1):e,Qe=e=>{const a=O.slice();if(a.indexOf(e)>-1){const l=a.indexOf(e);a.splice(l,1)}else a.push(e);Ke(a)},Xe=e=>{const a=Object.assign({},e),l=ot.useTheme();($||F)&&he.includes(String(a.value))&&(a.value="");let t=[],s="";if($||F){const i=String(a.value).split(" ");let o=25;d&&p==="Mobile"||ge&&!d?o=(c==null?void 0:c.mobileMaxTickLength)??25:d&&p==="Tablet"||be&&!d?o=(c==null?void 0:c.tabletMaxTickLength)??25:window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches&&!d&&(o=15),i.forEach(g=>{s.length+String(g).length<=o?s+=(s?" ":"")+g:(t.push(s),s=g)}),s&&t.push(s)}else t=[a.value];let r=12;return d&&p==="Mobile"||ge&&!d?r=(c==null?void 0:c.mobileYAxisLineHeight)??12:(d&&p==="Tablet"||be&&!d)&&(r=(c==null?void 0:c.tabletYAxisLineHeight)??12),ut(a.value,"12px Roboto")+15,y>0&&y<180?n.jsxs("g",{transform:`translate(${e.x},${e.y+30})`,children:[A&&n.jsx("line",{stroke:H?w:G,strokeWidth:1.5,y1:-32,y2:-12}),n.jsx("g",{transform:`translate(0, ${e.y+_})`,children:t.map((i,o)=>n.jsx("text",{transform:`rotate(${y})`,textAnchor:"start",y:typeof e.value=="number"?0:o*r,dominantBaseline:"middle",style:{...l.axis.ticks.text,fill:N==="null"?"black":N,fontSize:"12px",fontFamily:"sans-serif"},children:i},i))})]}):y>180&&y<360?n.jsxs("g",{transform:`translate(${e.x},${e.y+30})`,children:[A&&n.jsx("line",{stroke:H?w:G,strokeWidth:1.5,y1:-32,y2:-12}),n.jsx("g",{transform:`translate(0, ${e.y+_})`,children:n.jsx("text",{transform:`rotate(${y})`,textAnchor:"end",dominantBaseline:"middle",style:{...l.axis.ticks.text,fill:N,fontSize:"12px"},children:a.value})})]}):n.jsxs("g",{transform:`translate(${e.x},${e.y+30})`,children:[A&&n.jsx("line",{stroke:H?w:G,strokeWidth:1.5,y1:-32,y2:-12}),n.jsx("g",{transform:`translate(0, ${e.y+_})`,children:t.map((i,o)=>n.jsx("text",{transform:`rotate(${y})`,textAnchor:"middle",y:typeof e.value=="number"?0:o*r,dominantBaseline:"middle",style:{...l.axis.ticks.text,fill:N==="null"?"black":N,fontSize:"12px",fontFamily:"sans-serif"},children:i},i))})]})},Ce=({series:e,xScale:a,yScale:l,innerHeight:t})=>{const s=e&&e.length>0?e[0].color:"#3daff7",r=[];e[0]&&e[0].data.forEach(x=>{Y=="csv"?h.keys.forEach(b=>{r.push({measure:b,min:x.data.variables[b]})}):ze.forEach(b=>{r.push({measure:b,min:x.data.variables[b]})})});const i=r.sort((x,b)=>x.min-b.min),o=ee=="CUSTOM_BETWEEN_TWO_LINES"&&te?te:i[0].measure,g=ee=="CUSTOM_BETWEEN_TWO_LINES"&&ae?ae:i[i.length-1].measure,rt=pe.area().x(x=>a(x.data.x)).y0(x=>l(x.data.variables[o])).y1(x=>l(x.data.variables[g]));return n.jsx(n.Fragment,{children:e&&e[0]&&n.jsx("path",{d:rt(e[0].data),fill:s,fillOpacity:.4})})},et=({series:e,xScale:a,yScale:l,innerHeight:t,innerWidth:s})=>{const r=[0,s],i=pe.line().x((o,g)=>g===0?-10:o).y(o=>l(0));return n.jsx(j.Fragment,{children:n.jsx("path",{d:i(r),fill:"none",stroke:ht,style:{pointerEvents:"none",strokeDasharray:"4 4"}})})},M=["grid","axes","lines","legends"];Ie&&M.push(Ce),$e&&(M.push("points"),M.push("mesh")),ke&&M.push(et);let T=[];S(h.data).forEach(e=>{e.data&&(T=[...T,...e.data.map(a=>a.y)])});const tt=()=>{if(J==="stacked"){const e=[];S(h.data).forEach(t=>{e.push(...t.data)});const l=[];e.forEach(t=>{l.indexOf(t.x)==-1&&l.push(t.x)}),f=Math.max(...l.map(t=>e.filter(s=>s.x==t).map(s=>s.y).reduce((s,r)=>Math.max(s+r,s+0)))),m=Math.min(...l.map(t=>e.filter(s=>s.x==t).map(s=>s.y).reduce((s,r)=>Math.min(s-r,r-s))))}else T.length>0&&(f=Math.max(...T),m=Math.min(...T));return f=f<0?f*.9:f*1.1,m=m>0?m*.9:m*1.1,{min:m,max:f}};let m="auto",f="auto";const W=tt();Fe=="fixed"?(m=B!=null&&B!=""?B:W.min,f=q!=null&&q!=""?q:W.max):(m=W.min,f=W.max);const de=()=>n.jsx(n.Fragment,{children:P&&Q&&n.jsx("div",{className:"legend item",children:n.jsx("label",{className:"legend-title",children:Q})})}),at={top:le,right:Ne,bottom:ie,left:ve};let U=parseInt(Se);const st=h.data&&((fe=(me=h.data)==null?void 0:me.filter(e=>{var a;return((a=e==null?void 0:e.data)==null?void 0:a.length)>0}))==null?void 0:fe.length),he=[];if($||F){U=Number.parseInt(c.yAxisTickValues);const e=new Map(Object.entries(((xe=c==null?void 0:c.labels)==null?void 0:xe.xAxis)??{}));for(const[a,l]of e)l||he.push(a)}const ue=S(h.data),nt=["grid","axes","legends"];if(h!=null&&h.data&&st>0){let e=S(h.data);const a=[];e.forEach(t=>{t&&Array.isArray(t.data)&&t.data.forEach(s=>{const r=s&&s.x;r!==void 0&&a.indexOf(r)===-1&&a.push(r)})});let l;if(se==="count"){const t=Math.max(1,parseInt(Ue));if(a.length>0&&t>0)if(a.length<=t)l=a.slice();else{const s=(a.length-1)/(t-1),r=new Array(t);for(let i=0;i<t;i++)r[i]=Math.floor(i*s);r[t-1]=a.length-1,l=r.map(i=>a[i])}}else if(se==="every"){const t=Math.max(1,parseInt(Ge));if(a.length>0){const s=[];for(let r=0;r<a.length;r++)r%t===0&&s.push(a[r]);s[s.length-1]!==a[a.length-1]&&s.push(a[a.length-1]),l=s}}return n.jsxs("div",{style:{height:Me},children:[n.jsx(ct.ResponsiveLine,{curve:Re,data:ue,margin:at,xScale:{type:"point"},yScale:{type:"linear",min:m,max:f,stacked:J=="stacked",reverse:!1,clamp:Be},layers:ue.length===0?nt:M,axisTop:null,axisRight:De?{tickSize:5,tickValues:U,tickPadding:5,tickRotation:0,legend:v.right,legendPosition:"middle",legendOffset:parseInt(we),format:t=>{const s=I||E;return D.formatNumber(s.style==="percent"?t/100:t,{...s})}}:null,enableGridY:We,enableGridX:_e,enablePointLabel:Ee==="top",pointLabel:t=>D.formatNumber(E.style==="percent"?t.yFormatted/100:t.yFormatted,E),lineWidth:3,colors:t=>X.getColor(t.id,t),axisBottom:($||F)&&(c==null?void 0:c.xAxisDisabled)===!0?null:{...l?{tickValues:l}:{},renderTick:Xe,legend:v.bottom,legendPosition:"middle",legendOffset:Number.parseInt(Le)},axisLeft:{tickSize:5,tickValues:U,tickPadding:5,tickRotation:0,legend:v.left,legendPosition:"middle",legendOffset:Number.parseInt(Oe),format:t=>{const s=I||E;return D.formatNumber(s.style==="percent"?t/100:t,{...s})}},tooltip:t=>je&&k&&k.trim().length>0?n.jsx(it.default,{intl:D,format:E,d:t,tooltip:k,tooltipEnableMarkdown:Ae}):null,pointSize:10,pointBorderWidth:2,pointBorderColor:{from:"serieColor"},useMesh:e.length>0&&e[0].data.length>0},new Date),(u==="top"||u==="bottom")&&n.jsx("div",{className:`legends container has-standard-12-font-size ${u}`,style:u==="top"?{marginTop:ye&&`${le}px`}:u==="bottom"?{marginBottom:`${ie}px`}:{},children:n.jsxs("div",{className:"legend-sections",children:[n.jsx("div",{className:"title-section",children:de()}),n.jsx(dt.default,{onWrapChange:t=>{if(u==="top"){const s=K+t/2*40;Ye(s),ce(t)}else Je(Z+t/2*25),ce(t)},className:"legends container has-standard-12-font-size items-section",children:oe()})]})}),(u==="right"||u==="left")&&n.jsxs("div",{className:`legends container has-standard-12-font-size ${u}`,style:u==="right"?Ze:Pe,children:[de(),oe()]})]})}return n.jsx("div",{})},ft=lt.injectIntl(mt);exports.default=ft;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),j=require("react"),lt=require("react-intl"),ct=require("@nivo/line"),it=require("./Tooltip.js"),pe=require("d3-shape"),ot=require("@nivo/theming"),dt=require("../../layout/FlexWrapDetector.js"),V=require("../../utils/deviceType.js"),ht="#66676d",G="#f0f0f1",ye=["mobile","tablet","midTablet"].includes(V.default()),ge=V.default()==="mobile",be=["tablet","midTablet"].includes(V.default()),ut=(d,p)=>{const v=document.createElement("canvas").getContext("2d");return v.font=p,v.measureText(d).width},mt=({editing:d,previewMode:p,app:Y,legends:v,tooltip:k,tooltipEnabled:je,options:h,intl:D,groupMode:J,reverse:xt,marginLeft:ve,lineLabelPosition:Ee,marginTop:K,marginRight:Ne,marginBottom:Z,format:E,colors:pt,offsetY:Oe,height:Me,showLegends:P,legendPosition:u,tickRotation:y,offsetText:_,tickColor:w,legendLabel:Q,xLabelColor:N,colorGenerator:X,legendCheckBack:z,legendLabelBack:Te,legendLabelColor:C,highlightXAxisLine:ke,showTickLine:A,showRightAxis:De,valueScale:yt,enableArea:Ie,areaShadingCriteria:ee,areaLowerBound:te,areaUpperBound:ae,showPoints:$e,maxValue:Fe,fixedMinValue:B,fixedMaxValue:q,offsetBottom:Le,yAxisTickValues:Se,enableGridY:We,enableGridX:_e,overrideTickColor:H,offsetRight:we,selectedMeasures:ze,tooltipEnableMarkdown:Ae,minMaxClamp:Be,reverseLegend:qe,customAxisFormat:I,mobileCustomization:He,lineCurve:Re,customLabels:R,lineXAxisTickMode:se,lineXAxisTickCount:Ue,lineXAxisTickEvery:Ge})=>{var me,fe,xe;const c=JSON.parse(decodeURIComponent(He)),ne=ye&&((c==null?void 0:c.showCustomization)??!1),$=ne&&p!=="Desktop",F=!d&&ne,[re,Ve]=j.useState(50),[le,Ye]=j.useState(K),[gt,ce]=j.useState(0),[ie,Je]=j.useState(Z),[O,Ke]=j.useState([]),L=h.data.map(e=>({id:e.id,label:R&&R[e.id]?R[e.id]:e.label||e.id,color:X.getColor(e.id,e)})),oe=()=>(qe&&L.reverse(),n.jsx(n.Fragment,{children:P&&L.map((e,a)=>n.jsxs("div",{className:"legend item",onClick:()=>Qe(e.id),children:[n.jsx("input",{className:"ignore",type:"checkbox",checked:O.length===0||!O.includes(e.id),readOnly:!0,style:{backgroundColor:z===!0?e.color:"none",color:C}}),n.jsx("span",{className:z===!0?"checkmark-with-bg":"checkmark",style:{backgroundColor:z===!0?e.color:"transparent"}}),n.jsx("label",{style:{backgroundColor:Te===!0?e.color:"transparent",color:C},children:e.label})]},a))}));j.useEffect(()=>{(()=>{const l=5*Math.max(L.length-5,0);Ve(l)})()},[L]);const Ze={bottom:`-${re}px`},Pe={bottom:`-${re}px`,gap:"0px",top:"0px"},S=e=>O.length?e.filter(a=>O.indexOf(a.id)===-1):e,Qe=e=>{const a=O.slice();if(a.indexOf(e)>-1){const l=a.indexOf(e);a.splice(l,1)}else a.push(e);Ke(a)},Xe=e=>{const a=Object.assign({},e),l=ot.useTheme();($||F)&&he.includes(String(a.value))&&(a.value="");let t=[],s="";if($||F){const i=String(a.value).split(" ");let o=25;d&&p==="Mobile"||ge&&!d?o=(c==null?void 0:c.mobileMaxTickLength)??25:d&&p==="Tablet"||be&&!d?o=(c==null?void 0:c.tabletMaxTickLength)??25:window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches&&!d&&(o=15),i.forEach(g=>{s.length+String(g).length<=o?s+=(s?" ":"")+g:(t.push(s),s=g)}),s&&t.push(s)}else t=[a.value];let r=12;return d&&p==="Mobile"||ge&&!d?r=(c==null?void 0:c.mobileYAxisLineHeight)??12:(d&&p==="Tablet"||be&&!d)&&(r=(c==null?void 0:c.tabletYAxisLineHeight)??12),ut(a.value,"12px Roboto")+15,y>0&&y<180?n.jsxs("g",{transform:`translate(${e.x},${e.y+30})`,children:[A&&n.jsx("line",{stroke:H?w:G,strokeWidth:1.5,y1:-32,y2:-12}),n.jsx("g",{transform:`translate(0, ${e.y+_})`,children:t.map((i,o)=>n.jsx("text",{transform:`rotate(${y})`,textAnchor:"start",y:typeof e.value=="number"?0:o*r,dominantBaseline:"middle",style:{...l.axis.ticks.text,fill:N==="null"?"black":N,fontSize:"12px",fontFamily:"sans-serif"},children:i},i))})]}):y>180&&y<360?n.jsxs("g",{transform:`translate(${e.x},${e.y+30})`,children:[A&&n.jsx("line",{stroke:H?w:G,strokeWidth:1.5,y1:-32,y2:-12}),n.jsx("g",{transform:`translate(0, ${e.y+_})`,children:n.jsx("text",{transform:`rotate(${y})`,textAnchor:"end",dominantBaseline:"middle",style:{...l.axis.ticks.text,fill:N,fontSize:"12px"},children:a.value})})]}):n.jsxs("g",{transform:`translate(${e.x},${e.y+30})`,children:[A&&n.jsx("line",{stroke:H?w:G,strokeWidth:1.5,y1:-32,y2:-12}),n.jsx("g",{transform:`translate(0, ${e.y+_})`,children:t.map((i,o)=>n.jsx("text",{transform:`rotate(${y})`,textAnchor:"middle",y:typeof e.value=="number"?0:o*r,dominantBaseline:"middle",style:{...l.axis.ticks.text,fill:N==="null"?"black":N,fontSize:"12px",fontFamily:"sans-serif"},children:i},i))})]})},Ce=({series:e,xScale:a,yScale:l,innerHeight:t})=>{const s=e&&e.length>0?e[0].color:"#3daff7",r=[];e[0]&&e[0].data.forEach(x=>{Y=="csv"?h.keys.forEach(b=>{r.push({measure:b,min:x.data.variables[b]})}):ze.forEach(b=>{r.push({measure:b,min:x.data.variables[b]})})});const i=r.sort((x,b)=>x.min-b.min),o=ee=="CUSTOM_BETWEEN_TWO_LINES"&&te?te:i[0].measure,g=ee=="CUSTOM_BETWEEN_TWO_LINES"&&ae?ae:i[i.length-1].measure,rt=pe.area().x(x=>a(x.data.x)).y0(x=>l(x.data.variables[o])).y1(x=>l(x.data.variables[g]));return n.jsx(n.Fragment,{children:e&&e[0]&&n.jsx("path",{d:rt(e[0].data),fill:s,fillOpacity:.4})})},et=({series:e,xScale:a,yScale:l,innerHeight:t,innerWidth:s})=>{const r=[0,s],i=pe.line().x((o,g)=>g===0?-10:o).y(o=>l(0));return n.jsx(j.Fragment,{children:n.jsx("path",{d:i(r),fill:"none",stroke:ht,style:{pointerEvents:"none",strokeDasharray:"4 4"}})})},M=["grid","axes","lines","legends"];Ie&&M.push(Ce),$e&&(M.push("points"),M.push("mesh")),ke&&M.push(et);let T=[];S(h.data).forEach(e=>{e.data&&(T=[...T,...e.data.map(a=>a.y)])});const tt=()=>{if(J==="stacked"){const e=[];S(h.data).forEach(t=>{e.push(...t.data)});const l=[];e.forEach(t=>{l.indexOf(t.x)==-1&&l.push(t.x)}),f=Math.max(...l.map(t=>e.filter(s=>s.x==t).map(s=>s.y).reduce((s,r)=>Math.max(s+r,s+0)))),m=Math.min(...l.map(t=>e.filter(s=>s.x==t).map(s=>s.y).reduce((s,r)=>Math.min(s-r,r-s))))}else T.length>0&&(f=Math.max(...T),m=Math.min(...T));return f=f<0?f*.9:f*1.1,m=m>0?m*.9:m*1.1,{min:m,max:f}};let m="auto",f="auto";const W=tt();Fe=="fixed"?(m=B!=null&&B!=""?B:W.min,f=q!=null&&q!=""?q:W.max):(m=W.min,f=W.max);const de=()=>n.jsx(n.Fragment,{children:P&&Q&&n.jsx("div",{className:"legend item",children:n.jsx("label",{className:"legend-title",children:Q})})}),at={top:le,right:Ne,bottom:ie,left:ve};let U=parseInt(Se);const st=h.data&&((fe=(me=h.data)==null?void 0:me.filter(e=>{var a;return((a=e==null?void 0:e.data)==null?void 0:a.length)>0}))==null?void 0:fe.length),he=[];if($||F){U=Number.parseInt(c.yAxisTickValues);const e=new Map(Object.entries(((xe=c==null?void 0:c.labels)==null?void 0:xe.xAxis)??{}));for(const[a,l]of e)l||he.push(a)}const ue=S(h.data),nt=["grid","axes","legends"];if(h!=null&&h.data&&st>0){let e=S(h.data);const a=[];e.forEach(t=>{t&&Array.isArray(t.data)&&t.data.forEach(s=>{const r=s&&s.x;r!==void 0&&a.indexOf(r)===-1&&a.push(r)})});let l;if(se==="count"){const t=Math.max(1,parseInt(Ue));if(a.length>0&&t>0)if(a.length<=t)l=a.slice();else{const s=(a.length-1)/(t-1),r=new Array(t);for(let i=0;i<t;i++)r[i]=Math.floor(i*s);r[t-1]=a.length-1,l=r.map(i=>a[i])}}else if(se==="every"){const t=Math.max(1,parseInt(Ge));if(a.length>0){const s=[];for(let r=0;r<a.length;r++)r%t===0&&s.push(a[r]);s[s.length-1]!==a[a.length-1]&&s.push(a[a.length-1]),l=s}}return n.jsxs("div",{style:{height:Me},children:[n.jsx(ct.ResponsiveLine,{curve:Re,data:ue,margin:at,xScale:{type:"point"},yScale:{type:"linear",min:m,max:f,stacked:J=="stacked",reverse:!1,clamp:Be},layers:ue.length===0?nt:M,axisTop:null,axisRight:De?{tickSize:5,tickValues:U,tickPadding:5,tickRotation:0,legend:v.right,legendPosition:"middle",legendOffset:parseInt(we),format:t=>{const s=I||E;return D.formatNumber(s.style==="percent"?t/100:t,{...s})}}:null,enableGridY:We,enableGridX:_e,enablePointLabel:Ee==="top",pointLabel:t=>D.formatNumber(E.style==="percent"?t.data.yFormatted/100:t.data.yFormatted,E),lineWidth:3,colors:t=>X.getColor(t.id,t),axisBottom:($||F)&&(c==null?void 0:c.xAxisDisabled)===!0?null:{...l?{tickValues:l}:{},renderTick:Xe,legend:v.bottom,legendPosition:"middle",legendOffset:Number.parseInt(Le)},axisLeft:{tickSize:5,tickValues:U,tickPadding:5,tickRotation:0,legend:v.left,legendPosition:"middle",legendOffset:Number.parseInt(Oe),format:t=>{const s=I||E;return D.formatNumber(s.style==="percent"?t/100:t,{...s})}},tooltip:t=>je&&k&&k.trim().length>0?n.jsx(it.default,{intl:D,format:E,d:t,tooltip:k,tooltipEnableMarkdown:Ae}):null,pointSize:10,pointBorderWidth:2,pointBorderColor:{from:"serieColor"},useMesh:e.length>0&&e[0].data.length>0},new Date),(u==="top"||u==="bottom")&&n.jsx("div",{className:`legends container has-standard-12-font-size ${u}`,style:u==="top"?{marginTop:ye&&`${le}px`}:u==="bottom"?{marginBottom:`${ie}px`}:{},children:n.jsxs("div",{className:"legend-sections",children:[n.jsx("div",{className:"title-section",children:de()}),n.jsx(dt.default,{onWrapChange:t=>{if(u==="top"){const s=K+t/2*40;Ye(s),ce(t)}else Je(Z+t/2*25),ce(t)},className:"legends container has-standard-12-font-size items-section",children:oe()})]})}),(u==="right"||u==="left")&&n.jsxs("div",{className:`legends container has-standard-12-font-size ${u}`,style:u==="right"?Ze:Pe,children:[de(),oe()]})]})}return n.jsx("div",{})},ft=lt.injectIntl(mt);exports.default=ft;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("react"),o=require("semantic-ui-react"),k=require("@devgateway/wp-react-lib"),j=require("./dom-to-image.js"),R=require("file-saver"),H=require("react-redux"),Q=g.forwardRef((s,a)=>t.jsx("div",{ref:a,children:s.children})),V=s=>{const a=g.useRef();let{childContent:w,"data-height":Y,"data-button-label":v,"data-png-label":L,"data-jpg-label":q,"data-jpg-text":S,"data-png-text":U,"data-check-png":G="true","data-check-jpg":C="true","data-title":T,"data-default-format":P="PNG","data-use-title":b="false","data-style":E="heavy","data-section-title":I="","data-download-tooltip":J="","data-include-source-url":D="false","data-include-filters":y="false","data-source-urlmargin-left":F=70,"data-source-urlmargin-top":B=10,"data-source-urlfont-size":O=18,parent:Z,editing:i,component:ee,unique:te,pageModuleProps:l}=s;const[x,h]=g.useState(P),[$,c]=g.useState(!1),d=G=="true"||G===!0,u=C=="true"||C===!0;g.useEffect(()=>{h(P)},[P]);function M(n){const r=n.attributes,N=[];if(r)for(let e=0;e<r.length;e++)N.push(r[e].nodeName);const f=N.filter(e=>e.startsWith("data-"));if(f.length>0&&f.forEach(e=>{n.setAttribute(e,"")}),n.classList){if(n.classList.contains("ignore"))return!1;if(!(y===!0||y==="true")){const m=["filter-component","data-filters-reset","data-filters-apply","filter-search"];for(const z of m)if(n.classList.contains(z))return!1}return!0}return!0}const A={filter:M,bgcolor:"#FFF",imagePlaceholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8Xw8AAoMBgQb9Z3kAAAAASUVORK5CYII=",cacheBust:!0},W=n=>{j.domtoimage.cloneNode(a.current).then(function(r){if([...r.getElementsByTagName("input")].forEach(e=>e.remove()),[...r.querySelectorAll(".question.circle.icon")].forEach(e=>e.remove()),D==="true"){const e=document.createElement("div");e.style.marginLeft=F+"px",e.style.marginTop=B+"px",e.style.fontSize=O+"px",e.style.fontFamily="Roboto, sans-serif",e.style.fontWeight="400",e.style.color="#66676d",e.style.opacity="0.75",e.innerHTML=window.location.href,e.style.maxWidth="90%",e.style.wordWrap="break-word",e.style.overflowWrap="break-word",r.appendChild(e)}const f=50;A.height=a.current.scrollHeight+f,A.width=a.current.scrollWidth+f*2,r.style.padding=`${f}px`,n==="PNG"&&j.domtoimage.toPng(r,A).then(function(e){if(!e)throw new Error("PNG render returned empty result");return fetch(e).then(m=>m.blob())}).then(function(e){R.saveAs(e,L)}).catch(function(e){console.error("PNG download failed:",e)}),n==="JPG"&&j.domtoimage.toJpeg(r,A).then(function(e){if(!e)throw new Error("JPEG render returned empty result");return fetch(e).then(m=>m.blob())}).then(function(e){R.saveAs(e,q)}).catch(function(e){console.error("JPG download failed:",e)})})},p=n=>{i?alert("Not allowed when editing please preview page"):W(n)};return t.jsx(o.Container,{className:`viz download ${E} ${b?"has-title":""}
|
|
2
|
+
${d||u?"has-formats":""}
|
|
3
|
+
${i||l!=null&&l.editing?"editing":""}
|
|
4
|
+
${d&&u?"multi-format":""}
|
|
5
|
+
${d&&!u||!d&&u?"single-format":""}`,fluid:!0,children:t.jsxs(Q,{ref:a,children:[t.jsxs(o.Grid,{stackable:!0,reversed:"mobile",className:"download-header",children:[!i&&b==="true"&&t.jsx(o.Grid.Column,{width:12,children:t.jsx(k.PostContent,{parentUnique:s.unique,post:{content:{rendered:decodeURIComponent(I)}}})}),t.jsx(o.Grid.Column,{className:i?"editing ignore":"ignore",width:i||b!=="true"?16:4,textAlign:"right",children:t.jsxs("div",{className:"wrapper",children:[t.jsxs(o.Button,{className:"download",onClick:()=>p(x),children:[v," ",x==="PNG"?"PNG":"JPG"]}),t.jsx(o.Dropdown,{className:"download","data-tooltip":decodeURIComponent(J),open:$,onOpen:()=>c(!0),onClose:()=>c(!1),trigger:u&&d?t.jsx(o.Icon,{name:"download",className:"download-icon"}):null,children:t.jsxs(o.Dropdown.Menu,{children:[T,d===!0&&t.jsx(o.Dropdown.Item,{onClick:()=>{h("PNG"),p("PNG"),c(!1)},children:t.jsxs("div",{className:"ui radio checkbox",children:[t.jsx("input",{type:"radio",className:"hidden",readOnly:!0,tabIndex:0,checked:x==="PNG"}),t.jsx("label",{onClick:n=>{n.stopPropagation(),h("PNG"),p("PNG"),c(!1)},children:U})]})}),u===!0&&t.jsx(o.Dropdown.Item,{onClick:()=>{h("JPG"),p("JPG"),c(!1)},children:t.jsxs("div",{className:"ui radio checkbox",children:[t.jsx("input",{type:"radio",className:"hidden",readOnly:!0,tabIndex:0,checked:x==="JPG"}),t.jsx("label",{onClick:n=>{n.stopPropagation(),h("JPG"),p("JPG"),c(!1)},children:S})]})})]})})]})})]}),!i&&t.jsx(o.Container,{fluid:!0,className:`download area ${i||l!=null&&l.editing?"editing":""}`,children:t.jsx(k.PostContent,{parentUnique:s.unique,post:{content:{rendered:w}}})})]})})},_=s=>{const a=s.getIn(["data","pageModuleProps"]),w={};return a&&(w.pageModuleProps=a),w},K={},X=H.connect(_,K)(V);exports.default=X;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),m=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),m=require("react"),c=require("semantic-ui-react"),p=require("../reducers/data.js"),f=require("../../redux/hooks.js"),g=h=>{const{parent:x,editing:j=!1,unique:C,"data-label":n,"data-group":u,"data-app":a,"data-measures-groups":o}=h;let s;const i=f.useAppDispatch(),d=f.useAppSelector(e=>e.getIn(["data","measures",a,u])),l={onReset:p.cleanMeasures,onChange:p.setMeasures};if(o instanceof String||typeof o=="string"){const e=o;let t;try{t=decodeURIComponent(e)}catch{t=e}s=JSON.parse(t)}else s=o;if(m.useEffect(()=>{s&&s[a]&&s[a].forEach(e=>{e.defaultSelected&&i(l.onChange({app:a,group:u,mGroup:e}))})},[]),s&&s[a]){const e=s[a];return r.jsxs(c.Container,{className:"measures group",fluid:!0,children:[n&&r.jsx("span",{children:n}),e.map(t=>r.jsxs("div",{className:"inputs lists",onClick:q=>i(l.onChange({app:a,group:u,mGroup:t})),children:[r.jsx(c.Radio,{readOnly:!0,checked:!!(d&&d.idx==t.idx),type:"radio"}),r.jsx("span",{children:t.label})]},t.idx))]})}else return r.jsx(c.Container,{className:"measures group",fluid:!0,children:n&&r.jsx("span",{children:n})})};exports.default=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),h=require("react"),m=require("@devgateway/wp-react-lib"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),h=require("react"),m=require("@devgateway/wp-react-lib"),N=require("./CustomSemanticSearch.js"),E=require("react-dom"),_=require("semantic-ui-react"),w=require("react-intl"),R=(t,r)=>{if(!t||!r)return t||"";const s=new RegExp(`(${r})`,"gi");return t.replace(s,"<strong>$1</strong>")},T=(t,r)=>{const s=String(r||"en").replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`^/${s}/?$`).test(String(t||"").trim())},b=t=>Array.isArray(t)?String(t[0]||"").trim():String(t||"").trim(),I=w.injectIntl(({ID:t,title:r,slug:s,parent_title:i,parent_slug:n,parent_link:c,extract:a,type:l,link:d,terms:j,subtype:p,bread_crumbs:u=[],metadata:o,intl:{locale:g},searchTerm:S})=>{const f=o==null?void 0:o.redirect_url,x=m.utils.replaceLink(c,g),M=m.utils.replaceLink(d,g),y=b(f);let v=M;c&&!T(x,g)&&(v=x+`#${s}`),y&&(v=y+`#${s}`);const C=R(String(r),S),L=R(a,S);return e.jsx("div",{className:"search-results-wrapper searching-results",style:{display:"flex",flexDirection:"column"},children:e.jsxs("div",{className:"has-standard-12-font-size",onClick:F=>document.location.href=v,children:[e.jsx("h5",{className:"breadcrumbs-search",dangerouslySetInnerHTML:{__html:u&&u.length>0?R(u.join(" / "),S):""}}),e.jsx("div",{className:"has-standard-14-font-size",children:e.jsx("h4",{className:"search-title",dangerouslySetInnerHTML:{__html:C}})}),e.jsx("div",{className:"search-content",dangerouslySetInnerHTML:{__html:m.utils.replaceHTMLinks(L,g)}})]})})}),P=({results:t,meta:r,perPage:s,intl:i,searchTerm:n})=>{const c=r?r["x-wp-total"]:0;return r&&r["x-wp-totalpages"],e.jsxs("div",{id:"float-results-container",children:[e.jsx("span",{className:"float-results-header",children:i.formatMessage({id:"search.results.summary",defaultMessage:"{count} of {total} Results"},{count:c<s?c:s,total:c})}),t.map(a=>e.jsx(I,{...a,searchTerm:n},a.ID))]})},$=({onSearch:t,perPage:r,loading:s,results:i,meta:n,intl:c,searchTerm:a})=>(n&&n["x-wp-total"],n&&n["x-wp-totalpages"],e.jsx("input",{placeholder:c.formatMessage({id:"search.placeholder",defaultMessage:"Search..."}),type:"text",className:"input search",name:"search",value:a,onChange:l=>{t(l.target.value)}})),q=({onSearch:t,onSetSelected:r,perPage:s,loading:i,results:n,meta:c,locale:a,intl:l,searchTerm:d,selected:j})=>{const[p,u]=h.useState(!1),o=h.useRef(null),g=()=>{u(!1)};h.useEffect(()=>{const f=document.createElement("div");f.setAttribute("id","float-input-container"),f.setAttribute("class","input container"),f.style.display="none";const x=document.getElementById("root");return x&&(x.appendChild(f),o.current=f),()=>{o.current&&o.current.parentNode&&o.current.parentNode.removeChild(o.current)}},[]),h.useEffect(()=>{o.current&&(o.current.style.display=p?"block":"none")},[p]);const S=()=>{u(!0)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{id:"ui-float-search",className:`ui float-search${p?" ui-float-search-active":""}`,onMouseOver:S,children:e.jsx(_.Icon,{name:"search",size:"small"})}),o.current&&E.createPortal(p?e.jsxs("div",{onMouseLeave:g,children:[e.jsx("div",{className:"float-search-container",children:e.jsx($,{onSearch:t,perPage:s,loading:i,results:n,meta:c,intl:l,searchTerm:d})}),n&&n.length>0&&e.jsx(w.IntlProvider,{locale:a,children:e.jsx(P,{results:n,meta:c,perPage:s,intl:l,searchTerm:d})})]}):null,o.current)]})},z=({onSearch:t,perPage:r,loading:s,results:i,meta:n,intl:c})=>{const a=n?n["x-wp-total"]:0,l=n?n["x-wp-totalpages"]:0,[d,j]=h.useState("");h.useEffect(()=>{const u=setTimeout(()=>{t(d)},300);return()=>clearTimeout(u)},[d]);const p=u=>e.jsx(I,{...u,searchTerm:d});return e.jsx(N.default,{value:d,loading:s,placeholder:c.formatMessage({id:"search.placeholder",defaultMessage:"Search..."}),onResultSelect:(u,o)=>null,total:a,perPage:r,totalPages:l,onSearchChange:(u,o)=>{j(o.value)},resultRenderer:p,results:i,showNoResults:!1,intl:c,searchTerm:d})},k=w.injectIntl(t=>{const{intl:r,onSetSelected:s}=t,[i,n]=h.useState(""),[c,a]=h.useState(!1);return h.useEffect(()=>{const l=()=>{a(window.innerWidth<=1365)};return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),e.jsx(m.SearchProvider,{search:i,perPage:5,locale:r.locale,children:e.jsx(D,{...t,onSetSelected:s,setQuery:n,query:i,isSmallScreen:c,intl:r})})}),D=({onSetSelected:t,selected:r,setQuery:s,query:i,isSmallScreen:n,intl:c,...a})=>{const l=h.useContext(m.SearchContext);return a.settings.react_search_type==="floating"||n?e.jsx(q,{onSetSelected:t,selected:r,onSearch:s,perPage:5,intl:c,...a,...l,searchTerm:i}):e.jsx(z,{onSetSelected:t,onSearch:s,perPage:5,intl:c,...a,...l})};exports.default=k;
|
|
@@ -366,7 +366,7 @@ const xt = "#66676d", J = "#f0f0f1", ge = ["mobile", "tablet", "midTablet"].incl
|
|
|
366
366
|
enableGridX: Ae,
|
|
367
367
|
enablePointLabel: Oe === "top",
|
|
368
368
|
pointLabel: (t) => I.formatNumber(
|
|
369
|
-
N.style === "percent" ? t.yFormatted / 100 : t.yFormatted,
|
|
369
|
+
N.style === "percent" ? t.data.yFormatted / 100 : t.data.yFormatted,
|
|
370
370
|
N
|
|
371
371
|
),
|
|
372
372
|
lineWidth: 3,
|
|
@@ -1,146 +1,150 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Container as
|
|
4
|
-
import { PostContent as
|
|
5
|
-
import { domtoimage as
|
|
6
|
-
import { saveAs as
|
|
7
|
-
import { connect as
|
|
8
|
-
const
|
|
9
|
-
const r =
|
|
2
|
+
import K, { useRef as X, useState as L, useEffect as Y } from "react";
|
|
3
|
+
import { Container as v, Grid as y, Button as Z, Dropdown as P, Icon as _ } from "semantic-ui-react";
|
|
4
|
+
import { PostContent as U } from "@devgateway/wp-react-lib";
|
|
5
|
+
import { domtoimage as C } from "./dom-to-image.js";
|
|
6
|
+
import { saveAs as E } from "file-saver";
|
|
7
|
+
import { connect as ee } from "react-redux";
|
|
8
|
+
const te = K.forwardRef((a, r) => /* @__PURE__ */ t("div", { ref: r, children: a.children })), ne = (a) => {
|
|
9
|
+
const r = X();
|
|
10
10
|
let {
|
|
11
|
-
childContent:
|
|
12
|
-
"data-height":
|
|
13
|
-
"data-button-label":
|
|
14
|
-
"data-png-label":
|
|
11
|
+
childContent: g,
|
|
12
|
+
"data-height": ae,
|
|
13
|
+
"data-button-label": J,
|
|
14
|
+
"data-png-label": I,
|
|
15
15
|
"data-jpg-label": T,
|
|
16
16
|
"data-jpg-text": F,
|
|
17
17
|
"data-png-text": S,
|
|
18
|
-
"data-check-png":
|
|
19
|
-
"data-check-jpg":
|
|
20
|
-
"data-title":
|
|
21
|
-
"data-default-format":
|
|
22
|
-
"data-use-title":
|
|
23
|
-
"data-style":
|
|
18
|
+
"data-check-png": k = "true",
|
|
19
|
+
"data-check-jpg": x = "true",
|
|
20
|
+
"data-title": B,
|
|
21
|
+
"data-default-format": N = "PNG",
|
|
22
|
+
"data-use-title": b = "false",
|
|
23
|
+
"data-style": D = "heavy",
|
|
24
24
|
"data-section-title": $ = "",
|
|
25
25
|
"data-download-tooltip": j = "",
|
|
26
26
|
"data-include-source-url": q = "false",
|
|
27
27
|
"data-include-filters": R = "false",
|
|
28
|
-
"data-source-urlmargin-left":
|
|
28
|
+
"data-source-urlmargin-left": O = 70,
|
|
29
29
|
"data-source-urlmargin-top": W = 10,
|
|
30
30
|
"data-source-urlfont-size": M = 18,
|
|
31
|
-
parent:
|
|
31
|
+
parent: ie,
|
|
32
32
|
editing: i,
|
|
33
|
-
component:
|
|
34
|
-
unique:
|
|
35
|
-
pageModuleProps:
|
|
33
|
+
component: le,
|
|
34
|
+
unique: se,
|
|
35
|
+
pageModuleProps: s
|
|
36
36
|
} = a;
|
|
37
|
-
const [p,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
function z(n) {
|
|
45
|
-
const o = n.attributes, N = [];
|
|
37
|
+
const [w, p] = L(N), [z, c] = L(!1), d = k == "true" || k === !0, u = x == "true" || x === !0;
|
|
38
|
+
Y(() => {
|
|
39
|
+
p(N);
|
|
40
|
+
}, [N]);
|
|
41
|
+
function H(n) {
|
|
42
|
+
const o = n.attributes, G = [];
|
|
46
43
|
if (o)
|
|
47
44
|
for (let e = 0; e < o.length; e++)
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
45
|
+
G.push(o[e].nodeName);
|
|
46
|
+
const f = G.filter((e) => e.startsWith("data-"));
|
|
47
|
+
if (f.length > 0 && f.forEach((e) => {
|
|
51
48
|
n.setAttribute(e, "");
|
|
52
49
|
}), n.classList) {
|
|
53
50
|
if (n.classList.contains("ignore")) return !1;
|
|
54
51
|
if (!(R === !0 || R === "true")) {
|
|
55
|
-
const
|
|
52
|
+
const m = [
|
|
56
53
|
"filter-component",
|
|
57
54
|
"data-filters-reset",
|
|
58
55
|
"data-filters-apply",
|
|
59
56
|
"filter-search"
|
|
60
57
|
];
|
|
61
|
-
for (const
|
|
62
|
-
if (n.classList.contains(
|
|
58
|
+
for (const V of m)
|
|
59
|
+
if (n.classList.contains(V)) return !1;
|
|
63
60
|
}
|
|
64
61
|
return !0;
|
|
65
62
|
}
|
|
66
63
|
return !0;
|
|
67
64
|
}
|
|
68
|
-
const
|
|
69
|
-
|
|
65
|
+
const A = { filter: H, bgcolor: "#FFF", imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8Xw8AAoMBgQb9Z3kAAAAASUVORK5CYII=", cacheBust: !0 }, Q = (n) => {
|
|
66
|
+
C.cloneNode(r.current).then(function(o) {
|
|
70
67
|
if ([...o.getElementsByTagName("input")].forEach((e) => e.remove()), [...o.querySelectorAll(".question.circle.icon")].forEach((e) => e.remove()), q === "true") {
|
|
71
68
|
const e = document.createElement("div");
|
|
72
|
-
e.style.marginLeft =
|
|
69
|
+
e.style.marginLeft = O + "px", e.style.marginTop = W + "px", e.style.fontSize = M + "px", e.style.fontFamily = "Roboto, sans-serif", e.style.fontWeight = "400", e.style.color = "#66676d", e.style.opacity = "0.75", e.innerHTML = window.location.href, e.style.maxWidth = "90%", e.style.wordWrap = "break-word", e.style.overflowWrap = "break-word", o.appendChild(e);
|
|
73
70
|
}
|
|
74
|
-
const
|
|
75
|
-
|
|
71
|
+
const f = 50;
|
|
72
|
+
A.height = r.current.scrollHeight + f, A.width = r.current.scrollWidth + f * 2, o.style.padding = `${f}px`, n === "PNG" && C.toPng(o, A).then(function(e) {
|
|
76
73
|
if (!e) throw new Error("PNG render returned empty result");
|
|
77
|
-
return fetch(e).then((
|
|
74
|
+
return fetch(e).then((m) => m.blob());
|
|
78
75
|
}).then(function(e) {
|
|
79
|
-
|
|
76
|
+
E(e, I);
|
|
80
77
|
}).catch(function(e) {
|
|
81
78
|
console.error("PNG download failed:", e);
|
|
82
|
-
}), n === "JPG" &&
|
|
79
|
+
}), n === "JPG" && C.toJpeg(o, A).then(function(e) {
|
|
83
80
|
if (!e) throw new Error("JPEG render returned empty result");
|
|
84
|
-
return fetch(e).then((
|
|
81
|
+
return fetch(e).then((m) => m.blob());
|
|
85
82
|
}).then(function(e) {
|
|
86
|
-
|
|
83
|
+
E(e, T);
|
|
87
84
|
}).catch(function(e) {
|
|
88
85
|
console.error("JPG download failed:", e);
|
|
89
86
|
});
|
|
90
87
|
});
|
|
91
|
-
},
|
|
92
|
-
i ? alert("Not allowed when editing please preview page") :
|
|
88
|
+
}, h = (n) => {
|
|
89
|
+
i ? alert("Not allowed when editing please preview page") : Q(n);
|
|
93
90
|
};
|
|
94
91
|
return /* @__PURE__ */ t(
|
|
95
|
-
|
|
92
|
+
v,
|
|
96
93
|
{
|
|
97
|
-
className: `viz download ${
|
|
98
|
-
${
|
|
99
|
-
${i ||
|
|
100
|
-
${
|
|
101
|
-
${
|
|
94
|
+
className: `viz download ${D} ${b ? "has-title" : ""}
|
|
95
|
+
${d || u ? "has-formats" : ""}
|
|
96
|
+
${i || s != null && s.editing ? "editing" : ""}
|
|
97
|
+
${d && u ? "multi-format" : ""}
|
|
98
|
+
${d && !u || !d && u ? "single-format" : ""}`,
|
|
102
99
|
fluid: !0,
|
|
103
|
-
children: /* @__PURE__ */ l(
|
|
104
|
-
/* @__PURE__ */ l(
|
|
105
|
-
!i &&
|
|
106
|
-
|
|
100
|
+
children: /* @__PURE__ */ l(te, { ref: r, children: [
|
|
101
|
+
/* @__PURE__ */ l(y, { stackable: !0, reversed: "mobile", className: "download-header", children: [
|
|
102
|
+
!i && b === "true" && /* @__PURE__ */ t(y.Column, { width: 12, children: /* @__PURE__ */ t(
|
|
103
|
+
U,
|
|
107
104
|
{
|
|
108
105
|
parentUnique: a.unique,
|
|
109
106
|
post: { content: { rendered: decodeURIComponent($) } }
|
|
110
107
|
}
|
|
111
108
|
) }),
|
|
112
109
|
/* @__PURE__ */ t(
|
|
113
|
-
|
|
110
|
+
y.Column,
|
|
114
111
|
{
|
|
115
112
|
className: i ? "editing ignore" : "ignore",
|
|
116
|
-
width: i ||
|
|
113
|
+
width: i || b !== "true" ? 16 : 4,
|
|
117
114
|
textAlign: "right",
|
|
118
115
|
children: /* @__PURE__ */ l("div", { className: "wrapper", children: [
|
|
119
|
-
/* @__PURE__ */ l(
|
|
120
|
-
|
|
116
|
+
/* @__PURE__ */ l(Z, { className: "download", onClick: () => h(w), children: [
|
|
117
|
+
J,
|
|
121
118
|
" ",
|
|
122
|
-
|
|
119
|
+
w === "PNG" ? "PNG" : "JPG"
|
|
123
120
|
] }),
|
|
124
121
|
/* @__PURE__ */ t(
|
|
125
|
-
|
|
122
|
+
P,
|
|
126
123
|
{
|
|
127
124
|
className: "download",
|
|
128
125
|
"data-tooltip": decodeURIComponent(j),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
126
|
+
open: z,
|
|
127
|
+
onOpen: () => c(!0),
|
|
128
|
+
onClose: () => c(!1),
|
|
129
|
+
trigger: u && d ? /* @__PURE__ */ t(_, { name: "download", className: "download-icon" }) : null,
|
|
130
|
+
children: /* @__PURE__ */ l(P.Menu, { children: [
|
|
131
|
+
B,
|
|
132
|
+
d === !0 && /* @__PURE__ */ t(P.Item, { onClick: () => {
|
|
133
|
+
p("PNG"), h("PNG"), c(!1);
|
|
134
|
+
}, children: /* @__PURE__ */ l("div", { className: "ui radio checkbox", children: [
|
|
135
|
+
/* @__PURE__ */ t("input", { type: "radio", className: "hidden", readOnly: !0, tabIndex: 0, checked: w === "PNG" }),
|
|
136
|
+
/* @__PURE__ */ t("label", { onClick: (n) => {
|
|
137
|
+
n.stopPropagation(), p("PNG"), h("PNG"), c(!1);
|
|
138
|
+
}, children: S })
|
|
139
|
+
] }) }),
|
|
140
|
+
u === !0 && /* @__PURE__ */ t(P.Item, { onClick: () => {
|
|
141
|
+
p("JPG"), h("JPG"), c(!1);
|
|
142
|
+
}, children: /* @__PURE__ */ l("div", { className: "ui radio checkbox", children: [
|
|
143
|
+
/* @__PURE__ */ t("input", { type: "radio", className: "hidden", readOnly: !0, tabIndex: 0, checked: w === "JPG" }),
|
|
144
|
+
/* @__PURE__ */ t("label", { onClick: (n) => {
|
|
145
|
+
n.stopPropagation(), p("JPG"), h("JPG"), c(!1);
|
|
146
|
+
}, children: F })
|
|
147
|
+
] }) })
|
|
144
148
|
] })
|
|
145
149
|
}
|
|
146
150
|
)
|
|
@@ -148,20 +152,20 @@ const ee = V.forwardRef((a, r) => /* @__PURE__ */ t("div", { ref: r, children: a
|
|
|
148
152
|
}
|
|
149
153
|
)
|
|
150
154
|
] }),
|
|
151
|
-
!i && /* @__PURE__ */ t(
|
|
152
|
-
|
|
155
|
+
!i && /* @__PURE__ */ t(v, { fluid: !0, className: `download area ${i || s != null && s.editing ? "editing" : ""}`, children: /* @__PURE__ */ t(
|
|
156
|
+
U,
|
|
153
157
|
{
|
|
154
158
|
parentUnique: a.unique,
|
|
155
|
-
post: { content: { rendered:
|
|
159
|
+
post: { content: { rendered: g } }
|
|
156
160
|
}
|
|
157
161
|
) })
|
|
158
162
|
] })
|
|
159
163
|
}
|
|
160
164
|
);
|
|
161
|
-
},
|
|
162
|
-
const r = a.getIn(["data", "pageModuleProps"]),
|
|
163
|
-
return r && (
|
|
164
|
-
},
|
|
165
|
+
}, oe = (a) => {
|
|
166
|
+
const r = a.getIn(["data", "pageModuleProps"]), g = {};
|
|
167
|
+
return r && (g.pageModuleProps = r), g;
|
|
168
|
+
}, re = {}, we = ee(oe, re)(ne);
|
|
165
169
|
export {
|
|
166
|
-
|
|
170
|
+
we as default
|
|
167
171
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as f } from "react";
|
|
3
|
-
import { Container as l } from "semantic-ui-react";
|
|
4
|
-
import { setMeasures as
|
|
5
|
-
import { useAppDispatch as
|
|
3
|
+
import { Container as l, Radio as h } from "semantic-ui-react";
|
|
4
|
+
import { setMeasures as g, cleanMeasures as x } from "../reducers/data.js";
|
|
5
|
+
import { useAppDispatch as C, useAppSelector as y } from "../../redux/hooks.js";
|
|
6
6
|
const E = (m) => {
|
|
7
7
|
const {
|
|
8
|
-
parent:
|
|
9
|
-
editing:
|
|
10
|
-
unique:
|
|
11
|
-
"data-label":
|
|
8
|
+
parent: N,
|
|
9
|
+
editing: S = !1,
|
|
10
|
+
unique: b,
|
|
11
|
+
"data-label": o,
|
|
12
12
|
"data-group": p,
|
|
13
|
-
"data-app":
|
|
14
|
-
"data-measures-groups":
|
|
13
|
+
"data-app": r,
|
|
14
|
+
"data-measures-groups": n
|
|
15
15
|
} = m;
|
|
16
16
|
let s;
|
|
17
|
-
const i =
|
|
18
|
-
onReset:
|
|
19
|
-
onChange:
|
|
17
|
+
const i = C(), c = y((e) => e.getIn(["data", "measures", r, p])), d = {
|
|
18
|
+
onReset: x,
|
|
19
|
+
onChange: g
|
|
20
20
|
};
|
|
21
|
-
if (
|
|
22
|
-
const e =
|
|
21
|
+
if (n instanceof String || typeof n == "string") {
|
|
22
|
+
const e = n;
|
|
23
23
|
let a;
|
|
24
24
|
try {
|
|
25
25
|
a = decodeURIComponent(e);
|
|
@@ -28,29 +28,29 @@ const E = (m) => {
|
|
|
28
28
|
}
|
|
29
29
|
s = JSON.parse(a);
|
|
30
30
|
} else
|
|
31
|
-
s =
|
|
31
|
+
s = n;
|
|
32
32
|
if (f(() => {
|
|
33
|
-
s && s[
|
|
34
|
-
e.defaultSelected && i(
|
|
33
|
+
s && s[r] && s[r].forEach((e) => {
|
|
34
|
+
e.defaultSelected && i(d.onChange({ app: r, group: p, mGroup: e }));
|
|
35
35
|
});
|
|
36
|
-
}, []), s && s[
|
|
37
|
-
const e = s[
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
e.map((a) => /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
36
|
+
}, []), s && s[r]) {
|
|
37
|
+
const e = s[r];
|
|
38
|
+
return /* @__PURE__ */ u(l, { className: "measures group", fluid: !0, children: [
|
|
39
|
+
o && /* @__PURE__ */ t("span", { children: o }),
|
|
40
|
+
e.map((a) => /* @__PURE__ */ u("div", { className: "inputs lists", onClick: (G) => i(d.onChange({ app: r, group: p, mGroup: a })), children: [
|
|
41
|
+
/* @__PURE__ */ t(
|
|
42
|
+
h,
|
|
43
43
|
{
|
|
44
44
|
readOnly: !0,
|
|
45
|
-
checked: !!(
|
|
45
|
+
checked: !!(c && c.idx == a.idx),
|
|
46
46
|
type: "radio"
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ t("span", { children: a.label })
|
|
50
50
|
] }, a.idx))
|
|
51
51
|
] });
|
|
52
52
|
} else
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ t(l, { className: "measures group", fluid: !0, children: o && /* @__PURE__ */ t("span", { children: o }) });
|
|
54
54
|
};
|
|
55
55
|
export {
|
|
56
56
|
E as default
|
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as v, useEffect as w, useContext as
|
|
3
|
-
import { utils as x, SearchProvider as
|
|
4
|
-
import
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { injectIntl as
|
|
8
|
-
const C = (
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
return
|
|
12
|
-
},
|
|
1
|
+
import { jsx as o, jsxs as S, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useEffect as w, useContext as $, useRef as P } from "react";
|
|
3
|
+
import { utils as x, SearchProvider as b, SearchContext as z } from "@devgateway/wp-react-lib";
|
|
4
|
+
import k from "./CustomSemanticSearch.js";
|
|
5
|
+
import { createPortal as F } from "react-dom";
|
|
6
|
+
import { Icon as j } from "semantic-ui-react";
|
|
7
|
+
import { injectIntl as N, IntlProvider as A } from "react-intl";
|
|
8
|
+
const C = (e, r) => {
|
|
9
|
+
if (!e || !r) return e || "";
|
|
10
|
+
const n = new RegExp(`(${r})`, "gi");
|
|
11
|
+
return e.replace(n, "<strong>$1</strong>");
|
|
12
|
+
}, D = (e, r) => {
|
|
13
|
+
const n = String(r || "en").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
14
|
+
return new RegExp(`^/${n}/?$`).test(String(e || "").trim());
|
|
15
|
+
}, H = (e) => Array.isArray(e) ? String(e[0] || "").trim() : String(e || "").trim(), L = N(
|
|
13
16
|
({
|
|
14
|
-
ID:
|
|
15
|
-
title:
|
|
16
|
-
slug:
|
|
17
|
+
ID: e,
|
|
18
|
+
title: r,
|
|
19
|
+
slug: n,
|
|
17
20
|
parent_title: i,
|
|
18
|
-
parent_slug:
|
|
19
|
-
parent_link:
|
|
21
|
+
parent_slug: t,
|
|
22
|
+
parent_link: s,
|
|
20
23
|
extract: a,
|
|
21
24
|
type: l,
|
|
22
25
|
link: d,
|
|
23
26
|
terms: y,
|
|
24
|
-
subtype:
|
|
27
|
+
subtype: h,
|
|
25
28
|
bread_crumbs: u = [],
|
|
26
29
|
metadata: c,
|
|
27
|
-
intl: { locale:
|
|
30
|
+
intl: { locale: f },
|
|
28
31
|
searchTerm: g
|
|
29
32
|
// Added searchTerm prop
|
|
30
33
|
}) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */
|
|
34
|
+
const p = c == null ? void 0 : c.redirect_url, m = x.replaceLink(s, f), M = x.replaceLink(d, f), I = H(p);
|
|
35
|
+
let R = M;
|
|
36
|
+
s && !D(m, f) && (R = m + `#${n}`), I && (R = I + `#${n}`);
|
|
37
|
+
const E = C(String(r), g), T = C(a, g);
|
|
38
|
+
return /* @__PURE__ */ o(
|
|
36
39
|
"div",
|
|
37
40
|
{
|
|
38
41
|
className: "search-results-wrapper searching-results",
|
|
@@ -41,9 +44,9 @@ const C = (n, s) => {
|
|
|
41
44
|
"div",
|
|
42
45
|
{
|
|
43
46
|
className: "has-standard-12-font-size",
|
|
44
|
-
onClick: (
|
|
47
|
+
onClick: (J) => document.location.href = R,
|
|
45
48
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ o(
|
|
47
50
|
"h5",
|
|
48
51
|
{
|
|
49
52
|
className: "breadcrumbs-search",
|
|
@@ -52,21 +55,21 @@ const C = (n, s) => {
|
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
),
|
|
55
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ o("div", { className: "has-standard-14-font-size", children: /* @__PURE__ */ o(
|
|
56
59
|
"h4",
|
|
57
60
|
{
|
|
58
61
|
className: "search-title",
|
|
59
62
|
dangerouslySetInnerHTML: {
|
|
60
|
-
__html:
|
|
63
|
+
__html: E
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
) }),
|
|
64
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ o(
|
|
65
68
|
"div",
|
|
66
69
|
{
|
|
67
70
|
className: "search-content",
|
|
68
71
|
dangerouslySetInnerHTML: {
|
|
69
|
-
__html: x.replaceHTMLinks(
|
|
72
|
+
__html: x.replaceHTMLinks(T, f)
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
)
|
|
@@ -76,30 +79,30 @@ const C = (n, s) => {
|
|
|
76
79
|
}
|
|
77
80
|
);
|
|
78
81
|
}
|
|
79
|
-
),
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
), q = ({ results: e, meta: r, perPage: n, intl: i, searchTerm: t }) => {
|
|
83
|
+
const s = r ? r["x-wp-total"] : 0;
|
|
84
|
+
return r && r["x-wp-totalpages"], /* @__PURE__ */ S("div", { id: "float-results-container", children: [
|
|
85
|
+
/* @__PURE__ */ o("span", { className: "float-results-header", children: i.formatMessage(
|
|
83
86
|
{
|
|
84
87
|
id: "search.results.summary",
|
|
85
88
|
defaultMessage: "{count} of {total} Results"
|
|
86
89
|
},
|
|
87
|
-
{ count:
|
|
90
|
+
{ count: s < n ? s : n, total: s }
|
|
88
91
|
) }),
|
|
89
|
-
|
|
92
|
+
e.map((a) => /* @__PURE__ */ o(L, { ...a, searchTerm: t }, a.ID))
|
|
90
93
|
] });
|
|
91
|
-
},
|
|
92
|
-
onSearch:
|
|
93
|
-
perPage:
|
|
94
|
-
loading:
|
|
94
|
+
}, B = ({
|
|
95
|
+
onSearch: e,
|
|
96
|
+
perPage: r,
|
|
97
|
+
loading: n,
|
|
95
98
|
results: i,
|
|
96
|
-
meta:
|
|
97
|
-
intl:
|
|
99
|
+
meta: t,
|
|
100
|
+
intl: s,
|
|
98
101
|
searchTerm: a
|
|
99
|
-
}) => (
|
|
102
|
+
}) => (t && t["x-wp-total"], t && t["x-wp-totalpages"], /* @__PURE__ */ o(
|
|
100
103
|
"input",
|
|
101
104
|
{
|
|
102
|
-
placeholder:
|
|
105
|
+
placeholder: s.formatMessage({
|
|
103
106
|
id: "search.placeholder",
|
|
104
107
|
defaultMessage: "Search..."
|
|
105
108
|
}),
|
|
@@ -108,16 +111,16 @@ const C = (n, s) => {
|
|
|
108
111
|
name: "search",
|
|
109
112
|
value: a,
|
|
110
113
|
onChange: (l) => {
|
|
111
|
-
|
|
114
|
+
e(l.target.value);
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
|
-
)),
|
|
115
|
-
onSearch:
|
|
116
|
-
onSetSelected:
|
|
117
|
-
perPage:
|
|
117
|
+
)), O = ({
|
|
118
|
+
onSearch: e,
|
|
119
|
+
onSetSelected: r,
|
|
120
|
+
perPage: n,
|
|
118
121
|
loading: i,
|
|
119
|
-
results:
|
|
120
|
-
meta:
|
|
122
|
+
results: t,
|
|
123
|
+
meta: s,
|
|
121
124
|
locale: a,
|
|
122
125
|
intl: l,
|
|
123
126
|
searchTerm: d,
|
|
@@ -125,50 +128,50 @@ const C = (n, s) => {
|
|
|
125
128
|
selected: y
|
|
126
129
|
// Added selected prop to track menu selection
|
|
127
130
|
}) => {
|
|
128
|
-
const [
|
|
131
|
+
const [h, u] = v(!1), c = P(null), f = () => {
|
|
129
132
|
u(!1);
|
|
130
133
|
};
|
|
131
134
|
return w(() => {
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
return
|
|
135
|
+
const p = document.createElement("div");
|
|
136
|
+
p.setAttribute("id", "float-input-container"), p.setAttribute("class", "input container"), p.style.display = "none";
|
|
137
|
+
const m = document.getElementById("root");
|
|
138
|
+
return m && (m.appendChild(p), c.current = p), () => {
|
|
136
139
|
c.current && c.current.parentNode && c.current.parentNode.removeChild(c.current);
|
|
137
140
|
};
|
|
138
141
|
}, []), w(() => {
|
|
139
|
-
c.current && (c.current.style.display =
|
|
140
|
-
}, [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
c.current && (c.current.style.display = h ? "block" : "none");
|
|
143
|
+
}, [h]), /* @__PURE__ */ S(_, { children: [
|
|
144
|
+
/* @__PURE__ */ o(
|
|
142
145
|
"div",
|
|
143
146
|
{
|
|
144
147
|
id: "ui-float-search",
|
|
145
|
-
className: `ui float-search${
|
|
148
|
+
className: `ui float-search${h ? " ui-float-search-active" : ""}`,
|
|
146
149
|
onMouseOver: () => {
|
|
147
150
|
u(!0);
|
|
148
151
|
},
|
|
149
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ o(j, { name: "search", size: "small" })
|
|
150
153
|
}
|
|
151
154
|
),
|
|
152
|
-
c.current &&
|
|
153
|
-
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
155
|
+
c.current && F(
|
|
156
|
+
h ? /* @__PURE__ */ S("div", { onMouseLeave: f, children: [
|
|
157
|
+
/* @__PURE__ */ o("div", { className: "float-search-container", children: /* @__PURE__ */ o(
|
|
158
|
+
B,
|
|
156
159
|
{
|
|
157
|
-
onSearch:
|
|
158
|
-
perPage:
|
|
160
|
+
onSearch: e,
|
|
161
|
+
perPage: n,
|
|
159
162
|
loading: i,
|
|
160
|
-
results:
|
|
161
|
-
meta:
|
|
163
|
+
results: t,
|
|
164
|
+
meta: s,
|
|
162
165
|
intl: l,
|
|
163
166
|
searchTerm: d
|
|
164
167
|
}
|
|
165
168
|
) }),
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
t && t.length > 0 && /* @__PURE__ */ o(A, { locale: a, children: /* @__PURE__ */ o(
|
|
170
|
+
q,
|
|
168
171
|
{
|
|
169
|
-
results:
|
|
170
|
-
meta:
|
|
171
|
-
perPage:
|
|
172
|
+
results: t,
|
|
173
|
+
meta: s,
|
|
174
|
+
perPage: n,
|
|
172
175
|
intl: l,
|
|
173
176
|
searchTerm: d
|
|
174
177
|
}
|
|
@@ -177,82 +180,82 @@ const C = (n, s) => {
|
|
|
177
180
|
c.current
|
|
178
181
|
)
|
|
179
182
|
] });
|
|
180
|
-
},
|
|
181
|
-
const a =
|
|
183
|
+
}, W = ({ onSearch: e, perPage: r, loading: n, results: i, meta: t, intl: s }) => {
|
|
184
|
+
const a = t ? t["x-wp-total"] : 0, l = t ? t["x-wp-totalpages"] : 0, [d, y] = v("");
|
|
182
185
|
w(() => {
|
|
183
186
|
const u = setTimeout(() => {
|
|
184
|
-
|
|
187
|
+
e(d);
|
|
185
188
|
}, 300);
|
|
186
189
|
return () => clearTimeout(u);
|
|
187
190
|
}, [d]);
|
|
188
|
-
const
|
|
189
|
-
return /* @__PURE__ */
|
|
190
|
-
|
|
191
|
+
const h = (u) => /* @__PURE__ */ o(L, { ...u, searchTerm: d });
|
|
192
|
+
return /* @__PURE__ */ o(
|
|
193
|
+
k,
|
|
191
194
|
{
|
|
192
195
|
value: d,
|
|
193
|
-
loading:
|
|
194
|
-
placeholder:
|
|
196
|
+
loading: n,
|
|
197
|
+
placeholder: s.formatMessage({
|
|
195
198
|
id: "search.placeholder",
|
|
196
199
|
defaultMessage: "Search..."
|
|
197
200
|
}),
|
|
198
201
|
onResultSelect: (u, c) => null,
|
|
199
202
|
total: a,
|
|
200
|
-
perPage:
|
|
203
|
+
perPage: r,
|
|
201
204
|
totalPages: l,
|
|
202
205
|
onSearchChange: (u, c) => {
|
|
203
206
|
y(c.value);
|
|
204
207
|
},
|
|
205
|
-
resultRenderer:
|
|
208
|
+
resultRenderer: h,
|
|
206
209
|
results: i,
|
|
207
210
|
showNoResults: !1,
|
|
208
|
-
intl:
|
|
211
|
+
intl: s,
|
|
209
212
|
searchTerm: d
|
|
210
213
|
}
|
|
211
214
|
);
|
|
212
|
-
},
|
|
213
|
-
const { intl:
|
|
215
|
+
}, ee = N((e) => {
|
|
216
|
+
const { intl: r, onSetSelected: n } = e, [i, t] = v(""), [s, a] = v(!1);
|
|
214
217
|
return w(() => {
|
|
215
218
|
const l = () => {
|
|
216
219
|
a(window.innerWidth <= 1365);
|
|
217
220
|
};
|
|
218
221
|
return l(), window.addEventListener("resize", l), () => window.removeEventListener("resize", l);
|
|
219
|
-
}, []), /* @__PURE__ */
|
|
220
|
-
|
|
222
|
+
}, []), /* @__PURE__ */ o(b, { search: i, perPage: 5, locale: r.locale, children: /* @__PURE__ */ o(
|
|
223
|
+
G,
|
|
221
224
|
{
|
|
222
|
-
...
|
|
223
|
-
onSetSelected:
|
|
224
|
-
setQuery:
|
|
225
|
+
...e,
|
|
226
|
+
onSetSelected: n,
|
|
227
|
+
setQuery: t,
|
|
225
228
|
query: i,
|
|
226
|
-
isSmallScreen:
|
|
227
|
-
intl:
|
|
229
|
+
isSmallScreen: s,
|
|
230
|
+
intl: r
|
|
228
231
|
}
|
|
229
232
|
) });
|
|
230
|
-
}),
|
|
231
|
-
const l =
|
|
232
|
-
return a.settings.react_search_type === "floating" ||
|
|
233
|
-
|
|
233
|
+
}), G = ({ onSetSelected: e, selected: r, setQuery: n, query: i, isSmallScreen: t, intl: s, ...a }) => {
|
|
234
|
+
const l = $(z);
|
|
235
|
+
return a.settings.react_search_type === "floating" || t ? /* @__PURE__ */ o(
|
|
236
|
+
O,
|
|
234
237
|
{
|
|
235
|
-
onSetSelected:
|
|
236
|
-
selected:
|
|
237
|
-
onSearch:
|
|
238
|
+
onSetSelected: e,
|
|
239
|
+
selected: r,
|
|
240
|
+
onSearch: n,
|
|
238
241
|
perPage: 5,
|
|
239
|
-
intl:
|
|
242
|
+
intl: s,
|
|
240
243
|
...a,
|
|
241
244
|
...l,
|
|
242
245
|
searchTerm: i
|
|
243
246
|
}
|
|
244
|
-
) : /* @__PURE__ */
|
|
245
|
-
|
|
247
|
+
) : /* @__PURE__ */ o(
|
|
248
|
+
W,
|
|
246
249
|
{
|
|
247
|
-
onSetSelected:
|
|
248
|
-
onSearch:
|
|
250
|
+
onSetSelected: e,
|
|
251
|
+
onSearch: n,
|
|
249
252
|
perPage: 5,
|
|
250
|
-
intl:
|
|
253
|
+
intl: s,
|
|
251
254
|
...a,
|
|
252
255
|
...l
|
|
253
256
|
}
|
|
254
257
|
);
|
|
255
258
|
};
|
|
256
259
|
export {
|
|
257
|
-
|
|
260
|
+
ee as default
|
|
258
261
|
};
|