@d-mok/quasar-app-extension-quasar-axe 3.1.39 → 3.1.41

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.39",
3
+ "version": "3.1.41",
4
4
  "description": "A Quasar App Extension",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -122,30 +122,24 @@ const EmptySchema = v.object(
122
122
  })
123
123
  )
124
124
 
125
- function checkSpec(row: any): boolean {
126
- return v.is(v.union([StandardSchema, EmptySchema]), row)
127
- }
128
-
129
125
  function err(): string | false {
130
- for (let i = 0; i < dummy.value.length; i++) {
131
- if (!checkSpec(dummy.value[i])) {
132
- return [
133
- `row ${i + 1}:`,
134
- 'spec error!',
135
- 'spec sample:',
136
- JSON.stringify(sample),
137
- ].join('<br>')
126
+ let rows = dummy.value
127
+
128
+ for (let i = 0; i < rows.length; i++) {
129
+ let row = rows[i]
130
+ if (v.is(EmptySchema, row)) continue
131
+
132
+ if (!v.is(StandardSchema, row)) {
133
+ return `row ${i + 1} required format:<br/>` + JSON.stringify(sample)
138
134
  }
139
- }
140
- for (let i = 0; i < dummy.value.length; i++) {
135
+
141
136
  for (let [f, msg] of validators) {
142
- if (!f(dummy.value[i])) {
143
- return [`row ${i + 1}:`, msg].join('<br>')
144
- }
137
+ if (!f(row)) return `row ${i + 1}:<br/>` + msg
145
138
  }
146
139
  }
140
+
147
141
  for (let [f, msg] of arrayValidators) {
148
- if (!f(dummy.value)) {
142
+ if (!f(filterBlank(rows))) {
149
143
  return msg
150
144
  }
151
145
  }
@@ -24,14 +24,15 @@
24
24
  import { ref } from 'vue'
25
25
  import { HotTable } from '@handsontable/vue3'
26
26
  import { registerAllModules } from 'handsontable/registry'
27
+ import type Handsontable from 'handsontable'
27
28
 
28
29
  registerAllModules()
29
30
 
30
31
  // handsontable instance
31
32
 
32
- let hotTableComponent = ref()
33
+ let hotTableComponent = ref<InstanceType<typeof HotTable> | null>(null)
33
34
 
34
- function getInstance() {
35
+ function getInstance(): Handsontable {
35
36
  return hotTableComponent.value.hotInstance
36
37
  }
37
38
 
@@ -92,7 +93,7 @@ function afterRemoveRow() {
92
93
  // avoid no row
93
94
  let hot = getInstance()
94
95
  if (hot.countRows() === 0) {
95
- hot.alter('insert_row', 1)
96
+ hot.alter('insert_row_above', 1)
96
97
  }
97
98
  }
98
99