Skip to content

Commit 8db6ce4

Browse files
kagolgimmyhehe
andauthored
Sync 3.18.0 to dev (#2363)
* fix(autocomplete): [autocomplete] fix form validate error when select suggestion option (#2296) * fix: update @opentiny/fluent-editor version and export defaultToolbar * chore(renderless): release v3.18.6 --------- Co-authored-by: gimmyhehe <975402925@qq.com>
1 parent 379208d commit 8db6ce4

File tree

6 files changed

+26
-22
lines changed

6 files changed

+26
-22
lines changed

packages/renderless/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentiny/vue-renderless",
3-
"version": "3.18.4",
3+
"version": "3.18.6",
44
"private": true,
55
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
66
"author": "OpenTiny Team",

packages/renderless/src/autocomplete/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ export const handleFocus =
109109

110110
export const handleBlur =
111111
({ emit, state, dispatch, props }: Pick<IAutoCompleteRenderlessParams, 'emit' | 'state' | 'dispatch' | 'props'>) =>
112-
(event) => {
112+
() => {
113113
state.suggestionDisabled = true
114-
emit('blur', event)
114+
emit('blur')
115115
if (state.validateEvent) {
116116
dispatch(FORM_ITEM, FORM_EVENT.blur, [props.modelValue])
117117
}
@@ -165,17 +165,22 @@ export const select =
165165
emit,
166166
nextTick,
167167
props,
168-
state
168+
state,
169+
dispatch
169170
}: {
170171
emit: IAutoCompleteRenderlessParamUtils['emit']
171172
nextTick: IAutoCompleteRenderlessParamUtils['nextTick']
172173
props: IAutoCompleteProps
173174
state: IAutoCompleteState
174175
}) =>
175176
(item) => {
176-
emit('update:modelValue', item[props.valueKey])
177+
const value = item[props.valueKey]
178+
emit('update:modelValue', value)
177179
emit('select', item)
178180

181+
if (state.validateEvent) {
182+
dispatch(FORM_ITEM, FORM_EVENT.change, [value])
183+
}
179184
nextTick(() => {
180185
state.activated = false
181186
state.suggestions = []

packages/renderless/src/autocomplete/vue.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import type {
3939

4040
export const api = [
4141
'state',
42-
'select',
4342
'suggestionState',
4443
'getInput',
4544
'handleChange',
@@ -125,7 +124,7 @@ const initApi = ({
125124
mounted: mounted({ vm, state, suggestionState }),
126125
highlight: highlight({ constants, vm, state }),
127126
handleClear: handleClear({ emit, state }),
128-
select: select({ emit, nextTick, props, state }),
127+
select: select({ emit, nextTick, props, state, dispatch }),
129128
watchVisible: watchVisible({ suggestionState, vm }),
130129
handleChange: handleChange({ api, emit, state, props, dispatch }),
131130
handleFocus: handleFocus({ api, emit, props, state }),
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"name": "@opentiny/vue-autocomplete",
3-
"version": "3.18.0",
3+
"type": "module",
4+
"version": "3.18.1",
45
"description": "",
6+
"license": "MIT",
7+
"sideEffects": false,
58
"main": "lib/index.js",
69
"module": "index.ts",
7-
"sideEffects": false,
8-
"type": "module",
9-
"devDependencies": {
10-
"@opentiny-internal/vue-test-utils": "workspace:*",
11-
"vitest": "^0.31.0"
12-
},
1310
"scripts": {
1411
"build": "pnpm -w build:ui $npm_package_name",
1512
"//postversion": "pnpm build"
1613
},
1714
"dependencies": {
18-
"@opentiny/vue-renderless": "workspace:~",
15+
"@opentiny/vue-common": "workspace:~",
16+
"@opentiny/vue-icon": "workspace:~",
1917
"@opentiny/vue-input": "workspace:~",
18+
"@opentiny/vue-renderless": "workspace:~",
2019
"@opentiny/vue-scrollbar": "workspace:~",
21-
"@opentiny/vue-icon": "workspace:~",
22-
"@opentiny/vue-common": "workspace:~",
2320
"@opentiny/vue-theme": "workspace:~"
2421
},
25-
"license": "MIT"
26-
}
22+
"devDependencies": {
23+
"@opentiny-internal/vue-test-utils": "workspace:*",
24+
"vitest": "^0.31.0"
25+
}
26+
}

packages/vue/src/autocomplete/src/pc.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
ref="input"
2525
v-bind="f($props, $attrs)"
2626
front-clear-icon
27+
v-clickoutside="handleBlur"
2728
@update:modelValue="handleChange"
2829
:validate-event="false"
2930
@focus="handleFocus"
30-
@blur="handleBlur"
3131
@clear="handleClear"
3232
@keydown.up.prevent="highlight(state.highlightedIndex - 1)"
3333
@keydown.down.prevent="highlight(state.highlightedIndex + 1)"

packages/vue/src/fluent-editor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opentiny/vue-fluent-editor",
3-
"version": "3.18.0",
3+
"version": "3.18.3",
44
"description": "",
55
"license": "MIT",
66
"sideEffects": false,
@@ -11,7 +11,7 @@
1111
"//postversion": "pnpm build"
1212
},
1313
"dependencies": {
14-
"@opentiny/fluent-editor": "~3.19.0",
14+
"@opentiny/fluent-editor": "~3.20.0",
1515
"@opentiny/vue-common": "workspace:~",
1616
"@opentiny/vue-icon": "workspace:~",
1717
"@opentiny/vue-image-viewer": "workspace:~",

0 commit comments

Comments
 (0)