@volverjs/ui-vue 0.0.10-beta.43 → 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/VvInputFile/VvInputFile.es.js +11 -6
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +9 -0
- package/dist/components/VvInputFile/index.d.ts +4 -0
- package/dist/components/index.es.js +11 -6
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/InputFile/InputFile.stories.d.ts +1 -0
- package/package.json +1 -1
- 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/VvInputFile/VvInputFile.vue +8 -3
- package/src/components/VvInputFile/index.ts +2 -0
- package/src/stories/InputFile/InputFile.stories.ts +8 -0
|
@@ -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
|