@trim21/personal-pi-extensions 0.0.296 → 0.0.297
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.
- package/package.json +1 -1
- package/src/lib/ui.ts +4 -4
package/package.json
CHANGED
package/src/lib/ui.ts
CHANGED
|
@@ -131,9 +131,9 @@ export interface CheckboxActionResult<T extends string> {
|
|
|
131
131
|
/**
|
|
132
132
|
* Checkbox 多选 + 结束动作的组合对话框(selectMultiple 的带操作变体)。
|
|
133
133
|
*
|
|
134
|
-
* 循环列出全部 `
|
|
135
|
-
*
|
|
136
|
-
*
|
|
134
|
+
* 循环列出全部 `actions`(固定操作,选中即结束循环)与全部 `entries`
|
|
135
|
+
* (☑/☐ 前缀切换勾选);对话框关闭(dismiss)返回 undefined。操作在前、
|
|
136
|
+
* checkbox 条目在后,用户先决定本次动作,需要时再勾选要持久化的规则。
|
|
137
137
|
*/
|
|
138
138
|
export async function selectCheckboxActions<T extends string>(
|
|
139
139
|
title: string,
|
|
@@ -152,7 +152,7 @@ export async function selectCheckboxActions<T extends string>(
|
|
|
152
152
|
displayToLabel.set(display, entry.label);
|
|
153
153
|
round.push({ ...entry, label: display });
|
|
154
154
|
}
|
|
155
|
-
const result = await selectWithOptionalInput(title, [...
|
|
155
|
+
const result = await selectWithOptionalInput(title, [...actions, ...round], ui, opts);
|
|
156
156
|
if (result === undefined) return undefined;
|
|
157
157
|
const action = actions.find((candidate) => candidate.label === result.label);
|
|
158
158
|
if (action !== undefined) return { selected, action: action.action, input: result.input };
|