@7pmlabs/design-system 1.0.9 → 1.0.10
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/design-system.css +1 -1
- package/dist/design-system.js +24 -16
- package/dist/design-system177.js +29 -326
- package/dist/design-system177.js.map +1 -1
- package/dist/design-system179.js +1 -1
- package/dist/design-system179.js.map +1 -1
- package/dist/design-system180.js +73 -85
- package/dist/design-system180.js.map +1 -1
- package/dist/design-system182.js +1 -1
- package/dist/design-system182.js.map +1 -1
- package/dist/design-system183.js +32 -105
- package/dist/design-system183.js.map +1 -1
- package/dist/design-system185.js +4 -5
- package/dist/design-system185.js.map +1 -1
- package/dist/design-system186.js +26 -104
- package/dist/design-system186.js.map +1 -1
- package/dist/design-system188.js +4 -5
- package/dist/design-system188.js.map +1 -1
- package/dist/design-system189.js +23 -727
- package/dist/design-system189.js.map +1 -1
- package/dist/design-system191.js +1 -1
- package/dist/design-system191.js.map +1 -1
- package/dist/design-system192.js +31 -11
- package/dist/design-system192.js.map +1 -1
- package/dist/design-system194.js +8 -0
- package/dist/design-system194.js.map +1 -0
- package/dist/design-system195.js +332 -5
- package/dist/design-system195.js.map +1 -1
- package/dist/design-system197.js +5 -46
- package/dist/design-system197.js.map +1 -1
- package/dist/design-system198.js +100 -4
- package/dist/design-system198.js.map +1 -1
- package/dist/design-system200.js +8 -0
- package/dist/design-system200.js.map +1 -0
- package/dist/design-system201.js +19 -5
- package/dist/design-system201.js.map +1 -1
- package/dist/design-system202.js +4 -119
- package/dist/design-system202.js.map +1 -1
- package/dist/design-system203.js +6 -0
- package/dist/design-system203.js.map +1 -0
- package/dist/design-system204.js +419 -5
- package/dist/design-system204.js.map +1 -1
- package/dist/design-system206.js +8 -0
- package/dist/design-system206.js.map +1 -0
- package/dist/design-system207.js +108 -5
- package/dist/design-system207.js.map +1 -1
- package/dist/design-system209.js +6 -4
- package/dist/design-system209.js.map +1 -1
- package/dist/design-system210.js +90 -154
- package/dist/design-system210.js.map +1 -1
- package/dist/design-system212.js +5 -4
- package/dist/design-system212.js.map +1 -1
- package/dist/design-system213.js +737 -7
- package/dist/design-system213.js.map +1 -1
- package/dist/design-system215.js +8 -0
- package/dist/design-system215.js.map +1 -0
- package/dist/design-system216.js +11 -5
- package/dist/design-system216.js.map +1 -1
- package/dist/design-system217.js +451 -506
- package/dist/design-system217.js.map +1 -1
- package/dist/design-system219.js +4 -5
- package/dist/design-system219.js.map +1 -1
- package/dist/design-system220.js +3 -7
- package/dist/design-system220.js.map +1 -1
- package/dist/design-system221.js +41 -369
- package/dist/design-system221.js.map +1 -1
- package/dist/design-system222.js +7 -0
- package/dist/design-system222.js.map +1 -0
- package/dist/design-system223.js +283 -6
- package/dist/design-system223.js.map +1 -1
- package/dist/design-system225.js +8 -0
- package/dist/design-system225.js.map +1 -0
- package/dist/design-system226.js +122 -0
- package/dist/design-system226.js.map +1 -0
- package/dist/design-system228.js +8 -0
- package/dist/design-system228.js.map +1 -0
- package/dist/{design-system205.js → design-system229.js} +1 -1
- package/dist/{design-system205.js.map → design-system229.js.map} +1 -1
- package/dist/design-system231.js +8 -0
- package/dist/design-system231.js.map +1 -0
- package/dist/{design-system208.js → design-system232.js} +1 -1
- package/dist/{design-system208.js.map → design-system232.js.map} +1 -1
- package/dist/design-system233.js +7 -0
- package/dist/design-system233.js.map +1 -0
- package/dist/design-system234.js +173 -0
- package/dist/design-system234.js.map +1 -0
- package/dist/design-system236.js +8 -0
- package/dist/design-system236.js.map +1 -0
- package/dist/design-system237.js +10 -0
- package/dist/design-system237.js.map +1 -0
- package/dist/{design-system214.js → design-system238.js} +2 -2
- package/dist/{design-system214.js.map → design-system238.js.map} +1 -1
- package/dist/design-system240.js +8 -0
- package/dist/design-system240.js.map +1 -0
- package/dist/design-system241.js +583 -0
- package/dist/design-system241.js.map +1 -0
- package/dist/design-system243.js +9 -0
- package/dist/design-system243.js.map +1 -0
- package/dist/design-system244.js +10 -0
- package/dist/design-system244.js.map +1 -0
- package/dist/design-system245.js +377 -0
- package/dist/design-system245.js.map +1 -0
- package/dist/design-system247.js +9 -0
- package/dist/design-system247.js.map +1 -0
- package/dist/types/components/BSkeleton/BSkeleton.spec.d.ts +1 -0
- package/dist/types/components/BSkeleton/BSkeleton.vue.d.ts +46 -0
- package/dist/types/components/BSkeleton/BSkeletonAvatar.vue.d.ts +12 -0
- package/dist/types/components/BSkeleton/BSkeletonButton.vue.d.ts +14 -0
- package/dist/types/components/BSkeleton/BSkeletonImage.vue.d.ts +7 -0
- package/dist/types/components/BSkeleton/BSkeletonInput.vue.d.ts +12 -0
- package/dist/types/components/BSkeleton/BSkeletonNode.vue.d.ts +19 -0
- package/dist/types/components/BSkeleton/index.d.ts +7 -0
- package/dist/types/components/BSkeleton/types.d.ts +20 -0
- package/dist/types/components/BSplitter/BSplitter.spec.d.ts +1 -0
- package/dist/types/components/BSplitter/BSplitter.vue.d.ts +45 -0
- package/dist/types/components/BSplitter/BSplitterPanel.vue.d.ts +40 -0
- package/dist/types/components/BSplitter/index.d.ts +3 -0
- package/dist/types/components/BSplitter/types.d.ts +42 -0
- package/dist/types/components/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/design-system193.js +0 -528
- package/dist/design-system193.js.map +0 -1
- package/dist/design-system196.js +0 -6
- package/dist/design-system196.js.map +0 -1
- package/dist/design-system199.js +0 -286
- package/dist/design-system199.js.map +0 -1
package/dist/design-system221.js
CHANGED
|
@@ -1,377 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"disabled",
|
|
19
|
-
"webkitdirectory"
|
|
20
|
-
], te = {
|
|
21
|
-
key: 0,
|
|
22
|
-
class: "b-upload__item-thumbnail",
|
|
23
|
-
"aria-hidden": "true"
|
|
24
|
-
}, ne = ["src", "alt"], re = {
|
|
25
|
-
key: 1,
|
|
26
|
-
class: "b-upload__item-file-icon"
|
|
27
|
-
}, D = { class: "b-upload__item-info" }, O = ["title"], k = { class: "b-upload__item-actions" }, A = ["onClick"], j = ["onClick"], M = ["disabled", "onClick"], N = ["aria-valuenow", "aria-label"], P = {
|
|
28
|
-
key: 2,
|
|
29
|
-
class: "b-upload__hint"
|
|
30
|
-
}, F = /* @__PURE__ */ l({
|
|
31
|
-
inheritAttrs: !1,
|
|
32
|
-
__name: "BUpload",
|
|
33
|
-
props: /* @__PURE__ */ u({
|
|
34
|
-
accept: { default: "" },
|
|
35
|
-
action: {
|
|
36
|
-
type: [String, Function],
|
|
37
|
-
default: ""
|
|
38
|
-
},
|
|
39
|
-
multiple: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
default: !1
|
|
42
|
-
},
|
|
43
|
-
disabled: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: !1
|
|
46
|
-
},
|
|
47
|
-
directory: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: !1
|
|
50
|
-
},
|
|
51
|
-
maxCount: {},
|
|
52
|
-
listType: { default: () => n.Text },
|
|
53
|
-
method: { default: "POST" },
|
|
54
|
-
name: { default: "file" },
|
|
55
|
-
headers: {},
|
|
56
|
-
data: { type: [Object, Function] },
|
|
57
|
-
withCredentials: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: !1
|
|
60
|
-
},
|
|
61
|
-
openFileDialogOnClick: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: !0
|
|
64
|
-
},
|
|
65
|
-
showUploadList: {
|
|
66
|
-
type: [Boolean, Object],
|
|
67
|
-
default: !0
|
|
68
|
-
},
|
|
69
|
-
defaultFileList: { default: () => [] },
|
|
70
|
-
beforeUpload: { type: Function },
|
|
71
|
-
customRequest: { type: Function }
|
|
72
|
-
}, {
|
|
73
|
-
fileList: { default: void 0 },
|
|
74
|
-
fileListModifiers: {}
|
|
75
|
-
}),
|
|
76
|
-
emits: /* @__PURE__ */ u([
|
|
77
|
-
"change",
|
|
78
|
-
"remove",
|
|
79
|
-
"preview",
|
|
80
|
-
"download",
|
|
81
|
-
"drop"
|
|
82
|
-
], ["update:fileList"]),
|
|
83
|
-
setup(l, { expose: u, emit: F }) {
|
|
84
|
-
let I = b(), L = x(l, "fileList"), R = F, { componentUID: z } = e(), B = h(null), V = h(!1), H = h(Array.isArray(l.defaultFileList) ? [...l.defaultFileList] : []), U = i({
|
|
85
|
-
get: () => L.value === void 0 ? H.value : L.value,
|
|
86
|
-
set: (e) => {
|
|
87
|
-
H.value = e, L.value !== void 0 && (L.value = e);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
p(() => {
|
|
91
|
-
L.value === void 0 && l.defaultFileList.length > 0 && (H.value = [...l.defaultFileList]);
|
|
92
|
-
}), ee(() => L.value, (e) => {
|
|
93
|
-
e !== void 0 && (H.value = e);
|
|
94
|
-
});
|
|
95
|
-
let W = i(() => l.listType === n.PictureCard || l.listType === n.PictureCircle), G = i(() => l.showUploadList === !1 ? !1 : l.showUploadList === !0 ? {
|
|
96
|
-
showPreviewIcon: !0,
|
|
97
|
-
showRemoveIcon: !0,
|
|
98
|
-
showDownloadIcon: !1
|
|
99
|
-
} : l.showUploadList), K = i(() => l.maxCount !== void 0 && l.maxCount !== 1 && U.value.length >= l.maxCount), q = 0;
|
|
100
|
-
function J() {
|
|
101
|
-
return q += 1, `b-upload-${z.value}-${q}-${Date.now()}`;
|
|
102
|
-
}
|
|
103
|
-
function Y(e) {
|
|
1
|
+
import { BTabsContextKey as e } from "./design-system220.js";
|
|
2
|
+
import { createCommentVNode as t, defineComponent as n, inject as r, onBeforeUnmount as i, onMounted as a, useSlots as o, watch as s } from "vue";
|
|
3
|
+
//#region src/components/BTabs/BTabPane.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var c = /* @__PURE__ */ n({
|
|
5
|
+
__name: "BTabPane",
|
|
6
|
+
props: {
|
|
7
|
+
tabKey: {},
|
|
8
|
+
tab: {},
|
|
9
|
+
disabled: { type: Boolean },
|
|
10
|
+
closable: { type: Boolean },
|
|
11
|
+
destroyOnHidden: { type: Boolean },
|
|
12
|
+
forceRender: { type: Boolean },
|
|
13
|
+
keepAlive: { type: Boolean }
|
|
14
|
+
},
|
|
15
|
+
setup(n) {
|
|
16
|
+
let c = n, l = o(), u = r(e, null);
|
|
17
|
+
function d() {
|
|
104
18
|
return {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
19
|
+
key: c.tabKey,
|
|
20
|
+
label: c.tab,
|
|
21
|
+
disabled: c.disabled,
|
|
22
|
+
closable: c.closable,
|
|
23
|
+
destroyOnHidden: c.destroyOnHidden,
|
|
24
|
+
forceRender: c.forceRender,
|
|
25
|
+
keepAlive: c.keepAlive,
|
|
26
|
+
renderContent: () => l.default?.() ?? [],
|
|
27
|
+
renderLabel: l.tab ? () => l.tab() : void 0
|
|
112
28
|
};
|
|
113
29
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
e.onError?.(/* @__PURE__ */ Error("Upload network error"));
|
|
129
|
-
}), t.open(e.method || "POST", e.action, !0), e.withCredentials && (t.withCredentials = !0), e.headers && Object.entries(e.headers).forEach(([e, n]) => {
|
|
130
|
-
t.setRequestHeader(e, n);
|
|
131
|
-
});
|
|
132
|
-
let n = new FormData();
|
|
133
|
-
e.data && Object.entries(e.data).forEach(([e, t]) => {
|
|
134
|
-
n.append(e, t);
|
|
135
|
-
}), n.append(e.filename, e.file), t.send(n);
|
|
136
|
-
}
|
|
137
|
-
async function ae(e, t) {
|
|
138
|
-
if (l.beforeUpload) try {
|
|
139
|
-
let n = await l.beforeUpload(e, t);
|
|
140
|
-
if (n === !1) return;
|
|
141
|
-
if (n instanceof Blob) {
|
|
142
|
-
Z(n instanceof File ? n : new File([n], e.name, { type: n.type }));
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
} catch {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
Z(e);
|
|
149
|
-
}
|
|
150
|
-
function Z(e) {
|
|
151
|
-
let n = Y(e), r;
|
|
152
|
-
r = l.maxCount === 1 ? [n] : l.maxCount === void 0 ? [...U.value, n] : [...U.value, n].slice(-l.maxCount), X(n, r), (typeof l.action == "function" ? l.action(e) : Promise.resolve(l.action)).then((r) => {
|
|
153
|
-
let i = l.customRequest || ie, a = typeof l.data == "function" ? l.data(n) : l.data || {};
|
|
154
|
-
i({
|
|
155
|
-
action: r,
|
|
156
|
-
file: e,
|
|
157
|
-
filename: l.name,
|
|
158
|
-
headers: l.headers,
|
|
159
|
-
data: a,
|
|
160
|
-
withCredentials: l.withCredentials,
|
|
161
|
-
method: l.method,
|
|
162
|
-
onProgress: (e) => {
|
|
163
|
-
let t = {
|
|
164
|
-
...n,
|
|
165
|
-
percent: e.percent
|
|
166
|
-
};
|
|
167
|
-
X(t, U.value.map((e) => e.uid === n.uid ? t : e));
|
|
168
|
-
},
|
|
169
|
-
onSuccess: (e) => {
|
|
170
|
-
let r = {
|
|
171
|
-
...n,
|
|
172
|
-
status: t.Done,
|
|
173
|
-
percent: 100,
|
|
174
|
-
response: e
|
|
175
|
-
};
|
|
176
|
-
X(r, U.value.map((e) => e.uid === n.uid ? r : e));
|
|
177
|
-
},
|
|
178
|
-
onError: (e) => {
|
|
179
|
-
let r = {
|
|
180
|
-
...n,
|
|
181
|
-
status: t.Error,
|
|
182
|
-
error: e
|
|
183
|
-
};
|
|
184
|
-
X(r, U.value.map((e) => e.uid === n.uid ? r : e));
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
function Q(e) {
|
|
190
|
-
if (!e || e.length === 0) return;
|
|
191
|
-
let t = Array.from(e), n;
|
|
192
|
-
if (l.maxCount === 1) n = t.slice(0, 1);
|
|
193
|
-
else if (l.maxCount !== void 0) {
|
|
194
|
-
let e = l.maxCount - U.value.length;
|
|
195
|
-
n = e > 0 ? t.slice(0, e) : [];
|
|
196
|
-
} else n = t;
|
|
197
|
-
n.forEach((e) => ae(e, t));
|
|
198
|
-
}
|
|
199
|
-
function oe() {
|
|
200
|
-
l.disabled || !l.openFileDialogOnClick || K.value || B.value?.click();
|
|
201
|
-
}
|
|
202
|
-
function $(e) {
|
|
203
|
-
l.disabled || K.value || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), B.value?.click());
|
|
204
|
-
}
|
|
205
|
-
function se(e) {
|
|
206
|
-
let t = e.target;
|
|
207
|
-
Q(t.files), t.value = "";
|
|
208
|
-
}
|
|
209
|
-
function ce(e) {
|
|
210
|
-
e.preventDefault(), !l.disabled && (V.value = !0);
|
|
211
|
-
}
|
|
212
|
-
function le(e) {
|
|
213
|
-
e.preventDefault(), V.value = !1;
|
|
214
|
-
}
|
|
215
|
-
function ue(e) {
|
|
216
|
-
e.preventDefault(), V.value = !1, !l.disabled && (R("drop", e), Q(e.dataTransfer?.files ?? null));
|
|
217
|
-
}
|
|
218
|
-
function de(e) {
|
|
219
|
-
R("remove", e);
|
|
220
|
-
let n = U.value.filter((t) => t.uid !== e.uid);
|
|
221
|
-
X({
|
|
222
|
-
...e,
|
|
223
|
-
status: t.Removed
|
|
224
|
-
}, n);
|
|
225
|
-
}
|
|
226
|
-
function fe(e) {
|
|
227
|
-
R("preview", e);
|
|
228
|
-
}
|
|
229
|
-
function pe(e) {
|
|
230
|
-
R("download", e);
|
|
231
|
-
}
|
|
232
|
-
return u({ openFileDialog: () => B.value?.click() }), (e, i) => (m(), o("div", { class: d(["b-upload", {
|
|
233
|
-
"b-upload--disabled": l.disabled,
|
|
234
|
-
"b-upload--drag-over": V.value,
|
|
235
|
-
[`b-upload--${l.listType}`]: !0
|
|
236
|
-
}]) }, [
|
|
237
|
-
!W.value || !K.value ? (m(), o("div", {
|
|
238
|
-
key: 0,
|
|
239
|
-
class: "b-upload__trigger",
|
|
240
|
-
role: "button",
|
|
241
|
-
tabindex: l.disabled ? -1 : 0,
|
|
242
|
-
"aria-disabled": l.disabled || void 0,
|
|
243
|
-
"aria-label": y(I)["aria-label"] || "Upload file",
|
|
244
|
-
onClick: oe,
|
|
245
|
-
onKeydown: $,
|
|
246
|
-
onDragover: ce,
|
|
247
|
-
onDragleave: le,
|
|
248
|
-
onDrop: ue
|
|
249
|
-
}, [_(e.$slots, "default", {}, () => [W.value ? (m(), o("div", w, [...i[0] ||= [c("<span class=\"b-upload__plus-icon\" aria-hidden=\"true\" data-v-36315fd9><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" data-v-36315fd9><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\" data-v-36315fd9></line><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\" data-v-36315fd9></line></svg></span><span class=\"b-upload__card-text\" data-v-36315fd9>Upload</span>", 2)]])) : (m(), o("span", T, "Click to Upload"))], !0)], 40, C)) : a("", !0),
|
|
250
|
-
s("input", {
|
|
251
|
-
ref_key: "inputRef",
|
|
252
|
-
ref: B,
|
|
253
|
-
class: "b-upload__input",
|
|
254
|
-
type: "file",
|
|
255
|
-
accept: l.accept || void 0,
|
|
256
|
-
multiple: l.multiple,
|
|
257
|
-
disabled: l.disabled,
|
|
258
|
-
webkitdirectory: l.directory || void 0,
|
|
259
|
-
"aria-hidden": "true",
|
|
260
|
-
tabindex: "-1",
|
|
261
|
-
onChange: se
|
|
262
|
-
}, null, 40, E),
|
|
263
|
-
G.value !== !1 && U.value.length > 0 ? (m(), o("div", {
|
|
264
|
-
key: 1,
|
|
265
|
-
class: d(["b-upload__list", `b-upload__list--${l.listType}`]),
|
|
266
|
-
role: "list",
|
|
267
|
-
"aria-label": "Uploaded files"
|
|
268
|
-
}, [(m(!0), o(r, null, g(U.value, (e) => (m(), o("div", {
|
|
269
|
-
key: e.uid,
|
|
270
|
-
class: d(["b-upload__item", {
|
|
271
|
-
"b-upload__item--error": e.status === y(t).Error,
|
|
272
|
-
"b-upload__item--done": e.status === y(t).Done,
|
|
273
|
-
"b-upload__item--uploading": e.status === y(t).Uploading
|
|
274
|
-
}]),
|
|
275
|
-
role: "listitem"
|
|
276
|
-
}, [
|
|
277
|
-
l.listType === y(n).Text ? a("", !0) : (m(), o("span", te, [e.thumbUrl || e.url ? (m(), o("img", {
|
|
278
|
-
key: 0,
|
|
279
|
-
src: e.thumbUrl || e.url,
|
|
280
|
-
alt: e.name,
|
|
281
|
-
class: "b-upload__item-image"
|
|
282
|
-
}, null, 8, ne)) : (m(), o("span", re, [...i[1] ||= [s("svg", {
|
|
283
|
-
viewBox: "0 0 24 24",
|
|
284
|
-
fill: "none",
|
|
285
|
-
stroke: "currentColor",
|
|
286
|
-
"stroke-width": "1.5"
|
|
287
|
-
}, [s("path", { d: "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z" }), s("polyline", { points: "14,2 14,8 20,8" })], -1)]]))])),
|
|
288
|
-
s("span", D, [s("span", {
|
|
289
|
-
class: "b-upload__item-name",
|
|
290
|
-
title: e.name
|
|
291
|
-
}, v(e.name), 9, O)]),
|
|
292
|
-
s("span", k, [
|
|
293
|
-
G.value && G.value.showPreviewIcon && (e.url || e.thumbUrl) ? (m(), o("button", {
|
|
294
|
-
key: 0,
|
|
295
|
-
class: "b-upload__action-btn",
|
|
296
|
-
type: "button",
|
|
297
|
-
"aria-label": "Preview file",
|
|
298
|
-
onClick: S((t) => fe(e), ["stop"])
|
|
299
|
-
}, [...i[2] ||= [s("svg", {
|
|
300
|
-
viewBox: "0 0 24 24",
|
|
301
|
-
fill: "none",
|
|
302
|
-
stroke: "currentColor",
|
|
303
|
-
"stroke-width": "2",
|
|
304
|
-
"aria-hidden": "true"
|
|
305
|
-
}, [s("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }), s("circle", {
|
|
306
|
-
cx: "12",
|
|
307
|
-
cy: "12",
|
|
308
|
-
r: "3"
|
|
309
|
-
})], -1)]], 8, A)) : a("", !0),
|
|
310
|
-
G.value && G.value.showDownloadIcon && e.status === y(t).Done ? (m(), o("button", {
|
|
311
|
-
key: 1,
|
|
312
|
-
class: "b-upload__action-btn",
|
|
313
|
-
type: "button",
|
|
314
|
-
"aria-label": "Download file",
|
|
315
|
-
onClick: S((t) => pe(e), ["stop"])
|
|
316
|
-
}, [...i[3] ||= [s("svg", {
|
|
317
|
-
viewBox: "0 0 24 24",
|
|
318
|
-
fill: "none",
|
|
319
|
-
stroke: "currentColor",
|
|
320
|
-
"stroke-width": "2",
|
|
321
|
-
"aria-hidden": "true"
|
|
322
|
-
}, [
|
|
323
|
-
s("path", { d: "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" }),
|
|
324
|
-
s("polyline", { points: "7,10 12,15 17,10" }),
|
|
325
|
-
s("line", {
|
|
326
|
-
x1: "12",
|
|
327
|
-
y1: "15",
|
|
328
|
-
x2: "12",
|
|
329
|
-
y2: "3"
|
|
330
|
-
})
|
|
331
|
-
], -1)]], 8, j)) : a("", !0),
|
|
332
|
-
G.value && G.value.showRemoveIcon ? (m(), o("button", {
|
|
333
|
-
key: 2,
|
|
334
|
-
class: "b-upload__action-btn b-upload__action-btn--remove",
|
|
335
|
-
type: "button",
|
|
336
|
-
"aria-label": "Remove file",
|
|
337
|
-
disabled: l.disabled,
|
|
338
|
-
onClick: S((t) => de(e), ["stop"])
|
|
339
|
-
}, [...i[4] ||= [s("svg", {
|
|
340
|
-
viewBox: "0 0 24 24",
|
|
341
|
-
fill: "none",
|
|
342
|
-
stroke: "currentColor",
|
|
343
|
-
"stroke-width": "2",
|
|
344
|
-
"aria-hidden": "true"
|
|
345
|
-
}, [s("line", {
|
|
346
|
-
x1: "18",
|
|
347
|
-
y1: "6",
|
|
348
|
-
x2: "6",
|
|
349
|
-
y2: "18"
|
|
350
|
-
}), s("line", {
|
|
351
|
-
x1: "6",
|
|
352
|
-
y1: "6",
|
|
353
|
-
x2: "18",
|
|
354
|
-
y2: "18"
|
|
355
|
-
})], -1)]], 8, M)) : a("", !0)
|
|
356
|
-
]),
|
|
357
|
-
e.status === y(t).Uploading ? (m(), o("div", {
|
|
358
|
-
key: 1,
|
|
359
|
-
class: "b-upload__progress",
|
|
360
|
-
role: "progressbar",
|
|
361
|
-
"aria-valuenow": e.percent ?? 0,
|
|
362
|
-
"aria-valuemin": "0",
|
|
363
|
-
"aria-valuemax": "100",
|
|
364
|
-
"aria-label": `Uploading ${e.name}`
|
|
365
|
-
}, [s("div", {
|
|
366
|
-
class: "b-upload__progress-bar",
|
|
367
|
-
style: f({ width: `${e.percent ?? 0}%` })
|
|
368
|
-
}, null, 4)], 8, N)) : a("", !0)
|
|
369
|
-
], 2))), 128))], 2)) : a("", !0),
|
|
370
|
-
e.$slots.hint ? (m(), o("div", P, [_(e.$slots, "hint", {}, void 0, !0)])) : a("", !0)
|
|
371
|
-
], 2));
|
|
30
|
+
return a(() => {
|
|
31
|
+
u?.register(d());
|
|
32
|
+
}), i(() => {
|
|
33
|
+
u?.unregister(c.tabKey);
|
|
34
|
+
}), s(() => [
|
|
35
|
+
c.tab,
|
|
36
|
+
c.disabled,
|
|
37
|
+
c.closable,
|
|
38
|
+
c.destroyOnHidden,
|
|
39
|
+
c.forceRender,
|
|
40
|
+
c.keepAlive
|
|
41
|
+
], () => {
|
|
42
|
+
u?.update(c.tabKey, d());
|
|
43
|
+
}), (e, n) => t("", !0);
|
|
372
44
|
}
|
|
373
45
|
});
|
|
374
46
|
//#endregion
|
|
375
|
-
export {
|
|
47
|
+
export { c as default };
|
|
376
48
|
|
|
377
49
|
//# sourceMappingURL=design-system221.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system221.js","names":[],"sources":["../src/components/BUpload/BUpload.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { useModel as _useModel, mergeModels as _mergeModels, defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderSlot as _renderSlot, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, createStaticVNode as _createStaticVNode } from \"vue\"\n\nconst _hoisted_1 = [\"tabindex\", \"aria-disabled\", \"aria-label\"]\nconst _hoisted_2 = {\n key: 0,\n class: \"b-upload__card-trigger\"\n}\nconst _hoisted_3 = {\n key: 1,\n class: \"b-upload__default-text\"\n}\nconst _hoisted_4 = [\"accept\", \"multiple\", \"disabled\", \"webkitdirectory\"]\nconst _hoisted_5 = {\n key: 0,\n class: \"b-upload__item-thumbnail\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_6 = [\"src\", \"alt\"]\nconst _hoisted_7 = {\n key: 1,\n class: \"b-upload__item-file-icon\"\n}\nconst _hoisted_8 = { class: \"b-upload__item-info\" }\nconst _hoisted_9 = [\"title\"]\nconst _hoisted_10 = { class: \"b-upload__item-actions\" }\nconst _hoisted_11 = [\"onClick\"]\nconst _hoisted_12 = [\"onClick\"]\nconst _hoisted_13 = [\"disabled\", \"onClick\"]\nconst _hoisted_14 = [\"aria-valuenow\", \"aria-label\"]\nconst _hoisted_15 = {\n key: 2,\n class: \"b-upload__hint\"\n}\n\nimport { ref, computed, watch, onMounted, useAttrs } from 'vue';\nimport { useComponentId } from '@/composables/useComponentId';\nimport {\n BUploadListType,\n BUploadFileStatus,\n type BUploadFile,\n type BUploadChangeInfo,\n type BUploadRequestOption,\n type BUploadShowUploadList,\n} from './types';\n\n\nexport default /*@__PURE__*/_defineComponent({\n ...{ inheritAttrs: false },\n __name: 'BUpload',\n props: /*@__PURE__*/_mergeModels({\n accept: { default: '' },\n action: { type: [String, Function], default: '' },\n multiple: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n directory: { type: Boolean, default: false },\n maxCount: {},\n listType: { default: () => (BUploadListType.Text) },\n method: { default: 'POST' },\n name: { default: 'file' },\n headers: {},\n data: { type: [Object, Function] },\n withCredentials: { type: Boolean, default: false },\n openFileDialogOnClick: { type: Boolean, default: true },\n showUploadList: { type: [Boolean, Object], default: true },\n defaultFileList: { default: () => ([]) },\n beforeUpload: { type: Function },\n customRequest: { type: Function }\n }, {\n \"fileList\": { default: undefined },\n \"fileListModifiers\": {},\n }),\n emits: /*@__PURE__*/_mergeModels([\"change\", \"remove\", \"preview\", \"download\", \"drop\"], [\"update:fileList\"]),\n setup(__props: any, { expose: __expose, emit: __emit }) {\n\n\n\nconst attrs = useAttrs();\n\n//#region Props\n\n//#endregion\n\n//#region Model & Events\nconst model = _useModel<BUploadFile[]>(__props, 'fileList');\n\nconst emit = __emit;\n//#endregion\n\n//#region Internal State\nconst { componentUID } = useComponentId();\nconst inputRef = ref<HTMLInputElement | null>(null);\nconst dragOver = ref(false);\nconst internalFileList = ref<BUploadFile[]>(Array.isArray(__props.defaultFileList) ? [...__props.defaultFileList] : []);\n\nconst fileList = computed<BUploadFile[]>({\n get: () => (model.value !== undefined ? model.value : internalFileList.value),\n set: (val) => {\n internalFileList.value = val;\n if (model.value !== undefined) {\n model.value = val;\n }\n },\n});\n\nonMounted(() => {\n if (model.value === undefined && __props.defaultFileList.length > 0) {\n internalFileList.value = [...__props.defaultFileList];\n }\n});\n\nwatch(\n () => model.value,\n (val) => {\n if (val !== undefined) {\n internalFileList.value = val;\n }\n },\n);\n\nconst isPictureCard = computed(\n () =>\n __props.listType === BUploadListType.PictureCard ||\n __props.listType === BUploadListType.PictureCircle,\n);\n\nconst showListConfig = computed<BUploadShowUploadList | false>(() => {\n if (__props.showUploadList === false) return false;\n if (__props.showUploadList === true) {\n return { showPreviewIcon: true, showRemoveIcon: true, showDownloadIcon: false };\n }\n return __props.showUploadList;\n});\n\nconst atMaxCount = computed(() => __props.maxCount !== undefined && __props.maxCount !== 1 && fileList.value.length >= __props.maxCount);\n//#endregion\n\n//#region Upload Logic\nlet fileUidCounter = 0;\n\nfunction genUid(): string {\n fileUidCounter += 1;\n return `b-upload-${componentUID.value}-${fileUidCounter}-${Date.now()}`;\n}\n\nfunction fileToUploadFile(file: File): BUploadFile {\n return {\n uid: genUid(),\n name: file.name,\n size: file.size,\n type: file.type,\n status: BUploadFileStatus.Uploading,\n percent: 0,\n originFileObj: file,\n };\n}\n\nfunction triggerChange(file: BUploadFile, newFileList: BUploadFile[], event?: ProgressEvent) {\n fileList.value = newFileList;\n emit('change', { file, fileList: newFileList, event });\n}\n\nfunction defaultUpload(options: BUploadRequestOption) {\n const xhr = new XMLHttpRequest();\n\n xhr.upload.addEventListener('progress', (e) => {\n if (e.lengthComputable && options.onProgress) {\n options.onProgress({ percent: Math.round((e.loaded / e.total) * 100) });\n }\n });\n\n xhr.addEventListener('load', () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n options.onSuccess?.(xhr.response);\n } else {\n options.onError?.(new Error(`Upload failed with status ${xhr.status}`));\n }\n });\n\n xhr.addEventListener('error', () => {\n options.onError?.(new Error('Upload network error'));\n });\n\n xhr.open(options.method || 'POST', options.action, true);\n\n if (options.withCredentials) {\n xhr.withCredentials = true;\n }\n\n if (options.headers) {\n Object.entries(options.headers).forEach(([key, val]) => {\n xhr.setRequestHeader(key, val);\n });\n }\n\n const formData = new FormData();\n if (options.data) {\n Object.entries(options.data).forEach(([key, val]) => {\n formData.append(key, val as string);\n });\n }\n formData.append(options.filename, options.file);\n\n xhr.send(formData);\n}\n\nasync function uploadFile(file: File, rawFiles: File[]) {\n if (__props.beforeUpload) {\n try {\n const result = await __props.beforeUpload(file, rawFiles);\n if (result === false) return;\n if (result instanceof Blob) {\n const transformed = result instanceof File ? result : new File([result], file.name, { type: result.type });\n processUpload(transformed);\n return;\n }\n } catch {\n return;\n }\n }\n processUpload(file);\n}\n\nfunction processUpload(file: File) {\n const uploadFile = fileToUploadFile(file);\n let newList: BUploadFile[];\n\n if (__props.maxCount === 1) {\n newList = [uploadFile];\n } else if (__props.maxCount !== undefined) {\n newList = [...fileList.value, uploadFile].slice(-__props.maxCount);\n } else {\n newList = [...fileList.value, uploadFile];\n }\n\n triggerChange(uploadFile, newList);\n\n const resolvedAction = typeof __props.action === 'function' ? __props.action(file) : Promise.resolve(__props.action);\n\n resolvedAction.then((url: string) => {\n const requestFn = __props.customRequest || defaultUpload;\n const extraData = typeof __props.data === 'function' ? __props.data(uploadFile) : (__props.data || {});\n\n requestFn({\n action: url,\n file,\n filename: __props.name,\n headers: __props.headers,\n data: extraData,\n withCredentials: __props.withCredentials,\n method: __props.method,\n onProgress: (e) => {\n const updatedFile = { ...uploadFile, percent: e.percent };\n const updatedList = fileList.value.map((f) =>\n f.uid === uploadFile.uid ? updatedFile : f,\n );\n triggerChange(updatedFile, updatedList);\n },\n onSuccess: (response) => {\n const updatedFile = {\n ...uploadFile,\n status: BUploadFileStatus.Done,\n percent: 100,\n response,\n };\n const updatedList = fileList.value.map((f) =>\n f.uid === uploadFile.uid ? updatedFile : f,\n );\n triggerChange(updatedFile, updatedList);\n },\n onError: (error) => {\n const updatedFile = {\n ...uploadFile,\n status: BUploadFileStatus.Error,\n error,\n };\n const updatedList = fileList.value.map((f) =>\n f.uid === uploadFile.uid ? updatedFile : f,\n );\n triggerChange(updatedFile, updatedList);\n },\n });\n });\n}\n\nfunction handleFiles(files: FileList | null) {\n if (!files || files.length === 0) return;\n\n const rawFiles = Array.from(files);\n let filesToUpload: File[];\n\n if (__props.maxCount === 1) {\n filesToUpload = rawFiles.slice(0, 1);\n } else if (__props.maxCount !== undefined) {\n const remaining = __props.maxCount - fileList.value.length;\n filesToUpload = remaining > 0 ? rawFiles.slice(0, remaining) : [];\n } else {\n filesToUpload = rawFiles;\n }\n\n filesToUpload.forEach((file) => uploadFile(file, rawFiles));\n}\n//#endregion\n\n//#region Event Handlers\nfunction handleClick() {\n if (__props.disabled || !__props.openFileDialogOnClick || atMaxCount.value) return;\n inputRef.value?.click();\n}\n\nfunction handleKeyDown(event: KeyboardEvent) {\n if (__props.disabled || atMaxCount.value) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n inputRef.value?.click();\n }\n}\n\nfunction handleInputChange(event: Event) {\n const input = event.target as HTMLInputElement;\n handleFiles(input.files);\n input.value = '';\n}\n\nfunction handleDragOver(event: DragEvent) {\n event.preventDefault();\n if (__props.disabled) return;\n dragOver.value = true;\n}\n\nfunction handleDragLeave(event: DragEvent) {\n event.preventDefault();\n dragOver.value = false;\n}\n\nfunction handleDrop(event: DragEvent) {\n event.preventDefault();\n dragOver.value = false;\n if (__props.disabled) return;\n emit('drop', event);\n handleFiles(event.dataTransfer?.files ?? null);\n}\n\nfunction handleRemove(file: BUploadFile) {\n emit('remove', file);\n const newList = fileList.value.filter((f) => f.uid !== file.uid);\n triggerChange({ ...file, status: BUploadFileStatus.Removed }, newList);\n}\n\nfunction handlePreview(file: BUploadFile) {\n emit('preview', file);\n}\n\nfunction handleDownload(file: BUploadFile) {\n emit('download', file);\n}\n//#endregion\n\n//#region Expose\n__expose({\n /** Open the native file dialog programmatically. */\n openFileDialog: () => inputRef.value?.click(),\n});\n//#endregion\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"b-upload\", {\n 'b-upload--disabled': __props.disabled,\n 'b-upload--drag-over': dragOver.value,\n [`b-upload--${__props.listType}`]: true,\n }])\n }, [\n (!isPictureCard.value || !atMaxCount.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"b-upload__trigger\",\n role: \"button\",\n tabindex: __props.disabled ? -1 : 0,\n \"aria-disabled\": __props.disabled || undefined,\n \"aria-label\": (_unref(attrs)['aria-label'] as string) || 'Upload file',\n onClick: handleClick,\n onKeydown: handleKeyDown,\n onDragover: handleDragOver,\n onDragleave: handleDragLeave,\n onDrop: handleDrop\n }, [\n _renderSlot(_ctx.$slots, \"default\", {}, () => [\n (isPictureCard.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [...(_cache[0] || (_cache[0] = [\n _createStaticVNode(\"<span class=\\\"b-upload__plus-icon\\\" aria-hidden=\\\"true\\\" data-v-36315fd9><svg viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" data-v-36315fd9><line x1=\\\"12\\\" y1=\\\"5\\\" x2=\\\"12\\\" y2=\\\"19\\\" data-v-36315fd9></line><line x1=\\\"5\\\" y1=\\\"12\\\" x2=\\\"19\\\" y2=\\\"12\\\" data-v-36315fd9></line></svg></span><span class=\\\"b-upload__card-text\\\" data-v-36315fd9>Upload</span>\", 2)\n ]))]))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_3, \"Click to Upload\"))\n ], true)\n ], 40, _hoisted_1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"input\", {\n ref_key: \"inputRef\",\n ref: inputRef,\n class: \"b-upload__input\",\n type: \"file\",\n accept: __props.accept || undefined,\n multiple: __props.multiple,\n disabled: __props.disabled,\n webkitdirectory: __props.directory || undefined,\n \"aria-hidden\": \"true\",\n tabindex: \"-1\",\n onChange: handleInputChange\n }, null, 40, _hoisted_4),\n (showListConfig.value !== false && fileList.value.length > 0)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: _normalizeClass([\"b-upload__list\", `b-upload__list--${__props.listType}`]),\n role: \"list\",\n \"aria-label\": \"Uploaded files\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(fileList.value, (file) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: file.uid,\n class: _normalizeClass([\"b-upload__item\", {\n 'b-upload__item--error': file.status === _unref(BUploadFileStatus).Error,\n 'b-upload__item--done': file.status === _unref(BUploadFileStatus).Done,\n 'b-upload__item--uploading': file.status === _unref(BUploadFileStatus).Uploading,\n }]),\n role: \"listitem\"\n }, [\n (__props.listType !== _unref(BUploadListType).Text)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_5, [\n (file.thumbUrl || file.url)\n ? (_openBlock(), _createElementBlock(\"img\", {\n key: 0,\n src: file.thumbUrl || file.url,\n alt: file.name,\n class: \"b-upload__item-image\"\n }, null, 8, _hoisted_6))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_7, [...(_cache[1] || (_cache[1] = [\n _createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"1.5\"\n }, [\n _createElementVNode(\"path\", { d: \"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6z\" }),\n _createElementVNode(\"polyline\", { points: \"14,2 14,8 20,8\" })\n ], -1)\n ]))]))\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"span\", _hoisted_8, [\n _createElementVNode(\"span\", {\n class: \"b-upload__item-name\",\n title: file.name\n }, _toDisplayString(file.name), 9, _hoisted_9)\n ]),\n _createElementVNode(\"span\", _hoisted_10, [\n (showListConfig.value && showListConfig.value.showPreviewIcon && (file.url || file.thumbUrl))\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n class: \"b-upload__action-btn\",\n type: \"button\",\n \"aria-label\": \"Preview file\",\n onClick: _withModifiers(($event: any) => (handlePreview(file)), [\"stop\"])\n }, [...(_cache[2] || (_cache[2] = [\n _createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"aria-hidden\": \"true\"\n }, [\n _createElementVNode(\"path\", { d: \"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\" }),\n _createElementVNode(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"3\"\n })\n ], -1)\n ]))], 8, _hoisted_11))\n : _createCommentVNode(\"\", true),\n (showListConfig.value && showListConfig.value.showDownloadIcon && file.status === _unref(BUploadFileStatus).Done)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 1,\n class: \"b-upload__action-btn\",\n type: \"button\",\n \"aria-label\": \"Download file\",\n onClick: _withModifiers(($event: any) => (handleDownload(file)), [\"stop\"])\n }, [...(_cache[3] || (_cache[3] = [\n _createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"aria-hidden\": \"true\"\n }, [\n _createElementVNode(\"path\", { d: \"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4\" }),\n _createElementVNode(\"polyline\", { points: \"7,10 12,15 17,10\" }),\n _createElementVNode(\"line\", {\n x1: \"12\",\n y1: \"15\",\n x2: \"12\",\n y2: \"3\"\n })\n ], -1)\n ]))], 8, _hoisted_12))\n : _createCommentVNode(\"\", true),\n (showListConfig.value && showListConfig.value.showRemoveIcon)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 2,\n class: \"b-upload__action-btn b-upload__action-btn--remove\",\n type: \"button\",\n \"aria-label\": \"Remove file\",\n disabled: __props.disabled,\n onClick: _withModifiers(($event: any) => (handleRemove(file)), [\"stop\"])\n }, [...(_cache[4] || (_cache[4] = [\n _createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"aria-hidden\": \"true\"\n }, [\n _createElementVNode(\"line\", {\n x1: \"18\",\n y1: \"6\",\n x2: \"6\",\n y2: \"18\"\n }),\n _createElementVNode(\"line\", {\n x1: \"6\",\n y1: \"6\",\n x2: \"18\",\n y2: \"18\"\n })\n ], -1)\n ]))], 8, _hoisted_13))\n : _createCommentVNode(\"\", true)\n ]),\n (file.status === _unref(BUploadFileStatus).Uploading)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"b-upload__progress\",\n role: \"progressbar\",\n \"aria-valuenow\": file.percent ?? 0,\n \"aria-valuemin\": \"0\",\n \"aria-valuemax\": \"100\",\n \"aria-label\": `Uploading ${file.name}`\n }, [\n _createElementVNode(\"div\", {\n class: \"b-upload__progress-bar\",\n style: _normalizeStyle({ width: `${file.percent ?? 0}%` })\n }, null, 4)\n ], 8, _hoisted_14))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 2))\n : _createCommentVNode(\"\", true),\n (_ctx.$slots.hint)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, [\n _renderSlot(_ctx.$slots, \"hint\", {}, undefined, true)\n ]))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})"],"mappings":";;;;AAGA,IAAM,IAAa;CAAC;CAAY;CAAiB;CAAa,EACxD,IAAa;CACjB,KAAK;CACL,OAAO;CACR,EACK,IAAa;CACjB,KAAK;CACL,OAAO;CACR,EACK,IAAa;CAAC;CAAU;CAAY;CAAY;CAAkB,EAClE,KAAa;CACjB,KAAK;CACL,OAAO;CACP,eAAe;CAChB,EACK,KAAa,CAAC,OAAO,MAAM,EAC3B,KAAa;CACjB,KAAK;CACL,OAAO;CACR,EACK,IAAa,EAAE,OAAO,uBAAuB,EAC7C,IAAa,CAAC,QAAQ,EACtB,IAAc,EAAE,OAAO,0BAA0B,EACjD,IAAc,CAAC,UAAU,EACzB,IAAc,CAAC,UAAU,EACzB,IAAc,CAAC,YAAY,UAAU,EACrC,IAAc,CAAC,iBAAiB,aAAa,EAC7C,IAAc;CAClB,KAAK;CACL,OAAO;CACR,EAcD,IAA4B,kBAAiB;CACtC,cAAc;CACnB,QAAQ;CACR,OAAoB,kBAAa;EAC/B,QAAQ,EAAE,SAAS,IAAI;EACvB,QAAQ;GAAE,MAAM,CAAC,QAAQ,SAAS;GAAE,SAAS;GAAI;EACjD,UAAU;GAAE,MAAM;GAAS,SA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oB,OAAO;KACzB,OAAO;KACP,OAAO,EAAgB,EAAE,OAAO,GAAG,EAAK,WAAW,EAAE,IAAI,CAAC;KAC3D,EAAE,MAAM,EAAE,CACZ,EAAE,GAAG,EAAY,IAClB,EAAoB,IAAI,GAAK;IAClC,EAAE,EAAE,EACL,EAAE,IAAI,EACT,EAAE,EAAE,IACL,EAAoB,IAAI,GAAK;GAChC,EAAK,OAAO,QACR,GAAY,EAAE,EAAoB,OAAO,GAAa,CACrD,EAAY,EAAK,QAAQ,QAAQ,EAAE,EAAE,KAAA,GAAW,GAAK,CACtD,CAAC,IACF,EAAoB,IAAI,GAAK;GAClC,EAAE,EAAE;;CAIN,CAAA"}
|
|
1
|
+
{"version":3,"file":"design-system221.js","names":[],"sources":["../src/components/BTabs/BTabPane.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport type { VNode } from 'vue';\nimport { inject, onBeforeUnmount, onMounted, useSlots, watch } from 'vue';\n\nimport { BTabsContextKey } from './types';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\n\nexport default /*@__PURE__*/_defineComponent({\n __name: 'BTabPane',\n props: {\n tabKey: {},\n tab: {},\n disabled: { type: Boolean },\n closable: { type: Boolean },\n destroyOnHidden: { type: Boolean },\n forceRender: { type: Boolean },\n keepAlive: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\n\n\nconst slots = useSlots();\n\n// ─────────────────────────────────────────────\n// Inject parent context\n// ─────────────────────────────────────────────\nconst tabsContext = inject(BTabsContextKey, null);\n\n// ─────────────────────────────────────────────\n// Registration helpers\n// ─────────────────────────────────────────────\nfunction buildRegistration() {\n return {\n key: props.tabKey,\n label: props.tab,\n disabled: props.disabled,\n closable: props.closable,\n destroyOnHidden: props.destroyOnHidden,\n forceRender: props.forceRender,\n keepAlive: props.keepAlive,\n renderContent: () => (slots.default?.() ?? []) as VNode[],\n renderLabel: slots.tab ? () => slots.tab!() as VNode[] : undefined,\n };\n}\n\nonMounted(() => {\n tabsContext?.register(buildRegistration());\n});\n\nonBeforeUnmount(() => {\n tabsContext?.unregister(props.tabKey);\n});\n\nwatch(\n () => [\n props.tab,\n props.disabled,\n props.closable,\n props.destroyOnHidden,\n props.forceRender,\n props.keepAlive,\n ],\n () => {\n tabsContext?.update(props.tabKey, buildRegistration());\n },\n);\n\nreturn (_ctx: any,_cache: any) => {\n return false\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true)\n}\n}\n\n})"],"mappings":";;;AAYA,IAAA,IAA4B,kBAAiB;CAC3C,QAAQ;CACR,OAAO;EACL,QAAQ,EAAE;EACV,KAAK,EAAE;EACP,UAAU,EAAE,MAAM,SAAS;EAC3B,UAAU,EAAE,MAAM,SAAS;EAC3B,iBAAiB,EAAE,MAAM,SAAS;EAClC,aAAa,EAAE,MAAM,SAAS;EAC9B,WAAW,EAAE,MAAM,SAAS;EAC7B;CACD,MAAM,GAAc;EAEtB,IAAM,IAAQ,GAOR,IAAQ,GAAU,EAKlB,IAAc,EAAO,GAAiB,KAAK;EAKjD,SAAS,IAAoB;AAC3B,UAAO;IACL,KAAK,EAAM;IACX,OAAO,EAAM;IACb,UAAU,EAAM;IAChB,UAAU,EAAM;IAChB,iBAAiB,EAAM;IACvB,aAAa,EAAM;IACnB,WAAW,EAAM;IACjB,qBAAsB,EAAM,WAAW,IAAI,EAAE;IAC7C,aAAa,EAAM,YAAY,EAAM,KAAM,GAAc,KAAA;IAC1D;;AAyBH,SAtBA,QAAgB;AACd,MAAa,SAAS,GAAmB,CAAC;IAC1C,EAEF,QAAsB;AACpB,MAAa,WAAW,EAAM,OAAO;IACrC,EAEF,QACQ;GACJ,EAAM;GACN,EAAM;GACN,EAAM;GACN,EAAM;GACN,EAAM;GACN,EAAM;GACP,QACK;AACJ,MAAa,OAAO,EAAM,QAAQ,GAAmB,CAAC;IAEzD,GAEO,GAAU,MAGZ,EAAoB,IAAI,GAAK;;CAIlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-system222.js","names":[],"sources":["../src/components/BTabs/BTabPane.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { VNode } from 'vue';\nimport { inject, onBeforeUnmount, onMounted, useSlots, watch } from 'vue';\n\nimport { BTabsContextKey } from './types';\n\n// ─────────────────────────────────────────────\n// Props\n// ─────────────────────────────────────────────\nconst props = defineProps<{\n /** Unique key identifying this tab pane. */\n tabKey: string;\n /** Tab header label text. Use the `tab` slot for rich labels. */\n tab?: string;\n /** Whether this tab is disabled. @default false */\n disabled?: boolean;\n /** Show close button in editable-card mode. @default true */\n closable?: boolean;\n /** Destroy content when tab is hidden. @default false */\n destroyOnHidden?: boolean;\n /** Force render content even when inactive. @default false */\n forceRender?: boolean;\n /** Keep component state alive when switching away. Overrides global setting. */\n keepAlive?: boolean;\n}>();\n\n// ─────────────────────────────────────────────\n// Slots\n// ─────────────────────────────────────────────\ndefineSlots<{\n /** Tab pane content. */\n default?: () => unknown;\n /** Custom tab label content. */\n tab?: () => unknown;\n}>();\n\nconst slots = useSlots();\n\n// ─────────────────────────────────────────────\n// Inject parent context\n// ─────────────────────────────────────────────\nconst tabsContext = inject(BTabsContextKey, null);\n\n// ─────────────────────────────────────────────\n// Registration helpers\n// ─────────────────────────────────────────────\nfunction buildRegistration() {\n return {\n key: props.tabKey,\n label: props.tab,\n disabled: props.disabled,\n closable: props.closable,\n destroyOnHidden: props.destroyOnHidden,\n forceRender: props.forceRender,\n keepAlive: props.keepAlive,\n renderContent: () => (slots.default?.() ?? []) as VNode[],\n renderLabel: slots.tab ? () => slots.tab!() as VNode[] : undefined,\n };\n}\n\nonMounted(() => {\n tabsContext?.register(buildRegistration());\n});\n\nonBeforeUnmount(() => {\n tabsContext?.unregister(props.tabKey);\n});\n\nwatch(\n () => [\n props.tab,\n props.disabled,\n props.closable,\n props.destroyOnHidden,\n props.forceRender,\n props.keepAlive,\n ],\n () => {\n tabsContext?.update(props.tabKey, buildRegistration());\n },\n);\n</script>\n\n<template>\n <!-- BTabPane is a registration-only component. All rendering is handled by BTabs. -->\n <slot v-if=\"false\" />\n</template>\n"],"mappings":""}
|