How to use the @instructure/ui-utils/lib/uid function in @instructure/ui-utils

To help you get started, we’ve selected a few @instructure/ui-utils 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-core / src / components / TabList / index.js View on Github external
get tabIds () {
    // cache tab ids for better performance and to prevent errors with animations
    const ids = this._tabIds || []
    let diff = ids.length - this.tabs.length

    while (diff++ < 0) {
      ids.push(uid())
    }

    this._tabIds = ids

    return ids
  }
github instructure / instructure-ui / packages / ui-menu / src / components / Menu / MenuPopover / index.js View on Github external
constructor (props) {
    super(props)

    this._popover = null
    this._trigger = null
    this._menu = null
    this._labelId = `MenuPopover__${uid()}`
  }
github instructure / instructure-ui / packages / ui-core / src / components / RangeInput / index.js View on Github external
constructor (props) {
    super()

    if (props.value === undefined) {
      this.state = {
        value: props.defaultValue
      }
    }

    this.defaultId = `RangeInput_${uid()}`
  }
github instructure / instructure-ui / packages / ui-core / src / components / Checkbox / index.js View on Github external
constructor (props) {
    super(props)

    this.state = {
      focused: false,
      hovered: false
    }

    if (props.checked === undefined) {
      this.state.checked = !!props.defaultChecked
    }

    this._defaultId = `Checkbox__${uid()}`
  }
github instructure / instructure-ui / packages / ui-core / src / components / RadioInputGroup / index.js View on Github external
constructor (props) {
    super()

    if (props.value === undefined) {
      this.state = {
        value: props.defaultValue
      }
    }

    this._messagesId = `RadioInputGroup__messages-${uid()}`
  }
github instructure / instructure-ui / packages / ui-core / src / components / FormField / FormFieldLayout / index.js View on Github external
constructor (props) {
    super()

    this._messagesId = props.messagesId || `FormFieldLayout__messages-${uid()}`

    if (props.inline && props.layout === 'inline') {
      warning(
        !!props.width,
        `[FormFieldLayout] The inline prop is true, and the layout is set to inline.
        This will cause a layout issue in Internet Explorer 11 unless you also add a
        value for the width prop.`
      )
    }
  }
github instructure / instructure-ui / packages / ui-core / src / components / CheckboxGroup / index.js View on Github external
constructor (props) {
    super()

    if (props.value === undefined) {
      this.state = {
        value: props.defaultValue
      }
    }

    this._messagesId = `CheckboxGroup__messages-${uid()}`
  }
github instructure / instructure-ui / packages / ui-core / src / components / RadioInput / index.js View on Github external
constructor (props) {
    super(props)

    this.state = {}

    if (props.checked === undefined) {
      this.state.checked = false
    }

    this._defaultId = `RadioInput__${uid()}`
  }