@ultraviolet/form 3.13.6 → 3.13.7
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/components/TimeInputFieldV2/index.cjs +59 -0
- package/dist/components/TimeInputFieldV2/index.d.ts +11 -0
- package/dist/components/TimeInputFieldV2/index.js +59 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.cjs +22 -20
- package/dist/index.js +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
+
const ui = require("@ultraviolet/ui");
|
|
5
|
+
const reactHookForm = require("react-hook-form");
|
|
6
|
+
const index = require("../../providers/ErrorContext/index.cjs");
|
|
7
|
+
const TimeInputFieldV2 = ({
|
|
8
|
+
id,
|
|
9
|
+
className,
|
|
10
|
+
onChange,
|
|
11
|
+
placeholder,
|
|
12
|
+
disabled = false,
|
|
13
|
+
readOnly = false,
|
|
14
|
+
helper,
|
|
15
|
+
label,
|
|
16
|
+
autoFocus,
|
|
17
|
+
required = false,
|
|
18
|
+
"data-testid": dataTestId,
|
|
19
|
+
name,
|
|
20
|
+
onFocus,
|
|
21
|
+
onBlur,
|
|
22
|
+
clearable = false,
|
|
23
|
+
labelDescription,
|
|
24
|
+
size = "medium",
|
|
25
|
+
"aria-label": ariaLabel,
|
|
26
|
+
shouldUnregister,
|
|
27
|
+
control,
|
|
28
|
+
timeFormat
|
|
29
|
+
}) => {
|
|
30
|
+
const {
|
|
31
|
+
getError
|
|
32
|
+
} = index.useErrors();
|
|
33
|
+
const {
|
|
34
|
+
field,
|
|
35
|
+
fieldState: {
|
|
36
|
+
error
|
|
37
|
+
}
|
|
38
|
+
} = reactHookForm.useController({
|
|
39
|
+
name,
|
|
40
|
+
shouldUnregister,
|
|
41
|
+
control,
|
|
42
|
+
rules: {
|
|
43
|
+
required
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ui.TimeInputV2, { autoFocus, className, clearable, "data-testid": dataTestId, timeFormat, disabled, error: getError({
|
|
47
|
+
label: label ?? ariaLabel ?? name,
|
|
48
|
+
value: field.value
|
|
49
|
+
}, error), helper, label, labelDescription, onBlur: (event) => {
|
|
50
|
+
onBlur?.(event);
|
|
51
|
+
field.onBlur();
|
|
52
|
+
}, onChange: (value) => {
|
|
53
|
+
field.onChange(value);
|
|
54
|
+
onChange?.(value);
|
|
55
|
+
}, onFocus: (event) => {
|
|
56
|
+
onFocus?.(event);
|
|
57
|
+
}, placeholder, readOnly, required, value: field.value, id, size });
|
|
58
|
+
};
|
|
59
|
+
exports.TimeInputFieldV2 = TimeInputFieldV2;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TimeInputV2 } from '@ultraviolet/ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
4
|
+
import type { BaseFieldProps } from '../../types';
|
|
5
|
+
type TimeInputFieldProps<TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues>> = BaseFieldProps<TFieldValues, TFieldName> & Omit<ComponentProps<typeof TimeInputV2>, 'value' | 'error' | 'name' | 'onChange'>;
|
|
6
|
+
/**
|
|
7
|
+
* This component offers a form field based on Ultraviolet UI TimeInputV2 component
|
|
8
|
+
* @experimental This component is experimental and may be subject to breaking changes in the future.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TimeInputFieldV2: <TFieldValues extends FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ id, className, onChange, placeholder, disabled, readOnly, helper, label, autoFocus, required, "data-testid": dataTestId, name, onFocus, onBlur, clearable, labelDescription, size, "aria-label": ariaLabel, shouldUnregister, control, timeFormat, }: TimeInputFieldProps<TFieldValues, TFieldName>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { TimeInputV2 } from "@ultraviolet/ui";
|
|
3
|
+
import { useController } from "react-hook-form";
|
|
4
|
+
import { useErrors } from "../../providers/ErrorContext/index.js";
|
|
5
|
+
const TimeInputFieldV2 = ({
|
|
6
|
+
id,
|
|
7
|
+
className,
|
|
8
|
+
onChange,
|
|
9
|
+
placeholder,
|
|
10
|
+
disabled = false,
|
|
11
|
+
readOnly = false,
|
|
12
|
+
helper,
|
|
13
|
+
label,
|
|
14
|
+
autoFocus,
|
|
15
|
+
required = false,
|
|
16
|
+
"data-testid": dataTestId,
|
|
17
|
+
name,
|
|
18
|
+
onFocus,
|
|
19
|
+
onBlur,
|
|
20
|
+
clearable = false,
|
|
21
|
+
labelDescription,
|
|
22
|
+
size = "medium",
|
|
23
|
+
"aria-label": ariaLabel,
|
|
24
|
+
shouldUnregister,
|
|
25
|
+
control,
|
|
26
|
+
timeFormat
|
|
27
|
+
}) => {
|
|
28
|
+
const {
|
|
29
|
+
getError
|
|
30
|
+
} = useErrors();
|
|
31
|
+
const {
|
|
32
|
+
field,
|
|
33
|
+
fieldState: {
|
|
34
|
+
error
|
|
35
|
+
}
|
|
36
|
+
} = useController({
|
|
37
|
+
name,
|
|
38
|
+
shouldUnregister,
|
|
39
|
+
control,
|
|
40
|
+
rules: {
|
|
41
|
+
required
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ jsx(TimeInputV2, { autoFocus, className, clearable, "data-testid": dataTestId, timeFormat, disabled, error: getError({
|
|
45
|
+
label: label ?? ariaLabel ?? name,
|
|
46
|
+
value: field.value
|
|
47
|
+
}, error), helper, label, labelDescription, onBlur: (event) => {
|
|
48
|
+
onBlur?.(event);
|
|
49
|
+
field.onBlur();
|
|
50
|
+
}, onChange: (value) => {
|
|
51
|
+
field.onChange(value);
|
|
52
|
+
onChange?.(value);
|
|
53
|
+
}, onFocus: (event) => {
|
|
54
|
+
onFocus?.(event);
|
|
55
|
+
}, placeholder, readOnly, required, value: field.value, id, size });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
TimeInputFieldV2
|
|
59
|
+
};
|
|
@@ -13,6 +13,7 @@ export { TextAreaField } from './TextAreaField';
|
|
|
13
13
|
export { TextInputField } from './TextInputField';
|
|
14
14
|
export { TextInputField as TextInputFieldV2 } from './TextInputFieldV2';
|
|
15
15
|
export { TimeField } from './TimeField';
|
|
16
|
+
export { TimeInputFieldV2 } from './TimeInputFieldV2';
|
|
16
17
|
export { ToggleField } from './ToggleField';
|
|
17
18
|
export { Submit } from './Submit';
|
|
18
19
|
export { RadioGroupField } from './RadioGroupField';
|
package/dist/index.cjs
CHANGED
|
@@ -18,16 +18,17 @@ const index$c = require("./components/TextAreaField/index.cjs");
|
|
|
18
18
|
const index$d = require("./components/TextInputField/index.cjs");
|
|
19
19
|
const index$e = require("./components/TextInputFieldV2/index.cjs");
|
|
20
20
|
const index$f = require("./components/TimeField/index.cjs");
|
|
21
|
-
const index$g = require("./components/
|
|
22
|
-
const index$h = require("./components/
|
|
23
|
-
const index$i = require("./components/
|
|
24
|
-
const index$j = require("./components/
|
|
25
|
-
const index$k = require("./components/
|
|
26
|
-
const index$l = require("./components/
|
|
27
|
-
const index$m = require("./components/
|
|
28
|
-
const index$n = require("./components/
|
|
29
|
-
const index$o = require("./components/
|
|
30
|
-
const index$p = require("./components/
|
|
21
|
+
const index$g = require("./components/TimeInputFieldV2/index.cjs");
|
|
22
|
+
const index$h = require("./components/ToggleField/index.cjs");
|
|
23
|
+
const index$i = require("./components/Submit/index.cjs");
|
|
24
|
+
const index$j = require("./components/RadioGroupField/index.cjs");
|
|
25
|
+
const index$k = require("./components/KeyValueField/index.cjs");
|
|
26
|
+
const index$l = require("./components/SelectableCardGroupField/index.cjs");
|
|
27
|
+
const index$m = require("./components/SelectInputFieldV2/index.cjs");
|
|
28
|
+
const index$n = require("./components/UnitInputField/index.cjs");
|
|
29
|
+
const index$o = require("./components/SliderField/index.cjs");
|
|
30
|
+
const index$p = require("./components/SwitchButtonField/index.cjs");
|
|
31
|
+
const index$q = require("./components/VerificationCodeField/index.cjs");
|
|
31
32
|
exports.ErrorProvider = index.ErrorProvider;
|
|
32
33
|
exports.useErrors = index.useErrors;
|
|
33
34
|
Object.defineProperty(exports, "useController", {
|
|
@@ -70,13 +71,14 @@ exports.TextAreaField = index$c.TextAreaField;
|
|
|
70
71
|
exports.TextInputField = index$d.TextInputField;
|
|
71
72
|
exports.TextInputFieldV2 = index$e.TextInputField;
|
|
72
73
|
exports.TimeField = index$f.TimeField;
|
|
73
|
-
exports.
|
|
74
|
-
exports.
|
|
75
|
-
exports.
|
|
76
|
-
exports.
|
|
77
|
-
exports.
|
|
78
|
-
exports.
|
|
79
|
-
exports.
|
|
80
|
-
exports.
|
|
81
|
-
exports.
|
|
82
|
-
exports.
|
|
74
|
+
exports.TimeInputFieldV2 = index$g.TimeInputFieldV2;
|
|
75
|
+
exports.ToggleField = index$h.ToggleField;
|
|
76
|
+
exports.Submit = index$i.Submit;
|
|
77
|
+
exports.RadioGroupField = index$j.RadioGroupField;
|
|
78
|
+
exports.KeyValueField = index$k.KeyValueField;
|
|
79
|
+
exports.SelectableCardGroupField = index$l.SelectableCardGroupField;
|
|
80
|
+
exports.SelectInputFieldV2 = index$m.SelectInputFieldV2;
|
|
81
|
+
exports.UnitInputField = index$n.UnitInputField;
|
|
82
|
+
exports.SliderField = index$o.SliderField;
|
|
83
|
+
exports.SwitchButtonField = index$p.SwitchButtonField;
|
|
84
|
+
exports.VerificationCodeField = index$q.VerificationCodeField;
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import { TextAreaField } from "./components/TextAreaField/index.js";
|
|
|
16
16
|
import { TextInputField } from "./components/TextInputField/index.js";
|
|
17
17
|
import { TextInputField as TextInputField2 } from "./components/TextInputFieldV2/index.js";
|
|
18
18
|
import { TimeField } from "./components/TimeField/index.js";
|
|
19
|
+
import { TimeInputFieldV2 } from "./components/TimeInputFieldV2/index.js";
|
|
19
20
|
import { ToggleField } from "./components/ToggleField/index.js";
|
|
20
21
|
import { Submit } from "./components/Submit/index.js";
|
|
21
22
|
import { RadioGroupField } from "./components/RadioGroupField/index.js";
|
|
@@ -50,6 +51,7 @@ export {
|
|
|
50
51
|
TextInputField,
|
|
51
52
|
TextInputField2 as TextInputFieldV2,
|
|
52
53
|
TimeField,
|
|
54
|
+
TimeInputFieldV2,
|
|
53
55
|
ToggleField,
|
|
54
56
|
UnitInputField,
|
|
55
57
|
VerificationCodeField,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultraviolet/form",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.7",
|
|
4
4
|
"description": "Ultraviolet Form",
|
|
5
5
|
"homepage": "https://github.com/scaleway/ultraviolet#readme",
|
|
6
6
|
"repository": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@emotion/react": "11.14.0",
|
|
62
62
|
"@emotion/styled": "11.14.0",
|
|
63
63
|
"@types/final-form-focus": "1.1.7",
|
|
64
|
-
"@types/react": "19.0.
|
|
64
|
+
"@types/react": "19.0.7",
|
|
65
65
|
"@types/react-dom": "19.0.3",
|
|
66
66
|
"react": "19.0.0",
|
|
67
67
|
"react-dom": "19.0.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"react-hook-form": "7.54.2",
|
|
73
73
|
"react-select": "5.8.3",
|
|
74
74
|
"@ultraviolet/themes": "1.15.0",
|
|
75
|
-
"@ultraviolet/ui": "1.
|
|
75
|
+
"@ultraviolet/ui": "1.84.0"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"build:profile": "npx vite-bundle-visualizer -c vite.config.ts",
|