@bagelink/vue 1.20.36 → 1.20.39
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/Image.vue.d.ts +2 -0
- package/dist/components/Image.vue.d.ts.map +1 -1
- package/dist/components/charts/StatCard.vue.d.ts +3 -0
- package/dist/components/charts/StatCard.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/AssetUploadInput.vue.d.ts +146 -2
- package/dist/components/form/inputs/Upload/AssetUploadInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts +78 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/core.css +1 -1
- package/dist/index.cjs +45 -45
- package/dist/index.css +1 -1
- package/dist/index.mjs +8532 -8511
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/Image.vue +8 -0
- package/src/components/charts/StatCard.vue +7 -1
- package/src/components/form/inputs/DateInput.vue +1 -1
- package/src/components/form/inputs/DatePicker.vue +5 -1
- package/src/components/form/inputs/Upload/AssetUploadInput.vue +7 -3
- package/src/components/form/inputs/Upload/UploadInput.vue +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bagelink/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.20.
|
|
4
|
+
"version": "1.20.39",
|
|
5
5
|
"description": "Bagel core sdk packages",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bagel Studio",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@types/signature_pad": "^4.0.0",
|
|
64
64
|
"vue": "^3.5.43",
|
|
65
65
|
"vue-component-type-helpers": "^2.2.12",
|
|
66
|
-
"@bagelink/sdk": "1.20.
|
|
66
|
+
"@bagelink/sdk": "1.20.39"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@bagelink/sdk": "*",
|
package/src/components/Image.vue
CHANGED
|
@@ -27,6 +27,8 @@ interface ImageProps {
|
|
|
27
27
|
blend?: string
|
|
28
28
|
/** Rounded corners — true (default radius) or a px radius. */
|
|
29
29
|
rounded?: boolean | number
|
|
30
|
+
/** Defer the download until the image nears the viewport. */
|
|
31
|
+
lazy?: boolean
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const props = defineProps<ImageProps>()
|
|
@@ -110,6 +112,8 @@ const imgFit = computed(() => props.fit ?? 'cover')
|
|
|
110
112
|
v-if="imageSrc"
|
|
111
113
|
:src="imageSrc"
|
|
112
114
|
:alt="alt"
|
|
115
|
+
:loading="lazy ? 'lazy' : undefined"
|
|
116
|
+
decoding="async"
|
|
113
117
|
class="bgl-image-frame-img h-100p"
|
|
114
118
|
:class="[frameHasHeight ? 'absolute-fill' : 'bgl-image-frame-img--flow', { 'opacity-0': !imageLoaded }]"
|
|
115
119
|
:style="{ objectFit: imgFit, mixBlendMode: blend } as StyleValue"
|
|
@@ -130,6 +134,8 @@ const imgFit = computed(() => props.fit ?? 'cover')
|
|
|
130
134
|
:src="imageSrc"
|
|
131
135
|
v-bind="$attrs"
|
|
132
136
|
:alt="alt"
|
|
137
|
+
:loading="lazy ? 'lazy' : undefined"
|
|
138
|
+
decoding="async"
|
|
133
139
|
:width="normalizeDimension(width)"
|
|
134
140
|
:height="normalizeDimension(height)"
|
|
135
141
|
:class="{ 'opacity-0': !imageLoaded }"
|
|
@@ -155,6 +161,8 @@ const imgFit = computed(() => props.fit ?? 'cover')
|
|
|
155
161
|
v-if="imageSrc"
|
|
156
162
|
:src="imageSrc"
|
|
157
163
|
:alt="alt"
|
|
164
|
+
:loading="lazy ? 'lazy' : undefined"
|
|
165
|
+
decoding="async"
|
|
158
166
|
class="w-100p h-100p"
|
|
159
167
|
:class="{ 'opacity-0': !imageLoaded }"
|
|
160
168
|
:style="{ objectFit: imgFit }"
|
|
@@ -32,6 +32,9 @@ const props = withDefaults(defineProps<{
|
|
|
32
32
|
prefix?: string
|
|
33
33
|
suffix?: string
|
|
34
34
|
subtitle?: string
|
|
35
|
+
/** Small muted line under the value — a secondary figure such as
|
|
36
|
+
"1,080 unique" without inflating the headline number. */
|
|
37
|
+
caption?: string
|
|
35
38
|
loading?: boolean
|
|
36
39
|
/** Outlined card (transparent bg + border), like `<Card outline>`. */
|
|
37
40
|
outline?: boolean
|
|
@@ -71,7 +74,10 @@ const good = computed(() => (props.invertChange ? !up.value : up.value))
|
|
|
71
74
|
</div>
|
|
72
75
|
|
|
73
76
|
<div class="flex space-between w-100p align-items-end gap-1">
|
|
74
|
-
<
|
|
77
|
+
<div class="grid gap-025 min-w-0">
|
|
78
|
+
<span class="txt28 m_txt24 semibold line-height-1 tabular-nums" :class="{ 'opacity-4': loading }">{{ loading ? '…' : formatted }}</span>
|
|
79
|
+
<p v-if="caption" class="txt12 color-gray m-0 ellipsis-1">{{ caption }}</p>
|
|
80
|
+
</div>
|
|
75
81
|
<Sparkline v-if="trend?.length" :data="trend" :color="color" area class="flex-shrink-0 opacity-9" :width="96" :height="32" />
|
|
76
82
|
</div>
|
|
77
83
|
</Card>
|
|
@@ -111,7 +111,7 @@ function parseUserInput(input: string): Date | null {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function normalizeDate(date: Date): string {
|
|
114
|
-
if (props.enableTime) return
|
|
114
|
+
if (props.enableTime) return local.iso(date)
|
|
115
115
|
// Local calendar day — not toISOString().slice(0,10), which shifts TZ≠UTC.
|
|
116
116
|
return local.date(date)
|
|
117
117
|
}
|
|
@@ -381,7 +381,11 @@ function useTimeHandling() {
|
|
|
381
381
|
// Centralized date emission function
|
|
382
382
|
function emitDateValue(date: Date) {
|
|
383
383
|
if (props.enableTime) {
|
|
384
|
-
|
|
384
|
+
// Local ISO with device TZ offset ("…T11:00:00.000+03:00"). This keeps the
|
|
385
|
+
// user's wall-clock time intact for naive `timestamp` columns and still
|
|
386
|
+
// round-trips correctly through `timestamptz` columns. `toISOString()`
|
|
387
|
+
// would shift the time by the UTC offset.
|
|
388
|
+
emit('update:modelValue', local.iso(date))
|
|
385
389
|
} else {
|
|
386
390
|
// Date-only → YYYY-MM-DD (JSON Schema format: "date"). Never toISOString():
|
|
387
391
|
// local midnight becomes the previous UTC day (e.g. Asia/Jerusalem).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, inject, onScopeDispose, ref, useSlots } from 'vue'
|
|
3
|
-
import type { CSSProperties } from 'vue'
|
|
3
|
+
import type { CSSProperties, Slots } from 'vue'
|
|
4
4
|
import { Btn, Card, Dialog, Icon, Progress, resolveI18n, useI18n } from '../../../../index'
|
|
5
5
|
import { ASSET_CLIENT_KEY, useAssetUpload, type AssetReference } from '../../../../assets'
|
|
6
6
|
import { useFileUpload } from './useFileUpload'
|
|
@@ -50,7 +50,7 @@ const emit = defineEmits<{
|
|
|
50
50
|
}>()
|
|
51
51
|
|
|
52
52
|
const { $t } = useI18n()
|
|
53
|
-
const slots = useSlots()
|
|
53
|
+
const slots: Slots = useSlots()
|
|
54
54
|
const client = inject(ASSET_CLIENT_KEY, undefined)
|
|
55
55
|
const { upload, uploading, cancel } = useAssetUpload()
|
|
56
56
|
const { shellClass, shellStyle } = useBagelInputShell(props)
|
|
@@ -66,6 +66,10 @@ function output(items: AssetReference[]) {
|
|
|
66
66
|
emit('update:modelValue', props.multiple ? items : items[0])
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
function handleCropDialogOpen(value: boolean) {
|
|
70
|
+
if (!value) finishCrop()
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
function urlFor(value: AssetReference) {
|
|
70
74
|
return client?.assetUrl(value)
|
|
71
75
|
}
|
|
@@ -703,7 +707,7 @@ const listStyle = computed<CSSProperties | undefined>(() => {
|
|
|
703
707
|
<Dialog
|
|
704
708
|
v-if="cropperAvailable"
|
|
705
709
|
:open="cropOpen" :title="$t('upload.cropTitle')" width="m"
|
|
706
|
-
@update:open="
|
|
710
|
+
@update:open="handleCropDialogOpen"
|
|
707
711
|
>
|
|
708
712
|
<ImageCropper
|
|
709
713
|
v-if="cropSrc" ref="cropper" :src="cropSrc" :aspect="cropAspect"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { UploadInputProps } from '../../../../types/BagelForm'
|
|
3
3
|
import { Btn, IMAGE_FORMATS_REGEXP, Icon, Card, Image, pathKeyToURL, Loading, useI18n, resolveI18n } from '../../../../index'
|
|
4
4
|
import { watch, computed, ref, useSlots } from 'vue'
|
|
5
|
+
import type { Slots } from 'vue'
|
|
5
6
|
import { useFileDropzone } from '../../../file-drop/useFileDropzone'
|
|
6
7
|
import { useFileUpload } from './useFileUpload'
|
|
7
8
|
import { useBagelInputShell } from '../bagelInputShell'
|
|
@@ -33,7 +34,7 @@ const props = withDefaults(defineProps<UploadInputProps & { previewState?: impor
|
|
|
33
34
|
const emit = defineEmits(['update:modelValue', 'addFileStart', 'uploadError'])
|
|
34
35
|
|
|
35
36
|
const { $t } = useI18n()
|
|
36
|
-
const slots = useSlots()
|
|
37
|
+
const slots: Slots = useSlots()
|
|
37
38
|
const {
|
|
38
39
|
fileQueue,
|
|
39
40
|
pathKeys,
|