soda-heroui 0.9.0 → 0.9.1

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.
Files changed (62) hide show
  1. package/dist/components/AutoRefresh.d.ts +1 -1
  2. package/dist/components/FormAutocomplete.d.ts +1 -1
  3. package/dist/components/FormCalendar.cjs +1 -1
  4. package/dist/components/FormCalendar.d.ts +1 -1
  5. package/dist/components/FormCalendar.js +1 -1
  6. package/dist/components/FormCheckbox.d.ts +1 -1
  7. package/dist/components/FormCheckboxGroup.d.ts +1 -1
  8. package/dist/components/FormDateInput.cjs +1 -1
  9. package/dist/components/FormDateInput.d.ts +1 -1
  10. package/dist/components/FormDateInput.js +1 -1
  11. package/dist/components/FormDatePicker.cjs +1 -1
  12. package/dist/components/FormDatePicker.d.ts +1 -1
  13. package/dist/components/FormDatePicker.js +1 -1
  14. package/dist/components/FormDateRangePicker.cjs +1 -1
  15. package/dist/components/FormDateRangePicker.d.ts +1 -1
  16. package/dist/components/FormDateRangePicker.js +1 -1
  17. package/dist/components/FormInput.d.ts +1 -1
  18. package/dist/components/FormInputOtp.d.ts +1 -1
  19. package/dist/components/FormNumberInput.d.ts +1 -1
  20. package/dist/components/FormPagination.d.ts +1 -1
  21. package/dist/components/FormProvider.cjs +1 -1
  22. package/dist/components/FormProvider.js +1 -1
  23. package/dist/components/FormRadioGroup.d.ts +1 -1
  24. package/dist/components/FormRangeCalendar.cjs +1 -1
  25. package/dist/components/FormRangeCalendar.d.ts +1 -1
  26. package/dist/components/FormRangeCalendar.js +1 -1
  27. package/dist/components/FormSelect.cjs +1 -1
  28. package/dist/components/FormSelect.d.ts +1 -1
  29. package/dist/components/FormSelect.js +1 -1
  30. package/dist/components/FormSwitch.d.ts +1 -1
  31. package/dist/components/FormTextarea.d.ts +1 -1
  32. package/dist/components/FormTimeInput.cjs +1 -1
  33. package/dist/components/FormTimeInput.d.ts +1 -1
  34. package/dist/components/FormTimeInput.js +1 -1
  35. package/dist/utils/getTimeValue.cjs +11 -2
  36. package/dist/utils/getTimeValue.js +11 -2
  37. package/dist/utils/parseTime.cjs +1 -1
  38. package/dist/utils/parseTime.js +1 -1
  39. package/package.json +4 -4
  40. package/src/components/AutoRefresh.tsx +1 -1
  41. package/src/components/ErrorMessage.tsx +1 -1
  42. package/src/components/FormAutocomplete.tsx +1 -1
  43. package/src/components/FormCalendar.tsx +1 -1
  44. package/src/components/FormCheckbox.tsx +1 -1
  45. package/src/components/FormCheckboxGroup.tsx +1 -1
  46. package/src/components/FormDateInput.tsx +1 -1
  47. package/src/components/FormDatePicker.tsx +2 -2
  48. package/src/components/FormDateRangePicker.tsx +1 -1
  49. package/src/components/FormInput.tsx +1 -1
  50. package/src/components/FormInputOtp.tsx +1 -1
  51. package/src/components/FormNumberInput.tsx +1 -1
  52. package/src/components/FormPagination.tsx +1 -1
  53. package/src/components/FormProvider.tsx +1 -1
  54. package/src/components/FormRadioGroup.tsx +1 -1
  55. package/src/components/FormRangeCalendar.tsx +1 -1
  56. package/src/components/FormSelect.tsx +1 -1
  57. package/src/components/FormSwitch.tsx +1 -1
  58. package/src/components/FormTextarea.tsx +1 -1
  59. package/src/components/FormTimeInput.tsx +1 -1
  60. package/src/types/index.ts +1 -1
  61. package/src/utils/getTimeValue.ts +12 -2
  62. package/src/utils/parseTime.ts +1 -1
@@ -1,5 +1,5 @@
1
- import { FC, ReactNode } from "react";
2
1
  import { addToast } from "@heroui/react";
2
+ import { FC, ReactNode } from "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 { ReactNode } from "react";
2
1
  import { Autocomplete, AutocompleteProps } from "@heroui/react";
2
+ import { ReactNode } from "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,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  FormCalendar: ()=>FormCalendar
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_react_namespaceObject = require("react");
32
31
  const react_namespaceObject = require("@heroui/react");
32
+ const external_react_namespaceObject = require("react");
33
33
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
34
34
  const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
35
35
  const external_FormTimeInput_cjs_namespaceObject = require("./FormTimeInput.cjs");
@@ -1,5 +1,5 @@
1
- import { ReactNode } from "react";
2
1
  import { Calendar, CalendarProps, DateValue } from "@heroui/react";
2
+ import { ReactNode } from "react";
3
3
  import { FieldComponentProps } from "soda-tanstack-form";
4
4
  import { StrictOmit } from "soda-type";
5
5
  import { DateMode } from "../utils/parseTime";
@@ -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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__FormTimeInput_js_9364800a__ from "./FormTimeInput.js";
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, CheckboxProps, MergeWithAs } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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 { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, CheckboxGroupProps, MergeWithAs } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  FormDateInput: ()=>FormDateInput
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_react_namespaceObject = require("react");
32
31
  const react_namespaceObject = require("@heroui/react");
32
+ const external_react_namespaceObject = require("react");
33
33
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
34
34
  const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
35
35
  const external_FormTimeInput_cjs_namespaceObject = require("./FormTimeInput.cjs");
@@ -1,5 +1,5 @@
1
- import { ReactNode } from "react";
2
1
  import { DateInput, DateInputProps, DateValue } from "@heroui/react";
2
+ import { ReactNode } from "react";
3
3
  import { FieldComponentProps } from "soda-tanstack-form";
4
4
  import { StrictOmit } from "soda-type";
5
5
  import { DateMode } from "../utils/parseTime";
@@ -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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__FormTimeInput_js_9364800a__ from "./FormTimeInput.js";
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  FormDatePicker: ()=>FormDatePicker
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_react_namespaceObject = require("react");
32
31
  const react_namespaceObject = require("@heroui/react");
32
+ const external_react_namespaceObject = require("react");
33
33
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
34
34
  const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
35
35
  const external_FormTimeInput_cjs_namespaceObject = require("./FormTimeInput.cjs");
@@ -1,5 +1,5 @@
1
- import { ReactNode } from "react";
2
1
  import { DatePicker, DatePickerProps, DateValue } from "@heroui/react";
2
+ import { ReactNode } from "react";
3
3
  import { FieldComponentProps } from "soda-tanstack-form";
4
4
  import { StrictOmit } from "soda-type";
5
5
  import { DateMode } from "../utils/parseTime";
@@ -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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__FormTimeInput_js_9364800a__ from "./FormTimeInput.js";
@@ -28,8 +28,8 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  FormDateRangePicker: ()=>FormDateRangePicker
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_react_namespaceObject = require("react");
32
31
  const react_namespaceObject = require("@heroui/react");
32
+ const external_react_namespaceObject = require("react");
33
33
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
34
34
  const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
35
35
  const external_FormRangeCalendar_cjs_namespaceObject = require("./FormRangeCalendar.cjs");
@@ -1,5 +1,5 @@
1
- import { ReactNode } from "react";
2
1
  import { DateRangePicker, DateRangePickerProps, DateValue } from "@heroui/react";
2
+ import { ReactNode } from "react";
3
3
  import { FieldComponentProps } from "soda-tanstack-form";
4
4
  import { StrictOmit } from "soda-type";
5
5
  import { DateMode } from "../utils/parseTime";
@@ -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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__FormRangeCalendar_js_70d23bc2__ from "./FormRangeCalendar.js";
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, InputProps, MergeWithAs } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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 { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, InputOtpProps, MergeWithAs } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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 { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, MergeWithAs, NumberInputProps } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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 { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, MergeWithAs, PaginationProps } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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_react_namespaceObject = require("react");
34
33
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
34
+ const external_react_namespaceObject = require("react");
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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
5
5
  function getEmptyValue(value) {
6
6
  return "undefined" === value ? void 0 : null;
7
7
  }
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, MergeWithAs, RadioGroupProps } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "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>;
@@ -32,9 +32,9 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  getOnRangeChange: ()=>getOnRangeChange
33
33
  });
34
34
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
35
- const external_react_namespaceObject = require("react");
36
35
  const react_namespaceObject = require("@heroui/react");
37
36
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
37
+ const external_react_namespaceObject = require("react");
38
38
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
39
39
  const getTimeValue_cjs_namespaceObject = require("../utils/getTimeValue.cjs");
40
40
  const parseTime_cjs_namespaceObject = require("../utils/parseTime.cjs");
@@ -1,5 +1,5 @@
1
- import { ReactNode, SetStateAction } from "react";
2
1
  import { DateValue, RangeCalendar, RangeCalendarProps, RangeValue } from "@heroui/react";
2
+ import { ReactNode, SetStateAction } from "react";
3
3
  import { Field, FieldComponentProps } from "soda-tanstack-form";
4
4
  import { StrictOmit } from "soda-type";
5
5
  import { DateMode } from "../utils/parseTime";
@@ -1,8 +1,8 @@
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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
5
4
  import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getTimeValue_js_9ba8f683__ from "../utils/getTimeValue.js";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE__utils_parseTime_js_d0890db8__ from "../utils/parseTime.js";
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
28
28
  FormSelect: ()=>FormSelect
29
29
  });
30
30
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const external_react_namespaceObject = require("react");
32
31
  const react_namespaceObject = require("@heroui/react");
33
32
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
33
+ const external_react_namespaceObject = require("react");
34
34
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
35
35
  const external_FormProvider_cjs_namespaceObject = require("./FormProvider.cjs");
36
36
  function FormSelect({ field, multiple, emptyValue, component: Select2 = react_namespaceObject.Select, ...rest }) {
@@ -1,6 +1,6 @@
1
- import { ReactNode } from "react";
2
1
  import { Select, SelectProps } from "@heroui/react";
3
2
  import { Key } from "@react-types/shared";
3
+ import { ReactNode } from "react";
4
4
  import { FieldComponentProps } from "soda-tanstack-form";
5
5
  import { StrictOmit } from "soda-type";
6
6
  import { EmptyValue } from "./FormProvider";
@@ -1,8 +1,8 @@
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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
5
4
  import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__FormProvider_js_a80efa64__ from "./FormProvider.js";
8
8
  function FormSelect({ field, multiple, emptyValue, component: Select2 = __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__.Select, ...rest }) {
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, MergeWithAs, SwitchProps } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
3
3
  import { Field } from "soda-tanstack-form";
4
4
  export type FormSwitchProps<FieldValue extends boolean | null | undefined = boolean | null | undefined, AsComponent extends As = "input"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, SwitchProps, AsComponent> & {
5
5
  field: Field<FieldValue>;
@@ -1,5 +1,5 @@
1
- import { ComponentPropsWithoutRef, ReactNode } from "react";
2
1
  import { As, MergeWithAs, TextAreaProps } from "@heroui/react";
2
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
3
3
  import { Field } from "soda-tanstack-form";
4
4
  export type FormTextareaProps<FieldValue extends string | null | undefined = string | null | undefined, AsComponent extends As = "textarea"> = MergeWithAs<ComponentPropsWithoutRef<"input">, ComponentPropsWithoutRef<AsComponent>, TextAreaProps, AsComponent> & {
5
5
  field: Field<FieldValue>;
@@ -32,9 +32,9 @@ __webpack_require__.d(__webpack_exports__, {
32
32
  getValue: ()=>getValue
33
33
  });
34
34
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
35
- const external_react_namespaceObject = require("react");
36
35
  const react_namespaceObject = require("@heroui/react");
37
36
  const external_deepsea_tools_namespaceObject = require("deepsea-tools");
37
+ const external_react_namespaceObject = require("react");
38
38
  const getFieldProps_cjs_namespaceObject = require("../utils/getFieldProps.cjs");
39
39
  const getTimeValue_cjs_namespaceObject = require("../utils/getTimeValue.cjs");
40
40
  const parseTime_cjs_namespaceObject = require("../utils/parseTime.cjs");
@@ -1,6 +1,6 @@
1
- import { ReactNode, SetStateAction } from "react";
2
1
  import { TimeInput, TimeInputProps } from "@heroui/react";
3
2
  import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from "@internationalized/date";
3
+ import { ReactNode, SetStateAction } from "react";
4
4
  import { Field, FieldComponentProps } from "soda-tanstack-form";
5
5
  import { StrictOmit } from "soda-type";
6
6
  import { ParseMode, TimeMode } from "../utils/parseTime";
@@ -1,8 +1,8 @@
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_react__ from "react";
4
3
  import * as __WEBPACK_EXTERNAL_MODULE__heroui_react_7b65ca80__ from "@heroui/react";
5
4
  import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getFieldProps_js_0615ad2a__ from "../utils/getFieldProps.js";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__utils_getTimeValue_js_9ba8f683__ from "../utils/getTimeValue.js";
8
8
  import * as __WEBPACK_EXTERNAL_MODULE__utils_parseTime_js_d0890db8__ from "../utils/parseTime.js";
@@ -26,9 +26,18 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  getTimeValue: ()=>getTimeValue
28
28
  });
29
- const external_deepsea_tools_namespaceObject = require("deepsea-tools");
30
29
  function getTimeValue(time) {
31
- return (0, external_deepsea_tools_namespaceObject.isNonNullable)(time) ? new Date(time.toString().replace(/\[.+?\]$/, "")).valueOf() : void 0;
30
+ if (null == time) return;
31
+ const newTime = time;
32
+ const now = new Date();
33
+ const year = newTime.year ?? now.getFullYear();
34
+ const month = newTime.month ?? now.getMonth() + 1;
35
+ const day = newTime.day ?? now.getDate();
36
+ const hour = newTime.hour ?? now.getHours();
37
+ const minute = newTime.minute ?? now.getMinutes();
38
+ const second = newTime.second ?? now.getSeconds();
39
+ const millisecond = newTime.millisecond ?? now.getMilliseconds();
40
+ return new Date(`${year}/${month}/${day} ${hour}:${minute}:${second}.${millisecond}`).valueOf();
32
41
  }
33
42
  exports.getTimeValue = __webpack_exports__.getTimeValue;
34
43
  for(var __webpack_i__ in __webpack_exports__)if (-1 === [
@@ -1,5 +1,14 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__ from "deepsea-tools";
2
1
  function getTimeValue(time) {
3
- return (0, __WEBPACK_EXTERNAL_MODULE_deepsea_tools_8ecdf5a5__.isNonNullable)(time) ? new Date(time.toString().replace(/\[.+?\]$/, "")).valueOf() : void 0;
2
+ if (null == time) return;
3
+ const newTime = time;
4
+ const now = new Date();
5
+ const year = newTime.year ?? now.getFullYear();
6
+ const month = newTime.month ?? now.getMonth() + 1;
7
+ const day = newTime.day ?? now.getDate();
8
+ const hour = newTime.hour ?? now.getHours();
9
+ const minute = newTime.minute ?? now.getMinutes();
10
+ const second = newTime.second ?? now.getSeconds();
11
+ const millisecond = newTime.millisecond ?? now.getMilliseconds();
12
+ return new Date(`${year}/${month}/${day} ${hour}:${minute}:${second}.${millisecond}`).valueOf();
4
13
  }
5
14
  export { getTimeValue };
@@ -37,7 +37,7 @@ function parseTime(ms, type) {
37
37
  if (type === date_namespaceObject.ZonedDateTime) return (0, date_namespaceObject.fromAbsolute)(ms, (0, date_namespaceObject.getLocalTimeZone)());
38
38
  const date = new Date(ms);
39
39
  const year = date.getFullYear();
40
- const month = date.getMonth();
40
+ const month = date.getMonth() + 1;
41
41
  const day = date.getDate();
42
42
  const hour = date.getHours();
43
43
  const minute = date.getMinutes();
@@ -3,7 +3,7 @@ function parseTime(ms, type) {
3
3
  if (type === __WEBPACK_EXTERNAL_MODULE__internationalized_date_00f69a87__.ZonedDateTime) return (0, __WEBPACK_EXTERNAL_MODULE__internationalized_date_00f69a87__.fromAbsolute)(ms, (0, __WEBPACK_EXTERNAL_MODULE__internationalized_date_00f69a87__.getLocalTimeZone)());
4
4
  const date = new Date(ms);
5
5
  const year = date.getFullYear();
6
- const month = date.getMonth();
6
+ const month = date.getMonth() + 1;
7
7
  const day = date.getDate();
8
8
  const hour = date.getHours();
9
9
  const minute = date.getMinutes();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soda-heroui",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -37,10 +37,10 @@
37
37
  "dependencies": {
38
38
  "@internationalized/date": "^3.8.2",
39
39
  "@tanstack/react-form": "^1.14.1",
40
- "deepsea-tools": "5.38.2",
41
- "soda-type": "6.3.0",
42
40
  "soda-tanstack-form": "0.2.3",
43
- "soda-hooks": "6.12.0"
41
+ "soda-hooks": "6.12.0",
42
+ "deepsea-tools": "5.38.2",
43
+ "soda-type": "6.3.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@ianvs/prettier-plugin-sort-imports": "^4.5.1",
@@ -1,5 +1,5 @@
1
- import { FC, ReactNode } from "react"
2
1
  import { Button, PressEvent, addToast } from "@heroui/react"
2
+ import { FC, ReactNode } from "react"
3
3
  import { useAutoRefresh } from "soda-hooks"
4
4
  import { FirstParameter } from "soda-type"
5
5
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentProps, FC } from "react"
4
3
  import { isNonNullable } from "deepsea-tools"
4
+ import { ComponentProps, FC } from "react"
5
5
 
6
6
  export interface ErrorMessageItem {
7
7
  message: string
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { Key, ReactNode } from "react"
4
3
  import { Autocomplete, AutocompleteProps } from "@heroui/react"
4
+ import { Key, ReactNode } from "react"
5
5
  import { FieldComponentProps } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, useContext } from "react"
4
3
  import { Calendar, CalendarProps, DateValue } from "@heroui/react"
4
+ import { ReactNode, useContext } from "react"
5
5
  import { FieldComponentProps } from "soda-tanstack-form"
6
6
  import { StrictOmit } from "soda-type"
7
7
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, Checkbox, CheckboxProps, MergeWithAs } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, CheckboxGroup, CheckboxGroupProps, MergeWithAs } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, useContext } from "react"
4
3
  import { DateInput, DateInputProps, DateValue } from "@heroui/react"
4
+ import { ReactNode, useContext } from "react"
5
5
  import { FieldComponentProps } from "soda-tanstack-form"
6
6
  import { StrictOmit } from "soda-type"
7
7
 
@@ -1,11 +1,11 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, useContext } from "react"
4
3
  import { DatePicker, DatePickerProps, DateValue } from "@heroui/react"
4
+ import { ReactNode, useContext } from "react"
5
5
  import { FieldComponentProps } from "soda-tanstack-form"
6
6
  import { StrictOmit } from "soda-type"
7
7
 
8
- import { DateMode, TimeMode } from "@/utils/parseTime"
8
+ import { DateMode } from "@/utils/parseTime"
9
9
 
10
10
  import { getFieldProps } from "../utils/getFieldProps"
11
11
  import { EmptyValue, FormContext } from "./FormProvider"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, useContext } from "react"
4
3
  import { DateRangePicker, DateRangePickerProps, DateValue } from "@heroui/react"
4
+ import { ReactNode, useContext } from "react"
5
5
  import { Field, FieldComponentProps } from "soda-tanstack-form"
6
6
  import { StrictOmit } from "soda-type"
7
7
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, Input, InputProps, MergeWithAs } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, InputOtp, InputOtpProps, MergeWithAs } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, MergeWithAs, NumberInput, NumberInputProps } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, MergeWithAs, Pagination, PaginationProps } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { FC, ReactNode, createContext, useContext } from "react"
4
3
  import { assign } from "deepsea-tools"
4
+ import { FC, ReactNode, createContext, useContext } from "react"
5
5
 
6
6
  export type EmptyValue = "null" | "undefined"
7
7
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, MergeWithAs, RadioGroup, RadioGroupProps } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, SetStateAction, useContext } from "react"
4
3
  import { DateValue, RangeCalendar, RangeCalendarProps, RangeValue } from "@heroui/react"
5
4
  import { isNonNullable } from "deepsea-tools"
5
+ import { ReactNode, SetStateAction, useContext } from "react"
6
6
  import { Field, FieldComponentProps } from "soda-tanstack-form"
7
7
  import { StrictOmit } from "soda-type"
8
8
 
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, useContext } from "react"
4
3
  import { Select, SelectProps } from "@heroui/react"
5
4
  import { Key } from "@react-types/shared"
6
5
  import { isNonNullable } from "deepsea-tools"
6
+ import { ReactNode, useContext } from "react"
7
7
  import { FieldComponentProps } from "soda-tanstack-form"
8
8
  import { StrictOmit } from "soda-type"
9
9
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, MergeWithAs, Switch, SwitchProps } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { ComponentPropsWithoutRef, ReactNode } from "react"
4
3
  import { As, MergeWithAs, TextAreaProps, Textarea } from "@heroui/react"
4
+ import { ComponentPropsWithoutRef, ReactNode } from "react"
5
5
  import { Field } from "soda-tanstack-form"
6
6
 
7
7
  import { getFieldProps } from "../utils/getFieldProps"
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
 
3
- import { ReactNode, SetStateAction, useContext } from "react"
4
3
  import { TimeInput, TimeInputProps } from "@heroui/react"
5
4
  import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from "@internationalized/date"
6
5
  import { isNonNullable } from "deepsea-tools"
6
+ import { ReactNode, SetStateAction, useContext } from "react"
7
7
  import { Field, FieldComponentProps } from "soda-tanstack-form"
8
8
  import { StrictOmit } from "soda-type"
9
9
 
@@ -1 +1 @@
1
- export { type Field } from "soda-tanstack-form"
1
+ export { type Field } from "soda-tanstack-form"
@@ -1,8 +1,18 @@
1
1
  import { CalendarDate, CalendarDateTime, Time, ZonedDateTime } from "@internationalized/date"
2
- import { isNonNullable } from "deepsea-tools"
3
2
 
4
3
  export function getTimeValue<T extends CalendarDateTime | ZonedDateTime | Time | CalendarDate | null | undefined = undefined>(
5
4
  time?: T,
6
5
  ): T extends null | undefined ? undefined : number {
7
- return (isNonNullable(time) ? new Date(time.toString().replace(/\[.+?\]$/, "")).valueOf() : undefined) as T extends null | undefined ? undefined : number
6
+ type ReturnValue = T extends null | undefined ? undefined : number
7
+ if (time === undefined || time === null) return undefined as ReturnValue
8
+ const newTime = time as CalendarDateTime
9
+ const now = new Date()
10
+ const year = newTime.year ?? now.getFullYear()
11
+ const month = newTime.month ?? now.getMonth() + 1
12
+ const day = newTime.day ?? now.getDate()
13
+ const hour = newTime.hour ?? now.getHours()
14
+ const minute = newTime.minute ?? now.getMinutes()
15
+ const second = newTime.second ?? now.getSeconds()
16
+ const millisecond = newTime.millisecond ?? now.getMilliseconds()
17
+ return new Date(`${year}/${month}/${day} ${hour}:${minute}:${second}.${millisecond}`).valueOf() as ReturnValue
8
18
  }
@@ -12,7 +12,7 @@ export function parseTime<T extends ParseMode = typeof CalendarDateTime>(ms: num
12
12
  if (type === ZonedDateTime) return fromAbsolute(ms, getLocalTimeZone()) as InstanceType<T>
13
13
  const date = new Date(ms)
14
14
  const year = date.getFullYear()
15
- const month = date.getMonth()
15
+ const month = date.getMonth() + 1
16
16
  const day = date.getDate()
17
17
  const hour = date.getHours()
18
18
  const minute = date.getMinutes()