@d-mok/quasar-app-extension-quasar-axe 3.1.28 → 3.1.30

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": "3.1.28",
3
+ "version": "3.1.30",
4
4
  "description": "A Quasar App Extension",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -107,15 +107,25 @@ let dummy = ref(content.map($ => clone($, Object.keys(sample))))
107
107
 
108
108
  function checkSpec(row: any): boolean {
109
109
  return v.is(
110
- v.object(
111
- Object.mapValues(sample, val => {
112
- if (typeof val === 'string') return v.string()
113
- if (typeof val === 'number')
114
- return v.union([v.number(), v.nan()])
115
- if (typeof val === 'boolean') return v.boolean()
116
- return v.never('Invalid type:' + val)
117
- })
118
- ),
110
+ v.union([
111
+ v.object(
112
+ Object.mapValues(sample, val => {
113
+ if (typeof val === 'string') return v.string()
114
+ if (typeof val === 'number') return v.number() // not accept NaN
115
+ if (typeof val === 'boolean') return v.boolean()
116
+ return v.never('Invalid type:' + val)
117
+ })
118
+ ),
119
+ v.object(
120
+ Object.mapValues(sample, val => {
121
+ if (typeof val === 'string') return v.literal('')
122
+ if (typeof val === 'number') return v.nan()
123
+ if (typeof val === 'boolean') return v.literal(false)
124
+ return v.never('Invalid type:' + val)
125
+ })
126
+ ),
127
+ ]),
128
+
119
129
  row
120
130
  )
121
131
  }
@@ -123,7 +133,9 @@ function checkSpec(row: any): boolean {
123
133
  function err(): string | false {
124
134
  for (let i = 0; i < dummy.value.length; i++) {
125
135
  if (!checkSpec(dummy.value[i])) {
126
- return `row ${i + 1}: spec error<br>spec:${JSON.stringify(sample)}`
136
+ return `row ${
137
+ i + 1
138
+ }: spec error<br>spec sample:<br>${JSON.stringify(sample)}`
127
139
  }
128
140
  }
129
141
  for (let i = 0; i < dummy.value.length; i++) {
@@ -101,11 +101,6 @@ function afterRemoveRow() {
101
101
  async function afterCopy(data: (string | number | boolean)[][], coords: any) {
102
102
  // fix pasting space as non break space problem
103
103
  let text = data.map(r => r.join('\t')).join('\n')
104
- // // if all cols are copied, add header
105
- // let col = columns()
106
- // if (coords[0].startCol === 0 && coords[0].endCol === col.length - 1) {
107
- // text = col.map($ => $.data).join('\t') + '\n' + text
108
- // }
109
104
  await navigator.clipboard.writeText(text)
110
105
  }
111
106
  </script>