soda-heroui 0.9.1 → 0.10.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/dist/components/AutoRefresh.d.ts +1 -1
- package/dist/components/FormAutocomplete.d.ts +1 -1
- package/dist/components/FormCalendar.cjs +8 -7
- package/dist/components/FormCalendar.d.ts +6 -4
- package/dist/components/FormCalendar.js +8 -7
- package/dist/components/FormCheckbox.d.ts +1 -1
- package/dist/components/FormCheckboxGroup.d.ts +1 -1
- package/dist/components/FormDateInput.cjs +8 -7
- package/dist/components/FormDateInput.d.ts +6 -4
- package/dist/components/FormDateInput.js +8 -7
- package/dist/components/FormDatePicker.cjs +8 -7
- package/dist/components/FormDatePicker.d.ts +6 -4
- package/dist/components/FormDatePicker.js +8 -7
- package/dist/components/FormDateRangePicker.cjs +8 -7
- package/dist/components/FormDateRangePicker.d.ts +6 -4
- package/dist/components/FormDateRangePicker.js +8 -7
- package/dist/components/FormInput.d.ts +1 -1
- package/dist/components/FormInputOtp.d.ts +1 -1
- package/dist/components/FormNumberInput.d.ts +1 -1
- package/dist/components/FormPagination.d.ts +1 -1
- package/dist/components/FormProvider.cjs +1 -1
- package/dist/components/FormProvider.js +1 -1
- package/dist/components/FormRadioGroup.d.ts +1 -1
- package/dist/components/FormRangeCalendar.cjs +10 -55
- package/dist/components/FormRangeCalendar.d.ts +8 -20
- package/dist/components/FormRangeCalendar.js +9 -42
- package/dist/components/FormSelect.cjs +1 -1
- package/dist/components/FormSelect.d.ts +1 -1
- package/dist/components/FormSelect.js +1 -1
- package/dist/components/FormSwitch.d.ts +1 -1
- package/dist/components/FormTextarea.d.ts +1 -1
- package/dist/components/FormTimeInput.cjs +10 -44
- package/dist/components/FormTimeInput.d.ts +8 -22
- package/dist/components/FormTimeInput.js +9 -31
- package/dist/index.cjs +18 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/utils/getTimeValue.cjs +9 -8
- package/dist/utils/getTimeValue.d.ts +10 -1
- package/dist/utils/getTimeValue.js +9 -8
- package/dist/utils/range.cjs +89 -0
- package/dist/utils/range.d.ts +28 -0
- package/dist/utils/range.js +46 -0
- package/dist/utils/time.cjs +70 -0
- package/dist/utils/time.d.ts +25 -0
- package/dist/utils/time.js +27 -0
- package/package.json +7 -4
- package/src/components/AutoRefresh.tsx +1 -1
- package/src/components/ErrorMessage.tsx +1 -1
- package/src/components/FormAutocomplete.tsx +1 -1
- package/src/components/FormCalendar.tsx +8 -6
- package/src/components/FormCheckbox.tsx +1 -1
- package/src/components/FormCheckboxGroup.tsx +1 -1
- package/src/components/FormDateInput.tsx +15 -6
- package/src/components/FormDatePicker.tsx +24 -7
- package/src/components/FormDateRangePicker.tsx +10 -7
- package/src/components/FormInput.tsx +1 -1
- package/src/components/FormInputOtp.tsx +1 -1
- package/src/components/FormNumberInput.tsx +1 -1
- package/src/components/FormPagination.tsx +1 -1
- package/src/components/FormProvider.tsx +1 -1
- package/src/components/FormRadioGroup.tsx +1 -1
- package/src/components/FormRangeCalendar.tsx +10 -54
- package/src/components/FormSelect.tsx +1 -1
- package/src/components/FormSwitch.tsx +1 -1
- package/src/components/FormTextarea.tsx +1 -1
- package/src/components/FormTimeInput.tsx +18 -49
- package/src/index.ts +2 -0
- package/src/utils/getTimeValue.ts +20 -8
- package/src/utils/range.ts +80 -0
- package/src/utils/time.ts +50 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addToast } from "@heroui/react";
|
|
2
1
|
import { FC, ReactNode } from "react";
|
|
2
|
+
import { addToast } from "@heroui/react";
|
|
3
3
|
import { FirstParameter } from "soda-type";
|
|
4
4
|
export interface AutoRefreshProps extends FirstParameter<typeof addToast> {
|
|
5
5
|
onRefresh?: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Autocomplete, AutocompleteProps } from "@heroui/react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { Autocomplete, AutocompleteProps } from "@heroui/react";
|
|
3
3
|
import { FieldComponentProps } from "soda-tanstack-form";
|
|
4
4
|
export interface FormAutocompleteProps<FieldValue extends string | null | undefined = string | null | undefined, RenderItem extends object = object> extends FieldComponentProps<typeof Autocomplete<RenderItem>, FieldValue> {
|
|
5
5
|
component?: <T extends object>(props: AutocompleteProps<T>) => ReactNode;
|
|
@@ -28,20 +28,21 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
FormCalendar: ()=>FormCalendar
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const react_namespaceObject = require("@heroui/react");
|
|
32
31
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const
|
|
32
|
+
const react_namespaceObject = require("@heroui/react");
|
|
34
33
|
const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
|
|
35
|
+
const time_cjs_namespaceObject = require("../utils/time.cjs");
|
|
36
|
+
function FormCalendar({ field, valueMode, emptyValue, dateMode, defaultTime, component: Calendar2 = react_namespaceObject.Calendar, ...rest }) {
|
|
37
37
|
const context = (0, external_react_namespaceObject.useContext)(external_FormProvider_cjs_namespaceObject.FormContext);
|
|
38
38
|
emptyValue ??= context.emptyValue;
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Calendar2, {
|
|
40
|
-
focusedValue: (0,
|
|
41
|
-
onFocusChange: (0,
|
|
40
|
+
focusedValue: (0, time_cjs_namespaceObject.getFieldValue)(field, dateMode),
|
|
41
|
+
onFocusChange: (0, time_cjs_namespaceObject.getOnChange)({
|
|
42
42
|
field,
|
|
43
43
|
valueMode,
|
|
44
|
-
emptyValue
|
|
44
|
+
emptyValue,
|
|
45
|
+
defaultTime
|
|
45
46
|
}),
|
|
46
47
|
...(0, getFieldProps_cjs_namespaceObject.getFieldProps)(field),
|
|
47
48
|
...rest
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { Calendar, CalendarProps, DateValue } from "@heroui/react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { Calendar, CalendarProps, DateValue } from "@heroui/react";
|
|
3
3
|
import { FieldComponentProps } from "soda-tanstack-form";
|
|
4
4
|
import { StrictOmit } from "soda-type";
|
|
5
|
-
import { DateMode } from "../utils/parseTime";
|
|
6
5
|
import { EmptyValue } from "./FormProvider";
|
|
7
|
-
import {
|
|
6
|
+
import { DefaultTime } from "../utils/getTimeValue";
|
|
7
|
+
import { DateMode } from "../utils/parseTime";
|
|
8
|
+
import { TimeValueMode, TimeValueModeMap } from "../utils/time";
|
|
8
9
|
export interface FormCalendarProps<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined> extends StrictOmit<FieldComponentProps<typeof Calendar, FieldValue>, never> {
|
|
9
10
|
valueMode?: ValueMode;
|
|
10
11
|
emptyValue?: EmptyValue;
|
|
11
12
|
dateMode?: DateMode;
|
|
13
|
+
defaultTime?: DefaultTime | (() => DefaultTime);
|
|
12
14
|
component?: <T extends DateValue>(props: CalendarProps<T>) => ReactNode;
|
|
13
15
|
}
|
|
14
|
-
export declare function FormCalendar<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined>({ field, valueMode, emptyValue, dateMode, component: Calendar2, ...rest }: FormCalendarProps<ValueMode, FieldValue>): ReactNode;
|
|
16
|
+
export declare function FormCalendar<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined>({ field, valueMode, emptyValue, dateMode, defaultTime, component: Calendar2, ...rest }: FormCalendarProps<ValueMode, FieldValue>): ReactNode;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
-
import * as
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
|
|
7
|
-
import * as
|
|
8
|
-
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__ from "../utils/time.js";
|
|
8
|
+
function FormCalendar({ field, valueMode, emptyValue, dateMode, defaultTime, component: Calendar2 = __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__.Calendar, ...rest }) {
|
|
9
9
|
const context = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__.FormContext);
|
|
10
10
|
emptyValue ??= context.emptyValue;
|
|
11
11
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(Calendar2, {
|
|
12
|
-
focusedValue: (0,
|
|
13
|
-
onFocusChange: (0,
|
|
12
|
+
focusedValue: (0, __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__.getFieldValue)(field, dateMode),
|
|
13
|
+
onFocusChange: (0, __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__.getOnChange)({
|
|
14
14
|
field,
|
|
15
15
|
valueMode,
|
|
16
|
-
emptyValue
|
|
16
|
+
emptyValue,
|
|
17
|
+
defaultTime
|
|
17
18
|
}),
|
|
18
19
|
...(0, __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__.getFieldProps)(field),
|
|
19
20
|
...rest
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, CheckboxProps, MergeWithAs } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, CheckboxProps, MergeWithAs } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormCheckboxProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, CheckboxProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, CheckboxGroupProps, MergeWithAs } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, CheckboxGroupProps, MergeWithAs } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormCheckboxGroupProps<FieldValue extends string[] | null | undefined = string[] | null | undefined, AsComponent extends As = "div"> = MergeWithAs<ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef<AsComponent>, CheckboxGroupProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -28,20 +28,21 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
FormDateInput: ()=>FormDateInput
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const react_namespaceObject = require("@heroui/react");
|
|
32
31
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const
|
|
32
|
+
const react_namespaceObject = require("@heroui/react");
|
|
34
33
|
const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
|
|
35
|
+
const time_cjs_namespaceObject = require("../utils/time.cjs");
|
|
36
|
+
function FormDateInput({ field, valueMode, emptyValue, dateMode, defaultTime, component: DateInput2 = react_namespaceObject.DateInput, ...rest }) {
|
|
37
37
|
const context = (0, external_react_namespaceObject.useContext)(external_FormProvider_cjs_namespaceObject.FormContext);
|
|
38
38
|
emptyValue ??= context.emptyValue;
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DateInput2, {
|
|
40
|
-
value: (0,
|
|
41
|
-
onChange: (0,
|
|
40
|
+
value: (0, time_cjs_namespaceObject.getFieldValue)(field, dateMode),
|
|
41
|
+
onChange: (0, time_cjs_namespaceObject.getOnChange)({
|
|
42
42
|
field,
|
|
43
43
|
valueMode,
|
|
44
|
-
emptyValue
|
|
44
|
+
emptyValue,
|
|
45
|
+
defaultTime
|
|
45
46
|
}),
|
|
46
47
|
...(0, getFieldProps_cjs_namespaceObject.getFieldProps)(field),
|
|
47
48
|
...rest
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { DateInput, DateInputProps, DateValue } from "@heroui/react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { DateInput, DateInputProps, DateValue } from "@heroui/react";
|
|
3
3
|
import { FieldComponentProps } from "soda-tanstack-form";
|
|
4
4
|
import { StrictOmit } from "soda-type";
|
|
5
|
-
import { DateMode } from "../utils/parseTime";
|
|
6
5
|
import { EmptyValue } from "./FormProvider";
|
|
7
|
-
import {
|
|
6
|
+
import { DefaultTime } from "../utils/getTimeValue";
|
|
7
|
+
import { DateMode } from "../utils/parseTime";
|
|
8
|
+
import { TimeValueMode, TimeValueModeMap } from "../utils/time";
|
|
8
9
|
export interface FormDateInputProps<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined> extends StrictOmit<FieldComponentProps<typeof DateInput, FieldValue>, never> {
|
|
9
10
|
valueMode?: ValueMode;
|
|
10
11
|
emptyValue?: EmptyValue;
|
|
11
12
|
dateMode?: DateMode;
|
|
13
|
+
defaultTime?: DefaultTime | (() => DefaultTime);
|
|
12
14
|
component?: <T extends DateValue>(props: DateInputProps<T>) => ReactNode;
|
|
13
15
|
}
|
|
14
|
-
export declare function FormDateInput<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined>({ field, valueMode, emptyValue, dateMode, component: DateInput2, ...rest }: FormDateInputProps<ValueMode, FieldValue>): ReactNode;
|
|
16
|
+
export declare function FormDateInput<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined>({ field, valueMode, emptyValue, dateMode, defaultTime, component: DateInput2, ...rest }: FormDateInputProps<ValueMode, FieldValue>): ReactNode;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
-
import * as
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
|
|
7
|
-
import * as
|
|
8
|
-
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__ from "../utils/time.js";
|
|
8
|
+
function FormDateInput({ field, valueMode, emptyValue, dateMode, defaultTime, component: DateInput2 = __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__.DateInput, ...rest }) {
|
|
9
9
|
const context = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__.FormContext);
|
|
10
10
|
emptyValue ??= context.emptyValue;
|
|
11
11
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DateInput2, {
|
|
12
|
-
value: (0,
|
|
13
|
-
onChange: (0,
|
|
12
|
+
value: (0, __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__.getFieldValue)(field, dateMode),
|
|
13
|
+
onChange: (0, __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__.getOnChange)({
|
|
14
14
|
field,
|
|
15
15
|
valueMode,
|
|
16
|
-
emptyValue
|
|
16
|
+
emptyValue,
|
|
17
|
+
defaultTime
|
|
17
18
|
}),
|
|
18
19
|
...(0, __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__.getFieldProps)(field),
|
|
19
20
|
...rest
|
|
@@ -28,20 +28,21 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
FormDatePicker: ()=>FormDatePicker
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const react_namespaceObject = require("@heroui/react");
|
|
32
31
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const
|
|
32
|
+
const react_namespaceObject = require("@heroui/react");
|
|
34
33
|
const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
|
|
35
|
+
const time_cjs_namespaceObject = require("../utils/time.cjs");
|
|
36
|
+
function FormDatePicker({ field, valueMode, emptyValue, dateMode, defaultTime, component: DatePicker2 = react_namespaceObject.DatePicker, ...rest }) {
|
|
37
37
|
const context = (0, external_react_namespaceObject.useContext)(external_FormProvider_cjs_namespaceObject.FormContext);
|
|
38
38
|
emptyValue ??= context.emptyValue;
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DatePicker2, {
|
|
40
|
-
value: (0,
|
|
41
|
-
onChange: (0,
|
|
40
|
+
value: (0, time_cjs_namespaceObject.getFieldValue)(field, dateMode),
|
|
41
|
+
onChange: (0, time_cjs_namespaceObject.getOnChange)({
|
|
42
42
|
field,
|
|
43
43
|
valueMode,
|
|
44
|
-
emptyValue
|
|
44
|
+
emptyValue,
|
|
45
|
+
defaultTime
|
|
45
46
|
}),
|
|
46
47
|
...(0, getFieldProps_cjs_namespaceObject.getFieldProps)(field),
|
|
47
48
|
...rest
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { DatePicker, DatePickerProps, DateValue } from "@heroui/react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { DatePicker, DatePickerProps, DateValue } from "@heroui/react";
|
|
3
3
|
import { FieldComponentProps } from "soda-tanstack-form";
|
|
4
4
|
import { StrictOmit } from "soda-type";
|
|
5
|
-
import { DateMode } from "../utils/parseTime";
|
|
6
5
|
import { EmptyValue } from "./FormProvider";
|
|
7
|
-
import {
|
|
6
|
+
import { DefaultTime } from "../utils/getTimeValue";
|
|
7
|
+
import { DateMode } from "../utils/parseTime";
|
|
8
|
+
import { TimeValueMode, TimeValueModeMap } from "../utils/time";
|
|
8
9
|
export interface FormDatePickerProps<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined> extends StrictOmit<FieldComponentProps<typeof DatePicker, FieldValue>, never> {
|
|
9
10
|
valueMode?: ValueMode;
|
|
10
11
|
emptyValue?: EmptyValue;
|
|
11
12
|
dateMode?: DateMode;
|
|
13
|
+
defaultTime?: DefaultTime | (() => DefaultTime);
|
|
12
14
|
component?: <T extends DateValue>(props: DatePickerProps<T>) => ReactNode;
|
|
13
15
|
}
|
|
14
|
-
export declare function FormDatePicker<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined>({ field, valueMode, emptyValue, dateMode, component: DatePicker2, ...rest }: FormDatePickerProps<ValueMode, FieldValue>): ReactNode;
|
|
16
|
+
export declare function FormDatePicker<ValueMode extends TimeValueMode = "date", FieldValue extends TimeValueModeMap<ValueMode> | null | undefined = TimeValueModeMap<ValueMode> | null | undefined>({ field, valueMode, emptyValue, dateMode, defaultTime, component: DatePicker2, ...rest }: FormDatePickerProps<ValueMode, FieldValue>): ReactNode;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
-
import * as
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
|
|
7
|
-
import * as
|
|
8
|
-
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__ from "../utils/time.js";
|
|
8
|
+
function FormDatePicker({ field, valueMode, emptyValue, dateMode, defaultTime, component: DatePicker2 = __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__.DatePicker, ...rest }) {
|
|
9
9
|
const context = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__.FormContext);
|
|
10
10
|
emptyValue ??= context.emptyValue;
|
|
11
11
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DatePicker2, {
|
|
12
|
-
value: (0,
|
|
13
|
-
onChange: (0,
|
|
12
|
+
value: (0, __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__.getFieldValue)(field, dateMode),
|
|
13
|
+
onChange: (0, __WEBPACK_EXTERNAL_MODULE__utils_time_js_d87d46fc__.getOnChange)({
|
|
14
14
|
field,
|
|
15
15
|
valueMode,
|
|
16
|
-
emptyValue
|
|
16
|
+
emptyValue,
|
|
17
|
+
defaultTime
|
|
17
18
|
}),
|
|
18
19
|
...(0, __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__.getFieldProps)(field),
|
|
19
20
|
...rest
|
|
@@ -28,21 +28,22 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
FormDateRangePicker: ()=>FormDateRangePicker
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const react_namespaceObject = require("@heroui/react");
|
|
32
31
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const
|
|
32
|
+
const react_namespaceObject = require("@heroui/react");
|
|
34
33
|
const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
|
|
35
|
-
const
|
|
36
|
-
|
|
34
|
+
const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
|
|
35
|
+
const range_cjs_namespaceObject = require("../utils/range.cjs");
|
|
36
|
+
function FormDateRangePicker({ field: _field, valueMode, emptyValue, dateMode, defaultTime, component: DateRangePicker2 = react_namespaceObject.DateRangePicker, ...rest }) {
|
|
37
37
|
const field = _field;
|
|
38
38
|
const context = (0, external_react_namespaceObject.useContext)(external_FormProvider_cjs_namespaceObject.FormContext);
|
|
39
39
|
emptyValue ??= context.emptyValue;
|
|
40
40
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DateRangePicker2, {
|
|
41
|
-
value: (0,
|
|
42
|
-
onChange: (0,
|
|
41
|
+
value: (0, range_cjs_namespaceObject.getFieldRangeValue)(field, dateMode),
|
|
42
|
+
onChange: (0, range_cjs_namespaceObject.getOnRangeChange)({
|
|
43
43
|
field,
|
|
44
44
|
valueMode,
|
|
45
|
-
emptyValue
|
|
45
|
+
emptyValue,
|
|
46
|
+
defaultTime
|
|
46
47
|
}),
|
|
47
48
|
...(0, getFieldProps_cjs_namespaceObject.getFieldProps)(field),
|
|
48
49
|
...rest
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { DateRangePicker, DateRangePickerProps, DateValue } from "@heroui/react";
|
|
2
1
|
import { ReactNode } from "react";
|
|
2
|
+
import { DateRangePicker, DateRangePickerProps, DateValue } from "@heroui/react";
|
|
3
3
|
import { FieldComponentProps } from "soda-tanstack-form";
|
|
4
4
|
import { StrictOmit } from "soda-type";
|
|
5
|
-
import { DateMode } from "../utils/parseTime";
|
|
6
5
|
import { EmptyValue } from "./FormProvider";
|
|
7
|
-
import {
|
|
6
|
+
import { DateMode } from "../utils/parseTime";
|
|
7
|
+
import { RangeDefaultTime } from "../utils/range";
|
|
8
|
+
import { TimeValueMode, TimeValueModeMap } from "../utils/time";
|
|
8
9
|
export interface FormDateRangePickerProps<ValueMode extends TimeValueMode = "date", FieldValue extends [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined = [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined> extends StrictOmit<FieldComponentProps<typeof DateRangePicker, FieldValue>, never> {
|
|
9
10
|
valueMode?: ValueMode;
|
|
10
11
|
emptyValue?: EmptyValue;
|
|
11
12
|
dateMode?: DateMode;
|
|
13
|
+
defaultTime?: RangeDefaultTime | (() => RangeDefaultTime);
|
|
12
14
|
component?: <T extends DateValue>(props: DateRangePickerProps<T>) => ReactNode;
|
|
13
15
|
}
|
|
14
|
-
export declare function FormDateRangePicker<ValueMode extends TimeValueMode = "date", FieldValue extends [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined = [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined>({ field: _field, valueMode, emptyValue, dateMode, component: DateRangePicker2, ...rest }: FormDateRangePickerProps<ValueMode, FieldValue>): ReactNode;
|
|
16
|
+
export declare function FormDateRangePicker<ValueMode extends TimeValueMode = "date", FieldValue extends [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined = [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined>({ field: _field, valueMode, emptyValue, dateMode, defaultTime, component: DateRangePicker2, ...rest }: FormDateRangePickerProps<ValueMode, FieldValue>): ReactNode;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
-
import * as
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
|
|
7
|
-
import * as
|
|
8
|
-
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_range_js_50638587__ from "../utils/range.js";
|
|
8
|
+
function FormDateRangePicker({ field: _field, valueMode, emptyValue, dateMode, defaultTime, component: DateRangePicker2 = __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__.DateRangePicker, ...rest }) {
|
|
9
9
|
const field = _field;
|
|
10
10
|
const context = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__.FormContext);
|
|
11
11
|
emptyValue ??= context.emptyValue;
|
|
12
12
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(DateRangePicker2, {
|
|
13
|
-
value: (0,
|
|
14
|
-
onChange: (0,
|
|
13
|
+
value: (0, __WEBPACK_EXTERNAL_MODULE__utils_range_js_50638587__.getFieldRangeValue)(field, dateMode),
|
|
14
|
+
onChange: (0, __WEBPACK_EXTERNAL_MODULE__utils_range_js_50638587__.getOnRangeChange)({
|
|
15
15
|
field,
|
|
16
16
|
valueMode,
|
|
17
|
-
emptyValue
|
|
17
|
+
emptyValue,
|
|
18
|
+
defaultTime
|
|
18
19
|
}),
|
|
19
20
|
...(0, __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__.getFieldProps)(field),
|
|
20
21
|
...rest
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, InputProps, MergeWithAs } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, InputProps, MergeWithAs } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormInputProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, InputProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, InputOtpProps, MergeWithAs } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, InputOtpProps, MergeWithAs } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormInputOtpProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, InputOtpProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, MergeWithAs, NumberInputProps } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, NumberInputProps } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormNumberInputProps<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, NumberInputProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, MergeWithAs, PaginationProps } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, PaginationProps } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormPaginationProps<FieldValue extends number | null | undefined = number | null | undefined, AsComponent extends As = "nav"> = MergeWithAs<ComponentPropsWithoutRef<"nav">, ComponentPropsWithoutRef<AsComponent>, PaginationProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -30,8 +30,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
FormContext: ()=>FormContext
|
|
31
31
|
});
|
|
32
32
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
33
|
-
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
34
33
|
const external_react_namespaceObject = require("react");
|
|
34
|
+
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
35
35
|
function getEmptyValue(value) {
|
|
36
36
|
return "undefined" === value ? void 0 : null;
|
|
37
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
|
|
5
5
|
function getEmptyValue(value) {
|
|
6
6
|
return "undefined" === value ? void 0 : null;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { As, MergeWithAs, RadioGroupProps } from "@heroui/react";
|
|
2
1
|
import { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { As, MergeWithAs, RadioGroupProps } from "@heroui/react";
|
|
3
3
|
import { Field } from "soda-tanstack-form";
|
|
4
4
|
export type FormRadioGroupProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "div"> = MergeWithAs<ComponentPropsWithoutRef<"div">, ComponentPropsWithoutRef<AsComponent>, RadioGroupProps, AsComponent> & {
|
|
5
5
|
field: Field<FieldValue>;
|
|
@@ -25,78 +25,33 @@ var __webpack_require__ = {};
|
|
|
25
25
|
var __webpack_exports__ = {};
|
|
26
26
|
__webpack_require__.r(__webpack_exports__);
|
|
27
27
|
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
-
|
|
29
|
-
FormRangeCalendar: ()=>FormRangeCalendar,
|
|
30
|
-
getFieldRangeValue: ()=>getFieldRangeValue,
|
|
31
|
-
getRangeValue: ()=>getRangeValue,
|
|
32
|
-
getOnRangeChange: ()=>getOnRangeChange
|
|
28
|
+
FormRangeCalendar: ()=>FormRangeCalendar
|
|
33
29
|
});
|
|
34
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
35
|
-
const react_namespaceObject = require("@heroui/react");
|
|
36
|
-
const external_deepsea_tools_namespaceObject = require("deepsea-tools");
|
|
37
31
|
const external_react_namespaceObject = require("react");
|
|
38
|
-
const
|
|
39
|
-
const getTimeValue_cjs_namespaceObject = require("../utils/getTimeValue.cjs");
|
|
40
|
-
const parseTime_cjs_namespaceObject = require("../utils/parseTime.cjs");
|
|
32
|
+
const react_namespaceObject = require("@heroui/react");
|
|
41
33
|
const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
end: (0, parseTime_cjs_namespaceObject.parseTime)(value[1].valueOf(), dateMode)
|
|
46
|
-
} : null;
|
|
47
|
-
}
|
|
48
|
-
function getFieldRangeValue(field, dateMode) {
|
|
49
|
-
return getRangeValue(field.state.value, dateMode);
|
|
50
|
-
}
|
|
51
|
-
function getRangeUpdater({ value, valueMode, emptyValue }) {
|
|
52
|
-
if (!(0, external_deepsea_tools_namespaceObject.isNonNullable)(value)) return (0, external_FormProvider_cjs_namespaceObject.getEmptyValue)(emptyValue);
|
|
53
|
-
if ("timestamp" === valueMode) return [
|
|
54
|
-
(0, getTimeValue_cjs_namespaceObject.getTimeValue)(value.start),
|
|
55
|
-
(0, getTimeValue_cjs_namespaceObject.getTimeValue)(value.end)
|
|
56
|
-
];
|
|
57
|
-
function updater(prev) {
|
|
58
|
-
return prev?.[0] instanceof Date && prev?.[1] instanceof Date && prev[0].valueOf() === value.start.valueOf() && prev[1].valueOf() === value.end.valueOf() ? prev : [
|
|
59
|
-
new Date((0, getTimeValue_cjs_namespaceObject.getTimeValue)(value.start)),
|
|
60
|
-
new Date((0, getTimeValue_cjs_namespaceObject.getTimeValue)(value.end))
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
return updater;
|
|
64
|
-
}
|
|
65
|
-
function getOnRangeChange({ field, valueMode, emptyValue }) {
|
|
66
|
-
return function(value) {
|
|
67
|
-
field.handleChange(getRangeUpdater({
|
|
68
|
-
value,
|
|
69
|
-
valueMode,
|
|
70
|
-
emptyValue
|
|
71
|
-
}));
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function FormRangeCalendar({ field: _field, valueMode, emptyValue, dateMode, component: RangeCalendar2 = react_namespaceObject.RangeCalendar, ...rest }) {
|
|
34
|
+
const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
|
|
35
|
+
const range_cjs_namespaceObject = require("../utils/range.cjs");
|
|
36
|
+
function FormRangeCalendar({ field: _field, valueMode, emptyValue, dateMode, defaultTime, component: RangeCalendar2 = react_namespaceObject.RangeCalendar, ...rest }) {
|
|
75
37
|
const field = _field;
|
|
76
38
|
const context = (0, external_react_namespaceObject.useContext)(external_FormProvider_cjs_namespaceObject.FormContext);
|
|
77
39
|
emptyValue ??= context.emptyValue;
|
|
78
40
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(RangeCalendar2, {
|
|
79
|
-
value: getFieldRangeValue(field, dateMode),
|
|
80
|
-
onChange: getOnRangeChange({
|
|
41
|
+
value: (0, range_cjs_namespaceObject.getFieldRangeValue)(field, dateMode),
|
|
42
|
+
onChange: (0, range_cjs_namespaceObject.getOnRangeChange)({
|
|
81
43
|
field,
|
|
82
44
|
valueMode,
|
|
83
|
-
emptyValue
|
|
45
|
+
emptyValue,
|
|
46
|
+
defaultTime
|
|
84
47
|
}),
|
|
85
48
|
...(0, getFieldProps_cjs_namespaceObject.getFieldProps)(field),
|
|
86
49
|
...rest
|
|
87
50
|
});
|
|
88
51
|
}
|
|
89
52
|
exports.FormRangeCalendar = __webpack_exports__.FormRangeCalendar;
|
|
90
|
-
exports.getFieldRangeValue = __webpack_exports__.getFieldRangeValue;
|
|
91
|
-
exports.getOnRangeChange = __webpack_exports__.getOnRangeChange;
|
|
92
|
-
exports.getRangeUpdater = __webpack_exports__.getRangeUpdater;
|
|
93
|
-
exports.getRangeValue = __webpack_exports__.getRangeValue;
|
|
94
53
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
95
|
-
"FormRangeCalendar"
|
|
96
|
-
"getFieldRangeValue",
|
|
97
|
-
"getOnRangeChange",
|
|
98
|
-
"getRangeUpdater",
|
|
99
|
-
"getRangeValue"
|
|
54
|
+
"FormRangeCalendar"
|
|
100
55
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
101
56
|
Object.defineProperty(exports, '__esModule', {
|
|
102
57
|
value: true
|
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { DateValue, RangeCalendar, RangeCalendarProps } from "@heroui/react";
|
|
3
|
+
import { FieldComponentProps } from "soda-tanstack-form";
|
|
4
4
|
import { StrictOmit } from "soda-type";
|
|
5
|
-
import { DateMode } from "../utils/parseTime";
|
|
6
5
|
import { EmptyValue } from "./FormProvider";
|
|
7
|
-
import {
|
|
6
|
+
import { DateMode } from "../utils/parseTime";
|
|
7
|
+
import { RangeDefaultTime } from "../utils/range";
|
|
8
|
+
import { TimeValueMode, TimeValueModeMap } from "../utils/time";
|
|
8
9
|
export interface FormRangeCalendarProps<ValueMode extends TimeValueMode = "date", FieldValue extends [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined = [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined> extends StrictOmit<FieldComponentProps<typeof RangeCalendar, FieldValue>, never> {
|
|
9
10
|
valueMode?: ValueMode;
|
|
10
11
|
emptyValue?: EmptyValue;
|
|
11
12
|
dateMode?: DateMode;
|
|
13
|
+
defaultTime?: RangeDefaultTime | (() => RangeDefaultTime);
|
|
12
14
|
component?: <T extends DateValue>(props: RangeCalendarProps<T>) => ReactNode;
|
|
13
15
|
}
|
|
14
|
-
export declare function
|
|
15
|
-
export declare function getFieldRangeValue<T extends [Date, Date] | [number, number] | null | undefined, P extends DateMode>(field: Field<T>, dateMode?: P): RangeValue<DateValue> | null;
|
|
16
|
-
export interface GetRangeUpdaterParams {
|
|
17
|
-
value: RangeValue<DateValue> | null;
|
|
18
|
-
valueMode?: TimeValueMode;
|
|
19
|
-
emptyValue?: EmptyValue;
|
|
20
|
-
}
|
|
21
|
-
export declare function getRangeUpdater({ value, valueMode, emptyValue }: GetRangeUpdaterParams): SetStateAction<[Date, Date] | [number, number] | null | undefined>;
|
|
22
|
-
export interface GetOnRangeChangeParams<T extends [Date, Date] | [number, number] | null | undefined> {
|
|
23
|
-
field: Field<T>;
|
|
24
|
-
valueMode?: TimeValueMode;
|
|
25
|
-
emptyValue?: EmptyValue;
|
|
26
|
-
}
|
|
27
|
-
export declare function getOnRangeChange<T extends [Date, Date] | [number, number] | null | undefined>({ field, valueMode, emptyValue }: GetOnRangeChangeParams<T>): (value: RangeValue<DateValue> | null) => void;
|
|
28
|
-
export declare function FormRangeCalendar<ValueMode extends TimeValueMode = "date", FieldValue extends [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined = [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined>({ field: _field, valueMode, emptyValue, dateMode, component: RangeCalendar2, ...rest }: FormRangeCalendarProps<ValueMode, FieldValue>): ReactNode;
|
|
16
|
+
export declare function FormRangeCalendar<ValueMode extends TimeValueMode = "date", FieldValue extends [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined = [TimeValueModeMap<ValueMode>, TimeValueModeMap<ValueMode>] | null | undefined>({ field: _field, valueMode, emptyValue, dateMode, defaultTime, component: RangeCalendar2, ...rest }: FormRangeCalendarProps<ValueMode, FieldValue>): ReactNode;
|