@memobit/libs 3.26.4 → 3.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/dist/components/Banner/Banner2.js +15 -13
- package/dist/components/BoldText/BoldText.js +5 -0
- package/dist/components/Calendar/Calendar2.js +108 -135
- package/dist/components/ColorPicker/ColorPicker.css +1 -1
- package/dist/components/ColorPicker/ColorPicker2.js +114 -114
- package/dist/components/ConfirmDialog/ConfirmDialog2.js +13 -11
- package/dist/components/ConfirmPopover/ConfirmPopover2.js +26 -24
- package/dist/components/ContextMenu/ContextMenu2.js +46 -33
- package/dist/components/ControlPanel/ControlPanel2.js +95 -93
- package/dist/components/ControlPanel/ControlPanelFilter.js +205 -193
- package/dist/components/ControlPanel/ControlPanelOptions.js +190 -185
- package/dist/components/DataView/DataView.CardView.js +83 -81
- package/dist/components/DataView/DataView.ColumnSelector.js +27 -25
- package/dist/components/DataView/DataView.TableView.js +74 -72
- package/dist/components/DataView/DataView2.js +169 -167
- package/dist/components/DatePicker/DatePicker2.js +71 -69
- package/dist/components/Drawer/Drawer2.js +58 -55
- package/dist/components/Dropdown/Dropdown2.js +187 -189
- package/dist/components/InputDate/InputDate2.js +43 -41
- package/dist/components/InputSearch/InputSearch2.js +27 -25
- package/dist/components/MenuBar/MenuBar.css +1 -0
- package/dist/components/MenuBar/MenuBar2.js +46 -0
- package/dist/components/Modal/Modal2.js +49 -47
- package/dist/components/Pagination/Pagination2.js +44 -47
- package/dist/components/ScrollToTop/ScrollToTop2.js +18 -16
- package/dist/components/ThemeSettings/ThemeSettings2.js +131 -123
- package/dist/components/TipsOfTheDay/TipsOfTheDay2.js +16 -12
- package/dist/components/Toast/Toast2.js +38 -33
- package/dist/components/ToolButton/ToolButton.css +1 -0
- package/dist/components/ToolButton/ToolButton2.js +36 -0
- package/dist/components/ToolPalette/ToolPalette.css +1 -0
- package/dist/components/ToolPalette/ToolPalette2.js +83 -0
- package/dist/components/Toolbar/Toolbar2.js +58 -56
- package/dist/contexts/LanguageContext/LanguageContext.context.js +9 -0
- package/dist/contexts/LanguageContext/LanguageContext.js +19 -0
- package/dist/contexts/LanguageContext/libMessages.js +240 -0
- package/dist/helpers/Datetime.js +84 -68
- package/dist/helpers/Language.js +8 -0
- package/dist/helpers/Pagination.js +5 -4
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useLanguage.js +16 -0
- package/dist/index.d.ts +133 -6
- package/dist/index.js +417 -399
- package/dist/memobit-icons.json +4 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import './InputDate.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import {
|
|
2
|
+
import { Icon as N } from "../Icon/Icon2.js";
|
|
3
|
+
import { libMessages as M } from "../../contexts/LanguageContext/libMessages.js";
|
|
4
|
+
import { useMessages as P } from "../../hooks/useLanguage.js";
|
|
5
|
+
import { Tooltip as g } from "../Tooltip/Tooltip2.js";
|
|
4
6
|
/* empty css */
|
|
5
|
-
import { forwardRef as
|
|
7
|
+
import { forwardRef as F, useRef as T } from "react";
|
|
6
8
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
+
var q = F(({ autoComplete: v = "on", autoFocus: b, clearable: k, disabled: a, error: r, highlighted: w, id: l, label: o, max: x, min: C, onBlur: I, onChange: p, onClick: R, onKeyDown: $, onKeyUp: D, readOnly: n = !1, required: d = !1, success: c, type: j = "date", value: m }, i) => {
|
|
10
|
+
const u = P(M), f = k && m && !a && !n, h = T(null), y = (t) => {
|
|
11
|
+
h.current = t, typeof i == "function" ? i(t) : i && (i.current = t);
|
|
12
|
+
}, z = () => {
|
|
13
|
+
const t = h.current;
|
|
14
|
+
t && !a && !n && t.showPicker();
|
|
15
|
+
};
|
|
9
16
|
return /* @__PURE__ */ s("div", {
|
|
10
|
-
className: `input-date-wrapper${
|
|
17
|
+
className: `input-date-wrapper${w ? " input-date-highlighted" : ""}`,
|
|
11
18
|
children: [
|
|
12
|
-
|
|
13
|
-
htmlFor:
|
|
19
|
+
o && /* @__PURE__ */ s("label", {
|
|
20
|
+
htmlFor: l,
|
|
14
21
|
className: "input-date-label",
|
|
15
|
-
children: [
|
|
22
|
+
children: [o, d && /* @__PURE__ */ e("span", {
|
|
16
23
|
className: "input-date-required",
|
|
17
24
|
children: "*"
|
|
18
25
|
})]
|
|
@@ -21,49 +28,44 @@ var z = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, er
|
|
|
21
28
|
className: "input-date-field",
|
|
22
29
|
children: [/* @__PURE__ */ e("input", {
|
|
23
30
|
autoComplete: v,
|
|
24
|
-
autoFocus:
|
|
31
|
+
autoFocus: b,
|
|
25
32
|
disabled: a,
|
|
26
|
-
type:
|
|
27
|
-
className: `input-date${
|
|
28
|
-
id:
|
|
29
|
-
max:
|
|
30
|
-
min:
|
|
31
|
-
ref:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onKeyDown: I,
|
|
39
|
-
onKeyUp: $,
|
|
33
|
+
type: j === "date" ? "date" : "datetime-local",
|
|
34
|
+
className: `input-date${r ? " input-date-error" : ""}${c ? " input-date-success" : ""}${f ? " input-date--clearable" : ""}`,
|
|
35
|
+
id: l,
|
|
36
|
+
max: x,
|
|
37
|
+
min: C,
|
|
38
|
+
ref: y,
|
|
39
|
+
value: m ?? "",
|
|
40
|
+
onBlur: I,
|
|
41
|
+
onChange: (t) => p?.(t.target.value || void 0),
|
|
42
|
+
onClick: R,
|
|
43
|
+
onKeyDown: $,
|
|
44
|
+
onKeyUp: D,
|
|
40
45
|
readOnly: n,
|
|
41
46
|
required: d
|
|
42
47
|
}), /* @__PURE__ */ s("div", {
|
|
43
48
|
className: "input-date-actions",
|
|
44
|
-
children: [
|
|
45
|
-
title:
|
|
49
|
+
children: [f && /* @__PURE__ */ e(g, {
|
|
50
|
+
title: u.clearDate,
|
|
46
51
|
children: /* @__PURE__ */ e("button", {
|
|
47
52
|
type: "button",
|
|
48
53
|
className: "input-date-clear",
|
|
49
|
-
onClick: () =>
|
|
50
|
-
children: /* @__PURE__ */ e(
|
|
54
|
+
onClick: () => p?.(void 0),
|
|
55
|
+
children: /* @__PURE__ */ e(N, {
|
|
51
56
|
name: "clear",
|
|
52
57
|
size: "sm"
|
|
53
58
|
})
|
|
54
59
|
})
|
|
55
|
-
}), /* @__PURE__ */ e(
|
|
56
|
-
title:
|
|
60
|
+
}), /* @__PURE__ */ e(g, {
|
|
61
|
+
title: u.openCalendar,
|
|
57
62
|
children: /* @__PURE__ */ e("button", {
|
|
58
63
|
type: "button",
|
|
59
64
|
className: "input-date-picker",
|
|
60
|
-
onClick:
|
|
61
|
-
const t = h.current;
|
|
62
|
-
t && !a && !n && t.showPicker();
|
|
63
|
-
},
|
|
65
|
+
onClick: z,
|
|
64
66
|
disabled: a || n,
|
|
65
67
|
tabIndex: -1,
|
|
66
|
-
children: /* @__PURE__ */ e(
|
|
68
|
+
children: /* @__PURE__ */ e(N, {
|
|
67
69
|
name: "calendar",
|
|
68
70
|
size: "sm"
|
|
69
71
|
})
|
|
@@ -71,18 +73,18 @@ var z = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, er
|
|
|
71
73
|
})]
|
|
72
74
|
})]
|
|
73
75
|
}),
|
|
74
|
-
|
|
76
|
+
r && /* @__PURE__ */ e("span", {
|
|
75
77
|
className: "input-date-error-message",
|
|
76
|
-
children:
|
|
78
|
+
children: r
|
|
77
79
|
}),
|
|
78
|
-
|
|
80
|
+
c && /* @__PURE__ */ e("span", {
|
|
79
81
|
className: "input-date-success-message",
|
|
80
|
-
children:
|
|
82
|
+
children: c
|
|
81
83
|
})
|
|
82
84
|
]
|
|
83
85
|
});
|
|
84
86
|
});
|
|
85
|
-
|
|
87
|
+
q.displayName = "InputDate";
|
|
86
88
|
export {
|
|
87
|
-
|
|
89
|
+
q as InputDate
|
|
88
90
|
};
|
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
import './InputSearch.css';
|
|
2
2
|
import { Icon as c } from "../Icon/Icon2.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { libMessages as b } from "../../contexts/LanguageContext/libMessages.js";
|
|
4
|
+
import { useMessages as g } from "../../hooks/useLanguage.js";
|
|
5
|
+
import { Tooltip as j } from "../Tooltip/Tooltip2.js";
|
|
6
|
+
import { InputText as w } from "../InputText/InputText2.js";
|
|
5
7
|
/* empty css */
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { jsx as r, jsxs as
|
|
8
|
-
var T =
|
|
9
|
-
const
|
|
8
|
+
import { forwardRef as C } from "react";
|
|
9
|
+
import { jsx as r, jsxs as M } from "react/jsx-runtime";
|
|
10
|
+
var T = C(({ autoComplete: i = "off", autoFocus: m, disabled: t, id: l, label: n, onBlur: p, onChange: o, onClick: h, onKeyDown: f, onKeyUp: u, placeholder: d, readOnly: s = !1, required: x = !1, value: e, className: I = "" }, N) => {
|
|
11
|
+
const a = g(b), _ = () => {
|
|
10
12
|
o?.("");
|
|
11
|
-
},
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
className: `input-search ${
|
|
13
|
+
}, S = e && e.length > 0 && !t && !s;
|
|
14
|
+
return /* @__PURE__ */ M("div", {
|
|
15
|
+
className: `input-search ${I}`,
|
|
14
16
|
children: [
|
|
15
17
|
/* @__PURE__ */ r("div", {
|
|
16
18
|
className: "input-search__icon",
|
|
17
19
|
children: /* @__PURE__ */ r(c, { name: "search" })
|
|
18
20
|
}),
|
|
19
|
-
/* @__PURE__ */ r(
|
|
20
|
-
autoComplete:
|
|
21
|
-
autoFocus:
|
|
21
|
+
/* @__PURE__ */ r(w, {
|
|
22
|
+
autoComplete: i,
|
|
23
|
+
autoFocus: m,
|
|
22
24
|
disabled: t,
|
|
23
|
-
id:
|
|
24
|
-
label:
|
|
25
|
-
onBlur:
|
|
25
|
+
id: l,
|
|
26
|
+
label: n,
|
|
27
|
+
onBlur: p,
|
|
26
28
|
onChange: o,
|
|
27
|
-
onClick:
|
|
28
|
-
onKeyDown:
|
|
29
|
-
onKeyUp:
|
|
30
|
-
placeholder:
|
|
31
|
-
readOnly:
|
|
32
|
-
required:
|
|
29
|
+
onClick: h,
|
|
30
|
+
onKeyDown: f,
|
|
31
|
+
onKeyUp: u,
|
|
32
|
+
placeholder: d ?? a.searchPlaceholder,
|
|
33
|
+
readOnly: s,
|
|
34
|
+
required: x,
|
|
33
35
|
value: e,
|
|
34
|
-
ref:
|
|
36
|
+
ref: N
|
|
35
37
|
}),
|
|
36
|
-
|
|
37
|
-
title:
|
|
38
|
+
S && /* @__PURE__ */ r(j, {
|
|
39
|
+
title: a.clearSearch,
|
|
38
40
|
children: /* @__PURE__ */ r("button", {
|
|
39
41
|
type: "button",
|
|
40
42
|
className: "input-search__clear",
|
|
41
|
-
onClick:
|
|
43
|
+
onClick: _,
|
|
42
44
|
children: /* @__PURE__ */ r(c, {
|
|
43
45
|
name: "clear",
|
|
44
46
|
size: "sm"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.menu-bar{align-items:center;gap:var(--spacing-2);display:flex}.menu-bar__menu{position:relative}.menu-bar__title{padding:var(--spacing-4) var(--spacing-8);border-radius:var(--radius-sm);color:var(--body-color);font:inherit;font-size:var(--font-size-sm);cursor:default;background:0 0;border:none}.menu-bar__title:hover,.menu-bar__title--open{background:var(--list-hover-background-color)}.menu-bar__list{z-index:1200;min-width:200px;padding:var(--spacing-4);background:var(--popover-background-color);border:1px solid var(--popover-border-color);border-radius:var(--radius);box-shadow:0 var(--spacing-8) var(--spacing-24) var(--box-shadow);flex-direction:column;display:flex;position:absolute;top:100%;left:0}.menu-bar__item{justify-content:space-between;align-items:center;gap:var(--spacing-24);padding:var(--spacing-6) var(--spacing-8);border-radius:var(--radius-sm);color:var(--popover-color);font:inherit;font-size:var(--font-size-sm);text-align:left;white-space:nowrap;cursor:default;background:0 0;border:none;display:flex}.menu-bar__item:hover:not(:disabled){background:color-mix(in srgb, var(--body-accent-color) 16%, transparent)}.menu-bar__item:disabled{color:var(--body-color-muted);opacity:.6}.menu-bar__shortcut{color:var(--body-color-muted);font-size:var(--font-size-xs)}.menu-bar__separator{height:1px;margin:var(--spacing-4) var(--spacing-2);background:var(--delimiter-color)}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import './MenuBar.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { useEffect as d, useRef as m, useState as b } from "react";
|
|
4
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
|
5
|
+
var w = ({ menus: i, className: o }) => {
|
|
6
|
+
const [r, s] = b(null), l = m(null);
|
|
7
|
+
return d(() => {
|
|
8
|
+
if (r === null) return;
|
|
9
|
+
const n = (e) => {
|
|
10
|
+
e instanceof KeyboardEvent && e.key !== "Escape" || e instanceof MouseEvent && e.target instanceof Node && l.current?.contains(e.target) || s(null);
|
|
11
|
+
};
|
|
12
|
+
return window.addEventListener("mousedown", n), window.addEventListener("keydown", n), () => {
|
|
13
|
+
window.removeEventListener("mousedown", n), window.removeEventListener("keydown", n);
|
|
14
|
+
};
|
|
15
|
+
}, [r]), /* @__PURE__ */ a("div", {
|
|
16
|
+
className: `menu-bar${o ? ` ${o}` : ""}`,
|
|
17
|
+
ref: l,
|
|
18
|
+
children: i.map((n, e) => /* @__PURE__ */ u("div", {
|
|
19
|
+
className: "menu-bar__menu",
|
|
20
|
+
children: [/* @__PURE__ */ a("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
className: `menu-bar__title${r === e ? " menu-bar__title--open" : ""}`,
|
|
23
|
+
onClick: () => s(r === e ? null : e),
|
|
24
|
+
onMouseEnter: () => r !== null && s(e),
|
|
25
|
+
children: n.label
|
|
26
|
+
}), r === e && /* @__PURE__ */ a("div", {
|
|
27
|
+
className: "menu-bar__list",
|
|
28
|
+
children: n.entries.map((t, c) => t === "separator" ? /* @__PURE__ */ a("div", { className: "menu-bar__separator" }, `separator-${c}`) : /* @__PURE__ */ u("button", {
|
|
29
|
+
type: "button",
|
|
30
|
+
className: "menu-bar__item",
|
|
31
|
+
disabled: t.disabled,
|
|
32
|
+
onClick: () => {
|
|
33
|
+
s(null), t.onSelect();
|
|
34
|
+
},
|
|
35
|
+
children: [/* @__PURE__ */ a("span", { children: t.label }), t.shortcut && /* @__PURE__ */ a("span", {
|
|
36
|
+
className: "menu-bar__shortcut",
|
|
37
|
+
children: t.shortcut
|
|
38
|
+
})]
|
|
39
|
+
}, t.label))
|
|
40
|
+
})]
|
|
41
|
+
}, n.label))
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
w as MenuBar
|
|
46
|
+
};
|
|
@@ -1,87 +1,89 @@
|
|
|
1
1
|
import './Modal.css';
|
|
2
2
|
import { Icon as L } from "../Icon/Icon2.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { libMessages as P } from "../../contexts/LanguageContext/libMessages.js";
|
|
4
|
+
import { useBodyScrollLock as R } from "../../hooks/useBodyScrollLock.js";
|
|
5
|
+
import { useComponentEffect as j } from "../../hooks/useComponentEffect.js";
|
|
6
|
+
import { useMessages as w } from "../../hooks/useLanguage.js";
|
|
7
|
+
import { Button as d } from "../Button/Button2.js";
|
|
8
|
+
import { Tooltip as B } from "../Tooltip/Tooltip2.js";
|
|
7
9
|
/* empty css */
|
|
8
|
-
import { useEffect as
|
|
10
|
+
import { useEffect as S, useRef as h } from "react";
|
|
9
11
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
10
|
-
import { createPortal as
|
|
11
|
-
var
|
|
12
|
-
const E =
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
12
|
+
import { createPortal as q } from "react-dom";
|
|
13
|
+
var U = ({ children: s, className: k, fullHeight: p = !1, isOpen: a, noPadding: b = !1, onClose: n, onOverlayClick: _, primary: e, secondary: l, size: C = "auto", tertiary: t, title: g, titleIcon: r, usePortal: x = !1 }) => {
|
|
14
|
+
const E = w(P), N = j("Modal");
|
|
15
|
+
R(a);
|
|
16
|
+
const M = h(null), m = h(null);
|
|
17
|
+
if (S(() => {
|
|
16
18
|
if (!a) return;
|
|
17
|
-
const
|
|
18
|
-
if (u.key !== "Escape" || !
|
|
19
|
+
const c = (u) => {
|
|
20
|
+
if (u.key !== "Escape" || !n) return;
|
|
19
21
|
const v = document.querySelectorAll(".modal-overlay");
|
|
20
|
-
v[v.length - 1] ===
|
|
22
|
+
v[v.length - 1] === m.current && (u.stopPropagation(), n());
|
|
21
23
|
};
|
|
22
|
-
return document.addEventListener("keydown",
|
|
23
|
-
}, [a,
|
|
24
|
-
const $ =
|
|
25
|
-
ref:
|
|
24
|
+
return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
|
|
25
|
+
}, [a, n]), !a) return null;
|
|
26
|
+
const $ = e || l || t, f = /* @__PURE__ */ o("div", {
|
|
27
|
+
ref: m,
|
|
26
28
|
className: "modal-overlay",
|
|
27
29
|
onClick: _,
|
|
28
30
|
children: /* @__PURE__ */ i("div", {
|
|
29
|
-
ref:
|
|
30
|
-
className: `modal modal--${
|
|
31
|
-
onClick: (
|
|
31
|
+
ref: M,
|
|
32
|
+
className: `modal modal--${C} ${p ? "modal--full-height" : ""} ${k || ""} ${N}`,
|
|
33
|
+
onClick: (c) => c.stopPropagation(),
|
|
32
34
|
children: [
|
|
33
35
|
/* @__PURE__ */ i("div", {
|
|
34
36
|
className: "modal__header",
|
|
35
37
|
children: [/* @__PURE__ */ i("h2", { children: [
|
|
36
|
-
|
|
38
|
+
r ? /* @__PURE__ */ o(L, { name: r }) : null,
|
|
37
39
|
" ",
|
|
38
40
|
g
|
|
39
|
-
] }), /* @__PURE__ */ o(
|
|
40
|
-
title:
|
|
41
|
-
children: /* @__PURE__ */ o(
|
|
41
|
+
] }), /* @__PURE__ */ o(B, {
|
|
42
|
+
title: E.closeModal,
|
|
43
|
+
children: /* @__PURE__ */ o(d, {
|
|
42
44
|
className: "modal__close",
|
|
43
45
|
icon: "clear",
|
|
44
|
-
onClick:
|
|
46
|
+
onClick: n,
|
|
45
47
|
size: "medium",
|
|
46
48
|
variant: "ghost"
|
|
47
49
|
})
|
|
48
50
|
})]
|
|
49
51
|
}),
|
|
50
|
-
|
|
51
|
-
className: `modal__body ${
|
|
52
|
-
children:
|
|
52
|
+
s != null && /* @__PURE__ */ o("div", {
|
|
53
|
+
className: `modal__body ${b ? "modal__body--no-padding" : ""}`,
|
|
54
|
+
children: s
|
|
53
55
|
}),
|
|
54
56
|
$ && /* @__PURE__ */ i("div", {
|
|
55
57
|
className: "modal__footer",
|
|
56
58
|
children: [
|
|
57
|
-
|
|
58
|
-
variant:
|
|
59
|
-
icon:
|
|
60
|
-
onClick:
|
|
61
|
-
disabled:
|
|
62
|
-
children:
|
|
59
|
+
t && /* @__PURE__ */ o(d, {
|
|
60
|
+
variant: t.variant || "default",
|
|
61
|
+
icon: t.icon,
|
|
62
|
+
onClick: t.onClick,
|
|
63
|
+
disabled: t.disabled,
|
|
64
|
+
children: t.text
|
|
63
65
|
}),
|
|
64
|
-
|
|
65
|
-
variant:
|
|
66
|
-
icon:
|
|
67
|
-
onClick: e.onClick,
|
|
68
|
-
disabled: e.disabled,
|
|
69
|
-
children: e.text
|
|
70
|
-
}),
|
|
71
|
-
l && /* @__PURE__ */ o(c, {
|
|
72
|
-
variant: l.variant || "success",
|
|
73
|
-
icon: l.icon || "checkmark",
|
|
66
|
+
l && /* @__PURE__ */ o(d, {
|
|
67
|
+
variant: l.variant || "default",
|
|
68
|
+
icon: l.icon || "clear",
|
|
74
69
|
onClick: l.onClick,
|
|
75
70
|
disabled: l.disabled,
|
|
76
71
|
children: l.text
|
|
72
|
+
}),
|
|
73
|
+
e && /* @__PURE__ */ o(d, {
|
|
74
|
+
variant: e.variant || "success",
|
|
75
|
+
icon: e.icon || "checkmark",
|
|
76
|
+
onClick: e.onClick,
|
|
77
|
+
disabled: e.disabled,
|
|
78
|
+
children: e.text
|
|
77
79
|
})
|
|
78
80
|
]
|
|
79
81
|
})
|
|
80
82
|
]
|
|
81
83
|
})
|
|
82
84
|
});
|
|
83
|
-
return x ?
|
|
85
|
+
return x ? q(f, document.body) : f;
|
|
84
86
|
};
|
|
85
87
|
export {
|
|
86
|
-
|
|
88
|
+
U as Modal
|
|
87
89
|
};
|
|
@@ -1,92 +1,89 @@
|
|
|
1
1
|
import './Pagination.css';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { libMessages as y } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as L } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as p } from "../Button/Button2.js";
|
|
5
|
+
import { Dropdown as O } from "../Dropdown/Dropdown2.js";
|
|
6
|
+
import { useBreakpoint as I } from "../../hooks/useBreakpoint.js";
|
|
5
7
|
/* empty css */
|
|
6
|
-
import { useCallback as
|
|
7
|
-
import { jsx as t, jsxs as
|
|
8
|
-
var
|
|
9
|
-
const { isAtLeast:
|
|
10
|
-
const s =
|
|
8
|
+
import { useCallback as R, useEffect as V, useRef as j, useState as C } from "react";
|
|
9
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
10
|
+
var H = 120, U = 45, $ = 8, G = 4, Y = ({ currentPage: i, totalPages: n, totalItems: u, onPageChange: f, showPagesNumbers: D = !1, pageSizeOptions: o, pageSize: v, onPageSizeChange: b, pageSizeLabel: N, horizontalAlign: k = "left" }) => {
|
|
11
|
+
const a = L(y), { isAtLeast: l, isMobile: w } = I(), d = j(null), [c, A] = C(w ? 0 : 2), h = R(() => {
|
|
12
|
+
const s = d.current, e = s?.parentElement;
|
|
11
13
|
if (!s || !e) return;
|
|
12
|
-
let
|
|
13
|
-
for (const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
}, [
|
|
17
|
-
|
|
18
|
-
const s =
|
|
14
|
+
let r = 0;
|
|
15
|
+
for (const x of e.children) x !== s && (r += x.offsetWidth + $);
|
|
16
|
+
const W = e.clientWidth - r - ((l("desktop") ? H : U) * 2 + 90 + 90 + 48), B = Math.floor(W / 53), E = Math.min(G, Math.max(0, Math.floor(B / 2)));
|
|
17
|
+
A(E);
|
|
18
|
+
}, [l]);
|
|
19
|
+
V(() => {
|
|
20
|
+
const s = d.current, e = s?.parentElement;
|
|
19
21
|
if (!s || !e) return;
|
|
20
|
-
const
|
|
22
|
+
const r = new ResizeObserver(() => {
|
|
21
23
|
h();
|
|
22
24
|
});
|
|
23
|
-
return
|
|
25
|
+
return r.observe(s), r.observe(e), h(), () => r.disconnect();
|
|
24
26
|
}, [h]);
|
|
25
|
-
const
|
|
27
|
+
const M = o && v !== void 0 && b, _ = o?.map((s) => ({
|
|
26
28
|
label: `${s}`,
|
|
27
29
|
value: s
|
|
28
|
-
})),
|
|
30
|
+
})), T = () => {
|
|
29
31
|
const s = [], e = [];
|
|
30
|
-
for (let
|
|
31
|
-
return i -
|
|
32
|
+
for (let r = Math.max(2, i - c); r <= Math.min(n - 1, i + c); r++) s.push(r);
|
|
33
|
+
return i - c > 2 ? e.push(1, "...") : e.push(1), e.push(...s), i + c < n - 1 ? e.push("...", n) : n > 1 && e.push(n), e;
|
|
32
34
|
};
|
|
33
|
-
return
|
|
34
|
-
className: `pagination pagination--${
|
|
35
|
+
return u !== void 0 && o?.length && u <= Math.min(...o) || n <= 1 && !M ? null : /* @__PURE__ */ m("div", {
|
|
36
|
+
className: `pagination pagination--${k}`,
|
|
35
37
|
children: [
|
|
36
|
-
|
|
38
|
+
n > 1 && /* @__PURE__ */ m("div", {
|
|
37
39
|
className: "pagination__pages",
|
|
38
|
-
ref:
|
|
40
|
+
ref: d,
|
|
39
41
|
children: [
|
|
40
|
-
/* @__PURE__ */ t(
|
|
42
|
+
/* @__PURE__ */ t(p, {
|
|
41
43
|
variant: "default",
|
|
42
44
|
borders: "sharp",
|
|
43
45
|
disabled: i === 1,
|
|
44
46
|
icon: "previous",
|
|
45
|
-
onClick: () =>
|
|
46
|
-
children:
|
|
47
|
+
onClick: () => f(i - 1),
|
|
48
|
+
children: l("desktop") ? a.previous : ""
|
|
47
49
|
}),
|
|
48
|
-
|
|
50
|
+
T().map((s, e) => /* @__PURE__ */ t(p, {
|
|
49
51
|
borders: "sharp",
|
|
50
52
|
variant: s === i ? "warning" : "default",
|
|
51
53
|
disabled: typeof s == "string",
|
|
52
|
-
onClick: () => typeof s == "number" &&
|
|
54
|
+
onClick: () => typeof s == "number" && f(s),
|
|
53
55
|
children: s
|
|
54
56
|
}, e)),
|
|
55
|
-
/* @__PURE__ */ t(
|
|
57
|
+
/* @__PURE__ */ t(p, {
|
|
56
58
|
variant: "default",
|
|
57
59
|
borders: "sharp",
|
|
58
|
-
disabled: i ===
|
|
60
|
+
disabled: i === n,
|
|
59
61
|
sufixIcon: "next",
|
|
60
|
-
onClick: () =>
|
|
61
|
-
children:
|
|
62
|
+
onClick: () => f(i + 1),
|
|
63
|
+
children: l("desktop") ? a.next : ""
|
|
62
64
|
})
|
|
63
65
|
]
|
|
64
66
|
}),
|
|
65
|
-
|
|
67
|
+
M && _ && /* @__PURE__ */ m("div", {
|
|
66
68
|
className: "pagination__page-size",
|
|
67
|
-
children: [/* @__PURE__ */ t("span", { children:
|
|
69
|
+
children: [/* @__PURE__ */ t("span", { children: N ?? a.rows }), /* @__PURE__ */ t(O, {
|
|
68
70
|
name: "pageSize",
|
|
69
|
-
options:
|
|
70
|
-
value:
|
|
71
|
+
options: _,
|
|
72
|
+
value: v,
|
|
71
73
|
searchable: !1,
|
|
72
74
|
usePortal: !1,
|
|
73
75
|
onChange: (s) => {
|
|
74
|
-
s && !Array.isArray(s) &&
|
|
76
|
+
s && !Array.isArray(s) && b(Number(s.value));
|
|
75
77
|
}
|
|
76
78
|
})]
|
|
77
79
|
}),
|
|
78
|
-
|
|
80
|
+
D && /* @__PURE__ */ t("span", {
|
|
79
81
|
className: "page-info",
|
|
80
|
-
children:
|
|
81
|
-
"Page ",
|
|
82
|
-
i,
|
|
83
|
-
" of ",
|
|
84
|
-
r
|
|
85
|
-
]
|
|
82
|
+
children: a.pageOf(i, n)
|
|
86
83
|
})
|
|
87
84
|
]
|
|
88
85
|
});
|
|
89
86
|
};
|
|
90
87
|
export {
|
|
91
|
-
|
|
88
|
+
Y as Pagination
|
|
92
89
|
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import './ScrollToTop.css';
|
|
2
|
-
import {
|
|
2
|
+
import { libMessages as a } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as f } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Tooltip as u } from "../Tooltip/Tooltip2.js";
|
|
3
5
|
/* empty css */
|
|
4
|
-
import { useCallback as
|
|
6
|
+
import { useCallback as T, useEffect as d, useState as v } from "react";
|
|
5
7
|
import { jsx as t } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
const [c,
|
|
8
|
-
|
|
9
|
-
const
|
|
8
|
+
var k = ({ scrollContainer: o, scrollThreshold: s = 200, className: e }) => {
|
|
9
|
+
const i = f(a), [c, p] = v(!1);
|
|
10
|
+
d(() => {
|
|
11
|
+
const l = o ?? window, r = () => {
|
|
10
12
|
const n = o ? o.scrollTop : window.scrollY;
|
|
11
|
-
|
|
13
|
+
p(n > s);
|
|
12
14
|
};
|
|
13
|
-
return
|
|
14
|
-
|
|
15
|
+
return l.addEventListener("scroll", r, { passive: !0 }), () => {
|
|
16
|
+
l.removeEventListener("scroll", r);
|
|
15
17
|
};
|
|
16
|
-
}, [o,
|
|
17
|
-
const
|
|
18
|
+
}, [o, s]);
|
|
19
|
+
const m = T(() => {
|
|
18
20
|
o ? o.scrollTo({
|
|
19
21
|
top: 0,
|
|
20
22
|
behavior: "smooth"
|
|
@@ -23,11 +25,11 @@ var h = ({ scrollContainer: o, scrollThreshold: e = 200, className: l }) => {
|
|
|
23
25
|
behavior: "smooth"
|
|
24
26
|
});
|
|
25
27
|
}, [o]);
|
|
26
|
-
return c ? /* @__PURE__ */ t(
|
|
27
|
-
title:
|
|
28
|
+
return c ? /* @__PURE__ */ t(u, {
|
|
29
|
+
title: i.scrollToTop,
|
|
28
30
|
children: /* @__PURE__ */ t("button", {
|
|
29
|
-
className: `scroll-to-top${
|
|
30
|
-
onClick:
|
|
31
|
+
className: `scroll-to-top${e ? ` ${e}` : ""}`,
|
|
32
|
+
onClick: m,
|
|
31
33
|
children: /* @__PURE__ */ t("span", {
|
|
32
34
|
className: "scroll-to-top__icon",
|
|
33
35
|
children: "▲"
|
|
@@ -36,5 +38,5 @@ var h = ({ scrollContainer: o, scrollThreshold: e = 200, className: l }) => {
|
|
|
36
38
|
}) : null;
|
|
37
39
|
};
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
k as ScrollToTop
|
|
40
42
|
};
|