Exemplo n.º 1
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            // Let blazor do its thing!
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(DateExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <TValue>(nameof(Date), out var inDate)
                        ? inDate
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var replaceTabChanged = parameters.TryGetValue(nameof(ReplaceTab), out bool paramReplaceTab) && ReplaceTab != paramReplaceTab;
            var tabSizeChanged    = parameters.TryGetValue(nameof(TabSize), out int paramTabSize) && TabSize != paramTabSize;
            var softTabsChanged   = parameters.TryGetValue(nameof(SoftTabs), out bool paramSoftTabs) && SoftTabs != paramSoftTabs;
            var autoSizeChanged   = parameters.TryGetValue(nameof(AutoSize), out bool paramAutoSize) && AutoSize != paramAutoSize;

            if (Rendered && (replaceTabChanged ||
                             tabSizeChanged ||
                             softTabsChanged ||
                             autoSizeChanged))
            {
                ExecuteAfterRender(async() => await JSModule.UpdateOptions(ElementRef, ElementId, new
                {
                    ReplaceTab = new { Changed = replaceTabChanged, Value = paramReplaceTab },
                    TabSize    = new { Changed = tabSizeChanged, Value = paramTabSize },
                    SoftTabs   = new { Changed = softTabsChanged, Value = paramSoftTabs },
                    AutoSize   = new { Changed = autoSizeChanged, Value = paramAutoSize },
                }));
            }

            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <string> > >(nameof(TextExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Notifies the component that file input value has changed.
        /// </summary>
        /// <param name="files">List of changed file(s).</param>
        /// <returns>A task that represents the asynchronous operation.</returns>
        public async Task NotifyChange(FileEntry[] files)
        {
            // Unlike in other Edit components we cannot just call CurrentValueHandler since
            // we're dealing with complex types instead of a simple string as en element value.
            //
            // Because of that we're going to skip CurrentValueHandler and implement all the
            // update logic here.

            foreach (var file in files)
            {
                // So that method invocations on the file can be dispatched back here
                file.Owner = (IFileEntryOwner)(object)this;
            }

            InternalValue = files;

            // send the value to the validation for processing
            if (ParentValidation != null)
            {
                await ParentValidation.NotifyInputChanged <IFileEntry[]>(files);
            }

            await Changed.InvokeAsync(new(files) );

            await InvokeAsync(StateHasChanged);
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var decimalsChanged = parameters.TryGetValue(nameof(Decimals), out int decimals) && !Decimals.IsEqual(decimals);

            if (Rendered && decimalsChanged)
            {
                ExecuteAfterRender(async() => await JSRunner.UpdateNumericEdit(ElementRef, ElementId, new
                {
                    Decimals = new { Changed = decimalsChanged, Value = decimals },
                }));
            }

            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(ValueExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <TValue>(nameof(Value), out var inValue)
                        ? inValue
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 5
0
        protected async Task HandleOnChanged(UIChangeEventArgs e)
        {
            if (IsMultiple)
            {
                // when multiple selection is enabled we need to use javascript to get the list of selected items
                internalMultiValue = await JSRunner.GetSelectedOptions <TValue>(ElementId);

                // changed event must be called before validation
                await SelectedValuesChanged.InvokeAsync(internalMultiValue);

                ParentValidation?.UpdateInputValue(internalMultiValue);
            }
            else
            {
                if (Converters.TryChangeType <TValue>(e.Value, out var value))
                {
                    internalValue = value;
                }
                else
                {
                    internalValue = default;
                }

                // changed event must be called before validation
                await SelectedValueChanged.InvokeAsync(internalValue);

                ParentValidation?.UpdateInputValue(internalValue);
            }
        }
Exemplo n.º 6
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            try
            {
                skipCheckedValueChangedCallback = true;

                if (parameters.TryGetValue <TValue>(nameof(CheckedValue), out var result))
                {
                    await CurrentValueHandler(result?.ToString());
                }

                await base.SetParametersAsync(parameters);

                if (ParentValidation != null)
                {
                    if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(CheckedValueExpression), out var expression))
                    {
                        ParentValidation.InitializeInputExpression(expression);
                    }

                    InitializeValidation();
                }
            }
            finally
            {
                skipCheckedValueChangedCallback = false;
            }
        }
Exemplo n.º 7
0
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            if (Multiple && parameters.TryGetValue <IReadOnlyList <TValue> >(nameof(SelectedValues), out var selectedValues))
            {
                // For Multiple mode we need to update select options DOM through the javascript or otherwise
                // the newly selected values would not be re-rendered and not visible on the UI.
                ExecuteAfterRender(async() => await JSRunner.SetSelectedOptions(ElementId, selectedValues));
            }

            if (ParentValidation != null)
            {
                if (Multiple)
                {
                    if (parameters.TryGetValue <Expression <Func <IReadOnlyList <TValue> > > >(nameof(SelectedValuesExpression), out var expression))
                    {
                        await ParentValidation.InitializeInputExpression(expression);
                    }
                }
                else
                {
                    if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(SelectedValueExpression), out var expression))
                    {
                        await ParentValidation.InitializeInputExpression(expression);
                    }
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 8
0
        protected override void OnInitialized()
        {
            if (ParentValidation != null)
            {
                ParentValidation.InitInputPattern(Pattern);
            }

            base.OnInitialized();
        }
Exemplo n.º 9
0
        protected override void OnInitialized()
        {
            if (ParentValidation != null)
            {
                ParentValidation.InitializeInputExpression(TimeExpression);
            }

            base.OnInitialized();
        }
Exemplo n.º 10
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var dateChanged           = parameters.TryGetValue <TValue>(nameof(Date), out var date) && !Date.Equals(date);
            var minChanged            = parameters.TryGetValue(nameof(Min), out DateTimeOffset? min) && !Min.IsEqual(min);
            var maxChanged            = parameters.TryGetValue(nameof(Max), out DateTimeOffset? max) && !Max.IsEqual(max);
            var firstDayOfWeekChanged = parameters.TryGetValue(nameof(FirstDayOfWeek), out DayOfWeek firstDayOfWeek) && !FirstDayOfWeek.IsEqual(firstDayOfWeek);
            var displayFormatChanged  = parameters.TryGetValue(nameof(DisplayFormat), out string displayFormat) && DisplayFormat != displayFormat;
            var timeAs24hrChanged     = parameters.TryGetValue(nameof(TimeAs24hr), out bool timeAs24hr) && TimeAs24hr != timeAs24hr;

            if (dateChanged)
            {
                var dateString = FormatValueAsString(date);

                await CurrentValueHandler(dateString);

                if (Rendered)
                {
                    ExecuteAfterRender(async() => await JSRunner.UpdateDatePickerValue(ElementRef, ElementId, dateString));
                }
            }

            if (Rendered && (minChanged || maxChanged || firstDayOfWeekChanged || displayFormatChanged || timeAs24hrChanged))
            {
                ExecuteAfterRender(async() => await JSRunner.UpdateDatePickerOptions(ElementRef, ElementId, new
                {
                    FirstDayOfWeek = new { Changed = firstDayOfWeekChanged, Value = firstDayOfWeek },
                    DisplayFormat  = new { Changed = displayFormatChanged, Value = DateTimeFormatConverter.Convert(displayFormat) },
                    TimeAs24hr     = new { Changed = timeAs24hrChanged, Value = timeAs24hr },
                    Min            = new { Changed = minChanged, Value = min?.ToString(DateFormat) },
                    Max            = new { Changed = maxChanged, Value = max?.ToString(DateFormat) },
                }));
            }

            // Let blazor do its thing!
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(DateExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <TValue>(nameof(Date), out var inDate)
                        ? inDate
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 11
0
        protected override Task OnInternalValueChanged(MesContableEditDto value)
        {
            if (InternalValue != null && ParentValidation != null)
            {
                ParentValidation.Validate();
                StateHasChanged();
            }

            return(ValueChanged.InvokeAsync(InternalValue));
        }
Exemplo n.º 12
0
        protected override void OnInitialized()
        {
            // link to the parent component
            if (ParentValidation != null)
            {
                ParentValidation.InitializeInput(this);

                ParentValidation.ValidationStatusChanged += OnValidationStatusChanged;
            }

            base.OnInitialized();
        }
        protected override void OnInitialized()
        {
            // link to the parent component
            if (ParentValidation != null)
            {
                ParentValidation.InitInputValue(internalValue);

                ParentValidation.Validated += OnValidated;
            }

            base.OnInitialized();
        }
Exemplo n.º 14
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var timeChanged = parameters.TryGetValue(nameof(Time), out TValue time) && !Time.IsEqual(time);
            var minChanged  = parameters.TryGetValue(nameof(Min), out TimeSpan? min) && !Min.IsEqual(min);
            var maxChanged  = parameters.TryGetValue(nameof(Max), out TimeSpan? max) && !Max.IsEqual(max);

            if (timeChanged)
            {
                var timeString = FormatValueAsString(time);

                await CurrentValueHandler(timeString);

                if (Rendered)
                {
                    ExecuteAfterRender(async() => await JSRunner.UpdateTimePickerValue(ElementRef, ElementId, timeString));
                }
            }

            if (Rendered && (minChanged || maxChanged))
            {
                ExecuteAfterRender(async() => await JSRunner.UpdateTimePickerOptions(ElementRef, ElementId, new
                {
                    Min = new { Changed = minChanged, Value = min?.ToString(Parsers.InternalTimeFormat) },
                    Max = new { Changed = maxChanged, Value = max?.ToString(Parsers.InternalTimeFormat) },
                }));
            }

            // Let blazor do its thing!
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(TimeExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <TValue>(nameof(Time), out var inTime)
                        ? inTime
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 15
0
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <string> > >(nameof(ColorExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initializes input component for validation.
        /// </summary>
        protected async Task InitializeValidation()
        {
            if (validationInitialized)
            {
                return;
            }

            // link to the parent component
            await ParentValidation.InitializeInput(this);

            ParentValidation.ValidationStatusChanged += OnValidationStatusChanged;

            validationInitialized = true;
        }
Exemplo n.º 17
0
        protected override void OnInit()
        {
            // link to the parent component
            ParentField?.Hook(this);

            if (ParentValidation != null)
            {
                ParentValidation.InitInputValue(internalValue);

                ParentValidation.Validated += OnValidated;
            }

            base.OnInit();
        }
Exemplo n.º 18
0
        protected override void OnInitialized()
        {
            if (IsDelayTextOnKeyPress)
            {
                inputValueDelayer          = new ValueDelayer(DelayTextOnKeyPressIntervalValue);
                inputValueDelayer.Delayed += OnInputValueDelayed;
            }

            if (ParentValidation != null)
            {
                ParentValidation.InitializeInputPattern(Pattern);
            }

            base.OnInitialized();
        }
Exemplo n.º 19
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            // Individual Radio can have validation ONLY of it's not placed inside
            // of a RadioGroup
            if (ParentValidation != null && ParentRadioGroup == null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(CheckedExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 20
0
        protected override void OnInitialized()
        {
            if (ParentValidation != null)
            {
                if (Multiple)
                {
                    ParentValidation.InitializeInputExpression(SelectedValuesExpression);
                }
                else
                {
                    ParentValidation.InitializeInputExpression(SelectedValueExpression);
                }
            }

            base.OnInitialized();
        }
Exemplo n.º 21
0
        protected override void OnInitialized()
        {
            if (ParentValidation != null)
            {
                if (CheckedExpression != null)
                {
                    ParentValidation.InitializeInputExpression(CheckedExpression);
                }
                else if (NullableCheckedExpression != null)
                {
                    ParentValidation.InitializeInputExpression(NullableCheckedExpression);
                }
            }

            base.OnInitialized();
        }
Exemplo n.º 22
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var colorChanged                  = parameters.TryGetValue <string>(nameof(Color), out var color) && !Color.IsEqual(color);
            var paletteChanged                = parameters.TryGetValue(nameof(Palette), out string[] palette) && !Palette.AreEqual(palette);
            var showPaletteChanged            = parameters.TryGetValue(nameof(ShowPalette), out bool showPalette) && ShowPalette != showPalette;
            var hideAfterPaletteSelectChanged = parameters.TryGetValue(nameof(HideAfterPaletteSelect), out bool hideAfterPaletteSelect) && HideAfterPaletteSelect != hideAfterPaletteSelect;
            var disabledChanged               = parameters.TryGetValue(nameof(Disabled), out bool disabled) && Disabled != disabled;
            var readOnlyChanged               = parameters.TryGetValue(nameof(ReadOnly), out bool readOnly) && ReadOnly != readOnly;

            if (colorChanged)
            {
                await CurrentValueHandler(color);

                if (Rendered)
                {
                    ExecuteAfterRender(async() => await JSModule.UpdateValue(ElementRef, ElementId, color));
                }
            }

            if (Rendered && (paletteChanged ||
                             showPaletteChanged ||
                             hideAfterPaletteSelectChanged ||
                             disabledChanged ||
                             readOnlyChanged))
            {
                ExecuteAfterRender(async() => await JSModule.UpdateOptions(ElementRef, ElementId, new
                {
                    Palette                = new { Changed = paletteChanged, Value = palette },
                    ShowPalette            = new { Changed = showPaletteChanged, Value = showPalette },
                    HideAfterPaletteSelect = new { Changed = hideAfterPaletteSelectChanged, Value = hideAfterPaletteSelect },
                    Disabled               = new { Changed = disabledChanged, Value = disabled },
                    ReadOnly               = new { Changed = readOnlyChanged, Value = readOnly },
                }));
            }

            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <string> > >(nameof(ColorExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 23
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            if (parameters.TryGetValue <TValue>(nameof(CheckedValue), out var result) && !CheckedValue.IsEqual(result))
            {
                await CurrentValueHandler(result?.ToString());
            }

            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(CheckedValueExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 24
0
        public Task NotifyChange(FileEntry[] files)
        {
            // Unlike in other Edit components we cannot just call CurrentValueHandler since
            // we're dealing with complex types instead of a simple string as en element value.
            //
            // Because of that we're going to skip CurrentValueHandler and implement all the
            // update logic here.

            foreach (var file in files)
            {
                // So that method invocations on the file can be dispatched back here
                file.Owner = (FileEdit)(object)this;
            }

            InternalValue = files;

            // send the value to the validation for processing
            ParentValidation?.NotifyInputChanged();

            return(Changed.InvokeAsync(new FileChangedEventArgs(files)));
        }
Exemplo n.º 25
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var decimalsChanged = parameters.TryGetValue(nameof(Decimals), out int decimals) && !Decimals.IsEqual(decimals);

            if (Rendered && decimalsChanged)
            {
                ExecuteAfterRender(async() => await JSRunner.UpdateNumericEdit(ElementRef, ElementId, new
                {
                    Decimals = new { Changed = decimalsChanged, Value = decimals },
                }));
            }

            // This make sure we know that Min or Max parameters are defined and can be checked against the current value.
            // Without we cannot determine if Min or Max has a default value when TValue is non-nullable type.
            MinDefined = parameters.TryGetValue <TValue>(nameof(Min), out var min);
            MaxDefined = parameters.TryGetValue <TValue>(nameof(Max), out var max);

            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(ValueExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <TValue>(nameof(Value), out var inValue)
                        ? inValue
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Handles the parsing of an input value.
        /// </summary>
        /// <param name="value">Input value to be parsed.</param>
        /// <returns>Returns the awaitable task.</returns>
        protected async Task CurrentValueHandler(string value)
        {
            var empty = false;

            if (string.IsNullOrEmpty(value))
            {
                empty        = true;
                CurrentValue = default;
            }

            if (!empty)
            {
                var result = await ParseValueFromStringAsync(value);

                if (result.Success)
                {
                    CurrentValue = result.ParsedValue;
                }
            }

            // send the value to the validation for processing
            ParentValidation?.NotifyInputChanged();
        }
Exemplo n.º 27
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <string> > >(nameof(TextExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <string>(nameof(Text), out var paramText)
                        ? paramText
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }
Exemplo n.º 28
0
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (Multiple)
                {
                    if (parameters.TryGetValue <Expression <Func <IReadOnlyList <TValue> > > >(nameof(SelectedValuesExpression), out var expression))
                    {
                        ParentValidation.InitializeInputExpression(expression);
                    }
                }
                else
                {
                    if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(SelectedValueExpression), out var expression))
                    {
                        ParentValidation.InitializeInputExpression(expression);
                    }
                }

                InitializeValidation();
            }
        }
Exemplo n.º 29
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(CheckedExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                await InitializeValidation();
            }

            if (parameters.TryGetValue <bool?>(nameof(Indeterminate), out var indeterminate) && this.indeterminate != indeterminate)
            {
                this.indeterminate = indeterminate;

                ExecuteAfterRender(async() =>
                {
                    await JSUtilitiesModule.SetProperty(ElementRef, "indeterminate", indeterminate);
                });
            }
        }
Exemplo n.º 30
0
        /// <inheritdoc/>
        public override async Task SetParametersAsync(ParameterView parameters)
        {
            var timeChanged          = parameters.TryGetValue(nameof(Time), out TValue time) && !Time.IsEqual(time);
            var minChanged           = parameters.TryGetValue(nameof(Min), out TimeSpan? min) && !Min.IsEqual(min);
            var maxChanged           = parameters.TryGetValue(nameof(Max), out TimeSpan? max) && !Max.IsEqual(max);
            var displayFormatChanged = parameters.TryGetValue(nameof(DisplayFormat), out string displayFormat) && DisplayFormat != displayFormat;
            var timeAs24hrChanged    = parameters.TryGetValue(nameof(TimeAs24hr), out bool timeAs24hr) && TimeAs24hr != timeAs24hr;
            var disabledChanged      = parameters.TryGetValue(nameof(Disabled), out bool disabled) && Disabled != disabled;
            var readOnlyChanged      = parameters.TryGetValue(nameof(ReadOnly), out bool readOnly) && ReadOnly != readOnly;

            if (timeChanged)
            {
                var timeString = FormatValueAsString(time);

                await CurrentValueHandler(timeString);

                if (Rendered)
                {
                    ExecuteAfterRender(async() => await JSModule.UpdateValue(ElementRef, ElementId, timeString));
                }
            }

            if (Rendered && (minChanged ||
                             maxChanged ||
                             displayFormatChanged ||
                             timeAs24hrChanged ||
                             disabledChanged ||
                             readOnlyChanged))
            {
                ExecuteAfterRender(async() => await JSModule.UpdateOptions(ElementRef, ElementId, new
                {
                    DisplayFormat = new { Changed = displayFormatChanged, Value = DateTimeFormatConverter.Convert(displayFormat) },
                    TimeAs24hr    = new { Changed = timeAs24hrChanged, Value = timeAs24hr },
                    Min           = new { Changed = minChanged, Value = min?.ToString(Parsers.InternalTimeFormat) },
                    Max           = new { Changed = maxChanged, Value = max?.ToString(Parsers.InternalTimeFormat) },
                    Disabled      = new { Changed = disabledChanged, Value = disabled },
                    ReadOnly      = new { Changed = readOnlyChanged, Value = readOnly },
                }));
            }

            // Let blazor do its thing!
            await base.SetParametersAsync(parameters);

            if (ParentValidation != null)
            {
                if (parameters.TryGetValue <Expression <Func <TValue> > >(nameof(TimeExpression), out var expression))
                {
                    await ParentValidation.InitializeInputExpression(expression);
                }

                if (parameters.TryGetValue <string>(nameof(Pattern), out var pattern))
                {
                    // make sure we get the newest value
                    var value = parameters.TryGetValue <TValue>(nameof(Time), out var inTime)
                        ? inTime
                        : InternalValue;

                    await ParentValidation.InitializeInputPattern(pattern, value);
                }

                await InitializeValidation();
            }
        }