|
1 | 1 | /* |
2 | 2 | * @Author: weisheng |
3 | 3 | * @Date: 2024-03-18 11:22:03 |
4 | | - * @LastEditTime: 2024-03-18 13:17:22 |
| 4 | + * @LastEditTime: 2024-04-04 22:35:25 |
5 | 5 | * @LastEditors: weisheng |
6 | 6 | * @Description: |
7 | | - * @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-action-sheet\types.ts |
| 7 | + * @FilePath: /wot-design-uni/src/uni_modules/wot-design-uni/components/wd-action-sheet/types.ts |
8 | 8 | * 记得注释 |
9 | 9 | */ |
10 | 10 | import type { ExtractPropTypes } from 'vue' |
11 | | -import { baseProps, makeArrayProp, makeBooleanProp, makeRequiredProp, makeStringProp } from '../common/props' |
| 11 | +import { baseProps, makeArrayProp, makeBooleanProp, makeNumberProp, makeRequiredProp, makeStringProp } from '../common/props' |
12 | 12 |
|
13 | 13 | export type Action = { |
14 | 14 | /** |
@@ -48,65 +48,74 @@ export const actionSheetProps = { |
48 | 48 | ...baseProps, |
49 | 49 | /** |
50 | 50 | * header 头部样式 |
| 51 | + * @default '' |
| 52 | + * @type {string} |
51 | 53 | */ |
52 | 54 | customHeaderClass: makeStringProp(''), |
53 | 55 | /** |
54 | 56 | * 设置菜单显示隐藏 |
| 57 | + * @default false |
| 58 | + * @type {boolean} |
55 | 59 | */ |
56 | 60 | modelValue: { ...makeBooleanProp(false), ...makeRequiredProp(Boolean) }, |
57 | 61 | /** |
58 | 62 | * 菜单选项 |
| 63 | + * @default [] |
| 64 | + * @type {Action[]} |
59 | 65 | */ |
60 | 66 | actions: makeArrayProp<Action>(), |
61 | 67 | /** |
62 | 68 | * 自定义面板项,可以为字符串数组,也可以为对象数组,如果为二维数组,则为多行展示 |
| 69 | + * @default [] |
| 70 | + * @type {Array<Panel | Panel[]>} |
63 | 71 | */ |
64 | 72 | panels: makeArrayProp<Panel | Panel[]>(), |
65 | 73 | /** |
66 | 74 | * 标题 |
| 75 | + * @type {string} |
67 | 76 | */ |
68 | 77 | title: String, |
69 | 78 | /** |
70 | 79 | * 取消按钮文案 |
| 80 | + * @type {string} |
71 | 81 | */ |
72 | 82 | cancelText: String, |
73 | 83 | /** |
74 | 84 | * 点击选项后是否关闭菜单 |
| 85 | + * @default true |
| 86 | + * @type {boolean} |
75 | 87 | */ |
76 | | - closeOnClickAction: Boolean, |
| 88 | + closeOnClickAction: makeBooleanProp(true), |
77 | 89 | /** |
78 | 90 | * 点击遮罩是否关闭 |
| 91 | + * @default true |
| 92 | + * @type {boolean} |
79 | 93 | */ |
80 | | - closeOnClickModal: Boolean, |
| 94 | + closeOnClickModal: makeBooleanProp(true), |
81 | 95 | /** |
82 | 96 | * 弹框动画持续时间 |
| 97 | + * @default 200 |
| 98 | + * @type {number} |
83 | 99 | */ |
84 | | - duration: Number, |
| 100 | + duration: makeNumberProp(200), |
85 | 101 | /** |
86 | 102 | * 菜单层级 |
| 103 | + * @default 10 |
| 104 | + * @type {number} |
87 | 105 | */ |
88 | | - zIndex: Number, |
| 106 | + zIndex: makeNumberProp(10), |
89 | 107 | /** |
90 | 108 | * 弹层内容懒渲染,触发展示时才渲染内容 |
| 109 | + * @default true |
| 110 | + * @type {boolean} |
91 | 111 | */ |
92 | | - lazyRender: Boolean, |
| 112 | + lazyRender: makeBooleanProp(true), |
93 | 113 | /** |
94 | 114 | * 弹出面板是否设置底部安全距离(iphone X 类型的机型) |
| 115 | + * @default true |
| 116 | + * @type {boolean} |
95 | 117 | */ |
96 | | - safeAreaInsetBottom: Boolean |
| 118 | + safeAreaInsetBottom: makeBooleanProp(true) |
97 | 119 | } |
98 | 120 |
|
99 | 121 | export type ActionSheetProps = ExtractPropTypes<typeof actionSheetProps> |
100 | | - |
101 | | -// export type SelectPanelOption = { |
102 | | -// item: Panel | Action |
103 | | -// index?: number |
104 | | -// rowIndex?: number |
105 | | -// colIndex?: number |
106 | | -// } |
107 | | - |
108 | | -// export const actionSheetEmits = { |
109 | | -// [UPDATE_MODEL_EVENT]: (newValue: boolean) => isBoolean(newValue), |
110 | | -// select: (option: SelectPanelOption) => option !== undefined |
111 | | -// } |
112 | | -// export type ActionSheetEmits = typeof actionSheetEmits |
|
0 commit comments