@wssto2/vue-core 0.4.7 → 0.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.
Files changed (36) hide show
  1. package/README.md +2 -1
  2. package/dist/{Activity-CEeZADHC.js → Activity-BqmMjwAS.js} +1 -1
  3. package/dist/{Changes-B7TxVDoE.js → Changes-CoDcwt3C.js} +1 -1
  4. package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-C35PsfKK.js +1569 -0
  5. package/dist/{DataTable.vue_vue_type_script_setup_true_lang-KPm5NrDE.js → DataTable.vue_vue_type_script_setup_true_lang-4CL_kEKf.js} +21 -17
  6. package/dist/{DeadLetters-DwKeKpu6.js → DeadLetters-DaWaCeYJ.js} +2 -2
  7. package/dist/{General-C43nVs_x.js → General-sP35jv3T.js} +1 -1
  8. package/dist/{ProfilePage-BXVPsyS8.js → ProfilePage-CMtis35I.js} +2 -2
  9. package/dist/{Sessions-9OEiLpje.js → Sessions-CWqbbgzF.js} +1 -1
  10. package/dist/{SettingsPage-CmPy-kpL.js → SettingsPage-BYwmti4E.js} +1 -1
  11. package/dist/{SignIn-f-HF9B7-.js → SignIn-BGs0x7Cg.js} +1 -1
  12. package/dist/{SignInPage-C8zaS_7r.js → SignInPage-Djhf9T9M.js} +1 -1
  13. package/dist/{SignInTable.vue_vue_type_script_setup_true_lang-ALAuc0sI.js → SignInTable.vue_vue_type_script_setup_true_lang-BxqBA5pD.js} +1 -1
  14. package/dist/{SignIns-DzKz0Ple.js → SignIns-DkR9TvZT.js} +2 -2
  15. package/dist/{UserRecord-pciJE77m.js → UserRecord-C2jOiPcF.js} +2 -2
  16. package/dist/{UsersList-YRJTY69g.js → UsersList-CFDuDIu_.js} +3 -3
  17. package/dist/collection/CollectionPage.vue.d.ts +2 -0
  18. package/dist/collection/CollectionRows.vue.d.ts +6 -1
  19. package/dist/collection/CollectionTable.vue.d.ts +9 -0
  20. package/dist/collection/CollectionToolbar.vue.d.ts +3 -2
  21. package/dist/collection/DataTable.vue.d.ts +3 -0
  22. package/dist/collection/index.js +3 -3
  23. package/dist/collection/rowInteractions.d.ts +3 -1
  24. package/dist/i18n/index.js +8 -8
  25. package/dist/identity/index.js +1 -1
  26. package/dist/{index-DoowoCS7.js → index-0QeMiN0l.js} +10 -10
  27. package/dist/{index-DnYLRcv6.js → index-DtPd4laZ.js} +2 -2
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/notifications/index.js +1 -1
  31. package/dist/rowLayout-D1cYQghV.js +663 -0
  32. package/dist/{status-GT-QFBrB.js → status-7L8lC-_q.js} +1 -1
  33. package/dist/styles.css +1 -1
  34. package/package.json +1 -1
  35. package/dist/CollectionPage.vue_vue_type_script_setup_true_lang-DzuvFLj2.js +0 -1546
  36. package/dist/rowLayout-BkQWulan.js +0 -621
@@ -0,0 +1,663 @@
1
+ import { defineComponent as se, computed as g, openBlock as s, createElementBlock as l, normalizeClass as w, createBlock as D, unref as i, withCtx as F, Fragment as p, renderList as P, toDisplayString as C, createTextVNode as Q, createCommentVNode as b, renderSlot as S, createVNode as L, ref as oe, getCurrentScope as Ie, onScopeDispose as Ae, nextTick as ge, useSlots as fe, useId as Te, useTemplateRef as pe, watch as ye, mergeProps as q, normalizeStyle as M, createElementVNode as u, withModifiers as ve, createSlots as De } from "vue";
2
+ import { useI18n as Be } from "vue-i18n";
3
+ import { RouterLink as we, useRouter as He } from "vue-router";
4
+ import { _ as Ke } from "./SwipeActions.vue_vue_type_script_setup_true_lang-BJIA2JfI.js";
5
+ import { _ as J } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
+ import { _ as Ne } from "./Menu.vue_vue_type_script_setup_true_lang-uPmxWvds.js";
7
+ import { _ as ze } from "./Tooltip.vue_vue_type_script_setup_true_lang-OOD_XNWx.js";
8
+ import { _ as he } from "./EmptyState.vue_vue_type_script_setup_true_lang-50p-Mp8I.js";
9
+ import { u as Fe } from "./format-B8mJm946.js";
10
+ import { _ as Ve } from "./Badge.vue_vue_type_script_setup_true_lang-DJyZc0C7.js";
11
+ import { _ as Oe } from "./Timestamp.vue_vue_type_script_setup_true_lang-FVRUr-9y.js";
12
+ import { a as je } from "./mediaQuery-CygcXmFW.js";
13
+ function Ue(y, n) {
14
+ const d = (n ?? "").split(/\s+/).filter((v) => v !== "");
15
+ if (d.length === 0 || y === "") return [{ text: y, match: !1 }];
16
+ const e = new RegExp(`(${d.sort((v, c) => c.length - v.length).map((v) => v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})`, "giu");
17
+ return y.split(e).flatMap((v, c) => v === "" ? [] : [{ text: v, match: c % 2 === 1 }]);
18
+ }
19
+ const Ye = ["data-row-click-ignore"], me = "rounded-sm bg-status-warning-surface text-status-warning-content", be = "col-start-1 row-start-1", Ge = "col-span-full row-start-2 max-w-full", ke = /* @__PURE__ */ se({
20
+ __name: "RecordIdentity",
21
+ props: {
22
+ title: {},
23
+ subtitle: { default: null },
24
+ to: { default: null },
25
+ subtitleSelectable: { type: Boolean, default: !1 },
26
+ highlight: { default: null },
27
+ spread: { type: Boolean, default: !1 }
28
+ },
29
+ setup(y) {
30
+ const n = y, d = g(() => Ue(n.title, n.highlight));
31
+ return (e, v) => (s(), l("div", {
32
+ class: w(n.spread ? "contents" : "flex min-w-0 flex-col")
33
+ }, [
34
+ n.to ? (s(), D(i(we), {
35
+ key: 0,
36
+ to: n.to,
37
+ class: w(["block truncate rounded-sm text-row-title focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", n.spread ? be : void 0])
38
+ }, {
39
+ default: F(() => [
40
+ (s(!0), l(p, null, P(d.value, (c, h) => (s(), l(p, { key: h }, [
41
+ c.match ? (s(), l("mark", {
42
+ key: 0,
43
+ class: w(me)
44
+ }, C(c.text), 1)) : (s(), l(p, { key: 1 }, [
45
+ Q(C(c.text), 1)
46
+ ], 64))
47
+ ], 64))), 128))
48
+ ]),
49
+ _: 1
50
+ }, 8, ["to", "class"])) : (s(), l("span", {
51
+ key: 1,
52
+ class: w(["truncate text-row-title", n.spread ? be : void 0])
53
+ }, [
54
+ (s(!0), l(p, null, P(d.value, (c, h) => (s(), l(p, { key: h }, [
55
+ c.match ? (s(), l("mark", {
56
+ key: 0,
57
+ class: w(me)
58
+ }, C(c.text), 1)) : (s(), l(p, { key: 1 }, [
59
+ Q(C(c.text), 1)
60
+ ], 64))
61
+ ], 64))), 128))
62
+ ], 2)),
63
+ n.subtitle ? (s(), l("span", {
64
+ key: 2,
65
+ "data-row-click-ignore": n.subtitleSelectable ? "" : void 0,
66
+ class: w(["truncate text-row-subtitle", [n.subtitleSelectable ? "w-fit cursor-text select-text" : void 0, n.spread ? Ge : void 0]])
67
+ }, C(n.subtitle), 11, Ye)) : b("", !0)
68
+ ], 2));
69
+ }
70
+ });
71
+ function _e(y, n) {
72
+ let d = y;
73
+ for (const e of String(n).split(".")) {
74
+ if (typeof d != "object" || d === null) return;
75
+ d = d[e];
76
+ }
77
+ return d;
78
+ }
79
+ const We = {
80
+ key: 0,
81
+ class: "flex items-center gap-3"
82
+ }, Xe = ["datetime"], qe = {
83
+ key: 2,
84
+ class: "tabular-nums"
85
+ }, Je = {
86
+ key: 3,
87
+ class: "tabular-nums"
88
+ }, V = /* @__PURE__ */ se({
89
+ __name: "CollectionCell",
90
+ props: {
91
+ column: {},
92
+ item: {},
93
+ compact: { type: Boolean },
94
+ to: {},
95
+ search: {},
96
+ spread: { type: Boolean }
97
+ },
98
+ setup(y) {
99
+ const n = y, d = Fe(), e = g(() => _e(n.item, n.column.key)), v = g(() => e.value), c = g(() => e.value === null || e.value === void 0 ? "" : String(e.value)), h = g(() => typeof e.value == "number" ? e.value : typeof e.value == "string" && e.value.trim() !== "" ? Number(e.value) : null);
100
+ return (E, N) => n.column.kind === "identity" ? (s(), l(p, { key: 0 }, [
101
+ !n.compact && E.$slots.leading ? (s(), l("div", We, [
102
+ S(E.$slots, "leading"),
103
+ L(ke, {
104
+ to: n.to,
105
+ title: n.column.title?.(n.item) ?? c.value,
106
+ subtitle: n.column.subtitle?.(n.item),
107
+ highlight: n.search,
108
+ "subtitle-selectable": ""
109
+ }, null, 8, ["to", "title", "subtitle", "highlight"])
110
+ ])) : (s(), D(ke, {
111
+ key: 1,
112
+ spread: n.spread,
113
+ to: n.to,
114
+ title: n.column.title?.(n.item) ?? c.value,
115
+ subtitle: n.column.subtitle?.(n.item),
116
+ highlight: n.search,
117
+ "subtitle-selectable": ""
118
+ }, null, 8, ["spread", "to", "title", "subtitle", "highlight"]))
119
+ ], 64)) : n.column.kind === "timestamp" ? (s(), l(p, { key: 1 }, [
120
+ n.compact && v.value ? (s(), l("time", {
121
+ key: 0,
122
+ class: "tabular-nums",
123
+ datetime: String(e.value)
124
+ }, C(n.column.precision === "date" ? i(d).date(v.value) : i(d).dateTime(v.value)), 9, Xe)) : n.compact ? b("", !0) : (s(), D(i(Oe), {
125
+ key: 1,
126
+ value: v.value,
127
+ precision: n.column.precision ?? "dateTime"
128
+ }, null, 8, ["value", "precision"]))
129
+ ], 64)) : n.column.kind === "number" ? (s(), l("span", qe, C(i(d).number(h.value, n.column.format)), 1)) : n.column.kind === "money" ? (s(), l("span", Je, C(i(d).money(h.value, typeof n.column.currency == "function" ? n.column.currency(n.item) : n.column.currency)), 1)) : n.column.kind === "badge" ? (s(), D(i(Ve), {
130
+ key: 4,
131
+ tone: n.column.tone(n.item),
132
+ dot: ""
133
+ }, {
134
+ default: F(() => [
135
+ Q(C(n.column.text?.(n.item) ?? c.value), 1)
136
+ ]),
137
+ _: 1
138
+ }, 8, ["tone"])) : (s(), l(p, { key: 5 }, [
139
+ Q(C(c.value), 1)
140
+ ], 64));
141
+ }
142
+ }), Qe = 'a, button, input, select, textarea, label, [role="button"], [data-row-click-ignore]', Ze = 500, et = 8;
143
+ function tt(y) {
144
+ const n = He(), d = oe([]), e = oe("");
145
+ let v = !1, c = null, h = { x: 0, y: 0 };
146
+ const E = (a) => y.actions()?.(a) ?? [];
147
+ function N(a) {
148
+ return E(a).filter((k) => k.href).map((k) => ({ key: k.key, label: k.label, icon: k.icon, href: k.href, tone: k.tone ?? "neutral", external: k.external }));
149
+ }
150
+ function I(a, k, _) {
151
+ const A = E(a);
152
+ return A.length === 0 ? !1 : (e.value = y.label()?.(a) ?? y.moreLabel(), d.value = A.map((x) => ({
153
+ id: x.key,
154
+ label: x.label,
155
+ icon: x.icon,
156
+ section: x.section,
157
+ tone: x.tone === "critical" ? "critical" : void 0,
158
+ onSelect: () => {
159
+ x.onSelect ? x.onSelect() : x.href && (x.external ? window.open(x.href, "_blank", "noopener") : window.location.assign(x.href));
160
+ }
161
+ })), ge(() => y.presentMenu(k, _)), !0);
162
+ }
163
+ function O(a, k) {
164
+ const _ = a.currentTarget.getBoundingClientRect();
165
+ I(k, _.left, _.bottom);
166
+ }
167
+ function j(a, k) {
168
+ !y.actions() || a.target.closest("a") || I(k, a.clientX, a.clientY) && (a.preventDefault(), v = !0);
169
+ }
170
+ function B() {
171
+ c && clearTimeout(c), c = null;
172
+ }
173
+ function U(a, k) {
174
+ v = !1, !(a.pointerType !== "touch" || !y.actions()) && (h = { x: a.clientX, y: a.clientY }, B(), c = setTimeout(() => {
175
+ c = null, I(k, h.x, h.y) && (v = !0, navigator.vibrate?.(10));
176
+ }, Ze));
177
+ }
178
+ function H(a) {
179
+ c && Math.hypot(a.clientX - h.x, a.clientY - h.y) > et && B();
180
+ }
181
+ function z(a) {
182
+ v && (v = !1, a.preventDefault(), a.stopPropagation());
183
+ }
184
+ function K(a, k) {
185
+ const _ = y.pick?.(), A = _ ? null : y.target(k);
186
+ if (!(!_ && !A || a.target.closest(Qe)) && !window.getSelection()?.toString()) {
187
+ if (_) {
188
+ _(k);
189
+ return;
190
+ }
191
+ if (a.metaKey || a.ctrlKey) {
192
+ window.open(n.resolve(A).href, "_blank");
193
+ return;
194
+ }
195
+ n.push(A);
196
+ }
197
+ }
198
+ return Ie() && Ae(B), { menuItems: d, menuLabel: e, swipeActions: N, openMenuFrom: O, onContextMenu: j, onPointerDown: U, onPointerMove: H, cancelPress: B, onClickCapture: z, onClick: K, actionsOf: E };
199
+ }
200
+ const ot = { class: "flex flex-1 flex-col gap-2 pt-1" }, st = ["onClick", "onContextmenu", "onPointerdown"], nt = { class: "flex items-start gap-3" }, lt = {
201
+ key: 0,
202
+ class: "shrink-0 pt-0.5"
203
+ }, rt = { class: "flex min-w-0 flex-1 flex-col gap-1" }, it = {
204
+ key: 2,
205
+ class: "block truncate text-row-title"
206
+ }, at = {
207
+ key: 0,
208
+ class: "col-start-2 row-start-1 flex shrink-0 items-center gap-2 pt-0.5"
209
+ }, ct = ["aria-label", "onClick"], ut = {
210
+ key: 0,
211
+ class: "flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 text-row-meta"
212
+ }, dt = {
213
+ key: 1,
214
+ class: "truncate"
215
+ }, ft = {
216
+ key: 2,
217
+ class: "px-4 py-6",
218
+ "data-test": "collection-failed"
219
+ }, pt = {
220
+ key: 3,
221
+ class: "px-4 py-2 text-center",
222
+ "data-test": "collection-empty"
223
+ }, yt = {
224
+ key: 1,
225
+ class: "inline-block w-full align-middle"
226
+ }, vt = ["role"], ht = { class: "border-b border-border-separator" }, mt = ["aria-sort"], bt = ["onClick"], kt = { key: 1 }, gt = {
227
+ key: 0,
228
+ class: "px-4 pt-2.5 pb-2",
229
+ style: { width: "20px" }
230
+ }, wt = { class: "sr-only" }, _t = {
231
+ key: 0,
232
+ class: "size-8 shrink-0 rounded-full bg-fill"
233
+ }, xt = { class: "flex flex-1 flex-col gap-1.5" }, Ct = { key: 0 }, $t = ["onClick", "onContextmenu", "onPointerdown"], St = { key: 0 }, Lt = { class: "flex items-center justify-center gap-1" }, Pt = ["aria-label", "onClick"], Rt = {
234
+ key: 2,
235
+ "data-test": "collection-failed"
236
+ }, Mt = ["colspan"], Et = {
237
+ key: 3,
238
+ "data-test": "collection-empty"
239
+ }, It = ["colspan"], At = "cursor-pointer hover:bg-fill/60 active:bg-fill-strong group-focus-visible/pick:data-current:bg-fill group-focus-visible/pick:data-current:outline-2 group-focus-visible/pick:data-current:-outline-offset-2 group-focus-visible/pick:data-current:outline-border-focus", Tt = "cursor-pointer after:pointer-events-none after:absolute after:inset-0 after:z-10 after:transition-colors hover:after:bg-content-strong/5 active:after:bg-content-strong/10 group-focus-visible/pick:data-current:after:bg-content-strong/5 group-focus-visible/pick:data-current:after:outline-2 group-focus-visible/pick:data-current:after:-outline-offset-2 group-focus-visible/pick:data-current:after:outline-border-focus", Dt = 37, Wt = /* @__PURE__ */ se({
240
+ __name: "CollectionRows",
241
+ props: {
242
+ columns: {},
243
+ rows: {},
244
+ rowKey: {},
245
+ display: {},
246
+ phone: { type: Boolean },
247
+ link: {},
248
+ search: { default: void 0 },
249
+ sorted: { default: null },
250
+ rowActions: { type: Function, default: void 0 },
251
+ rowLabel: { type: Function, default: void 0 },
252
+ rowHeight: { default: void 0 },
253
+ density: { default: "regular" },
254
+ actionsVisible: { type: Boolean, default: !1 },
255
+ skeletonRows: {},
256
+ reserveRows: { default: void 0 },
257
+ rowClass: { type: Function, default: void 0 },
258
+ pick: { type: Function, default: void 0 },
259
+ pickLabel: { default: void 0 }
260
+ },
261
+ emits: ["sort"],
262
+ setup(y, { expose: n, emit: d }) {
263
+ const e = y, v = d, c = fe(), { t: h } = Be(), E = fe(), N = (o) => e.columns.filter((f) => f.mobile === o), I = g(() => N("primary")), O = g(() => N("accessory")), j = g(() => N("meta")), B = g(() => I.value.length === 1 && I.value[0].kind === "identity" && !z(I.value[0])), U = (o) => O.value.length > 0 || G.value && ee(o), H = (o) => `cell-${String(o.key).replace(/\./g, "_")}`, z = (o) => !!E[H(o)], K = (o, f) => _e(o, f.key), a = (o) => o == null || o === "", k = { md: "hidden md:table-cell", xl: "hidden xl:table-cell", "2xl": "hidden 2xl:table-cell" }, _ = (o) => o.hideBelow ? [k[o.hideBelow]] : [], A = (o) => ["text-nowrap px-4 pt-2.5 pb-2 text-footnote font-normal text-content-muted", ..._(o)], x = { start: "text-left", center: "text-center", end: "text-right" }, xe = (o) => [..._(o), x[o.align ?? "start"]], Ce = { start: "justify-start", center: "justify-center", end: "justify-end" }, ne = g(() => e.rows.length > 0 && e.link(e.rows[0]) !== null), T = g(() => e.pick !== void 0 && e.display === "rows" && e.rows.length > 0), $e = Te(), Z = (o) => `${$e}-option-${o}`, R = oe(-1), Y = pe("list");
264
+ ye(() => e.rows, () => R.value = -1), ye(R, (o) => void ge(() => Y.value?.querySelector(`[id="${Z(o)}"]`)?.scrollIntoView?.({ block: "nearest" })));
265
+ function Se(o) {
266
+ if (o.target !== o.currentTarget || o.altKey || o.ctrlKey || o.metaKey || o.shiftKey) return;
267
+ const f = e.rows.length - 1, t = R.value, $ = { ArrowDown: Math.min(t + 1, f), ArrowUp: Math.max(t - 1, 0), Home: 0, End: f };
268
+ o.key in $ ? (o.preventDefault(), R.value = $[o.key]) : (o.key === "Enter" || o.key === " ") && t >= 0 && e.rows[t] !== void 0 && (o.preventDefault(), e.pick?.(e.rows[t]));
269
+ }
270
+ const le = g(
271
+ () => T.value ? {
272
+ role: "listbox",
273
+ tabindex: 0,
274
+ "aria-label": e.pickLabel ?? h("core.collection.pick_label"),
275
+ "aria-activedescendant": R.value >= 0 ? Z(R.value) : void 0,
276
+ onKeydown: Se,
277
+ onFocus: () => {
278
+ R.value < 0 && (R.value = 0);
279
+ }
280
+ } : {}
281
+ ), re = (o) => T.value ? { role: "option", id: Z(o), "data-current": o === R.value ? "" : void 0 } : {};
282
+ function Le() {
283
+ return T.value ? (Y.value?.focus(), !0) : !1;
284
+ }
285
+ n({ focusRows: Le });
286
+ const ie = pe("rowMenu"), m = tt({
287
+ actions: () => e.rowActions,
288
+ label: () => e.rowLabel,
289
+ target: (o) => e.link(o),
290
+ pick: () => e.pick,
291
+ presentMenu: (o, f) => ie.value?.presentAt(o, f),
292
+ moreLabel: () => h("core.page.more_actions")
293
+ }), G = g(() => !!e.rowActions && (e.actionsVisible || !c.actions && !ne.value)), W = g(() => !!c.actions || ne.value || G.value), ae = (o) => e.rowLabel ? `${h("core.page.more_actions")}: ${e.rowLabel(o)}` : h("core.page.more_actions"), ee = (o) => m.actionsOf(o).length > 0, ce = g(() => e.columns.length + (W.value ? 1 : 0)), X = (o) => o.sort !== void 0 && e.sorted?.key === o.sort, Pe = (o) => o.sort === void 0 ? void 0 : X(o) ? e.sorted?.direction === "asc" ? "ascending" : "descending" : "none", Re = (o) => X(o) ? e.sorted?.direction === "asc" ? "arrowUpSLine" : "arrowDownSLine" : "expandUpDownLine", ue = (o) => ({ animationDelay: `${Math.min(o, 8) * 30}ms` }), te = g(() => e.display === "loading"), Me = g(() => te.value && e.reserveRows !== void 0 ? `${e.reserveRows * (e.rowHeight ?? 40) + Dt}px` : void 0), de = g(() => e.display === "empty" || e.display === "no-matches");
294
+ return (o, f) => (s(), l(p, null, [
295
+ e.phone ? (s(), l("ul", q({
296
+ key: 0,
297
+ ref_key: "list",
298
+ ref: Y
299
+ }, le.value, {
300
+ class: ["overflow-hidden rounded-group bg-surface-cell shadow-group", T.value ? "group/pick outline-0" : void 0],
301
+ "data-test": "collection-mobile-rows"
302
+ }), [
303
+ te.value ? (s(!0), l(p, { key: 0 }, P(e.skeletonRows, (t) => (s(), l("li", {
304
+ key: `skeleton-${t}`,
305
+ "aria-hidden": "true",
306
+ class: "relative flex animate-pulse items-start gap-3 px-row-inset py-3 motion-reduce:animate-none not-first:before:absolute not-first:before:top-0 not-first:before:right-0 not-first:before:left-row-inset not-first:before:h-px not-first:before:bg-border-separator",
307
+ style: M({ animationDelay: `${t * 60}ms` })
308
+ }, [
309
+ f[5] || (f[5] = u("span", { class: "size-9 shrink-0 rounded-full bg-fill" }, null, -1)),
310
+ u("span", ot, [
311
+ u("span", {
312
+ class: "h-2.5 rounded-full bg-fill-strong",
313
+ style: M({ width: `${45 + t * 13 % 30}%` })
314
+ }, null, 4),
315
+ u("span", {
316
+ class: "h-2 rounded-full bg-fill",
317
+ style: M({ width: `${60 + t * 7 % 25}%` })
318
+ }, null, 4)
319
+ ])
320
+ ], 4))), 128)) : b("", !0),
321
+ e.display === "rows" ? (s(!0), l(p, { key: 1 }, P(e.rows, (t, $) => (s(), l("li", q({
322
+ key: e.rowKey(t),
323
+ style: ue($),
324
+ "data-test": "collection-row"
325
+ }, { ref_for: !0 }, re($), {
326
+ class: ["relative animate-row-in transition-colors duration-motion-fast active:bg-fill not-first:before:absolute not-first:before:top-0 not-first:before:right-0 not-first:before:left-row-inset not-first:before:z-10 not-first:before:h-px not-first:before:bg-border-separator", [e.link(t) ? "cursor-pointer" : void 0, T.value ? Tt : void 0, e.rowClass?.(t)]],
327
+ onClickCapture: f[0] || (f[0] = //@ts-ignore
328
+ (...r) => i(m).onClickCapture && i(m).onClickCapture(...r)),
329
+ onClick: (r) => i(m).onClick(r, t),
330
+ onContextmenu: (r) => i(m).onContextMenu(r, t),
331
+ onPointerdown: (r) => i(m).onPointerDown(r, t),
332
+ onPointermove: f[1] || (f[1] = //@ts-ignore
333
+ (...r) => i(m).onPointerMove && i(m).onPointerMove(...r)),
334
+ onPointerup: f[2] || (f[2] = //@ts-ignore
335
+ (...r) => i(m).cancelPress && i(m).cancelPress(...r)),
336
+ onPointercancel: f[3] || (f[3] = //@ts-ignore
337
+ (...r) => i(m).cancelPress && i(m).cancelPress(...r))
338
+ }), [
339
+ L(i(Ke), {
340
+ actions: i(m).swipeActions(t),
341
+ "content-class": "px-row-inset py-2.5"
342
+ }, {
343
+ default: F(() => [
344
+ u("div", nt, [
345
+ c.leading ? (s(), l("div", lt, [
346
+ S(o.$slots, "leading", {
347
+ item: t,
348
+ compact: !0
349
+ })
350
+ ])) : b("", !0),
351
+ u("div", rt, [
352
+ u("div", {
353
+ class: w(["grid min-w-0 items-start gap-x-3", U(t) ? "grid-cols-[minmax(0,1fr)_auto]" : "grid-cols-[minmax(0,1fr)]"]),
354
+ "data-test": "collection-row-head"
355
+ }, [
356
+ u("div", {
357
+ class: w(B.value ? "contents" : "col-start-1 row-start-1 min-w-0")
358
+ }, [
359
+ (s(!0), l(p, null, P(I.value, (r) => (s(), l(p, {
360
+ key: String(r.key)
361
+ }, [
362
+ z(r) ? S(o.$slots, H(r), {
363
+ item: t,
364
+ value: K(t, r),
365
+ compact: !0,
366
+ to: e.link(t),
367
+ search: e.search
368
+ }, void 0, void 0, 0) : B.value ? (s(), D(V, {
369
+ key: 1,
370
+ column: r,
371
+ item: t,
372
+ compact: !0,
373
+ to: e.link(t),
374
+ search: e.search,
375
+ spread: ""
376
+ }, null, 8, ["column", "item", "to", "search"])) : (s(), l("span", it, [
377
+ L(V, {
378
+ column: r,
379
+ item: t,
380
+ compact: !0,
381
+ to: e.link(t),
382
+ search: e.search
383
+ }, null, 8, ["column", "item", "to", "search"])
384
+ ]))
385
+ ], 64))), 128))
386
+ ], 2),
387
+ U(t) ? (s(), l("div", at, [
388
+ (s(!0), l(p, null, P(O.value, (r) => (s(), l(p, {
389
+ key: String(r.key)
390
+ }, [
391
+ z(r) ? S(o.$slots, H(r), {
392
+ item: t,
393
+ value: K(t, r),
394
+ compact: !0,
395
+ to: e.link(t),
396
+ search: e.search
397
+ }, void 0, void 0, 0) : (s(), D(V, {
398
+ key: 1,
399
+ column: r,
400
+ item: t,
401
+ compact: !0,
402
+ to: e.link(t),
403
+ search: e.search
404
+ }, null, 8, ["column", "item", "to", "search"]))
405
+ ], 64))), 128)),
406
+ G.value && ee(t) ? (s(), l("button", {
407
+ key: 0,
408
+ type: "button",
409
+ "data-test": "collection-row-more",
410
+ "aria-label": ae(t),
411
+ class: "hit-target -my-1 -mr-1 flex size-8 cursor-pointer items-center justify-center rounded-full text-content-muted active:bg-fill",
412
+ onClick: ve((r) => i(m).openMenuFrom(r, t), ["stop"])
413
+ }, [
414
+ L(i(J), {
415
+ name: "moreLine",
416
+ size: 20
417
+ })
418
+ ], 8, ct)) : b("", !0)
419
+ ])) : b("", !0)
420
+ ], 2),
421
+ j.value.length ? (s(), l("div", ut, [
422
+ (s(!0), l(p, null, P(j.value, (r) => (s(), l(p, {
423
+ key: String(r.key)
424
+ }, [
425
+ z(r) ? S(o.$slots, H(r), {
426
+ item: t,
427
+ value: K(t, r),
428
+ compact: !0,
429
+ to: e.link(t),
430
+ search: e.search
431
+ }, void 0, void 0, 0) : a(K(t, r)) ? b("", !0) : (s(), l("span", dt, [
432
+ L(V, {
433
+ column: r,
434
+ item: t,
435
+ compact: !0,
436
+ to: e.link(t),
437
+ search: e.search
438
+ }, null, 8, ["column", "item", "to", "search"])
439
+ ]))
440
+ ], 64))), 128))
441
+ ])) : b("", !0)
442
+ ])
443
+ ])
444
+ ]),
445
+ _: 2
446
+ }, 1032, ["actions"])
447
+ ], 16, st))), 128)) : b("", !0),
448
+ e.display === "failed" ? (s(), l("li", ft, [
449
+ S(o.$slots, "failed")
450
+ ])) : b("", !0),
451
+ de.value ? (s(), l("li", pt, [
452
+ S(o.$slots, "empty", {}, () => [
453
+ L(i(he), {
454
+ title: i(h)("core.collection.no_data")
455
+ }, null, 8, ["title"])
456
+ ])
457
+ ])) : b("", !0)
458
+ ], 16)) : (s(), l("div", yt, [
459
+ u("div", {
460
+ class: "overflow-x-auto",
461
+ style: M({ minHeight: Me.value })
462
+ }, [
463
+ u("table", {
464
+ class: w(["collection-grid w-full", { condensed: e.density === "condensed" }]),
465
+ role: T.value ? "presentation" : void 0
466
+ }, [
467
+ u("thead", ht, [
468
+ u("tr", null, [
469
+ (s(!0), l(p, null, P(e.columns, (t) => (s(), l("th", {
470
+ key: String(t.key),
471
+ scope: "col",
472
+ class: w(A(t)),
473
+ style: M({ width: t.width ? `${t.width}px` : void 0, textAlign: t.align ?? "start" }),
474
+ "aria-sort": Pe(t)
475
+ }, [
476
+ u("div", {
477
+ class: w(["flex", Ce[t.align ?? "start"]])
478
+ }, [
479
+ t.sort !== void 0 ? (s(), l("button", {
480
+ key: 0,
481
+ type: "button",
482
+ class: w(["group inline-flex cursor-pointer items-center gap-1 rounded-sm transition-colors hover:text-content-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus", [X(t) ? "font-semibold text-content-strong" : "", t.align === "end" ? "flex-row-reverse" : ""]]),
483
+ onClick: ($) => v("sort", t.sort)
484
+ }, [
485
+ u("span", null, C(t.label), 1),
486
+ L(i(J), {
487
+ name: Re(t),
488
+ size: 14,
489
+ class: w(X(t) ? "text-content-muted" : "text-content-disabled opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100")
490
+ }, null, 8, ["name", "class"])
491
+ ], 10, bt)) : (s(), l("span", kt, C(t.label), 1))
492
+ ], 2)
493
+ ], 14, mt))), 128)),
494
+ W.value ? (s(), l("th", gt, [
495
+ u("span", wt, C(i(h)("core.actions.more")), 1)
496
+ ])) : b("", !0)
497
+ ])
498
+ ]),
499
+ u("tbody", q({
500
+ ref_key: "list",
501
+ ref: Y
502
+ }, le.value, {
503
+ class: T.value ? "group/pick outline-0" : void 0
504
+ }), [
505
+ te.value ? (s(!0), l(p, { key: 0 }, P(e.skeletonRows, (t) => (s(), l("tr", {
506
+ key: `skeleton-${t}`,
507
+ "aria-hidden": "true",
508
+ style: M(e.rowHeight ? { height: `${e.rowHeight}px` } : void 0)
509
+ }, [
510
+ (s(!0), l(p, null, P(e.columns, ($, r) => (s(), l("td", {
511
+ key: String($.key),
512
+ class: w(_($))
513
+ }, [
514
+ u("div", {
515
+ class: "flex animate-pulse items-center gap-3 motion-reduce:animate-none",
516
+ style: M({ animationDelay: `${t * 60}ms` })
517
+ }, [
518
+ r === 0 ? (s(), l("span", _t)) : b("", !0),
519
+ u("span", xt, [
520
+ u("span", {
521
+ class: "h-2.5 rounded-full bg-fill-strong",
522
+ style: M({ width: `${55 + (t * 7 + r * 13) % 35}%` })
523
+ }, null, 4),
524
+ u("span", {
525
+ class: "h-2 rounded-full bg-fill",
526
+ style: M({ width: `${30 + (t * 11 + r * 5) % 30}%` })
527
+ }, null, 4)
528
+ ])
529
+ ], 4)
530
+ ], 2))), 128)),
531
+ W.value ? (s(), l("td", Ct, [...f[6] || (f[6] = [
532
+ u("div", { class: "mx-auto h-6 w-6 animate-pulse rounded-full bg-fill motion-reduce:animate-none" }, null, -1)
533
+ ])])) : b("", !0)
534
+ ], 4))), 128)) : b("", !0),
535
+ e.display === "rows" ? (s(!0), l(p, { key: 1 }, P(e.rows, (t, $) => (s(), l("tr", q({
536
+ key: e.rowKey(t),
537
+ class: "animate-row-in",
538
+ "data-test": "collection-row"
539
+ }, { ref_for: !0 }, re($), {
540
+ class: [e.link(t) ? "cursor-pointer" : void 0, T.value ? At : void 0, e.rowClass?.(t)],
541
+ style: [e.rowHeight ? { height: `${e.rowHeight}px` } : {}, ue($)],
542
+ onClickCapture: f[4] || (f[4] = //@ts-ignore
543
+ (...r) => i(m).onClickCapture && i(m).onClickCapture(...r)),
544
+ onClick: (r) => i(m).onClick(r, t),
545
+ onContextmenu: (r) => i(m).onContextMenu(r, t),
546
+ onPointerdown: (r) => i(m).onPointerDown(r, t)
547
+ }), [
548
+ (s(!0), l(p, null, P(e.columns, (r, Ee) => (s(), l("td", {
549
+ key: String(r.key),
550
+ class: w(xe(r))
551
+ }, [
552
+ S(o.$slots, H(r), {
553
+ item: t,
554
+ value: K(t, r),
555
+ compact: !1,
556
+ to: e.link(t)
557
+ }, () => [
558
+ L(V, {
559
+ column: r,
560
+ item: t,
561
+ compact: !1,
562
+ to: e.link(t),
563
+ search: e.search
564
+ }, De({ _: 2 }, [
565
+ c.leading && Ee === 0 ? {
566
+ name: "leading",
567
+ fn: F(() => [
568
+ S(o.$slots, "leading", {
569
+ item: t,
570
+ compact: !1
571
+ })
572
+ ]),
573
+ key: "0"
574
+ } : void 0
575
+ ]), 1032, ["column", "item", "to", "search"])
576
+ ])
577
+ ], 2))), 128)),
578
+ W.value ? (s(), l("td", St, [
579
+ S(o.$slots, "actions", { item: t }, () => [
580
+ u("div", Lt, [
581
+ e.link(t) ? (s(), D(i(ze), {
582
+ key: 0,
583
+ text: i(h)("core.collection.open_record"),
584
+ side: "left"
585
+ }, {
586
+ default: F(() => [
587
+ L(i(we), {
588
+ to: e.link(t),
589
+ "aria-label": `${i(h)("core.collection.open_record")}${e.rowLabel ? `: ${e.rowLabel(t)}` : ""}`,
590
+ class: "inline-flex rounded-md p-1.5 text-content-link transition-colors hover:bg-tint-soft focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus"
591
+ }, {
592
+ default: F(() => [
593
+ L(i(J), {
594
+ name: "eye",
595
+ size: 18
596
+ })
597
+ ]),
598
+ _: 1
599
+ }, 8, ["to", "aria-label"])
600
+ ]),
601
+ _: 2
602
+ }, 1032, ["text"])) : b("", !0),
603
+ G.value && ee(t) ? (s(), l("button", {
604
+ key: 1,
605
+ type: "button",
606
+ "data-test": "collection-row-more",
607
+ "aria-label": ae(t),
608
+ class: "hit-target flex size-8 cursor-pointer items-center justify-center rounded-full bg-fill text-content-strong transition-colors duration-motion-fast hover:bg-fill-strong focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus",
609
+ onClick: ve((r) => i(m).openMenuFrom(r, t), ["stop"])
610
+ }, [
611
+ L(i(J), {
612
+ name: "moreLine",
613
+ size: 18
614
+ })
615
+ ], 8, Pt)) : b("", !0)
616
+ ])
617
+ ])
618
+ ])) : b("", !0)
619
+ ], 16, $t))), 128)) : b("", !0),
620
+ e.display === "failed" ? (s(), l("tr", Rt, [
621
+ u("td", {
622
+ colspan: ce.value,
623
+ class: "!whitespace-normal py-6"
624
+ }, [
625
+ S(o.$slots, "failed")
626
+ ], 8, Mt)
627
+ ])) : b("", !0),
628
+ de.value ? (s(), l("tr", Et, [
629
+ u("td", {
630
+ colspan: ce.value,
631
+ class: "!whitespace-normal py-6 text-center"
632
+ }, [
633
+ S(o.$slots, "empty", {}, () => [
634
+ L(i(he), {
635
+ title: i(h)("core.collection.no_data")
636
+ }, null, 8, ["title"])
637
+ ])
638
+ ], 8, It)
639
+ ])) : b("", !0)
640
+ ], 16)
641
+ ], 10, vt)
642
+ ], 4)
643
+ ])),
644
+ e.rowActions ? (s(), D(i(Ne), {
645
+ key: 2,
646
+ ref_key: "rowMenu",
647
+ ref: ie,
648
+ items: i(m).menuItems.value,
649
+ label: i(m).menuLabel.value
650
+ }, null, 8, ["items", "label"])) : b("", !0)
651
+ ], 64));
652
+ }
653
+ });
654
+ function Xt(y) {
655
+ const n = je("(max-width: 1023px)"), d = g(() => y().some((e) => e.mobile && e.mobile !== "hidden"));
656
+ return { narrow: g(() => n.value), phone: g(() => n.value && d.value) };
657
+ }
658
+ export {
659
+ Wt as _,
660
+ V as a,
661
+ ke as b,
662
+ Xt as u
663
+ };
@@ -1,5 +1,5 @@
1
1
  import { a, r as o } from "./http-D_D9YbLH.js";
2
- import { i as r } from "./index-DoowoCS7.js";
2
+ import { i as r } from "./index-0QeMiN0l.js";
3
3
  const n = ["active", "locked", "inactive", "all"];
4
4
  function l(i) {
5
5
  return a({