How to use the react-view.PropTypes.Number function in react-view

To help you get started, we’ve selected a few react-view 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 uber / baseweb / documentation-site / components / yard / config / toast.ts View on Github external
onClose: ()=>console.log('Toast closed.'),
            overrides: {InnerContainer: {style: {width: '100%'}}}});
        }}
        >
          Show notification
        
      `,
      type: PropTypes.ReactNode,
      description: `Additional elements to render in the place where the ToasterContainer is added.
        When 'usePortal' is set to true only the ToasterContainer is rendered with portal into
        the body element but not children.`,
    },
    autoHideDuration: {
      value: '0',
      defaultValue: '0',
      type: PropTypes.Number,
      description: `The number of milliseconds to wait before automatically dismissing a
        notification. This behavior is disabled when the value is set to 0.`,
    },
    usePortal: {
      value: true,
      defaultValue: true,
      type: PropTypes.Boolean,
      description: `Indicates if 'createPortal' is used to append the toaster container to the body element.`,
      hidden: true,
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'ToastBody', 'ToastInnerContainer', 'ToastCloseIcon'],
github uber / baseweb / documentation-site / components / yard / config / slider.ts View on Github external
value: '({value}) => value && setValue(value)',
      type: PropTypes.Function,
      description: 'Called when slider value is changed.',
      propHook: {
        what: 'JSON.stringify(value)',
        into: 'value',
      },
    },
    onFinalChange: {
      value: '({value}) => console.log(value)',
      type: PropTypes.Function,
      description: 'Called when slider value is done changing.',
    },
    min: {
      value: undefined,
      type: PropTypes.Number,
      placeholder: '0',
      description:
        'The minimum allowed value of the slider. Cannot not be bigger than max.',
    },
    max: {
      value: undefined,
      placeholder: '100',
      type: PropTypes.Number,
      description:
        'The maximum allowed value of the slider. Cannot not be smaller than min.',
    },
    step: {
      value: undefined,
      placeholder: '1',
      type: PropTypes.Number,
      description:
github uber / baseweb / documentation-site / components / yard / config / popover.ts View on Github external
options: ACCESSIBILITY_TYPE,
      enumName: 'ACCESSIBILITY_TYPE',
      type: PropTypes.Enum,
      description:
        'Controls how this popover behaves for screen readers and other assistive devices.',
      imports: {
        'baseui/popover': {
          named: ['ACCESSIBILITY_TYPE'],
        },
      },
      hidden: true,
    },
    animateOutTime: {
      value: undefined,
      placeholder: '0',
      type: PropTypes.Number,
      description: 'Number of milliseconds used to fade out the popover.',
      hidden: true,
    },
    onMouseEnterDelay: {
      value: undefined,
      placeholder: '200',
      type: PropTypes.Number,
      description:
        'Number of milliseconds to wait before showing the popover after mouse enters the trigger element.',
      hidden: true,
    },
    onMouseLeaveDelay: {
      value: undefined,
      placeholder: '200',
      type: PropTypes.Number,
      description:
github uber / baseweb / documentation-site / components / yard / config / rating.ts View on Github external
import {TConfig} from '../types';

const starRatingProps = require('!!extract-react-types-loader!../../../../src/rating/star-rating.js');

const ratingConfig: TConfig = {
  imports: {
    'baseui/rating': {
      named: ['StarRating'],
    },
  },
  scope: {StarRating},
  theme: ['rating200', 'rating400'],
  props: {
    numItems: {
      value: 5,
      type: PropTypes.Number,
      description: 'The total number of items to display.',
    },
    onChange: {
      value: '(data) => setValue(data.value)',
      type: PropTypes.Function,
      description: "Callback that's called with the newly selected value.",
      propHook: {
        what: 'data.value',
        into: 'value',
      },
    },

    value: {
      value: 4,
      type: PropTypes.Number,
      description: 'The current rating value.',
github uber / baseweb / documentation-site / components / yard / config / progress-bar.ts View on Github external
import {TConfig} from '../types';

const progressBarProps = require('!!extract-react-types-loader!../../../../src/progress-bar/progressbar.js');

const ProgressBarConfig: TConfig = {
  imports: {
    'baseui/progress-bar': {named: ['ProgressBar']},
  },
  scope: {
    ProgressBar,
  },
  theme: ['progressbarTrackFill'],
  props: {
    value: {
      value: 10,
      type: PropTypes.Number,
      description: 'Progess bar value attribute.',
      stateful: true,
    },
    successValue: {
      value: undefined,
      type: PropTypes.Number,
      description: 'Can be used to set a custom success value.',
    },
    getProgressLabel: {
      placeholder:
        '(currentValue, successValue) => `${currentValue}mb out of ${successValue}mb downloaded` ',
      value: '',
      type: PropTypes.Function,
      description:
        'Can be used to display a custom label for the progress bar.',
    },
github uber / baseweb / documentation-site / components / yard / config / datepicker.ts View on Github external
},
    maxDate: {
      value: undefined,
      type: PropTypes.Date,
      description: 'A max date that is selectable.',
      placeholder: '2020-10-17T07:00:00.000Z',
    },
    minDate: {
      value: undefined,
      type: PropTypes.Date,
      description: 'A min date that is selectable.',
      placeholder: '2018-10-17T07:00:00.000Z',
    },
    monthsShown: {
      value: undefined,
      type: PropTypes.Number,
      description: 'A number of months rendered in the calendar.',
      hidden: true,
    },
    onDayClick: {
      value: undefined,
      type: PropTypes.Function,
      placeholder: '({ date, event }) => {}',
      description: `Day's click event handler.`,
      hidden: true,
    },
    onDayMouseOver: {
      value: undefined,
      type: PropTypes.Function,
      placeholder: '({ date, event }) => {}',
      description: `Day's mouseover event handler.`,
      hidden: true,
github uber / baseweb / documentation-site / components / yard / config / timepicker.ts View on Github external
placeholder: {
      value: undefined,
      type: PropTypes.String,
      description: `If the value is undefined, the placeholder is shown. Defaults to HH:mm.`,
    },
    disabled: inputConfig.props.disabled,
    format: {
      value: undefined,
      type: PropTypes.String,
      placeholder: '12',
      description:
        '12 or 24. Render options in AM/PM format or 24 hour format. Defaults to 12 hour.',
    },
    step: {
      value: undefined,
      type: PropTypes.Number,
      placeholder: '900',
      description:
        'Amount of seconds between each option time. Defaults to 900 (15 minutes).',
    },
    error: inputConfig.props.error,
    positive: inputConfig.props.positive,
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: [],
        sharedProps: {},
      },
    },
  },
github uber / baseweb / documentation-site / components / yard / config / file-uploader.ts View on Github external
'baseui/file-uploader': {named: ['FileUploader']},
  },
  scope: {
    FileUploader,
  },
  theme: [],
  props: {
    accept: {
      value: '',
      type: PropTypes.String,
      description:
        'Set accepted file types. See https://github.com/okonet/attr-accept for more information',
    },
    maxSize: {
      value: undefined,
      type: PropTypes.Number,
      description: 'Maximum file size (in bytes).',
    },
    minSize: {
      value: undefined,
      type: PropTypes.Number,
      description: 'Minimum file size (in bytes).',
    },
    multiple: {
      value: undefined,
      type: PropTypes.Boolean,
      description:
        'Allow drag n drop (or selection from the file dialog) of multiple files',
    },
    disableClick: {
      value: undefined,
      type: PropTypes.Boolean,
github uber / baseweb / documentation-site / components / yard / config / side-nav.ts View on Github external
description: 'Lets you customize all aspects of the component.',
      custom: {
        names: [
          'Root',
          'NavItemContainer',
          'NavLink',
          'NavItem',
          'SubNavContainer',
        ],
        sharedProps: {
          $active: {
            type: PropTypes.Boolean,
            description: 'True if nav item is active.',
          },
          $level: {
            type: PropTypes.Number,
            description: 'Indicates the nav item nesting level.',
          },
          $selectable: {
            type: PropTypes.Boolean,
            description: 'True if the nav item is selectable.',
          },
        },
      },
    },
  },
  mapTokensToProps: {
    Navigation: sideNavProps,
  },
};

export default SideNavigationConfig;
github uber / baseweb / documentation-site / components / yard / config / pagination.ts View on Github external
import {TConfig} from '../types';

const paginationProps = require('!!extract-react-types-loader!../../../../src/pagination/pagination.js');

const PaginationConfig: TConfig = {
  imports: {
    'baseui/pagination': {
      named: ['Pagination'],
    },
  },
  scope: {Pagination},
  theme: ['paginationTriangleDown'],
  props: {
    numPages: {
      value: 20,
      type: PropTypes.Number,
      description: 'The total number of pages available.',
    },
    currentPage: {
      value: 1,
      type: PropTypes.Number,
      description: 'The currently selected page.',
      stateful: true,
    },
    onPageChange: {
      value: `({nextPage}) => {
  setCurrentPage(
    Math.min(
      Math.max(nextPage, 1),
      20,
    )
  );