@bagelink/vue 1.15.234 → 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.
@@ -7,6 +7,7 @@ export interface NavLink {
7
7
  href?: string;
8
8
  localized?: string;
9
9
  children?: NavLink[];
10
+ exact?: boolean;
10
11
  action?: () => void;
11
12
  class?: string;
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,kBAAkB,CAAA;IACzB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd"}
1
+ {"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,kBAAkB,CAAA;IACzB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAA;IACpB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.15.234",
4
+ "version": "1.15.239",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -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
- <Loading v-if="loading" class="h-100p" size="15" color="currentColor" />
231
- <div v-else class="bgl_btn-flex">
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
  }
@@ -33,6 +33,8 @@ const route = useRoute()
33
33
  watch(
34
34
  () => route.fullPath,
35
35
  async () => {
36
+ // Hash-only / hash navigations scroll to the target — don't yank back to top.
37
+ if (route.hash) return
36
38
  await nextTick()
37
39
  const container = anchor.value?.closest('.pageContent') as HTMLElement | null
38
40
  if (container) container.scrollTop = 0
@@ -8,6 +8,7 @@ import { resolveI18n } from '../../i18n'
8
8
  interface LinkWithAction extends NavLink {
9
9
  activeRoutes?: string[]
10
10
  children?: LinkWithAction[]
11
+ exact?: boolean
11
12
  action?: () => void
12
13
  }
13
14
 
@@ -34,6 +35,7 @@ function linkActive(link: LinkWithAction): boolean {
34
35
  p === '/' ? route.path === p : route.path === p || route.path.startsWith(`${p}/`))
35
36
  }
36
37
  if (!linkPath) return false
38
+ if (link.exact) return route.path === linkPath
37
39
  if (linkPath === '/') return route.path === linkPath
38
40
  return route.path === linkPath || route.path.startsWith(`${linkPath}/`)
39
41
  }
@@ -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
- <TabsNav v-model="slctTab" :flat="flat" :frame="frame" :tabs="tabs" :group class="mb-05" />
45
- <div v-if="currentTab">
46
- <template v-if="slots[currentTab]">
47
- <slot :name="currentTab" />
48
- </template>
49
- <template v-else-if="currentTab">
50
- <component :is="tabComponent" />
51
- </template>
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>
@@ -8,6 +8,7 @@ export interface NavLink {
8
8
  href?: string
9
9
  localized?: string
10
10
  children?: NavLink[]
11
+ exact?: boolean
11
12
  action?: () => void
12
13
  class?: string
13
14
  }