vant 4.1.2 → 4.2.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/index.d.ts +2 -1
- package/es/index.mjs +5 -2
- package/es/pagination/Pagination.d.ts +26 -0
- package/es/pagination/Pagination.mjs +14 -4
- package/es/pagination/index.css +1 -1
- package/es/pagination/index.d.ts +18 -0
- package/es/picker/Picker.d.ts +2 -1
- package/es/picker/Picker.mjs +16 -6
- package/es/picker/PickerColumn.d.ts +2 -1
- package/es/picker/PickerColumn.mjs +10 -4
- package/es/picker/index.d.ts +2 -1
- package/es/share-sheet/ShareSheet.mjs +11 -10
- package/es/sticky/Sticky.mjs +20 -4
- package/es/swipe/Swipe.mjs +1 -1
- package/es/tab/Tab.mjs +24 -6
- package/es/{tabs/TabsTitle.d.ts → tab/TabTitle.d.ts} +1 -2
- package/es/{tabs/TabsTitle.mjs → tab/TabTitle.mjs} +2 -2
- package/es/tabs/Tabs.d.ts +1 -1
- package/es/tabs/Tabs.mjs +15 -30
- package/es/tabs/index.d.ts +1 -1
- package/es/tabs/style/index.mjs +0 -1
- package/es/tabs/types.d.ts +3 -1
- package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/es/text-ellipsis/TextEllipsis.mjs +4 -3
- package/es/text-ellipsis/index.d.ts +9 -0
- package/es/watermark/Watermark.d.ts +112 -0
- package/es/watermark/Watermark.mjs +133 -0
- package/es/watermark/index.css +1 -0
- package/es/watermark/index.d.ts +83 -0
- package/es/watermark/index.mjs +10 -0
- package/es/watermark/style/index.d.ts +1 -0
- package/es/watermark/style/index.mjs +2 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +5 -2
- package/lib/pagination/Pagination.d.ts +26 -0
- package/lib/pagination/Pagination.js +13 -3
- package/lib/pagination/index.css +1 -1
- package/lib/pagination/index.d.ts +18 -0
- package/lib/picker/Picker.d.ts +2 -1
- package/lib/picker/Picker.js +16 -6
- package/lib/picker/PickerColumn.d.ts +2 -1
- package/lib/picker/PickerColumn.js +9 -3
- package/lib/picker/index.d.ts +2 -1
- package/lib/share-sheet/ShareSheet.js +11 -10
- package/lib/sticky/Sticky.js +18 -2
- package/lib/swipe/Swipe.js +1 -1
- package/lib/tab/Tab.js +21 -3
- package/lib/{tabs/TabsTitle.d.ts → tab/TabTitle.d.ts} +1 -2
- package/lib/{tabs/TabsTitle.js → tab/TabTitle.js} +2 -2
- package/lib/tabs/Tabs.d.ts +1 -1
- package/lib/tabs/Tabs.js +13 -28
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/style/index.js +0 -1
- package/lib/tabs/types.d.ts +3 -1
- package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/lib/text-ellipsis/TextEllipsis.js +4 -3
- package/lib/text-ellipsis/index.d.ts +9 -0
- package/lib/vant.cjs.js +1158 -981
- package/lib/vant.es.js +1160 -983
- package/lib/vant.js +1159 -982
- package/lib/vant.min.js +1 -1
- package/lib/watermark/Watermark.d.ts +112 -0
- package/lib/watermark/Watermark.js +152 -0
- package/lib/watermark/index.css +1 -0
- package/lib/watermark/index.d.ts +83 -0
- package/lib/watermark/index.js +39 -0
- package/lib/watermark/style/index.d.ts +1 -0
- package/lib/watermark/style/index.js +2 -0
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
@@ -93,10 +93,11 @@ export * from "./time-picker";
|
|
93
93
|
export * from "./toast";
|
94
94
|
export * from "./tree-select";
|
95
95
|
export * from "./uploader";
|
96
|
+
export * from "./watermark";
|
96
97
|
declare namespace _default {
|
97
98
|
export { install };
|
98
99
|
export { version };
|
99
100
|
}
|
100
101
|
export default _default;
|
101
102
|
export function install(app: any): void;
|
102
|
-
export const version: "4.1
|
103
|
+
export const version: "4.2.1";
|
package/lib/index.js
CHANGED
@@ -117,6 +117,7 @@ var import_time_picker = require("./time-picker");
|
|
117
117
|
var import_toast = require("./toast");
|
118
118
|
var import_tree_select = require("./tree-select");
|
119
119
|
var import_uploader = require("./uploader");
|
120
|
+
var import_watermark = require("./watermark");
|
120
121
|
__reExport(stdin_exports, require("./action-bar"), module.exports);
|
121
122
|
__reExport(stdin_exports, require("./action-bar-button"), module.exports);
|
122
123
|
__reExport(stdin_exports, require("./action-bar-icon"), module.exports);
|
@@ -212,7 +213,8 @@ __reExport(stdin_exports, require("./time-picker"), module.exports);
|
|
212
213
|
__reExport(stdin_exports, require("./toast"), module.exports);
|
213
214
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
214
215
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
215
|
-
|
216
|
+
__reExport(stdin_exports, require("./watermark"), module.exports);
|
217
|
+
const version = "4.2.1";
|
216
218
|
function install(app) {
|
217
219
|
const components = [
|
218
220
|
import_action_bar.ActionBar,
|
@@ -308,7 +310,8 @@ function install(app) {
|
|
308
310
|
import_time_picker.TimePicker,
|
309
311
|
import_toast.Toast,
|
310
312
|
import_tree_select.TreeSelect,
|
311
|
-
import_uploader.Uploader
|
313
|
+
import_uploader.Uploader,
|
314
|
+
import_watermark.Watermark
|
312
315
|
];
|
313
316
|
components.forEach((item) => {
|
314
317
|
if (item.install) {
|
@@ -28,6 +28,14 @@ export declare const paginationProps: {
|
|
28
28
|
default: number;
|
29
29
|
};
|
30
30
|
forceEllipses: BooleanConstructor;
|
31
|
+
showPrevButton: {
|
32
|
+
type: BooleanConstructor;
|
33
|
+
default: true;
|
34
|
+
};
|
35
|
+
showNextButton: {
|
36
|
+
type: BooleanConstructor;
|
37
|
+
default: true;
|
38
|
+
};
|
31
39
|
};
|
32
40
|
export type PaginationProps = ExtractPropTypes<typeof paginationProps>;
|
33
41
|
declare const _default: import("vue").DefineComponent<{
|
@@ -58,6 +66,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
58
66
|
default: number;
|
59
67
|
};
|
60
68
|
forceEllipses: BooleanConstructor;
|
69
|
+
showPrevButton: {
|
70
|
+
type: BooleanConstructor;
|
71
|
+
default: true;
|
72
|
+
};
|
73
|
+
showNextButton: {
|
74
|
+
type: BooleanConstructor;
|
75
|
+
default: true;
|
76
|
+
};
|
61
77
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
62
78
|
mode: {
|
63
79
|
type: import("vue").PropType<PaginationMode>;
|
@@ -86,6 +102,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
86
102
|
default: number;
|
87
103
|
};
|
88
104
|
forceEllipses: BooleanConstructor;
|
105
|
+
showPrevButton: {
|
106
|
+
type: BooleanConstructor;
|
107
|
+
default: true;
|
108
|
+
};
|
109
|
+
showNextButton: {
|
110
|
+
type: BooleanConstructor;
|
111
|
+
default: true;
|
112
|
+
};
|
89
113
|
}>> & {
|
90
114
|
onChange?: ((...args: any[]) => any) | undefined;
|
91
115
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
@@ -97,5 +121,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
97
121
|
showPageSize: string | number;
|
98
122
|
itemsPerPage: string | number;
|
99
123
|
forceEllipses: boolean;
|
124
|
+
showPrevButton: boolean;
|
125
|
+
showNextButton: boolean;
|
100
126
|
}>;
|
101
127
|
export default _default;
|
@@ -39,7 +39,9 @@ const paginationProps = {
|
|
39
39
|
totalItems: (0, import_utils.makeNumericProp)(0),
|
40
40
|
showPageSize: (0, import_utils.makeNumericProp)(5),
|
41
41
|
itemsPerPage: (0, import_utils.makeNumericProp)(10),
|
42
|
-
forceEllipses: Boolean
|
42
|
+
forceEllipses: Boolean,
|
43
|
+
showPrevButton: import_utils.truthProp,
|
44
|
+
showNextButton: import_utils.truthProp
|
43
45
|
};
|
44
46
|
var stdin_default = (0, import_vue2.defineComponent)({
|
45
47
|
name,
|
@@ -109,8 +111,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
109
111
|
const renderPrevButton = () => {
|
110
112
|
const {
|
111
113
|
mode,
|
112
|
-
modelValue
|
114
|
+
modelValue,
|
115
|
+
showPrevButton
|
113
116
|
} = props;
|
117
|
+
if (!showPrevButton) {
|
118
|
+
return;
|
119
|
+
}
|
114
120
|
const slot = slots["prev-text"];
|
115
121
|
const disabled = modelValue === 1;
|
116
122
|
return (0, import_vue.createVNode)("li", {
|
@@ -128,8 +134,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
128
134
|
const renderNextButton = () => {
|
129
135
|
const {
|
130
136
|
mode,
|
131
|
-
modelValue
|
137
|
+
modelValue,
|
138
|
+
showNextButton
|
132
139
|
} = props;
|
140
|
+
if (!showNextButton) {
|
141
|
+
return;
|
142
|
+
}
|
133
143
|
const slot = slots["next-text"];
|
134
144
|
const disabled = modelValue === count.value;
|
135
145
|
return (0, import_vue.createVNode)("li", {
|
package/lib/pagination/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-pagination-height: 40px;--van-pagination-font-size: var(--van-font-size-md);--van-pagination-item-width: 36px;--van-pagination-item-default-color: var(--van-primary-color);--van-pagination-item-disabled-color: var(--van-gray-7);--van-pagination-item-disabled-background: var(--van-background);--van-pagination-background: var(--van-background-2);--van-pagination-desc-color: var(--van-gray-7);--van-pagination-disabled-opacity: var(--van-disabled-opacity)}.van-pagination{font-size:var(--van-pagination-font-size)}.van-pagination__items{display:flex}.van-pagination__item,.van-pagination__page-desc{display:flex;align-items:center;justify-content:center}.van-pagination__item{flex:1;box-sizing:border-box;min-width:var(--van-pagination-item-width);height:var(--van-pagination-height);color:var(--van-pagination-item-default-color);background:var(--van-pagination-background);cursor:pointer;-webkit-user-select:none;user-select:none}.van-pagination__item button{flex:1;height:100%;border:none;padding:0;background:transparent}.van-pagination__item button[disabled]{cursor:not-allowed}.van-pagination__item:active{color:var(--van-white);background-color:var(--van-pagination-item-default-color)}.van-pagination__item:not(:last-child):after{border-right-width:0}.van-pagination__item--active{color:var(--van-white);background-color:var(--van-pagination-item-default-color)}.van-pagination__item--page{flex-grow:0}.van-pagination__item--prev,.van-pagination__item--next{padding:0 var(--van-padding-base);cursor:pointer}.van-pagination__item--border:after{border-width:var(--van-border-width)}.van-pagination__item--disabled{color:var(--van-pagination-item-disabled-color);background-color:var(--van-pagination-item-disabled-background);opacity:var(--van-pagination-disabled-opacity)}.van-pagination__page-desc{flex:1;height:var(--van-pagination-height);color:var(--van-pagination-desc-color)}
|
1
|
+
:root{--van-pagination-height: 40px;--van-pagination-font-size: var(--van-font-size-md);--van-pagination-item-width: 36px;--van-pagination-item-default-color: var(--van-primary-color);--van-pagination-item-disabled-color: var(--van-gray-7);--van-pagination-item-disabled-background: var(--van-background);--van-pagination-background: var(--van-background-2);--van-pagination-desc-color: var(--van-gray-7);--van-pagination-disabled-opacity: var(--van-disabled-opacity)}.van-pagination{font-size:var(--van-pagination-font-size)}.van-pagination__items{display:flex}.van-pagination__item,.van-pagination__page-desc{display:flex;align-items:center;justify-content:center}.van-pagination__item{flex:1;box-sizing:border-box;min-width:var(--van-pagination-item-width);height:var(--van-pagination-height);color:var(--van-pagination-item-default-color);background:var(--van-pagination-background);cursor:pointer;-webkit-user-select:none;user-select:none}.van-pagination__item button{flex:1;height:100%;border:none;padding:0;background:transparent}.van-pagination__item button[disabled]{cursor:not-allowed}.van-pagination__item:active{color:var(--van-white);background-color:var(--van-pagination-item-default-color)}.van-pagination__item:not(:last-child):after{border-right-width:0}.van-pagination__item--active{color:var(--van-white);background-color:var(--van-pagination-item-default-color)}.van-pagination__item--page{flex-grow:0}.van-pagination__item--prev,.van-pagination__item--next{padding:0 var(--van-padding-base);cursor:pointer}.van-pagination__item--border:after{border-width:var(--van-border-width)}.van-pagination__item--disabled,.van-pagination__item--disabled:active{color:var(--van-pagination-item-disabled-color);background-color:var(--van-pagination-item-disabled-background);opacity:var(--van-pagination-disabled-opacity)}.van-pagination__page-desc{flex:1;height:var(--van-pagination-height);color:var(--van-pagination-desc-color)}
|
@@ -26,6 +26,14 @@ export declare const Pagination: import("../utils").WithInstall<import("vue").De
|
|
26
26
|
default: number;
|
27
27
|
};
|
28
28
|
forceEllipses: BooleanConstructor;
|
29
|
+
showPrevButton: {
|
30
|
+
type: BooleanConstructor;
|
31
|
+
default: true;
|
32
|
+
};
|
33
|
+
showNextButton: {
|
34
|
+
type: BooleanConstructor;
|
35
|
+
default: true;
|
36
|
+
};
|
29
37
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change")[], "update:modelValue" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
30
38
|
mode: {
|
31
39
|
type: import("vue").PropType<import("./Pagination").PaginationMode>;
|
@@ -54,6 +62,14 @@ export declare const Pagination: import("../utils").WithInstall<import("vue").De
|
|
54
62
|
default: number;
|
55
63
|
};
|
56
64
|
forceEllipses: BooleanConstructor;
|
65
|
+
showPrevButton: {
|
66
|
+
type: BooleanConstructor;
|
67
|
+
default: true;
|
68
|
+
};
|
69
|
+
showNextButton: {
|
70
|
+
type: BooleanConstructor;
|
71
|
+
default: true;
|
72
|
+
};
|
57
73
|
}>> & {
|
58
74
|
onChange?: ((...args: any[]) => any) | undefined;
|
59
75
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
@@ -65,6 +81,8 @@ export declare const Pagination: import("../utils").WithInstall<import("vue").De
|
|
65
81
|
showPageSize: string | number;
|
66
82
|
itemsPerPage: string | number;
|
67
83
|
forceEllipses: boolean;
|
84
|
+
showPrevButton: boolean;
|
85
|
+
showNextButton: boolean;
|
68
86
|
}>>;
|
69
87
|
export default Pagination;
|
70
88
|
export { paginationProps } from './Pagination';
|
package/lib/picker/Picker.d.ts
CHANGED
@@ -104,7 +104,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
104
104
|
default: PickerToolbarPosition;
|
105
105
|
};
|
106
106
|
columnsFieldNames: PropType<PickerFieldNames>;
|
107
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "clickOption" | "confirm")[], "update:modelValue" | "cancel" | "change" | "clickOption" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
107
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "clickOption" | "scrollInto" | "confirm")[], "update:modelValue" | "cancel" | "change" | "clickOption" | "scrollInto" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
108
108
|
loading: BooleanConstructor;
|
109
109
|
readonly: BooleanConstructor;
|
110
110
|
allowHtml: BooleanConstructor;
|
@@ -147,6 +147,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
147
147
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
148
148
|
onCancel?: ((...args: any[]) => any) | undefined;
|
149
149
|
onClickOption?: ((...args: any[]) => any) | undefined;
|
150
|
+
onScrollInto?: ((...args: any[]) => any) | undefined;
|
150
151
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
151
152
|
}, {
|
152
153
|
modelValue: Numeric[];
|
package/lib/picker/Picker.js
CHANGED
@@ -60,7 +60,7 @@ const pickerProps = (0, import_utils.extend)({}, pickerSharedProps, {
|
|
60
60
|
var stdin_default = (0, import_vue2.defineComponent)({
|
61
61
|
name: import_utils2.name,
|
62
62
|
props: pickerProps,
|
63
|
-
emits: ["confirm", "cancel", "change", "clickOption", "update:modelValue"],
|
63
|
+
emits: ["confirm", "cancel", "change", "scrollInto", "clickOption", "update:modelValue"],
|
64
64
|
setup(props, {
|
65
65
|
emit,
|
66
66
|
slots
|
@@ -122,10 +122,14 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
122
122
|
}, getEventParams()));
|
123
123
|
});
|
124
124
|
};
|
125
|
-
const onClickOption = (currentOption, columnIndex) =>
|
126
|
-
|
127
|
-
|
128
|
-
|
125
|
+
const onClickOption = (currentOption, columnIndex) => {
|
126
|
+
const params = {
|
127
|
+
columnIndex,
|
128
|
+
currentOption
|
129
|
+
};
|
130
|
+
emit("clickOption", (0, import_utils.extend)(getEventParams(), params));
|
131
|
+
emit("scrollInto", params);
|
132
|
+
};
|
129
133
|
const confirm = () => {
|
130
134
|
children.forEach((child) => child.stopMomentum());
|
131
135
|
const params = getEventParams();
|
@@ -145,7 +149,13 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
145
149
|
"swipeDuration": props.swipeDuration,
|
146
150
|
"visibleOptionNum": props.visibleOptionNum,
|
147
151
|
"onChange": (value) => onChange(value, columnIndex),
|
148
|
-
"onClickOption": (option) => onClickOption(option, columnIndex)
|
152
|
+
"onClickOption": (option) => onClickOption(option, columnIndex),
|
153
|
+
"onScrollInto": (option) => {
|
154
|
+
emit("scrollInto", {
|
155
|
+
currentOption: option,
|
156
|
+
columnIndex
|
157
|
+
});
|
158
|
+
}
|
149
159
|
}, {
|
150
160
|
option: slots.option
|
151
161
|
}));
|
@@ -25,7 +25,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
25
25
|
type: (NumberConstructor | StringConstructor)[];
|
26
26
|
required: true;
|
27
27
|
};
|
28
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "clickOption")[], "change" | "clickOption", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
28
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "clickOption" | "scrollInto")[], "change" | "clickOption" | "scrollInto", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
29
29
|
value: (NumberConstructor | StringConstructor)[];
|
30
30
|
fields: {
|
31
31
|
type: PropType<Required<PickerFieldNames>>;
|
@@ -52,6 +52,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
52
52
|
}>> & {
|
53
53
|
onChange?: ((...args: any[]) => any) | undefined;
|
54
54
|
onClickOption?: ((...args: any[]) => any) | undefined;
|
55
|
+
onScrollInto?: ((...args: any[]) => any) | undefined;
|
55
56
|
}, {
|
56
57
|
readonly: boolean;
|
57
58
|
allowHtml: boolean;
|
@@ -45,7 +45,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
45
45
|
swipeDuration: (0, import_utils.makeRequiredProp)(import_utils.numericProp),
|
46
46
|
visibleOptionNum: (0, import_utils.makeRequiredProp)(import_utils.numericProp)
|
47
47
|
},
|
48
|
-
emits: ["change", "clickOption"],
|
48
|
+
emits: ["change", "clickOption", "scrollInto"],
|
49
49
|
setup(props, {
|
50
50
|
emit,
|
51
51
|
slots
|
@@ -89,6 +89,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
89
89
|
emit("clickOption", props.options[index]);
|
90
90
|
};
|
91
91
|
const getIndexByOffset = (offset) => (0, import_utils.clamp)(Math.round(-offset / props.optionHeight), 0, count() - 1);
|
92
|
+
const currentIndex = (0, import_vue2.computed)(() => getIndexByOffset(currentOffset.value));
|
92
93
|
const momentum = (distance, duration) => {
|
93
94
|
const speed = Math.abs(distance / duration);
|
94
95
|
distance = currentOffset.value + speed / 3e-3 * (distance < 0 ? -1 : 1);
|
@@ -128,11 +129,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
128
129
|
moving = true;
|
129
130
|
(0, import_utils.preventDefault)(event, true);
|
130
131
|
}
|
131
|
-
|
132
|
+
const newOffset = (0, import_utils.clamp)(startOffset + touch.deltaY.value, -(count() * props.optionHeight), props.optionHeight);
|
133
|
+
const newIndex = getIndexByOffset(newOffset);
|
134
|
+
if (newIndex !== currentIndex.value) {
|
135
|
+
emit("scrollInto", props.options[newIndex]);
|
136
|
+
}
|
137
|
+
currentOffset.value = newOffset;
|
132
138
|
const now = Date.now();
|
133
139
|
if (now - touchStartTime > MOMENTUM_TIME) {
|
134
140
|
touchStartTime = now;
|
135
|
-
momentumOffset =
|
141
|
+
momentumOffset = newOffset;
|
136
142
|
}
|
137
143
|
};
|
138
144
|
const onTouchEnd = () => {
|
package/lib/picker/index.d.ts
CHANGED
@@ -37,7 +37,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
37
37
|
default: import("./types").PickerToolbarPosition;
|
38
38
|
};
|
39
39
|
columnsFieldNames: import("vue").PropType<import("./types").PickerFieldNames>;
|
40
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "clickOption" | "confirm")[], "update:modelValue" | "cancel" | "change" | "clickOption" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
40
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "clickOption" | "scrollInto" | "confirm")[], "update:modelValue" | "cancel" | "change" | "clickOption" | "scrollInto" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
41
41
|
loading: BooleanConstructor;
|
42
42
|
readonly: BooleanConstructor;
|
43
43
|
allowHtml: BooleanConstructor;
|
@@ -80,6 +80,7 @@ export declare const Picker: import("../utils").WithInstall<import("vue").Define
|
|
80
80
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
81
81
|
onCancel?: ((...args: any[]) => any) | undefined;
|
82
82
|
onClickOption?: ((...args: any[]) => any) | undefined;
|
83
|
+
onScrollInto?: ((...args: any[]) => any) | undefined;
|
83
84
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
84
85
|
}, {
|
85
86
|
modelValue: import("../utils").Numeric[];
|
@@ -27,6 +27,7 @@ var import_utils = require("../utils");
|
|
27
27
|
var import_shared = require("../popup/shared");
|
28
28
|
var import_icon = require("../icon");
|
29
29
|
var import_popup = require("../popup");
|
30
|
+
const isImage = (name2) => name2 == null ? void 0 : name2.includes("/");
|
30
31
|
const popupInheritKeys = [...import_shared.popupSharedPropKeys, "round", "closeOnPopstate", "safeAreaInsetBottom"];
|
31
32
|
const iconMap = {
|
32
33
|
qq: "qq",
|
@@ -76,17 +77,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
76
77
|
}
|
77
78
|
};
|
78
79
|
const renderIcon = (icon) => {
|
79
|
-
if (
|
80
|
-
return (0, import_vue.createVNode)("
|
81
|
-
"
|
82
|
-
|
83
|
-
|
84
|
-
}, null)]);
|
80
|
+
if (isImage(icon)) {
|
81
|
+
return (0, import_vue.createVNode)("img", {
|
82
|
+
"src": icon,
|
83
|
+
"class": bem("image-icon")
|
84
|
+
}, null);
|
85
85
|
}
|
86
|
-
return (0, import_vue.createVNode)("
|
87
|
-
"
|
88
|
-
|
89
|
-
|
86
|
+
return (0, import_vue.createVNode)("div", {
|
87
|
+
"class": bem("icon", [icon])
|
88
|
+
}, [(0, import_vue.createVNode)(import_icon.Icon, {
|
89
|
+
"name": iconMap[icon] || icon
|
90
|
+
}, null)]);
|
90
91
|
};
|
91
92
|
const renderOption = (option, index) => {
|
92
93
|
const {
|
package/lib/sticky/Sticky.js
CHANGED
@@ -52,8 +52,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
52
52
|
// root height
|
53
53
|
transform: 0
|
54
54
|
});
|
55
|
+
const isReset = (0, import_vue2.ref)(false);
|
55
56
|
const offset = (0, import_vue2.computed)(() => (0, import_utils.unitToPx)(props.position === "top" ? props.offsetTop : props.offsetBottom));
|
56
57
|
const rootStyle = (0, import_vue2.computed)(() => {
|
58
|
+
if (isReset.value) {
|
59
|
+
return;
|
60
|
+
}
|
57
61
|
const {
|
58
62
|
fixed,
|
59
63
|
height,
|
@@ -67,7 +71,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
67
71
|
}
|
68
72
|
});
|
69
73
|
const stickyStyle = (0, import_vue2.computed)(() => {
|
70
|
-
if (!state.fixed) {
|
74
|
+
if (!state.fixed || isReset.value) {
|
71
75
|
return;
|
72
76
|
}
|
73
77
|
const style = (0, import_utils.extend)((0, import_utils.getZIndexStyle)(props.zIndex), {
|
@@ -126,6 +130,18 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
126
130
|
passive: true
|
127
131
|
});
|
128
132
|
(0, import_use_visibility_change.useVisibilityChange)(root, onScroll);
|
133
|
+
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight], () => {
|
134
|
+
if (!root.value || (0, import_utils.isHidden)(root) || !state.fixed) {
|
135
|
+
return;
|
136
|
+
}
|
137
|
+
isReset.value = true;
|
138
|
+
(0, import_vue2.nextTick)(() => {
|
139
|
+
const rootRect = (0, import_use.useRect)(root);
|
140
|
+
state.width = rootRect.width;
|
141
|
+
state.height = rootRect.height;
|
142
|
+
isReset.value = false;
|
143
|
+
});
|
144
|
+
});
|
129
145
|
return () => {
|
130
146
|
var _a;
|
131
147
|
return (0, import_vue.createVNode)("div", {
|
@@ -133,7 +149,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
133
149
|
"style": rootStyle.value
|
134
150
|
}, [(0, import_vue.createVNode)("div", {
|
135
151
|
"class": bem({
|
136
|
-
fixed: state.fixed
|
152
|
+
fixed: state.fixed && !isReset.value
|
137
153
|
}),
|
138
154
|
"style": stickyStyle.value
|
139
155
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])]);
|
package/lib/swipe/Swipe.js
CHANGED
@@ -360,7 +360,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
360
360
|
(0, import_vue2.watch)(() => props.initialSwipe, (value) => initialize(+value));
|
361
361
|
(0, import_vue2.watch)(count, () => initialize(state.active));
|
362
362
|
(0, import_vue2.watch)(() => props.autoplay, autoplay);
|
363
|
-
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight], resize);
|
363
|
+
(0, import_vue2.watch)([import_utils.windowWidth, import_utils.windowHeight, () => props.width, () => props.height], resize);
|
364
364
|
(0, import_vue2.watch)((0, import_use.usePageVisibility)(), (visible) => {
|
365
365
|
if (visible === "visible") {
|
366
366
|
autoplay();
|
package/lib/tab/Tab.js
CHANGED
@@ -30,6 +30,7 @@ var import_use_id = require("../composables/use-id");
|
|
30
30
|
var import_use_expose = require("../composables/use-expose");
|
31
31
|
var import_use_route = require("../composables/use-route");
|
32
32
|
var import_use_tab_status = require("../composables/use-tab-status");
|
33
|
+
var import_TabTitle = require("./TabTitle");
|
33
34
|
var import_swipe_item = require("../swipe-item");
|
34
35
|
const [name, bem] = (0, import_utils.createNamespace)("tab");
|
35
36
|
const tabProps = (0, import_utils.extend)({}, import_use_route.routeProps, {
|
@@ -50,6 +51,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
50
51
|
}) {
|
51
52
|
const id = (0, import_use_id.useId)();
|
52
53
|
const inited = (0, import_vue2.ref)(false);
|
54
|
+
const instance = (0, import_vue2.getCurrentInstance)();
|
53
55
|
const {
|
54
56
|
parent,
|
55
57
|
index
|
@@ -79,6 +81,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
79
81
|
}
|
80
82
|
return isActive;
|
81
83
|
});
|
84
|
+
const renderTitle = (onClickTab) => (0, import_vue.createVNode)(import_TabTitle.TabTitle, (0, import_vue.mergeProps)({
|
85
|
+
"key": id,
|
86
|
+
"id": `${parent.id}-${index.value}`,
|
87
|
+
"ref": parent.setTitleRefs(index.value),
|
88
|
+
"style": props.titleStyle,
|
89
|
+
"class": props.titleClass,
|
90
|
+
"isActive": active.value,
|
91
|
+
"controls": id,
|
92
|
+
"scrollable": parent.scrollable.value,
|
93
|
+
"activeColor": parent.props.titleActiveColor,
|
94
|
+
"inactiveColor": parent.props.titleInactiveColor,
|
95
|
+
"onClick": (event) => onClickTab(instance.proxy, index.value, event)
|
96
|
+
}, (0, import_utils.pick)(parent.props, ["type", "color", "shrink"]), (0, import_utils.pick)(props, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
|
97
|
+
title: slots.title
|
98
|
+
});
|
82
99
|
const hasInactiveClass = (0, import_vue2.ref)(!active.value);
|
83
100
|
(0, import_vue2.watch)(active, (val) => {
|
84
101
|
if (val) {
|
@@ -94,6 +111,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
94
111
|
parent.scrollIntoView();
|
95
112
|
});
|
96
113
|
(0, import_vue2.provide)(import_use_tab_status.TAB_STATUS_KEY, active);
|
114
|
+
(0, import_use_expose.useExpose)({
|
115
|
+
id,
|
116
|
+
renderTitle
|
117
|
+
});
|
97
118
|
return () => {
|
98
119
|
var _a;
|
99
120
|
const label = `${parent.id}-${index.value}`;
|
@@ -128,9 +149,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
128
149
|
}
|
129
150
|
const shouldRender = inited.value || scrollspy || !lazyRender;
|
130
151
|
const Content = shouldRender ? (_a = slots.default) == null ? void 0 : _a.call(slots) : null;
|
131
|
-
(0, import_use_expose.useExpose)({
|
132
|
-
id
|
133
|
-
});
|
134
152
|
return (0, import_vue.withDirectives)((0, import_vue.createVNode)("div", {
|
135
153
|
"id": id,
|
136
154
|
"role": "tabpanel",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
declare const
|
1
|
+
export declare const TabTitle: import("vue").DefineComponent<{
|
2
2
|
id: StringConstructor;
|
3
3
|
dot: BooleanConstructor;
|
4
4
|
type: StringConstructor;
|
@@ -42,4 +42,3 @@ declare const _default: import("vue").DefineComponent<{
|
|
42
42
|
scrollable: boolean;
|
43
43
|
showZeroBadge: boolean;
|
44
44
|
}>;
|
45
|
-
export default _default;
|
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
18
18
|
var stdin_exports = {};
|
19
19
|
__export(stdin_exports, {
|
20
|
-
|
20
|
+
TabTitle: () => TabTitle
|
21
21
|
});
|
22
22
|
module.exports = __toCommonJS(stdin_exports);
|
23
23
|
var import_vue = require("vue");
|
@@ -25,7 +25,7 @@ var import_vue2 = require("vue");
|
|
25
25
|
var import_utils = require("../utils");
|
26
26
|
var import_badge = require("../badge");
|
27
27
|
const [name, bem] = (0, import_utils.createNamespace)("tab");
|
28
|
-
|
28
|
+
const TabTitle = (0, import_vue2.defineComponent)({
|
29
29
|
name,
|
30
30
|
props: {
|
31
31
|
id: String,
|
package/lib/tabs/Tabs.d.ts
CHANGED
@@ -145,9 +145,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
145
145
|
duration: string | number;
|
146
146
|
lazyRender: boolean;
|
147
147
|
offsetTop: string | number;
|
148
|
-
shrink: boolean;
|
149
148
|
animated: boolean;
|
150
149
|
swipeable: boolean;
|
150
|
+
shrink: boolean;
|
151
151
|
scrollspy: boolean;
|
152
152
|
swipeThreshold: string | number;
|
153
153
|
}>;
|
package/lib/tabs/Tabs.js
CHANGED
@@ -44,7 +44,6 @@ var import_use_expose = require("../composables/use-expose");
|
|
44
44
|
var import_on_popup_reopen = require("../composables/on-popup-reopen");
|
45
45
|
var import_use_visibility_change = require("../composables/use-visibility-change");
|
46
46
|
var import_sticky = require("../sticky");
|
47
|
-
var import_TabsTitle = __toESM(require("./TabsTitle"));
|
48
47
|
var import_TabsContent = __toESM(require("./TabsContent"));
|
49
48
|
const [name, bem] = (0, import_utils.createNamespace)("tabs");
|
50
49
|
const tabsProps = {
|
@@ -260,24 +259,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
260
259
|
setCurrentIndex(index);
|
261
260
|
}
|
262
261
|
};
|
263
|
-
const renderNav = () => children.map((item, index) => (0, import_vue.createVNode)(import_TabsTitle.default, (0, import_vue.mergeProps)({
|
264
|
-
"key": item.id,
|
265
|
-
"id": `${id}-${index}`,
|
266
|
-
"ref": setTitleRefs(index),
|
267
|
-
"type": props.type,
|
268
|
-
"color": props.color,
|
269
|
-
"style": item.titleStyle,
|
270
|
-
"class": item.titleClass,
|
271
|
-
"shrink": props.shrink,
|
272
|
-
"isActive": index === state.currentIndex,
|
273
|
-
"controls": item.id,
|
274
|
-
"scrollable": scrollable.value,
|
275
|
-
"activeColor": props.titleActiveColor,
|
276
|
-
"inactiveColor": props.titleInactiveColor,
|
277
|
-
"onClick": (event) => onClickTab(item, index, event)
|
278
|
-
}, (0, import_utils.pick)(item, ["dot", "badge", "title", "disabled", "showZeroBadge"])), {
|
279
|
-
title: item.$slots.title
|
280
|
-
}));
|
281
262
|
const renderLine = () => {
|
282
263
|
if (props.type === "line" && children.length) {
|
283
264
|
return (0, import_vue.createVNode)("div", {
|
@@ -307,7 +288,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
307
288
|
}]),
|
308
289
|
"style": navStyle.value,
|
309
290
|
"aria-orientation": "horizontal"
|
310
|
-
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots),
|
291
|
+
}, [(_a = slots["nav-left"]) == null ? void 0 : _a.call(slots), children.map((item) => item.renderTitle(onClickTab)), renderLine(), (_b = slots["nav-right"]) == null ? void 0 : _b.call(slots)])]), (_c = slots["nav-bottom"]) == null ? void 0 : _c.call(slots)];
|
311
292
|
if (sticky) {
|
312
293
|
return (0, import_vue.createVNode)("div", {
|
313
294
|
"ref": wrapRef
|
@@ -315,7 +296,16 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
315
296
|
}
|
316
297
|
return Header;
|
317
298
|
};
|
318
|
-
|
299
|
+
const resize = () => {
|
300
|
+
setLine();
|
301
|
+
(0, import_vue2.nextTick)(() => {
|
302
|
+
var _a, _b;
|
303
|
+
scrollIntoView(true);
|
304
|
+
(_b = (_a = contentRef.value) == null ? void 0 : _a.swipeRef.value) == null ? void 0 : _b.resize();
|
305
|
+
});
|
306
|
+
};
|
307
|
+
(0, import_vue2.watch)(() => [props.color, props.duration, props.lineWidth, props.lineHeight], setLine);
|
308
|
+
(0, import_vue2.watch)(import_utils.windowWidth, resize);
|
319
309
|
(0, import_vue2.watch)(() => props.active, (value) => {
|
320
310
|
if (value !== currentName.value) {
|
321
311
|
setCurrentIndexByName(value);
|
@@ -341,13 +331,6 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
341
331
|
});
|
342
332
|
};
|
343
333
|
const onRendered = (name2, title) => emit("rendered", name2, title);
|
344
|
-
const resize = () => {
|
345
|
-
setLine();
|
346
|
-
(0, import_vue2.nextTick)(() => {
|
347
|
-
var _a, _b;
|
348
|
-
return (_b = (_a = contentRef.value) == null ? void 0 : _a.swipeRef.value) == null ? void 0 : _b.resize();
|
349
|
-
});
|
350
|
-
};
|
351
334
|
(0, import_use_expose.useExpose)({
|
352
335
|
resize,
|
353
336
|
scrollTo
|
@@ -364,8 +347,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
364
347
|
id,
|
365
348
|
props,
|
366
349
|
setLine,
|
350
|
+
scrollable,
|
367
351
|
onRendered,
|
368
352
|
currentName,
|
353
|
+
setTitleRefs,
|
369
354
|
scrollIntoView
|
370
355
|
});
|
371
356
|
return () => (0, import_vue.createVNode)("div", {
|
package/lib/tabs/index.d.ts
CHANGED
@@ -98,9 +98,9 @@ export declare const Tabs: import("../utils").WithInstall<import("vue").DefineCo
|
|
98
98
|
duration: string | number;
|
99
99
|
lazyRender: boolean;
|
100
100
|
offsetTop: string | number;
|
101
|
-
shrink: boolean;
|
102
101
|
animated: boolean;
|
103
102
|
swipeable: boolean;
|
103
|
+
shrink: boolean;
|
104
104
|
scrollspy: boolean;
|
105
105
|
swipeThreshold: string | number;
|
106
106
|
}>>;
|
package/lib/tabs/style/index.js
CHANGED
package/lib/tabs/types.d.ts
CHANGED
@@ -12,9 +12,11 @@ export type TabsProvide = {
|
|
12
12
|
id: string;
|
13
13
|
props: TabsProps;
|
14
14
|
setLine: () => void;
|
15
|
+
scrollable: ComputedRef<boolean>;
|
15
16
|
onRendered: (name: Numeric, title?: string) => void;
|
16
|
-
scrollIntoView: (immediate?: boolean) => void;
|
17
17
|
currentName: ComputedRef<Numeric | undefined>;
|
18
|
+
setTitleRefs: (index: number) => (el: unknown) => void;
|
19
|
+
scrollIntoView: (immediate?: boolean) => void;
|
18
20
|
};
|
19
21
|
export type TabsExpose = {
|
20
22
|
resize: () => void;
|