@leaflink/stash 53.4.6 → 53.4.8
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/AppSidebar.js +56 -52
- package/dist/AppSidebar.js.map +1 -1
- package/dist/AppTopbar.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/DataViewFilters.js +1 -1
- package/dist/DataViewFilters.js.map +1 -1
- package/dist/DataViewToolbar.js +139 -125
- package/dist/DataViewToolbar.js.map +1 -1
- package/dist/DatePicker.js +1114 -1113
- package/dist/DatePicker.js.map +1 -1
- package/dist/Modal.js +105 -89
- package/dist/Modal.js.map +1 -1
- package/dist/Modals.js +30 -26
- package/dist/Modals.js.map +1 -1
- package/dist/MoreActions.js +294 -288
- package/dist/MoreActions.js.map +1 -1
- package/dist/PageNavigation.js +1 -1
- package/dist/RadioGroup.js +69 -62
- package/dist/RadioGroup.js.map +1 -1
- package/dist/SearchBar.js +27 -25
- package/dist/SearchBar.js.map +1 -1
- package/dist/Select.js +103 -101
- package/dist/Select.js.map +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/Tabs.js +2 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js +131 -0
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-DEopbeSY.js.map +1 -0
- package/dist/Thumbnail.js +42 -42
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailGroup.js +24 -22
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/Timeline.js +15 -13
- package/dist/Timeline.js.map +1 -1
- package/dist/Toast.vue.d.ts +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/{Tooltip.vue_vue_type_script_setup_true_lang-CFpM7Ldj.js → Tooltip.vue_vue_type_script_setup_true_lang-UUjw5O1x.js} +2 -2
- 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
- package/dist/components.css +1 -1
- package/dist/getContrastingTextColor.d.ts +8 -0
- package/dist/index-t9tXBnql.js +469 -0
- package/dist/{index-DA70nQCT.js.map → index-t9tXBnql.js.map} +1 -1
- package/dist/templateRefNarrowing-CeANDylX.js +22 -0
- package/dist/templateRefNarrowing-CeANDylX.js.map +1 -0
- package/dist/useMediaQuery.d.ts +12 -10
- package/dist/useMediaQuery.js +7 -29
- package/dist/useMediaQuery.js.map +1 -1
- package/dist/useSortable.js +1 -1
- package/dist/useValidation.d.ts +11 -1
- package/dist/useValidation.js +240 -198
- package/dist/useValidation.js.map +1 -1
- package/dist/utils/getContrastingTextColor.js +36 -24
- package/dist/utils/getContrastingTextColor.js.map +1 -1
- package/package.json +1 -2
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js +0 -130
- package/dist/Tabs.vue_vue_type_script_setup_true_lang-B3FBaVP5.js.map +0 -1
- package/dist/index-DA70nQCT.js +0 -424
package/dist/MoreActions.js
CHANGED
|
@@ -1,442 +1,448 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { DEBOUNCE as
|
|
5
|
-
import { t as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
15
|
+
r.value !== null && (clearTimeout(r.value), r.value = null);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
g(),
|
|
17
|
+
function m(f) {
|
|
18
|
+
g(), o.value !== f && n(), i.value !== f && l(), s.value && d();
|
|
18
19
|
}
|
|
19
|
-
function A(
|
|
20
|
-
g(),
|
|
21
|
-
|
|
22
|
-
},
|
|
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
|
|
25
|
+
function b() {
|
|
25
26
|
A(!0);
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function w() {
|
|
28
29
|
A(!1);
|
|
29
30
|
}
|
|
30
31
|
function u() {
|
|
31
32
|
g();
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
+
return ce(() => {
|
|
34
35
|
u();
|
|
35
36
|
}), {
|
|
36
|
-
isVisible:
|
|
37
|
-
shouldShow:
|
|
37
|
+
isVisible: o,
|
|
38
|
+
shouldShow: i,
|
|
38
39
|
shouldHide: s,
|
|
39
40
|
toggle: A,
|
|
40
|
-
show:
|
|
41
|
-
hide:
|
|
42
|
-
setVisible:
|
|
41
|
+
show: b,
|
|
42
|
+
hide: w,
|
|
43
|
+
setVisible: m,
|
|
43
44
|
cleanup: u
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
+
const Re = {
|
|
47
48
|
TRACKER: -1,
|
|
48
49
|
DROPDOWN: 1e3
|
|
49
|
-
},
|
|
50
|
+
}, te = {
|
|
50
51
|
AUTO_ACTION: "auto-action-",
|
|
51
52
|
INDEX_BASED: "index-",
|
|
52
53
|
MORE_MENU: "more-actions-menu-"
|
|
53
|
-
},
|
|
54
|
+
}, E = {
|
|
54
55
|
ACTION_ID: "data-action-id",
|
|
55
56
|
PROCESSED: "data-more-actions-processed"
|
|
56
|
-
},
|
|
57
|
-
function
|
|
58
|
-
if (!
|
|
57
|
+
}, re = 300, X = /* @__PURE__ */ new WeakMap();
|
|
58
|
+
function q(t) {
|
|
59
|
+
if (!t)
|
|
59
60
|
return;
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
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
|
|
66
|
-
for (; a.has(`auto-action-${
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
}),
|
|
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
|
|
80
|
+
function Ne(t, e) {
|
|
80
81
|
const a = [];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}), a.forEach((
|
|
84
|
-
|
|
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
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
|
|
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
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
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
|
|
99
|
-
if (!
|
|
99
|
+
function ee(t, e) {
|
|
100
|
+
if (!t)
|
|
100
101
|
return;
|
|
101
102
|
Array.from(
|
|
102
|
-
|
|
103
|
-
).filter((
|
|
104
|
-
const
|
|
105
|
-
|
|
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
|
|
109
|
-
actionsContainerRef:
|
|
110
|
-
overflowIds:
|
|
109
|
+
function xe({
|
|
110
|
+
actionsContainerRef: t,
|
|
111
|
+
overflowIds: e,
|
|
111
112
|
moreDropdownMenuRef: a,
|
|
112
|
-
trackerElementRef:
|
|
113
|
-
onOverflowChange:
|
|
113
|
+
trackerElementRef: o,
|
|
114
|
+
onOverflowChange: n
|
|
114
115
|
}) {
|
|
115
|
-
const
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
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
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
(
|
|
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
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}))),
|
|
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
|
-
|
|
141
|
+
i.value || !p(t.value) || !p(o.value) || (i.value = !0, m());
|
|
143
142
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
143
|
+
function b() {
|
|
144
|
+
d.update();
|
|
145
|
+
}
|
|
146
|
+
function w() {
|
|
147
|
+
m.cancel(), i.value = !1;
|
|
146
148
|
}
|
|
147
149
|
return {
|
|
148
|
-
calculateOverflow:
|
|
149
|
-
applyElementVisibility:
|
|
150
|
-
updateOverflowState:
|
|
151
|
-
updateTrackerBounding:
|
|
152
|
-
cleanup:
|
|
153
|
-
isProcessing:
|
|
150
|
+
calculateOverflow: A,
|
|
151
|
+
applyElementVisibility: le,
|
|
152
|
+
updateOverflowState: r,
|
|
153
|
+
updateTrackerBounding: b,
|
|
154
|
+
cleanup: w,
|
|
155
|
+
isProcessing: i
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
|
-
function
|
|
157
|
-
actionsContainerRef:
|
|
158
|
-
overflowIds:
|
|
158
|
+
function We({
|
|
159
|
+
actionsContainerRef: t,
|
|
160
|
+
overflowIds: e,
|
|
159
161
|
moreDropdownMenuRef: a,
|
|
160
|
-
trackerElementRef:
|
|
161
|
-
moreDropdownWidth:
|
|
162
|
-
calculateMoreButtonWidth:
|
|
163
|
-
hasMoreActionsSlot:
|
|
162
|
+
trackerElementRef: o,
|
|
163
|
+
moreDropdownWidth: n,
|
|
164
|
+
calculateMoreButtonWidth: i,
|
|
165
|
+
hasMoreActionsSlot: l,
|
|
164
166
|
onOverflowChange: s
|
|
165
167
|
}) {
|
|
166
|
-
const d =
|
|
167
|
-
calculateOverflow:
|
|
168
|
+
const d = O(!1), {
|
|
169
|
+
calculateOverflow: r,
|
|
168
170
|
applyElementVisibility: g,
|
|
169
|
-
updateOverflowState:
|
|
171
|
+
updateOverflowState: m,
|
|
170
172
|
updateTrackerBounding: A,
|
|
171
|
-
cleanup:
|
|
172
|
-
isProcessing:
|
|
173
|
-
} =
|
|
174
|
-
actionsContainerRef:
|
|
175
|
-
overflowIds:
|
|
173
|
+
cleanup: b,
|
|
174
|
+
isProcessing: w
|
|
175
|
+
} = xe({
|
|
176
|
+
actionsContainerRef: t,
|
|
177
|
+
overflowIds: e,
|
|
176
178
|
moreDropdownMenuRef: a,
|
|
177
|
-
trackerElementRef:
|
|
179
|
+
trackerElementRef: o,
|
|
178
180
|
onOverflowChange: s
|
|
179
181
|
});
|
|
180
|
-
let u = null,
|
|
181
|
-
function
|
|
182
|
-
|
|
182
|
+
let u = null, f = null, I = null;
|
|
183
|
+
function v() {
|
|
184
|
+
e.value.clear(), n.value = 0;
|
|
183
185
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
+
function h() {
|
|
187
|
+
f && (f(), f = null), I && (I(), I = null);
|
|
186
188
|
}
|
|
187
|
-
const S =
|
|
189
|
+
const S = B(() => p(t.value)), D = Y(
|
|
188
190
|
() => {
|
|
189
|
-
|
|
191
|
+
const c = p(t.value);
|
|
192
|
+
!c || !l.value || (q(c), h(), b(), y());
|
|
190
193
|
},
|
|
191
|
-
|
|
194
|
+
F.FAST,
|
|
192
195
|
{ leading: !1, trailing: !0 }
|
|
193
196
|
);
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
const { stop:
|
|
200
|
-
A(),
|
|
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
|
-
|
|
203
|
-
const { stop:
|
|
204
|
-
|
|
205
|
-
(
|
|
206
|
-
if (
|
|
205
|
+
f = K;
|
|
206
|
+
const { stop: U } = we(
|
|
207
|
+
C,
|
|
208
|
+
(V) => {
|
|
209
|
+
if (w.value)
|
|
207
210
|
return;
|
|
208
|
-
let
|
|
209
|
-
const N = new Set(
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
}),
|
|
214
|
-
const
|
|
215
|
-
|
|
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
|
-
|
|
225
|
-
const
|
|
226
|
-
g(
|
|
227
|
-
}),
|
|
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
|
-
|
|
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
|
|
239
|
+
const y = Y(
|
|
238
240
|
() => {
|
|
239
|
-
d.value || (d.value = !0,
|
|
241
|
+
d.value || (d.value = !0, M(), d.value = !1);
|
|
240
242
|
},
|
|
241
|
-
|
|
243
|
+
F.FAST,
|
|
242
244
|
{ leading: !0 }
|
|
243
245
|
);
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}),
|
|
251
|
-
|
|
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
|
|
255
|
-
moreDropdownRef:
|
|
256
|
-
actionsContainerRef:
|
|
258
|
+
function Ve({
|
|
259
|
+
moreDropdownRef: t,
|
|
260
|
+
actionsContainerRef: e,
|
|
257
261
|
moreButtonAlign: a,
|
|
258
|
-
hasOverflowActions:
|
|
262
|
+
hasOverflowActions: o
|
|
259
263
|
}) {
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
if (!(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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
|
|
270
|
-
},
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
const s =
|
|
274
|
-
s > 0 && (
|
|
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:
|
|
278
|
-
moreButtonWidth:
|
|
282
|
+
calculateMoreButtonWidth: n,
|
|
283
|
+
moreButtonWidth: i
|
|
279
284
|
};
|
|
280
285
|
}
|
|
281
|
-
function
|
|
282
|
-
const a =
|
|
283
|
-
let
|
|
284
|
-
const
|
|
285
|
-
|
|
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
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
const
|
|
297
|
-
|
|
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 =
|
|
306
|
+
}), a.value = g;
|
|
301
307
|
}, s = () => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
},
|
|
314
|
+
}, re + 100);
|
|
309
315
|
};
|
|
310
|
-
return
|
|
316
|
+
return G(e, () => {
|
|
311
317
|
s();
|
|
312
318
|
}), {
|
|
313
319
|
visibleElementsWidth: a,
|
|
314
|
-
isRecalculatingWidth:
|
|
315
|
-
isRecalculatingWithDelay:
|
|
316
|
-
calculateVisibleElementsWidth:
|
|
320
|
+
isRecalculatingWidth: o,
|
|
321
|
+
isRecalculatingWithDelay: n,
|
|
322
|
+
calculateVisibleElementsWidth: l,
|
|
317
323
|
calculateVisibleElementsWidthDelayed: s,
|
|
318
324
|
cleanup: () => {
|
|
319
|
-
|
|
325
|
+
i && (clearTimeout(i), i = null), n.value = !1;
|
|
320
326
|
}
|
|
321
327
|
};
|
|
322
328
|
}
|
|
323
|
-
const
|
|
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: () =>
|
|
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(
|
|
334
|
-
const
|
|
335
|
-
isVisible:
|
|
336
|
-
shouldShow:
|
|
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
|
-
} =
|
|
339
|
-
duration:
|
|
344
|
+
} = Me({
|
|
345
|
+
duration: re,
|
|
340
346
|
initialVisible: !1
|
|
341
|
-
}),
|
|
342
|
-
moreDropdownRef:
|
|
343
|
-
actionsContainerRef:
|
|
344
|
-
moreButtonAlign:
|
|
345
|
-
hasOverflowActions:
|
|
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:
|
|
353
|
+
visibleElementsWidth: h,
|
|
348
354
|
isRecalculatingWithDelay: S,
|
|
349
|
-
calculateVisibleElementsWidthDelayed:
|
|
350
|
-
cleanup:
|
|
351
|
-
} =
|
|
352
|
-
actionsContainerRef:
|
|
355
|
+
calculateVisibleElementsWidthDelayed: D,
|
|
356
|
+
cleanup: W
|
|
357
|
+
} = ke({
|
|
358
|
+
actionsContainerRef: n,
|
|
353
359
|
overflowIds: d
|
|
354
|
-
}),
|
|
355
|
-
|
|
356
|
-
actionsContainerRef:
|
|
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:
|
|
364
|
+
moreDropdownMenuRef: l,
|
|
359
365
|
trackerElementRef: s,
|
|
360
|
-
moreDropdownWidth:
|
|
361
|
-
calculateMoreButtonWidth:
|
|
362
|
-
hasMoreActionsSlot:
|
|
363
|
-
onOverflowChange:
|
|
364
|
-
}),
|
|
365
|
-
() =>
|
|
366
|
-
(
|
|
367
|
-
|
|
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
|
-
},
|
|
375
|
+
}, F.FAST) : A.value = !1;
|
|
370
376
|
}
|
|
371
|
-
),
|
|
372
|
-
u(
|
|
377
|
+
), G(M, (T) => {
|
|
378
|
+
u(T);
|
|
373
379
|
});
|
|
374
|
-
function
|
|
375
|
-
|
|
380
|
+
function _(T) {
|
|
381
|
+
r.value = T;
|
|
376
382
|
}
|
|
377
|
-
return
|
|
378
|
-
|
|
379
|
-
}), (
|
|
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:
|
|
388
|
+
style: j({ width: e.width })
|
|
383
389
|
}, [
|
|
384
|
-
(
|
|
390
|
+
(Z(), ne(Ae(e.actionsContainerTag), {
|
|
385
391
|
ref_key: "actionsContainerRef",
|
|
386
|
-
ref:
|
|
392
|
+
ref: n,
|
|
387
393
|
"data-test": "stash-more-actions__container",
|
|
388
|
-
style:
|
|
389
|
-
width:
|
|
390
|
-
minWidth:
|
|
394
|
+
style: j({
|
|
395
|
+
width: c.value,
|
|
396
|
+
minWidth: R(v) ? `${R(v)}px` : void 0
|
|
391
397
|
}),
|
|
392
|
-
class:
|
|
398
|
+
class: ie(["stash-more-actions__container flex items-center gap-2 overflow-x-hidden", e.actionsContainerClass])
|
|
393
399
|
}, {
|
|
394
|
-
default:
|
|
395
|
-
|
|
400
|
+
default: H(() => [
|
|
401
|
+
J(T.$slots, "default")
|
|
396
402
|
]),
|
|
397
403
|
_: 3
|
|
398
404
|
}, 8, ["style", "class"])),
|
|
399
|
-
|
|
405
|
+
oe("div", {
|
|
400
406
|
ref_key: "trackerElementRef",
|
|
401
407
|
ref: s,
|
|
402
408
|
class: "stash-more-actions__tracker",
|
|
403
|
-
style:
|
|
409
|
+
style: j({
|
|
404
410
|
position: "absolute",
|
|
405
411
|
right: "0px",
|
|
406
412
|
top: "0",
|
|
407
413
|
visibility: "hidden",
|
|
408
|
-
width:
|
|
414
|
+
width: R(v) + "px",
|
|
409
415
|
height: "100%",
|
|
410
416
|
pointerEvents: "none",
|
|
411
|
-
zIndex:
|
|
417
|
+
zIndex: R(Re).TRACKER
|
|
412
418
|
})
|
|
413
419
|
}, null, 4),
|
|
414
|
-
|
|
420
|
+
o.value ? (Z(), ne(Ce, {
|
|
415
421
|
key: 0,
|
|
416
422
|
ref_key: "moreDropdownRef",
|
|
417
|
-
ref:
|
|
418
|
-
class:
|
|
423
|
+
ref: i,
|
|
424
|
+
class: ie([
|
|
419
425
|
"!absolute top-0",
|
|
420
|
-
|
|
421
|
-
{ invisible: !
|
|
426
|
+
R(w) ? "animate-fade-in" : "animate-fade-out",
|
|
427
|
+
{ invisible: !R(b) }
|
|
422
428
|
]),
|
|
423
|
-
style:
|
|
424
|
-
onToggle:
|
|
429
|
+
style: j(C.value),
|
|
430
|
+
onToggle: _
|
|
425
431
|
}, {
|
|
426
|
-
toggle:
|
|
427
|
-
|
|
428
|
-
toggle:
|
|
429
|
-
isOpen:
|
|
432
|
+
toggle: H(({ toggle: U }) => [
|
|
433
|
+
J(T.$slots, "toggle", {
|
|
434
|
+
toggle: U,
|
|
435
|
+
isOpen: r.value
|
|
430
436
|
}, () => [
|
|
431
|
-
|
|
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:
|
|
441
|
+
onClick: U
|
|
436
442
|
}, {
|
|
437
|
-
default:
|
|
438
|
-
|
|
439
|
-
|
|
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:
|
|
449
|
-
|
|
450
|
-
id:
|
|
454
|
+
default: H(() => [
|
|
455
|
+
oe("div", {
|
|
456
|
+
id: R(g),
|
|
451
457
|
ref_key: "moreDropdownMenuRef",
|
|
452
|
-
ref:
|
|
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
|
-
|
|
457
|
-
], 8,
|
|
462
|
+
J(T.$slots, "more-actions")
|
|
463
|
+
], 8, $e)
|
|
458
464
|
]),
|
|
459
465
|
_: 3
|
|
460
|
-
}, 8, ["class", "style"])) :
|
|
466
|
+
}, 8, ["class", "style"])) : ge("", !0)
|
|
461
467
|
], 4));
|
|
462
468
|
}
|
|
463
|
-
}),
|
|
464
|
-
$style:
|
|
465
|
-
},
|
|
469
|
+
}), Ue = {}, ze = {
|
|
470
|
+
$style: Ue
|
|
471
|
+
}, Ye = /* @__PURE__ */ Be(Fe, [["__cssModules", ze]]);
|
|
466
472
|
export {
|
|
467
|
-
|
|
473
|
+
Ye as default
|
|
468
474
|
};
|
|
469
475
|
//# sourceMappingURL=MoreActions.js.map
|