def get_tab_header(self, element_name, title, class_name=None, kwargs=None, is_selected=False, is_loaded=False, is_template=False, attrs={}):
    web = WebContainer.get_web()
    header = HtmlElement.li()
    header.add_class('spt_tab_header')
    header.add_class('nav-item')
    header.add_attr('spt_tab_id', self.unique_id)
    header.add_class('hand')
    header.add_style('width: 120px')
    header.add_behavior({'type': 'load', 'cbjs_action': '$(bvr.src_el).bmdRipples();'})
    if self.use_default_style:
        header.add_class('rounded-top-corners')
    if is_selected:
        header.add_class('spt_tab_selected')
        header.add_class('spt_is_selected')
    else:
        header.add_class('spt_tab_unselected')
    count = attrs.get('count')
    header.add_attr('spt_element_name', element_name)
    header.add_attr('spt_title', title)
    if (not is_template):
        if kwargs:
            if count:
                kwargs['count'] = count
            kwargs_str = Common.convert_to_json(kwargs)
            header.add_attr('spt_kwargs', kwargs_str)
        header.add_attr('spt_class_name', class_name)
        header.add_attr('spt_class_name_decoded', class_name)
    else:
        header.add_attr('spt_kwargs', '')
        widget_key = None
    header.add_behavior({'type': 'click_up', 'cbjs_action': '\n        var header = bvr.src_el;\n        spt.tab.top = header.getParent(".spt_tab_top");\n        var this_name = header.getAttribute(\'spt_element_name\');\n        spt.tab.select(this_name);\n        '})
    from .smart_menu_wdg import SmartMenu
    SmartMenu.assign_as_local_activator(header, 'DG_HEADER_CTX')
    title_container = DivWdg(css='spt_tab_header_label_container')
    title_container.add_class('nav-link')
    show_remove = self.kwargs.get('show_remove')
    if (show_remove not in [False, 'false']):
        title_container.add_style('width: 95%')
    else:
        title_container.add_style('width: 100%')
    header.add(title_container)
    title_div = DivWdg()
    title_div.add_class('spt_tab_header_label')
    display_title = title
    title_div.add(display_title)
    title_container.add(title_div)
    title_div.add_attr('title', ('%s' % title))
    count_wdg = SpanWdg()
    count_wdg.add_class('badge badge-secondary spt_tab_header_count')
    title_container.add(count_wdg)
    icon = None
    if icon:
        icon = IconWdg(name='whatever', icon=icon)
        title_div.add(icon)
    if count:
        count_color = attrs.get('count_color')
        state = (self.kwargs.get('state') or {})
        search_key = state.get('search_key')
        if (not search_key):
            search_key = self.kwargs.get('search_key')
        if search_key:
            sobject = Search.get_by_search_key(search_key)
        else:
            sobject = None
        if sobject:
            value = Search.eval(count, sobject)
            count_wdg.add(value)
            if count_color:
                count_wdg.add_style('background', count_color)
            count_wdg.add_update({'expression': count, 'expr_key': search_key})
    remove_wdg = DivWdg()
    remove_wdg.add_class('spt_tab_remove')
    remove_wdg.add_behavior({'type': 'click', 'cbjs_action': '\n        spt.tab.close(bvr.src_el); \n        '})
    show_remove = self.kwargs.get('show_remove')
    show_remove_tabs = self.kwargs.get('show_remove_tabs')
    if show_remove_tabs:
        show_remove_tabs_list = show_remove_tabs.split('|')
        if (element_name in show_remove_tabs_list):
            show_remove = False
    if (is_template or (show_remove not in [False, 'false'])):
        header.add(remove_wdg)
    if (show_remove == 'hover'):
        remove_wdg.add_style('display: none')
    remove_icon_path = self.kwargs.get('remove_icon_path')
    if remove_icon_path:
        icon = HtmlElement.img(remove_icon_path)
        icon.add_styles('padding: 2px; width: 11px')
        remove_wdg.add_style('right: 6px;')
    else:
        from tactic.ui.widget import ButtonNewWdg
        icon = ButtonNewWdg(icon='FA_TIMES', size=12, width=20)
    icon.add_class('spt_icon_active')
    remove_wdg.add(icon)
    divider_div = DivWdg()
    divider_div.add_style('width: 1px')
    divider_div.add_style('background: #fff')
    divider_div.add_style('height: 20px')
    header.add(divider_div)
    allow_drag = self.kwargs.get('allow_drag')
    if (allow_drag not in [False, 'false']):
        header.add_class('drag-header')
        header.add_behavior({'type': 'drag', 'drag_el': '@', 'cb_set_prefix': 'spt.tab.header_drag'})
    return header
def get_tab_header(self, element_name, title, class_name=None, kwargs=None, is_selected=False, is_loaded=False, is_template=False, attrs={}):
    web = WebContainer.get_web()
    header = HtmlElement.li()
    header.add_class('spt_tab_header')
    header.add_class('nav-item')
    header.add_attr('spt_tab_id', self.unique_id)
    header.add_class('hand')
    header.add_style('width: 120px')
    header.add_behavior({'type': 'load', 'cbjs_action': '$(bvr.src_el).bmdRipples();'})
    if self.use_default_style:
        header.add_class('rounded-top-corners')
    if is_selected:
        header.add_class('spt_tab_selected')
        header.add_class('spt_is_selected')
    else:
        header.add_class('spt_tab_unselected')
    count = attrs.get('count')
    header.add_attr('spt_element_name', element_name)
    header.add_attr('spt_title', title)
    if (not is_template):
        if kwargs:
            if count:
                kwargs['count'] = count
            kwargs_str = Common.convert_to_json(kwargs)
            header.add_attr('spt_kwargs', kwargs_str)
        header.add_attr('spt_class_name', class_name)
        header.add_attr('spt_class_name_decoded', class_name)
    else:
        header.add_attr('spt_kwargs', )
        widget_key = None
    header.add_behavior({'type': 'click_up', 'cbjs_action': '\n        var header = bvr.src_el;\n        spt.tab.top = header.getParent(".spt_tab_top");\n        var this_name = header.getAttribute(\'spt_element_name\');\n        spt.tab.select(this_name);\n        '})
    from .smart_menu_wdg import SmartMenu
    SmartMenu.assign_as_local_activator(header, 'DG_HEADER_CTX')
    title_container = DivWdg(css='spt_tab_header_label_container')
    title_container.add_class('nav-link')
    show_remove = self.kwargs.get('show_remove')
    if (show_remove not in [False, 'false']):
        title_container.add_style('width: 95%')
    else:
        title_container.add_style('width: 100%')
    header.add(title_container)
    title_div = DivWdg()
    title_div.add_class('spt_tab_header_label')
    display_title = title
    title_div.add(display_title)
    title_container.add(title_div)
    title_div.add_attr('title', ('%s' % title))
    count_wdg = SpanWdg()
    count_wdg.add_class('badge badge-secondary spt_tab_header_count')
    title_container.add(count_wdg)
    icon = None
    if icon:
        icon = IconWdg(name='whatever', icon=icon)
        title_div.add(icon)
    if count:
        count_color = attrs.get('count_color')
        state = (self.kwargs.get('state') or {})
        search_key = state.get('search_key')
        if (not search_key):
            search_key = self.kwargs.get('search_key')
        if search_key:
            sobject = Search.get_by_search_key(search_key)
        else:
            sobject = None
        if sobject:
            value = Search.eval(count, sobject)
            count_wdg.add(value)
            if count_color:
                count_wdg.add_style('background', count_color)
            count_wdg.add_update({'expression': count, 'expr_key': search_key})
    remove_wdg = DivWdg()
    remove_wdg.add_class('spt_tab_remove')
    remove_wdg.add_behavior({'type': 'click', 'cbjs_action': '\n        spt.tab.close(bvr.src_el); \n        '})
    show_remove = self.kwargs.get('show_remove')
    show_remove_tabs = self.kwargs.get('show_remove_tabs')
    if show_remove_tabs:
        show_remove_tabs_list = show_remove_tabs.split('|')
        if (element_name in show_remove_tabs_list):
            show_remove = False
    if (is_template or (show_remove not in [False, 'false'])):
        header.add(remove_wdg)
    if (show_remove == 'hover'):
        remove_wdg.add_style('display: none')
    remove_icon_path = self.kwargs.get('remove_icon_path')
    if remove_icon_path:
        icon = HtmlElement.img(remove_icon_path)
        icon.add_styles('padding: 2px; width: 11px')
        remove_wdg.add_style('right: 6px;')
    else:
        from tactic.ui.widget import ButtonNewWdg
        icon = ButtonNewWdg(icon='FA_TIMES', size=12, width=20)
    icon.add_class('spt_icon_active')
    remove_wdg.add(icon)
    divider_div = DivWdg()
    divider_div.add_style('width: 1px')
    divider_div.add_style('background: #fff')
    divider_div.add_style('height: 20px')
    header.add(divider_div)
    allow_drag = self.kwargs.get('allow_drag')
    if (allow_drag not in [False, 'false']):
        header.add_class('drag-header')
        header.add_behavior({'type': 'drag', 'drag_el': '@', 'cb_set_prefix': 'spt.tab.header_drag'})
    return header