Skip to content

Commit 2507fc8

Browse files
authored
feat(blazorui): add PdfReader component bitfoundation#8991 (bitfoundation#9078)
1 parent 8cbc4d0 commit 2507fc8

File tree

68 files changed

+5855
-39
lines changed

Some content is hidden

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

68 files changed

+5855
-39
lines changed

.github/workflows/bit.ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Run BeforeBuildTasks
3838
continue-on-error: true # Error MSB4057, not all csproj files have BeforeBuildTasks target.
39-
run: dotnet build src/Bit-CI-release.sln -t:BeforeBuildTasks -m:1
39+
run: dotnet build src/Bit-CI-release.sln -t:BeforeBuildTasks -m:1 -f net8.0
4040

4141
- name: MSBuild prerelease
4242
run: dotnet build src/Bit-CI-release.sln
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Run BeforeBuildTasks
8080
continue-on-error: true # Error MSB4057, not all csproj files have BeforeBuildTasks target.
81-
run: dotnet build src/Bit-CI.sln -t:BeforeBuildTasks -m:1
81+
run: dotnet build src/Bit-CI.sln -t:BeforeBuildTasks -m:1 -f net8.0
8282

8383
- name: Build
8484
run: dotnet build src/Bit-CI.sln -p:WarningLevel=0 -p:RunCodeAnalysis=false

.github/workflows/bit.full.ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
175175
- name: Run BeforeBuildTasks
176176
continue-on-error: true # Error MSB4057, not all csproj files have BeforeBuildTasks target.
177-
run: dotnet build src/Bit-CI-release.sln -t:BeforeBuildTasks -m:1
177+
run: dotnet build src/Bit-CI-release.sln -t:BeforeBuildTasks -m:1 -f net8.0
178178

179179
- name: Release build bit blazor ui + butil + bswup + besql + bup + code analyzers + source generators
180180
run: dotnet build src/Bit-CI-release.sln -c Release

src/BlazorUI/Bit.BlazorUI.Extras/Bit.BlazorUI.Extras.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
</ItemGroup>
5959

6060
<Target Name="BeforeBuildTasks" AfterTargets="CoreCompile" Condition="'$(TargetFramework)' == 'net8.0'">
61-
<CallTarget Targets="InstallNodejsDependencies"/>
62-
<CallTarget Targets="BuildJavaScript"/>
63-
<CallTarget Targets="BuildCss"/>
61+
<CallTarget Targets="InstallNodejsDependencies" />
62+
<CallTarget Targets="BuildJavaScript" />
63+
<CallTarget Targets="BuildCss" />
6464
</Target>
6565

6666
<Target Name="InstallNodejsDependencies" Inputs="package.json" Outputs="node_modules\.package-lock.json">

src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/BitChart.razor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
122122
scripts.AddRange(DateAdapterScripts);
123123
}
124124

125-
await _js.InitChartJs(scripts);
125+
await _js.BitChartJsInitChartJs(scripts);
126126

127-
await _js.SetupChart(Config);
127+
await _js.BitChartJsSetupChart(Config);
128128

129129
await SetupCompletedCallback.InvokeAsync(this);
130130
}
131131
else
132132
{
133-
await _js.SetupChart(Config);
133+
await _js.BitChartJsSetupChart(Config);
134134
}
135135
}
136136

@@ -142,7 +142,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
142142
/// </summary>
143143
public Task Update()
144144
{
145-
return _js.UpdateChart(Config).AsTask();
145+
return _js.BitChartJsUpdateChart(Config).AsTask();
146146
}
147147

148148
public async ValueTask DisposeAsync()
@@ -158,7 +158,7 @@ protected virtual async ValueTask DisposeAsync(bool disposing)
158158

159159
try
160160
{
161-
await _js.RemoveChart(Config?.CanvasId);
161+
await _js.BitChartJsRemoveChart(Config?.CanvasId);
162162
}
163163
catch (JSDisconnectedException) { } // we can ignore this exception here
164164
}

src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/Interop/BitChartJsInterop.cs renamed to src/BlazorUI/Bit.BlazorUI.Extras/Components/Chart/JsInterop/BitChartJsInterop.cs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ internal static class BitChartJsInterop
2020
Converters = { new IsoDateTimeConverter() }
2121
};
2222

23-
public static ValueTask InitChartJs(this IJSRuntime jsRuntime, IEnumerable<string> scripts)
23+
public static ValueTask BitChartJsInitChartJs(this IJSRuntime jsRuntime, IEnumerable<string> scripts)
2424
{
2525
return jsRuntime.InvokeVoidAsync("BitBlazorUI.BitChart.initChartJs", scripts);
2626
}
2727

28-
public static ValueTask RemoveChart(this IJSRuntime jsRuntime, string canvasId)
28+
public static ValueTask BitChartJsRemoveChart(this IJSRuntime jsRuntime, string canvasId)
2929
{
3030
return jsRuntime.InvokeVoidAsync("BitBlazorUI.BitChart.removeChart", canvasId);
3131
}
@@ -36,13 +36,28 @@ public static ValueTask RemoveChart(this IJSRuntime jsRuntime, string canvasId)
3636
/// <param name="jsRuntime"></param>
3737
/// <param name="chartConfig">The config for the new chart.</param>
3838
/// <returns></returns>
39-
public static ValueTask<bool> SetupChart(this IJSRuntime jsRuntime, BitChartConfigBase chartConfig)
39+
public static ValueTask<bool> BitChartJsSetupChart(this IJSRuntime jsRuntime, BitChartConfigBase chartConfig)
4040
{
4141
var dynParam = StripNulls(chartConfig);
4242
Dictionary<string, object> param = ConvertExpandoObjectToDictionary(dynParam);
4343
return jsRuntime.InvokeAsync<bool>("BitBlazorUI.BitChart.setupChart", param);
4444
}
4545

46+
/// <summary>
47+
/// Update an existing chart. Make sure that the Chart with this <see cref="BitChartConfigBase.CanvasId"/> already exists.
48+
/// </summary>
49+
/// <param name="jsRuntime"></param>
50+
/// <param name="chartConfig">The updated config of the chart you want to update.</param>
51+
/// <returns></returns>
52+
public static ValueTask<bool> BitChartJsUpdateChart(this IJSRuntime jsRuntime, BitChartConfigBase chartConfig)
53+
{
54+
var dynParam = StripNulls(chartConfig);
55+
Dictionary<string, object> param = ConvertExpandoObjectToDictionary(dynParam);
56+
return jsRuntime.InvokeAsync<bool>("BitBlazorUI.BitChart.updateChart", param);
57+
}
58+
59+
60+
4661
/// <summary>
4762
/// This method is specifically used to convert an <see cref="ExpandoObject"/> with a Tree structure to a <c>Dictionary&lt;string, object&gt;</c>.
4863
/// </summary>
@@ -85,19 +100,6 @@ private static Dictionary<string, object> RecursivelyConvertIDictToDict(IDiction
85100
}
86101
);
87102

88-
/// <summary>
89-
/// Update an existing chart. Make sure that the Chart with this <see cref="BitChartConfigBase.CanvasId"/> already exists.
90-
/// </summary>
91-
/// <param name="jsRuntime"></param>
92-
/// <param name="chartConfig">The updated config of the chart you want to update.</param>
93-
/// <returns></returns>
94-
public static ValueTask<bool> UpdateChart(this IJSRuntime jsRuntime, BitChartConfigBase chartConfig)
95-
{
96-
var dynParam = StripNulls(chartConfig);
97-
Dictionary<string, object> param = ConvertExpandoObjectToDictionary(dynParam);
98-
return jsRuntime.InvokeAsync<bool>("BitBlazorUI.BitChart.updateChart", param);
99-
}
100-
101103
/// <summary>
102104
/// Returns an object that is equivalent to the given parameter but without any null members AND it preserves <see cref="IBitChartMethodHandler"/>s intact.
103105
/// <para>Preserving <see cref="IBitChartMethodHandler"/> members is important because they might be <see cref="BitChartDelegateHandler{T}"/> instances which contain

0 commit comments

Comments
 (0)