reykit 1.0.141 → 1.0.143

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/index.js CHANGED
@@ -49440,22 +49440,23 @@ async function xI(a, i = "qrcode.png") {
49440
49440
  const u = await cC.toDataURL(a), m = await (await fetch(u)).blob();
49441
49441
  kj(m, i);
49442
49442
  }
49443
- async function SI(a, i, u) {
49444
- const d = u && u.width, m = (u && u.margin) ?? 0, g = await cC.toDataURL(a, { width: d, margin: m });
49445
- if (i !== void 0) {
49446
- if (typeof i == "string") {
49447
- const v = document.getElementById(i);
49443
+ async function SI(a, i) {
49444
+ let u = i && i.element;
49445
+ const d = i && i.width, m = (i && i.margin) ?? 0, g = await cC.toDataURL(a, { width: d, margin: m });
49446
+ if (u !== void 0) {
49447
+ if (typeof u == "string") {
49448
+ const v = document.getElementById(u);
49448
49449
  if (!v) throw new Error("element id not exists");
49449
- i = v;
49450
+ u = v;
49450
49451
  }
49451
- i.setAttribute("src", g);
49452
+ u.setAttribute("src", g);
49452
49453
  }
49453
49454
  return g;
49454
49455
  }
49455
49456
  const EI = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49456
49457
  __proto__: null,
49457
49458
  downloadQrcode: xI,
49458
- generateElementQrcode: SI,
49459
+ getQrcodeUrl: SI,
49459
49460
  openQrcode: bI
49460
49461
  }, Symbol.toStringTag, { value: "Module" }));
49461
49462
  async function RI(a, i) {
@@ -21,13 +21,14 @@ export declare function downloadQrcode(text: string, fileName?: string): Promise
21
21
  * Generate QRCode URL and set to element `src` attribute.
22
22
  *
23
23
  * @param text - QRCode Text.
24
- * @param element - Element instance or id.
24
+ * @param options.element - Element instance or id.
25
25
  * - `undefined` : Not set.
26
26
  * @param options.width - Width of Minimum pixel.
27
27
  * @param options.margin - Number of margin blank square.
28
28
  * @returns QR code URL.
29
29
  */
30
- export declare function generateElementQrcode(text: string, element?: HTMLElement | string, options?: {
30
+ export declare function getQrcodeUrl(text: string, options?: {
31
+ element?: HTMLElement | string;
31
32
  width?: number;
32
33
  margin?: number;
33
34
  }): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reykit",
3
- "version": "1.0.141",
3
+ "version": "1.0.143",
4
4
  "description": "Kit method set.",
5
5
  "author": "reyxbo",
6
6
  "keywords": [