Skip to content

Commit f85e734

Browse files
committed
Initial ready state for Nuget.
Not everything is fully tested, but the basics are. From here on out I will be testing more before publishing the real version
1 parent 7b56baf commit f85e734

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+789
-102
lines changed

Orbyss.Blazor.Syncfusion.JsonForms.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orbyss.Blazor.Syncfusion.Js
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orbyss.Components.JsonForms", "..\Orbyss.Blazor.JsonForms\src\Orbyss.Components.JsonForms.csproj", "{C7648F3D-CDA6-067B-39D8-D71C27993DE5}"
11-
EndProject
1210
Global
1311
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1412
Debug|Any CPU = Debug|Any CPU
@@ -19,10 +17,6 @@ Global
1917
{52C42CB5-BE9B-4C8B-A854-240924A33FD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
2018
{52C42CB5-BE9B-4C8B-A854-240924A33FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
2119
{52C42CB5-BE9B-4C8B-A854-240924A33FD5}.Release|Any CPU.Build.0 = Release|Any CPU
22-
{C7648F3D-CDA6-067B-39D8-D71C27993DE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23-
{C7648F3D-CDA6-067B-39D8-D71C27993DE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
24-
{C7648F3D-CDA6-067B-39D8-D71C27993DE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
25-
{C7648F3D-CDA6-067B-39D8-D71C27993DE5}.Release|Any CPU.Build.0 = Release|Any CPU
2620
EndGlobalSection
2721
GlobalSection(SolutionProperties) = preSolution
2822
HideSolutionNode = FALSE

README.md

Lines changed: 145 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,145 @@
1-
# Orbyss.Components.JsonForms.Syncfusion
2-
.NET class razor Library implementing Orbyss.Components.JsonForms for the Syncfusion Blazor UI Framework
1+
# 📦 Orbyss.Blazor.Syncfusion.JsonForms
2+
3+
**A full-featured Syncfusion-based UI renderer for [Orbyss.Blazor.JsonForms](https://github.com/orbyss-io/Orbyss.Blazor.JsonForms).**
4+
This package brings the power of Syncfusion Blazor components to schema-driven forms using JSON Schema, UI Schema, and Translation Schema.
5+
6+
---
7+
8+
## 🎯 What is this?
9+
10+
This package implements the **`IFormComponentInstanceProvider`** interface for Syncfusion — plugging into the [Orbyss.Blazor.JsonForms](https://github.com/orbyss-io/Orbyss.Blazor.JsonForms) core form engine.
11+
12+
✅ You don’t need to write your own component provider
13+
✅ Just install this NuGet package and use `<JsonForm ... />` as normal
14+
✅ Make sure to either inject `SyncfusionComponentInstanceProvider` in your DI container, or pass a fresh instance as parameter to
15+
`<JsonForm ComponentInstanceProvider=@provider ... >`
16+
17+
---
18+
19+
## 🧱 Components Rendered with Syncfusion
20+
21+
All form controls are implemented using Syncfusion Blazor components:
22+
23+
-`SfTextBox`, `SfDropDownList`, `SfSwitch`, `SfDatePicker`, etc.
24+
- ✅ Supports layout controls like Grid, Columns, Lists, Buttons, and Stepper Navigation
25+
- ✅ Fully compatible with cascading properties: `Language`, `Disabled`, `ReadOnly`
26+
- ✅ Custom UI behavior via `options` in your UI schema
27+
28+
---
29+
30+
## 🚀 Quickstart
31+
32+
```bash
33+
dotnet add package Orbyss.Blazor.Syncfusion.JsonForms
34+
```
35+
36+
Then in Program.cs:
37+
``` csharp
38+
builder.AddSyncfusionJsonForms()
39+
```
40+
41+
Then finally you can define the JsonForm Blazor component as follows:
42+
```csharp
43+
<JsonForm InitOptions=@options ComponentInstanceProvider=... />
44+
45+
@code {
46+
JsonFormContextInitOptions options = new(
47+
jsonSchema,
48+
uiSchema,
49+
translationSchema
50+
);
51+
}
52+
```
53+
---
54+
55+
## ⚙️ Customization
56+
57+
One way to override default behavior is by subclassing or replacing specific Syncfusion components. Example:
58+
59+
```csharp
60+
public class CustomProvider : SyncfusionFormComponentInstanceProvider
61+
{
62+
public override InputFormComponentInstanceBase GetInputField(IJsonFormContext context, FormControlContext control)
63+
{
64+
if (control.JsonPath == "#/properties/mySpecialField")
65+
return new MyCustomInputInstance();
66+
67+
return base.GetInputField(context, control);
68+
}
69+
}
70+
```
71+
72+
Another way is to configure specific delegates in the `SyncfusionFormComponentInstanceProviderOptions`. Example:
73+
```csharp
74+
var instanceProviderOptions = new SyncfusionFormComponentInstanceProviderOptions
75+
{
76+
ConfigureButton = (defaultButton, type, form) =>
77+
{
78+
defaultButton.CanToggle = true;
79+
return defaultButton;
80+
},
81+
ConfigureBooleanInput = (defaultInstance, controlContext) =>
82+
{
83+
var customOption = $"{controlContext.Interpretation.GetOption("custom-boolean")}";
84+
if (customOption == "switch")
85+
{
86+
return new MyCustomSwitchInputInstance();
87+
}
88+
89+
return defaultInstance;
90+
}
91+
};
92+
```
93+
94+
Or of course, you can provide and completely override your own components entirely, injecting the parameters and controlling the behavior as you wish (see the full example in [Orbyss.Blazor.JsonForms README](https://github.com/orbyss-io/Orbyss.Blazor.JsonForms)).
95+
96+
---
97+
98+
## 🔄 Under the hood: Powered by 3 schemas
99+
100+
Like all Orbyss JSON Forms integrations, this renderer works using:
101+
102+
| Schema | Purpose |
103+
|---------------------|-----------------------------------------------------|
104+
| **JSON Schema** | Defines data structure (types, constraints, etc.) |
105+
| **UI Schema** | Controls layout and per-control options |
106+
| **Translation Schema** | Manages localization, labels, error messages |
107+
108+
All schema interactions are fully supported.
109+
110+
---
111+
112+
## 🧩 Other UI Options
113+
114+
Prefer a different component library? Try:
115+
116+
- 🎨 [Orbyss.Blazor.MudBlazor.JsonForms](https://www.nuget.org/packages/Orbyss.Blazor.MudBlazor.JsonForms)
117+
- Or implement your own renderer via `IFormComponentInstanceProvider`
118+
119+
---
120+
121+
## 📄 License
122+
MIT License
123+
© Orbyss.io
124+
125+
---
126+
127+
## 🔗 Links
128+
129+
- 🌍 **Website**: [https://orbyss.io](https://orbyss.io)
130+
- 📦 **Core Engine**: [Orbyss.Blazor.JsonForms](https://www.nuget.org/packages/Orbyss.Blazor.JsonForms)
131+
- 📦 **This Package**: [Orbyss.Blazor.Syncfusion.JsonForms](https://www.nuget.org/packages/Orbyss.Blazor.Syncfusion.JsonForms)
132+
- 🧑‍💻 **GitHub**: [https://github.com/orbyss-io](https://github.com/orbyss-io)
133+
- 📚 **Syncfusion Docs**: [Syncfusion Blazor UI](https://blazor.syncfusion.com/)
134+
- 📝 **License**: [MIT](./LICENSE)
135+
136+
---
137+
138+
## 🤝 Contributing
139+
140+
We're happy to accept contributions, ideas, or improvements.
141+
Fork the repo, create a feature branch, and open a PR — no formal process required.
142+
143+
---
144+
145+
⭐️ Found this useful? [Give us a star](https://github.com/orbyss-io/Orbyss.Blazor.Syncfusion.JsonForms) and help spread the word!

src/ComponentInstances/SyncfusionButtonInstance.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33
using Syncfusion.Blazor.Buttons;
44

@@ -23,11 +23,11 @@ public SyncfusionButtonInstance(string text) : base(text)
2323
protected override IDictionary<string, object?> GetButtonParameters()
2424
{
2525
return new Dictionary<string, object?>
26-
{
26+
{
2727
[nameof(SyncfusionButton.IconClass)] = IconClass,
2828
[nameof(SyncfusionButton.IconPosition)] = IconPosition,
2929
[nameof(SyncfusionButton.CanToggle)] = CanToggle
3030
};
3131
}
3232
}
33-
}
33+
}

src/ComponentInstances/SyncfusionCheckboxInstance.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33
using Syncfusion.Blazor.Buttons;
44

@@ -7,7 +7,7 @@ namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
77
public class SyncfusionCheckboxInstance : InputFormComponentInstance<SyncfusionCheckbox>
88
{
99
public SyncfusionCheckboxInstance() : base(t => (bool?)t)
10-
{
10+
{
1111
}
1212

1313
public bool Clearable { get; set; }
@@ -23,4 +23,4 @@ public SyncfusionCheckboxInstance() : base(t => (bool?)t)
2323
};
2424
}
2525
}
26-
}
26+
}

src/ComponentInstances/SyncfusionDropdownInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33

44
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
@@ -15,4 +15,4 @@ public class SyncfusionDropdownInstance : DropdownFormComponentInstance<Syncfusi
1515
};
1616
}
1717
}
18-
}
18+
}

src/ComponentInstances/SyncfusionDropdownMultiSelectInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33

44
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
@@ -18,4 +18,4 @@ public class SyncfusionDropdownMultiSelectInstance : DropdownFormComponentInstan
1818
};
1919
}
2020
}
21-
}
21+
}

src/ComponentInstances/SyncfusionGridInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33

44
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
@@ -18,4 +18,4 @@ public sealed class SyncfusionGridInstance : FormComponentInstance<SyncfusionGri
1818
};
1919
}
2020
}
21-
}
21+
}

src/ComponentInstances/SyncfusionIntegerInputInstance.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33

44
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
@@ -10,7 +10,7 @@ public SyncfusionIntegerInputInstance() : base(t => (int?)t)
1010
}
1111

1212
public string? Width { get; set; }
13-
13+
1414
public bool Clearable { get; set; }
1515

1616
protected override IDictionary<string, object?> GetFormInputParameters()
@@ -22,4 +22,4 @@ public SyncfusionIntegerInputInstance() : base(t => (int?)t)
2222
};
2323
}
2424
}
25-
}
25+
}

src/ComponentInstances/SyncfusionNumberInputInstance.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Newtonsoft.Json.Linq;
2-
using Orbyss.Components.JsonForms.ComponentInstances;
2+
using Orbyss.Blazor.JsonForms.ComponentInstances;
33
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
4-
using Syncfusion.Blazor.Inputs;
54

65
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
76
{
@@ -15,7 +14,7 @@ public sealed class SyncfusionNumberInputInstance : InputFormComponentInstanceBa
1514

1615
protected override object? ConvertValue(JToken? value)
1716
{
18-
if(double.TryParse($"{value}", Culture, out var doubleValue))
17+
if (double.TryParse($"{value}", Culture, out var doubleValue))
1918
{
2019
return doubleValue;
2120
}
@@ -32,4 +31,4 @@ public sealed class SyncfusionNumberInputInstance : InputFormComponentInstanceBa
3231
};
3332
}
3433
}
35-
}
34+
}

src/ComponentInstances/SyncfusionRowInstance.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Orbyss.Components.JsonForms.ComponentInstances;
1+
using Orbyss.Blazor.JsonForms.ComponentInstances;
22
using Orbyss.Blazor.Syncfusion.JsonForms.Components;
33

44
namespace Orbyss.Blazor.Syncfusion.JsonForms.ComponentInstances
@@ -15,4 +15,4 @@ public sealed class SyncfusionRowInstance : FormComponentInstance<SyncfusionRow>
1515
};
1616
}
1717
}
18-
}
18+
}

0 commit comments

Comments
 (0)