@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.
- package/CHANGELOG.md +38 -0
- package/README.md +6 -4
- package/dist/{alert-dialog-BgQDxcYh.js → alert-dialog-CBkWG32g.js} +1 -1
- package/dist/{async-slice-BCZyWgGr.js → async-slice-CNZ3N55P.js} +1 -1
- package/dist/{button-2de_lrix.js → button-D3qzqDY_.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-Cs0uEjpu.js → chip-CMTe4sQd.js} +2 -2
- package/dist/{code-editor-BYhBAfcc.js → code-editor-Cs7mz1J-.js} +5 -5
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-xhmbF6wA.js → code-language-items-D_QMgjVy.js} +2 -2
- package/dist/{components-BRWaX4Xk.js → components-BbWcozcj.js} +18104 -17600
- package/dist/components.js +28 -28
- package/dist/{dialog-Co5oksU1.js → dialog-B3BSdRci.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-DdzyvN76.js → dropdown-menu-BaupOWgS.js} +1 -1
- package/dist/editor.js +661 -661
- package/dist/{empty-state-CQ0CV0kA.js → empty-state-B2Um5UpI.js} +2 -2
- package/dist/{field-blur-B2y-bNYi.js → field-blur-1XLyxRPr.js} +82 -82
- package/dist/{field-blur-context-BZtwcPUV.js → field-blur-context-XNvCDnMT.js} +1 -1
- package/dist/{hooks-DjuYsY-j.js → hooks-BU21Jpaa.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-BeBVy6tB.js → hover-card-Bvm3svX9.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-DbYsbzwZ.js → icon-badge-wip9bfa2.js} +3 -3
- package/dist/{icon-button-Co6ttdv1.js → icon-button-QwIeBTdw.js} +1 -1
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +3 -3
- package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +13 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +19 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +19 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +27 -0
- package/dist/lib/components/ui/fields/choice-list/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/choice-list/partials/choice-mark.d.ts +18 -0
- package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +19 -0
- package/dist/lib/components/ui/fields/choice-list/types.d.ts +44 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/country-field/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/country-field/iso-countries.d.ts +2 -0
- package/dist/lib/components/ui/fields/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/phone-field/index.d.ts +1 -1
- package/dist/lib/components/ui/fields/phone-field/parse-phone.d.ts +2 -0
- package/dist/lib/components/ui/fields/phone-field/phone-field.d.ts +8 -1
- package/dist/lib/components/ui/fields/phone-field/phone-form-field.d.ts +8 -1
- package/dist/lib/components/ui/fields/phone-field/use-phone-value.d.ts +2 -1
- package/dist/lib/components/ui/fields/postal-address/utils.d.ts +15 -0
- package/dist/lib/components/ui/fields/quantity-field/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-form-field.d.ts +8 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-row.d.ts +13 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-unit.d.ts +12 -0
- package/dist/lib/components/ui/fields/quantity-field/quantity-value.d.ts +9 -0
- package/dist/lib/components/ui/fields/quantity-field/types.d.ts +45 -0
- package/dist/lib/components/ui/media/upload/index.d.ts +1 -0
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.d.ts +6 -1
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.errors.d.ts +8 -0
- package/dist/lib/components/ui/media/upload/network-upload-field/network-upload-field.utils.d.ts +2 -7
- package/dist/lib/components/ui/media/upload/network-upload-field/use-start-upload.d.ts +7 -3
- package/dist/lib/components/ui/media/upload/network-upload-field/use-upload-item-handlers.d.ts +2 -1
- package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.d.ts +2 -5
- package/dist/lib/components/ui/media/upload/s3-upload-field/s3-upload-field.utils.d.ts +26 -1
- package/dist/lib/components/ui/media/upload/upload-error.d.ts +33 -0
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-enter.d.ts +18 -0
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chip-input.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-text-input.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/types.d.ts +3 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +10 -0
- package/dist/lib/i18n/resources/en/en.d.ts +20 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/resources.d.ts +40 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +42 -42
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -1
- package/dist/{public-AXwv1h3v.js → public-BuGgOtAl.js} +9 -9
- package/dist/{rich-code-block-qSvkA5rI.js → rich-code-block-DdHqzzek.js} +5 -5
- package/dist/{sortable-provider-DPk-RVEU.js → sortable-provider-DMyaSfZZ.js} +2 -2
- package/dist/{spinner-PdSk7zEs.js → spinner-ByYdcukU.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-CZQckLDd.js → theme-toggle-DB3aZZnO.js} +1 -1
- package/dist/{toolbar-items-BmNYNaRB.js → toolbar-items-DbzIKjo7.js} +3 -3
- package/dist/{translate-material-BlCQ6AW9.js → translate-material-Dh7MYkHT.js} +1 -1
- package/dist/{translator-ChpeKCO3.js → translator-Byhohi1S.js} +42 -2
- package/dist/{typography-C4JSRr2B.js → typography-rUf0mE5a.js} +1 -1
- package/dist/{use-chat-composer-OUa9akfM.js → use-chat-composer-uUUTRB3Z.js} +2401 -2343
- package/dist/{use-heading-spy-K-HUp4o_.js → use-heading-spy-CVzW2NM3.js} +4 -4
- package/dist/{use-material-translation-DkE9J5NE.js → use-material-translation-BAYyZOcH.js} +1 -1
- package/dist/{use-return-focus-KypnR7vv.js → use-return-focus-CQAuk9kh.js} +1 -1
- package/docs/components/form-fields.md +196 -3
- package/docs/components/media-and-files.md +55 -9
- package/docs/components/primitives.md +9 -14
- package/docs/components/rich-widgets.md +2 -1
- package/docs/components/selection-and-choice.md +10 -3
- package/docs/guides/forms.md +4 -3
- package/docs/previews/form-fields-choicelistfield.webp +0 -0
- package/docs/previews/form-fields-quantityfield.webp +0 -0
- package/docs/roadmap.md +5 -2
- package/docs/troubleshooting.md +11 -4
- 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-
|
|
3
|
-
import { t as n } from "./typography-
|
|
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-
|
|
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
|
|
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 =
|
|
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
|
|
763
|
-
function
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
786
|
+
function Ge(e, t) {
|
|
787
787
|
Array.isArray(e) ? e[t] = void 0 : delete e[t];
|
|
788
788
|
}
|
|
789
|
-
function
|
|
789
|
+
function Ke(e, t = {}, n) {
|
|
790
790
|
for (let r in e) {
|
|
791
791
|
let i = e[r], a = n && n[r];
|
|
792
|
-
|
|
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 ||=
|
|
797
|
+
n ||= Ke(t, {}, r);
|
|
798
798
|
for (let i in e) {
|
|
799
799
|
let a = e[i], o = r && r[i];
|
|
800
|
-
|
|
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
|
|
805
|
-
function
|
|
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 :
|
|
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
|
|
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
|
-
},
|
|
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 ===
|
|
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 ===
|
|
825
|
+
for (let t in e.validate) if (e.validate[t].constructor.name === Ze) return !0;
|
|
826
826
|
}
|
|
827
827
|
return !1;
|
|
828
|
-
},
|
|
829
|
-
function
|
|
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
|
|
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
|
-
},
|
|
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
|
-
},
|
|
858
|
+
}, at = {
|
|
859
859
|
mode: C.onSubmit,
|
|
860
860
|
reValidateMode: C.onChange,
|
|
861
861
|
shouldFocusError: !0
|
|
862
|
-
},
|
|
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
|
-
},
|
|
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
|
|
878
|
+
function lt(e = {}) {
|
|
879
879
|
let t = {
|
|
880
|
-
...
|
|
880
|
+
...at,
|
|
881
881
|
...e
|
|
882
882
|
}, n = {
|
|
883
|
-
...x(
|
|
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:
|
|
910
|
-
state:
|
|
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),
|
|
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 :
|
|
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) :
|
|
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,
|
|
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(`${
|
|
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(
|
|
1041
|
+
else V(i) || !i ? Ae(ot, {
|
|
1042
1042
|
message: i || "",
|
|
1043
1043
|
type: w.validate
|
|
1044
|
-
}) : ke(
|
|
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 &&
|
|
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) => !
|
|
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,
|
|
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 ?
|
|
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 =
|
|
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 =
|
|
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
|
-
},
|
|
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 (
|
|
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
|
-
},
|
|
1267
|
+
}, ze = (e) => (o.mount = !0, A = {
|
|
1268
1268
|
...A,
|
|
1269
1269
|
...e.formState
|
|
1270
|
-
},
|
|
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:
|
|
1305
|
-
max:
|
|
1306
|
-
minLength:
|
|
1307
|
-
maxLength:
|
|
1308
|
-
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 =
|
|
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(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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, ...
|
|
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:
|
|
1446
|
+
handleSubmit: Ke,
|
|
1447
1447
|
setError: Ae,
|
|
1448
|
-
_subscribe:
|
|
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:
|
|
1501
|
+
subscribe: ze,
|
|
1502
1502
|
trigger: Ee,
|
|
1503
1503
|
register: Ue,
|
|
1504
|
-
handleSubmit:
|
|
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:
|
|
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
|
|
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(
|
|
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 } =
|
|
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
|
|
1604
|
+
var dt = typeof document > "u" ? null : document, ft = {
|
|
1605
1605
|
capture: !0,
|
|
1606
1606
|
passive: !0
|
|
1607
1607
|
};
|
|
1608
|
-
function
|
|
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
|
|
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),
|
|
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 =
|
|
1640
|
-
l.inside && (!e || e ===
|
|
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,
|
|
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
|
|
1648
|
+
function ht({ onBlur: t, focusRef: n, children: r }) {
|
|
1649
1649
|
return /* @__PURE__ */ o(e, {
|
|
1650
|
-
value:
|
|
1650
|
+
value: mt(t, n),
|
|
1651
1651
|
children: r
|
|
1652
1652
|
});
|
|
1653
1653
|
}
|
|
1654
1654
|
//#endregion
|
|
1655
|
-
export { M as a, Ae as c,
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
-
import { i as u, n as d, r as f, t as p } from "./translate-material-
|
|
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-
|
|
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-
|
|
3
|
-
import { t as i } from "./icon-button-
|
|
4
|
-
import { f as a } from "./dialog-
|
|
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-
|
|
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 {};
|