@nice2dev/ui 1.2.1 → 1.2.2

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 (62) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/NiceCodeEditor-C43xFG8v.cjs +260 -0
  3. package/dist/NiceCodeEditor-CspuYLh6.js +1174 -0
  4. package/dist/NiceDataGrid-CrD4HPlO.cjs +10 -0
  5. package/dist/NiceDataGrid-Dfg1DVbU.js +2224 -0
  6. package/dist/NiceForm-CISJyzoW.cjs +1 -0
  7. package/dist/NiceForm-DmH6k1b_.js +4775 -0
  8. package/dist/NiceGantt-CHnq-n8f.cjs +1 -0
  9. package/dist/NiceGantt-CX3jVNaF.js +330 -0
  10. package/dist/NiceHtmlEditor-DeK0Of98.js +883 -0
  11. package/dist/NiceHtmlEditor-DvVxl4Fu.cjs +10 -0
  12. package/dist/NiceLoginForm-CHXbz0eu.js +747 -0
  13. package/dist/NiceLoginForm-ix6J1adA.cjs +1 -0
  14. package/dist/NiceMention-DKhk3xdM.js +11321 -0
  15. package/dist/NiceMention-wp1AJ5oh.cjs +430 -0
  16. package/dist/NiceModal-BbQwiEOp.cjs +1 -0
  17. package/dist/NiceModal-DQEfTcnZ.js +85 -0
  18. package/dist/NiceModuleLifecyclePanel-22CEEVbA.cjs +1 -0
  19. package/dist/NiceModuleLifecyclePanel-BCd9Wv5Y.js +6825 -0
  20. package/dist/NicePagination-BFGt1v0a.js +165 -0
  21. package/dist/NicePagination-DltL3-Sz.cjs +1 -0
  22. package/dist/NicePivotGrid-BD87Na7P.js +1163 -0
  23. package/dist/NicePivotGrid-BPmnvbPQ.cjs +152 -0
  24. package/dist/NiceSavedQueryPanel-BSTiZvFg.js +5130 -0
  25. package/dist/NiceSavedQueryPanel-DrR3sw4T.cjs +586 -0
  26. package/dist/NiceScheduler-DvxJ8N0I.js +1698 -0
  27. package/dist/NiceScheduler-TIksdF0k.cjs +5 -0
  28. package/dist/charts-BpELGDXh.cjs +768 -0
  29. package/dist/charts-M6LuVI7F.js +4776 -0
  30. package/dist/charts.cjs +1 -1
  31. package/dist/charts.d.ts +0 -28
  32. package/dist/charts.mjs +1 -1
  33. package/dist/core-lazy-Ctin_LwS.cjs +1 -0
  34. package/dist/core-lazy-iDiropM6.js +351 -0
  35. package/dist/data-branching-BgIAw01q.cjs +1 -0
  36. package/dist/data-branching-bvB9K6KS.js +6386 -0
  37. package/dist/data-branching.cjs +1 -1
  38. package/dist/data-branching.mjs +1 -1
  39. package/dist/data.cjs +1 -1
  40. package/dist/data.mjs +3 -3
  41. package/dist/devops-Bp-_aA-9.js +8682 -0
  42. package/dist/devops-CXBSjnyX.cjs +17 -0
  43. package/dist/devops.cjs +1 -1
  44. package/dist/devops.mjs +1 -1
  45. package/dist/editors.cjs +1 -1
  46. package/dist/editors.mjs +6 -6
  47. package/dist/feedback.cjs +1 -1
  48. package/dist/feedback.mjs +3 -3
  49. package/dist/index.cjs +261 -261
  50. package/dist/index.d.ts +4 -28
  51. package/dist/index.mjs +19296 -19116
  52. package/dist/lazy.cjs +1 -1
  53. package/dist/lazy.mjs +24 -24
  54. package/dist/navigation.cjs +1 -1
  55. package/dist/navigation.mjs +3 -3
  56. package/dist/no-code-BNFk_BDO.js +8275 -0
  57. package/dist/no-code-CFdTp543.cjs +331 -0
  58. package/dist/no-code.cjs +1 -1
  59. package/dist/no-code.mjs +1 -1
  60. package/dist/pickerCommons-CMxFt9SW.js +548 -0
  61. package/dist/pickerCommons-Dc_hlz-e.cjs +1 -0
  62. package/package.json +3 -3
@@ -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-BNFk_BDO.js";
4
+ function I(p, o, e) {
5
+ const t = [];
6
+ if (o <= 1)
7
+ return o === 1 && t.push(1), t;
8
+ const m = Math.max(2, p - e), g = Math.min(o - 1, p + e);
9
+ t.push(1), m > 2 && t.push("dots");
10
+ for (let s = m; s <= g; s++)
11
+ t.push(s);
12
+ return g < o - 1 && t.push("dots"), t.push(o), t;
13
+ }
14
+ const T = ({
15
+ page: p,
16
+ defaultPage: o,
17
+ totalPages: e,
18
+ onChange: t,
19
+ showInfo: m = !0,
20
+ siblingCount: g = 2,
21
+ size: s = "md",
22
+ showFirstLast: f,
23
+ showJumpInput: N,
24
+ jumpInputLabel: _,
25
+ showPageSize: v,
26
+ pageSizeOptions: u,
27
+ pageSize: x,
28
+ onPageSizeChange: k,
29
+ disabled: c,
30
+ className: y,
31
+ style: C
32
+ }) => {
33
+ const [i, l] = L({
34
+ value: p,
35
+ defaultValue: o,
36
+ fallbackValue: 1,
37
+ onChange: t,
38
+ componentName: "NicePagination"
39
+ }), { t: r } = $(), M = I(i, e, g);
40
+ return /* @__PURE__ */ b(
41
+ "nav",
42
+ {
43
+ className: `nice-pagination nice-pagination--${s} ${y || ""}`,
44
+ style: C,
45
+ "aria-label": r("pagination.ariaLabel", "Pagination"),
46
+ children: [
47
+ f && /* @__PURE__ */ a(
48
+ "button",
49
+ {
50
+ className: "nice-pagination__btn",
51
+ disabled: c || i <= 1,
52
+ onClick: () => l(1),
53
+ "aria-label": r("pagination.first", "First"),
54
+ title: r("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: c || i <= 1,
63
+ onClick: () => l(i - 1),
64
+ "aria-label": r("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: c,
74
+ onClick: () => l(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: c || i >= e,
86
+ onClick: () => l(i + 1),
87
+ "aria-label": r("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: c || i >= e,
96
+ onClick: () => l(e),
97
+ "aria-label": r("pagination.last", "Last"),
98
+ title: r("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: _ ?? r("pagination.goTo", "Go to") }),
114
+ /* @__PURE__ */ a(
115
+ j,
116
+ {
117
+ size: s === "lg" ? "md" : "sm",
118
+ min: 1,
119
+ max: e,
120
+ step: 1,
121
+ value: i,
122
+ disabled: c,
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
+ l(z);
128
+ }
129
+ }
130
+ }
131
+ )
132
+ ]
133
+ }
134
+ ),
135
+ v && u && u.length > 0 && /* @__PURE__ */ a(
136
+ "select",
137
+ {
138
+ className: "nice-pagination__size",
139
+ value: x ?? u[0],
140
+ disabled: c,
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": r("pagination.rowsPerPage", "Rows per page"),
153
+ children: u.map((n) => /* @__PURE__ */ b("option", { value: n, children: [
154
+ n,
155
+ " / page"
156
+ ] }, n))
157
+ }
158
+ )
159
+ ]
160
+ }
161
+ );
162
+ };
163
+ export {
164
+ T as N
165
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react/jsx-runtime"),p=require("@nice2dev/ui-core"),I=require("./no-code-CFdTp543.cjs");function M(u,r,e){const t=[];if(r<=1)return r===1&&t.push(1),t;const g=Math.max(2,u-e),m=Math.min(r-1,u+e);t.push(1),g>2&&t.push("dots");for(let c=g;c<=m;c++)t.push(c);return m<r-1&&t.push("dots"),t.push(r),t}const z=({page:u,defaultPage:r,totalPages:e,onChange:t,showInfo:g=!0,siblingCount:m=2,size:c="md",showFirstLast:x,showJumpInput:b,jumpInputLabel:N,showPageSize:f,pageSizeOptions:h,pageSize:_,onPageSizeChange:j,disabled:o,className:v,style:k})=>{const[i,l]=p.useControllableState({value:u,defaultValue:r,fallbackValue:1,onChange:t,componentName:"NicePagination"}),{t:s}=p.useNiceTranslation(),C=M(i,e,m);return n.jsxs("nav",{className:`nice-pagination nice-pagination--${c} ${v||""}`,style:k,"aria-label":s("pagination.ariaLabel","Pagination"),children:[x&&n.jsx("button",{className:"nice-pagination__btn",disabled:o||i<=1,onClick:()=>l(1),"aria-label":s("pagination.first","First"),title:s("pagination.first","First"),children:n.jsx(p.NiceIcon,{name:"skip-back",size:14})}),n.jsx("button",{className:"nice-pagination__btn",disabled:o||i<=1,onClick:()=>l(i-1),"aria-label":s("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:o,onClick:()=>l(a),"aria-current":a===i?"page":void 0,children:a},a)),n.jsx("button",{className:"nice-pagination__btn",disabled:o||i>=e,onClick:()=>l(i+1),"aria-label":s("pagination.next","Next"),children:n.jsx(p.NiceIcon,{name:"chevron-right",size:14})}),x&&n.jsx("button",{className:"nice-pagination__btn",disabled:o||i>=e,onClick:()=>l(e),"aria-label":s("pagination.last","Last"),title:s("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??s("pagination.goTo","Go to")}),n.jsx(I.NiceNumberInput,{size:c==="lg"?"md":"sm",min:1,max:e,step:1,value:i,disabled:o,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:o,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":s("pagination.rowsPerPage","Rows per page"),children:h.map(a=>n.jsxs("option",{value:a,children:[a," / page"]},a))})]})};exports.NicePagination=z;