Skip to content

Commit dea5ada

Browse files
committed
Finalizing the first release
1 parent 1832f1e commit dea5ada

15 files changed

+286
-33
lines changed

.github/workflows/publish.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # e.g., v1.2.0
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: '8.0.x'
20+
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
24+
- name: Build solution
25+
run: dotnet build --no-restore --configuration Release
26+
27+
- name: Run unit tests
28+
run: dotnet test ./tests --no-build --configuration Release --verbosity normal
29+
30+
publish:
31+
needs: build-and-test
32+
runs-on: ubuntu-latest
33+
outputs:
34+
version: ${{ steps.set-version.outputs.version }}
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v3
38+
39+
- name: Setup .NET
40+
uses: actions/setup-dotnet@v3
41+
with:
42+
dotnet-version: '8.0.x'
43+
44+
- name: Restore dependencies
45+
run: dotnet restore
46+
47+
- name: Build solution
48+
run: dotnet build --no-restore --configuration Release
49+
50+
- name: Extract version from tag
51+
id: set-version
52+
run: |
53+
VERSION="${GITHUB_REF#refs/tags/v}"
54+
echo "Using version: $VERSION"
55+
echo "version=$VERSION" >> $GITHUB_OUTPUT
56+
57+
- name: Pack NuGet packages
58+
run: |
59+
VERSION=${{ steps.set-version.outputs.version }}
60+
dotnet pack src/${{ github.event.repository.name }}.csproj \
61+
--configuration Release \
62+
--no-build \
63+
--skip-duplicate \
64+
-p:PackageVersion=$VERSION \
65+
-p:IncludeSymbols=true \
66+
-p:SymbolPackageFormat=snupkg
67+
68+
- name: Show packed files
69+
run: ls -lh src/bin/Release
70+
71+
- name: Push NuGet packages
72+
run: |
73+
for pkg in $(find src/bin/Release -name "*.nupkg" ! -name "*.symbols.nupkg" ! -name "*.snupkg"); do
74+
echo "Pushing main package: $pkg"
75+
dotnet nuget push "$pkg" \
76+
--api-key "${{ secrets.NUGET_API_KEY }}" \
77+
--source https://api.nuget.org/v3/index.json
78+
done
79+
80+
for symbols in $(find src/bin/Release -name "*.snupkg"); do
81+
echo "Pushing symbol package: $symbols"
82+
dotnet nuget push "$symbols" \
83+
--api-key "${{ secrets.NUGET_API_KEY }}" \
84+
--source https://api.nuget.org/v3/index.json
85+
done

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Like all Orbyss JSON Forms integrations, this renderer works using:
104104
| Schema | Purpose |
105105
|---------------------|-----------------------------------------------------|
106106
| **JSON Schema** | Defines data structure (types, constraints, etc.) |
107-
| **UI Schema** | Controls layout and per-control options |
107+
| **UI Schema** | Controls layout and per-control options, [rules](https://jsonforms.io/docs/uischema/rules/) |
108108
| **Translation Schema** | Manages localization, labels, error messages |
109109

110110
All schema interactions are fully supported.
@@ -137,11 +137,21 @@ MIT License
137137

138138
---
139139

140+
140141
## 🤝 Contributing
141142

142-
We're happy to accept contributions, ideas, or improvements.
143-
Fork the repo, create a feature branch, and open a PR — no formal process required.
143+
This project is open source and contributions are welcome!
144+
145+
Whether it's bug fixes, improvements, documentation, or ideas — we encourage developers to get involved.
146+
Just fork the repo, create a branch, and open a pull request.
147+
148+
We follow standard .NET open-source conventions:
149+
- Write clean, readable code
150+
- Keep PRs focused and descriptive
151+
- Open issues for larger features or discussions
152+
153+
No formal contribution guidelines — just be constructive and respectful.
144154

145155
---
146156

147-
⭐️ Found this useful? [Give us a star](https://github.com/orbyss-io/Orbyss.Blazor.Syncfusion.JsonForms) and help spread the word!
157+
⭐️ Found this useful? [Give us a star](https://github.com/orbyss-io/Orbyss.Blazor.Syncfusion.JsonForms/stargazers) and help spread the word!

src/ComponentInstances/SyncfusionStepperInstance.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Orbyss.Blazor.JsonForms.ComponentInstances;
2-
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
2+
using Orbyss.SyncFusion.Blazor.JsonForms.Components;
33
using Syncfusion.Blazor.Navigations;
44

55
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances

src/Components/SyncfusionButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
IconPosition="@IconPosition"
66
IsToggle=@CanToggle
77
Disabled=@Disabled
8-
OnClick="OnClicked" />
8+
OnClick="@Click" />

src/Components/SyncfusionButton.razor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.AspNetCore.Components;
2+
using Microsoft.AspNetCore.Components.Web;
23
using Syncfusion.Blazor.Buttons;
34

45
namespace Orbyss.Blazor.Syncfusion.JsonForms.Components
@@ -29,6 +30,11 @@ public partial class SyncfusionButton
2930
[Parameter]
3031
public EventCallback OnClicked { get; set; }
3132

33+
private Task Click(MouseEventArgs args)
34+
{
35+
return OnClicked.InvokeAsync();
36+
}
37+
3238
private readonly Dictionary<string, object> customAttributes = [];
3339

3440
protected override void OnInitialized()

src/Components/SyncfusionDatePicker.razor.cs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class SyncfusionDatePicker<TDate>
1414
public bool AllowManualInput { get; set; }
1515

1616
[Parameter]
17-
public TDate? Value { get; set; }
17+
public TDate Value { get; set; } = default!;
1818

1919
[Parameter]
2020
public DateTime? MinimumDate { get; set; }
@@ -32,13 +32,13 @@ public partial class SyncfusionDatePicker<TDate>
3232
public string? HelperText { get; set; }
3333

3434
[Parameter]
35-
public EventCallback<TDate?> OnValueChanged { get; set; }
35+
public EventCallback<TDate> OnValueChanged { get; set; }
3636

3737
[Parameter]
38-
public Func<DateTime?, TDate?>? ConvertToDateTime { get; set; }
38+
public Func<DateTime?, TDate>? ConvertFromDateTime { get; set; }
3939

4040
[Parameter]
41-
public Func<TDate?, DateTime?>? ConvertFromDateTime { get; set; }
41+
public Func<TDate, DateTime?>? ConvertToDateTime { get; set; }
4242

4343
private Task OnChanged(DateTime? value)
4444
{
@@ -52,20 +52,25 @@ private Task OnChanged(DateTime? value)
5252
return OnValueChanged.InvokeAsync(default);
5353
}
5454

55-
return OnValueChanged.InvokeAsync(
56-
ConvertToDateTime(value)
57-
);
55+
if (ConvertFromDateTime is not null)
56+
{
57+
return OnValueChanged.InvokeAsync(
58+
ConvertFromDateTime.Invoke(value)
59+
);
60+
}
61+
62+
return Task.CompletedTask;
5863
}
5964

6065
protected override void OnParametersSet()
6166
{
62-
if (ConvertFromDateTime is null)
67+
if (ConvertToDateTime is null)
6368
{
6469
value = null;
6570
}
6671
else
6772
{
68-
value = ConvertFromDateTime(Value);
73+
value = ConvertToDateTime(Value);
6974
}
7075
}
7176
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@using Orbyss.Blazor.JsonForms.Constants
2+
@inherits SyncfusionFormComponentBase
3+
@typeparam TDate
4+
5+
<SfDateTimePicker ID="@id"
6+
Value=@value
7+
TValue="DateTime?"
8+
AllowEdit=true
9+
CssClass="@FullClass"
10+
ValueChanged="ValueChangedHandler"
11+
Placeholder="@Label"
12+
ShowClearButton=true
13+
Readonly=@ReadOnly
14+
Step=@(TimeStep ?? 15)
15+
Enabled=@(!Disabled)
16+
FloatLabelType="FloatLabelType.Always"
17+
OnChange="OnManualInputChanged"
18+
Min="@(MinimumDate ?? DateTime.MinValue)"
19+
Max="@(MaximumDate ?? DateTime.MaxValue)"
20+
MinTime="@(MinimumTime ?? DateTime.MinValue)"
21+
MaxTime="@(MaximumTime ?? DateTime.MaxValue)" />
22+
23+
@if (HasError)
24+
{
25+
<div class="e-error validation-message">@ErrorHelperText</div>
26+
}
27+
else if (!string.IsNullOrWhiteSpace(HelperText))
28+
{
29+
<div class="validation-message "><i>@HelperText</i></div>
30+
}
31+
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
using Microsoft.AspNetCore.Components;
2+
using Orbyss.Blazor.JsonForms.Constants;
3+
4+
namespace Orbyss.Blazor.Syncfusion.JsonForms.Components
5+
{
6+
public partial class SyncfusionDateTimePicker<TDate>
7+
{
8+
private readonly string id = $"{Guid.NewGuid()}";
9+
private DateTime? value;
10+
11+
[Parameter]
12+
public string? Label { get; set; }
13+
14+
[Parameter]
15+
public bool AllowManualInput { get; set; }
16+
17+
[Parameter]
18+
public TDate Value { get; set; } = default!;
19+
20+
[Parameter]
21+
public DateTime? MinimumDate { get; set; }
22+
23+
[Parameter]
24+
public DateTime? MaximumDate { get; set; }
25+
26+
[Parameter]
27+
public DateTime? MinimumTime { get; set; }
28+
29+
[Parameter]
30+
public DateTime? MaximumTime { get; set; }
31+
32+
[Parameter]
33+
public int? TimeStep { get; set; }
34+
35+
[Parameter]
36+
public bool ReadOnly { get; set; }
37+
38+
[Parameter]
39+
public bool Disabled { get; set; }
40+
41+
[Parameter]
42+
public string? HelperText { get; set; }
43+
44+
[Parameter]
45+
public EventCallback<TDate> OnValueChanged { get; set; }
46+
47+
[Parameter]
48+
public Func<DateTime?, TDate>? ConvertFromDateTime { get; set; }
49+
50+
[Parameter]
51+
public Func<TDate, DateTime?>? ConvertToDateTime { get; set; }
52+
53+
private Task OnManualInputChanged(ChangeEventArgs args)
54+
{
55+
if (!AllowManualInput)
56+
{
57+
return Task.CompletedTask;
58+
}
59+
60+
var value = $"{args.Value}";
61+
if (DateTime.TryParse(value, FormCulture.Instance, out var result))
62+
{
63+
return ValueChangedHandler(result);
64+
}
65+
66+
return ValueChangedHandler(null);
67+
}
68+
69+
private Task ValueChangedHandler(DateTime? value)
70+
{
71+
if (this.value.HasValue)
72+
{
73+
this.value = value;
74+
}
75+
76+
if (!value.HasValue || ConvertToDateTime is null)
77+
{
78+
return OnValueChanged.InvokeAsync(default);
79+
}
80+
81+
if (ConvertFromDateTime is not null)
82+
{
83+
return OnValueChanged.InvokeAsync(
84+
ConvertFromDateTime.Invoke(value)
85+
);
86+
}
87+
88+
return Task.CompletedTask;
89+
}
90+
91+
protected override void OnParametersSet()
92+
{
93+
if (ConvertToDateTime is null)
94+
{
95+
value = null;
96+
}
97+
else
98+
{
99+
value = ConvertToDateTime(Value);
100+
}
101+
}
102+
}
103+
}

src/Components/SyncfusionStepper.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@inherits FormComponentBase
22

3+
@namespace Orbyss.SyncFusion.Blazor.JsonForms.Components
4+
35
@if (context is not null)
46
{
5-
<SfStepper StepChanging="@HandleStepChanging" Linear=false Orientation="@Orientation" LabelPosition="@LabelPosition">
7+
<SfStepper @ref=stepper StepChanging="@HandleStepChanging" Linear=false Orientation="@Orientation" LabelPosition="@LabelPosition">
68
<StepperSteps>
79
@if (lastStep > 0)
810
{

src/Extensions/BootstrapExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ public static IServiceCollection AddSyncfusionJsonForms<TFormComponentInstancePr
2222
.AddSingleton<IFormComponentInstanceProvider, TFormComponentInstanceProvider>();
2323
}
2424
}
25-
}
25+
}

0 commit comments

Comments
 (0)