@d-mok/quasar-app-extension-quasar-axe 2.0.1 → 2.0.2
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
CHANGED
|
@@ -74,7 +74,8 @@ export async function askFn(
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Ask for an array of objects by table.
|
|
77
|
-
*
|
|
77
|
+
* The first non-empty prefill will be used.
|
|
78
|
+
* The last non-empty prefill will be the spec.
|
|
78
79
|
*/
|
|
79
80
|
export async function askTable<T extends object>(
|
|
80
81
|
title: string,
|
|
@@ -82,15 +83,13 @@ export async function askTable<T extends object>(
|
|
|
82
83
|
prefills: T[][],
|
|
83
84
|
isValid: Predicate<T> = $ => true
|
|
84
85
|
): Promise<T[]> {
|
|
85
|
-
|
|
86
|
-
if (content === undefined) {
|
|
86
|
+
if (prefills.flat().length === 0)
|
|
87
87
|
throwError('Error', 'All prefills are empty array.')
|
|
88
|
-
}
|
|
89
88
|
return await base(dialogTable, {
|
|
90
89
|
title,
|
|
91
90
|
message,
|
|
92
|
-
content,
|
|
93
|
-
sample:
|
|
91
|
+
content: prefills.find($ => $.length > 0),
|
|
92
|
+
sample: [...prefills].reverse().find($ => $.length > 0)![0],
|
|
94
93
|
isValid,
|
|
95
94
|
cancel: true,
|
|
96
95
|
})
|