@snabcentr/vue-ui-lib 3.65.0 → 3.66.0

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.
@@ -61,8 +61,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<IC
61
61
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
62
62
  "header:click": (name: string | number, expanded: boolean) => any;
63
63
  }, string, {
64
- disabled: boolean;
65
64
  name: string | number;
65
+ disabled: boolean;
66
66
  title: string;
67
67
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
68
68
  beforeCreate?: (() => void) | (() => void)[];
@@ -85,8 +85,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<IC
85
85
  $nextTick: typeof import('vue').nextTick;
86
86
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
87
87
  } & Readonly<{
88
- disabled: boolean;
89
88
  name: string | number;
89
+ disabled: boolean;
90
90
  title: string;
91
91
  }> & Omit<Readonly<{
92
92
  name: string | number;
@@ -94,7 +94,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<IC
94
94
  disabled?: boolean;
95
95
  }> & Readonly<{
96
96
  "onHeader:click"?: ((name: string | number, expanded: boolean) => any) | undefined;
97
- }>, "toggle" | "expand" | "collapse" | "expanded" | ("disabled" | "name" | "title")> & import('vue').ShallowUnwrapRef<{
97
+ }>, "toggle" | "expand" | "collapse" | "expanded" | ("name" | "disabled" | "title")> & import('vue').ShallowUnwrapRef<{
98
98
  expand: () => void;
99
99
  toggle: () => void;
100
100
  collapse: () => void;
@@ -49,8 +49,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
49
49
  }> & Readonly<{
50
50
  "onHeader:click"?: ((name: string | number, expanded: boolean) => any) | undefined;
51
51
  }>, {
52
- disabled: boolean;
53
52
  name: string | number;
53
+ disabled: boolean;
54
54
  title: string;
55
55
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
56
56
  arrow?(_: {}): any;
@@ -32,8 +32,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
32
32
  blur: () => void | undefined;
33
33
  select: () => void | undefined;
34
34
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
35
- focus: (focusEvent: FocusEvent) => any;
36
35
  input: (inputEvent: Event) => any;
36
+ focus: (focusEvent: FocusEvent) => any;
37
37
  keydown: (keyboardEvent: KeyboardEvent) => any;
38
38
  "update:value": (value: number | null, ...additionalParams: any[]) => any;
39
39
  }, string, import('vue').PublicProps, Readonly<import('../../properties').IValue<number | null> & import('../../properties').IClearable & IDebounced & IPlaceholder & {
@@ -62,17 +62,17 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
62
62
  */
63
63
  showButton?: boolean;
64
64
  }> & Readonly<{
65
- onFocus?: ((focusEvent: FocusEvent) => any) | undefined;
66
65
  onInput?: ((inputEvent: Event) => any) | undefined;
66
+ onFocus?: ((focusEvent: FocusEvent) => any) | undefined;
67
67
  onKeydown?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
68
68
  "onUpdate:value"?: ((value: number | null, ...additionalParams: any[]) => any) | undefined;
69
69
  }>, {
70
70
  value: number | null;
71
- placeholder: string;
72
- clearable: boolean;
73
71
  validator: (value: number) => boolean;
74
72
  min: number;
75
73
  max: number;
74
+ placeholder: string;
75
+ clearable: boolean;
76
76
  step: number;
77
77
  showButton: boolean;
78
78
  parse: (value: string) => number | null;
@@ -0,0 +1,45 @@
1
+ import { Directive } from 'vue';
2
+ /**
3
+ * Тип значения, которое можно скопировать в буфер обмена.
4
+ */
5
+ export type CopyValue = string | number | null | undefined;
6
+ /**
7
+ * Копирует переданное значение в буфер обмена и показывает уведомление о результате.
8
+ *
9
+ * Использует Clipboard API с запасным механизмом для небезопасного контекста (http)
10
+ * и сам обрабатывает ошибки, показывая всплывающее уведомление об успехе или неудаче.
11
+ *
12
+ * Функцию следует использовать там, где директиву `v-copy` нельзя навесить на элемент:
13
+ * при копировании по программному событию (выбор пункта меню, обработчик колбэка и т.п.).
14
+ *
15
+ * @param value Значение для копирования.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // Копирование ссылки по выбору пункта меню.
20
+ * await copyToClipboard(`${location.origin}/orders/${orderId}`);
21
+ * ```
22
+ */
23
+ export declare const copyToClipboard: (value: CopyValue) => Promise<void>;
24
+ /**
25
+ * Директива `v-copy` — копирует переданное значение в буфер обмена.
26
+ *
27
+ * Поведение:
28
+ * - меняет курсор на `pointer`, обозначая интерактивность;
29
+ * - по умолчанию копирует по двойному клику, а на кнопках — по одиночному;
30
+ * - модификаторы `.click` / `.dblclick` принудительно задают тип события;
31
+ * - значение для копирования передаётся в саму директиву и может быть строкой или числом.
32
+ *
33
+ * @example
34
+ * ```vue
35
+ * <!-- Копирование номера заказа по двойному клику. -->
36
+ * <span v-copy="order.id">{{ order.id }}</span>
37
+ *
38
+ * <!-- Копирование по одиночному клику (на кнопке — автоматически). -->
39
+ * <n-button v-copy="order.payment.onlinePaymentLink">Скопировать ссылку</n-button>
40
+ *
41
+ * <!-- Принудительно одиночный клик на не-кнопке. -->
42
+ * <span v-copy.click="order.barcode">{{ order.barcode }}</span>
43
+ * ```
44
+ */
45
+ export declare const vCopy: Directive<HTMLElement, CopyValue>;
@@ -1 +1,2 @@
1
+ export * from './copy';
1
2
  export * from './focus-next';
@@ -0,0 +1,13 @@
1
+ import { IFile } from '@snabcentr/common-lib';
2
+ /**
3
+ * Объект помощников работы с файлами.
4
+ * Предоставляет методы подготовки файлов к отправке на портал.
5
+ */
6
+ export declare const FileHelper: {
7
+ /**
8
+ * Читает содержимое файла и возвращает данные файла в формате, принимаемом порталом.
9
+ *
10
+ * @param file Файл, выбранный пользователем.
11
+ */
12
+ readAsFileData(file: File): Promise<IFile>;
13
+ };
@@ -1,3 +1,5 @@
1
1
  export * from './content-helper';
2
+ export * from './file-helper';
2
3
  export * from './input-helper';
3
4
  export * from './select-option-helper';
5
+ export * from './validators';
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "keywords": [],
5
5
  "author": "Sergey S. Smirnov <dev@snabcentr.com>",
6
6
  "type": "module",
7
- "version": "3.65.0",
7
+ "version": "3.66.0",
8
8
  "license": "ISC",
9
9
  "scripts": {
10
10
  "dev": "vite",