@nubisco/ui 5.19.1 → 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/BarChart-Bnkibwcl.js +294 -0
- package/dist/BarChart-CjxY_3RM.cjs +1 -0
- package/dist/DataTable-CQBI0wcg.js +412 -0
- package/dist/DataTable-DN4SbClx.cjs +1 -0
- package/dist/{DatePicker-DMiiGKYY.js → DatePicker-ViTSDX6d.js} +113 -86
- 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/{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 +7 -7
- 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/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/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/index.cjs +1 -1
- package/dist/index.mjs +7 -7
- 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/Select.css +1 -1
- package/dist/styles/Tabs.css +1 -1
- package/dist/ui.css +5 -5
- 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-tAhXSR2o.cjs +0 -1
- package/dist/LineChart-C5bQNxQ-.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
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./_plugin-vue_export-helper-O4QQSku4.js";
|
|
2
|
-
import { i as t, l as n, n as r, u as i } from "./palette-StNyj_sM.js";
|
|
3
|
-
import { t as a } from "./ChartLegend-BLTbVV2E.js";
|
|
4
|
-
import { i as o, r as s, t as c } from "./scales-DlFF1BRk.js";
|
|
5
|
-
import { t as ee } from "./useChartSize-UdZSuP3G.js";
|
|
6
|
-
import { Fragment as l, computed as u, createBlock as te, createCommentVNode as ne, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as re, mergeProps as h, normalizeClass as ie, openBlock as g, ref as _, renderList as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
7
|
-
//#region src/components/Charts/BarChart.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var ae = [
|
|
9
|
-
"width",
|
|
10
|
-
"height",
|
|
11
|
-
"role",
|
|
12
|
-
"aria-label"
|
|
13
|
-
], oe = { key: 0 }, S = [
|
|
14
|
-
"x1",
|
|
15
|
-
"x2",
|
|
16
|
-
"y1",
|
|
17
|
-
"y2"
|
|
18
|
-
], C = { class: "nb-chart__axis" }, w = [
|
|
19
|
-
"x",
|
|
20
|
-
"y",
|
|
21
|
-
"text-anchor",
|
|
22
|
-
"dominant-baseline"
|
|
23
|
-
], T = { class: "nb-chart__axis" }, E = [
|
|
24
|
-
"x",
|
|
25
|
-
"y",
|
|
26
|
-
"text-anchor",
|
|
27
|
-
"dominant-baseline"
|
|
28
|
-
], D = [
|
|
29
|
-
"x1",
|
|
30
|
-
"x2",
|
|
31
|
-
"y1",
|
|
32
|
-
"y2"
|
|
33
|
-
], O = [
|
|
34
|
-
"fill",
|
|
35
|
-
"tabindex",
|
|
36
|
-
"role",
|
|
37
|
-
"aria-label",
|
|
38
|
-
"onKeydown"
|
|
39
|
-
], k = { class: "nb-chart__hover-layer" }, se = [
|
|
40
|
-
"onMouseenter",
|
|
41
|
-
"onMousemove",
|
|
42
|
-
"onClick"
|
|
43
|
-
], A = /* @__PURE__ */ e(/* @__PURE__ */ m({
|
|
44
|
-
__name: "BarChart",
|
|
45
|
-
props: {
|
|
46
|
-
series: { default: () => [] },
|
|
47
|
-
orientation: { default: "vertical" },
|
|
48
|
-
stacked: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: !1
|
|
51
|
-
},
|
|
52
|
-
title: { default: void 0 },
|
|
53
|
-
subtitle: { default: void 0 },
|
|
54
|
-
height: { default: 280 },
|
|
55
|
-
showLegend: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: !0
|
|
58
|
-
},
|
|
59
|
-
showTooltip: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: !0
|
|
62
|
-
},
|
|
63
|
-
showGrid: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: !0
|
|
66
|
-
},
|
|
67
|
-
colors: { default: () => r }
|
|
68
|
-
},
|
|
69
|
-
emits: ["select"],
|
|
70
|
-
setup(e, { emit: r }) {
|
|
71
|
-
let m = e, A = r, j = _(null), M = ee(j, {
|
|
72
|
-
width: 480,
|
|
73
|
-
height: 240
|
|
74
|
-
}), N = u(() => m.orientation === "horizontal"), P = u(() => m.series.map((e, n) => ({
|
|
75
|
-
name: e.name,
|
|
76
|
-
data: e.data,
|
|
77
|
-
color: e.color ?? t(n, m.colors)
|
|
78
|
-
}))), F = u(() => (m.series[0]?.data ?? []).map((e) => e.x)), I = (e, t) => P.value[t]?.data[e]?.y ?? 0, L = (e, t) => {
|
|
79
|
-
let n = I(e, t);
|
|
80
|
-
if (!m.stacked) return [0, n];
|
|
81
|
-
let r = 0;
|
|
82
|
-
for (let i = 0; i < t; i += 1) {
|
|
83
|
-
let t = I(e, i);
|
|
84
|
-
t >= 0 == n >= 0 && (r += t);
|
|
85
|
-
}
|
|
86
|
-
return [r, r + n];
|
|
87
|
-
}, R = u(() => {
|
|
88
|
-
let e = [];
|
|
89
|
-
return F.value.forEach((t, n) => {
|
|
90
|
-
P.value.forEach((t, r) => {
|
|
91
|
-
e.push(L(n, r)[1]);
|
|
92
|
-
});
|
|
93
|
-
}), e.length ? o(Math.min(0, ...e), Math.max(0, ...e), .05) : [0, 1];
|
|
94
|
-
}), z = u(() => {
|
|
95
|
-
if (!N.value) return {
|
|
96
|
-
top: 12,
|
|
97
|
-
right: 16,
|
|
98
|
-
bottom: 28,
|
|
99
|
-
left: 44
|
|
100
|
-
};
|
|
101
|
-
let e = F.value.reduce((e, t) => Math.max(e, String(t).length), 0), t = Math.max(44, Math.round(M.value.width * .4));
|
|
102
|
-
return {
|
|
103
|
-
top: 12,
|
|
104
|
-
right: 16,
|
|
105
|
-
bottom: 28,
|
|
106
|
-
left: Math.min(Math.max(44, Math.ceil(e * 6.2) + 12), t)
|
|
107
|
-
};
|
|
108
|
-
}), B = u(() => ({
|
|
109
|
-
x0: z.value.left,
|
|
110
|
-
x1: Math.max(z.value.left, M.value.width - z.value.right),
|
|
111
|
-
y0: z.value.top,
|
|
112
|
-
y1: Math.max(z.value.top, M.value.height - z.value.bottom)
|
|
113
|
-
})), V = u(() => c(F.value.map((e) => String(e)), N.value ? [B.value.y0, B.value.y1] : [B.value.x0, B.value.x1], .2)), H = u(() => s(R.value, N.value ? [B.value.x0, B.value.x1] : [B.value.y1, B.value.y0])), U = u(() => H.value.ticks(5)), W = (e) => V.value(String(F.value[e])), G = (e) => W(e) + V.value.bandwidth / 2, K = u(() => {
|
|
114
|
-
let e = P.value.length || 1;
|
|
115
|
-
return m.stacked ? V.value.bandwidth : V.value.bandwidth / e;
|
|
116
|
-
}), ce = (e, t) => {
|
|
117
|
-
let [n, r] = L(e, t), i = H.value(n), a = H.value(r), o = Math.max(0, K.value - 2), s = W(e) + (m.stacked ? 0 : t * K.value), c = Math.max(0, Math.abs(a - i));
|
|
118
|
-
return N.value ? {
|
|
119
|
-
x: Math.min(i, a),
|
|
120
|
-
y: s,
|
|
121
|
-
width: c,
|
|
122
|
-
height: o
|
|
123
|
-
} : {
|
|
124
|
-
x: s,
|
|
125
|
-
y: Math.min(i, a),
|
|
126
|
-
width: o,
|
|
127
|
-
height: c
|
|
128
|
-
};
|
|
129
|
-
}, le = (e) => {
|
|
130
|
-
let t = W(e), n = V.value.bandwidth;
|
|
131
|
-
return N.value ? {
|
|
132
|
-
x: B.value.x0,
|
|
133
|
-
y: t,
|
|
134
|
-
width: Math.max(0, B.value.x1 - B.value.x0),
|
|
135
|
-
height: n
|
|
136
|
-
} : {
|
|
137
|
-
x: t,
|
|
138
|
-
y: B.value.y0,
|
|
139
|
-
width: n,
|
|
140
|
-
height: Math.max(0, B.value.y1 - B.value.y0)
|
|
141
|
-
};
|
|
142
|
-
}, q = (e) => Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : String(e), ue = re(), J = () => !!ue?.vnode.props?.onSelect, Y = (e, t) => {
|
|
143
|
-
let n = P.value[t], r = q(I(e, t));
|
|
144
|
-
return P.value.length > 1 ? `${F.value[e]}, ${n?.name}: ${r}` : `${F.value[e]}: ${r}`;
|
|
145
|
-
}, X = (e, t) => {
|
|
146
|
-
let n = P.value[t], r = n?.data[e];
|
|
147
|
-
return {
|
|
148
|
-
kind: "series",
|
|
149
|
-
x: r?.x ?? F.value[e],
|
|
150
|
-
y: r?.y ?? 0,
|
|
151
|
-
seriesName: n?.name ?? "",
|
|
152
|
-
seriesIndex: t,
|
|
153
|
-
index: e,
|
|
154
|
-
point: r ?? {
|
|
155
|
-
x: F.value[e],
|
|
156
|
-
y: 0
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
}, Z = (e) => {
|
|
160
|
-
let t = e.currentTarget.ownerSVGElement;
|
|
161
|
-
if (!t) return null;
|
|
162
|
-
let n = t.getBoundingClientRect();
|
|
163
|
-
return {
|
|
164
|
-
x: e.clientX - n.left,
|
|
165
|
-
y: e.clientY - n.top
|
|
166
|
-
};
|
|
167
|
-
}, de = (e, t) => {
|
|
168
|
-
let n = P.value.length;
|
|
169
|
-
if (n <= 1) return 0;
|
|
170
|
-
let r = Z(e);
|
|
171
|
-
if (!r) return 0;
|
|
172
|
-
if (m.stacked) {
|
|
173
|
-
let e = N.value ? r.x : r.y;
|
|
174
|
-
for (let r = 0; r < n; r += 1) {
|
|
175
|
-
let [n, i] = L(t, r), a = H.value(n), o = H.value(i);
|
|
176
|
-
if (e >= Math.min(a, o) && e <= Math.max(a, o)) return r;
|
|
177
|
-
}
|
|
178
|
-
return n - 1;
|
|
179
|
-
}
|
|
180
|
-
let i = (N.value ? r.y : r.x) - W(t), a = Math.floor(i / (K.value || 1));
|
|
181
|
-
return Math.min(Math.max(a, 0), n - 1);
|
|
182
|
-
}, fe = (e, t) => {
|
|
183
|
-
J() && A("select", X(t, de(e, t)));
|
|
184
|
-
}, pe = (e, t, n) => {
|
|
185
|
-
J() && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), A("select", X(t, n))));
|
|
186
|
-
}, Q = _(null), $ = _({
|
|
187
|
-
x: 0,
|
|
188
|
-
y: 0
|
|
189
|
-
}), me = (e, t) => {
|
|
190
|
-
let n = Z(e);
|
|
191
|
-
n && ($.value = {
|
|
192
|
-
x: n.x + 12,
|
|
193
|
-
y: n.y + 12
|
|
194
|
-
}, Q.value = t);
|
|
195
|
-
}, he = u(() => Q.value === null ? [] : P.value.map((e) => ({
|
|
196
|
-
label: e.name,
|
|
197
|
-
value: q(e.data[Q.value]?.y ?? 0),
|
|
198
|
-
color: e.color
|
|
199
|
-
})));
|
|
200
|
-
return (t, r) => (g(), te(i, {
|
|
201
|
-
title: e.title,
|
|
202
|
-
subtitle: e.subtitle,
|
|
203
|
-
height: e.height,
|
|
204
|
-
"show-legend": e.showLegend && P.value.length > 0
|
|
205
|
-
}, {
|
|
206
|
-
legend: x(() => [p(a, { items: P.value.map((e) => ({
|
|
207
|
-
label: e.name,
|
|
208
|
-
color: e.color
|
|
209
|
-
})) }, null, 8, ["items"])]),
|
|
210
|
-
default: x(() => [f("div", {
|
|
211
|
-
ref_key: "root",
|
|
212
|
-
ref: j,
|
|
213
|
-
class: "nb-bar-chart"
|
|
214
|
-
}, [(g(), d("svg", {
|
|
215
|
-
width: b(M).width,
|
|
216
|
-
height: b(M).height,
|
|
217
|
-
class: ie(["nb-chart__svg", { "nb-chart__svg--selectable": J() }]),
|
|
218
|
-
role: J() ? "group" : "img",
|
|
219
|
-
"aria-label": e.title || "Bar chart",
|
|
220
|
-
onMouseleave: r[0] ||= (e) => Q.value = null
|
|
221
|
-
}, [
|
|
222
|
-
e.showGrid && b(M).width > 0 ? (g(), d("g", oe, [(g(!0), d(l, null, v(U.value, (e) => (g(), d("line", {
|
|
223
|
-
key: `grid-${e}`,
|
|
224
|
-
class: "nb-chart__gridline",
|
|
225
|
-
x1: N.value ? H.value(e) : B.value.x0,
|
|
226
|
-
x2: N.value ? H.value(e) : B.value.x1,
|
|
227
|
-
y1: N.value ? B.value.y0 : H.value(e),
|
|
228
|
-
y2: N.value ? B.value.y1 : H.value(e)
|
|
229
|
-
}, null, 8, S))), 128))])) : ne("", !0),
|
|
230
|
-
f("g", C, [(g(!0), d(l, null, v(U.value, (e) => (g(), d("text", {
|
|
231
|
-
key: `vt-${e}`,
|
|
232
|
-
x: N.value ? H.value(e) : B.value.x0 - 6,
|
|
233
|
-
y: N.value ? B.value.y1 + 14 : H.value(e),
|
|
234
|
-
"text-anchor": N.value ? "middle" : "end",
|
|
235
|
-
"dominant-baseline": N.value ? "auto" : "middle"
|
|
236
|
-
}, y(q(e)), 9, w))), 128))]),
|
|
237
|
-
f("g", T, [(g(!0), d(l, null, v(F.value, (e, t) => (g(), d("text", {
|
|
238
|
-
key: `ct-${t}`,
|
|
239
|
-
x: N.value ? B.value.x0 - 6 : G(t),
|
|
240
|
-
y: N.value ? G(t) : B.value.y1 + 14,
|
|
241
|
-
"text-anchor": N.value ? "end" : "middle",
|
|
242
|
-
"dominant-baseline": N.value ? "middle" : "auto"
|
|
243
|
-
}, y(e), 9, E))), 128))]),
|
|
244
|
-
f("line", {
|
|
245
|
-
class: "nb-chart__axis-line",
|
|
246
|
-
x1: N.value ? H.value(0) : B.value.x0,
|
|
247
|
-
x2: N.value ? H.value(0) : B.value.x1,
|
|
248
|
-
y1: N.value ? B.value.y0 : H.value(0),
|
|
249
|
-
y2: N.value ? B.value.y1 : H.value(0)
|
|
250
|
-
}, null, 8, D),
|
|
251
|
-
(g(!0), d(l, null, v(F.value, (e, t) => (g(), d("g", { key: `g-${t}` }, [(g(!0), d(l, null, v(P.value, (e, n) => (g(), d("rect", h({
|
|
252
|
-
key: `${t}-${n}`,
|
|
253
|
-
class: ["nb-chart__bar", { "is-dim": Q.value !== null && Q.value !== t }]
|
|
254
|
-
}, { ref_for: !0 }, ce(t, n), {
|
|
255
|
-
fill: e.color,
|
|
256
|
-
tabindex: J() ? 0 : void 0,
|
|
257
|
-
role: J() ? "button" : void 0,
|
|
258
|
-
"aria-label": J() ? Y(t, n) : void 0,
|
|
259
|
-
onKeydown: (e) => pe(e, t, n)
|
|
260
|
-
}), null, 16, O))), 128))]))), 128)),
|
|
261
|
-
f("g", k, [(g(!0), d(l, null, v(F.value, (e, t) => (g(), d("rect", h({ key: `hover-${t}` }, { ref_for: !0 }, le(t), {
|
|
262
|
-
fill: "transparent",
|
|
263
|
-
onMouseenter: (e) => Q.value = t,
|
|
264
|
-
onMousemove: (e) => me(e, t),
|
|
265
|
-
onClick: (e) => fe(e, t)
|
|
266
|
-
}), null, 16, se))), 128))])
|
|
267
|
-
], 42, ae)), p(n, {
|
|
268
|
-
visible: e.showTooltip && Q.value !== null,
|
|
269
|
-
x: $.value.x,
|
|
270
|
-
y: $.value.y,
|
|
271
|
-
title: Q.value === null ? "" : String(F.value[Q.value]),
|
|
272
|
-
rows: he.value
|
|
273
|
-
}, null, 8, [
|
|
274
|
-
"visible",
|
|
275
|
-
"x",
|
|
276
|
-
"y",
|
|
277
|
-
"title",
|
|
278
|
-
"rows"
|
|
279
|
-
])], 512)]),
|
|
280
|
-
_: 1
|
|
281
|
-
}, 8, [
|
|
282
|
-
"title",
|
|
283
|
-
"subtitle",
|
|
284
|
-
"height",
|
|
285
|
-
"show-legend"
|
|
286
|
-
]));
|
|
287
|
-
}
|
|
288
|
-
}), [["__scopeId", "data-v-6e97c73e"]]);
|
|
289
|
-
//#endregion
|
|
290
|
-
export { A as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./palette-Cy2_8mLH.cjs`),n=require(`./ChartLegend-DGgW0yjG.cjs`),r=require(`./scales-4WxjhxBm.cjs`),i=require(`./useChartSize-C-BIN0vc.cjs`);let a=require(`vue`);var o=[`width`,`height`,`role`,`aria-label`],s={key:0},c=[`x1`,`x2`,`y1`,`y2`],l={class:`nb-chart__axis`},u=[`x`,`y`,`text-anchor`,`dominant-baseline`],d={class:`nb-chart__axis`},f=[`x`,`y`,`text-anchor`,`dominant-baseline`],p=[`x1`,`x2`,`y1`,`y2`],m=[`fill`,`tabindex`,`role`,`aria-label`,`onKeydown`],h={class:`nb-chart__hover-layer`},g=[`onMouseenter`,`onMousemove`,`onClick`],_=(0,a.defineComponent)({__name:`BarChart`,props:{series:{default:()=>[]},orientation:{default:`vertical`},stacked:{type:Boolean,default:!1},title:{default:void 0},subtitle:{default:void 0},height:{default:280},showLegend:{type:Boolean,default:!0},showTooltip:{type:Boolean,default:!0},showGrid:{type:Boolean,default:!0},colors:{default:()=>t.n}},emits:[`select`],setup(e,{emit:_}){let v=e,y=_,b=(0,a.ref)(null),x=i.t(b,{width:480,height:240}),S=(0,a.computed)(()=>v.orientation===`horizontal`),C=(0,a.computed)(()=>v.series.map((e,n)=>({name:e.name,data:e.data,color:e.color??t.i(n,v.colors)}))),w=(0,a.computed)(()=>(v.series[0]?.data??[]).map(e=>e.x)),T=(e,t)=>C.value[t]?.data[e]?.y??0,E=(e,t)=>{let n=T(e,t);if(!v.stacked)return[0,n];let r=0;for(let i=0;i<t;i+=1){let t=T(e,i);t>=0==n>=0&&(r+=t)}return[r,r+n]},D=(0,a.computed)(()=>{let e=[];return w.value.forEach((t,n)=>{C.value.forEach((t,r)=>{e.push(E(n,r)[1])})}),e.length?r.i(Math.min(0,...e),Math.max(0,...e),.05):[0,1]}),O=(0,a.computed)(()=>{if(!S.value)return{top:12,right:16,bottom:28,left:44};let e=w.value.reduce((e,t)=>Math.max(e,String(t).length),0),t=Math.max(44,Math.round(x.value.width*.4));return{top:12,right:16,bottom:28,left:Math.min(Math.max(44,Math.ceil(e*6.2)+12),t)}}),k=(0,a.computed)(()=>({x0:O.value.left,x1:Math.max(O.value.left,x.value.width-O.value.right),y0:O.value.top,y1:Math.max(O.value.top,x.value.height-O.value.bottom)})),A=(0,a.computed)(()=>r.t(w.value.map(e=>String(e)),S.value?[k.value.y0,k.value.y1]:[k.value.x0,k.value.x1],.2)),j=(0,a.computed)(()=>r.r(D.value,S.value?[k.value.x0,k.value.x1]:[k.value.y1,k.value.y0])),M=(0,a.computed)(()=>j.value.ticks(5)),N=e=>A.value(String(w.value[e])),P=e=>N(e)+A.value.bandwidth/2,F=(0,a.computed)(()=>{let e=C.value.length||1;return v.stacked?A.value.bandwidth:A.value.bandwidth/e}),I=(e,t)=>{let[n,r]=E(e,t),i=j.value(n),a=j.value(r),o=Math.max(0,F.value-2),s=N(e)+(v.stacked?0:t*F.value),c=Math.max(0,Math.abs(a-i));return S.value?{x:Math.min(i,a),y:s,width:c,height:o}:{x:s,y:Math.min(i,a),width:o,height:c}},L=e=>{let t=N(e),n=A.value.bandwidth;return S.value?{x:k.value.x0,y:t,width:Math.max(0,k.value.x1-k.value.x0),height:n}:{x:t,y:k.value.y0,width:n,height:Math.max(0,k.value.y1-k.value.y0)}},R=e=>Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),z=(0,a.getCurrentInstance)(),B=()=>!!z?.vnode.props?.onSelect,V=(e,t)=>{let n=C.value[t],r=R(T(e,t));return C.value.length>1?`${w.value[e]}, ${n?.name}: ${r}`:`${w.value[e]}: ${r}`},H=(e,t)=>{let n=C.value[t],r=n?.data[e];return{kind:`series`,x:r?.x??w.value[e],y:r?.y??0,seriesName:n?.name??``,seriesIndex:t,index:e,point:r??{x:w.value[e],y:0}}},U=e=>{let t=e.currentTarget.ownerSVGElement;if(!t)return null;let n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}},W=(e,t)=>{let n=C.value.length;if(n<=1)return 0;let r=U(e);if(!r)return 0;if(v.stacked){let e=S.value?r.x:r.y;for(let r=0;r<n;r+=1){let[n,i]=E(t,r),a=j.value(n),o=j.value(i);if(e>=Math.min(a,o)&&e<=Math.max(a,o))return r}return n-1}let i=(S.value?r.y:r.x)-N(t),a=Math.floor(i/(F.value||1));return Math.min(Math.max(a,0),n-1)},G=(e,t)=>{B()&&y(`select`,H(t,W(e,t)))},K=(e,t,n)=>{B()&&(e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),y(`select`,H(t,n))))},q=(0,a.ref)(null),J=(0,a.ref)({x:0,y:0}),Y=(e,t)=>{let n=U(e);n&&(J.value={x:n.x+12,y:n.y+12},q.value=t)},X=(0,a.computed)(()=>q.value===null?[]:C.value.map(e=>({label:e.name,value:R(e.data[q.value]?.y??0),color:e.color})));return(r,i)=>((0,a.openBlock)(),(0,a.createBlock)(t.u,{title:e.title,subtitle:e.subtitle,height:e.height,"show-legend":e.showLegend&&C.value.length>0},{legend:(0,a.withCtx)(()=>[(0,a.createVNode)(n.t,{items:C.value.map(e=>({label:e.name,color:e.color}))},null,8,[`items`])]),default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,{ref_key:`root`,ref:b,class:`nb-bar-chart`},[((0,a.openBlock)(),(0,a.createElementBlock)(`svg`,{width:(0,a.unref)(x).width,height:(0,a.unref)(x).height,class:(0,a.normalizeClass)([`nb-chart__svg`,{"nb-chart__svg--selectable":B()}]),role:B()?`group`:`img`,"aria-label":e.title||`Bar chart`,onMouseleave:i[0]||=e=>q.value=null},[e.showGrid&&(0,a.unref)(x).width>0?((0,a.openBlock)(),(0,a.createElementBlock)(`g`,s,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(M.value,e=>((0,a.openBlock)(),(0,a.createElementBlock)(`line`,{key:`grid-${e}`,class:`nb-chart__gridline`,x1:S.value?j.value(e):k.value.x0,x2:S.value?j.value(e):k.value.x1,y1:S.value?k.value.y0:j.value(e),y2:S.value?k.value.y1:j.value(e)},null,8,c))),128))])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`g`,l,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(M.value,e=>((0,a.openBlock)(),(0,a.createElementBlock)(`text`,{key:`vt-${e}`,x:S.value?j.value(e):k.value.x0-6,y:S.value?k.value.y1+14:j.value(e),"text-anchor":S.value?`middle`:`end`,"dominant-baseline":S.value?`auto`:`middle`},(0,a.toDisplayString)(R(e)),9,u))),128))]),(0,a.createElementVNode)(`g`,d,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(w.value,(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`text`,{key:`ct-${t}`,x:S.value?k.value.x0-6:P(t),y:S.value?P(t):k.value.y1+14,"text-anchor":S.value?`end`:`middle`,"dominant-baseline":S.value?`middle`:`auto`},(0,a.toDisplayString)(e),9,f))),128))]),(0,a.createElementVNode)(`line`,{class:`nb-chart__axis-line`,x1:S.value?j.value(0):k.value.x0,x2:S.value?j.value(0):k.value.x1,y1:S.value?k.value.y0:j.value(0),y2:S.value?k.value.y1:j.value(0)},null,8,p),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(w.value,(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`g`,{key:`g-${t}`},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(C.value,(e,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`rect`,(0,a.mergeProps)({key:`${t}-${n}`,class:[`nb-chart__bar`,{"is-dim":q.value!==null&&q.value!==t}]},{ref_for:!0},I(t,n),{fill:e.color,tabindex:B()?0:void 0,role:B()?`button`:void 0,"aria-label":B()?V(t,n):void 0,onKeydown:e=>K(e,t,n)}),null,16,m))),128))]))),128)),(0,a.createElementVNode)(`g`,h,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(w.value,(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`rect`,(0,a.mergeProps)({key:`hover-${t}`},{ref_for:!0},L(t),{fill:`transparent`,onMouseenter:e=>q.value=t,onMousemove:e=>Y(e,t),onClick:e=>G(e,t)}),null,16,g))),128))])],42,o)),(0,a.createVNode)(t.l,{visible:e.showTooltip&&q.value!==null,x:J.value.x,y:J.value.y,title:q.value===null?``:String(w.value[q.value]),rows:X.value},null,8,[`visible`,`x`,`y`,`title`,`rows`])],512)]),_:1},8,[`title`,`subtitle`,`height`,`show-legend`]))}}),v=e.t(_,[[`__scopeId`,`data-v-6e97c73e`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|
|
@@ -1 +0,0 @@
|
|
|
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={key:0,class:`nb-data-table__toolbar`},m=[`inert`,`aria-hidden`],h={key:0},g={key:0,class:`nb-data-table__title`},_={key:1,class:`nb-data-table__description`},v=[`inert`,`aria-hidden`],y={key:1,class:`nb-data-table__batch`,role:`region`,"aria-label":`Table batch actions`},ee={class:`nb-data-table__batch-count`},te={class:`nb-data-table__batch-actions`},ne={class:`nb-data-table__scroll`},re=[`role`,`aria-label`,`aria-busy`],ie={key:0,class:`nb-data-table__col-select`},ae={key:1,class:`nb-data-table__col-actions`},oe=[`role`],se=[`role`],ce={key:0,scope:`col`,class:`nb-data-table__th nb-data-table__select-cell`},le=[`aria-sort`],ue=[`onClick`],de={class:`nb-data-table__th-label`},fe={key:1,class:`nb-data-table__th-label`},pe={key:1,scope:`col`,class:`nb-data-table__th nb-data-table__actions-cell`},me=[`role`],he={key:0,class:`nb-data-table__td`},ge={key:1,class:`nb-data-table__td`},_e={key:1,class:`nb-data-table__state-row`},b=[`colspan`],x={key:2,class:`nb-data-table__state-row`},S=[`colspan`],C=[`role`,`aria-selected`,`onClick`],w=[`checked`,`aria-label`,`onChange`],T=[`role`,`data-label`],E={key:1,class:`nb-data-table__footer`},D=(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:D}=i.useSurfaceLayer(),O=t,k=(0,l.useSlots)(),A=`nb-data-table-select-${(0,l.useId)()}`,j=(0,l.computed)(()=>n.size),M=(0,l.computed)(()=>n.columns.filter(e=>!e.hidden)),N=(0,l.computed)(()=>n.selectable!==`none`),P=(0,l.computed)(()=>!!k[`row-actions`]),F=(0,l.computed)(()=>M.value.length+(N.value?1:0)+(P.value?1:0)),{phone:I}=a.usePhoneLayout(),L=(0,l.computed)(()=>n.stackOnPhone&&I.value),ve=(0,l.computed)(()=>(M.value.find(e=>e.primary)??M.value.find(e=>!e.phoneHidden&&!e.phoneMeta))?.key);function ye(e){return e.phoneHidden?`nb-data-table__td--phone-hidden`:e.key===ve.value?`nb-data-table__td--primary`:e.phoneMeta?`nb-data-table__td--meta`:`nb-data-table__td--field`}let be=(0,l.computed)(()=>!n.loading&&!n.error&&n.rows.length>0&&(n.selectable===`multiple`||M.value.some(e=>e.sortable&&!e.phoneHidden)));function xe(e){if(e.width!=null)return{width:typeof e.width==`number`?`${e.width}px`:e.width}}function R(e,t){return t[e.key]}function Se(e){return e==null?``:String(e)}let z=e=>e.column.render?.(e.row,R(e.column,e.row),e.rowIndex)??null;z.props=[`column`,`row`,`rowIndex`];function B(e){let t=n.rowKey;return typeof t==`function`?t(e):e[t]}let V=(0,l.computed)(()=>new Set(n.selected)),Ce=(0,l.computed)(()=>n.selected),H=(0,l.computed)(()=>n.selected.length);function U(e){return V.value.has(B(e))}let W=(0,l.computed)(()=>n.rows.map(e=>B(e))),G=(0,l.computed)(()=>W.value.length>0&&W.value.every(e=>V.value.has(e))),we=(0,l.computed)(()=>!G.value&&W.value.some(e=>V.value.has(e))),K=(0,l.ref)(null),q=!1;function J(e){q=e.shiftKey}(0,l.watch)(W,()=>{K.value=null});function Te(e,t){let r=B(e),i=new Set(n.selected),a=!i.has(r),o=K.value,s=e=>{a?i.add(e):i.delete(e)};if(q&&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(B(e))}}else s(r),K.value=t;q=!1,O(`update:selected`,[...i])}function Ee(e){O(`update:selected`,[B(e)])}function De(){let e=new Set(n.selected);G.value?W.value.forEach(t=>e.delete(t)):W.value.forEach(t=>e.add(t)),O(`update:selected`,[...e])}function Y(){O(`update:selected`,[])}let X=(0,l.computed)(()=>n.selectable!==`none`&&!!k[`batch-actions`]),Z=(0,l.computed)(()=>X.value&&H.value>0),Oe=(0,l.computed)(()=>!!n.title||!!n.description||!!k.toolbar||!!k.search||!!k[`toolbar-actions`]),ke=(0,l.computed)(()=>Oe.value||X.value);function Q(e){return!!n.sortState&&n.sortState.key===e.key&&n.sortState.direction!==`none`}function Ae(e){return Q(e)?n.sortState.direction===`asc`?`ascending`:`descending`:`none`}function $(e){return Q(e)?n.sortState.direction===`asc`?d:f:u}function je(e){return e===`asc`?`desc`:e===`desc`?`none`:`asc`}function Me(e){let t=n.sortState&&n.sortState.key===e.key?n.sortState.direction:`none`;O(`sort`,{key:e.key,direction:je(t)})}let Ne=(0,l.getCurrentInstance)(),Pe=(0,l.computed)(()=>!!Ne?.vnode.props?.onRowClick);function Fe(e,t){O(`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":L.value},{"nb-data-table--stacked-headless":L.value&&!be.value}]},(0,l.unref)(D)),[ke.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,p,[(0,l.createElementVNode)(`div`,{class:`nb-data-table__toolbar-heading`,inert:Z.value||void 0,"aria-hidden":Z.value||void 0},[(0,l.renderSlot)(t.$slots,`toolbar`,{selectedCount:H.value},()=>[e.title||e.description?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,h,[e.title?((0,l.openBlock)(),(0,l.createElementBlock)(`h2`,g,(0,l.toDisplayString)(e.title),1)):(0,l.createCommentVNode)(``,!0),e.description?((0,l.openBlock)(),(0,l.createElementBlock)(`p`,_,(0,l.toDisplayString)(e.description),1)):(0,l.createCommentVNode)(``,!0)])):(0,l.createCommentVNode)(``,!0)],!0)],8,m),t.$slots.search||t.$slots[`toolbar-actions`]?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,class:`nb-data-table__toolbar-tools`,inert:Z.value||void 0,"aria-hidden":Z.value||void 0},[(0,l.renderSlot)(t.$slots,`search`,{},void 0,!0),(0,l.renderSlot)(t.$slots,`toolbar-actions`,{},void 0,!0)],8,v)):(0,l.createCommentVNode)(``,!0),Z.value?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,y,[(0,l.createElementVNode)(`span`,ee,(0,l.toDisplayString)(H.value)+` selected `,1),(0,l.createElementVNode)(`div`,te,[(0,l.renderSlot)(t.$slots,`batch-actions`,{selectedKeys:Ce.value,clear:Y},void 0,!0)]),(0,l.createVNode)(o.t,{class:`nb-data-table__batch-cancel`,variant:`ghost`,size:j.value,onClick:Y},{default:(0,l.withCtx)(()=>[...n[2]||=[(0,l.createTextVNode)(` Cancel `,-1)]]),_:1},8,[`size`])])):(0,l.createCommentVNode)(``,!0)])):(0,l.createCommentVNode)(``,!0),(0,l.createElementVNode)(`div`,ne,[(0,l.createElementVNode)(`table`,{class:`nb-data-table__table`,role:L.value?`table`:void 0,"aria-label":e.ariaLabel||e.title||void 0,"aria-busy":e.loading||void 0},[(0,l.createElementVNode)(`colgroup`,null,[N.value?((0,l.openBlock)(),(0,l.createElementBlock)(`col`,ie)):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(M.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)(`col`,{key:`col-${e.key}`,style:(0,l.normalizeStyle)(xe(e))},null,4))),128)),P.value?((0,l.openBlock)(),(0,l.createElementBlock)(`col`,ae)):(0,l.createCommentVNode)(``,!0)]),(0,l.createElementVNode)(`thead`,{class:`nb-data-table__head`,role:L.value?`rowgroup`:void 0},[(0,l.createElementVNode)(`tr`,{role:L.value?`row`:void 0},[N.value?((0,l.openBlock)(),(0,l.createElementBlock)(`th`,ce,[e.selectable===`multiple`?((0,l.openBlock)(),(0,l.createBlock)(c.t,{key:0,"model-value":G.value,indeterminate:we.value,"aria-label":`Select all rows`,"onUpdate:modelValue":De},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)(M.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":Q(e)},L.value&&e.phoneHidden&&`nb-data-table__th--phone-hidden`]),"aria-sort":e.sortable?Ae(e):void 0},[e.sortable?((0,l.openBlock)(),(0,l.createElementBlock)(`button`,{key:0,type:`button`,class:`nb-data-table__sort`,onClick:t=>Me(e)},[(0,l.createElementVNode)(`span`,de,[(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:$(e),class:`nb-data-table__sort-icon`,"aria-hidden":`true`},null,8,[`name`])],8,ue)):((0,l.openBlock)(),(0,l.createElementBlock)(`span`,fe,[(0,l.renderSlot)(t.$slots,`header-${e.key}`,{column:e},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(e.header),1)],!0)]))],10,le))),128)),P.value?((0,l.openBlock)(),(0,l.createElementBlock)(`th`,pe,[...n[3]||=[(0,l.createElementVNode)(`span`,{class:`nb-sr-only`},`Row actions`,-1)]])):(0,l.createCommentVNode)(``,!0)],8,se)],8,oe),(0,l.createElementVNode)(`tbody`,{class:`nb-data-table__body`,role:L.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`},[N.value?((0,l.openBlock)(),(0,l.createElementBlock)(`td`,he,[...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)(M.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)),P.value?((0,l.openBlock)(),(0,l.createElementBlock)(`td`,ge,[...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`,_e,[(0,l.createElementVNode)(`td`,{colspan:F.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:B(r),class:(0,l.normalizeClass)([`nb-data-table__row`,{"nb-data-table__row--selected":U(r)},{"nb-data-table__row--clickable":Pe.value}]),role:L.value?`row`:void 0,"aria-selected":e.selectable===`none`?void 0:U(r),onClick:e=>Fe(r,i)},[N.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:J,onKeydown:J},[e.selectable===`multiple`?((0,l.openBlock)(),(0,l.createBlock)(c.t,{key:0,"model-value":U(r),"aria-label":`Select row ${i+1}`,"onUpdate:modelValue":e=>Te(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:A,checked:U(r),"aria-label":`Select row ${i+1}`,onChange:e=>Ee(r)},null,40,w))],32)):(0,l.createCommentVNode)(``,!0),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(M.value,n=>((0,l.openBlock)(),(0,l.createElementBlock)(`td`,{key:`td-${B(r)}-${n.key}`,class:(0,l.normalizeClass)([`nb-data-table__td`,`nb-data-table__td--${n.align||`left`}`,n.cellClass,L.value&&ye(n)]),role:L.value?`cell`:void 0,"data-label":e.stackOnPhone?n.header:void 0},[(0,l.renderSlot)(t.$slots,`cell-${n.key}`,{row:r,value:R(n,r),column:n,rowIndex:i},()=>[n.render?((0,l.openBlock)(),(0,l.createBlock)(z,{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)(Se(R(n,r))),1)],64))],!0)],10,T))),128)),P.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,C))),128)):((0,l.openBlock)(),(0,l.createElementBlock)(`tr`,x,[(0,l.createElementVNode)(`td`,{colspan:F.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,S)]))],8,me)],8,re)]),t.$slots.footer?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,E,[(0,l.renderSlot)(t.$slots,`footer`,{},void 0,!0)])):(0,l.createCommentVNode)(``,!0)],16))}}),O=t.t(D,[[`__scopeId`,`data-v-a4bea523`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return O}});
|