@react-aria/spinbutton 3.6.1 → 3.6.2

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.
Files changed (177) hide show
  1. package/dist/import.mjs +188 -52
  2. package/dist/main.js +188 -52
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +188 -52
  5. package/dist/module.js.map +1 -1
  6. package/package.json +4 -4
  7. package/src/useSpinButton.ts +18 -18
  8. package/dist/ar-AE.main.js +0 -6
  9. package/dist/ar-AE.main.js.map +0 -1
  10. package/dist/ar-AE.mjs +0 -8
  11. package/dist/ar-AE.module.js +0 -8
  12. package/dist/ar-AE.module.js.map +0 -1
  13. package/dist/bg-BG.main.js +0 -6
  14. package/dist/bg-BG.main.js.map +0 -1
  15. package/dist/bg-BG.mjs +0 -8
  16. package/dist/bg-BG.module.js +0 -8
  17. package/dist/bg-BG.module.js.map +0 -1
  18. package/dist/cs-CZ.main.js +0 -6
  19. package/dist/cs-CZ.main.js.map +0 -1
  20. package/dist/cs-CZ.mjs +0 -8
  21. package/dist/cs-CZ.module.js +0 -8
  22. package/dist/cs-CZ.module.js.map +0 -1
  23. package/dist/da-DK.main.js +0 -6
  24. package/dist/da-DK.main.js.map +0 -1
  25. package/dist/da-DK.mjs +0 -8
  26. package/dist/da-DK.module.js +0 -8
  27. package/dist/da-DK.module.js.map +0 -1
  28. package/dist/de-DE.main.js +0 -6
  29. package/dist/de-DE.main.js.map +0 -1
  30. package/dist/de-DE.mjs +0 -8
  31. package/dist/de-DE.module.js +0 -8
  32. package/dist/de-DE.module.js.map +0 -1
  33. package/dist/el-GR.main.js +0 -6
  34. package/dist/el-GR.main.js.map +0 -1
  35. package/dist/el-GR.mjs +0 -8
  36. package/dist/el-GR.module.js +0 -8
  37. package/dist/el-GR.module.js.map +0 -1
  38. package/dist/en-US.main.js +0 -6
  39. package/dist/en-US.main.js.map +0 -1
  40. package/dist/en-US.mjs +0 -8
  41. package/dist/en-US.module.js +0 -8
  42. package/dist/en-US.module.js.map +0 -1
  43. package/dist/es-ES.main.js +0 -6
  44. package/dist/es-ES.main.js.map +0 -1
  45. package/dist/es-ES.mjs +0 -8
  46. package/dist/es-ES.module.js +0 -8
  47. package/dist/es-ES.module.js.map +0 -1
  48. package/dist/et-EE.main.js +0 -6
  49. package/dist/et-EE.main.js.map +0 -1
  50. package/dist/et-EE.mjs +0 -8
  51. package/dist/et-EE.module.js +0 -8
  52. package/dist/et-EE.module.js.map +0 -1
  53. package/dist/fi-FI.main.js +0 -6
  54. package/dist/fi-FI.main.js.map +0 -1
  55. package/dist/fi-FI.mjs +0 -8
  56. package/dist/fi-FI.module.js +0 -8
  57. package/dist/fi-FI.module.js.map +0 -1
  58. package/dist/fr-FR.main.js +0 -6
  59. package/dist/fr-FR.main.js.map +0 -1
  60. package/dist/fr-FR.mjs +0 -8
  61. package/dist/fr-FR.module.js +0 -8
  62. package/dist/fr-FR.module.js.map +0 -1
  63. package/dist/he-IL.main.js +0 -6
  64. package/dist/he-IL.main.js.map +0 -1
  65. package/dist/he-IL.mjs +0 -8
  66. package/dist/he-IL.module.js +0 -8
  67. package/dist/he-IL.module.js.map +0 -1
  68. package/dist/hr-HR.main.js +0 -6
  69. package/dist/hr-HR.main.js.map +0 -1
  70. package/dist/hr-HR.mjs +0 -8
  71. package/dist/hr-HR.module.js +0 -8
  72. package/dist/hr-HR.module.js.map +0 -1
  73. package/dist/hu-HU.main.js +0 -6
  74. package/dist/hu-HU.main.js.map +0 -1
  75. package/dist/hu-HU.mjs +0 -8
  76. package/dist/hu-HU.module.js +0 -8
  77. package/dist/hu-HU.module.js.map +0 -1
  78. package/dist/it-IT.main.js +0 -6
  79. package/dist/it-IT.main.js.map +0 -1
  80. package/dist/it-IT.mjs +0 -8
  81. package/dist/it-IT.module.js +0 -8
  82. package/dist/it-IT.module.js.map +0 -1
  83. package/dist/ja-JP.main.js +0 -6
  84. package/dist/ja-JP.main.js.map +0 -1
  85. package/dist/ja-JP.mjs +0 -8
  86. package/dist/ja-JP.module.js +0 -8
  87. package/dist/ja-JP.module.js.map +0 -1
  88. package/dist/ko-KR.main.js +0 -6
  89. package/dist/ko-KR.main.js.map +0 -1
  90. package/dist/ko-KR.mjs +0 -8
  91. package/dist/ko-KR.module.js +0 -8
  92. package/dist/ko-KR.module.js.map +0 -1
  93. package/dist/lt-LT.main.js +0 -6
  94. package/dist/lt-LT.main.js.map +0 -1
  95. package/dist/lt-LT.mjs +0 -8
  96. package/dist/lt-LT.module.js +0 -8
  97. package/dist/lt-LT.module.js.map +0 -1
  98. package/dist/lv-LV.main.js +0 -6
  99. package/dist/lv-LV.main.js.map +0 -1
  100. package/dist/lv-LV.mjs +0 -8
  101. package/dist/lv-LV.module.js +0 -8
  102. package/dist/lv-LV.module.js.map +0 -1
  103. package/dist/nb-NO.main.js +0 -6
  104. package/dist/nb-NO.main.js.map +0 -1
  105. package/dist/nb-NO.mjs +0 -8
  106. package/dist/nb-NO.module.js +0 -8
  107. package/dist/nb-NO.module.js.map +0 -1
  108. package/dist/nl-NL.main.js +0 -6
  109. package/dist/nl-NL.main.js.map +0 -1
  110. package/dist/nl-NL.mjs +0 -8
  111. package/dist/nl-NL.module.js +0 -8
  112. package/dist/nl-NL.module.js.map +0 -1
  113. package/dist/pl-PL.main.js +0 -6
  114. package/dist/pl-PL.main.js.map +0 -1
  115. package/dist/pl-PL.mjs +0 -8
  116. package/dist/pl-PL.module.js +0 -8
  117. package/dist/pl-PL.module.js.map +0 -1
  118. package/dist/pt-BR.main.js +0 -6
  119. package/dist/pt-BR.main.js.map +0 -1
  120. package/dist/pt-BR.mjs +0 -8
  121. package/dist/pt-BR.module.js +0 -8
  122. package/dist/pt-BR.module.js.map +0 -1
  123. package/dist/pt-PT.main.js +0 -6
  124. package/dist/pt-PT.main.js.map +0 -1
  125. package/dist/pt-PT.mjs +0 -8
  126. package/dist/pt-PT.module.js +0 -8
  127. package/dist/pt-PT.module.js.map +0 -1
  128. package/dist/ro-RO.main.js +0 -6
  129. package/dist/ro-RO.main.js.map +0 -1
  130. package/dist/ro-RO.mjs +0 -8
  131. package/dist/ro-RO.module.js +0 -8
  132. package/dist/ro-RO.module.js.map +0 -1
  133. package/dist/ru-RU.main.js +0 -6
  134. package/dist/ru-RU.main.js.map +0 -1
  135. package/dist/ru-RU.mjs +0 -8
  136. package/dist/ru-RU.module.js +0 -8
  137. package/dist/ru-RU.module.js.map +0 -1
  138. package/dist/sk-SK.main.js +0 -6
  139. package/dist/sk-SK.main.js.map +0 -1
  140. package/dist/sk-SK.mjs +0 -8
  141. package/dist/sk-SK.module.js +0 -8
  142. package/dist/sk-SK.module.js.map +0 -1
  143. package/dist/sl-SI.main.js +0 -6
  144. package/dist/sl-SI.main.js.map +0 -1
  145. package/dist/sl-SI.mjs +0 -8
  146. package/dist/sl-SI.module.js +0 -8
  147. package/dist/sl-SI.module.js.map +0 -1
  148. package/dist/sr-SP.main.js +0 -6
  149. package/dist/sr-SP.main.js.map +0 -1
  150. package/dist/sr-SP.mjs +0 -8
  151. package/dist/sr-SP.module.js +0 -8
  152. package/dist/sr-SP.module.js.map +0 -1
  153. package/dist/sv-SE.main.js +0 -6
  154. package/dist/sv-SE.main.js.map +0 -1
  155. package/dist/sv-SE.mjs +0 -8
  156. package/dist/sv-SE.module.js +0 -8
  157. package/dist/sv-SE.module.js.map +0 -1
  158. package/dist/tr-TR.main.js +0 -6
  159. package/dist/tr-TR.main.js.map +0 -1
  160. package/dist/tr-TR.mjs +0 -8
  161. package/dist/tr-TR.module.js +0 -8
  162. package/dist/tr-TR.module.js.map +0 -1
  163. package/dist/uk-UA.main.js +0 -6
  164. package/dist/uk-UA.main.js.map +0 -1
  165. package/dist/uk-UA.mjs +0 -8
  166. package/dist/uk-UA.module.js +0 -8
  167. package/dist/uk-UA.module.js.map +0 -1
  168. package/dist/zh-CN.main.js +0 -6
  169. package/dist/zh-CN.main.js.map +0 -1
  170. package/dist/zh-CN.mjs +0 -8
  171. package/dist/zh-CN.module.js +0 -8
  172. package/dist/zh-CN.module.js.map +0 -1
  173. package/dist/zh-TW.main.js +0 -6
  174. package/dist/zh-TW.main.js.map +0 -1
  175. package/dist/zh-TW.mjs +0 -8
  176. package/dist/zh-TW.module.js +0 -8
  177. package/dist/zh-TW.module.js.map +0 -1
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwBD,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX;;;;;;AD/BO,SAAS,0CACd,KAAsB;IAEtB,MAAM,SAAS,CAAA,GAAA,mBAAK;IACpB,IAAI,SACF,KAAK,aACL,SAAS,YACT,QAAQ,YACR,QAAQ,cACR,UAAU,cACV,UAAU,cACV,UAAU,eACV,WAAW,mBACX,eAAe,eACf,WAAW,mBACX,eAAe,oBACf,gBAAgB,oBAChB,gBAAgB,EACjB,GAAG;IACJ,MAAM,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,gEAAW,GAAG;IAElE,MAAM,aAAa,IAAM,aAAa,OAAO,OAAO;IAEpD,4CAA4C;IAC5C,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO,IAAM;IACf,GAAG,EAAE;IAEL,IAAI,YAAY,CAAC;QACf,IAAI,EAAE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AEJ;IAGF,MAAM,wBAAwB,CAAA,GAAA,oCAAa,EACzC,CAAC;QACC;QACA;QACA,qCAAqC;QACrC,OAAO,OAAO,GAAG,OAAO,UAAU,CAChC;YACE,IAAI,MAAM,aAAa,MAAM,UAAU,QAAQ,UAC7C,sBAAsB;QAE1B,GACA;IAEJ;IAGF,IAAI,oBAAoB,CAAC;QACvB,EAAE,cAAc;IAClB;IAEA,IAAI,qBAAC,iBAAiB,4BAAE,wBAAwB,EAAC,GAAG,CAAA,GAAA,wCAAiB;IAErE,OAAO;QACL,iBAAiB;YACf,MAAM;YACN,iBAAiB,CAAC,MAAM,SAAS,QAAQ;YACzC,kBAAkB;YAClB,iBAAiB;YACjB,iBAAiB;YACjB,iBAAiB,cAAc;YAC/B,iBAAiB,cAAc;YAC/B,iBAAiB,cAAc;uBAC/B;qBACA;oBACA;QACF;QACA,sBAAsB;YACpB,cAAc;gBACZ,sBAAsB;gBACtB,kBAAkB,QAAQ,eAAe;YAC3C;YACA,YAAY;gBACV;gBACA;YACF;qBACA;oBACA;QACF;QACA,sBAAsB;YACpB,cAAc;gBACZ,sBAAsB;gBACtB,kBAAkB,QAAQ,eAAe;YAC3C;YACA,YAAY;gBACV;gBACA;YACF;qBACA;oBACA;QACF;IACF;AACF;;CD5MC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/src/*.js"],"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 */\nexport type {SpinButtonProps, SpinbuttonAria} from './useSpinButton';\nexport {useSpinButton} 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, clearAnnouncer} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useEffect, useRef} from 'react';\nimport {useEffectEvent, useGlobalListeners} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation<number>, 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: DOMAttributes,\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 stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/spinbutton');\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 === '' ? stringFormatter.format('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n clearAnnouncer('assertive');\n announce(textValue, 'assertive');\n }\n }, [textValue]);\n\n const onIncrementPressStart = useEffectEvent(\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 );\n\n const onDecrementPressStart = useEffectEvent(\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 );\n\n let cancelContextMenu = (e) => {\n e.preventDefault();\n };\n\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\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 addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => {\n onDecrementPressStart(400);\n addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/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}"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;;AEVD,4B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F;AACF;;CD5MC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/src/*.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 */\nexport type {SpinButtonProps, SpinbuttonAria} from './useSpinButton';\nexport {useSpinButton} 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, clearAnnouncer} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useEffect, useRef} from 'react';\nimport {useEffectEvent, useGlobalListeners} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation<number>, 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: DOMAttributes,\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 stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/spinbutton');\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 let ariaTextValue = textValue === '' ? stringFormatter.format('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n clearAnnouncer('assertive');\n announce(ariaTextValue, 'assertive');\n }\n }, [ariaTextValue]);\n\n const onIncrementPressStart = useEffectEvent(\n (initialStepDelay: number) => {\n clearAsync();\n onIncrement?.();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if ((maxValue === undefined || isNaN(maxValue)) || (value === undefined || isNaN(value)) || value < maxValue) {\n onIncrementPressStart(60);\n }\n },\n initialStepDelay\n );\n }\n );\n\n const onDecrementPressStart = useEffectEvent(\n (initialStepDelay: number) => {\n clearAsync();\n onDecrement?.();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if ((minValue === undefined || isNaN(minValue)) || (value === undefined || isNaN(value)) || value > minValue) {\n onDecrementPressStart(60);\n }\n },\n initialStepDelay\n );\n }\n );\n\n let cancelContextMenu = (e) => {\n e.preventDefault();\n };\n\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n return {\n spinButtonProps: {\n role: 'spinbutton',\n 'aria-valuenow': value !== undefined && !isNaN(value) ? value : undefined,\n 'aria-valuetext': ariaTextValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-disabled': isDisabled || undefined,\n 'aria-readonly': isReadOnly || undefined,\n 'aria-required': isRequired || undefined,\n onKeyDown,\n onFocus,\n onBlur\n },\n incrementButtonProps: {\n onPressStart: () => {\n onIncrementPressStart(400);\n addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => {\n onDecrementPressStart(400);\n addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/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
@@ -1,37 +1,3 @@
1
- import $ed6aae4e5f766f1e$exports from "./ar-AE.module.js";
2
- import $38854e2b175151fa$exports from "./bg-BG.module.js";
3
- import $15b25ab20f3945b2$exports from "./cs-CZ.module.js";
4
- import $692a4298b6b649a2$exports from "./da-DK.module.js";
5
- import $1c6e1539193f1243$exports from "./de-DE.module.js";
6
- import $1e8678632c464b6d$exports from "./el-GR.module.js";
7
- import $4adc85d9bf5b9eed$exports from "./en-US.module.js";
8
- import $41c4b2bb61dafbca$exports from "./es-ES.module.js";
9
- import $405f8b24f5dd2a60$exports from "./et-EE.module.js";
10
- import $7efe3ed02b9b9dd4$exports from "./fi-FI.module.js";
11
- import $99fc4c101d92daf3$exports from "./fr-FR.module.js";
12
- import $f9e155e6e8cacaa2$exports from "./he-IL.module.js";
13
- import $c31b5e8e9a249fd5$exports from "./hr-HR.module.js";
14
- import $9c5435bc17499bd9$exports from "./hu-HU.module.js";
15
- import $6d1fc8e84d8165e1$exports from "./it-IT.module.js";
16
- import $46ea6b3641b83e71$exports from "./ja-JP.module.js";
17
- import $0e3cc9a288289dc5$exports from "./ko-KR.module.js";
18
- import $4ff2bb25c0089ffb$exports from "./lt-LT.module.js";
19
- import $6cf33cd4c010a2fb$exports from "./lv-LV.module.js";
20
- import $5a9f8486f8b8837e$exports from "./nb-NO.module.js";
21
- import $583f94d807f6ecea$exports from "./nl-NL.module.js";
22
- import $cc4dcfeea2b4050d$exports from "./pl-PL.module.js";
23
- import $68ac2954d56e12b4$exports from "./pt-BR.module.js";
24
- import $fdb0616f309780b0$exports from "./pt-PT.module.js";
25
- import $fe1eccf4ee1d6f52$exports from "./ro-RO.module.js";
26
- import $a38b6c4e18725976$exports from "./ru-RU.module.js";
27
- import $6c14ae2b766b652c$exports from "./sk-SK.module.js";
28
- import $8f1c9692e16dc5eb$exports from "./sl-SI.module.js";
29
- import $d2aa7abea627cafa$exports from "./sr-SP.module.js";
30
- import $676b82e4b56408e6$exports from "./sv-SE.module.js";
31
- import $14c9042552d7ce08$exports from "./tr-TR.module.js";
32
- import $393254ebcb66c9f5$exports from "./uk-UA.module.js";
33
- import $d49d621f310cf6ce$exports from "./zh-CN.module.js";
34
- import $94b60c866ca5dfe6$exports from "./zh-TW.module.js";
35
1
  import {clearAnnouncer as $glIEW$clearAnnouncer, announce as $glIEW$announce} from "@react-aria/live-announcer";
36
2
  import {useRef as $glIEW$useRef, useEffect as $glIEW$useEffect} from "react";
37
3
  import {useEffectEvent as $glIEW$useEffectEvent, useGlobalListeners as $glIEW$useGlobalListeners} from "@react-aria/utils";
@@ -63,38 +29,208 @@ function $parcel$interopDefault(a) {
63
29
  * governing permissions and limitations under the License.
64
30
  */
65
31
  var $a99895ee3dc79e61$exports = {};
32
+ var $ed6aae4e5f766f1e$exports = {};
33
+ $ed6aae4e5f766f1e$exports = {
34
+ "Empty": `\u{641}\u{627}\u{631}\u{63A}`
35
+ };
36
+
37
+
38
+ var $38854e2b175151fa$exports = {};
39
+ $38854e2b175151fa$exports = {
40
+ "Empty": `\u{418}\u{437}\u{43F}\u{440}\u{430}\u{437}\u{43D}\u{438}`
41
+ };
42
+
43
+
44
+ var $15b25ab20f3945b2$exports = {};
45
+ $15b25ab20f3945b2$exports = {
46
+ "Empty": `Pr\xe1zdn\xe9`
47
+ };
48
+
49
+
50
+ var $692a4298b6b649a2$exports = {};
51
+ $692a4298b6b649a2$exports = {
52
+ "Empty": `Tom`
53
+ };
54
+
55
+
56
+ var $1c6e1539193f1243$exports = {};
57
+ $1c6e1539193f1243$exports = {
58
+ "Empty": `Leer`
59
+ };
60
+
61
+
62
+ var $1e8678632c464b6d$exports = {};
63
+ $1e8678632c464b6d$exports = {
64
+ "Empty": `\u{386}\u{3B4}\u{3B5}\u{3B9}\u{3BF}`
65
+ };
66
+
67
+
68
+ var $4adc85d9bf5b9eed$exports = {};
69
+ $4adc85d9bf5b9eed$exports = {
70
+ "Empty": `Empty`
71
+ };
72
+
73
+
74
+ var $41c4b2bb61dafbca$exports = {};
75
+ $41c4b2bb61dafbca$exports = {
76
+ "Empty": `Vac\xedo`
77
+ };
78
+
79
+
80
+ var $405f8b24f5dd2a60$exports = {};
81
+ $405f8b24f5dd2a60$exports = {
82
+ "Empty": `T\xfchjenda`
83
+ };
84
+
85
+
86
+ var $7efe3ed02b9b9dd4$exports = {};
87
+ $7efe3ed02b9b9dd4$exports = {
88
+ "Empty": `Tyhj\xe4`
89
+ };
90
+
91
+
92
+ var $99fc4c101d92daf3$exports = {};
93
+ $99fc4c101d92daf3$exports = {
94
+ "Empty": `Vide`
95
+ };
96
+
97
+
98
+ var $f9e155e6e8cacaa2$exports = {};
99
+ $f9e155e6e8cacaa2$exports = {
100
+ "Empty": `\u{5E8}\u{5D9}\u{5E7}`
101
+ };
66
102
 
67
103
 
104
+ var $c31b5e8e9a249fd5$exports = {};
105
+ $c31b5e8e9a249fd5$exports = {
106
+ "Empty": `Prazno`
107
+ };
108
+
109
+
110
+ var $9c5435bc17499bd9$exports = {};
111
+ $9c5435bc17499bd9$exports = {
112
+ "Empty": `\xdcres`
113
+ };
114
+
115
+
116
+ var $6d1fc8e84d8165e1$exports = {};
117
+ $6d1fc8e84d8165e1$exports = {
118
+ "Empty": `Vuoto`
119
+ };
120
+
121
+
122
+ var $46ea6b3641b83e71$exports = {};
123
+ $46ea6b3641b83e71$exports = {
124
+ "Empty": `\u{7A7A}`
125
+ };
126
+
127
+
128
+ var $0e3cc9a288289dc5$exports = {};
129
+ $0e3cc9a288289dc5$exports = {
130
+ "Empty": `\u{BE44}\u{C5B4} \u{C788}\u{C74C}`
131
+ };
132
+
133
+
134
+ var $4ff2bb25c0089ffb$exports = {};
135
+ $4ff2bb25c0089ffb$exports = {
136
+ "Empty": `Tu\u{161}\u{10D}ias`
137
+ };
138
+
68
139
 
140
+ var $6cf33cd4c010a2fb$exports = {};
141
+ $6cf33cd4c010a2fb$exports = {
142
+ "Empty": `Tuk\u{161}s`
143
+ };
69
144
 
70
145
 
146
+ var $5a9f8486f8b8837e$exports = {};
147
+ $5a9f8486f8b8837e$exports = {
148
+ "Empty": `Tom`
149
+ };
71
150
 
72
151
 
152
+ var $583f94d807f6ecea$exports = {};
153
+ $583f94d807f6ecea$exports = {
154
+ "Empty": `Leeg`
155
+ };
73
156
 
74
157
 
158
+ var $cc4dcfeea2b4050d$exports = {};
159
+ $cc4dcfeea2b4050d$exports = {
160
+ "Empty": `Pusty`
161
+ };
75
162
 
76
163
 
164
+ var $68ac2954d56e12b4$exports = {};
165
+ $68ac2954d56e12b4$exports = {
166
+ "Empty": `Vazio`
167
+ };
77
168
 
78
169
 
170
+ var $fdb0616f309780b0$exports = {};
171
+ $fdb0616f309780b0$exports = {
172
+ "Empty": `Vazio`
173
+ };
79
174
 
80
175
 
176
+ var $fe1eccf4ee1d6f52$exports = {};
177
+ $fe1eccf4ee1d6f52$exports = {
178
+ "Empty": `Gol`
179
+ };
81
180
 
82
181
 
182
+ var $a38b6c4e18725976$exports = {};
183
+ $a38b6c4e18725976$exports = {
184
+ "Empty": `\u{41D}\u{435} \u{437}\u{430}\u{43F}\u{43E}\u{43B}\u{43D}\u{435}\u{43D}\u{43E}`
185
+ };
83
186
 
84
187
 
188
+ var $6c14ae2b766b652c$exports = {};
189
+ $6c14ae2b766b652c$exports = {
190
+ "Empty": `Pr\xe1zdne`
191
+ };
85
192
 
86
193
 
194
+ var $8f1c9692e16dc5eb$exports = {};
195
+ $8f1c9692e16dc5eb$exports = {
196
+ "Empty": `Prazen`
197
+ };
198
+
87
199
 
200
+ var $d2aa7abea627cafa$exports = {};
201
+ $d2aa7abea627cafa$exports = {
202
+ "Empty": `Prazno`
203
+ };
88
204
 
89
205
 
206
+ var $676b82e4b56408e6$exports = {};
207
+ $676b82e4b56408e6$exports = {
208
+ "Empty": `Tomt`
209
+ };
90
210
 
91
211
 
212
+ var $14c9042552d7ce08$exports = {};
213
+ $14c9042552d7ce08$exports = {
214
+ "Empty": `Bo\u{15F}`
215
+ };
92
216
 
93
217
 
218
+ var $393254ebcb66c9f5$exports = {};
219
+ $393254ebcb66c9f5$exports = {
220
+ "Empty": `\u{41F}\u{443}\u{441}\u{442}\u{43E}`
221
+ };
94
222
 
95
223
 
224
+ var $d49d621f310cf6ce$exports = {};
225
+ $d49d621f310cf6ce$exports = {
226
+ "Empty": `\u{7A7A}`
227
+ };
96
228
 
97
229
 
230
+ var $94b60c866ca5dfe6$exports = {};
231
+ $94b60c866ca5dfe6$exports = {
232
+ "Empty": `\u{7A7A}\u{767D}`
233
+ };
98
234
 
99
235
 
100
236
  $a99895ee3dc79e61$exports = {
@@ -153,7 +289,7 @@ function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
153
289
  case "PageUp":
154
290
  if (onIncrementPage) {
155
291
  e.preventDefault();
156
- onIncrementPage();
292
+ onIncrementPage === null || onIncrementPage === void 0 ? void 0 : onIncrementPage();
157
293
  break;
158
294
  }
159
295
  // fallthrough!
@@ -161,13 +297,13 @@ function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
161
297
  case "Up":
162
298
  if (onIncrement) {
163
299
  e.preventDefault();
164
- onIncrement();
300
+ onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement();
165
301
  }
166
302
  break;
167
303
  case "PageDown":
168
304
  if (onDecrementPage) {
169
305
  e.preventDefault();
170
- onDecrementPage();
306
+ onDecrementPage === null || onDecrementPage === void 0 ? void 0 : onDecrementPage();
171
307
  break;
172
308
  }
173
309
  // fallthrough
@@ -175,19 +311,19 @@ function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
175
311
  case "Down":
176
312
  if (onDecrement) {
177
313
  e.preventDefault();
178
- onDecrement();
314
+ onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement();
179
315
  }
180
316
  break;
181
317
  case "Home":
182
318
  if (onDecrementToMin) {
183
319
  e.preventDefault();
184
- onDecrementToMin();
320
+ onDecrementToMin === null || onDecrementToMin === void 0 ? void 0 : onDecrementToMin();
185
321
  }
186
322
  break;
187
323
  case "End":
188
324
  if (onIncrementToMax) {
189
325
  e.preventDefault();
190
- onIncrementToMax();
326
+ onIncrementToMax === null || onIncrementToMax === void 0 ? void 0 : onIncrementToMax();
191
327
  }
192
328
  break;
193
329
  }
@@ -203,29 +339,29 @@ function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
203
339
  // This ensures that macOS VoiceOver announces it as "minus" even with other characters between the minus sign
204
340
  // and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen.
205
341
  // In addition, replace the empty string with the word "Empty" so that iOS VoiceOver does not read "50%" for an empty field.
206
- textValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "\u2212");
342
+ let ariaTextValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "\u2212");
207
343
  (0, $glIEW$useEffect)(()=>{
208
344
  if (isFocused.current) {
209
345
  (0, $glIEW$clearAnnouncer)("assertive");
210
- (0, $glIEW$announce)(textValue, "assertive");
346
+ (0, $glIEW$announce)(ariaTextValue, "assertive");
211
347
  }
212
348
  }, [
213
- textValue
349
+ ariaTextValue
214
350
  ]);
215
351
  const onIncrementPressStart = (0, $glIEW$useEffectEvent)((initialStepDelay)=>{
216
352
  clearAsync();
217
- onIncrement();
353
+ onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement();
218
354
  // Start spinning after initial delay
219
355
  _async.current = window.setTimeout(()=>{
220
- if (isNaN(maxValue) || isNaN(value) || value < maxValue) onIncrementPressStart(60);
356
+ if (maxValue === undefined || isNaN(maxValue) || value === undefined || isNaN(value) || value < maxValue) onIncrementPressStart(60);
221
357
  }, initialStepDelay);
222
358
  });
223
359
  const onDecrementPressStart = (0, $glIEW$useEffectEvent)((initialStepDelay)=>{
224
360
  clearAsync();
225
- onDecrement();
361
+ onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement();
226
362
  // Start spinning after initial delay
227
363
  _async.current = window.setTimeout(()=>{
228
- if (isNaN(minValue) || isNaN(value) || value > minValue) onDecrementPressStart(60);
364
+ if (minValue === undefined || isNaN(minValue) || value === undefined || isNaN(value) || value > minValue) onDecrementPressStart(60);
229
365
  }, initialStepDelay);
230
366
  });
231
367
  let cancelContextMenu = (e)=>{
@@ -235,13 +371,13 @@ function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) {
235
371
  return {
236
372
  spinButtonProps: {
237
373
  role: "spinbutton",
238
- "aria-valuenow": !isNaN(value) ? value : null,
239
- "aria-valuetext": textValue,
374
+ "aria-valuenow": value !== undefined && !isNaN(value) ? value : undefined,
375
+ "aria-valuetext": ariaTextValue,
240
376
  "aria-valuemin": minValue,
241
377
  "aria-valuemax": maxValue,
242
- "aria-disabled": isDisabled || null,
243
- "aria-readonly": isReadOnly || null,
244
- "aria-required": isRequired || null,
378
+ "aria-disabled": isDisabled || undefined,
379
+ "aria-readonly": isReadOnly || undefined,
380
+ "aria-required": isRequired || undefined,
245
381
  onKeyDown: onKeyDown,
246
382
  onFocus: onFocus,
247
383
  onBlur: onBlur
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwBD,4BAAiB;IACf,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;AACX;;;;;;AD/BO,SAAS,0CAC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ACF;IACF;AACF;;CD5MC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/src/*.js"],"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 */\nexport type {SpinButtonProps, SpinbuttonAria} from './useSpinButton';\nexport {useSpinButton} 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, clearAnnouncer} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useEffect, useRef} from 'react';\nimport {useEffectEvent, useGlobalListeners} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation<number>, 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: DOMAttributes,\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 stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/spinbutton');\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 === '' ? stringFormatter.format('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n clearAnnouncer('assertive');\n announce(textValue, 'assertive');\n }\n }, [textValue]);\n\n const onIncrementPressStart = useEffectEvent(\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 );\n\n const onDecrementPressStart = useEffectEvent(\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 );\n\n let cancelContextMenu = (e) => {\n e.preventDefault();\n };\n\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\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 addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => {\n onDecrementPressStart(400);\n addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/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}"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;;;AEVD,4BAAiB;IAAG,SAAS,CAAC,4BAAI,CAAC;AACnC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,wDAAQ,CAAC;AACvC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,aAAO,CAAC;AACtC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,GAAG,CAAC;AAClC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,IAAI,CAAC;AACnC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,mCAAK,CAAC;AACpC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,KAAK,CAAC;AACpC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,QAAK,CAAC;AACpC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,WAAQ,CAAC;AACvC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,QAAK,CAAC;AACpC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,IAAI,CAAC;AACnC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,qBAAG,CAAC;AAClC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,MAAM,CAAC;AACrC;;;;ACDA,4BAAiB;IAAG,SAAS,CAAC,OAAI,CAAC;AACnC;;;;ACDA,4BAAiB;IAAG,SA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,iBAAiB;YACf,MAAM;YACN,iBAAiB,UAAU,aAAa,CAAC,MAAM,SAAS,QAAQ;YAChE,kBAAkB;YAClB,iBAAiB;YACjB,iBAAiB;YACjB,iBAAiB,cAAc;YAC/B,iBAAiB,cAAc;YAC/B,iBAAiB,cAAc;uBAC/B;qBACA;oBACA;QACF;QACA,sBAAsB;YACpB,cAAc;gBACZ,sBAAsB;gBACtB,kBAAkB,QAAQ,eAAe;YAC3C;YACA,YAAY;gBACV;gBACA;YACF;qBACA;oBACA;QACF;QACA,sBAAsB;YACpB,cAAc;gBACZ,sBAAsB;gBACtB,kBAAkB,QAAQ,eAAe;YAC3C;YACA,YAAY;gBACV;gBACA;YACF;qBACA;oBACA;QACF;IACF;AACF;;CD5MC","sources":["packages/@react-aria/spinbutton/src/index.ts","packages/@react-aria/spinbutton/src/useSpinButton.ts","packages/@react-aria/spinbutton/src/*.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 */\nexport type {SpinButtonProps, SpinbuttonAria} from './useSpinButton';\nexport {useSpinButton} 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, clearAnnouncer} from '@react-aria/live-announcer';\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, InputBase, RangeInputBase, Validation, ValueBase} from '@react-types/shared';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useEffect, useRef} from 'react';\nimport {useEffectEvent, useGlobalListeners} from '@react-aria/utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface SpinButtonProps extends InputBase, Validation<number>, 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: DOMAttributes,\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 stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/spinbutton');\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 let ariaTextValue = textValue === '' ? stringFormatter.format('Empty') : (textValue || `${value}`).replace('-', '\\u2212');\n\n useEffect(() => {\n if (isFocused.current) {\n clearAnnouncer('assertive');\n announce(ariaTextValue, 'assertive');\n }\n }, [ariaTextValue]);\n\n const onIncrementPressStart = useEffectEvent(\n (initialStepDelay: number) => {\n clearAsync();\n onIncrement?.();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if ((maxValue === undefined || isNaN(maxValue)) || (value === undefined || isNaN(value)) || value < maxValue) {\n onIncrementPressStart(60);\n }\n },\n initialStepDelay\n );\n }\n );\n\n const onDecrementPressStart = useEffectEvent(\n (initialStepDelay: number) => {\n clearAsync();\n onDecrement?.();\n // Start spinning after initial delay\n _async.current = window.setTimeout(\n () => {\n if ((minValue === undefined || isNaN(minValue)) || (value === undefined || isNaN(value)) || value > minValue) {\n onDecrementPressStart(60);\n }\n },\n initialStepDelay\n );\n }\n );\n\n let cancelContextMenu = (e) => {\n e.preventDefault();\n };\n\n let {addGlobalListener, removeAllGlobalListeners} = useGlobalListeners();\n\n return {\n spinButtonProps: {\n role: 'spinbutton',\n 'aria-valuenow': value !== undefined && !isNaN(value) ? value : undefined,\n 'aria-valuetext': ariaTextValue,\n 'aria-valuemin': minValue,\n 'aria-valuemax': maxValue,\n 'aria-disabled': isDisabled || undefined,\n 'aria-readonly': isReadOnly || undefined,\n 'aria-required': isRequired || undefined,\n onKeyDown,\n onFocus,\n onBlur\n },\n incrementButtonProps: {\n onPressStart: () => {\n onIncrementPressStart(400);\n addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n },\n decrementButtonProps: {\n onPressStart: () => {\n onDecrementPressStart(400);\n addGlobalListener(window, 'contextmenu', cancelContextMenu);\n },\n onPressEnd: () => {\n clearAsync();\n removeAllGlobalListeners();\n },\n onFocus,\n onBlur\n }\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/spinbutton",
3
- "version": "3.6.1",
3
+ "version": "3.6.2",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,9 +22,9 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/i18n": "^3.10.0",
25
+ "@react-aria/i18n": "^3.10.1",
26
26
  "@react-aria/live-announcer": "^3.3.1",
27
- "@react-aria/utils": "^3.23.0",
27
+ "@react-aria/utils": "^3.23.1",
28
28
  "@react-types/button": "^3.9.1",
29
29
  "@react-types/shared": "^3.22.0",
30
30
  "@swc/helpers": "^0.5.0"
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "86b38c87868ce7f262e0df905e5ac4eb2653791d"
39
+ "gitHead": "f040ff62678e6a31375b96c05396df0bae660350"
40
40
  }
@@ -73,7 +73,7 @@ export function useSpinButton(
73
73
  case 'PageUp':
74
74
  if (onIncrementPage) {
75
75
  e.preventDefault();
76
- onIncrementPage();
76
+ onIncrementPage?.();
77
77
  break;
78
78
  }
79
79
  // fallthrough!
@@ -81,13 +81,13 @@ export function useSpinButton(
81
81
  case 'Up':
82
82
  if (onIncrement) {
83
83
  e.preventDefault();
84
- onIncrement();
84
+ onIncrement?.();
85
85
  }
86
86
  break;
87
87
  case 'PageDown':
88
88
  if (onDecrementPage) {
89
89
  e.preventDefault();
90
- onDecrementPage();
90
+ onDecrementPage?.();
91
91
  break;
92
92
  }
93
93
  // fallthrough
@@ -95,19 +95,19 @@ export function useSpinButton(
95
95
  case 'Down':
96
96
  if (onDecrement) {
97
97
  e.preventDefault();
98
- onDecrement();
98
+ onDecrement?.();
99
99
  }
100
100
  break;
101
101
  case 'Home':
102
102
  if (onDecrementToMin) {
103
103
  e.preventDefault();
104
- onDecrementToMin();
104
+ onDecrementToMin?.();
105
105
  }
106
106
  break;
107
107
  case 'End':
108
108
  if (onIncrementToMax) {
109
109
  e.preventDefault();
110
- onIncrementToMax();
110
+ onIncrementToMax?.();
111
111
  }
112
112
  break;
113
113
  }
@@ -126,23 +126,23 @@ export function useSpinButton(
126
126
  // This ensures that macOS VoiceOver announces it as "minus" even with other characters between the minus sign
127
127
  // and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen.
128
128
  // In addition, replace the empty string with the word "Empty" so that iOS VoiceOver does not read "50%" for an empty field.
129
- textValue = textValue === '' ? stringFormatter.format('Empty') : (textValue || `${value}`).replace('-', '\u2212');
129
+ let ariaTextValue = textValue === '' ? stringFormatter.format('Empty') : (textValue || `${value}`).replace('-', '\u2212');
130
130
 
131
131
  useEffect(() => {
132
132
  if (isFocused.current) {
133
133
  clearAnnouncer('assertive');
134
- announce(textValue, 'assertive');
134
+ announce(ariaTextValue, 'assertive');
135
135
  }
136
- }, [textValue]);
136
+ }, [ariaTextValue]);
137
137
 
138
138
  const onIncrementPressStart = useEffectEvent(
139
139
  (initialStepDelay: number) => {
140
140
  clearAsync();
141
- onIncrement();
141
+ onIncrement?.();
142
142
  // Start spinning after initial delay
143
143
  _async.current = window.setTimeout(
144
144
  () => {
145
- if (isNaN(maxValue) || isNaN(value) || value < maxValue) {
145
+ if ((maxValue === undefined || isNaN(maxValue)) || (value === undefined || isNaN(value)) || value < maxValue) {
146
146
  onIncrementPressStart(60);
147
147
  }
148
148
  },
@@ -154,11 +154,11 @@ export function useSpinButton(
154
154
  const onDecrementPressStart = useEffectEvent(
155
155
  (initialStepDelay: number) => {
156
156
  clearAsync();
157
- onDecrement();
157
+ onDecrement?.();
158
158
  // Start spinning after initial delay
159
159
  _async.current = window.setTimeout(
160
160
  () => {
161
- if (isNaN(minValue) || isNaN(value) || value > minValue) {
161
+ if ((minValue === undefined || isNaN(minValue)) || (value === undefined || isNaN(value)) || value > minValue) {
162
162
  onDecrementPressStart(60);
163
163
  }
164
164
  },
@@ -176,13 +176,13 @@ export function useSpinButton(
176
176
  return {
177
177
  spinButtonProps: {
178
178
  role: 'spinbutton',
179
- 'aria-valuenow': !isNaN(value) ? value : null,
180
- 'aria-valuetext': textValue,
179
+ 'aria-valuenow': value !== undefined && !isNaN(value) ? value : undefined,
180
+ 'aria-valuetext': ariaTextValue,
181
181
  'aria-valuemin': minValue,
182
182
  'aria-valuemax': maxValue,
183
- 'aria-disabled': isDisabled || null,
184
- 'aria-readonly': isReadOnly || null,
185
- 'aria-required': isRequired || null,
183
+ 'aria-disabled': isDisabled || undefined,
184
+ 'aria-readonly': isReadOnly || undefined,
185
+ 'aria-required': isRequired || undefined,
186
186
  onKeyDown,
187
187
  onFocus,
188
188
  onBlur
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- "Empty": `\u{641}\u{627}\u{631}\u{63A}`
3
- };
4
-
5
-
6
- //# sourceMappingURL=ar-AE.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,SAAS,CAAC,4BAAI,CAAC;AACnC","sources":["packages/@react-aria/spinbutton/intl/ar-AE.json"],"sourcesContent":["{\n \"Empty\": \"فارغ\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}