Skip to content

Commit c27155e

Browse files
authored
Merge pull request #2342 from Basaingeal/release/v5.5.0
Release/v5.5.0
2 parents 7647214 + e6c5225 commit c27155e

12 files changed

+1431
-1482
lines changed

.eslintignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.cjs
1+
*.cjs
2+
3+
wwwroot

.github/dependabot.yml

-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
version: 2
22
updates:
3-
- package-ecosystem: nuget
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
8-
target-branch: develop
9-
ignore:
10-
- dependency-name: Microsoft.AspNetCore.Components
11-
versions:
12-
- 5.0.2
13-
- 5.0.3
14-
- 5.0.4
15-
- 5.0.5
16-
- dependency-name: Microsoft.AspNetCore.Components.Web
17-
versions:
18-
- 5.0.2
19-
- 5.0.3
20-
- 5.0.4
21-
- 5.0.5
223
- package-ecosystem: npm
234
directory: "/"
245
schedule:

.prettierrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
{
2-
"printWidth": 100
32
}

CHANGELOG.md

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
# v5.4.0
1+
# v5.5.0
22

33
## Notable changes
44

5-
### Remove explicit .NET Core 3.1 support
5+
### `InputAutoFocus` property
66

7-
This library no longer targets .NET Core 3.1 as it is no longer a supported version of .NET. The library still targets .NET Standard 2.0, so apps that are still on .NET Core 3.1 should still be able to use it.
7+
This release includes the new `inputAutoFocus` options property introduced by the `sweetalert2` library.
8+
By setting this to `false`, the input on the alert will not be auto-focused. (`true` by default)
89

9-
### Public `IAsyncSweetAlertService` interface
10-
11-
The `IAsyncSweetAlertService` interface has been made public by request. (https://github.com/Basaingeal/Razor.SweetAlert2/issues/2183)
12-
13-
### Protestware
14-
15-
The author of the `sweetalert2` library added protestware concerning the war between Russia and Ukraine. (https://github.com/sweetalert2/sweetalert2/pull/2462) ([SNYK: Undesired Behavior in sweetalert2](https://security.snyk.io/vuln/SNYK-JS-SWEETALERT2-2774674))
16-
17-
This protestware was recently updated to auto-play the Ukrainian national anthem in addition to disabling all user events. This library will now detect when the `<audio>` element that plays the anthem has been added to the document, and removes it.
18-
1910
## Dependencies
2011

21-
- bump `sweetalert2` to `11.6.15`
22-
- bump `@sweetalert2/themes` to `5.0.15`
23-
12+
- bump `sweetalert2` to `11.7.3`

CurrieTechnologies.Razor.SweetAlert2.csproj

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Description>
1010
A Razor class library for interacting with SweetAlert2.
1111
Use in Blazor Server Apps or Blazor WebAssembly Apps.
12-
Currently using sweetalert2@11.6.15
12+
Currently using sweetalert2@11.7.3
1313
</Description>
1414
<Copyright>Michael J. Currie</Copyright>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
@@ -21,9 +21,7 @@
2121
<PackageReadmeFile>README.md</PackageReadmeFile>
2222
<PackageReleaseNotes>
2323
bump sweetalert2
24-
bump @sweetalert2/themes
25-
removed explicit support for .NET Core 3.1
26-
made IAsyncSweetAlertService interface public
24+
add InputAutoFocus property
2725
</PackageReleaseNotes>
2826
</PropertyGroup>
2927

@@ -44,7 +42,7 @@
4442
</ItemGroup>
4543

4644
<ItemGroup>
47-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0.*">
45+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.*">
4846
<PrivateAssets>all</PrivateAssets>
4947
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5048
</PackageReference>

Models/SweetAlertOptionPOCO.cs

+2
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ internal class SweetAlertOptionPOCO
143143

144144
[JsonPropertyName("inputOptions")] public IDictionary<string, string> InputOptions { get; set; }
145145

146+
[JsonPropertyName("inputAutoFocus")] public bool? InputAutoFocus { get; set; }
147+
146148
[JsonPropertyName("inputAutoTrim")] public bool? InputAutoTrim { get; set; }
147149

148150
[JsonPropertyName("inputAttributes")] public IDictionary<string, string> InputAttributes { get; set; }

Models/SweetAlertOptions.cs

+7
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,12 @@ public SweetAlertOptions(string title)
379379
public IDictionary<string, string> InputOptions { get; set; }
380380
#pragma warning restore CA2227 // Collection properties should be read only
381381

382+
/// <summary>
383+
/// Automatically focus the input when popup is shown.
384+
/// <para>Set this parameter to `false` to disable auto-focusing.</para>
385+
/// </summary>
386+
public bool? InputAutoFocus { get; set; }
387+
382388
/// <summary>
383389
/// Automatically remove whitespaces from both ends of a result string.
384390
/// <para>Set this parameter to false to disable auto-trimming.</para>
@@ -539,6 +545,7 @@ internal SweetAlertOptionPOCO ToPOCO()
539545
InputPlaceholder = InputPlaceholder,
540546
InputValue = InputValue,
541547
InputOptions = InputOptions,
548+
InputAutoFocus = InputAutoFocus,
542549
InputAutoTrim = InputAutoTrim,
543550
InputAttributes = InputAttributes,
544551
InputValidator = InputValidator != null,

Services/SweetAlertOptionsMixingService.cs

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ internal static SweetAlertOptions Mix(SweetAlertOptions oldSettings, SweetAlertO
6868
InputPlaceholder = newSettings.InputPlaceholder ?? oldSettings.InputPlaceholder,
6969
InputValue = newSettings.InputValue ?? oldSettings.InputValue,
7070
InputOptions = newSettings.InputOptions ?? oldSettings.InputOptions,
71+
InputAutoFocus = newSettings.InputAutoFocus ?? oldSettings.InputAutoFocus,
7172
InputAutoTrim = newSettings.InputAutoTrim ?? oldSettings.InputAutoTrim,
7273
InputAttributes = newSettings.InputAttributes ?? oldSettings.InputAttributes,
7374
InputValidator = newSettings.InputValidator ?? oldSettings.InputValidator,

0 commit comments

Comments
 (0)