@pantograph/vue 0.32.4 → 0.32.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/Accordion/index.js +169 -190
- package/dist/Accordion/index.umd.cjs +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts +230 -30
- package/dist/AlertDialog/ConfirmDialog.d.ts +30 -0
- package/dist/AlertDialog/_index.d.ts +1 -0
- package/dist/AlertDialog/useAlertDialog.d.ts +21 -0
- package/dist/ColorPicker/index.js +2 -2
- package/dist/ColorPicker/index.umd.cjs +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-BEfDYfnf.js → ColorPicker.vue_vue_type_style_index_0_lang-BrT753B_.js} +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-I6QN70qq.js → ColorPicker.vue_vue_type_style_index_0_lang-ngeRTae-.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-T7Ym5IRz.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-B4PdDPjL.js} +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-DDy2ee2d.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-_pCAmZ53.js} +1 -1
- package/dist/Combobox/Combobox.d.ts +3 -2
- package/dist/Combobox/index.js +245 -239
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/Combobox/types.d.ts +1 -1
- package/dist/Comment/CommentMention.d.ts +10 -4
- package/dist/Comment/index.js +31 -27
- package/dist/Comment/index.umd.cjs +1 -1
- package/dist/ConfigProvider/ConfigProvider.d.ts +1 -0
- package/dist/ConfigProvider/index.js +2 -1
- package/dist/ConfigProvider/index.umd.cjs +1 -1
- package/dist/ConfigProvider/utils.d.ts +3 -3
- package/dist/DataTable/DataTable.d.ts +1 -1
- package/dist/Dialog/Dialog.d.ts +877 -147
- package/dist/Dialog/index.js +201 -188
- package/dist/Dialog/index.umd.cjs +1 -1
- package/dist/Drawer/Drawer.d.ts +32 -10
- package/dist/Drawer/index.js +17 -14
- package/dist/Drawer/index.umd.cjs +1 -1
- package/dist/GOPicker/index.js +1 -1
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/HoverCard/HoverCard.d.ts +2 -0
- package/dist/HoverCard/index.d.ts +5 -1
- package/dist/HoverCard/index.js +54 -36
- package/dist/HoverCard/index.umd.cjs +1 -1
- package/dist/Image/Image.d.ts +1 -1
- package/dist/Modal/Modal.d.ts +31 -10
- package/dist/Modal/index.js +23 -20
- package/dist/Modal/index.umd.cjs +1 -1
- package/dist/Popover/Popover.d.ts +2 -0
- package/dist/Popover/index.d.ts +2 -1
- package/dist/Popover/index.js +55 -37
- package/dist/Popover/index.umd.cjs +1 -1
- package/dist/Popover/type.d.ts +16 -4
- package/dist/Popover/utils.d.ts +2 -1
- package/dist/Progress/ProgressCirclePath.d.ts +1 -1
- package/dist/Select/Select.d.ts +1 -0
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +10 -9
- package/dist/Select/index.umd.cjs +1 -1
- package/dist/Select/types.d.ts +5 -0
- package/dist/{Select.vue_vue_type_style_index_0_lang-79nCnnn0.js → Select.vue_vue_type_style_index_0_lang-BLHjk2Iy.js} +1 -1
- package/dist/{Select.vue_vue_type_style_index_0_lang-DjdX0Ab4.js → Select.vue_vue_type_style_index_0_lang-BmCg9S_L.js} +24 -20
- package/dist/index.js +4 -4
- package/dist/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/dist/use/index.js +5 -5
- package/dist/use/index.umd.cjs +1 -1
- package/dist/utils/popupContext.d.ts +8 -0
- package/dist/utils-CCymYPFY.js +1 -0
- package/dist/utils-ktMrldiH.js +214 -0
- package/package.json +2 -2
- package/dist/utils-BurtTDf8.js +0 -1
- package/dist/utils-FYU7FkmA.js +0 -200
package/dist/Accordion/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { omit as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { useConfig as
|
|
6
|
-
import { flattenChildren as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { getBemBlock as
|
|
1
|
+
import { defineComponent as me, useSlots as be, useAttrs as xe, computed as h, createBlock as ge, openBlock as Ce, unref as s, mergeProps as Be, withCtx as fe, createVNode as z, h as r, ref as ce, normalizeClass as ve } from "vue";
|
|
2
|
+
import { omit as de } from "es-toolkit";
|
|
3
|
+
import { createContext as Oe, useForwardPropsEmits as Ne, AccordionRoot as je, AccordionItem as Ie, AccordionTrigger as pe, AccordionContent as _e } from "reka-ui";
|
|
4
|
+
import { cva as ze } from "class-variance-authority";
|
|
5
|
+
import { useConfig as Pe } from "../ConfigProvider/index.js";
|
|
6
|
+
import { flattenChildren as We, isEmptyElement as p, installComponent as ye } from "@pantograph/utils-vue";
|
|
7
|
+
import { _ as He } from "../Divider.vue_vue_type_style_index_0_lang-eXMD78c3.js";
|
|
8
|
+
import { getBemBlock as Te, getComponentOptions as he, generateVariantClassList as ue, normCls as a, getBemElement as u, getComponentName as Se } from "@pantograph/utils";
|
|
9
9
|
import "../Icon/index.js";
|
|
10
10
|
import "../Badge/index.js";
|
|
11
|
-
import { g as
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
const
|
|
15
|
-
...
|
|
11
|
+
import { g as we } from "../BaseBadge.vue_vue_type_style_index_0_lang-CKjbM3kM.js";
|
|
12
|
+
import { _ as Ee } from "../Badge.vue_vue_type_script_setup_true_lang-CHBj_GP4.js";
|
|
13
|
+
import { _ as Ve } from "../Icon.vue_vue_type_style_index_0_lang-D3lvOgux.js";
|
|
14
|
+
const Me = ["sm", "md", "lg"], nt = ["start", "end"], [$e, ke] = Oe("Accordion"), N = Te("accordion"), Le = /* @__PURE__ */ me({
|
|
15
|
+
...he("Accordion", !1),
|
|
16
16
|
__name: "Accordion",
|
|
17
17
|
props: {
|
|
18
18
|
accordion: { type: Boolean, default: !0 },
|
|
@@ -38,10 +38,10 @@ const Pe = ["sm", "md", "lg"], Ue = ["start", "end"], [We, we] = ye("Accordion")
|
|
|
38
38
|
defaultValue: {}
|
|
39
39
|
},
|
|
40
40
|
emits: ["update:modelValue"],
|
|
41
|
-
setup(
|
|
42
|
-
const e =
|
|
43
|
-
...
|
|
44
|
-
...
|
|
41
|
+
setup(m, { emit: t }) {
|
|
42
|
+
const e = m, o = t, l = be(), S = xe(), A = h(() => ({
|
|
43
|
+
...de(S, ["as", "asChild", "collapsible", "orientation", "type"]),
|
|
44
|
+
...de(e, [
|
|
45
45
|
"accordion",
|
|
46
46
|
"multiple",
|
|
47
47
|
"size",
|
|
@@ -59,37 +59,37 @@ const Pe = ["sm", "md", "lg"], Ue = ["start", "end"], [We, we] = ye("Accordion")
|
|
|
59
59
|
"bordered",
|
|
60
60
|
"expandIconPosition"
|
|
61
61
|
])
|
|
62
|
-
})),
|
|
62
|
+
})), j = Ne(A, o), f = ze(N, {
|
|
63
63
|
variants: {
|
|
64
|
-
size:
|
|
65
|
-
bordered:
|
|
64
|
+
size: ue(Me, N),
|
|
65
|
+
bordered: ue("bordered", N)
|
|
66
66
|
}
|
|
67
|
-
}), { getDir:
|
|
68
|
-
|
|
67
|
+
}), { getDir: x } = Pe(), B = x();
|
|
68
|
+
ke({
|
|
69
69
|
props: e,
|
|
70
|
-
slots:
|
|
70
|
+
slots: l
|
|
71
71
|
});
|
|
72
|
-
const
|
|
73
|
-
var
|
|
74
|
-
const i =
|
|
72
|
+
const I = () => {
|
|
73
|
+
var c;
|
|
74
|
+
const i = We(((c = l.default) == null ? void 0 : c.call(l, {})) ?? []);
|
|
75
75
|
return !e.bordered && i.length > 1 ? i.flatMap(
|
|
76
|
-
(
|
|
76
|
+
(b, v) => v < i.length - 1 ? [b, r(He, { type: "horizontal" })] : [b]
|
|
77
77
|
) : i;
|
|
78
78
|
};
|
|
79
|
-
return (i,
|
|
80
|
-
class:
|
|
81
|
-
dir:
|
|
82
|
-
collapsible: !
|
|
83
|
-
type:
|
|
79
|
+
return (i, c) => (Ce(), ge(s(je), Be(s(j), {
|
|
80
|
+
class: s(a)(s(f)(e), e.class),
|
|
81
|
+
dir: s(B),
|
|
82
|
+
collapsible: !m.accordion,
|
|
83
|
+
type: m.multiple ? "multiple" : "single"
|
|
84
84
|
}), {
|
|
85
|
-
default:
|
|
86
|
-
|
|
85
|
+
default: fe(() => [
|
|
86
|
+
z(I)
|
|
87
87
|
]),
|
|
88
88
|
_: 1
|
|
89
89
|
}, 16, ["class", "dir", "collapsible", "type"]));
|
|
90
90
|
}
|
|
91
|
-
}),
|
|
92
|
-
...
|
|
91
|
+
}), De = /* @__PURE__ */ me({
|
|
92
|
+
...he("AccordionItem"),
|
|
93
93
|
__name: "AccordionItem",
|
|
94
94
|
props: {
|
|
95
95
|
class: { type: [Array, Object, String, Number, null, Boolean] },
|
|
@@ -110,177 +110,156 @@ const Pe = ["sm", "md", "lg"], Ue = ["start", "end"], [We, we] = ye("Accordion")
|
|
|
110
110
|
value: {},
|
|
111
111
|
unmountOnHide: { type: Boolean }
|
|
112
112
|
},
|
|
113
|
-
setup(
|
|
114
|
-
const
|
|
115
|
-
var
|
|
116
|
-
return ((
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}), N = I(() => fe(n, ["value", "unmountOnHide"])), _ = (t) => {
|
|
137
|
-
var C, P;
|
|
138
|
-
const d = ((C = o.props) == null ? void 0 : C.collapsible) === "header", p = () => {
|
|
139
|
-
var L, D, F, R, q, G, J, K, Q, U, X, Y, Z;
|
|
140
|
-
const W = (L = e.header) == null ? void 0 : L.call(e, t);
|
|
141
|
-
if (!l(W)) return W;
|
|
142
|
-
const w = x(), f = [], E = () => {
|
|
143
|
-
var te, S, ne, oe;
|
|
144
|
-
const ee = ((te = e.expandIcon) == null ? void 0 : te.call(e, t)) ?? ((ne = (S = o.slots) == null ? void 0 : S.expandIcon) == null ? void 0 : ne.call(S, t));
|
|
145
|
-
return a(
|
|
146
|
-
ve,
|
|
147
|
-
{
|
|
148
|
-
icon: "tabler:chevron-down",
|
|
149
|
-
as: d ? void 0 : le,
|
|
150
|
-
size: w,
|
|
151
|
-
class: s(
|
|
152
|
-
m(r, "expand"),
|
|
153
|
-
n.expandCls,
|
|
154
|
-
(oe = o.props) == null ? void 0 : oe.expandCls
|
|
155
|
-
)
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
default: l(ee) ? void 0 : () => ee
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
}, T = (D = e.leading) == null ? void 0 : D.call(e, { ...t, iconSize: w }), V = !l(T);
|
|
162
|
-
(n.leading || V) && f.push(
|
|
163
|
-
a(
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
class: s(
|
|
167
|
-
m(r, "leading"),
|
|
168
|
-
n.leadingCls,
|
|
169
|
-
(F = o.props) == null ? void 0 : F.leadingCls
|
|
170
|
-
)
|
|
171
|
-
},
|
|
172
|
-
V ? T : n.leading
|
|
173
|
-
)
|
|
174
|
-
);
|
|
175
|
-
const k = (R = e.title) == null ? void 0 : R.call(e, t), H = !l(k);
|
|
176
|
-
!!(n.title || H) && f.push(
|
|
177
|
-
a(
|
|
178
|
-
"div",
|
|
179
|
-
{
|
|
180
|
-
class: s(
|
|
181
|
-
m(r, "title"),
|
|
182
|
-
"paragraph",
|
|
183
|
-
n.titleCls,
|
|
184
|
-
(q = o.props) == null ? void 0 : q.titleCls
|
|
185
|
-
)
|
|
186
|
-
},
|
|
187
|
-
H ? k : n.title
|
|
188
|
-
)
|
|
189
|
-
);
|
|
190
|
-
const M = B(), j = (G = e.badgeIcon) == null ? void 0 : G.call(e, { ...t, iconSize: ze(M) }), z = (J = e.badgeText) == null ? void 0 : J.call(e, t);
|
|
191
|
-
((K = n.badge) != null && K.text || (Q = n.badge) != null && Q.icon || !l(j) || !l(z)) && f.push(
|
|
192
|
-
a(
|
|
193
|
-
Ie,
|
|
194
|
-
{ size: M, ...n.badge, class: n.badgeCls },
|
|
195
|
-
{
|
|
196
|
-
icon: () => l(j) ? void 0 : j,
|
|
197
|
-
default: () => l(z) ? void 0 : z
|
|
198
|
-
}
|
|
199
|
-
)
|
|
113
|
+
setup(m) {
|
|
114
|
+
const t = m, e = be(), o = $e(), l = u(N, "item"), S = u(l, "header"), A = u(l, "content"), j = h(() => {
|
|
115
|
+
var n;
|
|
116
|
+
return t.disabled || ((n = o.props) == null ? void 0 : n.disabled);
|
|
117
|
+
}), f = h(() => {
|
|
118
|
+
var n;
|
|
119
|
+
return ((n = o.props) == null ? void 0 : n.size) || "md";
|
|
120
|
+
}), x = h(() => f.value === "lg" ? "sm" : f.value === "sm" ? "2xsm" : "xsm"), B = h(
|
|
121
|
+
() => f.value === "lg" ? "xsm" : "2xsm"
|
|
122
|
+
), I = (n) => {
|
|
123
|
+
var F, R, q, G, J, K, Q, U, X, Y, Z, ee, te, ne, oe;
|
|
124
|
+
const C = ((F = o.props) == null ? void 0 : F.collapsible) === "header", g = () => {
|
|
125
|
+
var ae, O, se, ie;
|
|
126
|
+
const le = ((ae = e.expandIcon) == null ? void 0 : ae.call(e, n)) ?? ((se = (O = o.slots) == null ? void 0 : O.expandIcon) == null ? void 0 : se.call(O, n)), re = !p(le);
|
|
127
|
+
return r(
|
|
128
|
+
Ve,
|
|
129
|
+
{
|
|
130
|
+
icon: re ? void 0 : "tabler:chevron-down",
|
|
131
|
+
as: C ? void 0 : pe,
|
|
132
|
+
size: x.value,
|
|
133
|
+
class: a(u(l, "expand"), t.expandCls, (ie = o.props) == null ? void 0 : ie.expandCls)
|
|
134
|
+
},
|
|
135
|
+
re ? { default: () => le } : void 0
|
|
200
136
|
);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
];
|
|
217
|
-
}, u = s(y, n.headerCls, (P = o.props) == null ? void 0 : P.headerCls);
|
|
218
|
-
return d ? a(
|
|
219
|
-
le,
|
|
220
|
-
{
|
|
221
|
-
class: u
|
|
222
|
-
},
|
|
223
|
-
p
|
|
224
|
-
) : a(
|
|
225
|
-
"div",
|
|
226
|
-
{
|
|
227
|
-
class: u
|
|
228
|
-
},
|
|
229
|
-
p()
|
|
137
|
+
}, d = (R = e.header) == null ? void 0 : R.call(e, n);
|
|
138
|
+
if (!p(d)) return d;
|
|
139
|
+
const y = [], P = (q = e.leading) == null ? void 0 : q.call(e, { ...n, iconSize: x.value }), W = !p(P);
|
|
140
|
+
(t.leading || W) && y.push(
|
|
141
|
+
r(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
class: a(
|
|
145
|
+
u(l, "leading"),
|
|
146
|
+
t.leadingCls,
|
|
147
|
+
(G = o.props) == null ? void 0 : G.leadingCls
|
|
148
|
+
)
|
|
149
|
+
},
|
|
150
|
+
W ? P : t.leading
|
|
151
|
+
)
|
|
230
152
|
);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
return a(
|
|
236
|
-
xe,
|
|
153
|
+
const H = (J = e.title) == null ? void 0 : J.call(e, n), T = !p(H);
|
|
154
|
+
(t.title || T) && y.push(
|
|
155
|
+
r(
|
|
156
|
+
"div",
|
|
237
157
|
{
|
|
238
|
-
class:
|
|
239
|
-
|
|
158
|
+
class: a(
|
|
159
|
+
u(l, "title"),
|
|
160
|
+
"paragraph",
|
|
161
|
+
t.titleCls,
|
|
162
|
+
(K = o.props) == null ? void 0 : K.titleCls
|
|
163
|
+
)
|
|
164
|
+
},
|
|
165
|
+
T ? H : t.title
|
|
166
|
+
)
|
|
167
|
+
);
|
|
168
|
+
const w = (Q = e.badgeIcon) == null ? void 0 : Q.call(e, {
|
|
169
|
+
...n,
|
|
170
|
+
iconSize: we(B.value)
|
|
171
|
+
}), E = !p(w), V = (U = e.badgeText) == null ? void 0 : U.call(e, n), M = !p(V);
|
|
172
|
+
((X = t.badge) != null && X.text || (Y = t.badge) != null && Y.icon || E || M) && y.push(
|
|
173
|
+
r(
|
|
174
|
+
Ee,
|
|
175
|
+
{ size: B.value, ...t.badge || {}, class: t.badgeCls },
|
|
176
|
+
{
|
|
177
|
+
icon: () => E ? w : void 0,
|
|
178
|
+
default: () => M ? V : void 0
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
);
|
|
182
|
+
const $ = (Z = e.extra) == null ? void 0 : Z.call(e, n);
|
|
183
|
+
p($) || y.push($);
|
|
184
|
+
const k = g(), L = [
|
|
185
|
+
((ee = o.props) == null ? void 0 : ee.expandIconPosition) === "start" ? k : null,
|
|
186
|
+
r(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
class: a(
|
|
190
|
+
u(S, "wrapper"),
|
|
191
|
+
t.headerWrapperCls,
|
|
192
|
+
(te = o.props) == null ? void 0 : te.headerWrapperCls
|
|
193
|
+
)
|
|
194
|
+
},
|
|
195
|
+
y
|
|
196
|
+
),
|
|
197
|
+
((ne = o.props) == null ? void 0 : ne.expandIconPosition) === "end" ? k : null
|
|
198
|
+
], D = a(S, t.headerCls, (oe = o.props) == null ? void 0 : oe.headerCls);
|
|
199
|
+
return C ? r(pe, { class: D }, () => L) : r("div", { class: D }, L);
|
|
200
|
+
}, i = ce(!1), c = ce(!1);
|
|
201
|
+
let b = null;
|
|
202
|
+
const v = () => {
|
|
203
|
+
b && (clearTimeout(b), b = null);
|
|
204
|
+
}, Ae = (n) => {
|
|
205
|
+
var g, d;
|
|
206
|
+
i.value !== n.open && (i.value = n.open, v(), n.open ? (c.value = !1, b = setTimeout(() => {
|
|
207
|
+
c.value = !0, v();
|
|
208
|
+
}, 300)) : c.value = !1);
|
|
209
|
+
const C = (g = e.default) == null ? void 0 : g.call(e, n);
|
|
210
|
+
if (!p(C))
|
|
211
|
+
return r(
|
|
212
|
+
_e,
|
|
213
|
+
{
|
|
214
|
+
class: a(A, t.contentCls, (d = o.props) == null ? void 0 : d.contentCls),
|
|
215
|
+
forceMount: t.forceMount,
|
|
216
|
+
"data-opened": c.value ? "" : void 0
|
|
240
217
|
},
|
|
241
218
|
() => {
|
|
242
|
-
var
|
|
243
|
-
return
|
|
219
|
+
var _;
|
|
220
|
+
return r(
|
|
244
221
|
"div",
|
|
245
222
|
{
|
|
246
|
-
class:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
(
|
|
223
|
+
class: a(
|
|
224
|
+
u(A, "wrapper"),
|
|
225
|
+
t.contentWrapperCls,
|
|
226
|
+
(_ = o.props) == null ? void 0 : _.contentWrapperCls
|
|
250
227
|
)
|
|
251
228
|
},
|
|
252
|
-
|
|
229
|
+
C
|
|
253
230
|
);
|
|
254
231
|
}
|
|
255
232
|
);
|
|
256
233
|
};
|
|
257
|
-
return (
|
|
258
|
-
var
|
|
259
|
-
return
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
234
|
+
return (n, C) => {
|
|
235
|
+
var g;
|
|
236
|
+
return Ce(), ge(s(Ie), {
|
|
237
|
+
value: m.value,
|
|
238
|
+
unmountOnHide: m.unmountOnHide,
|
|
239
|
+
class: ve(s(a)(s(l), t.class, (g = s(o).props) == null ? void 0 : g.itemCls)),
|
|
240
|
+
disabled: j.value
|
|
241
|
+
}, {
|
|
242
|
+
default: fe(({ open: d }) => [
|
|
243
|
+
z(I, { open: d }, null, 8, ["open"]),
|
|
244
|
+
z(Ae, { open: d }, null, 8, ["open"])
|
|
266
245
|
]),
|
|
267
246
|
_: 1
|
|
268
|
-
},
|
|
247
|
+
}, 8, ["value", "unmountOnHide", "class", "disabled"]);
|
|
269
248
|
};
|
|
270
249
|
}
|
|
271
|
-
}),
|
|
272
|
-
|
|
273
|
-
|
|
250
|
+
}), ot = ye(Le, Se("Accordion")), lt = ye(
|
|
251
|
+
De,
|
|
252
|
+
Se("AccordionItem")
|
|
274
253
|
);
|
|
275
254
|
export {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
255
|
+
Le as Accordion,
|
|
256
|
+
nt as AccordionExpandIconPositions,
|
|
257
|
+
De as AccordionItem,
|
|
258
|
+
lt as AccordionItemPlugin,
|
|
259
|
+
ot as AccordionPlugin,
|
|
260
|
+
Me as AccordionSizes,
|
|
261
|
+
N as accordionPrefix,
|
|
262
|
+
Le as default,
|
|
263
|
+
$e as injectAccordionContext,
|
|
264
|
+
ke as provideAccordionContext
|
|
286
265
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),ie=require("es-toolkit"),g=require("reka-ui"),me=require("class-variance-authority"),ge=require("../ConfigProvider/index.umd.cjs"),i=require("@pantograph/utils-vue"),Ce=require("../Divider.vue_vue_type_style_index_0_lang-Heq87yk1.js"),t=require("@pantograph/utils");require("../Icon/index.umd.cjs");require("../Badge/index.umd.cjs");const be=require("../BaseBadge.vue_vue_type_style_index_0_lang-D3Ibobu5.js"),ye=require("../Badge.vue_vue_type_script_setup_true_lang-D51ugS6o.js"),fe=require("../Icon.vue_vue_type_style_index_0_lang-v3QUxO-v.js"),se=["sm","md","lg"],he=["start","end"],[ce,de]=g.createContext("Accordion"),f=t.getBemBlock("accordion"),N=e.defineComponent({...t.getComponentOptions("Accordion",!1),__name:"Accordion",props:{accordion:{type:Boolean,default:!0},multiple:{type:Boolean},size:{default:"md"},class:{type:[Array,Object,String,Number,null,Boolean]},itemCls:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},headerWrapperCls:{type:[Array,Object,String,Number,null,Boolean]},titleCls:{type:[Array,Object,String,Number,null,Boolean]},contentCls:{type:[Array,Object,String,Number,null,Boolean]},contentWrapperCls:{type:[Array,Object,String,Number,null,Boolean]},expandCls:{type:[Array,Object,String,Number,null,Boolean]},leadingCls:{type:[Array,Object,String,Number,null,Boolean]},badgeCls:{type:[Array,Object,String,Number,null,Boolean]},collapsible:{default:"header"},bordered:{type:Boolean,default:!0},expandIconPosition:{default:"end"},disabled:{type:Boolean},dir:{},unmountOnHide:{type:Boolean},modelValue:{},defaultValue:{}},emits:["update:modelValue"],setup(u,{emit:o}){const n=u,r=o,a=e.useSlots(),h=e.useAttrs(),v=e.computed(()=>({...ie.omit(h,["as","asChild","collapsible","orientation","type"]),...ie.omit(n,["accordion","multiple","size","class","itemCls","headerCls","headerWrapperCls","titleCls","contentCls","contentWrapperCls","expandCls","leadingCls","badgeCls","collapsible","bordered","expandIconPosition"])})),_=g.useForwardPropsEmits(v,r),b=me.cva(f,{variants:{size:t.generateVariantClassList(se,f),bordered:t.generateVariantClassList("bordered",f)}}),{getDir:A}=ge.useConfig(),B=A();de({props:n,slots:a});const E=()=>{var c;const s=i.flattenChildren(((c=a.default)==null?void 0:c.call(a,{}))??[]);return!n.bordered&&s.length>1?s.flatMap((p,S)=>S<s.length-1?[p,e.h(Ce._sfc_main,{type:"horizontal"})]:[p]):s};return(s,c)=>(e.openBlock(),e.createBlock(e.unref(g.AccordionRoot),e.mergeProps(e.unref(_),{class:e.unref(t.normCls)(e.unref(b)(n),n.class),dir:e.unref(B),collapsible:!u.accordion,type:u.multiple?"multiple":"single"}),{default:e.withCtx(()=>[e.createVNode(E)]),_:1},16,["class","dir","collapsible","type"]))}}),ue=e.defineComponent({...t.getComponentOptions("AccordionItem"),__name:"AccordionItem",props:{class:{type:[Array,Object,String,Number,null,Boolean]},headerCls:{type:[Array,Object,String,Number,null,Boolean]},headerWrapperCls:{type:[Array,Object,String,Number,null,Boolean]},titleCls:{type:[Array,Object,String,Number,null,Boolean]},contentCls:{type:[Array,Object,String,Number,null,Boolean]},contentWrapperCls:{type:[Array,Object,String,Number,null,Boolean]},expandCls:{type:[Array,Object,String,Number,null,Boolean]},leadingCls:{type:[Array,Object,String,Number,null,Boolean]},badgeCls:{type:[Array,Object,String,Number,null,Boolean]},badge:{},leading:{},title:{},content:{},forceMount:{type:Boolean},disabled:{type:Boolean},value:{},unmountOnHide:{type:Boolean}},setup(u){const o=u,n=e.useSlots(),r=ce(),a=t.getBemElement(f,"item"),h=t.getBemElement(a,"header"),v=t.getBemElement(a,"content"),_=e.computed(()=>{var l;return o.disabled||((l=r.props)==null?void 0:l.disabled)}),b=e.computed(()=>{var l;return((l=r.props)==null?void 0:l.size)||"md"}),A=e.computed(()=>b.value==="lg"?"sm":b.value==="sm"?"2xsm":"xsm"),B=e.computed(()=>b.value==="lg"?"xsm":"2xsm"),E=l=>{var L,D,F,R,U,$,G,J,K,Q,X,Y,Z,ee,ne;const C=((L=r.props)==null?void 0:L.collapsible)==="header",m=()=>{var le,x,re,ae;const te=((le=n.expandIcon)==null?void 0:le.call(n,l))??((re=(x=r.slots)==null?void 0:x.expandIcon)==null?void 0:re.call(x,l)),oe=!i.isEmptyElement(te);return e.h(fe._sfc_main,{icon:oe?void 0:"tabler:chevron-down",as:C?void 0:g.AccordionTrigger,size:A.value,class:t.normCls(t.getBemElement(a,"expand"),o.expandCls,(ae=r.props)==null?void 0:ae.expandCls)},oe?{default:()=>te}:void 0)},d=(D=n.header)==null?void 0:D.call(n,l);if(!i.isEmptyElement(d))return d;const y=[],j=(F=n.leading)==null?void 0:F.call(n,{...l,iconSize:A.value}),I=!i.isEmptyElement(j);(o.leading||I)&&y.push(e.h("div",{class:t.normCls(t.getBemElement(a,"leading"),o.leadingCls,(R=r.props)==null?void 0:R.leadingCls)},I?j:o.leading));const P=(U=n.title)==null?void 0:U.call(n,l),z=!i.isEmptyElement(P);(o.title||z)&&y.push(e.h("div",{class:t.normCls(t.getBemElement(a,"title"),"paragraph",o.titleCls,($=r.props)==null?void 0:$.titleCls)},z?P:o.title));const q=(G=n.badgeIcon)==null?void 0:G.call(n,{...l,iconSize:be.getBadgeIconSize(B.value)}),T=!i.isEmptyElement(q),V=(J=n.badgeText)==null?void 0:J.call(n,l),W=!i.isEmptyElement(V);((K=o.badge)!=null&&K.text||(Q=o.badge)!=null&&Q.icon||T||W)&&y.push(e.h(ye._sfc_main,{size:B.value,...o.badge||{},class:o.badgeCls},{icon:()=>T?q:void 0,default:()=>W?V:void 0}));const H=(X=n.extra)==null?void 0:X.call(n,l);i.isEmptyElement(H)||y.push(H);const k=m(),w=[((Y=r.props)==null?void 0:Y.expandIconPosition)==="start"?k:null,e.h("div",{class:t.normCls(t.getBemElement(h,"wrapper"),o.headerWrapperCls,(Z=r.props)==null?void 0:Z.headerWrapperCls)},y),((ee=r.props)==null?void 0:ee.expandIconPosition)==="end"?k:null],M=t.normCls(h,o.headerCls,(ne=r.props)==null?void 0:ne.headerCls);return C?e.h(g.AccordionTrigger,{class:M},()=>w):e.h("div",{class:M},w)},s=e.ref(!1),c=e.ref(!1);let p=null;const S=()=>{p&&(clearTimeout(p),p=null)},pe=l=>{var m,d;s.value!==l.open&&(s.value=l.open,S(),l.open?(c.value=!1,p=setTimeout(()=>{c.value=!0,S()},300)):c.value=!1);const C=(m=n.default)==null?void 0:m.call(n,l);if(!i.isEmptyElement(C))return e.h(g.AccordionContent,{class:t.normCls(v,o.contentCls,(d=r.props)==null?void 0:d.contentCls),forceMount:o.forceMount,"data-opened":c.value?"":void 0},()=>{var O;return e.h("div",{class:t.normCls(t.getBemElement(v,"wrapper"),o.contentWrapperCls,(O=r.props)==null?void 0:O.contentWrapperCls)},C)})};return(l,C)=>{var m;return e.openBlock(),e.createBlock(e.unref(g.AccordionItem),{value:u.value,unmountOnHide:u.unmountOnHide,class:e.normalizeClass(e.unref(t.normCls)(e.unref(a),o.class,(m=e.unref(r).props)==null?void 0:m.itemCls)),disabled:_.value},{default:e.withCtx(({open:d})=>[e.createVNode(E,{open:d},null,8,["open"]),e.createVNode(pe,{open:d},null,8,["open"])]),_:1},8,["value","unmountOnHide","class","disabled"])}}}),ve=i.installComponent(N,t.getComponentName("Accordion")),Ae=i.installComponent(ue,t.getComponentName("AccordionItem"));exports.Accordion=N;exports.AccordionExpandIconPositions=he;exports.AccordionItem=ue;exports.AccordionItemPlugin=Ae;exports.AccordionPlugin=ve;exports.AccordionSizes=se;exports.accordionPrefix=f;exports.default=N;exports.injectAccordionContext=ce;exports.provideAccordionContext=de;
|