@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/import.mjs 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,
package/dist/main.js CHANGED
@@ -896,6 +896,7 @@ const $4acc2f407c169e55$export$653eddfc964b0f8a = new WeakMap();
896
896
  const $4acc2f407c169e55$export$300019f83c56d282 = "__role_" + Date.now();
897
897
  const $4acc2f407c169e55$export$7b3062cd49e80452 = "__focusManager_" + Date.now();
898
898
  function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
899
+ var _state_value;
899
900
  let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
900
901
  ...props,
901
902
  labelElementType: "span"
@@ -960,6 +961,7 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
960
961
  }, [
961
962
  focusManager
962
963
  ]);
964
+ (0, $IwcIq$reactariautils.useFormReset)(props.inputRef, state.value, state.setValue);
963
965
  let domProps = (0, $IwcIq$reactariautils.filterDOMProps)(props);
964
966
  return {
965
967
  labelProps: {
@@ -976,12 +978,20 @@ function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
976
978
  if (props.onKeyUp) props.onKeyUp(e);
977
979
  }
978
980
  }),
981
+ inputProps: {
982
+ type: "hidden",
983
+ name: props.name,
984
+ value: ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.toString()) || ""
985
+ },
979
986
  descriptionProps: descriptionProps,
980
987
  errorMessageProps: errorMessageProps
981
988
  };
982
989
  }
983
990
  function $4acc2f407c169e55$export$4c842f6a241dc825(props, state, ref) {
984
- return $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref);
991
+ var _state_timeValue;
992
+ let res = $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref);
993
+ res.inputProps.value = ((_state_timeValue = state.timeValue) === null || _state_timeValue === void 0 ? void 0 : _state_timeValue.toString()) || "";
994
+ return res;
985
995
  }
986
996
 
987
997
 
@@ -1062,7 +1072,8 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
1062
1072
  isReadOnly: props.isReadOnly,
1063
1073
  isRequired: props.isRequired,
1064
1074
  validationState: state.validationState,
1065
- autoFocus: props.autoFocus
1075
+ autoFocus: props.autoFocus,
1076
+ name: props.name
1066
1077
  },
1067
1078
  descriptionProps: descriptionProps,
1068
1079
  errorMessageProps: errorMessageProps,
@@ -1605,13 +1616,15 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
1605
1616
  ...commonFieldProps,
1606
1617
  value: (_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.start,
1607
1618
  onChange: (start)=>state.setDateTime("start", start),
1608
- autoFocus: props.autoFocus
1619
+ autoFocus: props.autoFocus,
1620
+ name: props.startName
1609
1621
  },
1610
1622
  endFieldProps: {
1611
1623
  ...endFieldProps,
1612
1624
  ...commonFieldProps,
1613
1625
  value: (_state_value1 = state.value) === null || _state_value1 === void 0 ? void 0 : _state_value1.end,
1614
- onChange: (end)=>state.setDateTime("end", end)
1626
+ onChange: (end)=>state.setDateTime("end", end),
1627
+ name: props.endName
1615
1628
  },
1616
1629
  descriptionProps: descriptionProps,
1617
1630
  errorMessageProps: errorMessageProps,