@nubisco/ui 5.25.2 → 5.26.1
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-lEopoloN.js → ActionGroup-BepLbLUB.js} +1 -1
- package/dist/{ActionGroup-CUN48Qea.cjs → ActionGroup-CPJcdC_x.cjs} +1 -1
- package/dist/{AiProvider-B4salihw.js → AiProvider-CkzXTd_m.js} +1 -1
- package/dist/{AiProvider-pHIvM5zN.cjs → AiProvider-ueSRHZ4d.cjs} +1 -1
- package/dist/{BackToTop-Dm7Aq_81.cjs → BackToTop-Bep47dq4.cjs} +1 -1
- package/dist/{BackToTop-C4Aol9qJ.js → BackToTop-DwInsaIf.js} +1 -1
- package/dist/{BlueprintControls-COeG8N6G.js → BlueprintControls-CLW9PC_k.js} +1 -1
- package/dist/{BlueprintControls-BfTyqOwC.cjs → BlueprintControls-xe0sgQXW.cjs} +1 -1
- package/dist/{Board-R38Zb5t2.js → Board-CTjk-pTy.js} +1 -1
- package/dist/{Board-DmOzimbT.cjs → Board-CoxZg27T.cjs} +1 -1
- package/dist/{BriefingDestination-CA8Dv-tJ.js → BriefingDestination-D_IHVo71.js} +1 -1
- package/dist/{BriefingDestination-DIXsBoE2.cjs → BriefingDestination-Md4A2sPI.cjs} +1 -1
- package/dist/{Button-C0UUTgEB.cjs → Button-CbQyG-jg.cjs} +1 -1
- package/dist/{Button-IcCXOoCT.js → Button-Cq9dEeHz.js} +1 -1
- package/dist/{Confirm-YhMEfWX5.cjs → Confirm-Bdc104-K.cjs} +1 -1
- package/dist/{Confirm-DQqArhXl.js → Confirm-CpKo6Tav.js} +2 -2
- package/dist/{CopyButton-CqrXMntq.js → CopyButton-DRpVCGXL.js} +1 -1
- package/dist/{CopyButton-BfjJRwj9.cjs → CopyButton-rEPzSx4v.cjs} +1 -1
- package/dist/DataTable-D0JW9sxz.cjs +1 -0
- package/dist/DataTable-DwLWLUUt.js +500 -0
- package/dist/FileUploader-DAbs5fWp.cjs +1 -0
- package/dist/FileUploader-DBGNk6Qg.js +187 -0
- package/dist/{Modal-CtCD-xEb.cjs → Modal-Bcl003Rp.cjs} +1 -1
- package/dist/{Modal-CfcTmfeK.js → Modal-CWeCxkXh.js} +1 -1
- package/dist/{NotificationCenter-CGhxyax1.cjs → NotificationCenter-BceqDL0a.cjs} +1 -1
- package/dist/{NotificationCenter-xL9_6BMt.js → NotificationCenter-DNA6BL18.js} +1 -1
- package/dist/{Pagination-CSISbmpl.js → Pagination-DJ8ZuHST.js} +1 -1
- package/dist/{Pagination-Ci1te4UW.cjs → Pagination-d-FYh-zd.cjs} +1 -1
- package/dist/{TableOfContents-BqF5y-1t.js → TableOfContents-1OY_mlI4.js} +1 -1
- package/dist/{TableOfContents-C6xx7P4d.cjs → TableOfContents-BZCrLDe1.cjs} +1 -1
- package/dist/{Video-CY0UEDLL.js → Video-BbraQauu.js} +1 -1
- package/dist/{Video-Bgzvf-C9.cjs → Video-DDytsRcF.cjs} +1 -1
- package/dist/{Walkthrough-KmxZqXxV.js → Walkthrough-BYCQMYqG.js} +1 -1
- package/dist/{Walkthrough-oU-NaG_A.cjs → Walkthrough-ZuHZx69C.cjs} +1 -1
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +17 -17
- package/dist/components/ActionGroup.cjs +1 -1
- package/dist/components/ActionGroup.mjs +1 -1
- package/dist/components/AiProvider.cjs +1 -1
- package/dist/components/AiProvider.mjs +1 -1
- package/dist/components/BackToTop.cjs +1 -1
- package/dist/components/BackToTop.mjs +1 -1
- package/dist/components/BlueprintControls.cjs +1 -1
- package/dist/components/BlueprintControls.mjs +1 -1
- package/dist/components/Board.cjs +1 -1
- package/dist/components/Board.mjs +1 -1
- package/dist/components/BriefingDestination.cjs +1 -1
- package/dist/components/BriefingDestination.mjs +1 -1
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.mjs +1 -1
- package/dist/components/Button.vue.d.ts.map +1 -1
- package/dist/components/Confirm.cjs +1 -1
- package/dist/components/Confirm.mjs +1 -1
- package/dist/components/CopyButton.cjs +1 -1
- package/dist/components/CopyButton.mjs +1 -1
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.d.ts +17 -1
- package/dist/components/DataTable.mjs +1 -1
- package/dist/components/DataTable.vue.d.ts +7 -1
- package/dist/components/DataTable.vue.d.ts.map +1 -1
- package/dist/components/FileUploader.cjs +1 -1
- package/dist/components/FileUploader.mjs +1 -1
- package/dist/components/FileUploader.vue.d.ts +1 -0
- package/dist/components/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/Modal.cjs +1 -1
- package/dist/components/Modal.mjs +1 -1
- package/dist/components/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter.mjs +1 -1
- package/dist/components/Pagination.cjs +1 -1
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/TableOfContents.cjs +1 -1
- package/dist/components/TableOfContents.mjs +1 -1
- package/dist/components/Video.cjs +1 -1
- package/dist/components/Video.mjs +1 -1
- package/dist/components/Walkthrough.cjs +1 -1
- package/dist/components/Walkthrough.mjs +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 +17 -17
- package/dist/styles/Button.css +1 -1
- package/dist/styles/DataTable.css +1 -1
- package/dist/styles/FileUploader.css +1 -1
- package/dist/ui.css +3 -3
- package/package.json +1 -1
- package/dist/DataTable-COfiHgll.js +0 -412
- package/dist/DataTable-XSEybeeP.cjs +0 -1
- package/dist/FileUploader-BjYXOXxj.cjs +0 -1
- package/dist/FileUploader-DwKKUn71.js +0 -162
|
@@ -0,0 +1,500 @@
|
|
|
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-Cq9dEeHz.js";
|
|
7
|
+
import { t as o } from "./Grid-XtnH-vr_.js";
|
|
8
|
+
import { t as s } from "./Checkbox-B3gBM6xy.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 C, useSlots as ae, watch as w, withCtx as oe, withModifiers as T } from "vue";
|
|
10
|
+
import * as se from "@nubisco/ui/icons/arrow-up";
|
|
11
|
+
import * as ce from "@nubisco/ui/icons/caret-right";
|
|
12
|
+
import * as le from "@nubisco/ui/icons/arrows-down-up";
|
|
13
|
+
import * as ue from "@nubisco/ui/icons/arrow-down";
|
|
14
|
+
//#region src/components/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
+
var de = ["inert", "aria-hidden"], fe = { key: 0 }, pe = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "nb-data-table__title"
|
|
18
|
+
}, me = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "nb-data-table__description"
|
|
21
|
+
}, he = ["inert", "aria-hidden"], ge = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "nb-data-table__batch",
|
|
24
|
+
role: "region",
|
|
25
|
+
"aria-label": "Table batch actions"
|
|
26
|
+
}, _e = { class: "nb-data-table__batch-count" }, ve = { class: "nb-data-table__batch-actions" }, ye = { class: "nb-data-table__scroll" }, be = [
|
|
27
|
+
"role",
|
|
28
|
+
"aria-label",
|
|
29
|
+
"aria-busy"
|
|
30
|
+
], xe = {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: "nb-data-table__col-expand"
|
|
33
|
+
}, Se = {
|
|
34
|
+
key: 1,
|
|
35
|
+
class: "nb-data-table__col-select"
|
|
36
|
+
}, Ce = {
|
|
37
|
+
key: 2,
|
|
38
|
+
class: "nb-data-table__col-actions"
|
|
39
|
+
}, we = ["role"], Te = ["role"], Ee = {
|
|
40
|
+
key: 0,
|
|
41
|
+
scope: "col",
|
|
42
|
+
class: "nb-data-table__th nb-data-table__expand-cell"
|
|
43
|
+
}, De = {
|
|
44
|
+
key: 1,
|
|
45
|
+
scope: "col",
|
|
46
|
+
class: "nb-data-table__th nb-data-table__select-cell"
|
|
47
|
+
}, Oe = ["aria-sort"], ke = ["onClick"], Ae = { class: "nb-data-table__th-label" }, je = {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: "nb-data-table__th-label"
|
|
50
|
+
}, Me = {
|
|
51
|
+
key: 2,
|
|
52
|
+
scope: "col",
|
|
53
|
+
class: "nb-data-table__th nb-data-table__actions-cell"
|
|
54
|
+
}, Ne = ["role"], Pe = {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "nb-data-table__td"
|
|
57
|
+
}, Fe = {
|
|
58
|
+
key: 1,
|
|
59
|
+
class: "nb-data-table__td"
|
|
60
|
+
}, Ie = {
|
|
61
|
+
key: 2,
|
|
62
|
+
class: "nb-data-table__td"
|
|
63
|
+
}, Le = {
|
|
64
|
+
key: 1,
|
|
65
|
+
class: "nb-data-table__state-row"
|
|
66
|
+
}, Re = ["colspan"], ze = {
|
|
67
|
+
key: 2,
|
|
68
|
+
class: "nb-data-table__state-row"
|
|
69
|
+
}, Be = ["colspan"], Ve = [
|
|
70
|
+
"role",
|
|
71
|
+
"aria-selected",
|
|
72
|
+
"tabindex",
|
|
73
|
+
"onClick",
|
|
74
|
+
"onKeydown",
|
|
75
|
+
"onKeyup"
|
|
76
|
+
], He = ["role"], Ue = [
|
|
77
|
+
"aria-expanded",
|
|
78
|
+
"aria-controls",
|
|
79
|
+
"aria-label",
|
|
80
|
+
"onClick"
|
|
81
|
+
], We = [
|
|
82
|
+
"checked",
|
|
83
|
+
"aria-label",
|
|
84
|
+
"onChange"
|
|
85
|
+
], Ge = ["role", "data-label"], Ke = ["role"], qe = ["colspan", "role"], Je = ["id", "aria-label"], Ye = {
|
|
86
|
+
key: 1,
|
|
87
|
+
class: "nb-data-table__footer"
|
|
88
|
+
}, E = /* @__PURE__ */ e(/* @__PURE__ */ g({
|
|
89
|
+
__name: "DataTable",
|
|
90
|
+
props: {
|
|
91
|
+
columns: {},
|
|
92
|
+
rows: {},
|
|
93
|
+
rowKey: {},
|
|
94
|
+
size: { default: t.Medium },
|
|
95
|
+
sortState: { default: null },
|
|
96
|
+
selectable: { default: "none" },
|
|
97
|
+
selected: { default: () => [] },
|
|
98
|
+
loading: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: !1
|
|
101
|
+
},
|
|
102
|
+
skeletonRows: { default: 5 },
|
|
103
|
+
error: { default: void 0 },
|
|
104
|
+
emptyMessage: { default: void 0 },
|
|
105
|
+
stickyHeader: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: !0
|
|
108
|
+
},
|
|
109
|
+
zebra: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: !1
|
|
112
|
+
},
|
|
113
|
+
fill: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: !1
|
|
116
|
+
},
|
|
117
|
+
title: { default: void 0 },
|
|
118
|
+
description: { default: void 0 },
|
|
119
|
+
ariaLabel: { default: void 0 },
|
|
120
|
+
stackOnPhone: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: !1
|
|
123
|
+
},
|
|
124
|
+
expanded: { default: () => [] }
|
|
125
|
+
},
|
|
126
|
+
emits: [
|
|
127
|
+
"sort",
|
|
128
|
+
"update:selected",
|
|
129
|
+
"row-click",
|
|
130
|
+
"update:expanded"
|
|
131
|
+
],
|
|
132
|
+
setup(e, { emit: t }) {
|
|
133
|
+
let g = e, { layerProps: E } = r(), D = t, O = ae(), Xe = `nb-data-table-select-${C()}`, Ze = l(() => g.size), k = l(() => g.columns.filter((e) => !e.hidden)), A = l(() => g.selectable !== "none"), j = l(() => !!O["row-actions"]), M = l(() => !!O["row-detail"]), N = l(() => k.value.length + (M.value ? 1 : 0) + (A.value ? 1 : 0) + (j.value ? 1 : 0)), { phone: Qe } = i(), P = l(() => g.stackOnPhone && Qe.value), $e = l(() => (k.value.find((e) => e.primary) ?? k.value.find((e) => !e.phoneHidden && !e.phoneMeta))?.key);
|
|
134
|
+
function et(e) {
|
|
135
|
+
return e.phoneHidden ? "nb-data-table__td--phone-hidden" : e.key === $e.value ? "nb-data-table__td--primary" : e.phoneMeta ? "nb-data-table__td--meta" : "nb-data-table__td--field";
|
|
136
|
+
}
|
|
137
|
+
let tt = l(() => !g.loading && !g.error && g.rows.length > 0 && (g.selectable === "multiple" || k.value.some((e) => e.sortable && !e.phoneHidden)));
|
|
138
|
+
function nt(e) {
|
|
139
|
+
if (e.width != null) return { width: typeof e.width == "number" ? `${e.width}px` : e.width };
|
|
140
|
+
}
|
|
141
|
+
function F(e, t) {
|
|
142
|
+
return t[e.key];
|
|
143
|
+
}
|
|
144
|
+
function rt(e) {
|
|
145
|
+
return e == null ? "" : String(e);
|
|
146
|
+
}
|
|
147
|
+
let it = (e) => e.column.render?.(e.row, F(e.column, e.row), e.rowIndex) ?? null;
|
|
148
|
+
it.props = [
|
|
149
|
+
"column",
|
|
150
|
+
"row",
|
|
151
|
+
"rowIndex"
|
|
152
|
+
];
|
|
153
|
+
function I(e) {
|
|
154
|
+
let t = g.rowKey;
|
|
155
|
+
return typeof t == "function" ? t(e) : e[t];
|
|
156
|
+
}
|
|
157
|
+
let L = l(() => new Set(g.selected)), at = l(() => g.selected), R = l(() => g.selected.length);
|
|
158
|
+
function z(e) {
|
|
159
|
+
return L.value.has(I(e));
|
|
160
|
+
}
|
|
161
|
+
let B = l(() => g.rows.map((e) => I(e))), V = l(() => B.value.length > 0 && B.value.every((e) => L.value.has(e))), ot = l(() => !V.value && B.value.some((e) => L.value.has(e))), H = y(null), U = !1;
|
|
162
|
+
function st(e) {
|
|
163
|
+
U = e.shiftKey;
|
|
164
|
+
}
|
|
165
|
+
w(B, () => {
|
|
166
|
+
H.value = null;
|
|
167
|
+
});
|
|
168
|
+
function ct(e, t) {
|
|
169
|
+
let n = I(e), r = new Set(g.selected), i = !r.has(n), a = H.value, o = (e) => {
|
|
170
|
+
i ? r.add(e) : r.delete(e);
|
|
171
|
+
};
|
|
172
|
+
if (U && a !== null && a !== t) {
|
|
173
|
+
let e = Math.min(a, t), n = Math.max(a, t);
|
|
174
|
+
for (let t = e; t <= n; t++) {
|
|
175
|
+
let e = g.rows[t];
|
|
176
|
+
e && o(I(e));
|
|
177
|
+
}
|
|
178
|
+
} else o(n), H.value = t;
|
|
179
|
+
U = !1, D("update:selected", [...r]);
|
|
180
|
+
}
|
|
181
|
+
function lt(e) {
|
|
182
|
+
D("update:selected", [I(e)]);
|
|
183
|
+
}
|
|
184
|
+
function ut() {
|
|
185
|
+
let e = new Set(g.selected);
|
|
186
|
+
V.value ? B.value.forEach((t) => e.delete(t)) : B.value.forEach((t) => e.add(t)), D("update:selected", [...e]);
|
|
187
|
+
}
|
|
188
|
+
function dt() {
|
|
189
|
+
D("update:selected", []);
|
|
190
|
+
}
|
|
191
|
+
let ft = l(() => g.selectable !== "none" && !!O["batch-actions"]), W = l(() => ft.value && R.value > 0), pt = `nb-data-table-detail-${C()}`, mt = l(() => new Set(g.expanded));
|
|
192
|
+
function G(e) {
|
|
193
|
+
return M.value && mt.value.has(I(e));
|
|
194
|
+
}
|
|
195
|
+
function ht(e) {
|
|
196
|
+
let t = I(e), n = g.expanded.filter((e) => e !== t);
|
|
197
|
+
n.length === g.expanded.length && n.push(t), D("update:expanded", n);
|
|
198
|
+
}
|
|
199
|
+
function gt(e) {
|
|
200
|
+
return `${pt}-${e}`;
|
|
201
|
+
}
|
|
202
|
+
function _t(e, t) {
|
|
203
|
+
let n = k.value.find((e) => e.key === $e.value);
|
|
204
|
+
return `Details for ${(n ? rt(F(n, e)).trim() : "") || `row ${t + 1}`}`;
|
|
205
|
+
}
|
|
206
|
+
let vt = l(() => !!g.title || !!g.description || !!O.toolbar || !!O.search || !!O["toolbar-actions"]), yt = l(() => vt.value || ft.value), bt = y(null), K = y(null), q = y(null), J = y(!1);
|
|
207
|
+
function xt() {
|
|
208
|
+
let e = K.value, t = q.value;
|
|
209
|
+
J.value = !!e && !!t && t.offsetTop >= e.offsetTop + e.offsetHeight - 1;
|
|
210
|
+
}
|
|
211
|
+
let Y = null;
|
|
212
|
+
w([
|
|
213
|
+
bt,
|
|
214
|
+
K,
|
|
215
|
+
q
|
|
216
|
+
], (e) => {
|
|
217
|
+
if (Y?.disconnect(), xt(), !(typeof ResizeObserver > "u")) {
|
|
218
|
+
Y ??= new ResizeObserver(xt);
|
|
219
|
+
for (let t of e) t && Y.observe(t);
|
|
220
|
+
}
|
|
221
|
+
}, { flush: "post" }), re(() => {
|
|
222
|
+
Y?.disconnect(), Y = null;
|
|
223
|
+
});
|
|
224
|
+
function X(e) {
|
|
225
|
+
return !!g.sortState && g.sortState.key === e.key && g.sortState.direction !== "none";
|
|
226
|
+
}
|
|
227
|
+
function St(e) {
|
|
228
|
+
return X(e) ? g.sortState.direction === "asc" ? "ascending" : "descending" : "none";
|
|
229
|
+
}
|
|
230
|
+
function Ct(e) {
|
|
231
|
+
return X(e) ? g.sortState.direction === "asc" ? se : ue : le;
|
|
232
|
+
}
|
|
233
|
+
function wt(e) {
|
|
234
|
+
return e === "asc" ? "desc" : e === "desc" ? "none" : "asc";
|
|
235
|
+
}
|
|
236
|
+
function Tt(e) {
|
|
237
|
+
let t = g.sortState && g.sortState.key === e.key ? g.sortState.direction : "none";
|
|
238
|
+
D("sort", {
|
|
239
|
+
key: e.key,
|
|
240
|
+
direction: wt(t)
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
let Et = ee(), Z = l(() => !!Et?.vnode.props?.onRowClick);
|
|
244
|
+
function Q(e, t) {
|
|
245
|
+
D("row-click", e, t);
|
|
246
|
+
}
|
|
247
|
+
function $(e) {
|
|
248
|
+
return Z.value && e.target === e.currentTarget && !e.altKey && !e.ctrlKey && !e.metaKey;
|
|
249
|
+
}
|
|
250
|
+
function Dt(e, t, n) {
|
|
251
|
+
$(e) && (e.key === "Enter" ? (e.preventDefault(), e.repeat || Q(t, n)) : e.key === " " && e.preventDefault());
|
|
252
|
+
}
|
|
253
|
+
function Ot(e, t, n) {
|
|
254
|
+
!$(e) || e.key !== " " || (e.preventDefault(), Q(t, n));
|
|
255
|
+
}
|
|
256
|
+
return (t, r) => (v(), f("div", te({ class: [
|
|
257
|
+
"nb-data-table",
|
|
258
|
+
`nb-data-table--${e.size}`,
|
|
259
|
+
{ "nb-data-table--zebra": e.zebra },
|
|
260
|
+
{ "nb-data-table--sticky": e.stickyHeader },
|
|
261
|
+
{ "nb-data-table--fill": e.fill },
|
|
262
|
+
{ "nb-data-table--stacked": P.value },
|
|
263
|
+
{ "nb-data-table--stacked-headless": P.value && !tt.value },
|
|
264
|
+
{ "nb-data-table--expandable": M.value }
|
|
265
|
+
] }, ie(E)), [
|
|
266
|
+
yt.value ? (v(), f("div", {
|
|
267
|
+
key: 0,
|
|
268
|
+
ref_key: "toolbarRef",
|
|
269
|
+
ref: bt,
|
|
270
|
+
class: _(["nb-data-table__toolbar", { "nb-data-table__toolbar--wrapped": J.value }])
|
|
271
|
+
}, [
|
|
272
|
+
p("div", {
|
|
273
|
+
ref_key: "toolbarHeadingRef",
|
|
274
|
+
ref: K,
|
|
275
|
+
class: "nb-data-table__toolbar-heading",
|
|
276
|
+
inert: W.value || void 0,
|
|
277
|
+
"aria-hidden": W.value || void 0
|
|
278
|
+
}, [x(t.$slots, "toolbar", { selectedCount: R.value }, () => [e.title || e.description ? (v(), f("div", fe, [e.title ? (v(), f("h2", pe, S(e.title), 1)) : d("", !0), e.description ? (v(), f("p", me, S(e.description), 1)) : d("", !0)])) : d("", !0)], !0)], 8, de),
|
|
279
|
+
t.$slots.search || t.$slots["toolbar-actions"] ? (v(), f("div", {
|
|
280
|
+
key: 0,
|
|
281
|
+
ref_key: "toolbarToolsRef",
|
|
282
|
+
ref: q,
|
|
283
|
+
class: _(["nb-data-table__toolbar-tools", { "nb-data-table__toolbar-tools--grow-search": J.value && !!t.$slots.search }]),
|
|
284
|
+
inert: W.value || void 0,
|
|
285
|
+
"aria-hidden": W.value || void 0
|
|
286
|
+
}, [x(t.$slots, "search", {}, void 0, !0), x(t.$slots, "toolbar-actions", {}, void 0, !0)], 10, he)) : d("", !0),
|
|
287
|
+
W.value ? (v(), f("div", ge, [
|
|
288
|
+
p("span", _e, S(R.value) + " selected ", 1),
|
|
289
|
+
p("div", ve, [x(t.$slots, "batch-actions", {
|
|
290
|
+
selectedKeys: at.value,
|
|
291
|
+
clear: dt
|
|
292
|
+
}, void 0, !0)]),
|
|
293
|
+
h(a, {
|
|
294
|
+
class: "nb-data-table__batch-cancel",
|
|
295
|
+
variant: "ghost",
|
|
296
|
+
size: Ze.value,
|
|
297
|
+
onClick: dt
|
|
298
|
+
}, {
|
|
299
|
+
default: oe(() => [...r[3] ||= [m(" Cancel ", -1)]]),
|
|
300
|
+
_: 1
|
|
301
|
+
}, 8, ["size"])
|
|
302
|
+
])) : d("", !0)
|
|
303
|
+
], 2)) : d("", !0),
|
|
304
|
+
p("div", ye, [p("table", {
|
|
305
|
+
class: "nb-data-table__table",
|
|
306
|
+
role: P.value ? "table" : void 0,
|
|
307
|
+
"aria-label": e.ariaLabel || e.title || void 0,
|
|
308
|
+
"aria-busy": e.loading || void 0
|
|
309
|
+
}, [
|
|
310
|
+
p("colgroup", null, [
|
|
311
|
+
M.value ? (v(), f("col", xe)) : d("", !0),
|
|
312
|
+
A.value ? (v(), f("col", Se)) : d("", !0),
|
|
313
|
+
(v(!0), f(c, null, b(k.value, (e) => (v(), f("col", {
|
|
314
|
+
key: `col-${e.key}`,
|
|
315
|
+
style: ne(nt(e))
|
|
316
|
+
}, null, 4))), 128)),
|
|
317
|
+
j.value ? (v(), f("col", Ce)) : d("", !0)
|
|
318
|
+
]),
|
|
319
|
+
p("thead", {
|
|
320
|
+
class: "nb-data-table__head",
|
|
321
|
+
role: P.value ? "rowgroup" : void 0
|
|
322
|
+
}, [p("tr", { role: P.value ? "row" : void 0 }, [
|
|
323
|
+
M.value ? (v(), f("th", Ee, [...r[4] ||= [p("span", { class: "nb-sr-only" }, "Row details", -1)]])) : d("", !0),
|
|
324
|
+
A.value ? (v(), f("th", De, [e.selectable === "multiple" ? (v(), u(s, {
|
|
325
|
+
key: 0,
|
|
326
|
+
"model-value": V.value,
|
|
327
|
+
indeterminate: ot.value,
|
|
328
|
+
"aria-label": "Select all rows",
|
|
329
|
+
"onUpdate:modelValue": ut
|
|
330
|
+
}, null, 8, ["model-value", "indeterminate"])) : d("", !0)])) : d("", !0),
|
|
331
|
+
(v(!0), f(c, null, b(k.value, (e) => (v(), f("th", {
|
|
332
|
+
key: `th-${e.key}`,
|
|
333
|
+
scope: "col",
|
|
334
|
+
class: _([
|
|
335
|
+
"nb-data-table__th",
|
|
336
|
+
`nb-data-table__th--${e.align || "left"}`,
|
|
337
|
+
{ "nb-data-table__th--sortable": e.sortable },
|
|
338
|
+
{ "nb-data-table__th--sorted": X(e) },
|
|
339
|
+
P.value && e.phoneHidden && "nb-data-table__th--phone-hidden"
|
|
340
|
+
]),
|
|
341
|
+
"aria-sort": e.sortable ? St(e) : void 0
|
|
342
|
+
}, [e.sortable ? (v(), f("button", {
|
|
343
|
+
key: 0,
|
|
344
|
+
type: "button",
|
|
345
|
+
class: "nb-data-table__sort",
|
|
346
|
+
onClick: (t) => Tt(e)
|
|
347
|
+
}, [p("span", Ae, [x(t.$slots, `header-${e.key}`, { column: e }, () => [m(S(e.header), 1)], !0)]), h(n, {
|
|
348
|
+
name: Ct(e),
|
|
349
|
+
class: "nb-data-table__sort-icon",
|
|
350
|
+
"aria-hidden": "true"
|
|
351
|
+
}, null, 8, ["name"])], 8, ke)) : (v(), f("span", je, [x(t.$slots, `header-${e.key}`, { column: e }, () => [m(S(e.header), 1)], !0)]))], 10, Oe))), 128)),
|
|
352
|
+
j.value ? (v(), f("th", Me, [...r[5] ||= [p("span", { class: "nb-sr-only" }, "Row actions", -1)]])) : d("", !0)
|
|
353
|
+
], 8, Te)], 8, we),
|
|
354
|
+
p("tbody", {
|
|
355
|
+
class: "nb-data-table__body",
|
|
356
|
+
role: P.value ? "rowgroup" : void 0
|
|
357
|
+
}, [e.loading ? (v(!0), f(c, { key: 0 }, b(e.skeletonRows, (e) => (v(), f("tr", {
|
|
358
|
+
key: `skeleton-${e}`,
|
|
359
|
+
class: "nb-data-table__row nb-data-table__row--skeleton"
|
|
360
|
+
}, [
|
|
361
|
+
M.value ? (v(), f("td", Pe)) : d("", !0),
|
|
362
|
+
A.value ? (v(), f("td", Fe, [...r[6] ||= [p("span", { class: "nb-data-table__skeleton nb-data-table__skeleton--box" }, null, -1)]])) : d("", !0),
|
|
363
|
+
(v(!0), f(c, null, b(k.value, (t) => (v(), f("td", {
|
|
364
|
+
key: `sk-${e}-${t.key}`,
|
|
365
|
+
class: "nb-data-table__td"
|
|
366
|
+
}, [...r[7] ||= [p("span", { class: "nb-data-table__skeleton" }, null, -1)]]))), 128)),
|
|
367
|
+
j.value ? (v(), f("td", Ie, [...r[8] ||= [p("span", { class: "nb-data-table__skeleton nb-data-table__skeleton--box" }, null, -1)]])) : d("", !0)
|
|
368
|
+
]))), 128)) : e.error ? (v(), f("tr", Le, [p("td", {
|
|
369
|
+
colspan: N.value,
|
|
370
|
+
class: "nb-data-table__state nb-data-table__state--error"
|
|
371
|
+
}, [x(t.$slots, "error", { error: e.error }, () => [h(o, {
|
|
372
|
+
is: "span",
|
|
373
|
+
align: "center",
|
|
374
|
+
justify: "center",
|
|
375
|
+
gap: "xs",
|
|
376
|
+
class: "nb-data-table__state-inner"
|
|
377
|
+
}, {
|
|
378
|
+
default: oe(() => [h(n, {
|
|
379
|
+
name: "warning-circle-fill",
|
|
380
|
+
"aria-hidden": "true"
|
|
381
|
+
}), p("span", null, S(e.error), 1)]),
|
|
382
|
+
_: 1
|
|
383
|
+
})], !0)], 8, Re)])) : e.rows.length ? (v(!0), f(c, { key: 3 }, b(e.rows, (i, a) => (v(), f(c, { key: I(i) }, [p("tr", {
|
|
384
|
+
class: _([
|
|
385
|
+
"nb-data-table__row",
|
|
386
|
+
{ "nb-data-table__row--selected": z(i) },
|
|
387
|
+
{ "nb-data-table__row--clickable": Z.value },
|
|
388
|
+
M.value && {
|
|
389
|
+
"nb-data-table__row--expanded": G(i),
|
|
390
|
+
"nb-data-table__row--even": a % 2 == 1
|
|
391
|
+
}
|
|
392
|
+
]),
|
|
393
|
+
role: P.value ? "row" : void 0,
|
|
394
|
+
"aria-selected": e.selectable === "none" ? void 0 : z(i),
|
|
395
|
+
tabindex: Z.value ? 0 : void 0,
|
|
396
|
+
onClick: (e) => Q(i, a),
|
|
397
|
+
onKeydown: (e) => Dt(e, i, a),
|
|
398
|
+
onKeyup: (e) => Ot(e, i, a)
|
|
399
|
+
}, [
|
|
400
|
+
M.value ? (v(), f("td", {
|
|
401
|
+
key: 0,
|
|
402
|
+
class: "nb-data-table__td nb-data-table__expand-cell",
|
|
403
|
+
role: P.value ? "cell" : void 0,
|
|
404
|
+
onClick: r[0] ||= T(() => {}, ["stop"])
|
|
405
|
+
}, [p("button", {
|
|
406
|
+
type: "button",
|
|
407
|
+
class: "nb-data-table__expand",
|
|
408
|
+
"aria-expanded": G(i),
|
|
409
|
+
"aria-controls": G(i) ? gt(a) : void 0,
|
|
410
|
+
"aria-label": _t(i, a),
|
|
411
|
+
onClick: (e) => ht(i)
|
|
412
|
+
}, [h(n, {
|
|
413
|
+
name: ce,
|
|
414
|
+
class: "nb-data-table__expand-icon",
|
|
415
|
+
"aria-hidden": "true"
|
|
416
|
+
})], 8, Ue)], 8, He)) : d("", !0),
|
|
417
|
+
A.value ? (v(), f("td", {
|
|
418
|
+
key: 1,
|
|
419
|
+
class: "nb-data-table__td nb-data-table__select-cell",
|
|
420
|
+
onClick: r[1] ||= T(() => {}, ["stop"]),
|
|
421
|
+
onMousedown: st,
|
|
422
|
+
onKeydown: st
|
|
423
|
+
}, [e.selectable === "multiple" ? (v(), u(s, {
|
|
424
|
+
key: 0,
|
|
425
|
+
"model-value": z(i),
|
|
426
|
+
"aria-label": `Select row ${a + 1}`,
|
|
427
|
+
"onUpdate:modelValue": (e) => ct(i, a)
|
|
428
|
+
}, null, 8, [
|
|
429
|
+
"model-value",
|
|
430
|
+
"aria-label",
|
|
431
|
+
"onUpdate:modelValue"
|
|
432
|
+
])) : (v(), f("input", {
|
|
433
|
+
key: 1,
|
|
434
|
+
type: "radio",
|
|
435
|
+
class: "nb-data-table__radio",
|
|
436
|
+
name: Xe,
|
|
437
|
+
checked: z(i),
|
|
438
|
+
"aria-label": `Select row ${a + 1}`,
|
|
439
|
+
onChange: (e) => lt(i)
|
|
440
|
+
}, null, 40, We))], 32)) : d("", !0),
|
|
441
|
+
(v(!0), f(c, null, b(k.value, (n) => (v(), f("td", {
|
|
442
|
+
key: `td-${I(i)}-${n.key}`,
|
|
443
|
+
class: _([
|
|
444
|
+
"nb-data-table__td",
|
|
445
|
+
`nb-data-table__td--${n.align || "left"}`,
|
|
446
|
+
n.cellClass,
|
|
447
|
+
P.value && et(n)
|
|
448
|
+
]),
|
|
449
|
+
role: P.value ? "cell" : void 0,
|
|
450
|
+
"data-label": e.stackOnPhone ? n.header : void 0
|
|
451
|
+
}, [x(t.$slots, `cell-${n.key}`, {
|
|
452
|
+
row: i,
|
|
453
|
+
value: F(n, i),
|
|
454
|
+
column: n,
|
|
455
|
+
rowIndex: a
|
|
456
|
+
}, () => [n.render ? (v(), u(it, {
|
|
457
|
+
key: 0,
|
|
458
|
+
column: n,
|
|
459
|
+
row: i,
|
|
460
|
+
"row-index": a
|
|
461
|
+
}, null, 8, [
|
|
462
|
+
"column",
|
|
463
|
+
"row",
|
|
464
|
+
"row-index"
|
|
465
|
+
])) : (v(), f(c, { key: 1 }, [m(S(rt(F(n, i))), 1)], 64))], !0)], 10, Ge))), 128)),
|
|
466
|
+
j.value ? (v(), f("td", {
|
|
467
|
+
key: 2,
|
|
468
|
+
class: "nb-data-table__td nb-data-table__actions-cell",
|
|
469
|
+
onClick: r[2] ||= T(() => {}, ["stop"])
|
|
470
|
+
}, [x(t.$slots, "row-actions", {
|
|
471
|
+
row: i,
|
|
472
|
+
rowIndex: a
|
|
473
|
+
}, void 0, !0)])) : d("", !0)
|
|
474
|
+
], 42, Ve), G(i) ? (v(), f("tr", {
|
|
475
|
+
key: 0,
|
|
476
|
+
class: "nb-data-table__detail-row",
|
|
477
|
+
role: P.value ? "row" : void 0
|
|
478
|
+
}, [p("td", {
|
|
479
|
+
colspan: N.value,
|
|
480
|
+
class: "nb-data-table__detail-cell",
|
|
481
|
+
role: P.value ? "cell" : void 0
|
|
482
|
+
}, [p("div", {
|
|
483
|
+
id: gt(a),
|
|
484
|
+
class: "nb-data-table__detail",
|
|
485
|
+
role: "region",
|
|
486
|
+
"aria-label": _t(i, a)
|
|
487
|
+
}, [x(t.$slots, "row-detail", {
|
|
488
|
+
row: i,
|
|
489
|
+
rowIndex: a
|
|
490
|
+
}, void 0, !0)], 8, Je)], 8, qe)], 8, Ke)) : d("", !0)], 64))), 128)) : (v(), f("tr", ze, [p("td", {
|
|
491
|
+
colspan: N.value,
|
|
492
|
+
class: "nb-data-table__state nb-data-table__state--empty"
|
|
493
|
+
}, [x(t.$slots, "empty", {}, () => [p("span", null, S(e.emptyMessage || "No data to display"), 1)], !0)], 8, Be)]))], 8, Ne)
|
|
494
|
+
], 8, be)]),
|
|
495
|
+
t.$slots.footer ? (v(), f("div", Ye, [x(t.$slots, "footer", {}, void 0, !0)])) : d("", !0)
|
|
496
|
+
], 16));
|
|
497
|
+
}
|
|
498
|
+
}), [["__scopeId", "data-v-129b9c3a"]]);
|
|
499
|
+
//#endregion
|
|
500
|
+
export { E as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-D-qHiVGv.cjs`);const e=require(`./_plugin-vue_export-helper-tagjRzOz.cjs`),t=require(`./Icon-C8R_r_In.cjs`),n=require(`./composables/useSurfaceLayer.composable.cjs`),r=require(`./Button-CbQyG-jg.cjs`);let i=require(`vue`),a=require(`@nubisco/ui/icons/x`),o=require(`@nubisco/ui/icons/circle-notch`);var s=function(e){return e.Primary=`primary`,e.Secondary=`secondary`,e.Ghost=`ghost`,e.Danger=`danger`,e.Success=`success`,e.Warning=`warning`,e}(s||{}),c=function(e){return e.Idle=`idle`,e.Loading=`loading`,e.Success=`success`,e}(c||{}),l={key:0,class:`nb-file-uploader__heading`},u={key:1,class:`nb-file-uploader__description`},d=[`accept`,`multiple`,`disabled`],f={key:4,class:`nb-file-uploader__list`},p={class:`nb-file-uploader__name`},m={class:`nb-file-uploader__status`},h=[`aria-label`,`disabled`,`onClick`],g={key:0,class:`nb-file-uploader__error`},_=(0,i.defineComponent)({__name:`FileUploader`,props:{heading:{},description:{},buttonLabel:{default:`Add file`},variant:{default:s.Primary},accept:{},multiple:{type:Boolean,default:!1},maxSize:{},disabled:{type:Boolean,default:!1},id:{}},emits:[`change`,`remove`],setup(e,{expose:s,emit:_}){let v=e,{layerProps:y}=n.useSurfaceLayer(),b=_,x=(0,i.ref)(null),S=(0,i.ref)([]),C=(0,i.ref)(!1),w=0;(0,i.watch)(()=>v.disabled,e=>{e&&(w=0,C.value=!1)});function T(){v.disabled||x.value?.click()}function E(e){if(v.maxSize&&e.size>v.maxSize)return`File exceeds size limit.`;if(v.accept){let t=v.accept.split(`,`).map(e=>e.trim().toLowerCase()),n=e.name.toLowerCase();if(!t.some(t=>t.startsWith(`.`)?n.endsWith(t):t.includes(`/`)?e.type===t||e.type.startsWith(t.replaceAll(`*`,``)):!1))return`File type not accepted.`}}function D(e){let t=Array.from(e);v.multiple||(S.value=[]);for(let e of t){let t=E(e);S.value.push({file:e,status:c.Idle,error:t})}b(`change`,S.value.filter(e=>!e.error).map(e=>e.file))}function O(e){let t=e.target;if(v.disabled){t.value=``;return}t.files?.length&&(D(t.files),t.value=``)}function k(){v.disabled||(w++,C.value=!0)}function A(){w--,w<=0&&(w=0,C.value=!1)}function j(e){v.disabled&&e.dataTransfer&&(e.dataTransfer.dropEffect=`none`)}function M(e){if(w=0,C.value=!1,v.disabled)return;let t=e.dataTransfer?.files;t?.length&&D(t)}function N(e){if(v.disabled)return;let t=S.value[e];S.value.splice(e,1),b(`remove`,t.file),b(`change`,S.value.filter(e=>!e.error).map(e=>e.file))}function P(e,t,n){S.value[e]&&(S.value[e].status=t,S.value[e].error=n)}return s({files:S,setFileStatus:P}),(n,s)=>((0,i.openBlock)(),(0,i.createElementBlock)(`div`,(0,i.mergeProps)({class:[`nb-file-uploader`,{"nb-file-uploader--disabled":e.disabled}]},(0,i.unref)(y),{onDragenter:(0,i.withModifiers)(k,[`prevent`]),onDragover:(0,i.withModifiers)(j,[`prevent`]),onDragleave:(0,i.withModifiers)(A,[`prevent`]),onDrop:(0,i.withModifiers)(M,[`prevent`])}),[e.heading?((0,i.openBlock)(),(0,i.createElementBlock)(`p`,l,(0,i.toDisplayString)(e.heading),1)):(0,i.createCommentVNode)(``,!0),e.description?((0,i.openBlock)(),(0,i.createElementBlock)(`p`,u,(0,i.toDisplayString)(e.description),1)):(0,i.createCommentVNode)(``,!0),C.value?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:2,class:(0,i.normalizeClass)([`nb-file-uploader__dropzone`,`nb-file-uploader__dropzone--${e.variant}`])},[...s[0]||=[(0,i.createElementVNode)(`span`,{class:`nb-file-uploader__drop-label`},[(0,i.createTextVNode)(` Drag and drop files here`),(0,i.createElementVNode)(`br`),(0,i.createTextVNode)(`or click to upload `)],-1)]],2)):((0,i.openBlock)(),(0,i.createBlock)(r.t,{key:3,class:`nb-file-uploader__btn`,variant:e.variant,disabled:e.disabled,onClick:(0,i.withModifiers)(T,[`stop`])},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(e.buttonLabel),1)]),_:1},8,[`variant`,`disabled`])),(0,i.createElementVNode)(`input`,{ref_key:`inputRef`,ref:x,type:`file`,class:`nb-file-uploader__input`,accept:e.accept,multiple:e.multiple,disabled:e.disabled,onChange:O},null,40,d),S.value.length?((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,f,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(S.value,(n,r)=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{key:r,class:(0,i.normalizeClass)([`nb-file-uploader__item`,{"nb-file-uploader__item--error":n.error,"nb-file-uploader__item--success":n.status===`success`}])},[(0,i.createElementVNode)(`span`,p,(0,i.toDisplayString)(n.file.name),1),(0,i.createElementVNode)(`span`,m,[n.status===`loading`?((0,i.openBlock)(),(0,i.createBlock)(t.t,{key:0,name:(0,i.unref)(o.regular),class:`nb-file-uploader__spinner`},null,8,[`name`])):n.status===`success`?((0,i.openBlock)(),(0,i.createBlock)(t.t,{key:1,name:`check-circle-fill`,class:`nb-file-uploader__check`})):(0,i.createCommentVNode)(``,!0),n.error?((0,i.openBlock)(),(0,i.createBlock)(t.t,{key:2,name:`warning-circle-fill`,class:`nb-file-uploader__warn`})):(0,i.createCommentVNode)(``,!0),n.status===`loading`?(0,i.createCommentVNode)(``,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`button`,{key:3,class:`nb-file-uploader__remove`,type:`button`,"aria-label":`Remove ${n.file.name}`,disabled:e.disabled,onClick:e=>N(r)},[(0,i.createVNode)(t.t,{name:(0,i.unref)(a.regular)},null,8,[`name`])],8,h))]),n.error?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,g,(0,i.toDisplayString)(n.error),1)):(0,i.createCommentVNode)(``,!0)],2))),128))])):(0,i.createCommentVNode)(``,!0)],16))}}),v=e.t(_,[[`__scopeId`,`data-v-9bd5f6ba`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|