@react-aria/datepicker 3.5.0 → 3.6.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/module.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {createFocusManager as $cIPI0$createFocusManager, getFocusableTreeWalker as $cIPI0$getFocusableTreeWalker} from "@react-aria/focus";
2
- import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, filterDOMProps as $cIPI0$filterDOMProps, mergeProps as $cIPI0$mergeProps, isMac as $cIPI0$isMac, scrollIntoViewport as $cIPI0$scrollIntoViewport, getScrollParent as $cIPI0$getScrollParent, useEvent as $cIPI0$useEvent, useLayoutEffect as $cIPI0$useLayoutEffect, isIOS as $cIPI0$isIOS, useLabels as $cIPI0$useLabels} from "@react-aria/utils";
2
+ import {useId as $cIPI0$useId, useDescription as $cIPI0$useDescription, filterDOMProps as $cIPI0$filterDOMProps, mergeProps as $cIPI0$mergeProps, useFormReset as $cIPI0$useFormReset, isMac as $cIPI0$isMac, scrollIntoViewport as $cIPI0$scrollIntoViewport, getScrollParent as $cIPI0$getScrollParent, useEvent as $cIPI0$useEvent, useLayoutEffect as $cIPI0$useLayoutEffect, isIOS as $cIPI0$isIOS, useLabels as $cIPI0$useLabels} from "@react-aria/utils";
3
3
  import $cIPI0$react, {useMemo as $cIPI0$useMemo, useRef as $cIPI0$useRef, useEffect as $cIPI0$useEffect} from "react";
4
4
  import {useField as $cIPI0$useField} from "@react-aria/label";
5
5
  import {useFocusWithin as $cIPI0$useFocusWithin, usePress as $cIPI0$usePress} from "@react-aria/interactions";
@@ -886,6 +886,7 @@ const $16f0b7bb276bc17e$export$653eddfc964b0f8a = new WeakMap();
886
886
  const $16f0b7bb276bc17e$export$300019f83c56d282 = "__role_" + Date.now();
887
887
  const $16f0b7bb276bc17e$export$7b3062cd49e80452 = "__focusManager_" + Date.now();
888
888
  function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
889
+ var _state_value;
889
890
  let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
890
891
  ...props,
891
892
  labelElementType: "span"
@@ -950,6 +951,7 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
950
951
  }, [
951
952
  focusManager
952
953
  ]);
954
+ (0, $cIPI0$useFormReset)(props.inputRef, state.value, state.setValue);
953
955
  let domProps = (0, $cIPI0$filterDOMProps)(props);
954
956
  return {
955
957
  labelProps: {
@@ -966,12 +968,20 @@ function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
966
968
  if (props.onKeyUp) props.onKeyUp(e);
967
969
  }
968
970
  }),
971
+ inputProps: {
972
+ type: "hidden",
973
+ name: props.name,
974
+ value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ""
975
+ },
969
976
  descriptionProps: descriptionProps,
970
977
  errorMessageProps: errorMessageProps
971
978
  };
972
979
  }
973
980
  function $16f0b7bb276bc17e$export$4c842f6a241dc825(props, state, ref) {
974
- return $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref);
981
+ var _state_timeValue;
982
+ let res = $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref);
983
+ res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || "";
984
+ return res;
975
985
  }
976
986
 
977
987
 
@@ -1052,7 +1062,8 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
1052
1062
  isReadOnly: props.isReadOnly,
1053
1063
  isRequired: props.isRequired,
1054
1064
  validationState: state.validationState,
1055
- autoFocus: props.autoFocus
1065
+ autoFocus: props.autoFocus,
1066
+ name: props.name
1056
1067
  },
1057
1068
  descriptionProps: descriptionProps,
1058
1069
  errorMessageProps: errorMessageProps,
@@ -1595,13 +1606,15 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
1595
1606
  ...commonFieldProps,
1596
1607
  value: (_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.start,
1597
1608
  onChange: (start)=>state.setDateTime("start", start),
1598
- autoFocus: props.autoFocus
1609
+ autoFocus: props.autoFocus,
1610
+ name: props.startName
1599
1611
  },
1600
1612
  endFieldProps: {
1601
1613
  ...endFieldProps,
1602
1614
  ...commonFieldProps,
1603
1615
  value: (_state_value1 = state.value) === null || _state_value1 === void 0 ? void 0 : _state_value1.end,
1604
- onChange: (end)=>state.setDateTime("end", end)
1616
+ onChange: (end)=>state.setDateTime("end", end),
1617
+ name: props.endName
1605
1618
  },
1606
1619
  descriptionProps: descriptionProps,
1607
1620
  errorMessageProps: errorMessageProps,