How to use the @instructure/ui-prop-types.xor function in @instructure/ui-prop-types

To help you get started, we’ve selected a few @instructure/ui-prop-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-utils / src / react / CustomPropTypes.js View on Github external
xor (...args) {
    warnDeprecatedComponent('v5.45.0', 'xor', changedPackageWarning(
      'ui-utils',
      'ui-prop-types'
    ))
    return xor(...args)
  }
}
github instructure / instructure-ui / packages / ui-forms / src / components / NumberInput / index.js View on Github external
class NumberInput extends Component {
  static propTypes = {
    label: PropTypes.node.isRequired,
    id: PropTypes.string,
    showArrows: PropTypes.bool,
    step: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    min: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    max: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    /**
     * Specify the number of digits to display after the decimal separator. If
     * the input has more digits after the decimal separator, it will be
     * rounded on blur. If it has less, trailing zeros will be added on blur.
     *
     * Pass either decimalPrecision or significantDigits, not both.
     */
    decimalPrecision: xor(PropTypes.number, 'significantDigits'),
    /**
     * Specify the number of significant digits. If the input has more
     * significant digits, it will be rounded on blur. If it has less, traling
     * zeros will be added on blur.
     *
     * Pass either decimalPrecision or significantDigits, not both.
     */
    significantDigits: xor(PropTypes.number, 'decimalPrecision'),
    /**
    * object with shape: `{
    * text: PropTypes.string,
    * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
    *   }`
    */
    messages: PropTypes.arrayOf(FormPropTypes.message),
    /**
github instructure / instructure-ui / packages / ui-forms / src / components / NumberInput / index.js View on Github external
/**
     * Specify the number of digits to display after the decimal separator. If
     * the input has more digits after the decimal separator, it will be
     * rounded on blur. If it has less, trailing zeros will be added on blur.
     *
     * Pass either decimalPrecision or significantDigits, not both.
     */
    decimalPrecision: xor(PropTypes.number, 'significantDigits'),
    /**
     * Specify the number of significant digits. If the input has more
     * significant digits, it will be rounded on blur. If it has less, traling
     * zeros will be added on blur.
     *
     * Pass either decimalPrecision or significantDigits, not both.
     */
    significantDigits: xor(PropTypes.number, 'decimalPrecision'),
    /**
    * object with shape: `{
    * text: PropTypes.string,
    * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
    *   }`
    */
    messages: PropTypes.arrayOf(FormPropTypes.message),
    /**
      A standard language id
    **/
    locale: PropTypes.string,
    size: PropTypes.oneOf(['medium', 'large']),
    layout: PropTypes.oneOf(['stacked', 'inline']),
    width: PropTypes.string,
    inline: PropTypes.bool,
    /**