@volverjs/ui-vue 0.0.13-beta.4 → 0.0.13-beta.5
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/bin/icons.cjs +2 -1
- package/bin/icons.js +61 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +244 -1
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +529 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAction/VvAction.es.js +235 -1
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +374 -1
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +539 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.es.js +57 -1
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +150 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +58 -1
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +322 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +687 -1
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +125 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvCard/VvCard.es.js +76 -1
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +521 -1
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +708 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.es.js +2801 -1
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +215 -1
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +559 -1
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +339 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +60 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +42 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +162 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +94 -1
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +1315 -1
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +2225 -4
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvNav/VvNav.es.js +345 -1
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +265 -1
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +21 -1
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +85 -1
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.es.js +469 -1
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +656 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.es.js +803 -1
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvTab/VvTab.es.js +436 -1
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +1533 -2
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.es.js +78 -1
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvVirtualScroll/VvVirtualScroll.es.js +153 -1
- package/dist/components/VvVirtualScroll/VvVirtualScroll.umd.js +1 -1
- package/dist/components/index.es.js +7005 -6
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/index.es.js +232 -2
- package/dist/composables/index.umd.js +1 -1
- package/dist/directives/index.es.js +186 -2
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-contextmenu.es.js +97 -2
- package/dist/directives/v-contextmenu.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +93 -1
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +24 -1
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +160 -1
- package/dist/index.umd.js +1 -1
- package/dist/resolvers/unplugin.es.js +128 -1
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/package.json +24 -24
package/bin/icons.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("node:fs"),require("node:path"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("@iconify/utils"),require("chokidar")):typeof define=="function"&&define.amd?define(["exports","node:fs","node:path","yargs","yargs/helpers","@iconify/tools","@iconify/utils","chokidar"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e["generate-icons"]={},e.fileSystem,e.path,e.yargs,e.helpers,e.tools,e.utils,e.chokidar))})(this,(function(e,i,l,m,C,c,I,q){"use strict";function w(o,s="iconify",r={}){return i.readdirSync(o).forEach(n=>{i.statSync(`${o}/${n}`).isDirectory()?r=w(`${o}/${n}`,n,r):n.includes(".svg")&&(r[s]?r[s].push(l.join(o,"/",n)):r[s]=[l.join(o,"/",n)])}),r}async function O(o,s,r,a){const n=c.blankIconSet(o);for(const y of s)try{const k=await i.promises.readFile(y,{encoding:"utf-8"}),h=new c.SVG(k);await c.cleanupSVG(h),a?.keepColors||await c.parseColors(h,{defaultColor:"currentColor",callback:(x,S,$)=>!$||c.isEmptyColor($)||S.includes("var(")?S:"currentColor"}),await c.runSVGO(h);const j=y.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");n.fromSVG(j,h)}catch(k){console.error(k)}const g=n.export();try{I.validateIconSet(g)}catch(y){throw new Error(`Icon set is not valid: ${y?.message}`)}const v=`${r}/${g.prefix}.json`;i.mkdirSync(l.dirname(v),{recursive:!0}),i.writeFileSync(v,JSON.stringify(g))}function f(o,s,r){const a=w(o,r?.prefix);Object.keys(a).length?Object.keys(a).forEach(n=>{O(n,a[n],s,r),console.info(`Icons generated in: ${s}/${n}.json
|
|
2
|
+
`)}):console.error(`There are no files in ${o}`)}const u=m(C.hideBin(process.argv)).argv,t=u.srcPath,d=u.destPath||t;(!t||!d)&&(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit());const p={prefix:u.prefix,keepColors:u.keepColors};u.watch?(f(t,d,p),q.watch(t,{ignoreInitial:!0}).on("add",()=>{f(t,d,p)}).on("change",()=>{f(t,d,p)})):f(t,d,p),e.createIconifyJsonFiles=f,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/bin/icons.js
CHANGED
|
@@ -1,2 +1,62 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import i from "node:fs";
|
|
3
|
+
import u from "node:path";
|
|
4
|
+
import $ from "yargs";
|
|
5
|
+
import { hideBin as k } from "yargs/helpers";
|
|
6
|
+
import { blankIconSet as C, SVG as I, cleanupSVG as E, parseColors as G, isEmptyColor as O, runSVGO as V } from "@iconify/tools";
|
|
7
|
+
import { validateIconSet as x } from "@iconify/utils";
|
|
8
|
+
import J from "chokidar";
|
|
9
|
+
function w(r, n = "iconify", o = {}) {
|
|
10
|
+
return i.readdirSync(r).forEach((e) => {
|
|
11
|
+
i.statSync(`${r}/${e}`).isDirectory() ? o = w(`${r}/${e}`, e, o) : e.includes(".svg") && (o[n] ? o[n].push(u.join(r, "/", e)) : o[n] = [u.join(r, "/", e)]);
|
|
12
|
+
}), o;
|
|
13
|
+
}
|
|
14
|
+
async function P(r, n, o, s) {
|
|
15
|
+
const e = C(r);
|
|
16
|
+
for (const l of n)
|
|
17
|
+
try {
|
|
18
|
+
const h = await i.promises.readFile(l, {
|
|
19
|
+
encoding: "utf-8"
|
|
20
|
+
}), f = new I(h);
|
|
21
|
+
await E(f), s?.keepColors || await G(f, {
|
|
22
|
+
defaultColor: "currentColor",
|
|
23
|
+
callback: (j, g, S) => !S || O(S) || g.includes("var(") ? g : "currentColor"
|
|
24
|
+
}), await V(f);
|
|
25
|
+
const v = l.replace(/^.*[\\/]/, "").split(".")[0].replace(/ /g, "-").replace(/[^a-z0-9-]/gi, "");
|
|
26
|
+
e.fromSVG(v, f);
|
|
27
|
+
} catch (h) {
|
|
28
|
+
console.error(h);
|
|
29
|
+
}
|
|
30
|
+
const d = e.export();
|
|
31
|
+
try {
|
|
32
|
+
x(d);
|
|
33
|
+
} catch (l) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Icon set is not valid: ${l?.message}`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const y = `${o}/${d.prefix}.json`;
|
|
39
|
+
i.mkdirSync(u.dirname(y), { recursive: !0 }), i.writeFileSync(y, JSON.stringify(d));
|
|
40
|
+
}
|
|
41
|
+
function p(r, n, o) {
|
|
42
|
+
const s = w(r, o?.prefix);
|
|
43
|
+
Object.keys(s).length ? Object.keys(s).forEach((e) => {
|
|
44
|
+
P(e, s[e], n, o), console.info(`Icons generated in: ${n}/${e}.json
|
|
45
|
+
`);
|
|
46
|
+
}) : console.error(`There are no files in ${r}`);
|
|
47
|
+
}
|
|
48
|
+
const a = $(k(process.argv)).argv, t = a.srcPath, c = a.destPath || t;
|
|
49
|
+
(!t || !c) && (console.error(
|
|
50
|
+
"Please specify the srcPath and destPath with --srcPath and --destPath"
|
|
51
|
+
), process.exit());
|
|
52
|
+
const m = { prefix: a.prefix, keepColors: a.keepColors };
|
|
53
|
+
a.watch ? (p(t, c, m), J.watch(t, {
|
|
54
|
+
ignoreInitial: !0
|
|
55
|
+
}).on("add", () => {
|
|
56
|
+
p(t, c, m);
|
|
57
|
+
}).on("change", () => {
|
|
58
|
+
p(t, c, m);
|
|
59
|
+
})) : p(t, c, m);
|
|
60
|
+
export {
|
|
61
|
+
p as createIconifyJsonFiles
|
|
62
|
+
};
|
|
@@ -1 +1,244 @@
|
|
|
1
|
-
import{inject as
|
|
1
|
+
import { inject as L, computed as p, toRef as Y, unref as c, defineComponent as z, useAttrs as D, useId as U, toRefs as w, ref as J, watch as E, onBeforeUnmount as K, createElementBlock as q, openBlock as F, normalizeClass as H, createElementVNode as C, withModifiers as Q, renderSlot as $, normalizeProps as R, guardReactiveProps as k, createTextVNode as G, toDisplayString as I } from "vue";
|
|
2
|
+
import { useVModel as W } from "@vueuse/core";
|
|
3
|
+
var P = /* @__PURE__ */ ((e) => (e.local = "local", e.session = "session", e))(P || {}), V = /* @__PURE__ */ ((e) => (e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e))(V || {}), M = /* @__PURE__ */ ((e) => (e.before = "before", e.after = "after", e))(M || {}), O = /* @__PURE__ */ ((e) => (e.button = "button", e.submit = "submit", e.reset = "reset", e))(O || {}), B = /* @__PURE__ */ ((e) => (e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e))(B || {});
|
|
4
|
+
const X = /* @__PURE__ */ Symbol.for(
|
|
5
|
+
"accordionGroup"
|
|
6
|
+
), Z = {
|
|
7
|
+
/**
|
|
8
|
+
* Component BEM modifiers
|
|
9
|
+
*/
|
|
10
|
+
modifiers: {
|
|
11
|
+
type: [String, Array],
|
|
12
|
+
default: void 0
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
M.before;
|
|
16
|
+
V.bottom;
|
|
17
|
+
O.button, B.button;
|
|
18
|
+
P.local;
|
|
19
|
+
function T(e) {
|
|
20
|
+
const n = L(e, void 0), d = p(() => n !== void 0);
|
|
21
|
+
function i(s, r, u) {
|
|
22
|
+
const o = n?.[s];
|
|
23
|
+
if (o)
|
|
24
|
+
return p({
|
|
25
|
+
get() {
|
|
26
|
+
return o.value;
|
|
27
|
+
},
|
|
28
|
+
set(m) {
|
|
29
|
+
o.value = m;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const v = Y(r, s);
|
|
33
|
+
return p({
|
|
34
|
+
get() {
|
|
35
|
+
return v.value;
|
|
36
|
+
},
|
|
37
|
+
set(m) {
|
|
38
|
+
u && u(`update:${s}`, m);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
group: n,
|
|
44
|
+
isInGroup: d,
|
|
45
|
+
getGroupOrLocalRef: i
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const ee = {
|
|
49
|
+
...Z,
|
|
50
|
+
/**
|
|
51
|
+
* Accordion name
|
|
52
|
+
*/
|
|
53
|
+
name: String,
|
|
54
|
+
/**
|
|
55
|
+
* Header title
|
|
56
|
+
*/
|
|
57
|
+
title: String,
|
|
58
|
+
/**
|
|
59
|
+
* Content text
|
|
60
|
+
*/
|
|
61
|
+
content: String,
|
|
62
|
+
/**
|
|
63
|
+
* (Optional) Defines if item is open. Event "update:modelValue" is emitted on accordion header click
|
|
64
|
+
*/
|
|
65
|
+
modelValue: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: void 0
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* If true, the accordion will be disabled
|
|
71
|
+
*/
|
|
72
|
+
disabled: Boolean,
|
|
73
|
+
/**
|
|
74
|
+
* If true, the accordion will be opened by default
|
|
75
|
+
*/
|
|
76
|
+
not: Boolean
|
|
77
|
+
}, te = ["update:modelValue"];
|
|
78
|
+
function oe(e) {
|
|
79
|
+
const { group: n, isInGroup: d } = T(
|
|
80
|
+
X
|
|
81
|
+
), i = p(
|
|
82
|
+
() => !!(e.disabled || n?.disabled.value)
|
|
83
|
+
), s = p(() => {
|
|
84
|
+
let r = e.modifiers, u = n?.modifiers.value;
|
|
85
|
+
const o = /* @__PURE__ */ new Set();
|
|
86
|
+
return r && (Array.isArray(r) || (r = r.split(" ")), r.forEach((v) => o.add(v))), u && (Array.isArray(u) || (u = u.split(" ")), u.forEach((v) => o.add(v))), Array.from(o);
|
|
87
|
+
});
|
|
88
|
+
return {
|
|
89
|
+
// group props
|
|
90
|
+
isInGroup: d,
|
|
91
|
+
group: n,
|
|
92
|
+
modifiers: s,
|
|
93
|
+
disabled: i,
|
|
94
|
+
bus: n?.bus
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function re(e, n, d) {
|
|
98
|
+
return p(() => {
|
|
99
|
+
const i = {
|
|
100
|
+
[e]: !0
|
|
101
|
+
}, s = typeof n?.value == "string" ? n.value.split(" ") : n?.value;
|
|
102
|
+
return s && Array.isArray(s) && s.forEach((r) => {
|
|
103
|
+
r && (i[`${e}--${r}`] = !0);
|
|
104
|
+
}), d && Object.keys(d.value).forEach((r) => {
|
|
105
|
+
i[`${e}--${r}`] = c(d.value[r]);
|
|
106
|
+
}), i;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const ne = ["id", "open"], ae = ["aria-controls", "aria-expanded"], ie = ["aria-hidden"], se = {
|
|
110
|
+
name: "VvAccordion"
|
|
111
|
+
}, de = /* @__PURE__ */ z({
|
|
112
|
+
...se,
|
|
113
|
+
props: ee,
|
|
114
|
+
emits: te,
|
|
115
|
+
setup(e, { expose: n, emit: d }) {
|
|
116
|
+
const i = e, s = d, r = D(), u = W(i, "modelValue", s), o = p(
|
|
117
|
+
() => i.name || r?.id || U()
|
|
118
|
+
), { title: v, content: m, not: x } = w(i), { isInGroup: S, modifiers: N, disabled: h, bus: l } = oe(i), a = J(!1);
|
|
119
|
+
E(
|
|
120
|
+
u,
|
|
121
|
+
(t) => {
|
|
122
|
+
typeof t == "boolean" && (a.value = x.value ? !t : t);
|
|
123
|
+
},
|
|
124
|
+
{ immediate: !0 }
|
|
125
|
+
), E(a, (t) => {
|
|
126
|
+
u.value = x.value ? !t : t;
|
|
127
|
+
}), l?.on("toggle", ({ name: t, value: f }) => {
|
|
128
|
+
t === o.value && (a.value = f);
|
|
129
|
+
});
|
|
130
|
+
function b() {
|
|
131
|
+
if (!h.value) {
|
|
132
|
+
if (S.value) {
|
|
133
|
+
l?.emit("toggle", {
|
|
134
|
+
name: o.value,
|
|
135
|
+
value: !a.value
|
|
136
|
+
});
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
a.value = !a.value;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
E(
|
|
143
|
+
o,
|
|
144
|
+
(t, f) => {
|
|
145
|
+
l && (f && f !== t && l.emit("unregister", { name: f }), l.emit("register", { name: t }));
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
immediate: !0
|
|
149
|
+
}
|
|
150
|
+
), K(() => {
|
|
151
|
+
l && l.emit("unregister", { name: o.value });
|
|
152
|
+
});
|
|
153
|
+
function g() {
|
|
154
|
+
a.value || b();
|
|
155
|
+
}
|
|
156
|
+
function y() {
|
|
157
|
+
a.value && b();
|
|
158
|
+
}
|
|
159
|
+
function _(t) {
|
|
160
|
+
if (!l) {
|
|
161
|
+
console.warn(
|
|
162
|
+
`[VvAccordion]: You are trying to expand accordion group of "${o.value}" but it is not in a group`
|
|
163
|
+
);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
l.emit("expand", { name: t });
|
|
167
|
+
}
|
|
168
|
+
function A(t) {
|
|
169
|
+
if (!l) {
|
|
170
|
+
console.warn(
|
|
171
|
+
`[VvAccordion]: You are trying to collapse accordion group of "${o.value}" but it is not in a group`
|
|
172
|
+
);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
l?.emit("collapse", { name: t });
|
|
176
|
+
}
|
|
177
|
+
n({
|
|
178
|
+
/** Whether the accordion is expanded */
|
|
179
|
+
isExpanded: a,
|
|
180
|
+
/** Expand the accordion */
|
|
181
|
+
expand: g,
|
|
182
|
+
/** Collapse the accordion */
|
|
183
|
+
collapse: y,
|
|
184
|
+
/** Expand accordions in the same group */
|
|
185
|
+
groupExpand: _,
|
|
186
|
+
/** Collapse accordions in the same group */
|
|
187
|
+
groupCollapse: A
|
|
188
|
+
});
|
|
189
|
+
const j = re(
|
|
190
|
+
"vv-accordion",
|
|
191
|
+
N,
|
|
192
|
+
p(() => ({
|
|
193
|
+
disabled: h.value
|
|
194
|
+
}))
|
|
195
|
+
);
|
|
196
|
+
return (t, f) => (F(), q("details", {
|
|
197
|
+
id: c(o),
|
|
198
|
+
class: H(c(j)),
|
|
199
|
+
open: c(a)
|
|
200
|
+
}, [
|
|
201
|
+
C("summary", {
|
|
202
|
+
"aria-controls": c(o),
|
|
203
|
+
"aria-expanded": c(a),
|
|
204
|
+
class: "vv-accordion__summary",
|
|
205
|
+
onClick: f[0] || (f[0] = Q((ue) => b(), ["prevent"]))
|
|
206
|
+
}, [
|
|
207
|
+
$(t.$slots, "summary", R(k({
|
|
208
|
+
isExpanded: c(a),
|
|
209
|
+
expand: g,
|
|
210
|
+
collapse: y,
|
|
211
|
+
groupExpand: _,
|
|
212
|
+
groupCollapse: A
|
|
213
|
+
})), () => [
|
|
214
|
+
G(
|
|
215
|
+
I(c(v)),
|
|
216
|
+
1
|
|
217
|
+
/* TEXT */
|
|
218
|
+
)
|
|
219
|
+
])
|
|
220
|
+
], 8, ae),
|
|
221
|
+
C("div", {
|
|
222
|
+
"aria-hidden": !c(a),
|
|
223
|
+
class: "vv-accordion__content"
|
|
224
|
+
}, [
|
|
225
|
+
$(t.$slots, "default", R(k({
|
|
226
|
+
isExpanded: c(a),
|
|
227
|
+
expand: g,
|
|
228
|
+
collapse: y,
|
|
229
|
+
groupExpand: _,
|
|
230
|
+
groupCollapse: A
|
|
231
|
+
})), () => [
|
|
232
|
+
G(
|
|
233
|
+
I(c(m)),
|
|
234
|
+
1
|
|
235
|
+
/* TEXT */
|
|
236
|
+
)
|
|
237
|
+
])
|
|
238
|
+
], 8, ie)
|
|
239
|
+
], 10, ne));
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
export {
|
|
243
|
+
de as default
|
|
244
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(e,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core"],m):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAccordion=m(e.vue,e.core))})(this,(function(e,m){"use strict";var A=(t=>(t.local="local",t.session="session",t))(A||{}),E=(t=>(t.left="left",t.right="right",t.top="top",t.bottom="bottom",t))(E||{}),x=(t=>(t.before="before",t.after="after",t))(x||{}),C=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(C||{}),R=(t=>(t.nuxtLink="nuxt-link",t.routerLink="router-link",t.a="a",t.button="button",t))(R||{});const P=Symbol.for("accordionGroup"),k={modifiers:{type:[String,Array],default:void 0}};x.before,E.bottom,C.button,R.button,A.local;function G(t){const i=e.inject(t,void 0),d=e.computed(()=>i!==void 0);function s(u,n,c){const r=i?.[u];if(r)return e.computed({get(){return r.value},set(g){r.value=g}});const p=e.toRef(n,u);return e.computed({get(){return p.value},set(g){c&&c(`update:${u}`,g)}})}return{group:i,isInGroup:d,getGroupOrLocalRef:s}}const I={...k,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean},S=["update:modelValue"];function M(t){const{group:i,isInGroup:d}=G(P),s=e.computed(()=>!!(t.disabled||i?.disabled.value)),u=e.computed(()=>{let n=t.modifiers,c=i?.modifiers.value;const r=new Set;return n&&(Array.isArray(n)||(n=n.split(" ")),n.forEach(p=>r.add(p))),c&&(Array.isArray(c)||(c=c.split(" ")),c.forEach(p=>r.add(p))),Array.from(r)});return{isInGroup:d,group:i,modifiers:u,disabled:s,bus:i?.bus}}function N(t,i,d){return e.computed(()=>{const s={[t]:!0},u=typeof i?.value=="string"?i.value.split(" "):i?.value;return u&&Array.isArray(u)&&u.forEach(n=>{n&&(s[`${t}--${n}`]=!0)}),d&&Object.keys(d.value).forEach(n=>{s[`${t}--${n}`]=e.unref(d.value[n])}),s})}const O=["id","open"],B=["aria-controls","aria-expanded"],j=["aria-hidden"],w={name:"VvAccordion"};return e.defineComponent({...w,props:I,emits:S,setup(t,{expose:i,emit:d}){const s=t,u=d,n=e.useAttrs(),c=m.useVModel(s,"modelValue",u),r=e.computed(()=>s.name||n?.id||e.useId()),{title:p,content:g,not:V}=e.toRefs(s),{isInGroup:z,modifiers:D,disabled:$,bus:l}=M(s),a=e.ref(!1);e.watch(c,o=>{typeof o=="boolean"&&(a.value=V.value?!o:o)},{immediate:!0}),e.watch(a,o=>{c.value=V.value?!o:o}),l?.on("toggle",({name:o,value:f})=>{o===r.value&&(a.value=f)});function b(){if(!$.value){if(z.value){l?.emit("toggle",{name:r.value,value:!a.value});return}a.value=!a.value}}e.watch(r,(o,f)=>{l&&(f&&f!==o&&l.emit("unregister",{name:f}),l.emit("register",{name:o}))},{immediate:!0}),e.onBeforeUnmount(()=>{l&&l.emit("unregister",{name:r.value})});function y(){a.value||b()}function _(){a.value&&b()}function v(o){if(!l){console.warn(`[VvAccordion]: You are trying to expand accordion group of "${r.value}" but it is not in a group`);return}l.emit("expand",{name:o})}function h(o){if(!l){console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${r.value}" but it is not in a group`);return}l?.emit("collapse",{name:o})}i({isExpanded:a,expand:y,collapse:_,groupExpand:v,groupCollapse:h});const L=N("vv-accordion",D,e.computed(()=>({disabled:$.value})));return(o,f)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(r),class:e.normalizeClass(e.unref(L)),open:e.unref(a)},[e.createElementVNode("summary",{"aria-controls":e.unref(r),"aria-expanded":e.unref(a),class:"vv-accordion__summary",onClick:f[0]||(f[0]=e.withModifiers(q=>b(),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(a),expand:y,collapse:_,groupExpand:v,groupCollapse:h})),()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)])],8,B),e.createElementVNode("div",{"aria-hidden":!e.unref(a),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({isExpanded:e.unref(a),expand:y,collapse:_,groupExpand:v,groupCollapse:h})),()=>[e.createTextVNode(e.toDisplayString(e.unref(g)),1)])],8,j)],10,O))}})}));
|