@bagelink/vue 1.6.49 → 1.6.51
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/Zoomer.vue.d.ts +0 -1
- package/dist/components/Zoomer.vue.d.ts.map +1 -1
- package/dist/index.cjs +25 -25
- package/dist/index.mjs +5883 -5180
- package/dist/plugins/useToast.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -9
- package/src/components/ListItem.vue +9 -3
- package/src/components/Zoomer.vue +0 -2
- package/src/plugins/useToast.ts +56 -51
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.51",
|
|
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>
|
|
@@ -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,
|
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
|
}
|