@ttoss/forms 0.26.3 → 0.26.5
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/dist/esm/Brazil/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { FormField, FormFieldCNPJ, FormFieldPatternFormat, isCnpjValid } from "../chunk-
|
|
2
|
+
import { FormField, FormFieldCNPJ, FormFieldPatternFormat, isCnpjValid } from "../chunk-VFAUAKN6.js";
|
|
3
3
|
|
|
4
4
|
// src/Brazil/FormFieldPhone.tsx
|
|
5
5
|
import { Input } from "@ttoss/ui";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { Form,
|
|
2
|
+
import { Form, useForm, yupResolver } from "../chunk-VFAUAKN6.js";
|
|
3
3
|
|
|
4
4
|
// src/MultistepForm/MultistepForm.tsx
|
|
5
5
|
import * as React3 from "react";
|
|
@@ -1930,24 +1930,24 @@ function defineIconifyIcon(name = "iconify-icon") {
|
|
|
1930
1930
|
// Customisations
|
|
1931
1931
|
"width", "height", "rotate", "flip"];
|
|
1932
1932
|
const IconifyIcon2 = class extends ParentClass {
|
|
1933
|
+
// Root
|
|
1934
|
+
_shadowRoot;
|
|
1935
|
+
// Initialised
|
|
1936
|
+
_initialised = false;
|
|
1937
|
+
// Icon state
|
|
1938
|
+
_state;
|
|
1939
|
+
// Attributes check queued
|
|
1940
|
+
_checkQueued = false;
|
|
1941
|
+
// Connected
|
|
1942
|
+
_connected = false;
|
|
1943
|
+
// Observer
|
|
1944
|
+
_observer = null;
|
|
1945
|
+
_visible = true;
|
|
1933
1946
|
/**
|
|
1934
1947
|
* Constructor
|
|
1935
1948
|
*/
|
|
1936
1949
|
constructor() {
|
|
1937
1950
|
super();
|
|
1938
|
-
// Root
|
|
1939
|
-
__publicField(this, "_shadowRoot");
|
|
1940
|
-
// Initialised
|
|
1941
|
-
__publicField(this, "_initialised", false);
|
|
1942
|
-
// Icon state
|
|
1943
|
-
__publicField(this, "_state");
|
|
1944
|
-
// Attributes check queued
|
|
1945
|
-
__publicField(this, "_checkQueued", false);
|
|
1946
|
-
// Connected
|
|
1947
|
-
__publicField(this, "_connected", false);
|
|
1948
|
-
// Observer
|
|
1949
|
-
__publicField(this, "_observer", null);
|
|
1950
|
-
__publicField(this, "_visible", true);
|
|
1951
1951
|
const root = this._shadowRoot = this.attachShadow({
|
|
1952
1952
|
mode: "open"
|
|
1953
1953
|
});
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
4
|
-
enumerable: true,
|
|
5
|
-
configurable: true,
|
|
6
|
-
writable: true,
|
|
7
|
-
value
|
|
8
|
-
}) : obj[key] = value;
|
|
9
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
2
|
|
|
11
3
|
// src/index.ts
|
|
12
4
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
@@ -280,6 +272,7 @@ var FormField = ({
|
|
|
280
272
|
};
|
|
281
273
|
|
|
282
274
|
// src/FormFieldCheckbox.tsx
|
|
275
|
+
import * as React2 from "react";
|
|
283
276
|
import { Checkbox, Flex as Flex2, Label as Label2 } from "@ttoss/ui";
|
|
284
277
|
import { useController as useController2 } from "react-hook-form";
|
|
285
278
|
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
@@ -304,7 +297,8 @@ var FormFieldCheckbox = ({
|
|
|
304
297
|
name,
|
|
305
298
|
defaultValue: false
|
|
306
299
|
});
|
|
307
|
-
const
|
|
300
|
+
const uniqueId = React2.useId();
|
|
301
|
+
const id = checkboxProps.id || `form-field-checkbox-${name}-${uniqueId}`;
|
|
308
302
|
const error = !!errors[name]?.message;
|
|
309
303
|
return /* @__PURE__ */jsxs2(Flex2, {
|
|
310
304
|
sx: {
|
|
@@ -627,10 +621,10 @@ var FormFieldTextarea = ({
|
|
|
627
621
|
};
|
|
628
622
|
|
|
629
623
|
// src/FormGroup.tsx
|
|
630
|
-
import * as
|
|
624
|
+
import * as React3 from "react";
|
|
631
625
|
import { Box as Box3, Flex as Flex4, Text } from "@ttoss/ui";
|
|
632
626
|
import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
633
|
-
var FormGroupLevelsManagerContext =
|
|
627
|
+
var FormGroupLevelsManagerContext = React3.createContext({
|
|
634
628
|
levelsLength: 1,
|
|
635
629
|
registerChild: () => {
|
|
636
630
|
return null;
|
|
@@ -639,8 +633,8 @@ var FormGroupLevelsManagerContext = React2.createContext({
|
|
|
639
633
|
var FormGroupLevelsManager = ({
|
|
640
634
|
children
|
|
641
635
|
}) => {
|
|
642
|
-
const [levelsLength, setLevelsLength] =
|
|
643
|
-
const registerChild =
|
|
636
|
+
const [levelsLength, setLevelsLength] = React3.useState(0);
|
|
637
|
+
const registerChild = React3.useCallback(level => {
|
|
644
638
|
if (level + 1 > levelsLength) {
|
|
645
639
|
setLevelsLength(level + 1);
|
|
646
640
|
}
|
|
@@ -653,14 +647,14 @@ var FormGroupLevelsManager = ({
|
|
|
653
647
|
children
|
|
654
648
|
});
|
|
655
649
|
};
|
|
656
|
-
var FormGroupContext =
|
|
650
|
+
var FormGroupContext = React3.createContext({});
|
|
657
651
|
var useFormGroup = () => {
|
|
658
652
|
const {
|
|
659
653
|
parentLevel
|
|
660
|
-
} =
|
|
654
|
+
} = React3.useContext(FormGroupContext);
|
|
661
655
|
const {
|
|
662
656
|
levelsLength
|
|
663
|
-
} =
|
|
657
|
+
} = React3.useContext(FormGroupLevelsManagerContext);
|
|
664
658
|
return {
|
|
665
659
|
level: parentLevel,
|
|
666
660
|
levelsLength
|
|
@@ -678,8 +672,8 @@ var FormGroupWrapper = ({
|
|
|
678
672
|
} = useFormGroup();
|
|
679
673
|
const {
|
|
680
674
|
registerChild
|
|
681
|
-
} =
|
|
682
|
-
|
|
675
|
+
} = React3.useContext(FormGroupLevelsManagerContext);
|
|
676
|
+
React3.useEffect(() => {
|
|
683
677
|
if (typeof level === "number") {
|
|
684
678
|
registerChild(level);
|
|
685
679
|
}
|
|
@@ -738,4 +732,4 @@ var FormGroup = props => {
|
|
|
738
732
|
// src/index.ts
|
|
739
733
|
import { useForm, useFormContext as useFormContext2, useWatch, useFieldArray, useController as useController4, useFormState, Controller, FormProvider as FormProvider2 } from "react-hook-form";
|
|
740
734
|
export * from "react-hook-form";
|
|
741
|
-
export {
|
|
735
|
+
export { isCnpjValid, FormFieldCNPJ, yup2 as yup, Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldPatternFormat, FormFieldCreditCardNumber, FormFieldNumericFormat, FormFieldCurrencyInput, FormFieldInput, FormFieldPassword, FormFieldRadio, FormFieldSelect, FormFieldTextarea, useFormGroup, FormGroup, yupResolver, useForm, useFormContext2 as useFormContext, useWatch, useFieldArray, useController4 as useController, useFormState, Controller, FormProvider2 as FormProvider };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
-
import { Controller, Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldPatternFormat, FormFieldRadio, FormFieldSelect, FormFieldTextarea, FormGroup, FormProvider, useController, useFieldArray, useForm, useFormContext, useFormGroup, useFormState, useWatch, yup, yupResolver } from "./chunk-
|
|
2
|
+
import { Controller, Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldPatternFormat, FormFieldRadio, FormFieldSelect, FormFieldTextarea, FormGroup, FormProvider, useController, useFieldArray, useForm, useFormContext, useFormGroup, useFormState, useWatch, yup, yupResolver } from "./chunk-VFAUAKN6.js";
|
|
3
3
|
export { Controller, Form, FormErrorMessage, FormField, FormFieldCheckbox, FormFieldCreditCardNumber, FormFieldCurrencyInput, FormFieldInput, FormFieldNumericFormat, FormFieldPassword, FormFieldPatternFormat, FormFieldRadio, FormFieldSelect, FormFieldTextarea, FormGroup, FormProvider, useController, useFieldArray, useForm, useFormContext, useFormGroup, useFormState, useWatch, yup, yupResolver };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/forms",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -32,30 +32,30 @@
|
|
|
32
32
|
"sideEffects": true,
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@hookform/error-message": "^2.0.1",
|
|
35
|
-
"@hookform/resolvers": "^3.
|
|
36
|
-
"react-hook-form": "^7.
|
|
37
|
-
"react-number-format": "^5.
|
|
35
|
+
"@hookform/resolvers": "^3.9.1",
|
|
36
|
+
"react-hook-form": "^7.53.2",
|
|
37
|
+
"react-number-format": "^5.4.2",
|
|
38
38
|
"yup": "^1.4.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=16.8.0",
|
|
42
|
-
"@ttoss/react-i18n": "^2.0.
|
|
43
|
-
"@ttoss/ui": "^5.0.
|
|
42
|
+
"@ttoss/react-i18n": "^2.0.6",
|
|
43
|
+
"@ttoss/ui": "^5.0.11"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/jest": "^29.5.14",
|
|
47
47
|
"@types/react": "^18.3.12",
|
|
48
48
|
"jest": "^29.7.0",
|
|
49
49
|
"react": "^18.3.1",
|
|
50
|
-
"react-error-boundary": "^4.
|
|
50
|
+
"react-error-boundary": "^4.1.2",
|
|
51
51
|
"tsup": "^8.3.5",
|
|
52
52
|
"yup": "^1.4.0",
|
|
53
|
-
"@ttoss/config": "^1.
|
|
54
|
-
"@ttoss/react-
|
|
55
|
-
"@ttoss/
|
|
56
|
-
"@ttoss/test-utils": "^2.1.
|
|
57
|
-
"@ttoss/ui": "^5.0.
|
|
58
|
-
"@ttoss/
|
|
53
|
+
"@ttoss/config": "^1.35.0",
|
|
54
|
+
"@ttoss/react-i18n": "^2.0.6",
|
|
55
|
+
"@ttoss/react-icons": "^0.4.6",
|
|
56
|
+
"@ttoss/test-utils": "^2.1.19",
|
|
57
|
+
"@ttoss/ui": "^5.0.11",
|
|
58
|
+
"@ttoss/i18n-cli": "^0.7.24"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|