ranui 0.1.9 → 0.1.10-alpha.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.
- package/README.zh-CN.md +190 -0
- package/dist/_commonjs-dynamic-modules-DLbDWi6a.js +12 -0
- package/dist/arrow-down-B_hCY3Wt.js +662 -0
- package/dist/button.js +7 -0
- package/dist/checkbox.js +7 -0
- package/dist/colorpicker.js +11 -0
- package/dist/{colz-746223ab.js → colz-DJZvo_8B.js} +4 -13
- package/dist/docx-CHkPTdGU.js +3665 -0
- package/dist/drop-4j4abxje.js +36 -0
- package/dist/icon.js +6 -0
- package/dist/iconShadowless.js +6 -0
- package/dist/image.js +4 -0
- package/dist/{index-4443363f.js → index-15M0olqa.js} +40 -68
- package/dist/index-1v568_nq.js +140 -0
- package/dist/index-B897keW5.js +279 -0
- package/dist/{index-e03d23e7.js → index-BZR0HaP2.js} +2 -5
- package/dist/{index-e2e5d725.js → index-B_GuEcTd.js} +1280 -2146
- package/dist/index-Bc2Bcl8D.js +63701 -0
- package/dist/index-C4Sv0T51.js +495 -0
- package/dist/{index-2d16a084.js → index-C6RcMHoH.js} +12 -22
- package/dist/index-C9z10IgG.js +103 -0
- package/dist/{index-3cf72afd.js → index-CFjEuvBW.js} +23 -45
- package/dist/{index-7b8840f9.js → index-CGEx9VOA.js} +1086 -2670
- package/dist/index-CGYfjKUV.js +72 -0
- package/dist/index-CVtBLEpV.js +712 -0
- package/dist/index-CiWwvEMM.js +511 -0
- package/dist/index-CtVOgBDk.js +659 -0
- package/dist/index-D4qUro5V.js +279 -0
- package/dist/index-D4y9c1Dj.js +310 -0
- package/dist/{index-b7790662.js → index-DAxs7Dd2.js} +6 -13
- package/dist/index-DC5EA657.js +91 -0
- package/dist/index-DJZmDHz-.js +146 -0
- package/dist/{index-0d5b9435.js → index-D_CA5VDZ.js} +11 -15
- package/dist/{index-01b17e26.js → index-KS2nvVcO.js} +2 -5
- package/dist/{index-1048a998.js → index-WfFw4LJT.js} +105 -62
- package/dist/{index-458debf7.js → index-mhFL9MJp.js} +15 -49
- package/dist/index.d.ts +211 -14
- package/dist/index.js +24 -24
- package/dist/info-circle-fill-CFeVMdci.js +4 -0
- package/dist/input.js +6 -0
- package/dist/inputShadowless.js +6 -0
- package/dist/jszip.min-Dhs3nUkD.js +2346 -0
- package/dist/katex-es-B5r5vt3m.js +14628 -0
- package/dist/loading-scene-BMc2wqKm.js +4 -0
- package/dist/loading.js +8 -0
- package/dist/math.js +7 -0
- package/dist/message.js +6 -0
- package/dist/modal.js +4 -0
- package/dist/{pdf-bdb7818a.js → pdf-Cx0VWKFo.js} +13 -8
- package/dist/player.js +8 -0
- package/dist/popover.js +8 -0
- package/dist/preview.js +7 -0
- package/dist/progress.js +7 -0
- package/dist/radar.js +6 -0
- package/dist/select.js +10 -0
- package/dist/{index-1b73beee.js → selectShadowless.js} +161 -165
- package/dist/shadowless.js +8 -0
- package/dist/skeleton.js +4 -0
- package/dist/sprite-CH2zLtZy.js +141 -0
- package/dist/style.css +1 -1
- package/dist/tab.js +6 -0
- package/dist/tabpane.js +4 -0
- package/dist/tsconfig.json +31 -0
- package/dist/typings.d.ts +211 -0
- package/dist/umd/index.umd.cjs +21 -32
- package/dist/umd/shadowless/shadowless.umd.cjs +1 -0
- package/dist/umd/shadowless/style.css +1 -0
- package/dist/umd/style.css +1 -1
- package/package.json +113 -69
- package/readme.md +38 -56
- package/typings.d.ts +211 -0
- package/dist/build/config.d.ts +0 -3
- package/dist/build/config.es.d.ts +0 -2
- package/dist/build/config.umd.d.ts +0 -2
- package/dist/components/button/index.d.ts +0 -35
- package/dist/components/button/index.js +0 -8
- package/dist/components/form/index.d.ts +0 -2
- package/dist/components/icon/index.d.ts +0 -2
- package/dist/components/icon/index.js +0 -6
- package/dist/components/image/index.d.ts +0 -2
- package/dist/components/image/index.js +0 -4
- package/dist/components/input/index.d.ts +0 -185
- package/dist/components/input/index.js +0 -6
- package/dist/components/message/index.d.ts +0 -14
- package/dist/components/message/index.js +0 -4
- package/dist/components/modal/index.d.ts +0 -2
- package/dist/components/modal/index.js +0 -4
- package/dist/components/option/index.d.ts +0 -2
- package/dist/components/option/index.js +0 -95
- package/dist/components/player/index.d.ts +0 -213
- package/dist/components/player/index.js +0 -12
- package/dist/components/preview/colz.d.ts +0 -72
- package/dist/components/preview/docx.d.ts +0 -8
- package/dist/components/preview/excel/excel.d.ts +0 -2
- package/dist/components/preview/excel/index.d.ts +0 -1
- package/dist/components/preview/excel/media.d.ts +0 -37
- package/dist/components/preview/index.d.ts +0 -6
- package/dist/components/preview/index.js +0 -8
- package/dist/components/preview/pdf.d.ts +0 -1
- package/dist/components/preview/pptx/index.d.ts +0 -16
- package/dist/components/preview/pptx/process_pptx.d.ts +0 -23
- package/dist/components/preview/pptx/t_xml.d.ts +0 -1
- package/dist/components/preview/pptx/worker.d.ts +0 -1
- package/dist/components/progress/index.d.ts +0 -36
- package/dist/components/progress/index.js +0 -8
- package/dist/components/radar/index.d.ts +0 -2
- package/dist/components/radar/index.js +0 -7
- package/dist/components/scratch/index.d.ts +0 -19
- package/dist/components/select/index.d.ts +0 -105
- package/dist/components/select/index.js +0 -11
- package/dist/components/skeleton/index.d.ts +0 -2
- package/dist/components/skeleton/index.js +0 -4
- package/dist/components/tab/index.d.ts +0 -408
- package/dist/components/tab/index.js +0 -7
- package/dist/components/tabpane/index.d.ts +0 -352
- package/dist/components/tabpane/index.js +0 -4
- package/dist/docx-c5d02d8c.js +0 -21
- package/dist/index-57492b9b.js +0 -48
- package/dist/index-7216d6b0.js +0 -175
- package/dist/index-73ce455b.js +0 -264
- package/dist/index-7913ec46.js +0 -239
- package/dist/index-c14450a9.js +0 -662
- package/dist/info-circle-fill-90ec9aa9.js +0 -14
- package/dist/playwright.config.d.ts +0 -9
- package/dist/plugins/auto-import-file.d.ts +0 -0
- package/dist/plugins/load-style.d.ts +0 -6
- package/dist/plugins/load-svg.d.ts +0 -9
- package/dist/tests/button.spec.d.ts +0 -1
- package/dist/umd/build/config.d.ts +0 -3
- package/dist/umd/build/config.es.d.ts +0 -2
- package/dist/umd/build/config.umd.d.ts +0 -2
- package/dist/umd/components/button/index.d.ts +0 -35
- package/dist/umd/components/form/index.d.ts +0 -2
- package/dist/umd/components/icon/index.d.ts +0 -2
- package/dist/umd/components/image/index.d.ts +0 -2
- package/dist/umd/components/input/index.d.ts +0 -185
- package/dist/umd/components/message/index.d.ts +0 -14
- package/dist/umd/components/modal/index.d.ts +0 -2
- package/dist/umd/components/option/index.d.ts +0 -2
- package/dist/umd/components/player/index.d.ts +0 -213
- package/dist/umd/components/preview/colz.d.ts +0 -72
- package/dist/umd/components/preview/docx.d.ts +0 -8
- package/dist/umd/components/preview/excel/excel.d.ts +0 -2
- package/dist/umd/components/preview/excel/index.d.ts +0 -1
- package/dist/umd/components/preview/excel/media.d.ts +0 -37
- package/dist/umd/components/preview/index.d.ts +0 -6
- package/dist/umd/components/preview/pdf.d.ts +0 -1
- package/dist/umd/components/preview/pptx/index.d.ts +0 -16
- package/dist/umd/components/preview/pptx/process_pptx.d.ts +0 -23
- package/dist/umd/components/preview/pptx/t_xml.d.ts +0 -1
- package/dist/umd/components/preview/pptx/worker.d.ts +0 -1
- package/dist/umd/components/progress/index.d.ts +0 -36
- package/dist/umd/components/radar/index.d.ts +0 -2
- package/dist/umd/components/scratch/index.d.ts +0 -19
- package/dist/umd/components/select/index.d.ts +0 -105
- package/dist/umd/components/skeleton/index.d.ts +0 -2
- package/dist/umd/components/tab/index.d.ts +0 -408
- package/dist/umd/components/tabpane/index.d.ts +0 -352
- package/dist/umd/index.d.ts +0 -14
- package/dist/umd/playwright.config.d.ts +0 -9
- package/dist/umd/plugins/auto-import-file.d.ts +0 -0
- package/dist/umd/plugins/load-style.d.ts +0 -6
- package/dist/umd/plugins/load-svg.d.ts +0 -9
- package/dist/umd/tests/button.spec.d.ts +0 -1
- package/dist/umd/utils/image.d.ts +0 -32
- package/dist/umd/utils/index.d.ts +0 -64
- package/dist/umd/utils/math.d.ts +0 -26
- package/dist/umd/utils/tween.d.ts +0 -21
- package/dist/umd/vite.config.d.ts +0 -6
- package/dist/utils/image.d.ts +0 -32
- package/dist/utils/index.d.ts +0 -64
- package/dist/utils/math.d.ts +0 -26
- package/dist/utils/tween.d.ts +0 -21
- package/dist/vendor-f71e6f68.js +0 -92126
- package/dist/vite.config.d.ts +0 -6
- /package/dist/{add-user-b2bed3e7.js → add-user-BN1JlY7e.js} +0 -0
- /package/dist/{book-b11a68eb.js → book-nTEFXU2x.js} +0 -0
- /package/dist/{check-circle-fill-dc284144.js → check-circle-fill-B_pd8ZSs.js} +0 -0
- /package/dist/{check-circle-74bd09c3.js → check-circle-szyAJiap.js} +0 -0
- /package/dist/{close-20925345.js → close-CFnkhudp.js} +0 -0
- /package/dist/{close-circle-720c18be.js → close-circle-CwmuN2C6.js} +0 -0
- /package/dist/{close-circle-fill-238a66b1.js → close-circle-fill-jSqPPw9i.js} +0 -0
- /package/dist/{eye-5e742329.js → eye-D_mEt17f.js} +0 -0
- /package/dist/{eye-close-3874f1ae.js → eye-close-BVr3NJtg.js} +0 -0
- /package/dist/{home-c4a05e8b.js → home-BUQ4USMk.js} +0 -0
- /package/dist/{index-8e1e2573.js → index-CQTJoWhb.js} +0 -0
- /package/dist/{info-circle-5826decc.js → info-circle-COnL5bTJ.js} +0 -0
- /package/dist/{loading-09ca52df.js → loading-Dcc5RApI.js} +0 -0
- /package/dist/{lock-1d2487c9.js → lock-Cr7BnmWN.js} +0 -0
- /package/dist/{message-b2bfdea7.js → message-D36_Zo2l.js} +0 -0
- /package/dist/{power-off-6ade5a91.js → power-off-lQRbiBak.js} +0 -0
- /package/dist/{preview-b291aea8.js → preview-CJbz9GjO.js} +0 -0
- /package/dist/{setting-1e5ccb6d.js → setting-DemlgzVC.js} +0 -0
- /package/dist/{team-ca6a12e1.js → team-tl4NJXPC.js} +0 -0
- /package/dist/{unlock-f56086fd.js → unlock-CeU74z9n.js} +0 -0
- /package/dist/{user-5c01e665.js → user-B-eVXwuk.js} +0 -0
- /package/dist/{warning-circle-035e025c.js → warning-circle-DDUgEDIv.js} +0 -0
- /package/dist/{warning-circle-fill-d17c37c9.js → warning-circle-fill-lODUKz0i.js} +0 -0
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
const noop = () => {
|
|
5
|
+
};
|
|
6
|
+
const currentDevice = () => {
|
|
7
|
+
if (typeof window !== "undefined") {
|
|
8
|
+
const ua = navigator.userAgent.toLowerCase();
|
|
9
|
+
if (/ipad|ipod/.test(ua)) return "ipad";
|
|
10
|
+
if (/android/.test(ua)) return "android";
|
|
11
|
+
if (/iphone/.test(ua)) return "iphone";
|
|
12
|
+
return "pc";
|
|
13
|
+
}
|
|
14
|
+
return "pc";
|
|
15
|
+
};
|
|
16
|
+
const isClient = typeof window !== "undefined";
|
|
17
|
+
const isMobile = () => {
|
|
18
|
+
if (!isClient) return false;
|
|
19
|
+
const ua = window.navigator.userAgent;
|
|
20
|
+
if (/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(ua)) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
25
|
+
const K_sha2 = [
|
|
26
|
+
1116352408,
|
|
27
|
+
1899447441,
|
|
28
|
+
3049323471,
|
|
29
|
+
3921009573,
|
|
30
|
+
961987163,
|
|
31
|
+
1508970993,
|
|
32
|
+
2453635748,
|
|
33
|
+
2870763221,
|
|
34
|
+
3624381080,
|
|
35
|
+
310598401,
|
|
36
|
+
607225278,
|
|
37
|
+
1426881987,
|
|
38
|
+
1925078388,
|
|
39
|
+
2162078206,
|
|
40
|
+
2614888103,
|
|
41
|
+
3248222580,
|
|
42
|
+
3835390401,
|
|
43
|
+
4022224774,
|
|
44
|
+
264347078,
|
|
45
|
+
604807628,
|
|
46
|
+
770255983,
|
|
47
|
+
1249150122,
|
|
48
|
+
1555081692,
|
|
49
|
+
1996064986,
|
|
50
|
+
2554220882,
|
|
51
|
+
2821834349,
|
|
52
|
+
2952996808,
|
|
53
|
+
3210313671,
|
|
54
|
+
3336571891,
|
|
55
|
+
3584528711,
|
|
56
|
+
113926993,
|
|
57
|
+
338241895,
|
|
58
|
+
666307205,
|
|
59
|
+
773529912,
|
|
60
|
+
1294757372,
|
|
61
|
+
1396182291,
|
|
62
|
+
1695183700,
|
|
63
|
+
1986661051,
|
|
64
|
+
2177026350,
|
|
65
|
+
2456956037,
|
|
66
|
+
2730485921,
|
|
67
|
+
2820302411,
|
|
68
|
+
3259730800,
|
|
69
|
+
3345764771,
|
|
70
|
+
3516065817,
|
|
71
|
+
3600352804,
|
|
72
|
+
4094571909,
|
|
73
|
+
275423344,
|
|
74
|
+
430227734,
|
|
75
|
+
506948616,
|
|
76
|
+
659060556,
|
|
77
|
+
883997877,
|
|
78
|
+
958139571,
|
|
79
|
+
1322822218,
|
|
80
|
+
1537002063,
|
|
81
|
+
1747873779,
|
|
82
|
+
1955562222,
|
|
83
|
+
2024104815,
|
|
84
|
+
2227730452,
|
|
85
|
+
2361852424,
|
|
86
|
+
2428436474,
|
|
87
|
+
2756734187,
|
|
88
|
+
3204031479,
|
|
89
|
+
3329325298
|
|
90
|
+
];
|
|
91
|
+
class Int_64 {
|
|
92
|
+
constructor(msint_32, lsint_32) {
|
|
93
|
+
__publicField(this, "highOrder");
|
|
94
|
+
__publicField(this, "lowOrder");
|
|
95
|
+
this.highOrder = msint_32;
|
|
96
|
+
this.lowOrder = lsint_32;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
[
|
|
100
|
+
new Int_64(K_sha2[0], 3609767458),
|
|
101
|
+
new Int_64(K_sha2[1], 602891725),
|
|
102
|
+
new Int_64(K_sha2[2], 3964484399),
|
|
103
|
+
new Int_64(K_sha2[3], 2173295548),
|
|
104
|
+
new Int_64(K_sha2[4], 4081628472),
|
|
105
|
+
new Int_64(K_sha2[5], 3053834265),
|
|
106
|
+
new Int_64(K_sha2[6], 2937671579),
|
|
107
|
+
new Int_64(K_sha2[7], 3664609560),
|
|
108
|
+
new Int_64(K_sha2[8], 2734883394),
|
|
109
|
+
new Int_64(K_sha2[9], 1164996542),
|
|
110
|
+
new Int_64(K_sha2[10], 1323610764),
|
|
111
|
+
new Int_64(K_sha2[11], 3590304994),
|
|
112
|
+
new Int_64(K_sha2[12], 4068182383),
|
|
113
|
+
new Int_64(K_sha2[13], 991336113),
|
|
114
|
+
new Int_64(K_sha2[14], 633803317),
|
|
115
|
+
new Int_64(K_sha2[15], 3479774868),
|
|
116
|
+
new Int_64(K_sha2[16], 2666613458),
|
|
117
|
+
new Int_64(K_sha2[17], 944711139),
|
|
118
|
+
new Int_64(K_sha2[18], 2341262773),
|
|
119
|
+
new Int_64(K_sha2[19], 2007800933),
|
|
120
|
+
new Int_64(K_sha2[20], 1495990901),
|
|
121
|
+
new Int_64(K_sha2[21], 1856431235),
|
|
122
|
+
new Int_64(K_sha2[22], 3175218132),
|
|
123
|
+
new Int_64(K_sha2[23], 2198950837),
|
|
124
|
+
new Int_64(K_sha2[24], 3999719339),
|
|
125
|
+
new Int_64(K_sha2[25], 766784016),
|
|
126
|
+
new Int_64(K_sha2[26], 2566594879),
|
|
127
|
+
new Int_64(K_sha2[27], 3203337956),
|
|
128
|
+
new Int_64(K_sha2[28], 1034457026),
|
|
129
|
+
new Int_64(K_sha2[29], 2466948901),
|
|
130
|
+
new Int_64(K_sha2[30], 3758326383),
|
|
131
|
+
new Int_64(K_sha2[31], 168717936),
|
|
132
|
+
new Int_64(K_sha2[32], 1188179964),
|
|
133
|
+
new Int_64(K_sha2[33], 1546045734),
|
|
134
|
+
new Int_64(K_sha2[34], 1522805485),
|
|
135
|
+
new Int_64(K_sha2[35], 2643833823),
|
|
136
|
+
new Int_64(K_sha2[36], 2343527390),
|
|
137
|
+
new Int_64(K_sha2[37], 1014477480),
|
|
138
|
+
new Int_64(K_sha2[38], 1206759142),
|
|
139
|
+
new Int_64(K_sha2[39], 344077627),
|
|
140
|
+
new Int_64(K_sha2[40], 1290863460),
|
|
141
|
+
new Int_64(K_sha2[41], 3158454273),
|
|
142
|
+
new Int_64(K_sha2[42], 3505952657),
|
|
143
|
+
new Int_64(K_sha2[43], 106217008),
|
|
144
|
+
new Int_64(K_sha2[44], 3606008344),
|
|
145
|
+
new Int_64(K_sha2[45], 1432725776),
|
|
146
|
+
new Int_64(K_sha2[46], 1467031594),
|
|
147
|
+
new Int_64(K_sha2[47], 851169720),
|
|
148
|
+
new Int_64(K_sha2[48], 3100823752),
|
|
149
|
+
new Int_64(K_sha2[49], 1363258195),
|
|
150
|
+
new Int_64(K_sha2[50], 3750685593),
|
|
151
|
+
new Int_64(K_sha2[51], 3785050280),
|
|
152
|
+
new Int_64(K_sha2[52], 3318307427),
|
|
153
|
+
new Int_64(K_sha2[53], 3812723403),
|
|
154
|
+
new Int_64(K_sha2[54], 2003034995),
|
|
155
|
+
new Int_64(K_sha2[55], 3602036899),
|
|
156
|
+
new Int_64(K_sha2[56], 1575990012),
|
|
157
|
+
new Int_64(K_sha2[57], 1125592928),
|
|
158
|
+
new Int_64(K_sha2[58], 2716904306),
|
|
159
|
+
new Int_64(K_sha2[59], 442776044),
|
|
160
|
+
new Int_64(K_sha2[60], 593698344),
|
|
161
|
+
new Int_64(K_sha2[61], 3733110249),
|
|
162
|
+
new Int_64(K_sha2[62], 2999351573),
|
|
163
|
+
new Int_64(K_sha2[63], 3815920427),
|
|
164
|
+
new Int_64(3391569614, 3928383900),
|
|
165
|
+
new Int_64(3515267271, 566280711),
|
|
166
|
+
new Int_64(3940187606, 3454069534),
|
|
167
|
+
new Int_64(4118630271, 4000239992),
|
|
168
|
+
new Int_64(116418474, 1914138554),
|
|
169
|
+
new Int_64(174292421, 2731055270),
|
|
170
|
+
new Int_64(289380356, 3203993006),
|
|
171
|
+
new Int_64(460393269, 320620315),
|
|
172
|
+
new Int_64(685471733, 587496836),
|
|
173
|
+
new Int_64(852142971, 1086792851),
|
|
174
|
+
new Int_64(1017036298, 365543100),
|
|
175
|
+
new Int_64(1126000580, 2618297676),
|
|
176
|
+
new Int_64(1288033470, 3409855158),
|
|
177
|
+
new Int_64(1501505948, 4234509866),
|
|
178
|
+
new Int_64(1607167915, 987167468),
|
|
179
|
+
new Int_64(1816402316, 1246189591)
|
|
180
|
+
];
|
|
181
|
+
[
|
|
182
|
+
new Int_64(0, 1),
|
|
183
|
+
new Int_64(0, 32898),
|
|
184
|
+
new Int_64(2147483648, 32906),
|
|
185
|
+
new Int_64(2147483648, 2147516416),
|
|
186
|
+
new Int_64(0, 32907),
|
|
187
|
+
new Int_64(0, 2147483649),
|
|
188
|
+
new Int_64(2147483648, 2147516545),
|
|
189
|
+
new Int_64(2147483648, 32777),
|
|
190
|
+
new Int_64(0, 138),
|
|
191
|
+
new Int_64(0, 136),
|
|
192
|
+
new Int_64(0, 2147516425),
|
|
193
|
+
new Int_64(0, 2147483658),
|
|
194
|
+
new Int_64(0, 2147516555),
|
|
195
|
+
new Int_64(2147483648, 139),
|
|
196
|
+
new Int_64(2147483648, 32905),
|
|
197
|
+
new Int_64(2147483648, 32771),
|
|
198
|
+
new Int_64(2147483648, 32770),
|
|
199
|
+
new Int_64(2147483648, 128),
|
|
200
|
+
new Int_64(0, 32778),
|
|
201
|
+
new Int_64(2147483648, 2147483658),
|
|
202
|
+
new Int_64(2147483648, 2147516545),
|
|
203
|
+
new Int_64(2147483648, 32896),
|
|
204
|
+
new Int_64(0, 2147483649),
|
|
205
|
+
new Int_64(2147483648, 2147516424)
|
|
206
|
+
];
|
|
207
|
+
function formatDuration(time) {
|
|
208
|
+
return time < 10 ? `0${time}` : time;
|
|
209
|
+
}
|
|
210
|
+
function timestampToTime(timestamp) {
|
|
211
|
+
let date = /* @__PURE__ */ new Date();
|
|
212
|
+
if (timestamp) {
|
|
213
|
+
date = new Date(timestamp);
|
|
214
|
+
}
|
|
215
|
+
date.format = (format = "YYYY-MM-DD HH:mm:ss") => {
|
|
216
|
+
const year = date.getFullYear();
|
|
217
|
+
const month = formatDuration(date.getMonth() + 1);
|
|
218
|
+
const day = formatDuration(date.getDate());
|
|
219
|
+
const hour = formatDuration(date.getHours());
|
|
220
|
+
const minute = formatDuration(date.getMinutes());
|
|
221
|
+
const second = formatDuration(date.getSeconds());
|
|
222
|
+
return format.replace(/Y+/gi, `${year}`).replace(/M+/g, `${month}`).replace(/D+/gi, `${day}`).replace(/H+/gi, `${hour}`).replace(/m+/g, `${minute}`).replace(/S+/gi, `${second}`);
|
|
223
|
+
};
|
|
224
|
+
return date;
|
|
225
|
+
}
|
|
226
|
+
const timeFormat = (time) => {
|
|
227
|
+
if (time === 0) return "00:00";
|
|
228
|
+
if (!time) return "";
|
|
229
|
+
const hour = Math.trunc(time / 3600);
|
|
230
|
+
const minute = Math.trunc(time % 3600 / 60);
|
|
231
|
+
const second = formatDuration(Math.trunc(time - hour * 3600 - minute * 60));
|
|
232
|
+
if (hour === 0) {
|
|
233
|
+
return `${formatDuration(minute)}:${second}`;
|
|
234
|
+
}
|
|
235
|
+
return `${formatDuration(hour)}:${formatDuration(minute)}:${second}`;
|
|
236
|
+
};
|
|
237
|
+
const getPixelRatio = (context) => {
|
|
238
|
+
const backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || 1;
|
|
239
|
+
return (isClient && window.devicePixelRatio || 1) / backingStore;
|
|
240
|
+
};
|
|
241
|
+
const addClassToElement = (element, addClass) => {
|
|
242
|
+
if (typeof document === "undefined") return void 0;
|
|
243
|
+
const classList = element.classList;
|
|
244
|
+
if (!classList.contains(addClass)) {
|
|
245
|
+
classList.add(addClass);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const removeClassToElement = (element, removeClass) => {
|
|
249
|
+
if (typeof document === "undefined") return void 0;
|
|
250
|
+
const classList = element.classList;
|
|
251
|
+
if (classList.contains(removeClass)) {
|
|
252
|
+
classList.remove(removeClass);
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
const createDocumentFragment = (list) => {
|
|
256
|
+
if (typeof document === "undefined") return void 0;
|
|
257
|
+
const Fragment = document.createDocumentFragment();
|
|
258
|
+
list.forEach((item) => Fragment.appendChild(item));
|
|
259
|
+
return Fragment;
|
|
260
|
+
};
|
|
261
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
262
|
+
const SVG_TAG_NAMES = [
|
|
263
|
+
"svg",
|
|
264
|
+
"path",
|
|
265
|
+
"g",
|
|
266
|
+
"circle",
|
|
267
|
+
"rect",
|
|
268
|
+
"line",
|
|
269
|
+
"polyline",
|
|
270
|
+
"polygon",
|
|
271
|
+
"ellipse",
|
|
272
|
+
"text",
|
|
273
|
+
"tspan",
|
|
274
|
+
"textPath",
|
|
275
|
+
"defs",
|
|
276
|
+
"marker",
|
|
277
|
+
"radialGradient",
|
|
278
|
+
"stop",
|
|
279
|
+
"linearGradient",
|
|
280
|
+
"clipPath",
|
|
281
|
+
"mask",
|
|
282
|
+
"pattern",
|
|
283
|
+
"image",
|
|
284
|
+
"use",
|
|
285
|
+
"symbol",
|
|
286
|
+
"foreignObject",
|
|
287
|
+
"feGaussianBlur",
|
|
288
|
+
"feColorMatrix"
|
|
289
|
+
];
|
|
290
|
+
class Chain {
|
|
291
|
+
constructor(tagName, options) {
|
|
292
|
+
__publicField(this, "listener");
|
|
293
|
+
__publicField(this, "element");
|
|
294
|
+
__publicField(this, "create", (tagName2, options2) => {
|
|
295
|
+
if (SVG_TAG_NAMES.includes(tagName2)) {
|
|
296
|
+
return document.createElementNS(SVG_NS, tagName2, options2);
|
|
297
|
+
}
|
|
298
|
+
return document.createElement(tagName2, options2);
|
|
299
|
+
});
|
|
300
|
+
__publicField(this, "setAttribute", (name, value) => {
|
|
301
|
+
this.element.setAttribute(name, value);
|
|
302
|
+
return this;
|
|
303
|
+
});
|
|
304
|
+
__publicField(this, "removeAttribute", (name) => {
|
|
305
|
+
this.element.removeAttribute(name);
|
|
306
|
+
return this;
|
|
307
|
+
});
|
|
308
|
+
__publicField(this, "append", (child) => {
|
|
309
|
+
this.element.appendChild(child);
|
|
310
|
+
return this;
|
|
311
|
+
});
|
|
312
|
+
__publicField(this, "remove", (child) => {
|
|
313
|
+
this.element.removeChild(child);
|
|
314
|
+
return this;
|
|
315
|
+
});
|
|
316
|
+
__publicField(this, "setTextContent", (text) => {
|
|
317
|
+
this.element.textContent = text;
|
|
318
|
+
return this;
|
|
319
|
+
});
|
|
320
|
+
__publicField(this, "setStyle", (name, value) => {
|
|
321
|
+
this.element.style.setProperty(name, value);
|
|
322
|
+
return this;
|
|
323
|
+
});
|
|
324
|
+
__publicField(this, "addElementByType", (item, parent) => {
|
|
325
|
+
if (item instanceof Chain) {
|
|
326
|
+
parent.appendChild(item.element);
|
|
327
|
+
}
|
|
328
|
+
if (item instanceof HTMLElement) {
|
|
329
|
+
parent.appendChild(item);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
__publicField(this, "addChild", (child) => {
|
|
333
|
+
if (Array.isArray(child)) {
|
|
334
|
+
const Fragment = document.createDocumentFragment();
|
|
335
|
+
child.forEach((item) => {
|
|
336
|
+
this.addElementByType(item, Fragment);
|
|
337
|
+
});
|
|
338
|
+
this.element.appendChild(Fragment);
|
|
339
|
+
} else {
|
|
340
|
+
this.addElementByType(child, this.element);
|
|
341
|
+
}
|
|
342
|
+
return this;
|
|
343
|
+
});
|
|
344
|
+
__publicField(this, "listen", (type, listener, options2) => {
|
|
345
|
+
let event = this.listener.get(type);
|
|
346
|
+
if (!event) {
|
|
347
|
+
event = /* @__PURE__ */ new Map();
|
|
348
|
+
this.listener.set(type, event);
|
|
349
|
+
}
|
|
350
|
+
const value = event.get(listener.name);
|
|
351
|
+
if (value === listener) {
|
|
352
|
+
console.warn(`${value.name} listener has been added to ${type} event, please remove it first.`);
|
|
353
|
+
}
|
|
354
|
+
this.element.addEventListener(type, listener, options2);
|
|
355
|
+
event.set(listener.name, listener);
|
|
356
|
+
return this;
|
|
357
|
+
});
|
|
358
|
+
__publicField(this, "clearListener", (type, listener, options2) => {
|
|
359
|
+
this.element.removeEventListener(type, listener, options2);
|
|
360
|
+
const event = this.listener.get(type);
|
|
361
|
+
if (event) {
|
|
362
|
+
event.delete(listener.name);
|
|
363
|
+
} else {
|
|
364
|
+
console.warn(`No ${type} event listener has been added.`);
|
|
365
|
+
}
|
|
366
|
+
return this;
|
|
367
|
+
});
|
|
368
|
+
__publicField(this, "clearAllListener", () => {
|
|
369
|
+
for (const [key, value] of this.listener) {
|
|
370
|
+
for (const [k2, v2] of value) {
|
|
371
|
+
this.element.removeEventListener(key, v2);
|
|
372
|
+
value.delete(k2);
|
|
373
|
+
}
|
|
374
|
+
this.listener.delete(key);
|
|
375
|
+
}
|
|
376
|
+
return this;
|
|
377
|
+
});
|
|
378
|
+
this.element = this.create(tagName, options);
|
|
379
|
+
this.listener = /* @__PURE__ */ new Map();
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const create = (tagName, options) => {
|
|
383
|
+
return new Chain(tagName, options);
|
|
384
|
+
};
|
|
385
|
+
const generateThrottle = () => {
|
|
386
|
+
let timer;
|
|
387
|
+
return function(fn, wait = 300) {
|
|
388
|
+
return function(...args) {
|
|
389
|
+
if (timer) {
|
|
390
|
+
clearTimeout(timer);
|
|
391
|
+
timer = void 0;
|
|
392
|
+
}
|
|
393
|
+
const context = this;
|
|
394
|
+
if (!timer) {
|
|
395
|
+
timer = setTimeout(() => {
|
|
396
|
+
fn.apply(context, args);
|
|
397
|
+
clearTimeout(timer);
|
|
398
|
+
timer = void 0;
|
|
399
|
+
}, wait);
|
|
400
|
+
}
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
const codes = /* @__PURE__ */ new Map([
|
|
405
|
+
[100, "Continue"],
|
|
406
|
+
[101, "Switching Protocols"],
|
|
407
|
+
[102, "Processing"],
|
|
408
|
+
[103, "Early Hints"],
|
|
409
|
+
[200, "OK"],
|
|
410
|
+
[201, "Created"],
|
|
411
|
+
[202, "Accepted"],
|
|
412
|
+
[203, "Non-Authoritative Information"],
|
|
413
|
+
[204, "No Content"],
|
|
414
|
+
[205, "Reset Content"],
|
|
415
|
+
[206, "Partial Content"],
|
|
416
|
+
[207, "Multi-Status"],
|
|
417
|
+
[208, "Already Reported"],
|
|
418
|
+
[226, "IM Used"],
|
|
419
|
+
[300, "Multiple Choices"],
|
|
420
|
+
[301, "Moved Permanently"],
|
|
421
|
+
[302, "Found"],
|
|
422
|
+
[303, "See Other"],
|
|
423
|
+
[304, "Not Modified"],
|
|
424
|
+
[305, "Use Proxy"],
|
|
425
|
+
[307, "Temporary Redirect"],
|
|
426
|
+
[308, "Permanent Redirect"],
|
|
427
|
+
[400, "Bad Request"],
|
|
428
|
+
[401, "Unauthorized"],
|
|
429
|
+
[402, "Payment Required"],
|
|
430
|
+
[403, "Forbidden"],
|
|
431
|
+
[404, "Not Found"],
|
|
432
|
+
[405, "Method Not Allowed"],
|
|
433
|
+
[406, "Not Acceptable"],
|
|
434
|
+
[407, "Proxy Authentication Required"],
|
|
435
|
+
[408, "Request Timeout"],
|
|
436
|
+
[409, "Conflict"],
|
|
437
|
+
[410, "Gone"],
|
|
438
|
+
[411, "Length Required"],
|
|
439
|
+
[412, "Precondition Failed"],
|
|
440
|
+
[413, "Payload Too Large"],
|
|
441
|
+
[414, "URI Too Long"],
|
|
442
|
+
[415, "Unsupported Media Type"],
|
|
443
|
+
[416, "Range Not Satisfiable"],
|
|
444
|
+
[417, "Expectation Failed"],
|
|
445
|
+
[418, "I'm a Teapot"],
|
|
446
|
+
[421, "Misdirected Request"],
|
|
447
|
+
[422, "Unprocessable Entity"],
|
|
448
|
+
[423, "Locked"],
|
|
449
|
+
[424, "Failed Dependency"],
|
|
450
|
+
[425, "Too Early"],
|
|
451
|
+
[426, "Upgrade Required"],
|
|
452
|
+
[428, "Precondition Required"],
|
|
453
|
+
[429, "Too Many Requests"],
|
|
454
|
+
[431, "Request Header Fields Too Large"],
|
|
455
|
+
[451, "Unavailable For Legal Reasons"],
|
|
456
|
+
[500, "Internal Server Error"],
|
|
457
|
+
[501, "Not Implemented"],
|
|
458
|
+
[502, "Bad Gateway"],
|
|
459
|
+
[503, "Service Unavailable"],
|
|
460
|
+
[504, "Gateway Timeout"],
|
|
461
|
+
[505, "HTTP Version Not Supported"],
|
|
462
|
+
[506, "Variant Also Negotiates"],
|
|
463
|
+
[507, "Insufficient Storage"],
|
|
464
|
+
[508, "Loop Detected"],
|
|
465
|
+
[509, "Bandwidth Limit Exceeded"],
|
|
466
|
+
[510, "Not Extended"],
|
|
467
|
+
[511, "Network Authentication Required"]
|
|
468
|
+
]);
|
|
469
|
+
({
|
|
470
|
+
// status code to message map
|
|
471
|
+
message: codes,
|
|
472
|
+
// status message (lower-case) to code map
|
|
473
|
+
code: createMessageToStatusCodeMap(codes),
|
|
474
|
+
// array of status codes
|
|
475
|
+
codes: createStatusCodeList(codes),
|
|
476
|
+
// status codes for redirects
|
|
477
|
+
redirect: {
|
|
478
|
+
300: true,
|
|
479
|
+
301: true,
|
|
480
|
+
302: true,
|
|
481
|
+
303: true,
|
|
482
|
+
305: true,
|
|
483
|
+
307: true,
|
|
484
|
+
308: true
|
|
485
|
+
},
|
|
486
|
+
// status codes for empty bodies
|
|
487
|
+
empty: {
|
|
488
|
+
204: true,
|
|
489
|
+
205: true,
|
|
490
|
+
304: true
|
|
491
|
+
},
|
|
492
|
+
// status codes for when you should retry the request
|
|
493
|
+
retry: {
|
|
494
|
+
502: true,
|
|
495
|
+
503: true,
|
|
496
|
+
504: true
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
function createMessageToStatusCodeMap(codes2) {
|
|
500
|
+
const map = /* @__PURE__ */ new Map();
|
|
501
|
+
for (const [status2, message] of codes2) {
|
|
502
|
+
map.set(message.toLowerCase(), status2);
|
|
503
|
+
}
|
|
504
|
+
return map;
|
|
505
|
+
}
|
|
506
|
+
function createStatusCodeList(codes2) {
|
|
507
|
+
const codeList = [];
|
|
508
|
+
for (const [status2, _] of codes2) {
|
|
509
|
+
codeList.push(status2);
|
|
510
|
+
}
|
|
511
|
+
return codeList;
|
|
512
|
+
}
|
|
513
|
+
const perToNum = (str = "") => {
|
|
514
|
+
if (str.length === 0) return 0;
|
|
515
|
+
if (str.endsWith("%")) {
|
|
516
|
+
const value = Number(str.replace("%", ""));
|
|
517
|
+
return value > 1 ? value / 100 : value;
|
|
518
|
+
} else {
|
|
519
|
+
return Number(str);
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
const range = (num, min = 0, max = 1) => {
|
|
523
|
+
return Math.min(max, Math.max(min, num));
|
|
524
|
+
};
|
|
525
|
+
const _Mathjs = class _Mathjs2 {
|
|
526
|
+
constructor() {
|
|
527
|
+
__publicField(this, "getDecimalLength", (n2) => {
|
|
528
|
+
const [_, decimal] = n2.toString().split(".");
|
|
529
|
+
return decimal ? decimal.length : 0;
|
|
530
|
+
});
|
|
531
|
+
__publicField(this, "amend", (n2, precision = 15) => parseFloat(Number(n2).toPrecision(precision)));
|
|
532
|
+
__publicField(this, "power", (a2, b2) => Math.pow(10, Math.max(this.getDecimalLength(a2), this.getDecimalLength(b2))));
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
__publicField(_Mathjs, "handleMethod", (l2, r2) => {
|
|
536
|
+
const mathjs2 = new _Mathjs();
|
|
537
|
+
const { power, amend } = mathjs2;
|
|
538
|
+
const pow = power(l2, r2);
|
|
539
|
+
const a2 = amend(l2 * pow);
|
|
540
|
+
const b2 = amend(r2 * pow);
|
|
541
|
+
return (type) => {
|
|
542
|
+
switch (type) {
|
|
543
|
+
case "+":
|
|
544
|
+
return (a2 + b2) / pow;
|
|
545
|
+
case "-":
|
|
546
|
+
return (a2 - b2) / pow;
|
|
547
|
+
case "*":
|
|
548
|
+
return a2 * b2 / (pow * pow);
|
|
549
|
+
case "/":
|
|
550
|
+
return a2 / b2;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
});
|
|
554
|
+
__publicField(_Mathjs, "add", (a2, b2) => {
|
|
555
|
+
return _Mathjs.handleMethod(a2, b2)("+");
|
|
556
|
+
});
|
|
557
|
+
__publicField(_Mathjs, "divide", (a2, b2) => {
|
|
558
|
+
return _Mathjs.handleMethod(a2, b2)("/");
|
|
559
|
+
});
|
|
560
|
+
__publicField(_Mathjs, "multiply", (a2, b2) => {
|
|
561
|
+
return _Mathjs.handleMethod(a2, b2)("*");
|
|
562
|
+
});
|
|
563
|
+
__publicField(_Mathjs, "subtract", (a2, b2) => {
|
|
564
|
+
return _Mathjs.handleMethod(a2, b2)("-");
|
|
565
|
+
});
|
|
566
|
+
const NEW_LISTENER = "NEW_LISTENER";
|
|
567
|
+
class SyncHook {
|
|
568
|
+
constructor() {
|
|
569
|
+
__publicField(this, "_events");
|
|
570
|
+
__publicField(this, "tap", (eventName, eventItem) => {
|
|
571
|
+
if (this._events[eventName] && eventName !== Symbol.for(NEW_LISTENER)) {
|
|
572
|
+
this.call(Symbol.for(NEW_LISTENER), eventName);
|
|
573
|
+
}
|
|
574
|
+
const callbacks = this._events[eventName] || [];
|
|
575
|
+
if (typeof eventItem === "function") {
|
|
576
|
+
callbacks.push({
|
|
577
|
+
name: eventName,
|
|
578
|
+
callback: eventItem
|
|
579
|
+
});
|
|
580
|
+
} else {
|
|
581
|
+
callbacks.push(eventItem);
|
|
582
|
+
}
|
|
583
|
+
this._events[eventName] = callbacks;
|
|
584
|
+
return this;
|
|
585
|
+
});
|
|
586
|
+
__publicField(this, "call", (eventName, ...args) => {
|
|
587
|
+
const callbacks = this._events[eventName] || [];
|
|
588
|
+
callbacks.forEach((item) => {
|
|
589
|
+
const { callback } = item;
|
|
590
|
+
callback(...args);
|
|
591
|
+
});
|
|
592
|
+
});
|
|
593
|
+
__publicField(this, "callSync", async (eventName, ...args) => {
|
|
594
|
+
const callbacks = this._events[eventName] || [];
|
|
595
|
+
for (const item of callbacks) {
|
|
596
|
+
const { callback } = item;
|
|
597
|
+
await callback(...args);
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
__publicField(this, "once", (eventName, eventItem) => {
|
|
601
|
+
let one;
|
|
602
|
+
if (typeof eventItem === "function") {
|
|
603
|
+
one = {
|
|
604
|
+
name: eventName,
|
|
605
|
+
callback: (...args) => {
|
|
606
|
+
eventItem(...args);
|
|
607
|
+
this.off(eventName, one);
|
|
608
|
+
},
|
|
609
|
+
initialCallback: eventItem
|
|
610
|
+
};
|
|
611
|
+
} else {
|
|
612
|
+
const { callback } = eventItem;
|
|
613
|
+
one = {
|
|
614
|
+
name: eventName,
|
|
615
|
+
callback: (...args) => {
|
|
616
|
+
callback(...args);
|
|
617
|
+
this.off(eventName, one);
|
|
618
|
+
},
|
|
619
|
+
initialCallback: callback
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
this.tap(eventName, one);
|
|
623
|
+
return this;
|
|
624
|
+
});
|
|
625
|
+
__publicField(this, "off", (eventName, eventItem) => {
|
|
626
|
+
const callbacks = this._events[eventName] || [];
|
|
627
|
+
const newCallbacks = callbacks.filter((item) => {
|
|
628
|
+
if (typeof eventItem === "function") {
|
|
629
|
+
return item.callback !== eventItem && item.initialCallback !== eventItem;
|
|
630
|
+
} else {
|
|
631
|
+
const { callback } = eventItem;
|
|
632
|
+
return item.callback !== callback && item.initialCallback !== callback;
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
this._events[eventName] = newCallbacks;
|
|
636
|
+
return this;
|
|
637
|
+
});
|
|
638
|
+
this._events = {};
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
const arrowDown = { "success": true, "_identification": true, "data": '<svg viewBox="0 0 1024 1024" width="200" height="200" version="1.1"\n fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path\n d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path>\n</svg>' };
|
|
642
|
+
const arrowDown$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
643
|
+
__proto__: null,
|
|
644
|
+
default: arrowDown
|
|
645
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
646
|
+
export {
|
|
647
|
+
SyncHook as S,
|
|
648
|
+
addClassToElement as a,
|
|
649
|
+
currentDevice as b,
|
|
650
|
+
create as c,
|
|
651
|
+
createDocumentFragment as d,
|
|
652
|
+
range as e,
|
|
653
|
+
generateThrottle as f,
|
|
654
|
+
getPixelRatio as g,
|
|
655
|
+
timestampToTime as h,
|
|
656
|
+
isMobile as i,
|
|
657
|
+
arrowDown$1 as j,
|
|
658
|
+
noop as n,
|
|
659
|
+
perToNum as p,
|
|
660
|
+
removeClassToElement as r,
|
|
661
|
+
timeFormat as t
|
|
662
|
+
};
|
package/dist/button.js
ADDED
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./arrow-down-B_hCY3Wt.js";
|
|
2
|
+
import "./index-DC5EA657.js";
|
|
3
|
+
import { C, a } from "./index-CiWwvEMM.js";
|
|
4
|
+
import "./index-D4y9c1Dj.js";
|
|
5
|
+
import "./index-WfFw4LJT.js";
|
|
6
|
+
import "./selectShadowless.js";
|
|
7
|
+
import "./index-15M0olqa.js";
|
|
8
|
+
export {
|
|
9
|
+
C as ColorPicker,
|
|
10
|
+
a as default
|
|
11
|
+
};
|