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

refactor: inline all x-design design config #2317

Merged
merged 17 commits into from
Oct 21, 2024
Merged

Conversation

gimmyhehe
Copy link
Member

@gimmyhehe gimmyhehe commented Oct 19, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added multiple new components: BreadcrumbItem, FilterBox, Guide, Milestone, Popconfirm, Popover, Time, TimeRange, TimeSpinner, TransferPanel, and UploadList.
    • Introduced new configuration options for components, enhancing customization.
    • Enhanced milestone functionality with dynamic styling based on status.
    • Improved upload list component with updated progress display properties.
  • Bug Fixes

    • Corrected icon references and improved visual consistency across components.
  • Documentation

    • Updated documentation to reflect new features and changes in component behavior.
  • Style

    • Adjusted styles for various components to improve user interface consistency.
  • Chores

    • Removed deprecated components and properties to streamline the codebase.

@gimmyhehe gimmyhehe added the refactoring Refactoring (重构) label Oct 19, 2024
Copy link

coderabbitai bot commented Oct 19, 2024

Walkthrough

The changes in this pull request involve significant updates to the components within the aurora and saas design packages. New components such as BreadcrumbItem, FilterBox, Guide, Milestone, Popconfirm, Split, Time, TimeRange, TimeSpinner, TransferPanel, and UploadList have been added to the exports, while the Popover component has been removed. Additionally, several existing components have undergone modifications to their properties and methods, enhancing their functionality and configuration options.

Changes

File Path Change Summary
packages/design/aurora/index.ts Added multiple components to imports and exports; removed Popover.
packages/design/aurora/src/alert/index.ts Removed renderless method from alert component.
packages/design/aurora/src/breadcrumb-item/index.ts Updated separator property from '/' to '>'.
packages/design/aurora/src/filter-box/index.ts Introduced new file exporting icons with expandButton.
packages/design/aurora/src/milestone/index.ts Added new methods for rendering milestone icons and styles.
packages/design/aurora/src/popconfirm/index.ts Introduced new file exporting icons with warning icon.
packages/design/aurora/src/split/index.ts Introduced new default export with triggerBarConWithLine set to false.
packages/design/aurora/src/time-range/index.ts Updated showTimePickerRangeButton from true to false.
packages/design/aurora/src/time-spinner/index.ts Introduced new default export with itemMarginSpace set to 0.
packages/design/aurora/src/time/index.ts Introduced new default export with showTimePickerButton set to false.
packages/design/aurora/src/transfer-panel/index.ts Introduced new default export with inputBoxType set to 'normal' and showInputSearch set to false.
packages/design/aurora/src/upload-list/index.ts Introduced new default export with state and icons properties.
packages/design/saas/index.ts Added multiple components to imports and exports; removed Popover, Pager, and Popeditor.
packages/design/saas/src/alert/index.ts Removed renderless method from alert component.
packages/design/saas/src/breadcrumb-item/index.ts Introduced new default export with separator set to '>'.
packages/design/saas/src/filter-box/index.ts Introduced new file exporting icons with expandButton.
packages/design/saas/src/guide/index.ts Updated state management by removing btnOrderReversed and adding isUseModalOverlay.
packages/design/saas/src/milestone/index.ts Introduced new renderless component with methods for styling based on milestone status.
packages/design/saas/src/popconfirm/index.ts Introduced new file exporting icons with warning icon.
packages/design/saas/src/split/index.ts Introduced new default export with triggerBarConWithLine set to false.
packages/design/saas/src/time-range/index.ts Introduced new default export with showTimePickerRangeButton set to false.
packages/design/saas/src/time-spinner/index.ts Introduced new default export with itemMarginSpace set to 0.
packages/design/saas/src/time/index.ts Introduced new default export with showTimePickerButton set to false.
packages/design/saas/src/transfer-panel/index.ts Introduced new default export with inputBoxType set to 'normal' and showInputSearch set to false.
packages/design/saas/src/upload-list/index.ts Introduced new default export with state and icons properties.
packages/design/smb/index.ts Removed multiple components from the components object, leaving it empty.
packages/design/smb/src/* Multiple files removed, including components like alert, action-menu, dropdown, etc.
packages/renderless/src/* Various updates to functions and properties across multiple files, enhancing component functionality.
packages/theme/src/* Modifications to LESS stylesheets, including removal of specific button styles and updates to CSS variables.
packages/vue/src/* Updates across various components, including icon changes and prop additions.

Possibly related PRs

Suggested reviewers

  • zzcr

Poem

🐇 In the land of code where rabbits play,
New components hop in, brightening the day.
With filters and milestones, the UI's a treat,
Each change a delight, making it neat!
So let's celebrate with a joyful cheer,
For every new feature that brings us near! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot removed the refactoring Refactoring (重构) label Oct 19, 2024
Copy link

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

@gimmyhehe gimmyhehe changed the title Cgm/inline design config refactor: inline all x-design design config Oct 19, 2024
@github-actions github-actions bot added the refactoring Refactoring (重构) label Oct 19, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 25

🧹 Outside diff range and nitpick comments (38)
packages/design/aurora/src/transfer-panel/index.ts (1)

1-4: Add explanatory comments for configuration options

While the code is clear, adding comments to explain the purpose and possible values for each configuration option would improve the maintainability and usability of this module.

Consider adding comments like this:

export default {
  // The type of input box to use in the transfer panel. 
  // Possible values: 'normal', ... (add other possible values)
  inputBoxType: 'normal',

  // Whether to show a search input in the transfer panel
  showInputSearch: false
}

These comments will help other developers understand the purpose and possible values for each option without needing to refer to external documentation.

packages/design/aurora/src/popconfirm/index.ts (1)

3-7: Consider adding a type definition for the exported object.

The default export is well-structured. However, to improve type safety and developer experience, consider adding a TypeScript interface or type definition for the exported object.

Here's a suggested implementation:

interface PopconfirmIcons {
  warning: ReturnType<typeof iconWarning>;
}

interface PopconfirmConfig {
  icons: PopconfirmIcons;
}

const config: PopconfirmConfig = {
  icons: {
    warning: iconWarning()
  }
};

export default config;
packages/design/aurora/src/filter-box/index.ts (1)

1-7: LGTM! Consider adding TypeScript type annotations.

The overall structure of the file looks good. It correctly imports the necessary icon and exports a default object with the required configuration. To improve maintainability and type safety, consider adding TypeScript type annotations to the exported object.

Here's a suggestion for adding type annotations:

import { iconArrowBottom } from '@opentiny/vue-icon'

interface FilterBoxConfig {
  icons: {
    expandButton: ReturnType<typeof iconArrowBottom>
  }
}

const config: FilterBoxConfig = {
  icons: {
    expandButton: iconArrowBottom()
  }
}

export default config
packages/design/saas/src/filter-box/index.ts (1)

3-7: LGTM: Clear and concise object structure. Consider adding type annotations.

The exported object structure is simple and easy to understand. To improve type safety and developer experience, consider adding TypeScript interfaces or type annotations.

Here's a suggestion to add type annotations:

interface FilterBoxIcons {
  expandButton: ReturnType<typeof iconArrowBottom>;
}

export default {
  icons: {
    expandButton: iconArrowBottom()
  } as FilterBoxIcons
};
packages/design/saas/src/upload-list/index.ts (2)

2-7: Consider documenting the purpose and usage of state properties

The state object contains properties related to a progress indicator, which is good for configuration. However, consider the following suggestions:

  1. Add comments or documentation explaining the purpose and possible values for each property.
  2. Consider using TypeScript to define types for these properties, enhancing type safety and developer experience.
  3. The progressWidth is set to null. Clarify if this is intentional or if it should have a default numeric value.

Example with TypeScript and comments:

interface UploadListState {
  // Type of progress indicator: 'circle' | 'line'
  progressType: string;
  // Width of the progress indicator in pixels, null for default
  progressWidth: number | null;
  // Thickness of the progress indicator stroke in pixels
  progressStrokeWidth: number;
  // Whether tooltips are disabled
  tooltipDisabled: boolean;
}

const state: UploadListState = {
  progressType: 'circle',
  progressWidth: null,
  progressStrokeWidth: 6,
  tooltipDisabled: true
};

8-11: Clarify the usage of icon components and consider consistency

The icons object provides configuration for close and preview components. However, there are some points to consider:

  1. The closeComponent is set to a string 'icon-close', which might be referencing an icon component. Consider using a more explicit naming convention, such as closeIconName or closeIconComponent, to clarify its purpose.

  2. The preViewComponent is set to an empty string. If this is intentional (e.g., no default preview icon), consider setting it to null instead of an empty string to make the intention clearer. If it's meant to be populated, provide a default value or add a TODO comment.

  3. For consistency, consider using the same naming convention for both properties. For example:

icons: {
  closeIconName: 'icon-close',
  previewIconName: null // or a default value if applicable
}
  1. Add comments explaining how these icon components are used in the upload list.
packages/renderless/src/filter-box/vue.ts (1)

7-7: LGTM: Improved icon configuration with fallback

The expandButtonIcon property now uses optional chaining to access designConfig.icons.expandButton, falling back to 'IconDownWard' if not defined. This change improves flexibility and robustness.

Consider adding a comment explaining the purpose of this configuration option for better maintainability.

You could add a comment like this:

// Allow custom expand button icon configuration, defaulting to 'IconDownWard'
expandButtonIcon: designConfig?.icons?.expandButton || 'IconDownWard'
packages/vue/src/popconfirm/src/index.ts (2)

26-26: LGTM! Consider updating related documentation.

The change from 'icon-warning' to 'icon-warning-triangle' for the warning state icon is appropriate and consistent with the naming convention of other icons in the ICON_MAP.

Please ensure that any related documentation or design specifications referencing the warning icon are updated to reflect this change.


Action Required: Fix Remaining Typo in index.ts

The typo 'Popconfim' still exists in packages/vue/src/popconfirm/src/index.ts on the line:

name: $prefix + 'Popconfim',

Please correct it to 'Popconfirm' to ensure consistency across the codebase.

🔗 Analysis chain

Line range hint 69-69: LGTM! Verify component references in the codebase.

The correction of the component name from 'Popconfim' to 'Popconfirm' improves consistency and accuracy.

Please run the following script to ensure that all references to this component in the codebase have been updated:

If any occurrences of 'Popconfim' are found, please update them to 'Popconfirm'.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining references to 'Popconfim' in the codebase

# Test: Search for 'Popconfim' in all files. Expect: No results
rg --type-add 'vue:*.{vue,js,ts}' --type vue 'Popconfim'

# Test: Search for 'Popconfirm' in all files. Expect: Results including this file
rg --type-add 'vue:*.{vue,js,ts}' --type vue 'Popconfirm'

Length of output: 8139

packages/vue/src/alert/src/pc.vue (1)

55-55: LGTM! Consider grouping similar icons.

The addition of iconWarningTriangle is appropriate and follows the existing import pattern. To improve code organization, consider grouping similar icons together in the import statement.

You could reorder the imports like this:

import { 
  iconClose, 
  iconSuccess, 
  iconError, 
  iconHelp, 
  iconWarning, 
  iconWarningTriangle 
} from '@opentiny/vue-icon'

This groups the warning-related icons (iconWarning and iconWarningTriangle) together, making it easier to see related imports at a glance.

packages/renderless/src/time/vue.ts (1)

63-63: Approve change with a minor suggestion for clarity.

The introduction of the designConfig for controlling the showTimePickerButton state is a good improvement, allowing for more flexible configuration. The use of the nullish coalescing operator ensures backwards compatibility.

For improved clarity and to make the default value more explicit, consider refactoring the line as follows:

-  state.showTimePickerButton = designConfig?.showTimePickerButton ?? true
+  state.showTimePickerButton = designConfig?.showTimePickerButton ?? true // Default to true if not specified in designConfig

This comment explicitly states the default behavior, which can be helpful for future maintainers.

packages/renderless/src/time-range/vue.ts (1)

74-74: Consider updating documentation for default behavior

While this change improves the code, it might be beneficial to update the component's documentation to reflect that showTimePickerRangeButton defaults to true when not specified in the design config. This ensures that users of the component are aware of the default behavior.

packages/vue/src/popconfirm/src/pc.vue (1)

Line range hint 58-68: Summary: Icon update implemented correctly

The changes in this file are focused on updating the warning icon from iconWarning to iconWarningTriangle. This modification has been consistently applied to both the import statement and the component declaration.

Key points:

  1. The change aligns with the PR objectives and AI-generated summary.
  2. No other parts of the component logic or structure were modified, minimizing the risk of unintended side effects.
  3. The update may result in a slight visual change in the component's appearance.

Consider the following to ensure a smooth transition:

  1. Update any documentation or design guidelines that reference the old warning icon.
  2. If this is part of a larger icon update across the project, ensure consistency in other components that use warning icons.
  3. Consider adding a visual regression test to catch any unexpected changes in the component's appearance due to this icon update.
packages/renderless/src/upload-list/vue.ts (2)

77-80: LGTM with a minor suggestion

The change properly handles the case when progressWidth is not specified in designConfig, defaulting to '68'. The use of Object.hasOwnProperty.call() is a good practice for safely checking property existence.

Consider using nullish coalescing operator (??) for a more concise expression:

progressWidth: designConfig?.state?.progressWidth ?? '68',

This achieves the same result with less code and improved readability.


84-87: LGTM with a minor suggestion

The change properly handles the case when preViewComponent is not specified in designConfig, defaulting to 'icon-fullscreen-left'. The use of Object.hasOwnProperty.call() is a good practice for safely checking property existence.

Consider using optional chaining and nullish coalescing for a more concise expression:

preViewComponent: designConfig?.icons?.preViewComponent ?? 'icon-fullscreen-left',

This achieves the same result with less code and improved readability.

packages/renderless/src/transfer-panel/vue.ts (2)

73-74: LGTM! Consider minor consistency improvement.

The changes introduce new design configuration options for the input box type and search visibility, which enhances the component's flexibility. The use of default values ensures backward compatibility.

For consistency, consider using the nullish coalescing operator for inputBoxType as well:

inputBoxType: designConfig?.inputBoxType ?? 'underline',

This change would allow explicitly setting inputBoxType to null or undefined in the design config if needed, matching the behavior of showInputSearch.


Line range hint 1-224: Suggest additional testing and documentation.

While the changes are minimal and well-integrated, the complexity of the transfer panel component warrants additional considerations:

  1. Testing: Ensure that unit tests are updated or added to cover the new configuration options (inputBoxType and showInputSearch). This will help verify that the component behaves correctly with different design configurations.

  2. Documentation: Update the component's documentation to reflect these new configuration options. Include:

    • Description of each option
    • Possible values
    • Default behavior
    • Examples of usage
  3. Consider adding comments in the code to explain the purpose of these new configuration options and how they affect the component's behavior.

These steps will help maintain the component's reliability and ease of use for other developers.

🧰 Tools
🪛 Biome

[error] 71-71: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/dropdown/src/pc.vue (1)

20-20: LGTM! Consider grouping related imports.

The change from iconDeltaDown to iconDownWard is consistent with the component's logic updates. To improve code organization, consider grouping all icon-related imports together at the top of the import section.

packages/renderless/src/guide/index.ts (6)

Line range hint 125-125: Typo in variable name cloesIcon should be closeIcon

The variable cloesIcon appears to be misspelled. Correcting it to closeIcon enhances code readability and prevents potential confusion.

Apply this diff to correct the typo:

- const cloesIcon = `<?xml version="1.0" encoding="utf-8"?>
+ const closeIcon = `<?xml version="1.0" encoding="utf-8"?>

Also, update the reference accordingly:

- cancelIcon.innerHTML = cloesIcon
+ cancelIcon.innerHTML = closeIcon

Line range hint 50-58: Use a more reliable method for deep cloning objects

Using JSON.parse(JSON.stringify(item)) for deep cloning can lead to issues with functions, undefined values, or circular references. Consider using a utility like lodash.cloneDeep for a more robust solution.

Update the imports and use cloneDeep:

+ import cloneDeep from 'lodash/cloneDeep';

const getItemCopy = (props, tour) => {
  const { domData } = props;

  const result = domData.map((item) => {
-   const itemCopy = JSON.parse(JSON.stringify(item));
+   const itemCopy = cloneDeep(item);

    itemCopy.button = item.button.map((e) => {
-     const eCopy = JSON.parse(JSON.stringify(e));
+     const eCopy = cloneDeep(e);

      eCopy.action = tour[e.action];
      return eCopy;
    });
    return itemCopy;
  });
  return result;
};

Line range hint 9-9: Remove unnecessary result parameter from getItemCopy function

The result parameter is not used as an input and is reassigned within the function. Removing it simplifies the function signature.

Modify the function signature:

- const getItemCopy = (props, tour, result) => {
+ const getItemCopy = (props, tour) => {

Adjust the function call:

- const deepCopy = getItemCopy(props, tour, result);
+ const deepCopy = getItemCopy(props, tour);

Remove the unused variable:

- const result = {};

Line range hint 16-16: Simplify the condition checking state.domData

The condition if (state.domData && state.domData !== 0) can be simplified. Since 0 is a falsy value in JavaScript, and state.domData being 0 would already fail the first condition.

Simplify the condition:

- if (state.domData && state.domData !== 0) {
+ if (state.domData) {

Line range hint 22-22: Simplify the condition checking steps.hightBox

The condition if (steps.hightBox && steps.hightBox.length !== 0) can be shortened to improve readability.

Simplify the condition:

- if (steps.hightBox && steps.hightBox.length !== 0) {
+ if (steps.hightBox && steps.hightBox.length) {

Line range hint 128-145: Avoid hardcoding SVG content within the code

Embedding the SVG markup directly in the code increases complexity and can make maintenance difficult. Consider importing the SVG as a module or using an icon library.

Example of importing the SVG:

+ import closeIconSVG from './path/to/closeIcon.svg';

...

- const closeIcon = `<?xml version="1.0" encoding="utf-8"?>
- <!-- SVG content -->
- </svg>`;
+ const closeIcon = closeIconSVG;

...

cancelIcon.innerHTML = closeIcon;
packages/renderless/src/tree-node/index.ts (3)

Line range hint 373-375: Prevent 'NaNpx' in computed indentation

In the computedIndent function, using parseInt on potentially undefined or non-numeric values (tree.indent and tree.baseIndent) may result in NaN, leading to invalid CSS values like 'NaNpx'.

Consider adding default values or validating the inputs to ensure they are valid numbers:

 export const computedIndent =
   () =>
   ({ node, showLine }, { tree }) => {
+    const indent = parseInt(tree.indent) || 0
+    const baseIndent = parseInt(tree.baseIndent) || 0
     return (
-      (node.level > 1 ? 1 : 0) * (parseInt(tree.indent) + (showLine ? 8 : 0)) + parseInt(tree.baseIndent) + 'px'
+      (node.level > 1 ? 1 : 0) * (indent + (showLine ? 8 : 0)) + baseIndent + 'px'
     )
   }

This ensures that if tree.indent or tree.baseIndent are invalid or undefined, they default to 0, preventing NaN in the result.


363-364: Consider centralizing icon definitions

If 'icon-expand' and 'icon-put-away' are standard icons used throughout the project, consider defining them as constants or within a configuration file. This promotes consistency and makes future updates easier.

For example, you can define constants at the top of the file or in a separate icons configuration module:

const DEFAULT_EXPAND_ICON = 'icon-expand';
const DEFAULT_COLLAPSE_ICON = 'icon-put-away';

Then update the code:

 export const computedExpandIcon =
   ({ designConfig }) =>
   (treeRoot, state) => {
     if (state.tree.icon) {
       return state.tree.icon;
     }
     if (treeRoot.showLine) {
-      const expandIcon = designConfig?.icons?.expanded || 'icon-expand';
-      const collapseIcon = designConfig?.icons?.collapse || 'icon-put-away';
+      const expandIcon = designConfig?.icons?.expanded || DEFAULT_EXPAND_ICON;
+      const collapseIcon = designConfig?.icons?.collapse || DEFAULT_COLLAPSE_ICON;
       return state.expanded ? expandIcon : collapseIcon;
     }
     return 'icon-chevron-right';
   }

Line range hint 373-375: Validate inputs to 'parseInt' to avoid unexpected results

Using parseInt without specifying the radix can lead to unexpected results if tree.indent or tree.baseIndent start with 0 (interpreted as octal) or are not numeric strings.

Specify the radix explicitly and ensure the inputs are valid:

 export const computedIndent =
   () =>
   ({ node, showLine }, { tree }) => {
+    const indent = parseInt(tree.indent, 10) || 0;
+    const baseIndent = parseInt(tree.baseIndent, 10) || 0;
     return (
       (node.level > 1 ? 1 : 0) * (indent + (showLine ? 8 : 0)) + baseIndent + 'px'
     );
   }

Alternatively, use Number() for conversion:

 export const computedIndent =
   () =>
   ({ node, showLine }, { tree }) => {
+    const indent = Number(tree.indent) || 0;
+    const baseIndent = Number(tree.baseIndent) || 0;
     return (
       (node.level > 1 ? 1 : 0) * (indent + (showLine ? 8 : 0)) + baseIndent + 'px'
     );
   }
packages/vue/src/select/src/pc.vue (2)

615-625: Organize icon imports for better readability

To improve code readability and maintainability, consider organizing the icon imports alphabetically or grouping them logically based on their usage. This practice makes it easier to locate and manage imports, especially as the list grows.


692-692: Translate comment to English for consistency

The comment // 默认下拉图标 is in Chinese. For consistency and to ensure that all team members and contributors can understand the codebase, please translate the comment to English. For example:

- IconDownWard: iconDownWard(), // 默认下拉图标
+ IconDownWard: iconDownWard(), // default dropdown icon
packages/renderless/src/base-select/index.ts (2)

1699-1699: Use English for code comments to maintain consistency

The comment // tiny 新增: sizeMap适配不同主题 is in Chinese. For consistency and to ensure all team members can understand the codebase, please use English for code comments.


600-600: Use English for code comments to maintain consistency

The comment // tiny 新增的spacing (design中配置:aui为4,smb为0,tiny 默认为0) is in Chinese. To maintain code readability for all contributors, consider translating code comments into English.

packages/renderless/src/select/index.ts (7)

723-723: Translate code comments to English for consistency

The comment on line 723 is written in Chinese. To maintain consistency and readability across the codebase, please translate all comments to English.


Line range hint 1129-1129: Translate code comments to English for consistency

The comment on line 1129 is in Chinese. Kindly translate it into English to ensure clarity for all contributors.


Line range hint 1609-1609: Translate code comments to English for consistency

The comment on line 1609 needs to be translated to English. This helps maintain readability and understanding among all team members.


2018-2018: Translate code comments to English for consistency

The comment on line 2018 is written in Chinese. Please translate it to English for better maintainability.


Line range hint 2060-2060: Translate code comments to English for consistency

The comment on line 2060 is in Chinese. Translating it into English will enhance the code's accessibility to all developers.


2365-2365: Translate code comments to English for consistency

The comment on line 2365 is in Chinese. For consistency and clarity, please translate it into English.


Line range hint 685-685: Translate code comments to English for consistency

The comment on line 685 is written in Chinese. Translating all comments to English helps in maintaining a universally understandable codebase.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 50489a1 and 33be669.

📒 Files selected for processing (68)
  • packages/design/aurora/index.ts (2 hunks)
  • packages/design/aurora/src/alert/index.ts (0 hunks)
  • packages/design/aurora/src/breadcrumb-item/index.ts (1 hunks)
  • packages/design/aurora/src/filter-box/index.ts (1 hunks)
  • packages/design/aurora/src/milestone/index.ts (1 hunks)
  • packages/design/aurora/src/popconfirm/index.ts (1 hunks)
  • packages/design/aurora/src/split/index.ts (1 hunks)
  • packages/design/aurora/src/time-range/index.ts (1 hunks)
  • packages/design/aurora/src/time-spinner/index.ts (1 hunks)
  • packages/design/aurora/src/time/index.ts (1 hunks)
  • packages/design/aurora/src/transfer-panel/index.ts (1 hunks)
  • packages/design/aurora/src/upload-list/index.ts (1 hunks)
  • packages/design/saas/index.ts (2 hunks)
  • packages/design/saas/src/alert/index.ts (0 hunks)
  • packages/design/saas/src/breadcrumb-item/index.ts (1 hunks)
  • packages/design/saas/src/filter-box/index.ts (1 hunks)
  • packages/design/saas/src/guide/index.ts (1 hunks)
  • packages/design/saas/src/milestone/index.ts (1 hunks)
  • packages/design/saas/src/popconfirm/index.ts (1 hunks)
  • packages/design/saas/src/split/index.ts (1 hunks)
  • packages/design/saas/src/time-range/index.ts (1 hunks)
  • packages/design/saas/src/time-spinner/index.ts (1 hunks)
  • packages/design/saas/src/time/index.ts (1 hunks)
  • packages/design/saas/src/transfer-panel/index.ts (1 hunks)
  • packages/design/saas/src/upload-list/index.ts (1 hunks)
  • packages/design/smb/index.ts (1 hunks)
  • packages/design/smb/src/action-menu/index.ts (0 hunks)
  • packages/design/smb/src/alert/index.ts (0 hunks)
  • packages/design/smb/src/dropdown-item/index.ts (0 hunks)
  • packages/design/smb/src/dropdown/index.ts (0 hunks)
  • packages/design/smb/src/filter-box/index.ts (0 hunks)
  • packages/design/smb/src/milestone/index.ts (0 hunks)
  • packages/design/smb/src/popconfirm/index.ts (0 hunks)
  • packages/design/smb/src/select/index.ts (0 hunks)
  • packages/design/smb/src/split/index.ts (0 hunks)
  • packages/design/smb/src/time-spinner/index.ts (0 hunks)
  • packages/design/smb/src/transfer-panel/index.ts (0 hunks)
  • packages/design/smb/src/tree-node/index.ts (0 hunks)
  • packages/design/smb/src/upload-list/index.ts (0 hunks)
  • packages/renderless/src/action-menu/index.ts (1 hunks)
  • packages/renderless/src/base-select/index.ts (2 hunks)
  • packages/renderless/src/breadcrumb-item/vue.ts (1 hunks)
  • packages/renderless/src/drawer/vue.ts (1 hunks)
  • packages/renderless/src/filter-box/vue.ts (1 hunks)
  • packages/renderless/src/guide/index.ts (1 hunks)
  • packages/renderless/src/milestone/index.ts (2 hunks)
  • packages/renderless/src/select/index.ts (3 hunks)
  • packages/renderless/src/split/vue.ts (1 hunks)
  • packages/renderless/src/time-range/vue.ts (1 hunks)
  • packages/renderless/src/time-spinner/index.ts (1 hunks)
  • packages/renderless/src/time/vue.ts (1 hunks)
  • packages/renderless/src/transfer-panel/vue.ts (1 hunks)
  • packages/renderless/src/tree-node/index.ts (1 hunks)
  • packages/renderless/src/upload-list/vue.ts (1 hunks)
  • packages/renderless/types/drawer.type.ts (0 hunks)
  • packages/theme/src/drawer/index.less (0 hunks)
  • packages/theme/src/popconfirm/vars.less (1 hunks)
  • packages/vue/src/alert/src/index.ts (1 hunks)
  • packages/vue/src/alert/src/pc.vue (2 hunks)
  • packages/vue/src/drawer/src/pc.vue (1 hunks)
  • packages/vue/src/dropdown-item/src/index.ts (1 hunks)
  • packages/vue/src/dropdown-item/src/pc.vue (2 hunks)
  • packages/vue/src/dropdown/src/pc.vue (3 hunks)
  • packages/vue/src/filter-box/src/pc.vue (1 hunks)
  • packages/vue/src/popconfirm/src/index.ts (1 hunks)
  • packages/vue/src/popconfirm/src/pc.vue (2 hunks)
  • packages/vue/src/select/src/pc.vue (3 hunks)
  • packages/vue/src/tree/src/tree-node.vue (2 hunks)
💤 Files with no reviewable changes (17)
  • packages/design/aurora/src/alert/index.ts
  • packages/design/saas/src/alert/index.ts
  • packages/design/smb/src/action-menu/index.ts
  • packages/design/smb/src/alert/index.ts
  • packages/design/smb/src/dropdown-item/index.ts
  • packages/design/smb/src/dropdown/index.ts
  • packages/design/smb/src/filter-box/index.ts
  • packages/design/smb/src/milestone/index.ts
  • packages/design/smb/src/popconfirm/index.ts
  • packages/design/smb/src/select/index.ts
  • packages/design/smb/src/split/index.ts
  • packages/design/smb/src/time-spinner/index.ts
  • packages/design/smb/src/transfer-panel/index.ts
  • packages/design/smb/src/tree-node/index.ts
  • packages/design/smb/src/upload-list/index.ts
  • packages/renderless/types/drawer.type.ts
  • packages/theme/src/drawer/index.less
✅ Files skipped from review due to trivial changes (11)
  • packages/design/aurora/src/breadcrumb-item/index.ts
  • packages/design/aurora/src/split/index.ts
  • packages/design/aurora/src/time-spinner/index.ts
  • packages/design/aurora/src/time/index.ts
  • packages/design/saas/src/breadcrumb-item/index.ts
  • packages/design/saas/src/split/index.ts
  • packages/design/saas/src/time-range/index.ts
  • packages/design/saas/src/time-spinner/index.ts
  • packages/design/saas/src/time/index.ts
  • packages/design/saas/src/transfer-panel/index.ts
  • packages/renderless/src/time-spinner/index.ts
🧰 Additional context used
🔇 Additional comments (61)
packages/design/saas/src/guide/index.ts (1)

3-3: Approve addition of isUseModalOverlay, but clarification needed on removed property

The addition of isUseModalOverlay: true looks good and follows proper naming conventions for boolean properties. However, there are a few points to address:

  1. The removal of btnOrderReversed (as mentioned in the AI summary) could potentially be a breaking change. Can you provide more context on why this property was removed and how it affects the component's functionality?

  2. Please ensure that the component's documentation is updated to reflect this change in the API, explaining the new isUseModalOverlay property and removing references to btnOrderReversed.

To ensure that this change doesn't introduce unintended side effects, let's verify the usage of both properties in the codebase:

This will help us identify any places where the old property is still being used or where the new property needs to be implemented.

packages/design/aurora/src/transfer-panel/index.ts (1)

1-4: LGTM: Clear and concise configuration export

The overall structure of this configuration export is clear, concise, and easy to understand. It provides a good foundation for configuring the transfer panel component.

packages/design/smb/index.ts (1)

6-6: LGTM, but please clarify the rationale behind removing all components.

The changes look good from a code perspective, but I have some questions and suggestions:

  1. Could you please explain the reasoning behind removing all the components from this package? Understanding the motivation will help in assessing the overall impact of these changes.

  2. Given that this is a significant change, it would be helpful to update the package documentation to reflect the new structure and purpose of this package.

To ensure that these changes don't unintentionally break existing code, let's verify the impact on the rest of the codebase:

If these searches return results, it might indicate that some parts of the codebase still depend on the removed components, which would require further updates.

Consider the following architectural advice:

  1. If these components have been moved to a different package, ensure that the new location is clearly documented and that any necessary migration guides are provided.
  2. If the components have been deprecated, consider adding deprecation notices or console warnings for any attempted imports to help developers update their code.
  3. Update any relevant documentation or README files to reflect these changes and guide users on how to use the package in its new form.
✅ Verification successful

Verification Successful: No remaining imports or usages of @opentiny/tiny-vue-smb or TinySmb were found in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining imports of the removed components from this package

# Test: Search for imports of removed components from the 'smb' package
rg --type typescript --type vue 'from\s+[\'"]@opentiny\/tiny-vue-smb[\'"]' -A 5

# Test: Search for uses of TinySmb plugin or components
rg --type typescript --type vue 'TinySmb' -A 5

Length of output: 93


Script:

#!/bin/bash
# Description: Check for any remaining imports of the removed components from this package

# Test: Search for imports of removed components from the 'smb' package
rg --type typescript --type vue "from\s+['\"]@opentiny/tiny-vue-smb['\"]" -A 5

# Test: Search for uses of TinySmb plugin or components
rg --type typescript --type vue "TinySmb" -A 5

Length of output: 201


Script:

#!/bin/bash
# Description: Check for any remaining imports of the removed components from this package

# Test: Search for imports of removed components from the 'smb' package
rg -g '*.ts' -g '*.tsx' "from\s+['\"]@opentiny/tiny-vue-smb['\"]" -A 5

# Test: Search for uses of TinySmb plugin or components
rg -g '*.ts' -g '*.tsx' "TinySmb" -A 5

Length of output: 115

packages/design/aurora/src/popconfirm/index.ts (1)

1-1: LGTM: Import statement is correct and follows best practices.

The import statement is well-structured, importing only the necessary iconWarning function from the @opentiny/vue-icon package.

packages/design/saas/src/popconfirm/index.ts (2)

1-1: LGTM: Import statement is correct.

The import of iconWarning from '@opentiny/vue-icon' is properly formatted and appears to be the correct way to import the icon for use in this module.


1-7: Overall assessment: Good start, with room for improvement.

The file successfully exports a configuration object for the Popconfirm component, focusing on icon management. While the current implementation is functional, the suggested improvements (lazy initialization and TypeScript types) would enhance performance and developer experience. These changes align with best practices in modern JavaScript/TypeScript development.

packages/design/saas/src/filter-box/index.ts (3)

1-1: LGTM: Import statement is correct and follows best practices.

The import of iconArrowBottom from '@opentiny/vue-icon' is properly structured and follows naming conventions.


1-7: Overall assessment: Good implementation with room for minor improvements.

This new file introduces a filter box component with an expandable button icon. The implementation is clean and straightforward. Consider the following suggestions for improvement:

  1. Add TypeScript interfaces or type annotations for better type safety.
  2. Reconsider the immediate invocation of iconArrowBottom() for more flexibility and potentially better performance.

These changes will enhance the maintainability and reusability of the component.


5-5: 🛠️ Refactor suggestion

Consider a more flexible approach to icon assignment.

The current implementation immediately invokes iconArrowBottom(). This might lead to unnecessary re-renders and reduces flexibility. Consider passing the icon function instead of its invocation result.

Here's a suggested change:

- expandButton: iconArrowBottom()
+ expandButton: iconArrowBottom

This change allows the parent component to control when the icon is rendered, potentially improving performance and flexibility.

Let's verify the usage of this icon in other parts of the codebase:

✅ Verification successful

Refactor expandButton to Use Icon Function Reference

The verification confirms that iconArrowBottom is consistently invoked immediately across multiple files, including packages/design/saas/src/filter-box/index.ts. Refactoring to pass the icon function instead of its invocation can enhance flexibility and potentially reduce unnecessary re-renders.

Suggested Change:

- expandButton: iconArrowBottom()
+ expandButton: iconArrowBottom

This adjustment allows parent components to manage the rendering of the icon, improving performance and maintainability.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of iconArrowBottom in the codebase

# Test: Search for iconArrowBottom usage
rg --type typescript --type vue 'iconArrowBottom'

# Test: Search for expandButton usage in filter-box related files
fd -e vue -e ts 'filter-box' | xargs rg 'expandButton'

Length of output: 137


Script:

#!/bin/bash
# Description: Check usage of iconArrowBottom in the codebase

# Test: Search for iconArrowBottom usage in TypeScript and Vue files
rg --type ts --type tsx --type vue 'iconArrowBottom'

# Test: Search for expandButton usage in filter-box related files with correct extensions
fd filter-box -e ts -e tsx -e vue | xargs rg 'expandButton'

Length of output: 140


Script:

#!/bin/bash
# Description: Check usage of iconArrowBottom in TypeScript and Vue files using glob patterns

# Test: Search for iconArrowBottom usage in .ts, .tsx, and .vue files
rg 'iconArrowBottom' -g '*.ts' -g '*.tsx' -g '*.vue'

# Test: Search for expandButton usage in filter-box related .ts, .tsx, and .vue files
fd filter-box -g '*.ts' -g '*.tsx' -g '*.vue' | xargs rg 'expandButton'

Length of output: 2437

packages/design/aurora/src/upload-list/index.ts (3)

1-12: LGTM: Well-structured configuration export

The overall structure of this export is clean and well-organized. Separating the configuration into state and icons objects provides a clear distinction between progress-related settings and icon components, which will make it easier to maintain and extend in the future.


2-7: Review state configuration and clarify design choices

The state object configuration looks reasonable, but a few points need clarification:

  1. The progressType is set to 'circle'. Is there a need to support other types of progress indicators?
  2. progressWidth is set to null. Is this intentional, or should it have a default value?
  3. Is the progressStrokeWidth of 6 based on design specifications?
  4. tooltipDisabled is set to true. This might affect user experience. What's the rationale behind disabling tooltips by default?

Consider adding comments to explain these configuration choices, especially if they're based on specific design requirements or user experience considerations.


8-11: Clarify icon component configuration

The icons object configuration raises a few questions:

  1. The closeComponent is set to 'icon-close'. Is this referencing a predefined icon component or CSS class?
  2. The preViewComponent is set to an empty string. Is this intentional, or is it a placeholder for a future implementation?

Consider the following suggestions:

  • Add comments to explain the expected format or usage of these icon components.
  • If preViewComponent is not implemented yet, consider using a TODO comment to indicate future work.

To verify the usage of 'icon-close', we can search for its definition or usage in the codebase:

packages/design/saas/src/upload-list/index.ts (1)

1-12: LGTM: Clean and well-structured export

The overall structure of the export is clean and well-organized. The separation of state and icons provides a clear distinction between different aspects of the component configuration.

packages/renderless/src/filter-box/vue.ts (1)

Line range hint 3-3: LGTM: API export updated correctly

The api array has been updated to include handeClick, which aligns with its import and usage in the renderless function. This change ensures that the exported API is complete and consistent.

packages/renderless/src/breadcrumb-item/vue.ts (1)

33-33: Improved flexibility for breadcrumb separator.

The change enhances the separator property by introducing a chain of fallback values. This modification allows for more customization options while maintaining a sensible default.

Considerations:

  1. The order of precedence (breadcrumb.separator > designConfig?.separator > '/') seems logical.
  2. The use of the optional chaining operator (?.) for designConfig is a good practice to prevent errors if designConfig is undefined.
  3. The default separator has been changed from '>' to '/', which is a common convention for breadcrumbs.

To ensure this change doesn't introduce unexpected behavior, let's verify the usage of separator across the codebase:

✅ Verification successful

Verification of breadcrumb separator change

The change to the separator property in packages/renderless/src/breadcrumb-item/vue.ts has been verified. The implementation uses a fallback mechanism as described in the review comment:

separator: computed(() => breadcrumb.separator || designConfig?.separator || '/')

This change appears to be consistent with the intended behavior and provides more flexibility for customization. However, there are a few points to consider:

  1. The default separator is now '/' instead of '>', which is a common convention for breadcrumbs.

  2. Two design packages (aurora and saas) still use '>' as the default separator. This inconsistency might need to be addressed:

    • ./packages/design/aurora/src/breadcrumb-item/index.ts
    • ./packages/design/saas/src/breadcrumb-item/index.ts
  3. The 'separator' concept is used widely across the codebase, so this change might have a broader impact on other components or features.

While the change itself seems appropriate, it's recommended to:

  1. Update the design packages to use the new default separator for consistency.
  2. Review other components that use separators to ensure they are not affected by this change.
  3. Update any documentation or examples that might reference the old default separator.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any hardcoded separator values that might need updating

# Search for hardcoded '>' separators in Vue files
echo "Checking for hardcoded '>' separators:"
rg --type vue "separator.*?['\"]>['\"]" .

# Search for other separator-related code
echo "Checking for other separator-related code:"
rg --type vue --type typescript "separator" .

Length of output: 337


Script:

#!/bin/bash
# Description: Check for any hardcoded '>' separators in .vue and .ts files

echo "Checking for hardcoded '>' separators in .vue files:"
fd --extension vue --type file --exec rg "separator\s*:\s*computed\(\s*\(\)\s*=>\s*['\"]>['\"]\s*\)" {} +

echo "Checking for hardcoded '>' separators in .ts files:"
fd --extension ts --type file --exec rg "separator\s*:\s*computed\(\s*\(\)\s*=>\s*['\"]>['\"]\s*\)" {} +

Length of output: 334912


Script:

#!/bin/bash
# Description: Search for hardcoded '>' separators and 'separator' references in .vue and .ts files

echo "Searching for hardcoded '>' separators in .vue files:"
find . -name "*.vue" -type f -exec grep -H "separator.*['\"]>['\"]" {} +

echo "Searching for hardcoded '>' separators in .ts files:"
find . -name "*.ts" -type f -exec grep -H "separator.*['\"]>['\"]" {} +

echo "Searching for 'separator' references in .vue files:"
find . -name "*.vue" -type f -exec grep -H "separator" {} +

echo "Searching for 'separator' references in .ts files:"
find . -name "*.ts" -type f -exec grep -H "separator" {} +

Length of output: 20684

packages/design/aurora/index.ts (3)

2-2: New component imports look good!

The new component imports have been added correctly and follow the existing naming convention. This is consistent with the changes mentioned in the AI summary.

Also applies to: 8-8, 10-14, 17-22


37-37: New components correctly added to exports

The newly imported components have been correctly added to the components object in the default export. This ensures they are available for use in the Aurora design system.

Also applies to: 43-43, 45-49, 52-57


Line range hint 1-66: Excellent consistency between imports and exports

There is perfect consistency between the imported components and those listed in the components object. The matching order of imports and exports enhances code readability and maintainability.

packages/design/saas/index.ts (2)

Line range hint 1-68: Overall file structure and consistency look good.

The file maintains consistency between imports and exports for all components, including the newly added ones. This consistency is crucial for maintaining a clean and understandable codebase.

However, please address the previously mentioned issues regarding Pager and Popeditor to ensure full alignment with the intended changes for this pull request.


3-23: New component imports look good, but check Pager and Popeditor usage.

The new component imports (BreadcrumbItem, FilterBox, Guide, Milestone, Popconfirm, Popover, Time, TimeRange, TimeSpinner, TransferPanel, and UploadList) have been correctly added. However, Pager and Popeditor are still imported but reportedly removed from exports.

Let's verify if Pager and Popeditor are still used elsewhere in the codebase:

If these components are not used elsewhere, consider removing their imports to maintain consistency.

packages/vue/src/filter-box/src/pc.vue (6)

Line range hint 1-1: Improved class binding for better flexibility

The class binding for the main div has been enhanced to include conditional classes based on the disabled and blank props. This improvement allows for more dynamic styling of the component.


Line range hint 2-2: Fixed typo in click event handler

The click event handler has been corrected from handeClick to handleClick. This fix resolves a potential bug where the click event would not have been properly handled.


Line range hint 8-8: Improved value rendering logic

The value rendering logic has been updated to correctly handle the case when the value is 0. This change ensures that zero values are displayed properly, fixing a potential display issue.


24-24: Updated icon imports for consistency

The import statements for icons have been updated to use a more consistent naming convention (iconDownWard, iconError, iconHelpCircle). This change aligns with the project's standards and improves code readability.


31-33: Updated icon component declarations

The component declarations for icons have been modified to match the new import names and now use a function call syntax. This change ensures that the component uses the correct icon implementations and follows the project's conventions for icon usage.


Line range hint 1-33: Overall improvements to the FilterBox component

The changes made to this file represent several minor improvements and bug fixes for the FilterBox component:

  1. Enhanced class bindings for more flexible styling
  2. Fixed a typo in the click event handler
  3. Improved value rendering logic to correctly handle zero values
  4. Updated icon imports and declarations for better consistency with project standards

These changes enhance the component's functionality and align it better with the project's conventions. No significant issues or concerns were identified during the review.

packages/vue/src/alert/src/index.ts (1)

20-20: LGTM. Verify new icon and update documentation.

The change from 'icon-warning' to 'icon-warning-triangle' for the warning type alert seems intentional and consistent with the naming convention of other icons in the ICON_MAP.

Please ensure the following:

  1. The 'icon-warning-triangle' exists in the project's icon library.
  2. Update any relevant documentation or design specifications to reflect this icon change for warning alerts.

Run the following script to check for any remaining occurrences of the old icon name:

If any occurrences are found, please review them to determine if they also need to be updated.

✅ Verification successful

Verified: 'icon-warning' has been successfully replaced with 'icon-warning-triangle' in the Alert component.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for occurrences of the old icon name 'icon-warning' in the codebase

# Test: Search for 'icon-warning' in all files. Expect: No occurrences related to alert warnings.
rg --type-not binary 'icon-warning'

Length of output: 66


Script:

#!/bin/bash
# Description: Search for occurrences of the old icon name 'icon-warning' in the codebase, excluding binary files.

# Corrected command to exclude binary files using the --binary flag set to false
rg 'icon-warning' --binary=false

Length of output: 2036

packages/vue/src/dropdown-item/src/index.ts (1)

18-18: Icon update for leftWardArrow: Verify consistency across the project

The icon for leftWardArrow has been updated from 'icon-delta-left' to 'icon-left-ward-arrow'. This change appears to be part of a larger icon standardization effort.

To ensure consistency across the project, please run the following script to check for any remaining instances of 'icon-delta-left' and confirm that this icon update has been applied uniformly:

If any instances of 'icon-delta-left' are found, please update them to maintain consistency. Also, ensure that 'icon-left-ward-arrow' is being used correctly in other components that may reference this icon.

✅ Verification successful

Icon Update Successfully Verified

All instances of 'icon-delta-left' have been removed, and 'icon-left-ward-arrow' is consistently used in packages/vue/src/dropdown-item/src/index.ts. The icon update aligns with project standards and appears fully integrated.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for remaining instances of the old icon name

# Search for 'icon-delta-left' in all files
echo "Searching for 'icon-delta-left':"
rg --type-add 'vue:*.vue' --type-add 'ts:*.ts' --type vue --type ts 'icon-delta-left'

# Search for 'icon-left-ward-arrow' to confirm new usage
echo "Confirming usage of 'icon-left-ward-arrow':"
rg --type-add 'vue:*.vue' --type-add 'ts:*.ts' --type vue --type ts 'icon-left-ward-arrow'

Length of output: 446

packages/renderless/src/action-menu/index.ts (1)

37-37: Verify the impact of the default spacing change.

The default spacing for the action menu has been increased from 5px to 8px. While this change is relatively minor, it could affect the component's appearance and layout in its default state.

Consider the following:

  1. Ensure this change aligns with the overall design system guidelines.
  2. Verify that this doesn't negatively impact existing layouts, especially in tight spaces.
  3. Update any related documentation or design specs to reflect this change.

To help verify the impact, you can run the following script to find other occurrences of the previous 5px spacing in action menu related files:

✅ Verification successful

Default spacing change verified with no additional '5px' usages found.
The update from '5px' to '8px' is isolated to the specified line, ensuring consistent spacing without impacting other components or layouts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for '5px' in action-menu related files
rg --type typescript --type vue '5px' packages/renderless/src/action-menu packages/vue/src/action-menu

Length of output: 137


Script:

#!/bin/bash
# Search for '5px' in .ts and .vue files within action-menu related directories
rg '5px' --glob '**/*.ts' --glob '**/*.vue' packages/renderless/src/action-menu packages/vue/src/action-menu

Length of output: 108

packages/renderless/src/time-range/vue.ts (2)

74-74: Improved fallback behavior for showTimePickerRangeButton

This change enhances the robustness of the showTimePickerRangeButton initialization. By using the nullish coalescing operator (??), it ensures that the button is shown by default (set to true) when not explicitly configured in designConfig. This approach maintains backwards compatibility while providing a clear default behavior.


74-74: Review similar patterns in the codebase

This change introduces a pattern of providing default values for design config properties. It might be worthwhile to review other components in the codebase to see if they could benefit from similar improvements, ensuring consistent behavior across the library.

To identify similar patterns that might benefit from this improvement, you can run the following script:

This script will search for instances where design config properties are assigned without providing default values, which might be candidates for similar improvements.

✅ Verification successful

Adjusting the Search Script for Correct File Types

To successfully search for similar patterns, please run the updated script below:


Refining the Search Script with Explicit File Extensions

To effectively search for similar patterns, please run the updated script below:


No Similar Patterns Found in the Codebase

No additional instances of design config properties without default values were found. The current implementation maintains consistent behavior across the library.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar patterns in the codebase
echo "Searching for similar patterns in the codebase..."
rg --type typescript --type vue 'designConfig\?\.(\w+)\s*=\s*designConfig\?\.(\w+)' -g '!**/node_modules/**'

Length of output: 254


Script:

# 
#!/bin/bash
# Search for similar patterns in the codebase with correct file types
echo "Searching for similar patterns in the codebase..."
rg 'designConfig\?\.(\w+)\s*=\s*designConfig\?\.(\w+)' -e ts -e vue -g '!**/node_modules/**'

Length of output: 293


Script:

# 
#!/bin/bash
# Search for similar patterns in the codebase with explicit file extensions
echo "Searching for similar patterns in the codebase..."
rg 'designConfig\?\.(\w+)\s*=\s*designConfig\?\.(\w+)' -g '*.ts' -g '*.vue' -g '!**/node_modules/**'

Length of output: 211

packages/vue/src/popconfirm/src/pc.vue (2)

58-58: LGTM. Verify visual consistency.

The icon import has been updated from iconWarning to iconWarningTriangle. This change is consistent with the intended modifications mentioned in the summary.

Please ensure that the new iconWarningTriangle visually aligns with the component's design and doesn't introduce any unexpected UI changes. You may want to check this in different themes if applicable.


68-68: LGTM. Verify icon usage in template.

The component declaration has been correctly updated to use IconWarningTriangle: iconWarningTriangle(), which aligns with the import change.

To ensure the change is fully implemented, please verify that all instances of IconWarning in the template have been updated to IconWarningTriangle. You can use the following command to check for any remaining occurrences:

If this command returns any results, those occurrences should be updated to IconWarningTriangle.

✅ Verification successful

All instances of IconWarning have been successfully replaced with IconWarningTriangle in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of IconWarning in the template

# Test: Search for IconWarning in the template section
rg --type vue '<IconWarning' packages/vue/src/popconfirm/src/pc.vue

Length of output: 97


Script:

#!/bin/bash
# Description: Check for any remaining instances of IconWarning in the template without specifying file type

# Test: Search for IconWarning in the template section of pc.vue
rg '<IconWarning' packages/vue/src/popconfirm/src/pc.vue

Length of output: 58


Script:

#!/bin/bash
# Description: Recursively check for any remaining instances of IconWarning in all .vue files

# Test: Search for <IconWarning in all .vue files within the repository
rg '<IconWarning' --type vue

Length of output: 58


Script:

#!/bin/bash
# Description: Recursively check for any remaining instances of IconWarning in all .vue files using glob

# Test: Search for <IconWarning in all .vue files within the repository
rg '<IconWarning' --glob '*.vue'

Length of output: 34

packages/renderless/src/split/vue.ts (1)

54-54: Approve change with suggestions for improvement

The modification to triggerBarConWithLine is an improvement. It simplifies the logic and provides more flexibility by allowing false as a valid input from designConfig.

However, consider the following suggestions:

  1. Update the comment to include an English translation for better maintainability. For example: "SMB style: the drag block is a line / SMB 风格的拖动块是线条"
  2. Verify that this change aligns with the expected behavior in all scenarios, especially when designConfig?.triggerBarConWithLine is explicitly set to false.

To verify the usage and impact of this change, you can run the following script:

This script will help identify any potential impacts on other parts of the codebase and ensure that the change is consistent with the overall design and usage of the Split component.

packages/vue/src/dropdown-item/src/pc.vue (3)

106-106: Verify icon rendering and conduct visual testing

The component has been updated from IconDeltaLeft to IconLeftWardArrow, which is consistent with the import change.

To ensure the new icon is properly integrated, please:

  1. Visually inspect the rendered component to confirm the new icon appears correctly.
  2. Run any existing visual regression tests.
  3. If no visual tests exist, consider adding them to catch any future unintended changes.

Update any component screenshots or visual documentation to reflect this icon change.


Line range hint 1-114: Overall review summary

The changes to this component include updating the icon import and usage, adding new props for enhanced configurability, and updating the component registration. These modifications appear to be part of a larger update to the icon system and component functionality.

Key points:

  1. The icon has been changed from IconDeltaLeft to IconLeftWardArrow.
  2. New props have been added: appendToBody, textField, tip, tipPosition, and effect.

Recommendations:

  1. Ensure all references to the old icon have been updated throughout the codebase.
  2. Verify that the new props are properly utilized within the component.
  3. Update the component's documentation to reflect these changes, including usage examples for the new props.
  4. Conduct thorough testing, including visual regression tests, to ensure the changes don't introduce any unintended side effects.

The changes look good overall, pending the verifications and documentation updates suggested in the individual comments.


Line range hint 95-99: Verify usage of new props and update documentation

New props have been added: appendToBody, textField, tip, tipPosition, and effect. These additions enhance the component's configurability.

Run the following script to check the usage of these new props within the component:

#!/bin/bash
# Description: Check usage of new props in the component

# Test: Search for usage of new props
ast-grep --lang vue --pattern 'v-bind:$prop="$_" | :$prop="$_" | $prop="$_"' | rg -e 'appendToBody|textField|tip|tipPosition|effect'

Ensure that these new props are properly documented in the component's API documentation. Consider adding examples of their usage in the component's documentation or README.

packages/renderless/src/upload-list/vue.ts (5)

76-76: LGTM: Default progressType set appropriately

The change provides a sensible default ('line') for progressType while still allowing for configuration through designConfig. The use of optional chaining is a good practice for safely accessing nested properties.


81-81: LGTM: Default progressStrokeWidth set appropriately

The change provides a sensible default (4) for progressStrokeWidth while still allowing for configuration through designConfig. The use of optional chaining is a good practice for safely accessing nested properties.


82-82: LGTM: tooltipDisabled default set with nullish coalescing

The use of the nullish coalescing operator (??) for tooltipDisabled is an excellent choice. It provides a default value of false while still allowing for configuration through designConfig. This approach handles undefined values appropriately and improves code readability.


83-83: Verify the icon change for closeComponent

The default icon for closeComponent has been changed from 'icon-close' to 'icon-del'. While this change is implemented correctly, it's important to ensure that this icon change aligns with the intended design and user experience.

Please confirm that the 'icon-del' icon is the intended replacement for 'icon-close' in this context. You may want to check with the design team or review any related design documents to ensure this change is intentional and consistent with the overall UI design.


76-87: Ensure thorough testing of visual changes

The changes in this file improve the configurability of the upload list component by providing sensible defaults for various properties. However, these changes may result in visual differences, particularly:

  1. Progress bar appearance (type changed to 'line', width set to '68', stroke width to 4)
  2. Icon changes ('icon-del' for close, 'icon-fullscreen-left' for preview)

Please ensure that these changes are thoroughly tested across different scenarios and device sizes. Verify that the new defaults align with the intended design and user experience. Consider the following:

  1. Test the component with and without custom designConfig to ensure it behaves correctly in both scenarios.
  2. Verify the visual appearance of the progress bar with the new default settings.
  3. Check that the new icons are displayed correctly and convey the right meaning to users.
  4. Test on different screen sizes to ensure the new default progressWidth of '68' works well across devices.

It may be helpful to provide before/after screenshots to the PR for easier visual comparison.

packages/vue/src/drawer/src/pc.vue (1)

101-106: Consider the implications of changing the button order.

The order of the cancel and confirm buttons has been switched. While this change doesn't affect functionality, it may impact user experience and expectations.

  1. Consistency: Ensure this new order aligns with other components in your design system and follows your UI/UX guidelines.
  2. User Expectations: Consider whether users are accustomed to a specific button order in your application.
  3. Accessibility: Verify that this change doesn't negatively impact keyboard navigation or screen reader users.

To ensure consistency across the codebase, run the following script:

This will help identify the prevalent button order in your codebase and ensure consistency.

packages/vue/src/dropdown/src/pc.vue (5)

119-119: LGTM! Consistent icon usage.

The update to use iconDownWard as the fallback option for IconDown is consistent with the import changes and maintains the existing component behavior.


120-120: LGTM! Consistent icon usage for button.

The update to use iconDownWard for ButtonIconDown is consistent with the previous changes and maintains the existing component behavior.


171-173: LGTM! Improved readability.

The reformatting of the class binding improves code readability without changing functionality. This change aligns with best practices for maintaining clean and easily readable code.


181-183: LGTM! Consistent formatting improvement.

The reformatting of the class binding for the span element is consistent with the previous formatting changes and improves code readability without altering functionality.


Line range hint 1-205: Summary: Icon update and code formatting improvements.

The changes in this file primarily focus on updating the icon usage from iconDeltaDown to iconDownWard and improving code formatting. These modifications:

  1. Maintain consistent icon usage throughout the component.
  2. Improve code readability through better formatting of class bindings.
  3. Do not introduce any functional changes or potential issues.

Overall, these changes enhance the code quality without altering the component's behavior.

packages/design/aurora/src/milestone/index.ts (1)

9-9: ⚠️ Potential issue

Ensure status is a valid hex color before conversion.

If status is not a valid hex color code, api.hexToRgb(status) may throw an error or return unexpected results. Consider adding validation or default handling to ensure status is a valid hex color before converting it.

Here's a script to verify that all possible status values are valid hex color codes:

packages/design/saas/src/milestone/index.ts (1)

15-15: Verify that constants.BOX_SHADOW_PX is defined and valid

Ensure that constants.BOX_SHADOW_PX is defined and contains a valid CSS value for use in the boxShadow property. An undefined or incorrect value could lead to styling issues.

packages/renderless/src/guide/index.ts (3)

84-84: Ensure useModalOverlay handles undefined designConfig gracefully

The line useModalOverlay: designConfig?.state?.isUseModalOverlay ?? false, uses optional chaining and the nullish coalescing operator to set a default value. This is a good practice to prevent runtime errors if designConfig or its nested properties are undefined.


Line range hint 147-147: Avoid setting innerHTML directly to minimize XSS risks

Directly assigning HTML content using innerHTML can introduce security vulnerabilities. Even if the content is static, it's safer to manipulate DOM elements using methods like createElement and appendChild.

Ensure that closeIcon cannot be modified by external input.


84-84: Confirm the correct default value for useModalOverlay

Using designConfig?.state?.isUseModalOverlay ?? false sets useModalOverlay to false when isUseModalOverlay is undefined or null. Verify that this aligns with the intended default behavior.

If the default should be true, adjust the code accordingly.

packages/renderless/src/tree-node/index.ts (1)

363-364: Ensure default icons are defined and consistent

The default icons 'icon-expand' and 'icon-put-away' are used when designConfig?.icons?.expanded or designConfig?.icons?.collapse are not provided. Verify that these default icon names are correctly defined in your icon assets and follow the project's naming conventions.

You can run the following script to check if the default icons are available:

packages/vue/src/tree/src/tree-node.vue (2)

250-252: New icon imports are correctly added

The icons iconFinish, iconExpand, and iconPutAway have been successfully imported from @opentiny/vue-icon. This ensures that they are available for use within the component.


338-339: Icon components registered appropriately

The components IconExpand and IconPutAway have been correctly registered in the components section using their respective functions. This allows the icons to be utilized within the template as needed.

packages/renderless/src/base-select/index.ts (2)

600-600: Use updated initial input height prioritization

The assignment of sizeInMap now prioritizes designConfig?.state.initialInputHeight, then state.initialInputHeight, and defaults to 32 if neither is available. This ensures that the input height adapts correctly based on the design configuration.


1699-1699: Verify size values in defaultSizeMap for accuracy

The defaultSizeMap is defined as { default: 32, mini: 24, small: 36, medium: 40 }. Please verify that the size values accurately reflect the intended design, especially since small (36) is larger than default (32). If small is meant to be smaller than default, consider adjusting the values accordingly.

packages/renderless/src/select/index.ts (3)

721-724: Update default sizing values

The adjustments to sizeInMap and spacingHeight correctly integrate design configurations with default values. The use of optional chaining (?.) and nullish coalescing (??) operators is appropriate and enhances the robustness of the code.


2019-2020: Set default size map for theme adaptation

The defaultSizeMap is appropriately defined to adapt to different themes. Assigning sizeMap using designConfig?.state?.sizeMap || defaultSizeMap ensures that custom configurations are prioritized over defaults.


2365-2366: Utilize design configuration for dropdown icon

The code correctly integrates designConfig?.icons.dropdownIcon with a fallback to 'icon-down-ward'. This approach ensures that custom icons are used when available, while maintaining a default option.

Comment on lines +1 to +4
export default {
inputBoxType: 'normal',
showInputSearch: false
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider adding TypeScript interface for better type safety

The exported configuration object is clear and concise. However, to improve type safety and provide better intellisense for consumers of this module, consider defining a TypeScript interface for the configuration object.

Here's a suggested implementation:

interface TransferPanelConfig {
  inputBoxType: 'normal' | string; // Add other possible values if any
  showInputSearch: boolean;
}

const config: TransferPanelConfig = {
  inputBoxType: 'normal',
  showInputSearch: false
};

export default config;

This change will provide better type checking and autocompletion for users of this module.

@@ -1,4 +1,4 @@
export default {
// 控制time-picker组件时间范围button显示和样式
showTimePickerRangeButton: true
showTimePickerRangeButton: false
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Potential Missing Tests for showTimePickerRangeButton Change

The showTimePickerRangeButton property has been modified from true to false and is referenced in multiple parts of the codebase. However, there are no associated tests to validate this change, which may lead to unintended side effects.

Recommendations:

  • Add Tests: Implement tests to ensure that disabling the time picker range button behaves as expected across all impacted components.
  • Document Rationale: Provide comments or documentation explaining why this change was made to aid future maintenance and understanding.
  • Review Recent Commits: Examine recent changes to ensure this update aligns with overall project goals and does not introduce regressions.
🔗 Analysis chain

Verify the intentionality and impact of disabling the time picker range button.

The showTimePickerRangeButton property has been changed from true to false. This change will hide the time picker range button, which could significantly affect the component's functionality and user experience.

Please confirm:

  1. Is this change intentional?
  2. Have you considered the impact on existing implementations using this component?
  3. Does this change require updates to the component's documentation or usage guidelines?

Additionally, consider adding a comment explaining the rationale behind this change to provide context for future developers.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of showTimePickerRangeButton in the codebase

# Test: Search for references to showTimePickerRangeButton
echo "Searching for references to showTimePickerRangeButton:"
rg --type typescript --type vue 'showTimePickerRangeButton'

# Test: Check if there are any tests related to this property
echo "Checking for related tests:"
rg --type typescript --type vue 'showTimePickerRangeButton' -g '*test*'

# Test: Look for recent changes to files mentioning this property
echo "Checking for recent changes to related files:"
git log -n 5 --pretty=format:"%h - %an, %ar : %s" -- $(rg --files-with-matches 'showTimePickerRangeButton')

Length of output: 1201


Script:

#!/bin/bash
# Description: Check for usage of showTimePickerRangeButton in the codebase

# Test: Search for references to showTimePickerRangeButton in .ts and .vue files
echo "Searching for references to showTimePickerRangeButton in .ts and .vue files:"
rg 'showTimePickerRangeButton' --glob '*.ts' --glob '*.vue'

# Test: Check if there are any tests related to this property
echo "Checking for related tests in .test.ts and .spec.ts files:"
rg 'showTimePickerRangeButton' --glob '*.{test,spec}.ts'

# Test: Look for recent changes to files mentioning this property
echo "Checking for recent changes to related files:"
files=$(rg 'showTimePickerRangeButton' --files-with-matches --glob '*.ts' --glob '*.vue')
if [ -n "$files" ]; then
  git log -n 5 --pretty=format:"%h - %an, %ar : %s" -- $files
else
  echo "No files found with showTimePickerRangeButton references."
fi

Length of output: 2311

Comment on lines +4 to +6
icons: {
warning: iconWarning()
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider performance and future extensibility of icons.

The current implementation dynamically creates the warning icon. While this works, it might have performance implications if the iconWarning() function is called frequently. Additionally, the current structure might be limiting if more icons need to be added in the future.

Consider the following suggestions:

  1. If the icon doesn't need to be dynamic, create it once and export the result:

    const warningIcon = iconWarning();
    
    export default {
      icons: {
        warning: warningIcon
      }
    };
  2. For better extensibility, consider using a more flexible structure:

    import { iconWarning, iconInfo, iconError } from '@opentiny/vue-icon';
    
    const createIcon = (iconFn: () => any) => iconFn();
    
    export default {
      icons: {
        warning: createIcon(iconWarning),
        info: createIcon(iconInfo),
        error: createIcon(iconError),
        // Easy to add more icons in the future
      }
    };

Comment on lines +3 to +7
export default {
icons: {
warning: iconWarning()
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider lazy initialization and add type information.

The current implementation initializes the warning icon immediately when the module is imported. Consider the following suggestions:

  1. Lazy initialization: This could improve performance if the icon isn't always used.
  2. Add TypeScript type information: This would enhance type safety and developer experience.

Here's a suggested implementation incorporating these changes:

import { iconWarning } from '@opentiny/vue-icon'

interface Icons {
  warning: ReturnType<typeof iconWarning>
}

interface PopconfirmConfig {
  icons: {
    warning: () => Icons['warning']
  }
}

const config: PopconfirmConfig = {
  icons: {
    warning: () => iconWarning()
  }
}

export default config

This approach lazily initializes the icon and provides type information. The warning property is now a function that returns the icon, ensuring it's only created when needed.


export default {
icons: {
expandButton: iconArrowBottom()
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider lazy initialization of the icon.

The iconArrowBottom function is being called immediately when the module is imported. This might not be necessary if the icon is not always used. Consider lazy initialization to potentially improve performance.

You could modify the code to use a getter or a function that returns the icon:

import { iconArrowBottom } from '@opentiny/vue-icon'

export default {
  icons: {
    get expandButton() {
      return iconArrowBottom()
    }
  }
}

This way, the icon is only created when it's actually accessed.

Comment on lines +118 to +121
background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR,
boxShadow: 'unset'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct style value concatenation in the DEFAULT case

Similarly, adjust the operator precedence in the DEFAULT case to ensure '!important' is appended.

Apply this diff:

-          background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
-          color: statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR + '!important',
-          'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR,
+          background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
+          color: (statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR) + '!important',
+          'border-color': (statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR) + '!important',
📝 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
background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR,
boxShadow: 'unset'
background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
color: (statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR) + '!important',
'border-color': (statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR) + '!important',
boxShadow: 'unset'

Comment on lines +108 to +115
if (status === constants.STATUS_MAP.COMPLETED) {
return {
'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR,
boxShadow: 'unset'
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Apply operator precedence correction in the COMPLETED status block

As with the previous comment, ensure '!important' is appended correctly in the COMPLETED status block by adjusting the operator precedence.

Apply this diff:

-            'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
-            color: statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR + '!important',
-            'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR,
+            'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
+            color: (statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR) + '!important',
+            'border-color': (statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR) + '!important',
📝 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
if (status === constants.STATUS_MAP.COMPLETED) {
return {
'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR,
boxShadow: 'unset'
}
}
if (status === constants.STATUS_MAP.COMPLETED) {
return {
'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
color: (statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR) + '!important',
'border-color': (statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR) + '!important',
boxShadow: 'unset'
}
}

Comment on lines +99 to +106
if (props.solid || status === constants.STATUS_MAP.DOING) {
return {
'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
boxShadow: 'unset'
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure '!important' is appended correctly to style values

Due to operator precedence, '!important' may not be appended when statusColor is truthy. To guarantee '!important' is always included, wrap the conditional expressions in parentheses.

Apply this diff to fix the operator precedence:

-          'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
+          'background-color': (statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR) + '!important',
-          'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
+          'border-color': (statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR) + '!important',

Repeat similar adjustments in the subsequent return statements to ensure consistency.

📝 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
if (props.solid || status === constants.STATUS_MAP.DOING) {
return {
'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
boxShadow: 'unset'
}
}
if (props.solid || status === constants.STATUS_MAP.DOING) {
return {
'background-color': (statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR) + '!important',
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
'border-color': (statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR) + '!important',
boxShadow: 'unset'
}
}

Comment on lines +70 to +94
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider moving smbConstants outside the getMileIcon function for optimization

The smbConstants object is defined inside the getMileIcon function, which means it's recreated every time the function is called. To improve performance, consider moving it outside the function so it's defined only once.

Apply this diff to move smbConstants outside the function:

+const smbConstants = {
+  STATUS_COLOR_MAP: {
+    DEFAULT: {
+      BORDER_COLOR: '#C2C2C2',
+      BACKGROUND_COLOR: '#FFFFFF',
+      COLOR: '#191919',
+      BOX_SHADOW_PX: '0px 0px 0px 4px',
+      FLAG_CONTENT_CLS: '.content'
+    },
+    COMPLETED: {
+      BORDER_COLOR: '#191919',
+      BACKGROUND_COLOR: '#FFFFFF',
+      COLOR: '#191919',
+      BOX_SHADOW_PX: '0px 0px 0px 4px',
+      FLAG_CONTENT_CLS: '.content'
+    },
+    DOING: {
+      BORDER_COLOR: '#191919',
+      BACKGROUND_COLOR: '#191919',
+      COLOR: '#FFFFFF',
+      BOX_SHADOW_PX: '0px 0px 0px 4px',
+      FLAG_CONTENT_CLS: '.content'
+    }
+  }
+};
+
 export const getMileIcon =
   ({ constants, props }: Pick<IMilestoneRenderlessParams, 'constants' | 'props'>) =>
   (node: IMilestoneNode): IMilestoneIconStyle => {
-    const smbConstants = {
-      STATUS_COLOR_MAP: {
-        DEFAULT: {
-          BORDER_COLOR: '#C2C2C2',
-          BACKGROUND_COLOR: '#FFFFFF',
-          COLOR: '#191919',
-          BOX_SHADOW_PX: '0px 0px 0px 4px',
-          FLAG_CONTENT_CLS: '.content'
-        },
-        COMPLETED: {
-          BORDER_COLOR: '#191919',
-          BACKGROUND_COLOR: '#FFFFFF',
-          COLOR: '#191919',
-          BOX_SHADOW_PX: '0px 0px 0px 4px',
-          FLAG_CONTENT_CLS: '.content'
-        },
-        DOING: {
-          BORDER_COLOR: '#191919',
-          BACKGROUND_COLOR: '#191919',
-          COLOR: '#FFFFFF',
-          BOX_SHADOW_PX: '0px 0px 0px 4px',
-          FLAG_CONTENT_CLS: '.content'
-        }
-      }
-    };
     const status = node[props.statusField];
     // Rest of the function...
📝 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
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
}
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
};
export const getMileIcon =
({ constants, props }: Pick<IMilestoneRenderlessParams, 'constants' | 'props'>) =>
(node: IMilestoneNode): IMilestoneIconStyle => {
const status = node[props.statusField];
// Rest of the function...

Comment on lines +53 to +54
? state.selectedLabel
: ''
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider displaying state.selectedLabel in the title for single-select when enabled

Currently, the :title attribute in the tagsGroup div displays state.selectedLabel only when the select is disabled and not multiple (!multiple && state.selectDisabled). To enhance user experience by providing a tooltip with the selected value, consider displaying state.selectedLabel even when the select is enabled and not multiple.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 17

🧹 Outside diff range and nitpick comments (29)
packages/design/aurora/src/popconfirm/index.ts (1)

3-7: LGTM: Well-structured export for the Popconfirm component icons.

The default export provides a clean structure for accessing the warning icon within the Popconfirm component. This approach allows for easy extension if more icons are needed in the future.

However, consider the following suggestions for potential improvements:

  1. You might want to add a brief comment explaining the purpose of this file and how it's used in the Popconfirm component.
  2. Consider using a named export instead of a default export for better tree-shaking and explicit imports.

Here's an example of how you could implement these suggestions:

 import { iconWarning } from '@opentiny/vue-icon'

-export default {
+// Icons used in the Popconfirm component
+export const PopconfirmIcons = {
   icons: {
     warning: iconWarning()
   }
 }

This change would require updating the import statements where this file is used, but it could lead to more explicit and maintainable code.

packages/design/aurora/src/filter-box/index.ts (1)

3-7: Consider using a more descriptive name for the exported object.

The current export is good, but we could improve it by giving the object a more descriptive name. This would enhance code readability and make it clear what this configuration is for.

Here's a suggested improvement:

-export default {
+export default {
+  name: 'filterBoxConfig',
   icons: {
     expandButton: iconArrowBottom()
   }
 }

This change adds a name property to the exported object, making it clearer that this configuration is specifically for the filter box component.

packages/design/saas/src/filter-box/index.ts (1)

1-7: Consider adding documentation for better maintainability.

While the code is concise and clear, adding a brief comment or documentation block at the beginning of the file would improve maintainability. This could include:

  • A description of the file's purpose
  • How it fits into the larger filter-box component structure
  • Any important usage notes for other developers

Here's an example of what you could add at the beginning of the file:

/**
 * Filter Box Icon Configuration
 * 
 * This file exports the icon configuration for the Filter Box component.
 * It defines the expandButton icon used in the component's UI.
 * 
 * @module FilterBoxIcons
 */
packages/design/aurora/src/upload-list/index.ts (2)

2-7: Consider the default values in the state object

The state object provides a good starting point for configuring the upload list component. However, there are a few points to consider:

  1. The progressWidth is set to null. Ensure this is intentional and doesn't cause any rendering issues. If it's meant to be set dynamically, consider adding a comment explaining this.

  2. tooltipDisabled is set to true by default. This might affect accessibility. Consider enabling tooltips by default unless there's a specific reason not to.

  3. The progressStrokeWidth of 6 seems reasonable, but verify that it aligns with your design system guidelines.

Consider adding comments to explain the purpose of each property, especially for progressWidth and tooltipDisabled, to improve maintainability.


8-11: Clarify the usage of icon components

The icons object provides configuration for close and preview components. However, there are some points that need clarification:

  1. The closeComponent is set to 'icon-close'. Ensure that this string corresponds to a valid icon component or CSS class in your design system.

  2. The preViewComponent is set to an empty string. This might lead to confusion or errors if the component expects a valid value. Consider one of the following options:

    • If preview functionality is not implemented yet, use null or add a TODO comment.
    • If it's meant to be set by the user, consider adding a comment explaining this.
    • If there's a default preview icon, set it here for consistency with closeComponent.

Add comments to explain the expected values and usage of these icon components to improve clarity for other developers.

packages/design/saas/src/upload-list/index.ts (2)

2-7: LGTM! Consider adding documentation for clarity.

The state object is well-structured with clear property names. However, to enhance maintainability and ease of use, consider adding JSDoc comments to explain the purpose and possible values for each property, especially for progressWidth which is set to null.

Example documentation:

state: {
  /** Type of progress indicator. Possible values: 'circle', 'line' */
  progressType: 'circle',
  /** Width of the progress indicator. Set to null for default size */
  progressWidth: null,
  /** Thickness of the progress indicator stroke */
  progressStrokeWidth: 6,
  /** Whether tooltips are disabled */
  tooltipDisabled: true
}

1-12: Overall structure looks good. Consider type definitions for improved maintainability.

The file structure is clean and well-organized, exporting a configuration object for what appears to be an upload list component. The separation of state and icons provides a clear distinction between different aspects of the component.

To further improve maintainability and type safety, consider defining TypeScript interfaces for the exported object and its nested objects. This would provide better IntelliSense support and catch potential type-related errors early. Here's an example:

interface UploadListState {
  progressType: 'circle' | 'line';
  progressWidth: number | null;
  progressStrokeWidth: number;
  tooltipDisabled: boolean;
}

interface UploadListIcons {
  closeComponent: string;
  preViewComponent: string;
}

interface UploadListConfig {
  state: UploadListState;
  icons: UploadListIcons;
}

const config: UploadListConfig = {
  state: {
    progressType: 'circle',
    progressWidth: null,
    progressStrokeWidth: 6,
    tooltipDisabled: true
  },
  icons: {
    closeComponent: 'icon-close',
    preViewComponent: ''
  }
};

export default config;

This approach would provide better type checking and documentation for the configuration object.

packages/renderless/src/filter-box/vue.ts (2)

Line range hint 1-1: Correct the spelling of handeClick to handleClick.

The method name handeClick appears to be misspelled. It should be handleClick. Please update the spelling in both the import statement and the api array.

Apply this diff to fix the spelling:

-import { handleClear, handeClick } from './index'
+import { handleClear, handleClick } from './index'

-export const api = ['state', 'handleClear', 'focus', 'blur', 'handeClick']
+export const api = ['state', 'handleClear', 'focus', 'blur', 'handleClick']

Also applies to: 3-3


Line range hint 15-15: Correct the spelling of handeClick to handleClick in the Object.assign call.

The method name handeClick is misspelled in the Object.assign call. It should be handleClick.

Apply this diff to fix the spelling:

-    handeClick: handeClick({ props, emit })
+    handleClick: handleClick({ props, emit })
packages/design/aurora/src/milestone/index.ts (2)

1-3: LGTM! Consider adding TypeScript types for improved clarity.

The structure of the renderless component is well-organized and follows good practices. To further enhance code quality and maintainability, consider adding TypeScript type annotations for the function parameters and return type.

Here's a suggested improvement:

interface RenderlessProps {
  // Define prop types here
}

interface RenderlessHooks {
  // Define hook types here
}

interface RenderlessConstants {
  // Define constant types here
}

interface RenderlessAPI {
  // Define API types here
}

export default {
  renderless: (
    props: RenderlessProps,
    hooks: RenderlessHooks,
    { constants }: { constants: RenderlessConstants },
    api: RenderlessAPI
  ): { getMileIcon: (node: any) => any; getFlagStyle: (params: { index: number; idx: number }) => any } => {
    // ... existing code ...
  }
}

4-16: Good implementation. Consider removing !important from styles.

The getMileIcon method is well-implemented, with clear logic for determining milestone status and generating appropriate styles. However, the use of !important in CSS styles should be avoided when possible, as it can lead to specificity issues and make styles harder to maintain.

Consider refactoring to remove !important:

getMileIcon: (node) => {
  const status = props.milestonesStatus[node[props.statusField]] || constants.DEFAULT_COLOR
  const isCompleted = node[props.statusField] === props.completedField
  const switchColor = isCompleted && !props.solid
  const { r, g, b } = api.hexToRgb(status)

  return {
    background: switchColor ? constants.DEFAULT_BACK_COLOR : status,
    color: switchColor ? status : constants.DEFAULT_BACK_COLOR,
    boxShadow: `rgba(${r},${g},${b},.4) ${constants.BOX_SHADOW_PX}`
  }
}

If !important is necessary due to specificity issues, consider addressing those issues in your CSS architecture instead.

packages/renderless/src/breadcrumb-item/vue.ts (1)

33-33: Approved: Improved flexibility for separator configuration.

The change enhances the component's flexibility by allowing the separator to be configured from multiple sources. This is a good improvement that maintains backwards compatibility while providing new customization options.

Consider adding a comment to explain the precedence of separator sources for better maintainability:

separator: computed(() => 
  // Precedence: 1. breadcrumb.separator, 2. designConfig.separator, 3. Default '/'
  breadcrumb.separator || designConfig?.separator || '/'
)
packages/design/saas/index.ts (2)

3-3: New component imports added successfully.

The new component imports have been added correctly. However, to improve maintainability, consider reorganizing all imports in alphabetical order.

Consider applying this change to reorganize the imports:

import Alert from './src/alert'
import Badge from './src/badge'
+import BreadcrumbItem from './src/breadcrumb-item'
import CollapseItem from './src/collapse-item'
+import DatePanel from './src/date-panel'
+import DateRange from './src/date-range'
+import DialogBox from './src/dialog-box'
import Drawer from './src/drawer'
import Dropdown from './src/dropdown'
import DropdownItem from './src/dropdown-item'
import DropdownMenu from './src/dropdown-menu'
+import FilterBox from './src/filter-box'
import Form from './src/form'
+import Grid from './src/grid'
+import Guide from './src/guide'
+import Input from './src/input'
+import Loading from './src/loading'
+import Milestone from './src/milestone'
+import Popconfirm from './src/popconfirm'
+import Popover from './src/popover'
import Select from './src/select'
+import Split from './src/split'
import Switch from './src/switch'
+import Time from './src/time'
+import TimeRange from './src/time-range'
+import TimeSpinner from './src/time-spinner'
+import TransferPanel from './src/transfer-panel'
+import UploadList from './src/upload-list'
-import Loading from './src/loading'
-import Input from './src/input'
-import DateRange from './src/date-range'
-import DialogBox from './src/dialog-box'
-import DatePanel from './src/date-panel'

Also applies to: 9-9, 11-11, 13-15, 18-23


Inconsistencies found between AI summary and actual code changes

The verification process has revealed significant discrepancies between the AI summary and the actual state of the codebase:

  1. New components (BreadcrumbItem, FilterBox, Guide, Milestone, Popconfirm, Time, TimeRange, TimeSpinner, TransferPanel, UploadList) have been successfully added and are being used across various files.

  2. Components mentioned as removed (Pager, Popeditor, Popover) are still present in the codebase and actively used. For example:

    • Pager is imported and used in files like pager/__test__/pager.test.tsx and grid/src/pager/src/methods.ts.
    • Popeditor is imported in popeditor/__tests__/popeditor.test.tsx.
    • Popover is imported in popover/__tests__/popover.test.tsx.
  3. There are leftover imports and uses of these supposedly removed components throughout the codebase.

These inconsistencies suggest that the PR description, commit messages, or the AI summary may not accurately reflect the current state of the codebase. To resolve this:

  1. Manually review the PR description and commit messages to ensure they align with the actual code changes.
  2. Update the documentation to accurately reflect the current status of Pager, Popeditor, and Popover components.
  3. If the removal of these components is still planned, create a new task or issue to track the removal process.
  4. Ensure that future summaries and descriptions accurately represent the state of the codebase to avoid confusion.
🔗 Analysis chain

Line range hint 1-68: Overall review summary and additional considerations.

The changes to this file successfully introduce new components to the SaaS design package. However, there are a few points to consider:

  1. The inconsistencies between the AI summary and the actual code (regarding Pager, Popeditor, and Popover) should be addressed.
  2. The order of imports and exports could be improved for better maintainability.
  3. It might be beneficial to verify that the PR description and commit messages accurately reflect the changes made in this file.

To ensure consistency across the codebase, please run the following script:

This script will help identify any inconsistencies in the usage of new and removed components across the codebase.


Let's update the verification script to correctly search for TypeScript files by specifying the file extensions directly.


Let's correct the verification script to properly exclude all index.ts files and ensure rg searches the intended TypeScript files.


Let's update the verification script to correctly exclude all index.ts files by using double quotes around the exclusion glob pattern.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of newly added and supposedly removed components

# Test: Check for usage of new components
echo "Checking usage of new components:"
rg --type typescript -g '!**/index.ts' -e 'BreadcrumbItem|FilterBox|Guide|Milestone|Popconfirm|Time|TimeRange|TimeSpinner|TransferPanel|UploadList'

# Test: Check for usage of components mentioned as removed in the AI summary
echo "Checking usage of components mentioned as removed:"
rg --type typescript -g '!**/index.ts' -e 'Pager|Popeditor|Popover'

# Test: Check if there are any leftover imports or uses of removed components
echo "Checking for leftover imports or uses of removed components:"
rg --type typescript -g '!**/index.ts' -e 'import.*Pager|import.*Popeditor|import.*Popover'

Length of output: 737


Script:

#!/bin/bash
# Description: Verify the usage of newly added and supposedly removed components

# Test: Check for usage of new components
echo "Checking usage of new components:"
rg -g '*.ts' -g '*.tsx' -e 'BreadcrumbItem|FilterBox|Guide|Milestone|Popconfirm|Time|TimeRange|TimeSpinner|TransferPanel|UploadList' --ignore-files 'index.ts'

# Test: Check for usage of components mentioned as removed in the AI summary
echo "Checking usage of components mentioned as removed:"
rg -g '*.ts' -g '*.tsx' -e 'Pager|Popeditor|Popover' --ignore-files 'index.ts'

# Test: Check if there are any leftover imports or uses of removed components
echo "Checking for leftover imports or uses of removed components:"
rg -g '*.ts' -g '*.tsx' -e 'import.*Pager|import.*Popeditor|import.*Popover' --ignore-files 'index.ts'

Length of output: 806


Script:

#!/bin/bash
# Description: Verify the usage of newly added and supposedly removed components

# Test: Check for usage of new components
echo "Checking usage of new components:"
rg -g '*.ts' -g '*.tsx' --glob '!**/index.ts' -e 'BreadcrumbItem|FilterBox|Guide|Milestone|Popconfirm|Time|TimeRange|TimeSpinner|TransferPanel|UploadList'

# Test: Check for usage of components mentioned as removed in the AI summary
echo "Checking usage of components mentioned as removed:"
rg -g '*.ts' -g '*.tsx' --glob '!**/index.ts' -e 'Pager|Popeditor|Popover'

# Test: Check if there are any leftover imports or uses of removed components
echo "Checking for leftover imports or uses of removed components:"
rg -g '*.ts' -g '*.tsx' --glob '!**/index.ts' -e 'import.*Pager|import.*Popeditor|import.*Popover'

Length of output: 118992


Script:

#!/bin/bash
# Description: Verify the usage of newly added and supposedly removed components

# Test: Check for usage of new components
echo "Checking usage of new components:"
rg -g '*.ts' -g '*.tsx' --glob "!**/index.ts" -e 'BreadcrumbItem|FilterBox|Guide|Milestone|Popconfirm|Time|TimeRange|TimeSpinner|TransferPanel|UploadList'

# Test: Check for usage of components mentioned as removed in the AI summary
echo "Checking usage of components mentioned as removed:"
rg -g '*.ts' -g '*.tsx' --glob "!**/index.ts" -e 'Pager|Popeditor|Popover'

# Test: Check if there are any leftover imports or uses of removed components
echo "Checking for leftover imports or uses of removed components:"
rg -g '*.ts' -g '*.tsx' --glob "!**/index.ts" -e 'import.*Pager|import.*Popeditor|import.*Popover'

Length of output: 118992

packages/vue/src/filter-box/src/pc.vue (1)

Line range hint 1-1: Typo in event handler name

The @click event handler has a typo. It should be handleClick instead of handeClick.

Please apply the following change:

- <div :class="['tiny-filter-box', disabled && 'disabled', blank && 'is-blank']" @click="handeClick">
+ <div :class="['tiny-filter-box', disabled && 'disabled', blank && 'is-blank']" @click="handleClick">
packages/vue/src/alert/src/pc.vue (1)

78-79: LGTM: New icon component added correctly.

The IconWarningTriangle component has been properly added to the components object. The naming convention and initialization are consistent with other icon components.

For improved readability, consider aligning the new component with the others:

 components: {
   IconClose: iconClose(),
   IconSuccess: iconSuccess(),
   IconError: iconError(),
   IconHelp: iconHelp(),
-  IconWarning: iconWarning(),
-  IconWarningTriangle: iconWarningTriangle()
+  IconWarning: iconWarning(),
+  IconWarningTriangle: iconWarningTriangle()
 },
packages/renderless/src/time/vue.ts (1)

63-63: Approved: Good use of nullish coalescing for configuration.

The addition of showTimePickerButton configuration is a good improvement, allowing for more flexibility in the component's usage. The use of the nullish coalescing operator (??) is a clean way to provide a default value.

For improved clarity, consider destructuring designConfig in the function parameters. This would make it clear that designConfig is an expected input:

export const renderless = (
  props,
  { computed, onMounted, reactive, watch, nextTick },
  { t, emit: $emit, vm, designConfig }
) => {
  // ... rest of the code
}

This change would make the source of designConfig more explicit to readers of the code.

packages/vue/src/popconfirm/src/pc.vue (1)

Line range hint 58-68: Summary: Icon update from Warning to WarningTriangle

The changes in this file involve updating the warning icon from iconWarning to iconWarningTriangle. This update is consistent across both the import statement and the component registration.

Consider the following points:

  1. Ensure that this icon change is part of a broader design system update and is consistently applied across all relevant components.
  2. If this change is part of a major version update, make sure to document it in the changelog as it might affect the visual appearance of components using this icon.
  3. Consider adding a comment explaining the reason for this icon change, especially if it's part of a larger design initiative or if it addresses any specific issues with the previous icon.
packages/renderless/src/split/vue.ts (1)

54-54: Approved: Good use of nullish coalescing, consider enhancing the comment.

The change to use the nullish coalescing operator (??) is a good improvement. It ensures that triggerBarConWithLine defaults to true when designConfig?.triggerBarConWithLine is undefined or null, making the code more robust.

Consider enhancing the comment to be more descriptive and use proper English:

-    triggerBarConWithLine: designConfig?.triggerBarConWithLine ?? true, // smb 风格的拖动块是线条
+    triggerBarConWithLine: designConfig?.triggerBarConWithLine ?? true, // For SMB style: determines if the drag block is rendered as a line

This change would make the comment more clear and informative for other developers.

packages/renderless/src/upload-list/vue.ts (1)

77-80: LGTM: Improved progressWidth initialization

The use of Object.hasOwnProperty ensures that progressWidth is only set from designConfig if it's explicitly defined, which is a good practice. The default value of '68' is provided as a fallback.

Consider using the nullish coalescing operator for a more concise expression:

progressWidth: designConfig?.state?.progressWidth ?? '68',

This achieves the same result with less code and is easier to read.

packages/renderless/src/transfer-panel/vue.ts (1)

73-74: Approved: Good use of modern JavaScript features for flexible configuration.

The changes to inputBoxType and showInputSearch improve the component's configurability and robustness. The use of optional chaining and nullish coalescing operators is a good practice.

For consistency, consider using the nullish coalescing operator for inputBoxType as well:

inputBoxType: designConfig?.inputBoxType ?? 'underline',

This would maintain consistent behavior with showInputSearch and prevent potential issues if designConfig.inputBoxType is intentionally set to a falsy value other than null or undefined.

packages/vue/src/drawer/src/pc.vue (1)

101-106: LGTM! Consider adding a comment explaining the button order change.

The reordering of the cancel and confirm buttons aligns with common UI patterns, potentially improving user experience. The code formatting is also more consistent now.

Consider adding a comment explaining the reason for switching the button order. This would be helpful for future maintainers. For example:

<!-- Cancel button placed first to align with common UI patterns and reduce accidental confirmations -->
<tiny-button plain class="tiny-drawer__cancel-btn" @click="handleClose('cancel')">
  {{ t('ui.button.cancel') }}
</tiny-button>
<tiny-button type="primary" class="tiny-drawer__confirm-btn" @click="handleClose('confirm')">
  {{ t('ui.button.confirm') }}
</tiny-button>
packages/vue/src/tree/src/tree-node.vue (2)

250-252: LGTM. Consider updating documentation.

The addition of iconExpand and iconPutAway icons suggests new functionality or design changes in the tree node component. These changes look good and follow the existing import pattern.

If these new icons introduce new features or change the component's appearance, please ensure that the component's documentation is updated to reflect these changes.


250-252: Summary: New icons added, potential feature enhancements

The changes in this file are focused on adding two new icons: iconExpand and iconPutAway. These additions suggest upcoming feature enhancements or design updates to the tree node component.

As these changes seem preparatory:

  1. Ensure that there's a plan to utilize these new icons in the component's template.
  2. Consider creating or updating relevant documentation or design specs to reflect the intended use of these new icons.
  3. If these changes are part of a larger feature, consider adding a TODO comment in the template where these icons will be used, to make it easier for future implementation.

Also applies to: 338-339

packages/design/smb/index.ts (1)

6-6: Consider removing the empty 'components' field

Since the components object is now empty, and if there are no components to export, you might consider removing this field to simplify the code.

packages/renderless/src/milestone/index.ts (1)

70-94: Unused properties BOX_SHADOW_PX and FLAG_CONTENT_CLS in smbConstants.STATUS_COLOR_MAP

The properties BOX_SHADOW_PX and FLAG_CONTENT_CLS are defined in each status within smbConstants.STATUS_COLOR_MAP but are not utilized in the getMileIcon function. Consider removing these properties if they're unnecessary, or incorporate them into the styling if they serve a purpose.

packages/renderless/src/tree-node/index.ts (1)

Line range hint 370-373: Validate 'tree.indent' and 'tree.baseIndent' before parsing

In computedIndent, using parseInt on tree.indent and tree.baseIndent without validation could lead to NaN if these properties are undefined or not valid numeric strings. To prevent potential issues, consider setting default values or validating their types before parsing.

Apply this diff to address the issue:

 export const computedIndent =
   () =>
   ({ node, showLine }, { tree }) => {
+    const indent = parseInt(tree.indent) || 0
+    const baseIndent = parseInt(tree.baseIndent) || 0
     return (node.level > 1 ? 1 : 0) * (indent + (showLine ? 8 : 0)) + baseIndent + 'px'
   }
packages/vue/src/select/src/pc.vue (2)

678-686: Ensure consistent component naming conventions

In the components registration, there is a mix of PascalCase and camelCase naming conventions (e.g., IconClose: iconClose()). For clarity and maintainability, consider standardizing the component names.

You might update the component registrations to consistently use PascalCase for component names:

        TinyButton,
-       IconClose: iconClose(),
+       IconClose,
        TinyScrollbar,
-       IconCopy: iconCopy(),
-       IconAddCircle: iconAddCircle(),
-       IconLoadingShadow: iconLoadingShadow(),
+       IconCopy,
+       IconAddCircle,
+       IconLoadingShadow,
        TinySelectDropdown,
-       IconHalfselect: iconHalfselect(),
-       IconCheck: iconCheck(),
-       IconCheckedSur: iconCheckedSur(),
+       IconHalfselect,
+       IconCheck,
+       IconCheckedSur,

And ensure the icons are imported appropriately:

 import {
       iconClose,
       iconHalfselect,
       iconCheck,
       iconCheckedSur,
       iconCopy,
       iconDownWard,
       iconSearch,
       iconEllipsis,
       iconChevronUp,
       iconAddCircle,
       iconLoadingShadow
 } from '@opentiny/vue-icon'

+ import IconClose from '@opentiny/vue-icon/lib/icon-close'
+ import IconHalfselect from '@opentiny/vue-icon/lib/icon-halfselect'
+ import IconCheck from '@opentiny/vue-icon/lib/icon-check'
+ import IconCheckedSur from '@opentiny/vue-icon/lib/icon-checked-sur'
+ import IconCopy from '@opentiny/vue-icon/lib/icon-copy'
+ import IconDownWard from '@opentiny/vue-icon/lib/icon-down-ward'
+ import IconSearch from '@opentiny/vue-icon/lib/icon-search'
+ import IconEllipsis from '@opentiny/vue-icon/lib/icon-ellipsis'
+ import IconChevronUp from '@opentiny/vue-icon/lib/icon-chevron-up'
+ import IconAddCircle from '@opentiny/vue-icon/lib/icon-add-circle'
+ import IconLoadingShadow from '@opentiny/vue-icon/lib/icon-loading-shadow'

691-692: Standardize code comments to English

The comments on lines 691-692 are in Chinese:

// tiny 新增,
// 默认下拉图标

For consistency and to accommodate all team members, please translate comments to English.

Updated comments might be:

- // tiny 新增,
+ // Newly added by Tiny
- // 默认下拉图标
+ // Default dropdown icon
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 50489a1 and 33be669.

📒 Files selected for processing (68)
  • packages/design/aurora/index.ts (2 hunks)
  • packages/design/aurora/src/alert/index.ts (0 hunks)
  • packages/design/aurora/src/breadcrumb-item/index.ts (1 hunks)
  • packages/design/aurora/src/filter-box/index.ts (1 hunks)
  • packages/design/aurora/src/milestone/index.ts (1 hunks)
  • packages/design/aurora/src/popconfirm/index.ts (1 hunks)
  • packages/design/aurora/src/split/index.ts (1 hunks)
  • packages/design/aurora/src/time-range/index.ts (1 hunks)
  • packages/design/aurora/src/time-spinner/index.ts (1 hunks)
  • packages/design/aurora/src/time/index.ts (1 hunks)
  • packages/design/aurora/src/transfer-panel/index.ts (1 hunks)
  • packages/design/aurora/src/upload-list/index.ts (1 hunks)
  • packages/design/saas/index.ts (2 hunks)
  • packages/design/saas/src/alert/index.ts (0 hunks)
  • packages/design/saas/src/breadcrumb-item/index.ts (1 hunks)
  • packages/design/saas/src/filter-box/index.ts (1 hunks)
  • packages/design/saas/src/guide/index.ts (1 hunks)
  • packages/design/saas/src/milestone/index.ts (1 hunks)
  • packages/design/saas/src/popconfirm/index.ts (1 hunks)
  • packages/design/saas/src/split/index.ts (1 hunks)
  • packages/design/saas/src/time-range/index.ts (1 hunks)
  • packages/design/saas/src/time-spinner/index.ts (1 hunks)
  • packages/design/saas/src/time/index.ts (1 hunks)
  • packages/design/saas/src/transfer-panel/index.ts (1 hunks)
  • packages/design/saas/src/upload-list/index.ts (1 hunks)
  • packages/design/smb/index.ts (1 hunks)
  • packages/design/smb/src/action-menu/index.ts (0 hunks)
  • packages/design/smb/src/alert/index.ts (0 hunks)
  • packages/design/smb/src/dropdown-item/index.ts (0 hunks)
  • packages/design/smb/src/dropdown/index.ts (0 hunks)
  • packages/design/smb/src/filter-box/index.ts (0 hunks)
  • packages/design/smb/src/milestone/index.ts (0 hunks)
  • packages/design/smb/src/popconfirm/index.ts (0 hunks)
  • packages/design/smb/src/select/index.ts (0 hunks)
  • packages/design/smb/src/split/index.ts (0 hunks)
  • packages/design/smb/src/time-spinner/index.ts (0 hunks)
  • packages/design/smb/src/transfer-panel/index.ts (0 hunks)
  • packages/design/smb/src/tree-node/index.ts (0 hunks)
  • packages/design/smb/src/upload-list/index.ts (0 hunks)
  • packages/renderless/src/action-menu/index.ts (1 hunks)
  • packages/renderless/src/base-select/index.ts (2 hunks)
  • packages/renderless/src/breadcrumb-item/vue.ts (1 hunks)
  • packages/renderless/src/drawer/vue.ts (1 hunks)
  • packages/renderless/src/filter-box/vue.ts (1 hunks)
  • packages/renderless/src/guide/index.ts (1 hunks)
  • packages/renderless/src/milestone/index.ts (2 hunks)
  • packages/renderless/src/select/index.ts (3 hunks)
  • packages/renderless/src/split/vue.ts (1 hunks)
  • packages/renderless/src/time-range/vue.ts (1 hunks)
  • packages/renderless/src/time-spinner/index.ts (1 hunks)
  • packages/renderless/src/time/vue.ts (1 hunks)
  • packages/renderless/src/transfer-panel/vue.ts (1 hunks)
  • packages/renderless/src/tree-node/index.ts (1 hunks)
  • packages/renderless/src/upload-list/vue.ts (1 hunks)
  • packages/renderless/types/drawer.type.ts (0 hunks)
  • packages/theme/src/drawer/index.less (0 hunks)
  • packages/theme/src/popconfirm/vars.less (1 hunks)
  • packages/vue/src/alert/src/index.ts (1 hunks)
  • packages/vue/src/alert/src/pc.vue (2 hunks)
  • packages/vue/src/drawer/src/pc.vue (1 hunks)
  • packages/vue/src/dropdown-item/src/index.ts (1 hunks)
  • packages/vue/src/dropdown-item/src/pc.vue (2 hunks)
  • packages/vue/src/dropdown/src/pc.vue (3 hunks)
  • packages/vue/src/filter-box/src/pc.vue (1 hunks)
  • packages/vue/src/popconfirm/src/index.ts (1 hunks)
  • packages/vue/src/popconfirm/src/pc.vue (2 hunks)
  • packages/vue/src/select/src/pc.vue (3 hunks)
  • packages/vue/src/tree/src/tree-node.vue (2 hunks)
💤 Files with no reviewable changes (17)
  • packages/design/aurora/src/alert/index.ts
  • packages/design/saas/src/alert/index.ts
  • packages/design/smb/src/action-menu/index.ts
  • packages/design/smb/src/alert/index.ts
  • packages/design/smb/src/dropdown-item/index.ts
  • packages/design/smb/src/dropdown/index.ts
  • packages/design/smb/src/filter-box/index.ts
  • packages/design/smb/src/milestone/index.ts
  • packages/design/smb/src/popconfirm/index.ts
  • packages/design/smb/src/select/index.ts
  • packages/design/smb/src/split/index.ts
  • packages/design/smb/src/time-spinner/index.ts
  • packages/design/smb/src/transfer-panel/index.ts
  • packages/design/smb/src/tree-node/index.ts
  • packages/design/smb/src/upload-list/index.ts
  • packages/renderless/types/drawer.type.ts
  • packages/theme/src/drawer/index.less
✅ Files skipped from review due to trivial changes (11)
  • packages/design/aurora/src/breadcrumb-item/index.ts
  • packages/design/aurora/src/split/index.ts
  • packages/design/aurora/src/time-spinner/index.ts
  • packages/design/aurora/src/time/index.ts
  • packages/design/aurora/src/transfer-panel/index.ts
  • packages/design/saas/src/breadcrumb-item/index.ts
  • packages/design/saas/src/split/index.ts
  • packages/design/saas/src/time-range/index.ts
  • packages/design/saas/src/time-spinner/index.ts
  • packages/design/saas/src/time/index.ts
  • packages/design/saas/src/transfer-panel/index.ts
🧰 Additional context used
🔇 Additional comments (48)
packages/design/saas/src/guide/index.ts (1)

3-3: Approve addition of isUseModalOverlay, but verify impact of removed property

The addition of isUseModalOverlay looks good and provides a clear way to control modal overlay usage. However, please address the following points:

  1. Verify the impact of removing btnOrderReversed. Ensure that all code relying on this property has been updated accordingly.
  2. Update documentation to reflect these changes, including any API documentation or usage guides.
  3. Adjust existing tests and add new ones to cover the isUseModalOverlay property.
  4. Check for any breaking changes in the UI or UX caused by this modification, especially related to button ordering which was likely controlled by the removed property.

To help verify the impact of the removed btnOrderReversed property, you can run the following script:

This script will help identify any remaining references to btnOrderReversed and potential areas where button ordering might be affected.

✅ Verification successful

To address the issues encountered with the previous shell scripts, please run the following updated scripts:


Approval Confirmed for isUseModalOverlay Addition and Safe Removal of btnOrderReversed

The addition of isUseModalOverlay is approved as it provides a clear mechanism to control modal overlay usage. Additionally, the removal of btnOrderReversed does not impact the codebase since no usages were found. Please ensure to:

  1. Update documentation to reflect the addition of isUseModalOverlay and the removal of btnOrderReversed.
  2. Adjust existing tests and add new ones to cover the isUseModalOverlay property.
  3. Verify that there are no unintended side effects on the user interface or user experience.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of btnOrderReversed in the codebase
echo "Searching for btnOrderReversed usage:"
rg "btnOrderReversed" --type vue --type ts --type js

# Search for potential button order related code
echo "Searching for potential button order related code:"
rg "button.*order|order.*button" --type vue --type ts --type js

# Search for usages of the Guide component
echo "Searching for Guide component usage:"
rg "<Guide" --type vue

Length of output: 506


Script:

#!/bin/bash
# Search for usages of btnOrderReversed in .vue, .ts, and .js files
echo "Searching for btnOrderReversed usage:"
rg "btnOrderReversed" -g "*.vue" -g "*.ts" -g "*.js"

# Search for potential button order related code in .vue, .ts, and .js files
echo "Searching for potential button order related code:"
rg "button.*order|order.*button" -g "*.vue" -g "*.ts" -g "*.js"

# Search for usages of the Guide component in .vue files
echo "Searching for Guide component usage:"
rg "<Guide" -g "*.vue"

Length of output: 4417

packages/design/aurora/src/popconfirm/index.ts (1)

1-1: LGTM: Correct import for the warning icon.

The import statement correctly imports the iconWarning function from the @opentiny/vue-icon package. This is consistent with the project's icon usage pattern.

packages/design/saas/src/popconfirm/index.ts (1)

1-7: 🛠️ Refactor suggestion

Consider enhancing type safety and flexibility

The overall structure of this file is clear and concise, serving as an entry point for the popconfirm component's icon configuration. However, there are a few suggestions to improve type safety and flexibility:

  1. Consider adding type information to make the code more robust in a TypeScript environment. This can help catch potential errors early and improve code documentation.

  2. The immediate invocation of iconWarning() might limit flexibility. Consider passing the function reference instead of its result, allowing for lazy evaluation or potential customization.

Here's a suggested refactor that addresses these points:

import { IconComponent, iconWarning } from '@opentiny/vue-icon'

interface PopconfirmIcons {
  warning: IconComponent
}

const icons: PopconfirmIcons = {
  warning: iconWarning
}

export default { icons }

This refactor:

  • Adds type information for better type safety.
  • Exports the icon function reference instead of its immediate result, allowing for more flexible usage.
  • Assumes IconComponent is the correct type for the icon function. If it's different, please adjust accordingly.

To ensure this change doesn't break existing usage, we should verify how this module is imported and used. Here's a script to check for its usage:

Please review the results of this script to ensure the suggested changes are compatible with existing usage.

packages/design/aurora/src/filter-box/index.ts (2)

1-1: LGTM: Icon import looks good.

The import of iconArrowBottom from @opentiny/vue-icon is correct and follows the project's convention for importing icons.


1-7: Verify integration and update documentation.

As this is a new configuration file for the filter box component in the Aurora design system, please ensure:

  1. The filter box component correctly uses this configuration.
  2. Any components that utilize the filter box are updated to accommodate this new configuration if necessary.
  3. The Aurora design system documentation is updated to reflect this new configuration option for the filter box.

To help verify the integration, you can run the following script:

This script will help identify where the filter box is used, potential documentation files, and any imports of this new configuration file.

packages/design/saas/src/filter-box/index.ts (1)

1-1: LGTM: Icon import looks good.

The import of iconArrowBottom from @opentiny/vue-icon is correct and follows the expected pattern for icon imports in this project.

packages/design/aurora/src/upload-list/index.ts (1)

1-12: LGTM: Clean and well-structured export

The overall structure of the exported object is clean and well-organized. The separation of state and icons properties provides a clear distinction between component state configuration and icon-related settings, which should make it easier to manage and maintain the upload list component.

packages/design/saas/src/milestone/index.ts (1)

1-26: Overall assessment: Good foundation, room for improvement

The renderless component approach is well-suited for a flexible design system. However, there are several areas where the code could be improved:

  1. Add TypeScript type annotations throughout the file.
  2. Enhance readability by breaking down complex calculations into smaller, named functions.
  3. Implement proper error handling, especially for color processing and data access.
  4. Consider performance optimizations, such as memoization for frequently used calculations.
  5. Remove the use of !important in styles if possible.
  6. Document or replace magic numbers with named constants.

These improvements will make the code more maintainable, less error-prone, and easier for other developers to understand and work with.

packages/design/aurora/index.ts (2)

2-2: LGTM: New component imports added correctly.

The new component imports have been added correctly, following the existing import pattern. This change is consistent with the components being added to the export object.

Also applies to: 8-8, 10-10, 12-14, 17-22


37-37: LGTM: New components added to export object correctly.

The new components have been added to the export object correctly, maintaining alphabetical order and consistency with the import statements.

Also applies to: 43-43, 45-45, 47-49, 52-57

packages/vue/src/filter-box/src/pc.vue (2)

Line range hint 1-1: Improved class bindings for better UI feedback

The class bindings for the main div and the value p element have been updated to provide better visual feedback based on component state. This is a good improvement for user experience.

Also applies to: 9-9


Line range hint 1-65: Overall improvements in consistency and maintainability

The changes in this file contribute to better consistency and maintainability of the FilterBox component. Key improvements include:

  1. Enhanced class bindings for better UI feedback based on component state.
  2. Fixed typo in the click event handler name.
  3. Updated icon imports and registrations, aligning with possible changes in the icon library or naming conventions.

These changes should positively impact the component's usability and the project's overall consistency.

packages/vue/src/dropdown-item/src/index.ts (1)

18-18: Icon name updated for leftWardArrow

The icon name for leftWardArrow has been changed from 'icon-delta-left' to 'icon-left-ward-arrow'. This change appears to be part of a design system update or icon library change.

To ensure consistency across the codebase, let's verify if this icon name change has been applied uniformly:

This script will help us identify if there are any inconsistencies in the icon naming across the project.

✅ Verification successful

Icon name update verified

All instances of 'icon-delta-left' have been removed, and 'icon-left-ward-arrow' is correctly used in packages/vue/src/dropdown-item/src/index.ts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of 'icon-delta-left' and occurrences of 'icon-left-ward-arrow'

echo "Checking for remaining instances of 'icon-delta-left':"
rg --type typescript --type vue "icon-delta-left"

echo "\nChecking for occurrences of 'icon-left-ward-arrow':"
rg --type typescript --type vue "icon-left-ward-arrow"

Length of output: 422


Script:

#!/bin/bash
# Description: Check for any remaining instances of 'icon-delta-left' and occurrences of 'icon-left-ward-arrow' across .ts, .tsx, and .vue files

echo "Checking for remaining instances of 'icon-delta-left':"
rg "icon-delta-left" --glob "*.ts" --glob "*.tsx" --glob "*.vue"

echo -e "\nChecking for occurrences of 'icon-left-ward-arrow':"
rg "icon-left-ward-arrow" --glob "*.ts" --glob "*.tsx" --glob "*.vue"

Length of output: 470

packages/renderless/src/drawer/vue.ts (1)

41-41: LGTM: Improved code readability

The consolidation of the computedHeight property definition into a single line improves code readability and maintains consistency with other property definitions in the state object. This change doesn't affect the functionality of the component.

packages/renderless/src/action-menu/index.ts (1)

37-37: Default spacing value changed from '5px' to '8px'

The default spacing value when designConfig?.props.spacing is not defined has been changed from '5px' to '8px'. While this change maintains the design configuration approach, it may have implications on the layout of components using this spacing.

  1. Could you please clarify the reason for this change? Is it to align with a new design system or to improve visual consistency?
  2. It's recommended to document this change in the component's changelog or documentation, as it might affect the appearance of components using the default spacing.
  3. Please verify the impact of this change on existing components that rely on the default spacing. Consider creating a visual regression test if not already in place.

To help assess the impact, you can run the following script to find all usages of the computedSpacing function:

This will help identify components that might be affected by the spacing change.

✅ Verification successful

Default spacing value change verified

All usages of the computedSpacing function are confined to the action-menu modules. The change from '5px' to '8px' is localized and does not impact other components in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all usages of the computedSpacing function

# Search for imports of the action-menu module
echo "Files importing action-menu:"
rg --type typescript "from ['\"].*action-menu['\"]" -l

# Search for uses of computedSpacing
echo "\nUses of computedSpacing:"
rg --type typescript "computedSpacing"

Length of output: 299


Script:

#!/bin/bash
# Description: Find all usages of the computedSpacing function

# Search for imports of the action-menu module
echo "Files importing action-menu:"
rg 'from [\'\"].*action-menu[\'\"]' -g "*.ts" -g "*.tsx" -l

# Search for uses of computedSpacing
echo "\nUses of computedSpacing:"
rg "computedSpacing" -g "*.ts" -g "*.tsx"

Length of output: 161


Script:

#!/bin/bash
# Description: Find all usages of the computedSpacing function

# Search for imports of the action-menu module
echo "Files importing action-menu:"
rg "from ['\"].*action-menu['\"]" -g "*.ts" -g "*.tsx" -l

# Search for uses of computedSpacing
echo "\nUses of computedSpacing:"
rg "computedSpacing" -g "*.ts" -g "*.tsx"

Length of output: 851

packages/vue/src/alert/src/pc.vue (2)

55-55: LGTM: New icon import added correctly.

The import statement has been updated to include the new iconWarningTriangle icon. This change is consistent with the existing import pattern for other icons.


55-55: Verify the intended use of the new IconWarningTriangle component.

The new IconWarningTriangle component has been imported and added to the components object, but there are no corresponding changes in the template to use this new icon. Could you please clarify:

  1. Is the template supposed to use this new icon? If so, where?
  2. If not intended for use in this component's template, is it meant for use in child components or slots?

Ensuring that the new icon is utilized as intended will help maintain code cleanliness and prevent unused imports.

Also applies to: 78-79

packages/renderless/src/time-range/vue.ts (1)

74-74: Approved: Good use of nullish coalescing for default value

This change improves the robustness of the code by providing a default value of true for showTimePickerRangeButton when designConfig?.showTimePickerRangeButton is undefined or null. It ensures consistent behavior of the component and is implemented using the appropriate JavaScript feature.

packages/vue/src/popconfirm/src/pc.vue (2)

58-58: LGTM! Verify the visual appearance of the new icon.

The change from iconWarning to iconWarningTriangle looks good. This update likely provides a more specific or updated icon for the component.

Please ensure that the new iconWarningTriangle visually fits the design and serves the same purpose as the previous iconWarning icon.


68-68: LGTM! Verify the component usage in the template.

The update of the component registration from IconWarning to IconWarningTriangle is consistent with the import change and looks good.

Please ensure that any usage of IconWarning in the template has been updated to IconWarningTriangle. Run the following script to check for any remaining usage of IconWarning:

✅ Verification successful

Script Error Detected: 'vue' is not a recognized file type in ripgrep.

Please run the following corrected script to check for any remaining usage of IconWarning:


There were errors in the previous scripts. Please run the corrected scripts below to continue verification:


Component Replacement Verified Successfully

The IconWarning component has been successfully replaced with IconWarningTriangle in packages/vue/src/popconfirm/src/pc.vue. No remaining usages of IconWarning were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of IconWarning in the template

# Test: Search for IconWarning in the template section
rg --type vue -A 5 $'IconWarning' packages/vue/src/popconfirm/src/pc.vue

Length of output: 99


Script:

#!/bin/bash
# Description: Check for any remaining usage of IconWarning in the template

# Test: Search for IconWarning in the template section without specifying file type
rg -A 5 'IconWarning' packages/vue/src/popconfirm/src/pc.vue

Length of output: 672


Script:

#!/bin/bash
# Description: Check for any remaining usage of IconWarning in the template

# Test: Search for IconWarning in the template section without specifying file type
rg -A 5 'IconWarning' packages/vue/src/popconfirm/src/pc.vue

Length of output: 189


Script:

#!/bin/bash
# Description: Search for specific patterns excluding node_modules

# Test: Search for patterns in markdown files, excluding node_modules directory
fd -e md --search-path . --exclude node_modules --exec rg '\b(appendToBody|textField|tip|tipPosition|effect)\b' '{}'

Length of output: 2845

packages/renderless/src/split/vue.ts (1)

Line range hint 1-114: LGTM: Minimal impact change with improved robustness.

The change to the triggerBarConWithLine property initialization is localized and doesn't affect the overall structure or exports of the module. It improves the robustness of the code by ensuring a default value when designConfig?.triggerBarConWithLine is not provided.

To ensure that this change doesn't unexpectedly affect other parts of the codebase, let's verify the usage of triggerBarConWithLine:

This script will help us verify that the change is consistent with other uses of designConfig and triggerBarConWithLine in the codebase.

✅ Verification successful

LGTM: Change verified with consistent usage across the codebase.

The update to the triggerBarConWithLine property is consistent with its usage in multiple parts of the codebase. Setting a default value using optional chaining enhances the code's robustness without affecting the module's structure or functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of triggerBarConWithLine in the codebase

# Search for usages of triggerBarConWithLine
echo "Searching for usages of triggerBarConWithLine:"
rg "triggerBarConWithLine" --type vue --type js --type ts

# Check if designConfig is used elsewhere in a similar manner
echo "Checking for similar usage of designConfig:"
rg "designConfig\?.+\s*\?\?" --type vue --type js --type ts

Length of output: 375


Script:

#!/bin/bash
# Description: Check usage of triggerBarConWithLine in the codebase

# Search for usages of triggerBarConWithLine in .vue, .js, and .ts files
echo "Searching for usages of triggerBarConWithLine:"
rg "triggerBarConWithLine" -g "*.vue" -g "*.js" -g "*.ts"

# Check if designConfig is used elsewhere with optional chaining
echo "Checking for similar usage of designConfig with optional chaining:"
rg "designConfig\?.+\?\?" -g "*.vue" -g "*.js" -g "*.ts"

Length of output: 2441

packages/vue/src/dropdown-item/src/pc.vue (4)

Line range hint 1-114: Summary of changes and recommendations

The changes to this component include:

  1. Updating the icon import and usage from IconDeltaLeft to IconLeftWardArrow.
  2. Adding new props to enhance configurability: appendToBody, textField, tip, tipPosition, and effect.
  3. Updating the component registration to reflect the new icon.

These changes appear to improve the component's functionality and flexibility. To ensure the changes are fully implemented:

  1. Verify that all references to the old icon have been updated throughout the component.
  2. Ensure the new props are properly utilized within the component.
  3. Update the component's documentation to include descriptions and usage examples for the new props.

Overall, the changes look good, but please address the verification steps and documentation updates mentioned in the previous comments.


106-106: Verify component usage in template

The component registration has been updated from IconDeltaLeft to IconLeftWardArrow, which is consistent with the import statement change.

Please run the following script to ensure that the template has been updated to use the new component:

#!/bin/bash
# Description: Check for usage of IconLeftWardArrow in the template

# Test: Search for IconLeftWardArrow in the template
rg --type vue '<IconLeftWardArrow' packages/vue/src/dropdown-item/src/pc.vue

# Test: Ensure there are no remaining references to IconDeltaLeft in the template
rg --type vue '<IconDeltaLeft' packages/vue/src/dropdown-item/src/pc.vue

73-73: Verify icon usage consistency

The import statement has been updated from iconDeltaLeft to iconLeftWardArrow. This change appears to be intentional, likely reflecting an update in the icon design or naming convention.

Please run the following script to ensure that all references to the old icon have been updated:

✅ Verification successful

Icon usage is consistent

All references to iconDeltaLeft have been successfully removed and replaced with IconLeftWardArrow in packages/vue/src/dropdown-item/src/pc.vue.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to iconDeltaLeft

# Test: Search for any remaining references to iconDeltaLeft
rg --type vue 'iconDeltaLeft'

# Test: Confirm that IconLeftWardArrow is now used in the template
rg --type vue -A 5 'IconLeftWardArrow' packages/vue/src/dropdown-item/src/pc.vue

Length of output: 166


Script:

#!/bin/bash
# Description: Check for any remaining references to iconDeltaLeft in .vue files

# Test: Search for any remaining references to iconDeltaLeft within .vue files
rg 'iconDeltaLeft' --glob '*.vue'

# Test: Confirm that IconLeftWardArrow is now used in the template of pc.vue
rg 'IconLeftWardArrow' packages/vue/src/dropdown-item/src/pc.vue

Length of output: 1981


Line range hint 91-95: Verify usage of new props and update documentation

New props have been added to enhance the component's configurability:

  • appendToBody
  • textField
  • tip
  • tipPosition
  • effect

These additions provide more flexibility in customizing the dropdown item's behavior and appearance.

Please ensure that these new props are properly utilized within the component and documented. Run the following script to check their usage:

Consider updating the component's documentation to include descriptions and usage examples for these new props.

✅ Verification successful

Props Usage and Documentation Verified

The new props appendToBody, textField, tip, tipPosition, and effect are properly utilized within the pc.vue component and are documented accordingly.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of new props in the component

# Test: Search for usage of new props in the template and script
rg --type vue '(appendToBody|textField|tip|tipPosition|effect)' packages/vue/src/dropdown-item/src/pc.vue

# Test: Check if props are documented in the component's documentation file
fd -e md -x rg '(appendToBody|textField|tip|tipPosition|effect)'

Length of output: 362


Script:

#!/bin/bash
# Description: Check usage of new props in the component

# Test: Search for usage of new props in the template and script
rg --glob '*.vue' '\b(appendToBody|textField|tip|tipPosition|effect)\b' packages/vue/src/dropdown-item/src/pc.vue

# Test: Check if props are documented in the component's documentation file
fd -e md --search-path . --exclude-dir=node_modules --exec rg '\b(appendToBody|textField|tip|tipPosition|effect)\b' {}

Length of output: 672


Script:

#!/bin/bash
# Description: Check usage of new props in the component

# Test: Search for usage of new props in the template and script
rg --glob '*.vue' '\b(appendToBody|textField|tip|tipPosition|effect)\b' packages/vue/src/dropdown-item/src/pc.vue

# Test: Check if props are documented in the component's documentation file
fd --extension md --search-path . --exclude node_modules --exec rg '\b(appendToBody|textField|tip|tipPosition|effect)\b' {}

Length of output: 3260


Script:

#!/bin/bash
# Description: Check usage of new props in the component

# Test: Search for usage of new props in the template and script
rg --glob '*.vue' '\b(appendToBody|textField|tip|tipPosition|effect)\b' packages/vue/src/dropdown-item/src/pc.vue

# Test: Check if props are documented in the component's documentation file
fd --extension md --search-path . --exclude node_modules --exec rg '\b(appendToBody|textField|tip|tipPosition|effect)\b' {}

Length of output: 3260

packages/renderless/src/upload-list/vue.ts (6)

76-76: LGTM: Default progressType set to 'line'

This change provides a good default value for progressType while still allowing customization through designConfig. It improves the component's flexibility and maintainability.


81-81: LGTM: Default progressStrokeWidth set to 4

This change provides a sensible default value for progressStrokeWidth while still allowing customization through designConfig. It improves the component's flexibility and maintainability.


82-82: LGTM: Improved tooltipDisabled initialization

The use of the nullish coalescing operator (??) for tooltipDisabled is a good improvement. It provides a default value of false while still allowing it to be explicitly set to false in the designConfig. This change makes the code more concise and easier to understand.


76-87: Overall: Good improvements to design configuration and default values

The changes in this file enhance the upload list component's flexibility and maintainability. Key improvements include:

  1. Better handling of design configuration options with appropriate fallback values.
  2. Use of modern JavaScript features like the nullish coalescing operator.
  3. Safer property checks using Object.hasOwnProperty.

These changes make the component more robust and easier to customize. Consider the suggested minor improvements to further enhance code readability and conciseness.


83-83: LGTM: Updated default closeComponent icon

The default icon for closeComponent has been changed to 'icon-del', which is likely more appropriate for a delete action. This change maintains customization flexibility through designConfig.

Please verify that the 'icon-del' icon exists in your icon library and that it's visually appropriate for this use case. Run the following script to check for the icon's usage:

#!/bin/bash
# Description: Check for the usage of 'icon-del' in the codebase

# Test: Search for 'icon-del' usage
rg --type vue --type typescript --type javascript 'icon-del'

84-87: LGTM: Improved preViewComponent initialization

The use of Object.hasOwnProperty ensures that preViewComponent is only set from designConfig if it's explicitly defined, which is a good practice. The default value of 'icon-fullscreen-left' is provided as a fallback.

Consider using the nullish coalescing operator for a more concise expression:

preViewComponent: designConfig?.icons?.preViewComponent ?? 'icon-fullscreen-left',

This achieves the same result with less code and is easier to read.

Please verify that the 'icon-fullscreen-left' icon exists in your icon library and that it's visually appropriate for this use case. Run the following script to check for the icon's usage:

packages/vue/src/dropdown/src/pc.vue (3)

119-120: Excellent improvement in icon handling!

The changes introduce a flexible fallback mechanism for icon selection:

  1. It first checks for a custom suffixIcon prop.
  2. Then it looks for a design configuration icon.
  3. Finally, it defaults to the iconDownWard().

This approach enhances customization options and maintains consistency with the design system. The use of optional chaining (?.) is also a good practice for safe property access.


171-173: Improved template string formatting.

The class bindings for both the button and span elements have been split across multiple lines. This change enhances code readability without altering the functionality. The use of template literals (`) is consistent and correct.

Also applies to: 181-183


Line range hint 1-205: Summary of changes and their impact.

The modifications in this file focus on three main areas:

  1. Icon import and usage: Introduced a more flexible approach to icon selection, allowing for custom icons and design system integration.
  2. Template string formatting: Improved readability of class bindings by splitting them across multiple lines.
  3. Removal of iconDeltaDown (as per AI summary, not visible in the provided code).

These changes enhance the component's flexibility and maintainability without introducing significant functional alterations. They align well with the PR's objective of implementing inline design configuration.

Overall, the changes are well-implemented and improve the quality of the code.

packages/renderless/src/guide/index.ts (2)

84-84: Improved handling of useModalOverlay configuration

This change enhances the robustness and clarity of the useModalOverlay configuration:

  1. It uses optional chaining (?.) to safely access designConfig.state.isUseModalOverlay, preventing errors if designConfig or state is undefined.
  2. The nullish coalescing operator (??) provides a default value of false, making the behavior explicit when isUseModalOverlay is undefined.

This approach is more maintainable and less prone to unexpected behavior compared to the previous implementation.


84-84: Verify impact and consider similar improvements

While this change improves the handling of the useModalOverlay configuration, please consider the following:

  1. Verify that this change aligns with the expected behavior in other parts of the application, especially if isUseModalOverlay was previously undefined in some scenarios.
  2. Consider applying similar improvements to other configuration options in this function or related components for consistency.

To help verify the impact of this change, you can run the following script:

This will help identify other places where similar improvements might be beneficial.

packages/renderless/src/time-spinner/index.ts (1)

282-282: Improved fallback handling for itemMarginSpace

The change from || to ?? operator and the new fallback value of 12 improves the handling of itemMarginSpace. This modification allows for more precise control over the item height calculation:

  1. It now correctly handles cases where itemMarginSpace is intentionally set to 0.
  2. If itemMarginSpace is not defined, it defaults to 12 instead of 0, which may provide better default spacing.

However, this change might affect the layout of existing implementations. Please ensure that:

  1. The new default value of 12 is appropriate for your use cases.
  2. Existing users of this component are aware of this change, as it might require adjustments in their styling or layout.

To verify the impact of this change, please run the following script:

This will help identify any areas of the codebase that might need adjustment due to the changed default spacing.

✅ Verification successful

Verified: Fallback Change Safe and Effective

The switch from || to ?? with a fallback value of 12 for itemMarginSpace has been successfully verified. This change allows itemMarginSpace to explicitly be set to 0 without defaulting, ensuring existing layouts remain consistent. Additionally, the new default of 12 is only applied when itemMarginSpace is null or undefined, which aligns with current design configurations.

  • No conflicting hardcoded styles were found that would be adversely affected by this change.
  • Explicit definitions of itemMarginSpace in design files ensure existing layouts remain unaffected.

Please ensure that all relevant teams are aware of this update to maintain consistency across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any hardcoded values or style definitions that might be affected by this change

# Search for any hardcoded pixel values related to time spinner item height or margin
rg --type=vue --type=js --type=ts -i '(height|margin).*?(\d+)px' packages/

# Search for any CSS classes or styles that might be related to time spinner items
rg --type=vue --type=css --type=scss -i '(time-spinner|time-select).*?\{' packages/

Length of output: 218


Script:

#!/bin/bash
# Description: Check for any hardcoded values or style definitions that might be affected by the change

# Search for any hardcoded pixel values related to time spinner item height or margin in .vue, .js, and .ts files
rg -g "*.vue" -g "*.js" -g "*.ts" -i '(height|margin).*?(\d+)px' packages/

# Search for any CSS classes or styles that might be related to time spinner items in .vue, .css, and .scss files
rg -g "*.vue" -g "*.css" -g "*.scss" -i '(time-spinner|time-select).*?\{' packages/

Length of output: 22281

packages/vue/src/tree/src/tree-node.vue (1)

338-339: LGTM. Verify icon usage in template.

The registration of IconExpand and IconPutAway components is correct and consistent with the import changes.

Please ensure that these new icons are properly used in the component's template. Run the following script to verify their usage:

If the script doesn't return any results, consider adding the new icons to the template or removing them if they're not needed.

packages/design/smb/index.ts (1)

6-6: Ensure that removing components does not break dependent modules

By emptying the components object, you may affect other parts of the application that rely on these components being exported from 'packages/design/smb'. Please verify that no other code depends on these components.

Run the following script to check if any imports rely on the removed components:

packages/renderless/src/tree-node/index.ts (1)

363-364: Appropriate use of optional chaining for icon configuration

The code correctly uses optional chaining to access designConfig.icons.expanded and designConfig.icons.collapse, providing default icon values when they're not defined. This ensures robustness in icon selection based on the design configuration.

packages/vue/src/select/src/pc.vue (2)

53-54: Approved: Updated :title binding in the template

The :title binding now correctly handles the case when the component is not multiple and is disabled, ensuring the state.selectedLabel is displayed appropriately. This enhances the user experience by providing accurate tooltip information.


615-625: Approved: Renamed icon imports to camelCase

The icon imports have been renamed to use camelCase (e.g., iconClose, iconCheck), aligning with standard naming conventions and improving code readability.

packages/renderless/src/base-select/index.ts (2)

Line range hint 600-616: Verify default values for spacingHeight and sizeInMap.

The calculations for spacingHeight and sizeInMap depend on designConfig and fallback values. Ensure that designConfig, designConfig.state.spacingHeight, and constants.SPACING_HEIGHT are properly defined with appropriate default values to prevent unintended UI behaviors when designConfig is undefined or incomplete.

Run the following script to verify the definitions and default values:

✅ Verification successful

Default values for spacingHeight and sizeInMap are properly defined.

  • constants.SPACING_HEIGHT is consistently set to 0 across relevant modules.
  • initialInputHeight defaults to 0 or 32 where necessary.
  • designConfig utilizes optional chaining with appropriate fallbacks to prevent UI issues when undefined or incomplete.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check definitions and defaults for `spacingHeight` and `sizeInMap`.

# Search for the definition of `SPACING_HEIGHT` in constants.
rg 'SPACING_HEIGHT' packages/

# Search for the initialization and default value of `initialInputHeight`.
rg 'initialInputHeight' packages/renderless/src/

# Search for default values in `designConfig` and its usage.
rg 'designConfig' packages/

Length of output: 25614


1699-1700: Verify the impact of updated defaultSizeMap on component sizes.

The defaultSizeMap has been updated to new values { default: 32, mini: 24, small: 36, medium: 40 }. Ensure that these changes align with the design guidelines and do not negatively affect components relying on these size mappings.

Run the following script to identify usages of defaultSizeMap and assess dependencies:

✅ Verification successful

The update to defaultSizeMap is consistent across the codebase and aligns with existing design implementations. No issues were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all usages of `defaultSizeMap` to check for size dependencies.

# Search for all occurrences of `defaultSizeMap`.
rg 'defaultSizeMap' packages/

# Search for components or styles that depend on size mappings.
rg 'sizeMap' packages/

# Check for hardcoded size values that may conflict with the new sizes.
rg --type js '32|36|40|24' packages/

Length of output: 28739

packages/renderless/src/select/index.ts (4)

724-724: Approve the use of optional chaining and nullish coalescing operator for spacingHeight.

The updated code enhances readability and handles undefined values more effectively by using optional chaining (?.) and the nullish coalescing operator (??).


2365-2365: Approve the use of optional chaining when accessing designConfig.icons.dropdownIcon.

The implementation correctly utilizes optional chaining to handle cases where designConfig or designConfig.icons may be undefined, defaulting to 'icon-down-ward' when necessary.


2019-2019: Confirm the updated default sizes in defaultSizeMap.

The sizes for default and small have been increased from { default: 28, small: 32 } to { default: 32, small: 36 }. Please verify that these changes are intentional and ensure they do not negatively affect UI elements or dependent components.

Run the following script to find all references to defaultSizeMap and evaluate potential impacts:

#!/bin/bash
# Description: Search for all usages of 'defaultSizeMap' in the codebase.

# Expected: Identify components that use 'defaultSizeMap' to check for any layout or styling issues due to the size changes.

rg --type-add 'js:*.{js,ts,tsx}' 'defaultSizeMap'

721-721: Confirm the change of default sizeInMap value from 30 to 32.

The default value of sizeInMap has been updated from 30 to 32. Please verify that this change is intentional and does not adversely affect UI layouts or other components relying on this value.

Run the following script to identify where sizeInMap is used and assess the impact:

✅ Verification successful

Verified the change of default sizeInMap value from 30 to 32.

The search results indicate that sizeInMap is not used elsewhere in the codebase, ensuring that the updated default value does not negatively impact other UI layouts or components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for all occurrences of 'sizeInMap' in JavaScript and TypeScript files.

# Expected: Review components or functions that depend on 'sizeInMap' to ensure the new default is compatible.

rg --type-add 'js:*.{js,ts,tsx}' 'sizeInMap'

Length of output: 505

@@ -1,4 +1,4 @@
export default {
// 控制time-picker组件时间范围button显示和样式
showTimePickerRangeButton: true
showTimePickerRangeButton: false
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Potential Breaking Change Detected with showTimePickerRangeButton

The showTimePickerRangeButton property has been changed from true to false, impacting multiple areas of the codebase:

  • packages/vue/src/time-range/src/pc.vue
  • packages/design/saas/src/time-range/index.ts
  • packages/design/aurora/src/time-range/index.ts
  • packages/renderless/src/time-range/vue.ts

This alteration may lead to unintended side effects, such as hiding the range button by default across various components, potentially disrupting the user experience and existing functionalities.

Recommendations:

  • Documentation: Update the component’s documentation to reflect the new default behavior and guide users on how to enable the range button if needed.
  • Migration Strategy: Consider implementing a deprecation period or providing clear migration steps for consumers affected by this change.
  • Backward Compatibility: Evaluate the necessity of maintaining backward compatibility to prevent breaking existing implementations.
🔗 Analysis chain

Please provide context for this change and consider its impact.

The showTimePickerRangeButton property has been changed from true to false, which will hide the time-picker component's range button by default. While this change aligns with the general updates mentioned in the PR description, there are a few points to consider:

  1. Could you please explain the reasoning behind this change? Understanding the motivation will help in evaluating its appropriateness.

  2. This change may impact the user experience and functionality of the time-range component. It's important to ensure that this aligns with the intended design and usability goals.

  3. This could potentially be a breaking change for consumers of this component who rely on the range button being visible by default. Have you considered the backwards compatibility implications?

  4. It would be beneficial to document this change in the component's documentation, explaining the new default behavior and how users can enable the range button if needed.

To assess the impact of this change, let's check for any usage of this property across the codebase:

This will help us understand if there are any components or tests that might be affected by this change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of showTimePickerRangeButton property
rg --type typescript --type vue 'showTimePickerRangeButton'

Length of output: 94


Script:

#!/bin/bash
# Search for usage of showTimePickerRangeButton property in .ts, .tsx, and .vue files
rg 'showTimePickerRangeButton' --glob '*.{ts,tsx,vue}'

Length of output: 739

Comment on lines +3 to +7
export default {
icons: {
expandButton: iconArrowBottom()
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider lazy loading the icon for better performance.

The current implementation immediately calls iconArrowBottom() when the module is imported. For better performance, especially if the icon is not always used, consider lazy loading the icon:

 export default {
   icons: {
-    expandButton: iconArrowBottom()
+    expandButton: () => iconArrowBottom()
   }
 }

This change would defer the icon creation until it's actually needed, potentially improving initial load time.

📝 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
export default {
icons: {
expandButton: iconArrowBottom()
}
}
export default {
icons: {
expandButton: () => iconArrowBottom()
}
}

Comment on lines +8 to +11
icons: {
closeComponent: 'icon-close',
preViewComponent: ''
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Potential Issue: preViewComponent is Unused

The icons object includes preViewComponent set to an empty string. However, no usage was found in .vue, .ts, or .js files within the packages/design/saas/src directory.

  • Consider removing preViewComponent if it's not needed.
  • If it's intended for future use, add a TODO comment to clarify its purpose.
🔗 Analysis chain

LGTM! Clarification needed for preViewComponent.

The icons object is structured well. The closeComponent is clearly defined. However, the preViewComponent is set to an empty string.

Could you clarify if this is intentional or if it's meant to be implemented later? If it's a placeholder, consider adding a TODO comment for future implementation.

To verify the usage of these components, let's run the following script:

This will help us understand if these components are being used elsewhere in the codebase and if preViewComponent is referenced despite being empty.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of closeComponent and preViewComponent

# Search for closeComponent usage
echo "Searching for closeComponent usage:"
rg --type vue "closeComponent" packages/design/saas/src

# Search for preViewComponent usage
echo "Searching for preViewComponent usage:"
rg --type vue "preViewComponent" packages/design/saas/src

Length of output: 335


Script:

#!/bin/bash
# Description: Check for usage of closeComponent and preViewComponent in .vue files

# Search for closeComponent usage
echo "Searching for closeComponent usage in .vue files:"
rg "closeComponent" packages/design/saas/src -g "*.vue"

# Search for preViewComponent usage
echo "Searching for preViewComponent usage in .vue files:"
rg "preViewComponent" packages/design/saas/src -g "*.vue"

Length of output: 335


Script:

#!/bin/bash
# Description: Check for usage of closeComponent and preViewComponent in relevant file types

# Search for closeComponent usage in .vue, .ts, and .js files
echo "Searching for closeComponent usage in .vue, .ts, and .js files:"
rg "closeComponent" packages/design/saas/src -g "*.vue" -g "*.ts" -g "*.js"

# Search for preViewComponent usage in .vue, .ts, and .js files
echo "Searching for preViewComponent usage in .vue, .ts, and .js files:"
rg "preViewComponent" packages/design/saas/src -g "*.vue" -g "*.ts" -g "*.js"

Length of output: 582

@@ -4,7 +4,7 @@ export const api = ['state', 'handleClear', 'focus', 'blur', 'handeClick']

export const renderless = (props, { reactive }, { dispatch, emit, designConfig }) => {
const state = reactive({
expandButtonIcon: designConfig?.icons?.expandButton || 'IconArrowBottom'
expandButtonIcon: designConfig?.icons?.expandButton || 'IconDownWard'
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Icon 'IconArrowBottom' Usage Not Fully Updated

The icon 'IconArrowBottom' is still used in the following files:

  • packages/vue/src/dropdown/src/mobile-first.vue
  • packages/vue/src/tree/src/tree-node.vue
  • examples/sites/demos/mobile-first/app/collapse/slot-icon.vue
  • packages/vue/src/filter-bar/src/mobile-first.vue
  • packages/vue/src/collapse-item/src/mobile-first.vue
  • packages/vue-icon/index.ts
  • packages/vue-icon/src/arrow-bottom/index.ts
  • packages/vue-icon-saas/index.ts

Please ensure that all occurrences are updated to 'IconDownWard' to maintain consistency across the UI.

🔗 Analysis chain

Verify the icon change from 'IconArrowBottom' to 'IconDownWard'.

The default icon for expandButtonIcon has been changed from 'IconArrowBottom' to 'IconDownWard'. This change looks good, but please ensure that this new icon is consistent with the design guidelines and doesn't negatively impact the UI.

Run the following script to check for any other occurrences of 'IconArrowBottom' that might need to be updated:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for occurrences of 'IconArrowBottom' in the codebase

rg --type vue --type typescript 'IconArrowBottom'

Length of output: 77


Script:

#!/bin/bash
# Description: Search for occurrences of 'IconArrowBottom' in .vue and .ts files

rg 'IconArrowBottom' -g '*.vue' -g '*.ts'

Length of output: 1981

Comment on lines +17 to +23
getFlagStyle: ({ index, idx }) => {
return {
left: `calc(${
(100 / (props.data[props.flagBefore ? index : index + 1][props.flagField].length + 1)) * (idx + 1)
}% - 29px)`
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Improve clarity and check for potential off-by-one error.

The getFlagStyle method calculates the left position for flags, but the logic is complex and might be difficult to understand or maintain. Additionally, there's a potential off-by-one error in the index calculation when props.flagBefore is true.

Consider refactoring for clarity and correctness:

getFlagStyle: ({ index, idx }) => {
  const flagIndex = props.flagBefore ? index : index + 1;
  const flagCount = props.data[flagIndex][props.flagField].length;
  const position = (idx + 1) / (flagCount + 1);
  const leftPercentage = position * 100;

  return {
    left: `calc(${leftPercentage}% - 29px)`
  }
}

This refactored version:

  1. Clearly separates the index calculation, addressing the potential off-by-one error.
  2. Calculates the position as a fraction, improving readability.
  3. Uses more descriptive variable names.

Please verify that this logic matches the intended behavior, especially regarding the props.flagBefore condition.

Comment on lines +101 to +105
'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
boxShadow: 'unset'
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure consistency by appending !important to statusColor

When statusColor is provided, it doesn't have the !important suffix, whereas the fallback colors from smbConstants do include it. This inconsistency can lead to unexpected CSS specificity issues. To maintain consistent styling, consider appending !important to statusColor.

Apply this diff to append !important to statusColor:

 return {
-   'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
+   'background-color': (statusColor ? statusColor + '!important' : smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important'),
    color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
    'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
    boxShadow: 'unset'
  }

  // Similar changes for COMPLETED and DEFAULT statuses

Also applies to: 110-114, 119-123

Comment on lines +165 to +167
left: `calc(${(100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length) * idx}% + ${
idx * 8
}px)`
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add checks to prevent potential division by zero

In the getFlagStyle function, the calculation of the left property involves dividing by props.data[...][props.flagField].length. If this length is zero or undefined, it can cause division by zero errors or unexpected results. Ensure that the length is valid before performing the calculation.

Apply this diff to add a safety check:

 export const getFlagStyle =
   (props) =>
   ({ index, idx }) => {
+    const flagData = props.data[props.flagBefore ? index : index + 1][props.flagField] || [];
+    const length = flagData.length || 1; // Prevent division by zero
     return {
-      left: `calc(${(100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length) * idx}%  + ${
+      left: `calc(${(100 / length) * idx}%  + ${
         idx * 8
       }px)`
     }
   }
📝 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
left: `calc(${(100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length) * idx}% + ${
idx * 8
}px)`
const flagData = props.data[props.flagBefore ? index : index + 1][props.flagField] || [];
const length = flagData.length || 1; // Prevent division by zero
left: `calc(${(100 / length) * idx}% + ${
idx * 8
}px)`

Comment on lines +99 to 123
if (props.solid || status === constants.STATUS_MAP.DOING) {
return {
'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
boxShadow: 'unset'
}
}

const isCompleted = node[props.statusField] === props.completedField
const switchColor = isCompleted && !props.solid
const { r, g, b } = hexToRgb(status)
if (status === constants.STATUS_MAP.COMPLETED) {
return {
'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR,
boxShadow: 'unset'
}
}

return {
background: (switchColor ? constants.DEFAULT_BACK_COLOR : status) + '!important',
color: (switchColor ? status : constants.DEFAULT_BACK_COLOR) + '!important',
boxShadow: `rgba(${r},${g},${b},.4) ${constants.BOX_SHADOW_PX}`
background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR,
boxShadow: 'unset'
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Refactor getMileIcon to reduce code duplication

The return statements for different statuses in the getMileIcon function have similar structures, leading to code duplication. Refactoring can enhance maintainability and readability.

Consider refactoring the function as follows:

 export const getMileIcon =
   ({ constants, props }) =>
   (node) => {
     const status = node[props.statusField];
     const statusColor = props.milestonesStatus[status];

+    const statusKey = props.solid || status === constants.STATUS_MAP.DOING
+      ? 'DOING'
+      : status === constants.STATUS_MAP.COMPLETED
+        ? 'COMPLETED'
+        : 'DEFAULT';

+    const statusStyles = smbConstants.STATUS_COLOR_MAP[statusKey];

+    return {
+      'background-color': (statusColor ? statusColor + '!important' : statusStyles.BACKGROUND_COLOR + '!important'),
+      color: (statusKey === 'DOING' ? statusStyles.COLOR + '!important' : (statusColor ? statusColor + '!important' : statusStyles.COLOR + '!important')),
+      'border-color': statusColor || statusStyles.BORDER_COLOR,
+      boxShadow: 'unset'
+    };
-
-    // Original code with multiple if statements
   }
📝 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
if (props.solid || status === constants.STATUS_MAP.DOING) {
return {
'background-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BACKGROUND_COLOR + '!important',
color: smbConstants.STATUS_COLOR_MAP.DOING.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DOING.BORDER_COLOR,
boxShadow: 'unset'
}
}
const isCompleted = node[props.statusField] === props.completedField
const switchColor = isCompleted && !props.solid
const { r, g, b } = hexToRgb(status)
if (status === constants.STATUS_MAP.COMPLETED) {
return {
'background-color': smbConstants.STATUS_COLOR_MAP.COMPLETED.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.COMPLETED.BORDER_COLOR,
boxShadow: 'unset'
}
}
return {
background: (switchColor ? constants.DEFAULT_BACK_COLOR : status) + '!important',
color: (switchColor ? status : constants.DEFAULT_BACK_COLOR) + '!important',
boxShadow: `rgba(${r},${g},${b},.4) ${constants.BOX_SHADOW_PX}`
background: smbConstants.STATUS_COLOR_MAP.DEFAULT.BACKGROUND_COLOR + '!important',
color: statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.COLOR + '!important',
'border-color': statusColor || smbConstants.STATUS_COLOR_MAP.DEFAULT.BORDER_COLOR,
boxShadow: 'unset'
}
}
const statusKey = props.solid || status === constants.STATUS_MAP.DOING
? 'DOING'
: status === constants.STATUS_MAP.COMPLETED
? 'COMPLETED'
: 'DEFAULT';
const statusStyles = smbConstants.STATUS_COLOR_MAP[statusKey];
return {
'background-color': (statusColor ? statusColor + '!important' : statusStyles.BACKGROUND_COLOR + '!important'),
color: (statusKey === 'DOING' ? statusStyles.COLOR + '!important' : (statusColor ? statusColor + '!important' : statusStyles.COLOR + '!important')),
'border-color': statusColor || statusStyles.BORDER_COLOR,
boxShadow: 'unset'
};
}

Comment on lines +70 to +94
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Move smbConstants outside getMileIcon to improve performance

The smbConstants object is a constant and does not rely on any function parameters. Defining it inside the getMileIcon function causes it to be recreated every time the function is called, which is unnecessary. Consider moving it outside the function scope to enhance performance.

Apply this diff to move smbConstants outside the function:

+ const smbConstants = {
+   STATUS_COLOR_MAP: {
+     DEFAULT: {
+       BORDER_COLOR: '#C2C2C2',
+       BACKGROUND_COLOR: '#FFFFFF',
+       COLOR: '#191919',
+       BOX_SHADOW_PX: '0px 0px 0px 4px',
+       FLAG_CONTENT_CLS: '.content'
+     },
+     COMPLETED: {
+       BORDER_COLOR: '#191919',
+       BACKGROUND_COLOR: '#FFFFFF',
+       COLOR: '#191919',
+       BOX_SHADOW_PX: '0px 0px 0px 4px',
+       FLAG_CONTENT_CLS: '.content'
+     },
+     DOING: {
+       BORDER_COLOR: '#191919',
+       BACKGROUND_COLOR: '#191919',
+       COLOR: '#FFFFFF',
+       BOX_SHADOW_PX: '0px 0px 0px 4px',
+       FLAG_CONTENT_CLS: '.content'
+     }
+   }
+ };

 export const getMileIcon =
   ({ constants, props }) =>
   (node) => {
-     const smbConstants = {
-       STATUS_COLOR_MAP: {
-         DEFAULT: {
-           BORDER_COLOR: '#C2C2C2',
-           BACKGROUND_COLOR: '#FFFFFF',
-           COLOR: '#191919',
-           BOX_SHADOW_PX: '0px 0px 0px 4px',
-           FLAG_CONTENT_CLS: '.content'
-         },
-         COMPLETED: {
-           BORDER_COLOR: '#191919',
-           BACKGROUND_COLOR: '#FFFFFF',
-           COLOR: '#191919',
-           BOX_SHADOW_PX: '0px 0px 0px 4px',
-           FLAG_CONTENT_CLS: '.content'
-         },
-         DOING: {
-           BORDER_COLOR: '#191919',
-           BACKGROUND_COLOR: '#191919',
-           COLOR: '#FFFFFF',
-           BOX_SHADOW_PX: '0px 0px 0px 4px',
-           FLAG_CONTENT_CLS: '.content'
-         }
-       }
-     };
📝 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
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
}
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
};
export const getMileIcon =
({ constants, props }) =>
(node) => {
// Function body (not shown in the original snippet)
}

IconChevronUp: IconChevronUp()
IconSearch: iconSearch(),
IconDownWard: iconDownWard(), // 默认下拉图标
IconEllipsis: iconEllipsis(),
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

iconEllipsis is not correctly imported in packages/vue/src/select/src/pc.vue. Please add the appropriate import statement for iconEllipsis from '@opentiny/vue-icon' to ensure proper component registration.

  • File: packages/vue/src/select/src/pc.vue
🔗 Analysis chain

Ensure proper component registration

The component IconEllipsis is registered as:

IconEllipsis: iconEllipsis(),

Ensure that this registration matches the import and usage. If iconEllipsis is a function that returns a component, this is acceptable. Otherwise, adjust the registration to correctly reference the component.

To verify the proper import and registration of IconEllipsis, run the following command:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if 'iconEllipsis' is correctly imported and used in the component.

# Test: Find where 'iconEllipsis' is imported and ensure it's used appropriately.
rg --type js --type vue 'import.*iconEllipsis' -A 3

Length of output: 81


Script:

#!/bin/bash
# Description: Check if 'iconEllipsis' is correctly imported and used in the component across .js and .vue files.

# Test: Find where 'iconEllipsis' is imported and ensure it's used appropriately.
rg 'import\s+.*iconEllipsis' -g '*.js' -g '*.vue' -A 3

Length of output: 2156

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 23

🧹 Outside diff range and nitpick comments (36)
packages/design/aurora/src/upload-list/index.ts (1)

2-7: Consider enabling tooltips for better user experience

The state object configuration looks good overall:

  • Using a circular progress indicator (progressType: 'circle') is a common and user-friendly choice.
  • The progressStrokeWidth of 6 should provide a visible but not overpowering progress bar.

However, I noticed that tooltips are disabled (tooltipDisabled: true). Tooltips can provide valuable information to users, especially for upload progress. Consider enabling them to enhance the user experience.

Also, progressWidth is set to null. Ensure that this is intentional and that a default or dynamic width is applied elsewhere in the component.

packages/design/saas/src/upload-list/index.ts (1)

2-7: Consider enabling tooltips by default

The state object looks good overall, but consider changing the default value of tooltipDisabled to false. Tooltips can provide valuable information to users, and it's generally better to have them enabled by default for better user experience.

You could modify the line as follows:

-    tooltipDisabled: true
+    tooltipDisabled: false
packages/renderless/src/filter-box/vue.ts (3)

Line range hint 1-3: Fix typo in function name 'handeClick'

The function name 'handeClick' appears to have a typo. It should likely be 'handleClick' for consistency with other function names and better readability.

Please apply the following changes:

-import { handleClear, handeClick } from './index'
+import { handleClear, handleClick } from './index'

-export const api = ['state', 'handleClear', 'focus', 'blur', 'handeClick']
+export const api = ['state', 'handleClear', 'focus', 'blur', 'handleClick']

The addition of the new function to both imports and exports is consistent, which is good.


7-7: LGTM: Improved configurability for expandButtonIcon

The change to expandButtonIcon is good. It now allows for configuration through designConfig while providing a sensible default. The use of optional chaining is a good practice.

Consider using nullish coalescing (??) instead of logical OR (||) for the fallback:

-    expandButtonIcon: designConfig?.icons?.expandButton || 'IconDownWard'
+    expandButtonIcon: designConfig?.icons?.expandButton ?? 'IconDownWard'

This ensures that 'IconDownWard' is used only when designConfig?.icons?.expandButton is null or undefined, not for other falsy values like an empty string.


Line range hint 15-15: Fix typo and approve addition of new function

The addition of the new click handler function to the api object is good and consistent with the changes in imports and exports. However, the typo in the function name persists here.

Please apply the following change:

-    handeClick: handeClick({ props, emit })
+    handleClick: handleClick({ props, emit })

This change ensures consistency with the corrected import and export names, and improves code readability.

packages/renderless/src/breadcrumb-item/vue.ts (1)

33-33: Approved: Good use of fallback mechanism for separator.

The change introduces a flexible approach to determine the separator value, which aligns well with the PR objective of inlining x-design config. The use of optional chaining is a good practice to prevent potential errors.

For improved clarity, consider using nullish coalescing operators:

-    separator: computed(() => breadcrumb.separator || designConfig?.separator || '/')
+    separator: computed(() => breadcrumb.separator ?? designConfig?.separator ?? '/')

This change would ensure that falsy values like an empty string ('') are not unintentionally overridden by the fallbacks.

packages/design/saas/index.ts (1)

Line range hint 1-68: Summary of review findings and suggested next steps

The changes to add new components to the saas design package have been implemented correctly. However, there are some inconsistencies and areas for improvement:

  1. Inconsistencies between the summary and the actual code changes regarding the removal of Pager, Popeditor, and Popover components.
  2. The order of components in the export object could be improved for better readability and maintainability.

Suggested next steps:

  1. Clarify the status of Pager, Popeditor, and Popover components. If they are meant to be removed, update the code accordingly.
  2. Consider reordering the components alphabetically in the export object.
  3. Update the PR description or summary to accurately reflect the actual changes made in the code.
  4. Run the provided verification scripts to ensure all changes are intentional and consistent across the codebase.

To maintain consistency and ease future refactoring, consider implementing a more structured approach to component management:

  1. Use a separate configuration file to list all available components.
  2. Implement an automated script to generate the index.ts file based on this configuration.
  3. This approach would ensure consistency between imports and exports, maintain alphabetical order, and make it easier to add or remove components in the future.

Would you like assistance in implementing this improved component management system?

packages/vue/src/popconfirm/src/index.ts (1)

Action Required: Fix Remaining Component Name Typo in index.ts

The old component name 'Popconfim' is still present in packages/vue/src/popconfirm/src/index.ts:

name: $prefix + 'Popconfim',

Please update this occurrence to 'Popconfirm' to ensure consistency across the codebase.

🔗 Analysis chain

Line range hint 67-67: LGTM: Component name typo correction

The component name has been corrected from 'Popconfim' to 'Popconfirm', fixing a typo. This change ensures consistency between the component name and the file name.

To ensure that this change doesn't break any existing code, please verify that all references to this component have been updated. Consider running the following script to check for any remaining occurrences of the old component name:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining occurrences of the old component name

# Test: Search for 'Popconfim' in all files
rg --type-add 'vue:*.vue' --type vue --type typescript --type javascript 'Popconfim'

Length of output: 119


Script:

#!/bin/bash
# Description: Search for any remaining occurrences of the old component name in relevant file types

# Test: Search for 'Popconfim' in .ts, .tsx, .vue, .js, and .jsx files
rg 'Popconfim' --glob '*.ts' --glob '*.tsx' --glob '*.vue' --glob '*.js' --glob '*.jsx'

Length of output: 159

packages/vue/src/filter-box/src/pc.vue (2)

Line range hint 2-2: Fix typo in click event handler

There's a typo in the @click event handler. It should be handleClick instead of handeClick.

Please apply the following change:

- <div :class="['tiny-filter-box', disabled && 'disabled', blank && 'is-blank']" @click="handeClick">
+ <div :class="['tiny-filter-box', disabled && 'disabled', blank && 'is-blank']" @click="handleClick">

24-24: Consider consistent casing for imported icons

The icon imports and component registrations have been updated, which is good. However, there's an inconsistency in the casing between the imported icons and their usage in the component registration.

Consider applying the following changes for consistency:

- import { iconDownWard, iconError, iconHelpCircle } from '@opentiny/vue-icon'
+ import { IconDownWard, IconError, IconHelpCircle } from '@opentiny/vue-icon'

  components: {
-   IconDownWard: iconDownWard(),
-   IconError: iconError(),
-   IconHelpCircle: iconHelpCircle(),
+   IconDownWard: IconDownWard(),
+   IconError: IconError(),
+   IconHelpCircle: IconHelpCircle(),
    TinyTooltip
  },

This change ensures that the casing is consistent between the imports and their usage, which can prevent potential issues in case-sensitive environments.

Also applies to: 31-33

packages/renderless/src/action-menu/index.ts (1)

Line range hint 30-39: Approved: Default spacing update looks good.

The change from '5px' to '8px' as the default spacing is consistent with the refactoring objective. This minor adjustment should improve the visual appearance of the action menu when no specific spacing is provided.

Consider adding a brief comment explaining the reason for the '8px' default value, e.g.:

return designConfig?.props.spacing || '8px' // Default spacing for optimal visual balance

This would help future developers understand the rationale behind this specific value.

packages/vue/src/alert/src/pc.vue (1)

78-79: LGTM: New icon component added correctly.

The addition of IconWarningTriangle to the components object is correct and consistent with the new import.

For better readability and consistency, consider aligning the new component with the existing ones:

 IconWarning: iconWarning(),
-    IconWarningTriangle: iconWarningTriangle()
+IconWarningTriangle: iconWarningTriangle()
packages/renderless/src/time/vue.ts (2)

63-63: Approved: Good use of nullish coalescing for design config.

The change effectively incorporates the design configuration for showTimePickerButton while maintaining a default value. This aligns well with the PR's objective of inlining design configurations.

For improved clarity, consider destructuring designConfig at the function parameters to make it clear that it's an expected input:

- renderless = (props, { computed, onMounted, reactive, watch, nextTick }, { t, emit: $emit, vm, designConfig })
+ renderless = (props, { computed, onMounted, reactive, watch, nextTick }, { t, emit: $emit, vm, designConfig = {} })

This change would make it explicit that designConfig is an optional parameter with a default empty object, which could prevent potential undefined errors if designConfig is not provided.


Line range hint 1-114: Overall, the change is well-implemented and aligns with the PR objectives.

The modification to incorporate the design configuration for showTimePickerButton is a good step towards making the component more configurable. The rest of the file remains unchanged, which helps maintain the existing functionality while introducing this new flexibility.

Remember to update the component's documentation to reflect this new configurable option, as it may be valuable for users of the library.

packages/renderless/src/time-range/vue.ts (1)

74-74: Approved: Good use of nullish coalescing for default value

This change effectively sets a default value for showTimePickerRangeButton, ensuring it's true when not specified in the designConfig. This aligns well with the PR objective of inlining design configurations.

For improved clarity, consider extracting this logic into a separate constant:

const DEFAULT_SHOW_TIME_PICKER_RANGE_BUTTON = true;
state.showTimePickerRangeButton = designConfig?.showTimePickerRangeButton ?? DEFAULT_SHOW_TIME_PICKER_RANGE_BUTTON;

This makes the default value more explicit and easier to modify in the future if needed.

packages/vue/src/popconfirm/src/pc.vue (1)

Incomplete update of icon usage.

The IconWarning is still being used in packages/vue/src/popconfirm/src/mobile-first.vue. Please ensure that all instances of the old icon are updated to IconWarningTriangle.

🔗 Analysis chain

Line range hint 1-116: Verify icon usage and consider documentation update.

While the icon import and registration changes look good, please consider the following:

  1. Verify that the state.getIcon method in the component's logic (not visible in this file) has been updated to use the new IconWarningTriangle where appropriate.
  2. Consider updating the component's documentation to reflect this change in the warning icon, especially if it's a visible change that might affect users of the component.

To verify the state.getIcon method usage, you can run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for references to the old and new icon names in the component logic

echo "Searching for old icon name (IconWarning):"
rg --type vue "IconWarning" packages/vue/src/popconfirm

echo "\nSearching for new icon name (IconWarningTriangle):"
rg --type vue "IconWarningTriangle" packages/vue/src/popconfirm

echo "\nSearching for getIcon method:"
rg --type vue "getIcon" packages/vue/src/popconfirm

Length of output: 538


Script:

#!/bin/bash
# Description: Search for references to the old and new icon names in .vue files within packages/vue/src/popconfirm

echo "Searching for old icon name (IconWarning):"
rg "IconWarning" packages/vue/src/popconfirm --glob '*.vue'

echo "\nSearching for new icon name (IconWarningTriangle):"
rg "IconWarningTriangle" packages/vue/src/popconfirm --glob '*.vue'

echo "\nSearching for getIcon method:"
rg "getIcon" packages/vue/src/popconfirm --glob '*.vue'

Length of output: 875

packages/renderless/src/split/vue.ts (1)

54-54: Approve the change with a suggestion for clarity

The use of the nullish coalescing operator is a good improvement over the previous implementation. It correctly handles the case when designConfig?.triggerBarConWithLine is undefined or null, defaulting to true in those cases.

For even better clarity, consider adding a comment explaining the default behavior:

triggerBarConWithLine: designConfig?.triggerBarConWithLine ?? true, // Default to true if undefined or null

This will help future maintainers understand the intent behind this line of code.

packages/vue/src/dropdown/src/pc.vue (2)

119-120: LGTM! Consider unifying icon selection logic.

The changes introduce more flexibility in icon selection and safely handle potential undefined properties. This aligns well with the refactoring objective.

For consistency, consider unifying the icon selection logic for both IconDown and ButtonIconDown. You could create a helper function:

const getIcon = (suffix, config) => suffix || config?.icons?.dropdownIcon || iconDownWard()

Then use it like this:

const IconDown = getIcon(suffixIcon, state.designConfig)
const ButtonIconDown = getIcon(null, state.designConfig)

This would make the code more DRY and easier to maintain.


Line range hint 1-205: Overall LGTM! Consider test and documentation updates.

The changes in this file successfully refactor the dropdown component by inlining design configurations and improving code readability. The modifications align well with the PR objectives and don't introduce any breaking changes.

While the changes don't introduce new features, consider the following:

  1. Update any existing tests to reflect the new icon selection logic.
  2. If there's internal documentation about the component's structure or theming capabilities, it might be worth updating to reflect these changes.

These steps, while not critical for this refactor, can help maintain the overall quality and documentation of the codebase.

packages/renderless/src/time-spinner/index.ts (2)

282-282: Approve the change with a minor suggestion for improvement.

The addition of the nullish coalescing operator (??) to provide a default value for itemMarginSpace is a good improvement. It makes the code more robust by handling cases where designConfig or itemMarginSpace might be undefined.

For improved readability and to make the default value more explicit, consider extracting it to a named constant:

+ const DEFAULT_ITEM_MARGIN_SPACE = 12;
- vm.$refs[type].$el.querySelector(DATEPICKER.Qurtyli).offsetHeight + (designConfig?.itemMarginSpace ?? 12)
+ vm.$refs[type].$el.querySelector(DATEPICKER.Qurtyli).offsetHeight + (designConfig?.itemMarginSpace ?? DEFAULT_ITEM_MARGIN_SPACE)

This change would make it easier to update the default value in the future if needed and improve the code's self-documentation.


Line range hint 1-282: Additional observations for future improvements

While reviewing the file, I noticed a few points that, while not directly related to the current changes, could be addressed in future refactoring efforts:

  1. There's a potential typo in the scrollDown function (around line 214): diabledHour should probably be disabledHour.
  2. The file contains a mix of arrow functions and regular function declarations. Consider standardizing the function declaration style for consistency.
  3. Some functions, like scrollDown and selectDateScroll, are quite long and complex. These might benefit from refactoring into smaller, more focused functions to improve readability and maintainability.

These are suggestions for future improvements and don't need to be addressed in this PR unless you feel it's necessary.

packages/renderless/src/tree-node/index.ts (2)

363-364: LGTM! Consider adding type annotations for improved clarity.

The computedExpandIcon function effectively implements custom icon support with fallback to default icons. This enhancement improves flexibility for different design configurations.

Consider adding TypeScript type annotations to the function parameters and return type for improved code clarity and maintainability. For example:

export const computedExpandIcon = 
  ({ designConfig }: { designConfig: any }) => 
  (treeRoot: any, state: any): string => {
    // ... (existing implementation)
  }

Replace any with more specific types as appropriate for your codebase.


Line range hint 371-374: LGTM! Consider enhancing flexibility and adding type annotations.

The computedIndent function effectively calculates the indentation based on various factors. However, there are opportunities to improve its flexibility and clarity.

  1. Consider making the hardcoded values (1 and 8) configurable through the designConfig or tree properties. This would allow for more customization without changing the function.

  2. Add TypeScript type annotations to improve code clarity and maintainability. Here's an example:

export const computedIndent =
  (designConfig: any) =>
  ({ node, showLine }: { node: any; showLine: boolean }, { tree }: { tree: any }): string => {
    const levelIndent = designConfig?.levelIndent || 1;
    const lineIndent = designConfig?.lineIndent || 8;
    return (
      (node.level > 1 ? levelIndent : 0) * (parseInt(tree.indent) + (showLine ? lineIndent : 0)) +
      parseInt(tree.baseIndent) +
      'px'
    );
  };
  1. Consider using a more descriptive name for the 1 value, such as levelIndent, to clarify its purpose in the calculation.

These changes would enhance the function's flexibility and readability while maintaining its current functionality.

packages/vue/src/tree/src/tree-node.vue (1)

250-252: LGTM! Consider sorting imports alphabetically.

The addition of iconExpand and iconPutAway imports is appropriate for enhancing the tree node functionality. Grouping related imports together is a good practice.

Consider sorting the icon imports alphabetically for even better organization:

import {
  iconArrowBottom,
  iconChevronRight,
  iconDel,
  iconEdit,
  iconExpand,
  iconFinish,
  iconLoading,
  iconPlusSquare,
  iconPutAway
} from '@opentiny/vue-icon'
packages/design/saas/src/milestone/index.ts (3)

12-13: Avoid overusing !important in inline styles

Using !important in the inline styles for background and color can lead to specificity issues and make the styles harder to override in the future.

Unless absolutely necessary, consider removing !important or using CSS classes with appropriate specificity to manage styling more effectively.


20-21: Refactor complex calculation for left style property

The computation within the template literal for the left property is complex and may reduce code readability.

Consider breaking down the calculation into well-named intermediate variables or a helper function to enhance clarity and maintainability.

For example:

const dataIndex = props.flagBefore ? index : index + 1
const flagCount = props.data[dataIndex][props.flagField].length + 1
const leftPosition = (100 / flagCount) * (idx + 1) - 29

return {
  left: `calc(${leftPosition}% )`
}

21-21: Avoid magic numbers in style calculations

The value 29px used in the left calculation is a magic number, which can make the code less understandable.

Define 29px as a constant with a meaningful name to explain its purpose. This improves code readability and makes future adjustments easier.

For example:

const OFFSET_PX = 29
// ...
left: `calc(${leftPercentage}% - ${OFFSET_PX}px)`
packages/renderless/src/base-select/index.ts (3)

Line range hint 602-604: Translate code comments to English

The comment on lines 602-604 is in Chinese:

// tiny 新增的spacing (design中配置:aui为4,smb为0,tiny 默认为0)

To maintain consistency and readability across the codebase, please translate code comments into English.


Line range hint 1990-1996: Inconsistent parameter typing in function onClickCollapseTag

In the onClickCollapseTag function, the event parameter is explicitly typed as MouseEvent:

(event: MouseEvent) => {

However, other functions in the codebase do not explicitly type their parameters. For consistency, consider aligning the parameter typing style across all functions. If using TypeScript types, it would be beneficial to define parameter types in all function definitions.


Line range hint 2040-2050: Ensure props.modelValue is defined before accessing its properties

In the clearNoMatchValue function, there is a check that compares props.modelValue.length and newModelValue.length. Ensure that props.modelValue is always defined and is an array when props.multiple is true to avoid potential runtime errors.

packages/renderless/src/select/index.ts (6)

721-724: Translate code comments to English for consistency

The code comment on line 723 is in Chinese. Please translate it into English to ensure code readability and maintain consistency.


Line range hint 1360-1360: Translate code comments to English for consistency

The code comment on line 1360 is in Chinese. Please translate it into English to ensure code readability and maintain consistency.


Line range hint 1701-1701: Translate code comments to English for consistency

The code comment on line 1701 is in Chinese. Please translate it into English to ensure code readability and maintain consistency.


2019-2019: Translate code comments to English for consistency

The code comment on line 2019 is in Chinese. Please translate it into English to ensure code readability and maintain consistency.


Line range hint 2024-2024: Translate code comments to English for consistency

The code comment on line 2024 is in Chinese. Please translate it into English to ensure code readability and maintain consistency.


2364-2365: Translate code comments to English for consistency

The code comment on line 2365 is in Chinese. Please translate it into English to ensure code readability and maintain consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 50489a1 and 33be669.

📒 Files selected for processing (68)
  • packages/design/aurora/index.ts (2 hunks)
  • packages/design/aurora/src/alert/index.ts (0 hunks)
  • packages/design/aurora/src/breadcrumb-item/index.ts (1 hunks)
  • packages/design/aurora/src/filter-box/index.ts (1 hunks)
  • packages/design/aurora/src/milestone/index.ts (1 hunks)
  • packages/design/aurora/src/popconfirm/index.ts (1 hunks)
  • packages/design/aurora/src/split/index.ts (1 hunks)
  • packages/design/aurora/src/time-range/index.ts (1 hunks)
  • packages/design/aurora/src/time-spinner/index.ts (1 hunks)
  • packages/design/aurora/src/time/index.ts (1 hunks)
  • packages/design/aurora/src/transfer-panel/index.ts (1 hunks)
  • packages/design/aurora/src/upload-list/index.ts (1 hunks)
  • packages/design/saas/index.ts (2 hunks)
  • packages/design/saas/src/alert/index.ts (0 hunks)
  • packages/design/saas/src/breadcrumb-item/index.ts (1 hunks)
  • packages/design/saas/src/filter-box/index.ts (1 hunks)
  • packages/design/saas/src/guide/index.ts (1 hunks)
  • packages/design/saas/src/milestone/index.ts (1 hunks)
  • packages/design/saas/src/popconfirm/index.ts (1 hunks)
  • packages/design/saas/src/split/index.ts (1 hunks)
  • packages/design/saas/src/time-range/index.ts (1 hunks)
  • packages/design/saas/src/time-spinner/index.ts (1 hunks)
  • packages/design/saas/src/time/index.ts (1 hunks)
  • packages/design/saas/src/transfer-panel/index.ts (1 hunks)
  • packages/design/saas/src/upload-list/index.ts (1 hunks)
  • packages/design/smb/index.ts (1 hunks)
  • packages/design/smb/src/action-menu/index.ts (0 hunks)
  • packages/design/smb/src/alert/index.ts (0 hunks)
  • packages/design/smb/src/dropdown-item/index.ts (0 hunks)
  • packages/design/smb/src/dropdown/index.ts (0 hunks)
  • packages/design/smb/src/filter-box/index.ts (0 hunks)
  • packages/design/smb/src/milestone/index.ts (0 hunks)
  • packages/design/smb/src/popconfirm/index.ts (0 hunks)
  • packages/design/smb/src/select/index.ts (0 hunks)
  • packages/design/smb/src/split/index.ts (0 hunks)
  • packages/design/smb/src/time-spinner/index.ts (0 hunks)
  • packages/design/smb/src/transfer-panel/index.ts (0 hunks)
  • packages/design/smb/src/tree-node/index.ts (0 hunks)
  • packages/design/smb/src/upload-list/index.ts (0 hunks)
  • packages/renderless/src/action-menu/index.ts (1 hunks)
  • packages/renderless/src/base-select/index.ts (2 hunks)
  • packages/renderless/src/breadcrumb-item/vue.ts (1 hunks)
  • packages/renderless/src/drawer/vue.ts (1 hunks)
  • packages/renderless/src/filter-box/vue.ts (1 hunks)
  • packages/renderless/src/guide/index.ts (1 hunks)
  • packages/renderless/src/milestone/index.ts (2 hunks)
  • packages/renderless/src/select/index.ts (3 hunks)
  • packages/renderless/src/split/vue.ts (1 hunks)
  • packages/renderless/src/time-range/vue.ts (1 hunks)
  • packages/renderless/src/time-spinner/index.ts (1 hunks)
  • packages/renderless/src/time/vue.ts (1 hunks)
  • packages/renderless/src/transfer-panel/vue.ts (1 hunks)
  • packages/renderless/src/tree-node/index.ts (1 hunks)
  • packages/renderless/src/upload-list/vue.ts (1 hunks)
  • packages/renderless/types/drawer.type.ts (0 hunks)
  • packages/theme/src/drawer/index.less (0 hunks)
  • packages/theme/src/popconfirm/vars.less (1 hunks)
  • packages/vue/src/alert/src/index.ts (1 hunks)
  • packages/vue/src/alert/src/pc.vue (2 hunks)
  • packages/vue/src/drawer/src/pc.vue (1 hunks)
  • packages/vue/src/dropdown-item/src/index.ts (1 hunks)
  • packages/vue/src/dropdown-item/src/pc.vue (2 hunks)
  • packages/vue/src/dropdown/src/pc.vue (3 hunks)
  • packages/vue/src/filter-box/src/pc.vue (1 hunks)
  • packages/vue/src/popconfirm/src/index.ts (1 hunks)
  • packages/vue/src/popconfirm/src/pc.vue (2 hunks)
  • packages/vue/src/select/src/pc.vue (3 hunks)
  • packages/vue/src/tree/src/tree-node.vue (2 hunks)
💤 Files with no reviewable changes (17)
  • packages/design/aurora/src/alert/index.ts
  • packages/design/saas/src/alert/index.ts
  • packages/design/smb/src/action-menu/index.ts
  • packages/design/smb/src/alert/index.ts
  • packages/design/smb/src/dropdown-item/index.ts
  • packages/design/smb/src/dropdown/index.ts
  • packages/design/smb/src/filter-box/index.ts
  • packages/design/smb/src/milestone/index.ts
  • packages/design/smb/src/popconfirm/index.ts
  • packages/design/smb/src/select/index.ts
  • packages/design/smb/src/split/index.ts
  • packages/design/smb/src/time-spinner/index.ts
  • packages/design/smb/src/transfer-panel/index.ts
  • packages/design/smb/src/tree-node/index.ts
  • packages/design/smb/src/upload-list/index.ts
  • packages/renderless/types/drawer.type.ts
  • packages/theme/src/drawer/index.less
✅ Files skipped from review due to trivial changes (12)
  • packages/design/aurora/src/breadcrumb-item/index.ts
  • packages/design/aurora/src/split/index.ts
  • packages/design/aurora/src/time-spinner/index.ts
  • packages/design/aurora/src/time/index.ts
  • packages/design/aurora/src/transfer-panel/index.ts
  • packages/design/saas/src/breadcrumb-item/index.ts
  • packages/design/saas/src/split/index.ts
  • packages/design/saas/src/time-range/index.ts
  • packages/design/saas/src/time-spinner/index.ts
  • packages/design/saas/src/time/index.ts
  • packages/design/saas/src/transfer-panel/index.ts
  • packages/renderless/src/drawer/vue.ts
🧰 Additional context used
🔇 Additional comments (43)
packages/design/saas/src/guide/index.ts (1)

3-3: Approved change, but clarification and follow-up actions needed.

The introduction of isUseModalOverlay: true aligns with the refactoring goal of inlining design configurations. However, a few points need attention:

  1. Could you please clarify the purpose of this new isUseModalOverlay property and how it differs from the removed btnOrderReversed? This will help in understanding the impact of this change.

  2. As this change might introduce new behavior, please consider updating the documentation to reflect this change and its implications for users of the guide component.

  3. It's recommended to add tests to ensure the new behavior works as expected, especially since this change could affect the component's functionality.

To ensure this new property is being used correctly throughout the codebase, please run the following verification script:

This will help identify any places where the new property is being used and ensure it's implemented consistently.

✅ Verification successful

Usage of isUseModalOverlay Verified and Approved.

The isUseModalOverlay property has been successfully integrated and is correctly utilized in the following files:

  • packages/renderless/src/guide/index.ts
  • packages/design/saas/src/guide/index.ts
  • packages/design/aurora/src/guide/index.ts

This aligns with the refactoring goal of inlining all x-design design configurations.

Additional Recommendations:

  1. Documentation Update: Please ensure that the documentation is updated to reflect the introduction of the isUseModalOverlay property and its implications for users of the guide component.

  2. Testing: It's recommended to add tests to verify the new behavior introduced by isUseModalOverlay, ensuring that the modal overlay functions as expected.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of isUseModalOverlay in the codebase
rg --type typescript --type vue 'isUseModalOverlay'

Length of output: 86


Script:

#!/bin/bash
# Corrected search for usages of isUseModalOverlay in TypeScript and Vue files using updated type aliases
rg --type ts --type vue 'isUseModalOverlay'

Length of output: 71


Script:

#!/bin/bash
# List available type aliases in ripgrep
rg --type-list

Length of output: 4821


Script:

#!/bin/bash
# Search for usages of isUseModalOverlay in TypeScript and Vue (JavaScript) files using correct type aliases
rg --type ts --type js 'isUseModalOverlay'

Length of output: 289

packages/design/aurora/src/time-range/index.ts (1)

3-3: Approved change with recommendations

The modification of showTimePickerRangeButton from true to false aligns with the PR's refactoring objective. However, this change has some implications:

  1. It alters the default behavior of the time-picker component, which may affect existing users.
  2. The documentation should be updated to reflect this change in default behavior.
  3. A test should be added to verify that the range button is hidden by default.

To ensure this change doesn't unintentionally affect other parts of the codebase, please run the following verification:

Would you like assistance in updating the documentation or creating a test for this change?

✅ Verification successful

Change Verified

The modification of showTimePickerRangeButton from true to false aligns with the refactoring objective and maintains consistency across the codebase. However, please consider the following:

  1. Impact on Users: The range button will now be hidden by default, which may affect existing users who rely on this feature.
  2. Documentation Update: Ensure that the documentation reflects this change in default behavior to inform users of the updated functionality.
  3. Testing: Add tests to verify that the range button is indeed hidden by default and that the component behaves as expected.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usages of showTimePickerRangeButton
rg 'showTimePickerRangeButton' --type ts

Length of output: 408

packages/design/smb/index.ts (1)

1-7: Clarify the impact of removing all component imports and entries.

The removal of all component imports and their corresponding entries from the components object is a significant change that raises several concerns:

  1. How will the components previously defined in this file be accessed and used after this change?
  2. Does this change align with the stated PR objective of "inlining all x-design design config"?
  3. This change appears to be potentially breaking, which contradicts the PR statement of no breaking changes. Can you clarify how this won't affect existing applications?

To better understand the impact of these changes, let's check for any references to the removed components:

Consider the following architectural advice:

  1. If the components are being moved elsewhere, ensure there's a clear migration path for existing users.
  2. Update the documentation to reflect these changes and provide guidance on how to use the components in the new structure.
  3. If this is part of a larger refactoring effort, consider breaking it down into smaller, more manageable PRs to reduce the risk of introducing bugs or breaking changes.

Would you like assistance in drafting documentation updates or creating a migration guide for these changes?

packages/design/saas/src/popconfirm/index.ts (3)

1-1: LGTM: Import statement is correct and used.

The import of iconWarning from '@opentiny/vue-icon' is properly done and the imported function is used in the file.


3-7: LGTM: Default export structure is appropriate.

The default export of an object containing the icons property is a clean and maintainable way to organize and expose the icon configurations.


1-7: Summary: Changes align with PR objectives.

This new file successfully inlines the icon configuration for the popconfirm component, which aligns with the PR's objective of refactoring and inlining design configurations. The implementation is straightforward and doesn't introduce any breaking changes, maintaining compatibility with existing applications.

packages/design/aurora/src/filter-box/index.ts (3)

1-1: LGTM: Proper icon import.

The import statement for iconArrowBottom from '@opentiny/vue-icon' is correct and follows good practices for tree-shaking.


3-7: LGTM: Well-structured default export.

The default export object is well-structured and allows for easy extension in the future if needed.


1-7: Overall assessment: Good structure with a minor improvement suggestion.

The file is well-structured and follows project conventions. The main suggestion is to reconsider how the icon function is passed in the configuration object. Otherwise, the implementation looks good and serves its purpose of providing a configuration for the filter-box component.

To ensure consistency across the codebase, let's check how icon functions are typically used:

This will help us verify if the suggested change aligns with the project's conventions for icon usage.

packages/design/saas/src/filter-box/index.ts (2)

1-1: LGTM: Import statement is correct and necessary.

The import of iconArrowBottom from '@opentiny/vue-icon' is properly done and is used in the exported object.


1-7: Summary: New file aligns with PR objectives.

This new file introduces the configuration for the FilterBox component, which aligns with the PR's objective of refactoring the x-design design configuration. The changes are consistent with the described refactoring effort and do not appear to introduce functional changes or API alterations.

To ensure this change doesn't introduce any breaking changes, let's verify if there are any existing usages of the FilterBox component that might be affected:

✅ Verification successful

Verification Successful: FilterBox usages are consistent with refactoring.

The refactoring of the FilterBox component in packages/design/saas/src/filter-box/index.ts aligns with the PR objectives and does not impact existing usages across the codebase. All current instances of the FilterBox component remain compatible with the refactored configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for existing usages of FilterBox component

# Test: Look for FilterBox imports or usages
rg --type vue --type typescript --type javascript 'FilterBox'

Length of output: 89


Script:

#!/bin/bash
# Description: Search for existing usages of FilterBox component

# Test: Look for FilterBox imports or usages across relevant file types
rg --type typescript --type javascript 'FilterBox'

Length of output: 85


Script:

#!/bin/bash
# Description: Search for existing usages of FilterBox component

# Test: Look for FilterBox imports or usages in .ts, .js, and .vue files
rg 'FilterBox' -g '*.ts' -g '*.js' -g '*.vue'

Length of output: 3217

packages/design/aurora/src/upload-list/index.ts (1)

1-12: LGTM: Well-structured configuration export

The overall structure of this export is clean and well-organized. Separating the configuration into state and icons provides a clear distinction between different types of settings, making it easier to understand and maintain.

packages/design/saas/src/upload-list/index.ts (2)

1-12: LGTM: Well-structured export object

The overall structure of the export is clean and well-organized. It separates concerns between state-related and icon-related properties, which allows for easy maintenance and future extensions.


8-11: Clarify the purpose of preViewComponent

The icons object looks good, but the preViewComponent is set to an empty string. Is this intentional, or is it a placeholder for future implementation?

If it's intended to be implemented later, consider adding a TODO comment for clarity:

  icons: {
    closeComponent: 'icon-close',
-    preViewComponent: ''
+    preViewComponent: '' // TODO: Implement preview component
  }
packages/design/aurora/index.ts (2)

2-22: LGTM: New component imports added correctly.

The new component imports have been added in the correct alphabetical order, maintaining the existing code structure and improving readability.


37-57: LGTM: New components added to exports correctly.

The newly imported components have been correctly added to the components object in the default export, maintaining alphabetical order and consistency with the import statements.

packages/theme/src/popconfirm/vars.less (1)

39-39: LGTM! Verify consistency across the codebase.

The update from var(--tv-color-warning-icon) to var(--tv-color-warn-icon) appears to be a valid semantic change, aligning with a possible standardization of naming conventions.

To ensure consistency and prevent potential styling issues, please run the following script to check for any remaining occurrences of the old variable name:

If any occurrences are found, consider updating them to maintain consistency across the codebase.

✅ Verification successful

LGTM! No occurrences of --tv-color-warning-icon found. Please ensure naming consistency across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for occurrences of the old variable name across the codebase

# Search for the old variable name
echo "Searching for occurrences of --tv-color-warning-icon:"
rg --type css --type less "--tv-color-warning-icon"

# Search for other occurrences of "warning" in color variable names
echo "Searching for other occurrences of 'warning' in color variable names:"
rg --type css --type less "-color-warning-\w+"

Length of output: 1195


Script:

#!/bin/bash
# Description: Corrected script to check for occurrences of the old variable name across the codebase

# Search for the old variable name
echo "Searching for occurrences of --tv-color-warning-icon:"
rg --type css --type less "--tv-color-warning-icon" .

# Search for other occurrences of "warning" in color variable names
echo "Searching for other occurrences of 'warning' in color variable names:"
rg --type css --type less "-color-warning-\w+" .

Length of output: 1227


Script:

#!/bin/bash
# Description: Corrected script to check for occurrences of the old variable name across the codebase

# Search for the old variable name
echo "Searching for occurrences of --tv-color-warning-icon:"
rg --type css --type less -e "--tv-color-warning-icon" .

# Search for other occurrences of "warning" in color variable names
echo "Searching for other occurrences of 'warning' in color variable names:"
rg --type css --type less -e "-color-warning-\w+" .

Length of output: 8724


Script:

#!/bin/bash
# Description: Corrected script to check for occurrences of the old variable name across the codebase

# Search for the old variable name
echo "Searching for occurrences of --tv-color-warning-icon:"
rg --type css --type less -- "--tv-color-warning-icon" .

# Search for other occurrences of "warning" in color variable names
echo "Searching for other occurrences of 'warning' in color variable names:"
rg --type css --type less -- "-color-warning-\\w+" .

Length of output: 8724

packages/vue/src/filter-box/src/pc.vue (2)

Line range hint 2-2: LGTM: Improved class bindings and value rendering

The updated class bindings for the main div and the improved value rendering logic in the p.value element look good. These changes enhance the component's flexibility and handle edge cases better.

Also applies to: 9-10


Line range hint 1-67: Overall assessment: Good refactoring with minor improvements needed

The changes to this component are generally positive:

  1. The template now has more flexible class bindings.
  2. Value rendering has been improved to handle edge cases better.
  3. Icon imports and registrations have been updated for consistency.

However, there are a couple of minor issues to address:

  1. A typo in the click event handler needs to be fixed.
  2. The casing of imported icons should be made consistent with their usage in component registration.

Once these small issues are resolved, this refactoring will improve the component's flexibility and maintainability.

packages/vue/src/dropdown-item/src/index.ts (1)

18-18: Icon name updated for consistency.

The icon name for leftWardArrow has been changed from 'icon-delta-left' to 'icon-left-ward-arrow'. This change appears to be part of the refactoring effort to inline design configurations.

To ensure consistency across the codebase, let's verify if this icon name is used elsewhere and if similar changes have been made:

This script will help us identify if the change has been consistently applied across the codebase and if there are any remaining instances of the old icon name that need to be updated.

✅ Verification successful

Icon name update verified.

All instances of 'icon-delta-left' have been successfully replaced with 'icon-left-ward-arrow'. No remaining references to the old icon name were found in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for occurrences of both old and new icon names

echo "Checking for occurrences of 'icon-delta-left':"
rg --type typescript --type vue "icon-delta-left"

echo "\nChecking for occurrences of 'icon-left-ward-arrow':"
rg --type typescript --type vue "icon-left-ward-arrow"

echo "\nChecking for other occurrences of 'leftWardArrow' in ICON_MAP:"
rg --type typescript --type vue "ICON_MAP.*leftWardArrow"

Length of output: 646


Script:

#!/bin/bash
# Description: Check for occurrences of both old and new icon names

echo "Checking for occurrences of 'icon-delta-left':"
rg --type ts --type vue "icon-delta-left"

echo "\nChecking for occurrences of 'icon-left-ward-arrow':"
rg --type ts --type vue "icon-left-ward-arrow"

echo "\nChecking for other occurrences of 'leftWardArrow' in ICON_MAP:"
rg --type ts --type vue "ICON_MAP.*leftWardArrow"

Length of output: 601


Script:

#!/bin/bash
# Description: Check for occurrences of both old and new icon names

echo "Checking for occurrences of 'icon-delta-left':"
rg -g "*.ts" -g "*.vue" "icon-delta-left"

echo "\nChecking for occurrences of 'icon-left-ward-arrow':"
rg -g "*.ts" -g "*.vue" "icon-left-ward-arrow"

echo "\nChecking for other occurrences of 'leftWardArrow' in ICON_MAP:"
rg -g "*.ts" -g "*.vue" "ICON_MAP.*leftWardArrow"

Length of output: 603

packages/vue/src/alert/src/pc.vue (1)

55-55: LGTM: New icon import added correctly.

The addition of iconWarningTriangle to the import statement is consistent with the existing pattern and aligns with the component's needs.

packages/renderless/src/time-range/vue.ts (1)

Line range hint 1-95: Overall assessment: Good refactoring of design configuration

The change in this file successfully inlines the showTimePickerRangeButton configuration from the design config, providing a sensible default. This aligns well with the PR's objective of refactoring and inlining x-design configurations. The implementation is clean and doesn't introduce any breaking changes.

packages/vue/src/popconfirm/src/pc.vue (2)

58-58: LGTM: Icon import updated correctly.

The import statement has been updated to replace iconWarning with iconWarningTriangle. This change is consistent with the intended refactoring of the design configuration.


68-68: LGTM: Icon component registration updated correctly.

The component registration has been updated to use IconWarningTriangle instead of IconWarning, which is consistent with the import statement change. This ensures that the new warning triangle icon is properly integrated into the component.

packages/renderless/src/split/vue.ts (1)

Line range hint 1-118: Overall impact of the change is minimal and positive

The modification to the triggerBarConWithLine property is the only change in this file. It improves the handling of the designConfig?.triggerBarConWithLine value without altering the overall structure or logic of the renderless function or the useOffset function.

This change enhances the robustness of the code by explicitly handling undefined or null values for the triggerBarConWithLine configuration. The rest of the file, including exported APIs and other reactive state properties, remains unchanged.

packages/vue/src/dropdown-item/src/pc.vue (2)

73-73: LGTM! Verify visual appearance after icon change.

The change from iconDeltaLeft to iconLeftWardArrow looks good. The new icon name is more descriptive, which improves code readability.

Please verify that the new icon visually matches the intended design and doesn't negatively impact the component's appearance.


Line range hint 89-93: LGTM! Please provide implementation details for new props.

The addition of new props (appendToBody, textField, tip, tipPosition, and effect) and the corresponding icon component change look good. These additions enhance the component's configurability.

Could you please provide details on how these new props are implemented in the component's logic? I don't see any usage of these props in the template or script sections. Consider adding comments or updating the template to reflect how these props affect the component's behavior.

To verify the usage of these new props, you can run the following script:

Also applies to: 106-106

packages/renderless/src/upload-list/vue.ts (5)

76-76: LGTM: Default progressType set to 'line'

The change provides a default value for progressType, which is good for maintaining consistent behavior. The use of optional chaining is appropriate for safely accessing nested properties.


81-81: LGTM: Default progressStrokeWidth set to 4

The change provides a default value for progressStrokeWidth, which is good for maintaining consistent behavior. The use of optional chaining is appropriate for safely accessing nested properties.


82-82: LGTM: Improved tooltipDisabled default behavior

The use of the nullish coalescing operator (??) for tooltipDisabled is a good improvement. It allows for a more flexible default behavior, treating undefined and null values as falsy and defaulting to false.


83-83: LGTM: Default closeComponent set to 'icon-del'

The change provides a default value for closeComponent, which is good for maintaining consistent behavior. The use of optional chaining is appropriate for safely accessing nested properties.


76-87: Overall assessment: Improved configurability and consistency

The changes in this file enhance the upload list component's configurability by providing sensible default values for various properties. This ensures consistent behavior when specific configurations are not provided. The use of optional chaining and nullish coalescing operators improves the code's robustness.

While the changes are generally good, there are opportunities to further simplify some of the conditional assignments, as noted in the individual comments.

To ensure that these changes don't introduce any regressions, please run the following verification script:

This script will help identify any potential impacts on other parts of the codebase and verify that the default values are being used as expected.

packages/vue/src/drawer/src/pc.vue (1)

101-106: LGTM. Verify consistency with UX guidelines and update documentation if needed.

The changes to the footer button order look good. The cancel button now precedes the confirm button, which is a common pattern in many UI designs.

To ensure consistency across the project:

  1. Verify if this button order is consistent with other components and follows the project's UX guidelines.
  2. Update any relevant documentation or style guides to reflect this change in button order.
packages/vue/src/dropdown/src/pc.vue (2)

171-173: LGTM! Improved readability with template literals.

The reformatting of class attribute concatenation using template literals enhances code readability without changing functionality. This is a good practice that makes the code easier to maintain.

Also applies to: 181-183


20-20: LGTM! Verify icon usage throughout the component.

The removal of the iconDeltaDown import and the retention of iconDownWard aligns with the refactoring objective. This change simplifies the icon imports and potentially reduces bundle size.

To ensure this change doesn't introduce any issues, please run the following script to verify that iconDeltaDown is not used elsewhere in this file:

✅ Verification successful

Verified! iconDeltaDown is no longer used in packages/vue/src/dropdown/src/pc.vue. The import removal is safe.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of iconDeltaDown in the file

rg 'iconDeltaDown' packages/vue/src/dropdown/src/pc.vue

Length of output: 55


Script:

#!/bin/bash
# Description: Search for any usage of iconDeltaDown throughout the entire codebase

rg 'iconDeltaDown'

Length of output: 876

packages/renderless/src/tree-node/index.ts (1)

Line range hint 1-374: Summary: Enhancements to tree node customization

The changes introduced in this file add two new functions, computedExpandIcon and computedIndent, which enhance the flexibility and customization options for the tree component. These additions allow for:

  1. Custom icon support with fallback to default icons
  2. More flexible indentation calculation based on various factors

These changes align well with the PR objective of refactoring and inlining design configurations. They do not introduce breaking changes and should improve the component's adaptability to different design requirements.

To further improve the code:

  1. Consider adding comprehensive TypeScript type annotations throughout the file for better maintainability and developer experience.
  2. Evaluate if other functions in this file could benefit from similar flexibility enhancements, particularly regarding design configuration options.
packages/vue/src/tree/src/tree-node.vue (2)

338-339: LGTM! Component registrations are consistent.

The registration of IconExpand and IconPutAway components is consistent with the component registration pattern used throughout the file. This ensures that the new icons can be used in the template.


Line range hint 321-324: LGTM! Verify usage of isShowFocusBg in the template.

The addition of the isShowFocusBg prop is clear and well-documented. Its purpose is to control the display of the tree node focus background color.

Please ensure that this prop is correctly used in the template. Run the following script to verify its usage:

✅ Verification successful

Usage of isShowFocusBg Verified

The isShowFocusBg prop is correctly utilized in both tree-node.vue and pc.vue to control the display of the tree node focus background color.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of isShowFocusBg prop in the template

# Test: Search for isShowFocusBg in the template section
rg --type vue 'isShowFocusBg' packages/vue/src/tree/src/tree-node.vue

Length of output: 97


Script:

#!/bin/bash
# Description: Verify the usage of isShowFocusBg prop in the template

# Test: Search for isShowFocusBg in all .vue files
rg 'isShowFocusBg' --glob '/*.vue'

Length of output: 183


Script:

#!/bin/bash
# Description: Verify the usage of isShowFocusBg prop in the template

# Test: Search for isShowFocusBg in all .vue files recursively
rg 'isShowFocusBg' --glob '**/*.vue'

Length of output: 397

packages/design/aurora/src/milestone/index.ts (1)

4-16: Great implementation of dynamic styling based on node status

The getMileIcon function effectively calculates styling based on the node's status and properties, allowing for dynamic and customizable milestone icons. This enhances the flexibility and user experience of the component.

packages/renderless/src/guide/index.ts (1)

84-84: Update to 'useModalOverlay' property is appropriate

The change ensures that useModalOverlay is set based on designConfig.state.isUseModalOverlay if defined, defaulting to false otherwise. This adds clarity and explicit control over the modal overlay behavior in the tour configuration.

packages/vue/src/select/src/pc.vue (1)

615-625: Verify the updated icon imports and their usage

The icons have been renamed to follow a consistent camelCase naming convention. Ensure that all references to these icons in the template and script sections are updated to match the new names to prevent any runtime errors.

Run the following script to check for any remaining references to the old icon names:

✅ Verification successful

Adjusting the search command to correctly target .vue files for icon name verification.


All updated icon imports and their usages are consistent with the new camelCase naming convention. No issues found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any usage of old icon names in the codebase.

rg --type vue 'IconClose[^a-zA-Z]|IconHalfselect[^a-zA-Z]|IconCheck[^a-zA-Z]|IconCheckedSur[^a-zA-Z]|IconCopy[^a-zA-Z]|IconDeltaDown[^a-zA-Z]|IconSearch[^a-zA-Z]|IconEllipsis[^a-zA-Z]|IconChevronUp[^a-zA-Z]'

Length of output: 237


Script:

#!/bin/bash
# Description: Search for any usage of old icon names in .vue files by targeting the .vue extension explicitly.

rg 'IconClose[^a-zA-Z]|IconHalfselect[^a-zA-Z]|IconCheck[^a-zA-Z]|IconCheckedSur[^a-zA-Z]|IconCopy[^a-zA-Z]|IconDeltaDown[^a-zA-Z]|IconSearch[^a-zA-Z]|IconEllipsis[^a-zA-Z]|IconChevronUp[^a-zA-Z]' --glob '*.vue'

Length of output: 32927

packages/renderless/src/base-select/index.ts (2)

Line range hint 600-621: Input height calculation logic appears correct

The modifications in the resetInputHeight function correctly adjust the input height based on designConfig, spacingHeight, and tagsClientHeight, ensuring proper UI rendering across different design configurations.


1699-1700: Default size map initialization is appropriate

The initialization of defaultSizeMap and the use of designConfig?.state?.sizeMap provide flexibility for handling different select sizes based on the design configuration.

Comment on lines +1 to +7
import { iconWarning } from '@opentiny/vue-icon'

export default {
icons: {
warning: iconWarning()
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider expanding the file content or renaming it

The file name index.ts suggests it might be the main entry point for the popconfirm component, but it only exports icons. Consider either:

  1. Expanding this file to include more popconfirm-related exports, or
  2. Renaming it to something more specific like popconfirm-icons.ts to better reflect its current content.

If you decide to expand the file, you could structure it like this:

import { iconWarning } from '@opentiny/vue-icon'
import { PopconfirmComponent } from './popconfirm-component'

export const PopconfirmIcons = {
  warning: iconWarning
}

export { PopconfirmComponent }

export default {
  component: PopconfirmComponent,
  icons: PopconfirmIcons
}

This structure allows for more flexibility and clear separation of concerns.


🛠️ Refactor suggestion

Add type information for better TypeScript support

To improve type safety and developer experience, consider adding type information to the exported object.

Here's how you could add types:

import { iconWarning } from '@opentiny/vue-icon'

interface PopconfirmIcons {
  warning: ReturnType<typeof iconWarning>
}

const icons: PopconfirmIcons = {
  warning: iconWarning()
}

export default {
  icons
}

This change provides better type inference and documentation for users of this module.


export default {
icons: {
warning: iconWarning()
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider lazy initialization of the icon

The warning icon is currently initialized immediately when this module is imported. If the icon is not always used, this could be unnecessary.

Consider lazy initialization:

import { iconWarning } from '@opentiny/vue-icon'

export default {
  icons: {
    get warning() {
      return iconWarning()
    }
  }
}

This approach will only create the icon when it's actually accessed, potentially improving performance.

Comment on lines +4 to +6
icons: {
warning: iconWarning()
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Add type information to the icons object.

The icons object in packages/design/saas/src/popconfirm/index.ts does not have a type annotation. Adding type information will enhance code clarity and maintainability.

🔗 Analysis chain

Consider adding type information and reviewing icon requirements.

The initialization of the warning icon looks good. However, there are a couple of suggestions for improvement:

  1. Add type information to enhance code clarity and maintainability. For example:

    interface Icons {
      warning: ReturnType<typeof iconWarning>;
    }
    
    const icons: Icons = {
      warning: iconWarning()
    };
  2. Review if the popconfirm component might need additional icons (e.g., success, error) to cover all use cases.

To verify if other icons are used in the popconfirm component, you can run:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for icon usage in popconfirm-related files
rg --type typescript --type vue 'icon' packages/design/saas/src/popconfirm

Length of output: 109


Script:

#!/bin/bash
# Search for icon usage in popconfirm-related files with correct type identifiers
rg --type ts --type vue 'icon' packages/design/saas/src/popconfirm

Length of output: 94


Script:

#!/bin/bash
# Search for icon usage in popconfirm-related files with correct type identifiers
rg --type ts --type-add 'vue:*.vue' --type vue 'icon' packages/design/saas/src/popconfirm

Length of output: 311


Script:

#!/bin/bash
# Check if 'icons' object has a type annotation in index.ts
rg 'icons\s*:\s*\w+' packages/design/saas/src/popconfirm/index.ts

Length of output: 67

Comment on lines +4 to +6
icons: {
expandButton: iconArrowBottom()
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consider passing the icon function as a reference.

The current implementation calls iconArrowBottom() immediately. This might not be the intended behavior, as it executes the function at import time rather than when the icon is actually needed.

Consider modifying the code to pass the function reference instead:

 icons: {
-  expandButton: iconArrowBottom()
+  expandButton: iconArrowBottom
 }

This change allows the icon function to be called when it's actually used, which is typically the desired behavior in Vue components.

📝 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
icons: {
expandButton: iconArrowBottom()
}
icons: {
expandButton: iconArrowBottom
}

Comment on lines +3 to +7
export default {
icons: {
expandButton: iconArrowBottom()
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider adding type information and lazy evaluation.

The exported object structure is clear, but there are two suggestions for improvement:

  1. Add type information for better maintainability and developer experience.
  2. Consider lazy evaluation of the icon function to potentially improve performance.

Here's a suggested implementation with these improvements:

import { IconComponent } from '@opentiny/vue-icon'
import { iconArrowBottom } from '@opentiny/vue-icon'

interface FilterBoxConfig {
  icons: {
    expandButton: () => IconComponent
  }
}

export default {
  icons: {
    expandButton: () => iconArrowBottom()
  }
} as FilterBoxConfig

This implementation:

  • Adds type information for better maintainability.
  • Uses lazy evaluation for the icon function, which may improve performance by only creating the icon when it's actually used.

Comment on lines +19 to +21
left: `calc(${
(100 / (props.data[props.flagBefore ? index : index + 1][props.flagField].length + 1)) * (idx + 1)
}% - 29px)`
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure safe access to nested properties in props.data

The calculation for the left property accesses props.data[props.flagBefore ? index : index + 1][props.flagField].length. If props.data does not have the expected structure, or if any nested property is undefined, this could cause runtime errors.

Add checks to confirm that props.data, props.data[...], and props.data[...][props.flagField] exist before accessing length. This will prevent potential exceptions due to undefined properties.

Comment on lines +76 to +93
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove unused 'BOX_SHADOW_PX' properties from 'smbConstants'

The BOX_SHADOW_PX properties defined in smbConstants.STATUS_COLOR_MAP are not being utilized in the returned style objects within getMileIcon. Instead, boxShadow is set to 'unset' in all cases. If these properties are unnecessary, consider removing them to simplify the constants and avoid confusion.

Apply this diff to remove the unused BOX_SHADOW_PX properties:

 STATUS_COLOR_MAP: {
   DEFAULT: {
     BORDER_COLOR: '#C2C2C2',
     BACKGROUND_COLOR: '#FFFFFF',
     COLOR: '#191919',
-    BOX_SHADOW_PX: '0px 0px 0px 4px',
     FLAG_CONTENT_CLS: '.content',
   },
   COMPLETED: {
     BORDER_COLOR: '#191919',
     BACKGROUND_COLOR: '#FFFFFF',
     COLOR: '#191919',
-    BOX_SHADOW_PX: '0px 0px 0px 4px',
     FLAG_CONTENT_CLS: '.content',
   },
   DOING: {
     BORDER_COLOR: '#191919',
     BACKGROUND_COLOR: '#191919',
     COLOR: '#FFFFFF',
-    BOX_SHADOW_PX: '0px 0px 0px 4px',
     FLAG_CONTENT_CLS: '.content',
   },
 }

Also applies to: 104-121

Comment on lines +165 to +167
left: `calc(${(100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length) * idx}% + ${
idx * 8
}px)`
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Simplify the calculation in the 'left' property for better readability

The calculation inside the 'left' property is complex and can be challenging to read and maintain. Consider extracting intermediate variables to improve clarity and maintainability.

Apply this diff to refactor the calculation:

 export const getFlagStyle =
   (props) =>
   ({ index, idx }) => {
+    const dataIndex = props.flagBefore ? index : index + 1
+    const flags = props.data[dataIndex][props.flagField]
+    const flagsLength = flags.length
+    const percentage = (100 / flagsLength) * idx
+    const pixels = idx * 8
     return {
-      left: `calc(${(100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length) * idx}%  + ${
-        idx * 8
-      }px)`
+      left: `calc(${percentage}% + ${pixels}px)`
     }
   }
📝 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
left: `calc(${(100 / props.data[props.flagBefore ? index : index + 1][props.flagField].length) * idx}% + ${
idx * 8
}px)`
export const getFlagStyle =
(props) =>
({ index, idx }) => {
const dataIndex = props.flagBefore ? index : index + 1
const flags = props.data[dataIndex][props.flagField]
const flagsLength = flags.length
const percentage = (100 / flagsLength) * idx
const pixels = idx * 8
return {
left: `calc(${percentage}% + ${pixels}px)`
}
}

Comment on lines +70 to +93
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Define 'smbConstants' outside of 'getMileIcon' to improve performance

The smbConstants object is currently defined inside the getMileIcon function, which means it's recreated every time the function is called. Since smbConstants is a constant and does not change between function calls, consider moving it outside the function to avoid unnecessary overhead.

Apply this diff to move smbConstants outside the getMileIcon function:

+ const smbConstants = {
+   STATUS_COLOR_MAP: {
+     DEFAULT: {
+       BORDER_COLOR: '#C2C2C2',
+       BACKGROUND_COLOR: '#FFFFFF',
+       COLOR: '#191919',
+       BOX_SHADOW_PX: '0px 0px 0px 4px',
+       FLAG_CONTENT_CLS: '.content',
+     },
+     COMPLETED: {
+       BORDER_COLOR: '#191919',
+       BACKGROUND_COLOR: '#FFFFFF',
+       COLOR: '#191919',
+       BOX_SHADOW_PX: '0px 0px 0px 4px',
+       FLAG_CONTENT_CLS: '.content',
+     },
+     DOING: {
+       BORDER_COLOR: '#191919',
+       BACKGROUND_COLOR: '#191919',
+       COLOR: '#FFFFFF',
+       BOX_SHADOW_PX: '0px 0px 0px 4px',
+       FLAG_CONTENT_CLS: '.content',
+     },
+   },
+ }

 export const getMileIcon =
   ({ constants, props }: Pick<IMilestoneRenderlessParams, 'constants' | 'props'>) =>
   (node: IMilestoneNode): IMilestoneIconStyle => {
-    const smbConstants = {
-      STATUS_COLOR_MAP: {
-        DEFAULT: {
-          BORDER_COLOR: '#C2C2C2',
-          BACKGROUND_COLOR: '#FFFFFF',
-          COLOR: '#191919',
-          BOX_SHADOW_PX: '0px 0px 0px 4px',
-          FLAG_CONTENT_CLS: '.content',
-        },
-        COMPLETED: {
-          BORDER_COLOR: '#191919',
-          BACKGROUND_COLOR: '#FFFFFF',
-          COLOR: '#191919',
-          BOX_SHADOW_PX: '0px 0px 0px 4px',
-          FLAG_CONTENT_CLS: '.content',
-        },
-        DOING: {
-          BORDER_COLOR: '#191919',
-          BACKGROUND_COLOR: '#191919',
-          COLOR: '#FFFFFF',
-          BOX_SHADOW_PX: '0px 0px 0px 4px',
-          FLAG_CONTENT_CLS: '.content',
-        },
-      },
-    }
📝 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
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
const smbConstants = {
STATUS_COLOR_MAP: {
DEFAULT: {
BORDER_COLOR: '#C2C2C2',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
COMPLETED: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#FFFFFF',
COLOR: '#191919',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
},
DOING: {
BORDER_COLOR: '#191919',
BACKGROUND_COLOR: '#191919',
COLOR: '#FFFFFF',
BOX_SHADOW_PX: '0px 0px 0px 4px',
FLAG_CONTENT_CLS: '.content'
}
}
}
export const getMileIcon =
({ constants, props }: Pick<IMilestoneRenderlessParams, 'constants' | 'props'>) =>
(node: IMilestoneNode): IMilestoneIconStyle => {
// Function body (not shown in the original snippet)

Comment on lines +678 to +694
IconClose: iconClose(),
TinyScrollbar,
IconCopy: IconCopy(),
IconAddCircle: IconAddCircle(),
IconLoadingShadow: IconLoadingShadow(),
IconCopy: iconCopy(),
IconAddCircle: iconAddCircle(),
IconLoadingShadow: iconLoadingShadow(),
TinySelectDropdown,
IconHalfselect: IconHalfselect(),
IconCheck: IconCheck(),
IconCheckedSur: IconCheckedSur(),
IconHalfselect: iconHalfselect(),
IconCheck: iconCheck(),
IconCheckedSur: iconCheckedSur(),
TinyFilterBox: FilterBox,
TinyTooltip,
TinyRecycleScroller: RecycleScroller,
// tiny 新增,
IconSearch: IconSearch(),
IconDeltaDown: IconDeltaDown(), // 默认下拉图标
IconEllipsis: IconEllipsis(),
IconChevronUp: IconChevronUp()
IconSearch: iconSearch(),
IconDownWard: iconDownWard(), // 默认下拉图标
IconEllipsis: iconEllipsis(),
IconChevronUp: iconChevronUp()
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct the component registration of icons

In the components registration, the icons are being registered by invoking them as functions:

IconClose: iconClose(),

If iconClose is a component object, it should be registered without invoking it:

IconClose: iconClose,

Invoking the components may lead to errors if iconClose() is not a factory function returning a component. Ensure that you are registering the components correctly to prevent runtime issues.

Apply this diff to fix the component registration:

-    IconClose: iconClose(),
-    IconCopy: iconCopy(),
-    IconAddCircle: iconAddCircle(),
-    IconLoadingShadow: iconLoadingShadow(),
-    IconHalfselect: iconHalfselect(),
-    IconCheck: iconCheck(),
-    IconCheckedSur: iconCheckedSur(),
-    IconSearch: iconSearch(),
-    IconDownWard: iconDownWard(), // 默认下拉图标
-    IconEllipsis: iconEllipsis(),
-    IconChevronUp: iconChevronUp()
+    IconClose: iconClose,
+    IconCopy: iconCopy,
+    IconAddCircle: iconAddCircle,
+    IconLoadingShadow: iconLoadingShadow,
+    IconHalfselect: iconHalfselect,
+    IconCheck: iconCheck,
+    IconCheckedSur: iconCheckedSur,
+    IconSearch: iconSearch,
+    IconDownWard: iconDownWard, // 默认下拉图标
+    IconEllipsis: iconEllipsis,
+    IconChevronUp: iconChevronUp

@zzcr zzcr merged commit ef4fd11 into dev Oct 21, 2024
19 of 23 checks passed
@kagol kagol deleted the cgm/inline-design-config branch November 4, 2024 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactoring (重构)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants