@devgateway/dvz-ui-react 1.9.9 → 1.9.10
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/map/MapDataFrame.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/tabbedposts/index.js +1 -1
- package/dist/esm/embeddable/map/MapDataFrame.js +118 -114
- package/dist/esm/embeddable/map/index.js +218 -205
- package/dist/esm/embeddable/tabbedposts/index.js +29 -30
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const q=require("react"),re=F=>{var N,K;const{data:o,measures:D,customMeasureLabels:y,children:J,source:x,extraDimension:f,allDimensions:C}=F;console.log("MapDataFrame props:",F);const B=(x||"").split("/").filter(Boolean),b=B.length>0?B[0]:null,d={locationsData:[],nationalData:{},measureLabelMap:{}};o.metadata&&o.metadata.measures&&Array.isArray(o.metadata.measures),o.children&&o.children[0]&&o.children[0].children;const E=o.metadata||{},$=["value","count","type","children","label","measure"],T=C&&C.length>0?C:E.types||[],V={};T.forEach(e=>{const n=e.category||e.type;n&&(V[n]=e.items||[])});const O=(e,n)=>{const r=V[e];if(!r)return null;const t=n!=null?String(n):n;return r.find(a=>{const l=a.value!=null?String(a.value):a.value,i=a.id!=null?String(a.id):a.id,s=a.code!=null?String(a.code):a.code;return l===t||i===t||s===t})||null},v=(e,n)=>{const r=O(e,n);return r?r.value??r.label??r.id??r.code??n:n},G=(e={})=>{const n={};return Object.keys(e).forEach(r=>{const t=e[r];t!=null&&(Array.isArray(t)?n[r]=t.map(a=>v(r,a)).join(" ,"):n[r]=v(r,t))}),n},H=e=>{const n=V[e]||[];return n.length===1?v(e,n[0].value??n[0].id??n[0].code):null},c=e=>e!=null&&e!=="",w=e=>{if(e)return c(e.value)?e.value:c(e.id)?e.id:e.code},A=e=>e==null?"":String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),p=(e,n)=>{if(!e)return;const r=A(n),t=e[n];if(t!=null&&t!=="")return t;const a=Object.keys(e);for(let l=0;l<a.length;l++){const i=a[l];if(A(i)===r){const s=e[i];if(s!=null&&s!=="")return s}}},Q=e=>Array.isArray(e)?e.length>0?e[0]:void 0:e,X=(e,n)=>{const r=[b,"country",e.type].filter(Boolean),t=[p(n,"country"),p(e,"country"),b?p(n,b):void 0,b?p(e,b):void 0,e.label,e.value].filter(a=>c(a));for(let a=0;a<r.length;a++){const l=r[a],i=V[l]||[];if(i.length)for(let s=0;s<t.length;s++){const h=t[s],m=A(h),W=i.findIndex(ee=>{const ne=w(ee);return A(ne)===m});if(W>=0)return W}}return-1},Y=(e,n,r)=>{const t=X(n,r);if(t<0)return;const a=V[e]||[];if(!a.length||t>=a.length)return;const l=w(a[t]);if(c(l))return v(e,l)},R=(e,n,r)=>{const t=p(r,e);if(c(t))return t;if(c(L[e]))return L[e];const a=p(n,e);if(c(a))return a;const l=Y(e,n,r);if(c(l))return l;const i=H(e);if(c(i))return i;const s=n.value;return O(e,s)?v(e,s):""},_=o.appliedFilters||{};let z="";if(f){const e=p(_,f),n=Q(e);z=v(f,n)||""}const L=G(_),Z=e=>{const n={};return Object.keys(e).forEach(r=>{$.includes(r)||(n[r]=e[r])}),e.type&&e.value!==void 0&&(n[e.type]=v(e.type,e.value)),n},S=e=>{let n=Z(e);return e.children&&Array.isArray(e.children)&&e.children.forEach(r=>{n={...n,...S(r)}}),n},P=(e,n)=>{if(!(!e.children||!Array.isArray(e.children)))return e.children.map(r=>({...r,label:r.value,value:r[n],variables:S(r),children:P(r,n)}))};E.measures&&E.measures.forEach(e=>{y&&y[e.value]&&y[e.value].hasCustomLabel&&y[e.value].customLabel?d.measureLabelMap[e.value]=y[e.value].customLabel:d.measureLabelMap[e.value]=e.label});const j=(((N=o==null?void 0:o.metadata)==null?void 0:N.measures)||[]).map(e=>e==null?void 0:e.value).filter(Boolean),u=(()=>{if(Array.isArray(D))return D.map(e=>(""+e).trim()).filter(Boolean);if(typeof D=="string"){const e=D.trim();if(!e||e==="[]")return j;if(e.startsWith("[")&&e.endsWith("]"))try{const n=JSON.parse(e);if(Array.isArray(n))return n.map(r=>(""+r).trim()).filter(Boolean)}catch{}return e.split(",").map(n=>n.trim()).filter(Boolean)}return j})(),M=((K=o==null?void 0:o.metadata)==null?void 0:K.types)||[],I=(x||"").split("/")[0],U=M.find(e=>e.dimension===I)||M[0],k=(e,n)=>{var l;if(typeof(e==null?void 0:e.value)=="string")return e.value;const t=M.find(i=>i.dimension===(e==null?void 0:e.type))||U,a=(l=t==null?void 0:t.items)==null?void 0:l[n];return(a==null?void 0:a.value)||(a==null?void 0:a.code)||(e==null?void 0:e.label)||(e==null?void 0:e.value)},g=(e,n)=>{if(e&&Object.prototype.hasOwnProperty.call(e,n))return e[n];if(n==="value")return e==null?void 0:e.value};if(o&&o.children){o.children.forEach((n,r)=>{const t=k(n,r);u.forEach(a=>{const l={...S(n),...L};if(T.forEach(s=>{const h=s.category||s.type;h&&(l[h]=R(h,n,l))}),f){const s=R(f,n,l);l[f]=c(s)?s:z,l.dimension3=l[f],l.additionalDimension=l[f]}const i={...n,label:t,value:g(n,a),measure:a,variables:l};i.variables.selectedDataFrameTooltipValue=g(n,a),n.children&&(i.children=[],n.children.forEach(s=>{i.children.push({...s,label:s.value,value:g(s,a)})})),i.children=P(n,a),d.locationsData.push(i)})}),d.measures=u.length>1?u:null;const e=u.length>0?u[0]:null;d.nationalData.value=e?g(o,e):null}else if(o&&u.length>0){const e=typeof o.value=="string"&&o.value||o.label||o.type||"total";u.forEach(n=>{const r=g(o,n);r!==void 0&&d.locationsData.push({label:e,value:r,measure:n})}),d.measures=u.length>1?u:null,d.nationalData.value=g(o,u[0])}return q.Children.map(J,e=>q.cloneElement(e,{transformedData:{...d,types:M}}))};exports.default=re;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
-
{label}: %({value},2)`,"data-show-no-data-tooltip":
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),j=require("react"),y=require("react-redux"),ea=require("../data/DataProvider.js"),aa=require("../data/DataConsumer.js"),ta=require("../reducers/data.js"),oa=require("./map.js"),la=require("./MapDataFrame.js"),ra=require("./MapCSVDataFrame.js"),na=[{label:"KENYA",value:"KEN",center:[35.8166634,.1],scale:2e3},{label:"Nigeria",value:"NGA",center:[7.491302,9.072264],scale:2e3},{label:"South Africa",value:"ZAF",center:[24.676997,-28.48322],scale:2e3},{label:"West Africa",value:"West Africa",center:[-7.293255,13.90572],scale:1500},{label:"Africa",value:"Africa",center:[13.134227,-11.523088],scale:550},{label:"Ethiopia",value:"ETH",center:[35.8166634,1.7],scale:2e3},{label:"Zambia",value:"ZMB",center:[26.459455,-14.668135],scale:2e3},{label:"Democratic Republic of the Congo",value:"DRC",center:[23.174338,-5.837475],scale:1250},{label:"World",value:"World",center:[0,20.050043],scale:150}],sa=s=>u.jsx(ia,{...s}),ia=s=>{var k;const{unique:f,editing:m,"data-filters":W="{}","data-app":o="csv","data-csv":_="","data-dimension1":G="","data-dimension2":J="","data-dimension3":g="","data-extra-tooltip-columns":Z="[]","data-measures":h="[]","data-height":H=600,width:K=960,"data-data-source-text":$="","data-data-source-label":Y="Source","data-national-average-label":Q="National Average","data-legend-title":X="Legend Title","data-legend-breaks":ee="[]","data-zoom-enabled":L=!1,"data-show-legend-labels":w=!1,"data-map-file":ae,"data-mapping-field":te="zone","data-map-label-field":oe="admin","data-has-multiple-measures":F="false",topoJSONField:le="collection","data-map-center":re="NGA","data-map-label-show-value":S="false","data-show-tooltip":x="true","data-measure-selector-label":ne="","data-value-format":se="","data-show-overall-value":D="false","data-auto-generate-breaks":I="false","data-number-of-breaks":ie=5,"data-scheme":de="reds","data-show-no-data-label":N="false","data-group":T="default","data-map-symbols":ce="[]","data-tooltip-theme":ue="map-tooltip-dark","data-label-font-size":me=12,"data-label-font-weight":pe="normal","data-label-font-color":fe="#595959","data-legend-font-size":ge=12,"data-legend-font-weight":he="normal","data-custom-tooltips":be="[]","data-format-style":b="decimal","data-decimals":z="2","data-currency":ve="","data-tooltip-font-size":Ce=14,"data-show-admin-unit-label":ye="showAll","data-map-no-data-color":Le="#f8f8f8","data-map-boundary-color":we="#000","data-map-focus-boundary-color":Fe="#000","data-highlighted-location":Se="","data-tooltip-format":xe=`{locationName} %({value},2)
|
|
2
|
+
{label}: %({value},2)`,"data-show-no-data-tooltip":A="false","data-map-container-bg-color":De="#fff","data-map-position":Ie="{}","data-main-layer-id":Ne="","data-enabled-layers":Te,"data-point-label-color":ze="#fff","data-point-label-format":Ae="{locationName} %({value},2)","data-show-no-data-legend-item":R=!1,"data-highlighted-loc-label-format":Re="{locationName} - Score: #({value},2)","data-enable-summary-view":ma="false","data-map-type":B="DEFAULT","data-default-point-color":Be="#FFFF00","data-aggregation-formula":Ue="COUNT","data-zoom-level-to-show-points":Pe=2,"data-zoom-on-filter":U="false","data-zoom-on-filter-field":Me="","data-no-data-text":Ee="No Data","data-labels-exclusion-list":Ve="","data-custom-measure-labels":ke="{}","data-show-shading-layer-labels":qe="ifUnitHasData","data-dvz-proxy-dataset-id":n,"data-recently-toggled-layer-id":Oe=null,intl:pa,settings:fa}=s;console.log("MapWrapper props",s);const je=e=>m?e:decodeURIComponent(e),P=e=>e==null?"":String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),We=(e,a)=>{if(!e||!a)return;if(Object.prototype.hasOwnProperty.call(e,a))return e[a];const t=P(a),r=Object.keys(e).find(q=>P(q)===t);return r?e[r]:void 0},l=e=>{try{if(e)return JSON.parse(je(e))}catch{console.error("error parsing value:"+e)}return null},_e=e=>{let a=l(e)||[];return a=a.map(t=>(t.min&&(t.min=parseFloat(t.min)),t.max&&(t.max=parseFloat(t.max)),t.color=decodeURIComponent(t.color),t)),a},Ge=e=>{const a=l(e)||[];let t={};return a&&a.forEach?a.forEach(r=>{(Array.isArray(r.value)?r.value:[r.value]).filter(O=>O!=null&&O.toString().trim()!="").length>0&&(t[r.param]=r.value)}):t=a,t},Je={style:b==="compacted"?"decimal":b,notation:b==="compacted"?"compact":"standard",currency:ve,minimumFractionDigits:parseInt(z),maximumFractionDigits:parseInt(z)};let v=l(Te)||[];v=v.map(e=>(e.bgColor=decodeURIComponent(e.bgColor),e.fontColor=decodeURIComponent(e.fontColor),e));const M=na.find(e=>e.value===re),E=F==!0||F=="true";let i=[G,J].filter(e=>e!=="none"&&e!==null).join("/");const d=g&&g!=="none"?g:null,p={unique:f,editing:m,source:`/${ae}`,center:M.center,scale:M.scale,measures:h,legendTitle:X,height:H,width:K,topoJSONField:le,mappingField:te,dataSourceText:$,dataSourceLabel:Y,nationalAverageLabel:Q,legendBreaks:_e(ee),mapLabelField:oe,zoomEnabled:L==!0||L=="true",showLegendLabels:w==!0||w=="true",multipleMeasures:E,app:o,mapLabelShowValue:S==!0||S=="true",showTooltip:x==!0||x=="true",showOverallValue:D==!0||D=="true",measureSelectorLabel:ne,valueFormat:se,autoGenerateBreaks:I==!0||I=="true",showNoDataLabel:N==!0||N=="true",numberOfBreaks:ie,colorScheme:de,group:T,symbols:l(ce)||[],tooltipTheme:ue,labelFontSize:me,labelFontColor:decodeURIComponent(fe),labelFontWeight:pe,legendFontSize:ge,legendFontWeight:he,customTooltips:l(be)||[],format:Je,tooltipFontSize:Ce,showAdminUnitLabel:ye,mapNoDataColor:decodeURIComponent(Le),mapBoundaryColor:decodeURIComponent(we),mapFocusBoundaryColor:decodeURIComponent(Fe),highlightedLocation:Se,tooltipFormat:xe,showNoDataTooltip:A==!0||A=="true",fields:i.split("/"),mapContainerBgColor:decodeURIComponent(De),mapPosition:l(Ie),mainLayerId:Ne,enabledLayers:v,pointLabelColor:decodeURIComponent(ze),pointLabelFormat:Ae,showNoDataLegendItem:R==!0||R=="true",highlightedLocLabelFormat:Re,mapType:B,defaultPointColor:decodeURIComponent(Be),zoomLevelToShowPoints:Pe,zoomOnFilter:U==!0||U=="true",zoomOnFilterField:Me,noDataText:Ee,labelsExclusionList:Ve.split(",").map(e=>e.trim()),showShadingLayerLabels:qe,dvzProxyDatasetId:n,recentlyToggledLayerId:Oe};if(p.recentlyToggledLayerId){const e=p.enabledLayers.find(a=>String(a.id)===String(p.recentlyToggledLayerId));e&&(e!=null&&e.apiField)&&(i=(k=e.apiField)==null?void 0:k.toLowerCase())}const Ze=l(ke)||{},He=o==="csv"?ra.default:la.default,Ke=m?(l(h)||[]).join(","):h,c=Ge(W);if(d){const e=We(c,d);e!=null&&e!==""&&(c[d]=e)}const $e=(l(Z)||[]).filter(e=>e&&e!=="none"),V=Array.from(new Set([d,...$e].filter(Boolean)));V.length>0&&(c.includeColumns=V.join(",")),n&&(c.dvzProxyDatasetId=n);const Ye=y.useDispatch(),Qe=["data","categories",o,...n?[n]:[],"items"],C=y.useSelector(e=>e.getIn(Qe)),Xe=j.useMemo(()=>C?C.toJS():[],[C]);return j.useEffect(()=>{o&&o!=="csv"&&Ye(ta.getCategories({app:o,dvzProxyDatasetId:n}))},[o,n]),u.jsx(ea.default,{params:c,app:o,csv:decodeURIComponent(_),group:T,editing:m,store:[o,f,...i.split("/")],source:i,children:u.jsx(aa.default,{children:u.jsx(He,{measures:Ke,multipleMeasures:E,mapType:B,aggregationFormula:Ue,customMeasureLabels:Ze,source:i,extraDimension:d,allDimensions:Xe,children:u.jsx(oa.default,{...p})})})})},da=(s,f)=>{},ca={},ua=y.connect(da,ca)(sa);exports.default=ua;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("react"),l=require("semantic-ui-react"),h=require("@devgateway/wp-react-lib"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("react"),l=require("semantic-ui-react"),h=require("@devgateway/wp-react-lib"),S=require("react-intl"),A=require("react-redux"),y=require("../connected-templates/PostIntro.js"),L=require("../../lib/hooks/window-dimensions.js"),q=({posts:t,activeItem:c,setActive:i,showLabels:n})=>t?t.map(s=>e.jsx(l.Menu.Item,{onClick:()=>i(s.slug),className:s.slug===c?"active":"",children:n?e.jsx(h.PostLabel,{post:s}):e.jsx(l.Label,{children:e.jsx("span",{dangerouslySetInnerHTML:{__html:s.title.rendered}})})},s.id)):null,k=({posts:t,activeItem:c,setActive:i,showIcons:n,showLabels:s})=>{const r=t.length;return t?t.map(o=>{var m,g;return(m=o._embedded)!=null&&m["wp:featuredmedia"]&&o._embedded["wp:featuredmedia"][0].source_url,e.jsx(l.Grid.Column,{className:(o.slug===c?"active":"")+(n?" has-icon":""),children:e.jsxs(l.Button,{onClick:()=>i(o.slug),className:`nav ${r===1?"one":""}`,children:[n&&e.jsx(h.MediaProvider,{id:(g=o.meta_fields)!=null&&g.icon?o.meta_fields.icon[0]:null,children:e.jsx(h.MediaConsumer,{children:e.jsx(h.PostIcon,{className:"icon"})})}),s?e.jsx(h.PostLabel,{post:o}):e.jsx(l.Label,{children:e.jsx("span",{dangerouslySetInnerHTML:{__html:o.title.rendered}})})]})},o.id)}):null},C=({posts:t,activeItem:c})=>(u.useEffect(()=>{const i=document.querySelector(".ui.container.content-tab");i&&(i.scrollTop=0)},[c]),t?t.map(i=>{let n={};return i.slug!==c?n={position:"absolute",left:"-3000px",width:"auto",height:"0px",overflow:"hidden",visibility:"hidden"}:n={visibility:"visible",position:"relative",width:"auto"},e.jsx(y.default,{as:l.Container,fluid:!0,post:i,style:n},i.slug)}):null),R=({posts:t,activeItem:c,setActive:i})=>{const[n,s]=u.useState(t.findIndex(d=>d.slug===c)),[r,o]=u.useState(null),m=u.useRef(null);u.useEffect(()=>{if(r){const d=r.getBoundingClientRect().top+window.scrollY;window.scrollTo({top:d,behavior:"smooth"})}},[r]);const g=(d,x)=>{const{index:a}=x,j=n===a?-1:a;s(j),i(t[a].slug),j!==-1&&o(d.currentTarget)};return e.jsx(l.Accordion,{fluid:!0,styled:!0,children:t.map((d,x)=>{var j;const a=(j=d.meta_fields)!=null&&j.icon?d.meta_fields.icon[0]:null;return e.jsxs(u.Fragment,{children:[e.jsx(l.Accordion.Title,{active:n===x,index:x,onClick:g,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[a&&e.jsx(h.MediaProvider,{id:a,children:e.jsx(h.MediaConsumer,{children:e.jsx(h.PostIcon,{className:"icon"})})}),e.jsx("span",{dangerouslySetInnerHTML:{__html:d.title.rendered},style:{marginLeft:a?"10px":"0"}})]}),e.jsx(l.Icon,{name:"chevron down"})]})}),e.jsx(l.Accordion.Content,{className:"accordion-post-content",active:n===x,children:e.jsx("div",{ref:m,children:e.jsx(y.default,{post:d,as:l.Container,fluid:!0})})})]},d.id)})})},$=({posts:t,showLabels:c,height:i})=>{const[n,s]=u.useState(t?t[0].slug:null);return u.useEffect(()=>{setTimeout(()=>{if(window.location.hash){const r=window.location.hash.substr(1),o=document.getElementById(r);o&&t.map(m=>m.slug).indexOf(r)>-1&&(s(r),o.scrollIntoView({behavior:"auto",block:"start"}))}},0)},[t]),e.jsxs(u.Fragment,{children:[t.map(r=>e.jsx("anchor",{id:r.slug},r.slug)),e.jsx(l.Menu,{className:"tabbed posts",text:!0,children:e.jsx(q,{showLabels:c,posts:t,setActive:s,activeItem:n})}),e.jsx(l.Container,{className:"content-tab",style:{height:`${i}px`},children:e.jsx(C,{posts:t,activeItem:n})})]})},D=({posts:t,showLabels:c,showIcons:i,height:n})=>{const[s,r]=u.useState(t?t[0].slug:null);return e.jsx(u.Fragment,{children:e.jsxs(l.Grid,{stackable:!0,className:"tabbed posts",columns:t.length,style:{height:n+"px"},children:[e.jsx(k,{showIcons:i,showLabels:c,posts:t,activeItem:s,setActive:r}),e.jsx(l.Grid.Row,{style:{height:`${n}px`},children:e.jsx(l.Grid.Column,{width:16,className:"content",children:e.jsx(l.Container,{className:"content-tab",style:{height:`${n}px`},children:e.jsx(C,{className:"content-tab",posts:t,activeItem:s})})})})]})})},G=t=>{var v;let{"data-type":c,"data-taxonomy":i,"data-categories":n,"data-items":s,"data-theme":r="light","data-show-icons":o,"data-use-scrolls":m,"data-show-labels":g,"data-height":d,"data-preview-mode":x="Desktop",pageModuleProps:a,parent:j,editing:b,unique:I}=t;a!=null&&a.previewMode&&(a!=null&&a.editing)&&(x=a.previewMode,b=a.editing);const p=t.intl.locale,M=Array.isArray(n)?n.join(","):n,f=m==="true",w=f?d:void 0,{width:_}=L.useWindowDimensionsAndDevice(),P=_<=1024,T=x!=="Desktop"&&b,N=P&&!b;return e.jsx(l.Container,{className:`viz tabbed posts ${b?"editing":""} ${f?"scrollable":""}`,fluid:!0,children:e.jsx(h.PostProvider,{locale:p,type:c,taxonomy:i,categories:M,store:`tabbedposts_${j}_${I}`,page:1,perPage:s,children:e.jsx(h.PostConsumer,{children:e.jsx(h.PostConsumer,{children:N||T?e.jsx(R,{posts:s,activeItem:(v=s[0])==null?void 0:v.slug,setActive:()=>{}}):r==="light"?e.jsx($,{height:w,showLabels:g==="true"}):e.jsx(D,{height:w,showLabels:g==="true",showIcons:o==="true"})})})})})},E=(t,c)=>{const i=t.getIn(["data","pageModuleProps"]),n={};return i&&(n.pageModuleProps=i),n},H={},B=A.connect(E,H)(S.injectIntl(G));exports.default=B;
|
|
@@ -1,146 +1,147 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
var
|
|
4
|
-
const { data:
|
|
5
|
-
console.log("MapDataFrame props:",
|
|
6
|
-
const
|
|
1
|
+
import J from "react";
|
|
2
|
+
const te = (F) => {
|
|
3
|
+
var j, K;
|
|
4
|
+
const { data: o, measures: D, customMeasureLabels: y, children: $, source: S, extraDimension: f, allDimensions: C } = F;
|
|
5
|
+
console.log("MapDataFrame props:", F);
|
|
6
|
+
const B = (S || "").split("/").filter(Boolean), b = B.length > 0 ? B[0] : null, d = {
|
|
7
7
|
locationsData: [],
|
|
8
8
|
nationalData: {},
|
|
9
9
|
measureLabelMap: {}
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
o.metadata && o.metadata.measures && Array.isArray(o.metadata.measures), o.children && o.children[0] && o.children[0].children;
|
|
12
|
+
const E = o.metadata || {}, q = ["value", "count", "type", "children", "label", "measure"], T = C && C.length > 0 ? C : E.types || [], V = {};
|
|
13
|
+
T.forEach((e) => {
|
|
14
14
|
const n = e.category || e.type;
|
|
15
|
-
n && (
|
|
15
|
+
n && (V[n] = e.items || []);
|
|
16
16
|
});
|
|
17
|
-
const
|
|
18
|
-
const a =
|
|
17
|
+
const O = (e, n) => {
|
|
18
|
+
const a = V[e];
|
|
19
19
|
if (!a)
|
|
20
20
|
return null;
|
|
21
21
|
const t = n != null ? String(n) : n;
|
|
22
22
|
return a.find((r) => {
|
|
23
|
-
const
|
|
24
|
-
return
|
|
23
|
+
const l = r.value != null ? String(r.value) : r.value, i = r.id != null ? String(r.id) : r.id, s = r.code != null ? String(r.code) : r.code;
|
|
24
|
+
return l === t || i === t || s === t;
|
|
25
25
|
}) || null;
|
|
26
|
-
},
|
|
27
|
-
const a =
|
|
26
|
+
}, p = (e, n) => {
|
|
27
|
+
const a = O(e, n);
|
|
28
28
|
return a ? a.value ?? a.label ?? a.id ?? a.code ?? n : n;
|
|
29
|
-
},
|
|
29
|
+
}, G = (e = {}) => {
|
|
30
30
|
const n = {};
|
|
31
31
|
return Object.keys(e).forEach((a) => {
|
|
32
32
|
const t = e[a];
|
|
33
|
-
t != null && (Array.isArray(t) ? n[a] = t.map((r) =>
|
|
33
|
+
t != null && (Array.isArray(t) ? n[a] = t.map((r) => p(a, r)).join(" ,") : n[a] = p(a, t));
|
|
34
34
|
}), n;
|
|
35
|
-
},
|
|
36
|
-
const n =
|
|
37
|
-
return n.length === 1 ?
|
|
38
|
-
},
|
|
35
|
+
}, H = (e) => {
|
|
36
|
+
const n = V[e] || [];
|
|
37
|
+
return n.length === 1 ? p(e, n[0].value ?? n[0].id ?? n[0].code) : null;
|
|
38
|
+
}, c = (e) => e != null && e !== "", w = (e) => {
|
|
39
39
|
if (e)
|
|
40
|
-
return
|
|
41
|
-
},
|
|
40
|
+
return c(e.value) ? e.value : c(e.id) ? e.id : e.code;
|
|
41
|
+
}, A = (e) => e == null ? "" : String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, ""), v = (e, n) => {
|
|
42
42
|
if (!e)
|
|
43
43
|
return;
|
|
44
|
-
const a =
|
|
44
|
+
const a = A(n), t = e[n];
|
|
45
45
|
if (t != null && t !== "")
|
|
46
46
|
return t;
|
|
47
47
|
const r = Object.keys(e);
|
|
48
|
-
for (let
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
const s = e[
|
|
48
|
+
for (let l = 0; l < r.length; l++) {
|
|
49
|
+
const i = r[l];
|
|
50
|
+
if (A(i) === a) {
|
|
51
|
+
const s = e[i];
|
|
52
52
|
if (s != null && s !== "")
|
|
53
53
|
return s;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
},
|
|
56
|
+
}, Q = (e) => Array.isArray(e) ? e.length > 0 ? e[0] : void 0 : e, X = (e, n) => {
|
|
57
57
|
const a = [
|
|
58
|
-
|
|
58
|
+
b,
|
|
59
59
|
"country",
|
|
60
60
|
e.type
|
|
61
61
|
].filter(Boolean), t = [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
v(n, "country"),
|
|
63
|
+
v(e, "country"),
|
|
64
|
+
b ? v(n, b) : void 0,
|
|
65
|
+
b ? v(e, b) : void 0,
|
|
66
66
|
e.label,
|
|
67
67
|
e.value
|
|
68
|
-
].filter((r) =>
|
|
68
|
+
].filter((r) => c(r));
|
|
69
69
|
for (let r = 0; r < a.length; r++) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const l = a[r], i = V[l] || [];
|
|
71
|
+
if (i.length)
|
|
72
72
|
for (let s = 0; s < t.length; s++) {
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
return
|
|
73
|
+
const h = t[s], k = A(h), W = i.findIndex((ee) => {
|
|
74
|
+
const ne = w(ee);
|
|
75
|
+
return A(ne) === k;
|
|
76
76
|
});
|
|
77
|
-
if (
|
|
78
|
-
return
|
|
77
|
+
if (W >= 0)
|
|
78
|
+
return W;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
return -1;
|
|
82
|
-
},
|
|
83
|
-
const t =
|
|
82
|
+
}, Y = (e, n, a) => {
|
|
83
|
+
const t = X(n, a);
|
|
84
84
|
if (t < 0)
|
|
85
85
|
return;
|
|
86
|
-
const r =
|
|
86
|
+
const r = V[e] || [];
|
|
87
87
|
if (!r.length || t >= r.length)
|
|
88
88
|
return;
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
return
|
|
92
|
-
},
|
|
93
|
-
const t =
|
|
94
|
-
if (
|
|
89
|
+
const l = w(r[t]);
|
|
90
|
+
if (c(l))
|
|
91
|
+
return p(e, l);
|
|
92
|
+
}, R = (e, n, a) => {
|
|
93
|
+
const t = v(a, e);
|
|
94
|
+
if (c(t))
|
|
95
95
|
return t;
|
|
96
|
-
if (
|
|
97
|
-
return
|
|
98
|
-
const r =
|
|
99
|
-
if (
|
|
96
|
+
if (c(L[e]))
|
|
97
|
+
return L[e];
|
|
98
|
+
const r = v(n, e);
|
|
99
|
+
if (c(r))
|
|
100
100
|
return r;
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
return
|
|
101
|
+
const l = Y(e, n, a);
|
|
102
|
+
if (c(l))
|
|
103
|
+
return l;
|
|
104
|
+
const i = H(e);
|
|
105
|
+
if (c(i))
|
|
106
|
+
return i;
|
|
107
107
|
const s = n.value;
|
|
108
|
-
return
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
return O(e, s) ? p(e, s) : "";
|
|
109
|
+
}, z = o.appliedFilters || {};
|
|
110
|
+
let N = "";
|
|
111
|
+
if (f) {
|
|
112
|
+
const e = v(z, f), n = Q(e);
|
|
113
|
+
N = p(f, n) || "";
|
|
113
114
|
}
|
|
114
|
-
const
|
|
115
|
+
const L = G(z), Z = (e) => {
|
|
115
116
|
const n = {};
|
|
116
117
|
return Object.keys(e).forEach((a) => {
|
|
117
|
-
|
|
118
|
-
}), e.type && e.value !== void 0 && (n[e.type] =
|
|
119
|
-
},
|
|
120
|
-
let n =
|
|
118
|
+
q.includes(a) || (n[a] = e[a]);
|
|
119
|
+
}), e.type && e.value !== void 0 && (n[e.type] = p(e.type, e.value)), n;
|
|
120
|
+
}, x = (e) => {
|
|
121
|
+
let n = Z(e);
|
|
121
122
|
return e.children && Array.isArray(e.children) && e.children.forEach((a) => {
|
|
122
|
-
n = { ...n, ...
|
|
123
|
+
n = { ...n, ...x(a) };
|
|
123
124
|
}), n;
|
|
124
|
-
},
|
|
125
|
+
}, P = (e, n) => {
|
|
125
126
|
if (!(!e.children || !Array.isArray(e.children)))
|
|
126
127
|
return e.children.map((a) => ({
|
|
127
128
|
...a,
|
|
128
129
|
label: a.value,
|
|
129
130
|
value: a[n],
|
|
130
|
-
variables:
|
|
131
|
-
children:
|
|
131
|
+
variables: x(a),
|
|
132
|
+
children: P(a, n)
|
|
132
133
|
}));
|
|
133
134
|
};
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
E.measures && E.measures.forEach((e) => {
|
|
136
|
+
y && y[e.value] && y[e.value].hasCustomLabel && y[e.value].customLabel ? d.measureLabelMap[e.value] = y[e.value].customLabel : d.measureLabelMap[e.value] = e.label;
|
|
136
137
|
});
|
|
137
|
-
const
|
|
138
|
+
const _ = (((j = o == null ? void 0 : o.metadata) == null ? void 0 : j.measures) || []).map((e) => e == null ? void 0 : e.value).filter(Boolean), u = (() => {
|
|
138
139
|
if (Array.isArray(D))
|
|
139
140
|
return D.map((e) => ("" + e).trim()).filter(Boolean);
|
|
140
141
|
if (typeof D == "string") {
|
|
141
142
|
const e = D.trim();
|
|
142
143
|
if (!e || e === "[]")
|
|
143
|
-
return
|
|
144
|
+
return _;
|
|
144
145
|
if (e.startsWith("[") && e.endsWith("]"))
|
|
145
146
|
try {
|
|
146
147
|
const n = JSON.parse(e);
|
|
@@ -150,62 +151,65 @@ const ae = (S) => {
|
|
|
150
151
|
}
|
|
151
152
|
return e.split(",").map((n) => n.trim()).filter(Boolean);
|
|
152
153
|
}
|
|
153
|
-
return
|
|
154
|
-
})(), M = ((
|
|
155
|
-
var
|
|
154
|
+
return _;
|
|
155
|
+
})(), M = ((K = o == null ? void 0 : o.metadata) == null ? void 0 : K.types) || [], m = (S || "").split("/")[0], I = M.find((e) => e.dimension === m) || M[0], U = (e, n) => {
|
|
156
|
+
var l;
|
|
156
157
|
if (typeof (e == null ? void 0 : e.value) == "string")
|
|
157
158
|
return e.value;
|
|
158
|
-
const t = M.find((
|
|
159
|
+
const t = M.find((i) => i.dimension === (e == null ? void 0 : e.type)) || I, r = (l = t == null ? void 0 : t.items) == null ? void 0 : l[n];
|
|
159
160
|
return (r == null ? void 0 : r.value) || (r == null ? void 0 : r.code) || (e == null ? void 0 : e.label) || (e == null ? void 0 : e.value);
|
|
160
|
-
},
|
|
161
|
+
}, g = (e, n) => {
|
|
161
162
|
if (e && Object.prototype.hasOwnProperty.call(e, n))
|
|
162
163
|
return e[n];
|
|
163
164
|
if (n === "value")
|
|
164
165
|
return e == null ? void 0 : e.value;
|
|
165
166
|
};
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
const t =
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
...
|
|
167
|
+
if (o && o.children) {
|
|
168
|
+
o.children.forEach((n, a) => {
|
|
169
|
+
const t = U(n, a);
|
|
170
|
+
u.forEach((r) => {
|
|
171
|
+
const l = {
|
|
172
|
+
...x(n),
|
|
172
173
|
// Dynamic fields for both formats, including nested dimensions
|
|
173
|
-
...
|
|
174
|
+
...L
|
|
174
175
|
};
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
})
|
|
179
|
-
|
|
176
|
+
if (T.forEach((s) => {
|
|
177
|
+
const h = s.category || s.type;
|
|
178
|
+
h && (l[h] = R(h, n, l));
|
|
179
|
+
}), f) {
|
|
180
|
+
const s = R(f, n, l);
|
|
181
|
+
l[f] = c(s) ? s : N, l.dimension3 = l[f], l.additionalDimension = l[f];
|
|
182
|
+
}
|
|
183
|
+
const i = {
|
|
180
184
|
...n,
|
|
181
185
|
label: t,
|
|
182
|
-
value:
|
|
186
|
+
value: g(n, r),
|
|
183
187
|
measure: r,
|
|
184
|
-
variables:
|
|
188
|
+
variables: l
|
|
185
189
|
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
})),
|
|
190
|
+
i.variables.selectedDataFrameTooltipValue = g(n, r), n.children && (i.children = [], n.children.forEach((s) => {
|
|
191
|
+
i.children.push({ ...s, label: s.value, value: g(s, r) });
|
|
192
|
+
})), i.children = P(n, r), d.locationsData.push(i);
|
|
189
193
|
});
|
|
190
|
-
}),
|
|
191
|
-
const e =
|
|
192
|
-
|
|
193
|
-
} else if (
|
|
194
|
-
const e = typeof
|
|
195
|
-
|
|
196
|
-
const a =
|
|
197
|
-
a !== void 0 &&
|
|
194
|
+
}), d.measures = u.length > 1 ? u : null;
|
|
195
|
+
const e = u.length > 0 ? u[0] : null;
|
|
196
|
+
d.nationalData.value = e ? g(o, e) : null;
|
|
197
|
+
} else if (o && u.length > 0) {
|
|
198
|
+
const e = typeof o.value == "string" && o.value || o.label || o.type || "total";
|
|
199
|
+
u.forEach((n) => {
|
|
200
|
+
const a = g(o, n);
|
|
201
|
+
a !== void 0 && d.locationsData.push({
|
|
198
202
|
label: e,
|
|
199
203
|
value: a,
|
|
200
204
|
measure: n
|
|
201
205
|
});
|
|
202
|
-
}),
|
|
206
|
+
}), d.measures = u.length > 1 ? u : null, d.nationalData.value = g(o, u[0]);
|
|
203
207
|
}
|
|
204
|
-
return
|
|
205
|
-
...
|
|
208
|
+
return J.Children.map($, (e) => J.cloneElement(e, { transformedData: {
|
|
209
|
+
...d,
|
|
206
210
|
types: M
|
|
207
211
|
} }));
|
|
208
212
|
};
|
|
209
213
|
export {
|
|
210
|
-
|
|
214
|
+
te as default
|
|
211
215
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { connect as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { getCategories as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as Qe, useEffect as Xe } from "react";
|
|
3
|
+
import { connect as ea, useDispatch as aa, useSelector as oa } from "react-redux";
|
|
4
|
+
import ta from "../data/DataProvider.js";
|
|
5
|
+
import la from "../data/DataConsumer.js";
|
|
6
|
+
import { getCategories as ra } from "../reducers/data.js";
|
|
7
|
+
import na from "./map.js";
|
|
8
|
+
import sa from "./MapDataFrame.js";
|
|
9
|
+
import ia from "./MapCSVDataFrame.js";
|
|
10
|
+
const da = [
|
|
11
11
|
{ label: "KENYA", value: "KEN", center: [35.8166634, 0.1], scale: 2e3 },
|
|
12
12
|
{ label: "Nigeria", value: "NGA", center: [7.491302, 9.072264], scale: 2e3 },
|
|
13
13
|
{ label: "South Africa", value: "ZAF", center: [24.676997, -28.48322], scale: 2e3 },
|
|
@@ -17,222 +17,235 @@ const oa = [
|
|
|
17
17
|
{ label: "Zambia", value: "ZMB", center: [26.459455, -14.668135], scale: 2e3 },
|
|
18
18
|
{ label: "Democratic Republic of the Congo", value: "DRC", center: [23.174338, -5.837475], scale: 1250 },
|
|
19
19
|
{ label: "World", value: "World", center: [0, 20.050043], scale: 150 }
|
|
20
|
-
],
|
|
21
|
-
var
|
|
20
|
+
], ma = (s) => /* @__PURE__ */ c(ca, { ...s }), ca = (s) => {
|
|
21
|
+
var V;
|
|
22
22
|
const {
|
|
23
|
-
unique:
|
|
24
|
-
editing:
|
|
25
|
-
"data-filters":
|
|
26
|
-
"data-app":
|
|
27
|
-
"data-csv":
|
|
28
|
-
"data-dimension1":
|
|
29
|
-
"data-dimension2":
|
|
30
|
-
"data-dimension3":
|
|
31
|
-
"data-
|
|
32
|
-
"data-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"data-data-source-
|
|
36
|
-
"data-
|
|
37
|
-
"data-
|
|
38
|
-
"data-legend-
|
|
39
|
-
"data-
|
|
40
|
-
"data-
|
|
41
|
-
"data-
|
|
42
|
-
"data-
|
|
43
|
-
"data-
|
|
44
|
-
"data-
|
|
45
|
-
|
|
46
|
-
|
|
23
|
+
unique: f,
|
|
24
|
+
editing: u,
|
|
25
|
+
"data-filters": W = "{}",
|
|
26
|
+
"data-app": t = "csv",
|
|
27
|
+
"data-csv": G = "",
|
|
28
|
+
"data-dimension1": J = "",
|
|
29
|
+
"data-dimension2": Z = "",
|
|
30
|
+
"data-dimension3": g = "",
|
|
31
|
+
"data-extra-tooltip-columns": _ = "[]",
|
|
32
|
+
"data-measures": h = "[]",
|
|
33
|
+
"data-height": j = 600,
|
|
34
|
+
width: H = 960,
|
|
35
|
+
"data-data-source-text": K = "",
|
|
36
|
+
"data-data-source-label": $ = "Source",
|
|
37
|
+
"data-national-average-label": q = "National Average",
|
|
38
|
+
"data-legend-title": Y = "Legend Title",
|
|
39
|
+
"data-legend-breaks": Q = "[]",
|
|
40
|
+
"data-zoom-enabled": y = !1,
|
|
41
|
+
"data-show-legend-labels": L = !1,
|
|
42
|
+
"data-map-file": X,
|
|
43
|
+
"data-mapping-field": ee = "zone",
|
|
44
|
+
"data-map-label-field": ae = "admin",
|
|
45
|
+
"data-has-multiple-measures": w = "false",
|
|
46
|
+
topoJSONField: oe = "collection",
|
|
47
|
+
"data-map-center": te = "NGA",
|
|
47
48
|
//country
|
|
48
49
|
"data-map-label-show-value": F = "false",
|
|
49
|
-
"data-show-tooltip":
|
|
50
|
-
"data-measure-selector-label":
|
|
51
|
-
"data-value-format":
|
|
52
|
-
"data-show-overall-value":
|
|
53
|
-
"data-auto-generate-breaks":
|
|
54
|
-
"data-number-of-breaks":
|
|
55
|
-
"data-scheme":
|
|
56
|
-
"data-show-no-data-label":
|
|
57
|
-
"data-group":
|
|
58
|
-
"data-map-symbols":
|
|
59
|
-
"data-tooltip-theme":
|
|
60
|
-
"data-label-font-size":
|
|
61
|
-
"data-label-font-weight":
|
|
62
|
-
"data-label-font-color":
|
|
63
|
-
"data-legend-font-size":
|
|
64
|
-
"data-legend-font-weight":
|
|
65
|
-
"data-custom-tooltips":
|
|
66
|
-
"data-format-style":
|
|
67
|
-
"data-decimals":
|
|
68
|
-
"data-currency":
|
|
69
|
-
"data-tooltip-font-size":
|
|
70
|
-
"data-show-admin-unit-label":
|
|
71
|
-
"data-map-no-data-color":
|
|
72
|
-
"data-map-boundary-color":
|
|
73
|
-
"data-map-focus-boundary-color":
|
|
74
|
-
"data-highlighted-location":
|
|
75
|
-
"data-tooltip-format":
|
|
50
|
+
"data-show-tooltip": S = "true",
|
|
51
|
+
"data-measure-selector-label": le = "",
|
|
52
|
+
"data-value-format": re = "",
|
|
53
|
+
"data-show-overall-value": D = "false",
|
|
54
|
+
"data-auto-generate-breaks": I = "false",
|
|
55
|
+
"data-number-of-breaks": ne = 5,
|
|
56
|
+
"data-scheme": se = "reds",
|
|
57
|
+
"data-show-no-data-label": N = "false",
|
|
58
|
+
"data-group": z = "default",
|
|
59
|
+
"data-map-symbols": ie = "[]",
|
|
60
|
+
"data-tooltip-theme": de = "map-tooltip-dark",
|
|
61
|
+
"data-label-font-size": me = 12,
|
|
62
|
+
"data-label-font-weight": ce = "normal",
|
|
63
|
+
"data-label-font-color": ue = "#595959",
|
|
64
|
+
"data-legend-font-size": pe = 12,
|
|
65
|
+
"data-legend-font-weight": fe = "normal",
|
|
66
|
+
"data-custom-tooltips": ge = "[]",
|
|
67
|
+
"data-format-style": b = "decimal",
|
|
68
|
+
"data-decimals": T = "2",
|
|
69
|
+
"data-currency": he = "",
|
|
70
|
+
"data-tooltip-font-size": be = 14,
|
|
71
|
+
"data-show-admin-unit-label": Ce = "showAll",
|
|
72
|
+
"data-map-no-data-color": ve = "#f8f8f8",
|
|
73
|
+
"data-map-boundary-color": ye = "#000",
|
|
74
|
+
"data-map-focus-boundary-color": Le = "#000",
|
|
75
|
+
"data-highlighted-location": we = "",
|
|
76
|
+
"data-tooltip-format": Fe = `{locationName} %({value},2)
|
|
76
77
|
{label}: %({value},2)`,
|
|
77
|
-
"data-show-no-data-tooltip":
|
|
78
|
-
"data-map-container-bg-color":
|
|
79
|
-
"data-map-position":
|
|
80
|
-
"data-main-layer-id":
|
|
81
|
-
"data-enabled-layers":
|
|
82
|
-
"data-point-label-color":
|
|
83
|
-
"data-point-label-format":
|
|
84
|
-
"data-show-no-data-legend-item":
|
|
85
|
-
"data-highlighted-loc-label-format":
|
|
86
|
-
"data-enable-summary-view":
|
|
87
|
-
"data-map-type":
|
|
88
|
-
"data-default-point-color":
|
|
89
|
-
"data-aggregation-formula":
|
|
90
|
-
"data-zoom-level-to-show-points":
|
|
78
|
+
"data-show-no-data-tooltip": x = "false",
|
|
79
|
+
"data-map-container-bg-color": Se = "#fff",
|
|
80
|
+
"data-map-position": De = "{}",
|
|
81
|
+
"data-main-layer-id": Ie = "",
|
|
82
|
+
"data-enabled-layers": Ne,
|
|
83
|
+
"data-point-label-color": ze = "#fff",
|
|
84
|
+
"data-point-label-format": Te = "{locationName} %({value},2)",
|
|
85
|
+
"data-show-no-data-legend-item": A = !1,
|
|
86
|
+
"data-highlighted-loc-label-format": xe = "{locationName} - Score: #({value},2)",
|
|
87
|
+
"data-enable-summary-view": fa = "false",
|
|
88
|
+
"data-map-type": B = "DEFAULT",
|
|
89
|
+
"data-default-point-color": Ae = "#FFFF00",
|
|
90
|
+
"data-aggregation-formula": Be = "COUNT",
|
|
91
|
+
"data-zoom-level-to-show-points": Ue = 2,
|
|
91
92
|
"data-zoom-on-filter": U = "false",
|
|
92
|
-
"data-zoom-on-filter-field":
|
|
93
|
-
"data-no-data-text":
|
|
94
|
-
"data-labels-exclusion-list":
|
|
95
|
-
"data-custom-measure-labels":
|
|
96
|
-
"data-show-shading-layer-labels":
|
|
97
|
-
"data-dvz-proxy-dataset-id":
|
|
98
|
-
"data-recently-toggled-layer-id":
|
|
99
|
-
intl:
|
|
100
|
-
settings:
|
|
101
|
-
} =
|
|
102
|
-
console.log("MapWrapper props",
|
|
103
|
-
const
|
|
93
|
+
"data-zoom-on-filter-field": Pe = "",
|
|
94
|
+
"data-no-data-text": Re = "No Data",
|
|
95
|
+
"data-labels-exclusion-list": Ee = "",
|
|
96
|
+
"data-custom-measure-labels": Me = "{}",
|
|
97
|
+
"data-show-shading-layer-labels": Ve = "ifUnitHasData",
|
|
98
|
+
"data-dvz-proxy-dataset-id": n,
|
|
99
|
+
"data-recently-toggled-layer-id": ke = null,
|
|
100
|
+
intl: ga,
|
|
101
|
+
settings: ha
|
|
102
|
+
} = s;
|
|
103
|
+
console.log("MapWrapper props", s);
|
|
104
|
+
const Oe = (e) => u ? e : decodeURIComponent(e), P = (e) => e == null ? "" : String(e).trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, ""), We = (e, a) => {
|
|
105
|
+
if (!e || !a)
|
|
106
|
+
return;
|
|
107
|
+
if (Object.prototype.hasOwnProperty.call(e, a))
|
|
108
|
+
return e[a];
|
|
109
|
+
const o = P(a), r = Object.keys(e).find((k) => P(k) === o);
|
|
110
|
+
return r ? e[r] : void 0;
|
|
111
|
+
}, l = (e) => {
|
|
104
112
|
try {
|
|
105
113
|
if (e)
|
|
106
|
-
return JSON.parse(
|
|
114
|
+
return JSON.parse(Oe(e));
|
|
107
115
|
} catch {
|
|
108
116
|
console.error("error parsing value:" + e);
|
|
109
117
|
}
|
|
110
118
|
return null;
|
|
111
|
-
},
|
|
112
|
-
let
|
|
113
|
-
return
|
|
114
|
-
},
|
|
115
|
-
const
|
|
116
|
-
let
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
}) :
|
|
120
|
-
},
|
|
121
|
-
style:
|
|
122
|
-
notation:
|
|
123
|
-
currency:
|
|
124
|
-
minimumFractionDigits: parseInt(
|
|
125
|
-
maximumFractionDigits: parseInt(
|
|
119
|
+
}, Ge = (e) => {
|
|
120
|
+
let a = l(e) || [];
|
|
121
|
+
return a = a.map((o) => (o.min && (o.min = parseFloat(o.min)), o.max && (o.max = parseFloat(o.max)), o.color = decodeURIComponent(o.color), o)), a;
|
|
122
|
+
}, Je = (e) => {
|
|
123
|
+
const a = l(e) || [];
|
|
124
|
+
let o = {};
|
|
125
|
+
return a && a.forEach ? a.forEach((r) => {
|
|
126
|
+
(Array.isArray(r.value) ? r.value : [r.value]).filter((O) => O != null && O.toString().trim() != "").length > 0 && (o[r.param] = r.value);
|
|
127
|
+
}) : o = a, o;
|
|
128
|
+
}, Ze = {
|
|
129
|
+
style: b === "compacted" ? "decimal" : b,
|
|
130
|
+
notation: b === "compacted" ? "compact" : "standard",
|
|
131
|
+
currency: he,
|
|
132
|
+
minimumFractionDigits: parseInt(T),
|
|
133
|
+
maximumFractionDigits: parseInt(T)
|
|
126
134
|
};
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
let
|
|
131
|
-
const
|
|
132
|
-
unique:
|
|
133
|
-
editing:
|
|
134
|
-
source: `/${
|
|
135
|
-
center:
|
|
136
|
-
scale:
|
|
137
|
-
measures:
|
|
138
|
-
legendTitle:
|
|
139
|
-
height:
|
|
140
|
-
width:
|
|
141
|
-
topoJSONField:
|
|
142
|
-
mappingField:
|
|
143
|
-
dataSourceText:
|
|
144
|
-
dataSourceLabel:
|
|
145
|
-
nationalAverageLabel:
|
|
146
|
-
legendBreaks:
|
|
147
|
-
mapLabelField:
|
|
148
|
-
zoomEnabled:
|
|
149
|
-
showLegendLabels:
|
|
150
|
-
multipleMeasures:
|
|
151
|
-
app:
|
|
135
|
+
let C = l(Ne) || [];
|
|
136
|
+
C = C.map((e) => (e.bgColor = decodeURIComponent(e.bgColor), e.fontColor = decodeURIComponent(e.fontColor), e));
|
|
137
|
+
const R = da.find((e) => e.value === te), E = w == !0 || w == "true";
|
|
138
|
+
let i = [J, Z].filter((e) => e !== "none" && e !== null).join("/");
|
|
139
|
+
const d = g && g !== "none" ? g : null, p = {
|
|
140
|
+
unique: f,
|
|
141
|
+
editing: u,
|
|
142
|
+
source: `/${X}`,
|
|
143
|
+
center: R.center,
|
|
144
|
+
scale: R.scale,
|
|
145
|
+
measures: h,
|
|
146
|
+
legendTitle: Y,
|
|
147
|
+
height: j,
|
|
148
|
+
width: H,
|
|
149
|
+
topoJSONField: oe,
|
|
150
|
+
mappingField: ee,
|
|
151
|
+
dataSourceText: K,
|
|
152
|
+
dataSourceLabel: $,
|
|
153
|
+
nationalAverageLabel: q,
|
|
154
|
+
legendBreaks: Ge(Q),
|
|
155
|
+
mapLabelField: ae,
|
|
156
|
+
zoomEnabled: y == !0 || y == "true",
|
|
157
|
+
showLegendLabels: L == !0 || L == "true",
|
|
158
|
+
multipleMeasures: E,
|
|
159
|
+
app: t,
|
|
152
160
|
mapLabelShowValue: F == !0 || F == "true",
|
|
153
|
-
showTooltip:
|
|
154
|
-
showOverallValue:
|
|
155
|
-
measureSelectorLabel:
|
|
156
|
-
valueFormat:
|
|
157
|
-
autoGenerateBreaks:
|
|
158
|
-
showNoDataLabel:
|
|
159
|
-
numberOfBreaks:
|
|
160
|
-
colorScheme:
|
|
161
|
-
group:
|
|
162
|
-
symbols: l(
|
|
163
|
-
tooltipTheme:
|
|
164
|
-
labelFontSize:
|
|
165
|
-
labelFontColor: decodeURIComponent(
|
|
166
|
-
labelFontWeight:
|
|
167
|
-
legendFontSize:
|
|
168
|
-
legendFontWeight:
|
|
169
|
-
customTooltips: l(
|
|
170
|
-
format:
|
|
171
|
-
tooltipFontSize:
|
|
172
|
-
showAdminUnitLabel:
|
|
173
|
-
mapNoDataColor: decodeURIComponent(
|
|
174
|
-
mapBoundaryColor: decodeURIComponent(
|
|
175
|
-
mapFocusBoundaryColor: decodeURIComponent(
|
|
176
|
-
highlightedLocation:
|
|
177
|
-
tooltipFormat:
|
|
178
|
-
showNoDataTooltip:
|
|
179
|
-
fields:
|
|
180
|
-
mapContainerBgColor: decodeURIComponent(
|
|
181
|
-
mapPosition: l(
|
|
182
|
-
mainLayerId:
|
|
183
|
-
enabledLayers:
|
|
184
|
-
pointLabelColor: decodeURIComponent(
|
|
185
|
-
pointLabelFormat:
|
|
186
|
-
showNoDataLegendItem:
|
|
187
|
-
highlightedLocLabelFormat:
|
|
188
|
-
mapType:
|
|
189
|
-
defaultPointColor: decodeURIComponent(
|
|
190
|
-
zoomLevelToShowPoints:
|
|
161
|
+
showTooltip: S == !0 || S == "true",
|
|
162
|
+
showOverallValue: D == !0 || D == "true",
|
|
163
|
+
measureSelectorLabel: le,
|
|
164
|
+
valueFormat: re,
|
|
165
|
+
autoGenerateBreaks: I == !0 || I == "true",
|
|
166
|
+
showNoDataLabel: N == !0 || N == "true",
|
|
167
|
+
numberOfBreaks: ne,
|
|
168
|
+
colorScheme: se,
|
|
169
|
+
group: z,
|
|
170
|
+
symbols: l(ie) || [],
|
|
171
|
+
tooltipTheme: de,
|
|
172
|
+
labelFontSize: me,
|
|
173
|
+
labelFontColor: decodeURIComponent(ue),
|
|
174
|
+
labelFontWeight: ce,
|
|
175
|
+
legendFontSize: pe,
|
|
176
|
+
legendFontWeight: fe,
|
|
177
|
+
customTooltips: l(ge) || [],
|
|
178
|
+
format: Ze,
|
|
179
|
+
tooltipFontSize: be,
|
|
180
|
+
showAdminUnitLabel: Ce,
|
|
181
|
+
mapNoDataColor: decodeURIComponent(ve),
|
|
182
|
+
mapBoundaryColor: decodeURIComponent(ye),
|
|
183
|
+
mapFocusBoundaryColor: decodeURIComponent(Le),
|
|
184
|
+
highlightedLocation: we,
|
|
185
|
+
tooltipFormat: Fe,
|
|
186
|
+
showNoDataTooltip: x == !0 || x == "true",
|
|
187
|
+
fields: i.split("/"),
|
|
188
|
+
mapContainerBgColor: decodeURIComponent(Se),
|
|
189
|
+
mapPosition: l(De),
|
|
190
|
+
mainLayerId: Ie,
|
|
191
|
+
enabledLayers: C,
|
|
192
|
+
pointLabelColor: decodeURIComponent(ze),
|
|
193
|
+
pointLabelFormat: Te,
|
|
194
|
+
showNoDataLegendItem: A == !0 || A == "true",
|
|
195
|
+
highlightedLocLabelFormat: xe,
|
|
196
|
+
mapType: B,
|
|
197
|
+
defaultPointColor: decodeURIComponent(Ae),
|
|
198
|
+
zoomLevelToShowPoints: Ue,
|
|
191
199
|
zoomOnFilter: U == !0 || U == "true",
|
|
192
|
-
zoomOnFilterField:
|
|
193
|
-
noDataText:
|
|
194
|
-
labelsExclusionList:
|
|
195
|
-
showShadingLayerLabels:
|
|
196
|
-
dvzProxyDatasetId:
|
|
197
|
-
recentlyToggledLayerId:
|
|
200
|
+
zoomOnFilterField: Pe,
|
|
201
|
+
noDataText: Re,
|
|
202
|
+
labelsExclusionList: Ee.split(",").map((e) => e.trim()),
|
|
203
|
+
showShadingLayerLabels: Ve,
|
|
204
|
+
dvzProxyDatasetId: n,
|
|
205
|
+
recentlyToggledLayerId: ke
|
|
198
206
|
};
|
|
199
|
-
if (
|
|
200
|
-
const e =
|
|
201
|
-
e && (e != null && e.apiField) && (
|
|
207
|
+
if (p.recentlyToggledLayerId) {
|
|
208
|
+
const e = p.enabledLayers.find((a) => String(a.id) === String(p.recentlyToggledLayerId));
|
|
209
|
+
e && (e != null && e.apiField) && (i = (V = e.apiField) == null ? void 0 : V.toLowerCase());
|
|
202
210
|
}
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
const _e = l(Me) || {}, je = t === "csv" ? ia : sa, He = u ? (l(h) || []).join(",") : h, m = Je(W);
|
|
212
|
+
if (d) {
|
|
213
|
+
const e = We(m, d);
|
|
214
|
+
e != null && e !== "" && (m[d] = e);
|
|
215
|
+
}
|
|
216
|
+
const Ke = (l(_) || []).filter((e) => e && e !== "none"), M = Array.from(new Set([d, ...Ke].filter(Boolean)));
|
|
217
|
+
M.length > 0 && (m.includeColumns = M.join(",")), n && (m.dvzProxyDatasetId = n);
|
|
218
|
+
const $e = aa(), qe = ["data", "categories", t, ...n ? [n] : [], "items"], v = oa((e) => e.getIn(qe)), Ye = Qe(() => v ? v.toJS() : [], [v]);
|
|
219
|
+
return Xe(() => {
|
|
220
|
+
t && t !== "csv" && $e(ra({ app: t, dvzProxyDatasetId: n }));
|
|
221
|
+
}, [t, n]), /* @__PURE__ */ c(
|
|
222
|
+
ta,
|
|
210
223
|
{
|
|
211
|
-
params:
|
|
212
|
-
app:
|
|
213
|
-
csv: decodeURIComponent(
|
|
214
|
-
group:
|
|
215
|
-
editing:
|
|
216
|
-
store: [
|
|
217
|
-
source:
|
|
218
|
-
children: /* @__PURE__ */
|
|
219
|
-
|
|
224
|
+
params: m,
|
|
225
|
+
app: t,
|
|
226
|
+
csv: decodeURIComponent(G),
|
|
227
|
+
group: z,
|
|
228
|
+
editing: u,
|
|
229
|
+
store: [t, f, ...i.split("/")],
|
|
230
|
+
source: i,
|
|
231
|
+
children: /* @__PURE__ */ c(la, { children: /* @__PURE__ */ c(
|
|
232
|
+
je,
|
|
220
233
|
{
|
|
221
|
-
measures:
|
|
222
|
-
multipleMeasures:
|
|
223
|
-
mapType:
|
|
224
|
-
aggregationFormula:
|
|
225
|
-
customMeasureLabels:
|
|
226
|
-
source:
|
|
227
|
-
extraDimension:
|
|
228
|
-
allDimensions:
|
|
229
|
-
children: /* @__PURE__ */
|
|
234
|
+
measures: He,
|
|
235
|
+
multipleMeasures: E,
|
|
236
|
+
mapType: B,
|
|
237
|
+
aggregationFormula: Be,
|
|
238
|
+
customMeasureLabels: _e,
|
|
239
|
+
source: i,
|
|
240
|
+
extraDimension: d,
|
|
241
|
+
allDimensions: Ye,
|
|
242
|
+
children: /* @__PURE__ */ c(na, { ...p })
|
|
230
243
|
}
|
|
231
244
|
) })
|
|
232
245
|
}
|
|
233
246
|
);
|
|
234
|
-
},
|
|
235
|
-
},
|
|
247
|
+
}, ua = (s, f) => {
|
|
248
|
+
}, pa = {}, za = ea(ua, pa)(ma);
|
|
236
249
|
export {
|
|
237
|
-
|
|
250
|
+
za as default
|
|
238
251
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { jsx as e, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import y, { useState as v, useRef as
|
|
3
|
-
import { Container as
|
|
4
|
-
import { PostProvider as
|
|
2
|
+
import y, { useState as v, useRef as V, useEffect as I } from "react";
|
|
3
|
+
import { Container as f, Accordion as p, Icon as W, Menu as T, Grid as w, Label as M, Button as q } from "semantic-ui-react";
|
|
4
|
+
import { PostProvider as z, PostConsumer as N, MediaProvider as P, MediaConsumer as A, PostIcon as k, PostLabel as L } from "@devgateway/wp-react-lib";
|
|
5
5
|
import { injectIntl as E } from "react-intl";
|
|
6
|
-
import { connect as
|
|
7
|
-
import
|
|
8
|
-
import { useWindowDimensionsAndDevice as
|
|
9
|
-
import { parse as U } from "../utils/parseUtils.js";
|
|
6
|
+
import { connect as O } from "react-redux";
|
|
7
|
+
import S from "../connected-templates/PostIntro.js";
|
|
8
|
+
import { useWindowDimensionsAndDevice as U } from "../../lib/hooks/window-dimensions.js";
|
|
10
9
|
const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.map((l) => /* @__PURE__ */ e(
|
|
11
10
|
T.Item,
|
|
12
11
|
{
|
|
13
12
|
onClick: () => i(l.slug),
|
|
14
13
|
className: l.slug === c ? "active" : "",
|
|
15
|
-
children: n ? /* @__PURE__ */ e(
|
|
14
|
+
children: n ? /* @__PURE__ */ e(L, { post: l }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: l.title.rendered } }) })
|
|
16
15
|
},
|
|
17
16
|
l.id
|
|
18
17
|
)) : null, J = ({
|
|
@@ -30,7 +29,7 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
30
29
|
{
|
|
31
30
|
className: (r.slug === c ? "active" : "") + (n ? " has-icon" : ""),
|
|
32
31
|
children: /* @__PURE__ */ g(
|
|
33
|
-
|
|
32
|
+
q,
|
|
34
33
|
{
|
|
35
34
|
onClick: () => i(r.slug),
|
|
36
35
|
className: `nav ${o === 1 ? "one" : ""}`,
|
|
@@ -39,10 +38,10 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
39
38
|
P,
|
|
40
39
|
{
|
|
41
40
|
id: (m = r.meta_fields) != null && m.icon ? r.meta_fields.icon[0] : null,
|
|
42
|
-
children: /* @__PURE__ */ e(
|
|
41
|
+
children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(k, { className: "icon" }) })
|
|
43
42
|
}
|
|
44
43
|
),
|
|
45
|
-
l ? /* @__PURE__ */ e(
|
|
44
|
+
l ? /* @__PURE__ */ e(L, { post: r }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
|
46
45
|
"span",
|
|
47
46
|
{
|
|
48
47
|
dangerouslySetInnerHTML: { __html: r.title.rendered }
|
|
@@ -71,11 +70,11 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
71
70
|
visibility: "visible",
|
|
72
71
|
position: "relative",
|
|
73
72
|
width: "auto"
|
|
74
|
-
}, /* @__PURE__ */ e(
|
|
73
|
+
}, /* @__PURE__ */ e(S, { as: f, fluid: !0, post: i, style: n }, i.slug);
|
|
75
74
|
}) : null), K = ({ posts: t, activeItem: c, setActive: i }) => {
|
|
76
75
|
const [n, l] = v(
|
|
77
76
|
t.findIndex((s) => s.slug === c)
|
|
78
|
-
), [o, r] = v(null), d =
|
|
77
|
+
), [o, r] = v(null), d = V(null);
|
|
79
78
|
I(() => {
|
|
80
79
|
if (o) {
|
|
81
80
|
const s = o.getBoundingClientRect().top + window.scrollY;
|
|
@@ -110,7 +109,7 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
110
109
|
},
|
|
111
110
|
children: [
|
|
112
111
|
/* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center" }, children: [
|
|
113
|
-
a && /* @__PURE__ */ e(P, { id: a, children: /* @__PURE__ */ e(
|
|
112
|
+
a && /* @__PURE__ */ e(P, { id: a, children: /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(k, { className: "icon" }) }) }),
|
|
114
113
|
/* @__PURE__ */ e(
|
|
115
114
|
"span",
|
|
116
115
|
{
|
|
@@ -119,7 +118,7 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
119
118
|
}
|
|
120
119
|
)
|
|
121
120
|
] }),
|
|
122
|
-
/* @__PURE__ */ e(
|
|
121
|
+
/* @__PURE__ */ e(W, { name: "chevron down" })
|
|
123
122
|
]
|
|
124
123
|
}
|
|
125
124
|
)
|
|
@@ -130,7 +129,7 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
130
129
|
{
|
|
131
130
|
className: "accordion-post-content",
|
|
132
131
|
active: n === u,
|
|
133
|
-
children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(
|
|
132
|
+
children: /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ e(S, { post: s, as: f, fluid: !0 }) })
|
|
134
133
|
}
|
|
135
134
|
)
|
|
136
135
|
] }, s.id);
|
|
@@ -147,13 +146,13 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
147
146
|
}, [t]), /* @__PURE__ */ g(y.Fragment, { children: [
|
|
148
147
|
t.map((o) => /* @__PURE__ */ e("anchor", { id: o.slug }, o.slug)),
|
|
149
148
|
/* @__PURE__ */ e(T, { className: "tabbed posts", text: !0, children: /* @__PURE__ */ e(Y, { showLabels: c, posts: t, setActive: l, activeItem: n }) }),
|
|
150
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(f, { className: "content-tab", style: { height: `${i}px` }, children: /* @__PURE__ */ e($, { posts: t, activeItem: n }) })
|
|
151
150
|
] });
|
|
152
151
|
}, X = ({ posts: t, showLabels: c, showIcons: i, height: n }) => {
|
|
153
152
|
const [l, o] = v(t ? t[0].slug : null);
|
|
154
153
|
return /* @__PURE__ */ e(y.Fragment, { children: /* @__PURE__ */ g(w, { stackable: !0, className: "tabbed posts", columns: t.length, style: { height: n + "px" }, children: [
|
|
155
154
|
/* @__PURE__ */ e(J, { showIcons: i, showLabels: c, posts: t, activeItem: l, setActive: o }),
|
|
156
|
-
/* @__PURE__ */ e(w.Row, { style: { height: `${n}px` }, children: /* @__PURE__ */ e(w.Column, { width: 16, className: "content", children: /* @__PURE__ */ e(
|
|
155
|
+
/* @__PURE__ */ e(w.Row, { style: { height: `${n}px` }, children: /* @__PURE__ */ e(w.Column, { width: 16, className: "content", children: /* @__PURE__ */ e(f, { className: "content-tab", style: { height: `${n}px` }, children: /* @__PURE__ */ e($, { className: "content-tab", posts: t, activeItem: l }) }) }) })
|
|
157
156
|
] }) });
|
|
158
157
|
}, Z = (t) => {
|
|
159
158
|
var _;
|
|
@@ -170,22 +169,22 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
170
169
|
"data-preview-mode": u = "Desktop",
|
|
171
170
|
pageModuleProps: a,
|
|
172
171
|
parent: h,
|
|
173
|
-
editing:
|
|
174
|
-
unique:
|
|
172
|
+
editing: b,
|
|
173
|
+
unique: j
|
|
175
174
|
} = t;
|
|
176
|
-
a != null && a.previewMode && (a != null && a.editing) && (u = a.previewMode,
|
|
177
|
-
const
|
|
178
|
-
return /* @__PURE__ */ e(
|
|
179
|
-
|
|
175
|
+
a != null && a.previewMode && (a != null && a.editing) && (u = a.previewMode, b = a.editing);
|
|
176
|
+
const D = t.intl.locale, R = Array.isArray(n) ? n.join(",") : n, x = d === "true", C = x ? s : void 0, { width: H } = U(), B = H <= 1024, F = u !== "Desktop" && b, G = B && !b;
|
|
177
|
+
return /* @__PURE__ */ e(f, { className: `viz tabbed posts ${b ? "editing" : ""} ${x ? "scrollable" : ""}`, fluid: !0, children: /* @__PURE__ */ e(
|
|
178
|
+
z,
|
|
180
179
|
{
|
|
181
|
-
locale:
|
|
180
|
+
locale: D,
|
|
182
181
|
type: c,
|
|
183
182
|
taxonomy: i,
|
|
184
|
-
categories:
|
|
185
|
-
store: `tabbedposts_${h}_${
|
|
183
|
+
categories: R,
|
|
184
|
+
store: `tabbedposts_${h}_${j}`,
|
|
186
185
|
page: 1,
|
|
187
186
|
perPage: l,
|
|
188
|
-
children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(N, { children:
|
|
187
|
+
children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(N, { children: G || F ? /* @__PURE__ */ e(K, { posts: l, activeItem: (_ = l[0]) == null ? void 0 : _.slug, setActive: () => {
|
|
189
188
|
} }) : o === "light" ? /* @__PURE__ */ e(Q, { height: C, showLabels: m === "true" }) : /* @__PURE__ */ e(
|
|
190
189
|
X,
|
|
191
190
|
{
|
|
@@ -202,7 +201,7 @@ const Y = ({ posts: t, activeItem: c, setActive: i, showLabels: n }) => t ? t.ma
|
|
|
202
201
|
"pageModuleProps"
|
|
203
202
|
]), n = {};
|
|
204
203
|
return i && (n.pageModuleProps = i), n;
|
|
205
|
-
}, te = {},
|
|
204
|
+
}, te = {}, de = O(ee, te)(E(Z));
|
|
206
205
|
export {
|
|
207
|
-
|
|
206
|
+
de as default
|
|
208
207
|
};
|