poe-svelte-ui-lib 1.31.3 → 1.31.5

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.
@@ -235,6 +235,7 @@
235
235
  - Компонент использует Tailwind CSS для адаптивного дизайна
236
236
  - Таблица автоматически адаптируется под размеры контейнера
237
237
  - Используются относительные единицы измерения для обеспечения масштабируемости
238
+ - Размер текста строк задаётся CSS-переменной `--table-font-size` на любом родителе (по умолчанию `13px`), например `style="--table-font-size: 11.5px"` — так потребитель меняет масштаб данных без правки компонента
238
239
 
239
240
  ### Ограничения
240
241
 
@@ -79,6 +79,8 @@
79
79
 
80
80
  const handleScroll = () => {
81
81
  if (!container) return
82
+ /* Контейнер рендерится только при наличии строк, поэтому слушатель — в разметке, а не addEventListener в onMount */
83
+ if (autoscroll) handleAutoScroll()
82
84
  const { scrollTop, clientHeight, scrollHeight } = container
83
85
  if (scrollTop + clientHeight >= scrollHeight - 50 && cursor !== null && loader && !loader()) {
84
86
  getData()
@@ -212,10 +214,7 @@
212
214
  })
213
215
 
214
216
  onMount(() => {
215
- if (autoscroll) {
216
- container?.addEventListener("scroll", handleAutoScroll)
217
- scrollToBottom()
218
- }
217
+ if (autoscroll) scrollToBottom()
219
218
 
220
219
  const handlePageScroll = () => {
221
220
  isDropdownOpen = null
@@ -231,7 +230,6 @@
231
230
  isScrollable = container ? container.scrollHeight > container.clientHeight : false
232
231
 
233
232
  return () => {
234
- container?.removeEventListener("scroll", handleAutoScroll)
235
233
  window.removeEventListener("scroll", handlePageScroll, true)
236
234
  window.removeEventListener("resize", handlePageScroll, true)
237
235
  }
@@ -310,7 +308,7 @@
310
308
  {@const contentArray = typeof column.content === "function" ? column.content(row) : column.content}
311
309
  <div
312
310
  id="rowDiv{i}-{j}"
313
- class="relative grid min-h-7 w-full min-w-0 items-center gap-x-2 px-3 py-1 text-[13px] wrap-break-word
311
+ class="relative grid min-h-7 w-full min-w-0 items-center gap-x-2 px-3 py-1 text-[length:var(--table-font-size,13px)] wrap-break-word
314
312
  {column.align === 'center'
315
313
  ? 'justify-center justify-items-center text-center'
316
314
  : column.align === 'right'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.31.3",
3
+ "version": "1.31.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {