rayyy-vue-table-components 1.2.21 → 1.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  showFilter?: boolean;
3
3
  showSearch?: boolean;
4
- fullInput?: boolean;
5
4
  badgeValue?: number;
6
5
  };
7
6
  declare function __VLS_template(): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayyy-vue-table-components",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "description": "Vue 3 + Element Plus 表格組件庫",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
@@ -6,7 +6,6 @@ import FilterBtn from './FilterBtn.vue'
6
6
  defineProps<{
7
7
  showFilter?: boolean
8
8
  showSearch?: boolean
9
- fullInput?: boolean
10
9
  badgeValue?: number
11
10
  }>()
12
11
 
@@ -39,7 +38,7 @@ const resetFilter = () => {
39
38
  </div>
40
39
 
41
40
  <div class="flex items-center justify-end">
42
- <div v-if="showSearch" :class="{ 'w-full': fullInput, 'search-input': !fullInput }">
41
+ <div v-if="showSearch" class="search-input">
43
42
  <base-input
44
43
  v-model="keyword"
45
44
  placeholder="請輸入關鍵字搜尋列表"
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { toRefs } from 'vue'
2
+ import { toRefs, computed } from 'vue'
3
3
  import type { Pager } from '@/types'
4
4
  import { MainPanel, SearchBar } from '@/components'
5
5
 
@@ -22,6 +22,9 @@ const emits = defineEmits<{
22
22
  (e: 'updatePageSize', limit: number): boolean
23
23
  }>()
24
24
 
25
+ const showAllFeatures = computed(() => {
26
+ return props.showDefaultSearch || (props.showSearch && props.showEdit && props.showFilter)
27
+ })
25
28
  const search = (keyword: string) => {
26
29
  emits('search', keyword)
27
30
  }
@@ -43,15 +46,15 @@ const changePageSize = (limit: number) => {
43
46
  <main-panel :title="props.title" :show-back="showBack">
44
47
  <template #searchBar>
45
48
  <search-bar
46
- :show-filter="showFilter"
47
- :show-search="showSearch"
49
+ :show-filter="showAllFeatures || showFilter"
50
+ :show-search="showAllFeatures || showSearch"
48
51
  :badge-value="badgeValue"
49
52
  @keydown:enter="search"
50
53
  @update:clear="clearable"
51
54
  >
52
55
  <template #button>
53
56
  <slot name="firstButton"></slot>
54
- <slot name="customButton"> </slot>
57
+ <slot name="customButton" v-if="showAllFeatures || showEdit"> </slot>
55
58
  <slot name="lastButton"></slot>
56
59
  </template>
57
60
  <template #filterBody>