@mcistudio/unoui-vue 1.0.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/README.md +95 -0
- package/dist/alert/Alert.vue.d.ts +67 -0
- package/dist/alert/index.d.ts +40 -0
- package/dist/alert/index.js +2 -0
- package/dist/attrs.d.ts +11 -0
- package/dist/attrs.js +16 -0
- package/dist/attrs.js.map +1 -0
- package/dist/badge/Badge.vue.d.ts +57 -0
- package/dist/badge/BadgeRibbon.vue.d.ts +34 -0
- package/dist/badge/index.d.ts +42 -0
- package/dist/badge/index.js +2 -0
- package/dist/build.d.ts +2 -0
- package/dist/button/Button.vue.d.ts +46 -0
- package/dist/button/ButtonGroup.vue.d.ts +13 -0
- package/dist/button/index.d.ts +13 -0
- package/dist/button/index.js +2 -0
- package/dist/checkbox/Checkbox.vue.d.ts +47 -0
- package/dist/checkbox/CheckboxGroup.vue.d.ts +38 -0
- package/dist/checkbox/index.d.ts +30 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/chunks/Progress-BL4KZ3HE.js +271 -0
- package/dist/chunks/Progress-BL4KZ3HE.js.map +1 -0
- package/dist/chunks/Skeleton-ohStUD4M.js +153 -0
- package/dist/chunks/Skeleton-ohStUD4M.js.map +1 -0
- package/dist/chunks/Table-DhXmuKQd.js +330 -0
- package/dist/chunks/Table-DhXmuKQd.js.map +1 -0
- package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
- package/dist/chunks/alert-CczW_DKs.js +190 -0
- package/dist/chunks/alert-CczW_DKs.js.map +1 -0
- package/dist/chunks/badge-BHOZeImh.js +287 -0
- package/dist/chunks/badge-BHOZeImh.js.map +1 -0
- package/dist/chunks/button-pDObrN_X.js +168 -0
- package/dist/chunks/button-pDObrN_X.js.map +1 -0
- package/dist/chunks/checkbox-9_0oR4kg.js +260 -0
- package/dist/chunks/checkbox-9_0oR4kg.js.map +1 -0
- package/dist/chunks/colorpicker-CcizUCQv.js +594 -0
- package/dist/chunks/colorpicker-CcizUCQv.js.map +1 -0
- package/dist/chunks/datepicker-Cy808x7X.js +1414 -0
- package/dist/chunks/datepicker-Cy808x7X.js.map +1 -0
- package/dist/chunks/drawer-C3JZ28Xo.js +193 -0
- package/dist/chunks/drawer-C3JZ28Xo.js.map +1 -0
- package/dist/chunks/dropdown-0l967g7D.js +329 -0
- package/dist/chunks/dropdown-0l967g7D.js.map +1 -0
- package/dist/chunks/form-Qeqkd-HH.js +642 -0
- package/dist/chunks/form-Qeqkd-HH.js.map +1 -0
- package/dist/chunks/input-BDOXVCrK.js +1281 -0
- package/dist/chunks/input-BDOXVCrK.js.map +1 -0
- package/dist/chunks/inputOtp-Dyxj9lNj.js +261 -0
- package/dist/chunks/inputOtp-Dyxj9lNj.js.map +1 -0
- package/dist/chunks/message-xPfuG0EX.js +107 -0
- package/dist/chunks/message-xPfuG0EX.js.map +1 -0
- package/dist/chunks/millercolumns-Dp3fBrq6.js +426 -0
- package/dist/chunks/millercolumns-Dp3fBrq6.js.map +1 -0
- package/dist/chunks/modal-D6l1iIvE.js +81 -0
- package/dist/chunks/modal-D6l1iIvE.js.map +1 -0
- package/dist/chunks/pagination-Bc583AQX.js +265 -0
- package/dist/chunks/pagination-Bc583AQX.js.map +1 -0
- package/dist/chunks/popconfirm-D6lUfSxG.js +343 -0
- package/dist/chunks/popconfirm-D6lUfSxG.js.map +1 -0
- package/dist/chunks/qrcode-B0t_pZna.js +1099 -0
- package/dist/chunks/qrcode-B0t_pZna.js.map +1 -0
- package/dist/chunks/radio-DnYm59xH.js +477 -0
- package/dist/chunks/radio-DnYm59xH.js.map +1 -0
- package/dist/chunks/rate-0sme__Kb.js +309 -0
- package/dist/chunks/rate-0sme__Kb.js.map +1 -0
- package/dist/chunks/select-ChTfQM5u.js +417 -0
- package/dist/chunks/select-ChTfQM5u.js.map +1 -0
- package/dist/chunks/slider-C-W5GzTP.js +724 -0
- package/dist/chunks/slider-C-W5GzTP.js.map +1 -0
- package/dist/chunks/splitter-CgfiXY65.js +524 -0
- package/dist/chunks/splitter-CgfiXY65.js.map +1 -0
- package/dist/chunks/switch-BULGbODP.js +327 -0
- package/dist/chunks/switch-BULGbODP.js.map +1 -0
- package/dist/chunks/tab-Dxfg1_To.js +663 -0
- package/dist/chunks/tab-Dxfg1_To.js.map +1 -0
- package/dist/chunks/tag-BYmNsrZC.js +167 -0
- package/dist/chunks/tag-BYmNsrZC.js.map +1 -0
- package/dist/chunks/timepicker-DsGIdcf8.js +1059 -0
- package/dist/chunks/timepicker-DsGIdcf8.js.map +1 -0
- package/dist/chunks/tooltip-DMhiAqto.js +242 -0
- package/dist/chunks/tooltip-DMhiAqto.js.map +1 -0
- package/dist/colorpicker/ColorPicker.vue.d.ts +30 -0
- package/dist/colorpicker/color.d.ts +56 -0
- package/dist/colorpicker/color.js +99 -0
- package/dist/colorpicker/color.js.map +1 -0
- package/dist/colorpicker/index.d.ts +12 -0
- package/dist/colorpicker/index.js +2 -0
- package/dist/config.d.ts +55 -0
- package/dist/config.js +260 -0
- package/dist/config.js.map +1 -0
- package/dist/datepicker/DatePicker.vue.d.ts +82 -0
- package/dist/datepicker/RangePicker.vue.d.ts +87 -0
- package/dist/datepicker/index.d.ts +59 -0
- package/dist/datepicker/index.js +2 -0
- package/dist/drawer/Drawer.vue.d.ts +86 -0
- package/dist/drawer/index.d.ts +23 -0
- package/dist/drawer/index.js +2 -0
- package/dist/dropdown/Dropdown.vue.d.ts +118 -0
- package/dist/dropdown/index.d.ts +2 -0
- package/dist/dropdown/index.js +2 -0
- package/dist/form/Form.vue.d.ts +170 -0
- package/dist/form/FormItem.vue.d.ts +83 -0
- package/dist/form/index.d.ts +176 -0
- package/dist/form/index.js +2 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +32 -0
- package/dist/input/Autocomplete.vue.d.ts +121 -0
- package/dist/input/Input.vue.d.ts +142 -0
- package/dist/input/InputI18n.vue.d.ts +80 -0
- package/dist/input/InputTag.vue.d.ts +114 -0
- package/dist/input/index.d.ts +41 -0
- package/dist/input/index.js +2 -0
- package/dist/inputOtp/InputOtp.vue.d.ts +60 -0
- package/dist/inputOtp/index.d.ts +21 -0
- package/dist/inputOtp/index.js +2 -0
- package/dist/message/MessageContainer.vue.d.ts +11 -0
- package/dist/message/index.d.ts +20 -0
- package/dist/message/index.js +2 -0
- package/dist/message/types.d.ts +25 -0
- package/dist/millercolumns/MillerColumns.vue.d.ts +88 -0
- package/dist/millercolumns/index.d.ts +39 -0
- package/dist/millercolumns/index.js +2 -0
- package/dist/modal/Modal.vue.d.ts +54 -0
- package/dist/modal/index.d.ts +2 -0
- package/dist/modal/index.js +2 -0
- package/dist/pagination/Pagination.vue.d.ts +70 -0
- package/dist/pagination/index.d.ts +12 -0
- package/dist/pagination/index.js +2 -0
- package/dist/popconfirm/Popconfirm.vue.d.ts +104 -0
- package/dist/popconfirm/index.d.ts +36 -0
- package/dist/popconfirm/index.js +2 -0
- package/dist/progress/Progress.vue.d.ts +64 -0
- package/dist/progress/index.d.ts +26 -0
- package/dist/progress/index.js +2 -0
- package/dist/qrcode/QRCode.vue.d.ts +87 -0
- package/dist/qrcode/index.d.ts +43 -0
- package/dist/qrcode/index.js +2 -0
- package/dist/qrcode/qr.d.ts +51 -0
- package/dist/qrcode/qrcodegen.d.ts +94 -0
- package/dist/radio/Radio.vue.d.ts +52 -0
- package/dist/radio/RadioGroup.vue.d.ts +44 -0
- package/dist/radio/index.d.ts +55 -0
- package/dist/radio/index.js +2 -0
- package/dist/rate/Rate.vue.d.ts +100 -0
- package/dist/rate/index.d.ts +38 -0
- package/dist/rate/index.js +2 -0
- package/dist/select/Select.vue.d.ts +129 -0
- package/dist/select/index.d.ts +33 -0
- package/dist/select/index.js +2 -0
- package/dist/skeleton/Skeleton.vue.d.ts +31 -0
- package/dist/skeleton/index.d.ts +2 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/slider/Slider.vue.d.ts +81 -0
- package/dist/slider/index.d.ts +61 -0
- package/dist/slider/index.js +2 -0
- package/dist/splitter/Splitter.vue.d.ts +63 -0
- package/dist/splitter/SplitterPanel.vue.d.ts +53 -0
- package/dist/splitter/index.d.ts +39 -0
- package/dist/splitter/index.js +2 -0
- package/dist/style.css +2 -0
- package/dist/switch/Switch.vue.d.ts +97 -0
- package/dist/switch/index.d.ts +31 -0
- package/dist/switch/index.js +2 -0
- package/dist/tab/TabPane.vue.d.ts +32 -0
- package/dist/tab/Tabs.vue.d.ts +87 -0
- package/dist/tab/index.d.ts +78 -0
- package/dist/tab/index.js +2 -0
- package/dist/table/Table.vue.d.ts +96 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +2 -0
- package/dist/table/types.d.ts +35 -0
- package/dist/table/types.js +0 -0
- package/dist/tag/Tag.vue.d.ts +46 -0
- package/dist/tag/index.d.ts +11 -0
- package/dist/tag/index.js +2 -0
- package/dist/timepicker/TimePicker.vue.d.ts +92 -0
- package/dist/timepicker/TimeRangePicker.vue.d.ts +90 -0
- package/dist/timepicker/index.d.ts +39 -0
- package/dist/timepicker/index.js +2 -0
- package/dist/tooltip/Tooltip.vue.d.ts +79 -0
- package/dist/tooltip/index.d.ts +14 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/uno.d.ts +32 -0
- package/dist/uno.js +83 -0
- package/dist/uno.js.map +1 -0
- package/dist/utils/DnD.d.ts +38 -0
- package/package.json +115 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, getCurrentInstance as c, inject as l, nextTick as u, normalizeClass as d, onBeforeUnmount as f, onMounted as p, openBlock as m, provide as h, reactive as g, ref as _, renderList as v, renderSlot as y, unref as b, useSlots as x, vShow as S, watch as C, withDirectives as w, withModifiers as T } from "vue";
|
|
3
|
+
import { clsx as E } from "clsx";
|
|
4
|
+
//#region src/tab/TabPane.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var D = ["id", "aria-labelledby"], O = /* @__PURE__ */ s({
|
|
6
|
+
__name: "TabPane",
|
|
7
|
+
props: {
|
|
8
|
+
name: { default: void 0 },
|
|
9
|
+
label: { default: void 0 },
|
|
10
|
+
disabled: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: !1
|
|
13
|
+
},
|
|
14
|
+
closable: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
lazy: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(e) {
|
|
24
|
+
let t = 0, a = e, o = c(), s = l(N), u = x(), h = t++, g = _(!1), v = n(() => a.name ?? h), T = n(() => s?.activeValue.value === v.value), E = n(() => !a.lazy || g.value || T.value), O = n(() => B({ active: T.value })), k = () => ({
|
|
25
|
+
uid: o?.uid ?? h,
|
|
26
|
+
order: h,
|
|
27
|
+
name: v.value,
|
|
28
|
+
label: a.label,
|
|
29
|
+
disabled: a.disabled,
|
|
30
|
+
closable: a.closable,
|
|
31
|
+
lazy: a.lazy,
|
|
32
|
+
slots: u
|
|
33
|
+
});
|
|
34
|
+
return C(T, (e) => {
|
|
35
|
+
e && (g.value = !0);
|
|
36
|
+
}), C(() => [
|
|
37
|
+
v.value,
|
|
38
|
+
a.label,
|
|
39
|
+
a.disabled,
|
|
40
|
+
a.closable,
|
|
41
|
+
a.lazy
|
|
42
|
+
], () => {
|
|
43
|
+
!s || !o || s.updatePane(o.uid, k());
|
|
44
|
+
}), p(() => {
|
|
45
|
+
!s || !o || (T.value && (g.value = !0), s.registerPane(k()));
|
|
46
|
+
}), f(() => {
|
|
47
|
+
!s || !o || s.unregisterPane(o.uid);
|
|
48
|
+
}), (e, t) => E.value ? w((m(), i("div", {
|
|
49
|
+
key: 0,
|
|
50
|
+
id: b(s)?.getPanelId(v.value),
|
|
51
|
+
role: "tabpanel",
|
|
52
|
+
"aria-labelledby": b(s)?.getTabId(v.value),
|
|
53
|
+
class: d(O.value),
|
|
54
|
+
tabindex: "0"
|
|
55
|
+
}, [y(e.$slots, "default")], 10, D)), [[S, T.value]]) : r("", !0);
|
|
56
|
+
}
|
|
57
|
+
}), k = ["aria-label", "aria-orientation"], A = [
|
|
58
|
+
"id",
|
|
59
|
+
"aria-selected",
|
|
60
|
+
"aria-disabled",
|
|
61
|
+
"aria-controls",
|
|
62
|
+
"tabindex",
|
|
63
|
+
"onClick",
|
|
64
|
+
"onKeydown"
|
|
65
|
+
], j = { class: "inline-flex min-w-0 items-center justify-center truncate" }, ee = ["aria-label", "onClick"], te = ["aria-label"], M = /* @__PURE__ */ s({
|
|
66
|
+
__name: "Tabs",
|
|
67
|
+
props: {
|
|
68
|
+
modelValue: { default: void 0 },
|
|
69
|
+
defaultValue: { default: void 0 },
|
|
70
|
+
type: { default: "line" },
|
|
71
|
+
tabPosition: { default: "top" },
|
|
72
|
+
size: { default: "md" },
|
|
73
|
+
stretch: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: !1
|
|
76
|
+
},
|
|
77
|
+
closable: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
addable: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !1
|
|
84
|
+
},
|
|
85
|
+
editable: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: !1
|
|
88
|
+
},
|
|
89
|
+
padded: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: !0
|
|
92
|
+
},
|
|
93
|
+
beforeLeave: {
|
|
94
|
+
type: Function,
|
|
95
|
+
default: void 0
|
|
96
|
+
},
|
|
97
|
+
ariaLabel: { default: "标签页" },
|
|
98
|
+
addAriaLabel: { default: "新增标签" },
|
|
99
|
+
closeAriaLabel: { default: "关闭标签" }
|
|
100
|
+
},
|
|
101
|
+
emits: [
|
|
102
|
+
"update:modelValue",
|
|
103
|
+
"tab-click",
|
|
104
|
+
"tab-change",
|
|
105
|
+
"tab-add",
|
|
106
|
+
"tab-remove",
|
|
107
|
+
"edit"
|
|
108
|
+
],
|
|
109
|
+
setup(e, { expose: c, emit: l }) {
|
|
110
|
+
let f = e, p = l, x = `ui-tabs-${Math.random().toString(36).slice(2, 9)}`, S = g(/* @__PURE__ */ new Map()), w = _(f.defaultValue), D = _(!1), O = /* @__PURE__ */ new Map(), M = n(() => Array.from(S.values()).sort((e, t) => e.order - t.order)), B = n(() => f.modelValue === void 0 ? w.value : f.modelValue), V = n(() => f.tabPosition === "left" || f.tabPosition === "right"), H = n(() => f.addable || f.editable), ne = n(() => P({
|
|
111
|
+
type: f.type,
|
|
112
|
+
tabPosition: f.tabPosition
|
|
113
|
+
})), U = n(() => F({
|
|
114
|
+
type: f.type,
|
|
115
|
+
tabPosition: f.tabPosition
|
|
116
|
+
})), W = n(() => I({ tabPosition: f.tabPosition })), re = n(() => z({
|
|
117
|
+
type: f.type,
|
|
118
|
+
tabPosition: f.tabPosition,
|
|
119
|
+
padded: f.padded
|
|
120
|
+
})), G = (e) => ({
|
|
121
|
+
name: e.name,
|
|
122
|
+
label: e.label,
|
|
123
|
+
disabled: e.disabled,
|
|
124
|
+
closable: e.closable,
|
|
125
|
+
lazy: e.lazy,
|
|
126
|
+
index: M.value.findIndex((t) => t.uid === e.uid)
|
|
127
|
+
});
|
|
128
|
+
function K(e) {
|
|
129
|
+
return B.value === e.name;
|
|
130
|
+
}
|
|
131
|
+
function q(e) {
|
|
132
|
+
return !e.disabled && (f.closable || f.editable || e.closable);
|
|
133
|
+
}
|
|
134
|
+
let J = s({
|
|
135
|
+
name: "PaneLabel",
|
|
136
|
+
props: { pane: {
|
|
137
|
+
type: Object,
|
|
138
|
+
required: !0
|
|
139
|
+
} },
|
|
140
|
+
setup(e) {
|
|
141
|
+
return () => e.pane.slots.label?.({
|
|
142
|
+
active: K(e.pane),
|
|
143
|
+
pane: G(e.pane)
|
|
144
|
+
}) ?? e.pane.label ?? String(e.pane.name);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
function Y(e) {
|
|
148
|
+
return `${x}-tab-${String(e)}`;
|
|
149
|
+
}
|
|
150
|
+
function X(e) {
|
|
151
|
+
return `${x}-panel-${String(e)}`;
|
|
152
|
+
}
|
|
153
|
+
function ie(e) {
|
|
154
|
+
S.set(e.uid, e);
|
|
155
|
+
}
|
|
156
|
+
function ae(e, t) {
|
|
157
|
+
S.set(e, t);
|
|
158
|
+
}
|
|
159
|
+
function oe(e) {
|
|
160
|
+
let t = S.get(e);
|
|
161
|
+
t && O.delete(t.name), S.delete(e);
|
|
162
|
+
}
|
|
163
|
+
h(N, {
|
|
164
|
+
activeValue: B,
|
|
165
|
+
registerPane: ie,
|
|
166
|
+
updatePane: ae,
|
|
167
|
+
unregisterPane: oe,
|
|
168
|
+
getTabId: Y,
|
|
169
|
+
getPanelId: X
|
|
170
|
+
});
|
|
171
|
+
function se() {
|
|
172
|
+
let e = M.value;
|
|
173
|
+
return e.find((e) => e.name === f.defaultValue && !e.disabled)?.name ?? e.find((e) => !e.disabled)?.name ?? e[0]?.name;
|
|
174
|
+
}
|
|
175
|
+
C(M, () => {
|
|
176
|
+
f.modelValue === void 0 && (B.value !== void 0 && M.value.some((e) => e.name === B.value) || (w.value = se()));
|
|
177
|
+
}, {
|
|
178
|
+
immediate: !0,
|
|
179
|
+
flush: "post"
|
|
180
|
+
});
|
|
181
|
+
function ce(e, t) {
|
|
182
|
+
return L({
|
|
183
|
+
type: f.type,
|
|
184
|
+
tabPosition: f.tabPosition,
|
|
185
|
+
size: f.size,
|
|
186
|
+
active: K(e),
|
|
187
|
+
disabled: e.disabled,
|
|
188
|
+
stretch: !1,
|
|
189
|
+
first: t === 0,
|
|
190
|
+
last: t === M.value.length - 1
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function le(e, t) {
|
|
194
|
+
if (!t) {
|
|
195
|
+
O.delete(e);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
let n = t instanceof Element ? t : t.$el;
|
|
199
|
+
n && O.set(e, n);
|
|
200
|
+
}
|
|
201
|
+
async function Z(e) {
|
|
202
|
+
let t = B.value;
|
|
203
|
+
if (Object.is(e, t)) return !0;
|
|
204
|
+
if (D.value) return !1;
|
|
205
|
+
D.value = !0;
|
|
206
|
+
try {
|
|
207
|
+
return await f.beforeLeave?.(e, t) === !1 ? !1 : (f.modelValue === void 0 && (w.value = e), p("update:modelValue", e), p("tab-change", e), !0);
|
|
208
|
+
} finally {
|
|
209
|
+
D.value = !1;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async function ue(e, t) {
|
|
213
|
+
e.disabled || (p("tab-click", G(e), t), await Z(e.name));
|
|
214
|
+
}
|
|
215
|
+
async function Q(e, t) {
|
|
216
|
+
let n = M.value.filter((e) => !e.disabled);
|
|
217
|
+
if (!n.length) return;
|
|
218
|
+
t.preventDefault();
|
|
219
|
+
let r = n[(e + n.length) % n.length];
|
|
220
|
+
if (!await Z(r.name)) return;
|
|
221
|
+
await u();
|
|
222
|
+
let i = O.get(r.name);
|
|
223
|
+
i instanceof HTMLElement && i.focus();
|
|
224
|
+
}
|
|
225
|
+
function de(e, t) {
|
|
226
|
+
if (e.disabled) return;
|
|
227
|
+
let n = M.value.filter((e) => !e.disabled), r = n.findIndex((t) => t.uid === e.uid);
|
|
228
|
+
if (V.value && t.key === "ArrowDown" || !V.value && t.key === "ArrowRight") {
|
|
229
|
+
Q(r + 1, t);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (V.value && t.key === "ArrowUp" || !V.value && t.key === "ArrowLeft") {
|
|
233
|
+
Q(r - 1, t);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (t.key === "Home") {
|
|
237
|
+
Q(0, t);
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
if (t.key === "End") {
|
|
241
|
+
Q(n.length - 1, t);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
(t.key === "Delete" || t.key === "Backspace") && q(e) && (t.preventDefault(), $(e));
|
|
245
|
+
}
|
|
246
|
+
function fe() {
|
|
247
|
+
p("tab-add"), p("edit", void 0, "add");
|
|
248
|
+
}
|
|
249
|
+
function $(e) {
|
|
250
|
+
p("tab-remove", e.name), p("edit", e.name, "remove");
|
|
251
|
+
}
|
|
252
|
+
return c({
|
|
253
|
+
panes: M,
|
|
254
|
+
activeValue: B,
|
|
255
|
+
setActiveValue: Z
|
|
256
|
+
}), (n, s) => (m(), i("div", {
|
|
257
|
+
"data-ui-tabs": "true",
|
|
258
|
+
class: d(ne.value)
|
|
259
|
+
}, [a("div", { class: d(U.value) }, [a("div", {
|
|
260
|
+
class: d(b(E)(W.value, H.value && "pr-0")),
|
|
261
|
+
role: "tablist",
|
|
262
|
+
"aria-label": e.ariaLabel,
|
|
263
|
+
"aria-orientation": V.value ? "vertical" : "horizontal"
|
|
264
|
+
}, [(m(!0), i(t, null, v(M.value, (t, n) => (m(), i("div", {
|
|
265
|
+
id: Y(t.name),
|
|
266
|
+
key: t.uid,
|
|
267
|
+
ref_for: !0,
|
|
268
|
+
ref: (e) => le(t.name, e),
|
|
269
|
+
role: "tab",
|
|
270
|
+
"aria-selected": K(t),
|
|
271
|
+
"aria-disabled": t.disabled,
|
|
272
|
+
"aria-controls": X(t.name),
|
|
273
|
+
tabindex: K(t) && !t.disabled ? 0 : -1,
|
|
274
|
+
class: d(ce(t, n)),
|
|
275
|
+
onClick: (e) => ue(t, e),
|
|
276
|
+
onKeydown: (e) => de(t, e)
|
|
277
|
+
}, [a("span", j, [o(b(J), { pane: t }, null, 8, ["pane"])]), q(t) ? (m(), i("button", {
|
|
278
|
+
key: 0,
|
|
279
|
+
type: "button",
|
|
280
|
+
tabindex: "-1",
|
|
281
|
+
"aria-label": `${e.closeAriaLabel} ${t.label ?? t.name}`,
|
|
282
|
+
class: "-mr-1 inline-flex size-5 shrink-0 items-center justify-center rounded-full text-current opacity-60 transition-opacity hover:bg-current/10 hover:opacity-100",
|
|
283
|
+
onClick: T((e) => $(t), ["stop"]),
|
|
284
|
+
onKeydown: s[0] ||= T(() => {}, ["stop"])
|
|
285
|
+
}, [...s[1] ||= [a("span", { class: "i-lucide:x size-3.5" }, null, -1)]], 40, ee)) : r("", !0)], 42, A))), 128)), H.value ? (m(), i("button", {
|
|
286
|
+
key: 0,
|
|
287
|
+
type: "button",
|
|
288
|
+
"aria-label": e.addAriaLabel,
|
|
289
|
+
class: d(b(R)({
|
|
290
|
+
tabPosition: e.tabPosition,
|
|
291
|
+
size: e.size
|
|
292
|
+
})),
|
|
293
|
+
onClick: fe
|
|
294
|
+
}, [...s[2] ||= [a("span", { class: "i-lucide:plus" }, null, -1)]], 10, te)) : r("", !0)], 10, k)], 2), a("div", { class: d(re.value) }, [y(n.$slots, "default")], 2)], 2));
|
|
295
|
+
}
|
|
296
|
+
}), N = Symbol("ui-tabs-context"), P = e("min-w-0 text-primary", {
|
|
297
|
+
variants: {
|
|
298
|
+
type: {
|
|
299
|
+
line: "",
|
|
300
|
+
card: "",
|
|
301
|
+
"border-card": "overflow-hidden rounded-md border border-medium bg-primary"
|
|
302
|
+
},
|
|
303
|
+
tabPosition: {
|
|
304
|
+
top: "flex flex-col",
|
|
305
|
+
bottom: "flex flex-col",
|
|
306
|
+
left: "flex flex-row",
|
|
307
|
+
right: "flex flex-row"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
defaultVariants: {
|
|
311
|
+
type: "line",
|
|
312
|
+
tabPosition: "top"
|
|
313
|
+
}
|
|
314
|
+
}), F = e("relative shrink-0", {
|
|
315
|
+
variants: {
|
|
316
|
+
type: {
|
|
317
|
+
line: "",
|
|
318
|
+
card: "",
|
|
319
|
+
"border-card": "bg-secondary/60"
|
|
320
|
+
},
|
|
321
|
+
tabPosition: {
|
|
322
|
+
top: "border-b border-medium",
|
|
323
|
+
bottom: "order-2 border-t border-medium",
|
|
324
|
+
left: "border-r border-medium",
|
|
325
|
+
right: "order-2 border-l border-medium"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
defaultVariants: {
|
|
329
|
+
type: "line",
|
|
330
|
+
tabPosition: "top"
|
|
331
|
+
}
|
|
332
|
+
}), I = e("relative flex min-w-0", {
|
|
333
|
+
variants: { tabPosition: {
|
|
334
|
+
top: "flex-row",
|
|
335
|
+
bottom: "flex-row",
|
|
336
|
+
left: "flex-col",
|
|
337
|
+
right: "flex-col"
|
|
338
|
+
} },
|
|
339
|
+
defaultVariants: { tabPosition: "top" }
|
|
340
|
+
}), L = e("relative inline-flex min-w-0 items-center justify-center gap-1.5 whitespace-nowrap border border-transparent font-medium outline-none transition-[color] duration-150 focus-visible:ring-2 focus-visible:ring-brand-400 focus-visible:ring-offset-1 focus-visible:ring-offset-primary", {
|
|
341
|
+
variants: {
|
|
342
|
+
type: {
|
|
343
|
+
line: "",
|
|
344
|
+
card: "",
|
|
345
|
+
"border-card": ""
|
|
346
|
+
},
|
|
347
|
+
tabPosition: {
|
|
348
|
+
top: "",
|
|
349
|
+
bottom: "",
|
|
350
|
+
left: "",
|
|
351
|
+
right: ""
|
|
352
|
+
},
|
|
353
|
+
size: {
|
|
354
|
+
sm: "h-8 pl-[var(--ui-tab-pl,var(--ui-tab-px))] pr-[var(--ui-tab-pr,var(--ui-tab-px))] pt-[var(--ui-tab-pt,var(--ui-tab-py))] pb-[var(--ui-tab-pb,var(--ui-tab-py))] text-xs/5 [--ui-tab-px:0.75rem] [--ui-tab-py:0rem]",
|
|
355
|
+
md: "h-10 pl-[var(--ui-tab-pl,var(--ui-tab-px))] pr-[var(--ui-tab-pr,var(--ui-tab-px))] pt-[var(--ui-tab-pt,var(--ui-tab-py))] pb-[var(--ui-tab-pb,var(--ui-tab-py))] text-sm/5 [--ui-tab-px:1rem] [--ui-tab-py:0rem]",
|
|
356
|
+
lg: "h-12 pl-[var(--ui-tab-pl,var(--ui-tab-px))] pr-[var(--ui-tab-pr,var(--ui-tab-px))] pt-[var(--ui-tab-pt,var(--ui-tab-py))] pb-[var(--ui-tab-pb,var(--ui-tab-py))] text-base/6 [--ui-tab-px:1.25rem] [--ui-tab-py:0rem]"
|
|
357
|
+
},
|
|
358
|
+
active: {
|
|
359
|
+
true: "",
|
|
360
|
+
false: ""
|
|
361
|
+
},
|
|
362
|
+
disabled: {
|
|
363
|
+
true: "cursor-not-allowed text-tertiary opacity-50",
|
|
364
|
+
false: "cursor-pointer"
|
|
365
|
+
},
|
|
366
|
+
stretch: {
|
|
367
|
+
true: "flex-1",
|
|
368
|
+
false: ""
|
|
369
|
+
},
|
|
370
|
+
first: {
|
|
371
|
+
true: "",
|
|
372
|
+
false: ""
|
|
373
|
+
},
|
|
374
|
+
last: {
|
|
375
|
+
true: "",
|
|
376
|
+
false: ""
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
compoundVariants: [
|
|
380
|
+
{
|
|
381
|
+
active: !1,
|
|
382
|
+
disabled: !1,
|
|
383
|
+
class: "text-secondary hover:bg-secondary/70 hover:text-brand-500"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
active: !0,
|
|
387
|
+
disabled: !1,
|
|
388
|
+
class: "text-brand-500 dark:text-brand-400"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
type: "line",
|
|
392
|
+
tabPosition: "top",
|
|
393
|
+
active: !0,
|
|
394
|
+
class: "-mb-px after:content-empty after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-brand-500"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
type: "line",
|
|
398
|
+
tabPosition: "bottom",
|
|
399
|
+
active: !0,
|
|
400
|
+
class: "-mt-px after:content-empty after:absolute after:inset-x-0 after:-top-px after:h-0.5 after:bg-brand-500"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
type: "line",
|
|
404
|
+
tabPosition: "left",
|
|
405
|
+
active: !0,
|
|
406
|
+
class: "-mr-px after:content-empty after:absolute after:inset-y-0 after:-right-px after:w-0.5 after:bg-brand-500"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
type: "line",
|
|
410
|
+
tabPosition: "right",
|
|
411
|
+
active: !0,
|
|
412
|
+
class: "-ml-px after:content-empty after:absolute after:inset-y-0 after:-left-px after:w-0.5 after:bg-brand-500"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
type: "card",
|
|
416
|
+
tabPosition: "top",
|
|
417
|
+
class: "-ml-px border-medium border-b-0"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
type: "card",
|
|
421
|
+
tabPosition: "bottom",
|
|
422
|
+
class: "-ml-px border-medium border-t-0"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
type: "card",
|
|
426
|
+
tabPosition: "left",
|
|
427
|
+
class: "-mt-px border-medium border-r-0"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
type: "card",
|
|
431
|
+
tabPosition: "right",
|
|
432
|
+
class: "-mt-px border-medium border-l-0"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
type: "card",
|
|
436
|
+
tabPosition: "top",
|
|
437
|
+
first: !0,
|
|
438
|
+
class: "ml-0 rounded-tl-md"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
type: "card",
|
|
442
|
+
tabPosition: "top",
|
|
443
|
+
last: !0,
|
|
444
|
+
class: "rounded-tr-md"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
type: "card",
|
|
448
|
+
tabPosition: "bottom",
|
|
449
|
+
first: !0,
|
|
450
|
+
class: "ml-0 rounded-bl-md"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
type: "card",
|
|
454
|
+
tabPosition: "bottom",
|
|
455
|
+
last: !0,
|
|
456
|
+
class: "rounded-br-md"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
type: "card",
|
|
460
|
+
tabPosition: "left",
|
|
461
|
+
first: !0,
|
|
462
|
+
class: "mt-0 rounded-tl-md"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
type: "card",
|
|
466
|
+
tabPosition: "left",
|
|
467
|
+
last: !0,
|
|
468
|
+
class: "rounded-bl-md"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
type: "card",
|
|
472
|
+
tabPosition: "right",
|
|
473
|
+
first: !0,
|
|
474
|
+
class: "mt-0 rounded-tr-md"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
type: "card",
|
|
478
|
+
tabPosition: "right",
|
|
479
|
+
last: !0,
|
|
480
|
+
class: "rounded-br-md"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
type: "card",
|
|
484
|
+
tabPosition: "top",
|
|
485
|
+
active: !0,
|
|
486
|
+
class: "z-1 -mb-px bg-primary after:content-empty after:absolute after:inset-x-0 after:-bottom-px after:h-px after:bg-primary"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
type: "card",
|
|
490
|
+
tabPosition: "bottom",
|
|
491
|
+
active: !0,
|
|
492
|
+
class: "z-1 -mt-px bg-primary after:content-empty after:absolute after:inset-x-0 after:-top-px after:h-px after:bg-primary"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
type: "card",
|
|
496
|
+
tabPosition: "left",
|
|
497
|
+
active: !0,
|
|
498
|
+
class: "z-1 -mr-px bg-primary after:content-empty after:absolute after:inset-y-0 after:-right-px after:w-px after:bg-primary"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
type: "card",
|
|
502
|
+
tabPosition: "right",
|
|
503
|
+
active: !0,
|
|
504
|
+
class: "z-1 -ml-px bg-primary after:content-empty after:absolute after:inset-y-0 after:-left-px after:w-px after:bg-primary"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
type: "card",
|
|
508
|
+
active: !1,
|
|
509
|
+
disabled: !1,
|
|
510
|
+
class: "bg-secondary/50 hover:bg-secondary/70"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
type: "border-card",
|
|
514
|
+
active: !0,
|
|
515
|
+
class: "bg-primary text-brand-500 dark:text-brand-400"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
type: "border-card",
|
|
519
|
+
tabPosition: "top",
|
|
520
|
+
active: !0,
|
|
521
|
+
class: "z-1 -mb-px border-x border-y-0 border-medium"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
type: "border-card",
|
|
525
|
+
tabPosition: "bottom",
|
|
526
|
+
active: !0,
|
|
527
|
+
class: "z-1 -mt-px border-x border-y-0 border-medium"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
type: "border-card",
|
|
531
|
+
tabPosition: "left",
|
|
532
|
+
active: !0,
|
|
533
|
+
class: "z-1 -mr-px border-x-0 border-y border-medium [--ui-tab-pl:calc(var(--ui-tab-px)+1px)] [--ui-tab-pr:calc(var(--ui-tab-px)+1px)]"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
type: "border-card",
|
|
537
|
+
tabPosition: "right",
|
|
538
|
+
active: !0,
|
|
539
|
+
class: "z-1 -ml-px border-x-0 border-y border-medium [--ui-tab-pl:calc(var(--ui-tab-px)+1px)] [--ui-tab-pr:calc(var(--ui-tab-px)+1px)]"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
type: "border-card",
|
|
543
|
+
tabPosition: "top",
|
|
544
|
+
active: !0,
|
|
545
|
+
first: !0,
|
|
546
|
+
class: "border-l-0 [--ui-tab-pl:calc(var(--ui-tab-px)+1px)]"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
type: "border-card",
|
|
550
|
+
tabPosition: "bottom",
|
|
551
|
+
active: !0,
|
|
552
|
+
first: !0,
|
|
553
|
+
class: "border-l-0 [--ui-tab-pl:calc(var(--ui-tab-px)+1px)]"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
type: "border-card",
|
|
557
|
+
tabPosition: "left",
|
|
558
|
+
active: !0,
|
|
559
|
+
first: !0,
|
|
560
|
+
class: "border-t-0 [--ui-tab-pt:calc(var(--ui-tab-py)+1px)]"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
type: "border-card",
|
|
564
|
+
tabPosition: "right",
|
|
565
|
+
active: !0,
|
|
566
|
+
first: !0,
|
|
567
|
+
class: "border-t-0 [--ui-tab-pt:calc(var(--ui-tab-py)+1px)]"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
type: "border-card",
|
|
571
|
+
active: !1,
|
|
572
|
+
disabled: !1,
|
|
573
|
+
class: "text-secondary hover:bg-primary/80"
|
|
574
|
+
}
|
|
575
|
+
],
|
|
576
|
+
defaultVariants: {
|
|
577
|
+
type: "line",
|
|
578
|
+
tabPosition: "top",
|
|
579
|
+
size: "md",
|
|
580
|
+
active: !1,
|
|
581
|
+
disabled: !1,
|
|
582
|
+
stretch: !1,
|
|
583
|
+
first: !1,
|
|
584
|
+
last: !1
|
|
585
|
+
}
|
|
586
|
+
}), R = e("inline-flex shrink-0 items-center justify-center border border-transparent text-tertiary outline-none transition-colors duration-150 hover:bg-secondary hover:text-brand-500 focus-visible:ring-2 focus-visible:ring-brand-400 focus-visible:ring-offset-1 focus-visible:ring-offset-primary", {
|
|
587
|
+
variants: {
|
|
588
|
+
tabPosition: {
|
|
589
|
+
top: "",
|
|
590
|
+
bottom: "",
|
|
591
|
+
left: "",
|
|
592
|
+
right: ""
|
|
593
|
+
},
|
|
594
|
+
size: {
|
|
595
|
+
sm: "h-8 w-8 text-sm",
|
|
596
|
+
md: "h-10 w-10 text-base",
|
|
597
|
+
lg: "h-12 w-12 text-lg"
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
defaultVariants: {
|
|
601
|
+
tabPosition: "top",
|
|
602
|
+
size: "md"
|
|
603
|
+
}
|
|
604
|
+
}), z = e("min-w-0 flex-1", {
|
|
605
|
+
variants: {
|
|
606
|
+
type: {
|
|
607
|
+
line: "",
|
|
608
|
+
card: "",
|
|
609
|
+
"border-card": "bg-primary"
|
|
610
|
+
},
|
|
611
|
+
tabPosition: {
|
|
612
|
+
top: "pt-4",
|
|
613
|
+
bottom: "order-1 pb-4",
|
|
614
|
+
left: "pl-4",
|
|
615
|
+
right: "order-1 pr-4"
|
|
616
|
+
},
|
|
617
|
+
padded: {
|
|
618
|
+
true: "",
|
|
619
|
+
false: "p-0!"
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
compoundVariants: [
|
|
623
|
+
{
|
|
624
|
+
type: "border-card",
|
|
625
|
+
tabPosition: "top",
|
|
626
|
+
padded: !0,
|
|
627
|
+
class: "p-4"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
type: "border-card",
|
|
631
|
+
tabPosition: "bottom",
|
|
632
|
+
padded: !0,
|
|
633
|
+
class: "p-4"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
type: "border-card",
|
|
637
|
+
tabPosition: "left",
|
|
638
|
+
padded: !0,
|
|
639
|
+
class: "p-4"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
type: "border-card",
|
|
643
|
+
tabPosition: "right",
|
|
644
|
+
padded: !0,
|
|
645
|
+
class: "p-4"
|
|
646
|
+
}
|
|
647
|
+
],
|
|
648
|
+
defaultVariants: {
|
|
649
|
+
type: "line",
|
|
650
|
+
tabPosition: "top",
|
|
651
|
+
padded: !0
|
|
652
|
+
}
|
|
653
|
+
}), B = e("min-w-0 text-sm/6 text-secondary outline-none", {
|
|
654
|
+
variants: { active: {
|
|
655
|
+
true: "",
|
|
656
|
+
false: ""
|
|
657
|
+
} },
|
|
658
|
+
defaultVariants: { active: !1 }
|
|
659
|
+
});
|
|
660
|
+
//#endregion
|
|
661
|
+
export { N as a, P as c, z as i, M as l, B as n, F as o, L as r, I as s, R as t, O as u };
|
|
662
|
+
|
|
663
|
+
//# sourceMappingURL=tab-Dxfg1_To.js.map
|