@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.
- package/dist/aliases.d.ts +43 -30
- package/dist/aliases.js +9 -9
- package/dist/aliases.js.map +1 -1
- package/dist/components/ActionBar/ActionBar.js.map +1 -1
- package/dist/components/ActionBar/ActionBar.vue.d.ts +20 -2
- package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js +106 -41
- package/dist/components/ActionBar/ActionBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ActionBar/index.d.ts +1 -1
- package/dist/components/Board/Board.js.map +1 -1
- package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js +80 -148
- package/dist/components/Board/Board.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.vue.d.ts +4 -4
- package/dist/components/DataList/DataList.js.map +1 -1
- package/dist/components/DataList/DataList.vue.d.ts +7 -1
- package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js +187 -147
- package/dist/components/DataList/DataList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/components/Dialog/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/Filters/FilterChip.vue.d.ts +3 -3
- package/dist/components/Filters/FilterMenu.vue.d.ts +3 -3
- package/dist/components/Filters/SortMenu.vue.d.ts +3 -3
- package/dist/components/PropertyList/Editable.vue.d.ts +1 -1
- package/dist/components/Toast/ToastMessage.vue.d.ts +1 -1
- package/dist/components/Toast/Toaster.vue.d.ts +1 -1
- package/dist/components/internal/useDragMove.d.ts +50 -0
- package/dist/components/internal/useDragMove.js +132 -0
- package/dist/components/internal/useDragMove.js.map +1 -0
- package/dist/composables/toast.d.ts +12 -1
- package/dist/composables/toast.js +40 -21
- package/dist/composables/toast.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +25 -24
- package/dist/utils/settle.d.ts +18 -0
- package/dist/utils/settle.js +24 -0
- package/dist/utils/settle.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
import e from "../Skeleton/Skeleton.js";
|
|
2
|
-
import t from "../
|
|
3
|
-
import n from "../
|
|
4
|
-
import
|
|
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
|
|
7
|
+
var D = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "size-6 shrink-0"
|
|
9
|
-
},
|
|
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
|
-
],
|
|
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
|
-
],
|
|
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
|
-
},
|
|
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__*/
|
|
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__*/
|
|
68
|
-
setup(
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
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 ??
|
|
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 =
|
|
76
|
-
G = 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(
|
|
80
|
-
r < 0 && (G =
|
|
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
|
|
83
|
-
let t = e.map(
|
|
84
|
-
t.length && (
|
|
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
|
|
87
|
-
|
|
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
|
|
90
|
-
|
|
117
|
+
function Ce(e) {
|
|
118
|
+
j.selectable && e.shiftKey && e.preventDefault();
|
|
91
119
|
}
|
|
92
|
-
function
|
|
120
|
+
function we(e, t) {
|
|
93
121
|
if (e.target !== e.currentTarget || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
94
|
-
let n = [...
|
|
95
|
-
if ((i || a) && e.shiftKey &&
|
|
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
|
-
|
|
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 &&
|
|
101
|
-
else if (e.key.toLowerCase() === "x" &&
|
|
102
|
-
else if ((e.key === "Enter" || e.key === " ") &&
|
|
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 =
|
|
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 =
|
|
138
|
+
}, Z = a(() => Te[j.groupHeaderTone ?? (J.value ? "surface" : "sunken")]), Ee = a(() => {
|
|
111
139
|
let e = {};
|
|
112
|
-
return
|
|
113
|
-
}), Q = (e) => !!
|
|
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
|
-
],
|
|
148
|
+
], Oe = [
|
|
121
149
|
"5.5rem",
|
|
122
150
|
"4rem",
|
|
123
151
|
"4.75rem"
|
|
124
152
|
];
|
|
125
|
-
return (
|
|
153
|
+
return (t, a) => (g(), c("div", {
|
|
126
154
|
ref_key: "root",
|
|
127
|
-
ref:
|
|
128
|
-
class:
|
|
129
|
-
style:
|
|
130
|
-
}, [
|
|
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:
|
|
133
|
-
}, [
|
|
134
|
-
key:
|
|
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:
|
|
137
|
-
}, [
|
|
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:
|
|
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
|
-
|
|
142
|
-
|
|
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:
|
|
145
|
-
})) :
|
|
146
|
-
|
|
147
|
-
class:
|
|
148
|
-
style:
|
|
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
|
-
|
|
151
|
-
], 2), (
|
|
152
|
-
key:
|
|
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:
|
|
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
|
-
|
|
184
|
+
t.$slots.leading || Y.value ? (g(), o(e, {
|
|
157
185
|
key: 0,
|
|
158
186
|
shape: "circle",
|
|
159
187
|
size: "1.25rem"
|
|
160
|
-
})) :
|
|
161
|
-
|
|
188
|
+
})) : s("", !0),
|
|
189
|
+
d(e, {
|
|
162
190
|
height: "0.75rem",
|
|
163
|
-
width: $[(
|
|
191
|
+
width: $[(r * 3 + n) % $.length]
|
|
164
192
|
}, null, 8, ["width"]),
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
}),
|
|
197
|
+
}), d(e, {
|
|
170
198
|
height: "0.625rem",
|
|
171
199
|
width: "3.5rem"
|
|
172
|
-
})], 64)) :
|
|
173
|
-
], 2))), 128))], 2))), 128)) : (
|
|
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)) ? `${
|
|
177
|
-
class:
|
|
178
|
-
|
|
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:
|
|
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) ? (
|
|
215
|
+
H(e) ? (g(), c("button", {
|
|
187
216
|
key: 0,
|
|
188
|
-
"aria-controls": `${
|
|
189
|
-
"aria-expanded": !
|
|
190
|
-
"aria-label":
|
|
191
|
-
class:
|
|
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) =>
|
|
194
|
-
}, [(
|
|
222
|
+
onClick: (t) => be(e.id)
|
|
223
|
+
}, [(g(), c("svg", {
|
|
195
224
|
"aria-hidden": "true",
|
|
196
|
-
class:
|
|
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
|
-
}, [...
|
|
202
|
-
Q(e) ? (
|
|
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: `${
|
|
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(() => [
|
|
208
|
-
collapsed:
|
|
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
|
-
}, () => [
|
|
240
|
+
}, () => [u(b(e.header), 1)])]),
|
|
212
241
|
_: 2
|
|
213
|
-
}, 1032, ["id"])) : (
|
|
214
|
-
|
|
215
|
-
(
|
|
216
|
-
id: `${
|
|
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(() => [
|
|
248
|
+
default: w(() => [u(b(e.name), 1)]),
|
|
220
249
|
_: 2
|
|
221
250
|
}, 1032, ["id"])),
|
|
222
|
-
|
|
251
|
+
l("span", ae, b(e.count ?? e.items.length), 1)
|
|
223
252
|
], 64)),
|
|
224
|
-
|
|
225
|
-
|
|
253
|
+
l("span", oe, [v(t.$slots, "group-actions", { group: e })]),
|
|
254
|
+
f.onNew ? (g(), c("button", {
|
|
226
255
|
key: 3,
|
|
227
|
-
"aria-label":
|
|
228
|
-
class:
|
|
256
|
+
"aria-label": f.newLabel.replace("{group}", De(e)),
|
|
257
|
+
class: m(A),
|
|
229
258
|
type: "button",
|
|
230
|
-
onClick: (t) =>
|
|
231
|
-
}, [...
|
|
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
|
-
}, [
|
|
238
|
-
], 2)) :
|
|
239
|
-
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
|
-
}, [(
|
|
242
|
-
key:
|
|
243
|
-
disabled: !
|
|
244
|
-
items:
|
|
245
|
-
label:
|
|
246
|
-
onClickItem: (
|
|
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(() => [
|
|
249
|
-
class:
|
|
250
|
-
|
|
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 ? (
|
|
290
|
+
Y.value ? (g(), c("span", {
|
|
253
291
|
key: 0,
|
|
254
|
-
class:
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
"
|
|
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": (
|
|
300
|
+
"onUpdate:modelValue": (e) => K(i)
|
|
262
301
|
}, null, 8, [
|
|
263
302
|
"aria-label",
|
|
264
303
|
"model-value",
|
|
265
304
|
"onUpdate:modelValue"
|
|
266
|
-
])], 6)) :
|
|
267
|
-
X.value ? (
|
|
305
|
+
])], 6)) : s("", !0),
|
|
306
|
+
X.value ? (g(), c("span", {
|
|
268
307
|
key: 1,
|
|
269
|
-
class:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
"
|
|
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": (
|
|
314
|
+
"onUpdate:modelValue": (e) => K(i)
|
|
275
315
|
}, null, 8, [
|
|
276
316
|
"aria-label",
|
|
277
317
|
"model-value",
|
|
278
318
|
"onUpdate:modelValue"
|
|
279
|
-
])], 2)) :
|
|
280
|
-
|
|
281
|
-
class:
|
|
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:
|
|
284
|
-
tabindex:
|
|
285
|
-
onClick: (
|
|
286
|
-
onKeydown: (
|
|
287
|
-
onMousedown:
|
|
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
|
-
|
|
329
|
+
t.$slots.leading ? (g(), c("span", {
|
|
290
330
|
key: 0,
|
|
291
|
-
class:
|
|
292
|
-
}, [
|
|
293
|
-
item:
|
|
294
|
-
selected:
|
|
295
|
-
selecting:
|
|
296
|
-
toggle: () => K(
|
|
297
|
-
})], 2)) :
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
], 42,
|
|
301
|
-
],
|
|
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,
|
|
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 {
|
|
352
|
+
export { j as default };
|
|
313
353
|
|
|
314
354
|
//# sourceMappingURL=DataList.vue_vue_type_script_setup_true_lang.js.map
|