Skip to content

fix(number-animation): add version information for the number animation component and fix the loading error problem under the SaaS theme #3390

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

Merged
merged 1 commit into from
May 8, 2025
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
9 changes: 8 additions & 1 deletion examples/sites/demos/pc/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,14 @@ export const cmpMenus = [
},
{ 'nameCn': '用户头像', 'name': 'UserHead', 'key': 'user-head' },
{ 'nameCn': '流程图', 'name': 'Wizard', 'key': 'wizard' },
{ 'nameCn': '数值动画', 'name': 'NumberAnimation', key: 'number-animation' }
{
'nameCn': '数值动画',
'name': 'NumberAnimation',
'key': 'number-animation',
'meta': {
'stable': '3.23.0'
}
}
]
},
{
Expand Down
1 change: 1 addition & 0 deletions packages/theme-saas/src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
@import './month-table/index.less';
@import './nav-menu/index.less';
@import './notify/index.less';
@import './number-animation/index.less';
@import './numeric/index.less';
@import './option/index.less';
@import './option-group/index.less';
Expand Down
9 changes: 9 additions & 0 deletions packages/theme-saas/src/number-animation/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '../custom.less';

@number-animation-item-prefix-cls: ~'@{css-prefix}number-animation';

.@{number-animation-item-prefix-cls} {
@apply text-2xl;
@apply font-normal;
@apply mb-5;
}
Comment on lines +1 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Introduce NumberAnimation styling; add missing license header
The stylesheet correctly sets up the component prefix and applies utility classes (text-2xl, font-normal, mb-5). However, to maintain consistency with other theme files, please add the standard MIT-style license header at the top. Also verify that @apply utility classes and the global @{css-prefix} variable are resolved by the build.

You can check for css-prefix definition and @apply support with:


🏁 Script executed:

#!/bin/bash
# Check that css-prefix is defined in custom.less
grep -R "css-prefix" -n packages/theme-saas/src/custom.less || echo "❌ css-prefix not found in custom.less"
# Ensure build supports @apply by inspecting PostCSS or Less plugin config (manually review)

Length of output: 1168


🏁 Script executed:

#!/bin/bash
# Search for PostCSS configuration
fd postcss.config.js || echo "no postcss.config.js found"
# Search for Tailwind configuration
fd tailwind.config.js || echo "no tailwind.config.js found"
# Check for @apply usage in theme-saas
rg "@apply" -n packages/theme-saas/src

Length of output: 110507


🏁 Script executed:

#!/bin/bash
# Search for existing license headers in theme-saas .less files
grep -R "MIT" -n packages/theme-saas/src || echo "No explicit 'MIT' mention found"
grep -R "license" -n packages/theme-saas/src

# Show top of a representative file to inspect header style
head -n 10 packages/theme-saas/src/checkbox/index.less

Length of output: 3222


Add MIT license header to number-animation/index.less
The @css-prefix variable is defined in custom.less and the PostCSS <code>@apply</code> plugin is already in use across the theme, so only the license header is missing.

• File to update: packages/theme-saas/src/number-animation/index.less
• Copy the standard header from any existing Less file (e.g., date-table/index.less) and prepend it above the imports.

Example snippet:

+ /*!
+  * Use of this source code is governed by an MIT-style license.
+  * See the LICENSE file in the project root for details.
+  */
@import '../custom.less';

@number-animation-item-prefix-cls: ~'@{css-prefix}number-animation';

.@{number-animation-item-prefix-cls} {
  @apply text-2xl;
  @apply font-normal;
  @apply mb-5;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@import '../custom.less';
@number-animation-item-prefix-cls: ~'@{css-prefix}number-animation';
.@{number-animation-item-prefix-cls} {
@apply text-2xl;
@apply font-normal;
@apply mb-5;
}
/*!
* Use of this source code is governed by an MIT-style license.
* See the LICENSE file in the project root for details.
*/
@import '../custom.less';
@number-animation-item-prefix-cls: ~'@{css-prefix}number-animation';
.@{number-animation-item-prefix-cls} {
@apply text-2xl;
@apply font-normal;
@apply mb-5;
}

1 change: 1 addition & 0 deletions packages/theme/src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
@import './month-table/index.less';
@import './nav-menu/index.less';
@import './notify/index.less';
@import './number-animation/index.less';
@import './numeric/index.less';
@import './option/index.less';
@import './option-group/index.less';
Expand Down
14 changes: 7 additions & 7 deletions packages/theme/src/number-animation/vars.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.inject-NumberAnimation-vars() {
// 数字内容下间距
--tv-NumberAnimation-margin-bottom: 20px;
// 数字内容字体粗细
--tv-NumberAnimation-font-weight: var(--tv-font-weight-regular);
// 数字内容字体
--tv-NumberAnimation-font-size: var(--tv-font-size-heading-lg);
}
// 数字内容下间距
--tv-NumberAnimation-margin-bottom: 20px;
// 数字内容字体粗细
--tv-NumberAnimation-font-weight: var(--tv-font-weight-regular, 400);
// 数字内容字体
--tv-NumberAnimation-font-size: var(--tv-font-size-heading-lg, 24px);
}
4 changes: 2 additions & 2 deletions packages/theme/src/table/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
// 表格单元格字体大小
--tv-Table-td-font-size: var(--tv-font-size-default, 14px);
// 表格边框颜色
--tv-Table-border-color: var(--tv-color-border-divider);
--tv-Table-border-color: var(--tv-color-border-divider, #f0f0f0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in --tv-Table-border-color now includes a default value #f0f0f0. Ensure that this default value does not conflict with existing themes or cause unintended visual changes.

// 表格复选框边框颜色
--tv-Table-icon-border-color: var(--tv-color-border);
--tv-Table-icon-border-color: var(--tv-color-border, #c2c2c2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in --tv-Table-icon-border-color now includes a default value #c2c2c2. Verify that this default value aligns with the design specifications and does not introduce visual inconsistencies.

// 表头背景颜色
--tv-Table-thead-bg-color: var(--tv-color-bg-header, #f5f5f5);
// 表格图标字体大小
Expand Down
Loading