@volverjs/ui-vue 0.0.10-beta.18 → 0.0.10-beta.20

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.
@@ -25,7 +25,7 @@
25
25
  props,
26
26
  )
27
27
 
28
- const { modifiers, id } = toRefs(props)
28
+ const { modifiers, id, readonly } = toRefs(props)
29
29
 
30
30
  const hasId = useUniqueId(id)
31
31
  const hasHintId = computed(() => `${hasId.value}-hint`)
@@ -142,7 +142,9 @@
142
142
  if (!inputEl.value) {
143
143
  return
144
144
  }
145
- inputEl.value.click()
145
+ if (!readonly.value) {
146
+ inputEl.value.click()
147
+ }
146
148
  }
147
149
 
148
150
  const onClickRemoveFile = (index: number) => {
@@ -210,6 +212,7 @@
210
212
  >
211
213
  <slot name="drop-area">
212
214
  <VvButton
215
+ v-if="!readonly"
213
216
  modifiers="action"
214
217
  aria-label="upload"
215
218
  :label="!previewSrc ? labelButton : undefined"
@@ -234,6 +237,7 @@
234
237
  <input
235
238
  :id="hasId"
236
239
  ref="inputEl"
240
+ :readonly="readonly"
237
241
  :placeholder="placeholder"
238
242
  :aria-describedby="hasHintLabelOrSlot ? hasHintId : undefined"
239
243
  :aria-invalid="invalid"
@@ -271,6 +275,7 @@
271
275
  {{ sizeInKiB(file.size) }} KB
272
276
  </small>
273
277
  <button
278
+ v-if="!readonly"
274
279
  type="button"
275
280
  class="vv-input-file__item-remove"
276
281
  title="Remove"
@@ -6,6 +6,7 @@ import {
6
6
  HintProps,
7
7
  LabelProps,
8
8
  LoadingProps,
9
+ ReadonlyProps,
9
10
  } from '../../props'
10
11
 
11
12
  export type VvInputFileEvents = {
@@ -19,6 +20,7 @@ export const VvInputFileProps = {
19
20
  ...HintProps,
20
21
  ...LabelProps,
21
22
  ...LoadingProps,
23
+ ...ReadonlyProps,
22
24
  name: { type: String },
23
25
  id: { type: String },
24
26
  modelValue: {
@@ -38,6 +38,14 @@ export const Default: Story = {
38
38
  }),
39
39
  }
40
40
 
41
+ export const Readonly: Story = {
42
+ ...Default,
43
+ args: {
44
+ ...defaultArgs,
45
+ readonly: true,
46
+ },
47
+ }
48
+
41
49
  export const Valid: Story = {
42
50
  ...Default,
43
51
  args: {