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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/renderless/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-renderless",
"version": "3.18.4",
"version": "3.18.5",
"private": true,
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
"author": "OpenTiny Team",
Expand Down
13 changes: 9 additions & 4 deletions packages/renderless/src/autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ export const handleFocus =

export const handleBlur =
({ emit, state, dispatch, props }: Pick<IAutoCompleteRenderlessParams, 'emit' | 'state' | 'dispatch' | 'props'>) =>
(event) => {
() => {
state.suggestionDisabled = true
emit('blur', event)
emit('blur')
if (state.validateEvent) {
dispatch(FORM_ITEM, FORM_EVENT.blur, [props.modelValue])
}
Expand Down Expand Up @@ -165,17 +165,22 @@ export const select =
emit,
nextTick,
props,
state
state,
dispatch
}: {
emit: IAutoCompleteRenderlessParamUtils['emit']
nextTick: IAutoCompleteRenderlessParamUtils['nextTick']
props: IAutoCompleteProps
state: IAutoCompleteState
}) =>
(item) => {
emit('update:modelValue', item[props.valueKey])
const value = item[props.valueKey]
emit('update:modelValue', value)
emit('select', item)

if (state.validateEvent) {
dispatch(FORM_ITEM, FORM_EVENT.change, [value])
}
nextTick(() => {
state.activated = false
state.suggestions = []
Expand Down
3 changes: 1 addition & 2 deletions packages/renderless/src/autocomplete/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import type {

export const api = [
'state',
'select',
'suggestionState',
'getInput',
'handleChange',
Expand Down Expand Up @@ -125,7 +124,7 @@ const initApi = ({
mounted: mounted({ vm, state, suggestionState }),
highlight: highlight({ constants, vm, state }),
handleClear: handleClear({ emit, state }),
select: select({ emit, nextTick, props, state }),
select: select({ emit, nextTick, props, state, dispatch }),
watchVisible: watchVisible({ suggestionState, vm }),
handleChange: handleChange({ api, emit, state, props, dispatch }),
handleFocus: handleFocus({ api, emit, props, state }),
Expand Down
24 changes: 12 additions & 12 deletions packages/vue/src/autocomplete/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"name": "@opentiny/vue-autocomplete",
"version": "3.18.0",
"type": "module",
"version": "3.18.1",
"description": "",
"license": "MIT",
"sideEffects": false,
"main": "lib/index.js",
"module": "index.ts",
"sideEffects": false,
"type": "module",
"devDependencies": {
"@opentiny-internal/vue-test-utils": "workspace:*",
"vitest": "^0.31.0"
},
"scripts": {
"build": "pnpm -w build:ui $npm_package_name",
"//postversion": "pnpm build"
},
"dependencies": {
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
"@opentiny/vue-input": "workspace:~",
"@opentiny/vue-renderless": "workspace:~",
Comment on lines +15 to +18
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

@opentiny/vue-icon is still in use across multiple files

The @opentiny/vue-icon dependency has been removed from the package.json, but it is still being imported in numerous files within the packages/vue/src/autocomplete directory and other related packages. This inconsistency can lead to potential runtime errors or build issues.

Please either add @opentiny/vue-icon back to the dependencies or refactor the code to eliminate its usage if it's no longer needed.

🔗 Analysis chain

Please clarify the removal of @opentiny/vue-icon from dependencies

The dependencies have been reordered, which is fine. However, @opentiny/vue-icon has been removed from the dependencies list. Could you please clarify why this dependency was removed? Is it no longer used in the package, or is it being imported differently now?

To check if @opentiny/vue-icon is still used in the package, you can run the following command:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for imports of @opentiny/vue-icon in the package
rg --type typescript --type vue "from ['\"]\@opentiny/vue-icon" packages/vue/src/autocomplete

Length of output: 205


Script:

#!/bin/bash
# Corrected script to search for imports of @opentiny/vue-icon in the autocomplete package
rg --type typescript --type vue "from ['\"]@opentiny/vue-icon['\"]" packages/vue/src/autocomplete

Length of output: 138


Script:

#!/bin/bash
# Corrected script to search for imports of @opentiny/vue-icon in the autocomplete package
rg --type ts --type vue "from ['\"]@opentiny/vue-icon['\"]" packages/vue/src/autocomplete

Length of output: 123


Script:

#!/bin/bash
# Search for imports of @opentiny/vue-icon in the autocomplete package
fd -e ts -e vue -t f packages/vue/src/autocomplete | xargs rg "from ['\"]@opentiny/vue-icon['\"]"

Length of output: 73589

"@opentiny/vue-scrollbar": "workspace:~",
"@opentiny/vue-icon": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
},
"license": "MIT"
}
"devDependencies": {
"@opentiny-internal/vue-test-utils": "workspace:*",
"vitest": "^0.31.0"
}
}
2 changes: 1 addition & 1 deletion packages/vue/src/autocomplete/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
ref="input"
v-bind="f($props, $attrs)"
front-clear-icon
v-clickoutside="handleBlur"
@update:modelValue="handleChange"
:validate-event="false"
@focus="handleFocus"
@blur="handleBlur"
@clear="handleClear"
@keydown.up.prevent="highlight(state.highlightedIndex - 1)"
@keydown.down.prevent="highlight(state.highlightedIndex + 1)"
Expand Down
Loading