vant 3.5.1 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ MIT License
2
+
3
+ Copyright (c) Youzan
4
+ Copyright (c) Chen Jiahan and other contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,6 +1,7 @@
1
1
  import { type ExtractPropTypes } from 'vue';
2
2
  export declare const ACTION_BAR_KEY: unique symbol;
3
3
  declare const actionBarProps: {
4
+ placeholder: BooleanConstructor;
4
5
  safeAreaInsetBottom: {
5
6
  type: BooleanConstructor;
6
7
  default: true;
@@ -8,16 +9,19 @@ declare const actionBarProps: {
8
9
  };
9
10
  export declare type ActionBarProps = ExtractPropTypes<typeof actionBarProps>;
10
11
  declare const _default: import("vue").DefineComponent<{
12
+ placeholder: BooleanConstructor;
11
13
  safeAreaInsetBottom: {
12
14
  type: BooleanConstructor;
13
15
  default: true;
14
16
  };
15
17
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
18
+ placeholder: BooleanConstructor;
16
19
  safeAreaInsetBottom: {
17
20
  type: BooleanConstructor;
18
21
  default: true;
19
22
  };
20
23
  }>>, {
24
+ placeholder: boolean;
21
25
  safeAreaInsetBottom: boolean;
22
26
  }>;
23
27
  export default _default;
@@ -1,10 +1,12 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { defineComponent } from "vue";
2
+ import { defineComponent, ref } from "vue";
3
3
  import { truthProp, createNamespace } from "../utils/index.mjs";
4
4
  import { useChildren } from "@vant/use";
5
+ import { usePlaceholder } from "../composables/use-placeholder.mjs";
5
6
  const [name, bem] = createNamespace("action-bar");
6
7
  const ACTION_BAR_KEY = Symbol(name);
7
8
  const actionBarProps = {
9
+ placeholder: Boolean,
8
10
  safeAreaInsetBottom: truthProp
9
11
  };
10
12
  var stdin_default = defineComponent({
@@ -13,18 +15,27 @@ var stdin_default = defineComponent({
13
15
  setup(props, {
14
16
  slots
15
17
  }) {
18
+ const root = ref();
19
+ const renderPlaceholder = usePlaceholder(root, bem);
16
20
  const {
17
21
  linkChildren
18
22
  } = useChildren(ACTION_BAR_KEY);
19
23
  linkChildren();
20
- return () => {
24
+ const renderActionBar = () => {
21
25
  var _a;
22
26
  return _createVNode("div", {
27
+ "ref": root,
23
28
  "class": [bem(), {
24
29
  "van-safe-area-bottom": props.safeAreaInsetBottom
25
30
  }]
26
31
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
27
32
  };
33
+ return () => {
34
+ if (props.placeholder) {
35
+ return renderPlaceholder(renderActionBar);
36
+ }
37
+ return renderActionBar();
38
+ };
28
39
  }
29
40
  });
30
41
  export {
@@ -1,14 +1,17 @@
1
1
  export declare const ActionBar: import("../utils").WithInstall<import("vue").DefineComponent<{
2
+ placeholder: BooleanConstructor;
2
3
  safeAreaInsetBottom: {
3
4
  type: BooleanConstructor;
4
5
  default: true;
5
6
  };
6
7
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ placeholder: BooleanConstructor;
7
9
  safeAreaInsetBottom: {
8
10
  type: BooleanConstructor;
9
11
  default: true;
10
12
  };
11
13
  }>>, {
14
+ placeholder: boolean;
12
15
  safeAreaInsetBottom: boolean;
13
16
  }>>;
14
17
  export default ActionBar;
@@ -209,7 +209,7 @@ declare const _default: import("vue").DefineComponent<{
209
209
  type: BooleanConstructor;
210
210
  default: null;
211
211
  };
212
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
212
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
213
213
  icon: StringConstructor;
214
214
  size: PropType<import("../cell").CellSize>;
215
215
  title: (NumberConstructor | StringConstructor)[];
@@ -297,6 +297,8 @@ declare const _default: import("vue").DefineComponent<{
297
297
  onKeypress?: ((...args: any[]) => any) | undefined;
298
298
  onClear?: ((...args: any[]) => any) | undefined;
299
299
  "onClick-input"?: ((...args: any[]) => any) | undefined;
300
+ "onEnd-validate"?: ((...args: any[]) => any) | undefined;
301
+ "onStart-validate"?: ((...args: any[]) => any) | undefined;
300
302
  "onClick-left-icon"?: ((...args: any[]) => any) | undefined;
301
303
  "onClick-right-icon"?: ((...args: any[]) => any) | undefined;
302
304
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -58,7 +58,7 @@ const fieldProps = extend({}, cellSharedProps, fieldSharedProps, {
58
58
  var stdin_default = defineComponent({
59
59
  name,
60
60
  props: fieldProps,
61
- emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
61
+ emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
62
62
  setup(props, {
63
63
  emit,
64
64
  slots
@@ -132,18 +132,24 @@ var stdin_default = defineComponent({
132
132
  state.status = "unvalidated";
133
133
  state.validateMessage = "";
134
134
  };
135
+ const endValidate = () => emit("end-validate", {
136
+ status: state.status
137
+ });
135
138
  const validate = (rules = props.rules) => new Promise((resolve) => {
136
139
  resetValidation();
137
140
  if (rules) {
141
+ emit("start-validate");
138
142
  runRules(rules).then(() => {
139
143
  if (state.status === "failed") {
140
144
  resolve({
141
145
  name: props.name,
142
146
  message: state.validateMessage
143
147
  });
148
+ endValidate();
144
149
  } else {
145
150
  state.status = "passed";
146
151
  resolve();
152
+ endValidate();
147
153
  }
148
154
  });
149
155
  } else {
@@ -81,7 +81,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
81
81
  type: BooleanConstructor;
82
82
  default: null;
83
83
  };
84
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
84
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
85
85
  icon: StringConstructor;
86
86
  size: import("vue").PropType<import("..").CellSize>;
87
87
  title: (NumberConstructor | StringConstructor)[];
@@ -169,6 +169,8 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
169
169
  onKeypress?: ((...args: any[]) => any) | undefined;
170
170
  onClear?: ((...args: any[]) => any) | undefined;
171
171
  "onClick-input"?: ((...args: any[]) => any) | undefined;
172
+ "onEnd-validate"?: ((...args: any[]) => any) | undefined;
173
+ "onStart-validate"?: ((...args: any[]) => any) | undefined;
172
174
  "onClick-left-icon"?: ((...args: any[]) => any) | undefined;
173
175
  "onClick-right-icon"?: ((...args: any[]) => any) | undefined;
174
176
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
package/es/index.d.ts CHANGED
@@ -90,4 +90,4 @@ declare namespace _default {
90
90
  }
91
91
  export default _default;
92
92
  export function install(app: any): void;
93
- export const version: "3.5.1";
93
+ export const version: "3.5.2";
package/es/index.mjs CHANGED
@@ -83,7 +83,7 @@ import { Tag } from "./tag/index.mjs";
83
83
  import { Toast } from "./toast/index.mjs";
84
84
  import { TreeSelect } from "./tree-select/index.mjs";
85
85
  import { Uploader } from "./uploader/index.mjs";
86
- const version = "3.5.1";
86
+ const version = "3.5.2";
87
87
  function install(app) {
88
88
  const components = [
89
89
  ActionBar,
@@ -20,6 +20,7 @@ declare const submitBarProps: {
20
20
  };
21
21
  buttonColor: StringConstructor;
22
22
  suffixLabel: StringConstructor;
23
+ placeholder: BooleanConstructor;
23
24
  decimalLength: {
24
25
  type: (NumberConstructor | StringConstructor)[];
25
26
  default: number;
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
49
50
  };
50
51
  buttonColor: StringConstructor;
51
52
  suffixLabel: StringConstructor;
53
+ placeholder: BooleanConstructor;
52
54
  decimalLength: {
53
55
  type: (NumberConstructor | StringConstructor)[];
54
56
  default: number;
@@ -76,6 +78,7 @@ declare const _default: import("vue").DefineComponent<{
76
78
  };
77
79
  buttonColor: StringConstructor;
78
80
  suffixLabel: StringConstructor;
81
+ placeholder: BooleanConstructor;
79
82
  decimalLength: {
80
83
  type: (NumberConstructor | StringConstructor)[];
81
84
  default: number;
@@ -88,6 +91,7 @@ declare const _default: import("vue").DefineComponent<{
88
91
  onSubmit?: ((...args: any[]) => any) | undefined;
89
92
  }, {
90
93
  disabled: boolean;
94
+ placeholder: boolean;
91
95
  safeAreaInsetBottom: boolean;
92
96
  loading: boolean;
93
97
  currency: string;
@@ -1,8 +1,9 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
- import { defineComponent } from "vue";
2
+ import { ref, defineComponent } from "vue";
3
3
  import { truthProp, makeStringProp, makeNumericProp, createNamespace } from "../utils/index.mjs";
4
4
  import { Icon } from "../icon/index.mjs";
5
5
  import { Button } from "../button/index.mjs";
6
+ import { usePlaceholder } from "../composables/use-placeholder.mjs";
6
7
  const [name, bem, t] = createNamespace("submit-bar");
7
8
  const submitBarProps = {
8
9
  tip: String,
@@ -17,6 +18,7 @@ const submitBarProps = {
17
18
  buttonType: makeStringProp("danger"),
18
19
  buttonColor: String,
19
20
  suffixLabel: String,
21
+ placeholder: Boolean,
20
22
  decimalLength: makeNumericProp(2),
21
23
  safeAreaInsetBottom: truthProp
22
24
  };
@@ -28,6 +30,8 @@ var stdin_default = defineComponent({
28
30
  emit,
29
31
  slots
30
32
  }) {
33
+ const root = ref();
34
+ const renderPlaceholder = usePlaceholder(root, bem);
31
35
  const renderText = () => {
32
36
  const {
33
37
  price,
@@ -87,9 +91,10 @@ var stdin_default = defineComponent({
87
91
  "onClick": onClickButton
88
92
  }, null);
89
93
  };
90
- return () => {
94
+ const renderSubmitBar = () => {
91
95
  var _a, _b;
92
96
  return _createVNode("div", {
97
+ "ref": root,
93
98
  "class": [bem(), {
94
99
  "van-safe-area-bottom": props.safeAreaInsetBottom
95
100
  }]
@@ -97,6 +102,12 @@ var stdin_default = defineComponent({
97
102
  "class": bem("bar")
98
103
  }, [(_b = slots.default) == null ? void 0 : _b.call(slots), renderText(), renderButton()])]);
99
104
  };
105
+ return () => {
106
+ if (props.placeholder) {
107
+ return renderPlaceholder(renderSubmitBar);
108
+ }
109
+ return renderSubmitBar();
110
+ };
100
111
  }
101
112
  });
102
113
  export {
@@ -17,6 +17,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
17
17
  };
18
18
  buttonColor: StringConstructor;
19
19
  suffixLabel: StringConstructor;
20
+ placeholder: BooleanConstructor;
20
21
  decimalLength: {
21
22
  type: (NumberConstructor | StringConstructor)[];
22
23
  default: number;
@@ -44,6 +45,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
44
45
  };
45
46
  buttonColor: StringConstructor;
46
47
  suffixLabel: StringConstructor;
48
+ placeholder: BooleanConstructor;
47
49
  decimalLength: {
48
50
  type: (NumberConstructor | StringConstructor)[];
49
51
  default: number;
@@ -56,6 +58,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
56
58
  onSubmit?: ((...args: any[]) => any) | undefined;
57
59
  }, {
58
60
  disabled: boolean;
61
+ placeholder: boolean;
59
62
  safeAreaInsetBottom: boolean;
60
63
  loading: boolean;
61
64
  currency: string;
@@ -1,6 +1,7 @@
1
1
  import { type ExtractPropTypes } from 'vue';
2
2
  export declare const ACTION_BAR_KEY: unique symbol;
3
3
  declare const actionBarProps: {
4
+ placeholder: BooleanConstructor;
4
5
  safeAreaInsetBottom: {
5
6
  type: BooleanConstructor;
6
7
  default: true;
@@ -8,16 +9,19 @@ declare const actionBarProps: {
8
9
  };
9
10
  export declare type ActionBarProps = ExtractPropTypes<typeof actionBarProps>;
10
11
  declare const _default: import("vue").DefineComponent<{
12
+ placeholder: BooleanConstructor;
11
13
  safeAreaInsetBottom: {
12
14
  type: BooleanConstructor;
13
15
  default: true;
14
16
  };
15
17
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
18
+ placeholder: BooleanConstructor;
16
19
  safeAreaInsetBottom: {
17
20
  type: BooleanConstructor;
18
21
  default: true;
19
22
  };
20
23
  }>>, {
24
+ placeholder: boolean;
21
25
  safeAreaInsetBottom: boolean;
22
26
  }>;
23
27
  export default _default;
@@ -25,9 +25,11 @@ var import_vue = require("vue");
25
25
  var import_vue2 = require("vue");
26
26
  var import_utils = require("../utils");
27
27
  var import_use = require("@vant/use");
28
+ var import_use_placeholder = require("../composables/use-placeholder");
28
29
  const [name, bem] = (0, import_utils.createNamespace)("action-bar");
29
30
  const ACTION_BAR_KEY = Symbol(name);
30
31
  const actionBarProps = {
32
+ placeholder: Boolean,
31
33
  safeAreaInsetBottom: import_utils.truthProp
32
34
  };
33
35
  var stdin_default = (0, import_vue2.defineComponent)({
@@ -36,17 +38,26 @@ var stdin_default = (0, import_vue2.defineComponent)({
36
38
  setup(props, {
37
39
  slots
38
40
  }) {
41
+ const root = (0, import_vue2.ref)();
42
+ const renderPlaceholder = (0, import_use_placeholder.usePlaceholder)(root, bem);
39
43
  const {
40
44
  linkChildren
41
45
  } = (0, import_use.useChildren)(ACTION_BAR_KEY);
42
46
  linkChildren();
43
- return () => {
47
+ const renderActionBar = () => {
44
48
  var _a;
45
49
  return (0, import_vue.createVNode)("div", {
50
+ "ref": root,
46
51
  "class": [bem(), {
47
52
  "van-safe-area-bottom": props.safeAreaInsetBottom
48
53
  }]
49
54
  }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
50
55
  };
56
+ return () => {
57
+ if (props.placeholder) {
58
+ return renderPlaceholder(renderActionBar);
59
+ }
60
+ return renderActionBar();
61
+ };
51
62
  }
52
63
  });
@@ -1,14 +1,17 @@
1
1
  export declare const ActionBar: import("../utils").WithInstall<import("vue").DefineComponent<{
2
+ placeholder: BooleanConstructor;
2
3
  safeAreaInsetBottom: {
3
4
  type: BooleanConstructor;
4
5
  default: true;
5
6
  };
6
7
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ placeholder: BooleanConstructor;
7
9
  safeAreaInsetBottom: {
8
10
  type: BooleanConstructor;
9
11
  default: true;
10
12
  };
11
13
  }>>, {
14
+ placeholder: boolean;
12
15
  safeAreaInsetBottom: boolean;
13
16
  }>>;
14
17
  export default ActionBar;
@@ -209,7 +209,7 @@ declare const _default: import("vue").DefineComponent<{
209
209
  type: BooleanConstructor;
210
210
  default: null;
211
211
  };
212
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
212
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
213
213
  icon: StringConstructor;
214
214
  size: PropType<import("../cell").CellSize>;
215
215
  title: (NumberConstructor | StringConstructor)[];
@@ -297,6 +297,8 @@ declare const _default: import("vue").DefineComponent<{
297
297
  onKeypress?: ((...args: any[]) => any) | undefined;
298
298
  onClear?: ((...args: any[]) => any) | undefined;
299
299
  "onClick-input"?: ((...args: any[]) => any) | undefined;
300
+ "onEnd-validate"?: ((...args: any[]) => any) | undefined;
301
+ "onStart-validate"?: ((...args: any[]) => any) | undefined;
300
302
  "onClick-left-icon"?: ((...args: any[]) => any) | undefined;
301
303
  "onClick-right-icon"?: ((...args: any[]) => any) | undefined;
302
304
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -81,7 +81,7 @@ const fieldProps = (0, import_utils.extend)({}, import_Cell.cellSharedProps, fie
81
81
  var stdin_default = (0, import_vue2.defineComponent)({
82
82
  name,
83
83
  props: fieldProps,
84
- emits: ["blur", "focus", "clear", "keypress", "click-input", "click-left-icon", "click-right-icon", "update:modelValue"],
84
+ emits: ["blur", "focus", "clear", "keypress", "click-input", "end-validate", "start-validate", "click-left-icon", "click-right-icon", "update:modelValue"],
85
85
  setup(props, {
86
86
  emit,
87
87
  slots
@@ -155,18 +155,24 @@ var stdin_default = (0, import_vue2.defineComponent)({
155
155
  state.status = "unvalidated";
156
156
  state.validateMessage = "";
157
157
  };
158
+ const endValidate = () => emit("end-validate", {
159
+ status: state.status
160
+ });
158
161
  const validate = (rules = props.rules) => new Promise((resolve) => {
159
162
  resetValidation();
160
163
  if (rules) {
164
+ emit("start-validate");
161
165
  runRules(rules).then(() => {
162
166
  if (state.status === "failed") {
163
167
  resolve({
164
168
  name: props.name,
165
169
  message: state.validateMessage
166
170
  });
171
+ endValidate();
167
172
  } else {
168
173
  state.status = "passed";
169
174
  resolve();
175
+ endValidate();
170
176
  }
171
177
  });
172
178
  } else {
@@ -81,7 +81,7 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
81
81
  type: BooleanConstructor;
82
82
  default: null;
83
83
  };
84
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
84
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue")[], "clear" | "focus" | "blur" | "keypress" | "click-input" | "end-validate" | "start-validate" | "click-left-icon" | "click-right-icon" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
85
85
  icon: StringConstructor;
86
86
  size: import("vue").PropType<import("..").CellSize>;
87
87
  title: (NumberConstructor | StringConstructor)[];
@@ -169,6 +169,8 @@ export declare const Field: import("../utils").WithInstall<import("vue").DefineC
169
169
  onKeypress?: ((...args: any[]) => any) | undefined;
170
170
  onClear?: ((...args: any[]) => any) | undefined;
171
171
  "onClick-input"?: ((...args: any[]) => any) | undefined;
172
+ "onEnd-validate"?: ((...args: any[]) => any) | undefined;
173
+ "onStart-validate"?: ((...args: any[]) => any) | undefined;
172
174
  "onClick-left-icon"?: ((...args: any[]) => any) | undefined;
173
175
  "onClick-right-icon"?: ((...args: any[]) => any) | undefined;
174
176
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
package/lib/index.d.ts CHANGED
@@ -90,4 +90,4 @@ declare namespace _default {
90
90
  }
91
91
  export default _default;
92
92
  export function install(app: any): void;
93
- export const version: "3.5.1";
93
+ export const version: "3.5.2";
package/lib/index.js CHANGED
@@ -194,7 +194,7 @@ __reExport(stdin_exports, require("./tag"), module.exports);
194
194
  __reExport(stdin_exports, require("./toast"), module.exports);
195
195
  __reExport(stdin_exports, require("./tree-select"), module.exports);
196
196
  __reExport(stdin_exports, require("./uploader"), module.exports);
197
- const version = "3.5.1";
197
+ const version = "3.5.2";
198
198
  function install(app) {
199
199
  const components = [
200
200
  import_action_bar.ActionBar,
@@ -20,6 +20,7 @@ declare const submitBarProps: {
20
20
  };
21
21
  buttonColor: StringConstructor;
22
22
  suffixLabel: StringConstructor;
23
+ placeholder: BooleanConstructor;
23
24
  decimalLength: {
24
25
  type: (NumberConstructor | StringConstructor)[];
25
26
  default: number;
@@ -49,6 +50,7 @@ declare const _default: import("vue").DefineComponent<{
49
50
  };
50
51
  buttonColor: StringConstructor;
51
52
  suffixLabel: StringConstructor;
53
+ placeholder: BooleanConstructor;
52
54
  decimalLength: {
53
55
  type: (NumberConstructor | StringConstructor)[];
54
56
  default: number;
@@ -76,6 +78,7 @@ declare const _default: import("vue").DefineComponent<{
76
78
  };
77
79
  buttonColor: StringConstructor;
78
80
  suffixLabel: StringConstructor;
81
+ placeholder: BooleanConstructor;
79
82
  decimalLength: {
80
83
  type: (NumberConstructor | StringConstructor)[];
81
84
  default: number;
@@ -88,6 +91,7 @@ declare const _default: import("vue").DefineComponent<{
88
91
  onSubmit?: ((...args: any[]) => any) | undefined;
89
92
  }, {
90
93
  disabled: boolean;
94
+ placeholder: boolean;
91
95
  safeAreaInsetBottom: boolean;
92
96
  loading: boolean;
93
97
  currency: string;
@@ -25,6 +25,7 @@ var import_vue2 = require("vue");
25
25
  var import_utils = require("../utils");
26
26
  var import_icon = require("../icon");
27
27
  var import_button = require("../button");
28
+ var import_use_placeholder = require("../composables/use-placeholder");
28
29
  const [name, bem, t] = (0, import_utils.createNamespace)("submit-bar");
29
30
  const submitBarProps = {
30
31
  tip: String,
@@ -39,6 +40,7 @@ const submitBarProps = {
39
40
  buttonType: (0, import_utils.makeStringProp)("danger"),
40
41
  buttonColor: String,
41
42
  suffixLabel: String,
43
+ placeholder: Boolean,
42
44
  decimalLength: (0, import_utils.makeNumericProp)(2),
43
45
  safeAreaInsetBottom: import_utils.truthProp
44
46
  };
@@ -50,6 +52,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
50
52
  emit,
51
53
  slots
52
54
  }) {
55
+ const root = (0, import_vue2.ref)();
56
+ const renderPlaceholder = (0, import_use_placeholder.usePlaceholder)(root, bem);
53
57
  const renderText = () => {
54
58
  const {
55
59
  price,
@@ -109,9 +113,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
109
113
  "onClick": onClickButton
110
114
  }, null);
111
115
  };
112
- return () => {
116
+ const renderSubmitBar = () => {
113
117
  var _a, _b;
114
118
  return (0, import_vue.createVNode)("div", {
119
+ "ref": root,
115
120
  "class": [bem(), {
116
121
  "van-safe-area-bottom": props.safeAreaInsetBottom
117
122
  }]
@@ -119,5 +124,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
119
124
  "class": bem("bar")
120
125
  }, [(_b = slots.default) == null ? void 0 : _b.call(slots), renderText(), renderButton()])]);
121
126
  };
127
+ return () => {
128
+ if (props.placeholder) {
129
+ return renderPlaceholder(renderSubmitBar);
130
+ }
131
+ return renderSubmitBar();
132
+ };
122
133
  }
123
134
  });
@@ -17,6 +17,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
17
17
  };
18
18
  buttonColor: StringConstructor;
19
19
  suffixLabel: StringConstructor;
20
+ placeholder: BooleanConstructor;
20
21
  decimalLength: {
21
22
  type: (NumberConstructor | StringConstructor)[];
22
23
  default: number;
@@ -44,6 +45,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
44
45
  };
45
46
  buttonColor: StringConstructor;
46
47
  suffixLabel: StringConstructor;
48
+ placeholder: BooleanConstructor;
47
49
  decimalLength: {
48
50
  type: (NumberConstructor | StringConstructor)[];
49
51
  default: number;
@@ -56,6 +58,7 @@ export declare const SubmitBar: import("../utils").WithInstall<import("vue").Def
56
58
  onSubmit?: ((...args: any[]) => any) | undefined;
57
59
  }, {
58
60
  disabled: boolean;
61
+ placeholder: boolean;
59
62
  safeAreaInsetBottom: boolean;
60
63
  loading: boolean;
61
64
  currency: string;