@nice2dev/ui 1.1.10 → 1.2.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/CHANGELOG.md +76 -0
- package/README.md +12 -20
- package/dist/NiceButton-5tWvfXKl.cjs +1 -0
- package/dist/NiceButton-DHSgQT1_.js +112 -0
- package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
- package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
- package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
- package/dist/NiceColorPicker-DK30kJgy.js +486 -0
- package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
- package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
- package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
- package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
- package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
- package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
- package/dist/NiceForm-BCEXovJR.cjs +1 -0
- package/dist/NiceForm-D7oyWHXg.js +4820 -0
- package/dist/NiceForm-DUhxXArr.js +4817 -0
- package/dist/NiceForm-uCeVmTrD.cjs +1 -0
- package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
- package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
- package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
- package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
- package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
- package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
- package/dist/NiceLoginForm.css +1 -0
- package/dist/NiceMention-CA7CL5BI.js +11263 -0
- package/dist/NiceMention-CHcKRl-L.cjs +430 -0
- package/dist/NiceMention-DJD0BLcp.js +11269 -0
- package/dist/NiceMention-DcaUEMSg.cjs +430 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-C4p8a82e.cjs +1 -0
- package/dist/NiceModal-TNlkaL_i.js +85 -0
- package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
- package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
- package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
- package/dist/NicePagination-8XsBbMNx.js +165 -0
- package/dist/NicePagination-CkOoXf0f.js +165 -0
- package/dist/NicePagination-D7lek1G7.cjs +1 -0
- package/dist/NicePagination-OjTEfZJE.cjs +1 -0
- package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
- package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
- package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
- package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
- package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
- package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
- package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
- package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
- package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
- package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
- package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
- package/dist/NiceSelect-DZB1Rs9x.js +435 -0
- package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
- package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
- package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
- package/dist/NiceWindow-BEov3s9F.js +2094 -0
- package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-C047IMVn.cjs +768 -0
- package/dist/charts-CCXSb3xk.js +4752 -0
- package/dist/charts-CqETcUhH.js +4752 -0
- package/dist/charts-DouiiHOT.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BL-KmGYC.js +795 -0
- package/dist/core-Chg-oYCr.cjs +1 -0
- package/dist/core-CxBnKAhs.cjs +1 -0
- package/dist/core-D_LRh59n.js +795 -0
- package/dist/data-branching-Km4lc8P_.cjs +1 -0
- package/dist/data-branching-YQtJJEtn.js +6273 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +0 -51
- package/dist/data.mjs +3 -3
- package/dist/devops-D5yIDM3e.js +8312 -0
- package/dist/devops-rVpB0ZAX.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +6 -25
- package/dist/editors.mjs +55 -54
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.mjs +2 -2
- package/dist/index.cjs +284 -284
- package/dist/index.css +1 -1
- package/dist/index.d.ts +194 -208
- package/dist/index.mjs +20312 -19511
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +29 -29
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.mjs +3 -3
- package/dist/no-code-6WyYb3hL.cjs +331 -0
- package/dist/no-code-BH5oVFC6.js +8186 -0
- package/dist/no-code-CnHG5_Vn.js +8186 -0
- package/dist/no-code-DMKlg1Zl.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.css +1 -1
- package/dist/no-code.d.ts +25 -18
- package/dist/no-code.mjs +3 -3
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +24 -24
- package/dist/overlays.mjs +24 -490
- package/dist/pickerCommons-0vyK1Knv.js +547 -0
- package/dist/pickerCommons-BFbItm8o.cjs +1 -0
- package/dist/pickerCommons-BHirHJyn.js +548 -0
- package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +10 -7
- package/package.json +4 -6
- package/css/legacy-bg-text-aliases.css +0 -87
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useControllableState as L, useNiceTranslation as $, NiceIcon as d } from "@nice2dev/ui-core";
|
|
3
|
+
import { a as j } from "./no-code-CnHG5_Vn.js";
|
|
4
|
+
function I(p, r, e) {
|
|
5
|
+
const t = [];
|
|
6
|
+
if (r <= 1)
|
|
7
|
+
return r === 1 && t.push(1), t;
|
|
8
|
+
const m = Math.max(2, p - e), u = Math.min(r - 1, p + e);
|
|
9
|
+
t.push(1), m > 2 && t.push("dots");
|
|
10
|
+
for (let l = m; l <= u; l++)
|
|
11
|
+
t.push(l);
|
|
12
|
+
return u < r - 1 && t.push("dots"), t.push(r), t;
|
|
13
|
+
}
|
|
14
|
+
const F = ({
|
|
15
|
+
page: p,
|
|
16
|
+
defaultPage: r,
|
|
17
|
+
totalPages: e,
|
|
18
|
+
onChange: t,
|
|
19
|
+
showInfo: m = !0,
|
|
20
|
+
siblingCount: u = 2,
|
|
21
|
+
size: l = "md",
|
|
22
|
+
showFirstLast: f,
|
|
23
|
+
showJumpInput: N,
|
|
24
|
+
jumpInputLabel: _,
|
|
25
|
+
showPageSize: v,
|
|
26
|
+
pageSizeOptions: g,
|
|
27
|
+
pageSize: x,
|
|
28
|
+
onPageSizeChange: k,
|
|
29
|
+
disabled: o,
|
|
30
|
+
className: y,
|
|
31
|
+
style: C
|
|
32
|
+
}) => {
|
|
33
|
+
const [i, s] = L({
|
|
34
|
+
value: p,
|
|
35
|
+
defaultValue: r,
|
|
36
|
+
fallbackValue: 1,
|
|
37
|
+
onChange: t,
|
|
38
|
+
componentName: "NicePagination"
|
|
39
|
+
}), { t: c } = $(), M = I(i, e, u);
|
|
40
|
+
return /* @__PURE__ */ b(
|
|
41
|
+
"nav",
|
|
42
|
+
{
|
|
43
|
+
className: `nice-pagination nice-pagination--${l} ${y || ""}`,
|
|
44
|
+
style: C,
|
|
45
|
+
"aria-label": c("pagination.ariaLabel", "Pagination"),
|
|
46
|
+
children: [
|
|
47
|
+
f && /* @__PURE__ */ a(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
className: "nice-pagination__btn",
|
|
51
|
+
disabled: o || i <= 1,
|
|
52
|
+
onClick: () => s(1),
|
|
53
|
+
"aria-label": c("pagination.first", "First"),
|
|
54
|
+
title: c("pagination.first", "First"),
|
|
55
|
+
children: /* @__PURE__ */ a(d, { name: "skip-back", size: 14 })
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ a(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
className: "nice-pagination__btn",
|
|
62
|
+
disabled: o || i <= 1,
|
|
63
|
+
onClick: () => s(i - 1),
|
|
64
|
+
"aria-label": c("pagination.previous", "Previous"),
|
|
65
|
+
children: /* @__PURE__ */ a(d, { name: "chevron-left", size: 14 })
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
M.map(
|
|
69
|
+
(n, h) => n === "dots" ? /* @__PURE__ */ a("span", { className: "nice-pagination__ellipsis", children: "…" }, `dots-${h}`) : /* @__PURE__ */ a(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
className: `nice-pagination__btn ${n === i ? "nice-pagination__btn--active" : ""}`,
|
|
73
|
+
disabled: o,
|
|
74
|
+
onClick: () => s(n),
|
|
75
|
+
"aria-current": n === i ? "page" : void 0,
|
|
76
|
+
children: n
|
|
77
|
+
},
|
|
78
|
+
n
|
|
79
|
+
)
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ a(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
className: "nice-pagination__btn",
|
|
85
|
+
disabled: o || i >= e,
|
|
86
|
+
onClick: () => s(i + 1),
|
|
87
|
+
"aria-label": c("pagination.next", "Next"),
|
|
88
|
+
children: /* @__PURE__ */ a(d, { name: "chevron-right", size: 14 })
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
f && /* @__PURE__ */ a(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
className: "nice-pagination__btn",
|
|
95
|
+
disabled: o || i >= e,
|
|
96
|
+
onClick: () => s(e),
|
|
97
|
+
"aria-label": c("pagination.last", "Last"),
|
|
98
|
+
title: c("pagination.last", "Last"),
|
|
99
|
+
children: /* @__PURE__ */ a(d, { name: "skip-forward", size: 14 })
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
m && /* @__PURE__ */ b("span", { className: "nice-pagination__info", children: [
|
|
103
|
+
i,
|
|
104
|
+
" / ",
|
|
105
|
+
e
|
|
106
|
+
] }),
|
|
107
|
+
N && /* @__PURE__ */ b(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
className: "nice-pagination__jump",
|
|
111
|
+
style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: 8 },
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ a("span", { style: { fontSize: "0.85rem", color: "var(--nice-text-secondary)" }, children: _ ?? "Go to" }),
|
|
114
|
+
/* @__PURE__ */ a(
|
|
115
|
+
j,
|
|
116
|
+
{
|
|
117
|
+
size: l === "lg" ? "md" : "sm",
|
|
118
|
+
min: 1,
|
|
119
|
+
max: e,
|
|
120
|
+
step: 1,
|
|
121
|
+
value: i,
|
|
122
|
+
disabled: o,
|
|
123
|
+
onChange: (n) => {
|
|
124
|
+
const h = typeof n == "number" ? n : Number(n);
|
|
125
|
+
if (!Number.isNaN(h)) {
|
|
126
|
+
const z = Math.max(1, Math.min(e, Math.floor(h)));
|
|
127
|
+
s(z);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
v && g && g.length > 0 && /* @__PURE__ */ a(
|
|
136
|
+
"select",
|
|
137
|
+
{
|
|
138
|
+
className: "nice-pagination__size",
|
|
139
|
+
value: x ?? g[0],
|
|
140
|
+
disabled: o,
|
|
141
|
+
onChange: (n) => k?.(Number(n.target.value)),
|
|
142
|
+
style: {
|
|
143
|
+
marginLeft: 8,
|
|
144
|
+
padding: "4px 8px",
|
|
145
|
+
border: "1px solid var(--nice-border-color)",
|
|
146
|
+
borderRadius: 6,
|
|
147
|
+
background: "var(--nice-bg-primary)",
|
|
148
|
+
color: "var(--nice-text-primary)",
|
|
149
|
+
font: "inherit",
|
|
150
|
+
fontSize: "0.85rem"
|
|
151
|
+
},
|
|
152
|
+
"aria-label": "Rows per page",
|
|
153
|
+
children: g.map((n) => /* @__PURE__ */ b("option", { value: n, children: [
|
|
154
|
+
n,
|
|
155
|
+
" / page"
|
|
156
|
+
] }, n))
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
export {
|
|
164
|
+
F as N
|
|
165
|
+
};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useControllableState as L, useNiceTranslation as $, NiceIcon as d } from "@nice2dev/ui-core";
|
|
3
|
+
import { a as j } from "./no-code-BH5oVFC6.js";
|
|
4
|
+
function I(p, r, e) {
|
|
5
|
+
const t = [];
|
|
6
|
+
if (r <= 1)
|
|
7
|
+
return r === 1 && t.push(1), t;
|
|
8
|
+
const m = Math.max(2, p - e), u = Math.min(r - 1, p + e);
|
|
9
|
+
t.push(1), m > 2 && t.push("dots");
|
|
10
|
+
for (let l = m; l <= u; l++)
|
|
11
|
+
t.push(l);
|
|
12
|
+
return u < r - 1 && t.push("dots"), t.push(r), t;
|
|
13
|
+
}
|
|
14
|
+
const F = ({
|
|
15
|
+
page: p,
|
|
16
|
+
defaultPage: r,
|
|
17
|
+
totalPages: e,
|
|
18
|
+
onChange: t,
|
|
19
|
+
showInfo: m = !0,
|
|
20
|
+
siblingCount: u = 2,
|
|
21
|
+
size: l = "md",
|
|
22
|
+
showFirstLast: f,
|
|
23
|
+
showJumpInput: N,
|
|
24
|
+
jumpInputLabel: _,
|
|
25
|
+
showPageSize: v,
|
|
26
|
+
pageSizeOptions: g,
|
|
27
|
+
pageSize: x,
|
|
28
|
+
onPageSizeChange: k,
|
|
29
|
+
disabled: o,
|
|
30
|
+
className: y,
|
|
31
|
+
style: C
|
|
32
|
+
}) => {
|
|
33
|
+
const [i, s] = L({
|
|
34
|
+
value: p,
|
|
35
|
+
defaultValue: r,
|
|
36
|
+
fallbackValue: 1,
|
|
37
|
+
onChange: t,
|
|
38
|
+
componentName: "NicePagination"
|
|
39
|
+
}), { t: c } = $(), M = I(i, e, u);
|
|
40
|
+
return /* @__PURE__ */ b(
|
|
41
|
+
"nav",
|
|
42
|
+
{
|
|
43
|
+
className: `nice-pagination nice-pagination--${l} ${y || ""}`,
|
|
44
|
+
style: C,
|
|
45
|
+
"aria-label": c("pagination.ariaLabel", "Pagination"),
|
|
46
|
+
children: [
|
|
47
|
+
f && /* @__PURE__ */ a(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
className: "nice-pagination__btn",
|
|
51
|
+
disabled: o || i <= 1,
|
|
52
|
+
onClick: () => s(1),
|
|
53
|
+
"aria-label": c("pagination.first", "First"),
|
|
54
|
+
title: c("pagination.first", "First"),
|
|
55
|
+
children: /* @__PURE__ */ a(d, { name: "skip-back", size: 14 })
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
/* @__PURE__ */ a(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
className: "nice-pagination__btn",
|
|
62
|
+
disabled: o || i <= 1,
|
|
63
|
+
onClick: () => s(i - 1),
|
|
64
|
+
"aria-label": c("pagination.previous", "Previous"),
|
|
65
|
+
children: /* @__PURE__ */ a(d, { name: "chevron-left", size: 14 })
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
M.map(
|
|
69
|
+
(n, h) => n === "dots" ? /* @__PURE__ */ a("span", { className: "nice-pagination__ellipsis", children: "…" }, `dots-${h}`) : /* @__PURE__ */ a(
|
|
70
|
+
"button",
|
|
71
|
+
{
|
|
72
|
+
className: `nice-pagination__btn ${n === i ? "nice-pagination__btn--active" : ""}`,
|
|
73
|
+
disabled: o,
|
|
74
|
+
onClick: () => s(n),
|
|
75
|
+
"aria-current": n === i ? "page" : void 0,
|
|
76
|
+
children: n
|
|
77
|
+
},
|
|
78
|
+
n
|
|
79
|
+
)
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ a(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
className: "nice-pagination__btn",
|
|
85
|
+
disabled: o || i >= e,
|
|
86
|
+
onClick: () => s(i + 1),
|
|
87
|
+
"aria-label": c("pagination.next", "Next"),
|
|
88
|
+
children: /* @__PURE__ */ a(d, { name: "chevron-right", size: 14 })
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
f && /* @__PURE__ */ a(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
className: "nice-pagination__btn",
|
|
95
|
+
disabled: o || i >= e,
|
|
96
|
+
onClick: () => s(e),
|
|
97
|
+
"aria-label": c("pagination.last", "Last"),
|
|
98
|
+
title: c("pagination.last", "Last"),
|
|
99
|
+
children: /* @__PURE__ */ a(d, { name: "skip-forward", size: 14 })
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
m && /* @__PURE__ */ b("span", { className: "nice-pagination__info", children: [
|
|
103
|
+
i,
|
|
104
|
+
" / ",
|
|
105
|
+
e
|
|
106
|
+
] }),
|
|
107
|
+
N && /* @__PURE__ */ b(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
className: "nice-pagination__jump",
|
|
111
|
+
style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: 8 },
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ a("span", { style: { fontSize: "0.85rem", color: "var(--nice-text-secondary)" }, children: _ ?? "Go to" }),
|
|
114
|
+
/* @__PURE__ */ a(
|
|
115
|
+
j,
|
|
116
|
+
{
|
|
117
|
+
size: l === "lg" ? "md" : "sm",
|
|
118
|
+
min: 1,
|
|
119
|
+
max: e,
|
|
120
|
+
step: 1,
|
|
121
|
+
value: i,
|
|
122
|
+
disabled: o,
|
|
123
|
+
onChange: (n) => {
|
|
124
|
+
const h = typeof n == "number" ? n : Number(n);
|
|
125
|
+
if (!Number.isNaN(h)) {
|
|
126
|
+
const z = Math.max(1, Math.min(e, Math.floor(h)));
|
|
127
|
+
s(z);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
v && g && g.length > 0 && /* @__PURE__ */ a(
|
|
136
|
+
"select",
|
|
137
|
+
{
|
|
138
|
+
className: "nice-pagination__size",
|
|
139
|
+
value: x ?? g[0],
|
|
140
|
+
disabled: o,
|
|
141
|
+
onChange: (n) => k?.(Number(n.target.value)),
|
|
142
|
+
style: {
|
|
143
|
+
marginLeft: 8,
|
|
144
|
+
padding: "4px 8px",
|
|
145
|
+
border: "1px solid var(--nice-border-color)",
|
|
146
|
+
borderRadius: 6,
|
|
147
|
+
background: "var(--nice-bg-primary)",
|
|
148
|
+
color: "var(--nice-text-primary)",
|
|
149
|
+
font: "inherit",
|
|
150
|
+
fontSize: "0.85rem"
|
|
151
|
+
},
|
|
152
|
+
"aria-label": "Rows per page",
|
|
153
|
+
children: g.map((n) => /* @__PURE__ */ b("option", { value: n, children: [
|
|
154
|
+
n,
|
|
155
|
+
" / page"
|
|
156
|
+
] }, n))
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
export {
|
|
164
|
+
F as N
|
|
165
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),p=require("@nice2dev/ui-core"),I=require("./no-code-6WyYb3hL.cjs");function M(u,s,e){const t=[];if(s<=1)return s===1&&t.push(1),t;const g=Math.max(2,u-e),m=Math.min(s-1,u+e);t.push(1),g>2&&t.push("dots");for(let o=g;o<=m;o++)t.push(o);return m<s-1&&t.push("dots"),t.push(s),t}const z=({page:u,defaultPage:s,totalPages:e,onChange:t,showInfo:g=!0,siblingCount:m=2,size:o="md",showFirstLast:x,showJumpInput:b,jumpInputLabel:N,showPageSize:f,pageSizeOptions:h,pageSize:_,onPageSizeChange:j,disabled:r,className:v,style:k})=>{const[i,l]=p.useControllableState({value:u,defaultValue:s,fallbackValue:1,onChange:t,componentName:"NicePagination"}),{t:c}=p.useNiceTranslation(),C=M(i,e,m);return n.jsxs("nav",{className:`nice-pagination nice-pagination--${o} ${v||""}`,style:k,"aria-label":c("pagination.ariaLabel","Pagination"),children:[x&&n.jsx("button",{className:"nice-pagination__btn",disabled:r||i<=1,onClick:()=>l(1),"aria-label":c("pagination.first","First"),title:c("pagination.first","First"),children:n.jsx(p.NiceIcon,{name:"skip-back",size:14})}),n.jsx("button",{className:"nice-pagination__btn",disabled:r||i<=1,onClick:()=>l(i-1),"aria-label":c("pagination.previous","Previous"),children:n.jsx(p.NiceIcon,{name:"chevron-left",size:14})}),C.map((a,d)=>a==="dots"?n.jsx("span",{className:"nice-pagination__ellipsis",children:"…"},`dots-${d}`):n.jsx("button",{className:`nice-pagination__btn ${a===i?"nice-pagination__btn--active":""}`,disabled:r,onClick:()=>l(a),"aria-current":a===i?"page":void 0,children:a},a)),n.jsx("button",{className:"nice-pagination__btn",disabled:r||i>=e,onClick:()=>l(i+1),"aria-label":c("pagination.next","Next"),children:n.jsx(p.NiceIcon,{name:"chevron-right",size:14})}),x&&n.jsx("button",{className:"nice-pagination__btn",disabled:r||i>=e,onClick:()=>l(e),"aria-label":c("pagination.last","Last"),title:c("pagination.last","Last"),children:n.jsx(p.NiceIcon,{name:"skip-forward",size:14})}),g&&n.jsxs("span",{className:"nice-pagination__info",children:[i," / ",e]}),b&&n.jsxs("span",{className:"nice-pagination__jump",style:{display:"inline-flex",alignItems:"center",gap:6,marginLeft:8},children:[n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--nice-text-secondary)"},children:N??"Go to"}),n.jsx(I.NiceNumberInput,{size:o==="lg"?"md":"sm",min:1,max:e,step:1,value:i,disabled:r,onChange:a=>{const d=typeof a=="number"?a:Number(a);if(!Number.isNaN(d)){const y=Math.max(1,Math.min(e,Math.floor(d)));l(y)}}})]}),f&&h&&h.length>0&&n.jsx("select",{className:"nice-pagination__size",value:_??h[0],disabled:r,onChange:a=>j?.(Number(a.target.value)),style:{marginLeft:8,padding:"4px 8px",border:"1px solid var(--nice-border-color)",borderRadius:6,background:"var(--nice-bg-primary)",color:"var(--nice-text-primary)",font:"inherit",fontSize:"0.85rem"},"aria-label":"Rows per page",children:h.map(a=>n.jsxs("option",{value:a,children:[a," / page"]},a))})]})};exports.NicePagination=z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),p=require("@nice2dev/ui-core"),I=require("./no-code-DMKlg1Zl.cjs");function M(u,s,e){const t=[];if(s<=1)return s===1&&t.push(1),t;const g=Math.max(2,u-e),m=Math.min(s-1,u+e);t.push(1),g>2&&t.push("dots");for(let o=g;o<=m;o++)t.push(o);return m<s-1&&t.push("dots"),t.push(s),t}const z=({page:u,defaultPage:s,totalPages:e,onChange:t,showInfo:g=!0,siblingCount:m=2,size:o="md",showFirstLast:x,showJumpInput:b,jumpInputLabel:N,showPageSize:f,pageSizeOptions:h,pageSize:_,onPageSizeChange:j,disabled:r,className:v,style:k})=>{const[i,l]=p.useControllableState({value:u,defaultValue:s,fallbackValue:1,onChange:t,componentName:"NicePagination"}),{t:c}=p.useNiceTranslation(),C=M(i,e,m);return n.jsxs("nav",{className:`nice-pagination nice-pagination--${o} ${v||""}`,style:k,"aria-label":c("pagination.ariaLabel","Pagination"),children:[x&&n.jsx("button",{className:"nice-pagination__btn",disabled:r||i<=1,onClick:()=>l(1),"aria-label":c("pagination.first","First"),title:c("pagination.first","First"),children:n.jsx(p.NiceIcon,{name:"skip-back",size:14})}),n.jsx("button",{className:"nice-pagination__btn",disabled:r||i<=1,onClick:()=>l(i-1),"aria-label":c("pagination.previous","Previous"),children:n.jsx(p.NiceIcon,{name:"chevron-left",size:14})}),C.map((a,d)=>a==="dots"?n.jsx("span",{className:"nice-pagination__ellipsis",children:"…"},`dots-${d}`):n.jsx("button",{className:`nice-pagination__btn ${a===i?"nice-pagination__btn--active":""}`,disabled:r,onClick:()=>l(a),"aria-current":a===i?"page":void 0,children:a},a)),n.jsx("button",{className:"nice-pagination__btn",disabled:r||i>=e,onClick:()=>l(i+1),"aria-label":c("pagination.next","Next"),children:n.jsx(p.NiceIcon,{name:"chevron-right",size:14})}),x&&n.jsx("button",{className:"nice-pagination__btn",disabled:r||i>=e,onClick:()=>l(e),"aria-label":c("pagination.last","Last"),title:c("pagination.last","Last"),children:n.jsx(p.NiceIcon,{name:"skip-forward",size:14})}),g&&n.jsxs("span",{className:"nice-pagination__info",children:[i," / ",e]}),b&&n.jsxs("span",{className:"nice-pagination__jump",style:{display:"inline-flex",alignItems:"center",gap:6,marginLeft:8},children:[n.jsx("span",{style:{fontSize:"0.85rem",color:"var(--nice-text-secondary)"},children:N??"Go to"}),n.jsx(I.NiceNumberInput,{size:o==="lg"?"md":"sm",min:1,max:e,step:1,value:i,disabled:r,onChange:a=>{const d=typeof a=="number"?a:Number(a);if(!Number.isNaN(d)){const y=Math.max(1,Math.min(e,Math.floor(d)));l(y)}}})]}),f&&h&&h.length>0&&n.jsx("select",{className:"nice-pagination__size",value:_??h[0],disabled:r,onChange:a=>j?.(Number(a.target.value)),style:{marginLeft:8,padding:"4px 8px",border:"1px solid var(--nice-border-color)",borderRadius:6,background:"var(--nice-bg-primary)",color:"var(--nice-text-primary)",font:"inherit",fontSize:"0.85rem"},"aria-label":"Rows per page",children:h.map(a=>n.jsxs("option",{value:a,children:[a," / page"]},a))})]})};exports.NicePagination=z;
|