Ejemplo n.º 1
0
        internal override void RenderElement(RenderContext context, Action <TagBuilder> onRender = null)
        {
            var dialog = new TagBuilder("div", "modal");

            dialog.MergeAttribute("id", context.RootId);

            SetSize(dialog);

            dialog.RenderStart(context);

            RenderHeader(context);
            RenderLoadIndicator(context);

            var content = new TagBuilder("div", "modal-content");

            OnCreateContent(content);
            if (Height != null)
            {
                content.MergeStyle("height", Height.Value);
            }
            if (Padding != null)
            {
                Padding.MergeStyles("padding", content);
            }
            content.RenderStart(context);
            RenderChildren(context);
            content.RenderEnd(context);

            RenderFooter(context);

            dialog.RenderEnd(context);
        }
Ejemplo n.º 2
0
        internal override void RenderElement(RenderContext context, Action <TagBuilder> onRender = null)
        {
            var dialog = new TagBuilder("div", "modal");

            dialog.MergeAttribute("id", context.RootId);
            dialog.MergeAttribute("v-cloak", String.Empty);
            dialog.AddCssClassBoolNo(UserSelect, "user-select");

            dialog.MergeAttribute("data-controller-attr", GetControllerAttributes());

            SetSize(dialog);

            dialog.RenderStart(context);

            RenderHeader(context);
            RenderLoadIndicator(context);


            var content = new TagBuilder("div", "modal-content");

            OnCreateContent(content);
            if (Height != null)
            {
                content.MergeStyle("min-height", Height.Value);
            }
            if (Padding != null)
            {
                Padding.MergeStyles("padding", content);
            }
            content.AddCssClassBool(IsContentIsIFrame, "content-iframe");             // bug fix (3px height)
            content.RenderStart(context);
            if (Taskpad != null)
            {
                var grid = new TagBuilder("div", "dialog-grid");
                if (Taskpad is Taskpad tp && tp.Width != null)
                {
                    grid.MergeStyle("grid-template-columns", $"1fr {tp.Width.Value}");
                }
                grid.RenderStart(context);
                var gridContent = new TagBuilder("div", "dialog-grid-content");
                gridContent.RenderStart(context);
                RenderChildren(context);
                gridContent.RenderEnd(context);
                Taskpad.RenderElement(context);
                grid.RenderEnd(context);
            }
            else
            {
                RenderChildren(context);
            }

            content.RenderEnd(context);

            RenderFooter(context);

            dialog.RenderEnd(context);
        }
Ejemplo n.º 3
0
        internal virtual void MergeAttributes(TagBuilder tag, RenderContext context, MergeAttrMode mode = MergeAttrMode.All)
        {
            if (mode.HasFlag(MergeAttrMode.Visibility))
            {
                MergeVisibilityAttribures(tag, context);
            }

            if (mode.HasFlag(MergeAttrMode.Tip))
            {
                MergeBindingAttributeString(tag, context, "title", "Tip", Tip);
            }

            if (mode.HasFlag(MergeAttrMode.Wrap))
            {
                if (Wrap != WrapMode.Default)
                {
                    tag.AddCssClass(Wrap.ToString().ToKebabCase());
                }
            }

            if (mode.HasFlag(MergeAttrMode.Margin))
            {
                if (Margin != null)
                {
                    Margin.MergeStyles("margin", tag);
                }
                if (Padding != null)
                {
                    Padding.MergeStyles("padding", tag);
                }
            }

            if (Absolute != null)
            {
                Absolute.MergeAbsolute(tag);
            }

            tag.MergeAttribute("id", HtmlId);
        }
Ejemplo n.º 4
0
        internal virtual void MergeAttributes(TagBuilder tag, RenderContext context, MergeAttrMode mode = MergeAttrMode.All)
        {
            if (mode.HasFlag(MergeAttrMode.Visibility))
            {
                MergeBindingAttributeBool(tag, context, "v-if", nameof(If), If);
                MergeBindingAttributeBool(tag, context, "v-show", nameof(Show), Show);
                // emulate v-hide
                MergeBindingAttributeBool(tag, context, "v-show", nameof(Hide), Hide, bInvert: true);
            }
            if (mode.HasFlag(MergeAttrMode.Tip))
            {
                MergeBindingAttributeString(tag, context, "title", "Tip", Tip);
            }
            if (mode.HasFlag(MergeAttrMode.Wrap))
            {
                if (Wrap != WrapMode.Default)
                {
                    tag.AddCssClass(Wrap.ToString().ToKebabCase());
                }
            }
            if (mode.HasFlag(MergeAttrMode.Margin))
            {
                if (Margin != null)
                {
                    Margin.MergeStyles("margin", tag);
                }
                if (Padding != null)
                {
                    Padding.MergeStyles("padding", tag);
                }

                if (Absolute != null)
                {
                    Absolute.MergeAbsolute(tag);
                }
            }
        }
Ejemplo n.º 5
0
        public override void RenderElement(RenderContext context, Action <TagBuilder> onRender = null)
        {
            var dialog = new TagBuilder("div", "modal");

            dialog.MergeAttribute("id", context.RootId);
            dialog.MergeAttribute("v-cloak", String.Empty);
            dialog.AddCssClassBoolNo(UserSelect, "user-select");
            dialog.MergeAttribute("data-controller-attr", GetControllerAttributes());

            if (!String.IsNullOrEmpty(TestId) && context.IsDebugConfiguration)
            {
                dialog.MergeAttribute("test-id", TestId);
            }


            SetSize(dialog);

            dialog.RenderStart(context);

            if (ShowWaitCursor)
            {
                new TagBuilder("wait-cursor", "dialog")
                .MergeAttribute(":ready", "$data.$ready")
                .Render(context, TagRenderMode.Normal);
            }


            RenderHeader(context);
            RenderLoadIndicator(context);


            var content = new TagBuilder("div", "modal-content");

            OnCreateContent(content);
            if (Height != null)
            {
                content.MergeStyle("min-height", Height.Value);
            }
            if (Padding != null)
            {
                Padding.MergeStyles("padding", content);
            }
            content.AddCssClassBool(IsContentIsIFrame, "content-iframe");             // bug fix (3px height)
            content.RenderStart(context);
            if (Taskpad != null)
            {
                var grid = new TagBuilder("div", "dialog-grid");
                if (Taskpad is Taskpad tp && tp.Width != null)
                {
                    grid.MergeStyle("grid-template-columns", $"1fr {tp.Width.Value}");
                }
                grid.RenderStart(context);
                var gridContent = new TagBuilder("div", "dialog-grid-content");
                gridContent.RenderStart(context);
                RenderChildren(context);
                gridContent.RenderEnd(context);
                Taskpad.RenderElement(context);
                grid.RenderEnd(context);
            }
            else
            {
                RenderChildren(context);
            }

            content.RenderEnd(context);

            RenderFooter(context);

            dialog.RenderEnd(context);
        }
Ejemplo n.º 6
0
        public override void RenderElement(RenderContext context, Action <TagBuilder> onRender = null)
        {
            var dialog = new TagBuilder("div", "modal");

            dialog.MergeAttribute("id", context.RootId);
            dialog.MergeAttribute("v-cloak", String.Empty);
            dialog.AddCssClassBoolNo(UserSelect, "user-select");
            dialog.MergeAttribute("data-controller-attr", GetControllerAttributes());
            dialog.AddCssClassBool(Maximize, "maximize");
            dialog.AddCssClassBool(ButtonOnTop, "button-on-top");

            if (!String.IsNullOrEmpty(TestId) && context.IsDebugConfiguration)
            {
                dialog.MergeAttribute("test-id", TestId);
            }


            if (Maximize)
            {
                dialog.MergeAttribute("v-maximize", "true");
            }
            else
            {
                SetSize(dialog);
            }

            dialog.RenderStart(context);

            if (ShowWaitCursor)
            {
                new TagBuilder("wait-cursor", "dialog")
                .MergeAttribute(":ready", "$data.$ready")
                .Render(context, TagRenderMode.Normal);
            }

            if (CollectionView != null)
            {
                CollectionView.RenderStart(context, tag =>
                {
                    tag.AddCssClass("cw-dialog");
                });
            }

            RenderHeader(context);
            RenderLoadIndicator(context);

            var content = new TagBuilder("div", "modal-content");

            OnCreateContent(content);
            if (Height != null)
            {
                content.MergeStyle("min-height", Height.Value);
            }
            if (Padding != null)
            {
                Padding.MergeStyles("padding", content);
            }
            content.AddCssClassBool(IsContentIsIFrame, "content-iframe");             // bug fix (3px height)
            if (Background != BackgroundStyle.Default)
            {
                content.AddCssClass("background-" + Background.ToString().ToKebabCase());
            }
            content.AddCssClassBool(Overflow, "overflow");
            content.RenderStart(context);
            if (Taskpad != null)
            {
                var gridContent = new TagBuilder("div", "dialog-grid-content");
                var grid        = new TagBuilder("div", "dialog-grid");
                if (Taskpad is Taskpad tp && tp.Width != null)
                {
                    if (tp.Position == TaskpadPosition.Left)
                    {
                        grid.MergeStyle("grid-template-columns", $"{tp.Width.Value} 1fr");
                        gridContent.MergeStyle("grid-column", "2");
                    }
                    else
                    {
                        grid.MergeStyle("grid-template-columns", $"1fr {tp.Width.Value}");
                        gridContent.MergeStyle("grid-column", "1");
                    }
                }
                grid.RenderStart(context);
                gridContent.RenderStart(context);
                RenderChildren(context);
                gridContent.RenderEnd(context);
                Taskpad.RenderElement(context);
                grid.RenderEnd(context);
            }
            else
            {
                RenderChildren(context);
            }

            content.RenderEnd(context);

            RenderFooter(context);

            if (CollectionView != null)
            {
                CollectionView.RenderEnd(context);
            }

            RenderAccelCommands(context);
            RenderContextMenus();

            dialog.RenderEnd(context);
        }