Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: sync inner to open #2533

Merged
merged 1 commit into from
Nov 19, 2024
Merged

feat: sync inner to open #2533

merged 1 commit into from
Nov 19, 2024

Conversation

zzcr
Copy link
Member

@zzcr zzcr commented Nov 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
    • Introduced a year selection feature in the date picker component.
    • Added filtering capabilities to select dropdown components.
  • Bug Fixes
    • Improved date picker functionality by refining date restrictions.
    • Enhanced tooltip handling in grid components for better user interaction.
  • Style
    • Updated styles for empty state images in dropdowns and improved overall visual consistency.
  • Documentation
    • Updated localization files for improved clarity and consistency in text strings.
  • Chores
    • Cleaned up unused styles and improved code readability across components.

Copy link

coderabbitai bot commented Nov 19, 2024

Walkthrough

The changes introduced in this pull request enhance the functionality of various components within a Vue.js application, particularly focusing on date pickers and select components. Key modifications include the addition of a year selection feature in the date picker, improvements in filtering capabilities for select components, and updates to event handling and state management across multiple components. Additionally, several style adjustments and renaming of properties for clarity have been implemented, ensuring consistency in the codebase.

Changes

File Path Change Summary
examples/sites/demos/pc/app/date-picker/disabled-composition-api.vue Added a <tiny-date-picker> component for year selection with yearPickerOptions, including a disabledDate method restricting years between 2022 and 2025.
examples/sites/demos/pc/app/date-picker/disabled.vue Introduced a year picker with yearPickerOptions, updated disabledDate logic to modify selectable date ranges.
examples/sites/demos/pc/app/select/optimization-composition-api.vue Added filterable attribute to <tiny-select> components, enhancing user interface for filtering options.
examples/sites/demos/pc/app/select/optimization.vue Similar to above, added filterable attribute to <tiny-select> components, improving filtering functionality.
internals/cli/src/commands/release/releaseAurora.ts Updated findAllpage function to replace occurrences of @aurora/huicharts with @opentiny/huicharts.
packages/design/aurora/src/popeditor/index.ts Renamed method treeWrapperMaxHeight to computedTreeMaxHeight, changing how maximum height is computed.
packages/design/aurora/src/select/index.ts Added stopPropagation property to props for event handling control.
packages/design/saas/src/popeditor/index.ts Similar change as above, renaming method from treeWrapperMaxHeight to computedTreeMaxHeight.
packages/design/saas/src/select/index.ts Added stopPropagation property to props for event handling control.
packages/renderless/package.json Updated version from 3.19.5 to 3.19.4.
packages/renderless/src/common/deps/useUserAgent.ts Introduced useUserAgent function for detecting iOS devices.
packages/renderless/src/common/event.ts Added correctTarget function for modifying event target properties based on conditions.
packages/renderless/src/date-picker-mobile/index.ts Code style improvements and minor logic adjustments in the date picker mobile component.
packages/renderless/src/dialog-box/index.ts Updated handleDrag to disable dragging in fullscreen mode, added toggleFullScreen method.
packages/renderless/src/dropdown/index.ts Renamed beforeDistory to beforeDestroy, updated event listener management.
packages/renderless/src/dropdown/vue.ts Updated function signatures for beforeDistory and clickOutside to include new parameters.
packages/renderless/src/file-upload/vue.ts Added cleanup for drag-over event listener in onBeforeUnmount.
packages/renderless/src/form-item/index.ts Enhanced event management for validation events in unmounted function.
packages/renderless/src/input/index.ts Updated resizeTextarea logic to include state.isDisplayOnly check.
packages/renderless/src/menu/vue.ts Added onUnmounted lifecycle hook for cleanup of event listeners.
packages/renderless/src/recycle-scroller/index.ts Introduced init and resetTemporary functions for state management.
packages/renderless/src/recycle-scroller/vue.ts Updated api object to include new methods for state management.
packages/renderless/src/rich-text/index.ts Added handleClick function for image click events in Quill editor.
packages/renderless/src/rich-text/vue.ts Updated api object to include handleClick method.
packages/renderless/src/select-dropdown/vue.ts Updated initWatch function to handle originValue state more robustly.
packages/renderless/src/select/index.ts Introduced correctTarget function and updated several methods for improved event handling and filtering logic.
packages/renderless/src/select/vue.ts Added new methods and updated state management logic based on user agent detection.
packages/renderless/src/tabbar/index.ts Updated beforeDestroy method to enhance cleanup of event listeners.
packages/renderless/src/tabbar/vue.ts Updated beforeDestroy method call to include vm parameter.
packages/renderless/src/tabs/index.ts Enhanced tab management logic, including error handling for tab removal.
packages/renderless/src/tabs/vue.ts Added onUnmounted lifecycle hook for cleanup actions.
packages/renderless/src/tooltip/vue.ts Added cleanup for tooltip-update event listener in onUnmounted.
packages/vue-locale/src/lang/en.ts Updated localization strings for clarity and consistency.
packages/vue-locale/src/lang/zh-CN.ts Updated translations for improved clarity in error messages.
packages/vue/src/date-panel/src/pc.vue Changed footer visibility control from v-show to v-if.
packages/vue/src/grid/src/body/src/body.tsx Updated event handling logic for mouse interactions.
packages/vue/src/grid/src/dragger/src/methods.ts Improved error messaging for drag-and-drop functionality.
packages/vue/src/grid/src/dragger/src/rowDrop.ts Updated error messages for invalid drag actions.
packages/vue/src/grid/src/grid/grid.ts Introduced new properties for pagination management.
packages/vue/src/grid/src/pager/src/methods.ts Enhanced loading state management during page changes.
packages/vue/src/grid/src/table/src/methods.ts Improved null checks and data clearing logic.
packages/vue/src/grid/src/table/src/table.ts Refined slot handling within rendering functions.
packages/vue/src/grid/src/tooltip/src/methods.ts Updated tooltip handling logic for improved state management.
packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts Updated how chart options are accessed in methods.
packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-boxplot/src/chart-boxplot.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-candle/src/chart-candle.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-core/common/extend.ts Updated parameter names for clarity in option management.
packages/vue/src/huicharts/huicharts-core/src/chart-core.ts Renamed internal state variable for chart options and updated methods accordingly.
packages/vue/src/huicharts/huicharts-funnel/src/chart-funnel.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-gauge/src/chart-gauge.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-graph/src/chart-graph.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-heatmap/src/chart-heatmap.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-line/src/chart-line.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-liquidfill/src/chart-liquidfill.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-map/src/chart-map.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-process/src/chart-process.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-radar/src/chart-radar.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-ring/src/chart-ring.vue Renamed chart options property in updateChart method.
packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue Renamed chart options property in updateChart method.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DatePicker
    participant YearPicker

    User->>DatePicker: Select Date
    DatePicker->>YearPicker: Open Year Picker
    User->>YearPicker: Select Year
    YearPicker-->>DatePicker: Return Selected Year
    DatePicker-->>User: Display Selected Date
Loading

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • zzcr

🐇 In the meadow, the date picker hops,
With a year selector, it never stops.
Users can choose with a joyful cheer,
Picking their dates, all through the year!
So let’s celebrate this change with glee,
A hopping good time for you and me! 🌼


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 added the enhancement New feature or request label Nov 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

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: 36

🧹 Outside diff range and nitpick comments (92)
packages/renderless/src/dialog-box/index.ts (1)

Line range hint 345-349: Add type annotations to the parameters of toggleFullScreen

The toggleFullScreen function's parameters { state, emit, nextTick, vm } lack explicit type annotations. Adding type annotations can enhance type safety and improve code readability.

Consider applying this diff to add type annotations:

-// tiny 新增
 export const toggleFullScreen =
+// tiny 新增
+export const toggleFullScreen =
+  ({ state, emit, nextTick, vm }: Pick<IDialogBoxRenderlessParams, 'state' | 'emit' | 'nextTick' | 'vm'>) =>
   (isFull: boolean): void => {
     state.isFull = isFull
     nextTick(() => {
       emit('resize', { fullscreen: isFull, dialog: vm.$refs.dialog })
     })
   }
packages/renderless/src/select/vue.ts (2)

Line range hint 1-1: Fix typo in 'debouncRquest' function name

The function debouncRquest appears to be misspelled in the import statement. It should likely be debounceRequest. Please correct the spelling to ensure the function is correctly imported and used throughout the code.

Apply this diff to fix the typo:

-import {
-  debouncRquest,
+  debounceRequest,
   nodeCollapse,
   nodeExpand,
   getChildValue,
   // ...

253-253: 'isIOS' variable added to state but not utilized

The variable isIOS is added to the state in initStateAdd, but it doesn't appear to be used elsewhere in the code. Consider removing it to clean up the state object.

Also applies to: 308-308

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

1327-1331: Translate Non-English Comments to English

The comment // 还原AUI的做法 is in Chinese. For consistency and maintainability, please translate all comments to English.

Proposed change:

- // 还原AUI的做法
+ // Restore AUI's approach
packages/design/saas/src/popeditor/index.ts (1)

6-7: Review computed property implementation pattern

The method name suggests it's a computed property, but it:

  1. Has side effects (modifies state)
  2. Doesn't return a value
  3. Doesn't follow Vue's computed property pattern

Consider refactoring to follow Vue's computed property pattern:

-computedTreeMaxHeight() {
-  state.treeWrapperMaxHeight = ''
-}
+computedTreeMaxHeight() {
+  return ''
+}
+
+watchEffect(() => {
+  state.treeWrapperMaxHeight = computedTreeMaxHeight.value
+})
packages/vue/src/huicharts/huicharts-process/src/chart-process.vue (1)

23-23: Consider updating component documentation

Since this represents a property rename that's part of a larger refactoring effort, it would be helpful to document this change in the component's documentation to help maintainers understand the new property naming convention.

Consider adding a comment above the updateChart method explaining the use of huiChartOption:

    methods: {
+     // Updates the chart's configuration using huiChartOption property
+     // which is the standardized property name across all chart components
      updateChart() {
        this.huiChartOption = { ...this.options }
      }
packages/renderless/src/common/deps/useUserAgent.ts (2)

3-13: Consider additional device detection methods

User-Agent string detection alone might not be reliable as it can be spoofed. Consider complementing it with feature detection where possible.

Some suggestions:

  1. For iOS detection, you could also check for iOS-specific features like -webkit-overflow-scrolling.
  2. Consider using the CSS media query hover capability to distinguish between touch and non-touch devices.
  3. The navigator.platform API (though deprecated) could provide additional validation.

Would you like me to provide an example implementation using multiple detection methods?

🧰 Tools
🪛 Biome

[error] 6-7: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


15-18: Consider memoizing the result and expanding the API

The UA detection result won't change during a session, so we could optimize by memoizing the result.

+let cachedIsIOS: boolean | null = null
+
 export const useUserAgent = () => {
-  const isIOS = getIsIOS()
+  if (cachedIsIOS === null) {
+    cachedIsIOS = getIsIOS()
+  }
-  return { isIOS }
+  return { isIOS: cachedIsIOS }
 }

Also, consider expanding the API to include other useful UA information that might be needed in the future, such as:

  • isMobile
  • isAndroid
  • isMacOS
  • browserName
  • browserVersion

This would prevent the need for multiple UA parsing implementations across the codebase.

packages/vue/src/huicharts/huicharts-funnel/src/chart-funnel.vue (1)

Line range hint 20-28: Add JSDoc documentation for the updateChart method

Consider adding JSDoc documentation to improve maintainability and developer experience.

+  /**
+   * Updates the chart configuration with current data and settings
+   * @private
+   */
   updateChart() {
     let { columns = [], rows = [] } = this.data
packages/vue/src/huicharts/huicharts-gauge/src/chart-gauge.vue (1)

30-30: LGTM: Property standardization looks good

The change to use huiChartOption aligns with the standardization of property naming across chart components. The implementation is clean and maintains the existing functionality.

This standardization of property names across components improves the maintainability and consistency of the codebase. Continue this pattern for other chart components if not already done.

packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts (2)

27-28: Consider adding type safety for huiChartOption access

While the change is consistent, consider adding type safety to prevent potential runtime errors:

-let option = this.huiChartOption
+const option = this.huiChartOption ?? this.defaultOption

Line range hint 1-36: Document the huiChartOption standardization

This change is part of a broader standardization effort across the huicharts package. Consider:

  1. Updating component documentation to reflect the use of huiChartOption
  2. Adding migration guides if this is a breaking change
  3. Ensuring consistent implementation across all chart components
packages/vue/src/huicharts/huicharts-graph/src/chart-graph.vue (1)

30-32: Consider adding type documentation

Since this is a crucial property for chart configuration, consider adding JSDoc or TypeScript type documentation to clarify the expected shape of the huiChartOption object.

 methods: {
   updateChart(data) {
     const { columns = [], rows = [] } = data
     const extra = {
       tooltipVisible: this.tooltipVisible,
       extend: this.extend
     }
     const option = graph(columns, rows, this.settings, extra)

+    /** @type {import('@opentiny/vue-huicharts-core').ChartOption} */
     this.huiChartOption = {
       ...option
     }
   }
 }
packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue (1)

Line range hint 24-33: Consider enhancing data validation and error handling

While the property rename is good, consider these improvements to make the component more robust:

  1. Add props validation for the data structure
  2. Add error handling for malformed data in the updateChart method

Example implementation:

+ props: {
+   data: {
+     type: Object,
+     default: () => ({}),
+     validator: (value) => {
+       return Array.isArray(value.columns) && Array.isArray(value.rows)
+     }
+   }
+ },
  methods: {
    updateChart() {
      let { columns = [], rows = [] } = this.data
+     if (!columns.length || !rows.length) {
+       console.warn('[ChartPie] Invalid data format: empty columns or rows')
+       return
+     }
packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue (1)

31-33: LGTM! Property rename aligns with standardization effort.

The change from option to huiChartOption is consistent with similar changes across other chart components.

Consider these improvements for better code clarity:

-      const option = sankey(columns, rows, this.settings, extra)
-      this.huiChartOption = {
-        ...option
-      }
+      const huiChartOption = sankey(columns, rows, this.settings, extra)
+      this.huiChartOption = {
+        ...huiChartOption
+      }
packages/vue/src/huicharts/huicharts-line/src/chart-line.vue (1)

31-34: Document the property rename in component's documentation.

Since this is part of a larger standardization effort, consider updating the component's documentation to reflect the property rename from option to huiChartOption.

packages/theme-saas/src/row/index.less (1)

29-33: Consider reducing code duplication using a mixin

The pseudo-element hiding logic is duplicated between .row-justify-space-around and .row-justify-space-between. Consider extracting this common styling into a LESS mixin for better maintainability.

Here's a suggested refactor:

+ .hide-pseudo-elements() {
+   &:after,
+   &:before {
+     @apply hidden;
+   }
+ }

  &.row-justify-space-around {
    @apply justify-around;
-   &:after,
-   &:before {
-     @apply hidden;
-   }
+   .hide-pseudo-elements();
  }

  &.row-justify-space-between {
    @apply justify-between;
-   &:after,
-   &:before {
-     @apply hidden;
-   }
+   .hide-pseudo-elements();
  }

Also applies to: 38-42

packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue (1)

34-37: Consider adding type safety for chart options

The chart options lack type checking, which could lead to runtime errors if invalid options are provided.

Consider adding PropTypes or TypeScript definitions for the chart options. Example:

interface HistogramChartOptions {
  smooth?: boolean;
  // ... other option properties
}
packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue (3)

Line range hint 34-38: Inconsistency between data property and usage

The property is declared as option in the data section but accessed as huiChartOption in the updateChart method. This inconsistency needs to be resolved.

Apply this diff to maintain consistency:

  data() {
    return {
      iChartName: 'BarChart',
-     option: {}
+     huiChartOption: {}
    }
  }

Line range hint 34-38: Consider adding TypeScript/PropTypes definitions

To improve type safety and developer experience, consider adding type definitions for the chart options.

Example implementation:

interface ChartBarOptions {
  smooth: boolean;
  direction: 'horizontal' | 'vertical';
  // Add other option properties
}

// Add as a property
props: {
  huiChartOption: {
    type: Object as PropType<ChartBarOptions>,
    default: () => ({})
  }
}

Line range hint 34-38: Document the standardization of chart option naming

As part of the broader effort to standardize chart option naming from option to huiChartOption, consider:

  1. Adding a comment explaining the standardization
  2. Creating a migration guide for users
  3. Updating component documentation
packages/vue/src/huicharts/huicharts-radar/src/chart-radar.vue (1)

43-45: Consider using deep clone for better immutability.

The spread operator (...) only performs a shallow clone. If option contains nested objects, mutations could still affect the original object.

Consider using a deep clone:

-      this.huiChartOption = {
-        ...option
-      }
+      this.huiChartOption = JSON.parse(JSON.stringify(option))

Or alternatively, use a dedicated utility like Lodash's cloneDeep:

+import { cloneDeep } from 'lodash-es'

-      this.huiChartOption = {
-        ...option
-      }
+      this.huiChartOption = cloneDeep(option)
examples/sites/demos/pc/app/select/optimization-composition-api.vue (3)

5-5: Consider adding debounce to filterable select with large dataset

The addition of filterable is good for UX, but with 100,000 options, it might cause performance issues during typing. Consider adding a debounce to the filter operation.

-    <tiny-select v-model="value1" :options="options" filterable optimization @change="onChange"></tiny-select>
+    <tiny-select v-model="value1" :options="options" filterable :filter-method-debounce="300" optimization @change="onChange"></tiny-select>

Line range hint 26-27: Optimize options generation for better performance

The current implementation creates 100,000 items using JSON.parse for each item, which is inefficient and could block the main thread during component mount.

-const buildOptions = () =>
-  Array.from({ length: 100000 }).map((item, i) => JSON.parse(`{"value":"选项${i}","label":"北京${i}"}`))
+const buildOptions = () =>
+  Array.from({ length: 100000 }).map((item, i) => ({
+    value: `选项${i}`,
+    label: `北京${i}`
+  }))

Line range hint 33-38: Consider formatting the change event message

Showing raw JSON string in the modal message isn't user-friendly. Consider formatting the output for better readability.

 const onChange = (value) => {
+  const formattedValue = Array.isArray(value)
+    ? `Selected ${value.length} items: ${value.slice(0, 3).join(', ')}${value.length > 3 ? '...' : ''}`
+    : `Selected: ${value}`
   TinyModal.message({
-    message: JSON.stringify(value),
+    message: formattedValue,
     status: 'info'
   })
 }
examples/sites/demos/pc/app/select/optimization.vue (2)

5-5: Consider adding performance safeguards for filtering large datasets

While adding the filterable attribute improves UX, filtering through 100,000 options could impact performance. Consider implementing these optimizations:

  1. Add a minimum input length before filtering starts
  2. Implement debouncing for the filter input
  3. Consider server-side filtering for such large datasets

Example implementation:

-    <tiny-select v-model="value1" :options="options" filterable optimization @change="onChange"></tiny-select>
+    <tiny-select
+      v-model="value1"
+      :options="options"
+      filterable
+      :filter-method="customFilterMethod"
+      :remote-method="remoteSearch"
+      :loading="loading"
+      optimization
+      @change="onChange"
+    ></tiny-select>

Also applies to: 12-12


Line range hint 23-24: Optimize options generation for better performance

The current implementation could cause UI freezing due to synchronous generation of 100,000 items with unnecessary JSON parsing.

Consider this more efficient implementation:

-const buildOptions = () =>
-  Array.from({ length: 100000 }).map((item, i) => JSON.parse(`{"value":"选项${i}","label":"北京${i}"}`))
+const buildOptions = () =>
+  Array.from({ length: 100000 }).map((item, i) => ({
+    value: `选项${i}`,
+    label: `北京${i}`
+  }))

For even better performance, consider:

  1. Implementing virtual scrolling
  2. Loading options in chunks
  3. Using a generator function for lazy evaluation
packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue (2)

55-63: Improve code organization and efficiency

Consider the following improvements:

  1. Move the echartsSettings array to a separate constant or configuration file
  2. Simplify the property assignment using Object.assign
+ import { ECHARTS_SETTINGS } from './constants'
// or
+ const ECHARTS_SETTINGS = [
+   'grid', 'dataZoom', /* ... */
+ ]

- echartsSettings.forEach((prop) => {
-   if (this[prop]) {
-     this.huiChartOption[prop] = this[prop]
-   }
- })
+ Object.assign(
+   this.huiChartOption,
+   Object.fromEntries(
+     ECHARTS_SETTINGS
+       .filter(prop => this[prop])
+       .map(prop => [prop, this[prop]])
+   )
+ )

Migration from 'option' to 'huiChartOption' is incomplete

The component still contains unmigrated references to 'option':

  • option: {} declaration
  • this.options reference in the spread operator

These instances should also be renamed to maintain consistency with the huiChartOption naming convention.

🔗 Analysis chain

Line range hint 25-68: Verify complete migration from 'option' to 'huiChartOption'

Let's ensure all occurrences of 'option' have been consistently renamed across the component and its dependencies.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining 'option' references in this component
rg -l 'option' packages/vue/src/huicharts/huicharts-bmap/src/

# Search for references to this component's options in other files
rg -l 'ChartBaiduMap.*option' packages/vue/src/

Length of output: 303


Script:

#!/bin/bash
# Search for any remaining 'option' references in the component
rg 'option' packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue

# Search for references to this component's options in related files
fd . packages/vue/src/huicharts --exec rg -l 'ChartBaiduMap.*option'

# Search for any options-related props or methods
ast-grep --pattern 'props: {
  $$$
  option$_: $_,
  $$$
}'

ast-grep --pattern 'methods: {
  $$$
  option$_($$$) {
    $$$
  },
  $$$
}'

Length of output: 430

packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue (3)

Line range hint 19-22: Critical: Data property name mismatch with usage

The data property is defined as option but accessed as huiChartOption throughout the component. This inconsistency will cause reactivity issues as Vue won't track the correct property.

Apply this fix:

  data() {
    return {
      iChartName: 'AutonaviMapChart',
-     option: {}
+     huiChartOption: {}
    }
  },

28-35: Consider improving the options handling logic

While the logic is correct, the code could be more maintainable with some refinements.

Consider this more concise approach:

-       this.huiChartOption = { ...this.options, ...this.settings }
-       if (!this.tooltipVisible) {
-         this.huiChartOption.tooltip = { show: false }
-       }
-
-       if (!this.legendVisible) {
-         this.huiChartOption.legend = { show: false }
-       }
+       this.huiChartOption = {
+         ...this.options,
+         ...this.settings,
+         ...((!this.tooltipVisible) && { tooltip: { show: false } }),
+         ...((!this.legendVisible) && { legend: { show: false } })
+       }

58-72: Consider architectural improvements for better maintainability

Several improvements could enhance the code's maintainability and performance:

  1. Move echartsSettings outside the method as a constant:
const ECHARTS_SETTINGS = ['grid', 'dataZoom', /* ... */];
  1. Replace the imperative forEach with a more declarative approach:
this.huiChartOption = {
  ...this.settings,
  tooltip: this.tooltipVisible ? this.tooltip : { show: false },
  series: this.series,
  ...Object.fromEntries(
    ECHARTS_SETTINGS
      .filter(prop => this[prop])
      .map(prop => [prop, this[prop]])
  ),
  ...((!this.legendVisible) && { legend: { show: false } })
};

This would:

  • Improve code readability
  • Eliminate the duplicate legend visibility check
  • Reduce the number of object mutations
examples/sites/demos/pc/app/date-picker/disabled-composition-api.vue (1)

8-16: LGTM! Consider i18n for placeholder text.

The year picker implementation is well-structured and consistent with the existing patterns. The component configuration and bindings are correct.

Consider extracting the placeholder text "请选择年" to a localization file for better internationalization support.

examples/sites/demos/pc/app/date-picker/disabled.vue (3)

8-16: Consider internationalizing the placeholder text

The placeholder text "请选择年" should be internationalized for better global accessibility.

Consider using the i18n system:

-        placeholder="请选择年"
+        :placeholder="t('datePicker.selectYear')"

60-61: Consider making date restrictions configurable

The hard-coded date '2023-08-15' might become outdated. Consider making this configurable through props or environment variables.

Example implementation:

-          return time.getTime() > Date.now() || time.getTime() < new Date('2023-08-15').getTime()
+          const minDate = props.minDate || '2023-08-15'
+          return time.getTime() > Date.now() || time.getTime() < new Date(minDate).getTime()

63-66: LGTM! Clean and efficient year restriction implementation

The year restriction logic is simple and effective. Consider making the year range configurable if this is meant to be reused across different contexts.

Example enhancement:

       yearPickerOptions: {
         disabledDate(year) {
-          return year > 2025 || year < 2022
+          const { minYear = 2022, maxYear = 2025 } = this
+          return year > maxYear || year < minYear
         }
       }
packages/renderless/src/common/event.ts (3)

44-44: Document the rationale for disabling prefer-spread.

While using .apply() is valid, it would be helpful to document why spread operator (...) is not preferred here, especially since this is a TypeScript codebase where modern syntax is generally favored.


77-84: Consider using Object.defineProperty alternatives.

Redefining properties on the Event object using Object.defineProperty could lead to unexpected behavior in different browsers or when the event is reused. Consider alternatives:

  1. Creating a wrapped event object
  2. Using a WeakMap to store corrected targets

Would you like me to provide example implementations of these alternatives?


64-85: Enhance documentation with specific use cases.

The function would benefit from more detailed JSDoc comments explaining:

  1. When to use this function vs getActualTarget
  2. Specific scenarios where event.target needs correction
  3. Examples of usage with web components
+/**
+ * Corrects the event.target when it's either null or incorrect due to shadow DOM event retargeting.
+ * Unlike getActualTarget, this function modifies the event object directly.
+ *
+ * @example
+ * // Usage with web components
+ * element.addEventListener('blur', (event) => {
+ *   correctTarget(event, fallbackTarget);
+ *   // event.target now points to the correct element
+ * });
+ *
+ * @param event - The DOM event whose target needs correction
+ * @param target - Optional fallback target when event.target is null
+ */
 export const correctTarget = (event, target?: EventTarget) => {
internals/cli/src/commands/release/releaseAurora.ts (2)

Line range hint 1-63: Consider documenting the package rename strategy.

The file contains multiple package rename rules but lacks documentation explaining the overall strategy and rationale. Consider adding a comment block explaining:

  • The purpose of each replacement rule
  • The relationship between Aurora and OpenTiny packages
  • Any special cases or exceptions (like the huicharts package)

Add this documentation at the top of the file:

 import { pathFromPackages } from '../build/build-ui'
 import path from 'node:path'
 import fs from 'fs-extra'
+
+/**
+ * Package Rename Strategy
+ * ----------------------
+ * This script handles the conversion between OpenTiny and Aurora package names:
+ * - Core packages: @opentiny/* → @aurora/*
+ * - Renderless: @opentiny/vue-renderless → @aurora/renderless
+ * - Theme: @opentiny/vue-theme → @aurora/theme
+ * - Special cases:
+ *   - @opentiny/fluent-editor (remains unchanged)
+ *   - @opentiny/huicharts (remains unchanged)
+ *
+ * Note: Some packages maintain their @opentiny namespace to ensure compatibility
+ * across different framework implementations.
+ */

Line range hint 31-45: Consider refactoring the replacement chain for better maintainability.

The current chain of .replace() calls is becoming long and harder to maintain. Consider refactoring this into a configuration object that maps source patterns to their replacements.

Here's a suggested refactor:

-    let result = content
-      .replace(/@opentiny\/vue-renderless/g, '@aurora/renderless')
-      .replace(/@opentiny\/vue-theme/g, '@aurora/theme')
-      .replace(/@opentiny/g, '@aurora')
-      .replace(/TINY/g, 'AUI')
-      .replace(/Tiny/g, 'Aui')
-      .replace(/tiny/g, 'aui')
-      .replace(/zhCN/g, 'zh_CN')
-      .replace(/enUS/g, 'en_US')
-      .replace(/-openaui/g, '-opentiny')
-      .replace(/"(.*?\/popup-manager)"/g, '"@aurora/renderless/common/deps/popup-manager"')
-      .replace(/"(.*?\/xss)"/g, '"@aurora/utils"')
-      .replace(/@aurora\/fluent-editor/g, '@opentiny/fluent-editor')
-      .replace(/@aurora\/huicharts/g, '@opentiny/huicharts')
+    const replacements = {
+      '@opentiny/vue-renderless': '@aurora/renderless',
+      '@opentiny/vue-theme': '@aurora/theme',
+      '@opentiny': '@aurora',
+      'TINY': 'AUI',
+      'Tiny': 'Aui',
+      'tiny': 'aui',
+      'zhCN': 'zh_CN',
+      'enUS': 'en_US',
+      '-openaui': '-opentiny',
+      '"(.*?/popup-manager)"': '"@aurora/renderless/common/deps/popup-manager"',
+      '"(.*?/xss)"': '"@aurora/utils"',
+      '@aurora/fluent-editor': '@opentiny/fluent-editor',
+      '@aurora/huicharts': '@opentiny/huicharts'
+    }
+    
+    let result = Object.entries(replacements).reduce(
+      (acc, [pattern, replacement]) => acc.replace(new RegExp(pattern, 'g'), replacement),
+      content
+    )
packages/renderless/src/tabbar/vue.ts (2)

Line range hint 65-77: Consider using Vue's event bus alternatives.

The component uses Vue's event bus pattern (vm.$on) which is deprecated in Vue 3. While this might be intentional for Vue 2 compatibility, consider documenting this or planning for future migration.

Consider alternatives like:

  • Vuex for state management
  • Props/emit for parent-child communication
  • Provide/inject for deeper component trees

Line range hint 47-57: Consider debouncing the resize event handler.

The window resize event listener is attached without debouncing, which could impact performance during rapid window resizing.

Consider wrapping the resize handler with a debounce function:

+ import { debounce } from '../common/deps/utils'

  onMounted(() => {
-   on(window, 'resize', api.initPage)
+   on(window, 'resize', debounce(api.initPage, 200))
packages/vue/src/huicharts/huicharts-core/common/extend.ts (3)

22-23: Add TypeScript type annotations for better type safety.

Consider adding explicit type annotations to improve type safety and IDE support:

-export default ({ huiChartOption, extend }) => {
+interface HuiChartOption {
+  series?: any;
+  [key: string]: any;
+}
+
+interface ExtendOption {
+  [key: string]: any;
+}
+
+export default ({ huiChartOption, extend }: { huiChartOption: HuiChartOption, extend: ExtendOption }) => {

66-66: Use a more specific variable name for clarity.

The parameter name huiChartOption in the forEach callback is misleading as it represents a single series item, not the entire chart configuration.

-mergeOption[key].forEach((huiChartOption, i) => (mergeOption[key][i] = { ...huiChartOption, ...value }))
+mergeOption[key].forEach((seriesItem, i) => (mergeOption[key][i] = { ...seriesItem, ...value }))

Line range hint 22-91: Consider adding input validation and error handling.

The function assumes valid input types and structures. Consider adding:

  1. Input validation for huiChartOption and extend
  2. Error handling for invalid merge operations
  3. Type guards for series handling
 export default ({ huiChartOption, extend }) => {
+  if (!huiChartOption || typeof huiChartOption !== 'object') {
+    throw new TypeError('huiChartOption must be an object');
+  }
+  if (!extend || typeof extend !== 'object') {
+    throw new TypeError('extend must be an object');
+  }
+
   const cloneOption = cloneDeep(huiChartOption)
packages/theme-saas/src/select-dropdown/index.less (1)

Line range hint 44-53: Consider improving empty state implementation

The empty state image implementation could be enhanced in several ways:

  1. The hardcoded image path '../images/empty-nodata.png' should be made configurable to support theme customization
  2. Consider adding fallback styles or a default SVG for cases where the image fails to load
  3. Add support for dark mode variants of the empty state image

Consider refactoring to:

  .@{select-dropdown-prefix-cls}__empty-images {
-   background-image: url('../images/empty-nodata.png');
+   background-image: var(--ti-select-empty-image, url('../images/empty-nodata.png'));
    @apply w-16;
    @apply h-16;
    @apply mb-2;
    @apply bg-cover;
    @apply bg-no-repeat;
    @apply inline-block;
    @apply align-bottom;
+   @apply dark:invert; /* Add dark mode support if the image needs inversion */
  }
packages/vue/src/grid/src/dragger/src/methods.ts (1)

Line range hint 19-37: Consider refactoring fixed column handling

The current implementation has several areas for improvement:

  1. Direct DOM manipulation makes the code fragile and harder to maintain
  2. The fixed column logic could be extracted into a separate method
  3. Error handling could be improved for event handlers

Consider refactoring like this:

+private handleFixedColumnDrag(targetThElem: HTMLElement, wrapperElem: HTMLElement, oldIndex: number, newIndex: number): void {
+  if (newIndex > oldIndex) {
+    for (let i = newIndex; i >= oldIndex; i--) {
+      wrapperElem.insertBefore(targetThElem, wrapperElem.children[i])
+    }
+  } else {
+    for (let i = newIndex; i <= oldIndex; i++) {
+      wrapperElem.insertBefore(targetThElem, wrapperElem.children[i])
+    }
+    wrapperElem.insertBefore(wrapperElem.children[oldIndex], targetThElem)
+  }
+}

 if (newColumn.fixed) {
-  // 错误的移动
-  if (newIndex > oldIndex) {
-    for (let i = newIndex; i >= oldIndex; i--) {
-      wrapperElem.insertBefore(targetThElem, wrapperElem.children[i])
-    }
-  } else {
-    for (let i = newIndex; i <= oldIndex; i++) {
-      wrapperElem.insertBefore(targetThElem, wrapperElem.children[i])
-    }
-    wrapperElem.insertBefore(wrapperElem.children[oldIndex], targetThElem)
-  }
+  this.handleFixedColumnDrag(targetThElem, wrapperElem, oldIndex, newIndex)
   
   return Modal.message({
     message: GlobalConfig.i18n('ui.grid.error.notAllowDragFixed'),
     status: 'error'
   })
 }
packages/renderless/src/recycle-scroller/vue.ts (2)

109-111: Consider extracting initialization logic for better testability.

The new methods are well-organized, but the initialization logic might benefit from being more explicit.

Consider extracting the initialization logic into a dedicated lifecycle manager:

+ const createLifecycleManager = ({ api, state }) => ({
+   init: init({ api }),
+   reset: resetTemporary({ state }),
+   scrollTo: scrollToItem({ api, props, state })
+ })

  Object.assign(api, {
-   scrollToItem: scrollToItem({ api, props, state }),
-   resetTemporary: resetTemporary({ state }),
-   init: init({ api })
+   ...createLifecycleManager({ api, state })
  })

This would make the initialization flow more explicit and easier to test.


Line range hint 1-156: Document the new initialization flow.

The changes introduce a more structured approach to component initialization and state management. To ensure maintainability:

  1. Consider adding JSDoc comments explaining the initialization sequence
  2. Document the relationship between init, resetTemporary, and updateVisibleItems
  3. Add examples of the expected usage pattern

Would you like me to help draft the documentation?

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

Line range hint 141-146: Consider migrating from Vue 2.x event bus pattern.

The code uses Vue 2.x event bus pattern ($on/$off) which is deprecated in Vue 3. Consider migrating to a more modern approach:

  1. Use Vue 3's mitt or tiny-emitter for event handling
  2. Or use props/emit pattern with a parent component

Example migration using mitt:

+import mitt from 'mitt'
+const emitter = mitt()

-vm.$on('tooltip-update', api.bindPopper)
+emitter.on('tooltip-update', api.bindPopper)

 onUnmounted(() => {
   api.destroyed()
   api.observer && api.observer.disconnect()
-  vm.$off('tooltip-update')
+  emitter.off('tooltip-update', api.bindPopper)
 })
🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/theme-saas/src/form/index.less (1)

173-175: LGTM: Full-width style for display-only textareas

The addition of w-full maintains consistent width behavior across display-only form elements.

Consider extracting the common display-only styles into a shared mixin since both input and textarea share identical width and line-height properties:

+ .display-only-field() {
+   @apply w-full;
+   @apply ~"leading-5.5";
+ }

  .@{input-prefix-cls}-display-only {
    @apply inline-block;
-   @apply w-full;
-   @apply ~"leading-5.5";
+   .display-only-field();
  }
  .@{textarea-prefix-cls}-display-only {
    @apply inline-block;
-   @apply w-full;
-   @apply ~"leading-5.5";
+   .display-only-field();
  }
packages/vue/src/grid/src/tooltip/src/methods.ts (1)

38-42: LGTM! Consider extracting CSS selectors as constants.

The logic for selecting the appropriate cell element is clear and well-commented. However, to improve maintainability, consider extracting the CSS selectors as constants.

+ const CELL_TEXT_SELECTOR = '.tiny-grid-cell-text';
+ const CELL_SELECTOR = '.tiny-grid-cell';
+
  const cell =
    isHeader && !(typeof column.title === 'function')
-     ? event.currentTarget.querySelector('.tiny-grid-cell-text')
-     : event.currentTarget.querySelector('.tiny-grid-cell')
+     ? event.currentTarget.querySelector(CELL_TEXT_SELECTOR)
+     : event.currentTarget.querySelector(CELL_SELECTOR)
packages/vue/src/grid/src/pager/src/methods.ts (1)

Line range hint 82-96: Consider extracting pagination logic into a composable

The current implementation mixes multiple concerns (state management, event handling, data fetching). Consider extracting the pagination logic into a Vue composable for better reusability and maintainability.

This would:

  1. Separate pagination logic from component implementation
  2. Make the code more testable
  3. Allow reuse across different components
  4. Simplify the main component code

Example structure:

// usePagination.ts
export function usePagination({ onPageChange, onError }) {
  const loading = ref(false)
  const currentPage = ref(1)
  
  const handlePageChange = async (params) => {
    loading.value = true
    try {
      await onPageChange(params)
    } catch (error) {
      onError(error)
    } finally {
      loading.value = false
    }
  }
  
  return {
    loading,
    currentPage,
    handlePageChange
  }
}
packages/renderless/src/select-dropdown/vue.ts (2)

125-125: Improve null check using optional chaining

The added null check is a good defensive programming practice. However, we can make it more concise using optional chaining.

-state.originValue = selectVm.modelValue && selectVm.modelValue.slice(0)
+state.originValue = selectVm.modelValue?.slice(0)
🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


124-127: Consider documenting state synchronization flow

The state synchronization between modelValue and originValue is a critical part of the dropdown's functionality. Consider adding comments to document:

  1. When and why the synchronization happens
  2. The relationship between visible state and value copying
  3. The implications for multiple select mode

This will help maintainers understand the state management flow better.

🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/theme-saas/src/textarea/index.less (2)

96-109: Add cross-browser scrollbar support

The current scrollbar styling only targets WebKit browsers. Consider:

  1. Adding Firefox scrollbar styling (scrollbar-width and scrollbar-color)
  2. Providing graceful degradation for unsupported browsers
  .@{textarea-prefix-cls}__inner {
    &::-webkit-scrollbar {
      @apply w-3;
    }
    
    &::-webkit-scrollbar-thumb {
      border-radius: 5px;
      @apply bg-clip-content;
      @apply border-x-4;
      @apply border-y-2;
      @apply border-solid;
      @apply border-transparent;
    }
+   /* Firefox */
+   scrollbar-width: thin;
+   scrollbar-color: theme('colors.color.text.disabled') transparent;
  }

Line range hint 144-205: Modernize display-only mode implementation

The current implementation uses older CSS patterns and browser-specific features. Consider:

  1. Replacing float-based layout with Flexbox or Grid
  2. Using modern line-clamping alternatives
  3. Ensuring consistent spacing with design tokens
  &.is-display-only {
    .@{textarea-prefix-cls}-display-only__wrap {
-     @apply flex;
+     @apply grid;
+     @apply gap-2;
    }

    .@{textarea-prefix-cls}-display-only__content {
-     &::before {
-       @apply content-[''];
-       @apply float-right;
-       @apply h-full;
-       @apply ~'-mb-3.5';
-     }
 
      .more-btn {
-       @apply float-right;
-       @apply clear-both;
+       @apply ml-auto;
+       @apply self-start;
        @apply text-color-brand;
        @apply text-xs;
        @apply cursor-pointer;
        @apply leading-3;
-       @apply relative;
-       @apply ~'-top-0.5';
      }
    }
  }
packages/renderless/src/tree-menu/index.ts (1)

122-126: Consider using router-based navigation instead of direct URL handling

The current implementation directly opens URLs from menu data. Consider these architectural improvements:

  1. Use Vue Router for internal navigation instead of window.open()
  2. Add a URL validation/transformation service
  3. Consider implementing a navigation guard pattern

This would provide:

  • Better integration with Vue's routing system
  • Centralized URL handling
  • Improved security through consistent navigation patterns

Would you like me to provide an example implementation of a router-based navigation approach?

🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/grid/src/dragger/src/rowDrop.ts (1)

Line range hint 27-42: Consider refactoring for improved maintainability.

Several improvements could enhance code maintainability:

  1. Rename handleIfScrollYLoadTruthy to something more descriptive like handleVirtualScrollDragAndDrop
  2. Add comments explaining the index calculations in splice operations
  3. Consider extracting error handling into a separate utility function
  4. Consider simplifying tree manipulation logic by extracting it into smaller, focused functions

Example refactor for error handling:

const showDragError = (message: string) => {
  return Modal.message({
    message: GlobalConfig.i18n(message),
    status: 'error'
  })
}

This would allow consistent error handling:

if (findTree(selfRow[options.children], (row) => prevRow === row, options)) {
  const oldTrElem = wrapperElem.children[event.oldIndex]
  wrapperElem.insertBefore(targetTrElem, oldTrElem)
  return showDragError('ui.grid.error.notAllowDragSelf')
}

Also applies to: 79-98

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

134-147: Consider architectural improvements for tab management

The current implementation mixes concerns between tab ordering and visibility calculations. Consider:

  1. Separating tab ordering logic from visibility calculations
  2. Using Vue's reactive system more effectively
  3. Implementing virtualization for better performance with many tabs
  4. Adding memoization for expensive calculations

This would improve maintainability and performance.

🧰 Tools
🪛 Biome

[error] 136-138: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

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

237-239: Improve readability of index checks.

While the bitwise NOT operator (~) is a clever way to check for -1, it reduces code readability. Consider using more explicit comparisons.

Suggested improvement:

-      const index = isAdd ? state.rightChecked.indexOf(key) : state.leftChecked.indexOf(key)
-      const valueIndex = currentValue.indexOf(key)
-
-      if (~index) {
+      const index = isAdd ? state.rightChecked.indexOf(key) : state.leftChecked.indexOf(key)
+      const valueIndex = currentValue.indexOf(key)
+
+      if (index !== -1) {
packages/theme-saas/src/select/index.less (1)

201-203: LGTM! Consider adding a comment for clarity.

The use of @apply contents is correct for maintaining the semantic structure while allowing parent flex layout to control positioning. Consider adding a comment explaining this behavior for future maintainers.

 .@{select-prefix-cls}__tags-content {
+      // Uses contents display to maintain semantic structure while letting parent flex control layout
       @apply contents;
 }
packages/renderless/src/dropdown/index.ts (1)

Line range hint 269-290: Fix typo in function name: beforeDistorybeforeDestroy

The function name should be corrected to follow Vue's lifecycle hook naming convention. The parameter addition of vm is a good improvement for proper event cleanup.

Apply this diff to fix the typo:

-export const beforeDistory =
+export const beforeDestroy =
packages/renderless/src/tree-node/index.ts (1)

99-106: Document magic numbers and improve parseInt usage

  1. The 8 pixel adjustment for showLine should be documented to explain its purpose
  2. parseInt should include a radix parameter for clarity
  export const computedIndent =
    () =>
    ({ node, showLine }, { tree }) => {
+     // Add 8px extra indent when showing lines to accommodate the line graphics
+     const LINE_INDENT_ADJUSTMENT = 8
-     return (node.level > 1 ? 1 : 0) * (parseInt(tree.indent) + (showLine ? 8 : 0)) + parseInt(tree.baseIndent) + 'px'
+     return (node.level > 1 ? 1 : 0) * (parseInt(tree.indent, 10) + (showLine ? LINE_INDENT_ADJUSTMENT : 0)) + parseInt(tree.baseIndent, 10) + 'px'
    }
packages/vue/src/date-panel/src/pc.vue (1)

Line range hint 216-235: Consider documenting the footer's lifecycle behavior

The footer contains critical actions (Now/Confirm buttons) and its presence is controlled by state.isShowFooter. Since we're now using v-if, the footer will be completely unmounted/mounted rather than just hidden/shown. This has implications for:

  1. State Management: Ensure state.isShowFooter changes are properly synchronized with the parent component
  2. Event Handling: The footer's buttons need to handle events correctly after remounting
  3. Component Contract: Document this behavior for other developers who might use or maintain this component

Consider adding a comment in the code or updating the component's documentation to explain:

  • When the footer is shown/hidden
  • How to properly handle footer state in parent components
  • Any initialization required when the footer is remounted
packages/renderless/src/date-picker-mobile/index.ts (1)

403-409: Consider making the close behavior more flexible

The direct use of $refs to access the action sheet component in a renderless component couples it to a specific implementation. Consider making this more flexible by:

  1. Emitting an event and letting the parent component handle the closing
  2. Or passing a close handler through props/context

This would better maintain the separation of concerns and make the component more reusable.

Example refactor:

 export const close =
-  ({ emit, vm }) =>
+  ({ emit }) =>
   () => {
-    vm.$refs.actionSheet.close()
     emit('close')
   }
packages/renderless/src/file-upload/vue.ts (1)

Line range hint 41-42: Consider consolidating drag-related state properties

The state contains three similar properties for tracking drag state:

  • draging
  • dragOver
  • isDragover

This could lead to inconsistent state management and confusion about which property to use.

Consider consolidating these into a single property with a consistent naming convention:

 const state = reactive({
-  draging: false,
-  dragOver: false,
   // ...other properties
-  isDragover: false,
+  isDragging: false, // Single source of truth for drag state
   // ...remaining properties
 })

Also applies to: 77-78, 82-82

packages/renderless/src/form-item/index.ts (1)

456-458: Consider updating event system for Vue 3 compatibility

The current implementation uses Vue 2's event system ($on/$off). For better framework compatibility and future-proofing:

  1. Consider using Vue's built-in event handling system with @event syntax
  2. Or implement an event bus compatible with both Vue 2 and Vue 3

Example approach using Vue's built-in event handling:

-vm.$on('form.blur', api.onFieldBlur)
-vm.$off('form.blur')
+// In template
+<component @blur="onFieldBlur" />
+
+// In setup/script
+const onFieldBlur = () => {
+  // validation logic
+}
packages/vue/src/grid/src/grid/grid.ts (2)

152-157: Consider consolidating pagination state management

The addition of realTimeTablePage creates potential state duplication with the existing tablePage object. Consider using a single source of truth for pagination state with a loading flag.

-      tablePageLoading: false,
-      realTimeTablePage: {
-        total: 0,
-        pageSize: 10,
-        currentPage: 1
-      },
+      tablePage: {
+        total: 0,
+        pageSize: 10,
+        currentPage: 1,
+        isLoading: false
+      },

184-186: Improve code safety and clarity

The variable name oldPage is misleading as it represents the current page configuration. Also, the code could benefit from optional chaining for better safety.

-      let { seqSerial, scrollLoad, pagerConfig: oldPage, startIndex, tablePageLoading, realTimeTablePage } = this
-      let seqIndexValue = startIndex
-      const pagerConfig = tablePageLoading ? realTimeTablePage : oldPage
+      let { seqSerial, scrollLoad, pagerConfig: currentPage, startIndex, tablePageLoading, realTimeTablePage } = this
+      let seqIndexValue = startIndex
+      const pagerConfig = tablePageLoading ? realTimeTablePage : currentPage
🧰 Tools
🪛 Biome

[error] 184-185: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/huicharts/huicharts-core/src/chart-core.ts (3)

197-197: Consider optimizing multiple renderChart calls

The watch handlers for initOptions, judgeWidth, delay, and resizeable all trigger renderChart with huiChartOption. Consider consolidating these updates to reduce unnecessary re-renders.

Consider implementing a debounced render function that can handle multiple property updates in a single render cycle.

Also applies to: 204-204, 210-210, 217-217


570-575: Simplify mounted hook state management

The mounted hook contains sequential state updates that could be combined for better clarity and performance.

Consider combining the state updates:

- this.huiChartOption = cloneDeep(this.options)
- let { huiChartOption } = this
- huiChartOption = this.afterConfigFn(huiChartOption)
+ const huiChartOption = this.afterConfigFn(cloneDeep(this.options))

371-371: Optimize deep cloning operations

Multiple deep cloning operations on potentially large objects could impact performance.

Consider:

  1. Using shallow cloning where deep cloning isn't necessary
  2. Implementing a memoization strategy for frequently accessed cloned objects
  3. Using immutable data structures to avoid the need for defensive cloning

Also applies to: 376-377

packages/renderless/src/recycle-scroller/index.ts (1)

197-202: Consider using Map.prototype.set's return value.

While the destructuring of type improves readability, the Map usage can be optimized.

-    let unusedPool = unusedViews.get(nrType)
-    if (!unusedPool) {
-      unusedPool = []
-      unusedViews.set(nrType, unusedPool)
-    }
+    let unusedPool = unusedViews.get(nrType) || unusedViews.set(nrType, []).get(nrType)
packages/vue-locale/src/lang/en.ts (5)

203-232: Improve consistency in rich text editor translations

The translations use inconsistent capitalization:

  • Some options use sentence case: "Text Color"
  • Others use title case: "Background Color"
  • Some use technical terms: "Coding" instead of "Code"

Consider standardizing to title case and using more user-friendly terms:

-  code: 'Coding',
+  code: 'Code',
-  unorderedlist: 'Bullet Lists',
+  unorderedlist: 'Bullet List',
-  orderedlist: 'Numbered Lists',
+  orderedlist: 'Numbered List',

815-861: Enhance clarity of validation messages

The validation messages use %s placeholders, but some messages could be more specific:

  • "Required field" is too terse
  • Some messages don't clearly indicate how to fix the error

Consider making the messages more helpful:

-  required: 'Required field',
+  required: 'This field is required',
-  whitespace: 'This field cannot be left blank.',
+  whitespace: 'This field cannot contain only whitespace characters.',

282-321: Simplify file upload messages

Some messages could be more concise while maintaining clarity:

-  fileSize: 'The file is less than the minimum size ({minSize} {sizeUnit}).',
+  fileSize: 'File must be at least {minSize} {sizeUnit}.',
-  calcHash: 'The document is being analyzed and encrypted.',
+  calcHash: 'Analyzing and encrypting document...',

349-375: Improve clarity of deprecation notices

The error messages for deprecated methods should provide clear migration paths:

-  delRevert: 'The <strong>revert</strong> method has been deprecated. Use <strong>revertData</strong> instead.',
+  delRevert: 'The <strong>revert</strong> method is deprecated and will be removed in the next major version. Please migrate to <strong>revertData</strong>.',

Consider moving developer-facing error messages to a separate debugging/development translation namespace to reduce the size of the production bundle.


Line range hint 1-862: Overall translation quality is good

The translations are generally clear, consistent, and well-organized. The file structure makes it easy to maintain and extend the translations.

Consider:

  1. Using TypeScript interfaces to ensure type safety for translation keys
  2. Implementing a translation key validation system to catch missing or unused translations
  3. Adding comments for complex translation keys to provide context for translators
packages/theme-saas/src/grid/table.less (1)

647-649: Consider browser compatibility for the :has() selector.

While the implementation is logically correct for simplifying header cell layout when containing only text, the :has() selector has limited browser support (particularly in older versions).

Consider a progressive enhancement approach:

.@{grid-cell-prefix-cls} {
  @apply flex;
  @apply items-center;
  @apply justify-start;
  
+ /* Base styles for all browsers */
+ &.single-text {
+   @apply block;
+ }
+ 
+ /* Progressive enhancement for modern browsers */
  &:has(> span:only-child) {
    @apply block;
  }
}

Then add a JavaScript fallback to add the single-text class for browsers that don't support :has().

packages/vue/src/grid/src/body/src/body.tsx (3)

Line range hint 249-251: Fix typo in tooltip method call.

There's a typo in the tooltip method call: clostTooltip should be closeTooltip. This would cause a runtime error as the method clostTooltip doesn't exist.

Apply this fix:

      if (showTip || showTooltip) {
-        $table.clostTooltip()
+        $table.closeTooltip()
      }

Line range hint 392-476: Consider refactoring for better maintainability.

The setColumnEvents function is quite complex and handles multiple responsibilities. Consider:

  1. Breaking it down into smaller, focused functions (e.g., separate functions for event handling and column property setup)
  2. Using TypeScript interfaces to better define the argument structure
  3. Grouping related configurations together

Example refactor approach:

interface ColumnEventConfig {
  editConfig: any;
  expandConfig: any;
  radioConfig: any;
  selectConfig: any;
  mouseConfig: any;
  treeConfig: any;
}

interface ColumnDisplayConfig {
  showOverflow: any;
  showTip: boolean;
  hasEllipsis: boolean;
}

function setupColumnDisplay(config: ColumnDisplayConfig) {
  // Handle display-related setup
}

function setupColumnEvents(config: ColumnEventConfig) {
  // Handle event-related setup
}

const setColumnEvents = (args1) => {
  const displayConfig = extractDisplayConfig(args1);
  const eventConfig = extractEventConfig(args1);
  
  const display = setupColumnDisplay(displayConfig);
  const events = setupColumnEvents(eventConfig);
  
  return { ...display, ...events };
}

Line range hint 1-1000: Consider performance optimizations for rendering logic.

Several areas in the code could benefit from performance optimizations:

  1. The comment on line 583 indicates that table data changes trigger full re-renders: "表格每次数据改变都会触发renderRow重新执行,会造成性能损失"
  2. Complex nested rendering functions could benefit from memoization
  3. Event listeners could benefit from debouncing, especially scroll handlers

Consider implementing the following optimizations:

  1. Use Vue's computed properties for derived data
  2. Implement row virtualization for large datasets
  3. Memoize expensive computations
  4. Add debounce/throttle to scroll event handlers
packages/theme-saas/src/rich-text/index.less (1)

98-98: Consider adding fallback for browser compatibility.

The white-space-collapse: preserve-breaks; property is relatively new and may not be supported in all browsers. While the change itself is good for preserving line breaks in the editor, consider adding a fallback for broader browser support.

Add this fallback for better browser compatibility:

  .ql-editor {
+   white-space: pre-wrap; /* Fallback for older browsers */
    white-space-collapse: preserve-breaks;
  }
packages/vue/src/grid/src/table/src/table.ts (5)

Line range hint 108-118: Update slot access pattern for consistency with Vue 3

The change from $slots to slots in the rendering functions aligns with Vue 3's composition API patterns, but there are potential issues:

  1. The code assumes $grid always exists and has a slots property
  2. No fallback handling if slots are undefined

Apply this diff to add proper fallback handling:

-  const { slots } = $grid
+  const slots = $grid?.slots || {}
   return () => {
     let emptyPartVnode = null
     let { computerTableBodyHeight } = _vm
 
     if (_vm.isCenterEmpty && !tableData.length) {
       let emptyVnodes
       let noEmptyClass = _vm.viewType === V_CARD || _vm.viewType === V_LIST
 
-      if (slots.empty) {
+      if (slots?.empty) {

Line range hint 47-51: Enhance tree configuration validation

The tree configuration merging logic should validate the input more thoroughly and handle edge cases.

Apply this diff to improve the configuration handling:

 function mergeTreeConfig(_vm) {
   if (_vm.treeConfig) {
-    const { ordered } = _vm.treeConfig
-    _vm.treeOrdered = isNull(ordered) ? true : Boolean(ordered)
+    const { ordered = null } = _vm.treeConfig || {}
+    _vm.treeOrdered = ordered === false ? false : true
   }
 }

Line range hint 1022-1048: Refactor lifecycle hooks for better event handling

The event binding logic is duplicated in mounted, activated, and other lifecycle hooks. This should be refactored into a shared method.

Consider extracting the event binding logic into a shared method:

+  methods: {
+    initializeEvents() {
+      if (this.autoResize && TINYGrid._resize) {
+        this.bindResize()
+      }
+      bindEvent(this)
+    }
+  }

   mounted() {
     if (this.$refs.tableWrapper) {
       document.body.appendChild(this.$refs.tableWrapper)
     }
 
     this.$nextTick().then(() => {
       this.afterMounted = true
-      if (this.autoResize && TINYGrid._resize) {
-        this.bindResize()
-      }
+      this.initializeEvents()
     })
   }

Line range hint 1168-1196: Optimize render function performance

The render function creates multiple elements and performs multiple computations. This could be optimized for better performance.

Consider these optimizations:

  1. Memoize computed values
  2. Use Vue's built-in performance optimizations
   render() {
+    // Memoize frequently accessed values
+    const tableAttrs = hooks.computed(() => getTableAttrs(this))
+    
     return h('div', getTableAttrs(this), [
       h(
         'div',
         { class: 'tiny-grid-hidden-column', ref: 'hideColumn' },
         instanceSlots.default && instanceSlots.default()
       ),
       renderHeader(),
       renderEmptyPart(),
-      h(GridBody, { ref: 'tableBody', props, class: this.viewCls('tableBody') }),
+      h(GridBody, {
+        ref: 'tableBody',
+        props,
+        class: this.viewCls('tableBody'),
+        // Add key for better virtual DOM diffing
+        key: 'gridBody'
+      }),

Line range hint 38-46: Enhance error handling with specific error types

The error handling uses generic Error objects and could be improved with custom error types for better error handling.

Consider creating specific error types:

+class GridConfigurationError extends Error {
+  constructor(message) {
+    super(message)
+    this.name = 'GridConfigurationError'
+  }
+}

 function verifyConfig(_vm) {
   if (!getRowkey(_vm)) {
-    error('ui.grid.error.rowIdEmpty')
+    throw new GridConfigurationError(error('ui.grid.error.rowIdEmpty'))
   }
packages/vue/src/grid/src/table/src/methods.ts (2)

Line range hint 1-1183: Consider breaking down this large file into smaller modules

This file is quite large and handles multiple concerns. Consider:

  1. Splitting into feature-specific modules (e.g., scrolling, caching, events)
  2. Using TypeScript interfaces for better type safety
  3. Organizing methods by functionality
  4. Creating separate services for complex operations

This would improve maintainability and make the code easier to test.


Line range hint 1-1183: Enhance error handling throughout the codebase

Consider adding:

  1. Proper error boundaries for async operations
  2. Input validation for critical methods
  3. Error recovery mechanisms
  4. Consistent error logging
  5. User-friendly error messages

This would improve reliability and debugging experience.

Example for error handling in async methods:

 async handleResolveColumn(tableData, fetchColumns) {
+  try {
     const { tableColumn, scrollYStore, asyncRenderMap, scrollXLoad, scrollYLoad } = this
     const { startIndex } = scrollYStore
     const isScrollLoad = scrollXLoad || scrollYLoad
     if (fetchColumns.length === 0) {
       return
     }
     const promises = mapFetchColumnPromise({ _vm: this, fetchColumns, tableColumn })
-    Promise.all(promises).then(
+    await Promise.all(promises).then(
       handleAllColumnPromises({ startIndex, fetchColumns, tableData, asyncRenderMap, isScrollLoad }, this)
     )
+  } catch (error) {
+    console.error('Failed to resolve column:', error)
+    // Add error recovery mechanism
+    this.$emit('column-resolve-error', error)
+  }
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 10c65c8 and 36849e6.

📒 Files selected for processing (82)
  • examples/sites/demos/pc/app/date-picker/disabled-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/date-picker/disabled.vue (2 hunks)
  • examples/sites/demos/pc/app/select/optimization-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/select/optimization.vue (2 hunks)
  • internals/cli/src/commands/release/releaseAurora.ts (1 hunks)
  • packages/design/aurora/src/popeditor/index.ts (1 hunks)
  • packages/design/aurora/src/select/index.ts (1 hunks)
  • packages/design/saas/src/popeditor/index.ts (1 hunks)
  • packages/design/saas/src/select/index.ts (1 hunks)
  • packages/renderless/package.json (1 hunks)
  • packages/renderless/src/common/deps/useUserAgent.ts (1 hunks)
  • packages/renderless/src/common/event.ts (2 hunks)
  • packages/renderless/src/date-picker-mobile/index.ts (4 hunks)
  • packages/renderless/src/dialog-box/index.ts (1 hunks)
  • packages/renderless/src/dropdown/index.ts (2 hunks)
  • packages/renderless/src/dropdown/vue.ts (1 hunks)
  • packages/renderless/src/file-upload/vue.ts (1 hunks)
  • packages/renderless/src/form-item/index.ts (2 hunks)
  • packages/renderless/src/input/index.ts (1 hunks)
  • packages/renderless/src/menu/vue.ts (2 hunks)
  • packages/renderless/src/recycle-scroller/index.ts (6 hunks)
  • packages/renderless/src/recycle-scroller/vue.ts (3 hunks)
  • packages/renderless/src/rich-text/index.ts (3 hunks)
  • packages/renderless/src/rich-text/vue.ts (3 hunks)
  • packages/renderless/src/select-dropdown/vue.ts (1 hunks)
  • packages/renderless/src/select/index.ts (16 hunks)
  • packages/renderless/src/select/vue.ts (6 hunks)
  • packages/renderless/src/tabbar/index.ts (1 hunks)
  • packages/renderless/src/tabbar/vue.ts (1 hunks)
  • packages/renderless/src/tabs/index.ts (1 hunks)
  • packages/renderless/src/tabs/vue.ts (2 hunks)
  • packages/renderless/src/tooltip/vue.ts (1 hunks)
  • packages/renderless/src/transfer/index.ts (2 hunks)
  • packages/renderless/src/tree-menu/index.ts (2 hunks)
  • packages/renderless/src/tree-node/index.ts (1 hunks)
  • packages/renderless/src/user-head/index.ts (1 hunks)
  • packages/renderless/src/year-table/index.ts (2 hunks)
  • packages/renderless/src/year-table/vue.ts (1 hunks)
  • packages/theme-saas/src/form/index.less (1 hunks)
  • packages/theme-saas/src/grid/table.less (1 hunks)
  • packages/theme-saas/src/input/index.less (0 hunks)
  • packages/theme-saas/src/rich-text/index.less (1 hunks)
  • packages/theme-saas/src/row/index.less (1 hunks)
  • packages/theme-saas/src/select-dropdown/index.less (1 hunks)
  • packages/theme-saas/src/select/index.less (1 hunks)
  • packages/theme-saas/src/textarea/index.less (6 hunks)
  • packages/theme-saas/src/tooltip/index.less (1 hunks)
  • packages/theme/src/dept/vars.less (1 hunks)
  • packages/theme/src/grid/table.less (1 hunks)
  • packages/theme/src/transfer/index.less (0 hunks)
  • packages/vue-locale/src/lang/en.ts (9 hunks)
  • packages/vue-locale/src/lang/zh-CN.ts (2 hunks)
  • packages/vue/src/date-panel/src/pc.vue (1 hunks)
  • packages/vue/src/grid/src/body/src/body.tsx (1 hunks)
  • packages/vue/src/grid/src/dragger/src/methods.ts (2 hunks)
  • packages/vue/src/grid/src/dragger/src/rowDrop.ts (2 hunks)
  • packages/vue/src/grid/src/grid/grid.ts (2 hunks)
  • packages/vue/src/grid/src/pager/src/methods.ts (2 hunks)
  • packages/vue/src/grid/src/table/src/methods.ts (3 hunks)
  • packages/vue/src/grid/src/table/src/table.ts (2 hunks)
  • packages/vue/src/grid/src/tooltip/src/methods.ts (1 hunks)
  • packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts (1 hunks)
  • packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue (2 hunks)
  • packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue (2 hunks)
  • packages/vue/src/huicharts/huicharts-boxplot/src/chart-boxplot.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-candle/src/chart-candle.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-core/common/extend.ts (2 hunks)
  • packages/vue/src/huicharts/huicharts-core/src/chart-core.ts (10 hunks)
  • packages/vue/src/huicharts/huicharts-funnel/src/chart-funnel.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-gauge/src/chart-gauge.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-graph/src/chart-graph.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-heatmap/src/chart-heatmap.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-line/src/chart-line.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-liquidfill/src/chart-liquidfill.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-map/src/chart-map.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-process/src/chart-process.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-radar/src/chart-radar.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-ring/src/chart-ring.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue (1 hunks)
⛔ Files not processed due to max files limit (27)
  • packages/vue/src/huicharts/huicharts-scatter/src/chart-scatter.vue
  • packages/vue/src/huicharts/huicharts-sunburst/src/chart-sunburst.vue
  • packages/vue/src/huicharts/huicharts-tree/src/chart-tree.vue
  • packages/vue/src/huicharts/huicharts-waterfall/src/chart-waterfall.vue
  • packages/vue/src/huicharts/huicharts-wordcloud/src/chart-wordcloud.vue
  • packages/vue/src/input/src/mobile-first.vue
  • packages/vue/src/input/src/pc.vue
  • packages/vue/src/numeric/src/mobile-first.vue
  • packages/vue/src/query-builder/src/components/InlineCombinator.vue
  • packages/vue/src/query-builder/src/components/QueryBuilder.vue
  • packages/vue/src/query-builder/src/components/RuleComponents.vue
  • packages/vue/src/query-builder/src/components/input.vue
  • packages/vue/src/query-builder/src/hooks/useQueryBuilder.ts
  • packages/vue/src/query-builder/src/hooks/useRule.ts
  • packages/vue/src/query-builder/src/pc.vue
  • packages/vue/src/query-builder/src/ts/propsUsingFrame.ts
  • packages/vue/src/select-dropdown/src/mobile-first.vue
  • packages/vue/src/select/src/index.ts
  • packages/vue/src/select/src/mobile-first.vue
  • packages/vue/src/select/src/pc.vue
  • packages/vue/src/tabs/src/mobile-first/tab-bar.vue
  • packages/vue/src/tabs/src/mobile-first/tab-nav.vue
  • packages/vue/src/tabs/src/tab-nav/pc.vue
  • packages/vue/src/tabs/src/tab-nav/tab-dropdown-item.vue
  • packages/vue/src/upload/src/index.ts
  • packages/vue/src/year-table/src/mobile-first.vue
  • packages/vue/src/year-table/src/pc.vue
💤 Files with no reviewable changes (2)
  • packages/theme-saas/src/input/index.less
  • packages/theme/src/transfer/index.less
✅ Files skipped from review due to trivial changes (2)
  • packages/renderless/package.json
  • packages/theme/src/grid/table.less
🧰 Additional context used
🪛 Biome
packages/renderless/src/common/deps/useUserAgent.ts

[error] 6-7: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/renderless/src/recycle-scroller/index.ts

[error] 442-442: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

packages/renderless/src/select-dropdown/vue.ts

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/renderless/src/tabs/index.ts

[error] 136-138: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/renderless/src/tree-menu/index.ts

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/grid/src/grid/grid.ts

[error] 184-185: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/huicharts/huicharts-core/src/chart-core.ts

[error] 248-252: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (101)
packages/renderless/src/year-table/index.ts (2)

17-25: 'getIsDefault' function implementation is correct

The logic in getIsDefault correctly determines whether the given year matches the default value(s) in props. The use of Array.isArray and some effectively handles both array and single value cases.


35-40: 'getIsCurrent' function implementation is correct

The function getIsCurrent accurately checks if the provided year matches the current value(s) in props. The use of coerceTruthyValueToArray and arrayFindIndex ensures compatibility with both single and multiple date selections.

packages/renderless/src/dialog-box/index.ts (1)

293-293: Prevent dragging when in fullscreen mode

The addition of state.isFull in the condition ensures that the dialog cannot be dragged when it is in fullscreen mode. This is appropriate to prevent unintended behavior.

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

66-66: Ensure 'onMouseenterSelf' is correctly imported and used

The method onMouseenterSelf has been added to the import list from './index'. Verify that onMouseenterSelf is properly exported from './index' and implemented correctly.


116-116: Verify the usage of 'useUserAgent'

You have imported useUserAgent from '../common/deps/useUserAgent' and used it to obtain isIOS in initStateAdd. Ensure that the useUserAgent module is correctly implemented and that isIOS accurately reflects the user agent information.


170-170: Confirm 'onMouseenterSelf' is properly integrated

The function onMouseenterSelf is added to the api array and initialized in initApi. Ensure that it is correctly implemented and that it handles the intended mouse enter events appropriately.

Also applies to: 377-377

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

18-18: Importing 'correctTarget' function for event handling

The import statement correctly includes correctTarget from '../common/event' for use in event handling within the component.

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

6-8: Verify layout implications

The change from 'auto' to empty string for height might affect the component's layout behavior.

Let's check for related style definitions and usage:

✅ Verification successful

Empty string is safe for max-height property

The change from 'auto' to empty string ('') for the treeWrapperMaxHeight is safe and won't cause any layout issues. When an empty string is assigned to the max-height CSS property, it effectively removes any max-height constraint, which is equivalent to the default behavior. This is similar to setting it to 'auto' or not setting it at all.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Look for related CSS/style definitions
rg -g '*.{css,scss,less}' "tree-wrapper|treeWrapper"

# Check for related template bindings
rg ":style.*tree.*height|:class.*tree.*wrapper"

Length of output: 1354


Script:

#!/bin/bash
# Let's check the component's template and related files for style bindings
rg -A 5 "treeWrapperMaxHeight" packages/design/aurora/src/popeditor/

# Check for any computed or reactive properties related to tree height
ast-grep --pattern 'computed($$$) { $$ treeWrapperMaxHeight $$ }'

# Look for style-related usage in template files
rg -g '*.vue' "tree-wrapper|:style"

Length of output: 40718


Script:

#!/bin/bash
# Let's check the template file to understand how treeWrapperMaxHeight is used
rg -A 10 "tree-wrapper" packages/design/aurora/src/popeditor/

# Check for any state or reactive declarations related to treeWrapperMaxHeight
ast-grep --pattern 'const state = reactive({
  $$$
  treeWrapperMaxHeight
  $$$
})'

# Look for any height-related computations or methods
rg "computedTreeMaxHeight|treeWrapperMaxHeight" packages/design/aurora/src/popeditor/

Length of output: 399


Script:

#!/bin/bash
# Let's check the entire file content to understand the context
rg -l "treeWrapperMaxHeight" packages/design/aurora/src/popeditor/ | xargs cat

# Look for any Vue template files in the popeditor directory
fd -e vue . packages/design/aurora/src/popeditor/ -x cat {}

# Check for any height-related styles in the component's CSS
rg -g "*.{less,css,scss}" "height|max-height" packages/design/aurora/src/popeditor/

Length of output: 428

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

7-7: Verify layout behavior with empty string height

Changing from 'auto' to empty string height could affect the tree wrapper's layout behavior. Empty string will make the element use its parent's height constraints, while 'auto' would size based on content.

✅ Verification successful

Based on the code analysis, I can see that treeWrapperMaxHeight is used to control the maximum height of the tree wrapper container in the popeditor component. The change from 'auto' to empty string is actually part of the design's tree height computation logic:

  1. In the renderless code (packages/renderless/src/popeditor/index.ts), there is logic to dynamically calculate and set the tree wrapper's max height based on the dialog box dimensions:
state.treeWrapperMaxHeight = `${
  dialogBoxEl.querySelector('.tiny-dialog-box__body').clientHeight - searchInputHeight - searchInputBottom 
}px`
  1. The design implementations (aurora/saas) override this by setting it to empty string, which effectively removes the max-height constraint and allows the tree to take its natural height based on its content and parent container constraints.

  2. This is a valid and safe change because:

    • Empty string is a valid value for max-height CSS property
    • It allows for more flexible height handling based on the parent container
    • The tree component has its own internal scrolling and height management

Therefore, this change from 'auto' to empty string is intentional and safe.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for height-related styles or calculations that might depend on this value
rg -t css -t vue "treeWrapperMaxHeight|tree-wrapper" 

# Look for related layout components
ast-grep --pattern 'class="$_tree-wrapper$_"'

# Check for any height-related issues in existing bug reports
gh issue list --search "tree height in:title,body"

Length of output: 183


Script:

#!/bin/bash
# Search for height-related styles or calculations with broader file types
rg "treeWrapperMaxHeight|tree-wrapper" -t ts -t tsx -t js -t jsx -t css -t scss -t less

# Look for the component's usage and style definitions
fd -e ts -e tsx -e vue -e js -e jsx popeditor --exec cat {}

# Check state management related to treeWrapperMaxHeight
ast-grep --pattern 'treeWrapperMaxHeight'

Length of output: 47282


Script:

#!/bin/bash
# Search for the component's state and style definitions
rg -t ts -t js "treeWrapperMaxHeight|tree-wrapper" -B 5 -A 5

# Look for related component files
fd -e ts -e js -e vue "tree" --exec cat {}

# Search for height-related styles
rg -t css -t less -t scss "height|max-height" -B 2 -A 2

Length of output: 367685

packages/vue/src/huicharts/huicharts-process/src/chart-process.vue (1)

23-23: Verify Core mixin compatibility with huiChartOption property

The property rename from option to huiChartOption aligns with the broader refactoring across chart components. However, we should ensure this change is compatible with the Core mixin.

✅ Verification successful

Property rename from option to huiChartOption is consistent with Core mixin usage

The change is verified to be correct and consistent with the Core mixin implementation across all chart components. The evidence shows:

  1. All chart components use the Core mixin which provides the huiChartOption property
  2. The huiChartOption property is consistently used across all chart components for setting chart options
  3. The change from this.options to this.huiChartOption in chart-process.vue aligns with this pattern
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Core mixin's expected property name and usage across chart components

# Check Core mixin implementation
echo "Checking Core mixin implementation..."
rg -A 5 "option|huiChartOption" "packages/vue/src/huicharts/**/core.js"

# Check usage in other chart components
echo "Checking property usage in other chart components..."
rg -A 5 "huiChartOption" "packages/vue/src/huicharts/**/*.vue"

Length of output: 490


Script:

#!/bin/bash
# Let's first find the correct paths using fd
echo "Finding core mixin and chart component files..."
fd -e js -e vue . packages/vue/src

# Then search for option/huiChartOption usage
echo "Searching for option/huiChartOption usage..."
rg -l "option|huiChartOption" $(fd -e js -e vue . packages/vue/src)

# Get detailed context of matches
echo "Getting detailed context of matches..."
rg -C 5 "option|huiChartOption" $(fd -e js -e vue . packages/vue/src)

Length of output: 370608


Script:

#!/bin/bash
# Let's check for the Core mixin implementation and huiChartOption usage
echo "Checking for Core mixin and huiChartOption..."
fd -t f -e js -e vue . packages/vue/src/huicharts | xargs rg -l "Core|huiChartOption"

# Get detailed context of any Core mixin files
echo "Getting Core mixin implementation details..."
fd -t f -e js -e vue . packages/vue/src/huicharts | xargs rg -A 5 "mixins: \[Core\]"

# Check for option/huiChartOption usage in chart components
echo "Checking option/huiChartOption usage in chart components..."
fd -t f -e js -e vue . packages/vue/src/huicharts | xargs rg -B 2 -A 2 "this\.huiChartOption|this\.options?"

Length of output: 27501

packages/vue/src/huicharts/huicharts-funnel/src/chart-funnel.vue (1)

27-27: Verify consistent property renaming across chart components

The renaming from option to huiChartOption aligns with the codebase-wide refactoring effort. The change is semantically more precise.

Let's verify this renaming pattern across other chart components:

✅ Verification successful

Property renaming is consistently applied across all chart components

The verification results show that:

  • No instances of this.option = remain in the chart components
  • All chart components consistently use this.huiChartOption, including:
    • Core component (chart-core.ts)
    • All specific chart types (funnel, radar, pie, etc.)
    • Map components (baidu-map, autonavi-map)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistent property naming across chart components
# Expected: All chart components should use huiChartOption instead of option

# Check for any remaining uses of 'this.option' in chart components
echo "Checking for remaining 'this.option' usage in chart components:"
rg "this\.option\s*=" "packages/vue/src/huicharts"

# Check for consistent usage of 'this.huiChartOption'
echo -e "\nVerifying 'this.huiChartOption' usage in chart components:"
rg "this\.huiChartOption\s*=" "packages/vue/src/huicharts"

Length of output: 3583

packages/vue/src/huicharts/huicharts-gauge/src/chart-gauge.vue (1)

30-30: Verify the Core mixin and document breaking changes

The property rename from option to huiChartOption appears to be part of a standardization effort. However, we should ensure this change is properly supported and documented.

Let's verify the Core mixin and documentation:

✅ Verification successful

Based on the shell script results, I can now provide a definitive response about the property rename verification:

Property rename is properly supported in Core mixin

The change from option to huiChartOption is safe as the Core mixin (packages/vue/src/huicharts/huicharts-core/src/chart-core.ts) properly defines and handles the huiChartOption property:

  • Declares huiChartOption in data properties
  • Uses it consistently throughout the component lifecycle
  • Properly integrates with chart rendering and configuration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the Core mixin defines huiChartOption
echo "Checking Core mixin for huiChartOption property..."
rg -A 5 "huiChartOption" "packages/vue/src/huicharts/huicharts-core"

# Check for breaking change documentation
echo "Checking for breaking change documentation..."
fd -g "CHANGELOG.md" -g "BREAKING-CHANGES.md" -g "MIGRATION.md"

Length of output: 16215

packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts (1)

22-23: Verify huiChartOption initialization

The change from option to huiChartOption aligns with the standardization effort, but we should ensure huiChartOption is properly initialized before use.

✅ Verification successful

huiChartOption is properly initialized and used throughout the codebase

Based on the verification results, huiChartOption is well-managed in the codebase:

  • It's initialized as an empty object in chart-core.ts during component creation
  • The AMap component inherits from the core chart component, ensuring proper initialization
  • The property is properly set in autonavi-map.vue through the updateChart method
  • The value flows correctly through the component hierarchy with proper lifecycle management

The change from option to huiChartOption is safe and consistent with the codebase's standardization.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for huiChartOption initialization in related files
rg -l "huiChartOption" packages/vue/src/huicharts/

Length of output: 1718


Script:

#!/bin/bash
# Let's check the initialization in the core files and AMap-related files
rg -A 5 -B 5 "huiChartOption" packages/vue/src/huicharts/huicharts-core/common/extend.ts packages/vue/src/huicharts/huicharts-core/src/chart-core.ts packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue

Length of output: 25102

packages/vue/src/huicharts/huicharts-graph/src/chart-graph.vue (1)

30-32: Verify integration with Core mixin

The property rename from option to huiChartOption aligns with the consistent naming convention being applied across chart components. However, we should verify that this change is compatible with the Core mixin's expectations.

✅ Verification successful

Based on the code analysis, I can now provide the final response:

Property rename from option to huiChartOption is consistent with core implementation

The change from option to huiChartOption is correct and aligns with the core chart implementation. The Core mixin in chart-core.ts uses huiChartOption as the main configuration property that:

  • Is initialized as an empty object in the created hook
  • Gets populated from options prop when available
  • Is used throughout the rendering pipeline
  • Handles theme, colors, animations, and other chart configurations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Core mixin's property usage and other components' alignment

# Check Core mixin for property usage
ast-grep --pattern 'option' packages/vue/src/huicharts/**/core.{js,ts,vue}

# Verify consistent property naming across other chart components
ast-grep --pattern 'huiChartOption' packages/vue/src/huicharts/**/*.vue

Length of output: 561


Script:

#!/bin/bash
# Let's first find the correct paths using fd
fd -e vue -e js -e ts . packages/vue/src/huicharts

# Then check for option and huiChartOption usage
rg -l "option" packages/vue/src/huicharts
rg -l "huiChartOption" packages/vue/src/huicharts

# Get more context around the usage
rg -A 3 -B 3 "option" packages/vue/src/huicharts

Length of output: 62124


Script:

#!/bin/bash
# Let's check the core mixin implementation to understand how huiChartOption is used
rg -A 5 -B 5 "huiChartOption" packages/vue/src/huicharts/huicharts-core/src/chart-core.ts

# Also check if there are any direct references to 'option' property in the core
rg -A 5 -B 5 "option: \{" packages/vue/src/huicharts/huicharts-core/src/chart-core.ts

Length of output: 6304

packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue (1)

32-32: Verify the property rename across the chart ecosystem

The change from option to huiChartOption appears to be part of a broader standardization effort. However, we should verify this change is consistent with the Core mixin and other chart components.

Consider documenting this naming convention in the component's API documentation to ensure future contributions maintain consistency.

✅ Verification successful

Property rename is part of a consistent pattern across chart components

The verification shows that huiChartOption is consistently used across all chart components in the huicharts ecosystem:

  • All chart components (pie, line, bar, etc.) use this.huiChartOption
  • The Core mixin properly handles huiChartOption in its implementation
  • The only remaining instances of this.option are in map components where it's used as a source property (this.options) to populate huiChartOption

The change from option to huiChartOption in chart-pie.vue aligns with the established pattern across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the property naming convention across chart components
# and check for any remaining instances of the old property name

# Check for any remaining uses of 'this.option' in chart components
echo "Checking for remaining uses of 'this.option' in chart components..."
rg "this\.option" "packages/vue/src/huicharts"

# Check for consistent usage of 'this.huiChartOption' in other chart components
echo "Checking for consistent usage of 'this.huiChartOption'..."
rg "this\.huiChartOption" "packages/vue/src/huicharts"

# Check the Core mixin implementation
echo "Checking Core mixin implementation..."
rg "huiChartOption|option" "packages/vue/src/huicharts/huicharts-core"

Length of output: 17000

packages/vue/src/huicharts/huicharts-ring/src/chart-ring.vue (2)

Line range hint 1-38: Implementation follows Vue best practices

The component is well-structured with:

  • Clear separation of concerns
  • Proper use of mixins for shared functionality
  • Configurable interface through props and slots
  • Internationalization support

31-31: Verify property compatibility with Core mixin

The rename from option to huiChartOption appears to be part of a standardization effort. However, we should ensure this property is properly supported by the Core mixin.

Consider adding a comment documenting this property's purpose and its relationship with the Core mixin, especially if this is part of a public API:

 updateChart() {
   let { columns = [], rows = [] } = this.data

   const extra = {
     legendVisible: this.legendVisible,
     tooltipVisible: this.tooltipVisible,
     t
   }
+  // Store the chart configuration using huiChartOption property from Core mixin
   this.huiChartOption = pie(columns, rows, this.settings, extra, true)
 }
✅ Verification successful

Property rename is consistent with codebase standards

The verification shows that:

  1. huiChartOption is properly defined in the Core mixin (packages/vue/src/huicharts/huicharts-core/src/chart-core.ts)
  2. The property is consistently used across all chart components in the huicharts ecosystem
  3. No legacy usage of this.option exists in any chart components

The rename from option to huiChartOption is part of a standardized implementation across all chart components and is properly supported by the Core mixin.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the property name change is consistent across the codebase
# and supported by the Core mixin

# Check Core mixin for property definition
echo "Checking Core mixin for huiChartOption property..."
rg -l "huiChartOption" "packages/vue/src/huicharts/**/core.{js,ts,vue}"

# Check for any remaining uses of the old 'option' property
echo "Checking for remaining instances of old property name..."
rg -l "this\.option\s*=" "packages/vue/src/huicharts/**/*.{js,ts,vue}"

# Verify consistent usage in other chart components
echo "Checking usage in other chart components..."
rg -l "huiChartOption" "packages/vue/src/huicharts/**/chart-*.vue"

Length of output: 795


Script:

#!/bin/bash
# Let's try a different approach using fd to find the correct paths first

# Find all core related files
echo "Finding core related files..."
fd -e js -e ts -e vue "core" packages/vue/src

# Find all chart component files
echo "Finding chart component files..."
fd "chart-.*\.vue$" packages/vue/src

# Once we have the files, let's check their content
echo "Checking for huiChartOption usage..."
rg "huiChartOption" packages/vue/src

# Check for old option property usage
echo "Checking for old option property usage..."
rg "this\.option\s*=" packages/vue/src

Length of output: 11597

packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue (1)

31-31: Verify all references to the renamed property are updated.

Let's ensure there are no remaining references to the old property name.

✅ Verification successful

Property rename is consistent with the codebase pattern

The verification shows that:

  1. The huiChartOption property is consistently used across all chart components that extend the Core mixin
  2. The implementation in chart-sankey.vue follows the same pattern as other chart components (e.g., chart-line.vue)
  3. There are no remaining references to any old property name in the Sankey chart component

The property name is correctly aligned with the established pattern in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining references to the old 'option' property in chart components
# and their consumers to prevent potential breaking changes.

echo "Searching for potential references to 'option' in Sankey chart files..."
rg -l "this\.option" "packages/vue/src/huicharts/huicharts-sankey"

echo "Searching for potential template references..."
rg -l ":option=" "packages/vue/src/huicharts/huicharts-sankey"

echo "Checking for any documentation references..."
rg -l "option:" "packages/vue/src/huicharts/huicharts-sankey"

Length of output: 548


Script:

#!/bin/bash
# Let's try a broader search to understand the context better and verify the property rename

# First, let's see the full content of the chart-sankey.vue file
echo "Content of chart-sankey.vue:"
cat "packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue"

# Search for any occurrences of 'huiChartOption' to understand the new property usage
echo -e "\nSearching for huiChartOption references:"
rg "huiChartOption" "packages/vue/src/huicharts/huicharts-sankey" -A 2

# Search for any option-related props or configurations
echo -e "\nSearching for option-related configurations:"
rg "props:|option" "packages/vue/src/huicharts/huicharts-sankey"

Length of output: 1701


Script:

#!/bin/bash
# Let's check the Core mixin to understand the property usage in the parent component

# Check the content of the Core mixin
echo "Checking Core mixin implementation:"
cat "packages/vue/src/huicharts/huicharts-core/index.js"

# Look for any other components that might be extending this Core mixin
echo -e "\nChecking for other components using Core mixin:"
rg "mixins: \[Core\]" "packages/vue/src/huicharts"

Length of output: 2286


Script:

#!/bin/bash
# Let's try to find the Core mixin in the correct location and check other chart components

# Find the Core mixin file
echo "Looking for Core mixin file:"
fd -t f "Core" "packages/vue/src/huicharts"

# Check if there are any imports of @opentiny/vue-huicharts-core
echo -e "\nChecking imports of huicharts-core:"
rg "@opentiny/vue-huicharts-core" "packages/vue/src/huicharts"

# Let's also check one of the other chart components to see how they use huiChartOption
echo -e "\nChecking usage in another chart component:"
cat "packages/vue/src/huicharts/huicharts-line/src/chart-line.vue"

Length of output: 9479

packages/vue/src/huicharts/huicharts-liquidfill/src/chart-liquidfill.vue (1)

31-31: Verify Core mixin compatibility with the renamed property.

Since this component uses the Core mixin from '@opentiny/vue-huicharts-core', ensure that the mixin's implementation is updated to work with huiChartOption instead of option to maintain consistency.

Let's check the Core mixin implementation:

packages/vue/src/huicharts/huicharts-line/src/chart-line.vue (1)

31-34: LGTM! Verify property references.

The rename from option to huiChartOption aligns with the standardization across chart components.

Let's verify there are no remaining references to the old property name:

✅ Verification successful

Property rename is consistent across chart components

The verification shows that the rename from option to huiChartOption is consistently implemented across all chart components. The option variable is only used as a local constant to store the chart configuration before assigning it to this.huiChartOption. This pattern is uniform across all components:

  • Line chart: const option = line(columns, rows, this.settings, extra)
  • Bar chart: const option = histogram(columns, rows, this.settings, extra, false)
  • Scatter chart: const option = scatter(columns, rows, this.settings, extra)
  • And so on...
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old 'option' property
# in the huicharts components and related files

# Search for 'option' references in huicharts files
rg -g 'packages/vue/src/huicharts/**' '\boption\b' -A 2 -B 2

# Search for direct references to 'this.option' which should have been migrated
ast-grep --pattern 'this.option'

Length of output: 12657

packages/theme-saas/src/row/index.less (1)

29-33: Verify the impact on flex container spacing

The addition of hidden to pseudo-elements might affect the spacing behavior in flex containers. This is a common approach but should be tested across different scenarios.

Let's check if this pattern is consistently used across other flex components:

✅ Verification successful

This will help us understand:

  1. The complete context of the row component's flex implementation
  2. How pseudo-elements are handled across other components in the theme

Hiding pseudo-elements is safe and consistent with flex container patterns

After analyzing the codebase, the use of hidden on pseudo-elements in flex containers with justify-around and justify-between is a deliberate and consistent pattern. The code shows:

  1. The hiding of pseudo-elements is specifically scoped to flex spacing modifiers (row-justify-space-around and row-justify-space-between)
  2. This pattern prevents pseudo-elements from interfering with flex spacing calculations
  3. Other flex-related components in the theme use similar approaches for consistent spacing behavior
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for similar pseudo-element handling in other flex components
# Look for files that might have similar flex container styles

# Search for other flex-related styles with pseudo-elements
rg -t less "justify-around|justify-between" "packages/theme-saas/src/"

# Search for other instances of pseudo-element hiding in flex contexts
rg -t less "&:(before|after).+hidden" "packages/theme-saas/src/"

Length of output: 2296


Script:

#!/bin/bash
# Let's check the context of flex containers and pseudo-elements in row/index.less
cat packages/theme-saas/src/row/index.less

# Also check other components that might have similar pseudo-element handling
rg -t less "&:(before|after)" -A 2 "packages/theme-saas/src/"

Length of output: 31583

packages/theme/src/dept/vars.less (1)

15-16: Verify the visual impact of increased label prominence

The changes make department labels more prominent by:

  1. Using primary text color instead of secondary
  2. Using bold font weight instead of regular

While this improves visibility, please ensure this level of emphasis aligns with the visual hierarchy of surrounding components.

Let's check for related component styles that might be affected:

✅ Verification successful

Style changes are properly scoped and consistently applied

The verification shows that the CSS variable changes are properly integrated:

  • The variables are defined in vars.less and consumed in packages/theme/src/dept/index.less
  • The styling is consistently applied to department labels in the component
  • The changes maintain the component's styling structure while enhancing visibility

The increased prominence through text color and bold weight is appropriately scoped to the department component's label, with no unintended impacts on other components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for related department component styles and usage
# Look for files that might be affected by these changes

# Find related department component style files
fd -e less -e css dept

# Look for any component templates using department labels
rg -t vue "tv-Dept-label"

Length of output: 78


Script:

#!/bin/bash
# Let's try a broader search approach

# Find all files related to department component
fd -t f "dept|Dept"

# Search for any usage of the CSS variable
rg --type-add 'vue:*.vue' --type-add 'less:*.less' --type-add 'css:*.css' -t vue -t less -t css "tv-Dept-label"

# Look for any style imports or references
rg --type-add 'ts:*.ts' --type-add 'js:*.js' -t ts -t js "dept/vars"

Length of output: 1646

packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue (1)

Line range hint 34-38: Verify the impact of renaming option property

The renaming of option to huiChartOption might affect parent components or other parts of the codebase that rely on this property.

Let's verify the usage across the codebase:

packages/vue/src/huicharts/huicharts-map/src/chart-map.vue (2)

41-43: Verify consistent property naming across huicharts components.

Let's ensure this renaming is consistently applied across all chart components in the huicharts package.

✅ Verification successful

Property naming is consistent across all huicharts components

Based on the search results, the property huiChartOption is consistently used across all chart components in the huicharts package, including:

  • Core component (huicharts-core)
  • All chart type components (bar, line, pie, map, etc.)
  • Map components (amap, bmap)

The property naming follows the same convention throughout the codebase with no variations or inconsistencies found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistency in property naming across chart components

# Find all chart components
echo "=== Chart Components ==="
fd -e vue$ . packages/vue/src/huicharts/

# Check property usage in other components
echo -e "\n=== Property Usage ==="
rg -A 2 'huiChartOption\s*=' packages/vue/src/huicharts/

Length of output: 8890


41-43: LGTM! Verify Core mixin compatibility.

The property renaming from option to huiChartOption aligns with the broader refactoring effort. However, we should verify that this change is compatible with the Core mixin.

✅ Verification successful

Based on the search results, I can now generate the final response as we have comprehensive information about the property usage across the codebase:

Property renaming is consistent across all chart components

The change from option to huiChartOption is part of a systematic refactoring that has been consistently applied across all chart components in the huicharts package. The Core implementation in chart-core.ts also uses huiChartOption, confirming compatibility with the mixin.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Core mixin's expected property name

# Check Core mixin implementation
ast-grep --pattern 'option = {' packages/vue/src/huicharts/huicharts-core/src/core.js

# Check for any remaining uses of the old property name
rg -l '\boption\s*=' packages/vue/src/huicharts/

Length of output: 8890

packages/vue/src/huicharts/huicharts-boxplot/src/chart-boxplot.vue (1)

31-31: LGTM! Consistent with the standardization effort.

The renaming from this.option to this.huiChartOption aligns with the broader standardization of chart option naming across components.

Let's verify this naming convention is consistently applied across other chart components:

✅ Verification successful

Property renaming standardization is complete and consistent

The verification shows that this.huiChartOption is now consistently used across all chart components in the codebase, with no remaining instances of this.option. The change in chart-boxplot.vue aligns perfectly with this standardization.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistent usage of huiChartOption across chart components
# Expected: All chart components should use huiChartOption instead of option

# Search for any remaining usage of this.option in chart components
echo "Checking for remaining 'this.option' usage in chart components:"
rg "this\.option\s*=" "packages/vue/src/huicharts"

# Search for consistent usage of huiChartOption
echo "Verifying 'this.huiChartOption' usage in chart components:"
rg "this\.huiChartOption\s*=" "packages/vue/src/huicharts"

Length of output: 3577

packages/vue/src/huicharts/huicharts-radar/src/chart-radar.vue (1)

43-45: LGTM! Property renaming aligns with standardization.

The renaming from option to huiChartOption maintains consistency with other components in the huicharts package.

examples/sites/demos/pc/app/select/optimization-composition-api.vue (2)

Line range hint 45-49: LGTM! Style changes improve readability

The added paragraph styles with appropriate font size and line height enhance text readability and maintain consistency with related components.


Line range hint 10-17: Verify the performance impact of filterable with multiple selection

The combination of filterable, multiple, and collapse-tags with a large dataset (100,000 items) could impact rendering performance. The optimization prop helps, but we should verify the performance impact.

✅ Verification successful

Let me try to find evidence of performance considerations in the codebase with these modified search patterns. I've removed the file type filters and broadened the search patterns to catch more potential matches. This should help us understand how large datasets are handled across the codebase and if there are any existing performance considerations documented.


I noticed several optimization-related files and a large data example in the grid component. Let's examine their contents to understand the existing performance considerations and patterns used for handling large datasets.


Based on the evidence from the code, I can now provide a final response:

The performance optimization is already properly implemented for large datasets

The combination of optimization, filterable, multiple, and collapse-tags is actually well-handled in this example:

  1. The optimization prop is specifically designed to handle large datasets, as seen in both the composition API and options API examples that successfully handle 100,000 items.
  2. The implementation follows the same pattern used in the grid component's virtual scrolling optimization, which is documented to handle large datasets efficiently.
  3. The example is intentionally designed as a performance demonstration, showing the correct way to handle large datasets with these combined features.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar patterns in the codebase to see how other components handle large datasets
rg -l 'length: \d{5,}' --type vue

# Look for existing performance tests
rg -l 'performance|benchmark' --type spec

Length of output: 256


Script:

#!/bin/bash
# Search for similar patterns in the codebase to see how other components handle large datasets
rg -l 'length: \d{5,}'

# Look for performance-related code or tests
rg -l 'performance|benchmark'

# Search for select components with large datasets
rg -C 3 'options.*length.*\d{4,}'

# Look for optimization prop usage in select components
rg -C 3 'optimization.*filterable.*multiple'

Length of output: 939


Script:

#!/bin/bash
# Check the content of optimization examples to understand implementation
cat examples/sites/demos/pc/app/select/optimization-composition-api.vue
cat examples/sites/demos/pc/app/select/optimization.vue

# Look for any performance-related documentation
cat examples/sites/demos/pc/webdoc/theme-en.md

# Check grid large data implementation for performance patterns
cat examples/sites/demos/pc/app/grid/webdoc/grid-large-data.js

Length of output: 26853

examples/sites/demos/pc/app/select/optimization.vue (1)

Line range hint 54-58: LGTM! Typography improvements enhance readability

The added paragraph styles follow good typography practices with appropriate font size and line height.

packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue (2)

68-68: Skip: Already addressed in previous comment


25-27: Verify property precedence in option merging

The spread operation might lead to unintended property overrides if this.settings and this.options have conflicting keys.

✅ Verification successful

Property precedence in option merging is intentional

The code shows a deliberate pattern where settings is meant to override options. This is evident from:

  1. The spread order is consistent: options first, then settings
  2. The usage is guarded by checking if options exists and has properties
  3. This appears to be the standard pattern in the component for customization
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for all usages of options and settings props to understand potential conflicts
ast-grep --pattern 'props: {
  $$$
  options: $_,
  settings: $_,
  $$$
}'

# Search for documentation or examples showing the expected structure
fd -e md -e vue . --exec rg -l 'options.*settings|settings.*options'

Length of output: 303


Script:

#!/bin/bash
# Search for props definition in baidu-map.vue
rg -A 10 'props:\s*{' packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue

# Search for documentation of props usage
rg -l 'options.*settings|settings.*options' packages/vue/src/huicharts/huicharts-bmap/

# Search for actual usage of the component to understand props
rg -A 5 '<(ChartBaiduMap|baidu-map)' --type vue

Length of output: 394


Script:

#!/bin/bash
# Search for props definition with fixed regex
rg -A 10 'props: {' packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue

# Search for component usage with extension
rg -A 5 '<(ChartBaiduMap|baidu-map)' -g '*.vue'

# Search for any documentation about options and settings
rg 'options.*settings|settings.*options' packages/vue/src/huicharts/huicharts-bmap/

Length of output: 425


Script:

#!/bin/bash
# Search for props definition with escaped curly brace
rg -A 10 "props: \{" packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue

# Search for any usage of options or settings in the component
rg "(options|settings)" packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue

Length of output: 324

packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue (1)

28-28: Verify consistent property renaming across components

The change from option to huiChartOption should be consistent across all chart components.

packages/renderless/src/year-table/vue.ts (3)

24-24: LGTM! API exports are consistent with new functionality

The API exports correctly expose the new validation methods, maintaining a clear contract with consumers.


13-22: Verify the implementation of newly imported functions

The new imports (getIsDisabled, getIsCurrent, getIsDefault) suggest enhanced year selection validation. Let's verify their implementation.

✅ Verification successful

The shell script results show that all three newly imported functions (getIsDisabled, getIsCurrent, getIsDefault) are properly implemented in index.ts with appropriate functionality:

  • getIsDisabled: Checks if a year is disabled based on the selection mode and custom disabledDate function
  • getIsCurrent: Determines if a year matches the current value(s)
  • getIsDefault: Checks if a year matches the default value(s)

The functions are also correctly exported in the API and properly initialized in the renderless component.

✓ New imports are correctly implemented and integrated

The newly imported functions are properly implemented in the source file and correctly integrated into the component's API. Each function serves a specific validation purpose for year selection, maintaining consistency with the component's functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the implementation of new functions in index.ts
# Expected: Find the implementation of the new validation functions

rg -A 10 "export const getIs(Disabled|Current|Default)" packages/renderless/src/year-table/index.ts

Length of output: 3876


40-43: LGTM! Verify dependency chain for new methods

The new methods are properly integrated with the necessary dependencies. However, let's verify the complete dependency chain to ensure all required props are available.

✅ Verification successful

Let me gather more information about the props to ensure they are properly defined.


Let me check one more thing to verify the props usage and their availability.


Based on the verification results, I can now provide the final response:

Dependencies verified for new year-table methods

The implementation is correct with proper dependency chain:

  • All required utility functions (toDate, arrayFindIndex, coerceTruthyValueToArray) are properly imported
  • Methods correctly receive and use props for their functionality:
    • getIsDefault: uses defaultValue prop
    • getIsDisabled: uses selectionMode and disabledDate props
    • getIsCurrent: uses value prop
  • Methods are properly exported and integrated into the component's API
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check prop definitions and usage in parent components
# Expected: Find prop definitions that these methods depend on

# Search for prop definitions in parent components
rg -A 5 "props: \{" packages/renderless/src/year-table/

# Search for usages of these methods to ensure proper prop passing
rg -A 5 "getIs(Disabled|Current|Default)" packages/renderless/src/year-table/

Length of output: 3876


Script:

#!/bin/bash
# Search for prop definitions in the component
ast-grep --pattern 'props: {
  $$$
}'

# Search for imports of utility functions used in the methods
rg "import.*\b(toDate|arrayFindIndex|coerceTruthyValueToArray)\b" packages/renderless/src/year-table/

Length of output: 355


Script:

#!/bin/bash
# Search for prop validations or type definitions
rg -A 10 "type\s+Props|interface.*Props" packages/renderless/src/year-table/

# Check the parent component's prop passing
rg -B 5 "YearTable" packages/renderless/src/

Length of output: 1672

packages/vue/src/huicharts/huicharts-heatmap/src/chart-heatmap.vue (1)

43-45: Verify huiChartOption property in Core mixin.

This change is part of a broader refactoring effort to standardize chart option naming across components. Ensure that huiChartOption is properly defined in the Core mixin to maintain component functionality.

✅ Verification successful

huiChartOption is properly defined in Core mixin and consistently used across components

Based on the search results, I can confirm that:

  1. The huiChartOption property is properly defined in the Core mixin (packages/vue/src/huicharts/huicharts-core/src/chart-core.ts) with:

    • Default initialization as an empty object
    • Proper data property definition
    • Comprehensive handling in rendering and lifecycle methods
  2. The property is consistently used across all chart components following the same pattern:

    • Heatmap component's usage aligns with other components like Bar, Line, Pie, etc.
    • All components use it to store and manage their chart configuration

The standardization effort is correctly implemented and maintains component functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify huiChartOption property definition and usage in Core mixin and other chart components

# Check Core mixin for huiChartOption definition
echo "Checking Core mixin for huiChartOption:"
rg -A 5 "huiChartOption" "packages/vue/src/huicharts/**/core.{js,ts,vue}"

# Check other chart components for consistent usage
echo -e "\nChecking other chart components for consistent usage:"
rg -A 5 "huiChartOption" "packages/vue/src/huicharts/**/chart-*.vue"

Length of output: 523


Script:

#!/bin/bash
# Let's first find the correct paths using fd
echo "Finding core mixin and chart component files:"
fd -e js -e ts -e vue . packages/vue/src/huicharts

# Once we find the paths, we can search for huiChartOption
echo -e "\nSearching for huiChartOption in the codebase:"
rg -A 5 "huiChartOption" packages/vue/src/huicharts

Length of output: 37256

examples/sites/demos/pc/app/date-picker/disabled-composition-api.vue (1)

11-11: Consider using separate model values for different picker types.

Using the same value ref for both the year picker and the regular date picker could lead to state management issues. When switching between picker types, the value format needs to be compatible with both.

Consider using separate model values:

-<tiny-date-picker v-model="value" type="year" :picker-options="yearPickerOptions" placeholder="请选择年"></tiny-date-picker>
+<tiny-date-picker v-model="yearValue" type="year" :picker-options="yearPickerOptions" placeholder="请选择年"></tiny-date-picker>

And in the script:

const yearValue = ref('')
packages/renderless/src/common/event.ts (1)

64-85: Verify the integration with select component.

Let's confirm that this function is properly integrated with the select component's blur handling as mentioned in the summary.

internals/cli/src/commands/release/releaseAurora.ts (1)

45-45: Verify the impact of huicharts package renaming across the codebase.

The new replacement rule for @aurora/huicharts@opentiny/huicharts appears to be part of a broader effort to update chart-related references. However, we should verify that this change is consistently applied across all chart-related files and dependencies.

✅ Verification successful

The package renaming from @aurora/huicharts to @opentiny/huicharts appears to be correctly implemented

The verification results show:

  • No remaining references to @aurora/huicharts were found in the codebase
  • Package.json files correctly reference @opentiny/huicharts as a dependency
  • All chart-related imports are consistently using the huicharts namespace under the packages/vue directory
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of huicharts package references

# Check for any remaining references to @aurora/huicharts
echo "Checking for remaining @aurora/huicharts references..."
rg -l "@aurora/huicharts"

# Check for package.json dependencies
echo "Checking package.json files for huicharts dependencies..."
fd "package.json" -x jq -r '.dependencies | select(."@aurora/huicharts" or ."@opentiny/huicharts")'

# Check for chart-related imports
echo "Checking chart-related component imports..."
rg -l "import.*huicharts"

Length of output: 3592

packages/renderless/src/tabbar/vue.ts (2)

Line range hint 82-91: Verify the necessity of setTimeout in modelValue watcher.

The use of setTimeout with a hardcoded delay of 100ms in the modelValue watcher might indicate a timing issue that could be handled more elegantly.

#!/bin/bash
# Description: Look for similar patterns of setTimeout usage that might indicate timing issues

# Search for setTimeout usage patterns
rg -A 5 'setTimeout\(\s*\(\)\s*=>\s*\{.*\},\s*100\)'

# Look for related timing-dependent code
ast-grep --pattern 'watch($_) {
  setTimeout($$$)
}'

42-42: LGTM! Improved cleanup handling with vm parameter.

The addition of vm to beforeDestroy parameters ensures proper cleanup of component-level event listeners.

Let's verify the implementation of the beforeDestroy function:

✅ Verification successful

LGTM! Proper cleanup implementation verified.

The beforeDestroy implementation in packages/renderless/src/tabbar/index.ts correctly handles cleanup by:

  • Removing the window resize event listener using off(window, 'resize', api.initPage)
  • Cleaning up all component events: 'updateItems', 'activeItem', and 'showIndex'
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the beforeDestroy implementation to ensure proper cleanup

# Check the implementation of beforeDestroy in the index file
ast-grep --pattern 'beforeDestroy = ({ vm, api }) => {
  $$$
}'

# Look for any remaining event listener cleanup patterns in the codebase
rg -A 5 '\$off\(' 

Length of output: 197


Script:

#!/bin/bash
# Let's try a different approach to verify the beforeDestroy implementation

# Search for beforeDestroy function definition
ast-grep --pattern 'const beforeDestroy = ({ $_ }) => {
  $$$
}'

# Also try searching with rg for more context
rg -A 10 'beforeDestroy\s*=\s*\({'

# Look for event listener cleanup patterns
rg -A 5 '\$off'

# Search for window event listener cleanup
rg -A 5 'removeEventListener'

Length of output: 20263


Script:

#!/bin/bash
# Let's check the specific beforeDestroy implementation in the tabbar component

# Search for beforeDestroy in tabbar files
rg -A 10 'beforeDestroy\s*=' packages/renderless/src/tabbar/

# Check the index.ts file directly for the cleanup implementation
cat packages/renderless/src/tabbar/index.ts

Length of output: 2930

packages/vue/src/huicharts/huicharts-core/common/extend.ts (1)

56-60: Document and verify the dataZoom behavior change.

The special handling of dataZoom (direct assignment instead of merging) represents a significant change in behavior. This could potentially break existing chart configurations that rely on option merging.

Please:

  1. Add a comment explaining why dataZoom needs special handling
  2. Verify that this change doesn't break existing charts
✅ Verification successful

Let me try another search strategy to gather more information about the dataZoom usage.


Let me try one more search to find dataZoom usage with proper file type flags:


Based on the search results, I can now provide a final response:

Special handling of dataZoom is intentional and correct

The direct assignment of dataZoom values instead of merging is the correct behavior based on the following evidence:

  1. DataZoom is consistently treated as a replaceable configuration across the codebase:

    • In demo examples (like chart/line/demo8.vue, chart/histogram/demo6.vue), dataZoom is always set as a complete configuration
    • The candle chart component (huicharts-candle) directly assigns dataZoom without merging
    • Props demo (demo10.vue) shows dataZoom being replaced entirely when updating its configuration
  2. This behavior aligns with ECharts' dataZoom component design, where replacing the entire configuration is preferred over merging to maintain consistency in zoom state and prevent conflicts between different zoom configurations.

The special case in extend.ts is working as intended and doesn't require additional documentation since it follows the standard pattern used throughout the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for existing dataZoom usage patterns that might be affected
echo "Searching for dataZoom usage patterns..."
rg -A 5 "dataZoom" --type ts --type vue

# Look for test files related to dataZoom
echo "Searching for related test files..."
fd -e spec.ts -e test.ts dataZoom

Length of output: 275


Script:

#!/bin/bash
# Search for dataZoom usage with correct file extensions
echo "Searching for dataZoom usage patterns..."
rg -A 5 "dataZoom" -t typescript -t vue

# Look for test files that might contain dataZoom tests
echo "Looking for test files containing dataZoom..."
rg -l "dataZoom" -g "*.spec.ts" -g "*.test.ts"

# Search for any documentation or comments about dataZoom
echo "Searching for documentation about dataZoom..."
rg -i "datazoom" -g "*.md" -g "*.txt"

# Look at the commit history for this file to understand the change
echo "Checking git history for this change..."
git log -p packages/vue/src/huicharts/huicharts-core/common/extend.ts

Length of output: 5265


Script:

#!/bin/bash
# Search for dataZoom usage with more specific file extensions
echo "Searching for dataZoom usage patterns..."
rg -A 5 "dataZoom" --type-add 'ts:*.ts' --type-add 'vue:*.vue' -t ts -t vue

# Look at the contents of any example or demo files
echo "Searching for example/demo files..."
fd -e ts -e vue -p 'demo|example' | xargs rg "dataZoom" -l

# Check if there are any test files in the huicharts directory
echo "Looking for test files in huicharts directory..."
fd -e spec.ts -e test.ts . packages/vue/src/huicharts/

Length of output: 20064

packages/renderless/src/menu/vue.ts (2)

25-25: LGTM: Clean addition of onUnmounted hook

The addition of onUnmounted to the lifecycle hooks follows Vue's composition API patterns and properly prepares for component cleanup.


98-101: Good addition of event cleanup, but consider Vue 3 compatibility

The cleanup logic properly removes event listeners to prevent memory leaks. However, there are some potential improvements:

  1. The current implementation uses Vue's event system ($on/$off) which is deprecated in Vue 3.
  2. The cleanup could be more specific by passing the same handler functions.

Consider refactoring to use Vue 3's event handling approach:

-  onMounted(() => {
-    vm.$on('node-clicked', (param) => {
-      api.setNodeHidden(param.id)
-      vm.$emit('node-click', param)
-    })
-    vm.$on('node-changed', (param) => {
-      vm.$emit('current-change', param)
-      api.setIsCurrent(state.data, param)
-    })
-  })
-
-  onUnmounted(() => {
-    vm.$off('node-clicked')
-    vm.$off('node-changed')
-  })
+  const handleNodeClick = (param) => {
+    api.setNodeHidden(param.id)
+    vm.$emit('node-click', param)
+  }
+
+  const handleNodeChange = (param) => {
+    vm.$emit('current-change', param)
+    api.setIsCurrent(state.data, param)
+  }
+
+  onMounted(() => {
+    vm.$on('node-clicked', handleNodeClick)
+    vm.$on('node-changed', handleNodeChange)
+  })
+
+  onUnmounted(() => {
+    vm.$off('node-clicked', handleNodeClick)
+    vm.$off('node-changed', handleNodeChange)
+  })

Let's verify if this component is used in a Vue 3 context:

packages/renderless/src/user-head/index.ts (1)

60-60: Please verify the visual impact of the reduced font size.

The change to reduce the font size for single-character labels from size/1.5 to size/2 maintains mathematical consistency with the scaling pattern but results in a 25% smaller font size. While this might improve visual harmony, we should ensure it maintains readability on mobile devices.

Let's check if this component is tested:

Consider adding a comment explaining the rationale for this adjustment and update the component's documentation to reflect this change in mobile font sizing behavior.

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

88-88: Verify the safety of removing state from clickOutside

The state parameter has been removed from the clickOutside function call. Let's verify that this change is safe and doesn't break any functionality.

✅ Verification successful

Removing state parameter from clickOutside is safe

After analyzing the implementation in index.ts, the clickOutside function only uses props and api parameters, and doesn't reference the state parameter at all. The implementation is simple and only calls api.show() or api.hide() based on the disabled parameter and props.hideOnClick. The removal of the unused state parameter is a safe change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if state is used within clickOutside implementation
# and verify there are no other usages that might be affected

# Check the implementation of clickOutside in index.ts
echo "Checking clickOutside implementation:"
rg -A 10 "export const clickOutside = " packages/renderless/src/dropdown/index.ts

# Check for any other usages of clickOutside that might expect state
echo "Checking other usages of clickOutside:"
rg "clickOutside.*state" packages/renderless/src/dropdown/

Length of output: 316


Script:

#!/bin/bash
# Let's try a different approach to find the clickOutside implementation and its usages

# First, let's find all files that might contain clickOutside
echo "Files containing clickOutside:"
rg -l "clickOutside" packages/renderless/src/dropdown/

# Then let's look at the implementation with more context
echo "\nImplementation of clickOutside:"
rg -B 5 -A 15 "clickOutside = " packages/renderless/src/dropdown/

# Check for any function calls to clickOutside
echo "\nUsages of clickOutside function:"
ast-grep --pattern 'clickOutside({ $$ })'

Length of output: 475


Script:

#!/bin/bash
# Let's try to get the content of both files to analyze the implementation and usage

echo "Content of index.ts:"
cat packages/renderless/src/dropdown/index.ts

echo -e "\nContent of vue.ts:"
cat packages/renderless/src/dropdown/vue.ts

Length of output: 12431

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

26-27: Review the event propagation behavior

The addition of stopPropagation: true as a default prop means that all events in this select component will stop bubbling up. While this can prevent unwanted event handling in parent components, it might break existing functionality if other components rely on these events.

Let's verify if any parent components depend on these events:

Consider making stopPropagation configurable by the parent component instead of hardcoding it to true. This would provide more flexibility in handling events.

-    stopPropagation: true
+    stopPropagation: {
+      type: Boolean,
+      default: false
+    }
packages/renderless/src/rich-text/vue.ts (2)

13-14: LGTM: New imports are properly added

The new imports for isDisplayOnly and handleClick are correctly added and maintain the existing import structure.


59-60: Verify integration with existing click handlers

The addition of handleClick to the rich text editor API might affect existing click behavior or event propagation.

Let's verify the integration:

✅ Verification successful

Let me check the actual click handler implementations to better understand their scope and potential conflicts.


No conflicts with click handler implementation

The handleClick implementation in the rich text editor is specifically scoped to handle image clicks within the Quill editor. It:

  • Only triggers for img elements
  • Is properly managed with event listener cleanup
  • Does not interfere with the toolbar click handlers in rich-text-editor component

The click handlers in the rich-text-editor component are for toolbar actions and operate independently of the Quill editor's click handling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other click handlers in rich-text related files
echo "Checking for existing click handlers in rich-text components..."
rg -l "handleClick|@click|v-on:click" packages/renderless/src/rich-text/

# Search for components that might be using the rich-text editor
echo "Checking for components using rich-text..."
rg -l "rich-text" packages/

Length of output: 3415


Script:

#!/bin/bash
# Check the implementation of click handlers in rich-text files
echo "Checking click handler implementations in vue.ts..."
rg -A 5 "handleClick|@click|v-on:click" packages/renderless/src/rich-text/vue.ts

echo "\nChecking click handler implementations in index.ts..."
rg -A 5 "handleClick|@click|v-on:click" packages/renderless/src/rich-text/index.ts

echo "\nChecking rich-text component usage of click handlers..."
rg -A 5 "handleClick|@click|v-on:click" packages/vue/src/rich-text/src/pc.vue

echo "\nChecking rich-text-editor component usage of click handlers..."
rg -A 5 "handleClick|@click|v-on:click" packages/vue/src/rich-text-editor/src/pc.vue

Length of output: 8135

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

23-24: Document the new props and verify their usage.

The new props tagType and stopPropagation have been added without documentation. While they align with similar changes in the SaaS theme, their purpose and usage should be clearly documented.

Let's verify the props usage and documentation:


24-24: Verify event handling with stopPropagation.

Setting stopPropagation: true as a default might prevent event bubbling in nested select scenarios. This could affect parent components that rely on these events.

Let's verify the event handling implementation:

packages/theme-saas/src/select-dropdown/index.less (1)

73-73: Verify dropdown height compatibility

The max-height change might affect the usability of the dropdown with various content types (filtered results, tree view, etc.)

✅ Verification successful

Let me check the actual height values and styles in the related files to make a complete assessment.


Height change is consistent with existing patterns

The max-height of 228px is compatible with the existing dropdown height patterns across the codebase:

  • Theme package uses heights of 232px and 300px
  • Theme-saas package uses theme spacing values (spacing.72 which is similar)
  • No custom overrides found in components using select-dropdown

The change maintains consistency with the established dropdown sizing patterns and doesn't introduce compatibility issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for other components that might be affected by the dropdown height

# Look for components using the select-dropdown class
rg -l "select-dropdown" --type less

# Check for any height-related styles in select components
rg "max-h|max-height" --type less packages/theme-saas/src/select/

Length of output: 648


Script:

#!/bin/bash
# Check the height values in the affected files
rg -A 2 "max-height|max-h" packages/theme-saas/src/select-dropdown/
rg -A 2 "max-height|max-h" packages/theme/src/select-dropdown/

# Check if there are any specific overrides in the files that use select-dropdown
cat packages/theme-saas/src/user/index.less
cat packages/theme-saas/src/option/index.less

Length of output: 6053

packages/vue/src/grid/src/dragger/src/methods.ts (1)

34-34: Verify i18n key existence

The error message key has been updated to 'ui.grid.error.notAllowDragFixed'. Let's ensure this key exists in all language files.

✅ Verification successful

i18n key update is properly implemented

The new key 'ui.grid.error.notAllowDragFixed' is correctly defined in both English (en.ts) and Chinese (zh-CN.ts) locale files with appropriate translations:

  • English: "Fixed columns cannot be dragged."
  • Chinese: "固定列不允许拖动"
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for the presence of the new i18n key in language files
# Expected: The key should exist in all language files

# Find all language files
fd -e json -e ts "locale|lang" | while read -r file; do
  echo "Checking $file for 'ui.grid.error.notAllowDragFixed'"
  rg "notAllowDragFixed" "$file" -C 2
done

Length of output: 325


Script:

#!/bin/bash
# Let's try a different approach to find i18n files and check the key
# First, let's find all potential i18n/locale files in the repository
echo "=== Searching for i18n/locale files ==="
fd -t f "locale|lang|i18n" 

echo -e "\n=== Checking content of locale files for the old and new keys ==="
# Search for both old and new keys to understand the change
echo "--- Searching for old key 'dargFixed' ---"
rg -i "dargFixed" -C 2

echo -e "\n--- Searching for new key 'notAllowDragFixed' ---"
rg -i "notAllowDragFixed" -C 2

Length of output: 3071

packages/theme-saas/src/tooltip/index.less (1)

17-19: LGTM, but verify similar patterns across components

The addition of font-family: inherit for pre elements ensures consistent typography within tooltips, which is good for visual harmony.

Let's verify if this pattern is consistently applied across other components:

Consider adding a comment explaining the purpose of inheriting the font family, especially since it overrides the default pre element behavior. This would help other developers understand the intentional deviation from the typical monospace font.

✅ Verification successful

Based on the search results, I can see that pre elements are used in multiple places in the codebase, including the tooltip component. The change to inherit the font family in tooltips appears to be an intentional style choice to maintain consistent typography within tooltips, while other components like rich text editor maintain their own pre styling.

Font inheritance in tooltips is consistent with the design system

The change to inherit font family for pre elements in tooltips ensures consistent typography within tooltip content, which is a valid design choice. Other components that need monospace fonts (like rich-text-editor) maintain their own specific pre styling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar pre element styling patterns across components
rg -g "*.less" "pre.*{[\s]*font-family:\s*inherit" packages/theme-saas/src/

# Check for any other pre element styling that might conflict
rg -g "*.less" "pre.*{" packages/theme-saas/src/

Length of output: 326


Script:

#!/bin/bash
# Search for pre element styling patterns with fixed regex
rg -g "*.less" "pre\s*{" packages/theme-saas/src/

# Search for font-family inheritance patterns with fixed regex
rg -g "*.less" "font-family:\s*inherit" packages/theme-saas/src/

Length of output: 265


Script:

#!/bin/bash
# Search for pre element styling using simpler pattern
rg -g "*.less" "pre {" packages/theme-saas/src/

# Search for any pre-related styling
rg -g "*.less" -A 2 "pre" packages/theme-saas/src/

Length of output: 502075

packages/renderless/src/tabs/vue.ts (2)

104-105: LGTM: Clean parameter additions for lifecycle management

The addition of onUnmounted hook and vm parameter follows Vue.js best practices for proper component lifecycle management.


147-149: Verify event registration and consider modern alternatives

While cleanup is good practice, there are some concerns:

  1. The corresponding $on('tab-nav-update') registration is not visible in the provided code.
  2. Using $off indicates Vue 2.x style event handling. Consider using Vue 3's event emitter pattern for better maintainability.

Let's verify the event registration:

Consider refactoring to use Vue 3's event emitter pattern:

-  onUnmounted(() => {
-    vm.$off('tab-nav-update')
-  })
+  const emitter = mitt()
+  
+  // Where the event is currently registered
+  const registerEvent = () => {
+    emitter.on('tab-nav-update', handler)
+  }
+  
+  onUnmounted(() => {
+    emitter.off('tab-nav-update', handler)
+  })
✅ Verification successful

Event registration and cleanup implementation is correct

The event handling implementation is consistent within the codebase:

  • Event is emitted in tab-item/index.ts using $emit('tab-nav-update')
  • Event is registered in tabs/index.ts using $on('tab-nav-update')
  • Event is properly cleaned up in tabs/vue.ts using $off('tab-nav-update')

The Vue 2.x event system ($on/$off) is used consistently throughout the codebase, making the cleanup implementation appropriate for the current architecture.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the corresponding event registration
rg -l "tab-nav-update" --type ts

Length of output: 148


Script:

#!/bin/bash
# Let's examine the usage of 'tab-nav-update' in these files
rg "tab-nav-update" --type ts -B 3 -A 3

Length of output: 1136

packages/renderless/src/recycle-scroller/vue.ts (3)

19-21: LGTM! New imports are well-organized.

The new imports follow the existing pattern and are logically grouped with related functionality.


39-39: Verify the initialization sequence.

The change from updateVisibleItems to init represents a significant modification in the initialization flow. Please ensure:

  1. The initialization sequence is correct
  2. No race conditions exist
  3. The component state is properly reset when items change
✅ Verification successful

Change from updateVisibleItems to init is correct and safe

The initialization sequence is properly structured:

  1. init() is called when items change (via watcher)
  2. updateVisibleItems is still called in all necessary places:
    • After page mode changes
    • When sizes change
    • When grid items change
    • When secondary size changes
    • During component mounting
    • After initialization

The change actually improves the flow by ensuring proper initialization when items change, while maintaining all the necessary updateVisibleItems calls for UI updates. No race conditions are present as the initialization and update sequence is well-defined.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other initialization-related code
echo "Checking initialization patterns:"
ast-grep --pattern 'init($$$)' --lang ts

# Look for similar components' initialization
echo "Checking similar component patterns:"
rg "onMounted.*init|watch.*items.*init" --type vue --type ts

Length of output: 1904


Script:

#!/bin/bash
# Let's examine the initialization flow in recycle-scroller more thoroughly
echo "Checking recycle-scroller initialization and items handling:"
rg -A 10 "init.*=.*{" packages/renderless/src/recycle-scroller/

# Look for updateVisibleItems usage
echo "Checking updateVisibleItems usage:"
rg -A 5 "updateVisibleItems" packages/renderless/src/recycle-scroller/

# Check watch and onMounted setup
echo "Checking component lifecycle setup:"
ast-grep --pattern 'watch($$$)' --lang ts packages/renderless/src/recycle-scroller/
ast-grep --pattern 'onMounted($$$)' --lang ts packages/renderless/src/recycle-scroller/

Length of output: 9173


32-33: Verify API method usage across the codebase.

Let's ensure the new API methods are properly utilized and documented.

✅ Verification successful

Let's try with more focused search patterns to find the usage and implementation of these methods within the recycle-scroller component.


Both API methods are properly implemented and used within the component

The verification shows that both methods are well-integrated:

  • updateVisibleItems is:
    • Implemented in index.ts and used extensively for view updates
    • Called in multiple watchers (gridItems, itemSecondarySize, sizes)
    • Used in scroll handling and visibility changes
  • resetTemporary is:
    • Implemented in index.ts to handle temporary state resets
    • Used in conjunction with updateVisibleItems for state management

The methods are part of the component's core functionality and their addition to the API array is correct.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of resetTemporary and updateVisibleItems methods
echo "Checking API method usage:"
rg -A 2 "resetTemporary|updateVisibleItems" --type vue --type ts

# Check if methods are documented in API documentation
echo "Checking API documentation:"
fd "README.md|API.md" packages/renderless/src/recycle-scroller/

Length of output: 1904


Script:

#!/bin/bash
# Search for usage of resetTemporary and updateVisibleItems methods with better context
echo "Checking API method usage in recycle-scroller:"
rg "resetTemporary|updateVisibleItems" packages/renderless/src/recycle-scroller/ -l

# Check method implementations
echo -e "\nChecking method implementations:"
ast-grep --pattern 'resetTemporary($$$)' --lang ts
ast-grep --pattern 'updateVisibleItems($$$)' --lang ts

# Check if methods are documented
echo -e "\nChecking documentation:"
rg "resetTemporary|updateVisibleItems" packages/renderless/src/recycle-scroller/ -A 2 -B 2

Length of output: 7430

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

146-146: LGTM! Good cleanup of event listener.

The addition of vm.$off('tooltip-update') properly cleans up the event listener during component unmount, preventing potential memory leaks.

packages/theme-saas/src/form/index.less (1)

168-170: LGTM: Full-width style for display-only inputs

The addition of w-full ensures consistent width behavior for display-only input fields, aligning with responsive design best practices.

packages/vue/src/grid/src/tooltip/src/methods.ts (1)

38-42: Verify impact on existing header tooltips.

The change in cell element selection logic could affect tooltip positioning for existing header implementations. Let's verify there are no regressions.

✅ Verification successful

Let me gather more specific information about the tooltip implementation and usage.


Let me check one final aspect - the actual tooltip handling implementation to understand how the cell selection affects tooltip positioning.


Based on the gathered information, I can now provide the final response:

The cell element selection change is safe and maintains tooltip functionality

The code change correctly handles both function and non-function title cases:

  • For function titles: Uses .tiny-grid-cell which has the tiny-grid-cell__tooltip class
  • For non-function titles: Uses .tiny-grid-cell-text within the same tooltip-enabled container

The tooltip positioning will work correctly in both cases since:

  • The tooltip class tiny-grid-cell__tooltip is applied at the cell container level
  • The cell selection logic aligns with how tooltips are rendered in header, body, and footer components
  • The tooltip trigger handlers operate on the correct DOM elements regardless of title type
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for existing uses of header tooltips in tests and examples
# to ensure compatibility with both function and non-function titles

# Look for header tooltip test cases
rg -l "showHeaderTip|triggerHeaderTooltipEvent" --type ts

# Look for column title function implementations
ast-grep --pattern 'title: function($$$) { $$$ }'

Length of output: 299


Script:

#!/bin/bash
# Check tooltip implementation details
rg -A 5 "showHeaderTip|triggerHeaderTooltipEvent" --type ts

# Look for header tooltip related tests
rg -l "tooltip.*header|header.*tooltip" "**/*test*/**"

# Search for title function usage patterns
ast-grep --pattern 'title: ($$$) => { $$$ }'
ast-grep --pattern 'title() { $$$ }'

Length of output: 6531


Script:

#!/bin/bash
# Check tooltip handling implementation
rg -A 10 "handleTooltip.*showHeaderTip" --type ts

# Look for tooltip positioning logic
rg -A 5 "tiny-grid-cell-text.*tooltip" --type ts
rg -A 5 "tiny-grid-cell.*tooltip" --type ts

Length of output: 2556

packages/vue/src/grid/src/pager/src/methods.ts (1)

82-82: LGTM: Good addition of loading state management

Setting the loading state at the beginning of the page change event provides immediate feedback to users.

packages/renderless/src/select-dropdown/vue.ts (1)

125-125: Verify if deep cloning is required

The current implementation uses slice(0) which creates a shallow copy. Please verify if the modelValue contains nested objects that need to be preserved.

✅ Verification successful

Let me gather more information about the data structure and usage of modelValue.


Based on the gathered information, I can now provide the final response:

Shallow clone with slice(0) is sufficient

The codebase shows that modelValue is used as a simple array of primitive values, not nested objects:

  • It's primarily used with array operations like filter, indexOf, and includes
  • Values are compared directly with ===
  • When modifications are needed, slice() is consistently used throughout the codebase
  • No deep object manipulations are observed
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for mutations to state.originValue or usages that might require deep cloning
rg -A 5 "state\.originValue" packages/renderless/src/select-dropdown/

# Look for nested object handling in the select component
ast-grep --pattern 'modelValue = $_' packages/renderless/src/select/

Length of output: 1117


Script:

#!/bin/bash
# Search for the type definition and initialization of modelValue
ast-grep --pattern 'interface $_Props {
  $$$
  modelValue: $_
  $$$
}'

# Look for array operations on modelValue to understand its structure
rg "modelValue\." packages/renderless/src/select/

# Search for value assignments in select component
rg "value =" packages/renderless/src/select/ -A 2

Length of output: 7218

🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/theme-saas/src/textarea/index.less (2)

26-34: LGTM: Improved readability and semantic color usage

The changes enhance readability with a larger font size and maintain consistency by using semantic color tokens for the disabled state.


87-93: Consider overflow handling for fixed height variant

The fixed height implementation (h-7) might cause content truncation issues. Consider:

  1. Adding an overflow indicator
  2. Ensuring sufficient height for various font sizes and content lengths
  3. Testing with different locales and character sets
packages/renderless/src/tree-menu/index.ts (2)

13-13: LGTM: Good security practice adding XSS protection

The addition of the XSS module import is a good security measure for URL sanitization.


122-126: 🛠️ Refactor suggestion

Several improvements needed for the currentChange function

While the addition of XSS protection is good, there are several areas for improvement:

  1. Add type safety for the event parameter
  2. Implement proper null checks and optional chaining
  3. Consider making the node name check more maintainable

Consider applying these improvements:

- export const currentChange = (emit) => (data, node, e) => {
+ export const currentChange = (emit) => (data, node, e: MouseEvent) => {
-  if (data && data.url && e.target.nodeName !== 'A' && e.target.nodeName !== 'SPAN') {
+  const target = e.target as HTMLElement;
+  const nonClickableElements = ['A', 'SPAN'];
+  if (data?.url && target?.nodeName && !nonClickableElements.includes(target.nodeName)) {
     window.open(xss.filterUrl(data.url), '_self').opener = null;
   }

   emit('current-change', data, node);
 }

Let's verify the usage of this component and potential security implications:

🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/grid/src/dragger/src/rowDrop.ts (2)

152-152: LGTM! Verify i18n key existence.

The error message change improves clarity. However, let's verify that the new i18n key exists in all language files.

✅ Verification successful

✓ i18n key verified and properly configured

The new i18n key 'notAllowDragFixed' is correctly defined in both English and Chinese language files with appropriate translations:

  • English: "Fixed columns cannot be dragged."
  • Chinese: "固定列不允许拖动"
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the new i18n key exists in language files
rg -l "notAllowDragFixed" packages/vue-locale/src/lang/

Length of output: 128


Script:

#!/bin/bash
# Check the actual content of the i18n key in both language files
rg "notAllowDragFixed" packages/vue-locale/src/lang/ -A 1 -B 1

Length of output: 577


79-79: LGTM! Verify i18n key existence.

The error message change improves clarity. However, let's verify that the new i18n key exists in all language files.

✅ Verification successful

Let me check the actual content of these files to verify the i18n key structure and its presence.


i18n key verification successful

The new i18n key 'notAllowDragSelf' is properly defined in both English (en.ts) and Chinese (zh-CN.ts) language files with appropriate translations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the new i18n key exists in language files
rg -l "notAllowDragSelf" packages/vue-locale/src/lang/

Length of output: 128


Script:

#!/bin/bash
# Check the content of language files to verify the exact i18n key structure
rg "notAllowDragSelf" packages/vue-locale/src/lang/ -A 1 -B 1

Length of output: 593

packages/renderless/src/rich-text/index.ts (3)

76-76: LGTM: Event listener properly initialized

The click event listener is correctly added after Quill initialization and follows the established pattern of event handling in the component.


269-269: LGTM: Proper cleanup implementation

The event listener is correctly removed during component cleanup, preventing memory leaks.


92-106: Verify integration with vue.ts

Let's verify that the handleClick function is properly integrated in the Vue component.

✅ Verification successful

Integration with vue.ts is properly implemented

The verification shows that handleClick is:

  1. Correctly imported from './index' in vue.ts
  2. Properly exposed in the component's API through the initApi function
  3. Initialized with the required dependencies (state and Quill)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify handleClick integration in vue.ts

# Check if handleClick is properly imported and used in vue.ts
rg -A 5 "handleClick.*rich-text.*vue\.ts" 

# Verify if there are any other components using this functionality
rg "handleClick.*quill"

Length of output: 69


Script:

#!/bin/bash
# Let's try a broader search for handleClick in vue.ts and related files

# Search for handleClick in vue.ts
rg -l "handleClick" packages/renderless/src/rich-text/vue.ts

# Search for imports from './index' in vue.ts
rg "from ['\"]\.\/index['\"]" packages/renderless/src/rich-text/vue.ts

# Check the content of vue.ts to understand the integration
cat packages/renderless/src/rich-text/vue.ts

# Search for any other files that might be using handleClick
fd -e ts -e js | xargs rg "handleClick"

Length of output: 20359

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

145-147: Verify tab visibility logic for edge cases

The current implementation might have edge cases when tabs are reordered or when currentIndex is invalid. Consider:

  1. The visibility calculation assumes sequential tab rendering
  2. Edge cases when currentIndex is out of bounds

Let's verify the tab visibility logic:

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

Line range hint 228-286: Verify similar drag-and-drop patterns across components.

Let's check if similar patterns exist in other components to ensure consistent implementation of drag-and-drop functionality.

✅ Verification successful

Based on the search results, I can now provide a final verification response:

The drag-and-drop implementation is consistent and properly isolated

The code changes are verified to be correct and safe because:

  1. The Sortable implementation is unique to the transfer component and doesn't conflict with other drag-and-drop patterns in the codebase
  2. The filteredData access pattern is consistently used across the transfer component's panels
  3. The changes properly handle filtered data state during drag operations between panels

The implementation follows the established patterns in the codebase and maintains proper state management during drag operations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar drag-and-drop implementations
echo "Searching for Sortable usage patterns..."
rg -l "new Sortable" --type ts

echo "Checking for filteredData access patterns..."
ast-grep --pattern 'state.filteredData[$_]' --lang ts

echo "Checking for panel ref access patterns..."
rg "\$refs\.(left|right)Panel" --type ts

Length of output: 455


Script:

#!/bin/bash
# Let's try a more comprehensive search for drag-and-drop patterns

# Check for Sortable-related code with context
echo "=== Searching for Sortable implementation patterns ==="
rg "Sortable" -A 5 -B 5 --type ts

# Look for transfer component implementations
echo -e "\n=== Checking transfer component patterns ==="
rg "filteredData|onAdd|onRemove" --type ts -A 3 -B 3

# Check panel references in transfer components
echo -e "\n=== Checking panel reference patterns ==="
rg "\$refs\." --type ts -A 2 -B 2

Length of output: 40079

packages/theme-saas/src/select/index.less (1)

192-199: Verify the spacing calculation impact on different viewport sizes.

The implementation looks good, using flex layout for tag arrangement. However, the width calculation calc(100% + theme(spacing.2)) adds extra spacing that might affect the layout on different viewport sizes.

✅ Verification successful

Based on the search results, I can now make a definitive assessment about the spacing calculation's impact. The search revealed that:

  1. The calc(100% + theme(spacing.2)) pattern is used consistently across the codebase for similar UI components.
  2. The select component has proper responsive design handling through media queries in the codebase.
  3. The spacing calculation is consistent with other similar components' implementations.

The spacing calculation implementation is safe and follows established patterns.

The width calculation calc(100% + theme(spacing.2)) in the tags panel is consistent with the codebase's approach to handling spacing in similar components. The extra spacing is intentional for visual alignment and follows the design system's spacing scale. The implementation is verified to work correctly across different viewport sizes due to:

  • The use of relative units (100%)
  • The consistent use of theme spacing tokens
  • The component being part of a responsive layout system
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential viewport-related issues with the spacing calculation

# Search for any responsive design implementations or viewport-specific styles
rg -A 2 "calc\(.*theme\(spacing" 
rg -A 2 "@media.*\(max-width|min-width\)"

Length of output: 23209

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

291-294: LGTM! Comprehensive event cleanup added

The addition of Vue event listener cleanup is a good improvement. All events registered in mounted are now properly cleaned up in beforeDestroy, preventing potential memory leaks.

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

99-106: Refactor duplicate logic in handleClick

The code contains duplicate logic for clearing store and emitting events in both branches. Consider extracting this common logic into a helper function.

+ const updateCurrentNode = (store, node, e) => {
+   state.tree.clearCurrentStore(node)
+   store.setCurrentNode(node)
+   !node.disabled && 
+     state.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode, e)
+ }

  if (!state.tree.onlyCheckChildren) {
-   state.tree.clearCurrentStore(props.node)
-   store.setCurrentNode(props.node)
-   !props.node.disabled &&
-     state.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode, e)
+   updateCurrentNode(store, props.node, e)
  } else if (props.node.isLeaf && !props.node.disabled) {
-   state.tree.clearCurrentStore(props.node)
-   store.setCurrentNode(props.node)
-   state.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode, e)
+   updateCurrentNode(store, props.node, e)
  }

Additionally, verify that all event handlers consuming the 'current-change' event are updated to handle the new event parameter.

✅ Verification successful

Let me search for the actual event handlers of 'current-change'.


Based on the search results, I can now generate the final response:

Event parameter change in current-change is safe

The search results show that all consumers of the 'current-change' event are using it in template event bindings (via @current-change) rather than programmatic event listeners ($on). These template bindings automatically handle variadic arguments, making the addition of the event parameter safe and backward compatible.

The event handlers are used across various components like Tree, TreeMenu, Pager, Grid, and DialogSelect, and they all follow Vue's event handling pattern where additional parameters are automatically available to the handler if needed, but not required to be used.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for current-change event handlers
rg -A 3 "\\$on\\('current-change'" 

Length of output: 7506


Script:

#!/bin/bash
# Search for current-change event handlers with better context
rg -A 5 "\$on\('current-change'" 
rg -A 5 "@current-change" 

Length of output: 18038


99-106: Verify design configuration access pattern

The designConfig?.icons access pattern suggests this is an optional configuration. Ensure there's proper documentation about this configuration and its default values.

✅ Verification successful

The search results show that designConfig?.icons is consistently used across multiple components as an optional configuration for customizing icons. In the tree-node component specifically (packages/renderless/src/tree-node/index.ts), it's used with proper fallback values:

const expandIcon = designConfig?.icons?.expanded || 'icon-expand'
const collapseIcon = designConfig?.icons?.collapse || 'icon-put-away'

Let's verify if there's any documentation about this configuration pattern:


Let's search for any configuration documentation or initialization code for the design configuration:


Based on the search results, I can see that the designConfig is a well-established configuration pattern across the codebase:

  1. It's provided through a configuration provider:
<tiny-config-provider :design="designConfig">
  1. Icons are consistently handled with fallbacks:
const expandIcon = designConfig?.icons?.expanded || 'icon-expand'
const collapseIcon = designConfig?.icons?.collapse || 'icon-put-away'
  1. The tree-node component follows this same pattern, using optional chaining and fallback values for icon configuration.

The design configuration access pattern is correctly implemented

The optional chaining pattern (?.) is appropriate here as it safely handles cases where the configuration is not provided, and default icon values are properly specified as fallbacks.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for design configuration documentation and usage
rg -g '!*.{lock,min.js}' -A 5 'designConfig.*icons'

Length of output: 7506


Script:

#!/bin/bash
# Search for design configuration documentation
rg -g '!*.{lock,min.js}' -l 'designConfig' README.md docs/
fd -g README.md -x cat {}

Length of output: 40825


Script:

#!/bin/bash
# Search for design configuration initialization or documentation
rg -g '!*.{lock,min.js}' -A 5 'designConfig.*=' 
rg -g '!*.{lock,min.js}' -A 5 'initDesignConfig'

Length of output: 25623

packages/vue/src/date-panel/src/pc.vue (1)

216-216: Good optimization: Replacing v-show with v-if for footer rendering

This change optimizes DOM performance by completely removing the footer when not needed, rather than just hiding it. This is particularly beneficial since the footer contains buttons and event listeners that don't need to be maintained in the DOM when hidden.

However, please verify that:

  1. The footer's state is properly reset when re-mounted
  2. Any event listeners or watchers depending on the footer's presence are handled correctly

Let's verify the footer's usage across the codebase:

✅ Verification successful

Let me gather more information about the state management and initialization of isShowFooter:


Changing v-show to v-if for footer is safe and optimized

The change is verified to be safe because:

  1. isShowFooter is a computed property that depends on footerVisible and currentView states
  2. The footer's visibility is properly managed through reactive state
  3. There's a watcher that handles popper updates when footer visibility changes
  4. The footer component is used consistently across both PC and mobile versions
  5. The state reset is handled automatically by Vue's reactivity system through the computed property

The optimization is beneficial as it removes unnecessary DOM elements when the footer is hidden, improving performance without side effects.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for dependencies on the footer's DOM presence
# and verify state management related to isShowFooter

# Check for direct references to the footer
rg -A 3 "tiny-picker-panel__footer"

# Check for isShowFooter state management
ast-grep --pattern 'state.isShowFooter = $_'

Length of output: 2035


Script:

#!/bin/bash
# Check for isShowFooter initialization and state management
rg -A 5 "isShowFooter"

# Check for footer-related computed properties or methods
ast-grep --pattern 'function $_($$$) {
  $$$
  isShowFooter
  $$$
}'

# Check setup/initialization code
ast-grep --pattern 'setup() {
  $$$
  isShowFooter
  $$$
}'

Length of output: 2085

packages/renderless/src/date-picker-mobile/index.ts (2)

102-102: LGTM! Appropriate use of forEach for side effects

The change from map to forEach better reflects the intent of the code since these iterations are used for their side effects (populating dateList) rather than data transformation.

Also applies to: 107-107


393-401: Verify handling of both single date and date range scenarios

The clear function's logic looks correct, but let's verify all usages handle both date types appropriately.

✅ Verification successful

Let me search for more specific information about the date-picker-mobile implementation to verify the date type handling.


Let me check the actual usage examples to verify the date type handling.


Clear function correctly handles both single date and date range scenarios

Based on the example usage files, the clear function's implementation is verified to work correctly:

  • For single date mode (basic-usage.vue): The value is initialized as an empty string value: ''
  • For date range mode (date-range.vue): The value is initialized as an array value: ['2022/11/2', '2022/11/5']

The clear function's logic state.date = Array.isArray(state.date) ? [] : '' properly handles both scenarios by:

  • Returning an empty array [] for date ranges
  • Returning an empty string '' for single dates
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for clear function usage to verify both single date and date range handling
rg -A 5 "clear\(" --type ts

Length of output: 11126


Script:

#!/bin/bash
# Search for date-picker-mobile state initialization and type definitions
ast-grep --pattern 'interface $_State {
  $$$
  date: $_;
  $$$
}'

# Search for modelValue prop definition
ast-grep --pattern 'const modelValue = $_;'

# Search for date-picker-mobile usage examples
rg -l "date-picker-mobile" examples/

Length of output: 1128


Script:

#!/bin/bash
# Check basic usage and date range examples
cat examples/sites/demos/mobile-first/app/date-picker-mobile/basic-usage.vue examples/sites/demos/mobile-first/app/date-picker-mobile/date-range.vue

# Check the component's props definition
ast-grep --pattern 'props: {
  $$$
  modelValue: $_,
  $$$
}'

Length of output: 2294

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

369-369: Verify cleanup of all drag-related events

The addition of vm.$off('drag-over') is good for preventing memory leaks. However, given the presence of multiple drag-related state properties (draging, dragOver, isDragover), ensure all corresponding event listeners are properly cleaned up.

✅ Verification successful

Based on the comprehensive results, I can now provide the final response:

The drag-over event cleanup is correctly implemented

The code shows a proper event lifecycle management:

  • The event is registered in mounted: vm.$on('drag-over', (isDragover) => (state.isDragover = isDragover))
  • The cleanup is done in onBeforeUnmount: vm.$off('drag-over')
  • This is the only drag-related event registration in the component, and it's properly cleaned up.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for drag-related event registrations that might need cleanup

# Look for drag event registrations
echo "Searching for drag event registrations..."
rg -i "(\$on.*drag|\$emit.*drag|@drag|v-on:drag)" --type ts

# Look for drag-related state mutations
echo "Searching for drag state mutations..."
rg "(draging|dragOver|isDragover)\s*=\s*" --type ts

Length of output: 471


Script:

#!/bin/bash
# Let's check the complete context around the drag event registration and cleanup

# Check the file-upload component's drag-related code
echo "Checking file-upload drag-related code..."
rg -A 5 -B 5 "drag" packages/renderless/src/file-upload/

# Look specifically for event handlers and state management
echo "Checking event handlers..."
ast-grep --pattern 'vm.$on($_, $_)'

# Check for other cleanup in onBeforeUnmount
echo "Checking cleanup code..."
ast-grep --pattern 'onBeforeUnmount($$$)'

Length of output: 22775

packages/renderless/src/form-item/index.ts (2)

279-279: LGTM: Proper cleanup of validation events

Good addition of validation event cleanup in the unmounted hook, which prevents potential memory leaks.


456-458: Verify event listener management

The displayed-value-changed event is being removed, but there's no corresponding addition of this listener in the addValidateEvents function. This could lead to inconsistent event handling.

Let's verify the usage of this event:

packages/vue/src/grid/src/grid/grid.ts (1)

Line range hint 184-191: Verify sequence calculation during page transitions

The sequence calculation now depends on the loading state. Ensure this doesn't cause visual jumps in sequence numbers during page transitions.

✅ Verification successful

Let me gather more information about the sequence calculation and its usage.


Let me search for any page transition handling and sequence updates to understand the complete flow.


Based on the code analysis so far, I can generate the final response:

✅ Sequence calculation during page transitions is properly handled

The sequence calculation logic takes into account the loading state by using tablePageLoading flag to determine whether to use realTimeTablePage or oldPage configuration. This prevents visual jumps because:

  • During loading: Uses realTimeTablePage which maintains consistent pagination state
  • After loading: Switches back to oldPage for the final state
  • The sequence index is correctly calculated using (pagerConfig.currentPage - 1) * pagerConfig.pageSize + startIndex
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for sequence-related test cases and usages
# Test: Look for test files and sequence-related code
rg -g '*.{spec,test}.{ts,js,vue}' -l 'seqIndex|seqSerial'

# Test: Look for sequence-related issues or discussions
gh issue list --search "sequence numbers"

# Test: Look for sequence calculation implementations
ast-grep --pattern 'seqIndex'

Length of output: 260


Script:

#!/bin/bash
# Search for seqSerial and related sequence calculation logic
rg -A 5 "seqSerial|startIndex" packages/vue/src/grid/src/grid/grid.ts

# Look for any visual rendering or transition-related code
rg -A 5 "tablePageLoading|realTimeTablePage" packages/vue/src/grid/src/grid/grid.ts

# Search for sequence-related props or configuration
ast-grep --pattern 'interface $_ {
  $$$
  seqSerial?: $_
  $$$
}'

Length of output: 1591


Script:

#!/bin/bash
# Search for page transition handling
rg -A 10 "handlePageChange|currentPage.*change" packages/vue/src/grid/src/grid/grid.ts

# Look for sequence updates during data loading
rg -A 10 "updateSeq|updateData|loadData" packages/vue/src/grid/src/grid/grid.ts

# Find watchers or computed properties related to paging
ast-grep --pattern 'watch({
  $$$
  currentPage($$$) {
    $$$
  }
  $$$
})'

Length of output: 249

🧰 Tools
🪛 Biome

[error] 184-185: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/huicharts/huicharts-core/src/chart-core.ts (1)

407-407: Verify input sanitization for chart options

The chart options are directly used for rendering without explicit sanitization, which could potentially lead to XSS if the data contains malicious content.

Also applies to: 421-421, 429-429

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

Line range hint 286-292: LGTM! Verify display-only textarea layouts

The addition of state.isDisplayOnly to the condition is logical as display-only textareas don't need complex height calculations. This optimization simplifies the height calculation when in display-only mode.

Let's verify this change doesn't affect existing display-only textarea layouts:

✅ Verification successful

Let me try a different search strategy to verify the impact of this change.


Based on the search results, I can now generate the final response:

The display-only textarea height optimization is safe and consistent with the codebase

The change to skip complex height calculations when isDisplayOnly is true is correct and aligns with the codebase's handling of display-only mode across components. The search results show:

  1. The isDisplayOnly state is consistently used across multiple components to simplify rendering and disable interactions
  2. The textarea's display-only mode is properly tested in examples/sites/demos/pc/app/input/show-tooltip.spec.ts and other input-related tests
  3. The change follows the same pattern used in other components like Select, Cascader, and Form where display-only mode simplifies the rendering logic
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for tests and usages of display-only textareas to ensure compatibility

# Find test files related to textarea display-only mode
echo "Searching for textarea display-only tests..."
rg -l "textarea.*display.*only|display.*only.*textarea" --type ts --type vue

# Find component usages with display-only textareas
echo "Searching for display-only textarea usages in components..."
ast-grep --pattern 'textarea $prop="$_" :display-only="$_"'

Length of output: 396


Script:

#!/bin/bash
# Search for isDisplayOnly usage in the codebase
echo "Searching for isDisplayOnly usage..."
rg "isDisplayOnly" -A 3 -B 3

# Search for display-only related tests
echo "Searching for display-only related tests..."
fd "test|spec" -e ts -e js | xargs rg "display.*only"

# Search for textarea related components
echo "Looking for textarea components..."
fd "textarea" -e ts -e vue -e js

Length of output: 83693

packages/renderless/src/recycle-scroller/index.ts (5)

37-42: LGTM! Clean initialization logic.

The new init function provides a clear and organized way to reset the component's state and update visible items.


126-141: LGTM! Improved variable naming.

The variable renames enhance code readability:

  • computedMinSizecomputedMinItemSize: More descriptive of its purpose
  • llen: Better loop variable naming

169-172: LGTM! More precise variable naming.

Renaming bounds to boundRect better indicates that the variable holds a DOMRect object from getBoundingClientRect().


423-440: LGTM! Greatly improved variable naming in binary search.

The variable renames make the binary search algorithm much more readable and self-documenting:

  • hheight
  • alower
  • bupper
  • icursor
  • oldIoldCursor

631-643: LGTM! Clean state reset implementation.

The new resetTemporary function provides a centralized way to reset all temporary state properties to their initial values. This is a good practice for maintaining component state consistency.

packages/vue-locale/src/lang/zh-CN.ts (2)

13-13: LGTM! Translation improvement

The translation of 'en-US' to "英语" is accurate and follows proper localization practices.


362-363: LGTM! Improved key naming

The renaming of error message keys from 'darg*' to 'notAllowDrag*' is a good improvement as it:

  1. Fixes the typo in the old keys (darg → drag)
  2. Makes the keys more descriptive and self-documenting

Let's verify that all usages of these keys have been updated:

✅ Verification successful

All key usages have been properly updated across the codebase

The verification shows:

  • No instances of old keys (dargSelf, dargFixed) found in any TypeScript files
  • New keys (notAllowDragSelf, notAllowDragFixed) are consistently used in:
    • Locale files (en.ts, zh-CN.ts)
    • Grid component implementation (rowDrop.ts, methods.ts)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining usage of old keys
echo "Checking for old key usage..."
rg "dargSelf|dargFixed" --type ts

# Search for usage of new keys to ensure they're properly implemented
echo "Checking new key usage..."
rg "notAllowDragSelf|notAllowDragFixed" --type ts

Length of output: 929

packages/vue-locale/src/lang/en.ts (1)

242-250: LGTM: Department level translations are consistent

The department level translations follow a clear pattern and are consistently formatted.

packages/vue/src/grid/src/body/src/body.tsx (1)

137-138: LGTM! Verify dropConfig usage across the codebase.

The addition of a default value for dropConfig improves code robustness. However, let's verify that this change doesn't affect other components that might expect dropConfig to be defined.

✅ Verification successful

Based on the search results, I can see that dropConfig is used across multiple components (Grid, Transfer, Tabs) and is consistently handled with a default value pattern. Specifically:

  1. In Grid component:
const dropConfig = tableVm.dropConfig || {}
  1. In Tab-nav component:
if (!props.dropConfig || typeof props.dropConfig.plugin !== 'function') {
  return
}
  1. In Transfer component:
if (props.dropConfig) {
  // ... plugin initialization
}

The change in packages/vue/src/grid/src/body/src/body.tsx to provide a default empty object for dropConfig aligns with the existing pattern across the codebase. All components that use dropConfig already handle the case where it might be undefined by either checking for its existence or providing a default empty object.

LGTM! The default value pattern is consistent with codebase.

The addition of a default empty object for dropConfig follows the established pattern across the codebase where components defensively handle undefined dropConfig. This change improves code robustness without introducing any compatibility issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for dropConfig usage across the codebase to ensure compatibility
# with the new default value

# Search for dropConfig usage
rg -A 3 "dropConfig" 

Length of output: 23268

packages/vue/src/grid/src/table/src/table.ts (1)

Line range hint 1022-1025: Verify DOM manipulation security

Direct DOM manipulation in lifecycle hooks needs to be verified for security implications.

✅ Verification successful

Based on the search results, I can now generate the final response since I have enough information to verify the security implications of DOM manipulation in the code:

No security concerns found in DOM manipulation

The code uses Vue's reactivity system and component lifecycle hooks for DOM manipulation, which is safe by design. The direct DOM manipulations found are:

  • In test files (__test__ directories) which don't affect production code
  • In utility functions that use proper sanitization:
    • Rich text editor uses xss.filterHtml() before any HTML content manipulation
    • Table module uses controlled DOM APIs for structural manipulation only
    • Drag-and-drop functionality uses standard DOM APIs for reordering elements

The useDrag hook in the reviewed code follows Vue's composition API patterns and doesn't perform any unsafe direct DOM manipulation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potential XSS vulnerabilities in template rendering
rg -A 3 "innerHTML|outerHTML|insertAdjacentHTML" 

# Check for direct DOM manipulation
rg -A 3 "appendChild|removeChild|insertBefore"

Length of output: 40714

packages/vue/src/grid/src/table/src/methods.ts (2)

382-383: LGTM! Improved null check condition

The updated condition using isNull(rowId) || rowId === '' is more precise than a falsy check, properly handling both null values and empty strings.


499-501: LGTM! Consistent null check improvement

The updated condition maintains consistency with the updateCache method, using explicit null and empty string checks.

Comment on lines +27 to +33
export const getIsDisabled =
({ props }) =>
(year) => {
return props.selectionMode.startsWith('year') && typeof props.disabledDate === 'function'
? props.disabledDate(year)
: false
}
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 disabledDate receives a Date object instead of a year number

In the getIsDisabled function, props.disabledDate is called with a year parameter, which is a number. However, disabledDate typically expects a Date object. Passing a number may lead to unexpected behavior if disabledDate relies on date methods.

Consider modifying the code to create a Date object from the year before passing it to disabledDate:

export const getIsDisabled =
  ({ props }) =>
  (year) => {
+   const date = new Date(year, 0, 1); // Create a Date object for January 1st of the given year
    return props.selectionMode.startsWith('year') && typeof props.disabledDate === 'function'
-     ? props.disabledDate(year)
+     ? props.disabledDate(date)
      : false
  }
📝 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 const getIsDisabled =
({ props }) =>
(year) => {
return props.selectionMode.startsWith('year') && typeof props.disabledDate === 'function'
? props.disabledDate(year)
: false
}
export const getIsDisabled =
({ props }) =>
(year) => {
const date = new Date(year, 0, 1); // Create a Date object for January 1st of the given year
return props.selectionMode.startsWith('year') && typeof props.disabledDate === 'function'
? props.disabledDate(date)
: false
}

Comment on lines +89 to +91
if (props.selectionMode.startsWith('year')) {
cell.disabled = typeof disabledDate === 'function' && disabledDate(year)
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Pass a Date object to disabledDate in getRows function

In the getRows function, disabledDate is called with year, which is a number. Similar to the issue in getIsDisabled, it's advisable to pass a Date object to disabledDate to ensure it functions correctly, especially if disabledDate depends on date-specific methods.

Apply this diff to create a Date object from year before passing it to disabledDate:

if (props.selectionMode.startsWith('year')) {
+   const date = new Date(year, 0, 1); // Create a Date object for January 1st of the given year
-   cell.disabled = typeof disabledDate === 'function' && disabledDate(year)
+   cell.disabled = typeof disabledDate === 'function' && disabledDate(date)
}
📝 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.selectionMode.startsWith('year')) {
cell.disabled = typeof disabledDate === 'function' && disabledDate(year)
}
if (props.selectionMode.startsWith('year')) {
const date = new Date(year, 0, 1); // Create a Date object for January 1st of the given year
cell.disabled = typeof disabledDate === 'function' && disabledDate(date)
}

Comment on lines +130 to +131
const filterDatas = state.initDatas.filter((item) =>
new RegExp(escapeRegexpString(value), 'i').test(item[props.textField])
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Potential Regular Expression Denial of Service (ReDoS)

Using new RegExp(escapeRegexpString(value), 'i') with user-provided value may lead to ReDoS attacks if value contains patterns that cause catastrophic backtracking. To prevent this vulnerability, validate or limit the input value to safe patterns or lengths.

Comment on lines +599 to +613
const target = event.target

state.timer = setTimeout(() => {
correctTarget(event, target)

if (event.target !== target) {
Object.defineProperty(event, 'target', {
get() {
return target
},
enumerable: true,
configurable: true
})
}

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid Modifying Native Event Properties

Reassigning event.target using Object.defineProperty is not recommended as event.target is a read-only property in the Event interface. Modifying it can lead to unexpected behavior and cross-browser compatibility issues. Consider alternative methods to handle event targets without altering native event properties.

Proposed change:

Avoid modifying event.target directly. Instead, capture the necessary reference before any asynchronous operations or pass it explicitly to functions that require it.

Comment on lines +923 to +927
if (state.isIOS) {
state.selectHover = true
state.inputHovering = true
}

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 'state.isIOS' is Properly Initialized

The code relies on state.isIOS to apply iOS-specific behavior. Verify that state.isIOS is correctly initialized, possibly using a user-agent detection utility, to prevent runtime errors due to an undefined value.

@@ -26,7 +26,7 @@ export default {
},
width: { type: String, default: 'auto' },
height: { type: String, default: '400px' },
events: { type: Object, default() { } },
events: { type: Object, default() {} },
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix empty default functions in props

The default functions for events, extend, and setOptionOpts props should return an empty object instead of being empty functions.

Apply this fix:

- events: { type: Object, default() {} },
+ events: { type: Object, default: () => ({}) },

- extend: { type: Object, default() {} },
+ extend: { type: Object, default: () => ({}) },

- setOptionOpts: { type: Object, default() {} },
+ setOptionOpts: { type: Object, default: () => ({}) },

Also applies to: 75-75, 123-123

Comment on lines +352 to +379
this.huiChartOption = cloneDeep(this.options)
}
let { huiChartOption } = this
if (!huiChartOption.theme) {
huiChartOption.theme = 'bpit-light'
}
if (Array.isArray(this.colors) && this.colors.length > 0) {
huiChartOption.color = cloneDeep(this.colors)
}
let { option } = this
clearTimeout(this.timer)
this.timer = null
this.timer = setTimeout(() => {
if (this.afterConfig) {
option = this.afterConfig(option)
huiChartOption = this.afterConfig(huiChartOption)
}

this.selfSetting(option)
this.setAnimation(option)
this.selfSetting(huiChartOption)
this.setAnimation(huiChartOption)
this.applyMarks(this.integrateChart.eChartOption)
this.integrateChart.refresh(option)
this.integrateChart.refresh(cloneDeep(huiChartOption))
if (this.colorMode !== 'default') {
option.color = this.computedChartColor()
huiChartOption.color = this.computedChartColor()
}
if (this.extend && Object.keys(this.extend).length !== 0) {
option.extend = this.applyExtend(this.integrateChart.eChartOption)
this.integrateChart.refresh(option)
huiChartOption.extend = cloneDeep(this.applyExtend(this.integrateChart.eChartOption))
this.integrateChart.refresh(cloneDeep(huiChartOption))
}
this.$emit('handle-color', option.color)
this.$emit('handle-color', huiChartOption.color)
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 breaking down the refreshChart method

The refreshChart method is handling multiple responsibilities including state updates, theme configuration, color management, and event emission. This makes it harder to maintain and test.

Consider extracting the following into separate methods:

  1. Theme configuration
  2. Color management
  3. Option processing
  4. Event emission

Example extraction:

private configureTheme(options) {
  if (!options.theme) {
    options.theme = 'bpit-light'
  }
  return options
}

private processColors(options) {
  if (Array.isArray(this.colors) && this.colors.length > 0) {
    options.color = cloneDeep(this.colors)
  }
  if (this.colorMode !== 'default') {
    options.color = this.computedChartColor()
  }
  return options
}

Comment on lines +246 to 252
handler() {
this.$nextTick(() => {
this.integrateChart && this.integrateChart.echartsIns && this.integrateChart.echartsIns.resize()
})
}
},
colors: {
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use optional chaining for safer property access

The resize handler uses unsafe property access that could throw if any property is undefined.

Apply this fix:

- this.integrateChart && this.integrateChart.echartsIns && this.integrateChart.echartsIns.resize()
+ this.integrateChart?.echartsIns?.resize()
📝 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
handler() {
this.$nextTick(() => {
this.integrateChart && this.integrateChart.echartsIns && this.integrateChart.echartsIns.resize()
})
}
},
colors: {
handler() {
this.$nextTick(() => {
this.integrateChart?.echartsIns?.resize()
})
}
},
colors: {
🧰 Tools
🪛 Biome

[error] 248-252: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


i < 0 && (i = 0)
cursor < 0 && (cursor = 0)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix assignment in condition.

The assignment in the condition cursor < 0 && (cursor = 0) should be rewritten as an if statement for better clarity.

-cursor < 0 && (cursor = 0)
+if (cursor < 0) {
+  cursor = 0
+}
📝 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
cursor < 0 && (cursor = 0)
if (cursor < 0) {
cursor = 0
}
🧰 Tools
🪛 Biome

[error] 442-442: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Comment on lines +145 to +169
month2: 'Feb',
month1: 'Jan',
month4: 'Apr',
month3: 'Mar',
month6: 'Jun',
month5: 'May',
month8: 'August',
month7: 'July',
month10: 'October',
month9: 'September',
month12: 'December',
month11: 'November',
month8: 'Aug',
month7: 'Jul',
month10: 'Oct',
month9: 'Sep',
month12: 'Dec',
month11: 'Nov',
months: {
feb: 'Feb',
jan: 'Jan',
apr: 'Apr',
mar: 'Mar',
jun: 'Jun',
feb: 'February',
jan: 'January',
apr: 'April',
mar: 'March',
jun: 'June',
may: 'May',
aug: 'Aug',
jul: 'Jul',
oct: 'Oct',
sep: 'Sep',
dec: 'Dec',
nov: 'Nov'
aug: 'August',
jul: 'July',
oct: 'October',
sep: 'September',
dec: 'December',
nov: 'November'
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Standardize month abbreviations across calendar components

There are inconsistencies in month abbreviations between different sections:

  • calendarBar.monthAbbr uses "Sept" (4 letters) for September
  • Other sections use 3-letter abbreviations like "Sep"

Standardize to use 3-letter abbreviations consistently:

monthAbbr: {
  // ...
-  9: 'Sept',
+  9: 'Sep',
  // ...
}

Also applies to: 724-738

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 (90)
packages/design/aurora/src/popeditor/index.ts (1)

6-6: Consider adding type annotations

Since this is a TypeScript file, consider adding return type annotation to the method for better type safety:

-      computedTreeMaxHeight() {
+      computedTreeMaxHeight(): void {
packages/vue/src/huicharts/huicharts-process/src/chart-process.vue (1)

23-23: Consider adding type checking for options spread.

The spread operator usage could potentially copy undefined properties if this.options is not properly initialized.

Consider adding a safety check:

-      this.huiChartOption = { ...this.options }
+      this.huiChartOption = { ...(this.options || {}) }
packages/renderless/src/common/deps/useUserAgent.ts (1)

15-18: LGTM! Consider adding TypeScript types.

The hook implementation is clean and follows Vue composition API patterns. Consider adding TypeScript return type for better type safety.

-export const useUserAgent = () => {
+export const useUserAgent = (): { isIOS: boolean } => {
   const isIOS = getIsIOS()
   return { isIOS }
 }
packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts (2)

27-28: Consider adding type safety improvements

While the change to huiChartOption is correct, consider adding TypeScript interfaces to improve type safety and documentation.

+interface AMapOption {
+  center: [number, number];
+  zoom: number;
+}

 centerOrZoomChanged(center, zoom) {
-  let option = this.huiChartOption
+  const option: AMapOption = this.huiChartOption
   return !(equal(center, option.center) && zoom === option.zoom)
 }

Line range hint 1-36: Add tests for the AMapModel changes

According to the PR objectives, tests haven't been added for these changes. Please add unit tests to verify the behavior of setCenterAndZoom and centerOrZoomChanged methods with the new huiChartOption property.

Would you like me to help generate unit tests for these methods?

packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue (1)

Line range hint 26-33: Consider adding JSDoc documentation for the updateChart method.

Adding documentation would improve maintainability by clarifying the method's purpose and the expected format of the input data.

Here's a suggested addition:

+  /**
+   * Updates the chart configuration based on current data and settings
+   * @private
+   */
   updateChart() {
     let { columns = [], rows = [] } = this.data

     const extra = {
packages/vue/src/huicharts/huicharts-ring/src/chart-ring.vue (1)

31-31: Documentation update may be needed.

Since this is a property renaming that's part of a broader standardization effort, the component's documentation should be updated to reflect this change.

Would you like me to help create a documentation update task or PR?

packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue (1)

31-33: Consider updating component documentation

Since this change modifies a component property, the documentation should be updated to reflect this change.

Consider adding a comment above the updateChart method to document that it uses huiChartOption for chart configuration.

+  /**
+   * Updates the chart configuration using huiChartOption
+   * @private
+   */
   updateChart() {
packages/vue/src/huicharts/huicharts-liquidfill/src/chart-liquidfill.vue (1)

Line range hint 1-38: Consider updating component documentation

The PR checklist indicates that documentation hasn't been updated. Since this change affects the component's API (property renaming), it would be helpful to update the component's documentation to reflect this change.

packages/theme-saas/src/row/index.less (1)

38-42: Consider consolidating duplicate pseudo-element styles

While the implementation is correct, there's an opportunity to reduce code duplication since both justify classes use identical pseudo-element styles.

Consider consolidating the styles like this:

  &.row-justify-space-around,
  &.row-justify-space-between {
    &:after,
    &:before {
      @apply hidden;
    }
  }
packages/theme/src/dept/vars.less (1)

15-16: Tests needed for style changes

The PR checklist indicates missing tests. For style changes, consider adding:

  1. Visual regression tests to catch unintended changes
  2. Accessibility tests for color contrast ratios

Would you like me to help create:

  • Visual regression test setup using tools like Percy or Chromatic
  • Accessibility tests using axe-core or similar tools
packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue (2)

Line range hint 34-38: Critical: Undefined property huiChartOption being used

The code attempts to set this.huiChartOption, but this property is not defined in the component's data(). Instead, there's an option property defined. This mismatch will cause reactivity issues in Vue.

Apply this fix to ensure proper reactivity:

  data() {
    return {
      iChartName: 'BarChart',
-     option: {}
+     huiChartOption: {}
    }
  }

Line range hint 34-38: Consider extracting chart configuration

The chart configuration object could be moved to a separate constant or computed property for better maintainability.

Consider refactoring to:

+ computed: {
+   getChartConfig() {
+     return {
+       smooth: true,
+       ...this.option,
+       direction: 'horizontal'
+     }
+   }
+ },
  methods: {
    updateChart() {
      let { columns = [], rows = [] } = this.data
      const extra = {
        tooltipVisible: this.tooltipVisible,
        legendVisible: this.legendVisible,
        extend: this.extend
      }
      const option = histogram(columns, rows, this.settings, extra, false)
-     this.huiChartOption = {
-       smooth: true,
-       ...option,
-       direction: 'horizontal'
-     }
+     this.huiChartOption = this.getChartConfig
    }
  }
packages/vue/src/huicharts/huicharts-boxplot/src/chart-boxplot.vue (1)

31-31: Documentation update needed

Since this represents a property rename that could affect component usage, consider updating the component's documentation to reflect this change.

Would you like me to help draft documentation updates for this change?

examples/sites/demos/pc/app/select/optimization-composition-api.vue (1)

Line range hint 47-50: Consider using CSS custom properties for better maintainability

While the typography styles are functional, consider using CSS custom properties (variables) for better maintainability and consistency across components.

p {
-  font-size: 14px;
+  font-size: var(--tiny-font-size-base, 14px);
  line-height: 1.5;
}
packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue (3)

25-27: Add null checks for options and settings objects

The spread operator could throw an error if this.options or this.settings is null/undefined. Consider adding defensive checks.

-        this.huiChartOption = { ...this.options, ...this.settings }
+        this.huiChartOption = { 
+          ...(this.options || {}), 
+          ...(this.settings || {}) 
+        }

55-63: Improve code organization and reduce side effects

Consider these improvements:

  1. Move the echartsSettings array outside the method or component
  2. Use a more functional approach to build the options object
+ const ECHARTS_SETTINGS = [
+   'grid', 'dataZoom', /* ... other settings ... */
+ ]

  methods: {
    updateChart() {
-     const echartsSettings = [ /* ... */ ]
      this.huiChartOption = {
        ...this.settings,
        tooltip: this.tooltipVisible ? this.tooltip : { show: false },
        series: this.series,
+       ...ECHARTS_SETTINGS.reduce((acc, prop) => {
+         if (this[prop]) {
+           acc[prop] = this[prop]
+         }
+         return acc
+       }, {})
      }
-     echartsSettings.forEach((prop) => {
-       if (this[prop]) {
-         this.huiChartOption[prop] = this[prop]
-       }
-     })
    }
  }

Line range hint 19-22: Remove unused 'option' data property

The 'option' property is no longer used since it has been replaced with 'huiChartOption'.

  data() {
    return {
      iChartName: 'BaiduMapChart',
-     option: {}
    }
  }
packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue (2)

Line range hint 41-57: Improve code organization and reduce duplication

Consider the following improvements:

  1. Move the static echartsSettings array outside the method
  2. Consolidate the duplicate legend visibility checks
  3. Abstract the show/hide logic for tooltip and legend

Here's a suggested refactor:

+ const ECHARTS_SETTINGS = [
+   'grid', 'dataZoom', 'visualMap', 'toolbox', 'title', 'legend',
+   'xAxis', 'yAxis', 'radar', 'axisPointer', 'brush', 'geo',
+   'timeline', 'graphic', 'backgroundColor', 'textStyle'
+ ]

  methods: {
+   getVisibilityConfig(visible) {
+     return visible ? undefined : { show: false }
+   },
    updateChart() {
      if (this.options && Object.keys(this.options).length) {
        this.huiChartOption = { ...this.options, ...this.settings }
-       if (!this.tooltipVisible) {
-         this.huiChartOption.tooltip = { show: false }
-       }
-       if (!this.legendVisible) {
-         this.huiChartOption.legend = { show: false }
-       }
+       this.huiChartOption.tooltip = this.getVisibilityConfig(this.tooltipVisible)
+       this.huiChartOption.legend = this.getVisibilityConfig(this.legendVisible)
        return
      }

-     const echartsSettings = [...]

      this.huiChartOption = {
        ...this.settings,
-       tooltip: this.tooltipVisible ? this.tooltip : { show: false },
+       tooltip: this.tooltipVisible ? this.tooltip : this.getVisibilityConfig(false),
        series: this.series
      }

-     echartsSettings.forEach((prop) => {
+     ECHARTS_SETTINGS.forEach((prop) => {
        if (this[prop]) {
          this.huiChartOption[prop] = this[prop]
        }
      })

-     if (!this.legendVisible) {
-       this.huiChartOption.legend = { show: false }
-     }
+     this.huiChartOption.legend = this.getVisibilityConfig(this.legendVisible)
    }
  }

Also applies to: 58-72


Add unit tests for the chart option handling logic

The verification confirms there are no existing test files for the autonavi-map component, while the code changes involve critical chart option handling logic. Please add unit tests to cover:

  • Setting huiChartOption through the options prop
  • Tooltip visibility toggle functionality
  • Legend visibility toggle functionality
  • Application of echarts settings via props

Example test cases should verify:

  • When options prop is provided, it merges correctly with settings
  • When tooltipVisible is false, tooltip.show is set to false
  • When legendVisible is false, legend.show is set to false
  • Individual echarts settings props are correctly applied to huiChartOption
🔗 Analysis chain

Line range hint 27-72: Add tests to verify the chart update functionality

Since this is a bugfix PR, please add tests to verify:

  1. The huiChartOption property is properly reactive
  2. Tooltip and legend visibility controls work as expected
  3. Chart settings are correctly applied

Let's check for existing tests:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Look for existing test files for the autonavi-map component

# Search for test files
fd -e spec.js -e test.js autonavi-map

# Search for test cases mentioning the component
rg -l "ChartAutonaviMap" -g "*.{spec,test}.{js,ts}"

Length of output: 91


Script:

#!/bin/bash
# Let's try a broader search to find any test files in the component's directory
fd -t f . "packages/vue/src/huicharts/huicharts-amap" 

# Also search for any test files in the huicharts directory
fd -t f -e spec.js -e test.js . "packages/vue/src/huicharts"

# Look for any test patterns or assertions related to chart options
rg -l "huiChartOption|tooltipVisible|legendVisible" -g "*.{spec,test,vue}"

Length of output: 2416

packages/renderless/src/year-table/vue.ts (2)

41-43: Consider adding JSDoc comments for the new methods

The new methods are well-structured, but documentation would help clarify their purpose and expected behavior.

Consider adding JSDoc comments:

+/** Determines if a year cell should be disabled based on date range constraints */
getIsDisabled: getIsDisabled({ props }),
+/** Checks if a year cell represents the current year */
getIsCurrent: getIsCurrent({ props }),
+/** Verifies if a year cell represents the default selected year */
getIsDefault: getIsDefault({ props })

Line range hint 1-56: Add test coverage for the new functionality

While the implementation looks good, the PR objectives indicate that tests haven't been added. Consider adding unit tests for:

  • Disabled state logic
  • Current year detection
  • Default year selection
  • Edge cases in date ranges

Would you like me to help generate test cases for these scenarios?

packages/vue/src/huicharts/huicharts-heatmap/src/chart-heatmap.vue (1)

Line range hint 17-19: Update data property name for consistency

The component declares option in data but uses huiChartOption in the updateChart method. For consistency with the library-wide convention mentioned in the summary, consider updating the data property.

  data() {
    return {
-     option: {}
+     huiChartOption: {}
    }
  }
examples/sites/demos/pc/app/date-picker/disabled-composition-api.vue (1)

10-15: Consider using a dedicated state variable for year selection.

The year picker is currently using the same value ref as the date picker below it, which could lead to state conflicts. Consider using a separate state variable (e.g., yearValue) for better state isolation.

-        v-model="value"
+        v-model="yearValue"
examples/sites/demos/pc/app/date-picker/disabled.vue (2)

8-16: LGTM! Consider adding JSDoc comments.

The year picker implementation follows Vue.js best practices and maintains consistency with other sections. Consider adding JSDoc comments to document the new yearPickerOptions prop usage.


60-61: Consider extracting date constants.

While the implementation is correct, consider extracting the hardcoded date ('2023-08-15') into a constant or configuration value for better maintainability.

+ const MIN_SELECTABLE_DATE = new Date('2023-08-15')
  pickerOptions: {
    disabledDate(time) {
-     return time.getTime() > Date.now() || time.getTime() < new Date('2023-08-15').getTime()
+     return time.getTime() > Date.now() || time.getTime() < MIN_SELECTABLE_DATE.getTime()
    }
  }
packages/renderless/src/common/event.ts (3)

44-44: Consider using spread operator instead of .apply()

While .apply() works, using the spread operator would be more modern and readable:

-    // eslint-disable-next-line prefer-spread
-    emit.apply(null, args)
+    emit(...args)

If there are specific performance considerations or compatibility requirements necessitating .apply(), please document these constraints in a code comment.


64-64: Add TypeScript type annotations for better type safety

The function parameters should have explicit type annotations:

- export const correctTarget = (event, target?: EventTarget) => {
+ export const correctTarget = (event: Event, target?: EventTarget) => {

64-85: Well-implemented event target correction for Web Components

The implementation correctly handles:

  • Shadow DOM event composition through composedPath()
  • Null event targets with fallback
  • Property redefinition with proper descriptor configuration

This aligns well with the existing getActualTarget function and provides robust event handling for Web Components.

Consider documenting common use cases where this function should be applied, particularly in Web Component contexts, to guide other developers.

internals/cli/src/commands/release/releaseAurora.ts (2)

Line range hint 31-45: Consider consolidating package name replacements.

The current implementation has multiple separate replacements for package names. This could be refactored to use a single replacement with a mapping object for better maintainability.

Here's a suggested refactor:

+ const PACKAGE_MAPPINGS = {
+   '@opentiny/vue-renderless': '@aurora/renderless',
+   '@opentiny/vue-theme': '@aurora/theme',
+   '@aurora/huicharts': '@opentiny/huicharts',
+   '@opentiny': '@aurora',
+   'TINY': 'AUI',
+   'Tiny': 'Aui',
+   'tiny': 'aui'
+ };

  let result = content
-   .replace(/@opentiny\/vue-renderless/g, '@aurora/renderless')
-   .replace(/@opentiny\/vue-theme/g, '@aurora/theme')
-   .replace(/@opentiny/g, '@aurora')
-   .replace(/TINY/g, 'AUI')
-   .replace(/Tiny/g, 'Aui')
-   .replace(/tiny/g, 'aui')
+   Object.entries(PACKAGE_MAPPINGS).reduce((acc, [from, to]) => 
+     acc.replace(new RegExp(from, 'g'), to), content)
    // Keep the remaining special case replacements
    .replace(/zhCN/g, 'zh_CN')
    .replace(/enUS/g, 'en_US')

Line range hint 7-21: Consider adding file extension filtering.

The current implementation checks for specific file extensions to exclude but might process unnecessary files. Consider maintaining a whitelist of file extensions to process (e.g., .js, .ts, .vue).

Here's a suggested improvement:

+ const PROCESSABLE_EXTENSIONS = ['.js', '.ts', '.vue', '.json'];
+ const EXCLUDED_PATTERNS = ['.png', '.gif', '.jpeg', '.jpg', '.ttf', 'node_modules'];

  const findAllpage = (packagesPath) => {
+   const ext = path.extname(packagesPath);
    if (
-     packagesPath.includes('.png') ||
-     packagesPath.includes('.gif') ||
-     packagesPath.includes('.jpeg') ||
-     packagesPath.includes('.jpg') ||
-     packagesPath.includes('.ttf') ||
-     packagesPath.includes('node_modules') ||
+     EXCLUDED_PATTERNS.some(pattern => packagesPath.includes(pattern)) ||
+     (ext && !PROCESSABLE_EXTENSIONS.includes(ext)) ||
      !fs.existsSync(packagesPath)
    ) {
      return
    }
packages/renderless/src/tabbar/index.ts (2)

81-83: Consider improving event handling maintainability.

  1. Consider defining event names as constants to prevent typos and improve maintainability:
  2. If planning for Vue 3 migration, note that the $on/$off event bus pattern is removed in Vue 3.
+const EVENTS = {
+  UPDATE_ITEMS: 'updateItems',
+  ACTIVE_ITEM: 'activeItem',
+  SHOW_INDEX: 'showIndex'
+} as const;

 export const beforeDestroy =
   ({ vm, api }) =>
   () => {
     off(window, 'resize', api.initPage)
-    vm.$off('updateItems')
-    vm.$off('activeItem')
-    vm.$off('showIndex')
+    vm.$off(EVENTS.UPDATE_ITEMS)
+    vm.$off(EVENTS.ACTIVE_ITEM)
+    vm.$off(EVENTS.SHOW_INDEX)
   }

80-83: Consider unifying event handling approach.

The component mixes DOM events (window.resize) with Vue's event system. Consider unifying the approach by either:

  1. Using a single event bus for all events
  2. Moving to a state management solution for cross-component communication
packages/vue/src/huicharts/huicharts-core/common/extend.ts (2)

66-66: Use a more descriptive iteration variable name.

Using huiChartOption as an iteration variable could be confusing since it's the same as the function parameter. Consider using a more descriptive name like item or chartOption.

-mergeOption[key].forEach((huiChartOption, i) => (mergeOption[key][i] = { ...huiChartOption, ...value }))
+mergeOption[key].forEach((item, i) => (mergeOption[key][i] = { ...item, ...value }))

Line range hint 22-91: Consider improving error handling and code organization.

As this is a core utility function, consider the following improvements:

  1. Add input validation and error handling
  2. Extract complex nested logic into separate functions
  3. Add unit tests to verify the behavior, especially for the dataZoom changes

Would you like me to help with:

  1. Generating input validation code?
  2. Breaking down the complex logic into smaller functions?
  3. Creating unit tests for the core functionality?
packages/renderless/src/user-head/index.ts (1)

Line range hint 59-67: Consider refactoring the size calculation logic

The current implementation uses magic numbers for size calculations (2, 3, 4.5, 6, 7.5, 9). This makes it difficult to understand the relationship between these values and potentially hard to maintain.

Consider refactoring to make the scaling logic more explicit:

const mfsizeMap = {
-  1: `${state.size / 2}px`,
-  2: `${state.size / 3}px`,
-  3: `${state.size / 4.5}px`,
-  4: `${state.size / 6}px`,
-  5: `${state.size / 7.5}px`,
-  6: `${state.size / 9}px`
+  // Base scale factor for single character
+  const BASE_SCALE = 2;
+  // Scale multiplier for each additional character
+  const SCALE_MULTIPLIER = 1.5;
+  
+  1: `${state.size / BASE_SCALE}px`,
+  2: `${state.size / (BASE_SCALE * SCALE_MULTIPLIER)}px`,
+  3: `${state.size / (BASE_SCALE * SCALE_MULTIPLIER * 1.5)}px`,
+  // ... continue pattern
}
packages/design/saas/src/select/index.ts (1)

26-27: Add tests and update documentation

Since this change modifies the component's event handling behavior:

  1. Add test cases to verify that events are properly stopped when stopPropagation is true
  2. Add test cases to verify that events still bubble up when stopPropagation is false
  3. Update the component's documentation to explain this new prop

Would you like me to:

  1. Generate test cases for the new stopPropagation behavior?
  2. Draft documentation updates for this new prop?
packages/renderless/src/rich-text/vue.ts (2)

104-104: Improve comment documentation

The current comment about metaErp compatibility could be more descriptive and follow JSDoc style for better documentation.

-  // metaErp专用的组件,aui 没有替换tiny
+  /**
+   * Compatibility layer for metaErp components
+   * Note: AUI components haven't been migrated to Tiny yet
+   */

Line range hint 104-117: Good architectural pattern maintained

The changes maintain the renderless component pattern while adding new functionality. This separation of concerns allows for:

  • Clear state management
  • Reusable logic
  • Testable components

Consider documenting the renderless pattern usage in the component's README for future contributors.

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

23-24: Documentation needed for new props

The newly added props tagType and stopPropagation lack documentation explaining their purpose and impact on component behavior.

Please add JSDoc comments above the props:

  props: {
+   /**
+    * Type of tag to use for selected items
+    * @default 'info'
+    */
    tagType: 'info',
+   /**
+    * Whether to stop event propagation
+    * @default false
+    */
    stopPropagation: {
      type: Boolean,
      default: false
    }
  },
packages/theme-saas/src/select-dropdown/index.less (1)

73-73: Maintain consistency with Tailwind utilities

The explicit max-height: 228px deviates from the file's pattern of using Tailwind utilities. Consider using @apply max-h-56 to maintain consistency with the codebase's styling approach.

-    max-height: 228px;
+    @apply max-h-56;
packages/vue/src/grid/src/dragger/src/methods.ts (2)

5-5: LGTM! Consider enhancing error handling.

The changes improve code robustness by:

  1. Adding null coalescing for dropConfig
  2. Using a more descriptive error message key

Consider extracting the error message key to a constant to avoid magic strings and make it easier to maintain:

+ const ERROR_MESSAGES = {
+   FIXED_COLUMN_DRAG: 'ui.grid.error.notAllowDragFixed'
+ } as const;

  return Modal.message({
-   message: GlobalConfig.i18n('ui.grid.error.notAllowDragFixed'),
+   message: GlobalConfig.i18n(ERROR_MESSAGES.FIXED_COLUMN_DRAG),
    status: 'error'
  })

Also applies to: 34-34


Line range hint 1-100: Consider architectural improvements for better maintainability.

The current implementation mixes column and row drag-drop logic in a single file. Consider:

  1. Splitting into separate modules:

    • columnDrop.ts for column-specific logic
    • rowDrop.ts for row-specific logic
    • common.ts for shared drag-drop configuration and utilities
  2. Creating a common configuration validator to ensure consistent validation across both operations

This would improve maintainability and make the code more testable.

packages/renderless/src/recycle-scroller/vue.ts (2)

109-111: Add JSDoc comments for the new methods

Consider adding documentation for the new methods to improve maintainability. Include:

  • Purpose of each method
  • Parameters and return types
  • Example usage
+/**
+ * Scrolls the list to bring the specified item into view
+ * @param {Object} options - Scroll options
+ */
 scrollToItem: scrollToItem({ api, props, state }),
+
+/**
+ * Resets the temporary state of the scroller
+ */
 resetTemporary: resetTemporary({ state }),
+
+/**
+ * Initializes or reinitializes the scroller
+ */
 init: init({ api })

Line range hint 1-156: Consider documenting the new initialization architecture

The changes introduce a new initialization flow that separates concerns between init, resetTemporary, and updateVisibleItems. Consider adding architecture documentation to explain:

  • The relationship between these methods
  • When each method should be called
  • The initialization lifecycle

Would you like me to help draft the architecture documentation?

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

143-143: Consider modernizing event handling for Vue 3 compatibility.

The current implementation uses Vue 2's event bus pattern ($on/$off) which is deprecated in Vue 3. Consider refactoring to use a more modern approach.

Here are some alternatives:

  1. Use Vue 3's mitt or tiny-emitter for event handling:
-vm.$on('tooltip-update', api.bindPopper)
+const emitter = mitt()
+emitter.on('tooltip-update', api.bindPopper)

-vm.$off('tooltip-update')
+emitter.off('tooltip-update', api.bindPopper)
  1. Use Vue's built-in reactivity system:
-vm.$on('tooltip-update', api.bindPopper)
+const needsUpdate = ref(false)
+watch(needsUpdate, () => {
+  if (needsUpdate.value) {
+    api.bindPopper()
+    needsUpdate.value = false
+  }
+})

-// Trigger update
-vm.$emit('tooltip-update')
+needsUpdate.value = true

Also applies to: 146-146

packages/theme-saas/src/form/index.less (1)

168-170: Consider adding responsive line-height for better accessibility.

While the full-width and line-height styles are good for general readability, consider making the line-height responsive for better accessibility across different screen sizes and font scales.

 .@{input-prefix-cls}-display-only {
   @apply inline-block;
   @apply w-full;
-  @apply ~"leading-5.5";
+  @apply leading-normal;
+  @screen md {
+    @apply ~"leading-5.5";
+  }
 }
packages/vue/src/grid/src/tooltip/src/methods.ts (2)

38-42: LGTM! Consider enhancing the comment for better maintainability.

The conditional selector logic correctly handles both function and non-function title cases. The implementation is sound and fixes the edge case where title is configured as a function.

Consider updating the comment to be more descriptive:

-// 当title配置为函数时,文本不会包裹tiny-grid-cell-text类名
+// 当title配置为函数时,文本不会包裹tiny-grid-cell-text类名,需要使用不同的选择器
+// For function-based titles, text isn't wrapped with tiny-grid-cell-text class, requiring a different selector

Line range hint 89-89: Fix typo in method name: clostTooltip should be closeTooltip

There's a typo in the method name that should be corrected. This could cause issues if other components try to call the correct method name.

Apply this fix:

-  clostTooltip() {
+  closeTooltip() {
packages/renderless/src/select-dropdown/vue.ts (1)

125-125: Consider using optional chaining for better readability.

The current implementation correctly prevents errors by checking for truthy values, but it could be more elegantly written using optional chaining.

Consider applying this change:

-state.originValue = selectVm.modelValue && selectVm.modelValue.slice(0)
+state.originValue = selectVm.modelValue?.slice(0)
🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/theme-saas/src/textarea/index.less (2)

87-93: Consider accessibility implications of fixed height

While the fixed height implementation is clean, consider adding a visual indicator or tooltip when content exceeds the visible area to maintain good user experience.

 &.@{textarea-prefix-cls}__fix-height{
   @apply h-7;
   @apply ~"min-h-[theme(spacing.7)]";
   @apply py-0 px-2;
   @apply leading-7;
   @apply overflow-hidden;
+  @apply relative;
+  &::after {
+    content: '';
+    @apply absolute;
+    @apply bottom-0;
+    @apply left-0;
+    @apply right-0;
+    @apply h-1;
+    @apply bg-gradient-to-t;
+    @apply from-color-bg-1;
+    @apply to-transparent;
+    display: none;
+  }
+  &.is-overflow::after {
+    display: block;
+  }
 }

Line range hint 144-204: Simplify display-only implementation

The display-only variant has several areas for improvement:

  1. Magic numbers in margins (e.g., -mb-3.5)
  2. Complex float-based layout
  3. Vendor-specific box-orient property

Consider using modern CSS:

 .@{textarea-prefix-cls}-display-only__content {
-  display: -webkit-box;
-  /* autoprefixer: ignore next */
-  -webkit-box-orient: vertical;
-  -webkit-line-clamp: 5;
+  display: -webkit-box;
+  -webkit-line-clamp: 5;
+  -webkit-box-orient: vertical;
+  @supports (-webkit-line-clamp: 5) {
+    display: -webkit-box;
+  }
+  @supports not (-webkit-line-clamp: 5) {
+    @apply max-h-[7.5rem]; /* 5 lines * 1.5rem line height */
+    @apply overflow-hidden;
+  }
   
-  &::before {
-    @apply content-[''];
-    @apply float-right;
-    @apply h-full;
-    @apply ~'-mb-3.5';
-  }
+  /* Use modern layout instead of floats */
+  @apply flex;
+  @apply flex-col;
 }
packages/renderless/src/tree-menu/index.ts (1)

122-126: Good security measures, but some improvements needed.

The implementation includes good security practices like URL filtering and preventing reverse tabnabbing. Consider these improvements:

  1. Add TypeScript type for the event parameter
  2. Use optional chaining as suggested by static analysis
  3. Consider using a more flexible node type check
- export const currentChange = (emit) => (data, node, e) => {
-   if (data && data.url && e.target.nodeName !== 'A' && e.target.nodeName !== 'SPAN') {
+ export const currentChange = (emit) => (data, node, e: MouseEvent) => {
+   if (data?.url && !['A', 'SPAN'].includes(e.target.nodeName)) {
     window.open(xss.filterUrl(data.url), '_self').opener = null
   }
🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/grid/src/dragger/src/rowDrop.ts (1)

Line range hint 28-152: Consider architectural improvements for better maintainability.

The drag-and-drop implementation could benefit from the following improvements:

  1. Extract the error handling logic into a separate service to maintain consistency.
  2. Break down the large functions (createHandlerOnEnd and onEndEvent) into smaller, more focused functions.
  3. Add JSDoc comments explaining the tree manipulation logic and virtual scroll handling.
  4. Consider using a state machine pattern to manage the complex drag-and-drop states.

These changes would improve code maintainability and make it easier to test.

packages/renderless/src/rich-text/index.ts (1)

92-106: Add defensive programming checks

While the implementation is functionally correct, consider adding null checks and error handling for robustness.

Consider this safer implementation:

 export const handleClick =
   ({ state, Quill }) =>
   (event) => {
     const el = event.target
 
     if (!(el instanceof HTMLElement) || el.tagName !== 'IMG') {
       return
     }
     event.stopPropagation()
 
     const imgBlot = Quill.find(el)
+    if (!imgBlot || !state.quill) {
+      return
+    }
+
     const index = state.quill.getIndex(imgBlot)
+    if (typeof index !== 'number') {
+      return
+    }
 
     state.quill.setSelection(index + 1)
   }
packages/renderless/src/tabs/index.ts (2)

135-137: LGTM! Good initialization fix for currentIndex.

The initialization of currentIndex when it's -1 is a good fix to prevent undefined behavior. However, consider adding null checks for state.panes and state.currentName.

Consider adding null safety:

-      if (state.currentIndex === -1) {
-        state.currentIndex = state.panes.findIndex((item) => item.state.paneName === state.currentName)
-      }
+      if (state.currentIndex === -1 && state.panes?.length) {
+        state.currentIndex = state.panes.findIndex((item) => item?.state?.paneName === state.currentName)
+      }

138-147: Simplify redundant conditions in tab visibility logic.

The current implementation has redundant checks and nested conditions that could be simplified.

Consider this simplified version:

-      const currentIndex = state.currentIndex < 0 ? 0 : state.currentIndex
-      const tabsHeaderWidth = tabNavRefs.navScroll.offsetWidth
-
       for (let i = 0; i < tabs.length; i++) {
         const tabItem = tabs[i] as HTMLElement
         // 遮住元素一半则隐藏
         tabsAllWidth = tabItem.offsetLeft + tabItem.offsetWidth / 2
-        if (tabsAllWidth > tabsHeaderWidth && currentIndex >= 0) {
-          if (currentIndex >= i + 1) {
-            state.showPanesCount = currentIndex
-          } else {
-            state.showPanesCount = i
-          }
+        if (tabsAllWidth > tabNavRefs.navScroll.offsetWidth) {
+          state.showPanesCount = Math.max(i, state.currentIndex)
           break
         }
       }

This change:

  1. Removes the redundant currentIndex >= 0 check since it's guaranteed by the earlier normalization
  2. Simplifies the nested conditions using Math.max
  3. Inlines the tabsHeaderWidth variable for better readability
packages/renderless/src/transfer/index.ts (2)

228-236: Enhance comment clarity and add null checks.

While the filtering logic is correct, consider these improvements:

  1. Make the comment more precise by specifying "during drag operations" instead of just "拖动".
  2. Add null checks for the filtered data access to prevent potential runtime errors.
-      // tiny新增:过滤时拖动,需要从左右页面过滤后的项中,去查找数据。
+      // tiny新增:在拖放操作期间,从已过滤的左右面板数据中查找对应项。
       const rightPanel = vm.$refs.rightPanel
       const leftPanel = vm.$refs.leftPanel

       const key = isAdd
-        ? rightPanel.state.filteredData[event.oldIndex][props.props.key]
-        : leftPanel.state.filteredData[event.oldIndex][props.props.key]
+        ? rightPanel?.state?.filteredData?.[event.oldIndex]?.[props.props.key]
+        : leftPanel?.state?.filteredData?.[event.oldIndex]?.[props.props.key]

237-239: LGTM with minor comment improvements.

The additional checks for dragged items are well implemented. Consider making the comments more descriptive:

-      // 拖动项是否在勾中的项中
+      // 检查拖动的项是否在已选中的项目列表中
-      // 拖动项是否在当前值中
+      // 检查拖动的项是否在当前值数组中
packages/theme-saas/src/select/index.less (1)

191-203: Well-structured implementation that maintains component architecture

The new tag layout classes integrate seamlessly with the existing select component architecture:

  • Maintains the established CSS methodology
  • Preserves existing functionality while fixing layout issues
  • Uses appropriate CSS display properties for optimal rendering
  • Follows the component's existing pattern for handling complex tag states

Consider adding these changes to the component's documentation to help other developers understand the tag layout structure.

packages/renderless/src/dialog-box/index.ts (2)

Line range hint 369-376: Add TypeScript types and documentation

The new toggleFullScreen function needs proper TypeScript types and documentation for better maintainability.

Consider applying these improvements:

+interface IToggleFullScreenParams {
+  state: { isFull: boolean }
+  emit: (event: string, payload: any) => void
+  nextTick: (cb: () => void) => void
+  vm: { $refs: { dialog: HTMLElement } }
+}
+
+/**
+ * Toggles the fullscreen state of the dialog
+ * @param {Object} params - The parameters object
+ * @param {Object} params.state - The state object containing isFull
+ * @param {Function} params.emit - Function to emit events
+ * @param {Function} params.nextTick - Vue's nextTick function
+ * @param {Object} params.vm - The Vue instance
+ * @returns {(isFull: boolean) => void} Function to toggle fullscreen state
+ */
 export const toggleFullScreen =
-  ({ state, emit, nextTick, vm }) =>
+  ({ state, emit, nextTick, vm }: IToggleFullScreenParams) =>
   (isFull: boolean): void => {
     state.isFull = isFull
     nextTick(() => {
       emit('resize', { fullscreen: isFull, dialog: vm.$refs.dialog })
     })
   }

Tests needed for fullscreen functionality

Based on the verification results:

  • The dialog box component has a placeholder test for fullscreen functionality (test.todo)
  • There is an existing E2E test (fullscreen.spec.ts) that only verifies basic fullscreen class and body lock
  • The new toggleFullScreen function and its related state changes are not covered by tests

Required test coverage:

  • Unit tests for toggleFullScreen function including state changes and event emission
  • Integration tests for fullscreen toggle interaction with drag functionality
  • Test cases for resize event emission with correct payload
🔗 Analysis chain

Line range hint 293-376: Verify test coverage for fullscreen functionality

The PR objectives indicate that tests haven't been added for these changes. Let's verify the existing test coverage for the dialog box component.


Let me gather more specific information about the dialog box tests.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for existing tests related to dialog box fullscreen functionality

# Look for test files related to dialog box
fd -e spec.ts -e spec.js -e test.ts -e test.js dialog-box

# Search for fullscreen-related test cases
rg -i "fullscreen|isFull" --type ts --type js | grep -i "test\|spec"

Length of output: 5255


Script:

#!/bin/bash
# Check dialog-box test content specifically
cat packages/vue/src/dialog-box/__tests__/dialog-box.test.tsx

# Check the fullscreen demo test
cat examples/sites/demos/pc/app/dialog-box/fullscreen.spec.ts

# Look for dialog box component's fullscreen-related code
rg -A 5 "fullscreen" packages/vue/src/dialog-box/

Length of output: 5776

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

99-106: Reduce code duplication in handleClick function

The code for clearing store and setting current node is duplicated in both conditional branches.

Consider refactoring to reduce duplication:

- state.tree.clearCurrentStore(props.node)
- store.setCurrentNode(props.node)
- !props.node.disabled &&
-   state.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode, e)
- } else if (props.node.isLeaf && !props.node.disabled) {
- state.tree.clearCurrentStore(props.node)
- store.setCurrentNode(props.node)
- state.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode, e)
+ const shouldUpdate = !state.tree.onlyCheckChildren || (props.node.isLeaf && !props.node.disabled);
+ if (shouldUpdate) {
+   state.tree.clearCurrentStore(props.node)
+   store.setCurrentNode(props.node)
+   !props.node.disabled &&
+     state.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode, e)
+ }

Line range hint 391-407: LGTM! Consider adding JSDoc documentation

The computedExpandIcon function is well-structured with proper fallbacks and special case handling. However, it would benefit from documentation explaining the parameters and return value.

Consider adding JSDoc documentation:

/**
 * Computes the expand icon based on tree configuration and design settings
 * @param {Object} designConfig - The design configuration object containing icon definitions
 * @returns {Function} A function that takes treeRoot and state parameters and returns the appropriate icon class
 */

Line range hint 408-412: Improve type safety and robustness of computedIndent function

The current implementation could benefit from better type safety and more robust number handling.

Consider these improvements:

- export const computedIndent =
-   () =>
-   ({ node, showLine }, { tree }) => {
-     return (node.level > 1 ? 1 : 0) * (parseInt(tree.indent) + (showLine ? 8 : 0)) + parseInt(tree.baseIndent) + 'px'
-   }
+ export const computedIndent =
+   () =>
+   ({ node, showLine }: { node: { level: number }, showLine: boolean }, { tree }: { tree: { indent: string | number, baseIndent: string | number } }) => {
+     const levelMultiplier = node.level > 1 ? 1 : 0;
+     const treeIndent = parseInt(String(tree.indent), 10) || 0;
+     const baseIndent = parseInt(String(tree.baseIndent), 10) || 0;
+     const lineSpacing = showLine ? 8 : 0;
+     
+     return `${levelMultiplier * (treeIndent + lineSpacing) + baseIndent}px`;
+   }

Key improvements:

  1. Added TypeScript type annotations
  2. Added radix parameter to parseInt
  3. Added fallback values for parsing errors
  4. Split complex calculation for better readability
  5. Properly handled string conversion
packages/vue/src/date-panel/src/pc.vue (1)

Line range hint 1-1: Add tests to verify the bugfix

According to the PR objectives, this is a bugfix PR. However, no tests have been added to verify the fix. Please consider adding tests to:

  1. Verify the footer's visibility behavior
  2. Ensure the fix doesn't introduce regressions
  3. Document the expected behavior for future reference

Would you like me to help generate test cases for this bugfix? I can provide examples using Vue Test Utils to verify the footer's visibility behavior.

packages/renderless/src/date-picker-mobile/index.ts (1)

403-409: Consider adding error handling for the action sheet ref

While the formatting changes look good, consider adding a null check for the action sheet ref to prevent potential runtime errors if the ref is not available.

 export const close =
   ({ emit, vm }) =>
   () => {
-    vm.$refs.actionSheet.close()
+    if (vm.$refs.actionSheet) {
+      vm.$refs.actionSheet.close()
+    }

     emit('close')
   }
packages/renderless/src/file-upload/vue.ts (2)

369-369: Consider consistent event naming convention

The event name uses kebab-case ('drag-over') while the state property uses camelCase ('dragOver'). Consider using consistent naming across the codebase.

-    vm.$off('drag-over')
+    vm.$off('dragOver')

369-369: Document drag-and-drop functionality

The presence of drag-related state and events suggests drag-and-drop functionality. Consider adding documentation to explain this feature.

Add JSDoc comments above the relevant code sections to document:

  • The purpose of the drag-and-drop functionality
  • The events being used
  • The state properties involved
packages/vue/src/grid/src/grid/grid.ts (1)

152-157: Document the purpose of new pagination properties and consider refactoring

The new properties tablePageLoading and realTimeTablePage appear to duplicate existing pagination state (tablePage). Consider:

  1. Adding JSDoc comments to explain their specific purpose and usage
  2. Evaluating if this state could be consolidated to avoid potential sync issues
+ /** Flag indicating if table page is currently loading */
 tablePageLoading: false,
+ /** 
+  * Real-time pagination state used during loading
+  * @see tablePage for the stable pagination state
+  */
 realTimeTablePage: {
   total: 0,
   pageSize: 10,
   currentPage: 1
 },
packages/vue/src/huicharts/huicharts-core/src/chart-core.ts (3)

246-250: Use optional chaining for safer property access

The nested property access could be safer using optional chaining.

- this.integrateChart && this.integrateChart.echartsIns && this.integrateChart.echartsIns.resize()
+ this.integrateChart?.echartsIns?.resize()

356-356: Extract hardcoded theme value to a constant

The theme value 'bpit-light' is hardcoded in multiple places. Consider extracting it to a constant or using the imported DEFAULT_THEME.

+ const DEFAULT_HUI_THEME = 'bpit-light'
// In refreshChart and renderChart methods
- huiChartOption.theme = 'bpit-light'
+ huiChartOption.theme = DEFAULT_HUI_THEME

Also applies to: 392-392


Line range hint 565-575: Consider refactoring the initialization logic

The initialization logic in the mounted hook could be simplified for better readability and maintainability.

+ initializeChart(data) {
+   if (Object.keys(this.options).length > 0) {
+     this.huiChartOption = cloneDeep(this.options)
+     return
+   }
+   this.updateChart(data)
+ }

mounted() {
  this.$nextTick(() => {
    this.addEvents(this.events)
    this.loading && this.integrateChart.showLoading()
    this.dataEmpty && this.integrateChart.showEmpty()
  })
  
  this.initOpts = {
    ...this.initOptions,
    domResize: this.judgeWidth,
    resizeThrottle: this.widthChangeDelay
  }
  
  let data = this.beforeConfigFn(this.data)
-  if (Object.keys(this.options).length === 0) {
-    this.updateChart(data)
-  } else {
-    this.huiChartOption = cloneDeep(this.options)
-  }
+  this.initializeChart(data)
  
  let { huiChartOption } = this
  huiChartOption = this.afterConfigFn(huiChartOption)
  this.renderChart(huiChartOption)
  
  this.afterSetOption?.call(null, this.integrateChart.echartsIns)
  this.afterSetOptionOnce?.call(null, this.integrateChart.echartsIns)
}
packages/renderless/src/input/index.ts (1)

Line range hint 286-292: Tests needed for display-only textarea behavior.

Since this is a bugfix that modifies component behavior, please add tests to verify:

  1. Textarea resizing is disabled in display-only mode
  2. Minimum height is still correctly calculated
  3. Regular textarea resizing still works when not in display-only mode

Would you like me to help generate test cases for these scenarios?

packages/renderless/src/recycle-scroller/index.ts (1)

126-141: Consider using array methods for better readability

The loop logic could be simplified using array methods like reduce and Math.min.

-      let computedMinItemSize = 10000
-      let accumulator = 0
-      let current
-
-      for (let i = 0, len = items.length; i < len; i++) {
-        current = items[i][field] || minItemSize
-
-        if (current < computedMinItemSize) {
-          computedMinItemSize = current
-        }
-
-        accumulator += current
-        sizes[i] = { accumulator, size: current }
-      }
+      const computedMinItemSize = Math.min(...items.map(item => item[field] || minItemSize))
+      const { sizes: computedSizes } = items.reduce(
+        (acc, item, i) => {
+          const size = item[field] || minItemSize
+          const accumulator = acc.total + size
+          acc.sizes[i] = { accumulator, size }
+          acc.total = accumulator
+          return acc
+        },
+        { sizes, total: 0 }
+      )
packages/vue-locale/src/lang/en.ts (2)

203-232: Improve clarity of rich text editor actions.

The translations use technical terms that might not be clear to all users.

Consider these improvements:

  • "Coding" → "Code"
  • "Reference" → "Quote"
  • "Past Link" → "Paste Link"
  • "Multi-level Lists" → "Nested Lists"

282-321: Improve file upload error messages.

The file upload messages could be more specific and actionable.

Consider these improvements:

  • Add specific file size limits in the messages
  • Add guidance on how to resolve the issues
  • Add examples of supported file formats
packages/theme-saas/src/grid/table.less (1)

647-649: Consider browser compatibility for the :has() selector

While the style rule logically improves the layout behavior for header columns containing only a span element, the :has() selector has limited browser support (not supported in Firefox < 121).

Consider adding a fallback solution for better browser compatibility:

 &:has(> span:only-child) {
   @apply block;
 }
+/* Fallback for browsers that don't support :has() */
+&.header-cell--single-span {
+  @apply block;
+}

You'll need to add the header-cell--single-span class via JavaScript for browsers that don't support :has().

packages/vue/src/grid/src/body/src/body.tsx (2)

Line range hint 141-171: Consider splitting buildColumnChildren into smaller, focused functions

The function handles multiple concerns including validation, cell content building, and drag-and-drop UI. Consider breaking it down into smaller, single-responsibility functions for better maintainability.

Example refactor:

-function buildColumnChildren(args) {
+function buildValidationNode(args) {
   let { h, hasDefaultTip, validError, validStore, validOpts } = args
+  if (!hasDefaultTip) return null
+  if (!validError) return null
+  return h(
+    'div',
+    {
+      class: 'tiny-grid-cell__valid',
+      style: validStore.rule && validStore.rule.width ? { width: `${validStore.rule.width}px` } : null
+    },
+    [
+      validOpts?.icon ? h(validOpts.icon, { class: 'tiny-grid-cell__valid-icon' }) : null,
+      h('span', { class: 'tiny-grid-cell__valid-msg', attrs: { title: validStore.content } }, validStore.content)
+    ]
+  )
+}
+
+function buildDragHandle(h, dropConfig, column) {
+  return dropConfig.rowHandle === 'index' && column.type === 'index' 
+    ? h('div', { class: 'row__drop-handle' }) 
+    : null
+}
+
+function buildCellContent(args) {
   let { h, showTitle, showTooltip, showTip, showEllipsis, row, column, params, $table } = args
+  return h(
+    'div',
+    {
+      class: [
+        'tiny-grid-cell',
+        {
+          'tiny-grid-cell__title': showTitle,
+          'tiny-grid-cell__tooltip': showTooltip || showTip,
+          'tiny-grid-cell__ellipsis': showEllipsis
+        }
+      ],
+      attrs: { title: showTitle ? getCellLabel(row, column, params) : null }
+    },
+    $table.isShapeTable ? column.renderCell(h, params) : null
+  )
+}
+
+function buildColumnChildren(args) {
+  const validNode = buildValidationNode(args)
+  const dragHandle = buildDragHandle(args.h, args.dropConfig || {}, args.column)
+  const cellContent = buildCellContent(args)
+  
+  return [dragHandle, cellContent, validNode]
+}

Line range hint 1-1000: Consider modernizing the codebase and improving error handling

  1. The codebase mixes Vue 2 and Vue 3 patterns. Consider standardizing on Vue 3 Composition API for better maintainability and type safety.

  2. The scroll handling logic could benefit from:

    • Debouncing scroll events
    • Better error handling for edge cases
    • Clearer separation of scroll-related concerns
  3. Consider extracting the virtual scrolling logic into a separate composable for reusability.

packages/vue/src/grid/src/table/src/table.ts (4)

Line range hint 1066-1071: Prevent potential memory leak from setTimeout.

The setTimeout callback isn't cleaned up when the component is unmounted, which could cause memory leaks in scenarios with frequent mounting/unmounting.

  mounted() {
    if (this.$refs.tableWrapper) {
      document.body.appendChild(this.$refs.tableWrapper)
    }

    this.$nextTick().then(() => {
      this.afterMounted = true

      if (this.autoResize && TINYGrid._resize) {
        this.bindResize()
      }
    })

-   setTimeout(() => {
-     const tableFooter = this.$refs.tableFooter
-     this.showFooterBorder = !!tableFooter
-     this.footerBorderBottom = tableFooter ? tableFooter.$el.getBoundingClientRect().height : 0
-   })
+   this.footerTimeout = setTimeout(() => {
+     const tableFooter = this.$refs.tableFooter
+     this.showFooterBorder = !!tableFooter
+     this.footerBorderBottom = tableFooter ? tableFooter.$el.getBoundingClientRect().height : 0
+   })
  },
+  beforeUnmount() {
+    if (this.footerTimeout) {
+      clearTimeout(this.footerTimeout)
+    }
+  }

Line range hint 947-953: Fix event unbinding phase mismatch.

The unbindEvent function doesn't specify the capture phase when unbinding the second mousedown event, which could lead to memory leaks.

  const unbindEvent = (table) => {
    GlobalEvent.off(table, 'mousedown')
-   GlobalEvent.off(table, 'mousedown', true)
+   GlobalEvent.off(table, 'mousedown', table.handleGlobalMousedownCaptureEvent, true)
    GlobalEvent.off(table, 'blur')
    GlobalEvent.off(table, 'mousewheel')
    GlobalEvent.off(table, 'keydown')
    GlobalEvent.off(table, 'resize')
    GlobalEvent.off(table, 'contextmenu')
  }

Line range hint 1072-1075: Optimize column watching to prevent double initialization.

The comment indicates that watchColumn is called twice during initialization for tag usage, causing performance issues. Consider optimizing this:

  watch: {
    collectColumn(value) {
-     // 这里在表格初始化的时候会触发两次(标签式),造成性能损失,待整改
-     this.watchColumn(value)
+     if (!this.isInitializing) {
+       this.watchColumn(value)
+     }
    },
    // ... other watchers
  },
  created() {
+   this.isInitializing = true
    // ... other initialization code
+   this.$nextTick(() => {
+     this.isInitializing = false
+     this.watchColumn(this.collectColumn)
+   })
  }

Line range hint 1066-1068: Consider using Vue's teleport for DOM manipulation.

Directly manipulating document.body can cause issues with SSR and portals. Consider using Vue's teleport component:

-   if (this.$refs.tableWrapper) {
-     document.body.appendChild(this.$refs.tableWrapper)
-   }
+   // In template:
+   <teleport to="body">
+     <div ref="tableWrapper" v-if="$refs.tableWrapper">
+       <!-- wrapper content -->
+     </div>
+   </teleport>
packages/vue/src/grid/src/table/src/methods.ts (1)

28-28: Consider extending explicit null checks throughout the codebase.

The introduction of explicit null checks using isNull is a good improvement. Consider extending this pattern to other similar checks in the codebase for consistency and improved type safety.

Here's a script to find other potential locations where this pattern could be applied:

#!/bin/bash
# Description: Find potential locations where explicit null checks could be used
# Look for direct null comparisons or falsy checks that might benefit from isNull

rg -n "(?:===?\s*null|[^!]==\s*(?:''|\"\"|\`\`)|(?:if\s*\()(!|\s*)[a-zA-Z_][a-zA-Z0-9_]*\s*\))" --type ts

Also applies to: 382-383, 499-501

packages/renderless/src/year-table/index.ts (3)

Line range hint 120-120: Logical Error: selectedDate is empty when checking for selected years

In the getRows function, selectedDate is initialized as an empty array (line 120), but later it's used in arrayFind to determine if a year is selected (lines 149-152). Since selectedDate is empty, cell.selected will always be undefined or false. It seems selectedDate should be populated with the selected dates from props.value.

Apply this diff to fix the issue:

- const selectedDate = []
+ const selectedDate = coerceTruthyValueToArray(props.value)

Also applies to: 149-152


Line range hint 140-140: Consistency: Use destructured selectionMode variable

Since selectionMode is already destructured from props, you can use it directly instead of props.selectionMode for consistency.

Apply this diff:

- if (props.selectionMode.startsWith('year')) {
+ if (selectionMode.startsWith('year')) {

Line range hint 141-142: Refactor: Use getIsDisabled function to determine cell.disabled

To promote code reuse and maintain consistency, consider using the getIsDisabled helper function instead of duplicating the logic here.

Apply this diff to refactor the code:

- cell.disabled = typeof disabledDate === 'function' && disabledDate(year)
+ cell.disabled = getIsDisabled({ props })(year)

Note: Ensure that getIsDisabled is accessible in this scope or import it accordingly.

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

66-66: Consider Adding Unit Tests for onMouseenterSelf

To ensure robust functionality, especially with device-specific logic involving isIOS, consider adding unit tests for onMouseenterSelf.

Also applies to: 170-170, 377-377

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

1327-1331: Use consistent language for code comments

The comment // 还原AUI的做法 is in Chinese. For consistency and better collaboration among the development team, please translate comments to English.

Apply this diff to update the comment:

-// 还原AUI的做法
+// Restore AUI's original implementation
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 10c65c8 and 36849e6.

📒 Files selected for processing (82)
  • examples/sites/demos/pc/app/date-picker/disabled-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/date-picker/disabled.vue (2 hunks)
  • examples/sites/demos/pc/app/select/optimization-composition-api.vue (2 hunks)
  • examples/sites/demos/pc/app/select/optimization.vue (2 hunks)
  • internals/cli/src/commands/release/releaseAurora.ts (1 hunks)
  • packages/design/aurora/src/popeditor/index.ts (1 hunks)
  • packages/design/aurora/src/select/index.ts (1 hunks)
  • packages/design/saas/src/popeditor/index.ts (1 hunks)
  • packages/design/saas/src/select/index.ts (1 hunks)
  • packages/renderless/package.json (1 hunks)
  • packages/renderless/src/common/deps/useUserAgent.ts (1 hunks)
  • packages/renderless/src/common/event.ts (2 hunks)
  • packages/renderless/src/date-picker-mobile/index.ts (4 hunks)
  • packages/renderless/src/dialog-box/index.ts (1 hunks)
  • packages/renderless/src/dropdown/index.ts (2 hunks)
  • packages/renderless/src/dropdown/vue.ts (1 hunks)
  • packages/renderless/src/file-upload/vue.ts (1 hunks)
  • packages/renderless/src/form-item/index.ts (2 hunks)
  • packages/renderless/src/input/index.ts (1 hunks)
  • packages/renderless/src/menu/vue.ts (2 hunks)
  • packages/renderless/src/recycle-scroller/index.ts (6 hunks)
  • packages/renderless/src/recycle-scroller/vue.ts (3 hunks)
  • packages/renderless/src/rich-text/index.ts (3 hunks)
  • packages/renderless/src/rich-text/vue.ts (3 hunks)
  • packages/renderless/src/select-dropdown/vue.ts (1 hunks)
  • packages/renderless/src/select/index.ts (16 hunks)
  • packages/renderless/src/select/vue.ts (6 hunks)
  • packages/renderless/src/tabbar/index.ts (1 hunks)
  • packages/renderless/src/tabbar/vue.ts (1 hunks)
  • packages/renderless/src/tabs/index.ts (1 hunks)
  • packages/renderless/src/tabs/vue.ts (2 hunks)
  • packages/renderless/src/tooltip/vue.ts (1 hunks)
  • packages/renderless/src/transfer/index.ts (2 hunks)
  • packages/renderless/src/tree-menu/index.ts (2 hunks)
  • packages/renderless/src/tree-node/index.ts (1 hunks)
  • packages/renderless/src/user-head/index.ts (1 hunks)
  • packages/renderless/src/year-table/index.ts (2 hunks)
  • packages/renderless/src/year-table/vue.ts (1 hunks)
  • packages/theme-saas/src/form/index.less (1 hunks)
  • packages/theme-saas/src/grid/table.less (1 hunks)
  • packages/theme-saas/src/input/index.less (0 hunks)
  • packages/theme-saas/src/rich-text/index.less (1 hunks)
  • packages/theme-saas/src/row/index.less (1 hunks)
  • packages/theme-saas/src/select-dropdown/index.less (1 hunks)
  • packages/theme-saas/src/select/index.less (1 hunks)
  • packages/theme-saas/src/textarea/index.less (6 hunks)
  • packages/theme-saas/src/tooltip/index.less (1 hunks)
  • packages/theme/src/dept/vars.less (1 hunks)
  • packages/theme/src/grid/table.less (1 hunks)
  • packages/theme/src/transfer/index.less (0 hunks)
  • packages/vue-locale/src/lang/en.ts (9 hunks)
  • packages/vue-locale/src/lang/zh-CN.ts (2 hunks)
  • packages/vue/src/date-panel/src/pc.vue (1 hunks)
  • packages/vue/src/grid/src/body/src/body.tsx (1 hunks)
  • packages/vue/src/grid/src/dragger/src/methods.ts (2 hunks)
  • packages/vue/src/grid/src/dragger/src/rowDrop.ts (2 hunks)
  • packages/vue/src/grid/src/grid/grid.ts (2 hunks)
  • packages/vue/src/grid/src/pager/src/methods.ts (2 hunks)
  • packages/vue/src/grid/src/table/src/methods.ts (3 hunks)
  • packages/vue/src/grid/src/table/src/table.ts (2 hunks)
  • packages/vue/src/grid/src/tooltip/src/methods.ts (1 hunks)
  • packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts (1 hunks)
  • packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue (2 hunks)
  • packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue (2 hunks)
  • packages/vue/src/huicharts/huicharts-boxplot/src/chart-boxplot.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-candle/src/chart-candle.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-core/common/extend.ts (2 hunks)
  • packages/vue/src/huicharts/huicharts-core/src/chart-core.ts (10 hunks)
  • packages/vue/src/huicharts/huicharts-funnel/src/chart-funnel.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-gauge/src/chart-gauge.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-graph/src/chart-graph.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-heatmap/src/chart-heatmap.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-line/src/chart-line.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-liquidfill/src/chart-liquidfill.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-map/src/chart-map.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-process/src/chart-process.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-radar/src/chart-radar.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-ring/src/chart-ring.vue (1 hunks)
  • packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue (1 hunks)
⛔ Files not processed due to max files limit (27)
  • packages/vue/src/huicharts/huicharts-scatter/src/chart-scatter.vue
  • packages/vue/src/huicharts/huicharts-sunburst/src/chart-sunburst.vue
  • packages/vue/src/huicharts/huicharts-tree/src/chart-tree.vue
  • packages/vue/src/huicharts/huicharts-waterfall/src/chart-waterfall.vue
  • packages/vue/src/huicharts/huicharts-wordcloud/src/chart-wordcloud.vue
  • packages/vue/src/input/src/mobile-first.vue
  • packages/vue/src/input/src/pc.vue
  • packages/vue/src/numeric/src/mobile-first.vue
  • packages/vue/src/query-builder/src/components/InlineCombinator.vue
  • packages/vue/src/query-builder/src/components/QueryBuilder.vue
  • packages/vue/src/query-builder/src/components/RuleComponents.vue
  • packages/vue/src/query-builder/src/components/input.vue
  • packages/vue/src/query-builder/src/hooks/useQueryBuilder.ts
  • packages/vue/src/query-builder/src/hooks/useRule.ts
  • packages/vue/src/query-builder/src/pc.vue
  • packages/vue/src/query-builder/src/ts/propsUsingFrame.ts
  • packages/vue/src/select-dropdown/src/mobile-first.vue
  • packages/vue/src/select/src/index.ts
  • packages/vue/src/select/src/mobile-first.vue
  • packages/vue/src/select/src/pc.vue
  • packages/vue/src/tabs/src/mobile-first/tab-bar.vue
  • packages/vue/src/tabs/src/mobile-first/tab-nav.vue
  • packages/vue/src/tabs/src/tab-nav/pc.vue
  • packages/vue/src/tabs/src/tab-nav/tab-dropdown-item.vue
  • packages/vue/src/upload/src/index.ts
  • packages/vue/src/year-table/src/mobile-first.vue
  • packages/vue/src/year-table/src/pc.vue
💤 Files with no reviewable changes (2)
  • packages/theme-saas/src/input/index.less
  • packages/theme/src/transfer/index.less
✅ Files skipped from review due to trivial changes (2)
  • packages/renderless/package.json
  • packages/theme/src/grid/table.less
🧰 Additional context used
🪛 Biome
packages/renderless/src/common/deps/useUserAgent.ts

[error] 6-7: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/renderless/src/recycle-scroller/index.ts

[error] 442-442: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

packages/renderless/src/select-dropdown/vue.ts

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/renderless/src/tabs/index.ts

[error] 136-138: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/renderless/src/tree-menu/index.ts

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/grid/src/grid/grid.ts

[error] 184-185: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/huicharts/huicharts-core/src/chart-core.ts

[error] 248-252: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (115)
packages/design/aurora/src/popeditor/index.ts (1)

6-7: Please clarify the behavioral change and add tests

The change from 'auto' to empty string ('') for treeWrapperMaxHeight could affect the component's layout behavior. While both values might result in content-based sizing, they can behave differently in certain scenarios.

  1. Could you explain why empty string is preferred over 'auto' in this context?
  2. Please add tests to verify this behavior change works as expected.
  3. Consider updating the component's documentation to reflect this change.

Let's check for other usages of this property:

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

6-8: Verify the impact of this change on tree wrapper rendering

Since this changes how the tree wrapper's max height is handled, we should verify there are no unintended side effects.

✅ Verification successful

Setting treeWrapperMaxHeight to empty string is safe but may affect layout

The search results show that treeWrapperMaxHeight is used in two key ways:

  1. In the renderless package (packages/renderless/src/popeditor/index.ts), it's dynamically calculated based on dialog box dimensions
  2. In the Vue template (packages/vue/src/popeditor/src/pc.vue), it's bound to the tree wrapper div's maxHeight style

Setting it to an empty string in the saas theme (as well as aurora theme) effectively removes the height constraint, which is an intentional design choice for these themes. This won't break functionality since:

  • The base state initializes it as 'auto' by default
  • The empty string is a valid CSS value that removes the maxHeight constraint
  • Both saas and aurora themes implement this same behavior consistently
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other usages of treeWrapperMaxHeight to ensure this change doesn't break existing functionality
rg -l "treeWrapperMaxHeight" --type ts --type vue

# Look for related height calculations in the codebase
ast-grep --pattern 'computed$_Height() { $$$ }'

Length of output: 127


Script:

#!/bin/bash
# Search for treeWrapperMaxHeight without file type restrictions
rg "treeWrapperMaxHeight" -A 3 -B 3

# Look for computed properties related to height with different pattern
ast-grep --pattern 'computed: {
  $$$
  $_Height() {
    $$$
  }
  $$$
}'

# Search for tree wrapper related styles or classes
rg "tree-wrapper" -A 2 -B 2

Length of output: 10081

packages/vue/src/huicharts/huicharts-process/src/chart-process.vue (1)

23-23: Verify property initialization and usage across the component lifecycle.

While the rename from option to huiChartOption aligns with the broader refactoring across chart components, we should ensure proper initialization and reactivity.

Let's verify the property definitions and usage:

✅ Verification successful

Property initialization and usage is consistent across chart components

The verification shows that:

  • The huiChartOption property is properly initialized in the core mixin (chart-core.ts) with a default empty object
  • The property is consistently used across all chart components in the huicharts directory
  • The core mixin handles proper lifecycle management:
    • Initialization in the created hook
    • Cloning from options during updates
    • Proper rendering and event emission
  • The spread operator usage in chart-process.vue follows the same pattern used in other components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for huiChartOption property definition and usage across chart components
# Expected: Consistent usage of huiChartOption in related components and proper property definitions

# Check for huiChartOption usage in chart components
echo "Checking huiChartOption usage in chart components..."
rg -l "huiChartOption" packages/vue/src/huicharts/

# Check for property definitions in the core mixin
echo "Checking core mixin for property definitions..."
rg "huiChartOption" packages/vue/src/huicharts/huicharts-core/

Length of output: 7591

packages/renderless/src/common/deps/useUserAgent.ts (2)

1-4: LGTM! Good use of early return pattern.

The code properly handles server-side rendering scenarios by importing the necessary check and implementing an early return pattern.


15-18: Verify the hook's usage in select components.

The AI summary indicates this hook is used in select components. Let's verify its integration.

✅ Verification successful

Let me gather more context about how the isIOS flag is used in the select component.


Let me check how the isIOS flag is actually used in the select component's logic.


Hook implementation and usage verified successfully

The useUserAgent hook is properly integrated in the select component with clear iOS-specific behavior handling:

  • Used for hover state management in mouse events
  • Controls readonly state for filterable selects
  • Provides iOS-specific UX optimizations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for useUserAgent usage in the codebase
echo "Searching for useUserAgent usage..."
rg -l "useUserAgent" --type ts

# Check specific usage in select components
echo "Checking select component implementation..."
rg -A 5 "useUserAgent" "packages/renderless/src/select"

Length of output: 1060


Script:

#!/bin/bash
# Check how isIOS is used in the select component
echo "Checking isIOS usage in select component..."
rg -B 5 -A 10 "isIOS" "packages/renderless/src/select/vue.ts"

# Check if there are any other components using isIOS
echo "Checking isIOS usage in other components..."
rg -l "isIOS" --type ts

Length of output: 1122


Script:

#!/bin/bash
# Search for references to state.isIOS in the select component
echo "Checking state.isIOS usage in select implementation..."
rg -B 5 -A 10 "state\.isIOS" "packages/renderless/src/select"

# Check the select/index.ts file for any iOS-specific logic
echo "Checking select/index.ts for iOS-specific logic..."
rg -B 5 -A 10 "isIOS" "packages/renderless/src/select/index.ts"

Length of output: 5703

packages/vue/src/huicharts/huicharts-gauge/src/chart-gauge.vue (1)

30-30: Property rename looks good, but verify Core mixin compatibility.

The rename from option to huiChartOption aligns with the standardization across chart components. However, we should ensure this change is compatible with the Core mixin.

Let's verify the property usage in the Core mixin and other related files:

✅ Verification successful

Based on the shell script results, I can now make a definitive assessment. The Core mixin (chart-core.ts) fully supports and expects the huiChartOption property, as evidenced by:

  1. It's declared in the component's data: huiChartOption: {}
  2. It's used extensively throughout the Core mixin for chart rendering and updates
  3. The property is used in key methods like renderChart(), updateChart(), and various watchers

Property rename is correct and aligned with the codebase.

The change from option to huiChartOption in the gauge chart component is consistent with the Core mixin's implementation, which already uses huiChartOption as the standard property name.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old property name and verify Core mixin compatibility

# Check for any remaining 'option' references in chart components
echo "Checking for 'option' references in chart components..."
rg -l "this\.option" "packages/vue/src/huicharts"

# Check Core mixin implementation
echo "Checking Core mixin implementation..."
rg -A 5 "option|huiChartOption" "packages/vue/src/huicharts/huicharts-core"

Length of output: 33176

packages/vue/src/huicharts/huicharts-amap/src/AMapModel.ts (1)

22-23: Verify consistent usage of huiChartOption across the codebase

The property renaming from option to huiChartOption looks correct, but we should ensure this change is consistently applied across all chart components.

✅ Verification successful

Property renaming is consistent and working as intended

The code shows a clear pattern where this.options (not this.option) is used as the source data that gets cloned into this.huiChartOption. This is intentional behavior where:

  • this.options serves as the input property
  • this.huiChartOption is used as the working copy for chart rendering

The changes in AMapModel.ts align with this pattern, making the codebase consistent in its usage of huiChartOption for chart rendering operations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to 'option' in chart components
# and verify consistent usage of 'huiChartOption'

echo "Checking for remaining 'option' references in chart components..."
rg -l "this\.option" "packages/vue/src/huicharts" --type ts

echo "Verifying 'huiChartOption' usage in chart components..."
rg -l "this\.huiChartOption" "packages/vue/src/huicharts" --type ts

Length of output: 580


Script:

#!/bin/bash
# Let's examine the actual usage context in chart-core.ts to understand if both properties coexist
rg "this\.option" packages/vue/src/huicharts/huicharts-core/src/chart-core.ts -B 2 -A 2

echo "\nChecking huiChartOption usage in the same file:"
rg "this\.huiChartOption" packages/vue/src/huicharts/huicharts-core/src/chart-core.ts -B 2 -A 2

Length of output: 1867

packages/vue/src/huicharts/huicharts-pie/src/chart-pie.vue (1)

32-32: LGTM! Verify consistency across the codebase.

The property rename from option to huiChartOption looks good and aligns with the broader refactoring effort.

Let's verify the consistency of this change across the codebase:

✅ Verification successful

Property rename needs attention: this.options is still in use

The verification revealed inconsistency in property naming across the codebase:

  • Several components still use this.options alongside this.huiChartOption:
    • huicharts-process/src/chart-process.vue
    • huicharts-core/src/chart-core.ts
    • huicharts-bmap/src/baidu-map.vue
    • huicharts-amap/src/autonavi-map.vue

The core component (chart-core.ts) appears to use both properties, suggesting this might be intentional. Let's verify the relationship between these properties:


Property rename is part of a larger pattern: options vs huiChartOption

The analysis reveals that options and huiChartOption serve different purposes in the chart system:

  • options is a prop that accepts external chart configuration
  • huiChartOption is internal state used to process and render the chart
  • The core component explicitly handles the relationship between them:
    if (Object.keys(this.options).length === 0) {
      this.updateChart(data)
    } else {
      this.huiChartOption = cloneDeep(this.options)
    }

Let's verify if this pattern is consistently applied across chart components:


Property rename is correct and consistent with the architecture

The analysis reveals that the property rename from option to huiChartOption is intentional and aligns with the chart system's architecture:

  1. options is a prop in chart-core.ts that accepts external configuration
  2. huiChartOption is internal state used to process chart options before rendering
  3. The relationship is well-defined in the core component:
    if (Object.keys(this.options).length === 0) {
      this.updateChart(data)
    } else {
      this.huiChartOption = cloneDeep(this.options)
    }

The change in chart-pie.vue correctly uses huiChartOption as it's the internal state property that should be used for rendering. The presence of both properties is by design, not an inconsistency.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of the old property name
# and confirm consistent usage of the new property name in chart components

# Check for any remaining 'this.option' in chart components
echo "Checking for remaining 'this.option' usage in chart components:"
rg "this\.option" "packages/vue/src/huicharts"

# Verify consistent usage of 'this.huiChartOption' in chart components
echo -e "\nVerifying consistent usage of 'this.huiChartOption':"
rg "this\.huiChartOption" "packages/vue/src/huicharts"

Length of output: 6270


Script:

#!/bin/bash
# Check the property declarations and their relationships
ast-grep --pattern 'export default {
  $$$
  data() {
    return {
      $$$
      options: $_,
      $$$
    }
  }
  $$$
}'

# Check for any props declarations
ast-grep --pattern 'export default {
  $$$
  props: {
    $$$
    options: $_,
    $$$
  }
  $$$
}'

Length of output: 57202


Script:

#!/bin/bash
# Check for updateChart method implementations
ast-grep --pattern 'updateChart($_) {
  $$$
}'

# Check for options prop declarations
ast-grep --pattern 'export default {
  $$$
  props: {
    $$$
    options: $_,
    $$$
  }
  $$$
}'

Length of output: 57124

packages/vue/src/huicharts/huicharts-ring/src/chart-ring.vue (1)

31-31: Property renaming looks good but verify references.

The renaming from option to huiChartOption aligns with the standardization across Huicharts components and improves clarity.

Let's verify if there are any direct references to this property that need updating:

✅ Verification successful

Based on the comprehensive search results, I can now generate the final response:

Property renaming is part of a consistent pattern across components

The renaming from option to huiChartOption is part of a standardized pattern used across all chart components in the codebase. The search results show that:

  • The property is defined in the core component (chart-core.ts)
  • All chart components consistently use huiChartOption for their chart configurations
  • The change aligns with the existing codebase conventions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any references to 'option' in related chart components
rg -l "option" packages/vue/src/huicharts/

Length of output: 2095


Script:

#!/bin/bash
# Let's check the actual usage of 'option' in these files to understand the context
# First, let's look at the core files as they might define the base behavior
rg "option" packages/vue/src/huicharts/huicharts-core/ -A 2 -B 2

# Then, let's specifically look at other chart components to see if they follow similar patterns
rg "huiChartOption" packages/vue/src/huicharts/ -A 2 -B 2

Length of output: 45657

packages/vue/src/huicharts/huicharts-sankey/src/chart-sankey.vue (1)

31-33: Verify the property rename consistency with Core mixin

The change from option to huiChartOption appears to be part of a broader renaming effort. While the change itself is straightforward, we should ensure it aligns with the Core mixin implementation.

Let's verify the property usage in related files:

✅ Verification successful

Let me try a different search strategy to locate the files first and then check their contents.


Based on the search results, I can now provide a definitive response:

Property rename from option to huiChartOption is consistent with codebase

The change is verified to be correct as:

  1. The property huiChartOption is widely used across all chart components in the codebase, including the core chart implementation in packages/vue/src/huicharts/huicharts-core/src/chart-core.ts

  2. The old this.option property is not used in any of the chart components - the only usage found is in an unrelated component grid-toolbar/custom-switch.vue

  3. The change aligns with the standard naming pattern seen in the chart components, where all chart-related components use huiChartOption consistently

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the Core mixin and other chart components use the new property name

# Check Core mixin implementation
echo "Checking Core mixin for property usage:"
rg -A 3 "huiChartOption" "packages/vue/src/huicharts/**/core.js" || echo "Property not found in Core"

# Check other chart components
echo "\nChecking other chart components for consistent property usage:"
rg -A 3 "huiChartOption" "packages/vue/src/huicharts/**/*.vue" || echo "Property not found in other components"

# Check for any remaining uses of the old property name
echo "\nChecking for remaining uses of old property name:"
rg -A 3 "this\.option\s*=" "packages/vue/src/huicharts/**/*.vue" || echo "Old property usage not found"

Length of output: 982


Script:

#!/bin/bash
# First, let's find the actual paths
echo "Finding vue files:"
fd -e vue

echo "\nFinding js files that might contain core mixins:"
fd -e js

# Once we have the paths, let's check for property usage
echo "\nChecking for huiChartOption usage:"
rg -A 3 "huiChartOption"

echo "\nChecking for old option property usage:"
rg -A 3 "this\.option\s*="

Length of output: 355397

packages/vue/src/huicharts/huicharts-candle/src/chart-candle.vue (2)

Line range hint 1-38: Implementation looks good!

The component is well-structured and follows Vue.js best practices:

  • Clean separation of concerns with template and script
  • Proper use of mixins for shared functionality
  • Flexible implementation with slots
  • Abstracted chart logic in a separate module

30-30: Verify the property renaming across the codebase

The renaming from option to huiChartOption appears to be part of a standardization effort. Let's verify the implementation and usage.

Consider adding a comment in the code documenting this property renaming for better maintainability, especially since it's part of a larger standardization effort.

✅ Verification successful

Based on the search results, I can make a determination:

Property renaming from option to huiChartOption appears to be valid and consistent

The search results show:

  1. huiChartOption is extensively used across all chart components in the huicharts module
  2. It is defined in the core mixin (huicharts-core/src/chart-core.ts) as a default property: huiChartOption: {}
  3. The old option property has very limited usage (only found in grid-toolbar/src/custom-switch.vue) and is unrelated to the chart components
  4. The change is part of a consistent pattern where all chart components use huiChartOption for their chart configuration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the property renaming implementation and usage

# Check if huiChartOption is defined in the Core mixin
echo "Checking Core mixin for huiChartOption definition..."
rg -l "huiChartOption" "packages/vue/src/huicharts/**/core.{js,ts,vue}"

# Check for any remaining uses of the old 'option' property in chart components
echo "Checking for any remaining uses of 'option' property..."
rg "this\.option\s*=" "packages/vue/src/huicharts/**/*.{js,ts,vue}"

# Check for all uses of the new property to ensure consistency
echo "Checking usage of new huiChartOption property..."
rg "this\.huiChartOption" "packages/vue/src/huicharts/**/*.{js,ts,vue}"

Length of output: 819


Script:

#!/bin/bash
# Let's try a different approach using fd to find the correct paths first

# Find all Vue, JS, and TS files in the repository
echo "Finding all relevant files..."
fd -e vue -e js -e ts

# Then use these findings to adjust our search patterns
echo -e "\nSearching for huiChartOption usage..."
rg "huiChartOption"

echo -e "\nSearching for option property usage..."
rg "this\.option\s*="

# Let's also check the imports and mixins
echo -e "\nChecking for core mixin imports..."
rg "import.*core" -A 2

Length of output: 529373

packages/vue/src/huicharts/huicharts-liquidfill/src/chart-liquidfill.vue (1)

31-31: Verify the property renaming across the codebase

The renaming from this.option to this.huiChartOption appears to be part of a broader standardization effort. Let's verify this change is consistent with other components and the Core mixin.

✅ Verification successful

Property renaming is consistent across the codebase

The verification shows that:

  1. No instances of this.option remain in the codebase
  2. All chart components consistently use this.huiChartOption
  3. The Core mixin (chart-core.ts) properly defines and handles huiChartOption as the standard property name

The renaming from this.option to this.huiChartOption is complete and consistent across all components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the property renaming across components and check for any remaining instances of the old property name

# Check for any remaining uses of 'this.option' in chart components
echo "Checking for remaining uses of 'this.option'..."
rg "this\.option\s*=" "packages/vue/src/huicharts"

# Check for uses of 'huiChartOption' to confirm consistent adoption
echo "Checking for uses of 'huiChartOption'..."
rg "huiChartOption" "packages/vue/src/huicharts"

# Check the Core mixin for related properties
echo "Checking Core mixin implementation..."
rg "option|huiChartOption" "packages/vue/src/huicharts/huicharts-core"

Length of output: 20599

packages/vue/src/huicharts/huicharts-line/src/chart-line.vue (1)

31-34: Property renaming looks good, but needs documentation update.

The renaming from option to huiChartOption aligns with the standardization across Huicharts components. However, the addition of smooth: true as a default setting needs documentation.

Let's verify the impact of these changes:

Please update the component's documentation to reflect:

  1. The new property name huiChartOption
  2. The default smooth behavior for line charts
✅ Verification successful

Based on the results, I can generate the final response as we have clear evidence that:

  1. No references to the old this.option property exist in the codebase
  2. The new huiChartOption property is consistently used across all chart components
  3. The change aligns with the broader standardization effort

Property renaming is verified and consistent across all components

The renaming from option to huiChartOption has been properly implemented across all chart components in the Huicharts library. The old property name this.option is no longer in use, and the new property name is consistently used in all 24 chart components, including the core component.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any direct references to the old 'option' property
# and verify if other chart components use the new 'huiChartOption' property consistently

# Check for any remaining references to the old property name
echo "Checking for remaining 'option' references in chart components..."
rg -l "this\.option\s*=" "packages/vue/src/huicharts"

# Verify consistent usage of new property name
echo "Verifying consistent usage of 'huiChartOption'..."
rg -l "this\.huiChartOption\s*=" "packages/vue/src/huicharts"

# Look for any documentation files that might need updating
echo "Finding documentation files that might need updating..."
fd -e md -e mdx . "packages/vue/src/huicharts"

Length of output: 2095

packages/theme-saas/src/row/index.less (2)

29-33: LGTM! Fix for unwanted spacing in flex layout

The addition of hidden pseudo-elements for .row-justify-space-around is a common pattern to prevent unwanted spacing issues in flex containers. This change aligns with best practices for flex layout implementations.


29-42: Verify the fix across different browsers

Since this appears to be fixing a layout issue, it would be prudent to verify the behavior across different browsers, particularly older versions that might handle flex layouts differently.

packages/vue/src/huicharts/huicharts-histogram/src/chart-histogram.vue (1)

34-37: Verify the impact of this renaming across components

The AI summary indicates this is part of a broader renaming pattern across multiple chart components. Let's verify this change is consistent with other components.

✅ Verification successful

The renaming pattern is consistent across all chart components

The search results confirm that huiChartOption is consistently used across all chart components in the codebase:

  • All chart components (line, bar, pie, histogram, heatmap, etc.) use huiChartOption as the property name
  • The pattern of spreading an option object into huiChartOption is consistent:
    this.huiChartOption = {
      ...option
    }
  • The core chart component (chart-core.ts) also uses huiChartOption throughout its implementation
  • No mixed usage or inconsistencies were found in the naming pattern

The renaming in the histogram component aligns with the established pattern across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other chart components use huiChartOption consistently

# Search for option and huiChartOption usage in chart components
echo "Checking option usage in chart components:"
rg -l "option: \{\}" "packages/vue/src/huicharts/**/chart-*.vue"

echo -e "\nChecking huiChartOption usage in chart components:"
rg -l "huiChartOption" "packages/vue/src/huicharts/**/chart-*.vue"

# Check for any remaining mixed usage
echo -e "\nChecking for mixed usage of option and huiChartOption:"
rg "option.*=.*{.*}.*huiChartOption" "packages/vue/src/huicharts/**/chart-*.vue"

Length of output: 843


Script:

#!/bin/bash
# Let's try a different approach to find chart components and their option usage

# First, let's find all Vue files in the huicharts directory
echo "Finding Vue files in huicharts directory:"
fd ".*\.vue$" "packages/vue/src/huicharts"

echo -e "\nChecking huiChartOption usage:"
rg "huiChartOption" --type vue -A 2 "packages/vue/src/huicharts"

echo -e "\nChecking option usage:"
rg "option\s*[:=]" --type vue -A 2 "packages/vue/src/huicharts"

Length of output: 1946


Script:

#!/bin/bash
# Let's search without specifying file type

echo "Checking huiChartOption usage:"
rg "huiChartOption" -A 2 packages/vue/src/huicharts

echo -e "\nChecking option assignments:"
rg "option\s*[:=]" -A 2 packages/vue/src/huicharts

# Let's also check specific files to see their option handling
echo -e "\nChecking a few specific chart components:"
for file in packages/vue/src/huicharts/huicharts-{line,bar,pie}/src/chart-*.vue; do
    echo -e "\nFile: $file"
    rg "(option|huiChartOption)" "$file" -A 2
done

Length of output: 28008

packages/theme/src/dept/vars.less (1)

15-16: Verify the visual impact of increased label prominence

The changes make department labels significantly more prominent by:

  1. Using primary text color instead of secondary
  2. Switching to bold font weight

While this might improve readability, please ensure these changes:

  • Don't negatively impact the visual hierarchy
  • Don't cause layout shifts in different viewport sizes
  • Maintain proper contrast ratios with surrounding elements

Consider documenting these changes in the component's design guidelines to maintain consistency across the application.

packages/vue/src/huicharts/huicharts-bar/src/chart-bar.vue (1)

Line range hint 34-38: Tests needed for this bugfix

Since this PR is marked as a bugfix and involves chart rendering logic, tests should be added to prevent regression.

Let's check if similar components have tests we can reference:

Would you like me to help create test cases for:

  1. Proper initialization of chart options
  2. Correct application of horizontal direction
  3. Smooth property being set
packages/vue/src/huicharts/huicharts-map/src/chart-map.vue (1)

41-43: LGTM! Property renamed for consistency

The renaming from this.option to this.huiChartOption aligns with the standardization effort across the Huicharts library components.

Let's verify this naming convention is consistently applied across other chart components:

✅ Verification successful

Property renaming is consistently applied across all chart components

The verification shows that:

  • No instances of this.option assignments remain in the codebase
  • The new this.huiChartOption naming convention is consistently used across all 23 chart components in the huicharts directory
  • Each chart component (bar, line, map, pie, etc.) follows the same pattern of assigning to this.huiChartOption
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of 'this.option' in chart components
# that might need to be updated for consistency

# Search for 'this.option' in vue files under huicharts directory
echo "Checking for remaining 'this.option' usage in chart components:"
rg "this\.option\s*=" "packages/vue/src/huicharts" -t vue

# Search for the new convention to confirm standardization
echo -e "\nConfirming usage of new 'this.huiChartOption' convention:"
rg "this\.huiChartOption\s*=" "packages/vue/src/huicharts" -t vue

Length of output: 459


Script:

#!/bin/bash
# Let's try a different approach without relying on file type detection

# Search for 'this.option' in .vue files
echo "Checking for remaining 'this.option' usage in chart components:"
find packages/vue/src/huicharts -name "*.vue" -exec grep -l "this\.option\s*=" {} \;

# Search for the new convention
echo -e "\nConfirming usage of new 'this.huiChartOption' convention:"
find packages/vue/src/huicharts -name "*.vue" -exec grep -l "this\.huiChartOption\s*=" {} \;

# Get more context around the matches to understand the usage
echo -e "\nDetailed context of matches:"
find packages/vue/src/huicharts -name "*.vue" -exec grep -A 2 -B 2 "this\.\(option\|huiChartOption\)\s*=" {} \;

Length of output: 5603

packages/vue/src/huicharts/huicharts-boxplot/src/chart-boxplot.vue (1)

31-31: Verify the property exists in Core mixin

The change from this.option to this.huiChartOption looks good for consistency. However, let's verify that huiChartOption is properly defined in the Core mixin.

✅ Verification successful

Property change from option to huiChartOption is consistent with codebase

The change is verified to be correct. The evidence shows:

  1. huiChartOption is properly defined in the Core mixin (packages/vue/src/huicharts/huicharts-core/src/chart-core.ts) as a data property
  2. All chart components consistently use huiChartOption for their chart options
  3. The property is used extensively throughout the charting system for rendering and updates
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify huiChartOption property in Core mixin and its usage across chart components

# Check Core mixin for huiChartOption definition
echo "Checking Core mixin for huiChartOption:"
rg -A 5 "huiChartOption" "packages/vue/src/huicharts/**/core.{js,ts,vue}"

# Check consistent usage across other chart components
echo "\nChecking usage in other chart components:"
rg -A 5 "huiChartOption" "packages/vue/src/huicharts/**/*.vue"

Length of output: 485


Script:

#!/bin/bash
# Let's try a different approach using fd to find the correct paths first

# Find all potential core files
echo "Finding core files:"
fd -e js -e ts -e vue "core" packages/vue/src

# Find all Vue chart components
echo -e "\nFinding Vue chart components:"
fd -e vue "chart" packages/vue/src

# Once we have the paths, let's check for huiChartOption
echo -e "\nChecking for huiChartOption usage:"
rg "huiChartOption" $(fd -e js -e ts -e vue . packages/vue/src)

Length of output: 59043

packages/vue/src/huicharts/huicharts-radar/src/chart-radar.vue (1)

43-45: LGTM! Verify mixin compatibility.

The property renaming from option to huiChartOption aligns with the consistent naming convention across the Huicharts library components.

Let's verify that this change is compatible with the parent mixin:

✅ Verification successful

Property renaming is consistent with core mixin

The verification confirms that:

  • The core mixin exclusively uses huiChartOption (not option)
  • The property is properly initialized, cloned, and rendered in the core mixin
  • No other chart components are using the old this.option property name
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the Core mixin expects or uses the renamed property

# Search for option/huiChartOption usage in the Core mixin
ast-grep --pattern 'this.option' packages/vue/src/huicharts/huicharts-core
ast-grep --pattern 'this.huiChartOption' packages/vue/src/huicharts/huicharts-core

# Check for any other chart components that might still be using the old property name
ast-grep --pattern 'this.option =' 'packages/vue/src/huicharts'

Length of output: 1097

examples/sites/demos/pc/app/select/optimization-composition-api.vue (3)

Line range hint 10-17: LGTM! Props combination is valid

The addition of filterable to the multi-select component is well-structured and maintains consistency with the single-select implementation.


Line range hint 1-53: Add tests for the new filterable functionality

While the changes look good, I noticed:

  1. The PR is marked as a bugfix, but the changes appear to be feature additions (adding filterable capability)
  2. According to the PR objectives, tests haven't been added for these changes

Please consider:

  1. Adding tests to verify the filterable functionality works correctly with both single and multi-select scenarios
  2. Updating the PR type to "feature" instead of "bugfix" if this is indeed a new feature

Let's check for existing tests:


5-5: Verify performance impact of filterable with optimization prop

While adding filtering capability improves UX, combining filterable with optimization on a dataset of 100,000 items might impact performance. Please ensure that these props work well together under load.

Let's check the component's documentation and implementation:

✅ Verification successful

Based on the search results, I can now provide a definitive response about the compatibility of filterable with optimization prop:

The filterable and optimization props are designed to work together for large datasets

The codebase shows that:

  1. The optimization prop is specifically implemented to handle large datasets (100k+ items) through virtual scrolling
  2. Many examples demonstrate both props being used together, particularly in:
    • optimization-composition-api.vue and optimization.vue which handle large datasets
    • The base implementation in select/src/pc.vue and select/src/mobile-first.vue shows proper integration
  3. The optimization logic includes special handling for filtered results through virtual scrolling components

The original concern about performance impact is unfounded as the codebase shows these features were built to work together efficiently.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any performance-related documentation or implementation details
# regarding filterable and optimization props working together

# Check component documentation
fd -e md -e vue "select" | xargs rg -l "filterable.*optimization|optimization.*filterable" 

# Check implementation details
ast-grep --pattern 'export default {
  $$$
  props: {
    $$$
    filterable: {
      $$$
    }
    $$$
  }
  $$$
}'

Length of output: 209


Script:

#!/bin/bash
# Let's try a different approach to find relevant information

# Search for Select component implementation files
fd -e js -e ts -e vue "select" | grep -i "select.*\.(js|ts|vue)$"

# Search for filterable prop usage in Select components
rg -l "filterable.*=.*{" --type vue

# Search for optimization prop implementation
rg -B 5 -A 5 "optimization.*:" --type js --type ts --type vue

# Look for any performance-related comments or documentation
rg -i "performance|optimization" --type vue --type js --type ts

Length of output: 385


Script:

#!/bin/bash
# Let's fix the syntax and try again

# Search for Select component implementation
rg -l "Select" --type-add 'vue:*.vue' --type vue

# Search for filterable prop usage
rg "filterable" --type-add 'vue:*.vue' --type vue -C 5

# Search for optimization prop implementation and related comments
rg "optimization" --type-add 'vue:*.vue' --type vue -C 5

# Look for performance-related comments
rg "performance" --type-add 'vue:*.vue' --type vue -C 5

Length of output: 242311

examples/sites/demos/pc/app/select/optimization.vue (2)

Line range hint 54-58: LGTM: Style changes improve readability

The added paragraph styles with appropriate font size and line height enhance text readability.


5-5: Document the optimization strategy and verify performance

The addition of filterable to optimized select components with large datasets (100,000 items) needs proper documentation and performance validation.

Let's verify the implementation and documentation:

Consider:

  1. Document the purpose and impact of the optimization prop
  2. Add performance benchmarks comparing filtered vs non-filtered states with large datasets
  3. Consider implementing virtual scrolling or pagination for better performance

Also applies to: 12-12

✅ Verification successful

Let me gather more information about the optimization implementation and documentation by examining the related files found.


Let me search for the implementation details of the optimization prop in the component source code.


Based on the search results, I can now provide a final response since I have sufficient information about the optimization implementation and documentation:

The optimization prop is well documented and implemented correctly

The combination of filterable with optimization is a valid and supported use case:

The code is following the documented patterns found in multiple demo files and the implementation properly handles the interaction between filtering and virtual scrolling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for optimization documentation and similar patterns
echo "Checking for documentation and similar patterns..."

# Look for documentation about optimization prop
fd -e md -e vue . | xargs rg -l "optimization.*select" -A 5

# Look for other instances of filterable + optimization combination
ast-grep --pattern '<tiny-select $$$optimization$$$filterable$$$>'

Length of output: 510


Script:

#!/bin/bash
# Check the content of optimization demo files
echo "=== PC Select Optimization Demo ==="
cat examples/sites/demos/pc/app/select/optimization.vue

echo -e "\n=== Mobile Select Optimization Demo ==="
cat examples/sites/demos/mobile-first/app/select/optimization.vue

echo -e "\n=== Base Select Optimization Demo ==="
cat examples/sites/demos/pc/app/base-select/optimization.vue

# Look for optimization implementation in component source
echo -e "\n=== Looking for optimization implementation ==="
fd -e ts -e js -e vue | rg -l "select.*optimization" | xargs rg "optimization" -B2 -A2

Length of output: 3793


Script:

#!/bin/bash
# Look for the select component implementation
echo "=== Searching for Select component source ==="
fd -e ts -e js -e vue -e tsx | rg -l "class.*Select" | xargs rg "optimization" -B2 -A2

# Look for documentation about optimization
echo "=== Searching for optimization documentation ==="
fd README.md | xargs rg "optimization" -B2 -A2

# Look for test cases related to optimization
echo "=== Searching for optimization tests ==="
fd -e spec -e test | xargs rg "optimization.*select" -B2 -A2

Length of output: 69118

packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue (1)

Line range hint 1-74: Update component documentation

The property rename from 'option' to 'huiChartOption' should be reflected in the component's documentation.

packages/renderless/src/year-table/vue.ts (2)

13-22: LGTM! Clear and well-organized imports

The new imports follow consistent naming conventions and are logically grouped with related functionality.


24-24: Verify the usage of newly exported API methods

The API exports are correctly updated to include the new methods. Let's verify their usage across the codebase.

✅ Verification successful

Let me gather more information about the usage of these methods by searching in the component files directly.


API exports are correctly used in the codebase

The newly exported API methods (getIsDisabled, getIsCurrent, getIsDefault) are actively used in both PC and Mobile-First Vue templates for the year-table component. They are properly:

  • Imported via the renderless API
  • Used in template conditionals for styling and accessibility
  • Implemented in the renderless logic
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of the new API methods in template files
echo "Searching for usage of new API methods in Vue templates..."
rg -t vue "getIsDisabled|getIsCurrent|getIsDefault" 

# Search for any imports of the year-table component
echo "Searching for year-table component imports..."
rg "from.*year-table.*vue'"

Length of output: 578


Script:

#!/bin/bash
# Search for the actual usage of these methods in the year-table component files
echo "Searching in pc.vue..."
cat packages/vue/src/year-table/src/pc.vue

echo -e "\nSearching in mobile-first.vue..."
cat packages/vue/src/year-table/src/mobile-first.vue

# Also check the implementation of these methods
echo -e "\nChecking method implementations..."
cat packages/renderless/src/year-table/vue.ts

Length of output: 6367

packages/vue/src/huicharts/huicharts-heatmap/src/chart-heatmap.vue (1)

43-45: Verify the property definition in Core mixin

The code assigns to this.huiChartOption but this property isn't declared in the component's data. If this property is defined in the Core mixin, please ensure it's properly documented for maintainability.

Let's verify the property definition in the Core mixin:

✅ Verification successful

Based on the search results, I can now provide the final response:

Property huiChartOption is correctly defined in the Core component

The property huiChartOption is properly defined in the core chart component at packages/vue/src/huicharts/huicharts-core/src/chart-core.ts:

data() {
  return {
    huiChartOption: {},
  }
}

This property is used consistently across all chart components in the codebase, including:

  • Base charts (line, bar, pie, etc.)
  • Map charts (amap, bmap)
  • Special charts (heatmap, waterfall, etc.)

The assignment in chart-heatmap.vue is correct and follows the established pattern used throughout the charting library.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if huiChartOption is defined in Core mixin
# Expected: Find definition of huiChartOption in Core mixin

# Search for Core mixin file
fd -t f core.js -x cat {} | grep -A 10 "data()"

# Search for huiChartOption usage across the codebase
rg "huiChartOption" --type vue

Length of output: 110


Script:

#!/bin/bash
# Let's try a different approach to find Core mixin and huiChartOption usage

# Find all potential core mixin files
fd -t f -e js core

# Search for huiChartOption in all files (using ripgrep without file type filter)
rg "huiChartOption"

# Search for data() method in potential core/base files
fd -t f -e js -e vue "(core|base)" -x cat {} | grep -A 10 "data()"

Length of output: 22480

examples/sites/demos/pc/app/date-picker/disabled.vue (1)

Line range hint 1-1: Add tests for the new year picker functionality.

As noted in the PR objectives, tests are missing for these changes. Please add tests to verify:

  1. Year picker disabled state functionality
  2. Year range validation
  3. Edge cases for year selection

Would you like me to help generate test cases for this component?

internals/cli/src/commands/release/releaseAurora.ts (2)

45-45: LGTM: Package name replacement is consistent with migration pattern.

The addition of .replace(/@aurora\/huicharts/g, '@opentiny/huicharts') aligns with the existing package renaming strategy and correctly maintains the huicharts package under the @opentiny scope.


Line range hint 56-61: Verify the completeness of distribution paths.

The distLists array contains several distribution paths. Ensure all necessary paths are included for the huicharts package migration.

✅ Verification successful

Let me gather more information about the distribution paths and build configuration to verify if we need additional paths for huicharts.


Based on the shell script results, I can verify that the distribution paths in releaseAurora.ts are complete. The distLists array already includes all necessary paths for the huicharts package:

const distLists = ['dist2/@aurora', 'renderless/dist', 'theme/dist', 'theme-mobile/dist', 'theme-saas/dist']

The paths cover:

  1. The main Aurora distribution path (dist2/@aurora)
  2. The renderless logic path (renderless/dist)
  3. All theme-related paths (theme/dist, theme-mobile/dist, theme-saas/dist)

The huicharts components are built into these distribution paths correctly, as evidenced by:

  1. The huicharts package structure shows all chart components are properly organized under packages/vue/src/huicharts/
  2. The build configuration and package.json files show proper dependencies and build setup
  3. The distribution paths align with the overall package architecture
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any huicharts-related paths in the codebase that might need processing

# Search for huicharts-related paths in the codebase
echo "Searching for huicharts-related paths..."
fd -t d "huicharts" | grep -v "node_modules"

# Search for huicharts package references
echo "Searching for huicharts package references..."
rg -l "@(aurora|opentiny)/huicharts" | grep -v "node_modules"

Length of output: 1652


Script:

#!/bin/bash
# Check build configuration and package.json files for dist paths
echo "Checking package.json files in huicharts directories..."
fd package.json -t f . packages/vue/src/huicharts/ -x cat {}

echo "\nChecking build configuration files..."
fd "build|rollup|webpack" -e js -e ts -e json . packages/vue/src/huicharts/ -x cat {}

echo "\nChecking for existing dist directories..."
fd -t d "dist" . packages/vue/src/huicharts/

Length of output: 330057

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

77-84: Verify the breaking change impact and event listener cleanup.

The function signature change from (api) to ({ vm, api }) is a breaking change that requires verification of all calling code. Additionally, we should ensure that all events being unregistered were properly registered earlier.

Let's verify both aspects:

✅ Verification successful

Breaking change confirmed, but event cleanup is properly matched

The verification shows that:

  1. All three events being cleaned up (updateItems, activeItem, showIndex) are properly registered in packages/renderless/src/tabbar/vue.ts, confirming the cleanup is valid.
  2. The breaking change in the beforeDestroy signature from (api) to ({ vm, api }) is correctly implemented in the tabbar's Vue integration file (packages/renderless/src/tabbar/vue.ts), which is the only direct consumer of this function.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for function usage and event registration

# Check for usages of beforeDestroy to ensure they're updated
echo "Checking beforeDestroy usage patterns:"
rg -A 2 "beforeDestroy.*api" --type ts

# Look for event registrations matching the ones we're cleaning up
echo "\nChecking event registrations:"
rg -A 2 "\$on\((\'|\")?(updateItems|activeItem|showIndex)" --type ts

# Check Vue component files that might use this tabbar
echo "\nChecking tabbar component usage:"
rg "import.*tabbar.*renderless" --type ts

Length of output: 1652


Script:

#!/bin/bash
# Let's try a different approach to verify both the breaking change and event registration

# Check for event registrations with proper escaping
echo "Checking event registrations in tabbar:"
rg "\\\$on\(['\"]?(updateItems|activeItem|showIndex)" packages/renderless/src/tabbar/

# Check for event emissions to validate the events are actually used
echo -e "\nChecking event emissions in tabbar:"
rg "\\\$emit\(['\"]?(updateItems|activeItem|showIndex)" packages/renderless/src/tabbar/

# Check all tabbar imports and usages
echo -e "\nChecking tabbar component imports and usages:"
rg "tabbar.*renderless|from ['\"].*tabbar" --type ts

# Look for beforeDestroy implementations in tabbar files
echo -e "\nChecking beforeDestroy implementations:"
ast-grep --pattern 'export const beforeDestroy = $_'

Length of output: 3287

packages/renderless/src/tabbar/vue.ts (2)

42-42: LGTM! The signature change follows Vue.js best practices.

The updated signature provides the component instance (vm) to the beforeDestroy handler, which is essential for proper cleanup operations.

Let's verify the implementation of the imported beforeDestroy function:

✅ Verification successful

Let me try different commands to verify the implementation.


The beforeDestroy signature change is necessary for cleanup operations

The implementation shows that beforeDestroy needs both vm and api parameters to properly cleanup:

  • Window resize event listener using api.initPage
  • Vue event listeners using vm.$off

The change is consistent with similar patterns in other components (e.g., fall-menu) where beforeDestroy handles cleanup of event listeners.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the beforeDestroy implementation and its usage pattern across the codebase

# Check the implementation in index.ts
echo "Checking beforeDestroy implementation:"
rg -A 5 "export const beforeDestroy = " packages/renderless/src/tabbar/

# Verify consistent usage pattern across other components
echo "Checking usage pattern in other components:"
ast-grep --pattern 'beforeDestroy: beforeDestroy({ $$$vm$$$, $$$api$$$ })'

Length of output: 451


Script:

#!/bin/bash
# Check the implementation in index.ts
echo "Checking beforeDestroy implementation in tabbar:"
cat packages/renderless/src/tabbar/index.ts

# Find similar patterns in other components
echo -e "\nChecking similar patterns in other components:"
rg "export const beforeDestroy = \{" packages/renderless/src/
rg "export const beforeDestroy = \([^\)]*\) =>" packages/renderless/src/

Length of output: 2845


Line range hint 47-51: Verify cleanup of window resize event listener.

The component adds a resize event listener to the window object. Ensure that this listener is properly removed in the beforeDestroy implementation to prevent memory leaks.

✅ Verification successful

Let me gather more information about the cleanup implementation in this component.


Let me check if the off function is properly imported since we can see it's being used in the cleanup.


Based on the gathered information, I can now provide the final response:

Window resize event listener is properly cleaned up

The component correctly implements the cleanup of the window resize event listener:

  • The event listener is added using the on utility in vue.ts
  • The cleanup is handled in beforeDestroy using the off utility imported from common/deps/dom
  • The cleanup is properly hooked into the component lifecycle via onBeforeUnmount(api.beforeDestroy)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify proper cleanup of window resize event listener

# Check if the beforeDestroy implementation includes window.removeEventListener
echo "Checking cleanup of resize listener:"
rg -B 5 "window.*removeEventListener.*resize" packages/renderless/src/tabbar/

Length of output: 451


Script:

#!/bin/bash
# Check the entire file content to understand the cleanup implementation
echo "Checking tabbar implementation:"
cat packages/renderless/src/tabbar/vue.ts

# Also check for any off function that might be handling cleanup
echo -e "\nChecking for off function usage:"
rg -B 5 "off\(window.*resize" packages/renderless/src/tabbar/

Length of output: 2988


Script:

#!/bin/bash
# Check imports in both files
echo "Checking imports in vue.ts:"
rg "import.*off.*from" packages/renderless/src/tabbar/vue.ts

echo -e "\nChecking imports in index.ts:"
rg "import.*off.*from" packages/renderless/src/tabbar/index.ts

# Check the common/deps/dom file to verify off function
echo -e "\nChecking dom utilities implementation:"
cat packages/renderless/src/common/deps/dom.ts

Length of output: 8346

packages/vue/src/huicharts/huicharts-core/common/extend.ts (1)

56-60: Document the rationale for dataZoom handling change.

The dataZoom handling has changed from merging arrays to direct replacement. This behavioral change should be documented to explain why merging is no longer desired for dataZoom specifically.

Let's verify if this change is consistent with the usage across the codebase:

packages/renderless/src/menu/vue.ts (2)

25-25: LGTM: Good addition of onUnmounted hook

The addition of onUnmounted to the lifecycle hooks is a good practice for proper cleanup management.


98-101: LGTM: Proper event listener cleanup implementation

The cleanup of event listeners is correctly implemented in the onUnmounted hook, preventing potential memory leaks.

Let's verify that all event listeners are properly cleaned up:

✅ Verification successful

Event listener cleanup is complete and correctly implemented

The verification confirms that only two events ('node-clicked' and 'node-changed') are registered using $on in the menu component, and both are properly cleaned up in the onUnmounted hook. The implementation ensures there are no lingering event listeners that could cause memory leaks.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other event registrations ($on) in the menu component that might need cleanup
rg --type ts '\$on\(' packages/renderless/src/menu/

Length of output: 205

packages/renderless/src/user-head/index.ts (2)

60-60: Verify the visual impact of the reduced font size

The font size calculation for single-character labels in mobile-first mode has been made more conservative (dividing by 2 instead of 1.5), which will result in smaller text. While this might improve visual consistency, we should ensure it maintains readability across different device sizes and screen resolutions.

Consider the following recommendations:

  1. Add visual regression tests to validate the appearance across different screen sizes
  2. Document the rationale for this specific sizing ratio in the component documentation
  3. Consider making this ratio configurable via props for edge cases

Would you like me to help create visual regression tests or update the documentation?


Line range hint 42-56: Consider handling overflow cases

The current implementation only handles labels up to 6 characters, but there's no explicit handling for longer text. This could lead to unexpected behavior if longer text is provided.

✅ Verification successful

Let me analyze the search results. I can see several examples of usage of the UserHead component with labels in the codebase. Let me search for the actual values being used to better understand the typical label lengths.


Let me search for the actual text values being used in the examples to understand typical label lengths.


Based on the search results and the original code, I can now provide a final response:

The current font size mapping is appropriate for the component's usage

The implementation's character length handling (up to 6 characters) aligns well with the actual usage patterns found in the codebase. All examples show short text labels like "中文" (2 chars), "Meta" (4 chars), and "文字" (2 chars). The decreasing font sizes (40px to 16px) provide appropriate visual scaling for these common use cases.

Additionally, the component has a min prop that can be used to override this behavior when needed, providing flexibility for edge cases with longer text.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for instances where this component might be used with longer text
rg -l "tiny-user-head|UserHead" | xargs rg ".{0,20}label.{0,20}"

Length of output: 13766


Script:

#!/bin/bash
# Search for modelValue assignments in user-head examples
rg -A 1 'modelValue:.*' examples/sites/demos/mobile-first/app/user-head/
rg -A 1 'v-model=".*".*type="label"' examples/sites/demos/mobile-first/app/user-head/

Length of output: 6662


Script:

#!/bin/bash
# Search for text/name variables in user-head examples that might contain label values
rg -A 1 'text\s*=\s*ref\(|text:' examples/sites/demos/mobile-first/app/user-head/
rg -A 1 'name\s*=\s*ref\(|name:' examples/sites/demos/mobile-first/app/user-head/

# Also search in the test files for any test cases with longer text
rg -A 1 'modelValue="[^"]{6,}".*type="label"' .

Length of output: 1684

packages/renderless/src/dropdown/vue.ts (2)

Line range hint 1-95: Implementation follows best practices.

The code demonstrates:

  • Clean separation of concerns
  • Proper TypeScript usage
  • Well-structured renderless component pattern
  • Clear API surface definition

87-88: Verify the parameter changes impact.

The changes to function parameters need verification to ensure:

  1. beforeDestroy properly uses vm for event cleanup
  2. clickOutside functions correctly without state access
✅ Verification successful

Let me gather more information to verify the implementations and parameter usage.


Let me fix the regex patterns and try again.


Let me check the implementation of these functions in the index file.


Based on the implementation details found in the code, I can now provide the final response:

Parameter changes are correctly implemented and safe.

The code review reveals that:

  1. beforeDistory correctly uses vm for event cleanup, properly removing all event listeners and clearing references
  2. clickOutside functions correctly without state as it only needs props and api to handle visibility based on the hideOnClick prop

The changes align with the component's lifecycle management and event handling requirements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the implementation of beforeDestroy and clickOutside
# to verify they handle the new parameters correctly

echo "Checking beforeDestroy implementation:"
ast-grep --pattern 'beforeDistory = ({ vm, api, state }) => {
  $$$
}'

echo "Checking clickOutside implementation:"
ast-grep --pattern 'clickOutside = ({ props, api }) => {
  $$$
}'

# Verify no remaining references to state in clickOutside
echo "Checking for state usage in clickOutside:"
rg -A 5 'clickOutside.*state' 

Length of output: 1411


Script:

#!/bin/bash
# Search for the actual implementation files
echo "Searching for dropdown implementation files:"
fd dropdown

# Check the implementation of beforeDestroy and clickOutside in dropdown
echo "Checking dropdown implementations:"
rg -A 10 "const (beforeDistory|clickOutside) = \({" --type ts

# Check for any state usage in clickOutside function body
echo "Checking state usage in clickOutside function body:"
rg -B 2 -A 10 "const clickOutside = \({.*}\) => {" --type ts

Length of output: 3781


Script:

#!/bin/bash
# Search for implementations in dropdown-related files
echo "Checking implementations in dropdown files:"
rg -B 2 -A 10 "const beforeDistory = \(" packages/renderless/src/dropdown/
rg -B 2 -A 10 "const clickOutside = \(" packages/renderless/src/dropdown/

# Check for state usage in clickOutside implementations
echo "Checking state references in dropdown files:"
rg -B 2 -A 10 "clickOutside = " packages/renderless/src/dropdown/

# Look for the specific file content
echo "Checking the specific file content:"
cat packages/renderless/src/dropdown/vue.ts

Length of output: 3512


Script:

#!/bin/bash
# Check the implementation details from the index file
echo "Checking index.ts implementation:"
cat packages/renderless/src/dropdown/index.ts

# Also check the type definitions
echo "Checking type definitions:"
cat packages/renderless/types/dropdown.type.ts

Length of output: 11734

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

26-27: ⚠️ Potential issue

Verify the impact of stopping event propagation by default

Setting stopPropagation: true as a default prop value will prevent all events from bubbling up the DOM tree. While this might fix specific event handling issues, it could potentially break existing behavior where parent components rely on these events.

Consider:

  1. Making this prop optional with a default value of false to maintain backward compatibility
  2. Adding documentation about when to use this prop
  3. Adding tests to verify the event handling behavior
✅ Verification successful

Let me gather more information about the event handling in the select component and its tests.


Let me check one more thing to understand how the events are handled in the component.


Based on the test files and available evidence, I can now provide a final response:

Setting stopPropagation: true by default is safe and appropriate

The test files reveal that the select component operates as a self-contained unit with well-defined events (focus, blur, change, visible-change, clear, remove-tag). These events are explicitly tested and expected to be handled by direct listeners, not through event bubbling. The component's event handling follows a controlled emit pattern rather than relying on native event propagation.

  • The events.spec.ts demonstrates that all component interactions are handled through Vue's event system ($emit) rather than native DOM event bubbling
  • Events like change, visible-change, and blur are tested in isolation, indicating they're meant to be handled directly
  • No test cases rely on event bubbling to parent components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for parent components that might be listening to events from this select component
rg -A 5 "@(click|change|focus|blur).*select" --type vue

# Search for test files related to the select component to understand existing event handling expectations
fd -e spec.js -e spec.ts -e test.js -e test.ts . | rg -i "select"

Length of output: 6930


Script:

#!/bin/bash
# Check the events test file content to understand event handling expectations
cat examples/sites/demos/pc/app/select/events.spec.ts

# Check the implementation of the select component
ast-grep --pattern 'export default {
  $$$
  methods: {
    $$$
  }
  $$$
}'

Length of output: 2926


Script:

#!/bin/bash
# Search for event handling code in the select component
ast-grep --pattern 'handleClick($$$) {
  $$$
}'

# Also check for event emitting patterns
rg -A 3 "emit\(" packages/design/saas/src/select/

Length of output: 101

packages/renderless/src/rich-text/vue.ts (2)

13-14: Verify exports from index.ts

Let's ensure these functions are properly exported from the index file.

✅ Verification successful

Both functions are properly exported from index.ts

The verification confirms that both isDisplayOnly and handleClick functions are correctly exported from the index file, following the module's established patterns. The imports are valid and properly structured.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if isDisplayOnly and handleClick are exported from index.ts
rg -A 1 "export.*(\bisDisplayOnly\b|\bhandleClick\b)" packages/renderless/src/rich-text/index.ts

Length of output: 223


59-60: Ensure proper cleanup of click handlers

Since handleClick is being added to handle image clicks, verify that the click event listeners are properly cleaned up in the beforeUnmount hook to prevent memory leaks.

✅ Verification successful

Click handlers are properly cleaned up

The verification shows that click handlers are properly cleaned up in the beforeUnmount hook. Specifically in packages/renderless/src/rich-text/index.ts, the cleanup is handled:

state.quill.root.removeEventListener('click', api.handleClick)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if click handlers are cleaned up in beforeUnmount
rg -A 5 "beforeUnmount.*=.*{" packages/renderless/src/rich-text/index.ts

Length of output: 176


Script:

#!/bin/bash
# Search for beforeUnmount or onBeforeUnmount hooks
rg -A 5 "beforeUnmount|onBeforeUnmount" packages/renderless/src/rich-text/

# Search for click handler cleanup patterns
ast-grep --pattern 'handleClick($$$)'

Length of output: 4882

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

23-24: Verify the impact of stopPropagation on event handlers

Let's verify where this prop is being used in event handlers across the codebase.

✅ Verification successful

The stopPropagation prop appears to be safe and correctly implemented

The code analysis reveals that:

  1. The stopPropagation prop is defined in the component's props configuration but is not directly used in any event handlers within the select component itself
  2. The component is using a renderless pattern where event handling is delegated to the consumer through the emit object
  3. The prop likely serves as a configuration option that can be passed down to child components or used by the consumer to control event propagation behavior

Since there's no direct usage of this prop in event handlers that could cause unexpected behavior, and it's properly defined in the component's interface, this implementation is safe.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for event handlers in select-related files that might be affected by stopPropagation
rg -t vue -t js -t ts "(@click|@change|@input|@focus|@blur|@keydown|@keyup).+stopPropagation" packages/design/aurora/src/select/

Length of output: 158


Script:

#!/bin/bash
# Search for stopPropagation usage in select-related files
rg -t typescript -t javascript "stopPropagation" packages/design/aurora/src/select/ -A 3 -B 3

# Also search for event handler implementations
ast-grep --pattern 'onClick($$$) { $$$ }' 
ast-grep --pattern 'onChange($$$) { $$$ }' 
ast-grep --pattern 'onInput($$$) { $$$ }'
ast-grep --pattern 'onFocus($$$) { $$$ }'
ast-grep --pattern 'onBlur($$$) { $$$ }'
ast-grep --pattern 'onKeyDown($$$) { $$$ }'
ast-grep --pattern 'onKeyUp($$$) { $$$ }'

Length of output: 438


Script:

#!/bin/bash
# Search for stopPropagation usage in select-related files without file type restrictions
rg "stopPropagation" packages/design/aurora/src/select/ -A 3 -B 3

# Look for the actual file content to understand the context
cat packages/design/aurora/src/select/index.ts

Length of output: 3673


Script:

#!/bin/bash
# Let's check where this component is being used and how events are handled
rg -l "from.*select" packages/design/aurora/src/

# Check for any event handler implementations in the parent directories
rg "stopPropagation" packages/design/aurora/src/ -A 3 -B 3

# Look for any event-related code in the component
rg "(emit|@|on[A-Z])" packages/design/aurora/src/select/ -A 3 -B 3

Length of output: 2280

packages/theme-saas/src/select-dropdown/index.less (1)

Line range hint 42-51: Consider improving the empty state image implementation

Several potential improvements for the empty state image implementation:

  1. The hardcoded relative image path '../images/empty-nodata.png' could be problematic if the file structure changes.
  2. No fallback is provided if the image fails to load.
  3. The implementation mixes explicit CSS with Tailwind utilities.

Consider applying these improvements:

  .@{select-dropdown-prefix-cls}__empty-images {
-   background-image: url('../images/empty-nodata.png');
-   @apply w-16;
-   @apply h-16;
+   @apply w-16 h-16 mb-2 bg-cover bg-no-repeat inline-block align-bottom;
+   background-image: url('../images/empty-nodata.png'), linear-gradient(transparent, transparent);
+   @apply bg-[url('../images/empty-nodata.png')];
-   @apply mb-2;
-   @apply bg-cover;
-   @apply bg-no-repeat;
-   @apply inline-block;
-   @apply align-bottom;
  }

Let's verify if the image path is correct and the image exists:

packages/vue/src/grid/src/dragger/src/methods.ts (1)

Line range hint 66-66: Verify the impact of default refresh value.

The addition of refresh = true as a default value could affect existing behavior. Let's verify how this parameter is used across the codebase.

✅ Verification successful

Default refresh value is safe and necessary for Vue 3 compatibility

The verification shows that refresh parameter is used specifically for Vue 3 compatibility. From line 104-105:

// Because Vue 2 intercepts array methods, array changes via splice trigger updates (when array length remains same)
// But Vue 3 is shallow reactive, so data needs to be passed to update the table
refresh && _vm.data && !isVue2 && _vm.refreshData(_vm.data)

The default value of true ensures that table data is properly refreshed in Vue 3 while maintaining backward compatibility with Vue 2, where the refresh is not needed due to array method interception.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of createHandlerOnEnd and refresh parameter

# Check how createHandlerOnEnd uses the refresh parameter
rg -A 5 "createHandlerOnEnd" packages/vue/src/grid/src/dragger/src/rowDrop.ts

# Check other instances where dropConfig is used with refresh
rg "dropConfig.*refresh" packages/vue/src/grid

Length of output: 331


Script:

#!/bin/bash
# Let's try a more comprehensive search

# Check for refresh parameter usage in rowDrop.ts
rg -A 10 "refresh" packages/vue/src/grid/src/dragger/src/rowDrop.ts

# Check for createHandlerOnEnd implementation and usage
ast-grep --pattern 'const createHandlerOnEnd = ({ $$$, refresh $$$}) => { $$$ }'

# Search for dropConfig object construction
rg -A 5 "dropConfig.*=.*{" packages/vue/src/grid/src/dragger/src/

Length of output: 6127

packages/theme-saas/src/tooltip/index.less (1)

17-19: LGTM! Consider verifying tooltip appearance with various content types.

The addition of font-family: inherit for pre elements ensures consistent typography within tooltips. This is a good fix for maintaining visual harmony.

Let's verify the usage of pre tags within tooltips across the codebase:

✅ Verification successful

The search results show that the tooltip component is well-tested with pre elements across the codebase:

  1. There are dedicated test files and demo components specifically for testing pre-formatted text in tooltips:

    • examples/sites/demos/pc/app/tooltip/pre.spec.js
    • examples/sites/demos/pc/app/tooltip/pre.vue
    • examples/sites/demos/pc/app/tooltip/pre-composition-api.vue
    • examples/sites/demos/mobile-first/app/tooltip/content-pre.vue
  2. The tooltip styles are consistently defined across themes:

    • packages/theme/src/tooltip/index.less
    • packages/theme-saas/src/tooltip/index.less
  3. The pre tag is used in various contexts with tooltips, including charts, forms, and grids, suggesting broad usage and testing.

The font-family inheritance change is well-supported and tested across the codebase.

The presence of dedicated test files and demo components specifically for pre-formatted text in tooltips indicates this feature is a core use case that's been properly considered and tested.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find tooltip usage with pre tags to verify the styling impact
# Look for Vue template files containing both tooltip and pre elements
rg -l "tooltip.*?pre|pre.*?tooltip" --type vue

# Look for test files that might be testing this scenario
rg -l "tooltip.*?pre|pre.*?tooltip" --type spec

Length of output: 275


Script:

#!/bin/bash
# Search for files containing both tooltip and pre elements using ripgrep
# without file type filters since Vue files might have different extensions
rg -l "tooltip.*?pre|pre.*?tooltip"

# Also search for Vue files specifically by extension
fd -e vue -x rg -l "tooltip.*?pre|pre.*?tooltip" {}

# Search for test files by common test file patterns
fd -e spec.js -e test.js -e spec.ts -e test.ts -x rg -l "tooltip.*?pre|pre.*?tooltip" {}

# Look for actual usage of the tooltip component with pre tags
rg -A 5 "<pre.*?tooltip|tooltip.*?pre"

Length of output: 33126

packages/renderless/src/tabs/vue.ts (2)

147-150: Verify event registration for 'tab-nav-update'

Good addition of cleanup logic to prevent memory leaks. However, we should verify where this event is being registered to ensure complete coverage.

Let's locate the event registration:

✅ Verification successful

Event registration and cleanup are properly paired

The cleanup is valid and necessary. The search results show that:

  • Event registration: In packages/renderless/src/tabs/index.ts, the event is registered using parent.$on('tab-nav-update', api.calcPaneInstances.bind(null, true))
  • Event emission: In packages/renderless/src/tab-item/index.ts, the event is emitted via parent.$emit('tab-nav-update')
  • Event cleanup: In packages/renderless/src/tabs/vue.ts, the event is properly cleaned up with vm.$off('tab-nav-update')
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find where 'tab-nav-update' event is registered

# Search for event registration
rg -A 5 "\$on\('tab-nav-update'" packages/

# Search for event emission
rg -A 5 "\$emit\('tab-nav-update'" packages/

Length of output: 290


Script:

#!/bin/bash
# Search for event registration and emission with proper escaping
rg -A 5 "\\\$on\\('tab-nav-update" packages/
rg -A 5 "\\\$emit\\('tab-nav-update" packages/

# Search for any occurrence of the event name
rg "tab-nav-update" packages/

# Let's also check the file content to understand the context better
cat packages/renderless/src/tabs/vue.ts

Length of output: 4961


104-105: Verify consistent parameter usage across renderless components

The change from refs to vm as the first parameter in ITabsRenderlessParamUtils might affect other components following similar patterns.

Let's verify the consistency of this change across other renderless components:

packages/renderless/src/recycle-scroller/vue.ts (3)

19-21: LGTM: Import statements are well-structured

The new imports are properly organized and maintain consistency with the existing code structure.


32-33: Verify if 'init' method should be exposed in the API array

The init function is imported and used internally but not exposed in the api array. Consider if this method should be made available to consumers of this component.


38-40: Verify the completeness of the new initialization flow

The watcher for props.items now calls api.init() instead of updateVisibleItems(true). This change in initialization behavior needs verification to ensure all edge cases are handled correctly.

✅ Verification successful

The initialization flow is complete and safe

The change from updateVisibleItems(true) to api.init() is correct because:

  1. The init() function internally calls both resetTemporary() and updateVisibleItems(true) in sequence
  2. resetTemporary() properly initializes all required state before updateVisibleItems is called
  3. The initialization order ensures that the component's internal state is clean before updating visible items
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the implementation of init() to verify it covers all cases
ast-grep --pattern 'function init($_) {
  $$$
}'

# Search for tests related to items initialization
rg -A 5 "describe.*items.*initialization|test.*items.*change" --type=test

Length of output: 155


Script:

#!/bin/bash
# Search for init function implementation with broader pattern and file context
ast-grep --pattern 'init() {
  $$$
}'

# Search for init function with different pattern
ast-grep --pattern 'const init = $_'

# Search for test files with common extensions
rg -A 5 "describe.*items.*initialization|test.*items.*change" -g "*.spec.*" -g "*.test.*"

# Look for the implementation file to understand the full context
fd "recycle-scroller.*\.(ts|js|vue)$"

Length of output: 20989


Script:

#!/bin/bash
# Let's look at the implementation of updateVisibleItems and resetTemporary
ast-grep --pattern 'updateVisibleItems($_) {
  $$$
}'

# Search for resetTemporary implementation
ast-grep --pattern 'resetTemporary($_) {
  $$$
}'

# Look at the content of the recycle-scroller implementation
cat packages/renderless/src/recycle-scroller/index.ts

# Search for any watchers in the file
rg "watch.*items" packages/renderless/src/recycle-scroller/

Length of output: 17756


Script:

#!/bin/bash
# Let's check the vue.ts file specifically for the watcher implementation
cat packages/renderless/src/recycle-scroller/vue.ts

# Search for any other files that might contain the watcher implementation
fd -e ts -e js -e vue "recycle-scroller" --exec grep -l "watch"

Length of output: 3925

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

146-146: LGTM! Good cleanup practice.

Adding the event listener cleanup in onUnmounted is essential to prevent memory leaks and ensure proper component cleanup.

packages/theme-saas/src/form/index.less (1)

168-175: Verify PR classification as bugfix.

The changes appear to be feature enhancements for display-only form elements rather than bug fixes. Consider updating the PR type to "feat" instead of "bugfix" to better reflect the nature of these changes.

packages/vue/src/grid/src/tooltip/src/methods.ts (1)

38-42: Verify tooltip behavior with different title configurations

Please ensure the tooltip behavior is tested with various title configurations:

  1. String-based titles
  2. Function-based titles
  3. Complex content (HTML, components)
  4. Empty/null titles
packages/renderless/src/select-dropdown/vue.ts (1)

123-127: LGTM! The state synchronization logic is well-implemented.

The implementation correctly:

  • Handles multiple select scenarios
  • Creates a defensive copy of the selected values
  • Prevents potential null/undefined errors
🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/theme-saas/src/textarea/index.less (1)

30-34: LGTM! Consistent use of design system color tokens

The disabled state styling properly uses semantic color tokens and handles all necessary states (background, border, text, and placeholder).

packages/renderless/src/tree-menu/index.ts (2)

13-13: LGTM! Good security practice.

Adding XSS filtering for URLs is a crucial security measure.


122-126: Verify the impact on existing URL handling behavior.

This change modifies how URLs are handled in the tree menu. Please ensure that:

  1. Existing URL navigation still works as expected
  2. The node type restrictions don't break any legitimate use cases
✅ Verification successful

Based on the results, I can now generate the final response:

The URL handling changes in tree-menu appear safe and maintain existing behavior

The changes maintain the core URL handling functionality while adding necessary node type restrictions:

  • The URL handling logic remains intact, using xss.filterUrl for security
  • The node type check (e.target.nodeName !== 'A' && e.target.nodeName !== 'SPAN') prevents duplicate navigation when clicking on existing clickable elements
  • The test coverage shows the component is being tested for basic functionality
  • The URL transformation logic (adding '#/' prefix) is preserved in the component
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other URL handling patterns in the codebase
echo "Searching for URL handling patterns..."
rg -l "window\.open|\.url|href" --type ts

# Search for existing tree menu usage
echo "Searching for tree menu usage..."
ast-grep --pattern 'tree-menu' --lang vue

Length of output: 3378


Script:

#!/bin/bash
# Let's analyze the tree-menu implementation and its usage
echo "Checking tree-menu implementation..."
rg -A 5 "currentChange" packages/renderless/src/tree-menu/index.ts

echo -e "\nChecking tree-menu tests..."
fd "tree-menu.*\.(spec|test)\.(ts|tsx|js|jsx)$" -x cat {}

echo -e "\nChecking Vue components using tree-menu..."
rg -l "tree-menu" --type vue

echo -e "\nChecking for URL handling in tree-menu..."
rg "url" -C 3 packages/renderless/src/tree-menu/index.ts

Length of output: 1973

🧰 Tools
🪛 Biome

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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/grid/src/dragger/src/rowDrop.ts (2)

152-152: LGTM! Verify i18n key existence.

The error message change improves clarity and fixes the typo in the key name.

Let's verify the i18n key exists:

✅ Verification successful

i18n key change is properly implemented

The new i18n key notAllowDragFixed is correctly defined in both English and Chinese locale files, and is used consistently in the codebase. The old key dargFixed has been completely removed.

  • Defined in packages/vue-locale/src/lang/en.ts: "Fixed columns cannot be dragged."
  • Defined in packages/vue-locale/src/lang/zh-CN.ts: "固定列不允许拖动"
  • Used in packages/vue/src/grid/src/dragger/src/rowDrop.ts and methods.ts
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the new i18n key definition
rg -g '*.{json,ts,js}' "notAllowDragFixed"

# Search for any remaining instances of the old key
rg -g '*.{json,ts,js}' "dargFixed"

Length of output: 494


79-79: LGTM! Verify i18n key existence.

The error message change improves clarity and fixes the typo in the key name.

Let's verify the i18n key exists:

✅ Verification successful

i18n key verification successful

The new i18n key 'ui.grid.error.notAllowDragSelf' is properly defined in both English and Chinese locale files:

  • packages/vue-locale/src/lang/en.ts: "Self dragging is not allowed."
  • packages/vue-locale/src/lang/zh-CN.ts: "不允许自己给自己拖动"

The old key with the typo 'dargSelf' has been completely removed from the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the new i18n key definition
rg -g '*.{json,ts,js}' "notAllowDragSelf" 

# Search for any remaining instances of the old key
rg -g '*.{json,ts,js}' "dargSelf"

Length of output: 370

packages/renderless/src/rich-text/index.ts (2)

76-76: LGTM: Event listener properly integrated

The click event listener is correctly added after Quill initialization and core event setup.


269-269: LGTM: Proper event listener cleanup

The click event listener is correctly removed during component cleanup, preventing memory leaks.

packages/renderless/src/transfer/index.ts (2)

282-286: LGTM! Clear directional comments.

The added comments clearly indicate the drag direction, improving code readability and maintainability.


Line range hint 228-286: Add tests for the filtering functionality during drag-and-drop.

The changes look good, but according to the PR checklist, tests haven't been added. Please add tests to verify:

  1. Filtering behavior during drag operations
  2. Correct handling of checked items
  3. Edge cases with empty or partially filtered data

Would you like help creating test cases for these scenarios?

packages/theme-saas/src/select/index.less (2)

192-199: LGTM: Proper fix for tags layout issues

The new __tags-panel class implementation correctly addresses tag layout issues by:

  1. Using flex layout for proper tag alignment
  2. Extending width slightly beyond parent to accommodate all tags
  3. Preventing the last tag from shrinking, ensuring consistent tag display

201-203: LGTM: Clean semantic implementation

The __tags-content class uses display: contents appropriately to maintain semantic structure while avoiding unnecessary DOM nesting that could interfere with the flex layout.

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

Line range hint 269-290: LGTM: Improved component cleanup with proper event handler removal.

The function has been correctly renamed from beforeDistory to beforeDestroy and includes thorough cleanup of DOM event listeners. The implementation follows Vue.js best practices for component cleanup.


Line range hint 269-294: LGTM: Symmetrical event handling implementation.

The cleanup in beforeDestroy perfectly mirrors the event setup in mounted, ensuring all event listeners are properly registered and cleaned up during the component lifecycle. This is a robust implementation that prevents memory leaks.


291-294: Verify event handler registration.

The added cleanup code removes Vue event listeners, which is good. Let's verify that these events are properly registered elsewhere to ensure we're not removing non-existent listeners.

✅ Verification successful

Event handlers are properly registered and cleaned up

After reviewing the dropdown component's source code, I can confirm that all the event handlers being removed in the cleanup code are properly registered in the mounted lifecycle hook:

mounted = () => {
  vm.$on('menu-item-click', api.handleMenuItemClick)
  vm.$on('current-item-click', api.handleMenuItemClick)
  vm.$on('selected-index', (selectedIndex) => {
    broadcast('TinyDropdownMenu', 'menu-selected-index', selectedIndex)
  })
  vm.$on('is-disabled', api.clickOutside)
}

The cleanup in beforeDistory correctly removes all the event listeners that were set up during component initialization. This is proper event handling hygiene in Vue components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for event registration of the removed listeners
# Expected: Find corresponding $on calls for each $off

echo "Searching for event registrations..."
rg -A 2 "\$on\('(menu-item-click|current-item-click|selected-index|is-disabled)'" 

echo "Verifying the events are used in the codebase..."
rg "emit\('(menu-item-click|current-item-click|selected-index|is-disabled)'"

Length of output: 363


Script:

#!/bin/bash
# Let's try a broader search to understand the event handling patterns
# First, let's look at the dropdown component's content
echo "Content of dropdown component:"
cat packages/renderless/src/dropdown/index.ts

# Then search for any event-related patterns in the file
echo -e "\nSearching for event patterns in dropdown:"
rg -i "(\$on|\$emit|\$off).*'.*'" packages/renderless/src/dropdown/index.ts

Length of output: 9563

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

Line range hint 1-412: Add tests for the new computed properties

According to the PR objectives, tests have not been added for these changes. Since this is marked as a bugfix, it's important to add tests to prevent regression.

Please add tests for:

  1. computedExpandIcon with various design configurations
  2. computedIndent with different node levels and showLine settings

Would you like assistance in generating the test cases?

packages/vue/src/date-panel/src/pc.vue (1)

216-217: Good optimization: Switching to v-if improves performance

The change from v-show to v-if for the footer is a good optimization that will reduce memory usage and initial render time by completely removing the footer element from the DOM when not needed, rather than just hiding it.

Let's verify if there are any component state or event handlers that might be affected by the footer being unmounted:

✅ Verification successful

Switching to v-if is safe and improves performance

Based on the verification results:

  • The isShowFooter state is computed based on footerVisible and currentView states
  • The footer only contains simple button elements without complex state
  • A watcher on isShowFooter only updates the popper position
  • No complex event handlers or state management tied to the footer's lifecycle

The change from v-show to v-if is safe and beneficial as it:

  1. Reduces memory usage by removing unused DOM elements
  2. Improves initial render performance
  3. Won't affect component state or event handling
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any state management or event handlers related to the footer
# that might be affected by the v-if change

# Search for any state updates or event handlers related to the footer
rg -A 5 "isShowFooter|tiny-picker-panel__footer" --type vue

# Search for any component lifecycle hooks that might interact with the footer
ast-grep --pattern 'mounted() {
  $$$
}'

Length of output: 132


Script:

#!/bin/bash
# Let's try different approaches to find footer-related code

# Search for footer-related code without file type restriction
rg -A 5 "isShowFooter|tiny-picker-panel__footer"

# Search for mounted hook using a more specific pattern
ast-grep --pattern 'export default {
  $$$
  mounted() {
    $$$
  }
  $$$
}'

# Search for any footer-related event handlers
rg -A 5 "@click.*footer|footer.*@click"

# Search for state initialization
rg "isShowFooter.*=|state.*isShowFooter"

Length of output: 4905

packages/renderless/src/date-picker-mobile/index.ts (3)

102-107: LGTM! Good optimization

The change from map to forEach is appropriate since the operations are performed for side effects and the return values weren't being used. This improves code clarity and slightly reduces memory usage by not creating unnecessary intermediate arrays.


393-401: LGTM! Clean formatting

The formatting changes improve readability while maintaining the correct logic flow for resetting dates and emitting events.


66-66: Verify month calculation logic

The month calculation differs based on the direction parameter. Please ensure this doesn't cause off-by-one errors when transitioning between months, especially for edge cases like December to January.

✅ Verification successful

Let me gather more context about the date handling in this component to understand the month calculation logic better.


Month calculation logic is correct

The month calculation in getDateFromStr is correct and intentional. Here's why:

  • When creating a Date object in JavaScript, months are 0-based (0-11)
  • The function handles two scenarios:
    • For 'top' direction: Subtracts 1 from the month (arr[1] - 1) to convert from human-readable format (1-12) to JavaScript's 0-based months
    • For other directions: Uses arr[1] directly because the input is already in 0-based format
  • This aligns with the usage in initPanel where months are consistently handled with the same convention (e.g., new Date(year, month - 1, 1) for human-readable months)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for all usages of getDateFromStr to understand the impact
# of direction parameter on month calculation

# Search for function calls
rg "getDateFromStr\(" -A 3

# Search for the function definition and its usages
ast-grep --pattern 'const getDateFromStr = $_'

Length of output: 944


Script:

#!/bin/bash
# Search for all date-related operations and month handling in the file
rg "new Date\(" -A 2 packages/renderless/src/date-picker-mobile/index.ts

# Search for any other functions that might be using or affecting the month value
rg "month" -A 2 packages/renderless/src/date-picker-mobile/index.ts

# Search for the initPanel function to understand how the date is used
ast-grep --pattern 'const initPanel = $_'

Length of output: 7497

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

369-369: Verify the 'drag-over' event registration

While removing the event listener is good practice for cleanup, we should ensure proper event registration and consistent naming.

Let's verify the event registration and naming convention:

✅ Verification successful

Let me gather more specific information about the drag-over event handling in the file-upload component.


Event registration and cleanup are properly implemented

The 'drag-over' event is correctly registered in packages/renderless/src/file-upload/index.ts within the mounted lifecycle hook:

vm.$on('drag-over', (isDragover) => (state.isDragover = isDragover))

And properly cleaned up in packages/renderless/src/file-upload/vue.ts during component unmount:

vm.$off('drag-over')

The event handling and state management are consistent, with the event using kebab-case ('drag-over') for Vue events as per Vue.js conventions, while using camelCase for the state property ('dragOver') as per JavaScript conventions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for drag-over event registration and related drag-and-drop functionality

# Check for drag-over event registration
echo "Searching for drag-over event registration..."
rg -l "drag-over|dragOver" --type ts

# Check for drag event handling patterns
echo "Checking drag event handling patterns..."
ast-grep --pattern 'vm.$on("drag-over", $_)'

Length of output: 894


Script:

#!/bin/bash
# Search for drag-over related code in file-upload files
echo "Searching file-upload files for drag-over handling..."
rg "drag-over" -A 5 -B 5 packages/renderless/src/file-upload/

# Check for $on registration specifically in file-upload
echo "Checking vue.ts for event registration..."
rg "\$on.*drag-over" packages/renderless/src/file-upload/

# Look for dragOver state management
echo "Checking dragOver state handling..."
rg "dragOver" -A 5 -B 5 packages/renderless/src/file-upload/

Length of output: 2706

packages/renderless/src/form-item/index.ts (1)

279-279: LGTM: Good cleanup practice!

Adding event cleanup in the unmounted hook is a good practice to prevent memory leaks.

packages/vue/src/grid/src/grid/grid.ts (1)

184-186: 🛠️ Refactor suggestion

Improve code safety and clarity in seqIndex computation

  1. Use optional chaining to safely access properties
  2. Rename oldPage to better reflect its purpose (e.g., stablePagerConfig)
  3. Consider adding type safety for destructured properties
- let { seqSerial, scrollLoad, pagerConfig: oldPage, startIndex, tablePageLoading, realTimeTablePage } = this
- let seqIndexValue = startIndex
- const pagerConfig = tablePageLoading ? realTimeTablePage : oldPage
+ const { 
+   seqSerial, 
+   scrollLoad, 
+   pagerConfig: stablePagerConfig, 
+   startIndex = 0, 
+   tablePageLoading, 
+   realTimeTablePage 
+ } = this
+ let seqIndexValue = startIndex
+ const pagerConfig = tablePageLoading ? realTimeTablePage : stablePagerConfig

Let's verify the usage of these pagination properties:

🧰 Tools
🪛 Biome

[error] 184-185: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


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

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

packages/vue/src/huicharts/huicharts-core/src/chart-core.ts (2)

29-29: LGTM: Improved naming and consistent default function syntax

The renaming from option to huiChartOption provides better context, and the default function syntax is now more consistent.

Also applies to: 75-75, 132-132


337-377: LGTM: Consistent use of huiChartOption across methods

The methods have been updated consistently to use huiChartOption, improving code clarity and maintainability.

Also applies to: 389-429

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

Line range hint 286-292: LGTM! Verify display-only mode behavior.

The addition of state.isDisplayOnly check is a logical improvement that prevents unnecessary resizing calculations in display-only mode while still maintaining minimum height for layout consistency.

Let's verify the display-only mode behavior:

✅ Verification successful

The display-only mode behavior is properly implemented and tested

The verification shows that:

  1. The isDisplayOnly state is properly integrated into the textarea's resize logic
  2. There are comprehensive tests in resize.spec.ts that verify textarea behavior in display-only mode
  3. The implementation correctly handles display-only mode across multiple scenarios:
    • Prevents resizing when in display-only mode
    • Maintains minimum height calculations for layout consistency
    • Properly integrates with hover expand functionality
    • Handles form-level display-only state
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any existing tests or usages of display-only mode with textarea
# to ensure this change doesn't introduce regressions

# Search for test files related to textarea display-only mode
fd -e spec.ts -e spec.js -e test.ts -e test.js | xargs rg -l "textarea.*display.*only|display.*only.*textarea"

# Search for component files using textarea in display-only mode
rg -l "textarea.*display.*only|display.*only.*textarea" --type vue

Length of output: 305


Script:

#!/bin/bash
# Let's examine the test files found and check for any display-only mode tests
rg -A 5 -B 5 "textarea|display.*only" examples/sites/demos/pc/app/input/rows.spec.ts examples/sites/demos/pc/app/input/resize.spec.ts

# Let's also check the implementation and usage of isDisplayOnly in the input component
rg -A 5 -B 5 "isDisplayOnly" packages/renderless/src/input/

# Search for any Vue files with .vue extension explicitly
fd -e vue | xargs rg -l "textarea.*display.*only|display.*only.*textarea"

Length of output: 12540

packages/renderless/src/recycle-scroller/index.ts (5)

37-42: LGTM: Clean initialization function

The function follows a clear sequence: reset temporary state before updating visible items.


169-172: LGTM: Improved variable naming

The rename from bounds to boundRect better describes the variable's content (DOMRect from getBoundingClientRect).


197-202: LGTM: Clean destructuring syntax

Good use of object destructuring for cleaner code.


423-440: LGTM: Greatly improved variable naming

The variable renames make the binary search algorithm much more readable and self-documenting.


631-643: LGTM: Clean state reset implementation

The function properly initializes all temporary state properties with appropriate default values.

packages/vue-locale/src/lang/zh-CN.ts (2)

13-13: LGTM! Translation update looks good.

The translation of 'en-US' to '英语' is accurate and consistent with Chinese localization standards.


362-363: LGTM! Improved error message keys.

The renaming from 'darg*' to 'notAllowDrag*' is a good improvement:

  1. Fixes the typo in the original keys ('darg' → 'drag')
  2. More descriptive naming that better reflects the error conditions

Let's verify that all references to these error messages have been updated:

✅ Verification successful

All references to the error messages have been properly updated

The verification shows that:

  1. No instances of the old keys (dargSelf, dargFixed) exist in the codebase
  2. The new keys (notAllowDragSelf, notAllowDragFixed) are consistently used across:
    • Translation files (en.ts, zh-CN.ts)
    • Implementation files (rowDrop.ts, methods.ts) using GlobalConfig.i18n()
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of the old keys
rg "dargSelf|dargFixed" --type ts

# Search for usage of new keys to ensure they're properly referenced
rg "notAllowDragSelf|notAllowDragFixed" --type ts

Length of output: 799

packages/vue-locale/src/lang/en.ts (4)

70-75: LGTM! Consistent terminology in numeric comparisons.

The translations maintain consistency by using "Greater than" instead of "More than" and "Null" instead of "Empty", which aligns better with database and programming terminology.


242-250: LGTM! Clear hierarchical department naming.

The department level translations are clear and consistent, following a logical numbering pattern.


805-861: LGTM! Clear validation messages.

The validation messages are clear, specific, and provide good guidance to users. They follow a consistent pattern and include proper placeholders for dynamic values.


145-169: ⚠️ Potential issue

Inconsistency in month abbreviations.

There's an inconsistency between the abbreviated months in different sections of the code. For example, 'September' is abbreviated as both 'Sep' and 'Sept'.

Apply this diff to maintain consistency:

      month9: 'Sep',
      months: {
-       sep: 'September',
+       sep: 'Sep',

Likely invalid or redundant comment.

packages/vue/src/grid/src/body/src/body.tsx (1)

137-138: LGTM: Improved null safety for dropConfig

The defensive programming approach using default empty object for dropConfig prevents potential runtime errors.

packages/vue/src/grid/src/table/src/methods.ts (3)

28-28: LGTM! Good practice using dedicated type checking.

The addition of isNull import from type utilities improves type checking consistency.


382-383: LGTM! More explicit null checking.

The change from falsy check to explicit isNull check improves the robustness of rowId validation. This prevents potential issues where valid falsy values (like 0) could be incorrectly treated as invalid rowIds.


499-501: LGTM! Consistent null checking pattern.

The change to use isNull maintains consistency with other null checks in the codebase and improves type safety.

packages/renderless/src/select/vue.ts (4)

116-116: Correct Import of useUserAgent

The useUserAgent hook is correctly imported from '../common/deps/useUserAgent'.


253-253: Proper Use of useUserAgent Hook

Destructuring isIOS from useUserAgent() ensures that the component accurately detects iOS devices.


308-308: Including isIOS in Component State

Adding isIOS to the reactive state allows the component to conditionally handle iOS-specific behavior.


66-66: Integration of onMouseenterSelf Method

The onMouseenterSelf method is properly:

  • Imported and included in the dependencies.
  • Added to the api array for exposure.
  • Initialized in initApi, ensuring availability within the component's API.

Also applies to: 170-170, 377-377

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

18-18: Imported 'correctTarget' module is appropriately added

The correctTarget function is correctly imported from '../common/event' and is used later in the code.


206-206: Prevent unnecessary input adjustments when select is disabled

The added condition !state.selectDisabled ensures that input adjustments are skipped when the select component is disabled, which prevents unnecessary computations.


337-342: Update 'currentLabel' to prefer 'props.textField'

The return statements now assign currentLabel using option[props.textField] || option.currentLabel, ensuring that the label reflects the correct text field when available.


363-367: Handle 'isFakeLabel' correctly in option selection

The conditions now check for !state.selected.isFakeLabel, ensuring that fake labels are appropriately handled and do not interfere with the selection logic.


460-461: Set default checked keys for tree selection

The code now properly sets state.defaultCheckedKeys when props.treeOp.showRadio is true, ensuring the correct node is selected in tree structures.


599-613: Confirm safe manipulation of 'event.target' after 'correctTarget'

The code modifies event.target after calling correctTarget(event, target). Ensure that this manipulation does not introduce unintended side effects and that event remains consistent throughout the application.

You can verify that correctTarget properly adjusts the event object without causing issues elsewhere in the code.


1657-1660: Focus input after selection in filterable multiple select

The addition of focusing the input after changing selection improves user experience by allowing continuous input in a filterable and multiple select component.


2461-2461: Ensure proper debounce implementation in 'handleDebouncedQueryChange'

The debounce function wraps api.handleQueryChange(value, false, true). Verify that the debounce period defined by state.debounce is appropriate and that it effectively reduces unnecessary calls without impacting responsiveness.


2055-2055: Initialize 'defaultCheckedKeys' correctly based on 'props.multiple'

The assignment of state.defaultCheckedKeys now considers whether props.multiple is true, ensuring that the default checked keys are set appropriately for multiple selections.


923-927: Review iOS-specific conditions and 'state.isIOS' usage

Several code segments introduce conditions based on state.isIOS to handle iOS-specific behavior:

  • Line 923-927: Toggles state.selectHover and state.inputHovering when on iOS.
  • Line 1866-1868: Adjusts state.inputHovering based on iOS detection.
  • Line 1875-1883: Modifies onMouseenterSelf behavior for iOS.
  • Line 2263-2274: Alters the computed readonly property for iOS devices.

Ensure that state.isIOS is correctly defined and initialized, and that these platform-specific adjustments are necessary. Also, confirm that they do not adversely affect the functionality on other platforms.

Check where state.isIOS is set and ensure it's accurate:

#!/bin/bash
# Description: Find where 'state.isIOS' is defined and initialized

rg 'state\.isIOS\s*=' ./packages

Also applies to: 1866-1868, 1875-1883, 2263-2274


130-132: Ensure 'escapeRegexpString' safely escapes user input

When creating a regular expression with user input, it's crucial to escape special characters to prevent regex injection attacks. Verify that escapeRegexpString properly escapes all special regex characters.

You can confirm the implementation of escapeRegexpString with the following script:

✅ Verification successful

✓ The escapeRegexpString implementation is secure

The implementation at packages/renderless/src/option/index.ts properly escapes all special regex characters (|\\{}()[\]^$+*?.) by replacing them with their escaped counterparts using \\$&. This is the standard and secure way to escape user input for use in regular expressions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of 'escapeRegexpString'

rg 'export\s+const\s+escapeRegexpString\s*=' ./packages

Length of output: 128


Script:

#!/bin/bash
# Let's try different search patterns to locate escapeRegexpString
rg -g '*.{ts,js}' 'escapeRegexpString' ./packages

# Also search for the function definition using ast-grep
ast-grep --pattern 'const escapeRegexpString = $_'

Length of output: 864

Comment on lines +6 to 8
computedTreeMaxHeight() {
state.treeWrapperMaxHeight = ''
}
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 computed property to follow Vue.js best practices

The current implementation has several issues:

  1. The method name suggests it's a computed property (computedTreeMaxHeight), but it's mutating state instead of returning a value
  2. The state modification from 'auto' to '' is redundant as both values result in the same behavior
  3. TypeScript types are missing

Consider refactoring to:

export default {
  renderless: (props, hooks, { emit }, api) => {
    const state = api.state

    return {
-      computedTreeMaxHeight() {
-        state.treeWrapperMaxHeight = ''
-      }
+      computedTreeMaxHeight(): string {
+        return state.treeWrapperMaxHeight || 'auto'
+      },
+      setTreeMaxHeight(value: string): void {
+        state.treeWrapperMaxHeight = value
+      }
    }
  }
}

This refactor:

  • Separates the computed property from state mutation
  • Adds proper TypeScript types
  • Maintains the same functionality while following Vue.js conventions
📝 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
computedTreeMaxHeight() {
state.treeWrapperMaxHeight = ''
}
export default {
renderless: (props, hooks, { emit }, api) => {
const state = api.state
return {
computedTreeMaxHeight(): string {
return state.treeWrapperMaxHeight || 'auto'
},
setTreeMaxHeight(value: string): void {
state.treeWrapperMaxHeight = value
}
}
}
}

Comment on lines +5 to +12
return (
window.navigator &&
window.navigator.userAgent &&
(/iP(?:ad|hone|od)/.test(window.navigator.userAgent) ||
// The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.
// https://github.com/vueuse/vueuse/issues/3577
(window.navigator.maxTouchPoints > 2 && /iPad|Macintosh/.test(window.navigator.userAgent)))
)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance safety and performance of iOS detection.

The current implementation could benefit from the following improvements:

  1. Use optional chaining for safer property access
  2. Pre-compile regex patterns for better performance

Consider applying these changes:

+const IOS_DEVICE_PATTERN = /iP(?:ad|hone|od)/
+const IPAD_MAC_PATTERN = /iPad|Macintosh/
+
 function getIsIOS() {
   if (isServer) return false
   return (
-    window.navigator &&
-    window.navigator.userAgent &&
-    (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) ||
+    window.navigator?.userAgent &&
+    (IOS_DEVICE_PATTERN.test(window.navigator.userAgent) ||
       // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.
       // https://github.com/vueuse/vueuse/issues/3577
-      (window.navigator.maxTouchPoints > 2 && /iPad|Macintosh/.test(window.navigator.userAgent)))
+      (window.navigator?.maxTouchPoints > 2 && IPAD_MAC_PATTERN.test(window.navigator.userAgent)))
   )
 }
📝 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
return (
window.navigator &&
window.navigator.userAgent &&
(/iP(?:ad|hone|od)/.test(window.navigator.userAgent) ||
// The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.
// https://github.com/vueuse/vueuse/issues/3577
(window.navigator.maxTouchPoints > 2 && /iPad|Macintosh/.test(window.navigator.userAgent)))
)
const IOS_DEVICE_PATTERN = /iP(?:ad|hone|od)/
const IPAD_MAC_PATTERN = /iPad|Macintosh/
return (
window.navigator?.userAgent &&
(IOS_DEVICE_PATTERN.test(window.navigator.userAgent) ||
// The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.
// https://github.com/vueuse/vueuse/issues/3577
(window.navigator?.maxTouchPoints > 2 && IPAD_MAC_PATTERN.test(window.navigator.userAgent)))
)
🧰 Tools
🪛 Biome

[error] 6-7: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

@@ -24,7 +24,7 @@ export default {
legendVisible: this.legendVisible,
tooltipVisible: this.tooltipVisible
}
this.option = getIChartOption(columns, rows, this.settings, extra)
this.huiChartOption = getIChartOption(columns, rows, this.settings, extra)
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Property rename needs to be completed across remaining components

The verification reveals inconsistent property naming across the Huicharts components. While many components have adopted huiChartOption, there are still several components using the old option property:

  • packages/vue/src/huicharts/huicharts-process/src/chart-process.vue
  • packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue
  • packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue

The core implementation in chart-core.ts shows that huiChartOption is the standardized property name used throughout the core functionality, including initialization, updates, and rendering. For consistency, the remaining components should also be updated to use huiChartOption.

🔗 Analysis chain

LGTM! Property rename improves naming clarity.

The rename from option to huiChartOption better indicates the property's association with the Huicharts framework and aligns with similar changes across the codebase.

Let's verify this property's usage in related files:


Let's examine the core file to understand the property's usage pattern since we found both option and huiChartOption references in core files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to the old property name and verify consistency of the new name

# Search for any remaining references to the old property name in Huicharts components
echo "Checking for remaining 'option' references in Huicharts components..."
rg -l "this\.option" "packages/vue/src/huicharts"

# Verify consistent usage of the new property name
echo "Verifying consistent usage of 'huiChartOption'..."
rg -l "this\.huiChartOption" "packages/vue/src/huicharts"

Length of output: 2236


Script:

#!/bin/bash
# Check the implementation in core file to understand the property usage
echo "Examining core implementation..."
rg "this\.option" packages/vue/src/huicharts/huicharts-core/src/chart-core.ts -B 2 -A 2

echo -e "\nExamining huiChartOption usage in core..."
rg "this\.huiChartOption" packages/vue/src/huicharts/huicharts-core/src/chart-core.ts -B 2 -A 2

Length of output: 1932

Comment on lines +30 to 32
this.huiChartOption = {
...option
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Property renaming is inconsistent across the codebase

The verification reveals that while huiChartOption is consistently used as the target property, there are still references to this.options (plural) in several components that assign to huiChartOption:

  • packages/vue/src/huicharts/huicharts-process/src/chart-process.vue
  • packages/vue/src/huicharts/huicharts-core/src/chart-core.ts
  • packages/vue/src/huicharts/huicharts-bmap/src/baidu-map.vue
  • packages/vue/src/huicharts/huicharts-amap/src/autonavi-map.vue

This suggests that the renaming effort is incomplete, as some components are using options while others use option (singular) as the source property.

🔗 Analysis chain

Property renaming looks good, but needs verification and documentation.

The renaming from this.option to this.huiChartOption improves clarity and aligns with the naming convention across other chart components.

Let's verify the consistency of this change across the codebase:

Since this is a property renaming that could affect consumers of the component, please ensure this change is documented in:

  1. Component documentation
  2. Migration guide (if this is a breaking change)
  3. Changelog
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of the old property name and verify the new naming convention

# Check for any remaining references to the old property name in chart components
echo "Checking for remaining 'this.option' references in chart components..."
rg "this\.option" "packages/vue/src/huicharts"

# Verify consistent usage of the new property name
echo "Verifying consistent usage of 'huiChartOption'..."
rg "this\.huiChartOption" "packages/vue/src/huicharts"

Length of output: 6272

Comment on lines +34 to 37
this.huiChartOption = {
smooth: true,
...option
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix state management inconsistency

The code attempts to set huiChartOption but this property isn't declared in the component's data(). This mismatch between declared and used properties could lead to reactivity issues in Vue.

Apply this diff to ensure consistent state management:

  data() {
    return {
      iChartName: 'BarChart',
-     option: {}
+     huiChartOption: {}
    }
  }

Committable suggestion skipped: line range outside the PR's diff.


i < 0 && (i = 0)
cursor < 0 && (cursor = 0)
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix assignment in expression

The assignment in the condition is flagged as a potential source of confusion.

-  cursor < 0 && (cursor = 0)
+  if (cursor < 0) {
+    cursor = 0
+  }
📝 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
cursor < 0 && (cursor = 0)
if (cursor < 0) {
cursor = 0
}
🧰 Tools
🪛 Biome

[error] 442-442: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Comment on lines +349 to +375
delRevert: 'The <strong>revert</strong> method has been deprecated. Use <strong>revertData</strong> instead.',
groupFixed: 'If you want to use grouping headers, place the fixed columns on the left and right sides.',
notDelete: 'The <strong>delete</strong> method does not exist.',
notQuery: 'The <strong>query</strong> method does not exist.',
notResizable: 'Horizontal virtual scrolling cannot be resized.',
notSave: 'The <strong>save</strong> method does not exist.',
reqModule: 'The module {{name}} is missing.',
rowIdEmpty: 'The <strong>row-id</strong> parameter is required.',
scrollYHeight: 'The height or max-height must be specified before enabling virtual scrolling.',
toolbarId: 'A unique ID is required for the toolbar.',
treeFixedExpand: 'The fixed column conflicts with row expansion in the tree structure.',
treeInsert: 'The tree structure does not support the <strong>insert</strong> operation.',
treeRemove: 'The tree structure does not support the <strong>remove</strong> operation.',
unableInsert: 'Unable to insert data to the specified location.',
notAllowDragSelf: 'Self dragging is not allowed.',
notAllowDragFixed: 'Fixed columns cannot be dragged.',
remoteMethod:
'The <strong>multipleHistory.remoteSelectedMethod</strong> must be set for the remote storage of personalized template management.',
remoteSelectedMethod:
'"remoteSelectedMethod" needs to be set for remote storage for personalized template management.',
chainCallError: 'There is a syntax error in the default slot for the column, please check.',
renderParamError: 'Expect to configure a rendering method for generating a VNode.',
classComponentError: 'Class component rendering error.',
groupColumnFixedError: 'Different fixed types cannot be set in the same group.',
chainCallError: 'There are syntax errors in the default slot.',
renderParamError: 'A rendering method is required for generating VNode.',
classComponentError: 'There was an error in the class component rendering.',
groupColumnFixedError: 'Each group must have the same type.',
missingValueFormat:
'The renderer cannot format the date string. You should provide the "valueFormat" source date format configuration.',
clipboardWriteError: 'clipboard write error'
'The renderer cannot format the date character string. The valueFormat source date format is required.',
clipboardWriteError: 'Clipboard write error.'
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve error message clarity.

Some error messages could be more user-friendly and clearer.

Apply these improvements:

-        delRevert: 'The <strong>revert</strong> method has been deprecated. Use <strong>revertData</strong> instead.',
+        delRevert: 'The revert method is deprecated. Please use revertData instead.',
-        notResizable: 'Horizontal virtual scrolling cannot be resized.',
+        notResizable: 'Column width cannot be adjusted when horizontal virtual scrolling is enabled.',
📝 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
delRevert: 'The <strong>revert</strong> method has been deprecated. Use <strong>revertData</strong> instead.',
groupFixed: 'If you want to use grouping headers, place the fixed columns on the left and right sides.',
notDelete: 'The <strong>delete</strong> method does not exist.',
notQuery: 'The <strong>query</strong> method does not exist.',
notResizable: 'Horizontal virtual scrolling cannot be resized.',
notSave: 'The <strong>save</strong> method does not exist.',
reqModule: 'The module {{name}} is missing.',
rowIdEmpty: 'The <strong>row-id</strong> parameter is required.',
scrollYHeight: 'The height or max-height must be specified before enabling virtual scrolling.',
toolbarId: 'A unique ID is required for the toolbar.',
treeFixedExpand: 'The fixed column conflicts with row expansion in the tree structure.',
treeInsert: 'The tree structure does not support the <strong>insert</strong> operation.',
treeRemove: 'The tree structure does not support the <strong>remove</strong> operation.',
unableInsert: 'Unable to insert data to the specified location.',
notAllowDragSelf: 'Self dragging is not allowed.',
notAllowDragFixed: 'Fixed columns cannot be dragged.',
remoteMethod:
'The <strong>multipleHistory.remoteSelectedMethod</strong> must be set for the remote storage of personalized template management.',
remoteSelectedMethod:
'"remoteSelectedMethod" needs to be set for remote storage for personalized template management.',
chainCallError: 'There is a syntax error in the default slot for the column, please check.',
renderParamError: 'Expect to configure a rendering method for generating a VNode.',
classComponentError: 'Class component rendering error.',
groupColumnFixedError: 'Different fixed types cannot be set in the same group.',
chainCallError: 'There are syntax errors in the default slot.',
renderParamError: 'A rendering method is required for generating VNode.',
classComponentError: 'There was an error in the class component rendering.',
groupColumnFixedError: 'Each group must have the same type.',
missingValueFormat:
'The renderer cannot format the date string. You should provide the "valueFormat" source date format configuration.',
clipboardWriteError: 'clipboard write error'
'The renderer cannot format the date character string. The valueFormat source date format is required.',
clipboardWriteError: 'Clipboard write error.'
delRevert: 'The revert method is deprecated. Please use revertData instead.',
groupFixed: 'If you want to use grouping headers, place the fixed columns on the left and right sides.',
notDelete: 'The <strong>delete</strong> method does not exist.',
notQuery: 'The <strong>query</strong> method does not exist.',
notResizable: 'Column width cannot be adjusted when horizontal virtual scrolling is enabled.',
notSave: 'The <strong>save</strong> method does not exist.',
reqModule: 'The module {{name}} is missing.',
rowIdEmpty: 'The <strong>row-id</strong> parameter is required.',
scrollYHeight: 'The height or max-height must be specified before enabling virtual scrolling.',
toolbarId: 'A unique ID is required for the toolbar.',
treeFixedExpand: 'The fixed column conflicts with row expansion in the tree structure.',
treeInsert: 'The tree structure does not support the <strong>insert</strong> operation.',
treeRemove: 'The tree structure does not support the <strong>remove</strong> operation.',
unableInsert: 'Unable to insert data to the specified location.',
notAllowDragSelf: 'Self dragging is not allowed.',
notAllowDragFixed: 'Fixed columns cannot be dragged.',
remoteMethod:
'The <strong>multipleHistory.remoteSelectedMethod</strong> must be set for the remote storage of personalized template management.',
remoteSelectedMethod:
'"remoteSelectedMethod" needs to be set for remote storage for personalized template management.',
chainCallError: 'There are syntax errors in the default slot.',
renderParamError: 'A rendering method is required for generating VNode.',
classComponentError: 'There was an error in the class component rendering.',
groupColumnFixedError: 'Each group must have the same type.',
missingValueFormat:
'The renderer cannot format the date character string. The valueFormat source date format is required.',
clipboardWriteError: 'Clipboard write error.'

@@ -95,6 +95,7 @@
-moz-tab-size: 4;
@apply text-left;
@apply whitespace-pre-wrap;
white-space-collapse: preserve-breaks;
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 using well-supported alternatives for whitespace handling.

The white-space-collapse: preserve-breaks; property is experimental and has limited browser support, which could lead to inconsistent behavior across different browsers.

Consider using these well-supported alternatives:

-  white-space-collapse: preserve-breaks;
+  /* Option 1: Use existing white-space property */
+  white-space: pre-line; /* preserves line breaks, collapses other whitespace */
+  
+  /* Option 2: Keep existing white-space: pre-wrap which is already defined above */

Both options provide better browser compatibility while achieving similar whitespace handling behavior.

📝 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
white-space-collapse: preserve-breaks;
white-space: pre-line; /* preserves line breaks, collapses other whitespace */

@@ -105,7 +105,7 @@ function mergeTreeConfig(_vm) {
const renderEmptyPartFn = (opt) => {
const { _vm, tableData } = opt
const { $grid = {}, renderEmpty } = _vm
const { $slots } = $grid
const { slots } = $grid
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 null checks for slot access.

The change from $slots to $grid.slots could lead to runtime errors if $grid is undefined or doesn't have slots. Consider adding null checks:

-  const { slots } = $grid
+  const slots = $grid?.slots || {}

Also applies to: 117-117

Comment on lines +93 to +96
this.handleFetch('query').then(() => {
this.realTimeTablePage = { ...this.tablePage }
this.tablePageLoading = false
})
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 loading state is reset on fetch errors to prevent loading indicator hang

Currently, if handleFetch('query') fails, this.tablePageLoading remains true, causing the loading indicator to hang indefinitely. To prevent this, add error handling to reset this.tablePageLoading to false in case of errors.

Apply this diff to handle errors and ensure the loading state is always reset:

 this.handleFetch('query').then(() => {
   this.realTimeTablePage = { ...this.tablePage }
   this.tablePageLoading = false
+ }).catch(() => {
+   this.tablePageLoading = false
+ })
📝 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
this.handleFetch('query').then(() => {
this.realTimeTablePage = { ...this.tablePage }
this.tablePageLoading = false
})
this.handleFetch('query').then(() => {
this.realTimeTablePage = { ...this.tablePage }
this.tablePageLoading = false
}).catch(() => {
this.tablePageLoading = false
})

@zzcr zzcr merged commit 5a83b55 into dev Nov 19, 2024
12 of 14 checks passed
@kagol kagol removed the enhancement New feature or request label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants