@nice2dev/ui 1.4.16 → 1.4.18

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 (42) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/NiceAlert-RVTgQxCE.cjs +1 -0
  3. package/dist/NiceDataGrid-Cszjz8NV.cjs +10 -0
  4. package/dist/NiceForm-DM2tARZT.cjs +1 -0
  5. package/dist/{NiceHtmlEditor-By7R1wRo.cjs → NiceHtmlEditor-BEWNA_UI.cjs} +1 -1
  6. package/dist/NiceLoginForm-Bkm5j80r.cjs +1 -0
  7. package/dist/{NiceMention-i7n2BoMw.cjs → NiceMention-DhaTUqvR.cjs} +1 -1
  8. package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +1 -0
  9. package/dist/{NicePagination-D9JguOl0.cjs → NicePagination-CnKYyKI5.cjs} +1 -1
  10. package/dist/{NicePivotGrid-B_7iQJys.cjs → NicePivotGrid-BshofJh1.cjs} +1 -1
  11. package/dist/NiceSavedQueryPanel-DJKEOqy5.cjs +587 -0
  12. package/dist/{NiceScheduler-B2DamQ_L.cjs → NiceScheduler-Dff8fuq_.cjs} +1 -1
  13. package/dist/{core-lazy-ChKRuEPb.cjs → core-lazy-BhQxFuLf.cjs} +1 -1
  14. package/dist/data/NiceRowEditDialog.mjs +42 -35
  15. package/dist/data/NiceTreeGrid.mjs +512 -474
  16. package/dist/data.cjs +1 -1
  17. package/dist/data.d.ts +30 -3
  18. package/dist/editors/forms/NiceForm.mjs +55 -52
  19. package/dist/editors/inputs/NiceRadioGroup.mjs +12 -12
  20. package/dist/editors/inputs/NiceSelect.mjs +51 -51
  21. package/dist/editors/pickers/NiceLanguagePicker.mjs +129 -125
  22. package/dist/editors/pickers/NiceThemePicker.mjs +1 -1
  23. package/dist/editors/pickers/pickerCommons.mjs +155 -203
  24. package/dist/editors.cjs +1 -1
  25. package/dist/feedback.cjs +1 -1
  26. package/dist/index.cjs +96 -96
  27. package/dist/index.d.ts +41 -7
  28. package/dist/lazy.cjs +1 -1
  29. package/dist/navigation.cjs +1 -1
  30. package/dist/navigation.d.ts +6 -0
  31. package/dist/{no-code-CN_q6TcB.cjs → no-code-DPc82kyy.cjs} +11 -11
  32. package/dist/no-code.cjs +1 -1
  33. package/dist/pickerCommons-CQnae2FM.cjs +1 -0
  34. package/dist/style.css +2 -2
  35. package/dist/tools/NiceThemeGalleryPicker.mjs +168 -265
  36. package/package.json +4 -4
  37. package/dist/NiceDataGrid-B1AOjgjm.cjs +0 -10
  38. package/dist/NiceForm-fmePSeA9.cjs +0 -1
  39. package/dist/NiceLoginForm-C2-WgRn0.cjs +0 -1
  40. package/dist/NiceModuleLifecyclePanel-DVHQuhc-.cjs +0 -1
  41. package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +0 -587
  42. package/dist/pickerCommons-CwcCc8Qi.cjs +0 -1
@@ -9,7 +9,7 @@ const fn = /* @__PURE__ */ Object.assign(
9
9
  label: O,
10
10
  "aria-label": ce,
11
11
  helperText: R,
12
- error: p,
12
+ error: _,
13
13
  required: xe,
14
14
  disabled: k,
15
15
  size: le = "md",
@@ -20,8 +20,8 @@ const fn = /* @__PURE__ */ Object.assign(
20
20
  accessMode: De,
21
21
  displayStyle: Q,
22
22
  options: Ie,
23
- value: N,
24
- onChange: y,
23
+ value: g,
24
+ onChange: N,
25
25
  placeholder: ae,
26
26
  multiple: o = !1,
27
27
  searchable: oe = !0,
@@ -34,7 +34,7 @@ const fn = /* @__PURE__ */ Object.assign(
34
34
  virtualScroll: F,
35
35
  optionHeight: u = 36,
36
36
  onSearch: b,
37
- loading: _,
37
+ loading: v,
38
38
  renderOption: j,
39
39
  multipleAutosize: K = !1,
40
40
  showKeyboardHints: Ee,
@@ -46,10 +46,10 @@ const fn = /* @__PURE__ */ Object.assign(
46
46
  }, z) => {
47
47
  const Y = Ve(De, re), Oe = Y === "hidden";
48
48
  (Y === "disabled" || Y === "readOnly") && (k = !0);
49
- const { t: v } = We(), Re = Be("input", Q), Ae = He("input", Q), m = Ge(re), fe = Je({ enabled: Te, disabled: k }), [l, w] = x(!1), [P, V] = x(""), [r, D] = x(-1), [ue, Fe] = x(0), he = we(null), I = we(null), [pe, je] = x(null);
49
+ const { t: m } = We(), Re = Be("input", Q), Ae = He("input", Q), y = Ge(re), fe = Je({ enabled: Te, disabled: k }), [l, w] = x(!1), [P, V] = x(""), [r, D] = x(-1), [ue, Fe] = x(0), he = we(null), I = we(null), [pe, je] = x(null);
50
50
  te(() => {
51
- !_ && I.current && je(I.current.offsetWidth);
52
- }, [_, N, Q]);
51
+ !v && I.current && je(I.current.offsetWidth);
52
+ }, [v, g, Q]);
53
53
  const [M, Ke] = x(null);
54
54
  te(() => {
55
55
  o && !K && I.current && M == null && Ke(I.current.offsetWidth);
@@ -58,7 +58,7 @@ const fn = /* @__PURE__ */ Object.assign(
58
58
  X ?? null,
59
59
  Se ?? X?.keyField ?? "id",
60
60
  Ce ?? "name"
61
- ), g = X ? Ue.options : (Ie ?? []).map(
61
+ ), h = X ? Ue.options : (Ie ?? []).map(
62
62
  (e) => typeof e == "string" ? { value: e, label: e } : e
63
63
  ), { popupRef: W, coords: S, ready: _e, themeClass: B, portalTarget: ve } = tn(
64
64
  l,
@@ -66,14 +66,14 @@ const fn = /* @__PURE__ */ Object.assign(
66
66
  () => {
67
67
  w(!1), V("");
68
68
  }
69
- ), t = L(() => N ? Array.isArray(N) ? N : [N] : [], [N]), c = L(() => {
69
+ ), t = L(() => g == null || g === "" && !h.some((e) => e.value === "") ? [] : Array.isArray(g) ? g : [g], [g, h]), c = L(() => {
70
70
  if (!P && !b || b)
71
- return g;
71
+ return h;
72
72
  const e = P.toLowerCase();
73
- return g.filter(
73
+ return h.filter(
74
74
  (n) => n.label.toLowerCase().includes(e) || String(n.value).toLowerCase().includes(e)
75
75
  );
76
- }, [g, P, b]), me = L(() => {
76
+ }, [h, P, b]), me = L(() => {
77
77
  const e = /* @__PURE__ */ new Map();
78
78
  for (const n of c) {
79
79
  const s = n.group || "";
@@ -84,11 +84,11 @@ const fn = /* @__PURE__ */ Object.assign(
84
84
  (e) => {
85
85
  if (o) {
86
86
  const n = t.includes(e) ? t.filter((s) => s !== e) : [...t, e];
87
- y?.(n);
87
+ N?.(n);
88
88
  } else
89
- y?.(e), w(!1), V("");
89
+ N?.(e), w(!1), V("");
90
90
  },
91
- [o, t, y]
91
+ [o, t, N]
92
92
  ), H = T(() => {
93
93
  const e = c.findIndex((n) => t.includes(String(n.value)));
94
94
  D(e >= 0 ? e : 0), w(!0);
@@ -103,7 +103,7 @@ const fn = /* @__PURE__ */ Object.assign(
103
103
  return;
104
104
  }
105
105
  if ((e.key === "Delete" || e.key === "Backspace") && !n && A && t.length > 0) {
106
- e.preventDefault(), y?.(o ? [] : "");
106
+ e.preventDefault(), N?.(o ? [] : "");
107
107
  return;
108
108
  }
109
109
  if (e.key === "Enter" || e.key === " " && !n) {
@@ -121,8 +121,8 @@ const fn = /* @__PURE__ */ Object.assign(
121
121
  PageUp: (a) => a - 10
122
122
  };
123
123
  n || (s.Home = () => 0, s.End = () => c.length - 1);
124
- const h = s[e.key];
125
- h && (e.preventDefault(), l ? Z(h) : H());
124
+ const p = s[e.key];
125
+ p && (e.preventDefault(), l ? Z(p) : H());
126
126
  },
127
127
  [
128
128
  l,
@@ -133,10 +133,10 @@ const fn = /* @__PURE__ */ Object.assign(
133
133
  Z,
134
134
  A,
135
135
  t.length,
136
- y,
136
+ N,
137
137
  o
138
138
  ]
139
- ), ge = oe || !!b, ee = `${m}-listbox`, ne = (e) => `${m}-opt-${e}`, Ne = l && r >= 0 && c[r] ? ne(r) : void 0;
139
+ ), ge = oe || !!b, ee = `${y}-listbox`, ne = (e) => `${y}-opt-${e}`, Ne = l && r >= 0 && c[r] ? ne(r) : void 0;
140
140
  te(() => {
141
141
  const e = W.current;
142
142
  if (!(!l || r < 0 || !e)) {
@@ -163,25 +163,25 @@ const fn = /* @__PURE__ */ Object.assign(
163
163
  },
164
164
  { ref: W, enabled: l && ge }
165
165
  );
166
- const ie = L(() => t.length === 0 ? null : o ? t.map((e) => g.find((n) => n.value === e)?.label || e).join(", ") : g.find((e) => e.value === t[0])?.label || t[0], [t, g, o]), qe = T(
166
+ const ie = L(() => t.length === 0 ? null : o ? t.map((e) => h.find((n) => n.value === e)?.label || e).join(", ") : h.find((e) => e.value === t[0])?.label || t[0], [t, h, o]), qe = T(
167
167
  (e) => {
168
- e.stopPropagation(), y?.(o ? [] : "");
168
+ e.stopPropagation(), N?.(o ? [] : "");
169
169
  },
170
- [y, o]
170
+ [N, o]
171
171
  ), ze = L(
172
172
  () => [
173
- { key: "Enter", description: v("shortcuts.select", "Select") },
174
- { key: "Space", description: v("shortcuts.openDropdown", "Open dropdown") },
173
+ { key: "Enter", description: m("shortcuts.select", "Select") },
174
+ { key: "Space", description: m("shortcuts.openDropdown", "Open dropdown") },
175
175
  se.moveUp,
176
176
  se.moveDown,
177
177
  se.cancel
178
178
  ],
179
- [v]
179
+ [m]
180
180
  );
181
181
  return Oe ? null : /* @__PURE__ */ f(
182
182
  "div",
183
183
  {
184
- className: `nice-field ${$ == null ? "nice-field--select-auto" : ""} nice-field--${le} ${Le === "left" ? "nice-field--label-left" : ""} ${_ ? "nice-field--loading" : ""} ${ke || ""}`,
184
+ className: `nice-field ${$ == null ? "nice-field--select-auto" : ""} nice-field--${le} ${Le === "left" ? "nice-field--label-left" : ""} ${v ? "nice-field--loading" : ""} ${ke || ""}`,
185
185
  style: {
186
186
  ...$e,
187
187
  ...q != null && {
@@ -190,14 +190,14 @@ const fn = /* @__PURE__ */ Object.assign(
190
190
  ...$ != null && {
191
191
  "--nice-field-control-width": typeof $ == "number" ? `${$}px` : $
192
192
  },
193
- ..._ && pe != null && { "--nice-select-locked-width": `${pe}px` }
193
+ ...v && pe != null && { "--nice-select-locked-width": `${pe}px` }
194
194
  },
195
- "aria-busy": _ || void 0,
195
+ "aria-busy": v || void 0,
196
196
  children: [
197
197
  O && /* @__PURE__ */ f(
198
198
  "label",
199
199
  {
200
- htmlFor: m,
200
+ htmlFor: y,
201
201
  className: `nice-field__label ${xe ? "nice-field__label--required" : ""}`,
202
202
  children: [
203
203
  O,
@@ -210,7 +210,7 @@ const fn = /* @__PURE__ */ Object.assign(
210
210
  Ze,
211
211
  {
212
212
  value: ie,
213
- placeholder: ae || v("controls.select", "Select..."),
213
+ placeholder: ae || m("controls.select", "Select..."),
214
214
  disabled: k,
215
215
  onActivate: () => {
216
216
  fe.enterEdit(), w(!0);
@@ -225,16 +225,16 @@ const fn = /* @__PURE__ */ Object.assign(
225
225
  I.current = e, typeof z == "function" ? z(e) : z && (z.current = e);
226
226
  },
227
227
  type: "button",
228
- id: m,
228
+ id: y,
229
229
  role: "combobox",
230
230
  "aria-label": O ? void 0 : ce,
231
231
  "aria-expanded": l,
232
232
  "aria-haspopup": "listbox",
233
233
  "aria-controls": l ? ee : void 0,
234
234
  "aria-activedescendant": ge ? void 0 : Ne,
235
- "aria-invalid": !!p,
235
+ "aria-invalid": !!_,
236
236
  "aria-keyshortcuts": A && t.length > 0 ? "Delete" : void 0,
237
- className: `nice-select__trigger nice-select__trigger--${le} nice-select--ds-${Ae} ${l ? "nice-select__trigger--open" : ""} ${p ? "nice-select__trigger--error" : ""} ${k ? "nice-select__trigger--disabled" : ""}`,
237
+ className: `nice-select__trigger nice-select__trigger--${le} nice-select--ds-${Ae} ${l ? "nice-select__trigger--open" : ""} ${_ ? "nice-select__trigger--error" : ""} ${k ? "nice-select__trigger--disabled" : ""}`,
238
238
  style: {
239
239
  ...Re,
240
240
  ...o && !K && M != null ? {
@@ -259,7 +259,7 @@ const fn = /* @__PURE__ */ Object.assign(
259
259
  } : void 0,
260
260
  children: ie
261
261
  }
262
- ) : /* @__PURE__ */ i("span", { className: "nice-select__placeholder", children: ae || v("controls.select", "Select...") }),
262
+ ) : /* @__PURE__ */ i("span", { className: "nice-select__placeholder", children: ae || m("controls.select", "Select...") }),
263
263
  /* @__PURE__ */ f("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
264
264
  A && t.length > 0 && // the pointer's shortcut for Delete / Backspace on the trigger
265
265
  /* @__PURE__ */ i("span", { className: "nice-input__clear", onClick: qe, role: "presentation", children: /* @__PURE__ */ i(J, { name: "close", size: 14 }) }),
@@ -307,29 +307,29 @@ const fn = /* @__PURE__ */ Object.assign(
307
307
  V(e.target.value), D(0), b?.(e.target.value);
308
308
  },
309
309
  onKeyDown: ye,
310
- placeholder: v("controls.search", "Search..."),
311
- "aria-label": v("controls.search", "Search..."),
310
+ placeholder: m("controls.search", "Search..."),
311
+ "aria-label": m("controls.search", "Search..."),
312
312
  "aria-controls": ee,
313
313
  "aria-activedescendant": Ne,
314
314
  "aria-autocomplete": "list",
315
315
  autoFocus: !0
316
316
  }
317
317
  ) }),
318
- _ && /* @__PURE__ */ i("div", { className: "nice-select__loading", children: /* @__PURE__ */ i(
318
+ v && /* @__PURE__ */ i("div", { className: "nice-select__loading", children: /* @__PURE__ */ i(
319
319
  "div",
320
320
  {
321
321
  className: "nice-spinner nice-spinner--sm",
322
322
  style: { margin: "8px auto" }
323
323
  }
324
324
  ) }),
325
- !_ && c.length === 0 ? /* @__PURE__ */ i("div", { className: "nice-select__empty", children: Me || v("controls.noResults", "No results found") }) : F && !Array.from(me.keys()).some((e) => e !== "") ? (() => {
325
+ !v && c.length === 0 ? /* @__PURE__ */ i("div", { className: "nice-select__empty", children: Me || m("controls.noResults", "No results found") }) : F && !Array.from(me.keys()).some((e) => e !== "") ? (() => {
326
326
  const n = c.length * u, s = Math.max(
327
327
  0,
328
328
  Math.floor(ue / u) - 3
329
- ), h = Math.min(
329
+ ), p = Math.min(
330
330
  c.length,
331
331
  Math.ceil((ue + de) / u) + 3
332
- ), a = c.slice(s, h);
332
+ ), a = c.slice(s, p);
333
333
  return /* @__PURE__ */ i("div", { style: { height: n, position: "relative" }, children: a.map((d, Pe) => {
334
334
  const E = s + Pe, G = t.includes(d.value);
335
335
  return (
@@ -378,7 +378,7 @@ const fn = /* @__PURE__ */ Object.assign(
378
378
  })() : Array.from(me.entries()).map(([e, n]) => /* @__PURE__ */ f(en.Fragment, { children: [
379
379
  e && /* @__PURE__ */ i("div", { className: "nice-select__group-label", children: e }),
380
380
  n.map((s) => {
381
- const h = t.includes(s.value), a = c.indexOf(s);
381
+ const p = t.includes(s.value), a = c.indexOf(s);
382
382
  return (
383
383
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keys: the combobox (aria-activedescendant)
384
384
  /* @__PURE__ */ i(
@@ -387,18 +387,18 @@ const fn = /* @__PURE__ */ Object.assign(
387
387
  id: ne(a),
388
388
  "data-nice-option-index": a,
389
389
  role: "option",
390
- "aria-selected": h,
390
+ "aria-selected": p,
391
391
  "aria-disabled": s.disabled || void 0,
392
- className: `nice-select__option ${h ? "nice-select__option--selected" : ""} ${a === r ? "nice-select__option--highlighted" : ""} ${s.disabled ? "nice-select__option--disabled" : ""}`,
392
+ className: `nice-select__option ${p ? "nice-select__option--selected" : ""} ${a === r ? "nice-select__option--highlighted" : ""} ${s.disabled ? "nice-select__option--disabled" : ""}`,
393
393
  onClick: () => !s.disabled && C(String(s.value)),
394
394
  onMouseEnter: () => D(a),
395
- children: j ? j(s, h) : /* @__PURE__ */ f(be, { children: [
395
+ children: j ? j(s, p) : /* @__PURE__ */ f(be, { children: [
396
396
  s.icon && /* @__PURE__ */ i("span", { children: s.icon }),
397
397
  /* @__PURE__ */ f("div", { style: { flex: 1 }, children: [
398
398
  /* @__PURE__ */ i("div", { children: s.label }),
399
399
  s.description && /* @__PURE__ */ i("div", { className: "nice-select__option-desc", children: s.description })
400
400
  ] }),
401
- h && /* @__PURE__ */ i(
401
+ p && /* @__PURE__ */ i(
402
402
  J,
403
403
  {
404
404
  name: "check",
@@ -419,12 +419,12 @@ const fn = /* @__PURE__ */ Object.assign(
419
419
  ve
420
420
  )
421
421
  ] }),
422
- _ && /* @__PURE__ */ i("span", { className: "nice-field__spinner", children: /* @__PURE__ */ i("span", { className: "nice-spinner nice-spinner--sm" }) }),
423
- U === "right" && p && /* @__PURE__ */ i("div", { id: `${m}-error`, className: "nice-field__error", role: "alert", children: p }),
424
- U === "right" && !p && R && /* @__PURE__ */ i("div", { id: `${m}-helper`, className: "nice-field__helper", children: R })
422
+ v && /* @__PURE__ */ i("span", { className: "nice-field__spinner", children: /* @__PURE__ */ i("span", { className: "nice-spinner nice-spinner--sm" }) }),
423
+ U === "right" && _ && /* @__PURE__ */ i("div", { id: `${y}-error`, className: "nice-field__error", role: "alert", children: _ }),
424
+ U === "right" && !_ && R && /* @__PURE__ */ i("div", { id: `${y}-helper`, className: "nice-field__helper", children: R })
425
425
  ] }),
426
- U !== "right" && p && /* @__PURE__ */ i("div", { id: `${m}-error`, className: "nice-field__error", role: "alert", children: p }),
427
- U !== "right" && !p && R && /* @__PURE__ */ i("div", { id: `${m}-helper`, className: "nice-field__helper", children: R })
426
+ U !== "right" && _ && /* @__PURE__ */ i("div", { id: `${y}-error`, className: "nice-field__error", role: "alert", children: _ }),
427
+ U !== "right" && !_ && R && /* @__PURE__ */ i("div", { id: `${y}-helper`, className: "nice-field__helper", children: R })
428
428
  ]
429
429
  }
430
430
  );