luna-plus 0.0.22 → 0.0.24
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 +19 -7
- 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,
|
|
@@ -626,9 +624,12 @@
|
|
|
626
624
|
});
|
|
627
625
|
};
|
|
628
626
|
|
|
627
|
+
// Table classes
|
|
628
|
+
const tableClasses = $derived(
|
|
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" : ""}${cls ? ` ${cls}` : ""}`,
|
|
630
|
+
);
|
|
629
631
|
|
|
630
|
-
|
|
631
|
-
const tableStyle = $derived.by(() => {
|
|
632
|
+
const innerWrapperStyle = $derived.by(() => {
|
|
632
633
|
const styles: string[] = [];
|
|
633
634
|
if (height) {
|
|
634
635
|
const h = typeof height === "number" ? `${height}px` : height;
|
|
@@ -641,6 +642,10 @@
|
|
|
641
642
|
return styles.join("; ");
|
|
642
643
|
});
|
|
643
644
|
|
|
645
|
+
const tableElementClasses = $derived(
|
|
646
|
+
`lm-table__table${cls ? ` ${cls}` : ""}`,
|
|
647
|
+
);
|
|
648
|
+
|
|
644
649
|
// Cleanup
|
|
645
650
|
$effect(() => {
|
|
646
651
|
return () => {
|
|
@@ -651,10 +656,17 @@
|
|
|
651
656
|
});
|
|
652
657
|
</script>
|
|
653
658
|
|
|
654
|
-
<div
|
|
659
|
+
<div bind:this={tableRef} class={tableClasses}>
|
|
655
660
|
<Loading visible={loading} lock={false}>
|
|
656
|
-
<div class="lm-table__inner-wrapper" onscroll={handleScroll}>
|
|
657
|
-
<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
|
+
>
|
|
658
670
|
<colgroup>
|
|
659
671
|
{#each columns as column}
|
|
660
672
|
<col style={getColumnWidthStyle(column)} />
|