feat(basic): 为列表对话框添加对齐方式设置

- 在 ListOptions 接口中添加 alignment 属性,用于设置对话框的对齐方式
- 修改 ToolsHelper 类中的 showListDialog 方法,支持根据 options.alignment 设置对齐方式
这个提交包含在:
徐勤民 2024-11-05 18:40:04 +08:00
父节点 cc73119a32
当前提交 45187bc8b6

查看文件

@ -28,6 +28,7 @@ export interface ConfirmOptions {
export interface ListOptions<T> { export interface ListOptions<T> {
title?: string title?: string
cancel?: Btn cancel?: Btn
alignment?: DialogAlignment
values: Array<T> values: Array<T>
onSelected: (index: number, value: T) => void onSelected: (index: number, value: T) => void
onError?: (msg: string) => void onError?: (msg: string) => void
@ -102,6 +103,7 @@ interface ThrottleInterface {
export class ToolsHelper { export class ToolsHelper {
private constructor() { private constructor() {
} }
/** /**
* 弹出Toast * 弹出Toast
* @param msg * @param msg
@ -233,7 +235,7 @@ export class ToolsHelper {
} else { } else {
const dialogTag = ToolsHelper.getUuid() const dialogTag = ToolsHelper.getUuid()
promptAction.openCustomDialog({ promptAction.openCustomDialog({
alignment: DialogAlignment.Bottom, alignment: options.alignment ?? DialogAlignment.Bottom,
builder: customDialogBuilder.bind(p, options, dialogTag) builder: customDialogBuilder.bind(p, options, dialogTag)
}).then((dialogId: number) => { }).then((dialogId: number) => {
ToolsHelper.mapDialog.set(dialogTag, dialogId) ToolsHelper.mapDialog.set(dialogTag, dialogId)