@d-mok/quasar-app-extension-quasar-axe 2.2.9 → 2.2.11
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
|
@@ -90,7 +90,7 @@ export async function askTable<T extends object>(
|
|
|
90
90
|
message: string = '',
|
|
91
91
|
prefills: T[][],
|
|
92
92
|
validators: [(_: T) => boolean, string][] = [[$ => true, '']],
|
|
93
|
-
|
|
93
|
+
arrayValidators: [(_: T[]) => boolean, string][] = [[$ => true, '']]
|
|
94
94
|
): Promise<T[]> {
|
|
95
95
|
if (prefills.flat().length === 0)
|
|
96
96
|
throwError('Error', 'All prefills are empty array.')
|
|
@@ -100,7 +100,7 @@ export async function askTable<T extends object>(
|
|
|
100
100
|
content: prefills.find($ => $.length > 0),
|
|
101
101
|
sample: [...prefills].reverse().find($ => $.length > 0)![0],
|
|
102
102
|
validators,
|
|
103
|
-
|
|
103
|
+
arrayValidators,
|
|
104
104
|
cancel: true,
|
|
105
105
|
allowAddRow: true,
|
|
106
106
|
})
|
|
@@ -114,7 +114,7 @@ export async function editTable<T extends object>(
|
|
|
114
114
|
message: string = '',
|
|
115
115
|
prefill: T[],
|
|
116
116
|
validators: [(_: T) => boolean, string][] = [[$ => true, '']],
|
|
117
|
-
|
|
117
|
+
arrayValidators: [(_: T[]) => boolean, string][] = [[$ => true, '']]
|
|
118
118
|
): Promise<T[]> {
|
|
119
119
|
if (prefill.length === 0) throwError('Error', 'prefill is empty array.')
|
|
120
120
|
return await base(dialogTable, {
|
|
@@ -123,7 +123,7 @@ export async function editTable<T extends object>(
|
|
|
123
123
|
content: prefill,
|
|
124
124
|
sample: prefill[0],
|
|
125
125
|
validators,
|
|
126
|
-
|
|
126
|
+
arrayValidators,
|
|
127
127
|
cancel: true,
|
|
128
128
|
allowAddRow: false,
|
|
129
129
|
})
|
|
@@ -137,14 +137,14 @@ export async function askArray(
|
|
|
137
137
|
message: string = '',
|
|
138
138
|
prefill: string[] = [],
|
|
139
139
|
validators: [(_: string) => boolean, string][] = [[$ => true, '']],
|
|
140
|
-
|
|
140
|
+
arrayValidators: [(_: string[]) => boolean, string][] = [[$ => true, '']]
|
|
141
141
|
): Promise<string[]> {
|
|
142
142
|
let result = await askTable(
|
|
143
143
|
title,
|
|
144
144
|
message,
|
|
145
145
|
[prefill.map($ => ({ value: $ })), [{ value: '' }]],
|
|
146
146
|
validators.map(([fn, err]) => [$ => fn($.value), err]),
|
|
147
|
-
|
|
147
|
+
arrayValidators.map(([fn, err]) => [$ => fn($.pluck('value')), err])
|
|
148
148
|
)
|
|
149
149
|
return result.pluck('value').unmatch([''])
|
|
150
150
|
}
|