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.
Files changed (75) hide show
  1. package/es/address-list/AddressList.d.ts +13 -0
  2. package/es/address-list/AddressList.mjs +3 -2
  3. package/es/address-list/index.d.ts +9 -0
  4. package/es/checkbox/Checkbox.d.ts +13 -23
  5. package/es/checkbox/Checkbox.mjs +2 -2
  6. package/es/checkbox/Checker.d.ts +6 -11
  7. package/es/checkbox/Checker.mjs +8 -6
  8. package/es/checkbox/index.d.ts +2 -9
  9. package/es/checkbox-group/CheckboxGroup.d.ts +14 -1
  10. package/es/checkbox-group/CheckboxGroup.mjs +2 -1
  11. package/es/checkbox-group/index.d.ts +9 -0
  12. package/es/floating-bubble/index.d.ts +1 -1
  13. package/es/index.d.ts +1 -1
  14. package/es/index.mjs +1 -1
  15. package/es/radio/Radio.d.ts +13 -23
  16. package/es/radio/Radio.mjs +2 -2
  17. package/es/radio/index.css +1 -1
  18. package/es/radio/index.d.ts +2 -9
  19. package/es/radio-group/RadioGroup.d.ts +4 -0
  20. package/es/radio-group/RadioGroup.mjs +1 -0
  21. package/es/radio-group/index.d.ts +2 -0
  22. package/es/tab/Tab.mjs +2 -2
  23. package/es/utils/basic.d.ts +8 -0
  24. package/es/utils/basic.mjs +28 -7
  25. package/es/utils/create.mjs +1 -2
  26. package/es/utils/deep-assign.mjs +1 -1
  27. package/es/utils/deep-clone.mjs +1 -1
  28. package/es/utils/dom.mjs +1 -1
  29. package/es/utils/format.mjs +1 -1
  30. package/es/utils/index.d.ts +0 -1
  31. package/es/utils/index.mjs +0 -1
  32. package/es/utils/interceptor.mjs +1 -2
  33. package/lib/address-list/AddressList.d.ts +13 -0
  34. package/lib/address-list/AddressList.js +3 -2
  35. package/lib/address-list/index.d.ts +9 -0
  36. package/lib/checkbox/Checkbox.d.ts +13 -23
  37. package/lib/checkbox/Checkbox.js +1 -1
  38. package/lib/checkbox/Checker.d.ts +6 -11
  39. package/lib/checkbox/Checker.js +7 -5
  40. package/lib/checkbox/index.d.ts +2 -9
  41. package/lib/checkbox-group/CheckboxGroup.d.ts +14 -1
  42. package/lib/checkbox-group/CheckboxGroup.js +1 -0
  43. package/lib/checkbox-group/index.d.ts +9 -0
  44. package/lib/floating-bubble/index.d.ts +1 -1
  45. package/lib/index.css +1 -1
  46. package/lib/index.d.ts +1 -1
  47. package/lib/index.js +1 -1
  48. package/lib/radio/Radio.d.ts +13 -23
  49. package/lib/radio/Radio.js +1 -1
  50. package/lib/radio/index.css +1 -1
  51. package/lib/radio/index.d.ts +2 -9
  52. package/lib/radio-group/RadioGroup.d.ts +4 -0
  53. package/lib/radio-group/RadioGroup.js +1 -0
  54. package/lib/radio-group/index.d.ts +2 -0
  55. package/lib/tab/Tab.js +2 -2
  56. package/lib/utils/basic.d.ts +8 -0
  57. package/lib/utils/basic.js +29 -8
  58. package/lib/utils/create.js +1 -2
  59. package/lib/utils/deep-assign.js +3 -3
  60. package/lib/utils/deep-clone.js +3 -3
  61. package/lib/utils/dom.js +2 -2
  62. package/lib/utils/format.js +4 -4
  63. package/lib/utils/index.d.ts +0 -1
  64. package/lib/utils/index.js +0 -1
  65. package/lib/utils/interceptor.js +1 -2
  66. package/lib/vant.cjs.js +31 -23
  67. package/lib/vant.es.js +31 -23
  68. package/lib/vant.js +96 -34
  69. package/lib/vant.min.js +1 -1
  70. package/lib/web-types.json +1 -1
  71. package/package.json +1 -1
  72. package/es/utils/validate.d.ts +0 -9
  73. package/es/utils/validate.mjs +0 -22
  74. package/lib/utils/validate.d.ts +0 -9
  75. package/lib/utils/validate.js +0 -41
package/lib/index.d.ts CHANGED
@@ -105,4 +105,4 @@ declare namespace _default {
105
105
  }
106
106
  export default _default;
107
107
  export function install(app: any): void;
108
- export const version: "4.6.2";
108
+ export const version: "4.6.3";
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.2";
227
+ const version = "4.6.3";
228
228
  function install(app) {
229
229
  const components = [
230
230
  import_action_bar.ActionBar,
@@ -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: import("vue").PropType<unknown>;
5
+ name: PropType<unknown>;
6
6
  disabled: BooleanConstructor;
7
7
  iconSize: (NumberConstructor | StringConstructor)[];
8
- modelValue: import("vue").PropType<unknown>;
8
+ modelValue: PropType<unknown>;
9
9
  checkedColor: StringConstructor;
10
- labelPosition: import("vue").PropType<CheckerLabelPosition>;
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: import("vue").PropType<unknown>;
18
+ name: PropType<unknown>;
22
19
  disabled: BooleanConstructor;
23
20
  iconSize: (NumberConstructor | StringConstructor)[];
24
- modelValue: import("vue").PropType<unknown>;
21
+ modelValue: PropType<unknown>;
25
22
  checkedColor: StringConstructor;
26
- labelPosition: import("vue").PropType<CheckerLabelPosition>;
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: import("vue").PropType<unknown>;
28
+ name: PropType<unknown>;
35
29
  disabled: BooleanConstructor;
36
30
  iconSize: (NumberConstructor | StringConstructor)[];
37
- modelValue: import("vue").PropType<unknown>;
31
+ modelValue: PropType<unknown>;
38
32
  checkedColor: StringConstructor;
39
- labelPosition: import("vue").PropType<CheckerLabelPosition>;
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;
@@ -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: (0, import_utils.makeStringProp)("round")
41
+ shape: String
42
42
  });
43
43
  const [name, bem] = (0, import_utils.createNamespace)("radio");
44
44
  var stdin_default = (0, import_vue2.defineComponent)({
@@ -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:border-color,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)}
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)}
@@ -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, import_vue2.normalizeClass)(titleClass) : "";
93
- parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? (0, import_shared.stringifyStyle)((0, import_vue2.normalizeStyle)(titleStyle)) : titleStyle;
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,
@@ -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];
@@ -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 = (0, import_validate.isObject)(result) ? (_a = result[key]) != null ? _a : "" : "";
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((ret, key) => {
45
- if (!ignoreUndefined || obj[key] !== void 0) {
46
- ret[key] = obj[key];
47
- }
48
- return ret;
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];
@@ -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, import_validate.isFunction)(message) ? message(...args) : message;
43
+ return (0, import_basic.isFunction)(message) ? message(...args) : message;
45
44
  };
46
45
  }
47
46
  function genBem(name, mods) {
@@ -20,14 +20,14 @@ __export(stdin_exports, {
20
20
  deepAssign: () => deepAssign
21
21
  });
22
22
  module.exports = __toCommonJS(stdin_exports);
23
- var import_validate = require("./validate");
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, import_validate.isDef)(val)) {
27
+ if (!(0, import_basic.isDef)(val)) {
28
28
  return;
29
29
  }
30
- if (!hasOwnProperty.call(to, key) || !(0, import_validate.isObject)(val)) {
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);
@@ -20,15 +20,15 @@ __export(stdin_exports, {
20
20
  deepClone: () => deepClone
21
21
  });
22
22
  module.exports = __toCommonJS(stdin_exports);
23
- var import_validate = require("./validate");
23
+ var import_basic = require("./basic");
24
24
  function deepClone(obj) {
25
- if (!(0, import_validate.isDef)(obj)) {
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, import_validate.isObject)(obj)) {
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 import_validate = require("./validate");
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, import_validate.isIOS)();
61
+ const isIOS = (0, import_basic.isIOS)();
62
62
  function resetScroll() {
63
63
  if (isIOS) {
64
64
  setRootScrollTop(getRootScrollTop());
@@ -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 import_validate = require("./validate");
34
+ var import_basic2 = require("./basic");
35
35
  function addUnit(value) {
36
- if ((0, import_validate.isDef)(value)) {
37
- return (0, import_validate.isNumeric)(value) ? `${value}px` : String(value);
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, import_validate.isDef)(originSize)) {
42
+ if ((0, import_basic2.isDef)(originSize)) {
43
43
  if (Array.isArray(originSize)) {
44
44
  return {
45
45
  width: addUnit(originSize[0]),
@@ -4,7 +4,6 @@ export * from './dom';
4
4
  export * from './create';
5
5
  export * from './format';
6
6
  export * from './constant';
7
- export * from './validate';
8
7
  export * from './interceptor';
9
8
  export * from './with-install';
10
9
  export * from './closest';
@@ -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);
@@ -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, import_validate.isPromise)(returnVal)) {
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((ret, key) => {
33
- if (!ignoreUndefined || obj[key] !== void 0) {
34
- ret[key] = obj[key];
35
- }
36
- return ret;
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 ? vue.normalizeClass(titleClass) : "";
3111
- parsedStyle.value = titleStyle && typeof titleStyle !== "string" ? shared.stringifyStyle(vue.normalizeStyle(titleStyle)) : titleStyle;
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: makeStringProp("round"),
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: makeStringProp("round")
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: makeStringProp("round"),
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.2";
16390
+ const version = "4.6.3";
16383
16391
  function install(app) {
16384
16392
  const components = [
16385
16393
  ActionBar,