soda-heroui 0.11.2 → 0.11.4

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/README.md CHANGED
@@ -1,23 +1,23 @@
1
- # soda-tanstack-form
2
-
3
- [![NPM version](https://img.shields.io/npm/v/soda-tanstack-form.svg?style=flat)](https://npmjs.com/package/soda-tanstack-form)
4
- [![NPM downloads](http://img.shields.io/npm/dm/soda-tanstack-form.svg?style=flat)](https://npmjs.com/package/soda-tanstack-form)
5
-
6
- ## Install
7
-
8
- ```bash
9
- $ pnpm install
10
- ```
11
-
12
- ```bash
13
- $ npm run dev
14
- $ npm run build
15
- ```
16
-
17
- ## Options
18
-
19
- TODO
20
-
21
- ## LICENSE
22
-
23
- MIT
1
+ # soda-tanstack-form
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/soda-tanstack-form.svg?style=flat)](https://npmjs.com/package/soda-tanstack-form)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/soda-tanstack-form.svg?style=flat)](https://npmjs.com/package/soda-tanstack-form)
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ $ pnpm install
10
+ ```
11
+
12
+ ```bash
13
+ $ npm run dev
14
+ $ npm run build
15
+ ```
16
+
17
+ ## Options
18
+
19
+ TODO
20
+
21
+ ## LICENSE
22
+
23
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soda-heroui",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -37,8 +37,8 @@
37
37
  "dependencies": {
38
38
  "@internationalized/date": "^3.8.2",
39
39
  "@tanstack/react-form": "^1.19.0",
40
- "deepsea-tools": "5.40.4",
41
- "soda-hooks": "6.12.7",
40
+ "deepsea-tools": "5.40.5",
41
+ "soda-hooks": "6.13.1",
42
42
  "soda-tanstack-form": "0.2.5",
43
43
  "soda-type": "6.3.1"
44
44
  },
@@ -1,36 +1,36 @@
1
- import { FC, ReactNode } from "react"
2
- import { Button, PressEvent, addToast } from "@heroui/react"
3
- import { useAutoRefresh } from "soda-hooks"
4
- import { FirstParameter } from "soda-type"
5
-
6
- export interface AutoRefreshProps extends FirstParameter<typeof addToast> {
7
- onRefresh?: () => void
8
- children?: ReactNode
9
- }
10
-
11
- export const AutoRefresh: FC<AutoRefreshProps> = ({ children, onRefresh, ...rest }) => {
12
- if (process.env.NODE_ENV === "development") return children
13
-
14
- function onPress(e: PressEvent) {
15
- const closeButton = e.target.parentElement?.querySelector(`[aria-label="关闭"]`) as HTMLButtonElement
16
- closeButton?.click()
17
- onRefresh?.()
18
- }
19
-
20
- useAutoRefresh(() =>
21
- addToast({
22
- title: "检测到页面更新",
23
- description: "为了最佳的体验,请刷新页面",
24
- color: "warning",
25
- timeout: Infinity,
26
- endContent: (
27
- <Button color="warning" size="sm" variant="flat" onPress={onPress}>
28
- 刷新
29
- </Button>
30
- ),
31
- ...rest,
32
- }),
33
- )
34
-
35
- return children
36
- }
1
+ import { FC, ReactNode } from "react"
2
+ import { Button, PressEvent, addToast } from "@heroui/react"
3
+ import { useAutoRefresh } from "soda-hooks"
4
+ import { FirstParameter } from "soda-type"
5
+
6
+ export interface AutoRefreshProps extends FirstParameter<typeof addToast> {
7
+ onRefresh?: () => void
8
+ children?: ReactNode
9
+ }
10
+
11
+ export const AutoRefresh: FC<AutoRefreshProps> = ({ children, onRefresh, ...rest }) => {
12
+ if (process.env.NODE_ENV === "development") return children
13
+
14
+ function onPress(e: PressEvent) {
15
+ const closeButton = e.target.parentElement?.querySelector(`[aria-label="关闭"]`) as HTMLButtonElement
16
+ closeButton?.click()
17
+ onRefresh?.()
18
+ }
19
+
20
+ useAutoRefresh(() =>
21
+ addToast({
22
+ title: "检测到页面更新",
23
+ description: "为了最佳的体验,请刷新页面",
24
+ color: "warning",
25
+ timeout: Infinity,
26
+ endContent: (
27
+ <Button color="warning" size="sm" variant="flat" onPress={onPress}>
28
+ 刷新
29
+ </Button>
30
+ ),
31
+ ...rest,
32
+ }),
33
+ )
34
+
35
+ return children
36
+ }
@@ -1,34 +1,34 @@
1
- "use client"
2
-
3
- import { ComponentProps, FC } from "react"
4
- import { isNonNullable } from "deepsea-tools"
5
-
6
- export interface ErrorMessageItem {
7
- message: string
8
- }
9
-
10
- export interface ErrorMessageProps extends Omit<ComponentProps<"div">, "children"> {
11
- data: (ErrorMessageItem | undefined)[]
12
- }
13
-
14
- function getErrorMessage(error: ErrorMessageItem | string | undefined): string[] {
15
- if (!isNonNullable(error)) return []
16
- if (typeof error === "string") return [error]
17
- if ("errors" in error && Array.isArray(error.errors)) return error.errors.map(e => e.message).filter((item, index, array) => array.indexOf(item) === index)
18
- return [error.message]
19
- }
20
-
21
- export const ErrorMessage: FC<ErrorMessageProps> = props => {
22
- const { data, ...rest } = props
23
- const errors = data.flatMap(getErrorMessage).filter((item, index, array) => array.indexOf(item) === index)
24
-
25
- return (
26
- errors.length > 0 && (
27
- <div {...rest}>
28
- {errors.map((item, index) => (
29
- <div key={index}>{item}</div>
30
- ))}
31
- </div>
32
- )
33
- )
34
- }
1
+ "use client"
2
+
3
+ import { ComponentProps, FC } from "react"
4
+ import { isNonNullable } from "deepsea-tools"
5
+
6
+ export interface ErrorMessageItem {
7
+ message: string
8
+ }
9
+
10
+ export interface ErrorMessageProps extends Omit<ComponentProps<"div">, "children"> {
11
+ data: (ErrorMessageItem | undefined)[]
12
+ }
13
+
14
+ function getErrorMessage(error: ErrorMessageItem | string | undefined): string[] {
15
+ if (!isNonNullable(error)) return []
16
+ if (typeof error === "string") return [error]
17
+ if ("errors" in error && Array.isArray(error.errors)) return error.errors.map(e => e.message).filter((item, index, array) => array.indexOf(item) === index)
18
+ return [error.message]
19
+ }
20
+
21
+ export const ErrorMessage: FC<ErrorMessageProps> = props => {
22
+ const { data, ...rest } = props
23
+ const errors = data.flatMap(getErrorMessage).filter((item, index, array) => array.indexOf(item) === index)
24
+
25
+ return (
26
+ errors.length > 0 && (
27
+ <div {...rest}>
28
+ {errors.map((item, index) => (
29
+ <div key={index}>{item}</div>
30
+ ))}
31
+ </div>
32
+ )
33
+ )
34
+ }
@@ -1,27 +1,27 @@
1
- "use client"
2
-
3
- import { Key, ReactNode } from "react"
4
- import { Autocomplete, AutocompleteProps } from "@heroui/react"
5
- import { FieldComponentProps } from "soda-tanstack-form"
6
-
7
- import { getFieldProps } from "../utils/getFieldProps"
8
-
9
- export interface FormAutocompleteProps<FieldValue extends string | null | undefined = string | null | undefined, RenderItem extends object = object>
10
- extends FieldComponentProps<typeof Autocomplete<RenderItem>, FieldValue> {
11
- component?: <T extends object>(props: AutocompleteProps<T>) => ReactNode
12
- }
13
-
14
- export function FormAutocomplete<FieldValue extends string | null | undefined = string | null | undefined, RenderItem extends object = object>({
15
- field,
16
- component: Autocomplete2 = Autocomplete,
17
- ...rest
18
- }: FormAutocompleteProps<FieldValue, RenderItem>): ReactNode {
19
- return (
20
- <Autocomplete2<RenderItem>
21
- selectedKey={field.state.value ?? ""}
22
- onSelectionChange={field.handleChange as (value: Key | null) => void}
23
- {...getFieldProps(field)}
24
- {...rest}
25
- />
26
- )
27
- }
1
+ "use client"
2
+
3
+ import { Key, ReactNode } from "react"
4
+ import { Autocomplete, AutocompleteProps } from "@heroui/react"
5
+ import { FieldComponentProps } from "soda-tanstack-form"
6
+
7
+ import { getFieldProps } from "../utils/getFieldProps"
8
+
9
+ export interface FormAutocompleteProps<FieldValue extends string | null | undefined = string | null | undefined, RenderItem extends object = object>
10
+ extends FieldComponentProps<typeof Autocomplete<RenderItem>, FieldValue> {
11
+ component?: <T extends object>(props: AutocompleteProps<T>) => ReactNode
12
+ }
13
+
14
+ export function FormAutocomplete<FieldValue extends string | null | undefined = string | null | undefined, RenderItem extends object = object>({
15
+ field,
16
+ component: Autocomplete2 = Autocomplete,
17
+ ...rest
18
+ }: FormAutocompleteProps<FieldValue, RenderItem>): ReactNode {
19
+ return (
20
+ <Autocomplete2<RenderItem>
21
+ selectedKey={field.state.value ?? ""}
22
+ onSelectionChange={field.handleChange as (value: Key | null) => void}
23
+ {...getFieldProps(field)}
24
+ {...rest}
25
+ />
26
+ )
27
+ }
@@ -1,41 +1,41 @@
1
- "use client"
2
-
3
- import { ReactNode, useContext } from "react"
4
- import { Calendar, CalendarProps, DateValue } from "@heroui/react"
5
- import { FieldComponentProps } from "soda-tanstack-form"
6
- import { StrictOmit } from "soda-type"
7
-
8
- import { EmptyValue, FormContext } from "@/components/FormProvider"
9
-
10
- import { getFieldProps } from "@/utils/getFieldProps"
11
- import { DefaultTime } from "@/utils/getTimeValue"
12
- import { DateMode } from "@/utils/parseTime"
13
- import { TimeValueMode, TimeValueModeMap, getFieldValue, getOnChange } from "@/utils/time"
14
-
15
- export interface FormCalendarProps<
16
- ValueMode extends TimeValueMode = "date",
17
- FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
18
- > extends StrictOmit<FieldComponentProps<typeof Calendar, FieldValue>, never> {
19
- valueMode?: ValueMode
20
- emptyValue?: EmptyValue
21
- dateMode?: DateMode
22
- defaultTime?: DefaultTime | (() => DefaultTime)
23
- component?: <T extends DateValue>(props: CalendarProps<T>) => ReactNode
24
- }
25
-
26
- export function FormCalendar<
27
- ValueMode extends TimeValueMode = "date",
28
- FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
29
- >({ field, valueMode, emptyValue, dateMode, defaultTime, component: Calendar2 = Calendar, ...rest }: FormCalendarProps<ValueMode, FieldValue>): ReactNode {
30
- const context = useContext(FormContext)
31
- emptyValue ??= context.emptyValue
32
-
33
- return (
34
- <Calendar2
35
- focusedValue={getFieldValue(field, dateMode)}
36
- onFocusChange={getOnChange({ field, valueMode, emptyValue, defaultTime })}
37
- {...getFieldProps(field)}
38
- {...rest}
39
- />
40
- )
41
- }
1
+ "use client"
2
+
3
+ import { ReactNode, useContext } from "react"
4
+ import { Calendar, CalendarProps, DateValue } from "@heroui/react"
5
+ import { FieldComponentProps } from "soda-tanstack-form"
6
+ import { StrictOmit } from "soda-type"
7
+
8
+ import { EmptyValue, FormContext } from "@/components/FormProvider"
9
+
10
+ import { getFieldProps } from "@/utils/getFieldProps"
11
+ import { DefaultTime } from "@/utils/getTimeValue"
12
+ import { DateMode } from "@/utils/parseTime"
13
+ import { TimeValueMode, TimeValueModeMap, getFieldValue, getOnChange } from "@/utils/time"
14
+
15
+ export interface FormCalendarProps<
16
+ ValueMode extends TimeValueMode = "date",
17
+ FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
18
+ > extends StrictOmit<FieldComponentProps<typeof Calendar, FieldValue>, never> {
19
+ valueMode?: ValueMode
20
+ emptyValue?: EmptyValue
21
+ dateMode?: DateMode
22
+ defaultTime?: DefaultTime | (() => DefaultTime)
23
+ component?: <T extends DateValue>(props: CalendarProps<T>) => ReactNode
24
+ }
25
+
26
+ export function FormCalendar<
27
+ ValueMode extends TimeValueMode = "date",
28
+ FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
29
+ >({ field, valueMode, emptyValue, dateMode, defaultTime, component: Calendar2 = Calendar, ...rest }: FormCalendarProps<ValueMode, FieldValue>): ReactNode {
30
+ const context = useContext(FormContext)
31
+ emptyValue ??= context.emptyValue
32
+
33
+ return (
34
+ <Calendar2
35
+ focusedValue={getFieldValue(field, dateMode)}
36
+ onFocusChange={getOnChange({ field, valueMode, emptyValue, defaultTime })}
37
+ {...getFieldProps(field)}
38
+ {...rest}
39
+ />
40
+ )
41
+ }
@@ -1,34 +1,34 @@
1
- "use client"
2
-
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
- import { As, Checkbox, CheckboxProps, MergeWithAs } from "@heroui/react"
5
- import { Field } from "soda-tanstack-form"
6
-
7
- import { getFieldProps } from "../utils/getFieldProps"
8
-
9
- export type FormCheckboxProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
10
- ComponentPropsWithoutRef<"input">,
11
- ComponentPropsWithoutRef<AsComponent>,
12
- CheckboxProps,
13
- AsComponent
14
- > & {
15
- field: Field<FieldValue>
16
- component?: <AsComponent extends As = "input">(
17
- props: MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, CheckboxProps, AsComponent>,
18
- ) => ReactNode
19
- }
20
-
21
- export function FormCheckbox<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input">({
22
- field,
23
- component: Checkbox2 = Checkbox,
24
- ...rest
25
- }: FormCheckboxProps<FieldValue, AsComponent>): ReactNode {
26
- return (
27
- <Checkbox2<AsComponent>
28
- isSelected={field.state.value ?? false}
29
- onValueChange={field.handleChange as (value: boolean) => void}
30
- {...getFieldProps(field, true)}
31
- {...rest}
32
- />
33
- )
34
- }
1
+ "use client"
2
+
3
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
4
+ import { As, Checkbox, CheckboxProps, MergeWithAs } from "@heroui/react"
5
+ import { Field } from "soda-tanstack-form"
6
+
7
+ import { getFieldProps } from "../utils/getFieldProps"
8
+
9
+ export type FormCheckboxProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<
10
+ ComponentPropsWithoutRef<"input">,
11
+ ComponentPropsWithoutRef<AsComponent>,
12
+ CheckboxProps,
13
+ AsComponent
14
+ > & {
15
+ field: Field<FieldValue>
16
+ component?: <AsComponent extends As = "input">(
17
+ props: MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, CheckboxProps, AsComponent>,
18
+ ) => ReactNode
19
+ }
20
+
21
+ export function FormCheckbox<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input">({
22
+ field,
23
+ component: Checkbox2 = Checkbox,
24
+ ...rest
25
+ }: FormCheckboxProps<FieldValue, AsComponent>): ReactNode {
26
+ return (
27
+ <Checkbox2<AsComponent>
28
+ isSelected={field.state.value ?? false}
29
+ onValueChange={field.handleChange as (value: boolean) => void}
30
+ {...getFieldProps(field, true)}
31
+ {...rest}
32
+ />
33
+ )
34
+ }
@@ -1,34 +1,34 @@
1
- "use client"
2
-
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
- import { As, CheckboxGroup, CheckboxGroupProps, MergeWithAs } from "@heroui/react"
5
- import { Field } from "soda-tanstack-form"
6
-
7
- import { getFieldProps } from "../utils/getFieldProps"
8
-
9
- export type FormCheckboxGroupProps<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div"> = MergeWithAs<
10
- ComponentPropsWithoutRef<"div">,
11
- ComponentPropsWithoutRef<AsComponent>,
12
- CheckboxGroupProps,
13
- AsComponent
14
- > & {
15
- field: Field<FieldValue>
16
- component?: <AsComponent extends As = "div">(
17
- props: MergeWithAs<ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef<AsComponent>, CheckboxGroupProps, AsComponent>,
18
- ) => ReactNode
19
- }
20
-
21
- export function FormCheckboxGroup<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div">({
22
- field,
23
- component: CheckboxGroup2 = CheckboxGroup,
24
- ...rest
25
- }: FormCheckboxGroupProps<FieldValue, AsComponent>): ReactNode {
26
- return (
27
- <CheckboxGroup2<AsComponent>
28
- value={field.state.value ?? []}
29
- onValueChange={field.handleChange as (value: string[]) => void}
30
- {...getFieldProps(field)}
31
- {...rest}
32
- />
33
- )
34
- }
1
+ "use client"
2
+
3
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
4
+ import { As, CheckboxGroup, CheckboxGroupProps, MergeWithAs } from "@heroui/react"
5
+ import { Field } from "soda-tanstack-form"
6
+
7
+ import { getFieldProps } from "../utils/getFieldProps"
8
+
9
+ export type FormCheckboxGroupProps<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div"> = MergeWithAs<
10
+ ComponentPropsWithoutRef<"div">,
11
+ ComponentPropsWithoutRef<AsComponent>,
12
+ CheckboxGroupProps,
13
+ AsComponent
14
+ > & {
15
+ field: Field<FieldValue>
16
+ component?: <AsComponent extends As = "div">(
17
+ props: MergeWithAs<ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef<AsComponent>, CheckboxGroupProps, AsComponent>,
18
+ ) => ReactNode
19
+ }
20
+
21
+ export function FormCheckboxGroup<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div">({
22
+ field,
23
+ component: CheckboxGroup2 = CheckboxGroup,
24
+ ...rest
25
+ }: FormCheckboxGroupProps<FieldValue, AsComponent>): ReactNode {
26
+ return (
27
+ <CheckboxGroup2<AsComponent>
28
+ value={field.state.value ?? []}
29
+ onValueChange={field.handleChange as (value: string[]) => void}
30
+ {...getFieldProps(field)}
31
+ {...rest}
32
+ />
33
+ )
34
+ }
@@ -1,41 +1,41 @@
1
- "use client"
2
-
3
- import { ReactNode, useContext } from "react"
4
- import { DateInput, DateInputProps, DateValue } from "@heroui/react"
5
- import { FieldComponentProps } from "soda-tanstack-form"
6
- import { StrictOmit } from "soda-type"
7
-
8
- import { EmptyValue, FormContext } from "@/components/FormProvider"
9
-
10
- import { getFieldProps } from "@/utils/getFieldProps"
11
- import { DefaultTime } from "@/utils/getTimeValue"
12
- import { DateMode } from "@/utils/parseTime"
13
- import { TimeValueMode, TimeValueModeMap, getFieldValue, getOnChange } from "@/utils/time"
14
-
15
- export interface FormDateInputProps<
16
- ValueMode extends TimeValueMode = "date",
17
- FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
18
- > extends StrictOmit<FieldComponentProps<typeof DateInput, FieldValue>, never> {
19
- valueMode?: ValueMode
20
- emptyValue?: EmptyValue
21
- dateMode?: DateMode
22
- defaultTime?: DefaultTime | (() => DefaultTime)
23
- component?: <T extends DateValue>(props: DateInputProps<T>) => ReactNode
24
- }
25
-
26
- export function FormDateInput<
27
- ValueMode extends TimeValueMode = "date",
28
- FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
29
- >({ field, valueMode, emptyValue, dateMode, defaultTime, component: DateInput2 = DateInput, ...rest }: FormDateInputProps<ValueMode, FieldValue>): ReactNode {
30
- const context = useContext(FormContext)
31
- emptyValue ??= context.emptyValue
32
-
33
- return (
34
- <DateInput2
35
- value={getFieldValue(field, dateMode)}
36
- onChange={getOnChange({ field, valueMode, emptyValue, defaultTime })}
37
- {...getFieldProps(field)}
38
- {...rest}
39
- />
40
- )
41
- }
1
+ "use client"
2
+
3
+ import { ReactNode, useContext } from "react"
4
+ import { DateInput, DateInputProps, DateValue } from "@heroui/react"
5
+ import { FieldComponentProps } from "soda-tanstack-form"
6
+ import { StrictOmit } from "soda-type"
7
+
8
+ import { EmptyValue, FormContext } from "@/components/FormProvider"
9
+
10
+ import { getFieldProps } from "@/utils/getFieldProps"
11
+ import { DefaultTime } from "@/utils/getTimeValue"
12
+ import { DateMode } from "@/utils/parseTime"
13
+ import { TimeValueMode, TimeValueModeMap, getFieldValue, getOnChange } from "@/utils/time"
14
+
15
+ export interface FormDateInputProps<
16
+ ValueMode extends TimeValueMode = "date",
17
+ FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
18
+ > extends StrictOmit<FieldComponentProps<typeof DateInput, FieldValue>, never> {
19
+ valueMode?: ValueMode
20
+ emptyValue?: EmptyValue
21
+ dateMode?: DateMode
22
+ defaultTime?: DefaultTime | (() => DefaultTime)
23
+ component?: <T extends DateValue>(props: DateInputProps<T>) => ReactNode
24
+ }
25
+
26
+ export function FormDateInput<
27
+ ValueMode extends TimeValueMode = "date",
28
+ FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined,
29
+ >({ field, valueMode, emptyValue, dateMode, defaultTime, component: DateInput2 = DateInput, ...rest }: FormDateInputProps<ValueMode, FieldValue>): ReactNode {
30
+ const context = useContext(FormContext)
31
+ emptyValue ??= context.emptyValue
32
+
33
+ return (
34
+ <DateInput2
35
+ value={getFieldValue(field, dateMode)}
36
+ onChange={getOnChange({ field, valueMode, emptyValue, defaultTime })}
37
+ {...getFieldProps(field)}
38
+ {...rest}
39
+ />
40
+ )
41
+ }