@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.
Files changed (117) hide show
  1. package/dist/components/AlertDialog/AlertDialogAction.vue.js +2 -3
  2. package/dist/components/AlertDialog/AlertDialogCancel.vue.js +8 -9
  3. package/dist/components/AlertDialog/AlertDialogTrigger.vue.js +7 -8
  4. package/dist/components/Button/Button.css +1 -1
  5. package/dist/components/Button/Button.vue.js +5 -52
  6. package/dist/components/Button/Button.vue2.js +52 -3
  7. package/dist/components/Calendar/CalendarNext.vue.js +3 -4
  8. package/dist/components/Calendar/CalendarPrev.vue.js +7 -8
  9. package/dist/components/ConfirmDialog/ConfirmDialog.vue2.js +11 -12
  10. package/dist/components/DatePicker/DatePickerNext.vue.js +1 -2
  11. package/dist/components/DatePicker/DatePickerPrev.vue.js +7 -8
  12. package/dist/components/DateRangePicker/DateRangePickerNext.vue.js +6 -7
  13. package/dist/components/DateRangePicker/DateRangePickerPrev.vue.js +7 -8
  14. package/dist/components/RangeCalendar/RangeCalendarNext.vue.js +3 -4
  15. package/dist/components/RangeCalendar/RangeCalendarPrev.vue.js +3 -4
  16. package/dist/components/Schedule/Schedule.vue2.js +38 -39
  17. package/dist/components/index.js +391 -392
  18. package/dist/components/v2/AlertDialog/AlertDialog.css +1 -1
  19. package/dist/components/v2/AlertDialog/AlertDialog.types.d.ts +2 -2
  20. package/dist/components/v2/AlertDialog/AlertDialog.vue.d.ts +2 -2
  21. package/dist/components/v2/AlertDialog/AlertDialog.vue.js +2 -2
  22. package/dist/components/v2/AlertDialog/AlertDialog.vue2.js +29 -29
  23. package/dist/components/v2/Button/Button.css +1 -1
  24. package/dist/components/v2/Button/Button.vue.js +2 -2
  25. package/dist/components/v2/Checkbox/Checkbox.css +1 -1
  26. package/dist/components/v2/Checkbox/Checkbox.types.d.ts +11 -0
  27. package/dist/components/v2/Checkbox/Checkbox.vue.d.ts +2 -0
  28. package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
  29. package/dist/components/v2/Checkbox/Checkbox.vue2.js +61 -49
  30. package/dist/components/v2/Combobox/Combobox.css +1 -1
  31. package/dist/components/v2/Combobox/Combobox.types.d.ts +24 -4
  32. package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
  33. package/dist/components/v2/Combobox/Combobox.vue2.js +195 -188
  34. package/dist/components/v2/ConfirmDialog/ConfirmDialog.types.d.ts +2 -2
  35. package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.d.ts +2 -2
  36. package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.js +6 -6
  37. package/dist/components/v2/DatePicker/DatePicker.css +1 -1
  38. package/dist/components/v2/DatePicker/DatePicker.types.d.ts +2 -2
  39. package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
  40. package/dist/components/v2/DatePicker/DatePicker.vue.js +2 -2
  41. package/dist/components/v2/DatePicker/DatePicker.vue2.js +54 -54
  42. package/dist/components/v2/Divider/Divider.types.d.ts +8 -0
  43. package/dist/components/v2/DropdownMenu/DropdownMenu.types.d.ts +2 -2
  44. package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
  45. package/dist/components/v2/DropdownMenu/DropdownMenu.vue2.js +6 -6
  46. package/dist/components/v2/FileUpload/FileUpload.css +1 -1
  47. package/dist/components/v2/FileUpload/FileUpload.vue.js +2 -2
  48. package/dist/components/v2/FileUpload/FileUpload.vue2.js +16 -16
  49. package/dist/components/v2/FormField/FormField.css +1 -0
  50. package/dist/components/v2/FormField/FormField.types.d.ts +48 -0
  51. package/dist/components/v2/FormField/FormField.vue.d.ts +25 -0
  52. package/dist/components/v2/FormField/FormField.vue.js +8 -0
  53. package/dist/components/v2/FormField/FormField.vue2.js +54 -0
  54. package/dist/components/v2/FormField/index.d.ts +3 -0
  55. package/dist/components/v2/Image/Image.css +1 -0
  56. package/dist/components/v2/Image/Image.types.d.ts +26 -0
  57. package/dist/components/v2/Image/Image.vue.d.ts +16 -0
  58. package/dist/components/v2/Image/Image.vue.js +8 -0
  59. package/dist/components/v2/Image/Image.vue2.js +91 -0
  60. package/dist/components/v2/Image/ImageList.css +1 -0
  61. package/dist/components/v2/Image/ImageList.types.d.ts +28 -0
  62. package/dist/components/v2/Image/ImageList.vue.d.ts +15 -0
  63. package/dist/components/v2/Image/ImageList.vue.js +8 -0
  64. package/dist/components/v2/Image/ImageList.vue2.js +38 -0
  65. package/dist/components/v2/Image/index.d.ts +5 -0
  66. package/dist/components/v2/InputNumber/InputNumber.css +1 -1
  67. package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
  68. package/dist/components/v2/InputNumber/InputNumber.vue2.js +22 -21
  69. package/dist/components/v2/InputSelect/InputSelect.types.d.ts +2 -2
  70. package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +2 -2
  71. package/dist/components/v2/InputSelect/InputSelect.vue.js +14 -14
  72. package/dist/components/v2/InputSelect/InputSelectChip.css +1 -1
  73. package/dist/components/v2/InputSelect/InputSelectChip.vue.d.ts +3 -3
  74. package/dist/components/v2/InputSelect/InputSelectChip.vue.js +2 -2
  75. package/dist/components/v2/InputSelect/InputSelectChip.vue2.js +17 -17
  76. package/dist/components/v2/Popover/Popover.css +1 -1
  77. package/dist/components/v2/Popover/Popover.types.d.ts +15 -2
  78. package/dist/components/v2/Popover/Popover.vue.d.ts +3 -2
  79. package/dist/components/v2/Popover/Popover.vue.js +2 -2
  80. package/dist/components/v2/Popover/Popover.vue2.js +50 -49
  81. package/dist/components/v2/Radio/Radio.css +1 -1
  82. package/dist/components/v2/Radio/Radio.vue.d.ts +4 -0
  83. package/dist/components/v2/Radio/Radio.vue.js +1 -1
  84. package/dist/components/v2/Radio/Radio.vue2.js +57 -49
  85. package/dist/components/v2/Schedule/Schedule.css +1 -1
  86. package/dist/components/v2/Schedule/Schedule.types.d.ts +2 -2
  87. package/dist/components/v2/Schedule/Schedule.vue.d.ts +2 -2
  88. package/dist/components/v2/Schedule/Schedule.vue.js +3 -3
  89. package/dist/components/v2/Schedule/Schedule.vue2.js +58 -57
  90. package/dist/components/v2/Select/Select.css +1 -1
  91. package/dist/components/v2/Select/Select.types.d.ts +8 -2
  92. package/dist/components/v2/Select/Select.vue.js +3 -3
  93. package/dist/components/v2/Select/Select.vue2.js +102 -92
  94. package/dist/components/v2/Toast/Toast.types.d.ts +2 -2
  95. package/dist/components/v2/Toast/Toaster.css +1 -1
  96. package/dist/components/v2/Toast/Toaster.vue.d.ts +2 -2
  97. package/dist/components/v2/Toast/Toaster.vue.js +1 -1
  98. package/dist/components/v2/Toast/Toaster.vue2.js +17 -17
  99. package/dist/components/v2/Tooltip/Tooltip.css +1 -1
  100. package/dist/components/v2/Tooltip/Tooltip.types.d.ts +2 -2
  101. package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +2 -2
  102. package/dist/components/v2/Tooltip/Tooltip.vue.js +1 -1
  103. package/dist/components/v2/Tooltip/Tooltip.vue2.js +39 -38
  104. package/dist/components/v2/Tooltip/TooltipContent.css +1 -1
  105. package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +2 -2
  106. package/dist/components/v2/Tooltip/TooltipContent.vue.js +2 -2
  107. package/dist/components/v2/Tooltip/TooltipContent.vue2.js +20 -20
  108. package/dist/components/v2/Tooltip/vTooltip.directive.js +40 -41
  109. package/dist/components/v2/index.d.ts +2 -0
  110. package/dist/components/v2/index.js +82 -76
  111. package/dist/components/v2/shared/isHtmlElement.util.d.ts +15 -0
  112. package/dist/components/v2/shared/isHtmlElement.util.js +10 -0
  113. package/dist/components/v2/shared/useIsMobile.util.d.ts +13 -0
  114. package/dist/components/v2/shared/useIsMobile.util.js +8 -0
  115. package/dist/components/v2/shared/useTriggerAria.util.js +4 -3
  116. package/dist/types/global.types.d.ts +10 -0
  117. package/package.json +3 -1
@@ -1,23 +1,24 @@
1
- import { defineComponent as Re, useModel as we, useId as Ce, useAttrs as Se, computed as u, ref as V, useTemplateRef as R, onMounted as $e, nextTick as N, onBeforeUnmount as xe, watch as w, openBlock as o, createElementBlock as c, mergeProps as f, unref as r, toDisplayString as v, createCommentVNode as C, createElementVNode as g, createVNode as B, withCtx as X, Fragment as ie, renderList as ne, createBlock as q, renderSlot as D, createTextVNode as U, resolveDynamicComponent as Ie, withModifiers as Ae, mergeModels as oe } from "vue";
1
+ import { defineComponent as Re, useModel as Se, useId as we, useAttrs as Ce, computed as d, ref as V, useTemplateRef as S, onMounted as $e, nextTick as B, onBeforeUnmount as xe, watch as w, openBlock as n, createElementBlock as u, mergeProps as f, unref as o, createTextVNode as N, toDisplayString as v, createCommentVNode as y, createElementVNode as g, createVNode as q, withCtx as X, Fragment as ie, renderList as re, createBlock as U, renderSlot as D, resolveDynamicComponent as Ie, withModifiers as Ae, mergeModels as ne } from "vue";
2
2
  import { CircleX as Me, ChevronDown as Ee } from "@lucide/vue";
3
3
  import Te from "../Popover/Popover.vue.js";
4
4
  import Ve from "../Radio/RadioMarker.vue.js";
5
- import { useTestId as Ne } from "../shared/useTestId.util.js";
6
- import Be from "../shared/VisuallyHidden.vue.js";
7
- import De from "./SelectCheckMarker.vue.js";
8
- const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe = ["aria-label", "aria-multiselectable", "aria-activedescendant"], Ge = ["id", "aria-selected", "aria-disabled", "onClick", "onMouseenter"], We = { class: "select-list__label" }, ze = {
5
+ import { useTestId as Be } from "../shared/useTestId.util.js";
6
+ import Ne from "../shared/VisuallyHidden.vue.js";
7
+ import qe from "./SelectCheckMarker.vue.js";
8
+ const De = ["disabled", "aria-labelledby", "aria-label", "aria-describedby", "aria-required"], Fe = ["aria-label", "aria-multiselectable", "aria-activedescendant"], Oe = ["id", "aria-selected", "aria-disabled", "onClick", "onMouseenter"], Ge = { class: "select-list__label" }, We = {
9
9
  key: 0,
10
10
  class: "select-list__empty"
11
- }, Le = ["aria-hidden"], Xe = ["src"], qe = { class: "select__chip-label" }, Ue = ["disabled", "tabindex", "aria-label", "onClick"], je = ["aria-hidden"], He = {
11
+ }, ze = ["aria-hidden"], Le = ["src"], Xe = { class: "select__chip-label" }, Ue = ["disabled", "tabindex", "aria-label", "onClick"], je = ["aria-hidden"], He = {
12
12
  key: 3,
13
13
  class: "select__placeholder"
14
14
  }, Ke = "Нет вариантов", lt = /* @__PURE__ */ Re({
15
15
  inheritAttrs: !1,
16
16
  __name: "Select",
17
- props: /* @__PURE__ */ oe({
17
+ props: /* @__PURE__ */ ne({
18
18
  options: {},
19
19
  multiple: { type: Boolean, default: !1 },
20
20
  label: { default: void 0 },
21
+ required: { type: Boolean, default: !1 },
21
22
  placeholder: { default: "Выберите значение" },
22
23
  supportText: { default: void 0 },
23
24
  errorText: { default: void 0 },
@@ -30,7 +31,7 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
30
31
  side: { default: "bottom" },
31
32
  sideOffset: { default: 4 },
32
33
  ariaLabel: { default: void 0 },
33
- breakpointMobile: { default: "sm" },
34
+ breakpointMobile: { type: [String, Boolean], default: "sm" },
34
35
  testId: { default: void 0 }
35
36
  }, {
36
37
  modelValue: {
@@ -38,28 +39,28 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
38
39
  },
39
40
  modelModifiers: {}
40
41
  }),
41
- emits: /* @__PURE__ */ oe(["change", "select"], ["update:modelValue"]),
42
- setup(a, { emit: re }) {
43
- const s = a, S = re, $ = we(a, "modelValue"), x = Ce(), j = `select-trigger-${x}`, H = `select-label-${x}`, y = `select-list-${x}`, K = `select-message-${x}`, d = Ne(() => s.testId), F = Se(), ce = u(() => ({
42
+ emits: /* @__PURE__ */ ne(["change", "select"], ["update:modelValue"]),
43
+ setup(a, { emit: oe }) {
44
+ const s = a, C = oe, $ = Se(a, "modelValue"), x = we(), j = `select-trigger-${x}`, H = `select-label-${x}`, k = `select-list-${x}`, K = `select-message-${x}`, c = Be(() => s.testId), F = Ce(), ue = d(() => ({
44
45
  class: F.class,
45
46
  style: F.style
46
- })), ue = u(() => {
47
+ })), ce = d(() => {
47
48
  const { class: e, style: l, ...t } = F;
48
49
  return t;
49
- }), b = V(!1), P = R("fieldRef"), I = R("listRef"), A = R("contentRef"), J = R("chipsRef"), Q = R("counterRef"), m = V(Number.MAX_SAFE_INTEGER), O = V(0), n = V(-1), k = u(() => {
50
+ }), b = V(!1), P = S("fieldRef"), I = S("listRef"), A = S("contentRef"), J = S("chipsRef"), Q = S("counterRef"), m = V(Number.MAX_SAFE_INTEGER), O = V(0), r = V(-1), _ = d(() => {
50
51
  const e = $.value;
51
52
  return e == null ? [] : Array.isArray(e) ? e : [e];
52
- }), h = u(
53
- () => s.options.filter((e) => k.value.includes(e.value))
54
- ), M = u(
53
+ }), h = d(
54
+ () => s.options.filter((e) => _.value.includes(e.value))
55
+ ), M = d(
55
56
  () => h.value.map((e) => e.label).join(", ")
56
- ), E = u(
57
+ ), E = d(
57
58
  () => Math.max(0, h.value.length - m.value)
58
- ), de = u(() => M.value || s.placeholder), G = u(
59
+ ), de = d(() => M.value || s.placeholder), G = d(
59
60
  () => s.invalid ? s.errorText ?? s.supportText : s.supportText
60
- ), fe = u(() => s.width ?? O.value), ve = u(
61
- () => n.value === -1 ? void 0 : `${y}-option-${n.value}`
62
- ), be = u(() => [
61
+ ), fe = d(() => s.width ?? O.value), ve = d(
62
+ () => r.value === -1 ? void 0 : `${k}-option-${r.value}`
63
+ ), be = d(() => [
63
64
  "select",
64
65
  `select--${s.size}`,
65
66
  {
@@ -69,8 +70,8 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
69
70
  "select--multiple": s.multiple
70
71
  }
71
72
  ]);
72
- function _(e) {
73
- return k.value.includes(e);
73
+ function R(e) {
74
+ return _.value.includes(e);
74
75
  }
75
76
  function W(e) {
76
77
  const l = s.options[e];
@@ -93,32 +94,32 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
93
94
  return -1;
94
95
  }
95
96
  function ee(e = 20) {
96
- N(() => {
97
+ B(() => {
97
98
  if (!b.value) return;
98
99
  const l = I.value;
99
100
  l && (l.focus(), document.activeElement === l) || e > 0 && requestAnimationFrame(() => ee(e - 1));
100
101
  });
101
102
  }
102
103
  function he(e, l) {
103
- l || (n.value = e);
104
+ l || (r.value = e);
104
105
  }
105
106
  function pe(e) {
106
107
  switch (e.key) {
107
108
  case "ArrowDown":
108
- e.preventDefault(), n.value = Z(n.value, 1);
109
+ e.preventDefault(), r.value = Z(r.value, 1);
109
110
  break;
110
111
  case "ArrowUp":
111
- e.preventDefault(), n.value = n.value === -1 ? Y() : Z(n.value, -1);
112
+ e.preventDefault(), r.value = r.value === -1 ? Y() : Z(r.value, -1);
112
113
  break;
113
114
  case "Home":
114
- e.preventDefault(), n.value = me();
115
+ e.preventDefault(), r.value = me();
115
116
  break;
116
117
  case "End":
117
- e.preventDefault(), n.value = Y();
118
+ e.preventDefault(), r.value = Y();
118
119
  break;
119
120
  case "Enter":
120
121
  case " ": {
121
- const l = s.options[n.value];
122
+ const l = s.options[r.value];
122
123
  if (!l) break;
123
124
  e.preventDefault(), te(l);
124
125
  break;
@@ -128,17 +129,17 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
128
129
  function te(e) {
129
130
  if (!(e.disabled || s.disabled)) {
130
131
  if (s.multiple) {
131
- const l = _(e.value) ? k.value.filter((t) => t !== e.value) : [...k.value, e.value];
132
- $.value = l, S("change", l);
132
+ const l = R(e.value) ? _.value.filter((t) => t !== e.value) : [..._.value, e.value];
133
+ $.value = l, C("change", l);
133
134
  } else
134
- $.value = e.value, S("change", e.value), b.value = !1;
135
- S("select", e);
135
+ $.value = e.value, C("change", e.value), b.value = !1;
136
+ C("select", e);
136
137
  }
137
138
  }
138
139
  function ge(e) {
139
140
  if (s.disabled) return;
140
- const l = k.value.filter((t) => t !== e);
141
- $.value = l, S("change", l);
141
+ const l = _.value.filter((t) => t !== e);
142
+ $.value = l, C("change", l);
142
143
  }
143
144
  function z() {
144
145
  if (!s.multiple) return;
@@ -163,7 +164,7 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
163
164
  let T;
164
165
  $e(() => {
165
166
  const e = P.value;
166
- e && (O.value = e.getBoundingClientRect().width, N(z), T = new ResizeObserver((l) => {
167
+ e && (O.value = e.getBoundingClientRect().width, B(z), T = new ResizeObserver((l) => {
167
168
  for (const t of l)
168
169
  t.target === e && (O.value = t.borderBoxSize?.[0]?.inlineSize ?? e.getBoundingClientRect().width);
169
170
  z();
@@ -171,18 +172,18 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
171
172
  }), xe(() => T?.disconnect()), w(
172
173
  () => h.value.map((e) => e.value).join("|"),
173
174
  () => {
174
- m.value = Number.MAX_SAFE_INTEGER, N(z);
175
+ m.value = Number.MAX_SAFE_INTEGER, B(z);
175
176
  }
176
177
  );
177
178
  let le = null;
178
179
  return w(b, (e) => {
179
- e ? (le = document.activeElement, n.value = -1) : (n.value = -1, le?.focus());
180
+ e ? (le = document.activeElement, r.value = -1) : (r.value = -1, le?.focus());
180
181
  }), w(I, (e) => {
181
182
  e && b.value && ee();
182
- }), w(n, (e) => {
183
- e !== -1 && N(() => {
183
+ }), w(r, (e) => {
184
+ e !== -1 && B(() => {
184
185
  I.value?.querySelector(
185
- `#${CSS.escape(`${y}-option-${e}`)}`
186
+ `#${CSS.escape(`${k}-option-${e}`)}`
186
187
  )?.scrollIntoView({ block: "nearest" });
187
188
  });
188
189
  }), w(
@@ -190,19 +191,26 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
190
191
  (e) => {
191
192
  e && (b.value = !1);
192
193
  }
193
- ), (e, l) => (o(), c("div", f({ class: be.value }, { ...ce.value, ...r(d)("root") }), [
194
- a.label ? (o(), c("label", f({
194
+ ), (e, l) => (n(), u("div", f({ class: be.value }, { ...ue.value, ...o(c)("root") }), [
195
+ a.label ? (n(), u("label", f({
195
196
  key: 0,
196
197
  id: H,
197
198
  class: "select__label",
198
199
  for: j
199
- }, r(d)("label")), v(a.label), 17)) : C("", !0),
200
+ }, o(c)("label")), [
201
+ N(v(a.label) + " ", 1),
202
+ a.required ? (n(), u("span", f({
203
+ key: 0,
204
+ class: "select__required",
205
+ "aria-hidden": "true"
206
+ }, o(c)("required")), "*", 16)) : y("", !0)
207
+ ], 16)) : y("", !0),
200
208
  g("div", f({
201
209
  ref_key: "fieldRef",
202
210
  ref: P,
203
211
  class: "select__field"
204
- }, r(d)("field")), [
205
- B(r(Te), {
212
+ }, o(c)("field")), [
213
+ q(o(Te), {
206
214
  open: b.value,
207
215
  "onUpdate:open": l[0] || (l[0] = (t) => b.value = t),
208
216
  width: fe.value,
@@ -213,34 +221,36 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
213
221
  arrow: !1,
214
222
  "breakpoint-mobile": a.breakpointMobile,
215
223
  "trigger-has-popup": "listbox",
216
- "trigger-controls": y,
224
+ "trigger-controls": k,
217
225
  "test-id": a.testId
218
226
  }, {
219
227
  trigger: X(({ props: t }) => [
220
228
  g("button", f({
221
229
  id: j,
222
230
  type: "button",
231
+ role: "combobox",
223
232
  class: "select__trigger",
224
233
  disabled: a.disabled,
225
234
  "aria-labelledby": a.label ? H : void 0,
226
235
  "aria-label": a.label ? void 0 : a.ariaLabel,
227
- "aria-describedby": G.value ? K : void 0
236
+ "aria-describedby": G.value ? K : void 0,
237
+ "aria-required": a.required || void 0
228
238
  }, {
229
239
  ...t,
230
- ...ue.value,
231
- ...r(d)("trigger")
240
+ ...ce.value,
241
+ ...o(c)("trigger")
232
242
  }), [
233
- B(Be, null, {
243
+ q(Ne, null, {
234
244
  default: X(() => [
235
- U(v(de.value), 1)
245
+ N(v(de.value), 1)
236
246
  ]),
237
247
  _: 1
238
248
  })
239
- ], 16, Fe)
249
+ ], 16, De)
240
250
  ]),
241
251
  default: X(() => [
242
252
  g("div", {
243
- id: y,
253
+ id: k,
244
254
  ref_key: "listRef",
245
255
  ref: I,
246
256
  role: "listbox",
@@ -251,46 +261,46 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
251
261
  class: "select-list",
252
262
  onKeydown: pe
253
263
  }, [
254
- (o(!0), c(ie, null, ne(a.options, (t, i) => (o(), c("div", f({
255
- id: `${y}-option-${i}`,
264
+ (n(!0), u(ie, null, re(a.options, (t, i) => (n(), u("div", f({
265
+ id: `${k}-option-${i}`,
256
266
  key: t.value,
257
267
  role: "option",
258
268
  class: ["select-list__option", {
259
- "select-list__option--active": n.value === i,
269
+ "select-list__option--active": r.value === i,
260
270
  "select-list__option--disabled": t.disabled
261
271
  }],
262
- "aria-selected": _(t.value),
272
+ "aria-selected": R(t.value),
263
273
  "aria-disabled": t.disabled || void 0
264
- }, { ref_for: !0 }, r(d)("option", t.value), {
274
+ }, { ref_for: !0 }, o(c)("option", t.value), {
265
275
  onClick: (p) => te(t),
266
276
  onMouseenter: (p) => he(i, t.disabled)
267
277
  }), [
268
- a.multiple ? (o(), q(De, {
278
+ a.multiple ? (n(), U(qe, {
269
279
  key: 0,
270
- checked: _(t.value),
280
+ checked: R(t.value),
271
281
  disabled: t.disabled,
272
- state: n.value === i ? "hover" : "default"
273
- }, null, 8, ["checked", "disabled", "state"])) : (o(), q(r(Ve), {
282
+ state: r.value === i ? "hover" : "default"
283
+ }, null, 8, ["checked", "disabled", "state"])) : (n(), U(o(Ve), {
274
284
  key: 1,
275
- checked: _(t.value),
285
+ checked: R(t.value),
276
286
  disabled: t.disabled,
277
- state: n.value === i ? "hover" : "default"
287
+ state: r.value === i ? "hover" : "default"
278
288
  }, null, 8, ["checked", "disabled", "state"])),
279
289
  D(e.$slots, "option", {
280
290
  option: t,
281
- selected: _(t.value),
282
- active: n.value === i,
291
+ selected: R(t.value),
292
+ active: r.value === i,
283
293
  index: i
284
294
  }, () => [
285
- g("span", We, v(t.label), 1)
295
+ g("span", Ge, v(t.label), 1)
286
296
  ], !0)
287
- ], 16, Ge))), 128)),
288
- a.options.length ? C("", !0) : (o(), c("p", ze, [
297
+ ], 16, Oe))), 128)),
298
+ a.options.length ? y("", !0) : (n(), u("p", We, [
289
299
  D(e.$slots, "empty", {}, () => [
290
- U(v(Ke))
300
+ N(v(Ke))
291
301
  ], !0)
292
302
  ]))
293
- ], 40, Oe)
303
+ ], 40, Fe)
294
304
  ]),
295
305
  _: 3
296
306
  }, 8, ["open", "width", "side", "side-offset", "align", "align-offset", "breakpoint-mobile", "test-id"]),
@@ -299,35 +309,35 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
299
309
  ref: A,
300
310
  class: "select__content"
301
311
  }, [
302
- a.multiple && h.value.length ? (o(), c("span", {
312
+ a.multiple && h.value.length ? (n(), u("span", {
303
313
  key: 0,
304
314
  ref_key: "chipsRef",
305
315
  ref: J,
306
316
  class: "select__chips"
307
317
  }, [
308
- (o(!0), c(ie, null, ne(h.value, (t, i) => (o(), c("span", f({
318
+ (n(!0), u(ie, null, re(h.value, (t, i) => (n(), u("span", f({
309
319
  key: t.value,
310
320
  "data-chip": "item",
311
321
  class: ["select__chip", {
312
322
  "select__chip--measured": i >= m.value
313
323
  }],
314
324
  "aria-hidden": i >= m.value || void 0
315
- }, { ref_for: !0 }, r(d)("chip", t.value)), [
325
+ }, { ref_for: !0 }, o(c)("chip", t.value)), [
316
326
  D(e.$slots, "chip", {
317
327
  option: t,
318
328
  index: i
319
329
  }, () => [
320
- t.avatar ? (o(), c("img", {
330
+ t.avatar ? (n(), u("img", {
321
331
  key: 0,
322
332
  class: "select__chip-avatar",
323
333
  src: t.avatar,
324
334
  alt: ""
325
- }, null, 8, Xe)) : t.icon ? (o(), q(Ie(t.icon), {
335
+ }, null, 8, Le)) : t.icon ? (n(), U(Ie(t.icon), {
326
336
  key: 1,
327
337
  class: "select__chip-icon",
328
338
  "aria-hidden": "true"
329
- })) : C("", !0),
330
- g("span", qe, v(t.label), 1)
339
+ })) : y("", !0),
340
+ g("span", Xe, v(t.label), 1)
331
341
  ], !0),
332
342
  g("button", f({
333
343
  type: "button",
@@ -335,44 +345,44 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
335
345
  disabled: a.disabled,
336
346
  tabindex: i >= m.value ? -1 : void 0,
337
347
  "aria-label": `Убрать ${t.label}`
338
- }, { ref_for: !0 }, r(d)("chip-remove", t.value), {
348
+ }, { ref_for: !0 }, o(c)("chip-remove", t.value), {
339
349
  onClick: Ae((p) => ge(t.value), ["stop"])
340
350
  }), [
341
- B(r(Me), {
351
+ q(o(Me), {
342
352
  class: "select__chip-icon",
343
353
  "aria-hidden": "true"
344
354
  })
345
355
  ], 16, Ue)
346
- ], 16, Le))), 128))
347
- ], 512)) : C("", !0),
348
- a.multiple && h.value.length ? (o(), c("span", f({
356
+ ], 16, ze))), 128))
357
+ ], 512)) : y("", !0),
358
+ a.multiple && h.value.length ? (n(), u("span", f({
349
359
  key: 1,
350
360
  ref_key: "counterRef",
351
361
  ref: Q,
352
362
  class: ["select__chip select__chip--counter", { "select__chip--measured": !E.value }],
353
363
  "aria-hidden": !E.value || void 0
354
- }, r(d)("chip-counter")), " +" + v(E.value || 1), 17, je)) : M.value ? (o(), c("span", f({
364
+ }, o(c)("chip-counter")), " +" + v(E.value || 1), 17, je)) : M.value ? (n(), u("span", f({
355
365
  key: 2,
356
366
  class: "select__value"
357
- }, r(d)("value")), [
367
+ }, o(c)("value")), [
358
368
  D(e.$slots, "value", {
359
369
  option: h.value[0],
360
370
  displayValue: M.value
361
371
  }, () => [
362
- U(v(M.value), 1)
372
+ N(v(M.value), 1)
363
373
  ], !0)
364
- ], 16)) : (o(), c("span", He, v(a.placeholder), 1))
374
+ ], 16)) : (n(), u("span", He, v(a.placeholder), 1))
365
375
  ], 512),
366
- B(r(Ee), {
376
+ q(o(Ee), {
367
377
  class: "select__arrow",
368
378
  "aria-hidden": "true"
369
379
  })
370
380
  ], 16),
371
- G.value ? (o(), c("p", f({
381
+ G.value ? (n(), u("p", f({
372
382
  key: 1,
373
383
  id: K,
374
384
  class: "select__message"
375
- }, r(d)("message")), v(G.value), 17)) : C("", !0)
385
+ }, o(c)("message")), v(G.value), 17)) : y("", !0)
376
386
  ], 16));
377
387
  }
378
388
  });
@@ -1,4 +1,4 @@
1
- import { TBreakpoints } from '../../../types/global.types';
1
+ import { TBreakpointMobile } from '../../../types/global.types';
2
2
  export type ToastVariant = 'info' | 'success' | 'warning' | 'error';
3
3
  export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
4
4
  /** Направление свайпа, которым тост закрывается. `none` — свайп отключён. */
@@ -55,7 +55,7 @@ export interface ToasterProps {
55
55
  limit?: number;
56
56
  zIndex?: number;
57
57
  /** Брейкпоинт, ниже которого стек занимает всю ширину экрана. */
58
- breakpointMobile?: TBreakpoints;
58
+ breakpointMobile?: TBreakpointMobile;
59
59
  /** Направление свайпа. По умолчанию выводится из `position`. */
60
60
  swipeDirection?: ToastSwipeDirection;
61
61
  /** Доступное имя области с уведомлениями (`aria-label`). */
@@ -1 +1 @@
1
- .toaster[data-v-6890b6d4]{width:23.75rem;max-width:calc(100vw - var(--toaster-offset) * 2);z-index:var(--toaster-z-index);pointer-events:none;flex-direction:column;gap:.5rem;display:flex;position:fixed}.toaster[data-v-6890b6d4]>*{pointer-events:auto}.toaster--top[data-v-6890b6d4]{top:var(--toaster-offset)}.toaster--bottom[data-v-6890b6d4]{bottom:var(--toaster-offset);flex-direction:column-reverse}.toaster--left[data-v-6890b6d4]{left:var(--toaster-offset)}.toaster--right[data-v-6890b6d4]{right:var(--toaster-offset)}.toaster--center[data-v-6890b6d4]{left:50%;transform:translate(-50%)}.toaster--mobile[data-v-6890b6d4]{width:auto;max-width:none;left:var(--toaster-offset);right:var(--toaster-offset);transform:none}.toast-enter-from[data-v-6890b6d4],.toast-leave-to[data-v-6890b6d4]{opacity:0;transform:var(--toaster-slide)}.toast-enter-active[data-v-6890b6d4],.toast-leave-active[data-v-6890b6d4],.toast-move[data-v-6890b6d4]{transition:transform var(--animation-duration) ease, opacity var(--animation-duration) ease}.toast-leave-active[data-v-6890b6d4]{width:100%;position:absolute}
1
+ .toaster[data-v-ad45c627]{width:23.75rem;max-width:calc(100vw - var(--toaster-offset) * 2);z-index:var(--toaster-z-index);pointer-events:none;flex-direction:column;gap:.5rem;display:flex;position:fixed}.toaster[data-v-ad45c627]>*{pointer-events:auto}.toaster--top[data-v-ad45c627]{top:var(--toaster-offset)}.toaster--bottom[data-v-ad45c627]{bottom:var(--toaster-offset);flex-direction:column-reverse}.toaster--left[data-v-ad45c627]{left:var(--toaster-offset)}.toaster--right[data-v-ad45c627]{right:var(--toaster-offset)}.toaster--center[data-v-ad45c627]{left:50%;transform:translate(-50%)}.toaster--mobile[data-v-ad45c627]{width:auto;max-width:none;left:var(--toaster-offset);right:var(--toaster-offset);transform:none}.toast-enter-from[data-v-ad45c627],.toast-leave-to[data-v-ad45c627]{opacity:0;transform:var(--toaster-slide)}.toast-enter-active[data-v-ad45c627],.toast-leave-active[data-v-ad45c627],.toast-move[data-v-ad45c627]{transition:transform var(--animation-duration) ease, opacity var(--animation-duration) ease}.toast-leave-active[data-v-ad45c627]{width:100%;position:absolute}
@@ -1,12 +1,12 @@
1
1
  import { ToasterProps, ToastSwipeDirection, ToastPosition } from './Toast.types';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- import { TBreakpoints } from '../../../types/global.types';
3
+ import { TBreakpointMobile } from '../../../types/global.types';
4
4
  declare const _default: DefineComponent<ToasterProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
5
5
  label: string;
6
6
  offset: number;
7
7
  position: ToastPosition;
8
8
  zIndex: number;
9
- breakpointMobile: TBreakpoints;
9
+ breakpointMobile: TBreakpointMobile;
10
10
  swipeDirection: ToastSwipeDirection;
11
11
  testId: string;
12
12
  limit: number;
@@ -2,7 +2,7 @@ import './Toaster.css';
2
2
  import o from "./Toaster.vue2.js";
3
3
  /* empty css */
4
4
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
5
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6890b6d4"]]);
5
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ad45c627"]]);
6
6
  export {
7
7
  p as default
8
8
  };
@@ -1,27 +1,27 @@
1
- import { defineComponent as S, ref as x, computed as o, onMounted as y, onBeforeUnmount as L, watch as C, openBlock as i, createBlock as b, withCtx as T, createElementBlock as w, mergeProps as B, unref as a, createVNode as D, TransitionGroup as z, Fragment as E, renderList as Y, createCommentVNode as O } from "vue";
2
- import { breakpoints as P } from "../../../utils/breakpoints.util.js";
3
- import W from "../shared/Portal.vue.js";
1
+ import { defineComponent as F, ref as k, computed as o, onMounted as x, onBeforeUnmount as L, watch as B, openBlock as i, createBlock as b, withCtx as T, createElementBlock as w, mergeProps as C, unref as a, createVNode as D, TransitionGroup as z, Fragment as E, renderList as Y, createCommentVNode as O } from "vue";
2
+ import P from "../shared/Portal.vue.js";
3
+ import { useIsMobile as W } from "../shared/useIsMobile.util.js";
4
4
  import { useTestId as X } from "../shared/useTestId.util.js";
5
5
  import A from "./Toast.vue.js";
6
6
  import { TOAST_DEFAULT_LIMIT as N, useToast as U } from "./useToast.js";
7
- const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ S({
7
+ const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ F({
8
8
  __name: "Toaster",
9
9
  props: {
10
10
  position: { default: "top-right" },
11
11
  offset: { default: 24 },
12
12
  limit: { default: N },
13
13
  zIndex: { default: 9999 },
14
- breakpointMobile: { default: "sm" },
14
+ breakpointMobile: { type: [String, Boolean], default: "sm" },
15
15
  swipeDirection: { default: void 0 },
16
16
  label: { default: "Уведомления" },
17
17
  closeLabel: { default: void 0 },
18
18
  testId: { default: void 0 }
19
19
  },
20
20
  setup(r) {
21
- const s = x([]), t = r, { toasts: h, dismiss: M, pause: f, resume: v, setLimit: _ } = U(), g = X(() => t.testId), l = /* @__PURE__ */ Symbol("toaster"), I = o(
21
+ const s = k([]), t = r, { toasts: h, dismiss: M, pause: f, resume: v, setLimit: g } = U(), I = X(() => t.testId), l = /* @__PURE__ */ Symbol("toaster"), _ = o(
22
22
  () => s.value[0] === l
23
23
  );
24
- y(() => {
24
+ x(() => {
25
25
  s.value = [...s.value, l], s.value.length > 1 && console.warn(
26
26
  "[Toaster] Смонтировано несколько Toaster — очередь тостов общая, поэтому лишние экземпляры не отрисовываются. Оставьте один Toaster на приложение."
27
27
  );
@@ -30,9 +30,9 @@ const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ S({
30
30
  (m) => m !== l
31
31
  );
32
32
  });
33
- const u = P.smaller(t.breakpointMobile), c = o(
33
+ const u = W(t.breakpointMobile), c = o(
34
34
  () => t.position.startsWith("bottom") ? "bottom" : "top"
35
- ), d = o(() => t.position.endsWith("left") ? "left" : t.position.endsWith("center") ? "center" : "right"), p = o(() => t.swipeDirection ? t.swipeDirection : u.value || d.value === "center" ? c.value === "top" ? "up" : "down" : d.value === "left" ? "left" : "right"), $ = o(() => {
35
+ ), d = o(() => t.position.endsWith("left") ? "left" : t.position.endsWith("center") ? "center" : "right"), p = o(() => t.swipeDirection ? t.swipeDirection : u.value || d.value === "center" ? c.value === "top" ? "up" : "down" : d.value === "left" ? "left" : "right"), S = o(() => {
36
36
  switch (p.value) {
37
37
  case "right":
38
38
  return "translateX(120%)";
@@ -45,25 +45,25 @@ const V = ["aria-label"], G = 10, Z = /* @__PURE__ */ S({
45
45
  default:
46
46
  return c.value === "top" ? "translateY(-120%)" : "translateY(120%)";
47
47
  }
48
- }), k = o(() => [
48
+ }), $ = o(() => [
49
49
  "toaster",
50
50
  `toaster--${c.value}`,
51
51
  `toaster--${d.value}`,
52
52
  { "toaster--mobile": u.value }
53
- ]), F = o(() => ({
53
+ ]), y = o(() => ({
54
54
  "--toaster-offset": `${u.value ? G : t.offset}px`,
55
55
  "--toaster-z-index": String(t.zIndex),
56
- "--toaster-slide": $.value
56
+ "--toaster-slide": S.value
57
57
  }));
58
- return C(() => t.limit, _, { immediate: !0 }), (m, K) => (i(), b(W, null, {
58
+ return B(() => t.limit, g, { immediate: !0 }), (m, K) => (i(), b(P, null, {
59
59
  default: T(() => [
60
- I.value ? (i(), w("div", B({
60
+ _.value ? (i(), w("div", C({
61
61
  key: 0,
62
- class: k.value,
63
- style: F.value,
62
+ class: $.value,
63
+ style: y.value,
64
64
  role: "region",
65
65
  "aria-label": r.label
66
- }, a(g)("viewport")), [
66
+ }, a(I)("viewport")), [
67
67
  D(z, { name: "toast" }, {
68
68
  default: T(() => [
69
69
  (i(!0), w(E, null, Y(a(h), (e) => (i(), b(A, {
@@ -1 +1 @@
1
- .tooltip-trigger[data-v-ac7b22ad]{width:fit-content;display:inline-block}
1
+ .tooltip-trigger[data-v-06f091c9]{width:fit-content;display:inline-block}
@@ -1,4 +1,4 @@
1
- import { TBreakpoints } from '../../../types/global.types';
1
+ import { TBreakpointMobile } from '../../../types/global.types';
2
2
  export type TooltipSide = 'top' | 'right' | 'bottom' | 'left';
3
3
  export type TooltipAlign = 'start' | 'center' | 'end';
4
4
  export interface TooltipProps {
@@ -29,7 +29,7 @@ export interface TooltipProps {
29
29
  disabled?: boolean;
30
30
  zIndex?: number | 'auto';
31
31
  /** Ширина, ниже которой подсказка открывается шторкой снизу. */
32
- breakpointMobile?: TBreakpoints;
32
+ breakpointMobile?: TBreakpointMobile;
33
33
  /** Доступное имя шторки на мобильных (`aria-label`). */
34
34
  mobileLabel?: string;
35
35
  /** Базовый `data-testid`; внутренние части получают суффикс имени части. */
@@ -1,6 +1,6 @@
1
1
  import { TooltipProps, TooltipSide, TooltipAlign } from './Tooltip.types';
2
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- import { TBreakpoints } from '../../../types/global.types';
3
+ import { TBreakpointMobile } from '../../../types/global.types';
4
4
  type __VLS_Props = TooltipProps;
5
5
  type __VLS_PublicProps = {
6
6
  'open'?: boolean;
@@ -29,7 +29,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
29
29
  sideOffset: number;
30
30
  align: TooltipAlign;
31
31
  alignOffset: number;
32
- breakpointMobile: TBreakpoints;
32
+ breakpointMobile: TBreakpointMobile;
33
33
  arrow: boolean;
34
34
  testId: string;
35
35
  maxWidth: number | string;
@@ -2,7 +2,7 @@ import './Tooltip.css';
2
2
  import o from "./Tooltip.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-ac7b22ad"]]);
5
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-06f091c9"]]);
6
6
  export {
7
7
  m as default
8
8
  };