@bagelink/vue 1.4.167 → 1.4.169
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/calendar/views/AgendaView.vue.d.ts.map +1 -1
- package/dist/components/calendar/views/MonthView.vue.d.ts.map +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/useBagel.d.ts +5 -0
- package/dist/composables/useBagel.d.ts.map +1 -0
- package/dist/index.cjs +20 -20
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +20 -20
- package/dist/plugins/bagel.d.ts +1 -2
- package/dist/plugins/bagel.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/calendar/views/AgendaView.vue +5 -4
- package/src/components/calendar/views/DayView.vue +1 -1
- package/src/components/calendar/views/MonthView.vue +9 -1
- package/src/composables/index.ts +1 -0
- package/src/composables/useBagel.ts +21 -0
- package/src/index.ts +1 -2
- package/src/plugins/bagel.ts +6 -7
- package/src/styles/inputs.css +1 -0
- package/src/utils/index.ts +20 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAI1E,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,GAAE,MAAY,QAO1D;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,UAMlC;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ3D;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAA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,EAAE,MAAM,sBAsB5C;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,GAAe,GAAG,GAAG,CAa1F;AAID,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,QAkBpE"}
|
package/package.json
CHANGED
|
@@ -157,7 +157,7 @@ onUnmounted(() => {
|
|
|
157
157
|
:key="event.id"
|
|
158
158
|
class="event"
|
|
159
159
|
:style="{
|
|
160
|
-
|
|
160
|
+
// height: `${event.height}px`,
|
|
161
161
|
backgroundColor: event.color || 'var(--bgl-primary)',
|
|
162
162
|
}"
|
|
163
163
|
:data-date="event.start_time"
|
|
@@ -207,11 +207,11 @@ onUnmounted(() => {
|
|
|
207
207
|
.agenda-content {
|
|
208
208
|
flex-grow: 1;
|
|
209
209
|
overflow-y: auto;
|
|
210
|
-
|
|
210
|
+
padding: 1rem 0;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
.event {
|
|
214
|
-
|
|
214
|
+
margin-bottom: 0.5rem;
|
|
215
215
|
border-radius: 4px;
|
|
216
216
|
overflow: hidden;
|
|
217
217
|
cursor: pointer;
|
|
@@ -219,7 +219,8 @@ onUnmounted(() => {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
.event:hover {
|
|
222
|
-
|
|
222
|
+
/* transform: scale(1.01); */
|
|
223
|
+
filter: brightness(90%);
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
.event-content {
|
|
@@ -217,13 +217,21 @@ function handleEventSelection(event: CalendarEvent, domEvent?: MouseEvent) {
|
|
|
217
217
|
font-size: 0.8rem;
|
|
218
218
|
cursor: pointer;
|
|
219
219
|
transition: all 0.2s ease;
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: 0.25rem;
|
|
223
|
+
min-width: 0;
|
|
224
|
+
justify-content: space-between;
|
|
225
|
+
/* Allow flex items to shrink */
|
|
220
226
|
}
|
|
221
227
|
|
|
222
228
|
.event-title {
|
|
223
229
|
font-weight: 500;
|
|
224
|
-
white-space: nowrap;
|
|
230
|
+
/* white-space: nowrap; */
|
|
231
|
+
height: 1lh;
|
|
225
232
|
overflow: hidden;
|
|
226
233
|
text-overflow: ellipsis;
|
|
234
|
+
|
|
227
235
|
}
|
|
228
236
|
|
|
229
237
|
.event-time {
|
package/src/composables/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { MaybeRefOrGetter, Ref, UnwrapRef } from 'vue'
|
|
|
4
4
|
import { getFallbackSchema } from '@bagelink/vue'
|
|
5
5
|
import { ref, toValue, watch } from 'vue'
|
|
6
6
|
|
|
7
|
+
export { getBagelInstance, setBagelInstance, useBagel } from './useBagel'
|
|
7
8
|
export { useDevice } from './useDevice'
|
|
8
9
|
export { useExcel } from './useExcel'
|
|
9
10
|
export { usePolling } from './usePolling'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Bagel } from '@bagelink/sdk'
|
|
2
|
+
import { shallowRef } from 'vue'
|
|
3
|
+
|
|
4
|
+
// Global state for the Bagel instance (using shallowRef to avoid deep reactivity on class instance)
|
|
5
|
+
const bagelInstance = shallowRef<Bagel | null>(null)
|
|
6
|
+
|
|
7
|
+
export function useBagel(): Bagel {
|
|
8
|
+
const instance = bagelInstance.value
|
|
9
|
+
if (!instance) {
|
|
10
|
+
throw new Error('Bagel instance is not initialized. Please install BagelVue plugin first.')
|
|
11
|
+
}
|
|
12
|
+
return instance
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function setBagelInstance(instance: Bagel) {
|
|
16
|
+
bagelInstance.value = instance
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getBagelInstance(): Bagel | null {
|
|
20
|
+
return bagelInstance.value
|
|
21
|
+
}
|
package/src/index.ts
CHANGED
package/src/plugins/bagel.ts
CHANGED
|
@@ -4,6 +4,7 @@ import FloatingVue from 'floating-vue'
|
|
|
4
4
|
import { inject } from 'vue'
|
|
5
5
|
|
|
6
6
|
import lightboxPlugin from '../components/lightbox/index'
|
|
7
|
+
import { setBagelInstance } from '../composables/useBagel'
|
|
7
8
|
import { ripple, pattern } from '../directives'
|
|
8
9
|
import { useLang } from '../utils'
|
|
9
10
|
import clickOutside from '../utils/clickOutside'
|
|
@@ -11,13 +12,7 @@ import clickOutside from '../utils/clickOutside'
|
|
|
11
12
|
export const bagelInjectionKey = Symbol('bagel') as InjectionKey<Bagel>
|
|
12
13
|
export const i18nTInjectionKey = Symbol('bagel') as InjectionKey<(key: string) => string>
|
|
13
14
|
|
|
14
|
-
export function
|
|
15
|
-
const bagel = inject(injectionKey)
|
|
16
|
-
if (!bagel) throw new Error('No bagel provided')
|
|
17
|
-
return bagel
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function useI18nT(injectionKey: typeof i18nTInjectionKey = i18nTInjectionKey) {
|
|
15
|
+
export function injectI18nT(injectionKey: typeof i18nTInjectionKey = i18nTInjectionKey) {
|
|
21
16
|
const i18nT = inject(injectionKey)
|
|
22
17
|
if (!i18nT) throw new Error('No i18nT provided')
|
|
23
18
|
return i18nT
|
|
@@ -36,6 +31,10 @@ export interface BagelOptions {
|
|
|
36
31
|
export const BagelVue: Plugin<BagelOptions> = {
|
|
37
32
|
install: (app, options) => {
|
|
38
33
|
const bagel = new Bagel({ host: options.host, fileBaseUrl: options.fileBaseUrl, onError: options.onError })
|
|
34
|
+
|
|
35
|
+
// Set global Bagel instance for the composable
|
|
36
|
+
setBagelInstance(bagel)
|
|
37
|
+
|
|
39
38
|
app.directive('click-outside', clickOutside)
|
|
40
39
|
app.directive('ripple', ripple)
|
|
41
40
|
app.directive('pattern', pattern)
|
package/src/styles/inputs.css
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -206,17 +206,32 @@ export { useLang } from './lang'
|
|
|
206
206
|
export { formatString } from './strings'
|
|
207
207
|
export { useDebounceFn } from '@vueuse/core'
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
const bagelBaseUrl = import.meta.env.VITE_BAGEL_BASE_URL
|
|
209
|
+
import { getBagelInstance } from '../composables/useBagel'
|
|
211
210
|
|
|
212
211
|
const URL_REGEX = /^https?:\/\/|^\/\//
|
|
213
212
|
|
|
214
213
|
export function pathKeyToURL(pathKey?: string) {
|
|
215
|
-
if (
|
|
214
|
+
if (pathKey === undefined || pathKey === '' || URL_REGEX.test(pathKey)) return pathKey
|
|
215
|
+
|
|
216
|
+
const bagel = getBagelInstance()
|
|
217
|
+
if (!bagel) {
|
|
218
|
+
console.warn('Bagel instance is not initialized. Please install BagelVue plugin.')
|
|
219
|
+
return pathKey
|
|
220
|
+
}
|
|
221
|
+
|
|
216
222
|
if (pathKey.startsWith('static/')) {
|
|
217
|
-
|
|
223
|
+
if (bagel.host === undefined || bagel.host === '') {
|
|
224
|
+
console.warn('Bagel host is not configured. Please set it in BagelVue options.')
|
|
225
|
+
return pathKey
|
|
226
|
+
}
|
|
227
|
+
return `${bagel.host}/${pathKey}`
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (bagel.fileBaseUrl === undefined || bagel.fileBaseUrl === '') {
|
|
231
|
+
console.warn('File base URL is not configured. Please set it in BagelVue options.')
|
|
232
|
+
return pathKey
|
|
218
233
|
}
|
|
219
|
-
return `${fileBaseUrl}/${pathKey}`
|
|
234
|
+
return `${bagel.fileBaseUrl}/${pathKey}`
|
|
220
235
|
}
|
|
221
236
|
|
|
222
237
|
export function getNestedValue(obj: any, path?: string, defaultValue: any = undefined): any {
|