@nice2dev/ui 1.4.15 → 1.4.17

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 (33) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/NiceAlert-RVTgQxCE.cjs +1 -0
  3. package/dist/NiceDataGrid-DpSADM9L.cjs +10 -0
  4. package/dist/NiceForm-CzH9IPmZ.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-CrJJtDJx.cjs} +1 -1
  8. package/dist/{NiceModuleLifecyclePanel-DVHQuhc-.cjs → NiceModuleLifecyclePanel-CxVQOIIA.cjs} +1 -1
  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-C40zmo8O.cjs +587 -0
  12. package/dist/{NiceScheduler-B2DamQ_L.cjs → NiceScheduler-CSWtLS5G.cjs} +1 -1
  13. package/dist/{core-lazy-ChKRuEPb.cjs → core-lazy-DUKT6R8d.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.cjs +1 -1
  22. package/dist/feedback.cjs +1 -1
  23. package/dist/index.cjs +101 -101
  24. package/dist/index.d.ts +31 -4
  25. package/dist/lazy.cjs +1 -1
  26. package/dist/navigation.cjs +1 -1
  27. package/dist/{no-code-CN_q6TcB.cjs → no-code-DPc82kyy.cjs} +11 -11
  28. package/dist/no-code.cjs +1 -1
  29. package/package.json +4 -4
  30. package/dist/NiceDataGrid-B1AOjgjm.cjs +0 -10
  31. package/dist/NiceForm-fmePSeA9.cjs +0 -1
  32. package/dist/NiceLoginForm-C2-WgRn0.cjs +0 -1
  33. package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +0 -587
package/dist/data.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./NiceDataGrid-B1AOjgjm.cjs"),e=require("./NiceSavedQueryPanel-ChY4HwpM.cjs"),r=require("./NicePivotGrid-B_7iQJys.cjs");exports.NiceDataGrid=i.NiceDataGrid;exports.applyColumnOrder=i.applyColumnOrder;exports.buildColumnGroupSegments=i.buildColumnGroupSegments;exports.buildGridState=i.buildGridState;exports.computeAggregate=i.computeAggregate;exports.escapeCsvField=i.escapeCsvField;exports.formatNumberPattern=i.formatNumberPattern;exports.measureColumnContentWidth=i.measureColumnContentWidth;exports.readStoredGridState=i.readStoredGridState;exports.writeStoredGridState=i.writeStoredGridState;exports.NiceDataGridAI=e.NiceDataGridAI;exports.NiceKanbanBoard=e.NiceKanbanBoard;exports.NiceList=e.NiceList;exports.NiceModuleGrid=e.NiceModuleGrid;exports.NiceReconciliationView=e.NiceReconciliationView;exports.NiceSavedQueryPanel=e.NiceSavedQueryPanel;exports.NiceSpreadsheet=e.NiceSpreadsheet;exports.NiceTable=e.NiceTable;exports.NiceTileView=e.NiceTileView;exports.NiceTreeGrid=e.NiceTreeGrid;exports.NiceTreeList=e.NiceTreeList;exports.NiceTreeView=e.NiceTreeView;exports.NicePivotGrid=r.NicePivotGrid;exports.NicePivotGridFieldChooser=r.NicePivotGridFieldChooser;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./NiceDataGrid-DpSADM9L.cjs"),e=require("./NiceSavedQueryPanel-C40zmo8O.cjs"),r=require("./NicePivotGrid-BshofJh1.cjs");exports.NiceDataGrid=i.NiceDataGrid;exports.applyColumnOrder=i.applyColumnOrder;exports.buildColumnGroupSegments=i.buildColumnGroupSegments;exports.buildGridState=i.buildGridState;exports.computeAggregate=i.computeAggregate;exports.escapeCsvField=i.escapeCsvField;exports.formatNumberPattern=i.formatNumberPattern;exports.measureColumnContentWidth=i.measureColumnContentWidth;exports.readStoredGridState=i.readStoredGridState;exports.writeStoredGridState=i.writeStoredGridState;exports.NiceDataGridAI=e.NiceDataGridAI;exports.NiceKanbanBoard=e.NiceKanbanBoard;exports.NiceList=e.NiceList;exports.NiceModuleGrid=e.NiceModuleGrid;exports.NiceReconciliationView=e.NiceReconciliationView;exports.NiceSavedQueryPanel=e.NiceSavedQueryPanel;exports.NiceSpreadsheet=e.NiceSpreadsheet;exports.NiceTable=e.NiceTable;exports.NiceTileView=e.NiceTileView;exports.NiceTreeGrid=e.NiceTreeGrid;exports.NiceTreeList=e.NiceTreeList;exports.NiceTreeView=e.NiceTreeView;exports.NicePivotGrid=r.NicePivotGrid;exports.NicePivotGridFieldChooser=r.NicePivotGridFieldChooser;
package/dist/data.d.ts CHANGED
@@ -1445,6 +1445,10 @@ declare interface NiceRowEditDialogProps {
1445
1445
  onFieldChange: (field: string, value: unknown) => void;
1446
1446
  onSubmit: (data: Record<string, unknown>) => void;
1447
1447
  onClose: () => void;
1448
+ /** Why the last save failed, shown above the form (1.4.17). */
1449
+ error?: default_2.ReactNode;
1450
+ /** A save is under way: the form is disabled until it answers (1.4.17). */
1451
+ saving?: boolean;
1448
1452
  }
1449
1453
 
1450
1454
  declare interface NiceSavedQuery {
@@ -1719,7 +1723,7 @@ declare interface NiceTreeContextMenuItem {
1719
1723
  /** Where a dropped row goes relative to the row it is dropped on. */
1720
1724
  declare type NiceTreeDropPosition = 'before' | 'inside' | 'after';
1721
1725
 
1722
- export declare function NiceTreeGrid<T extends NiceTreeGridNode>({ columns, data, keyField, parentKeyField, nested, childrenField, expandedKeys: controlledExpanded, defaultExpandedKeys, onExpandedChange, hasChildren, loadChildren, rowActions, defaultExpandAll, sortable, sortField: controlledSortField, sortDirection: controlledSortDir, onSort, selectable, selectedKeys: controlledSelected, onSelectionChange, checkable, checkedKeys, defaultCheckedKeys, onCheckedChange, checkStrategy, isRowCheckable, isRowDisabled, checkboxPlacement, checkOnRowClick, showCheckedCount, checkedSummary, showSelectAll, showOnlyChecked: controlledOnlyChecked, defaultShowOnlyChecked, onShowOnlyCheckedChange, toolbarActions, searchable, searchPlaceholder, searchText, defaultSearchText, onSearchChange, searchFields, searchFilter, searchKeepDescendants, searchAutoExpand, highlightMatches, rowClassName, getRowLabel, virtualScroll, rowHeight, height, striped, compact, size, loading, disabled, readOnly, error, emptyText, toolbar, onRowClick, contextMenuItems, rowDraggable, canDrop, onRowDrop, editMode, formItems, formColumns, editFormTitle, formProps, onRowEdit, className, style, id, testId, 'data-testid': dataTestId, accessMode, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: NiceTreeGridProps<T>): default_2.JSX.Element | null;
1726
+ export declare function NiceTreeGrid<T extends NiceTreeGridNode>({ columns, data, keyField, parentKeyField, nested, childrenField, expandedKeys: controlledExpanded, defaultExpandedKeys, onExpandedChange, hasChildren, loadChildren, rowActions, defaultExpandAll, sortable, sortField: controlledSortField, sortDirection: controlledSortDir, onSort, selectable, selectedKeys: controlledSelected, onSelectionChange, checkable, checkedKeys, defaultCheckedKeys, onCheckedChange, checkStrategy, isRowCheckable, isRowDisabled, checkboxPlacement, checkOnRowClick, showCheckedCount, checkedSummary, showSelectAll, showOnlyChecked: controlledOnlyChecked, defaultShowOnlyChecked, onShowOnlyCheckedChange, toolbarActions, searchable, searchPlaceholder, searchText, defaultSearchText, onSearchChange, searchFields, searchFilter, searchKeepDescendants, searchAutoExpand, highlightMatches, rowClassName, getRowLabel, virtualScroll, rowHeight, height, striped, compact, size, loading, disabled, readOnly, error, emptyText, toolbar, onRowClick, contextMenuItems, rowDraggable, canDrop, onRowDrop, editMode, formItems, formColumns, editFormTitle, formProps, onRowEdit, apiRef, selectionMode, selectedKey: controlledSelectedKey, defaultSelectedKey, onSelectedKeyChange, className, style, id, testId, 'data-testid': dataTestId, accessMode, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: NiceTreeGridProps<T>): default_2.JSX.Element | null;
1723
1727
 
1724
1728
  /** What a `checkedSummary` function of {@link NiceTreeGrid} gets. */
1725
1729
  export declare interface NiceTreeGridCheckedSummaryInfo<T = NiceTreeGridNode> {
@@ -1748,6 +1752,12 @@ export declare interface NiceTreeGridCheckInfo<T = NiceTreeGridNode> {
1748
1752
  halfCheckedKeys: string[];
1749
1753
  }
1750
1754
 
1755
+ /** NiceTreeGrid's imperative handle, from the `apiRef` prop (1.4.17). */
1756
+ export declare interface NiceTreeGridHandle {
1757
+ /** Opens a row's edit dialog (`editMode="popup"` with `onRowEdit`); an unknown key does nothing. */
1758
+ editRow: (key: string) => void;
1759
+ }
1760
+
1751
1761
  /** An entry of a {@link NiceTreeGridProps.contextMenuItems} menu (1.4.5). */
1752
1762
  export declare interface NiceTreeGridMenuItem {
1753
1763
  id: string;
@@ -1961,8 +1971,25 @@ export declare interface NiceTreeGridProps<T extends NiceTreeGridNode = NiceTree
1961
1971
  editFormTitle?: string;
1962
1972
  /** More props of the dialog's NiceForm. */
1963
1973
  formProps?: NiceRowEditDialogProps['formProps'];
1964
- /** A row edited in the dialog. The grid does not change `data` itself. */
1965
- onRowEdit?: (key: string, row: T) => void;
1974
+ /**
1975
+ * A row edited in the dialog. The grid does not change `data` itself. From 1.4.17 (OmniVerk wishlist
1976
+ * #24) the dialog waits for it: return `false` or a message — or a promise of one, as when the server
1977
+ * refuses — and the dialog stays open showing it (a thrown error too); anything else closes it.
1978
+ */
1979
+ onRowEdit?: (key: string, row: T) => void | boolean | string | Promise<void | boolean | string>;
1980
+ /** Imperative handle (1.4.17): `editRow(key)` opens a row's dialog from a toolbar or a menu. */
1981
+ apiRef?: default_2.Ref<NiceTreeGridHandle>;
1982
+ /**
1983
+ * `'single'` (1.4.17 — OmniVerk wishlist #24): one selected row without checkboxes — a click or
1984
+ * Space selects it (highlighted, `aria-selected`), also in `readOnly`. `selectable` takes precedence.
1985
+ */
1986
+ selectionMode?: 'single';
1987
+ /** The selected row (controlled, `selectionMode="single"`); `null` for none. */
1988
+ selectedKey?: string | null;
1989
+ /** The row selected at first (uncontrolled). */
1990
+ defaultSelectedKey?: string | null;
1991
+ /** The selected row changed (`selectionMode="single"`). */
1992
+ onSelectedKeyChange?: (key: string | null, row: T | null) => void;
1966
1993
  }
1967
1994
 
1968
1995
  /** A built-in button in the rows of {@link NiceTreeGrid}. */
@@ -1,6 +1,6 @@
1
1
  import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
2
  import { useNiceTranslation as Se, useNiceAccessMode as Ae, useNiceRecord as Ie } from "@nice2dev/ui-core";
3
- import { useMemo as q, useState as E, useRef as U, useEffect as O, useCallback as h, useId as Le } from "react";
3
+ import { useMemo as k, useState as E, useRef as U, useEffect as O, useCallback as h, useId as Le } from "react";
4
4
  import { NiceButton as V } from "../../buttons/NiceButton.mjs";
5
5
  import { NiceTabs as Re } from "../../navigation/NiceTabs.mjs";
6
6
  import { NiceAutocomplete as we } from "../inputs/NiceAutocomplete.mjs";
@@ -26,28 +26,31 @@ const Ye = [], Je = [
26
26
  '[role="combobox"], [role="spinbutton"], [role="slider"], [role="switch"], [role="radiogroup"], [role="listbox"], [role="textbox"]',
27
27
  'button, [tabindex]:not([tabindex="-1"])'
28
28
  ];
29
- function Qe(x) {
30
- for (const T of Je) {
31
- const d = x.querySelector(T);
29
+ function Qe(v) {
30
+ const N = v.querySelector('[role="radiogroup"]');
31
+ if (N)
32
+ return N;
33
+ for (const b of Je) {
34
+ const d = v.querySelector(b);
32
35
  if (d)
33
36
  return d;
34
37
  }
35
38
  return null;
36
39
  }
37
40
  const Xe = ({
38
- items: x = Ye,
39
- data: T,
40
- onFieldChange: d,
41
- onSubmit: k,
41
+ items: v = Ye,
42
+ data: N,
43
+ onFieldChange: b,
44
+ onSubmit: d,
42
45
  dataSource: Y,
43
46
  recordKey: J,
44
47
  columns: S = 1,
45
48
  responsiveColumns: A,
46
49
  gap: se = 16,
47
50
  labelPosition: ie = "top",
48
- size: v = "md",
49
- readOnly: g,
50
- disabled: N,
51
+ size: _ = "md",
52
+ readOnly: y,
53
+ disabled: C,
51
54
  className: le,
52
55
  style: Q,
53
56
  accessMode: ue,
@@ -61,34 +64,34 @@ const Xe = ({
61
64
  cancelLabel: he,
62
65
  "data-testid": be
63
66
  }) => {
64
- const { t: D } = Se(), ve = me ?? D("form.submit", "Submit"), ge = pe ?? D("form.reset", "Reset"), Ne = he ?? D("form.cancel", "Cancel"), M = Ae(ue, de), _e = M === "hidden";
65
- M === "disabled" && (N = !0), M === "readOnly" && (g = !0);
66
- const l = Ie(Y ?? null, J), u = !!Y && J != null, s = q(
67
- () => u ? l.editData : T ?? {},
68
- [u, l.editData, T]
69
- ), [K] = E(() => ({ ...s })), [_, z] = E([]), y = q(() => Object.keys(s).some((e) => s[e] !== K[e]), [s, K]), ee = U(!1);
67
+ const { t: D } = Se(), ge = me ?? D("form.submit", "Submit"), ve = pe ?? D("form.reset", "Reset"), Ne = he ?? D("form.cancel", "Cancel"), M = Ae(ue, de), _e = M === "hidden";
68
+ M === "disabled" && (C = !0), M === "readOnly" && (y = !0);
69
+ const l = Ie(Y ?? null, J), u = !!Y && J != null, s = k(
70
+ () => u ? l.editData : N ?? {},
71
+ [u, l.editData, N]
72
+ ), [K] = E(() => ({ ...s })), [q, z] = E([]), x = k(() => Object.keys(s).some((e) => s[e] !== K[e]), [s, K]), ee = U(!1);
70
73
  O(() => {
71
- y !== ee.current && (ee.current = y, X?.(y));
72
- }, [y, X]);
73
- const C = U(null), re = h(() => {
74
- G && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
75
- u ? l.save() : k?.(s);
74
+ x !== ee.current && (ee.current = x, X?.(x));
75
+ }, [x, X]);
76
+ const T = U(null), re = h(() => {
77
+ G && (T.current && clearTimeout(T.current), T.current = setTimeout(() => {
78
+ u ? l.save() : d?.(s);
76
79
  }, G));
77
- }, [G, u, l, k, s]), te = h(
80
+ }, [G, u, l, d, s]), te = h(
78
81
  (e, t) => {
79
- g || N || (z((n) => [...n, { field: e, prev: s[e] }]), u ? l.set(e, t) : d?.(e, t), re());
82
+ y || C || (z((n) => [...n, { field: e, prev: s[e] }]), u ? l.set(e, t) : b?.(e, t), re());
80
83
  },
81
- [u, l, d, g, N, s, re]
84
+ [u, l, b, y, C, s, re]
82
85
  ), ye = h(() => {
83
- if (_.length === 0)
86
+ if (q.length === 0)
84
87
  return;
85
- const e = _[_.length - 1];
86
- z((t) => t.slice(0, -1)), u ? l.set(e.field, e.prev) : d?.(e.field, e.prev);
87
- }, [_, u, l, d]), Ce = h(
88
+ const e = q[q.length - 1];
89
+ z((t) => t.slice(0, -1)), u ? l.set(e.field, e.prev) : b?.(e.field, e.prev);
90
+ }, [q, u, l, b]), Ce = h(
88
91
  (e) => {
89
- e.preventDefault(), C.current && clearTimeout(C.current), u ? l.save() : k?.(s);
92
+ e.preventDefault(), T.current && clearTimeout(T.current), u ? l.save() : d?.(s);
90
93
  },
91
- [s, k, u, l]
94
+ [s, d, u, l]
92
95
  ), I = U(null), L = Le(), R = h((e) => `${L}-f-${e}`, [L]), j = h((e) => `${L}-l-${e}`, [L]);
93
96
  O(() => {
94
97
  const e = I.current;
@@ -114,16 +117,16 @@ const Xe = ({
114
117
  });
115
118
  return t.observe(e), () => t.disconnect();
116
119
  }, [A, S]);
117
- const b = q(
118
- () => x.filter((e) => !(e.visible === !1 || e.hidden || e.visibleWhen && !e.visibleWhen(s))),
119
- [x, s]
120
- ), ne = q(() => {
120
+ const g = k(
121
+ () => v.filter((e) => !(e.visible === !1 || e.hidden || e.visibleWhen && !e.visibleWhen(s))),
122
+ [v, s]
123
+ ), ne = k(() => {
121
124
  const e = [];
122
125
  let t = null;
123
- for (const n of b)
126
+ for (const n of g)
124
127
  !t || t.name !== n.group ? (t = { name: n.group, items: [n] }, e.push(t)) : t.items.push(n);
125
128
  return e;
126
- }, [b]), xe = h(
129
+ }, [g]), xe = h(
127
130
  (e) => {
128
131
  const t = s[e.field] !== void 0 ? s[e.field] : e.defaultValue, n = (r) => te(e.field, r);
129
132
  if (e.render)
@@ -134,9 +137,9 @@ const Xe = ({
134
137
  const m = e.type || "text", c = e.options?.map(
135
138
  (r) => typeof r == "string" ? { label: r, value: r } : { label: r.label, value: String(r.value) }
136
139
  ), a = {
137
- size: v,
138
- disabled: N || e.disabled,
139
- readOnly: g || e.readOnly
140
+ size: _,
141
+ disabled: C || e.disabled,
142
+ readOnly: y || e.readOnly
140
143
  }, i = e.placeholder;
141
144
  switch (m) {
142
145
  case "number":
@@ -359,7 +362,7 @@ const Xe = ({
359
362
  );
360
363
  }
361
364
  },
362
- [s, te, N, g, v, R, j]
365
+ [s, te, C, y, _, R, j]
363
366
  ), w = (e) => /* @__PURE__ */ p(
364
367
  "div",
365
368
  {
@@ -388,12 +391,12 @@ const Xe = ({
388
391
  display: "grid",
389
392
  gridTemplateColumns: `repeat(${qe}, 1fr)`,
390
393
  gap: se
391
- }, oe = ne.some((e) => e.name != null), f = q(() => {
394
+ }, oe = ne.some((e) => e.name != null), f = k(() => {
392
395
  const e = /* @__PURE__ */ new Set(), t = [];
393
- for (const n of b)
396
+ for (const n of g)
394
397
  n.tab && !e.has(n.tab) && (e.add(n.tab), t.push(n.tab));
395
398
  return t;
396
- }, [b]), $ = f.length > 0, [H, ae] = E("");
399
+ }, [g]), $ = f.length > 0, [H, ae] = E("");
397
400
  O(() => {
398
401
  $ && !f.includes(H) && ae(f[0]);
399
402
  }, [$, f, H]);
@@ -415,26 +418,26 @@ const Xe = ({
415
418
  )) : /* @__PURE__ */ o("div", { style: F, children: e.map(w) });
416
419
  }, ke = fe ? /* @__PURE__ */ p("div", { className: "nice-form__actions", children: [
417
420
  /* @__PURE__ */ p("div", { className: "nice-form__actions-left", children: [
418
- Z && /* @__PURE__ */ o(V, { type: "button", variant: "secondary", size: v, onClick: Z, children: Ne }),
421
+ Z && /* @__PURE__ */ o(V, { type: "button", variant: "secondary", size: _, onClick: Z, children: Ne }),
419
422
  /* @__PURE__ */ o(
420
423
  V,
421
424
  {
422
425
  type: "button",
423
426
  variant: "ghost",
424
- size: v,
427
+ size: _,
425
428
  onClick: ye,
426
- disabled: _.length === 0,
427
- children: ge
429
+ disabled: q.length === 0,
430
+ children: ve
428
431
  }
429
432
  )
430
433
  ] }),
431
- /* @__PURE__ */ o("div", { className: "nice-form__actions-right", children: /* @__PURE__ */ o(V, { type: "submit", variant: "primary", size: v, children: ve }) })
434
+ /* @__PURE__ */ o("div", { className: "nice-form__actions-right", children: /* @__PURE__ */ o(V, { type: "submit", variant: "primary", size: _, children: ge }) })
432
435
  ] }) : null;
433
436
  return _e ? null : /* @__PURE__ */ p(
434
437
  "form",
435
438
  {
436
439
  ref: I,
437
- className: `nice-form nice-form--label-${ie}${y ? " nice-form--dirty" : ""} ${le || ""}`,
440
+ className: `nice-form nice-form--label-${ie}${x ? " nice-form--dirty" : ""} ${le || ""}`,
438
441
  style: oe || $ ? { ...Q } : { ...F, ...Q },
439
442
  onSubmit: Ce,
440
443
  "data-testid": be,
@@ -449,7 +452,7 @@ const Xe = ({
449
452
  tabs: f.map((e) => ({
450
453
  id: e,
451
454
  label: e,
452
- content: /* @__PURE__ */ o("div", { className: "nice-form__tab-panel", children: Te(b.filter((t) => (t.tab ?? f[0]) === e)) })
455
+ content: /* @__PURE__ */ o("div", { className: "nice-form__tab-panel", children: Te(g.filter((t) => (t.tab ?? f[0]) === e)) })
453
456
  }))
454
457
  }
455
458
  ) : oe ? ne.map((e, t) => /* @__PURE__ */ p(
@@ -462,7 +465,7 @@ const Xe = ({
462
465
  ]
463
466
  },
464
467
  t
465
- )) : b.map(w),
468
+ )) : g.map(w),
466
469
  ke
467
470
  ]
468
471
  }
@@ -2,11 +2,11 @@ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
2
  import { useComponentDisplayClass as j, useNiceAccessMode as z, useNiceTranslation as D, useControlId as H, NiceKeyboardHint as q } from "@nice2dev/ui-core";
3
3
  import { useMemo as E } from "react";
4
4
  const G = [], Y = ({
5
- label: m,
5
+ label: u,
6
6
  helperText: a,
7
7
  error: l,
8
8
  required: h,
9
- disabled: u,
9
+ disabled: p,
10
10
  size: N = "md",
11
11
  name: v,
12
12
  id: _,
@@ -24,11 +24,11 @@ const G = [], Y = ({
24
24
  labelWidth: r,
25
25
  controlWidth: d,
26
26
  loading: c,
27
- readOnly: p
27
+ readOnly: f
28
28
  }) => {
29
29
  j("toggle", A);
30
- const f = z(y, _), M = f === "hidden";
31
- (f === "disabled" || f === "readOnly") && (u = !0);
30
+ const m = z(y, _), M = m === "hidden";
31
+ (m === "disabled" || m === "readOnly") && (p = !0);
32
32
  const { t: o } = D(), i = H(_), O = v || i, S = E(
33
33
  () => [
34
34
  { key: "ArrowUp", description: o("shortcuts.previousOption", "Previous option") },
@@ -51,16 +51,16 @@ const G = [], Y = ({
51
51
  }
52
52
  },
53
53
  role: "radiogroup",
54
- "aria-labelledby": `${i}-label`,
54
+ "aria-labelledby": u ? `${i}-label` : void 0,
55
55
  "aria-busy": c || void 0,
56
56
  children: [
57
- m && /* @__PURE__ */ t(
57
+ u && /* @__PURE__ */ t(
58
58
  "span",
59
59
  {
60
60
  id: `${i}-label`,
61
61
  className: `nice-field__label ${h ? "nice-field__label--required" : ""}`,
62
62
  children: [
63
- m,
63
+ u,
64
64
  C && /* @__PURE__ */ e(q, { shortcuts: S, size: "sm" })
65
65
  ]
66
66
  }
@@ -73,7 +73,7 @@ const G = [], Y = ({
73
73
  children: g.map((n) => /* @__PURE__ */ t(
74
74
  "label",
75
75
  {
76
- className: `nice-radio ${u || n.disabled || c ? "nice-radio--disabled" : ""} ${p ? "nice-radio--readonly" : ""}`,
76
+ className: `nice-radio ${p || n.disabled || c ? "nice-radio--disabled" : ""} ${f ? "nice-radio--readonly" : ""}`,
77
77
  children: [
78
78
  /* @__PURE__ */ e(
79
79
  "input",
@@ -83,10 +83,10 @@ const G = [], Y = ({
83
83
  name: O,
84
84
  value: n.value,
85
85
  checked: k === n.value,
86
- disabled: u || n.disabled || c,
87
- "aria-readonly": p || void 0,
86
+ disabled: p || n.disabled || c,
87
+ "aria-readonly": f || void 0,
88
88
  onChange: () => {
89
- p || w?.(n.value);
89
+ f || w?.(n.value);
90
90
  }
91
91
  }
92
92
  ),