File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed
platform/assets/components Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const meta: Meta<typeof SearchBox> = {
8
8
component : SearchBox ,
9
9
tags : [ 'autodocs' ] ,
10
10
argTypes : {
11
- placeHolder : {
11
+ placeholder : {
12
12
control : 'text'
13
13
} ,
14
14
showBorder : {
@@ -22,7 +22,7 @@ const meta: Meta<typeof SearchBox> = {
22
22
}
23
23
} ,
24
24
args : {
25
- placeHolder : 'Search...' ,
25
+ placeholder : 'Search...' ,
26
26
showBorder : false ,
27
27
size : 'md'
28
28
}
Original file line number Diff line number Diff line change 5
5
ref =" input"
6
6
v-model =" searchQuery"
7
7
:aria-label ="
8
- placeHolder || t('templateWidgets.sort.searchPlaceholder', 'Search...')
8
+ placeholder || t('templateWidgets.sort.searchPlaceholder', 'Search...')
9
9
"
10
10
:placeholder ="
11
- placeHolder || t('templateWidgets.sort.searchPlaceholder', 'Search...')
11
+ placeholder || t('templateWidgets.sort.searchPlaceholder', 'Search...')
12
12
"
13
13
type =" text"
14
14
unstyled
19
19
20
20
<script setup lang="ts">
21
21
import InputText from ' primevue/inputtext'
22
- import { computed , ref } from ' vue'
22
+ import { computed , onMounted , ref } from ' vue'
23
23
24
24
import { t } from ' @/i18n'
25
25
import { cn } from ' @/utils/tailwindUtil'
26
26
27
27
const {
28
- placeHolder,
28
+ autofocus = false ,
29
+ placeholder,
29
30
showBorder = false ,
30
31
size = ' md'
31
32
} = defineProps <{
32
- placeHolder? : string
33
+ autofocus? : boolean
34
+ placeholder? : string
33
35
showBorder? : boolean
34
36
size? : ' md' | ' lg'
35
37
}>()
@@ -43,6 +45,8 @@ const focusInput = () => {
43
45
}
44
46
}
45
47
48
+ onMounted (() => autofocus && focusInput ())
49
+
46
50
const wrapperStyle = computed (() => {
47
51
const baseClasses = [
48
52
' relative flex w-full items-center gap-2' ,
Original file line number Diff line number Diff line change 1944
1944
"connectionError" : " Please check your connection and try again" ,
1945
1945
"failedToCreateNode" : " Failed to create node. Please try again or check console for details." ,
1946
1946
"noModelsInFolder" : " No {type} available in this folder" ,
1947
- "searchAssetsPlaceholder" : " Search assets ..." ,
1947
+ "searchAssetsPlaceholder" : " Type to search ..." ,
1948
1948
"allModels" : " All Models" ,
1949
1949
"allCategory" : " All {category}" ,
1950
1950
"unknown" : " Unknown" ,
Original file line number Diff line number Diff line change 23
23
<template #header >
24
24
<SearchBox
25
25
v-model =" searchQuery"
26
+ :autofocus =" true"
26
27
size =" lg"
27
28
:placeholder =" $t('assetBrowser.searchAssetsPlaceholder')"
28
29
class =" max-w-96"
You can’t perform that action at this time.
0 commit comments