persagy-vant 0.0.42 → 0.0.43

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 (46) hide show
  1. package/es/action-sheet/ActionSheet.d.ts +4 -0
  2. package/es/action-sheet/ActionSheet.mjs +4 -1
  3. package/es/action-sheet/index.css +1 -1
  4. package/es/action-sheet/index.d.ts +3 -0
  5. package/es/action-sheet/index.less +4 -0
  6. package/es/index.d.ts +1 -1
  7. package/es/index.mjs +1 -1
  8. package/es/locale/lang/en-US.d.ts +6 -0
  9. package/es/locale/lang/en-US.mjs +6 -0
  10. package/es/locale/lang/zh-CN.d.ts +6 -0
  11. package/es/locale/lang/zh-CN.mjs +6 -0
  12. package/es/uploader/Uploader.d.ts +6 -1
  13. package/es/uploader/Uploader.mjs +80 -19
  14. package/es/uploader/index.css +1 -1
  15. package/es/uploader/index.d.ts +6 -2
  16. package/es/uploader/index.less +4 -0
  17. package/es/uploader/style/index.mjs +3 -0
  18. package/es/uploader/style/less.mjs +3 -0
  19. package/es/uploader/types.d.ts +2 -1
  20. package/lib/action-sheet/ActionSheet.d.ts +4 -0
  21. package/lib/action-sheet/ActionSheet.js +4 -1
  22. package/lib/action-sheet/index.css +1 -1
  23. package/lib/action-sheet/index.d.ts +3 -0
  24. package/lib/action-sheet/index.less +4 -0
  25. package/lib/index.css +1 -1
  26. package/lib/index.d.ts +1 -1
  27. package/lib/index.js +1 -1
  28. package/lib/locale/lang/en-US.d.ts +6 -0
  29. package/lib/locale/lang/en-US.js +6 -0
  30. package/lib/locale/lang/zh-CN.d.ts +6 -0
  31. package/lib/locale/lang/zh-CN.js +6 -0
  32. package/lib/uploader/Uploader.d.ts +6 -1
  33. package/lib/uploader/Uploader.js +79 -18
  34. package/lib/uploader/index.css +1 -1
  35. package/lib/uploader/index.d.ts +6 -2
  36. package/lib/uploader/index.less +4 -0
  37. package/lib/uploader/style/index.js +3 -0
  38. package/lib/uploader/style/less.js +3 -0
  39. package/lib/uploader/types.d.ts +2 -1
  40. package/lib/vant.cjs.js +89 -20
  41. package/lib/vant.es.js +89 -20
  42. package/lib/vant.js +89 -20
  43. package/lib/vant.min.js +1 -1
  44. package/lib/web-types.json +1 -1
  45. package/package.json +1 -1
  46. package/skills/use-persagy-vant/references/component-catalog.md +1 -1
@@ -50,6 +50,7 @@ declare const actionSheetProps: {
50
50
  };
51
51
  cancelText: StringConstructor;
52
52
  description: StringConstructor;
53
+ contentAdaptive: BooleanConstructor;
53
54
  closeOnPopstate: {
54
55
  type: BooleanConstructor;
55
56
  default: true;
@@ -102,6 +103,7 @@ declare const _default: import("vue").DefineComponent<{
102
103
  };
103
104
  cancelText: StringConstructor;
104
105
  description: StringConstructor;
106
+ contentAdaptive: BooleanConstructor;
105
107
  closeOnPopstate: {
106
108
  type: BooleanConstructor;
107
109
  default: true;
@@ -152,6 +154,7 @@ declare const _default: import("vue").DefineComponent<{
152
154
  };
153
155
  cancelText: StringConstructor;
154
156
  description: StringConstructor;
157
+ contentAdaptive: BooleanConstructor;
155
158
  closeOnPopstate: {
156
159
  type: BooleanConstructor;
157
160
  default: true;
@@ -178,5 +181,6 @@ declare const _default: import("vue").DefineComponent<{
178
181
  closeOnPopstate: boolean;
179
182
  actions: ActionSheetAction[];
180
183
  closeOnClickAction: boolean;
184
+ contentAdaptive: boolean;
181
185
  }>;
182
186
  export default _default;
@@ -13,6 +13,7 @@ const actionSheetProps = extend({}, popupSharedProps, {
13
13
  closeable: truthProp,
14
14
  cancelText: String,
15
15
  description: String,
16
+ contentAdaptive: Boolean,
16
17
  closeOnPopstate: truthProp,
17
18
  closeOnClickAction: Boolean,
18
19
  safeAreaInsetBottom: truthProp
@@ -121,7 +122,9 @@ var stdin_default = defineComponent({
121
122
  }
122
123
  };
123
124
  return () => _createVNode(Popup, _mergeProps({
124
- "class": bem(),
125
+ "class": bem({
126
+ "content-adaptive": props.contentAdaptive
127
+ }),
125
128
  "position": "bottom",
126
129
  "onUpdate:show": updateShow
127
130
  }, pick(props, popupInheritKeys)), {
@@ -1 +1 @@
1
- :root{--van-action-sheet-max-height:calc(100% - 96px);--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-color-light);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background-color);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color);background:var(--van-gray-2)}.van-action-sheet__content{flex:1 auto;display:flex;flex-direction:column;gap:0;padding:0 var(--van-padding-md) var(--van-padding-md);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__action-card{overflow:hidden;background:var(--van-white);border-radius:8px}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:transparent;border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{position:relative;line-height:var(--van-action-sheet-item-line-height);text-align:left}.van-action-sheet__item--selected{font-weight:var(--van-font-weight-bold)}.van-action-sheet__item:not(:last-child):after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;background:transparent}.van-action-sheet__nav-left{display:flex;align-items:center;height:var(--van-nav-bar-height);padding:0 6px 0 var(--van-padding-md)}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}
1
+ :root{--van-action-sheet-max-height:calc(100% - 96px);--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-color-light);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background-color);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color);background:var(--van-gray-2)}.van-action-sheet--content-adaptive{height:auto}.van-action-sheet__content{flex:1 auto;display:flex;flex-direction:column;gap:0;padding:0 var(--van-padding-md) var(--van-padding-md);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__action-card{overflow:hidden;background:var(--van-white);border-radius:8px}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:transparent;border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{position:relative;line-height:var(--van-action-sheet-item-line-height);text-align:left}.van-action-sheet__item--selected{font-weight:var(--van-font-weight-bold)}.van-action-sheet__item:not(:last-child):after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;background:transparent}.van-action-sheet__nav-left{display:flex;align-items:center;height:var(--van-nav-bar-height);padding:0 6px 0 var(--van-padding-md)}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}
@@ -39,6 +39,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
39
39
  };
40
40
  cancelText: StringConstructor;
41
41
  description: StringConstructor;
42
+ contentAdaptive: BooleanConstructor;
42
43
  closeOnPopstate: {
43
44
  type: BooleanConstructor;
44
45
  default: true;
@@ -89,6 +90,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
89
90
  };
90
91
  cancelText: StringConstructor;
91
92
  description: StringConstructor;
93
+ contentAdaptive: BooleanConstructor;
92
94
  closeOnPopstate: {
93
95
  type: BooleanConstructor;
94
96
  default: true;
@@ -115,6 +117,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
115
117
  closeOnPopstate: boolean;
116
118
  actions: import("./ActionSheet").ActionSheetAction[];
117
119
  closeOnClickAction: boolean;
120
+ contentAdaptive: boolean;
118
121
  }>>;
119
122
  export default ActionSheet;
120
123
  export type { ActionSheetProps, ActionSheetAction } from './ActionSheet';
@@ -31,6 +31,10 @@
31
31
  color: var(--van-action-sheet-item-text-color);
32
32
  background: var(--van-gray-2);
33
33
 
34
+ &--content-adaptive {
35
+ height: auto;
36
+ }
37
+
34
38
  &__content {
35
39
  flex: 1 auto;
36
40
  display: flex;
package/es/index.d.ts CHANGED
@@ -117,4 +117,4 @@ declare namespace _default {
117
117
  }
118
118
  export default _default;
119
119
  export function install(app: any): void;
120
- export const version: "0.0.42";
120
+ export const version: "0.0.43";
package/es/index.mjs CHANGED
@@ -110,7 +110,7 @@ import { Uploader } from "./uploader/index.mjs";
110
110
  import { VideoPreview } from "./video-preview/index.mjs";
111
111
  import { WorkOrderCard } from "./work-order-card/index.mjs";
112
112
  import { WorkOrderFilter } from "./work-order-filter/index.mjs";
113
- const version = "0.0.42";
113
+ const version = "0.0.43";
114
114
  function install(app) {
115
115
  const components = [
116
116
  ActionBar,
@@ -63,5 +63,11 @@ declare const _default: {
63
63
  vanTabs: {
64
64
  moreTitle: string;
65
65
  };
66
+ vanUploader: {
67
+ sourcePickerTitle: string;
68
+ takePhoto: string;
69
+ recordVideo: string;
70
+ chooseFromAlbum: string;
71
+ };
66
72
  };
67
73
  export default _default;
@@ -62,6 +62,12 @@ var stdin_default = {
62
62
  },
63
63
  vanTabs: {
64
64
  moreTitle: "More tabs"
65
+ },
66
+ vanUploader: {
67
+ sourcePickerTitle: "Choose upload source",
68
+ takePhoto: "Take photo",
69
+ recordVideo: "Record video",
70
+ chooseFromAlbum: "Choose from album"
65
71
  }
66
72
  };
67
73
  export {
@@ -63,5 +63,11 @@ declare const _default: {
63
63
  vanTabs: {
64
64
  moreTitle: string;
65
65
  };
66
+ vanUploader: {
67
+ sourcePickerTitle: string;
68
+ takePhoto: string;
69
+ recordVideo: string;
70
+ chooseFromAlbum: string;
71
+ };
66
72
  };
67
73
  export default _default;
@@ -62,6 +62,12 @@ var stdin_default = {
62
62
  },
63
63
  vanTabs: {
64
64
  moreTitle: "\u66F4\u591A\u6807\u7B7E"
65
+ },
66
+ vanUploader: {
67
+ sourcePickerTitle: "\u9009\u62E9\u4E0A\u4F20\u65B9\u5F0F",
68
+ takePhoto: "\u62CD\u7167",
69
+ recordVideo: "\u62CD\u89C6\u9891",
70
+ chooseFromAlbum: "\u4ECE\u76F8\u518C\u9009\u62E9"
65
71
  }
66
72
  };
67
73
  export {
@@ -14,6 +14,7 @@ declare const uploaderProps: {
14
14
  };
15
15
  capture: StringConstructor;
16
16
  multiple: BooleanConstructor;
17
+ sourcePicker: BooleanConstructor;
17
18
  label: StringConstructor;
18
19
  required: BooleanConstructor;
19
20
  disabled: BooleanConstructor;
@@ -79,6 +80,7 @@ declare const _default: import("vue").DefineComponent<{
79
80
  };
80
81
  capture: StringConstructor;
81
82
  multiple: BooleanConstructor;
83
+ sourcePicker: BooleanConstructor;
82
84
  label: StringConstructor;
83
85
  required: BooleanConstructor;
84
86
  disabled: BooleanConstructor;
@@ -131,7 +133,7 @@ declare const _default: import("vue").DefineComponent<{
131
133
  type: PropType<UploaderMaxSize>;
132
134
  default: number;
133
135
  };
134
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview")[], "update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
136
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview" | "select-source")[], "update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview" | "select-source", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
135
137
  name: {
136
138
  type: (NumberConstructor | StringConstructor)[];
137
139
  default: string;
@@ -142,6 +144,7 @@ declare const _default: import("vue").DefineComponent<{
142
144
  };
143
145
  capture: StringConstructor;
144
146
  multiple: BooleanConstructor;
147
+ sourcePicker: BooleanConstructor;
145
148
  label: StringConstructor;
146
149
  required: BooleanConstructor;
147
150
  disabled: BooleanConstructor;
@@ -201,6 +204,7 @@ declare const _default: import("vue").DefineComponent<{
201
204
  "onClick-upload"?: ((...args: any[]) => any) | undefined;
202
205
  "onClose-preview"?: ((...args: any[]) => any) | undefined;
203
206
  "onClick-preview"?: ((...args: any[]) => any) | undefined;
207
+ "onSelect-source"?: ((...args: any[]) => any) | undefined;
204
208
  }, {
205
209
  required: boolean;
206
210
  name: string | number;
@@ -210,6 +214,7 @@ declare const _default: import("vue").DefineComponent<{
210
214
  readonly: boolean;
211
215
  multiple: boolean;
212
216
  lazyLoad: boolean;
217
+ sourcePicker: boolean;
213
218
  maxCount: string | number;
214
219
  imageFit: ImageFit;
215
220
  resultType: UploaderResultType;
@@ -20,10 +20,11 @@ var __async = (__this, __arguments, generator) => {
20
20
  };
21
21
  import { ref, reactive, defineComponent, onBeforeUnmount, mergeProps as _mergeProps, createVNode as _createVNode, createTextVNode as _createTextVNode, Fragment as _Fragment } from "vue";
22
22
  import { pick, extend, toArray, isPromise, truthProp, getSizeStyle, makeArrayProp, makeStringProp, makeNumericProp } from "../utils/index.mjs";
23
- import { bem, name, isOversize, filterFiles, isImageFile, isVideoFile, readFileContent, createVideoThumbnail } from "./utils.mjs";
23
+ import { bem, name, t, isOversize, filterFiles, isImageFile, isVideoFile, readFileContent, createVideoThumbnail } from "./utils.mjs";
24
24
  import { useCustomFieldValue } from "@vant/use";
25
25
  import { useExpose } from "../composables/use-expose.mjs";
26
26
  import { Icon } from "../icon/index.mjs";
27
+ import { ActionSheet } from "../action-sheet/index.mjs";
27
28
  import { ImagePreview } from "../image-preview/index.mjs";
28
29
  import UploaderPreviewItem from "./UploaderPreviewItem.mjs";
29
30
  const uploaderProps = {
@@ -31,6 +32,7 @@ const uploaderProps = {
31
32
  accept: makeStringProp("image/*"),
32
33
  capture: String,
33
34
  multiple: Boolean,
35
+ sourcePicker: Boolean,
34
36
  label: String,
35
37
  required: Boolean,
36
38
  disabled: Boolean,
@@ -60,21 +62,26 @@ const uploaderProps = {
60
62
  var stdin_default = defineComponent({
61
63
  name,
62
64
  props: uploaderProps,
63
- emits: ["delete", "oversize", "click-upload", "close-preview", "click-preview", "update:modelValue"],
65
+ emits: ["delete", "oversize", "click-upload", "close-preview", "click-preview", "select-source", "update:modelValue"],
64
66
  setup(props, {
65
67
  emit,
66
68
  slots
67
69
  }) {
68
70
  const inputRef = ref();
71
+ const cameraInputRef = ref();
72
+ const videoInputRef = ref();
73
+ const sourcePickerVisible = ref(false);
69
74
  const urls = [];
70
75
  const getDetail = (index = props.modelValue.length) => ({
71
76
  name: props.name,
72
77
  index
73
78
  });
74
79
  const resetInput = () => {
75
- if (inputRef.value) {
76
- inputRef.value.value = "";
77
- }
80
+ [inputRef, cameraInputRef, videoInputRef].forEach((input) => {
81
+ if (input.value) {
82
+ input.value.value = "";
83
+ }
84
+ });
78
85
  };
79
86
  const onAfterRead = (items) => {
80
87
  resetInput();
@@ -210,21 +217,69 @@ var stdin_default = defineComponent({
210
217
  "class": bem("required")
211
218
  }, [_createTextVNode("*")]), props.label]);
212
219
  };
213
- const onClickUpload = (event) => emit("click-upload", event);
220
+ const acceptTypes = () => props.accept.split(",").map((type) => type.trim().toLowerCase()).filter(Boolean);
221
+ const acceptsMediaType = (type) => acceptTypes().some((accept) => accept === `${type}/*` || accept.startsWith(`${type}/`));
222
+ const triggerInput = (source) => {
223
+ const target = source === "camera" ? cameraInputRef.value : source === "video" ? videoInputRef.value : inputRef.value;
224
+ if (target && !props.disabled && !props.readonly) {
225
+ emit("select-source", source);
226
+ target.click();
227
+ }
228
+ };
229
+ const onClickUpload = (event) => {
230
+ emit("click-upload", event);
231
+ if (props.sourcePicker && !props.disabled && !props.readonly) {
232
+ sourcePickerVisible.value = true;
233
+ }
234
+ };
235
+ const renderInput = (input, accept, capture, multiple = false, hidden = false) => _createVNode("input", {
236
+ "ref": input,
237
+ "type": "file",
238
+ "class": bem("input", {
239
+ hidden
240
+ }),
241
+ "accept": accept,
242
+ "capture": capture,
243
+ "multiple": multiple,
244
+ "disabled": props.disabled,
245
+ "onChange": onChange
246
+ }, null);
247
+ const renderSourcePicker = () => {
248
+ if (!props.sourcePicker)
249
+ return;
250
+ const actions = [];
251
+ if (acceptsMediaType("image")) {
252
+ actions.push({
253
+ name: t("takePhoto"),
254
+ callback: () => triggerInput("camera")
255
+ });
256
+ }
257
+ if (acceptsMediaType("video")) {
258
+ actions.push({
259
+ name: t("recordVideo"),
260
+ callback: () => triggerInput("video")
261
+ });
262
+ }
263
+ actions.push({
264
+ name: t("chooseFromAlbum"),
265
+ callback: () => triggerInput("album")
266
+ });
267
+ return _createVNode(ActionSheet, {
268
+ "show": sourcePickerVisible.value,
269
+ "title": t("sourcePickerTitle"),
270
+ "actions": actions,
271
+ "contentAdaptive": true,
272
+ "closeOnClickAction": true,
273
+ "onUpdate:show": (show) => {
274
+ sourcePickerVisible.value = show;
275
+ }
276
+ }, null);
277
+ };
214
278
  const renderUpload = () => {
215
279
  if (props.modelValue.length >= props.maxCount || !props.showUpload) {
216
280
  return;
217
281
  }
218
- const Input = props.readonly ? null : _createVNode("input", {
219
- "ref": inputRef,
220
- "type": "file",
221
- "class": bem("input"),
222
- "accept": props.accept,
223
- "capture": props.capture,
224
- "multiple": props.multiple,
225
- "disabled": props.disabled,
226
- "onChange": onChange
227
- }, null);
282
+ const Input = props.readonly ? null : props.sourcePicker ? [renderInput(inputRef, props.accept, void 0, props.multiple, true), acceptsMediaType("image") && renderInput(cameraInputRef, "image/*", props.capture || "environment", false, true), acceptsMediaType("video") && renderInput(videoInputRef, "video/*", props.capture || "environment", false, true)] : renderInput(inputRef, props.accept, props.capture, props.multiple);
228
283
  if (slots.default) {
229
284
  return _createVNode("div", {
230
285
  "class": bem("input-wrapper"),
@@ -244,8 +299,14 @@ var stdin_default = defineComponent({
244
299
  "class": bem("upload-text")
245
300
  }, [props.uploadText]), Input]);
246
301
  };
247
- const chooseFile = () => {
248
- if (inputRef.value && !props.disabled) {
302
+ const chooseFile = (source) => {
303
+ if (props.disabled || props.readonly)
304
+ return;
305
+ if (source) {
306
+ triggerInput(source);
307
+ } else if (props.sourcePicker) {
308
+ sourcePickerVisible.value = true;
309
+ } else if (inputRef.value) {
249
310
  inputRef.value.click();
250
311
  }
251
312
  };
@@ -265,7 +326,7 @@ var stdin_default = defineComponent({
265
326
  "class": bem("wrapper", {
266
327
  disabled: props.disabled
267
328
  })
268
- }, [props.uploadFirst ? _createVNode(_Fragment, null, [renderUpload(), renderPreviewList()]) : _createVNode(_Fragment, null, [renderPreviewList(), renderUpload()])])]);
329
+ }, [props.uploadFirst ? _createVNode(_Fragment, null, [renderUpload(), renderPreviewList()]) : _createVNode(_Fragment, null, [renderPreviewList(), renderUpload()])]), renderSourcePicker()]);
269
330
  }
270
331
  });
271
332
  export {
@@ -1 +1 @@
1
- :root{--van-uploader-size: 72px;--van-uploader-border-radius: 8px;--van-uploader-border: 1px solid var(--van-grey-50);--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background-color: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background-color: rgba(0, 0, 0, .7);--van-uploader-file-background-color: var(--van-background-color);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background-color: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity);--van-uploader-required-color: var(--van-danger-color);--van-uploader-label-color: var(--van-text-color);--van-uploader-label-font-size: var(--van-font-size-md);--van-uploader-label-line-height: var(--van-line-height-md);--van-uploader-label-margin-bottom: var(--van-padding-sm)}.van-uploader{position:relative;display:inline-block}.van-uploader--required:before{position:absolute;top:0;left:calc(-1 * var(--van-padding-sm));color:var(--van-uploader-required-color);font-size:var(--van-font-size-md);line-height:var(--van-line-height-md);content:"*"}.van-uploader__label{position:relative;margin-bottom:var(--van-uploader-label-margin-bottom);color:var(--van-uploader-label-color);font-size:var(--van-uploader-label-font-size);line-height:var(--van-uploader-label-line-height)}.van-uploader__required{position:absolute;top:0;left:calc(-1 * (var(--van-padding-md) - var(--van-padding-xs)));color:var(--van-uploader-required-color)}.van-uploader__wrapper{display:flex;flex-wrap:wrap;gap:var(--van-padding-xs)}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-upload-background-color);border-radius:var(--van-uploader-border-radius);border:var(--van-uploader-border)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background-color)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;cursor:pointer;border-radius:var(--van-uploader-border-radius);overflow:hidden}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);border-radius:var(--van-uploader-border-radius);border:var(--van-uploader-border);overflow:hidden;box-sizing:border-box}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background-color);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background-color);border-radius:var(--van-uploader-border-radius);border:var(--van-uploader-border)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background-color)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
1
+ :root{--van-uploader-size: 72px;--van-uploader-border-radius: 8px;--van-uploader-border: 1px solid var(--van-grey-50);--van-uploader-icon-size: 24px;--van-uploader-icon-color: var(--van-gray-4);--van-uploader-text-color: var(--van-text-color-2);--van-uploader-text-font-size: var(--van-font-size-sm);--van-uploader-upload-background-color: var(--van-gray-1);--van-uploader-upload-active-color: var(--van-active-color);--van-uploader-delete-color: var(--van-white);--van-uploader-delete-icon-size: 14px;--van-uploader-delete-background-color: rgba(0, 0, 0, .7);--van-uploader-file-background-color: var(--van-background-color);--van-uploader-file-icon-size: 20px;--van-uploader-file-icon-color: var(--van-gray-7);--van-uploader-file-name-padding: 0 var(--van-padding-base);--van-uploader-file-name-margin-top: var(--van-padding-xs);--van-uploader-file-name-font-size: var(--van-font-size-sm);--van-uploader-file-name-text-color: var(--van-gray-7);--van-uploader-mask-text-color: var(--van-white);--van-uploader-mask-background-color: rgba(50, 50, 51, .88);--van-uploader-mask-icon-size: 22px;--van-uploader-mask-message-font-size: var(--van-font-size-sm);--van-uploader-mask-message-line-height: var(--van-line-height-xs);--van-uploader-loading-icon-size: 22px;--van-uploader-loading-icon-color: var(--van-white);--van-uploader-disabled-opacity: var(--van-disabled-opacity);--van-uploader-required-color: var(--van-danger-color);--van-uploader-label-color: var(--van-text-color);--van-uploader-label-font-size: var(--van-font-size-md);--van-uploader-label-line-height: var(--van-line-height-md);--van-uploader-label-margin-bottom: var(--van-padding-sm)}.van-uploader{position:relative;display:inline-block}.van-uploader--required:before{position:absolute;top:0;left:calc(-1 * var(--van-padding-sm));color:var(--van-uploader-required-color);font-size:var(--van-font-size-md);line-height:var(--van-line-height-md);content:"*"}.van-uploader__label{position:relative;margin-bottom:var(--van-uploader-label-margin-bottom);color:var(--van-uploader-label-color);font-size:var(--van-uploader-label-font-size);line-height:var(--van-uploader-label-line-height)}.van-uploader__required{position:absolute;top:0;left:calc(-1 * (var(--van-padding-md) - var(--van-padding-xs)));color:var(--van-uploader-required-color)}.van-uploader__wrapper{display:flex;flex-wrap:wrap;gap:var(--van-padding-xs)}.van-uploader__wrapper--disabled{opacity:var(--van-uploader-disabled-opacity)}.van-uploader__input{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;cursor:pointer;opacity:0}.van-uploader__input--hidden{display:none}.van-uploader__input-wrapper{position:relative}.van-uploader__input:disabled{cursor:not-allowed}.van-uploader__upload{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-upload-background-color);border-radius:var(--van-uploader-border-radius);border:var(--van-uploader-border)}.van-uploader__upload:active{background-color:var(--van-uploader-upload-active-color)}.van-uploader__upload--readonly:active{background-color:var(--van-uploader-upload-background-color)}.van-uploader__upload-icon{color:var(--van-uploader-icon-color);font-size:var(--van-uploader-icon-size)}.van-uploader__upload-text{margin-top:var(--van-padding-xs);color:var(--van-uploader-text-color);font-size:var(--van-uploader-text-font-size)}.van-uploader__preview{position:relative;cursor:pointer;border-radius:var(--van-uploader-border-radius);overflow:hidden}.van-uploader__preview-image{display:block;width:var(--van-uploader-size);height:var(--van-uploader-size);border-radius:var(--van-uploader-border-radius);border:var(--van-uploader-border);overflow:hidden;box-sizing:border-box}.van-uploader__preview-delete{position:absolute;top:0;right:0}.van-uploader__preview-delete--shadow{width:var(--van-uploader-delete-icon-size);height:var(--van-uploader-delete-icon-size);background:var(--van-uploader-delete-background-color);border-radius:0 0 0 12px}.van-uploader__preview-delete-icon{position:absolute;top:0;right:0;color:var(--van-uploader-delete-color);font-size:var(--van-uploader-delete-icon-size);transform:scale(.7) translate(10%,-10%)}.van-uploader__preview-cover{position:absolute;top:0;right:0;bottom:0;left:0}.van-uploader__mask{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--van-uploader-mask-text-color);background:var(--van-uploader-mask-background-color);border-radius:var(--van-uploader-border-radius);border:var(--van-uploader-border)}.van-uploader__mask-icon{font-size:var(--van-uploader-mask-icon-size)}.van-uploader__mask-message{margin-top:6px;padding:0 var(--van-padding-base);font-size:var(--van-uploader-mask-message-font-size);line-height:var(--van-uploader-mask-message-line-height)}.van-uploader__loading{width:var(--van-uploader-loading-icon-size);height:var(--van-uploader-loading-icon-size);color:var(--van-uploader-loading-icon-color)}.van-uploader__file{display:flex;flex-direction:column;align-items:center;justify-content:center;width:var(--van-uploader-size);height:var(--van-uploader-size);background:var(--van-uploader-file-background-color)}.van-uploader__file-icon{color:var(--van-uploader-file-icon-color);font-size:var(--van-uploader-file-icon-size)}.van-uploader__file-name{box-sizing:border-box;width:100%;margin-top:var(--van-uploader-file-name-margin-top);padding:var(--van-uploader-file-name-padding);color:var(--van-uploader-file-name-text-color);font-size:var(--van-uploader-file-name-font-size);text-align:center}
@@ -10,6 +10,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
10
10
  };
11
11
  capture: StringConstructor;
12
12
  multiple: BooleanConstructor;
13
+ sourcePicker: BooleanConstructor;
13
14
  label: StringConstructor;
14
15
  required: BooleanConstructor;
15
16
  disabled: BooleanConstructor;
@@ -62,7 +63,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
62
63
  type: import("vue").PropType<import("./types").UploaderMaxSize>;
63
64
  default: number;
64
65
  };
65
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview")[], "update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview" | "select-source")[], "update:modelValue" | "delete" | "oversize" | "click-upload" | "close-preview" | "click-preview" | "select-source", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
67
  name: {
67
68
  type: (NumberConstructor | StringConstructor)[];
68
69
  default: string;
@@ -73,6 +74,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
73
74
  };
74
75
  capture: StringConstructor;
75
76
  multiple: BooleanConstructor;
77
+ sourcePicker: BooleanConstructor;
76
78
  label: StringConstructor;
77
79
  required: BooleanConstructor;
78
80
  disabled: BooleanConstructor;
@@ -132,6 +134,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
132
134
  "onClick-upload"?: ((...args: any[]) => any) | undefined;
133
135
  "onClose-preview"?: ((...args: any[]) => any) | undefined;
134
136
  "onClick-preview"?: ((...args: any[]) => any) | undefined;
137
+ "onSelect-source"?: ((...args: any[]) => any) | undefined;
135
138
  }, {
136
139
  required: boolean;
137
140
  name: string | number;
@@ -141,6 +144,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
141
144
  readonly: boolean;
142
145
  multiple: boolean;
143
146
  lazyLoad: boolean;
147
+ sourcePicker: boolean;
144
148
  maxCount: string | number;
145
149
  imageFit: import("..").ImageFit;
146
150
  resultType: import("./types").UploaderResultType;
@@ -154,7 +158,7 @@ export declare const Uploader: import("../utils").WithInstall<import("vue").Defi
154
158
  }>>;
155
159
  export default Uploader;
156
160
  export type { UploaderProps };
157
- export type { UploaderInstance, UploaderResultType, UploaderFileListItem, } from './types';
161
+ export type { UploaderInstance, UploaderResultType, UploaderSourceType, UploaderFileListItem, } from './types';
158
162
  declare module 'vue' {
159
163
  interface GlobalComponents {
160
164
  VanUploader: typeof Uploader;
@@ -84,6 +84,10 @@
84
84
  cursor: pointer;
85
85
  opacity: 0;
86
86
 
87
+ &--hidden {
88
+ display: none;
89
+ }
90
+
87
91
  &-wrapper {
88
92
  position: relative;
89
93
  }
@@ -5,6 +5,9 @@ import "../../image/index.css";
5
5
  import "../../loading/index.css";
6
6
  import "../../overlay/index.css";
7
7
  import "../../popup/index.css";
8
+ import "../../popover/index.css";
9
+ import "../../nav-bar/index.css";
10
+ import "../../action-sheet/index.css";
8
11
  import "../../swipe/index.css";
9
12
  import "../../swipe-item/index.css";
10
13
  import "../../image-preview/index.css";
@@ -5,6 +5,9 @@ import "../../image/index.less";
5
5
  import "../../loading/index.less";
6
6
  import "../../overlay/index.less";
7
7
  import "../../popup/index.less";
8
+ import "../../popover/index.less";
9
+ import "../../nav-bar/index.less";
10
+ import "../../action-sheet/index.less";
8
11
  import "../../swipe/index.less";
9
12
  import "../../swipe-item/index.less";
10
13
  import "../../image-preview/index.less";
@@ -3,6 +3,7 @@ import type { ImageFit } from '../image';
3
3
  import type { Numeric, Interceptor } from '../utils';
4
4
  import type { UploaderProps } from './Uploader';
5
5
  export declare type UploaderResultType = 'dataUrl' | 'text' | 'file';
6
+ export declare type UploaderSourceType = 'camera' | 'video' | 'album';
6
7
  export declare type UploaderFileListItem = {
7
8
  url?: string;
8
9
  file?: File;
@@ -26,7 +27,7 @@ export declare type UploaderAfterRead = (items: UploaderFileListItem | UploaderF
26
27
  index: number;
27
28
  }) => void;
28
29
  export declare type UploaderExpose = {
29
- chooseFile: () => void;
30
+ chooseFile: (source?: UploaderSourceType) => void;
30
31
  closeImagePreview: () => void;
31
32
  };
32
33
  export declare type UploaderInstance = ComponentPublicInstance<UploaderProps, UploaderExpose>;
@@ -50,6 +50,7 @@ declare const actionSheetProps: {
50
50
  };
51
51
  cancelText: StringConstructor;
52
52
  description: StringConstructor;
53
+ contentAdaptive: BooleanConstructor;
53
54
  closeOnPopstate: {
54
55
  type: BooleanConstructor;
55
56
  default: true;
@@ -102,6 +103,7 @@ declare const _default: import("vue").DefineComponent<{
102
103
  };
103
104
  cancelText: StringConstructor;
104
105
  description: StringConstructor;
106
+ contentAdaptive: BooleanConstructor;
105
107
  closeOnPopstate: {
106
108
  type: BooleanConstructor;
107
109
  default: true;
@@ -152,6 +154,7 @@ declare const _default: import("vue").DefineComponent<{
152
154
  };
153
155
  cancelText: StringConstructor;
154
156
  description: StringConstructor;
157
+ contentAdaptive: BooleanConstructor;
155
158
  closeOnPopstate: {
156
159
  type: BooleanConstructor;
157
160
  default: true;
@@ -178,5 +181,6 @@ declare const _default: import("vue").DefineComponent<{
178
181
  closeOnPopstate: boolean;
179
182
  actions: ActionSheetAction[];
180
183
  closeOnClickAction: boolean;
184
+ contentAdaptive: boolean;
181
185
  }>;
182
186
  export default _default;
@@ -35,6 +35,7 @@ const actionSheetProps = (0, import_utils.extend)({}, import_shared.popupSharedP
35
35
  closeable: import_utils.truthProp,
36
36
  cancelText: String,
37
37
  description: String,
38
+ contentAdaptive: Boolean,
38
39
  closeOnPopstate: import_utils.truthProp,
39
40
  closeOnClickAction: Boolean,
40
41
  safeAreaInsetBottom: import_utils.truthProp
@@ -143,7 +144,9 @@ var stdin_default = (0, import_vue.defineComponent)({
143
144
  }
144
145
  };
145
146
  return () => (0, import_vue.createVNode)(import_popup.Popup, (0, import_vue.mergeProps)({
146
- "class": bem(),
147
+ "class": bem({
148
+ "content-adaptive": props.contentAdaptive
149
+ }),
147
150
  "position": "bottom",
148
151
  "onUpdate:show": updateShow
149
152
  }, (0, import_utils.pick)(props, popupInheritKeys)), {
@@ -1 +1 @@
1
- :root{--van-action-sheet-max-height:calc(100% - 96px);--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-color-light);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background-color);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color);background:var(--van-gray-2)}.van-action-sheet__content{flex:1 auto;display:flex;flex-direction:column;gap:0;padding:0 var(--van-padding-md) var(--van-padding-md);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__action-card{overflow:hidden;background:var(--van-white);border-radius:8px}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:transparent;border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{position:relative;line-height:var(--van-action-sheet-item-line-height);text-align:left}.van-action-sheet__item--selected{font-weight:var(--van-font-weight-bold)}.van-action-sheet__item:not(:last-child):after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;background:transparent}.van-action-sheet__nav-left{display:flex;align-items:center;height:var(--van-nav-bar-height);padding:0 6px 0 var(--van-padding-md)}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}
1
+ :root{--van-action-sheet-max-height:calc(100% - 96px);--van-action-sheet-header-height: 48px;--van-action-sheet-header-font-size: var(--van-font-size-lg);--van-action-sheet-description-color: var(--van-text-color-2);--van-action-sheet-description-font-size: var(--van-font-size-md);--van-action-sheet-description-line-height: var(--van-line-height-md);--van-action-sheet-item-background: var(--van-background-color-light);--van-action-sheet-item-font-size: var(--van-font-size-lg);--van-action-sheet-item-line-height: var(--van-line-height-lg);--van-action-sheet-item-text-color: var(--van-text-color);--van-action-sheet-item-disabled-text-color: var(--van-text-color-3);--van-action-sheet-subname-color: var(--van-text-color-2);--van-action-sheet-subname-font-size: var(--van-font-size-sm);--van-action-sheet-subname-line-height: var(--van-line-height-sm);--van-action-sheet-cancel-text-color: var(--van-gray-7);--van-action-sheet-cancel-padding-top: var(--van-padding-xs);--van-action-sheet-cancel-padding-color: var(--van-background-color);--van-action-sheet-loading-icon-size: 22px}.van-action-sheet{display:flex;flex-direction:column;max-height:var(--van-action-sheet-max-height);height:var(--van-action-sheet-max-height);overflow:hidden;color:var(--van-action-sheet-item-text-color);background:var(--van-gray-2)}.van-action-sheet--content-adaptive{height:auto}.van-action-sheet__content{flex:1 auto;display:flex;flex-direction:column;gap:0;padding:0 var(--van-padding-md) var(--van-padding-md);overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__action-card{overflow:hidden;background:var(--van-white);border-radius:8px}.van-action-sheet__item,.van-action-sheet__cancel{display:block;width:100%;padding:14px var(--van-padding-md);font-size:var(--van-action-sheet-item-font-size);background:transparent;border:none;cursor:pointer}.van-action-sheet__item:active,.van-action-sheet__cancel:active{background-color:var(--van-active-color)}.van-action-sheet__item{position:relative;line-height:var(--van-action-sheet-item-line-height);text-align:left}.van-action-sheet__item--selected{font-weight:var(--van-font-weight-bold)}.van-action-sheet__item:not(:last-child):after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__item--loading,.van-action-sheet__item--disabled{color:var(--van-action-sheet-item-disabled-text-color)}.van-action-sheet__item--loading:active,.van-action-sheet__item--disabled:active{background-color:var(--van-action-sheet-item-background)}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{flex-shrink:0;box-sizing:border-box;color:var(--van-action-sheet-cancel-text-color)}.van-action-sheet__subname{margin-top:var(--van-padding-xs);color:var(--van-action-sheet-subname-color);font-size:var(--van-action-sheet-subname-font-size);line-height:var(--van-action-sheet-subname-line-height)}.van-action-sheet__gap{display:block;height:var(--van-action-sheet-cancel-padding-top);background:var(--van-action-sheet-cancel-padding-color)}.van-action-sheet__header{flex-shrink:0;background:transparent}.van-action-sheet__nav-left{display:flex;align-items:center;height:var(--van-nav-bar-height);padding:0 6px 0 var(--van-padding-md)}.van-action-sheet__description{position:relative;flex-shrink:0;padding:20px var(--van-padding-md);color:var(--van-action-sheet-description-color);font-size:var(--van-action-sheet-description-font-size);line-height:var(--van-action-sheet-description-line-height);text-align:center}.van-action-sheet__description:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-border-color);transform:scaleY(.5)}.van-action-sheet__loading-icon .van-loading__spinner{width:var(--van-action-sheet-loading-icon-size);height:var(--van-action-sheet-loading-icon-size)}
@@ -39,6 +39,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
39
39
  };
40
40
  cancelText: StringConstructor;
41
41
  description: StringConstructor;
42
+ contentAdaptive: BooleanConstructor;
42
43
  closeOnPopstate: {
43
44
  type: BooleanConstructor;
44
45
  default: true;
@@ -89,6 +90,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
89
90
  };
90
91
  cancelText: StringConstructor;
91
92
  description: StringConstructor;
93
+ contentAdaptive: BooleanConstructor;
92
94
  closeOnPopstate: {
93
95
  type: BooleanConstructor;
94
96
  default: true;
@@ -115,6 +117,7 @@ export declare const ActionSheet: import("../utils").WithInstall<import("vue").D
115
117
  closeOnPopstate: boolean;
116
118
  actions: import("./ActionSheet").ActionSheetAction[];
117
119
  closeOnClickAction: boolean;
120
+ contentAdaptive: boolean;
118
121
  }>>;
119
122
  export default ActionSheet;
120
123
  export type { ActionSheetProps, ActionSheetAction } from './ActionSheet';
@@ -31,6 +31,10 @@
31
31
  color: var(--van-action-sheet-item-text-color);
32
32
  background: var(--van-gray-2);
33
33
 
34
+ &--content-adaptive {
35
+ height: auto;
36
+ }
37
+
34
38
  &__content {
35
39
  flex: 1 auto;
36
40
  display: flex;