Esempio n. 1
0
 public void AddColumnHeader(string name_header)
 {
     ChildsNodes.Add(new hsTableTh()
     {
         Header = name_header
     });
 }
Esempio n. 2
0
        public bsNavItem AddNavItem(string id_dom, string header, string href)
        {
            bsNavItem navItem = new bsNavItem(id_dom)
            {
                Header = header, Href = href
            };

            ChildsNodes.Add(navItem);
            return(navItem);
        }
        public void AddFacetText(string header_text)
        {
            hsSpan span = new hsSpan()
            {
                Header = header_text
            };

            span.AddCSS("input-group-text");
            ChildsNodes.Add(span);
        }
        public void AddSubNav(string header_nav, string href_nav = "#", string id_nav = null)
        {
            if (string.IsNullOrEmpty(header_nav))
            {
                ChildsNodes.Add(null);
                return;
            }

            ChildsNodes.Add(new bsNavItem(id_nav)
            {
                Header = header_nav, Href = href_nav
            });
        }
        /// <summary>
        /// Вертикально обычный Input (не Checkable)
        /// </summary>
        private void WriteDomNormalSingle()
        {
            if (!string.IsNullOrEmpty(Label.Header))
            {
                ChildsNodes.Add(Label);
            }

            ChildsNodes.Add(wInput);

            if (!string.IsNullOrEmpty(CustomInput.HelpCaption))
            {
                ChildsNodes.Add(new hsSmall(CustomInput.HelpCaption).AddCSS("form-text text-muted"));
            }
        }
        public bsNavItem AddNav(string SetNavHeader, string SetNavId, string SetNavCachedContent)
        {
            bsNavItem navItem = new bsNavItem(SetNavId)
            {
                Header = SetNavHeader, Href = "#" + SetNavId, ID = SetNavId + "-tab"
            };

            navItem.SetAttribute(new Dictionary <string, string>()
            {
                { "data-toggle", this.IsTabsStyle ? "tab" : "pill" }, { "role", "tab" }, { "aria-controls", SetNavId }
            });

            ChildsNodes.Add(navItem);
            CacheContents.Add(SetNavId, SetNavCachedContent);
            return((bsNavItem)ChildsNodes[ChildsNodes.Count - 1]);
        }
        /// <summary>
        /// Горизонтально обычный Input (не Checkable)
        /// </summary>
        private void WriteDomHorisontalSingle()
        {
            hsDiv LabelDiv = new hsDiv().AddCSS("col-sm-2") as hsDiv;
            hsDiv InputDiv = new hsDiv().AddCSS("col-sm-10") as hsDiv;

            //Label.AddCSS("col-form-label");

            LabelDiv.ChildsNodes.Add(Label);
            ChildsNodes.Add(LabelDiv);
            InputDiv.ChildsNodes.Add(wInput);
            if (!string.IsNullOrEmpty(CustomInput.HelpCaption))
            {
                InputDiv.ChildsNodes.Add(new hsSmall(CustomInput.HelpCaption).AddCSS("form-text text-muted"));
            }
            ChildsNodes.Add(InputDiv);
        }
Esempio n. 8
0
        public bsNavItem AddNav(string SetNavHeader, string SetNavHref, string SetNavId)
        {
            if (string.IsNullOrWhiteSpace(SetNavId))
            {
                throw new ArgumentNullException(nameof(SetNavId));
            }
            if (string.IsNullOrWhiteSpace(SetNavHref))
            {
                throw new ArgumentNullException(nameof(SetNavHref));
            }

            ChildsNodes.Add(new bsNavItem(SetNavId)
            {
                Header = SetNavHeader, Href = SetNavHref
            });
            return((bsNavItem)ChildsNodes[ChildsNodes.Count - 1]);
        }
        /// <summary>
        /// Checkable - Label слева отдельно (в "col-sm-2") от Input. Input справа в "col-sm-10"
        /// </summary>
        private void WriteDomHorisontalSingleCheckable()
        {
            hsDiv LabelDiv = new hsDiv().AddCSS("col-sm-2") as hsDiv;
            hsDiv InputDiv = new hsDiv().AddCSS("col-sm-10") as hsDiv;
            hsDiv div      = new hsDiv().AddCSS("form-check") as hsDiv;

            if (CustomInput.IsHorisontalStyle)
            {
                div.AddCSS("form-check-inline");
            }
            div.ChildsNodes.Add(LabelDiv);
            div.ChildsNodes.Add(InputDiv);
            if (!string.IsNullOrEmpty(CustomInput.HelpCaption))
            {
                div.ChildsNodes.Add(new hsSmall(CustomInput.HelpCaption).AddCSS("form-text text-muted"));
            }
            ChildsNodes.Add(div);
        }
Esempio n. 10
0
        public override ahsDom[] GetChilds()
        {
            ChildsNodes.Clear();
            bsFormGroupSingle groupSingle;

            foreach (bmInput input in CustomInputs)
            {
                groupSingle = new bsFormGroupSingle()
                {
                    IsHorisontal = false
                };
                if (UseCustomisation)
                {
                    groupSingle.CustomInput = new bmCustomInput(input);
                }
                else
                {
                    groupSingle.CustomInput = input.Clone() as bmInput;
                }

                if (IsInline)
                {
                    groupSingle.CustomInput.IsHorisontalStyle = IsInline;
                    if (groupSingle.CustomInput.Input.GetType().IsSubclassOf(typeof(ahsCheckableInputs)))
                    {
                        groupSingle.AddCSS("form-check-inline");
                        ChildsNodes.AddRange(groupSingle.GetChilds());
                    }
                    else
                    {
                        groupSingle.AddCSS(("col " + input.AddedWrapCSS).Trim());
                        ChildsNodes.Add(groupSingle);
                    }
                }
                else
                {
                    ChildsNodes.AddRange(groupSingle.GetChilds());
                }
            }
            return(base.GetChilds());
        }
 public void AddSubNode(bsNavbarText navbarText)
 {
     ChildsNodes.Add(navbarText);
 }
        /// <summary>
        /// Кастомный Bootstrap Input
        /// </summary>
        private void WriteCustomDomSingle()
        {
            if (CustomInput.Input.GetType().IsSubclassOf(typeof(ahsCheckableInputs)))
            {
                wInput.AddCSS("custom-control-input");
                Label.AddCSS("custom-control-label");
            }
            else
            {
                if (CustomInput.Input is hsInputSelect)
                {
                    wInput.AddCSS("custom-select");
                }
                else if (CustomInput.Input is hsInputRange)
                {
                    wInput.AddCSS("custom-range");
                }
                else if (CustomInput.Input is hsInputFile)
                {
                    wInput.AddCSS("custom-file-input");
                    Label.AddCSS("custom-file-label");
                }
                else
                {
                    //wInput.AddCSS("custom-control-input");
                }
            }

            if (IsHorisontal)
            {
                hsDiv LabelDiv = new hsDiv().AddCSS("col-sm-2") as hsDiv;
                hsDiv InputDiv = new hsDiv().AddCSS("col-sm-10") as hsDiv;

                if (!(CustomInput.Input is hsInputFile))
                {
                    Label.AddCSS("col-form-label");
                }

                if (!string.IsNullOrEmpty(CustomInput.Label) && !(CustomInput.Input is hsInputFile))
                {
                    LabelDiv.ChildsNodes.Add(Label);
                }
                else
                {
                    LabelDiv.ChildsNodes.Add(new hsP(" "));
                }

                InputDiv.ChildsNodes.Add(wInput);

                if (CustomInput.Input is hsInputFile)
                {
                    InputDiv.ChildsNodes.Add(Label);
                }
                if (!string.IsNullOrEmpty(CustomInput.HelpCaption))
                {
                    InputDiv.ChildsNodes.Add(new hsSmall(CustomInput.HelpCaption).AddCSS("form-text text-muted"));
                }
                ChildsNodes.Add(LabelDiv);
                ChildsNodes.Add(InputDiv);
            }
            else
            {
                if (CustomInput.Input.GetType().IsSubclassOf(typeof(ahsCheckableInputs)))
                {
                    hsDiv div = new hsDiv().AddCSS("custom-control") as hsDiv;
                    if (CustomInput.IsHorisontalStyle)
                    {
                        div.AddCSS("custom-control-inline");
                    }

                    if (CustomInput.Input is bsSwitchInput)
                    {
                        div.AddCSS("custom-switch");
                    }
                    else if (CustomInput.Input is hsInputCheckbox)
                    {
                        div.AddCSS("custom-checkbox");
                    }
                    else if (CustomInput.Input is hsInputRadio)
                    {
                        div.AddCSS("custom-radio");
                    }

                    div.AddChild(wInput);
                    if (string.IsNullOrEmpty(CustomInput.Label))
                    {
                        wInput.AddCSS("position-static");
                    }
                    else
                    {
                        div.AddChild(Label);
                    }

                    if (!string.IsNullOrWhiteSpace(CustomInput.HelpCaption))
                    {
                        div.AddChild(new hsSmall(CustomInput.HelpCaption)
                        {
                            ID = HelpCaptionId
                        }.AddCSS("form-text text-muted"));
                    }
                    ChildsNodes.Add(div);
                }
                else
                {
                    if (CustomInput.Input is hsInputSelect)
                    {
                        wInput.AddCSS("custom-select");
                    }
                    else if (CustomInput.Input is hsInputRange)
                    {
                        wInput.AddCSS("custom-range");
                    }
                    else if (CustomInput.Input is hsInputFile)
                    {
                        Label.AddCSS("custom-file-label");
                        wInput.AddCSS("custom-file-input");
                        hsDiv div = new hsDiv().AddCSS("custom-file") as hsDiv;
                        div.ChildsNodes.Add(wInput);
                        if (!string.IsNullOrEmpty(CustomInput.Label))
                        {
                            div.ChildsNodes.Add(Label);
                        }
                        if (!string.IsNullOrWhiteSpace(CustomInput.HelpCaption))
                        {
                            div.ChildsNodes.Add(new hsSmall(CustomInput.HelpCaption)
                            {
                                ID = HelpCaptionId
                            }.AddCSS("form-text text-muted"));
                        }
                        ChildsNodes.Add(div);
                        return;
                    }
                    else
                    {
                        wInput.AddCSS("form-control");
                    }



                    if (!string.IsNullOrEmpty(CustomInput.Label))
                    {
                        ChildsNodes.Add(Label);
                    }
                    ChildsNodes.Add(wInput);
                    if (!string.IsNullOrWhiteSpace(CustomInput.HelpCaption))
                    {
                        ChildsNodes.Add(new hsSmall(CustomInput.HelpCaption)
                        {
                            ID = HelpCaptionId
                        }.AddCSS("form-text text-muted"));
                    }
                }
            }
        }
 public void AddSubNode(bsNavbarNav navbarNav)
 {
     navbarNav.AddCSS("navbar-nav");
     ChildsNodes.Add(navbarNav);
 }
 public void AddRow(hsTableTr tableTr)
 {
     ChildsNodes.Add(tableTr);
 }
Esempio n. 15
0
 public hsTableTr AddCell(bsTableTd tdBootstrapManager)
 {
     ChildsNodes.Add(tdBootstrapManager);
     return(this);
 }
 public void AddSubNode(hsForm navbarform)
 {
     navbarform.AddCSS("form-inline");
     ChildsNodes.Add(navbarform);
 }
Esempio n. 17
0
 public hsTableTr AddCell(hsTableTd tdManager)
 {
     ChildsNodes.Add(tdManager);
     return(this);
 }
Esempio n. 18
0
 public void AddChild(ahsDom AddedChildNode)
 {
     ChildsNodes.Add(AddedChildNode);
 }