@sparklingopinions/sparkling-ui 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/aliases.d.ts +43 -30
  2. package/dist/aliases.js +9 -9
  3. package/dist/aliases.js.map +1 -1
  4. package/dist/components/ActionBar/ActionBar.js.map +1 -1
  5. package/dist/components/ActionBar/ActionBar.vue.d.ts +20 -2
  6. package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js +106 -41
  7. package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  8. package/dist/components/ActionBar/index.d.ts +1 -1
  9. package/dist/components/Board/Board.js.map +1 -1
  10. package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js +80 -148
  11. package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/ContextMenu/ContextMenu.vue.d.ts +4 -4
  13. package/dist/components/DataList/DataList.js.map +1 -1
  14. package/dist/components/DataList/DataList.vue.d.ts +7 -1
  15. package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js +187 -147
  16. package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +7 -7
  18. package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
  20. package/dist/components/Filters/FilterChip.vue.d.ts +3 -3
  21. package/dist/components/Filters/FilterMenu.vue.d.ts +3 -3
  22. package/dist/components/Filters/SortMenu.vue.d.ts +3 -3
  23. package/dist/components/PropertyList/Editable.vue.d.ts +1 -1
  24. package/dist/components/Toast/ToastMessage.vue.d.ts +1 -1
  25. package/dist/components/Toast/Toaster.vue.d.ts +1 -1
  26. package/dist/components/internal/useDragMove.d.ts +50 -0
  27. package/dist/components/internal/useDragMove.js +132 -0
  28. package/dist/components/internal/useDragMove.js.map +1 -0
  29. package/dist/composables/toast.d.ts +12 -1
  30. package/dist/composables/toast.js +40 -21
  31. package/dist/composables/toast.js.map +1 -1
  32. package/dist/index.d.ts +2 -1
  33. package/dist/index.js +25 -24
  34. package/dist/utils/settle.d.ts +18 -0
  35. package/dist/utils/settle.js +24 -0
  36. package/dist/utils/settle.js.map +1 -0
  37. package/package.json +1 -1
@@ -1,27 +1,36 @@
1
1
  import e from "../Skeleton/Skeleton.js";
2
- import t from "../Checkbox/Checkbox.js";
3
- import n from "../ContextMenu/ContextMenu.js";
4
- import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, normalizeClass as p, normalizeStyle as m, openBlock as h, renderList as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useId as x, useModel as S, useSlots as C, useTemplateRef as ee, vShow as te, withCtx as w, withDirectives as T } from "vue";
2
+ import { useDragMove as t } from "../internal/useDragMove.js";
3
+ import n from "../Checkbox/Checkbox.js";
4
+ import r from "../ContextMenu/ContextMenu.js";
5
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as p, normalizeClass as m, normalizeStyle as h, openBlock as g, renderList as _, renderSlot as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as ee, useModel as S, useSlots as C, useTemplateRef as te, vShow as ne, withCtx as w, withDirectives as T, withModifiers as E } from "vue";
5
6
  //#region src/components/DataList/DataList.vue?vue&type=script&setup=true&lang.ts
6
- var E = {
7
+ var D = {
7
8
  key: 0,
8
9
  class: "size-6 shrink-0"
9
- }, D = ["aria-label", "aria-labelledby"], ne = [
10
+ }, re = [
11
+ "aria-label",
12
+ "aria-labelledby",
13
+ "data-drag-zone"
14
+ ], ie = [
10
15
  "aria-controls",
11
16
  "aria-expanded",
12
17
  "aria-label",
13
18
  "onClick"
14
- ], re = { class: "text-13 text-sui-ink-muted tabular-nums" }, ie = { class: "ml-auto flex items-center gap-1" }, ae = ["aria-label", "onClick"], oe = ["id"], se = [
19
+ ], ae = { class: "text-13 text-sui-ink-muted tabular-nums" }, oe = { class: "ml-auto flex items-center gap-1" }, se = ["aria-label", "onClick"], ce = ["id"], le = ["data-drag-index", "onPointerdown"], ue = [
15
20
  "role",
16
21
  "tabindex",
17
22
  "onClick",
18
23
  "onKeydown"
19
- ], ce = { class: "min-w-0 flex-1 truncate font-medium text-sui-ink" }, O = {
24
+ ], de = { class: "min-w-0 flex-1 truncate font-medium text-sui-ink" }, fe = {
20
25
  key: 1,
21
26
  class: "flex shrink-0 items-center gap-2 text-xs text-sui-ink-muted tabular-nums"
22
- }, k = "overflow-clip rounded-xl border border-sui-line-subtle bg-sui-surface", A = "animate-pulse bg-sui-fill-hover", j = "flex size-6 shrink-0 items-center justify-center rounded-md text-sui-ink-muted outline-hidden transition-colors duration-150 hover:bg-sui-fill-hover hover:text-sui-ink focus-visible:sui-ring-inset", M = /*@__PURE__*/ d({
27
+ }, pe = {
28
+ key: 0,
29
+ "aria-hidden": "true",
30
+ class: "h-0.5 bg-sui-accent-solid"
31
+ }, O = "overflow-clip rounded-xl border border-sui-line-subtle bg-sui-surface", k = "animate-pulse bg-sui-fill-hover", A = "flex size-6 shrink-0 items-center justify-center rounded-md text-sui-ink-muted outline-hidden transition-colors duration-150 hover:bg-sui-fill-hover hover:text-sui-ink focus-visible:sui-ring-inset", j = /*@__PURE__*/ f({
23
32
  __name: "DataList",
24
- props: /*@__PURE__*/ f({
33
+ props: /*@__PURE__*/ p({
25
34
  groups: {},
26
35
  rowKey: { default: "id" },
27
36
  selectable: { type: Boolean },
@@ -41,6 +50,14 @@ var E = {
41
50
  type: Boolean,
42
51
  default: !1
43
52
  },
53
+ draggable: {
54
+ type: Boolean,
55
+ default: !1
56
+ },
57
+ hideEmpty: {
58
+ type: Boolean,
59
+ default: !1
60
+ },
44
61
  contextItems: {
45
62
  type: Function,
46
63
  default: void 0
@@ -64,251 +81,274 @@ var E = {
64
81
  collapsed: { default: () => [] },
65
82
  collapsedModifiers: {}
66
83
  }),
67
- emits: /*@__PURE__*/ f(["context-item"], ["update:selected", "update:collapsed"]),
68
- setup(d, { emit: f }) {
69
- let M = d, N = f, P = S(d, "selected"), F = S(d, "collapsed"), le = C(), I = x(), L = ee("root"), R = (e) => e[M.rowKey ?? "id"], z = i(() => !!M.onRowClick || M.selectable), B = i(() => !M.loading && M.groups.every((e) => e.items.length === 0));
70
- function V(e) {
71
- F.value = F.value.includes(e) ? F.value.filter((t) => t !== e) : [...F.value, e];
84
+ emits: /*@__PURE__*/ p(["context-item", "move"], ["update:selected", "update:collapsed"]),
85
+ setup(f, { emit: p }) {
86
+ let j = f, M = p, N = S(f, "selected"), P = S(f, "collapsed"), me = C(), F = ee(), I = te("root"), L = (e) => e[j.rowKey ?? "id"], R = a(() => !!j.onRowClick || j.selectable), { dragged: z, target: B, onPointerDown: he, endedDrag: ge } = t({
87
+ root: I,
88
+ countOf: (e) => j.groups.find((t) => t.id === e)?.items.length ?? 0,
89
+ onMove: (e, t, n) => M("move", e, t, n),
90
+ ghostMaxWidth: 360,
91
+ tilt: !1,
92
+ ghostStyle: {
93
+ background: "rgb(var(--sui-raised))",
94
+ border: "1px solid rgb(var(--sui-edge))",
95
+ borderRadius: "10px"
96
+ }
97
+ }), _e = a(() => j.hideEmpty && !z.value ? j.groups.filter((e) => e.items.length > 0) : j.groups), ve = (e, t, n) => B.value?.zone === e && B.value.index === t && z.value?.id !== L(n) && z.value?.zone !== e, ye = (e) => B.value?.zone === e.id && z.value?.zone !== e.id && B.value.index >= e.items.length, V = a(() => !j.loading && j.groups.every((e) => e.items.length === 0));
98
+ function be(e) {
99
+ P.value = P.value.includes(e) ? P.value.filter((t) => t !== e) : [...P.value, e];
72
100
  }
73
- let H = (e) => e.collapsible ?? M.collapsible, U = (e) => H(e) && F.value.includes(e.id), W = i(() => M.groups.filter((e) => !U(e)).flatMap((e) => e.items)), G;
101
+ let H = (e) => e.collapsible ?? j.collapsible, U = (e) => H(e) && P.value.includes(e.id), W = a(() => j.groups.filter((e) => !U(e)).flatMap((e) => e.items)), G;
74
102
  function K(e) {
75
- let t = R(e);
76
- G = t, P.value = P.value.includes(t) ? P.value.filter((e) => e !== t) : [...P.value, t];
103
+ let t = L(e);
104
+ G = t, N.value = N.value.includes(t) ? N.value.filter((e) => e !== t) : [...N.value, t];
77
105
  }
78
106
  function q(e) {
79
- let t = W.value.map(R), n = t.indexOf(R(e)), r = t.indexOf(G), i = r < 0 ? [t[n]] : t.slice(Math.min(r, n), Math.max(r, n) + 1);
80
- r < 0 && (G = R(e)), P.value = [...P.value, ...i.filter((e) => !P.value.includes(e))];
107
+ let t = W.value.map(L), n = t.indexOf(L(e)), r = t.indexOf(G), i = r < 0 ? [t[n]] : t.slice(Math.min(r, n), Math.max(r, n) + 1);
108
+ r < 0 && (G = L(e)), N.value = [...N.value, ...i.filter((e) => !N.value.includes(e))];
81
109
  }
82
- function ue(...e) {
83
- let t = e.map(R).filter((e) => !P.value.includes(e));
84
- t.length && (P.value = [...P.value, ...new Set(t)]);
110
+ function xe(...e) {
111
+ let t = e.map(L).filter((e) => !N.value.includes(e));
112
+ t.length && (N.value = [...N.value, ...new Set(t)]);
85
113
  }
86
- function de(e, t) {
87
- M.selectable && e.shiftKey ? q(t) : M.selectable && (e.metaKey || e.ctrlKey) || M.selectable && Y.value && P.value.length ? K(t) : M.onRowClick?.(t);
114
+ function Se(e, t) {
115
+ ge() || (j.selectable && e.shiftKey ? q(t) : j.selectable && (e.metaKey || e.ctrlKey) || j.selectable && Y.value && N.value.length ? K(t) : j.onRowClick?.(t));
88
116
  }
89
- function fe(e) {
90
- M.selectable && e.shiftKey && e.preventDefault();
117
+ function Ce(e) {
118
+ j.selectable && e.shiftKey && e.preventDefault();
91
119
  }
92
- function pe(e, t) {
120
+ function we(e, t) {
93
121
  if (e.target !== e.currentTarget || e.metaKey || e.ctrlKey || e.altKey) return;
94
- let n = [...L.value?.querySelectorAll("[data-list-row]") ?? []].filter((e) => e.closest("ul")?.style.display !== "none"), r = n.indexOf(e.currentTarget), i = e.key === "ArrowDown" || e.key === "j", a = e.key === "ArrowUp" || e.key === "k";
95
- if ((i || a) && e.shiftKey && M.selectable) {
122
+ let n = [...I.value?.querySelectorAll("[data-list-row]") ?? []].filter((e) => e.closest("ul")?.style.display !== "none"), r = n.indexOf(e.currentTarget), i = e.key === "ArrowDown" || e.key === "j", a = e.key === "ArrowUp" || e.key === "k";
123
+ if ((i || a) && e.shiftKey && j.selectable) {
96
124
  let e = i ? Math.min(n.length - 1, r + 1) : Math.max(0, r - 1), a = W.value[e];
97
- ue(t, ...a ? [a] : []), n[e]?.focus();
125
+ xe(t, ...a ? [a] : []), n[e]?.focus();
98
126
  } else if (i) n[Math.min(n.length - 1, r + 1)]?.focus();
99
127
  else if (a) n[Math.max(0, r - 1)]?.focus();
100
- else if (e.key === " " && e.shiftKey && M.selectable) q(t);
101
- else if (e.key.toLowerCase() === "x" && M.selectable) K(t);
102
- else if ((e.key === "Enter" || e.key === " ") && M.onRowClick) M.onRowClick(t);
128
+ else if (e.key === " " && e.shiftKey && j.selectable) q(t);
129
+ else if (e.key.toLowerCase() === "x" && j.selectable) K(t);
130
+ else if ((e.key === "Enter" || e.key === " ") && j.onRowClick) j.onRowClick(t);
103
131
  else return;
104
132
  e.preventDefault();
105
133
  }
106
- let J = i(() => M.variant === "cards"), Y = i(() => M.selectable && M.checkboxPlacement === "leading"), X = i(() => M.selectable && M.checkboxPlacement === "gutter"), me = {
134
+ let J = a(() => j.variant === "cards"), Y = a(() => j.selectable && j.checkboxPlacement === "leading"), X = a(() => j.selectable && j.checkboxPlacement === "gutter"), Te = {
107
135
  sunken: "sui-band",
108
136
  surface: "bg-sui-surface",
109
137
  canvas: "bg-sui-canvas"
110
- }, Z = i(() => me[M.groupHeaderTone ?? (J.value ? "surface" : "sunken")]), he = i(() => {
138
+ }, Z = a(() => Te[j.groupHeaderTone ?? (J.value ? "surface" : "sunken")]), Ee = a(() => {
111
139
  let e = {};
112
- return M.rowHeight !== void 0 && (e["--sui-list-row"] = `${M.rowHeight}px`), M.groupHeaderHeight !== void 0 && (e["--sui-list-header"] = `${M.groupHeaderHeight}px`), Object.keys(e).length ? e : void 0;
113
- }), Q = (e) => !!le["group-header"] || e.header !== void 0, ge = (e) => e.label ?? e.name ?? "", $ = [
140
+ return j.rowHeight !== void 0 && (e["--sui-list-row"] = `${j.rowHeight}px`), j.groupHeaderHeight !== void 0 && (e["--sui-list-header"] = `${j.groupHeaderHeight}px`), Object.keys(e).length ? e : void 0;
141
+ }), Q = (e) => !!me["group-header"] || e.header !== void 0, De = (e) => e.label ?? e.name ?? "", $ = [
114
142
  "42%",
115
143
  "58%",
116
144
  "35%",
117
145
  "50%",
118
146
  "46%",
119
147
  "38%"
120
- ], _e = [
148
+ ], Oe = [
121
149
  "5.5rem",
122
150
  "4rem",
123
151
  "4.75rem"
124
152
  ];
125
- return (i, f) => (h(), s("div", {
153
+ return (t, a) => (g(), c("div", {
126
154
  ref_key: "root",
127
- ref: L,
128
- class: p(["flex flex-col text-13 text-sui-ink", J.value ? "gap-3" : k]),
129
- style: m(he.value)
130
- }, [B.value && i.$slots.empty ? (h(), s("div", {
155
+ ref: I,
156
+ class: m(["flex flex-col text-13 text-sui-ink", J.value ? "gap-3" : O]),
157
+ style: h(Ee.value)
158
+ }, [V.value && t.$slots.empty ? (g(), c("div", {
131
159
  key: 0,
132
- class: p(J.value && k)
133
- }, [_(i.$slots, "empty")], 2)) : d.loading ? (h(!0), s(r, { key: 1 }, g(d.loadingGroups, (t, n) => (h(), s("section", {
134
- key: n,
160
+ class: m(J.value && O)
161
+ }, [v(t.$slots, "empty")], 2)) : f.loading ? (g(!0), c(i, { key: 1 }, _(f.loadingGroups, (n, r) => (g(), c("section", {
162
+ key: r,
135
163
  "aria-busy": "true",
136
- class: p(J.value ? k : "border-t border-sui-line-subtle first:border-t-0")
137
- }, [c("div", {
164
+ class: m(J.value ? O : "border-t border-sui-line-subtle first:border-t-0")
165
+ }, [l("div", {
138
166
  "aria-hidden": "true",
139
- class: p(["flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2", [Z.value, d.collapsible ? "pl-1.5" : "pl-4"]])
167
+ class: m(["flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2", [Z.value, f.collapsible ? "pl-1.5" : "pl-4"]])
140
168
  }, [
141
- d.collapsible ? (h(), s("span", E)) : o("", !0),
142
- i.$slots["group-leading"] || i.$slots["group-header"] ? (h(), s("span", {
169
+ f.collapsible ? (g(), c("span", D)) : s("", !0),
170
+ t.$slots["group-leading"] || t.$slots["group-header"] ? (g(), c("span", {
143
171
  key: 1,
144
- class: p(["size-3.5 rounded-full", A])
145
- })) : o("", !0),
146
- c("span", {
147
- class: p(["h-2.5 rounded-md", A]),
148
- style: m({ width: _e[n % 3] })
172
+ class: m(["size-3.5 rounded-full", k])
173
+ })) : s("", !0),
174
+ l("span", {
175
+ class: m(["h-2.5 rounded-md", k]),
176
+ style: h({ width: Oe[r % 3] })
149
177
  }, null, 4),
150
- c("span", { class: p(["h-2.5 w-3.5 rounded-md", A]) })
151
- ], 2), (h(!0), s(r, null, g(t, (t) => (h(), s("div", {
152
- key: t,
178
+ l("span", { class: m(["h-2.5 w-3.5 rounded-md", k]) })
179
+ ], 2), (g(!0), c(i, null, _(n, (n) => (g(), c("div", {
180
+ key: n,
153
181
  "aria-hidden": "true",
154
- class: p(["flex h-[var(--sui-list-row,2.5rem)] items-center gap-2.5 pr-4", [X.value ? "pl-9.5" : "pl-4", d.dividers && "[&+&]:border-t [&+&]:border-sui-line-subtle"]])
182
+ class: m(["flex h-[var(--sui-list-row,2.5rem)] items-center gap-2.5 pr-4", [X.value ? "pl-9.5" : "pl-4", f.dividers && "[&+&]:border-t [&+&]:border-sui-line-subtle"]])
155
183
  }, [
156
- i.$slots.leading || Y.value ? (h(), a(e, {
184
+ t.$slots.leading || Y.value ? (g(), o(e, {
157
185
  key: 0,
158
186
  shape: "circle",
159
187
  size: "1.25rem"
160
- })) : o("", !0),
161
- u(e, {
188
+ })) : s("", !0),
189
+ d(e, {
162
190
  height: "0.75rem",
163
- width: $[(n * 3 + t) % $.length]
191
+ width: $[(r * 3 + n) % $.length]
164
192
  }, null, 8, ["width"]),
165
- f[0] ||= c("span", { class: "flex-1" }, null, -1),
166
- i.$slots.meta ? (h(), s(r, { key: 1 }, [u(e, {
193
+ a[1] ||= l("span", { class: "flex-1" }, null, -1),
194
+ t.$slots.meta ? (g(), c(i, { key: 1 }, [d(e, {
167
195
  height: "0.625rem",
168
196
  width: "6rem"
169
- }), u(e, {
197
+ }), d(e, {
170
198
  height: "0.625rem",
171
199
  width: "3.5rem"
172
- })], 64)) : o("", !0)
173
- ], 2))), 128))], 2))), 128)) : (h(!0), s(r, { key: 2 }, g(d.groups, (e) => (h(), s("section", {
200
+ })], 64)) : s("", !0)
201
+ ], 2))), 128))], 2))), 128)) : (g(!0), c(i, { key: 2 }, _(_e.value, (e) => (g(), c("section", {
174
202
  key: e.id,
175
203
  "aria-label": e.label,
176
- "aria-labelledby": !e.label && (e.name || Q(e)) ? `${b(I)}-${e.id}-name` : void 0,
177
- class: p(J.value ? k : "border-t border-sui-line-subtle first:border-t-0")
178
- }, [e.name || Q(e) ? (h(), s("header", {
204
+ "aria-labelledby": !e.label && (e.name || Q(e)) ? `${x(F)}-${e.id}-name` : void 0,
205
+ class: m([J.value ? O : "border-t border-sui-line-subtle first:border-t-0", x(z) && x(B)?.zone === e.id && x(z).zone !== e.id && "ring-2 ring-sui-accent-line ring-inset"]),
206
+ "data-drag-zone": f.draggable ? e.id : void 0
207
+ }, [e.name || Q(e) ? (g(), c("header", {
179
208
  key: 0,
180
- class: p(["flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2", [
209
+ class: m(["flex h-[var(--sui-list-header,2.25rem)] items-center gap-2 border-b border-sui-line-subtle pr-2", [
181
210
  Z.value,
182
211
  !J.value && "sticky top-0 z-10",
183
212
  H(e) ? "pl-1.5" : "pl-4"
184
213
  ]])
185
214
  }, [
186
- H(e) ? (h(), s("button", {
215
+ H(e) ? (g(), c("button", {
187
216
  key: 0,
188
- "aria-controls": `${b(I)}-${e.id}`,
189
- "aria-expanded": !F.value.includes(e.id),
190
- "aria-label": F.value.includes(e.id) ? d.expandLabel : d.collapseLabel,
191
- class: p(j),
217
+ "aria-controls": `${x(F)}-${e.id}`,
218
+ "aria-expanded": !P.value.includes(e.id),
219
+ "aria-label": P.value.includes(e.id) ? f.expandLabel : f.collapseLabel,
220
+ class: m(A),
192
221
  type: "button",
193
- onClick: (t) => V(e.id)
194
- }, [(h(), s("svg", {
222
+ onClick: (t) => be(e.id)
223
+ }, [(g(), c("svg", {
195
224
  "aria-hidden": "true",
196
- class: p(["size-3 fill-none stroke-current transition-transform duration-150", U(e) && "-rotate-90"]),
225
+ class: m(["size-3 fill-none stroke-current transition-transform duration-150", U(e) && "-rotate-90"]),
197
226
  "stroke-linecap": "round",
198
227
  "stroke-linejoin": "round",
199
228
  "stroke-width": "1.5",
200
229
  viewBox: "0 0 12 12"
201
- }, [...f[1] ||= [c("path", { d: "M3 4.5 6 7.5l3-3" }, null, -1)]], 2))], 8, ne)) : o("", !0),
202
- Q(e) ? (h(), a(v(`h${d.headingLevel}`), {
230
+ }, [...a[2] ||= [l("path", { d: "M3 4.5 6 7.5l3-3" }, null, -1)]], 2))], 8, ie)) : s("", !0),
231
+ Q(e) ? (g(), o(y(`h${f.headingLevel}`), {
203
232
  key: 1,
204
- id: `${b(I)}-${e.id}-name`,
233
+ id: `${x(F)}-${e.id}-name`,
205
234
  class: "m-0 flex min-w-0 items-center gap-2 text-13 font-medium text-sui-ink"
206
235
  }, {
207
- default: w(() => [_(i.$slots, "group-header", {
208
- collapsed: F.value.includes(e.id),
236
+ default: w(() => [v(t.$slots, "group-header", {
237
+ collapsed: P.value.includes(e.id),
209
238
  count: e.count ?? e.items.length,
210
239
  group: e
211
- }, () => [l(y(e.header), 1)])]),
240
+ }, () => [u(b(e.header), 1)])]),
212
241
  _: 2
213
- }, 1032, ["id"])) : (h(), s(r, { key: 2 }, [
214
- _(i.$slots, "group-leading", { group: e }),
215
- (h(), a(v(`h${d.headingLevel}`), {
216
- id: `${b(I)}-${e.id}-name`,
242
+ }, 1032, ["id"])) : (g(), c(i, { key: 2 }, [
243
+ v(t.$slots, "group-leading", { group: e }),
244
+ (g(), o(y(`h${f.headingLevel}`), {
245
+ id: `${x(F)}-${e.id}-name`,
217
246
  class: "m-0 text-13 font-medium text-sui-ink"
218
247
  }, {
219
- default: w(() => [l(y(e.name), 1)]),
248
+ default: w(() => [u(b(e.name), 1)]),
220
249
  _: 2
221
250
  }, 1032, ["id"])),
222
- c("span", re, y(e.count ?? e.items.length), 1)
251
+ l("span", ae, b(e.count ?? e.items.length), 1)
223
252
  ], 64)),
224
- c("span", ie, [_(i.$slots, "group-actions", { group: e })]),
225
- d.onNew ? (h(), s("button", {
253
+ l("span", oe, [v(t.$slots, "group-actions", { group: e })]),
254
+ f.onNew ? (g(), c("button", {
226
255
  key: 3,
227
- "aria-label": d.newLabel.replace("{group}", ge(e)),
228
- class: p(j),
256
+ "aria-label": f.newLabel.replace("{group}", De(e)),
257
+ class: m(A),
229
258
  type: "button",
230
- onClick: (t) => d.onNew(e)
231
- }, [...f[2] ||= [c("svg", {
259
+ onClick: (t) => f.onNew(e)
260
+ }, [...a[3] ||= [l("svg", {
232
261
  "aria-hidden": "true",
233
262
  class: "size-3.5 fill-none stroke-current",
234
263
  "stroke-linecap": "round",
235
264
  "stroke-width": "1.5",
236
265
  viewBox: "0 0 14 14"
237
- }, [c("path", { d: "M7 2.5v9M2.5 7h9" })], -1)]], 8, ae)) : o("", !0)
238
- ], 2)) : o("", !0), T(c("ul", {
239
- id: `${b(I)}-${e.id}`,
266
+ }, [l("path", { d: "M7 2.5v9M2.5 7h9" })], -1)]], 8, se)) : s("", !0)
267
+ ], 2)) : s("", !0), T(l("ul", {
268
+ id: `${x(F)}-${e.id}`,
240
269
  class: "m-0 list-none p-0"
241
- }, [(h(!0), s(r, null, g(e.items, (e) => (h(), a(n, {
242
- key: R(e),
243
- disabled: !d.contextItems,
244
- items: d.contextItems?.(e),
245
- label: d.contextLabel,
246
- onClickItem: (t) => N("context-item", t, e)
270
+ }, [(g(!0), c(i, null, _(e.items, (i, p) => (g(), o(r, {
271
+ key: L(i),
272
+ disabled: !f.contextItems,
273
+ items: f.contextItems?.(i),
274
+ label: f.contextLabel,
275
+ onClickItem: (e) => M("context-item", e, i)
247
276
  }, {
248
- default: w(() => [c("li", {
249
- class: p(["group/row relative flex h-[var(--sui-list-row,2.5rem)] items-center transition-colors duration-100 has-focus-visible:sui-ring-inset", [d.dividers && "[&+&]:border-t [&+&]:border-sui-line-subtle", P.value.includes(R(e)) ? "bg-sui-accent-wash" : "hover:bg-sui-fill-hover has-focus-visible:bg-sui-fill-hover"]]),
250
- style: m(e.depth ? { paddingLeft: `${e.depth * 22}px` } : void 0)
277
+ default: w(() => [l("li", {
278
+ class: m(["group/row relative flex h-[var(--sui-list-row,2.5rem)] items-center transition-[background-color,opacity] duration-100 has-focus-visible:sui-ring-inset", [
279
+ f.dividers && "[&+&]:border-t [&+&]:border-sui-line-subtle",
280
+ f.draggable && "select-none",
281
+ x(z)?.id === L(i) && "opacity-40",
282
+ ve(e.id, p, i) && "shadow-[inset_0_2px_0_rgb(var(--sui-accent-solid))]",
283
+ N.value.includes(L(i)) ? "bg-sui-accent-wash" : "hover:bg-sui-fill-hover has-focus-visible:bg-sui-fill-hover"
284
+ ]]),
285
+ "data-drag-index": f.draggable ? p : void 0,
286
+ style: h(i.depth ? { paddingLeft: `${i.depth * 22}px` } : void 0),
287
+ onDragstart: a[0] ||= E(() => {}, ["prevent"]),
288
+ onPointerdown: (t) => f.draggable && x(he)(t, L(i), e.id, p)
251
289
  }, [
252
- Y.value ? (h(), s("span", {
290
+ Y.value ? (g(), c("span", {
253
291
  key: 0,
254
- class: p(["absolute top-1/2 z-[1] flex size-4 -translate-y-1/2 items-center justify-center", !P.value.length && "hidden group-hover/row:flex group-has-focus-visible/row:flex"]),
292
+ class: m(["absolute top-1/2 z-[1] flex size-4 -translate-y-1/2 items-center justify-center", !N.value.length && "hidden group-hover/row:flex group-has-focus-visible/row:flex"]),
255
293
  "data-list-check": "",
256
- style: m({ left: `${16 + (e.depth ?? 0) * 22}px` })
257
- }, [u(t, {
258
- "aria-label": d.selectLabel,
259
- "model-value": P.value.includes(R(e)),
294
+ "data-no-drag": "",
295
+ style: h({ left: `${16 + (i.depth ?? 0) * 22}px` })
296
+ }, [d(n, {
297
+ "aria-label": f.selectLabel,
298
+ "model-value": N.value.includes(L(i)),
260
299
  tabindex: "-1",
261
- "onUpdate:modelValue": (t) => K(e)
300
+ "onUpdate:modelValue": (e) => K(i)
262
301
  }, null, 8, [
263
302
  "aria-label",
264
303
  "model-value",
265
304
  "onUpdate:modelValue"
266
- ])], 6)) : o("", !0),
267
- X.value ? (h(), s("span", {
305
+ ])], 6)) : s("", !0),
306
+ X.value ? (g(), c("span", {
268
307
  key: 1,
269
- class: p(["flex w-7 shrink-0 justify-end transition-opacity duration-100", P.value.length ? "opacity-100" : "opacity-0 group-hover/row:opacity-100"])
270
- }, [u(t, {
271
- "aria-label": d.selectLabel,
272
- "model-value": P.value.includes(R(e)),
308
+ class: m(["flex w-7 shrink-0 justify-end transition-opacity duration-100", N.value.length ? "opacity-100" : "opacity-0 group-hover/row:opacity-100"]),
309
+ "data-no-drag": ""
310
+ }, [d(n, {
311
+ "aria-label": f.selectLabel,
312
+ "model-value": N.value.includes(L(i)),
273
313
  tabindex: "-1",
274
- "onUpdate:modelValue": (t) => K(e)
314
+ "onUpdate:modelValue": (e) => K(i)
275
315
  }, null, 8, [
276
316
  "aria-label",
277
317
  "model-value",
278
318
  "onUpdate:modelValue"
279
- ])], 2)) : o("", !0),
280
- c("div", {
281
- class: p(["flex h-full min-w-0 flex-1 items-center gap-2.5 pr-4 outline-hidden", [X.value ? "pl-2.5" : "pl-4", (d.onRowClick || d.selectable) && "cursor-pointer"]]),
319
+ ])], 2)) : s("", !0),
320
+ l("div", {
321
+ class: m(["flex h-full min-w-0 flex-1 items-center gap-2.5 pr-4 outline-hidden", [X.value ? "pl-2.5" : "pl-4", (f.onRowClick || f.selectable) && "cursor-pointer"]]),
282
322
  "data-list-row": "",
283
- role: d.onRowClick ? "button" : void 0,
284
- tabindex: z.value ? 0 : void 0,
285
- onClick: (t) => de(t, e),
286
- onKeydown: (t) => pe(t, e),
287
- onMousedown: fe
323
+ role: f.onRowClick ? "button" : void 0,
324
+ tabindex: R.value ? 0 : void 0,
325
+ onClick: (e) => Se(e, i),
326
+ onKeydown: (e) => we(e, i),
327
+ onMousedown: Ce
288
328
  }, [
289
- i.$slots.leading ? (h(), s("span", {
329
+ t.$slots.leading ? (g(), c("span", {
290
330
  key: 0,
291
- class: p(["flex shrink-0 items-center gap-2 text-sui-ink-muted tabular-nums", Y.value && (P.value.length ? "[&>*:first-child]:invisible" : "group-hover/row:[&>*:first-child]:invisible group-has-focus-visible/row:[&>*:first-child]:invisible")])
292
- }, [_(i.$slots, "leading", {
293
- item: e,
294
- selected: P.value.includes(R(e)),
295
- selecting: P.value.length > 0,
296
- toggle: () => K(e)
297
- })], 2)) : o("", !0),
298
- c("span", ce, [_(i.$slots, "title", { item: e }, () => [l(y(e.name), 1)])]),
299
- i.$slots.meta ? (h(), s("span", O, [_(i.$slots, "meta", { item: e })])) : o("", !0)
300
- ], 42, se)
301
- ], 6)]),
331
+ class: m(["flex shrink-0 items-center gap-2 text-sui-ink-muted tabular-nums", Y.value && (N.value.length ? "[&>*:first-child]:invisible" : "group-hover/row:[&>*:first-child]:invisible group-has-focus-visible/row:[&>*:first-child]:invisible")])
332
+ }, [v(t.$slots, "leading", {
333
+ item: i,
334
+ selected: N.value.includes(L(i)),
335
+ selecting: N.value.length > 0,
336
+ toggle: () => K(i)
337
+ })], 2)) : s("", !0),
338
+ l("span", de, [v(t.$slots, "title", { item: i }, () => [u(b(i.name), 1)])]),
339
+ t.$slots.meta ? (g(), c("span", fe, [v(t.$slots, "meta", { item: i })])) : s("", !0)
340
+ ], 42, ue)
341
+ ], 46, le)]),
302
342
  _: 2
303
343
  }, 1032, [
304
344
  "disabled",
305
345
  "items",
306
346
  "label",
307
347
  "onClickItem"
308
- ]))), 128))], 8, oe), [[te, !U(e)]])], 10, D))), 128))], 6));
348
+ ]))), 128)), x(z) && ye(e) ? (g(), c("li", pe)) : s("", !0)], 8, ce), [[ne, !U(e)]])], 10, re))), 128))], 6));
309
349
  }
310
350
  });
311
351
  //#endregion
312
- export { M as default };
352
+ export { j as default };
313
353
 
314
354
  //# sourceMappingURL=DataList.vue_vue_type_script_setup_true_lang.js.map