@profitliga/ui 2.0.4 → 2.0.6

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 (29) hide show
  1. package/dist/components/v2/AlertDialog/AlertDialog.css +1 -1
  2. package/dist/components/v2/AlertDialog/AlertDialog.vue.js +2 -2
  3. package/dist/components/v2/AlertDialog/AlertDialog.vue2.js +52 -51
  4. package/dist/components/v2/BottomSheet/BottomSheet.css +1 -1
  5. package/dist/components/v2/BottomSheet/BottomSheet.vue.js +2 -2
  6. package/dist/components/v2/BottomSheet/BottomSheet.vue2.js +31 -29
  7. package/dist/components/v2/Button/Button.css +1 -1
  8. package/dist/components/v2/Button/Button.vue.js +2 -2
  9. package/dist/components/v2/Combobox/Combobox.css +1 -1
  10. package/dist/components/v2/Combobox/Combobox.types.d.ts +10 -2
  11. package/dist/components/v2/Combobox/Combobox.vue.js +1 -1
  12. package/dist/components/v2/Combobox/Combobox.vue2.js +118 -120
  13. package/dist/components/v2/Dialog/Dialog.css +1 -1
  14. package/dist/components/v2/Dialog/Dialog.vue.js +1 -1
  15. package/dist/components/v2/Dialog/Dialog.vue2.js +74 -72
  16. package/dist/components/v2/Drawer/Drawer.css +1 -1
  17. package/dist/components/v2/Drawer/Drawer.vue.js +1 -1
  18. package/dist/components/v2/Drawer/Drawer.vue2.js +44 -42
  19. package/dist/components/v2/Popover/Popover.css +1 -1
  20. package/dist/components/v2/Popover/Popover.types.d.ts +13 -0
  21. package/dist/components/v2/Popover/Popover.vue.d.ts +1 -0
  22. package/dist/components/v2/Popover/Popover.vue.js +2 -2
  23. package/dist/components/v2/Popover/Popover.vue2.js +34 -33
  24. package/dist/components/v2/Schedule/Schedule.css +1 -1
  25. package/dist/components/v2/Schedule/Schedule.vue.js +3 -3
  26. package/dist/components/v2/Schedule/Schedule.vue2.js +5 -4
  27. package/dist/components/v2/shared/useLayerZIndex.util.d.ts +10 -0
  28. package/dist/components/v2/shared/useLayerZIndex.util.js +25 -13
  29. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
- import { defineComponent as G, useModel as J, useId as Q, computed as g, useSlots as W, useTemplateRef as M, watch as Y, onBeforeUnmount as x, unref as t, openBlock as o, createBlock as p, createSlots as ee, withCtx as y, createElementVNode as v, createElementBlock as a, mergeProps as s, renderSlot as r, createCommentVNode as n, toDisplayString as R, normalizeProps as te, guardReactiveProps as oe, Fragment as ie, normalizeStyle as le, normalizeClass as se, resolveDynamicComponent as T, createTextVNode as ae, createVNode as ne, mergeModels as N } from "vue";
1
+ import { defineComponent as G, useModel as J, useId as Q, computed as g, useSlots as W, useTemplateRef as M, watch as Y, onBeforeUnmount as x, unref as t, openBlock as o, createBlock as b, createSlots as ee, withCtx as y, createElementVNode as v, createElementBlock as n, mergeProps as l, renderSlot as r, createCommentVNode as a, toDisplayString as R, normalizeProps as te, guardReactiveProps as oe, Fragment as ie, normalizeStyle as se, normalizeClass as le, resolveDynamicComponent as T, createTextVNode as ne, createVNode as ae, mergeModels as A } from "vue";
2
2
  import { X as de } from "@lucide/vue";
3
3
  import { breakpoints as re } from "../../../utils/breakpoints.util.js";
4
4
  import { onClickOutside as ue } from "../../../utils/onClickOutside.util.js";
5
5
  import { useBodyScroll as ce } from "../../../utils/useBodyScroll.util.js";
6
6
  import { useFocusTrap as ve } from "../../../utils/useFocusTrap.util.js";
7
7
  import me from "../BottomSheet/BottomSheet.vue.js";
8
- import { ANIMATION_DURATION_MS as A } from "../shared/animation.const.js";
8
+ import { ANIMATION_DURATION_MS as N } from "../shared/animation.const.js";
9
9
  import fe from "../shared/Portal.vue.js";
10
10
  import { useDelayedVisibility as ge } from "../shared/useDelayedVisibility.util.js";
11
11
  import { useLayerZIndex as ye } from "../shared/useLayerZIndex.util.js";
@@ -18,13 +18,13 @@ const $e = { class: "dialog-mobile" }, he = {
18
18
  }, we = {
19
19
  key: 1,
20
20
  class: "dialog-mobile__divider"
21
- }, Ie = ["data-state"], Oe = ["aria-describedby", "data-state"], De = { class: "dialog-content__heading" }, Be = ["aria-label"], Se = {
21
+ }, Ie = ["data-state"], Oe = ["aria-describedby", "data-state"], De = { class: "dialog-content__heading" }, Be = ["aria-label"], Ee = {
22
22
  key: 0,
23
23
  class: "dialog-content__divider"
24
24
  }, Fe = /* @__PURE__ */ G({
25
25
  inheritAttrs: !1,
26
26
  __name: "Dialog",
27
- props: /* @__PURE__ */ N({
27
+ props: /* @__PURE__ */ A({
28
28
  title: { default: void 0 },
29
29
  closeButton: { default: () => ({ enabled: !0 }) },
30
30
  width: { default: 500 },
@@ -37,52 +37,54 @@ const $e = { class: "dialog-mobile" }, he = {
37
37
  open: { type: Boolean, default: !1 },
38
38
  openModifiers: {}
39
39
  }),
40
- emits: /* @__PURE__ */ N(["escapeKeyDown", "pointerDownOutside"], ["update:open"]),
40
+ emits: /* @__PURE__ */ A(["escapeKeyDown", "pointerDownOutside"], ["update:open"]),
41
41
  setup(i, { emit: V }) {
42
- const m = i, b = V, u = J(i, "open"), S = re.smaller(m.breakpointMobile), k = Q(), f = `dialog-title-${k}`, $ = `dialog-content-${k}`, z = `dialog-body-${k}`, l = pe(() => m.testId), K = g(() => ({
42
+ const m = i, k = V, u = J(i, "open"), E = re.smaller(m.breakpointMobile), $ = Q(), f = `dialog-title-${$}`, h = `dialog-content-${$}`, S = `dialog-body-${$}`, s = pe(() => m.testId), K = g(() => ({
43
43
  "aria-haspopup": "dialog",
44
44
  "aria-expanded": u.value,
45
- "aria-controls": u.value ? $ : void 0
46
- })), E = g(() => m.title?.as ?? "h2"), L = g(() => `${m.width}px`), U = W(), h = g(() => m.divider ?? !!U.icon), C = M("triggerRef"), w = M("contentRef");
45
+ "aria-controls": u.value ? h : void 0
46
+ })), z = g(() => m.title?.as ?? "h2"), L = g(() => `${m.width}px`), U = W(), w = g(() => m.divider ?? !!U.icon), C = M("triggerRef"), I = M("contentRef");
47
47
  be({
48
48
  host: () => C.value,
49
49
  isOpen: () => u.value,
50
- contentId: () => $,
50
+ contentId: () => h,
51
51
  hasPopup: () => "dialog"
52
52
  });
53
- const { lockScroll: F, unlockScroll: Z } = ce(), I = ve(() => w.value), O = ye(), q = g(
54
- () => m.zIndex === "auto" ? O.zIndex.value : m.zIndex
53
+ const { lockScroll: F, unlockScroll: Z } = ce(), O = ve(() => I.value), p = ye(), q = g(
54
+ () => m.zIndex === "auto" ? p.zIndex.value : m.zIndex
55
55
  );
56
56
  function P() {
57
57
  u.value = !1;
58
58
  }
59
59
  function D(e) {
60
- e.key === "Escape" && (b("escapeKeyDown", e), e.defaultPrevented || P());
60
+ e.key === "Escape" && (k("escapeKeyDown", e), e.defaultPrevented || P());
61
61
  }
62
62
  function H(e) {
63
- b("pointerDownOutside", e), !m.disableOutsidePointerEvents && !e.defaultPrevented && P();
63
+ k("pointerDownOutside", e), !m.disableOutsidePointerEvents && !e.defaultPrevented && P();
64
64
  }
65
- const X = g(() => u.value && !S.value), { visible: j, dataState: _ } = ge(
65
+ const X = g(() => u.value && !E.value), { visible: j, dataState: _ } = ge(
66
66
  X,
67
- A,
67
+ N,
68
68
  {
69
69
  onOpen: () => {
70
- O.acquire(), F(), I.activate({ focusDelayMs: A }), document.addEventListener("keydown", D);
70
+ p.acquire(), F(), O.activate({ focusDelayMs: N }), document.addEventListener("keydown", D);
71
71
  },
72
72
  onCloseStart: () => {
73
- I.deactivate(), document.removeEventListener("keydown", D);
73
+ O.deactivate(), document.removeEventListener("keydown", D);
74
74
  },
75
75
  onCloseEnd: () => {
76
- Z(), O.release();
76
+ Z(), p.release();
77
77
  }
78
78
  }
79
79
  );
80
80
  let B;
81
- return Y(w, (e) => {
82
- B?.(), B = e ? ue(e, H) : void 0;
81
+ return Y(I, (e) => {
82
+ p.registerElement(e), B?.(), B = e ? ue(e, H, {
83
+ ignore: () => p.elementsAbove()
84
+ }) : void 0;
83
85
  }), x(() => {
84
- B?.(), document.removeEventListener("keydown", D), I.deactivate();
85
- }), (e, d) => t(S) ? (o(), p(t(me), {
86
+ B?.(), document.removeEventListener("keydown", D), O.deactivate();
87
+ }), (e, d) => t(E) ? (o(), b(t(me), {
86
88
  key: 0,
87
89
  open: u.value,
88
90
  "onUpdate:open": d[0] || (d[0] = (c) => u.value = c),
@@ -90,35 +92,35 @@ const $e = { class: "dialog-mobile" }, he = {
90
92
  "disable-outside-pointer-events": i.disableOutsidePointerEvents,
91
93
  "labelled-by": i.title?.text && !e.$slots.title ? f : void 0,
92
94
  "test-id": i.testId,
93
- onEscapeKeyDown: d[1] || (d[1] = (c) => b("escapeKeyDown", c)),
94
- onPointerDownOutside: d[2] || (d[2] = (c) => b("pointerDownOutside", c))
95
+ onEscapeKeyDown: d[1] || (d[1] = (c) => k("escapeKeyDown", c)),
96
+ onPointerDownOutside: d[2] || (d[2] = (c) => k("pointerDownOutside", c))
95
97
  }, ee({
96
98
  default: y(() => [
97
99
  v("div", $e, [
98
- e.$slots.icon || i.title?.text && !e.$slots.title ? (o(), a("div", he, [
99
- e.$slots.icon ? (o(), a("span", s({
100
+ e.$slots.icon || i.title?.text && !e.$slots.title ? (o(), n("div", he, [
101
+ e.$slots.icon ? (o(), n("span", l({
100
102
  key: 0,
101
103
  class: "dialog-mobile__icon"
102
- }, t(l)("icon")), [
104
+ }, t(s)("icon")), [
103
105
  r(e.$slots, "icon", {}, void 0, !0)
104
- ], 16)) : n("", !0),
105
- i.title?.text && !e.$slots.title ? (o(), a("div", s({
106
+ ], 16)) : a("", !0),
107
+ i.title?.text && !e.$slots.title ? (o(), n("div", l({
106
108
  key: 1,
107
109
  id: f,
108
110
  class: "dialog-mobile__title"
109
- }, t(l)("title")), R(i.title.text), 17)) : n("", !0)
110
- ])) : n("", !0),
111
- h.value ? (o(), a("div", we)) : n("", !0),
112
- v("div", s({ class: "dialog-mobile__content" }, t(l)("body")), [
111
+ }, t(s)("title")), R(i.title.text), 17)) : a("", !0)
112
+ ])) : a("", !0),
113
+ w.value ? (o(), n("div", we)) : a("", !0),
114
+ v("div", l({ class: "dialog-mobile__content" }, t(s)("body")), [
113
115
  r(e.$slots, "title", {}, void 0, !0),
114
116
  r(e.$slots, "default", {}, void 0, !0)
115
117
  ], 16),
116
- e.$slots.actions ? (o(), a("div", s({
118
+ e.$slots.actions ? (o(), n("div", l({
117
119
  key: 2,
118
120
  class: "dialog-mobile__actions"
119
- }, t(l)("actions")), [
121
+ }, t(s)("actions")), [
120
122
  r(e.$slots, "actions", {}, void 0, !0)
121
- ], 16)) : n("", !0)
123
+ ], 16)) : a("", !0)
122
124
  ])
123
125
  ]),
124
126
  _: 2
@@ -130,109 +132,109 @@ const $e = { class: "dialog-mobile" }, he = {
130
132
  ]),
131
133
  key: "0"
132
134
  } : void 0
133
- ]), 1032, ["open", "z-index", "disable-outside-pointer-events", "labelled-by", "test-id"])) : (o(), a(ie, { key: 1 }, [
134
- e.$slots.trigger ? (o(), a("span", s({
135
+ ]), 1032, ["open", "z-index", "disable-outside-pointer-events", "labelled-by", "test-id"])) : (o(), n(ie, { key: 1 }, [
136
+ e.$slots.trigger ? (o(), n("span", l({
135
137
  key: 0,
136
138
  ref_key: "triggerRef",
137
139
  ref: C,
138
140
  class: "dialog-trigger"
139
- }, t(l)("trigger"), {
141
+ }, t(s)("trigger"), {
140
142
  onClick: d[3] || (d[3] = (c) => u.value = !0)
141
143
  }), [
142
144
  r(e.$slots, "trigger", { props: K.value }, void 0, !0)
143
- ], 16)) : n("", !0),
144
- t(j) ? (o(), p(fe, { key: 1 }, {
145
+ ], 16)) : a("", !0),
146
+ t(j) ? (o(), b(fe, { key: 1 }, {
145
147
  default: y(() => [
146
148
  v("div", {
147
149
  class: "dialog-layer",
148
- style: le({ zIndex: q.value })
150
+ style: se({ zIndex: q.value })
149
151
  }, [
150
- v("div", s({
152
+ v("div", l({
151
153
  class: "overlay dialog-overlay",
152
154
  "data-state": t(_)
153
- }, t(l)("overlay")), null, 16, Ie),
154
- v("div", s({
155
- id: $,
155
+ }, t(s)("overlay")), null, 16, Ie),
156
+ v("div", l({
157
+ id: h,
156
158
  ref_key: "contentRef",
157
- ref: w,
159
+ ref: I,
158
160
  role: "dialog",
159
161
  "aria-modal": "true",
160
162
  "aria-labelledby": f,
161
- "aria-describedby": e.$slots.default ? z : void 0,
163
+ "aria-describedby": e.$slots.default ? S : void 0,
162
164
  "data-state": t(_),
163
165
  class: "dialog-content",
164
166
  style: { width: L.value }
165
- }, { ...e.$attrs, ...t(l)("content") }), [
167
+ }, { ...e.$attrs, ...t(s)("content") }), [
166
168
  v("div", {
167
- class: se(["dialog-content__header", {
168
- "dialog-content__header--divided": h.value
169
+ class: le(["dialog-content__header", {
170
+ "dialog-content__header--divided": w.value
169
171
  }])
170
172
  }, [
171
173
  v("div", De, [
172
- e.$slots.icon ? (o(), a("span", s({
174
+ e.$slots.icon ? (o(), n("span", l({
173
175
  key: 0,
174
176
  class: "dialog-content__icon"
175
- }, t(l)("icon")), [
177
+ }, t(s)("icon")), [
176
178
  r(e.$slots, "icon", {}, void 0, !0)
177
- ], 16)) : n("", !0),
178
- i.title?.text ? (o(), p(T(E.value), s({
179
+ ], 16)) : a("", !0),
180
+ i.title?.text ? (o(), b(T(z.value), l({
179
181
  key: 1,
180
182
  id: f,
181
183
  class: ["dialog-content__title", {
182
184
  "dialog-content__title--with-icon": e.$slots.icon
183
185
  }]
184
- }, t(l)("title")), {
186
+ }, t(s)("title")), {
185
187
  default: y(() => [
186
- ae(R(i.title.text), 1)
188
+ ne(R(i.title.text), 1)
187
189
  ]),
188
190
  _: 1
189
- }, 16, ["class"])) : e.$slots.title ? (o(), p(T(E.value), s({
191
+ }, 16, ["class"])) : e.$slots.title ? (o(), b(T(z.value), l({
190
192
  key: 2,
191
193
  id: f,
192
194
  class: ["dialog-content__title", {
193
195
  "dialog-content__title--with-icon": e.$slots.icon
194
196
  }]
195
- }, t(l)("title")), {
197
+ }, t(s)("title")), {
196
198
  default: y(() => [
197
199
  r(e.$slots, "title", {}, void 0, !0)
198
200
  ]),
199
201
  _: 3
200
- }, 16, ["class"])) : (o(), p(ke, { key: 3 }, {
202
+ }, 16, ["class"])) : (o(), b(ke, { key: 3 }, {
201
203
  default: y(() => [
202
204
  v("h2", { id: f }, "Диалоговое окно")
203
205
  ]),
204
206
  _: 1
205
207
  }))
206
208
  ]),
207
- i.closeButton?.enabled ? (o(), a("button", s({
209
+ i.closeButton?.enabled ? (o(), n("button", l({
208
210
  key: 0,
209
211
  type: "button",
210
212
  class: "dialog-content__close",
211
213
  "aria-label": i.closeButton.label ?? "Закрыть"
212
- }, t(l)("close"), {
214
+ }, t(s)("close"), {
213
215
  onClick: d[4] || (d[4] = (c) => u.value = !1)
214
216
  }), [
215
- ne(t(de), { size: 20 })
216
- ], 16, Be)) : n("", !0)
217
+ ae(t(de), { size: 20 })
218
+ ], 16, Be)) : a("", !0)
217
219
  ], 2),
218
- h.value ? (o(), a("div", Se)) : n("", !0),
219
- v("div", s({
220
- id: z,
220
+ w.value ? (o(), n("div", Ee)) : a("", !0),
221
+ v("div", l({
222
+ id: S,
221
223
  class: "dialog-content__wrapper"
222
- }, t(l)("body")), [
224
+ }, t(s)("body")), [
223
225
  r(e.$slots, "default", {}, void 0, !0)
224
226
  ], 16),
225
- e.$slots.actions ? (o(), a("div", s({
227
+ e.$slots.actions ? (o(), n("div", l({
226
228
  key: 1,
227
229
  class: "dialog-content__actions"
228
- }, t(l)("actions")), [
230
+ }, t(s)("actions")), [
229
231
  r(e.$slots, "actions", {}, void 0, !0)
230
- ], 16)) : n("", !0)
232
+ ], 16)) : a("", !0)
231
233
  ], 16, Oe)
232
234
  ], 4)
233
235
  ]),
234
236
  _: 3
235
- })) : n("", !0)
237
+ })) : a("", !0)
236
238
  ], 64));
237
239
  }
238
240
  });
@@ -1 +1 @@
1
- .drawer-trigger[data-v-fa82d1f1]{display:contents}.drawer-layer[data-v-fa82d1f1]{position:relative}.drawer-content[data-v-fa82d1f1]{box-sizing:border-box;background-color:var(--theme-neutral-0);z-index:1002;flex-direction:column;padding:24px;display:flex;position:fixed;box-shadow:0 2px 5px #3a3a3a40}.drawer-content--left[data-v-fa82d1f1]{border-radius:0 12px 12px 0;max-width:90vw;height:100%;top:0;bottom:0;left:0}.drawer-content--left[data-state=open][data-v-fa82d1f1]{animation:slideLeftIn var(--animation-duration) ease-in-out}.drawer-content--left[data-state=closed][data-v-fa82d1f1]{animation:slideLeftOut var(--animation-duration) ease-in-out}.drawer-content--right[data-v-fa82d1f1]{border-radius:12px 0 0 12px;max-width:90vw;height:100%;top:0;bottom:0;right:0}.drawer-content--right[data-state=open][data-v-fa82d1f1]{animation:slideRightIn var(--animation-duration) ease-in-out}.drawer-content--right[data-state=closed][data-v-fa82d1f1]{animation:slideRightOut var(--animation-duration) ease-in-out}.drawer-content--top[data-v-fa82d1f1]{border-radius:0 0 12px 12px;width:100%;max-height:90dvh;top:0;left:0;right:0}.drawer-content--top[data-state=open][data-v-fa82d1f1]{animation:slideTopIn var(--animation-duration) ease-in-out}.drawer-content--top[data-state=closed][data-v-fa82d1f1]{animation:slideTopOut var(--animation-duration) ease-in-out}.drawer-content--bottom[data-v-fa82d1f1]{border-radius:12px 12px 0 0;width:100%;max-height:90dvh;bottom:0;left:0;right:0}.drawer-content--bottom[data-state=open][data-v-fa82d1f1]{animation:slideBottomIn var(--animation-duration) ease-in-out}.drawer-content--bottom[data-state=closed][data-v-fa82d1f1]{animation:slideBottomOut var(--animation-duration) ease-in-out}.drawer-content__header[data-v-fa82d1f1]{flex:none;justify-content:space-between;align-items:flex-start;gap:12px;width:100%;margin-bottom:16px;display:flex}.drawer-content__title[data-v-fa82d1f1]{flex:1 1 0;min-width:0;font-weight:500}.drawer-content__close[data-v-fa82d1f1]{background:0 0;border:none;justify-content:center;align-items:center;width:20px;min-width:20px;height:20px;margin-left:auto;padding:0;display:flex}.drawer-content__close[data-v-fa82d1f1]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.drawer-content__close svg[data-v-fa82d1f1]{width:20px;height:20px;color:var(--color-secondary-400);transition:color .3s ease-in-out}.drawer-content__close[data-v-fa82d1f1]:hover{cursor:pointer}.drawer-content__close:hover svg[data-v-fa82d1f1]{color:var(--color-secondary-500);transition:color .3s ease-in-out}.drawer-content__divider[data-v-fa82d1f1]{background-color:var(--theme-secondary-250);flex:none;width:100%;height:1px;margin-top:-4px;margin-bottom:12px}.drawer-content__wrapper[data-v-fa82d1f1]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);flex-direction:column;flex:1 1 0;justify-content:flex-start;align-items:flex-start;gap:12px;width:100%;min-height:0;display:flex;overflow-y:auto}.drawer-content__wrapper[data-v-fa82d1f1]::-webkit-scrollbar{width:8px;height:0}.drawer-content__wrapper[data-v-fa82d1f1]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.drawer-content__wrapper[data-v-fa82d1f1]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.drawer-content__wrapper[data-v-fa82d1f1]::-webkit-scrollbar-corner{background:0 0}.drawer-content__actions[data-v-fa82d1f1]{flex:none;justify-content:flex-end;align-items:center;gap:8px;width:100%;margin-top:32px;display:flex}.drawer-mobile[data-v-fa82d1f1]{flex-direction:column;gap:16px;width:100%;display:flex}.drawer-mobile__title[data-v-fa82d1f1]{color:var(--theme-neutral-text-title);font-size:1.125rem;font-weight:500;line-height:1.5}.drawer-mobile__divider[data-v-fa82d1f1]{background-color:var(--theme-secondary-250);width:100%;height:1px;margin-top:-4px}.drawer-mobile__content[data-v-fa82d1f1]{flex-direction:column;gap:12px;display:flex}.drawer-mobile__actions[data-v-fa82d1f1]{flex-direction:column-reverse;gap:8px;width:100%;display:flex}.drawer-mobile__actions[data-v-fa82d1f1] button{width:100%}
1
+ .drawer-trigger[data-v-4d3b35ae]{display:contents}.drawer-layer[data-v-4d3b35ae]{position:relative}.drawer-content[data-v-4d3b35ae]{box-sizing:border-box;background-color:var(--theme-neutral-0);z-index:1002;flex-direction:column;padding:24px;display:flex;position:fixed;box-shadow:0 2px 5px #3a3a3a40}.drawer-content--left[data-v-4d3b35ae]{border-radius:0 12px 12px 0;max-width:90vw;height:100%;top:0;bottom:0;left:0}.drawer-content--left[data-state=open][data-v-4d3b35ae]{animation:slideLeftIn var(--animation-duration) ease-in-out}.drawer-content--left[data-state=closed][data-v-4d3b35ae]{animation:slideLeftOut var(--animation-duration) ease-in-out}.drawer-content--right[data-v-4d3b35ae]{border-radius:12px 0 0 12px;max-width:90vw;height:100%;top:0;bottom:0;right:0}.drawer-content--right[data-state=open][data-v-4d3b35ae]{animation:slideRightIn var(--animation-duration) ease-in-out}.drawer-content--right[data-state=closed][data-v-4d3b35ae]{animation:slideRightOut var(--animation-duration) ease-in-out}.drawer-content--top[data-v-4d3b35ae]{border-radius:0 0 12px 12px;width:100%;max-height:90dvh;top:0;left:0;right:0}.drawer-content--top[data-state=open][data-v-4d3b35ae]{animation:slideTopIn var(--animation-duration) ease-in-out}.drawer-content--top[data-state=closed][data-v-4d3b35ae]{animation:slideTopOut var(--animation-duration) ease-in-out}.drawer-content--bottom[data-v-4d3b35ae]{border-radius:12px 12px 0 0;width:100%;max-height:90dvh;bottom:0;left:0;right:0}.drawer-content--bottom[data-state=open][data-v-4d3b35ae]{animation:slideBottomIn var(--animation-duration) ease-in-out}.drawer-content--bottom[data-state=closed][data-v-4d3b35ae]{animation:slideBottomOut var(--animation-duration) ease-in-out}.drawer-content__header[data-v-4d3b35ae]{flex:none;justify-content:space-between;align-items:flex-start;gap:12px;width:100%;margin-bottom:16px;display:flex}.drawer-content__title[data-v-4d3b35ae]{flex:1 1 0;min-width:0;font-weight:500}.drawer-content__close[data-v-4d3b35ae]{background:0 0;border:none;justify-content:center;align-items:center;width:20px;min-width:20px;height:20px;margin-left:auto;padding:0;display:flex}.drawer-content__close[data-v-4d3b35ae]:focus-visible{outline:2px solid var(--theme-primary-500);outline-offset:2px}.drawer-content__close svg[data-v-4d3b35ae]{width:20px;height:20px;color:var(--color-secondary-400);transition:color .3s ease-in-out}.drawer-content__close[data-v-4d3b35ae]:hover{cursor:pointer}.drawer-content__close:hover svg[data-v-4d3b35ae]{color:var(--color-secondary-500);transition:color .3s ease-in-out}.drawer-content__divider[data-v-4d3b35ae]{background-color:var(--theme-secondary-250);flex:none;width:100%;height:1px;margin-top:-4px;margin-bottom:12px}.drawer-content__wrapper[data-v-4d3b35ae]{box-sizing:content-box;scrollbar-width:thin;scrollbar-color:var(--theme-neutral-icon-primary) var(--theme-neutral-surface-icon);flex-direction:column;flex:1 1 0;justify-content:flex-start;align-items:flex-start;gap:12px;width:100%;min-height:0;display:flex;overflow-y:auto}.drawer-content__wrapper[data-v-4d3b35ae]::-webkit-scrollbar{width:8px;height:0}.drawer-content__wrapper[data-v-4d3b35ae]::-webkit-scrollbar-thumb{background-color:var(--theme-neutral-icon-primary);background-clip:padding-box;border:1px solid #0000;border-radius:999px}.drawer-content__wrapper[data-v-4d3b35ae]::-webkit-scrollbar-track{background:var(--theme-neutral-surface-icon);border-radius:4px}.drawer-content__wrapper[data-v-4d3b35ae]::-webkit-scrollbar-corner{background:0 0}.drawer-content__actions[data-v-4d3b35ae]{flex:none;justify-content:flex-end;align-items:center;gap:8px;width:100%;margin-top:32px;display:flex}.drawer-mobile[data-v-4d3b35ae]{flex-direction:column;gap:16px;width:100%;display:flex}.drawer-mobile__title[data-v-4d3b35ae]{color:var(--theme-neutral-text-title);font-size:1.125rem;font-weight:500;line-height:1.5}.drawer-mobile__divider[data-v-4d3b35ae]{background-color:var(--theme-secondary-250);width:100%;height:1px;margin-top:-4px}.drawer-mobile__content[data-v-4d3b35ae]{flex-direction:column;gap:12px;display:flex}.drawer-mobile__actions[data-v-4d3b35ae]{flex-direction:column-reverse;gap:8px;width:100%;display:flex}.drawer-mobile__actions[data-v-4d3b35ae] button{width:100%}
@@ -2,7 +2,7 @@ import './Drawer.css';
2
2
  import o from "./Drawer.vue2.js";
3
3
  /* empty css */
4
4
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
5
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fa82d1f1"]]);
5
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-4d3b35ae"]]);
6
6
  export {
7
7
  m as default
8
8
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as W, useModel as Y, useId as _, computed as b, useTemplateRef as T, ref as ee, watch as te, onBeforeUnmount as oe, unref as t, openBlock as s, createBlock as w, createSlots as ie, withCtx as m, createElementVNode as d, createElementBlock as u, mergeProps as n, toDisplayString as N, createCommentVNode as c, renderSlot as f, normalizeProps as se, guardReactiveProps as ae, Fragment as ne, normalizeStyle as re, resolveDynamicComponent as x, createTextVNode as le, createVNode as de, mergeModels as A } from "vue";
1
+ import { defineComponent as W, useModel as Y, useId as _, computed as g, useTemplateRef as T, ref as ee, watch as te, onBeforeUnmount as oe, unref as t, openBlock as s, createBlock as w, createSlots as ie, withCtx as m, createElementVNode as d, createElementBlock as u, mergeProps as n, toDisplayString as A, createCommentVNode as c, renderSlot as f, normalizeProps as se, guardReactiveProps as ae, Fragment as ne, normalizeStyle as re, resolveDynamicComponent as N, createTextVNode as le, createVNode as de, mergeModels as x } from "vue";
2
2
  import { X as ue } from "@lucide/vue";
3
3
  import { breakpoints as ce } from "../../../utils/breakpoints.util.js";
4
4
  import { onClickOutside as fe } from "../../../utils/onClickOutside.util.js";
@@ -8,20 +8,20 @@ import pe from "../BottomSheet/BottomSheet.vue.js";
8
8
  import { ANIMATION_DURATION_MS as K } from "../shared/animation.const.js";
9
9
  import ye from "../shared/Portal.vue.js";
10
10
  import { useDelayedVisibility as be } from "../shared/useDelayedVisibility.util.js";
11
- import { useLayerZIndex as we } from "../shared/useLayerZIndex.util.js";
12
- import { useTestId as ge } from "../shared/useTestId.util.js";
11
+ import { useLayerZIndex as ge } from "../shared/useLayerZIndex.util.js";
12
+ import { useTestId as we } from "../shared/useTestId.util.js";
13
13
  import { useTriggerAria as ke } from "../shared/useTriggerAria.util.js";
14
14
  import he from "../shared/VisuallyHidden.vue.js";
15
15
  const $e = { class: "drawer-mobile" }, Ie = {
16
16
  key: 1,
17
17
  class: "drawer-mobile__divider"
18
- }, Ce = ["data-state"], Oe = ["aria-describedby", "data-state"], Pe = { class: "drawer-content__header" }, De = ["aria-label"], Se = {
18
+ }, Ce = ["data-state"], Oe = ["aria-describedby", "data-state"], Pe = { class: "drawer-content__header" }, De = ["aria-label"], Ee = {
19
19
  key: 0,
20
20
  class: "drawer-content__divider"
21
21
  }, Ue = /* @__PURE__ */ W({
22
22
  inheritAttrs: !1,
23
23
  __name: "Drawer",
24
- props: /* @__PURE__ */ A({
24
+ props: /* @__PURE__ */ x({
25
25
  position: { default: "right" },
26
26
  title: { default: void 0 },
27
27
  closeButton: { default: () => ({ enabled: !0 }) },
@@ -37,25 +37,25 @@ const $e = { class: "drawer-mobile" }, Ie = {
37
37
  open: { type: Boolean, default: !1 },
38
38
  openModifiers: {}
39
39
  }),
40
- emits: /* @__PURE__ */ A(["escapeKeyDown", "pointerDownOutside"], ["update:open"]),
40
+ emits: /* @__PURE__ */ x(["escapeKeyDown", "pointerDownOutside"], ["update:open"]),
41
41
  setup(o, { expose: V, emit: q }) {
42
- const i = o, g = q, r = Y(o, "open"), S = ce.smaller(i.breakpointMobile), k = _(), v = `drawer-title-${k}`, h = `drawer-content-${k}`, B = `drawer-body-${k}`, a = ge(() => i.testId), L = b(() => ({
42
+ const i = o, k = q, r = Y(o, "open"), E = ce.smaller(i.breakpointMobile), h = _(), v = `drawer-title-${h}`, $ = `drawer-content-${h}`, S = `drawer-body-${h}`, a = we(() => i.testId), L = g(() => ({
43
43
  "aria-haspopup": "dialog",
44
44
  "aria-expanded": r.value,
45
- "aria-controls": r.value ? h : void 0
46
- })), E = b(() => i.title?.as ?? "h2"), F = b(
45
+ "aria-controls": r.value ? $ : void 0
46
+ })), B = g(() => i.title?.as ?? "h2"), F = g(
47
47
  () => i.position === "left" || i.position === "right" ? { width: `${i.width}px` } : { height: `${i.height}px` }
48
- ), z = T("triggerRef"), $ = T("contentRef");
48
+ ), z = T("triggerRef"), I = T("contentRef");
49
49
  ke({
50
50
  host: () => z.value,
51
51
  isOpen: () => r.value,
52
- contentId: () => h,
52
+ contentId: () => $,
53
53
  hasPopup: () => "dialog"
54
54
  });
55
- const { lockScroll: U, unlockScroll: Z } = ve(), I = me(() => $.value), C = we(), H = b(
56
- () => i.zIndex === "auto" ? C.zIndex.value : i.zIndex
55
+ const { lockScroll: U, unlockScroll: Z } = ve(), C = me(() => I.value), p = ge(), H = g(
56
+ () => i.zIndex === "auto" ? p.zIndex.value : i.zIndex
57
57
  ), O = ee(!1);
58
- async function p(e) {
58
+ async function y(e) {
59
59
  if (!i.beforeClose) {
60
60
  r.value = !1;
61
61
  return;
@@ -70,46 +70,48 @@ const $e = { class: "drawer-mobile" }, Ie = {
70
70
  }
71
71
  }
72
72
  function P(e) {
73
- e.key === "Escape" && (g("escapeKeyDown", e), e.defaultPrevented || p("escapeKey"));
73
+ e.key === "Escape" && (k("escapeKeyDown", e), e.defaultPrevented || y("escapeKey"));
74
74
  }
75
75
  function X(e) {
76
- g("pointerDownOutside", e), !i.disableOutsidePointerEvents && !e.defaultPrevented && p("outsidePointer");
76
+ k("pointerDownOutside", e), !i.disableOutsidePointerEvents && !e.defaultPrevented && y("outsidePointer");
77
77
  }
78
78
  function R(e, l) {
79
- e.defaultPrevented || !i.beforeClose || (e.preventDefault(), p(l));
79
+ e.defaultPrevented || !i.beforeClose || (e.preventDefault(), y(l));
80
80
  }
81
81
  function j(e) {
82
- g("escapeKeyDown", e), R(e, "escapeKey");
82
+ k("escapeKeyDown", e), R(e, "escapeKey");
83
83
  }
84
84
  function G(e) {
85
- g("pointerDownOutside", e), !i.disableOutsidePointerEvents && R(e, "outsidePointer");
85
+ k("pointerDownOutside", e), !i.disableOutsidePointerEvents && R(e, "outsidePointer");
86
86
  }
87
- const J = b(() => r.value && !S.value), { visible: Q, dataState: M } = be(
87
+ const J = g(() => r.value && !E.value), { visible: Q, dataState: M } = be(
88
88
  J,
89
89
  K,
90
90
  {
91
91
  onOpen: () => {
92
- C.acquire(), U(), I.activate({ focusDelayMs: K }), document.addEventListener("keydown", P);
92
+ p.acquire(), U(), C.activate({ focusDelayMs: K }), document.addEventListener("keydown", P);
93
93
  },
94
94
  onCloseStart: () => {
95
- I.deactivate(), document.removeEventListener("keydown", P);
95
+ C.deactivate(), document.removeEventListener("keydown", P);
96
96
  },
97
97
  onCloseEnd: () => {
98
- Z(), C.release();
98
+ Z(), p.release();
99
99
  }
100
100
  }
101
101
  );
102
102
  let D;
103
- return te($, (e) => {
104
- D?.(), D = e ? fe(e, X) : void 0;
103
+ return te(I, (e) => {
104
+ p.registerElement(e), D?.(), D = e ? fe(e, X, {
105
+ ignore: () => p.elementsAbove()
106
+ }) : void 0;
105
107
  }), oe(() => {
106
- D?.(), document.removeEventListener("keydown", P), I.deactivate();
108
+ D?.(), document.removeEventListener("keydown", P), C.deactivate();
107
109
  }), V({
108
- requestClose: (e = "programmatic") => p(e)
109
- }), (e, l) => t(S) ? (s(), w(t(pe), {
110
+ requestClose: (e = "programmatic") => y(e)
111
+ }), (e, l) => t(E) ? (s(), w(t(pe), {
110
112
  key: 0,
111
113
  open: r.value,
112
- "onUpdate:open": l[0] || (l[0] = (y) => r.value = y),
114
+ "onUpdate:open": l[0] || (l[0] = (b) => r.value = b),
113
115
  "z-index": o.zIndex,
114
116
  "disable-outside-pointer-events": o.disableOutsidePointerEvents,
115
117
  "disable-swipe-to-close": !!o.beforeClose,
@@ -124,7 +126,7 @@ const $e = { class: "drawer-mobile" }, Ie = {
124
126
  key: 0,
125
127
  id: v,
126
128
  class: "drawer-mobile__title"
127
- }, t(a)("title")), N(o.title.text), 17)) : c("", !0),
129
+ }, t(a)("title")), A(o.title.text), 17)) : c("", !0),
128
130
  o.divider ? (s(), u("div", Ie)) : c("", !0),
129
131
  d("div", n({ class: "drawer-mobile__content" }, t(a)("body")), [
130
132
  f(e.$slots, "title", {}, void 0, !0),
@@ -142,8 +144,8 @@ const $e = { class: "drawer-mobile" }, Ie = {
142
144
  }, [
143
145
  e.$slots.trigger ? {
144
146
  name: "trigger",
145
- fn: m((y) => [
146
- f(e.$slots, "trigger", se(ae(y)), void 0, !0)
147
+ fn: m((b) => [
148
+ f(e.$slots, "trigger", se(ae(b)), void 0, !0)
147
149
  ]),
148
150
  key: "0"
149
151
  } : void 0
@@ -154,7 +156,7 @@ const $e = { class: "drawer-mobile" }, Ie = {
154
156
  ref: z,
155
157
  class: "drawer-trigger"
156
158
  }, t(a)("trigger"), {
157
- onClick: l[1] || (l[1] = (y) => r.value = !0)
159
+ onClick: l[1] || (l[1] = (b) => r.value = !0)
158
160
  }), [
159
161
  f(e.$slots, "trigger", { props: L.value }, void 0, !0)
160
162
  ], 16)) : c("", !0),
@@ -169,28 +171,28 @@ const $e = { class: "drawer-mobile" }, Ie = {
169
171
  "data-state": t(M)
170
172
  }, t(a)("overlay")), null, 16, Ce),
171
173
  d("div", n({
172
- id: h,
174
+ id: $,
173
175
  ref_key: "contentRef",
174
- ref: $,
176
+ ref: I,
175
177
  role: "dialog",
176
178
  "aria-modal": "true",
177
179
  "aria-labelledby": v,
178
- "aria-describedby": e.$slots.default ? B : void 0,
180
+ "aria-describedby": e.$slots.default ? S : void 0,
179
181
  class: ["drawer-content", `drawer-content--${o.position}`],
180
182
  "data-state": t(M),
181
183
  style: F.value
182
184
  }, { ...e.$attrs, ...t(a)("content") }), [
183
185
  d("div", Pe, [
184
- o.title?.text ? (s(), w(x(E.value), n({
186
+ o.title?.text ? (s(), w(N(B.value), n({
185
187
  key: 0,
186
188
  id: v,
187
189
  class: "drawer-content__title"
188
190
  }, t(a)("title")), {
189
191
  default: m(() => [
190
- le(N(o.title.text), 1)
192
+ le(A(o.title.text), 1)
191
193
  ]),
192
194
  _: 1
193
- }, 16)) : e.$slots.title ? (s(), w(x(E.value), n({
195
+ }, 16)) : e.$slots.title ? (s(), w(N(B.value), n({
194
196
  key: 1,
195
197
  id: v,
196
198
  class: "drawer-content__title"
@@ -211,14 +213,14 @@ const $e = { class: "drawer-mobile" }, Ie = {
211
213
  class: "drawer-content__close",
212
214
  "aria-label": o.closeButton.label ?? "Закрыть"
213
215
  }, t(a)("close"), {
214
- onClick: l[2] || (l[2] = (y) => p("closeButton"))
216
+ onClick: l[2] || (l[2] = (b) => y("closeButton"))
215
217
  }), [
216
218
  de(t(ue), { size: 20 })
217
219
  ], 16, De)) : c("", !0)
218
220
  ]),
219
- o.divider ? (s(), u("div", Se)) : c("", !0),
221
+ o.divider ? (s(), u("div", Ee)) : c("", !0),
220
222
  d("div", n({
221
- id: B,
223
+ id: S,
222
224
  class: "drawer-content__wrapper"
223
225
  }, t(a)("body")), [
224
226
  f(e.$slots, "default", {}, void 0, !0)
@@ -1 +1 @@
1
- .popover-trigger[data-v-3289c013]{display:block}.popover-mobile[data-v-3289c013]{width:100%}.popover-content[data-v-3289c013]{z-index:1001;background-color:var(--theme-neutral-0);filter:drop-shadow(-1px 1px 10px #8d8f9340);border-radius:16px;position:fixed}.popover-content[data-state=open][data-v-3289c013]{animation:fadeIn var(--animation-duration) ease-in-out}.popover-content[data-state=closed][data-v-3289c013]{animation:fadeOut var(--animation-duration) ease-in-out}.popover-arrow[data-v-3289c013]{background-color:var(--theme-neutral-0);pointer-events:none;width:10px;height:10px;position:absolute;transform:rotate(45deg)}.popover-arrow--bottom[data-v-3289c013]{top:-5px}.popover-arrow--top[data-v-3289c013]{bottom:-5px}.popover-arrow--right[data-v-3289c013]{left:-5px}.popover-arrow--left[data-v-3289c013]{right:-5px}
1
+ .popover-trigger[data-v-cb7adfa2]{display:block}.popover-trigger--content[data-v-cb7adfa2]{width:fit-content}.popover-mobile[data-v-cb7adfa2]{width:100%}.popover-content[data-v-cb7adfa2]{z-index:1001;background-color:var(--theme-neutral-0);filter:drop-shadow(-1px 1px 10px #8d8f9340);border-radius:16px;position:fixed}.popover-content[data-state=open][data-v-cb7adfa2]{animation:fadeIn var(--animation-duration) ease-in-out}.popover-content[data-state=closed][data-v-cb7adfa2]{animation:fadeOut var(--animation-duration) ease-in-out}.popover-arrow[data-v-cb7adfa2]{background-color:var(--theme-neutral-0);pointer-events:none;width:10px;height:10px;position:absolute;transform:rotate(45deg)}.popover-arrow--bottom[data-v-cb7adfa2]{top:-5px}.popover-arrow--top[data-v-cb7adfa2]{bottom:-5px}.popover-arrow--right[data-v-cb7adfa2]{left:-5px}.popover-arrow--left[data-v-cb7adfa2]{right:-5px}
@@ -32,6 +32,19 @@ export interface PopoverProps {
32
32
  * именно на него — иначе связь ведёт на безролевую обёртку.
33
33
  */
34
34
  triggerControls?: string;
35
+ /**
36
+ * Ширина обёртки слота `trigger`.
37
+ *
38
+ * По умолчанию `full` — обёртка блочная и занимает всю доступную ширину.
39
+ * Так нужно тем, у кого сам триггер растянут по ней (`Select` задаёт
40
+ * кнопке `width: 100%`, и от `content` она схлопнулась бы в ноль).
41
+ *
42
+ * `content` обтягивает содержимое. Нужно полям, которые в макете идут по
43
+ * своему содержимому, а не по ширине контейнера: иначе обёртка
44
+ * растягивается на всю строку, ловит клики мимо поля и сдвигает точку, от
45
+ * которой считается положение попапа.
46
+ */
47
+ triggerWidth?: 'full' | 'content';
35
48
  /**
36
49
  * Удерживать фокус внутри попапа, пока он открыт, и вернуть его на триггер
37
50
  * при закрытии. Отключается для попапов, которые управляют фокусом сами.
@@ -49,6 +49,7 @@ declare const __VLS_component: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}
49
49
  labelledBy: string;
50
50
  triggerHasPopup: "dialog" | "menu" | "listbox" | "grid" | "tree";
51
51
  triggerControls: string;
52
+ triggerWidth: "full" | "content";
52
53
  }, {}, {}, {}, string, ComponentProvideOptions, false, {
53
54
  triggerRef: HTMLSpanElement;
54
55
  contentRef: HTMLDivElement;
@@ -2,7 +2,7 @@ import './Popover.css';
2
2
  import o from "./Popover.vue2.js";
3
3
  /* empty css */
4
4
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
5
- const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3289c013"]]);
5
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-cb7adfa2"]]);
6
6
  export {
7
- _ as default
7
+ f as default
8
8
  };