| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- namespace VberAdmin.Web.Models.Modals;
- public class VmModal
- {
- public VmModal(string id, string formId)
- {
- Id = id;
- FormId = formId;
- }
- public VmModal(string id) : this(id, id + "_form")
- {
- Id = id;
- }
- public VmModal() : this("modal", "form")
- {
- }
- public VmModalHeader Header { get; set; }
- public int? Footer { get; set; } = 0;
- private VmModalBody _body;
- public string Other { get; set; }
- public string Class { get; set; }
- public string SizeClass { get; set; } = "modal-lg";
- public string DialogClass { get; set; } = "modal-dialog-centered modal-dialog-scrollable";
- public int? Width { get; set; }
- public VmModalBody Body
- {
- get
- {
- _body.Modal = this;
- return _body;
- }
- set => _body = value;
- }
- public string Id { get; set; }
- public string FormId { get; set; }
- public VmModal WithOther(string other)
- {
- Other = other;
- return this;
- }
- public VmModal WithClass(string @class)
- {
- Class = @class;
- return this;
- }
- public VmModal WithSizeClass(string sizeClass, string @class)
- {
- SizeClass = sizeClass;
- Class = @class;
- return this;
- }
- public VmModal WithWidth(int width)
- {
- Width = width;
- return this;
- }
- public VmModal WithHeaderAndFooter(VmModalHeader header, int? footer = 0)
- {
- Header = header;
- Footer = footer;
- return this;
- }
- public VmModal WithHeaderAndFooter(string title, string preFix = null, string subFix = null, int? footer = 0)
- {
- Header = new VmModalHeader(title, preFix, subFix);
- Footer = footer;
- return this;
- }
- public VmModal WithBody(string body)
- {
- Body = new VmModalBody().WithBodyContent(body);
- return this;
- }
- public VmModal WithBody(VmModalTabBodyBase body)
- {
- Body = (VmModalBody)body;
- return this;
- }
- public VmModal WithBody(VmModalBody body)
- {
- Body = body;
- return this;
- }
- public VmModalBody WithBody()
- {
- Body = new VmModalBody();
- return Body;
- }
- }
|