@volverjs/ui-vue 0.0.10-beta.7 → 0.0.10-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 (112) hide show
  1. package/bin/icons.cjs +1 -1
  2. package/bin/icons.js +22 -15
  3. package/dist/Volver.d.ts +0 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +24 -2
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +66 -25
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +17 -3
  9. package/dist/components/VvAction/VvAction.umd.js +1 -1
  10. package/dist/components/VvAction/VvAction.vue.d.ts +10 -0
  11. package/dist/components/VvAction/index.d.ts +4 -0
  12. package/dist/components/VvAlert/VvAlert.es.js +87 -43
  13. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  14. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +127 -64
  15. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  16. package/dist/components/VvAvatar/VvAvatar.es.js +15 -1
  17. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  18. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +70 -26
  19. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  20. package/dist/components/VvBadge/VvBadge.es.js +32 -8
  21. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +217 -41
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  24. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +14 -3
  25. package/dist/components/VvBreadcrumb/index.d.ts +2 -9
  26. package/dist/components/VvButton/VvButton.es.js +56 -19
  27. package/dist/components/VvButton/VvButton.umd.js +1 -1
  28. package/dist/components/VvButton/VvButton.vue.d.ts +20 -13
  29. package/dist/components/VvButton/index.d.ts +6 -2
  30. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +26 -6
  31. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  32. package/dist/components/VvCard/VvCard.es.js +40 -16
  33. package/dist/components/VvCard/VvCard.umd.js +1 -1
  34. package/dist/components/VvCheckbox/VvCheckbox.es.js +23 -2
  35. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  36. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +92 -44
  37. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  38. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  39. package/dist/components/VvCombobox/VvCombobox.es.js +598 -370
  40. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  41. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +3 -3
  42. package/dist/components/VvCombobox/index.d.ts +3 -10
  43. package/dist/components/VvDialog/VvDialog.es.js +58 -27
  44. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  45. package/dist/components/VvDropdown/VvDropdown.es.js +78 -44
  46. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  47. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +3 -3
  48. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
  49. package/dist/components/VvDropdown/index.d.ts +1 -1
  50. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +37 -11
  51. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  52. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
  53. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +21 -1
  54. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
  55. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +33 -8
  56. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
  57. package/dist/components/VvIcon/VvIcon.es.js +1 -1
  58. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  59. package/dist/components/VvInputText/VvInputText.es.js +140 -97
  60. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  61. package/dist/components/VvInputText/index.d.ts +8 -2
  62. package/dist/components/VvNav/VvNav.es.js +61 -28
  63. package/dist/components/VvNav/VvNav.umd.js +1 -1
  64. package/dist/components/VvNav/VvNav.vue.d.ts +3 -3
  65. package/dist/components/VvNav/index.d.ts +1 -1
  66. package/dist/components/VvNavItem/VvNavItem.es.js +30 -9
  67. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  68. package/dist/components/VvProgress/VvProgress.es.js +26 -6
  69. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  70. package/dist/components/VvRadio/VvRadio.es.js +23 -2
  71. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  72. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +92 -44
  73. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  74. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  75. package/dist/components/VvSelect/VvSelect.es.js +147 -94
  76. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  77. package/dist/components/VvSelect/index.d.ts +1 -1
  78. package/dist/components/VvTab/VvTab.es.js +109 -46
  79. package/dist/components/VvTab/VvTab.umd.js +1 -1
  80. package/dist/components/VvTextarea/VvTextarea.es.js +113 -74
  81. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  82. package/dist/components/VvTooltip/VvTooltip.es.js +33 -9
  83. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  84. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +3 -3
  85. package/dist/components/VvTooltip/index.d.ts +1 -1
  86. package/dist/components/index.es.js +1369 -839
  87. package/dist/components/index.umd.js +1 -1
  88. package/dist/composables/useVolver.d.ts +1 -1
  89. package/dist/directives/index.d.ts +3 -5
  90. package/dist/directives/index.es.js +53 -23
  91. package/dist/directives/index.umd.js +1 -1
  92. package/dist/directives/v-tooltip.es.js +51 -18
  93. package/dist/directives/v-tooltip.umd.js +1 -1
  94. package/dist/icons.es.js +3 -3
  95. package/dist/icons.umd.js +1 -1
  96. package/dist/index.d.ts +3 -1
  97. package/dist/props/index.d.ts +9 -2
  98. package/dist/types/generic.d.ts +1 -1
  99. package/package.json +31 -31
  100. package/src/Volver.ts +0 -1
  101. package/src/assets/icons/detailed.json +1 -1
  102. package/src/assets/icons/normal.json +1 -1
  103. package/src/assets/icons/simple.json +1 -1
  104. package/src/components/VvAction/VvAction.vue +4 -2
  105. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
  106. package/src/components/VvBreadcrumb/index.ts +2 -8
  107. package/src/components/VvInputText/VvInputText.vue +2 -2
  108. package/src/directives/index.ts +1 -4
  109. package/src/directives/v-tooltip.ts +19 -10
  110. package/src/index.ts +3 -1
  111. package/src/props/index.ts +8 -0
  112. package/src/types/generic.ts +2 -1
@@ -55,7 +55,7 @@
55
55
  case props.href !== undefined:
56
56
  return ActionTag.a
57
57
  default:
58
- return ActionTag.button
58
+ return props.defaultTag // button
59
59
  }
60
60
  })
61
61
 
@@ -85,12 +85,14 @@
85
85
  to: props.to,
86
86
  target: props.target,
87
87
  }
88
- default:
88
+ case ActionTag.button:
89
89
  return {
90
90
  ...toReturn,
91
91
  type: props.type,
92
92
  disabled: props.disabled,
93
93
  }
94
+ default:
95
+ return toReturn
94
96
  }
95
97
  })
96
98
 
@@ -7,46 +7,47 @@
7
7
  <script setup lang="ts">
8
8
  import { useModifiers } from '../../composables/useModifiers'
9
9
  import { VvBreadcrumbProps } from '.'
10
+ import VvAction from '../VvAction/VvAction.vue'
10
11
 
11
12
  const props = defineProps(VvBreadcrumbProps)
12
13
  const { modifiers } = toRefs(props)
13
14
  const bemCssClasses = useModifiers('vv-breadcrumb', modifiers)
15
+ const length = computed(() => props.routes?.length ?? 0)
16
+
17
+ const isLast = (index: number) => index === length.value - 1
14
18
  </script>
15
19
 
16
20
  <template>
17
21
  <nav :class="bemCssClasses" aria-label="breadcrumbs">
18
22
  <ol class="vv-breadcrumb__list">
19
23
  <li
20
- v-for="(route, index) in routes"
21
- :key="`${route.label}-${index}`"
22
- :class="{
23
- 'vv-breadcrumb__item': index < Number(routes?.length) - 1,
24
- 'vv-breadcrumb__item-active':
25
- index === Number(routes?.length) - 1,
26
- }"
24
+ v-for="({ label, ...route }, index) in routes"
25
+ :key="`${label}-${index}`"
26
+ :class="
27
+ !isLast(index)
28
+ ? 'vv-breadcrumb__item'
29
+ : 'vv-breadcrumb__item-active'
30
+ "
27
31
  itemprop="itemListElement"
28
32
  itemtype="https://schema.org/ListItem"
29
33
  itemscope
30
34
  >
31
- <Component
32
- :is="route.to ? 'router-link' : route.href ? 'a' : 'span'"
35
+ <VvAction
33
36
  v-bind="route"
34
- :class="{
35
- 'vv-breadcrumb__link':
36
- index < Number(routes?.length) - 1,
37
- }"
38
- :aria-current="
39
- index === Number(routes?.length) - 1
40
- ? 'page'
41
- : undefined
37
+ :class="
38
+ !isLast(index)
39
+ ? 'vv-breadcrumb__link'
40
+ : 'vv-breadcrumb__label'
42
41
  "
42
+ :aria-current="isLast(index) ? 'page' : undefined"
43
43
  itemprop="item"
44
+ default-tag="span"
44
45
  >
45
46
  <!-- @slot Slot for label -->
46
47
  <slot name="label" v-bind="{ route, index }">
47
- {{ route.label }}
48
+ {{ label }}
48
49
  </slot>
49
- </Component>
50
+ </VvAction>
50
51
  <meta itemprop="position" :content="`${index + 1}`" />
51
52
  </li>
52
53
  </ol>
@@ -1,13 +1,7 @@
1
1
  import { ModifiersProps } from '../../props'
2
-
3
- export interface Route {
4
- label: string
5
- to?: string | { [key: string]: unknown }
6
- title?: string
7
- href?: string
8
- }
2
+ import type { NavItem } from '../../types'
9
3
 
10
4
  export const VvBreadcrumbProps = {
11
5
  ...ModifiersProps,
12
- routes: Array as PropType<Route[]>,
6
+ routes: Array as PropType<NavItem[]>,
13
7
  }
@@ -227,7 +227,7 @@
227
227
  return
228
228
  }
229
229
  inputEl.value.stepUp()
230
- localModelValue.value = unref(inputEl).value
230
+ localModelValue.value = Number(unref(inputEl).value)
231
231
  }
232
232
  }
233
233
  const onStepDown = () => {
@@ -238,7 +238,7 @@
238
238
  return
239
239
  }
240
240
  inputEl.value.stepDown()
241
- localModelValue.value = unref(inputEl).value
241
+ localModelValue.value = Number(unref(inputEl).value)
242
242
  }
243
243
  }
244
244
 
@@ -1,7 +1,4 @@
1
1
  import tooltip from '../directives/v-tooltip'
2
2
  import contextmenu from '../directives/v-contextmenu'
3
3
 
4
- export default {
5
- tooltip,
6
- contextmenu,
7
- }
4
+ export { tooltip, contextmenu }
@@ -1,15 +1,24 @@
1
1
  import { render, type Directive, type DirectiveBinding } from 'vue'
2
2
  import VvTooltip from '../components/VvTooltip/VvTooltip.vue'
3
- import type { Side } from '../constants'
3
+ import { Side } from '../constants'
4
4
 
5
- const tooltip: Directive = {
6
- beforeMount(el: HTMLElement, binding: DirectiveBinding) {
7
- const tooltip = h(VvTooltip, {
8
- value: binding.value,
9
- position: binding.arg as Side,
10
- })
11
- render(tooltip, el)
12
- },
13
- }
5
+ const tooltip: Directive = (() => {
6
+ return {
7
+ beforeMount(el: HTMLElement, binding: DirectiveBinding) {
8
+ const tooltip = h(VvTooltip, {
9
+ value: binding.value,
10
+ position: binding.arg as Side,
11
+ })
12
+ render(tooltip, el)
13
+ },
14
+ updated(el: HTMLElement, binding: DirectiveBinding) {
15
+ const tooltip = h(VvTooltip, {
16
+ value: binding.value,
17
+ position: binding.arg as Side,
18
+ })
19
+ render(tooltip, el)
20
+ },
21
+ }
22
+ })()
14
23
 
15
24
  export default tooltip
package/src/index.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import VolverPlugin from './Volver'
2
- import type { Volver } from './Volver'
2
+ import type { Volver, VolverOptions } from './Volver'
3
3
 
4
4
  export { VolverPlugin }
5
+ export * from './types'
6
+ export type { Volver, VolverOptions }
5
7
 
6
8
  // https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
7
9
  // Add custom property and extend vue type definition
@@ -15,6 +15,7 @@ import {
15
15
  Side,
16
16
  AnchorTarget,
17
17
  ButtonType,
18
+ ActionTag,
18
19
  } from '@/constants'
19
20
 
20
21
  export const LinkProps = {
@@ -469,6 +470,13 @@ export const ActionProps = {
469
470
  type: String,
470
471
  default: undefined,
471
472
  },
473
+ /**
474
+ * Default tag for the action
475
+ */
476
+ defaultTag: {
477
+ type: String,
478
+ default: ActionTag.button,
479
+ },
472
480
  }
473
481
 
474
482
  export const NavProps = {
@@ -1,5 +1,6 @@
1
1
  export type Nullable<T> = T | null | undefined
2
2
 
3
- export type Option = Record<string | number | symbol, unknown> & {
3
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ export type Option = Record<string | number | symbol, any> & {
4
5
  options?: Option[]
5
6
  }