@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-mok/quasar-app-extension-quasar-axe",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "A Quasar App Extension",
5
5
  "author": "d-mok <49301824+d-mok@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -74,7 +74,8 @@ export async function askFn(
74
74
 
75
75
  /**
76
76
  * Ask for an array of objects by table.
77
- * Input object must have the same keys as sample.
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
- let content = prefills.find($ => $.length > 0)
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: content[0],
91
+ content: prefills.find($ => $.length > 0),
92
+ sample: [...prefills].reverse().find($ => $.length > 0)![0],
94
93
  isValid,
95
94
  cancel: true,
96
95
  })