persagy-vant 0.0.53 → 0.0.54
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/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/lang/en-US.d.ts +9 -0
- package/es/locale/lang/en-US.mjs +9 -0
- package/es/locale/lang/zh-CN.d.ts +9 -0
- package/es/locale/lang/zh-CN.mjs +9 -0
- package/es/locale/lang/zh-TW.d.ts +9 -0
- package/es/locale/lang/zh-TW.mjs +9 -0
- package/es/qr-scanner/QrScanner.d.ts +18 -1
- package/es/qr-scanner/QrScanner.mjs +141 -18
- package/es/qr-scanner/decoder.d.ts +3 -3
- package/es/qr-scanner/decoder.mjs +99 -27
- package/es/qr-scanner/function-call.d.ts +13 -1
- package/es/qr-scanner/function-call.mjs +5 -0
- package/es/qr-scanner/index.d.ts +1 -1
- package/es/qr-scanner/startup.d.ts +3 -0
- package/es/qr-scanner/startup.mjs +33 -0
- package/es/qr-scanner/types.d.ts +16 -1
- package/lib/{decoder-8f5b00db.js → decoder-03a4b162.js} +112 -34
- package/lib/{decoder-a36ba9ae.mjs → decoder-9637718d.mjs} +112 -34
- package/lib/index-d68a26ab.mjs +22968 -0
- package/lib/index-ea574b22.js +22967 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/en-US.d.ts +9 -0
- package/lib/locale/lang/en-US.js +9 -0
- package/lib/locale/lang/zh-CN.d.ts +9 -0
- package/lib/locale/lang/zh-CN.js +9 -0
- package/lib/locale/lang/zh-TW.d.ts +9 -0
- package/lib/locale/lang/zh-TW.js +9 -0
- package/lib/qr-scanner/QrScanner.d.ts +18 -1
- package/lib/qr-scanner/QrScanner.js +141 -18
- package/lib/qr-scanner/decoder.d.ts +3 -3
- package/lib/qr-scanner/decoder.js +94 -26
- package/lib/qr-scanner/function-call.d.ts +13 -1
- package/lib/qr-scanner/function-call.js +5 -0
- package/lib/qr-scanner/index.d.ts +1 -1
- package/lib/qr-scanner/startup.d.ts +3 -0
- package/lib/qr-scanner/startup.js +52 -0
- package/lib/qr-scanner/types.d.ts +16 -1
- package/lib/vant.cjs.js +131 -22802
- package/lib/vant.es.js +131 -22802
- package/lib/vant.js +372 -137
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,11 @@ declare const QrScanner: {
|
|
|
17
17
|
type: import("vue").PropType<string>;
|
|
18
18
|
default: string;
|
|
19
19
|
};
|
|
20
|
+
startupTimeout: {
|
|
21
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
22
|
+
default: number;
|
|
23
|
+
};
|
|
24
|
+
startupTexts: import("vue").PropType<Partial<Record<"camera" | "preview" | "decoder", string>>>;
|
|
20
25
|
formats: {
|
|
21
26
|
type: import("vue").PropType<import("./types").QrScannerFormat[]>;
|
|
22
27
|
default: () => never[];
|
|
@@ -68,7 +73,7 @@ declare const QrScanner: {
|
|
|
68
73
|
type: BooleanConstructor;
|
|
69
74
|
default: true;
|
|
70
75
|
};
|
|
71
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "error" | "closed" | "update:show" | "cancel" | "scan" | "ready")[], "close" | "error" | "closed" | "update:show" | "cancel" | "scan" | "ready", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
76
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "error" | "closed" | "update:show" | "cancel" | "scan" | "ready" | "stageChange")[], "close" | "error" | "closed" | "update:show" | "cancel" | "scan" | "ready" | "stageChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
72
77
|
show: BooleanConstructor;
|
|
73
78
|
title: {
|
|
74
79
|
type: import("vue").PropType<string>;
|
|
@@ -82,6 +87,11 @@ declare const QrScanner: {
|
|
|
82
87
|
type: import("vue").PropType<string>;
|
|
83
88
|
default: string;
|
|
84
89
|
};
|
|
90
|
+
startupTimeout: {
|
|
91
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
92
|
+
default: number;
|
|
93
|
+
};
|
|
94
|
+
startupTexts: import("vue").PropType<Partial<Record<"camera" | "preview" | "decoder", string>>>;
|
|
85
95
|
formats: {
|
|
86
96
|
type: import("vue").PropType<import("./types").QrScannerFormat[]>;
|
|
87
97
|
default: () => never[];
|
|
@@ -141,6 +151,7 @@ declare const QrScanner: {
|
|
|
141
151
|
onCancel?: ((...args: any[]) => any) | undefined;
|
|
142
152
|
onScan?: ((...args: any[]) => any) | undefined;
|
|
143
153
|
onReady?: ((...args: any[]) => any) | undefined;
|
|
154
|
+
onStageChange?: ((...args: any[]) => any) | undefined;
|
|
144
155
|
}, {
|
|
145
156
|
title: string;
|
|
146
157
|
show: boolean;
|
|
@@ -149,6 +160,7 @@ declare const QrScanner: {
|
|
|
149
160
|
closeOnPopstate: boolean;
|
|
150
161
|
tip: string;
|
|
151
162
|
processingText: string;
|
|
163
|
+
startupTimeout: string | number;
|
|
152
164
|
formats: import("./types").QrScannerFormat[];
|
|
153
165
|
facingMode: "environment" | "user";
|
|
154
166
|
showAlbum: boolean;
|
|
@@ -35,11 +35,14 @@ var import_utils = require("../utils");
|
|
|
35
35
|
var import_mount_component = require("../utils/mount-component");
|
|
36
36
|
var import_use_expose = require("../composables/use-expose");
|
|
37
37
|
var import_QrScanner = __toESM(require("./QrScanner"));
|
|
38
|
+
var import_startup = require("./startup");
|
|
38
39
|
let instance;
|
|
39
40
|
const defaultOptions = {
|
|
40
41
|
title: "\u626B\u63CF\u8BBE\u5907\u4E8C\u7EF4\u7801",
|
|
41
42
|
tip: "\u5C06\u8BBE\u5907\u4E8C\u7EF4\u7801\u7F6E\u4E8E\u53D6\u666F\u6846\u5185\uFF0C\u5373\u53EF\u81EA\u52A8\u8BC6\u522B",
|
|
42
43
|
processingText: "\u6B63\u5728\u5904\u7406\u626B\u7801\u7ED3\u679C...",
|
|
44
|
+
startupTimeout: import_startup.DEFAULT_STARTUP_TIMEOUT,
|
|
45
|
+
startupTexts: void 0,
|
|
43
46
|
formats: ["QRCode"],
|
|
44
47
|
facingMode: "environment",
|
|
45
48
|
showAlbum: true,
|
|
@@ -58,6 +61,8 @@ const defaultOptions = {
|
|
|
58
61
|
closeOnPopstate: true,
|
|
59
62
|
onScan: void 0,
|
|
60
63
|
onError: void 0,
|
|
64
|
+
onStageChange: void 0,
|
|
65
|
+
onReady: void 0,
|
|
61
66
|
onCancel: void 0,
|
|
62
67
|
onClose: void 0
|
|
63
68
|
};
|
|
@@ -2,7 +2,7 @@ import { QrScanner } from './function-call';
|
|
|
2
2
|
export default QrScanner;
|
|
3
3
|
export { QrScanner };
|
|
4
4
|
export type { QrScannerProps } from './QrScanner';
|
|
5
|
-
export type { QrScannerBeforeConfirm, QrScannerError, QrScannerErrorCode, QrScannerExpose, QrScannerFormat, QrScannerInstance, QrScannerNativeScan, QrScannerOptions, QrScannerResult, } from './types';
|
|
5
|
+
export type { QrScannerBeforeConfirm, QrScannerError, QrScannerErrorCode, QrScannerExpose, QrScannerFormat, QrScannerInstance, QrScannerNativeScan, QrScannerOptions, QrScannerResult, QrScannerStageChange, QrScannerStartupStage, QrScannerStartupTexts, } from './types';
|
|
6
6
|
declare module 'vue' {
|
|
7
7
|
interface GlobalComponents {
|
|
8
8
|
VanQrScanner: typeof QrScanner.Component;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
DEFAULT_STARTUP_TIMEOUT: () => DEFAULT_STARTUP_TIMEOUT,
|
|
21
|
+
abortError: () => abortError,
|
|
22
|
+
waitForAbort: () => waitForAbort
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
25
|
+
const DEFAULT_STARTUP_TIMEOUT = 15e3;
|
|
26
|
+
function abortError() {
|
|
27
|
+
const error = new Error("Scanner startup cancelled");
|
|
28
|
+
error.name = "AbortError";
|
|
29
|
+
return error;
|
|
30
|
+
}
|
|
31
|
+
function waitForAbort(task, signal) {
|
|
32
|
+
return new Promise((resolve, reject) => {
|
|
33
|
+
const onAbort = () => {
|
|
34
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
35
|
+
reject(abortError());
|
|
36
|
+
};
|
|
37
|
+
if (signal == null ? void 0 : signal.aborted)
|
|
38
|
+
onAbort();
|
|
39
|
+
else
|
|
40
|
+
signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
41
|
+
task.then(
|
|
42
|
+
(value) => {
|
|
43
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
44
|
+
resolve(value);
|
|
45
|
+
},
|
|
46
|
+
(error) => {
|
|
47
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
48
|
+
reject(error);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -6,11 +6,20 @@ export declare type QrScannerResult = {
|
|
|
6
6
|
format: string;
|
|
7
7
|
source: 'camera' | 'image' | 'native';
|
|
8
8
|
};
|
|
9
|
-
export declare type
|
|
9
|
+
export declare type QrScannerStartupStage = 'camera' | 'preview' | 'decoder' | 'ready';
|
|
10
|
+
export declare type QrScannerStartupTexts = Partial<Record<Exclude<QrScannerStartupStage, 'ready'>, string>>;
|
|
11
|
+
export declare type QrScannerStageChange = {
|
|
12
|
+
stage: QrScannerStartupStage;
|
|
13
|
+
/** Milliseconds since this H5 startup attempt began. */
|
|
14
|
+
elapsedMs: number;
|
|
15
|
+
};
|
|
16
|
+
export declare type QrScannerErrorCode = 'INSECURE_CONTEXT' | 'CAMERA_UNSUPPORTED' | 'CAMERA_PERMISSION_DENIED' | 'CAMERA_NOT_FOUND' | 'CAMERA_UNAVAILABLE' | 'PREVIEW_FAILED' | 'STARTUP_TIMEOUT' | 'DECODER_LOAD_FAILED' | 'DECODE_FAILED' | 'IMAGE_TOO_LARGE' | 'IMAGE_NOT_FOUND' | 'CONFIRM_FAILED' | 'NATIVE_SCAN_FAILED' | 'TORCH_UNAVAILABLE';
|
|
10
17
|
export declare type QrScannerError = {
|
|
11
18
|
code: QrScannerErrorCode;
|
|
12
19
|
message: string;
|
|
13
20
|
cause?: unknown;
|
|
21
|
+
stage?: QrScannerStartupStage;
|
|
22
|
+
elapsedMs?: number;
|
|
14
23
|
};
|
|
15
24
|
export declare type QrScannerBeforeConfirm = (result: QrScannerResult) => boolean | void | Promise<boolean | void>;
|
|
16
25
|
export declare type QrScannerNativeScan = (options: {
|
|
@@ -24,6 +33,8 @@ export declare type QrScannerOptions = {
|
|
|
24
33
|
title?: string;
|
|
25
34
|
tip?: string;
|
|
26
35
|
processingText?: string;
|
|
36
|
+
startupTimeout?: number | string;
|
|
37
|
+
startupTexts?: QrScannerStartupTexts;
|
|
27
38
|
formats?: QrScannerFormat[];
|
|
28
39
|
facingMode?: 'environment' | 'user';
|
|
29
40
|
showAlbum?: boolean;
|
|
@@ -42,6 +53,10 @@ export declare type QrScannerOptions = {
|
|
|
42
53
|
closeOnPopstate?: boolean;
|
|
43
54
|
onScan?: (result: QrScannerResult) => void;
|
|
44
55
|
onError?: (error: QrScannerError) => void;
|
|
56
|
+
onStageChange?: (info: QrScannerStageChange) => void;
|
|
57
|
+
onReady?: (info: {
|
|
58
|
+
torch: boolean;
|
|
59
|
+
}) => void;
|
|
45
60
|
onCancel?: () => void;
|
|
46
61
|
onClose?: () => void;
|
|
47
62
|
};
|