@rimelight/ui 0.0.56 → 0.0.58
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/package.json +5 -5
- package/src/components/avatar/avatar.theme.ts +58 -1
- package/src/components/avatar/avatar.ts +21 -1
- package/src/components/avatar-group/RLAAvatarGroup.astro +37 -161
- package/src/components/avatar-group/RLSAvatarGroup.tsx +37 -121
- package/src/components/breadcrumb/RLABreadcrumb.astro +59 -196
- package/src/components/breadcrumb/RLSBreadcrumb.tsx +57 -120
- package/src/components/card/RLSCard.tsx +1 -2
- package/src/components/card/RLVCard.vue +1 -2
- package/src/components/carousel/RLACarousel.astro +2 -1
- package/src/components/carousel/RLSCarousel.tsx +3 -11
- package/src/components/chart/RLAChart.astro +211 -219
- package/src/components/dashboard-navbar/RLADashboardNavbar.astro +1 -1
- package/src/components/dashboard-navbar/RLSDashboardNavbar.tsx +1 -15
- package/src/components/dashboard-panel/RLADashboardPanel.astro +1 -1
- package/src/components/dashboard-panel/RLSDashboardPanel.tsx +1 -6
- package/src/components/dashboard-search/RLADashboardSearch.astro +1 -1
- package/src/components/head/UIHead.astro +0 -11
- package/src/components/image/RLAImage.astro +15 -20
- package/src/components/image/RLSImage.tsx +5 -12
- package/src/components/image/image.theme.ts +4 -4
- package/src/components/input-rating/RLAInputRating.astro +19 -14
- package/src/components/input-rating/RLSInputRating.tsx +39 -32
- package/src/components/input-tags/RLAInputTags.astro +27 -137
- package/src/components/layout-grid/RLALayoutGrid.astro +4 -4
- package/src/components/logo/RLALogo.astro +0 -16
- package/src/components/logo/RLSLogo.tsx +1 -8
- package/src/components/marquee/RLAMarquee.astro +55 -62
- package/src/components/page-section/RLAPageSection.astro +2 -2
- package/src/components/progress/RLAProgress.astro +39 -38
- package/src/components/progress/RLSProgress.tsx +16 -5
- package/src/components/progress/progress.theme.ts +1 -1
- package/src/components/scroll-area/RLAScrollArea.astro +4 -5
- package/src/components/scroll-area/RLSScrollArea.tsx +5 -6
- package/src/components/splitter/RLASplitter.astro +217 -230
- package/src/components/splitter/RLSSplitter.tsx +2 -6
- package/src/components/steps/RLASteps.astro +110 -110
- package/src/components/sticky-surface/RLAStickySurface.astro +49 -67
- package/src/components/table/RLATable.astro +16 -46
- package/src/components/tabs/RLATabs.astro +352 -385
- package/src/components/textarea/RLATextarea.astro +1 -2
- package/src/components/theme-selector/RLAThemeSelector.astro +6 -6
- package/src/components/tooltip/RLATooltip.astro +7 -11
|
@@ -121,10 +121,7 @@ const RLSSplitter: Component<RLSSplitterProps> = (allProps) => {
|
|
|
121
121
|
setSizes(next)
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
const
|
|
125
|
-
isHorizontal()
|
|
126
|
-
? { "flex": `0 0 ${size}%` as const, "min-width": "0" }
|
|
127
|
-
: { "flex": `0 0 ${size}%` as const, "min-height": "0" }
|
|
124
|
+
const panelClass = (size: number) => (isHorizontal() ? `w-[${size}%]` : `h-[${size}%]`)
|
|
128
125
|
|
|
129
126
|
return (
|
|
130
127
|
<div
|
|
@@ -139,10 +136,9 @@ const RLSSplitter: Component<RLSSplitterProps> = (allProps) => {
|
|
|
139
136
|
{(size, i) => (
|
|
140
137
|
<>
|
|
141
138
|
<div
|
|
142
|
-
class={resolvedClasses().panel}
|
|
139
|
+
class={`${resolvedClasses().panel} ${panelClass(size)}`}
|
|
143
140
|
data-slot="panel"
|
|
144
141
|
data-resizable-panel={i()}
|
|
145
|
-
style={panelStyle(size)}
|
|
146
142
|
>
|
|
147
143
|
{panelContents()[i()]}
|
|
148
144
|
</div>
|
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { StepsProps } from "./steps"
|
|
3
|
-
import { stepsTheme } from "./steps.theme"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
size = "md",
|
|
9
|
-
...rest
|
|
10
|
-
} = Astro.props as StepsProps
|
|
11
|
-
|
|
12
|
-
const classes = stepsTheme(Astro.props)
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<div class:list={[classes.root, "rl-steps"]} data-slot="root" data-size={size} {...rest}>
|
|
16
|
-
<ol class="rl-steps-list">
|
|
17
|
-
<slot />
|
|
18
|
-
</ol>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<style
|
|
22
|
-
.rl-steps-list {
|
|
23
|
-
list-style: none;
|
|
24
|
-
counter-reset: rl-step 0;
|
|
25
|
-
padding: 0;
|
|
26
|
-
margin: 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.rl-steps-list > li {
|
|
32
|
-
counter-increment: rl-step;
|
|
33
|
-
position: relative;
|
|
34
|
-
padding-left: 2.625rem;
|
|
35
|
-
padding-bottom: 1.75rem;
|
|
36
|
-
margin: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.rl-steps-list > li:last-child {
|
|
40
|
-
padding-bottom: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.rl-steps-list > li::before {
|
|
44
|
-
content: counter(rl-step);
|
|
45
|
-
position: absolute;
|
|
46
|
-
left: 0;
|
|
47
|
-
top: 0.125rem;
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
width: 1.75rem;
|
|
52
|
-
height: 1.75rem;
|
|
53
|
-
border-radius: 9999px;
|
|
54
|
-
font-size: 0.75rem;
|
|
55
|
-
font-weight: 700;
|
|
56
|
-
line-height: 1;
|
|
57
|
-
color: var(--rl-neutral-50);
|
|
58
|
-
background-color: var(--primary, #3b82f6);
|
|
59
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
60
|
-
z-index: 1;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.rl-steps-list > li::after {
|
|
64
|
-
content: '';
|
|
65
|
-
position: absolute;
|
|
66
|
-
left: calc(0.875rem - 1px);
|
|
67
|
-
top: calc(1.75rem + 0.375rem);
|
|
68
|
-
bottom: 0;
|
|
69
|
-
width: 2px;
|
|
70
|
-
background-color: var(--rl-neutral-200);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.rl-steps-list > li:last-child::after {
|
|
74
|
-
display: none;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.rl-steps-list > li > :first-child {
|
|
78
|
-
margin-top: 0;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* size: sm */
|
|
82
|
-
[data-size="sm"] .rl-steps-list > li {
|
|
83
|
-
padding-left: 2rem;
|
|
84
|
-
padding-bottom: 1.25rem;
|
|
85
|
-
}
|
|
86
|
-
[data-size="sm"] .rl-steps-list > li::before {
|
|
87
|
-
width: 1.375rem;
|
|
88
|
-
height: 1.375rem;
|
|
89
|
-
font-size: 0.625rem;
|
|
90
|
-
}
|
|
91
|
-
[data-size="sm"] .rl-steps-list > li::after {
|
|
92
|
-
left: calc(0.6875rem - 1px);
|
|
93
|
-
top: calc(1.375rem + 0.375rem);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/* size: lg */
|
|
97
|
-
[data-size="lg"] .rl-steps-list > li {
|
|
98
|
-
padding-left: 3.25rem;
|
|
99
|
-
padding-bottom: 2.25rem;
|
|
100
|
-
}
|
|
101
|
-
[data-size="lg"] .rl-steps-list > li::before {
|
|
102
|
-
width: 2.25rem;
|
|
103
|
-
height: 2.25rem;
|
|
104
|
-
font-size: 0.875rem;
|
|
105
|
-
}
|
|
106
|
-
[data-size="lg"] .rl-steps-list > li::after {
|
|
107
|
-
left: calc(1.125rem - 1px);
|
|
108
|
-
top: calc(2.25rem + 0.375rem);
|
|
109
|
-
}
|
|
110
|
-
</style>
|
|
1
|
+
---
|
|
2
|
+
import type { StepsProps } from "./steps"
|
|
3
|
+
import { stepsTheme } from "./steps.theme"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
size = "md",
|
|
9
|
+
...rest
|
|
10
|
+
} = Astro.props as StepsProps
|
|
11
|
+
|
|
12
|
+
const classes = stepsTheme(Astro.props)
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<div class:list={[classes.root, "rl-steps"]} data-slot="root" data-size={size} {...rest}>
|
|
16
|
+
<ol class="rl-steps-list">
|
|
17
|
+
<slot />
|
|
18
|
+
</ol>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<style>
|
|
22
|
+
.rl-steps-list {
|
|
23
|
+
list-style: none;
|
|
24
|
+
counter-reset: rl-step 0;
|
|
25
|
+
padding: 0;
|
|
26
|
+
margin: 0;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rl-steps-list > li {
|
|
32
|
+
counter-increment: rl-step;
|
|
33
|
+
position: relative;
|
|
34
|
+
padding-left: 2.625rem;
|
|
35
|
+
padding-bottom: 1.75rem;
|
|
36
|
+
margin: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rl-steps-list > li:last-child {
|
|
40
|
+
padding-bottom: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rl-steps-list > li::before {
|
|
44
|
+
content: counter(rl-step);
|
|
45
|
+
position: absolute;
|
|
46
|
+
left: 0;
|
|
47
|
+
top: 0.125rem;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 1.75rem;
|
|
52
|
+
height: 1.75rem;
|
|
53
|
+
border-radius: 9999px;
|
|
54
|
+
font-size: 0.75rem;
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
line-height: 1;
|
|
57
|
+
color: var(--rl-neutral-50);
|
|
58
|
+
background-color: var(--primary, #3b82f6);
|
|
59
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
60
|
+
z-index: 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.rl-steps-list > li::after {
|
|
64
|
+
content: '';
|
|
65
|
+
position: absolute;
|
|
66
|
+
left: calc(0.875rem - 1px);
|
|
67
|
+
top: calc(1.75rem + 0.375rem);
|
|
68
|
+
bottom: 0;
|
|
69
|
+
width: 2px;
|
|
70
|
+
background-color: var(--rl-neutral-200);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.rl-steps-list > li:last-child::after {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.rl-steps-list > li > :first-child {
|
|
78
|
+
margin-top: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* size: sm */
|
|
82
|
+
[data-size="sm"] .rl-steps-list > li {
|
|
83
|
+
padding-left: 2rem;
|
|
84
|
+
padding-bottom: 1.25rem;
|
|
85
|
+
}
|
|
86
|
+
[data-size="sm"] .rl-steps-list > li::before {
|
|
87
|
+
width: 1.375rem;
|
|
88
|
+
height: 1.375rem;
|
|
89
|
+
font-size: 0.625rem;
|
|
90
|
+
}
|
|
91
|
+
[data-size="sm"] .rl-steps-list > li::after {
|
|
92
|
+
left: calc(0.6875rem - 1px);
|
|
93
|
+
top: calc(1.375rem + 0.375rem);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* size: lg */
|
|
97
|
+
[data-size="lg"] .rl-steps-list > li {
|
|
98
|
+
padding-left: 3.25rem;
|
|
99
|
+
padding-bottom: 2.25rem;
|
|
100
|
+
}
|
|
101
|
+
[data-size="lg"] .rl-steps-list > li::before {
|
|
102
|
+
width: 2.25rem;
|
|
103
|
+
height: 2.25rem;
|
|
104
|
+
font-size: 0.875rem;
|
|
105
|
+
}
|
|
106
|
+
[data-size="lg"] .rl-steps-list > li::after {
|
|
107
|
+
left: calc(1.125rem - 1px);
|
|
108
|
+
top: calc(2.25rem + 0.375rem);
|
|
109
|
+
}
|
|
110
|
+
</style>
|
|
@@ -1,67 +1,49 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { StickySurfaceProps } from "./sticky-surface"
|
|
3
|
-
import { stickySurfaceTheme } from "./sticky-surface.theme"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
offsetTop = 0,
|
|
9
|
-
zIndex = 10,
|
|
10
|
-
stuckShadow = true,
|
|
11
|
-
...rest
|
|
12
|
-
} = Astro.props as StickySurfaceProps
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const classes = stickySurfaceTheme(Astro.props)
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
---
|
|
20
|
-
<div
|
|
21
|
-
class:list={[classes.root,
|
|
22
|
-
data-slot="root"
|
|
23
|
-
{...rest}
|
|
24
|
-
>
|
|
25
|
-
<slot />
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<style
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<style is:inline set:html={`
|
|
51
|
-
@container rla-sticky-${id} scroll-state(stuck: top) {
|
|
52
|
-
.${id} {
|
|
53
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.10), 0 1px 4px 0 rgba(0, 0, 0, 0.06);
|
|
54
|
-
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@media (prefers-color-scheme: dark) {
|
|
59
|
-
@container rla-sticky-${id} scroll-state(stuck: top) {
|
|
60
|
-
.${id} {
|
|
61
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.40), 0 1px 4px 0 rgba(0, 0, 0, 0.20);
|
|
62
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
`} />
|
|
67
|
-
)}
|
|
1
|
+
---
|
|
2
|
+
import type { StickySurfaceProps } from "./sticky-surface"
|
|
3
|
+
import { stickySurfaceTheme } from "./sticky-surface.theme"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
offsetTop = 0,
|
|
9
|
+
zIndex = 10,
|
|
10
|
+
stuckShadow = true,
|
|
11
|
+
...rest
|
|
12
|
+
} = Astro.props as StickySurfaceProps
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const classes = stickySurfaceTheme(Astro.props)
|
|
17
|
+
const topClass = offsetTop === 0 ? "top-0" : `top-[${offsetTop}px]`
|
|
18
|
+
const zClass = `z-[${zIndex}]`
|
|
19
|
+
---
|
|
20
|
+
<div
|
|
21
|
+
class:list={[classes.root, topClass, zClass, "rla-sticky-surface", stuckShadow && "rla-sticky-shadow"]}
|
|
22
|
+
data-slot="root"
|
|
23
|
+
{...rest}
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.rla-sticky-surface {
|
|
30
|
+
container-type: scroll-state;
|
|
31
|
+
container-name: rla-sticky;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@container rla-sticky scroll-state(stuck: top) {
|
|
35
|
+
.rla-sticky-shadow {
|
|
36
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.10), 0 1px 4px 0 rgba(0, 0, 0, 0.06);
|
|
37
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (prefers-color-scheme: dark) {
|
|
42
|
+
@container rla-sticky scroll-state(stuck: top) {
|
|
43
|
+
.rla-sticky-shadow {
|
|
44
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.40), 0 1px 4px 0 rgba(0, 0, 0, 0.20);
|
|
45
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -474,11 +474,11 @@ const hasFooters = visibleColumns.some(
|
|
|
474
474
|
|
|
475
475
|
const showToolbar = searchable || showColumnsToggle || exportable || Astro.slots.has("toolbar")
|
|
476
476
|
|
|
477
|
-
function
|
|
477
|
+
function getPinClass(colId: string): string {
|
|
478
478
|
if (colOffsetLeft[colId] !== undefined)
|
|
479
|
-
return `left
|
|
479
|
+
return `left-[${colOffsetLeft[colId]}px]`
|
|
480
480
|
if (colOffsetRight[colId] !== undefined)
|
|
481
|
-
return `right
|
|
481
|
+
return `right-[${colOffsetRight[colId]}px]`
|
|
482
482
|
return ""
|
|
483
483
|
}
|
|
484
484
|
|
|
@@ -486,20 +486,20 @@ function isPinned(colId: string): boolean {
|
|
|
486
486
|
return colId in colOffsetLeft || colId in colOffsetRight
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
function
|
|
489
|
+
function getColumnSizeClasses(col: TableColumn): string[] {
|
|
490
490
|
const colId = (col.id || col.accessorKey || "") as string
|
|
491
491
|
const sizeVal = columnSizing[colId] ?? col.size
|
|
492
|
-
const
|
|
492
|
+
const classes: string[] = []
|
|
493
493
|
if (sizeVal) {
|
|
494
|
-
|
|
494
|
+
classes.push(typeof sizeVal === "number" ? `w-[${sizeVal}px]` : `w-[${sizeVal}]`)
|
|
495
495
|
}
|
|
496
496
|
if (col.minSize) {
|
|
497
|
-
|
|
497
|
+
classes.push(typeof col.minSize === "number" ? `min-w-[${col.minSize}px]` : `min-w-[${col.minSize}]`)
|
|
498
498
|
}
|
|
499
499
|
if (col.maxSize) {
|
|
500
|
-
|
|
500
|
+
classes.push(typeof col.maxSize === "number" ? `max-w-[${col.maxSize}px]` : `max-w-[${col.maxSize}]`)
|
|
501
501
|
}
|
|
502
|
-
return
|
|
502
|
+
return classes
|
|
503
503
|
}
|
|
504
504
|
---
|
|
505
505
|
|
|
@@ -558,8 +558,7 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
558
558
|
<colgroup>
|
|
559
559
|
{visibleColumns.map((col) => {
|
|
560
560
|
const colId = (col.id || col.accessorKey || "") as string
|
|
561
|
-
|
|
562
|
-
return <col data-col-id={colId} style={sizeStyle || undefined} />
|
|
561
|
+
return <col data-col-id={colId} class:list={[getColumnSizeClasses(col)]} />
|
|
563
562
|
})}
|
|
564
563
|
</colgroup>
|
|
565
564
|
|
|
@@ -580,10 +579,6 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
580
579
|
typeof col.meta?.class?.th === "function"
|
|
581
580
|
? col.meta.class.th(col)
|
|
582
581
|
: col.meta?.class?.th || ""
|
|
583
|
-
const metaThStyle =
|
|
584
|
-
typeof col.meta?.style?.th === "function"
|
|
585
|
-
? col.meta.style.th(col)
|
|
586
|
-
: col.meta?.style?.th || ""
|
|
587
582
|
const canSort =
|
|
588
583
|
col.enableSorting !== false &&
|
|
589
584
|
!!(col.accessorKey || col.id || col.accessorFn) &&
|
|
@@ -595,12 +590,6 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
595
590
|
const sortDir = activeSort ? (activeSort.desc ? "desc" : "asc") : "none"
|
|
596
591
|
const headerSlotName = `${colId}-header`
|
|
597
592
|
|
|
598
|
-
const sizeStyle = getColumnSizeStyle(col)
|
|
599
|
-
const pinStyle = getPinStyle(colId)
|
|
600
|
-
const combinedStyle = [sizeStyle, pinStyle, metaThStyle]
|
|
601
|
-
.filter(Boolean)
|
|
602
|
-
.join("")
|
|
603
|
-
|
|
604
593
|
const headerLabel =
|
|
605
594
|
typeof col.header === "string"
|
|
606
595
|
? col.header
|
|
@@ -616,9 +605,10 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
616
605
|
class:list={[
|
|
617
606
|
classes.th,
|
|
618
607
|
pinned ? "sticky bg-default z-10" : "",
|
|
608
|
+
getPinClass(colId),
|
|
609
|
+
getColumnSizeClasses(col),
|
|
619
610
|
metaThClass
|
|
620
611
|
]}
|
|
621
|
-
style={combinedStyle || undefined}
|
|
622
612
|
data-col-id={colId}
|
|
623
613
|
data-slot="th"
|
|
624
614
|
>
|
|
@@ -731,8 +721,7 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
731
721
|
<tr class={classes.trGroup} data-slot="tr-group" data-group-id={group.id} data-depth={depth}>
|
|
732
722
|
<td
|
|
733
723
|
colspan={Math.max(1, visibleColumns.length)}
|
|
734
|
-
class={classes.tdGroup}
|
|
735
|
-
style={depth ? `padding-left: ${depth * 1.5 + 1}rem;` : undefined}
|
|
724
|
+
class:list={[classes.tdGroup, depth ? `pl-[${depth * 1.5 + 1}rem]` : ""]}
|
|
736
725
|
data-slot="td-group"
|
|
737
726
|
>
|
|
738
727
|
{Astro.slots.has("group-header") ? (
|
|
@@ -762,10 +751,6 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
762
751
|
typeof meta?.class?.tr === "function"
|
|
763
752
|
? meta.class.tr(row)
|
|
764
753
|
: meta?.class?.tr || ""
|
|
765
|
-
const trMetaStyle =
|
|
766
|
-
typeof meta?.style?.tr === "function"
|
|
767
|
-
? meta.style.tr(row)
|
|
768
|
-
: meta?.style?.tr || ""
|
|
769
754
|
const isSelected = row.getIsSelected()
|
|
770
755
|
const isExpanded = row.getIsExpanded()
|
|
771
756
|
const isPinned_ = row.getIsPinned()
|
|
@@ -774,7 +759,6 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
774
759
|
<>
|
|
775
760
|
<tr
|
|
776
761
|
class:list={[classes.tr, trMetaClass]}
|
|
777
|
-
style={trMetaStyle || undefined}
|
|
778
762
|
data-slot="tr"
|
|
779
763
|
data-row-id={row.id}
|
|
780
764
|
data-row-index={row.index}
|
|
@@ -797,10 +781,6 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
797
781
|
typeof col.meta?.class?.td === "function"
|
|
798
782
|
? col.meta.class.td(row)
|
|
799
783
|
: col.meta?.class?.td || ""
|
|
800
|
-
const metaTdStyle =
|
|
801
|
-
typeof col.meta?.style?.td === "function"
|
|
802
|
-
? col.meta.style.td(row)
|
|
803
|
-
: col.meta?.style?.td || ""
|
|
804
784
|
const colSpanVal =
|
|
805
785
|
typeof col.meta?.colspan?.td === "function"
|
|
806
786
|
? col.meta.colspan.td(row)
|
|
@@ -810,17 +790,14 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
810
790
|
? col.meta.rowspan.td(row)
|
|
811
791
|
: col.meta?.rowspan?.td
|
|
812
792
|
|
|
813
|
-
const pinStyle_ = getPinStyle(colId)
|
|
814
|
-
const combinedTdStyle = [pinStyle_, metaTdStyle].filter(Boolean).join("")
|
|
815
|
-
|
|
816
793
|
return (
|
|
817
794
|
<td
|
|
818
795
|
class:list={[
|
|
819
796
|
classes.td,
|
|
820
797
|
pinned ? "sticky bg-default z-10" : "",
|
|
798
|
+
getPinClass(colId),
|
|
821
799
|
metaTdClass
|
|
822
800
|
]}
|
|
823
|
-
style={combinedTdStyle || undefined}
|
|
824
801
|
colspan={colSpanVal}
|
|
825
802
|
rowspan={rowSpanVal}
|
|
826
803
|
data-slot="td"
|
|
@@ -927,10 +904,6 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
927
904
|
typeof col.meta?.class?.td === "function"
|
|
928
905
|
? col.meta.class.td(subRow)
|
|
929
906
|
: col.meta?.class?.td || ""
|
|
930
|
-
const metaTdStyle =
|
|
931
|
-
typeof col.meta?.style?.td === "function"
|
|
932
|
-
? col.meta.style.td(subRow)
|
|
933
|
-
: col.meta?.style?.td || ""
|
|
934
907
|
const colSpanVal =
|
|
935
908
|
typeof col.meta?.colspan?.td === "function"
|
|
936
909
|
? col.meta.colspan.td(subRow)
|
|
@@ -940,18 +913,15 @@ function getColumnSizeStyle(col: TableColumn): string {
|
|
|
940
913
|
? col.meta.rowspan.td(subRow)
|
|
941
914
|
: col.meta?.rowspan?.td
|
|
942
915
|
|
|
943
|
-
const sizeStyle = getColumnSizeStyle(col)
|
|
944
|
-
const pinStyle_ = getPinStyle(colId)
|
|
945
|
-
const combinedTdStyle = [sizeStyle, pinStyle_, metaTdStyle].filter(Boolean).join("")
|
|
946
|
-
|
|
947
916
|
return (
|
|
948
917
|
<td
|
|
949
918
|
class:list={[
|
|
950
919
|
classes.td,
|
|
951
920
|
pinned ? "sticky bg-default z-10" : "",
|
|
921
|
+
getPinClass(colId),
|
|
922
|
+
getColumnSizeClasses(col),
|
|
952
923
|
metaTdClass
|
|
953
924
|
]}
|
|
954
|
-
style={combinedTdStyle || undefined}
|
|
955
925
|
colspan={colSpanVal}
|
|
956
926
|
rowspan={rowSpanVal}
|
|
957
927
|
data-slot="td"
|