Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ImageCropper): support set crop shape #14

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,41 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup>
<Version>0.0.4</Version>
<PackageProjectUrl>https://github.com/densen2014/BootstrapBlazor.ImageCropper</PackageProjectUrl>
<RepositoryUrl>https://github.com/densen2014/BootstrapBlazor.ImageCropper</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Bootstrap Blazor ImageCropper 图像裁剪 组件 </PackageTags>
<Description>Bootstrap UI ImageCropper components experience</Description>
<AssemblyName>BootstrapBlazor.ImageCropper</AssemblyName>
<RootNamespace>BootstrapBlazor.ImageCropper</RootNamespace>
<AssemblyOriginatorKeyFile>..\keys\Longbow.Utility.snk</AssemblyOriginatorKeyFile>
<SignAssembly>True</SignAssembly>
<OutputPath>..\..\..\Bin</OutputPath>
</PropertyGroup>
<PropertyGroup>
<Version>8.1.0</Version>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.10" />
</ItemGroup>
<PropertyGroup>
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components ImageCropper</PackageTags>
<Description>Bootstrap UI components extensions of ImageCropper</Description>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BootstrapBlazor" Version="8.10.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0" />
</ItemGroup>

<!-- 通过移除正常的引用并替换成固定版本的引用,达到无论如何更新都无法生效的目的。 -->
<Target Condition="'$(TargetFramework)' == 'net6.0'" Name="ReferenceStaticLegacyPackage" BeforeTargets="CollectPackageReferences">
<ItemGroup>
<PackageReference Remove="Microsoft.AspNetCore.Components.Web" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0" />
</ItemGroup>
</Target>
</Project>
29 changes: 4 additions & 25 deletions src/components/BootstrapBlazor.ImageCropper/ImageCropper.razor
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
@namespace BootstrapBlazor.Components
@inherits BootstrapModuleComponentBase
@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.ImageCropper/ImageCropper.razor.js")]

<link href="@CssPath" rel="stylesheet">

<div @ref="Element">

<div class="containerTop">
<div>
<img class="@CssClass" data-action="image" src="@Url" alt="Picture">
</div>
@if (DefaultButton)
{
<div class="input-group">
<button type="button" onclick="@(() => Crop())" class="btn btn-primary">@ConfirmBtnTitle</button>
<button type="button" onclick="@(() => Reset())" class="btn btn-primary">@ResetBtnTitle</button>
</div>
}
@if (Preview)
{
<h3>@PreviewTitle</h3>
<div data-action="result"></div>
}


</div>

<div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id">
<img src="@Url" class="bb-cropper-image" />
</div>

Loading