persagy-vant 0.0.53 → 0.0.55
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/action-sheet/ActionSheet.d.ts +3 -0
- package/es/action-sheet/ActionSheet.mjs +5 -1
- package/es/action-sheet/index.css +1 -1
- package/es/action-sheet/index.d.ts +2 -0
- package/es/action-sheet/var.less +1 -1
- package/es/calendar/Calendar.mjs +1 -0
- 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/action-sheet/ActionSheet.d.ts +3 -0
- package/lib/action-sheet/ActionSheet.js +4 -0
- package/lib/action-sheet/index.css +1 -1
- package/lib/action-sheet/index.d.ts +2 -0
- package/lib/action-sheet/var.less +1 -1
- package/lib/calendar/Calendar.js +1 -0
- package/lib/{decoder-8f5b00db.js → decoder-51de19c7.js} +112 -34
- package/lib/{decoder-a36ba9ae.mjs → decoder-6b11aad7.mjs} +112 -34
- package/lib/index-491e7ee3.js +22972 -0
- package/lib/index-4a9f05ad.mjs +22973 -0
- package/lib/index.css +1 -1
- 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 +377 -137
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -18,48 +18,120 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
import {
|
|
22
|
+
prepareZXingModule,
|
|
23
|
+
purgeZXingModule,
|
|
24
|
+
readBarcodes
|
|
25
|
+
} from "zxing-wasm/reader";
|
|
26
|
+
import { abortError, waitForAbort } from "./startup.mjs";
|
|
27
|
+
let preparation;
|
|
28
|
+
function invalidate(entry) {
|
|
29
|
+
if (preparation === entry) {
|
|
30
|
+
preparation = void 0;
|
|
31
|
+
purgeZXingModule();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function createPreparation(wasmUrl) {
|
|
35
|
+
const controller = new AbortController();
|
|
36
|
+
const entry = {
|
|
37
|
+
wasmUrl,
|
|
38
|
+
pending: true,
|
|
39
|
+
controller,
|
|
40
|
+
consumers: /* @__PURE__ */ new Set(),
|
|
41
|
+
promise: void 0
|
|
42
|
+
};
|
|
43
|
+
const initialize = () => __async(this, null, function* () {
|
|
26
44
|
const url = wasmUrl || (yield import("zxing-wasm/reader/zxing_reader.wasm?url")).default;
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
if (controller.signal.aborted || preparation !== entry)
|
|
46
|
+
throw abortError();
|
|
47
|
+
yield prepareZXingModule({
|
|
48
|
+
overrides: { locateFile: () => url },
|
|
49
|
+
fireImmediately: true
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
entry.promise = waitForAbort(
|
|
53
|
+
Promise.resolve().then(initialize),
|
|
54
|
+
controller.signal
|
|
55
|
+
).then(
|
|
56
|
+
() => {
|
|
57
|
+
entry.pending = false;
|
|
58
|
+
},
|
|
59
|
+
(error) => {
|
|
60
|
+
entry.pending = false;
|
|
61
|
+
invalidate(entry);
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
return entry;
|
|
66
|
+
}
|
|
67
|
+
function prepareDecoder(wasmUrl, signal) {
|
|
68
|
+
return __async(this, null, function* () {
|
|
69
|
+
if (signal == null ? void 0 : signal.aborted)
|
|
70
|
+
throw abortError();
|
|
71
|
+
if (!preparation || preparation.wasmUrl !== wasmUrl) {
|
|
72
|
+
preparation = createPreparation(wasmUrl);
|
|
73
|
+
}
|
|
74
|
+
const entry = preparation;
|
|
75
|
+
const consumer = Symbol("decoder-consumer");
|
|
76
|
+
entry.consumers.add(consumer);
|
|
77
|
+
const releaseConsumer = () => {
|
|
78
|
+
entry.consumers.delete(consumer);
|
|
79
|
+
if (entry.pending && !entry.consumers.size) {
|
|
80
|
+
invalidate(entry);
|
|
81
|
+
entry.controller.abort();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
signal == null ? void 0 : signal.addEventListener("abort", releaseConsumer, { once: true });
|
|
85
|
+
try {
|
|
86
|
+
yield waitForAbort(entry.promise, signal);
|
|
87
|
+
} finally {
|
|
88
|
+
signal == null ? void 0 : signal.removeEventListener("abort", releaseConsumer);
|
|
89
|
+
releaseConsumer();
|
|
38
90
|
}
|
|
39
|
-
yield ready;
|
|
40
91
|
});
|
|
41
92
|
}
|
|
42
|
-
function decode(image, formats, wasmUrl) {
|
|
93
|
+
function decode(image, formats, wasmUrl, signal) {
|
|
43
94
|
return __async(this, null, function* () {
|
|
44
|
-
yield prepareDecoder(wasmUrl);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
95
|
+
yield prepareDecoder(wasmUrl, signal);
|
|
96
|
+
if (signal == null ? void 0 : signal.aborted)
|
|
97
|
+
throw abortError();
|
|
98
|
+
const results = yield waitForAbort(
|
|
99
|
+
readBarcodes(image, {
|
|
100
|
+
formats: formats.length ? formats : ["QRCode"],
|
|
101
|
+
tryHarder: true,
|
|
102
|
+
maxNumberOfSymbols: 1
|
|
103
|
+
}),
|
|
104
|
+
signal
|
|
105
|
+
);
|
|
50
106
|
return results.find((result) => result.isValid && result.text.length > 0);
|
|
51
107
|
});
|
|
52
108
|
}
|
|
53
|
-
function loadImage(file) {
|
|
109
|
+
function loadImage(file, signal) {
|
|
54
110
|
return new Promise((resolve, reject) => {
|
|
111
|
+
if (signal == null ? void 0 : signal.aborted) {
|
|
112
|
+
reject(abortError());
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
55
115
|
const url = URL.createObjectURL(file);
|
|
56
116
|
const image = new Image();
|
|
57
|
-
|
|
117
|
+
const cleanup = () => {
|
|
58
118
|
URL.revokeObjectURL(url);
|
|
119
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
120
|
+
image.onload = null;
|
|
121
|
+
image.onerror = null;
|
|
122
|
+
};
|
|
123
|
+
const onAbort = () => {
|
|
124
|
+
cleanup();
|
|
125
|
+
image.src = "";
|
|
126
|
+
reject(abortError());
|
|
127
|
+
};
|
|
128
|
+
signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
129
|
+
image.onload = () => {
|
|
130
|
+
cleanup();
|
|
59
131
|
resolve(image);
|
|
60
132
|
};
|
|
61
133
|
image.onerror = () => {
|
|
62
|
-
|
|
134
|
+
cleanup();
|
|
63
135
|
reject(new Error("\u65E0\u6CD5\u8BFB\u53D6\u56FE\u7247\uFF0C\u8BF7\u9009\u62E9 JPG\u3001PNG \u7B49\u6D4F\u89C8\u5668\u652F\u6301\u7684\u56FE\u7247"));
|
|
64
136
|
};
|
|
65
137
|
image.src = url;
|
|
@@ -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;
|
|
@@ -3,11 +3,14 @@ import { extend, inBrowser, withInstall } from "../utils/index.mjs";
|
|
|
3
3
|
import { mountComponent, usePopupState } from "../utils/mount-component.mjs";
|
|
4
4
|
import { useExpose } from "../composables/use-expose.mjs";
|
|
5
5
|
import VanQrScanner from "./QrScanner.mjs";
|
|
6
|
+
import { DEFAULT_STARTUP_TIMEOUT } from "./startup.mjs";
|
|
6
7
|
let instance;
|
|
7
8
|
const defaultOptions = {
|
|
8
9
|
title: "\u626B\u63CF\u8BBE\u5907\u4E8C\u7EF4\u7801",
|
|
9
10
|
tip: "\u5C06\u8BBE\u5907\u4E8C\u7EF4\u7801\u7F6E\u4E8E\u53D6\u666F\u6846\u5185\uFF0C\u5373\u53EF\u81EA\u52A8\u8BC6\u522B",
|
|
10
11
|
processingText: "\u6B63\u5728\u5904\u7406\u626B\u7801\u7ED3\u679C...",
|
|
12
|
+
startupTimeout: DEFAULT_STARTUP_TIMEOUT,
|
|
13
|
+
startupTexts: void 0,
|
|
11
14
|
formats: ["QRCode"],
|
|
12
15
|
facingMode: "environment",
|
|
13
16
|
showAlbum: true,
|
|
@@ -26,6 +29,8 @@ const defaultOptions = {
|
|
|
26
29
|
closeOnPopstate: true,
|
|
27
30
|
onScan: void 0,
|
|
28
31
|
onError: void 0,
|
|
32
|
+
onStageChange: void 0,
|
|
33
|
+
onReady: void 0,
|
|
29
34
|
onCancel: void 0,
|
|
30
35
|
onClose: void 0
|
|
31
36
|
};
|
package/es/qr-scanner/index.d.ts
CHANGED
|
@@ -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,33 @@
|
|
|
1
|
+
const DEFAULT_STARTUP_TIMEOUT = 15e3;
|
|
2
|
+
function abortError() {
|
|
3
|
+
const error = new Error("Scanner startup cancelled");
|
|
4
|
+
error.name = "AbortError";
|
|
5
|
+
return error;
|
|
6
|
+
}
|
|
7
|
+
function waitForAbort(task, signal) {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
const onAbort = () => {
|
|
10
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
11
|
+
reject(abortError());
|
|
12
|
+
};
|
|
13
|
+
if (signal == null ? void 0 : signal.aborted)
|
|
14
|
+
onAbort();
|
|
15
|
+
else
|
|
16
|
+
signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
17
|
+
task.then(
|
|
18
|
+
(value) => {
|
|
19
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
20
|
+
resolve(value);
|
|
21
|
+
},
|
|
22
|
+
(error) => {
|
|
23
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
24
|
+
reject(error);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
DEFAULT_STARTUP_TIMEOUT,
|
|
31
|
+
abortError,
|
|
32
|
+
waitForAbort
|
|
33
|
+
};
|
package/es/qr-scanner/types.d.ts
CHANGED
|
@@ -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
|
};
|
|
@@ -51,6 +51,7 @@ declare const actionSheetProps: {
|
|
|
51
51
|
cancelText: StringConstructor;
|
|
52
52
|
description: StringConstructor;
|
|
53
53
|
contentAdaptive: BooleanConstructor;
|
|
54
|
+
maxHeight: (NumberConstructor | StringConstructor)[];
|
|
54
55
|
closeOnPopstate: {
|
|
55
56
|
type: BooleanConstructor;
|
|
56
57
|
default: true;
|
|
@@ -104,6 +105,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
104
105
|
cancelText: StringConstructor;
|
|
105
106
|
description: StringConstructor;
|
|
106
107
|
contentAdaptive: BooleanConstructor;
|
|
108
|
+
maxHeight: (NumberConstructor | StringConstructor)[];
|
|
107
109
|
closeOnPopstate: {
|
|
108
110
|
type: BooleanConstructor;
|
|
109
111
|
default: true;
|
|
@@ -155,6 +157,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
155
157
|
cancelText: StringConstructor;
|
|
156
158
|
description: StringConstructor;
|
|
157
159
|
contentAdaptive: BooleanConstructor;
|
|
160
|
+
maxHeight: (NumberConstructor | StringConstructor)[];
|
|
158
161
|
closeOnPopstate: {
|
|
159
162
|
type: BooleanConstructor;
|
|
160
163
|
default: true;
|
|
@@ -36,6 +36,7 @@ const actionSheetProps = (0, import_utils.extend)({}, import_shared.popupSharedP
|
|
|
36
36
|
cancelText: String,
|
|
37
37
|
description: String,
|
|
38
38
|
contentAdaptive: Boolean,
|
|
39
|
+
maxHeight: import_utils.numericProp,
|
|
39
40
|
closeOnPopstate: import_utils.truthProp,
|
|
40
41
|
closeOnClickAction: Boolean,
|
|
41
42
|
safeAreaInsetBottom: import_utils.truthProp
|
|
@@ -147,6 +148,9 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
147
148
|
"class": bem({
|
|
148
149
|
"content-adaptive": props.contentAdaptive
|
|
149
150
|
}),
|
|
151
|
+
"style": props.maxHeight !== void 0 ? {
|
|
152
|
+
"--van-action-sheet-max-height": (0, import_utils.addUnit)(props.maxHeight)
|
|
153
|
+
} : void 0,
|
|
150
154
|
"position": "bottom",
|
|
151
155
|
"onUpdate:show": updateShow
|
|
152
156
|
}, (0, import_utils.pick)(props, popupInheritKeys)), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--van-action-sheet-max-height:
|
|
1
|
+
:root{--van-action-sheet-max-height: 80vh;--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-color-light);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background-color);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color);background:var(--van-gray-2)}.van-action-sheet--content-adaptive{height:auto}.van-action-sheet__content{flex:1 auto;display:flex;flex-direction:column;gap:0;padding:0 var(--van-padding-md) var(--van-padding-md);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__action-card{overflow:hidden;background:var(--van-white);border-radius:8px}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:transparent;border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{position:relative;line-height:var(--van-action-sheet-item-line-height);text-align:left}.van-action-sheet__item--selected{font-weight:var(--van-font-weight-bold)}.van-action-sheet__item:not(:last-child):after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;background:transparent}.van-action-sheet__nav-left{display:flex;align-items:center;height:var(--van-nav-bar-height);padding:0 6px 0 var(--van-padding-md)}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}
|
|
@@ -40,6 +40,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
|
|
|
40
40
|
cancelText: StringConstructor;
|
|
41
41
|
description: StringConstructor;
|
|
42
42
|
contentAdaptive: BooleanConstructor;
|
|
43
|
+
maxHeight: (NumberConstructor | StringConstructor)[];
|
|
43
44
|
closeOnPopstate: {
|
|
44
45
|
type: BooleanConstructor;
|
|
45
46
|
default: true;
|
|
@@ -91,6 +92,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
|
|
|
91
92
|
cancelText: StringConstructor;
|
|
92
93
|
description: StringConstructor;
|
|
93
94
|
contentAdaptive: BooleanConstructor;
|
|
95
|
+
maxHeight: (NumberConstructor | StringConstructor)[];
|
|
94
96
|
closeOnPopstate: {
|
|
95
97
|
type: BooleanConstructor;
|
|
96
98
|
default: true;
|
package/lib/calendar/Calendar.js
CHANGED
|
@@ -419,6 +419,7 @@ var stdin_default = (0, import_vue.defineComponent)({
|
|
|
419
419
|
"round": props.round,
|
|
420
420
|
"position": props.position,
|
|
421
421
|
"closeable": props.showTitle || props.showSubtitle,
|
|
422
|
+
"closeIconPosition": "top-left",
|
|
422
423
|
"teleport": props.teleport,
|
|
423
424
|
"closeOnPopstate": props.closeOnPopstate,
|
|
424
425
|
"safeAreaInsetTop": props.safeAreaInsetTop,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("./index-491e7ee3.js");
|
|
4
|
+
require("vue");
|
|
5
|
+
require("@vant/use");
|
|
6
|
+
require("@vant/popperjs");
|
|
7
|
+
require("plyr");
|
|
3
8
|
var e = [
|
|
4
9
|
[
|
|
5
10
|
"All",
|
|
@@ -548,6 +553,9 @@ function J(e2) {
|
|
|
548
553
|
}
|
|
549
554
|
(c == null ? n(a, s) : c) || K.set(e2, [s]);
|
|
550
555
|
}
|
|
556
|
+
function Y(e2) {
|
|
557
|
+
K.delete(e2);
|
|
558
|
+
}
|
|
551
559
|
async function X(e2, t2) {
|
|
552
560
|
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : I, r = {
|
|
553
561
|
...I,
|
|
@@ -644,12 +652,12 @@ async function b() {
|
|
|
644
652
|
var e3;
|
|
645
653
|
if (!(y2 != null && (e3 = y2.buffer) != null && e3.resizable)) {
|
|
646
654
|
var t3 = te();
|
|
647
|
-
y2 = new Int8Array(t3), Ht = new Int16Array(t3), i.HEAPU8 = I2 = new Uint8Array(t3),
|
|
655
|
+
y2 = new Int8Array(t3), Ht = new Int16Array(t3), i.HEAPU8 = I2 = new Uint8Array(t3), Y2 = new Uint16Array(t3), Ut = new Int32Array(t3), E2 = new Uint32Array(t3), Lt = new Float32Array(t3), Rt = new Float64Array(t3);
|
|
648
656
|
}
|
|
649
657
|
}
|
|
650
658
|
function re() {
|
|
651
659
|
var e3 = i.preRun;
|
|
652
|
-
e3 && (typeof e3 == "function" && (e3 = [e3]),
|
|
660
|
+
e3 && (typeof e3 == "function" && (e3 = [e3]), ge2.push(...e3)), b2(ge2);
|
|
653
661
|
}
|
|
654
662
|
function ie() {
|
|
655
663
|
Rr.ra();
|
|
@@ -723,7 +731,7 @@ async function b() {
|
|
|
723
731
|
var y2, b2 = (e3) => {
|
|
724
732
|
for (; e3.length > 0; )
|
|
725
733
|
e3.shift()(i);
|
|
726
|
-
}, x2 = [],
|
|
734
|
+
}, x2 = [], ge2 = [], _e = true, S = (e3) => Yn(e3), C2 = () => Zn(), ve = [], w2 = (e3) => {
|
|
727
735
|
var t3 = ve[e3];
|
|
728
736
|
return t3 || (ve[e3] = t3 = rr.get(e3)), t3;
|
|
729
737
|
}, ye = (e3, t3) => w2(e3)(t3), T = [], be = 0, E2;
|
|
@@ -1364,12 +1372,12 @@ async function b() {
|
|
|
1364
1372
|
var r3 = [n3[0], null].concat(n3.slice(1));
|
|
1365
1373
|
return _t(e3, Ot(e3, r3, null, i2, a2, o2), t3 - 1), [];
|
|
1366
1374
|
});
|
|
1367
|
-
}, Ht,
|
|
1375
|
+
}, Ht, Y2, Ut, Wt = (e3, t3, n2) => {
|
|
1368
1376
|
switch (t3) {
|
|
1369
1377
|
case 1:
|
|
1370
1378
|
return n2 ? (e4) => y2[e4] : (e4) => I2[e4];
|
|
1371
1379
|
case 2:
|
|
1372
|
-
return n2 ? (e4) => Ht[e4 >> 1] : (e4) =>
|
|
1380
|
+
return n2 ? (e4) => Ht[e4 >> 1] : (e4) => Y2[e4 >> 1];
|
|
1373
1381
|
case 4:
|
|
1374
1382
|
return n2 ? (e4) => Ut[e4 >> 2] : (e4) => E2[e4 >> 2];
|
|
1375
1383
|
default:
|
|
@@ -1526,11 +1534,11 @@ async function b() {
|
|
|
1526
1534
|
}
|
|
1527
1535
|
});
|
|
1528
1536
|
}, on = globalThis.TextDecoder ? new TextDecoder("utf-16le") : void 0, sn = (e3, t3, n2) => {
|
|
1529
|
-
var r2 = e3 >> 1, i2 = tn(
|
|
1537
|
+
var r2 = e3 >> 1, i2 = tn(Y2, r2, t3 / 2, n2);
|
|
1530
1538
|
if (i2 - r2 > 16 && on)
|
|
1531
|
-
return on.decode(
|
|
1539
|
+
return on.decode(Y2.subarray(r2, i2));
|
|
1532
1540
|
for (var a2 = "", o2 = r2; o2 < i2; ++o2) {
|
|
1533
|
-
var s2 =
|
|
1541
|
+
var s2 = Y2[o2];
|
|
1534
1542
|
a2 += String.fromCharCode(s2);
|
|
1535
1543
|
}
|
|
1536
1544
|
return a2;
|
|
@@ -2112,6 +2120,9 @@ async function b() {
|
|
|
2112
2120
|
function x(e2) {
|
|
2113
2121
|
return J(b, e2);
|
|
2114
2122
|
}
|
|
2123
|
+
function ge() {
|
|
2124
|
+
return Y(b);
|
|
2125
|
+
}
|
|
2115
2126
|
async function C(e2, t2) {
|
|
2116
2127
|
return X(b, e2, t2);
|
|
2117
2128
|
}
|
|
@@ -2135,47 +2146,114 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2135
2146
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
2136
2147
|
});
|
|
2137
2148
|
};
|
|
2138
|
-
let
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2149
|
+
let preparation;
|
|
2150
|
+
function invalidate(entry) {
|
|
2151
|
+
if (preparation === entry) {
|
|
2152
|
+
preparation = void 0;
|
|
2153
|
+
ge();
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
function createPreparation(wasmUrl) {
|
|
2157
|
+
const controller = new AbortController();
|
|
2158
|
+
const entry = {
|
|
2159
|
+
wasmUrl,
|
|
2160
|
+
pending: true,
|
|
2161
|
+
controller,
|
|
2162
|
+
consumers: /* @__PURE__ */ new Set(),
|
|
2163
|
+
promise: void 0
|
|
2164
|
+
};
|
|
2165
|
+
const initialize = () => __async(this, null, function* () {
|
|
2142
2166
|
const url = wasmUrl || (yield Promise.resolve().then(() => require("./zxing_reader-d6a2742e.js"))).default;
|
|
2143
|
-
if (
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2167
|
+
if (controller.signal.aborted || preparation !== entry)
|
|
2168
|
+
throw index.abortError();
|
|
2169
|
+
yield x({
|
|
2170
|
+
overrides: { locateFile: () => url },
|
|
2171
|
+
fireImmediately: true
|
|
2172
|
+
});
|
|
2173
|
+
});
|
|
2174
|
+
entry.promise = index.waitForAbort(
|
|
2175
|
+
Promise.resolve().then(initialize),
|
|
2176
|
+
controller.signal
|
|
2177
|
+
).then(
|
|
2178
|
+
() => {
|
|
2179
|
+
entry.pending = false;
|
|
2180
|
+
},
|
|
2181
|
+
(error) => {
|
|
2182
|
+
entry.pending = false;
|
|
2183
|
+
invalidate(entry);
|
|
2184
|
+
throw error;
|
|
2185
|
+
}
|
|
2186
|
+
);
|
|
2187
|
+
return entry;
|
|
2188
|
+
}
|
|
2189
|
+
function prepareDecoder(wasmUrl, signal) {
|
|
2190
|
+
return __async(this, null, function* () {
|
|
2191
|
+
if (signal == null ? void 0 : signal.aborted)
|
|
2192
|
+
throw index.abortError();
|
|
2193
|
+
if (!preparation || preparation.wasmUrl !== wasmUrl) {
|
|
2194
|
+
preparation = createPreparation(wasmUrl);
|
|
2195
|
+
}
|
|
2196
|
+
const entry = preparation;
|
|
2197
|
+
const consumer = Symbol("decoder-consumer");
|
|
2198
|
+
entry.consumers.add(consumer);
|
|
2199
|
+
const releaseConsumer = () => {
|
|
2200
|
+
entry.consumers.delete(consumer);
|
|
2201
|
+
if (entry.pending && !entry.consumers.size) {
|
|
2202
|
+
invalidate(entry);
|
|
2203
|
+
entry.controller.abort();
|
|
2204
|
+
}
|
|
2205
|
+
};
|
|
2206
|
+
signal == null ? void 0 : signal.addEventListener("abort", releaseConsumer, { once: true });
|
|
2207
|
+
try {
|
|
2208
|
+
yield index.waitForAbort(entry.promise, signal);
|
|
2209
|
+
} finally {
|
|
2210
|
+
signal == null ? void 0 : signal.removeEventListener("abort", releaseConsumer);
|
|
2211
|
+
releaseConsumer();
|
|
2154
2212
|
}
|
|
2155
|
-
yield ready;
|
|
2156
2213
|
});
|
|
2157
2214
|
}
|
|
2158
|
-
function decode(image, formats, wasmUrl) {
|
|
2215
|
+
function decode(image, formats, wasmUrl, signal) {
|
|
2159
2216
|
return __async(this, null, function* () {
|
|
2160
|
-
yield prepareDecoder(wasmUrl);
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2217
|
+
yield prepareDecoder(wasmUrl, signal);
|
|
2218
|
+
if (signal == null ? void 0 : signal.aborted)
|
|
2219
|
+
throw index.abortError();
|
|
2220
|
+
const results = yield index.waitForAbort(
|
|
2221
|
+
C(image, {
|
|
2222
|
+
formats: formats.length ? formats : ["QRCode"],
|
|
2223
|
+
tryHarder: true,
|
|
2224
|
+
maxNumberOfSymbols: 1
|
|
2225
|
+
}),
|
|
2226
|
+
signal
|
|
2227
|
+
);
|
|
2166
2228
|
return results.find((result) => result.isValid && result.text.length > 0);
|
|
2167
2229
|
});
|
|
2168
2230
|
}
|
|
2169
|
-
function loadImage(file) {
|
|
2231
|
+
function loadImage(file, signal) {
|
|
2170
2232
|
return new Promise((resolve, reject) => {
|
|
2233
|
+
if (signal == null ? void 0 : signal.aborted) {
|
|
2234
|
+
reject(index.abortError());
|
|
2235
|
+
return;
|
|
2236
|
+
}
|
|
2171
2237
|
const url = URL.createObjectURL(file);
|
|
2172
2238
|
const image = new Image();
|
|
2173
|
-
|
|
2239
|
+
const cleanup = () => {
|
|
2174
2240
|
URL.revokeObjectURL(url);
|
|
2241
|
+
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
2242
|
+
image.onload = null;
|
|
2243
|
+
image.onerror = null;
|
|
2244
|
+
};
|
|
2245
|
+
const onAbort = () => {
|
|
2246
|
+
cleanup();
|
|
2247
|
+
image.src = "";
|
|
2248
|
+
reject(index.abortError());
|
|
2249
|
+
};
|
|
2250
|
+
signal == null ? void 0 : signal.addEventListener("abort", onAbort, { once: true });
|
|
2251
|
+
image.onload = () => {
|
|
2252
|
+
cleanup();
|
|
2175
2253
|
resolve(image);
|
|
2176
2254
|
};
|
|
2177
2255
|
image.onerror = () => {
|
|
2178
|
-
|
|
2256
|
+
cleanup();
|
|
2179
2257
|
reject(new Error("无法读取图片,请选择 JPG、PNG 等浏览器支持的图片"));
|
|
2180
2258
|
};
|
|
2181
2259
|
image.src = url;
|