@react-aria/numberfield 3.1.0 → 3.1.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.
- package/dist/main.js +10 -8
- package/dist/main.js.map +1 -1
- package/dist/module.js +4 -3
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/useNumberField.ts +4 -1
package/dist/main.js
CHANGED
|
@@ -18,6 +18,13 @@ var {
|
|
|
18
18
|
} = require("@react-aria/interactions");
|
|
19
19
|
|
|
20
20
|
var {
|
|
21
|
+
useCallback,
|
|
22
|
+
useMemo,
|
|
23
|
+
useState
|
|
24
|
+
} = require("react");
|
|
25
|
+
|
|
26
|
+
var {
|
|
27
|
+
filterDOMProps,
|
|
21
28
|
isAndroid,
|
|
22
29
|
isIOS,
|
|
23
30
|
isIPhone,
|
|
@@ -25,12 +32,6 @@ var {
|
|
|
25
32
|
useId
|
|
26
33
|
} = require("@react-aria/utils");
|
|
27
34
|
|
|
28
|
-
var {
|
|
29
|
-
useCallback,
|
|
30
|
-
useMemo,
|
|
31
|
-
useState
|
|
32
|
-
} = require("react");
|
|
33
|
-
|
|
34
35
|
var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
|
|
35
36
|
|
|
36
37
|
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -301,12 +302,13 @@ function useNumberField(props, state, inputRef) {
|
|
|
301
302
|
state.setInputValue(value);
|
|
302
303
|
};
|
|
303
304
|
|
|
305
|
+
let domProps = filterDOMProps(props);
|
|
304
306
|
let {
|
|
305
307
|
labelProps,
|
|
306
308
|
inputProps: textFieldProps,
|
|
307
309
|
descriptionProps,
|
|
308
310
|
errorMessageProps
|
|
309
|
-
} = useFormattedTextField({
|
|
311
|
+
} = useFormattedTextField(_babelRuntimeHelpersExtends({}, domProps, {
|
|
310
312
|
label,
|
|
311
313
|
autoFocus,
|
|
312
314
|
isDisabled,
|
|
@@ -329,7 +331,7 @@ function useNumberField(props, state, inputRef) {
|
|
|
329
331
|
onKeyUp,
|
|
330
332
|
description,
|
|
331
333
|
errorMessage
|
|
332
|
-
}, state, inputRef);
|
|
334
|
+
}), state, inputRef);
|
|
333
335
|
let inputProps = mergeProps(spinButtonProps, textFieldProps, focusProps, {
|
|
334
336
|
// override the spinbutton role, we can't focus a spin button with VO
|
|
335
337
|
role: null,
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,0CAAiBG,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,uHAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,8GAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,kHAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,+GAAX,CAAjB;;;ACAA,qCAAiBD,IAAI,CAACC,KAAL,CAAW,kHAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,oHAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,gHAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,8GAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,sHAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,4CAA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,UAAU,EAAE,CAACL,KAAK,CAAC0G,YAPkD;AAQrED,IAAAA,YAAY,EAAEf;AARuD,GAAjB,CAAtD;AAWA,SAAO;AACLiB,IAAAA,UAAU;AACRrB,MAAAA,IAAI,EAAE,OADE;AAER,uBAAiBjF,UAFT;AAGR,sBAAgBM,eAAe,KAAK,SAApB,GAAgC,MAAhC,GAAyCiG;AAHjD,OAIL1D,gBAJK,CADL;AAOL2B,IAAAA,UAPK;AAQLC,IAAAA,UARK;AASL3C,IAAAA,oBATK;AAULE,IAAAA,oBAVK;AAWL4C,IAAAA,iBAXK;AAYLD,IAAAA;AAZK,GAAP;AAcD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/numberfield/intl/ar-AE.json","./packages/@react-aria/numberfield/intl/bg-BG.json","./packages/@react-aria/numberfield/intl/cs-CZ.json","./packages/@react-aria/numberfield/intl/da-DK.json","./packages/@react-aria/numberfield/intl/de-DE.json","./packages/@react-aria/numberfield/intl/el-GR.json","./packages/@react-aria/numberfield/intl/en-US.json","./packages/@react-aria/numberfield/intl/es-ES.json","./packages/@react-aria/numberfield/intl/et-EE.json","./packages/@react-aria/numberfield/intl/fi-FI.json","./packages/@react-aria/numberfield/intl/fr-FR.json","./packages/@react-aria/numberfield/intl/he-IL.json","./packages/@react-aria/numberfield/intl/hr-HR.json","./packages/@react-aria/numberfield/intl/hu-HU.json","./packages/@react-aria/numberfield/intl/it-IT.json","./packages/@react-aria/numberfield/intl/ja-JP.json","./packages/@react-aria/numberfield/intl/ko-KR.json","./packages/@react-aria/numberfield/intl/lt-LT.json","./packages/@react-aria/numberfield/intl/lv-LV.json","./packages/@react-aria/numberfield/intl/nb-NO.json","./packages/@react-aria/numberfield/intl/nl-NL.json","./packages/@react-aria/numberfield/intl/pl-PL.json","./packages/@react-aria/numberfield/intl/pt-BR.json","./packages/@react-aria/numberfield/intl/pt-PT.json","./packages/@react-aria/numberfield/intl/ro-RO.json","./packages/@react-aria/numberfield/intl/ru-RU.json","./packages/@react-aria/numberfield/intl/sk-SK.json","./packages/@react-aria/numberfield/intl/sl-SI.json","./packages/@react-aria/numberfield/intl/sr-SP.json","./packages/@react-aria/numberfield/intl/sv-SE.json","./packages/@react-aria/numberfield/intl/tr-TR.json","./packages/@react-aria/numberfield/intl/uk-UA.json","./packages/@react-aria/numberfield/intl/zh-CN.json","./packages/@react-aria/numberfield/intl/zh-TW.json","./packages/@react-aria/numberfield/src/useNumberField.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","{\n \"decrease\": \"خفض {fieldLabel}\",\n \"increase\": \"زيادة {fieldLabel}\",\n \"numberField\": \"حقل رقمي\"\n}\n","{\n \"decrease\": \"Намаляване {fieldLabel}\",\n \"increase\": \"Усилване {fieldLabel}\",\n \"numberField\": \"Номер на полето\"\n}\n","{\n \"decrease\": \"Snížit {fieldLabel}\",\n \"increase\": \"Zvýšit {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Reducer {fieldLabel}\",\n \"increase\": \"Øg {fieldLabel}\",\n \"numberField\": \"Talfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verringern\",\n \"increase\": \"{fieldLabel} erhöhen\",\n \"numberField\": \"Nummernfeld\"\n}\n","{\n \"decrease\": \"Μείωση {fieldLabel}\",\n \"increase\": \"Αύξηση {fieldLabel}\",\n \"numberField\": \"Πεδίο αριθμού\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Reducir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Vähenda {fieldLabel}\",\n \"increase\": \"Suurenda {fieldLabel}\",\n \"numberField\": \"Numbri väli\"\n}\n","{\n \"decrease\": \"Vähennä {fieldLabel}\",\n \"increase\": \"Lisää {fieldLabel}\",\n \"numberField\": \"Numerokenttä\"\n}\n","{\n \"decrease\": \"Diminuer {fieldLabel}\",\n \"increase\": \"Augmenter {fieldLabel}\",\n \"numberField\": \"Champ de nombre\"\n}\n","{\n \"decrease\": \"הקטן {fieldLabel}\",\n \"increase\": \"הגדל {fieldLabel}\",\n \"numberField\": \"שדה מספר\"\n}\n","{\n \"decrease\": \"Smanji {fieldLabel}\",\n \"increase\": \"Povećaj {fieldLabel}\",\n \"numberField\": \"Polje broja\"\n}\n","{\n \"decrease\": \"{fieldLabel} csökkentése\",\n \"increase\": \"{fieldLabel} növelése\",\n \"numberField\": \"Számmező\"\n}\n","{\n \"decrease\": \"Riduci {fieldLabel}\",\n \"increase\": \"Aumenta {fieldLabel}\",\n \"numberField\": \"Campo numero\"\n}\n","{\n \"decrease\": \"{fieldLabel}を縮小\",\n \"increase\": \"{fieldLabel}を拡大\",\n \"numberField\": \"数値フィールド\"\n}\n","{\n \"decrease\": \"{fieldLabel} 감소\",\n \"increase\": \"{fieldLabel} 증가\",\n \"numberField\": \"번호 필드\"\n}\n","{\n \"decrease\": \"Sumažinti {fieldLabel}\",\n \"increase\": \"Padidinti {fieldLabel}\",\n \"numberField\": \"Numerio laukas\"\n}\n","{\n \"decrease\": \"Samazināšana {fieldLabel}\",\n \"increase\": \"Palielināšana {fieldLabel}\",\n \"numberField\": \"Skaitļu lauks\"\n}\n","{\n \"decrease\": \"Reduser {fieldLabel}\",\n \"increase\": \"Øk {fieldLabel}\",\n \"numberField\": \"Tallfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verlagen\",\n \"increase\": \"{fieldLabel} verhogen\",\n \"numberField\": \"Getalveld\"\n}\n","{\n \"decrease\": \"Zmniejsz {fieldLabel}\",\n \"increase\": \"Zwiększ {fieldLabel}\",\n \"numberField\": \"Pole numeru\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo numérico\"\n}\n","{\n \"decrease\": \"Scădere {fieldLabel}\",\n \"increase\": \"Creștere {fieldLabel}\",\n \"numberField\": \"Câmp numeric\"\n}\n","{\n \"decrease\": \"Уменьшение {fieldLabel}\",\n \"increase\": \"Увеличение {fieldLabel}\",\n \"numberField\": \"Числовое поле\"\n}\n","{\n \"decrease\": \"Znížiť {fieldLabel}\",\n \"increase\": \"Zvýšiť {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Upadati {fieldLabel}\",\n \"increase\": \"Povečajte {fieldLabel}\",\n \"numberField\": \"Številčno polje\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Minska {fieldLabel}\",\n \"increase\": \"Öka {fieldLabel}\",\n \"numberField\": \"Nummerfält\"\n}\n","{\n \"decrease\": \"{fieldLabel} azalt\",\n \"increase\": \"{fieldLabel} arttır\",\n \"numberField\": \"Sayı alanı\"\n}\n","{\n \"decrease\": \"Зменшити {fieldLabel}\",\n \"increase\": \"Збільшити {fieldLabel}\",\n \"numberField\": \"Поле номера\"\n}\n","{\n \"decrease\": \"降低 {fieldLabel}\",\n \"increase\": \"提高 {fieldLabel}\",\n \"numberField\": \"数字字段\"\n}\n","{\n \"decrease\": \"縮小 {fieldLabel}\",\n \"increase\": \"放大 {fieldLabel}\",\n \"numberField\": \"數字欄位\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaNumberFieldProps} from '@react-types/numberfield';\nimport {\n HTMLAttributes,\n InputHTMLAttributes,\n LabelHTMLAttributes,\n RefObject,\n useCallback,\n useMemo,\n useState\n} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAndroid, isIOS, isIPhone, mergeProps, useId} from '@react-aria/utils';\nimport {NumberFieldState} from '@react-stately/numberfield';\nimport {TextInputDOMProps} from '@react-types/shared';\nimport {useFocus, useFocusWithin} from '@react-aria/interactions';\nimport {useFormattedTextField} from '@react-aria/textfield';\nimport {\n useMessageFormatter,\n useNumberFormatter\n} from '@react-aria/i18n';\nimport {useScrollWheel} from '@react-aria/interactions';\nimport {useSpinButton} from '@react-aria/spinbutton';\n\ninterface NumberFieldAria {\n /** Props for the label element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the group wrapper around the input and stepper buttons. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the increment button, to be passed to [useButton](useButton.html). */\n incrementButtonProps: AriaButtonProps,\n /** Props for the decrement button, to be passed to [useButton](useButton.html). */\n decrementButtonProps: AriaButtonProps,\n /** Props for the number field's description element, if any. */\n descriptionProps: HTMLAttributes<HTMLElement>,\n /** Props for the number field's error message element, if any. */\n errorMessageProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field component.\n * Number fields allow users to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport function useNumberField(props: AriaNumberFieldProps, state: NumberFieldState, inputRef: RefObject<HTMLInputElement>): NumberFieldAria {\n let {\n id,\n decrementAriaLabel,\n incrementAriaLabel,\n isDisabled,\n isReadOnly,\n isRequired,\n minValue,\n maxValue,\n autoFocus,\n validationState,\n label,\n formatOptions,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n } = props;\n\n let {\n increment,\n incrementToMax,\n decrement,\n decrementToMin,\n numberValue,\n commit\n } = state;\n\n const formatMessage = useMessageFormatter(intlMessages);\n\n let inputId = useId(id);\n\n let {focusProps} = useFocus({\n onBlur: () => {\n // Set input value to normalized valid value\n commit();\n }\n });\n\n let {\n spinButtonProps,\n incrementButtonProps: incButtonProps,\n decrementButtonProps: decButtonProps\n } = useSpinButton(\n {\n isDisabled,\n isReadOnly,\n isRequired,\n maxValue,\n minValue,\n onIncrement: increment,\n onIncrementToMax: incrementToMax,\n onDecrement: decrement,\n onDecrementToMin: decrementToMin,\n value: numberValue,\n textValue: state.inputValue\n }\n );\n\n let [focusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({isDisabled, onFocusWithinChange: setFocusWithin});\n\n let onWheel = useCallback((e) => {\n // if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change\n // if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec\n // this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication\n // especially if the user is scrolling near 45deg\n if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) {\n return;\n }\n if (e.deltaY > 0) {\n increment();\n } else if (e.deltaY < 0) {\n decrement();\n }\n }, [decrement, increment]);\n // If the input isn't supposed to receive input, disable scrolling.\n let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;\n useScrollWheel({onScroll: onWheel, isDisabled: scrollingDisabled}, inputRef);\n\n // The inputMode attribute influences the software keyboard that is shown on touch devices.\n // Browsers and operating systems are quite inconsistent about what keys are available, however.\n // We choose between numeric and decimal based on whether we allow negative and fractional numbers,\n // and based on testing on various devices to determine what keys are available in each inputMode.\n let numberFormatter = useNumberFormatter(formatOptions);\n let intlOptions = useMemo(() => numberFormatter.resolvedOptions(), [numberFormatter]);\n let hasDecimals = intlOptions.maximumFractionDigits > 0;\n let hasNegative = isNaN(state.minValue) || state.minValue < 0;\n let inputMode: TextInputDOMProps['inputMode'] = 'numeric';\n if (isIPhone()) {\n // iPhone doesn't have a minus sign in either numeric or decimal.\n // Note this is only for iPhone, not iPad, which always has both\n // minus and decimal in numeric.\n if (hasNegative) {\n inputMode = 'text';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n } else if (isAndroid()) {\n // Android numeric has both a decimal point and minus key.\n // decimal does not have a minus key.\n if (hasNegative) {\n inputMode = 'numeric';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n }\n\n let onChange = value => {\n state.setInputValue(value);\n };\n\n let {labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps} = useFormattedTextField({\n label,\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n validationState,\n value: state.inputValue,\n autoComplete: 'off',\n 'aria-label': props['aria-label'] || null,\n 'aria-labelledby': props['aria-labelledby'] || null,\n id: inputId,\n type: 'text', // Can't use type=\"number\" because then we can't have things like $ in the field.\n inputMode,\n onChange,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n }, state, inputRef);\n\n let inputProps = mergeProps(\n spinButtonProps,\n textFieldProps,\n focusProps,\n {\n // override the spinbutton role, we can't focus a spin button with VO\n role: null,\n // ignore aria-roledescription on iOS so that required state will announce when it is present\n 'aria-roledescription': (!isIOS() ? formatMessage('numberField') : null),\n 'aria-valuemax': null,\n 'aria-valuemin': null,\n 'aria-valuenow': null,\n 'aria-valuetext': null,\n autoCorrect: 'off',\n spellCheck: 'false'\n }\n );\n\n let onButtonPressStart = (e) => {\n // If focus is already on the input, keep it there so we don't hide the\n // software keyboard when tapping the increment/decrement buttons.\n if (document.activeElement === inputRef.current) {\n return;\n }\n\n // Otherwise, when using a mouse, move focus to the input.\n // On touch, or with a screen reader, focus the button so that the software\n // keyboard does not appear and the screen reader cursor is not moved off the button.\n if (e.pointerType === 'mouse') {\n inputRef.current.focus();\n } else {\n e.target.focus();\n }\n };\n\n // Determine the label for the increment and decrement buttons. There are 4 cases:\n //\n // 1. With a visible label that is a string: aria-label: `Increase ${props.label}`\n // 2. With a visible label that is JSX: aria-label: 'Increase', aria-labelledby: '${incrementId} ${labelId}'\n // 3. With an aria-label: aria-label: `Increase ${props['aria-label']}`\n // 4. With an aria-labelledby: aria-label: 'Increase', aria-labelledby: `${incrementId} ${props['aria-labelledby']}`\n //\n // (1) and (2) could possibly be combined and both use aria-labelledby. However, placing the label in\n // the aria-label string rather than using aria-labelledby gives more flexibility to translators to change\n // the order or add additional words around the label if needed.\n let fieldLabel = props['aria-label'] || (typeof props.label === 'string' ? props.label : '');\n let ariaLabelledby: string;\n if (!fieldLabel) {\n ariaLabelledby = props.label != null ? labelProps.id : props['aria-labelledby'];\n }\n\n let incrementId = useId();\n let decrementId = useId();\n\n let incrementButtonProps: AriaButtonProps = mergeProps(incButtonProps, {\n 'aria-label': incrementAriaLabel || formatMessage('increase', {fieldLabel}).trim(),\n id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,\n 'aria-labelledby': ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canIncrement,\n onPressStart: onButtonPressStart\n });\n\n let decrementButtonProps: AriaButtonProps = mergeProps(decButtonProps, {\n 'aria-label': decrementAriaLabel || formatMessage('decrease', {fieldLabel}).trim(),\n id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,\n 'aria-labelledby': ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canDecrement,\n onPressStart: onButtonPressStart\n });\n\n return {\n groupProps: {\n role: 'group',\n 'aria-disabled': isDisabled,\n 'aria-invalid': validationState === 'invalid' ? 'true' : undefined,\n ...focusWithinProps\n },\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n errorMessageProps,\n descriptionProps\n };\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","JSON","parse","useNumberField","props","state","inputRef","id","decrementAriaLabel","incrementAriaLabel","isDisabled","isReadOnly","isRequired","minValue","maxValue","autoFocus","validationState","label","formatOptions","onBlur","onFocus","onFocusChange","onKeyDown","onKeyUp","description","errorMessage","increment","incrementToMax","decrement","decrementToMin","numberValue","commit","formatMessage","useMessageFormatter","intlMessages","inputId","useId","focusProps","useFocus","spinButtonProps","incrementButtonProps","incButtonProps","decrementButtonProps","decButtonProps","useSpinButton","onIncrement","onIncrementToMax","onDecrement","onDecrementToMin","value","textValue","inputValue","focusWithin","setFocusWithin","useState","focusWithinProps","useFocusWithin","onFocusWithinChange","onWheel","useCallback","e","Math","abs","deltaY","deltaX","scrollingDisabled","useScrollWheel","onScroll","numberFormatter","useNumberFormatter","intlOptions","useMemo","resolvedOptions","hasDecimals","maximumFractionDigits","hasNegative","isNaN","inputMode","isIPhone","isAndroid","onChange","setInputValue","labelProps","inputProps","textFieldProps","descriptionProps","errorMessageProps","useFormattedTextField","autoComplete","type","mergeProps","role","isIOS","autoCorrect","spellCheck","onButtonPressStart","document","activeElement","current","pointerType","focus","target","fieldLabel","ariaLabelledby","incrementId","decrementId","trim","excludeFromTabOrder","preventFocusOnPress","canIncrement","onPressStart","can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5D,gBAJK,CADL;AAOL6B,IAAAA,UAPK;AAQLC,IAAAA,UARK;AASL7C,IAAAA,oBATK;AAULE,IAAAA,oBAVK;AAWL8C,IAAAA,iBAXK;AAYLD,IAAAA;AAZK,GAAP;AAcD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/@react-aria/numberfield/intl/ar-AE.json","./packages/@react-aria/numberfield/intl/bg-BG.json","./packages/@react-aria/numberfield/intl/cs-CZ.json","./packages/@react-aria/numberfield/intl/da-DK.json","./packages/@react-aria/numberfield/intl/de-DE.json","./packages/@react-aria/numberfield/intl/el-GR.json","./packages/@react-aria/numberfield/intl/en-US.json","./packages/@react-aria/numberfield/intl/es-ES.json","./packages/@react-aria/numberfield/intl/et-EE.json","./packages/@react-aria/numberfield/intl/fi-FI.json","./packages/@react-aria/numberfield/intl/fr-FR.json","./packages/@react-aria/numberfield/intl/he-IL.json","./packages/@react-aria/numberfield/intl/hr-HR.json","./packages/@react-aria/numberfield/intl/hu-HU.json","./packages/@react-aria/numberfield/intl/it-IT.json","./packages/@react-aria/numberfield/intl/ja-JP.json","./packages/@react-aria/numberfield/intl/ko-KR.json","./packages/@react-aria/numberfield/intl/lt-LT.json","./packages/@react-aria/numberfield/intl/lv-LV.json","./packages/@react-aria/numberfield/intl/nb-NO.json","./packages/@react-aria/numberfield/intl/nl-NL.json","./packages/@react-aria/numberfield/intl/pl-PL.json","./packages/@react-aria/numberfield/intl/pt-BR.json","./packages/@react-aria/numberfield/intl/pt-PT.json","./packages/@react-aria/numberfield/intl/ro-RO.json","./packages/@react-aria/numberfield/intl/ru-RU.json","./packages/@react-aria/numberfield/intl/sk-SK.json","./packages/@react-aria/numberfield/intl/sl-SI.json","./packages/@react-aria/numberfield/intl/sr-SP.json","./packages/@react-aria/numberfield/intl/sv-SE.json","./packages/@react-aria/numberfield/intl/tr-TR.json","./packages/@react-aria/numberfield/intl/uk-UA.json","./packages/@react-aria/numberfield/intl/zh-CN.json","./packages/@react-aria/numberfield/intl/zh-TW.json","./packages/@react-aria/numberfield/src/useNumberField.ts"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","{\n \"decrease\": \"خفض {fieldLabel}\",\n \"increase\": \"زيادة {fieldLabel}\",\n \"numberField\": \"حقل رقمي\"\n}\n","{\n \"decrease\": \"Намаляване {fieldLabel}\",\n \"increase\": \"Усилване {fieldLabel}\",\n \"numberField\": \"Номер на полето\"\n}\n","{\n \"decrease\": \"Snížit {fieldLabel}\",\n \"increase\": \"Zvýšit {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Reducer {fieldLabel}\",\n \"increase\": \"Øg {fieldLabel}\",\n \"numberField\": \"Talfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verringern\",\n \"increase\": \"{fieldLabel} erhöhen\",\n \"numberField\": \"Nummernfeld\"\n}\n","{\n \"decrease\": \"Μείωση {fieldLabel}\",\n \"increase\": \"Αύξηση {fieldLabel}\",\n \"numberField\": \"Πεδίο αριθμού\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Reducir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Vähenda {fieldLabel}\",\n \"increase\": \"Suurenda {fieldLabel}\",\n \"numberField\": \"Numbri väli\"\n}\n","{\n \"decrease\": \"Vähennä {fieldLabel}\",\n \"increase\": \"Lisää {fieldLabel}\",\n \"numberField\": \"Numerokenttä\"\n}\n","{\n \"decrease\": \"Diminuer {fieldLabel}\",\n \"increase\": \"Augmenter {fieldLabel}\",\n \"numberField\": \"Champ de nombre\"\n}\n","{\n \"decrease\": \"הקטן {fieldLabel}\",\n \"increase\": \"הגדל {fieldLabel}\",\n \"numberField\": \"שדה מספר\"\n}\n","{\n \"decrease\": \"Smanji {fieldLabel}\",\n \"increase\": \"Povećaj {fieldLabel}\",\n \"numberField\": \"Polje broja\"\n}\n","{\n \"decrease\": \"{fieldLabel} csökkentése\",\n \"increase\": \"{fieldLabel} növelése\",\n \"numberField\": \"Számmező\"\n}\n","{\n \"decrease\": \"Riduci {fieldLabel}\",\n \"increase\": \"Aumenta {fieldLabel}\",\n \"numberField\": \"Campo numero\"\n}\n","{\n \"decrease\": \"{fieldLabel}を縮小\",\n \"increase\": \"{fieldLabel}を拡大\",\n \"numberField\": \"数値フィールド\"\n}\n","{\n \"decrease\": \"{fieldLabel} 감소\",\n \"increase\": \"{fieldLabel} 증가\",\n \"numberField\": \"번호 필드\"\n}\n","{\n \"decrease\": \"Sumažinti {fieldLabel}\",\n \"increase\": \"Padidinti {fieldLabel}\",\n \"numberField\": \"Numerio laukas\"\n}\n","{\n \"decrease\": \"Samazināšana {fieldLabel}\",\n \"increase\": \"Palielināšana {fieldLabel}\",\n \"numberField\": \"Skaitļu lauks\"\n}\n","{\n \"decrease\": \"Reduser {fieldLabel}\",\n \"increase\": \"Øk {fieldLabel}\",\n \"numberField\": \"Tallfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verlagen\",\n \"increase\": \"{fieldLabel} verhogen\",\n \"numberField\": \"Getalveld\"\n}\n","{\n \"decrease\": \"Zmniejsz {fieldLabel}\",\n \"increase\": \"Zwiększ {fieldLabel}\",\n \"numberField\": \"Pole numeru\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo numérico\"\n}\n","{\n \"decrease\": \"Scădere {fieldLabel}\",\n \"increase\": \"Creștere {fieldLabel}\",\n \"numberField\": \"Câmp numeric\"\n}\n","{\n \"decrease\": \"Уменьшение {fieldLabel}\",\n \"increase\": \"Увеличение {fieldLabel}\",\n \"numberField\": \"Числовое поле\"\n}\n","{\n \"decrease\": \"Znížiť {fieldLabel}\",\n \"increase\": \"Zvýšiť {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Upadati {fieldLabel}\",\n \"increase\": \"Povečajte {fieldLabel}\",\n \"numberField\": \"Številčno polje\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Minska {fieldLabel}\",\n \"increase\": \"Öka {fieldLabel}\",\n \"numberField\": \"Nummerfält\"\n}\n","{\n \"decrease\": \"{fieldLabel} azalt\",\n \"increase\": \"{fieldLabel} arttır\",\n \"numberField\": \"Sayı alanı\"\n}\n","{\n \"decrease\": \"Зменшити {fieldLabel}\",\n \"increase\": \"Збільшити {fieldLabel}\",\n \"numberField\": \"Поле номера\"\n}\n","{\n \"decrease\": \"降低 {fieldLabel}\",\n \"increase\": \"提高 {fieldLabel}\",\n \"numberField\": \"数字字段\"\n}\n","{\n \"decrease\": \"縮小 {fieldLabel}\",\n \"increase\": \"放大 {fieldLabel}\",\n \"numberField\": \"數字欄位\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaNumberFieldProps} from '@react-types/numberfield';\nimport {filterDOMProps, isAndroid, isIOS, isIPhone, mergeProps, useId} from '@react-aria/utils';\nimport {\n HTMLAttributes,\n InputHTMLAttributes,\n LabelHTMLAttributes,\n RefObject,\n useCallback,\n useMemo,\n useState\n} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {NumberFieldState} from '@react-stately/numberfield';\nimport {TextInputDOMProps} from '@react-types/shared';\nimport {useFocus, useFocusWithin} from '@react-aria/interactions';\nimport {useFormattedTextField} from '@react-aria/textfield';\nimport {\n useMessageFormatter,\n useNumberFormatter\n} from '@react-aria/i18n';\nimport {useScrollWheel} from '@react-aria/interactions';\nimport {useSpinButton} from '@react-aria/spinbutton';\n\ninterface NumberFieldAria {\n /** Props for the label element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the group wrapper around the input and stepper buttons. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the increment button, to be passed to [useButton](useButton.html). */\n incrementButtonProps: AriaButtonProps,\n /** Props for the decrement button, to be passed to [useButton](useButton.html). */\n decrementButtonProps: AriaButtonProps,\n /** Props for the number field's description element, if any. */\n descriptionProps: HTMLAttributes<HTMLElement>,\n /** Props for the number field's error message element, if any. */\n errorMessageProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field component.\n * Number fields allow users to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport function useNumberField(props: AriaNumberFieldProps, state: NumberFieldState, inputRef: RefObject<HTMLInputElement>): NumberFieldAria {\n let {\n id,\n decrementAriaLabel,\n incrementAriaLabel,\n isDisabled,\n isReadOnly,\n isRequired,\n minValue,\n maxValue,\n autoFocus,\n validationState,\n label,\n formatOptions,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n } = props;\n\n let {\n increment,\n incrementToMax,\n decrement,\n decrementToMin,\n numberValue,\n commit\n } = state;\n\n const formatMessage = useMessageFormatter(intlMessages);\n\n let inputId = useId(id);\n\n let {focusProps} = useFocus({\n onBlur: () => {\n // Set input value to normalized valid value\n commit();\n }\n });\n\n let {\n spinButtonProps,\n incrementButtonProps: incButtonProps,\n decrementButtonProps: decButtonProps\n } = useSpinButton(\n {\n isDisabled,\n isReadOnly,\n isRequired,\n maxValue,\n minValue,\n onIncrement: increment,\n onIncrementToMax: incrementToMax,\n onDecrement: decrement,\n onDecrementToMin: decrementToMin,\n value: numberValue,\n textValue: state.inputValue\n }\n );\n\n let [focusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({isDisabled, onFocusWithinChange: setFocusWithin});\n\n let onWheel = useCallback((e) => {\n // if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change\n // if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec\n // this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication\n // especially if the user is scrolling near 45deg\n if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) {\n return;\n }\n if (e.deltaY > 0) {\n increment();\n } else if (e.deltaY < 0) {\n decrement();\n }\n }, [decrement, increment]);\n // If the input isn't supposed to receive input, disable scrolling.\n let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;\n useScrollWheel({onScroll: onWheel, isDisabled: scrollingDisabled}, inputRef);\n\n // The inputMode attribute influences the software keyboard that is shown on touch devices.\n // Browsers and operating systems are quite inconsistent about what keys are available, however.\n // We choose between numeric and decimal based on whether we allow negative and fractional numbers,\n // and based on testing on various devices to determine what keys are available in each inputMode.\n let numberFormatter = useNumberFormatter(formatOptions);\n let intlOptions = useMemo(() => numberFormatter.resolvedOptions(), [numberFormatter]);\n let hasDecimals = intlOptions.maximumFractionDigits > 0;\n let hasNegative = isNaN(state.minValue) || state.minValue < 0;\n let inputMode: TextInputDOMProps['inputMode'] = 'numeric';\n if (isIPhone()) {\n // iPhone doesn't have a minus sign in either numeric or decimal.\n // Note this is only for iPhone, not iPad, which always has both\n // minus and decimal in numeric.\n if (hasNegative) {\n inputMode = 'text';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n } else if (isAndroid()) {\n // Android numeric has both a decimal point and minus key.\n // decimal does not have a minus key.\n if (hasNegative) {\n inputMode = 'numeric';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n }\n\n let onChange = value => {\n state.setInputValue(value);\n };\n\n let domProps = filterDOMProps(props);\n\n let {labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps} = useFormattedTextField({\n ...domProps,\n label,\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n validationState,\n value: state.inputValue,\n autoComplete: 'off',\n 'aria-label': props['aria-label'] || null,\n 'aria-labelledby': props['aria-labelledby'] || null,\n id: inputId,\n type: 'text', // Can't use type=\"number\" because then we can't have things like $ in the field.\n inputMode,\n onChange,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n }, state, inputRef);\n\n let inputProps = mergeProps(\n spinButtonProps,\n textFieldProps,\n focusProps,\n {\n // override the spinbutton role, we can't focus a spin button with VO\n role: null,\n // ignore aria-roledescription on iOS so that required state will announce when it is present\n 'aria-roledescription': (!isIOS() ? formatMessage('numberField') : null),\n 'aria-valuemax': null,\n 'aria-valuemin': null,\n 'aria-valuenow': null,\n 'aria-valuetext': null,\n autoCorrect: 'off',\n spellCheck: 'false'\n }\n );\n\n let onButtonPressStart = (e) => {\n // If focus is already on the input, keep it there so we don't hide the\n // software keyboard when tapping the increment/decrement buttons.\n if (document.activeElement === inputRef.current) {\n return;\n }\n\n // Otherwise, when using a mouse, move focus to the input.\n // On touch, or with a screen reader, focus the button so that the software\n // keyboard does not appear and the screen reader cursor is not moved off the button.\n if (e.pointerType === 'mouse') {\n inputRef.current.focus();\n } else {\n e.target.focus();\n }\n };\n\n // Determine the label for the increment and decrement buttons. There are 4 cases:\n //\n // 1. With a visible label that is a string: aria-label: `Increase ${props.label}`\n // 2. With a visible label that is JSX: aria-label: 'Increase', aria-labelledby: '${incrementId} ${labelId}'\n // 3. With an aria-label: aria-label: `Increase ${props['aria-label']}`\n // 4. With an aria-labelledby: aria-label: 'Increase', aria-labelledby: `${incrementId} ${props['aria-labelledby']}`\n //\n // (1) and (2) could possibly be combined and both use aria-labelledby. However, placing the label in\n // the aria-label string rather than using aria-labelledby gives more flexibility to translators to change\n // the order or add additional words around the label if needed.\n let fieldLabel = props['aria-label'] || (typeof props.label === 'string' ? props.label : '');\n let ariaLabelledby: string;\n if (!fieldLabel) {\n ariaLabelledby = props.label != null ? labelProps.id : props['aria-labelledby'];\n }\n\n let incrementId = useId();\n let decrementId = useId();\n\n let incrementButtonProps: AriaButtonProps = mergeProps(incButtonProps, {\n 'aria-label': incrementAriaLabel || formatMessage('increase', {fieldLabel}).trim(),\n id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,\n 'aria-labelledby': ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canIncrement,\n onPressStart: onButtonPressStart\n });\n\n let decrementButtonProps: AriaButtonProps = mergeProps(decButtonProps, {\n 'aria-label': decrementAriaLabel || formatMessage('decrease', {fieldLabel}).trim(),\n id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,\n 'aria-labelledby': ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canDecrement,\n onPressStart: onButtonPressStart\n });\n\n return {\n groupProps: {\n role: 'group',\n 'aria-disabled': isDisabled,\n 'aria-invalid': validationState === 'invalid' ? 'true' : undefined,\n ...focusWithinProps\n },\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n errorMessageProps,\n descriptionProps\n };\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","JSON","parse","useNumberField","props","state","inputRef","id","decrementAriaLabel","incrementAriaLabel","isDisabled","isReadOnly","isRequired","minValue","maxValue","autoFocus","validationState","label","formatOptions","onBlur","onFocus","onFocusChange","onKeyDown","onKeyUp","description","errorMessage","increment","incrementToMax","decrement","decrementToMin","numberValue","commit","formatMessage","useMessageFormatter","intlMessages","inputId","useId","focusProps","useFocus","spinButtonProps","incrementButtonProps","incButtonProps","decrementButtonProps","decButtonProps","useSpinButton","onIncrement","onIncrementToMax","onDecrement","onDecrementToMin","value","textValue","inputValue","focusWithin","setFocusWithin","useState","focusWithinProps","useFocusWithin","onFocusWithinChange","onWheel","useCallback","e","Math","abs","deltaY","deltaX","scrollingDisabled","useScrollWheel","onScroll","numberFormatter","useNumberFormatter","intlOptions","useMemo","resolvedOptions","hasDecimals","maximumFractionDigits","hasNegative","isNaN","inputMode","isIPhone","isAndroid","onChange","setInputValue","domProps","filterDOMProps","labelProps","inputProps","textFieldProps","descriptionProps","errorMessageProps","useFormattedTextField","autoComplete","type","mergeProps","role","isIOS","autoCorrect","spellCheck","onButtonPressStart","document","activeElement","current","pointerType","focus","target","fieldLabel","ariaLabelledby","incrementId","decrementId","trim","excludeFromTabOrder","preventFocusOnPress","canIncrement","onPressStart","canDecrement","groupProps","undefined"],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -2,8 +2,8 @@ import { useSpinButton } from "@react-aria/spinbutton";
|
|
|
2
2
|
import { useMessageFormatter, useNumberFormatter } from "@react-aria/i18n";
|
|
3
3
|
import { useFormattedTextField } from "@react-aria/textfield";
|
|
4
4
|
import { useFocus, useFocusWithin, useScrollWheel } from "@react-aria/interactions";
|
|
5
|
-
import { isAndroid, isIOS, isIPhone, mergeProps, useId } from "@react-aria/utils";
|
|
6
5
|
import { useCallback, useMemo, useState } from "react";
|
|
6
|
+
import { filterDOMProps, isAndroid, isIOS, isIPhone, mergeProps, useId } from "@react-aria/utils";
|
|
7
7
|
import _babelRuntimeHelpersEsmInteropRequireDefault from "@babel/runtime/helpers/esm/interopRequireDefault";
|
|
8
8
|
import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
|
|
9
9
|
// ASSET: /Users/govett/dev/react-spectrum-v3/packages/@react-aria/numberfield/intl/ar-AE.json
|
|
@@ -268,12 +268,13 @@ export function useNumberField(props, state, inputRef) {
|
|
|
268
268
|
state.setInputValue(value);
|
|
269
269
|
};
|
|
270
270
|
|
|
271
|
+
let domProps = filterDOMProps(props);
|
|
271
272
|
let {
|
|
272
273
|
labelProps,
|
|
273
274
|
inputProps: textFieldProps,
|
|
274
275
|
descriptionProps,
|
|
275
276
|
errorMessageProps
|
|
276
|
-
} = useFormattedTextField({
|
|
277
|
+
} = useFormattedTextField(_babelRuntimeHelpersEsmExtends({}, domProps, {
|
|
277
278
|
label,
|
|
278
279
|
autoFocus,
|
|
279
280
|
isDisabled,
|
|
@@ -296,7 +297,7 @@ export function useNumberField(props, state, inputRef) {
|
|
|
296
297
|
onKeyUp,
|
|
297
298
|
description,
|
|
298
299
|
errorMessage
|
|
299
|
-
}, state, inputRef);
|
|
300
|
+
}), state, inputRef);
|
|
300
301
|
let inputProps = mergeProps(spinButtonProps, textFieldProps, focusProps, {
|
|
301
302
|
// override the spinbutton role, we can't focus a spin button with VO
|
|
302
303
|
role: null,
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA,4CAAiBA,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,4CAAi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AmB,EAAE,IALgD;AAMrEC,IAAAA,mBAAmB,EAAE,IANgD;AAOrElG,IAAAA,UAAU,EAAE,CAACL,KAAK,CAACwG,YAPkD;AAQrEC,IAAAA,YAAY,EAAEf;AARuD,GAAjB,CAAtD;AAWA,MAAIrD,oBAAqC,GAAGgD,UAAU,CAAC/C,cAAD,EAAiB;AACrE,kBAAcnC,kBAAkB,IAAIwB,aAAa,CAAC,UAAD,EAAa;AAACsE,MAAAA;AAAD,KAAb,CAAb,CAAwCI,IAAxC,EADiC;AAErEnG,IAAAA,EAAE,EAAEgG,cAAc,IAAI,CAAC/F,kBAAnB,GAAwCiG,WAAxC,GAAsD,IAFW;AAGrE,uBAAmBF,cAAc,IAAI,CAAC/F,kBAAnB,GAA2CiG,WAA3C,SAA0DF,cAA1D,GAA6E,IAH3B;AAIrE,qBAAiBpE,OAJoD;AAKrEwE,IAAAA,mBAAmB,EAAE,IALgD;AAMrEC,IAAAA,mBAAmB,EAAE,IANgD;AAOrElG,IAAAA,UAAU,EAAE,CAACL,KAAK,CAAC0G,YAPkD;AAQrED,IAAAA,YAAY,EAAEf;AARuD,GAAjB,CAAtD;AAWA,SAAO;AACLiB,IAAAA,UAAU;AACRrB,MAAAA,IAAI,EAAE,OADE;AAER,uBAAiBjF,UAFT;AAGR,sBAAgBM,eAAe,KAAK,SAApB,GAAgC,MAAhC,GAAyCiG;AAHjD,OAIL1D,gBAJK,CADL;AAOL2B,IAAAA,UAPK;AAQLC,IAAAA,UARK;AASL3C,IAAAA,oBATK;AAULE,IAAAA,oBAVK;AAWL4C,IAAAA,iBAXK;AAYLD,IAAAA;AAZK,GAAP;AAcD","sources":["./packages/@react-aria/numberfield/intl/ar-AE.json","./packages/@react-aria/numberfield/intl/bg-BG.json","./packages/@react-aria/numberfield/intl/cs-CZ.json","./packages/@react-aria/numberfield/intl/da-DK.json","./packages/@react-aria/numberfield/intl/de-DE.json","./packages/@react-aria/numberfield/intl/el-GR.json","./packages/@react-aria/numberfield/intl/en-US.json","./packages/@react-aria/numberfield/intl/es-ES.json","./packages/@react-aria/numberfield/intl/et-EE.json","./packages/@react-aria/numberfield/intl/fi-FI.json","./packages/@react-aria/numberfield/intl/fr-FR.json","./packages/@react-aria/numberfield/intl/he-IL.json","./packages/@react-aria/numberfield/intl/hr-HR.json","./packages/@react-aria/numberfield/intl/hu-HU.json","./packages/@react-aria/numberfield/intl/it-IT.json","./packages/@react-aria/numberfield/intl/ja-JP.json","./packages/@react-aria/numberfield/intl/ko-KR.json","./packages/@react-aria/numberfield/intl/lt-LT.json","./packages/@react-aria/numberfield/intl/lv-LV.json","./packages/@react-aria/numberfield/intl/nb-NO.json","./packages/@react-aria/numberfield/intl/nl-NL.json","./packages/@react-aria/numberfield/intl/pl-PL.json","./packages/@react-aria/numberfield/intl/pt-BR.json","./packages/@react-aria/numberfield/intl/pt-PT.json","./packages/@react-aria/numberfield/intl/ro-RO.json","./packages/@react-aria/numberfield/intl/ru-RU.json","./packages/@react-aria/numberfield/intl/sk-SK.json","./packages/@react-aria/numberfield/intl/sl-SI.json","./packages/@react-aria/numberfield/intl/sr-SP.json","./packages/@react-aria/numberfield/intl/sv-SE.json","./packages/@react-aria/numberfield/intl/tr-TR.json","./packages/@react-aria/numberfield/intl/uk-UA.json","./packages/@react-aria/numberfield/intl/zh-CN.json","./packages/@react-aria/numberfield/intl/zh-TW.json","./packages/@react-aria/numberfield/src/useNumberField.ts"],"sourcesContent":["{\n \"decrease\": \"خفض {fieldLabel}\",\n \"increase\": \"زيادة {fieldLabel}\",\n \"numberField\": \"حقل رقمي\"\n}\n","{\n \"decrease\": \"Намаляване {fieldLabel}\",\n \"increase\": \"Усилване {fieldLabel}\",\n \"numberField\": \"Номер на полето\"\n}\n","{\n \"decrease\": \"Snížit {fieldLabel}\",\n \"increase\": \"Zvýšit {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Reducer {fieldLabel}\",\n \"increase\": \"Øg {fieldLabel}\",\n \"numberField\": \"Talfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verringern\",\n \"increase\": \"{fieldLabel} erhöhen\",\n \"numberField\": \"Nummernfeld\"\n}\n","{\n \"decrease\": \"Μείωση {fieldLabel}\",\n \"increase\": \"Αύξηση {fieldLabel}\",\n \"numberField\": \"Πεδίο αριθμού\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Reducir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Vähenda {fieldLabel}\",\n \"increase\": \"Suurenda {fieldLabel}\",\n \"numberField\": \"Numbri väli\"\n}\n","{\n \"decrease\": \"Vähennä {fieldLabel}\",\n \"increase\": \"Lisää {fieldLabel}\",\n \"numberField\": \"Numerokenttä\"\n}\n","{\n \"decrease\": \"Diminuer {fieldLabel}\",\n \"increase\": \"Augmenter {fieldLabel}\",\n \"numberField\": \"Champ de nombre\"\n}\n","{\n \"decrease\": \"הקטן {fieldLabel}\",\n \"increase\": \"הגדל {fieldLabel}\",\n \"numberField\": \"שדה מספר\"\n}\n","{\n \"decrease\": \"Smanji {fieldLabel}\",\n \"increase\": \"Povećaj {fieldLabel}\",\n \"numberField\": \"Polje broja\"\n}\n","{\n \"decrease\": \"{fieldLabel} csökkentése\",\n \"increase\": \"{fieldLabel} növelése\",\n \"numberField\": \"Számmező\"\n}\n","{\n \"decrease\": \"Riduci {fieldLabel}\",\n \"increase\": \"Aumenta {fieldLabel}\",\n \"numberField\": \"Campo numero\"\n}\n","{\n \"decrease\": \"{fieldLabel}を縮小\",\n \"increase\": \"{fieldLabel}を拡大\",\n \"numberField\": \"数値フィールド\"\n}\n","{\n \"decrease\": \"{fieldLabel} 감소\",\n \"increase\": \"{fieldLabel} 증가\",\n \"numberField\": \"번호 필드\"\n}\n","{\n \"decrease\": \"Sumažinti {fieldLabel}\",\n \"increase\": \"Padidinti {fieldLabel}\",\n \"numberField\": \"Numerio laukas\"\n}\n","{\n \"decrease\": \"Samazināšana {fieldLabel}\",\n \"increase\": \"Palielināšana {fieldLabel}\",\n \"numberField\": \"Skaitļu lauks\"\n}\n","{\n \"decrease\": \"Reduser {fieldLabel}\",\n \"increase\": \"Øk {fieldLabel}\",\n \"numberField\": \"Tallfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verlagen\",\n \"increase\": \"{fieldLabel} verhogen\",\n \"numberField\": \"Getalveld\"\n}\n","{\n \"decrease\": \"Zmniejsz {fieldLabel}\",\n \"increase\": \"Zwiększ {fieldLabel}\",\n \"numberField\": \"Pole numeru\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo numérico\"\n}\n","{\n \"decrease\": \"Scădere {fieldLabel}\",\n \"increase\": \"Creștere {fieldLabel}\",\n \"numberField\": \"Câmp numeric\"\n}\n","{\n \"decrease\": \"Уменьшение {fieldLabel}\",\n \"increase\": \"Увеличение {fieldLabel}\",\n \"numberField\": \"Числовое поле\"\n}\n","{\n \"decrease\": \"Znížiť {fieldLabel}\",\n \"increase\": \"Zvýšiť {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Upadati {fieldLabel}\",\n \"increase\": \"Povečajte {fieldLabel}\",\n \"numberField\": \"Številčno polje\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Minska {fieldLabel}\",\n \"increase\": \"Öka {fieldLabel}\",\n \"numberField\": \"Nummerfält\"\n}\n","{\n \"decrease\": \"{fieldLabel} azalt\",\n \"increase\": \"{fieldLabel} arttır\",\n \"numberField\": \"Sayı alanı\"\n}\n","{\n \"decrease\": \"Зменшити {fieldLabel}\",\n \"increase\": \"Збільшити {fieldLabel}\",\n \"numberField\": \"Поле номера\"\n}\n","{\n \"decrease\": \"降低 {fieldLabel}\",\n \"increase\": \"提高 {fieldLabel}\",\n \"numberField\": \"数字字段\"\n}\n","{\n \"decrease\": \"縮小 {fieldLabel}\",\n \"increase\": \"放大 {fieldLabel}\",\n \"numberField\": \"數字欄位\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaNumberFieldProps} from '@react-types/numberfield';\nimport {\n HTMLAttributes,\n InputHTMLAttributes,\n LabelHTMLAttributes,\n RefObject,\n useCallback,\n useMemo,\n useState\n} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {isAndroid, isIOS, isIPhone, mergeProps, useId} from '@react-aria/utils';\nimport {NumberFieldState} from '@react-stately/numberfield';\nimport {TextInputDOMProps} from '@react-types/shared';\nimport {useFocus, useFocusWithin} from '@react-aria/interactions';\nimport {useFormattedTextField} from '@react-aria/textfield';\nimport {\n useMessageFormatter,\n useNumberFormatter\n} from '@react-aria/i18n';\nimport {useScrollWheel} from '@react-aria/interactions';\nimport {useSpinButton} from '@react-aria/spinbutton';\n\ninterface NumberFieldAria {\n /** Props for the label element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the group wrapper around the input and stepper buttons. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the increment button, to be passed to [useButton](useButton.html). */\n incrementButtonProps: AriaButtonProps,\n /** Props for the decrement button, to be passed to [useButton](useButton.html). */\n decrementButtonProps: AriaButtonProps,\n /** Props for the number field's description element, if any. */\n descriptionProps: HTMLAttributes<HTMLElement>,\n /** Props for the number field's error message element, if any. */\n errorMessageProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field component.\n * Number fields allow users to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport function useNumberField(props: AriaNumberFieldProps, state: NumberFieldState, inputRef: RefObject<HTMLInputElement>): NumberFieldAria {\n let {\n id,\n decrementAriaLabel,\n incrementAriaLabel,\n isDisabled,\n isReadOnly,\n isRequired,\n minValue,\n maxValue,\n autoFocus,\n validationState,\n label,\n formatOptions,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n } = props;\n\n let {\n increment,\n incrementToMax,\n decrement,\n decrementToMin,\n numberValue,\n commit\n } = state;\n\n const formatMessage = useMessageFormatter(intlMessages);\n\n let inputId = useId(id);\n\n let {focusProps} = useFocus({\n onBlur: () => {\n // Set input value to normalized valid value\n commit();\n }\n });\n\n let {\n spinButtonProps,\n incrementButtonProps: incButtonProps,\n decrementButtonProps: decButtonProps\n } = useSpinButton(\n {\n isDisabled,\n isReadOnly,\n isRequired,\n maxValue,\n minValue,\n onIncrement: increment,\n onIncrementToMax: incrementToMax,\n onDecrement: decrement,\n onDecrementToMin: decrementToMin,\n value: numberValue,\n textValue: state.inputValue\n }\n );\n\n let [focusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({isDisabled, onFocusWithinChange: setFocusWithin});\n\n let onWheel = useCallback((e) => {\n // if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change\n // if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec\n // this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication\n // especially if the user is scrolling near 45deg\n if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) {\n return;\n }\n if (e.deltaY > 0) {\n increment();\n } else if (e.deltaY < 0) {\n decrement();\n }\n }, [decrement, increment]);\n // If the input isn't supposed to receive input, disable scrolling.\n let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;\n useScrollWheel({onScroll: onWheel, isDisabled: scrollingDisabled}, inputRef);\n\n // The inputMode attribute influences the software keyboard that is shown on touch devices.\n // Browsers and operating systems are quite inconsistent about what keys are available, however.\n // We choose between numeric and decimal based on whether we allow negative and fractional numbers,\n // and based on testing on various devices to determine what keys are available in each inputMode.\n let numberFormatter = useNumberFormatter(formatOptions);\n let intlOptions = useMemo(() => numberFormatter.resolvedOptions(), [numberFormatter]);\n let hasDecimals = intlOptions.maximumFractionDigits > 0;\n let hasNegative = isNaN(state.minValue) || state.minValue < 0;\n let inputMode: TextInputDOMProps['inputMode'] = 'numeric';\n if (isIPhone()) {\n // iPhone doesn't have a minus sign in either numeric or decimal.\n // Note this is only for iPhone, not iPad, which always has both\n // minus and decimal in numeric.\n if (hasNegative) {\n inputMode = 'text';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n } else if (isAndroid()) {\n // Android numeric has both a decimal point and minus key.\n // decimal does not have a minus key.\n if (hasNegative) {\n inputMode = 'numeric';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n }\n\n let onChange = value => {\n state.setInputValue(value);\n };\n\n let {labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps} = useFormattedTextField({\n label,\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n validationState,\n value: state.inputValue,\n autoComplete: 'off',\n 'aria-label': props['aria-label'] || null,\n 'aria-labelledby': props['aria-labelledby'] || null,\n id: inputId,\n type: 'text', // Can't use type=\"number\" because then we can't have things like $ in the field.\n inputMode,\n onChange,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n }, state, inputRef);\n\n let inputProps = mergeProps(\n spinButtonProps,\n textFieldProps,\n focusProps,\n {\n // override the spinbutton role, we can't focus a spin button with VO\n role: null,\n // ignore aria-roledescription on iOS so that required state will announce when it is present\n 'aria-roledescription': (!isIOS() ? formatMessage('numberField') : null),\n 'aria-valuemax': null,\n 'aria-valuemin': null,\n 'aria-valuenow': null,\n 'aria-valuetext': null,\n autoCorrect: 'off',\n spellCheck: 'false'\n }\n );\n\n let onButtonPressStart = (e) => {\n // If focus is already on the input, keep it there so we don't hide the\n // software keyboard when tapping the increment/decrement buttons.\n if (document.activeElement === inputRef.current) {\n return;\n }\n\n // Otherwise, when using a mouse, move focus to the input.\n // On touch, or with a screen reader, focus the button so that the software\n // keyboard does not appear and the screen reader cursor is not moved off the button.\n if (e.pointerType === 'mouse') {\n inputRef.current.focus();\n } else {\n e.target.focus();\n }\n };\n\n // Determine the label for the increment and decrement buttons. There are 4 cases:\n //\n // 1. With a visible label that is a string: aria-label: `Increase ${props.label}`\n // 2. With a visible label that is JSX: aria-label: 'Increase', aria-labelledby: '${incrementId} ${labelId}'\n // 3. With an aria-label: aria-label: `Increase ${props['aria-label']}`\n // 4. With an aria-labelledby: aria-label: 'Increase', aria-labelledby: `${incrementId} ${props['aria-labelledby']}`\n //\n // (1) and (2) could possibly be combined and both use aria-labelledby. However, placing the label in\n // the aria-label string rather than using aria-labelledby gives more flexibility to translators to change\n // the order or add additional words around the label if needed.\n let fieldLabel = props['aria-label'] || (typeof props.label === 'string' ? props.label : '');\n let ariaLabelledby: string;\n if (!fieldLabel) {\n ariaLabelledby = props.label != null ? labelProps.id : props['aria-labelledby'];\n }\n\n let incrementId = useId();\n let decrementId = useId();\n\n let incrementButtonProps: AriaButtonProps = mergeProps(incButtonProps, {\n 'aria-label': incrementAriaLabel || formatMessage('increase', {fieldLabel}).trim(),\n id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,\n 'aria-labelledby': ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canIncrement,\n onPressStart: onButtonPressStart\n });\n\n let decrementButtonProps: AriaButtonProps = mergeProps(decButtonProps, {\n 'aria-label': decrementAriaLabel || formatMessage('decrease', {fieldLabel}).trim(),\n id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,\n 'aria-labelledby': ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canDecrement,\n onPressStart: onButtonPressStart\n });\n\n return {\n groupProps: {\n role: 'group',\n 'aria-disabled': isDisabled,\n 'aria-invalid': validationState === 'invalid' ? 'true' : undefined,\n ...focusWithinProps\n },\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n errorMessageProps,\n descriptionProps\n };\n}\n"],"names":["JSON","parse","useNumberField","props","state","inputRef","id","decrementAriaLabel","incrementAriaLabel","isDisabled","isReadOnly","isRequired","minValue","maxValue","autoFocus","validationState","label","formatOptions","onBlur","onFocus","onFocusChange","onKeyDown","onKeyUp","description","errorMessage","increment","incrementToMax","decrement","decrementToMin","numberValue","commit","formatMessage","useMessageFormatter","intlMessages","inputId","useId","focusProps","useFocus","spinButtonProps","incrementButtonProps","incButtonProps","decrementButtonProps","decButtonProps","useSpinButton","onIncrement","onIncrementToMax","onDecrement","onDecrementToMin","value","textValue","inputValue","focusWithin","setFocusWithin","useState","focusWithinProps","useFocusWithin","onFocusWithinChange","onWheel","useCallback","e","Math","abs","deltaY","deltaX","scrollingDisabled","useScrollWheel","onScroll","numberFormatter","useNumberFormatter","intlOptions","useMemo","resolvedOptions","hasDecimals","maximumFractionDigits","hasNegative","isNaN","inputMode","isIPhone","isAndroid","onChange","setInputValue","labelProps","inputProps","textFieldProps","descriptionProps","errorMessageProps","useFormattedTextField","autoComplete","type","mergeProps","role","isIOS","autoCorrect","spellCheck","onButtonPressStart","document","activeElement","current","pointerType","focus","target","fieldLabel","ariaLabelledby","incrementId","decrementId","trim","excludeFromTabOrder","preventFocusOnPress","canIncrement","onPressStart","canDecrement","groupProps","undefined"],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA,4CAAiBA,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,uHAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,8GAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,kHAAX,CAAjB;;;ACAA,oCAAiBD,IAAI,CAACC,KAAL,CAAW,+GAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,kHAAX,CAAjB;;;ACAA,wCAAiBD,IAAI,CAACC,KAAL,CAAW,oHAAX,CAAjB;;;ACAA,2CAAiBD,IAAI,CAACC,KAAL,CAAW,gHAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,8GAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,sHAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,sGAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,8GAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,iHAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,+GAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,iGAAX,CAAjB;;;ACAA,yCAAiBD,IAAI,CAACC,KAAL,CAAW,+FAAX,CAAjB;;;ACAA,4CAAiBD,IAAI,CAACC,KAAL,CAAW,sHAAX,CAAjB;;;ACAA,0CAAiBD,IAAI,CAACC,KAAL,CAAW,4HAAX,CAAjB;;;ACAA,qCAAiBD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AWL8C,IAAAA,iBAXK;AAYLD,IAAAA;AAZK,GAAP;AAcD","sources":["./packages/@react-aria/numberfield/intl/ar-AE.json","./packages/@react-aria/numberfield/intl/bg-BG.json","./packages/@react-aria/numberfield/intl/cs-CZ.json","./packages/@react-aria/numberfield/intl/da-DK.json","./packages/@react-aria/numberfield/intl/de-DE.json","./packages/@react-aria/numberfield/intl/el-GR.json","./packages/@react-aria/numberfield/intl/en-US.json","./packages/@react-aria/numberfield/intl/es-ES.json","./packages/@react-aria/numberfield/intl/et-EE.json","./packages/@react-aria/numberfield/intl/fi-FI.json","./packages/@react-aria/numberfield/intl/fr-FR.json","./packages/@react-aria/numberfield/intl/he-IL.json","./packages/@react-aria/numberfield/intl/hr-HR.json","./packages/@react-aria/numberfield/intl/hu-HU.json","./packages/@react-aria/numberfield/intl/it-IT.json","./packages/@react-aria/numberfield/intl/ja-JP.json","./packages/@react-aria/numberfield/intl/ko-KR.json","./packages/@react-aria/numberfield/intl/lt-LT.json","./packages/@react-aria/numberfield/intl/lv-LV.json","./packages/@react-aria/numberfield/intl/nb-NO.json","./packages/@react-aria/numberfield/intl/nl-NL.json","./packages/@react-aria/numberfield/intl/pl-PL.json","./packages/@react-aria/numberfield/intl/pt-BR.json","./packages/@react-aria/numberfield/intl/pt-PT.json","./packages/@react-aria/numberfield/intl/ro-RO.json","./packages/@react-aria/numberfield/intl/ru-RU.json","./packages/@react-aria/numberfield/intl/sk-SK.json","./packages/@react-aria/numberfield/intl/sl-SI.json","./packages/@react-aria/numberfield/intl/sr-SP.json","./packages/@react-aria/numberfield/intl/sv-SE.json","./packages/@react-aria/numberfield/intl/tr-TR.json","./packages/@react-aria/numberfield/intl/uk-UA.json","./packages/@react-aria/numberfield/intl/zh-CN.json","./packages/@react-aria/numberfield/intl/zh-TW.json","./packages/@react-aria/numberfield/src/useNumberField.ts"],"sourcesContent":["{\n \"decrease\": \"خفض {fieldLabel}\",\n \"increase\": \"زيادة {fieldLabel}\",\n \"numberField\": \"حقل رقمي\"\n}\n","{\n \"decrease\": \"Намаляване {fieldLabel}\",\n \"increase\": \"Усилване {fieldLabel}\",\n \"numberField\": \"Номер на полето\"\n}\n","{\n \"decrease\": \"Snížit {fieldLabel}\",\n \"increase\": \"Zvýšit {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Reducer {fieldLabel}\",\n \"increase\": \"Øg {fieldLabel}\",\n \"numberField\": \"Talfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verringern\",\n \"increase\": \"{fieldLabel} erhöhen\",\n \"numberField\": \"Nummernfeld\"\n}\n","{\n \"decrease\": \"Μείωση {fieldLabel}\",\n \"increase\": \"Αύξηση {fieldLabel}\",\n \"numberField\": \"Πεδίο αριθμού\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Reducir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Vähenda {fieldLabel}\",\n \"increase\": \"Suurenda {fieldLabel}\",\n \"numberField\": \"Numbri väli\"\n}\n","{\n \"decrease\": \"Vähennä {fieldLabel}\",\n \"increase\": \"Lisää {fieldLabel}\",\n \"numberField\": \"Numerokenttä\"\n}\n","{\n \"decrease\": \"Diminuer {fieldLabel}\",\n \"increase\": \"Augmenter {fieldLabel}\",\n \"numberField\": \"Champ de nombre\"\n}\n","{\n \"decrease\": \"הקטן {fieldLabel}\",\n \"increase\": \"הגדל {fieldLabel}\",\n \"numberField\": \"שדה מספר\"\n}\n","{\n \"decrease\": \"Smanji {fieldLabel}\",\n \"increase\": \"Povećaj {fieldLabel}\",\n \"numberField\": \"Polje broja\"\n}\n","{\n \"decrease\": \"{fieldLabel} csökkentése\",\n \"increase\": \"{fieldLabel} növelése\",\n \"numberField\": \"Számmező\"\n}\n","{\n \"decrease\": \"Riduci {fieldLabel}\",\n \"increase\": \"Aumenta {fieldLabel}\",\n \"numberField\": \"Campo numero\"\n}\n","{\n \"decrease\": \"{fieldLabel}を縮小\",\n \"increase\": \"{fieldLabel}を拡大\",\n \"numberField\": \"数値フィールド\"\n}\n","{\n \"decrease\": \"{fieldLabel} 감소\",\n \"increase\": \"{fieldLabel} 증가\",\n \"numberField\": \"번호 필드\"\n}\n","{\n \"decrease\": \"Sumažinti {fieldLabel}\",\n \"increase\": \"Padidinti {fieldLabel}\",\n \"numberField\": \"Numerio laukas\"\n}\n","{\n \"decrease\": \"Samazināšana {fieldLabel}\",\n \"increase\": \"Palielināšana {fieldLabel}\",\n \"numberField\": \"Skaitļu lauks\"\n}\n","{\n \"decrease\": \"Reduser {fieldLabel}\",\n \"increase\": \"Øk {fieldLabel}\",\n \"numberField\": \"Tallfelt\"\n}\n","{\n \"decrease\": \"{fieldLabel} verlagen\",\n \"increase\": \"{fieldLabel} verhogen\",\n \"numberField\": \"Getalveld\"\n}\n","{\n \"decrease\": \"Zmniejsz {fieldLabel}\",\n \"increase\": \"Zwiększ {fieldLabel}\",\n \"numberField\": \"Pole numeru\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo de número\"\n}\n","{\n \"decrease\": \"Diminuir {fieldLabel}\",\n \"increase\": \"Aumentar {fieldLabel}\",\n \"numberField\": \"Campo numérico\"\n}\n","{\n \"decrease\": \"Scădere {fieldLabel}\",\n \"increase\": \"Creștere {fieldLabel}\",\n \"numberField\": \"Câmp numeric\"\n}\n","{\n \"decrease\": \"Уменьшение {fieldLabel}\",\n \"increase\": \"Увеличение {fieldLabel}\",\n \"numberField\": \"Числовое поле\"\n}\n","{\n \"decrease\": \"Znížiť {fieldLabel}\",\n \"increase\": \"Zvýšiť {fieldLabel}\",\n \"numberField\": \"Číselné pole\"\n}\n","{\n \"decrease\": \"Upadati {fieldLabel}\",\n \"increase\": \"Povečajte {fieldLabel}\",\n \"numberField\": \"Številčno polje\"\n}\n","{\n \"decrease\": \"Decrease {fieldLabel}\",\n \"increase\": \"Increase {fieldLabel}\",\n \"numberField\": \"Number field\"\n}\n","{\n \"decrease\": \"Minska {fieldLabel}\",\n \"increase\": \"Öka {fieldLabel}\",\n \"numberField\": \"Nummerfält\"\n}\n","{\n \"decrease\": \"{fieldLabel} azalt\",\n \"increase\": \"{fieldLabel} arttır\",\n \"numberField\": \"Sayı alanı\"\n}\n","{\n \"decrease\": \"Зменшити {fieldLabel}\",\n \"increase\": \"Збільшити {fieldLabel}\",\n \"numberField\": \"Поле номера\"\n}\n","{\n \"decrease\": \"降低 {fieldLabel}\",\n \"increase\": \"提高 {fieldLabel}\",\n \"numberField\": \"数字字段\"\n}\n","{\n \"decrease\": \"縮小 {fieldLabel}\",\n \"increase\": \"放大 {fieldLabel}\",\n \"numberField\": \"數字欄位\"\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {AriaNumberFieldProps} from '@react-types/numberfield';\nimport {filterDOMProps, isAndroid, isIOS, isIPhone, mergeProps, useId} from '@react-aria/utils';\nimport {\n HTMLAttributes,\n InputHTMLAttributes,\n LabelHTMLAttributes,\n RefObject,\n useCallback,\n useMemo,\n useState\n} from 'react';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {NumberFieldState} from '@react-stately/numberfield';\nimport {TextInputDOMProps} from '@react-types/shared';\nimport {useFocus, useFocusWithin} from '@react-aria/interactions';\nimport {useFormattedTextField} from '@react-aria/textfield';\nimport {\n useMessageFormatter,\n useNumberFormatter\n} from '@react-aria/i18n';\nimport {useScrollWheel} from '@react-aria/interactions';\nimport {useSpinButton} from '@react-aria/spinbutton';\n\ninterface NumberFieldAria {\n /** Props for the label element. */\n labelProps: LabelHTMLAttributes<HTMLLabelElement>,\n /** Props for the group wrapper around the input and stepper buttons. */\n groupProps: HTMLAttributes<HTMLElement>,\n /** Props for the input element. */\n inputProps: InputHTMLAttributes<HTMLInputElement>,\n /** Props for the increment button, to be passed to [useButton](useButton.html). */\n incrementButtonProps: AriaButtonProps,\n /** Props for the decrement button, to be passed to [useButton](useButton.html). */\n decrementButtonProps: AriaButtonProps,\n /** Props for the number field's description element, if any. */\n descriptionProps: HTMLAttributes<HTMLElement>,\n /** Props for the number field's error message element, if any. */\n errorMessageProps: HTMLAttributes<HTMLElement>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a number field component.\n * Number fields allow users to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport function useNumberField(props: AriaNumberFieldProps, state: NumberFieldState, inputRef: RefObject<HTMLInputElement>): NumberFieldAria {\n let {\n id,\n decrementAriaLabel,\n incrementAriaLabel,\n isDisabled,\n isReadOnly,\n isRequired,\n minValue,\n maxValue,\n autoFocus,\n validationState,\n label,\n formatOptions,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n } = props;\n\n let {\n increment,\n incrementToMax,\n decrement,\n decrementToMin,\n numberValue,\n commit\n } = state;\n\n const formatMessage = useMessageFormatter(intlMessages);\n\n let inputId = useId(id);\n\n let {focusProps} = useFocus({\n onBlur: () => {\n // Set input value to normalized valid value\n commit();\n }\n });\n\n let {\n spinButtonProps,\n incrementButtonProps: incButtonProps,\n decrementButtonProps: decButtonProps\n } = useSpinButton(\n {\n isDisabled,\n isReadOnly,\n isRequired,\n maxValue,\n minValue,\n onIncrement: increment,\n onIncrementToMax: incrementToMax,\n onDecrement: decrement,\n onDecrementToMin: decrementToMin,\n value: numberValue,\n textValue: state.inputValue\n }\n );\n\n let [focusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({isDisabled, onFocusWithinChange: setFocusWithin});\n\n let onWheel = useCallback((e) => {\n // if on a trackpad, users can scroll in both X and Y at once, check the magnitude of the change\n // if it's mostly in the X direction, then just return, the user probably doesn't mean to inc/dec\n // this isn't perfect, events come in fast with small deltas and a part of the scroll may give a false indication\n // especially if the user is scrolling near 45deg\n if (Math.abs(e.deltaY) <= Math.abs(e.deltaX)) {\n return;\n }\n if (e.deltaY > 0) {\n increment();\n } else if (e.deltaY < 0) {\n decrement();\n }\n }, [decrement, increment]);\n // If the input isn't supposed to receive input, disable scrolling.\n let scrollingDisabled = isDisabled || isReadOnly || !focusWithin;\n useScrollWheel({onScroll: onWheel, isDisabled: scrollingDisabled}, inputRef);\n\n // The inputMode attribute influences the software keyboard that is shown on touch devices.\n // Browsers and operating systems are quite inconsistent about what keys are available, however.\n // We choose between numeric and decimal based on whether we allow negative and fractional numbers,\n // and based on testing on various devices to determine what keys are available in each inputMode.\n let numberFormatter = useNumberFormatter(formatOptions);\n let intlOptions = useMemo(() => numberFormatter.resolvedOptions(), [numberFormatter]);\n let hasDecimals = intlOptions.maximumFractionDigits > 0;\n let hasNegative = isNaN(state.minValue) || state.minValue < 0;\n let inputMode: TextInputDOMProps['inputMode'] = 'numeric';\n if (isIPhone()) {\n // iPhone doesn't have a minus sign in either numeric or decimal.\n // Note this is only for iPhone, not iPad, which always has both\n // minus and decimal in numeric.\n if (hasNegative) {\n inputMode = 'text';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n } else if (isAndroid()) {\n // Android numeric has both a decimal point and minus key.\n // decimal does not have a minus key.\n if (hasNegative) {\n inputMode = 'numeric';\n } else if (hasDecimals) {\n inputMode = 'decimal';\n }\n }\n\n let onChange = value => {\n state.setInputValue(value);\n };\n\n let domProps = filterDOMProps(props);\n\n let {labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps} = useFormattedTextField({\n ...domProps,\n label,\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n validationState,\n value: state.inputValue,\n autoComplete: 'off',\n 'aria-label': props['aria-label'] || null,\n 'aria-labelledby': props['aria-labelledby'] || null,\n id: inputId,\n type: 'text', // Can't use type=\"number\" because then we can't have things like $ in the field.\n inputMode,\n onChange,\n onBlur,\n onFocus,\n onFocusChange,\n onKeyDown,\n onKeyUp,\n description,\n errorMessage\n }, state, inputRef);\n\n let inputProps = mergeProps(\n spinButtonProps,\n textFieldProps,\n focusProps,\n {\n // override the spinbutton role, we can't focus a spin button with VO\n role: null,\n // ignore aria-roledescription on iOS so that required state will announce when it is present\n 'aria-roledescription': (!isIOS() ? formatMessage('numberField') : null),\n 'aria-valuemax': null,\n 'aria-valuemin': null,\n 'aria-valuenow': null,\n 'aria-valuetext': null,\n autoCorrect: 'off',\n spellCheck: 'false'\n }\n );\n\n let onButtonPressStart = (e) => {\n // If focus is already on the input, keep it there so we don't hide the\n // software keyboard when tapping the increment/decrement buttons.\n if (document.activeElement === inputRef.current) {\n return;\n }\n\n // Otherwise, when using a mouse, move focus to the input.\n // On touch, or with a screen reader, focus the button so that the software\n // keyboard does not appear and the screen reader cursor is not moved off the button.\n if (e.pointerType === 'mouse') {\n inputRef.current.focus();\n } else {\n e.target.focus();\n }\n };\n\n // Determine the label for the increment and decrement buttons. There are 4 cases:\n //\n // 1. With a visible label that is a string: aria-label: `Increase ${props.label}`\n // 2. With a visible label that is JSX: aria-label: 'Increase', aria-labelledby: '${incrementId} ${labelId}'\n // 3. With an aria-label: aria-label: `Increase ${props['aria-label']}`\n // 4. With an aria-labelledby: aria-label: 'Increase', aria-labelledby: `${incrementId} ${props['aria-labelledby']}`\n //\n // (1) and (2) could possibly be combined and both use aria-labelledby. However, placing the label in\n // the aria-label string rather than using aria-labelledby gives more flexibility to translators to change\n // the order or add additional words around the label if needed.\n let fieldLabel = props['aria-label'] || (typeof props.label === 'string' ? props.label : '');\n let ariaLabelledby: string;\n if (!fieldLabel) {\n ariaLabelledby = props.label != null ? labelProps.id : props['aria-labelledby'];\n }\n\n let incrementId = useId();\n let decrementId = useId();\n\n let incrementButtonProps: AriaButtonProps = mergeProps(incButtonProps, {\n 'aria-label': incrementAriaLabel || formatMessage('increase', {fieldLabel}).trim(),\n id: ariaLabelledby && !incrementAriaLabel ? incrementId : null,\n 'aria-labelledby': ariaLabelledby && !incrementAriaLabel ? `${incrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canIncrement,\n onPressStart: onButtonPressStart\n });\n\n let decrementButtonProps: AriaButtonProps = mergeProps(decButtonProps, {\n 'aria-label': decrementAriaLabel || formatMessage('decrease', {fieldLabel}).trim(),\n id: ariaLabelledby && !decrementAriaLabel ? decrementId : null,\n 'aria-labelledby': ariaLabelledby && !decrementAriaLabel ? `${decrementId} ${ariaLabelledby}` : null,\n 'aria-controls': inputId,\n excludeFromTabOrder: true,\n preventFocusOnPress: true,\n isDisabled: !state.canDecrement,\n onPressStart: onButtonPressStart\n });\n\n return {\n groupProps: {\n role: 'group',\n 'aria-disabled': isDisabled,\n 'aria-invalid': validationState === 'invalid' ? 'true' : undefined,\n ...focusWithinProps\n },\n labelProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n errorMessageProps,\n descriptionProps\n };\n}\n"],"names":["JSON","parse","useNumberField","props","state","inputRef","id","decrementAriaLabel","incrementAriaLabel","isDisabled","isReadOnly","isRequired","minValue","maxValue","autoFocus","validationState","label","formatOptions","onBlur","onFocus","onFocusChange","onKeyDown","onKeyUp","description","errorMessage","increment","incrementToMax","decrement","decrementToMin","numberValue","commit","formatMessage","useMessageFormatter","intlMessages","inputId","useId","focusProps","useFocus","spinButtonProps","incrementButtonProps","incButtonProps","decrementButtonProps","decButtonProps","useSpinButton","onIncrement","onIncrementToMax","onDecrement","onDecrementToMin","value","textValue","inputValue","focusWithin","setFocusWithin","useState","focusWithinProps","useFocusWithin","onFocusWithinChange","onWheel","useCallback","e","Math","abs","deltaY","deltaX","scrollingDisabled","useScrollWheel","onScroll","numberFormatter","useNumberFormatter","intlOptions","useMemo","resolvedOptions","hasDecimals","maximumFractionDigits","hasNegative","isNaN","inputMode","isIPhone","isAndroid","onChange","setInputValue","domProps","filterDOMProps","labelProps","inputProps","textFieldProps","descriptionProps","errorMessageProps","useFormattedTextField","autoComplete","type","mergeProps","role","isIOS","autoCorrect","spellCheck","onButtonPressStart","document","activeElement","current","pointerType","focus","target","fieldLabel","ariaLabelledby","incrementId","decrementId","trim","excludeFromTabOrder","preventFocusOnPress","canIncrement","onPressStart","canDecrement","groupProps","undefined"],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A;A;A;A;AAqCA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAClD,wEAAwE;IACxE,UAAU,EAAE,eAAe,WAAW,CAAC,CAAC;IACxC,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAClD,mFAAmF;IACnF,oBAAoB,EAAE,eAAe,CAAC;IACtC,mFAAmF;IACnF,oBAAoB,EAAE,eAAe,CAAC;IACtC,gEAAgE;IAChE,gBAAgB,EAAE,eAAe,WAAW,CAAC,CAAC;IAC9C,kEAAkE;IAClE,iBAAiB,EAAE,eAAe,WAAW,CAAC,CAAA;CAC/C;AAED;A;A;GAGG;AACH,+BAA+B,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,gBAAgB,CAAC,GAAG,eAAe,
|
|
1
|
+
{"mappings":"A;A;A;A;AAqCA;IACE,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAClD,wEAAwE;IACxE,UAAU,EAAE,eAAe,WAAW,CAAC,CAAC;IACxC,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,gBAAgB,CAAC,CAAC;IAClD,mFAAmF;IACnF,oBAAoB,EAAE,eAAe,CAAC;IACtC,mFAAmF;IACnF,oBAAoB,EAAE,eAAe,CAAC;IACtC,gEAAgE;IAChE,gBAAgB,EAAE,eAAe,WAAW,CAAC,CAAC;IAC9C,kEAAkE;IAClE,iBAAiB,EAAE,eAAe,WAAW,CAAC,CAAA;CAC/C;AAED;A;A;GAGG;AACH,+BAA+B,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,UAAU,gBAAgB,CAAC,GAAG,eAAe,CAyO3I","sources":["./packages/@react-aria/numberfield/src/packages/@react-aria/numberfield/src/useNumberField.ts","./packages/@react-aria/numberfield/src/packages/@react-aria/numberfield/src/index.ts"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/numberfield",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-aria/i18n": "^3.3.
|
|
22
|
-
"@react-aria/interactions": "^3.
|
|
21
|
+
"@react-aria/i18n": "^3.3.3",
|
|
22
|
+
"@react-aria/interactions": "^3.7.0",
|
|
23
23
|
"@react-aria/live-announcer": "^3.0.1",
|
|
24
24
|
"@react-aria/spinbutton": "^3.0.1",
|
|
25
|
-
"@react-aria/textfield": "^3.
|
|
26
|
-
"@react-aria/utils": "^3.
|
|
25
|
+
"@react-aria/textfield": "^3.5.0",
|
|
26
|
+
"@react-aria/utils": "^3.10.0",
|
|
27
27
|
"@react-stately/numberfield": "^3.0.2",
|
|
28
28
|
"@react-types/button": "^3.4.1",
|
|
29
29
|
"@react-types/numberfield": "^3.1.0",
|
|
30
|
-
"@react-types/shared": "^3.
|
|
30
|
+
"@react-types/shared": "^3.10.0",
|
|
31
31
|
"@react-types/textfield": "^3.3.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "896eabe5521a0349a675c4773ed7629addd4b8c4"
|
|
41
41
|
}
|
package/src/useNumberField.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import {AriaButtonProps} from '@react-types/button';
|
|
14
14
|
import {AriaNumberFieldProps} from '@react-types/numberfield';
|
|
15
|
+
import {filterDOMProps, isAndroid, isIOS, isIPhone, mergeProps, useId} from '@react-aria/utils';
|
|
15
16
|
import {
|
|
16
17
|
HTMLAttributes,
|
|
17
18
|
InputHTMLAttributes,
|
|
@@ -23,7 +24,6 @@ import {
|
|
|
23
24
|
} from 'react';
|
|
24
25
|
// @ts-ignore
|
|
25
26
|
import intlMessages from '../intl/*.json';
|
|
26
|
-
import {isAndroid, isIOS, isIPhone, mergeProps, useId} from '@react-aria/utils';
|
|
27
27
|
import {NumberFieldState} from '@react-stately/numberfield';
|
|
28
28
|
import {TextInputDOMProps} from '@react-types/shared';
|
|
29
29
|
import {useFocus, useFocusWithin} from '@react-aria/interactions';
|
|
@@ -172,7 +172,10 @@ export function useNumberField(props: AriaNumberFieldProps, state: NumberFieldSt
|
|
|
172
172
|
state.setInputValue(value);
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
+
let domProps = filterDOMProps(props);
|
|
176
|
+
|
|
175
177
|
let {labelProps, inputProps: textFieldProps, descriptionProps, errorMessageProps} = useFormattedTextField({
|
|
178
|
+
...domProps,
|
|
176
179
|
label,
|
|
177
180
|
autoFocus,
|
|
178
181
|
isDisabled,
|