@pantograph/vue 0.28.5 → 0.28.6
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/Avatar/Avatar.d.ts +0 -2
- package/dist/Avatar/Avatar.model.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar/index.umd.cjs +1 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-MQITXCju.js +202 -0
- package/dist/Avatar.vue_vue_type_style_index_0_lang-iFQme6cr.js +1 -0
- package/dist/AvatarGroup/AvatarGroup.d.ts +6 -5
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/AvatarGroup/index.umd.cjs +1 -1
- package/dist/Chip/Chip.d.ts +1 -0
- package/dist/Chip/Chip.model.d.ts +1 -1
- package/dist/Chip/index.js +1 -1
- package/dist/Chip/index.umd.cjs +1 -1
- package/dist/{Chip.vue_vue_type_style_index_0_lang-C5g6ivHU.js → Chip.vue_vue_type_style_index_0_lang-CGBRYOsr.js} +25 -25
- package/dist/Chip.vue_vue_type_style_index_0_lang-Cr9OkEzs.js +1 -0
- package/dist/ChipGroup/ChipGroup.d.ts +1 -0
- package/dist/ChipGroup/index.js +1 -1
- package/dist/ChipGroup/index.umd.cjs +1 -1
- package/dist/ColorPicker/index.js +1 -1
- package/dist/ColorPicker/index.umd.cjs +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-CqosPpAC.js → ColorPicker.vue_vue_type_style_index_0_lang-BsPMp6nY.js} +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-BXzoWqMJ.js → ColorPicker.vue_vue_type_style_index_0_lang-k4zhYbY2.js} +1 -1
- package/dist/ColorSwatchGroup/index.js +1 -1
- package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-Ckk-UUhA.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-Bhy0Nsts.js} +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-bvjeYaZB.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-CsFGOy9g.js} +1 -1
- package/dist/Combobox/index.js +1 -1
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/{Combobox.vue_vue_type_style_index_0_lang-DwX86qXK.js → Combobox.vue_vue_type_style_index_0_lang-BOVytQ70.js} +1 -1
- package/dist/{Combobox.vue_vue_type_style_index_0_lang-lDMxlocK.js → Combobox.vue_vue_type_style_index_0_lang-CXwlC1VR.js} +2 -2
- package/dist/Comment/index.js +3 -3
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/GOPicker/index.js +1 -1
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-CeCZeMIy.js → GOPicker.vue_vue_type_style_index_0_lang-B79spkzQ.js} +1 -1
- package/dist/{GOPicker.vue_vue_type_style_index_0_lang-D2ZnoKpk.js → GOPicker.vue_vue_type_style_index_0_lang-BikulE0p.js} +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/Select/index.umd.cjs +1 -1
- package/dist/{Select.vue_vue_type_style_index_0_lang-u2mkyMPk.js → Select.vue_vue_type_style_index_0_lang-BWQI_Gdd.js} +1 -1
- package/dist/{Select.vue_vue_type_style_index_0_lang-DzGpei7j.js → Select.vue_vue_type_style_index_0_lang-CNm59A4k.js} +1 -1
- package/dist/TabContent.vue_vue_type_script_setup_true_lang-BBb-wV7s.js +1 -0
- package/dist/TabContent.vue_vue_type_script_setup_true_lang-D0L4W1At.js +364 -0
- package/dist/Tabs/TabList.d.ts +1 -276
- package/dist/Tabs/index.js +1 -1
- package/dist/Tabs/index.umd.cjs +1 -1
- package/dist/index.js +8 -8
- package/dist/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/package.json +1 -1
- package/dist/Avatar.vue_vue_type_style_index_0_lang-CS0wzmEg.js +0 -200
- package/dist/Avatar.vue_vue_type_style_index_0_lang-DtvtisQt.js +0 -1
- package/dist/Chip.vue_vue_type_style_index_0_lang-AeVPgAnJ.js +0 -1
- package/dist/TabContent.vue_vue_type_script_setup_true_lang-CoRnMTmp.js +0 -378
- package/dist/TabContent.vue_vue_type_script_setup_true_lang-Cz7tqTyz.js +0 -1
package/package.json
CHANGED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import { defineComponent as O, useSlots as F, computed as o, createElementBlock as y, openBlock as c, normalizeClass as v, unref as t, createVNode as I, h as x, createBlock as A, withCtx as B, createCommentVNode as _, Fragment as R, mergeProps as T, renderSlot as b, createTextVNode as $, toDisplayString as w } from "vue";
|
|
2
|
-
import { createContext as H, useEmitAsProps as J, AvatarRoot as K, AvatarImage as Q, AvatarFallback as U } from "reka-ui";
|
|
3
|
-
import { getComponentOptions as j, getBemBlock as q, getBemElement as f, generateVariantClassList as d, normCls as P } from "@pantograph/utils";
|
|
4
|
-
import { cva as D } from "class-variance-authority";
|
|
5
|
-
import { flattenChildren as W } from "@pantograph/utils-vue";
|
|
6
|
-
import { _ as X } from "./HoverCard.vue_vue_type_style_index_0_lang-DOwcNfdp.js";
|
|
7
|
-
import "./Popover.vue_vue_type_style_index_0_lang-CWM6Krh-.js";
|
|
8
|
-
import { _ as Y } from "./Icon.vue_vue_type_style_index_0_lang-BUxhmWxU.js";
|
|
9
|
-
import { _ as Z } from "./Indicator.vue_vue_type_script_setup_true_lang-qbXRbfSe.js";
|
|
10
|
-
const [ee, te] = H("AvatarGroup"), pe = /* @__PURE__ */ O({
|
|
11
|
-
...j("AvatarGroup"),
|
|
12
|
-
__name: "AvatarGroup",
|
|
13
|
-
props: {
|
|
14
|
-
class: {},
|
|
15
|
-
gutter: { type: Boolean },
|
|
16
|
-
size: {},
|
|
17
|
-
shape: {},
|
|
18
|
-
popoverProps: {},
|
|
19
|
-
maxCount: {},
|
|
20
|
-
noPopover: { type: Boolean }
|
|
21
|
-
},
|
|
22
|
-
setup(C) {
|
|
23
|
-
const a = C, g = F(), r = o(() => a.size), s = o(() => a.shape), S = q("avatar"), h = f(S, "group"), z = D(h, {
|
|
24
|
-
variants: {
|
|
25
|
-
gutter: d("gutter", h)
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
te({
|
|
29
|
-
size: r,
|
|
30
|
-
shape: s
|
|
31
|
-
});
|
|
32
|
-
const n = o(() => a.maxCount ? Number(a.maxCount) : 0), i = o(
|
|
33
|
-
() => z({
|
|
34
|
-
gutter: a.gutter
|
|
35
|
-
})
|
|
36
|
-
), m = o(() => {
|
|
37
|
-
switch (a.size) {
|
|
38
|
-
case "2xsm":
|
|
39
|
-
case "xsm":
|
|
40
|
-
case "sm":
|
|
41
|
-
return "sm";
|
|
42
|
-
case "lg":
|
|
43
|
-
case "xlg":
|
|
44
|
-
return "lg";
|
|
45
|
-
default:
|
|
46
|
-
return "md";
|
|
47
|
-
}
|
|
48
|
-
}), k = () => {
|
|
49
|
-
const l = W(g.default ? g.default() : []), p = () => x(se, { text: `+${l.length - n.value}` });
|
|
50
|
-
return n.value >= 1 && l.length > n.value ? [
|
|
51
|
-
...l.filter((e, u) => u < n.value),
|
|
52
|
-
a.noPopover ? p() : x(
|
|
53
|
-
X,
|
|
54
|
-
{
|
|
55
|
-
size: m.value,
|
|
56
|
-
...a.popoverProps ?? {}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
default: p,
|
|
60
|
-
content: () => x(
|
|
61
|
-
"div",
|
|
62
|
-
{ class: P(i.value, a.class) },
|
|
63
|
-
{
|
|
64
|
-
default: () => l.filter((e, u) => u >= n.value)
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
] : l;
|
|
70
|
-
};
|
|
71
|
-
return (l, p) => (c(), y("div", {
|
|
72
|
-
class: v(t(P)(i.value, a.class))
|
|
73
|
-
}, [
|
|
74
|
-
I(k, { maxCount: l.maxCount }, null, 8, ["maxCount"])
|
|
75
|
-
], 2));
|
|
76
|
-
}
|
|
77
|
-
}), E = ["2xsm", "xsm", "sm", "md", "lg", "xlg"], G = ["gray", "white"], N = ["circle", "square", "rect"], V = {
|
|
78
|
-
start: "online-start",
|
|
79
|
-
end: "online-end"
|
|
80
|
-
}, se = /* @__PURE__ */ O({
|
|
81
|
-
...j("Avatar"),
|
|
82
|
-
__name: "Avatar",
|
|
83
|
-
props: {
|
|
84
|
-
src: { default: "" },
|
|
85
|
-
class: {},
|
|
86
|
-
onlineColor: { default: "lime" },
|
|
87
|
-
size: { default: "md" },
|
|
88
|
-
stroke: {},
|
|
89
|
-
shape: { default: "circle" },
|
|
90
|
-
online: { type: Boolean },
|
|
91
|
-
unExtendParent: { type: Boolean, default: !1 },
|
|
92
|
-
alt: {},
|
|
93
|
-
fallback: {},
|
|
94
|
-
text: {},
|
|
95
|
-
icon: { default: "tabler:user" },
|
|
96
|
-
onlineAlignment: { default: "start" },
|
|
97
|
-
referrerPolicy: {},
|
|
98
|
-
crossOrigin: {},
|
|
99
|
-
delayMs: {}
|
|
100
|
-
},
|
|
101
|
-
emits: ["loadingStatusChange"],
|
|
102
|
-
setup(C, { emit: a }) {
|
|
103
|
-
const g = F(), r = q("avatar"), s = C, h = J(a), z = D(r, {
|
|
104
|
-
variants: {
|
|
105
|
-
size: d(E, r),
|
|
106
|
-
stroke: d(G, r),
|
|
107
|
-
shape: d(N, r),
|
|
108
|
-
onlineAlignment: d(
|
|
109
|
-
V,
|
|
110
|
-
r
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
}), n = s.unExtendParent ? void 0 : ee({
|
|
114
|
-
size: o(() => s.size),
|
|
115
|
-
shape: o(() => s.shape)
|
|
116
|
-
}), i = o(() => (n == null ? void 0 : n.size.value) ?? s.size), m = o(() => (n == null ? void 0 : n.shape.value) ?? s.shape), k = o(() => {
|
|
117
|
-
const e = i.value && E.includes(i.value) ? i.value : "md", u = s.stroke && G.includes(s.stroke) ? s.stroke : "none", L = m.value && N.includes(m.value) ? m.value : "circle", M = V[s.onlineAlignment] ? s.onlineAlignment : "start";
|
|
118
|
-
return {
|
|
119
|
-
size: e,
|
|
120
|
-
stroke: u,
|
|
121
|
-
shape: L,
|
|
122
|
-
onlineAlignment: M
|
|
123
|
-
};
|
|
124
|
-
}), l = o(() => {
|
|
125
|
-
switch (i.value) {
|
|
126
|
-
case "lg":
|
|
127
|
-
case "xlg":
|
|
128
|
-
return "tiny";
|
|
129
|
-
default:
|
|
130
|
-
return "tinier";
|
|
131
|
-
}
|
|
132
|
-
}), p = o(() => {
|
|
133
|
-
switch (i.value) {
|
|
134
|
-
case "lg":
|
|
135
|
-
case "xlg":
|
|
136
|
-
return "sm";
|
|
137
|
-
case "xsm":
|
|
138
|
-
case "2xsm":
|
|
139
|
-
return "3xsm";
|
|
140
|
-
case "sm":
|
|
141
|
-
case "md":
|
|
142
|
-
default:
|
|
143
|
-
return "xsm";
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
return (e, u) => (c(), A(t(K), {
|
|
147
|
-
as: "div",
|
|
148
|
-
class: v(t(P)(t(z)(k.value), s.class))
|
|
149
|
-
}, {
|
|
150
|
-
default: B(() => [
|
|
151
|
-
!g.default && !e.text ? (c(), y(R, { key: 0 }, [
|
|
152
|
-
e.src ? (c(), A(t(Q), T({ key: 0 }, t(h), {
|
|
153
|
-
src: e.src,
|
|
154
|
-
alt: e.alt,
|
|
155
|
-
class: t(f)(t(r), "image")
|
|
156
|
-
}), null, 16, ["src", "alt", "class"])) : _("", !0),
|
|
157
|
-
I(t(U), {
|
|
158
|
-
class: v(t(f)(t(r), "fallback"))
|
|
159
|
-
}, {
|
|
160
|
-
default: B(() => [
|
|
161
|
-
b(e.$slots, "fallback", {}, () => [
|
|
162
|
-
e.fallback ? _("", !0) : (c(), A(t(Y), {
|
|
163
|
-
key: 0,
|
|
164
|
-
icon: e.icon,
|
|
165
|
-
size: p.value
|
|
166
|
-
}, null, 8, ["icon", "size"])),
|
|
167
|
-
$(" " + w(e.fallback), 1)
|
|
168
|
-
])
|
|
169
|
-
]),
|
|
170
|
-
_: 3
|
|
171
|
-
}, 8, ["class"])
|
|
172
|
-
], 64)) : (c(), y("span", {
|
|
173
|
-
key: 1,
|
|
174
|
-
class: v(t(f)(t(r), "image"))
|
|
175
|
-
}, [
|
|
176
|
-
b(e.$slots, "default", {}, () => [
|
|
177
|
-
$(w(e.text), 1)
|
|
178
|
-
])
|
|
179
|
-
], 2)),
|
|
180
|
-
e.online ? (c(), A(Z, {
|
|
181
|
-
key: 2,
|
|
182
|
-
color: e.onlineColor,
|
|
183
|
-
size: l.value,
|
|
184
|
-
class: v(t(f)(t(r), "online"))
|
|
185
|
-
}, null, 8, ["color", "size", "class"])) : _("", !0)
|
|
186
|
-
]),
|
|
187
|
-
_: 3
|
|
188
|
-
}, 8, ["class"]));
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
export {
|
|
192
|
-
E as A,
|
|
193
|
-
se as _,
|
|
194
|
-
G as a,
|
|
195
|
-
N as b,
|
|
196
|
-
V as c,
|
|
197
|
-
pe as d,
|
|
198
|
-
ee as i,
|
|
199
|
-
te as p
|
|
200
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),p=require("reka-ui"),t=require("@pantograph/utils"),B=require("class-variance-authority"),E=require("@pantograph/utils-vue"),q=require("./HoverCard.vue_vue_type_style_index_0_lang-B6a5M7RJ.js");require("./Popover.vue_vue_type_style_index_0_lang-w-n010qN.js");const b=require("./Icon.vue_vue_type_style_index_0_lang-DQNF7GAr.js"),N=require("./Indicator.vue_vue_type_script_setup_true_lang-g2dBu5LK.js"),[x,y]=p.createContext("AvatarGroup"),G=e.defineComponent({...t.getComponentOptions("AvatarGroup"),__name:"AvatarGroup",props:{class:{},gutter:{type:Boolean},size:{},shape:{},popoverProps:{},maxCount:{},noPopover:{type:Boolean}},setup(f){const n=f,v=e.useSlots(),o=e.computed(()=>n.size),s=e.computed(()=>n.shape),g=t.getBemBlock("avatar"),d=t.getBemElement(g,"group"),C=B.cva(d,{variants:{gutter:t.generateVariantClassList("gutter",d)}});y({size:o,shape:s});const r=e.computed(()=>n.maxCount?Number(n.maxCount):0),c=e.computed(()=>C({gutter:n.gutter})),i=e.computed(()=>{switch(n.size){case"2xsm":case"xsm":case"sm":return"sm";case"lg":case"xlg":return"lg";default:return"md"}}),k=()=>{const l=E.flattenChildren(v.default?v.default():[]),m=()=>e.h(S,{text:`+${l.length-r.value}`});return r.value>=1&&l.length>r.value?[...l.filter((a,u)=>u<r.value),n.noPopover?m():e.h(q._sfc_main,{size:i.value,...n.popoverProps??{}},{default:m,content:()=>e.h("div",{class:t.normCls(c.value,n.class)},{default:()=>l.filter((a,u)=>u>=r.value)})})]:l};return(l,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t.normCls)(c.value,n.class))},[e.createVNode(k,{maxCount:l.maxCount},null,8,["maxCount"])],2))}}),_=["2xsm","xsm","sm","md","lg","xlg"],A=["gray","white"],h=["circle","square","rect"],z={start:"online-start",end:"online-end"},S=e.defineComponent({...t.getComponentOptions("Avatar"),__name:"Avatar",props:{src:{default:""},class:{},onlineColor:{default:"lime"},size:{default:"md"},stroke:{},shape:{default:"circle"},online:{type:Boolean},unExtendParent:{type:Boolean,default:!1},alt:{},fallback:{},text:{},icon:{default:"tabler:user"},onlineAlignment:{default:"start"},referrerPolicy:{},crossOrigin:{},delayMs:{}},emits:["loadingStatusChange"],setup(f,{emit:n}){const v=e.useSlots(),o=t.getBemBlock("avatar"),s=f,g=n,d=p.useEmitAsProps(g),C=B.cva(o,{variants:{size:t.generateVariantClassList(_,o),stroke:t.generateVariantClassList(A,o),shape:t.generateVariantClassList(h,o),onlineAlignment:t.generateVariantClassList(z,o)}}),r=s.unExtendParent?void 0:x({size:e.computed(()=>s.size),shape:e.computed(()=>s.shape)}),c=e.computed(()=>(r==null?void 0:r.size.value)??s.size),i=e.computed(()=>(r==null?void 0:r.shape.value)??s.shape),k=e.computed(()=>{const a=c.value&&_.includes(c.value)?c.value:"md",u=s.stroke&&A.includes(s.stroke)?s.stroke:"none",V=i.value&&h.includes(i.value)?i.value:"circle",P=z[s.onlineAlignment]?s.onlineAlignment:"start";return{size:a,stroke:u,shape:V,onlineAlignment:P}}),l=e.computed(()=>{switch(c.value){case"lg":case"xlg":return"tiny";default:return"tinier"}}),m=e.computed(()=>{switch(c.value){case"lg":case"xlg":return"sm";case"xsm":case"2xsm":return"3xsm";case"sm":case"md":default:return"xsm"}});return(a,u)=>(e.openBlock(),e.createBlock(e.unref(p.AvatarRoot),{as:"div",class:e.normalizeClass(e.unref(t.normCls)(e.unref(C)(k.value),s.class))},{default:e.withCtx(()=>[!v.default&&!a.text?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.src?(e.openBlock(),e.createBlock(e.unref(p.AvatarImage),e.mergeProps({key:0},e.unref(d),{src:a.src,alt:a.alt,class:e.unref(t.getBemElement)(e.unref(o),"image")}),null,16,["src","alt","class"])):e.createCommentVNode("",!0),e.createVNode(e.unref(p.AvatarFallback),{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(o),"fallback"))},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"fallback",{},()=>[a.fallback?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,icon:a.icon,size:m.value},null,8,["icon","size"])),e.createTextVNode(" "+e.toDisplayString(a.fallback),1)])]),_:3},8,["class"])],64)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(o),"image"))},[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.text),1)])],2)),a.online?(e.openBlock(),e.createBlock(N._sfc_main,{key:2,color:a.onlineColor,size:l.value,class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(o),"online"))},null,8,["color","size","class"])):e.createCommentVNode("",!0)]),_:3},8,["class"]))}});exports.AvatarOnlineAlignments=z;exports.AvatarShapes=h;exports.AvatarSizes=_;exports.AvatarStrokes=A;exports._sfc_main=S;exports._sfc_main$1=G;exports.injectAvatarGroupContext=x;exports.provideAvatarGroupContext=y;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),t=require("@pantograph/utils"),I=require("class-variance-authority"),A=require("./Icon.vue_vue_type_style_index_0_lang-DQNF7GAr.js"),g=require("@pantograph/utils-vue"),O=require("./BaseBadge.model-DecqxaGN.js"),$=require("./HoverCard.vue_vue_type_style_index_0_lang-B6a5M7RJ.js");require("./Popover.vue_vue_type_style_index_0_lang-w-n010qN.js");const x=require("reka-ui"),[q,b]=x.createContext("ChipGroup"),T=e.defineComponent({...t.getComponentOptions("ChipGroup"),__name:"ChipGroup",props:{color:{},size:{default:"md"},closeIcon:{},icon:{},overlayActions:{type:Boolean},selected:{type:Boolean},maxCount:{},popoverProps:{},truncateCls:{},noPopover:{type:Boolean},noWrap:{type:Boolean},closeable:{type:Boolean,default:!0}},emits:["close"],setup(y,{emit:h}){const n=h,s=y,d=e.useSlots();b({props:s,onClose:(a,u)=>{n("close",a,u)}});const c=e.computed(()=>s.maxCount?Number(s.maxCount):0),_=()=>{const a=g.flattenChildren(d.default?d.default():[]),u=()=>e.h("div",{class:t.normCls(t.getBemElement(p,"truncate"),s.truncateCls)},`+${a.length-c.value}`);return c.value>=1&&a.length>c.value?[...a.filter((r,l)=>l<c.value),s.noPopover?u():e.h($._sfc_main,{size:s.size==="md"?"md":"sm",...s.popoverProps??{}},{default:u,content:()=>e.h("div",{class:m(s)},{default:()=>a.filter((r,l)=>l>=c.value)})})]:a},p=t.getBemBlock("chip_group"),m=I.cva(p,{variants:{size:t.generateVariantClassList(S,p),noWrap:t.generateVariantClassList("no-wrap",p)}});return(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(m)(s))},[e.createVNode(_)],2))}}),S=["xsm","sm","md"],G=[...O.BadgeColors],w=e.defineComponent({...t.getComponentOptions("Chip"),__name:"Chip",props:{value:{},size:{default:"md"},class:{},actionsCls:{},textCls:{},iconCls:{},text:{},icon:{},closeIcon:{default:"tabler:x"},closeIconCls:{},color:{},overlayActions:{type:Boolean,default:void 0},stopPropagationOnClose:{type:Boolean},closeable:{type:Boolean,default:void 0},selected:{type:Boolean,default:void 0},readonly:{type:Boolean},closeTrigger:{default:"click"},unExtendParent:{type:Boolean,default:!1}},emits:["close"],setup(y,{emit:h}){const n=y,s=n.unExtendParent?void 0:q({}),d=e.computed(()=>{var o;return((o=s==null?void 0:s.props)==null?void 0:o.size)??n.size}),k=e.computed(()=>{var o;return n.color??((o=s==null?void 0:s.props)==null?void 0:o.color)??"primary"}),c=e.computed(()=>{var o;return((o=s==null?void 0:s.props)==null?void 0:o.overlayActions)??n.overlayActions}),_=e.computed(()=>{var o;return n.selected??((o=s==null?void 0:s.props)==null?void 0:o.selected)}),p=e.computed(()=>{var o;return((o=s==null?void 0:s.props)==null?void 0:o.closeIcon)??n.closeIcon}),m=e.computed(()=>{var o;return((o=s==null?void 0:s.props)==null?void 0:o.icon)??n.icon}),a=e.computed(()=>{var o;return((o=s==null?void 0:s.props)==null?void 0:o.closeable)??n.closeable}),u=h,r=e.useSlots(),l=t.getBemBlock("chip"),L=I.cva(l,{variants:{size:t.generateVariantClassList(S,l),color:t.generateVariantClassList(G,l),overlayActions:t.generateVariantClassList("overlay-actions",l),selected:t.generateVariantClassList("selected",l),readonly:t.generateVariantClassList("readonly",l)}}),B=o=>{var C;o.stopPropagation(),(C=s==null?void 0:s.onClose)==null||C.call(s,n,o),u("close",o)},i=e.computed(()=>({onClose:B,size:(()=>{switch(d.value){case"md":return"xsm";default:return"2xsm"}})()})),N=()=>{var P,E;const o=(P=r.overlayActions)==null?void 0:P.call(r,i.value),C=!g.isEmptyElement(o),v=c.value&&C;if((a.value||v)&&!n.readonly){const f=[];if(v&&f.push(o),a.value){const V=(E=r.close)==null?void 0:E.call(r,i.value);g.isEmptyElement(V)?f.push(e.h(A._sfc_main,{onClick:z=>{n.closeTrigger==="click"&&B(z)},onPointerdown:z=>{n.closeTrigger==="pointer"&&B(z)},size:i.value.size,icon:p.value,class:t.normCls(t.getBemElement(l,"close_icon"),n.closeIconCls)})):f.push(V)}return e.h("div",{class:t.normCls(t.getBemElement(l,"actions"),n.actionsCls)},f)}return null};return(o,C)=>{var v;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(t.normCls)(e.unref(L)({size:d.value,color:k.value,overlayActions:c.value,selected:_.value,readonly:o.readonly}),n.class))},[e.renderSlot(o.$slots,"leading",e.normalizeProps(e.guardReactiveProps(i.value)),()=>[m.value?(e.openBlock(),e.createBlock(e.unref(A._sfc_main),{key:0,size:i.value.size,icon:m.value,class:e.normalizeClass(o.iconCls)},null,8,["size","icon","class"])):e.createCommentVNode("",!0)]),!e.unref(g.isEmptyElement)((v=r.text)==null?void 0:v.call(r,i.value))||o.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(l),"text"),o.textCls))},[e.renderSlot(o.$slots,"text",e.normalizeProps(e.guardReactiveProps(i.value)),()=>[e.createTextVNode(e.toDisplayString(o.text),1)])],2)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"trailing",e.normalizeProps(e.guardReactiveProps(i.value))),e.createVNode(N)],2)}}});exports.ChipColors=G;exports.ChipSizes=S;exports._sfc_main=w;exports._sfc_main$1=T;exports.injectChipGroupContext=q;exports.provideChipGroupContext=b;
|
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
import { defineComponent as I, computed as G, createBlock as R, openBlock as z, unref as e, isRef as Z, withCtx as k, renderSlot as L, useSlots as J, ref as N, onMounted as ee, render as te, h as _, onBeforeUnmount as se, createVNode as C, normalizeStyle as oe, normalizeClass as b, createElementVNode as U, createElementBlock as D, createCommentVNode as O, createSlots as ae, normalizeProps as K, guardReactiveProps as Q, withModifiers as le } from "vue";
|
|
2
|
-
import { createContext as ne, TabsRoot as re, TabsList as ie, TabsIndicator as ce, TabsTrigger as de, TabsContent as ue } from "reka-ui";
|
|
3
|
-
import { useVModel as pe, useCollection as W, isEmptyElement as V } from "@pantograph/utils-vue";
|
|
4
|
-
import { getComponentOptions as A, getBemBlock as fe, getBemElement as r, generateVariantClassList as H, sortPlaceholderCls as me, sortPlaceholderVariantsClass as ge, normCls as p } from "@pantograph/utils";
|
|
5
|
-
import { cva as X } from "class-variance-authority";
|
|
6
|
-
import { _ as ve } from "./ScrollContainer.vue_vue_type_style_index_0_lang-CHAf6ZD-.js";
|
|
7
|
-
import { _ as j } from "./FloatButton.vue_vue_type_script_setup_true_lang-BTmEBbt_.js";
|
|
8
|
-
import { _ as F } from "./Divider.vue_vue_type_style_index_0_lang-GfWcHNix.js";
|
|
9
|
-
import be from "@pantograph/sortable";
|
|
10
|
-
import { u as Ce } from "./ConfigProvider.vue_vue_type_script_setup_true_lang-IVHvl51_.js";
|
|
11
|
-
import { i as q } from "./isNumber-BduWbB-B.js";
|
|
12
|
-
import { _ as _e } from "./Skeleton.vue_vue_type_style_index_0_lang-DOsf2SEN.js";
|
|
13
|
-
import { _ as ye } from "./Badge.vue_vue_type_script_setup_true_lang-D8HhPgXQ.js";
|
|
14
|
-
const [Y, he] = ne("Tabs"), Re = /* @__PURE__ */ I({
|
|
15
|
-
...A("Tabs", !1),
|
|
16
|
-
__name: "Tabs",
|
|
17
|
-
props: {
|
|
18
|
-
block: { type: Boolean },
|
|
19
|
-
draggable: { type: Boolean },
|
|
20
|
-
size: { default: "md" },
|
|
21
|
-
sortableProps: {},
|
|
22
|
-
defaultValue: {},
|
|
23
|
-
orientation: {},
|
|
24
|
-
dir: {},
|
|
25
|
-
activationMode: {},
|
|
26
|
-
modelValue: {},
|
|
27
|
-
unmountOnHide: { type: Boolean },
|
|
28
|
-
asChild: { type: Boolean },
|
|
29
|
-
as: {}
|
|
30
|
-
},
|
|
31
|
-
emits: ["change", "dragStart", "dragEnd", "update:modelValue"],
|
|
32
|
-
setup(T, { emit: o }) {
|
|
33
|
-
const s = T, y = o, i = pe(s, "modelValue", y, {
|
|
34
|
-
defaultValue: s.defaultValue,
|
|
35
|
-
passive: s.defaultValue === void 0,
|
|
36
|
-
onChange: (f) => y("change", f)
|
|
37
|
-
}), { getDir: c } = Ce(), u = c();
|
|
38
|
-
return he({
|
|
39
|
-
props: s,
|
|
40
|
-
emit: y,
|
|
41
|
-
dir: u,
|
|
42
|
-
slotProps: G(() => ({
|
|
43
|
-
size: s.size === "lg" ? "md" : "sm",
|
|
44
|
-
iconSize: s.size === "lg" ? "sm" : "xsm"
|
|
45
|
-
}))
|
|
46
|
-
}), (f, h) => (z(), R(e(re), {
|
|
47
|
-
asChild: "",
|
|
48
|
-
orientation: "horizontal",
|
|
49
|
-
modelValue: e(i),
|
|
50
|
-
"onUpdate:modelValue": h[0] || (h[0] = (l) => Z(i) ? i.value = l : null),
|
|
51
|
-
dir: e(u)
|
|
52
|
-
}, {
|
|
53
|
-
default: k(() => [
|
|
54
|
-
L(f.$slots, "default")
|
|
55
|
-
]),
|
|
56
|
-
_: 3
|
|
57
|
-
}, 8, ["modelValue", "dir"]));
|
|
58
|
-
}
|
|
59
|
-
}), Pe = ["md", "lg"], n = fe("tabs"), P = r(n, "trigger"), Ae = /* @__PURE__ */ I({
|
|
60
|
-
...A("TabList"),
|
|
61
|
-
__name: "TabList",
|
|
62
|
-
props: {
|
|
63
|
-
class: {},
|
|
64
|
-
indicatorCls: {},
|
|
65
|
-
containerCls: {},
|
|
66
|
-
fixedActionsCls: {},
|
|
67
|
-
actionsCls: {},
|
|
68
|
-
startScrollCls: {},
|
|
69
|
-
endScrollCls: {}
|
|
70
|
-
},
|
|
71
|
-
setup(T) {
|
|
72
|
-
const o = T, s = J(), y = X(n, {
|
|
73
|
-
variants: {
|
|
74
|
-
block: H("block", n),
|
|
75
|
-
size: H(Pe, n)
|
|
76
|
-
}
|
|
77
|
-
}), i = N(), c = Y();
|
|
78
|
-
let u;
|
|
79
|
-
function f() {
|
|
80
|
-
u && clearInterval(u), u = null;
|
|
81
|
-
}
|
|
82
|
-
const h = (a) => {
|
|
83
|
-
a ? l() : f();
|
|
84
|
-
}, l = () => {
|
|
85
|
-
u || (u = setInterval(() => {
|
|
86
|
-
var a, t, d, m;
|
|
87
|
-
q((d = (t = (a = i.value) == null ? void 0 : a.container) == null ? void 0 : t.viewportElement) == null ? void 0 : d.scrollLeft) && ((m = i.value) != null && m.rightVisible ? f() : i.value.container.viewportElement.scrollLeft += 10);
|
|
88
|
-
}, 10));
|
|
89
|
-
}, g = (a) => {
|
|
90
|
-
a ? B() : f();
|
|
91
|
-
}, B = () => {
|
|
92
|
-
u || (u = setInterval(() => {
|
|
93
|
-
var a, t, d, m;
|
|
94
|
-
q((d = (t = (a = i.value) == null ? void 0 : a.container) == null ? void 0 : t.viewportElement) == null ? void 0 : d.scrollLeft) && ((m = i.value) != null && m.leftVisible ? f() : i.value.container.viewportElement.scrollLeft -= 10);
|
|
95
|
-
}, 10));
|
|
96
|
-
}, w = () => {
|
|
97
|
-
var t;
|
|
98
|
-
const a = (t = s.actions) == null ? void 0 : t.call(s, c.slotProps.value);
|
|
99
|
-
if (!V(a))
|
|
100
|
-
return [
|
|
101
|
-
_(F, {
|
|
102
|
-
type: "vertical",
|
|
103
|
-
class: r(n, "actions_divider")
|
|
104
|
-
}),
|
|
105
|
-
_(
|
|
106
|
-
"div",
|
|
107
|
-
{ class: p(r(n, "actions"), o.actionsCls) },
|
|
108
|
-
a
|
|
109
|
-
)
|
|
110
|
-
];
|
|
111
|
-
}, S = N(), x = N(!1);
|
|
112
|
-
let v;
|
|
113
|
-
ee(async () => {
|
|
114
|
-
c.props.draggable && S.value && (v = new be(S.value, {
|
|
115
|
-
...c.props.sortableProps ?? {},
|
|
116
|
-
forceFallback: !1,
|
|
117
|
-
fallbackOnBody: !1,
|
|
118
|
-
filter: "[data-draggable=false]",
|
|
119
|
-
draggable: `.${P}`,
|
|
120
|
-
dataIdAttr: "id",
|
|
121
|
-
onStart(a) {
|
|
122
|
-
x.value = !0, c.emit("dragStart", a, v);
|
|
123
|
-
},
|
|
124
|
-
onEnd(a) {
|
|
125
|
-
x.value = !1, c.emit("dragEnd", a, v);
|
|
126
|
-
},
|
|
127
|
-
getPlaceholder(a) {
|
|
128
|
-
const t = document.createElement("div"), d = a.item.getBoundingClientRect();
|
|
129
|
-
return t.style.width = `${d.width ?? 100}px`, t.style.height = "100%", t.classList.add(r(n, me)), te(
|
|
130
|
-
_("div", {
|
|
131
|
-
class: ge({ size: c.slotProps.value.size })
|
|
132
|
-
}),
|
|
133
|
-
t
|
|
134
|
-
), t;
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
}), se(() => {
|
|
138
|
-
f(), v && (v.destroy(), v = void 0);
|
|
139
|
-
});
|
|
140
|
-
const { CollectionSlot: M, itemMap: E } = W({ isProvider: !0, key: n });
|
|
141
|
-
return (a, t) => (z(), R(e(M), null, {
|
|
142
|
-
default: k(() => [
|
|
143
|
-
C(e(ie), {
|
|
144
|
-
class: b(
|
|
145
|
-
e(p)(
|
|
146
|
-
e(y)({ block: e(c).props.block, size: e(c).props.size }),
|
|
147
|
-
o.class
|
|
148
|
-
)
|
|
149
|
-
),
|
|
150
|
-
loop: !1,
|
|
151
|
-
asChild: !1,
|
|
152
|
-
style: oe({ "--ptc-tabs-count": e(E).size })
|
|
153
|
-
}, {
|
|
154
|
-
default: k(() => [
|
|
155
|
-
U("div", {
|
|
156
|
-
class: b(e(r)(e(n), "wrapper"))
|
|
157
|
-
}, [
|
|
158
|
-
C(ve, {
|
|
159
|
-
wrapCls: e(r)(e(n), "scroll_wrap"),
|
|
160
|
-
rootCls: e(r)(e(n), "scroll_root"),
|
|
161
|
-
areaCls: e(r)(e(n), "scroll_area"),
|
|
162
|
-
dir: e(c).dir.value,
|
|
163
|
-
ref_key: "scrollContainer",
|
|
164
|
-
ref: i,
|
|
165
|
-
overlay: !1,
|
|
166
|
-
hasMask: !e(c).props.block,
|
|
167
|
-
hideHorizontalScrollbar: ""
|
|
168
|
-
}, ae({
|
|
169
|
-
default: k(() => [
|
|
170
|
-
C(e(ce), {
|
|
171
|
-
class: b(e(p)(e(r)(e(n), "indicator"), o.indicatorCls)),
|
|
172
|
-
hasMask: ""
|
|
173
|
-
}, null, 8, ["class"]),
|
|
174
|
-
U("div", {
|
|
175
|
-
class: b(e(p)(e(r)(e(n), "container"), o.containerCls)),
|
|
176
|
-
ref_key: "container",
|
|
177
|
-
ref: S
|
|
178
|
-
}, [
|
|
179
|
-
L(a.$slots, "default")
|
|
180
|
-
], 2)
|
|
181
|
-
]),
|
|
182
|
-
_: 2
|
|
183
|
-
}, [
|
|
184
|
-
e(c).props.block ? void 0 : {
|
|
185
|
-
name: "root",
|
|
186
|
-
fn: k(() => {
|
|
187
|
-
var d, m;
|
|
188
|
-
return [
|
|
189
|
-
!((d = i.value) != null && d.leftVisible) && !x.value ? (z(), D("div", {
|
|
190
|
-
key: 0,
|
|
191
|
-
class: b(e(p)(e(r)(e(n), "left_scroll"), o.startScrollCls))
|
|
192
|
-
}, [
|
|
193
|
-
C(j, {
|
|
194
|
-
type: "outline",
|
|
195
|
-
icon: "tabler:chevron-left",
|
|
196
|
-
size: "sm",
|
|
197
|
-
color: "neutral",
|
|
198
|
-
onMousedown: t[0] || (t[0] = ($) => g(!0)),
|
|
199
|
-
onMouseup: t[1] || (t[1] = ($) => g(!1)),
|
|
200
|
-
onMouseleave: t[2] || (t[2] = ($) => g(!1))
|
|
201
|
-
})
|
|
202
|
-
], 2)) : O("", !0),
|
|
203
|
-
!((m = i.value) != null && m.rightVisible) && !x.value ? (z(), D("div", {
|
|
204
|
-
key: 1,
|
|
205
|
-
class: b(e(p)(e(r)(e(n), "right_scroll"), o.endScrollCls))
|
|
206
|
-
}, [
|
|
207
|
-
C(j, {
|
|
208
|
-
type: "outline",
|
|
209
|
-
icon: "tabler:chevron-right",
|
|
210
|
-
size: "sm",
|
|
211
|
-
color: "neutral",
|
|
212
|
-
onMousedown: t[3] || (t[3] = ($) => h(!0)),
|
|
213
|
-
onMouseup: t[4] || (t[4] = ($) => h(!1)),
|
|
214
|
-
onMouseleave: t[5] || (t[5] = ($) => h(!1))
|
|
215
|
-
})
|
|
216
|
-
], 2)) : O("", !0)
|
|
217
|
-
];
|
|
218
|
-
}),
|
|
219
|
-
key: "0"
|
|
220
|
-
}
|
|
221
|
-
]), 1032, ["wrapCls", "rootCls", "areaCls", "dir", "hasMask"]),
|
|
222
|
-
C(w)
|
|
223
|
-
], 2),
|
|
224
|
-
a.$slots.fixedActions ? (z(), D("div", {
|
|
225
|
-
key: 0,
|
|
226
|
-
class: b(e(p)(e(r)(e(n), "fixed_actions"), o.fixedActionsCls))
|
|
227
|
-
}, [
|
|
228
|
-
L(a.$slots, "fixedActions", K(Q(e(c).slotProps.value)))
|
|
229
|
-
], 2)) : O("", !0),
|
|
230
|
-
C(F, {
|
|
231
|
-
class: b(e(r)(e(n), "underline"))
|
|
232
|
-
}, null, 8, ["class"])
|
|
233
|
-
]),
|
|
234
|
-
_: 3
|
|
235
|
-
}, 8, ["class", "style"])
|
|
236
|
-
]),
|
|
237
|
-
_: 3
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
}), Ne = /* @__PURE__ */ I({
|
|
241
|
-
...A("TabsTrigger"),
|
|
242
|
-
__name: "TabTrigger",
|
|
243
|
-
props: {
|
|
244
|
-
text: {},
|
|
245
|
-
loading: { type: Boolean, default: void 0 },
|
|
246
|
-
draggable: { type: Boolean, default: void 0 },
|
|
247
|
-
class: {},
|
|
248
|
-
contentCls: {},
|
|
249
|
-
textCls: {},
|
|
250
|
-
trailingCls: {},
|
|
251
|
-
actionCls: {},
|
|
252
|
-
badgeProps: {},
|
|
253
|
-
value: {},
|
|
254
|
-
disabled: { type: Boolean }
|
|
255
|
-
},
|
|
256
|
-
setup(T) {
|
|
257
|
-
const o = T, s = J(), y = X(P, {
|
|
258
|
-
variants: {
|
|
259
|
-
loading: H("loading", P)
|
|
260
|
-
}
|
|
261
|
-
}), i = Y(), c = (l) => {
|
|
262
|
-
l.stopPropagation(), l.preventDefault();
|
|
263
|
-
}, u = () => {
|
|
264
|
-
var g, B, w, S, x, v, M;
|
|
265
|
-
const l = [];
|
|
266
|
-
if (o.loading)
|
|
267
|
-
l.push(
|
|
268
|
-
_(_e, {
|
|
269
|
-
size: i.slotProps.value.size,
|
|
270
|
-
class: r(P, "skeleton")
|
|
271
|
-
})
|
|
272
|
-
);
|
|
273
|
-
else {
|
|
274
|
-
const E = (g = s.leading) == null ? void 0 : g.call(s, i.slotProps.value), a = (B = s.text) == null ? void 0 : B.call(s, {});
|
|
275
|
-
V(E) || l.push(E);
|
|
276
|
-
const t = !V(a);
|
|
277
|
-
(t || o.text) && l.push(
|
|
278
|
-
_(
|
|
279
|
-
"div",
|
|
280
|
-
{
|
|
281
|
-
class: p(r(P, "text"), o.textCls)
|
|
282
|
-
},
|
|
283
|
-
t ? a : o.text
|
|
284
|
-
)
|
|
285
|
-
);
|
|
286
|
-
const d = (w = s.trailing) == null ? void 0 : w.call(s, i.slotProps.value);
|
|
287
|
-
V(d) || l.push(
|
|
288
|
-
_(
|
|
289
|
-
"div",
|
|
290
|
-
{ class: p(r(P, "trailing"), o.trailingCls) },
|
|
291
|
-
d
|
|
292
|
-
)
|
|
293
|
-
), (s.badgeIcon || s.badge || (S = o.badgeProps) != null && S.text || (x = o.badgeProps) != null && x.icon) && l.push(
|
|
294
|
-
_(
|
|
295
|
-
ye,
|
|
296
|
-
{
|
|
297
|
-
...o.badgeProps ?? {},
|
|
298
|
-
size: "xsm",
|
|
299
|
-
color: ((v = o.badgeProps) == null ? void 0 : v.color) ?? "primary-subtle"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
default: s.badge,
|
|
303
|
-
icon: s.badgeIcon
|
|
304
|
-
}
|
|
305
|
-
)
|
|
306
|
-
);
|
|
307
|
-
const m = (M = s.action) == null ? void 0 : M.call(s, i.slotProps.value);
|
|
308
|
-
V(m) || l.push(
|
|
309
|
-
_(
|
|
310
|
-
"div",
|
|
311
|
-
{
|
|
312
|
-
class: p(r(P, "action"), o.actionCls),
|
|
313
|
-
onMousedown: c
|
|
314
|
-
},
|
|
315
|
-
m
|
|
316
|
-
)
|
|
317
|
-
);
|
|
318
|
-
}
|
|
319
|
-
return _(
|
|
320
|
-
"div",
|
|
321
|
-
{
|
|
322
|
-
class: p(r(P, "content"), o.contentCls)
|
|
323
|
-
},
|
|
324
|
-
l
|
|
325
|
-
);
|
|
326
|
-
}, { CollectionItem: f } = W({ key: n }), h = G(
|
|
327
|
-
() => o.disabled || o.draggable === !1 ? !1 : void 0
|
|
328
|
-
);
|
|
329
|
-
return (l, g) => (z(), R(e(f), null, {
|
|
330
|
-
default: k(() => [
|
|
331
|
-
C(e(de), {
|
|
332
|
-
asChild: !1,
|
|
333
|
-
as: "button",
|
|
334
|
-
value: l.value,
|
|
335
|
-
"data-draggable": h.value,
|
|
336
|
-
disabled: l.loading || l.disabled,
|
|
337
|
-
class: b(e(p)(e(y)({ loading: l.loading }), o.class)),
|
|
338
|
-
onMousedown: g[0] || (g[0] = le(() => {
|
|
339
|
-
}, ["right", "stop", "prevent"]))
|
|
340
|
-
}, {
|
|
341
|
-
default: k(() => [
|
|
342
|
-
C(u)
|
|
343
|
-
]),
|
|
344
|
-
_: 1
|
|
345
|
-
}, 8, ["value", "data-draggable", "disabled", "class"])
|
|
346
|
-
]),
|
|
347
|
-
_: 1
|
|
348
|
-
}));
|
|
349
|
-
}
|
|
350
|
-
}), De = /* @__PURE__ */ I({
|
|
351
|
-
...A("TabContent"),
|
|
352
|
-
__name: "TabContent",
|
|
353
|
-
props: {
|
|
354
|
-
value: {},
|
|
355
|
-
forceMount: { type: Boolean },
|
|
356
|
-
asChild: { type: Boolean },
|
|
357
|
-
as: {}
|
|
358
|
-
},
|
|
359
|
-
setup(T) {
|
|
360
|
-
const o = T;
|
|
361
|
-
return (s, y) => (z(), R(e(ue), K(Q(o)), {
|
|
362
|
-
default: k(() => [
|
|
363
|
-
L(s.$slots, "default")
|
|
364
|
-
]),
|
|
365
|
-
_: 3
|
|
366
|
-
}, 16));
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
export {
|
|
370
|
-
Pe as T,
|
|
371
|
-
Re as _,
|
|
372
|
-
Ae as a,
|
|
373
|
-
Ne as b,
|
|
374
|
-
De as c,
|
|
375
|
-
Y as i,
|
|
376
|
-
he as p,
|
|
377
|
-
n as t
|
|
378
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),E=require("reka-ui"),b=require("@pantograph/utils-vue"),t=require("@pantograph/utils"),M=require("class-variance-authority"),L=require("./ScrollContainer.vue_vue_type_style_index_0_lang-DDjSsSEk.js"),T=require("./FloatButton.vue_vue_type_script_setup_true_lang-ClqbpPNl.js"),w=require("./Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),I=require("@pantograph/sortable"),R=require("./ConfigProvider.vue_vue_type_script_setup_true_lang-CyGHtFPF.js"),$=require("./isNumber-DMOjxgl8.js"),A=require("./Skeleton.vue_vue_type_style_index_0_lang-vZBJnVJj.js"),O=require("./Badge.vue_vue_type_script_setup_true_lang-DVt1axIK.js"),[S,N]=E.createContext("Tabs"),D=e.defineComponent({...t.getComponentOptions("Tabs",!1),__name:"Tabs",props:{block:{type:Boolean},draggable:{type:Boolean},size:{default:"md"},sortableProps:{},defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["change","dragStart","dragEnd","update:modelValue"],setup(B,{emit:o}){const s=B,C=o,i=b.useVModel(s,"modelValue",C,{defaultValue:s.defaultValue,passive:s.defaultValue===void 0,onChange:f=>C("change",f)}),{getDir:c}=R.useConfig(),d=c();return N({props:s,emit:C,dir:d,slotProps:e.computed(()=>({size:s.size==="lg"?"md":"sm",iconSize:s.size==="lg"?"sm":"xsm"}))}),(f,v)=>(e.openBlock(),e.createBlock(e.unref(E.TabsRoot),{asChild:"",orientation:"horizontal",modelValue:e.unref(i),"onUpdate:modelValue":v[0]||(v[0]=r=>e.isRef(i)?i.value=r:null),dir:e.unref(d)},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"default")]),_:3},8,["modelValue","dir"]))}}),q=["md","lg"],a=t.getBemBlock("tabs"),_=t.getBemElement(a,"trigger"),U=e.defineComponent({...t.getComponentOptions("TabList"),__name:"TabList",props:{class:{},indicatorCls:{},containerCls:{},fixedActionsCls:{},actionsCls:{},startScrollCls:{},endScrollCls:{}},setup(B){const o=B,s=e.useSlots(),C=M.cva(a,{variants:{block:t.generateVariantClassList("block",a),size:t.generateVariantClassList(q,a)}}),i=e.ref(),c=S();let d;function f(){d&&clearInterval(d),d=null}const v=l=>{l?r():f()},r=()=>{d||(d=setInterval(()=>{var l,n,u,m;$.isNumber((u=(n=(l=i.value)==null?void 0:l.container)==null?void 0:n.viewportElement)==null?void 0:u.scrollLeft)&&((m=i.value)!=null&&m.rightVisible?f():i.value.container.viewportElement.scrollLeft+=10)},10))},p=l=>{l?V():f()},V=()=>{d||(d=setInterval(()=>{var l,n,u,m;$.isNumber((u=(n=(l=i.value)==null?void 0:l.container)==null?void 0:n.viewportElement)==null?void 0:u.scrollLeft)&&((m=i.value)!=null&&m.leftVisible?f():i.value.container.viewportElement.scrollLeft-=10)},10))},x=()=>{var n;const l=(n=s.actions)==null?void 0:n.call(s,c.slotProps.value);if(!b.isEmptyElement(l))return[e.h(w._sfc_main,{type:"vertical",class:t.getBemElement(a,"actions_divider")}),e.h("div",{class:t.normCls(t.getBemElement(a,"actions"),o.actionsCls)},l)]},h=e.ref(),y=e.ref(!1);let g;e.onMounted(async()=>{c.props.draggable&&h.value&&(g=new I(h.value,{...c.props.sortableProps??{},forceFallback:!1,fallbackOnBody:!1,filter:"[data-draggable=false]",draggable:`.${_}`,dataIdAttr:"id",onStart(l){y.value=!0,c.emit("dragStart",l,g)},onEnd(l){y.value=!1,c.emit("dragEnd",l,g)},getPlaceholder(l){const n=document.createElement("div"),u=l.item.getBoundingClientRect();return n.style.width=`${u.width??100}px`,n.style.height="100%",n.classList.add(t.getBemElement(a,t.sortPlaceholderCls)),e.render(e.h("div",{class:t.sortPlaceholderVariantsClass({size:c.slotProps.value.size})}),n),n}}))}),e.onBeforeUnmount(()=>{f(),g&&(g.destroy(),g=void 0)});const{CollectionSlot:z,itemMap:P}=b.useCollection({isProvider:!0,key:a});return(l,n)=>(e.openBlock(),e.createBlock(e.unref(z),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.TabsList),{class:e.normalizeClass(e.unref(t.normCls)(e.unref(C)({block:e.unref(c).props.block,size:e.unref(c).props.size}),o.class)),loop:!1,asChild:!1,style:e.normalizeStyle({"--ptc-tabs-count":e.unref(P).size})},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(a),"wrapper"))},[e.createVNode(L._sfc_main,{wrapCls:e.unref(t.getBemElement)(e.unref(a),"scroll_wrap"),rootCls:e.unref(t.getBemElement)(e.unref(a),"scroll_root"),areaCls:e.unref(t.getBemElement)(e.unref(a),"scroll_area"),dir:e.unref(c).dir.value,ref_key:"scrollContainer",ref:i,overlay:!1,hasMask:!e.unref(c).props.block,hideHorizontalScrollbar:""},e.createSlots({default:e.withCtx(()=>[e.createVNode(e.unref(E.TabsIndicator),{class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"indicator"),o.indicatorCls)),hasMask:""},null,8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"container"),o.containerCls)),ref_key:"container",ref:h},[e.renderSlot(l.$slots,"default")],2)]),_:2},[e.unref(c).props.block?void 0:{name:"root",fn:e.withCtx(()=>{var u,m;return[!((u=i.value)!=null&&u.leftVisible)&&!y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"left_scroll"),o.startScrollCls))},[e.createVNode(T._sfc_main,{type:"outline",icon:"tabler:chevron-left",size:"sm",color:"neutral",onMousedown:n[0]||(n[0]=k=>p(!0)),onMouseup:n[1]||(n[1]=k=>p(!1)),onMouseleave:n[2]||(n[2]=k=>p(!1))})],2)):e.createCommentVNode("",!0),!((m=i.value)!=null&&m.rightVisible)&&!y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"right_scroll"),o.endScrollCls))},[e.createVNode(T._sfc_main,{type:"outline",icon:"tabler:chevron-right",size:"sm",color:"neutral",onMousedown:n[3]||(n[3]=k=>v(!0)),onMouseup:n[4]||(n[4]=k=>v(!1)),onMouseleave:n[5]||(n[5]=k=>v(!1))})],2)):e.createCommentVNode("",!0)]}),key:"0"}]),1032,["wrapCls","rootCls","areaCls","dir","hasMask"]),e.createVNode(x)],2),l.$slots.fixedActions?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t.normCls)(e.unref(t.getBemElement)(e.unref(a),"fixed_actions"),o.fixedActionsCls))},[e.renderSlot(l.$slots,"fixedActions",e.normalizeProps(e.guardReactiveProps(e.unref(c).slotProps.value)))],2)):e.createCommentVNode("",!0),e.createVNode(w._sfc_main,{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(a),"underline"))},null,8,["class"])]),_:3},8,["class","style"])]),_:3}))}}),j=e.defineComponent({...t.getComponentOptions("TabsTrigger"),__name:"TabTrigger",props:{text:{},loading:{type:Boolean,default:void 0},draggable:{type:Boolean,default:void 0},class:{},contentCls:{},textCls:{},trailingCls:{},actionCls:{},badgeProps:{},value:{},disabled:{type:Boolean}},setup(B){const o=B,s=e.useSlots(),C=M.cva(_,{variants:{loading:t.generateVariantClassList("loading",_)}}),i=S(),c=r=>{r.stopPropagation(),r.preventDefault()},d=()=>{var p,V,x,h,y,g,z;const r=[];if(o.loading)r.push(e.h(A._sfc_main,{size:i.slotProps.value.size,class:t.getBemElement(_,"skeleton")}));else{const P=(p=s.leading)==null?void 0:p.call(s,i.slotProps.value),l=(V=s.text)==null?void 0:V.call(s,{});b.isEmptyElement(P)||r.push(P);const n=!b.isEmptyElement(l);(n||o.text)&&r.push(e.h("div",{class:t.normCls(t.getBemElement(_,"text"),o.textCls)},n?l:o.text));const u=(x=s.trailing)==null?void 0:x.call(s,i.slotProps.value);b.isEmptyElement(u)||r.push(e.h("div",{class:t.normCls(t.getBemElement(_,"trailing"),o.trailingCls)},u)),(s.badgeIcon||s.badge||(h=o.badgeProps)!=null&&h.text||(y=o.badgeProps)!=null&&y.icon)&&r.push(e.h(O._sfc_main,{...o.badgeProps??{},size:"xsm",color:((g=o.badgeProps)==null?void 0:g.color)??"primary-subtle"},{default:s.badge,icon:s.badgeIcon}));const m=(z=s.action)==null?void 0:z.call(s,i.slotProps.value);b.isEmptyElement(m)||r.push(e.h("div",{class:t.normCls(t.getBemElement(_,"action"),o.actionCls),onMousedown:c},m))}return e.h("div",{class:t.normCls(t.getBemElement(_,"content"),o.contentCls)},r)},{CollectionItem:f}=b.useCollection({key:a}),v=e.computed(()=>o.disabled||o.draggable===!1?!1:void 0);return(r,p)=>(e.openBlock(),e.createBlock(e.unref(f),null,{default:e.withCtx(()=>[e.createVNode(e.unref(E.TabsTrigger),{asChild:!1,as:"button",value:r.value,"data-draggable":v.value,disabled:r.loading||r.disabled,class:e.normalizeClass(e.unref(t.normCls)(e.unref(C)({loading:r.loading}),o.class)),onMousedown:p[0]||(p[0]=e.withModifiers(()=>{},["right","stop","prevent"]))},{default:e.withCtx(()=>[e.createVNode(d)]),_:1},8,["value","data-draggable","disabled","class"])]),_:1}))}}),F=e.defineComponent({...t.getComponentOptions("TabContent"),__name:"TabContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(B){const o=B;return(s,C)=>(e.openBlock(),e.createBlock(e.unref(E.TabsContent),e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}});exports.TabsSizes=q;exports._sfc_main=D;exports._sfc_main$1=U;exports._sfc_main$2=j;exports._sfc_main$3=F;exports.injectTabsContext=S;exports.provideTabsContext=N;exports.tabsPrefix=a;
|