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

chore: migrate v5 style #3574

Open
wants to merge 38 commits into
base: compatibility-v5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7eb36ef
create v5 style file
yoli799480165 Jul 14, 2023
7cee972
Remove the style file that is not working properly .
yoli799480165 Jul 24, 2023
95d447b
add v5 theme
yoli799480165 Nov 24, 2023
0efac54
WIP
yoli799480165 Nov 27, 2023
ff1542a
WIP
yoli799480165 Nov 27, 2023
f19a59c
WIP
yoli799480165 Dec 1, 2023
1661d26
update CssInCSharp package
yoli799480165 Dec 2, 2023
e9bf367
clean projects
yoli799480165 Dec 2, 2023
07a69d4
fix build error
yoli799480165 Dec 2, 2023
103a0b8
add a simple doc project for v5
yoli799480165 Dec 3, 2023
334f953
refactor style render method
yoli799480165 Dec 5, 2023
3b01110
update code generator
yoli799480165 Dec 5, 2023
0942aff
All components starting with the letter A have been migrated.
yoli799480165 Dec 6, 2023
11f484c
migrate components starting with the letter B
yoli799480165 Dec 6, 2023
fe17f9a
fix missing tokens
yoli799480165 Dec 6, 2023
776707d
update generator
yoli799480165 Dec 6, 2023
01ccf82
fix number mapping type error
yoli799480165 Dec 7, 2023
e967fba
generate component style with letter D
yoli799480165 Dec 7, 2023
7adfe73
add hashId to components
yoli799480165 Dec 7, 2023
b8ac1f2
WIP
yoli799480165 Dec 7, 2023
ec24df0
add style for component letter with C
yoli799480165 Dec 7, 2023
59e120b
add empty component
yoli799480165 Dec 8, 2023
5d3e824
update docs
yoli799480165 Dec 11, 2023
01a8bb5
gen menu style
yoli799480165 Dec 11, 2023
e025e61
update menu style
yoli799480165 Dec 12, 2023
7ea328c
add grid style
yoli799480165 Dec 12, 2023
b17f196
gen radio style
yoli799480165 Dec 13, 2023
bc4f548
gen input & mentions style.
yoli799480165 Dec 13, 2023
82601e9
WIP
yoli799480165 Dec 13, 2023
b9ec5ce
gen message component style
yoli799480165 Dec 13, 2023
4f002f2
gen component styles
yoli799480165 Dec 14, 2023
55a9de8
remove useless style file
yoli799480165 Dec 14, 2023
7bd561d
gen styles
yoli799480165 Dec 14, 2023
8a30c98
update cssincsharp package
yoli799480165 Dec 14, 2023
053ce68
gen component styles
yoli799480165 Dec 15, 2023
6455b08
remove v5 demo site
yoli799480165 Dec 15, 2023
ec83053
fix cast token prop error
yoli799480165 Dec 18, 2023
26a8f4b
Merge branch 'compatibility-v5' into v5
ElderJames Jun 21, 2024
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
17 changes: 16 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@
// If you have changed the default port / launch URL make sure to update the expectation below
"url": "http://localhost:5000",
"webRoot": "${workspaceFolder}/site/AntDesign.Docs.Wasm",
}
},
{
"name": "Migrator",
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"runtimeArgs": [
"-r",
"ts-node/register"
],
"args": [
"${workspaceFolder}/scripts/migrator/index.ts"
]
}
]
}
3 changes: 2 additions & 1 deletion components/AntDesign.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CssInCSharp" Version="0.1.0-nightly-231218032026" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="OneOf" Version="2.1.155" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<Content Update="**\*.razor">
<Pack>false</Pack>
Expand Down
3 changes: 2 additions & 1 deletion components/_Imports.razor
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web
@using CssInCSharp
3 changes: 2 additions & 1 deletion components/affix/Affix.razor
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
<div class="@ClassMapper.Class" @ref="_childRef" style="@_affixStyle">
@ChildContent
</div>
</div>
</div>
@_styleContent
5 changes: 3 additions & 2 deletions components/affix/Affix.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ private bool Affixed
protected override void OnInitialized()
{
base.OnInitialized();

var hashId = UseStyle(PrefixCls);
ClassMapper
.If(PrefixCls, () => _affixed);
.If(PrefixCls, () => _affixed)
.Add(hashId);
}

public override async Task SetParametersAsync(ParameterView parameters)
Expand Down
52 changes: 52 additions & 0 deletions components/affix/Style.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using CssInCSharp;
using static AntDesign.GlobalStyle;
using static AntDesign.Theme;
using static AntDesign.StyleUtil;

namespace AntDesign
{
public class AffixToken : TokenWithCommonCls
{
public double ZIndexPopup
{
get => (double)_tokens["zIndexPopup"];
set => _tokens["zIndexPopup"] = value;
}

}

public partial class Affix
{
public CSSObject GenSharedAffixStyle(AffixToken token)
{
var componentCls = token.ComponentCls;
return new CSSObject()
{
[componentCls] = new CSSObject()
{
Position = "fixed",
ZIndex = token.ZIndexPopup,
},
};
}

protected override UseComponentStyleResult UseComponentStyle()
{
return GenComponentStyleHook(
"Affix",
(token) =>
{
var affixToken = MergeToken(
token,
new AffixToken()
{
ZIndexPopup = token.ZIndexBase + 10,
});
return new CSSInterpolation[] { GenSharedAffixStyle(affixToken) };
});
}

}

}
3 changes: 2 additions & 1 deletion components/alert/Alert.razor
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@
</button>
}
</div>
}
}
@_styleContent
4 changes: 3 additions & 1 deletion components/alert/Alert.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ public partial class Alert : AntDomComponentBase
private void SetClassMap()
{
string prefixName = "ant-alert";
var hashId = UseStyle(prefixName);
ClassMapper
.Add("ant-alert")
.Add(prefixName)
.Add(hashId)
.GetIf(() => $"{prefixName}-{CalcType}", () => !string.IsNullOrEmpty(CalcType))
.If($"{prefixName}-no-icon", () => !IsShowIcon)
.If($"{prefixName}-closable", () => Closable)
Expand Down
Loading
Loading