vant 4.7.1 → 4.7.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 (90) hide show
  1. package/README.md +1 -0
  2. package/es/address-edit/AddressEdit.mjs +1 -1
  3. package/es/cell/Cell.d.ts +17 -5
  4. package/es/cell/Cell.mjs +5 -2
  5. package/es/cell/index.d.ts +9 -3
  6. package/es/collapse-item/CollapseItem.d.ts +13 -4
  7. package/es/collapse-item/index.d.ts +9 -3
  8. package/es/config-provider/types.d.ts +1 -1
  9. package/es/field/Field.d.ts +30 -21
  10. package/es/field/Field.mjs +11 -3
  11. package/es/field/index.css +1 -1
  12. package/es/field/index.d.ts +18 -12
  13. package/es/field/types.d.ts +1 -1
  14. package/es/form/Form.d.ts +3 -0
  15. package/es/form/Form.mjs +1 -0
  16. package/es/form/index.d.ts +2 -0
  17. package/es/icon/index.css +1 -1
  18. package/es/image-preview/ImagePreview.d.ts +13 -0
  19. package/es/image-preview/ImagePreview.mjs +2 -0
  20. package/es/image-preview/ImagePreviewItem.d.ts +3 -0
  21. package/es/image-preview/ImagePreviewItem.mjs +16 -11
  22. package/es/image-preview/function-call.mjs +1 -0
  23. package/es/image-preview/index.d.ts +9 -0
  24. package/es/image-preview/types.d.ts +1 -0
  25. package/es/index.d.ts +1 -1
  26. package/es/index.mjs +1 -1
  27. package/es/locale/lang/ar-SA.d.ts +63 -0
  28. package/es/locale/lang/ar-SA.mjs +65 -0
  29. package/es/picker-group/PickerGroup.mjs +3 -3
  30. package/es/progress/types.d.ts +1 -4
  31. package/es/search/Search.d.ts +13 -13
  32. package/es/search/Search.mjs +3 -1
  33. package/es/search/index.css +1 -1
  34. package/es/search/index.d.ts +9 -9
  35. package/es/signature/Signature.mjs +49 -38
  36. package/es/signature/index.d.ts +1 -1
  37. package/es/signature/types.d.ts +6 -0
  38. package/es/tabs/Tabs.d.ts +13 -0
  39. package/es/tabs/Tabs.mjs +3 -2
  40. package/es/tabs/index.d.ts +9 -0
  41. package/es/text-ellipsis/index.css +1 -1
  42. package/es/uploader/Uploader.mjs +12 -3
  43. package/lib/address-edit/AddressEdit.js +1 -1
  44. package/lib/cell/Cell.d.ts +17 -5
  45. package/lib/cell/Cell.js +5 -2
  46. package/lib/cell/index.d.ts +9 -3
  47. package/lib/collapse-item/CollapseItem.d.ts +13 -4
  48. package/lib/collapse-item/index.d.ts +9 -3
  49. package/lib/config-provider/types.d.ts +1 -1
  50. package/lib/field/Field.d.ts +30 -21
  51. package/lib/field/Field.js +11 -3
  52. package/lib/field/index.css +1 -1
  53. package/lib/field/index.d.ts +18 -12
  54. package/lib/field/types.d.ts +1 -1
  55. package/lib/form/Form.d.ts +3 -0
  56. package/lib/form/Form.js +1 -0
  57. package/lib/form/index.d.ts +2 -0
  58. package/lib/icon/index.css +1 -1
  59. package/lib/image-preview/ImagePreview.d.ts +13 -0
  60. package/lib/image-preview/ImagePreview.js +2 -0
  61. package/lib/image-preview/ImagePreviewItem.d.ts +3 -0
  62. package/lib/image-preview/ImagePreviewItem.js +16 -11
  63. package/lib/image-preview/function-call.js +1 -0
  64. package/lib/image-preview/index.d.ts +9 -0
  65. package/lib/image-preview/types.d.ts +1 -0
  66. package/lib/index.css +1 -1
  67. package/lib/index.d.ts +1 -1
  68. package/lib/index.js +1 -1
  69. package/lib/locale/lang/ar-SA.d.ts +63 -0
  70. package/lib/locale/lang/ar-SA.js +84 -0
  71. package/lib/picker-group/PickerGroup.js +2 -2
  72. package/lib/progress/types.d.ts +1 -4
  73. package/lib/search/Search.d.ts +13 -13
  74. package/lib/search/Search.js +3 -1
  75. package/lib/search/index.css +1 -1
  76. package/lib/search/index.d.ts +9 -9
  77. package/lib/signature/Signature.js +47 -36
  78. package/lib/signature/index.d.ts +1 -1
  79. package/lib/signature/types.d.ts +6 -0
  80. package/lib/tabs/Tabs.d.ts +13 -0
  81. package/lib/tabs/Tabs.js +3 -2
  82. package/lib/tabs/index.d.ts +9 -0
  83. package/lib/text-ellipsis/index.css +1 -1
  84. package/lib/uploader/Uploader.js +11 -2
  85. package/lib/vant.cjs.js +103 -61
  86. package/lib/vant.es.js +104 -62
  87. package/lib/vant.js +103 -61
  88. package/lib/vant.min.js +1 -1
  89. package/lib/web-types.json +1 -1
  90. package/package.json +4 -4
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": () => {
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;
@@ -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('../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}
@@ -15,13 +15,16 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
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("..").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;
@@ -50,10 +53,6 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
50
53
  autocorrect: StringConstructor;
51
54
  errorMessage: StringConstructor;
52
55
  enterkeyhint: StringConstructor;
53
- spellcheck: {
54
- type: BooleanConstructor;
55
- default: null;
56
- };
57
56
  clearTrigger: {
58
57
  type: import("vue").PropType<import("./types").FieldClearTrigger>;
59
58
  default: import("./types").FieldClearTrigger;
@@ -62,6 +61,10 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
62
61
  type: import("vue").PropType<import("./types").FieldFormatTrigger>;
63
62
  default: import("./types").FieldFormatTrigger;
64
63
  };
64
+ spellcheck: {
65
+ type: BooleanConstructor;
66
+ default: null;
67
+ };
65
68
  error: {
66
69
  type: BooleanConstructor;
67
70
  default: null;
@@ -107,13 +110,16 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
107
110
  type: BooleanConstructor;
108
111
  default: true;
109
112
  };
110
- required: BooleanConstructor;
111
113
  iconPrefix: StringConstructor;
112
114
  valueClass: import("vue").PropType<unknown>;
113
115
  labelClass: import("vue").PropType<unknown>;
114
116
  titleClass: import("vue").PropType<unknown>;
115
117
  titleStyle: import("vue").PropType<string | import("vue").CSSProperties>;
116
118
  arrowDirection: import("vue").PropType<import("..").CellArrowDirection>;
119
+ required: {
120
+ type: import("vue").PropType<boolean | "auto">;
121
+ default: null;
122
+ };
117
123
  clickable: {
118
124
  type: import("vue").PropType<boolean | null>;
119
125
  default: null;
@@ -142,10 +148,6 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
142
148
  autocorrect: StringConstructor;
143
149
  errorMessage: StringConstructor;
144
150
  enterkeyhint: StringConstructor;
145
- spellcheck: {
146
- type: BooleanConstructor;
147
- default: null;
148
- };
149
151
  clearTrigger: {
150
152
  type: import("vue").PropType<import("./types").FieldClearTrigger>;
151
153
  default: import("./types").FieldClearTrigger;
@@ -154,6 +156,10 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
154
156
  type: import("vue").PropType<import("./types").FieldFormatTrigger>;
155
157
  default: import("./types").FieldFormatTrigger;
156
158
  };
159
+ spellcheck: {
160
+ type: BooleanConstructor;
161
+ default: null;
162
+ };
157
163
  error: {
158
164
  type: BooleanConstructor;
159
165
  default: null;
@@ -202,14 +208,14 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
202
208
  disabled: boolean;
203
209
  border: boolean;
204
210
  isLink: boolean;
205
- required: boolean;
211
+ required: boolean | "auto";
206
212
  clickable: boolean | null;
207
213
  clearable: boolean;
208
214
  clearIcon: string;
209
215
  modelValue: string | number;
210
- spellcheck: boolean;
211
216
  clearTrigger: import("./types").FieldClearTrigger;
212
217
  formatTrigger: import("./types").FieldFormatTrigger;
218
+ spellcheck: boolean;
213
219
  error: boolean;
214
220
  readonly: boolean;
215
221
  showWordLimit: boolean;
@@ -26,7 +26,7 @@ export type FieldRule = {
26
26
  validateEmpty?: boolean;
27
27
  };
28
28
  export type FieldValidationStatus = 'passed' | 'failed' | 'unvalidated';
29
- export type FieldFormSharedProps = 'colon' | 'disabled' | 'readonly' | 'labelWidth' | 'labelAlign' | 'inputAlign' | 'errorMessageAlign';
29
+ export type FieldFormSharedProps = 'colon' | 'required' | 'disabled' | 'readonly' | 'labelWidth' | 'labelAlign' | 'inputAlign' | 'errorMessageAlign';
30
30
  export type FieldExpose = {
31
31
  blur: () => void | undefined;
32
32
  focus: () => void | undefined;
package/es/form/Form.d.ts CHANGED
@@ -4,6 +4,7 @@ export declare const formProps: {
4
4
  colon: BooleanConstructor;
5
5
  disabled: BooleanConstructor;
6
6
  readonly: BooleanConstructor;
7
+ required: PropType<boolean | "auto">;
7
8
  showError: BooleanConstructor;
8
9
  labelWidth: (NumberConstructor | StringConstructor)[];
9
10
  labelAlign: PropType<FieldTextAlign>;
@@ -29,6 +30,7 @@ declare const _default: import("vue").DefineComponent<{
29
30
  colon: BooleanConstructor;
30
31
  disabled: BooleanConstructor;
31
32
  readonly: BooleanConstructor;
33
+ required: PropType<boolean | "auto">;
32
34
  showError: BooleanConstructor;
33
35
  labelWidth: (NumberConstructor | StringConstructor)[];
34
36
  labelAlign: PropType<FieldTextAlign>;
@@ -52,6 +54,7 @@ declare const _default: import("vue").DefineComponent<{
52
54
  colon: BooleanConstructor;
53
55
  disabled: BooleanConstructor;
54
56
  readonly: BooleanConstructor;
57
+ required: PropType<boolean | "auto">;
55
58
  showError: BooleanConstructor;
56
59
  labelWidth: (NumberConstructor | StringConstructor)[];
57
60
  labelAlign: PropType<FieldTextAlign>;
package/es/form/Form.mjs CHANGED
@@ -8,6 +8,7 @@ const formProps = {
8
8
  colon: Boolean,
9
9
  disabled: Boolean,
10
10
  readonly: Boolean,
11
+ required: [Boolean, String],
11
12
  showError: Boolean,
12
13
  labelWidth: numericProp,
13
14
  labelAlign: String,