@bagelink/vue 0.0.466 → 0.0.471

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.
Files changed (179) hide show
  1. package/dist/components/Accordion.vue.d.ts.map +1 -1
  2. package/dist/components/AccordionItem.vue.d.ts.map +1 -1
  3. package/dist/components/Alert.vue.d.ts +2 -2
  4. package/dist/components/Alert.vue.d.ts.map +1 -1
  5. package/dist/components/Avatar.vue.d.ts.map +1 -1
  6. package/dist/components/Badge.vue.d.ts +2 -2
  7. package/dist/components/Badge.vue.d.ts.map +1 -1
  8. package/dist/components/BglVideo.vue.d.ts +2 -2
  9. package/dist/components/BglVideo.vue.d.ts.map +1 -1
  10. package/dist/components/Btn.vue.d.ts.map +1 -1
  11. package/dist/components/Card.vue.d.ts.map +1 -1
  12. package/dist/components/Carousel.vue.d.ts +4 -2
  13. package/dist/components/Carousel.vue.d.ts.map +1 -1
  14. package/dist/components/DataPreview.vue.d.ts.map +1 -1
  15. package/dist/components/Drop.vue.d.ts +34 -0
  16. package/dist/components/Drop.vue.d.ts.map +1 -0
  17. package/dist/components/FileUploader.vue.d.ts +60 -0
  18. package/dist/components/FileUploader.vue.d.ts.map +1 -0
  19. package/dist/components/Flag.vue.d.ts +2 -2
  20. package/dist/components/Flag.vue.d.ts.map +1 -1
  21. package/dist/components/ListItem.vue.d.ts.map +1 -1
  22. package/dist/components/ListView.vue.d.ts.map +1 -1
  23. package/dist/components/MapEmbed.vue.d.ts +2 -2
  24. package/dist/components/MapEmbed.vue.d.ts.map +1 -1
  25. package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
  26. package/dist/components/Modal.vue.d.ts +2 -1
  27. package/dist/components/Modal.vue.d.ts.map +1 -1
  28. package/dist/components/ModalConfirm.vue.d.ts.map +1 -1
  29. package/dist/components/ModalForm.vue.d.ts.map +1 -1
  30. package/dist/components/NavBar.vue.d.ts.map +1 -1
  31. package/dist/components/PageTitle.vue.d.ts.map +1 -1
  32. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  33. package/dist/components/Title.vue.d.ts.map +1 -1
  34. package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
  35. package/dist/components/dashboard/index.d.ts.map +1 -1
  36. package/dist/components/form/BglField.vue.d.ts.map +1 -1
  37. package/dist/components/form/BglForm.vue.d.ts +4 -2
  38. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  39. package/dist/components/form/ItemRef.vue.d.ts +1 -0
  40. package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
  41. package/dist/components/form/index.d.ts.map +1 -1
  42. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  43. package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
  44. package/dist/components/form/inputs/ColorPicker.vue.d.ts.map +1 -1
  45. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  46. package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
  47. package/dist/components/form/inputs/FileUpload.vue.d.ts +2 -1
  48. package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
  49. package/dist/components/form/inputs/JSONInput.vue.d.ts.map +1 -1
  50. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
  51. package/dist/components/form/inputs/RichText.vue.d.ts.map +1 -1
  52. package/dist/components/form/inputs/SelectField.vue.d.ts +1 -4
  53. package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
  54. package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
  55. package/dist/components/form/inputs/SignaturePad.vue.d.ts +56 -0
  56. package/dist/components/form/inputs/SignaturePad.vue.d.ts.map +1 -0
  57. package/dist/components/form/inputs/TableField.vue.d.ts.map +1 -1
  58. package/dist/components/form/inputs/TelInput.vue.d.ts +2 -2
  59. package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
  60. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  61. package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -1
  62. package/dist/components/form/inputs/index.d.ts +1 -0
  63. package/dist/components/form/inputs/index.d.ts.map +1 -1
  64. package/dist/components/index.d.ts.map +1 -1
  65. package/dist/components/layout/BottomMenu.vue.d.ts.map +1 -1
  66. package/dist/components/layout/Layout.vue.d.ts +2 -2
  67. package/dist/components/layout/Layout.vue.d.ts.map +1 -1
  68. package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
  69. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -1
  70. package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
  71. package/dist/components/layout/TabsBody.vue.d.ts.map +1 -1
  72. package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
  73. package/dist/components/layout/index.d.ts.map +1 -1
  74. package/dist/index.cjs +17616 -20818
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.mjs +17616 -20818
  77. package/dist/plugins/bagel.d.ts +1 -1
  78. package/dist/plugins/bagel.d.ts.map +1 -1
  79. package/dist/plugins/modal.d.ts +14 -14
  80. package/dist/plugins/modal.d.ts.map +1 -1
  81. package/dist/style.css +330 -309
  82. package/dist/types/BagelForm.d.ts +16 -16
  83. package/dist/types/BagelForm.d.ts.map +1 -1
  84. package/dist/types/BtnOptions.d.ts +1 -1
  85. package/dist/types/BtnOptions.d.ts.map +1 -1
  86. package/dist/types/NavLink.d.ts +2 -2
  87. package/dist/types/NavLink.d.ts.map +1 -1
  88. package/dist/types/file.d.ts +2 -2
  89. package/dist/types/file.d.ts.map +1 -1
  90. package/dist/types/index.d.ts.map +1 -1
  91. package/dist/types/materialIcons.d.ts.map +1 -1
  92. package/dist/utils/BagelFormUtils.d.ts.map +1 -1
  93. package/dist/utils/allCountries.d.ts +2 -2
  94. package/dist/utils/allCountries.d.ts.map +1 -1
  95. package/dist/utils/clickOutside.d.ts.map +1 -1
  96. package/dist/utils/index.d.ts +5 -5
  97. package/dist/utils/index.d.ts.map +1 -1
  98. package/package.json +19 -17
  99. package/src/components/Accordion.vue +10 -10
  100. package/src/components/AccordionItem.vue +47 -47
  101. package/src/components/Alert.vue +21 -21
  102. package/src/components/Avatar.vue +15 -15
  103. package/src/components/Badge.vue +17 -16
  104. package/src/components/BglVideo.vue +43 -43
  105. package/src/components/Btn.vue +64 -65
  106. package/src/components/Card.vue +26 -26
  107. package/src/components/Carousel.vue +130 -134
  108. package/src/components/DataPreview.vue +30 -30
  109. package/src/components/Flag.vue +26 -26
  110. package/src/components/ListItem.vue +13 -13
  111. package/src/components/ListView.vue +2 -2
  112. package/src/components/MapEmbed.vue +33 -33
  113. package/src/components/MaterialIcon.vue +12 -12
  114. package/src/components/Modal.vue +73 -66
  115. package/src/components/ModalConfirm.vue +18 -18
  116. package/src/components/ModalForm.vue +79 -76
  117. package/src/components/NavBar.vue +33 -30
  118. package/src/components/PageTitle.vue +10 -8
  119. package/src/components/TableSchema.vue +123 -113
  120. package/src/components/Title.vue +8 -8
  121. package/src/components/dashboard/Lineart.vue +103 -96
  122. package/src/components/dashboard/index.ts +1 -1
  123. package/src/components/form/BglField.vue +61 -61
  124. package/src/components/form/BglFieldSet.vue +9 -8
  125. package/src/components/form/BglForm.vue +71 -70
  126. package/src/components/form/index.ts +4 -4
  127. package/src/components/form/inputs/CheckInput.vue +25 -23
  128. package/src/components/form/inputs/Checkbox.vue +10 -10
  129. package/src/components/form/inputs/ColorPicker.vue +26 -24
  130. package/src/components/form/inputs/DateInput.vue +39 -39
  131. package/src/components/form/inputs/DatePicker.vue +37 -36
  132. package/src/components/form/inputs/FileUpload.vue +165 -161
  133. package/src/components/form/inputs/FileUploadURL.vue +134 -132
  134. package/src/components/form/inputs/JSONInput.vue +29 -29
  135. package/src/components/form/inputs/RadioPillsInput.vue +49 -49
  136. package/src/components/form/inputs/RichText.vue +62 -63
  137. package/src/components/form/inputs/SelectInput.vue +173 -167
  138. package/src/components/form/inputs/SignaturePad.vue +150 -0
  139. package/src/components/form/inputs/TableField.vue +77 -76
  140. package/src/components/form/inputs/TelInput.vue +280 -285
  141. package/src/components/form/inputs/TextInput.vue +81 -76
  142. package/src/components/form/inputs/ToggleInput.vue +13 -13
  143. package/src/components/form/inputs/index.ts +17 -15
  144. package/src/components/formkit/FileUploader.vue +162 -158
  145. package/src/components/formkit/MiscFields.vue +20 -20
  146. package/src/components/formkit/Toggle.vue +13 -13
  147. package/src/components/index.ts +28 -28
  148. package/src/components/layout/BottomMenu.vue +25 -21
  149. package/src/components/layout/Layout.vue +29 -29
  150. package/src/components/layout/SidebarMenu.vue +31 -27
  151. package/src/components/layout/TabbedLayout.vue +47 -45
  152. package/src/components/layout/Tabs.vue +32 -32
  153. package/src/components/layout/TabsBody.vue +10 -10
  154. package/src/components/layout/TabsNav.vue +44 -44
  155. package/src/components/layout/index.ts +7 -7
  156. package/src/components/layout/tabsManager.ts +6 -6
  157. package/src/index.ts +13 -8
  158. package/src/plugins/bagel.ts +37 -37
  159. package/src/plugins/modal.ts +66 -67
  160. package/src/styles/layout.css +5 -3
  161. package/src/styles/mobilLayout.css +7 -0
  162. package/src/types/BagelForm.ts +27 -27
  163. package/src/types/BtnOptions.ts +13 -13
  164. package/src/types/NavLink.ts +8 -8
  165. package/src/types/file.ts +11 -11
  166. package/src/types/index.ts +16 -12
  167. package/src/types/materialIcons.ts +3249 -3249
  168. package/src/utils/BagelFormUtils.ts +23 -23
  169. package/src/utils/allCountries.ts +11 -12
  170. package/src/utils/clickOutside.ts +6 -6
  171. package/src/utils/index.ts +39 -41
  172. package/src/utils/lang.ts +13 -13
  173. package/src/utils/strings.ts +9 -9
  174. package/tsconfig.json +0 -1
  175. package/vite.config.ts +8 -8
  176. package/dist/components/Popover.vue.d.ts +0 -10
  177. package/dist/components/Popover.vue.d.ts.map +0 -1
  178. package/dist/types/materialIcon.d.ts +0 -2
  179. package/dist/types/materialIcon.d.ts.map +0 -1
@@ -1,24 +1,24 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ helpText?: string
4
+ id: string
5
+ label?: string
6
+ }>()
7
+ const inputVal = defineModel('modelValue', {
8
+ type: Boolean,
9
+ default: false,
10
+ })
11
+ </script>
12
+
1
13
  <template>
2
14
  <div class="bagel-input checkbox" :title="label">
3
15
  <label class="switch">
4
- <input type="checkbox" v-model="inputVal" :id="id">
16
+ <input :id="id" v-model="inputVal" type="checkbox">
5
17
  <span class="slider round" />
6
18
  </label>
7
19
  </div>
8
20
  </template>
9
21
 
10
- <script setup lang="ts">
11
- defineProps<{
12
- helpText?: string;
13
- id: string;
14
- label?: string;
15
- }>();
16
- const inputVal = defineModel('modelValue', {
17
- type: Boolean,
18
- default: false,
19
- });
20
- </script>
21
-
22
22
  <style>
23
23
  .checkbox-label {
24
24
  display: flex;
@@ -1,30 +1,30 @@
1
- export { default as MaterialIcon } from './MaterialIcon.vue';
2
- export { default as Icon } from './MaterialIcon.vue';
3
- export { default as NavBar } from './NavBar.vue';
4
- export { default as Btn } from './Btn.vue';
5
- export { default as Modal } from './Modal.vue';
6
- export { default as ModalForm } from './ModalForm.vue';
7
- export { default as AccordionItem } from './AccordionItem.vue';
8
- export { default as ListView } from './ListView.vue';
9
- export { default as ListItem } from './ListItem.vue';
10
- export { default as PageTitle } from './PageTitle.vue';
11
- export { default as TableSchema } from './TableSchema.vue';
12
- export { default as TopBar } from './TopBar.vue';
13
- export { default as RouterWrapper } from './RouterWrapper.vue';
14
- export { default as DataPreview } from './DataPreview.vue';
15
- export { default as Card } from './Card.vue';
16
- export { default as Avatar } from './Avatar.vue';
17
- export { default as Title } from './Title.vue';
18
- export { default as Accordion } from './Accordion.vue';
19
- export { default as Alert } from './Alert.vue';
20
- export { default as Badge } from './Badge.vue';
21
- export { default as BglVideo } from './BglVideo.vue';
22
- export { default as Carousel } from './Carousel.vue';
23
- export { default as ModalConfirm } from './ModalConfirm.vue';
24
- export { default as MapEmbed } from './MapEmbed.vue';
25
- export { default as Flag } from './Flag.vue';
1
+ export { default as MaterialIcon } from './MaterialIcon.vue'
2
+ export { default as Icon } from './MaterialIcon.vue'
3
+ export { default as NavBar } from './NavBar.vue'
4
+ export { default as Btn } from './Btn.vue'
5
+ export { default as Modal } from './Modal.vue'
6
+ export { default as ModalForm } from './ModalForm.vue'
7
+ export { default as AccordionItem } from './AccordionItem.vue'
8
+ export { default as ListView } from './ListView.vue'
9
+ export { default as ListItem } from './ListItem.vue'
10
+ export { default as PageTitle } from './PageTitle.vue'
11
+ export { default as TableSchema } from './TableSchema.vue'
12
+ export { default as TopBar } from './TopBar.vue'
13
+ export { default as RouterWrapper } from './RouterWrapper.vue'
14
+ export { default as DataPreview } from './DataPreview.vue'
15
+ export { default as Card } from './Card.vue'
16
+ export { default as Avatar } from './Avatar.vue'
17
+ export { default as Title } from './Title.vue'
18
+ export { default as Accordion } from './Accordion.vue'
19
+ export { default as Alert } from './Alert.vue'
20
+ export { default as Badge } from './Badge.vue'
21
+ export { default as BglVideo } from './BglVideo.vue'
22
+ export { default as Carousel } from './Carousel.vue'
23
+ export { default as ModalConfirm } from './ModalConfirm.vue'
24
+ export { default as MapEmbed } from './MapEmbed.vue'
25
+ export { default as Flag } from './Flag.vue'
26
26
 
27
- export * from './form';
28
- export * from './dashboard';
27
+ export * from './form'
28
+ export * from './dashboard'
29
29
  // export * from './whatsapp';
30
- export * from './layout';
30
+ export * from './layout'
@@ -1,37 +1,42 @@
1
+ <script lang="ts" setup>
2
+ import {
3
+ Btn,
4
+ Card,
5
+ Icon,
6
+ type NavLink,
7
+ } from '@bagelink/vue'
8
+
9
+ defineProps<{
10
+ navLinks: NavLink[]
11
+ }>()
12
+ </script>
13
+
1
14
  <template>
2
15
  <Card
3
16
  class="hide m_grid gap-05 bgl_bottombar px-1 txt14 justify-content-start align-items-center
4
17
  overflow-x"
5
18
  >
6
- <slot name="brand" />
7
- <Btn @click="nav.onClick" :to="nav.to" v-for="(nav, i) in navLinks" :key="i"
8
- class="m_h-auto">
9
- <Icon :icon="nav.icon" :size="1.4" class="m-0" />
10
- <p class="m-0 pb-025 txt14 line-height-1">
11
- {{ nav.label }}
12
- </p>
13
- </Btn>
14
- </Card>
19
+ <slot name="brand" />
20
+ <Btn
21
+ v-for="(nav, i) in navLinks" :key="i" :to="nav.to" class="m_h-auto"
22
+ @click="nav.onClick"
23
+ >
24
+ <Icon :icon="nav.icon" :size="1.4" class="m-0" />
25
+ <p class="m-0 pb-025 txt14 line-height-1">
26
+ {{ nav.label }}
27
+ </p>
28
+ </Btn>
29
+ </Card>
15
30
  </template>
16
31
 
17
- <script lang="ts" setup>
18
- import {
19
- Icon, Btn, type NavLink, Card,
20
- } from '@bagelink/vue';
21
-
22
- defineProps<{
23
- navLinks: NavLink[];
24
- }>();
25
- </script>
26
-
27
32
  <style>
28
33
  .bgl_bottombar .bgl_btn-flex{
29
34
  flex-direction: column;
30
35
  height: 60px;
31
36
  gap: 0;
32
37
  }
33
-
34
38
  </style>
39
+
35
40
  <style scoped>
36
41
  .bgl_bottombar {
37
42
  background-color: var(--bgl-primary);
@@ -43,7 +48,6 @@ defineProps<{
43
48
  --bgl_bottombar-btn-width: 62px;
44
49
  }
45
50
 
46
-
47
51
  .bgl_bottombar>* {
48
52
  width: var(--bgl_bottombar-btn-width);
49
53
  }
@@ -1,43 +1,43 @@
1
- <template>
2
- <div class="layout" :class="{ 'layout-h-100': h100 }">
3
- <slot />
4
- </div>
5
- </template>
6
-
7
1
  <script lang="ts" setup>
8
- type LayoutProrps = {
9
- gap?: number,
10
- h100?: boolean,
11
- columns?: string[]
12
- mColumns?: string[],
13
- mRows?: string[]
14
- rows?: string[],
2
+ interface LayoutProrps {
3
+ gap?: number
4
+ h100?: boolean
5
+ columns?: string[]
6
+ mColumns?: string[]
7
+ mRows?: string[]
8
+ rows?: string[]
15
9
  }
16
10
 
17
11
  const props = withDefaults(defineProps<LayoutProrps>(), {
18
- gap: 1,
19
- h100: false,
20
- columns: () => ([]),
21
- rows: () => ([]),
22
- mColumns: () => ([]),
23
- mRows: () => ([]),
24
- });
12
+ gap: 1,
13
+ h100: false,
14
+ columns: () => ([]),
15
+ rows: () => ([]),
16
+ mColumns: () => ([]),
17
+ mRows: () => ([]),
18
+ })
25
19
 
26
- const gridTemplateRows = $computed(() => (props.rows.length ? props.rows.join(' ') : 'auto'));
27
- const gapSize = $computed(() => `${props.gap}rem`);
20
+ const gridTemplateRows = $computed(() => (props.rows.length ? props.rows.join(' ') : 'auto'))
21
+ const gapSize = $computed(() => `${props.gap}rem`)
28
22
  const mGridTemplateRows = $computed(() => {
29
- if (props.mRows?.length) return props.mRows.join(' ');
30
- return gridTemplateRows;
31
- });
23
+ if (props.mRows?.length) return props.mRows.join(' ')
24
+ return gridTemplateRows
25
+ })
32
26
 
33
- const gridTemplateColumns = $computed(() => (props.columns.length ? props.columns.join(' ') : 'auto'));
27
+ const gridTemplateColumns = $computed(() => (props.columns.length ? props.columns.join(' ') : 'auto'))
34
28
 
35
29
  const mGridTemplateColumns = $computed(() => {
36
- if (props.mColumns?.length) return props.mColumns.join(' ');
37
- return gridTemplateColumns;
38
- });
30
+ if (props.mColumns?.length) return props.mColumns.join(' ')
31
+ return gridTemplateColumns
32
+ })
39
33
  </script>
40
34
 
35
+ <template>
36
+ <div class="layout" :class="{ 'layout-h-100': h100 }">
37
+ <slot />
38
+ </div>
39
+ </template>
40
+
41
41
  <style scoped>
42
42
  .layout {
43
43
  min-height: 100px;
@@ -1,14 +1,39 @@
1
+ <script lang="ts" setup>
2
+ import { useSlots } from 'vue'
3
+ import { Btn, Card, Icon } from '@bagelink/vue'
4
+ import type { NavLink } from '@bagelink/vue'
5
+
6
+ const props = defineProps<{
7
+ navLinks?: NavLink[]
8
+ expandable?: boolean
9
+ open: boolean
10
+ }>()
11
+
12
+ const emit = defineEmits(['update:open'])
13
+
14
+ const slots = useSlots()
15
+
16
+ let isOpen = $ref(props.open)
17
+
18
+ function toggleMenu() {
19
+ isOpen = !isOpen
20
+ emit('update:open', isOpen)
21
+ }
22
+ </script>
23
+
1
24
  <template>
2
25
  <Card
3
26
  class="flex column gap-05 pt-1 bgl_sidebar"
4
- :class="{ wideNav: isOpen }">
27
+ :class="{ wideNav: isOpen }"
28
+ >
5
29
  <div class="w-100 px-075">
6
30
  <Btn
7
31
  thin
8
32
  color="light"
9
33
  class="toggleNav mb-05"
10
34
  icon="keyboard_arrow_right"
11
- @click="toggleMenu" />
35
+ @click="toggleMenu"
36
+ />
12
37
  </div>
13
38
  <slot v-if="!isOpen || !slots['brand-open']" name="brand" />
14
39
  <slot v-if="isOpen" name="brand-open" />
@@ -16,13 +41,14 @@
16
41
  <Btn
17
42
  v-for="(nav, i) in navLinks"
18
43
  :key="i"
19
- :to="nav.to"
20
- class="nav-button px-075"
21
44
  v-tooltip.right="{
22
45
  content: nav.label,
23
46
  disabled: open,
24
47
  class: ['nav-tooltip'],
25
- }">
48
+ }"
49
+ :to="nav.to"
50
+ class="nav-button px-075"
51
+ >
26
52
  <template #default>
27
53
  <Icon :icon="nav.icon" :size="1.4" />
28
54
  <p v-if="open">
@@ -35,28 +61,6 @@
35
61
  </Card>
36
62
  </template>
37
63
 
38
- <script lang="ts" setup>
39
- import { useSlots } from 'vue';
40
- import { Btn, Icon, Card } from '@bagelink/vue';
41
- import type { NavLink } from '@bagelink/vue';
42
-
43
- const slots = useSlots();
44
-
45
- const props = defineProps<{
46
- navLinks?: NavLink[];
47
- expandable?: boolean;
48
- open: boolean;
49
- }>();
50
-
51
- let isOpen = $ref(props.open);
52
-
53
- const emit = defineEmits(['update:open']);
54
- function toggleMenu() {
55
- isOpen = !isOpen;
56
- emit('update:open', isOpen);
57
- }
58
- </script>
59
-
60
64
  <style>
61
65
  .v-popper--theme-tooltip .v-popper__inner {
62
66
  background: rgb(255, 255, 255) !important;
@@ -1,58 +1,60 @@
1
- <template>
2
- <div class="h-100 grid list-view gap-1" :class="{ 'side-tabs': sideTabs }">
3
- <div class="bgl_card tabs-top">
4
- <slot name="top-section" />
5
- <div class="tabs grid auto-flow-columns fit-content">
6
- <div v-for="tab in tabs" :class="{
7
- active:
8
- tab === activeTab ||
9
- tab === router?.currentRoute.value.path.split('/').slice(-1)[0],
10
- }" class="tab" :key="tab" @click="changeTab(tab)">
11
- {{ tab }}
12
- </div>
13
- </div>
14
- </div>
15
- <div class="list-content" v-for="tab in tabs.filter((item) => item === activeTab)" :key="tab">
16
- <slot :name="tab" :key="tab" />
17
- </div>
18
- </div>
19
- </template>
20
-
21
1
  <script setup lang="ts">
22
- import { onMounted } from 'vue';
23
- import type { Router } from 'vue-router';
24
-
25
- const emit = defineEmits(['update:modelValue']);
2
+ import { onMounted } from 'vue'
3
+ import type { Router } from 'vue-router'
26
4
 
27
- let activeTab = $ref<string>();
28
5
  const props = defineProps<{
29
- title?: string;
30
- tabs: string[];
31
- modelValue?: string;
32
- router?: Router;
33
- sideTabs?: boolean;
34
- }>();
6
+ title?: string
7
+ tabs: string[]
8
+ modelValue?: string
9
+ router?: Router
10
+ sideTabs?: boolean
11
+ }>()
35
12
 
13
+ const emit = defineEmits(['update:modelValue'])
14
+
15
+ let activeTab = $ref<string>()
36
16
  function changeTab(tab: string) {
37
- activeTab = tab;
38
- emit('update:modelValue', activeTab);
39
- if (!props.router) return;
40
- void props.router?.push({
41
- path: props.router.currentRoute.value.path,
42
- query: { ...props.router.currentRoute.value.query, t: tab },
43
- hash: props.router.currentRoute.value.hash,
44
- });
17
+ activeTab = tab
18
+ emit('update:modelValue', activeTab)
19
+ if (!props.router) return
20
+ void props.router.push({
21
+ path: props.router.currentRoute.value.path,
22
+ query: { ...props.router.currentRoute.value.query, t: tab },
23
+ hash: props.router.currentRoute.value.hash,
24
+ })
45
25
  }
46
26
 
47
27
  onMounted(() => {
48
- const firstTab =
49
- props.modelValue ||
50
- props.router?.currentRoute.value.query.t ||
51
- props.tabs[0];
52
- activeTab = firstTab as string;
53
- });
28
+ const firstTab
29
+ = props.modelValue
30
+ || props.router?.currentRoute.value.query.t
31
+ || props.tabs[0]
32
+ activeTab = firstTab as string
33
+ })
54
34
  </script>
55
35
 
36
+ <template>
37
+ <div class="h-100 grid list-view gap-1" :class="{ 'side-tabs': sideTabs }">
38
+ <div class="bgl_card tabs-top">
39
+ <slot name="top-section" />
40
+ <div class="tabs grid auto-flow-columns fit-content">
41
+ <div
42
+ v-for="tab in tabs" :key="tab" :class="{
43
+ active:
44
+ tab === activeTab
45
+ || tab === router?.currentRoute.value.path.split('/').slice(-1)[0],
46
+ }" class="tab" @click="changeTab(tab)"
47
+ >
48
+ {{ tab }}
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div v-for="tab in tabs.filter((item) => item === activeTab)" :key="tab" class="list-content">
53
+ <slot :key="tab" :name="tab" />
54
+ </div>
55
+ </div>
56
+ </template>
57
+
56
58
  <style scoped>
57
59
  .tab {
58
60
  text-transform: capitalize;
@@ -1,48 +1,48 @@
1
- <template>
2
- <TabsNav v-model="slctTab" :tabs="tabs" :group="group" class="mb-05" />
3
- <div v-if="currentTab">
4
- <template v-if="slots[currentTab]">
5
- <slot :name="currentTab" />
6
- </template>
7
- <template v-else-if="currentTab">
8
- <component :is="tabComponent" />
9
- </template>
10
- </div>
11
- </template>
12
- z
13
1
  <script setup lang="ts">
14
- import { TabsNav, type Tab } from '@bagelink/vue';
15
- import { defineProps, useSlots, h, type VNode, defineComponent } from 'vue';
2
+ import { type Tab, TabsNav } from '@bagelink/vue'
3
+ import { type VNode, defineComponent, defineProps, h, useSlots } from 'vue'
16
4
 
17
- import { useTabs } from './tabsManager';
5
+ import { useTabs } from './tabsManager'
18
6
 
19
7
  const props = defineProps<{
20
- tabs: Tab[];
21
- modelValue?: string;
22
- }>();
23
-
24
- const slots = useSlots();
25
- const group = Math.random().toString(36).substring(7);
26
- const { currentTab } = useTabs(group);
8
+ tabs: Tab[]
9
+ modelValue?: string
10
+ }>()
27
11
 
28
- const tabValue = (tab: Tab) => (typeof tab === 'string' ? tab : tab.id);
12
+ const emit = defineEmits(['update:modelValue'])
13
+ const slots = useSlots()
14
+ const group = Math.random().toString(36).substring(7)
15
+ const { currentTab } = useTabs(group)
29
16
 
30
- const emit = defineEmits(['update:modelValue']);
17
+ const tabValue = (tab: Tab) => (typeof tab === 'string' ? tab : tab.id)
31
18
 
32
19
  const slctTab = $computed({
33
20
  get: () => props.modelValue || tabValue(props.tabs[0]),
34
- set: (value) => emit('update:modelValue', value),
35
- });
21
+ set: (value) => { emit('update:modelValue', value) },
22
+ })
36
23
 
37
24
  const tabComponent = defineComponent({
38
25
  render() {
39
26
  const currentTabIndex = props.tabs.findIndex(
40
- (tab) => tabValue(tab) === currentTab.value,
41
- );
42
- if (currentTabIndex === -1) return null;
43
- const slotChildren = slots?.default?.()?.[1]?.children;
27
+ tab => tabValue(tab) === currentTab.value,
28
+ )
29
+ if (currentTabIndex === -1) return null
30
+ const slotChildren = slots.default?.()[1]?.children
44
31
 
45
- return h('div', (slotChildren as VNode[])[currentTabIndex]);
32
+ return h('div', (slotChildren as VNode[])[currentTabIndex])
46
33
  },
47
- });
34
+ })
48
35
  </script>
36
+
37
+ z
38
+ <template>
39
+ <TabsNav v-model="slctTab" :tabs="tabs" :group="group" class="mb-05" />
40
+ <div v-if="currentTab">
41
+ <template v-if="slots[currentTab]">
42
+ <slot :name="currentTab" />
43
+ </template>
44
+ <template v-else-if="currentTab">
45
+ <component :is="tabComponent" />
46
+ </template>
47
+ </div>
48
+ </template>
@@ -1,15 +1,15 @@
1
- <template>
2
- <div v-if="currentTab">
3
- <slot :name="currentTab"></slot>
4
- </div>
5
- </template>
6
-
7
1
  <script setup lang="ts">
8
- import { useTabs } from './tabsManager';
2
+ import { useTabs } from './tabsManager'
9
3
 
10
4
  const props = defineProps<{
11
- group: string;
12
- }>();
5
+ group: string
6
+ }>()
13
7
 
14
- const { currentTab } = useTabs(props.group);
8
+ const { currentTab } = useTabs(props.group)
15
9
  </script>
10
+
11
+ <template>
12
+ <div v-if="currentTab">
13
+ <slot :name="currentTab" />
14
+ </div>
15
+ </template>
@@ -1,63 +1,63 @@
1
- <template>
2
- <div class="grid auto-flow-columns fit-content bgl_tabs_wrap">
3
- <button
4
- type="button"
5
- :class="{ active: isActive(tab) }"
6
- @click="selectTab(tab)"
7
- class="bgl_tab"
8
- v-for="(tab, i) in tabs"
9
- :key="i"
10
- >
11
- <Icon v-if="typeof tab !== 'string' && tab.icon" :icon="tab.icon" />
12
- {{ tabLabel(tab) }}
13
- </button>
14
- </div>
15
- </template>
16
-
17
1
  <script setup lang="ts">
18
- import { type Tab, Icon } from '@bagelink/vue';
19
- import { watch } from 'vue';
20
- import { useTabs } from './tabsManager';
2
+ import { Icon, type Tab } from '@bagelink/vue'
3
+ import { watch } from 'vue'
4
+ import { useTabs } from './tabsManager'
21
5
 
22
6
  const props = defineProps<{
23
- title?: string;
24
- tabs: Tab[];
25
- modelValue?: string;
26
- sideTabs?: boolean;
27
- group: string;
28
- }>();
7
+ title?: string
8
+ tabs: Tab[]
9
+ modelValue?: string
10
+ sideTabs?: boolean
11
+ group: string
12
+ }>()
29
13
 
30
- const { currentTab } = useTabs(props.group);
31
- currentTab.value =
32
- props.modelValue || typeof props.tabs[0] === 'string'
14
+ const emit = defineEmits(['update:modelValue'])
15
+ const { currentTab } = useTabs(props.group)
16
+ currentTab.value
17
+ = props.modelValue || typeof props.tabs[0] === 'string'
33
18
  ? props.tabs[0]
34
- : props.tabs[0].id;
19
+ : props.tabs[0].id
35
20
 
36
- const emit = defineEmits(['update:modelValue']);
37
- const selectTab = (tab: Tab) => {
38
- currentTab.value = typeof tab === 'string' ? tab : tab.id;
39
- emit('update:modelValue', currentTab.value);
40
- };
21
+ function selectTab(tab: Tab) {
22
+ currentTab.value = typeof tab === 'string' ? tab : tab.id
23
+ emit('update:modelValue', currentTab.value)
24
+ }
41
25
 
42
- const isActive = (tab: Tab) => {
43
- if (typeof tab === 'string') return currentTab.value === tab;
44
- return currentTab.value === tab.id;
45
- };
26
+ function isActive(tab: Tab) {
27
+ if (typeof tab === 'string') return currentTab.value === tab
28
+ return currentTab.value === tab.id
29
+ }
46
30
 
47
- const tabLabel = (tab: Tab) => {
48
- if (typeof tab === 'string') return tab;
49
- return tab.label;
50
- };
31
+ function tabLabel(tab: Tab) {
32
+ if (typeof tab === 'string') return tab
33
+ return tab.label
34
+ }
51
35
 
52
36
  watch(
53
37
  () => props.modelValue,
54
38
  (value) => {
55
- if (value && !isActive(value)) currentTab.value = value;
39
+ if (value && !isActive(value)) currentTab.value = value
56
40
  },
57
41
  { immediate: true },
58
- );
42
+ )
59
43
  </script>
60
44
 
45
+ <template>
46
+ <div class="grid auto-flow-columns fit-content bgl_tabs_wrap">
47
+ <button
48
+ v-for="(tab, i) in tabs"
49
+ :key="i"
50
+ type="button"
51
+ :class="{ active: isActive(tab) }"
52
+ class="bgl_tab"
53
+ @click="selectTab(tab)"
54
+ >
55
+ <Icon v-if="typeof tab !== 'string' && tab.icon" :icon="tab.icon" />
56
+ {{ tabLabel(tab) }}
57
+ </button>
58
+ </div>
59
+ </template>
60
+
61
61
  <style scoped>
62
62
  .bgl_tabs_wrap {
63
63
  background: var(--input-bg);
@@ -1,7 +1,7 @@
1
- export { default as Layout } from './Layout.vue';
2
- export { default as SidebarMenu } from './SidebarMenu.vue';
3
- export { default as BottomMenu } from './BottomMenu.vue';
4
- export { default as Tabs } from './Tabs.vue';
5
- export { default as TabsNav } from './TabsNav.vue';
6
- export { default as TabsBody } from './TabsBody.vue';
7
- export { default as TabbedLayout } from './TabbedLayout.vue';
1
+ export { default as Layout } from './Layout.vue'
2
+ export { default as SidebarMenu } from './SidebarMenu.vue'
3
+ export { default as BottomMenu } from './BottomMenu.vue'
4
+ export { default as Tabs } from './Tabs.vue'
5
+ export { default as TabsNav } from './TabsNav.vue'
6
+ export { default as TabsBody } from './TabsBody.vue'
7
+ export { default as TabbedLayout } from './TabbedLayout.vue'