File tree Expand file tree Collapse file tree 3 files changed +36
-8
lines changed
JoinRpg.Web.ProjectCommon/Projects Expand file tree Collapse file tree 3 files changed +36
-8
lines changed Original file line number Diff line number Diff line change 3434<JoinPanel >
3535 <Header >Создание новой базы заявок</Header >
3636 <Body >
37- <EditForm FormName =" CreateProject" EditContext =" @editContext" method = " post " action = " /game/create " OnValidSubmit =" HandleValidSubmit" >
37+ <EditForm FormName =" CreateProject" EditContext =" @editContext" OnValidSubmit =" HandleValidSubmit" >
3838 <FormHorizontal >
3939 <ValidationSummary />
4040 <DataAnnotationsValidator />
4141 <FormRowFor For =" @(() => Model.ProjectName)" >
42- <InputText @bind-Value =" Model.ProjectName" class = " form-control " />
42+ <JoinTextInput @bind-Value =" Model.ProjectName" />
4343 </FormRowFor >
4444 <FormRowFor For =" @(() => Model.RulesApproved)" >
4545 <CheckboxInput @bind-Value =" Model.RulesApproved" />
4949 <JoinAlert Variation =" VariationStyleEnum.Info" >Все настройки можно будет изменить после создания проекта.</JoinAlert >
5050 </FormRowFor >
5151 <FormRowFor For =" @(() => Model.CopyFromProjectId)" hidden =" @(Model.ProjectType != ProjectTypeViewModel.CopyFromAnother)" >
52- <ProjectSelector @bind-ProjectId =" Model.CopyFromProjectId" Name = " CopyFromProjectId " />
52+ <ProjectSelector @bind-ProjectId =" Model.CopyFromProjectId" />
5353 </FormRowFor >
5454 <FormRow >
5555 <JoinCreateButton Submit =" true" Disabled =" @formInvalid" />
Original file line number Diff line number Diff line change 2626 <None Update =" libman.json" />
2727 </ItemGroup >
2828
29- <ItemGroup >
30- <UpToDateCheckInput Remove =" HelpLink.razor" />
31- <_ContentIncludedByDefault Remove =" HelpLink.razor" />
32- </ItemGroup >
33-
3429</Project >
Original file line number Diff line number Diff line change 1+ @using System .Linq .Expressions
2+ <input type =" text" name =" @FieldIdentifier.FieldName" value =" @internalValue" @onchange =" UpdateValue" class =" form-control" />
3+
4+ @code {
5+ [CascadingParameter ]
6+ private EditContext ? EditContext { get ;set ;}
7+
8+ [Parameter ]
9+ public string Value { get ; set ; }
10+
11+ [Parameter ]
12+ public EventCallback <string > ValueChanged { get ; set ; }
13+
14+ [Parameter ]
15+ public Expression <Func <string >> ValueExpression { get ; set ; } = default ! ;
16+
17+ private FieldIdentifier FieldIdentifier { get ; set ; }
18+
19+ private string internalValue = " " ;
20+
21+ protected override void OnInitialized ()
22+ {
23+ internalValue = Value ;
24+ FieldIdentifier = FieldIdentifier .Create (ValueExpression );
25+ }
26+
27+ private async Task UpdateValue (ChangeEventArgs eventArgs )
28+ {
29+ internalValue = (string ?) eventArgs .Value ?? " " ;
30+ await ValueChanged .InvokeAsync (internalValue );
31+ EditContext ? .NotifyFieldChanged (FieldIdentifier );
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments