public void Dispose() { if (TargetRef != null) { _ = DomHelpers.ClearContentAsync(TargetRef.Current); } }
protected override async Task OnAfterMountAsync() { var value = await DomHelpers.GetInputValueAsync(Input.RootRef.Current); if (!string.IsNullOrEmpty(value)) { if (IsControlled) { if (!object.Equals(Value, value)) { await OnChange.InvokeAsync(new ChangeEventArgs { Value = value }); await ValueChanged.InvokeAsync(value); } } else { ValueState = value; } DirtyCheck(value); await InvokeAsync(StateHasChanged); } }
protected override async Task OnAfterRenderAsync() { if (AutoFocus && Open) { var elementRef = RootRef.Current; await DomHelpers.FocusAsync(elementRef); } }
protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); if (TargetRef != null) { await DomHelpers.MoveContentAsync(SourceRef.Current, TargetRef.Current); } }
protected Task UpdateClassesAsync(IReference refback, IEnumerable <string> adds, IEnumerable <string> removes, bool trigger = false) { List <string> removeClasses = removes.ToList(); List <string> addClasses = adds.ToList(); _ = DomHelpers.UpdateClassesAsync(refback.Current, removeClasses, addClasses, trigger); return(Task.CompletedTask); }
protected override async Task OnAfterRenderAsync() { await base.OnAfterRenderAsync(); if (!DisablePortal) { // await Task.Delay(2000); await DomHelpers.MoveContentAsync(SourceRef.Current, TargetRef?.Current, TargetBodyRef?.Current); } }
protected async Task HandleEnteredAsync(IReference refback, bool appeared) { var styles = new Dictionary <string, object> { { "height", "auto" } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnEntered?.Invoke(refback, appeared); }
protected async Task HandleEnterAsync(IReference refback, bool appear) { var styles = new Dictionary <string, object> { { "height", $"{CollapsedHeight.ToString(CultureInfo.InvariantCulture)}px" } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnEnter?.Invoke(refback, appear); }
protected async Task UpdateClassesAsync(IReference refback, IEnumerable <string> adds, IEnumerable <string> removes, bool trigger = false) { List <string> removeClasses = removes.ToList(); List <string> addClasses = adds.ToList(); if (removeClasses.Count > 0 || addClasses.Count > 0) { await DomHelpers.UpdateClassesAsync(refback.Current, removeClasses, addClasses, trigger); } }
protected async Task HandleExitingAsync(IReference refback) { var styles = new Dictionary <string, object> { { "height", $"{CollapsedHeight}px" }, { "transition-duration", $"{GetExitDuration()}ms" } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnExiting?.Invoke(refback); }
protected override void Dispose() { base.Dispose(); if (!DisablePortal) { if (ChildRef.Current != null) { _ = DomHelpers.RemoveNodeAsync(ChildRef.Current); } } }
protected async Task HandleExitAsync(IReference refback) { var wrappedHeight = await DomHelpers.GetHeightAsync(WrapperRef.Current, true); var styles = new Dictionary <string, object> { { "height", $"{wrappedHeight}px" } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnExit?.Invoke(refback); }
protected async Task HandleEnteringAsync(IReference refback, bool appearing) { var wrappedHeight = await DomHelpers.GetHeightAsync(WrapperRef.Current, true); var styles = new Dictionary <string, object> { { "height", $"{wrappedHeight}px" }, { "transition-duration", $"{GetEnterDuration()}ms" } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnEntering?.Invoke(refback, appearing); }
protected async Task HandleEnterAsync(IReference refback, bool appear) { var transition = GetTransition(GetEnterDuration(), TransitionDelay); var styles = new Dictionary <string, object> { { "opacity", 1 }, { "transition", transition }, { "webkitTransition", transition } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnEnter?.Invoke(refback, appear); }
protected async Task HandleExitedAsync(IReference refback) { // No need for transitions when the component is hidden var transition = string.Empty; var styles = new Dictionary <string, object> { { "transition", transition }, { "webkitTransition", transition } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : false); OnExited?.Invoke(refback); }
protected async Task HandleExitAsync(IReference refback) { var transition = GetTransition(GetExitDuration(), TransitionDelay); var styles = new Dictionary <string, object> { { "opacity", 0 }, { "transform", ToScale(0.75) }, { "transition", transition }, { "webkitTransition", transition } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnExit?.Invoke(refback); }
protected async Task HandleExitAsync(IReference refback) { var transition = CreateTransition("transform", GetExitDuration(), TransitionDelay, TransitionEasing.EasingSharp); var styles = new Dictionary <string, object> { { "transition", transition }, { "webkitTransition", transition } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); await SlideHelper.SetSlideTranslateValueAsync(Placement, refback.Current); OnExit?.Invoke(refback); }
protected async Task HandleEnteringAsync(IReference refback, bool appearing) { var transition = CreateTransition("transform", GetEnterDuration(), TransitionDelay, TransitionEasing.EasingOut); var styles = new Dictionary <string, object> { { "transition", transition }, { "webkitTransition", transition }, { "transform", "none" }, { "webkitTransform", "none" } }; await DomHelpers.SetStyleAsync(refback.Current, styles, trigger : true); OnEntering?.Invoke(refback, appearing); }
public PopoverHelper(IScriptService scriptService, DomHelpers domHelpers) { ScriptService = scriptService; DomHelpers = domHelpers; }
protected override async Task OnAfterUpdateAsync() { await DomHelpers.ScrollTopAsync(ContentRef.Current, 0); }
protected void SetStyle(IReference refback, IDictionary <string, object> styles, bool trigger = false) { _ = DomHelpers.SetStyleAsync(refback.Current, styles, trigger); }
public PopoverHelper(IJSRuntime jsruntime, DomHelpers domHelpers) { JSRuntime = jsruntime; DomHelpers = domHelpers; }