all files / packages/toolbar/ Toolbar.js

0% Statements 0/10
0% Branches 0/2
0% Functions 0/5
0% Lines 0/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40                                                                               
import { Toolbox } from '../../ui'
 
class Toolbar extends Toolbox {
 
  render($$) {
    let el = $$('div').addClass(this.getClassNames())
    let activeToolGroups = this.state.activeToolGroups
 
    activeToolGroups.forEach((toolGroup) => {
      let toolGroupProps = Object.assign({}, toolGroup, {
        toolStyle: this.getToolStyle(),
        layout: 'horizontal',
        showIcons: true
      })
      el.append(
        $$(toolGroup.Class, toolGroupProps)
      )
    })
    return el
  }
 
  getActiveToolGroupNames() {
    return this.props.toolGroups || ['text', 'document', 'annotations', 'default']
  }
 
  getClassNames() {
    return 'sc-toolbar';
  }
 
  getToolStyle() {
    return 'outline'
  }
 
  showDisabled() {
    return true
  }
}
 
export default Toolbar