File tree Expand file tree Collapse file tree 2 files changed +38
-20
lines changed Expand file tree Collapse file tree 2 files changed +38
-20
lines changed Original file line number Diff line number Diff line change @@ -85,21 +85,24 @@ onMounted(async () => {
85
85
<div
86
86
:class =" `${tableBasicConf.styles.headerClass} iw-tt-header flex justify-between p-0 min-h-0`"
87
87
>
88
- <div class =" tablist iw-tabs iw-tabs-sm iw-tabs-boxed" >
89
- <a
90
- v-for =" layout in tableLayoutsConf"
91
- :key =" layout.id"
92
- :data-layout-id =" layout.id"
93
- role =" tab"
94
- class =" iw-tt-header__item iw-tab"
95
- :class =" currentLayoutId === layout.id ? 'iw-tab-active' : ''"
96
- >
97
- <i :class =" `${layout.icon}`" class =" mr-1" /> {{ layout.title }}
98
- </a >
99
- </div >
100
- <div >
88
+ <ScrollableComp class =" flex-1" >
89
+ <div class =" tablist iw-tabs iw-tabs-sm iw-tabs-boxed" >
90
+ <a
91
+ v-for =" layout in tableLayoutsConf"
92
+ :key =" layout.id"
93
+ :data-layout-id =" layout.id"
94
+ role =" tab"
95
+ class =" iw-tt-header__item iw-tab flex flex-nowrap"
96
+ :class =" currentLayoutId === layout.id ? 'iw-tab-active' : ''"
97
+ >
98
+ <i :class =" `${layout.icon}`" class =" mr-1" /> {{ layout.title }}
99
+ </a >
100
+ </div >
101
+ </ScrollableComp >
102
+ <div class =" flex items-center" >
101
103
<QuickSearchComp
102
104
v-if =" props.layouts.find(layout => layout.id === currentLayoutId)?.quickSearch"
105
+ class =" mx-2"
103
106
:placeholder =" props.layouts.find(layout => layout.id === currentLayoutId)?.quickSearch?.placeholder!"
104
107
:search-content =" tableLayoutsConf.find(layout => layout.id === currentLayoutId)?.quickSearchContent"
105
108
/>
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import * as eb from ' ../eventbus' ;
2
+ import { ref } from ' vue'
3
+ import * as eb from ' ../eventbus'
3
4
4
5
const props = defineProps <{
5
6
placeholder: string
6
7
searchContent? : string
7
8
}>()
8
9
10
+ const quickSearchRef = ref ()
11
+ const showInput = ref (false )
12
+
9
13
async function setQuickSearchContent(e : Event ) {
10
14
const target = e .target as HTMLInputElement
11
15
await eb .modifyLayout ({
12
16
quickSearchContent: target .value ,
13
17
})
14
18
}
19
+
20
+ function handleQuickShow() {
21
+ showInput .value = ! showInput .value
22
+ }
15
23
</script >
16
24
17
25
<template >
18
- <input
19
- class =" iw-input iw-input-bordered iw-input-xs"
20
- :value =" props.searchContent || ''"
21
- :placeholder =" props.placeholder"
22
- @change =" setQuickSearchContent"
23
- >
26
+ <label class =" iw-input iw-input-xs flex items-center" :class =" `${showInput && 'iw-input-bordered'}`" >
27
+ <input
28
+ ref =" quickSearchRef"
29
+ type =" text"
30
+ class =" iw-grow border-none"
31
+ :class =" `${showInput ? 'w-[150px]' : 'w-0'}`"
32
+ :value =" props.searchContent || ''"
33
+ :placeholder =" props.placeholder"
34
+ style =" transition : all 0.2s ease-in-out "
35
+ @change =" setQuickSearchContent"
36
+ >
37
+ <svg xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 16 16" fill =" currentColor" class =" w-4 h-4 opacity-70 cursor-pointer" @click =" handleQuickShow" ><path fill-rule =" evenodd" d =" M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" clip-rule =" evenodd" /></svg >
38
+ </label >
24
39
</template >
You can’t perform that action at this time.
0 commit comments