@volverjs/ui-vue 0.0.10-beta.42 → 0.0.10-beta.44

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 (84) hide show
  1. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +12 -12
  2. package/dist/components/VvAccordionGroup/index.d.ts +4 -4
  3. package/dist/components/VvAction/VvAction.vue.d.ts +2 -2
  4. package/dist/components/VvAction/index.d.ts +1 -1
  5. package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
  6. package/dist/components/VvAlert/index.d.ts +4 -3
  7. package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +9 -9
  8. package/dist/components/VvAlertGroup/index.d.ts +4 -4
  9. package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +4 -4
  10. package/dist/components/VvAvatarGroup/index.d.ts +2 -2
  11. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +13 -13
  12. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  13. package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
  14. package/dist/components/VvButton/index.d.ts +2 -2
  15. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +4 -4
  16. package/dist/components/VvButtonGroup/index.d.ts +2 -2
  17. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +1 -1
  18. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +3 -3
  19. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  20. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +438 -559
  21. package/dist/components/VvCombobox/index.d.ts +21 -241
  22. package/dist/components/VvDialog/VvDialog.es.js +41 -165
  23. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  24. package/dist/components/VvDialog/VvDialog.vue.d.ts +9 -0
  25. package/dist/components/VvDialog/index.d.ts +7 -0
  26. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +33 -268
  27. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +8 -6
  28. package/dist/components/VvDropdown/index.d.ts +9 -117
  29. package/dist/components/VvIcon/VvIcon.vue.d.ts +1 -1
  30. package/dist/components/VvInputFile/VvInputFile.es.js +11 -6
  31. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  32. package/dist/components/VvInputFile/VvInputFile.vue.d.ts +31 -105
  33. package/dist/components/VvInputFile/index.d.ts +11 -28
  34. package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
  35. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +4 -4
  36. package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
  37. package/dist/components/VvInputText/index.d.ts +4 -9
  38. package/dist/components/VvNav/VvNav.vue.d.ts +9 -9
  39. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +3 -3
  40. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  41. package/dist/components/VvSelect/VvSelect.vue.d.ts +174 -184
  42. package/dist/components/VvSelect/index.d.ts +4 -4
  43. package/dist/components/VvTab/VvTab.vue.d.ts +13 -13
  44. package/dist/components/VvTab/index.d.ts +2 -2
  45. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +2 -2
  46. package/dist/components/VvTextarea/index.d.ts +1 -1
  47. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
  48. package/dist/components/VvTooltip/index.d.ts +1 -1
  49. package/dist/components/index.es.js +34 -31
  50. package/dist/components/index.umd.js +1 -1
  51. package/dist/composables/alert/useAlert.d.ts +47 -77
  52. package/dist/composables/index.es.js +1 -2
  53. package/dist/composables/useBlurhash.d.ts +1 -1
  54. package/dist/composables/useOptions.d.ts +3 -3
  55. package/dist/icons.es.js +3 -3
  56. package/dist/icons.umd.js +1 -1
  57. package/dist/index.es.js +1 -4
  58. package/dist/index.umd.js +1 -1
  59. package/dist/props/index.d.ts +14 -121
  60. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +283 -347
  61. package/dist/stories/InputFile/InputFile.stories.d.ts +1 -0
  62. package/dist/test/expect.d.ts +0 -1
  63. package/dist/types/input-file.d.ts +2 -9
  64. package/dist/utils/ObjectUtilities.d.ts +1 -1
  65. package/package.json +29 -30
  66. package/src/Volver.ts +6 -6
  67. package/src/assets/icons/detailed.json +1 -1
  68. package/src/assets/icons/normal.json +1 -1
  69. package/src/assets/icons/simple.json +1 -1
  70. package/src/components/VvButtonGroup/index.ts +1 -1
  71. package/src/components/VvCombobox/index.ts +6 -6
  72. package/src/components/VvDialog/VvDialog.vue +3 -5
  73. package/src/components/VvDialog/index.ts +4 -0
  74. package/src/components/VvInputFile/VvInputFile.vue +8 -3
  75. package/src/components/VvInputFile/index.ts +2 -0
  76. package/src/components/VvInputText/VvInputText.vue +18 -18
  77. package/src/components/common/HintSlot.ts +2 -2
  78. package/src/composables/group/useInjectedGroupState.ts +3 -3
  79. package/src/composables/group/useProvideGroupState.ts +3 -3
  80. package/src/composables/useDefaults.ts +4 -4
  81. package/src/props/index.ts +1 -1
  82. package/src/stories/InputFile/InputFile.stories.ts +8 -0
  83. package/src/types/group.ts +1 -1
  84. package/src/types/input-file.ts +10 -18
@@ -21,7 +21,7 @@ export const VvButtonGroupProps = {
21
21
  | boolean
22
22
  | (string | number | boolean)[]
23
23
  | undefined
24
- >,
24
+ >,
25
25
  default: undefined,
26
26
  },
27
27
  }
@@ -99,11 +99,11 @@ export const VvComboboxProps = {
99
99
  */
100
100
  searchFunction: {
101
101
  type: Function as PropType<
102
- (
102
+ (
103
103
  search: string,
104
104
  options: (Option | string)[],
105
- ) => (Option | string)[] | Promise<(Option | string)[]>
106
- >,
105
+ ) => (Option | string)[] | Promise<(Option | string)[]>
106
+ >,
107
107
  default: undefined,
108
108
  },
109
109
  /**
@@ -207,11 +207,11 @@ export function useVvComboboxProps<T extends Option | string>() {
207
207
  searchFunction: {
208
208
  ...VvComboboxProps.searchFunction,
209
209
  type: Function as PropType<
210
- (
210
+ (
211
211
  search: string,
212
212
  options: T[],
213
- ) => T[] | Promise<T[]>
214
- >,
213
+ ) => T[] | Promise<T[]>
214
+ >,
215
215
  },
216
216
  }
217
217
  }
@@ -1,6 +1,5 @@
1
1
  <script setup lang="ts">
2
2
  import type { DialogHTMLAttributes } from 'vue'
3
- import VvIcon from '../VvIcon/VvIcon.vue'
4
3
  import { VvDialogEvents, VvDialogProps } from '.'
5
4
 
6
5
  // props, emit and template refs
@@ -134,12 +133,11 @@ export default {
134
133
  {{ title }}
135
134
  <button
136
135
  type="button"
137
- aria-label="Close"
136
+ :aria-label="labelClose"
137
+ :title="labelClose"
138
138
  class="vv-dialog__close"
139
139
  @click.passive="close"
140
- >
141
- <VvIcon name="close" />
142
- </button>
140
+ />
143
141
  </slot>
144
142
  </header>
145
143
  <div class="vv-dialog__content">
@@ -41,4 +41,8 @@ export const VvDialogProps = {
41
41
  * Keep open dialog on click outside
42
42
  */
43
43
  keepOpen: { type: Boolean, default: false },
44
+ /**
45
+ * Close button label
46
+ */
47
+ labelClose: { type: String, default: 'Close' },
44
48
  }
@@ -19,7 +19,7 @@ const propsDefaults = useDefaults<typeof VvInputFileProps>(
19
19
  VvInputFileProps,
20
20
  props,
21
21
  )
22
- const { modifiers, id, readonly, icon, iconPosition, iconDownload }
22
+ const { modifiers, id, readonly, disabled, icon, iconPosition, iconDownload }
23
23
  = toRefs(props)
24
24
  const hasId = useUniqueId(id)
25
25
  const hasHintId = computed(() => `${hasId.value}-hint`)
@@ -83,12 +83,14 @@ const files = computed({
83
83
  },
84
84
  })
85
85
 
86
+ const isDisabledOrReadonly = computed(() => props.disabled || props.readonly)
87
+
86
88
  const hasMax = computed(() => {
87
89
  return typeof props.max === 'string' ? Number.parseInt(props.max) : props.max
88
90
  })
89
91
 
90
92
  const hasDropArea = computed(() => {
91
- return props.dropArea && !readonly.value
93
+ return props.dropArea && !isDisabledOrReadonly.value
92
94
  })
93
95
 
94
96
  const isMultiple = computed(() => {
@@ -161,7 +163,7 @@ function onClickDropArea() {
161
163
  if (!inputEl.value) {
162
164
  return
163
165
  }
164
- if (!readonly.value) {
166
+ if (!isDisabledOrReadonly.value) {
165
167
  inputEl.value.click()
166
168
  }
167
169
  }
@@ -302,6 +304,7 @@ export default {
302
304
  modifiers="action"
303
305
  :label="!previewSrc ? dropdAreaActionLabel : undefined"
304
306
  :title="previewSrc ? dropdAreaActionLabel : undefined"
307
+ :disabled="disabled"
305
308
  :class="{
306
309
  'vv-input-file__drop-area-action': previewSrc,
307
310
  }"
@@ -317,6 +320,7 @@ export default {
317
320
  ref="inputEl"
318
321
  type="file"
319
322
  :readonly="readonly"
323
+ :disabled="disabled"
320
324
  :placeholder="placeholder"
321
325
  :aria-describedby="hasHintLabelOrSlot ? hasHintId : undefined"
322
326
  :aria-invalid="invalid"
@@ -379,6 +383,7 @@ export default {
379
383
  type="button"
380
384
  class="vv-input-file__item-remove"
381
385
  :title="labelRemove"
386
+ :disabled="disabled"
382
387
  @click.stop="onClickRemoveFile(index)"
383
388
  />
384
389
  </li>
@@ -7,6 +7,7 @@ import {
7
7
  LabelProps,
8
8
  LoadingProps,
9
9
  ReadonlyProps,
10
+ DisabledProps,
10
11
  IconProps,
11
12
  } from '../../props'
12
13
  import { type VvIconProps, ACTION_ICONS } from '../VvIcon'
@@ -33,6 +34,7 @@ export const VvInputFileProps = {
33
34
  ...LabelProps,
34
35
  ...LoadingProps,
35
36
  ...ReadonlyProps,
37
+ ...DisabledProps,
36
38
  ...IconProps,
37
39
  /**
38
40
  * Input value
@@ -171,8 +171,8 @@ function updateMaskValue(newValue: string | number | undefined) {
171
171
  }
172
172
  if (
173
173
  type.value === INPUT_TYPES.NUMBER
174
- && NEGATIVE_ZERO_REGEX.test(unmasked.value)
175
- && newValue === 0
174
+ && NEGATIVE_ZERO_REGEX.test(unmasked.value)
175
+ && newValue === 0
176
176
  ) {
177
177
  return
178
178
  }
@@ -430,11 +430,11 @@ const hasAttrs = computed(() => {
430
430
  }
431
431
  if (
432
432
  type === INPUT_TYPES.DATE
433
- || type === INPUT_TYPES.MONTH
434
- || type === INPUT_TYPES.WEEK
435
- || type === INPUT_TYPES.TIME
436
- || type === INPUT_TYPES.DATETIME_LOCAL
437
- || type === INPUT_TYPES.NUMBER
433
+ || type === INPUT_TYPES.MONTH
434
+ || type === INPUT_TYPES.WEEK
435
+ || type === INPUT_TYPES.TIME
436
+ || type === INPUT_TYPES.DATETIME_LOCAL
437
+ || type === INPUT_TYPES.NUMBER
438
438
  ) {
439
439
  let max = props.max
440
440
  if (type === INPUT_TYPES.DATE && !max) {
@@ -447,22 +447,22 @@ const hasAttrs = computed(() => {
447
447
  }
448
448
  if (
449
449
  type === INPUT_TYPES.TEXT
450
- || type === INPUT_TYPES.SEARCH
451
- || type === INPUT_TYPES.URL
452
- || type === INPUT_TYPES.TEL
453
- || type === INPUT_TYPES.EMAIL
454
- || type === INPUT_TYPES.PASSWORD
455
- || type === INPUT_TYPES.NUMBER
450
+ || type === INPUT_TYPES.SEARCH
451
+ || type === INPUT_TYPES.URL
452
+ || type === INPUT_TYPES.TEL
453
+ || type === INPUT_TYPES.EMAIL
454
+ || type === INPUT_TYPES.PASSWORD
455
+ || type === INPUT_TYPES.NUMBER
456
456
  ) {
457
457
  toReturn.placeholder = inputTextPlaceholder.value
458
458
  }
459
459
  if (
460
460
  type === INPUT_TYPES.TEXT
461
- || type === INPUT_TYPES.SEARCH
462
- || type === INPUT_TYPES.URL
463
- || type === INPUT_TYPES.TEL
464
- || type === INPUT_TYPES.EMAIL
465
- || type === INPUT_TYPES.PASSWORD
461
+ || type === INPUT_TYPES.SEARCH
462
+ || type === INPUT_TYPES.URL
463
+ || type === INPUT_TYPES.TEL
464
+ || type === INPUT_TYPES.EMAIL
465
+ || type === INPUT_TYPES.PASSWORD
466
466
  ) {
467
467
  toReturn.minlength = props.minlength
468
468
  toReturn.maxlength = props.maxlength
@@ -13,7 +13,7 @@ function joinLines(items: string[] | string | unknown[] | undefined) {
13
13
  }
14
14
 
15
15
  export type HintSlotProps = Readonly<
16
- ExtractPropTypes<{
16
+ ExtractPropTypes<{
17
17
  hintLabel: {
18
18
  type: StringConstructor
19
19
  default: ''
@@ -26,7 +26,7 @@ export type HintSlotProps = Readonly<
26
26
  invalidLabel: (StringConstructor | ArrayConstructor)[]
27
27
  loading: BooleanConstructor
28
28
  loadingLabel: StringConstructor
29
- }>
29
+ }>
30
30
  >
31
31
 
32
32
  /**
@@ -16,9 +16,9 @@ export function useInjectedGroupState<GroupStateType>(
16
16
  * Get a group or local property
17
17
  */
18
18
  function getGroupOrLocalRef<
19
- TProps extends object,
20
- TName extends keyof GroupStateType,
21
- >(
19
+ TProps extends object,
20
+ TName extends keyof GroupStateType,
21
+ >(
22
22
  propName: TName,
23
23
  props: TProps,
24
24
  emit?: (event: string, ...args: unknown[]) => void,
@@ -5,10 +5,10 @@ import type { Emitter } from 'mitt'
5
5
  * Share part of the state of the component with all its children.
6
6
  */
7
7
  export function useProvideGroupState<
8
- TGroupState extends Record<
9
- string,
8
+ TGroupState extends Record<
9
+ string,
10
10
  Ref<unknown> | Emitter<any>
11
- >,
11
+ >,
12
12
  >(key: InjectionKey<TGroupState>, groupState: TGroupState) {
13
13
  provide(key, groupState)
14
14
  }
@@ -55,8 +55,8 @@ export function useDefaults<Definition>(
55
55
  // single type
56
56
  if (typeof simplifiedPropsDefinition[key] === 'function') {
57
57
  const typeFunction = simplifiedPropsDefinition[key] as <
58
- T,
59
- >() => T
58
+ T,
59
+ >() => T
60
60
  if (typeFunction() === propValue) {
61
61
  acc[key] = componentDefaults[key]
62
62
  }
@@ -84,7 +84,7 @@ export function useDefaults<Definition>(
84
84
  }
85
85
  return acc
86
86
  }, {} as Record<string, unknown>) as Readonly<
87
- ExtractPropTypes<Definition>
88
- >
87
+ ExtractPropTypes<Definition>
88
+ >
89
89
  })
90
90
  }
@@ -300,7 +300,7 @@ export const DropdownProps = {
300
300
  offset: {
301
301
  type: [Number, String, Object] as PropType<
302
302
  OffsetOptions | number | string
303
- >,
303
+ >,
304
304
  default: 0,
305
305
  },
306
306
  /**
@@ -44,6 +44,14 @@ export const Readonly: Story = {
44
44
  },
45
45
  }
46
46
 
47
+ export const Disabled: Story = {
48
+ ...Default,
49
+ args: {
50
+ ...defaultArgs,
51
+ disabled: true,
52
+ },
53
+ }
54
+
47
55
  export const Valid: Story = {
48
56
  ...Default,
49
57
  args: {
@@ -18,7 +18,7 @@ export type InputGroupState = {
18
18
  export type ButtonGroupState = {
19
19
  modelValue: Ref<
20
20
  string | number | boolean | (string | number | boolean)[] | undefined
21
- >
21
+ >
22
22
  disabled: Ref<boolean>
23
23
  toggle: Ref<boolean>
24
24
  multiple: Ref<boolean>
@@ -1,18 +1,10 @@
1
- export type UploadedFile<Source = undefined> = Source extends undefined
2
- ? {
3
- name: string
4
- size: number
5
- type: string
6
- url?: string
7
- thumbnailUrl?: string
8
- lastModified?: number
9
- }
10
- : {
11
- name: string
12
- size: number
13
- type: string
14
- url?: string
15
- thumbnailUrl?: string
16
- lastModified?: number
17
- source: Source
18
- }
1
+ export type UploadedFile<Source = unknown> =
2
+ {
3
+ name: string
4
+ size: number
5
+ type: string
6
+ url?: string
7
+ thumbnailUrl?: string
8
+ lastModified?: number
9
+ source?: Source
10
+ }