@propellerads/pagination 3.1.2 → 3.1.4
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/index.css +1 -1
- package/dist/index.js +191 -180
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import { createElement as t,
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { actionColor as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
2
|
+
import { createElement as t, forwardRef as n, useContext as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
3
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
+
import { actionColor as l, black as u, errorColor as d, gray50 as f, gray70 as p, spacing as m, successColor as h, warningColor as g, white as _ } from "@propellerads/stylevariables";
|
|
5
|
+
import v, { ThemeContext as y } from "styled-components";
|
|
6
|
+
import b from "@propellerads/label";
|
|
7
|
+
import ee from "@propellerads/select";
|
|
8
8
|
//#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
9
9
|
function x() {
|
|
10
10
|
return typeof window < "u";
|
|
@@ -48,7 +48,7 @@ function A() {
|
|
|
48
48
|
//#region ../../node_modules/@base-ui-components/utils/esm/error.js
|
|
49
49
|
var j;
|
|
50
50
|
process.env.NODE_ENV !== "production" && (j = /* @__PURE__ */ new Set());
|
|
51
|
-
function
|
|
51
|
+
function M(...e) {
|
|
52
52
|
if (process.env.NODE_ENV !== "production") {
|
|
53
53
|
let t = e.join(" ");
|
|
54
54
|
j.has(t) || (j.add(t), console.error(`Base UI: ${t}`));
|
|
@@ -57,7 +57,7 @@ function ee(...e) {
|
|
|
57
57
|
var te = typeof document < "u" ? e.useLayoutEffect : () => {};
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region ../../node_modules/@base-ui-components/utils/esm/mergeObjects.js
|
|
60
|
-
function
|
|
60
|
+
function N(e, t) {
|
|
61
61
|
if (e && !t) return e;
|
|
62
62
|
if (!e && t) return t;
|
|
63
63
|
if (e || t) return {
|
|
@@ -67,50 +67,50 @@ function M(e, t) {
|
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region ../../node_modules/@base-ui-components/react/esm/merge-props/mergeProps.js
|
|
70
|
-
var
|
|
71
|
-
function
|
|
72
|
-
let a = { ...I(e,
|
|
70
|
+
var P = {};
|
|
71
|
+
function ne(e, t, n, r, i) {
|
|
72
|
+
let a = { ...I(e, P) };
|
|
73
73
|
return t && (a = F(a, t)), n && (a = F(a, n)), r && (a = F(a, r)), i && (a = F(a, i)), a;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
if (e.length === 0) return
|
|
77
|
-
if (e.length === 1) return I(e[0],
|
|
78
|
-
let t = { ...I(e[0],
|
|
75
|
+
function re(e) {
|
|
76
|
+
if (e.length === 0) return P;
|
|
77
|
+
if (e.length === 1) return I(e[0], P);
|
|
78
|
+
let t = { ...I(e[0], P) };
|
|
79
79
|
for (let n = 1; n < e.length; n += 1) t = F(t, e[n]);
|
|
80
80
|
return t;
|
|
81
81
|
}
|
|
82
82
|
function F(e, t) {
|
|
83
|
-
return
|
|
83
|
+
return oe(t) ? t(e) : ie(e, t);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ie(e, t) {
|
|
86
86
|
if (!t) return e;
|
|
87
87
|
for (let n in t) {
|
|
88
88
|
let r = t[n];
|
|
89
89
|
switch (n) {
|
|
90
90
|
case "style":
|
|
91
|
-
e[n] =
|
|
91
|
+
e[n] = N(e.style, r);
|
|
92
92
|
break;
|
|
93
93
|
case "className":
|
|
94
94
|
e[n] = R(e.className, r);
|
|
95
95
|
break;
|
|
96
|
-
default:
|
|
96
|
+
default: ae(n, r) ? e[n] = se(e[n], r) : e[n] = r;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return e;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function ae(e, t) {
|
|
102
102
|
let n = e.charCodeAt(0), r = e.charCodeAt(1), i = e.charCodeAt(2);
|
|
103
103
|
return n === 111 && r === 110 && i >= 65 && i <= 90 && (typeof t == "function" || t === void 0);
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function oe(e) {
|
|
106
106
|
return typeof e == "function";
|
|
107
107
|
}
|
|
108
108
|
function I(e, t) {
|
|
109
|
-
return
|
|
109
|
+
return oe(e) ? e(t) : e ?? P;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function se(e, t) {
|
|
112
112
|
return t ? e ? (n) => {
|
|
113
|
-
if (
|
|
113
|
+
if (ce(n)) {
|
|
114
114
|
let r = n;
|
|
115
115
|
L(r);
|
|
116
116
|
let i = t(r);
|
|
@@ -128,7 +128,7 @@ function L(e) {
|
|
|
128
128
|
function R(e, t) {
|
|
129
129
|
return t ? e ? t + " " + e : t : e;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function ce(e) {
|
|
132
132
|
return typeof e == "object" && !!e && "nativeEvent" in e;
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
@@ -141,14 +141,14 @@ function z(e, ...t) {
|
|
|
141
141
|
//#region ../../node_modules/@base-ui-components/react/esm/composite/root/CompositeRootContext.js
|
|
142
142
|
var B = /* @__PURE__ */ e.createContext(void 0);
|
|
143
143
|
process.env.NODE_ENV !== "production" && (B.displayName = "CompositeRootContext");
|
|
144
|
-
function
|
|
144
|
+
function le(t = !1) {
|
|
145
145
|
let n = e.useContext(B);
|
|
146
146
|
if (n === void 0 && !t) throw Error(process.env.NODE_ENV === "production" ? z(16) : "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
|
|
147
147
|
return n;
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region ../../node_modules/@base-ui-components/react/esm/utils/useFocusableWhenDisabled.js
|
|
151
|
-
function
|
|
151
|
+
function ue(t) {
|
|
152
152
|
let { focusableWhenDisabled: n, disabled: r, composite: i = !1, tabIndex: a = 0, isNativeButton: o } = t, s = i && n !== !1, c = i && n === !1;
|
|
153
153
|
return { props: e.useMemo(() => {
|
|
154
154
|
let e = { onKeyDown(e) {
|
|
@@ -167,11 +167,11 @@ function le(t) {
|
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
169
|
//#region ../../node_modules/@base-ui-components/react/esm/use-button/useButton.js
|
|
170
|
-
function
|
|
171
|
-
let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0 } = t, o = e.useRef(null), s =
|
|
170
|
+
function de(t = {}) {
|
|
171
|
+
let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0 } = t, o = e.useRef(null), s = le(!0) !== void 0, c = O(() => {
|
|
172
172
|
let e = o.current;
|
|
173
173
|
return !!(e?.tagName === "A" && e?.href);
|
|
174
|
-
}), { props: l } =
|
|
174
|
+
}), { props: l } = ue({
|
|
175
175
|
focusableWhenDisabled: r,
|
|
176
176
|
disabled: n,
|
|
177
177
|
composite: s,
|
|
@@ -181,11 +181,11 @@ function ue(t = {}) {
|
|
|
181
181
|
process.env.NODE_ENV !== "production" && e.useEffect(() => {
|
|
182
182
|
if (!o.current) return;
|
|
183
183
|
let e = o.current.tagName === "BUTTON";
|
|
184
|
-
a ? e ||
|
|
184
|
+
a ? e || M("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.") : e && M("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
|
|
185
185
|
}, [a]);
|
|
186
186
|
let u = e.useCallback(() => {
|
|
187
187
|
let e = o.current;
|
|
188
|
-
|
|
188
|
+
fe(e) && s && n && l.disabled === void 0 && e.disabled && (e.disabled = !1);
|
|
189
189
|
}, [
|
|
190
190
|
n,
|
|
191
191
|
l.disabled,
|
|
@@ -194,7 +194,7 @@ function ue(t = {}) {
|
|
|
194
194
|
return te(u, [u]), {
|
|
195
195
|
getButtonProps: e.useCallback((e = {}) => {
|
|
196
196
|
let { onClick: t, onMouseDown: r, onKeyUp: i, onKeyDown: o, onPointerDown: s, ...u } = e;
|
|
197
|
-
return
|
|
197
|
+
return ne({
|
|
198
198
|
type: a ? "button" : void 0,
|
|
199
199
|
onClick(e) {
|
|
200
200
|
if (n) {
|
|
@@ -233,23 +233,23 @@ function ue(t = {}) {
|
|
|
233
233
|
})
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function fe(e) {
|
|
237
237
|
return C(e) && e.tagName === "BUTTON";
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region ../../node_modules/@base-ui-components/utils/esm/useMergedRefs.js
|
|
241
241
|
function V(e, t, n, r) {
|
|
242
242
|
let i = T(H).current;
|
|
243
|
-
return
|
|
243
|
+
return me(i, e, t, n, r) && U(i, [
|
|
244
244
|
e,
|
|
245
245
|
t,
|
|
246
246
|
n,
|
|
247
247
|
r
|
|
248
248
|
]), i.callback;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function pe(e) {
|
|
251
251
|
let t = T(H).current;
|
|
252
|
-
return
|
|
252
|
+
return he(t, e) && U(t, e), t.callback;
|
|
253
253
|
}
|
|
254
254
|
function H() {
|
|
255
255
|
return {
|
|
@@ -258,10 +258,10 @@ function H() {
|
|
|
258
258
|
refs: []
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function me(e, t, n, r, i) {
|
|
262
262
|
return e.refs[0] !== t || e.refs[1] !== n || e.refs[2] !== r || e.refs[3] !== i;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function he(e, t) {
|
|
265
265
|
return e.refs.length !== t.length || e.refs.some((e, n) => e !== t[n]);
|
|
266
266
|
}
|
|
267
267
|
function U(e, t) {
|
|
@@ -307,20 +307,20 @@ function U(e, t) {
|
|
|
307
307
|
}
|
|
308
308
|
//#endregion
|
|
309
309
|
//#region ../../node_modules/@base-ui-components/utils/esm/reactVersion.js
|
|
310
|
-
var
|
|
311
|
-
function
|
|
312
|
-
return
|
|
310
|
+
var ge = parseInt(e.version, 10);
|
|
311
|
+
function _e(e) {
|
|
312
|
+
return ge >= e;
|
|
313
313
|
}
|
|
314
314
|
//#endregion
|
|
315
315
|
//#region ../../node_modules/@base-ui-components/utils/esm/getReactElementRef.js
|
|
316
316
|
function W(t) {
|
|
317
317
|
if (!/* @__PURE__ */ e.isValidElement(t)) return null;
|
|
318
318
|
let n = t, r = n.props;
|
|
319
|
-
return (
|
|
319
|
+
return (_e(19) ? r?.ref : n.ref) ?? null;
|
|
320
320
|
}
|
|
321
321
|
//#endregion
|
|
322
322
|
//#region ../../node_modules/@base-ui-components/react/esm/utils/getStateAttributesProps.js
|
|
323
|
-
function
|
|
323
|
+
function ve(e, t) {
|
|
324
324
|
let n = {};
|
|
325
325
|
for (let r in e) {
|
|
326
326
|
let i = e[r];
|
|
@@ -335,40 +335,40 @@ function _e(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
//#endregion
|
|
337
337
|
//#region ../../node_modules/@base-ui-components/react/esm/utils/resolveClassName.js
|
|
338
|
-
function
|
|
338
|
+
function ye(e, t) {
|
|
339
339
|
return typeof e == "function" ? e(t) : e;
|
|
340
340
|
}
|
|
341
341
|
//#endregion
|
|
342
342
|
//#region ../../node_modules/@base-ui-components/react/esm/utils/resolveStyle.js
|
|
343
|
-
function
|
|
343
|
+
function be(e, t) {
|
|
344
344
|
return typeof e == "function" ? e(t) : e;
|
|
345
345
|
}
|
|
346
346
|
Object.freeze([]);
|
|
347
347
|
var G = Object.freeze({});
|
|
348
348
|
//#endregion
|
|
349
349
|
//#region ../../node_modules/@base-ui-components/react/esm/utils/useRenderElement.js
|
|
350
|
-
function
|
|
351
|
-
let r = t.render, i =
|
|
352
|
-
return n.enabled === !1 ? null :
|
|
350
|
+
function xe(e, t, n = {}) {
|
|
351
|
+
let r = t.render, i = Se(t, n);
|
|
352
|
+
return n.enabled === !1 ? null : Ce(e, r, i, n.state ?? G);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
let { className: n, style: r, render: i } = e, { state: a = G, ref: o, props: s, stateAttributesMapping: c, enabled: l = !0 } = t, u = l ?
|
|
356
|
-
return typeof document < "u" && (l ? Array.isArray(o) ? p.ref =
|
|
354
|
+
function Se(e, t = {}) {
|
|
355
|
+
let { className: n, style: r, render: i } = e, { state: a = G, ref: o, props: s, stateAttributesMapping: c, enabled: l = !0 } = t, u = l ? ye(n, a) : void 0, d = l ? be(r, a) : void 0, f = l ? ve(a, c) : G, p = l ? N(f, Array.isArray(s) ? re(s) : s) ?? G : G;
|
|
356
|
+
return typeof document < "u" && (l ? Array.isArray(o) ? p.ref = pe([
|
|
357
357
|
p.ref,
|
|
358
358
|
W(i),
|
|
359
359
|
...o
|
|
360
|
-
]) : p.ref = V(p.ref, W(i), o) : V(null, null)), l ? (u !== void 0 && (p.className = R(p.className, u)), d !== void 0 && (p.style =
|
|
360
|
+
]) : p.ref = V(p.ref, W(i), o) : V(null, null)), l ? (u !== void 0 && (p.className = R(p.className, u)), d !== void 0 && (p.style = N(p.style, d)), p) : G;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Ce(t, n, r, i) {
|
|
363
363
|
if (n) {
|
|
364
364
|
if (typeof n == "function") return n(r, i);
|
|
365
|
-
let t =
|
|
365
|
+
let t = ne(r, n.props);
|
|
366
366
|
return t.ref = r.ref, /* @__PURE__ */ e.cloneElement(n, t);
|
|
367
367
|
}
|
|
368
|
-
if (t && typeof t == "string") return
|
|
368
|
+
if (t && typeof t == "string") return we(t, r);
|
|
369
369
|
throw Error(process.env.NODE_ENV === "production" ? z(8) : "Base UI: Render element or function are not defined.");
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function we(n, r) {
|
|
372
372
|
return n === "button" ? /* @__PURE__ */ t("button", {
|
|
373
373
|
type: "button",
|
|
374
374
|
...r,
|
|
@@ -382,12 +382,12 @@ function Ce(n, r) {
|
|
|
382
382
|
//#endregion
|
|
383
383
|
//#region ../../node_modules/@base-ui-components/react/esm/button/Button.js
|
|
384
384
|
var K = /* @__PURE__ */ e.forwardRef(function(t, n) {
|
|
385
|
-
let { render: r, className: i, disabled: a = !1, focusableWhenDisabled: o = !1, nativeButton: s = !0, ...c } = t, l = !!a, { getButtonProps: u, buttonRef: d } =
|
|
385
|
+
let { render: r, className: i, disabled: a = !1, focusableWhenDisabled: o = !1, nativeButton: s = !0, ...c } = t, l = !!a, { getButtonProps: u, buttonRef: d } = de({
|
|
386
386
|
disabled: l,
|
|
387
387
|
focusableWhenDisabled: o,
|
|
388
388
|
native: s
|
|
389
389
|
});
|
|
390
|
-
return
|
|
390
|
+
return xe("button", t, {
|
|
391
391
|
state: e.useMemo(() => ({ disabled: l }), [l]),
|
|
392
392
|
ref: [n, d],
|
|
393
393
|
props: [c, u]
|
|
@@ -396,33 +396,33 @@ var K = /* @__PURE__ */ e.forwardRef(function(t, n) {
|
|
|
396
396
|
process.env.NODE_ENV !== "production" && (K.displayName = "Button");
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region ../../node_modules/clsx/dist/clsx.mjs
|
|
399
|
-
function
|
|
399
|
+
function Te(e) {
|
|
400
400
|
var t, n, r = "";
|
|
401
401
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
402
402
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
403
403
|
var i = e.length;
|
|
404
|
-
for (t = 0; t < i; t++) e[t] && (n =
|
|
404
|
+
for (t = 0; t < i; t++) e[t] && (n = Te(e[t])) && (r && (r += " "), r += n);
|
|
405
405
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
406
406
|
return r;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t =
|
|
408
|
+
function Ee() {
|
|
409
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Te(e)) && (r && (r += " "), r += t);
|
|
410
410
|
return r;
|
|
411
411
|
}
|
|
412
412
|
//#endregion
|
|
413
413
|
//#region ../../node_modules/class-variance-authority/dist/index.mjs
|
|
414
|
-
var
|
|
415
|
-
if (t?.variants == null) return
|
|
414
|
+
var De = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Oe = Ee, ke = (e, t) => (n) => {
|
|
415
|
+
if (t?.variants == null) return Oe(e, n?.class, n?.className);
|
|
416
416
|
let { variants: r, defaultVariants: i } = t, a = Object.keys(r).map((e) => {
|
|
417
417
|
let t = n?.[e], a = i?.[e];
|
|
418
418
|
if (t === null) return null;
|
|
419
|
-
let o =
|
|
419
|
+
let o = De(t) || De(a);
|
|
420
420
|
return r[e][o];
|
|
421
421
|
}), o = n && Object.entries(n).reduce((e, t) => {
|
|
422
422
|
let [n, r] = t;
|
|
423
423
|
return r === void 0 || (e[n] = r), e;
|
|
424
424
|
}, {});
|
|
425
|
-
return
|
|
425
|
+
return Oe(e, a, t?.compoundVariants?.reduce((e, t) => {
|
|
426
426
|
let { class: n, className: r, ...a } = t;
|
|
427
427
|
return Object.entries(a).every((e) => {
|
|
428
428
|
let [t, n] = e;
|
|
@@ -439,19 +439,19 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
|
|
|
439
439
|
r
|
|
440
440
|
] : e;
|
|
441
441
|
}, []), n?.class, n?.className);
|
|
442
|
-
},
|
|
442
|
+
}, Ae = (...e) => Ee(e), q = {
|
|
443
443
|
Primary: "primary",
|
|
444
444
|
Secondary: "secondary",
|
|
445
445
|
Ghost: "ghost",
|
|
446
446
|
Inline: "inline",
|
|
447
447
|
Link: "link",
|
|
448
448
|
Plain: "plain"
|
|
449
|
-
},
|
|
449
|
+
}, je = {
|
|
450
450
|
Action: "action",
|
|
451
451
|
Danger: "danger",
|
|
452
452
|
Success: "success",
|
|
453
453
|
Light: "light"
|
|
454
|
-
},
|
|
454
|
+
}, Me = ke("button", {
|
|
455
455
|
variants: {
|
|
456
456
|
variant: {
|
|
457
457
|
primary: "button--primary",
|
|
@@ -471,6 +471,10 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
|
|
|
471
471
|
true: "button--icon",
|
|
472
472
|
false: ""
|
|
473
473
|
},
|
|
474
|
+
quiet: {
|
|
475
|
+
true: "button--quiet",
|
|
476
|
+
false: ""
|
|
477
|
+
},
|
|
474
478
|
fullWidth: {
|
|
475
479
|
true: "button--full-width",
|
|
476
480
|
false: ""
|
|
@@ -492,77 +496,84 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
|
|
|
492
496
|
variant: "primary",
|
|
493
497
|
tone: "action",
|
|
494
498
|
iconOnly: !1,
|
|
499
|
+
quiet: !1,
|
|
495
500
|
fullWidth: !1,
|
|
496
501
|
loading: !1,
|
|
497
502
|
startIcon: !1,
|
|
498
503
|
endIcon: !1
|
|
499
504
|
}
|
|
500
|
-
}),
|
|
501
|
-
let [
|
|
502
|
-
|
|
503
|
-
|
|
505
|
+
}), J = n(({ variant: e = q.Primary, tone: t = je.Action, isFullWidth: n = !1, isLoading: r = !1, isAsync: l = !1, isDisabled: u = !1, isQuiet: d = !1, type: f = "button", className: p, onClick: m, icon: h, startIcon: g, endIcon: _, gtmAction: v, gtmLabel: y, children: b, ...ee }, x) => {
|
|
506
|
+
let [S, C] = o(!1), w = a(!0);
|
|
507
|
+
i(() => () => {
|
|
508
|
+
w.current = !1;
|
|
504
509
|
}, []);
|
|
505
|
-
let
|
|
506
|
-
if (
|
|
510
|
+
let T = r || S, E = async (e) => {
|
|
511
|
+
if (T) {
|
|
507
512
|
e.preventDefault();
|
|
508
513
|
return;
|
|
509
514
|
}
|
|
510
|
-
if (
|
|
515
|
+
if (m !== void 0) {
|
|
511
516
|
if (!l) {
|
|
512
|
-
|
|
517
|
+
m(e);
|
|
513
518
|
return;
|
|
514
519
|
}
|
|
515
520
|
try {
|
|
516
|
-
|
|
521
|
+
C(!0), await m(e);
|
|
517
522
|
} finally {
|
|
518
|
-
|
|
523
|
+
w.current && C(!1);
|
|
519
524
|
}
|
|
520
525
|
}
|
|
521
|
-
},
|
|
526
|
+
}, D = /* @__PURE__ */ s("span", {
|
|
522
527
|
className: "button__spinner",
|
|
523
528
|
"aria-hidden": "true"
|
|
524
|
-
}),
|
|
525
|
-
return /* @__PURE__ */
|
|
526
|
-
...
|
|
527
|
-
|
|
529
|
+
}), O = h !== void 0, k = g === void 0 && _ !== void 0, A = T && !O && !k ? D : g, j = T && k ? D : _, M = O ? T ? D : h : b;
|
|
530
|
+
return /* @__PURE__ */ c(K, {
|
|
531
|
+
...ee,
|
|
532
|
+
ref: x,
|
|
533
|
+
type: f,
|
|
528
534
|
disabled: u,
|
|
529
|
-
className:
|
|
535
|
+
className: Ae("Button", Me({
|
|
530
536
|
variant: e,
|
|
531
537
|
tone: t,
|
|
532
|
-
iconOnly:
|
|
538
|
+
iconOnly: O,
|
|
539
|
+
quiet: d,
|
|
533
540
|
fullWidth: n,
|
|
534
|
-
loading:
|
|
535
|
-
startIcon:
|
|
536
|
-
endIcon:
|
|
537
|
-
}),
|
|
538
|
-
onClick:
|
|
539
|
-
"aria-disabled":
|
|
540
|
-
"aria-busy":
|
|
541
|
-
"data-loading":
|
|
542
|
-
"gtm-action":
|
|
543
|
-
"gtm-label":
|
|
541
|
+
loading: T,
|
|
542
|
+
startIcon: A !== void 0,
|
|
543
|
+
endIcon: j !== void 0
|
|
544
|
+
}), p),
|
|
545
|
+
onClick: E,
|
|
546
|
+
"aria-disabled": T || void 0,
|
|
547
|
+
"aria-busy": T || void 0,
|
|
548
|
+
"data-loading": T || void 0,
|
|
549
|
+
"gtm-action": v,
|
|
550
|
+
"gtm-label": y,
|
|
544
551
|
children: [
|
|
545
|
-
|
|
552
|
+
A !== void 0 && /* @__PURE__ */ s("span", {
|
|
546
553
|
className: "button__icon",
|
|
547
554
|
"aria-hidden": "true",
|
|
548
|
-
children:
|
|
555
|
+
children: A
|
|
549
556
|
}),
|
|
550
|
-
|
|
551
|
-
|
|
557
|
+
M,
|
|
558
|
+
j !== void 0 && /* @__PURE__ */ s("span", {
|
|
552
559
|
className: "button__icon",
|
|
553
560
|
"aria-hidden": "true",
|
|
554
|
-
children:
|
|
561
|
+
children: j
|
|
555
562
|
})
|
|
556
563
|
]
|
|
557
564
|
});
|
|
558
|
-
}
|
|
565
|
+
});
|
|
566
|
+
J.displayName = "Button";
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region ../Icon/dist/index.js
|
|
569
|
+
var Y = {
|
|
559
570
|
ExtraSmall: "extra-small",
|
|
560
571
|
Small: "small",
|
|
561
572
|
MediumSmall: "medium-small",
|
|
562
573
|
Medium: "medium",
|
|
563
574
|
Large: "large",
|
|
564
575
|
ExtraLarge: "extra-large"
|
|
565
|
-
},
|
|
576
|
+
}, X = {
|
|
566
577
|
Black: "black",
|
|
567
578
|
White: "white",
|
|
568
579
|
Blue: "blue",
|
|
@@ -571,108 +582,108 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
|
|
|
571
582
|
Success: "success",
|
|
572
583
|
Warning: "warning",
|
|
573
584
|
Error: "error"
|
|
574
|
-
},
|
|
575
|
-
[
|
|
576
|
-
[
|
|
577
|
-
[
|
|
578
|
-
[
|
|
579
|
-
[
|
|
580
|
-
[
|
|
581
|
-
},
|
|
585
|
+
}, Z = {
|
|
586
|
+
[Y.ExtraSmall]: m * 3,
|
|
587
|
+
[Y.Small]: m * 4,
|
|
588
|
+
[Y.MediumSmall]: m * 5,
|
|
589
|
+
[Y.Medium]: m * 6,
|
|
590
|
+
[Y.Large]: m * 8,
|
|
591
|
+
[Y.ExtraLarge]: m * 16
|
|
592
|
+
}, Ne = v.svg`
|
|
582
593
|
display: inline-flex;
|
|
583
|
-
width: ${(e) =>
|
|
584
|
-
height: ${(e) =>
|
|
594
|
+
width: ${(e) => Z[e.$size]}px;
|
|
595
|
+
height: ${(e) => Z[e.$size]}px;
|
|
585
596
|
fill: ${(e) => e.$color};
|
|
586
597
|
|
|
587
598
|
&:hover {
|
|
588
599
|
fill: ${(e) => e.$hoverColor};
|
|
589
600
|
}
|
|
590
|
-
`,
|
|
591
|
-
[
|
|
592
|
-
[
|
|
593
|
-
[
|
|
594
|
-
[
|
|
595
|
-
[
|
|
596
|
-
[
|
|
597
|
-
[
|
|
598
|
-
[
|
|
599
|
-
},
|
|
600
|
-
let
|
|
601
|
-
return /* @__PURE__ */
|
|
601
|
+
`, Pe = {
|
|
602
|
+
[X.White]: () => _,
|
|
603
|
+
[X.Blue]: (e) => e?.actionColor?.main ?? l,
|
|
604
|
+
[X.Gray]: () => p,
|
|
605
|
+
[X.GrayDark]: () => f,
|
|
606
|
+
[X.Success]: (e) => e?.successColor?.main ?? h,
|
|
607
|
+
[X.Error]: (e) => e?.errorColor?.main ?? d,
|
|
608
|
+
[X.Warning]: (e) => e?.warningColor?.main ?? g,
|
|
609
|
+
[X.Black]: () => u
|
|
610
|
+
}, Fe = (e) => e in Pe, Ie = (e, t) => Fe(t) ? Pe[t](e) : t, Q = ({ children: e, size: t = Y.Medium, color: n = X.Black, hoverColor: i, ...a }) => {
|
|
611
|
+
let o = r(y);
|
|
612
|
+
return /* @__PURE__ */ s(Ne, {
|
|
602
613
|
$size: t,
|
|
603
|
-
$color:
|
|
604
|
-
$hoverColor:
|
|
614
|
+
$color: Ie(o, n),
|
|
615
|
+
$hoverColor: Ie(o, i || n),
|
|
605
616
|
viewBox: "0 0 24 24",
|
|
606
617
|
...a,
|
|
607
618
|
children: e
|
|
608
619
|
});
|
|
609
|
-
},
|
|
620
|
+
}, Le = (e) => /* @__PURE__ */ s(Q, {
|
|
610
621
|
...e,
|
|
611
|
-
children: /* @__PURE__ */
|
|
612
|
-
}),
|
|
622
|
+
children: /* @__PURE__ */ s("path", { d: "M14.71 15.88L10.83 12l3.88-3.88c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L8.71 11.3c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z" })
|
|
623
|
+
}), Re = (e) => /* @__PURE__ */ c(Q, {
|
|
613
624
|
...e,
|
|
614
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ s("path", {
|
|
615
626
|
opacity: ".87",
|
|
616
627
|
fill: "none",
|
|
617
628
|
d: "M0 0h24v24H0V0z"
|
|
618
|
-
}), /* @__PURE__ */
|
|
619
|
-
}),
|
|
629
|
+
}), /* @__PURE__ */ s("path", { d: "M17.7075 15.89L13.8175 12L17.7075 8.11C18.0975 7.72 18.0975 7.09 17.7075 6.7C17.3175 6.31 16.6875 6.31 16.2975 6.7L11.7075 11.29C11.3175 11.68 11.3175 12.31 11.7075 12.7L16.2975 17.3C16.6875 17.69 17.3175 17.69 17.7075 17.3C18.0875 16.91 18.0875 16.27 17.7075 15.89ZM6.9975 18C6.4475 18 5.9975 17.55 5.9975 17L5.9975 7C5.9975 6.45 6.4475 6 6.9975 6C7.5475 6 7.9975 6.45 7.9975 7L7.9975 17C7.9975 17.55 7.5475 18 6.9975 18Z" })]
|
|
630
|
+
}), ze = (e) => /* @__PURE__ */ c(Q, {
|
|
620
631
|
...e,
|
|
621
|
-
children: [/* @__PURE__ */
|
|
632
|
+
children: [/* @__PURE__ */ s("path", {
|
|
622
633
|
opacity: ".87",
|
|
623
634
|
fill: "none",
|
|
624
635
|
d: "M0 0h24v24H0V0z"
|
|
625
|
-
}), /* @__PURE__ */
|
|
626
|
-
}),
|
|
636
|
+
}), /* @__PURE__ */ s("path", { d: "M6.29 8.11L10.18 12l-3.89 3.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L7.7 6.7c-.39-.39-1.02-.39-1.41 0-.38.39-.38 1.03 0 1.41zM17 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1z" })]
|
|
637
|
+
}), Be = (e) => /* @__PURE__ */ s(Q, {
|
|
627
638
|
...e,
|
|
628
|
-
children: /* @__PURE__ */
|
|
629
|
-
}),
|
|
639
|
+
children: /* @__PURE__ */ s("path", { d: "M9.29 15.88L13.17 12 9.29 8.12c-.39-.39-.39-1.02 0-1.41.39-.39 1.02-.39 1.41 0l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3c-.39.39-1.02.39-1.41 0-.38-.39-.39-1.03 0-1.42z" })
|
|
640
|
+
}), Ve = v.div`
|
|
630
641
|
display: flex;
|
|
631
642
|
align-items: center;
|
|
632
|
-
`,
|
|
643
|
+
`, He = v.div`
|
|
633
644
|
display: flex;
|
|
634
645
|
align-items: center;
|
|
635
|
-
margin-right: ${
|
|
646
|
+
margin-right: ${m * 9}px;
|
|
636
647
|
|
|
637
648
|
label {
|
|
638
|
-
margin: 0 ${
|
|
649
|
+
margin: 0 ${m * 3}px 0 0;
|
|
639
650
|
}
|
|
640
651
|
|
|
641
652
|
select {
|
|
642
653
|
width: 66px;
|
|
643
654
|
}
|
|
644
|
-
`,
|
|
655
|
+
`, Ue = v.div`
|
|
645
656
|
width: 70px;
|
|
646
|
-
`,
|
|
647
|
-
margin-right: ${
|
|
648
|
-
`,
|
|
657
|
+
`, We = v.div`
|
|
658
|
+
margin-right: ${m * 8}px;
|
|
659
|
+
`, Ge = v.div`
|
|
649
660
|
display: flex;
|
|
650
|
-
`, $ =
|
|
661
|
+
`, $ = v.div`
|
|
651
662
|
&:not(:last-child) {
|
|
652
|
-
margin-right: ${
|
|
663
|
+
margin-right: ${m * 2}px;
|
|
653
664
|
}
|
|
654
|
-
`,
|
|
665
|
+
`, Ke = (e, t, n) => {
|
|
655
666
|
let r = e * (t - 1);
|
|
656
667
|
return {
|
|
657
668
|
from: r + 1,
|
|
658
669
|
to: Math.min(r + e, n),
|
|
659
670
|
total: n
|
|
660
671
|
};
|
|
661
|
-
},
|
|
672
|
+
}, qe = ({ from: e, to: t, total: n }) => `${e}-${t} of ${n}`, Je = ({ pageIndex: e, perPage: t, pageSizes: n = [
|
|
662
673
|
10,
|
|
663
674
|
20,
|
|
664
675
|
50
|
|
665
|
-
], totalPages: r, totalItems: i, setPageSize: a, canNextPage:
|
|
676
|
+
], totalPages: r, totalItems: i, setPageSize: a, canNextPage: o, gotoPage: l, canPreviousPage: u, previousPageHandler: d, nextPageHandler: f, parentElementId: p, paginationAmount: m = "", labelPerPage: h = "" }) => {
|
|
666
677
|
let g = `${p}-pagination-select-per-page`, _ = n.map((e) => ({
|
|
667
678
|
id: e,
|
|
668
679
|
label: e,
|
|
669
680
|
value: e
|
|
670
|
-
})), v = _.find(({ value: e }) => e === t),
|
|
671
|
-
return /* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
681
|
+
})), v = _.find(({ value: e }) => e === t), y = Ke(t, e + 1, i), x = m || qe(y);
|
|
682
|
+
return /* @__PURE__ */ c(Ve, { children: [
|
|
683
|
+
/* @__PURE__ */ c(He, { children: [h && /* @__PURE__ */ s(b, {
|
|
673
684
|
label: h,
|
|
674
685
|
for: g
|
|
675
|
-
}), /* @__PURE__ */
|
|
686
|
+
}), /* @__PURE__ */ s(Ue, { children: /* @__PURE__ */ s(ee, {
|
|
676
687
|
id: g,
|
|
677
688
|
onChange: (e) => {
|
|
678
689
|
e !== null && a(Number(e.value));
|
|
@@ -680,49 +691,49 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
|
|
|
680
691
|
options: _,
|
|
681
692
|
value: v
|
|
682
693
|
}) })] }),
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
variant:
|
|
687
|
-
icon: /* @__PURE__ */
|
|
688
|
-
hoverColor:
|
|
689
|
-
color:
|
|
694
|
+
/* @__PURE__ */ s(We, { children: x }),
|
|
695
|
+
/* @__PURE__ */ c(Ge, { children: [
|
|
696
|
+
/* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
|
|
697
|
+
variant: q.Ghost,
|
|
698
|
+
icon: /* @__PURE__ */ s(Re, {
|
|
699
|
+
hoverColor: X.Blue,
|
|
700
|
+
color: X.Gray
|
|
690
701
|
}),
|
|
691
702
|
"aria-label": "First page",
|
|
692
703
|
isDisabled: !u,
|
|
693
704
|
id: `${p}-pagination-first-page-button`,
|
|
694
705
|
onClick: () => l(0)
|
|
695
706
|
}) }),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
variant:
|
|
698
|
-
icon: /* @__PURE__ */
|
|
699
|
-
hoverColor:
|
|
700
|
-
color:
|
|
707
|
+
/* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
|
|
708
|
+
variant: q.Ghost,
|
|
709
|
+
icon: /* @__PURE__ */ s(Le, {
|
|
710
|
+
hoverColor: X.Blue,
|
|
711
|
+
color: X.Gray
|
|
701
712
|
}),
|
|
702
713
|
"aria-label": "Previous page",
|
|
703
714
|
isDisabled: !u,
|
|
704
715
|
id: `${p}-pagination-previous-page-button`,
|
|
705
716
|
onClick: d
|
|
706
717
|
}) }),
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
variant:
|
|
709
|
-
icon: /* @__PURE__ */
|
|
710
|
-
hoverColor:
|
|
711
|
-
color:
|
|
718
|
+
/* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
|
|
719
|
+
variant: q.Ghost,
|
|
720
|
+
icon: /* @__PURE__ */ s(Be, {
|
|
721
|
+
hoverColor: X.Blue,
|
|
722
|
+
color: X.Gray
|
|
712
723
|
}),
|
|
713
724
|
"aria-label": "Next page",
|
|
714
|
-
isDisabled: !
|
|
725
|
+
isDisabled: !o,
|
|
715
726
|
id: `${p}-pagination-next-page-button`,
|
|
716
727
|
onClick: f
|
|
717
728
|
}) }),
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
variant:
|
|
720
|
-
icon: /* @__PURE__ */
|
|
721
|
-
hoverColor:
|
|
722
|
-
color:
|
|
729
|
+
/* @__PURE__ */ s($, { children: /* @__PURE__ */ s(J, {
|
|
730
|
+
variant: q.Ghost,
|
|
731
|
+
icon: /* @__PURE__ */ s(ze, {
|
|
732
|
+
hoverColor: X.Blue,
|
|
733
|
+
color: X.Gray
|
|
723
734
|
}),
|
|
724
735
|
"aria-label": "Last page",
|
|
725
|
-
isDisabled: !
|
|
736
|
+
isDisabled: !o,
|
|
726
737
|
id: `${p}-pagination-last-page-button`,
|
|
727
738
|
onClick: () => l(r - 1)
|
|
728
739
|
}) })
|
|
@@ -730,6 +741,6 @@ var Te = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Ee = we, De
|
|
|
730
741
|
] });
|
|
731
742
|
};
|
|
732
743
|
//#endregion
|
|
733
|
-
export {
|
|
744
|
+
export { Je as default };
|
|
734
745
|
|
|
735
746
|
//# sourceMappingURL=index.js.map
|