@profitliga/ui 2.0.2 → 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.
Files changed (121) 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/Checkbox/Checkbox.css +1 -1
  24. package/dist/components/v2/Checkbox/Checkbox.types.d.ts +11 -0
  25. package/dist/components/v2/Checkbox/Checkbox.vue.d.ts +2 -0
  26. package/dist/components/v2/Checkbox/Checkbox.vue.js +2 -2
  27. package/dist/components/v2/Checkbox/Checkbox.vue2.js +61 -49
  28. package/dist/components/v2/Combobox/Combobox.css +1 -1
  29. package/dist/components/v2/Combobox/Combobox.types.d.ts +28 -2
  30. package/dist/components/v2/Combobox/Combobox.vue.d.ts +3 -2
  31. package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
  32. package/dist/components/v2/Combobox/Combobox.vue2.js +305 -251
  33. package/dist/components/v2/ConfirmDialog/ConfirmDialog.types.d.ts +2 -2
  34. package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.d.ts +2 -2
  35. package/dist/components/v2/ConfirmDialog/ConfirmDialog.vue.js +6 -6
  36. package/dist/components/v2/DatePicker/DatePicker.css +1 -1
  37. package/dist/components/v2/DatePicker/DatePicker.types.d.ts +2 -2
  38. package/dist/components/v2/DatePicker/DatePicker.vue.d.ts +2 -2
  39. package/dist/components/v2/DatePicker/DatePicker.vue.js +2 -2
  40. package/dist/components/v2/DatePicker/DatePicker.vue2.js +54 -54
  41. package/dist/components/v2/Divider/Divider.css +1 -1
  42. package/dist/components/v2/Divider/Divider.types.d.ts +8 -0
  43. package/dist/components/v2/Divider/Divider.vue.js +2 -2
  44. package/dist/components/v2/DropdownMenu/DropdownMenu.types.d.ts +2 -2
  45. package/dist/components/v2/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
  46. package/dist/components/v2/DropdownMenu/DropdownMenu.vue2.js +6 -6
  47. package/dist/components/v2/FileUpload/FileUpload.css +1 -1
  48. package/dist/components/v2/FileUpload/FileUpload.vue.js +2 -2
  49. package/dist/components/v2/FileUpload/FileUpload.vue2.js +16 -16
  50. package/dist/components/v2/FormField/FormField.css +1 -0
  51. package/dist/components/v2/FormField/FormField.types.d.ts +48 -0
  52. package/dist/components/v2/FormField/FormField.vue.d.ts +25 -0
  53. package/dist/components/v2/FormField/FormField.vue.js +8 -0
  54. package/dist/components/v2/FormField/FormField.vue2.js +54 -0
  55. package/dist/components/v2/FormField/index.d.ts +3 -0
  56. package/dist/components/v2/Image/Image.css +1 -0
  57. package/dist/components/v2/Image/Image.types.d.ts +26 -0
  58. package/dist/components/v2/Image/Image.vue.d.ts +16 -0
  59. package/dist/components/v2/Image/Image.vue.js +8 -0
  60. package/dist/components/v2/Image/Image.vue2.js +91 -0
  61. package/dist/components/v2/Image/ImageList.css +1 -0
  62. package/dist/components/v2/Image/ImageList.types.d.ts +28 -0
  63. package/dist/components/v2/Image/ImageList.vue.d.ts +15 -0
  64. package/dist/components/v2/Image/ImageList.vue.js +8 -0
  65. package/dist/components/v2/Image/ImageList.vue2.js +38 -0
  66. package/dist/components/v2/Image/index.d.ts +5 -0
  67. package/dist/components/v2/Input/Input.css +1 -1
  68. package/dist/components/v2/Input/Input.vue.js +2 -2
  69. package/dist/components/v2/Input/Input.vue2.js +113 -107
  70. package/dist/components/v2/InputNumber/InputNumber.css +1 -1
  71. package/dist/components/v2/InputNumber/InputNumber.vue.js +2 -2
  72. package/dist/components/v2/InputNumber/InputNumber.vue2.js +22 -21
  73. package/dist/components/v2/InputSelect/InputSelect.types.d.ts +2 -2
  74. package/dist/components/v2/InputSelect/InputSelect.vue.d.ts +2 -2
  75. package/dist/components/v2/InputSelect/InputSelect.vue.js +14 -14
  76. package/dist/components/v2/InputSelect/InputSelectChip.css +1 -1
  77. package/dist/components/v2/InputSelect/InputSelectChip.vue.d.ts +3 -3
  78. package/dist/components/v2/InputSelect/InputSelectChip.vue.js +2 -2
  79. package/dist/components/v2/InputSelect/InputSelectChip.vue2.js +17 -17
  80. package/dist/components/v2/Popover/Popover.css +1 -1
  81. package/dist/components/v2/Popover/Popover.types.d.ts +2 -2
  82. package/dist/components/v2/Popover/Popover.vue.d.ts +2 -2
  83. package/dist/components/v2/Popover/Popover.vue.js +2 -2
  84. package/dist/components/v2/Popover/Popover.vue2.js +24 -24
  85. package/dist/components/v2/Radio/Radio.css +1 -1
  86. package/dist/components/v2/Radio/Radio.vue.d.ts +4 -0
  87. package/dist/components/v2/Radio/Radio.vue.js +1 -1
  88. package/dist/components/v2/Radio/Radio.vue2.js +57 -49
  89. package/dist/components/v2/Schedule/Schedule.css +1 -1
  90. package/dist/components/v2/Schedule/Schedule.types.d.ts +2 -2
  91. package/dist/components/v2/Schedule/Schedule.vue.d.ts +2 -2
  92. package/dist/components/v2/Schedule/Schedule.vue.js +3 -3
  93. package/dist/components/v2/Schedule/Schedule.vue2.js +55 -55
  94. package/dist/components/v2/Select/Select.css +1 -1
  95. package/dist/components/v2/Select/Select.types.d.ts +8 -2
  96. package/dist/components/v2/Select/Select.vue.js +3 -3
  97. package/dist/components/v2/Select/Select.vue2.js +143 -127
  98. package/dist/components/v2/Toast/Toast.types.d.ts +2 -2
  99. package/dist/components/v2/Toast/Toaster.css +1 -1
  100. package/dist/components/v2/Toast/Toaster.vue.d.ts +2 -2
  101. package/dist/components/v2/Toast/Toaster.vue.js +1 -1
  102. package/dist/components/v2/Toast/Toaster.vue2.js +17 -17
  103. package/dist/components/v2/Tooltip/Tooltip.css +1 -1
  104. package/dist/components/v2/Tooltip/Tooltip.types.d.ts +2 -2
  105. package/dist/components/v2/Tooltip/Tooltip.vue.d.ts +2 -2
  106. package/dist/components/v2/Tooltip/Tooltip.vue.js +1 -1
  107. package/dist/components/v2/Tooltip/Tooltip.vue2.js +39 -38
  108. package/dist/components/v2/Tooltip/TooltipContent.css +1 -1
  109. package/dist/components/v2/Tooltip/TooltipContent.vue.d.ts +2 -2
  110. package/dist/components/v2/Tooltip/TooltipContent.vue.js +2 -2
  111. package/dist/components/v2/Tooltip/TooltipContent.vue2.js +20 -20
  112. package/dist/components/v2/Tooltip/vTooltip.directive.js +40 -41
  113. package/dist/components/v2/index.d.ts +2 -0
  114. package/dist/components/v2/index.js +82 -76
  115. package/dist/components/v2/shared/isHtmlElement.util.d.ts +15 -0
  116. package/dist/components/v2/shared/isHtmlElement.util.js +10 -0
  117. package/dist/components/v2/shared/useIsMobile.util.d.ts +13 -0
  118. package/dist/components/v2/shared/useIsMobile.util.js +8 -0
  119. package/dist/components/v2/shared/useTriggerAria.util.js +4 -3
  120. package/dist/types/global.types.d.ts +10 -0
  121. package/package.json +3 -1
@@ -1,23 +1,24 @@
1
- import { defineComponent as Re, useModel as we, useId as xe, useAttrs as Ce, computed as u, ref as E, useTemplateRef as _, onMounted as Ae, nextTick as L, onBeforeUnmount as Ie, watch as T, openBlock as r, createElementBlock as o, mergeProps as f, unref as c, toDisplayString as v, createCommentVNode as R, createElementVNode as g, createVNode as V, withCtx as X, Fragment as ie, renderList as ne, createBlock as U, renderSlot as N, createTextVNode as j, resolveDynamicComponent as Me, withModifiers as Se, mergeModels as re } from "vue";
2
- import { CircleX as $e, ChevronDown as Ee } from "@lucide/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
+ 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"], Ue = { class: "select__chip-label" }, je = ["disabled", "tabindex", "aria-label", "onClick"], qe = ["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__ */ re({
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__ */ re(["change", "select"], ["update:modelValue"]),
42
- setup(a, { emit: ce }) {
43
- const s = a, w = ce, x = we(a, "modelValue"), C = xe(), q = `select-trigger-${C}`, H = `select-label-${C}`, A = `select-list-${C}`, K = `select-message-${C}`, d = Ne(() => s.testId), B = Ce(), oe = u(() => ({
44
- class: B.class,
45
- style: B.style
46
- })), ue = u(() => {
47
- const { class: e, style: l, ...t } = B;
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(() => ({
45
+ class: F.class,
46
+ style: F.style
47
+ })), ce = d(() => {
48
+ const { class: e, style: l, ...t } = F;
48
49
  return t;
49
- }), b = E(!1), P = _("fieldRef"), D = _("listRef"), I = _("contentRef"), J = _("chipsRef"), Q = _("counterRef"), m = E(Number.MAX_SAFE_INTEGER), F = E(0), n = E(-1), y = u(() => {
50
- const e = x.value;
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(() => {
51
+ const e = $.value;
51
52
  return e == null ? [] : Array.isArray(e) ? e : [e];
52
- }), h = u(
53
- () => s.options.filter((e) => y.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
- ), S = u(
57
+ ), E = d(
57
58
  () => Math.max(0, h.value.length - m.value)
58
- ), de = u(() => M.value || s.placeholder), O = 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 ?? F.value), ve = u(
61
- () => n.value === -1 ? void 0 : `${A}-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,19 +70,19 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
69
70
  "select--multiple": s.multiple
70
71
  }
71
72
  ]);
72
- function k(e) {
73
- return y.value.includes(e);
73
+ function R(e) {
74
+ return _.value.includes(e);
74
75
  }
75
- function G(e) {
76
+ function W(e) {
76
77
  const l = s.options[e];
77
78
  return !!l && !l?.disabled;
78
79
  }
79
80
  function me() {
80
- return s.options.findIndex((e, l) => G(l));
81
+ return s.options.findIndex((e, l) => W(l));
81
82
  }
82
83
  function Y() {
83
84
  for (let e = s.options.length - 1; e >= 0; e -= 1)
84
- if (G(e)) return e;
85
+ if (W(e)) return e;
85
86
  return -1;
86
87
  }
87
88
  function Z(e, l) {
@@ -89,36 +90,36 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
89
90
  if (t === 0) return -1;
90
91
  let i = e;
91
92
  for (let p = 0; p < t; p += 1)
92
- if (i = (i + l + t) % t, G(i)) return i;
93
+ if (i = (i + l + t) % t, W(i)) return i;
93
94
  return -1;
94
95
  }
95
96
  function ee(e = 20) {
96
- L(() => {
97
+ B(() => {
97
98
  if (!b.value) return;
98
- const l = D.value;
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,21 +129,21 @@ 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 = k(e.value) ? y.value.filter((t) => t !== e.value) : [...y.value, e.value];
132
- x.value = l, w("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
- x.value = e.value, w("change", e.value), b.value = !1;
135
- w("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 = y.value.filter((t) => t !== e);
141
- x.value = l, w("change", l);
141
+ const l = _.value.filter((t) => t !== e);
142
+ $.value = l, C("change", l);
142
143
  }
143
- function W() {
144
+ function z() {
144
145
  if (!s.multiple) return;
145
- const e = I.value, l = J.value;
146
+ const e = A.value, l = J.value;
146
147
  if (!e || !l) return;
147
148
  const t = Array.from(
148
149
  l.querySelectorAll('[data-chip="item"]')
@@ -151,52 +152,65 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
151
152
  m.value = Number.MAX_SAFE_INTEGER;
152
153
  return;
153
154
  }
154
- const i = Number.parseFloat(getComputedStyle(l).columnGap) || 0, p = Number.parseFloat(getComputedStyle(e).columnGap) || 0, ye = S.value ? (Q.value?.offsetWidth ?? 0) + p : 0, ke = e.clientWidth - ye;
155
- let ae = 0, z = 0;
155
+ const i = Number.parseFloat(getComputedStyle(l).columnGap) || 0, p = Number.parseFloat(getComputedStyle(e).columnGap) || 0, ye = E.value ? (Q.value?.offsetWidth ?? 0) + p : 0, ke = e.clientWidth - ye;
156
+ let ae = 0, L = 0;
156
157
  for (const _e of t) {
157
- const se = ae + (z ? i : 0) + _e.offsetWidth;
158
+ const se = ae + (L ? i : 0) + _e.offsetWidth;
158
159
  if (se > ke) break;
159
- ae = se, z += 1;
160
+ ae = se, L += 1;
160
161
  }
161
- m.value = Math.max(z, 1);
162
+ m.value = Math.max(L, 1);
162
163
  }
163
- let $;
164
- Ae(() => {
164
+ let T;
165
+ $e(() => {
165
166
  const e = P.value;
166
- e && (F.value = e.getBoundingClientRect().width, L(W), $ = new ResizeObserver((l) => {
167
+ e && (O.value = e.getBoundingClientRect().width, B(z), T = new ResizeObserver((l) => {
167
168
  for (const t of l)
168
- t.target === e && (F.value = t.borderBoxSize?.[0]?.inlineSize ?? e.getBoundingClientRect().width);
169
- W();
170
- }), $.observe(e), I.value && $.observe(I.value));
171
- }), Ie(() => $?.disconnect()), T(
169
+ t.target === e && (O.value = t.borderBoxSize?.[0]?.inlineSize ?? e.getBoundingClientRect().width);
170
+ z();
171
+ }), T.observe(e), A.value && T.observe(A.value));
172
+ }), xe(() => T?.disconnect()), w(
172
173
  () => h.value.map((e) => e.value).join("|"),
173
174
  () => {
174
- m.value = Number.MAX_SAFE_INTEGER, L(W);
175
+ m.value = Number.MAX_SAFE_INTEGER, B(z);
175
176
  }
176
177
  );
177
178
  let le = null;
178
- return T(b, (e) => {
179
- e ? (le = document.activeElement, n.value = -1) : (n.value = -1, le?.focus());
180
- }), T(D, (e) => {
179
+ return w(b, (e) => {
180
+ e ? (le = document.activeElement, r.value = -1) : (r.value = -1, le?.focus());
181
+ }), w(I, (e) => {
181
182
  e && b.value && ee();
182
- }), T(
183
+ }), w(r, (e) => {
184
+ e !== -1 && B(() => {
185
+ I.value?.querySelector(
186
+ `#${CSS.escape(`${k}-option-${e}`)}`
187
+ )?.scrollIntoView({ block: "nearest" });
188
+ });
189
+ }), w(
183
190
  () => s.disabled,
184
191
  (e) => {
185
192
  e && (b.value = !1);
186
193
  }
187
- ), (e, l) => (r(), o("div", f({ class: be.value }, { ...oe.value, ...c(d)("root") }), [
188
- a.label ? (r(), o("label", f({
194
+ ), (e, l) => (n(), u("div", f({ class: be.value }, { ...ue.value, ...o(c)("root") }), [
195
+ a.label ? (n(), u("label", f({
189
196
  key: 0,
190
197
  id: H,
191
198
  class: "select__label",
192
- for: q
193
- }, c(d)("label")), v(a.label), 17)) : R("", !0),
199
+ for: j
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),
194
208
  g("div", f({
195
209
  ref_key: "fieldRef",
196
210
  ref: P,
197
211
  class: "select__field"
198
- }, c(d)("field")), [
199
- V(c(Te), {
212
+ }, o(c)("field")), [
213
+ q(o(Te), {
200
214
  open: b.value,
201
215
  "onUpdate:open": l[0] || (l[0] = (t) => b.value = t),
202
216
  width: fe.value,
@@ -207,36 +221,38 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
207
221
  arrow: !1,
208
222
  "breakpoint-mobile": a.breakpointMobile,
209
223
  "trigger-has-popup": "listbox",
210
- "trigger-controls": A,
224
+ "trigger-controls": k,
211
225
  "test-id": a.testId
212
226
  }, {
213
227
  trigger: X(({ props: t }) => [
214
228
  g("button", f({
215
- id: q,
229
+ id: j,
216
230
  type: "button",
231
+ role: "combobox",
217
232
  class: "select__trigger",
218
233
  disabled: a.disabled,
219
234
  "aria-labelledby": a.label ? H : void 0,
220
235
  "aria-label": a.label ? void 0 : a.ariaLabel,
221
- "aria-describedby": O.value ? K : void 0
236
+ "aria-describedby": G.value ? K : void 0,
237
+ "aria-required": a.required || void 0
222
238
  }, {
223
239
  ...t,
224
- ...ue.value,
225
- ...c(d)("trigger")
240
+ ...ce.value,
241
+ ...o(c)("trigger")
226
242
  }), [
227
- V(Be, null, {
243
+ q(Ne, null, {
228
244
  default: X(() => [
229
- j(v(de.value), 1)
245
+ N(v(de.value), 1)
230
246
  ]),
231
247
  _: 1
232
248
  })
233
- ], 16, Fe)
249
+ ], 16, De)
234
250
  ]),
235
251
  default: X(() => [
236
252
  g("div", {
237
- id: A,
253
+ id: k,
238
254
  ref_key: "listRef",
239
- ref: D,
255
+ ref: I,
240
256
  role: "listbox",
241
257
  tabindex: "0",
242
258
  "aria-label": a.label ?? a.ariaLabel,
@@ -245,83 +261,83 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
245
261
  class: "select-list",
246
262
  onKeydown: pe
247
263
  }, [
248
- (r(!0), o(ie, null, ne(a.options, (t, i) => (r(), o("div", f({
249
- id: `${A}-option-${i}`,
264
+ (n(!0), u(ie, null, re(a.options, (t, i) => (n(), u("div", f({
265
+ id: `${k}-option-${i}`,
250
266
  key: t.value,
251
267
  role: "option",
252
268
  class: ["select-list__option", {
253
- "select-list__option--active": n.value === i,
269
+ "select-list__option--active": r.value === i,
254
270
  "select-list__option--disabled": t.disabled
255
271
  }],
256
- "aria-selected": k(t.value),
272
+ "aria-selected": R(t.value),
257
273
  "aria-disabled": t.disabled || void 0
258
- }, { ref_for: !0 }, c(d)("option", t.value), {
274
+ }, { ref_for: !0 }, o(c)("option", t.value), {
259
275
  onClick: (p) => te(t),
260
276
  onMouseenter: (p) => he(i, t.disabled)
261
277
  }), [
262
- a.multiple ? (r(), U(De, {
278
+ a.multiple ? (n(), U(qe, {
263
279
  key: 0,
264
- checked: k(t.value),
280
+ checked: R(t.value),
265
281
  disabled: t.disabled,
266
- state: n.value === i ? "hover" : "default"
267
- }, null, 8, ["checked", "disabled", "state"])) : (r(), U(c(Ve), {
282
+ state: r.value === i ? "hover" : "default"
283
+ }, null, 8, ["checked", "disabled", "state"])) : (n(), U(o(Ve), {
268
284
  key: 1,
269
- checked: k(t.value),
285
+ checked: R(t.value),
270
286
  disabled: t.disabled,
271
- state: n.value === i ? "hover" : "default"
287
+ state: r.value === i ? "hover" : "default"
272
288
  }, null, 8, ["checked", "disabled", "state"])),
273
- N(e.$slots, "option", {
289
+ D(e.$slots, "option", {
274
290
  option: t,
275
- selected: k(t.value),
276
- active: n.value === i,
291
+ selected: R(t.value),
292
+ active: r.value === i,
277
293
  index: i
278
294
  }, () => [
279
- g("span", We, v(t.label), 1)
295
+ g("span", Ge, v(t.label), 1)
280
296
  ], !0)
281
- ], 16, Ge))), 128)),
282
- a.options.length ? R("", !0) : (r(), o("p", ze, [
283
- N(e.$slots, "empty", {}, () => [
284
- j(v(Ke))
297
+ ], 16, Oe))), 128)),
298
+ a.options.length ? y("", !0) : (n(), u("p", We, [
299
+ D(e.$slots, "empty", {}, () => [
300
+ N(v(Ke))
285
301
  ], !0)
286
302
  ]))
287
- ], 40, Oe)
303
+ ], 40, Fe)
288
304
  ]),
289
305
  _: 3
290
306
  }, 8, ["open", "width", "side", "side-offset", "align", "align-offset", "breakpoint-mobile", "test-id"]),
291
307
  g("div", {
292
308
  ref_key: "contentRef",
293
- ref: I,
309
+ ref: A,
294
310
  class: "select__content"
295
311
  }, [
296
- a.multiple && h.value.length ? (r(), o("span", {
312
+ a.multiple && h.value.length ? (n(), u("span", {
297
313
  key: 0,
298
314
  ref_key: "chipsRef",
299
315
  ref: J,
300
316
  class: "select__chips"
301
317
  }, [
302
- (r(!0), o(ie, null, ne(h.value, (t, i) => (r(), o("span", f({
318
+ (n(!0), u(ie, null, re(h.value, (t, i) => (n(), u("span", f({
303
319
  key: t.value,
304
320
  "data-chip": "item",
305
321
  class: ["select__chip", {
306
322
  "select__chip--measured": i >= m.value
307
323
  }],
308
324
  "aria-hidden": i >= m.value || void 0
309
- }, { ref_for: !0 }, c(d)("chip", t.value)), [
310
- N(e.$slots, "chip", {
325
+ }, { ref_for: !0 }, o(c)("chip", t.value)), [
326
+ D(e.$slots, "chip", {
311
327
  option: t,
312
328
  index: i
313
329
  }, () => [
314
- t.avatar ? (r(), o("img", {
330
+ t.avatar ? (n(), u("img", {
315
331
  key: 0,
316
332
  class: "select__chip-avatar",
317
333
  src: t.avatar,
318
334
  alt: ""
319
- }, null, 8, Xe)) : t.icon ? (r(), U(Me(t.icon), {
335
+ }, null, 8, Le)) : t.icon ? (n(), U(Ie(t.icon), {
320
336
  key: 1,
321
337
  class: "select__chip-icon",
322
338
  "aria-hidden": "true"
323
- })) : R("", !0),
324
- g("span", Ue, v(t.label), 1)
339
+ })) : y("", !0),
340
+ g("span", Xe, v(t.label), 1)
325
341
  ], !0),
326
342
  g("button", f({
327
343
  type: "button",
@@ -329,44 +345,44 @@ const Fe = ["disabled", "aria-labelledby", "aria-label", "aria-describedby"], Oe
329
345
  disabled: a.disabled,
330
346
  tabindex: i >= m.value ? -1 : void 0,
331
347
  "aria-label": `Убрать ${t.label}`
332
- }, { ref_for: !0 }, c(d)("chip-remove", t.value), {
333
- onClick: Se((p) => ge(t.value), ["stop"])
348
+ }, { ref_for: !0 }, o(c)("chip-remove", t.value), {
349
+ onClick: Ae((p) => ge(t.value), ["stop"])
334
350
  }), [
335
- V(c($e), {
351
+ q(o(Me), {
336
352
  class: "select__chip-icon",
337
353
  "aria-hidden": "true"
338
354
  })
339
- ], 16, je)
340
- ], 16, Le))), 128))
341
- ], 512)) : R("", !0),
342
- a.multiple && h.value.length ? (r(), o("span", f({
355
+ ], 16, Ue)
356
+ ], 16, ze))), 128))
357
+ ], 512)) : y("", !0),
358
+ a.multiple && h.value.length ? (n(), u("span", f({
343
359
  key: 1,
344
360
  ref_key: "counterRef",
345
361
  ref: Q,
346
- class: ["select__chip select__chip--counter", { "select__chip--measured": !S.value }],
347
- "aria-hidden": !S.value || void 0
348
- }, c(d)("chip-counter")), " +" + v(S.value || 1), 17, qe)) : M.value ? (r(), o("span", f({
362
+ class: ["select__chip select__chip--counter", { "select__chip--measured": !E.value }],
363
+ "aria-hidden": !E.value || void 0
364
+ }, o(c)("chip-counter")), " +" + v(E.value || 1), 17, je)) : M.value ? (n(), u("span", f({
349
365
  key: 2,
350
366
  class: "select__value"
351
- }, c(d)("value")), [
352
- N(e.$slots, "value", {
367
+ }, o(c)("value")), [
368
+ D(e.$slots, "value", {
353
369
  option: h.value[0],
354
370
  displayValue: M.value
355
371
  }, () => [
356
- j(v(M.value), 1)
372
+ N(v(M.value), 1)
357
373
  ], !0)
358
- ], 16)) : (r(), o("span", He, v(a.placeholder), 1))
374
+ ], 16)) : (n(), u("span", He, v(a.placeholder), 1))
359
375
  ], 512),
360
- V(c(Ee), {
376
+ q(o(Ee), {
361
377
  class: "select__arrow",
362
378
  "aria-hidden": "true"
363
379
  })
364
380
  ], 16),
365
- O.value ? (r(), o("p", f({
381
+ G.value ? (n(), u("p", f({
366
382
  key: 1,
367
383
  id: K,
368
384
  class: "select__message"
369
- }, c(d)("message")), v(O.value), 17)) : R("", !0)
385
+ }, o(c)("message")), v(G.value), 17)) : y("", !0)
370
386
  ], 16));
371
387
  }
372
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}