@profitliga/ui 2.0.3 → 2.0.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.
- 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/Button/Button.css +1 -1
- package/dist/components/v2/Button/Button.vue.js +2 -2
- 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 +24 -4
- package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
- package/dist/components/v2/Combobox/Combobox.vue2.js +195 -188
- 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 +15 -2
- package/dist/components/v2/Popover/Popover.vue.d.ts +3 -2
- package/dist/components/v2/Popover/Popover.vue.js +2 -2
- package/dist/components/v2/Popover/Popover.vue2.js +50 -49
- 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 +58 -57
- 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
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTestId as
|
|
1
|
+
import { defineComponent as j, useModel as w, useSlots as G, useId as H, useTemplateRef as K, inject as U, ref as h, computed as t, openBlock as d, createElementBlock as i, mergeProps as r, unref as v, createElementVNode as Y, createVNode as q, renderSlot as k, createTextVNode as z, toDisplayString as C, createCommentVNode as g, mergeModels as I } from "vue";
|
|
2
|
+
import { useTestId as x } from "../shared/useTestId.util.js";
|
|
3
3
|
import { RADIO_GROUP_KEY as J } from "./radioGroup.context.js";
|
|
4
4
|
import Q from "./RadioMarker.vue.js";
|
|
5
5
|
const W = ["for"], X = ["id", "name", "value", "checked", "disabled"], Z = {
|
|
6
|
-
key:
|
|
6
|
+
key: 1,
|
|
7
7
|
class: "radio__text"
|
|
8
|
-
}, oe = /* @__PURE__ */
|
|
8
|
+
}, oe = /* @__PURE__ */ j({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "Radio",
|
|
11
11
|
props: /* @__PURE__ */ I({
|
|
@@ -22,75 +22,83 @@ const W = ["for"], X = ["id", "name", "value", "checked", "disabled"], Z = {
|
|
|
22
22
|
modelModifiers: {}
|
|
23
23
|
}),
|
|
24
24
|
emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
|
|
25
|
-
setup(
|
|
26
|
-
const e =
|
|
25
|
+
setup(n, { emit: M }) {
|
|
26
|
+
const e = n, P = M, $ = w(n, "modelValue"), y = G(), u = x(() => e.testId), D = H(), B = K("inputRef"), l = U(J, void 0), f = h(!1), c = h(!1), m = h(!1), R = t(() => e.id ?? `${D}-radio`), T = t(() => e.name ?? l?.name), S = t(
|
|
27
27
|
() => e.size ?? l?.size.value ?? "default"
|
|
28
|
-
),
|
|
28
|
+
), o = t(
|
|
29
29
|
() => e.disabled || !!l?.disabled.value
|
|
30
|
-
),
|
|
31
|
-
() => !!(e.description ||
|
|
32
|
-
), _ = t(() =>
|
|
30
|
+
), p = t(() => (l ? l.selected.value : $.value) === e.value), V = t(() => !!(e.label || y.default)), N = t(
|
|
31
|
+
() => !!(e.description || y.description)
|
|
32
|
+
), _ = t(() => V.value || N.value), E = t(() => o.value ? "default" : c.value ? "pressed" : m.value ? "focused" : f.value ? "hover" : "default"), F = t(() => [
|
|
33
33
|
"radio",
|
|
34
|
-
`radio--${
|
|
35
|
-
{ "radio--disabled":
|
|
34
|
+
`radio--${S.value}`,
|
|
35
|
+
{ "radio--disabled": o.value }
|
|
36
36
|
]);
|
|
37
|
-
function x() {
|
|
38
|
-
f.value = !1, u.value = !1;
|
|
39
|
-
}
|
|
40
37
|
function A() {
|
|
41
|
-
|
|
38
|
+
f.value = !1, c.value = !1;
|
|
42
39
|
}
|
|
43
40
|
function L() {
|
|
44
|
-
|
|
41
|
+
m.value = !!B.value?.matches(":focus-visible");
|
|
42
|
+
}
|
|
43
|
+
function O() {
|
|
44
|
+
o.value || (l ? l.select(e.value) : $.value = e.value, P("change", e.value));
|
|
45
45
|
}
|
|
46
|
-
return (
|
|
46
|
+
return (s, a) => (d(), i("label", r({
|
|
47
47
|
class: F.value,
|
|
48
|
-
for:
|
|
49
|
-
},
|
|
50
|
-
onMouseenter: a[1] || (a[1] = (
|
|
51
|
-
onMouseleave:
|
|
52
|
-
onPointerdown: a[2] || (a[2] = (
|
|
53
|
-
onPointerup: a[3] || (a[3] = (
|
|
48
|
+
for: R.value
|
|
49
|
+
}, v(u)("root"), {
|
|
50
|
+
onMouseenter: a[1] || (a[1] = (b) => f.value = !0),
|
|
51
|
+
onMouseleave: A,
|
|
52
|
+
onPointerdown: a[2] || (a[2] = (b) => c.value = !0),
|
|
53
|
+
onPointerup: a[3] || (a[3] = (b) => c.value = !1)
|
|
54
54
|
}), [
|
|
55
|
-
|
|
56
|
-
id:
|
|
55
|
+
Y("input", r({
|
|
56
|
+
id: R.value,
|
|
57
57
|
ref_key: "inputRef",
|
|
58
58
|
ref: B,
|
|
59
59
|
type: "radio",
|
|
60
60
|
class: "radio__input",
|
|
61
61
|
name: T.value,
|
|
62
|
-
value: String(
|
|
63
|
-
checked:
|
|
64
|
-
disabled:
|
|
65
|
-
}, { ...
|
|
66
|
-
onChange:
|
|
67
|
-
onFocus:
|
|
68
|
-
onBlur: a[0] || (a[0] = (
|
|
62
|
+
value: String(n.value),
|
|
63
|
+
checked: p.value,
|
|
64
|
+
disabled: o.value
|
|
65
|
+
}, { ...s.$attrs, ...v(u)("input") }, {
|
|
66
|
+
onChange: O,
|
|
67
|
+
onFocus: L,
|
|
68
|
+
onBlur: a[0] || (a[0] = (b) => m.value = !1)
|
|
69
69
|
}), null, 16, X),
|
|
70
|
-
|
|
71
|
-
size:
|
|
72
|
-
checked:
|
|
73
|
-
disabled:
|
|
70
|
+
q(Q, {
|
|
71
|
+
size: S.value,
|
|
72
|
+
checked: p.value,
|
|
73
|
+
disabled: o.value,
|
|
74
74
|
state: E.value
|
|
75
75
|
}, null, 8, ["size", "checked", "disabled", "state"]),
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
s.$slots.content ? (d(), i("span", r({
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "radio__content"
|
|
79
|
+
}, v(u)("content")), [
|
|
80
|
+
k(s.$slots, "content", {
|
|
81
|
+
checked: p.value,
|
|
82
|
+
disabled: o.value
|
|
83
|
+
}, void 0, !0)
|
|
84
|
+
], 16)) : _.value ? (d(), i("span", Z, [
|
|
85
|
+
V.value ? (d(), i("span", r({
|
|
78
86
|
key: 0,
|
|
79
87
|
class: "radio__label"
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
z(C(
|
|
88
|
+
}, v(u)("label")), [
|
|
89
|
+
k(s.$slots, "default", {}, () => [
|
|
90
|
+
z(C(n.label), 1)
|
|
83
91
|
], !0)
|
|
84
|
-
], 16)) :
|
|
85
|
-
|
|
92
|
+
], 16)) : g("", !0),
|
|
93
|
+
N.value ? (d(), i("span", r({
|
|
86
94
|
key: 1,
|
|
87
95
|
class: "radio__description"
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
z(C(
|
|
96
|
+
}, v(u)("description")), [
|
|
97
|
+
k(s.$slots, "description", {}, () => [
|
|
98
|
+
z(C(n.description), 1)
|
|
91
99
|
], !0)
|
|
92
|
-
], 16)) :
|
|
93
|
-
])) :
|
|
100
|
+
], 16)) : g("", !0)
|
|
101
|
+
])) : g("", !0)
|
|
94
102
|
], 16, W));
|
|
95
103
|
}
|
|
96
104
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.schedule-field[data-v-
|
|
1
|
+
.schedule-field[data-v-7ca326fb]{max-width:100%;height:var(--input-height);background-color:var(--theme-neutral-0);border:1px solid var(--input-border-color);padding:var(--input-padding);cursor:pointer;border-radius:8px;justify-content:flex-start;align-items:center;gap:4px;display:flex;overflow:hidden}.schedule-field[data-v-7ca326fb]:hover{border-color:var(--input-border-color-hover)}.schedule-field__main[data-v-7ca326fb]{min-width:0;height:100%;font:inherit;text-align:left;cursor:inherit;background:0 0;border:none;flex:auto;justify-content:flex-start;align-items:center;gap:4px;padding:0;display:flex}.schedule-field__main[data-v-7ca326fb]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:-2px}.schedule-field__main[data-v-7ca326fb]:disabled{cursor:not-allowed}.schedule-field--open[data-v-7ca326fb]{border-color:var(--input-border-color-focus)}.schedule-field--disabled[data-v-7ca326fb]{cursor:not-allowed;opacity:.6}.schedule-field--small[data-v-7ca326fb]{height:var(--input-height-small)}.schedule-field--large[data-v-7ca326fb]{height:var(--input-height-large)}.schedule-field__icon[data-v-7ca326fb]{color:var(--theme-neutral-icon-caption);flex:none}.schedule-field__placeholder[data-v-7ca326fb],.schedule-field__value[data-v-7ca326fb]{white-space:nowrap;text-overflow:ellipsis;min-width:0;font-size:var(--input-font-size);overflow:hidden}.schedule-field__placeholder[data-v-7ca326fb]{color:var(--input-color-placeholder)}.schedule-field__value[data-v-7ca326fb]{color:var(--theme-neutral-text-body)}.schedule-field__clear[data-v-7ca326fb]{width:16px;height:16px;color:var(--color-neutral-text-caption);cursor:pointer;background:0 0;border:none;flex:none;margin-left:auto;padding:0}.schedule-field__clear[data-v-7ca326fb]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.schedule-field__clear svg[data-v-7ca326fb]{width:100%;height:100%}.schedule-field__clear[data-v-7ca326fb]:hover{color:var(--color-error-500)}.schedule-panel[data-v-7ca326fb]{flex-direction:column;gap:20px;padding:24px;display:flex}.schedule-panel--mobile[data-v-7ca326fb]{gap:16px;padding:0 16px 16px}.schedule-panel__header[data-v-7ca326fb]{justify-content:space-between;align-items:center;gap:8px;display:flex}.schedule-panel__title[data-v-7ca326fb]{color:var(--theme-neutral-text-title);font-size:1.125rem;font-weight:500;line-height:1.5}.schedule-panel__close[data-v-7ca326fb]{width:24px;height:24px;color:var(--theme-neutral-text-title);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:flex}.schedule-panel__close[data-v-7ca326fb]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.schedule-panel__rows[data-v-7ca326fb]{flex-direction:column;gap:12px;display:flex}.schedule-row[data-v-7ca326fb]{align-items:center;gap:12px;display:flex}.schedule-row__day[data-v-7ca326fb]{cursor:pointer;flex:0 0 120px;align-items:center;gap:8px;min-width:0;display:flex;position:relative}.schedule-row__checkbox[data-v-7ca326fb]{opacity:0;cursor:pointer;width:20px;height:20px;margin:0;position:absolute}.schedule-row__checkbox:checked+.schedule-row__box[data-v-7ca326fb]{background-color:var(--theme-primary-500);border-color:var(--theme-primary-500);color:var(--theme-neutral-icon-negative)}.schedule-row__checkbox:checked+.schedule-row__box svg[data-v-7ca326fb]{opacity:1}.schedule-row__checkbox:hover+.schedule-row__box[data-v-7ca326fb]{border-color:var(--input-border-color-hover)}.schedule-row__checkbox:focus-visible+.schedule-row__box[data-v-7ca326fb]{outline:2px solid var(--theme-primary-500);outline-offset:2px}.schedule-row__box[data-v-7ca326fb]{background-color:var(--theme-neutral-0);border:1px solid var(--theme-neutral-border-default);width:20px;height:20px;transition:background-color var(--animation-duration-fast) ease, border-color var(--animation-duration-fast) ease;border-radius:5px;flex:none;justify-content:center;align-items:center;display:flex}.schedule-row__box svg[data-v-7ca326fb]{opacity:0;transition:opacity var(--animation-duration-fast) ease}.schedule-row__label[data-v-7ca326fb]{white-space:nowrap;text-overflow:ellipsis;min-width:0;color:var(--theme-neutral-text-subtitle);font-size:.75rem;line-height:1rem;overflow:hidden}.schedule-row__times[data-v-7ca326fb]{flex:auto;align-items:center;gap:6px;min-width:0;display:flex}.schedule-row__preposition[data-v-7ca326fb]{color:var(--theme-neutral-text-body);flex:none;font-size:.75rem;line-height:1rem}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
2
2
|
export type ScheduleDay = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
|
|
3
3
|
/**
|
|
4
4
|
* Интервал работы за один день. Время — строка `HH:MM` в 24-часовом формате:
|
|
@@ -54,7 +54,7 @@ export interface ScheduleProps {
|
|
|
54
54
|
dayLabels?: Partial<Record<ScheduleDay, string>>;
|
|
55
55
|
/** Короткие подписи дней для сводки в поле. */
|
|
56
56
|
dayShortLabels?: Partial<Record<ScheduleDay, string>>;
|
|
57
|
-
breakpointMobile?:
|
|
57
|
+
breakpointMobile?: TBreakpointMobile;
|
|
58
58
|
/**
|
|
59
59
|
* Доступное имя поля. По умолчанию берётся `placeholder`; выбранное
|
|
60
60
|
* значение подставляется к нему автоматически.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ScheduleDay, ScheduleModelValue, ScheduleProps, ScheduleLabels } from './Schedule.types';
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
4
4
|
type __VLS_Props = ScheduleProps;
|
|
5
5
|
type __VLS_PublicProps = {
|
|
6
6
|
modelValue?: ScheduleModelValue;
|
|
@@ -17,7 +17,7 @@ declare const _default: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, Compo
|
|
|
17
17
|
placeholder: string;
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
width: number | "full";
|
|
20
|
-
breakpointMobile:
|
|
20
|
+
breakpointMobile: TBreakpointMobile;
|
|
21
21
|
showClear: boolean;
|
|
22
22
|
testId: string;
|
|
23
23
|
labels: ScheduleLabels;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './Schedule.css';
|
|
2
2
|
import o from "./Schedule.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7ca326fb"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as default
|
|
8
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as W, useModel as X, useId as q, ref as
|
|
2
|
-
import { CircleX as
|
|
3
|
-
import
|
|
4
|
-
import ne from "../
|
|
5
|
-
import ie from "../
|
|
1
|
+
import { defineComponent as W, useModel as X, useId as q, ref as M, computed as y, watch as T, openBlock as m, createBlock as G, unref as l, withCtx as x, createElementVNode as i, mergeProps as f, createElementBlock as w, toDisplayString as h, createVNode as v, createCommentVNode as A, Fragment as J, renderList as K, withDirectives as Q, vModelCheckbox as Z, createTextVNode as ee, normalizeStyle as le, normalizeClass as te, withModifiers as ae, mergeModels as B } from "vue";
|
|
2
|
+
import { CircleX as U, Check as oe, Clock as se } from "@lucide/vue";
|
|
3
|
+
import de from "../Button/Button.vue.js";
|
|
4
|
+
import ne from "../Popover/Popover.vue.js";
|
|
5
|
+
import { useIsMobile as ie } from "../shared/useIsMobile.util.js";
|
|
6
6
|
import { useTestId as ue } from "../shared/useTestId.util.js";
|
|
7
7
|
import { SCHEDULE_DAYS as L, DEFAULT_DAY_LABELS as E, DEFAULT_DAY_SHORT_LABELS as re } from "./Schedule.util.js";
|
|
8
8
|
import I from "./ScheduleTimeInput.vue.js";
|
|
@@ -20,7 +20,7 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
20
20
|
"aria-hidden": "true"
|
|
21
21
|
}, we = { class: "schedule-row__label" }, ke = { class: "schedule-row__times" }, Le = { class: "schedule-row__preposition" }, Ve = { class: "schedule-row__preposition" }, Ce = 500, Ee = /* @__PURE__ */ W({
|
|
22
22
|
__name: "Schedule",
|
|
23
|
-
props: /* @__PURE__ */
|
|
23
|
+
props: /* @__PURE__ */ B({
|
|
24
24
|
placeholder: { default: "Выберите расписание" },
|
|
25
25
|
size: { default: "default" },
|
|
26
26
|
width: { default: 300 },
|
|
@@ -30,7 +30,7 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
30
30
|
defaultTo: { default: "17:30" },
|
|
31
31
|
dayLabels: { default: void 0 },
|
|
32
32
|
dayShortLabels: { default: void 0 },
|
|
33
|
-
breakpointMobile: { default: "sm" },
|
|
33
|
+
breakpointMobile: { type: [String, Boolean], default: "sm" },
|
|
34
34
|
label: { default: void 0 },
|
|
35
35
|
labels: { default: void 0 },
|
|
36
36
|
testId: { default: void 0 }
|
|
@@ -38,18 +38,18 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
38
38
|
modelValue: { default: null },
|
|
39
39
|
modelModifiers: {}
|
|
40
40
|
}),
|
|
41
|
-
emits: /* @__PURE__ */
|
|
42
|
-
setup(n, { emit:
|
|
43
|
-
const d = n,
|
|
41
|
+
emits: /* @__PURE__ */ B(["apply"], ["update:modelValue"]),
|
|
42
|
+
setup(n, { emit: g }) {
|
|
43
|
+
const d = n, z = g, p = X(n, "modelValue"), c = ue(() => d.testId), S = `schedule-title-${q()}`, b = M(!1), V = ie(d.breakpointMobile), $ = y(() => d.labels?.title ?? "Расписание"), F = y(() => d.labels?.from ?? "с"), N = y(() => d.labels?.to ?? "до"), O = y(
|
|
44
44
|
() => d.width === "full" ? "100%" : `${d.width}px`
|
|
45
45
|
);
|
|
46
|
-
function C(
|
|
46
|
+
function C(t) {
|
|
47
47
|
const s = (e) => {
|
|
48
|
-
const
|
|
48
|
+
const a = t?.[e];
|
|
49
49
|
return {
|
|
50
|
-
active: !!
|
|
51
|
-
from:
|
|
52
|
-
to:
|
|
50
|
+
active: !!a,
|
|
51
|
+
from: a?.from ?? d.defaultFrom,
|
|
52
|
+
to: a?.to ?? d.defaultTo
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
return {
|
|
@@ -62,25 +62,25 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
62
62
|
sunday: s("sunday")
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
const u =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}),
|
|
65
|
+
const u = M(C(p.value));
|
|
66
|
+
T(b, (t) => {
|
|
67
|
+
t && (u.value = C(p.value));
|
|
68
|
+
}), T(
|
|
69
69
|
p,
|
|
70
|
-
(
|
|
71
|
-
b.value || (u.value = C(
|
|
70
|
+
(t) => {
|
|
71
|
+
b.value || (u.value = C(t));
|
|
72
72
|
},
|
|
73
73
|
{ deep: !0 }
|
|
74
74
|
);
|
|
75
|
-
function
|
|
76
|
-
const e = d.dayLabels?.[
|
|
77
|
-
return `${e}, ${
|
|
75
|
+
function D(t, s) {
|
|
76
|
+
const e = d.dayLabels?.[t] ?? E[t], a = s === "from" ? d.labels?.timeFrom ?? "время начала" : d.labels?.timeTo ?? "время окончания";
|
|
77
|
+
return `${e}, ${a}`;
|
|
78
78
|
}
|
|
79
79
|
const k = y(() => {
|
|
80
|
-
const
|
|
81
|
-
if (!
|
|
80
|
+
const t = p.value;
|
|
81
|
+
if (!t) return "";
|
|
82
82
|
const e = L.flatMap((o) => {
|
|
83
|
-
const r =
|
|
83
|
+
const r = t[o];
|
|
84
84
|
return r ? [{ day: o, ...r }] : [];
|
|
85
85
|
}).reduce((o, r) => {
|
|
86
86
|
const _ = o[o.length - 1], R = _ && L.indexOf(r.day) === L.indexOf(_.end) + 1;
|
|
@@ -90,42 +90,43 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
90
90
|
from: r.from,
|
|
91
91
|
to: r.to
|
|
92
92
|
}), o);
|
|
93
|
-
}, []),
|
|
94
|
-
return e.map((o) => `${o.start === o.end ?
|
|
93
|
+
}, []), a = (o) => d.dayShortLabels?.[o] ?? re[o];
|
|
94
|
+
return e.map((o) => `${o.start === o.end ? a(o.start) : `${a(o.start)}–${a(o.end)}`}, ${o.from}–${o.to}`).join("; ");
|
|
95
95
|
}), P = y(() => {
|
|
96
|
-
const
|
|
97
|
-
return k.value ? `${
|
|
96
|
+
const t = d.label ?? d.placeholder;
|
|
97
|
+
return k.value ? `${t}: ${k.value}` : t;
|
|
98
98
|
});
|
|
99
|
-
function H(
|
|
100
|
-
d.disabled &&
|
|
99
|
+
function H(t) {
|
|
100
|
+
d.disabled && t.stopPropagation();
|
|
101
101
|
}
|
|
102
102
|
function Y() {
|
|
103
|
-
const
|
|
103
|
+
const t = {};
|
|
104
104
|
for (const e of L) {
|
|
105
|
-
const
|
|
106
|
-
|
|
105
|
+
const a = u.value[e];
|
|
106
|
+
a.active && (t[e] = { from: a.from, to: a.to });
|
|
107
107
|
}
|
|
108
|
-
const s = Object.keys(
|
|
109
|
-
p.value = s,
|
|
108
|
+
const s = Object.keys(t).length > 0 ? t : null;
|
|
109
|
+
p.value = s, z("apply", s), b.value = !1;
|
|
110
110
|
}
|
|
111
111
|
function j() {
|
|
112
112
|
p.value = null, u.value = C(null);
|
|
113
113
|
}
|
|
114
|
-
return (
|
|
114
|
+
return (t, s) => (m(), G(l(ne), {
|
|
115
115
|
open: b.value,
|
|
116
116
|
"onUpdate:open": s[1] || (s[1] = (e) => b.value = e),
|
|
117
117
|
side: "bottom",
|
|
118
118
|
align: "start",
|
|
119
119
|
arrow: !1,
|
|
120
120
|
width: Ce,
|
|
121
|
+
"trigger-width": "content",
|
|
121
122
|
"breakpoint-mobile": n.breakpointMobile,
|
|
122
|
-
label: l(V) ? void 0 :
|
|
123
|
-
"labelled-by": l(V) ?
|
|
123
|
+
label: l(V) ? void 0 : $.value,
|
|
124
|
+
"labelled-by": l(V) ? S : void 0,
|
|
124
125
|
"test-id": n.testId
|
|
125
126
|
}, {
|
|
126
127
|
trigger: x(({ props: e }) => [
|
|
127
128
|
i("div", {
|
|
128
|
-
class:
|
|
129
|
+
class: te(["schedule-field", [
|
|
129
130
|
`schedule-field--${n.size}`,
|
|
130
131
|
{
|
|
131
132
|
"schedule-field--open": b.value,
|
|
@@ -154,10 +155,10 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
154
155
|
class: "schedule-field__clear",
|
|
155
156
|
"aria-label": n.labels?.clear ?? "Очистить"
|
|
156
157
|
}, l(c)("clear"), {
|
|
157
|
-
onClick:
|
|
158
|
+
onClick: ae(j, ["stop"])
|
|
158
159
|
}), [
|
|
159
|
-
v(l(
|
|
160
|
-
], 16, me)) :
|
|
160
|
+
v(l(U))
|
|
161
|
+
], 16, me)) : A("", !0)
|
|
161
162
|
], 6)
|
|
162
163
|
]),
|
|
163
164
|
default: x(() => [
|
|
@@ -166,9 +167,9 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
166
167
|
}, l(c)("panel")), [
|
|
167
168
|
l(V) ? (m(), w("div", he, [
|
|
168
169
|
i("span", {
|
|
169
|
-
id:
|
|
170
|
+
id: S,
|
|
170
171
|
class: "schedule-panel__title"
|
|
171
|
-
}, h(
|
|
172
|
+
}, h($.value), 1),
|
|
172
173
|
i("button", f({
|
|
173
174
|
type: "button",
|
|
174
175
|
class: "schedule-panel__close",
|
|
@@ -176,9 +177,9 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
176
177
|
}, l(c)("close"), {
|
|
177
178
|
onClick: s[0] || (s[0] = (e) => b.value = !1)
|
|
178
179
|
}), [
|
|
179
|
-
v(l(
|
|
180
|
+
v(l(U), { size: 24 })
|
|
180
181
|
], 16, ve)
|
|
181
|
-
])) :
|
|
182
|
+
])) : A("", !0),
|
|
182
183
|
i("div", f({ class: "schedule-panel__rows" }, l(c)("rows")), [
|
|
183
184
|
(m(!0), w(J, null, K(l(L), (e) => (m(), w("div", f({
|
|
184
185
|
key: e,
|
|
@@ -186,7 +187,7 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
186
187
|
}, { ref_for: !0 }, l(c)("row", e)), [
|
|
187
188
|
i("label", pe, [
|
|
188
189
|
Q(i("input", f({
|
|
189
|
-
"onUpdate:modelValue": (
|
|
190
|
+
"onUpdate:modelValue": (a) => u.value[e].active = a,
|
|
190
191
|
type: "checkbox",
|
|
191
192
|
class: "schedule-row__checkbox"
|
|
192
193
|
}, { ref_for: !0 }, l(c)("day", e)), null, 16, _e), [
|
|
@@ -201,24 +202,24 @@ const ce = ["disabled", "aria-label"], fe = {
|
|
|
201
202
|
i("span", we, h(n.dayLabels?.[e] ?? l(E)[e]), 1)
|
|
202
203
|
]),
|
|
203
204
|
i("div", ke, [
|
|
204
|
-
i("span", Le, h(
|
|
205
|
+
i("span", Le, h(F.value), 1),
|
|
205
206
|
v(I, f({
|
|
206
207
|
modelValue: u.value[e].from,
|
|
207
|
-
"onUpdate:modelValue": (
|
|
208
|
+
"onUpdate:modelValue": (a) => u.value[e].from = a,
|
|
208
209
|
disabled: !u.value[e].active,
|
|
209
|
-
"aria-label":
|
|
210
|
+
"aria-label": D(e, "from")
|
|
210
211
|
}, { ref_for: !0 }, l(c)("time-from", e)), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "aria-label"]),
|
|
211
|
-
i("span", Ve, h(
|
|
212
|
+
i("span", Ve, h(N.value), 1),
|
|
212
213
|
v(I, f({
|
|
213
214
|
modelValue: u.value[e].to,
|
|
214
|
-
"onUpdate:modelValue": (
|
|
215
|
+
"onUpdate:modelValue": (a) => u.value[e].to = a,
|
|
215
216
|
disabled: !u.value[e].active,
|
|
216
|
-
"aria-label":
|
|
217
|
+
"aria-label": D(e, "to")
|
|
217
218
|
}, { ref_for: !0 }, l(c)("time-to", e)), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "aria-label"])
|
|
218
219
|
])
|
|
219
220
|
], 16))), 128))
|
|
220
221
|
], 16),
|
|
221
|
-
v(l(
|
|
222
|
+
v(l(de), f({
|
|
222
223
|
variant: "success",
|
|
223
224
|
full: ""
|
|
224
225
|
}, l(c)("apply"), { onClick: Y }), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.select[data-v-
|
|
1
|
+
.select[data-v-23e4cee1]{--select-field-height:2.5rem;--select-field-radius:.5rem;--select-font-size:.875rem;--select-line-height:1.25rem;--select-label-font-size:.875rem;--select-label-line-height:1rem;--select-border-color:var(--theme-neutral-border-default);flex-direction:column;display:flex}.select--small[data-v-23e4cee1]{--select-field-height:2.25rem;--select-label-font-size:.75rem}.select--large[data-v-23e4cee1]{--select-field-height:2.75rem;--select-field-radius:.75rem;--select-font-size:1rem;--select-line-height:1.5rem;--select-label-font-size:1rem;--select-label-line-height:1.25rem}.select__label[data-v-23e4cee1]{font-weight:400;font-size:var(--select-label-font-size);line-height:var(--select-label-line-height);color:var(--theme-neutral-text-title);cursor:pointer;align-items:center;gap:.125rem;padding:.375rem .5rem;display:flex}.select__required[data-v-23e4cee1]{color:var(--theme-error-500);flex-shrink:0}.select__field[data-v-23e4cee1]{min-height:var(--select-field-height);background-color:var(--theme-neutral-0);border:.0625rem solid var(--select-border-color);border-radius:var(--select-field-radius);transition:border-color var(--animation-duration-fast) ease;align-items:center;gap:.25rem;padding:.25rem .5rem;display:flex;position:relative}.select[data-v-23e4cee1] .popover-trigger{position:absolute;inset:0}.select__trigger[data-v-23e4cee1]{border-radius:inherit;cursor:pointer;background:0 0;border:none;width:100%;height:100%;padding:0}.select__trigger[data-v-23e4cee1]:disabled{cursor:not-allowed}.select__content[data-v-23e4cee1]{z-index:1;pointer-events:none;flex:auto;align-items:center;gap:.25rem;min-width:0;display:flex;position:relative}.select__chips[data-v-23e4cee1]{flex:0 auto;align-items:center;gap:.25rem;min-width:0;display:flex;overflow:hidden}.select__value[data-v-23e4cee1],.select__placeholder[data-v-23e4cee1]{min-width:0;font-weight:400;font-size:var(--select-font-size);line-height:var(--select-line-height);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.select__value[data-v-23e4cee1]{color:var(--theme-neutral-text-body)}.select__placeholder[data-v-23e4cee1]{color:var(--theme-neutral-550)}.select__chip[data-v-23e4cee1]{max-width:100%;height:1.125rem;color:var(--theme-neutral-text-subtitle);background-color:var(--theme-neutral-surface-icon);border-radius:.375rem;flex-shrink:0;align-items:center;gap:.5rem;padding:0 .375rem;font-size:.75rem;font-weight:400;line-height:1rem;display:flex}.select__chip-label[data-v-23e4cee1]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.select__chip-remove[data-v-23e4cee1]{color:var(--theme-neutral-icon-caption);cursor:pointer;pointer-events:auto;transition:color var(--animation-duration-fast) ease;background:0 0;border:none;align-items:center;margin:0;padding:0;display:flex}.select__chip-remove[data-v-23e4cee1]:hover:not(:disabled){color:var(--theme-neutral-text-body)}.select__chip-remove[data-v-23e4cee1]:focus-visible{outline:.125rem solid var(--theme-primary-500);outline-offset:.125rem}.select__chip-remove[data-v-23e4cee1]:disabled{cursor:not-allowed}.select__chip-icon[data-v-23e4cee1],.select__chip-avatar[data-v-23e4cee1]{flex-shrink:0;width:.75rem;height:.75rem}.select__chip-avatar[data-v-23e4cee1]{object-fit:cover;border-radius:50%}.select__chip--measured[data-v-23e4cee1]{visibility:hidden;pointer-events:none;position:absolute;top:0;left:-9999px}.select__chip--counter[data-v-23e4cee1]{color:var(--theme-neutral-text-caption);flex-shrink:0}.select__arrow[data-v-23e4cee1]{width:1.125rem;height:1.125rem;color:var(--theme-neutral-text-body);pointer-events:none;transition:transform var(--animation-duration-fast) ease;flex-shrink:0}.select__message[data-v-23e4cee1]{color:var(--theme-neutral-text-body);margin:0;padding:.25rem .5rem;font-size:.625rem;font-weight:400;line-height:1.2}.select[data-v-23e4cee1]:hover:not(.select--disabled){--select-border-color:var(--theme-primary-300)}.select--open[data-v-23e4cee1],.select--open[data-v-23e4cee1]:hover{--select-border-color:var(--theme-primary-500)}.select--open .select__arrow[data-v-23e4cee1]{transform:rotate(180deg)}.select--invalid[data-v-23e4cee1]{--select-border-color:var(--theme-error-500)}.select--invalid .select__label[data-v-23e4cee1],.select--invalid .select__message[data-v-23e4cee1]{color:var(--theme-error-500)}.select--invalid[data-v-23e4cee1]:hover:not(.select--disabled){--select-border-color:var(--theme-error-500)}.select--disabled[data-v-23e4cee1]{--select-border-color:var(--theme-neutral-border-disabled)}.select--disabled .select__label[data-v-23e4cee1],.select--disabled .select__value[data-v-23e4cee1],.select--disabled .select__placeholder[data-v-23e4cee1],.select--disabled .select__message[data-v-23e4cee1],.select--disabled .select__arrow[data-v-23e4cee1]{color:var(--theme-neutral-text-disabled)}.select--disabled .select__label[data-v-23e4cee1]{cursor:not-allowed}.select__field[data-v-23e4cee1]:has(.select__trigger:focus-visible){outline:.125rem solid var(--theme-primary-500);outline-offset:.125rem}.select-list[data-v-23e4cee1]{outline:none;flex-direction:column;gap:.5rem;max-height:15rem;padding:.5rem;display:flex;overflow-y:auto}.select-list__option[data-v-23e4cee1]{width:100%;min-height:2rem;color:var(--theme-neutral-text-title);text-align:left;cursor:pointer;transition:background-color var(--animation-duration-fast) ease;background-color:#0000;border-radius:.5rem;flex-shrink:0;align-items:flex-start;gap:.5rem;padding:.375rem .5rem;font-size:.875rem;font-weight:400;line-height:1.25rem;display:flex}.select-list__option[data-v-23e4cee1]:hover:not(.select-list__option--disabled),.select-list__option--active[data-v-23e4cee1]{background-color:var(--theme-secondary-50)}.select-list__option--disabled[data-v-23e4cee1]{cursor:not-allowed;opacity:.5}.select-list__label[data-v-23e4cee1]{white-space:nowrap;text-overflow:ellipsis;flex:auto;min-width:0;overflow:hidden}.select-list__empty[data-v-23e4cee1]{color:var(--theme-neutral-text-caption);margin:0;padding:.25rem .5rem;font-size:.875rem;line-height:1.25rem}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, VNodeChild } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { TBreakpointMobile } from '../../../types/global.types';
|
|
3
3
|
import { PopoverAlign, PopoverSide } from '../Popover';
|
|
4
4
|
export type SelectSize = 'small' | 'default' | 'large';
|
|
5
5
|
export type SelectValue = string | number;
|
|
@@ -65,6 +65,12 @@ export interface SelectProps<T extends SelectOptionData = SelectOptionData> {
|
|
|
65
65
|
multiple?: boolean;
|
|
66
66
|
/** Подпись над полем. */
|
|
67
67
|
label?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Обязательное поле: к подписи добавляется красная звёздочка, кнопке —
|
|
70
|
+
* `aria-required`. Проверку значения проп на себя не берёт, это забота
|
|
71
|
+
* формы, — он только помечает поле.
|
|
72
|
+
*/
|
|
73
|
+
required?: boolean;
|
|
68
74
|
placeholder?: string;
|
|
69
75
|
/** Пояснение под полем. При `invalid` его место занимает `errorText`. */
|
|
70
76
|
supportText?: string;
|
|
@@ -91,7 +97,7 @@ export interface SelectProps<T extends SelectOptionData = SelectOptionData> {
|
|
|
91
97
|
/** Доступное имя, когда видимой подписи нет. */
|
|
92
98
|
ariaLabel?: string;
|
|
93
99
|
/** Ниже этой ширины экрана список открывается шторкой снизу. */
|
|
94
|
-
breakpointMobile?:
|
|
100
|
+
breakpointMobile?: TBreakpointMobile;
|
|
95
101
|
/** Базовый `data-testid`; внутренние части получают суффикс имени части. */
|
|
96
102
|
testId?: string;
|
|
97
103
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './Select.css';
|
|
2
|
-
import
|
|
2
|
+
import e from "./Select.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const m = /* @__PURE__ */
|
|
4
|
+
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const m = /* @__PURE__ */ o(e, [["__scopeId", "data-v-23e4cee1"]]);
|
|
6
6
|
export {
|
|
7
7
|
m as default
|
|
8
8
|
};
|