@nxgt/material 3.67.0 → 3.70.0

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 (105) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +6 -4
  3. package/dist/{alert-dialog-BgQDxcYh.js → alert-dialog-CBkWG32g.js} +1 -1
  4. package/dist/{async-slice-BCZyWgGr.js → async-slice-CNZ3N55P.js} +1 -1
  5. package/dist/{button-2de_lrix.js → button-D3qzqDY_.js} +1 -1
  6. package/dist/charts.js +3 -3
  7. package/dist/{chip-Cs0uEjpu.js → chip-CMTe4sQd.js} +2 -2
  8. package/dist/{code-editor-BYhBAfcc.js → code-editor-Cs7mz1J-.js} +5 -5
  9. package/dist/code-editor.js +5 -5
  10. package/dist/{code-language-items-xhmbF6wA.js → code-language-items-D_QMgjVy.js} +2 -2
  11. package/dist/{components-BRWaX4Xk.js → components-BbWcozcj.js} +18104 -17600
  12. package/dist/components.js +28 -28
  13. package/dist/{dialog-Co5oksU1.js → dialog-B3BSdRci.js} +4 -4
  14. package/dist/dnd.js +1 -1
  15. package/dist/{dropdown-menu-DdzyvN76.js → dropdown-menu-BaupOWgS.js} +1 -1
  16. package/dist/editor.js +661 -661
  17. package/dist/{empty-state-CQ0CV0kA.js → empty-state-B2Um5UpI.js} +2 -2
  18. package/dist/{field-blur-B2y-bNYi.js → field-blur-1XLyxRPr.js} +82 -82
  19. package/dist/{field-blur-context-BZtwcPUV.js → field-blur-context-XNvCDnMT.js} +1 -1
  20. package/dist/{hooks-DjuYsY-j.js → hooks-BU21Jpaa.js} +2 -2
  21. package/dist/hooks.js +2 -2
  22. package/dist/{hover-card-BeBVy6tB.js → hover-card-Bvm3svX9.js} +1 -1
  23. package/dist/i18n.js +3 -3
  24. package/dist/{icon-badge-DbYsbzwZ.js → icon-badge-wip9bfa2.js} +3 -3
  25. package/dist/{icon-button-Co6ttdv1.js → icon-button-QwIeBTdw.js} +1 -1
  26. package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +3 -3
  27. package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +13 -0
  28. package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +19 -0
  29. package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +19 -0
  30. package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +27 -0
  31. package/dist/lib/components/ui/fields/choice-list/index.d.ts +3 -0
  32. package/dist/lib/components/ui/fields/choice-list/partials/choice-mark.d.ts +18 -0
  33. package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +19 -0
  34. package/dist/lib/components/ui/fields/choice-list/types.d.ts +44 -0
  35. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  36. package/dist/lib/components/ui/fields/country-field/index.d.ts +2 -0
  37. package/dist/lib/components/ui/fields/country-field/iso-countries.d.ts +2 -0
  38. package/dist/lib/components/ui/fields/index.d.ts +2 -0
  39. package/dist/lib/components/ui/fields/phone-field/index.d.ts +1 -1
  40. package/dist/lib/components/ui/fields/phone-field/parse-phone.d.ts +2 -0
  41. package/dist/lib/components/ui/fields/phone-field/phone-field.d.ts +8 -1
  42. package/dist/lib/components/ui/fields/phone-field/phone-form-field.d.ts +8 -1
  43. package/dist/lib/components/ui/fields/phone-field/use-phone-value.d.ts +2 -1
  44. package/dist/lib/components/ui/fields/postal-address/utils.d.ts +15 -0
  45. package/dist/lib/components/ui/fields/quantity-field/index.d.ts +3 -0
  46. package/dist/lib/components/ui/fields/quantity-field/quantity-field.d.ts +8 -0
  47. package/dist/lib/components/ui/fields/quantity-field/quantity-form-field.d.ts +8 -0
  48. package/dist/lib/components/ui/fields/quantity-field/quantity-row.d.ts +13 -0
  49. package/dist/lib/components/ui/fields/quantity-field/quantity-unit.d.ts +12 -0
  50. package/dist/lib/components/ui/fields/quantity-field/quantity-value.d.ts +9 -0
  51. package/dist/lib/components/ui/fields/quantity-field/types.d.ts +45 -0
  52. package/dist/lib/components/ui/media/upload/index.d.ts +1 -0
  53. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.d.ts +6 -1
  54. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.errors.d.ts +8 -0
  55. package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.d.ts +2 -7
  56. package/dist/lib/components/ui/media/upload/network-upload-field/use-start-upload.d.ts +7 -3
  57. package/dist/lib/components/ui/media/upload/network-upload-field/use-upload-item-handlers.d.ts +2 -1
  58. package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.d.ts +2 -5
  59. package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.utils.d.ts +26 -1
  60. package/dist/lib/components/ui/media/upload/upload-error.d.ts +33 -0
  61. package/dist/lib/components/ui/selection/autocomplete/autocomplete-enter.d.ts +18 -0
  62. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chip-input.d.ts +2 -1
  63. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-text-input.d.ts +2 -1
  64. package/dist/lib/components/ui/selection/autocomplete/types.d.ts +3 -1
  65. package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
  66. package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
  67. package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
  68. package/dist/lib/components/ui/widgets/education/questions/types.d.ts +10 -0
  69. package/dist/lib/i18n/resources/en/en.d.ts +20 -0
  70. package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
  71. package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
  72. package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
  73. package/dist/lib/i18n/resources/resources.d.ts +40 -0
  74. package/dist/lib/i18n/translator.d.ts +1 -1
  75. package/dist/lib.js +1 -1
  76. package/dist/main.js +42 -42
  77. package/dist/map.js +8 -8
  78. package/dist/material.css +1 -1
  79. package/dist/pdf-reader.js +1 -1
  80. package/dist/print.js +1 -1
  81. package/dist/{public-AXwv1h3v.js → public-BuGgOtAl.js} +9 -9
  82. package/dist/{rich-code-block-qSvkA5rI.js → rich-code-block-DdHqzzek.js} +5 -5
  83. package/dist/{sortable-provider-DPk-RVEU.js → sortable-provider-DMyaSfZZ.js} +2 -2
  84. package/dist/{spinner-PdSk7zEs.js → spinner-ByYdcukU.js} +1 -1
  85. package/dist/theme-picker.js +2 -2
  86. package/dist/{theme-toggle-CZQckLDd.js → theme-toggle-DB3aZZnO.js} +1 -1
  87. package/dist/{toolbar-items-BmNYNaRB.js → toolbar-items-DbzIKjo7.js} +3 -3
  88. package/dist/{translate-material-BlCQ6AW9.js → translate-material-Dh7MYkHT.js} +1 -1
  89. package/dist/{translator-ChpeKCO3.js → translator-Byhohi1S.js} +42 -2
  90. package/dist/{typography-C4JSRr2B.js → typography-rUf0mE5a.js} +1 -1
  91. package/dist/{use-chat-composer-OUa9akfM.js → use-chat-composer-uUUTRB3Z.js} +2401 -2343
  92. package/dist/{use-heading-spy-K-HUp4o_.js → use-heading-spy-CVzW2NM3.js} +4 -4
  93. package/dist/{use-material-translation-DkE9J5NE.js → use-material-translation-BAYyZOcH.js} +1 -1
  94. package/dist/{use-return-focus-KypnR7vv.js → use-return-focus-CQAuk9kh.js} +1 -1
  95. package/docs/components/form-fields.md +196 -3
  96. package/docs/components/media-and-files.md +55 -9
  97. package/docs/components/primitives.md +9 -14
  98. package/docs/components/rich-widgets.md +2 -1
  99. package/docs/components/selection-and-choice.md +10 -3
  100. package/docs/guides/forms.md +4 -3
  101. package/docs/previews/form-fields-choicelistfield.webp +0 -0
  102. package/docs/previews/form-fields-quantityfield.webp +0 -0
  103. package/docs/roadmap.md +5 -2
  104. package/docs/troubleshooting.md +11 -4
  105. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { t } from "./use-material-translation-DkE9J5NE.js";
3
- import { t as n } from "./typography-C4JSRr2B.js";
2
+ import { t } from "./use-material-translation-BAYyZOcH.js";
3
+ import { t as n } from "./typography-rUf0mE5a.js";
4
4
  import { a as r, c as i, i as a, n as o, o as s, r as c, t as l, u } from "./state-scenes-BX03WmSu.js";
5
5
  import { Suspense as d } from "react";
6
6
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as e } from "./field-blur-context-BZtwcPUV.js";
1
+ import { t as e } from "./field-blur-context-XNvCDnMT.js";
2
2
  import { t } from "./useEvent-2fKq-6w8.js";
3
3
  import n, { useCallback as r, useEffect as i, useRef as a } from "react";
4
4
  import { jsx as o } from "react/jsx-runtime";
@@ -731,7 +731,7 @@ var je = (e) => {
731
731
  return t;
732
732
  }, Me = n.createContext(null);
733
733
  Me.displayName = "HookFormContext";
734
- var Ne = () => {
734
+ var Ne = () => n.useContext(Me), Pe = () => {
735
735
  let e = [];
736
736
  return {
737
737
  get observers() {
@@ -748,65 +748,65 @@ var Ne = () => {
748
748
  }
749
749
  };
750
750
  };
751
- function Pe(e, t) {
751
+ function Fe(e, t) {
752
752
  let n = {};
753
753
  for (let r in e) if (e.hasOwnProperty(r)) {
754
754
  let i = e[r], a = t[r];
755
755
  if (i && g(i) && a) {
756
- let e = Pe(i, a);
756
+ let e = Fe(i, a);
757
757
  g(e) && (n[r] = e);
758
758
  } else e[r] && (n[r] = a);
759
759
  }
760
760
  return n;
761
761
  }
762
- var Fe = (e) => e.type === "select-multiple", Ie = (e) => fe(e) || d(e), Le = (e) => de(e) && e.isConnected;
763
- function Re(e) {
762
+ var Ie = (e) => e.type === "select-multiple", Le = (e) => fe(e) || d(e), Re = (e) => de(e) && e.isConnected;
763
+ function ze(e) {
764
764
  return Array.isArray(e) || g(e);
765
765
  }
766
- function ze(e, t, n = "", r = []) {
766
+ function Be(e, t, n = "", r = []) {
767
767
  for (let i in e) {
768
768
  let a = n ? `${n}.${i}` : i, o = e[i];
769
- Re(o) && Re(M(t, a)) ? ze(o, t, a, r) : r.push(a);
769
+ ze(o) && ze(M(t, a)) ? Be(o, t, a, r) : r.push(a);
770
770
  }
771
771
  return r;
772
772
  }
773
- var Be = (e) => {
773
+ var Ve = (e) => {
774
774
  for (let t in e) if (P(e[t])) return !0;
775
775
  return !1;
776
776
  };
777
- function Ve(e) {
778
- return Array.isArray(e) || g(e) && !Be(e);
779
- }
780
777
  function He(e) {
781
- return !!(e && "_f" in e);
778
+ return Array.isArray(e) || g(e) && !Ve(e);
782
779
  }
783
780
  function Ue(e) {
781
+ return !!(e && "_f" in e);
782
+ }
783
+ function We(e) {
784
784
  return Array.isArray(e) ? !e.some((e) => !k(e)) : !Object.keys(e).length;
785
785
  }
786
- function We(e, t) {
786
+ function Ge(e, t) {
787
787
  Array.isArray(e) ? e[t] = void 0 : delete e[t];
788
788
  }
789
- function Ge(e, t = {}, n) {
789
+ function Ke(e, t = {}, n) {
790
790
  for (let r in e) {
791
791
  let i = e[r], a = n && n[r];
792
- Ve(i) && (!Array.isArray(i) || !He(a)) ? (t[r] = Array.isArray(i) ? [] : {}, Ge(i, t[r], a), Ue(t[r]) && We(t, r)) : k(i) || (t[r] = !0);
792
+ He(i) && (!Array.isArray(i) || !Ue(a)) ? (t[r] = Array.isArray(i) ? [] : {}, Ke(i, t[r], a), We(t[r]) && Ge(t, r)) : k(i) || (t[r] = !0);
793
793
  }
794
794
  return t;
795
795
  }
796
796
  function $(e, t, n, r) {
797
- n ||= Ge(t, {}, r);
797
+ n ||= Ke(t, {}, r);
798
798
  for (let i in e) {
799
799
  let a = e[i], o = r && r[i];
800
- Ve(a) && (!Array.isArray(a) || !He(o)) ? (k(t) || R(n[i]) ? n[i] = Ge(a, Array.isArray(a) ? [] : {}, o) : $(a, m(t) ? {} : t[i], n[i], o), Ue(n[i]) && We(n, i)) : B(a, t[i]) ? We(n, i) : n[i] = !0;
800
+ He(a) && (!Array.isArray(a) || !Ue(o)) ? (k(t) || R(n[i]) ? n[i] = Ke(a, Array.isArray(a) ? [] : {}, o) : $(a, m(t) ? {} : t[i], n[i], o), We(n[i]) && Ge(n, i)) : B(a, t[i]) ? Ge(n, i) : n[i] = !0;
801
801
  }
802
802
  return n;
803
803
  }
804
- var Ke = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => k(e) ? e : t ? e === "" ? NaN : e && +e : n && V(e) ? new Date(e) : r ? r(e) : e;
805
- function qe(e) {
804
+ var qe = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => k(e) ? e : t ? e === "" ? NaN : e && +e : n && V(e) ? new Date(e) : r ? r(e) : e;
805
+ function Je(e) {
806
806
  let t = e.ref;
807
- return f(t) ? t.files : fe(t) ? J(e.refs).value : Fe(t) ? [...t.selectedOptions].map(({ value: e }) => e) : d(t) ? q(e.refs).value : Ke(t.value, e);
807
+ return f(t) ? t.files : fe(t) ? J(e.refs).value : Ie(t) ? [...t.selectedOptions].map(({ value: e }) => e) : d(t) ? q(e.refs).value : qe(t.value, e);
808
808
  }
809
- var Je = (e, t, n, r) => {
809
+ var Ye = (e, t, n, r) => {
810
810
  let i = {};
811
811
  for (let n of e) {
812
812
  let e = M(t, n);
@@ -818,15 +818,15 @@ var Je = (e, t, n, r) => {
818
818
  fields: i,
819
819
  shouldUseNativeValidation: r
820
820
  };
821
- }, Ye = (e) => k(e) ? e : pe(e) ? e.source : g(e) ? pe(e.value) ? e.value.source : e.value : e, Xe = "AsyncFunction", Ze = (e) => {
821
+ }, Xe = (e) => k(e) ? e : pe(e) ? e.source : g(e) ? pe(e.value) ? e.value.source : e.value : e, Ze = "AsyncFunction", Qe = (e) => {
822
822
  if (!e || !e.validate) return !1;
823
- if (P(e.validate)) return e.validate.constructor.name === Xe;
823
+ if (P(e.validate)) return e.validate.constructor.name === Ze;
824
824
  if (g(e.validate)) {
825
- for (let t in e.validate) if (e.validate[t].constructor.name === Xe) return !0;
825
+ for (let t in e.validate) if (e.validate[t].constructor.name === Ze) return !0;
826
826
  }
827
827
  return !1;
828
- }, Qe = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
829
- function $e(e, t, n) {
828
+ }, $e = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
829
+ function et(e, t, n) {
830
830
  let r = M(e, n);
831
831
  if (r || O(n)) return {
832
832
  error: r,
@@ -848,21 +848,21 @@ function $e(e, t, n) {
848
848
  }
849
849
  return { name: n };
850
850
  }
851
- var et = (e, t, n, r) => {
851
+ var tt = (e, t, n, r) => {
852
852
  n(e);
853
853
  let i = Object.keys(e).filter((e) => e !== "name");
854
854
  return !i.length || r && i.length >= Object.keys(t).length || i.find((e) => t[e] === (!r || C.all));
855
- }, tt = (e, t, n) => !e || !t || e === t || X(e).some((e) => e && (n ? e === t || e.startsWith(t + ".") : e.startsWith(t) || t.startsWith(e))), nt = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, rt = (e, t) => {
855
+ }, nt = (e, t, n) => !e || !t || e === t || X(e).some((e) => e && (n ? e === t || e.startsWith(t + ".") : e.startsWith(t) || t.startsWith(e))), rt = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, it = (e, t) => {
856
856
  let n = M(e, t);
857
857
  !Ce(n).length && !n?.root && Q(e, t);
858
- }, it = {
858
+ }, at = {
859
859
  mode: C.onSubmit,
860
860
  reValidateMode: C.onChange,
861
861
  shouldFocusError: !0
862
- }, at = "form", ot = (e, t) => {
862
+ }, ot = "form", st = (e, t) => {
863
863
  for (let n in e) n in t || delete e[n];
864
864
  Object.assign(e, t);
865
- }, st = {
865
+ }, ct = {
866
866
  submitCount: 0,
867
867
  isDirty: !1,
868
868
  isReady: !1,
@@ -875,12 +875,12 @@ var et = (e, t, n, r) => {
875
875
  dirtyFields: {},
876
876
  validatingFields: {}
877
877
  };
878
- function ct(e = {}) {
878
+ function lt(e = {}) {
879
879
  let t = {
880
- ...it,
880
+ ...at,
881
881
  ...e
882
882
  }, n = {
883
- ...x(st),
883
+ ...x(ct),
884
884
  isLoading: P(t.defaultValues),
885
885
  errors: t.errors || {},
886
886
  disabled: t.disabled || !1
@@ -906,8 +906,8 @@ function ct(e = {}) {
906
906
  isValid: !1,
907
907
  errors: !1
908
908
  }, D = { ...E }, A = { ...D }, I = {
909
- array: Ne(),
910
- state: Ne()
909
+ array: Pe(),
910
+ state: Pe()
911
911
  }, L = 0, ee = t.criteriaMode === C.all, te = (e, t) => (n) => {
912
912
  clearTimeout(l[e]), l[e] = setTimeout(t, n);
913
913
  }, R = async (e) => {
@@ -940,7 +940,7 @@ function ct(e = {}) {
940
940
  }
941
941
  if (u && Array.isArray(M(n.errors, e))) {
942
942
  let t = M(n.errors, e), r = t.root, i = s(t, c.argA, c.argB) || t;
943
- r && (i.root = r), l && F(n.errors, e, i), rt(n.errors, e);
943
+ r && (i.root = r), l && F(n.errors, e, i), it(n.errors, e);
944
944
  }
945
945
  if ((D.touchedFields || A.touchedFields) && u && Array.isArray(M(n.touchedFields, e))) {
946
946
  let t = s(M(n.touchedFields, e), c.argA, c.argB);
@@ -983,14 +983,14 @@ function ct(e = {}) {
983
983
  if (d) {
984
984
  if (se(t) || H(t)) return;
985
985
  let r = k(M(a, t)), f = M(a, t, k(l) ? M(i, t) : l);
986
- k(f) || u && u.defaultChecked || c ? F(a, t, c ? f : qe(d._f)) : ye(t, f), o.mount && !o.action && (R(), r && n.isDirty && (D.isDirty || A.isDirty) && (J() || (n.isDirty = !1, I.state.next({ ...n }))), e.shouldUnregister && r && !k(M(a, t)) && le(t, s) && (o.watch = !0));
986
+ k(f) || u && u.defaultChecked || c ? F(a, t, c ? f : Je(d._f)) : ye(t, f), o.mount && !o.action && (R(), r && n.isDirty && (D.isDirty || A.isDirty) && (J() || (n.isDirty = !1, I.state.next({ ...n }))), e.shouldUnregister && r && !k(M(a, t)) && le(t, s) && (o.watch = !0));
987
987
  }
988
988
  }, fe = (e, o, s, c, l) => {
989
989
  let u = !1, d = !1, f = { name: e };
990
990
  if (!t.disabled || c === !0) {
991
991
  if (!s || c) {
992
992
  let t = B(M(i, e), o);
993
- (D.isDirty || A.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t || J(), u = d !== f.isDirty), d = !!M(n.dirtyFields, e), t === n.isDirty ? t ? Q(n.dirtyFields, e) : F(n.dirtyFields, e, !0) : ot(n.dirtyFields, $(i, a, void 0, r)), f.dirtyFields = n.dirtyFields, u ||= (D.dirtyFields || A.dirtyFields) && d !== !t;
993
+ (D.isDirty || A.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t || J(), u = d !== f.isDirty), d = !!M(n.dirtyFields, e), t === n.isDirty ? t ? Q(n.dirtyFields, e) : F(n.dirtyFields, e, !0) : st(n.dirtyFields, $(i, a, void 0, r)), f.dirtyFields = n.dirtyFields, u ||= (D.dirtyFields || A.dirtyFields) && d !== !t;
994
994
  }
995
995
  if (s) {
996
996
  let t = M(n.touchedFields, e);
@@ -1013,7 +1013,7 @@ function ct(e = {}) {
1013
1013
  ...t
1014
1014
  }, I.state.next(t);
1015
1015
  }
1016
- }, K = async (e) => (z(e, !0), await t.resolver(a, t.context, Je(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), me = async (e) => {
1016
+ }, K = async (e) => (z(e, !0), await t.resolver(a, t.context, Ye(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), me = async (e) => {
1017
1017
  let { errors: t } = await K(e);
1018
1018
  if (z(e), e) {
1019
1019
  for (let r of e) {
@@ -1033,15 +1033,15 @@ function ct(e = {}) {
1033
1033
  });
1034
1034
  if (g(i)) for (let e in i) {
1035
1035
  let t = i[e];
1036
- t && Ae(`${at}.${e}`, {
1036
+ t && Ae(`${ot}.${e}`, {
1037
1037
  message: V(t.message) ? t.message : "",
1038
1038
  type: t.type || w.validate
1039
1039
  });
1040
1040
  }
1041
- else V(i) || !i ? Ae(at, {
1041
+ else V(i) || !i ? Ae(ot, {
1042
1042
  message: i || "",
1043
1043
  type: w.validate
1044
- }) : ke(at);
1044
+ }) : ke(ot);
1045
1045
  return i;
1046
1046
  }
1047
1047
  return !0;
@@ -1058,7 +1058,7 @@ function ct(e = {}) {
1058
1058
  if (u) {
1059
1059
  let { _f: r, ...d } = u;
1060
1060
  if (r) {
1061
- let o = s.array.has(r.name), c = u._f && Ze(u._f), d = D.validatingFields || D.isValidating || A.validatingFields || A.isValidating;
1061
+ let o = s.array.has(r.name), c = u._f && Qe(u._f), d = D.validatingFields || D.isValidating || A.validatingFields || A.isValidating;
1062
1062
  c && d && z([r.name], !0);
1063
1063
  let f = await ve(u, s.disabled, a, ee, t.shouldUseNativeValidation && !i, o);
1064
1064
  if (c && d && z([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (M(f, r.name) ? o ? ue(n.errors, f, r.name) : F(n.errors, r.name, f[r.name]) : Q(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
@@ -1076,14 +1076,14 @@ function ct(e = {}) {
1076
1076
  }, ge = () => {
1077
1077
  for (let e of s.unMount) {
1078
1078
  let t = M(r, e);
1079
- t && (t._f.refs ? t._f.refs.every((e) => !Le(e)) : !Le(t._f.ref)) && Ve(e);
1079
+ t && (t._f.refs ? t._f.refs.every((e) => !Re(e)) : !Re(t._f.ref)) && Ve(e);
1080
1080
  }
1081
1081
  s.unMount = /* @__PURE__ */ new Set();
1082
1082
  }, J = (e, t) => (e && t && F(a, e, t), !B(o.mount ? a : i, i)), _e = (e, t, n) => ie(e, s, { ...o.mount ? a : k(t) || V(e) ? i : t }, n, t), Y = (e) => Ce(M(o.mount ? a : i, e, t.shouldUnregister ? M(i, e, []) : [])), ye = (e, t, n = {}, i = !1, o = !1, s = !1) => {
1083
1083
  let c = M(r, e), l = t;
1084
1084
  if (c) {
1085
1085
  let n = c._f;
1086
- n && (!n.disabled && F(a, e, Ke(t, n)), l = de(n.ref) && m(t) ? "" : t, Fe(n.ref) ? [...n.ref.options].forEach((e) => e.selected = l.includes(e.value)) : n.refs ? d(n.ref) ? n.refs.forEach((e) => {
1086
+ n && (!n.disabled && F(a, e, qe(t, n)), l = de(n.ref) && m(t) ? "" : t, Ie(n.ref) ? [...n.ref.options].forEach((e) => e.selected = l.includes(e.value)) : n.refs ? d(n.ref) ? n.refs.forEach((e) => {
1087
1087
  (!e.defaultChecked || !e.disabled) && (Array.isArray(l) ? e.checked = !!l.find((t) => t === e.value) : e.checked = l === e.value || !!l);
1088
1088
  }) : n.refs.forEach((e) => e.checked = e.value === l) : f(n.ref) ? n.ref.value = "" : (n.ref.value = l, !n.ref.type && !o && !s && I.state.next({
1089
1089
  name: e,
@@ -1145,7 +1145,7 @@ function ct(e = {}) {
1145
1145
  f = Number.isNaN(e) || p(e) && isNaN(e.getTime()) || B(e, M(a, d, e));
1146
1146
  };
1147
1147
  if (m) {
1148
- let o, p, v = l.type ? qe(m._f) : _(i), b = i.type === S.BLUR || i.type === S.FOCUS_OUT, C = !Qe(m._f) && !e.validate && !t.resolver && !M(n.errors, d) && !m._f.deps, w = C || nt(b, M(n.touchedFields, d), n.isSubmitted, y, h), T = le(d, s, b);
1148
+ let o, p, v = l.type ? Je(m._f) : _(i), b = i.type === S.BLUR || i.type === S.FOCUS_OUT, C = !$e(m._f) && !e.validate && !t.resolver && !M(n.errors, d) && !m._f.deps, w = C || rt(b, M(n.touchedFields, d), n.isSubmitted, y, h), T = le(d, s, b);
1149
1149
  if (F(a, d, v), b) {
1150
1150
  if (!l || !l.readOnly) {
1151
1151
  m._f.onBlur && m._f.onBlur(i);
@@ -1171,7 +1171,7 @@ function ct(e = {}) {
1171
1171
  !G(E) && I.state.next(E);
1172
1172
  return;
1173
1173
  }
1174
- let t = $e(n.errors, r, d), i = $e(e, r, t.name || d);
1174
+ let t = et(n.errors, r, d), i = et(e, r, t.name || d);
1175
1175
  o = i.error, d = i.name, p = G(e);
1176
1176
  } else z([d], !0), o = (await ve(m, s.disabled, a, ee, t.shouldUseNativeValidation))[d], z([d]), g(v), f && (o ? p = !1 : (D.isValid || A.isValid) && (p = await q({
1177
1177
  fields: r,
@@ -1210,7 +1210,7 @@ function ct(e = {}) {
1210
1210
  }), i.shouldFocus && !o && W(r, Te, e ? u : s.mount), o;
1211
1211
  }, De = (e, t) => {
1212
1212
  let r = { ...o.mount ? a : i };
1213
- return t && (r = Pe(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), k(e) ? r : V(e) ? M(r, e) : e.map((e) => M(r, e));
1213
+ return t && (r = Fe(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), k(e) ? r : V(e) ? M(r, e) : e.map((e) => M(r, e));
1214
1214
  }, Oe = (e, t) => ({
1215
1215
  invalid: !!M((t || n).errors, e),
1216
1216
  isDirty: !!M((t || n).dirtyFields, e),
@@ -1245,11 +1245,11 @@ function ct(e = {}) {
1245
1245
  } };
1246
1246
  }
1247
1247
  return _e(e, t, !0);
1248
- }, Re = (e) => {
1248
+ }, Ne = (e) => {
1249
1249
  let t = !!e.formState?.values;
1250
1250
  t && u++;
1251
1251
  let { unsubscribe: r } = I.state.subscribe({ next: (t) => {
1252
- if (tt(e.name, t.name, e.exact) && et(t, e.formState || D, ft, e.reRenderRoot)) {
1252
+ if (nt(e.name, t.name, e.exact) && tt(t, e.formState || D, ft, e.reRenderRoot)) {
1253
1253
  let r = { ...a };
1254
1254
  e.callback({
1255
1255
  values: r,
@@ -1264,10 +1264,10 @@ function ct(e = {}) {
1264
1264
  return () => {
1265
1265
  o || (o = !0, u--, r());
1266
1266
  };
1267
- }, Be = (e) => (o.mount = !0, A = {
1267
+ }, ze = (e) => (o.mount = !0, A = {
1268
1268
  ...A,
1269
1269
  ...e.formState
1270
- }, Re({
1270
+ }, Ne({
1271
1271
  ...e,
1272
1272
  formState: {
1273
1273
  ...E,
@@ -1301,11 +1301,11 @@ function ct(e = {}) {
1301
1301
  ...c ? { disabled: n.disabled || t.disabled } : {},
1302
1302
  ...t.progressive ? {
1303
1303
  required: !!n.required,
1304
- min: Ye(n.min),
1305
- max: Ye(n.max),
1306
- minLength: Ye(n.minLength),
1307
- maxLength: Ye(n.maxLength),
1308
- pattern: Ye(n.pattern)
1304
+ min: Xe(n.min),
1305
+ max: Xe(n.max),
1306
+ minLength: Xe(n.minLength),
1307
+ maxLength: Xe(n.maxLength),
1308
+ pattern: Xe(n.pattern)
1309
1309
  } : {},
1310
1310
  name: e,
1311
1311
  onChange: we,
@@ -1313,11 +1313,11 @@ function ct(e = {}) {
1313
1313
  ref: (c) => {
1314
1314
  if (c) {
1315
1315
  s.registerName.add(e), Ue(e, n), s.registerName.delete(e), a = M(r, e);
1316
- let t = k(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = Ie(t), l = a._f.refs || [];
1316
+ let t = k(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = Le(t), l = a._f.refs || [];
1317
1317
  if (o ? l.find((e) => e === t) : t === a._f.ref) return;
1318
1318
  let u = { ...a._f };
1319
1319
  o ? (u.refs = [
1320
- ...l.filter(Le),
1320
+ ...l.filter(Re),
1321
1321
  t,
1322
1322
  ...Array.isArray(M(i, e)) ? [{}] : []
1323
1323
  ], u.ref = {
@@ -1334,7 +1334,7 @@ function ct(e = {}) {
1334
1334
  t.disabled = i._f.disabled || e;
1335
1335
  }));
1336
1336
  }, 0, !1));
1337
- }, Xe = (e, i) => async (o) => {
1337
+ }, Ke = (e, i) => async (o) => {
1338
1338
  let c, l;
1339
1339
  o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
1340
1340
  let u = x(a);
@@ -1362,13 +1362,13 @@ function ct(e = {}) {
1362
1362
  errors: n.errors
1363
1363
  }), l) throw l;
1364
1364
  return c;
1365
- }, ct = (e, t = {}) => {
1365
+ }, Ze = (e, t = {}) => {
1366
1366
  M(r, e) && (k(t.defaultValue) ? Z(e, x(M(i, e))) : (Z(e, t.defaultValue), F(i, e, x(t.defaultValue))), t.keepTouched || Q(n.touchedFields, e), t.keepDirty || (Q(n.dirtyFields, e), n.isDirty = t.defaultValue ? J(e, x(M(i, e))) : J()), t.keepError || (Q(n.errors, e), D.isValid && R()), I.state.next({ ...n }));
1367
1367
  }, lt = (e, c = {}) => {
1368
1368
  let l = e ? x(e) : i, u = x(l), d = G(e), f = u, p = r;
1369
1369
  if (c.keepDefaultValues || (i = l), !c.keepValues) {
1370
1370
  if (c.keepDirtyValues) {
1371
- let e = /* @__PURE__ */ new Set([...s.mount, ...ze($(i, a, void 0, p), n.dirtyFields)]);
1371
+ let e = /* @__PURE__ */ new Set([...s.mount, ...Be($(i, a, void 0, p), n.dirtyFields)]);
1372
1372
  for (let t of Array.from(e)) {
1373
1373
  let e = M(n.dirtyFields, t), r = M(a, t), i = M(f, t);
1374
1374
  e && !k(r) ? F(f, t, r) : !e && !k(i) && Z(t, i);
@@ -1443,9 +1443,9 @@ function ct(e = {}) {
1443
1443
  register: Ue,
1444
1444
  unregister: Ve,
1445
1445
  getFieldState: Oe,
1446
- handleSubmit: Xe,
1446
+ handleSubmit: Ke,
1447
1447
  setError: Ae,
1448
- _subscribe: Re,
1448
+ _subscribe: Ne,
1449
1449
  _runSchema: K,
1450
1450
  _updateIsValidating: z,
1451
1451
  _focusError: We,
@@ -1498,16 +1498,16 @@ function ct(e = {}) {
1498
1498
  }, h = U(t.mode), y = U(t.reValidateMode);
1499
1499
  }
1500
1500
  },
1501
- subscribe: Be,
1501
+ subscribe: ze,
1502
1502
  trigger: Ee,
1503
1503
  register: Ue,
1504
- handleSubmit: Xe,
1504
+ handleSubmit: Ke,
1505
1505
  watch: Me,
1506
1506
  setValue: Z,
1507
1507
  setValues: Se,
1508
1508
  getValues: De,
1509
1509
  reset: ut,
1510
- resetField: ct,
1510
+ resetField: Ze,
1511
1511
  resetDefaultValues: (e, t = {}) => {
1512
1512
  if (i = x(e), !t.keepDirty) {
1513
1513
  let e = $(i, a, void 0, r);
@@ -1529,9 +1529,9 @@ function ct(e = {}) {
1529
1529
  formControl: pt
1530
1530
  };
1531
1531
  }
1532
- function lt(e = {}) {
1532
+ function ut(e = {}) {
1533
1533
  let t = n.useRef(void 0), r = n.useRef(void 0), i = n.useRef(e.formControl), [a, o] = n.useState(() => ({
1534
- ...x(st),
1534
+ ...x(ct),
1535
1535
  isLoading: P(e.defaultValues),
1536
1536
  errors: e.errors || {},
1537
1537
  disabled: e.disabled || !1,
@@ -1542,7 +1542,7 @@ function lt(e = {}) {
1542
1542
  formState: a
1543
1543
  }, e.defaultValues && !P(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
1544
1544
  else {
1545
- let { formControl: n, ...r } = ct(e);
1545
+ let { formControl: n, ...r } = lt(e);
1546
1546
  t.current = {
1547
1547
  ...r,
1548
1548
  formState: a
@@ -1601,11 +1601,11 @@ function lt(e = {}) {
1601
1601
  }
1602
1602
  //#endregion
1603
1603
  //#region lib/components/ui/forms/use-field-blur.ts
1604
- var ut = typeof document > "u" ? null : document, dt = {
1604
+ var dt = typeof document > "u" ? null : document, ft = {
1605
1605
  capture: !0,
1606
1606
  passive: !0
1607
1607
  };
1608
- function ft(e, t) {
1608
+ function pt(e, t) {
1609
1609
  for (let t of e.roots) t.isConnected || e.roots.delete(t);
1610
1610
  let n = [...e.roots];
1611
1611
  if (!n.length) return !1;
@@ -1617,7 +1617,7 @@ function ft(e, t) {
1617
1617
  let i = l(n, e, r);
1618
1618
  return i === "theirs" || !i && e.before.has(r) ? !0 : (e.opened.add(r), !1);
1619
1619
  }
1620
- function pt(e, n) {
1620
+ function mt(e, n) {
1621
1621
  let o = u(n), c = u(e), l = a({
1622
1622
  roots: /* @__PURE__ */ new Set(),
1623
1623
  inside: !1,
@@ -1632,24 +1632,24 @@ function pt(e, n) {
1632
1632
  l.inside = !1, c.current();
1633
1633
  }, [l, c]), p = r((e) => {
1634
1634
  let t = e.target;
1635
- t instanceof Node && (clearTimeout(l.settle), ft(l, t) && f());
1635
+ t instanceof Node && (clearTimeout(l.settle), pt(l, t) && f());
1636
1636
  }, [l, f]), m = r((e) => {
1637
1637
  !l.inside || e.relatedTarget || (clearTimeout(l.settle), l.settle = setTimeout(() => {
1638
1638
  l.settle = setTimeout(() => {
1639
- let e = ut?.activeElement;
1640
- l.inside && (!e || e === ut?.body) && f();
1639
+ let e = dt?.activeElement;
1640
+ l.inside && (!e || e === dt?.body) && f();
1641
1641
  });
1642
1642
  }));
1643
1643
  }, [l, f]);
1644
- return t("focusin", p, ut, dt), t("focusout", m, ut, dt), i(() => () => clearTimeout(l.settle), [l]), d;
1644
+ return t("focusin", p, dt, ft), t("focusout", m, dt, ft), i(() => () => clearTimeout(l.settle), [l]), d;
1645
1645
  }
1646
1646
  //#endregion
1647
1647
  //#region lib/components/ui/forms/field-blur.tsx
1648
- function mt({ onBlur: t, focusRef: n, children: r }) {
1648
+ function ht({ onBlur: t, focusRef: n, children: r }) {
1649
1649
  return /* @__PURE__ */ o(e, {
1650
- value: pt(t, n),
1650
+ value: mt(t, n),
1651
1651
  children: r
1652
1652
  });
1653
1653
  }
1654
1654
  //#endregion
1655
- export { M as a, Ae as c, ae as d, u as f, K as i, lt as l, pt as n, F as o, se as r, oe as s, mt as t, re as u };
1655
+ export { M as a, Ae as c, re as d, ae as f, K as i, ut as l, mt as n, F as o, u as p, se as r, oe as s, ht as t, Ne as u };
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { l as t } from "./dist-lmHmz_bu.js";
3
- import { t as n } from "./typography-C4JSRr2B.js";
3
+ import { t as n } from "./typography-rUf0mE5a.js";
4
4
  import * as r from "react";
5
5
  import { createContext as i, use as a, useMemo as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
- import { i as e } from "./translate-material-BlCQ6AW9.js";
1
+ import { i as e } from "./translate-material-Dh7MYkHT.js";
2
2
  import { t } from "./number.utils-BG_eEt5g.js";
3
- import { n } from "./use-heading-spy-K-HUp4o_.js";
3
+ import { n } from "./use-heading-spy-CVzW2NM3.js";
4
4
  import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
5
5
  import { jsx as c } from "react/jsx-runtime";
6
6
  import { useBlocker as l, useNavigate as u, useSearchParams as d } from "react-router";
package/dist/hooks.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as e, i as t, o as n, r, s as i } from "./theme-store-BdPp43cV.js";
2
2
  import { n as a, t as o } from "./use-theme-BCLireTd.js";
3
- import { a as s, c, d as l, o as u, r as d, s as f, t as p } from "./use-heading-spy-K-HUp4o_.js";
3
+ import { a as s, c, d as l, o as u, r as d, s as f, t as p } from "./use-heading-spy-CVzW2NM3.js";
4
4
  import { r as m } from "./use-csp-nonce-ZKs9k-ov.js";
5
5
  import { t as h } from "./use-mobile-BDro060N.js";
6
6
  import { t as g } from "./use-scroll-away-PQRFZkT2.js";
7
- import { a as _, c as v, d as y, f as b, g as x, h as S, i as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M } from "./hooks-DjuYsY-j.js";
7
+ import { a as _, c as v, d as y, f as b, g as x, h as S, i as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M } from "./hooks-BU21Jpaa.js";
8
8
  export { r as DEFAULT_THEME, t as applyResolvedTheme, e as applyThemeName, _ as buildOptions, s as busySettler, b as clearDrafts, u as createSubmitGuard, D as extractNode, S as isLeaving, n as resolveTheme, i as resolveThemeName, x as shouldBlockNavigation, T as useAllowedTransitions, d as useCountdown, m as useCspNonce, E as useDiscardGuard, O as useDrafts, c as useFocusOnMount, y as useFormatters, p as useHeadingSpy, a as useIsClient, h as useIsMobile, l as useLocalizedDate, w as useNavigationHandler, M as useNavigationHandlers, v as useNumberFormatter, A as useOptions, C as useReactRouterBlock, g as useScrollAway, k as useSearchParam, f as useSubmitOnce, o as useTheme, j as useUnsavedGuard };
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { o as t } from "./dist-DVRQkaTK.js";
3
3
  import { a as n, c as r, i, l as a, s as o } from "./dist-lmHmz_bu.js";
4
- import { C as s, S as c, f as l, m as u, p as d, u as f } from "./spinner-PdSk7zEs.js";
4
+ import { C as s, S as c, f as l, m as u, p as d, u as f } from "./spinner-ByYdcukU.js";
5
5
  import { t as p } from "./in-dialog-Vwkyp-M5.js";
6
6
  import { i as m } from "./escape-owner-DpaP0lm1.js";
7
7
  import * as h from "react";
package/dist/i18n.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./is-production-GLw59WU8.js";
2
- import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-ChpeKCO3.js";
3
- import { i as u, n as d, r as f, t as p } from "./translate-material-BlCQ6AW9.js";
2
+ import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-Byhohi1S.js";
3
+ import { i as u, n as d, r as f, t as p } from "./translate-material-Dh7MYkHT.js";
4
4
  import { o as m, t as h } from "./merge-BCZE6HGq.js";
5
- import { t as g } from "./use-material-translation-DkE9J5NE.js";
5
+ import { t as g } from "./use-material-translation-BAYyZOcH.js";
6
6
  import { useCallback as _ } from "react";
7
7
  //#region lib/i18n/merge-resources.ts
8
8
  function v(e, t, n = "") {
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
- import { a as t, i as n, n as r } from "./field-blur-context-BZtwcPUV.js";
3
- import { t as i } from "./icon-button-Co6ttdv1.js";
4
- import { f as a } from "./dialog-Co5oksU1.js";
2
+ import { a as t, i as n, n as r } from "./field-blur-context-XNvCDnMT.js";
3
+ import { t as i } from "./icon-button-QwIeBTdw.js";
4
+ import { f as a } from "./dialog-B3BSdRci.js";
5
5
  import { isValidElement as o, useId as s } from "react";
6
6
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
7
  import { describedBy as u } from "@nxgt/material-core/described-by";
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./utils-BLfntITJ.js";
2
2
  import { n as t } from "./use-shape-morph-BKA_R5P5.js";
3
3
  import { n, t as r } from "./dist-DVRQkaTK.js";
4
- import { n as i, r as a, t as o } from "./spinner-PdSk7zEs.js";
4
+ import { n as i, r as a, t as o } from "./spinner-ByYdcukU.js";
5
5
  import { a as s, i as c, n as l, o as u, r as d, s as f, t as p } from "./use-click-lock-BZYtTmVt.js";
6
6
  import { t as m } from "./is-production-GLw59WU8.js";
7
7
  import { t as h } from "./button-group-context-CaP0X5p_.js";
@@ -4879,7 +4879,7 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
4879
4879
  onRemove?: ((value: string) => void | Promise<void>) | undefined;
4880
4880
  maxFiles?: number | undefined;
4881
4881
  resolveUrl?: ((value: string) => string | null | undefined) | undefined;
4882
- onUpload: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
4882
+ onUpload: (file: File, onProgress?: (percent: number) => void, signal?: AbortSignal) => Promise<string>;
4883
4883
  accept?: string;
4884
4884
  description?: import('react').ReactNode;
4885
4885
  buttonText?: import('react').ReactNode;
@@ -5213,7 +5213,7 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
5213
5213
  accept?: string;
5214
5214
  maxSize?: number;
5215
5215
  maxFiles?: number;
5216
- onUpload: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
5216
+ onUpload: (file: File, onProgress?: (percent: number) => void, signal?: AbortSignal) => Promise<string>;
5217
5217
  onRemove?: (value: string) => void | Promise<void>;
5218
5218
  onError?: (((file: File, error: unknown) => void) & import('react').ReactEventHandler<HTMLDivElement>) | undefined;
5219
5219
  resolveUrl?: (value: string) => string | null | undefined;
@@ -5510,7 +5510,7 @@ export declare function useFilterFieldConfig({ field, value, onChange, error, di
5510
5510
  accept?: string;
5511
5511
  maxSize?: number;
5512
5512
  maxFiles?: number;
5513
- onUpload: (file: File, onProgress?: (percent: number) => void) => Promise<string>;
5513
+ onUpload: (file: File, onProgress?: (percent: number) => void, signal?: AbortSignal) => Promise<string>;
5514
5514
  onRemove?: (value: string) => void | Promise<void>;
5515
5515
  onError?: (((file: File, error: unknown) => void) & import('react').ReactEventHandler<HTMLDivElement>) | undefined;
5516
5516
  resolveUrl?: (value: string) => string | null | undefined;
@@ -0,0 +1,13 @@
1
+ import { ChoiceListFieldProps } from './types.js';
2
+ export type { ChoiceListFieldProps } from './types.js';
3
+ /**
4
+ * An editable list of answer choices: rows of text, each with a "correct"
5
+ * mark. `selection="single"` marks one row, as radios of one radiogroup;
6
+ * `multiple` allows several, as checkboxes. It is a `RepeatableGroup`:
7
+ * Add, Remove and move buttons per row, `min` and `max` rows, focus that
8
+ * follows each change, polite announcements. Every row keeps its `id`
9
+ * across edits and moves; rows whose id is missing or repeated are given a
10
+ * new one, with one call of `onAssignIds` (default: `onChange`) on mount.
11
+ * `ChoiceListFormField` wires it to react-hook-form.
12
+ */
13
+ export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { FieldValues, UseControllerProps } from 'react-hook-form';
2
+ import { ChoiceListFieldProps } from './types.js';
3
+ export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'onBlur'> & {
4
+ /**
5
+ * The built-in rules ask for one marked row at least. `false` lets a list
6
+ * with none pass (a poll). Default true.
7
+ */
8
+ requireCorrect?: boolean;
9
+ };
10
+ /**
11
+ * A `ChoiceListField` over react-hook-form: the value is an array of
12
+ * `{ id, text, correct }`. Without a resolver it validates by itself: fewer
13
+ * than `min` rows, several rows marked in `single`, no row marked (unless
14
+ * `requireCorrect` is false), or a blank row put an error under the list,
15
+ * and blank rows say so. With a resolver (zod), its issues show the same
16
+ * way: `choices.2.text` under row 3, `choices` under the list. Ids given on
17
+ * mount do not make the form dirty when a `FormProvider` is above.
18
+ */
19
+ export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { useMaterialTranslation } from '../../../../i18n/use-material-translation.js';
2
+ import { ChoiceListIssue } from './choice-list.utils.js';
3
+ type Translate = ReturnType<typeof useMaterialTranslation>['t'];
4
+ /** What a row is called by default ("answer"). */
5
+ export declare const defaultRowLabel: (t: Translate) => string;
6
+ /** A row's text field label: "Answer 2". */
7
+ export declare const textLabel: (label: string, position: number) => string;
8
+ /** The visible word beside the mark. */
9
+ export declare const correctText: (t: Translate) => string;
10
+ /** The mark's accessible name, which starts with its visible word. */
11
+ export declare const correctName: (t: Translate, label: string, position: number) => string;
12
+ /** The message of an issue of the list, naming a row `label`. */
13
+ export declare function issueMessage(t: Translate, issue: ChoiceListIssue, options: {
14
+ min?: number;
15
+ selection: 'single' | 'multiple';
16
+ label: string;
17
+ }): string;
18
+ export declare const textRequired: (t: Translate, label: string) => string;
19
+ export {};