vant 4.7.2 → 4.8.0

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 (110) hide show
  1. package/README.md +1 -0
  2. package/es/address-edit/AddressEdit.mjs +1 -1
  3. package/es/calendar/Calendar.mjs +20 -17
  4. package/es/cell/Cell.d.ts +17 -5
  5. package/es/cell/Cell.mjs +5 -2
  6. package/es/cell/index.d.ts +9 -3
  7. package/es/checkbox/Checker.mjs +7 -1
  8. package/es/col/Col.mjs +11 -3
  9. package/es/collapse-item/CollapseItem.d.ts +13 -4
  10. package/es/collapse-item/index.d.ts +9 -3
  11. package/es/config-provider/types.d.ts +1 -1
  12. package/es/field/Field.d.ts +30 -21
  13. package/es/field/Field.mjs +11 -3
  14. package/es/field/index.css +1 -1
  15. package/es/field/index.d.ts +18 -12
  16. package/es/field/types.d.ts +1 -1
  17. package/es/form/Form.d.ts +3 -0
  18. package/es/form/Form.mjs +1 -0
  19. package/es/form/index.d.ts +2 -0
  20. package/es/highlight/Highlight.d.ts +96 -0
  21. package/es/highlight/Highlight.mjs +122 -0
  22. package/es/highlight/index.css +1 -0
  23. package/es/highlight/index.d.ts +73 -0
  24. package/es/highlight/index.mjs +10 -0
  25. package/es/highlight/style/index.d.ts +1 -0
  26. package/es/highlight/style/index.mjs +2 -0
  27. package/es/highlight/types.d.ts +3 -0
  28. package/es/highlight/types.mjs +0 -0
  29. package/es/image-preview/ImagePreview.mjs +10 -0
  30. package/es/image-preview/ImagePreviewItem.d.ts +27 -1
  31. package/es/image-preview/ImagePreviewItem.mjs +17 -12
  32. package/es/image-preview/types.d.ts +7 -0
  33. package/es/index.d.ts +2 -1
  34. package/es/index.mjs +4 -1
  35. package/es/locale/lang/ar-SA.d.ts +63 -0
  36. package/es/locale/lang/ar-SA.mjs +65 -0
  37. package/es/picker-group/PickerGroup.mjs +3 -3
  38. package/es/progress/types.d.ts +1 -4
  39. package/es/row/Row.d.ts +8 -4
  40. package/es/row/Row.mjs +35 -4
  41. package/es/row/index.d.ts +3 -3
  42. package/es/search/Search.d.ts +13 -13
  43. package/es/search/Search.mjs +3 -1
  44. package/es/search/index.css +1 -1
  45. package/es/search/index.d.ts +9 -9
  46. package/es/signature/Signature.mjs +16 -3
  47. package/es/signature/index.d.ts +1 -1
  48. package/es/signature/types.d.ts +6 -0
  49. package/es/tabs/Tabs.d.ts +13 -0
  50. package/es/tabs/Tabs.mjs +3 -2
  51. package/es/tabs/index.d.ts +9 -0
  52. package/es/text-ellipsis/index.css +1 -1
  53. package/lib/address-edit/AddressEdit.js +1 -1
  54. package/lib/calendar/Calendar.js +20 -17
  55. package/lib/cell/Cell.d.ts +17 -5
  56. package/lib/cell/Cell.js +5 -2
  57. package/lib/cell/index.d.ts +9 -3
  58. package/lib/checkbox/Checker.js +7 -1
  59. package/lib/col/Col.js +10 -2
  60. package/lib/collapse-item/CollapseItem.d.ts +13 -4
  61. package/lib/collapse-item/index.d.ts +9 -3
  62. package/lib/config-provider/types.d.ts +1 -1
  63. package/lib/field/Field.d.ts +30 -21
  64. package/lib/field/Field.js +11 -3
  65. package/lib/field/index.css +1 -1
  66. package/lib/field/index.d.ts +18 -12
  67. package/lib/field/types.d.ts +1 -1
  68. package/lib/form/Form.d.ts +3 -0
  69. package/lib/form/Form.js +1 -0
  70. package/lib/form/index.d.ts +2 -0
  71. package/lib/highlight/Highlight.d.ts +96 -0
  72. package/lib/highlight/Highlight.js +141 -0
  73. package/lib/highlight/index.css +1 -0
  74. package/lib/highlight/index.d.ts +73 -0
  75. package/lib/highlight/index.js +39 -0
  76. package/lib/highlight/style/index.d.ts +1 -0
  77. package/lib/highlight/style/index.js +2 -0
  78. package/lib/highlight/types.d.ts +3 -0
  79. package/lib/highlight/types.js +15 -0
  80. package/lib/image-preview/ImagePreview.js +10 -0
  81. package/lib/image-preview/ImagePreviewItem.d.ts +27 -1
  82. package/lib/image-preview/ImagePreviewItem.js +17 -12
  83. package/lib/image-preview/types.d.ts +7 -0
  84. package/lib/index.css +1 -1
  85. package/lib/index.d.ts +2 -1
  86. package/lib/index.js +4 -1
  87. package/lib/locale/lang/ar-SA.d.ts +63 -0
  88. package/lib/locale/lang/ar-SA.js +84 -0
  89. package/lib/picker-group/PickerGroup.js +2 -2
  90. package/lib/progress/types.d.ts +1 -4
  91. package/lib/row/Row.d.ts +8 -4
  92. package/lib/row/Row.js +34 -3
  93. package/lib/row/index.d.ts +3 -3
  94. package/lib/search/Search.d.ts +13 -13
  95. package/lib/search/Search.js +3 -1
  96. package/lib/search/index.css +1 -1
  97. package/lib/search/index.d.ts +9 -9
  98. package/lib/signature/Signature.js +14 -1
  99. package/lib/signature/index.d.ts +1 -1
  100. package/lib/signature/types.d.ts +6 -0
  101. package/lib/tabs/Tabs.d.ts +13 -0
  102. package/lib/tabs/Tabs.js +3 -2
  103. package/lib/tabs/index.d.ts +9 -0
  104. package/lib/text-ellipsis/index.css +1 -1
  105. package/lib/vant.cjs.js +813 -605
  106. package/lib/vant.es.js +814 -606
  107. package/lib/vant.js +813 -605
  108. package/lib/vant.min.js +1 -1
  109. package/lib/web-types.json +1 -1
  110. package/package.json +2 -2
package/README.md CHANGED
@@ -113,6 +113,7 @@ Vant 3/4 supports modern browsers and Chrome >= 51、iOS >= 10.0 (same as Vue 3)
113
113
  | [sfc-playground-vant](https://github.com/zhixiaoqiang/sfc-playground-vant) | Vant Playground |
114
114
  | [vue3-h5-template](https://github.com/yulimchen/vue3-h5-template) | Mobile project template based on Vant |
115
115
  | [vue3-vant-mobile](https://github.com/CharleeWa/vue3-vant-mobile) | Mobile project template based on Vant |
116
+ | [vscode-common-intellisense](https://github.com/Simon-He95/vscode-common-intellisense) | A VS Code extension that provides better intellisense to Vant developers |
116
117
 
117
118
  ## Links
118
119
 
@@ -227,7 +227,7 @@ var stdin_default = defineComponent({
227
227
  "label": t("area"),
228
228
  "is-link": !disableArea,
229
229
  "modelValue": areaText.value,
230
- "rules": rules.value.areaCode,
230
+ "rules": props.showArea ? rules.value.areaCode : void 0,
231
231
  "placeholder": props.areaPlaceholder || t("area"),
232
232
  "onFocus": () => onFocus("areaCode"),
233
233
  "onClick": () => {
@@ -107,7 +107,7 @@ var stdin_default = defineComponent({
107
107
  let bodyHeight;
108
108
  const bodyRef = ref();
109
109
  const subtitle = ref({
110
- text: "",
110
+ textFn: () => "",
111
111
  date: void 0
112
112
  });
113
113
  const currentDate = ref(getInitialDate());
@@ -171,7 +171,7 @@ var stdin_default = defineComponent({
171
171
  });
172
172
  if (currentMonth) {
173
173
  subtitle.value = {
174
- text: currentMonth.getTitle(),
174
+ textFn: currentMonth.getTitle,
175
175
  date: currentMonth.date
176
176
  };
177
177
  }
@@ -361,21 +361,24 @@ var stdin_default = defineComponent({
361
361
  "van-safe-area-bottom": props.safeAreaInsetBottom
362
362
  }]
363
363
  }, [renderFooterButton()]);
364
- const renderCalendar = () => _createVNode("div", {
365
- "class": bem()
366
- }, [_createVNode(CalendarHeader, {
367
- "date": subtitle.value.date,
368
- "title": props.title,
369
- "subtitle": subtitle.value.text,
370
- "showTitle": props.showTitle,
371
- "showSubtitle": props.showSubtitle,
372
- "firstDayOfWeek": dayOffset.value,
373
- "onClickSubtitle": (event) => emit("clickSubtitle", event)
374
- }, pick(slots, ["title", "subtitle"])), _createVNode("div", {
375
- "ref": bodyRef,
376
- "class": bem("body"),
377
- "onScroll": onScroll
378
- }, [months.value.map(renderMonth)]), renderFooter()]);
364
+ const renderCalendar = () => {
365
+ const subTitle = subtitle.value.textFn();
366
+ return _createVNode("div", {
367
+ "class": bem()
368
+ }, [_createVNode(CalendarHeader, {
369
+ "date": subtitle.value.date,
370
+ "title": props.title,
371
+ "subtitle": subTitle,
372
+ "showTitle": props.showTitle,
373
+ "showSubtitle": props.showSubtitle,
374
+ "firstDayOfWeek": dayOffset.value,
375
+ "onClickSubtitle": (event) => emit("clickSubtitle", event)
376
+ }, pick(slots, ["title", "subtitle"])), _createVNode("div", {
377
+ "ref": bodyRef,
378
+ "class": bem("body"),
379
+ "onScroll": onScroll
380
+ }, [months.value.map(renderMonth)]), renderFooter()]);
381
+ };
379
382
  watch(() => props.show, init);
380
383
  watch(() => [props.type, props.minDate, props.maxDate], () => reset(getInitialDate(currentDate.value)));
381
384
  watch(() => props.defaultDate, (value = null) => {
package/es/cell/Cell.d.ts CHANGED
@@ -17,13 +17,16 @@ export declare const cellSharedProps: {
17
17
  type: BooleanConstructor;
18
18
  default: true;
19
19
  };
20
- required: BooleanConstructor;
21
20
  iconPrefix: StringConstructor;
22
21
  valueClass: PropType<unknown>;
23
22
  labelClass: PropType<unknown>;
24
23
  titleClass: PropType<unknown>;
25
24
  titleStyle: PropType<string | CSSProperties>;
26
25
  arrowDirection: PropType<CellArrowDirection>;
26
+ required: {
27
+ type: PropType<boolean | "auto">;
28
+ default: null;
29
+ };
27
30
  clickable: {
28
31
  type: PropType<boolean | null>;
29
32
  default: null;
@@ -45,13 +48,16 @@ export declare const cellProps: {
45
48
  type: BooleanConstructor;
46
49
  default: true;
47
50
  };
48
- required: BooleanConstructor;
49
51
  iconPrefix: StringConstructor;
50
52
  valueClass: PropType<unknown>;
51
53
  labelClass: PropType<unknown>;
52
54
  titleClass: PropType<unknown>;
53
55
  titleStyle: PropType<string | CSSProperties>;
54
56
  arrowDirection: PropType<CellArrowDirection>;
57
+ required: {
58
+ type: PropType<boolean | "auto">;
59
+ default: null;
60
+ };
55
61
  clickable: {
56
62
  type: PropType<boolean | null>;
57
63
  default: null;
@@ -78,13 +84,16 @@ declare const _default: import("vue").DefineComponent<{
78
84
  type: BooleanConstructor;
79
85
  default: true;
80
86
  };
81
- required: BooleanConstructor;
82
87
  iconPrefix: StringConstructor;
83
88
  valueClass: PropType<unknown>;
84
89
  labelClass: PropType<unknown>;
85
90
  titleClass: PropType<unknown>;
86
91
  titleStyle: PropType<string | CSSProperties>;
87
92
  arrowDirection: PropType<CellArrowDirection>;
93
+ required: {
94
+ type: PropType<boolean | "auto">;
95
+ default: null;
96
+ };
88
97
  clickable: {
89
98
  type: PropType<boolean | null>;
90
99
  default: null;
@@ -109,13 +118,16 @@ declare const _default: import("vue").DefineComponent<{
109
118
  type: BooleanConstructor;
110
119
  default: true;
111
120
  };
112
- required: BooleanConstructor;
113
121
  iconPrefix: StringConstructor;
114
122
  valueClass: PropType<unknown>;
115
123
  labelClass: PropType<unknown>;
116
124
  titleClass: PropType<unknown>;
117
125
  titleStyle: PropType<string | CSSProperties>;
118
126
  arrowDirection: PropType<CellArrowDirection>;
127
+ required: {
128
+ type: PropType<boolean | "auto">;
129
+ default: null;
130
+ };
119
131
  clickable: {
120
132
  type: PropType<boolean | null>;
121
133
  default: null;
@@ -130,7 +142,7 @@ declare const _default: import("vue").DefineComponent<{
130
142
  center: boolean;
131
143
  border: boolean;
132
144
  isLink: boolean;
133
- required: boolean;
145
+ required: boolean | "auto";
134
146
  clickable: boolean | null;
135
147
  }, {}>;
136
148
  export default _default;
package/es/cell/Cell.mjs CHANGED
@@ -14,13 +14,16 @@ const cellSharedProps = {
14
14
  center: Boolean,
15
15
  isLink: Boolean,
16
16
  border: truthProp,
17
- required: Boolean,
18
17
  iconPrefix: String,
19
18
  valueClass: unknownProp,
20
19
  labelClass: unknownProp,
21
20
  titleClass: unknownProp,
22
21
  titleStyle: null,
23
22
  arrowDirection: String,
23
+ required: {
24
+ type: [Boolean, String],
25
+ default: null
26
+ },
24
27
  clickable: {
25
28
  type: Boolean,
26
29
  default: null
@@ -101,7 +104,7 @@ var stdin_default = defineComponent({
101
104
  const clickable = (_a = props.clickable) != null ? _a : isLink;
102
105
  const classes = {
103
106
  center,
104
- required,
107
+ required: !!required,
105
108
  clickable,
106
109
  borderless: !border
107
110
  };
@@ -14,13 +14,16 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
14
14
  type: BooleanConstructor;
15
15
  default: true;
16
16
  };
17
- required: BooleanConstructor;
18
17
  iconPrefix: StringConstructor;
19
18
  valueClass: import("vue").PropType<unknown>;
20
19
  labelClass: import("vue").PropType<unknown>;
21
20
  titleClass: import("vue").PropType<unknown>;
22
21
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
23
22
  arrowDirection: import("vue").PropType<import("./Cell").CellArrowDirection>;
23
+ required: {
24
+ type: import("vue").PropType<boolean | "auto">;
25
+ default: null;
26
+ };
24
27
  clickable: {
25
28
  type: import("vue").PropType<boolean | null>;
26
29
  default: null;
@@ -45,13 +48,16 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
45
48
  type: BooleanConstructor;
46
49
  default: true;
47
50
  };
48
- required: BooleanConstructor;
49
51
  iconPrefix: StringConstructor;
50
52
  valueClass: import("vue").PropType<unknown>;
51
53
  labelClass: import("vue").PropType<unknown>;
52
54
  titleClass: import("vue").PropType<unknown>;
53
55
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
54
56
  arrowDirection: import("vue").PropType<import("./Cell").CellArrowDirection>;
57
+ required: {
58
+ type: import("vue").PropType<boolean | "auto">;
59
+ default: null;
60
+ };
55
61
  clickable: {
56
62
  type: import("vue").PropType<boolean | null>;
57
63
  default: null;
@@ -66,7 +72,7 @@ export declare const Cell: import("../utils").WithInstall<import("vue").DefineCo
66
72
  center: boolean;
67
73
  border: boolean;
68
74
  isLink: boolean;
69
- required: boolean;
75
+ required: boolean | "auto";
70
76
  clickable: boolean | null;
71
77
  }, {}>>;
72
78
  export default Cell;
@@ -108,12 +108,18 @@ var stdin_default = defineComponent({
108
108
  }, null)]);
109
109
  };
110
110
  const renderLabel = () => {
111
+ const {
112
+ checked
113
+ } = props;
111
114
  if (slots.default) {
112
115
  return _createVNode("span", {
113
116
  "class": props.bem("label", [props.labelPosition, {
114
117
  disabled: disabled.value
115
118
  }])
116
- }, [slots.default()]);
119
+ }, [slots.default({
120
+ checked,
121
+ disabled: disabled.value
122
+ })]);
117
123
  }
118
124
  };
119
125
  return () => {
package/es/col/Col.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { computed, defineComponent } from "vue";
3
- import { numericProp, createNamespace, makeNumericProp, makeStringProp } from "../utils/index.mjs";
3
+ import { numericProp, createNamespace, makeNumericProp, makeStringProp, extend } from "../utils/index.mjs";
4
4
  import { useParent } from "@vant/use";
5
5
  import { ROW_KEY } from "../row/Row.mjs";
6
6
  const [name, bem] = createNamespace("col");
@@ -24,18 +24,26 @@ var stdin_default = defineComponent({
24
24
  return;
25
25
  }
26
26
  const {
27
- spaces
27
+ spaces,
28
+ verticalSpaces
28
29
  } = parent;
30
+ let styles = {};
29
31
  if (spaces && spaces.value && spaces.value[index.value]) {
30
32
  const {
31
33
  left,
32
34
  right
33
35
  } = spaces.value[index.value];
34
- return {
36
+ styles = {
35
37
  paddingLeft: left ? `${left}px` : null,
36
38
  paddingRight: right ? `${right}px` : null
37
39
  };
38
40
  }
41
+ const {
42
+ bottom
43
+ } = verticalSpaces.value[index.value] || {};
44
+ return extend(styles, {
45
+ marginBottom: bottom ? `${bottom}px` : null
46
+ });
39
47
  });
40
48
  return () => {
41
49
  const {
@@ -15,13 +15,16 @@ export declare const collapseItemProps: {
15
15
  type: BooleanConstructor;
16
16
  default: true;
17
17
  };
18
- required: BooleanConstructor;
19
18
  iconPrefix: StringConstructor;
20
19
  valueClass: import("vue").PropType<unknown>;
21
20
  labelClass: import("vue").PropType<unknown>;
22
21
  titleClass: import("vue").PropType<unknown>;
23
22
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
24
23
  arrowDirection: import("vue").PropType<import("../cell").CellArrowDirection>;
24
+ required: {
25
+ type: import("vue").PropType<boolean | "auto">;
26
+ default: null;
27
+ };
25
28
  clickable: {
26
29
  type: import("vue").PropType<boolean | null>;
27
30
  default: null;
@@ -56,13 +59,16 @@ declare const _default: import("vue").DefineComponent<{
56
59
  type: BooleanConstructor;
57
60
  default: true;
58
61
  };
59
- required: BooleanConstructor;
60
62
  iconPrefix: StringConstructor;
61
63
  valueClass: import("vue").PropType<unknown>;
62
64
  labelClass: import("vue").PropType<unknown>;
63
65
  titleClass: import("vue").PropType<unknown>;
64
66
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
65
67
  arrowDirection: import("vue").PropType<import("../cell").CellArrowDirection>;
68
+ required: {
69
+ type: import("vue").PropType<boolean | "auto">;
70
+ default: null;
71
+ };
66
72
  clickable: {
67
73
  type: import("vue").PropType<boolean | null>;
68
74
  default: null;
@@ -95,13 +101,16 @@ declare const _default: import("vue").DefineComponent<{
95
101
  type: BooleanConstructor;
96
102
  default: true;
97
103
  };
98
- required: BooleanConstructor;
99
104
  iconPrefix: StringConstructor;
100
105
  valueClass: import("vue").PropType<unknown>;
101
106
  labelClass: import("vue").PropType<unknown>;
102
107
  titleClass: import("vue").PropType<unknown>;
103
108
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
104
109
  arrowDirection: import("vue").PropType<import("../cell").CellArrowDirection>;
110
+ required: {
111
+ type: import("vue").PropType<boolean | "auto">;
112
+ default: null;
113
+ };
105
114
  clickable: {
106
115
  type: import("vue").PropType<boolean | null>;
107
116
  default: null;
@@ -124,7 +133,7 @@ declare const _default: import("vue").DefineComponent<{
124
133
  disabled: boolean;
125
134
  border: boolean;
126
135
  isLink: boolean;
127
- required: boolean;
136
+ required: boolean | "auto";
128
137
  clickable: boolean | null;
129
138
  readonly: boolean;
130
139
  lazyRender: boolean;
@@ -14,13 +14,16 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
14
14
  type: BooleanConstructor;
15
15
  default: true;
16
16
  };
17
- required: BooleanConstructor;
18
17
  iconPrefix: StringConstructor;
19
18
  valueClass: import("vue").PropType<unknown>;
20
19
  labelClass: import("vue").PropType<unknown>;
21
20
  titleClass: import("vue").PropType<unknown>;
22
21
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
23
22
  arrowDirection: import("vue").PropType<import("..").CellArrowDirection>;
23
+ required: {
24
+ type: import("vue").PropType<boolean | "auto">;
25
+ default: null;
26
+ };
24
27
  clickable: {
25
28
  type: import("vue").PropType<boolean | null>;
26
29
  default: null;
@@ -53,13 +56,16 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
53
56
  type: BooleanConstructor;
54
57
  default: true;
55
58
  };
56
- required: BooleanConstructor;
57
59
  iconPrefix: StringConstructor;
58
60
  valueClass: import("vue").PropType<unknown>;
59
61
  labelClass: import("vue").PropType<unknown>;
60
62
  titleClass: import("vue").PropType<unknown>;
61
63
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
62
64
  arrowDirection: import("vue").PropType<import("..").CellArrowDirection>;
65
+ required: {
66
+ type: import("vue").PropType<boolean | "auto">;
67
+ default: null;
68
+ };
63
69
  clickable: {
64
70
  type: import("vue").PropType<boolean | null>;
65
71
  default: null;
@@ -82,7 +88,7 @@ export declare const CollapseItem: import("../utils").WithInstall<import("vue").
82
88
  disabled: boolean;
83
89
  border: boolean;
84
90
  isLink: boolean;
85
- required: boolean;
91
+ required: boolean | "auto";
86
92
  clickable: boolean | null;
87
93
  readonly: boolean;
88
94
  lazyRender: boolean;
@@ -57,5 +57,5 @@ type BaseThemeVars = {
57
57
  radiusLg?: string;
58
58
  radiusMax?: string;
59
59
  };
60
- export type ConfigProviderThemeVars = BaseThemeVars & import('../action-bar').ActionBarThemeVars & import('../action-bar-button').ActionBarButtonThemeVars & import('../action-bar-icon').ActionBarIconThemeVars & import('../action-sheet').ActionSheetThemeVars & import('../address-edit').AddressEditThemeVars & import('../address-list').AddressListThemeVars & import('../badge').BadgeThemeVars & import('../barrage').BarrageThemeVars & import('../button').ButtonThemeVars & import('../calendar').CalendarThemeVars & import('../card').CardThemeVars & import('../cascader').CascaderThemeVars & import('../cell').CellThemeVars & import('../cell-group').CellGroupThemeVars & import('../checkbox').CheckboxThemeVars & import('../circle').CircleThemeVars & import('../collapse-item').CollapseItemThemeVars & import('../contact-card').ContactCardThemeVars & import('../contact-edit').ContactEditThemeVars & import('../contact-list').ContactListThemeVars & import('../count-down').CountDownThemeVars & import('../coupon').CouponThemeVars & import('../coupon-cell').CouponCellThemeVars & import('../coupon-list').CouponListThemeVars & import('../dialog').DialogThemeVars & import('../divider').DividerThemeVars & import('../dropdown-item').DropdownItemThemeVars & import('../dropdown-menu').DropdownMenuThemeVars & import('../empty').EmptyThemeVars & import('../field').FieldThemeVars & import('../floating-bubble').FloatingBubbleThemeVars & import('../floating-panel').FloatingPanelThemeVars & import('../grid-item').GridItemThemeVars & import('../image').ImageThemeVars & import('../image-preview').ImagePreviewThemeVars & import('../index-anchor').IndexAnchorThemeVars & import('../index-bar').IndexBarThemeVars & import('../list').ListThemeVars & import('../loading').LoadingThemeVars & import('../nav-bar').NavBarThemeVars & import('../notice-bar').NoticeBarThemeVars & import('../notify').NotifyThemeVars & import('../number-keyboard').NumberKeyboardThemeVars & import('../overlay').OverlayThemeVars & import('../pagination').PaginationThemeVars & import('../password-input').PasswordInputThemeVars & import('../picker').PickerThemeVars & import('../picker-group').PickerGroupThemeVars & import('../popover').PopoverThemeVars & import('../popup').PopupThemeVars & import('../progress').ProgressThemeVars & import('../pull-refresh').PullRefreshThemeVars & import('../radio').RadioThemeVars & import('../rate').RateThemeVars & import('../rolling-text').RollingTextThemeVars & import('../search').SearchThemeVars & import('../share-sheet').ShareSheetThemeVars & import('../sidebar').SidebarThemeVars & import('../sidebar-item').SidebarItemThemeVars & import('../signature').SignatureThemeVars & import('../skeleton').SkeletonThemeVars & import('../slider').SliderThemeVars & import('../step').StepThemeVars & import('../stepper').StepperThemeVars & import('../steps').StepsThemeVars & import('../sticky').StickyThemeVars & import('../submit-bar').SubmitBarThemeVars & import('../swipe').SwipeThemeVars & import('../switch').SwitchThemeVars & import('../tabbar').TabbarThemeVars & import('../tabbar-item').TabbarItemThemeVars & import('../tabs').TabsThemeVars & import('../tag').TagThemeVars & import('../toast').ToastThemeVars & import('../tree-select').TreeSelectThemeVars & import('../uploader').UploaderThemeVars & import('../watermark').WatermarkThemeVars;
60
+ export type ConfigProviderThemeVars = BaseThemeVars & import('../action-bar').ActionBarThemeVars & import('../action-bar-button').ActionBarButtonThemeVars & import('../action-bar-icon').ActionBarIconThemeVars & import('../action-sheet').ActionSheetThemeVars & import('../address-edit').AddressEditThemeVars & import('../address-list').AddressListThemeVars & import('../back-top').BackTopThemeVars & import('../badge').BadgeThemeVars & import('../barrage').BarrageThemeVars & import('../button').ButtonThemeVars & import('../calendar').CalendarThemeVars & import('../card').CardThemeVars & import('../cascader').CascaderThemeVars & import('../cell').CellThemeVars & import('../cell-group').CellGroupThemeVars & import('../checkbox').CheckboxThemeVars & import('../circle').CircleThemeVars & import('../collapse-item').CollapseItemThemeVars & import('../contact-card').ContactCardThemeVars & import('../contact-edit').ContactEditThemeVars & import('../contact-list').ContactListThemeVars & import('../count-down').CountDownThemeVars & import('../coupon').CouponThemeVars & import('../coupon-cell').CouponCellThemeVars & import('../coupon-list').CouponListThemeVars & import('../dialog').DialogThemeVars & import('../divider').DividerThemeVars & import('../dropdown-item').DropdownItemThemeVars & import('../dropdown-menu').DropdownMenuThemeVars & import('../empty').EmptyThemeVars & import('../highlight').HighlightThemeVars & import('../field').FieldThemeVars & import('../floating-bubble').FloatingBubbleThemeVars & import('../floating-panel').FloatingPanelThemeVars & import('../grid-item').GridItemThemeVars & import('../image').ImageThemeVars & import('../image-preview').ImagePreviewThemeVars & import('../index-anchor').IndexAnchorThemeVars & import('../index-bar').IndexBarThemeVars & import('../list').ListThemeVars & import('../loading').LoadingThemeVars & import('../nav-bar').NavBarThemeVars & import('../notice-bar').NoticeBarThemeVars & import('../notify').NotifyThemeVars & import('../number-keyboard').NumberKeyboardThemeVars & import('../overlay').OverlayThemeVars & import('../pagination').PaginationThemeVars & import('../password-input').PasswordInputThemeVars & import('../picker').PickerThemeVars & import('../picker-group').PickerGroupThemeVars & import('../popover').PopoverThemeVars & import('../popup').PopupThemeVars & import('../progress').ProgressThemeVars & import('../pull-refresh').PullRefreshThemeVars & import('../radio').RadioThemeVars & import('../rate').RateThemeVars & import('../rolling-text').RollingTextThemeVars & import('../search').SearchThemeVars & import('../share-sheet').ShareSheetThemeVars & import('../sidebar').SidebarThemeVars & import('../sidebar-item').SidebarItemThemeVars & import('../signature').SignatureThemeVars & import('../skeleton').SkeletonThemeVars & import('../slider').SliderThemeVars & import('../step').StepThemeVars & import('../stepper').StepperThemeVars & import('../steps').StepsThemeVars & import('../sticky').StickyThemeVars & import('../submit-bar').SubmitBarThemeVars & import('../swipe').SwipeThemeVars & import('../switch').SwitchThemeVars & import('../tabbar').TabbarThemeVars & import('../tabbar-item').TabbarItemThemeVars & import('../tabs').TabsThemeVars & import('../tag').TagThemeVars & import('../toast').ToastThemeVars & import('../tree-select').TreeSelectThemeVars & import('../uploader').UploaderThemeVars & import('../watermark').WatermarkThemeVars;
61
61
  export {};
@@ -24,10 +24,6 @@ export declare const fieldSharedProps: {
24
24
  autocorrect: StringConstructor;
25
25
  errorMessage: StringConstructor;
26
26
  enterkeyhint: StringConstructor;
27
- spellcheck: {
28
- type: BooleanConstructor;
29
- default: null;
30
- };
31
27
  clearTrigger: {
32
28
  type: PropType<FieldClearTrigger>;
33
29
  default: FieldClearTrigger;
@@ -36,6 +32,10 @@ export declare const fieldSharedProps: {
36
32
  type: PropType<FieldFormatTrigger>;
37
33
  default: FieldFormatTrigger;
38
34
  };
35
+ spellcheck: {
36
+ type: BooleanConstructor;
37
+ default: null;
38
+ };
39
39
  error: {
40
40
  type: BooleanConstructor;
41
41
  default: null;
@@ -65,13 +65,16 @@ export declare const fieldProps: {
65
65
  type: BooleanConstructor;
66
66
  default: true;
67
67
  };
68
- required: BooleanConstructor;
69
68
  iconPrefix: StringConstructor;
70
69
  valueClass: PropType<unknown>;
71
70
  labelClass: PropType<unknown>;
72
71
  titleClass: PropType<unknown>;
73
72
  titleStyle: PropType<string | import("vue").CSSProperties>;
74
73
  arrowDirection: PropType<import("../cell").CellArrowDirection>;
74
+ required: {
75
+ type: PropType<boolean | "auto">;
76
+ default: null;
77
+ };
75
78
  clickable: {
76
79
  type: PropType<boolean | null>;
77
80
  default: null;
@@ -100,10 +103,6 @@ export declare const fieldProps: {
100
103
  autocorrect: StringConstructor;
101
104
  errorMessage: StringConstructor;
102
105
  enterkeyhint: StringConstructor;
103
- spellcheck: {
104
- type: BooleanConstructor;
105
- default: null;
106
- };
107
106
  clearTrigger: {
108
107
  type: PropType<FieldClearTrigger>;
109
108
  default: FieldClearTrigger;
@@ -112,6 +111,10 @@ export declare const fieldProps: {
112
111
  type: PropType<FieldFormatTrigger>;
113
112
  default: FieldFormatTrigger;
114
113
  };
114
+ spellcheck: {
115
+ type: BooleanConstructor;
116
+ default: null;
117
+ };
115
118
  error: {
116
119
  type: BooleanConstructor;
117
120
  default: null;
@@ -159,13 +162,16 @@ declare const _default: import("vue").DefineComponent<{
159
162
  type: BooleanConstructor;
160
163
  default: true;
161
164
  };
162
- required: BooleanConstructor;
163
165
  iconPrefix: StringConstructor;
164
166
  valueClass: PropType<unknown>;
165
167
  labelClass: PropType<unknown>;
166
168
  titleClass: PropType<unknown>;
167
169
  titleStyle: PropType<string | import("vue").CSSProperties>;
168
170
  arrowDirection: PropType<import("../cell").CellArrowDirection>;
171
+ required: {
172
+ type: PropType<boolean | "auto">;
173
+ default: null;
174
+ };
169
175
  clickable: {
170
176
  type: PropType<boolean | null>;
171
177
  default: null;
@@ -194,10 +200,6 @@ declare const _default: import("vue").DefineComponent<{
194
200
  autocorrect: StringConstructor;
195
201
  errorMessage: StringConstructor;
196
202
  enterkeyhint: StringConstructor;
197
- spellcheck: {
198
- type: BooleanConstructor;
199
- default: null;
200
- };
201
203
  clearTrigger: {
202
204
  type: PropType<FieldClearTrigger>;
203
205
  default: FieldClearTrigger;
@@ -206,6 +208,10 @@ declare const _default: import("vue").DefineComponent<{
206
208
  type: PropType<FieldFormatTrigger>;
207
209
  default: FieldFormatTrigger;
208
210
  };
211
+ spellcheck: {
212
+ type: BooleanConstructor;
213
+ default: null;
214
+ };
209
215
  error: {
210
216
  type: BooleanConstructor;
211
217
  default: null;
@@ -251,13 +257,16 @@ declare const _default: import("vue").DefineComponent<{
251
257
  type: BooleanConstructor;
252
258
  default: true;
253
259
  };
254
- required: BooleanConstructor;
255
260
  iconPrefix: StringConstructor;
256
261
  valueClass: PropType<unknown>;
257
262
  labelClass: PropType<unknown>;
258
263
  titleClass: PropType<unknown>;
259
264
  titleStyle: PropType<string | import("vue").CSSProperties>;
260
265
  arrowDirection: PropType<import("../cell").CellArrowDirection>;
266
+ required: {
267
+ type: PropType<boolean | "auto">;
268
+ default: null;
269
+ };
261
270
  clickable: {
262
271
  type: PropType<boolean | null>;
263
272
  default: null;
@@ -286,10 +295,6 @@ declare const _default: import("vue").DefineComponent<{
286
295
  autocorrect: StringConstructor;
287
296
  errorMessage: StringConstructor;
288
297
  enterkeyhint: StringConstructor;
289
- spellcheck: {
290
- type: BooleanConstructor;
291
- default: null;
292
- };
293
298
  clearTrigger: {
294
299
  type: PropType<FieldClearTrigger>;
295
300
  default: FieldClearTrigger;
@@ -298,6 +303,10 @@ declare const _default: import("vue").DefineComponent<{
298
303
  type: PropType<FieldFormatTrigger>;
299
304
  default: FieldFormatTrigger;
300
305
  };
306
+ spellcheck: {
307
+ type: BooleanConstructor;
308
+ default: null;
309
+ };
301
310
  error: {
302
311
  type: BooleanConstructor;
303
312
  default: null;
@@ -346,14 +355,14 @@ declare const _default: import("vue").DefineComponent<{
346
355
  disabled: boolean;
347
356
  border: boolean;
348
357
  isLink: boolean;
349
- required: boolean;
358
+ required: boolean | "auto";
350
359
  clickable: boolean | null;
351
360
  clearable: boolean;
352
361
  clearIcon: string;
353
362
  modelValue: string | number;
354
- spellcheck: boolean;
355
363
  clearTrigger: FieldClearTrigger;
356
364
  formatTrigger: FieldFormatTrigger;
365
+ spellcheck: boolean;
357
366
  error: boolean;
358
367
  readonly: boolean;
359
368
  showWordLimit: boolean;
@@ -27,12 +27,12 @@ const fieldSharedProps = {
27
27
  autocorrect: String,
28
28
  errorMessage: String,
29
29
  enterkeyhint: String,
30
+ clearTrigger: makeStringProp("focus"),
31
+ formatTrigger: makeStringProp("onChange"),
30
32
  spellcheck: {
31
33
  type: Boolean,
32
34
  default: null
33
35
  },
34
- clearTrigger: makeStringProp("focus"),
35
- formatTrigger: makeStringProp("onChange"),
36
36
  error: {
37
37
  type: Boolean,
38
38
  default: null
@@ -108,6 +108,14 @@ var stdin_default = defineComponent({
108
108
  }
109
109
  return props.modelValue;
110
110
  });
111
+ const showRequiredMark = computed(() => {
112
+ var _a;
113
+ const required = getProp("required");
114
+ if (required === "auto") {
115
+ return (_a = props.rules) == null ? void 0 : _a.some((rule) => rule.required);
116
+ }
117
+ return required;
118
+ });
111
119
  const runRules = (rules) => rules.reduce((promise, rule) => promise.then(() => {
112
120
  if (state.status === "failed") {
113
121
  return;
@@ -510,7 +518,7 @@ var stdin_default = defineComponent({
510
518
  "titleStyle": labelStyle.value,
511
519
  "valueClass": bem("value"),
512
520
  "titleClass": [bem("label", [labelAlign, {
513
- required: props.required
521
+ required: showRequiredMark.value
514
522
  }]), props.labelClass],
515
523
  "arrowDirection": props.arrowDirection
516
524
  }, {
@@ -1 +1 @@
1
- :root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-text-color);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size: 18px;--van-field-clear-icon-size: 18px;--van-field-clear-icon-color: var(--van-gray-5);--van-field-right-icon-color: var(--van-gray-6);--van-field-error-message-color: var(--van-danger-color);--van-field-error-message-font-size: 12px;--van-field-text-area-min-height: 60px;--van-field-word-limit-color: var(--van-gray-7);--van-field-word-limit-font-size: var(--van-font-size-sm);--van-field-word-limit-line-height: 16px;--van-field-disabled-text-color: var(--van-text-color-3);--van-field-required-mark-color: var(--van-red)}.van-field{flex-wrap:wrap}.van-field__label{flex:none;box-sizing:border-box;width:var(--van-field-label-width);margin-right:var(--van-field-label-margin-right);color:var(--van-field-label-color);text-align:left;word-wrap:break-word}.van-field__label--center{text-align:center}.van-field__label--right{text-align:right}.van-field__label--top{display:flex;width:100%;text-align:left;margin-bottom:var(--van-padding-base);word-break:break-word}.van-field__label--required:before{margin-right:2px;color:var(--van-field-required-mark-color);content:"*"}.van-field--disabled .van-field__label{color:var(--van-field-disabled-text-color)}.van-field__value{overflow:visible}.van-field__body{display:flex;align-items:center}.van-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--van-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.van-field__control::-webkit-input-placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control::placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control:read-only{cursor:default}.van-field__control:disabled{color:var(--van-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--van-field-input-disabled-text-color)}.van-field__control--center{justify-content:center;text-align:center}.van-field__control--right{justify-content:flex-end;text-align:right}.van-field__control--custom{display:flex;align-items:center;min-height:var(--van-cell-line-height)}.van-field__control--error::-webkit-input-placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--error,.van-field__control--error::placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--min-height{min-height:var(--van-field-text-area-min-height)}.van-field__control[type=date],.van-field__control[type=time],.van-field__control[type=datetime-local]{min-height:var(--van-cell-line-height)}.van-field__control[type=search]{-webkit-appearance:none}.van-field__clear,.van-field__icon,.van-field__button,.van-field__right-icon{flex-shrink:0}.van-field__clear,.van-field__right-icon{margin-right:calc(var(--van-padding-xs) * -1);padding:0 var(--van-padding-xs);line-height:inherit}.van-field__clear{color:var(--van-field-clear-icon-color);font-size:var(--van-field-clear-icon-size);cursor:pointer}.van-field__left-icon .van-icon,.van-field__right-icon .van-icon{display:block;font-size:var(--van-field-icon-size);line-height:inherit}.van-field__left-icon{margin-right:var(--van-padding-base)}.van-field__right-icon{color:var(--van-field-right-icon-color)}.van-field__button{padding-left:var(--van-padding-xs)}.van-field__error-message{color:var(--van-field-error-message-color);font-size:var(--van-field-error-message-font-size);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{margin-top:var(--van-padding-base);color:var(--van-field-word-limit-color);font-size:var(--van-field-word-limit-font-size);line-height:var(--van-field-word-limit-line-height);text-align:right}
1
+ :root{--van-field-label-width: 6.2em;--van-field-label-color: var(--van-text-color);--van-field-label-margin-right: var(--van-padding-sm);--van-field-input-text-color: var(--van-text-color);--van-field-input-error-text-color: var(--van-danger-color);--van-field-input-disabled-text-color: var(--van-text-color-3);--van-field-placeholder-text-color: var(--van-text-color-3);--van-field-icon-size: 18px;--van-field-clear-icon-size: 18px;--van-field-clear-icon-color: var(--van-gray-5);--van-field-right-icon-color: var(--van-gray-6);--van-field-error-message-color: var(--van-danger-color);--van-field-error-message-font-size: 12px;--van-field-text-area-min-height: 60px;--van-field-word-limit-color: var(--van-gray-7);--van-field-word-limit-font-size: var(--van-font-size-sm);--van-field-word-limit-line-height: 16px;--van-field-disabled-text-color: var(--van-text-color-3);--van-field-required-mark-color: var(--van-red)}.van-field{flex-wrap:wrap}.van-field__label{flex:none;box-sizing:border-box;width:var(--van-field-label-width);margin-right:var(--van-field-label-margin-right);color:var(--van-field-label-color);text-align:left;word-wrap:break-word}.van-field__label--center{text-align:center}.van-field__label--right{text-align:right}.van-field__label--top{display:flex;width:100%;text-align:left;margin-bottom:var(--van-padding-base);overflow-wrap:break-word}.van-field__label--required:before{margin-right:2px;color:var(--van-field-required-mark-color);content:"*"}.van-field--disabled .van-field__label{color:var(--van-field-disabled-text-color)}.van-field__value{overflow:visible}.van-field__body{display:flex;align-items:center}.van-field__control{display:block;box-sizing:border-box;width:100%;min-width:0;margin:0;padding:0;color:var(--van-field-input-text-color);line-height:inherit;text-align:left;background-color:transparent;border:0;resize:none;-webkit-user-select:auto;user-select:auto}.van-field__control::-webkit-input-placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control::placeholder{color:var(--van-field-placeholder-text-color)}.van-field__control:read-only{cursor:default}.van-field__control:disabled{color:var(--van-field-input-disabled-text-color);cursor:not-allowed;opacity:1;-webkit-text-fill-color:var(--van-field-input-disabled-text-color)}.van-field__control--center{justify-content:center;text-align:center}.van-field__control--right{justify-content:flex-end;text-align:right}.van-field__control--custom{display:flex;align-items:center;min-height:var(--van-cell-line-height)}.van-field__control--error::-webkit-input-placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--error,.van-field__control--error::placeholder{color:var(--van-field-input-error-text-color);-webkit-text-fill-color:currentColor}.van-field__control--min-height{min-height:var(--van-field-text-area-min-height)}.van-field__control[type=date],.van-field__control[type=time],.van-field__control[type=datetime-local]{min-height:var(--van-cell-line-height)}.van-field__control[type=search]{-webkit-appearance:none}.van-field__clear,.van-field__icon,.van-field__button,.van-field__right-icon{flex-shrink:0}.van-field__clear,.van-field__right-icon{margin-right:calc(var(--van-padding-xs) * -1);padding:0 var(--van-padding-xs);line-height:inherit}.van-field__clear{color:var(--van-field-clear-icon-color);font-size:var(--van-field-clear-icon-size);cursor:pointer}.van-field__left-icon .van-icon,.van-field__right-icon .van-icon{display:block;font-size:var(--van-field-icon-size);line-height:inherit}.van-field__left-icon{margin-right:var(--van-padding-base)}.van-field__right-icon{color:var(--van-field-right-icon-color)}.van-field__button{padding-left:var(--van-padding-xs)}.van-field__error-message{color:var(--van-field-error-message-color);font-size:var(--van-field-error-message-font-size);text-align:left}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{margin-top:var(--van-padding-base);color:var(--van-field-word-limit-color);font-size:var(--van-field-word-limit-font-size);line-height:var(--van-field-word-limit-line-height);text-align:right}