@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.
- package/README.md +79 -0
- package/dist/components/VvAccordion/VvAccordion.es.js +128 -130
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +2 -2
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +163 -165
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +2 -2
- package/dist/components/VvAction/VvAction.es.js +57 -60
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +2 -2
- package/dist/components/VvAction/index.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.es.js +128 -129
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +5 -5
- package/dist/components/VvAlert/index.d.ts +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +156 -157
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +3 -3
- package/dist/components/VvAvatar/VvAvatar.es.js +58 -59
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +69 -70
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.es.js +67 -68
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
- package/dist/components/VvBadge/index.d.ts +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +93 -96
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvButton/VvButton.es.js +103 -106
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +13 -13
- package/dist/components/VvButton/index.d.ts +5 -5
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +63 -65
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
- package/dist/components/VvCard/VvCard.es.js +66 -67
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +185 -187
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +16 -16
- package/dist/components/VvCheckbox/index.d.ts +6 -6
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +159 -161
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +11 -11
- package/dist/components/VvCheckboxGroup/index.d.ts +2 -2
- package/dist/components/VvCombobox/VvCombobox.es.js +297 -299
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +7 -7
- package/dist/components/VvCombobox/index.d.ts +14 -14
- package/dist/components/VvDialog/VvDialog.es.js +80 -81
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +3 -3
- package/dist/components/VvDialog/index.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdown.es.js +184 -186
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +15 -15
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +3 -3
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +2 -2
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +1 -1
- package/dist/components/VvDropdown/index.d.ts +1 -1
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +110 -112
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +46 -48
- package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +54 -55
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +77 -79
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +44 -44
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +315 -318
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +11 -11
- package/dist/components/VvInputFile/index.d.ts +4 -4
- package/dist/components/VvInputText/VvInputText.es.js +156 -158
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +25 -25
- package/dist/components/VvInputText/index.d.ts +10 -10
- package/dist/components/VvNav/VvNav.es.js +123 -126
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNavItem/VvNavItem.es.js +105 -108
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.es.js +67 -68
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +5 -5
- package/dist/components/VvProgress/index.d.ts +2 -2
- package/dist/components/VvRadio/VvRadio.es.js +155 -157
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +14 -14
- package/dist/components/VvRadio/index.d.ts +5 -5
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +170 -172
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +11 -11
- package/dist/components/VvRadioGroup/index.d.ts +2 -2
- package/dist/components/VvSelect/VvSelect.es.js +188 -189
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +5 -5
- package/dist/components/VvSelect/index.d.ts +10 -10
- package/dist/components/VvTab/VvTab.es.js +142 -145
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.es.js +278 -280
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -21
- package/dist/components/VvTextarea/index.d.ts +8 -8
- package/dist/components/VvTooltip/VvTooltip.es.js +64 -65
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/common/VvInputClearAction.d.ts +1 -1
- package/dist/composables/index.es.js +69 -69
- package/dist/composables/index.umd.js +2 -2
- package/dist/directives/index.es.js +67 -68
- package/dist/directives/index.umd.js +2 -2
- package/dist/directives/v-contextmenu.es.js +23 -23
- package/dist/directives/v-contextmenu.umd.js +2 -2
- package/dist/directives/v-tooltip.es.js +57 -58
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +88 -88
- package/dist/index.umd.js +1 -1
- package/dist/json-render/catalog.d.ts +395 -0
- package/dist/json-render/components.d.ts +111 -0
- package/dist/json-render/definitions.d.ts +697 -0
- package/dist/json-render/index.d.ts +55 -0
- package/dist/json-render/index.es.js +5329 -0
- package/dist/json-render/index.umd.js +1 -0
- package/dist/json-render/registry.d.ts +34 -0
- package/dist/props/index.d.ts +19 -19
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +79 -79
- 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
|
|
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
|
-
})({}),
|
|
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
|
-
})({}),
|
|
24
|
+
})({}), M = /* @__PURE__ */ (function(e) {
|
|
25
25
|
return e.before = "before", e.after = "after", e;
|
|
26
|
-
})({}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
} },
|
|
68
|
+
} }, K = { required: {
|
|
71
69
|
type: Boolean,
|
|
72
70
|
default: !1
|
|
73
|
-
} },
|
|
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
|
-
},
|
|
90
|
+
}, ge = { pressed: {
|
|
93
91
|
type: Boolean,
|
|
94
92
|
default: !1
|
|
95
|
-
} },
|
|
93
|
+
} }, g = { label: {
|
|
96
94
|
type: [String, Number],
|
|
97
95
|
default: void 0
|
|
98
|
-
} },
|
|
96
|
+
} }, x = { readonly: {
|
|
99
97
|
type: Boolean,
|
|
100
98
|
default: !1
|
|
101
|
-
} },
|
|
99
|
+
} }, b = { modifiers: {
|
|
102
100
|
type: [String, Array],
|
|
103
101
|
default: void 0
|
|
104
|
-
} },
|
|
102
|
+
} }, N = { hintLabel: {
|
|
105
103
|
type: String,
|
|
106
104
|
default: ""
|
|
107
|
-
} },
|
|
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
|
-
} },
|
|
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:
|
|
144
|
-
validation: (e) => Object.values(
|
|
141
|
+
default: M.before,
|
|
142
|
+
validation: (e) => Object.values(M).includes(e)
|
|
145
143
|
}
|
|
146
|
-
},
|
|
144
|
+
}, q = { tabindex: {
|
|
147
145
|
type: [String, Number],
|
|
148
146
|
default: 0
|
|
149
|
-
} },
|
|
147
|
+
} }, he = { floating: {
|
|
150
148
|
type: Boolean,
|
|
151
149
|
default: !1
|
|
152
|
-
} },
|
|
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
|
-
},
|
|
208
|
-
...
|
|
205
|
+
}, z = {
|
|
206
|
+
...Be,
|
|
209
207
|
name: {
|
|
210
208
|
type: String,
|
|
211
209
|
required: !0
|
|
212
210
|
}
|
|
213
|
-
},
|
|
211
|
+
}, Oe = { autofocus: {
|
|
214
212
|
type: Boolean,
|
|
215
213
|
default: !1
|
|
216
|
-
} },
|
|
214
|
+
} }, _e = { autocomplete: {
|
|
217
215
|
type: String,
|
|
218
216
|
default: "off"
|
|
219
|
-
} },
|
|
220
|
-
...
|
|
221
|
-
...
|
|
222
|
-
...
|
|
223
|
-
...
|
|
217
|
+
} }, Fe = {
|
|
218
|
+
...z,
|
|
219
|
+
...Oe,
|
|
220
|
+
..._e,
|
|
221
|
+
...q,
|
|
224
222
|
...y,
|
|
225
|
-
...
|
|
226
|
-
...I,
|
|
227
|
-
...C,
|
|
223
|
+
...x,
|
|
228
224
|
...A,
|
|
229
|
-
...
|
|
230
|
-
...
|
|
225
|
+
...C,
|
|
226
|
+
...N,
|
|
227
|
+
...j,
|
|
228
|
+
...b,
|
|
231
229
|
...me,
|
|
232
230
|
...Se,
|
|
233
|
-
...
|
|
234
|
-
...
|
|
235
|
-
...
|
|
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
|
-
},
|
|
250
|
-
...
|
|
251
|
-
...
|
|
252
|
-
...I,
|
|
253
|
-
...C,
|
|
246
|
+
...K
|
|
247
|
+
}, Ke = {
|
|
248
|
+
...z,
|
|
249
|
+
...q,
|
|
254
250
|
...A,
|
|
251
|
+
...C,
|
|
252
|
+
...N,
|
|
255
253
|
...y,
|
|
256
|
-
...
|
|
257
|
-
...g,
|
|
254
|
+
...x,
|
|
258
255
|
...b,
|
|
259
|
-
...
|
|
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
|
-
},
|
|
278
|
-
...I,
|
|
279
|
-
...C,
|
|
280
|
-
...ge,
|
|
275
|
+
}, qe = {
|
|
281
276
|
...A,
|
|
277
|
+
...C,
|
|
278
|
+
...be,
|
|
279
|
+
...N,
|
|
282
280
|
...y,
|
|
283
|
-
...
|
|
284
|
-
...g,
|
|
281
|
+
...x,
|
|
285
282
|
...b,
|
|
286
|
-
...
|
|
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
|
-
},
|
|
304
|
+
}, ze = {
|
|
307
305
|
...y,
|
|
308
|
-
...
|
|
309
|
-
...
|
|
310
|
-
...ce,
|
|
311
|
-
...ye,
|
|
306
|
+
...g,
|
|
307
|
+
...ge,
|
|
312
308
|
...ve,
|
|
309
|
+
...ye,
|
|
310
|
+
...ce,
|
|
313
311
|
type: {
|
|
314
312
|
type: String,
|
|
315
|
-
default:
|
|
316
|
-
validator: (e) => Object.values(
|
|
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
|
-
},
|
|
324
|
+
}, Ye = {
|
|
327
325
|
storageType: {
|
|
328
326
|
type: String,
|
|
329
|
-
default:
|
|
330
|
-
validator: (e) => Object.values(
|
|
327
|
+
default: G.local,
|
|
328
|
+
validator: (e) => Object.values(G).includes(e)
|
|
331
329
|
},
|
|
332
330
|
storageKey: String
|
|
333
331
|
};
|
|
334
|
-
function
|
|
335
|
-
const n =
|
|
336
|
-
function i(
|
|
337
|
-
const r = n?.[
|
|
338
|
-
if (r) return
|
|
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(
|
|
343
|
-
r.value =
|
|
340
|
+
set(v) {
|
|
341
|
+
r.value = v;
|
|
344
342
|
}
|
|
345
343
|
});
|
|
346
|
-
const m = te(
|
|
347
|
-
return
|
|
344
|
+
const m = te(o, a);
|
|
345
|
+
return c({
|
|
348
346
|
get() {
|
|
349
347
|
return m.value;
|
|
350
348
|
},
|
|
351
|
-
set(
|
|
352
|
-
f && f(`update:${
|
|
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
|
-
...
|
|
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
|
-
},
|
|
374
|
-
function
|
|
375
|
-
const { group: n, isInGroup: s } =
|
|
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:
|
|
380
|
-
let
|
|
377
|
+
modifiers: c(() => {
|
|
378
|
+
let a = e.modifiers, o = n?.modifiers.value;
|
|
381
379
|
const f = /* @__PURE__ */ new Set();
|
|
382
|
-
return
|
|
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
|
|
389
|
-
return
|
|
390
|
-
const i = { [e]: !0 },
|
|
391
|
-
return
|
|
392
|
-
|
|
393
|
-
}), s && Object.keys(s.value).forEach((
|
|
394
|
-
i[`${e}--${
|
|
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
|
|
399
|
-
...
|
|
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:
|
|
399
|
+
emits: je,
|
|
402
400
|
setup(e, { expose: n, emit: s }) {
|
|
403
|
-
const i = e,
|
|
404
|
-
|
|
405
|
-
typeof t == "boolean" && (l.value =
|
|
406
|
-
}, { immediate: !0 }),
|
|
407
|
-
f.value =
|
|
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 (!
|
|
413
|
-
if (
|
|
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
|
-
|
|
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
|
|
429
|
+
function h() {
|
|
432
430
|
l.value && S();
|
|
433
431
|
}
|
|
434
|
-
function
|
|
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
|
|
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:
|
|
452
|
-
groupExpand:
|
|
453
|
-
groupCollapse:
|
|
448
|
+
expand: P,
|
|
449
|
+
collapse: h,
|
|
450
|
+
groupExpand: B,
|
|
451
|
+
groupCollapse: O
|
|
454
452
|
});
|
|
455
|
-
const
|
|
456
|
-
return (t, p) => (Z(),
|
|
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(
|
|
456
|
+
class: Q(d(U)),
|
|
459
457
|
open: d(l)
|
|
460
|
-
}, [
|
|
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((
|
|
465
|
-
}, [
|
|
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:
|
|
469
|
-
groupExpand:
|
|
470
|
-
groupCollapse:
|
|
471
|
-
})), () => [
|
|
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
|
-
}, [
|
|
472
|
+
}, [V(t.$slots, "default", R(L({
|
|
475
473
|
isExpanded: d(l),
|
|
476
|
-
expand:
|
|
477
|
-
collapse:
|
|
478
|
-
groupExpand:
|
|
479
|
-
groupCollapse:
|
|
480
|
-
})), () => [
|
|
474
|
+
expand: P,
|
|
475
|
+
collapse: h,
|
|
476
|
+
groupExpand: B,
|
|
477
|
+
groupCollapse: O
|
|
478
|
+
})), () => [w($(d(v)), 1)])], 8, Ie)], 10, Ee));
|
|
481
479
|
}
|
|
482
|
-
}),
|
|
480
|
+
}), Te = Le;
|
|
483
481
|
export {
|
|
484
|
-
|
|
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
|
|
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;
|