PluginProbe
The Innovative Form Builder – IvyForms / 1.1
The Innovative Form Builder – IvyForms v1.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / views / _components / table / composables / useTableSkeletonState.ts

useTableSkeletonState.ts in The Innovative Form Builder – IvyForms 1.1, at frontend/src/views/_components/table/composables/useTableSkeletonState.ts

21 lines 623 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { computed, type Ref } from 'vue'
2
3 export interface UseTableSkeletonStateOptions {
4 loading: Ref<boolean>
5 searchQuery?: Ref<string>
6 debouncedSearchQuery?: Ref<string>
7 }
8
9 export function useTableSkeletonState(options: UseTableSkeletonStateOptions) {
10 const { loading, searchQuery, debouncedSearchQuery } = options
11
12 const isDebouncing = computed(() => {
13 if (!searchQuery || !debouncedSearchQuery) return false
14 return searchQuery.value !== debouncedSearchQuery.value
15 })
16
17 const shouldShowSkeleton = computed(() => loading.value || isDebouncing.value)
18
19 return { isDebouncing, shouldShowSkeleton }
20 }
21