@bagelink/vue 1.15.238 → 1.15.239
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/index.cjs +30 -30
- package/dist/index.mjs +3910 -3907
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +10 -2
- package/src/components/layout/Tabs.vue +32 -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
|
}
|
|
@@ -1,20 +1,34 @@
|
|
|
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
|
+
icon?: IconType
|
|
24
|
+
iconEnd?: IconType
|
|
25
|
+
iconSize?: number | string
|
|
26
|
+
iconMobileSize?: number | string
|
|
14
27
|
}>()
|
|
15
28
|
|
|
16
29
|
const emit = defineEmits(['update:modelValue'])
|
|
17
30
|
const slots: SetupContext['slots'] = useSlots()
|
|
31
|
+
const attrs = useAttrs()
|
|
18
32
|
const group = Math.random().toString(36).slice(7)
|
|
19
33
|
const { currentTab } = useTabs(group)
|
|
20
34
|
|
|
@@ -41,13 +55,21 @@ const tabComponent = defineComponent({
|
|
|
41
55
|
</script>
|
|
42
56
|
|
|
43
57
|
<template>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</
|
|
58
|
+
<div class="bgl_tabs grid gap-05">
|
|
59
|
+
<div class="flex justify-content-center">
|
|
60
|
+
<TabsNav
|
|
61
|
+
v-bind="{ ...props, ...attrs }"
|
|
62
|
+
v-model="slctTab"
|
|
63
|
+
:group="group"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
<div v-if="currentTab">
|
|
67
|
+
<template v-if="slots[currentTab]">
|
|
68
|
+
<slot :name="currentTab" />
|
|
69
|
+
</template>
|
|
70
|
+
<template v-else-if="currentTab">
|
|
71
|
+
<component :is="tabComponent" />
|
|
72
|
+
</template>
|
|
73
|
+
</div>
|
|
52
74
|
</div>
|
|
53
75
|
</template>
|