github.com/kotovmak/go-admin@v1.1.1/template/components/popup.go (about)

     1  package components
     2  
     3  import (
     4  	"html/template"
     5  
     6  	"github.com/kotovmak/go-admin/template/types"
     7  )
     8  
     9  type PopupAttribute struct {
    10  	Name       string
    11  	ID         string
    12  	Body       template.HTML
    13  	Footer     template.HTML
    14  	FooterHTML template.HTML
    15  	Title      template.HTML
    16  	Size       string
    17  	HideFooter bool
    18  	Height     string
    19  	Width      string
    20  	Draggable  bool
    21  	types.Attribute
    22  }
    23  
    24  func (compo *PopupAttribute) SetID(value string) types.PopupAttribute {
    25  	compo.ID = value
    26  	return compo
    27  }
    28  
    29  func (compo *PopupAttribute) SetTitle(value template.HTML) types.PopupAttribute {
    30  	compo.Title = value
    31  	return compo
    32  }
    33  
    34  func (compo *PopupAttribute) SetFooter(value template.HTML) types.PopupAttribute {
    35  	compo.Footer = value
    36  	return compo
    37  }
    38  
    39  func (compo *PopupAttribute) SetFooterHTML(value template.HTML) types.PopupAttribute {
    40  	compo.FooterHTML = value
    41  	return compo
    42  }
    43  
    44  func (compo *PopupAttribute) SetWidth(width string) types.PopupAttribute {
    45  	compo.Width = width
    46  	return compo
    47  }
    48  
    49  func (compo *PopupAttribute) SetHeight(height string) types.PopupAttribute {
    50  	compo.Height = height
    51  	return compo
    52  }
    53  
    54  func (compo *PopupAttribute) SetDraggable() types.PopupAttribute {
    55  	compo.Draggable = true
    56  	return compo
    57  }
    58  
    59  func (compo *PopupAttribute) SetHideFooter() types.PopupAttribute {
    60  	compo.HideFooter = true
    61  	return compo
    62  }
    63  
    64  func (compo *PopupAttribute) SetBody(value template.HTML) types.PopupAttribute {
    65  	compo.Body = value
    66  	return compo
    67  }
    68  
    69  func (compo *PopupAttribute) SetSize(value string) types.PopupAttribute {
    70  	compo.Size = value
    71  	return compo
    72  }
    73  
    74  func (compo *PopupAttribute) GetContent() template.HTML {
    75  	return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "popup")
    76  }