@carbon/react
Version:
React components for the Carbon Design System
78 lines (76 loc) • 1.81 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import PropTypes from "prop-types";
//#region src/components/NumberInput/NumberFormatPropTypes.ts
/**
* Copyright IBM Corp. 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const NumberFormatOptionsPropType = PropTypes.shape({
localeMatcher: PropTypes.oneOf(["best fit", "lookup"]),
style: PropTypes.oneOf([
"decimal",
"currency",
"percent",
"unit"
]),
currency: PropTypes.string,
currencyDisplay: PropTypes.oneOf([
"symbol",
"narrowSymbol",
"code",
"name"
]),
currencySign: PropTypes.oneOf(["standard", "accounting"]),
unit: PropTypes.string,
unitDisplay: PropTypes.oneOf([
"short",
"narrow",
"long"
]),
notation: PropTypes.oneOf([
"standard",
"scientific",
"engineering",
"compact"
]),
compactDisplay: PropTypes.oneOf(["short", "long"]),
signDisplay: PropTypes.oneOf([
"auto",
"never",
"always",
"exceptZero"
]),
minimumIntegerDigits: PropTypes.number,
minimumFractionDigits: PropTypes.number,
maximumFractionDigits: PropTypes.number,
minimumSignificantDigits: PropTypes.number,
maximumSignificantDigits: PropTypes.number,
useGrouping: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf([
"always",
"auto",
"min2"
])]),
numberingSystem: PropTypes.string,
roundingIncrement: PropTypes.number,
roundingMode: PropTypes.oneOf([
"ceil",
"floor",
"expand",
"trunc",
"halfCeil",
"halfFloor",
"halfExpand",
"halfTrunc",
"halfEven"
]),
trailingZeroDisplay: PropTypes.oneOf(["auto", "stripIfInteger"])
});
//#endregion
export { NumberFormatOptionsPropType };