@mptw/skylens-ui 1.4.82 → 1.4.84
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.
|
@@ -223,6 +223,10 @@ export default defineComponent({
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
const dataURL = await domToPngDataUrl(imageTarget.value, customFilter.value, customStyle.value, padding.value, dateRanges.value, watermark.value, WatermarkImage);
|
|
226
|
+
if (!dataURL) {
|
|
227
|
+
console.log("Can not generate data URL!");
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
226
230
|
downloadURL(dataURL, `${fileName.value}.png`);
|
|
227
231
|
|
|
228
232
|
if (evCategory.value !== "") {
|
package/package.json
CHANGED
package/utils/index.ts
CHANGED
|
@@ -664,7 +664,7 @@ async function addWatermark(dataURL: string, watermarkImg: string) {
|
|
|
664
664
|
export const domToPngDataUrl = async (
|
|
665
665
|
imageTarget: HTMLElement | null,
|
|
666
666
|
customFilter: Function | null,
|
|
667
|
-
customStyle: CSSStyleDeclaration | null,
|
|
667
|
+
customStyle: Partial<CSSStyleDeclaration> | null,
|
|
668
668
|
padding: number = 0,
|
|
669
669
|
dateRanges: (IDateRange | null)[] = [],
|
|
670
670
|
watermark: boolean = true,
|
|
@@ -685,9 +685,9 @@ export const domToPngDataUrl = async (
|
|
|
685
685
|
);
|
|
686
686
|
};
|
|
687
687
|
const styleOption = Object.assign({}, {
|
|
688
|
-
marginTop:
|
|
689
|
-
marginBottom:
|
|
690
|
-
border:
|
|
688
|
+
marginTop: 0,
|
|
689
|
+
marginBottom: 9,
|
|
690
|
+
border: 0,
|
|
691
691
|
}, customStyle || {});
|
|
692
692
|
|
|
693
693
|
const options = {
|