@volverjs/ui-vue 0.0.13-beta.8 → 0.0.13-beta.9

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.
Files changed (129) hide show
  1. package/README.md +79 -0
  2. package/dist/components/VvAccordion/VvAccordion.es.js +128 -130
  3. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  4. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
  5. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +163 -165
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +2 -2
  8. package/dist/components/VvAction/VvAction.es.js +57 -60
  9. package/dist/components/VvAction/VvAction.umd.js +1 -1
  10. package/dist/components/VvAction/VvAction.vue.d.ts +2 -2
  11. package/dist/components/VvAction/index.d.ts +1 -1
  12. package/dist/components/VvAlert/VvAlert.es.js +128 -129
  13. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  14. package/dist/components/VvAlert/VvAlert.vue.d.ts +5 -5
  15. package/dist/components/VvAlert/index.d.ts +1 -1
  16. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +156 -157
  17. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  18. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
  19. package/dist/components/VvAvatar/VvAvatar.es.js +58 -59
  20. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  21. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +69 -70
  22. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  23. package/dist/components/VvBadge/VvBadge.es.js +67 -68
  24. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  25. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  26. package/dist/components/VvBadge/index.d.ts +1 -1
  27. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +93 -96
  28. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  29. package/dist/components/VvButton/VvButton.es.js +103 -106
  30. package/dist/components/VvButton/VvButton.umd.js +1 -1
  31. package/dist/components/VvButton/VvButton.vue.d.ts +13 -13
  32. package/dist/components/VvButton/index.d.ts +5 -5
  33. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +63 -65
  34. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  35. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  36. package/dist/components/VvCard/VvCard.es.js +66 -67
  37. package/dist/components/VvCard/VvCard.umd.js +1 -1
  38. package/dist/components/VvCheckbox/VvCheckbox.es.js +185 -187
  39. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  40. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +16 -16
  41. package/dist/components/VvCheckbox/index.d.ts +6 -6
  42. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +159 -161
  43. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  44. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +11 -11
  45. package/dist/components/VvCheckboxGroup/index.d.ts +2 -2
  46. package/dist/components/VvCombobox/VvCombobox.es.js +297 -299
  47. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  48. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +7 -7
  49. package/dist/components/VvCombobox/index.d.ts +14 -14
  50. package/dist/components/VvDialog/VvDialog.es.js +80 -81
  51. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  52. package/dist/components/VvDialog/VvDialog.vue.d.ts +3 -3
  53. package/dist/components/VvDialog/index.d.ts +1 -1
  54. package/dist/components/VvDropdown/VvDropdown.es.js +184 -186
  55. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  56. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +15 -15
  57. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +3 -3
  58. package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +2 -2
  59. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
  60. package/dist/components/VvDropdown/index.d.ts +1 -1
  61. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +110 -112
  62. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  63. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +46 -48
  64. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  65. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +54 -55
  66. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  67. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +77 -79
  68. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  69. package/dist/components/VvIcon/VvIcon.es.js +44 -44
  70. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  71. package/dist/components/VvInputFile/VvInputFile.es.js +315 -318
  72. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  73. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +11 -11
  74. package/dist/components/VvInputFile/index.d.ts +4 -4
  75. package/dist/components/VvInputText/VvInputText.es.js +156 -158
  76. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  77. package/dist/components/VvInputText/VvInputText.vue.d.ts +25 -25
  78. package/dist/components/VvInputText/index.d.ts +10 -10
  79. package/dist/components/VvNav/VvNav.es.js +123 -126
  80. package/dist/components/VvNav/VvNav.umd.js +1 -1
  81. package/dist/components/VvNavItem/VvNavItem.es.js +105 -108
  82. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  83. package/dist/components/VvProgress/VvProgress.es.js +67 -68
  84. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  85. package/dist/components/VvProgress/VvProgress.vue.d.ts +5 -5
  86. package/dist/components/VvProgress/index.d.ts +2 -2
  87. package/dist/components/VvRadio/VvRadio.es.js +155 -157
  88. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  89. package/dist/components/VvRadio/VvRadio.vue.d.ts +14 -14
  90. package/dist/components/VvRadio/index.d.ts +5 -5
  91. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +170 -172
  92. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  93. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +11 -11
  94. package/dist/components/VvRadioGroup/index.d.ts +2 -2
  95. package/dist/components/VvSelect/VvSelect.es.js +188 -189
  96. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  97. package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
  98. package/dist/components/VvSelect/index.d.ts +10 -10
  99. package/dist/components/VvTab/VvTab.es.js +142 -145
  100. package/dist/components/VvTab/VvTab.umd.js +1 -1
  101. package/dist/components/VvTextarea/VvTextarea.es.js +278 -280
  102. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  103. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -21
  104. package/dist/components/VvTextarea/index.d.ts +8 -8
  105. package/dist/components/VvTooltip/VvTooltip.es.js +64 -65
  106. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  107. package/dist/components/common/VvInputClearAction.d.ts +1 -1
  108. package/dist/composables/index.es.js +69 -69
  109. package/dist/composables/index.umd.js +2 -2
  110. package/dist/directives/index.es.js +67 -68
  111. package/dist/directives/index.umd.js +2 -2
  112. package/dist/directives/v-contextmenu.es.js +23 -23
  113. package/dist/directives/v-contextmenu.umd.js +2 -2
  114. package/dist/directives/v-tooltip.es.js +57 -58
  115. package/dist/directives/v-tooltip.umd.js +1 -1
  116. package/dist/icons.es.js +3 -3
  117. package/dist/icons.umd.js +1 -1
  118. package/dist/index.es.js +88 -88
  119. package/dist/index.umd.js +1 -1
  120. package/dist/json-render/catalog.d.ts +395 -0
  121. package/dist/json-render/components.d.ts +111 -0
  122. package/dist/json-render/definitions.d.ts +697 -0
  123. package/dist/json-render/index.d.ts +55 -0
  124. package/dist/json-render/index.es.js +5329 -0
  125. package/dist/json-render/index.umd.js +1 -0
  126. package/dist/json-render/registry.d.ts +34 -0
  127. package/dist/props/index.d.ts +19 -19
  128. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +79 -79
  129. package/package.json +56 -31
package/README.md CHANGED
@@ -328,12 +328,91 @@ The following features are planned for the next releases:
328
328
  - [x] (v0.0.6) Alerts, notifications and toasts with `VvAlert` and `VvAlertGroup` component;
329
329
  - [x] (v0.0.10) Multiple uploads with `VvInputFile`;
330
330
  - [x] (v0.0.10) `useBlurhash` composable;
331
+ - [x] (v0.0.13) Generative UI with [json-render](https://json-render.dev) catalog & registry;
331
332
  - [ ] Image crop and file previews;
332
333
  - [ ] Loaders with `VvLoader` and `VvSkeleton`;
333
334
  - [ ] `VvTable` component with sort, filters, pagination and cell editing;
334
335
  - [ ] Carousel and galleries with `VvCarousel` component;
335
336
  - [ ] Calendar and date picker with `VvCalendar` component.
336
337
 
338
+ ## Generative UI (json-render)
339
+
340
+ `@volverjs/ui-vue` ships with a built-in [json-render](https://json-render.dev) catalog and registry, enabling LLMs to generate UIs using Volver components.
341
+
342
+ ### Quick start
343
+
344
+ ```typescript
345
+ import { catalog, registry } from '@volverjs/ui-vue/json-render'
346
+
347
+ // Generate a system prompt for your AI model
348
+ const systemPrompt = catalog.prompt()
349
+ ```
350
+
351
+ The `catalog` declares **26 components** (layout, data display, actions, navigation, forms) with Zod-validated props and AI-friendly descriptions. The `registry` maps each catalog type to the real Vue component.
352
+
353
+ ### Rendering AI-generated specs
354
+
355
+ ```vue
356
+ <script setup lang="ts">
357
+ import {
358
+ Renderer,
359
+ StateProvider,
360
+ VisibilityProvider,
361
+ } from '@json-render/vue'
362
+ import { registry } from '@volverjs/ui-vue/json-render'
363
+
364
+ const spec = ref(null)
365
+ </script>
366
+
367
+ <template>
368
+ <StateProvider :initial-state="{}">
369
+ <VisibilityProvider>
370
+ <Renderer :spec="spec" :registry="registry" />
371
+ </VisibilityProvider>
372
+ </StateProvider>
373
+ </template>
374
+ ```
375
+
376
+ ### Custom catalog (subset of components)
377
+
378
+ You can build a custom catalog with only the components you need:
379
+
380
+ ```typescript
381
+ import { defineCatalog } from '@json-render/core'
382
+ import { defineRegistry, schema } from '@json-render/vue'
383
+ import {
384
+ volverComponentDefinitions,
385
+ volverComponents,
386
+ } from '@volverjs/ui-vue/json-render'
387
+
388
+ // Pick only the components you need
389
+ const myCatalog = defineCatalog(schema, {
390
+ components: {
391
+ Button: volverComponentDefinitions.Button,
392
+ Card: volverComponentDefinitions.Card,
393
+ InputText: volverComponentDefinitions.InputText,
394
+ },
395
+ actions: {},
396
+ })
397
+
398
+ // Create a matching registry
399
+ const { registry } = defineRegistry(myCatalog, {
400
+ components: {
401
+ Button: volverComponents.Button,
402
+ Card: volverComponents.Card,
403
+ InputText: volverComponents.InputText,
404
+ },
405
+ })
406
+ ```
407
+
408
+ ### Peer dependencies
409
+
410
+ To use the json-render integration, install the required peer dependencies:
411
+
412
+ ```bash
413
+ pnpm add @json-render/core @json-render/vue zod
414
+ ```
415
+
337
416
  ## Documentation
338
417
 
339
418
  To learn more about `@volverjs/ui-vue`, check [its documentation](https://volverjs.github.io/ui-vue).
@@ -1,4 +1,4 @@
1
- import { computed as v, createElementBlock as W, createElementVNode as j, createTextVNode as x, defineComponent as z, guardReactiveProps as T, inject as H, normalizeClass as Q, normalizeProps as k, onBeforeUnmount as X, openBlock as Z, ref as ee, renderSlot as w, toDisplayString as L, toRef as te, toRefs as re, unref as d, useAttrs as oe, useId as ae, watch as E, withModifiers as ne } from "vue";
1
+ import { computed as c, createElementBlock as H, createElementVNode as I, createTextVNode as w, defineComponent as J, guardReactiveProps as L, inject as W, normalizeClass as Q, normalizeProps as R, onBeforeUnmount as X, openBlock as Z, ref as ee, renderSlot as V, toDisplayString as $, toRef as te, toRefs as re, unref as d, useAttrs as ae, useId as oe, watch as _, withModifiers as ne } from "vue";
2
2
  import { useVModel as le } from "@vueuse/core";
3
3
  var ie = {
4
4
  showPassword: "eye-on",
@@ -13,7 +13,7 @@ var ie = {
13
13
  download: "download"
14
14
  }, ue = /* @__PURE__ */ (function(e) {
15
15
  return e.simple = "simple", e.normal = "normal", e.detailed = "detailed", e;
16
- })({}), Ve = { prefix: ue.normal }, V = /* @__PURE__ */ (function(e) {
16
+ })({}), Ge = { prefix: ue.normal }, G = /* @__PURE__ */ (function(e) {
17
17
  return e.local = "local", e.session = "session", e;
18
18
  })({}), de = /* @__PURE__ */ (function(e) {
19
19
  return e.absolute = "absolute", e.fixed = "fixed", e;
@@ -21,15 +21,13 @@ var ie = {
21
21
  return e.left = "left", e.right = "right", e.top = "top", e.bottom = "bottom", e;
22
22
  })({}), se = /* @__PURE__ */ (function(e) {
23
23
  return e.topStart = "top-start", e.topEnd = "top-end", e.bottomStart = "bottom-start", e.bottomEnd = "bottom-end", e.leftStart = "left-start", e.leftEnd = "left-end", e.rightStart = "right-start", e.rightEnd = "right-end", e;
24
- })({}), K = /* @__PURE__ */ (function(e) {
24
+ })({}), M = /* @__PURE__ */ (function(e) {
25
25
  return e.before = "before", e.after = "after", e;
26
- })({}), Y = /* @__PURE__ */ (function(e) {
26
+ })({}), F = /* @__PURE__ */ (function(e) {
27
27
  return e.button = "button", e.submit = "submit", e.reset = "reset", e;
28
28
  })({}), fe = /* @__PURE__ */ (function(e) {
29
29
  return e.nuxtLink = "nuxt-link", e.routerLink = "router-link", e.a = "a", e.button = "button", e;
30
- })({});
31
- var pe = /* @__PURE__ */ Symbol.for("accordionGroup");
32
- var ve = {
30
+ })({}), pe = /* @__PURE__ */ Symbol.for("accordionGroup"), ce = {
33
31
  to: { type: [String, Object] },
34
32
  href: String,
35
33
  target: String,
@@ -37,7 +35,7 @@ var ve = {
37
35
  type: String,
38
36
  default: "noopener noreferrer"
39
37
  }
40
- }, I = {
38
+ }, A = {
41
39
  valid: {
42
40
  type: Boolean,
43
41
  default: !1
@@ -55,7 +53,7 @@ var ve = {
55
53
  type: [String, Array],
56
54
  default: void 0
57
55
  }
58
- }, h = {
56
+ }, j = {
59
57
  loading: {
60
58
  type: Boolean,
61
59
  default: !1
@@ -67,10 +65,10 @@ var ve = {
67
65
  }, y = { disabled: {
68
66
  type: Boolean,
69
67
  default: !1
70
- } }, $ = { required: {
68
+ } }, K = { required: {
71
69
  type: Boolean,
72
70
  default: !1
73
- } }, ce = { active: {
71
+ } }, ve = { active: {
74
72
  type: Boolean,
75
73
  default: !1
76
74
  } }, ye = { current: {
@@ -89,22 +87,22 @@ var ve = {
89
87
  type: String,
90
88
  default: "Clear"
91
89
  }
92
- }, be = { pressed: {
90
+ }, ge = { pressed: {
93
91
  type: Boolean,
94
92
  default: !1
95
- } }, b = { label: {
93
+ } }, g = { label: {
96
94
  type: [String, Number],
97
95
  default: void 0
98
- } }, B = { readonly: {
96
+ } }, x = { readonly: {
99
97
  type: Boolean,
100
98
  default: !1
101
- } }, g = { modifiers: {
99
+ } }, b = { modifiers: {
102
100
  type: [String, Array],
103
101
  default: void 0
104
- } }, A = { hintLabel: {
102
+ } }, N = { hintLabel: {
105
103
  type: String,
106
104
  default: ""
107
- } }, ge = {
105
+ } }, be = {
108
106
  options: {
109
107
  type: Array,
110
108
  default: () => []
@@ -133,23 +131,23 @@ var ve = {
133
131
  } }, Se = { debounce: {
134
132
  type: [Number, String],
135
133
  default: void 0
136
- } }, _e = {
134
+ } }, Pe = {
137
135
  icon: {
138
136
  type: [String, Object],
139
137
  default: void 0
140
138
  },
141
139
  iconPosition: {
142
140
  type: String,
143
- default: K.before,
144
- validation: (e) => Object.values(K).includes(e)
141
+ default: M.before,
142
+ validation: (e) => Object.values(M).includes(e)
145
143
  }
146
- }, J = { tabindex: {
144
+ }, q = { tabindex: {
147
145
  type: [String, Number],
148
146
  default: 0
149
- } }, Oe = { floating: {
147
+ } }, he = { floating: {
150
148
  type: Boolean,
151
149
  default: !1
152
- } }, Pe = { id: [String, Number] }, Ke = {
150
+ } }, Be = { id: [String, Number] }, Me = {
153
151
  placement: {
154
152
  type: String,
155
153
  default: D.bottom,
@@ -204,35 +202,35 @@ var ve = {
204
202
  type: Boolean,
205
203
  default: !1
206
204
  }
207
- }, M = {
208
- ...Pe,
205
+ }, z = {
206
+ ...Be,
209
207
  name: {
210
208
  type: String,
211
209
  required: !0
212
210
  }
213
- }, Ne = { autofocus: {
211
+ }, Oe = { autofocus: {
214
212
  type: Boolean,
215
213
  default: !1
216
- } }, Ee = { autocomplete: {
214
+ } }, _e = { autocomplete: {
217
215
  type: String,
218
216
  default: "off"
219
- } }, Ye = {
220
- ...M,
221
- ...Ne,
222
- ...Ee,
223
- ...J,
217
+ } }, Fe = {
218
+ ...z,
219
+ ...Oe,
220
+ ..._e,
221
+ ...q,
224
222
  ...y,
225
- ...B,
226
- ...I,
227
- ...C,
223
+ ...x,
228
224
  ...A,
229
- ...h,
230
- ...g,
225
+ ...C,
226
+ ...N,
227
+ ...j,
228
+ ...b,
231
229
  ...me,
232
230
  ...Se,
233
- ..._e,
234
- ...Oe,
235
- ...b,
231
+ ...Pe,
232
+ ...he,
233
+ ...g,
236
234
  minlength: {
237
235
  type: [String, Number],
238
236
  default: void 0
@@ -245,18 +243,18 @@ var ve = {
245
243
  type: String,
246
244
  default: void 0
247
245
  },
248
- ...$
249
- }, $e = {
250
- ...M,
251
- ...J,
252
- ...I,
253
- ...C,
246
+ ...K
247
+ }, Ke = {
248
+ ...z,
249
+ ...q,
254
250
  ...A,
251
+ ...C,
252
+ ...N,
255
253
  ...y,
256
- ...B,
257
- ...g,
254
+ ...x,
258
255
  ...b,
259
- ...h,
256
+ ...g,
257
+ ...j,
260
258
  value: {
261
259
  type: [
262
260
  String,
@@ -274,17 +272,17 @@ var ve = {
274
272
  ],
275
273
  default: void 0
276
274
  }
277
- }, Je = {
278
- ...I,
279
- ...C,
280
- ...ge,
275
+ }, qe = {
281
276
  ...A,
277
+ ...C,
278
+ ...be,
279
+ ...N,
282
280
  ...y,
283
- ...B,
284
- ...g,
281
+ ...x,
285
282
  ...b,
286
- ...h,
287
- ...$,
283
+ ...g,
284
+ ...j,
285
+ ...K,
288
286
  modelValue: {
289
287
  type: [
290
288
  String,
@@ -303,17 +301,17 @@ var ve = {
303
301
  type: Boolean,
304
302
  default: !1
305
303
  }
306
- }, Me = {
304
+ }, ze = {
307
305
  ...y,
308
- ...b,
309
- ...be,
310
- ...ce,
311
- ...ye,
306
+ ...g,
307
+ ...ge,
312
308
  ...ve,
309
+ ...ye,
310
+ ...ce,
313
311
  type: {
314
312
  type: String,
315
- default: Y.button,
316
- validator: (e) => Object.values(Y).includes(e)
313
+ default: F.button,
314
+ validator: (e) => Object.values(F).includes(e)
317
315
  },
318
316
  ariaLabel: {
319
317
  type: String,
@@ -323,33 +321,33 @@ var ve = {
323
321
  type: String,
324
322
  default: fe.button
325
323
  }
326
- }, Ue = {
324
+ }, Ye = {
327
325
  storageType: {
328
326
  type: String,
329
- default: V.local,
330
- validator: (e) => Object.values(V).includes(e)
327
+ default: G.local,
328
+ validator: (e) => Object.values(G).includes(e)
331
329
  },
332
330
  storageKey: String
333
331
  };
334
- function Ie(e) {
335
- const n = H(e, void 0), s = v(() => n !== void 0);
336
- function i(o, a, f) {
337
- const r = n?.[o];
338
- if (r) return v({
332
+ function Ae(e) {
333
+ const n = W(e, void 0), s = c(() => n !== void 0);
334
+ function i(a, o, f) {
335
+ const r = n?.[a];
336
+ if (r) return c({
339
337
  get() {
340
338
  return r.value;
341
339
  },
342
- set(c) {
343
- r.value = c;
340
+ set(v) {
341
+ r.value = v;
344
342
  }
345
343
  });
346
- const m = te(a, o);
347
- return v({
344
+ const m = te(o, a);
345
+ return c({
348
346
  get() {
349
347
  return m.value;
350
348
  },
351
- set(c) {
352
- f && f(`update:${o}`, c);
349
+ set(v) {
350
+ f && f(`update:${a}`, v);
353
351
  }
354
352
  });
355
353
  }
@@ -360,7 +358,7 @@ function Ie(e) {
360
358
  };
361
359
  }
362
360
  var Ce = {
363
- ...g,
361
+ ...b,
364
362
  name: String,
365
363
  title: String,
366
364
  content: String,
@@ -370,47 +368,47 @@ var Ce = {
370
368
  },
371
369
  disabled: Boolean,
372
370
  not: Boolean
373
- }, he = ["update:modelValue"];
374
- function Be(e) {
375
- const { group: n, isInGroup: s } = Ie(pe), i = v(() => !!(e.disabled || n?.disabled.value));
371
+ }, je = ["update:modelValue"];
372
+ function xe(e) {
373
+ const { group: n, isInGroup: s } = Ae(pe), i = c(() => !!(e.disabled || n?.disabled.value));
376
374
  return {
377
375
  isInGroup: s,
378
376
  group: n,
379
- modifiers: v(() => {
380
- let o = e.modifiers, a = n?.modifiers.value;
377
+ modifiers: c(() => {
378
+ let a = e.modifiers, o = n?.modifiers.value;
381
379
  const f = /* @__PURE__ */ new Set();
382
- return o && (Array.isArray(o) || (o = o.split(" ")), o.forEach((r) => f.add(r))), a && (Array.isArray(a) || (a = a.split(" ")), a.forEach((r) => f.add(r))), [...f];
380
+ return a && (Array.isArray(a) || (a = a.split(" ")), a.forEach((r) => f.add(r))), o && (Array.isArray(o) || (o = o.split(" ")), o.forEach((r) => f.add(r))), [...f];
383
381
  }),
384
382
  disabled: i,
385
383
  bus: n?.bus
386
384
  };
387
385
  }
388
- function Ae(e, n, s) {
389
- return v(() => {
390
- const i = { [e]: !0 }, o = typeof n?.value == "string" ? n.value.split(" ") : n?.value;
391
- return o && Array.isArray(o) && o.forEach((a) => {
392
- a && (i[`${e}--${a}`] = !0);
393
- }), s && Object.keys(s.value).forEach((a) => {
394
- i[`${e}--${a}`] = d(s.value[a]);
386
+ function Ne(e, n, s) {
387
+ return c(() => {
388
+ const i = { [e]: !0 }, a = typeof n?.value == "string" ? n.value.split(" ") : n?.value;
389
+ return a && Array.isArray(a) && a.forEach((o) => {
390
+ o && (i[`${e}--${o}`] = !0);
391
+ }), s && Object.keys(s.value).forEach((o) => {
392
+ i[`${e}--${o}`] = d(s.value[o]);
395
393
  }), i;
396
394
  });
397
395
  }
398
- var Re = ["id", "open"], Ge = ["aria-controls", "aria-expanded"], je = ["aria-hidden"], xe = { name: "VvAccordion" }, Te = /* @__PURE__ */ z({
399
- ...xe,
396
+ var Ee = ["id", "open"], ke = ["aria-controls", "aria-expanded"], Ie = ["aria-hidden"], we = { name: "VvAccordion" }, Le = /* @__PURE__ */ J({
397
+ ...we,
400
398
  props: Ce,
401
- emits: he,
399
+ emits: je,
402
400
  setup(e, { expose: n, emit: s }) {
403
- const i = e, o = s, a = oe(), f = le(i, "modelValue", o), r = v(() => i.name || a?.id || ae()), { title: m, content: c, not: R } = re(i), { isInGroup: U, modifiers: F, disabled: G, bus: u } = Be(i), l = ee(!1);
404
- E(f, (t) => {
405
- typeof t == "boolean" && (l.value = R.value ? !t : t);
406
- }, { immediate: !0 }), E(l, (t) => {
407
- f.value = R.value ? !t : t;
401
+ const i = e, a = s, o = ae(), f = le(i, "modelValue", a), r = c(() => i.name || o?.id || oe()), { title: m, content: v, not: E } = re(i), { isInGroup: Y, modifiers: T, disabled: k, bus: u } = xe(i), l = ee(!1);
402
+ _(f, (t) => {
403
+ typeof t == "boolean" && (l.value = E.value ? !t : t);
404
+ }, { immediate: !0 }), _(l, (t) => {
405
+ f.value = E.value ? !t : t;
408
406
  }), u?.on("toggle", ({ name: t, value: p }) => {
409
407
  t === r.value && (l.value = p);
410
408
  });
411
409
  function S() {
412
- if (!G.value) {
413
- if (U.value) {
410
+ if (!k.value) {
411
+ if (Y.value) {
414
412
  u?.emit("toggle", {
415
413
  name: r.value,
416
414
  value: !l.value
@@ -420,25 +418,25 @@ var Re = ["id", "open"], Ge = ["aria-controls", "aria-expanded"], je = ["aria-hi
420
418
  l.value = !l.value;
421
419
  }
422
420
  }
423
- E(r, (t, p) => {
421
+ _(r, (t, p) => {
424
422
  u && (p && p !== t && u.emit("unregister", { name: p }), u.emit("register", { name: t }));
425
423
  }, { immediate: !0 }), X(() => {
426
424
  u && u.emit("unregister", { name: r.value });
427
425
  });
428
- function _() {
426
+ function P() {
429
427
  l.value || S();
430
428
  }
431
- function O() {
429
+ function h() {
432
430
  l.value && S();
433
431
  }
434
- function P(t) {
432
+ function B(t) {
435
433
  if (!u) {
436
434
  console.warn(`[VvAccordion]: You are trying to expand accordion group of "${r.value}" but it is not in a group`);
437
435
  return;
438
436
  }
439
437
  u.emit("expand", { name: t });
440
438
  }
441
- function N(t) {
439
+ function O(t) {
442
440
  if (!u) {
443
441
  console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${r.value}" but it is not in a group`);
444
442
  return;
@@ -447,39 +445,39 @@ var Re = ["id", "open"], Ge = ["aria-controls", "aria-expanded"], je = ["aria-hi
447
445
  }
448
446
  n({
449
447
  isExpanded: l,
450
- expand: _,
451
- collapse: O,
452
- groupExpand: P,
453
- groupCollapse: N
448
+ expand: P,
449
+ collapse: h,
450
+ groupExpand: B,
451
+ groupCollapse: O
454
452
  });
455
- const q = Ae("vv-accordion", F, v(() => ({ disabled: G.value })));
456
- return (t, p) => (Z(), W("details", {
453
+ const U = Ne("vv-accordion", T, c(() => ({ disabled: k.value })));
454
+ return (t, p) => (Z(), H("details", {
457
455
  id: d(r),
458
- class: Q(d(q)),
456
+ class: Q(d(U)),
459
457
  open: d(l)
460
- }, [j("summary", {
458
+ }, [I("summary", {
461
459
  "aria-controls": d(r),
462
460
  "aria-expanded": d(l),
463
461
  class: "vv-accordion__summary",
464
- onClick: p[0] || (p[0] = ne((ke) => S(), ["prevent"]))
465
- }, [w(t.$slots, "summary", k(T({
462
+ onClick: p[0] || (p[0] = ne((Re) => S(), ["prevent"]))
463
+ }, [V(t.$slots, "summary", R(L({
466
464
  isExpanded: d(l),
467
- expand: _,
468
- collapse: O,
469
- groupExpand: P,
470
- groupCollapse: N
471
- })), () => [x(L(d(m)), 1)])], 8, Ge), j("div", {
465
+ expand: P,
466
+ collapse: h,
467
+ groupExpand: B,
468
+ groupCollapse: O
469
+ })), () => [w($(d(m)), 1)])], 8, ke), I("div", {
472
470
  "aria-hidden": !d(l),
473
471
  class: "vv-accordion__content"
474
- }, [w(t.$slots, "default", k(T({
472
+ }, [V(t.$slots, "default", R(L({
475
473
  isExpanded: d(l),
476
- expand: _,
477
- collapse: O,
478
- groupExpand: P,
479
- groupCollapse: N
480
- })), () => [x(L(d(c)), 1)])], 8, je)], 10, Re));
474
+ expand: P,
475
+ collapse: h,
476
+ groupExpand: B,
477
+ groupCollapse: O
478
+ })), () => [w($(d(v)), 1)])], 8, Ie)], 10, Ee));
481
479
  }
482
- }), Fe = Te;
480
+ }), Te = Le;
483
481
  export {
484
- Fe as default
482
+ Te as default
485
483
  };
@@ -1 +1 @@
1
- (function(t,c){typeof exports=="object"&&typeof module<"u"?module.exports=c(require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core"],c):(t=typeof globalThis<"u"?globalThis:t||self,t.VvAccordion=c(t.Vue,t.VueuseCore))})(this,function(t,c){var D={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},L=(function(e){return e.simple="simple",e.normal="normal",e.detailed="detailed",e})({}),me={prefix:L.normal},A=(function(e){return e.local="local",e.session="session",e})({}),K=(function(e){return e.absolute="absolute",e.fixed="fixed",e})({}),R=(function(e){return e.left="left",e.right="right",e.top="top",e.bottom="bottom",e})({}),Y=(function(e){return e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e})({}),x=(function(e){return e.before="before",e.after="after",e})({}),T=(function(e){return e.button="button",e.submit="submit",e.reset="reset",e})({}),$=(function(e){return e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e})({}),be=Symbol.for("volver"),ge=Symbol.for("buttonGroup"),Se=Symbol.for("radioGroup"),_e=Symbol.for("checkGroup"),J=Symbol.for("accordionGroup"),Oe=Symbol.for("dropdownTrigger"),Pe=Symbol.for("dropdownItem"),Ne=Symbol.for("dropdownAction"),Ee=Symbol.for("alertGroup"),M={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},g={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},S={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},_={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},V={required:{type:Boolean,default:!1}},U={active:{type:Boolean,default:!1}},q={current:{type:Boolean,default:!1}},he={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:D.clear},labelClear:{type:String,default:"Clear"}},F={pressed:{type:Boolean,default:!1}},m={label:{type:[String,Number],default:void 0}},O={readonly:{type:Boolean,default:!1}},b={modifiers:{type:[String,Array],default:void 0}},P={hintLabel:{type:String,default:""}},z={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},W={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},H={debounce:{type:[Number,String],default:void 0}},Q={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:x.before,validation:e=>Object.values(x).includes(e)}},j={tabindex:{type:[String,Number],default:0}},X={floating:{type:Boolean,default:!1}},Z={id:[String,Number]},Ie={placement:{type:String,default:R.bottom,validator:e=>Object.values(R).includes(e)||Object.values(Y).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(K).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},G={...Z,name:{type:String,required:!0}},ee={autofocus:{type:Boolean,default:!1}},te={autocomplete:{type:String,default:"off"}},Ce={...G,...ee,...te,...j,...y,...O,...g,...S,...P,..._,...b,...W,...H,...Q,...X,...m,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...V},Be={...G,...j,...g,...S,...P,...y,...O,...b,...m,..._,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},Ae={...g,...S,...z,...P,...y,...O,...b,...m,..._,...V,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}},Re={...y,...m,...F,...U,...q,...M,type:{type:String,default:T.button,validator:e=>Object.values(T).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:$.button}},xe={storageType:{type:String,default:A.local,validator:e=>Object.values(A).includes(e)},storageKey:String};function re(e){const i=(0,t.inject)(e,void 0),s=(0,t.computed)(()=>i!==void 0);function d(a,n,f){const o=i?.[a];if(o)return(0,t.computed)({get(){return o.value},set(v){o.value=v}});const N=(0,t.toRef)(n,a);return(0,t.computed)({get(){return N.value},set(v){f&&f(`update:${a}`,v)}})}return{group:i,isInGroup:s,getGroupOrLocalRef:d}}var oe={...b,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean},ae=["update:modelValue"];function ne(e){const{group:i,isInGroup:s}=re(J),d=(0,t.computed)(()=>!!(e.disabled||i?.disabled.value));return{isInGroup:s,group:i,modifiers:(0,t.computed)(()=>{let a=e.modifiers,n=i?.modifiers.value;const f=new Set;return a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach(o=>f.add(o))),n&&(Array.isArray(n)||(n=n.split(" ")),n.forEach(o=>f.add(o))),[...f]}),disabled:d,bus:i?.bus}}function ie(e,i,s){return(0,t.computed)(()=>{const d={[e]:!0},a=typeof i?.value=="string"?i.value.split(" "):i?.value;return a&&Array.isArray(a)&&a.forEach(n=>{n&&(d[`${e}--${n}`]=!0)}),s&&Object.keys(s.value).forEach(n=>{d[`${e}--${n}`]=(0,t.unref)(s.value[n])}),d})}var le=["id","open"],de=["aria-controls","aria-expanded"],ue=["aria-hidden"],se={name:"VvAccordion"},fe=(0,t.defineComponent)({...se,props:oe,emits:ae,setup(e,{expose:i,emit:s}){const d=e,a=s,n=(0,t.useAttrs)(),f=(0,c.useVModel)(d,"modelValue",a),o=(0,t.computed)(()=>d.name||n?.id||(0,t.useId)()),{title:N,content:v,not:w}=(0,t.toRefs)(d),{isInGroup:ce,modifiers:ve,disabled:k,bus:u}=ne(d),l=(0,t.ref)(!1);(0,t.watch)(f,r=>{typeof r=="boolean"&&(l.value=w.value?!r:r)},{immediate:!0}),(0,t.watch)(l,r=>{f.value=w.value?!r:r}),u?.on("toggle",({name:r,value:p})=>{r===o.value&&(l.value=p)});function E(){if(!k.value){if(ce.value){u?.emit("toggle",{name:o.value,value:!l.value});return}l.value=!l.value}}(0,t.watch)(o,(r,p)=>{u&&(p&&p!==r&&u.emit("unregister",{name:p}),u.emit("register",{name:r}))},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{u&&u.emit("unregister",{name:o.value})});function h(){l.value||E()}function I(){l.value&&E()}function C(r){if(!u){console.warn(`[VvAccordion]: You are trying to expand accordion group of "${o.value}" but it is not in a group`);return}u.emit("expand",{name:r})}function B(r){if(!u){console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${o.value}" but it is not in a group`);return}u?.emit("collapse",{name:r})}i({isExpanded:l,expand:h,collapse:I,groupExpand:C,groupCollapse:B});const ye=ie("vv-accordion",ve,(0,t.computed)(()=>({disabled:k.value})));return(r,p)=>((0,t.openBlock)(),(0,t.createElementBlock)("details",{id:(0,t.unref)(o),class:(0,t.normalizeClass)((0,t.unref)(ye)),open:(0,t.unref)(l)},[(0,t.createElementVNode)("summary",{"aria-controls":(0,t.unref)(o),"aria-expanded":(0,t.unref)(l),class:"vv-accordion__summary",onClick:p[0]||(p[0]=(0,t.withModifiers)(Te=>E(),["prevent"]))},[(0,t.renderSlot)(r.$slots,"summary",(0,t.normalizeProps)((0,t.guardReactiveProps)({isExpanded:(0,t.unref)(l),expand:h,collapse:I,groupExpand:C,groupCollapse:B})),()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(N)),1)])],8,de),(0,t.createElementVNode)("div",{"aria-hidden":!(0,t.unref)(l),class:"vv-accordion__content"},[(0,t.renderSlot)(r.$slots,"default",(0,t.normalizeProps)((0,t.guardReactiveProps)({isExpanded:(0,t.unref)(l),expand:h,collapse:I,groupExpand:C,groupCollapse:B})),()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(v)),1)])],8,ue)],10,le))}}),pe=fe;return pe});
1
+ (function(t,c){typeof exports=="object"&&typeof module<"u"?module.exports=c(require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","@vueuse/core"],c):(t=typeof globalThis<"u"?globalThis:t||self,t.VvAccordion=c(t.Vue,t.VueuseCore))})(this,function(t,c){var G={showPassword:"eye-on",hidePassword:"eye-off",showDatePicker:"calendar",showTimePicker:"time",showColorPicker:"color",clear:"close",add:"add",remove:"trash",edit:"edit",download:"download"},D=(function(e){return e.simple="simple",e.normal="normal",e.detailed="detailed",e})({}),ge={prefix:D.normal},j=(function(e){return e.local="local",e.session="session",e})({}),q=(function(e){return e.absolute="absolute",e.fixed="fixed",e})({}),E=(function(e){return e.left="left",e.right="right",e.top="top",e.bottom="bottom",e})({}),M=(function(e){return e.topStart="top-start",e.topEnd="top-end",e.bottomStart="bottom-start",e.bottomEnd="bottom-end",e.leftStart="left-start",e.leftEnd="left-end",e.rightStart="right-start",e.rightEnd="right-end",e})({}),V=(function(e){return e.before="before",e.after="after",e})({}),k=(function(e){return e.button="button",e.submit="submit",e.reset="reset",e})({}),F=(function(e){return e.nuxtLink="nuxt-link",e.routerLink="router-link",e.a="a",e.button="button",e})({}),K=Symbol.for("accordionGroup"),T={to:{type:[String,Object]},href:String,target:String,rel:{type:String,default:"noopener noreferrer"}},b={valid:{type:Boolean,default:!1},validLabel:{type:[String,Array],default:void 0}},S={invalid:{type:Boolean,default:!1},invalidLabel:{type:[String,Array],default:void 0}},P={loading:{type:Boolean,default:!1},loadingLabel:{type:String,default:"Loading..."}},y={disabled:{type:Boolean,default:!1}},w={required:{type:Boolean,default:!1}},z={active:{type:Boolean,default:!1}},Y={current:{type:Boolean,default:!1}},me={showClearAction:{type:Boolean,default:!1},iconClear:{type:[String,Object],default:G.clear},labelClear:{type:String,default:"Clear"}},U={pressed:{type:Boolean,default:!1}},g={label:{type:[String,Number],default:void 0}},h={readonly:{type:Boolean,default:!1}},m={modifiers:{type:[String,Array],default:void 0}},B={hintLabel:{type:String,default:""}},H={options:{type:Array,default:()=>[]},labelKey:{type:[String,Function],default:"label"},valueKey:{type:[String,Function],default:"value"},disabledKey:{type:[String,Function],default:"disabled"}},J={count:{type:[Boolean,String],default:!1,validator:e=>[!0,!1,"limit","countdown"].includes(e)}},W={debounce:{type:[Number,String],default:void 0}},Q={icon:{type:[String,Object],default:void 0},iconPosition:{type:String,default:V.before,validation:e=>Object.values(V).includes(e)}},I={tabindex:{type:[String,Number],default:0}},X={floating:{type:Boolean,default:!1}},Z={id:[String,Number]},be={placement:{type:String,default:E.bottom,validator:e=>Object.values(E).includes(e)||Object.values(M).includes(e)},strategy:{type:String,default:void 0,validator:e=>Object.values(q).includes(e)},transitionName:{type:String,default:void 0},offset:{type:[Number,String,Object],default:0},shift:{type:[Boolean,Object],default:!1},flip:{type:[Boolean,Object],default:!0},size:{type:[Boolean,Object],default:()=>({padding:10})},autoPlacement:{type:[Boolean,Object],default:!1},arrow:{type:Boolean,default:!1},keepOpen:{type:Boolean,default:!1},autofocusFirst:{type:Boolean,default:!0},triggerWidth:{type:Boolean,default:!1}},R={...Z,name:{type:String,required:!0}},ee={autofocus:{type:Boolean,default:!1}},te={autocomplete:{type:String,default:"off"}},Se={...R,...ee,...te,...I,...y,...h,...b,...S,...B,...P,...m,...J,...W,...Q,...X,...g,minlength:{type:[String,Number],default:void 0},maxlength:{type:[String,Number],default:void 0},placeholder:{type:String,default:void 0},...w},Pe={...R,...I,...b,...S,...B,...y,...h,...m,...g,...P,value:{type:[String,Number,Boolean],default:void 0},modelValue:{type:[Object,Number,Boolean,String],default:void 0}},he={...b,...S,...H,...B,...y,...h,...m,...g,...P,...w,modelValue:{type:[String,Array,Boolean,Number,Symbol],default:void 0},name:{type:String,required:!0},vertical:{type:Boolean,default:!1}},Be={...y,...g,...U,...z,...Y,...T,type:{type:String,default:k.button,validator:e=>Object.values(k).includes(e)},ariaLabel:{type:String,default:void 0},defaultTag:{type:String,default:F.button}},Ae={storageType:{type:String,default:j.local,validator:e=>Object.values(j).includes(e)},storageKey:String};function re(e){const i=(0,t.inject)(e,void 0),s=(0,t.computed)(()=>i!==void 0);function d(a,n,f){const o=i?.[a];if(o)return(0,t.computed)({get(){return o.value},set(v){o.value=v}});const A=(0,t.toRef)(n,a);return(0,t.computed)({get(){return A.value},set(v){f&&f(`update:${a}`,v)}})}return{group:i,isInGroup:s,getGroupOrLocalRef:d}}var oe={...m,name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},disabled:Boolean,not:Boolean},ae=["update:modelValue"];function ne(e){const{group:i,isInGroup:s}=re(K),d=(0,t.computed)(()=>!!(e.disabled||i?.disabled.value));return{isInGroup:s,group:i,modifiers:(0,t.computed)(()=>{let a=e.modifiers,n=i?.modifiers.value;const f=new Set;return a&&(Array.isArray(a)||(a=a.split(" ")),a.forEach(o=>f.add(o))),n&&(Array.isArray(n)||(n=n.split(" ")),n.forEach(o=>f.add(o))),[...f]}),disabled:d,bus:i?.bus}}function ie(e,i,s){return(0,t.computed)(()=>{const d={[e]:!0},a=typeof i?.value=="string"?i.value.split(" "):i?.value;return a&&Array.isArray(a)&&a.forEach(n=>{n&&(d[`${e}--${n}`]=!0)}),s&&Object.keys(s.value).forEach(n=>{d[`${e}--${n}`]=(0,t.unref)(s.value[n])}),d})}var le=["id","open"],de=["aria-controls","aria-expanded"],ue=["aria-hidden"],se={name:"VvAccordion"},fe=(0,t.defineComponent)({...se,props:oe,emits:ae,setup(e,{expose:i,emit:s}){const d=e,a=s,n=(0,t.useAttrs)(),f=(0,c.useVModel)(d,"modelValue",a),o=(0,t.computed)(()=>d.name||n?.id||(0,t.useId)()),{title:A,content:v,not:L}=(0,t.toRefs)(d),{isInGroup:ce,modifiers:ve,disabled:$,bus:u}=ne(d),l=(0,t.ref)(!1);(0,t.watch)(f,r=>{typeof r=="boolean"&&(l.value=L.value?!r:r)},{immediate:!0}),(0,t.watch)(l,r=>{f.value=L.value?!r:r}),u?.on("toggle",({name:r,value:p})=>{r===o.value&&(l.value=p)});function O(){if(!$.value){if(ce.value){u?.emit("toggle",{name:o.value,value:!l.value});return}l.value=!l.value}}(0,t.watch)(o,(r,p)=>{u&&(p&&p!==r&&u.emit("unregister",{name:p}),u.emit("register",{name:r}))},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{u&&u.emit("unregister",{name:o.value})});function _(){l.value||O()}function C(){l.value&&O()}function x(r){if(!u){console.warn(`[VvAccordion]: You are trying to expand accordion group of "${o.value}" but it is not in a group`);return}u.emit("expand",{name:r})}function N(r){if(!u){console.warn(`[VvAccordion]: You are trying to collapse accordion group of "${o.value}" but it is not in a group`);return}u?.emit("collapse",{name:r})}i({isExpanded:l,expand:_,collapse:C,groupExpand:x,groupCollapse:N});const ye=ie("vv-accordion",ve,(0,t.computed)(()=>({disabled:$.value})));return(r,p)=>((0,t.openBlock)(),(0,t.createElementBlock)("details",{id:(0,t.unref)(o),class:(0,t.normalizeClass)((0,t.unref)(ye)),open:(0,t.unref)(l)},[(0,t.createElementVNode)("summary",{"aria-controls":(0,t.unref)(o),"aria-expanded":(0,t.unref)(l),class:"vv-accordion__summary",onClick:p[0]||(p[0]=(0,t.withModifiers)(Oe=>O(),["prevent"]))},[(0,t.renderSlot)(r.$slots,"summary",(0,t.normalizeProps)((0,t.guardReactiveProps)({isExpanded:(0,t.unref)(l),expand:_,collapse:C,groupExpand:x,groupCollapse:N})),()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(A)),1)])],8,de),(0,t.createElementVNode)("div",{"aria-hidden":!(0,t.unref)(l),class:"vv-accordion__content"},[(0,t.renderSlot)(r.$slots,"default",(0,t.normalizeProps)((0,t.guardReactiveProps)({isExpanded:(0,t.unref)(l),expand:_,collapse:C,groupExpand:x,groupCollapse:N})),()=>[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(v)),1)])],8,ue)],10,le))}}),pe=fe;return pe});
@@ -40,10 +40,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<global
40
40
  default: undefined;
41
41
  };
42
42
  }>> & Readonly<{}>, {
43
- disabled: boolean;
44
43
  modelValue: boolean;
45
- not: boolean;
46
44
  modifiers: string | string[];
45
+ disabled: boolean;
46
+ not: boolean;
47
47
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
48
48
  summary?: (props: {
49
49
  isExpanded: boolean;