vant 4.6.2 → 4.6.3
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/address-list/AddressList.d.ts +13 -0
- package/es/address-list/AddressList.mjs +3 -2
- package/es/address-list/index.d.ts +9 -0
- package/es/checkbox/Checkbox.d.ts +13 -23
- package/es/checkbox/Checkbox.mjs +2 -2
- package/es/checkbox/Checker.d.ts +6 -11
- package/es/checkbox/Checker.mjs +8 -6
- package/es/checkbox/index.d.ts +2 -9
- package/es/checkbox-group/CheckboxGroup.d.ts +14 -1
- package/es/checkbox-group/CheckboxGroup.mjs +2 -1
- package/es/checkbox-group/index.d.ts +9 -0
- package/es/floating-bubble/index.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/radio/Radio.d.ts +13 -23
- package/es/radio/Radio.mjs +2 -2
- package/es/radio/index.css +1 -1
- package/es/radio/index.d.ts +2 -9
- package/es/radio-group/RadioGroup.d.ts +4 -0
- package/es/radio-group/RadioGroup.mjs +1 -0
- package/es/radio-group/index.d.ts +2 -0
- package/es/tab/Tab.mjs +2 -2
- package/es/utils/basic.d.ts +8 -0
- package/es/utils/basic.mjs +28 -7
- package/es/utils/create.mjs +1 -2
- package/es/utils/deep-assign.mjs +1 -1
- package/es/utils/deep-clone.mjs +1 -1
- package/es/utils/dom.mjs +1 -1
- package/es/utils/format.mjs +1 -1
- package/es/utils/index.d.ts +0 -1
- package/es/utils/index.mjs +0 -1
- package/es/utils/interceptor.mjs +1 -2
- package/lib/address-list/AddressList.d.ts +13 -0
- package/lib/address-list/AddressList.js +3 -2
- package/lib/address-list/index.d.ts +9 -0
- package/lib/checkbox/Checkbox.d.ts +13 -23
- package/lib/checkbox/Checkbox.js +1 -1
- package/lib/checkbox/Checker.d.ts +6 -11
- package/lib/checkbox/Checker.js +7 -5
- package/lib/checkbox/index.d.ts +2 -9
- package/lib/checkbox-group/CheckboxGroup.d.ts +14 -1
- package/lib/checkbox-group/CheckboxGroup.js +1 -0
- package/lib/checkbox-group/index.d.ts +9 -0
- package/lib/floating-bubble/index.d.ts +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/radio/Radio.d.ts +13 -23
- package/lib/radio/Radio.js +1 -1
- package/lib/radio/index.css +1 -1
- package/lib/radio/index.d.ts +2 -9
- package/lib/radio-group/RadioGroup.d.ts +4 -0
- package/lib/radio-group/RadioGroup.js +1 -0
- package/lib/radio-group/index.d.ts +2 -0
- package/lib/tab/Tab.js +2 -2
- package/lib/utils/basic.d.ts +8 -0
- package/lib/utils/basic.js +29 -8
- package/lib/utils/create.js +1 -2
- package/lib/utils/deep-assign.js +3 -3
- package/lib/utils/deep-clone.js +3 -3
- package/lib/utils/dom.js +2 -2
- package/lib/utils/format.js +4 -4
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/interceptor.js +1 -2
- package/lib/vant.cjs.js +31 -23
- package/lib/vant.es.js +31 -23
- package/lib/vant.js +96 -34
- package/lib/vant.min.js +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
- package/es/utils/validate.d.ts +0 -9
- package/es/utils/validate.mjs +0 -22
- package/lib/utils/validate.d.ts +0 -9
- package/lib/utils/validate.js +0 -41
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
@@ -224,7 +224,7 @@ __reExport(stdin_exports, require("./toast"), module.exports);
|
|
224
224
|
__reExport(stdin_exports, require("./tree-select"), module.exports);
|
225
225
|
__reExport(stdin_exports, require("./uploader"), module.exports);
|
226
226
|
__reExport(stdin_exports, require("./watermark"), module.exports);
|
227
|
-
const version = "4.6.
|
227
|
+
const version = "4.6.3";
|
228
228
|
function install(app) {
|
229
229
|
const components = [
|
230
230
|
import_action_bar.ActionBar,
|
package/lib/radio/Radio.d.ts
CHANGED
@@ -1,53 +1,43 @@
|
|
1
|
-
import { type ExtractPropTypes } from 'vue';
|
1
|
+
import { type PropType, type ExtractPropTypes } from 'vue';
|
2
2
|
import { type CheckerShape, type CheckerLabelPosition } from '../checkbox/Checker';
|
3
3
|
export type RadioShape = CheckerShape | 'dot';
|
4
4
|
export declare const radioProps: {
|
5
|
-
name:
|
5
|
+
name: PropType<unknown>;
|
6
6
|
disabled: BooleanConstructor;
|
7
7
|
iconSize: (NumberConstructor | StringConstructor)[];
|
8
|
-
modelValue:
|
8
|
+
modelValue: PropType<unknown>;
|
9
9
|
checkedColor: StringConstructor;
|
10
|
-
labelPosition:
|
10
|
+
labelPosition: PropType<CheckerLabelPosition>;
|
11
11
|
labelDisabled: BooleanConstructor;
|
12
12
|
} & {
|
13
|
-
shape:
|
14
|
-
type: import("vue").PropType<RadioShape>;
|
15
|
-
default: RadioShape;
|
16
|
-
};
|
13
|
+
shape: PropType<RadioShape>;
|
17
14
|
};
|
18
15
|
export type RadioLabelPosition = CheckerLabelPosition;
|
19
16
|
export type RadioProps = ExtractPropTypes<typeof radioProps>;
|
20
17
|
declare const _default: import("vue").DefineComponent<{
|
21
|
-
name:
|
18
|
+
name: PropType<unknown>;
|
22
19
|
disabled: BooleanConstructor;
|
23
20
|
iconSize: (NumberConstructor | StringConstructor)[];
|
24
|
-
modelValue:
|
21
|
+
modelValue: PropType<unknown>;
|
25
22
|
checkedColor: StringConstructor;
|
26
|
-
labelPosition:
|
23
|
+
labelPosition: PropType<CheckerLabelPosition>;
|
27
24
|
labelDisabled: BooleanConstructor;
|
28
25
|
} & {
|
29
|
-
shape:
|
30
|
-
type: import("vue").PropType<RadioShape>;
|
31
|
-
default: RadioShape;
|
32
|
-
};
|
26
|
+
shape: PropType<RadioShape>;
|
33
27
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
34
|
-
name:
|
28
|
+
name: PropType<unknown>;
|
35
29
|
disabled: BooleanConstructor;
|
36
30
|
iconSize: (NumberConstructor | StringConstructor)[];
|
37
|
-
modelValue:
|
31
|
+
modelValue: PropType<unknown>;
|
38
32
|
checkedColor: StringConstructor;
|
39
|
-
labelPosition:
|
33
|
+
labelPosition: PropType<CheckerLabelPosition>;
|
40
34
|
labelDisabled: BooleanConstructor;
|
41
35
|
} & {
|
42
|
-
shape:
|
43
|
-
type: import("vue").PropType<RadioShape>;
|
44
|
-
default: RadioShape;
|
45
|
-
};
|
36
|
+
shape: PropType<RadioShape>;
|
46
37
|
}>> & {
|
47
38
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
48
39
|
}, {
|
49
40
|
disabled: boolean;
|
50
|
-
shape: RadioShape;
|
51
41
|
labelDisabled: boolean;
|
52
42
|
}, {}>;
|
53
43
|
export default _default;
|
package/lib/radio/Radio.js
CHANGED
@@ -38,7 +38,7 @@ var import_RadioGroup = require("../radio-group/RadioGroup");
|
|
38
38
|
var import_use = require("@vant/use");
|
39
39
|
var import_Checker = __toESM(require("../checkbox/Checker"));
|
40
40
|
const radioProps = (0, import_utils.extend)({}, import_Checker.checkerProps, {
|
41
|
-
shape:
|
41
|
+
shape: String
|
42
42
|
});
|
43
43
|
const [name, bem] = (0, import_utils.createNamespace)("radio");
|
44
44
|
var stdin_default = (0, import_vue2.defineComponent)({
|
package/lib/radio/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:root{--van-radio-size: 20px;--van-radio-dot-size: 8px;--van-radio-border-color: var(--van-gray-5);--van-radio-duration: var(--van-duration-fast);--van-radio-label-margin: var(--van-padding-xs);--van-radio-label-color: var(--van-text-color);--van-radio-checked-icon-color: var(--van-primary-color);--van-radio-disabled-icon-color: var(--van-gray-5);--van-radio-disabled-label-color: var(--van-text-color-3);--van-radio-disabled-background: var(--van-border-color)}.van-radio{display:flex;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none}.van-radio--disabled{cursor:not-allowed}.van-radio--label-disabled{cursor:default}.van-radio--horizontal{margin-right:var(--van-padding-sm)}.van-radio__icon{flex:none;height:1em;font-size:var(--van-radio-size);line-height:1em;cursor:pointer}.van-radio__icon .van-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid var(--van-radio-border-color);transition-duration:var(--van-radio-duration);transition-property:color,border-color,background-color}.van-radio__icon--round .van-icon{border-radius:100%}.van-radio__icon--dot{position:relative;border-radius:100%;box-sizing:border-box;width:var(--van-radio-size);height:var(--van-radio-size);border:1px solid var(--van-radio-border-color);transition-duration:var(--van-radio-duration);transition-property:border-color}.van-radio__icon--dot__icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:100%;height:calc(100% - var(--van-radio-dot-size));width:calc(100% - var(--van-radio-dot-size));transition-duration:var(--van-radio-duration);transition-property:
|
1
|
+
:root{--van-radio-size: 20px;--van-radio-dot-size: 8px;--van-radio-border-color: var(--van-gray-5);--van-radio-duration: var(--van-duration-fast);--van-radio-label-margin: var(--van-padding-xs);--van-radio-label-color: var(--van-text-color);--van-radio-checked-icon-color: var(--van-primary-color);--van-radio-disabled-icon-color: var(--van-gray-5);--van-radio-disabled-label-color: var(--van-text-color-3);--van-radio-disabled-background: var(--van-border-color)}.van-radio{display:flex;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none}.van-radio--disabled{cursor:not-allowed}.van-radio--label-disabled{cursor:default}.van-radio--horizontal{margin-right:var(--van-padding-sm)}.van-radio__icon{flex:none;height:1em;font-size:var(--van-radio-size);line-height:1em;cursor:pointer}.van-radio__icon .van-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid var(--van-radio-border-color);transition-duration:var(--van-radio-duration);transition-property:color,border-color,background-color}.van-radio__icon--round .van-icon{border-radius:100%}.van-radio__icon--dot{position:relative;border-radius:100%;box-sizing:border-box;width:var(--van-radio-size);height:var(--van-radio-size);border:1px solid var(--van-radio-border-color);transition-duration:var(--van-radio-duration);transition-property:border-color}.van-radio__icon--dot__icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:100%;height:calc(100% - var(--van-radio-dot-size));width:calc(100% - var(--van-radio-dot-size));transition-duration:var(--van-radio-duration);transition-property:background-color}.van-radio__icon--checked .van-icon{color:var(--van-white);background-color:var(--van-radio-checked-icon-color);border-color:var(--van-radio-checked-icon-color)}.van-radio__icon--checked.van-radio__icon--dot{border-color:var(--van-radio-checked-icon-color)}.van-radio__icon--checked.van-radio__icon--dot .van-radio__icon--dot__icon{background:var(--van-radio-checked-icon-color)}.van-radio__icon--disabled{cursor:not-allowed}.van-radio__icon--disabled .van-icon{background-color:var(--van-radio-disabled-background);border-color:var(--van-radio-disabled-icon-color)}.van-radio__icon--disabled.van-radio__icon--checked .van-icon{color:var(--van-radio-disabled-icon-color)}.van-radio__label{margin-left:var(--van-radio-label-margin);color:var(--van-radio-label-color);line-height:var(--van-radio-size)}.van-radio__label--left{margin:0 var(--van-radio-label-margin) 0 0}.van-radio__label--disabled{color:var(--van-radio-disabled-label-color)}
|
package/lib/radio/index.d.ts
CHANGED
@@ -7,10 +7,7 @@ export declare const Radio: import("../utils").WithInstall<import("vue").DefineC
|
|
7
7
|
labelPosition: import("vue").PropType<import("../checkbox/Checker").CheckerLabelPosition>;
|
8
8
|
labelDisabled: BooleanConstructor;
|
9
9
|
} & {
|
10
|
-
shape:
|
11
|
-
type: import("vue").PropType<import("./Radio").RadioShape>;
|
12
|
-
default: import("./Radio").RadioShape;
|
13
|
-
};
|
10
|
+
shape: import("vue").PropType<import("./Radio").RadioShape>;
|
14
11
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
12
|
name: import("vue").PropType<unknown>;
|
16
13
|
disabled: BooleanConstructor;
|
@@ -20,15 +17,11 @@ export declare const Radio: import("../utils").WithInstall<import("vue").DefineC
|
|
20
17
|
labelPosition: import("vue").PropType<import("../checkbox/Checker").CheckerLabelPosition>;
|
21
18
|
labelDisabled: BooleanConstructor;
|
22
19
|
} & {
|
23
|
-
shape:
|
24
|
-
type: import("vue").PropType<import("./Radio").RadioShape>;
|
25
|
-
default: import("./Radio").RadioShape;
|
26
|
-
};
|
20
|
+
shape: import("vue").PropType<import("./Radio").RadioShape>;
|
27
21
|
}>> & {
|
28
22
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
29
23
|
}, {
|
30
24
|
disabled: boolean;
|
31
|
-
shape: import("./Radio").RadioShape;
|
32
25
|
labelDisabled: boolean;
|
33
26
|
}, {}>>;
|
34
27
|
export default Radio;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { type PropType, type InjectionKey, type ExtractPropTypes } from 'vue';
|
2
|
+
import type { RadioShape } from '../radio';
|
2
3
|
import type { CheckerDirection } from '../checkbox/Checker';
|
3
4
|
export type RadioGroupDirection = CheckerDirection;
|
4
5
|
export declare const radioGroupProps: {
|
6
|
+
shape: PropType<RadioShape>;
|
5
7
|
disabled: BooleanConstructor;
|
6
8
|
iconSize: (NumberConstructor | StringConstructor)[];
|
7
9
|
direction: PropType<CheckerDirection>;
|
@@ -15,12 +17,14 @@ export type RadioGroupProvide = {
|
|
15
17
|
};
|
16
18
|
export declare const RADIO_KEY: InjectionKey<RadioGroupProvide>;
|
17
19
|
declare const _default: import("vue").DefineComponent<{
|
20
|
+
shape: PropType<RadioShape>;
|
18
21
|
disabled: BooleanConstructor;
|
19
22
|
iconSize: (NumberConstructor | StringConstructor)[];
|
20
23
|
direction: PropType<CheckerDirection>;
|
21
24
|
modelValue: PropType<unknown>;
|
22
25
|
checkedColor: StringConstructor;
|
23
26
|
}, () => 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<{
|
27
|
+
shape: PropType<RadioShape>;
|
24
28
|
disabled: BooleanConstructor;
|
25
29
|
iconSize: (NumberConstructor | StringConstructor)[];
|
26
30
|
direction: PropType<CheckerDirection>;
|
@@ -28,6 +28,7 @@ var import_utils = require("../utils");
|
|
28
28
|
var import_use = require("@vant/use");
|
29
29
|
const [name, bem] = (0, import_utils.createNamespace)("radio-group");
|
30
30
|
const radioGroupProps = {
|
31
|
+
shape: String,
|
31
32
|
disabled: Boolean,
|
32
33
|
iconSize: import_utils.numericProp,
|
33
34
|
direction: String,
|
@@ -1,10 +1,12 @@
|
|
1
1
|
export declare const RadioGroup: import("../utils").WithInstall<import("vue").DefineComponent<{
|
2
|
+
shape: import("vue").PropType<import("..").RadioShape>;
|
2
3
|
disabled: BooleanConstructor;
|
3
4
|
iconSize: (NumberConstructor | StringConstructor)[];
|
4
5
|
direction: import("vue").PropType<import("../checkbox/Checker").CheckerDirection>;
|
5
6
|
modelValue: import("vue").PropType<unknown>;
|
6
7
|
checkedColor: StringConstructor;
|
7
8
|
}, () => 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<{
|
9
|
+
shape: import("vue").PropType<import("..").RadioShape>;
|
8
10
|
disabled: BooleanConstructor;
|
9
11
|
iconSize: (NumberConstructor | StringConstructor)[];
|
10
12
|
direction: import("vue").PropType<import("../checkbox/Checker").CheckerDirection>;
|
package/lib/tab/Tab.js
CHANGED
@@ -89,8 +89,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
89
89
|
titleClass,
|
90
90
|
titleStyle
|
91
91
|
} = props;
|
92
|
-
parsedClass.value = titleClass ? (0,
|
93
|
-
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? (0, import_shared.stringifyStyle)((0,
|
92
|
+
parsedClass.value = titleClass ? (0, import_shared.normalizeClass)(titleClass) : "";
|
93
|
+
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? (0, import_shared.stringifyStyle)((0, import_shared.normalizeStyle)(titleStyle)) : titleStyle;
|
94
94
|
});
|
95
95
|
const renderTitle = (onClickTab) => (0, import_vue.createVNode)(import_TabTitle.TabTitle, (0, import_vue.mergeProps)({
|
96
96
|
"key": id,
|
package/lib/utils/basic.d.ts
CHANGED
@@ -9,6 +9,14 @@ export declare const extend: {
|
|
9
9
|
export declare const inBrowser: boolean;
|
10
10
|
export type Numeric = number | string;
|
11
11
|
export type ComponentInstance = ComponentPublicInstance<{}, any>;
|
12
|
+
export declare const isObject: (val: unknown) => val is Record<any, any>;
|
13
|
+
export declare const isDef: <T>(val: T) => val is NonNullable<T>;
|
14
|
+
export declare const isFunction: (val: unknown) => val is Function;
|
15
|
+
export declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
16
|
+
export declare const isDate: (val: unknown) => val is Date;
|
17
|
+
export declare function isMobile(value: string): boolean;
|
18
|
+
export declare const isNumeric: (val: Numeric) => val is string;
|
19
|
+
export declare const isIOS: () => boolean;
|
12
20
|
export declare function get(object: any, path: string): any;
|
13
21
|
export type Writeable<T> = {
|
14
22
|
-readonly [P in keyof T]: T[P];
|
package/lib/utils/basic.js
CHANGED
@@ -20,33 +20,54 @@ __export(stdin_exports, {
|
|
20
20
|
extend: () => extend,
|
21
21
|
get: () => get,
|
22
22
|
inBrowser: () => inBrowser,
|
23
|
+
isDate: () => isDate,
|
24
|
+
isDef: () => isDef,
|
25
|
+
isFunction: () => isFunction,
|
26
|
+
isIOS: () => isIOS,
|
27
|
+
isMobile: () => isMobile,
|
28
|
+
isNumeric: () => isNumeric,
|
29
|
+
isObject: () => isObject,
|
30
|
+
isPromise: () => isPromise,
|
23
31
|
isSameValue: () => isSameValue,
|
24
32
|
noop: () => noop,
|
25
33
|
pick: () => pick,
|
26
34
|
toArray: () => toArray
|
27
35
|
});
|
28
36
|
module.exports = __toCommonJS(stdin_exports);
|
29
|
-
var import_validate = require("./validate");
|
30
37
|
function noop() {
|
31
38
|
}
|
32
39
|
const extend = Object.assign;
|
33
40
|
const inBrowser = typeof window !== "undefined";
|
41
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
42
|
+
const isDef = (val) => val !== void 0 && val !== null;
|
43
|
+
const isFunction = (val) => typeof val === "function";
|
44
|
+
const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
45
|
+
const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
46
|
+
function isMobile(value) {
|
47
|
+
value = value.replace(/[^-|\d]/g, "");
|
48
|
+
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
|
49
|
+
}
|
50
|
+
const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
|
51
|
+
const isIOS = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
34
52
|
function get(object, path) {
|
35
53
|
const keys = path.split(".");
|
36
54
|
let result = object;
|
37
55
|
keys.forEach((key) => {
|
38
56
|
var _a;
|
39
|
-
result =
|
57
|
+
result = isObject(result) ? (_a = result[key]) != null ? _a : "" : "";
|
40
58
|
});
|
41
59
|
return result;
|
42
60
|
}
|
43
61
|
function pick(obj, keys, ignoreUndefined) {
|
44
|
-
return keys.reduce(
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
62
|
+
return keys.reduce(
|
63
|
+
(ret, key) => {
|
64
|
+
if (!ignoreUndefined || obj[key] !== void 0) {
|
65
|
+
ret[key] = obj[key];
|
66
|
+
}
|
67
|
+
return ret;
|
68
|
+
},
|
69
|
+
{}
|
70
|
+
);
|
50
71
|
}
|
51
72
|
const isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
|
52
73
|
const toArray = (item) => Array.isArray(item) ? item : [item];
|
package/lib/utils/create.js
CHANGED
@@ -34,14 +34,13 @@ __export(stdin_exports, {
|
|
34
34
|
module.exports = __toCommonJS(stdin_exports);
|
35
35
|
var import_basic = require("./basic");
|
36
36
|
var import_format = require("./format");
|
37
|
-
var import_validate = require("./validate");
|
38
37
|
var import_locale = __toESM(require("../locale"));
|
39
38
|
function createTranslate(name) {
|
40
39
|
const prefix = (0, import_format.camelize)(name) + ".";
|
41
40
|
return (path, ...args) => {
|
42
41
|
const messages = import_locale.default.messages();
|
43
42
|
const message = (0, import_basic.get)(messages, prefix + path) || (0, import_basic.get)(messages, path);
|
44
|
-
return (0,
|
43
|
+
return (0, import_basic.isFunction)(message) ? message(...args) : message;
|
45
44
|
};
|
46
45
|
}
|
47
46
|
function genBem(name, mods) {
|
package/lib/utils/deep-assign.js
CHANGED
@@ -20,14 +20,14 @@ __export(stdin_exports, {
|
|
20
20
|
deepAssign: () => deepAssign
|
21
21
|
});
|
22
22
|
module.exports = __toCommonJS(stdin_exports);
|
23
|
-
var
|
23
|
+
var import_basic = require("./basic");
|
24
24
|
const { hasOwnProperty } = Object.prototype;
|
25
25
|
function assignKey(to, from, key) {
|
26
26
|
const val = from[key];
|
27
|
-
if (!(0,
|
27
|
+
if (!(0, import_basic.isDef)(val)) {
|
28
28
|
return;
|
29
29
|
}
|
30
|
-
if (!hasOwnProperty.call(to, key) || !(0,
|
30
|
+
if (!hasOwnProperty.call(to, key) || !(0, import_basic.isObject)(val)) {
|
31
31
|
to[key] = val;
|
32
32
|
} else {
|
33
33
|
to[key] = deepAssign(Object(to[key]), val);
|
package/lib/utils/deep-clone.js
CHANGED
@@ -20,15 +20,15 @@ __export(stdin_exports, {
|
|
20
20
|
deepClone: () => deepClone
|
21
21
|
});
|
22
22
|
module.exports = __toCommonJS(stdin_exports);
|
23
|
-
var
|
23
|
+
var import_basic = require("./basic");
|
24
24
|
function deepClone(obj) {
|
25
|
-
if (!(0,
|
25
|
+
if (!(0, import_basic.isDef)(obj)) {
|
26
26
|
return obj;
|
27
27
|
}
|
28
28
|
if (Array.isArray(obj)) {
|
29
29
|
return obj.map((item) => deepClone(item));
|
30
30
|
}
|
31
|
-
if ((0,
|
31
|
+
if ((0, import_basic.isObject)(obj)) {
|
32
32
|
const to = {};
|
33
33
|
Object.keys(obj).forEach((key) => {
|
34
34
|
to[key] = deepClone(obj[key]);
|
package/lib/utils/dom.js
CHANGED
@@ -32,7 +32,7 @@ __export(stdin_exports, {
|
|
32
32
|
module.exports = __toCommonJS(stdin_exports);
|
33
33
|
var import_use = require("@vant/use");
|
34
34
|
var import_vue = require("vue");
|
35
|
-
var
|
35
|
+
var import_basic = require("./basic");
|
36
36
|
function getScrollTop(el) {
|
37
37
|
const top = "scrollTop" in el ? el.scrollTop : el.pageYOffset;
|
38
38
|
return Math.max(top, 0);
|
@@ -58,7 +58,7 @@ function getElementTop(el, scroller) {
|
|
58
58
|
const scrollTop = scroller ? getScrollTop(scroller) : getRootScrollTop();
|
59
59
|
return (0, import_use.useRect)(el).top + scrollTop;
|
60
60
|
}
|
61
|
-
const isIOS = (0,
|
61
|
+
const isIOS = (0, import_basic.isIOS)();
|
62
62
|
function resetScroll() {
|
63
63
|
if (isIOS) {
|
64
64
|
setRootScrollTop(getRootScrollTop());
|
package/lib/utils/format.js
CHANGED
@@ -31,15 +31,15 @@ __export(stdin_exports, {
|
|
31
31
|
module.exports = __toCommonJS(stdin_exports);
|
32
32
|
var import_basic = require("./basic");
|
33
33
|
var import_dom = require("./dom");
|
34
|
-
var
|
34
|
+
var import_basic2 = require("./basic");
|
35
35
|
function addUnit(value) {
|
36
|
-
if ((0,
|
37
|
-
return (0,
|
36
|
+
if ((0, import_basic2.isDef)(value)) {
|
37
|
+
return (0, import_basic2.isNumeric)(value) ? `${value}px` : String(value);
|
38
38
|
}
|
39
39
|
return void 0;
|
40
40
|
}
|
41
41
|
function getSizeStyle(originSize) {
|
42
|
-
if ((0,
|
42
|
+
if ((0, import_basic2.isDef)(originSize)) {
|
43
43
|
if (Array.isArray(originSize)) {
|
44
44
|
return {
|
45
45
|
width: addUnit(originSize[0]),
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
@@ -20,7 +20,6 @@ __reExport(stdin_exports, require("./dom"), module.exports);
|
|
20
20
|
__reExport(stdin_exports, require("./create"), module.exports);
|
21
21
|
__reExport(stdin_exports, require("./format"), module.exports);
|
22
22
|
__reExport(stdin_exports, require("./constant"), module.exports);
|
23
|
-
__reExport(stdin_exports, require("./validate"), module.exports);
|
24
23
|
__reExport(stdin_exports, require("./interceptor"), module.exports);
|
25
24
|
__reExport(stdin_exports, require("./with-install"), module.exports);
|
26
25
|
__reExport(stdin_exports, require("./closest"), module.exports);
|
package/lib/utils/interceptor.js
CHANGED
@@ -21,7 +21,6 @@ __export(stdin_exports, {
|
|
21
21
|
});
|
22
22
|
module.exports = __toCommonJS(stdin_exports);
|
23
23
|
var import_basic = require("./basic");
|
24
|
-
var import_validate = require("./validate");
|
25
24
|
function callInterceptor(interceptor, {
|
26
25
|
args = [],
|
27
26
|
done,
|
@@ -29,7 +28,7 @@ function callInterceptor(interceptor, {
|
|
29
28
|
}) {
|
30
29
|
if (interceptor) {
|
31
30
|
const returnVal = interceptor.apply(null, args);
|
32
|
-
if ((0,
|
31
|
+
if ((0, import_basic.isPromise)(returnVal)) {
|
33
32
|
returnVal.then((value) => {
|
34
33
|
if (value) {
|
35
34
|
done();
|
package/lib/vant.cjs.js
CHANGED
@@ -4,9 +4,13 @@ const vue = require("vue");
|
|
4
4
|
const use = require("@vant/use");
|
5
5
|
const shared = require("@vue/shared");
|
6
6
|
const popperjs = require("@vant/popperjs");
|
7
|
+
function noop() {
|
8
|
+
}
|
9
|
+
const extend = Object.assign;
|
10
|
+
const inBrowser = typeof window !== "undefined";
|
11
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
7
12
|
const isDef = (val) => val !== void 0 && val !== null;
|
8
13
|
const isFunction = (val) => typeof val === "function";
|
9
|
-
const isObject = (val) => val !== null && typeof val === "object";
|
10
14
|
const isPromise = (val) => isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
11
15
|
const isDate = (val) => Object.prototype.toString.call(val) === "[object Date]" && !Number.isNaN(val.getTime());
|
12
16
|
function isMobile(value) {
|
@@ -15,10 +19,6 @@ function isMobile(value) {
|
|
15
19
|
}
|
16
20
|
const isNumeric = (val) => typeof val === "number" || /^\d+(\.\d+)?$/.test(val);
|
17
21
|
const isIOS$1 = () => inBrowser ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false;
|
18
|
-
function noop() {
|
19
|
-
}
|
20
|
-
const extend = Object.assign;
|
21
|
-
const inBrowser = typeof window !== "undefined";
|
22
22
|
function get(object, path) {
|
23
23
|
const keys = path.split(".");
|
24
24
|
let result = object;
|
@@ -29,12 +29,15 @@ function get(object, path) {
|
|
29
29
|
return result;
|
30
30
|
}
|
31
31
|
function pick(obj, keys, ignoreUndefined) {
|
32
|
-
return keys.reduce(
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
return keys.reduce(
|
33
|
+
(ret, key) => {
|
34
|
+
if (!ignoreUndefined || obj[key] !== void 0) {
|
35
|
+
ret[key] = obj[key];
|
36
|
+
}
|
37
|
+
return ret;
|
38
|
+
},
|
39
|
+
{}
|
40
|
+
);
|
38
41
|
}
|
39
42
|
const isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
|
40
43
|
const toArray = (item) => Array.isArray(item) ? item : [item];
|
@@ -3107,8 +3110,8 @@ var stdin_default$1A = vue.defineComponent({
|
|
3107
3110
|
titleClass,
|
3108
3111
|
titleStyle
|
3109
3112
|
} = props2;
|
3110
|
-
parsedClass.value = titleClass ?
|
3111
|
-
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? shared.stringifyStyle(
|
3113
|
+
parsedClass.value = titleClass ? shared.normalizeClass(titleClass) : "";
|
3114
|
+
parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? shared.stringifyStyle(shared.normalizeStyle(titleStyle)) : titleStyle;
|
3112
3115
|
});
|
3113
3116
|
const renderTitle = (onClickTab) => vue.createVNode(TabTitle, vue.mergeProps({
|
3114
3117
|
"key": id,
|
@@ -5188,6 +5191,7 @@ var stdin_default$1q = vue.defineComponent({
|
|
5188
5191
|
const AddressEdit = withInstall(stdin_default$1q);
|
5189
5192
|
const [name$1f, bem$1b] = createNamespace("radio-group");
|
5190
5193
|
const radioGroupProps = {
|
5194
|
+
shape: String,
|
5191
5195
|
disabled: Boolean,
|
5192
5196
|
iconSize: numericProp,
|
5193
5197
|
direction: String,
|
@@ -5308,7 +5312,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
5308
5312
|
props: extend({}, checkerProps, {
|
5309
5313
|
bem: makeRequiredProp(Function),
|
5310
5314
|
role: String,
|
5311
|
-
shape:
|
5315
|
+
shape: String,
|
5312
5316
|
parent: Object,
|
5313
5317
|
checked: Boolean,
|
5314
5318
|
bindGroup: truthProp
|
@@ -5347,6 +5351,9 @@ var stdin_default$1n = vue.defineComponent({
|
|
5347
5351
|
};
|
5348
5352
|
}
|
5349
5353
|
});
|
5354
|
+
const shape = vue.computed(() => {
|
5355
|
+
return props2.shape || getParentProp("shape") || "round";
|
5356
|
+
});
|
5350
5357
|
const onClick = (event) => {
|
5351
5358
|
const {
|
5352
5359
|
target
|
@@ -5362,17 +5369,16 @@ var stdin_default$1n = vue.defineComponent({
|
|
5362
5369
|
var _a, _b;
|
5363
5370
|
const {
|
5364
5371
|
bem: bem2,
|
5365
|
-
shape,
|
5366
5372
|
checked
|
5367
5373
|
} = props2;
|
5368
5374
|
const iconSize = props2.iconSize || getParentProp("iconSize");
|
5369
5375
|
return vue.createVNode("div", {
|
5370
5376
|
"ref": iconRef,
|
5371
|
-
"class": bem2("icon", [shape, {
|
5377
|
+
"class": bem2("icon", [shape.value, {
|
5372
5378
|
disabled: disabled.value,
|
5373
5379
|
checked
|
5374
5380
|
}]),
|
5375
|
-
"style": shape !== "dot" ? {
|
5381
|
+
"style": shape.value !== "dot" ? {
|
5376
5382
|
fontSize: addUnit(iconSize)
|
5377
5383
|
} : {
|
5378
5384
|
width: addUnit(iconSize),
|
@@ -5382,7 +5388,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
5382
5388
|
}, [slots.icon ? slots.icon({
|
5383
5389
|
checked,
|
5384
5390
|
disabled: disabled.value
|
5385
|
-
}) : shape !== "dot" ? vue.createVNode(Icon, {
|
5391
|
+
}) : shape.value !== "dot" ? vue.createVNode(Icon, {
|
5386
5392
|
"name": "success",
|
5387
5393
|
"style": iconStyle.value
|
5388
5394
|
}, null) : vue.createVNode("div", {
|
@@ -5417,7 +5423,7 @@ var stdin_default$1n = vue.defineComponent({
|
|
5417
5423
|
}
|
5418
5424
|
});
|
5419
5425
|
const radioProps = extend({}, checkerProps, {
|
5420
|
-
shape:
|
5426
|
+
shape: String
|
5421
5427
|
});
|
5422
5428
|
const [name$1d, bem$19] = createNamespace("radio");
|
5423
5429
|
var stdin_default$1m = vue.defineComponent({
|
@@ -5546,6 +5552,7 @@ const addressListProps = {
|
|
5546
5552
|
switchable: truthProp,
|
5547
5553
|
disabledText: String,
|
5548
5554
|
disabledList: makeArrayProp(),
|
5555
|
+
showAddButton: truthProp,
|
5549
5556
|
addButtonText: String,
|
5550
5557
|
defaultTagText: String,
|
5551
5558
|
rightIcon: makeStringProp("edit")
|
@@ -5587,7 +5594,7 @@ var stdin_default$1k = vue.defineComponent({
|
|
5587
5594
|
return list.map((item, index) => renderItem(item, index, disabled));
|
5588
5595
|
}
|
5589
5596
|
};
|
5590
|
-
const renderBottom = () => vue.createVNode("div", {
|
5597
|
+
const renderBottom = () => props2.showAddButton ? vue.createVNode("div", {
|
5591
5598
|
"class": [bem$17("bottom"), "van-safe-area-bottom"]
|
5592
5599
|
}, [vue.createVNode(Button, {
|
5593
5600
|
"round": true,
|
@@ -5596,7 +5603,7 @@ var stdin_default$1k = vue.defineComponent({
|
|
5596
5603
|
"text": props2.addButtonText || t$h("add"),
|
5597
5604
|
"class": bem$17("add"),
|
5598
5605
|
"onClick": () => emit("add")
|
5599
|
-
}, null)]);
|
5606
|
+
}, null)]) : void 0;
|
5600
5607
|
return () => {
|
5601
5608
|
var _a, _b;
|
5602
5609
|
const List2 = renderList(props2.list);
|
@@ -7415,6 +7422,7 @@ const CellGroup = withInstall(stdin_default$1a);
|
|
7415
7422
|
const [name$10, bem$$] = createNamespace("checkbox-group");
|
7416
7423
|
const checkboxGroupProps = {
|
7417
7424
|
max: numericProp,
|
7425
|
+
shape: makeStringProp("round"),
|
7418
7426
|
disabled: Boolean,
|
7419
7427
|
iconSize: numericProp,
|
7420
7428
|
direction: String,
|
@@ -7476,7 +7484,7 @@ var stdin_default$19 = vue.defineComponent({
|
|
7476
7484
|
});
|
7477
7485
|
const [name$$, bem$_] = createNamespace("checkbox");
|
7478
7486
|
const checkboxProps = extend({}, checkerProps, {
|
7479
|
-
shape:
|
7487
|
+
shape: String,
|
7480
7488
|
bindGroup: truthProp
|
7481
7489
|
});
|
7482
7490
|
var stdin_default$18 = vue.defineComponent({
|
@@ -16379,7 +16387,7 @@ const Lazyload = {
|
|
16379
16387
|
});
|
16380
16388
|
}
|
16381
16389
|
};
|
16382
|
-
const version = "4.6.
|
16390
|
+
const version = "4.6.3";
|
16383
16391
|
function install(app) {
|
16384
16392
|
const components = [
|
16385
16393
|
ActionBar,
|