@profitliga/ui 2.0.3 → 2.0.4
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.
- package/dist/components/AlertDialog/AlertDialogAction.vue.js +2 -3
- package/dist/components/AlertDialog/AlertDialogCancel.vue.js +8 -9
- package/dist/components/AlertDialog/AlertDialogTrigger.vue.js +7 -8
- package/dist/components/Button/Button.css +1 -1
- package/dist/components/Button/Button.vue.js +5 -52
- package/dist/components/Button/Button.vue2.js +52 -3
- package/dist/components/Calendar/CalendarNext.vue.js +3 -4
- package/dist/components/Calendar/CalendarPrev.vue.js +7 -8
- package/dist/components/ConfirmDialog/ConfirmDialog.vue2.js +11 -12
- package/dist/components/DatePicker/DatePickerNext.vue.js +1 -2
- package/dist/components/DatePicker/DatePickerPrev.vue.js +7 -8
- package/dist/components/DateRangePicker/DateRangePickerNext.vue.js +6 -7
- package/dist/components/DateRangePicker/DateRangePickerPrev.vue.js +7 -8
- package/dist/components/RangeCalendar/RangeCalendarNext.vue.js +3 -4
- package/dist/components/RangeCalendar/RangeCalendarPrev.vue.js +3 -4
- package/dist/components/Schedule/Schedule.vue2.js +38 -39
- package/dist/components/index.js +391 -392
- package/dist/components/v2/AlertDialog/AlertDialog.css +1 -1
- package/dist/components/v2/AlertDialog/AlertDialog.types.d.ts +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue.d.ts +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue.js +2 -2
- package/dist/components/v2/AlertDialog/AlertDialog.vue2.js +29 -29
- package/dist/components/v2/Checkbox/Checkbox.css +1 -1
- package/dist/components/v2/Checkbox/Checkbox.types.d.ts +11 -0
- package/dist/components/v2/Checkbox/Checkbox.vue.d.ts +2 -0
- package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
- package/dist/components/v2/Checkbox/Checkbox.vue2.js +61 -49
- package/dist/components/v2/Combobox/Combobox.css +1 -1
- package/dist/components/v2/Combobox/Combobox.types.d.ts +14 -2
- package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
- package/dist/components/v2/Combobox/Combobox.vue2.js +190 -181
- package/dist/components/v2/ConfirmDialog/ConfirmDialog.types.d.ts +2 -2
- package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.d.ts +2 -2
- package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.js +6 -6
- package/dist/components/v2/DatePicker/DatePicker.css +1 -1
- package/dist/components/v2/DatePicker/DatePicker.types.d.ts +2 -2
- package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
- package/dist/components/v2/DatePicker/DatePicker.vue.js +2 -2
- package/dist/components/v2/DatePicker/DatePicker.vue2.js +54 -54
- package/dist/components/v2/Divider/Divider.types.d.ts +8 -0
- package/dist/components/v2/DropdownMenu/DropdownMenu.types.d.ts +2 -2
- package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/v2/DropdownMenu/DropdownMenu.vue2.js +6 -6
- package/dist/components/v2/FileUpload/FileUpload.css +1 -1
- package/dist/components/v2/FileUpload/FileUpload.vue.js +2 -2
- package/dist/components/v2/FileUpload/FileUpload.vue2.js +16 -16
- package/dist/components/v2/FormField/FormField.css +1 -0
- package/dist/components/v2/FormField/FormField.types.d.ts +48 -0
- package/dist/components/v2/FormField/FormField.vue.d.ts +25 -0
- package/dist/components/v2/FormField/FormField.vue.js +8 -0
- package/dist/components/v2/FormField/FormField.vue2.js +54 -0
- package/dist/components/v2/FormField/index.d.ts +3 -0
- package/dist/components/v2/Image/Image.css +1 -0
- package/dist/components/v2/Image/Image.types.d.ts +26 -0
- package/dist/components/v2/Image/Image.vue.d.ts +16 -0
- package/dist/components/v2/Image/Image.vue.js +8 -0
- package/dist/components/v2/Image/Image.vue2.js +91 -0
- package/dist/components/v2/Image/ImageList.css +1 -0
- package/dist/components/v2/Image/ImageList.types.d.ts +28 -0
- package/dist/components/v2/Image/ImageList.vue.d.ts +15 -0
- package/dist/components/v2/Image/ImageList.vue.js +8 -0
- package/dist/components/v2/Image/ImageList.vue2.js +38 -0
- package/dist/components/v2/Image/index.d.ts +5 -0
- package/dist/components/v2/InputNumber/InputNumber.css +1 -1
- package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
- package/dist/components/v2/InputNumber/InputNumber.vue2.js +22 -21
- package/dist/components/v2/InputSelect/InputSelect.types.d.ts +2 -2
- package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +2 -2
- package/dist/components/v2/InputSelect/InputSelect.vue.js +14 -14
- package/dist/components/v2/InputSelect/InputSelectChip.css +1 -1
- package/dist/components/v2/InputSelect/InputSelectChip.vue.d.ts +3 -3
- package/dist/components/v2/InputSelect/InputSelectChip.vue.js +2 -2
- package/dist/components/v2/InputSelect/InputSelectChip.vue2.js +17 -17
- package/dist/components/v2/Popover/Popover.css +1 -1
- package/dist/components/v2/Popover/Popover.types.d.ts +2 -2
- package/dist/components/v2/Popover/Popover.vue.d.ts +2 -2
- package/dist/components/v2/Popover/Popover.vue.js +2 -2
- package/dist/components/v2/Popover/Popover.vue2.js +24 -24
- package/dist/components/v2/Radio/Radio.css +1 -1
- package/dist/components/v2/Radio/Radio.vue.d.ts +4 -0
- package/dist/components/v2/Radio/Radio.vue.js +1 -1
- package/dist/components/v2/Radio/Radio.vue2.js +57 -49
- package/dist/components/v2/Schedule/Schedule.css +1 -1
- package/dist/components/v2/Schedule/Schedule.types.d.ts +2 -2
- package/dist/components/v2/Schedule/Schedule.vue.d.ts +2 -2
- package/dist/components/v2/Schedule/Schedule.vue.js +3 -3
- package/dist/components/v2/Schedule/Schedule.vue2.js +55 -55
- package/dist/components/v2/Select/Select.css +1 -1
- package/dist/components/v2/Select/Select.types.d.ts +8 -2
- package/dist/components/v2/Select/Select.vue.js +3 -3
- package/dist/components/v2/Select/Select.vue2.js +102 -92
- package/dist/components/v2/Toast/Toast.types.d.ts +2 -2
- package/dist/components/v2/Toast/Toaster.css +1 -1
- package/dist/components/v2/Toast/Toaster.vue.d.ts +2 -2
- package/dist/components/v2/Toast/Toaster.vue.js +1 -1
- package/dist/components/v2/Toast/Toaster.vue2.js +17 -17
- package/dist/components/v2/Tooltip/Tooltip.css +1 -1
- package/dist/components/v2/Tooltip/Tooltip.types.d.ts +2 -2
- package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +2 -2
- package/dist/components/v2/Tooltip/Tooltip.vue.js +1 -1
- package/dist/components/v2/Tooltip/Tooltip.vue2.js +39 -38
- package/dist/components/v2/Tooltip/TooltipContent.css +1 -1
- package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +2 -2
- package/dist/components/v2/Tooltip/TooltipContent.vue.js +2 -2
- package/dist/components/v2/Tooltip/TooltipContent.vue2.js +20 -20
- package/dist/components/v2/Tooltip/vTooltip.directive.js +40 -41
- package/dist/components/v2/index.d.ts +2 -0
- package/dist/components/v2/index.js +82 -76
- package/dist/components/v2/shared/isHtmlElement.util.d.ts +15 -0
- package/dist/components/v2/shared/isHtmlElement.util.js +10 -0
- package/dist/components/v2/shared/useIsMobile.util.d.ts +13 -0
- package/dist/components/v2/shared/useIsMobile.util.js +8 -0
- package/dist/components/v2/shared/useTriggerAria.util.js +4 -3
- package/dist/types/global.types.d.ts +10 -0
- package/package.json +3 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface FormFieldProps {
|
|
2
|
+
/**
|
|
3
|
+
* Подпись над контролом. Для подписи сложнее строки есть слот `label` —
|
|
4
|
+
* например «Комментарий» с уточнением мелким шрифтом рядом.
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Обязательное поле: к подписи добавляется красная звёздочка, контрол
|
|
9
|
+
* получает `required` через проп слота. Проверку значения обёртка на себя
|
|
10
|
+
* не берёт — это забота формы.
|
|
11
|
+
*/
|
|
12
|
+
required?: boolean;
|
|
13
|
+
/** Состояние ошибки: подпись краснеет, показывается `errorMessage`. */
|
|
14
|
+
error?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Текст ошибки под контролом. Показывается только при `error: true`,
|
|
17
|
+
* поэтому проп можно держать заполненным постоянно — так же, как у `Input`.
|
|
18
|
+
*/
|
|
19
|
+
errorMessage?: string;
|
|
20
|
+
/** Пояснение под контролом. В состоянии ошибки его место занимает `errorMessage`. */
|
|
21
|
+
supportText?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Свой `id` контрола. По умолчанию генерируется — его нужно прокинуть в
|
|
24
|
+
* контрол из пропов слота, иначе клик по подписи не наведёт фокус.
|
|
25
|
+
*/
|
|
26
|
+
id?: string;
|
|
27
|
+
/** Базовый `data-testid`; внутренние части получают суффикс имени части. */
|
|
28
|
+
testId?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Обёртка не знает, что за контрол внутри, поэтому связывающие атрибуты
|
|
32
|
+
* отдаёт наружу: проставить их на нужный элемент может только потребитель.
|
|
33
|
+
*/
|
|
34
|
+
export interface FormFieldSlotProps {
|
|
35
|
+
/** `id` для контрола — на него ссылается `for` подписи. */
|
|
36
|
+
id: string;
|
|
37
|
+
/** `id` подписи под контролом; уходит в `aria-describedby` контрола. */
|
|
38
|
+
describedBy: string | undefined;
|
|
39
|
+
/** Дублирует проп `required` — чтобы не передавать его дважды. */
|
|
40
|
+
required: boolean;
|
|
41
|
+
/** Дублирует проп `error` — обычно уходит в `aria-invalid` контрола. */
|
|
42
|
+
error: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface FormFieldSlots {
|
|
45
|
+
default: (props: FormFieldSlotProps) => unknown;
|
|
46
|
+
/** Подпись целиком — вместо пропа `label`. Звёздочка добавляется сама. */
|
|
47
|
+
label?: () => unknown;
|
|
48
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormFieldProps, FormFieldSlots } from './FormField.types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: Readonly<FormFieldSlots> & FormFieldSlots;
|
|
6
|
+
refs: {};
|
|
7
|
+
rootEl: any;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
10
|
+
declare const __VLS_component: DefineComponent<FormFieldProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FormFieldProps> & Readonly<{}>, {
|
|
11
|
+
label: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
id: string;
|
|
14
|
+
error: boolean;
|
|
15
|
+
errorMessage: string;
|
|
16
|
+
testId: string;
|
|
17
|
+
supportText: string;
|
|
18
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as q, useSlots as B, useId as T, computed as s, openBlock as a, createElementBlock as d, mergeProps as t, unref as l, renderSlot as v, createTextVNode as $, toDisplayString as p, createCommentVNode as n, createElementVNode as h } from "vue";
|
|
2
|
+
import { useTestId as k } from "../shared/useTestId.util.js";
|
|
3
|
+
const _ = ["for"], S = /* @__PURE__ */ q({
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "FormField",
|
|
6
|
+
props: {
|
|
7
|
+
label: { default: void 0 },
|
|
8
|
+
required: { type: Boolean, default: !1 },
|
|
9
|
+
error: { type: Boolean, default: !1 },
|
|
10
|
+
errorMessage: { default: void 0 },
|
|
11
|
+
supportText: { default: void 0 },
|
|
12
|
+
id: { default: void 0 },
|
|
13
|
+
testId: { default: void 0 }
|
|
14
|
+
},
|
|
15
|
+
setup(r) {
|
|
16
|
+
const e = r, b = B(), o = k(() => e.testId), i = T(), c = s(() => e.id ?? `${i}-form-field`), g = `${i}-form-field-label`, m = `${i}-form-field-message`, y = s(() => !!(e.label || b.label)), u = s(() => e.error ? e.errorMessage ?? e.supportText : e.supportText), I = s(() => [
|
|
17
|
+
"form-field-v2",
|
|
18
|
+
{ "form-field-v2--error": e.error }
|
|
19
|
+
]);
|
|
20
|
+
return (f, x) => (a(), d("div", t({ class: I.value }, { ...f.$attrs, ...l(o)("root") }), [
|
|
21
|
+
y.value ? (a(), d("label", t({
|
|
22
|
+
key: 0,
|
|
23
|
+
id: g,
|
|
24
|
+
class: "form-field-v2__label",
|
|
25
|
+
for: c.value
|
|
26
|
+
}, l(o)("label")), [
|
|
27
|
+
v(f.$slots, "label", {}, () => [
|
|
28
|
+
$(p(r.label), 1)
|
|
29
|
+
], !0),
|
|
30
|
+
r.required ? (a(), d("span", t({
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "form-field-v2__required",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, l(o)("required")), "*", 16)) : n("", !0)
|
|
35
|
+
], 16, _)) : n("", !0),
|
|
36
|
+
h("div", t({ class: "form-field-v2__control" }, l(o)("control")), [
|
|
37
|
+
v(f.$slots, "default", {
|
|
38
|
+
id: c.value,
|
|
39
|
+
describedBy: u.value ? m : void 0,
|
|
40
|
+
required: r.required,
|
|
41
|
+
error: r.error
|
|
42
|
+
}, void 0, !0)
|
|
43
|
+
], 16),
|
|
44
|
+
u.value ? (a(), d("p", t({
|
|
45
|
+
key: 1,
|
|
46
|
+
id: m,
|
|
47
|
+
class: "form-field-v2__message"
|
|
48
|
+
}, l(o)("message")), p(u.value), 17)) : n("", !0)
|
|
49
|
+
], 16));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export {
|
|
53
|
+
S as default
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.image-v2[data-v-9056dfcb]{--image-v2-size:3rem;--image-v2-radius:.25rem;width:var(--image-v2-size);height:var(--image-v2-size);flex-shrink:0;position:relative}.image-v2--small[data-v-9056dfcb]{--image-v2-size:2rem;--image-v2-radius:.5rem}.image-v2--medium[data-v-9056dfcb]{--image-v2-size:3rem;--image-v2-radius:.25rem}.image-v2--large[data-v-9056dfcb]{--image-v2-size:6.625rem;--image-v2-radius:.5rem}.image-v2--full[data-v-9056dfcb]{--image-v2-size:100%;--image-v2-radius:0;aspect-ratio:1;height:auto}.image-v2__frame[data-v-9056dfcb]{border-radius:var(--image-v2-radius);background:0 0;border:none;width:100%;height:100%;padding:0;display:block;position:relative;overflow:hidden}.image-v2__picture[data-v-9056dfcb]{object-fit:cover;width:100%;height:100%;display:block}.image-v2__overlay[data-v-9056dfcb]{color:var(--theme-neutral-0);opacity:0;transition:opacity var(--animation-duration-fast) ease-in-out;background-color:#16161666;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.image-v2__overlay-icon[data-v-9056dfcb]{width:1.25rem;height:1.25rem}.image-v2--preview .image-v2__frame[data-v-9056dfcb]{cursor:pointer}.image-v2--preview .image-v2__frame[data-v-9056dfcb]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.image-v2--preview .image-v2__frame:hover .image-v2__overlay[data-v-9056dfcb],.image-v2--preview .image-v2__frame:focus-visible .image-v2__overlay[data-v-9056dfcb]{opacity:1}.image-v2__delete[data-v-9056dfcb]{z-index:1;background-color:var(--theme-secondary-250);width:1.125rem;height:1.125rem;color:var(--theme-neutral-text-title);cursor:pointer;border:none;border-radius:50%;justify-content:center;align-items:center;padding:0;display:flex;position:absolute;top:-.5625rem;right:-.5625rem}.image-v2__delete[data-v-9056dfcb]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.image-v2__delete[data-v-9056dfcb]:hover{background-color:var(--theme-secondary-300)}.image-v2__delete-icon[data-v-9056dfcb]{width:.75rem;height:.75rem}.image-v2__preview[data-v-9056dfcb]{justify-content:center;align-items:center;width:100%;display:flex}.image-v2__preview-picture[data-v-9056dfcb]{object-fit:contain;max-width:100%;max-height:70dvh}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Размер плитки. `full` растягивает картинку по контейнеру. */
|
|
2
|
+
export type ImageSize = 'small' | 'medium' | 'large' | 'full';
|
|
3
|
+
export interface ImageProps {
|
|
4
|
+
/** Ссылка на картинку. */
|
|
5
|
+
src: string;
|
|
6
|
+
/**
|
|
7
|
+
* Описание картинки. Пустая строка — картинка декоративная и скрывается от
|
|
8
|
+
* скринридера; так же ведёт себя нативный `<img alt="">`.
|
|
9
|
+
*/
|
|
10
|
+
alt?: string;
|
|
11
|
+
size?: ImageSize;
|
|
12
|
+
/** Показывать крестик удаления. Нажатие эмитит `delete`, сам ничего не удаляет. */
|
|
13
|
+
deletable?: boolean;
|
|
14
|
+
/** Доступное имя крестика удаления. */
|
|
15
|
+
deleteLabel?: string;
|
|
16
|
+
/** Клик по картинке открывает её на весь экран. */
|
|
17
|
+
preview?: boolean;
|
|
18
|
+
/** Доступное имя плитки, когда она открывает просмотр. */
|
|
19
|
+
previewLabel?: string;
|
|
20
|
+
/** Базовый `data-testid`; внутренние части получают суффикс имени части. */
|
|
21
|
+
testId?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ImageEmits {
|
|
24
|
+
/** Нажат крестик удаления. */
|
|
25
|
+
delete: [];
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ImageProps, ImageSize } from './Image.types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
declare const _default: DefineComponent<ImageProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
4
|
+
delete: () => any;
|
|
5
|
+
}, string, PublicProps, Readonly<ImageProps> & Readonly<{
|
|
6
|
+
onDelete?: (() => any) | undefined;
|
|
7
|
+
}>, {
|
|
8
|
+
size: ImageSize;
|
|
9
|
+
alt: string;
|
|
10
|
+
testId: string;
|
|
11
|
+
deletable: boolean;
|
|
12
|
+
preview: boolean;
|
|
13
|
+
deleteLabel: string;
|
|
14
|
+
previewLabel: string;
|
|
15
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent as C, ref as I, computed as f, openBlock as r, createElementBlock as n, mergeProps as o, unref as t, createVNode as w, createCommentVNode as v, createBlock as b, resolveDynamicComponent as B, withCtx as m, createElementVNode as u, createTextVNode as N, toDisplayString as $ } from "vue";
|
|
2
|
+
import { X as h, Eye as L } from "@lucide/vue";
|
|
3
|
+
import V from "../Dialog/Dialog.vue.js";
|
|
4
|
+
import { useTestId as x } from "../shared/useTestId.util.js";
|
|
5
|
+
const D = ["aria-label"], E = ["src", "alt"], z = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "image-v2__overlay",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, A = ["src", "alt"], U = /* @__PURE__ */ C({
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
__name: "Image",
|
|
12
|
+
props: {
|
|
13
|
+
src: {},
|
|
14
|
+
alt: { default: "" },
|
|
15
|
+
size: { default: "medium" },
|
|
16
|
+
deletable: { type: Boolean, default: !1 },
|
|
17
|
+
deleteLabel: { default: "Удалить изображение" },
|
|
18
|
+
preview: { type: Boolean, default: !1 },
|
|
19
|
+
previewLabel: { default: void 0 },
|
|
20
|
+
testId: { default: void 0 }
|
|
21
|
+
},
|
|
22
|
+
emits: ["delete"],
|
|
23
|
+
setup(e, { emit: p }) {
|
|
24
|
+
const l = e, g = p, i = x(() => l.testId), s = I(!1), c = f(
|
|
25
|
+
() => l.previewLabel || l.alt || "Открыть изображение"
|
|
26
|
+
), y = f(() => [
|
|
27
|
+
"image-v2",
|
|
28
|
+
`image-v2--${l.size}`,
|
|
29
|
+
{ "image-v2--preview": l.preview }
|
|
30
|
+
]);
|
|
31
|
+
return (k, a) => (r(), n("div", o({ class: y.value }, { ...k.$attrs, ...t(i)("root") }), [
|
|
32
|
+
e.deletable ? (r(), n("button", o({
|
|
33
|
+
key: 0,
|
|
34
|
+
type: "button",
|
|
35
|
+
class: "image-v2__delete",
|
|
36
|
+
"aria-label": e.deleteLabel
|
|
37
|
+
}, t(i)("delete"), {
|
|
38
|
+
onClick: a[0] || (a[0] = (d) => g("delete"))
|
|
39
|
+
}), [
|
|
40
|
+
w(t(h), {
|
|
41
|
+
class: "image-v2__delete-icon",
|
|
42
|
+
"aria-hidden": "true"
|
|
43
|
+
})
|
|
44
|
+
], 16, D)) : v("", !0),
|
|
45
|
+
(r(), b(B(e.preview ? "button" : "div"), o({
|
|
46
|
+
type: e.preview ? "button" : void 0,
|
|
47
|
+
"aria-label": e.preview ? c.value : void 0,
|
|
48
|
+
class: "image-v2__frame"
|
|
49
|
+
}, t(i)("frame"), {
|
|
50
|
+
onClick: a[1] || (a[1] = (d) => e.preview ? s.value = !0 : void 0)
|
|
51
|
+
}), {
|
|
52
|
+
default: m(() => [
|
|
53
|
+
u("img", o({
|
|
54
|
+
class: "image-v2__picture",
|
|
55
|
+
src: e.src,
|
|
56
|
+
alt: e.alt
|
|
57
|
+
}, t(i)("picture")), null, 16, E),
|
|
58
|
+
e.preview ? (r(), n("span", z, [
|
|
59
|
+
w(t(L), { class: "image-v2__overlay-icon" })
|
|
60
|
+
])) : v("", !0)
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 16, ["type", "aria-label"])),
|
|
64
|
+
e.preview ? (r(), b(t(V), {
|
|
65
|
+
key: 1,
|
|
66
|
+
open: s.value,
|
|
67
|
+
"onUpdate:open": a[2] || (a[2] = (d) => s.value = d),
|
|
68
|
+
width: 960,
|
|
69
|
+
"close-button": { enabled: !0, label: "Закрыть просмотр" },
|
|
70
|
+
"test-id": e.testId ? `${e.testId}-preview` : void 0
|
|
71
|
+
}, {
|
|
72
|
+
title: m(() => [
|
|
73
|
+
N($(c.value), 1)
|
|
74
|
+
]),
|
|
75
|
+
default: m(() => [
|
|
76
|
+
u("div", o({ class: "image-v2__preview" }, t(i)("preview")), [
|
|
77
|
+
u("img", {
|
|
78
|
+
class: "image-v2__preview-picture",
|
|
79
|
+
src: e.src,
|
|
80
|
+
alt: e.alt
|
|
81
|
+
}, null, 8, A)
|
|
82
|
+
], 16)
|
|
83
|
+
]),
|
|
84
|
+
_: 1
|
|
85
|
+
}, 8, ["open", "test-id"])) : v("", !0)
|
|
86
|
+
], 16));
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
U as default
|
|
91
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.image-list-v2[data-v-2691f19b]{flex-wrap:wrap;gap:1.25rem;display:flex}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ImageSize } from './Image.types';
|
|
2
|
+
export interface ImageListProps {
|
|
3
|
+
/**
|
|
4
|
+
* Ссылки на картинки. Именно массив строк, а не модель файла: у превью,
|
|
5
|
+
* пришедшего с сервера, нет ни имени, ни размера, ни mime — только адрес.
|
|
6
|
+
* Для файлов с метаданными есть `FileUpload`.
|
|
7
|
+
*/
|
|
8
|
+
items: string[];
|
|
9
|
+
size?: ImageSize;
|
|
10
|
+
/** Показывать крестик удаления у каждой плитки. */
|
|
11
|
+
deletable?: boolean;
|
|
12
|
+
/** Клик по плитке открывает картинку на весь экран. */
|
|
13
|
+
preview?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Как назвать плитку номер N для скринридера. По умолчанию —
|
|
16
|
+
* «Изображение 1», «Изображение 2» и так далее.
|
|
17
|
+
*/
|
|
18
|
+
itemLabel?: (index: number, src: string) => string;
|
|
19
|
+
/** Базовый `data-testid`; внутренние части получают суффикс имени части. */
|
|
20
|
+
testId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ImageListEmits {
|
|
23
|
+
/**
|
|
24
|
+
* Нажат крестик на плитке. Список ничего не удаляет сам — правит массив
|
|
25
|
+
* потребитель, как и у остальных полей v2.
|
|
26
|
+
*/
|
|
27
|
+
delete: [index: number, src: string];
|
|
28
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ImageListProps } from './ImageList.types';
|
|
2
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
+
import { ImageSize } from './Image.types';
|
|
4
|
+
declare const _default: DefineComponent<ImageListProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
5
|
+
delete: (index: number, src: string) => any;
|
|
6
|
+
}, string, PublicProps, Readonly<ImageListProps> & Readonly<{
|
|
7
|
+
onDelete?: ((index: number, src: string) => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
size: ImageSize;
|
|
10
|
+
testId: string;
|
|
11
|
+
deletable: boolean;
|
|
12
|
+
preview: boolean;
|
|
13
|
+
itemLabel: (index: number, src: string) => string;
|
|
14
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as f, openBlock as i, createElementBlock as r, mergeProps as c, unref as v, Fragment as b, renderList as p, createBlock as I } from "vue";
|
|
2
|
+
import { useTestId as g } from "../shared/useTestId.util.js";
|
|
3
|
+
import B from "./Image.vue.js";
|
|
4
|
+
const y = /* @__PURE__ */ f({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "ImageList",
|
|
7
|
+
props: {
|
|
8
|
+
items: {},
|
|
9
|
+
size: { default: "medium" },
|
|
10
|
+
deletable: { type: Boolean, default: !1 },
|
|
11
|
+
preview: { type: Boolean, default: !1 },
|
|
12
|
+
itemLabel: { type: Function, default: void 0 },
|
|
13
|
+
testId: { default: void 0 }
|
|
14
|
+
},
|
|
15
|
+
emits: ["delete"],
|
|
16
|
+
setup(e, { emit: d }) {
|
|
17
|
+
const o = e, m = d, u = g(() => o.testId);
|
|
18
|
+
function n(l, s) {
|
|
19
|
+
return o.itemLabel?.(l, s) ?? `Изображение ${l + 1}`;
|
|
20
|
+
}
|
|
21
|
+
return (l, s) => (i(), r("div", c({ class: "image-list-v2" }, { ...l.$attrs, ...v(u)("root") }), [
|
|
22
|
+
(i(!0), r(b, null, p(e.items, (t, a) => (i(), I(B, {
|
|
23
|
+
key: t,
|
|
24
|
+
src: t,
|
|
25
|
+
alt: n(a, t),
|
|
26
|
+
size: e.size,
|
|
27
|
+
deletable: e.deletable,
|
|
28
|
+
"delete-label": `Удалить ${n(a, t)}`,
|
|
29
|
+
preview: e.preview,
|
|
30
|
+
"test-id": e.testId ? `${e.testId}-item` : void 0,
|
|
31
|
+
onDelete: (L) => m("delete", a, t)
|
|
32
|
+
}, null, 8, ["src", "alt", "size", "deletable", "delete-label", "preview", "test-id", "onDelete"]))), 128))
|
|
33
|
+
], 16));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
y as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as Image } from './Image.vue';
|
|
2
|
+
import { default as ImageList } from './ImageList.vue';
|
|
3
|
+
export type { ImageEmits, ImageProps, ImageSize } from './Image.types';
|
|
4
|
+
export type { ImageListEmits, ImageListProps } from './ImageList.types';
|
|
5
|
+
export { Image, ImageList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.number-field[data-v-
|
|
1
|
+
.number-field[data-v-5a2b652b]{--step-height:2.25rem;--step-radius:.5rem;--step-padding-x:.75rem;--step-gap:.5rem;--step-icon-size:1rem;--step-font-size:.875rem;--step-line-height:1.25rem;--step-value-width:1.75rem;--step-border-color:var(--theme-neutral-border-default);--step-icon-color:var(--theme-secondary-500);--step-text-color:var(--theme-neutral-text-title);width:max-content;height:var(--step-height);justify-content:center;align-items:center;gap:var(--step-gap);padding:0 var(--step-padding-x);background-color:var(--theme-neutral-0);border:.0625rem solid var(--step-border-color);border-radius:var(--step-radius);transition:border-color var(--animation-duration-fast) ease;display:flex}.number-field[data-v-5a2b652b]:not(.number-field--disabled):hover{--step-border-color:var(--theme-primary-300)}.number-field[data-v-5a2b652b]:not(.number-field--disabled):focus-within{--step-border-color:var(--theme-primary-500)}.number-field__button[data-v-5a2b652b]{cursor:pointer;color:var(--step-icon-color);transition:color var(--animation-duration-fast) ease;background-color:#0000;border:none;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:flex}.number-field__button[data-v-5a2b652b] svg{width:var(--step-icon-size);height:var(--step-icon-size)}.number-field__button[data-v-5a2b652b]:hover:not(:disabled){color:var(--theme-secondary-600)}.number-field__button[data-v-5a2b652b]:disabled{color:var(--theme-neutral-icon-disabled);cursor:not-allowed}.number-field__button[data-v-5a2b652b]:focus-visible{outline:.125rem solid var(--theme-primary-500);outline-offset:.125rem;border-radius:.25rem}.number-field__value[data-v-5a2b652b]{width:var(--step-value-width);font-family:inherit;font-weight:400;font-size:var(--step-font-size);line-height:var(--step-line-height);text-align:center;color:var(--step-text-color);background-color:#0000;border:none;outline:none;flex-shrink:0}@media (max-width:1009.98px){.number-field__value[data-v-5a2b652b]{font-size:1rem}}.number-field__value[data-v-5a2b652b]::placeholder{color:var(--theme-neutral-550)}.number-field__value[data-v-5a2b652b]:disabled{cursor:not-allowed;-webkit-text-fill-color:var(--step-text-color);opacity:1}.number-field--small[data-v-5a2b652b]{--step-height:1.5rem;--step-padding-x:.5rem;--step-icon-size:.75rem;--step-font-size:.75rem;--step-line-height:1rem;--step-value-width:1.5rem}.number-field--medium[data-v-5a2b652b]{--step-height:2.5rem;--step-padding-x:1rem;--step-icon-size:1.125rem;--step-font-size:1rem;--step-line-height:1.5rem;--step-value-width:2rem}.number-field--large[data-v-5a2b652b]{--step-height:2.75rem;--step-radius:.75rem;--step-padding-x:1rem;--step-icon-size:1.25rem;--step-font-size:1rem;--step-line-height:1.5rem;--step-value-width:2rem}.number-field--error[data-v-5a2b652b]{--step-border-color:var(--theme-error-500)}.number-field--disabled[data-v-5a2b652b]{--step-border-color:var(--theme-neutral-border-disabled);--step-icon-color:var(--theme-neutral-icon-disabled);--step-text-color:var(--theme-neutral-400);cursor:not-allowed}
|
|
@@ -2,7 +2,7 @@ import './InputNumber.css';
|
|
|
2
2
|
import o from "./InputNumber.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5a2b652b"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { defineComponent as _, useModel as ee, useId as te, useTemplateRef as F, computed as r, ref as le, watch as ae, openBlock as S, createBlock as ne, unref as d, createElementBlock as re, mergeProps as b, createElementVNode as N, createVNode as C, mergeModels as P, nextTick as oe } from "vue";
|
|
2
2
|
import { Minus as ie, Plus as ue } from "@lucide/vue";
|
|
3
3
|
import de from "../Input/Input.vue.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { isHtmlInputElement as se } from "../shared/isHtmlElement.util.js";
|
|
5
|
+
import { useTestId as ce } from "../shared/useTestId.util.js";
|
|
6
|
+
const me = ["disabled", "aria-label"], fe = ["id", "value", "name", "placeholder", "disabled", "readonly", "required", "aria-label", "aria-invalid"], ve = ["disabled", "aria-label"], Ie = /* @__PURE__ */ _({
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "InputNumber",
|
|
8
9
|
props: /* @__PURE__ */ P({
|
|
@@ -30,7 +31,7 @@ const ce = ["disabled", "aria-label"], me = ["id", "value", "name", "placeholder
|
|
|
30
31
|
}),
|
|
31
32
|
emits: /* @__PURE__ */ P(["change", "increment", "decrement", "focus", "blur"], ["update:modelValue"]),
|
|
32
33
|
setup(a, { expose: U, emit: Y }) {
|
|
33
|
-
const l = a, u = Y, s = ee(a, "modelValue"), p =
|
|
34
|
+
const l = a, u = Y, s = ee(a, "modelValue"), p = ce(() => l.testId), j = te(), x = F("inputRef"), k = F("stepperRef"), V = r(() => l.variant === "input"), G = r(() => l.id ?? `${j}-number`), H = r(() => l.size === "small" ? "small" : l.size === "large" ? "large" : "default"), y = r(() => l.precision ?? 0), K = r(() => y.value > 0), O = r(() => l.min === void 0 || l.min < 0), z = r(() => l.step ?? 1), W = r(() => "Уменьшить"), J = r(() => "Увеличить"), Q = r(
|
|
34
35
|
() => l.ariaLabel ?? l.label ?? "Значение"
|
|
35
36
|
), f = (e) => e === null || Number.isNaN(e) ? "" : l.precision === void 0 ? String(e) : e.toFixed(y.value), g = (e) => {
|
|
36
37
|
if (e === "" || e === "-" || e === "." || e === "-.") return null;
|
|
@@ -45,16 +46,16 @@ const ce = ["disabled", "aria-label"], me = ["id", "value", "name", "placeholder
|
|
|
45
46
|
} else
|
|
46
47
|
i = i.replace(/\./g, "");
|
|
47
48
|
return n ? `-${i}` : i;
|
|
48
|
-
},
|
|
49
|
+
}, M = (e) => {
|
|
49
50
|
const t = l.min ?? Number.NEGATIVE_INFINITY, n = l.max ?? Number.POSITIVE_INFINITY;
|
|
50
51
|
return Math.min(n, Math.max(t, e));
|
|
51
|
-
},
|
|
52
|
+
}, B = (e) => {
|
|
52
53
|
const t = 10 ** (l.precision ?? 10);
|
|
53
54
|
return Math.round(e * t) / t;
|
|
54
55
|
}, o = le(f(s.value)), c = r(() => {
|
|
55
56
|
if (!V.value) return k.value;
|
|
56
57
|
const e = x.value?.el;
|
|
57
|
-
return e
|
|
58
|
+
return se(e) ? e : null;
|
|
58
59
|
}), v = async (e) => {
|
|
59
60
|
await oe();
|
|
60
61
|
const t = c.value;
|
|
@@ -65,21 +66,21 @@ const ce = ["disabled", "aria-label"], me = ["id", "value", "name", "placeholder
|
|
|
65
66
|
t.setSelectionRange(m, m);
|
|
66
67
|
}, h = (e) => {
|
|
67
68
|
e !== s.value && (s.value = e, u("change", e));
|
|
68
|
-
},
|
|
69
|
+
}, T = (e) => {
|
|
69
70
|
const t = e.target, n = X(t.value);
|
|
70
71
|
o.value = n, v(n), h(g(n));
|
|
71
72
|
}, R = (e) => {
|
|
72
|
-
const t = g(o.value), n = t === null ? null :
|
|
73
|
+
const t = g(o.value), n = t === null ? null : B(M(t));
|
|
73
74
|
h(n), o.value = f(n), v(o.value), u("blur", e);
|
|
74
75
|
}, I = r(() => s.value ?? l.min ?? 0), q = r(() => l.disabled || l.readonly ? !1 : l.min === void 0 || I.value > l.min), w = r(() => l.disabled || l.readonly ? !1 : l.max === void 0 || I.value < l.max), E = (e) => {
|
|
75
|
-
const t =
|
|
76
|
+
const t = B(M(I.value + e));
|
|
76
77
|
return h(t), o.value = f(t), v(o.value), t;
|
|
77
|
-
}, L = () => {
|
|
78
|
-
w.value && u("increment", E(M.value));
|
|
79
78
|
}, A = () => {
|
|
80
|
-
|
|
79
|
+
w.value && u("increment", E(z.value));
|
|
80
|
+
}, L = () => {
|
|
81
|
+
q.value && u("decrement", E(-z.value));
|
|
81
82
|
}, $ = (e) => {
|
|
82
|
-
e.key !== "ArrowUp" && e.key !== "ArrowDown" || (e.preventDefault(), e.key === "ArrowUp" ?
|
|
83
|
+
e.key !== "ArrowUp" && e.key !== "ArrowDown" || (e.preventDefault(), e.key === "ArrowUp" ? A() : L());
|
|
83
84
|
}, Z = r(() => [
|
|
84
85
|
"number-field",
|
|
85
86
|
`number-field--${l.size}`,
|
|
@@ -117,7 +118,7 @@ const ce = ["disabled", "aria-label"], me = ["id", "value", "name", "placeholder
|
|
|
117
118
|
"test-id": a.testId,
|
|
118
119
|
inputmode: "decimal",
|
|
119
120
|
autocomplete: "off",
|
|
120
|
-
onInput:
|
|
121
|
+
onInput: T,
|
|
121
122
|
onBlur: R,
|
|
122
123
|
onFocus: t[0] || (t[0] = (n) => u("focus", n)),
|
|
123
124
|
onKeydown: $
|
|
@@ -130,9 +131,9 @@ const ce = ["disabled", "aria-label"], me = ["id", "value", "name", "placeholder
|
|
|
130
131
|
class: "number-field__button",
|
|
131
132
|
disabled: !q.value,
|
|
132
133
|
"aria-label": W.value
|
|
133
|
-
}, d(p)("decrement"), { onClick:
|
|
134
|
+
}, d(p)("decrement"), { onClick: L }), [
|
|
134
135
|
C(d(ie), { "stroke-width": 2 })
|
|
135
|
-
], 16,
|
|
136
|
+
], 16, me),
|
|
136
137
|
N("input", b({
|
|
137
138
|
id: G.value,
|
|
138
139
|
ref_key: "stepperRef",
|
|
@@ -150,22 +151,22 @@ const ce = ["disabled", "aria-label"], me = ["id", "value", "name", "placeholder
|
|
|
150
151
|
"aria-label": Q.value,
|
|
151
152
|
"aria-invalid": a.error || void 0
|
|
152
153
|
}, e.$attrs, {
|
|
153
|
-
onInput:
|
|
154
|
+
onInput: T,
|
|
154
155
|
onBlur: R,
|
|
155
156
|
onFocus: t[1] || (t[1] = (n) => u("focus", n)),
|
|
156
157
|
onKeydown: $
|
|
157
|
-
}), null, 16,
|
|
158
|
+
}), null, 16, fe),
|
|
158
159
|
N("button", b({
|
|
159
160
|
type: "button",
|
|
160
161
|
class: "number-field__button",
|
|
161
162
|
disabled: !w.value,
|
|
162
163
|
"aria-label": J.value
|
|
163
|
-
}, d(p)("increment"), { onClick:
|
|
164
|
+
}, d(p)("increment"), { onClick: A }), [
|
|
164
165
|
C(d(ue), { "stroke-width": 2 })
|
|
165
|
-
], 16,
|
|
166
|
+
], 16, ve)
|
|
166
167
|
], 16));
|
|
167
168
|
}
|
|
168
169
|
});
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
+
Ie as default
|
|
171
172
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
2
2
|
import { InputProps } from '../Input';
|
|
3
3
|
/** Пункт выпадающего списка чипа-селекта. */
|
|
4
4
|
export interface InputSelectOption {
|
|
@@ -34,5 +34,5 @@ export interface InputSelectProps extends Omit<InputProps, 'type'> {
|
|
|
34
34
|
*/
|
|
35
35
|
dropdownWidth?: number;
|
|
36
36
|
/** Точка перелома, ниже которой список открывается шторкой снизу */
|
|
37
|
-
breakpointMobile?:
|
|
37
|
+
breakpointMobile?: TBreakpointMobile;
|
|
38
38
|
}
|
|
@@ -2,7 +2,7 @@ import { InputSelectOption, InputSelectProps } from './InputSelect.types';
|
|
|
2
2
|
import { ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, Attrs, Slot, ComponentPublicInstance, ComponentOptionsBase, ShallowRef, ComponentOptionsMixin, GlobalComponents, GlobalDirectives, ComponentProvideOptions, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ComponentCustomProperties, DefineComponent, PublicProps } from 'vue';
|
|
3
3
|
import { InputType, InputSize, InputNativeType, InputMode, InputProps } from '..';
|
|
4
4
|
import { OnCleanup } from '@vue/reactivity';
|
|
5
|
-
import {
|
|
5
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
6
6
|
type __VLS_Props = InputSelectProps;
|
|
7
7
|
type __VLS_PublicProps = {
|
|
8
8
|
modelValue?: string;
|
|
@@ -207,7 +207,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
|
|
|
207
207
|
error: boolean;
|
|
208
208
|
readonly: boolean;
|
|
209
209
|
name: string;
|
|
210
|
-
breakpointMobile:
|
|
210
|
+
breakpointMobile: TBreakpointMobile;
|
|
211
211
|
rows: number;
|
|
212
212
|
errorMessage: string;
|
|
213
213
|
maxlength: number;
|