@bagelink/vue 0.0.815 → 0.0.819

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.
@@ -3,40 +3,34 @@ import type { MaterialIcons, ThemeType } from '@bagelink/vue'
3
3
  import { Btn, MaterialIcon } from '@bagelink/vue'
4
4
  import { useSlots } from 'vue'
5
5
 
6
- const props = withDefaults(
7
- defineProps<{
8
- disabled?: boolean
9
- icon?: MaterialIcons
10
- iconEnd?: MaterialIcons
11
- color?: ThemeType
12
- theme?: ThemeType
13
- flat?: boolean
14
- border?: boolean
15
- outline?: boolean
16
- loading?: boolean
17
- value?: string
18
- round?: boolean
19
- btnStart?: boolean
20
- btnEnd?: boolean
21
-
22
- }>(),
23
- {
24
- onClick: () => '',
25
- loading: false,
26
- round: false,
27
- disabled: false,
28
- border: false,
29
- outline: false,
30
- btnStart: true
31
- },
32
- )
6
+ interface BtnProp {
7
+ icon: MaterialIcons
8
+ onClick: () => void
9
+ value: string
10
+ }
11
+
12
+ const props = defineProps<{
13
+ disabled?: boolean
14
+ icon?: MaterialIcons
15
+ iconEnd: MaterialIcons
16
+ color?: ThemeType
17
+ theme?: ThemeType
18
+ flat?: boolean
19
+ border?: boolean
20
+ outline?: boolean
21
+ loading?: boolean
22
+ value?: string
23
+ round?: boolean
24
+ btn: BtnProp
25
+ btnEnd: BtnProp
26
+ }>()
33
27
 
34
28
  const slots = useSlots()
35
29
 
36
30
  const computedTheme = $computed(
37
31
  () => {
38
32
  if (props.disabled) return 'gray-light'
39
- return (props.color || props.theme)
33
+ return (props.color || props.theme) as ThemeType
40
34
  },
41
35
  )
42
36
 
@@ -91,8 +85,8 @@ const computedBackgroundColor = $computed(
91
85
  <div class="bgl_pill-flex">
92
86
  <div v-if="loading" class="loading" />
93
87
  <div v-else>
94
- <div v-if="btnStart" class="flex h-100">
95
- <Btn class="bgl_pill-btn " thin icon="close" />
88
+ <div v-if="btn" class="flex h-100">
89
+ <Btn class="bgl_pill-btn" thin v-bind="btn" />
96
90
  </div>
97
91
  </div>
98
92
  <MaterialIcon v-if="icon" :icon="icon" />
@@ -100,11 +94,11 @@ const computedBackgroundColor = $computed(
100
94
  <template v-if="!slots.default && value">
101
95
  {{ value }}
102
96
  </template>
103
- <MaterialIcon v-if="props.iconEnd" :icon="props.iconEnd" />
97
+ <MaterialIcon v-if="iconEnd" :icon="iconEnd" />
104
98
  <div v-if="loading" class="loading" />
105
99
  <div v-else>
106
- <div v-if="props.btnEnd" class="flex h-100">
107
- <Btn class="bgl_pill-btn" thin icon="close" />
100
+ <div v-if="btnEnd" class="flex h-100">
101
+ <Btn class="bgl_pill-btn" thin v-bind="btnEnd" />
108
102
  </div>
109
103
  </div>
110
104
  </div>
@@ -48,6 +48,12 @@ onMounted(() => {
48
48
  if (!props.files && [file_bindkeys].flat().length > 0) {
49
49
  const ids = [file_bindkeys].flat().filter(Boolean) as (string | number)[] | undefined
50
50
  if (!ids?.length) return
51
+ if (bindKey === 'url') {
52
+ ids.forEach((url) => {
53
+ storageFiles.push({ url } as StorageFile)
54
+ })
55
+ return
56
+ }
51
57
  if (props.multiple) {
52
58
  ids.forEach((id) => {
53
59
  void bagel