constructor(options) {
        super(options.name)
        this.box           = null // DOM Element that holds the element
        this.name          = null // unique name for w2ui
        this.routeData     = {} // data for dynamic routes
        this.items         = []
        this.right         = '' // HTML text on the right of toolbar
        this.tooltip       = 'top|left'// can be top, bottom, left, right
        this.onClick       = null
        this.onMouseDown   = null
        this.onMouseUp     = null
        this.onMouseEnter  = null // mouse enter the button event
        this.onMouseLeave  = null
        this.onRender      = null
        this.onRefresh     = null
        this.onResize      = null
        this.onDestroy     = null
        this.item_template = {
            id: null, // command to be sent to all event handlers
            type: 'button', // button, check, radio, drop, menu, menu-radio, menu-check, break, html, spacer
            text: null,
            html: '',
            tooltip: null,  // w2toolbar.tooltip should be
            count: null,
            hidden: false,
            disabled: false,
            checked: false, // used for radio buttons
            icon: null,
            route: null,    // if not null, it is route to go
            arrow: null,    // arrow down for drop/menu types
            style: null,    // extra css style for caption
            group: null,    // used for radio buttons
            items: null,    // for type menu* it is an array of items in the menu
            selected: null, // used for menu-check, menu-radio
            color: null,    // color value - used in color pickers
            overlay: {      // additional options for overlay
                anchorClass: ''
            },
            onClick: null,
            onRefresh: null
        }
        this.last = {
            badge: {}
        }
        // mix in options, w/o items
        let items = options.items
        delete options.items
        Object.assign(this, options)
        // add item via method to makes sure item_template is applied
        if (Array.isArray(items)) this.add(items, true)
        // need to reassign back to keep it in config
        options.items = items
        // render if box specified
        if (typeof this.box == 'string') this.box = query(this.box).get(0)
        if (this.box) this.render(this.box)
    }
Part of w2ui 2.0 library
 - Dependencies: mQuery, w2utils, w2base, w2tooltip, w2color, w2menu

== TODO ==
 - tab navigation (index state)
 - vertical toolbar
 - w2menu on second click of tb button should hide
 - button display groups for each show/hide, possibly add state: { single: t/f, multiple: t/f, type: 'font' }
 - item.count - should just support html, so a custom block can be created, such as a colored line

== 2.0 changes
 - CSP - fixed inline events
 - removed jQuery dependency
 - item.icon - can be class or <custom-icon-component> or <svg>
 - new w2tooltips and w2menu
 - scroll returns promise
 - added onMouseEntter, onMouseLeave, onMouseDown, onMouseUp events
 - add(..., skipRefresh), insert(..., skipRefresh)