luna-plus 0.0.23 → 0.0.25
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 +16 -8
- package/package.json +1 -1
package/dist/Table/Table.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { Snippet } from "svelte";
|
|
3
2
|
import type {
|
|
4
3
|
TableProps,
|
|
5
4
|
TableColumn,
|
|
@@ -9,7 +8,6 @@
|
|
|
9
8
|
CellClickEvent,
|
|
10
9
|
SelectionChangeEvent,
|
|
11
10
|
TableActionButton,
|
|
12
|
-
SpanMethodResult,
|
|
13
11
|
SelectEvent,
|
|
14
12
|
SelectAllEvent,
|
|
15
13
|
CellMouseEvent,
|
|
@@ -628,11 +626,10 @@
|
|
|
628
626
|
|
|
629
627
|
// Table classes
|
|
630
628
|
const tableClasses = $derived(
|
|
631
|
-
`lm-table${border ? " lm-table--border" : ""}${stripe ? " lm-table--striped" : ""}${size !== "default" ? ` lm-table--${size}` : ""}${fit ? " lm-table--fit" : ""}${highlightCurrentRow ? " lm-table--highlight-current-row" : ""}${loading ? " is-loading" : ""}${flexible ? " lm-table--flexible" : ""}${scrollbarAlwaysOn ? " lm-table--scrollbar-always-on" : ""}
|
|
629
|
+
`lm-table${border ? " lm-table--border" : ""}${stripe ? " lm-table--striped" : ""}${size !== "default" ? ` lm-table--${size}` : ""}${fit ? " lm-table--fit" : ""}${highlightCurrentRow ? " lm-table--highlight-current-row" : ""}${loading ? " is-loading" : ""}${flexible ? " lm-table--flexible" : ""}${scrollbarAlwaysOn ? " lm-table--scrollbar-always-on" : ""}`,
|
|
632
630
|
);
|
|
633
631
|
|
|
634
|
-
|
|
635
|
-
const tableStyle = $derived.by(() => {
|
|
632
|
+
const innerWrapperStyle = $derived.by(() => {
|
|
636
633
|
const styles: string[] = [];
|
|
637
634
|
if (height) {
|
|
638
635
|
const h = typeof height === "number" ? `${height}px` : height;
|
|
@@ -645,6 +642,10 @@
|
|
|
645
642
|
return styles.join("; ");
|
|
646
643
|
});
|
|
647
644
|
|
|
645
|
+
const tableElementClasses = $derived(
|
|
646
|
+
`lm-table__table${cls ? ` ${cls}` : ""}`,
|
|
647
|
+
);
|
|
648
|
+
|
|
648
649
|
// Cleanup
|
|
649
650
|
$effect(() => {
|
|
650
651
|
return () => {
|
|
@@ -655,10 +656,17 @@
|
|
|
655
656
|
});
|
|
656
657
|
</script>
|
|
657
658
|
|
|
658
|
-
<div
|
|
659
|
+
<div bind:this={tableRef} class={tableClasses}>
|
|
659
660
|
<Loading visible={loading} lock={false}>
|
|
660
|
-
<div class="lm-table__inner-wrapper" onscroll={handleScroll}>
|
|
661
|
-
<table
|
|
661
|
+
<div class="lm-table__inner-wrapper" style={innerWrapperStyle} onscroll={handleScroll}>
|
|
662
|
+
<table
|
|
663
|
+
{...attrs}
|
|
664
|
+
class={tableElementClasses}
|
|
665
|
+
style:table-layout={tableLayout}
|
|
666
|
+
cellspacing="0"
|
|
667
|
+
cellpadding="0"
|
|
668
|
+
border="0"
|
|
669
|
+
>
|
|
662
670
|
<colgroup>
|
|
663
671
|
{#each columns as column}
|
|
664
672
|
<col style={getColumnWidthStyle(column)} />
|