@soft-stech/bootsman-ui-shadcn 1.3.6 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{BuiAutoForm.vue_vue_type_script_setup_true_lang-BWWNpH1I.js → BuiAutoForm.vue_vue_type_script_setup_true_lang-DyG1WRf2.js} +23 -23
- package/dist/BuiAutoFormField.vue_vue_type_script_setup_true_lang-D0xFhEmy.js +284 -0
- package/dist/BuiAutoFormFieldObject.vue_vue_type_script_setup_true_lang-C7URAPKt.js +96 -0
- package/dist/{BuiDataTable.vue_vue_type_script_setup_true_lang-CUH3nl15.js → BuiDataTable.vue_vue_type_script_setup_true_lang-Bzw8CawP.js} +74 -68
- package/dist/assets/main.css +1 -1
- package/dist/components/ui/auto-form/BuiAutoForm.js +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormField.js +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldArray.js +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldObject.js +1 -1
- package/dist/components/ui/auto-form/BuiAutoFormFieldObjectCard.js +4 -0
- package/dist/components/ui/auto-form/constant.js +5 -3
- package/dist/components/ui/auto-form/index.js +18 -17
- package/dist/components/ui/table/BuiDataTable.js +1 -1
- package/dist/components/ui/table/BuiDataTable.vue.d.ts +3 -0
- package/dist/components/ui/table/index.js +1 -1
- package/dist/index.js +70 -69
- package/package.json +1 -1
- package/src/components/stories/BuiAutoForm.story.vue +10 -0
- package/src/components/stories/BuiDataTable.story.vue +38 -4
- package/src/components/ui/auto-form/BuiAutoForm.vue +1 -1
- package/src/components/ui/auto-form/BuiAutoFormFieldObjectCard.vue +73 -0
- package/src/components/ui/auto-form/constant.ts +2 -1
- package/src/components/ui/table/BuiDataTable.vue +7 -1
- package/dist/BuiAutoFormField.vue_vue_type_script_setup_true_lang-xmzLQDzl.js +0 -294
@@ -1,23 +1,23 @@
|
|
1
|
-
import { defineComponent as L, mergeModels as U, useModel as
|
1
|
+
import { defineComponent as L, mergeModels as U, useModel as y, computed as b, watchEffect as F, openBlock as n, createElementBlock as i, Fragment as g, renderSlot as S, unref as o, createCommentVNode as w, createVNode as d, withCtx as l, renderList as f, createBlock as m, createElementVNode as N, createTextVNode as v, toDisplayString as C } from "vue";
|
2
2
|
import { _ as O } from "./BuiCollapsible.vue_vue_type_script_setup_true_lang-BfgRYJts.js";
|
3
3
|
import { _ as T } from "./BuiCollapsibleTrigger.vue_vue_type_script_setup_true_lang-DJ8YMCCp.js";
|
4
4
|
import { _ as j } from "./BuiCollapsibleContent.vue_vue_type_script_setup_true_lang-eieHE5yV.js";
|
5
5
|
import { _ as G } from "./BuiPaginationCommon.vue_vue_type_script_setup_true_lang-DjLAqoa-.js";
|
6
|
-
import { v as
|
7
|
-
import { _ as
|
6
|
+
import { v as $ } from "./utils-DPuEjrVV.js";
|
7
|
+
import { _ as z } from "./BuiTableRowSubrow.vue_vue_type_script_setup_true_lang-Ch5gemw2.js";
|
8
8
|
import { useVueTable as H, getCoreRowModel as K, getPaginationRowModel as Y, getSortedRowModel as q, FlexRender as A } from "@tanstack/vue-table";
|
9
9
|
import { _ as J } from "./BuiTable.vue_vue_type_script_setup_true_lang-CUPSwE5z.js";
|
10
10
|
import { _ as Q } from "./BuiTableBody.vue_vue_type_script_setup_true_lang-CWT4u-Ma.js";
|
11
|
-
import { _ as
|
11
|
+
import { _ as E } from "./BuiTableCell.vue_vue_type_script_setup_true_lang-BrTQJCiZ.js";
|
12
12
|
import { _ as W } from "./BuiTableHead.vue_vue_type_script_setup_true_lang-CCXONmtG.js";
|
13
13
|
import { _ as X } from "./BuiTableHeader.vue_vue_type_script_setup_true_lang-DZOqi3dp.js";
|
14
|
-
import { _ as
|
14
|
+
import { _ as R } from "./BuiTableRow.vue_vue_type_script_setup_true_lang-CpEilJsW.js";
|
15
15
|
import { _ as Z } from "./BuiTableEmpty.vue_vue_type_script_setup_true_lang-BJDYHpRG.js";
|
16
16
|
import { _ as ee } from "./BuiTableFooter.vue_vue_type_script_setup_true_lang-Cfxlxsbh.js";
|
17
17
|
const te = {
|
18
18
|
key: 0,
|
19
19
|
class: "w-full py-4"
|
20
|
-
}, oe = { class: "flex w-full items-center justify-between" }, ne = { class: "inline-block rounded-t bg-background px-4 py-3" },
|
20
|
+
}, oe = { class: "flex w-full items-center justify-between" }, ne = { class: "inline-block rounded-t bg-background px-4 py-3" }, x = "#UNDEFINED#", we = /* @__PURE__ */ L({
|
21
21
|
__name: "BuiDataTable",
|
22
22
|
props: /* @__PURE__ */ U({
|
23
23
|
columns: {},
|
@@ -43,7 +43,7 @@ const te = {
|
|
43
43
|
}),
|
44
44
|
emits: ["update:sorting", "update:pagination", "update:selection", "update:columnVisibility"],
|
45
45
|
setup(c) {
|
46
|
-
const t = c,
|
46
|
+
const t = c, P = y(c, "sorting"), p = y(c, "pagination"), k = y(c, "selection"), D = y(c, "columnVisibility"), I = b(
|
47
47
|
() => t.manualPagination ? t.totalItems : t.data.length
|
48
48
|
), u = H({
|
49
49
|
initialState: { pagination: { pageSize: t.pageSize } },
|
@@ -57,13 +57,13 @@ const te = {
|
|
57
57
|
getPaginationRowModel: Y(),
|
58
58
|
getSortedRowModel: q(),
|
59
59
|
onSortingChange: (e) => {
|
60
|
-
|
60
|
+
$(e, P);
|
61
61
|
},
|
62
62
|
onPaginationChange: (e) => {
|
63
|
-
|
63
|
+
$(e, p);
|
64
64
|
},
|
65
65
|
onRowSelectionChange: (e) => {
|
66
|
-
|
66
|
+
$(e, k);
|
67
67
|
},
|
68
68
|
autoResetPageIndex: !1,
|
69
69
|
manualPagination: t.manualPagination,
|
@@ -71,7 +71,7 @@ const te = {
|
|
71
71
|
manualSorting: t.manualSorting,
|
72
72
|
state: {
|
73
73
|
get sorting() {
|
74
|
-
return
|
74
|
+
return P.value;
|
75
75
|
},
|
76
76
|
get pagination() {
|
77
77
|
return p.value;
|
@@ -84,14 +84,14 @@ const te = {
|
|
84
84
|
}
|
85
85
|
},
|
86
86
|
getRowId: t.getRowId
|
87
|
-
}), B =
|
87
|
+
}), B = b({
|
88
88
|
get() {
|
89
89
|
return u.getState().pagination.pageSize;
|
90
90
|
},
|
91
91
|
set(e) {
|
92
92
|
p.value && (p.value.pageSize = e, u.setPageSize(e), u.setPageIndex(0));
|
93
93
|
}
|
94
|
-
}), _ =
|
94
|
+
}), _ = b({
|
95
95
|
get() {
|
96
96
|
return u.getState().pagination.pageIndex + 1;
|
97
97
|
},
|
@@ -103,33 +103,33 @@ const te = {
|
|
103
103
|
const e = u.getPageCount();
|
104
104
|
e && e < _.value && (_.value = e);
|
105
105
|
});
|
106
|
-
const M =
|
107
|
-
const
|
108
|
-
return e[
|
106
|
+
const M = b(() => t.groupBy ? u.getRowModel().rows.reduce((e, s) => {
|
107
|
+
const a = s.getValue(t.groupBy) ?? x;
|
108
|
+
return e[a] = e[a] || [], e[a].push(s), e;
|
109
109
|
}, /* @__PURE__ */ Object.create(null)) : null);
|
110
110
|
function h(e) {
|
111
111
|
return (t.groupBy && t.groupLabels ? t.groupLabels[t.groupBy] || [] : [])[e];
|
112
112
|
}
|
113
|
-
return (e,
|
114
|
-
e.$slots.caption ? (n(),
|
115
|
-
|
116
|
-
])) :
|
117
|
-
|
118
|
-
default:
|
119
|
-
|
120
|
-
default:
|
121
|
-
(n(!0),
|
113
|
+
return (e, s) => (n(), i(g, null, [
|
114
|
+
e.$slots.caption ? (n(), i("div", te, [
|
115
|
+
S(e.$slots, "caption", { table: o(u) })
|
116
|
+
])) : w("", !0),
|
117
|
+
d(o(J), null, {
|
118
|
+
default: l(() => [
|
119
|
+
d(o(X), null, {
|
120
|
+
default: l(() => [
|
121
|
+
(n(!0), i(g, null, f(o(u).getHeaderGroups(), (r) => (n(), m(o(R), {
|
122
122
|
key: r.id
|
123
123
|
}, {
|
124
|
-
default:
|
125
|
-
(n(!0),
|
126
|
-
key:
|
124
|
+
default: l(() => [
|
125
|
+
(n(!0), i(g, null, f(r.headers, (a) => (n(), m(o(W), {
|
126
|
+
key: a.id
|
127
127
|
}, {
|
128
|
-
default:
|
129
|
-
|
128
|
+
default: l(() => [
|
129
|
+
a.isPlaceholder ? w("", !0) : (n(), m(o(A), {
|
130
130
|
key: 0,
|
131
|
-
render:
|
132
|
-
props:
|
131
|
+
render: a.column.columnDef.header,
|
132
|
+
props: a.getContext()
|
133
133
|
}, null, 8, ["render", "props"]))
|
134
134
|
]),
|
135
135
|
_: 2
|
@@ -140,36 +140,42 @@ const te = {
|
|
140
140
|
]),
|
141
141
|
_: 1
|
142
142
|
}),
|
143
|
-
|
144
|
-
default:
|
145
|
-
o(u).getRowModel().rows?.length ? (n(),
|
146
|
-
t.groupBy && M.value ? (n(!0),
|
143
|
+
d(o(Q), null, {
|
144
|
+
default: l(() => [
|
145
|
+
o(u).getRowModel().rows?.length ? (n(), i(g, { key: 0 }, [
|
146
|
+
t.groupBy && M.value ? (n(!0), i(g, { key: 0 }, f(M.value, (r, a) => (n(), m(o(O), {
|
147
147
|
asChild: "",
|
148
|
-
key:
|
148
|
+
key: a,
|
149
149
|
open: !0
|
150
150
|
}, {
|
151
|
-
default:
|
152
|
-
|
153
|
-
default:
|
154
|
-
|
155
|
-
default:
|
156
|
-
|
151
|
+
default: l(() => [
|
152
|
+
d(o(T), { asChild: "" }, {
|
153
|
+
default: l(() => [
|
154
|
+
d(o(R), { class: "bg-foreground/[0.04]" }, {
|
155
|
+
default: l(() => [
|
156
|
+
d(o(E), {
|
157
157
|
colspan: e.columns.length,
|
158
158
|
class: "!pb-0"
|
159
159
|
}, {
|
160
|
-
default:
|
161
|
-
|
162
|
-
|
163
|
-
|
160
|
+
default: l(() => [
|
161
|
+
N("div", oe, [
|
162
|
+
N("div", ne, [
|
163
|
+
a === x ? (n(), i(g, { key: 0 }, [
|
164
164
|
v(C(h(1)), 1)
|
165
|
-
], 64)) : (n(),
|
166
|
-
v(C(h(0)) + ": "
|
165
|
+
], 64)) : (n(), i(g, { key: 1 }, [
|
166
|
+
v(C(h(0)) + ": ", 1),
|
167
|
+
e.$slots.groupName ? S(e.$slots, "groupName", {
|
168
|
+
key: 0,
|
169
|
+
group: a
|
170
|
+
}) : (n(), i(g, { key: 1 }, [
|
171
|
+
v(C(a), 1)
|
172
|
+
], 64))
|
167
173
|
], 64))
|
168
174
|
]),
|
169
|
-
e.$slots.groupByRow ?
|
175
|
+
e.$slots.groupByRow ? S(e.$slots, "groupByRow", {
|
170
176
|
key: 0,
|
171
|
-
group:
|
172
|
-
}) :
|
177
|
+
group: a
|
178
|
+
}) : w("", !0)
|
173
179
|
])
|
174
180
|
]),
|
175
181
|
_: 2
|
@@ -180,9 +186,9 @@ const te = {
|
|
180
186
|
]),
|
181
187
|
_: 2
|
182
188
|
}, 1024),
|
183
|
-
|
184
|
-
default:
|
185
|
-
(n(!0),
|
189
|
+
d(o(j), { asChild: "" }, {
|
190
|
+
default: l(() => [
|
191
|
+
(n(!0), i(g, null, f(r, (V) => (n(), m(z, {
|
186
192
|
key: V.id,
|
187
193
|
columns: t.columns,
|
188
194
|
row: V,
|
@@ -193,7 +199,7 @@ const te = {
|
|
193
199
|
}, 1024)
|
194
200
|
]),
|
195
201
|
_: 2
|
196
|
-
}, 1024))), 128)) : (n(!0),
|
202
|
+
}, 1024))), 128)) : (n(!0), i(g, { key: 1 }, f(o(u).getRowModel().rows, (r) => (n(), m(z, {
|
197
203
|
key: r.id,
|
198
204
|
columns: t.columns,
|
199
205
|
row: r,
|
@@ -203,9 +209,9 @@ const te = {
|
|
203
209
|
key: 1,
|
204
210
|
colspan: e.columns.length
|
205
211
|
}, {
|
206
|
-
default:
|
207
|
-
|
208
|
-
|
212
|
+
default: l(() => [
|
213
|
+
S(e.$slots, "nodata", {}, () => [
|
214
|
+
s[2] || (s[2] = v("No data"))
|
209
215
|
])
|
210
216
|
]),
|
211
217
|
_: 3
|
@@ -214,20 +220,20 @@ const te = {
|
|
214
220
|
_: 3
|
215
221
|
}),
|
216
222
|
e.showPagination && I.value > 0 ? (n(), m(o(ee), { key: 0 }, {
|
217
|
-
default:
|
218
|
-
|
219
|
-
default:
|
220
|
-
|
223
|
+
default: l(() => [
|
224
|
+
d(o(R), null, {
|
225
|
+
default: l(() => [
|
226
|
+
d(o(E), {
|
221
227
|
colspan: e.columns.length
|
222
228
|
}, {
|
223
|
-
default:
|
224
|
-
|
229
|
+
default: l(() => [
|
230
|
+
d(o(G), {
|
225
231
|
class: "float-right",
|
226
232
|
total: I.value,
|
227
233
|
pageIndex: _.value,
|
228
|
-
"onUpdate:pageIndex":
|
234
|
+
"onUpdate:pageIndex": s[0] || (s[0] = (r) => _.value = r),
|
229
235
|
pageSize: B.value,
|
230
|
-
"onUpdate:pageSize":
|
236
|
+
"onUpdate:pageSize": s[1] || (s[1] = (r) => B.value = r)
|
231
237
|
}, null, 8, ["total", "pageIndex", "pageSize"])
|
232
238
|
]),
|
233
239
|
_: 1
|
@@ -237,7 +243,7 @@ const te = {
|
|
237
243
|
})
|
238
244
|
]),
|
239
245
|
_: 1
|
240
|
-
})) :
|
246
|
+
})) : w("", !0)
|
241
247
|
]),
|
242
248
|
_: 3
|
243
249
|
})
|