reykit 1.0.168 → 1.0.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +52 -33
- package/dist/src/index.d.ts +3 -2
- package/dist/src/lib/base.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49932,11 +49932,20 @@ const fk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
49932
49932
|
function dk() {
|
|
49933
49933
|
document.documentElement.classList.add("debug");
|
|
49934
49934
|
}
|
|
49935
|
-
|
|
49935
|
+
function pk(a) {
|
|
49936
|
+
try {
|
|
49937
|
+
const i = new URL(a);
|
|
49938
|
+
return i.protocol === "http:" || i.protocol === "https:";
|
|
49939
|
+
} catch {
|
|
49940
|
+
return !1;
|
|
49941
|
+
}
|
|
49942
|
+
}
|
|
49943
|
+
const mk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
49936
49944
|
__proto__: null,
|
|
49937
|
-
debugCss: dk
|
|
49945
|
+
debugCss: dk,
|
|
49946
|
+
isUrl: pk
|
|
49938
49947
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
49939
|
-
class
|
|
49948
|
+
class hk {
|
|
49940
49949
|
/**
|
|
49941
49950
|
* Build instance.
|
|
49942
49951
|
*
|
|
@@ -50037,9 +50046,9 @@ function A4(a, i) {
|
|
|
50037
50046
|
const u = a instanceof Blob ? window.URL.createObjectURL(a) : a, d = document.createElement("a");
|
|
50038
50047
|
d.download = i, d.href = u, d.style.display = "none", document.body.appendChild(d), d.click(), d.remove(), a instanceof Blob && URL.revokeObjectURL(u);
|
|
50039
50048
|
}
|
|
50040
|
-
const
|
|
50049
|
+
const gk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50041
50050
|
__proto__: null,
|
|
50042
|
-
Storager:
|
|
50051
|
+
Storager: hk,
|
|
50043
50052
|
downloadFile: A4,
|
|
50044
50053
|
openFile: M4
|
|
50045
50054
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -50047,15 +50056,15 @@ async function cR(a, i) {
|
|
|
50047
50056
|
const u = i && i.width, d = (i && i.margin) ?? 0;
|
|
50048
50057
|
return await Uj.toDataURL(a, { width: u, margin: d });
|
|
50049
50058
|
}
|
|
50050
|
-
async function
|
|
50059
|
+
async function vk(a, i) {
|
|
50051
50060
|
const u = await cR(a, i), m = await (await fetch(u)).blob();
|
|
50052
50061
|
return M4(m), u;
|
|
50053
50062
|
}
|
|
50054
|
-
async function
|
|
50063
|
+
async function yk(a, i) {
|
|
50055
50064
|
const u = await cR(a, i), d = (i && i.fileName) ?? "qrcode.png", g = await (await fetch(u)).blob();
|
|
50056
50065
|
return A4(g, d), u;
|
|
50057
50066
|
}
|
|
50058
|
-
async function
|
|
50067
|
+
async function bk(a, i, u) {
|
|
50059
50068
|
const d = await cR(a, u);
|
|
50060
50069
|
if (typeof i == "string") {
|
|
50061
50070
|
const m = document.getElementById(i);
|
|
@@ -50064,14 +50073,14 @@ async function yk(a, i, u) {
|
|
|
50064
50073
|
}
|
|
50065
50074
|
return i.setAttribute("src", d), d;
|
|
50066
50075
|
}
|
|
50067
|
-
const
|
|
50076
|
+
const xk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50068
50077
|
__proto__: null,
|
|
50069
|
-
downloadQrcode:
|
|
50078
|
+
downloadQrcode: yk,
|
|
50070
50079
|
getQrcode: cR,
|
|
50071
|
-
openQrcode:
|
|
50072
|
-
setQrcode:
|
|
50080
|
+
openQrcode: vk,
|
|
50081
|
+
setQrcode: bk
|
|
50073
50082
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
50074
|
-
async function
|
|
50083
|
+
async function Sk(a, i) {
|
|
50075
50084
|
let {
|
|
50076
50085
|
params: u,
|
|
50077
50086
|
body: d,
|
|
@@ -50106,38 +50115,48 @@ async function xk(a, i) {
|
|
|
50106
50115
|
}
|
|
50107
50116
|
return C;
|
|
50108
50117
|
}
|
|
50109
|
-
const
|
|
50118
|
+
const Ek = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50119
|
+
__proto__: null,
|
|
50120
|
+
request: Sk
|
|
50121
|
+
}, Symbol.toStringTag, { value: "Module" })), Rk = /^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, Tk = /^https?:\/\/[^\s/$.?#].[^\s]*$/, Ck = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/, Ok = /^1[3-9]\d{9}$/, wk = /^[\u4e00-\u9fa5]+$/, Nk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50110
50122
|
__proto__: null,
|
|
50111
|
-
|
|
50112
|
-
|
|
50123
|
+
PATTERN_CN: wk,
|
|
50124
|
+
PATTERN_EMAIL: Ck,
|
|
50125
|
+
PATTERN_IP: Rk,
|
|
50126
|
+
PATTERN_PHONE: Ok,
|
|
50127
|
+
PATTERN_URL: Tk
|
|
50128
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
50129
|
+
function Mk() {
|
|
50130
|
+
const a = /* @__PURE__ */ new Date();
|
|
50131
|
+
return a.getFullYear() + "-" + String(a.getMonth() + 1).padStart(2, "0") + "-" + String(a.getDate()).padStart(2, "0") + "T" + String(a.getHours()).padStart(2, "0") + ":" + String(a.getMinutes()).padStart(2, "0");
|
|
50132
|
+
}
|
|
50133
|
+
const Ak = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
50113
50134
|
__proto__: null,
|
|
50114
|
-
|
|
50115
|
-
|
|
50116
|
-
PATTERN_IP: Ek,
|
|
50117
|
-
PATTERN_PHONE: Ck,
|
|
50118
|
-
PATTERN_URL: Rk
|
|
50119
|
-
}, Symbol.toStringTag, { value: "Module" })), qk = {
|
|
50135
|
+
datetimeLocal: Mk
|
|
50136
|
+
}, Symbol.toStringTag, { value: "Module" })), Qk = {
|
|
50120
50137
|
component: fk,
|
|
50121
50138
|
ui: C4,
|
|
50122
|
-
base:
|
|
50139
|
+
base: mk,
|
|
50123
50140
|
data: lk,
|
|
50124
|
-
image:
|
|
50125
|
-
net:
|
|
50126
|
-
re:
|
|
50141
|
+
image: xk,
|
|
50142
|
+
net: Ek,
|
|
50143
|
+
re: Nk,
|
|
50127
50144
|
react: Xj,
|
|
50145
|
+
time: Ak,
|
|
50128
50146
|
twc: C6,
|
|
50129
|
-
window:
|
|
50147
|
+
window: gk
|
|
50130
50148
|
};
|
|
50131
50149
|
export {
|
|
50132
|
-
|
|
50150
|
+
mk as base,
|
|
50133
50151
|
fk as component,
|
|
50134
50152
|
lk as data,
|
|
50135
|
-
|
|
50136
|
-
|
|
50137
|
-
|
|
50138
|
-
|
|
50153
|
+
Qk as default,
|
|
50154
|
+
xk as image,
|
|
50155
|
+
Ek as net,
|
|
50156
|
+
Nk as re,
|
|
50139
50157
|
Xj as react,
|
|
50158
|
+
Ak as time,
|
|
50140
50159
|
C6 as twc,
|
|
50141
50160
|
C4 as ui,
|
|
50142
|
-
|
|
50161
|
+
gk as window
|
|
50143
50162
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { base, data, image, net, re, react, twc, window } from './lib';
|
|
1
|
+
import { base, data, image, net, re, react, time, twc, window } from './lib';
|
|
2
2
|
/**
|
|
3
3
|
* @Time : 2026-03-11
|
|
4
4
|
* @Author : Rey
|
|
@@ -16,8 +16,9 @@ declare const _default: {
|
|
|
16
16
|
net: typeof net;
|
|
17
17
|
re: typeof re;
|
|
18
18
|
react: typeof react;
|
|
19
|
+
time: typeof time;
|
|
19
20
|
twc: typeof twc;
|
|
20
21
|
window: typeof window;
|
|
21
22
|
};
|
|
22
23
|
export default _default;
|
|
23
|
-
export { component, ui, base, data, image, net, re, react, twc, window };
|
|
24
|
+
export { component, ui, base, data, image, net, re, react, time, twc, window };
|
package/dist/src/lib/base.d.ts
CHANGED
|
@@ -13,3 +13,10 @@ export type KeyByValue<T, V> = {
|
|
|
13
13
|
* Start debug CSS style, need to import 'reykit/debug' CSS style first.
|
|
14
14
|
*/
|
|
15
15
|
export declare function debugCss(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Judge whether value is a URL.
|
|
18
|
+
*
|
|
19
|
+
* @param value - Value.
|
|
20
|
+
* @returns Judgement result.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isUrl(value: string): boolean;
|