dpot-ui 0.5.9 → 0.5.10

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.
Files changed (2) hide show
  1. package/dist/index.es.js +5 -8
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -25458,14 +25458,11 @@ const ap = {
25458
25458
  t.title && o === 1 ? o.height = Math.max((t.style || {}).fontSize * 1.5 || 24, e) : o.height = t.rowHeight || e;
25459
25459
  }), t.waterText) {
25460
25460
  const o = document.createElement("canvas");
25461
- o.width = Math.round(t.columnResult.map((b) => (b.style || {}).width || 20).reduce((b, p) => b + p, 0) * 8 * 1.5), o.height = Math.round(n.rowCount * (t.rowHeight || e) * 1.3 * 1.5);
25462
- const s = o.getContext("2d"), a = s.measureText(t.waterText).width, l = 50, r = 150, c = t.waterStyle || { font: "24px Arial", fillStyle: "rgba(0, 0, 0, 0.1)", textAlign: "left", textBaseline: "middle" };
25463
- s.font = c.font, s.fillStyle = c.fillStyle, s.textAlign = c.textAlign, s.textBaseline = c.textBaseline, s.translate(-o.width / 4, o.height / 2), s.rotate(-45 * Math.PI / 180);
25464
- for (let b = 0; b < o.width; b += a + r)
25465
- for (let p = 0; p < o.height; p += l + r)
25466
- s.fillText(t.waterText, b, p);
25467
- const d = o.toDataURL("image/png").replace(/^data:image\/[a-z]+;base64,/, ""), h = i.addImage({ base64: d, extension: "png" }), f = t.body[t.body.length - 1], m = f[f.length - 1];
25468
- n.addImage(h, `A1:${m[m.length - 1]._gps_}`);
25461
+ o.width = t.waterText.length * (parseInt((t.waterStyle || {}).font) || 24) * 1.5, o.height = o.width;
25462
+ const s = o.getContext("2d"), a = t.waterStyle || { font: "24px Arial", fillStyle: "rgba(0, 0, 0, 0.1)", textAlign: "center", textBaseline: "middle" };
25463
+ s.font = a.font, s.fillStyle = a.fillStyle, s.textAlign = a.textAlign, s.textBaseline = a.textBaseline, s.translate(0, 0), s.rotate(-45 * Math.PI / 180), s.fillText(t.waterText, 10, o.height - 10);
25464
+ const l = o.toDataURL("image/png").replace(/^data:image\/[a-z]+;base64,/, ""), r = i.addImage({ base64: l, extension: "png" });
25465
+ n.addBackgroundImage(r);
25469
25466
  }
25470
25467
  }), i.xlsx.writeBuffer().then((t) => {
25471
25468
  ip.saveAs(new Blob([t], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }), this.fileName);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dpot-ui",
3
3
  "private": false,
4
- "version": "0.5.9",
4
+ "version": "0.5.10",
5
5
  "author": "Jeesn",
6
6
  "main": "./dist/index.es.js",
7
7
  "module": "./dist/index.es.js",