@devgateway/dvz-ui-react 1.7.3 → 1.7.5
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/filtered-posts/NoData.js +2 -2
- package/dist/cjs/embeddable/filtered-posts/index.js +1 -1
- package/dist/cjs/embeddable/posts-filter/CategoricalFilter.js +1 -1
- package/dist/cjs/embeddable/posts-filter/index.js +1 -1
- package/dist/cjs/embeddable/posts-pagination/index.js +1 -1
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/esm/embeddable/filtered-posts/NoData.js +13 -14
- package/dist/esm/embeddable/filtered-posts/index.js +89 -84
- package/dist/esm/embeddable/posts-filter/CategoricalFilter.js +56 -53
- package/dist/esm/embeddable/posts-filter/index.js +139 -148
- package/dist/esm/embeddable/posts-pagination/index.js +41 -35
- package/dist/esm/embeddable/reducers/data-api.js +46 -45
- package/dist/esm/embeddable/reducers/data.js +108 -96
- package/dist/types/embeddable/filtered-posts/NoData.d.ts +1 -0
- package/dist/types/embeddable/filtered-posts/index.d.ts +4 -0
- package/dist/types/embeddable/filtered-posts/utils.d.ts +2 -1
- package/dist/types/embeddable/posts-filter/CategoricalFilter.d.ts +1 -0
- package/dist/types/embeddable/posts-filter/index.d.ts +2 -0
- package/dist/types/embeddable/reducers/data-api.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("../../redux/hooks.js"),t=require("semantic-ui-react"),d=require("../reducers/data.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),n=require("../../redux/hooks.js"),t=require("semantic-ui-react"),d=require("../reducers/data.js"),g=a=>{const{noDataMsg:l,clearFilterMsg:i,editing:p,group:s}=a,r=n.useAppDispatch(),o=n.useAppSelector(c=>c.getIn(["data","posts","initialFilters",s])),u=c=>{c.preventDefault(),d.clearPostsFilter({group:s,dispatch:r,initialFilters:o})};return e.jsxs(t.Segment,{placeholder:!0,className:"chartNoDataMessage",children:[e.jsxs(t.Header,{icon:!0,children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"noDataSVG",viewBox:"0 0 512 512",children:e.jsx("path",{d:`M403.7,96.3c-41-41-95.6-63.6-153.7-63.6c-58,0-112.6,22.6-153.7,63.6c-41,41-63.6,95.6-63.6,153.7
|
|
2
2
|
c0,58,22.6,112.6,63.6,153.7c41,41,95.6,63.6,153.7,63.6c58,0,112.6-22.6,153.7-63.6c41-41,63.7-95.6,63.7-153.7
|
|
3
3
|
C467.3,192,444.7,137.4,403.7,96.3z M57.7,250C57.7,144,144,57.7,250,57.7c37.2,0,72,10.6,101.5,29l-63,77.1c-2.8-3.5-6-6.8-9.5-10
|
|
4
4
|
c-18.2-16.7-39.9-24.5-65.1-23.5c-25.2,1.1-46.2,10.7-62.9,28.9c-16.7,18.2-24.5,39.9-23.5,65.1c1.1,25.2,10.7,46.2,28.9,62.9
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
c4,3.7,7.3,7.6,10.1,11.8L194.6,278.8z M250,442.3c-46,0-88.2-16.2-121.3-43.2l73.1-89.5c6.4,1,13,1.4,19.9,1.1
|
|
9
9
|
c10.2-0.4,19.7-2.5,28.6-6.1c8.9-3.6,16.7-8.4,23.4-14.2l81,74.4c2.6,2.4,6,3.6,9.3,3.6c3.7,0,7.4-1.5,10.1-4.5
|
|
10
10
|
c5.1-5.6,4.8-14.3-0.8-19.4l-81-74.4c5.3-7.2,9.3-15.3,12.2-24.5c2.8-9.2,4.1-18.8,3.6-29c-0.5-10.7-2.5-20.6-6-29.8l69.8-85.5
|
|
11
|
-
c43,35.3,70.5,88.8,70.5,148.7C442.3,356,356,442.3,250,442.3z`})}),
|
|
11
|
+
c43,35.3,70.5,88.8,70.5,148.7C442.3,356,356,442.3,250,442.3z`})}),e.jsx("div",{className:"WPnoDataMsg",children:l})]}),e.jsx(t.Button,{size:"medium",onClick:c=>u(c),children:i||"Clear Filter"})]})};exports.default=g;
|
|
@@ -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 a=require("react/jsx-runtime"),y=require("react"),p=require("semantic-ui-react"),rt=require("../connected-templates/PostIntro.js"),ot=require("react-intl"),Y=require("./utils.js"),nt=require("./NoData.js"),B=require("react-redux"),st=require("../reducers/data-api.js"),at=require("react-router"),H=require("../../utils/data.js"),it=T=>{const{posts:l,numberOfColumns:w,sortFirstBy:u,countryCategory:c,postWidth:b,postHeight:A}=T,g=[];if(c&&u&&u!=="none"){const d=l.filter(h=>h[c].includes(Number(u))),N=l.filter(h=>!h[c].includes(Number(u)));g.push(...d),g.push(...N)}else g.push(...l);return a.jsx(p.Grid,{className:"filtered-posts",columns:w,children:a.jsx(p.GridRow,{children:g.map(d=>a.jsx(p.Grid.Column,{children:a.jsx("div",{className:"filtered-posts-column",style:{width:b,height:A,overflow:"hidden"},children:a.jsx(rt.default,{style:{width:"100%",height:"100%",overflow:"hidden",margin:0,padding:0},as:p.Container,fluid:!0,post:d},d.id)})},d.id))})})},lt=T=>{const{"data-group":l,"data-number-of-columns":w,"data-type":u,"data-taxonomy":c,"data-categories":b="[]","data-height":A,"data-post-width":g,"data-post-height":d,"data-number-of-items-per-page":N,"data-enable-sorting":h,"data-sort-first-by":q,"data-sorting-taxonomy":R,"data-wordpress-source-type":ct,"data-wordpress-source":V,"data-no-data-msg":z,"data-clear-filter-msg":W,editing:J}=T,L=B.useDispatch(),{locale:U}=at.useParams(),[I,v]=y.useState(!1),O=B.useSelector(t=>t).getIn(["data","posts",l]),[C,S]=y.useState([]),D=y.useRef(null),[E,_]=y.useState(void 0),$=H.toBoolean(h)&&q!=="none"?H.toNumber(q):null,f=O??{yearFilter:null,categoryFilter:null,countryFilter:null,page:1,countryTaxonomy:null,categoryTaxonomy:null},F=t=>{if(t==null)return{values:[],isExplicitNone:!1};const e=Array.isArray(t)?t:[t],s=e.some(r=>Number(r)===Number.MIN_SAFE_INTEGER);return{values:e.map(r=>Number(r)).filter(r=>Number.isFinite(r)&&r!==Number.MIN_SAFE_INTEGER),isExplicitNone:s}},k=t=>{if(!t||t.length===0)return null;const e=Array.from(new Set(t)).sort((P,j)=>P-j);if(e.length===0)return null;const s=e[0],o=e[e.length-1],r=Y.getStartDateAndEndDateFromYear(s),n=Y.getStartDateAndEndDateFromYear(o);return!(r!=null&&r.startDate)||!(n!=null&&n.endDate)?null:{startDate:r.startDate,endDate:n.endDate}},K=()=>{const t=F(f.yearFilter),e=t.isExplicitNone?null:k(t.values),s=f.countryFilter??null,o=f.categoryFilter??null,r=f.categoryTaxonomy||(c&&c!=="none"?c:null),n=f.countryTaxonomy||null;return{before:(e==null?void 0:e.endDate)||null,after:(e==null?void 0:e.startDate)||null,categoryFilter:o,categoryTaxonomy:r,countryFilter:s,countryTaxonomy:n}},M=t=>J?t:decodeURIComponent(t),Q=t=>{try{return JSON.parse(M(t))}catch(e){return console.warn("JSON parsing failed for value:",t,"- treating as plain string. Error:",e),M(t)}},X=()=>{const t=Q(b);return t?typeof t=="string"?t.split(",").map(Number):typeof t=="number"?[t]:t:[]},Z=(t,e,s)=>{if(s)return null;if(t.length===0)return e.length>0?e:null;if(e.length===0)return t;const o=new Set(t),r=e.filter(n=>o.has(n));return r.length>0?r:null},tt=async()=>{D.current&&_(D.current.offsetHeight),v(!0);const t=K(),e=F(X()).values,s=F(t.categoryFilter),o=Z(e,s.values,s.isExplicitNone),r=F(t.countryFilter);if(s.isExplicitNone){S([]),v(!1);return}if(r.isExplicitNone){S([]),v(!1);return}const n=new Map;t.categoryTaxonomy&&o&&o.length>0&&n.set(t.categoryTaxonomy,o),t.countryTaxonomy&&r.values.length>0&&n.set(t.countryTaxonomy,r.values);const P=o?o.join(","):void 0,j={after:t.after,before:t.before,perPage:Number(N||10),page:f.page||1,locale:U||"en",postType:u,taxonomy:t.categoryTaxonomy||void 0,category:P||void 0,taxonomyFilters:n,ordering:"date",orderingDirection:"desc",wpApiBase:V??void 0};await st.getCustomPosts(j).then(i=>{if(i){let x=null,m=null;if(i&&typeof i=="object"&&"data"in i?(x=i.data,m=i.meta):(Array.isArray(i),x=i),S(Array.isArray(x)?x:[]),m){const G=m["x-wp-totalpages"]?m["x-wp-totalpages"]:1,et=m["x-wp-total"]?m["x-wp-total"]:0;G&&L({type:"SET_POSTS_PAGINATION",group:l,totalPages:Number(G),totalItems:Number(et)})}}else S([])}).finally(()=>{v(!1),_(void 0)})};return y.useEffect(()=>{u&&(async()=>await tt())()},[O,u,c,N,b,R]),a.jsx("div",{ref:D,id:`filtered-posts-${l}`,style:E!==void 0?{minHeight:E,border:"1px solid #e0e0e0",borderRadius:"4px"}:void 0,children:a.jsx(p.Container,{fluid:!0,children:I?a.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:E??"100%"},children:a.jsx(p.Loader,{active:!0,inline:"centered"})}):!I&&C&&C.length>0?a.jsx(it,{posts:C,postWidth:Number(g),postHeight:Number(d),numberOfColumns:Number(w),sortFirstBy:$,countryCategory:R}):a.jsx(nt.default,{noDataMsg:z,clearFilterMsg:W,group:l})})})},ut=ot.injectIntl(y.memo(lt));exports.default=ut;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const j=require("react/jsx-runtime"),c=require("react"),q=require("./PostsFilterDropdown.js"),F=require("../../conf/index.js"),R=u=>{const{taxonomy:n,group:p,placeholder:f,allLabel:d,noneLabel:g,useSingleColumn:y,enableTextSearch:m,filterType:h,showNoDataOption:x,closeOnSelect:S,allNoneSameBehaviour:O,autoApply:P,alphabeticalSort:A,ascOrder:b,type:v,categories:s,onChange:T,wpApiBase:t,...w}=u,[B,e]=c.useState([]),C=async()=>{if(!n||n==="none"){e([]);return}const i=t!=null&&t!==""?t:F.Config.REACT_APP_WP_API;console.log("Fetching taxonomy options from API base:",i);const r=await(await fetch(i+"/wp/v2/"+n)).json();if(r){const l=r.map(o=>({key:o.id,value:o.id,text:o.name}));if(s){const o=l.filter(_=>s.indexOf(_.value.toString())>-1);e([]),e(o)}else e([]),e(l)}};return c.useEffect(()=>{let a=!1;return a||(e([]),C()),()=>{a=!0}},[v,n,s,t]),j.jsx(q.default,{...w,group:p,placeholder:f,allLabel:d,noneLabel:g,useSingleColumn:y,enableTextSearch:m,filterType:h,showNoDataOption:x,closeOnSelect:S,allNoneSameBehaviour:O,autoApply:P,alphabeticalSort:A,ascOrder:b,options:B,onChange:T})};exports.default=R;
|
|
@@ -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 f=require("react/jsx-runtime"),c=require("react"),ne=require("semantic-ui-react"),s=require("../../utils/data.js"),se=require("../../redux/hooks.js"),ie=require("react-redux"),ce=require("./CategoricalFilter.js"),ue=require("./YearFilter.js"),ye=E=>{const{"data-alphabetical-sort":Y,"data-asc-order":L,"data-group":u,"data-placeholder":T,"data-all-label":C,"data-none-label":b,"data-use-single-column":R,"data-enable-text-search":q,"data-filter-type":p,"data-show-no-data-option":v,"data-close-on-select":M,"data-all-none-same-behaviour":D,"data-auto-apply":P,"data-taxonomy":i,"data-categories":F="[]","data-is-country-filter":j,"data-is-year-filter":z,"data-type":J,"data-sort-first-by":B,"data-default-values":K="[]","data-wordpress-source-type":de,"data-wordpress-source":U,editing:k=!1}=E,d=se.useAppDispatch(),e=ie.useSelector(t=>t.getIn(["data","posts",u]))||{},l=p==="multi-select",[x,Fe]=c.useState(0),O=t=>k?t:decodeURIComponent(t);let n=(t=>{try{return JSON.parse(O(t))}catch(o){return console.warn("JSON parsing failed for value:",t,"- treating as plain string. Error:",o),O(t)}})(K);n||(n=[]),typeof n=="string"&&(n=n.split(",").map(Number)),typeof n=="number"&&(n=[n]);const $=s.toBoolean(Y),G=s.toBoolean(L),N=s.toBoolean(v),V=s.toBoolean(M),_=s.toBoolean(D),A=s.toBoolean(P),r=s.toBoolean(j),a=s.toBoolean(z),I=s.toBoolean(R),w=s.toBoolean(q),g=B!=="none"?s.toNumber(B):null,[y,H]=c.useState([]),[m,Q]=c.useState(!1),S=(t,o)=>o?Array.isArray(t)?t:t!=null?[t]:[]:t||void 0,W=c.useMemo(()=>S(e.countryFilter,l),[e.countryFilter,l]),X=c.useMemo(()=>S(e.categoryFilter,l),[e.categoryFilter,l]),Z=c.useMemo(()=>a?S(e.yearFilter,l):void 0,[e.yearFilter,l,a]),h=c.useMemo(()=>F?F.split(","):[],[F]),ee=t=>{d({type:"SET_POSTS_FILTER",group:u,...e,isYearFilter:a,yearFilter:a?t:null,isCountryFilter:r,categoryFilter:e.categoryFilter,countryFilter:e.countryFilter,sortFirstBy:g,countryCategory:i,categoryTaxonomy:i,countryTaxonomy:i})},te=t=>{d({type:"SET_POSTS_FILTER",group:u,...e,categoryFilter:r?e.categoryFilter:t,countryFilter:r?t:e.countryFilter,isYearFilter:a,yearFilter:e.yearFilter,isCountryFilter:r,sortFirstBy:r?g:e.sortFirstBy,countryCategory:r?i:e.countryCategory,categoryCategory:r?e.categoryCategory:t,categoryTaxonomy:r?e.categoryTaxonomy:i,countryTaxonomy:r?i:e.countryTaxonomy})};return c.useEffect(()=>{const t=n.length>0,o=l?n:n[0],re=r?e.categoryFilter:t?o:l?h.map(Number):e.categoryFilter,ae=r?t?o:l?h.map(Number):e.countryFilter:e.countryFilter,oe=a&&l?y.length>0?y.map(le=>le.value):[]:e.yearFilter;d({type:"SET_INITIAL_POSTS_FILTER",group:u,categoryFilter:re,countryFilter:ae,isYearFilter:a,isCountryFilter:r,sortFirstBy:g,yearFilter:a?oe:null,categoryCategory:r?null:e.categoryCategory,categoryTaxonomy:r?null:i,countryCategory:r?i:null,countryTaxonomy:r?i:null,page:1})},[]),c.useEffect(()=>{if(a&&!m){const t=a&&l?y.length>0?y.map(o=>o.value):[]:e.yearFilter;d({type:"SET_INITIAL_POSTS_FILTER",group:u,...e,isYearFilter:a,yearFilter:a?t:null})}},[m]),f.jsxs(ne.Container,{fluid:!0,className:"filter post-filter",children:[a&&f.jsx(ue.default,{group:u,placeholder:T,allLabel:C,noneLabel:b,useSingleColumn:I,enableTextSearch:w,filterType:p,showNoDataOption:N,closeOnSelect:V,allNoneSameBehaviour:_,autoApply:A,alphabeticalSort:$,ascOrder:G,options:y,value:Z,yearOptions:y,setYearOptions:H,yearFilterLoading:m,setYearFilterLoading:Q,onChange:(t,o)=>{ee(o)},resetKey:x}),!a&&f.jsx(ce.default,{group:u,placeholder:T,allLabel:C,noneLabel:b,useSingleColumn:I,enableTextSearch:w,filterType:p,showNoDataOption:N,closeOnSelect:V,allNoneSameBehaviour:_,autoApply:A,taxonomy:i,type:J,value:r?W:X,onChange:(t,o)=>{te(o)},categories:h,resetKey:x,wpApiBase:U??void 0},`cat-${u}`)]})};exports.default=ye;
|
|
@@ -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 s=require("react/jsx-runtime"),r=require("react"),d=require("react-redux"),i=require("semantic-ui-react"),v=require("react-intl"),I=p=>{const{"data-group":c}=p,f=d.useDispatch(),t=d.useSelector(e=>e.getIn(["data","postsPagination",c])),n=d.useSelector(e=>e.getIn(["data","posts",c])),l=t&&(t!=null&&t.totalPages)?t.totalPages:1,[a,g]=r.useState((n==null?void 0:n.page)??1),[h,m]=r.useState([]),x=r.useRef(null),j=()=>{const e=[];for(let o=1;o<=l;o++)e.push({key:o,text:o,value:o});m(e)},u=e=>{if(e===a||e<1||e>l)return;g(e),f({type:"SET_POSTS_FILTER",group:c,...n,page:e});const o=document.getElementById(`filtered-posts-${c}`);if(o){const P=o.getBoundingClientRect().top+window.scrollY-50;window.scrollTo({top:P,behavior:"smooth"})}};return r.useEffect(()=>{j()},[t]),r.useEffect(()=>{const e=(n==null?void 0:n.page)??1;e!==a&&g(e)},[n==null?void 0:n.page]),s.jsx("div",{ref:x,children:s.jsxs(i.Container,{fluid:!0,className:"posts-pagination",children:[s.jsxs("div",{className:"posts-pagination-dropdown",children:[s.jsx("span",{children:"Page"}),s.jsx(i.Dropdown,{options:h,placeholder:"Select Item",selection:!0,compact:!0,value:a,onChange:(e,o)=>u(Number(o.value))}),s.jsx("div",{children:s.jsxs("span",{children:["of ",t&&(t==null?void 0:t.totalPages)]})})]}),s.jsxs("div",{children:[s.jsx(i.Icon,{size:"large",style:{cursor:"pointer"},onClick:()=>u(a-1),name:"angle left",disabled:a===1}),s.jsx(i.Icon,{size:"large",style:{cursor:"pointer"},onClick:()=>u(a+1),name:"angle right",disabled:a===l})]})]})})},R=v.injectIntl(r.memo(I));exports.default=R;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../../conf/index.js"),O=require("../../api/commons.js");function p(n){return JSON.parse(JSON.stringify(n))}const u=process.env.VITE_REACT_APP_API_ROOT||A.Config.REACT_APP_API_ROOT||null,T=typeof window<"u"?window.location.origin:"",d={},l={},E=3*60*1e3;function C(n){return Object.keys(n).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(n[t])).join("&")}function S(n,t=!1){const e=n,o=Date.now();if(l[e]&&o-l[e].timestamp<E)return Promise.resolve(p(l[e].data));if(d[e])return d[e].then(p);const g=O.get(n,{},t).then(a=>(l[e]={data:a,timestamp:Date.now()},t?{data:p(a),meta:l[e].meta}:p(a))).finally(()=>{delete d[e]});return d[e]=g,g}const b=({app:n,params:t})=>{const e=`${u||T}/api/${n}/categories${t?"?"+C(t):""}`;return S(e)},j=({app:n,type:t,params:e})=>{const o=`${u||""}/api/${n}/categories/${t}${e?"?"+C(e):""}`;return S(o)},D=({source:n,app:t,params:e})=>{const o=`${u||T}/api/${t}/stats/${n}${e?"?"+C(e):""}`;return S(o)},k=({postType:n,taxonomy:t,category:e,taxonomyFilters:o,before:g,perPage:a,page:_,locale:R,after:y,ordering:q,orderingDirection:I,wpApiBase:f})=>{const $=f!=null&&f!==""?f:A.Config.REACT_APP_WP_API;console.log("Using API base:",$);const U=`${$}/wp/v2/${n}`,r=new URLSearchParams,P=new Map,h=(s,i)=>{if(!s||i==null)return;const c=P.get(s)||[];Array.isArray(i)?i.forEach(m=>{m!=null&&c.push(String(m))}):c.push(String(i)),P.set(s,c)};o&&o instanceof Map&&o.forEach((s,i)=>{h(i,s)}),t&&e!=null&&h(t,e),P.forEach((s,i)=>{const c=Array.from(new Set(s));c.length!==0&&r.set(i,c.join(","))}),g&&r.append("before",g.toISOString()),a&&r.append("per_page",a.toString()),r.append("page",_.toString()),r.append("locale",R),y&&r.append("after",y.toISOString()),r.append("orderby",q),r.append("order",I);const w=r.toString().replace(/%2C/g,",");return O.get(`${U}?${w}`,{headers:{"Content-Type":"application/json"}},!0)};exports.getCategories=b;exports.getCategory=j;exports.getCustomPosts=k;exports.getData=D;
|
|
@@ -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 A=require("./data-api.js"),J=require("immutable"),H=require("papaparse");function V(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const e=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(n,s,e.get?e:{enumerable:!0,get:()=>r[s]})}}return n.default=r,Object.freeze(n)}const d=V(J),O="LOAD_DATA",m="LOAD_DATA_DONE",F="LOAD_DATA_ERROR",D="LOAD_CATEGORIES",R="LOAD_CATEGORIES_DONE",L="LOAD_CATEGORIES_ERROR",P="SET_PAGE_MODULE_PROPS",h="RELOAD_CHILD_FILTER_ITEMS",N="SET_FILTER",Y="SET_FILTERS",C="SET_INITIAL_FILTER",M="SET_APPLY",w="CLEAN_FILTER",b="UNSET_FILTER",B=d.Map({mode:"info"}),v="SET_MEASURES",U="CLEAN_MEASURES",K="SET_POSTS_PAGINATION",Q="SET_POSTS_FILTER",G="SET_INITIAL_POSTS_FILTER",W=({app:r,group:n})=>(s,e)=>{s({type:U,app:r,group:n})},X=({app:r,group:n,mGroup:s})=>(e,t)=>{const l=Object.keys(s.measures).filter(o=>s.measures[o].selected),a={...s};a[r]={measures:{}},l.forEach(o=>{a[r].measures[o]={...s.measures[o]}}),a[r].format=s.format,e({type:v,app:r,group:n,measure:a})},Z=({app:r,type:n,group:s,param:e,autoApply:t,params:l,parentParam:a,parentType:o,parentSelectedItems:i,uniqueStorage:I,dvzProxyDatasetId:p})=>(g,u)=>{const E={...l};E[a]=i,A.getCategory({app:r,params:E,type:n}).then(f=>{g({type:h,filterType:n,parentType:o,param:e,app:r,group:s,data:f,uniqueStorage:I,dvzProxyDatasetId:p,autoApply:t})})},$=r=>(n,s)=>{const{app:e,group:t,param:l,value:a,autoApply:o,parent:i}=r;console.log("set filters"),n({type:N,app:e,group:t,param:l,value:a,autoApply:o,parent:i})},k=({app:r,group:n})=>(s,e)=>{s({type:w,app:r,group:n})},ee=({app:r,group:n,param:s,parent:e})=>(t,l)=>{t({type:b,app:r,group:n,param:s,parent:e})},te=({app:r,group:n})=>(s,e)=>{s({type:M,app:r,group:n})},se=({app:r,group:n,param:s,value:e})=>(t,l)=>{t({type:C,app:r,group:n,param:s,value:e})},re=r=>(n,s)=>{const{app:e,params:t,dvzProxyDatasetId:l,uniqueStorage:a}=r;n({type:D,params:t,app:e,uniqueStorage:a,dvzProxyDatasetId:l}),A.getCategories({app:e,params:t}).then(o=>(o.appliedFilters=t,n({type:R,app:e,data:o,uniqueStorage:a,dvzProxyDatasetId:l}))).catch(o=>n({type:L,app:e,uniqueStorage:a,error:o,dvzProxyDatasetId:l}))},ne=({app:r,group:n,csv:s,store:e,params:t})=>(l,a)=>{const o=a().get("data").getIn(["filters",r,n]);o?t={...t,...o.toJS()}:t=t||{};const i=H.parse(s,{header:!0,dynamicTyping:!0}),I=i.data.filter(g=>{let u=!1;return Object.keys(t).forEach(E=>{const f=t[E];if(g[E]){const S=g[E].toString().trim().toLowerCase();u=f.filter(_=>_&&_.toString().trim().toLowerCase()==S).length==0}}),!u}),p={...i,data:I,appliedFilters:t};l({type:m,app:r,group:n,store:e,data:{count:p.data.length,itemsSize:p.data.length,...p}})},ae=r=>(n,s)=>{const{app:e,group:t,source:l,store:a,params:o,parent:i}=r;let I=s().get("data").getIn(["filters",e,t]);i&&o&&Object.keys(o).forEach(u=>{if(I&&I.has(u)){let E=o[u],S=I.get(u).filter(_=>E.indexOf(_)>-1);I=I.set(u,S)}});let p={...o};I&&(p={...p,...I.toJS()}),n({type:O,app:e,group:t,params:p,store:a}),A.getData({app:e,source:l,params:p}).then(g=>(g.appliedFilters=p,n({type:m,app:e,group:t,store:a,data:g,params:p}))).catch(g=>n({type:F,app:e,group:t,store:a,error:g}))},le=({data:r})=>(n,s)=>{n({type:P,data:r})},oe=(r=B,n)=>{switch(n.type){case O:{const{store:s,app:e,group:t,params:l}=n,a=Date.now();return r.deleteIn([...s,"error"]).setIn([...s,"loading"],!0).setIn([...s,"time"],a).setIn([...s,"presetFilter"],l)}case F:{const{error:s,store:e,app:t,group:l}=n;return r.setIn([...e,"loading"],!1).setIn([...e,"error"],s).setIn(["filters-settings",t,l,"apply"],null)}case m:{const{data:s,app:e,group:t,store:l}=n;return r.setIn([...l,"loading"],!1).deleteIn([...l,"error"]).setIn([...l,"data"],s).setIn(["filters-settings",e,t,"apply"],null)}case P:{const{data:s}=n;return r.setIn(["pageModuleProps"],s)}case D:{const{data:s,app:e,uniqueStorage:t,dvzProxyDatasetId:l}=n,a=["categories",e];return t&&a.push(t),l&&a.push(l),r.setIn([...a,"loading"],!0).deleteIn([...a,"error"])}case R:{const{data:s,app:e,uniqueStorage:t,dvzProxyDatasetId:l}=n,a=["categories",e];return l&&a.push(l),t&&a.push(t),r.setIn([...a,"loading"],!1).setIn([...a,"items"],d.fromJS(s))}case L:{const{data:s,app:e,uniqueStorage:t,dvzProxyDatasetId:l}=n,a=["categories",e];return t&&a.push(t),l&&a.push(l),r.setIn([...a,"loading"],!1).setIn([...a,"error"],s)}case M:{const{app:s,group:e}=n;return r.setIn(["filters-settings",s,e,"apply"],new Date().getTime())}case N:{const s=Date.now(),{app:e,group:t,param:l,value:a,autoApply:o,parent:i}=n;return r.setIn(["filters-settings",e,t,"autoApply"],o).setIn(["filters",e,t,l],a.length===0?[Number.MIN_SAFE_INTEGER]:a).setIn(["filters-settings",e,t,"apply"],null).setIn(["filters-settings",e,t,"lastUserFilterChange"],s).setIn(["filters-settings",e,t,"parent"],i||null)}case Y:{const s=Date.now(),{app:e,group:t,filters:l,autoApply:a}=n;return r.setIn(["filters-settings",e,t,"autoApply"],a).setIn(["filters",e,t,param],value.length===0?[Number.MIN_SAFE_INTEGER]:value).setIn(["filters-settings",e,t,"apply"],null).setIn(["filters-settings",e,t,"lastUserFilterChange"],s)}case h:{const{data:s,app:e,group:t,param:l,uniqueStorage:a,dvzProxyDatasetId:o,filterType:i,parentType:I,autoApply:p}=n,g=Date.now(),u=["categories",e];o&&u.push(o),a&&u.push(a);const E=s.filter(c=>c.type==i),S=r.getIn([...u,"items"]).filter(c=>c.get("type")==i).get(0).get("items").map(c=>c.value),j=r.getIn([...u,"items"]).filter(c=>c.get("type")!=i).push(d.Map(E[0])),q=r.getIn(["filters",e,t,l]),y=s[0].items.map(c=>c.value),x=q.filter(c=>y.indexOf(c)>-1),z=y.filter(c=>S.indexOf(c)==-1),T=Array.from(new Set([...x,...z]));return r.setIn([...u,"items"],j).setIn(["filters",e,t,l],Array.from(T)).setIn(["filters-settings",e,t,"autoApply"],p).setIn(["filters",e,t,l],T.length===0?[Number.MIN_SAFE_INTEGER]:T).setIn(["filters-settings",e,t,"apply"],null).setIn(["filters-settings",e,t,"lastUserFilterChange"],g)}case C:{const s=Date.now(),{app:e,group:t,param:l,value:a}=n;return r.setIn(["filters","initial",e,t,l],a.length===0?[Number.MIN_SAFE_INTEGER]:a).setIn(["filters",e,t,l],a.length===0?[Number.MIN_SAFE_INTEGER]:a).setIn(["filters-settings",e,t,"lastInitialFilterChange"],s).setIn(["filters-settings",e,t,"lastUserFilterChange"],s)}case b:{const s=Date.now(),{app:e,group:t,param:l,parent:a}=n;return r.deleteIn(["filters",e,t,l]).setIn(["filters-settings",e,t,"lastUserFilterChange"],s).setIn(["filters-settings",e,t,"parent"],a||null)}case w:{const{app:s,group:e}=n,t=r.getIn(["filters","initial",s,e]);return r.setIn(["filters",s,e],t)}case v:{const{app:s,group:e,measure:t}=n;return r.setIn(["measures",s,e],t)}case U:{const{app:s,group:e,measure:t}=n;return r.deleteIn(["measures",s,e])}case K:{const{group:s,totalPages:e,totalItems:t}=n;return r.setIn(["postsPagination",s],{totalPages:e,totalItems:t})}case Q:{const{type:s,group:e,...t}=n;return r.setIn(["posts",e],t)}case G:{const{type:s,group:e,...t}=n;return r.setIn(["posts",e],t).setIn(["posts","initialFilters",e],t)}default:return r}},ie=({group:r,dispatch:n,initialFilters:s})=>{n({type:G,group:r,...s,reset:!0,page:1})};exports.applyFilter=te;exports.cleanFilter=k;exports.cleanMeasures=W;exports.clearPostsFilter=ie;exports.default=oe;exports.getCategories=re;exports.getData=ae;exports.loadFilterItems=Z;exports.setData=ne;exports.setFilter=$;exports.setInitialFilters=se;exports.setMeasures=X;exports.setPageModuleProps=le;exports.unsetFilter=ee;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useAppDispatch as p, useAppSelector as
|
|
3
|
-
import { Segment as
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useAppDispatch as p, useAppSelector as m } from "../../redux/hooks.js";
|
|
3
|
+
import { Segment as d, Header as g, Button as h } from "semantic-ui-react";
|
|
4
4
|
import { clearPostsFilter as u } from "../reducers/data.js";
|
|
5
|
-
const
|
|
6
|
-
const { noDataMsg:
|
|
7
|
-
c.preventDefault(), u({ group:
|
|
5
|
+
const F = (s) => {
|
|
6
|
+
const { noDataMsg: a, clearFilterMsg: l, editing: M, group: e } = s, r = p(), i = m((c) => c.getIn(["data", "posts", "initialFilters", e])), o = (c) => {
|
|
7
|
+
c.preventDefault(), u({ group: e, dispatch: r, initialFilters: i });
|
|
8
8
|
};
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ n(d, { placeholder: !0, className: "chartNoDataMessage", children: [
|
|
10
|
+
/* @__PURE__ */ n(g, { icon: !0, children: [
|
|
11
|
+
/* @__PURE__ */ t(
|
|
12
12
|
"svg",
|
|
13
13
|
{
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
15
|
className: "noDataSVG",
|
|
16
16
|
viewBox: "0 0 512 512",
|
|
17
|
-
children: /* @__PURE__ */
|
|
17
|
+
children: /* @__PURE__ */ t("path", { d: `M403.7,96.3c-41-41-95.6-63.6-153.7-63.6c-58,0-112.6,22.6-153.7,63.6c-41,41-63.6,95.6-63.6,153.7
|
|
18
18
|
c0,58,22.6,112.6,63.6,153.7c41,41,95.6,63.6,153.7,63.6c58,0,112.6-22.6,153.7-63.6c41-41,63.7-95.6,63.7-153.7
|
|
19
19
|
C467.3,192,444.7,137.4,403.7,96.3z M57.7,250C57.7,144,144,57.7,250,57.7c37.2,0,72,10.6,101.5,29l-63,77.1c-2.8-3.5-6-6.8-9.5-10
|
|
20
20
|
c-18.2-16.7-39.9-24.5-65.1-23.5c-25.2,1.1-46.2,10.7-62.9,28.9c-16.7,18.2-24.5,39.9-23.5,65.1c1.1,25.2,10.7,46.2,28.9,62.9
|
|
@@ -27,12 +27,11 @@ const f = (n) => {
|
|
|
27
27
|
c43,35.3,70.5,88.8,70.5,148.7C442.3,356,356,442.3,250,442.3z` })
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */ e("div", { className: "WPnoDataMsg", children: r })
|
|
30
|
+
/* @__PURE__ */ t("div", { className: "WPnoDataMsg", children: a })
|
|
32
31
|
] }),
|
|
33
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ t(h, { size: "medium", onClick: (c) => o(c), children: l || "Clear Filter" })
|
|
34
33
|
] });
|
|
35
34
|
};
|
|
36
35
|
export {
|
|
37
|
-
|
|
36
|
+
F as default
|
|
38
37
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Container as
|
|
4
|
-
import
|
|
5
|
-
import { injectIntl as
|
|
6
|
-
import { getStartDateAndEndDateFromYear as
|
|
7
|
-
import
|
|
8
|
-
import { useDispatch as
|
|
9
|
-
import { getCustomPosts as
|
|
10
|
-
import { useParams as
|
|
11
|
-
import { toNumber as
|
|
12
|
-
const
|
|
13
|
-
const { posts:
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import et, { useState as D, useRef as ot, useEffect as rt } from "react";
|
|
3
|
+
import { Container as Y, Loader as nt, Grid as M, GridRow as at } from "semantic-ui-react";
|
|
4
|
+
import st from "../connected-templates/PostIntro.js";
|
|
5
|
+
import { injectIntl as it } from "react-intl";
|
|
6
|
+
import { getStartDateAndEndDateFromYear as V } from "./utils.js";
|
|
7
|
+
import lt from "./NoData.js";
|
|
8
|
+
import { useDispatch as ct, useSelector as ut } from "react-redux";
|
|
9
|
+
import { getCustomPosts as dt } from "../reducers/data-api.js";
|
|
10
|
+
import { useParams as mt } from "react-router";
|
|
11
|
+
import { toNumber as ft, toBoolean as gt } from "../../utils/data.js";
|
|
12
|
+
const yt = (F) => {
|
|
13
|
+
const { posts: l, numberOfColumns: S, sortFirstBy: c, countryCategory: u, postWidth: h, postHeight: A } = F, m = [];
|
|
14
|
+
if (u && c && c !== "none") {
|
|
15
|
+
const d = l.filter((y) => y[u].includes(Number(c))), b = l.filter((y) => !y[u].includes(Number(c)));
|
|
16
|
+
m.push(...d), m.push(...b);
|
|
17
17
|
} else
|
|
18
|
-
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
18
|
+
m.push(...l);
|
|
19
|
+
return /* @__PURE__ */ s(M, { className: "filtered-posts", columns: S, children: /* @__PURE__ */ s(at, { children: m.map((d) => /* @__PURE__ */ s(M.Column, { children: /* @__PURE__ */ s("div", { className: "filtered-posts-column", style: { width: h, height: A, overflow: "hidden" }, children: /* @__PURE__ */ s(
|
|
20
|
+
st,
|
|
21
21
|
{
|
|
22
22
|
style: {
|
|
23
23
|
width: "100%",
|
|
@@ -26,35 +26,39 @@ const lt = (T) => {
|
|
|
26
26
|
margin: 0,
|
|
27
27
|
padding: 0
|
|
28
28
|
},
|
|
29
|
-
as:
|
|
29
|
+
as: Y,
|
|
30
30
|
fluid: !0,
|
|
31
|
-
post:
|
|
31
|
+
post: d
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
) }) },
|
|
35
|
-
},
|
|
33
|
+
d.id
|
|
34
|
+
) }) }, d.id)) }) });
|
|
35
|
+
}, pt = (F) => {
|
|
36
36
|
const {
|
|
37
|
-
"data-group":
|
|
38
|
-
"data-number-of-columns":
|
|
37
|
+
"data-group": l,
|
|
38
|
+
"data-number-of-columns": S,
|
|
39
39
|
"data-type": c,
|
|
40
|
-
"data-taxonomy":
|
|
41
|
-
"data-categories": h,
|
|
42
|
-
"data-height":
|
|
43
|
-
"data-post-width":
|
|
44
|
-
"data-post-height":
|
|
45
|
-
"data-number-of-items-per-page":
|
|
40
|
+
"data-taxonomy": u,
|
|
41
|
+
"data-categories": h = "[]",
|
|
42
|
+
"data-height": A,
|
|
43
|
+
"data-post-width": m,
|
|
44
|
+
"data-post-height": d,
|
|
45
|
+
"data-number-of-items-per-page": b,
|
|
46
46
|
"data-enable-sorting": y,
|
|
47
|
-
"data-sort-first-by":
|
|
48
|
-
"data-sorting-taxonomy":
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
"data-sort-first-by": I,
|
|
48
|
+
"data-sorting-taxonomy": O,
|
|
49
|
+
"data-wordpress-source-type": ht,
|
|
50
|
+
"data-wordpress-source": j,
|
|
51
|
+
"data-no-data-msg": z,
|
|
52
|
+
"data-clear-filter-msg": W,
|
|
53
|
+
editing: J
|
|
54
|
+
} = F, L = ct(), { locale: q } = mt(), [R, x] = D(!1), _ = ut((t) => t).getIn(["data", "posts", l]), [T, N] = D([]), w = ot(null), [C, B] = D(void 0), U = gt(y) && I !== "none" ? ft(I) : null, f = _ ?? {
|
|
51
55
|
yearFilter: null,
|
|
52
56
|
categoryFilter: null,
|
|
53
57
|
countryFilter: null,
|
|
54
58
|
page: 1,
|
|
55
59
|
countryTaxonomy: null,
|
|
56
60
|
categoryTaxonomy: null
|
|
57
|
-
},
|
|
61
|
+
}, v = (t) => {
|
|
58
62
|
if (t == null)
|
|
59
63
|
return { values: [], isExplicitNone: !1 };
|
|
60
64
|
const e = Array.isArray(t) ? t : [t], a = e.some(
|
|
@@ -64,19 +68,19 @@ const lt = (T) => {
|
|
|
64
68
|
values: e.map((o) => Number(o)).filter((o) => Number.isFinite(o) && o !== Number.MIN_SAFE_INTEGER),
|
|
65
69
|
isExplicitNone: a
|
|
66
70
|
};
|
|
67
|
-
},
|
|
71
|
+
}, $ = (t) => {
|
|
68
72
|
if (!t || t.length === 0)
|
|
69
73
|
return null;
|
|
70
|
-
const e = Array.from(new Set(t)).sort((
|
|
74
|
+
const e = Array.from(new Set(t)).sort((E, P) => E - P);
|
|
71
75
|
if (e.length === 0)
|
|
72
76
|
return null;
|
|
73
|
-
const a = e[0], r = e[e.length - 1], o =
|
|
77
|
+
const a = e[0], r = e[e.length - 1], o = V(a), n = V(r);
|
|
74
78
|
return !(o != null && o.startDate) || !(n != null && n.endDate) ? null : {
|
|
75
79
|
startDate: o.startDate,
|
|
76
80
|
endDate: n.endDate
|
|
77
81
|
};
|
|
78
|
-
},
|
|
79
|
-
const t =
|
|
82
|
+
}, k = () => {
|
|
83
|
+
const t = v(f.yearFilter), e = t.isExplicitNone ? null : $(t.values), a = f.countryFilter ?? null, r = f.categoryFilter ?? null, o = f.categoryTaxonomy || (u && u !== "none" ? u : null), n = f.countryTaxonomy || null;
|
|
80
84
|
return {
|
|
81
85
|
before: (e == null ? void 0 : e.endDate) || null,
|
|
82
86
|
after: (e == null ? void 0 : e.startDate) || null,
|
|
@@ -85,83 +89,84 @@ const lt = (T) => {
|
|
|
85
89
|
countryFilter: a,
|
|
86
90
|
countryTaxonomy: n
|
|
87
91
|
};
|
|
88
|
-
},
|
|
92
|
+
}, G = (t) => J ? t : decodeURIComponent(t), K = (t) => {
|
|
89
93
|
try {
|
|
90
|
-
return JSON.parse(
|
|
94
|
+
return JSON.parse(G(t));
|
|
91
95
|
} catch (e) {
|
|
92
|
-
return console.warn("JSON parsing failed for value:", t, "- treating as plain string. Error:", e),
|
|
96
|
+
return console.warn("JSON parsing failed for value:", t, "- treating as plain string. Error:", e), G(t);
|
|
93
97
|
}
|
|
94
|
-
},
|
|
95
|
-
const t =
|
|
98
|
+
}, Q = () => {
|
|
99
|
+
const t = K(h);
|
|
96
100
|
return t ? typeof t == "string" ? t.split(",").map(Number) : typeof t == "number" ? [t] : t : [];
|
|
97
|
-
},
|
|
101
|
+
}, X = (t, e, a) => {
|
|
98
102
|
if (a) return null;
|
|
99
103
|
if (t.length === 0) return e.length > 0 ? e : null;
|
|
100
104
|
if (e.length === 0) return t;
|
|
101
105
|
const r = new Set(t), o = e.filter((n) => r.has(n));
|
|
102
106
|
return o.length > 0 ? o : null;
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
const t =
|
|
107
|
+
}, Z = async () => {
|
|
108
|
+
w.current && B(w.current.offsetHeight), x(!0);
|
|
109
|
+
const t = k(), e = v(Q()).values, a = v(t.categoryFilter), r = X(
|
|
106
110
|
e,
|
|
107
111
|
a.values,
|
|
108
112
|
a.isExplicitNone
|
|
109
|
-
), o =
|
|
113
|
+
), o = v(t.countryFilter);
|
|
110
114
|
if (a.isExplicitNone) {
|
|
111
|
-
|
|
115
|
+
N([]), x(!1);
|
|
112
116
|
return;
|
|
113
117
|
}
|
|
114
118
|
if (o.isExplicitNone) {
|
|
115
|
-
|
|
119
|
+
N([]), x(!1);
|
|
116
120
|
return;
|
|
117
121
|
}
|
|
118
122
|
const n = /* @__PURE__ */ new Map();
|
|
119
123
|
t.categoryTaxonomy && r && r.length > 0 && n.set(t.categoryTaxonomy, r), t.countryTaxonomy && o.values.length > 0 && n.set(t.countryTaxonomy, o.values);
|
|
120
|
-
const
|
|
124
|
+
const E = r ? r.join(",") : void 0, P = {
|
|
121
125
|
after: t.after,
|
|
122
126
|
before: t.before,
|
|
123
|
-
perPage: Number(
|
|
124
|
-
page:
|
|
125
|
-
locale:
|
|
127
|
+
perPage: Number(b || 10),
|
|
128
|
+
page: f.page || 1,
|
|
129
|
+
locale: q || "en",
|
|
126
130
|
postType: c,
|
|
127
131
|
taxonomy: t.categoryTaxonomy || void 0,
|
|
128
|
-
category:
|
|
132
|
+
category: E || void 0,
|
|
129
133
|
taxonomyFilters: n,
|
|
130
134
|
ordering: "date",
|
|
131
|
-
orderingDirection: "desc"
|
|
135
|
+
orderingDirection: "desc",
|
|
136
|
+
wpApiBase: j ?? void 0
|
|
132
137
|
};
|
|
133
|
-
await
|
|
134
|
-
if (
|
|
135
|
-
let p = null,
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
138
|
-
|
|
138
|
+
await dt(P).then((i) => {
|
|
139
|
+
if (i) {
|
|
140
|
+
let p = null, g = null;
|
|
141
|
+
if (i && typeof i == "object" && "data" in i ? (p = i.data, g = i.meta) : (Array.isArray(i), p = i), N(Array.isArray(p) ? p : []), g) {
|
|
142
|
+
const H = g["x-wp-totalpages"] ? g["x-wp-totalpages"] : 1, tt = g["x-wp-total"] ? g["x-wp-total"] : 0;
|
|
143
|
+
H && L({
|
|
139
144
|
type: "SET_POSTS_PAGINATION",
|
|
140
|
-
group:
|
|
141
|
-
totalPages: Number(
|
|
142
|
-
totalItems: Number(
|
|
145
|
+
group: l,
|
|
146
|
+
totalPages: Number(H),
|
|
147
|
+
totalItems: Number(tt)
|
|
143
148
|
});
|
|
144
149
|
}
|
|
145
150
|
} else
|
|
146
|
-
|
|
151
|
+
N([]);
|
|
147
152
|
}).finally(() => {
|
|
148
|
-
|
|
153
|
+
x(!1), B(void 0);
|
|
149
154
|
});
|
|
150
155
|
};
|
|
151
|
-
return
|
|
152
|
-
(async () => await
|
|
153
|
-
}, [
|
|
154
|
-
|
|
156
|
+
return rt(() => {
|
|
157
|
+
c && (async () => await Z())();
|
|
158
|
+
}, [_, c, u, b, h, O]), /* @__PURE__ */ s("div", { ref: w, id: `filtered-posts-${l}`, style: C !== void 0 ? { minHeight: C, border: "1px solid #e0e0e0", borderRadius: "4px" } : void 0, children: /* @__PURE__ */ s(Y, { fluid: !0, children: R ? /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: C ?? "100%" }, children: /* @__PURE__ */ s(nt, { active: !0, inline: "centered" }) }) : !R && T && T.length > 0 ? /* @__PURE__ */ s(
|
|
159
|
+
yt,
|
|
155
160
|
{
|
|
156
|
-
posts:
|
|
157
|
-
postWidth: Number(
|
|
158
|
-
postHeight: Number(
|
|
159
|
-
numberOfColumns: Number(
|
|
160
|
-
sortFirstBy:
|
|
161
|
-
countryCategory:
|
|
161
|
+
posts: T,
|
|
162
|
+
postWidth: Number(m),
|
|
163
|
+
postHeight: Number(d),
|
|
164
|
+
numberOfColumns: Number(S),
|
|
165
|
+
sortFirstBy: U,
|
|
166
|
+
countryCategory: O
|
|
162
167
|
}
|
|
163
|
-
) : /* @__PURE__ */
|
|
164
|
-
},
|
|
168
|
+
) : /* @__PURE__ */ s(lt, { noDataMsg: z, clearFilterMsg: W, group: l }) }) });
|
|
169
|
+
}, At = it(et.memo(pt));
|
|
165
170
|
export {
|
|
166
|
-
|
|
171
|
+
At as default
|
|
167
172
|
};
|