sard-uniapp 1.25.5 → 1.25.7

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 (49) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/components/action-sheet/README.md +106 -12
  3. package/components/action-sheet/action-sheet.d.ts +2 -1
  4. package/components/action-sheet/action-sheet.vue +47 -11
  5. package/components/action-sheet/common.d.ts +51 -12
  6. package/components/action-sheet-agent/action-sheet-agent.d.ts +35 -0
  7. package/components/action-sheet-agent/action-sheet-agent.vue +194 -0
  8. package/components/action-sheet-agent/common.d.ts +613 -0
  9. package/components/action-sheet-agent/common.js +35 -0
  10. package/components/action-sheet-agent/index.d.ts +1 -0
  11. package/components/action-sheet-agent/index.js +1 -0
  12. package/components/config/index.d.ts +2 -0
  13. package/components/config/index.js +5 -0
  14. package/components/crop-image/crop-image.vue +7 -1
  15. package/components/dialog/dialog.d.ts +1 -1
  16. package/components/dialog/dialog.vue +11 -5
  17. package/components/dialog-agent/dialog-agent.d.ts +11 -11
  18. package/components/locale/lang/ar-SA.d.ts +3 -0
  19. package/components/locale/lang/ar-SA.js +3 -0
  20. package/components/locale/lang/en-US.d.ts +3 -0
  21. package/components/locale/lang/en-US.js +3 -0
  22. package/components/locale/lang/vi-VN.d.ts +3 -0
  23. package/components/locale/lang/vi-VN.js +3 -0
  24. package/components/locale/lang/zh-CN.d.ts +3 -0
  25. package/components/locale/lang/zh-CN.js +3 -0
  26. package/components/notice-bar/notice-bar.vue +5 -3
  27. package/components/notify/notify.vue +1 -0
  28. package/components/notify-agent/notify-agent.d.ts +1 -1
  29. package/components/popout/README.md +41 -37
  30. package/components/popout/common.d.ts +47 -0
  31. package/components/popout/popout.d.ts +2 -1
  32. package/components/popout/popout.vue +15 -3
  33. package/components/popup/README.md +30 -28
  34. package/components/popup/common.d.ts +31 -0
  35. package/components/popup/popup.d.ts +1 -0
  36. package/components/popup/popup.vue +60 -6
  37. package/components/resize-sensor/resize-sensor.vue +1 -1
  38. package/components/share-sheet/share-sheet.vue +8 -1
  39. package/components/toast/toast.vue +1 -0
  40. package/global.d.ts +2 -0
  41. package/index.d.ts +1 -0
  42. package/index.js +1 -0
  43. package/package.json +23 -23
  44. package/use/index.d.ts +1 -0
  45. package/use/index.js +1 -0
  46. package/use/useTopPopup.d.ts +8 -0
  47. package/use/useTopPopup.js +82 -0
  48. package/utils/string.d.ts +0 -3
  49. package/utils/string.js +6 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## [1.25.7](https://github.com/sutras/sard-uniapp/compare/v1.25.6...v1.25.7) (2026-01-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 修复notice-bar错位问题 ([f4a7e6b](https://github.com/sutras/sard-uniapp/commit/f4a7e6ba0840c9723d51f0add89677c1fe985b07))
7
+
8
+
9
+ ### Features
10
+
11
+ * app端允许页面返回时关闭弹出框 ([c538d7f](https://github.com/sutras/sard-uniapp/commit/c538d7fd35ade7bb07f192f35aed2db2515456b9))
12
+ * 小程序端允许页面返回操作关闭弹出框 ([a4fdc64](https://github.com/sutras/sard-uniapp/commit/a4fdc647ae5425ea5c4302493ca00852a7cc3a7a))
13
+
14
+
15
+
16
+ ## [1.25.6](https://github.com/sutras/sard-uniapp/compare/v1.25.5...v1.25.6) (2025-12-27)
17
+
18
+
19
+ ### Features
20
+
21
+ * **ActionSheet:** 动作面板允许命令式使用 ([d17e03a](https://github.com/sutras/sard-uniapp/commit/d17e03abcb1d9179844a2d6856e4b6d34c0c3a0e))
22
+
23
+
24
+
1
25
  ## [1.25.5](https://github.com/sutras/sard-uniapp/compare/v1.25.4...v1.25.5) (2025-11-30)
2
26
 
3
27
 
@@ -15,6 +15,8 @@ group:
15
15
 
16
16
  ```ts
17
17
  import ActionSheet from 'sard-uniapp/components/action-sheet/action-sheet.vue'
18
+ import ActionSheetAgent from 'sard-uniapp/components/action-sheet-agent/action-sheet-agent.vue'
19
+ import { actionSheet } from 'sard-uniapp'
18
20
  ```
19
21
 
20
22
  ## 代码演示
@@ -27,7 +29,7 @@ import ActionSheet from 'sard-uniapp/components/action-sheet/action-sheet.vue'
27
29
 
28
30
  ### 取消按钮
29
31
 
30
- 使用 `cancel` 属性展示取消按钮。
32
+ 设置 `show-cancel` 属性展示取消按钮,或者使用 `cancel` 属性在设置取消按钮文本的同时显示取消按钮。
31
33
 
32
34
  @code('${DEMO_PATH}/action-sheet/demo/Cancel.vue')
33
35
 
@@ -43,21 +45,64 @@ import ActionSheet from 'sard-uniapp/components/action-sheet/action-sheet.vue'
43
45
 
44
46
  @code('${DEMO_PATH}/action-sheet/demo/Status.vue')
45
47
 
48
+ ### 命令式 <sup>1.25.6+</sup>
49
+
50
+ 先在页面放置代理组件。
51
+
52
+ ```tsx
53
+ <sar-action-sheet-agent />
54
+ ```
55
+
56
+ 接着便可以使用 `actionSheet` 方法显示动作面板。
57
+
58
+ @code('${DEMO_PATH}/action-sheet/demo/Imperative.vue')
59
+
46
60
  ## API
47
61
 
48
62
  ### ActionSheetProps
49
63
 
50
- | 属性 | 描述 | 类型 | 默认值 |
51
- | ---------------- | -------------------------------------------------------------------- | ---------------------------------------------- | ------ |
52
- | root-class | 组件根元素类名 | string | - |
53
- | root-style | 组件根元素样式 | StyleValue | - |
54
- | description | 动作面板描述说明 | string | - |
55
- | item-list | 面板项列表 | ActionSheetItem[] | [] |
56
- | cancel | 取消按钮文字 | string | - |
57
- | visible | 是否显示动作面板 | boolean | false |
58
- | overlay-closable | 点击遮罩后是否关闭 | boolean | true |
59
- | before-close | 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭 | (type: 'close' \| 'cancel' \| 'select') => any | - |
60
- | duration | 显隐动画时长,单位 ms | number | 300 |
64
+ | 属性 | 描述 | 类型 | 默认值 |
65
+ | ------------------------------ | -------------------------------------------------------------------- | ---------------------- | ------ |
66
+ | root-class | 组件根元素类名 | string | - |
67
+ | root-style | 组件根元素样式 | StyleValue | - |
68
+ | description | 动作面板描述说明 | string | - |
69
+ | item-list | 面板项列表 | ActionSheetItem[] | [] |
70
+ | show-cancel <sup>1.25.6+</sup> | 是否显示取消按钮 | boolean | false |
71
+ | cancel | 自定义取消按钮文字 | string | - |
72
+ | visible | 是否显示动作面板 | boolean | false |
73
+ | overlay-closable | 点击遮罩后是否关闭 | boolean | true |
74
+ | before-close | 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭 | ActionSheetBeforeClose | - |
75
+ | duration | 显隐动画时长,单位 ms | number | 300 |
76
+
77
+ #### ActionSheetBeforeClose
78
+
79
+ ```ts
80
+ type ActionSheetBeforeClose =
81
+ | ((
82
+ type: 'close' | 'cancel',
83
+ loading: {
84
+ readonly cancel: boolean
85
+ readonly select: boolean
86
+ readonly close: boolean
87
+ },
88
+ ) => any | Promise<any>)
89
+ | ((
90
+ type: 'select',
91
+ item: ActionSheetItem,
92
+ index: number,
93
+ loading: {
94
+ readonly cancel: boolean
95
+ readonly select: boolean
96
+ readonly close: boolean
97
+ },
98
+ ) => any | Promise<any>)
99
+ ```
100
+
101
+ - 当点击动作项时,`type` 为 `select`;
102
+ - 当点击取消按钮时,`type` 为 `cancel`;
103
+ - 当点击遮罩时,`type` 为 `close`。
104
+
105
+ `loading` 表示当前哪个按钮处于异步关闭状态。
61
106
 
62
107
  ### ActionSheetItem
63
108
 
@@ -87,6 +132,55 @@ import ActionSheet from 'sard-uniapp/components/action-sheet/action-sheet.vue'
87
132
  | after-leave <sup>1.22.1+</sup> | 退场动画结束时触发 | () => void |
88
133
  | leave-cancelled <sup>1.22.1+</sup> | 退场动画取消时触发 | () => void |
89
134
 
135
+ ### ActionSheetAgentProps / ActionSheetOptions <sup>1.25.6+</sup>
136
+
137
+ 继承 [`ActionSheetProps`](#ActionSheetProps) 并有以下额外属性。
138
+
139
+ | 属性 | 描述 | 类型 | 默认值 |
140
+ | ---------------- | --------------------------- | ---------------------------------------------- | ------------- |
141
+ | id | 动作面板组件的 id | string | 'actionSheet' |
142
+ | onClose | 点击遮罩时调用 | () => void |
143
+ | onCancel | 点击取消按钮时调用 | () => void |
144
+ | onSelect | 点击动作项时调用 | (item: ActionSheetItem, index: number) => void |
145
+ | onVisibleHook | 入场/退场动画状态改变时调用 | (name: TransitionHookName) => void |
146
+ | onBeforeEnter | 入场动画开始前调用 | () => void |
147
+ | onEnter | 入场动画开始时调用 | () => void |
148
+ | onAfterEnter | 入场动画结束时调用 | () => void |
149
+ | onEnterCancelled | 入场动画取消时调用 | () => void |
150
+ | onBeforeLeave | 退场动画开始前调用 | () => void |
151
+ | onLeave | 退场动画开始时调用 | () => void |
152
+ | onAfterLeave | 退场动画结束时调用 | () => void |
153
+ | onLeaveCancelled | 退场动画取消时调用 | () => void |
154
+
155
+ ### ActionSheetAgentEmits <sup>1.25.6+</sup>
156
+
157
+ 继承 [`ActionSheetEmits`](#ActionSheetEmits)。
158
+
159
+ ### 命令式方法 <sup>1.25.6+</sup>
160
+
161
+ | 名称 | 描述 | 类型 |
162
+ | ----------- | ------------------------------ | ---------------------------- |
163
+ | actionSheet | 显示动作面板 | ActionSheetFunction |
164
+ | hide | 隐藏指定 `id` 的命令式动作面板 | (id = 'actionSheet') => void |
165
+ | hideAll | 隐藏所有命令式动作面板 | () => void |
166
+
167
+ ### ActionSheetFunction <sup>1.25.6+</sup>
168
+
169
+ ```ts
170
+ type ActionSheetFunction = ActionSheetSimpleShowFunction & {
171
+ hide: (id?: string) => void
172
+ hideAll: () => void
173
+ }
174
+ ```
175
+
176
+ ### ActionSheetSimpleShowFunction <sup>1.25.6+</sup>
177
+
178
+ ```ts
179
+ interface ActionSheetSimpleShowFunction {
180
+ (options: ActionSheetOptions): void
181
+ }
182
+ ```
183
+
90
184
  ## 主题定制
91
185
 
92
186
  ### CSS 变量
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<ActionSheetProps, {}, {},
14
14
  duration: number;
15
15
  overlayClosable: boolean;
16
16
  itemList: ActionSheetItem[];
17
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
17
+ showCancel: boolean;
18
+ beforeClose: import("./common").ActionSheetBeforeClose;
18
19
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
20
  export default _default;
@@ -3,8 +3,10 @@
3
3
  effect="slide-bottom"
4
4
  :visible="innerVisible"
5
5
  :duration="duration"
6
+ back-press="close"
6
7
  @overlay-click="onOverlayClick"
7
8
  @visible-hook="onVisibleHook"
9
+ @back-press="onBackPress"
8
10
  >
9
11
  <view :class="actionSheetClass" :style="actionSheetStyle">
10
12
  <view v-if="description" :class="bem.e('description')">
@@ -37,10 +39,10 @@
37
39
  </view>
38
40
  </view>
39
41
  </view>
40
- <template v-if="cancel">
42
+ <template v-if="mergedShowCancel">
41
43
  <view :class="bem.e('gap')"></view>
42
44
  <view :class="bem.e('cancel')" @click="onCancel">
43
- {{ cancel }}
45
+ {{ cancel || t('cancel') }}
44
46
  </view>
45
47
  </template>
46
48
  </view>
@@ -49,7 +51,7 @@
49
51
 
50
52
  <script>
51
53
  import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent } from "vue";
52
- import { computed, ref, watch } from "vue";
54
+ import { computed, reactive, readonly, ref, watch } from "vue";
53
55
  import {
54
56
  classNames,
55
57
  stringifyStyle,
@@ -63,15 +65,17 @@ import SarLoading from "../loading/loading.vue";
63
65
  import {
64
66
  defaultActionSheetProps
65
67
  } from "./common";
68
+ import { useTranslate } from "../locale";
66
69
  /**
67
70
  * @property {string} rootClass 组件根元素类名,默认值:-。
68
71
  * @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
69
72
  * @property {string} description 动作面板描述说明,默认值:-。
70
73
  * @property {ActionSheetItem[]} itemList 面板项列表,默认值:[]。
71
- * @property {string} cancel 取消按钮文字,默认值:-。
74
+ * @property {boolean} showCancel 是否显示取消按钮,默认值:false。
75
+ * @property {string} cancel 自定义取消按钮文字,默认值:-。
72
76
  * @property {boolean} visible 是否显示动作面板,默认值:false。
73
77
  * @property {boolean} overlayClosable 点击遮罩后是否关闭,默认值:true。
74
- * @property {(type: 'close' | 'cancel' | 'select') => any} beforeClose 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭,默认值:-。
78
+ * @property {ActionSheetBeforeClose} beforeClose 关闭前的回调,返回 `false` 或 `rejected` 状态的 `Promise` 可阻止关闭,默认值:-。
75
79
  * @property {number} duration 显隐动画时长,单位 ms,默认值:300。
76
80
  * @event {(visible: boolean) => void} update 动作面板显隐时触发
77
81
  * @event {() => void} close 点击遮罩时触发
@@ -105,6 +109,7 @@ export default _defineComponent({
105
109
  description: { type: String, required: false },
106
110
  itemList: { type: Array, required: false },
107
111
  cancel: { type: String, required: false },
112
+ showCancel: { type: Boolean, required: false },
108
113
  visible: { type: Boolean, required: false },
109
114
  overlayClosable: { type: Boolean, required: false },
110
115
  beforeClose: { type: Function, required: false },
@@ -116,6 +121,7 @@ export default _defineComponent({
116
121
  const props = __props;
117
122
  const emit = __emit;
118
123
  const bem = createBem("action-sheet");
124
+ const { t } = useTranslate("actionSheet");
119
125
  const innerVisible = ref(props.visible);
120
126
  watch(
121
127
  () => props.visible,
@@ -123,9 +129,35 @@ export default _defineComponent({
123
129
  innerVisible.value = props.visible;
124
130
  }
125
131
  );
126
- const perhapsClose = (type) => {
132
+ const mergedShowCancel = computed(() => props.showCancel || props.cancel);
133
+ const loading = reactive({
134
+ cancel: false,
135
+ select: false,
136
+ close: false
137
+ });
138
+ const readonlyLoading = readonly(loading);
139
+ const asyncSet = new Set();
140
+ watch(
141
+ innerVisible,
142
+ () => {
143
+ if (innerVisible.value === false) {
144
+ asyncSet.forEach((obj) => {
145
+ obj.valid = false;
146
+ });
147
+ Object.assign(loading, {
148
+ cancel: false,
149
+ select: false,
150
+ close: false
151
+ });
152
+ }
153
+ },
154
+ {
155
+ flush: "sync"
156
+ }
157
+ );
158
+ function perhapsClose(type, item, index) {
127
159
  if (isFunction(props.beforeClose)) {
128
- const result = props.beforeClose(type);
160
+ const result = type === "select" ? props.beforeClose(type, item, index, readonlyLoading) : props.beforeClose(type, readonlyLoading);
129
161
  if (isObject(result) && isFunction(result.then)) {
130
162
  return result.then(() => {
131
163
  innerVisible.value = false;
@@ -137,17 +169,17 @@ export default _defineComponent({
137
169
  }
138
170
  innerVisible.value = false;
139
171
  emit("update:visible", false);
140
- };
172
+ }
141
173
  const onOverlayClick = () => {
142
- emit("close");
143
174
  if (props.overlayClosable) {
175
+ emit("close");
144
176
  perhapsClose("close");
145
177
  }
146
178
  };
147
179
  const onSelect = (item, index) => {
148
180
  if (!item.disabled && !item.loading) {
149
181
  emit("select", item, index);
150
- perhapsClose("select");
182
+ perhapsClose("select", item, index);
151
183
  }
152
184
  };
153
185
  const onCancel = () => {
@@ -158,6 +190,10 @@ export default _defineComponent({
158
190
  emit("visible-hook", name);
159
191
  emit(name);
160
192
  };
193
+ const onBackPress = () => {
194
+ innerVisible.value = false;
195
+ emit("update:visible", false);
196
+ };
161
197
  const actionSheetClass = computed(() => {
162
198
  return classNames(
163
199
  bem.b(),
@@ -168,7 +204,7 @@ export default _defineComponent({
168
204
  const actionSheetStyle = computed(() => {
169
205
  return stringifyStyle(props.rootStyle);
170
206
  });
171
- const __returned__ = { props, emit, bem, innerVisible, perhapsClose, onOverlayClick, onSelect, onCancel, onVisibleHook, actionSheetClass, actionSheetStyle, get classNames() {
207
+ const __returned__ = { props, emit, bem, t, innerVisible, mergedShowCancel, loading, readonlyLoading, asyncSet, perhapsClose, onOverlayClick, onSelect, onCancel, onVisibleHook, onBackPress, actionSheetClass, actionSheetStyle, get classNames() {
172
208
  return classNames;
173
209
  }, get stringifyStyle() {
174
210
  return stringifyStyle;
@@ -1,14 +1,24 @@
1
1
  import { type StyleValue } from 'vue';
2
2
  import { type TransitionHookEmits } from '../popup/common';
3
+ export type ActionSheetBeforeClose = ((type: 'close' | 'cancel', loading: {
4
+ readonly cancel: boolean;
5
+ readonly select: boolean;
6
+ readonly close: boolean;
7
+ }) => any | Promise<any>) & ((type: 'select', item: ActionSheetItem, index: number, loading: {
8
+ readonly cancel: boolean;
9
+ readonly select: boolean;
10
+ readonly close: boolean;
11
+ }) => any | Promise<any>);
3
12
  export interface ActionSheetProps {
4
13
  rootStyle?: StyleValue;
5
14
  rootClass?: string;
6
15
  description?: string;
7
16
  itemList?: ActionSheetItem[];
8
17
  cancel?: string;
18
+ showCancel?: boolean;
9
19
  visible?: boolean;
10
20
  overlayClosable?: boolean;
11
- beforeClose?: (type: 'close' | 'cancel' | 'select') => boolean | Promise<any>;
21
+ beforeClose?: ActionSheetBeforeClose;
12
22
  duration?: number;
13
23
  }
14
24
  export declare const defaultActionSheetProps: {
@@ -18,9 +28,10 @@ export declare const defaultActionSheetProps: {
18
28
  description: string;
19
29
  itemList: ActionSheetItem[];
20
30
  cancel: string;
31
+ showCancel: boolean;
21
32
  visible: boolean;
22
33
  overlayClosable: boolean;
23
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
34
+ beforeClose: ActionSheetBeforeClose;
24
35
  duration: number;
25
36
  }) => string | false | import("vue").CSSProperties | StyleValue[]) | null) | undefined;
26
37
  rootClass?: (string | ((props: {
@@ -29,9 +40,10 @@ export declare const defaultActionSheetProps: {
29
40
  description: string;
30
41
  itemList: ActionSheetItem[];
31
42
  cancel: string;
43
+ showCancel: boolean;
32
44
  visible: boolean;
33
45
  overlayClosable: boolean;
34
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
46
+ beforeClose: ActionSheetBeforeClose;
35
47
  duration: number;
36
48
  }) => string)) | undefined;
37
49
  description?: (string | ((props: {
@@ -40,9 +52,10 @@ export declare const defaultActionSheetProps: {
40
52
  description: string;
41
53
  itemList: ActionSheetItem[];
42
54
  cancel: string;
55
+ showCancel: boolean;
43
56
  visible: boolean;
44
57
  overlayClosable: boolean;
45
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
58
+ beforeClose: ActionSheetBeforeClose;
46
59
  duration: number;
47
60
  }) => string)) | undefined;
48
61
  itemList?: ((props: {
@@ -51,9 +64,10 @@ export declare const defaultActionSheetProps: {
51
64
  description: string;
52
65
  itemList: ActionSheetItem[];
53
66
  cancel: string;
67
+ showCancel: boolean;
54
68
  visible: boolean;
55
69
  overlayClosable: boolean;
56
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
70
+ beforeClose: ActionSheetBeforeClose;
57
71
  duration: number;
58
72
  }) => ActionSheetItem[]) | undefined;
59
73
  cancel?: (string | ((props: {
@@ -62,20 +76,34 @@ export declare const defaultActionSheetProps: {
62
76
  description: string;
63
77
  itemList: ActionSheetItem[];
64
78
  cancel: string;
79
+ showCancel: boolean;
65
80
  visible: boolean;
66
81
  overlayClosable: boolean;
67
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
82
+ beforeClose: ActionSheetBeforeClose;
68
83
  duration: number;
69
84
  }) => string)) | undefined;
85
+ showCancel?: (boolean | ((props: {
86
+ rootStyle: StyleValue;
87
+ rootClass: string;
88
+ description: string;
89
+ itemList: ActionSheetItem[];
90
+ cancel: string;
91
+ showCancel: boolean;
92
+ visible: boolean;
93
+ overlayClosable: boolean;
94
+ beforeClose: ActionSheetBeforeClose;
95
+ duration: number;
96
+ }) => boolean)) | undefined;
70
97
  visible?: (boolean | ((props: {
71
98
  rootStyle: StyleValue;
72
99
  rootClass: string;
73
100
  description: string;
74
101
  itemList: ActionSheetItem[];
75
102
  cancel: string;
103
+ showCancel: boolean;
76
104
  visible: boolean;
77
105
  overlayClosable: boolean;
78
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
106
+ beforeClose: ActionSheetBeforeClose;
79
107
  duration: number;
80
108
  }) => boolean)) | undefined;
81
109
  overlayClosable?: (boolean | ((props: {
@@ -84,31 +112,42 @@ export declare const defaultActionSheetProps: {
84
112
  description: string;
85
113
  itemList: ActionSheetItem[];
86
114
  cancel: string;
115
+ showCancel: boolean;
87
116
  visible: boolean;
88
117
  overlayClosable: boolean;
89
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
118
+ beforeClose: ActionSheetBeforeClose;
90
119
  duration: number;
91
120
  }) => boolean)) | undefined;
92
- beforeClose?: (((type: "close" | "cancel" | "select") => boolean | Promise<any>) | ((props: {
121
+ beforeClose?: (ActionSheetBeforeClose | ((props: {
93
122
  rootStyle: StyleValue;
94
123
  rootClass: string;
95
124
  description: string;
96
125
  itemList: ActionSheetItem[];
97
126
  cancel: string;
127
+ showCancel: boolean;
98
128
  visible: boolean;
99
129
  overlayClosable: boolean;
100
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
130
+ beforeClose: ActionSheetBeforeClose;
101
131
  duration: number;
102
- }) => (type: "close" | "cancel" | "select") => boolean | Promise<any>)) | undefined;
132
+ }) => ((type: "close" | "cancel", loading: {
133
+ readonly cancel: boolean;
134
+ readonly select: boolean;
135
+ readonly close: boolean;
136
+ }) => any | Promise<any>) & ((type: "select", item: ActionSheetItem, index: number, loading: {
137
+ readonly cancel: boolean;
138
+ readonly select: boolean;
139
+ readonly close: boolean;
140
+ }) => any | Promise<any>))) | undefined;
103
141
  duration?: (number | ((props: {
104
142
  rootStyle: StyleValue;
105
143
  rootClass: string;
106
144
  description: string;
107
145
  itemList: ActionSheetItem[];
108
146
  cancel: string;
147
+ showCancel: boolean;
109
148
  visible: boolean;
110
149
  overlayClosable: boolean;
111
- beforeClose: (type: "close" | "cancel" | "select") => boolean | Promise<any>;
150
+ beforeClose: ActionSheetBeforeClose;
112
151
  duration: number;
113
152
  }) => number)) | undefined;
114
153
  };
@@ -0,0 +1,35 @@
1
+ import { type ActionSheetAgentProps } from './common';
2
+ import { type TransitionHookName } from '../../use';
3
+ import { type ActionSheetItem } from '../action-sheet/common';
4
+ declare const _default: import("vue").DefineComponent<ActionSheetAgentProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ [x: string]: any;
6
+ } & {
7
+ [x: string]: any;
8
+ }, string, import("vue").PublicProps, Readonly<ActionSheetAgentProps> & Readonly<{
9
+ [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
10
+ }>, {
11
+ cancel: string;
12
+ rootStyle: string | false | import("vue").CSSProperties | import("vue").StyleValue[] | null;
13
+ rootClass: string;
14
+ onSelect: (item: ActionSheetItem, index: number) => void;
15
+ description: string;
16
+ visible: boolean;
17
+ id: string;
18
+ duration: number;
19
+ overlayClosable: boolean;
20
+ itemList: ActionSheetItem[];
21
+ showCancel: boolean;
22
+ beforeClose: import("../action-sheet/common").ActionSheetBeforeClose;
23
+ onClose: () => void;
24
+ onCancel: () => void;
25
+ onVisibleHook: (name: TransitionHookName) => void;
26
+ onBeforeEnter: () => void;
27
+ onEnter: () => void;
28
+ onAfterEnter: () => void;
29
+ onEnterCancelled: () => void;
30
+ onBeforeLeave: () => void;
31
+ onLeave: () => void;
32
+ onAfterLeave: () => void;
33
+ onLeaveCancelled: () => void;
34
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ export default _default;