vant 4.9.22 → 4.9.23
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.md +0 -2
- package/es/action-bar-icon/ActionBarIcon.d.ts +4 -0
- package/es/action-bar-icon/ActionBarIcon.mjs +12 -4
- package/es/action-bar-icon/index.css +1 -1
- package/es/action-bar-icon/index.d.ts +3 -0
- package/es/field/Field.mjs +2 -1
- package/es/floating-panel/FloatingPanel.d.ts +13 -0
- package/es/floating-panel/FloatingPanel.mjs +12 -0
- package/es/floating-panel/index.css +1 -1
- package/es/floating-panel/index.d.ts +9 -0
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/locale/lang/ar-SA.d.ts +1 -0
- package/es/locale/lang/ar-SA.mjs +10 -1
- package/es/locale/lang/bg-BG.d.ts +1 -0
- package/es/locale/lang/bg-BG.mjs +1 -0
- package/es/locale/lang/bn-BD.d.ts +1 -0
- package/es/locale/lang/bn-BD.mjs +1 -0
- package/es/locale/lang/da-DK.d.ts +1 -0
- package/es/locale/lang/da-DK.mjs +1 -0
- package/es/locale/lang/de-DE-formal.d.ts +1 -0
- package/es/locale/lang/de-DE-formal.mjs +1 -0
- package/es/locale/lang/de-DE.d.ts +1 -0
- package/es/locale/lang/de-DE.mjs +1 -0
- package/es/locale/lang/el-GR.d.ts +1 -0
- package/es/locale/lang/el-GR.mjs +1 -0
- package/es/locale/lang/en-US.d.ts +1 -0
- package/es/locale/lang/en-US.mjs +1 -0
- package/es/locale/lang/eo-EO.d.ts +1 -0
- package/es/locale/lang/eo-EO.mjs +1 -0
- package/es/locale/lang/es-ES.d.ts +1 -0
- package/es/locale/lang/es-ES.mjs +1 -0
- package/es/locale/lang/fa-IR.d.ts +1 -0
- package/es/locale/lang/fa-IR.mjs +1 -0
- package/es/locale/lang/fr-FR.d.ts +1 -0
- package/es/locale/lang/fr-FR.mjs +1 -0
- package/es/locale/lang/he-IL.d.ts +1 -0
- package/es/locale/lang/he-IL.mjs +1 -0
- package/es/locale/lang/hi-IN.d.ts +1 -0
- package/es/locale/lang/hi-IN.mjs +1 -0
- package/es/locale/lang/id-ID.d.ts +1 -0
- package/es/locale/lang/id-ID.mjs +1 -0
- package/es/locale/lang/is-IS.d.ts +1 -0
- package/es/locale/lang/is-IS.mjs +1 -0
- package/es/locale/lang/it-IT.d.ts +1 -0
- package/es/locale/lang/it-IT.mjs +1 -0
- package/es/locale/lang/ja-JP.d.ts +1 -0
- package/es/locale/lang/ja-JP.mjs +1 -0
- package/es/locale/lang/kk-KZ.d.ts +1 -0
- package/es/locale/lang/kk-KZ.mjs +1 -0
- package/es/locale/lang/km-KH.d.ts +1 -0
- package/es/locale/lang/km-KH.mjs +1 -0
- package/es/locale/lang/ko-KR.d.ts +1 -0
- package/es/locale/lang/ko-KR.mjs +1 -0
- package/es/locale/lang/la-LA.d.ts +1 -0
- package/es/locale/lang/la-LA.mjs +1 -0
- package/es/locale/lang/mm-MN.d.ts +1 -0
- package/es/locale/lang/mm-MN.mjs +1 -0
- package/es/locale/lang/nb-NO.d.ts +1 -0
- package/es/locale/lang/nb-NO.mjs +1 -0
- package/es/locale/lang/nl-NL.d.ts +1 -0
- package/es/locale/lang/nl-NL.mjs +1 -0
- package/es/locale/lang/pl-PL.d.ts +1 -0
- package/es/locale/lang/pl-PL.mjs +1 -0
- package/es/locale/lang/pt-BR.d.ts +1 -0
- package/es/locale/lang/pt-BR.mjs +1 -0
- package/es/locale/lang/ro-RO.d.ts +1 -0
- package/es/locale/lang/ro-RO.mjs +1 -0
- package/es/locale/lang/ru-RU.d.ts +1 -0
- package/es/locale/lang/ru-RU.mjs +1 -0
- package/es/locale/lang/sr-RS.d.ts +1 -0
- package/es/locale/lang/sr-RS.mjs +1 -0
- package/es/locale/lang/sv-SE.d.ts +1 -0
- package/es/locale/lang/sv-SE.mjs +1 -0
- package/es/locale/lang/th-TH.d.ts +1 -0
- package/es/locale/lang/th-TH.mjs +1 -0
- package/es/locale/lang/tr-TR.d.ts +1 -0
- package/es/locale/lang/tr-TR.mjs +1 -0
- package/es/locale/lang/uk-UA.d.ts +1 -0
- package/es/locale/lang/uk-UA.mjs +1 -0
- package/es/locale/lang/vi-VN.d.ts +1 -0
- package/es/locale/lang/vi-VN.mjs +1 -0
- package/es/locale/lang/zh-CN.d.ts +1 -0
- package/es/locale/lang/zh-CN.mjs +1 -0
- package/es/locale/lang/zh-HK.d.ts +1 -0
- package/es/locale/lang/zh-HK.mjs +1 -0
- package/es/locale/lang/zh-TW.d.ts +1 -0
- package/es/locale/lang/zh-TW.mjs +1 -0
- package/es/popup/index.d.ts +1 -0
- package/es/popup/index.mjs +7 -1
- package/es/progress/Progress.mjs +8 -4
- package/es/signature/Signature.d.ts +16 -0
- package/es/signature/Signature.mjs +32 -1
- package/es/signature/index.d.ts +11 -0
- package/es/signature/types.d.ts +1 -0
- package/es/swipe-cell/SwipeCell.d.ts +16 -0
- package/es/swipe-cell/SwipeCell.mjs +7 -2
- package/es/swipe-cell/index.d.ts +11 -0
- package/lib/action-bar-icon/ActionBarIcon.d.ts +4 -0
- package/lib/action-bar-icon/ActionBarIcon.js +12 -4
- package/lib/action-bar-icon/index.css +1 -1
- package/lib/action-bar-icon/index.d.ts +3 -0
- package/lib/field/Field.js +2 -1
- package/lib/floating-panel/FloatingPanel.d.ts +13 -0
- package/lib/floating-panel/FloatingPanel.js +12 -0
- package/lib/floating-panel/index.css +1 -1
- package/lib/floating-panel/index.d.ts +9 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/lang/ar-SA.d.ts +1 -0
- package/lib/locale/lang/ar-SA.js +10 -1
- package/lib/locale/lang/bg-BG.d.ts +1 -0
- package/lib/locale/lang/bg-BG.js +1 -0
- package/lib/locale/lang/bn-BD.d.ts +1 -0
- package/lib/locale/lang/bn-BD.js +1 -0
- package/lib/locale/lang/da-DK.d.ts +1 -0
- package/lib/locale/lang/da-DK.js +1 -0
- package/lib/locale/lang/de-DE-formal.d.ts +1 -0
- package/lib/locale/lang/de-DE-formal.js +1 -0
- package/lib/locale/lang/de-DE.d.ts +1 -0
- package/lib/locale/lang/de-DE.js +1 -0
- package/lib/locale/lang/el-GR.d.ts +1 -0
- package/lib/locale/lang/el-GR.js +1 -0
- package/lib/locale/lang/en-US.d.ts +1 -0
- package/lib/locale/lang/en-US.js +1 -0
- package/lib/locale/lang/eo-EO.d.ts +1 -0
- package/lib/locale/lang/eo-EO.js +1 -0
- package/lib/locale/lang/es-ES.d.ts +1 -0
- package/lib/locale/lang/es-ES.js +1 -0
- package/lib/locale/lang/fa-IR.d.ts +1 -0
- package/lib/locale/lang/fa-IR.js +1 -0
- package/lib/locale/lang/fr-FR.d.ts +1 -0
- package/lib/locale/lang/fr-FR.js +1 -0
- package/lib/locale/lang/he-IL.d.ts +1 -0
- package/lib/locale/lang/he-IL.js +1 -0
- package/lib/locale/lang/hi-IN.d.ts +1 -0
- package/lib/locale/lang/hi-IN.js +1 -0
- package/lib/locale/lang/id-ID.d.ts +1 -0
- package/lib/locale/lang/id-ID.js +1 -0
- package/lib/locale/lang/is-IS.d.ts +1 -0
- package/lib/locale/lang/is-IS.js +1 -0
- package/lib/locale/lang/it-IT.d.ts +1 -0
- package/lib/locale/lang/it-IT.js +1 -0
- package/lib/locale/lang/ja-JP.d.ts +1 -0
- package/lib/locale/lang/ja-JP.js +1 -0
- package/lib/locale/lang/kk-KZ.d.ts +1 -0
- package/lib/locale/lang/kk-KZ.js +1 -0
- package/lib/locale/lang/km-KH.d.ts +1 -0
- package/lib/locale/lang/km-KH.js +1 -0
- package/lib/locale/lang/ko-KR.d.ts +1 -0
- package/lib/locale/lang/ko-KR.js +1 -0
- package/lib/locale/lang/la-LA.d.ts +1 -0
- package/lib/locale/lang/la-LA.js +1 -0
- package/lib/locale/lang/mm-MN.d.ts +1 -0
- package/lib/locale/lang/mm-MN.js +1 -0
- package/lib/locale/lang/nb-NO.d.ts +1 -0
- package/lib/locale/lang/nb-NO.js +1 -0
- package/lib/locale/lang/nl-NL.d.ts +1 -0
- package/lib/locale/lang/nl-NL.js +1 -0
- package/lib/locale/lang/pl-PL.d.ts +1 -0
- package/lib/locale/lang/pl-PL.js +1 -0
- package/lib/locale/lang/pt-BR.d.ts +1 -0
- package/lib/locale/lang/pt-BR.js +1 -0
- package/lib/locale/lang/ro-RO.d.ts +1 -0
- package/lib/locale/lang/ro-RO.js +1 -0
- package/lib/locale/lang/ru-RU.d.ts +1 -0
- package/lib/locale/lang/ru-RU.js +1 -0
- package/lib/locale/lang/sr-RS.d.ts +1 -0
- package/lib/locale/lang/sr-RS.js +1 -0
- package/lib/locale/lang/sv-SE.d.ts +1 -0
- package/lib/locale/lang/sv-SE.js +1 -0
- package/lib/locale/lang/th-TH.d.ts +1 -0
- package/lib/locale/lang/th-TH.js +1 -0
- package/lib/locale/lang/tr-TR.d.ts +1 -0
- package/lib/locale/lang/tr-TR.js +1 -0
- package/lib/locale/lang/uk-UA.d.ts +1 -0
- package/lib/locale/lang/uk-UA.js +1 -0
- package/lib/locale/lang/vi-VN.d.ts +1 -0
- package/lib/locale/lang/vi-VN.js +1 -0
- package/lib/locale/lang/zh-CN.d.ts +1 -0
- package/lib/locale/lang/zh-CN.js +1 -0
- package/lib/locale/lang/zh-HK.d.ts +1 -0
- package/lib/locale/lang/zh-HK.js +1 -0
- package/lib/locale/lang/zh-TW.d.ts +1 -0
- package/lib/locale/lang/zh-TW.js +1 -0
- package/lib/popup/index.d.ts +1 -0
- package/lib/popup/index.js +4 -1
- package/lib/progress/Progress.js +8 -4
- package/lib/signature/Signature.d.ts +16 -0
- package/lib/signature/Signature.js +32 -1
- package/lib/signature/index.d.ts +11 -0
- package/lib/signature/types.d.ts +1 -0
- package/lib/swipe-cell/SwipeCell.d.ts +16 -0
- package/lib/swipe-cell/SwipeCell.js +7 -2
- package/lib/swipe-cell/index.d.ts +11 -0
- package/lib/vant.cjs.js +77 -13
- package/lib/vant.es.js +77 -13
- package/lib/vant.js +80 -16
- package/lib/vant.min.js +3 -3
- package/lib/web-types.json +1 -1
- package/package.json +33 -33
package/es/locale/lang/ko-KR.mjs
CHANGED
package/es/locale/lang/la-LA.mjs
CHANGED
|
@@ -3,6 +3,7 @@ var stdin_default = {
|
|
|
3
3
|
tel: "\u0EC2\u0E97\u0EA5\u0EB0\u0EAA\u0EB1\u0E9A",
|
|
4
4
|
save: "\u0E9A\u0EB1\u0E99\u0E97\u0EB6\u0E81",
|
|
5
5
|
clear: "\u0E88\u0EB0\u0EC1\u0E88\u0EC9\u0E87",
|
|
6
|
+
undo: "\u0E8D\u0EBB\u0E81\u0EC0\u0EA5\u0EB5\u0E81",
|
|
6
7
|
cancel: "\u0E8D\u0EBB\u0E81\u0EC0\u0EA5\u0EB5\u0E81",
|
|
7
8
|
confirm: "\u0EA2\u0EB6\u0E99\u0EA2\u0EB1\u0E99",
|
|
8
9
|
delete: "\u0EA5\u0EB7\u0E9A",
|
package/es/locale/lang/mm-MN.mjs
CHANGED
|
@@ -3,6 +3,7 @@ var stdin_default = {
|
|
|
3
3
|
tel: "\u0423\u0442\u0430\u0441",
|
|
4
4
|
save: "\u0425\u0430\u0434\u0433\u0430\u043B\u0430\u0445",
|
|
5
5
|
clear: "\u0422\u043E\u0434\u043E\u0440\u0445\u043E\u0439",
|
|
6
|
+
undo: "\u0411\u0443\u0446\u0430\u0430\u0445",
|
|
6
7
|
cancel: "\u0426\u0443\u0446\u043B\u0430\u0445",
|
|
7
8
|
confirm: "\u0411\u0430\u0442\u0430\u043B\u0433\u0430\u0430\u0436\u0443\u0443\u043B\u0430\u0445",
|
|
8
9
|
delete: "\u0423\u0441\u0442\u0433\u0430\u0445",
|
package/es/locale/lang/nb-NO.mjs
CHANGED
package/es/locale/lang/nl-NL.mjs
CHANGED
package/es/locale/lang/pl-PL.mjs
CHANGED
package/es/locale/lang/pt-BR.mjs
CHANGED
package/es/locale/lang/ro-RO.mjs
CHANGED
package/es/locale/lang/ru-RU.mjs
CHANGED
|
@@ -3,6 +3,7 @@ var stdin_default = {
|
|
|
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
|
+
undo: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",
|
|
6
7
|
cancel: "\u041E\u0442\u043C\u0435\u043D\u0430",
|
|
7
8
|
confirm: "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C",
|
|
8
9
|
delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
|
package/es/locale/lang/sr-RS.mjs
CHANGED
package/es/locale/lang/sv-SE.mjs
CHANGED
package/es/locale/lang/th-TH.mjs
CHANGED
|
@@ -3,6 +3,7 @@ var stdin_default = {
|
|
|
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
|
+
undo: "\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",
|
|
6
7
|
cancel: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",
|
|
7
8
|
confirm: "\u0E22\u0E37\u0E19\u0E22\u0E31\u0E19",
|
|
8
9
|
delete: "\u0E25\u0E1A",
|
package/es/locale/lang/tr-TR.mjs
CHANGED
package/es/locale/lang/uk-UA.mjs
CHANGED
|
@@ -3,6 +3,7 @@ var stdin_default = {
|
|
|
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
|
+
undo: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",
|
|
6
7
|
cancel: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",
|
|
7
8
|
confirm: "\u041F\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438",
|
|
8
9
|
delete: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
|
package/es/locale/lang/vi-VN.mjs
CHANGED
package/es/locale/lang/zh-CN.mjs
CHANGED
package/es/locale/lang/zh-HK.mjs
CHANGED
package/es/locale/lang/zh-TW.mjs
CHANGED
package/es/popup/index.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export declare const Popup: import("../utils").WithInstall<import("vue").DefineC
|
|
|
120
120
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
121
121
|
export default Popup;
|
|
122
122
|
export { popupProps } from './Popup';
|
|
123
|
+
export { useGlobalZIndex, setGlobalZIndex, } from '../composables/use-global-z-index';
|
|
123
124
|
export type { PopupProps } from './Popup';
|
|
124
125
|
export type { PopupPosition, PopupInstance, PopupThemeVars, PopupCloseIconPosition, } from './types';
|
|
125
126
|
declare module 'vue' {
|
package/es/popup/index.mjs
CHANGED
|
@@ -3,8 +3,14 @@ import _Popup from "./Popup.mjs";
|
|
|
3
3
|
const Popup = withInstall(_Popup);
|
|
4
4
|
var stdin_default = Popup;
|
|
5
5
|
import { popupProps } from "./Popup.mjs";
|
|
6
|
+
import {
|
|
7
|
+
useGlobalZIndex,
|
|
8
|
+
setGlobalZIndex
|
|
9
|
+
} from "../composables/use-global-z-index.mjs";
|
|
6
10
|
export {
|
|
7
11
|
Popup,
|
|
8
12
|
stdin_default as default,
|
|
9
|
-
popupProps
|
|
13
|
+
popupProps,
|
|
14
|
+
setGlobalZIndex,
|
|
15
|
+
useGlobalZIndex
|
|
10
16
|
};
|
package/es/progress/Progress.mjs
CHANGED
|
@@ -19,7 +19,9 @@ const progressProps = {
|
|
|
19
19
|
var stdin_default = defineComponent({
|
|
20
20
|
name,
|
|
21
21
|
props: progressProps,
|
|
22
|
-
setup(props
|
|
22
|
+
setup(props, {
|
|
23
|
+
slots
|
|
24
|
+
}) {
|
|
23
25
|
const background = computed(() => props.inactive ? void 0 : props.color);
|
|
24
26
|
const format = (rate) => Math.min(Math.max(+rate, 0), 100);
|
|
25
27
|
const renderPivot = () => {
|
|
@@ -30,8 +32,8 @@ var stdin_default = defineComponent({
|
|
|
30
32
|
percentage
|
|
31
33
|
} = props;
|
|
32
34
|
const safePercentage = format(percentage);
|
|
33
|
-
const text = pivotText != null ? pivotText : `${
|
|
34
|
-
if (props.showPivot && text) {
|
|
35
|
+
const text = pivotText != null ? pivotText : `${safePercentage}%`;
|
|
36
|
+
if (props.showPivot && (slots.pivot || text)) {
|
|
35
37
|
const style = {
|
|
36
38
|
color: textColor,
|
|
37
39
|
left: `${safePercentage}%`,
|
|
@@ -43,7 +45,9 @@ var stdin_default = defineComponent({
|
|
|
43
45
|
"class": bem("pivot", {
|
|
44
46
|
inactive: props.inactive
|
|
45
47
|
})
|
|
46
|
-
}, [
|
|
48
|
+
}, [slots.pivot ? slots.pivot({
|
|
49
|
+
percentage: safePercentage
|
|
50
|
+
}) : text]);
|
|
47
51
|
}
|
|
48
52
|
};
|
|
49
53
|
return () => {
|
|
@@ -13,6 +13,11 @@ export declare const signatureProps: {
|
|
|
13
13
|
type: NumberConstructor;
|
|
14
14
|
default: number;
|
|
15
15
|
};
|
|
16
|
+
historySize: {
|
|
17
|
+
type: NumberConstructor;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
undoButtonText: StringConstructor;
|
|
16
21
|
clearButtonText: StringConstructor;
|
|
17
22
|
backgroundColor: {
|
|
18
23
|
type: import("vue").PropType<string>;
|
|
@@ -35,6 +40,11 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
35
40
|
type: NumberConstructor;
|
|
36
41
|
default: number;
|
|
37
42
|
};
|
|
43
|
+
historySize: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
undoButtonText: StringConstructor;
|
|
38
48
|
clearButtonText: StringConstructor;
|
|
39
49
|
backgroundColor: {
|
|
40
50
|
type: import("vue").PropType<string>;
|
|
@@ -55,6 +65,11 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
55
65
|
type: NumberConstructor;
|
|
56
66
|
default: number;
|
|
57
67
|
};
|
|
68
|
+
historySize: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
default: number;
|
|
71
|
+
};
|
|
72
|
+
undoButtonText: StringConstructor;
|
|
58
73
|
clearButtonText: StringConstructor;
|
|
59
74
|
backgroundColor: {
|
|
60
75
|
type: import("vue").PropType<string>;
|
|
@@ -72,5 +87,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
72
87
|
backgroundColor: string;
|
|
73
88
|
lineWidth: number;
|
|
74
89
|
penColor: string;
|
|
90
|
+
historySize: number;
|
|
75
91
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
92
|
export default _default;
|
|
@@ -9,6 +9,8 @@ const signatureProps = {
|
|
|
9
9
|
type: makeStringProp("png"),
|
|
10
10
|
penColor: makeStringProp("#000"),
|
|
11
11
|
lineWidth: makeNumberProp(3),
|
|
12
|
+
historySize: makeNumberProp(20),
|
|
13
|
+
undoButtonText: String,
|
|
12
14
|
clearButtonText: String,
|
|
13
15
|
backgroundColor: makeStringProp(""),
|
|
14
16
|
confirmButtonText: String
|
|
@@ -36,6 +38,15 @@ var stdin_default = defineComponent({
|
|
|
36
38
|
let canvasWidth = 0;
|
|
37
39
|
let canvasHeight = 0;
|
|
38
40
|
let canvasRect;
|
|
41
|
+
const history = ref([]);
|
|
42
|
+
const saveState = () => {
|
|
43
|
+
if (ctx.value && canvasWidth && canvasHeight) {
|
|
44
|
+
if (history.value.length >= props.historySize) {
|
|
45
|
+
history.value.shift();
|
|
46
|
+
}
|
|
47
|
+
history.value.push(ctx.value.getImageData(0, 0, canvasWidth, canvasHeight));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
39
50
|
const touchStart = () => {
|
|
40
51
|
if (!ctx.value) {
|
|
41
52
|
return false;
|
|
@@ -62,6 +73,7 @@ var stdin_default = defineComponent({
|
|
|
62
73
|
};
|
|
63
74
|
const touchEnd = (event) => {
|
|
64
75
|
preventDefault(event);
|
|
76
|
+
saveState();
|
|
65
77
|
emit("end");
|
|
66
78
|
};
|
|
67
79
|
const isCanvasEmpty = (canvas) => {
|
|
@@ -102,8 +114,21 @@ var stdin_default = defineComponent({
|
|
|
102
114
|
ctx.value.closePath();
|
|
103
115
|
setCanvasBgColor(ctx.value);
|
|
104
116
|
}
|
|
117
|
+
history.value = [];
|
|
105
118
|
emit("clear");
|
|
106
119
|
};
|
|
120
|
+
const undo = () => {
|
|
121
|
+
if (history.value.length) {
|
|
122
|
+
history.value.pop();
|
|
123
|
+
if (ctx.value) {
|
|
124
|
+
ctx.value.clearRect(0, 0, canvasWidth, canvasHeight);
|
|
125
|
+
setCanvasBgColor(ctx.value);
|
|
126
|
+
if (history.value.length) {
|
|
127
|
+
ctx.value.putImageData(history.value[history.value.length - 1], 0, 0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
107
132
|
const initialize = () => {
|
|
108
133
|
var _a, _b, _c;
|
|
109
134
|
if (isRenderCanvas && canvasRef.value) {
|
|
@@ -127,7 +152,8 @@ var stdin_default = defineComponent({
|
|
|
127
152
|
useExpose({
|
|
128
153
|
resize,
|
|
129
154
|
clear,
|
|
130
|
-
submit
|
|
155
|
+
submit,
|
|
156
|
+
undo
|
|
131
157
|
});
|
|
132
158
|
return () => _createVNode("div", {
|
|
133
159
|
"class": bem()
|
|
@@ -146,6 +172,11 @@ var stdin_default = defineComponent({
|
|
|
146
172
|
"onClick": clear
|
|
147
173
|
}, {
|
|
148
174
|
default: () => [props.clearButtonText || t("clear")]
|
|
175
|
+
}), _createVNode(Button, {
|
|
176
|
+
"size": "small",
|
|
177
|
+
"onClick": undo
|
|
178
|
+
}, {
|
|
179
|
+
default: () => [props.undoButtonText || t("undo")]
|
|
149
180
|
}), _createVNode(Button, {
|
|
150
181
|
"type": "primary",
|
|
151
182
|
"size": "small",
|
package/es/signature/index.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export declare const Signature: import("../utils").WithInstall<import("vue").Def
|
|
|
12
12
|
type: NumberConstructor;
|
|
13
13
|
default: number;
|
|
14
14
|
};
|
|
15
|
+
historySize: {
|
|
16
|
+
type: NumberConstructor;
|
|
17
|
+
default: number;
|
|
18
|
+
};
|
|
19
|
+
undoButtonText: StringConstructor;
|
|
15
20
|
clearButtonText: StringConstructor;
|
|
16
21
|
backgroundColor: {
|
|
17
22
|
type: import("vue").PropType<string>;
|
|
@@ -32,6 +37,11 @@ export declare const Signature: import("../utils").WithInstall<import("vue").Def
|
|
|
32
37
|
type: NumberConstructor;
|
|
33
38
|
default: number;
|
|
34
39
|
};
|
|
40
|
+
historySize: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: number;
|
|
43
|
+
};
|
|
44
|
+
undoButtonText: StringConstructor;
|
|
35
45
|
clearButtonText: StringConstructor;
|
|
36
46
|
backgroundColor: {
|
|
37
47
|
type: import("vue").PropType<string>;
|
|
@@ -49,6 +59,7 @@ export declare const Signature: import("../utils").WithInstall<import("vue").Def
|
|
|
49
59
|
backgroundColor: string;
|
|
50
60
|
lineWidth: number;
|
|
51
61
|
penColor: string;
|
|
62
|
+
historySize: number;
|
|
52
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
53
64
|
export default Signature;
|
|
54
65
|
export type { SignatureProps } from './Signature';
|
package/es/signature/types.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export declare const swipeCellProps: {
|
|
|
8
8
|
disabled: BooleanConstructor;
|
|
9
9
|
leftWidth: (NumberConstructor | StringConstructor)[];
|
|
10
10
|
rightWidth: (NumberConstructor | StringConstructor)[];
|
|
11
|
+
threshold: {
|
|
12
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
13
|
+
default: number;
|
|
14
|
+
validator: (value: number | string) => boolean;
|
|
15
|
+
};
|
|
11
16
|
beforeClose: PropType<Interceptor>;
|
|
12
17
|
stopPropagation: BooleanConstructor;
|
|
13
18
|
};
|
|
@@ -20,6 +25,11 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
20
25
|
disabled: BooleanConstructor;
|
|
21
26
|
leftWidth: (NumberConstructor | StringConstructor)[];
|
|
22
27
|
rightWidth: (NumberConstructor | StringConstructor)[];
|
|
28
|
+
threshold: {
|
|
29
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
30
|
+
default: number;
|
|
31
|
+
validator: (value: number | string) => boolean;
|
|
32
|
+
};
|
|
23
33
|
beforeClose: PropType<Interceptor>;
|
|
24
34
|
stopPropagation: BooleanConstructor;
|
|
25
35
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("open" | "click" | "close")[], "open" | "click" | "close", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
@@ -30,6 +40,11 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
30
40
|
disabled: BooleanConstructor;
|
|
31
41
|
leftWidth: (NumberConstructor | StringConstructor)[];
|
|
32
42
|
rightWidth: (NumberConstructor | StringConstructor)[];
|
|
43
|
+
threshold: {
|
|
44
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
45
|
+
default: number;
|
|
46
|
+
validator: (value: number | string) => boolean;
|
|
47
|
+
};
|
|
33
48
|
beforeClose: PropType<Interceptor>;
|
|
34
49
|
stopPropagation: BooleanConstructor;
|
|
35
50
|
}>> & Readonly<{
|
|
@@ -40,5 +55,6 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
40
55
|
name: string | number;
|
|
41
56
|
disabled: boolean;
|
|
42
57
|
stopPropagation: boolean;
|
|
58
|
+
threshold: string | number;
|
|
43
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
44
60
|
export default _default;
|
|
@@ -9,6 +9,11 @@ const swipeCellProps = {
|
|
|
9
9
|
disabled: Boolean,
|
|
10
10
|
leftWidth: numericProp,
|
|
11
11
|
rightWidth: numericProp,
|
|
12
|
+
threshold: {
|
|
13
|
+
type: numericProp,
|
|
14
|
+
default: 0.15,
|
|
15
|
+
validator: (value) => +value >= 0 && +value <= 1
|
|
16
|
+
},
|
|
12
17
|
beforeClose: Function,
|
|
13
18
|
stopPropagation: Boolean
|
|
14
19
|
};
|
|
@@ -57,8 +62,8 @@ var stdin_default = defineComponent({
|
|
|
57
62
|
};
|
|
58
63
|
const toggle = (side) => {
|
|
59
64
|
const offset = Math.abs(state.offset);
|
|
60
|
-
const
|
|
61
|
-
const threshold = opened ? 1 -
|
|
65
|
+
const thresholdValue = +props.threshold;
|
|
66
|
+
const threshold = opened ? 1 - thresholdValue : thresholdValue;
|
|
62
67
|
const width = side === "left" ? leftWidth.value : rightWidth.value;
|
|
63
68
|
if (width && offset > width * threshold) {
|
|
64
69
|
open(side);
|
package/es/swipe-cell/index.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ export declare const SwipeCell: import("../utils").WithInstall<import("vue").Def
|
|
|
7
7
|
disabled: BooleanConstructor;
|
|
8
8
|
leftWidth: (NumberConstructor | StringConstructor)[];
|
|
9
9
|
rightWidth: (NumberConstructor | StringConstructor)[];
|
|
10
|
+
threshold: {
|
|
11
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
12
|
+
default: number;
|
|
13
|
+
validator: (value: number | string) => boolean;
|
|
14
|
+
};
|
|
10
15
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
|
11
16
|
stopPropagation: BooleanConstructor;
|
|
12
17
|
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("open" | "click" | "close")[], "open" | "click" | "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -17,6 +22,11 @@ export declare const SwipeCell: import("../utils").WithInstall<import("vue").Def
|
|
|
17
22
|
disabled: BooleanConstructor;
|
|
18
23
|
leftWidth: (NumberConstructor | StringConstructor)[];
|
|
19
24
|
rightWidth: (NumberConstructor | StringConstructor)[];
|
|
25
|
+
threshold: {
|
|
26
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
27
|
+
default: number;
|
|
28
|
+
validator: (value: number | string) => boolean;
|
|
29
|
+
};
|
|
20
30
|
beforeClose: import("vue").PropType<import("../utils").Interceptor>;
|
|
21
31
|
stopPropagation: BooleanConstructor;
|
|
22
32
|
}>> & Readonly<{
|
|
@@ -27,6 +37,7 @@ export declare const SwipeCell: import("../utils").WithInstall<import("vue").Def
|
|
|
27
37
|
name: string | number;
|
|
28
38
|
disabled: boolean;
|
|
29
39
|
stopPropagation: boolean;
|
|
40
|
+
threshold: string | number;
|
|
30
41
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
31
42
|
export default SwipeCell;
|
|
32
43
|
export { swipeCellProps } from './SwipeCell';
|