@volverjs/ui-vue 0.0.4 → 0.0.5-beta.2

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 (215) hide show
  1. package/README.md +2 -2
  2. package/auto-imports.d.ts +12 -3
  3. package/bin/icons.cjs +1 -73
  4. package/dist/Volver.d.ts +19 -11
  5. package/dist/components/VvAccordion/VvAccordion.es.js +165 -106
  6. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  7. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
  8. package/dist/components/VvAccordion/index.d.ts +8 -3
  9. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +264 -164
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
  12. package/dist/components/VvAccordionGroup/index.d.ts +8 -0
  13. package/dist/components/VvAction/VvAction.es.js +276 -98
  14. package/dist/components/VvAction/VvAction.umd.js +1 -1
  15. package/dist/components/VvAction/VvAction.vue.d.ts +12 -12
  16. package/dist/components/VvAction/index.d.ts +2 -2
  17. package/dist/components/VvBadge/VvBadge.es.js +213 -44
  18. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  19. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  20. package/dist/components/VvBadge/index.d.ts +1 -1
  21. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +247 -75
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
  24. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  25. package/dist/components/VvButton/VvButton.es.js +646 -360
  26. package/dist/components/VvButton/VvButton.umd.js +1 -1
  27. package/dist/components/VvButton/VvButton.vue.d.ts +18 -18
  28. package/dist/components/VvButton/index.d.ts +13 -13
  29. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +261 -79
  30. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  31. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  32. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  33. package/dist/components/VvCard/VvCard.es.js +57 -38
  34. package/dist/components/VvCard/VvCard.umd.js +1 -1
  35. package/dist/components/VvCheckbox/VvCheckbox.es.js +562 -274
  36. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  37. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  38. package/dist/components/VvCheckbox/index.d.ts +5 -5
  39. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +661 -340
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +7 -7
  42. package/dist/components/VvCheckboxGroup/index.d.ts +3 -3
  43. package/dist/components/VvCombobox/VvCombobox.es.js +1546 -983
  44. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  45. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +138 -51
  46. package/dist/components/VvCombobox/index.d.ts +41 -10
  47. package/dist/components/VvDialog/VvDialog.es.js +387 -141
  48. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  49. package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
  50. package/dist/components/VvDialog/index.d.ts +4 -1
  51. package/dist/components/VvDropdown/VvDropdown.es.js +452 -244
  52. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  53. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +130 -42
  54. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +13 -13
  55. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +2 -2
  56. package/dist/components/VvDropdown/index.d.ts +40 -11
  57. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +373 -160
  58. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  59. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +43 -28
  60. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  61. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +285 -90
  62. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  63. package/dist/components/VvIcon/VvIcon.es.js +113 -65
  64. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  65. package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
  66. package/dist/components/VvIcon/index.d.ts +2 -2
  67. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
  68. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  69. package/dist/components/VvInputText/VvInputText.es.js +986 -462
  70. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  71. package/dist/components/VvInputText/VvInputText.vue.d.ts +100 -20
  72. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  73. package/dist/components/VvInputText/index.d.ts +66 -13
  74. package/dist/components/VvProgress/VvProgress.es.js +216 -45
  75. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  76. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  77. package/dist/components/VvProgress/index.d.ts +1 -1
  78. package/dist/components/VvRadio/VvRadio.es.js +499 -238
  79. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  80. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  81. package/dist/components/VvRadio/index.d.ts +5 -5
  82. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +598 -304
  83. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  84. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +7 -7
  85. package/dist/components/VvRadioGroup/index.d.ts +3 -3
  86. package/dist/components/VvSelect/VvSelect.es.js +631 -324
  87. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  88. package/dist/components/VvSelect/VvSelect.vue.d.ts +13 -13
  89. package/dist/components/VvSelect/index.d.ts +3 -3
  90. package/dist/components/VvTextarea/VvTextarea.es.js +676 -355
  91. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  92. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +20 -20
  93. package/dist/components/VvTextarea/index.d.ts +4 -4
  94. package/dist/components/VvTooltip/VvTooltip.es.js +215 -47
  95. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  96. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
  97. package/dist/components/VvTooltip/index.d.ts +2 -2
  98. package/dist/components/index.es.js +3522 -2231
  99. package/dist/components/index.umd.js +1 -1
  100. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  101. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
  102. package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
  103. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  104. package/dist/composables/useComponentFocus.d.ts +1 -1
  105. package/dist/composables/useComponentIcon.d.ts +7 -7
  106. package/dist/composables/useDebouncedInput.d.ts +4 -1
  107. package/dist/composables/useDefaults.d.ts +2 -0
  108. package/dist/composables/useModifiers.d.ts +1 -1
  109. package/dist/composables/useOptions.d.ts +2 -2
  110. package/dist/composables/useTextCount.d.ts +3 -3
  111. package/dist/composables/useUniqueId.d.ts +1 -1
  112. package/dist/composables/useVolver.d.ts +1 -1
  113. package/dist/directives/index.d.ts +1 -0
  114. package/dist/directives/index.es.js +264 -55
  115. package/dist/directives/index.umd.js +1 -1
  116. package/dist/directives/v-contextmenu.d.ts +3 -0
  117. package/dist/directives/v-contextmenu.es.js +42 -0
  118. package/dist/directives/v-contextmenu.umd.js +1 -0
  119. package/dist/directives/v-tooltip.es.js +222 -53
  120. package/dist/directives/v-tooltip.umd.js +1 -1
  121. package/dist/icons.d.ts +3 -1
  122. package/dist/icons.es.js +40 -23
  123. package/dist/icons.umd.js +1 -1
  124. package/dist/index.d.ts +0 -1
  125. package/dist/index.es.js +112 -3607
  126. package/dist/index.umd.js +1 -1
  127. package/dist/props/index.d.ts +50 -18
  128. package/dist/resolvers/unplugin.d.ts +7 -1
  129. package/dist/resolvers/unplugin.es.js +77 -37
  130. package/dist/resolvers/unplugin.umd.js +1 -1
  131. package/dist/stories/Combobox/Combobox.settings.d.ts +12 -0
  132. package/dist/stories/Dropdown/Dropdown.settings.d.ts +12 -0
  133. package/dist/stories/InputText/InputText.settings.d.ts +53 -0
  134. package/dist/stories/argTypes.d.ts +13 -1
  135. package/package.json +126 -40
  136. package/src/Volver.ts +49 -22
  137. package/src/assets/icons/detailed.json +1 -1
  138. package/src/assets/icons/normal.json +1 -1
  139. package/src/assets/icons/simple.json +1 -1
  140. package/src/components/VvAccordion/VvAccordion.vue +19 -22
  141. package/src/components/VvAccordion/index.ts +12 -4
  142. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
  143. package/src/components/VvAccordionGroup/index.ts +8 -0
  144. package/src/components/VvAction/VvAction.vue +7 -7
  145. package/src/components/VvAction/index.ts +1 -1
  146. package/src/components/VvBadge/VvBadge.vue +2 -2
  147. package/src/components/VvBadge/index.ts +1 -1
  148. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
  149. package/src/components/VvButton/VvButton.vue +11 -11
  150. package/src/components/VvButton/index.ts +10 -9
  151. package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
  152. package/src/components/VvButtonGroup/index.ts +1 -1
  153. package/src/components/VvCard/VvCard.vue +2 -2
  154. package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
  155. package/src/components/VvCheckbox/index.ts +11 -7
  156. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
  157. package/src/components/VvCheckboxGroup/index.ts +1 -1
  158. package/src/components/VvCombobox/VvCombobox.vue +44 -26
  159. package/src/components/VvCombobox/index.ts +1 -1
  160. package/src/components/VvDialog/VvDialog.vue +28 -11
  161. package/src/components/VvDialog/index.ts +5 -2
  162. package/src/components/VvDropdown/VvDropdown.vue +7 -5
  163. package/src/components/VvDropdown/VvDropdownAction.vue +7 -5
  164. package/src/components/VvDropdown/VvDropdownOption.vue +17 -10
  165. package/src/components/VvDropdown/index.ts +3 -3
  166. package/src/components/VvIcon/VvIcon.vue +3 -3
  167. package/src/components/VvIcon/index.ts +3 -3
  168. package/src/components/VvInputText/VvInputClearAction.ts +2 -2
  169. package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
  170. package/src/components/VvInputText/VvInputStepAction.ts +3 -2
  171. package/src/components/VvInputText/VvInputText.vue +130 -37
  172. package/src/components/VvInputText/VvInputTextActions.ts +5 -8
  173. package/src/components/VvInputText/index.ts +62 -1
  174. package/src/components/VvProgress/VvProgress.vue +2 -2
  175. package/src/components/VvProgress/index.ts +1 -1
  176. package/src/components/VvRadio/VvRadio.vue +3 -7
  177. package/src/components/VvRadio/index.ts +11 -7
  178. package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
  179. package/src/components/VvRadioGroup/index.ts +1 -1
  180. package/src/components/VvSelect/VvSelect.vue +4 -4
  181. package/src/components/VvSelect/index.ts +1 -1
  182. package/src/components/VvTextarea/VvTextarea.vue +6 -6
  183. package/src/components/VvTextarea/index.ts +1 -1
  184. package/src/components/VvTooltip/VvTooltip.vue +2 -2
  185. package/src/components/VvTooltip/index.ts +3 -3
  186. package/src/composables/dropdown/useInjectDropdown.ts +2 -2
  187. package/src/composables/dropdown/useProvideDropdown.ts +2 -2
  188. package/src/composables/group/useInjectedGroupState.ts +1 -1
  189. package/src/composables/group/useProvideGroupState.ts +1 -1
  190. package/src/composables/useComponentIcon.ts +1 -1
  191. package/src/composables/useDebouncedInput.ts +10 -3
  192. package/src/composables/useDefaults.ts +89 -0
  193. package/src/composables/useModifiers.ts +4 -2
  194. package/src/composables/useOptions.ts +1 -1
  195. package/src/composables/useVolver.ts +2 -2
  196. package/src/directives/index.ts +3 -1
  197. package/src/directives/v-contextmenu.ts +40 -0
  198. package/src/directives/v-tooltip.ts +2 -2
  199. package/src/icons.ts +1 -1
  200. package/src/index.ts +0 -2
  201. package/src/props/index.ts +20 -10
  202. package/src/resolvers/unplugin.ts +15 -1
  203. package/src/stories/Accordion/Accordion.stories.mdx +8 -2
  204. package/src/stories/Accordion/Accordion.test.ts +21 -15
  205. package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
  206. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
  207. package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
  208. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +1 -1
  209. package/src/stories/Dropdown/DropdownContextmenuDirective.stories.mdx +41 -0
  210. package/src/stories/InputText/InputText.settings.ts +53 -0
  211. package/src/stories/InputText/InputText.stories.mdx +40 -0
  212. package/src/stories/InputText/InputText.test.ts +5 -2
  213. package/src/stories/Tooltip/TooltipDirective.stories.mdx +1 -1
  214. package/src/stories/argTypes.ts +12 -2
  215. package/src/types/group.d.ts +5 -0
package/README.md CHANGED
@@ -96,7 +96,7 @@ Than you can import components and use them in your templates.
96
96
  * all components are also available with a dedicated export
97
97
  * import VvButton from '@volverjs/ui-vue/vv-button'
98
98
  */
99
- import { VvButton } from '@volverjs/ui-vue'
99
+ import { VvButton } from '@volverjs/ui-vue/components'
100
100
  /*
101
101
  * import the component style
102
102
  * for scss support you can import the scss file
@@ -163,12 +163,12 @@ The following features are planned for the next releases:
163
163
  - [x] (v0.0.3) `VvTooltip` component and `v-tooltip` directive;
164
164
  - [x] (v0.0.3) Redesign of `VvCombobox` for better accessibility and more features;
165
165
  - [x] (v0.0.3) Rewrite of `VvDropdown` to get it applicable to any element;
166
+ - [x] (v0.0.5) Input masks for `VvInputText` component;
166
167
  - [ ] `VvAvatar` component;
167
168
  - [ ] `VvAvatarGroup` component;
168
169
  - [ ] Alerts, notifications and toasts with `VvAlert` and `VvToast` component;
169
170
  - [ ] Loaders with `VvLoader` and `VvSkeleton`;
170
171
  - [ ] Menus, navigation and tabs with `VvNav`;
171
- - [ ] Input masks for `VvInputText` component;
172
172
  - [ ] `VvTable` component with sort, filters, pagination and cell editing;
173
173
  - [ ] Multiple uploads, image crop and file previews with `VvInputFile`;
174
174
  - [ ] Carousel and galleries with `VvCarousel` component;
package/auto-imports.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- // Generated by 'unplugin-auto-import'
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // Generated by unplugin-auto-import
2
5
  export {}
3
6
  declare global {
4
7
  const EffectScope: typeof import('vue')['EffectScope']
@@ -84,7 +87,6 @@ declare global {
84
87
  const refWithControl: typeof import('@vueuse/core')['refWithControl']
85
88
  const removeFromList: typeof import('./src/utils/ObjectUtilities')['removeFromList']
86
89
  const resolveComponent: typeof import('vue')['resolveComponent']
87
- const resolveDirective: typeof import('vue')['resolveDirective']
88
90
  const resolveFieldData: typeof import('./src/utils/ObjectUtilities')['resolveFieldData']
89
91
  const resolveRef: typeof import('@vueuse/core')['resolveRef']
90
92
  const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
@@ -114,6 +116,7 @@ declare global {
114
116
  const useArrayFilter: typeof import('@vueuse/core')['useArrayFilter']
115
117
  const useArrayFind: typeof import('@vueuse/core')['useArrayFind']
116
118
  const useArrayFindIndex: typeof import('@vueuse/core')['useArrayFindIndex']
119
+ const useArrayFindLast: typeof import('@vueuse/core')['useArrayFindLast']
117
120
  const useArrayJoin: typeof import('@vueuse/core')['useArrayJoin']
118
121
  const useArrayMap: typeof import('@vueuse/core')['useArrayMap']
119
122
  const useArrayReduce: typeof import('@vueuse/core')['useArrayReduce']
@@ -124,7 +127,6 @@ declare global {
124
127
  const useAttrs: typeof import('vue')['useAttrs']
125
128
  const useBase64: typeof import('@vueuse/core')['useBase64']
126
129
  const useBattery: typeof import('@vueuse/core')['useBattery']
127
- const useBemModifiers: typeof import('./src/composables/useModifiers')['useBemModifiers']
128
130
  const useBluetooth: typeof import('@vueuse/core')['useBluetooth']
129
131
  const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
130
132
  const useBroadcastChannel: typeof import('@vueuse/core')['useBroadcastChannel']
@@ -148,6 +150,7 @@ declare global {
148
150
  const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
149
151
  const useDebouncedInput: typeof import('./src/composables/useDebouncedInput')['useDebouncedInput']
150
152
  const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
153
+ const useDefaults: typeof import('./src/composables/useDefaults')['useDefaults']
151
154
  const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
152
155
  const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
153
156
  const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
@@ -194,6 +197,7 @@ declare global {
194
197
  const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
195
198
  const useMemoize: typeof import('@vueuse/core')['useMemoize']
196
199
  const useMemory: typeof import('@vueuse/core')['useMemory']
200
+ const useModifiers: typeof import('./src/composables/useModifiers')['useModifiers']
197
201
  const useMounted: typeof import('@vueuse/core')['useMounted']
198
202
  const useMouse: typeof import('@vueuse/core')['useMouse']
199
203
  const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
@@ -291,3 +295,8 @@ declare global {
291
295
  const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
292
296
  const whenever: typeof import('@vueuse/core')['whenever']
293
297
  }
298
+ // for type re-export
299
+ declare global {
300
+ // @ts-ignore
301
+ export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
302
+ }
package/bin/icons.cjs CHANGED
@@ -1,73 +1 @@
1
- (function(global, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("fs"), require("yargs"), require("yargs/helpers"), require("@iconify/tools"), require("path"), require("@iconify/utils")) : typeof define === "function" && define.amd ? define(["exports", "fs", "yargs", "yargs/helpers", "@iconify/tools", "path", "@iconify/utils"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["generate-icons"] = {}, global.fileSystem, global.yargs, global.helpers, global.tools, global.path, global.utils));
3
- })(this, function(exports2, fileSystem, yargs, helpers, tools, path, utils) {
4
- "use strict";
5
- function getAllFiles(dirPath, prefix = "iconify", objectFiles = {}) {
6
- const files = fileSystem.readdirSync(dirPath);
7
- files.forEach(function(file) {
8
- if (fileSystem.statSync(dirPath + "/" + file).isDirectory()) {
9
- objectFiles = getAllFiles(dirPath + "/" + file, file, objectFiles);
10
- } else {
11
- if (file.includes(".svg")) {
12
- objectFiles[prefix] ? objectFiles[prefix].push(path.join(dirPath, "/", file)) : objectFiles[prefix] = [path.join(dirPath, "/", file)];
13
- }
14
- }
15
- });
16
- return objectFiles;
17
- }
18
- async function generateIcons(prefix, files, destPath2) {
19
- const iconSet = tools.blankIconSet(prefix);
20
- for (const file of files) {
21
- const content = await fileSystem.promises.readFile(file, {
22
- encoding: "utf-8"
23
- });
24
- const svg = new tools.SVG(content);
25
- await tools.cleanupSVG(svg);
26
- await tools.parseColors(svg, {
27
- defaultColor: "currentColor",
28
- callback: (attr, colorStr, color) => {
29
- return !color || tools.isEmptyColor(color) ? colorStr : "currentColor";
30
- }
31
- });
32
- await tools.runSVGO(svg);
33
- const fileName = file.replace(/^.*[\\/]/, "").split(".")[0].replace(/ /g, "-").replace(/[^a-z0-9-]/gi, "");
34
- iconSet.fromSVG(fileName, svg);
35
- }
36
- const iconifyJson = iconSet.export();
37
- try {
38
- utils.validateIconSet(iconifyJson);
39
- } catch (error) {
40
- throw new Error(
41
- `Icon set is not valid: ${error == null ? void 0 : error.message}`
42
- );
43
- }
44
- fileSystem.writeFileSync(
45
- `${destPath2}/${iconifyJson.prefix}.json`,
46
- JSON.stringify(iconifyJson)
47
- );
48
- }
49
- function createIconifyJsonFiles(srcPath2, destPath2, prefix) {
50
- const objectFiles = getAllFiles(srcPath2, prefix);
51
- if (!Object.keys(objectFiles).length) {
52
- console.error(`There are no files in ${srcPath2}`);
53
- } else {
54
- Object.keys(objectFiles).forEach((prefix2) => {
55
- generateIcons(prefix2, objectFiles[prefix2], destPath2);
56
- console.info(`Icons generated in: ${destPath2}/${prefix2}.json
57
- `);
58
- });
59
- }
60
- }
61
- const argv = yargs(helpers.hideBin(process.argv)).argv;
62
- const srcPath = argv.srcPath;
63
- const destPath = argv.destPath || srcPath;
64
- if (!srcPath || !destPath) {
65
- console.error(
66
- "Please specify the srcPath and destPath with --srcPath and --destPath"
67
- );
68
- process.exit();
69
- }
70
- createIconifyJsonFiles(srcPath, destPath, argv.prefix);
71
- exports2.createIconifyJsonFiles = createIconifyJsonFiles;
72
- Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
73
- });
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("fs"),require("yargs"),require("yargs/helpers"),require("@iconify/tools"),require("path"),require("@iconify/utils")):"function"==typeof define&&define.amd?define(["exports","fs","yargs","yargs/helpers","@iconify/tools","path","@iconify/utils"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self)["generate-icons"]={},e.fileSystem,e.yargs,e.helpers,e.tools,e.path,e.utils)}(this,(function(e,o,t,r,n,i,s){"use strict";function c(e,t="iconify",r={}){return o.readdirSync(e).forEach((function(n){o.statSync(e+"/"+n).isDirectory()?r=c(e+"/"+n,n,r):n.includes(".svg")&&(r[t]?r[t].push(i.join(e,"/",n)):r[t]=[i.join(e,"/",n)])})),r}function a(e,t,r){const i=c(e,r);Object.keys(i).length?Object.keys(i).forEach((e=>{!async function(e,t,r){const i=n.blankIconSet(e);for(const s of t){const e=await o.promises.readFile(s,{encoding:"utf-8"}),t=new n.SVG(e);await n.cleanupSVG(t),await n.parseColors(t,{defaultColor:"currentColor",callback:(e,o,t)=>!t||n.isEmptyColor(t)?o:"currentColor"}),await n.runSVGO(t);const r=s.replace(/^.*[\\/]/,"").split(".")[0].replace(/ /g,"-").replace(/[^a-z0-9-]/gi,"");i.fromSVG(r,t)}const c=i.export();try{s.validateIconSet(c)}catch(a){throw new Error(`Icon set is not valid: ${null==a?void 0:a.message}`)}o.writeFileSync(`${r}/${c.prefix}.json`,JSON.stringify(c))}(e,i[e],t),console.info(`Icons generated in: ${t}/${e}.json\n`)})):console.error(`There are no files in ${e}`)}const l=t(r.hideBin(process.argv)).argv,f=l.srcPath,u=l.destPath||f;f&&u||(console.error("Please specify the srcPath and destPath with --srcPath and --destPath"),process.exit()),a(f,u,l.prefix),e.createIconifyJsonFiles=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/dist/Volver.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type IconifyIcon, type IconifyJSON, type PartialIconifyAPIConfig } from '@iconify/vue';
2
- import type { Component, Directive, Plugin } from 'vue';
2
+ import type { Component, Directive, Plugin, Ref } from 'vue';
3
3
  export declare function useDefaultProps(component: Component, defaults?: Record<string, unknown>, name?: string): Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
4
4
  export type DefaultOptions = Record<string, Record<string, unknown>>;
5
5
  export type VolverOptions = {
@@ -25,7 +25,7 @@ export type VolverOptions = {
25
25
  * @see https://docs.iconify.design/icon-components/vue/add-collection.html
26
26
  * @default 'vv'
27
27
  */
28
- provider?: string;
28
+ iconsProvider?: string;
29
29
  /**
30
30
  * Components to install
31
31
  */
@@ -66,16 +66,16 @@ export interface VolverInterface {
66
66
  */
67
67
  addIcon(name: string, data: IconifyIcon): boolean;
68
68
  /**
69
- * Add custom config for provider
69
+ * Add custom config for icons provider
70
70
  * @param {String} provider
71
71
  * @param {PartialIconifyAPIConfig} customConfig
72
72
  * @returns {Boolean} true on success, false if something is wrong with data
73
73
  */
74
- addAPIProvider(provider: string, customConfig: PartialIconifyAPIConfig): boolean;
74
+ addIconsAPIProvider(provider: string, customConfig: PartialIconifyAPIConfig): boolean;
75
75
  /**
76
76
  * Current provider
77
77
  */
78
- provider: string;
78
+ iconsProvider: string;
79
79
  /**
80
80
  * Array of installed iconify collections
81
81
  * @see https://docs.iconify.design/types/iconify-json.html
@@ -85,16 +85,24 @@ export interface VolverInterface {
85
85
  * Set true inside nuxt
86
86
  */
87
87
  nuxt: boolean;
88
+ /**
89
+ * Components defaults options
90
+ */
91
+ defaults: Ref<DefaultOptions>;
88
92
  }
89
93
  export declare class Volver implements VolverInterface {
90
- fetchOptions: RequestInit;
91
- nuxt: boolean;
92
- iconsCollections: IconifyJSON[];
93
- provider: string;
94
- constructor({ fetchWithCredentials, fetchOptions, provider, nuxt, iconsCollections, }?: VolverOptions);
94
+ private _fetchOptions;
95
+ private _iconsCollections;
96
+ private _iconsProvider;
97
+ private _nuxt;
98
+ defaults: Ref<DefaultOptions>;
99
+ constructor({ fetchWithCredentials, fetchOptions, iconsProvider, nuxt, iconsCollections, defaults, }?: VolverOptions);
100
+ get nuxt(): boolean;
101
+ get iconsProvider(): string;
102
+ get iconsCollections(): IconifyJSON[];
95
103
  addCollection(collection: IconifyJSON, providerName?: string): boolean;
96
104
  addIcon(name: string, data: IconifyIcon): boolean;
97
- addAPIProvider(provider: string, customConfig: PartialIconifyAPIConfig): boolean;
105
+ addIconsAPIProvider(provider: string, customConfig: PartialIconifyAPIConfig): boolean;
98
106
  fetchIcon(src: string, options?: RequestInit): Promise<string | undefined>;
99
107
  }
100
108
  declare const VolverPlugin: Plugin;
@@ -1,41 +1,43 @@
1
- import { unref as r, inject as E, computed as i, toRef as S, toRefs as $, defineComponent as I, useAttrs as V, ref as j, openBlock as k, createElementBlock as B, normalizeClass as N, withModifiers as P, createElementVNode as g, renderSlot as A, normalizeProps as b, guardReactiveProps as C, createTextVNode as G, toDisplayString as O } from "vue";
2
- import { nanoid as D } from "nanoid";
3
- import { useToggle as M } from "@vueuse/core";
4
- const T = Symbol.for("accordionGroup");
5
- function z(o) {
6
- return ((e) => e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0)(r(o));
1
+ import { unref, inject, computed, toRef, toRefs, defineComponent, useAttrs, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, renderSlot, normalizeProps, guardReactiveProps, createTextVNode, toDisplayString } from "vue";
2
+ import { nanoid } from "nanoid";
3
+ import { useToggle } from "@vueuse/core";
4
+ const INJECTION_KEY_ACCORDION_GROUP = Symbol.for("accordionGroup");
5
+ function isEmpty(value) {
6
+ return ((value2) => value2 === null || value2 === void 0 || value2 === "" || Array.isArray(value2) && value2.length === 0 || !(value2 instanceof Date) && typeof value2 === "object" && Object.keys(value2).length === 0)(unref(value));
7
7
  }
8
- function L(o) {
9
- const e = E(o, void 0), l = i(() => !z(e));
10
- function a(t, s, d) {
11
- if (e != null && e.value) {
12
- const u = r(e.value)[t];
13
- return i({
8
+ function useInjectedGroupState(groupKey) {
9
+ const group = inject(groupKey, void 0);
10
+ const isInGroup = computed(() => !isEmpty(group));
11
+ function getGroupOrLocalRef(propName, props, emit) {
12
+ if (group == null ? void 0 : group.value) {
13
+ const groupPropValue = unref(group.value)[propName];
14
+ return computed({
14
15
  get() {
15
- return u == null ? void 0 : u.value;
16
+ return groupPropValue == null ? void 0 : groupPropValue.value;
16
17
  },
17
- set(v) {
18
- u.value = v;
18
+ set(value) {
19
+ groupPropValue.value = value;
19
20
  }
20
21
  });
21
22
  }
22
- const p = S(s, t);
23
- return i({
23
+ const propRef = toRef(props, propName);
24
+ return computed({
24
25
  get() {
25
- return p.value;
26
+ return propRef.value;
26
27
  },
27
- set(u) {
28
- d && d(`update:${t}`, u);
28
+ set(value) {
29
+ if (emit)
30
+ emit(`update:${propName}`, value);
29
31
  }
30
32
  });
31
33
  }
32
34
  return {
33
- group: e,
34
- isInGroup: l,
35
- getGroupOrLocalRef: a
35
+ group,
36
+ isInGroup,
37
+ getGroupOrLocalRef
36
38
  };
37
39
  }
38
- const x = {
40
+ const VvAccordionProps = {
39
41
  /**
40
42
  * Accordion name
41
43
  */
@@ -62,110 +64,167 @@ const x = {
62
64
  /**
63
65
  * If true, the accordion will be disabled
64
66
  */
65
- disabled: Boolean
66
- }, J = ["update:modelValue"];
67
- function K(o, e) {
68
- const { group: l, isInGroup: a, getGroupOrLocalRef: t } = L(
69
- T
70
- ), { title: s, content: d } = $(o), p = t("modelValue", o, e), u = t("disabled", o), v = t("collapse", o), n = t("modifiers", o);
67
+ disabled: Boolean,
68
+ /**
69
+ * If true, the accordion will be opened by default
70
+ */
71
+ not: Boolean
72
+ };
73
+ const VvAccordionEvents = ["update:modelValue"];
74
+ function useGroupProps(props, emit) {
75
+ const { group, isInGroup, getGroupOrLocalRef } = useInjectedGroupState(
76
+ INJECTION_KEY_ACCORDION_GROUP
77
+ );
78
+ const { title, content } = toRefs(props);
79
+ const modelValue = getGroupOrLocalRef("modelValue", props, emit);
80
+ const not = getGroupOrLocalRef("not", props);
81
+ const collapse = getGroupOrLocalRef("collapse", props);
82
+ const modifiers = getGroupOrLocalRef("modifiers", props);
83
+ const disabled = computed(
84
+ () => {
85
+ var _a;
86
+ return Boolean(props.disabled || ((_a = group == null ? void 0 : group.value) == null ? void 0 : _a.disabled.value));
87
+ }
88
+ );
71
89
  return {
72
90
  // group props
73
- modelValue: p,
74
- disabled: u,
75
- isInGroup: a,
76
- group: l,
77
- collapse: v,
78
- modifiers: n,
91
+ modelValue,
92
+ not,
93
+ isInGroup,
94
+ group,
95
+ collapse,
96
+ modifiers,
97
+ disabled,
79
98
  // local props
80
- title: s,
81
- content: d
99
+ title,
100
+ content
82
101
  };
83
102
  }
84
- function U(o, e, l) {
85
- return i(() => {
86
- const a = {
87
- [o]: !0
88
- }, t = typeof (e == null ? void 0 : e.value) == "string" ? e.value.split(" ") : e == null ? void 0 : e.value;
89
- return t && Array.isArray(t) && t.forEach((s) => {
90
- a[`${o}--${s}`] = !0;
91
- }), l && Object.keys(l.value).forEach((s) => {
92
- a[`${o}--${s}`] = r(l.value[s]);
93
- }), a;
103
+ function useModifiers(prefix, modifiers, others) {
104
+ return computed(() => {
105
+ const toReturn = {
106
+ [prefix]: true
107
+ };
108
+ const modifiersArray = typeof (modifiers == null ? void 0 : modifiers.value) === "string" ? modifiers.value.split(" ") : modifiers == null ? void 0 : modifiers.value;
109
+ if (modifiersArray) {
110
+ if (Array.isArray(modifiersArray)) {
111
+ modifiersArray.forEach((modifier) => {
112
+ if (modifier) {
113
+ toReturn[`${prefix}--${modifier}`] = true;
114
+ }
115
+ });
116
+ }
117
+ }
118
+ if (others) {
119
+ Object.keys(others.value).forEach((key) => {
120
+ toReturn[`${prefix}--${key}`] = unref(others.value[key]);
121
+ });
122
+ }
123
+ return toReturn;
94
124
  });
95
125
  }
96
- const Y = ["id", "open"], q = ["aria-controls", "aria-expanded"], F = ["aria-hidden"], H = {
126
+ const _hoisted_1 = ["id", "open"];
127
+ const _hoisted_2 = ["aria-controls", "aria-expanded"];
128
+ const _hoisted_3 = ["aria-hidden"];
129
+ const __default__ = {
97
130
  name: "VvAccordion"
98
- }, w = /* @__PURE__ */ I({
99
- ...H,
100
- props: x,
101
- emits: J,
102
- setup(o, { emit: e }) {
103
- const l = o, a = V(), t = i(
104
- () => l.name || (a == null ? void 0 : a.id) || D()
105
- ), {
106
- modifiers: s,
107
- title: d,
108
- content: p,
109
- disabled: u,
110
- collapse: v,
111
- modelValue: n,
112
- isInGroup: y
113
- } = K(l, e), _ = j(!1), f = i({
114
- get: () => y.value ? v.value && Array.isArray(n.value) ? n.value.includes(t.value) : n.value === t.value : n.value === void 0 ? _.value : n.value,
115
- set: (c) => {
116
- if (y.value) {
117
- if (v.value && Array.isArray(n.value)) {
118
- if (c) {
119
- n.value.push(t.value);
131
+ };
132
+ const _sfc_main = /* @__PURE__ */ defineComponent({
133
+ ...__default__,
134
+ props: VvAccordionProps,
135
+ emits: VvAccordionEvents,
136
+ setup(__props, { emit }) {
137
+ const props = __props;
138
+ const attrs = useAttrs();
139
+ const accordionName = computed(
140
+ () => props.name || (attrs == null ? void 0 : attrs.id) || nanoid()
141
+ );
142
+ const {
143
+ modifiers,
144
+ title,
145
+ content,
146
+ disabled,
147
+ collapse,
148
+ modelValue,
149
+ isInGroup,
150
+ not
151
+ } = useGroupProps(props, emit);
152
+ const localModelValue = ref(false);
153
+ const isOpen = computed({
154
+ get: () => {
155
+ let toReturn = modelValue.value;
156
+ if (isInGroup.value) {
157
+ if (collapse.value && Array.isArray(modelValue.value)) {
158
+ toReturn = modelValue.value.includes(accordionName.value);
159
+ } else {
160
+ toReturn = modelValue.value === accordionName.value;
161
+ }
162
+ } else if (modelValue.value === void 0) {
163
+ toReturn = localModelValue.value;
164
+ }
165
+ return not.value ? !toReturn : toReturn;
166
+ },
167
+ set: (newValue) => {
168
+ if (not.value) {
169
+ newValue = !newValue;
170
+ }
171
+ if (isInGroup.value) {
172
+ if (collapse.value && Array.isArray(modelValue.value)) {
173
+ if (newValue) {
174
+ modelValue.value.push(accordionName.value);
120
175
  return;
121
176
  }
122
- n.value = n.value.filter(
123
- (m) => m !== t.value
177
+ modelValue.value = modelValue.value.filter(
178
+ (name) => name !== accordionName.value
124
179
  );
125
180
  return;
126
181
  }
127
- n.value = c ? t.value : null;
182
+ modelValue.value = newValue ? accordionName.value : null;
128
183
  return;
129
184
  }
130
- if (n.value === void 0 && typeof c == "boolean") {
131
- _.value = c;
185
+ if (modelValue.value === void 0 && typeof newValue === "boolean") {
186
+ localModelValue.value = newValue;
132
187
  return;
133
188
  }
134
- n.value = c;
189
+ modelValue.value = newValue;
135
190
  }
136
- }), R = U(
191
+ });
192
+ const bemCssClasses = useModifiers(
137
193
  "vv-accordion",
138
- s,
139
- i(() => ({
140
- disabled: u.value
194
+ modifiers,
195
+ computed(() => ({
196
+ disabled: disabled.value
141
197
  }))
142
- ), h = M(f);
143
- return (c, m) => (k(), B("details", {
144
- id: r(t),
145
- class: N(r(R)),
146
- open: r(f),
147
- onClick: m[0] || (m[0] = P((Q) => r(h)(), ["prevent"]))
148
- }, [
149
- g("summary", {
150
- "aria-controls": r(t),
151
- "aria-expanded": r(f),
152
- class: "vv-collapse__summary"
153
- }, [
154
- A(c.$slots, "summary", b(C({ open: r(f) })), () => [
155
- G(O(r(d)), 1)
156
- ])
157
- ], 8, q),
158
- g("div", {
159
- "aria-hidden": !r(f),
160
- class: "vv-collapse__content"
198
+ );
199
+ const onClick = useToggle(isOpen);
200
+ return (_ctx, _cache) => {
201
+ return openBlock(), createElementBlock("details", {
202
+ id: unref(accordionName),
203
+ class: normalizeClass(unref(bemCssClasses)),
204
+ open: unref(isOpen)
161
205
  }, [
162
- A(c.$slots, "details", b(C({ open: r(f) })), () => [
163
- G(O(r(p)), 1)
164
- ])
165
- ], 8, F)
166
- ], 10, Y));
206
+ createElementVNode("summary", {
207
+ "aria-controls": unref(accordionName),
208
+ "aria-expanded": unref(isOpen),
209
+ class: "vv-accordion__summary",
210
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(onClick)(), ["prevent"]))
211
+ }, [
212
+ renderSlot(_ctx.$slots, "summary", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
213
+ createTextVNode(toDisplayString(unref(title)), 1)
214
+ ])
215
+ ], 8, _hoisted_2),
216
+ createElementVNode("div", {
217
+ "aria-hidden": !unref(isOpen),
218
+ class: "vv-accordion__content"
219
+ }, [
220
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ open: unref(isOpen) })), () => [
221
+ createTextVNode(toDisplayString(unref(content)), 1)
222
+ ])
223
+ ], 8, _hoisted_3)
224
+ ], 10, _hoisted_1);
225
+ };
167
226
  }
168
227
  });
169
228
  export {
170
- w as default
229
+ _sfc_main as default
171
230
  };
@@ -1 +1 @@
1
- (function(e,p){typeof exports=="object"&&typeof module<"u"?module.exports=p(require("vue"),require("nanoid"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["vue","nanoid","@vueuse/core"],p):(e=typeof globalThis<"u"?globalThis:e||self,e.VvAccordion=p(e.vue,e.nanoid,e.core))})(this,function(e,p,g){"use strict";const h=Symbol.for("accordionGroup");function v(o){return(n=>n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&typeof n=="object"&&Object.keys(n).length===0)(e.unref(o))}function R(o){const n=e.inject(o,void 0),s=e.computed(()=>!v(n));function a(t,i,u){if(n!=null&&n.value){const c=e.unref(n.value)[t];return e.computed({get(){return c==null?void 0:c.value},set(d){c.value=d}})}const m=e.toRef(i,t);return e.computed({get(){return m.value},set(c){u&&u(`update:${t}`,c)}})}return{group:n,isInGroup:s,getGroupOrLocalRef:a}}const S={name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},modifiers:[String,Array],disabled:Boolean},b=["update:modelValue"];function C(o,n){const{group:s,isInGroup:a,getGroupOrLocalRef:t}=R(h),{title:i,content:u}=e.toRefs(o),m=t("modelValue",o,n),c=t("disabled",o),d=t("collapse",o),r=t("modifiers",o);return{modelValue:m,disabled:c,isInGroup:a,group:s,collapse:d,modifiers:r,title:i,content:u}}function E(o,n,s){return e.computed(()=>{const a={[o]:!0},t=typeof(n==null?void 0:n.value)=="string"?n.value.split(" "):n==null?void 0:n.value;return t&&Array.isArray(t)&&t.forEach(i=>{a[`${o}--${i}`]=!0}),s&&Object.keys(s.value).forEach(i=>{a[`${o}--${i}`]=e.unref(s.value[i])}),a})}const G=["id","open"],O=["aria-controls","aria-expanded"],V=["aria-hidden"],$={name:"VvAccordion"};return e.defineComponent({...$,props:S,emits:b,setup(o,{emit:n}){const s=o,a=e.useAttrs(),t=e.computed(()=>s.name||(a==null?void 0:a.id)||p.nanoid()),{modifiers:i,title:u,content:m,disabled:c,collapse:d,modelValue:r,isInGroup:_}=C(s,n),A=e.ref(!1),f=e.computed({get:()=>_.value?d.value&&Array.isArray(r.value)?r.value.includes(t.value):r.value===t.value:r.value===void 0?A.value:r.value,set:l=>{if(_.value){if(d.value&&Array.isArray(r.value)){if(l){r.value.push(t.value);return}r.value=r.value.filter(y=>y!==t.value);return}r.value=l?t.value:null;return}if(r.value===void 0&&typeof l=="boolean"){A.value=l;return}r.value=l}}),I=E("vv-accordion",i,e.computed(()=>({disabled:c.value}))),j=g.useToggle(f);return(l,y)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(t),class:e.normalizeClass(e.unref(I)),open:e.unref(f),onClick:y[0]||(y[0]=e.withModifiers(P=>e.unref(j)(),["prevent"]))},[e.createElementVNode("summary",{"aria-controls":e.unref(t),"aria-expanded":e.unref(f),class:"vv-collapse__summary"},[e.renderSlot(l.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(f)})),()=>[e.createTextVNode(e.toDisplayString(e.unref(u)),1)])],8,O),e.createElementVNode("div",{"aria-hidden":!e.unref(f),class:"vv-collapse__content"},[e.renderSlot(l.$slots,"details",e.normalizeProps(e.guardReactiveProps({open:e.unref(f)})),()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)])],8,V)],10,G))}})});
1
+ !function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("nanoid"),require("@vueuse/core")):"function"==typeof define&&define.amd?define(["vue","nanoid","@vueuse/core"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).VvAccordion=o(e.vue,e.nanoid,e.core)}(this,(function(e,o,n){"use strict";const r=Symbol.for("accordionGroup");function t(o){const n=e.inject(o,void 0),r=e.computed((()=>{return o=n,!(null==(r=e.unref(o))||""===r||Array.isArray(r)&&0===r.length||!(r instanceof Date)&&"object"==typeof r&&0===Object.keys(r).length);var o,r}));return{group:n,isInGroup:r,getGroupOrLocalRef:function(o,r,t){if(null==n?void 0:n.value){const r=e.unref(n.value)[o];return e.computed({get:()=>null==r?void 0:r.value,set(e){r.value=e}})}const u=e.toRef(r,o);return e.computed({get:()=>u.value,set(e){t&&t(`update:${o}`,e)}})}}}const u={name:String,title:String,content:String,modelValue:{type:Boolean,default:void 0},modifiers:[String,Array],disabled:Boolean,not:Boolean};const a=["id","open"],l=["aria-controls","aria-expanded"],i=["aria-hidden"];return e.defineComponent({name:"VvAccordion",props:u,emits:["update:modelValue"],setup(u,{emit:d}){const s=u,c=e.useAttrs(),v=e.computed((()=>s.name||(null==c?void 0:c.id)||o.nanoid())),{modifiers:f,title:p,content:m,disabled:y,collapse:g,modelValue:b,isInGroup:A,not:h}=function(o,n){const{group:u,isInGroup:a,getGroupOrLocalRef:l}=t(r),{title:i,content:d}=e.toRefs(o),s=l("modelValue",o,n),c=l("not",o),v=l("collapse",o),f=l("modifiers",o),p=e.computed((()=>{var e;return Boolean(o.disabled||(null==(e=null==u?void 0:u.value)?void 0:e.disabled.value))}));return{modelValue:s,not:c,isInGroup:a,group:u,collapse:v,modifiers:f,disabled:p,title:i,content:d}}(s,d),V=e.ref(!1),S=e.computed({get:()=>{let e=b.value;return A.value?e=g.value&&Array.isArray(b.value)?b.value.includes(v.value):b.value===v.value:void 0===b.value&&(e=V.value),h.value?!e:e},set:e=>{if(h.value&&(e=!e),A.value)return g.value&&Array.isArray(b.value)?e?void b.value.push(v.value):void(b.value=b.value.filter((e=>e!==v.value))):void(b.value=e?v.value:null);void 0!==b.value||"boolean"!=typeof e?b.value=e:V.value=e}}),G=function(o,n,r){return e.computed((()=>{const t={[o]:!0},u="string"==typeof(null==n?void 0:n.value)?n.value.split(" "):null==n?void 0:n.value;return u&&Array.isArray(u)&&u.forEach((e=>{e&&(t[`${o}--${e}`]=!0)})),r&&Object.keys(r.value).forEach((n=>{t[`${o}--${n}`]=e.unref(r.value[n])})),t}))}("vv-accordion",f,e.computed((()=>({disabled:y.value})))),$=n.useToggle(S);return(o,n)=>(e.openBlock(),e.createElementBlock("details",{id:e.unref(v),class:e.normalizeClass(e.unref(G)),open:e.unref(S)},[e.createElementVNode("summary",{"aria-controls":e.unref(v),"aria-expanded":e.unref(S),class:"vv-accordion__summary",onClick:n[0]||(n[0]=e.withModifiers((o=>e.unref($)()),["prevent"]))},[e.renderSlot(o.$slots,"summary",e.normalizeProps(e.guardReactiveProps({open:e.unref(S)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(p)),1)]))],8,l),e.createElementVNode("div",{"aria-hidden":!e.unref(S),class:"vv-accordion__content"},[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({open:e.unref(S)})),(()=>[e.createTextVNode(e.toDisplayString(e.unref(m)),1)]))],8,i)],10,a))}})}));
@@ -8,6 +8,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
8
8
  };
9
9
  modifiers: (StringConstructor | ArrayConstructor)[];
10
10
  disabled: BooleanConstructor;
11
+ not: BooleanConstructor;
11
12
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
13
  name: StringConstructor;
13
14
  title: StringConstructor;
@@ -18,16 +19,18 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
18
19
  };
19
20
  modifiers: (StringConstructor | ArrayConstructor)[];
20
21
  disabled: BooleanConstructor;
22
+ not: BooleanConstructor;
21
23
  }>> & {
22
24
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
23
25
  }, {
24
26
  modelValue: boolean;
25
27
  disabled: boolean;
28
+ not: boolean;
26
29
  }>, {
27
30
  summary: (_: {
28
31
  open: boolean;
29
32
  }) => any;
30
- details: (_: {
33
+ default: (_: {
31
34
  open: boolean;
32
35
  }) => any;
33
36
  }>;
@@ -1,5 +1,5 @@
1
1
  import type { ExtractPropTypes, Ref } from 'vue';
2
- import type { AccordionGroupState } from '@/types/group';
2
+ import type { AccordionGroupState } from '../../types/group';
3
3
  export declare const VvAccordionProps: {
4
4
  /**
5
5
  * Accordion name
@@ -28,6 +28,10 @@ export declare const VvAccordionProps: {
28
28
  * If true, the accordion will be disabled
29
29
  */
30
30
  disabled: BooleanConstructor;
31
+ /**
32
+ * If true, the accordion will be opened by default
33
+ */
34
+ not: BooleanConstructor;
31
35
  };
32
36
  export declare const VvAccordionEvents: string[];
33
37
  export type VvAccordionPropsTypes = ExtractPropTypes<typeof VvAccordionProps>;
@@ -36,11 +40,12 @@ export type VvAccordionPropsTypes = ExtractPropTypes<typeof VvAccordionProps>;
36
40
  */
37
41
  export declare function useGroupProps(props: VvAccordionPropsTypes, emit: (event: string, value: unknown) => void): {
38
42
  modelValue: import("vue").WritableComputedRef<unknown>;
39
- disabled: Ref<boolean>;
40
- isInGroup: import("vue").ComputedRef<boolean>;
43
+ not: Ref<boolean>;
44
+ isInGroup: globalThis.ComputedRef<boolean>;
41
45
  group: Ref<AccordionGroupState> | undefined;
42
46
  collapse: Ref<boolean>;
43
47
  modifiers: Ref<string | string[]>;
48
+ disabled: globalThis.ComputedRef<boolean>;
44
49
  title: Ref<string | undefined> | undefined;
45
50
  content: Ref<string | undefined> | undefined;
46
51
  };