@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.
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +12 -12
- package/dist/components/VvAccordionGroup/index.d.ts +4 -4
- package/dist/components/VvAction/VvAction.vue.d.ts +2 -2
- package/dist/components/VvAction/index.d.ts +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +6 -6
- package/dist/components/VvAlert/index.d.ts +4 -3
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +9 -9
- package/dist/components/VvAlertGroup/index.d.ts +4 -4
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +4 -4
- package/dist/components/VvAvatarGroup/index.d.ts +2 -2
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +13 -13
- package/dist/components/VvBreadcrumb/index.d.ts +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +4 -4
- package/dist/components/VvButton/index.d.ts +2 -2
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +4 -4
- package/dist/components/VvButtonGroup/index.d.ts +2 -2
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +3 -3
- package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +438 -559
- package/dist/components/VvCombobox/index.d.ts +21 -241
- package/dist/components/VvDialog/VvDialog.es.js +41 -165
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +9 -0
- package/dist/components/VvDialog/index.d.ts +7 -0
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +33 -268
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +8 -6
- package/dist/components/VvDropdown/index.d.ts +9 -117
- package/dist/components/VvIcon/VvIcon.vue.d.ts +1 -1
- package/dist/components/VvInputFile/VvInputFile.es.js +11 -6
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +31 -105
- package/dist/components/VvInputFile/index.d.ts +11 -28
- package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +4 -4
- package/dist/components/VvInputText/VvInputText.vue.d.ts +4 -4
- package/dist/components/VvInputText/index.d.ts +4 -9
- package/dist/components/VvNav/VvNav.vue.d.ts +9 -9
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +3 -3
- package/dist/components/VvRadioGroup/index.d.ts +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +174 -184
- package/dist/components/VvSelect/index.d.ts +4 -4
- package/dist/components/VvTab/VvTab.vue.d.ts +13 -13
- package/dist/components/VvTab/index.d.ts +2 -2
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +2 -2
- package/dist/components/VvTextarea/index.d.ts +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +2 -2
- package/dist/components/VvTooltip/index.d.ts +1 -1
- package/dist/components/index.es.js +34 -31
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +47 -77
- package/dist/composables/index.es.js +1 -2
- package/dist/composables/useBlurhash.d.ts +1 -1
- package/dist/composables/useOptions.d.ts +3 -3
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/index.es.js +1 -4
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +14 -121
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +283 -347
- package/dist/stories/InputFile/InputFile.stories.d.ts +1 -0
- package/dist/test/expect.d.ts +0 -1
- package/dist/types/input-file.d.ts +2 -9
- package/dist/utils/ObjectUtilities.d.ts +1 -1
- package/package.json +29 -30
- package/src/Volver.ts +6 -6
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvButtonGroup/index.ts +1 -1
- package/src/components/VvCombobox/index.ts +6 -6
- package/src/components/VvDialog/VvDialog.vue +3 -5
- package/src/components/VvDialog/index.ts +4 -0
- package/src/components/VvInputFile/VvInputFile.vue +8 -3
- package/src/components/VvInputFile/index.ts +2 -0
- package/src/components/VvInputText/VvInputText.vue +18 -18
- package/src/components/common/HintSlot.ts +2 -2
- package/src/composables/group/useInjectedGroupState.ts +3 -3
- package/src/composables/group/useProvideGroupState.ts +3 -3
- package/src/composables/useDefaults.ts +4 -4
- package/src/props/index.ts +1 -1
- package/src/stories/InputFile/InputFile.stories.ts +8 -0
- package/src/types/group.ts +1 -1
- package/src/types/input-file.ts +10 -18
|
@@ -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
|
-
|
|
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
|
-
|
|
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="
|
|
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">
|
|
@@ -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 && !
|
|
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 (!
|
|
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
|
-
|
|
175
|
-
|
|
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
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
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
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
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
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
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
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
9
|
-
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
|
|
88
|
-
|
|
87
|
+
ExtractPropTypes<Definition>
|
|
88
|
+
>
|
|
89
89
|
})
|
|
90
90
|
}
|
package/src/props/index.ts
CHANGED
package/src/types/group.ts
CHANGED
package/src/types/input-file.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
export type UploadedFile<Source =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
}
|