@ogcio/design-system-react 1.26.0 → 1.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -11
- package/dist/autocomplete/use-autocomplete-controller.js +1 -1
- package/dist/browser-support/browser-support.js +1 -1
- package/dist/character-count/character-count.d.ts +6 -0
- package/dist/character-count/character-count.js +23 -0
- package/dist/character-count/types.d.ts +10 -0
- package/dist/character-count/types.js +1 -0
- package/dist/data-table/editable-table-cell.js +1 -1
- package/dist/forms/form-field/form-field.js +1 -1
- package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
- package/dist/header/header-next/components/menu/components/header-menu-item-button.js +1 -1
- package/dist/header/header-next/components/menu/components/header-menu-item-link.js +1 -1
- package/dist/hooks/use-focus-trap.js +574 -416
- package/dist/i18n/config.js +2 -2
- package/dist/i18n/utility.js +1 -1
- package/dist/{i18nInstance-D_96ADqd.js → i18nInstance-AYICsHJu.js} +8 -6
- package/dist/{i18next-B_GQfCrJ.js → i18next-Bfi2-LyH.js} +125 -117
- package/dist/index-D_wwt4P0.js +87 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +232 -229
- package/dist/link/link.js +33 -33
- package/dist/load-symbols/load-symbols.d.ts +7 -0
- package/dist/{load-fonts/load-fonts.js → load-symbols/load-symbols.js} +7 -13
- package/dist/{lodash-LsP9-6SV.js → lodash-82PmXrjJ.js} +16 -16
- package/dist/pagination/pagination.js +249 -221
- package/dist/primitives/anchor.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/textarea/textarea.d.ts +6 -0
- package/dist/textarea/textarea.js +33 -33
- package/dist/useTranslation-DiBQuy8S.js +268 -0
- package/package.json +2 -2
- package/dist/index-2sRBqKFV.js +0 -78
- package/dist/load-fonts/load-fonts.d.ts +0 -40
- package/dist/useTranslation-BmIU4GBA.js +0 -272
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { useBreakpoint as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { getDisplayPages as
|
|
8
|
-
import { w as
|
|
9
|
-
import { k as
|
|
10
|
-
import { g as
|
|
11
|
-
import { g as
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
return
|
|
2
|
+
import { jsxs as R, jsx as j } from "react/jsx-runtime";
|
|
3
|
+
import J, { createElement as z, isValidElement as D, cloneElement as K, Children as de, Fragment as he, useContext as ge, useState as ye, useEffect as ve } from "react";
|
|
4
|
+
import { Button as U } from "../button/button.js";
|
|
5
|
+
import { useBreakpoint as be, Breakpoint as re } from "../hooks/use-breakpoint.js";
|
|
6
|
+
import { Icon as X } from "../icon/icon.js";
|
|
7
|
+
import { getDisplayPages as se } from "../utils/utilities.js";
|
|
8
|
+
import { w as oe, i as L, a as Y, b as _, I as Ne, u as xe } from "../useTranslation-DiBQuy8S.js";
|
|
9
|
+
import { k as Ae } from "../i18next-Bfi2-LyH.js";
|
|
10
|
+
import { g as Ee } from "../_commonjsHelpers-DaMA6jEr.js";
|
|
11
|
+
import { g as le, b as ce, u as $e } from "../i18nInstance-AYICsHJu.js";
|
|
12
|
+
var Q, ae;
|
|
13
|
+
function Te() {
|
|
14
|
+
return ae || (ae = 1, Q = {
|
|
15
15
|
area: !0,
|
|
16
16
|
base: !0,
|
|
17
17
|
br: !0,
|
|
@@ -26,273 +26,288 @@ function be() {
|
|
|
26
26
|
source: !0,
|
|
27
27
|
track: !0,
|
|
28
28
|
wbr: !0
|
|
29
|
-
}),
|
|
29
|
+
}), Q;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
32
|
-
const
|
|
33
|
-
var
|
|
34
|
-
function
|
|
31
|
+
var Ce = Te();
|
|
32
|
+
const ke = /* @__PURE__ */ Ee(Ce);
|
|
33
|
+
var Oe = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
|
|
34
|
+
function ie(e) {
|
|
35
35
|
var t = { type: "tag", name: "", voidElement: !1, attrs: {}, children: [] }, n = e.match(/<\/?([^\s]+?)[/\s>]/);
|
|
36
|
-
if (n && (t.name = n[1], (
|
|
36
|
+
if (n && (t.name = n[1], (ke[n[1]] || e.charAt(e.length - 2) === "/") && (t.voidElement = !0), t.name.startsWith("!--"))) {
|
|
37
37
|
var r = e.indexOf("-->");
|
|
38
38
|
return { type: "comment", comment: r !== -1 ? e.slice(4, r) : "" };
|
|
39
39
|
}
|
|
40
|
-
for (var a = new RegExp(
|
|
40
|
+
for (var a = new RegExp(Oe), s = null; (s = a.exec(e)) !== null; ) if (s[0].trim()) if (s[1]) {
|
|
41
41
|
var o = s[1].trim(), c = [o, ""];
|
|
42
42
|
o.indexOf("=") > -1 && (c = o.split("=")), t.attrs[c[0]] = c[1], a.lastIndex--;
|
|
43
43
|
} else s[2] && (t.attrs[s[2]] = s[3].trim().substring(1, s[3].length - 1));
|
|
44
44
|
return t;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
function
|
|
46
|
+
var Ve = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, je = /^\s*$/, Ie = /* @__PURE__ */ Object.create(null);
|
|
47
|
+
function ue(e, t) {
|
|
48
48
|
switch (t.type) {
|
|
49
49
|
case "text":
|
|
50
50
|
return e + t.content;
|
|
51
51
|
case "tag":
|
|
52
|
-
return e += "<" + t.name + (t.attrs ? function(n) {
|
|
52
|
+
return e += "<" + t.name + (t.attrs ? (function(n) {
|
|
53
53
|
var r = [];
|
|
54
54
|
for (var a in n) r.push(a + '="' + n[a] + '"');
|
|
55
55
|
return r.length ? " " + r.join(" ") : "";
|
|
56
|
-
}(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(
|
|
56
|
+
})(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(ue, "") + "</" + t.name + ">";
|
|
57
57
|
case "comment":
|
|
58
58
|
return e + "<!--" + t.comment + "-->";
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
var
|
|
62
|
-
t || (t = {}), t.components || (t.components =
|
|
61
|
+
var _e = { parse: function(e, t) {
|
|
62
|
+
t || (t = {}), t.components || (t.components = Ie);
|
|
63
63
|
var n, r = [], a = [], s = -1, o = !1;
|
|
64
64
|
if (e.indexOf("<") !== 0) {
|
|
65
65
|
var c = e.indexOf("<");
|
|
66
66
|
r.push({ type: "text", content: c === -1 ? e : e.substring(0, c) });
|
|
67
67
|
}
|
|
68
|
-
return e.replace(
|
|
68
|
+
return e.replace(Ve, function(f, m) {
|
|
69
69
|
if (o) {
|
|
70
|
-
if (
|
|
70
|
+
if (f !== "</" + n.name + ">") return;
|
|
71
71
|
o = !1;
|
|
72
72
|
}
|
|
73
|
-
var
|
|
74
|
-
if (
|
|
75
|
-
var T =
|
|
76
|
-
return s < 0 ? (r.push(T), r) : ((
|
|
73
|
+
var p, N = f.charAt(1) !== "/", $ = f.startsWith("<!--"), g = m + f.length, l = e.charAt(g);
|
|
74
|
+
if ($) {
|
|
75
|
+
var T = ie(f);
|
|
76
|
+
return s < 0 ? (r.push(T), r) : ((p = a[s]).children.push(T), r);
|
|
77
77
|
}
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
|
|
78
|
+
if (N && (s++, (n = ie(f)).type === "tag" && t.components[n.name] && (n.type = "component", o = !0), n.voidElement || o || !l || l === "<" || n.children.push({ type: "text", content: e.slice(g, e.indexOf("<", g)) }), s === 0 && r.push(n), (p = a[s - 1]) && p.children.push(n), a[s] = n), (!N || n.voidElement) && (s > -1 && (n.voidElement || n.name === f.slice(2, -1)) && (s--, n = s === -1 ? r : a[s]), !o && l !== "<" && l)) {
|
|
79
|
+
p = s === -1 ? r : a[s].children;
|
|
80
|
+
var h = e.indexOf("<", g), x = e.slice(g, h === -1 ? void 0 : h);
|
|
81
|
+
je.test(x) && (x = " "), (h > -1 && s + p.length >= 0 || x !== " ") && p.push({ type: "text", content: x });
|
|
82
82
|
}
|
|
83
83
|
}), r;
|
|
84
84
|
}, stringify: function(e) {
|
|
85
85
|
return e.reduce(function(t, n) {
|
|
86
|
-
return t +
|
|
86
|
+
return t + ue("", n);
|
|
87
87
|
}, "");
|
|
88
88
|
} };
|
|
89
|
-
const
|
|
89
|
+
const G = (e, t) => {
|
|
90
90
|
var r;
|
|
91
91
|
if (!e) return !1;
|
|
92
92
|
const n = ((r = e.props) == null ? void 0 : r.children) ?? e.children;
|
|
93
93
|
return t ? n.length > 0 : !!n;
|
|
94
|
-
},
|
|
94
|
+
}, q = (e) => {
|
|
95
95
|
var n, r;
|
|
96
96
|
if (!e) return [];
|
|
97
97
|
const t = ((n = e.props) == null ? void 0 : n.children) ?? e.children;
|
|
98
|
-
return (r = e.props) != null && r.i18nIsDynamicList ?
|
|
99
|
-
},
|
|
98
|
+
return (r = e.props) != null && r.i18nIsDynamicList ? S(t) : t;
|
|
99
|
+
}, Se = (e) => Array.isArray(e) && e.every(D), S = (e) => Array.isArray(e) ? e : [e], Le = (e, t) => {
|
|
100
100
|
const n = {
|
|
101
101
|
...t
|
|
102
102
|
};
|
|
103
103
|
return n.props = Object.assign(e.props, t.props), n;
|
|
104
|
-
},
|
|
104
|
+
}, Fe = (e) => {
|
|
105
|
+
const t = {};
|
|
106
|
+
if (!e) return t;
|
|
107
|
+
const n = (r) => {
|
|
108
|
+
S(r).forEach((s) => {
|
|
109
|
+
L(s) || (G(s) ? n(q(s)) : _(s) && !D(s) && Object.assign(t, s));
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
return n(e), t;
|
|
113
|
+
}, pe = (e, t, n, r) => {
|
|
105
114
|
if (!e) return "";
|
|
106
115
|
let a = "";
|
|
107
|
-
const s =
|
|
108
|
-
return s.forEach((c,
|
|
109
|
-
if (
|
|
116
|
+
const s = S(e), o = t != null && t.transSupportBasicHtmlNodes ? t.transKeepBasicHtmlNodesFor ?? [] : [];
|
|
117
|
+
return s.forEach((c, f) => {
|
|
118
|
+
if (L(c)) {
|
|
110
119
|
a += `${c}`;
|
|
111
120
|
return;
|
|
112
121
|
}
|
|
113
|
-
if (
|
|
122
|
+
if (D(c)) {
|
|
114
123
|
const {
|
|
115
|
-
props:
|
|
116
|
-
type:
|
|
117
|
-
} = c,
|
|
118
|
-
if (!g &&
|
|
119
|
-
a += `<${
|
|
124
|
+
props: m,
|
|
125
|
+
type: p
|
|
126
|
+
} = c, N = Object.keys(m).length, $ = o.indexOf(p) > -1, g = m.children;
|
|
127
|
+
if (!g && $ && !N) {
|
|
128
|
+
a += `<${p}/>`;
|
|
120
129
|
return;
|
|
121
130
|
}
|
|
122
|
-
if (!g && (
|
|
123
|
-
a += `<${
|
|
131
|
+
if (!g && (!$ || N) || m.i18nIsDynamicList) {
|
|
132
|
+
a += `<${f}></${f}>`;
|
|
124
133
|
return;
|
|
125
134
|
}
|
|
126
|
-
if (
|
|
127
|
-
a += `<${
|
|
135
|
+
if ($ && N === 1 && L(g)) {
|
|
136
|
+
a += `<${p}>${g}</${p}>`;
|
|
128
137
|
return;
|
|
129
138
|
}
|
|
130
|
-
const l =
|
|
131
|
-
a += `<${
|
|
139
|
+
const l = pe(g, t, n, r);
|
|
140
|
+
a += `<${f}>${l}</${f}>`;
|
|
132
141
|
return;
|
|
133
142
|
}
|
|
134
143
|
if (c === null) {
|
|
135
|
-
|
|
144
|
+
Y(n, "TRANS_NULL_VALUE", "Passed in a null value as child", {
|
|
136
145
|
i18nKey: r
|
|
137
146
|
});
|
|
138
147
|
return;
|
|
139
148
|
}
|
|
140
|
-
if (
|
|
149
|
+
if (_(c)) {
|
|
141
150
|
const {
|
|
142
|
-
format:
|
|
143
|
-
...
|
|
144
|
-
} = c,
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
a += `{{${
|
|
151
|
+
format: m,
|
|
152
|
+
...p
|
|
153
|
+
} = c, N = Object.keys(p);
|
|
154
|
+
if (N.length === 1) {
|
|
155
|
+
const $ = m ? `${N[0]}, ${m}` : N[0];
|
|
156
|
+
a += `{{${$}}}`;
|
|
148
157
|
return;
|
|
149
158
|
}
|
|
150
|
-
|
|
159
|
+
Y(n, "TRANS_INVALID_OBJ", "Invalid child - Object should only have keys {{ value, format }} (format is optional).", {
|
|
151
160
|
i18nKey: r,
|
|
152
161
|
child: c
|
|
153
162
|
});
|
|
154
163
|
return;
|
|
155
164
|
}
|
|
156
|
-
|
|
165
|
+
Y(n, "TRANS_INVALID_VAR", "Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.", {
|
|
157
166
|
i18nKey: r,
|
|
158
167
|
child: c
|
|
159
168
|
});
|
|
160
169
|
}), a;
|
|
161
|
-
},
|
|
170
|
+
}, we = (e, t = [], n = {}) => {
|
|
162
171
|
if (!e) return e;
|
|
163
172
|
const r = Object.keys(n), a = [...t, ...r];
|
|
164
173
|
let s = "", o = 0;
|
|
165
174
|
for (; o < e.length; )
|
|
166
175
|
if (e[o] === "<") {
|
|
167
176
|
let c = !1;
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
(/^\d+$/.test(
|
|
177
|
+
const f = e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);
|
|
178
|
+
if (f) {
|
|
179
|
+
const m = f[1];
|
|
180
|
+
(/^\d+$/.test(m) || a.includes(m)) && (c = !0, s += f[0], o += f[0].length);
|
|
172
181
|
}
|
|
173
182
|
if (!c) {
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
(/^\d+$/.test(
|
|
183
|
+
const m = e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);
|
|
184
|
+
if (m) {
|
|
185
|
+
const p = m[1];
|
|
186
|
+
(/^\d+$/.test(p) || a.includes(p)) && (c = !0, s += m[0], o += m[0].length);
|
|
178
187
|
}
|
|
179
188
|
}
|
|
180
189
|
c || (s += "<", o += 1);
|
|
181
190
|
} else
|
|
182
191
|
s += e[o], o += 1;
|
|
183
192
|
return s;
|
|
184
|
-
},
|
|
193
|
+
}, ze = (e, t, n, r, a, s, o) => {
|
|
185
194
|
if (n === "") return [];
|
|
186
|
-
const c = a.transKeepBasicHtmlNodesFor || [],
|
|
187
|
-
if (!e && !t && !
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
195
|
+
const c = a.transKeepBasicHtmlNodesFor || [], f = n && new RegExp(c.map((u) => `<${u}`).join("|")).test(n);
|
|
196
|
+
if (!e && !t && !f && !o) return [n];
|
|
197
|
+
const m = t ?? {}, p = (u) => {
|
|
198
|
+
S(u).forEach((y) => {
|
|
199
|
+
L(y) || (G(y) ? p(q(y)) : _(y) && !D(y) && Object.assign(m, y));
|
|
191
200
|
});
|
|
192
201
|
};
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
...
|
|
202
|
+
p(e);
|
|
203
|
+
const N = we(n, c, m), $ = _e.parse(`<0>${N}</0>`), g = {
|
|
204
|
+
...m,
|
|
196
205
|
...s
|
|
197
|
-
}, l = (
|
|
206
|
+
}, l = (u, A, y) => {
|
|
198
207
|
var d;
|
|
199
|
-
const E =
|
|
200
|
-
return
|
|
201
|
-
}, T = (
|
|
202
|
-
|
|
208
|
+
const E = q(u), I = h(E, A.children, y);
|
|
209
|
+
return Se(E) && I.length === 0 || (d = u.props) != null && d.i18nIsDynamicList ? E : I;
|
|
210
|
+
}, T = (u, A, y, E, I) => {
|
|
211
|
+
u.dummy ? (u.children = A, y.push(K(u, {
|
|
203
212
|
key: E
|
|
204
|
-
},
|
|
205
|
-
const i = {
|
|
206
|
-
...d.props
|
|
207
|
-
};
|
|
208
|
-
return delete i.i18nIsDynamicList, I(d.type, {
|
|
209
|
-
...i,
|
|
213
|
+
}, I ? void 0 : A))) : y.push(...de.map([u], (d) => {
|
|
214
|
+
const i = "data-i18n-is-dynamic-list", O = {
|
|
210
215
|
key: E,
|
|
211
|
-
|
|
212
|
-
}
|
|
216
|
+
[i]: void 0
|
|
217
|
+
};
|
|
218
|
+
return d && d.props && Object.keys(d.props).forEach((C) => {
|
|
219
|
+
C === "ref" || C === "children" || C === "i18nIsDynamicList" || C === i || (O[C] = d.props[C]);
|
|
220
|
+
}), K(d, O, I ? null : A);
|
|
213
221
|
}));
|
|
214
|
-
},
|
|
215
|
-
const E =
|
|
216
|
-
return
|
|
217
|
-
var
|
|
218
|
-
const
|
|
222
|
+
}, h = (u, A, y) => {
|
|
223
|
+
const E = S(u);
|
|
224
|
+
return S(A).reduce((d, i, O) => {
|
|
225
|
+
var F, H;
|
|
226
|
+
const C = ((H = (F = i.children) == null ? void 0 : F[0]) == null ? void 0 : H.content) && r.services.interpolator.interpolate(i.children[0].content, g, r.language);
|
|
219
227
|
if (i.type === "tag") {
|
|
220
228
|
let k = E[parseInt(i.name, 10)];
|
|
221
|
-
!k && t && (k = t[i.name]),
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
229
|
+
!k && t && (k = t[i.name]), y.length === 1 && !k && (k = y[0][i.name]), k || (k = {});
|
|
230
|
+
const V = {
|
|
231
|
+
...i.attrs
|
|
232
|
+
};
|
|
233
|
+
o && Object.keys(V).forEach((b) => {
|
|
234
|
+
const B = V[b];
|
|
235
|
+
L(B) && (V[b] = $e(B));
|
|
236
|
+
});
|
|
237
|
+
const v = Object.keys(V).length !== 0 ? Le({
|
|
238
|
+
props: V
|
|
239
|
+
}, k) : k, w = D(v), M = w && G(i, !0) && !i.voidElement, W = f && _(v) && v.dummy && !w, Z = _(t) && Object.hasOwnProperty.call(t, i.name);
|
|
240
|
+
if (L(v)) {
|
|
241
|
+
const b = r.services.interpolator.interpolate(v, g, r.language);
|
|
242
|
+
d.push(b);
|
|
243
|
+
} else if (G(v) || M) {
|
|
244
|
+
const b = l(v, i, y);
|
|
245
|
+
T(v, b, d, O);
|
|
246
|
+
} else if (W) {
|
|
247
|
+
const b = h(E, i.children, y);
|
|
248
|
+
T(v, b, d, O);
|
|
234
249
|
} else if (Number.isNaN(parseFloat(i.name)))
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
T(v,
|
|
250
|
+
if (Z) {
|
|
251
|
+
const b = l(v, i, y);
|
|
252
|
+
T(v, b, d, O, i.voidElement);
|
|
238
253
|
} else if (a.transSupportBasicHtmlNodes && c.indexOf(i.name) > -1)
|
|
239
254
|
if (i.voidElement)
|
|
240
|
-
d.push(
|
|
241
|
-
key: `${i.name}-${
|
|
255
|
+
d.push(z(i.name, {
|
|
256
|
+
key: `${i.name}-${O}`
|
|
242
257
|
}));
|
|
243
258
|
else {
|
|
244
|
-
const
|
|
245
|
-
d.push(
|
|
246
|
-
key: `${i.name}-${
|
|
247
|
-
},
|
|
259
|
+
const b = h(E, i.children, y);
|
|
260
|
+
d.push(z(i.name, {
|
|
261
|
+
key: `${i.name}-${O}`
|
|
262
|
+
}, b));
|
|
248
263
|
}
|
|
249
264
|
else if (i.voidElement)
|
|
250
265
|
d.push(`<${i.name} />`);
|
|
251
266
|
else {
|
|
252
|
-
const
|
|
253
|
-
d.push(`<${i.name}>${
|
|
267
|
+
const b = h(E, i.children, y);
|
|
268
|
+
d.push(`<${i.name}>${b}</${i.name}>`);
|
|
254
269
|
}
|
|
255
|
-
else if (
|
|
256
|
-
const
|
|
257
|
-
|
|
270
|
+
else if (_(v) && !w) {
|
|
271
|
+
const b = i.children[0] ? C : null;
|
|
272
|
+
b && d.push(b);
|
|
258
273
|
} else
|
|
259
|
-
T(v,
|
|
274
|
+
T(v, C, d, O, i.children.length !== 1 || !C);
|
|
260
275
|
} else if (i.type === "text") {
|
|
261
|
-
const k = a.transWrapTextNodes,
|
|
262
|
-
k ? d.push(
|
|
263
|
-
key: `${i.name}-${
|
|
276
|
+
const k = a.transWrapTextNodes, V = typeof a.unescape == "function" ? a.unescape : ce().unescape, v = o ? V(r.services.interpolator.interpolate(i.content, g, r.language)) : r.services.interpolator.interpolate(i.content, g, r.language);
|
|
277
|
+
k ? d.push(z(k, {
|
|
278
|
+
key: `${i.name}-${O}`
|
|
264
279
|
}, v)) : d.push(v);
|
|
265
280
|
}
|
|
266
281
|
return d;
|
|
267
282
|
}, []);
|
|
268
|
-
},
|
|
283
|
+
}, x = h([{
|
|
269
284
|
dummy: !0,
|
|
270
285
|
children: e || []
|
|
271
|
-
}],
|
|
272
|
-
return
|
|
273
|
-
},
|
|
274
|
-
const r = e.key || t, a =
|
|
286
|
+
}], $, S(e || []));
|
|
287
|
+
return q(x[0]);
|
|
288
|
+
}, fe = (e, t, n) => {
|
|
289
|
+
const r = e.key || t, a = K(e, {
|
|
275
290
|
key: r
|
|
276
291
|
});
|
|
277
292
|
if (!a.props || !a.props.children || n.indexOf(`${t}/>`) < 0 && n.indexOf(`${t} />`) < 0)
|
|
278
293
|
return a;
|
|
279
294
|
function s() {
|
|
280
|
-
return
|
|
295
|
+
return z(he, null, a);
|
|
281
296
|
}
|
|
282
|
-
return
|
|
297
|
+
return z(s, {
|
|
283
298
|
key: r
|
|
284
299
|
});
|
|
285
|
-
},
|
|
300
|
+
}, Be = (e, t) => e.map((n, r) => fe(n, r, t)), Re = (e, t) => {
|
|
286
301
|
const n = {};
|
|
287
302
|
return Object.keys(e).forEach((r) => {
|
|
288
303
|
Object.assign(n, {
|
|
289
|
-
[r]:
|
|
304
|
+
[r]: fe(e[r], r, t)
|
|
290
305
|
});
|
|
291
306
|
}), n;
|
|
292
|
-
},
|
|
307
|
+
}, De = (e, t, n, r) => e ? Array.isArray(e) ? Be(e, t) : _(e) ? Re(e, t) : (oe(n, "TRANS_INVALID_COMPONENTS", '<Trans /> "components" prop expects an object or array', {
|
|
293
308
|
i18nKey: r
|
|
294
|
-
}), null) : null,
|
|
295
|
-
function
|
|
309
|
+
}), null) : null, He = (e) => !_(e) || Array.isArray(e) ? !1 : Object.keys(e).reduce((t, n) => t && Number.isNaN(Number.parseFloat(n)), !0);
|
|
310
|
+
function Me({
|
|
296
311
|
children: e,
|
|
297
312
|
count: t,
|
|
298
313
|
parent: n,
|
|
@@ -301,58 +316,71 @@ function Le({
|
|
|
301
316
|
tOptions: s = {},
|
|
302
317
|
values: o,
|
|
303
318
|
defaults: c,
|
|
304
|
-
components:
|
|
305
|
-
ns:
|
|
306
|
-
i18n:
|
|
307
|
-
t:
|
|
308
|
-
shouldUnescape:
|
|
319
|
+
components: f,
|
|
320
|
+
ns: m,
|
|
321
|
+
i18n: p,
|
|
322
|
+
t: N,
|
|
323
|
+
shouldUnescape: $,
|
|
309
324
|
...g
|
|
310
325
|
}) {
|
|
311
|
-
var
|
|
312
|
-
const l =
|
|
326
|
+
var b, B, P, ee, te, ne;
|
|
327
|
+
const l = p || le();
|
|
313
328
|
if (!l)
|
|
314
|
-
return
|
|
329
|
+
return oe(l, "NO_I18NEXT_INSTANCE", "Trans: You need to pass in an i18next instance using i18nextReactModule", {
|
|
315
330
|
i18nKey: r
|
|
316
331
|
}), e;
|
|
317
|
-
const T =
|
|
318
|
-
...
|
|
319
|
-
...(
|
|
332
|
+
const T = N || l.t.bind(l) || ((me) => me), h = {
|
|
333
|
+
...ce(),
|
|
334
|
+
...(b = l.options) == null ? void 0 : b.react
|
|
320
335
|
};
|
|
321
|
-
let
|
|
322
|
-
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
} =
|
|
326
|
-
|
|
327
|
-
...
|
|
336
|
+
let x = m || T.ns || ((B = l.options) == null ? void 0 : B.defaultNS);
|
|
337
|
+
x = L(x) ? [x] : x || ["translation"];
|
|
338
|
+
const {
|
|
339
|
+
transDefaultProps: u
|
|
340
|
+
} = h, A = u != null && u.tOptions ? {
|
|
341
|
+
...u.tOptions,
|
|
342
|
+
...s
|
|
343
|
+
} : s, y = $ ?? (u == null ? void 0 : u.shouldUnescape), E = u != null && u.values ? {
|
|
344
|
+
...u.values,
|
|
345
|
+
...o
|
|
346
|
+
} : o, I = u != null && u.components ? {
|
|
347
|
+
...u.components,
|
|
348
|
+
...f
|
|
349
|
+
} : f, d = pe(e, h, l, r), i = c || (A == null ? void 0 : A.defaultValue) || d || h.transEmptyNodeValue || (typeof r == "function" ? Ae(r) : r), {
|
|
350
|
+
hashTransKey: O
|
|
351
|
+
} = h, C = r || (O ? O(d || i) : d || i);
|
|
352
|
+
(ee = (P = l.options) == null ? void 0 : P.interpolation) != null && ee.defaultVariables ? o = E && Object.keys(E).length > 0 ? {
|
|
353
|
+
...E,
|
|
328
354
|
...l.options.interpolation.defaultVariables
|
|
329
355
|
} : {
|
|
330
356
|
...l.options.interpolation.defaultVariables
|
|
331
|
-
}
|
|
332
|
-
const
|
|
357
|
+
} : o = E;
|
|
358
|
+
const F = Fe(e);
|
|
359
|
+
F && typeof F.count == "number" && t === void 0 && (t = F.count);
|
|
360
|
+
const H = o || t !== void 0 && !((ne = (te = l.options) == null ? void 0 : te.interpolation) != null && ne.alwaysFormat) || !e ? A.interpolation : {
|
|
333
361
|
interpolation: {
|
|
334
|
-
...
|
|
362
|
+
...A.interpolation,
|
|
335
363
|
prefix: "#$?",
|
|
336
364
|
suffix: "?$#"
|
|
337
365
|
}
|
|
338
|
-
},
|
|
339
|
-
...
|
|
340
|
-
context: a ||
|
|
366
|
+
}, k = {
|
|
367
|
+
...A,
|
|
368
|
+
context: a || A.context,
|
|
341
369
|
count: t,
|
|
342
370
|
...o,
|
|
343
|
-
...
|
|
344
|
-
defaultValue:
|
|
345
|
-
ns:
|
|
371
|
+
...H,
|
|
372
|
+
defaultValue: i,
|
|
373
|
+
ns: x
|
|
346
374
|
};
|
|
347
|
-
let
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
let
|
|
351
|
-
|
|
352
|
-
const
|
|
353
|
-
return
|
|
375
|
+
let V = C ? T(C, k) : i;
|
|
376
|
+
V === C && i && (V = i);
|
|
377
|
+
const v = De(I, V, l, r);
|
|
378
|
+
let w = v || e, M = null;
|
|
379
|
+
He(v) && (M = v, w = e);
|
|
380
|
+
const W = ze(w, M, V, l, h, k, y), Z = n ?? h.defaultTransParent;
|
|
381
|
+
return Z ? z(Z, g, W) : W;
|
|
354
382
|
}
|
|
355
|
-
function
|
|
383
|
+
function We({
|
|
356
384
|
children: e,
|
|
357
385
|
count: t,
|
|
358
386
|
parent: n,
|
|
@@ -361,19 +389,19 @@ function we({
|
|
|
361
389
|
tOptions: s = {},
|
|
362
390
|
values: o,
|
|
363
391
|
defaults: c,
|
|
364
|
-
components:
|
|
365
|
-
ns:
|
|
366
|
-
i18n:
|
|
367
|
-
t:
|
|
368
|
-
shouldUnescape:
|
|
392
|
+
components: f,
|
|
393
|
+
ns: m,
|
|
394
|
+
i18n: p,
|
|
395
|
+
t: N,
|
|
396
|
+
shouldUnescape: $,
|
|
369
397
|
...g
|
|
370
398
|
}) {
|
|
371
|
-
var
|
|
399
|
+
var u;
|
|
372
400
|
const {
|
|
373
401
|
i18n: l,
|
|
374
402
|
defaultNS: T
|
|
375
|
-
} =
|
|
376
|
-
return
|
|
403
|
+
} = ge(Ne) || {}, h = p || l || le(), x = N || (h == null ? void 0 : h.t.bind(h));
|
|
404
|
+
return Me({
|
|
377
405
|
children: e,
|
|
378
406
|
count: t,
|
|
379
407
|
parent: n,
|
|
@@ -382,37 +410,37 @@ function we({
|
|
|
382
410
|
tOptions: s,
|
|
383
411
|
values: o,
|
|
384
412
|
defaults: c,
|
|
385
|
-
components:
|
|
386
|
-
ns:
|
|
387
|
-
i18n:
|
|
388
|
-
t:
|
|
389
|
-
shouldUnescape:
|
|
413
|
+
components: f,
|
|
414
|
+
ns: m || (x == null ? void 0 : x.ns) || T || ((u = h == null ? void 0 : h.options) == null ? void 0 : u.defaultNS),
|
|
415
|
+
i18n: h,
|
|
416
|
+
t: N,
|
|
417
|
+
shouldUnescape: $,
|
|
390
418
|
...g
|
|
391
419
|
});
|
|
392
420
|
}
|
|
393
|
-
const
|
|
421
|
+
const et = ({
|
|
394
422
|
currentPage: e,
|
|
395
423
|
totalPages: t,
|
|
396
424
|
onPageChange: n,
|
|
397
425
|
dataTestid: r
|
|
398
426
|
}) => {
|
|
399
|
-
const { t: a } =
|
|
427
|
+
const { t: a } = xe();
|
|
400
428
|
if (t === 0)
|
|
401
429
|
return null;
|
|
402
|
-
const { breakpoint: s, width: o } =
|
|
403
|
-
|
|
404
|
-
|
|
430
|
+
const { breakpoint: s, width: o } = be(), [c, f] = ye(!1);
|
|
431
|
+
ve(() => {
|
|
432
|
+
f(!0);
|
|
405
433
|
}, []);
|
|
406
|
-
const
|
|
407
|
-
(l, T) => l === -1 || l === -2 ? /* @__PURE__ */
|
|
408
|
-
|
|
434
|
+
const m = c && s === re.ExtraSmall, p = c && o !== null && o < 639, N = () => (c && s ? se(e, t, s) : se(e, t, re.Large)).map(
|
|
435
|
+
(l, T) => l === -1 || l === -2 ? /* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(
|
|
436
|
+
X,
|
|
409
437
|
{
|
|
410
438
|
role: "presentation",
|
|
411
439
|
className: "gi-text-gray-700",
|
|
412
440
|
icon: "more_horiz"
|
|
413
441
|
}
|
|
414
|
-
) }, `ellipsis-${T}`) : /* @__PURE__ */
|
|
415
|
-
|
|
442
|
+
) }, `ellipsis-${T}`) : /* @__PURE__ */ j(
|
|
443
|
+
U,
|
|
416
444
|
{
|
|
417
445
|
variant: l === e ? "primary" : "flat",
|
|
418
446
|
size: "large",
|
|
@@ -426,14 +454,14 @@ const qe = ({
|
|
|
426
454
|
},
|
|
427
455
|
l
|
|
428
456
|
)
|
|
429
|
-
),
|
|
430
|
-
|
|
457
|
+
), $ = () => /* @__PURE__ */ j("span", { className: "gi-text-md gi-leading-6", "aria-live": "polite", children: /* @__PURE__ */ R(
|
|
458
|
+
We,
|
|
431
459
|
{
|
|
432
460
|
i18nKey: "pagination.page",
|
|
433
461
|
values: { currentPage: e, totalPages: t },
|
|
434
|
-
components: { bold: /* @__PURE__ */
|
|
462
|
+
components: { bold: /* @__PURE__ */ j("span", { className: "gi-font-bold" }) },
|
|
435
463
|
children: [
|
|
436
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ R("span", { className: "gi-font-bold", children: [
|
|
437
465
|
"Page ",
|
|
438
466
|
e
|
|
439
467
|
] }),
|
|
@@ -442,7 +470,7 @@ const qe = ({
|
|
|
442
470
|
]
|
|
443
471
|
}
|
|
444
472
|
) });
|
|
445
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ R(
|
|
446
474
|
"div",
|
|
447
475
|
{
|
|
448
476
|
className: "gi-pagination",
|
|
@@ -454,8 +482,8 @@ const qe = ({
|
|
|
454
482
|
}),
|
|
455
483
|
"data-testid": r,
|
|
456
484
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
|
|
485
|
+
/* @__PURE__ */ R(
|
|
486
|
+
U,
|
|
459
487
|
{
|
|
460
488
|
variant: "flat",
|
|
461
489
|
size: "large",
|
|
@@ -465,17 +493,17 @@ const qe = ({
|
|
|
465
493
|
"aria-label": a("pagination.goToPrevious", {
|
|
466
494
|
defaultValue: "Go to previous"
|
|
467
495
|
}),
|
|
468
|
-
className:
|
|
496
|
+
className: p ? "gi-icon-btn-large" : "",
|
|
469
497
|
dataTestid: "govie-pagination-prev-btn",
|
|
470
498
|
children: [
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
!
|
|
499
|
+
/* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(X, { icon: "arrow_left_alt" }) }, "previous-btn-pagination"),
|
|
500
|
+
!p && a("pagination.previous", { defaultValue: "Previous" })
|
|
473
501
|
]
|
|
474
502
|
}
|
|
475
503
|
),
|
|
476
|
-
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
|
|
504
|
+
m ? $() : N(),
|
|
505
|
+
/* @__PURE__ */ R(
|
|
506
|
+
U,
|
|
479
507
|
{
|
|
480
508
|
disabled: e === t,
|
|
481
509
|
variant: "flat",
|
|
@@ -483,11 +511,11 @@ const qe = ({
|
|
|
483
511
|
appearance: "dark",
|
|
484
512
|
onClick: () => n(e + 1),
|
|
485
513
|
"aria-label": a("pagination.goToNext", { defaultValue: "Go to next" }),
|
|
486
|
-
className:
|
|
514
|
+
className: p ? "gi-icon-btn-large" : "",
|
|
487
515
|
dataTestid: "govie-pagination-next-btn",
|
|
488
516
|
children: [
|
|
489
|
-
!
|
|
490
|
-
/* @__PURE__ */
|
|
517
|
+
!p && a("pagination.next", { defaultValue: "Next" }),
|
|
518
|
+
/* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(X, { icon: "arrow_right_alt" }) }, "next-btn-pagination")
|
|
491
519
|
]
|
|
492
520
|
}
|
|
493
521
|
)
|
|
@@ -496,5 +524,5 @@ const qe = ({
|
|
|
496
524
|
);
|
|
497
525
|
};
|
|
498
526
|
export {
|
|
499
|
-
|
|
527
|
+
et as Pagination
|
|
500
528
|
};
|