@owocow/saber-ui 0.1.13 → 0.1.14
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/{SaberAppLayout.vue_vue_type_script_setup_true_lang-R7F5K7kj.js → SaberAppLayout.vue_vue_type_script_setup_true_lang-DaxscIFe.js} +2 -2
- package/dist/{SaberDictSelect.vue_vue_type_script_setup_true_lang-B8PTKNKX.js → SaberDictSelect.vue_vue_type_script_setup_true_lang-BKdOdlFX.js} +1 -1
- package/dist/SaberDistrictSelect.vue_vue_type_script_setup_true_lang-jkl2AOay.js +272 -0
- package/dist/SaberPopSelect.vue_vue_type_script_setup_true_lang-eH8jkkzK.js +162 -0
- package/dist/SaberSwitchBar.vue_vue_type_script_setup_true_lang-CIbFBx5r.js +47 -0
- package/dist/components/SaberAppLayout.mjs +1 -1
- package/dist/components/SaberPagination.vue.d.ts +49 -0
- package/dist/components/SaberSwitchBar.mjs +1 -1
- package/dist/control-size.d.ts +33 -0
- package/dist/forms/components/SaberFilterBar.vue.d.ts +3 -0
- package/dist/forms/components/SaberFormModal.vue.d.ts +2 -0
- package/dist/forms/components/fields/SaberDistrictSelect.vue.d.ts +5 -0
- package/dist/forms/components/fields/SaberInput.vue.d.ts +5 -0
- package/dist/forms/components/fields/SaberInputNumber.vue.d.ts +10 -2
- package/dist/forms/components/fields/SaberPopSelect.vue.d.ts +4 -1
- package/dist/forms/components/fields/SaberSelect.vue.d.ts +10 -2
- package/dist/forms/dict-select.mjs +1 -1
- package/dist/forms/district-select.mjs +1 -1
- package/dist/forms/index.d.ts +1 -0
- package/dist/forms/pop-select.mjs +1 -1
- package/dist/forms.mjs +4 -4
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +176 -98
- package/dist/plugin-DvH6j00c.js +442 -0
- package/package.json +1 -1
- package/dist/SaberDistrictSelect.vue_vue_type_script_setup_true_lang-BX8nLC35.js +0 -257
- package/dist/SaberPopSelect.vue_vue_type_script_setup_true_lang-BcS27NXI.js +0 -125
- package/dist/SaberSwitchBar.vue_vue_type_script_setup_true_lang-CDx3Dcas.js +0 -47
- package/dist/plugin-Dr3z0YFg.js +0 -396
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import te from "@nuxt/ui/components/Popover.vue";
|
|
2
|
-
import oe from "@nuxt/ui/runtime/vue/components/Icon.vue";
|
|
3
|
-
import le from "@nuxt/ui/components/Input.vue";
|
|
4
|
-
import ne from "@nuxt/ui/components/Button.vue";
|
|
5
|
-
import { defineComponent as ae, useModel as se, ref as x, inject as ie, computed as i, onMounted as ce, watch as K, nextTick as de, openBlock as l, createBlock as g, withCtx as j, createVNode as M, createSlots as re, createElementVNode as f, normalizeClass as k, toDisplayString as b, withModifiers as U, createElementBlock as s, Fragment as z, renderList as B, createCommentVNode as D, mergeModels as Q } from "vue";
|
|
6
|
-
import { D as ue } from "./district-service-cOu1tbQG.js";
|
|
7
|
-
const ve = { class: "w-120 p-2 flex flex-col gap-2" }, me = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "max-h-64 overflow-y-auto flex flex-col gap-0.5"
|
|
10
|
-
}, fe = ["onClick"], pe = { class: "flex-1 truncate" }, he = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "flex items-center justify-center h-10 text-sm text-muted"
|
|
13
|
-
}, _e = {
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "flex divide-x divide-default border border-default rounded-sm overflow-hidden"
|
|
16
|
-
}, ye = { class: "flex-1 max-h-64 overflow-y-auto py-1 minimal-scrollbar" }, xe = ["onClick"], ge = { class: "truncate" }, ke = { class: "flex-1 max-h-64 overflow-y-auto py-1 minimal-scrollbar" }, be = ["onClick"], Ce = { class: "truncate" }, we = {
|
|
17
|
-
key: 1,
|
|
18
|
-
class: "flex items-center justify-center h-full text-sm text-muted/50 py-4"
|
|
19
|
-
}, Ve = { class: "flex-1 max-h-64 overflow-y-auto py-1 minimal-scrollbar" }, $e = ["onClick"], je = { class: "truncate" }, ze = {
|
|
20
|
-
key: 1,
|
|
21
|
-
class: "flex items-center justify-center h-full text-sm text-muted/50 py-4"
|
|
22
|
-
}, Pe = /* @__PURE__ */ ae({
|
|
23
|
-
name: "SaberDistrictSelect",
|
|
24
|
-
__name: "SaberDistrictSelect",
|
|
25
|
-
props: /* @__PURE__ */ Q({
|
|
26
|
-
districts: {},
|
|
27
|
-
placeholder: { default: "请选择省 / 市 / 区" },
|
|
28
|
-
clearable: { type: Boolean, default: !0 },
|
|
29
|
-
disabled: { type: Boolean, default: !1 },
|
|
30
|
-
loading: { type: Boolean, default: void 0 }
|
|
31
|
-
}, {
|
|
32
|
-
modelValue: { default: void 0 },
|
|
33
|
-
modelModifiers: {}
|
|
34
|
-
}),
|
|
35
|
-
emits: /* @__PURE__ */ Q(["change"], ["update:modelValue"]),
|
|
36
|
-
setup(C, { expose: T, emit: A }) {
|
|
37
|
-
const h = C, L = A, a = se(C, "modelValue"), w = x(!1), P = x(null), u = x(null), c = x(null), _ = x(""), n = ie(ue, void 0), S = i(() => h.districts === void 0), V = i(
|
|
38
|
-
() => h.districts ?? (n == null ? void 0 : n.districts.value) ?? []
|
|
39
|
-
), $ = i(
|
|
40
|
-
() => h.loading ?? (S.value ? (n == null ? void 0 : n.loading.value) ?? !1 : !1)
|
|
41
|
-
), G = i(() => $.value ? "行政区加载中..." : h.placeholder);
|
|
42
|
-
async function E() {
|
|
43
|
-
if (!(!S.value || !n || n.districts.value.length))
|
|
44
|
-
try {
|
|
45
|
-
await n.load();
|
|
46
|
-
} catch (t) {
|
|
47
|
-
console.error("[SaberUI] Failed to load district data.", t);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
ce(() => void E()), K(() => h.districts, (t) => {
|
|
51
|
-
t === void 0 && E();
|
|
52
|
-
}), K(w, async (t) => {
|
|
53
|
-
var o, v, p;
|
|
54
|
-
if (!t) {
|
|
55
|
-
_.value = "";
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (a.value) {
|
|
59
|
-
const m = V.value.find((y) => {
|
|
60
|
-
var e;
|
|
61
|
-
return y.adcode === ((e = a.value) == null ? void 0 : e.provinceCode);
|
|
62
|
-
}) ?? null;
|
|
63
|
-
u.value = m, c.value = ((o = m == null ? void 0 : m.districts) == null ? void 0 : o.find((y) => {
|
|
64
|
-
var e;
|
|
65
|
-
return y.adcode === ((e = a.value) == null ? void 0 : e.cityCode);
|
|
66
|
-
})) ?? null;
|
|
67
|
-
} else
|
|
68
|
-
u.value = null, c.value = null;
|
|
69
|
-
await de(), (p = (v = P.value) == null ? void 0 : v.input) == null || p.focus();
|
|
70
|
-
});
|
|
71
|
-
const N = i(() => {
|
|
72
|
-
var t;
|
|
73
|
-
return ((t = u.value) == null ? void 0 : t.districts) ?? [];
|
|
74
|
-
}), R = i(() => {
|
|
75
|
-
var t;
|
|
76
|
-
return ((t = c.value) == null ? void 0 : t.districts) ?? [];
|
|
77
|
-
});
|
|
78
|
-
function H(t) {
|
|
79
|
-
u.value = t, c.value = null;
|
|
80
|
-
}
|
|
81
|
-
function J(t) {
|
|
82
|
-
c.value = t;
|
|
83
|
-
}
|
|
84
|
-
function W(t) {
|
|
85
|
-
!u.value || !c.value || O({
|
|
86
|
-
province: u.value.name,
|
|
87
|
-
provinceCode: u.value.adcode,
|
|
88
|
-
city: c.value.name,
|
|
89
|
-
cityCode: c.value.adcode,
|
|
90
|
-
district: t.name,
|
|
91
|
-
districtCode: t.adcode
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
const X = i(() => {
|
|
95
|
-
const t = [];
|
|
96
|
-
for (const o of V.value)
|
|
97
|
-
for (const v of o.districts ?? [])
|
|
98
|
-
for (const p of v.districts ?? [])
|
|
99
|
-
t.push({
|
|
100
|
-
label: `${o.name} / ${v.name} / ${p.name}`,
|
|
101
|
-
province: o.name,
|
|
102
|
-
provinceCode: o.adcode,
|
|
103
|
-
city: v.name,
|
|
104
|
-
cityCode: v.adcode,
|
|
105
|
-
district: p.name,
|
|
106
|
-
districtCode: p.adcode
|
|
107
|
-
});
|
|
108
|
-
return t;
|
|
109
|
-
}), F = i(() => {
|
|
110
|
-
const t = _.value.trim();
|
|
111
|
-
return t ? X.value.filter((o) => o.province.includes(t) || o.city.includes(t) || o.district.includes(t)).slice(0, 50) : [];
|
|
112
|
-
});
|
|
113
|
-
function O(t) {
|
|
114
|
-
a.value = t, L("change", t), w.value = !1;
|
|
115
|
-
}
|
|
116
|
-
function Y() {
|
|
117
|
-
a.value = void 0, u.value = null, c.value = null, L("change", void 0);
|
|
118
|
-
}
|
|
119
|
-
const Z = i(() => a.value ? `${a.value.province} / ${a.value.city} / ${a.value.district}` : G.value), q = i(() => a.value != null), ee = i(() => _.value.trim().length > 0);
|
|
120
|
-
return T({
|
|
121
|
-
districts: V,
|
|
122
|
-
loading: $,
|
|
123
|
-
error: i(() => (n == null ? void 0 : n.error.value) ?? null),
|
|
124
|
-
reload: () => n == null ? void 0 : n.load(!0)
|
|
125
|
-
}), (t, o) => {
|
|
126
|
-
const v = ne, p = le, m = oe, y = te;
|
|
127
|
-
return l(), g(y, {
|
|
128
|
-
open: w.value,
|
|
129
|
-
"onUpdate:open": o[3] || (o[3] = (e) => w.value = e),
|
|
130
|
-
content: { align: "start", sideOffset: 4 }
|
|
131
|
-
}, {
|
|
132
|
-
content: j(() => [
|
|
133
|
-
f("div", ve, [
|
|
134
|
-
M(p, {
|
|
135
|
-
ref_key: "searchInputRef",
|
|
136
|
-
ref: P,
|
|
137
|
-
modelValue: _.value,
|
|
138
|
-
"onUpdate:modelValue": o[2] || (o[2] = (e) => _.value = e),
|
|
139
|
-
placeholder: "搜索省 / 市 / 区...",
|
|
140
|
-
ui: { base: "h-9", leadingIcon: "size-4" },
|
|
141
|
-
"leading-icon": "i-solar:minimalistic-magnifer-outline"
|
|
142
|
-
}, null, 8, ["modelValue"]),
|
|
143
|
-
ee.value ? (l(), s("div", me, [
|
|
144
|
-
F.value.length > 0 ? (l(!0), s(z, { key: 0 }, B(F.value, (e) => {
|
|
145
|
-
var d, r;
|
|
146
|
-
return l(), s("div", {
|
|
147
|
-
key: e.districtCode,
|
|
148
|
-
class: k(["flex items-center h-9 px-3 rounded-sm cursor-pointer select-none text-sm hover:bg-muted", ((d = a.value) == null ? void 0 : d.districtCode) === e.districtCode ? "bg-accented/70" : ""]),
|
|
149
|
-
onClick: (I) => O(e)
|
|
150
|
-
}, [
|
|
151
|
-
f("span", pe, b(e.label), 1),
|
|
152
|
-
((r = a.value) == null ? void 0 : r.districtCode) === e.districtCode ? (l(), g(m, {
|
|
153
|
-
key: 0,
|
|
154
|
-
name: "i-lucide:check",
|
|
155
|
-
class: "size-4 shrink-0 ml-2 text-primary"
|
|
156
|
-
})) : D("", !0)
|
|
157
|
-
], 10, fe);
|
|
158
|
-
}), 128)) : (l(), s("div", he, "无匹配结果"))
|
|
159
|
-
])) : (l(), s("div", _e, [
|
|
160
|
-
f("div", ye, [
|
|
161
|
-
(l(!0), s(z, null, B(V.value, (e) => {
|
|
162
|
-
var d, r;
|
|
163
|
-
return l(), s("div", {
|
|
164
|
-
key: e.adcode,
|
|
165
|
-
class: k(["flex items-center justify-between h-9 px-3 cursor-pointer select-none text-sm", ((d = u.value) == null ? void 0 : d.adcode) === e.adcode ? "bg-accented/70" : "hover:bg-muted"]),
|
|
166
|
-
onClick: (I) => H(e)
|
|
167
|
-
}, [
|
|
168
|
-
f("span", ge, b(e.name), 1),
|
|
169
|
-
((r = u.value) == null ? void 0 : r.adcode) === e.adcode ? (l(), g(m, {
|
|
170
|
-
key: 0,
|
|
171
|
-
name: "i-lucide:chevron-right",
|
|
172
|
-
class: "size-4 shrink-0 ml-1 text-muted"
|
|
173
|
-
})) : D("", !0)
|
|
174
|
-
], 10, xe);
|
|
175
|
-
}), 128))
|
|
176
|
-
]),
|
|
177
|
-
f("div", ke, [
|
|
178
|
-
N.value.length > 0 ? (l(!0), s(z, { key: 0 }, B(N.value, (e) => {
|
|
179
|
-
var d, r;
|
|
180
|
-
return l(), s("div", {
|
|
181
|
-
key: e.adcode,
|
|
182
|
-
class: k(["flex items-center justify-between h-9 px-3 cursor-pointer select-none text-sm", ((d = c.value) == null ? void 0 : d.adcode) === e.adcode ? "bg-accented/70" : "hover:bg-muted"]),
|
|
183
|
-
onClick: (I) => J(e)
|
|
184
|
-
}, [
|
|
185
|
-
f("span", Ce, b(e.name), 1),
|
|
186
|
-
((r = c.value) == null ? void 0 : r.adcode) === e.adcode ? (l(), g(m, {
|
|
187
|
-
key: 0,
|
|
188
|
-
name: "i-lucide:chevron-right",
|
|
189
|
-
class: "size-4 shrink-0 ml-1 text-muted"
|
|
190
|
-
})) : D("", !0)
|
|
191
|
-
], 10, be);
|
|
192
|
-
}), 128)) : (l(), s("div", we, "请选择省份"))
|
|
193
|
-
]),
|
|
194
|
-
f("div", Ve, [
|
|
195
|
-
R.value.length > 0 ? (l(!0), s(z, { key: 0 }, B(R.value, (e) => {
|
|
196
|
-
var d, r;
|
|
197
|
-
return l(), s("div", {
|
|
198
|
-
key: e.adcode,
|
|
199
|
-
class: k(["flex items-center justify-between h-9 px-3 cursor-pointer select-none text-sm", ((d = a.value) == null ? void 0 : d.districtCode) === e.adcode ? "bg-accented/70" : "hover:bg-muted"]),
|
|
200
|
-
onClick: (I) => W(e)
|
|
201
|
-
}, [
|
|
202
|
-
f("span", je, b(e.name), 1),
|
|
203
|
-
((r = a.value) == null ? void 0 : r.districtCode) === e.adcode ? (l(), g(m, {
|
|
204
|
-
key: 0,
|
|
205
|
-
name: "i-lucide:check",
|
|
206
|
-
class: "size-3.5 shrink-0 ml-1 text-primary"
|
|
207
|
-
})) : D("", !0)
|
|
208
|
-
], 10, $e);
|
|
209
|
-
}), 128)) : (l(), s("div", ze, "请选择城市"))
|
|
210
|
-
])
|
|
211
|
-
]))
|
|
212
|
-
])
|
|
213
|
-
]),
|
|
214
|
-
default: j(() => [
|
|
215
|
-
M(v, {
|
|
216
|
-
color: "neutral",
|
|
217
|
-
variant: "outline",
|
|
218
|
-
disabled: C.disabled || $.value,
|
|
219
|
-
loading: $.value,
|
|
220
|
-
ui: { base: "rounded-sm justify-between h-10", trailingIcon: "size-4" },
|
|
221
|
-
"trailing-icon": "i-lucide:chevron-down",
|
|
222
|
-
class: "w-full saberButton"
|
|
223
|
-
}, re({
|
|
224
|
-
default: j(() => [
|
|
225
|
-
f("span", {
|
|
226
|
-
class: k(["truncate", q.value ? "" : "text-muted/60 font-normal"])
|
|
227
|
-
}, b(Z.value), 3)
|
|
228
|
-
]),
|
|
229
|
-
_: 2
|
|
230
|
-
}, [
|
|
231
|
-
q.value && C.clearable ? {
|
|
232
|
-
name: "trailing",
|
|
233
|
-
fn: j(() => [
|
|
234
|
-
M(v, {
|
|
235
|
-
color: "neutral",
|
|
236
|
-
variant: "ghost",
|
|
237
|
-
icon: "i-solar:close-circle-outline",
|
|
238
|
-
ui: { base: "p-1 min-w-0 -mr-1.5", leadingIcon: "size-4" },
|
|
239
|
-
onPointerdown: o[0] || (o[0] = U(() => {
|
|
240
|
-
}, ["stop", "prevent"])),
|
|
241
|
-
onMousedown: o[1] || (o[1] = U(() => {
|
|
242
|
-
}, ["stop", "prevent"])),
|
|
243
|
-
onClick: U(Y, ["stop", "prevent"])
|
|
244
|
-
})
|
|
245
|
-
]),
|
|
246
|
-
key: "0"
|
|
247
|
-
} : void 0
|
|
248
|
-
]), 1032, ["disabled", "loading"])
|
|
249
|
-
]),
|
|
250
|
-
_: 1
|
|
251
|
-
}, 8, ["open"]);
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
export {
|
|
256
|
-
Pe as _
|
|
257
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import z from "@nuxt/ui/components/Popover.vue";
|
|
2
|
-
import U from "@nuxt/ui/runtime/vue/components/Icon.vue";
|
|
3
|
-
import j from "@nuxt/ui/components/Button.vue";
|
|
4
|
-
import { defineComponent as I, useModel as L, ref as N, useAttrs as O, computed as u, openBlock as r, createBlock as b, withCtx as i, createVNode as _, mergeProps as E, unref as $, createSlots as D, createElementVNode as p, normalizeClass as x, toDisplayString as k, withModifiers as m, createElementBlock as v, Fragment as F, renderList as q, createCommentVNode as G, mergeModels as w } from "vue";
|
|
5
|
-
const H = {
|
|
6
|
-
style: { width: "var(--reka-popper-anchor-width)" },
|
|
7
|
-
class: "p-2 max-h-60 overflow-y-auto flex flex-col gap-0.5"
|
|
8
|
-
}, J = ["onClick"], K = { class: "flex-1 truncate" }, Q = {
|
|
9
|
-
key: 1,
|
|
10
|
-
class: "flex items-center justify-center h-10 text-sm text-muted px-3"
|
|
11
|
-
}, Z = /* @__PURE__ */ I({
|
|
12
|
-
name: "SaberPopSelect",
|
|
13
|
-
inheritAttrs: !1,
|
|
14
|
-
__name: "SaberPopSelect",
|
|
15
|
-
props: /* @__PURE__ */ w({
|
|
16
|
-
items: { default: () => [] },
|
|
17
|
-
placeholder: { default: "请选择" },
|
|
18
|
-
multiple: { type: Boolean, default: !1 },
|
|
19
|
-
clearable: { type: Boolean, default: !0 },
|
|
20
|
-
disabled: { type: Boolean, default: !1 }
|
|
21
|
-
}, {
|
|
22
|
-
modelValue: {},
|
|
23
|
-
modelModifiers: {}
|
|
24
|
-
}),
|
|
25
|
-
emits: /* @__PURE__ */ w(["change"], ["update:modelValue"]),
|
|
26
|
-
setup(s, { emit: A }) {
|
|
27
|
-
const o = s, c = A, t = L(s, "modelValue"), d = N(!1), f = O();
|
|
28
|
-
function h(l) {
|
|
29
|
-
return o.multiple ? Array.isArray(t.value) && t.value.includes(l.value) : t.value === l.value;
|
|
30
|
-
}
|
|
31
|
-
function S(l) {
|
|
32
|
-
if (!l.disabled) {
|
|
33
|
-
if (o.multiple) {
|
|
34
|
-
const e = Array.isArray(t.value) ? [...t.value] : [], n = e.indexOf(l.value);
|
|
35
|
-
n === -1 ? e.push(l.value) : e.splice(n, 1), t.value = e, c("change", e);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
t.value = l.value, d.value = !1, c("change", l.value);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function C() {
|
|
42
|
-
const l = o.multiple ? [] : void 0;
|
|
43
|
-
t.value = l, c("change", l);
|
|
44
|
-
}
|
|
45
|
-
const g = u(() => {
|
|
46
|
-
if (o.multiple) {
|
|
47
|
-
const e = Array.isArray(t.value) ? t.value : [];
|
|
48
|
-
return o.items.filter((n) => e.includes(n.value)).map((n) => n.label);
|
|
49
|
-
}
|
|
50
|
-
const l = o.items.find((e) => e.value === t.value);
|
|
51
|
-
return l ? [l.label] : [];
|
|
52
|
-
}), V = u(() => g.value.length > 0 ? g.value.join(", ") : o.placeholder), y = u(() => o.multiple ? Array.isArray(t.value) && t.value.length > 0 : t.value != null && t.value !== ""), B = u(() => {
|
|
53
|
-
const { class: l, ...e } = f;
|
|
54
|
-
return e;
|
|
55
|
-
});
|
|
56
|
-
return (l, e) => {
|
|
57
|
-
const n = j, M = U, P = z;
|
|
58
|
-
return r(), b(P, {
|
|
59
|
-
open: d.value,
|
|
60
|
-
"onUpdate:open": e[2] || (e[2] = (a) => d.value = a),
|
|
61
|
-
content: { align: "start", sideOffset: 4 }
|
|
62
|
-
}, {
|
|
63
|
-
content: i(() => [
|
|
64
|
-
p("div", H, [
|
|
65
|
-
s.items.length > 0 ? (r(!0), v(F, { key: 0 }, q(s.items, (a) => (r(), v("div", {
|
|
66
|
-
key: String(a.value),
|
|
67
|
-
class: x(["flex items-center h-10 px-3 rounded-sm select-none text-sm", [
|
|
68
|
-
a.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
69
|
-
h(a) ? "bg-accented/70" : a.disabled ? "" : "hover:bg-muted"
|
|
70
|
-
]]),
|
|
71
|
-
onClick: (R) => S(a)
|
|
72
|
-
}, [
|
|
73
|
-
p("span", K, k(a.label), 1),
|
|
74
|
-
h(a) ? (r(), b(M, {
|
|
75
|
-
key: 0,
|
|
76
|
-
name: "i-lucide:check",
|
|
77
|
-
class: "size-4 shrink-0 ml-2"
|
|
78
|
-
})) : G("", !0)
|
|
79
|
-
], 10, J))), 128)) : (r(), v("div", Q, "暂无数据"))
|
|
80
|
-
])
|
|
81
|
-
]),
|
|
82
|
-
default: i(() => [
|
|
83
|
-
_(n, E({
|
|
84
|
-
color: "neutral",
|
|
85
|
-
variant: "outline",
|
|
86
|
-
disabled: s.disabled,
|
|
87
|
-
ui: { base: "rounded-sm justify-between h-10", trailingIcon: "size-4" },
|
|
88
|
-
"trailing-icon": "i-lucide:chevron-down"
|
|
89
|
-
}, B.value, {
|
|
90
|
-
class: $(f).class || "w-full"
|
|
91
|
-
}), D({
|
|
92
|
-
default: i(() => [
|
|
93
|
-
p("span", {
|
|
94
|
-
class: x(["truncate", y.value ? "" : "text-muted/60 font-normal"])
|
|
95
|
-
}, k(V.value), 3)
|
|
96
|
-
]),
|
|
97
|
-
_: 2
|
|
98
|
-
}, [
|
|
99
|
-
y.value && s.clearable ? {
|
|
100
|
-
name: "trailing",
|
|
101
|
-
fn: i(() => [
|
|
102
|
-
_(n, {
|
|
103
|
-
color: "neutral",
|
|
104
|
-
variant: "ghost",
|
|
105
|
-
icon: "i-solar:close-circle-outline",
|
|
106
|
-
ui: { base: "p-1 min-w-0 -mr-1.5", leadingIcon: "size-4" },
|
|
107
|
-
onPointerdown: e[0] || (e[0] = m(() => {
|
|
108
|
-
}, ["stop", "prevent"])),
|
|
109
|
-
onMousedown: e[1] || (e[1] = m(() => {
|
|
110
|
-
}, ["stop", "prevent"])),
|
|
111
|
-
onClick: m(C, ["stop", "prevent"])
|
|
112
|
-
})
|
|
113
|
-
]),
|
|
114
|
-
key: "0"
|
|
115
|
-
} : void 0
|
|
116
|
-
]), 1040, ["disabled", "class"])
|
|
117
|
-
]),
|
|
118
|
-
_: 1
|
|
119
|
-
}, 8, ["open"]);
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
export {
|
|
124
|
-
Z as _
|
|
125
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineComponent as b, useModel as p, computed as f, openBlock as n, createElementBlock as i, normalizeClass as l, createElementVNode as s, Fragment as h, renderList as x, toDisplayString as g, mergeModels as c } from "vue";
|
|
2
|
-
const w = ["onClick"], C = /* @__PURE__ */ b({
|
|
3
|
-
name: "SaberSwitchBar",
|
|
4
|
-
__name: "SaberSwitchBar",
|
|
5
|
-
props: /* @__PURE__ */ c({
|
|
6
|
-
tabs: {},
|
|
7
|
-
ui: { default: () => ({}) }
|
|
8
|
-
}, {
|
|
9
|
-
modelValue: { required: !0 },
|
|
10
|
-
modelModifiers: {}
|
|
11
|
-
}),
|
|
12
|
-
emits: /* @__PURE__ */ c(["change"], ["update:modelValue"]),
|
|
13
|
-
setup(o, { emit: u }) {
|
|
14
|
-
const d = o, m = u, r = p(o, "modelValue"), e = f(() => ({
|
|
15
|
-
root: "rounded-full bg-accented/80 p-1.25",
|
|
16
|
-
scroller: "w-full overflow-x-auto touch-pan-x [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
17
|
-
list: "inline-flex w-max min-w-max items-center gap-1",
|
|
18
|
-
tab: "shrink-0 whitespace-nowrap rounded-full px-4 py-2.5 text-sm leading-none transition-colors duration-100",
|
|
19
|
-
tabActive: "bg-primary text-(--saber-bg) dark:text-default font-bold cursor-default",
|
|
20
|
-
tabInactive: "text-muted hover:text-primary cursor-pointer font-bold",
|
|
21
|
-
...d.ui
|
|
22
|
-
}));
|
|
23
|
-
function v(t) {
|
|
24
|
-
r.value !== t && (r.value = t, m("change", t));
|
|
25
|
-
}
|
|
26
|
-
return (t, k) => (n(), i("div", {
|
|
27
|
-
class: l(e.value.root)
|
|
28
|
-
}, [
|
|
29
|
-
s("div", {
|
|
30
|
-
class: l(e.value.scroller)
|
|
31
|
-
}, [
|
|
32
|
-
s("div", {
|
|
33
|
-
class: l(e.value.list)
|
|
34
|
-
}, [
|
|
35
|
-
(n(!0), i(h, null, x(o.tabs, (a) => (n(), i("span", {
|
|
36
|
-
key: String(a.value),
|
|
37
|
-
class: l([e.value.tab, r.value === a.value ? e.value.tabActive : e.value.tabInactive]),
|
|
38
|
-
onClick: (y) => v(a.value)
|
|
39
|
-
}, g(a.label), 11, w))), 128))
|
|
40
|
-
], 2)
|
|
41
|
-
], 2)
|
|
42
|
-
], 2));
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
export {
|
|
46
|
-
C as _
|
|
47
|
-
};
|