vant 4.2.1 → 4.3.1
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/date-picker/utils.mjs +3 -4
- package/es/field/index.css +1 -1
- package/es/image/Image.mjs +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.mjs +4 -1
- package/es/locale/lang/bg-BG.d.ts +2 -1
- package/es/locale/lang/bg-BG.mjs +2 -1
- package/es/locale/lang/bn-BD.d.ts +2 -1
- package/es/locale/lang/bn-BD.mjs +2 -1
- package/es/locale/lang/da-DK.d.ts +2 -1
- package/es/locale/lang/da-DK.mjs +2 -1
- package/es/locale/lang/de-DE-formal.d.ts +2 -1
- package/es/locale/lang/de-DE-formal.mjs +2 -1
- package/es/locale/lang/de-DE.d.ts +2 -1
- package/es/locale/lang/de-DE.mjs +2 -1
- package/es/locale/lang/el-GR.d.ts +2 -1
- package/es/locale/lang/el-GR.mjs +2 -1
- package/es/locale/lang/en-US.d.ts +2 -1
- package/es/locale/lang/en-US.mjs +2 -1
- package/es/locale/lang/eo-EO.d.ts +2 -1
- package/es/locale/lang/eo-EO.mjs +2 -1
- package/es/locale/lang/es-ES.d.ts +2 -1
- package/es/locale/lang/es-ES.mjs +2 -1
- package/es/locale/lang/fa-IR.d.ts +2 -1
- package/es/locale/lang/fa-IR.mjs +2 -1
- package/es/locale/lang/fr-FR.d.ts +2 -1
- package/es/locale/lang/fr-FR.mjs +2 -1
- package/es/locale/lang/he-IL.d.ts +2 -1
- package/es/locale/lang/he-IL.mjs +2 -1
- package/es/locale/lang/hi-IN.d.ts +2 -1
- package/es/locale/lang/hi-IN.mjs +2 -1
- package/es/locale/lang/id-ID.d.ts +2 -1
- package/es/locale/lang/id-ID.mjs +2 -1
- package/es/locale/lang/is-IS.d.ts +2 -1
- package/es/locale/lang/is-IS.mjs +2 -1
- package/es/locale/lang/it-IT.d.ts +2 -1
- package/es/locale/lang/it-IT.mjs +3 -10
- package/es/locale/lang/ja-JP.d.ts +2 -1
- package/es/locale/lang/ja-JP.mjs +2 -1
- package/es/locale/lang/km-KH.d.ts +2 -1
- package/es/locale/lang/km-KH.mjs +2 -1
- package/es/locale/lang/ko-KR.d.ts +2 -1
- package/es/locale/lang/ko-KR.mjs +2 -1
- package/es/locale/lang/la-LA.d.ts +2 -1
- package/es/locale/lang/la-LA.mjs +2 -1
- package/es/locale/lang/mm-MN.d.ts +2 -1
- package/es/locale/lang/mm-MN.mjs +2 -1
- package/es/locale/lang/nb-NO.d.ts +2 -1
- package/es/locale/lang/nb-NO.mjs +2 -1
- package/es/locale/lang/nl-NL.d.ts +2 -1
- package/es/locale/lang/nl-NL.mjs +2 -1
- package/es/locale/lang/pt-BR.d.ts +2 -1
- package/es/locale/lang/pt-BR.mjs +2 -1
- package/es/locale/lang/ro-RO.d.ts +2 -1
- package/es/locale/lang/ro-RO.mjs +2 -1
- package/es/locale/lang/ru-RU.d.ts +2 -1
- package/es/locale/lang/ru-RU.mjs +2 -1
- package/es/locale/lang/sv-SE.d.ts +2 -1
- package/es/locale/lang/sv-SE.mjs +2 -1
- package/es/locale/lang/th-TH.d.ts +2 -1
- package/es/locale/lang/th-TH.mjs +2 -1
- package/es/locale/lang/tr-TR.d.ts +2 -1
- package/es/locale/lang/tr-TR.mjs +2 -1
- package/es/locale/lang/uk-UA.d.ts +2 -1
- package/es/locale/lang/uk-UA.mjs +3 -10
- package/es/locale/lang/vi-VN.d.ts +2 -1
- package/es/locale/lang/vi-VN.mjs +2 -1
- package/es/locale/lang/zh-CN.d.ts +2 -1
- package/es/locale/lang/zh-CN.mjs +2 -1
- package/es/locale/lang/zh-HK.d.ts +2 -1
- package/es/locale/lang/zh-HK.mjs +2 -1
- package/es/locale/lang/zh-TW.d.ts +2 -1
- package/es/locale/lang/zh-TW.mjs +2 -1
- package/es/signature/Signature.d.ts +63 -0
- package/es/signature/Signature.mjs +129 -0
- package/es/signature/index.css +1 -0
- package/es/signature/index.d.ts +50 -0
- package/es/signature/index.mjs +8 -0
- package/es/signature/style/index.d.ts +1 -0
- package/es/signature/style/index.mjs +6 -0
- package/lib/date-picker/utils.js +2 -3
- package/lib/field/index.css +1 -1
- package/lib/image/Image.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/locale/lang/bg-BG.d.ts +2 -1
- package/lib/locale/lang/bg-BG.js +2 -1
- package/lib/locale/lang/bn-BD.d.ts +2 -1
- package/lib/locale/lang/bn-BD.js +2 -1
- package/lib/locale/lang/da-DK.d.ts +2 -1
- package/lib/locale/lang/da-DK.js +2 -1
- package/lib/locale/lang/de-DE-formal.d.ts +2 -1
- package/lib/locale/lang/de-DE-formal.js +2 -1
- package/lib/locale/lang/de-DE.d.ts +2 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/el-GR.d.ts +2 -1
- package/lib/locale/lang/el-GR.js +2 -1
- package/lib/locale/lang/en-US.d.ts +2 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/eo-EO.d.ts +2 -1
- package/lib/locale/lang/eo-EO.js +2 -1
- package/lib/locale/lang/es-ES.d.ts +2 -1
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/fa-IR.d.ts +2 -1
- package/lib/locale/lang/fa-IR.js +2 -1
- package/lib/locale/lang/fr-FR.d.ts +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/he-IL.d.ts +2 -1
- package/lib/locale/lang/he-IL.js +2 -1
- package/lib/locale/lang/hi-IN.d.ts +2 -1
- package/lib/locale/lang/hi-IN.js +2 -1
- package/lib/locale/lang/id-ID.d.ts +2 -1
- package/lib/locale/lang/id-ID.js +2 -1
- package/lib/locale/lang/is-IS.d.ts +2 -1
- package/lib/locale/lang/is-IS.js +2 -1
- package/lib/locale/lang/it-IT.d.ts +2 -1
- package/lib/locale/lang/it-IT.js +3 -10
- package/lib/locale/lang/ja-JP.d.ts +2 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/km-KH.d.ts +2 -1
- package/lib/locale/lang/km-KH.js +2 -1
- package/lib/locale/lang/ko-KR.d.ts +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/la-LA.d.ts +2 -1
- package/lib/locale/lang/la-LA.js +2 -1
- package/lib/locale/lang/mm-MN.d.ts +2 -1
- package/lib/locale/lang/mm-MN.js +2 -1
- package/lib/locale/lang/nb-NO.d.ts +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nl-NL.d.ts +2 -1
- package/lib/locale/lang/nl-NL.js +2 -1
- package/lib/locale/lang/pt-BR.d.ts +2 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/ro-RO.d.ts +2 -1
- package/lib/locale/lang/ro-RO.js +2 -1
- package/lib/locale/lang/ru-RU.d.ts +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/sv-SE.d.ts +2 -1
- package/lib/locale/lang/sv-SE.js +2 -1
- package/lib/locale/lang/th-TH.d.ts +2 -1
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/tr-TR.d.ts +2 -1
- package/lib/locale/lang/tr-TR.js +2 -1
- package/lib/locale/lang/uk-UA.d.ts +2 -1
- package/lib/locale/lang/uk-UA.js +3 -10
- package/lib/locale/lang/vi-VN.d.ts +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/zh-CN.d.ts +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-HK.d.ts +2 -1
- package/lib/locale/lang/zh-HK.js +2 -1
- package/lib/locale/lang/zh-TW.d.ts +2 -1
- package/lib/locale/lang/zh-TW.js +2 -1
- package/lib/signature/Signature.d.ts +63 -0
- package/lib/signature/Signature.js +148 -0
- package/lib/signature/index.css +1 -0
- package/lib/signature/index.d.ts +50 -0
- package/lib/signature/index.js +37 -0
- package/lib/signature/style/index.d.ts +1 -0
- package/lib/signature/style/index.js +6 -0
- package/lib/vant.cjs.js +909 -786
- package/lib/vant.es.js +909 -786
- package/lib/vant.js +909 -786
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +6 -6
package/es/locale/lang/nb-NO.mjs
CHANGED
package/es/locale/lang/nl-NL.mjs
CHANGED
package/es/locale/lang/pt-BR.mjs
CHANGED
package/es/locale/lang/ro-RO.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "Nume",
|
3
3
|
tel: "Telefon",
|
4
4
|
save: "Salveaz\u0103",
|
5
|
-
|
5
|
+
clear: "Clar",
|
6
6
|
cancel: "Anuleaz\u0103",
|
7
|
+
confirm: "Confirm\u0103",
|
7
8
|
delete: "\u0218terge",
|
8
9
|
loading: "\xCEnc\u0103rcare...",
|
9
10
|
noCoupon: "F\u0103r\u0103 cupoane",
|
package/es/locale/lang/ru-RU.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "\u0418\u043C\u044F",
|
3
3
|
tel: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D",
|
4
4
|
save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
|
5
|
-
|
5
|
+
clear: "\u041F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u044B\u0439",
|
6
6
|
cancel: "\u041E\u0442\u043C\u0435\u043D\u0430",
|
7
|
+
confirm: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C",
|
7
8
|
delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
|
8
9
|
loading: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430...",
|
9
10
|
noCoupon: "\u041D\u0435\u0442 \u043A\u0443\u043F\u043E\u043D\u043E\u0432",
|
package/es/locale/lang/sv-SE.mjs
CHANGED
package/es/locale/lang/th-TH.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "\u0E0A\u0E37\u0E48\u0E2D",
|
3
3
|
tel: "\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C",
|
4
4
|
save: "\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01",
|
5
|
-
|
5
|
+
clear: "\u0E0A\u0E31\u0E14\u0E40\u0E08\u0E19",
|
6
6
|
cancel: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",
|
7
|
+
confirm: "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19",
|
7
8
|
delete: "\u0E25\u0E1A",
|
8
9
|
loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14...",
|
9
10
|
noCoupon: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E39\u0E1B\u0E2D\u0E07",
|
package/es/locale/lang/tr-TR.mjs
CHANGED
package/es/locale/lang/uk-UA.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "\u0406\u043C'\u044F",
|
3
3
|
tel: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D",
|
4
4
|
save: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",
|
5
|
-
|
5
|
+
clear: "\u044F\u0441\u043D\u043E",
|
6
6
|
cancel: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",
|
7
|
+
confirm: "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438",
|
7
8
|
delete: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
|
8
9
|
loading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F...",
|
9
10
|
noCoupon: "\u0411\u0435\u0437 \u043A\u0443\u043F\u043E\u043D\u0456\u0432",
|
@@ -14,15 +15,7 @@ var stdin_default = {
|
|
14
15
|
end: "\u041A\u0456\u043D\u0435\u0446\u044C",
|
15
16
|
start: "\u041F\u043E\u0447\u0430\u0442\u043E\u043A",
|
16
17
|
title: "\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440",
|
17
|
-
weekdays: [
|
18
|
-
"\u041D\u0434",
|
19
|
-
"\u041F\u043D",
|
20
|
-
"\u0412\u0442",
|
21
|
-
"\u0421\u0440",
|
22
|
-
"\u0427\u0442",
|
23
|
-
"\u041F\u0442",
|
24
|
-
"\u0421\u0431"
|
25
|
-
],
|
18
|
+
weekdays: ["\u041D\u0434", "\u041F\u043D", "\u0412\u0442", "\u0421\u0440", "\u0427\u0442", "\u041F\u0442", "\u0421\u0431"],
|
26
19
|
monthTitle: (year, month) => `${year}/${month}`,
|
27
20
|
rangePrompt: (maxRange) => `\u041E\u0431\u0435\u0440\u0456\u0442\u044C \u043D\u0435 \u0431\u0456\u043B\u044C\u0448\u0435 \u043D\u0456\u0436 ${maxRange} \u0434\u043D\u0456\u0432`
|
28
21
|
},
|
package/es/locale/lang/vi-VN.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "t\xEAn",
|
3
3
|
tel: "\u0110i\u1EC7n tho\u1EA1i",
|
4
4
|
save: "C\u1EE9u",
|
5
|
-
|
5
|
+
clear: "Th\xF4ng tho\xE1ng",
|
6
6
|
cancel: "H\u1EE7y b\u1ECF",
|
7
|
+
confirm: "X\xE1c nh\u1EADn",
|
7
8
|
delete: "X\xF3a",
|
8
9
|
loading: "\u0110ang t\u1EA3i ...",
|
9
10
|
noCoupon: "Kh\xF4ng c\xF3 phi\u1EBFu gi\u1EA3m gi\xE1",
|
package/es/locale/lang/zh-CN.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "\u59D3\u540D",
|
3
3
|
tel: "\u7535\u8BDD",
|
4
4
|
save: "\u4FDD\u5B58",
|
5
|
-
|
5
|
+
clear: "\u6E05\u7A7A",
|
6
6
|
cancel: "\u53D6\u6D88",
|
7
|
+
confirm: "\u786E\u8BA4",
|
7
8
|
delete: "\u5220\u9664",
|
8
9
|
loading: "\u52A0\u8F7D\u4E2D...",
|
9
10
|
noCoupon: "\u6682\u65E0\u4F18\u60E0\u5238",
|
package/es/locale/lang/zh-HK.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "\u59D3\u540D",
|
3
3
|
tel: "\u96FB\u8A71",
|
4
4
|
save: "\u4FDD\u5B58",
|
5
|
-
|
5
|
+
clear: "\u6E05\u7A7A",
|
6
6
|
cancel: "\u53D6\u6D88",
|
7
|
+
confirm: "\u78BA\u8A8D",
|
7
8
|
delete: "\u522A\u9664",
|
8
9
|
loading: "\u52A0\u8F09\u4E2D...",
|
9
10
|
noCoupon: "\u66AB\u7121\u512A\u60E0\u5238",
|
package/es/locale/lang/zh-TW.mjs
CHANGED
@@ -2,8 +2,9 @@ var stdin_default = {
|
|
2
2
|
name: "\u59D3\u540D",
|
3
3
|
tel: "\u96FB\u8A71",
|
4
4
|
save: "\u5132\u5B58",
|
5
|
-
|
5
|
+
clear: "\u6E05\u7A7A",
|
6
6
|
cancel: "\u53D6\u6D88",
|
7
|
+
confirm: "\u78BA\u8A8D",
|
7
8
|
delete: "\u522A\u9664",
|
8
9
|
loading: "\u8F09\u5165\u4E2D...",
|
9
10
|
noCoupon: "\u66AB\u7121\u512A\u60E0\u5238",
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { type ExtractPropTypes } from 'vue';
|
2
|
+
export declare const signatureProps: {
|
3
|
+
tips: StringConstructor;
|
4
|
+
type: {
|
5
|
+
type: import("vue").PropType<string>;
|
6
|
+
default: string;
|
7
|
+
};
|
8
|
+
penColor: {
|
9
|
+
type: import("vue").PropType<string>;
|
10
|
+
default: string;
|
11
|
+
};
|
12
|
+
lineWidth: {
|
13
|
+
type: NumberConstructor;
|
14
|
+
default: number;
|
15
|
+
};
|
16
|
+
clearButtonText: StringConstructor;
|
17
|
+
confirmButtonText: StringConstructor;
|
18
|
+
};
|
19
|
+
export type SignatureProps = ExtractPropTypes<typeof signatureProps>;
|
20
|
+
declare const _default: import("vue").DefineComponent<{
|
21
|
+
tips: StringConstructor;
|
22
|
+
type: {
|
23
|
+
type: import("vue").PropType<string>;
|
24
|
+
default: string;
|
25
|
+
};
|
26
|
+
penColor: {
|
27
|
+
type: import("vue").PropType<string>;
|
28
|
+
default: string;
|
29
|
+
};
|
30
|
+
lineWidth: {
|
31
|
+
type: NumberConstructor;
|
32
|
+
default: number;
|
33
|
+
};
|
34
|
+
clearButtonText: StringConstructor;
|
35
|
+
confirmButtonText: StringConstructor;
|
36
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("submit" | "start" | "clear" | "end" | "signing")[], "submit" | "start" | "clear" | "end" | "signing", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
37
|
+
tips: StringConstructor;
|
38
|
+
type: {
|
39
|
+
type: import("vue").PropType<string>;
|
40
|
+
default: string;
|
41
|
+
};
|
42
|
+
penColor: {
|
43
|
+
type: import("vue").PropType<string>;
|
44
|
+
default: string;
|
45
|
+
};
|
46
|
+
lineWidth: {
|
47
|
+
type: NumberConstructor;
|
48
|
+
default: number;
|
49
|
+
};
|
50
|
+
clearButtonText: StringConstructor;
|
51
|
+
confirmButtonText: StringConstructor;
|
52
|
+
}>> & {
|
53
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
54
|
+
onClear?: ((...args: any[]) => any) | undefined;
|
55
|
+
onStart?: ((...args: any[]) => any) | undefined;
|
56
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
57
|
+
onSigning?: ((...args: any[]) => any) | undefined;
|
58
|
+
}, {
|
59
|
+
type: string;
|
60
|
+
lineWidth: number;
|
61
|
+
penColor: string;
|
62
|
+
}>;
|
63
|
+
export default _default;
|
@@ -0,0 +1,129 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
import { ref, reactive, onMounted, defineComponent } from "vue";
|
3
|
+
import { inBrowser, makeNumberProp, makeStringProp, createNamespace, preventDefault } from "../utils/index.mjs";
|
4
|
+
import { useRect } from "@vant/use";
|
5
|
+
import { Button } from "../button/index.mjs";
|
6
|
+
const [name, bem, t] = createNamespace("signature");
|
7
|
+
const signatureProps = {
|
8
|
+
tips: String,
|
9
|
+
type: makeStringProp("png"),
|
10
|
+
penColor: makeStringProp("#000"),
|
11
|
+
lineWidth: makeNumberProp(3),
|
12
|
+
clearButtonText: String,
|
13
|
+
confirmButtonText: String
|
14
|
+
};
|
15
|
+
const hasCanvasSupport = () => {
|
16
|
+
var _a;
|
17
|
+
const canvas = document.createElement("canvas");
|
18
|
+
return !!((_a = canvas.getContext) == null ? void 0 : _a.call(canvas, "2d"));
|
19
|
+
};
|
20
|
+
var stdin_default = defineComponent({
|
21
|
+
name,
|
22
|
+
props: signatureProps,
|
23
|
+
emits: ["submit", "clear", "start", "end", "signing"],
|
24
|
+
setup(props, {
|
25
|
+
emit
|
26
|
+
}) {
|
27
|
+
const canvasRef = ref();
|
28
|
+
const wrapRef = ref();
|
29
|
+
const state = reactive({
|
30
|
+
width: 0,
|
31
|
+
height: 0,
|
32
|
+
ctx: null
|
33
|
+
});
|
34
|
+
let canvasRect;
|
35
|
+
const isRenderCanvas = inBrowser ? hasCanvasSupport() : true;
|
36
|
+
const touchStart = () => {
|
37
|
+
if (!state.ctx) {
|
38
|
+
return false;
|
39
|
+
}
|
40
|
+
state.ctx.beginPath();
|
41
|
+
state.ctx.lineWidth = props.lineWidth;
|
42
|
+
state.ctx.strokeStyle = props.penColor;
|
43
|
+
canvasRect = useRect(canvasRef);
|
44
|
+
emit("start");
|
45
|
+
};
|
46
|
+
const touchMove = (event) => {
|
47
|
+
var _a, _b;
|
48
|
+
if (!state.ctx) {
|
49
|
+
return false;
|
50
|
+
}
|
51
|
+
preventDefault(event);
|
52
|
+
const touch = event.touches[0];
|
53
|
+
const mouseX = touch.clientX - ((canvasRect == null ? void 0 : canvasRect.left) || 0);
|
54
|
+
const mouseY = touch.clientY - ((canvasRect == null ? void 0 : canvasRect.top) || 0);
|
55
|
+
state.ctx.lineCap = "round";
|
56
|
+
state.ctx.lineJoin = "round";
|
57
|
+
(_a = state.ctx) == null ? void 0 : _a.lineTo(mouseX, mouseY);
|
58
|
+
(_b = state.ctx) == null ? void 0 : _b.stroke();
|
59
|
+
emit("signing", event);
|
60
|
+
};
|
61
|
+
const touchEnd = (event) => {
|
62
|
+
preventDefault(event);
|
63
|
+
emit("end");
|
64
|
+
};
|
65
|
+
const isCanvasEmpty = (canvas) => {
|
66
|
+
const empty = document.createElement("canvas");
|
67
|
+
empty.width = canvas.width;
|
68
|
+
empty.height = canvas.height;
|
69
|
+
return canvas.toDataURL() === empty.toDataURL();
|
70
|
+
};
|
71
|
+
const submit = () => {
|
72
|
+
const canvas = canvasRef.value;
|
73
|
+
if (!canvas) {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
const isEmpty = isCanvasEmpty(canvas);
|
77
|
+
const image = isEmpty ? "" : canvas.toDataURL(`image/${props.type}`, props.type === "jpg" ? 0.9 : null);
|
78
|
+
emit("submit", {
|
79
|
+
image,
|
80
|
+
canvas
|
81
|
+
});
|
82
|
+
};
|
83
|
+
const clear = () => {
|
84
|
+
if (state.ctx) {
|
85
|
+
state.ctx.clearRect(0, 0, state.width, state.height);
|
86
|
+
state.ctx.closePath();
|
87
|
+
}
|
88
|
+
emit("clear");
|
89
|
+
};
|
90
|
+
onMounted(() => {
|
91
|
+
var _a, _b, _c;
|
92
|
+
if (isRenderCanvas) {
|
93
|
+
state.ctx = (_a = canvasRef.value) == null ? void 0 : _a.getContext("2d");
|
94
|
+
state.width = ((_b = wrapRef.value) == null ? void 0 : _b.offsetWidth) || 0;
|
95
|
+
state.height = ((_c = wrapRef.value) == null ? void 0 : _c.offsetHeight) || 0;
|
96
|
+
}
|
97
|
+
});
|
98
|
+
return () => _createVNode("div", {
|
99
|
+
"class": bem()
|
100
|
+
}, [_createVNode("div", {
|
101
|
+
"class": bem("content"),
|
102
|
+
"ref": wrapRef
|
103
|
+
}, [isRenderCanvas ? _createVNode("canvas", {
|
104
|
+
"ref": canvasRef,
|
105
|
+
"width": state.width,
|
106
|
+
"height": state.height,
|
107
|
+
"onTouchstartPassive": touchStart,
|
108
|
+
"onTouchmove": touchMove,
|
109
|
+
"onTouchend": touchEnd
|
110
|
+
}, null) : _createVNode("p", null, [props.tips])]), _createVNode("div", {
|
111
|
+
"class": bem("footer")
|
112
|
+
}, [_createVNode(Button, {
|
113
|
+
"size": "small",
|
114
|
+
"onClick": clear
|
115
|
+
}, {
|
116
|
+
default: () => [props.clearButtonText || t("clear")]
|
117
|
+
}), _createVNode(Button, {
|
118
|
+
"type": "primary",
|
119
|
+
"size": "small",
|
120
|
+
"onClick": submit
|
121
|
+
}, {
|
122
|
+
default: () => [props.confirmButtonText || t("confirm")]
|
123
|
+
})])]);
|
124
|
+
}
|
125
|
+
});
|
126
|
+
export {
|
127
|
+
stdin_default as default,
|
128
|
+
signatureProps
|
129
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
:root{--van-signature-padding: var(--van-padding-xs);--van-signature-content-height: 200px;--van-signature-content-background: var(--van-background-2);--van-signature-content-border: 1px dotted #dadada}.van-signature{padding:var(--van-signature-padding)}.van-signature__content{display:flex;justify-content:center;align-items:center;height:var(--van-signature-content-height);background-color:var(--van-signature-content-background);border:var(--van-signature-content-border);border-radius:var(--van-radius-lg);overflow:hidden}.van-signature__footer{display:flex;justify-content:flex-end}.van-signature__footer .van-button{padding:0 var(--van-padding-md);margin-top:var(--van-padding-xs);margin-left:var(--van-padding-xs)}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
export declare const Signature: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
tips: StringConstructor;
|
3
|
+
type: {
|
4
|
+
type: import("vue").PropType<string>;
|
5
|
+
default: string;
|
6
|
+
};
|
7
|
+
penColor: {
|
8
|
+
type: import("vue").PropType<string>;
|
9
|
+
default: string;
|
10
|
+
};
|
11
|
+
lineWidth: {
|
12
|
+
type: NumberConstructor;
|
13
|
+
default: number;
|
14
|
+
};
|
15
|
+
clearButtonText: StringConstructor;
|
16
|
+
confirmButtonText: StringConstructor;
|
17
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("submit" | "start" | "clear" | "end" | "signing")[], "submit" | "start" | "clear" | "end" | "signing", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
18
|
+
tips: StringConstructor;
|
19
|
+
type: {
|
20
|
+
type: import("vue").PropType<string>;
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
penColor: {
|
24
|
+
type: import("vue").PropType<string>;
|
25
|
+
default: string;
|
26
|
+
};
|
27
|
+
lineWidth: {
|
28
|
+
type: NumberConstructor;
|
29
|
+
default: number;
|
30
|
+
};
|
31
|
+
clearButtonText: StringConstructor;
|
32
|
+
confirmButtonText: StringConstructor;
|
33
|
+
}>> & {
|
34
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
35
|
+
onClear?: ((...args: any[]) => any) | undefined;
|
36
|
+
onStart?: ((...args: any[]) => any) | undefined;
|
37
|
+
onEnd?: ((...args: any[]) => any) | undefined;
|
38
|
+
onSigning?: ((...args: any[]) => any) | undefined;
|
39
|
+
}, {
|
40
|
+
type: string;
|
41
|
+
lineWidth: number;
|
42
|
+
penColor: string;
|
43
|
+
}>>;
|
44
|
+
export default Signature;
|
45
|
+
export type { SignatureProps } from './Signature';
|
46
|
+
declare module 'vue' {
|
47
|
+
interface GlobalComponents {
|
48
|
+
Signature: typeof Signature;
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/lib/date-picker/utils.js
CHANGED
@@ -61,10 +61,9 @@ const genOptions = (min, max, type, formatter, filter) => {
|
|
61
61
|
const formatValueRange = (values, columns) => values.map((value, index) => {
|
62
62
|
const column = columns[index];
|
63
63
|
if (column.length) {
|
64
|
+
const minValue = +column[0].value;
|
64
65
|
const maxValue = +column[column.length - 1].value;
|
65
|
-
|
66
|
-
return String(maxValue);
|
67
|
-
}
|
66
|
+
return (0, import_utils.padZero)((0, import_utils.clamp)(+value, minValue, maxValue));
|
68
67
|
}
|
69
68
|
return value;
|
70
69
|
});
|
package/lib/field/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-text-color);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size:
|
1
|
+
:root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-text-color);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size: 18px;--van-field-clear-icon-size: 18px;--van-field-clear-icon-color: var(--van-gray-5);--van-field-right-icon-color: var(--van-gray-6);--van-field-error-message-color: var(--van-danger-color);--van-field-error-message-font-size: 12px;--van-field-text-area-min-height: 60px;--van-field-word-limit-color: var(--van-gray-7);--van-field-word-limit-font-size: var(--van-font-size-sm);--van-field-word-limit-line-height: 16px;--van-field-disabled-text-color: var(--van-text-color-3);--van-field-required-mark-color: var(--van-red)}.van-field{flex-wrap:wrap}.van-field__label{flex:none;box-sizing:border-box;width:var(--van-field-label-width);margin-right:var(--van-field-label-margin-right);color:var(--van-field-label-color);text-align:left;word-wrap:break-word}.van-field__label--center{text-align:center}.van-field__label--right{text-align:right}.van-field__label--top{display:flex;width:100%;text-align:left;margin-bottom:var(--van-padding-base);word-break:break-word}.van-field__label--required:before{margin-right:2px;color:var(--van-field-required-mark-color);content:"*"}.van-field--disabled .van-field__label{color:var(--van-field-disabled-text-color)}.van-field__value{overflow:visible}.van-field__body{display:flex;align-items:center}.van-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--van-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.van-field__control::-webkit-input-placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control::placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control:read-only{cursor:default}.van-field__control:disabled{color:var(--van-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--van-field-input-disabled-text-color)}.van-field__control--center{justify-content:center;text-align:center}.van-field__control--right{justify-content:flex-end;text-align:right}.van-field__control--custom{display:flex;align-items:center;min-height:var(--van-cell-line-height)}.van-field__control--error::-webkit-input-placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--error,.van-field__control--error::placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--min-height{min-height:var(--van-field-text-area-min-height)}.van-field__control[type=date],.van-field__control[type=time],.van-field__control[type=datetime-local]{min-height:var(--van-cell-line-height)}.van-field__control[type=search]{-webkit-appearance:none}.van-field__clear,.van-field__icon,.van-field__button,.van-field__right-icon{flex-shrink:0}.van-field__clear,.van-field__right-icon{margin-right:calc(var(--van-padding-xs) * -1);padding:0 var(--van-padding-xs);line-height:inherit}.van-field__clear{color:var(--van-field-clear-icon-color);font-size:var(--van-field-clear-icon-size);cursor:pointer}.van-field__left-icon .van-icon,.van-field__right-icon .van-icon{display:block;font-size:var(--van-field-icon-size);line-height:inherit}.van-field__left-icon{margin-right:var(--van-padding-base)}.van-field__right-icon{color:var(--van-field-right-icon-color)}.van-field__button{padding-left:var(--van-padding-xs)}.van-field__error-message{color:var(--van-field-error-message-color);font-size:var(--van-field-error-message-font-size);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{margin-top:var(--van-padding-base);color:var(--van-field-word-limit-color);font-size:var(--van-field-word-limit-font-size);line-height:var(--van-field-word-limit-line-height);text-align:right}
|
package/lib/image/Image.js
CHANGED
@@ -171,7 +171,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
171
171
|
(0, import_vue2.onMounted)(() => {
|
172
172
|
(0, import_vue2.nextTick)(() => {
|
173
173
|
var _a;
|
174
|
-
if ((_a = imageRef.value) == null ? void 0 : _a.complete) {
|
174
|
+
if (((_a = imageRef.value) == null ? void 0 : _a.complete) && !props.lazyLoad) {
|
175
175
|
triggerLoad();
|
176
176
|
}
|
177
177
|
});
|