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