vant 4.3.1 → 4.4.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 (113) hide show
  1. package/es/address-edit/AddressEdit.mjs +1 -0
  2. package/es/area/Area.d.ts +6 -8
  3. package/es/area/Area.mjs +1 -1
  4. package/es/area/index.d.ts +4 -6
  5. package/es/back-top/BackTop.d.ts +1 -1
  6. package/es/back-top/BackTop.mjs +6 -3
  7. package/es/back-top/index.css +1 -1
  8. package/es/back-top/index.d.ts +1 -1
  9. package/es/barrage/Barrage.d.ts +93 -0
  10. package/es/barrage/Barrage.mjs +134 -0
  11. package/es/barrage/index.css +1 -0
  12. package/es/barrage/index.d.ts +69 -0
  13. package/es/barrage/index.mjs +10 -0
  14. package/es/barrage/style/index.d.ts +1 -0
  15. package/es/barrage/style/index.mjs +2 -0
  16. package/es/barrage/types.d.ts +7 -0
  17. package/es/barrage/types.mjs +0 -0
  18. package/es/cascader/Cascader.mjs +14 -0
  19. package/es/checkbox/Checker.d.ts +2 -0
  20. package/es/checkbox/Checker.mjs +13 -1
  21. package/es/contact-list/ContactList.mjs +1 -1
  22. package/es/contact-list/index.css +1 -1
  23. package/es/date-picker/DatePicker.mjs +5 -2
  24. package/es/date-picker/utils.d.ts +1 -1
  25. package/es/dialog/index.css +1 -1
  26. package/es/divider/Divider.d.ts +4 -0
  27. package/es/divider/Divider.mjs +4 -2
  28. package/es/divider/index.css +1 -1
  29. package/es/divider/index.d.ts +3 -0
  30. package/es/field/Field.mjs +4 -0
  31. package/es/image-preview/ImagePreviewItem.mjs +60 -26
  32. package/es/index.d.ts +2 -1
  33. package/es/index.mjs +4 -1
  34. package/es/notice-bar/NoticeBar.d.ts +1 -1
  35. package/es/notice-bar/index.d.ts +1 -1
  36. package/es/picker-group/PickerGroup.d.ts +15 -1
  37. package/es/picker-group/PickerGroup.mjs +8 -6
  38. package/es/picker-group/index.d.ts +11 -1
  39. package/es/signature/Signature.d.ts +13 -0
  40. package/es/signature/Signature.mjs +24 -8
  41. package/es/signature/index.css +1 -1
  42. package/es/signature/index.d.ts +9 -0
  43. package/es/step/index.css +1 -1
  44. package/es/submit-bar/index.css +1 -1
  45. package/es/tabs/Tabs.mjs +8 -2
  46. package/es/tabs/utils.d.ts +2 -2
  47. package/es/tabs/utils.mjs +14 -4
  48. package/es/uploader/Uploader.d.ts +6 -1
  49. package/es/uploader/Uploader.mjs +25 -10
  50. package/es/uploader/UploaderPreviewItem.d.ts +5 -1
  51. package/es/uploader/UploaderPreviewItem.mjs +6 -3
  52. package/es/uploader/index.d.ts +5 -1
  53. package/es/uploader/types.d.ts +1 -0
  54. package/lib/address-edit/AddressEdit.js +1 -0
  55. package/lib/area/Area.d.ts +6 -8
  56. package/lib/area/Area.js +1 -1
  57. package/lib/area/index.d.ts +4 -6
  58. package/lib/back-top/BackTop.d.ts +1 -1
  59. package/lib/back-top/BackTop.js +6 -3
  60. package/lib/back-top/index.css +1 -1
  61. package/lib/back-top/index.d.ts +1 -1
  62. package/lib/barrage/Barrage.d.ts +93 -0
  63. package/lib/barrage/Barrage.js +153 -0
  64. package/lib/barrage/index.css +1 -0
  65. package/lib/barrage/index.d.ts +69 -0
  66. package/lib/barrage/index.js +39 -0
  67. package/lib/barrage/style/index.d.ts +1 -0
  68. package/lib/barrage/style/index.js +2 -0
  69. package/lib/barrage/types.d.ts +7 -0
  70. package/lib/barrage/types.js +15 -0
  71. package/lib/cascader/Cascader.js +14 -0
  72. package/lib/checkbox/Checker.d.ts +2 -0
  73. package/lib/checkbox/Checker.js +13 -1
  74. package/lib/contact-list/ContactList.js +1 -1
  75. package/lib/contact-list/index.css +1 -1
  76. package/lib/date-picker/DatePicker.js +5 -2
  77. package/lib/date-picker/utils.d.ts +1 -1
  78. package/lib/dialog/index.css +1 -1
  79. package/lib/divider/Divider.d.ts +4 -0
  80. package/lib/divider/Divider.js +4 -2
  81. package/lib/divider/index.css +1 -1
  82. package/lib/divider/index.d.ts +3 -0
  83. package/lib/field/Field.js +4 -0
  84. package/lib/image-preview/ImagePreviewItem.js +59 -25
  85. package/lib/index.css +1 -1
  86. package/lib/index.d.ts +2 -1
  87. package/lib/index.js +4 -1
  88. package/lib/notice-bar/NoticeBar.d.ts +1 -1
  89. package/lib/notice-bar/index.d.ts +1 -1
  90. package/lib/picker-group/PickerGroup.d.ts +15 -1
  91. package/lib/picker-group/PickerGroup.js +6 -4
  92. package/lib/picker-group/index.d.ts +11 -1
  93. package/lib/signature/Signature.d.ts +13 -0
  94. package/lib/signature/Signature.js +23 -7
  95. package/lib/signature/index.css +1 -1
  96. package/lib/signature/index.d.ts +9 -0
  97. package/lib/step/index.css +1 -1
  98. package/lib/submit-bar/index.css +1 -1
  99. package/lib/tabs/Tabs.js +8 -2
  100. package/lib/tabs/utils.d.ts +2 -2
  101. package/lib/tabs/utils.js +13 -3
  102. package/lib/uploader/Uploader.d.ts +6 -1
  103. package/lib/uploader/Uploader.js +25 -10
  104. package/lib/uploader/UploaderPreviewItem.d.ts +5 -1
  105. package/lib/uploader/UploaderPreviewItem.js +6 -3
  106. package/lib/uploader/index.d.ts +5 -1
  107. package/lib/uploader/types.d.ts +1 -0
  108. package/lib/vant.cjs.js +611 -358
  109. package/lib/vant.es.js +612 -359
  110. package/lib/vant.js +611 -358
  111. package/lib/vant.min.js +1 -1
  112. package/lib/web-types.json +1 -1
  113. package/package.json +1 -1
@@ -163,6 +163,7 @@ var stdin_default = defineComponent({
163
163
  };
164
164
  return _withDirectives(_createVNode(Cell, {
165
165
  "center": true,
166
+ "border": false,
166
167
  "title": t("defaultAddress"),
167
168
  "class": bem("default")
168
169
  }, slots2), [[_vShow, !hideBottomFields.value]]);
package/es/area/Area.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type PropType, type ExtractPropTypes } from 'vue';
2
2
  import type { AreaList } from './types';
3
- export declare const areaProps: {
3
+ export declare const areaProps: import("../utils").Writeable<Pick<{
4
4
  loading: BooleanConstructor;
5
5
  readonly: BooleanConstructor;
6
6
  allowHtml: BooleanConstructor;
@@ -24,7 +24,7 @@ export declare const areaProps: {
24
24
  title: StringConstructor;
25
25
  cancelButtonText: StringConstructor;
26
26
  confirmButtonText: StringConstructor;
27
- } & {
27
+ }, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
28
28
  modelValue: StringConstructor;
29
29
  columnsNum: {
30
30
  type: (NumberConstructor | StringConstructor)[];
@@ -40,7 +40,7 @@ export declare const areaProps: {
40
40
  };
41
41
  };
42
42
  export type AreaProps = ExtractPropTypes<typeof areaProps>;
43
- declare const _default: import("vue").DefineComponent<{
43
+ declare const _default: import("vue").DefineComponent<import("../utils").Writeable<Pick<{
44
44
  loading: BooleanConstructor;
45
45
  readonly: BooleanConstructor;
46
46
  allowHtml: BooleanConstructor;
@@ -64,7 +64,7 @@ declare const _default: import("vue").DefineComponent<{
64
64
  title: StringConstructor;
65
65
  cancelButtonText: StringConstructor;
66
66
  confirmButtonText: StringConstructor;
67
- } & {
67
+ }, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
68
68
  modelValue: StringConstructor;
69
69
  columnsNum: {
70
70
  type: (NumberConstructor | StringConstructor)[];
@@ -78,7 +78,7 @@ declare const _default: import("vue").DefineComponent<{
78
78
  type: PropType<AreaList>;
79
79
  default: () => {};
80
80
  };
81
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
81
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<import("../utils").Writeable<Pick<{
82
82
  loading: BooleanConstructor;
83
83
  readonly: BooleanConstructor;
84
84
  allowHtml: BooleanConstructor;
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
102
102
  title: StringConstructor;
103
103
  cancelButtonText: StringConstructor;
104
104
  confirmButtonText: StringConstructor;
105
- } & {
105
+ }, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
106
106
  modelValue: StringConstructor;
107
107
  columnsNum: {
108
108
  type: (NumberConstructor | StringConstructor)[];
@@ -124,9 +124,7 @@ declare const _default: import("vue").DefineComponent<{
124
124
  }, {
125
125
  readonly: boolean;
126
126
  loading: boolean;
127
- allowHtml: boolean;
128
127
  optionHeight: string | number;
129
- showToolbar: boolean;
130
128
  swipeDuration: string | number;
131
129
  visibleOptionNum: string | number;
132
130
  columnsNum: string | number;
package/es/area/Area.mjs CHANGED
@@ -6,7 +6,7 @@ import { INHERIT_PROPS, INHERIT_SLOTS, formatDataForCascade } from "./utils.mjs"
6
6
  import { useExpose } from "../composables/use-expose.mjs";
7
7
  import { Picker } from "../picker/index.mjs";
8
8
  const [name, bem] = createNamespace("area");
9
- const areaProps = extend({}, pickerSharedProps, {
9
+ const areaProps = extend({}, pick(pickerSharedProps, INHERIT_PROPS), {
10
10
  modelValue: String,
11
11
  columnsNum: makeNumericProp(3),
12
12
  columnsPlaceholder: makeArrayProp(),
@@ -1,4 +1,4 @@
1
- export declare const Area: import("../utils").WithInstall<import("vue").DefineComponent<{
1
+ export declare const Area: import("../utils").WithInstall<import("vue").DefineComponent<import("../utils").Writeable<Pick<{
2
2
  loading: BooleanConstructor;
3
3
  readonly: BooleanConstructor;
4
4
  allowHtml: BooleanConstructor;
@@ -22,7 +22,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
22
22
  title: StringConstructor;
23
23
  cancelButtonText: StringConstructor;
24
24
  confirmButtonText: StringConstructor;
25
- } & {
25
+ }, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
26
26
  modelValue: StringConstructor;
27
27
  columnsNum: {
28
28
  type: (NumberConstructor | StringConstructor)[];
@@ -36,7 +36,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
36
36
  type: import("vue").PropType<import("./types").AreaList>;
37
37
  default: () => {};
38
38
  };
39
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "cancel" | "change" | "confirm")[], "update:modelValue" | "cancel" | "change" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<import("../utils").Writeable<Pick<{
40
40
  loading: BooleanConstructor;
41
41
  readonly: BooleanConstructor;
42
42
  allowHtml: BooleanConstructor;
@@ -60,7 +60,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
60
60
  title: StringConstructor;
61
61
  cancelButtonText: StringConstructor;
62
62
  confirmButtonText: StringConstructor;
63
- } & {
63
+ }, "title" | "readonly" | "loading" | "optionHeight" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText">> & {
64
64
  modelValue: StringConstructor;
65
65
  columnsNum: {
66
66
  type: (NumberConstructor | StringConstructor)[];
@@ -82,9 +82,7 @@ export declare const Area: import("../utils").WithInstall<import("vue").DefineCo
82
82
  }, {
83
83
  readonly: boolean;
84
84
  loading: boolean;
85
- allowHtml: boolean;
86
85
  optionHeight: string | number;
87
- showToolbar: boolean;
88
86
  swipeDuration: string | number;
89
87
  visibleOptionNum: string | number;
90
88
  columnsNum: string | number;
@@ -29,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
29
29
  type: PropType<string | import("vue").RendererElement | null | undefined>;
30
30
  default: string;
31
31
  };
32
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
32
+ }, () => JSX.Element | JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
33
33
  right: (NumberConstructor | StringConstructor)[];
34
34
  bottom: (NumberConstructor | StringConstructor)[];
35
35
  zIndex: (NumberConstructor | StringConstructor)[];
@@ -76,7 +76,7 @@ var stdin_default = defineComponent({
76
76
  watch(() => props.target, updateTarget);
77
77
  return () => {
78
78
  const Content = _createVNode("div", _mergeProps({
79
- "ref": root,
79
+ "ref": !props.teleport ? root : void 0,
80
80
  "class": bem({
81
81
  active: show.value
82
82
  }),
@@ -87,11 +87,14 @@ var stdin_default = defineComponent({
87
87
  "class": bem("icon")
88
88
  }, null)]);
89
89
  if (props.teleport) {
90
- return _createVNode(Teleport, {
90
+ return [_createVNode("div", {
91
+ "ref": root,
92
+ "class": bem("placeholder")
93
+ }, null), _createVNode(Teleport, {
91
94
  "to": props.teleport
92
95
  }, {
93
96
  default: () => [Content]
94
- });
97
+ })];
95
98
  }
96
99
  return Content;
97
100
  };
@@ -1 +1 @@
1
- :root{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
1
+ :root{--van-back-top-size: 40px;--van-back-top-right: 30px;--van-back-top-bottom: 40px;--van-back-top-z-index: 100;--van-back-top-icon-size: 20px;--van-back-top-text-color: #fff;--van-back-top-background: var(--van-blue)}.van-back-top{position:fixed;display:flex;align-items:center;justify-content:center;width:var(--van-back-top-size);height:var(--van-back-top-size);right:var(--van-back-top-right);bottom:var(--van-back-top-bottom);z-index:var(--van-back-top-z-index);cursor:pointer;color:var(--van-back-top-text-color);border-radius:var(--van-radius-max);box-shadow:0 2px 8px rgba(0,0,0,.12);transform:scale(0);transition:var(--van-duration-base) cubic-bezier(.25,.8,.5,1);background-color:var(--van-back-top-background)}.van-back-top:active{opacity:var(--van-active-opacity)}.van-back-top__placeholder{display:none}.van-back-top--active{transform:scale(1)}.van-back-top__icon{font-size:var(--van-back-top-icon-size);font-weight:var(--van-font-bold)}
@@ -12,7 +12,7 @@ export declare const BackTop: import("../utils").WithInstall<import("vue").Defin
12
12
  type: import("vue").PropType<string | import("vue").RendererElement | null | undefined>;
13
13
  default: string;
14
14
  };
15
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ }, () => JSX.Element | JSX.Element[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
16
16
  right: (NumberConstructor | StringConstructor)[];
17
17
  bottom: (NumberConstructor | StringConstructor)[];
18
18
  zIndex: (NumberConstructor | StringConstructor)[];
@@ -0,0 +1,93 @@
1
+ import { type ExtractPropTypes } from 'vue';
2
+ export interface BarrageItem {
3
+ id: string | number;
4
+ text: string | number;
5
+ }
6
+ export declare const barrageProps: {
7
+ top: {
8
+ type: (NumberConstructor | StringConstructor)[];
9
+ default: number;
10
+ };
11
+ rows: {
12
+ type: (NumberConstructor | StringConstructor)[];
13
+ default: number;
14
+ };
15
+ duration: {
16
+ type: (NumberConstructor | StringConstructor)[];
17
+ default: number;
18
+ };
19
+ autoPlay: {
20
+ type: BooleanConstructor;
21
+ default: true;
22
+ };
23
+ delay: {
24
+ type: NumberConstructor;
25
+ default: number;
26
+ };
27
+ modelValue: {
28
+ type: import("vue").PropType<BarrageItem[]>;
29
+ default: () => never[];
30
+ };
31
+ };
32
+ export type BarrageProps = ExtractPropTypes<typeof barrageProps>;
33
+ declare const _default: import("vue").DefineComponent<{
34
+ top: {
35
+ type: (NumberConstructor | StringConstructor)[];
36
+ default: number;
37
+ };
38
+ rows: {
39
+ type: (NumberConstructor | StringConstructor)[];
40
+ default: number;
41
+ };
42
+ duration: {
43
+ type: (NumberConstructor | StringConstructor)[];
44
+ default: number;
45
+ };
46
+ autoPlay: {
47
+ type: BooleanConstructor;
48
+ default: true;
49
+ };
50
+ delay: {
51
+ type: NumberConstructor;
52
+ default: number;
53
+ };
54
+ modelValue: {
55
+ type: import("vue").PropType<BarrageItem[]>;
56
+ default: () => never[];
57
+ };
58
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
59
+ top: {
60
+ type: (NumberConstructor | StringConstructor)[];
61
+ default: number;
62
+ };
63
+ rows: {
64
+ type: (NumberConstructor | StringConstructor)[];
65
+ default: number;
66
+ };
67
+ duration: {
68
+ type: (NumberConstructor | StringConstructor)[];
69
+ default: number;
70
+ };
71
+ autoPlay: {
72
+ type: BooleanConstructor;
73
+ default: true;
74
+ };
75
+ delay: {
76
+ type: NumberConstructor;
77
+ default: number;
78
+ };
79
+ modelValue: {
80
+ type: import("vue").PropType<BarrageItem[]>;
81
+ default: () => never[];
82
+ };
83
+ }>> & {
84
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
85
+ }, {
86
+ top: string | number;
87
+ modelValue: BarrageItem[];
88
+ rows: string | number;
89
+ duration: string | number;
90
+ autoPlay: boolean;
91
+ delay: number;
92
+ }>;
93
+ export default _default;
@@ -0,0 +1,134 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { createVNode as _createVNode } from "vue";
22
+ import { defineComponent, onMounted, ref, nextTick, watch } from "vue";
23
+ import { useExpose } from "../composables/use-expose.mjs";
24
+ import { createNamespace, makeArrayProp, makeNumberProp, makeNumericProp, truthProp } from "../utils/index.mjs";
25
+ const barrageProps = {
26
+ top: makeNumericProp(10),
27
+ rows: makeNumericProp(4),
28
+ duration: makeNumericProp(4e3),
29
+ autoPlay: truthProp,
30
+ delay: makeNumberProp(300),
31
+ modelValue: makeArrayProp()
32
+ };
33
+ const [name, bem] = createNamespace("barrage");
34
+ var stdin_default = defineComponent({
35
+ name,
36
+ props: barrageProps,
37
+ emits: ["update:modelValue"],
38
+ setup(props, {
39
+ emit,
40
+ slots
41
+ }) {
42
+ const barrageWrapper = ref();
43
+ const className = bem("item");
44
+ const total = ref(0);
45
+ const barrageItems = [];
46
+ const createBarrageItem = (text, delay = props.delay) => {
47
+ const item = document.createElement("span");
48
+ item.className = className;
49
+ item.innerText = String(text);
50
+ item.style.animationDuration = `${props.duration}ms`;
51
+ item.style.animationDelay = `${delay}ms`;
52
+ item.style.animationName = "van-barrage";
53
+ item.style.animationTimingFunction = "linear";
54
+ return item;
55
+ };
56
+ const isInitBarrage = ref(true);
57
+ const isPlay = ref(props.autoPlay);
58
+ const appendBarrageItem = ({
59
+ id,
60
+ text
61
+ }, i) => {
62
+ var _a;
63
+ const item = createBarrageItem(text, isInitBarrage.value ? i * props.delay : void 0);
64
+ if (!props.autoPlay && isPlay.value === false) {
65
+ item.style.animationPlayState = "paused";
66
+ }
67
+ (_a = barrageWrapper.value) == null ? void 0 : _a.append(item);
68
+ total.value++;
69
+ const top = (total.value - 1) % +props.rows * item.offsetHeight + +props.top;
70
+ item.style.top = `${top}px`;
71
+ item.dataset.id = String(id);
72
+ barrageItems.push(item);
73
+ item.addEventListener("animationend", () => {
74
+ emit("update:modelValue", [...props.modelValue].filter((v) => String(v.id) !== item.dataset.id));
75
+ });
76
+ };
77
+ const updateBarrages = (newValue, oldValue) => {
78
+ const map = new Map(oldValue.map((item) => [item.id, item]));
79
+ newValue.forEach((item, i) => {
80
+ if (map.has(item.id)) {
81
+ map.delete(item.id);
82
+ } else {
83
+ appendBarrageItem(item, i);
84
+ }
85
+ });
86
+ map.forEach((item) => {
87
+ const index = barrageItems.findIndex((span) => span.dataset.id === String(item.id));
88
+ if (index > -1) {
89
+ barrageItems[index].remove();
90
+ barrageItems.splice(index, 1);
91
+ }
92
+ });
93
+ isInitBarrage.value = false;
94
+ };
95
+ watch(() => props.modelValue.slice(), (newValue, oldValue) => updateBarrages(newValue != null ? newValue : [], oldValue != null ? oldValue : []), {
96
+ deep: true
97
+ });
98
+ const rootStyle = ref({});
99
+ onMounted(() => __async(this, null, function* () {
100
+ var _a;
101
+ rootStyle.value["--move-distance"] = `-${(_a = barrageWrapper.value) == null ? void 0 : _a.offsetWidth}px`;
102
+ yield nextTick();
103
+ updateBarrages(props.modelValue, []);
104
+ }));
105
+ const play = () => {
106
+ isPlay.value = true;
107
+ barrageItems.forEach((item) => {
108
+ item.style.animationPlayState = "running";
109
+ });
110
+ };
111
+ const pause = () => {
112
+ isPlay.value = false;
113
+ barrageItems.forEach((item) => {
114
+ item.style.animationPlayState = "paused";
115
+ });
116
+ };
117
+ useExpose({
118
+ play,
119
+ pause
120
+ });
121
+ return () => {
122
+ var _a;
123
+ return _createVNode("div", {
124
+ "class": bem(),
125
+ "ref": barrageWrapper,
126
+ "style": rootStyle.value
127
+ }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
128
+ };
129
+ }
130
+ });
131
+ export {
132
+ barrageProps,
133
+ stdin_default as default
134
+ };
@@ -0,0 +1 @@
1
+ :root{--van-barrage-font-size: 16px;--van-barrage-space: 10px;--van-barrage-font: inherit;--van-barrage-color: var(--van-white)}.van-barrage{position:relative;overflow:hidden}.van-barrage__item{position:absolute;top:0;right:0;z-index:99;padding-bottom:var(--van-barrage-space);opacity:.75;line-height:1;font-size:var(--van-barrage-font-size);font-family:var(--van-barrage-font);font-weight:700;white-space:nowrap;color:var(--van-barrage-color);text-shadow:1px 0 1px #000000,0 1px 1px #000000,0 -1px 1px #000000,-1px 0 1px #000000;-webkit-user-select:none;user-select:none;will-change:transform;transform:translate(110%)}@keyframes van-barrage{0%{transform:translate(110%)}to{transform:translate(var(--move-distance))}}
@@ -0,0 +1,69 @@
1
+ export declare const Barrage: import("../utils").WithInstall<import("vue").DefineComponent<{
2
+ top: {
3
+ type: (NumberConstructor | StringConstructor)[];
4
+ default: number;
5
+ };
6
+ rows: {
7
+ type: (NumberConstructor | StringConstructor)[];
8
+ default: number;
9
+ };
10
+ duration: {
11
+ type: (NumberConstructor | StringConstructor)[];
12
+ default: number;
13
+ };
14
+ autoPlay: {
15
+ type: BooleanConstructor;
16
+ default: true;
17
+ };
18
+ delay: {
19
+ type: NumberConstructor;
20
+ default: number;
21
+ };
22
+ modelValue: {
23
+ type: import("vue").PropType<import("./Barrage").BarrageItem[]>;
24
+ default: () => never[];
25
+ };
26
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
+ top: {
28
+ type: (NumberConstructor | StringConstructor)[];
29
+ default: number;
30
+ };
31
+ rows: {
32
+ type: (NumberConstructor | StringConstructor)[];
33
+ default: number;
34
+ };
35
+ duration: {
36
+ type: (NumberConstructor | StringConstructor)[];
37
+ default: number;
38
+ };
39
+ autoPlay: {
40
+ type: BooleanConstructor;
41
+ default: true;
42
+ };
43
+ delay: {
44
+ type: NumberConstructor;
45
+ default: number;
46
+ };
47
+ modelValue: {
48
+ type: import("vue").PropType<import("./Barrage").BarrageItem[]>;
49
+ default: () => never[];
50
+ };
51
+ }>> & {
52
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
53
+ }, {
54
+ top: string | number;
55
+ modelValue: import("./Barrage").BarrageItem[];
56
+ rows: string | number;
57
+ duration: string | number;
58
+ autoPlay: boolean;
59
+ delay: number;
60
+ }>>;
61
+ export default Barrage;
62
+ export { barrageProps } from './Barrage';
63
+ export type { BarrageProps, BarrageItem } from './Barrage';
64
+ export type { BarrageInstance } from './types';
65
+ declare module 'vue' {
66
+ interface GlobalComponents {
67
+ VanBarrage: typeof Barrage;
68
+ }
69
+ }
@@ -0,0 +1,10 @@
1
+ import { withInstall } from "../utils/index.mjs";
2
+ import _Barrage from "./Barrage.mjs";
3
+ const Barrage = withInstall(_Barrage);
4
+ var stdin_default = Barrage;
5
+ import { barrageProps } from "./Barrage.mjs";
6
+ export {
7
+ Barrage,
8
+ barrageProps,
9
+ stdin_default as default
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import "../../style/base.css";
2
+ import "../index.css";
@@ -0,0 +1,7 @@
1
+ import { ComponentPublicInstance } from 'vue';
2
+ import { BarrageProps } from './Barrage';
3
+ export type BarrageExpose = {
4
+ play(): void;
5
+ pause(): void;
6
+ };
7
+ export type BarrageInstance = ComponentPublicInstance<BarrageProps, BarrageExpose>;
File without changes
@@ -1,6 +1,7 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import { ref, watch, nextTick, defineComponent } from "vue";
3
3
  import { extend, truthProp, numericProp, makeArrayProp, makeStringProp, createNamespace, HAPTICS_FEEDBACK } from "../utils/index.mjs";
4
+ import { useRefs } from "../composables/use-refs.mjs";
4
5
  import { Tab } from "../tab/index.mjs";
5
6
  import { Tabs } from "../tabs/index.mjs";
6
7
  import { Icon } from "../icon/index.mjs";
@@ -27,6 +28,7 @@ var stdin_default = defineComponent({
27
28
  }) {
28
29
  const tabs = ref([]);
29
30
  const activeTab = ref(0);
31
+ const [selectedElementRefs, setSelectedElementRefs] = useRefs();
30
32
  const {
31
33
  text: textKey,
32
34
  value: valueKey,
@@ -145,6 +147,7 @@ var stdin_default = defineComponent({
145
147
  selected
146
148
  }) : _createVNode("span", null, [option[textKey]]);
147
149
  return _createVNode("li", {
150
+ "ref": selected ? setSelectedElementRefs(tabIndex) : void 0,
148
151
  "role": "menuitemradio",
149
152
  "class": [bem("option", {
150
153
  selected,
@@ -201,7 +204,18 @@ var stdin_default = defineComponent({
201
204
  }, {
202
205
  default: () => [tabs.value.map(renderTab)]
203
206
  });
207
+ const scrollIntoView = (el) => {
208
+ const scrollParent = el.parentElement;
209
+ if (scrollParent) {
210
+ scrollParent.scrollTop = el.offsetTop - (scrollParent.offsetHeight - el.offsetHeight) / 2;
211
+ }
212
+ };
204
213
  updateTabs();
214
+ watch(activeTab, (value) => {
215
+ const el = selectedElementRefs.value[value];
216
+ if (el)
217
+ scrollIntoView(el);
218
+ });
205
219
  watch(() => props.options, updateTabs, {
206
220
  deep: true
207
221
  });
@@ -9,6 +9,8 @@ export type CheckerParent = {
9
9
  iconSize?: Numeric;
10
10
  direction?: CheckerDirection;
11
11
  checkedColor?: string;
12
+ modelValue?: unknown | unknown[];
13
+ max?: Numeric;
12
14
  };
13
15
  };
14
16
  export declare const checkerProps: {
@@ -31,7 +31,19 @@ var stdin_default = defineComponent({
31
31
  return props.parent.props[name];
32
32
  }
33
33
  };
34
- const disabled = computed(() => getParentProp("disabled") || props.disabled);
34
+ const disabled = computed(() => {
35
+ if (props.parent && props.bindGroup) {
36
+ const disabled2 = getParentProp("disabled") || props.disabled;
37
+ if (props.role === "checkbox") {
38
+ const checkedCount = getParentProp("modelValue").length;
39
+ const max = getParentProp("max");
40
+ const overlimit = max && checkedCount >= +max;
41
+ return disabled2 || overlimit && !props.checked;
42
+ }
43
+ return disabled2;
44
+ }
45
+ return props.disabled;
46
+ });
35
47
  const direction = computed(() => getParentProp("direction"));
36
48
  const iconStyle = computed(() => {
37
49
  const checkedColor = props.checkedColor || getParentProp("checkedColor");
@@ -29,7 +29,7 @@ var stdin_default = defineComponent({
29
29
  const renderRightIcon = () => _createVNode(Radio, {
30
30
  "class": bem("radio"),
31
31
  "name": item.id,
32
- "iconSize": 16
32
+ "iconSize": 18
33
33
  }, null);
34
34
  const renderEditIcon = () => _createVNode(Icon, {
35
35
  "name": "edit",
@@ -1 +1 @@
1
- :root{--van-contact-list-edit-icon-size: 16px;--van-contact-list-add-button-z-index: 999;--van-contact-list-radio-color: var(--van-primary-color);--van-contact-list-item-padding: var(--van-padding-md)}.van-contact-list{box-sizing:border-box;height:100%;padding-bottom:80px}.van-contact-list__item{padding:var(--van-contact-list-item-padding)}.van-contact-list__item-title{display:flex;align-items:center;padding-right:var(--van-padding-xl);padding-left:var(--van-padding-xs)}.van-contact-list__item-tag{flex:none;margin-left:var(--van-padding-xs);padding-top:0;padding-bottom:0;line-height:1.4em}.van-contact-list__group{box-sizing:border-box;height:100%;overflow-y:scroll;-webkit-overflow-scrolling:touch}.van-contact-list__edit{font-size:var(--van-contact-list-edit-icon-size)}.van-contact-list__radio .van-radio__icon--checked .van-icon{background-color:var(--van-contact-list-radio-color);border-color:var(--van-contact-list-radio-color)}.van-contact-list__bottom{position:fixed;right:0;bottom:0;left:0;z-index:var(--van-contact-list-add-button-z-index);padding-left:var(--van-padding-md);padding-right:var(--van-padding-md);background-color:var(--van-background-2)}.van-contact-list__add{height:40px;margin:5px 0}
1
+ :root{--van-contact-list-padding: var(--van-padding-sm) var(--van-padding-sm) 80px;--van-contact-list-edit-icon-size: 16px;--van-contact-list-add-button-z-index: 999;--van-contact-list-radio-color: var(--van-primary-color);--van-contact-list-item-padding: var(--van-padding-md)}.van-contact-list{box-sizing:border-box;height:100%;padding:var(--van-contact-list-padding)}.van-contact-list__item{padding:var(--van-contact-list-item-padding)}.van-contact-list__item-title{display:flex;align-items:center;padding-right:var(--van-padding-xl);padding-left:var(--van-padding-xs)}.van-contact-list__item-tag{flex:none;margin-left:var(--van-padding-xs);padding-top:0;padding-bottom:0;line-height:1.4em}.van-contact-list__group{box-sizing:border-box;height:100%;overflow-y:scroll;-webkit-overflow-scrolling:touch;border-radius:var(--van-radius-lg)}.van-contact-list__edit{font-size:var(--van-contact-list-edit-icon-size)}.van-contact-list__radio .van-radio__icon--checked .van-icon{background-color:var(--van-contact-list-radio-color);border-color:var(--van-contact-list-radio-color)}.van-contact-list__bottom{position:fixed;right:0;bottom:0;left:0;z-index:var(--van-contact-list-add-button-z-index);padding-left:var(--van-padding-md);padding-right:var(--van-padding-md);background-color:var(--van-background-2)}.van-contact-list__add{height:40px;margin:5px 0}
@@ -30,6 +30,7 @@ var stdin_default = defineComponent({
30
30
  slots
31
31
  }) {
32
32
  const currentValues = ref(props.modelValue);
33
+ const updatedByExternalSources = ref(false);
33
34
  const genYearOptions = () => {
34
35
  const minYear = props.minDate.getFullYear();
35
36
  const maxYear = props.maxDate.getFullYear();
@@ -45,7 +46,7 @@ var stdin_default = defineComponent({
45
46
  columnsType
46
47
  } = props;
47
48
  const index = columnsType.indexOf(type);
48
- const value = currentValues.value[index];
49
+ const value = updatedByExternalSources.value ? props.modelValue[index] : currentValues.value[index];
49
50
  if (value) {
50
51
  return +value;
51
52
  }
@@ -91,11 +92,13 @@ var stdin_default = defineComponent({
91
92
  emit("update:modelValue", newValues);
92
93
  }
93
94
  });
94
- watch(() => props.modelValue, (newValues) => {
95
+ watch(() => props.modelValue, (newValues, oldValues) => {
96
+ updatedByExternalSources.value = isSameValue(oldValues, currentValues.value);
95
97
  newValues = formatValueRange(newValues, columns.value);
96
98
  if (!isSameValue(newValues, currentValues.value)) {
97
99
  currentValues.value = newValues;
98
100
  }
101
+ updatedByExternalSources.value = false;
99
102
  }, {
100
103
  immediate: true
101
104
  });
@@ -41,5 +41,5 @@ export declare const pickerInheritKeys: ("title" | "readonly" | "loading" | "all
41
41
  export declare function times<T>(n: number, iteratee: (index: number) => T): T[];
42
42
  export declare const getMonthEndDay: (year: number, month: number) => number;
43
43
  export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter?: Filter) => PickerOption[];
44
- export declare const formatValueRange: (values: string[], columns: PickerOption[]) => string[];
44
+ export declare const formatValueRange: (values: string[], columns: PickerOption[][]) => string[];
45
45
  export {};