@nice2dev/ui 1.1.9 → 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.
Files changed (163) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +27 -34
  3. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  4. package/dist/NiceButton-DHSgQT1_.js +112 -0
  5. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  6. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  7. package/dist/NiceCodeEditor-BfkH1bsZ.cjs +260 -0
  8. package/dist/NiceCodeEditor-CduGYggj.js +1179 -0
  9. package/dist/NiceColorPicker-CdUnhM-A.cjs +1 -0
  10. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  11. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  12. package/dist/NiceColorPicker-DpXwnDwL.js +598 -0
  13. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  14. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  15. package/dist/NiceConfirmDialog-B7aNRL2K.cjs +1 -0
  16. package/dist/NiceConfirmDialog-BdhWenrO.js +81 -0
  17. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  18. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  19. package/dist/NiceDataGrid-CVYEo_nv.cjs +10 -0
  20. package/dist/NiceDataGrid-D-rm4lu8.js +2217 -0
  21. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  22. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  23. package/dist/NiceDocumentViewer-BgcgLWJ3.cjs +180 -0
  24. package/dist/NiceDocumentViewer-sukmGhRx.js +672 -0
  25. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  26. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  27. package/dist/NiceForm-DUhxXArr.js +4817 -0
  28. package/dist/NiceForm-DVc0Xoly.js +4819 -0
  29. package/dist/NiceForm-qD_RKPYz.cjs +1 -0
  30. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  31. package/dist/NiceGantt-4UBd4uJ8.cjs +1 -0
  32. package/dist/NiceGantt-B_1lwEsp.js +328 -0
  33. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  34. package/dist/NiceHtmlEditor-Bce9Vwe1.cjs +10 -0
  35. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  36. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  37. package/dist/NiceHtmlEditor-CGRgcu2h.js +848 -0
  38. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  39. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  40. package/dist/NiceLoginForm-BTuQ0eKk.cjs +1 -0
  41. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  42. package/dist/NiceLoginForm-o1A-TBcp.js +736 -0
  43. package/dist/NiceLoginForm.css +1 -0
  44. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  45. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  46. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  47. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  48. package/dist/NiceMention-Dds9GQzk.cjs +430 -0
  49. package/dist/NiceMention-DlLXWddO.js +11268 -0
  50. package/dist/NiceMention.css +1 -1
  51. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  52. package/dist/NiceModal-Dr1e3nQZ.cjs +1 -0
  53. package/dist/NiceModal-TNlkaL_i.js +85 -0
  54. package/dist/NiceModal-sihGCfDy.js +95 -0
  55. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  56. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  57. package/dist/NiceModuleLifecyclePanel-Du7G3-RG.js +7053 -0
  58. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  59. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  60. package/dist/NiceModuleLifecyclePanel-js1p7LIY.cjs +1 -0
  61. package/dist/NicePagination-8XsBbMNx.js +165 -0
  62. package/dist/NicePagination-CkOoXf0f.js +165 -0
  63. package/dist/NicePagination-D44waj9o.cjs +1 -0
  64. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  65. package/dist/NicePagination-DdxH8KMG.js +179 -0
  66. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  67. package/dist/NicePivotGrid-B2YHP3Z6.js +1183 -0
  68. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  69. package/dist/NicePivotGrid-BtVUWiud.cjs +152 -0
  70. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  71. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  72. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  73. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  74. package/dist/NiceSavedQueryPanel-C0A-eoYN.js +5142 -0
  75. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  76. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  77. package/dist/NiceSavedQueryPanel-ZrilZRtf.cjs +586 -0
  78. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  79. package/dist/NiceSavedQueryPanel.css +1 -1
  80. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  81. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  82. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  83. package/dist/NiceScheduler-KSzaUQxC.js +1693 -0
  84. package/dist/NiceScheduler-O3AwmdGG.cjs +5 -0
  85. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  86. package/dist/NiceSelect-BCbWtu1v.js +433 -0
  87. package/dist/NiceSelect-BqtiQbfD.cjs +1 -0
  88. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  89. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  90. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  91. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  92. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  93. package/dist/NiceWindow-BU1Ce7gS.js +1623 -0
  94. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  95. package/dist/NiceWindow-jjdE6vGy.cjs +1 -0
  96. package/dist/NiceWindow.css +1 -1
  97. package/dist/charts-C047IMVn.cjs +768 -0
  98. package/dist/charts-C44vJber.cjs +768 -0
  99. package/dist/charts-CCXSb3xk.js +4752 -0
  100. package/dist/charts-CqETcUhH.js +4752 -0
  101. package/dist/charts-DouiiHOT.cjs +768 -0
  102. package/dist/charts-XVlDwU0y.js +4732 -0
  103. package/dist/charts.cjs +1 -1
  104. package/dist/charts.mjs +8 -8
  105. package/dist/core-BL-KmGYC.js +795 -0
  106. package/dist/core-BxiH7vkV.cjs +1 -0
  107. package/dist/core-Chg-oYCr.cjs +1 -0
  108. package/dist/core-CxBnKAhs.cjs +1 -0
  109. package/dist/core-DMV6_SEE.js +795 -0
  110. package/dist/core-D_LRh59n.js +795 -0
  111. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  112. package/dist/data-branching-YQtJJEtn.js +6273 -0
  113. package/dist/data-branching-oEH04O3i.js +6273 -0
  114. package/dist/data-branching-wmsbLNfa.cjs +1 -0
  115. package/dist/data-branching.cjs +1 -1
  116. package/dist/data-branching.mjs +1 -1
  117. package/dist/data.cjs +1 -1
  118. package/dist/data.d.ts +2 -53
  119. package/dist/data.mjs +3 -3
  120. package/dist/devops-Bt6EsfPa.cjs +17 -0
  121. package/dist/devops-CnZQ1rU5.js +8312 -0
  122. package/dist/devops-D5yIDM3e.js +8312 -0
  123. package/dist/devops-rVpB0ZAX.cjs +17 -0
  124. package/dist/devops.cjs +1 -1
  125. package/dist/devops.mjs +1 -1
  126. package/dist/editors.cjs +1 -1
  127. package/dist/editors.d.ts +8 -26
  128. package/dist/editors.mjs +55 -54
  129. package/dist/feedback.cjs +1 -1
  130. package/dist/feedback.d.ts +5 -0
  131. package/dist/feedback.mjs +3 -3
  132. package/dist/index.cjs +290 -290
  133. package/dist/index.css +1 -1
  134. package/dist/index.d.ts +239 -234
  135. package/dist/index.mjs +20262 -19440
  136. package/dist/lazy.cjs +1 -1
  137. package/dist/lazy.mjs +29 -29
  138. package/dist/navigation.cjs +1 -1
  139. package/dist/navigation.d.ts +4 -4
  140. package/dist/navigation.mjs +69 -69
  141. package/dist/no-code-4GtIBr6f.js +7503 -0
  142. package/dist/no-code-6WyYb3hL.cjs +331 -0
  143. package/dist/no-code-BH5oVFC6.js +8186 -0
  144. package/dist/no-code-Bdwh1vyS.cjs +332 -0
  145. package/dist/no-code-CnHG5_Vn.js +8186 -0
  146. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  147. package/dist/no-code.cjs +1 -1
  148. package/dist/no-code.css +1 -1
  149. package/dist/no-code.d.ts +25 -18
  150. package/dist/no-code.mjs +3 -3
  151. package/dist/overlays.cjs +1 -1
  152. package/dist/overlays.d.ts +24 -24
  153. package/dist/overlays.mjs +24 -490
  154. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  155. package/dist/pickerCommons-31hyz1gs.js +1122 -0
  156. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  157. package/dist/pickerCommons-BHirHJyn.js +548 -0
  158. package/dist/pickerCommons-BifIkPdk.cjs +1 -0
  159. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  160. package/dist/pickerCommons.css +1 -1
  161. package/dist/style.css +10 -7
  162. package/package.json +5 -7
  163. 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 e=require("react/jsx-runtime"),g=require("@nice2dev/ui-core"),y=require("./pickerCommons-BifIkPdk.cjs");function R(o,c,i){const r=[];if(c<=1)return c===1&&r.push(1),r;const p=Math.max(2,o-i),u=Math.min(c-1,o+i);r.push(1),p>2&&r.push("dots");for(let t=p;t<=u;t++)r.push(t);return u<c-1&&r.push("dots"),r.push(c),r}const M=({page:o,defaultPage:c,totalPages:i,onChange:r,showInfo:p=!0,siblingCount:u=2,size:t="md",showFirstLast:m,showJumpInput:x,jumpInputLabel:b,showPageSize:f,pageSizeOptions:d,pageSize:N,onPageSizeChange:j,disabled:l,className:v,style:_})=>{const[a,s]=g.useControllableState({value:o,defaultValue:c,fallbackValue:1,onChange:r,componentName:"NicePagination"}),C=R(a,i,u);return e.jsxs("nav",{className:`nice-pagination nice-pagination--${t} ${v||""}`,style:_,"aria-label":"Pagination",children:[m&&e.jsx("button",{className:"nice-pagination__btn",disabled:l||a<=1,onClick:()=>s(1),"aria-label":"First page",title:"First page",children:e.jsx(g.NiceIcon,{name:"chevron-left",size:14})}),e.jsx("button",{className:"nice-pagination__btn",disabled:l||a<=1,onClick:()=>s(a-1),"aria-label":"Previous",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",clipRule:"evenodd"})})}),C.map((n,h)=>n==="dots"?e.jsx("span",{className:"nice-pagination__ellipsis",children:"…"},`dots-${h}`):e.jsx("button",{className:`nice-pagination__btn ${n===a?"nice-pagination__btn--active":""}`,disabled:l,onClick:()=>s(n),"aria-current":n===a?"page":void 0,children:n},n)),e.jsx("button",{className:"nice-pagination__btn",disabled:l||a>=i,onClick:()=>s(a+1),"aria-label":"Next",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})})}),m&&e.jsx("button",{className:"nice-pagination__btn",disabled:l||a>=i,onClick:()=>s(i),"aria-label":"Last page",title:"Last page",children:e.jsx(g.NiceIcon,{name:"skip-forward",size:14})}),p&&e.jsxs("span",{className:"nice-pagination__info",children:[a," / ",i]}),x&&e.jsxs("span",{className:"nice-pagination__jump",style:{display:"inline-flex",alignItems:"center",gap:6,marginLeft:8},children:[e.jsx("span",{style:{fontSize:"0.85rem",color:"var(--nice-text-secondary)"},children:b??"Go to"}),e.jsx(y.NiceNumberInput,{size:t==="lg"?"md":"sm",min:1,max:i,step:1,value:a,disabled:l,onChange:n=>{const h=typeof n=="number"?n:Number(n);if(!Number.isNaN(h)){const k=Math.max(1,Math.min(i,Math.floor(h)));s(k)}}})]}),f&&d&&d.length>0&&e.jsx("select",{className:"nice-pagination__size",value:N??d[0],disabled:l,onChange:n=>j?.(Number(n.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:d.map(n=>e.jsxs("option",{value:n,children:[n," / page"]},n))})]})};exports.NicePagination=M;
@@ -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,179 @@
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import { useControllableState as R, NiceIcon as f } from "@nice2dev/ui-core";
3
+ import { a as w } from "./pickerCommons-31hyz1gs.js";
4
+ function L(s, l, i) {
5
+ const r = [];
6
+ if (l <= 1)
7
+ return l === 1 && r.push(1), r;
8
+ const p = Math.max(2, s - i), d = Math.min(l - 1, s + i);
9
+ r.push(1), p > 2 && r.push("dots");
10
+ for (let o = p; o <= d; o++)
11
+ r.push(o);
12
+ return d < l - 1 && r.push("dots"), r.push(l), r;
13
+ }
14
+ const I = ({
15
+ page: s,
16
+ defaultPage: l,
17
+ totalPages: i,
18
+ onChange: r,
19
+ showInfo: p = !0,
20
+ siblingCount: d = 2,
21
+ size: o = "md",
22
+ showFirstLast: g,
23
+ showJumpInput: b,
24
+ jumpInputLabel: N,
25
+ showPageSize: v,
26
+ pageSizeOptions: u,
27
+ pageSize: _,
28
+ onPageSizeChange: x,
29
+ disabled: t,
30
+ className: C,
31
+ style: k
32
+ }) => {
33
+ const [a, c] = R({
34
+ value: s,
35
+ defaultValue: l,
36
+ fallbackValue: 1,
37
+ onChange: r,
38
+ componentName: "NicePagination"
39
+ }), y = L(a, i, d);
40
+ return /* @__PURE__ */ h(
41
+ "nav",
42
+ {
43
+ className: `nice-pagination nice-pagination--${o} ${C || ""}`,
44
+ style: k,
45
+ "aria-label": "Pagination",
46
+ children: [
47
+ g && /* @__PURE__ */ e(
48
+ "button",
49
+ {
50
+ className: "nice-pagination__btn",
51
+ disabled: t || a <= 1,
52
+ onClick: () => c(1),
53
+ "aria-label": "First page",
54
+ title: "First page",
55
+ children: /* @__PURE__ */ e(f, { name: "chevron-left", size: 14 })
56
+ }
57
+ ),
58
+ /* @__PURE__ */ e(
59
+ "button",
60
+ {
61
+ className: "nice-pagination__btn",
62
+ disabled: t || a <= 1,
63
+ onClick: () => c(a - 1),
64
+ "aria-label": "Previous",
65
+ children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
66
+ "path",
67
+ {
68
+ fillRule: "evenodd",
69
+ d: "M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z",
70
+ clipRule: "evenodd"
71
+ }
72
+ ) })
73
+ }
74
+ ),
75
+ y.map(
76
+ (n, m) => n === "dots" ? /* @__PURE__ */ e("span", { className: "nice-pagination__ellipsis", children: "…" }, `dots-${m}`) : /* @__PURE__ */ e(
77
+ "button",
78
+ {
79
+ className: `nice-pagination__btn ${n === a ? "nice-pagination__btn--active" : ""}`,
80
+ disabled: t,
81
+ onClick: () => c(n),
82
+ "aria-current": n === a ? "page" : void 0,
83
+ children: n
84
+ },
85
+ n
86
+ )
87
+ ),
88
+ /* @__PURE__ */ e(
89
+ "button",
90
+ {
91
+ className: "nice-pagination__btn",
92
+ disabled: t || a >= i,
93
+ onClick: () => c(a + 1),
94
+ "aria-label": "Next",
95
+ children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
96
+ "path",
97
+ {
98
+ fillRule: "evenodd",
99
+ d: "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",
100
+ clipRule: "evenodd"
101
+ }
102
+ ) })
103
+ }
104
+ ),
105
+ g && /* @__PURE__ */ e(
106
+ "button",
107
+ {
108
+ className: "nice-pagination__btn",
109
+ disabled: t || a >= i,
110
+ onClick: () => c(i),
111
+ "aria-label": "Last page",
112
+ title: "Last page",
113
+ children: /* @__PURE__ */ e(f, { name: "skip-forward", size: 14 })
114
+ }
115
+ ),
116
+ p && /* @__PURE__ */ h("span", { className: "nice-pagination__info", children: [
117
+ a,
118
+ " / ",
119
+ i
120
+ ] }),
121
+ b && /* @__PURE__ */ h(
122
+ "span",
123
+ {
124
+ className: "nice-pagination__jump",
125
+ style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: 8 },
126
+ children: [
127
+ /* @__PURE__ */ e("span", { style: { fontSize: "0.85rem", color: "var(--nice-text-secondary)" }, children: N ?? "Go to" }),
128
+ /* @__PURE__ */ e(
129
+ w,
130
+ {
131
+ size: o === "lg" ? "md" : "sm",
132
+ min: 1,
133
+ max: i,
134
+ step: 1,
135
+ value: a,
136
+ disabled: t,
137
+ onChange: (n) => {
138
+ const m = typeof n == "number" ? n : Number(n);
139
+ if (!Number.isNaN(m)) {
140
+ const M = Math.max(1, Math.min(i, Math.floor(m)));
141
+ c(M);
142
+ }
143
+ }
144
+ }
145
+ )
146
+ ]
147
+ }
148
+ ),
149
+ v && u && u.length > 0 && /* @__PURE__ */ e(
150
+ "select",
151
+ {
152
+ className: "nice-pagination__size",
153
+ value: _ ?? u[0],
154
+ disabled: t,
155
+ onChange: (n) => x?.(Number(n.target.value)),
156
+ style: {
157
+ marginLeft: 8,
158
+ padding: "4px 8px",
159
+ border: "1px solid var(--nice-border-color)",
160
+ borderRadius: 6,
161
+ background: "var(--nice-bg-primary)",
162
+ color: "var(--nice-text-primary)",
163
+ font: "inherit",
164
+ fontSize: "0.85rem"
165
+ },
166
+ "aria-label": "Rows per page",
167
+ children: u.map((n) => /* @__PURE__ */ h("option", { value: n, children: [
168
+ n,
169
+ " / page"
170
+ ] }, n))
171
+ }
172
+ )
173
+ ]
174
+ }
175
+ );
176
+ };
177
+ export {
178
+ I as N
179
+ };
@@ -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;