@indielayer/ui 1.14.5 → 1.15.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/docs/pages/component/avatar/usage.vue +1 -1
- package/docs/pages/component/input/usage.vue +22 -8
- package/docs/pages/component/table/selectable.vue +1 -1
- package/docs/pages/component/table/virtual.vue +2 -1
- package/docs/pages/component/tag/usage.vue +1 -1
- package/docs/pages/component/textarea/usage.vue +22 -8
- package/lib/components/avatar/Avatar.vue2.js +20 -19
- package/lib/components/avatar/theme/Avatar.base.theme.js +9 -12
- package/lib/components/datepicker/Datepicker.vue.js +1 -1
- package/lib/components/drawer/Drawer.vue.js +66 -60
- package/lib/components/input/Input.vue.d.ts +8 -0
- package/lib/components/input/Input.vue.js +84 -69
- package/lib/components/inputFooter/InputFooter.vue.d.ts +13 -2
- package/lib/components/inputFooter/InputFooter.vue.js +35 -19
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -1
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +3 -1
- package/lib/components/popover/Popover.vue.d.ts +1 -1
- package/lib/components/select/Select.vue.d.ts +38 -10
- package/lib/components/select/Select.vue.js +210 -200
- package/lib/components/table/Table.vue.d.ts +55 -19
- package/lib/components/table/Table.vue.js +256 -214
- package/lib/components/table/TableCell.vue.d.ts +9 -0
- package/lib/components/table/TableCell.vue.js +45 -21
- package/lib/components/table/TableHeader.vue.js +14 -14
- package/lib/components/table/theme/TableCell.base.theme.js +3 -3
- package/lib/components/tag/Tag.vue.d.ts +3 -0
- package/lib/components/tag/Tag.vue.js +37 -35
- package/lib/components/textarea/Textarea.vue.d.ts +19 -3
- package/lib/components/textarea/Textarea.vue.js +98 -76
- package/lib/components/textarea/theme/Textarea.base.theme.js +2 -1
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +2 -1
- package/lib/components/upload/Upload.vue.js +91 -86
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.vue +2 -2
- package/src/components/avatar/theme/Avatar.base.theme.ts +0 -5
- package/src/components/datepicker/Datepicker.vue +6 -1
- package/src/components/drawer/Drawer.vue +13 -2
- package/src/components/input/Input.vue +27 -2
- package/src/components/inputFooter/InputFooter.vue +35 -3
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +2 -0
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +2 -0
- package/src/components/select/Select.vue +21 -8
- package/src/components/table/Table.vue +170 -48
- package/src/components/table/TableCell.vue +23 -0
- package/src/components/table/TableHeader.vue +2 -2
- package/src/components/table/theme/TableCell.base.theme.ts +20 -11
- package/src/components/tag/Tag.vue +8 -3
- package/src/components/textarea/Textarea.vue +63 -30
- package/src/components/textarea/theme/Textarea.base.theme.ts +2 -0
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +2 -0
- package/src/components/upload/Upload.vue +12 -2
- package/src/version.ts +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { useVirtualList as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
import { defineComponent as re, mergeModels as X, useModel as se, ref as oe, computed as b, watch as ie, openBlock as s, createElementBlock as i, mergeProps as D, unref as c, renderSlot as p, createElementVNode as y, normalizeStyle as K, normalizeClass as m, createVNode as v, withCtx as f, createBlock as g, withModifiers as L, createCommentVNode as k, Fragment as S, renderList as C, createTextVNode as W, toDisplayString as q } from "vue";
|
|
2
|
+
import { useTheme as ue } from "../../composables/useTheme.js";
|
|
3
|
+
import { useVirtualList as de } from "../../composables/useVirtualList.js";
|
|
4
|
+
import ce from "./TableHead.vue.js";
|
|
5
|
+
import E from "./TableHeader.vue.js";
|
|
6
|
+
import fe from "./TableBody.js";
|
|
7
|
+
import G from "./TableRow.vue.js";
|
|
8
|
+
import A from "./TableCell.vue.js";
|
|
9
|
+
import pe from "../spinner/Spinner.vue.js";
|
|
10
|
+
import ve from "../skeleton/Skeleton.vue.js";
|
|
11
|
+
import ge from "../icon/Icon.vue.js";
|
|
12
12
|
import J from "../checkbox/Checkbox.vue.js";
|
|
13
|
-
import { chevronDownIcon as
|
|
14
|
-
const
|
|
13
|
+
import { chevronDownIcon as ye } from "../../common/icons.js";
|
|
14
|
+
const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se = ["onClick"], we = ["colspan"], $e = {
|
|
15
15
|
headers: {
|
|
16
16
|
type: Array,
|
|
17
17
|
default: () => []
|
|
@@ -61,31 +61,29 @@ const fe = { key: 1 }, ve = { colspan: "999" }, me = { key: 2 }, ye = { colspan:
|
|
|
61
61
|
autoClearSelected: {
|
|
62
62
|
type: Boolean,
|
|
63
63
|
default: !0
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
},
|
|
65
|
+
toFn: Function,
|
|
66
|
+
hrefFn: Function,
|
|
67
|
+
hrefTarget: String
|
|
68
|
+
}, Ce = { name: "XTable" }, Ve = /* @__PURE__ */ re({
|
|
69
|
+
...Ce,
|
|
70
|
+
props: /* @__PURE__ */ X({
|
|
71
|
+
...$e,
|
|
69
72
|
items: {
|
|
70
73
|
type: Array,
|
|
71
74
|
default: () => []
|
|
72
|
-
}
|
|
75
|
+
},
|
|
76
|
+
toFn: Function,
|
|
77
|
+
hrefFn: Function,
|
|
78
|
+
hrefTarget: String
|
|
73
79
|
}, {
|
|
74
80
|
selected: {},
|
|
75
81
|
selectedModifiers: {}
|
|
76
82
|
}),
|
|
77
|
-
emits: /* @__PURE__ */
|
|
78
|
-
setup(
|
|
79
|
-
const l =
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
return JSON.parse(JSON.stringify(e));
|
|
83
|
-
} catch {
|
|
84
|
-
return [];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const w = B(() => l.items), { list: q, containerProps: G, wrapperProps: Q } = ie(
|
|
88
|
-
w,
|
|
83
|
+
emits: /* @__PURE__ */ X(["update:sort", "click-row"], ["update:selected"]),
|
|
84
|
+
setup(u, { emit: Q }) {
|
|
85
|
+
const l = u, r = se(u, "selected"), w = oe(/* @__PURE__ */ new Map()), $ = b(() => l.items), { list: U, containerProps: Y, wrapperProps: Z } = de(
|
|
86
|
+
$,
|
|
89
87
|
{
|
|
90
88
|
disabled: !l.virtualList,
|
|
91
89
|
itemHeight: l.virtualListItemHeight || 54,
|
|
@@ -93,106 +91,153 @@ const fe = { key: 1 }, ve = { colspan: "999" }, me = { key: 2 }, ye = { colspan:
|
|
|
93
91
|
bottomOffset: l.virtualListOffsetBottom || 0,
|
|
94
92
|
overscan: l.virtualListOverscan
|
|
95
93
|
}
|
|
96
|
-
)
|
|
97
|
-
function
|
|
94
|
+
);
|
|
95
|
+
function d(e, a) {
|
|
96
|
+
if (!l.keyProp || !e || typeof e != "object" || e === null)
|
|
97
|
+
return a;
|
|
98
|
+
const t = e[l.keyProp];
|
|
99
|
+
return t == null ? (console.warn(`[XTable] keyProp "${l.keyProp}" is undefined/null for item at index ${a}. Falling back to index.`), a) : typeof t != "string" && typeof t != "number" ? (console.warn(`[XTable] keyProp "${l.keyProp}" must be a string or number, got ${typeof t}. Falling back to index.`), a) : t;
|
|
100
|
+
}
|
|
101
|
+
function B(e) {
|
|
102
|
+
return e.index;
|
|
103
|
+
}
|
|
104
|
+
const M = Q;
|
|
105
|
+
function j(e, a) {
|
|
98
106
|
if (e)
|
|
99
|
-
for (let t = 0; t <
|
|
100
|
-
const { 0:
|
|
101
|
-
if (e ===
|
|
102
|
-
return parseInt(
|
|
107
|
+
for (let t = 0; t < a.length; t++) {
|
|
108
|
+
const { 0: n, 1: o } = a[t].split(",");
|
|
109
|
+
if (e === n)
|
|
110
|
+
return parseInt(o) > 0 ? 1 : -1;
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
113
|
+
function _(e) {
|
|
114
|
+
const a = l.sort.slice(0);
|
|
107
115
|
let t = !1;
|
|
108
|
-
for (let
|
|
109
|
-
const { 0:
|
|
110
|
-
if (
|
|
111
|
-
if (t = !0,
|
|
112
|
-
|
|
116
|
+
for (let n = 0; n < a.length; n++) {
|
|
117
|
+
const { 0: o, 1: h } = a[n].split(",");
|
|
118
|
+
if (o === e.value) {
|
|
119
|
+
if (t = !0, h === "-1") {
|
|
120
|
+
a.splice(n, 1, `${e.value},1`);
|
|
113
121
|
break;
|
|
114
|
-
} else if (
|
|
115
|
-
|
|
122
|
+
} else if (h === "1") {
|
|
123
|
+
a.splice(n, 1);
|
|
116
124
|
break;
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
|
-
t ||
|
|
128
|
+
t || a.push(`${e.value},-1`), M("update:sort", a);
|
|
121
129
|
}
|
|
122
|
-
|
|
123
|
-
|
|
130
|
+
const F = /* @__PURE__ */ new Map();
|
|
131
|
+
function ee(e, a) {
|
|
132
|
+
if (!a || !e)
|
|
124
133
|
return "";
|
|
125
|
-
|
|
126
|
-
return (t
|
|
134
|
+
let t;
|
|
135
|
+
return Array.isArray(a) ? t = a : F.has(a) ? t = F.get(a) : (t = a.match(/([^[.\]])+/g), t && F.set(a, t)), !t || t.length === 0 ? "" : t.reduce((o, h) => o == null || typeof o != "object" ? null : o[h], e) ?? "";
|
|
136
|
+
}
|
|
137
|
+
const x = b(() => l.selectable ? $.value.map((e, a) => d(e, a)) : []), O = b(() => !l.selectable || l.singleSelect ? /* @__PURE__ */ new Set() : Array.isArray(r.value) ? new Set(r.value) : /* @__PURE__ */ new Set()), V = b(() => {
|
|
138
|
+
if (!l.selectable || l.singleSelect || !Array.isArray(r.value) || r.value.length === 0)
|
|
139
|
+
return !1;
|
|
140
|
+
const e = x.value.length;
|
|
141
|
+
return e === 0 ? !1 : r.value.length === e;
|
|
142
|
+
}), T = b(() => {
|
|
143
|
+
if (!l.selectable || l.singleSelect || !Array.isArray(r.value) || r.value.length === 0)
|
|
144
|
+
return !1;
|
|
145
|
+
const e = x.value.length;
|
|
146
|
+
return e === 0 ? !1 : r.value.length > 0 && r.value.length !== e;
|
|
147
|
+
});
|
|
148
|
+
function z(e) {
|
|
149
|
+
return l.selectable ? l.singleSelect ? r.value === e : O.value.has(e) : !1;
|
|
127
150
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return l.selectable ? l.singleSelect ? a.value === e : Array.isArray(a.value) && a.value.includes(e) : !1;
|
|
151
|
+
function N(e) {
|
|
152
|
+
l.selectable && (l.singleSelect ? r.value = r.value === e ? void 0 : e : (Array.isArray(r.value) || (r.value = []), O.value.has(e) ? r.value = r.value.filter((a) => a !== e) : r.value = [...r.value, e]));
|
|
131
153
|
}
|
|
132
|
-
function
|
|
133
|
-
l.selectable
|
|
154
|
+
function R() {
|
|
155
|
+
!l.selectable || l.singleSelect || (V.value || T.value ? r.value = [] : r.value = x.value);
|
|
134
156
|
}
|
|
135
|
-
function
|
|
136
|
-
!l.
|
|
157
|
+
function te(e) {
|
|
158
|
+
if (!l.expandable)
|
|
159
|
+
return;
|
|
160
|
+
const a = d(e.data, B(e));
|
|
161
|
+
w.value.set(a, !w.value.get(a));
|
|
137
162
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
163
|
+
function P(e) {
|
|
164
|
+
if (!l.expandable)
|
|
165
|
+
return !1;
|
|
166
|
+
const a = d(e.data, B(e));
|
|
167
|
+
return w.value.get(a) ?? !1;
|
|
140
168
|
}
|
|
141
|
-
|
|
142
|
-
|
|
169
|
+
function le(e, a) {
|
|
170
|
+
const t = B(a);
|
|
171
|
+
if (l.selectable && l.singleSelect) {
|
|
172
|
+
const n = d(e, t);
|
|
173
|
+
N(n);
|
|
174
|
+
}
|
|
175
|
+
M("click-row", e, t);
|
|
176
|
+
}
|
|
177
|
+
const H = b(() => {
|
|
178
|
+
let e = l.headers.length;
|
|
179
|
+
return l.selectable && !l.singleSelect && e++, l.expandable && e++, e;
|
|
180
|
+
});
|
|
181
|
+
ie($, (e) => {
|
|
182
|
+
const a = /* @__PURE__ */ new Set();
|
|
183
|
+
e.forEach((t, n) => {
|
|
184
|
+
a.add(d(t, n));
|
|
185
|
+
}), l.expandable && w.value.forEach((t, n) => {
|
|
186
|
+
a.has(n) || w.value.delete(n);
|
|
187
|
+
}), l.selectable && l.autoClearSelected && (l.singleSelect ? a.has(r.value) || (r.value = void 0) : Array.isArray(r.value) && r.value.length > 0 && (r.value = r.value.filter((t) => a.has(t))));
|
|
143
188
|
}, { immediate: !0 });
|
|
144
|
-
const { styles:
|
|
145
|
-
return (e,
|
|
146
|
-
class: [
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
189
|
+
const { styles: ae, classes: I, className: ne } = ue("Table", {}, l);
|
|
190
|
+
return (e, a) => (s(), i("div", D({
|
|
191
|
+
class: [c(ne), c(I).wrapper]
|
|
192
|
+
}, c(Y)), [
|
|
193
|
+
p(e.$slots, "title"),
|
|
194
|
+
p(e.$slots, "actions"),
|
|
195
|
+
y("div", D(c(Z), {
|
|
151
196
|
class: ["relative", {
|
|
152
197
|
"!h-auto": l.loading
|
|
153
198
|
}]
|
|
154
199
|
}), [
|
|
155
|
-
|
|
156
|
-
style:
|
|
157
|
-
class:
|
|
200
|
+
y("table", {
|
|
201
|
+
style: K(c(ae)),
|
|
202
|
+
class: m(c(I).table)
|
|
158
203
|
}, [
|
|
159
|
-
v(
|
|
160
|
-
default:
|
|
161
|
-
l.selectable && !l.singleSelect ? (s(),
|
|
204
|
+
v(ce, { "sticky-header": e.stickyHeader }, {
|
|
205
|
+
default: f(() => [
|
|
206
|
+
l.selectable && !l.singleSelect ? (s(), g(E, {
|
|
162
207
|
key: 0,
|
|
163
208
|
width: "40",
|
|
164
209
|
class: "!pl-3.5 !pr-0.5 !py-2.5 cursor-pointer",
|
|
165
|
-
onClick:
|
|
210
|
+
onClick: R
|
|
166
211
|
}, {
|
|
167
|
-
default:
|
|
212
|
+
default: f(() => [
|
|
168
213
|
v(J, {
|
|
169
|
-
"model-value":
|
|
170
|
-
indeterminate:
|
|
214
|
+
"model-value": V.value || T.value,
|
|
215
|
+
indeterminate: T.value,
|
|
171
216
|
"hide-footer": "",
|
|
172
217
|
"aria-label": "Select all rows",
|
|
173
218
|
"skip-form-registry": "",
|
|
174
|
-
onClick:
|
|
219
|
+
onClick: L(R, ["prevent", "stop"])
|
|
175
220
|
}, null, 8, ["model-value", "indeterminate"])
|
|
176
221
|
]),
|
|
177
222
|
_: 1
|
|
178
|
-
})) :
|
|
179
|
-
e.expandable ? (s(),
|
|
223
|
+
})) : k("", !0),
|
|
224
|
+
e.expandable ? (s(), g(E, {
|
|
180
225
|
key: 1,
|
|
181
226
|
width: "48",
|
|
182
227
|
class: "!p-0"
|
|
183
|
-
})) :
|
|
184
|
-
(s(!0),
|
|
185
|
-
key:
|
|
228
|
+
})) : k("", !0),
|
|
229
|
+
(s(!0), i(S, null, C(e.headers, (t, n) => (s(), g(E, {
|
|
230
|
+
key: n,
|
|
186
231
|
"text-align": t.align,
|
|
187
|
-
sort:
|
|
232
|
+
sort: j(t.value, e.sort),
|
|
188
233
|
sortable: t.sortable,
|
|
189
234
|
width: t.width,
|
|
190
235
|
tooltip: t.tooltip,
|
|
191
|
-
onClick: (
|
|
236
|
+
onClick: (o) => t.sortable ? _(t) : null
|
|
192
237
|
}, {
|
|
193
|
-
default:
|
|
194
|
-
|
|
195
|
-
|
|
238
|
+
default: f(() => [
|
|
239
|
+
p(e.$slots, `header-${t.value}`, { header: t }, () => [
|
|
240
|
+
W(q(t.text), 1)
|
|
196
241
|
])
|
|
197
242
|
]),
|
|
198
243
|
_: 2
|
|
@@ -200,28 +245,28 @@ const fe = { key: 1 }, ve = { colspan: "999" }, me = { key: 2 }, ye = { colspan:
|
|
|
200
245
|
]),
|
|
201
246
|
_: 3
|
|
202
247
|
}, 8, ["sticky-header"]),
|
|
203
|
-
v(
|
|
204
|
-
default:
|
|
205
|
-
e.loading ? (s(!0),
|
|
206
|
-
key:
|
|
248
|
+
v(c(fe), null, {
|
|
249
|
+
default: f(() => [
|
|
250
|
+
e.loading ? (s(!0), i(S, { key: 0 }, C(Number(e.loadingLines), (t, n) => (s(), g(G, {
|
|
251
|
+
key: n,
|
|
207
252
|
striped: e.striped
|
|
208
253
|
}, {
|
|
209
|
-
default:
|
|
210
|
-
(s(!0),
|
|
211
|
-
key:
|
|
212
|
-
"text-align":
|
|
213
|
-
width:
|
|
254
|
+
default: f(() => [
|
|
255
|
+
(s(!0), i(S, null, C(e.headers, (o, h) => (s(), g(A, {
|
|
256
|
+
key: h,
|
|
257
|
+
"text-align": o.align,
|
|
258
|
+
width: o.width,
|
|
214
259
|
dense: e.dense,
|
|
215
260
|
fixed: e.fixed
|
|
216
261
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
|
|
219
|
-
v(
|
|
220
|
-
class:
|
|
221
|
-
"mx-auto":
|
|
222
|
-
"ml-auto":
|
|
262
|
+
default: f(() => [
|
|
263
|
+
p(e.$slots, `loading-${o.value}`, { item: t }, () => [
|
|
264
|
+
v(ve, {
|
|
265
|
+
class: m(["max-w-[60%]", {
|
|
266
|
+
"mx-auto": o.align === "center",
|
|
267
|
+
"ml-auto": o.align === "right"
|
|
223
268
|
}]),
|
|
224
|
-
shape:
|
|
269
|
+
shape: o.skeletonShape || "line"
|
|
225
270
|
}, null, 8, ["shape", "class"])
|
|
226
271
|
])
|
|
227
272
|
]),
|
|
@@ -229,124 +274,121 @@ const fe = { key: 1 }, ve = { colspan: "999" }, me = { key: 2 }, ye = { colspan:
|
|
|
229
274
|
}, 1032, ["text-align", "width", "dense", "fixed"]))), 128))
|
|
230
275
|
]),
|
|
231
276
|
_: 2
|
|
232
|
-
}, 1032, ["striped"]))), 128)) : e.error ? (s(),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
])
|
|
236
|
-
])) :
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
])
|
|
240
|
-
])) : (s(!0),
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
default: c(() => [
|
|
309
|
-
f(e.$slots, `item-${n.value}`, {
|
|
310
|
-
item: t.data
|
|
311
|
-
}, () => [
|
|
312
|
-
X(D(Z(t.data, n.value)), 1)
|
|
313
|
-
])
|
|
314
|
-
]),
|
|
315
|
-
_: 2
|
|
316
|
-
}, 1032, ["text-align", "truncate", "width", "dense", "style"]))), 128))
|
|
317
|
-
]),
|
|
318
|
-
_: 2
|
|
319
|
-
}, 1032, ["pointer", "striped", "selected", "single-select", "onClick"]),
|
|
320
|
-
e.expandable ? (s(), u("tr", {
|
|
321
|
-
key: 0,
|
|
322
|
-
class: k({ hidden: !((i = b.value[t.index]) != null && i.__expanded) })
|
|
323
|
-
}, [
|
|
324
|
-
g("td", ke, [
|
|
325
|
-
g("div", {
|
|
326
|
-
class: k(["overflow-hidden transition-opacity", [(p = b.value[t.index]) != null && p.__expanded ? "" : "opacity-0 max-h-0"]])
|
|
327
|
-
}, [
|
|
328
|
-
f(e.$slots, "expanded-row", {
|
|
277
|
+
}, 1032, ["striped"]))), 128)) : e.error ? (s(), i("tr", me, [
|
|
278
|
+
y("td", { colspan: H.value }, [
|
|
279
|
+
p(e.$slots, "error")
|
|
280
|
+
], 8, he)
|
|
281
|
+
])) : !$.value || $.value.length === 0 ? (s(), i("tr", be, [
|
|
282
|
+
y("td", { colspan: H.value }, [
|
|
283
|
+
p(e.$slots, "empty")
|
|
284
|
+
], 8, ke)
|
|
285
|
+
])) : (s(!0), i(S, { key: 3 }, C(c(U), (t) => (s(), i(S, {
|
|
286
|
+
key: d(t.data, t.index)
|
|
287
|
+
}, [
|
|
288
|
+
v(G, {
|
|
289
|
+
pointer: e.pointer || !!u.toFn || !!u.hrefFn,
|
|
290
|
+
striped: e.striped,
|
|
291
|
+
selected: z(d(t.data, t.index)),
|
|
292
|
+
"single-select": e.singleSelect,
|
|
293
|
+
onClick: (n) => le(t.data, t)
|
|
294
|
+
}, {
|
|
295
|
+
default: f(() => [
|
|
296
|
+
l.selectable && !e.singleSelect ? (s(), g(A, {
|
|
297
|
+
key: 0,
|
|
298
|
+
width: "40",
|
|
299
|
+
class: "!pl-3.5 !pr-0.5 cursor-pointer",
|
|
300
|
+
onClick: L((n) => N(d(t.data, t.index)), ["stop"])
|
|
301
|
+
}, {
|
|
302
|
+
default: f(() => [
|
|
303
|
+
v(J, {
|
|
304
|
+
"model-value": z(d(t.data, t.index)),
|
|
305
|
+
"hide-footer": "",
|
|
306
|
+
"aria-label": `Select row ${B(t) + 1}`,
|
|
307
|
+
"skip-form-registry": "",
|
|
308
|
+
onClick: L((n) => N(d(t.data, t.index)), ["prevent", "stop"])
|
|
309
|
+
}, null, 8, ["model-value", "aria-label", "onClick"])
|
|
310
|
+
]),
|
|
311
|
+
_: 2
|
|
312
|
+
}, 1032, ["onClick"])) : k("", !0),
|
|
313
|
+
e.expandable ? (s(), g(A, {
|
|
314
|
+
key: 1,
|
|
315
|
+
width: "48",
|
|
316
|
+
class: "!p-1"
|
|
317
|
+
}, {
|
|
318
|
+
default: f(() => [
|
|
319
|
+
y("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
class: m(["px-3 p-2", [e.dense ? "p-0.5" : "px-3 py-2"]]),
|
|
322
|
+
onClick: L((n) => te(t), ["stop"])
|
|
323
|
+
}, [
|
|
324
|
+
v(ge, {
|
|
325
|
+
icon: c(ye),
|
|
326
|
+
size: e.dense ? "xs" : "md",
|
|
327
|
+
class: m(["transition-transform", {
|
|
328
|
+
"rotate-180": P(t)
|
|
329
|
+
}])
|
|
330
|
+
}, null, 8, ["icon", "size", "class"])
|
|
331
|
+
], 10, Se)
|
|
332
|
+
]),
|
|
333
|
+
_: 2
|
|
334
|
+
}, 1024)) : k("", !0),
|
|
335
|
+
(s(!0), i(S, null, C(e.headers, (n, o) => (s(), g(A, {
|
|
336
|
+
key: o,
|
|
337
|
+
"text-align": n.align,
|
|
338
|
+
truncate: n.truncate,
|
|
339
|
+
width: n.width,
|
|
340
|
+
dense: e.dense,
|
|
341
|
+
style: K([l.virtualList ? {
|
|
342
|
+
height: `${l.virtualListItemHeight}px`,
|
|
343
|
+
maxHeight: `${l.virtualListItemHeight}px`,
|
|
344
|
+
overflow: "hidden",
|
|
345
|
+
whiteSpace: "nowrap"
|
|
346
|
+
} : {}]),
|
|
347
|
+
href: u.hrefFn ? u.hrefFn(t.data) : void 0,
|
|
348
|
+
to: u.toFn ? u.toFn(t.data) : void 0,
|
|
349
|
+
target: u.hrefFn ? u.hrefTarget : void 0
|
|
350
|
+
}, {
|
|
351
|
+
default: f(() => [
|
|
352
|
+
p(e.$slots, `item-${n.value}`, {
|
|
329
353
|
item: t.data
|
|
330
|
-
})
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
354
|
+
}, () => [
|
|
355
|
+
W(q(ee(t.data, n.value)), 1)
|
|
356
|
+
])
|
|
357
|
+
]),
|
|
358
|
+
_: 2
|
|
359
|
+
}, 1032, ["text-align", "truncate", "width", "dense", "style", "href", "to", "target"]))), 128))
|
|
360
|
+
]),
|
|
361
|
+
_: 2
|
|
362
|
+
}, 1032, ["pointer", "striped", "selected", "single-select", "onClick"]),
|
|
363
|
+
e.expandable ? (s(), i("tr", {
|
|
364
|
+
key: 0,
|
|
365
|
+
class: m({ hidden: !P(t) })
|
|
366
|
+
}, [
|
|
367
|
+
y("td", { colspan: H.value }, [
|
|
368
|
+
y("div", {
|
|
369
|
+
class: m(["overflow-hidden transition-opacity", [P(t) ? "" : "opacity-0 max-h-0"]])
|
|
370
|
+
}, [
|
|
371
|
+
p(e.$slots, "expanded-row", {
|
|
372
|
+
item: t.data
|
|
373
|
+
})
|
|
374
|
+
], 2)
|
|
375
|
+
], 8, we)
|
|
376
|
+
], 2)) : k("", !0)
|
|
377
|
+
], 64))), 128))
|
|
336
378
|
]),
|
|
337
379
|
_: 3
|
|
338
380
|
})
|
|
339
381
|
], 6),
|
|
340
|
-
e.loading ? (s(),
|
|
382
|
+
e.loading ? (s(), i("div", {
|
|
341
383
|
key: 0,
|
|
342
|
-
class:
|
|
384
|
+
class: m(c(I).loadingWrapper)
|
|
343
385
|
}, [
|
|
344
|
-
v(
|
|
345
|
-
], 2)) :
|
|
386
|
+
v(pe, { size: "lg" })
|
|
387
|
+
], 2)) : k("", !0)
|
|
346
388
|
], 16)
|
|
347
389
|
], 16));
|
|
348
390
|
}
|
|
349
391
|
});
|
|
350
392
|
export {
|
|
351
|
-
|
|
393
|
+
Ve as default
|
|
352
394
|
};
|
|
@@ -17,6 +17,9 @@ declare const tableCellProps: {
|
|
|
17
17
|
default: string;
|
|
18
18
|
validator: (value: string) => boolean;
|
|
19
19
|
};
|
|
20
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
21
|
+
href: StringConstructor;
|
|
22
|
+
target: PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
20
23
|
};
|
|
21
24
|
export type TableCellTextAlign = typeof validators.textAlign[number];
|
|
22
25
|
export type TableCellVerticalAlign = typeof validators.verticalAlign[number];
|
|
@@ -37,6 +40,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
37
40
|
default: string;
|
|
38
41
|
validator: (value: string) => boolean;
|
|
39
42
|
};
|
|
43
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
44
|
+
href: StringConstructor;
|
|
45
|
+
target: PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
40
46
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
41
47
|
textAlign: {
|
|
42
48
|
type: PropType<"left" | "right" | "center" | "justify" | null>;
|
|
@@ -50,6 +56,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
50
56
|
default: string;
|
|
51
57
|
validator: (value: string) => boolean;
|
|
52
58
|
};
|
|
59
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
60
|
+
href: StringConstructor;
|
|
61
|
+
target: PropType<"_blank" | "_self" | "_parent" | "_top">;
|
|
53
62
|
}>> & Readonly<{}>, {
|
|
54
63
|
truncate: boolean;
|
|
55
64
|
dense: boolean;
|