@react-aria/textfield 3.5.2 → 3.5.3

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/main.js CHANGED
@@ -1,7 +1,7 @@
1
- var $5GtoM$reactariautils = require("@react-aria/utils");
2
- var $5GtoM$reactarialabel = require("@react-aria/label");
3
- var $5GtoM$reactariafocus = require("@react-aria/focus");
4
- var $5GtoM$react = require("react");
1
+ var $iITAC$reactariautils = require("@react-aria/utils");
2
+ var $iITAC$reactarialabel = require("@react-aria/label");
3
+ var $iITAC$reactariafocus = require("@react-aria/focus");
4
+ var $iITAC$react = require("react");
5
5
 
6
6
  function $parcel$exportWildcard(dest, source) {
7
7
  Object.keys(source).forEach(function(key) {
@@ -22,18 +22,18 @@ function $parcel$exportWildcard(dest, source) {
22
22
  function $parcel$export(e, n, v, s) {
23
23
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
24
24
  }
25
- var $bebe07d66fab856a$exports = {};
25
+ var $9076f978e02df845$exports = {};
26
26
 
27
- $parcel$export($bebe07d66fab856a$exports, "useTextField", () => $bebe07d66fab856a$export$712718f7aec83d5);
27
+ $parcel$export($9076f978e02df845$exports, "useTextField", () => $9076f978e02df845$export$712718f7aec83d5);
28
28
 
29
29
 
30
30
 
31
- function $bebe07d66fab856a$export$712718f7aec83d5(props, ref) {
31
+ function $9076f978e02df845$export$712718f7aec83d5(props, ref) {
32
32
  let { inputElementType: inputElementType = 'input' , isDisabled: isDisabled = false , isRequired: isRequired = false , isReadOnly: isReadOnly = false , validationState: validationState , type: type = 'text' , onChange: onChange = ()=>{
33
33
  } } = props;
34
- let { focusableProps: focusableProps } = $5GtoM$reactariafocus.useFocusable(props, ref);
35
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $5GtoM$reactarialabel.useField(props);
36
- let domProps = $5GtoM$reactariautils.filterDOMProps(props, {
34
+ let { focusableProps: focusableProps } = $iITAC$reactariafocus.useFocusable(props, ref);
35
+ let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $iITAC$reactarialabel.useField(props);
36
+ let domProps = $iITAC$reactariautils.filterDOMProps(props, {
37
37
  labelable: true
38
38
  });
39
39
  const inputOnlyProps = {
@@ -42,7 +42,7 @@ function $bebe07d66fab856a$export$712718f7aec83d5(props, ref) {
42
42
  };
43
43
  return {
44
44
  labelProps: labelProps,
45
- inputProps: $5GtoM$reactariautils.mergeProps(domProps, inputElementType === 'input' && inputOnlyProps, {
45
+ inputProps: $iITAC$reactariautils.mergeProps(domProps, inputElementType === 'input' && inputOnlyProps, {
46
46
  disabled: isDisabled,
47
47
  readOnly: isReadOnly,
48
48
  'aria-required': isRequired || undefined,
@@ -83,18 +83,18 @@ function $bebe07d66fab856a$export$712718f7aec83d5(props, ref) {
83
83
  }
84
84
 
85
85
 
86
- var $264edc939d19dce3$exports = {};
86
+ var $56b68c3dab9bf16c$exports = {};
87
87
 
88
- $parcel$export($264edc939d19dce3$exports, "useFormattedTextField", () => $264edc939d19dce3$export$4f384c9210e583c3);
88
+ $parcel$export($56b68c3dab9bf16c$exports, "useFormattedTextField", () => $56b68c3dab9bf16c$export$4f384c9210e583c3);
89
89
 
90
90
 
91
91
 
92
- function $264edc939d19dce3$var$supportsNativeBeforeInputEvent() {
92
+ function $56b68c3dab9bf16c$var$supportsNativeBeforeInputEvent() {
93
93
  return typeof window !== 'undefined' && window.InputEvent && // @ts-ignore
94
94
  typeof InputEvent.prototype.getTargetRanges === 'function';
95
95
  }
96
- function $264edc939d19dce3$export$4f384c9210e583c3(props, state1, inputRef) {
97
- let stateRef = $5GtoM$react.useRef(state1);
96
+ function $56b68c3dab9bf16c$export$4f384c9210e583c3(props, state1, inputRef) {
97
+ let stateRef = $iITAC$react.useRef(state1);
98
98
  stateRef.current = state1;
99
99
  // All browsers implement the 'beforeinput' event natively except Firefox
100
100
  // (currently behind a flag as of Firefox 84). React's polyfill does not
@@ -102,8 +102,8 @@ function $264edc939d19dce3$export$4f384c9210e583c3(props, state1, inputRef) {
102
102
  // Use the native event if available so that we can prevent invalid deletions.
103
103
  // We do not attempt to polyfill this in Firefox since it would be very complicated,
104
104
  // the benefit of doing so is fairly minor, and it's going to be natively supported soon.
105
- $5GtoM$react.useEffect(()=>{
106
- if (!$264edc939d19dce3$var$supportsNativeBeforeInputEvent()) return;
105
+ $iITAC$react.useEffect(()=>{
106
+ if (!$56b68c3dab9bf16c$var$supportsNativeBeforeInputEvent()) return;
107
107
  let input = inputRef.current;
108
108
  let onBeforeInput = (e)=>{
109
109
  let state = stateRef.current;
@@ -152,14 +152,14 @@ function $264edc939d19dce3$export$4f384c9210e583c3(props, state1, inputRef) {
152
152
  inputRef,
153
153
  stateRef
154
154
  ]);
155
- let onBeforeInput1 = !$264edc939d19dce3$var$supportsNativeBeforeInputEvent() ? (e)=>{
155
+ let onBeforeInput1 = !$56b68c3dab9bf16c$var$supportsNativeBeforeInputEvent() ? (e)=>{
156
156
  let nextValue = e.target.value.slice(0, e.target.selectionStart) + e.data + e.target.value.slice(e.target.selectionEnd);
157
157
  if (!state1.validate(nextValue)) e.preventDefault();
158
158
  } : null;
159
- let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $bebe07d66fab856a$export$712718f7aec83d5(props, inputRef);
160
- let compositionStartState = $5GtoM$react.useRef(null);
159
+ let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $9076f978e02df845$export$712718f7aec83d5(props, inputRef);
160
+ let compositionStartState = $iITAC$react.useRef(null);
161
161
  return {
162
- inputProps: $5GtoM$reactariautils.mergeProps(textFieldProps, {
162
+ inputProps: $iITAC$reactariautils.mergeProps(textFieldProps, {
163
163
  onBeforeInput: onBeforeInput1,
164
164
  onCompositionStart () {
165
165
  // Chrome does not implement Input Events Level 2, which specifies the insertFromComposition
@@ -199,8 +199,8 @@ function $264edc939d19dce3$export$4f384c9210e583c3(props, state1, inputRef) {
199
199
  }
200
200
 
201
201
 
202
- $parcel$exportWildcard(module.exports, $bebe07d66fab856a$exports);
203
- $parcel$exportWildcard(module.exports, $264edc939d19dce3$exports);
202
+ $parcel$exportWildcard(module.exports, $9076f978e02df845$exports);
203
+ $parcel$exportWildcard(module.exports, $56b68c3dab9bf16c$exports);
204
204
 
205
205
 
206
206
  //# sourceMappingURL=main.js.map
package/dist/module.js CHANGED
@@ -1,23 +1,23 @@
1
- import {filterDOMProps as $aywJT$filterDOMProps, mergeProps as $aywJT$mergeProps} from "@react-aria/utils";
2
- import {useField as $aywJT$useField} from "@react-aria/label";
3
- import {useFocusable as $aywJT$useFocusable} from "@react-aria/focus";
4
- import {useRef as $aywJT$useRef, useEffect as $aywJT$useEffect} from "react";
1
+ import {filterDOMProps as $kOq5K$filterDOMProps, mergeProps as $kOq5K$mergeProps} from "@react-aria/utils";
2
+ import {useField as $kOq5K$useField} from "@react-aria/label";
3
+ import {useFocusable as $kOq5K$useFocusable} from "@react-aria/focus";
4
+ import {useRef as $kOq5K$useRef, useEffect as $kOq5K$useEffect} from "react";
5
5
 
6
6
  function $parcel$export(e, n, v, s) {
7
7
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
8
  }
9
- var $13fe50aacf882d03$exports = {};
9
+ var $2d73ec29415bd339$exports = {};
10
10
 
11
- $parcel$export($13fe50aacf882d03$exports, "useTextField", () => $13fe50aacf882d03$export$712718f7aec83d5);
11
+ $parcel$export($2d73ec29415bd339$exports, "useTextField", () => $2d73ec29415bd339$export$712718f7aec83d5);
12
12
 
13
13
 
14
14
 
15
- function $13fe50aacf882d03$export$712718f7aec83d5(props, ref) {
15
+ function $2d73ec29415bd339$export$712718f7aec83d5(props, ref) {
16
16
  let { inputElementType: inputElementType = 'input' , isDisabled: isDisabled = false , isRequired: isRequired = false , isReadOnly: isReadOnly = false , validationState: validationState , type: type = 'text' , onChange: onChange = ()=>{
17
17
  } } = props;
18
- let { focusableProps: focusableProps } = $aywJT$useFocusable(props, ref);
19
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $aywJT$useField(props);
20
- let domProps = $aywJT$filterDOMProps(props, {
18
+ let { focusableProps: focusableProps } = $kOq5K$useFocusable(props, ref);
19
+ let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $kOq5K$useField(props);
20
+ let domProps = $kOq5K$filterDOMProps(props, {
21
21
  labelable: true
22
22
  });
23
23
  const inputOnlyProps = {
@@ -26,7 +26,7 @@ function $13fe50aacf882d03$export$712718f7aec83d5(props, ref) {
26
26
  };
27
27
  return {
28
28
  labelProps: labelProps,
29
- inputProps: $aywJT$mergeProps(domProps, inputElementType === 'input' && inputOnlyProps, {
29
+ inputProps: $kOq5K$mergeProps(domProps, inputElementType === 'input' && inputOnlyProps, {
30
30
  disabled: isDisabled,
31
31
  readOnly: isReadOnly,
32
32
  'aria-required': isRequired || undefined,
@@ -67,18 +67,18 @@ function $13fe50aacf882d03$export$712718f7aec83d5(props, ref) {
67
67
  }
68
68
 
69
69
 
70
- var $58c0262056d833d5$exports = {};
70
+ var $d841c8010a73d545$exports = {};
71
71
 
72
- $parcel$export($58c0262056d833d5$exports, "useFormattedTextField", () => $58c0262056d833d5$export$4f384c9210e583c3);
72
+ $parcel$export($d841c8010a73d545$exports, "useFormattedTextField", () => $d841c8010a73d545$export$4f384c9210e583c3);
73
73
 
74
74
 
75
75
 
76
- function $58c0262056d833d5$var$supportsNativeBeforeInputEvent() {
76
+ function $d841c8010a73d545$var$supportsNativeBeforeInputEvent() {
77
77
  return typeof window !== 'undefined' && window.InputEvent && // @ts-ignore
78
78
  typeof InputEvent.prototype.getTargetRanges === 'function';
79
79
  }
80
- function $58c0262056d833d5$export$4f384c9210e583c3(props, state1, inputRef) {
81
- let stateRef = $aywJT$useRef(state1);
80
+ function $d841c8010a73d545$export$4f384c9210e583c3(props, state1, inputRef) {
81
+ let stateRef = $kOq5K$useRef(state1);
82
82
  stateRef.current = state1;
83
83
  // All browsers implement the 'beforeinput' event natively except Firefox
84
84
  // (currently behind a flag as of Firefox 84). React's polyfill does not
@@ -86,8 +86,8 @@ function $58c0262056d833d5$export$4f384c9210e583c3(props, state1, inputRef) {
86
86
  // Use the native event if available so that we can prevent invalid deletions.
87
87
  // We do not attempt to polyfill this in Firefox since it would be very complicated,
88
88
  // the benefit of doing so is fairly minor, and it's going to be natively supported soon.
89
- $aywJT$useEffect(()=>{
90
- if (!$58c0262056d833d5$var$supportsNativeBeforeInputEvent()) return;
89
+ $kOq5K$useEffect(()=>{
90
+ if (!$d841c8010a73d545$var$supportsNativeBeforeInputEvent()) return;
91
91
  let input = inputRef.current;
92
92
  let onBeforeInput = (e)=>{
93
93
  let state = stateRef.current;
@@ -136,14 +136,14 @@ function $58c0262056d833d5$export$4f384c9210e583c3(props, state1, inputRef) {
136
136
  inputRef,
137
137
  stateRef
138
138
  ]);
139
- let onBeforeInput1 = !$58c0262056d833d5$var$supportsNativeBeforeInputEvent() ? (e)=>{
139
+ let onBeforeInput1 = !$d841c8010a73d545$var$supportsNativeBeforeInputEvent() ? (e)=>{
140
140
  let nextValue = e.target.value.slice(0, e.target.selectionStart) + e.data + e.target.value.slice(e.target.selectionEnd);
141
141
  if (!state1.validate(nextValue)) e.preventDefault();
142
142
  } : null;
143
- let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $13fe50aacf882d03$export$712718f7aec83d5(props, inputRef);
144
- let compositionStartState = $aywJT$useRef(null);
143
+ let { labelProps: labelProps , inputProps: textFieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = $2d73ec29415bd339$export$712718f7aec83d5(props, inputRef);
144
+ let compositionStartState = $kOq5K$useRef(null);
145
145
  return {
146
- inputProps: $aywJT$mergeProps(textFieldProps, {
146
+ inputProps: $kOq5K$mergeProps(textFieldProps, {
147
147
  onBeforeInput: onBeforeInput1,
148
148
  onCompositionStart () {
149
149
  // Chrome does not implement Input Events Level 2, which specifies the insertFromComposition
@@ -185,5 +185,5 @@ function $58c0262056d833d5$export$4f384c9210e583c3(props, state1, inputRef) {
185
185
 
186
186
 
187
187
 
188
- export {$13fe50aacf882d03$export$712718f7aec83d5 as useTextField, $58c0262056d833d5$export$4f384c9210e583c3 as useFormattedTextField};
188
+ export {$2d73ec29415bd339$export$712718f7aec83d5 as useTextField, $d841c8010a73d545$export$4f384c9210e583c3 as useFormattedTextField};
189
189
  //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/textfield",
3
- "version": "3.5.2",
3
+ "version": "3.5.3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@babel/runtime": "^7.6.2",
21
- "@react-aria/focus": "^3.5.2",
22
- "@react-aria/label": "^3.2.3",
23
- "@react-aria/utils": "^3.11.2",
24
- "@react-types/shared": "^3.11.1",
25
- "@react-types/textfield": "^3.3.2"
21
+ "@react-aria/focus": "^3.5.3",
22
+ "@react-aria/label": "^3.2.4",
23
+ "@react-aria/utils": "^3.11.3",
24
+ "@react-types/shared": "^3.11.2",
25
+ "@react-types/textfield": "^3.3.3"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^16.8.0 || ^17.0.0-rc.1"
@@ -30,5 +30,5 @@
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
33
+ "gitHead": "ed8d8d984c2f7f2c31e8b18795b97858a95e4729"
34
34
  }