@nice2dev/ui 1.0.12 → 1.0.14

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 (52) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +53 -36
  3. package/css/legacy-bg-text-aliases.css +83 -0
  4. package/dist/NiceErrorBoundary-BLTq8mPU.cjs +1 -0
  5. package/dist/NiceErrorBoundary-Bjw5U31n.js +762 -0
  6. package/dist/NiceForm-CUlhtlHw.js +5357 -0
  7. package/dist/NiceForm-DTgIGX88.cjs +382 -0
  8. package/dist/NiceForm.css +1 -1
  9. package/dist/NiceModal-C_t2qqZd.js +95 -0
  10. package/dist/NiceModal-FQqBxCij.cjs +1 -0
  11. package/dist/NiceModuleLifecyclePanel-CCFHxKIu.js +6343 -0
  12. package/dist/NiceModuleLifecyclePanel-D8cIOI8I.cjs +1 -0
  13. package/dist/NiceModuleLifecyclePanel.css +1 -1
  14. package/dist/NicePagination-BVkkePJU.js +171 -0
  15. package/dist/NicePagination-DGd3Hrh9.cjs +1 -0
  16. package/dist/NicePinCodeInput-CDtodnIM.js +11875 -0
  17. package/dist/NicePinCodeInput-DytLfqZL.cjs +419 -0
  18. package/dist/NicePinCodeInput.css +1 -1
  19. package/dist/NiceSavedQueryPanel-CbR3EDQU.cjs +596 -0
  20. package/dist/NiceSavedQueryPanel-DJqCNWYZ.js +6446 -0
  21. package/dist/NiceTabs-B-9_mzpc.js +1624 -0
  22. package/dist/NiceTabs-CHg36waF.cjs +1 -0
  23. package/dist/NiceWindow-BxGVzUs2.js +1409 -0
  24. package/dist/NiceWindow-HhPIzPzs.cjs +1 -0
  25. package/dist/charts-Us8Ep8MJ.cjs +761 -0
  26. package/dist/charts-fO6InNZd.js +4645 -0
  27. package/dist/charts.cjs +1 -1
  28. package/dist/charts.mjs +1 -1
  29. package/dist/core-B-tu8l9M.cjs +96 -0
  30. package/dist/core-BJ_UNMlX.js +22276 -0
  31. package/dist/data.cjs +1 -1
  32. package/dist/data.d.ts +7 -0
  33. package/dist/data.mjs +1 -1
  34. package/dist/editors.cjs +1 -1
  35. package/dist/editors.mjs +3 -3
  36. package/dist/feedback.cjs +1 -1
  37. package/dist/feedback.mjs +2 -2
  38. package/dist/index-DHc_KZkF.js +61311 -0
  39. package/dist/index-drIVMHeC.cjs +5194 -0
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.css +1 -1
  42. package/dist/index.d.ts +1140 -63
  43. package/dist/index.mjs +833 -819
  44. package/dist/lazy.cjs +1 -1
  45. package/dist/lazy.mjs +3 -3
  46. package/dist/navigation.cjs +1 -1
  47. package/dist/navigation.d.ts +309 -70
  48. package/dist/navigation.mjs +91 -90
  49. package/dist/overlays.cjs +1 -1
  50. package/dist/overlays.mjs +2 -2
  51. package/dist/style.css +7 -0
  52. package/package.json +9 -5
@@ -0,0 +1,171 @@
1
+ import { jsxs as u, jsx as e } from "react/jsx-runtime";
2
+ import { b as y } from "./NiceTabs-B-9_mzpc.js";
3
+ function M(i, a, l) {
4
+ const r = [];
5
+ if (a <= 1)
6
+ return a === 1 && r.push(1), r;
7
+ const s = Math.max(2, i - l), o = Math.min(a - 1, i + l);
8
+ r.push(1), s > 2 && r.push("dots");
9
+ for (let c = s; c <= o; c++)
10
+ r.push(c);
11
+ return o < a - 1 && r.push("dots"), r.push(a), r;
12
+ }
13
+ const L = ({
14
+ page: i,
15
+ totalPages: a,
16
+ onChange: l,
17
+ showInfo: r,
18
+ siblingCount: s = 1,
19
+ size: o = "md",
20
+ showFirstLast: c,
21
+ showJumpInput: m,
22
+ jumpInputLabel: h,
23
+ showPageSize: b,
24
+ pageSizeOptions: d,
25
+ pageSize: f,
26
+ onPageSizeChange: N,
27
+ disabled: t,
28
+ className: _,
29
+ style: v
30
+ }) => {
31
+ const g = M(i, a, s);
32
+ return /* @__PURE__ */ u(
33
+ "nav",
34
+ {
35
+ className: `nice-pagination nice-pagination--${o} ${_ || ""}`,
36
+ style: v,
37
+ "aria-label": "Pagination",
38
+ children: [
39
+ c && /* @__PURE__ */ e(
40
+ "button",
41
+ {
42
+ className: "nice-pagination__btn",
43
+ disabled: t || i <= 1,
44
+ onClick: () => l(1),
45
+ "aria-label": "First page",
46
+ title: "First page",
47
+ children: "⏮"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ e(
51
+ "button",
52
+ {
53
+ className: "nice-pagination__btn",
54
+ disabled: t || i <= 1,
55
+ onClick: () => l(i - 1),
56
+ "aria-label": "Previous",
57
+ children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
58
+ "path",
59
+ {
60
+ fillRule: "evenodd",
61
+ 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",
62
+ clipRule: "evenodd"
63
+ }
64
+ ) })
65
+ }
66
+ ),
67
+ g.map(
68
+ (n, p) => n === "dots" ? /* @__PURE__ */ e("span", { className: "nice-pagination__ellipsis", children: "…" }, `dots-${p}`) : /* @__PURE__ */ e(
69
+ "button",
70
+ {
71
+ className: `nice-pagination__btn ${n === i ? "nice-pagination__btn--active" : ""}`,
72
+ disabled: t,
73
+ onClick: () => l(n),
74
+ "aria-current": n === i ? "page" : void 0,
75
+ children: n
76
+ },
77
+ n
78
+ )
79
+ ),
80
+ /* @__PURE__ */ e(
81
+ "button",
82
+ {
83
+ className: "nice-pagination__btn",
84
+ disabled: t || i >= a,
85
+ onClick: () => l(i + 1),
86
+ "aria-label": "Next",
87
+ children: /* @__PURE__ */ e("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ e(
88
+ "path",
89
+ {
90
+ fillRule: "evenodd",
91
+ 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",
92
+ clipRule: "evenodd"
93
+ }
94
+ ) })
95
+ }
96
+ ),
97
+ c && /* @__PURE__ */ e(
98
+ "button",
99
+ {
100
+ className: "nice-pagination__btn",
101
+ disabled: t || i >= a,
102
+ onClick: () => l(a),
103
+ "aria-label": "Last page",
104
+ title: "Last page",
105
+ children: "⏭"
106
+ }
107
+ ),
108
+ r && /* @__PURE__ */ u("span", { className: "nice-pagination__info", children: [
109
+ i,
110
+ " / ",
111
+ a
112
+ ] }),
113
+ m && /* @__PURE__ */ u(
114
+ "span",
115
+ {
116
+ className: "nice-pagination__jump",
117
+ style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: 8 },
118
+ children: [
119
+ /* @__PURE__ */ e("span", { style: { fontSize: "0.85rem", color: "var(--text-secondary)" }, children: h ?? "Go to" }),
120
+ /* @__PURE__ */ e(
121
+ y,
122
+ {
123
+ size: o === "lg" ? "md" : "sm",
124
+ min: 1,
125
+ max: a,
126
+ step: 1,
127
+ value: i,
128
+ disabled: t,
129
+ onChange: (n) => {
130
+ const p = typeof n == "number" ? n : Number(n);
131
+ if (!Number.isNaN(p)) {
132
+ const x = Math.max(1, Math.min(a, Math.floor(p)));
133
+ l(x);
134
+ }
135
+ }
136
+ }
137
+ )
138
+ ]
139
+ }
140
+ ),
141
+ b && d && d.length > 0 && /* @__PURE__ */ e(
142
+ "select",
143
+ {
144
+ className: "nice-pagination__size",
145
+ value: f ?? d[0],
146
+ disabled: t,
147
+ onChange: (n) => N?.(Number(n.target.value)),
148
+ style: {
149
+ marginLeft: 8,
150
+ padding: "4px 8px",
151
+ border: "1px solid var(--border-color)",
152
+ borderRadius: 6,
153
+ background: "var(--bg-primary)",
154
+ color: "var(--text-primary)",
155
+ font: "inherit",
156
+ fontSize: "0.85rem"
157
+ },
158
+ "aria-label": "Rows per page",
159
+ children: d.map((n) => /* @__PURE__ */ u("option", { value: n, children: [
160
+ n,
161
+ " / page"
162
+ ] }, n))
163
+ }
164
+ )
165
+ ]
166
+ }
167
+ );
168
+ };
169
+ export {
170
+ L as N
171
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react/jsx-runtime"),g=require("./NiceTabs-CHg36waF.cjs");function v(e,a,l){const r=[];if(a<=1)return a===1&&r.push(1),r;const o=Math.max(2,e-l),c=Math.min(a-1,e+l);r.push(1),o>2&&r.push("dots");for(let s=o;s<=c;s++)r.push(s);return c<a-1&&r.push("dots"),r.push(a),r}const y=({page:e,totalPages:a,onChange:l,showInfo:r,siblingCount:o=1,size:c="md",showFirstLast:s,showJumpInput:p,jumpInputLabel:h,showPageSize:m,pageSizeOptions:d,pageSize:x,onPageSizeChange:b,disabled:t,className:f,style:N})=>{const _=v(e,a,o);return n.jsxs("nav",{className:`nice-pagination nice-pagination--${c} ${f||""}`,style:N,"aria-label":"Pagination",children:[s&&n.jsx("button",{className:"nice-pagination__btn",disabled:t||e<=1,onClick:()=>l(1),"aria-label":"First page",title:"First page",children:"⏮"}),n.jsx("button",{className:"nice-pagination__btn",disabled:t||e<=1,onClick:()=>l(e-1),"aria-label":"Previous",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})}),_.map((i,u)=>i==="dots"?n.jsx("span",{className:"nice-pagination__ellipsis",children:"…"},`dots-${u}`):n.jsx("button",{className:`nice-pagination__btn ${i===e?"nice-pagination__btn--active":""}`,disabled:t,onClick:()=>l(i),"aria-current":i===e?"page":void 0,children:i},i)),n.jsx("button",{className:"nice-pagination__btn",disabled:t||e>=a,onClick:()=>l(e+1),"aria-label":"Next",children:n.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:n.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"})})}),s&&n.jsx("button",{className:"nice-pagination__btn",disabled:t||e>=a,onClick:()=>l(a),"aria-label":"Last page",title:"Last page",children:"⏭"}),r&&n.jsxs("span",{className:"nice-pagination__info",children:[e," / ",a]}),p&&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(--text-secondary)"},children:h??"Go to"}),n.jsx(g.NiceNumberInput,{size:c==="lg"?"md":"sm",min:1,max:a,step:1,value:e,disabled:t,onChange:i=>{const u=typeof i=="number"?i:Number(i);if(!Number.isNaN(u)){const j=Math.max(1,Math.min(a,Math.floor(u)));l(j)}}})]}),m&&d&&d.length>0&&n.jsx("select",{className:"nice-pagination__size",value:x??d[0],disabled:t,onChange:i=>b?.(Number(i.target.value)),style:{marginLeft:8,padding:"4px 8px",border:"1px solid var(--border-color)",borderRadius:6,background:"var(--bg-primary)",color:"var(--text-primary)",font:"inherit",fontSize:"0.85rem"},"aria-label":"Rows per page",children:d.map(i=>n.jsxs("option",{value:i,children:[i," / page"]},i))})]})};exports.NicePagination=y;