@webitel/ui-sdk 26.8.51 → 26.8.53

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,48 @@
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 { EmptyCause } from '../../../enums/index';
2
+ type DeepPartial<T> = T extends object ? {
3
+ [K in keyof T]?: DeepPartial<T[K]>;
4
+ } : T;
5
+ interface EmptyImageSet {
6
+ dark: string;
7
+ light: string;
8
+ }
9
+ interface EmptyStateVariants<T> {
10
+ filters: T;
11
+ error: T;
12
+ empty: T;
13
+ }
14
+ interface EmptyStateConfig {
15
+ image: EmptyStateVariants<EmptyImageSet>;
16
+ headline: EmptyStateVariants<string>;
17
+ title: EmptyStateVariants<string>;
18
+ text: EmptyStateVariants<string>;
19
+ primaryActionText: EmptyStateVariants<string>;
20
+ secondaryActionText: EmptyStateVariants<string>;
21
+ }
22
+ /** duck-typed readable ref — accepts `Ref`/`ComputedRef`/Pinia `ToRef` alike, only `.value` is ever read */
23
+ type Readable<T> = {
24
+ value: T;
25
+ };
26
+ export interface UseTableEmptySource {
27
+ dataList?: Readable<unknown[] | undefined>;
28
+ filters?: Readable<Record<string, unknown> | undefined>;
29
+ error?: Readable<unknown>;
30
+ isLoading?: Readable<boolean | undefined>;
31
+ }
32
+ type MaybeOverridesGetter = DeepPartial<EmptyStateConfig> | Readable<DeepPartial<EmptyStateConfig>> | (() => DeepPartial<EmptyStateConfig>);
33
+ /**
34
+ * @param overrides plain object, ref, computed, or getter — use a reactive
35
+ * source (not a plain object literal) if any value inside depends on
36
+ * locale/dark mode, so it re-evaluates instead of freezing at first render
37
+ */
38
+ export declare const useTableEmpty: ({ dataList, filters, error, isLoading }?: UseTableEmptySource, overrides?: MaybeOverridesGetter) => {
7
39
  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>;
40
+ emptyCause: import("vue").ComputedRef<EmptyCause | null>;
41
+ image: import("vue").ComputedRef<string | null>;
42
+ headline: import("vue").ComputedRef<string | null>;
43
+ title: import("vue").ComputedRef<string | null>;
44
+ text: import("vue").ComputedRef<string | null>;
45
+ primaryActionText: import("vue").ComputedRef<string | null>;
46
+ secondaryActionText: import("vue").ComputedRef<string | null>;
15
47
  };
48
+ 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
- };