@webitel/ui-sdk 26.8.51 → 26.8.52

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
  export * from './useCachedInterval/useCachedInterval';
2
2
  export * from './useCachedItemInstanceName/useCachedItemInstanceName';
3
3
  export * from './useCard/useCardComponent';
4
- export * from './useCard/useCardTabs';
5
4
  export * from './useClose/useClose';
6
5
  export * from './useDestroyableSortable/useDestroyableSortable';
7
6
  export * from './useEventBus/useEventBus';
@@ -1,15 +1,40 @@
1
- export function useTableEmpty({ dataList, filters, error, isLoading }?: {
2
- dataList?: unknown;
3
- filters?: unknown;
4
- error?: unknown;
5
- isLoading?: unknown;
6
- }, overrides?: object): {
1
+ import { type MaybeRefOrGetter } from 'vue';
2
+ import { EmptyCause } from '../../../enums/index';
3
+ interface EmptyImageSet {
4
+ dark: string;
5
+ light: string;
6
+ }
7
+ interface EmptyStateVariants<T> {
8
+ filters: T;
9
+ error: T;
10
+ empty: T;
11
+ }
12
+ interface EmptyStateConfig {
13
+ image: EmptyStateVariants<EmptyImageSet>;
14
+ headline: EmptyStateVariants<string>;
15
+ title: EmptyStateVariants<string>;
16
+ text: EmptyStateVariants<string>;
17
+ primaryActionText: EmptyStateVariants<string>;
18
+ secondaryActionText: EmptyStateVariants<string>;
19
+ }
20
+ /** duck-typed readable ref — accepts `Ref`/`ComputedRef`/Pinia `ToRef` alike, only `.value` is ever read */
21
+ type Readable<T> = {
22
+ value: T;
23
+ };
24
+ export interface UseTableEmptySource {
25
+ dataList?: Readable<unknown[] | undefined>;
26
+ filters?: Readable<Record<string, unknown> | undefined>;
27
+ error?: Readable<unknown>;
28
+ isLoading?: Readable<boolean | undefined>;
29
+ }
30
+ export declare const useTableEmpty: ({ dataList, filters, error, isLoading }?: UseTableEmptySource, overrides?: MaybeRefOrGetter<Partial<EmptyStateConfig>>) => {
7
31
  showEmpty: import("vue").ComputedRef<boolean>;
8
- emptyCause: import("vue").ComputedRef<"error" | "filters" | "empty" | null>;
9
- image: import("vue").ComputedRef<any>;
10
- headline: import("vue").ComputedRef<any>;
11
- title: import("vue").ComputedRef<any>;
12
- text: import("vue").ComputedRef<any>;
13
- primaryActionText: import("vue").ComputedRef<any>;
14
- secondaryActionText: import("vue").ComputedRef<any>;
32
+ emptyCause: import("vue").ComputedRef<EmptyCause | null>;
33
+ image: import("vue").ComputedRef<string | null>;
34
+ headline: import("vue").ComputedRef<string | null>;
35
+ title: import("vue").ComputedRef<string | null>;
36
+ text: import("vue").ComputedRef<string | null>;
37
+ primaryActionText: import("vue").ComputedRef<string | null>;
38
+ secondaryActionText: import("vue").ComputedRef<string | null>;
15
39
  };
40
+ export {};
@@ -1,29 +0,0 @@
1
- import { computed } from 'vue';
2
- import { useRoute, useRouter } from 'vue-router';
3
-
4
- export const useCardTabs = (tabs) => {
5
- const router = useRouter();
6
- const route = useRoute();
7
-
8
- const currentTab = computed(() => {
9
- return (
10
- tabs?.value.find(({ pathName }) => route.name === pathName) ||
11
- tabs?.value[0]
12
- );
13
- });
14
-
15
- function changeTab(tab) {
16
- if (!tab?.pathName) return;
17
-
18
- return router.push({
19
- ...route,
20
- name: tab.pathName,
21
- });
22
- }
23
-
24
- return {
25
- currentTab,
26
-
27
- changeTab,
28
- };
29
- };
@@ -1,4 +0,0 @@
1
- export function useCardTabs(tabs: any): {
2
- currentTab: import("vue").ComputedRef<any>;
3
- changeTab: (tab: any) => Promise<void | import("vue-router").NavigationFailure | undefined> | undefined;
4
- };