@uxf/form 1.0.0-beta.86 → 1.0.0-beta.87
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/form",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.87",
|
|
4
4
|
"description": "",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "UX Fans s.r.o",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@uxf/ui": "^1.0.0-beta.
|
|
16
|
+
"@uxf/ui": "^1.0.0-beta.87",
|
|
17
17
|
"react-hook-form": "latest"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
import { TextInputProps as UITextInputProps } from "@uxf/ui/text-input";
|
|
3
3
|
import { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
4
|
export declare type TextInputProps<FormData extends FieldValues> = UseControllerProps<FormData> & Omit<UITextInputProps, "isInvalid" | "max" | "min" | "pattern" | "step" | "name" | "onChange" | "value" | "type"> & {
|
|
5
|
-
patternErrorMessage?: string;
|
|
6
5
|
requiredMessage?: string;
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
} & ({
|
|
7
|
+
type: "email";
|
|
8
|
+
invalidEmailMessage?: string;
|
|
9
|
+
invalidPhoneMessage?: never;
|
|
10
|
+
} | {
|
|
11
|
+
type: "tel";
|
|
12
|
+
invalidEmailMessage?: never;
|
|
13
|
+
invalidPhoneMessage?: string;
|
|
14
|
+
} | {
|
|
15
|
+
type?: "password" | "search" | "text" | "url";
|
|
16
|
+
invalidEmailMessage?: never;
|
|
17
|
+
invalidPhoneMessage?: never;
|
|
18
|
+
});
|
|
9
19
|
export declare function TextInput<FormData extends FieldValues>(props: TextInputProps<FormData>): JSX.Element;
|
package/text-input/text-input.js
CHANGED
|
@@ -20,12 +20,12 @@ function TextInput(props) {
|
|
|
20
20
|
pattern: props.type === "email"
|
|
21
21
|
? {
|
|
22
22
|
value: EMAIL_REGEXP,
|
|
23
|
-
message: (_a = props.
|
|
23
|
+
message: (_a = props.invalidEmailMessage) !== null && _a !== void 0 ? _a : "E-mail by měl být ve\xa0formátu: info@email.cz",
|
|
24
24
|
}
|
|
25
25
|
: props.type === "tel"
|
|
26
26
|
? {
|
|
27
27
|
value: PHONE_REGEXP,
|
|
28
|
-
message: (_b = props.
|
|
28
|
+
message: (_b = props.invalidPhoneMessage) !== null && _b !== void 0 ? _b : "Zadaný telefon není ve správném formátu",
|
|
29
29
|
}
|
|
30
30
|
: undefined,
|
|
31
31
|
...((_c = props.rules) !== null && _c !== void 0 ? _c : {}),
|