@nubisco/ui 5.19.0 → 5.20.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/{ActionGroup-CMuposow.cjs → ActionGroup-CUN48Qea.cjs} +1 -1
- package/dist/{ActionGroup-0u17QzT8.js → ActionGroup-lEopoloN.js} +1 -1
- package/dist/BarChart-Bnkibwcl.js +294 -0
- package/dist/BarChart-CjxY_3RM.cjs +1 -0
- package/dist/{Confirm-OMhu2Fuz.js → Confirm-Dh1H2PMh.js} +1 -1
- package/dist/{Confirm-DCkG5bUZ.cjs → Confirm-ue689l-w.cjs} +1 -1
- package/dist/DataTable-CQBI0wcg.js +412 -0
- package/dist/DataTable-DN4SbClx.cjs +1 -0
- package/dist/{DatePicker-MDaQ2l8I.js → DatePicker-ViTSDX6d.js} +162 -135
- package/dist/DatePicker-lv4wQxf8.cjs +1 -0
- package/dist/LineChart-Bol60gtX.cjs +1 -0
- package/dist/{LineChart-DG_ows6r.js → LineChart-CsBHPIUF.js} +25 -21
- package/dist/{Menu-D-zvh-SA.js → Menu-2Se8F81Q.js} +1 -1
- package/dist/Menu-CAZmNx60.cjs +1 -0
- package/dist/{MenuBarItem-BDqp9LzY.js → MenuBarItem-Cxxs8Dnr.js} +1 -1
- package/dist/{MenuBarItem-Dmutkr1p.cjs → MenuBarItem-dBEuTZ3Q.cjs} +1 -1
- package/dist/{Modal-C97dRTiP.js → Modal-BxSP1eyD.js} +2 -2
- package/dist/{Modal-BNgLfB88.cjs → Modal-sGlC__uQ.cjs} +1 -1
- package/dist/{Pagination-Br-k9zuG.js → Pagination-BveCRx-Z.js} +1 -1
- package/dist/{Pagination-CCMhqtoz.cjs → Pagination-DlTqW-zR.cjs} +1 -1
- package/dist/Select-D4Il1NaM.js +489 -0
- package/dist/Select-MwbDOqbP.cjs +1 -0
- package/dist/Tabs-Bmw1hFrN.cjs +1 -0
- package/dist/Tabs-CjXOZ3K6.js +196 -0
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +12 -12
- package/dist/components/ActionGroup.cjs +1 -1
- package/dist/components/ActionGroup.mjs +1 -1
- package/dist/components/Charts/BarChart.cjs +1 -1
- package/dist/components/Charts/BarChart.d.ts +8 -1
- package/dist/components/Charts/BarChart.mjs +1 -1
- package/dist/components/Charts/BarChart.vue.d.ts.map +1 -1
- package/dist/components/Charts/LineChart.cjs +1 -1
- package/dist/components/Charts/LineChart.d.ts +8 -1
- package/dist/components/Charts/LineChart.mjs +1 -1
- package/dist/components/Charts/LineChart.vue.d.ts.map +1 -1
- package/dist/components/Charts/shared/types.d.ts +7 -0
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DataTable.vue.d.ts.map +1 -1
- package/dist/components/DatePicker.cjs +1 -1
- package/dist/components/DatePicker.mjs +1 -1
- package/dist/components/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/Menu.cjs +1 -1
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/MenuBarItem.cjs +1 -1
- package/dist/components/MenuBarItem.mjs +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/Select.cjs +1 -1
- package/dist/components/Select.d.ts +8 -0
- package/dist/components/Select.mjs +1 -1
- package/dist/components/Select.vue.d.ts +9 -7
- package/dist/components/Select.vue.d.ts.map +1 -1
- package/dist/components/Tabs.cjs +1 -1
- package/dist/components/Tabs.mjs +1 -1
- package/dist/components/Tabs.vue.d.ts.map +1 -1
- package/dist/composables/useConfirm.composable.cjs +1 -1
- package/dist/composables/useConfirm.composable.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +12 -12
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/BarChart.css +1 -1
- package/dist/styles/DataTable.css +1 -1
- package/dist/styles/LineChart.css +1 -1
- package/dist/styles/Modal.css +1 -1
- package/dist/styles/Select.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/dist/ui.css +6 -6
- package/package.json +1 -1
- package/dist/BarChart-DTStA9jd.js +0 -290
- package/dist/BarChart-Dvrl4xeX.cjs +0 -1
- package/dist/DataTable-CWMlmjMi.cjs +0 -1
- package/dist/DataTable-DaNZAixf.js +0 -389
- package/dist/DatePicker-BgMtkY76.cjs +0 -1
- package/dist/LineChart-C5bQNxQ-.cjs +0 -1
- package/dist/Menu-BALfMobG.cjs +0 -1
- package/dist/Select-ClkEzw5T.cjs +0 -1
- package/dist/Select-DIw08nte.js +0 -437
- package/dist/Tabs-CrrG1hvh.cjs +0 -1
- package/dist/Tabs-D3pdOieX.js +0 -180
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
+
import { r as t } from "./Size.d-Bah6vMl3.js";
|
|
3
|
+
import { t as n } from "./Icon-rREAqsu0.js";
|
|
4
|
+
import { useSurfaceLayer as r } from "./composables/useSurfaceLayer.composable.mjs";
|
|
5
|
+
import { usePhoneLayout as i } from "./composables/usePhoneLayout.composable.mjs";
|
|
6
|
+
import { t as a } from "./Button-IcCXOoCT.js";
|
|
7
|
+
import { t as o } from "./Grid-iox-7xyH.js";
|
|
8
|
+
import { t as s } from "./Checkbox-CXlovpPs.js";
|
|
9
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, getCurrentInstance as ee, mergeProps as te, normalizeClass as _, normalizeStyle as ne, onBeforeUnmount as re, openBlock as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, unref as ie, useId as ae, useSlots as oe, watch as C, withCtx as w, withModifiers as T } from "vue";
|
|
10
|
+
import * as se from "@nubisco/ui/icons/arrows-down-up";
|
|
11
|
+
import * as ce from "@nubisco/ui/icons/arrow-up";
|
|
12
|
+
import * as le from "@nubisco/ui/icons/arrow-down";
|
|
13
|
+
//#region src/components/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
+
var ue = ["inert", "aria-hidden"], de = { key: 0 }, fe = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "nb-data-table__title"
|
|
17
|
+
}, pe = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "nb-data-table__description"
|
|
20
|
+
}, me = ["inert", "aria-hidden"], he = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "nb-data-table__batch",
|
|
23
|
+
role: "region",
|
|
24
|
+
"aria-label": "Table batch actions"
|
|
25
|
+
}, ge = { class: "nb-data-table__batch-count" }, _e = { class: "nb-data-table__batch-actions" }, ve = { class: "nb-data-table__scroll" }, ye = [
|
|
26
|
+
"role",
|
|
27
|
+
"aria-label",
|
|
28
|
+
"aria-busy"
|
|
29
|
+
], be = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "nb-data-table__col-select"
|
|
32
|
+
}, xe = {
|
|
33
|
+
key: 1,
|
|
34
|
+
class: "nb-data-table__col-actions"
|
|
35
|
+
}, Se = ["role"], Ce = ["role"], we = {
|
|
36
|
+
key: 0,
|
|
37
|
+
scope: "col",
|
|
38
|
+
class: "nb-data-table__th nb-data-table__select-cell"
|
|
39
|
+
}, Te = ["aria-sort"], Ee = ["onClick"], De = { class: "nb-data-table__th-label" }, Oe = {
|
|
40
|
+
key: 1,
|
|
41
|
+
class: "nb-data-table__th-label"
|
|
42
|
+
}, ke = {
|
|
43
|
+
key: 1,
|
|
44
|
+
scope: "col",
|
|
45
|
+
class: "nb-data-table__th nb-data-table__actions-cell"
|
|
46
|
+
}, Ae = ["role"], je = {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "nb-data-table__td"
|
|
49
|
+
}, Me = {
|
|
50
|
+
key: 1,
|
|
51
|
+
class: "nb-data-table__td"
|
|
52
|
+
}, Ne = {
|
|
53
|
+
key: 1,
|
|
54
|
+
class: "nb-data-table__state-row"
|
|
55
|
+
}, Pe = ["colspan"], Fe = {
|
|
56
|
+
key: 2,
|
|
57
|
+
class: "nb-data-table__state-row"
|
|
58
|
+
}, Ie = ["colspan"], Le = [
|
|
59
|
+
"role",
|
|
60
|
+
"aria-selected",
|
|
61
|
+
"onClick"
|
|
62
|
+
], Re = [
|
|
63
|
+
"checked",
|
|
64
|
+
"aria-label",
|
|
65
|
+
"onChange"
|
|
66
|
+
], ze = ["role", "data-label"], Be = {
|
|
67
|
+
key: 1,
|
|
68
|
+
class: "nb-data-table__footer"
|
|
69
|
+
}, E = /* @__PURE__ */ e(/* @__PURE__ */ g({
|
|
70
|
+
__name: "DataTable",
|
|
71
|
+
props: {
|
|
72
|
+
columns: {},
|
|
73
|
+
rows: {},
|
|
74
|
+
rowKey: {},
|
|
75
|
+
size: { default: t.Medium },
|
|
76
|
+
sortState: { default: null },
|
|
77
|
+
selectable: { default: "none" },
|
|
78
|
+
selected: { default: () => [] },
|
|
79
|
+
loading: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: !1
|
|
82
|
+
},
|
|
83
|
+
skeletonRows: { default: 5 },
|
|
84
|
+
error: { default: void 0 },
|
|
85
|
+
emptyMessage: { default: void 0 },
|
|
86
|
+
stickyHeader: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !0
|
|
89
|
+
},
|
|
90
|
+
zebra: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
},
|
|
94
|
+
fill: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: !1
|
|
97
|
+
},
|
|
98
|
+
title: { default: void 0 },
|
|
99
|
+
description: { default: void 0 },
|
|
100
|
+
ariaLabel: { default: void 0 },
|
|
101
|
+
stackOnPhone: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: !1
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
emits: [
|
|
107
|
+
"sort",
|
|
108
|
+
"update:selected",
|
|
109
|
+
"row-click"
|
|
110
|
+
],
|
|
111
|
+
setup(e, { emit: t }) {
|
|
112
|
+
let g = e, { layerProps: E } = r(), D = t, O = oe(), Ve = `nb-data-table-select-${ae()}`, He = l(() => g.size), k = l(() => g.columns.filter((e) => !e.hidden)), A = l(() => g.selectable !== "none"), j = l(() => !!O["row-actions"]), Ue = l(() => k.value.length + (A.value ? 1 : 0) + (j.value ? 1 : 0)), { phone: We } = i(), M = l(() => g.stackOnPhone && We.value), Ge = l(() => (k.value.find((e) => e.primary) ?? k.value.find((e) => !e.phoneHidden && !e.phoneMeta))?.key);
|
|
113
|
+
function Ke(e) {
|
|
114
|
+
return e.phoneHidden ? "nb-data-table__td--phone-hidden" : e.key === Ge.value ? "nb-data-table__td--primary" : e.phoneMeta ? "nb-data-table__td--meta" : "nb-data-table__td--field";
|
|
115
|
+
}
|
|
116
|
+
let qe = l(() => !g.loading && !g.error && g.rows.length > 0 && (g.selectable === "multiple" || k.value.some((e) => e.sortable && !e.phoneHidden)));
|
|
117
|
+
function Je(e) {
|
|
118
|
+
if (e.width != null) return { width: typeof e.width == "number" ? `${e.width}px` : e.width };
|
|
119
|
+
}
|
|
120
|
+
function N(e, t) {
|
|
121
|
+
return t[e.key];
|
|
122
|
+
}
|
|
123
|
+
function Ye(e) {
|
|
124
|
+
return e == null ? "" : String(e);
|
|
125
|
+
}
|
|
126
|
+
let P = (e) => e.column.render?.(e.row, N(e.column, e.row), e.rowIndex) ?? null;
|
|
127
|
+
P.props = [
|
|
128
|
+
"column",
|
|
129
|
+
"row",
|
|
130
|
+
"rowIndex"
|
|
131
|
+
];
|
|
132
|
+
function F(e) {
|
|
133
|
+
let t = g.rowKey;
|
|
134
|
+
return typeof t == "function" ? t(e) : e[t];
|
|
135
|
+
}
|
|
136
|
+
let I = l(() => new Set(g.selected)), Xe = l(() => g.selected), L = l(() => g.selected.length);
|
|
137
|
+
function R(e) {
|
|
138
|
+
return I.value.has(F(e));
|
|
139
|
+
}
|
|
140
|
+
let z = l(() => g.rows.map((e) => F(e))), B = l(() => z.value.length > 0 && z.value.every((e) => I.value.has(e))), Ze = l(() => !B.value && z.value.some((e) => I.value.has(e))), V = y(null), H = !1;
|
|
141
|
+
function U(e) {
|
|
142
|
+
H = e.shiftKey;
|
|
143
|
+
}
|
|
144
|
+
C(z, () => {
|
|
145
|
+
V.value = null;
|
|
146
|
+
});
|
|
147
|
+
function Qe(e, t) {
|
|
148
|
+
let n = F(e), r = new Set(g.selected), i = !r.has(n), a = V.value, o = (e) => {
|
|
149
|
+
i ? r.add(e) : r.delete(e);
|
|
150
|
+
};
|
|
151
|
+
if (H && a !== null && a !== t) {
|
|
152
|
+
let e = Math.min(a, t), n = Math.max(a, t);
|
|
153
|
+
for (let t = e; t <= n; t++) {
|
|
154
|
+
let e = g.rows[t];
|
|
155
|
+
e && o(F(e));
|
|
156
|
+
}
|
|
157
|
+
} else o(n), V.value = t;
|
|
158
|
+
H = !1, D("update:selected", [...r]);
|
|
159
|
+
}
|
|
160
|
+
function $e(e) {
|
|
161
|
+
D("update:selected", [F(e)]);
|
|
162
|
+
}
|
|
163
|
+
function et() {
|
|
164
|
+
let e = new Set(g.selected);
|
|
165
|
+
B.value ? z.value.forEach((t) => e.delete(t)) : z.value.forEach((t) => e.add(t)), D("update:selected", [...e]);
|
|
166
|
+
}
|
|
167
|
+
function W() {
|
|
168
|
+
D("update:selected", []);
|
|
169
|
+
}
|
|
170
|
+
let G = l(() => g.selectable !== "none" && !!O["batch-actions"]), K = l(() => G.value && L.value > 0), tt = l(() => !!g.title || !!g.description || !!O.toolbar || !!O.search || !!O["toolbar-actions"]), nt = l(() => tt.value || G.value), q = y(null), J = y(null), Y = y(null), X = y(!1);
|
|
171
|
+
function Z() {
|
|
172
|
+
let e = J.value, t = Y.value;
|
|
173
|
+
X.value = !!e && !!t && t.offsetTop >= e.offsetTop + e.offsetHeight - 1;
|
|
174
|
+
}
|
|
175
|
+
let Q = null;
|
|
176
|
+
C([
|
|
177
|
+
q,
|
|
178
|
+
J,
|
|
179
|
+
Y
|
|
180
|
+
], (e) => {
|
|
181
|
+
if (Q?.disconnect(), Z(), !(typeof ResizeObserver > "u")) {
|
|
182
|
+
Q ??= new ResizeObserver(Z);
|
|
183
|
+
for (let t of e) t && Q.observe(t);
|
|
184
|
+
}
|
|
185
|
+
}, { flush: "post" }), re(() => {
|
|
186
|
+
Q?.disconnect(), Q = null;
|
|
187
|
+
});
|
|
188
|
+
function $(e) {
|
|
189
|
+
return !!g.sortState && g.sortState.key === e.key && g.sortState.direction !== "none";
|
|
190
|
+
}
|
|
191
|
+
function rt(e) {
|
|
192
|
+
return $(e) ? g.sortState.direction === "asc" ? "ascending" : "descending" : "none";
|
|
193
|
+
}
|
|
194
|
+
function it(e) {
|
|
195
|
+
return $(e) ? g.sortState.direction === "asc" ? ce : le : se;
|
|
196
|
+
}
|
|
197
|
+
function at(e) {
|
|
198
|
+
return e === "asc" ? "desc" : e === "desc" ? "none" : "asc";
|
|
199
|
+
}
|
|
200
|
+
function ot(e) {
|
|
201
|
+
let t = g.sortState && g.sortState.key === e.key ? g.sortState.direction : "none";
|
|
202
|
+
D("sort", {
|
|
203
|
+
key: e.key,
|
|
204
|
+
direction: at(t)
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
let st = ee(), ct = l(() => !!st?.vnode.props?.onRowClick);
|
|
208
|
+
function lt(e, t) {
|
|
209
|
+
D("row-click", e, t);
|
|
210
|
+
}
|
|
211
|
+
return (t, r) => (v(), f("div", te({ class: [
|
|
212
|
+
"nb-data-table",
|
|
213
|
+
`nb-data-table--${e.size}`,
|
|
214
|
+
{ "nb-data-table--zebra": e.zebra },
|
|
215
|
+
{ "nb-data-table--sticky": e.stickyHeader },
|
|
216
|
+
{ "nb-data-table--fill": e.fill },
|
|
217
|
+
{ "nb-data-table--stacked": M.value },
|
|
218
|
+
{ "nb-data-table--stacked-headless": M.value && !qe.value }
|
|
219
|
+
] }, ie(E)), [
|
|
220
|
+
nt.value ? (v(), f("div", {
|
|
221
|
+
key: 0,
|
|
222
|
+
ref_key: "toolbarRef",
|
|
223
|
+
ref: q,
|
|
224
|
+
class: _(["nb-data-table__toolbar", { "nb-data-table__toolbar--wrapped": X.value }])
|
|
225
|
+
}, [
|
|
226
|
+
p("div", {
|
|
227
|
+
ref_key: "toolbarHeadingRef",
|
|
228
|
+
ref: J,
|
|
229
|
+
class: "nb-data-table__toolbar-heading",
|
|
230
|
+
inert: K.value || void 0,
|
|
231
|
+
"aria-hidden": K.value || void 0
|
|
232
|
+
}, [x(t.$slots, "toolbar", { selectedCount: L.value }, () => [e.title || e.description ? (v(), f("div", de, [e.title ? (v(), f("h2", fe, S(e.title), 1)) : d("", !0), e.description ? (v(), f("p", pe, S(e.description), 1)) : d("", !0)])) : d("", !0)], !0)], 8, ue),
|
|
233
|
+
t.$slots.search || t.$slots["toolbar-actions"] ? (v(), f("div", {
|
|
234
|
+
key: 0,
|
|
235
|
+
ref_key: "toolbarToolsRef",
|
|
236
|
+
ref: Y,
|
|
237
|
+
class: _(["nb-data-table__toolbar-tools", { "nb-data-table__toolbar-tools--grow-search": X.value && !!t.$slots.search }]),
|
|
238
|
+
inert: K.value || void 0,
|
|
239
|
+
"aria-hidden": K.value || void 0
|
|
240
|
+
}, [x(t.$slots, "search", {}, void 0, !0), x(t.$slots, "toolbar-actions", {}, void 0, !0)], 10, me)) : d("", !0),
|
|
241
|
+
K.value ? (v(), f("div", he, [
|
|
242
|
+
p("span", ge, S(L.value) + " selected ", 1),
|
|
243
|
+
p("div", _e, [x(t.$slots, "batch-actions", {
|
|
244
|
+
selectedKeys: Xe.value,
|
|
245
|
+
clear: W
|
|
246
|
+
}, void 0, !0)]),
|
|
247
|
+
h(a, {
|
|
248
|
+
class: "nb-data-table__batch-cancel",
|
|
249
|
+
variant: "ghost",
|
|
250
|
+
size: He.value,
|
|
251
|
+
onClick: W
|
|
252
|
+
}, {
|
|
253
|
+
default: w(() => [...r[2] ||= [m(" Cancel ", -1)]]),
|
|
254
|
+
_: 1
|
|
255
|
+
}, 8, ["size"])
|
|
256
|
+
])) : d("", !0)
|
|
257
|
+
], 2)) : d("", !0),
|
|
258
|
+
p("div", ve, [p("table", {
|
|
259
|
+
class: "nb-data-table__table",
|
|
260
|
+
role: M.value ? "table" : void 0,
|
|
261
|
+
"aria-label": e.ariaLabel || e.title || void 0,
|
|
262
|
+
"aria-busy": e.loading || void 0
|
|
263
|
+
}, [
|
|
264
|
+
p("colgroup", null, [
|
|
265
|
+
A.value ? (v(), f("col", be)) : d("", !0),
|
|
266
|
+
(v(!0), f(c, null, b(k.value, (e) => (v(), f("col", {
|
|
267
|
+
key: `col-${e.key}`,
|
|
268
|
+
style: ne(Je(e))
|
|
269
|
+
}, null, 4))), 128)),
|
|
270
|
+
j.value ? (v(), f("col", xe)) : d("", !0)
|
|
271
|
+
]),
|
|
272
|
+
p("thead", {
|
|
273
|
+
class: "nb-data-table__head",
|
|
274
|
+
role: M.value ? "rowgroup" : void 0
|
|
275
|
+
}, [p("tr", { role: M.value ? "row" : void 0 }, [
|
|
276
|
+
A.value ? (v(), f("th", we, [e.selectable === "multiple" ? (v(), u(s, {
|
|
277
|
+
key: 0,
|
|
278
|
+
"model-value": B.value,
|
|
279
|
+
indeterminate: Ze.value,
|
|
280
|
+
"aria-label": "Select all rows",
|
|
281
|
+
"onUpdate:modelValue": et
|
|
282
|
+
}, null, 8, ["model-value", "indeterminate"])) : d("", !0)])) : d("", !0),
|
|
283
|
+
(v(!0), f(c, null, b(k.value, (e) => (v(), f("th", {
|
|
284
|
+
key: `th-${e.key}`,
|
|
285
|
+
scope: "col",
|
|
286
|
+
class: _([
|
|
287
|
+
"nb-data-table__th",
|
|
288
|
+
`nb-data-table__th--${e.align || "left"}`,
|
|
289
|
+
{ "nb-data-table__th--sortable": e.sortable },
|
|
290
|
+
{ "nb-data-table__th--sorted": $(e) },
|
|
291
|
+
M.value && e.phoneHidden && "nb-data-table__th--phone-hidden"
|
|
292
|
+
]),
|
|
293
|
+
"aria-sort": e.sortable ? rt(e) : void 0
|
|
294
|
+
}, [e.sortable ? (v(), f("button", {
|
|
295
|
+
key: 0,
|
|
296
|
+
type: "button",
|
|
297
|
+
class: "nb-data-table__sort",
|
|
298
|
+
onClick: (t) => ot(e)
|
|
299
|
+
}, [p("span", De, [x(t.$slots, `header-${e.key}`, { column: e }, () => [m(S(e.header), 1)], !0)]), h(n, {
|
|
300
|
+
name: it(e),
|
|
301
|
+
class: "nb-data-table__sort-icon",
|
|
302
|
+
"aria-hidden": "true"
|
|
303
|
+
}, null, 8, ["name"])], 8, Ee)) : (v(), f("span", Oe, [x(t.$slots, `header-${e.key}`, { column: e }, () => [m(S(e.header), 1)], !0)]))], 10, Te))), 128)),
|
|
304
|
+
j.value ? (v(), f("th", ke, [...r[3] ||= [p("span", { class: "nb-sr-only" }, "Row actions", -1)]])) : d("", !0)
|
|
305
|
+
], 8, Ce)], 8, Se),
|
|
306
|
+
p("tbody", {
|
|
307
|
+
class: "nb-data-table__body",
|
|
308
|
+
role: M.value ? "rowgroup" : void 0
|
|
309
|
+
}, [e.loading ? (v(!0), f(c, { key: 0 }, b(e.skeletonRows, (e) => (v(), f("tr", {
|
|
310
|
+
key: `skeleton-${e}`,
|
|
311
|
+
class: "nb-data-table__row nb-data-table__row--skeleton"
|
|
312
|
+
}, [
|
|
313
|
+
A.value ? (v(), f("td", je, [...r[4] ||= [p("span", { class: "nb-data-table__skeleton nb-data-table__skeleton--box" }, null, -1)]])) : d("", !0),
|
|
314
|
+
(v(!0), f(c, null, b(k.value, (t) => (v(), f("td", {
|
|
315
|
+
key: `sk-${e}-${t.key}`,
|
|
316
|
+
class: "nb-data-table__td"
|
|
317
|
+
}, [...r[5] ||= [p("span", { class: "nb-data-table__skeleton" }, null, -1)]]))), 128)),
|
|
318
|
+
j.value ? (v(), f("td", Me, [...r[6] ||= [p("span", { class: "nb-data-table__skeleton nb-data-table__skeleton--box" }, null, -1)]])) : d("", !0)
|
|
319
|
+
]))), 128)) : e.error ? (v(), f("tr", Ne, [p("td", {
|
|
320
|
+
colspan: Ue.value,
|
|
321
|
+
class: "nb-data-table__state nb-data-table__state--error"
|
|
322
|
+
}, [x(t.$slots, "error", { error: e.error }, () => [h(o, {
|
|
323
|
+
is: "span",
|
|
324
|
+
align: "center",
|
|
325
|
+
justify: "center",
|
|
326
|
+
gap: "xs",
|
|
327
|
+
class: "nb-data-table__state-inner"
|
|
328
|
+
}, {
|
|
329
|
+
default: w(() => [h(n, {
|
|
330
|
+
name: "warning-circle-fill",
|
|
331
|
+
"aria-hidden": "true"
|
|
332
|
+
}), p("span", null, S(e.error), 1)]),
|
|
333
|
+
_: 1
|
|
334
|
+
})], !0)], 8, Pe)])) : e.rows.length ? (v(!0), f(c, { key: 3 }, b(e.rows, (n, i) => (v(), f("tr", {
|
|
335
|
+
key: F(n),
|
|
336
|
+
class: _([
|
|
337
|
+
"nb-data-table__row",
|
|
338
|
+
{ "nb-data-table__row--selected": R(n) },
|
|
339
|
+
{ "nb-data-table__row--clickable": ct.value }
|
|
340
|
+
]),
|
|
341
|
+
role: M.value ? "row" : void 0,
|
|
342
|
+
"aria-selected": e.selectable === "none" ? void 0 : R(n),
|
|
343
|
+
onClick: (e) => lt(n, i)
|
|
344
|
+
}, [
|
|
345
|
+
A.value ? (v(), f("td", {
|
|
346
|
+
key: 0,
|
|
347
|
+
class: "nb-data-table__td nb-data-table__select-cell",
|
|
348
|
+
onClick: r[0] ||= T(() => {}, ["stop"]),
|
|
349
|
+
onMousedown: U,
|
|
350
|
+
onKeydown: U
|
|
351
|
+
}, [e.selectable === "multiple" ? (v(), u(s, {
|
|
352
|
+
key: 0,
|
|
353
|
+
"model-value": R(n),
|
|
354
|
+
"aria-label": `Select row ${i + 1}`,
|
|
355
|
+
"onUpdate:modelValue": (e) => Qe(n, i)
|
|
356
|
+
}, null, 8, [
|
|
357
|
+
"model-value",
|
|
358
|
+
"aria-label",
|
|
359
|
+
"onUpdate:modelValue"
|
|
360
|
+
])) : (v(), f("input", {
|
|
361
|
+
key: 1,
|
|
362
|
+
type: "radio",
|
|
363
|
+
class: "nb-data-table__radio",
|
|
364
|
+
name: Ve,
|
|
365
|
+
checked: R(n),
|
|
366
|
+
"aria-label": `Select row ${i + 1}`,
|
|
367
|
+
onChange: (e) => $e(n)
|
|
368
|
+
}, null, 40, Re))], 32)) : d("", !0),
|
|
369
|
+
(v(!0), f(c, null, b(k.value, (r) => (v(), f("td", {
|
|
370
|
+
key: `td-${F(n)}-${r.key}`,
|
|
371
|
+
class: _([
|
|
372
|
+
"nb-data-table__td",
|
|
373
|
+
`nb-data-table__td--${r.align || "left"}`,
|
|
374
|
+
r.cellClass,
|
|
375
|
+
M.value && Ke(r)
|
|
376
|
+
]),
|
|
377
|
+
role: M.value ? "cell" : void 0,
|
|
378
|
+
"data-label": e.stackOnPhone ? r.header : void 0
|
|
379
|
+
}, [x(t.$slots, `cell-${r.key}`, {
|
|
380
|
+
row: n,
|
|
381
|
+
value: N(r, n),
|
|
382
|
+
column: r,
|
|
383
|
+
rowIndex: i
|
|
384
|
+
}, () => [r.render ? (v(), u(P, {
|
|
385
|
+
key: 0,
|
|
386
|
+
column: r,
|
|
387
|
+
row: n,
|
|
388
|
+
"row-index": i
|
|
389
|
+
}, null, 8, [
|
|
390
|
+
"column",
|
|
391
|
+
"row",
|
|
392
|
+
"row-index"
|
|
393
|
+
])) : (v(), f(c, { key: 1 }, [m(S(Ye(N(r, n))), 1)], 64))], !0)], 10, ze))), 128)),
|
|
394
|
+
j.value ? (v(), f("td", {
|
|
395
|
+
key: 1,
|
|
396
|
+
class: "nb-data-table__td nb-data-table__actions-cell",
|
|
397
|
+
onClick: r[1] ||= T(() => {}, ["stop"])
|
|
398
|
+
}, [x(t.$slots, "row-actions", {
|
|
399
|
+
row: n,
|
|
400
|
+
rowIndex: i
|
|
401
|
+
}, void 0, !0)])) : d("", !0)
|
|
402
|
+
], 10, Le))), 128)) : (v(), f("tr", Fe, [p("td", {
|
|
403
|
+
colspan: Ue.value,
|
|
404
|
+
class: "nb-data-table__state nb-data-table__state--empty"
|
|
405
|
+
}, [x(t.$slots, "empty", {}, () => [p("span", null, S(e.emptyMessage || "No data to display"), 1)], !0)], 8, Ie)]))], 8, Ae)
|
|
406
|
+
], 8, ye)]),
|
|
407
|
+
t.$slots.footer ? (v(), f("div", Be, [x(t.$slots, "footer", {}, void 0, !0)])) : d("", !0)
|
|
408
|
+
], 16));
|
|
409
|
+
}
|
|
410
|
+
}), [["__scopeId", "data-v-0d151db9"]]);
|
|
411
|
+
//#endregion
|
|
412
|
+
export { E as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-D-qHiVGv.cjs`),t=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),n=require(`./Size.d-GBIblj2D.cjs`),r=require(`./Icon-C8R_r_In.cjs`),i=require(`./composables/useSurfaceLayer.composable.cjs`),a=require(`./composables/usePhoneLayout.composable.cjs`),o=require(`./Button-C0UUTgEB.cjs`),s=require(`./Grid-DiCxrPaO.cjs`),c=require(`./Checkbox-CZVNZ2pn.cjs`);let l=require(`vue`),u=require(`@nubisco/ui/icons/arrows-down-up`);u=e.n(u);let d=require(`@nubisco/ui/icons/arrow-up`);d=e.n(d);let f=require(`@nubisco/ui/icons/arrow-down`);f=e.n(f);var p=[`inert`,`aria-hidden`],m={key:0},h={key:0,class:`nb-data-table__title`},g={key:1,class:`nb-data-table__description`},ee=[`inert`,`aria-hidden`],te={key:1,class:`nb-data-table__batch`,role:`region`,"aria-label":`Table batch actions`},ne={class:`nb-data-table__batch-count`},re={class:`nb-data-table__batch-actions`},ie={class:`nb-data-table__scroll`},ae=[`role`,`aria-label`,`aria-busy`],oe={key:0,class:`nb-data-table__col-select`},se={key:1,class:`nb-data-table__col-actions`},ce=[`role`],le=[`role`],ue={key:0,scope:`col`,class:`nb-data-table__th nb-data-table__select-cell`},_=[`aria-sort`],de=[`onClick`],fe={class:`nb-data-table__th-label`},pe={key:1,class:`nb-data-table__th-label`},me={key:1,scope:`col`,class:`nb-data-table__th nb-data-table__actions-cell`},he=[`role`],ge={key:0,class:`nb-data-table__td`},v={key:1,class:`nb-data-table__td`},y={key:1,class:`nb-data-table__state-row`},b=[`colspan`],x={key:2,class:`nb-data-table__state-row`},_e=[`colspan`],ve=[`role`,`aria-selected`,`onClick`],ye=[`checked`,`aria-label`,`onChange`],be=[`role`,`data-label`],xe={key:1,class:`nb-data-table__footer`},S=(0,l.defineComponent)({__name:`DataTable`,props:{columns:{},rows:{},rowKey:{},size:{default:n.r.Medium},sortState:{default:null},selectable:{default:`none`},selected:{default:()=>[]},loading:{type:Boolean,default:!1},skeletonRows:{default:5},error:{default:void 0},emptyMessage:{default:void 0},stickyHeader:{type:Boolean,default:!0},zebra:{type:Boolean,default:!1},fill:{type:Boolean,default:!1},title:{default:void 0},description:{default:void 0},ariaLabel:{default:void 0},stackOnPhone:{type:Boolean,default:!1}},emits:[`sort`,`update:selected`,`row-click`],setup(e,{emit:t}){let n=e,{layerProps:S}=i.useSurfaceLayer(),C=t,w=(0,l.useSlots)(),T=`nb-data-table-select-${(0,l.useId)()}`,E=(0,l.computed)(()=>n.size),D=(0,l.computed)(()=>n.columns.filter(e=>!e.hidden)),O=(0,l.computed)(()=>n.selectable!==`none`),k=(0,l.computed)(()=>!!w[`row-actions`]),A=(0,l.computed)(()=>D.value.length+(O.value?1:0)+(k.value?1:0)),{phone:j}=a.usePhoneLayout(),M=(0,l.computed)(()=>n.stackOnPhone&&j.value),Se=(0,l.computed)(()=>(D.value.find(e=>e.primary)??D.value.find(e=>!e.phoneHidden&&!e.phoneMeta))?.key);function Ce(e){return e.phoneHidden?`nb-data-table__td--phone-hidden`:e.key===Se.value?`nb-data-table__td--primary`:e.phoneMeta?`nb-data-table__td--meta`:`nb-data-table__td--field`}let we=(0,l.computed)(()=>!n.loading&&!n.error&&n.rows.length>0&&(n.selectable===`multiple`||D.value.some(e=>e.sortable&&!e.phoneHidden)));function Te(e){if(e.width!=null)return{width:typeof e.width==`number`?`${e.width}px`:e.width}}function N(e,t){return t[e.key]}function Ee(e){return e==null?``:String(e)}let P=e=>e.column.render?.(e.row,N(e.column,e.row),e.rowIndex)??null;P.props=[`column`,`row`,`rowIndex`];function F(e){let t=n.rowKey;return typeof t==`function`?t(e):e[t]}let I=(0,l.computed)(()=>new Set(n.selected)),De=(0,l.computed)(()=>n.selected),L=(0,l.computed)(()=>n.selected.length);function R(e){return I.value.has(F(e))}let z=(0,l.computed)(()=>n.rows.map(e=>F(e))),B=(0,l.computed)(()=>z.value.length>0&&z.value.every(e=>I.value.has(e))),Oe=(0,l.computed)(()=>!B.value&&z.value.some(e=>I.value.has(e))),V=(0,l.ref)(null),H=!1;function U(e){H=e.shiftKey}(0,l.watch)(z,()=>{V.value=null});function ke(e,t){let r=F(e),i=new Set(n.selected),a=!i.has(r),o=V.value,s=e=>{a?i.add(e):i.delete(e)};if(H&&o!==null&&o!==t){let e=Math.min(o,t),r=Math.max(o,t);for(let t=e;t<=r;t++){let e=n.rows[t];e&&s(F(e))}}else s(r),V.value=t;H=!1,C(`update:selected`,[...i])}function Ae(e){C(`update:selected`,[F(e)])}function je(){let e=new Set(n.selected);B.value?z.value.forEach(t=>e.delete(t)):z.value.forEach(t=>e.add(t)),C(`update:selected`,[...e])}function W(){C(`update:selected`,[])}let G=(0,l.computed)(()=>n.selectable!==`none`&&!!w[`batch-actions`]),K=(0,l.computed)(()=>G.value&&L.value>0),Me=(0,l.computed)(()=>!!n.title||!!n.description||!!w.toolbar||!!w.search||!!w[`toolbar-actions`]),Ne=(0,l.computed)(()=>Me.value||G.value),q=(0,l.ref)(null),J=(0,l.ref)(null),Y=(0,l.ref)(null),X=(0,l.ref)(!1);function Z(){let e=J.value,t=Y.value;X.value=!!e&&!!t&&t.offsetTop>=e.offsetTop+e.offsetHeight-1}let Q=null;(0,l.watch)([q,J,Y],e=>{if(Q?.disconnect(),Z(),!(typeof ResizeObserver>`u`)){Q??=new ResizeObserver(Z);for(let t of e)t&&Q.observe(t)}},{flush:`post`}),(0,l.onBeforeUnmount)(()=>{Q?.disconnect(),Q=null});function $(e){return!!n.sortState&&n.sortState.key===e.key&&n.sortState.direction!==`none`}function Pe(e){return $(e)?n.sortState.direction===`asc`?`ascending`:`descending`:`none`}function Fe(e){return $(e)?n.sortState.direction===`asc`?d:f:u}function Ie(e){return e===`asc`?`desc`:e===`desc`?`none`:`asc`}function Le(e){let t=n.sortState&&n.sortState.key===e.key?n.sortState.direction:`none`;C(`sort`,{key:e.key,direction:Ie(t)})}let Re=(0,l.getCurrentInstance)(),ze=(0,l.computed)(()=>!!Re?.vnode.props?.onRowClick);function Be(e,t){C(`row-click`,e,t)}return(t,n)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,(0,l.mergeProps)({class:[`nb-data-table`,`nb-data-table--${e.size}`,{"nb-data-table--zebra":e.zebra},{"nb-data-table--sticky":e.stickyHeader},{"nb-data-table--fill":e.fill},{"nb-data-table--stacked":M.value},{"nb-data-table--stacked-headless":M.value&&!we.value}]},(0,l.unref)(S)),[Ne.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,ref_key:`toolbarRef`,ref:q,class:(0,l.normalizeClass)([`nb-data-table__toolbar`,{"nb-data-table__toolbar--wrapped":X.value}])},[(0,l.createElementVNode)(`div`,{ref_key:`toolbarHeadingRef`,ref:J,class:`nb-data-table__toolbar-heading`,inert:K.value||void 0,"aria-hidden":K.value||void 0},[(0,l.renderSlot)(t.$slots,`toolbar`,{selectedCount:L.value},()=>[e.title||e.description?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,m,[e.title?((0,l.openBlock)(),(0,l.createElementBlock)(`h2`,h,(0,l.toDisplayString)(e.title),1)):(0,l.createCommentVNode)(``,!0),e.description?((0,l.openBlock)(),(0,l.createElementBlock)(`p`,g,(0,l.toDisplayString)(e.description),1)):(0,l.createCommentVNode)(``,!0)])):(0,l.createCommentVNode)(``,!0)],!0)],8,p),t.$slots.search||t.$slots[`toolbar-actions`]?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,ref_key:`toolbarToolsRef`,ref:Y,class:(0,l.normalizeClass)([`nb-data-table__toolbar-tools`,{"nb-data-table__toolbar-tools--grow-search":X.value&&!!t.$slots.search}]),inert:K.value||void 0,"aria-hidden":K.value||void 0},[(0,l.renderSlot)(t.$slots,`search`,{},void 0,!0),(0,l.renderSlot)(t.$slots,`toolbar-actions`,{},void 0,!0)],10,ee)):(0,l.createCommentVNode)(``,!0),K.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,te,[(0,l.createElementVNode)(`span`,ne,(0,l.toDisplayString)(L.value)+` selected `,1),(0,l.createElementVNode)(`div`,re,[(0,l.renderSlot)(t.$slots,`batch-actions`,{selectedKeys:De.value,clear:W},void 0,!0)]),(0,l.createVNode)(o.t,{class:`nb-data-table__batch-cancel`,variant:`ghost`,size:E.value,onClick:W},{default:(0,l.withCtx)(()=>[...n[2]||=[(0,l.createTextVNode)(` Cancel `,-1)]]),_:1},8,[`size`])])):(0,l.createCommentVNode)(``,!0)],2)):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`div`,ie,[(0,l.createElementVNode)(`table`,{class:`nb-data-table__table`,role:M.value?`table`:void 0,"aria-label":e.ariaLabel||e.title||void 0,"aria-busy":e.loading||void 0},[(0,l.createElementVNode)(`colgroup`,null,[O.value?((0,l.openBlock)(),(0,l.createElementBlock)(`col`,oe)):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(D.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`col`,{key:`col-${e.key}`,style:(0,l.normalizeStyle)(Te(e))},null,4))),128)),k.value?((0,l.openBlock)(),(0,l.createElementBlock)(`col`,se)):(0,l.createCommentVNode)(``,!0)]),(0,l.createElementVNode)(`thead`,{class:`nb-data-table__head`,role:M.value?`rowgroup`:void 0},[(0,l.createElementVNode)(`tr`,{role:M.value?`row`:void 0},[O.value?((0,l.openBlock)(),(0,l.createElementBlock)(`th`,ue,[e.selectable===`multiple`?((0,l.openBlock)(),(0,l.createBlock)(c.t,{key:0,"model-value":B.value,indeterminate:Oe.value,"aria-label":`Select all rows`,"onUpdate:modelValue":je},null,8,[`model-value`,`indeterminate`])):(0,l.createCommentVNode)(``,!0)])):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(D.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`th`,{key:`th-${e.key}`,scope:`col`,class:(0,l.normalizeClass)([`nb-data-table__th`,`nb-data-table__th--${e.align||`left`}`,{"nb-data-table__th--sortable":e.sortable},{"nb-data-table__th--sorted":$(e)},M.value&&e.phoneHidden&&`nb-data-table__th--phone-hidden`]),"aria-sort":e.sortable?Pe(e):void 0},[e.sortable?((0,l.openBlock)(),(0,l.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-data-table__sort`,onClick:t=>Le(e)},[(0,l.createElementVNode)(`span`,fe,[(0,l.renderSlot)(t.$slots,`header-${e.key}`,{column:e},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(e.header),1)],!0)]),(0,l.createVNode)(r.t,{name:Fe(e),class:`nb-data-table__sort-icon`,"aria-hidden":`true`},null,8,[`name`])],8,de)):((0,l.openBlock)(),(0,l.createElementBlock)(`span`,pe,[(0,l.renderSlot)(t.$slots,`header-${e.key}`,{column:e},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(e.header),1)],!0)]))],10,_))),128)),k.value?((0,l.openBlock)(),(0,l.createElementBlock)(`th`,me,[...n[3]||=[(0,l.createElementVNode)(`span`,{class:`nb-sr-only`},`Row actions`,-1)]])):(0,l.createCommentVNode)(``,!0)],8,le)],8,ce),(0,l.createElementVNode)(`tbody`,{class:`nb-data-table__body`,role:M.value?`rowgroup`:void 0},[e.loading?((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,{key:0},(0,l.renderList)(e.skeletonRows,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`tr`,{key:`skeleton-${e}`,class:`nb-data-table__row nb-data-table__row--skeleton`},[O.value?((0,l.openBlock)(),(0,l.createElementBlock)(`td`,ge,[...n[4]||=[(0,l.createElementVNode)(`span`,{class:`nb-data-table__skeleton nb-data-table__skeleton--box`},null,-1)]])):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(D.value,t=>((0,l.openBlock)(),(0,l.createElementBlock)(`td`,{key:`sk-${e}-${t.key}`,class:`nb-data-table__td`},[...n[5]||=[(0,l.createElementVNode)(`span`,{class:`nb-data-table__skeleton`},null,-1)]]))),128)),k.value?((0,l.openBlock)(),(0,l.createElementBlock)(`td`,v,[...n[6]||=[(0,l.createElementVNode)(`span`,{class:`nb-data-table__skeleton nb-data-table__skeleton--box`},null,-1)]])):(0,l.createCommentVNode)(``,!0)]))),128)):e.error?((0,l.openBlock)(),(0,l.createElementBlock)(`tr`,y,[(0,l.createElementVNode)(`td`,{colspan:A.value,class:`nb-data-table__state nb-data-table__state--error`},[(0,l.renderSlot)(t.$slots,`error`,{error:e.error},()=>[(0,l.createVNode)(s.t,{is:`span`,align:`center`,justify:`center`,gap:`xs`,class:`nb-data-table__state-inner`},{default:(0,l.withCtx)(()=>[(0,l.createVNode)(r.t,{name:`warning-circle-fill`,"aria-hidden":`true`}),(0,l.createElementVNode)(`span`,null,(0,l.toDisplayString)(e.error),1)]),_:1})],!0)],8,b)])):e.rows.length?((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,{key:3},(0,l.renderList)(e.rows,(r,i)=>((0,l.openBlock)(),(0,l.createElementBlock)(`tr`,{key:F(r),class:(0,l.normalizeClass)([`nb-data-table__row`,{"nb-data-table__row--selected":R(r)},{"nb-data-table__row--clickable":ze.value}]),role:M.value?`row`:void 0,"aria-selected":e.selectable===`none`?void 0:R(r),onClick:e=>Be(r,i)},[O.value?((0,l.openBlock)(),(0,l.createElementBlock)(`td`,{key:0,class:`nb-data-table__td nb-data-table__select-cell`,onClick:n[0]||=(0,l.withModifiers)(()=>{},[`stop`]),onMousedown:U,onKeydown:U},[e.selectable===`multiple`?((0,l.openBlock)(),(0,l.createBlock)(c.t,{key:0,"model-value":R(r),"aria-label":`Select row ${i+1}`,"onUpdate:modelValue":e=>ke(r,i)},null,8,[`model-value`,`aria-label`,`onUpdate:modelValue`])):((0,l.openBlock)(),(0,l.createElementBlock)(`input`,{key:1,type:`radio`,class:`nb-data-table__radio`,name:T,checked:R(r),"aria-label":`Select row ${i+1}`,onChange:e=>Ae(r)},null,40,ye))],32)):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(D.value,n=>((0,l.openBlock)(),(0,l.createElementBlock)(`td`,{key:`td-${F(r)}-${n.key}`,class:(0,l.normalizeClass)([`nb-data-table__td`,`nb-data-table__td--${n.align||`left`}`,n.cellClass,M.value&&Ce(n)]),role:M.value?`cell`:void 0,"data-label":e.stackOnPhone?n.header:void 0},[(0,l.renderSlot)(t.$slots,`cell-${n.key}`,{row:r,value:N(n,r),column:n,rowIndex:i},()=>[n.render?((0,l.openBlock)(),(0,l.createBlock)(P,{key:0,column:n,row:r,"row-index":i},null,8,[`column`,`row`,`row-index`])):((0,l.openBlock)(),(0,l.createElementBlock)(l.Fragment,{key:1},[(0,l.createTextVNode)((0,l.toDisplayString)(Ee(N(n,r))),1)],64))],!0)],10,be))),128)),k.value?((0,l.openBlock)(),(0,l.createElementBlock)(`td`,{key:1,class:`nb-data-table__td nb-data-table__actions-cell`,onClick:n[1]||=(0,l.withModifiers)(()=>{},[`stop`])},[(0,l.renderSlot)(t.$slots,`row-actions`,{row:r,rowIndex:i},void 0,!0)])):(0,l.createCommentVNode)(``,!0)],10,ve))),128)):((0,l.openBlock)(),(0,l.createElementBlock)(`tr`,x,[(0,l.createElementVNode)(`td`,{colspan:A.value,class:`nb-data-table__state nb-data-table__state--empty`},[(0,l.renderSlot)(t.$slots,`empty`,{},()=>[(0,l.createElementVNode)(`span`,null,(0,l.toDisplayString)(e.emptyMessage||`No data to display`),1)],!0)],8,_e)]))],8,he)],8,ae)]),t.$slots.footer?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,xe,[(0,l.renderSlot)(t.$slots,`footer`,{},void 0,!0)])):(0,l.createCommentVNode)(``,!0)],16))}}),C=t.t(S,[[`__scopeId`,`data-v-0d151db9`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return C}});
|