@profitliga/ui 2.0.1 → 2.0.3

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 (40) hide show
  1. package/dist/components/BottomSheet/BottomSheet.css +1 -1
  2. package/dist/components/BottomSheet/BottomSheet.vue.js +1 -1
  3. package/dist/components/BottomSheet/BottomSheet.vue2.js +56 -56
  4. package/dist/components/Drawer/Drawer.vue.d.ts +1 -1
  5. package/dist/components/Drawer/Drawer.vue.js +4 -4
  6. package/dist/components/RangeCalendar/RangeCalendar.css +1 -1
  7. package/dist/components/RangeCalendar/RangeCalendar.vue.js +2 -2
  8. package/dist/components/RangeCalendar/RangeCalendar.vue2.js +42 -42
  9. package/dist/components/v2/Checkbox/Checkbox.css +1 -1
  10. package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
  11. package/dist/components/v2/Checkbox/Checkbox.vue2.js +26 -26
  12. package/dist/components/v2/Combobox/Combobox.css +1 -1
  13. package/dist/components/v2/Combobox/Combobox.types.d.ts +63 -3
  14. package/dist/components/v2/Combobox/Combobox.vue.d.ts +24 -52
  15. package/dist/components/v2/Combobox/Combobox.vue.js +2 -2
  16. package/dist/components/v2/Combobox/Combobox.vue2.js +328 -257
  17. package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
  18. package/dist/components/v2/Divider/Divider.css +1 -1
  19. package/dist/components/v2/Divider/Divider.vue.js +2 -2
  20. package/dist/components/v2/Divider/Divider.vue2.js +10 -10
  21. package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
  22. package/dist/components/v2/File/FilePreviewDialog.vue.d.ts +1 -1
  23. package/dist/components/v2/FileUpload/FileUpload.vue.d.ts +1 -1
  24. package/dist/components/v2/FileUpload/FileUploadInline.vue.d.ts +1 -1
  25. package/dist/components/v2/Input/Input.css +1 -1
  26. package/dist/components/v2/Input/Input.vue.js +2 -2
  27. package/dist/components/v2/Input/Input.vue2.js +113 -107
  28. package/dist/components/v2/InputNumber/InputNumber.css +1 -1
  29. package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
  30. package/dist/components/v2/InputNumber/InputNumber.vue2.js +2 -2
  31. package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +1 -1
  32. package/dist/components/v2/Popover/Popover.vue.d.ts +1 -1
  33. package/dist/components/v2/Select/Select.css +1 -1
  34. package/dist/components/v2/Select/Select.types.d.ts +50 -3
  35. package/dist/components/v2/Select/Select.vue.d.ts +20 -40
  36. package/dist/components/v2/Select/Select.vue.js +1 -1
  37. package/dist/components/v2/Select/Select.vue2.js +191 -162
  38. package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +1 -1
  39. package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +1 -1
  40. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Component } from 'vue';
1
+ import { Component, VNodeChild } from 'vue';
2
2
  import { TBreakpoints } from '../../../types/global.types';
3
3
  import { PopoverAlign, PopoverSide } from '../Popover';
4
4
  export type SelectSize = 'small' | 'default' | 'large';
@@ -12,8 +12,55 @@ export interface SelectOptionData {
12
12
  /** Картинка 12×12 (аватар) перед подписью выбранного значения. */
13
13
  avatar?: string;
14
14
  }
15
- export interface SelectProps {
16
- options: SelectOptionData[];
15
+ /**
16
+ * Слоты перекрывают то, что компонент рисует по данным варианта: сначала
17
+ * проверяется слот, и только без него в дело идёт `label` и тексты из пропов.
18
+ *
19
+ * Набор намеренно повторяет `ComboboxSlots` — компоненты соседние, и
20
+ * разъехавшийся API слотов заставлял бы переучиваться при переходе с одного
21
+ * на другой. Строки загрузки у `Select` нет, поэтому нет и слота `loading`.
22
+ */
23
+ export interface SelectSlots<T extends SelectOptionData = SelectOptionData> {
24
+ /**
25
+ * Строка списка. Маркер выбора остаётся снаружи слота — он часть
26
+ * механики выбора, а не содержимого варианта.
27
+ *
28
+ * Внутри `role="option"`, поэтому интерактивные элементы (кнопки, ссылки,
29
+ * поля) сюда класть нельзя: скринридер до них не доберётся.
30
+ */
31
+ option?: (props: {
32
+ option: T;
33
+ /** Вариант входит в текущее значение. */
34
+ selected: boolean;
35
+ /** Строка под курсором или выбрана с клавиатуры. */
36
+ active: boolean;
37
+ index: number;
38
+ }) => VNodeChild;
39
+ /**
40
+ * Содержимое чипа выбранного значения при `multiple`. Кнопка «убрать»
41
+ * остаётся снаружи — без неё значение нечем снять.
42
+ *
43
+ * Ширину чипов компонент меряет, чтобы спрятать лишние за счётчик «+n»:
44
+ * содержимое переменной ширины это переживает, а вот `width` в процентах
45
+ * внутри слота меряться будет не от того.
46
+ */
47
+ chip?: (props: {
48
+ option: T;
49
+ index: number;
50
+ }) => VNodeChild;
51
+ /**
52
+ * Выбранное значение в поле — только при одиночном выборе. При `multiple`
53
+ * его место занимают чипы, и слот не вызывается.
54
+ */
55
+ value?: (props: {
56
+ option: T | undefined;
57
+ displayValue: string;
58
+ }) => VNodeChild;
59
+ /** Пустой список: вариантов не передали вовсе. */
60
+ empty?: () => VNodeChild;
61
+ }
62
+ export interface SelectProps<T extends SelectOptionData = SelectOptionData> {
63
+ options: T[];
17
64
  /** Множественный выбор: список не закрывается, значения показываются чипами. */
18
65
  multiple?: boolean;
19
66
  /** Подпись над полем. */
@@ -1,41 +1,21 @@
1
- import { SelectOptionData, SelectProps, SelectValue, SelectSize } from './Select.types';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- import { TBreakpoints } from '../../../types/global.types';
4
- import { PopoverSide, PopoverAlign } from '..';
5
- type __VLS_Props = SelectProps;
6
- type __VLS_PublicProps = {
7
- modelValue?: SelectValue | SelectValue[] | undefined;
8
- } & __VLS_Props;
9
- declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
10
- "update:modelValue": (value: SelectValue | SelectValue[] | undefined) => any;
11
- select: (option: SelectOptionData) => any;
12
- change: (value: SelectValue | SelectValue[] | undefined) => any;
13
- }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
- "onUpdate:modelValue"?: ((value: SelectValue | SelectValue[] | undefined) => any) | undefined;
15
- onSelect?: ((option: SelectOptionData) => any) | undefined;
16
- onChange?: ((value: SelectValue | SelectValue[] | undefined) => any) | undefined;
17
- }>, {
18
- multiple: boolean;
19
- label: string;
20
- size: SelectSize;
21
- placeholder: string;
22
- disabled: boolean;
23
- width: number;
24
- breakpointMobile: TBreakpoints;
25
- invalid: boolean;
26
- errorText: string;
27
- side: PopoverSide;
28
- sideOffset: number;
29
- align: PopoverAlign;
30
- alignOffset: number;
31
- ariaLabel: string;
32
- testId: string;
33
- supportText: string;
34
- }, {}, {}, {}, string, ComponentProvideOptions, false, {
35
- fieldRef: HTMLDivElement;
36
- listRef: HTMLDivElement;
37
- contentRef: HTMLDivElement;
38
- chipsRef: HTMLSpanElement;
39
- counterRef: HTMLSpanElement;
40
- }, any>;
1
+ import { SelectOptionData, SelectProps, SelectSlots, SelectValue } from './Select.types';
2
+ import { VNodeProps, AllowedComponentProps, ComponentCustomProps, PublicProps, ShallowUnwrapRef, VNode } from 'vue';
3
+ declare const _default: <T extends SelectOptionData = SelectOptionData>(__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<{
4
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
+ readonly "onUpdate:modelValue"?: ((value: SelectValue | SelectValue[] | undefined) => any) | undefined;
6
+ readonly onSelect?: ((option: T) => any) | undefined;
7
+ readonly onChange?: ((value: SelectValue | SelectValue[] | undefined) => any) | undefined;
8
+ } & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, "onUpdate:modelValue" | "onChange" | "onSelect"> & ({
9
+ modelValue?: SelectValue | SelectValue[] | undefined;
10
+ } & SelectProps<T>) & Partial<{}>> & PublicProps;
11
+ expose(exposed: ShallowUnwrapRef<{}>): void;
12
+ attrs: any;
13
+ slots: Readonly<SelectSlots<T>> & SelectSlots<T>;
14
+ emit: (((evt: "select", option: T) => void) & ((evt: "change", value: SelectValue | SelectValue[] | undefined) => void)) & ((evt: "update:modelValue", value: SelectValue | SelectValue[] | undefined) => void);
15
+ }>) => VNode & {
16
+ __ctx?: Awaited<typeof __VLS_setup>;
17
+ };
41
18
  export default _default;
19
+ type __VLS_PrettifyLocal<T> = {
20
+ [K in keyof T]: T[K];
21
+ } & {};
@@ -2,7 +2,7 @@ import './Select.css';
2
2
  import o from "./Select.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
5
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b9512ce4"]]);
5
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ec306731"]]);
6
6
  export {
7
7
  m as default
8
8
  };