@leaflink/stash 53.4.6 → 53.4.7

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 (47) hide show
  1. package/dist/AppSidebar.js +43 -41
  2. package/dist/AppSidebar.js.map +1 -1
  3. package/dist/AppTopbar.js +1 -1
  4. package/dist/Copy.js +1 -1
  5. package/dist/DataViewFilters.js +1 -1
  6. package/dist/DataViewFilters.js.map +1 -1
  7. package/dist/DataViewToolbar.js +139 -125
  8. package/dist/DataViewToolbar.js.map +1 -1
  9. package/dist/DatePicker.js +1114 -1113
  10. package/dist/DatePicker.js.map +1 -1
  11. package/dist/Modal.js +104 -90
  12. package/dist/Modal.js.map +1 -1
  13. package/dist/MoreActions.js +294 -288
  14. package/dist/MoreActions.js.map +1 -1
  15. package/dist/PageNavigation.js +1 -1
  16. package/dist/RadioGroup.js +69 -62
  17. package/dist/RadioGroup.js.map +1 -1
  18. package/dist/Select.js +90 -90
  19. package/dist/Select.js.map +1 -1
  20. package/dist/Stepper.js +1 -1
  21. package/dist/Tab.js +1 -1
  22. package/dist/Table.js +1 -1
  23. package/dist/Tabs.js +2 -2
  24. package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js +131 -0
  25. package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js.map +1 -0
  26. package/dist/Thumbnail.js +42 -42
  27. package/dist/Thumbnail.js.map +1 -1
  28. package/dist/Toast.vue.d.ts +1 -1
  29. package/dist/Tooltip.js +1 -1
  30. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js} +2 -2
  31. package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js.map → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js.map} +1 -1
  32. package/dist/components.css +1 -1
  33. package/dist/getContrastingTextColor.d.ts +8 -0
  34. package/dist/index-t9tXBnql.js +469 -0
  35. package/dist/{index-DA70nQCT.js.map → index-t9tXBnql.js.map} +1 -1
  36. package/dist/templateRefNarrowing-CeANDylX.js +22 -0
  37. package/dist/templateRefNarrowing-CeANDylX.js.map +1 -0
  38. package/dist/useMediaQuery.d.ts +12 -10
  39. package/dist/useMediaQuery.js +7 -29
  40. package/dist/useMediaQuery.js.map +1 -1
  41. package/dist/useSortable.js +1 -1
  42. package/dist/utils/getContrastingTextColor.js +36 -24
  43. package/dist/utils/getContrastingTextColor.js.map +1 -1
  44. package/package.json +1 -1
  45. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js +0 -130
  46. package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js.map +0 -1
  47. package/dist/index-DA70nQCT.js +0 -424
@@ -1,442 +1,448 @@
1
- import { ref as T, onUnmounted as se, nextTick as V, onMounted as ue, onUpdated as re, onDeactivated as ce, onBeforeUnmount as oe, watch as X, defineComponent as de, useSlots as fe, computed as W, useTemplateRef as U, createElementBlock as ve, openBlock as H, normalizeStyle as z, createBlock as Y, createElementVNode as ee, createCommentVNode as me, resolveDynamicComponent as he, normalizeClass as te, unref as C, withCtx as P, renderSlot as G, createVNode as le, createTextVNode as pe, toDisplayString as ge } from "vue";
2
- import Ae from "lodash-es/uniqueId";
3
- import { e as K, f as Ie, c as Te, d as be } from "./index-DA70nQCT.js";
4
- import { DEBOUNCE as k } from "./constants.js";
5
- import { t as Oe } from "./locale.js";
6
- import ye from "./Button.js";
7
- import Ee from "./Dropdown.js";
8
- import we from "./Icon.js";
9
- import Z from "lodash-es/debounce";
10
- import { _ as Se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
- function _e(e = {}) {
12
- const { duration: t = 300, initialVisible: a = !1 } = e, [n, l] = K(a), [o, i] = K(a), [s, d] = K(!1), c = T(null);
1
+ import { ref as O, onUnmounted as ce, computed as B, nextTick as $, onMounted as de, onUpdated as fe, onDeactivated as ve, onBeforeUnmount as se, watch as G, defineComponent as me, useSlots as he, useTemplateRef as P, createElementBlock as pe, openBlock as Z, normalizeStyle as j, createBlock as ne, createElementVNode as oe, createCommentVNode as ge, resolveDynamicComponent as Ae, normalizeClass as ie, unref as R, withCtx as H, renderSlot as J, createVNode as ae, createTextVNode as Ie, toDisplayString as Te } from "vue";
2
+ import Ee from "lodash-es/uniqueId";
3
+ import { g as Q, h as be, e as Oe, f as we } from "./index-t9tXBnql.js";
4
+ import { DEBOUNCE as F } from "./constants.js";
5
+ import { t as ye } from "./locale.js";
6
+ import Se from "./Button.js";
7
+ import Ce from "./Dropdown.js";
8
+ import _e from "./Icon.js";
9
+ import Y from "lodash-es/debounce";
10
+ import { t as p, i as De } from "./templateRefNarrowing-CeANDylX.js";
11
+ import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ function Me(t = {}) {
13
+ const { duration: e = 300, initialVisible: a = !1 } = t, [o, n] = Q(a), [i, l] = Q(a), [s, d] = Q(!1), r = O(null);
13
14
  function g() {
14
- c.value !== null && (clearTimeout(c.value), c.value = null);
15
+ r.value !== null && (clearTimeout(r.value), r.value = null);
15
16
  }
16
- function v(r) {
17
- g(), n.value !== r && l(), o.value !== r && i(), s.value && d();
17
+ function m(f) {
18
+ g(), o.value !== f && n(), i.value !== f && l(), s.value && d();
18
19
  }
19
- function A(r) {
20
- g(), r ? (n.value || l(), o.value || i(), s.value && d()) : (o.value && i(), s.value || d(), c.value = setTimeout(() => {
21
- n.value && l(), s.value && d(), c.value = null;
22
- }, t));
20
+ function A(f) {
21
+ g(), f ? (o.value || n(), i.value || l(), s.value && d()) : (i.value && l(), s.value || d(), r.value = setTimeout(() => {
22
+ o.value && n(), s.value && d(), r.value = null;
23
+ }, e));
23
24
  }
24
- function I() {
25
+ function b() {
25
26
  A(!0);
26
27
  }
27
- function h() {
28
+ function w() {
28
29
  A(!1);
29
30
  }
30
31
  function u() {
31
32
  g();
32
33
  }
33
- return se(() => {
34
+ return ce(() => {
34
35
  u();
35
36
  }), {
36
- isVisible: n,
37
- shouldShow: o,
37
+ isVisible: o,
38
+ shouldShow: i,
38
39
  shouldHide: s,
39
40
  toggle: A,
40
- show: I,
41
- hide: h,
42
- setVisible: v,
41
+ show: b,
42
+ hide: w,
43
+ setVisible: m,
43
44
  cleanup: u
44
45
  };
45
46
  }
46
- const De = {
47
+ const Re = {
47
48
  TRACKER: -1,
48
49
  DROPDOWN: 1e3
49
- }, Q = {
50
+ }, te = {
50
51
  AUTO_ACTION: "auto-action-",
51
52
  INDEX_BASED: "index-",
52
53
  MORE_MENU: "more-actions-menu-"
53
- }, p = {
54
+ }, E = {
54
55
  ACTION_ID: "data-action-id",
55
56
  PROCESSED: "data-more-actions-processed"
56
- }, ae = 300, L = /* @__PURE__ */ new WeakMap();
57
- function j(e) {
58
- if (!e)
57
+ }, re = 300, X = /* @__PURE__ */ new WeakMap();
58
+ function q(t) {
59
+ if (!t)
59
60
  return;
60
- const t = Array.from(e.children), a = /* @__PURE__ */ new Set();
61
- t.forEach((l) => {
62
- const o = l.getAttribute(p.ACTION_ID);
63
- o && a.add(o);
61
+ const e = Array.from(t.children), a = /* @__PURE__ */ new Set();
62
+ e.forEach((n) => {
63
+ const i = n.getAttribute(E.ACTION_ID);
64
+ i && a.add(i);
64
65
  });
65
- let n = 0;
66
- for (; a.has(`auto-action-${n}`); )
67
- n++;
68
- t.forEach((l) => {
69
- l.hasAttribute(p.ACTION_ID) || (l.setAttribute(p.ACTION_ID, `${Q.AUTO_ACTION}${n}`), n++);
66
+ let o = 0;
67
+ for (; a.has(`auto-action-${o}`); )
68
+ o++;
69
+ e.forEach((n) => {
70
+ n.hasAttribute(E.ACTION_ID) || (n.setAttribute(E.ACTION_ID, `${te.AUTO_ACTION}${o}`), o++);
70
71
  });
71
72
  }
72
- function ie(e) {
73
- const t = /* @__PURE__ */ new Map();
74
- return e.forEach((a, n) => {
75
- const l = a.getAttribute(p.ACTION_ID);
76
- l ? t.set(a, l) : t.set(a, `${Q.INDEX_BASED}${n}`);
77
- }), t;
73
+ function ue(t) {
74
+ const e = /* @__PURE__ */ new Map();
75
+ return t.forEach((a, o) => {
76
+ const n = a.getAttribute(E.ACTION_ID);
77
+ n ? e.set(a, n) : e.set(a, `${te.INDEX_BASED}${o}`);
78
+ }), e;
78
79
  }
79
- function Be(e, t) {
80
+ function Ne(t, e) {
80
81
  const a = [];
81
- e.forEach((n) => {
82
- t.has(n) || a.push(n);
83
- }), a.forEach((n) => {
84
- e.delete(n);
82
+ t.forEach((o) => {
83
+ e.has(o) || a.push(o);
84
+ }), a.forEach((o) => {
85
+ t.delete(o);
85
86
  });
86
87
  }
87
- function ne(e, t, a) {
88
- const n = L.get(e);
89
- if (n && (clearTimeout(n), L.delete(e)), a.has(t))
90
- e.removeAttribute(p.PROCESSED), e.classList.add("invisible");
88
+ function le(t, e, a) {
89
+ const o = X.get(t);
90
+ if (o && (clearTimeout(o), X.delete(t)), a.has(e))
91
+ t.removeAttribute(E.PROCESSED), t.classList.add("invisible");
91
92
  else {
92
- const l = setTimeout(() => {
93
- e.isConnected && e.setAttribute(p.PROCESSED, "true"), L.delete(e);
94
- }, k.FAST);
95
- L.set(e, l), e.classList.remove("invisible");
93
+ const n = setTimeout(() => {
94
+ t.isConnected && t.setAttribute(E.PROCESSED, "true"), X.delete(t);
95
+ }, F.FAST);
96
+ X.set(t, n), t.classList.remove("invisible");
96
97
  }
97
98
  }
98
- function J(e, t) {
99
- if (!e)
99
+ function ee(t, e) {
100
+ if (!t)
100
101
  return;
101
102
  Array.from(
102
- e.querySelectorAll(`[${p.ACTION_ID}]`)
103
- ).filter((l) => l.querySelectorAll(`[${p.ACTION_ID}]`).length === 0).forEach((l) => {
104
- const o = l.getAttribute(p.ACTION_ID);
105
- o && t.has(o) ? l.classList.remove("hidden") : l.classList.add("hidden");
103
+ t.querySelectorAll(`[${E.ACTION_ID}]`)
104
+ ).filter((n) => n.querySelectorAll(`[${E.ACTION_ID}]`).length === 0).forEach((n) => {
105
+ const i = n.getAttribute(E.ACTION_ID);
106
+ i && e.has(i) ? n.classList.remove("hidden") : n.classList.add("hidden");
106
107
  });
107
108
  }
108
- function Ce({
109
- actionsContainerRef: e,
110
- overflowIds: t,
109
+ function xe({
110
+ actionsContainerRef: t,
111
+ overflowIds: e,
111
112
  moreDropdownMenuRef: a,
112
- trackerElementRef: n,
113
- onOverflowChange: l
113
+ trackerElementRef: o,
114
+ onOverflowChange: n
114
115
  }) {
115
- const o = T(!1), i = T(""), s = Ie(n);
116
- function d(h, u, r) {
117
- t.value.clear(), h.forEach((f) => t.value.add(f)), u.forEach((f) => {
118
- const m = r.get(f) || f.getAttribute(p.ACTION_ID) || void 0;
119
- m && ne(f, m, t.value);
116
+ const i = O(!1), l = O(""), s = B(() => p(o.value)), d = be(s);
117
+ function r(u, f, I) {
118
+ e.value.clear(), u.forEach((v) => e.value.add(v)), f.forEach((v) => {
119
+ const h = I.get(v) || v.getAttribute(E.ACTION_ID) || void 0;
120
+ h && le(v, h, e.value);
120
121
  });
121
122
  }
122
- function c() {
123
- if (!e.value || !n.value) {
124
- o.value = !1;
123
+ function g() {
124
+ const u = p(t.value), f = p(o.value);
125
+ if (!u || !f) {
126
+ i.value = !1;
125
127
  return;
126
128
  }
127
- const h = Array.from(e.value.children), u = ie(h), r = /* @__PURE__ */ new Set(), f = window.getComputedStyle(e.value), m = f.columnGap || f.gap, O = m ? parseFloat(m) : 0;
128
- h.forEach((_, E) => {
129
- const y = u.get(_) || _.getAttribute(p.ACTION_ID) || void 0, w = _.getBoundingClientRect();
130
- (E < h.length - 1 ? w.right + O : w.right) > s.left.value && y && r.add(y);
129
+ const I = Array.from(u.children).filter((c) => c instanceof HTMLElement), v = ue(I), h = /* @__PURE__ */ new Set(), S = window.getComputedStyle(u), D = S.columnGap || S.gap, W = D ? parseFloat(D) : 0;
130
+ I.forEach((c, C) => {
131
+ const _ = v.get(c) || c.getAttribute(E.ACTION_ID) || void 0, T = c.getBoundingClientRect();
132
+ (C < I.length - 1 ? T.right + W : T.right) > d.left.value && _ && h.add(_);
131
133
  });
132
- const S = Array.from(t.value).sort().join(","), B = Array.from(r).sort().join(",");
133
- S !== B && (d(r, h, u), J(a.value, t.value), l && i.value !== B && (i.value = B, V(() => {
134
- l();
135
- }))), o.value = !1;
136
- }
137
- const g = Z(c, k.FAST);
138
- function v() {
139
- o.value || !e.value || !n.value || (o.value = !0, g());
134
+ const M = Array.from(e.value).sort().join(","), y = Array.from(h).sort().join(",");
135
+ M !== y && (r(h, I, v), ee(p(a.value), e.value), n && l.value !== y && (l.value = y, $(() => {
136
+ n();
137
+ }))), i.value = !1;
140
138
  }
139
+ const m = Y(g, F.FAST);
141
140
  function A() {
142
- s.update();
141
+ i.value || !p(t.value) || !p(o.value) || (i.value = !0, m());
143
142
  }
144
- function I() {
145
- g.cancel(), o.value = !1;
143
+ function b() {
144
+ d.update();
145
+ }
146
+ function w() {
147
+ m.cancel(), i.value = !1;
146
148
  }
147
149
  return {
148
- calculateOverflow: v,
149
- applyElementVisibility: ne,
150
- updateOverflowState: d,
151
- updateTrackerBounding: A,
152
- cleanup: I,
153
- isProcessing: o
150
+ calculateOverflow: A,
151
+ applyElementVisibility: le,
152
+ updateOverflowState: r,
153
+ updateTrackerBounding: b,
154
+ cleanup: w,
155
+ isProcessing: i
154
156
  };
155
157
  }
156
- function Me({
157
- actionsContainerRef: e,
158
- overflowIds: t,
158
+ function We({
159
+ actionsContainerRef: t,
160
+ overflowIds: e,
159
161
  moreDropdownMenuRef: a,
160
- trackerElementRef: n,
161
- moreDropdownWidth: l,
162
- calculateMoreButtonWidth: o,
163
- hasMoreActionsSlot: i,
162
+ trackerElementRef: o,
163
+ moreDropdownWidth: n,
164
+ calculateMoreButtonWidth: i,
165
+ hasMoreActionsSlot: l,
164
166
  onOverflowChange: s
165
167
  }) {
166
- const d = T(!1), {
167
- calculateOverflow: c,
168
+ const d = O(!1), {
169
+ calculateOverflow: r,
168
170
  applyElementVisibility: g,
169
- updateOverflowState: v,
171
+ updateOverflowState: m,
170
172
  updateTrackerBounding: A,
171
- cleanup: I,
172
- isProcessing: h
173
- } = Ce({
174
- actionsContainerRef: e,
175
- overflowIds: t,
173
+ cleanup: b,
174
+ isProcessing: w
175
+ } = xe({
176
+ actionsContainerRef: t,
177
+ overflowIds: e,
176
178
  moreDropdownMenuRef: a,
177
- trackerElementRef: n,
179
+ trackerElementRef: o,
178
180
  onOverflowChange: s
179
181
  });
180
- let u = null, r = null, f = null;
181
- function m() {
182
- t.value.clear(), l.value = 0;
182
+ let u = null, f = null, I = null;
183
+ function v() {
184
+ e.value.clear(), n.value = 0;
183
185
  }
184
- function O() {
185
- r && (r(), r = null), f && (f(), f = null);
186
+ function h() {
187
+ f && (f(), f = null), I && (I(), I = null);
186
188
  }
187
- const S = Z(
189
+ const S = B(() => p(t.value)), D = Y(
188
190
  () => {
189
- !e.value || !i.value || (j(e.value), O(), I(), E());
191
+ const c = p(t.value);
192
+ !c || !l.value || (q(c), h(), b(), y());
190
193
  },
191
- k.FAST,
194
+ F.FAST,
192
195
  { leading: !1, trailing: !0 }
193
196
  );
194
- function B() {
195
- if (!e.value || !i.value)
196
- return;
197
- const y = Array.from(e.value.children), w = ie(y), $ = new Set(w.values());
198
- Be(t.value, $);
199
- const { stop: q } = Te(e, () => {
200
- A(), c();
197
+ function W() {
198
+ const c = p(t.value);
199
+ if (!c || !l.value) return;
200
+ const C = Array.from(c.children), _ = ue(C), T = new Set(_.values());
201
+ Ne(e.value, T);
202
+ const { stop: K } = Oe(S, () => {
203
+ A(), r();
201
204
  });
202
- r = q;
203
- const { stop: b } = be(
204
- y,
205
- (M) => {
206
- if (h.value)
205
+ f = K;
206
+ const { stop: U } = we(
207
+ C,
208
+ (V) => {
209
+ if (w.value)
207
210
  return;
208
- let D = !1;
209
- const N = new Set(t.value);
210
- if (M.forEach((R) => {
211
- const F = R.target, x = w.get(F) || F.getAttribute(p.ACTION_ID) || void 0;
212
- R.intersectionRatio === 1 ? x && N.has(x) && (N.delete(x), D = !0) : x && !N.has(x) && (N.add(x), D = !0);
213
- }), D) {
214
- const R = Array.from(t.value).sort().join(","), F = Array.from(N).sort().join(",");
215
- R !== F && (v(N, y, w), J(a.value, t.value), s && V(() => {
211
+ let k = !1;
212
+ const N = new Set(e.value);
213
+ if (V.forEach((z) => {
214
+ const L = z.target, x = _.get(L) || L.getAttribute(E.ACTION_ID) || void 0;
215
+ z.intersectionRatio === 1 ? x && N.has(x) && (N.delete(x), k = !0) : x && !N.has(x) && (N.add(x), k = !0);
216
+ }), k) {
217
+ const z = Array.from(e.value).sort().join(","), L = Array.from(N).sort().join(",");
218
+ z !== L && (m(N, C, _), ee(p(a.value), e.value), s && $(() => {
216
219
  s();
217
220
  }));
218
221
  }
219
222
  },
220
- {
221
- root: e.value
222
- }
223
+ { root: c }
223
224
  );
224
- f = b, y.forEach((M) => {
225
- const D = w.get(M) || M.getAttribute(p.ACTION_ID) || "";
226
- g(M, D, t.value);
227
- }), c(), J(a.value, t.value);
225
+ I = U, C.forEach((V) => {
226
+ const k = _.get(V) || V.getAttribute(E.ACTION_ID) || "";
227
+ g(V, k, e.value);
228
+ }), r(), ee(p(a.value), e.value);
228
229
  }
229
- function _() {
230
- e.value && i.value && (j(e.value), B(), l.value === 0 && (l.value = o()), !u && e.value && (u = new MutationObserver(S), u.observe(e.value, {
230
+ function M() {
231
+ const c = p(t.value);
232
+ c && l.value && (q(c), W(), n.value === 0 && (n.value = i()), u || (u = new MutationObserver(D), u.observe(c, {
231
233
  childList: !0,
232
234
  // Watch for added/removed children
233
235
  subtree: !1
234
236
  // Only watch direct children
235
237
  })));
236
238
  }
237
- const E = Z(
239
+ const y = Y(
238
240
  () => {
239
- d.value || (d.value = !0, _(), d.value = !1);
241
+ d.value || (d.value = !0, M(), d.value = !1);
240
242
  },
241
- k.FAST,
243
+ F.FAST,
242
244
  { leading: !0 }
243
245
  );
244
- ue(() => {
245
- i.value && (j(e.value), _());
246
- }), re(() => {
247
- i.value && (j(e.value), e.value && Array.from(e.value.children).length === 0 && m(), O(), I(), E());
248
- }), ce(() => {
249
- O(), I(), S.cancel(), E.cancel(), u && (u.disconnect(), u = null);
250
- }), oe(() => {
251
- O(), I(), S.cancel(), E.cancel(), u && (u.disconnect(), u = null);
246
+ de(() => {
247
+ l.value && (q(p(t.value)), M());
248
+ }), fe(() => {
249
+ if (!l.value) return;
250
+ const c = p(t.value);
251
+ q(c), c && Array.from(c.children).length === 0 && v(), h(), b(), y();
252
+ }), ve(() => {
253
+ h(), b(), D.cancel(), y.cancel(), u && (u.disconnect(), u = null);
254
+ }), se(() => {
255
+ h(), b(), D.cancel(), y.cancel(), u && (u.disconnect(), u = null);
252
256
  });
253
257
  }
254
- function Ne({
255
- moreDropdownRef: e,
256
- actionsContainerRef: t,
258
+ function Ve({
259
+ moreDropdownRef: t,
260
+ actionsContainerRef: e,
257
261
  moreButtonAlign: a,
258
- hasOverflowActions: n
262
+ hasOverflowActions: o
259
263
  }) {
260
- const l = () => {
261
- var s;
262
- if (!((s = e.value) != null && s.$el))
263
- return 0;
264
- const i = e.value.$el.getBoundingClientRect().width;
265
- if (a === "separate" && t.value) {
266
- const d = window.getComputedStyle(t.value), c = parseFloat(d.gap) || 0;
267
- return i + c;
264
+ const n = () => {
265
+ const l = t.value;
266
+ if (!De(l)) return 0;
267
+ const s = l.$el.getBoundingClientRect().width;
268
+ if (a === "separate") {
269
+ const d = p(e.value);
270
+ if (!d) return s;
271
+ const r = window.getComputedStyle(d), g = parseFloat(r.gap) || 0;
272
+ return s + g;
268
273
  }
269
- return i;
270
- }, o = T(0);
271
- return X(n, (i) => {
272
- i && e.value && V(() => {
273
- const s = l();
274
- s > 0 && (o.value = s);
274
+ return s;
275
+ }, i = O(0);
276
+ return G(o, (l) => {
277
+ l && t.value && $(() => {
278
+ const s = n();
279
+ s > 0 && (i.value = s);
275
280
  });
276
281
  }), {
277
- calculateMoreButtonWidth: l,
278
- moreButtonWidth: o
282
+ calculateMoreButtonWidth: n,
283
+ moreButtonWidth: i
279
284
  };
280
285
  }
281
- function xe({ actionsContainerRef: e, overflowIds: t }) {
282
- const a = T(0), n = T(!1), l = T(!1);
283
- let o = null;
284
- const i = () => {
285
- if (!e.value) {
286
+ function ke({ actionsContainerRef: t, overflowIds: e }) {
287
+ const a = O(0), o = O(!1), n = O(!1);
288
+ let i = null;
289
+ const l = () => {
290
+ const r = p(t.value);
291
+ if (!r) {
286
292
  a.value = 0;
287
293
  return;
288
294
  }
289
- let c = 0;
290
- const g = Array.from(e.value.children);
291
- g.forEach((v, A) => {
292
- const I = v.getAttribute(p.ACTION_ID), h = !I || !t.value.has(I), u = v.classList.contains("invisible");
293
- if (h && !u) {
294
- const r = v.getBoundingClientRect();
295
- if (c += r.width, A < g.length - 1 && e.value) {
296
- const f = window.getComputedStyle(e.value), m = f.columnGap || f.gap, O = m ? parseFloat(m) : 0;
297
- c += O;
295
+ let g = 0;
296
+ const m = Array.from(r.children);
297
+ m.forEach((A, b) => {
298
+ const w = A.getAttribute(E.ACTION_ID), u = !w || !e.value.has(w), f = A.classList.contains("invisible");
299
+ if (u && !f) {
300
+ const I = A.getBoundingClientRect();
301
+ if (g += I.width, b < m.length - 1 && r) {
302
+ const v = window.getComputedStyle(r), h = v.columnGap || v.gap, S = h ? parseFloat(h) : 0;
303
+ g += S;
298
304
  }
299
305
  }
300
- }), a.value = c;
306
+ }), a.value = g;
301
307
  }, s = () => {
302
- l.value = !0, o && clearTimeout(o), o = setTimeout(() => {
303
- n.value || (n.value = !0, V(() => {
304
- V(() => {
305
- i(), n.value = !1, l.value = !1;
308
+ n.value = !0, i && clearTimeout(i), i = setTimeout(() => {
309
+ o.value || (o.value = !0, $(() => {
310
+ $(() => {
311
+ l(), o.value = !1, n.value = !1;
306
312
  });
307
313
  }));
308
- }, ae + 100);
314
+ }, re + 100);
309
315
  };
310
- return X(t, () => {
316
+ return G(e, () => {
311
317
  s();
312
318
  }), {
313
319
  visibleElementsWidth: a,
314
- isRecalculatingWidth: n,
315
- isRecalculatingWithDelay: l,
316
- calculateVisibleElementsWidth: i,
320
+ isRecalculatingWidth: o,
321
+ isRecalculatingWithDelay: n,
322
+ calculateVisibleElementsWidth: l,
317
323
  calculateVisibleElementsWidthDelayed: s,
318
324
  cleanup: () => {
319
- o && (clearTimeout(o), o = null), l.value = !1;
325
+ i && (clearTimeout(i), i = null), n.value = !1;
320
326
  }
321
327
  };
322
328
  }
323
- const We = ["id"], Ve = /* @__PURE__ */ de({
329
+ const $e = ["id"], Fe = /* @__PURE__ */ me({
324
330
  __name: "MoreActions",
325
331
  props: {
326
332
  actionsContainerClass: { default: void 0 },
327
333
  actionsContainerTag: { default: "div" },
328
- moreButtonText: { default: () => Oe("ll.more") },
334
+ moreButtonText: { default: () => ye("ll.more") },
329
335
  width: { default: void 0 },
330
336
  dropdownMode: { default: "default" },
331
337
  moreButtonAlign: { default: "separate" }
332
338
  },
333
- setup(e) {
334
- const t = e, a = fe(), n = W(() => !!a["more-actions"]), l = U("actionsContainerRef"), o = U("moreDropdownRef"), i = U("moreDropdownMenuRef"), s = U("trackerElementRef"), d = T(/* @__PURE__ */ new Set()), c = T(!1), g = Ae(Q.MORE_MENU), v = T(null), A = T(!1), {
335
- isVisible: I,
336
- shouldShow: h,
339
+ setup(t) {
340
+ const e = t, a = he(), o = B(() => !!a["more-actions"]), n = P("actionsContainerRef"), i = P("moreDropdownRef"), l = P("moreDropdownMenuRef"), s = P("trackerElementRef"), d = O(/* @__PURE__ */ new Set()), r = O(!1), g = Ee(te.MORE_MENU), m = O(null), A = O(!1), {
341
+ isVisible: b,
342
+ shouldShow: w,
337
343
  toggle: u
338
- } = _e({
339
- duration: ae,
344
+ } = Me({
345
+ duration: re,
340
346
  initialVisible: !1
341
- }), r = W(() => d.value.size > 0), { calculateMoreButtonWidth: f, moreButtonWidth: m } = Ne({
342
- moreDropdownRef: o,
343
- actionsContainerRef: l,
344
- moreButtonAlign: t.moreButtonAlign,
345
- hasOverflowActions: r
347
+ }), f = B(() => d.value.size > 0), { calculateMoreButtonWidth: I, moreButtonWidth: v } = Ve({
348
+ moreDropdownRef: i,
349
+ actionsContainerRef: n,
350
+ moreButtonAlign: e.moreButtonAlign,
351
+ hasOverflowActions: f
346
352
  }), {
347
- visibleElementsWidth: O,
353
+ visibleElementsWidth: h,
348
354
  isRecalculatingWithDelay: S,
349
- calculateVisibleElementsWidthDelayed: B,
350
- cleanup: _
351
- } = xe({
352
- actionsContainerRef: l,
355
+ calculateVisibleElementsWidthDelayed: D,
356
+ cleanup: W
357
+ } = ke({
358
+ actionsContainerRef: n,
353
359
  overflowIds: d
354
- }), E = W(() => n.value && r.value && !S.value && A.value), y = W(() => c.value.toString()), w = W(() => E.value ? `calc(100% - ${m.value}px)` : "100%"), $ = W(() => t.moreButtonAlign === "together" ? { left: `${O.value}px`, right: "auto" } : { right: "0", left: "auto" });
355
- Me({
356
- actionsContainerRef: l,
360
+ }), M = B(() => o.value && f.value && !S.value && A.value), y = B(() => r.value.toString()), c = B(() => M.value ? `calc(100% - ${v.value}px)` : "100%"), C = B(() => e.moreButtonAlign === "together" ? { left: `${h.value}px`, right: "auto" } : { right: "0", left: "auto" });
361
+ We({
362
+ actionsContainerRef: n,
357
363
  overflowIds: d,
358
- moreDropdownMenuRef: i,
364
+ moreDropdownMenuRef: l,
359
365
  trackerElementRef: s,
360
- moreDropdownWidth: m,
361
- calculateMoreButtonWidth: f,
362
- hasMoreActionsSlot: n,
363
- onOverflowChange: B
364
- }), X(
365
- () => n.value && r.value && !S.value,
366
- (b) => {
367
- v.value && (clearTimeout(v.value), v.value = null), b ? v.value = setTimeout(() => {
366
+ moreDropdownWidth: v,
367
+ calculateMoreButtonWidth: I,
368
+ hasMoreActionsSlot: o,
369
+ onOverflowChange: D
370
+ }), G(
371
+ () => o.value && f.value && !S.value,
372
+ (T) => {
373
+ m.value && (clearTimeout(m.value), m.value = null), T ? m.value = setTimeout(() => {
368
374
  A.value = !0;
369
- }, k.FAST) : A.value = !1;
375
+ }, F.FAST) : A.value = !1;
370
376
  }
371
- ), X(E, (b) => {
372
- u(b);
377
+ ), G(M, (T) => {
378
+ u(T);
373
379
  });
374
- function q(b) {
375
- c.value = b;
380
+ function _(T) {
381
+ r.value = T;
376
382
  }
377
- return oe(() => {
378
- _(), v.value && clearTimeout(v.value);
379
- }), (b, M) => (H(), ve("div", {
383
+ return se(() => {
384
+ W(), m.value && clearTimeout(m.value);
385
+ }), (T, K) => (Z(), pe("div", {
380
386
  class: "stash-more-actions relative overflow-x-hidden",
381
387
  "data-test": "stash-more-actions",
382
- style: z({ width: t.width })
388
+ style: j({ width: e.width })
383
389
  }, [
384
- (H(), Y(he(t.actionsContainerTag), {
390
+ (Z(), ne(Ae(e.actionsContainerTag), {
385
391
  ref_key: "actionsContainerRef",
386
- ref: l,
392
+ ref: n,
387
393
  "data-test": "stash-more-actions__container",
388
- style: z({
389
- width: w.value,
390
- minWidth: C(m) ? `${C(m)}px` : void 0
394
+ style: j({
395
+ width: c.value,
396
+ minWidth: R(v) ? `${R(v)}px` : void 0
391
397
  }),
392
- class: te(["stash-more-actions__container flex items-center gap-2 overflow-x-hidden", t.actionsContainerClass])
398
+ class: ie(["stash-more-actions__container flex items-center gap-2 overflow-x-hidden", e.actionsContainerClass])
393
399
  }, {
394
- default: P(() => [
395
- G(b.$slots, "default")
400
+ default: H(() => [
401
+ J(T.$slots, "default")
396
402
  ]),
397
403
  _: 3
398
404
  }, 8, ["style", "class"])),
399
- ee("div", {
405
+ oe("div", {
400
406
  ref_key: "trackerElementRef",
401
407
  ref: s,
402
408
  class: "stash-more-actions__tracker",
403
- style: z({
409
+ style: j({
404
410
  position: "absolute",
405
411
  right: "0px",
406
412
  top: "0",
407
413
  visibility: "hidden",
408
- width: C(m) + "px",
414
+ width: R(v) + "px",
409
415
  height: "100%",
410
416
  pointerEvents: "none",
411
- zIndex: C(De).TRACKER
417
+ zIndex: R(Re).TRACKER
412
418
  })
413
419
  }, null, 4),
414
- n.value ? (H(), Y(Ee, {
420
+ o.value ? (Z(), ne(Ce, {
415
421
  key: 0,
416
422
  ref_key: "moreDropdownRef",
417
- ref: o,
418
- class: te([
423
+ ref: i,
424
+ class: ie([
419
425
  "!absolute top-0",
420
- C(h) ? "animate-fade-in" : "animate-fade-out",
421
- { invisible: !C(I) }
426
+ R(w) ? "animate-fade-in" : "animate-fade-out",
427
+ { invisible: !R(b) }
422
428
  ]),
423
- style: z($.value),
424
- onToggle: q
429
+ style: j(C.value),
430
+ onToggle: _
425
431
  }, {
426
- toggle: P(({ toggle: D }) => [
427
- G(b.$slots, "toggle", {
428
- toggle: D,
429
- isOpen: c.value
432
+ toggle: H(({ toggle: U }) => [
433
+ J(T.$slots, "toggle", {
434
+ toggle: U,
435
+ isOpen: r.value
430
436
  }, () => [
431
- le(ye, {
437
+ ae(Se, {
432
438
  class: "button -border-gray-500 text-gray-500 flex w-full items-center justify-between -border",
433
439
  secondary: "",
434
440
  "aria-expanded": y.value,
435
- onClick: D
441
+ onClick: U
436
442
  }, {
437
- default: P(() => [
438
- pe(ge(t.moreButtonText) + " ", 1),
439
- le(we, {
443
+ default: H(() => [
444
+ Ie(Te(e.moreButtonText) + " ", 1),
445
+ ae(_e, {
440
446
  class: "-ml-1.5",
441
447
  name: "action-dots"
442
448
  })
@@ -445,25 +451,25 @@ const We = ["id"], Ve = /* @__PURE__ */ de({
445
451
  }, 8, ["aria-expanded", "onClick"])
446
452
  ])
447
453
  ]),
448
- default: P(() => [
449
- ee("div", {
450
- id: C(g),
454
+ default: H(() => [
455
+ oe("div", {
456
+ id: R(g),
451
457
  ref_key: "moreDropdownMenuRef",
452
- ref: i,
458
+ ref: l,
453
459
  "data-test": "stash-more-actions__dropdown",
454
460
  class: "flex flex-col gap-1.5 p-1.5"
455
461
  }, [
456
- G(b.$slots, "more-actions")
457
- ], 8, We)
462
+ J(T.$slots, "more-actions")
463
+ ], 8, $e)
458
464
  ]),
459
465
  _: 3
460
- }, 8, ["class", "style"])) : me("", !0)
466
+ }, 8, ["class", "style"])) : ge("", !0)
461
467
  ], 4));
462
468
  }
463
- }), ke = {}, $e = {
464
- $style: ke
465
- }, Ge = /* @__PURE__ */ Se(Ve, [["__cssModules", $e]]);
469
+ }), Ue = {}, ze = {
470
+ $style: Ue
471
+ }, Ye = /* @__PURE__ */ Be(Fe, [["__cssModules", ze]]);
466
472
  export {
467
- Ge as default
473
+ Ye as default
468
474
  };
469
475
  //# sourceMappingURL=MoreActions.js.map