asterui 0.12.1 → 0.12.2
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/components/Calendar.d.ts +23 -0
- package/dist/components/Checkbox.d.ts +10 -0
- package/dist/components/Dock.d.ts +38 -0
- package/dist/components/Mask.d.ts +14 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +203 -194
- package/dist/index.js.map +1 -1
- package/dist/index10.js +85 -59
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +45 -7
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +11 -11
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +12 -28
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +7 -17
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +12 -10792
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +31 -5
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +16 -40
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +174 -2
- package/dist/index107.js.map +1 -1
- package/dist/index109.js +10788 -147
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +5 -30
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +39 -27
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +6 -71
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +147 -34
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +28 -24
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +28 -19
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -24
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +71 -19
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +33 -94
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +24 -358
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +19 -23
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +22 -71
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +18 -14
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +92 -58
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +357 -141
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +25 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +70 -53
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +16 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +66 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +35 -95
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +144 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index132.js +56 -2
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +2 -2
- package/dist/index134.js +2 -2
- package/dist/index136.js +2 -32
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +2 -2
- package/dist/index138.js +2 -8
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +2 -2
- package/dist/index14.js +90 -153
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +2 -2
- package/dist/index141.js +31 -20
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +2 -2
- package/dist/index143.js +7 -23
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +2 -71
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +2 -21
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +20 -33
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +2 -70
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +24 -2
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +70 -21
- package/dist/index149.js.map +1 -1
- package/dist/index15.js +154 -146
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +21 -2
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +34 -2
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +70 -2
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +2 -2
- package/dist/index154.js +21 -3
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +5 -0
- package/dist/index155.js.map +1 -0
- package/dist/index156.js +5 -0
- package/dist/index156.js.map +1 -0
- package/dist/index157.js +5 -0
- package/dist/index157.js.map +1 -0
- package/dist/index158.js +5 -0
- package/dist/index158.js.map +1 -0
- package/dist/index159.js +7 -0
- package/dist/index159.js.map +1 -0
- package/dist/index16.js +150 -5
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +5 -71
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +71 -17
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +15 -96
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +89 -105
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +107 -177
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +181 -107
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +110 -19
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +19 -32
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +42 -40
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +31 -11
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +41 -33
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +12 -63
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +33 -80
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +63 -18
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +79 -219
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +16 -1080
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +218 -16
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +1081 -121
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +17 -39
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +121 -190
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +37 -94
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +186 -157
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +89 -138
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +161 -14
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +146 -18
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +14 -20
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +15 -116
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +18 -10
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +119 -35
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +12 -115
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +33 -174
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +10 -147
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +116 -12
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +176 -22
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +147 -14
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +10 -5
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +21 -265
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +10 -13
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +7 -122
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +262 -106
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +14 -167
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +121 -31
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +107 -119
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +161 -77
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +31 -19
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +117 -69
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +82 -53
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +19 -44
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +70 -48
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +55 -60
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +39 -101
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +52 -41
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +58 -64
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +105 -19
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +41 -46
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +63 -129
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +19 -50
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +46 -22
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +132 -29
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +52 -22
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +19 -326
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +31 -56
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +22 -40
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +328 -22
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +55 -94
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +38 -128
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +20 -158
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +93 -63
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +128 -33
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +152 -225
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +63 -32
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -210
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +229 -208
- package/dist/index89.js.map +1 -1
- package/dist/index90.js +34 -295
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +200 -168
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +198 -243
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +293 -12
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +174 -29
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +258 -6
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +13 -13
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +32 -45
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -12
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +13 -14
- package/dist/index99.js.map +1 -1
- package/package.json +2 -1
- package/dist/index108.js +0 -10
- package/dist/index108.js.map +0 -1
package/dist/index149.js
CHANGED
|
@@ -1,25 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { __require as s } from "./index129.js";
|
|
2
|
+
var r, o;
|
|
3
|
+
function d() {
|
|
4
|
+
if (o) return r;
|
|
5
|
+
o = 1;
|
|
6
|
+
const u = s(), n = [
|
|
7
|
+
"0",
|
|
8
|
+
"1",
|
|
9
|
+
"2",
|
|
10
|
+
"3",
|
|
11
|
+
"4",
|
|
12
|
+
"5",
|
|
13
|
+
"6",
|
|
14
|
+
"7",
|
|
15
|
+
"8",
|
|
16
|
+
"9",
|
|
17
|
+
"A",
|
|
18
|
+
"B",
|
|
19
|
+
"C",
|
|
20
|
+
"D",
|
|
21
|
+
"E",
|
|
22
|
+
"F",
|
|
23
|
+
"G",
|
|
24
|
+
"H",
|
|
25
|
+
"I",
|
|
26
|
+
"J",
|
|
27
|
+
"K",
|
|
28
|
+
"L",
|
|
29
|
+
"M",
|
|
30
|
+
"N",
|
|
31
|
+
"O",
|
|
32
|
+
"P",
|
|
33
|
+
"Q",
|
|
34
|
+
"R",
|
|
35
|
+
"S",
|
|
36
|
+
"T",
|
|
37
|
+
"U",
|
|
38
|
+
"V",
|
|
39
|
+
"W",
|
|
40
|
+
"X",
|
|
41
|
+
"Y",
|
|
42
|
+
"Z",
|
|
43
|
+
" ",
|
|
44
|
+
"$",
|
|
45
|
+
"%",
|
|
46
|
+
"*",
|
|
47
|
+
"+",
|
|
48
|
+
"-",
|
|
49
|
+
".",
|
|
50
|
+
"/",
|
|
51
|
+
":"
|
|
52
|
+
];
|
|
53
|
+
function t(i) {
|
|
54
|
+
this.mode = u.ALPHANUMERIC, this.data = i;
|
|
55
|
+
}
|
|
56
|
+
return t.getBitsLength = function(a) {
|
|
57
|
+
return 11 * Math.floor(a / 2) + 6 * (a % 2);
|
|
58
|
+
}, t.prototype.getLength = function() {
|
|
59
|
+
return this.data.length;
|
|
60
|
+
}, t.prototype.getBitsLength = function() {
|
|
61
|
+
return t.getBitsLength(this.data.length);
|
|
62
|
+
}, t.prototype.write = function(a) {
|
|
63
|
+
let e;
|
|
64
|
+
for (e = 0; e + 2 <= this.data.length; e += 2) {
|
|
65
|
+
let h = n.indexOf(this.data[e]) * 45;
|
|
66
|
+
h += n.indexOf(this.data[e + 1]), a.put(h, 11);
|
|
67
|
+
}
|
|
68
|
+
this.data.length % 2 && a.put(n.indexOf(this.data[e]), 6);
|
|
69
|
+
}, r = t, r;
|
|
21
70
|
}
|
|
22
71
|
export {
|
|
23
|
-
|
|
72
|
+
d as __require
|
|
24
73
|
};
|
|
25
74
|
//# sourceMappingURL=index149.js.map
|
package/dist/index149.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index149.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/
|
|
1
|
+
{"version":3,"file":"index149.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js"],"sourcesContent":["const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n this.mode = Mode.ALPHANUMERIC\n this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n let i\n\n // Input data characters are divided into groups of two characters\n // and encoded as 11-bit binary codes.\n for (i = 0; i + 2 <= this.data.length; i += 2) {\n // The character value of the first character is multiplied by 45\n let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n // The character value of the second digit is added to the product\n value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n // The sum is then stored as 11-bit binary number\n bitBuffer.put(value, 11)\n }\n\n // If the number of input data characters is not a multiple of two,\n // the character value of the final character is encoded as a 6-bit binary number.\n if (this.data.length % 2) {\n bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n }\n}\n\nmodule.exports = AlphanumericData\n"],"names":["Mode","require$$0","ALPHA_NUM_CHARS","AlphanumericData","data","length","bitBuffer","i","value","alphanumericData"],"mappings":";;;;;AAAA,QAAMA,IAAOC,EAAA,GAWPC,IAAkB;AAAA,IACtB;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC7C;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC5D;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAAK;AAAA,IAC5D;AAAA,IAAK;AAAA,IAAK;AAAA,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
-
"--color-warning",
|
|
23
|
-
"--color-error"
|
|
24
|
-
].map((e) => {
|
|
25
|
-
const t = S(e);
|
|
26
|
-
return t.includes("oklch") ? x(t) : t;
|
|
27
|
-
}).filter(Boolean);
|
|
28
|
-
}
|
|
29
|
-
function I() {
|
|
30
|
-
const o = V(), e = S("--color-base-content"), t = e.includes("oklch") ? x(e) : e || "#888888", r = S("--color-base-300"), a = r.includes("oklch") ? x(r) : r || "#e0e0e0", c = t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i), l = c ? (parseInt(c[1], 16) + parseInt(c[2], 16) + parseInt(c[3], 16)) / 3 > 128 : !1;
|
|
31
|
-
return {
|
|
32
|
-
colors: o.length > 0 ? o : void 0,
|
|
33
|
-
theme: {
|
|
34
|
-
mode: l ? "dark" : "light"
|
|
35
|
-
},
|
|
36
|
-
chart: {
|
|
37
|
-
background: "transparent",
|
|
38
|
-
foreColor: t
|
|
39
|
-
},
|
|
40
|
-
grid: {
|
|
41
|
-
borderColor: a
|
|
42
|
-
},
|
|
43
|
-
xaxis: {
|
|
44
|
-
labels: {
|
|
45
|
-
style: {
|
|
46
|
-
colors: t
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
axisBorder: {
|
|
50
|
-
color: a
|
|
51
|
-
},
|
|
52
|
-
axisTicks: {
|
|
53
|
-
color: a
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
yaxis: {
|
|
57
|
-
labels: {
|
|
58
|
-
style: {
|
|
59
|
-
colors: t
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
legend: {
|
|
64
|
-
labels: {
|
|
65
|
-
colors: t
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
tooltip: {
|
|
69
|
-
theme: l ? "dark" : "light",
|
|
70
|
-
style: {
|
|
71
|
-
fontSize: "12px"
|
|
72
|
-
},
|
|
73
|
-
x: {
|
|
74
|
-
show: !0
|
|
75
|
-
},
|
|
76
|
-
marker: {
|
|
77
|
-
show: !0
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
dataLabels: {
|
|
81
|
-
style: {
|
|
82
|
-
colors: [t, t, t, t, t, t, t]
|
|
83
|
-
},
|
|
84
|
-
background: {
|
|
85
|
-
enabled: !1
|
|
86
|
-
},
|
|
87
|
-
dropShadow: {
|
|
88
|
-
enabled: !1
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function h(o, e) {
|
|
94
|
-
const t = { ...o };
|
|
95
|
-
for (const r in e)
|
|
96
|
-
e[r] !== void 0 && (typeof e[r] == "object" && e[r] !== null && !Array.isArray(e[r]) && typeof o[r] == "object" && o[r] !== null && !Array.isArray(o[r]) ? t[r] = h(
|
|
97
|
-
o[r],
|
|
98
|
-
e[r]
|
|
99
|
-
) : t[r] = e[r]);
|
|
100
|
-
return t;
|
|
101
|
-
}
|
|
102
|
-
const $ = ({
|
|
103
|
-
type: o,
|
|
104
|
-
series: e,
|
|
105
|
-
width: t = "100%",
|
|
106
|
-
height: r = 350,
|
|
107
|
-
options: a = {},
|
|
108
|
-
themed: c = !0,
|
|
109
|
-
className: l = ""
|
|
110
|
-
}) => {
|
|
111
|
-
const u = C(null), n = C(null), [, f] = v(!1), i = () => {
|
|
112
|
-
const s = {
|
|
113
|
-
chart: {
|
|
114
|
-
type: o,
|
|
115
|
-
width: t,
|
|
116
|
-
height: r
|
|
117
|
-
},
|
|
118
|
-
series: e
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as I, useId as j, useEffect as $, useCallback as E } from "react";
|
|
3
|
+
function T({
|
|
4
|
+
options: c,
|
|
5
|
+
value: b,
|
|
6
|
+
onChange: k,
|
|
7
|
+
placeholder: M = "Please select",
|
|
8
|
+
disabled: i = !1,
|
|
9
|
+
allowClear: S = !0,
|
|
10
|
+
expandTrigger: D = "click",
|
|
11
|
+
displayRender: w,
|
|
12
|
+
size: C = "md",
|
|
13
|
+
className: B = "",
|
|
14
|
+
...H
|
|
15
|
+
}) {
|
|
16
|
+
const [r, d] = g(!1), [o, p] = g(b || []), [y, u] = g([]), x = I(null), W = j(), N = j();
|
|
17
|
+
$(() => {
|
|
18
|
+
b !== void 0 && p(b);
|
|
19
|
+
}, [b]), $(() => {
|
|
20
|
+
const e = (s) => {
|
|
21
|
+
x.current && !x.current.contains(s.target) && (d(!1), u([]));
|
|
119
22
|
};
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
23
|
+
if (r)
|
|
24
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
25
|
+
}, [r]);
|
|
26
|
+
const z = E((e, s) => {
|
|
27
|
+
if (e === 0) return c;
|
|
28
|
+
let t = c;
|
|
29
|
+
for (let l = 0; l < e; l++) {
|
|
30
|
+
const a = t.find((f) => f.value === s[l]);
|
|
31
|
+
if (!a?.children) return [];
|
|
32
|
+
t = a.children;
|
|
123
33
|
}
|
|
124
|
-
return
|
|
34
|
+
return t;
|
|
35
|
+
}, [c]), O = E((e) => {
|
|
36
|
+
const s = [];
|
|
37
|
+
let t = c;
|
|
38
|
+
for (const l of e) {
|
|
39
|
+
const a = t.find((f) => f.value === l);
|
|
40
|
+
if (!a) break;
|
|
41
|
+
s.push(a), t = a.children || [];
|
|
42
|
+
}
|
|
43
|
+
return s;
|
|
44
|
+
}, [c]), h = r && y.length > 0 ? y : o, v = [];
|
|
45
|
+
v.push(c);
|
|
46
|
+
for (let e = 0; e < h.length; e++) {
|
|
47
|
+
const s = z(e + 1, h);
|
|
48
|
+
s.length > 0 && v.push(s);
|
|
49
|
+
}
|
|
50
|
+
const K = (e, s) => {
|
|
51
|
+
if (e.disabled) return;
|
|
52
|
+
const t = [...h.slice(0, s), e.value];
|
|
53
|
+
e.children && e.children.length > 0 ? u(t) : (p(t), d(!1), u([]), k?.(t, O(t)));
|
|
54
|
+
}, A = (e, s) => {
|
|
55
|
+
if (D !== "hover" || e.disabled) return;
|
|
56
|
+
const t = [...h.slice(0, s), e.value];
|
|
57
|
+
u(t);
|
|
58
|
+
}, R = (e) => {
|
|
59
|
+
e.stopPropagation(), p([]), k?.([], []);
|
|
60
|
+
}, V = (e) => {
|
|
61
|
+
if (!i)
|
|
62
|
+
switch (e.key) {
|
|
63
|
+
case "Enter":
|
|
64
|
+
case " ":
|
|
65
|
+
e.preventDefault(), d(!r);
|
|
66
|
+
break;
|
|
67
|
+
case "Escape":
|
|
68
|
+
e.preventDefault(), d(!1), u([]);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}, L = O(o), P = L.map((e) => e.label), q = w ? w(P, L) : P.join(" / "), F = {
|
|
72
|
+
xs: "input-xs text-xs",
|
|
73
|
+
sm: "input-sm text-sm",
|
|
74
|
+
md: "input-md",
|
|
75
|
+
lg: "input-lg text-lg"
|
|
76
|
+
}, G = {
|
|
77
|
+
xs: "text-xs",
|
|
78
|
+
sm: "text-sm",
|
|
79
|
+
md: "text-base",
|
|
80
|
+
lg: "text-lg"
|
|
125
81
|
};
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
82
|
+
return /* @__PURE__ */ m("div", { ref: x, className: `relative inline-block w-full ${B}`, "data-state": r ? "open" : "closed", ...H, children: [
|
|
83
|
+
/* @__PURE__ */ m(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
id: W,
|
|
87
|
+
role: "combobox",
|
|
88
|
+
"aria-expanded": r,
|
|
89
|
+
"aria-haspopup": "listbox",
|
|
90
|
+
"aria-controls": N,
|
|
91
|
+
tabIndex: i ? -1 : 0,
|
|
92
|
+
className: `input input-bordered w-full flex items-center justify-between cursor-pointer ${F[C]} ${i ? "input-disabled cursor-not-allowed" : ""} ${r ? "border-primary" : ""}`,
|
|
93
|
+
onClick: () => !i && d(!r),
|
|
94
|
+
onKeyDown: V,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ n("span", { className: o.length === 0 ? "text-base-content/50" : "", children: o.length > 0 ? q : M }),
|
|
97
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: [
|
|
98
|
+
S && o.length > 0 && !i && /* @__PURE__ */ n(
|
|
99
|
+
"button",
|
|
100
|
+
{
|
|
101
|
+
type: "button",
|
|
102
|
+
className: "btn btn-ghost btn-xs btn-circle",
|
|
103
|
+
onClick: R,
|
|
104
|
+
"aria-label": "Clear selection",
|
|
105
|
+
children: /* @__PURE__ */ n("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ n(
|
|
109
|
+
"svg",
|
|
110
|
+
{
|
|
111
|
+
className: `w-4 h-4 transition-transform ${r ? "rotate-180" : ""}`,
|
|
112
|
+
fill: "none",
|
|
113
|
+
viewBox: "0 0 24 24",
|
|
114
|
+
stroke: "currentColor",
|
|
115
|
+
children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] })
|
|
119
|
+
]
|
|
142
120
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
121
|
+
),
|
|
122
|
+
r && /* @__PURE__ */ n(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
id: N,
|
|
126
|
+
className: `absolute z-50 mt-1 bg-base-100 border border-base-300 rounded-lg shadow-lg flex ${G[C]}`,
|
|
127
|
+
children: v.map((e, s) => /* @__PURE__ */ n(
|
|
128
|
+
"ul",
|
|
129
|
+
{
|
|
130
|
+
role: "listbox",
|
|
131
|
+
className: `min-w-[120px] max-h-[200px] overflow-y-auto py-1 ${s > 0 ? "border-l border-base-300" : ""}`,
|
|
132
|
+
children: e.map((t) => {
|
|
133
|
+
const l = o[s] === t.value, a = h[s] === t.value, f = t.children && t.children.length > 0;
|
|
134
|
+
return /* @__PURE__ */ m(
|
|
135
|
+
"li",
|
|
136
|
+
{
|
|
137
|
+
role: "option",
|
|
138
|
+
"aria-selected": l,
|
|
139
|
+
"aria-disabled": t.disabled,
|
|
140
|
+
className: `px-3 py-2 cursor-pointer flex items-center justify-between gap-2 ${t.disabled ? "text-base-content/30 cursor-not-allowed" : l ? "bg-primary text-primary-content" : a ? "bg-base-200" : "hover:bg-base-200"}`,
|
|
141
|
+
onClick: () => K(t, s),
|
|
142
|
+
onMouseEnter: () => A(t, s),
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ n("span", { children: t.label }),
|
|
145
|
+
f && /* @__PURE__ */ n("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
t.value
|
|
149
|
+
);
|
|
150
|
+
})
|
|
151
|
+
},
|
|
152
|
+
s
|
|
153
|
+
))
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] });
|
|
157
|
+
}
|
|
150
158
|
export {
|
|
151
|
-
|
|
159
|
+
T as Cascader
|
|
152
160
|
};
|
|
153
161
|
//# sourceMappingURL=index15.js.map
|
package/dist/index15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.js","sources":["../src/components/Chart.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport ApexCharts from 'apexcharts'\nimport type { ApexOptions } from 'apexcharts'\n\nexport interface ChartProps {\n /** Chart type */\n type: 'line' | 'area' | 'bar' | 'pie' | 'donut' | 'radialBar' | 'scatter' | 'bubble' | 'heatmap' | 'candlestick' | 'boxPlot' | 'radar' | 'polarArea' | 'rangeBar' | 'rangeArea' | 'treemap'\n /** Chart series data */\n series: ApexAxisChartSeries | ApexNonAxisChartSeries\n /** Chart width */\n width?: string | number\n /** Chart height */\n height?: string | number\n /** ApexCharts options (merged with theme defaults) */\n options?: ApexOptions\n /** Use daisyUI theme colors */\n themed?: boolean\n /** Additional CSS classes */\n className?: string\n}\n\n// Get CSS variable value from root\nfunction getCssVar(varName: string): string {\n if (typeof document === 'undefined') return ''\n return getComputedStyle(document.documentElement).getPropertyValue(varName).trim()\n}\n\n// Convert oklch to hex (approximate)\nfunction oklchToHex(oklch: string): string {\n // Parse oklch(L C H) format\n const match = oklch.match(/oklch\\(\\s*([\\d.]+)%?\\s+([\\d.]+)\\s+([\\d.]+)/)\n if (!match) return ''\n\n const l = parseFloat(match[1]) / 100 // Lightness 0-1\n const c = parseFloat(match[2]) // Chroma\n const h = parseFloat(match[3]) // Hue in degrees\n\n // Simplified oklch to sRGB conversion\n // This is an approximation - full conversion is complex\n const hRad = (h * Math.PI) / 180\n const a = c * Math.cos(hRad)\n const b = c * Math.sin(hRad)\n\n // Approximate conversion to linear RGB\n const l_ = l + 0.3963377774 * a + 0.2158037573 * b\n const m_ = l - 0.1055613458 * a - 0.0638541728 * b\n const s_ = l - 0.0894841775 * a - 1.2914855480 * b\n\n const l3 = l_ * l_ * l_\n const m3 = m_ * m_ * m_\n const s3 = s_ * s_ * s_\n\n let r = 4.0767416621 * l3 - 3.3077115913 * m3 + 0.2309699292 * s3\n let g = -1.2684380046 * l3 + 2.6097574011 * m3 - 0.3413193965 * s3\n let bl = -0.0041960863 * l3 - 0.7034186147 * m3 + 1.7076147010 * s3\n\n // Clamp and convert to sRGB\n const toSrgb = (x: number) => {\n x = Math.max(0, Math.min(1, x))\n return x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1/2.4) - 0.055\n }\n\n r = Math.round(toSrgb(r) * 255)\n g = Math.round(toSrgb(g) * 255)\n bl = Math.round(toSrgb(bl) * 255)\n\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${bl.toString(16).padStart(2, '0')}`\n}\n\n// Get daisyUI theme colors from CSS variables\nfunction getThemeColors(): string[] {\n if (typeof document === 'undefined') return []\n\n const colorVars = [\n '--color-primary',\n '--color-secondary',\n '--color-accent',\n '--color-info',\n '--color-success',\n '--color-warning',\n '--color-error',\n ]\n\n return colorVars\n .map(varName => {\n const value = getCssVar(varName)\n if (value.includes('oklch')) {\n return oklchToHex(value)\n }\n return value\n })\n .filter(Boolean)\n}\n\n// Get theme-aware chart options\nfunction getThemedOptions(): Partial<ApexOptions> {\n const colors = getThemeColors()\n\n // Get text color from CSS variable\n const baseContentVar = getCssVar('--color-base-content')\n const textColor = baseContentVar.includes('oklch')\n ? oklchToHex(baseContentVar)\n : (baseContentVar || '#888888')\n\n // Get grid color from CSS variable\n const base300Var = getCssVar('--color-base-300')\n const gridColor = base300Var.includes('oklch')\n ? oklchToHex(base300Var)\n : (base300Var || '#e0e0e0')\n\n // Determine if dark theme by checking luminance of text color\n // If text is light, we're on dark theme\n const textMatch = textColor.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)\n const isDark = textMatch\n ? (parseInt(textMatch[1], 16) + parseInt(textMatch[2], 16) + parseInt(textMatch[3], 16)) / 3 > 128\n : false\n\n return {\n colors: colors.length > 0 ? colors : undefined,\n theme: {\n mode: isDark ? 'dark' : 'light',\n },\n chart: {\n background: 'transparent',\n foreColor: textColor,\n },\n grid: {\n borderColor: gridColor,\n },\n xaxis: {\n labels: {\n style: {\n colors: textColor,\n },\n },\n axisBorder: {\n color: gridColor,\n },\n axisTicks: {\n color: gridColor,\n },\n },\n yaxis: {\n labels: {\n style: {\n colors: textColor,\n },\n },\n },\n legend: {\n labels: {\n colors: textColor,\n },\n },\n tooltip: {\n theme: isDark ? 'dark' : 'light',\n style: {\n fontSize: '12px',\n },\n x: {\n show: true,\n },\n marker: {\n show: true,\n },\n },\n dataLabels: {\n style: {\n colors: [textColor, textColor, textColor, textColor, textColor, textColor, textColor],\n },\n background: {\n enabled: false,\n },\n dropShadow: {\n enabled: false,\n },\n },\n }\n}\n\n// Deep merge objects\nfunction deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T {\n const result = { ...target }\n\n for (const key in source) {\n if (source[key] !== undefined) {\n if (\n typeof source[key] === 'object' &&\n source[key] !== null &&\n !Array.isArray(source[key]) &&\n typeof target[key] === 'object' &&\n target[key] !== null &&\n !Array.isArray(target[key])\n ) {\n result[key] = deepMerge(\n target[key] as Record<string, unknown>,\n source[key] as Record<string, unknown>\n ) as T[Extract<keyof T, string>]\n } else {\n result[key] = source[key] as T[Extract<keyof T, string>]\n }\n }\n }\n\n return result\n}\n\nexport const Chart: React.FC<ChartProps> = ({\n type,\n series,\n width = '100%',\n height = 350,\n options = {},\n themed = true,\n className = '',\n}) => {\n const chartRef = useRef<HTMLDivElement>(null)\n const chartInstance = useRef<ApexCharts | null>(null)\n const [, setMounted] = useState(false)\n\n // Build final options\n const buildOptions = (): ApexOptions => {\n const baseOptions: ApexOptions = {\n chart: {\n type,\n width,\n height,\n },\n series,\n }\n\n if (themed) {\n const themedOpts = getThemedOptions()\n return deepMerge(deepMerge(baseOptions as unknown as Record<string, unknown>, themedOpts as unknown as Record<string, unknown>), options as unknown as Record<string, unknown>) as ApexOptions\n }\n\n return deepMerge(baseOptions as unknown as Record<string, unknown>, options as unknown as Record<string, unknown>) as ApexOptions\n }\n\n // Initialize chart\n useEffect(() => {\n if (!chartRef.current) return\n\n const opts = buildOptions()\n chartInstance.current = new ApexCharts(chartRef.current, opts)\n chartInstance.current.render()\n setMounted(true)\n\n return () => {\n if (chartInstance.current) {\n chartInstance.current.destroy()\n chartInstance.current = null\n }\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n // Update chart when props change\n useEffect(() => {\n if (!chartInstance.current) return\n\n const opts = buildOptions()\n chartInstance.current.updateOptions(opts, true, true)\n }, [type, series, width, height, options, themed]) // eslint-disable-line react-hooks/exhaustive-deps\n\n // Listen for theme changes\n useEffect(() => {\n if (!themed || typeof window === 'undefined') return\n\n const observer = new MutationObserver(() => {\n if (chartInstance.current) {\n const opts = buildOptions()\n chartInstance.current.updateOptions(opts, true, true)\n }\n })\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-theme', 'class'],\n })\n\n return () => observer.disconnect()\n }, [themed]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={chartRef} className={className} />\n}\n"],"names":["getCssVar","varName","oklchToHex","oklch","match","l","c","hRad","a","b","l_","m_","s_","l3","m3","s3","r","g","bl","toSrgb","x","getThemeColors","value","getThemedOptions","colors","baseContentVar","textColor","base300Var","gridColor","textMatch","isDark","deepMerge","target","source","result","key","Chart","type","series","width","height","options","themed","className","chartRef","useRef","chartInstance","setMounted","useState","buildOptions","baseOptions","themedOpts","useEffect","opts","ApexCharts","observer","jsx"],"mappings":";;;AAsBA,SAASA,EAAUC,GAAyB;AAC1C,SAAI,OAAO,WAAa,MAAoB,KACrC,iBAAiB,SAAS,eAAe,EAAE,iBAAiBA,CAAO,EAAE,KAAA;AAC9E;AAGA,SAASC,EAAWC,GAAuB;AAEzC,QAAMC,IAAQD,EAAM,MAAM,4CAA4C;AACtE,MAAI,CAACC,EAAO,QAAO;AAEnB,QAAMC,IAAI,WAAWD,EAAM,CAAC,CAAC,IAAI,KAC3BE,IAAI,WAAWF,EAAM,CAAC,CAAC,GAKvBG,IAJI,WAAWH,EAAM,CAAC,CAAC,IAIX,KAAK,KAAM,KACvBI,IAAIF,IAAI,KAAK,IAAIC,CAAI,GACrBE,IAAIH,IAAI,KAA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B,aAAOQ,EAAUA,EAAUmB,GAAmDC,CAAgD,GAAGV,CAA6C;AAAA,IAChL;AAEA,WAAOV,EAAUmB,GAAmDT,CAA6C;AAAA,EACnH;AAGA,SAAAW,EAAU,MAAM;AACd,QAAI,CAACR,EAAS,QAAS;AAEvB,UAAMS,IAAOJ,EAAA;AACb,WAAAH,EAAc,UAAU,IAAIQ,EAAWV,EAAS,SAASS,CAAI,GAC7DP,EAAc,QAAQ,OAAA,GACtBC,EAAW,EAAI,GAER,MAAM;AACX,MAAID,EAAc,YAChBA,EAAc,QAAQ,QAAA,GACtBA,EAAc,UAAU;AAAA,IAE5B;AAAA,EACF,GAAG,CAAA,CAAE,GAGLM,EAAU,MAAM;AACd,QAAI,CAACN,EAAc,QAAS;AAE5B,UAAMO,IAAOJ,EAAA;AACb,IAAAH,EAAc,QAAQ,cAAcO,GAAM,IAAM,EAAI;AAAA,EACtD,GAAG,CAAChB,GAAMC,GAAQC,GAAOC,GAAQC,GAASC,CAAM,CAAC,GAGjDU,EAAU,MAAM;AACd,QAAI,CAACV,KAAU,OAAO,SAAW,IAAa;AAE9C,UAAMa,IAAW,IAAI,iBAAiB,MAAM;AAC1C,UAAIT,EAAc,SAAS;AACzB,cAAMO,IAAOJ,EAAA;AACb,QAAAH,EAAc,QAAQ,cAAcO,GAAM,IAAM,EAAI;AAAA,MACtD;AAAA,IACF,CAAC;AAED,WAAAE,EAAS,QAAQ,SAAS,iBAAiB;AAAA,MACzC,YAAY;AAAA,MACZ,iBAAiB,CAAC,cAAc,OAAO;AAAA,IAAA,CACxC,GAEM,MAAMA,EAAS,WAAA;AAAA,EACxB,GAAG,CAACb,CAAM,CAAC,GAEJ,gBAAAc,EAAC,OAAA,EAAI,KAAKZ,GAAU,WAAAD,EAAA,CAAsB;AACnD;"}
|
|
1
|
+
{"version":3,"file":"index15.js","sources":["../src/components/Cascader.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect, useCallback, useId } from 'react'\n\nexport interface CascaderOption {\n value: string | number\n label: React.ReactNode\n disabled?: boolean\n children?: CascaderOption[]\n}\n\nexport interface CascaderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n options: CascaderOption[]\n value?: (string | number)[]\n onChange?: (value: (string | number)[], selectedOptions: CascaderOption[]) => void\n placeholder?: string\n disabled?: boolean\n allowClear?: boolean\n expandTrigger?: 'click' | 'hover'\n displayRender?: (labels: React.ReactNode[], selectedOptions: CascaderOption[]) => React.ReactNode\n size?: 'xs' | 'sm' | 'md' | 'lg'\n}\n\nexport function Cascader({\n options,\n value,\n onChange,\n placeholder = 'Please select',\n disabled = false,\n allowClear = true,\n expandTrigger = 'click',\n displayRender,\n size = 'md',\n className = '',\n ...rest\n}: CascaderProps) {\n const [isOpen, setIsOpen] = useState(false)\n const [selectedPath, setSelectedPath] = useState<(string | number)[]>(value || [])\n const [hoveredPath, setHoveredPath] = useState<(string | number)[]>([])\n const containerRef = useRef<HTMLDivElement>(null)\n const inputId = useId()\n const listboxId = useId()\n\n // Sync with controlled value\n useEffect(() => {\n if (value !== undefined) {\n setSelectedPath(value)\n }\n }, [value])\n\n // Close on outside click\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setIsOpen(false)\n setHoveredPath([])\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n return () => document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen])\n\n // Get options at each level based on path\n const getOptionsAtLevel = useCallback((level: number, path: (string | number)[]): CascaderOption[] => {\n if (level === 0) return options\n\n let currentOptions = options\n for (let i = 0; i < level; i++) {\n const selected = currentOptions.find(opt => opt.value === path[i])\n if (!selected?.children) return []\n currentOptions = selected.children\n }\n return currentOptions\n }, [options])\n\n // Get selected options objects from path\n const getSelectedOptions = useCallback((path: (string | number)[]): CascaderOption[] => {\n const result: CascaderOption[] = []\n let currentOptions = options\n\n for (const val of path) {\n const found = currentOptions.find(opt => opt.value === val)\n if (!found) break\n result.push(found)\n currentOptions = found.children || []\n }\n\n return result\n }, [options])\n\n // Determine which path to use for displaying columns\n const activePath = isOpen ? (hoveredPath.length > 0 ? hoveredPath : selectedPath) : selectedPath\n\n // Build columns to display\n const columns: CascaderOption[][] = []\n columns.push(options)\n\n for (let i = 0; i < activePath.length; i++) {\n const nextOptions = getOptionsAtLevel(i + 1, activePath)\n if (nextOptions.length > 0) {\n columns.push(nextOptions)\n }\n }\n\n const handleOptionClick = (option: CascaderOption, level: number) => {\n if (option.disabled) return\n\n const newPath = [...activePath.slice(0, level), option.value]\n\n if (option.children && option.children.length > 0) {\n // Has children - just expand, don't select yet\n setHoveredPath(newPath)\n } else {\n // Leaf node - select and close\n setSelectedPath(newPath)\n setIsOpen(false)\n setHoveredPath([])\n onChange?.(newPath, getSelectedOptions(newPath))\n }\n }\n\n const handleOptionHover = (option: CascaderOption, level: number) => {\n if (expandTrigger !== 'hover' || option.disabled) return\n\n const newPath = [...activePath.slice(0, level), option.value]\n setHoveredPath(newPath)\n }\n\n const handleClear = (e: React.MouseEvent) => {\n e.stopPropagation()\n setSelectedPath([])\n onChange?.([], [])\n }\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (disabled) return\n\n switch (e.key) {\n case 'Enter':\n case ' ':\n e.preventDefault()\n setIsOpen(!isOpen)\n break\n case 'Escape':\n e.preventDefault()\n setIsOpen(false)\n setHoveredPath([])\n break\n }\n }\n\n // Display value\n const selectedOptions = getSelectedOptions(selectedPath)\n const labels = selectedOptions.map(opt => opt.label)\n const displayValue = displayRender\n ? displayRender(labels, selectedOptions)\n : labels.join(' / ')\n\n // Size classes\n const sizeClasses = {\n xs: 'input-xs text-xs',\n sm: 'input-sm text-sm',\n md: 'input-md',\n lg: 'input-lg text-lg',\n }\n\n const dropdownSizeClasses = {\n xs: 'text-xs',\n sm: 'text-sm',\n md: 'text-base',\n lg: 'text-lg',\n }\n\n return (\n <div ref={containerRef} className={`relative inline-block w-full ${className}`} data-state={isOpen ? 'open' : 'closed'} {...rest}>\n {/* Input/Trigger */}\n <div\n id={inputId}\n role=\"combobox\"\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n aria-controls={listboxId}\n tabIndex={disabled ? -1 : 0}\n className={`input input-bordered w-full flex items-center justify-between cursor-pointer ${sizeClasses[size]} ${\n disabled ? 'input-disabled cursor-not-allowed' : ''\n } ${isOpen ? 'border-primary' : ''}`}\n onClick={() => !disabled && setIsOpen(!isOpen)}\n onKeyDown={handleKeyDown}\n >\n <span className={selectedPath.length === 0 ? 'text-base-content/50' : ''}>\n {selectedPath.length > 0 ? displayValue : placeholder}\n </span>\n <div className=\"flex items-center gap-1\">\n {allowClear && selectedPath.length > 0 && !disabled && (\n <button\n type=\"button\"\n className=\"btn btn-ghost btn-xs btn-circle\"\n onClick={handleClear}\n aria-label=\"Clear selection\"\n >\n <svg className=\"w-3 h-3\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n )}\n <svg\n className={`w-4 h-4 transition-transform ${isOpen ? 'rotate-180' : ''}`}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </div>\n </div>\n\n {/* Dropdown */}\n {isOpen && (\n <div\n id={listboxId}\n className={`absolute z-50 mt-1 bg-base-100 border border-base-300 rounded-lg shadow-lg flex ${dropdownSizeClasses[size]}`}\n >\n {columns.map((columnOptions, colIndex) => (\n <ul\n key={colIndex}\n role=\"listbox\"\n className={`min-w-[120px] max-h-[200px] overflow-y-auto py-1 ${\n colIndex > 0 ? 'border-l border-base-300' : ''\n }`}\n >\n {columnOptions.map((option) => {\n const isSelected = selectedPath[colIndex] === option.value\n const isHovered = activePath[colIndex] === option.value\n const hasChildren = option.children && option.children.length > 0\n\n return (\n <li\n key={option.value}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled}\n className={`px-3 py-2 cursor-pointer flex items-center justify-between gap-2 ${\n option.disabled\n ? 'text-base-content/30 cursor-not-allowed'\n : isSelected\n ? 'bg-primary text-primary-content'\n : isHovered\n ? 'bg-base-200'\n : 'hover:bg-base-200'\n }`}\n onClick={() => handleOptionClick(option, colIndex)}\n onMouseEnter={() => handleOptionHover(option, colIndex)}\n >\n <span>{option.label}</span>\n {hasChildren && (\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n )}\n </li>\n )\n })}\n </ul>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"names":["Cascader","options","value","onChange","placeholder","disabled","allowClear","expandTrigger","displayRender","size","className","rest","isOpen","setIsOpen","useState","selectedPath","setSelectedPath","hoveredPath","setHoveredPath","containerRef","useRef","inputId","useId","listboxId","useEffect","handleClickOutside","e","getOptionsAtLevel","useCallback","level","path","currentOptions","i","selected","opt","getSelectedOptions","result","val","found","activePath","columns","nextOptions","handleOptionClick","option","newPath","handleOptionHover","handleClear","handleKeyDown","selectedOptions","labels","displayValue","sizeClasses","dropdownSizeClasses","jsxs","jsx","columnOptions","colIndex","isSelected","isHovered","hasChildren"],"mappings":";;AAqBO,SAASA,EAAS;AAAA,EACvB,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,YAAAC,IAAa;AAAA,EACb,eAAAC,IAAgB;AAAA,EAChB,eAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAkB;AAChB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK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,cAAc,MAAMX,EAAkBF,GAAQa,CAAQ;AAAA,kBAEtD,UAAA;AAAA,oBAAA,gBAAAF,EAAC,QAAA,EAAM,YAAO,MAAA,CAAM;AAAA,oBACnBK,uBACE,OAAA,EAAI,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBAC9D,UAAA,gBAAAL,EAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,eAAA,CAAe,EAAA,CACtF;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBApBGX,EAAO;AAAA,cAAA;AAAA,YAwBlB,CAAC;AAAA,UAAA;AAAA,UArCIa;AAAA,QAAA,CAuCR;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GAEJ;AAEJ;"}
|
package/dist/index150.js
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { __require as g } from "./index129.js";
|
|
2
|
+
var r, i;
|
|
3
|
+
function s() {
|
|
4
|
+
if (i) return r;
|
|
5
|
+
i = 1;
|
|
6
|
+
const o = g();
|
|
7
|
+
function e(t) {
|
|
8
|
+
this.mode = o.BYTE, typeof t == "string" ? this.data = new TextEncoder().encode(t) : this.data = new Uint8Array(t);
|
|
9
|
+
}
|
|
10
|
+
return e.getBitsLength = function(n) {
|
|
11
|
+
return n * 8;
|
|
12
|
+
}, e.prototype.getLength = function() {
|
|
13
|
+
return this.data.length;
|
|
14
|
+
}, e.prototype.getBitsLength = function() {
|
|
15
|
+
return e.getBitsLength(this.data.length);
|
|
16
|
+
}, e.prototype.write = function(t) {
|
|
17
|
+
for (let n = 0, a = this.data.length; n < a; n++)
|
|
18
|
+
t.put(this.data[n], 8);
|
|
19
|
+
}, r = e, r;
|
|
20
|
+
}
|
|
2
21
|
export {
|
|
3
|
-
|
|
22
|
+
s as __require
|
|
4
23
|
};
|
|
5
24
|
//# sourceMappingURL=index150.js.map
|
package/dist/index150.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index150.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index150.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js"],"sourcesContent":["const Mode = require('./mode')\n\nfunction ByteData (data) {\n this.mode = Mode.BYTE\n if (typeof (data) === 'string') {\n this.data = new TextEncoder().encode(data)\n } else {\n this.data = new Uint8Array(data)\n }\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n for (let i = 0, l = this.data.length; i < l; i++) {\n bitBuffer.put(this.data[i], 8)\n }\n}\n\nmodule.exports = ByteData\n"],"names":["Mode","require$$0","ByteData","data","length","bitBuffer","i","l","byteData"],"mappings":";;;;;AAAA,QAAMA,IAAOC,EAAA;AAEb,WAASC,EAAUC,GAAM;AACvB,SAAK,OAAOH,EAAK,MACb,OAAQG,KAAU,WACpB,KAAK,OAAO,IAAI,YAAW,EAAG,OAAOA,CAAI,IAEzC,KAAK,OAAO,IAAI,WAAWA,CAAI;AAAA,EAEnC;AAEA,SAAAD,EAAS,gBAAgB,SAAwBE,GAAQ;AACvD,WAAOA,IAAS;AAAA,EAClB,GAEAF,EAAS,UAAU,YAAY,WAAsB;AACnD,WAAO,KAAK,KAAK;AAAA,EACnB,GAEAA,EAAS,UAAU,gBAAgB,WAA0B;AAC3D,WAAOA,EAAS,cAAc,KAAK,KAAK,MAAM;AAAA,EAChD,GAEAA,EAAS,UAAU,QAAQ,SAAUG,GAAW;AAC9C,aAASC,IAAI,GAAGC,IAAI,KAAK,KAAK,QAAQD,IAAIC,GAAGD;AAC3C,MAAAD,EAAU,IAAI,KAAK,KAAKC,CAAC,GAAG,CAAC;AAAA,EAEjC,GAEAE,IAAiBN;;","x_google_ignoreList":[0]}
|
package/dist/index151.js
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import { __require as u } from "./index129.js";
|
|
2
|
+
import { __require as h } from "./index118.js";
|
|
3
|
+
var a, n;
|
|
4
|
+
function c() {
|
|
5
|
+
if (n) return a;
|
|
6
|
+
n = 1;
|
|
7
|
+
const o = u(), s = h();
|
|
8
|
+
function r(i) {
|
|
9
|
+
this.mode = o.KANJI, this.data = i;
|
|
10
|
+
}
|
|
11
|
+
return r.getBitsLength = function(e) {
|
|
12
|
+
return e * 13;
|
|
13
|
+
}, r.prototype.getLength = function() {
|
|
14
|
+
return this.data.length;
|
|
15
|
+
}, r.prototype.getBitsLength = function() {
|
|
16
|
+
return r.getBitsLength(this.data.length);
|
|
17
|
+
}, r.prototype.write = function(i) {
|
|
18
|
+
let e;
|
|
19
|
+
for (e = 0; e < this.data.length; e++) {
|
|
20
|
+
let t = s.toSJIS(this.data[e]);
|
|
21
|
+
if (t >= 33088 && t <= 40956)
|
|
22
|
+
t -= 33088;
|
|
23
|
+
else if (t >= 57408 && t <= 60351)
|
|
24
|
+
t -= 49472;
|
|
25
|
+
else
|
|
26
|
+
throw new Error(
|
|
27
|
+
"Invalid SJIS character: " + this.data[e] + `
|
|
28
|
+
Make sure your charset is UTF-8`
|
|
29
|
+
);
|
|
30
|
+
t = (t >>> 8 & 255) * 192 + (t & 255), i.put(t, 13);
|
|
31
|
+
}
|
|
32
|
+
}, a = r, a;
|
|
33
|
+
}
|
|
2
34
|
export {
|
|
3
|
-
|
|
35
|
+
c as __require
|
|
4
36
|
};
|
|
5
37
|
//# sourceMappingURL=index151.js.map
|
package/dist/index151.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index151.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index151.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js"],"sourcesContent":["const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n this.mode = Mode.KANJI\n this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n let i\n\n // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n // These byte values are shifted from the JIS X 0208 values.\n // JIS X 0208 gives details of the shift coded representation.\n for (i = 0; i < this.data.length; i++) {\n let value = Utils.toSJIS(this.data[i])\n\n // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n if (value >= 0x8140 && value <= 0x9FFC) {\n // Subtract 0x8140 from Shift JIS value\n value -= 0x8140\n\n // For characters with Shift JIS values from 0xE040 to 0xEBBF\n } else if (value >= 0xE040 && value <= 0xEBBF) {\n // Subtract 0xC140 from Shift JIS value\n value -= 0xC140\n } else {\n throw new Error(\n 'Invalid SJIS character: ' + this.data[i] + '\\n' +\n 'Make sure your charset is UTF-8')\n }\n\n // Multiply most significant byte of result by 0xC0\n // and add least significant byte to product\n value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n // Convert result to a 13-bit binary string\n bitBuffer.put(value, 13)\n }\n}\n\nmodule.exports = KanjiData\n"],"names":["Mode","require$$0","Utils","require$$1","KanjiData","data","length","bitBuffer","i","value","kanjiData"],"mappings":";;;;;;AAAA,QAAMA,IAAOC,EAAA,GACPC,IAAQC,EAAA;AAEd,WAASC,EAAWC,GAAM;AACxB,SAAK,OAAOL,EAAK,OACjB,KAAK,OAAOK;AAAA,EACd;AAEA,SAAAD,EAAU,gBAAgB,SAAwBE,GAAQ;AACxD,WAAOA,IAAS;AAAA,EAClB,GAEAF,EAAU,UAAU,YAAY,WAAsB;AACpD,WAAO,KAAK,KAAK;AAAA,EACnB,GAEAA,EAAU,UAAU,gBAAgB,WAA0B;AAC5D,WAAOA,EAAU,cAAc,KAAK,KAAK,MAAM;AAAA,EACjD,GAEAA,EAAU,UAAU,QAAQ,SAAUG,GAAW;AAC/C,QAAIC;AAKJ,SAAKA,IAAI,GAAGA,IAAI,KAAK,KAAK,QAAQA,KAAK;AACrC,UAAIC,IAAQP,EAAM,OAAO,KAAK,KAAKM,CAAC,CAAC;AAGrC,UAAIC,KAAS,SAAUA,KAAS;AAE9B,QAAAA,KAAS;AAAA,eAGAA,KAAS,SAAUA,KAAS;AAErC,QAAAA,KAAS;AAAA;AAET,cAAM,IAAI;AAAA,UACR,6BAA6B,KAAK,KAAKD,CAAC,IAAI;AAAA;AAAA,QACX;AAKrC,MAAAC,KAAWA,MAAU,IAAK,OAAQ,OAASA,IAAQ,MAGnDF,EAAU,IAAIE,GAAO,EAAE;AAAA,IAC3B;AAAA,EACA,GAEAC,IAAiBN;;","x_google_ignoreList":[0]}
|