@huntflow/ui 0.3.4 → 0.3.5

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,3 +1,3 @@
1
1
  import { default as UiTabs } from './tabs.vue';
2
- export type { UiTabsProps, UiTabsEmits, UiTabsValue, UiTabsItem, UiTabsGap } from './types';
2
+ export type { UiTabsProps, UiTabsEmits, UiTabsValue, UiTabsItem, UiTabsGap, UiTabsContentGap } from './types';
3
3
  export { UiTabs };
@@ -0,0 +1,4 @@
1
+ export declare const hasHorizontalScroll: (container: HTMLElement) => boolean;
2
+ export declare const animateScrollLeft: (container: HTMLElement, leftTo: number, onEnd?: () => void) => (() => void) | undefined;
3
+ export declare const ensureElementVisible: (container: HTMLElement, element: HTMLElement, scrollTo: (left: number) => void) => void;
4
+ export declare const getNextScrollLeft: (container: HTMLElement, direction: 1 | -1) => number;
@@ -1 +1 @@
1
- export declare const tabsCodeSnippet = "\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { UiTabs } from '@huntflow/ui';\n\nconst model = ref('interview');\n\nconst items = [\n {\n label: '\u0418\u043D\u0442\u0435\u0440\u0432\u044C\u044E',\n value: 'interview'\n },\n {\n label: '\u0414\u0440\u0443\u0433\u043E\u0435',\n value: 'other'\n }\n];\n</script>\n\n<template>\n <ui-tabs\n v-model=\"model\"\n :items=\"items\"\n :indicator=\"true\"\n list-aria-label=\"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u0440\u043E\u0444\u0438\u043B\u044F\"\n >\n <template #interview>\n \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0444\u0438\u043B\u044F \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430.\n </template>\n\n <template #other>\n \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u044C \u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0441\u0442\u0438.\n </template>\n </ui-tabs>\n</template>\n";
1
+ export declare const tabsCodeSnippet = "\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { UiTabs } from '@huntflow/ui';\n\nconst model = ref('interview');\n\nconst items = [\n {\n label: '\u0418\u043D\u0442\u0435\u0440\u0432\u044C\u044E',\n value: 'interview'\n },\n {\n label: '\u0414\u0440\u0443\u0433\u043E\u0435',\n value: 'other'\n }\n];\n</script>\n\n<template>\n <ui-tabs\n v-model=\"model\"\n :items=\"items\"\n :indicator=\"true\"\n list-aria-label=\"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u0440\u043E\u0444\u0438\u043B\u044F\"\n >\n <template #content-interview>\n \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0444\u0438\u043B\u044F \u0438 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430.\n </template>\n\n <template #content-other>\n \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u044C \u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0441\u0442\u0438.\n </template>\n </ui-tabs>\n</template>\n";
@@ -1,7 +1,7 @@
1
1
  import { UiTabsItem, UiTabsProps } from './types';
2
2
  declare const _default: <Item extends UiTabsItem = UiTabsItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
- readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
4
+ readonly "onUpdate:modelValue"?: ((value: Item["value"]) => any) | undefined;
5
5
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue"> & ({
6
6
  modelValue?: Item["value"];
7
7
  } & UiTabsProps<Item>) & Partial<{}>> & import('vue').PublicProps;
@@ -11,16 +11,18 @@ declare const _default: <Item extends UiTabsItem = UiTabsItem>(__VLS_props: NonN
11
11
  item?: (props: {
12
12
  item: Item;
13
13
  }) => any;
14
- } & { [K in Item["value"]]?: (() => any) | undefined; } & {
14
+ after?: () => any;
15
+ } & { [K in Item["value"] as `content-${K}`]?: (() => any) | undefined; } & {
15
16
  [key: string]: unknown;
16
17
  }> & {
17
18
  item?: (props: {
18
19
  item: Item;
19
20
  }) => any;
20
- } & { [K in Item["value"]]?: (() => any) | undefined; } & {
21
+ after?: () => any;
22
+ } & { [K in Item["value"] as `content-${K}`]?: (() => any) | undefined; } & {
21
23
  [key: string]: unknown;
22
24
  };
23
- emit: ((evt: "update:modelValue", value: Item["value"]) => void) & ((evt: "update:modelValue", value: Item["value"]) => void);
25
+ emit: (evt: "update:modelValue", value: Item["value"]) => void;
24
26
  }>) => import('vue').VNode & {
25
27
  __ctx?: Awaited<typeof __VLS_setup>;
26
28
  };
@@ -4,6 +4,13 @@ export type UiTabsItem = {
4
4
  value: UiTabsValue;
5
5
  };
6
6
  export type UiTabsGap = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl';
7
+ export type UiTabsContentGap = UiTabsGap | false;
8
+ export type UiTabsSticky = boolean | {
9
+ top?: number;
10
+ right?: number;
11
+ bottom?: number;
12
+ left?: number;
13
+ };
7
14
  export type UiTabsProps<Item extends UiTabsItem = UiTabsItem> = {
8
15
  /** Значение активной вкладки. Используется с v-model. */
9
16
  modelValue?: Item['value'];
@@ -13,10 +20,18 @@ export type UiTabsProps<Item extends UiTabsItem = UiTabsItem> = {
13
20
  size?: 'fit' | 'full';
14
21
  /** Горизонтальный отступ у списка табов. */
15
22
  headerGap?: UiTabsGap;
16
- /** Отступ между списком табов и контентом. */
17
- contentGap?: UiTabsGap;
23
+ /** Отступ между списком табов и контентом. Передайте `false`, чтобы убрать отступ. */
24
+ contentGap?: UiTabsContentGap;
18
25
  /** Показывает анимированный индикатор активной вкладки. */
19
26
  indicator?: boolean;
27
+ /** Скрывает список вкладок, если вкладка только одна. */
28
+ hideSingleTab?: boolean;
29
+ /** Скрывает линию под списком вкладок. */
30
+ hideLine?: boolean;
31
+ /** Прилипающий режим списка вкладок: `true/false` или объект оффсетов, например `{ top: 0 }`. */
32
+ sticky?: UiTabsSticky;
33
+ /** Удаляет содержимое неактивных вкладок из DOM. */
34
+ unmountOnHide?: boolean;
20
35
  /** Список вкладок. */
21
36
  items: Item[];
22
37
  };