@react-aria/spinbutton
Advanced tools
Comparing version 3.6.3 to 3.6.4
267
dist/main.js
@@ -1,39 +0,2 @@ | ||
var $db6c23092fbfea22$exports = require("./ar-AE.main.js"); | ||
var $f4b3121a918895c4$exports = require("./bg-BG.main.js"); | ||
var $d01cc02a83842f4c$exports = require("./cs-CZ.main.js"); | ||
var $ae20f188998ad249$exports = require("./da-DK.main.js"); | ||
var $f17ee93fe12c77e5$exports = require("./de-DE.main.js"); | ||
var $9691dc6a69dd5ba9$exports = require("./el-GR.main.js"); | ||
var $b2385949437f9917$exports = require("./en-US.main.js"); | ||
var $ed6d4429037ec60d$exports = require("./es-ES.main.js"); | ||
var $c9cb32f5c221f118$exports = require("./et-EE.main.js"); | ||
var $5be8f6c4ad248dda$exports = require("./fi-FI.main.js"); | ||
var $3f46a428519ddd7e$exports = require("./fr-FR.main.js"); | ||
var $41c7f98604688f35$exports = require("./he-IL.main.js"); | ||
var $183e97db82c2cbf0$exports = require("./hr-HR.main.js"); | ||
var $749cae0664a7dc03$exports = require("./hu-HU.main.js"); | ||
var $4129f25b282c341e$exports = require("./it-IT.main.js"); | ||
var $908925465e00dbfc$exports = require("./ja-JP.main.js"); | ||
var $34fae452e2e356d9$exports = require("./ko-KR.main.js"); | ||
var $458e73ba0e56bdd4$exports = require("./lt-LT.main.js"); | ||
var $2ddf9ecf84010f95$exports = require("./lv-LV.main.js"); | ||
var $b787a09821b773ea$exports = require("./nb-NO.main.js"); | ||
var $6b951cc1b0de6d71$exports = require("./nl-NL.main.js"); | ||
var $fc3eb600d1c488fa$exports = require("./pl-PL.main.js"); | ||
var $ba0f4e25830e4bbf$exports = require("./pt-BR.main.js"); | ||
var $2cd34c446640bd1d$exports = require("./pt-PT.main.js"); | ||
var $55c7bf6cdae0bed5$exports = require("./ro-RO.main.js"); | ||
var $240e8ca0b043d76a$exports = require("./ru-RU.main.js"); | ||
var $c28c7ecdb94a1868$exports = require("./sk-SK.main.js"); | ||
var $c2d6776ba29b6517$exports = require("./sl-SI.main.js"); | ||
var $628464d96d5a7855$exports = require("./sr-SP.main.js"); | ||
var $5a1bcd0a675a6f60$exports = require("./sv-SE.main.js"); | ||
var $f71e9bc82e4a5a16$exports = require("./tr-TR.main.js"); | ||
var $cb1ece2578f5693e$exports = require("./uk-UA.main.js"); | ||
var $d8ce7cc5e4398a80$exports = require("./zh-CN.main.js"); | ||
var $8db5191ec1aacb53$exports = require("./zh-TW.main.js"); | ||
var $2BLaI$reactarialiveannouncer = require("@react-aria/live-announcer"); | ||
var $2BLaI$react = require("react"); | ||
var $2BLaI$reactariautils = require("@react-aria/utils"); | ||
var $2BLaI$reactariai18n = require("@react-aria/i18n"); | ||
var $37bbd4c129023f61$exports = require("./useSpinButton.main.js"); | ||
@@ -45,7 +8,3 @@ | ||
function $parcel$interopDefault(a) { | ||
return a && a.__esModule ? a.default : a; | ||
} | ||
$parcel$export(module.exports, "useSpinButton", () => $37bbd4c129023f61$export$e908e06f4b8e3402); | ||
$parcel$export(module.exports, "useSpinButton", () => $37bbd4c129023f61$exports.useSpinButton); | ||
/* | ||
@@ -61,227 +20,5 @@ * Copyright 2020 Adobe. All rights reserved. | ||
* governing permissions and limitations under the License. | ||
*/ /* | ||
* Copyright 2020 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
var $cb4b786159079747$exports = {}; | ||
$cb4b786159079747$exports = { | ||
"ar-AE": $db6c23092fbfea22$exports, | ||
"bg-BG": $f4b3121a918895c4$exports, | ||
"cs-CZ": $d01cc02a83842f4c$exports, | ||
"da-DK": $ae20f188998ad249$exports, | ||
"de-DE": $f17ee93fe12c77e5$exports, | ||
"el-GR": $9691dc6a69dd5ba9$exports, | ||
"en-US": $b2385949437f9917$exports, | ||
"es-ES": $ed6d4429037ec60d$exports, | ||
"et-EE": $c9cb32f5c221f118$exports, | ||
"fi-FI": $5be8f6c4ad248dda$exports, | ||
"fr-FR": $3f46a428519ddd7e$exports, | ||
"he-IL": $41c7f98604688f35$exports, | ||
"hr-HR": $183e97db82c2cbf0$exports, | ||
"hu-HU": $749cae0664a7dc03$exports, | ||
"it-IT": $4129f25b282c341e$exports, | ||
"ja-JP": $908925465e00dbfc$exports, | ||
"ko-KR": $34fae452e2e356d9$exports, | ||
"lt-LT": $458e73ba0e56bdd4$exports, | ||
"lv-LV": $2ddf9ecf84010f95$exports, | ||
"nb-NO": $b787a09821b773ea$exports, | ||
"nl-NL": $6b951cc1b0de6d71$exports, | ||
"pl-PL": $fc3eb600d1c488fa$exports, | ||
"pt-BR": $ba0f4e25830e4bbf$exports, | ||
"pt-PT": $2cd34c446640bd1d$exports, | ||
"ro-RO": $55c7bf6cdae0bed5$exports, | ||
"ru-RU": $240e8ca0b043d76a$exports, | ||
"sk-SK": $c28c7ecdb94a1868$exports, | ||
"sl-SI": $c2d6776ba29b6517$exports, | ||
"sr-SP": $628464d96d5a7855$exports, | ||
"sv-SE": $5a1bcd0a675a6f60$exports, | ||
"tr-TR": $f71e9bc82e4a5a16$exports, | ||
"uk-UA": $cb1ece2578f5693e$exports, | ||
"zh-CN": $d8ce7cc5e4398a80$exports, | ||
"zh-TW": $8db5191ec1aacb53$exports | ||
}; | ||
function $37bbd4c129023f61$export$e908e06f4b8e3402(props) { | ||
const _async = (0, $2BLaI$react.useRef)(); | ||
let { value: value, textValue: textValue, minValue: minValue, maxValue: maxValue, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, onIncrement: onIncrement, onIncrementPage: onIncrementPage, onDecrement: onDecrement, onDecrementPage: onDecrementPage, onDecrementToMin: onDecrementToMin, onIncrementToMax: onIncrementToMax } = props; | ||
const stringFormatter = (0, $2BLaI$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($cb4b786159079747$exports))), "@react-aria/spinbutton"); | ||
const clearAsync = ()=>clearTimeout(_async.current); | ||
// eslint-disable-next-line arrow-body-style | ||
(0, $2BLaI$react.useEffect)(()=>{ | ||
return ()=>clearAsync(); | ||
}, []); | ||
let onKeyDown = (e)=>{ | ||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) return; | ||
switch(e.key){ | ||
case "PageUp": | ||
if (onIncrementPage) { | ||
e.preventDefault(); | ||
onIncrementPage === null || onIncrementPage === void 0 ? void 0 : onIncrementPage(); | ||
break; | ||
} | ||
// fallthrough! | ||
case "ArrowUp": | ||
case "Up": | ||
if (onIncrement) { | ||
e.preventDefault(); | ||
onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement(); | ||
} | ||
break; | ||
case "PageDown": | ||
if (onDecrementPage) { | ||
e.preventDefault(); | ||
onDecrementPage === null || onDecrementPage === void 0 ? void 0 : onDecrementPage(); | ||
break; | ||
} | ||
// fallthrough | ||
case "ArrowDown": | ||
case "Down": | ||
if (onDecrement) { | ||
e.preventDefault(); | ||
onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement(); | ||
} | ||
break; | ||
case "Home": | ||
if (onDecrementToMin) { | ||
e.preventDefault(); | ||
onDecrementToMin === null || onDecrementToMin === void 0 ? void 0 : onDecrementToMin(); | ||
} | ||
break; | ||
case "End": | ||
if (onIncrementToMax) { | ||
e.preventDefault(); | ||
onIncrementToMax === null || onIncrementToMax === void 0 ? void 0 : onIncrementToMax(); | ||
} | ||
break; | ||
} | ||
}; | ||
let isFocused = (0, $2BLaI$react.useRef)(false); | ||
let onFocus = ()=>{ | ||
isFocused.current = true; | ||
}; | ||
let onBlur = ()=>{ | ||
isFocused.current = false; | ||
}; | ||
// Replace Unicode hyphen-minus (U+002D) with minus sign (U+2212). | ||
// This ensures that macOS VoiceOver announces it as "minus" even with other characters between the minus sign | ||
// and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen. | ||
// In addition, replace the empty string with the word "Empty" so that iOS VoiceOver does not read "50%" for an empty field. | ||
let ariaTextValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "\u2212"); | ||
(0, $2BLaI$react.useEffect)(()=>{ | ||
if (isFocused.current) { | ||
(0, $2BLaI$reactarialiveannouncer.clearAnnouncer)("assertive"); | ||
(0, $2BLaI$reactarialiveannouncer.announce)(ariaTextValue, "assertive"); | ||
} | ||
}, [ | ||
ariaTextValue | ||
]); | ||
const onIncrementPressStart = (0, $2BLaI$reactariautils.useEffectEvent)((initialStepDelay)=>{ | ||
clearAsync(); | ||
onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement(); | ||
// Start spinning after initial delay | ||
_async.current = window.setTimeout(()=>{ | ||
if (maxValue === undefined || isNaN(maxValue) || value === undefined || isNaN(value) || value < maxValue) onIncrementPressStart(60); | ||
}, initialStepDelay); | ||
}); | ||
const onDecrementPressStart = (0, $2BLaI$reactariautils.useEffectEvent)((initialStepDelay)=>{ | ||
clearAsync(); | ||
onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement(); | ||
// Start spinning after initial delay | ||
_async.current = window.setTimeout(()=>{ | ||
if (minValue === undefined || isNaN(minValue) || value === undefined || isNaN(value) || value > minValue) onDecrementPressStart(60); | ||
}, initialStepDelay); | ||
}); | ||
let cancelContextMenu = (e)=>{ | ||
e.preventDefault(); | ||
}; | ||
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $2BLaI$reactariautils.useGlobalListeners)(); | ||
return { | ||
spinButtonProps: { | ||
role: "spinbutton", | ||
"aria-valuenow": value !== undefined && !isNaN(value) ? value : undefined, | ||
"aria-valuetext": ariaTextValue, | ||
"aria-valuemin": minValue, | ||
"aria-valuemax": maxValue, | ||
"aria-disabled": isDisabled || undefined, | ||
"aria-readonly": isReadOnly || undefined, | ||
"aria-required": isRequired || undefined, | ||
onKeyDown: onKeyDown, | ||
onFocus: onFocus, | ||
onBlur: onBlur | ||
}, | ||
incrementButtonProps: { | ||
onPressStart: ()=>{ | ||
onIncrementPressStart(400); | ||
addGlobalListener(window, "contextmenu", cancelContextMenu); | ||
}, | ||
onPressEnd: ()=>{ | ||
clearAsync(); | ||
removeAllGlobalListeners(); | ||
}, | ||
onFocus: onFocus, | ||
onBlur: onBlur | ||
}, | ||
decrementButtonProps: { | ||
onPressStart: ()=>{ | ||
onDecrementPressStart(400); | ||
addGlobalListener(window, "contextmenu", cancelContextMenu); | ||
}, | ||
onPressEnd: ()=>{ | ||
clearAsync(); | ||
removeAllGlobalListeners(); | ||
}, | ||
onFocus: onFocus, | ||
onBlur: onBlur | ||
} | ||
}; | ||
} | ||
//# sourceMappingURL=main.js.map |
@@ -1,44 +0,3 @@ | ||
import $ed6aae4e5f766f1e$exports from "./ar-AE.module.js"; | ||
import $38854e2b175151fa$exports from "./bg-BG.module.js"; | ||
import $15b25ab20f3945b2$exports from "./cs-CZ.module.js"; | ||
import $692a4298b6b649a2$exports from "./da-DK.module.js"; | ||
import $1c6e1539193f1243$exports from "./de-DE.module.js"; | ||
import $1e8678632c464b6d$exports from "./el-GR.module.js"; | ||
import $4adc85d9bf5b9eed$exports from "./en-US.module.js"; | ||
import $41c4b2bb61dafbca$exports from "./es-ES.module.js"; | ||
import $405f8b24f5dd2a60$exports from "./et-EE.module.js"; | ||
import $7efe3ed02b9b9dd4$exports from "./fi-FI.module.js"; | ||
import $99fc4c101d92daf3$exports from "./fr-FR.module.js"; | ||
import $f9e155e6e8cacaa2$exports from "./he-IL.module.js"; | ||
import $c31b5e8e9a249fd5$exports from "./hr-HR.module.js"; | ||
import $9c5435bc17499bd9$exports from "./hu-HU.module.js"; | ||
import $6d1fc8e84d8165e1$exports from "./it-IT.module.js"; | ||
import $46ea6b3641b83e71$exports from "./ja-JP.module.js"; | ||
import $0e3cc9a288289dc5$exports from "./ko-KR.module.js"; | ||
import $4ff2bb25c0089ffb$exports from "./lt-LT.module.js"; | ||
import $6cf33cd4c010a2fb$exports from "./lv-LV.module.js"; | ||
import $5a9f8486f8b8837e$exports from "./nb-NO.module.js"; | ||
import $583f94d807f6ecea$exports from "./nl-NL.module.js"; | ||
import $cc4dcfeea2b4050d$exports from "./pl-PL.module.js"; | ||
import $68ac2954d56e12b4$exports from "./pt-BR.module.js"; | ||
import $fdb0616f309780b0$exports from "./pt-PT.module.js"; | ||
import $fe1eccf4ee1d6f52$exports from "./ro-RO.module.js"; | ||
import $a38b6c4e18725976$exports from "./ru-RU.module.js"; | ||
import $6c14ae2b766b652c$exports from "./sk-SK.module.js"; | ||
import $8f1c9692e16dc5eb$exports from "./sl-SI.module.js"; | ||
import $d2aa7abea627cafa$exports from "./sr-SP.module.js"; | ||
import $676b82e4b56408e6$exports from "./sv-SE.module.js"; | ||
import $14c9042552d7ce08$exports from "./tr-TR.module.js"; | ||
import $393254ebcb66c9f5$exports from "./uk-UA.module.js"; | ||
import $d49d621f310cf6ce$exports from "./zh-CN.module.js"; | ||
import $94b60c866ca5dfe6$exports from "./zh-TW.module.js"; | ||
import {clearAnnouncer as $glIEW$clearAnnouncer, announce as $glIEW$announce} from "@react-aria/live-announcer"; | ||
import {useRef as $glIEW$useRef, useEffect as $glIEW$useEffect} from "react"; | ||
import {useEffectEvent as $glIEW$useEffectEvent, useGlobalListeners as $glIEW$useGlobalListeners} from "@react-aria/utils"; | ||
import {useLocalizedStringFormatter as $glIEW$useLocalizedStringFormatter} from "@react-aria/i18n"; | ||
import {useSpinButton as $d2e8511e6f209edf$export$e908e06f4b8e3402} from "./useSpinButton.module.js"; | ||
function $parcel$interopDefault(a) { | ||
return a && a.__esModule ? a.default : a; | ||
} | ||
/* | ||
@@ -54,228 +13,6 @@ * Copyright 2020 Adobe. All rights reserved. | ||
* governing permissions and limitations under the License. | ||
*/ /* | ||
* Copyright 2020 Adobe. All rights reserved. | ||
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. You may obtain a copy | ||
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
* OF ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
*/ | ||
var $a99895ee3dc79e61$exports = {}; | ||
$a99895ee3dc79e61$exports = { | ||
"ar-AE": $ed6aae4e5f766f1e$exports, | ||
"bg-BG": $38854e2b175151fa$exports, | ||
"cs-CZ": $15b25ab20f3945b2$exports, | ||
"da-DK": $692a4298b6b649a2$exports, | ||
"de-DE": $1c6e1539193f1243$exports, | ||
"el-GR": $1e8678632c464b6d$exports, | ||
"en-US": $4adc85d9bf5b9eed$exports, | ||
"es-ES": $41c4b2bb61dafbca$exports, | ||
"et-EE": $405f8b24f5dd2a60$exports, | ||
"fi-FI": $7efe3ed02b9b9dd4$exports, | ||
"fr-FR": $99fc4c101d92daf3$exports, | ||
"he-IL": $f9e155e6e8cacaa2$exports, | ||
"hr-HR": $c31b5e8e9a249fd5$exports, | ||
"hu-HU": $9c5435bc17499bd9$exports, | ||
"it-IT": $6d1fc8e84d8165e1$exports, | ||
"ja-JP": $46ea6b3641b83e71$exports, | ||
"ko-KR": $0e3cc9a288289dc5$exports, | ||
"lt-LT": $4ff2bb25c0089ffb$exports, | ||
"lv-LV": $6cf33cd4c010a2fb$exports, | ||
"nb-NO": $5a9f8486f8b8837e$exports, | ||
"nl-NL": $583f94d807f6ecea$exports, | ||
"pl-PL": $cc4dcfeea2b4050d$exports, | ||
"pt-BR": $68ac2954d56e12b4$exports, | ||
"pt-PT": $fdb0616f309780b0$exports, | ||
"ro-RO": $fe1eccf4ee1d6f52$exports, | ||
"ru-RU": $a38b6c4e18725976$exports, | ||
"sk-SK": $6c14ae2b766b652c$exports, | ||
"sl-SI": $8f1c9692e16dc5eb$exports, | ||
"sr-SP": $d2aa7abea627cafa$exports, | ||
"sv-SE": $676b82e4b56408e6$exports, | ||
"tr-TR": $14c9042552d7ce08$exports, | ||
"uk-UA": $393254ebcb66c9f5$exports, | ||
"zh-CN": $d49d621f310cf6ce$exports, | ||
"zh-TW": $94b60c866ca5dfe6$exports | ||
}; | ||
function $d2e8511e6f209edf$export$e908e06f4b8e3402(props) { | ||
const _async = (0, $glIEW$useRef)(); | ||
let { value: value, textValue: textValue, minValue: minValue, maxValue: maxValue, isDisabled: isDisabled, isReadOnly: isReadOnly, isRequired: isRequired, onIncrement: onIncrement, onIncrementPage: onIncrementPage, onDecrement: onDecrement, onDecrementPage: onDecrementPage, onDecrementToMin: onDecrementToMin, onIncrementToMax: onIncrementToMax } = props; | ||
const stringFormatter = (0, $glIEW$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($a99895ee3dc79e61$exports))), "@react-aria/spinbutton"); | ||
const clearAsync = ()=>clearTimeout(_async.current); | ||
// eslint-disable-next-line arrow-body-style | ||
(0, $glIEW$useEffect)(()=>{ | ||
return ()=>clearAsync(); | ||
}, []); | ||
let onKeyDown = (e)=>{ | ||
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey || isReadOnly) return; | ||
switch(e.key){ | ||
case "PageUp": | ||
if (onIncrementPage) { | ||
e.preventDefault(); | ||
onIncrementPage === null || onIncrementPage === void 0 ? void 0 : onIncrementPage(); | ||
break; | ||
} | ||
// fallthrough! | ||
case "ArrowUp": | ||
case "Up": | ||
if (onIncrement) { | ||
e.preventDefault(); | ||
onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement(); | ||
} | ||
break; | ||
case "PageDown": | ||
if (onDecrementPage) { | ||
e.preventDefault(); | ||
onDecrementPage === null || onDecrementPage === void 0 ? void 0 : onDecrementPage(); | ||
break; | ||
} | ||
// fallthrough | ||
case "ArrowDown": | ||
case "Down": | ||
if (onDecrement) { | ||
e.preventDefault(); | ||
onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement(); | ||
} | ||
break; | ||
case "Home": | ||
if (onDecrementToMin) { | ||
e.preventDefault(); | ||
onDecrementToMin === null || onDecrementToMin === void 0 ? void 0 : onDecrementToMin(); | ||
} | ||
break; | ||
case "End": | ||
if (onIncrementToMax) { | ||
e.preventDefault(); | ||
onIncrementToMax === null || onIncrementToMax === void 0 ? void 0 : onIncrementToMax(); | ||
} | ||
break; | ||
} | ||
}; | ||
let isFocused = (0, $glIEW$useRef)(false); | ||
let onFocus = ()=>{ | ||
isFocused.current = true; | ||
}; | ||
let onBlur = ()=>{ | ||
isFocused.current = false; | ||
}; | ||
// Replace Unicode hyphen-minus (U+002D) with minus sign (U+2212). | ||
// This ensures that macOS VoiceOver announces it as "minus" even with other characters between the minus sign | ||
// and the number (e.g. currency symbol). Otherwise it announces nothing because it assumes the character is a hyphen. | ||
// In addition, replace the empty string with the word "Empty" so that iOS VoiceOver does not read "50%" for an empty field. | ||
let ariaTextValue = textValue === "" ? stringFormatter.format("Empty") : (textValue || `${value}`).replace("-", "\u2212"); | ||
(0, $glIEW$useEffect)(()=>{ | ||
if (isFocused.current) { | ||
(0, $glIEW$clearAnnouncer)("assertive"); | ||
(0, $glIEW$announce)(ariaTextValue, "assertive"); | ||
} | ||
}, [ | ||
ariaTextValue | ||
]); | ||
const onIncrementPressStart = (0, $glIEW$useEffectEvent)((initialStepDelay)=>{ | ||
clearAsync(); | ||
onIncrement === null || onIncrement === void 0 ? void 0 : onIncrement(); | ||
// Start spinning after initial delay | ||
_async.current = window.setTimeout(()=>{ | ||
if (maxValue === undefined || isNaN(maxValue) || value === undefined || isNaN(value) || value < maxValue) onIncrementPressStart(60); | ||
}, initialStepDelay); | ||
}); | ||
const onDecrementPressStart = (0, $glIEW$useEffectEvent)((initialStepDelay)=>{ | ||
clearAsync(); | ||
onDecrement === null || onDecrement === void 0 ? void 0 : onDecrement(); | ||
// Start spinning after initial delay | ||
_async.current = window.setTimeout(()=>{ | ||
if (minValue === undefined || isNaN(minValue) || value === undefined || isNaN(value) || value > minValue) onDecrementPressStart(60); | ||
}, initialStepDelay); | ||
}); | ||
let cancelContextMenu = (e)=>{ | ||
e.preventDefault(); | ||
}; | ||
let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $glIEW$useGlobalListeners)(); | ||
return { | ||
spinButtonProps: { | ||
role: "spinbutton", | ||
"aria-valuenow": value !== undefined && !isNaN(value) ? value : undefined, | ||
"aria-valuetext": ariaTextValue, | ||
"aria-valuemin": minValue, | ||
"aria-valuemax": maxValue, | ||
"aria-disabled": isDisabled || undefined, | ||
"aria-readonly": isReadOnly || undefined, | ||
"aria-required": isRequired || undefined, | ||
onKeyDown: onKeyDown, | ||
onFocus: onFocus, | ||
onBlur: onBlur | ||
}, | ||
incrementButtonProps: { | ||
onPressStart: ()=>{ | ||
onIncrementPressStart(400); | ||
addGlobalListener(window, "contextmenu", cancelContextMenu); | ||
}, | ||
onPressEnd: ()=>{ | ||
clearAsync(); | ||
removeAllGlobalListeners(); | ||
}, | ||
onFocus: onFocus, | ||
onBlur: onBlur | ||
}, | ||
decrementButtonProps: { | ||
onPressStart: ()=>{ | ||
onDecrementPressStart(400); | ||
addGlobalListener(window, "contextmenu", cancelContextMenu); | ||
}, | ||
onPressEnd: ()=>{ | ||
clearAsync(); | ||
removeAllGlobalListeners(); | ||
}, | ||
onFocus: onFocus, | ||
onBlur: onBlur | ||
} | ||
}; | ||
} | ||
export {$d2e8511e6f209edf$export$e908e06f4b8e3402 as useSpinButton}; | ||
//# sourceMappingURL=module.js.map |
{ | ||
"name": "@react-aria/spinbutton", | ||
"version": "3.6.3", | ||
"version": "3.6.4", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,7 +25,7 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/i18n": "^3.10.2", | ||
"@react-aria/live-announcer": "^3.3.2", | ||
"@react-aria/utils": "^3.23.2", | ||
"@react-types/button": "^3.9.2", | ||
"@react-types/shared": "^3.22.1", | ||
"@react-aria/i18n": "^3.11.0", | ||
"@react-aria/live-announcer": "^3.3.3", | ||
"@react-aria/utils": "^3.24.0", | ||
"@react-types/button": "^3.9.3", | ||
"@react-types/shared": "^3.23.0", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -40,3 +40,3 @@ }, | ||
}, | ||
"gitHead": "de9f84a22583fc741c29b341d14cd35ef4cca161" | ||
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112908
192
1505
Updated@react-aria/i18n@^3.11.0
Updated@react-aria/utils@^3.24.0
Updated@react-types/button@^3.9.3
Updated@react-types/shared@^3.23.0