@nice2dev/ui 1.3.9 → 1.3.10

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 (59) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/NiceColorPicker-BLwYNSXJ.cjs +1 -0
  3. package/dist/NiceColorPicker-DS59tNkP.js +552 -0
  4. package/dist/NiceDataGrid-CL2_7fS7.cjs +10 -0
  5. package/dist/NiceDataGrid-CpJrRN_H.js +2269 -0
  6. package/dist/NiceForm-BQj-K7p7.cjs +1 -0
  7. package/dist/NiceForm-HQ4h7hX_.js +5023 -0
  8. package/dist/NiceGantt-BygumlaY.cjs +1 -0
  9. package/dist/NiceGantt-DTC7OH-v.js +334 -0
  10. package/dist/NiceHtmlEditor-BtpuaLln.js +901 -0
  11. package/dist/NiceHtmlEditor-C1OVtLQ6.cjs +10 -0
  12. package/dist/NiceMention-CVxxCVtQ.js +11668 -0
  13. package/dist/NiceMention-Te66Oid1.cjs +430 -0
  14. package/dist/NiceModuleLifecyclePanel-DCrFyUH8.cjs +1 -0
  15. package/dist/NiceModuleLifecyclePanel-Mt80MdET.js +7441 -0
  16. package/dist/NicePagination-CKsAP38Q.cjs +1 -0
  17. package/dist/NicePagination-zOed5QxG.js +202 -0
  18. package/dist/NicePivotGrid-Clue9FM5.js +1184 -0
  19. package/dist/NicePivotGrid-Cnkr9WkC.cjs +152 -0
  20. package/dist/NiceSavedQueryPanel-NgG58w6i.js +6226 -0
  21. package/dist/NiceSavedQueryPanel-lTWY2plm.cjs +587 -0
  22. package/dist/NiceScheduler-BWwqFKEc.js +1712 -0
  23. package/dist/NiceScheduler-DqWEJU7g.cjs +5 -0
  24. package/dist/NiceSelect-BNPXs6FQ.cjs +1 -0
  25. package/dist/NiceSelect-DEruWHan.js +495 -0
  26. package/dist/NiceWindow-D3V7A69Q.js +2247 -0
  27. package/dist/NiceWindow-pgR4c-kQ.cjs +1 -0
  28. package/dist/core-lazy-Bjdu111n.js +351 -0
  29. package/dist/core-lazy-Bx_8BOlG.cjs +1 -0
  30. package/dist/data.cjs +1 -1
  31. package/dist/data.d.ts +46 -5
  32. package/dist/data.mjs +3 -3
  33. package/dist/devops-CqhA0rjL.js +9130 -0
  34. package/dist/devops-cgRBnZVX.cjs +18 -0
  35. package/dist/devops.cjs +1 -1
  36. package/dist/devops.mjs +1 -1
  37. package/dist/editors.cjs +1 -1
  38. package/dist/editors.mjs +7 -7
  39. package/dist/feedback.cjs +1 -1
  40. package/dist/feedback.mjs +1 -1
  41. package/dist/index.cjs +108 -108
  42. package/dist/index.css +1 -1
  43. package/dist/index.d.ts +51 -8
  44. package/dist/index.mjs +13739 -13579
  45. package/dist/lazy.cjs +1 -1
  46. package/dist/lazy.mjs +15 -15
  47. package/dist/navigation.cjs +1 -1
  48. package/dist/navigation.d.ts +2 -0
  49. package/dist/navigation.mjs +3 -3
  50. package/dist/no-code-BQqK8mvU.cjs +331 -0
  51. package/dist/no-code-Cppb-xz3.js +8320 -0
  52. package/dist/no-code.cjs +1 -1
  53. package/dist/no-code.mjs +1 -1
  54. package/dist/overlays.cjs +1 -1
  55. package/dist/overlays.mjs +1 -1
  56. package/dist/pickerCommons-BA3-D5RC.js +663 -0
  57. package/dist/pickerCommons-KrBqCBDn.cjs +1 -0
  58. package/dist/style.css +1 -1
  59. package/package.json +4 -4
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),r=require("@nice2dev/ui-core"),v=require("react"),L=require("./no-code-BQqK8mvU.cjs");function $(g,s,t){const o=[];if(s<=1)return s===1&&o.push(1),o;const x=Math.max(2,g-t),d=Math.min(s-1,g+t);o.push(1),x>2&&o.push("dots");for(let u=x;u<=d;u++)o.push(u);return d<s-1&&o.push("dots"),o.push(s),o}const H=({page:g,defaultPage:s,totalPages:t,onChange:o,showInfo:x=!0,siblingCount:d=2,size:u="md",showFirstLast:N,showJumpInput:_,jumpInputLabel:y,showPageSize:C,pageSizeOptions:m,pageSize:k,onPageSizeChange:I,disabled:c,className:P,"data-testid":R,style:M})=>{const[a,l]=r.useControllableState({value:g,defaultValue:s,fallbackValue:1,onChange:o,componentName:"NicePagination"}),{t:i}=r.useNiceTranslation(),q=$(a,t,d),h=v.useId(),b=v.useRef(null),f=!c&&a>1,j=!c&&a<t;return r.useIntent(["pagePrev","pageNext"],n=>{const p=n.intent==="pageNext";if(p?!j:!f)return!1;l(a+(p?1:-1))},{ref:b}),r.useInputHints(b,[{intent:"pagePrev",label:i("pagination.previous","Previous")},{intent:"pageNext",label:i("pagination.next","Next")}]),e.jsxs("nav",{ref:b,className:`nice-pagination nice-pagination--${u} ${P||""}`,style:M,"data-testid":R,"aria-label":i("pagination.ariaLabel","Pagination"),children:[N&&e.jsx("button",{type:"button",className:"nice-pagination__btn",disabled:c||a<=1,onClick:()=>l(1),"aria-label":i("pagination.first","First"),title:i("pagination.first","First"),children:e.jsx(r.NiceIcon,{name:"skip-back",size:14})}),e.jsxs("button",{type:"button",className:"nice-pagination__btn",disabled:!f,onClick:()=>l(a-1),"aria-label":i("pagination.previous","Previous"),children:[e.jsx(r.NiceIcon,{name:"chevron-left",size:14}),e.jsx(r.NiceControlHint,{intent:"pagePrev"})]}),q.map((n,p)=>n==="dots"?e.jsx("span",{className:"nice-pagination__ellipsis","aria-hidden":"true",children:"…"},`dots-${p}`):e.jsx("button",{type:"button",className:`nice-pagination__btn ${n===a?"nice-pagination__btn--active":""}`,disabled:c,onClick:()=>l(n),"aria-current":n===a?"page":void 0,"aria-label":i("pagination.page","Page {page}").replace("{page}",String(n)),children:n},n)),e.jsxs("button",{type:"button",className:"nice-pagination__btn",disabled:!j,onClick:()=>l(a+1),"aria-label":i("pagination.next","Next"),children:[e.jsx(r.NiceIcon,{name:"chevron-right",size:14}),e.jsx(r.NiceControlHint,{intent:"pageNext"})]}),N&&e.jsx("button",{type:"button",className:"nice-pagination__btn",disabled:c||a>=t,onClick:()=>l(t),"aria-label":i("pagination.last","Last"),title:i("pagination.last","Last"),children:e.jsx(r.NiceIcon,{name:"skip-forward",size:14})}),x&&e.jsxs("span",{className:"nice-pagination__info","aria-live":"polite",children:[a," / ",t]}),_&&e.jsxs("span",{className:"nice-pagination__jump",style:{display:"inline-flex",alignItems:"center",gap:6,marginLeft:8},children:[e.jsx("label",{htmlFor:h,style:{fontSize:"0.85rem",color:"var(--nice-text-secondary)"},children:y??i("pagination.goTo","Go to")}),e.jsx(L.NiceNumberInput,{id:h,size:u==="lg"?"md":"sm",min:1,max:t,step:1,value:a,disabled:c,onChange:n=>{const p=typeof n=="number"?n:Number(n);if(!Number.isNaN(p)){const z=Math.max(1,Math.min(t,Math.floor(p)));l(z)}}})]}),C&&m&&m.length>0&&e.jsx("select",{className:"nice-pagination__size",value:k??m[0],disabled:c,onChange:n=>I?.(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":i("pagination.rowsPerPage","Rows per page"),children:m.map(n=>e.jsxs("option",{value:n,children:[n," / page"]},n))})]})};exports.NicePagination=H;
@@ -0,0 +1,202 @@
1
+ import { jsxs as g, jsx as a } from "react/jsx-runtime";
2
+ import { useControllableState as w, useNiceTranslation as F, useIntent as H, useInputHints as T, NiceIcon as f, NiceControlHint as y } from "@nice2dev/ui-core";
3
+ import { useId as V, useRef as G } from "react";
4
+ import { a as S } from "./no-code-Cppb-xz3.js";
5
+ function q(u, o, t) {
6
+ const r = [];
7
+ if (o <= 1)
8
+ return o === 1 && r.push(1), r;
9
+ const m = Math.max(2, u - t), b = Math.min(o - 1, u + t);
10
+ r.push(1), m > 2 && r.push("dots");
11
+ for (let p = m; p <= b; p++)
12
+ r.push(p);
13
+ return b < o - 1 && r.push("dots"), r.push(o), r;
14
+ }
15
+ const J = ({
16
+ page: u,
17
+ defaultPage: o,
18
+ totalPages: t,
19
+ onChange: r,
20
+ showInfo: m = !0,
21
+ siblingCount: b = 2,
22
+ size: p = "md",
23
+ showFirstLast: N,
24
+ showJumpInput: k,
25
+ jumpInputLabel: C,
26
+ showPageSize: P,
27
+ pageSizeOptions: d,
28
+ pageSize: I,
29
+ onPageSizeChange: M,
30
+ disabled: c,
31
+ className: R,
32
+ "data-testid": j,
33
+ style: z
34
+ }) => {
35
+ const [e, l] = w({
36
+ value: u,
37
+ defaultValue: o,
38
+ fallbackValue: 1,
39
+ onChange: r,
40
+ componentName: "NicePagination"
41
+ }), { t: i } = F(), L = q(e, t, b), v = V(), h = G(null), x = !c && e > 1, _ = !c && e < t;
42
+ return H(
43
+ ["pagePrev", "pageNext"],
44
+ (n) => {
45
+ const s = n.intent === "pageNext";
46
+ if (s ? !_ : !x)
47
+ return !1;
48
+ l(e + (s ? 1 : -1));
49
+ },
50
+ { ref: h }
51
+ ), T(h, [
52
+ { intent: "pagePrev", label: i("pagination.previous", "Previous") },
53
+ { intent: "pageNext", label: i("pagination.next", "Next") }
54
+ ]), /* @__PURE__ */ g(
55
+ "nav",
56
+ {
57
+ ref: h,
58
+ className: `nice-pagination nice-pagination--${p} ${R || ""}`,
59
+ style: z,
60
+ "data-testid": j,
61
+ "aria-label": i("pagination.ariaLabel", "Pagination"),
62
+ children: [
63
+ N && /* @__PURE__ */ a(
64
+ "button",
65
+ {
66
+ type: "button",
67
+ className: "nice-pagination__btn",
68
+ disabled: c || e <= 1,
69
+ onClick: () => l(1),
70
+ "aria-label": i("pagination.first", "First"),
71
+ title: i("pagination.first", "First"),
72
+ children: /* @__PURE__ */ a(f, { name: "skip-back", size: 14 })
73
+ }
74
+ ),
75
+ /* @__PURE__ */ g(
76
+ "button",
77
+ {
78
+ type: "button",
79
+ className: "nice-pagination__btn",
80
+ disabled: !x,
81
+ onClick: () => l(e - 1),
82
+ "aria-label": i("pagination.previous", "Previous"),
83
+ children: [
84
+ /* @__PURE__ */ a(f, { name: "chevron-left", size: 14 }),
85
+ /* @__PURE__ */ a(y, { intent: "pagePrev" })
86
+ ]
87
+ }
88
+ ),
89
+ L.map(
90
+ (n, s) => n === "dots" ? /* @__PURE__ */ a("span", { className: "nice-pagination__ellipsis", "aria-hidden": "true", children: "…" }, `dots-${s}`) : /* @__PURE__ */ a(
91
+ "button",
92
+ {
93
+ type: "button",
94
+ className: `nice-pagination__btn ${n === e ? "nice-pagination__btn--active" : ""}`,
95
+ disabled: c,
96
+ onClick: () => l(n),
97
+ "aria-current": n === e ? "page" : void 0,
98
+ "aria-label": i("pagination.page", "Page {page}").replace("{page}", String(n)),
99
+ children: n
100
+ },
101
+ n
102
+ )
103
+ ),
104
+ /* @__PURE__ */ g(
105
+ "button",
106
+ {
107
+ type: "button",
108
+ className: "nice-pagination__btn",
109
+ disabled: !_,
110
+ onClick: () => l(e + 1),
111
+ "aria-label": i("pagination.next", "Next"),
112
+ children: [
113
+ /* @__PURE__ */ a(f, { name: "chevron-right", size: 14 }),
114
+ /* @__PURE__ */ a(y, { intent: "pageNext" })
115
+ ]
116
+ }
117
+ ),
118
+ N && /* @__PURE__ */ a(
119
+ "button",
120
+ {
121
+ type: "button",
122
+ className: "nice-pagination__btn",
123
+ disabled: c || e >= t,
124
+ onClick: () => l(t),
125
+ "aria-label": i("pagination.last", "Last"),
126
+ title: i("pagination.last", "Last"),
127
+ children: /* @__PURE__ */ a(f, { name: "skip-forward", size: 14 })
128
+ }
129
+ ),
130
+ m && // announced when the page changes
131
+ /* @__PURE__ */ g("span", { className: "nice-pagination__info", "aria-live": "polite", children: [
132
+ e,
133
+ " / ",
134
+ t
135
+ ] }),
136
+ k && /* @__PURE__ */ g(
137
+ "span",
138
+ {
139
+ className: "nice-pagination__jump",
140
+ style: { display: "inline-flex", alignItems: "center", gap: 6, marginLeft: 8 },
141
+ children: [
142
+ /* @__PURE__ */ a(
143
+ "label",
144
+ {
145
+ htmlFor: v,
146
+ style: { fontSize: "0.85rem", color: "var(--nice-text-secondary)" },
147
+ children: C ?? i("pagination.goTo", "Go to")
148
+ }
149
+ ),
150
+ /* @__PURE__ */ a(
151
+ S,
152
+ {
153
+ id: v,
154
+ size: p === "lg" ? "md" : "sm",
155
+ min: 1,
156
+ max: t,
157
+ step: 1,
158
+ value: e,
159
+ disabled: c,
160
+ onChange: (n) => {
161
+ const s = typeof n == "number" ? n : Number(n);
162
+ if (!Number.isNaN(s)) {
163
+ const $ = Math.max(1, Math.min(t, Math.floor(s)));
164
+ l($);
165
+ }
166
+ }
167
+ }
168
+ )
169
+ ]
170
+ }
171
+ ),
172
+ P && d && d.length > 0 && /* @__PURE__ */ a(
173
+ "select",
174
+ {
175
+ className: "nice-pagination__size",
176
+ value: I ?? d[0],
177
+ disabled: c,
178
+ onChange: (n) => M?.(Number(n.target.value)),
179
+ style: {
180
+ marginLeft: 8,
181
+ padding: "4px 8px",
182
+ border: "1px solid var(--nice-border-color)",
183
+ borderRadius: 6,
184
+ background: "var(--nice-bg-primary)",
185
+ color: "var(--nice-text-primary)",
186
+ font: "inherit",
187
+ fontSize: "0.85rem"
188
+ },
189
+ "aria-label": i("pagination.rowsPerPage", "Rows per page"),
190
+ children: d.map((n) => /* @__PURE__ */ g("option", { value: n, children: [
191
+ n,
192
+ " / page"
193
+ ] }, n))
194
+ }
195
+ )
196
+ ]
197
+ }
198
+ );
199
+ };
200
+ export {
201
+ J as N
202
+ };