@stonecrop/atable 0.4.20 → 0.4.22
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/dist/atable.js +577 -544
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +2 -2
- package/dist/atable.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/src/components/ACell.vue +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/atable",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@vueuse/core": "^13.4.0",
|
|
39
39
|
"pinia": "^3.0.3",
|
|
40
40
|
"vue": "^3.5.17",
|
|
41
|
-
"@stonecrop/themes": "0.4.
|
|
42
|
-
"@stonecrop/utilities": "0.4.
|
|
41
|
+
"@stonecrop/themes": "0.4.22",
|
|
42
|
+
"@stonecrop/utilities": "0.4.22"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-documenter": "^7.26.29",
|
package/src/components/ACell.vue
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:style="cellStyle"
|
|
11
11
|
@focus="onFocus"
|
|
12
12
|
@paste="updateCellData"
|
|
13
|
-
@input="
|
|
13
|
+
@input="debouncedUpdateCellData"
|
|
14
14
|
@click="showModal"
|
|
15
15
|
class="atable-cell"
|
|
16
16
|
:class="cellClasses">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
28
|
import { KeypressHandlers, defaultKeypressHandlers, useKeyboardNav } from '@stonecrop/utilities'
|
|
29
|
-
import { useElementBounding } from '@vueuse/core'
|
|
29
|
+
import { useDebounceFn, useElementBounding } from '@vueuse/core'
|
|
30
30
|
import { computed, type CSSProperties, ref, useTemplateRef } from 'vue'
|
|
31
31
|
|
|
32
32
|
import { createTableStore } from '../stores/table'
|
|
@@ -39,6 +39,7 @@ const {
|
|
|
39
39
|
addNavigation = true,
|
|
40
40
|
tabIndex = 0,
|
|
41
41
|
pinned = false,
|
|
42
|
+
debounce = 300,
|
|
42
43
|
} = defineProps<{
|
|
43
44
|
colIndex: number
|
|
44
45
|
rowIndex: number
|
|
@@ -46,6 +47,7 @@ const {
|
|
|
46
47
|
addNavigation?: boolean | KeypressHandlers
|
|
47
48
|
tabIndex?: number
|
|
48
49
|
pinned?: boolean
|
|
50
|
+
debounce?: number
|
|
49
51
|
}>()
|
|
50
52
|
|
|
51
53
|
const cellRef = useTemplateRef<HTMLTableCellElement>('cell')
|
|
@@ -176,6 +178,8 @@ const updateCellData = (payload: Event) => {
|
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
|
|
181
|
+
const debouncedUpdateCellData = useDebounceFn(updateCellData, debounce)
|
|
182
|
+
|
|
179
183
|
defineExpose({
|
|
180
184
|
currentData,
|
|
181
185
|
})
|