@devgateway/dvz-ui-react 1.8.6 → 1.8.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),g=require("react"),y=require("semantic-ui-react"),se=require("../connected-templates/PostIntro.js"),ie=require("./FilteredPostsIntro.js"),W=require("react-intl"),ae=require("./NoData.js"),V=require("react-redux"),le=require("../reducers/data-api.js"),z=require("../../utils/data.js"),ue=x=>{const{posts:l,numberOfColumns:C,sortFirstBy:u,countryCategory:c,postWidth:N,postHeight:q,locale:j}=x,f=[];if(c&&u&&u!=="none"){const i=l.filter(m=>m[c].includes(Number(u))),F=l.filter(m=>!m[c].includes(Number(u)));f.push(...i),f.push(...F)}else f.push(...l);const v=x.wordpressSourceType==="internal"||!x.wordpressSourceType;return n.jsx(y.Grid,{className:"filtered-posts",columns:C,children:n.jsx(y.GridRow,{children:f.map(i=>n.jsx(y.Grid.Column,{children:n.jsx("div",{className:"filtered-posts-column",style:{width:N,height:q,overflow:"hidden"},children:v?n.jsx(se.default,{style:{width:"100%",height:"100%",overflow:"hidden",margin:0,padding:0},as:y.Container,fluid:!0,post:i},i.id):n.jsx(ie.default,{style:{width:"100%",height:"100%",overflow:"hidden",margin:0,padding:0},as:y.Container,fluid:!0,post:i,locale:j},i.id)})},i.id))})})},ce=x=>{const{"data-group":l,"data-number-of-columns":C,"data-type":u,"data-taxonomy":c,"data-categories":N="[]","data-height":q,"data-post-width":j,"data-post-height":f,"data-number-of-items-per-page":v,"data-enable-sorting":i,"data-sort-first-by":F,"data-sorting-taxonomy":m,"data-wordpress-source-type":Y,"data-wordpress-source":O,"data-no-data-msg":J,"data-clear-filter-msg":L,editing:U}=x,$=V.useDispatch(),{locale:_}=W.useIntl(),[M,S]=g.useState(!1),P=g.useRef(0),G=V.useSelector(e=>e).getIn(["data","posts",l]),[E,w]=g.useState([]),I=g.useRef(null),[A,B]=g.useState(void 0),k=z.toBoolean(i)&&F!=="none"?z.toNumber(F):null,p=G??{yearFilter:null,categoryFilter:null,countryFilter:null,page:1,countryTaxonomy:null,categoryTaxonomy:null},T=e=>{if(e==null)return{values:[],isExplicitNone:!1};const t=Array.isArray(e)?e:[e],o=t.some(r=>Number(r)===Number.MIN_SAFE_INTEGER);return{values:t.map(r=>Number(r)).filter(r=>Number.isFinite(r)&&r!==Number.MIN_SAFE_INTEGER),isExplicitNone:o}},K=e=>{if(!e||e.length===0)return null;const t=Array.from(new Set(e)).map(o=>Number(o)).filter(o=>Number.isFinite(o)&&o>0).sort((o,s)=>o-s);return t.length>0?t:null},Q=()=>{const e=T(p.yearFilter),t=e.isExplicitNone?null:K(e.values),o=p.countryFilter??null,s=p.categoryFilter??null,r=p.categoryTaxonomy||(c&&c!=="none"?c:null),d=p.countryTaxonomy||null;return{years:t,categoryFilter:s,categoryTaxonomy:r,countryFilter:o,countryTaxonomy:d}},D=e=>U?e:decodeURIComponent(e),X=e=>{try{return JSON.parse(D(e))}catch(t){return console.warn("JSON parsing failed for value:",e,"- treating as plain string. Error:",t),D(e)}},Z=()=>{const e=X(N);return e?typeof e=="string"?e.split(",").map(Number):typeof e=="number"?[e]:e:[]},ee=(e,t,o)=>{if(o)return null;if(e.length===0)return t.length>0?t:null;if(t.length===0)return e;const s=new Set(e),r=t.filter(d=>s.has(d));return r.length>0?r:null},te=async()=>{const e=++P.current;I.current&&B(I.current.offsetHeight),S(!0);const t=Q(),o=T(Z()).values,s=T(t.categoryFilter),r=ee(o,s.values,s.isExplicitNone),d=T(t.countryFilter);if(s.isExplicitNone){w([]),S(!1);return}if(d.isExplicitNone){w([]),S(!1);return}const R=new Map;t.categoryTaxonomy&&r&&r.length>0&&R.set(t.categoryTaxonomy,r),t.countryTaxonomy&&d.values.length>0&&R.set(t.countryTaxonomy,d.values);const re=r?r.join(","):void 0,oe={years:t.years||void 0,after:void 0,before:void 0,perPage:Number(v||10),page:p.page||1,locale:_||"en",postType:u,taxonomy:t.categoryTaxonomy||void 0,category:re||void 0,taxonomyFilters:R,ordering:"date",orderingDirection:"desc",wpApiBase:O??void 0};await le.getCustomPosts(oe).then(a=>{if(e===P.current)if(a){let b=null,h=null;if(a&&typeof a=="object"&&"data"in a?(b=a.data,h=a.meta):(Array.isArray(a),b=a),w(Array.isArray(b)?b:[]),h){const H=h["x-wp-totalpages"]?h["x-wp-totalpages"]:1,ne=h["x-wp-total"]?h["x-wp-total"]:0;H&&$({type:"SET_POSTS_PAGINATION",group:l,totalPages:Number(H),totalItems:Number(ne)})}}else w([])}).finally(()=>{e===P.current&&(S(!1),B(void 0))})};return g.useEffect(()=>{u&&(async()=>await te())()},[G,u,c,v,N,m]),n.jsx("div",{ref:I,id:`filtered-posts-${l}`,style:A!==void 0?{minHeight:A,border:"1px solid #e0e0e0",borderRadius:"4px"}:void 0,children:n.jsx(y.Container,{fluid:!0,children:M?n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:A??"100%"},children:n.jsx(y.Loader,{active:!0,inline:"centered"})}):!M&&E&&E.length>0?n.jsx(ue,{posts:E,postWidth:Number(j),postHeight:Number(f),numberOfColumns:Number(C),sortFirstBy:k,countryCategory:m,wordpressSourceType:Y,wordpressSource:O,locale:_}):n.jsx(ae.default,{noDataMsg:J,clearFilterMsg:L,group:l})})})},de=W.injectIntl(g.memo(ce));exports.default=de;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),y=require("react"),g=require("semantic-ui-react"),ie=require("../connected-templates/PostIntro.js"),le=require("./FilteredPostsIntro.js"),Y=require("react-intl"),ue=require("./NoData.js"),V=require("react-redux"),ce=require("../reducers/data-api.js"),W=require("../../utils/data.js"),de=x=>{const{posts:u,numberOfColumns:C,sortFirstBy:c,countryCategory:s,postWidth:N,postHeight:O,locale:j}=x,m=[];if(s&&c&&c!=="none"){const i=u.filter(f=>f[s].includes(Number(c))),F=u.filter(f=>!f[s].includes(Number(c)));m.push(...i),m.push(...F)}else m.push(...u);const v=x.wordpressSourceType==="internal"||!x.wordpressSourceType;return n.jsx(g.Grid,{className:"filtered-posts",columns:C,children:n.jsx(g.GridRow,{children:m.map(i=>n.jsx(g.Grid.Column,{children:n.jsx("div",{className:"filtered-posts-column",style:{width:N,height:O,overflow:"hidden"},children:v?n.jsx(ie.default,{style:{width:"100%",height:"100%",overflow:"hidden",margin:0,padding:0},as:g.Container,fluid:!0,post:i},i.id):n.jsx(le.default,{style:{width:"100%",height:"100%",overflow:"hidden",margin:0,padding:0},as:g.Container,fluid:!0,post:i,locale:j},i.id)})},i.id))})})},ye=x=>{const{"data-group":u,"data-number-of-columns":C,"data-type":c,"data-taxonomy":s,"data-categories":N="[]","data-height":O,"data-post-width":j,"data-post-height":m,"data-number-of-items-per-page":v,"data-enable-sorting":i,"data-sort-first-by":F,"data-sorting-taxonomy":f,"data-wordpress-source-type":k,"data-wordpress-source":_,"data-no-data-msg":J,"data-clear-filter-msg":L,editing:U}=x,$=V.useDispatch(),{locale:B}=Y.useIntl(),[M,T]=y.useState(!1),P=y.useRef(0),z=V.useSelector(e=>e).getIn(["data","posts",u]),[E,S]=y.useState([]),I=y.useRef(null),[A,G]=y.useState(void 0),K=W.toBoolean(i)&&F!=="none"?W.toNumber(F):null,p=z??{yearFilter:null,categoryFilter:null,countryFilter:null,page:1,countryTaxonomy:null,categoryTaxonomy:null},w=e=>{if(e==null)return{values:[],isExplicitNone:!1};const t=Array.isArray(e)?e:[e],o=t.some(r=>Number(r)===Number.MIN_SAFE_INTEGER);return{values:t.map(r=>Number(r)).filter(r=>Number.isFinite(r)&&r!==Number.MIN_SAFE_INTEGER),isExplicitNone:o}},Q=e=>{if(!e||e.length===0)return null;const t=Array.from(new Set(e)).map(o=>Number(o)).filter(o=>Number.isFinite(o)&&o>0).sort((o,a)=>o-a);return t.length>0?t:null},X=()=>{const e=w(p.yearFilter),t=e.isExplicitNone?null:Q(e.values),o=p.countryFilter??null,a=p.categoryFilter??null,r=p.categoryTaxonomy||(s&&s!=="none"?s:null),d=p.countryTaxonomy||null;return{years:t,categoryFilter:a,categoryTaxonomy:r,countryFilter:o,countryTaxonomy:d}},D=e=>U?e:decodeURIComponent(e),Z=e=>{try{return JSON.parse(D(e))}catch(t){return console.warn("JSON parsing failed for value:",e,"- treating as plain string. Error:",t),D(e)}},ee=()=>{const e=Z(N);return e?typeof e=="string"?e.split(",").map(Number):typeof e=="number"?[e]:e:[]},te=(e,t,o)=>{if(o)return null;if(e.length===0)return t.length>0?t:null;if(t.length===0)return e;const a=new Set(e),r=t.filter(d=>a.has(d));return r.length>0?r:null},re=async()=>{const e=++P.current;I.current&&G(I.current.offsetHeight),T(!0);const t=X(),o=w(ee()).values,a=w(t.categoryFilter),r=te(o,a.values,a.isExplicitNone),d=w(t.countryFilter);if(a.isExplicitNone){S([]),T(!1);return}if(d.isExplicitNone){S([]),T(!1);return}const R=t.categoryTaxonomy&&t.categoryTaxonomy!=="none"?t.categoryTaxonomy:null,oe=R||(s&&s!=="none"?s:null)||void 0,q=new Map;R&&r&&r.length>0&&q.set(R,r),t.countryTaxonomy&&d.values.length>0&&q.set(t.countryTaxonomy,d.values);const ne=r?r.join(","):void 0,se={years:t.years||void 0,after:void 0,before:void 0,perPage:Number(v||10),page:p.page||1,locale:B||"en",postType:c,taxonomy:oe,category:ne||void 0,taxonomyFilters:q,ordering:"date",orderingDirection:"desc",wpApiBase:_??void 0};await ce.getCustomPosts(se).then(l=>{if(e===P.current)if(l){let b=null,h=null;if(l&&typeof l=="object"&&"data"in l?(b=l.data,h=l.meta):(Array.isArray(l),b=l),S(Array.isArray(b)?b:[]),h){const H=h["x-wp-totalpages"]?h["x-wp-totalpages"]:1,ae=h["x-wp-total"]?h["x-wp-total"]:0;H&&$({type:"SET_POSTS_PAGINATION",group:u,totalPages:Number(H),totalItems:Number(ae)})}}else S([])}).finally(()=>{e===P.current&&(T(!1),G(void 0))})};return y.useEffect(()=>{c&&(async()=>await re())()},[z,c,s,v,N,f]),n.jsx("div",{ref:I,id:`filtered-posts-${u}`,style:A!==void 0?{minHeight:A,border:"1px solid #e0e0e0",borderRadius:"4px"}:void 0,children:n.jsx(g.Container,{fluid:!0,children:M?n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:A??"100%"},children:n.jsx(g.Loader,{active:!0,inline:"centered"})}):!M&&E&&E.length>0?n.jsx(de,{posts:E,postWidth:Number(j),postHeight:Number(m),numberOfColumns:Number(C),sortFirstBy:K,countryCategory:f,wordpressSourceType:k,wordpressSource:_,locale:B}):n.jsx(ue.default,{noDataMsg:J,clearFilterMsg:L,group:u})})})},ge=Y.injectIntl(y.memo(ye));exports.default=ge;
@@ -1,23 +1,23 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import nt, { useState as R, useRef as z, useEffect as st } from "react";
3
- import { Container as O, Loader as it, Grid as q, GridRow as at } from "semantic-ui-react";
4
- import lt from "../connected-templates/PostIntro.js";
5
- import ut from "./FilteredPostsIntro.js";
6
- import { injectIntl as ct, useIntl as dt } from "react-intl";
7
- import mt from "./NoData.js";
8
- import { useDispatch as gt, useSelector as ft } from "react-redux";
9
- import { getCustomPosts as yt } from "../reducers/data-api.js";
10
- import { toNumber as pt, toBoolean as ht } from "../../utils/data.js";
11
- const bt = (p) => {
12
- const { posts: l, numberOfColumns: S, sortFirstBy: u, countryCategory: c, postWidth: b, postHeight: _, locale: T } = p, m = [];
13
- if (c && u && u !== "none") {
14
- const i = l.filter((g) => g[c].includes(Number(u))), N = l.filter((g) => !g[c].includes(Number(u)));
15
- m.push(...i), m.push(...N);
2
+ import it, { useState as B, useRef as q, useEffect as at } from "react";
3
+ import { Container as O, Loader as lt, Grid as W, GridRow as ct } from "semantic-ui-react";
4
+ import ut from "../connected-templates/PostIntro.js";
5
+ import dt from "./FilteredPostsIntro.js";
6
+ import { injectIntl as mt, useIntl as yt } from "react-intl";
7
+ import ft from "./NoData.js";
8
+ import { useDispatch as gt, useSelector as pt } from "react-redux";
9
+ import { getCustomPosts as ht } from "../reducers/data-api.js";
10
+ import { toNumber as xt, toBoolean as bt } from "../../utils/data.js";
11
+ const Nt = (p) => {
12
+ const { posts: c, numberOfColumns: w, sortFirstBy: u, countryCategory: s, postWidth: x, postHeight: z, locale: S } = p, m = [];
13
+ if (s && u && u !== "none") {
14
+ const a = c.filter((y) => y[s].includes(Number(u))), N = c.filter((y) => !y[s].includes(Number(u)));
15
+ m.push(...a), m.push(...N);
16
16
  } else
17
- m.push(...l);
18
- const x = p.wordpressSourceType === "internal" || !p.wordpressSourceType;
19
- return /* @__PURE__ */ n(q, { className: "filtered-posts", columns: S, children: /* @__PURE__ */ n(at, { children: m.map((i) => /* @__PURE__ */ n(q.Column, { children: /* @__PURE__ */ n("div", { className: "filtered-posts-column", style: { width: b, height: _, overflow: "hidden" }, children: x ? /* @__PURE__ */ n(
20
- lt,
17
+ m.push(...c);
18
+ const b = p.wordpressSourceType === "internal" || !p.wordpressSourceType;
19
+ return /* @__PURE__ */ n(W, { className: "filtered-posts", columns: w, children: /* @__PURE__ */ n(ct, { children: m.map((a) => /* @__PURE__ */ n(W.Column, { children: /* @__PURE__ */ n("div", { className: "filtered-posts-column", style: { width: x, height: z, overflow: "hidden" }, children: b ? /* @__PURE__ */ n(
20
+ ut,
21
21
  {
22
22
  style: {
23
23
  width: "100%",
@@ -28,11 +28,11 @@ const bt = (p) => {
28
28
  },
29
29
  as: O,
30
30
  fluid: !0,
31
- post: i
31
+ post: a
32
32
  },
33
- i.id
33
+ a.id
34
34
  ) : /* @__PURE__ */ n(
35
- ut,
35
+ dt,
36
36
  {
37
37
  style: {
38
38
  width: "100%",
@@ -43,145 +43,145 @@ const bt = (p) => {
43
43
  },
44
44
  as: O,
45
45
  fluid: !0,
46
- post: i,
47
- locale: T
46
+ post: a,
47
+ locale: S
48
48
  },
49
- i.id
50
- ) }) }, i.id)) }) });
51
- }, xt = (p) => {
49
+ a.id
50
+ ) }) }, a.id)) }) });
51
+ }, vt = (p) => {
52
52
  const {
53
- "data-group": l,
54
- "data-number-of-columns": S,
53
+ "data-group": c,
54
+ "data-number-of-columns": w,
55
55
  "data-type": u,
56
- "data-taxonomy": c,
57
- "data-categories": b = "[]",
58
- "data-height": _,
59
- "data-post-width": T,
56
+ "data-taxonomy": s,
57
+ "data-categories": x = "[]",
58
+ "data-height": z,
59
+ "data-post-width": S,
60
60
  "data-post-height": m,
61
- "data-number-of-items-per-page": x,
62
- "data-enable-sorting": i,
61
+ "data-number-of-items-per-page": b,
62
+ "data-enable-sorting": a,
63
63
  "data-sort-first-by": N,
64
- "data-sorting-taxonomy": g,
65
- "data-wordpress-source-type": W,
66
- "data-wordpress-source": B,
67
- "data-no-data-msg": Y,
64
+ "data-sorting-taxonomy": y,
65
+ "data-wordpress-source-type": Y,
66
+ "data-wordpress-source": _,
67
+ "data-no-data-msg": k,
68
68
  "data-clear-filter-msg": J,
69
69
  editing: L
70
- } = p, U = gt(), { locale: D } = dt(), [G, F] = R(!1), C = z(0), H = ft((t) => t).getIn(["data", "posts", l]), [P, v] = R([]), E = z(null), [I, M] = R(void 0), $ = ht(i) && N !== "none" ? pt(N) : null, f = H ?? {
70
+ } = p, U = gt(), { locale: D } = yt(), [G, v] = B(!1), C = q(0), H = pt((t) => t).getIn(["data", "posts", c]), [P, F] = B([]), E = q(null), [I, M] = B(void 0), $ = bt(a) && N !== "none" ? xt(N) : null, f = H ?? {
71
71
  yearFilter: null,
72
72
  categoryFilter: null,
73
73
  countryFilter: null,
74
74
  page: 1,
75
75
  countryTaxonomy: null,
76
76
  categoryTaxonomy: null
77
- }, w = (t) => {
77
+ }, T = (t) => {
78
78
  if (t == null)
79
79
  return { values: [], isExplicitNone: !1 };
80
- const e = Array.isArray(t) ? t : [t], o = e.some(
81
- (r) => Number(r) === Number.MIN_SAFE_INTEGER
80
+ const e = Array.isArray(t) ? t : [t], r = e.some(
81
+ (o) => Number(o) === Number.MIN_SAFE_INTEGER
82
82
  );
83
83
  return {
84
- values: e.map((r) => Number(r)).filter((r) => Number.isFinite(r) && r !== Number.MIN_SAFE_INTEGER),
85
- isExplicitNone: o
84
+ values: e.map((o) => Number(o)).filter((o) => Number.isFinite(o) && o !== Number.MIN_SAFE_INTEGER),
85
+ isExplicitNone: r
86
86
  };
87
- }, k = (t) => {
87
+ }, K = (t) => {
88
88
  if (!t || t.length === 0)
89
89
  return null;
90
- const e = Array.from(new Set(t)).map((o) => Number(o)).filter((o) => Number.isFinite(o) && o > 0).sort((o, s) => o - s);
90
+ const e = Array.from(new Set(t)).map((r) => Number(r)).filter((r) => Number.isFinite(r) && r > 0).sort((r, i) => r - i);
91
91
  return e.length > 0 ? e : null;
92
- }, K = () => {
93
- const t = w(f.yearFilter), e = t.isExplicitNone ? null : k(t.values), o = f.countryFilter ?? null, s = f.categoryFilter ?? null, r = f.categoryTaxonomy || (c && c !== "none" ? c : null), d = f.countryTaxonomy || null;
92
+ }, Q = () => {
93
+ const t = T(f.yearFilter), e = t.isExplicitNone ? null : K(t.values), r = f.countryFilter ?? null, i = f.categoryFilter ?? null, o = f.categoryTaxonomy || (s && s !== "none" ? s : null), d = f.countryTaxonomy || null;
94
94
  return {
95
95
  years: e,
96
- categoryFilter: s,
97
- categoryTaxonomy: r,
98
- countryFilter: o,
96
+ categoryFilter: i,
97
+ categoryTaxonomy: o,
98
+ countryFilter: r,
99
99
  countryTaxonomy: d
100
100
  };
101
- }, V = (t) => L ? t : decodeURIComponent(t), Q = (t) => {
101
+ }, V = (t) => L ? t : decodeURIComponent(t), X = (t) => {
102
102
  try {
103
103
  return JSON.parse(V(t));
104
104
  } catch (e) {
105
105
  return console.warn("JSON parsing failed for value:", t, "- treating as plain string. Error:", e), V(t);
106
106
  }
107
- }, X = () => {
108
- const t = Q(b);
107
+ }, Z = () => {
108
+ const t = X(x);
109
109
  return t ? typeof t == "string" ? t.split(",").map(Number) : typeof t == "number" ? [t] : t : [];
110
- }, Z = (t, e, o) => {
111
- if (o) return null;
110
+ }, tt = (t, e, r) => {
111
+ if (r) return null;
112
112
  if (t.length === 0) return e.length > 0 ? e : null;
113
113
  if (e.length === 0) return t;
114
- const s = new Set(t), r = e.filter((d) => s.has(d));
115
- return r.length > 0 ? r : null;
116
- }, tt = async () => {
114
+ const i = new Set(t), o = e.filter((d) => i.has(d));
115
+ return o.length > 0 ? o : null;
116
+ }, et = async () => {
117
117
  const t = ++C.current;
118
- E.current && M(E.current.offsetHeight), F(!0);
119
- const e = K(), o = w(X()).values, s = w(e.categoryFilter), r = Z(
120
- o,
121
- s.values,
122
- s.isExplicitNone
123
- ), d = w(e.countryFilter);
124
- if (s.isExplicitNone) {
125
- v([]), F(!1);
118
+ E.current && M(E.current.offsetHeight), v(!0);
119
+ const e = Q(), r = T(Z()).values, i = T(e.categoryFilter), o = tt(
120
+ r,
121
+ i.values,
122
+ i.isExplicitNone
123
+ ), d = T(e.countryFilter);
124
+ if (i.isExplicitNone) {
125
+ F([]), v(!1);
126
126
  return;
127
127
  }
128
128
  if (d.isExplicitNone) {
129
- v([]), F(!1);
129
+ F([]), v(!1);
130
130
  return;
131
131
  }
132
- const A = /* @__PURE__ */ new Map();
133
- e.categoryTaxonomy && r && r.length > 0 && A.set(e.categoryTaxonomy, r), e.countryTaxonomy && d.values.length > 0 && A.set(e.countryTaxonomy, d.values);
134
- const et = r ? r.join(",") : void 0, rt = {
132
+ const A = e.categoryTaxonomy && e.categoryTaxonomy !== "none" ? e.categoryTaxonomy : null, ot = A || (s && s !== "none" ? s : null) || void 0, R = /* @__PURE__ */ new Map();
133
+ A && o && o.length > 0 && R.set(A, o), e.countryTaxonomy && d.values.length > 0 && R.set(e.countryTaxonomy, d.values);
134
+ const rt = o ? o.join(",") : void 0, nt = {
135
135
  years: e.years || void 0,
136
136
  after: void 0,
137
137
  before: void 0,
138
- perPage: Number(x || 10),
138
+ perPage: Number(b || 10),
139
139
  page: f.page || 1,
140
140
  locale: D || "en",
141
141
  postType: u,
142
- taxonomy: e.categoryTaxonomy || void 0,
143
- category: et || void 0,
144
- taxonomyFilters: A,
142
+ taxonomy: ot,
143
+ category: rt || void 0,
144
+ taxonomyFilters: R,
145
145
  ordering: "date",
146
146
  orderingDirection: "desc",
147
- wpApiBase: B ?? void 0
147
+ wpApiBase: _ ?? void 0
148
148
  };
149
- await yt(rt).then((a) => {
149
+ await ht(nt).then((l) => {
150
150
  if (t === C.current)
151
- if (a) {
152
- let h = null, y = null;
153
- if (a && typeof a == "object" && "data" in a ? (h = a.data, y = a.meta) : (Array.isArray(a), h = a), v(Array.isArray(h) ? h : []), y) {
154
- const j = y["x-wp-totalpages"] ? y["x-wp-totalpages"] : 1, ot = y["x-wp-total"] ? y["x-wp-total"] : 0;
151
+ if (l) {
152
+ let h = null, g = null;
153
+ if (l && typeof l == "object" && "data" in l ? (h = l.data, g = l.meta) : (Array.isArray(l), h = l), F(Array.isArray(h) ? h : []), g) {
154
+ const j = g["x-wp-totalpages"] ? g["x-wp-totalpages"] : 1, st = g["x-wp-total"] ? g["x-wp-total"] : 0;
155
155
  j && U({
156
156
  type: "SET_POSTS_PAGINATION",
157
- group: l,
157
+ group: c,
158
158
  totalPages: Number(j),
159
- totalItems: Number(ot)
159
+ totalItems: Number(st)
160
160
  });
161
161
  }
162
162
  } else
163
- v([]);
163
+ F([]);
164
164
  }).finally(() => {
165
- t === C.current && (F(!1), M(void 0));
165
+ t === C.current && (v(!1), M(void 0));
166
166
  });
167
167
  };
168
- return st(() => {
169
- u && (async () => await tt())();
170
- }, [H, u, c, x, b, g]), /* @__PURE__ */ n("div", { ref: E, id: `filtered-posts-${l}`, style: I !== void 0 ? { minHeight: I, border: "1px solid #e0e0e0", borderRadius: "4px" } : void 0, children: /* @__PURE__ */ n(O, { fluid: !0, children: G ? /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: I ?? "100%" }, children: /* @__PURE__ */ n(it, { active: !0, inline: "centered" }) }) : !G && P && P.length > 0 ? /* @__PURE__ */ n(
171
- bt,
168
+ return at(() => {
169
+ u && (async () => await et())();
170
+ }, [H, u, s, b, x, y]), /* @__PURE__ */ n("div", { ref: E, id: `filtered-posts-${c}`, style: I !== void 0 ? { minHeight: I, border: "1px solid #e0e0e0", borderRadius: "4px" } : void 0, children: /* @__PURE__ */ n(O, { fluid: !0, children: G ? /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: I ?? "100%" }, children: /* @__PURE__ */ n(lt, { active: !0, inline: "centered" }) }) : !G && P && P.length > 0 ? /* @__PURE__ */ n(
171
+ Nt,
172
172
  {
173
173
  posts: P,
174
- postWidth: Number(T),
174
+ postWidth: Number(S),
175
175
  postHeight: Number(m),
176
- numberOfColumns: Number(S),
176
+ numberOfColumns: Number(w),
177
177
  sortFirstBy: $,
178
- countryCategory: g,
179
- wordpressSourceType: W,
180
- wordpressSource: B,
178
+ countryCategory: y,
179
+ wordpressSourceType: Y,
180
+ wordpressSource: _,
181
181
  locale: D
182
182
  }
183
- ) : /* @__PURE__ */ n(mt, { noDataMsg: Y, clearFilterMsg: J, group: l }) }) });
184
- }, Rt = ct(nt.memo(xt));
183
+ ) : /* @__PURE__ */ n(ft, { noDataMsg: k, clearFilterMsg: J, group: c }) }) });
184
+ }, zt = mt(it.memo(vt));
185
185
  export {
186
- Rt as default
186
+ zt as default
187
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devgateway/dvz-ui-react",
3
- "version": "1.8.6",
3
+ "version": "1.8.7",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",