@bagelink/vue 1.6.49 → 1.6.53
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/ListItem.vue.d.ts.map +1 -1
- package/dist/components/Menu.vue.d.ts +2 -8
- package/dist/components/Menu.vue.d.ts.map +1 -1
- package/dist/components/Zoomer.vue.d.ts +0 -1
- package/dist/components/Zoomer.vue.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.vue.d.ts +0 -1
- package/dist/components/layout/AppSidebar.vue.d.ts.map +1 -1
- package/dist/index.cjs +25 -25
- package/dist/index.mjs +5894 -5191
- package/dist/plugins/useToast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/NavLink.d.ts +1 -1
- package/dist/types/NavLink.d.ts.map +1 -1
- package/package.json +5 -9
- package/src/components/ListItem.vue +9 -3
- package/src/components/Menu.vue +8 -15
- package/src/components/NavBar.vue +2 -2
- package/src/components/Zoomer.vue +0 -2
- package/src/components/layout/AppSidebar.vue +1 -2
- package/src/components/layout/BottomMenu.vue +1 -1
- package/src/components/layout/SidebarMenu.vue +1 -1
- package/src/plugins/useToast.ts +56 -51
- package/src/types/NavLink.ts +1 -1
package/dist/types/NavLink.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,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,
|
|
1
|
+
{"version":3,"file":"NavLink.d.ts","sourceRoot":"","sources":["../../src/types/NavLink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,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;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.53",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bagel Studio",
|
|
@@ -61,8 +61,7 @@
|
|
|
61
61
|
"@types/leaflet": "^1.9.18",
|
|
62
62
|
"@types/signature_pad": "^4.0.0",
|
|
63
63
|
"vue": "^3.5.16",
|
|
64
|
-
"vue-component-type-helpers": "^2.2.10"
|
|
65
|
-
"vue-toastification": "^2.0.0-rc.5"
|
|
64
|
+
"vue-component-type-helpers": "^2.2.10"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
67
|
"@bagelink/sdk": "*",
|
|
@@ -70,15 +69,11 @@
|
|
|
70
69
|
"vue-component-type-helpers": "^2.2.10",
|
|
71
70
|
"vue": "*",
|
|
72
71
|
"vue-draggable-next": "^2.2.1",
|
|
73
|
-
"vue-router": "*"
|
|
74
|
-
"vue-toastification": "^2"
|
|
72
|
+
"vue-router": "*"
|
|
75
73
|
},
|
|
76
74
|
"peerDependenciesMeta": {
|
|
77
75
|
"vue-draggable-next": {
|
|
78
76
|
"optional": true
|
|
79
|
-
},
|
|
80
|
-
"vue-toastification": {
|
|
81
|
-
"optional": true
|
|
82
77
|
}
|
|
83
78
|
},
|
|
84
79
|
"publishConfig": {
|
|
@@ -89,7 +84,8 @@
|
|
|
89
84
|
"axios": "^1.9.0",
|
|
90
85
|
"floating-vue": "^5.2.2",
|
|
91
86
|
"libphonenumber-js": "1.12.9",
|
|
92
|
-
"signature_pad": "^5.0.9"
|
|
87
|
+
"signature_pad": "^5.0.9",
|
|
88
|
+
"vue-toastification": "^2.0.0-rc.5"
|
|
93
89
|
},
|
|
94
90
|
"scripts": {
|
|
95
91
|
"dev": "tsx watch src/index.ts",
|
|
@@ -46,7 +46,7 @@ const bind = computed(() => {
|
|
|
46
46
|
const obj: { [key: string]: any } = {}
|
|
47
47
|
if (props.to !== undefined && props.to !== '') { obj.to = props.to }
|
|
48
48
|
else if (props.href !== undefined && props.href !== '') { obj.href = props.href }
|
|
49
|
-
if (props.target !== undefined && props.target !==
|
|
49
|
+
if (props.target !== undefined && props.target !== undefined && ((props.to !== undefined && props.to !== '') || (props.href !== undefined && props.href !== ''))) { obj.target = props.target }
|
|
50
50
|
|
|
51
51
|
obj.class = {
|
|
52
52
|
'notClickable': !((props.to !== undefined && props.to !== '') || (props.onClick !== undefined)),
|
|
@@ -81,7 +81,10 @@ const bind = computed(() => {
|
|
|
81
81
|
{{ title }}
|
|
82
82
|
<slot />
|
|
83
83
|
</p>
|
|
84
|
-
<p
|
|
84
|
+
<p
|
|
85
|
+
v-if="subtitle" class="txt12 m-0 m-0 py-0 ps-0 pe-1-5 opacity-7 me-2"
|
|
86
|
+
:class="{ 'ellipsis-1': ellipsis }"
|
|
87
|
+
>
|
|
85
88
|
{{ subtitle }}
|
|
86
89
|
<slot name="subtitle" />
|
|
87
90
|
</p>
|
|
@@ -90,7 +93,10 @@ const bind = computed(() => {
|
|
|
90
93
|
</component>
|
|
91
94
|
<slot name="end">
|
|
92
95
|
<Icon v-if="iconEnd" :icon="iconEnd" class="transition-400" />
|
|
93
|
-
<p
|
|
96
|
+
<p
|
|
97
|
+
v-if="end" class="txt12 m-0 py-0 ps-0 pe-1-5 opacity-7 " :class="{ 'ellipsis-1': ellipsis }"
|
|
98
|
+
v-text="end"
|
|
99
|
+
/>
|
|
94
100
|
</slot>
|
|
95
101
|
</div>
|
|
96
102
|
</template>
|
package/src/components/Menu.vue
CHANGED
|
@@ -1,45 +1,38 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { NavLink } from '@bagelink/vue'
|
|
3
3
|
import { Btn, Icon, Dropdown } from '@bagelink/vue'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
icon: IconType
|
|
7
|
-
value: string
|
|
8
|
-
to: string
|
|
9
|
-
items?: MenuItem[]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
defineProps<{ items: MenuItem[] }>()
|
|
5
|
+
defineProps<{ items: NavLink[] }>()
|
|
13
6
|
</script>
|
|
14
7
|
|
|
15
8
|
<template>
|
|
16
9
|
<div class="flex space-between m_w-100vw overflow m_-ms-1 m_px-05 m_py-025 bglTopMenu">
|
|
17
10
|
<div class="flex gap-025 m_gap-05">
|
|
18
|
-
<template v-for="item in items" :key="item.
|
|
19
|
-
<Dropdown v-if="item.
|
|
11
|
+
<template v-for="item in items" :key="item.label">
|
|
12
|
+
<Dropdown v-if="item.children" :value="item.label" iconEnd="keyboard_arrow_down">
|
|
20
13
|
<template #trigger="{ show }">
|
|
21
14
|
<Btn thin flat @click="show()">
|
|
22
15
|
<Icon :name="item.icon" size="0.8" style="margin-bottom: -0.1rem" />
|
|
23
16
|
<p class="-ms-025">
|
|
24
|
-
{{ item.
|
|
17
|
+
{{ item.label }}
|
|
25
18
|
</p>
|
|
26
19
|
<Icon name="keyboard_arrow_down" size="0.8" style="margin-bottom: -0.1rem" />
|
|
27
20
|
</Btn>
|
|
28
21
|
</template>
|
|
29
22
|
<Btn
|
|
30
|
-
v-for="subItem in item.
|
|
23
|
+
v-for="subItem in item.children" :key="subItem.label" thin flat :to="subItem.to"
|
|
31
24
|
class="block m_px-025"
|
|
32
25
|
>
|
|
33
26
|
<Icon :name="subItem.icon" size="0.8" style="margin-bottom: -0.1rem" />
|
|
34
27
|
<p class="-ms-025">
|
|
35
|
-
{{ subItem.
|
|
28
|
+
{{ subItem.label }}
|
|
36
29
|
</p>
|
|
37
30
|
</Btn>
|
|
38
31
|
</Dropdown>
|
|
39
32
|
<Btn v-else thin flat :to="item.to" class="m_px-025">
|
|
40
33
|
<Icon :name="item.icon" size="0.9" style="margin-bottom: -0.1rem" />
|
|
41
34
|
<p class="-ms-025">
|
|
42
|
-
{{ item.
|
|
35
|
+
{{ item.label }}
|
|
43
36
|
</p>
|
|
44
37
|
</Btn>
|
|
45
38
|
</template>
|
|
@@ -60,7 +60,7 @@ onMounted(calcIsOpen)
|
|
|
60
60
|
:key="link.label"
|
|
61
61
|
class="nav-button"
|
|
62
62
|
:to="link.to"
|
|
63
|
-
@click="link.
|
|
63
|
+
@click="link.action?.()"
|
|
64
64
|
>
|
|
65
65
|
<Icon :icon="link.icon" />
|
|
66
66
|
<div class="tooltip">
|
|
@@ -77,7 +77,7 @@ onMounted(calcIsOpen)
|
|
|
77
77
|
:key="link.label"
|
|
78
78
|
class="nav-button"
|
|
79
79
|
:to="link.to"
|
|
80
|
-
@click="link.
|
|
80
|
+
@click="link.action?.()"
|
|
81
81
|
>
|
|
82
82
|
<Icon :icon="link.icon" />
|
|
83
83
|
<div class="tooltip">
|
|
@@ -9,7 +9,6 @@ interface Props {
|
|
|
9
9
|
maxScale?: number
|
|
10
10
|
zoom?: number
|
|
11
11
|
resetTrigger?: number
|
|
12
|
-
aspectRatio?: number
|
|
13
12
|
backgroundColor?: string
|
|
14
13
|
pivot?: string // 'cursor' | 'image-center'
|
|
15
14
|
zoomingElastic?: boolean
|
|
@@ -24,7 +23,6 @@ const {
|
|
|
24
23
|
maxScale = 5,
|
|
25
24
|
zoom,
|
|
26
25
|
disabled = false,
|
|
27
|
-
aspectRatio = 1,
|
|
28
26
|
backgroundColor = 'transparent',
|
|
29
27
|
pivot = 'cursor',
|
|
30
28
|
zoomingElastic = true,
|
|
@@ -4,9 +4,8 @@ import { Btn, Icon } from '@bagelink/vue'
|
|
|
4
4
|
import { inject, computed, ref, watch } from 'vue'
|
|
5
5
|
import { useRoute } from 'vue-router'
|
|
6
6
|
|
|
7
|
-
// Extended interface for links
|
|
7
|
+
// Extended interface for links with active route tracking
|
|
8
8
|
interface LinkWithAction extends NavLink {
|
|
9
|
-
action?: () => void
|
|
10
9
|
activeRoutes?: string[] // נתיבים שצריכים להיות מסומנים כאקטיביים עבור הלינק הזה
|
|
11
10
|
}
|
|
12
11
|
|
|
@@ -20,7 +20,7 @@ defineProps<{
|
|
|
20
20
|
<slot name="brand" />
|
|
21
21
|
<Btn
|
|
22
22
|
v-for="(nav, i) in navLinks" :key="i" :to="nav.to" class="m_h-auto"
|
|
23
|
-
@click="nav.
|
|
23
|
+
@click="nav.action"
|
|
24
24
|
>
|
|
25
25
|
<Icon :icon="nav.icon" :size="1.4" class="m-0 line-height-14" />
|
|
26
26
|
<p class="m-0 pb-025 txt10 line-height-1 w60 menu-text">
|
|
@@ -47,7 +47,7 @@ const toggleMenu = useDebounceFn(() => {
|
|
|
47
47
|
v-bind="{
|
|
48
48
|
...(nav.to && { to: nav.to }),
|
|
49
49
|
...(nav.href && { href: nav.href }),
|
|
50
|
-
...(nav.
|
|
50
|
+
...(nav.action && { onClick: nav.action }),
|
|
51
51
|
}"
|
|
52
52
|
class="nav-button px-075 me-auto w-100"
|
|
53
53
|
>
|
package/src/plugins/useToast.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { App, InjectionKey, Plugin } from 'vue'
|
|
2
2
|
import { inject } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import Toast, {
|
|
4
4
|
type PluginOptions as ToastOptions,
|
|
5
|
-
type ToastInterface,
|
|
6
5
|
POSITION,
|
|
6
|
+
useToast as useVueToast,
|
|
7
7
|
} from 'vue-toastification'
|
|
8
|
+
import 'vue-toastification/dist/index.css'
|
|
8
9
|
|
|
9
10
|
export interface ToastApi {
|
|
10
11
|
success: (message: string, options?: any) => void
|
|
@@ -35,58 +36,62 @@ export function useToast(): ToastApi {
|
|
|
35
36
|
export type BagelToastOptions = Partial<ToastOptions>
|
|
36
37
|
|
|
37
38
|
export const ToastPlugin: Plugin<BagelToastOptions[]> = {
|
|
38
|
-
install:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
transition: 'Vue-Toastification__fade',
|
|
58
|
-
maxToasts: 5,
|
|
59
|
-
newestOnTop: true,
|
|
60
|
-
...options,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Install vue-toastification
|
|
64
|
-
app.use(ToastInterface as Plugin, defaultOptions)
|
|
65
|
-
|
|
66
|
-
// Get the toast instance
|
|
67
|
-
const toast: ToastInterface = app.config.globalProperties.$toast
|
|
39
|
+
install: (app: App, options: BagelToastOptions = {}) => {
|
|
40
|
+
const defaultOptions: ToastOptions = {
|
|
41
|
+
position: POSITION.TOP_RIGHT,
|
|
42
|
+
timeout: 3000,
|
|
43
|
+
closeOnClick: true,
|
|
44
|
+
pauseOnFocusLoss: true,
|
|
45
|
+
pauseOnHover: true,
|
|
46
|
+
draggable: true,
|
|
47
|
+
draggablePercent: 0.6,
|
|
48
|
+
showCloseButtonOnHover: false,
|
|
49
|
+
hideProgressBar: false,
|
|
50
|
+
closeButton: 'button',
|
|
51
|
+
icon: true,
|
|
52
|
+
rtl: false,
|
|
53
|
+
transition: 'Vue-Toastification__fade',
|
|
54
|
+
maxToasts: 5,
|
|
55
|
+
newestOnTop: true,
|
|
56
|
+
...options,
|
|
57
|
+
}
|
|
68
58
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
success: (message: string, options?: any) => toast.success(message, options),
|
|
72
|
-
error: (message: string, options?: any) => toast.error(message, options),
|
|
73
|
-
info: (message: string, options?: any) => toast.info(message, options),
|
|
74
|
-
warning: (message: string, options?: any) => toast.warning(message, options),
|
|
75
|
-
show: (message: string, options?: any) => toast(message, options),
|
|
76
|
-
clear: () => { toast.clear() },
|
|
77
|
-
}
|
|
59
|
+
// Install vue-toastification
|
|
60
|
+
app.use(Toast, defaultOptions)
|
|
78
61
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
// Create the API wrapper using lazy evaluation
|
|
63
|
+
const api: ToastApi = {
|
|
64
|
+
success: (message: string, opts?: any) => {
|
|
65
|
+
const toast = useVueToast()
|
|
66
|
+
return toast.success(message, opts)
|
|
67
|
+
},
|
|
68
|
+
error: (message: string, opts?: any) => {
|
|
69
|
+
const toast = useVueToast()
|
|
70
|
+
return toast.error(message, opts)
|
|
71
|
+
},
|
|
72
|
+
info: (message: string, opts?: any) => {
|
|
73
|
+
const toast = useVueToast()
|
|
74
|
+
return toast.info(message, opts)
|
|
75
|
+
},
|
|
76
|
+
warning: (message: string, opts?: any) => {
|
|
77
|
+
const toast = useVueToast()
|
|
78
|
+
return toast.warning(message, opts)
|
|
79
|
+
},
|
|
80
|
+
show: (message: string, opts?: any) => {
|
|
81
|
+
const toast = useVueToast()
|
|
82
|
+
return toast(message, opts)
|
|
83
|
+
},
|
|
84
|
+
clear: () => {
|
|
85
|
+
const toast = useVueToast()
|
|
86
|
+
toast.clear()
|
|
87
|
+
},
|
|
88
|
+
}
|
|
83
89
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
throw new Error(
|
|
88
|
-
'vue-toastification is required for ToastPlugin. Install it with: pnpm add vue-toastification'
|
|
89
|
-
)
|
|
90
|
+
// Set global singleton on first install
|
|
91
|
+
if (!globalToastApi) {
|
|
92
|
+
globalToastApi = api
|
|
90
93
|
}
|
|
94
|
+
|
|
95
|
+
app.provide(ToastSymbol, api)
|
|
91
96
|
},
|
|
92
97
|
}
|
package/src/types/NavLink.ts
CHANGED