@react-aria/spinbutton 3.0.0-nightly.1356 → 3.0.0-nightly.1368
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 +19 -6
- package/dist/main.js.map +1 -1
- package/dist/module.js +19 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/useSpinButton.ts +20 -4
package/dist/main.js
CHANGED
|
@@ -302,6 +302,9 @@ function $85d07e5d20aa402a$export$e908e06f4b8e3402(props) {
|
|
|
302
302
|
minValue,
|
|
303
303
|
value
|
|
304
304
|
]);
|
|
305
|
+
let cancelContextMenu = (e)=>{
|
|
306
|
+
e.preventDefault();
|
|
307
|
+
};
|
|
305
308
|
return {
|
|
306
309
|
spinButtonProps: {
|
|
307
310
|
role: 'spinbutton',
|
|
@@ -317,16 +320,26 @@ function $85d07e5d20aa402a$export$e908e06f4b8e3402(props) {
|
|
|
317
320
|
onBlur: onBlur
|
|
318
321
|
},
|
|
319
322
|
incrementButtonProps: {
|
|
320
|
-
onPressStart: ()=>
|
|
321
|
-
|
|
322
|
-
|
|
323
|
+
onPressStart: ()=>{
|
|
324
|
+
onIncrementPressStart(400);
|
|
325
|
+
window.addEventListener('contextmenu', cancelContextMenu);
|
|
326
|
+
},
|
|
327
|
+
onPressEnd: ()=>{
|
|
328
|
+
clearAsync();
|
|
329
|
+
window.removeEventListener('contextmenu', cancelContextMenu);
|
|
330
|
+
},
|
|
323
331
|
onFocus: onFocus,
|
|
324
332
|
onBlur: onBlur
|
|
325
333
|
},
|
|
326
334
|
decrementButtonProps: {
|
|
327
|
-
onPressStart: ()=>
|
|
328
|
-
|
|
329
|
-
|
|
335
|
+
onPressStart: ()=>{
|
|
336
|
+
onDecrementPressStart(400);
|
|
337
|
+
window.addEventListener('contextmenu', cancelContextMenu);
|
|
338
|
+
},
|
|
339
|
+
onPressEnd: ()=>{
|
|
340
|
+
clearAsync();
|
|
341
|
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gBAAE,UAAU,IAAI,IAAI;YACnC,CAAe,gBAAE,UAAU,IAAI,IAAI;YACnC,CAAe,gBAAE,UAAU,IAAI,IAAI;uBACnC,SAAS;qBACT,OAAO;oBACP,MAAM;QACR,CAAC;QACD,oBAAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,qBAAqB,CAAC,GAAG;;YAC7C,UAAU,EAAE,UAAU;qBACtB,OAAO;oBACP,MAAM;QACR,CAAC;QACD,oBAAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,qBAAqB,CAAC,GAAG;;YAC7C,UAAU,EAAE,UAAU;qBACtB,OAAO;oBACP,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/intl/*.js","packages/@react-aria/spinbutton/intl/ar-AE.json","packages/@react-aria/spinbutton/intl/bg-BG.json","packages/@react-aria/spinbutton/intl/cs-CZ.json","packages/@react-aria/spinbutton/intl/da-DK.json","packages/@react-aria/spinbutton/intl/de-DE.json","packages/@react-aria/spinbutton/intl/el-GR.json","packages/@react-aria/spinbutton/intl/en-US.json","packages/@react-aria/spinbutton/intl/es-ES.json","packages/@react-aria/spinbutton/intl/et-EE.json","packages/@react-aria/spinbutton/intl/fi-FI.json","packages/@react-aria/spinbutton/intl/fr-FR.json","packages/@react-aria/spinbutton/intl/he-IL.json","packages/@react-aria/spinbutton/intl/hr-HR.json","packages/@react-aria/spinbutton/intl/hu-HU.json","packages/@react-aria/spinbutton/intl/it-IT.json","packages/@react-aria/spinbutton/intl/ja-JP.json","packages/@react-aria/spinbutton/intl/ko-KR.json","packages/@react-aria/spinbutton/intl/lt-LT.json","packages/@react-aria/spinbutton/intl/lv-LV.json","packages/@react-aria/spinbutton/intl/nb-NO.json","packages/@react-aria/spinbutton/intl/nl-NL.json","packages/@react-aria/spinbutton/intl/pl-PL.json","packages/@react-aria/spinbutton/intl/pt-BR.json","packages/@react-aria/spinbutton/intl/pt-PT.json","packages/@react-aria/spinbutton/intl/ro-RO.json","packages/@react-aria/spinbutton/intl/ru-RU.json","packages/@react-aria/spinbutton/intl/sk-SK.json","packages/@react-aria/spinbutton/intl/sl-SI.json","packages/@react-aria/spinbutton/intl/sr-SP.json","packages/@react-aria/spinbutton/intl/sv-SE.json","packages/@react-aria/spinbutton/intl/tr-TR.json","packages/@react-aria/spinbutton/intl/uk-UA.json","packages/@react-aria/spinbutton/intl/zh-CN.json","packages/@react-aria/spinbutton/intl/zh-TW.json"],"sourcesContent":["/*\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\nexport * from './useSpinButton';\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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {HTMLAttributes, useCallback, useEffect, useRef} from 'react';\nimport {InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useMessageFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation, ValueBase<number>, RangeInputBase<number> {\n textValue?: string,\n onIncrement?: () => void,\n onIncrementPage?: () => void,\n onDecrement?: () => void,\n onDecrementPage?: () => void,\n onDecrementToMin?: () => void,\n onIncrementToMax?: () => void\n}\n\nexport interface SpinbuttonAria {\n spinButtonProps: HTMLAttributes<HTMLDivElement>,\n incrementButtonProps: AriaButtonProps,\n decrementButtonProps: AriaButtonProps\n}\n\nexport function useSpinButton(\n props: SpinButtonProps\n): SpinbuttonAria {\n const _async = useRef<number>();\n let {\n value,\n textValue,\n minValue,\n maxValue,\n isDisabled,\n isReadOnly,\n isRequired,\n onIncrement,\n onIncrementPage,\n onDecrement,\n onDecrementPage,\n onDecrementToMin,\n onIncrementToMax\n } = props;\n const formatMessage = useMessageFormatter(intlMessages);\n\n const clearAsync = () => clearTimeout(_async.current);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => clearAsync();\n }, []);\n\n let onKeyDown = (e) => {\n if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) {\n return;\n }\n\n switch (e.key) {\n case 'PageUp':\n if (onIncrementPage) {\n e.preventDefault();\n onIncrementPage();\n break;\n }\n // fallthrough!\n case 'ArrowUp':\n case 'Up':\n if (onIncrement) {\n e.preventDefault();\n onIncrement();\n }\n break;\n case 'PageDown':\n if (onDecrementPage) {\n e.preventDefault();\n onDecrementPage();\n break;\n }\n // fallthrough\n case 'ArrowDown':\n case 'Down':\n if (onDecrement) {\n e.preventDefault();\n onDecrement();\n }\n break;\n case 'Home':\n if (onDecrementToMin) {\n e.preventDefault();\n onDecrementToMin();\n }\n break;\n case 'End':\n if (onIncrementToMax) {\n e.preventDefault();\n onIncrementToMax();\n }\n break;\n }\n };\n\n let isFocused = useRef(false);\n let onFocus = () => {\n isFocused.current = true;\n };\n\n let onBlur = () => {\n isFocused.current = false;\n };\n\n // Replace Unicode hyphen-minus (U+002D) with minus sign (U+2212).\n // This ensures that macOS VoiceOver announces it as \"minus\" even with other characters between the minus sign\n // and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen.\n // In addition, replace the empty string with the word \"Empty\" so that iOS VoiceOver does not read \"50%\" for an empty field.\n textValue = textValue === '' ? formatMessage('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n announce(textValue, 'assertive');\n }\n }, [textValue]);\n\n const onIncrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onIncrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(maxValue) || isNaN(value) || value < maxValue) {\n onIncrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onIncrement, maxValue, value]\n );\n\n const onDecrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onDecrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(minValue) || isNaN(value) || value > minValue) {\n onDecrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onDecrement, minValue, value]\n );\n\n return {\n spinButtonProps: {\n role: 'spinbutton',\n 'aria-valuenow': !isNaN(value) ? value : null,\n 'aria-valuetext': textValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-disabled': isDisabled || null,\n 'aria-readonly': isReadOnly || null,\n 'aria-required': isRequired || null,\n onKeyDown,\n onFocus,\n onBlur\n },\n incrementButtonProps: {\n onPressStart: () => onIncrementPressStart(400),\n onPressEnd: clearAsync,\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => onDecrementPressStart(400),\n onPressEnd: clearAsync,\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"Empty\": \"فارغ\"\n}\n","{\n \"Empty\": \"Изпразни\"\n}\n","{\n \"Empty\": \"Prázdné\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leer\"\n}\n","{\n \"Empty\": \"Άδειο\"\n}\n","{\n \"Empty\": \"Empty\"\n}\n","{\n \"Empty\": \"Vacío\"\n}\n","{\n \"Empty\": \"Tühjenda\"\n}\n","{\n \"Empty\": \"Tyhjä\"\n}\n","{\n \"Empty\": \"Vide\"\n}\n","{\n \"Empty\": \"ריק\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Üres\"\n}\n","{\n \"Empty\": \"Vuoto\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"비어 있음\"\n}\n","{\n \"Empty\": \"Tuščias\"\n}\n","{\n \"Empty\": \"Tukšs\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leeg\"\n}\n","{\n \"Empty\": \"Pusty\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Gol\"\n}\n","{\n \"Empty\": \"Не заполнено\"\n}\n","{\n \"Empty\": \"Prázdne\"\n}\n","{\n \"Empty\": \"Prazen\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Tomt\"\n}\n","{\n \"Empty\": \"Boş\"\n}\n","{\n \"Empty\": \"Пусто\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"空白\"\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AGAA,yBAAc,GAAG,IAAI,CAAC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AAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,CAAC;gBACnB,qBAAqB,CAAC,GAAG;gBACzB,MAAM,CAAC,gBAAgB,CAAC,CAAa,cAAE,iBAAiB;YAC1D,CAAC;YACD,UAAU,MAAQ,CAAC;gBACjB,UAAU;gBACV,MAAM,CAAC,mBAAmB,CAAC,CAAa,cAAE,iBAAiB;YAC7D,CAAC;qBACD,OAAO;oBACP,MAAM;QACR,CAAC;QACD,oBAAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,CAAC;gBACnB,qBAAqB,CAAC,GAAG;gBACzB,MAAM,CAAC,gBAAgB,CAAC,CAAa,cAAE,iBAAiB;YAC1D,CAAC;YACD,UAAU,MAAQ,CAAC;gBACjB,UAAU;gBACV,MAAM,CAAC,mBAAmB,CAAC,CAAa,cAAE,iBAAiB;YAC7D,CAAC;qBACD,OAAO;oBACP,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/intl/*.js","packages/@react-aria/spinbutton/intl/ar-AE.json","packages/@react-aria/spinbutton/intl/bg-BG.json","packages/@react-aria/spinbutton/intl/cs-CZ.json","packages/@react-aria/spinbutton/intl/da-DK.json","packages/@react-aria/spinbutton/intl/de-DE.json","packages/@react-aria/spinbutton/intl/el-GR.json","packages/@react-aria/spinbutton/intl/en-US.json","packages/@react-aria/spinbutton/intl/es-ES.json","packages/@react-aria/spinbutton/intl/et-EE.json","packages/@react-aria/spinbutton/intl/fi-FI.json","packages/@react-aria/spinbutton/intl/fr-FR.json","packages/@react-aria/spinbutton/intl/he-IL.json","packages/@react-aria/spinbutton/intl/hr-HR.json","packages/@react-aria/spinbutton/intl/hu-HU.json","packages/@react-aria/spinbutton/intl/it-IT.json","packages/@react-aria/spinbutton/intl/ja-JP.json","packages/@react-aria/spinbutton/intl/ko-KR.json","packages/@react-aria/spinbutton/intl/lt-LT.json","packages/@react-aria/spinbutton/intl/lv-LV.json","packages/@react-aria/spinbutton/intl/nb-NO.json","packages/@react-aria/spinbutton/intl/nl-NL.json","packages/@react-aria/spinbutton/intl/pl-PL.json","packages/@react-aria/spinbutton/intl/pt-BR.json","packages/@react-aria/spinbutton/intl/pt-PT.json","packages/@react-aria/spinbutton/intl/ro-RO.json","packages/@react-aria/spinbutton/intl/ru-RU.json","packages/@react-aria/spinbutton/intl/sk-SK.json","packages/@react-aria/spinbutton/intl/sl-SI.json","packages/@react-aria/spinbutton/intl/sr-SP.json","packages/@react-aria/spinbutton/intl/sv-SE.json","packages/@react-aria/spinbutton/intl/tr-TR.json","packages/@react-aria/spinbutton/intl/uk-UA.json","packages/@react-aria/spinbutton/intl/zh-CN.json","packages/@react-aria/spinbutton/intl/zh-TW.json"],"sourcesContent":["/*\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\nexport * from './useSpinButton';\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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {HTMLAttributes, useCallback, useEffect, useRef} from 'react';\nimport {InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useMessageFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation, ValueBase<number>, RangeInputBase<number> {\n textValue?: string,\n onIncrement?: () => void,\n onIncrementPage?: () => void,\n onDecrement?: () => void,\n onDecrementPage?: () => void,\n onDecrementToMin?: () => void,\n onIncrementToMax?: () => void\n}\n\nexport interface SpinbuttonAria {\n spinButtonProps: HTMLAttributes<HTMLDivElement>,\n incrementButtonProps: AriaButtonProps,\n decrementButtonProps: AriaButtonProps\n}\n\nexport function useSpinButton(\n props: SpinButtonProps\n): SpinbuttonAria {\n const _async = useRef<number>();\n let {\n value,\n textValue,\n minValue,\n maxValue,\n isDisabled,\n isReadOnly,\n isRequired,\n onIncrement,\n onIncrementPage,\n onDecrement,\n onDecrementPage,\n onDecrementToMin,\n onIncrementToMax\n } = props;\n const formatMessage = useMessageFormatter(intlMessages);\n\n const clearAsync = () => clearTimeout(_async.current);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => clearAsync();\n }, []);\n\n let onKeyDown = (e) => {\n if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) {\n return;\n }\n\n switch (e.key) {\n case 'PageUp':\n if (onIncrementPage) {\n e.preventDefault();\n onIncrementPage();\n break;\n }\n // fallthrough!\n case 'ArrowUp':\n case 'Up':\n if (onIncrement) {\n e.preventDefault();\n onIncrement();\n }\n break;\n case 'PageDown':\n if (onDecrementPage) {\n e.preventDefault();\n onDecrementPage();\n break;\n }\n // fallthrough\n case 'ArrowDown':\n case 'Down':\n if (onDecrement) {\n e.preventDefault();\n onDecrement();\n }\n break;\n case 'Home':\n if (onDecrementToMin) {\n e.preventDefault();\n onDecrementToMin();\n }\n break;\n case 'End':\n if (onIncrementToMax) {\n e.preventDefault();\n onIncrementToMax();\n }\n break;\n }\n };\n\n let isFocused = useRef(false);\n let onFocus = () => {\n isFocused.current = true;\n };\n\n let onBlur = () => {\n isFocused.current = false;\n };\n\n // Replace Unicode hyphen-minus (U+002D) with minus sign (U+2212).\n // This ensures that macOS VoiceOver announces it as \"minus\" even with other characters between the minus sign\n // and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen.\n // In addition, replace the empty string with the word \"Empty\" so that iOS VoiceOver does not read \"50%\" for an empty field.\n textValue = textValue === '' ? formatMessage('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n announce(textValue, 'assertive');\n }\n }, [textValue]);\n\n const onIncrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onIncrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(maxValue) || isNaN(value) || value < maxValue) {\n onIncrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onIncrement, maxValue, value]\n );\n\n const onDecrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onDecrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(minValue) || isNaN(value) || value > minValue) {\n onDecrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onDecrement, minValue, value]\n );\n\n let cancelContextMenu = (e) => {\n e.preventDefault();\n };\n\n return {\n spinButtonProps: {\n role: 'spinbutton',\n 'aria-valuenow': !isNaN(value) ? value : null,\n 'aria-valuetext': textValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-disabled': isDisabled || null,\n 'aria-readonly': isReadOnly || null,\n 'aria-required': isRequired || null,\n onKeyDown,\n onFocus,\n onBlur\n },\n incrementButtonProps: {\n onPressStart: () => {\n onIncrementPressStart(400);\n window.addEventListener('contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n window.removeEventListener('contextmenu', cancelContextMenu);\n },\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => {\n onDecrementPressStart(400);\n window.addEventListener('contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n window.removeEventListener('contextmenu', cancelContextMenu);\n },\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"Empty\": \"فارغ\"\n}\n","{\n \"Empty\": \"Изпразни\"\n}\n","{\n \"Empty\": \"Prázdné\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leer\"\n}\n","{\n \"Empty\": \"Άδειο\"\n}\n","{\n \"Empty\": \"Empty\"\n}\n","{\n \"Empty\": \"Vacío\"\n}\n","{\n \"Empty\": \"Tühjenda\"\n}\n","{\n \"Empty\": \"Tyhjä\"\n}\n","{\n \"Empty\": \"Vide\"\n}\n","{\n \"Empty\": \"ריק\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Üres\"\n}\n","{\n \"Empty\": \"Vuoto\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"비어 있음\"\n}\n","{\n \"Empty\": \"Tuščias\"\n}\n","{\n \"Empty\": \"Tukšs\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leeg\"\n}\n","{\n \"Empty\": \"Pusty\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Gol\"\n}\n","{\n \"Empty\": \"Не заполнено\"\n}\n","{\n \"Empty\": \"Prázdne\"\n}\n","{\n \"Empty\": \"Prazen\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Tomt\"\n}\n","{\n \"Empty\": \"Boş\"\n}\n","{\n \"Empty\": \"Пусто\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"空白\"\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -286,6 +286,9 @@ function $fade679e6d148269$export$e908e06f4b8e3402(props) {
|
|
|
286
286
|
minValue,
|
|
287
287
|
value
|
|
288
288
|
]);
|
|
289
|
+
let cancelContextMenu = (e)=>{
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
};
|
|
289
292
|
return {
|
|
290
293
|
spinButtonProps: {
|
|
291
294
|
role: 'spinbutton',
|
|
@@ -301,16 +304,26 @@ function $fade679e6d148269$export$e908e06f4b8e3402(props) {
|
|
|
301
304
|
onBlur: onBlur
|
|
302
305
|
},
|
|
303
306
|
incrementButtonProps: {
|
|
304
|
-
onPressStart: ()=>
|
|
305
|
-
|
|
306
|
-
|
|
307
|
+
onPressStart: ()=>{
|
|
308
|
+
onIncrementPressStart(400);
|
|
309
|
+
window.addEventListener('contextmenu', cancelContextMenu);
|
|
310
|
+
},
|
|
311
|
+
onPressEnd: ()=>{
|
|
312
|
+
clearAsync();
|
|
313
|
+
window.removeEventListener('contextmenu', cancelContextMenu);
|
|
314
|
+
},
|
|
307
315
|
onFocus: onFocus,
|
|
308
316
|
onBlur: onBlur
|
|
309
317
|
},
|
|
310
318
|
decrementButtonProps: {
|
|
311
|
-
onPressStart: ()=>
|
|
312
|
-
|
|
313
|
-
|
|
319
|
+
onPressStart: ()=>{
|
|
320
|
+
onDecrementPressStart(400);
|
|
321
|
+
window.addEventListener('contextmenu', cancelContextMenu);
|
|
322
|
+
},
|
|
323
|
+
onPressEnd: ()=>{
|
|
324
|
+
clearAsync();
|
|
325
|
+
window.removeEventListener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e,gBAAE,UAAU,IAAI,IAAI;YACnC,CAAe,gBAAE,UAAU,IAAI,IAAI;uBACnC,SAAS;qBACT,OAAO;oBACP,MAAM;QACR,CAAC;QACD,oBAAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,qBAAqB,CAAC,GAAG;;YAC7C,UAAU,EAAE,UAAU;qBACtB,OAAO;oBACP,MAAM;QACR,CAAC;QACD,oBAAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,qBAAqB,CAAC,GAAG;;YAC7C,UAAU,EAAE,UAAU;qBACtB,OAAO;oBACP,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/intl/*.js","packages/@react-aria/spinbutton/intl/ar-AE.json","packages/@react-aria/spinbutton/intl/bg-BG.json","packages/@react-aria/spinbutton/intl/cs-CZ.json","packages/@react-aria/spinbutton/intl/da-DK.json","packages/@react-aria/spinbutton/intl/de-DE.json","packages/@react-aria/spinbutton/intl/el-GR.json","packages/@react-aria/spinbutton/intl/en-US.json","packages/@react-aria/spinbutton/intl/es-ES.json","packages/@react-aria/spinbutton/intl/et-EE.json","packages/@react-aria/spinbutton/intl/fi-FI.json","packages/@react-aria/spinbutton/intl/fr-FR.json","packages/@react-aria/spinbutton/intl/he-IL.json","packages/@react-aria/spinbutton/intl/hr-HR.json","packages/@react-aria/spinbutton/intl/hu-HU.json","packages/@react-aria/spinbutton/intl/it-IT.json","packages/@react-aria/spinbutton/intl/ja-JP.json","packages/@react-aria/spinbutton/intl/ko-KR.json","packages/@react-aria/spinbutton/intl/lt-LT.json","packages/@react-aria/spinbutton/intl/lv-LV.json","packages/@react-aria/spinbutton/intl/nb-NO.json","packages/@react-aria/spinbutton/intl/nl-NL.json","packages/@react-aria/spinbutton/intl/pl-PL.json","packages/@react-aria/spinbutton/intl/pt-BR.json","packages/@react-aria/spinbutton/intl/pt-PT.json","packages/@react-aria/spinbutton/intl/ro-RO.json","packages/@react-aria/spinbutton/intl/ru-RU.json","packages/@react-aria/spinbutton/intl/sk-SK.json","packages/@react-aria/spinbutton/intl/sl-SI.json","packages/@react-aria/spinbutton/intl/sr-SP.json","packages/@react-aria/spinbutton/intl/sv-SE.json","packages/@react-aria/spinbutton/intl/tr-TR.json","packages/@react-aria/spinbutton/intl/uk-UA.json","packages/@react-aria/spinbutton/intl/zh-CN.json","packages/@react-aria/spinbutton/intl/zh-TW.json"],"sourcesContent":["/*\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\nexport * from './useSpinButton';\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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {HTMLAttributes, useCallback, useEffect, useRef} from 'react';\nimport {InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useMessageFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation, ValueBase<number>, RangeInputBase<number> {\n textValue?: string,\n onIncrement?: () => void,\n onIncrementPage?: () => void,\n onDecrement?: () => void,\n onDecrementPage?: () => void,\n onDecrementToMin?: () => void,\n onIncrementToMax?: () => void\n}\n\nexport interface SpinbuttonAria {\n spinButtonProps: HTMLAttributes<HTMLDivElement>,\n incrementButtonProps: AriaButtonProps,\n decrementButtonProps: AriaButtonProps\n}\n\nexport function useSpinButton(\n props: SpinButtonProps\n): SpinbuttonAria {\n const _async = useRef<number>();\n let {\n value,\n textValue,\n minValue,\n maxValue,\n isDisabled,\n isReadOnly,\n isRequired,\n onIncrement,\n onIncrementPage,\n onDecrement,\n onDecrementPage,\n onDecrementToMin,\n onIncrementToMax\n } = props;\n const formatMessage = useMessageFormatter(intlMessages);\n\n const clearAsync = () => clearTimeout(_async.current);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => clearAsync();\n }, []);\n\n let onKeyDown = (e) => {\n if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) {\n return;\n }\n\n switch (e.key) {\n case 'PageUp':\n if (onIncrementPage) {\n e.preventDefault();\n onIncrementPage();\n break;\n }\n // fallthrough!\n case 'ArrowUp':\n case 'Up':\n if (onIncrement) {\n e.preventDefault();\n onIncrement();\n }\n break;\n case 'PageDown':\n if (onDecrementPage) {\n e.preventDefault();\n onDecrementPage();\n break;\n }\n // fallthrough\n case 'ArrowDown':\n case 'Down':\n if (onDecrement) {\n e.preventDefault();\n onDecrement();\n }\n break;\n case 'Home':\n if (onDecrementToMin) {\n e.preventDefault();\n onDecrementToMin();\n }\n break;\n case 'End':\n if (onIncrementToMax) {\n e.preventDefault();\n onIncrementToMax();\n }\n break;\n }\n };\n\n let isFocused = useRef(false);\n let onFocus = () => {\n isFocused.current = true;\n };\n\n let onBlur = () => {\n isFocused.current = false;\n };\n\n // Replace Unicode hyphen-minus (U+002D) with minus sign (U+2212).\n // This ensures that macOS VoiceOver announces it as \"minus\" even with other characters between the minus sign\n // and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen.\n // In addition, replace the empty string with the word \"Empty\" so that iOS VoiceOver does not read \"50%\" for an empty field.\n textValue = textValue === '' ? formatMessage('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n announce(textValue, 'assertive');\n }\n }, [textValue]);\n\n const onIncrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onIncrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(maxValue) || isNaN(value) || value < maxValue) {\n onIncrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onIncrement, maxValue, value]\n );\n\n const onDecrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onDecrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(minValue) || isNaN(value) || value > minValue) {\n onDecrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onDecrement, minValue, value]\n );\n\n return {\n spinButtonProps: {\n role: 'spinbutton',\n 'aria-valuenow': !isNaN(value) ? value : null,\n 'aria-valuetext': textValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-disabled': isDisabled || null,\n 'aria-readonly': isReadOnly || null,\n 'aria-required': isRequired || null,\n onKeyDown,\n onFocus,\n onBlur\n },\n incrementButtonProps: {\n onPressStart: () => onIncrementPressStart(400),\n onPressEnd: clearAsync,\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => onDecrementPressStart(400),\n onPressEnd: clearAsync,\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"Empty\": \"فارغ\"\n}\n","{\n \"Empty\": \"Изпразни\"\n}\n","{\n \"Empty\": \"Prázdné\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leer\"\n}\n","{\n \"Empty\": \"Άδειο\"\n}\n","{\n \"Empty\": \"Empty\"\n}\n","{\n \"Empty\": \"Vacío\"\n}\n","{\n \"Empty\": \"Tühjenda\"\n}\n","{\n \"Empty\": \"Tyhjä\"\n}\n","{\n \"Empty\": \"Vide\"\n}\n","{\n \"Empty\": \"ריק\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Üres\"\n}\n","{\n \"Empty\": \"Vuoto\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"비어 있음\"\n}\n","{\n \"Empty\": \"Tuščias\"\n}\n","{\n \"Empty\": \"Tukšs\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leeg\"\n}\n","{\n \"Empty\": \"Pusty\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Gol\"\n}\n","{\n \"Empty\": \"Не заполнено\"\n}\n","{\n \"Empty\": \"Prázdne\"\n}\n","{\n \"Empty\": \"Prazen\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Tomt\"\n}\n","{\n \"Empty\": \"Boş\"\n}\n","{\n \"Empty\": \"Пусто\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"空白\"\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AGAA,yBAAc,GAAG,IAAI,CAAC,KAAK,CAAC,CAAsB;;;;ACAlD,yBAAc,GAAG,IAAI,CAA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,CAAC,GAAG;gBACzB,MAAM,CAAC,gBAAgB,CAAC,CAAa,cAAE,iBAAiB;YAC1D,CAAC;YACD,UAAU,MAAQ,CAAC;gBACjB,UAAU;gBACV,MAAM,CAAC,mBAAmB,CAAC,CAAa,cAAE,iBAAiB;YAC7D,CAAC;qBACD,OAAO;oBACP,MAAM;QACR,CAAC;QACD,oBAAoB,EAAE,CAAC;YACrB,YAAY,MAAQ,CAAC;gBACnB,qBAAqB,CAAC,GAAG;gBACzB,MAAM,CAAC,gBAAgB,CAAC,CAAa,cAAE,iBAAiB;YAC1D,CAAC;YACD,UAAU,MAAQ,CAAC;gBACjB,UAAU;gBACV,MAAM,CAAC,mBAAmB,CAAC,CAAa,cAAE,iBAAiB;YAC7D,CAAC;qBACD,OAAO;oBACP,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/intl/*.js","packages/@react-aria/spinbutton/intl/ar-AE.json","packages/@react-aria/spinbutton/intl/bg-BG.json","packages/@react-aria/spinbutton/intl/cs-CZ.json","packages/@react-aria/spinbutton/intl/da-DK.json","packages/@react-aria/spinbutton/intl/de-DE.json","packages/@react-aria/spinbutton/intl/el-GR.json","packages/@react-aria/spinbutton/intl/en-US.json","packages/@react-aria/spinbutton/intl/es-ES.json","packages/@react-aria/spinbutton/intl/et-EE.json","packages/@react-aria/spinbutton/intl/fi-FI.json","packages/@react-aria/spinbutton/intl/fr-FR.json","packages/@react-aria/spinbutton/intl/he-IL.json","packages/@react-aria/spinbutton/intl/hr-HR.json","packages/@react-aria/spinbutton/intl/hu-HU.json","packages/@react-aria/spinbutton/intl/it-IT.json","packages/@react-aria/spinbutton/intl/ja-JP.json","packages/@react-aria/spinbutton/intl/ko-KR.json","packages/@react-aria/spinbutton/intl/lt-LT.json","packages/@react-aria/spinbutton/intl/lv-LV.json","packages/@react-aria/spinbutton/intl/nb-NO.json","packages/@react-aria/spinbutton/intl/nl-NL.json","packages/@react-aria/spinbutton/intl/pl-PL.json","packages/@react-aria/spinbutton/intl/pt-BR.json","packages/@react-aria/spinbutton/intl/pt-PT.json","packages/@react-aria/spinbutton/intl/ro-RO.json","packages/@react-aria/spinbutton/intl/ru-RU.json","packages/@react-aria/spinbutton/intl/sk-SK.json","packages/@react-aria/spinbutton/intl/sl-SI.json","packages/@react-aria/spinbutton/intl/sr-SP.json","packages/@react-aria/spinbutton/intl/sv-SE.json","packages/@react-aria/spinbutton/intl/tr-TR.json","packages/@react-aria/spinbutton/intl/uk-UA.json","packages/@react-aria/spinbutton/intl/zh-CN.json","packages/@react-aria/spinbutton/intl/zh-TW.json"],"sourcesContent":["/*\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\nexport * from './useSpinButton';\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 {announce} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {HTMLAttributes, useCallback, useEffect, useRef} from 'react';\nimport {InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useMessageFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation, ValueBase<number>, RangeInputBase<number> {\n textValue?: string,\n onIncrement?: () => void,\n onIncrementPage?: () => void,\n onDecrement?: () => void,\n onDecrementPage?: () => void,\n onDecrementToMin?: () => void,\n onIncrementToMax?: () => void\n}\n\nexport interface SpinbuttonAria {\n spinButtonProps: HTMLAttributes<HTMLDivElement>,\n incrementButtonProps: AriaButtonProps,\n decrementButtonProps: AriaButtonProps\n}\n\nexport function useSpinButton(\n props: SpinButtonProps\n): SpinbuttonAria {\n const _async = useRef<number>();\n let {\n value,\n textValue,\n minValue,\n maxValue,\n isDisabled,\n isReadOnly,\n isRequired,\n onIncrement,\n onIncrementPage,\n onDecrement,\n onDecrementPage,\n onDecrementToMin,\n onIncrementToMax\n } = props;\n const formatMessage = useMessageFormatter(intlMessages);\n\n const clearAsync = () => clearTimeout(_async.current);\n\n // eslint-disable-next-line arrow-body-style\n useEffect(() => {\n return () => clearAsync();\n }, []);\n\n let onKeyDown = (e) => {\n if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) {\n return;\n }\n\n switch (e.key) {\n case 'PageUp':\n if (onIncrementPage) {\n e.preventDefault();\n onIncrementPage();\n break;\n }\n // fallthrough!\n case 'ArrowUp':\n case 'Up':\n if (onIncrement) {\n e.preventDefault();\n onIncrement();\n }\n break;\n case 'PageDown':\n if (onDecrementPage) {\n e.preventDefault();\n onDecrementPage();\n break;\n }\n // fallthrough\n case 'ArrowDown':\n case 'Down':\n if (onDecrement) {\n e.preventDefault();\n onDecrement();\n }\n break;\n case 'Home':\n if (onDecrementToMin) {\n e.preventDefault();\n onDecrementToMin();\n }\n break;\n case 'End':\n if (onIncrementToMax) {\n e.preventDefault();\n onIncrementToMax();\n }\n break;\n }\n };\n\n let isFocused = useRef(false);\n let onFocus = () => {\n isFocused.current = true;\n };\n\n let onBlur = () => {\n isFocused.current = false;\n };\n\n // Replace Unicode hyphen-minus (U+002D) with minus sign (U+2212).\n // This ensures that macOS VoiceOver announces it as \"minus\" even with other characters between the minus sign\n // and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen.\n // In addition, replace the empty string with the word \"Empty\" so that iOS VoiceOver does not read \"50%\" for an empty field.\n textValue = textValue === '' ? formatMessage('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n announce(textValue, 'assertive');\n }\n }, [textValue]);\n\n const onIncrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onIncrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(maxValue) || isNaN(value) || value < maxValue) {\n onIncrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onIncrement, maxValue, value]\n );\n\n const onDecrementPressStart = useCallback(\n (initialStepDelay: number) => {\n clearAsync();\n onDecrement();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if (isNaN(minValue) || isNaN(value) || value > minValue) {\n onDecrementPressStart(60);\n }\n },\n initialStepDelay\n );\n },\n [onDecrement, minValue, value]\n );\n\n let cancelContextMenu = (e) => {\n e.preventDefault();\n };\n\n return {\n spinButtonProps: {\n role: 'spinbutton',\n 'aria-valuenow': !isNaN(value) ? value : null,\n 'aria-valuetext': textValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-disabled': isDisabled || null,\n 'aria-readonly': isReadOnly || null,\n 'aria-required': isRequired || null,\n onKeyDown,\n onFocus,\n onBlur\n },\n incrementButtonProps: {\n onPressStart: () => {\n onIncrementPressStart(400);\n window.addEventListener('contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n window.removeEventListener('contextmenu', cancelContextMenu);\n },\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => {\n onDecrementPressStart(400);\n window.addEventListener('contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n window.removeEventListener('contextmenu', cancelContextMenu);\n },\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"./ar-AE.json\");\nconst _temp1 = require(\"./bg-BG.json\");\nconst _temp2 = require(\"./cs-CZ.json\");\nconst _temp3 = require(\"./da-DK.json\");\nconst _temp4 = require(\"./de-DE.json\");\nconst _temp5 = require(\"./el-GR.json\");\nconst _temp6 = require(\"./en-US.json\");\nconst _temp7 = require(\"./es-ES.json\");\nconst _temp8 = require(\"./et-EE.json\");\nconst _temp9 = require(\"./fi-FI.json\");\nconst _temp10 = require(\"./fr-FR.json\");\nconst _temp11 = require(\"./he-IL.json\");\nconst _temp12 = require(\"./hr-HR.json\");\nconst _temp13 = require(\"./hu-HU.json\");\nconst _temp14 = require(\"./it-IT.json\");\nconst _temp15 = require(\"./ja-JP.json\");\nconst _temp16 = require(\"./ko-KR.json\");\nconst _temp17 = require(\"./lt-LT.json\");\nconst _temp18 = require(\"./lv-LV.json\");\nconst _temp19 = require(\"./nb-NO.json\");\nconst _temp20 = require(\"./nl-NL.json\");\nconst _temp21 = require(\"./pl-PL.json\");\nconst _temp22 = require(\"./pt-BR.json\");\nconst _temp23 = require(\"./pt-PT.json\");\nconst _temp24 = require(\"./ro-RO.json\");\nconst _temp25 = require(\"./ru-RU.json\");\nconst _temp26 = require(\"./sk-SK.json\");\nconst _temp27 = require(\"./sl-SI.json\");\nconst _temp28 = require(\"./sr-SP.json\");\nconst _temp29 = require(\"./sv-SE.json\");\nconst _temp30 = require(\"./tr-TR.json\");\nconst _temp31 = require(\"./uk-UA.json\");\nconst _temp32 = require(\"./zh-CN.json\");\nconst _temp33 = require(\"./zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"Empty\": \"فارغ\"\n}\n","{\n \"Empty\": \"Изпразни\"\n}\n","{\n \"Empty\": \"Prázdné\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leer\"\n}\n","{\n \"Empty\": \"Άδειο\"\n}\n","{\n \"Empty\": \"Empty\"\n}\n","{\n \"Empty\": \"Vacío\"\n}\n","{\n \"Empty\": \"Tühjenda\"\n}\n","{\n \"Empty\": \"Tyhjä\"\n}\n","{\n \"Empty\": \"Vide\"\n}\n","{\n \"Empty\": \"ריק\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Üres\"\n}\n","{\n \"Empty\": \"Vuoto\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"비어 있음\"\n}\n","{\n \"Empty\": \"Tuščias\"\n}\n","{\n \"Empty\": \"Tukšs\"\n}\n","{\n \"Empty\": \"Tom\"\n}\n","{\n \"Empty\": \"Leeg\"\n}\n","{\n \"Empty\": \"Pusty\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Vazio\"\n}\n","{\n \"Empty\": \"Gol\"\n}\n","{\n \"Empty\": \"Не заполнено\"\n}\n","{\n \"Empty\": \"Prázdne\"\n}\n","{\n \"Empty\": \"Prazen\"\n}\n","{\n \"Empty\": \"Prazno\"\n}\n","{\n \"Empty\": \"Tomt\"\n}\n","{\n \"Empty\": \"Boş\"\n}\n","{\n \"Empty\": \"Пусто\"\n}\n","{\n \"Empty\": \"空\"\n}\n","{\n \"Empty\": \"空白\"\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAqBA,gCAAiC,SAAQ,SAAS,EAAE,UAAU,EAAE,UAAU,MAAM,CAAC,EAAE,eAAe,MAAM,CAAC;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAED;IACE,eAAe,EAAE,eAAe,cAAc,CAAC,CAAC;IAChD,oBAAoB,EAAE,eAAe,CAAC;IACtC,oBAAoB,EAAE,eAAe,CAAA;CACtC;AAED,8BACE,KAAK,EAAE,eAAe,GACrB,cAAc,
|
|
1
|
+
{"mappings":";;;AAqBA,gCAAiC,SAAQ,SAAS,EAAE,UAAU,EAAE,UAAU,MAAM,CAAC,EAAE,eAAe,MAAM,CAAC;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAED;IACE,eAAe,EAAE,eAAe,cAAc,CAAC,CAAC;IAChD,oBAAoB,EAAE,eAAe,CAAC;IACtC,oBAAoB,EAAE,eAAe,CAAA;CACtC;AAED,8BACE,KAAK,EAAE,eAAe,GACrB,cAAc,CA6KhB","sources":["packages/@react-aria/spinbutton/src/packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/src/packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/index.ts"],"sourcesContent":[null,null,"/*\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\nexport * from './useSpinButton';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/spinbutton",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.1368+2842ff524",
|
|
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/i18n": "3.0.0-nightly.
|
|
22
|
-
"@react-aria/live-announcer": "3.0.0-nightly.
|
|
23
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
24
|
-
"@react-types/button": "3.4.2-nightly.
|
|
25
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-aria/i18n": "3.0.0-nightly.1368+2842ff524",
|
|
22
|
+
"@react-aria/live-announcer": "3.0.0-nightly.1368+2842ff524",
|
|
23
|
+
"@react-aria/utils": "3.0.0-nightly.1368+2842ff524",
|
|
24
|
+
"@react-types/button": "3.4.2-nightly.3059+2842ff524",
|
|
25
|
+
"@react-types/shared": "3.0.0-nightly.1368+2842ff524"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.8.0 || ^17.0.0-rc.1",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "2842ff524282eb9847eadb1d98d9a293ecbaa0a2"
|
|
35
35
|
}
|
package/src/useSpinButton.ts
CHANGED
|
@@ -167,6 +167,10 @@ export function useSpinButton(
|
|
|
167
167
|
[onDecrement, minValue, value]
|
|
168
168
|
);
|
|
169
169
|
|
|
170
|
+
let cancelContextMenu = (e) => {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
};
|
|
173
|
+
|
|
170
174
|
return {
|
|
171
175
|
spinButtonProps: {
|
|
172
176
|
role: 'spinbutton',
|
|
@@ -182,14 +186,26 @@ export function useSpinButton(
|
|
|
182
186
|
onBlur
|
|
183
187
|
},
|
|
184
188
|
incrementButtonProps: {
|
|
185
|
-
onPressStart: () =>
|
|
186
|
-
|
|
189
|
+
onPressStart: () => {
|
|
190
|
+
onIncrementPressStart(400);
|
|
191
|
+
window.addEventListener('contextmenu', cancelContextMenu);
|
|
192
|
+
},
|
|
193
|
+
onPressEnd: () => {
|
|
194
|
+
clearAsync();
|
|
195
|
+
window.removeEventListener('contextmenu', cancelContextMenu);
|
|
196
|
+
},
|
|
187
197
|
onFocus,
|
|
188
198
|
onBlur
|
|
189
199
|
},
|
|
190
200
|
decrementButtonProps: {
|
|
191
|
-
onPressStart: () =>
|
|
192
|
-
|
|
201
|
+
onPressStart: () => {
|
|
202
|
+
onDecrementPressStart(400);
|
|
203
|
+
window.addEventListener('contextmenu', cancelContextMenu);
|
|
204
|
+
},
|
|
205
|
+
onPressEnd: () => {
|
|
206
|
+
clearAsync();
|
|
207
|
+
window.removeEventListener('contextmenu', cancelContextMenu);
|
|
208
|
+
},
|
|
193
209
|
onFocus,
|
|
194
210
|
onBlur
|
|
195
211
|
}
|