@bagelink/vue 1.4.115 → 1.4.118
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/bin/generateFormSchema.ts +2 -2
- package/dist/components/form/inputs/RichText/composables/useEditor.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/plugins/modalTypes.d.ts +2 -1
- package/dist/plugins/modalTypes.d.ts.map +1 -1
- package/dist/plugins/useModal.d.ts +1 -1
- package/dist/plugins/useModal.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +17 -8
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/types/NavLink.d.ts +1 -1
- package/dist/types/NavLink.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts +19 -8
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/RichText/utils/media.ts +7 -7
- package/src/plugins/modalTypes.ts +10 -2
- package/src/plugins/useModal.ts +23 -7
- package/src/styles/layout.css +6 -0
- package/src/types/BagelForm.ts +31 -10
- package/src/types/NavLink.ts +1 -1
- package/src/utils/BagelFormUtils.ts +49 -19
- package/src/utils/index.ts +7 -5
package/src/utils/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Attributes, BglFormSchemaT, Path } from '
|
|
1
|
+
import type { Attributes, BglFormSchemaT, Path } from '../types/BagelForm'
|
|
2
2
|
|
|
3
3
|
const debouncers = new Map<() => void, ReturnType<typeof setTimeout>>()
|
|
4
4
|
|
|
@@ -93,7 +93,7 @@ export function iffer(field: any, itemData: any) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export function denullify(itemData?: { [key: string]: any }, fieldID?: string) {
|
|
96
|
-
if (!fieldID) return
|
|
96
|
+
if (!fieldID) return undefined
|
|
97
97
|
return itemData ? itemData[fieldID] : undefined
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -132,7 +132,8 @@ export async function appendScript(src: string, options?: { id?: string }): Prom
|
|
|
132
132
|
await sleep(1)
|
|
133
133
|
// If this script is already loading, return the existing promise
|
|
134
134
|
if (scriptsLoading.has(scriptId)) {
|
|
135
|
-
|
|
135
|
+
const existingPromise = scriptsLoading.get(scriptId)
|
|
136
|
+
if (existingPromise) return existingPromise
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
// Check if script is already in the document
|
|
@@ -157,7 +158,7 @@ export async function appendScript(src: string, options?: { id?: string }): Prom
|
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
script.onerror = (err) => {
|
|
160
|
-
reject(err)
|
|
161
|
+
reject(new Error(String(err)))
|
|
161
162
|
// Remove from loading scripts map on error
|
|
162
163
|
scriptsLoading.delete(scriptId)
|
|
163
164
|
}
|
|
@@ -241,7 +242,8 @@ export function downloadFile(source: string | Blob, fileName?: string) {
|
|
|
241
242
|
|
|
242
243
|
if (typeof source === 'string') {
|
|
243
244
|
link.href = upgradeHeaders(source)
|
|
244
|
-
|
|
245
|
+
const fileNameFromSource = source.split('/').pop()
|
|
246
|
+
link.download = fileName || fileNameFromSource || 'download'
|
|
245
247
|
} else {
|
|
246
248
|
const url = URL.createObjectURL(source)
|
|
247
249
|
link.href = url
|