@xiping/react-components 1.0.18 → 1.0.19
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/cjs/_virtual/_commonjsHelpers.js +1 -0
- package/dist/cjs/_virtual/alignment-pattern.js +1 -0
- package/dist/cjs/_virtual/browser.js +1 -0
- package/dist/cjs/_virtual/browser2.js +1 -0
- package/dist/cjs/_virtual/canvas.js +1 -0
- package/dist/cjs/_virtual/dijkstra.js +1 -0
- package/dist/cjs/_virtual/error-correction-code.js +1 -0
- package/dist/cjs/_virtual/error-correction-level.js +1 -0
- package/dist/cjs/_virtual/finder-pattern.js +1 -0
- package/dist/cjs/_virtual/format-info.js +1 -0
- package/dist/cjs/_virtual/galois-field.js +1 -0
- package/dist/cjs/_virtual/mask-pattern.js +1 -0
- package/dist/cjs/_virtual/mode.js +1 -0
- package/dist/cjs/_virtual/polynomial.js +1 -0
- package/dist/cjs/_virtual/qrcode.js +1 -0
- package/dist/cjs/_virtual/regex.js +1 -0
- package/dist/cjs/_virtual/segments.js +1 -0
- package/dist/cjs/_virtual/svg-tag.js +1 -0
- package/dist/cjs/_virtual/utils.js +1 -0
- package/dist/cjs/_virtual/utils2.js +1 -0
- package/dist/cjs/_virtual/version-check.js +1 -0
- package/dist/cjs/_virtual/version.js +1 -0
- package/dist/cjs/components/qr-code/index.js +1 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +2 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +4 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +2 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +2 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +1 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +2 -0
- package/dist/cjs/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +1 -0
- package/dist/es/_virtual/_commonjsHelpers.js +6 -0
- package/dist/es/_virtual/alignment-pattern.js +4 -0
- package/dist/es/_virtual/browser.js +7 -0
- package/dist/es/_virtual/browser2.js +4 -0
- package/dist/es/_virtual/canvas.js +4 -0
- package/dist/es/_virtual/dijkstra.js +4 -0
- package/dist/es/_virtual/error-correction-code.js +4 -0
- package/dist/es/_virtual/error-correction-level.js +4 -0
- package/dist/es/_virtual/finder-pattern.js +4 -0
- package/dist/es/_virtual/format-info.js +4 -0
- package/dist/es/_virtual/galois-field.js +4 -0
- package/dist/es/_virtual/mask-pattern.js +4 -0
- package/dist/es/_virtual/mode.js +4 -0
- package/dist/es/_virtual/polynomial.js +4 -0
- package/dist/es/_virtual/qrcode.js +4 -0
- package/dist/es/_virtual/regex.js +4 -0
- package/dist/es/_virtual/segments.js +4 -0
- package/dist/es/_virtual/svg-tag.js +4 -0
- package/dist/es/_virtual/utils.js +4 -0
- package/dist/es/_virtual/utils2.js +4 -0
- package/dist/es/_virtual/version-check.js +4 -0
- package/dist/es/_virtual/version.js +4 -0
- package/dist/es/components/qr-code/index.js +49 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +22 -20
- package/dist/es/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +72 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +44 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +9 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +26 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +73 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +28 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +23 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +23 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +362 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +41 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +18 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +24 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +36 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +102 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +68 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +26 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +34 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +154 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +27 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +23 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +146 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +74 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +10 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +75 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +32 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +32 -0
- package/dist/es/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +58 -0
- package/package.json +2 -2
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { __exports as f } from "../../../../../../../_virtual/version.js";
|
|
2
|
+
import { __require as M } from "./utils.js";
|
|
3
|
+
import { __require as w } from "./error-correction-code.js";
|
|
4
|
+
import { __require as D } from "./error-correction-level.js";
|
|
5
|
+
import { __require as p } from "./mode.js";
|
|
6
|
+
import { __require as y } from "./version-check.js";
|
|
7
|
+
var B;
|
|
8
|
+
function H() {
|
|
9
|
+
return B ? f : (B = 1, function(i) {
|
|
10
|
+
const u = M(), m = w(), l = D(), n = p(), a = y(), d = 7973, g = u.getBCHDigit(d);
|
|
11
|
+
function E(o, e, r) {
|
|
12
|
+
for (let t = 1; t <= 40; t++)
|
|
13
|
+
if (e <= i.getCapacity(t, r, o))
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
function C(o, e) {
|
|
17
|
+
return n.getCharCountIndicator(o, e) + 4;
|
|
18
|
+
}
|
|
19
|
+
function _(o, e) {
|
|
20
|
+
let r = 0;
|
|
21
|
+
return o.forEach(function(t) {
|
|
22
|
+
const s = C(t.mode, e);
|
|
23
|
+
r += s + t.getBitsLength();
|
|
24
|
+
}), r;
|
|
25
|
+
}
|
|
26
|
+
function q(o, e) {
|
|
27
|
+
for (let r = 1; r <= 40; r++)
|
|
28
|
+
if (_(o, r) <= i.getCapacity(r, e, n.MIXED))
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
i.from = function(e, r) {
|
|
32
|
+
return a.isValid(e) ? parseInt(e, 10) : r;
|
|
33
|
+
}, i.getCapacity = function(e, r, t) {
|
|
34
|
+
if (!a.isValid(e))
|
|
35
|
+
throw new Error("Invalid QR Code version");
|
|
36
|
+
typeof t > "u" && (t = n.BYTE);
|
|
37
|
+
const s = u.getSymbolTotalCodewords(e), V = m.getTotalCodewordsCount(e, r), h = (s - V) * 8;
|
|
38
|
+
if (t === n.MIXED) return h;
|
|
39
|
+
const c = h - C(t, e);
|
|
40
|
+
switch (t) {
|
|
41
|
+
case n.NUMERIC:
|
|
42
|
+
return Math.floor(c / 10 * 3);
|
|
43
|
+
case n.ALPHANUMERIC:
|
|
44
|
+
return Math.floor(c / 11 * 2);
|
|
45
|
+
case n.KANJI:
|
|
46
|
+
return Math.floor(c / 13);
|
|
47
|
+
case n.BYTE:
|
|
48
|
+
default:
|
|
49
|
+
return Math.floor(c / 8);
|
|
50
|
+
}
|
|
51
|
+
}, i.getBestVersionForData = function(e, r) {
|
|
52
|
+
let t;
|
|
53
|
+
const s = l.from(r, l.M);
|
|
54
|
+
if (Array.isArray(e)) {
|
|
55
|
+
if (e.length > 1)
|
|
56
|
+
return q(e, s);
|
|
57
|
+
if (e.length === 0)
|
|
58
|
+
return 1;
|
|
59
|
+
t = e[0];
|
|
60
|
+
} else
|
|
61
|
+
t = e;
|
|
62
|
+
return E(t.mode, t.getLength(), s);
|
|
63
|
+
}, i.getEncodedBits = function(e) {
|
|
64
|
+
if (!a.isValid(e) || e < 7)
|
|
65
|
+
throw new Error("Invalid QR Code version");
|
|
66
|
+
let r = e << 12;
|
|
67
|
+
for (; u.getBCHDigit(r) - g >= 0; )
|
|
68
|
+
r ^= d << u.getBCHDigit(r) - g;
|
|
69
|
+
return e << 12 | r;
|
|
70
|
+
};
|
|
71
|
+
}(f), f);
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
H as __require
|
|
75
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __exports as a } from "../../../../../../../_virtual/canvas.js";
|
|
2
|
+
import { __require as h } from "./utils.js";
|
|
3
|
+
var p;
|
|
4
|
+
function C() {
|
|
5
|
+
return p ? a : (p = 1, function(u) {
|
|
6
|
+
const f = h();
|
|
7
|
+
function m(d, r, e) {
|
|
8
|
+
d.clearRect(0, 0, r.width, r.height), r.style || (r.style = {}), r.height = e, r.width = e, r.style.height = e + "px", r.style.width = e + "px";
|
|
9
|
+
}
|
|
10
|
+
function s() {
|
|
11
|
+
try {
|
|
12
|
+
return document.createElement("canvas");
|
|
13
|
+
} catch {
|
|
14
|
+
throw new Error("You need to specify a canvas element");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
u.render = function(r, e, l) {
|
|
18
|
+
let t = l, n = e;
|
|
19
|
+
typeof t > "u" && (!e || !e.getContext) && (t = e, e = void 0), e || (n = s()), t = f.getOptions(t);
|
|
20
|
+
const i = f.getImageWidth(r.modules.size, t), o = n.getContext("2d"), g = o.createImageData(i, i);
|
|
21
|
+
return f.qrToImageData(g.data, r, t), m(o, n, i), o.putImageData(g, 0, 0), n;
|
|
22
|
+
}, u.renderToDataURL = function(r, e, l) {
|
|
23
|
+
let t = l;
|
|
24
|
+
typeof t > "u" && (!e || !e.getContext) && (t = e, e = void 0), t || (t = {});
|
|
25
|
+
const n = u.render(r, e, t), i = t.type || "image/png", o = t.rendererOpts || {};
|
|
26
|
+
return n.toDataURL(i, o.quality);
|
|
27
|
+
};
|
|
28
|
+
}(a), a);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
C as __require
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __exports as g } from "../../../../../../../_virtual/svg-tag.js";
|
|
2
|
+
import { __require as m } from "./utils.js";
|
|
3
|
+
var d;
|
|
4
|
+
function T() {
|
|
5
|
+
if (d) return g;
|
|
6
|
+
d = 1;
|
|
7
|
+
const p = m();
|
|
8
|
+
function u(n, r) {
|
|
9
|
+
const i = n.a / 255, e = r + '="' + n.hex + '"';
|
|
10
|
+
return i < 1 ? e + " " + r + '-opacity="' + i.toFixed(2).slice(1) + '"' : e;
|
|
11
|
+
}
|
|
12
|
+
function h(n, r, i) {
|
|
13
|
+
let e = n + r;
|
|
14
|
+
return typeof i < "u" && (e += " " + i), e;
|
|
15
|
+
}
|
|
16
|
+
function w(n, r, i) {
|
|
17
|
+
let e = "", o = 0, s = !1, c = 0;
|
|
18
|
+
for (let t = 0; t < n.length; t++) {
|
|
19
|
+
const l = Math.floor(t % r), f = Math.floor(t / r);
|
|
20
|
+
!l && !s && (s = !0), n[t] ? (c++, t > 0 && l > 0 && n[t - 1] || (e += s ? h("M", l + i, 0.5 + f + i) : h("m", o, 0), o = 0, s = !1), l + 1 < r && n[t + 1] || (e += h("h", c), c = 0)) : o++;
|
|
21
|
+
}
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
return g.render = function(r, i, e) {
|
|
25
|
+
const o = p.getOptions(i), s = r.modules.size, c = r.modules.data, t = s + o.margin * 2, l = o.color.light.a ? "<path " + u(o.color.light, "fill") + ' d="M0 0h' + t + "v" + t + 'H0z"/>' : "", f = "<path " + u(o.color.dark, "stroke") + ' d="' + w(c, s, o.margin) + '"/>', v = 'viewBox="0 0 ' + t + " " + t + '"', a = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + v + ' shape-rendering="crispEdges">' + l + f + `</svg>
|
|
26
|
+
`;
|
|
27
|
+
return typeof e == "function" && e(null, a), a;
|
|
28
|
+
}, g;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
T as __require
|
|
32
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __exports as u } from "../../../../../../../_virtual/utils2.js";
|
|
2
|
+
var s;
|
|
3
|
+
function M() {
|
|
4
|
+
return s ? u : (s = 1, function(l) {
|
|
5
|
+
function m(n) {
|
|
6
|
+
if (typeof n == "number" && (n = n.toString()), typeof n != "string")
|
|
7
|
+
throw new Error("Color should be defined as hex string");
|
|
8
|
+
let e = n.slice().replace("#", "").split("");
|
|
9
|
+
if (e.length < 3 || e.length === 5 || e.length > 8)
|
|
10
|
+
throw new Error("Invalid hex color: " + n);
|
|
11
|
+
(e.length === 3 || e.length === 4) && (e = Array.prototype.concat.apply([], e.map(function(t) {
|
|
12
|
+
return [t, t];
|
|
13
|
+
}))), e.length === 6 && e.push("F", "F");
|
|
14
|
+
const r = parseInt(e.join(""), 16);
|
|
15
|
+
return {
|
|
16
|
+
r: r >> 24 & 255,
|
|
17
|
+
g: r >> 16 & 255,
|
|
18
|
+
b: r >> 8 & 255,
|
|
19
|
+
a: r & 255,
|
|
20
|
+
hex: "#" + e.slice(0, 6).join("")
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
l.getOptions = function(e) {
|
|
24
|
+
e || (e = {}), e.color || (e.color = {});
|
|
25
|
+
const r = typeof e.margin > "u" || e.margin === null || e.margin < 0 ? 4 : e.margin, t = e.width && e.width >= 21 ? e.width : void 0, f = e.scale || 4;
|
|
26
|
+
return {
|
|
27
|
+
width: t,
|
|
28
|
+
scale: t ? 4 : f,
|
|
29
|
+
margin: r,
|
|
30
|
+
color: {
|
|
31
|
+
dark: m(e.color.dark || "#000000ff"),
|
|
32
|
+
light: m(e.color.light || "#ffffffff")
|
|
33
|
+
},
|
|
34
|
+
type: e.type,
|
|
35
|
+
rendererOpts: e.rendererOpts || {}
|
|
36
|
+
};
|
|
37
|
+
}, l.getScale = function(e, r) {
|
|
38
|
+
return r.width && r.width >= e + r.margin * 2 ? r.width / (e + r.margin * 2) : r.scale;
|
|
39
|
+
}, l.getImageWidth = function(e, r) {
|
|
40
|
+
const t = l.getScale(e, r);
|
|
41
|
+
return Math.floor((e + r.margin * 2) * t);
|
|
42
|
+
}, l.qrToImageData = function(e, r, t) {
|
|
43
|
+
const f = r.modules.size, w = r.modules.data, d = l.getScale(f, t), g = Math.floor((f + t.margin * 2) * d), a = t.margin * d, y = [t.color.light, t.color.dark];
|
|
44
|
+
for (let i = 0; i < g; i++)
|
|
45
|
+
for (let c = 0; c < g; c++) {
|
|
46
|
+
let h = (i * g + c) * 4, o = t.color.light;
|
|
47
|
+
if (i >= a && c >= a && i < g - a && c < g - a) {
|
|
48
|
+
const b = Math.floor((i - a) / d), I = Math.floor((c - a) / d);
|
|
49
|
+
o = y[w[b * f + I] ? 1 : 0];
|
|
50
|
+
}
|
|
51
|
+
e[h++] = o.r, e[h++] = o.g, e[h++] = o.b, e[h] = o.a;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}(u), u);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
M as __require
|
|
58
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xiping/react-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.19",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"module": "./dist/es/index.js",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"engines": {
|
|
106
106
|
"node": ">=20"
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "d513cdc3c016464d0237c921ea508f986c7a639b"
|
|
109
109
|
}
|