@bagelink/vue 1.15.238 → 1.15.241
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/Btn.vue.d.ts.map +1 -1
- package/dist/components/Image.vue.d.ts.map +1 -1
- package/dist/components/layout/Tabs.vue.d.ts +14 -1
- package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
- package/dist/index.cjs +31 -31
- package/dist/index.mjs +3319 -3311
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +10 -2
- package/src/components/Image.vue +6 -2
- package/src/components/layout/Tabs.vue +40 -10
package/package.json
CHANGED
package/src/components/Btn.vue
CHANGED
|
@@ -225,10 +225,13 @@ const slots: SetupContext['slots'] = useSlots()
|
|
|
225
225
|
'frost': computedVariant === 'frost',
|
|
226
226
|
'gradient': computedVariant === 'gradient',
|
|
227
227
|
'bgl_pill-frame': frame,
|
|
228
|
+
relative: loading,
|
|
228
229
|
}, computedPairClass]" :style="gradientStyle" :tabindex="disabled ? -1 : 0" @click.stop="handleClick" @keydown.enter="handleClick" @keydown.space="handleClick"
|
|
229
230
|
>
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
<!-- Keep label/icons mounted while loading so the button width/height don't jump.
|
|
232
|
+
absolute-fill + flex-center (not center-xy) so it stays centered in RTL too. -->
|
|
233
|
+
<Loading v-if="loading" class="absolute-fill flex-center pointer-events-none" size="15" color="currentColor" />
|
|
234
|
+
<div class="bgl_btn-flex" :class="{ invisible: loading }">
|
|
232
235
|
<Icon
|
|
233
236
|
v-if="icon" :icon="icon" class="transition-400" :size="iconSizeComputed"
|
|
234
237
|
:mobile-size="iconMobileSize"
|
|
@@ -296,6 +299,11 @@ justify-content: center;
|
|
|
296
299
|
height: 100%;
|
|
297
300
|
}
|
|
298
301
|
|
|
302
|
+
/* Loading.ring applies a thickness offset transform that pulls the spinner off-center */
|
|
303
|
+
.bgl_btn :deep(.lds-ring) {
|
|
304
|
+
transform: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
299
307
|
.bgl_btn .bgl_btn-icon {
|
|
300
308
|
font-size: calc(var(--bgl-input-font-size) * 1.3);
|
|
301
309
|
}
|
package/src/components/Image.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
defineOptions({ name: 'BglImage', inheritAttrs:
|
|
2
|
+
defineOptions({ name: 'BglImage', inheritAttrs: false })
|
|
3
3
|
import { Skeleton, normalizeDimension, Icon, useImageSrc } from '@bagelink/vue'
|
|
4
4
|
import { Comment, computed, useSlots, type StyleValue, type VNode } from 'vue'
|
|
5
5
|
|
|
@@ -68,14 +68,18 @@ const imgFit = computed(() => props.fit ?? 'cover')
|
|
|
68
68
|
</script>
|
|
69
69
|
|
|
70
70
|
<template>
|
|
71
|
-
<!-- Framed mode: ratio box with gradient base, blended photo, and overlay slot.
|
|
71
|
+
<!-- Framed mode: ratio box with gradient base, blended photo, and overlay slot.
|
|
72
|
+
Multi-root component → bind $attrs explicitly so class/style (e.g. flex-shrink-0) land on the frame. -->
|
|
72
73
|
<div
|
|
73
74
|
v-if="framed"
|
|
75
|
+
v-bind="$attrs"
|
|
74
76
|
class="bgl-image-frame relative overflow-hidden"
|
|
75
77
|
:class="ratioClass"
|
|
76
78
|
:style="{
|
|
77
79
|
width: normalizeDimension(width),
|
|
80
|
+
minWidth: normalizeDimension(width),
|
|
78
81
|
height: ratio ? undefined : normalizeDimension(height),
|
|
82
|
+
minHeight: ratio ? undefined : normalizeDimension(height),
|
|
79
83
|
background: gradientCss,
|
|
80
84
|
borderRadius: radiusStyle,
|
|
81
85
|
}"
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { Tab } from '@bagelink/vue'
|
|
2
|
+
import type { Tab, IconType } from '@bagelink/vue'
|
|
3
3
|
import type { SetupContext, VNode } from 'vue'
|
|
4
4
|
import { TabsNav } from '@bagelink/vue'
|
|
5
|
-
import { computed, defineComponent, h, useSlots } from 'vue'
|
|
5
|
+
import { computed, defineComponent, h, useAttrs, useSlots } from 'vue'
|
|
6
6
|
|
|
7
7
|
import { useTabs } from './tabsManager'
|
|
8
8
|
|
|
9
|
+
defineOptions({ inheritAttrs: false })
|
|
10
|
+
|
|
9
11
|
const props = defineProps<{
|
|
10
12
|
tabs: Tab[]
|
|
11
13
|
modelValue?: string
|
|
12
14
|
flat?: boolean
|
|
13
15
|
frame?: boolean
|
|
16
|
+
outline?: boolean
|
|
17
|
+
thin?: boolean
|
|
18
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
19
|
+
fullWidth?: boolean
|
|
20
|
+
fullWidthMobile?: boolean
|
|
21
|
+
alignTxt?: 'center' | 'start' | 'end'
|
|
22
|
+
alignTxtMobile?: 'center' | 'start' | 'end'
|
|
23
|
+
/** Horizontally center the tab bar (content panels stay full-width). */
|
|
24
|
+
center?: boolean
|
|
25
|
+
icon?: IconType
|
|
26
|
+
iconEnd?: IconType
|
|
27
|
+
iconSize?: number | string
|
|
28
|
+
iconMobileSize?: number | string
|
|
14
29
|
}>()
|
|
15
30
|
|
|
16
31
|
const emit = defineEmits(['update:modelValue'])
|
|
17
32
|
const slots: SetupContext['slots'] = useSlots()
|
|
33
|
+
const attrs = useAttrs()
|
|
18
34
|
const group = Math.random().toString(36).slice(7)
|
|
19
35
|
const { currentTab } = useTabs(group)
|
|
20
36
|
|
|
@@ -27,6 +43,12 @@ const slctTab = computed({
|
|
|
27
43
|
},
|
|
28
44
|
})
|
|
29
45
|
|
|
46
|
+
/** Props forwarded to TabsNav — omit `center` (layout-only here). */
|
|
47
|
+
const navProps = computed(() => {
|
|
48
|
+
const { center: _center, modelValue: _mv, ...rest } = props
|
|
49
|
+
return rest
|
|
50
|
+
})
|
|
51
|
+
|
|
30
52
|
const tabComponent = defineComponent({
|
|
31
53
|
render() {
|
|
32
54
|
const currentTabIndex = props.tabs.findIndex(
|
|
@@ -41,13 +63,21 @@ const tabComponent = defineComponent({
|
|
|
41
63
|
</script>
|
|
42
64
|
|
|
43
65
|
<template>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</
|
|
66
|
+
<div class="bgl_tabs">
|
|
67
|
+
<div :class="center ? 'flex justify-content-center' : undefined">
|
|
68
|
+
<TabsNav
|
|
69
|
+
v-bind="{ ...navProps, ...attrs }"
|
|
70
|
+
v-model="slctTab"
|
|
71
|
+
:group="group"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
<div v-if="currentTab">
|
|
75
|
+
<template v-if="slots[currentTab]">
|
|
76
|
+
<slot :name="currentTab" />
|
|
77
|
+
</template>
|
|
78
|
+
<template v-else-if="currentTab">
|
|
79
|
+
<component :is="tabComponent" />
|
|
80
|
+
</template>
|
|
81
|
+
</div>
|
|
52
82
|
</div>
|
|
53
83
|
</template>
|