Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('dialogSelect 设置多选状态', async ({ page }) => {
const trs = await page.locator('.tiny-grid table tbody tr').all()
for (let i = 0; i < trs.length; i++) {
const classes = await trs[i].getAttribute('class')
if (i === 1) {
if (i <= 1) {
expect(classes?.includes('row__selected')).toBeTruthy()
} else {
expect(classes?.includes('row__selected')).toBeFalsy()
Expand Down
19 changes: 19 additions & 0 deletions packages/renderless/types/grid.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export interface IGridEvent {
selectAll: Function
}
Comment on lines +1 to +3
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Avoid Function type; use a concrete handler signature (or unknown args) and make it optional.

Improves type-safety and DX.

 export interface IGridEvent {
-  selectAll: Function
+  // TODO: refine args once confirmed (e.g., (checked: boolean) => void)
+  selectAll?: (...args: unknown[]) => void
 }

If selectAll is (checked: boolean) => void, confirm and we’ll lock that in.


🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "PWD: $(pwd)"
echo "--- rg version ---"
rg --version 2>/dev/null || true

echo
echo "--- Search for IGridEvent ---"
rg -n --hidden --no-ignore -S '\bIGridEvent\b' -C3 || true

echo
echo "--- Show packages/renderless/types/grid.type.ts (if present) ---"
if [ -f packages/renderless/types/grid.type.ts ]; then
  sed -n '1,240p' packages/renderless/types/grid.type.ts
else
  echo "packages/renderless/types/grid.type.ts not found"
fi

echo
echo "--- Search for 'selectAll' occurrences ---"
rg -n --hidden --no-ignore -S '\bselectAll\b' -C3 || true

echo
echo "--- Search for '.selectAll(' invocations ---"
rg -n --hidden --no-ignore -S '\.selectAll\s*\(' -C2 || true

echo
echo "--- Search for property assignments like 'selectAll: (...) =>', 'selectAll: function' ---"
rg -n --hidden --no-ignore -S 'selectAll\s*:\s*(async\s*)?(\(?\s*[A-Za-z0-9_,\s]*\)?\s*=>|function)' -C3 || true

echo
echo "--- Search for emit/on patterns using literal 'selectAll' ---"
rg -n --hidden --no-ignore -S "emit('selectAll" -C2 || true
rg -n --hidden --no-ignore -S 'emit(\"selectAll' -C2 || true
rg -n --hidden --no-ignore -S "on('selectAll" -C2 || true
rg -n --hidden --no-ignore -S 'on(\"selectAll' -C2 || true
rg -n --hidden --no-ignore -S 'onSelectAll' -C2 || true

Length of output: 12394


Use explicit optional handler type for IGridEvent.selectAll

selectAll is invoked as selectAll({ selection, checked, $table }, event) (see packages/renderless/src/dialog-select/index.ts) — replace Function with a concrete optional signature.

 export interface IGridEvent {
-  selectAll: Function
+  // invoked as: selectAll({ selection, checked, $table }, event)
+  selectAll?: (payload: { selection: any[]; checked: boolean; $table: any }, event?: any) => void
 }
📝 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 interface IGridEvent {
selectAll: Function
}
export interface IGridEvent {
// invoked as: selectAll({ selection, checked, $table }, event)
selectAll?: (payload: { selection: any[]; checked: boolean; $table: any }, event?: any) => void
}
🤖 Prompt for AI Agents
In packages/renderless/types/grid.type.ts around lines 1-3, IGridEvent.selectAll
is currently typed as Function; change it to an optional, explicit handler
signature that matches its usage selectAll({ selection, checked, $table },
event). Replace Function with something like selectAll?: (payload: { selection:
any[]; checked: boolean; $table: unknown }, event?: Event) => void (adjust
selection/$table types to more specific types from the codebase if available).


export interface IGridColumn {
field: string
title: string
}

export interface IGridConfig {
columns: IGridColumn[]
data: any[]
border: boolean
event: IGridEvent
treeConfig: any
Comment on lines +10 to +15
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Confirm property name event vs events.

Ensure this matches component API to avoid mismatch with consumers.


🏁 Script executed:

#!/bin/bash
# Look for grid config objects to confirm key naming conventions
rg -nP --type=ts -C2 '\bevents?\s*:' 

Length of output: 96763


Align property name: change IGridConfig.event → events

IGridConfig declares event: IGridEvent (packages/renderless/types/grid.type.ts:14) but the Vue component props use events (packages/vue/src/grid/src/grid/grid.ts:124). Make the property name consistent (rename to events or add an alias in types/component).

🤖 Prompt for AI Agents
In packages/renderless/types/grid.type.ts around lines 10 to 15, the IGridConfig
interface currently declares `event: IGridEvent` but the Vue component expects
`events`; rename the property to `events: IGridEvent` (or add an `events` alias
typed as IGridEvent and mark `event` deprecated) and update any imports/usages
to use the new property name so the type and component props are consistent.

selectConfig: any
}

export type IGriOp = Partial<IGridConfig>
2 changes: 1 addition & 1 deletion packages/vue/src/dialog-select/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineComponent({
popseletor: {
type: String,
default: 'grid',
validator: (value) => ~['grid', 'tree'].indexOf(value)
validator: (value: string) => ['grid', 'tree'].includes(value)
},
multi: {
type: Boolean,
Expand Down