How to use the react-view.PropTypes.Function 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 / tag.ts View on Github external
'tagNegativeOutlinedActive',
    'tagNegativeOutlinedDisabled',
    'tagNegativeOutlinedFont',
    'tagNegativeOutlinedFontHover',
    'tagNegativeFontDisabled',
  ],
  props: {
    children: {
      value: 'this is a tag',
      type: PropTypes.ReactNode,
      description: `Visible label.`,
    },
    onClick: {
      value: undefined,
      placeholder: '() => alert("click")',
      type: PropTypes.Function,
      description: `onClick handler for the tag. Passing an onClick handler also makes the tag clickable.`,
    },
    onActionClick: {
      value: undefined,
      placeholder: '() => alert("click")',
      type: PropTypes.Function,
      description: `onClick handler for the action button element.`,
    },
    closeable: {
      value: true,
      defaultValue: true,
      type: PropTypes.Boolean,
      description: `Include or exclude the "x" button and click action.`,
    },
    kind: {
      value: 'KIND.primary',
github uber / baseweb / documentation-site / components / yard / config / timezonepicker.ts View on Github external
},
  scope: {
    TimezonePicker,
  },
  theme: selectConfig.theme,
  props: {
    value: {
      value: 'Europe/London',
      type: PropTypes.String,
      description:
        'Optional value that can be provided to fully control the component. If not provided, TimezonePicker will manage state internally.',
      stateful: true,
    },
    onChange: {
      value: '({ id }) => setValue(id)',
      type: PropTypes.Function,
      description: 'Callback for when the timezone selection changes.',
      propHook: {
        what: 'id',
        into: 'value',
      },
    },
    positive: inputConfig.props.positive,
    error: inputConfig.props.error,
    date: {
      value: new Date().toISOString(),
      type: PropTypes.Date,
      description:
        'If not provided, defaults to new Date(). Important to note that the timezone picker only displays options related to the provided date. Take Pacific Time for example. On March 9th, Pacific Time equates to the more specific Pacific Standard Time. On March 10th, it operates on Pacific Daylight Time. The timezone picker will never display PST and PDT together. If you need exact specificity, provide a date. Otherwise it will default to the relevant timezone at render.',
    },
    mapLabels: {
      value: undefined,
github uber / baseweb / documentation-site / components / yard / config / phone-input.ts View on Github external
country: {
      value: undefined,
      options: countriesEnum,
      type: PropTypes.Enum,
      enumName: 'COUNTRIES',
      description: 'Input value attribute.',
      stateful: true,
      imports: {
        'baseui/phone-input': {
          named: ['COUNTRIES'],
        },
      },
    },
    onCountryChange: {
      value: '({option}) => setCountry(option)',
      type: PropTypes.Function,
      description: 'Called when country value is changed.',
      propHook: {
        what: '"COUNTRIES." + option.id',
        into: 'country',
      },
    },
    text: {
      value: '',
      type: PropTypes.String,
      description: 'Text value attribute.',
      stateful: true,
    },
    onTextChange: {
      value: 'e => setText(e.currentTarget.value)',
      type: PropTypes.Function,
      description: 'Called when text value is changed.',
github uber / baseweb / documentation-site / components / yard / config / select.ts View on Github external
{label: 'Beige', id: '#F5F5DC'},
]`,
      type: PropTypes.Array,
      description: `Options to be displayed in the dropdown.
        If an option has a disabled prop value set to true it will be rendered as a disabled option in the dropdown.`,
    },
    value: {
      value: '[]',
      type: PropTypes.Array,
      description: `A current selected value(s). If a selected value has a clearableValue
        prop set to true it will be rendered as a disabled selected option that can't be cleared.`,
      stateful: true,
    },
    getOptionLabel: {
      value: undefined,
      type: PropTypes.Function,
      description:
        'A custom method to get a display value for a dropdown option.',
      placeholder: '({option}) => option.label',
    },
    getValueLabel: {
      value: undefined,
      type: PropTypes.Function,
      description:
        'A custom method to get a display value for a selected option.',
      placeholder: '({option}) => option.label',
    },
    labelKey: {
      value: undefined,
      type: PropTypes.String,
      description: 'Defines an option key name for a default label value.',
      placeholder: 'string',
github uber / baseweb / documentation-site / components / yard / config / form-control.ts View on Github external
},
  scope: {
    FormControl,
    Input,
  },
  theme: [],
  props: {
    children: {
      value: '<input>',
      type: PropTypes.ReactNode,
      description: 'Content wrapped by FormControl.',
      imports: {'baseui/input': {named: ['Input']}},
    },
    label: {
      value: `() =&gt; 'label'`,
      type: PropTypes.Function,
      description: 'A label rendered above the input field.',
    },
    caption: {
      value: `() =&gt; 'caption'`,
      type: PropTypes.Function,
      description: 'A caption rendered below the input field.',
    },
    positive: {
      value: undefined,
      type: PropTypes.Function,
      description:
        'Positive state of the input. If an error prop passed it will be rendered in place of positive as an error message.',
    },
    error: {
      value: undefined,
      type: PropTypes.Function,
github uber / baseweb / documentation-site / components / yard / config / tabs.ts View on Github external
Content 2


  Content 3
`,
      type: PropTypes.ReactNode,
      description: `An array of Tab components.`,
      imports: {
        'baseui/tabs': {named: ['Tab']},
      },
    },
    onChange: {
      value: '({ activeKey }) =&gt; {\n  setActiveKey(activeKey);\n}',
      type: PropTypes.Function,
      description: `Change handler that is called every time a new tab is selected.`,
      propHook: {
        what: 'activeKey',
        into: 'activeKey',
      },
    },
    orientation: {
      value: 'ORIENTATION.horizontal',
      defaultValue: 'ORIENTATION.horizontal',
      type: PropTypes.Enum,
      options: ORIENTATION,
      description: 'The orientation of the tab component.',
      imports: {
        'baseui/tabs': {named: ['ORIENTATION']},
      },
    },
github uber / baseweb / documentation-site / components / yard / config / modal.ts View on Github external
Proin ut dui sed metus pharetra hend rerit vel non mi.
  Nulla ornare faucibus ex, non facilisis nisl. Maecenas
  aliquet mauris ut tempus.


  Cancel
  Okay

`,
      type: PropTypes.ReactNode,
      description: 'Modal content.',
    },
    onClose: {
      value: '() =&gt; setIsOpen(false);',
      type: PropTypes.Function,
      description: 'A callback that is invoked when the modal will close.',
      propHook: {
        what: 'false',
        into: 'isOpen',
      },
    },
    closeable: {
      value: true,
      type: PropTypes.Boolean,
      description: 'Whether the modal should be closeable by the user.',
    },
    isOpen: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Toggles the modal visibility.',
      stateful: true,
github uber / baseweb / documentation-site / components / yard / config / file-uploader.ts View on Github external
...changeHandlers.reduce((acc, current) => {
      //@ts-ignore
      acc[current] = {
        value: undefined,
        type: PropTypes.Function,
        description: `Called when the ${current} even is triggered.`,
        hidden: true,
      };
      return acc;
    }, {}),
    name: {
github uber / baseweb / documentation-site / components / yard / config / phone-input.ts View on Github external
},
    maxDropdownHeight: {
      value: undefined,
      type: PropTypes.String,
      description: 'Sets the max height of the country select dropdown.',
      hidden: true,
    },
    maxDropdownWidth: {
      value: undefined,
      type: PropTypes.String,
      description: 'Sets the max width of the country select dropdown.',
      hidden: true,
    },
    mapIsoToLabel: {
      value: undefined,
      type: PropTypes.Function,
      description:
        'Function for mapping ISO codes to country names. Useful for localization of the country select dropdown.',
      hidden: true,
    },
    id: {
      value: undefined,
      type: PropTypes.String,
      description:
        "Id attribute value to be added to the input element and as a label's for attribute value.",
      hidden: true,
    },
    placeholder: {
      value: '',
      type: PropTypes.String,
      description: "Input's placeholder.",
    },
github uber / baseweb / documentation-site / components / yard / config / drawer.ts View on Github external
},
    showBackdrop: {
      value: false,
      type: PropTypes.Boolean,
      description: 'Whether the backdrop should be shown.',
      hidden: true,
    },
    onBackdropClick: {
      value: false,
      type: PropTypes.Function,
      description: 'Callback invoked when backdrop is clicked.',
      hidden: true,
    },
    onEscapeKeyDown: {
      value: false,
      type: PropTypes.Function,
      description: 'Callback invoked when escape key is pressed.',
      hidden: true,
    },
    overrides: {
      value: undefined,
      type: PropTypes.Custom,
      description: 'Lets you customize all aspects of the component.',
      custom: {
        names: ['Root', 'Backdrop', 'DrawerBody', 'DrawerContainer', 'Close'],
        sharedProps: {
          $animating: {
            type: PropTypes.Boolean,
            description: 'True if drawer is animating.',
          },
          $isVisible: {
            type: PropTypes.Boolean,