poe-svelte-ui-lib 1.2.13 → 1.2.14
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/Table/Table.svelte
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
direction: null,
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
let isAutoscroll = $state(
|
|
34
|
+
let isAutoscroll = $state(false)
|
|
35
35
|
|
|
36
36
|
/* Сортировка столбцов */
|
|
37
37
|
const sortRows = (key: string) => {
|
|
@@ -142,10 +142,15 @@
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
onMount(() => {
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
if (autoscroll) {
|
|
146
|
+
container?.addEventListener('scroll', handleAutoScroll)
|
|
147
|
+
scrollToBottom()
|
|
148
|
+
}
|
|
149
|
+
|
|
147
150
|
return () => {
|
|
148
|
-
|
|
151
|
+
if (autoscroll) {
|
|
152
|
+
container?.removeEventListener('scroll', handleAutoScroll)
|
|
153
|
+
}
|
|
149
154
|
}
|
|
150
155
|
})
|
|
151
156
|
</script>
|
|
@@ -56,19 +56,6 @@
|
|
|
56
56
|
updateProperty('body', newBody, component, onPropertyChange)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
const handleImageUpload = (columnIndex: number, event: Event) => {
|
|
60
|
-
const target = event.target as HTMLInputElement
|
|
61
|
-
const file = target.files?.[0]
|
|
62
|
-
if (!file) return
|
|
63
|
-
|
|
64
|
-
const reader = new FileReader()
|
|
65
|
-
reader.onload = () => {
|
|
66
|
-
const base64WithPrefix = reader.result as string
|
|
67
|
-
updateTableHeader(columnIndex, 'image', { ['src']: base64WithPrefix })
|
|
68
|
-
}
|
|
69
|
-
reader.readAsDataURL(file)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
59
|
const updateButtonProperty = (columnIndex: number, buttonIndex: number, field: string, value: any) => {
|
|
73
60
|
const headers = [...component.properties.header]
|
|
74
61
|
const buttons = [...headers[columnIndex].buttons]
|