@snabcentr/vue-ui-lib 5.4.0 → 5.5.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.
Files changed (32) hide show
  1. package/dist/manifest.json +2 -2
  2. package/dist/release_notes.tmp +19 -3
  3. package/dist/sc-vue-ui-lib.css +1 -1
  4. package/dist/sc-vue-ui-lib.js +5496 -5315
  5. package/dist/sc-vue-ui-lib.js.map +1 -1
  6. package/dist/sc-vue-ui-lib.umd.cjs +38 -38
  7. package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
  8. package/dist/src/components/buttons/button-with-confirm-action.vue.d.ts +1 -1
  9. package/dist/src/components/buttons/chip-group.vue.d.ts +28 -0
  10. package/dist/src/components/buttons/index.d.ts +2 -0
  11. package/dist/src/components/buttons/interfaces/i-chip-group-item.d.ts +13 -0
  12. package/dist/src/components/buttons/interfaces/index.d.ts +1 -0
  13. package/dist/src/components/catalog/category-collapse-item.vue.d.ts +15 -15
  14. package/dist/src/components/collapse/collapse-item.vue.d.ts +14 -13
  15. package/dist/src/components/index.d.ts +1 -0
  16. package/dist/src/components/kpi/index.d.ts +2 -0
  17. package/dist/src/components/kpi/interfaces/i-kpi-grid-item.d.ts +25 -0
  18. package/dist/src/components/kpi/interfaces/index.d.ts +1 -0
  19. package/dist/src/components/kpi/kpi-grid.vue.d.ts +24 -0
  20. package/dist/src/components/lists/compact-card-list.vue.d.ts +53 -0
  21. package/dist/src/components/lists/index.d.ts +1 -0
  22. package/dist/src/components/orders/blocks/order-external-links.vue.d.ts +3 -3
  23. package/dist/src/components/orders/orders-list.vue.d.ts +1 -1
  24. package/dist/src/components/orders/simple/order-product-info.vue.d.ts +41 -2
  25. package/dist/src/composables/index.d.ts +1 -0
  26. package/dist/src/composables/use-compact-layout.d.ts +8 -0
  27. package/dist/src/helpers/app-version-helper.d.ts +9 -0
  28. package/dist/src/helpers/index.d.ts +2 -0
  29. package/dist/src/helpers/pagination-items-prefix.d.ts +7 -0
  30. package/dist/src/properties/interfaces/i-order-external-links-property.d.ts +10 -0
  31. package/dist/src/properties/interfaces/index.d.ts +1 -0
  32. package/package.json +2 -2
@@ -90,10 +90,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<ID
90
90
  }> & Readonly<{
91
91
  onAccept?: ((closeModalCallback: () => void) => any) | undefined;
92
92
  }>, {
93
+ circle: boolean;
93
94
  size: Size;
94
95
  disabled: boolean;
95
96
  type: Type;
96
- circle: boolean;
97
97
  dialogTitle: string;
98
98
  dialogContent: string;
99
99
  disableConfirm: boolean;
@@ -0,0 +1,28 @@
1
+ import { IChipGroupItem } from './interfaces/i-chip-group-item';
2
+ /**
3
+ * Горизонтальная группа круглых кнопок с прокруткой на узком экране.
4
+ */
5
+ declare const _default: <TKey extends string>(__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<{
6
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
7
+ readonly "onUpdate:modelValue"?: ((value: TKey) => any) | undefined;
8
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue"> & {
9
+ /**
10
+ * Пункты группы.
11
+ */
12
+ items: readonly IChipGroupItem<TKey>[];
13
+ /**
14
+ * Ключ выбранного пункта.
15
+ */
16
+ modelValue: TKey;
17
+ } & Partial<{}>> & import('vue').PublicProps;
18
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
19
+ attrs: any;
20
+ slots: {};
21
+ emit: (e: "update:modelValue", value: TKey) => void;
22
+ }>) => import('vue').VNode & {
23
+ __ctx?: Awaited<typeof __VLS_setup>;
24
+ };
25
+ export default _default;
26
+ type __VLS_PrettifyLocal<T> = {
27
+ [K in keyof T]: T[K];
28
+ } & {};
@@ -1 +1,3 @@
1
+ export * from './interfaces';
1
2
  export { default as ScButtonWithConfirmAction } from './button-with-confirm-action.vue';
3
+ export { default as ScChipGroup } from './chip-group.vue';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Пункт горизонтальной группы круглых кнопок.
3
+ */
4
+ export interface IChipGroupItem<TKey extends string = string> {
5
+ /**
6
+ * Ключ пункта.
7
+ */
8
+ readonly key: TKey;
9
+ /**
10
+ * Подпись кнопки.
11
+ */
12
+ readonly label: string;
13
+ }
@@ -0,0 +1 @@
1
+ export * from './i-chip-group-item';
@@ -62,9 +62,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<IC
62
62
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
63
63
  "header:click": (name: string | number, expanded: boolean) => any;
64
64
  }, string, {
65
+ title: string;
65
66
  name: string | number;
66
67
  disabled: boolean;
67
- title: string;
68
68
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
69
69
  beforeCreate?: (() => void) | (() => void)[];
70
70
  created?: (() => void) | (() => void)[];
@@ -86,35 +86,35 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<IC
86
86
  $nextTick: typeof import('vue').nextTick;
87
87
  $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;
88
88
  } & Readonly<{
89
+ title: string;
89
90
  name: string | number;
90
91
  disabled: boolean;
91
- title: string;
92
92
  }> & Omit<Readonly<{
93
93
  name: string | number;
94
94
  title?: string;
95
95
  disabled?: boolean;
96
96
  }> & Readonly<{
97
97
  "onHeader:click"?: ((name: string | number, expanded: boolean) => any) | undefined;
98
- }>, "toggle" | "expand" | "collapse" | "expanded" | ("name" | "disabled" | "title")> & import('vue').ShallowUnwrapRef<{
98
+ }>, "toggle" | "expand" | "collapse" | "expanded" | ("title" | "name" | "disabled")> & import('vue').ShallowUnwrapRef<{
99
99
  expand: () => void;
100
100
  toggle: () => void;
101
101
  collapse: () => void;
102
102
  expanded: Readonly<import('vue').Ref<boolean, boolean>>;
103
103
  }> & {} & import('vue').ComponentCustomProperties & {} & {
104
104
  $slots: Readonly<{
105
- arrow: () => void;
106
- 'pre-arrow': () => void;
107
- header: () => void;
108
- 'sub-header': () => void;
109
- 'header-extra': () => void;
110
- default: () => void;
105
+ arrow: () => import('vue').VNode[];
106
+ 'pre-arrow': () => import('vue').VNode[];
107
+ header: () => import('vue').VNode[];
108
+ 'sub-header': () => import('vue').VNode[];
109
+ 'header-extra': () => import('vue').VNode[];
110
+ default: () => import('vue').VNode[];
111
111
  }> & {
112
- arrow: () => void;
113
- 'pre-arrow': () => void;
114
- header: () => void;
115
- 'sub-header': () => void;
116
- 'header-extra': () => void;
117
- default: () => void;
112
+ arrow: () => import('vue').VNode[];
113
+ 'pre-arrow': () => import('vue').VNode[];
114
+ header: () => import('vue').VNode[];
115
+ 'sub-header': () => import('vue').VNode[];
116
+ 'header-extra': () => import('vue').VNode[];
117
+ default: () => import('vue').VNode[];
118
118
  };
119
119
  }) | null;
120
120
  }, HTMLDivElement>, Readonly<{
@@ -1,3 +1,4 @@
1
+ import { VNode } from 'vue';
1
2
  /**
2
3
  * Компонент элемента списка сворачиваемых элементов.
3
4
  */
@@ -49,59 +50,59 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
49
50
  }> & Readonly<{
50
51
  "onHeader:click"?: ((name: string | number, expanded: boolean) => any) | undefined;
51
52
  }>, {
53
+ title: string;
52
54
  name: string | number;
53
55
  disabled: boolean;
54
- title: string;
55
56
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, Readonly<{
56
57
  /**
57
58
  * Значок скрытия и отображения содержимого.
58
59
  */
59
- arrow: () => void;
60
+ arrow: () => VNode[];
60
61
  /**
61
62
  * Зона значков слева от заголовка.
62
63
  */
63
- 'pre-arrow': () => void;
64
+ 'pre-arrow': () => VNode[];
64
65
  /**
65
66
  * Основной заголовок элемента.
66
67
  */
67
- header: () => void;
68
+ header: () => VNode[];
68
69
  /**
69
70
  * Вспомогательный заголовок под основным.
70
71
  */
71
- 'sub-header': () => void;
72
+ 'sub-header': () => VNode[];
72
73
  /**
73
74
  * Дополнительное содержимое заголовка справа.
74
75
  */
75
- 'header-extra': () => void;
76
+ 'header-extra': () => VNode[];
76
77
  /**
77
78
  * Содержимое элемента, отображаемое в развёрнутом состоянии.
78
79
  */
79
- default: () => void;
80
+ default: () => VNode[];
80
81
  }> & {
81
82
  /**
82
83
  * Значок скрытия и отображения содержимого.
83
84
  */
84
- arrow: () => void;
85
+ arrow: () => VNode[];
85
86
  /**
86
87
  * Зона значков слева от заголовка.
87
88
  */
88
- 'pre-arrow': () => void;
89
+ 'pre-arrow': () => VNode[];
89
90
  /**
90
91
  * Основной заголовок элемента.
91
92
  */
92
- header: () => void;
93
+ header: () => VNode[];
93
94
  /**
94
95
  * Вспомогательный заголовок под основным.
95
96
  */
96
- 'sub-header': () => void;
97
+ 'sub-header': () => VNode[];
97
98
  /**
98
99
  * Дополнительное содержимое заголовка справа.
99
100
  */
100
- 'header-extra': () => void;
101
+ 'header-extra': () => VNode[];
101
102
  /**
102
103
  * Содержимое элемента, отображаемое в развёрнутом состоянии.
103
104
  */
104
- default: () => void;
105
+ default: () => VNode[];
105
106
  }>;
106
107
  export default _default;
107
108
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -13,6 +13,7 @@ export * from './icons';
13
13
  export * from './images';
14
14
  export * from './inline';
15
15
  export * from './inputs';
16
+ export * from './kpi';
16
17
  export * from './links';
17
18
  export * from './lists';
18
19
  export * from './orders';
@@ -0,0 +1,2 @@
1
+ export * from './interfaces';
2
+ export { default as ScKpiGrid } from './kpi-grid.vue';
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Плашка сетки KPI.
3
+ */
4
+ export interface IKpiGridItem {
5
+ /**
6
+ * Подпись.
7
+ */
8
+ readonly label: string;
9
+ /**
10
+ * Значение.
11
+ */
12
+ readonly value: string;
13
+ /**
14
+ * CSS-класс значения.
15
+ */
16
+ readonly valueClass: string;
17
+ /**
18
+ * Подстрочная подпись.
19
+ */
20
+ readonly note: string;
21
+ /**
22
+ * CSS-класс подстрочной подписи.
23
+ */
24
+ readonly noteClass: string;
25
+ }
@@ -0,0 +1 @@
1
+ export * from './i-kpi-grid-item';
@@ -0,0 +1,24 @@
1
+ import { IKpiGridItem } from './interfaces/i-kpi-grid-item';
2
+ /**
3
+ * Сетка KPI-плашек: подпись, значение и примечание.
4
+ */
5
+ declare const _default: import('vue').DefineComponent<{
6
+ /**
7
+ * Элементы KPI-плашек.
8
+ */
9
+ items: readonly IKpiGridItem[];
10
+ /**
11
+ * Признак загрузки сводки.
12
+ */
13
+ isLoading?: boolean;
14
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
15
+ /**
16
+ * Элементы KPI-плашек.
17
+ */
18
+ items: readonly IKpiGridItem[];
19
+ /**
20
+ * Признак загрузки сводки.
21
+ */
22
+ isLoading?: boolean;
23
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
24
+ export default _default;
@@ -0,0 +1,53 @@
1
+ import { IPagination } from '@snabcentr/common-lib';
2
+ /**
3
+ * Список карточек для узкого экрана: загрузка, пустое состояние и пагинация.
4
+ */
5
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
6
+ /**
7
+ * Признак загрузки данных.
8
+ */
9
+ isLoading: boolean;
10
+ /**
11
+ * Признак пустого списка.
12
+ */
13
+ isEmpty: boolean;
14
+ /**
15
+ * Текст пустого состояния.
16
+ */
17
+ emptyDescription: string;
18
+ /**
19
+ * Параметры пагинации. Без них список не показывает переключатель страниц.
20
+ */
21
+ pagination?: IPagination;
22
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
23
+ "update:page": (page: number) => any;
24
+ "update:pageSize": (pageSize: number) => any;
25
+ }, string, import('vue').PublicProps, Readonly<{
26
+ /**
27
+ * Признак загрузки данных.
28
+ */
29
+ isLoading: boolean;
30
+ /**
31
+ * Признак пустого списка.
32
+ */
33
+ isEmpty: boolean;
34
+ /**
35
+ * Текст пустого состояния.
36
+ */
37
+ emptyDescription: string;
38
+ /**
39
+ * Параметры пагинации. Без них список не показывает переключатель страниц.
40
+ */
41
+ pagination?: IPagination;
42
+ }> & Readonly<{
43
+ "onUpdate:page"?: ((page: number) => any) | undefined;
44
+ "onUpdate:pageSize"?: ((pageSize: number) => any) | undefined;
45
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
46
+ default?(_: {}): any;
47
+ }>;
48
+ export default _default;
49
+ type __VLS_WithTemplateSlots<T, S> = T & {
50
+ new (): {
51
+ $slots: S;
52
+ };
53
+ };
@@ -1 +1,2 @@
1
+ export { default as ScCompactCardList } from './compact-card-list.vue';
1
2
  export { default as ScProductsList } from './products-list.vue';
@@ -1,6 +1,6 @@
1
- import { IOrderProperty } from '../../../properties';
1
+ import { IOrderExternalLinksProperty } from '../../../properties';
2
2
  /**
3
- * Компонент представления внешних ссылок заказа (счета, онлайн оплата).
3
+ * Компонент представления внешних ссылок заказа (ERP, счета, онлайн оплата).
4
4
  */
5
- declare const _default: import('vue').DefineComponent<IOrderProperty, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IOrderProperty> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: import('vue').DefineComponent<IOrderExternalLinksProperty, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<IOrderExternalLinksProperty> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
6
  export default _default;
@@ -152,11 +152,11 @@ declare const _default: import('vue').DefineComponent<{
152
152
  }>, {
153
153
  sort: ISortRequestParams[];
154
154
  filters: IFilterGroup;
155
+ pagination: IPagination;
155
156
  showAttachedUserColumn: boolean;
156
157
  highlightSettings: IOrderHighlightSettings;
157
158
  selectable: boolean;
158
159
  tableMinWidth: number;
159
- pagination: IPagination;
160
160
  useCellIndication: boolean;
161
161
  enableSorting: boolean;
162
162
  refreshInterval: number;
@@ -1,8 +1,10 @@
1
1
  import { OrderItemBase } from '@snabcentr/common-lib';
2
+ import { IOrderEmits } from '../../../orders/interfaces/events/i-order-emits';
3
+ import { Emitter } from 'mitt';
2
4
  /**
3
5
  * Компонент представления кратких данных о продукте заказа.
4
6
  */
5
- declare const _default: import('vue').DefineComponent<{
7
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
6
8
  /**
7
9
  * Данные о продукте в заказе.
8
10
  */
@@ -11,6 +13,19 @@ declare const _default: import('vue').DefineComponent<{
11
13
  * Номер позиции в списке.
12
14
  */
13
15
  index: number;
16
+ /**
17
+ * Механизм, обеспечивающий генерацию событий заказа.
18
+ */
19
+ eventEmitter?: Emitter<IOrderEmits>;
20
+ /**
21
+ * Признак возможности редактирования параметров позиции заказа.
22
+ */
23
+ allowEdit?: boolean;
24
+ /**
25
+ * Признак отправки количества по мере ввода. Если выключен, количество отправляется
26
+ * по завершении ввода, и на каждый введённый символ запрос не уходит.
27
+ */
28
+ updateQuantityOnInput?: boolean;
14
29
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
15
30
  /**
16
31
  * Данные о продукте в заказе.
@@ -20,5 +35,29 @@ declare const _default: import('vue').DefineComponent<{
20
35
  * Номер позиции в списке.
21
36
  */
22
37
  index: number;
23
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
38
+ /**
39
+ * Механизм, обеспечивающий генерацию событий заказа.
40
+ */
41
+ eventEmitter?: Emitter<IOrderEmits>;
42
+ /**
43
+ * Признак возможности редактирования параметров позиции заказа.
44
+ */
45
+ allowEdit?: boolean;
46
+ /**
47
+ * Признак отправки количества по мере ввода. Если выключен, количество отправляется
48
+ * по завершении ввода, и на каждый введённый символ запрос не уходит.
49
+ */
50
+ updateQuantityOnInput?: boolean;
51
+ }> & Readonly<{}>, {
52
+ eventEmitter: Emitter<IOrderEmits>;
53
+ allowEdit: boolean;
54
+ updateQuantityOnInput: boolean;
55
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, {
56
+ actions?(_: {}): any;
57
+ }>;
24
58
  export default _default;
59
+ type __VLS_WithTemplateSlots<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
@@ -1 +1,2 @@
1
+ export * from './use-compact-layout';
1
2
  export * from './use-hover-support';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Признак узкого экрана: телефон или планшет.
3
+ *
4
+ * На компьютере списки остаются таблицами.
5
+ */
6
+ export declare function useCompactLayout(): {
7
+ isCompactLayout: import('vue').ComputedRef<boolean>;
8
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Добавляет запись о версии приложения в список `.sc-versions-list`.
3
+ * Если запись с тем же названием приложения уже есть, повторно не добавляет.
4
+ *
5
+ * @param appName Отображаемое название приложения.
6
+ * @param version Версия приложения.
7
+ * @param releaseDate Дата релиза.
8
+ */
9
+ export declare function showAppVersion(appName: string, version: string, releaseDate: Date): void;
@@ -1,7 +1,9 @@
1
+ export * from './app-version-helper';
1
2
  export * from './content-helper';
2
3
  export * from './file-helper';
3
4
  export * from './entity-name-helper';
4
5
  export * from './input-helper';
6
+ export * from './pagination-items-prefix';
5
7
  export * from './select-option-helper';
6
8
  export * from './validators';
7
9
  export * from './product-info-helper';
@@ -0,0 +1,7 @@
1
+ import { PaginationInfo } from 'naive-ui';
2
+ /**
3
+ * Подпись с общим числом записей для префикса пагинации Naive UI.
4
+ *
5
+ * @param info Состояние пагинации Naive UI.
6
+ */
7
+ export declare function paginationItemsPrefix(info: PaginationInfo): string;
@@ -0,0 +1,10 @@
1
+ import { IOrderProperty } from './i-order-property';
2
+ /**
3
+ * Свойства блока внешних ссылок заказа.
4
+ */
5
+ export interface IOrderExternalLinksProperty extends IOrderProperty {
6
+ /**
7
+ * Признак отображения кнопки открытия заказа в ERP. Нужен там, где рядом нет отдельной кнопки ERP (например, в превью заказа).
8
+ */
9
+ showErpLink?: boolean;
10
+ }
@@ -7,6 +7,7 @@ export * from './i-debounced';
7
7
  export * from './i-default-country';
8
8
  export * from './i-disabled';
9
9
  export * from './i-min-term-length';
10
+ export * from './i-order-external-links-property';
10
11
  export * from './i-order-info-property';
11
12
  export * from './i-order-property';
12
13
  export * from './i-order-short-info-property';
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": "5.4.0",
7
+ "version": "5.5.0",
8
8
  "license": "ISC",
9
9
  "scripts": {
10
10
  "dev": "vite",
@@ -51,7 +51,7 @@
51
51
  "@iconify-json/logos": "^1.2.9",
52
52
  "@iconify-json/mdi": "^1.2.3",
53
53
  "@iconify-json/tabler": "^1.2.23",
54
- "@snabcentr/common-lib": "^3.0.0",
54
+ "@snabcentr/common-lib": "^3.5.1",
55
55
  "@tailwindcss/container-queries": "^0.1.1",
56
56
  "date-fns": "^3.6.0",
57
57
  "libphonenumber-js": "^1.12.23",