@shtabapp/ui-kit 1.65.0 → 1.66.0

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 (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{SColorPicker-Z6lSlByI.cjs → SColorPicker-B_rbs-0d.cjs} +1 -1
  3. package/dist/{SColorPicker-B8x6qO8A.js → SColorPicker-C_161aLA.js} +3 -3
  4. package/dist/{SDropdown-LNVnMol3.cjs → SDropdown-B1OGbIYg.cjs} +1 -1
  5. package/dist/SDropdown-CiXHI3g1.js +362 -0
  6. package/dist/{SSelect-BLc_92_w.js → SSelect-C3-8vi2u.js} +1 -1
  7. package/dist/{SSelect-LaTTGKd1.cjs → SSelect-EhvfGB4d.cjs} +1 -1
  8. package/dist/{STable-CfRGPFmm.js → STable-CADyNvk8.js} +2 -2
  9. package/dist/{STable-xMxOF84K.cjs → STable-D1x-kIBO.cjs} +1 -1
  10. package/dist/components/SDropdown/SDropdown.types.d.ts +10 -2
  11. package/dist/components/SDropdown/SDropdown.types.d.ts.map +1 -1
  12. package/dist/components/SDropdown/SDropdown.vue.d.ts.map +1 -1
  13. package/dist/components/SDropdown/index.d.ts +1 -1
  14. package/dist/components/SDropdown/index.d.ts.map +1 -1
  15. package/dist/composables/connectedPosition/index.d.ts +1 -1
  16. package/dist/composables/connectedPosition/index.d.ts.map +1 -1
  17. package/dist/composables/connectedPosition/types.d.ts +4 -0
  18. package/dist/composables/connectedPosition/types.d.ts.map +1 -1
  19. package/dist/composables/useFloatingOverlay.d.ts +2 -1
  20. package/dist/composables/useFloatingOverlay.d.ts.map +1 -1
  21. package/dist/entries/color-picker.cjs +1 -1
  22. package/dist/entries/color-picker.js +1 -1
  23. package/dist/entries/composables.cjs +1 -1
  24. package/dist/entries/composables.js +1 -1
  25. package/dist/entries/dropdown.cjs +1 -1
  26. package/dist/entries/dropdown.js +2 -2
  27. package/dist/entries/select.cjs +1 -1
  28. package/dist/entries/select.js +1 -1
  29. package/dist/entries/table.cjs +1 -1
  30. package/dist/entries/table.js +1 -1
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +139 -139
  35. package/dist/uikit-components.css +1 -1
  36. package/dist/{useFloatingOverlay-QcumEYEq.js → useFloatingOverlay-B1BvRxLz.js} +134 -130
  37. package/dist/useFloatingOverlay-CtQBdvS9.cjs +1 -0
  38. package/package.json +1 -1
  39. package/dist/SDropdown-LOTCtlCX.js +0 -356
  40. package/dist/useFloatingOverlay-B1UCUYQQ.cjs +0 -1
@@ -8,8 +8,10 @@ var l = /* @__PURE__ */ function(e) {
8
8
  }({}), d = /* @__PURE__ */ function(e) {
9
9
  return e.TOP = "top", e.TOP_START = "top-start", e.TOP_END = "top-end", e.BOTTOM = "bottom", e.BOTTOM_START = "bottom-start", e.BOTTOM_END = "bottom-end", e.LEFT = "left", e.LEFT_START = "left-start", e.LEFT_END = "left-end", e.RIGHT = "right", e.RIGHT_START = "right-start", e.RIGHT_END = "right-end", e;
10
10
  }({}), f = /* @__PURE__ */ function(e) {
11
+ return e.CLIPPING_ANCESTORS = "clipping-ancestors", e.VIEWPORT = "viewport", e;
12
+ }({}), p = /* @__PURE__ */ function(e) {
11
13
  return e.PREFERRED = "preferred", e.FLIP = "flip", e.SHIFT = "shift", e.SIZE = "size", e;
12
- }({}), p = (e) => {
14
+ }({}), m = (e) => {
13
15
  switch (e) {
14
16
  case d.TOP: return {
15
17
  side: l.TOP,
@@ -61,8 +63,8 @@ var l = /* @__PURE__ */ function(e) {
61
63
  };
62
64
  default: return e;
63
65
  }
64
- }, m = (e) => e.side === l.TOP ? e.align === u.START ? d.TOP_START : e.align === u.END ? d.TOP_END : d.TOP : e.side === l.BOTTOM ? e.align === u.START ? d.BOTTOM_START : e.align === u.END ? d.BOTTOM_END : d.BOTTOM : e.side === l.LEFT ? e.align === u.START ? d.LEFT_START : e.align === u.END ? d.LEFT_END : d.LEFT : e.align === u.START ? d.RIGHT_START : e.align === u.END ? d.RIGHT_END : d.RIGHT, h = (e, t, n) => Math.min(Math.max(t, e), n), g = (e) => e === l.TOP ? "bottom" : e === l.BOTTOM ? "top" : e === l.LEFT ? "right" : "left", _ = ({ referenceCenter: e, floatingStart: t, floatingLength: n, crossAxisProperty: r, staticSide: i, staticOffset: a, arrowSize: o, arrowPadding: s }) => {
65
- let c = e - t - o / 2, l = h(s, c, n - o - s), u = c - l;
66
+ }, h = (e) => e.side === l.TOP ? e.align === u.START ? d.TOP_START : e.align === u.END ? d.TOP_END : d.TOP : e.side === l.BOTTOM ? e.align === u.START ? d.BOTTOM_START : e.align === u.END ? d.BOTTOM_END : d.BOTTOM : e.side === l.LEFT ? e.align === u.START ? d.LEFT_START : e.align === u.END ? d.LEFT_END : d.LEFT : e.align === u.START ? d.RIGHT_START : e.align === u.END ? d.RIGHT_END : d.RIGHT, g = (e, t, n) => Math.min(Math.max(t, e), n), _ = (e) => e === l.TOP ? "bottom" : e === l.BOTTOM ? "top" : e === l.LEFT ? "right" : "left", v = ({ referenceCenter: e, floatingStart: t, floatingLength: n, crossAxisProperty: r, staticSide: i, staticOffset: a, arrowSize: o, arrowPadding: s }) => {
67
+ let c = e - t - o / 2, l = g(s, c, n - o - s), u = c - l;
66
68
  return {
67
69
  crossAxisPosition: l,
68
70
  crossAxisProperty: r,
@@ -71,9 +73,9 @@ var l = /* @__PURE__ */ function(e) {
71
73
  centerOffset: u,
72
74
  isOverflow: Math.abs(u) > o / 2
73
75
  };
74
- }, v = (e) => {
75
- let { referenceRect: t, floatingCoordinates: n, floatingSize: r, arrowSize: i, arrowPadding: a } = e, o = p(e.resolvedPlacement), s = g(o.side), c = -(i / 2);
76
- return o.side === l.TOP || o.side === l.BOTTOM ? _({
76
+ }, y = (e) => {
77
+ let { referenceRect: t, floatingCoordinates: n, floatingSize: r, arrowSize: i, arrowPadding: a } = e, o = m(e.resolvedPlacement), s = _(o.side), c = -(i / 2);
78
+ return o.side === l.TOP || o.side === l.BOTTOM ? v({
77
79
  referenceCenter: t.left + t.width / 2,
78
80
  floatingStart: n.x,
79
81
  floatingLength: r.width,
@@ -82,7 +84,7 @@ var l = /* @__PURE__ */ function(e) {
82
84
  staticOffset: c,
83
85
  arrowSize: i,
84
86
  arrowPadding: a
85
- }) : _({
87
+ }) : v({
86
88
  referenceCenter: t.top + t.height / 2,
87
89
  floatingStart: n.y,
88
90
  floatingLength: r.height,
@@ -92,7 +94,7 @@ var l = /* @__PURE__ */ function(e) {
92
94
  arrowSize: i,
93
95
  arrowPadding: a
94
96
  });
95
- }, y = (e, t, n) => {
97
+ }, b = (e, t, n) => {
96
98
  let r = t.top + n, i = t.left + n, a = t.right - n, o = t.bottom - n;
97
99
  return {
98
100
  top: r - e.top,
@@ -100,7 +102,7 @@ var l = /* @__PURE__ */ function(e) {
100
102
  left: i - e.left,
101
103
  right: e.right - a
102
104
  };
103
- }, b = (e, t) => t === "top" ? e.top > 0 : t === "bottom" ? e.bottom > 0 : t === "left" ? e.left > 0 : e.right > 0, x = (e) => e.top > 0 || e.bottom > 0 || e.left > 0 || e.right > 0, S = (e, t) => t === l.TOP || t === l.BOTTOM ? e.left > 0 || e.right > 0 : e.top > 0 || e.bottom > 0, C = (e, t) => e.bottom > t.top && e.top < t.bottom && e.right > t.left && e.left < t.right, w = (e, t) => {
105
+ }, x = (e, t) => t === "top" ? e.top > 0 : t === "bottom" ? e.bottom > 0 : t === "left" ? e.left > 0 : e.right > 0, S = (e) => e.top > 0 || e.bottom > 0 || e.left > 0 || e.right > 0, C = (e, t) => t === l.TOP || t === l.BOTTOM ? e.left > 0 || e.right > 0 : e.top > 0 || e.bottom > 0, w = (e, t) => e.bottom > t.top && e.top < t.bottom && e.right > t.left && e.left < t.right, T = (e, t) => {
104
106
  let n = e.top + t, r = e.left + t, i = e.right - t, a = e.bottom - t;
105
107
  return {
106
108
  top: n,
@@ -110,7 +112,7 @@ var l = /* @__PURE__ */ function(e) {
110
112
  width: Math.max(0, i - r),
111
113
  height: Math.max(0, a - n)
112
114
  };
113
- }, T = (e) => e.side === l.TOP ? {
115
+ }, E = (e) => e.side === l.TOP ? {
114
116
  ...e,
115
117
  side: l.BOTTOM
116
118
  } : e.side === l.BOTTOM ? {
@@ -122,101 +124,101 @@ var l = /* @__PURE__ */ function(e) {
122
124
  } : {
123
125
  ...e,
124
126
  side: l.LEFT
125
- }, E = (e, t, n) => Math.min(Math.max(t, e), n), D = (e, t, n) => e === "y" ? {
127
+ }, D = (e, t, n) => Math.min(Math.max(t, e), n), O = (e, t, n) => e === "y" ? {
126
128
  x: t.x,
127
- y: E(t.y + n.top, t.y, t.y - n.bottom)
129
+ y: D(t.y + n.top, t.y, t.y - n.bottom)
128
130
  } : {
129
- x: E(t.x + n.left, t.x, t.x - n.right),
131
+ x: D(t.x + n.left, t.x, t.x - n.right),
130
132
  y: t.y
131
- }, O = (e) => e === l.TOP || e === l.BOTTOM ? {
133
+ }, k = (e) => e === l.TOP || e === l.BOTTOM ? {
132
134
  mainAxis: "x",
133
135
  crossAxis: "y"
134
136
  } : {
135
137
  mainAxis: "y",
136
138
  crossAxis: "x"
137
- }, k = (e, t, n, r) => r === u.START ? e : r === u.END ? e + t - n : e + (t - n) / 2, A = (e, t, n, r) => n.side === l.BOTTOM ? {
138
- x: k(e.left, e.width, t.width, n.align),
139
+ }, A = (e, t, n, r) => r === u.START ? e : r === u.END ? e + t - n : e + (t - n) / 2, j = (e, t, n, r) => n.side === l.BOTTOM ? {
140
+ x: A(e.left, e.width, t.width, n.align),
139
141
  y: e.bottom + r
140
142
  } : n.side === l.TOP ? {
141
- x: k(e.left, e.width, t.width, n.align),
143
+ x: A(e.left, e.width, t.width, n.align),
142
144
  y: e.top - r - t.height
143
145
  } : n.side === l.LEFT ? {
144
146
  x: e.left - r - t.width,
145
- y: k(e.top, e.height, t.height, n.align)
147
+ y: A(e.top, e.height, t.height, n.align)
146
148
  } : {
147
149
  x: e.right + r,
148
- y: k(e.top, e.height, t.height, n.align)
149
- }, j = (e, t) => ({
150
+ y: A(e.top, e.height, t.height, n.align)
151
+ }, M = (e, t) => ({
150
152
  top: e.y,
151
153
  left: e.x,
152
154
  right: e.x + t.width,
153
155
  bottom: e.y + t.height,
154
156
  width: t.width,
155
157
  height: t.height
156
- }), M = (e, t, n, r) => e === "x" ? {
158
+ }), N = (e, t, n, r) => e === "x" ? {
157
159
  min: t.left + n,
158
160
  max: t.right - n - r.width
159
161
  } : {
160
162
  min: t.top + n,
161
163
  max: t.bottom - n - r.height
162
- }, N = (e, t, n, r, i) => t <= n ? E(t, e, n) : E(r, e, i), P = (e, t, n, r, i, a) => {
163
- let { mainAxis: o } = O(t), { x: s, y: c } = e, l = M(o, i, a, r);
164
+ }, P = (e, t, n, r, i) => t <= n ? D(t, e, n) : D(r, e, i), F = (e, t, n, r, i, a) => {
165
+ let { mainAxis: o } = k(t), { x: s, y: c } = e, l = N(o, i, a, r);
164
166
  if (o === "y") {
165
167
  let e = n.top - r.height, t = n.bottom, i = Math.max(l.min, e), a = Math.min(l.max, t);
166
- c = N(c, i, a, l.min, l.max);
168
+ c = P(c, i, a, l.min, l.max);
167
169
  } else {
168
170
  let e = n.left - r.width, t = n.right, i = Math.max(l.min, e), a = Math.min(l.max, t);
169
- s = N(s, i, a, l.min, l.max);
171
+ s = P(s, i, a, l.min, l.max);
170
172
  }
171
173
  return {
172
174
  x: s,
173
175
  y: c
174
176
  };
175
- }, F = (e, t, n) => {
176
- let { anchorSide: r, referenceRect: i, viewportRect: a, viewportPadding: o, mainAxis: s = !0, crossAxis: c = !1 } = n, l = y(j(e, t), a, o), { mainAxis: u, crossAxis: d } = O(r), f = {
177
+ }, I = (e, t, n) => {
178
+ let { anchorSide: r, referenceRect: i, viewportRect: a, viewportPadding: o, mainAxis: s = !0, crossAxis: c = !1 } = n, l = b(M(e, t), a, o), { mainAxis: u, crossAxis: d } = k(r), f = {
177
179
  x: e.x,
178
180
  y: e.y
179
181
  };
180
- return s && (f = D(u, f, l)), c && (f = D(d, f, l)), P(f, r, i, t, a, o);
181
- }, I = (e) => e === l.TOP ? "top" : e === l.BOTTOM ? "bottom" : e === l.LEFT ? "left" : "right", L = (e, t, n) => {
182
+ return s && (f = O(u, f, l)), c && (f = O(d, f, l)), F(f, r, i, t, a, o);
183
+ }, L = (e) => e === l.TOP ? "top" : e === l.BOTTOM ? "bottom" : e === l.LEFT ? "left" : "right", R = (e, t, n) => {
182
184
  let r = t.bottom - n;
183
185
  return Math.max(0, Math.floor(r - e.y));
184
- }, R = (e) => {
185
- let t = p(e.placement), n = e.flip ? [t, T(t)] : [t], r = {
186
+ }, z = (e) => {
187
+ let t = m(e.placement), n = e.flip ? [t, E(t)] : [t], r = {
186
188
  anchor: t,
187
- coordinates: A(e.referenceRect, e.floatingSize, t, e.offset),
188
- strategy: f.PREFERRED
189
+ coordinates: j(e.referenceRect, e.floatingSize, t, e.offset),
190
+ strategy: p.PREFERRED
189
191
  };
190
192
  for (let i of n) {
191
- let n = A(e.referenceRect, e.floatingSize, i, e.offset);
192
- if (!b(y(j(n, e.floatingSize), e.viewportRect, e.viewportPadding), I(i.side))) return {
193
+ let n = j(e.referenceRect, e.floatingSize, i, e.offset);
194
+ if (!x(b(M(n, e.floatingSize), e.viewportRect, e.viewportPadding), L(i.side))) return {
193
195
  anchor: i,
194
196
  coordinates: n,
195
- strategy: i === t ? f.PREFERRED : f.FLIP
197
+ strategy: i === t ? p.PREFERRED : p.FLIP
196
198
  };
197
199
  r = {
198
200
  anchor: i,
199
201
  coordinates: n,
200
- strategy: f.FLIP
202
+ strategy: p.FLIP
201
203
  };
202
204
  }
203
205
  return r;
204
- }, z = (e, t) => !e.shift || !x(y(j(t.coordinates, e.floatingSize), e.viewportRect, e.viewportPadding)) ? t : {
206
+ }, B = (e, t) => !e.shift || !S(b(M(t.coordinates, e.floatingSize), e.viewportRect, e.viewportPadding)) ? t : {
205
207
  ...t,
206
- coordinates: F(t.coordinates, e.floatingSize, {
208
+ coordinates: I(t.coordinates, e.floatingSize, {
207
209
  anchorSide: t.anchor.side,
208
210
  referenceRect: e.referenceRect,
209
211
  viewportRect: e.viewportRect,
210
212
  viewportPadding: e.viewportPadding
211
213
  }),
212
- strategy: f.SHIFT
213
- }, B = (e, t) => {
214
+ strategy: p.SHIFT
215
+ }, V = (e, t) => {
214
216
  if (!e.fitViewport) return {
215
217
  coordinates: t.coordinates,
216
218
  strategy: t.strategy,
217
219
  maxHeight: void 0
218
220
  };
219
- let n = L(t.coordinates, e.viewportRect, e.viewportPadding), r = e.referenceRect.top - e.offset;
221
+ let n = R(t.coordinates, e.viewportRect, e.viewportPadding), r = e.referenceRect.top - e.offset;
220
222
  if (t.anchor.side === l.TOP) {
221
223
  let t = e.viewportRect.top + e.viewportPadding, i = Math.max(0, Math.floor(r - t));
222
224
  n = Math.min(n, i);
@@ -230,19 +232,19 @@ var l = /* @__PURE__ */ function(e) {
230
232
  ...t.coordinates,
231
233
  y: r - n
232
234
  } : t.coordinates,
233
- strategy: f.SIZE,
235
+ strategy: p.SIZE,
234
236
  maxHeight: n
235
237
  };
236
- }, V = (e) => {
237
- let t = z(e, R(e)), n = B(e, t);
238
+ }, H = (e) => {
239
+ let t = B(e, z(e)), n = V(e, t);
238
240
  return {
239
241
  x: n.coordinates.x,
240
242
  y: n.coordinates.y,
241
- resolvedPlacement: m(t.anchor),
243
+ resolvedPlacement: h(t.anchor),
242
244
  strategy: n.strategy,
243
245
  maxHeight: n.maxHeight
244
246
  };
245
- }, H = () => {
247
+ }, U = () => {
246
248
  let e = window.visualViewport;
247
249
  return e ? {
248
250
  top: e.offsetTop,
@@ -259,21 +261,21 @@ var l = /* @__PURE__ */ function(e) {
259
261
  width: window.innerWidth,
260
262
  height: window.innerHeight
261
263
  };
262
- }, U = (e) => ({
264
+ }, W = (e) => ({
263
265
  top: e.top,
264
266
  left: e.left,
265
267
  right: e.right,
266
268
  bottom: e.bottom,
267
269
  width: e.width,
268
270
  height: e.height
269
- }), W = /auto|scroll|overlay|hidden|clip/, G = (e) => {
271
+ }), G = /auto|scroll|overlay|hidden|clip/, K = (e) => {
270
272
  let t = window.getComputedStyle(e);
271
273
  return [
272
274
  t.overflow,
273
275
  t.overflowX,
274
276
  t.overflowY
275
- ].some((e) => W.test(e));
276
- }, K = (e, t) => {
277
+ ].some((e) => G.test(e));
278
+ }, q = (e, t) => {
277
279
  let n = Math.max(e.top, t.top), r = Math.max(e.left, t.left), i = Math.min(e.right, t.right), a = Math.min(e.bottom, t.bottom);
278
280
  return {
279
281
  top: n,
@@ -283,65 +285,65 @@ var l = /* @__PURE__ */ function(e) {
283
285
  width: Math.max(0, i - r),
284
286
  height: Math.max(0, a - n)
285
287
  };
286
- }, q = (e) => {
287
- let t = H();
288
+ }, J = (e) => {
289
+ let t = U();
288
290
  if (!e) return t;
289
291
  let n = e.parentElement;
290
- for (; n;) G(n) && (t = K(t, n.getBoundingClientRect())), n = n.parentElement;
292
+ for (; n;) K(n) && (t = q(t, n.getBoundingClientRect())), n = n.parentElement;
291
293
  return t;
292
- }, J = /auto|scroll|overlay/, Y = (e) => {
294
+ }, Y = /auto|scroll|overlay/, X = (e) => {
293
295
  let t = window.getComputedStyle(e);
294
296
  return [
295
297
  t.overflow,
296
298
  t.overflowX,
297
299
  t.overflowY
298
- ].some((e) => J.test(e));
299
- }, X = (e) => {
300
+ ].some((e) => Y.test(e));
301
+ }, ee = (e) => {
300
302
  let t = [], n = e?.parentElement ?? null;
301
- for (; n;) Y(n) && t.push(n), n = n.parentElement;
303
+ for (; n;) X(n) && t.push(n), n = n.parentElement;
302
304
  return t;
303
305
  }, Z = (e) => e ? e instanceof HTMLElement ? e : e.$el instanceof HTMLElement ? e.$el : null : null, Q = (e) => {
304
306
  let t = e.trim();
305
307
  if (!t) return;
306
308
  let n = parseFloat(t);
307
309
  if (!Number.isNaN(n)) return n;
308
- }, ee = (e) => {
310
+ }, te = (e) => {
309
311
  let t = getComputedStyle(e);
310
312
  return {
311
313
  arrowSize: Q(t.getPropertyValue("--s-ui-dropdown-arrow-size")) ?? 12,
312
314
  arrowPadding: Q(t.getPropertyValue("--s-ui-dropdown-arrow-padding")) ?? 8
313
315
  };
314
- }, te = (e, t, n) => {
316
+ }, ne = (e, t, n) => {
315
317
  if (!n) return t;
316
318
  let r = e.firstElementChild;
317
319
  return r instanceof HTMLElement ? Math.max(r.scrollHeight, t) : Math.max(e.scrollHeight, t);
318
- }, $ = (e, t) => i(e ?? t), ne = (e, t) => e && t instanceof HTMLElement ? ee(t) : {
320
+ }, $ = (e, t) => i(e ?? t), re = (e, t) => e && t instanceof HTMLElement ? te(t) : {
319
321
  arrowSize: 12,
320
322
  arrowPadding: 8
321
- }, re = (e, t, n, r, i, a) => {
322
- let o = w(r, i), s = y(j({
323
+ }, ie = (e, t, n, r, i, a, o) => {
324
+ let s = T(r, a), c = b(M({
323
325
  x: e.x,
324
326
  y: e.y
325
- }, n), r, i), c = C(t, o), l = p(e.resolvedPlacement).side, u = a ? !S(s, l) : !x(s);
326
- return c && u;
327
- }, ie = (l) => {
328
- let u = r(null), f = r(void 0), p = r(d.BOTTOM_START), m = r(!1), h = r(0), g = r(null), _ = r(!1), y = [], b = () => {
329
- i(l.open) && E();
330
- }, x = () => {
331
- for (let e of y) e();
332
- y = [];
327
+ }, n), i, a), l = w(t, s), u = m(e.resolvedPlacement).side, d = o ? !C(c, u) : !S(c);
328
+ return l && d;
329
+ }, ae = (l) => {
330
+ let u = r(null), p = r(void 0), m = r(d.BOTTOM_START), h = r(!1), g = r(0), _ = r(null), v = r(!1), b = [], x = () => {
331
+ i(l.open) && D();
333
332
  }, S = () => {
334
- x();
333
+ for (let e of b) e();
334
+ b = [];
335
+ }, C = () => {
336
+ S();
335
337
  let e = Z(i(l.reference));
336
- for (let t of X(e)) t.addEventListener("scroll", b, {
338
+ for (let t of ee(e)) t.addEventListener("scroll", x, {
337
339
  capture: !0,
338
340
  passive: !0
339
- }), y.push(() => {
340
- t.removeEventListener("scroll", b, { capture: !0 });
341
+ }), b.push(() => {
342
+ t.removeEventListener("scroll", x, { capture: !0 });
341
343
  });
342
344
  };
343
- s(window, "scroll", b, { capture: !0 }), s(document, "scroll", b, { capture: !0 }), s(() => document.documentElement, "scroll", b, { capture: !0 }), s(() => window.visualViewport ?? null, "scroll", b, { passive: !0 });
344
- let C = () => ({
345
+ s(window, "scroll", x, { capture: !0 }), s(document, "scroll", x, { capture: !0 }), s(() => document.documentElement, "scroll", x, { capture: !0 }), s(() => window.visualViewport ?? null, "scroll", x, { passive: !0 });
346
+ let w = () => ({
345
347
  matchReferenceWidth: $(l.matchReferenceWidth, !1),
346
348
  fitViewport: $(l.fitViewport, !1),
347
349
  shift: $(l.shift, !1),
@@ -349,13 +351,14 @@ var l = /* @__PURE__ */ function(e) {
349
351
  viewportPadding: $(l.viewportPadding, 8),
350
352
  hasArrow: $(l.arrow, !1),
351
353
  placement: $(l.placement, d.BOTTOM_START),
352
- flip: $(l.flip, !0)
353
- }), w = (e, t) => {
354
+ flip: $(l.flip, !0),
355
+ boundary: $(l.boundary, f.CLIPPING_ANCESTORS)
356
+ }), T = (e, t) => {
354
357
  if (!e) {
355
- g.value = null, _.value = !1;
358
+ _.value = null, v.value = !1;
356
359
  return;
357
360
  }
358
- let n = v({
361
+ let n = y({
359
362
  referenceRect: t.referenceRect,
360
363
  floatingCoordinates: {
361
364
  x: t.result.x,
@@ -366,45 +369,45 @@ var l = /* @__PURE__ */ function(e) {
366
369
  arrowSize: t.arrowSize,
367
370
  arrowPadding: t.arrowPadding
368
371
  });
369
- g.value = n, _.value = n.isOverflow;
370
- }, T = () => {
372
+ _.value = n, v.value = n.isOverflow;
373
+ }, E = () => {
371
374
  if (!i(l.open)) return;
372
375
  let e = Z(i(l.reference)), t = i(l.panel);
373
376
  if (!e || !t) return;
374
- let n = C(), r = U(e.getBoundingClientRect()), a = U(t.getBoundingClientRect());
375
- h.value = Math.round(r.width);
376
- let o = t.firstElementChild, { arrowSize: s, arrowPadding: c } = ne(n.hasArrow, o), d = n.hasArrow ? n.baseOffset + s / 2 : n.baseOffset, g = {
377
+ let n = w(), r = W(e.getBoundingClientRect()), a = W(t.getBoundingClientRect());
378
+ g.value = Math.round(r.width);
379
+ let o = t.firstElementChild, { arrowSize: s, arrowPadding: c } = re(n.hasArrow, o), d = n.hasArrow ? n.baseOffset + s / 2 : n.baseOffset, _ = {
377
380
  width: n.matchReferenceWidth && r.width > 0 ? r.width : a.width,
378
- height: te(t, a.height, n.fitViewport)
379
- }, _ = q(e), v = V({
381
+ height: ne(t, a.height, n.fitViewport)
382
+ }, v = J(e), y = n.boundary === f.VIEWPORT ? U() : v, b = H({
380
383
  referenceRect: r,
381
- floatingSize: g,
384
+ floatingSize: _,
382
385
  placement: n.placement,
383
386
  offset: d,
384
387
  flip: n.flip,
385
388
  shift: n.shift,
386
389
  fitViewport: n.fitViewport,
387
- viewportRect: _,
390
+ viewportRect: y,
388
391
  viewportPadding: n.viewportPadding
389
392
  });
390
393
  u.value = {
391
- x: v.x,
392
- y: v.y
393
- }, f.value = v.maxHeight, p.value = v.resolvedPlacement;
394
- let y = {
395
- width: g.width,
396
- height: v.maxHeight ?? g.height
394
+ x: b.x,
395
+ y: b.y
396
+ }, p.value = b.maxHeight, m.value = b.resolvedPlacement;
397
+ let x = {
398
+ width: _.width,
399
+ height: b.maxHeight ?? _.height
397
400
  };
398
- m.value = re(v, r, y, _, n.viewportPadding, n.shift), w(n.hasArrow, {
401
+ h.value = ie(b, r, x, v, y, n.viewportPadding, n.shift), T(n.hasArrow, {
399
402
  referenceRect: r,
400
- result: v,
401
- renderedFloatingSize: y,
403
+ result: b,
404
+ renderedFloatingSize: x,
402
405
  arrowSize: s,
403
406
  arrowPadding: c
404
407
  });
405
- }, E = () => {
406
- T();
407
- }, D = e(() => {
408
+ }, D = () => {
409
+ E();
410
+ }, O = e(() => {
408
411
  let e = i(l.matchReferenceWidth ?? !1);
409
412
  if (!i(l.open) || !u.value) return {
410
413
  position: "fixed",
@@ -418,27 +421,27 @@ var l = /* @__PURE__ */ function(e) {
418
421
  top: "0",
419
422
  left: "0",
420
423
  transform: `translate(${u.value.x}px, ${u.value.y}px)`,
421
- visibility: m.value ? "visible" : "hidden",
422
- pointerEvents: m.value ? "auto" : "none"
424
+ visibility: h.value ? "visible" : "hidden",
425
+ pointerEvents: h.value ? "auto" : "none"
423
426
  };
424
- if (e && h.value > 0) {
425
- let e = `${Math.round(h.value)}px`;
427
+ if (e && g.value > 0) {
428
+ let e = `${Math.round(g.value)}px`;
426
429
  t.width = e, t.minWidth = e, t.maxWidth = e;
427
430
  }
428
431
  return t;
429
- }), O = e(() => {
430
- if (!i(l.open) || !i(l.arrow ?? !1) || !g.value) return;
431
- let e = g.value;
432
+ }), k = e(() => {
433
+ if (!i(l.open) || !i(l.arrow ?? !1) || !_.value) return;
434
+ let e = _.value;
432
435
  return { [e.crossAxisProperty]: `${e.crossAxisPosition}px` };
433
- }), k = () => {
436
+ }), A = () => {
434
437
  l.onOpenChange?.(!1);
435
438
  };
436
439
  return a(() => i(l.open), async (e) => {
437
440
  if (e) {
438
- m.value = !1, await t(), S(), E();
441
+ h.value = !1, await t(), C(), D();
439
442
  return;
440
443
  }
441
- m.value = !1, u.value = null, f.value = void 0, g.value = null, _.value = !1, x();
444
+ h.value = !1, u.value = null, p.value = void 0, _.value = null, v.value = !1, S();
442
445
  }), a([
443
446
  () => i(l.placement ?? d.BOTTOM_START),
444
447
  () => i(l.offset ?? 8),
@@ -447,37 +450,38 @@ var l = /* @__PURE__ */ function(e) {
447
450
  () => i(l.matchReferenceWidth ?? !1),
448
451
  () => i(l.fitViewport ?? !1),
449
452
  () => i(l.viewportPadding ?? 8),
450
- () => i(l.arrow ?? !1)
453
+ () => i(l.arrow ?? !1),
454
+ () => i(l.boundary ?? f.CLIPPING_ANCESTORS)
451
455
  ], async () => {
452
- i(l.open) && (m.value = !1, await t(), E());
456
+ i(l.open) && (h.value = !1, await t(), D());
453
457
  }), c(() => Z(i(l.reference)), () => {
454
- i(l.open) && E();
458
+ i(l.open) && D();
455
459
  }), c(() => i(l.panel), () => {
456
- i(l.open) && E();
460
+ i(l.open) && D();
457
461
  }), s(window, "resize", () => {
458
- i(l.open) && E();
462
+ i(l.open) && D();
459
463
  }), s(() => window.visualViewport ?? null, "resize", () => {
460
- i(l.open) && E();
464
+ i(l.open) && D();
461
465
  }), o(() => i(l.panel), () => {
462
- !i(l.open) || !i(l.dismissOnClickOutside ?? !0) || k();
466
+ !i(l.open) || !i(l.dismissOnClickOutside ?? !0) || A();
463
467
  }, { ignore: [
464
468
  e(() => Z(i(l.reference))),
465
469
  ".s-ui-dropdown",
466
470
  ".s-ui-dropdown__panel"
467
471
  ] }), s(window, "keydown", (e) => {
468
- !i(l.open) || !i(l.dismissOnEscape ?? !0) || e.key === "Escape" && k();
472
+ !i(l.open) || !i(l.dismissOnEscape ?? !0) || e.key === "Escape" && A();
469
473
  }), n(() => {
470
- x();
474
+ S();
471
475
  }), {
472
- panelStyles: D,
473
- panelMaxHeight: f,
474
- resolvedPlacement: p,
475
- isPositionReady: m,
476
- referenceWidth: h,
477
- arrowStyles: O,
478
- isArrowOverflow: _,
479
- updatePosition: E
476
+ panelStyles: O,
477
+ panelMaxHeight: p,
478
+ resolvedPlacement: m,
479
+ isPositionReady: h,
480
+ referenceWidth: g,
481
+ arrowStyles: k,
482
+ isArrowOverflow: v,
483
+ updatePosition: D
480
484
  };
481
485
  };
482
486
  //#endregion
483
- export { d as i, V as n, f as r, ie as t };
487
+ export { d as a, f as i, H as n, p as r, ae as t };
@@ -0,0 +1 @@
1
+ let e=require("vue"),t=require("@vueuse/core");var n=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),r=function(e){return e.START=`start`,e.END=`end`,e.CENTER=`center`,e}({}),i=function(e){return e.TOP=`top`,e.TOP_START=`top-start`,e.TOP_END=`top-end`,e.BOTTOM=`bottom`,e.BOTTOM_START=`bottom-start`,e.BOTTOM_END=`bottom-end`,e.LEFT=`left`,e.LEFT_START=`left-start`,e.LEFT_END=`left-end`,e.RIGHT=`right`,e.RIGHT_START=`right-start`,e.RIGHT_END=`right-end`,e}({}),a=function(e){return e.CLIPPING_ANCESTORS=`clipping-ancestors`,e.VIEWPORT=`viewport`,e}({}),o=function(e){return e.PREFERRED=`preferred`,e.FLIP=`flip`,e.SHIFT=`shift`,e.SIZE=`size`,e}({}),s=e=>{switch(e){case i.TOP:return{side:n.TOP,align:r.CENTER};case i.TOP_START:return{side:n.TOP,align:r.START};case i.TOP_END:return{side:n.TOP,align:r.END};case i.BOTTOM:return{side:n.BOTTOM,align:r.CENTER};case i.BOTTOM_START:return{side:n.BOTTOM,align:r.START};case i.BOTTOM_END:return{side:n.BOTTOM,align:r.END};case i.LEFT:return{side:n.LEFT,align:r.CENTER};case i.LEFT_START:return{side:n.LEFT,align:r.START};case i.LEFT_END:return{side:n.LEFT,align:r.END};case i.RIGHT:return{side:n.RIGHT,align:r.CENTER};case i.RIGHT_START:return{side:n.RIGHT,align:r.START};case i.RIGHT_END:return{side:n.RIGHT,align:r.END};default:return e}},c=e=>e.side===n.TOP?e.align===r.START?i.TOP_START:e.align===r.END?i.TOP_END:i.TOP:e.side===n.BOTTOM?e.align===r.START?i.BOTTOM_START:e.align===r.END?i.BOTTOM_END:i.BOTTOM:e.side===n.LEFT?e.align===r.START?i.LEFT_START:e.align===r.END?i.LEFT_END:i.LEFT:e.align===r.START?i.RIGHT_START:e.align===r.END?i.RIGHT_END:i.RIGHT,l=(e,t,n)=>Math.min(Math.max(t,e),n),u=e=>e===n.TOP?`bottom`:e===n.BOTTOM?`top`:e===n.LEFT?`right`:`left`,d=({referenceCenter:e,floatingStart:t,floatingLength:n,crossAxisProperty:r,staticSide:i,staticOffset:a,arrowSize:o,arrowPadding:s})=>{let c=e-t-o/2,u=l(s,c,n-o-s),d=c-u;return{crossAxisPosition:u,crossAxisProperty:r,staticSide:i,staticOffset:a,centerOffset:d,isOverflow:Math.abs(d)>o/2}},f=e=>{let{referenceRect:t,floatingCoordinates:r,floatingSize:i,arrowSize:a,arrowPadding:o}=e,c=s(e.resolvedPlacement),l=u(c.side),f=-(a/2);return c.side===n.TOP||c.side===n.BOTTOM?d({referenceCenter:t.left+t.width/2,floatingStart:r.x,floatingLength:i.width,crossAxisProperty:`left`,staticSide:l,staticOffset:f,arrowSize:a,arrowPadding:o}):d({referenceCenter:t.top+t.height/2,floatingStart:r.y,floatingLength:i.height,crossAxisProperty:`top`,staticSide:l,staticOffset:f,arrowSize:a,arrowPadding:o})},p=(e,t,n)=>{let r=t.top+n,i=t.left+n,a=t.right-n,o=t.bottom-n;return{top:r-e.top,bottom:e.bottom-o,left:i-e.left,right:e.right-a}},m=(e,t)=>t===`top`?e.top>0:t===`bottom`?e.bottom>0:t===`left`?e.left>0:e.right>0,h=e=>e.top>0||e.bottom>0||e.left>0||e.right>0,g=(e,t)=>t===n.TOP||t===n.BOTTOM?e.left>0||e.right>0:e.top>0||e.bottom>0,_=(e,t)=>e.bottom>t.top&&e.top<t.bottom&&e.right>t.left&&e.left<t.right,v=(e,t)=>{let n=e.top+t,r=e.left+t,i=e.right-t,a=e.bottom-t;return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},y=e=>e.side===n.TOP?{...e,side:n.BOTTOM}:e.side===n.BOTTOM?{...e,side:n.TOP}:e.side===n.LEFT?{...e,side:n.RIGHT}:{...e,side:n.LEFT},b=(e,t,n)=>Math.min(Math.max(t,e),n),x=(e,t,n)=>e===`y`?{x:t.x,y:b(t.y+n.top,t.y,t.y-n.bottom)}:{x:b(t.x+n.left,t.x,t.x-n.right),y:t.y},S=e=>e===n.TOP||e===n.BOTTOM?{mainAxis:`x`,crossAxis:`y`}:{mainAxis:`y`,crossAxis:`x`},C=(e,t,n,i)=>i===r.START?e:i===r.END?e+t-n:e+(t-n)/2,w=(e,t,r,i)=>r.side===n.BOTTOM?{x:C(e.left,e.width,t.width,r.align),y:e.bottom+i}:r.side===n.TOP?{x:C(e.left,e.width,t.width,r.align),y:e.top-i-t.height}:r.side===n.LEFT?{x:e.left-i-t.width,y:C(e.top,e.height,t.height,r.align)}:{x:e.right+i,y:C(e.top,e.height,t.height,r.align)},T=(e,t)=>({top:e.y,left:e.x,right:e.x+t.width,bottom:e.y+t.height,width:t.width,height:t.height}),E=(e,t,n,r)=>e===`x`?{min:t.left+n,max:t.right-n-r.width}:{min:t.top+n,max:t.bottom-n-r.height},D=(e,t,n,r,i)=>t<=n?b(t,e,n):b(r,e,i),O=(e,t,n,r,i,a)=>{let{mainAxis:o}=S(t),{x:s,y:c}=e,l=E(o,i,a,r);if(o===`y`){let e=n.top-r.height,t=n.bottom,i=Math.max(l.min,e),a=Math.min(l.max,t);c=D(c,i,a,l.min,l.max)}else{let e=n.left-r.width,t=n.right,i=Math.max(l.min,e),a=Math.min(l.max,t);s=D(s,i,a,l.min,l.max)}return{x:s,y:c}},k=(e,t,n)=>{let{anchorSide:r,referenceRect:i,viewportRect:a,viewportPadding:o,mainAxis:s=!0,crossAxis:c=!1}=n,l=p(T(e,t),a,o),{mainAxis:u,crossAxis:d}=S(r),f={x:e.x,y:e.y};return s&&(f=x(u,f,l)),c&&(f=x(d,f,l)),O(f,r,i,t,a,o)},A=e=>e===n.TOP?`top`:e===n.BOTTOM?`bottom`:e===n.LEFT?`left`:`right`,j=(e,t,n)=>{let r=t.bottom-n;return Math.max(0,Math.floor(r-e.y))},M=e=>{let t=s(e.placement),n=e.flip?[t,y(t)]:[t],r={anchor:t,coordinates:w(e.referenceRect,e.floatingSize,t,e.offset),strategy:o.PREFERRED};for(let i of n){let n=w(e.referenceRect,e.floatingSize,i,e.offset);if(!m(p(T(n,e.floatingSize),e.viewportRect,e.viewportPadding),A(i.side)))return{anchor:i,coordinates:n,strategy:i===t?o.PREFERRED:o.FLIP};r={anchor:i,coordinates:n,strategy:o.FLIP}}return r},N=(e,t)=>!e.shift||!h(p(T(t.coordinates,e.floatingSize),e.viewportRect,e.viewportPadding))?t:{...t,coordinates:k(t.coordinates,e.floatingSize,{anchorSide:t.anchor.side,referenceRect:e.referenceRect,viewportRect:e.viewportRect,viewportPadding:e.viewportPadding}),strategy:o.SHIFT},P=(e,t)=>{if(!e.fitViewport)return{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0};let r=j(t.coordinates,e.viewportRect,e.viewportPadding),i=e.referenceRect.top-e.offset;if(t.anchor.side===n.TOP){let t=e.viewportRect.top+e.viewportPadding,n=Math.max(0,Math.floor(i-t));r=Math.min(r,n)}return r>=e.floatingSize.height?{coordinates:t.coordinates,strategy:t.strategy,maxHeight:void 0}:{coordinates:t.anchor.side===n.TOP?{...t.coordinates,y:i-r}:t.coordinates,strategy:o.SIZE,maxHeight:r}},F=e=>{let t=N(e,M(e)),n=P(e,t);return{x:n.coordinates.x,y:n.coordinates.y,resolvedPlacement:c(t.anchor),strategy:n.strategy,maxHeight:n.maxHeight}},I=()=>{let e=window.visualViewport;return e?{top:e.offsetTop,left:e.offsetLeft,right:e.offsetLeft+e.width,bottom:e.offsetTop+e.height,width:e.width,height:e.height}:{top:0,left:0,right:window.innerWidth,bottom:window.innerHeight,width:window.innerWidth,height:window.innerHeight}},L=e=>({top:e.top,left:e.left,right:e.right,bottom:e.bottom,width:e.width,height:e.height}),R=/auto|scroll|overlay|hidden|clip/,z=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>R.test(e))},B=(e,t)=>{let n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},V=e=>{let t=I();if(!e)return t;let n=e.parentElement;for(;n;)z(n)&&(t=B(t,n.getBoundingClientRect())),n=n.parentElement;return t},H=/auto|scroll|overlay/,U=e=>{let t=window.getComputedStyle(e);return[t.overflow,t.overflowX,t.overflowY].some(e=>H.test(e))},W=e=>{let t=[],n=e?.parentElement??null;for(;n;)U(n)&&t.push(n),n=n.parentElement;return t},G=e=>e?e instanceof HTMLElement?e:e.$el instanceof HTMLElement?e.$el:null:null,K=e=>{let t=e.trim();if(!t)return;let n=parseFloat(t);if(!Number.isNaN(n))return n},q=e=>{let t=getComputedStyle(e);return{arrowSize:K(t.getPropertyValue(`--s-ui-dropdown-arrow-size`))??12,arrowPadding:K(t.getPropertyValue(`--s-ui-dropdown-arrow-padding`))??8}},J=(e,t,n)=>{if(!n)return t;let r=e.firstElementChild;return r instanceof HTMLElement?Math.max(r.scrollHeight,t):Math.max(e.scrollHeight,t)},Y=(t,n)=>(0,e.toValue)(t??n),X=(e,t)=>e&&t instanceof HTMLElement?q(t):{arrowSize:12,arrowPadding:8},Z=(e,t,n,r,i,a,o)=>{let c=v(r,a),l=p(T({x:e.x,y:e.y},n),i,a),u=_(t,c),d=s(e.resolvedPlacement).side,f=o?!g(l,d):!h(l);return u&&f},Q=n=>{let r=(0,e.shallowRef)(null),o=(0,e.shallowRef)(void 0),s=(0,e.shallowRef)(i.BOTTOM_START),c=(0,e.shallowRef)(!1),l=(0,e.shallowRef)(0),u=(0,e.shallowRef)(null),d=(0,e.shallowRef)(!1),p=[],m=()=>{(0,e.toValue)(n.open)&&b()},h=()=>{for(let e of p)e();p=[]},g=()=>{h();let t=G((0,e.toValue)(n.reference));for(let e of W(t))e.addEventListener(`scroll`,m,{capture:!0,passive:!0}),p.push(()=>{e.removeEventListener(`scroll`,m,{capture:!0})})};(0,t.useEventListener)(window,`scroll`,m,{capture:!0}),(0,t.useEventListener)(document,`scroll`,m,{capture:!0}),(0,t.useEventListener)(()=>document.documentElement,`scroll`,m,{capture:!0}),(0,t.useEventListener)(()=>window.visualViewport??null,`scroll`,m,{passive:!0});let _=()=>({matchReferenceWidth:Y(n.matchReferenceWidth,!1),fitViewport:Y(n.fitViewport,!1),shift:Y(n.shift,!1),baseOffset:Y(n.offset,8),viewportPadding:Y(n.viewportPadding,8),hasArrow:Y(n.arrow,!1),placement:Y(n.placement,i.BOTTOM_START),flip:Y(n.flip,!0),boundary:Y(n.boundary,a.CLIPPING_ANCESTORS)}),v=(e,t)=>{if(!e){u.value=null,d.value=!1;return}let n=f({referenceRect:t.referenceRect,floatingCoordinates:{x:t.result.x,y:t.result.y},floatingSize:t.renderedFloatingSize,resolvedPlacement:t.result.resolvedPlacement,arrowSize:t.arrowSize,arrowPadding:t.arrowPadding});u.value=n,d.value=n.isOverflow},y=()=>{if(!(0,e.toValue)(n.open))return;let t=G((0,e.toValue)(n.reference)),i=(0,e.toValue)(n.panel);if(!t||!i)return;let u=_(),d=L(t.getBoundingClientRect()),f=L(i.getBoundingClientRect());l.value=Math.round(d.width);let p=i.firstElementChild,{arrowSize:m,arrowPadding:h}=X(u.hasArrow,p),g=u.hasArrow?u.baseOffset+m/2:u.baseOffset,y={width:u.matchReferenceWidth&&d.width>0?d.width:f.width,height:J(i,f.height,u.fitViewport)},b=V(t),x=u.boundary===a.VIEWPORT?I():b,S=F({referenceRect:d,floatingSize:y,placement:u.placement,offset:g,flip:u.flip,shift:u.shift,fitViewport:u.fitViewport,viewportRect:x,viewportPadding:u.viewportPadding});r.value={x:S.x,y:S.y},o.value=S.maxHeight,s.value=S.resolvedPlacement;let C={width:y.width,height:S.maxHeight??y.height};c.value=Z(S,d,C,b,x,u.viewportPadding,u.shift),v(u.hasArrow,{referenceRect:d,result:S,renderedFloatingSize:C,arrowSize:m,arrowPadding:h})},b=()=>{y()},x=(0,e.computed)(()=>{let t=(0,e.toValue)(n.matchReferenceWidth??!1);if(!(0,e.toValue)(n.open)||!r.value)return{position:`fixed`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`};let i={position:`fixed`,top:`0`,left:`0`,transform:`translate(${r.value.x}px, ${r.value.y}px)`,visibility:c.value?`visible`:`hidden`,pointerEvents:c.value?`auto`:`none`};if(t&&l.value>0){let e=`${Math.round(l.value)}px`;i.width=e,i.minWidth=e,i.maxWidth=e}return i}),S=(0,e.computed)(()=>{if(!(0,e.toValue)(n.open)||!(0,e.toValue)(n.arrow??!1)||!u.value)return;let t=u.value;return{[t.crossAxisProperty]:`${t.crossAxisPosition}px`}}),C=()=>{n.onOpenChange?.(!1)};return(0,e.watch)(()=>(0,e.toValue)(n.open),async t=>{if(t){c.value=!1,await(0,e.nextTick)(),g(),b();return}c.value=!1,r.value=null,o.value=void 0,u.value=null,d.value=!1,h()}),(0,e.watch)([()=>(0,e.toValue)(n.placement??i.BOTTOM_START),()=>(0,e.toValue)(n.offset??8),()=>(0,e.toValue)(n.flip??!0),()=>(0,e.toValue)(n.shift??!1),()=>(0,e.toValue)(n.matchReferenceWidth??!1),()=>(0,e.toValue)(n.fitViewport??!1),()=>(0,e.toValue)(n.viewportPadding??8),()=>(0,e.toValue)(n.arrow??!1),()=>(0,e.toValue)(n.boundary??a.CLIPPING_ANCESTORS)],async()=>{(0,e.toValue)(n.open)&&(c.value=!1,await(0,e.nextTick)(),b())}),(0,t.useResizeObserver)(()=>G((0,e.toValue)(n.reference)),()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useResizeObserver)(()=>(0,e.toValue)(n.panel),()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useEventListener)(window,`resize`,()=>{(0,e.toValue)(n.open)&&b()}),(0,t.useEventListener)(()=>window.visualViewport??null,`resize`,()=>{(0,e.toValue)(n.open)&&b()}),(0,t.onClickOutside)(()=>(0,e.toValue)(n.panel),()=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnClickOutside??!0)||C()},{ignore:[(0,e.computed)(()=>G((0,e.toValue)(n.reference))),`.s-ui-dropdown`,`.s-ui-dropdown__panel`]}),(0,t.useEventListener)(window,`keydown`,t=>{!(0,e.toValue)(n.open)||!(0,e.toValue)(n.dismissOnEscape??!0)||t.key===`Escape`&&C()}),(0,e.onScopeDispose)(()=>{h()}),{panelStyles:x,panelMaxHeight:o,resolvedPlacement:s,isPositionReady:c,referenceWidth:l,arrowStyles:S,isArrowOverflow:d,updatePosition:b}};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Q}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shtabapp/ui-kit",
3
- "version": "1.65.0",
3
+ "version": "1.66.0",
4
4
  "description": "Vue 3 component library by Shtab — 30+ typed components, design tokens, light/dark themes",
5
5
  "keywords": [
6
6
  "shtab",