@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.
- package/dist/components/Accordion.vue.d.ts.map +1 -1
- package/dist/components/AccordionItem.vue.d.ts.map +1 -1
- package/dist/components/Alert.vue.d.ts +2 -2
- package/dist/components/Alert.vue.d.ts.map +1 -1
- package/dist/components/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge.vue.d.ts +2 -2
- package/dist/components/Badge.vue.d.ts.map +1 -1
- package/dist/components/BglVideo.vue.d.ts +2 -2
- package/dist/components/BglVideo.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/Carousel.vue.d.ts +4 -2
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/DataPreview.vue.d.ts.map +1 -1
- package/dist/components/Drop.vue.d.ts +34 -0
- package/dist/components/Drop.vue.d.ts.map +1 -0
- package/dist/components/FileUploader.vue.d.ts +60 -0
- package/dist/components/FileUploader.vue.d.ts.map +1 -0
- package/dist/components/Flag.vue.d.ts +2 -2
- package/dist/components/Flag.vue.d.ts.map +1 -1
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/MapEmbed.vue.d.ts +2 -2
- package/dist/components/MapEmbed.vue.d.ts.map +1 -1
- package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +2 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalConfirm.vue.d.ts.map +1 -1
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/PageTitle.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/Title.vue.d.ts.map +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
- package/dist/components/dashboard/index.d.ts.map +1 -1
- package/dist/components/form/BglField.vue.d.ts.map +1 -1
- package/dist/components/form/BglForm.vue.d.ts +4 -2
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/ItemRef.vue.d.ts +1 -0
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ColorPicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts +2 -1
- package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/JSONInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts +1 -4
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SignaturePad.vue.d.ts +56 -0
- package/dist/components/form/inputs/SignaturePad.vue.d.ts.map +1 -0
- package/dist/components/form/inputs/TableField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TelInput.vue.d.ts +2 -2
- package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/index.d.ts +1 -0
- package/dist/components/form/inputs/index.d.ts.map +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/layout/BottomMenu.vue.d.ts.map +1 -1
- package/dist/components/layout/Layout.vue.d.ts +2 -2
- package/dist/components/layout/Layout.vue.d.ts.map +1 -1
- package/dist/components/layout/SidebarMenu.vue.d.ts.map +1 -1
- package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -1
- package/dist/components/layout/Tabs.vue.d.ts.map +1 -1
- package/dist/components/layout/TabsBody.vue.d.ts.map +1 -1
- package/dist/components/layout/TabsNav.vue.d.ts.map +1 -1
- package/dist/components/layout/index.d.ts.map +1 -1
- package/dist/index.cjs +17616 -20818
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +17616 -20818
- package/dist/plugins/bagel.d.ts +1 -1
- package/dist/plugins/bagel.d.ts.map +1 -1
- package/dist/plugins/modal.d.ts +14 -14
- package/dist/plugins/modal.d.ts.map +1 -1
- package/dist/style.css +330 -309
- package/dist/types/BagelForm.d.ts +16 -16
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/BtnOptions.d.ts +1 -1
- package/dist/types/BtnOptions.d.ts.map +1 -1
- package/dist/types/NavLink.d.ts +2 -2
- package/dist/types/NavLink.d.ts.map +1 -1
- package/dist/types/file.d.ts +2 -2
- package/dist/types/file.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/materialIcons.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/allCountries.d.ts +2 -2
- package/dist/utils/allCountries.d.ts.map +1 -1
- package/dist/utils/clickOutside.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +19 -17
- package/src/components/Accordion.vue +10 -10
- package/src/components/AccordionItem.vue +47 -47
- package/src/components/Alert.vue +21 -21
- package/src/components/Avatar.vue +15 -15
- package/src/components/Badge.vue +17 -16
- package/src/components/BglVideo.vue +43 -43
- package/src/components/Btn.vue +64 -65
- package/src/components/Card.vue +26 -26
- package/src/components/Carousel.vue +130 -134
- package/src/components/DataPreview.vue +30 -30
- package/src/components/Flag.vue +26 -26
- package/src/components/ListItem.vue +13 -13
- package/src/components/ListView.vue +2 -2
- package/src/components/MapEmbed.vue +33 -33
- package/src/components/MaterialIcon.vue +12 -12
- package/src/components/Modal.vue +73 -66
- package/src/components/ModalConfirm.vue +18 -18
- package/src/components/ModalForm.vue +79 -76
- package/src/components/NavBar.vue +33 -30
- package/src/components/PageTitle.vue +10 -8
- package/src/components/TableSchema.vue +123 -113
- package/src/components/Title.vue +8 -8
- package/src/components/dashboard/Lineart.vue +103 -96
- package/src/components/dashboard/index.ts +1 -1
- package/src/components/form/BglField.vue +61 -61
- package/src/components/form/BglFieldSet.vue +9 -8
- package/src/components/form/BglForm.vue +71 -70
- package/src/components/form/index.ts +4 -4
- package/src/components/form/inputs/CheckInput.vue +25 -23
- package/src/components/form/inputs/Checkbox.vue +10 -10
- package/src/components/form/inputs/ColorPicker.vue +26 -24
- package/src/components/form/inputs/DateInput.vue +39 -39
- package/src/components/form/inputs/DatePicker.vue +37 -36
- package/src/components/form/inputs/FileUpload.vue +165 -161
- package/src/components/form/inputs/FileUploadURL.vue +134 -132
- package/src/components/form/inputs/JSONInput.vue +29 -29
- package/src/components/form/inputs/RadioPillsInput.vue +49 -49
- package/src/components/form/inputs/RichText.vue +62 -63
- package/src/components/form/inputs/SelectInput.vue +173 -167
- package/src/components/form/inputs/SignaturePad.vue +150 -0
- package/src/components/form/inputs/TableField.vue +77 -76
- package/src/components/form/inputs/TelInput.vue +280 -285
- package/src/components/form/inputs/TextInput.vue +81 -76
- package/src/components/form/inputs/ToggleInput.vue +13 -13
- package/src/components/form/inputs/index.ts +17 -15
- package/src/components/formkit/FileUploader.vue +162 -158
- package/src/components/formkit/MiscFields.vue +20 -20
- package/src/components/formkit/Toggle.vue +13 -13
- package/src/components/index.ts +28 -28
- package/src/components/layout/BottomMenu.vue +25 -21
- package/src/components/layout/Layout.vue +29 -29
- package/src/components/layout/SidebarMenu.vue +31 -27
- package/src/components/layout/TabbedLayout.vue +47 -45
- package/src/components/layout/Tabs.vue +32 -32
- package/src/components/layout/TabsBody.vue +10 -10
- package/src/components/layout/TabsNav.vue +44 -44
- package/src/components/layout/index.ts +7 -7
- package/src/components/layout/tabsManager.ts +6 -6
- package/src/index.ts +13 -8
- package/src/plugins/bagel.ts +37 -37
- package/src/plugins/modal.ts +66 -67
- package/src/styles/layout.css +5 -3
- package/src/styles/mobilLayout.css +7 -0
- package/src/types/BagelForm.ts +27 -27
- package/src/types/BtnOptions.ts +13 -13
- package/src/types/NavLink.ts +8 -8
- package/src/types/file.ts +11 -11
- package/src/types/index.ts +16 -12
- package/src/types/materialIcons.ts +3249 -3249
- package/src/utils/BagelFormUtils.ts +23 -23
- package/src/utils/allCountries.ts +11 -12
- package/src/utils/clickOutside.ts +6 -6
- package/src/utils/index.ts +39 -41
- package/src/utils/lang.ts +13 -13
- package/src/utils/strings.ts +9 -9
- package/tsconfig.json +0 -1
- package/vite.config.ts +8 -8
- package/dist/components/Popover.vue.d.ts +0 -10
- package/dist/components/Popover.vue.d.ts.map +0 -1
- package/dist/types/materialIcon.d.ts +0 -2
- 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
|
|
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;
|
package/src/components/index.ts
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
49
|
-
props.modelValue
|
|
50
|
-
props.router?.currentRoute.value.query.t
|
|
51
|
-
props.tabs[0]
|
|
52
|
-
|
|
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 {
|
|
15
|
-
import {
|
|
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
|
|
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
|
|
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
|
-
|
|
41
|
-
)
|
|
42
|
-
if (currentTabIndex === -1) return null
|
|
43
|
-
const slotChildren = slots
|
|
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
|
-
|
|
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
|
|
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
|
|
31
|
-
currentTab
|
|
32
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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'
|