@d-mok/quasar-app-extension-quasar-axe 1.0.73 → 1.0.76
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/utils/dialog.ts +17 -4
package/package.json
CHANGED
package/src/utils/dialog.ts
CHANGED
|
@@ -287,10 +287,16 @@ class QDialog {
|
|
|
287
287
|
): Promise<T[]> {
|
|
288
288
|
if (sample.length === 0)
|
|
289
289
|
throw 'Dialog askCSV must provide at least one sample object.'
|
|
290
|
-
|
|
290
|
+
|
|
291
|
+
let words = unparseCSV(sample)
|
|
292
|
+
.split('\n')
|
|
293
|
+
.flatMap(l => l.split('\t'))
|
|
294
|
+
let maxWordLength = Math.max(...words.map($ => $.length))
|
|
295
|
+
|
|
296
|
+
let lines = unparseCSV(sample)
|
|
291
297
|
.split('\n')
|
|
292
|
-
.map($ => $.
|
|
293
|
-
let
|
|
298
|
+
.map($ => $.replace('\t', ' '.repeat(maxWordLength + 2)))
|
|
299
|
+
let maxLineLength = Math.max(...lines.map($ => $.length))
|
|
294
300
|
|
|
295
301
|
let csv = await this.baseDialog({
|
|
296
302
|
title,
|
|
@@ -303,8 +309,15 @@ class QDialog {
|
|
|
303
309
|
parseCSV(csv, sample[0]).every(
|
|
304
310
|
$ => schemaEqual($, sample[0]) && isValid($)
|
|
305
311
|
),
|
|
312
|
+
//@ts-ignore // This is a bug from quasar
|
|
313
|
+
style:
|
|
314
|
+
"font-family: 'Courier New', monospace;" +
|
|
315
|
+
'tab-size: ' +
|
|
316
|
+
(maxWordLength + 2),
|
|
317
|
+
rows: Math.min(25, sample.length + 1),
|
|
318
|
+
cols: maxLineLength + 5,
|
|
306
319
|
},
|
|
307
|
-
fullWidth:
|
|
320
|
+
// fullWidth: maxLineLength > 35,
|
|
308
321
|
})
|
|
309
322
|
return parseCSV(csv, sample[0])
|
|
310
323
|
}
|