@pathscale/ui 1.1.11 → 1.1.13
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/components/pagination/Pagination.css +121 -0
- package/dist/components/pagination/Pagination.d.ts +8 -2
- package/dist/components/pagination/Pagination.js +113 -7
- package/dist/components/streaming-table/StreamingTable.js +39 -92
- package/dist/components/table/EnhancedTable.d.ts +1 -1
- package/dist/components/table/EnhancedTable.js +68 -51
- package/dist/components/table/{table.css → Table.css} +106 -9
- package/dist/components/table/Table.d.ts +51 -7
- package/dist/components/table/Table.js +220 -28
- package/dist/components/table/index.d.ts +2 -1
- package/dist/components/table/index.js +14 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.pagination {
|
|
3
|
+
display: flex;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 640px) {
|
|
12
|
+
.pagination {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pagination__summary {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 0.5rem;
|
|
21
|
+
align-self: flex-start;
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
opacity: 0.7;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (min-width: 640px) {
|
|
27
|
+
.pagination__summary {
|
|
28
|
+
align-self: center;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.pagination__content {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 0.25rem;
|
|
36
|
+
align-self: flex-start;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (min-width: 640px) {
|
|
40
|
+
.pagination__content {
|
|
41
|
+
align-self: center;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.pagination__item {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pagination__link {
|
|
50
|
+
position: relative;
|
|
51
|
+
isolation: isolate;
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
height: 2.25rem;
|
|
54
|
+
width: 2.25rem;
|
|
55
|
+
transform-origin: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
border-radius: 9999px;
|
|
59
|
+
border: 0;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
color: var(--color-base-content);
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
outline: none;
|
|
66
|
+
user-select: none;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
transition:
|
|
69
|
+
transform 250ms var(--ease-smooth, cubic-bezier(0.22, 1, 0.36, 1)),
|
|
70
|
+
background-color 100ms ease-out,
|
|
71
|
+
box-shadow 100ms ease-out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pagination__link:focus-visible,
|
|
75
|
+
.pagination__link[data-focus-visible="true"] {
|
|
76
|
+
outline: none;
|
|
77
|
+
box-shadow: 0 0 0 2px var(--color-focus, var(--color-accent));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pagination__link:disabled,
|
|
81
|
+
.pagination__link[aria-disabled="true"] {
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (hover: hover) {
|
|
87
|
+
.pagination__link:hover:not(:disabled),
|
|
88
|
+
.pagination__link[data-hovered="true"]:not(:disabled) {
|
|
89
|
+
background-color: var(--color-base-200);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pagination__link:active:not(:disabled),
|
|
94
|
+
.pagination__link[data-pressed="true"]:not(:disabled) {
|
|
95
|
+
background-color: var(--color-base-300);
|
|
96
|
+
transform: scale(0.97);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pagination__link[data-active="true"] {
|
|
100
|
+
background-color: var(--color-base-300);
|
|
101
|
+
color: var(--color-base-content);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.pagination__ellipsis {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
height: 2.25rem;
|
|
107
|
+
width: 2.25rem;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
font-size: 0.875rem;
|
|
111
|
+
opacity: 0.65;
|
|
112
|
+
user-select: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.pagination__link--nav {
|
|
116
|
+
width: auto;
|
|
117
|
+
gap: 0.375rem;
|
|
118
|
+
padding-inline: 0.625rem;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import "./Pagination.css";
|
|
1
2
|
import { type JSX } from "solid-js";
|
|
2
|
-
import {
|
|
3
|
-
export type PaginationProps =
|
|
3
|
+
import type { IComponentBaseProps } from "../types";
|
|
4
|
+
export type PaginationProps = Omit<JSX.HTMLAttributes<HTMLElement>, "onChange"> & IComponentBaseProps & {
|
|
5
|
+
page: number;
|
|
6
|
+
total: number;
|
|
7
|
+
onChange: (page: number) => void;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
};
|
|
4
10
|
declare const Pagination: (props: PaginationProps) => JSX.Element;
|
|
5
11
|
export default Pagination;
|
|
@@ -1,17 +1,123 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import "./Pagination.css";
|
|
2
3
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
3
4
|
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
4
|
-
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(`<nav><div class=pagination__summary data-slot=pagination-summary>Page <!> of </div><ul class=pagination__content data-slot=pagination-content><li class=pagination__item data-slot=pagination-item><button type=button class="pagination__link pagination__link--nav"data-slot=pagination-previous aria-label="Go to previous page"><span aria-hidden=true>\u{2039}</span><span>Previous</span></button></li><li class=pagination__item data-slot=pagination-item><button type=button class="pagination__link pagination__link--nav"data-slot=pagination-next aria-label="Go to next page"><span>Next</span><span aria-hidden=true>\u{203A}`), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<li class=pagination__item data-slot=pagination-item>"), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<button type=button class=pagination__link data-slot=pagination-link>"), _tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(`<span class=pagination__ellipsis data-slot=pagination-ellipsis aria-hidden=true>\u{2026}`);
|
|
6
|
+
const clampPage = (page, total)=>{
|
|
7
|
+
if (!Number.isFinite(page)) return 1;
|
|
8
|
+
return Math.min(Math.max(1, Math.floor(page)), total);
|
|
9
|
+
};
|
|
10
|
+
const getPaginationTokens = (page, total)=>{
|
|
11
|
+
if (total <= 0) return [];
|
|
12
|
+
if (total <= 7) return Array.from({
|
|
13
|
+
length: total
|
|
14
|
+
}, (_, index)=>index + 1);
|
|
15
|
+
if (page <= 4) return [
|
|
16
|
+
1,
|
|
17
|
+
2,
|
|
18
|
+
3,
|
|
19
|
+
4,
|
|
20
|
+
5,
|
|
21
|
+
"ellipsis-right",
|
|
22
|
+
total
|
|
23
|
+
];
|
|
24
|
+
if (page >= total - 3) return [
|
|
25
|
+
1,
|
|
26
|
+
"ellipsis-left",
|
|
27
|
+
total - 4,
|
|
28
|
+
total - 3,
|
|
29
|
+
total - 2,
|
|
30
|
+
total - 1,
|
|
31
|
+
total
|
|
32
|
+
];
|
|
33
|
+
return [
|
|
34
|
+
1,
|
|
35
|
+
"ellipsis-left",
|
|
36
|
+
page - 1,
|
|
37
|
+
page,
|
|
38
|
+
page + 1,
|
|
39
|
+
"ellipsis-right",
|
|
40
|
+
total
|
|
41
|
+
];
|
|
42
|
+
};
|
|
5
43
|
const Pagination = (props)=>{
|
|
6
44
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
7
45
|
"class",
|
|
8
|
-
"className"
|
|
46
|
+
"className",
|
|
47
|
+
"dataTheme",
|
|
48
|
+
"page",
|
|
49
|
+
"total",
|
|
50
|
+
"onChange",
|
|
51
|
+
"isDisabled"
|
|
9
52
|
]);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
53
|
+
const safeTotal = ()=>Math.max(1, Math.floor(local.total || 0));
|
|
54
|
+
const currentPage = ()=>clampPage(local.page, safeTotal());
|
|
55
|
+
const tokens = ()=>getPaginationTokens(currentPage(), safeTotal());
|
|
56
|
+
const disabled = ()=>Boolean(local.isDisabled);
|
|
57
|
+
const handleChange = (nextPage)=>{
|
|
58
|
+
if (disabled()) return;
|
|
59
|
+
const bounded = clampPage(nextPage, safeTotal());
|
|
60
|
+
if (bounded === currentPage()) return;
|
|
61
|
+
local.onChange(bounded);
|
|
62
|
+
};
|
|
63
|
+
return (()=>{
|
|
64
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling, _el$6 = (_el$5.nextSibling, _el$2.nextSibling), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$0 = _el$9.firstChild;
|
|
65
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
66
|
+
"aria-label": "pagination",
|
|
67
|
+
role: "navigation",
|
|
68
|
+
get ["class"] () {
|
|
69
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("pagination", local.class, local.className);
|
|
70
|
+
},
|
|
71
|
+
get ["data-theme"] () {
|
|
72
|
+
return local.dataTheme;
|
|
73
|
+
},
|
|
74
|
+
"data-slot": "pagination"
|
|
75
|
+
}), false, true);
|
|
76
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, currentPage, _el$5);
|
|
77
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, safeTotal, null);
|
|
78
|
+
_el$8.$$click = ()=>handleChange(currentPage() - 1);
|
|
79
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
|
|
80
|
+
get each () {
|
|
81
|
+
return tokens();
|
|
82
|
+
},
|
|
83
|
+
children: (token)=>(()=>{
|
|
84
|
+
var _el$1 = _tmpl$2();
|
|
85
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$1, "number" == typeof token ? (()=>{
|
|
86
|
+
var _el$10 = _tmpl$3();
|
|
87
|
+
_el$10.$$click = ()=>handleChange(token);
|
|
88
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$10, "aria-label", `Go to page ${token}`);
|
|
89
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$10, token);
|
|
90
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
91
|
+
var _v$3 = token === currentPage() ? "true" : void 0, _v$4 = token === currentPage() ? "page" : void 0, _v$5 = disabled();
|
|
92
|
+
_v$3 !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$10, "data-active", _p$.e = _v$3);
|
|
93
|
+
_v$4 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$10, "aria-current", _p$.t = _v$4);
|
|
94
|
+
_v$5 !== _p$.a && (_el$10.disabled = _p$.a = _v$5);
|
|
95
|
+
return _p$;
|
|
96
|
+
}, {
|
|
97
|
+
e: void 0,
|
|
98
|
+
t: void 0,
|
|
99
|
+
a: void 0
|
|
100
|
+
});
|
|
101
|
+
return _el$10;
|
|
102
|
+
})() : _tmpl$4());
|
|
103
|
+
return _el$1;
|
|
104
|
+
})()
|
|
105
|
+
}), _el$9);
|
|
106
|
+
_el$0.$$click = ()=>handleChange(currentPage() + 1);
|
|
107
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
108
|
+
var _v$ = disabled() || currentPage() <= 1, _v$2 = disabled() || currentPage() >= safeTotal();
|
|
109
|
+
_v$ !== _p$.e && (_el$8.disabled = _p$.e = _v$);
|
|
110
|
+
_v$2 !== _p$.t && (_el$0.disabled = _p$.t = _v$2);
|
|
111
|
+
return _p$;
|
|
112
|
+
}, {
|
|
113
|
+
e: void 0,
|
|
114
|
+
t: void 0
|
|
115
|
+
});
|
|
116
|
+
return _el$;
|
|
117
|
+
})();
|
|
15
118
|
};
|
|
16
119
|
const pagination_Pagination = Pagination;
|
|
120
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
121
|
+
"click"
|
|
122
|
+
]);
|
|
17
123
|
export { pagination_Pagination as default };
|
|
@@ -2,11 +2,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web
|
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__table_index_js_3c329fbb__ from "../table/index.js";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE__button_index_js_557db1f7__ from "../button/index.js";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__icon_index_js_1f7a158c__ from "../icon/index.js";
|
|
7
6
|
import * as __WEBPACK_EXTERNAL_MODULE__pagination_index_js_4cbbf7e7__ from "../pagination/index.js";
|
|
8
7
|
import * as __WEBPACK_EXTERNAL_MODULE__createStreamingTableStore_js_f1f78960__ from "./createStreamingTableStore.js";
|
|
9
|
-
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div class=mt-4>"), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><span>");
|
|
10
9
|
const StreamingTable = (props)=>{
|
|
11
10
|
const [local, tableProps] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12
11
|
"data",
|
|
@@ -88,18 +87,18 @@ const StreamingTable = (props)=>{
|
|
|
88
87
|
});
|
|
89
88
|
});
|
|
90
89
|
const getColumnId = (col, index)=>col.id ?? col.accessorKey ?? `column-${index}`;
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
const sortDescriptor = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
91
|
+
const sorting = sortingState();
|
|
92
|
+
if (!sorting.columnId || !sorting.direction) return;
|
|
93
|
+
return {
|
|
94
|
+
column: sorting.columnId,
|
|
95
|
+
direction: "asc" === sorting.direction ? "ascending" : "descending"
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
const handleSortChange = (descriptor)=>{
|
|
100
99
|
setSortingState({
|
|
101
|
-
columnId:
|
|
102
|
-
direction:
|
|
100
|
+
columnId: descriptor.column,
|
|
101
|
+
direction: "ascending" === descriptor.direction ? "asc" : "desc"
|
|
103
102
|
});
|
|
104
103
|
};
|
|
105
104
|
const getSortValue = (row, col)=>{
|
|
@@ -140,17 +139,15 @@ const StreamingTable = (props)=>{
|
|
|
140
139
|
});
|
|
141
140
|
return sorted;
|
|
142
141
|
});
|
|
143
|
-
const renderSortIndicator = (
|
|
144
|
-
if (!local.enableSorting
|
|
145
|
-
|
|
146
|
-
const sorting = sortingState();
|
|
147
|
-
if (sorting.columnId !== columnId || !sorting.direction) return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__icon_index_js_1f7a158c__["default"], {
|
|
142
|
+
const renderSortIndicator = (sortDirection)=>{
|
|
143
|
+
if (!local.enableSorting) return null;
|
|
144
|
+
if (!sortDirection) return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__icon_index_js_1f7a158c__["default"], {
|
|
148
145
|
name: "icon-[mdi-light--unfold-more-horizontal]",
|
|
149
146
|
width: 16,
|
|
150
147
|
height: 16,
|
|
151
148
|
class: "opacity-30"
|
|
152
149
|
});
|
|
153
|
-
return "
|
|
150
|
+
return "ascending" === sortDirection ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__icon_index_js_1f7a158c__["default"], {
|
|
154
151
|
name: "icon-[mdi-light--chevron-up]",
|
|
155
152
|
width: 16,
|
|
156
153
|
height: 16
|
|
@@ -186,22 +183,6 @@ const StreamingTable = (props)=>{
|
|
|
186
183
|
const maxPage = totalPages() - 1;
|
|
187
184
|
if (page >= 0 && page <= maxPage) setCurrentPage(page);
|
|
188
185
|
};
|
|
189
|
-
const nextPage = ()=>goToPage(currentPage() + 1);
|
|
190
|
-
const prevPage = ()=>goToPage(currentPage() - 1);
|
|
191
|
-
const visiblePageNumbers = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
192
|
-
const total = totalPages();
|
|
193
|
-
const current = currentPage();
|
|
194
|
-
const pages = [];
|
|
195
|
-
if (total <= 5) for(let i = 0; i < total; i++)pages.push(i);
|
|
196
|
-
else {
|
|
197
|
-
let start = Math.max(0, current - 2);
|
|
198
|
-
let end = Math.min(total - 1, current + 2);
|
|
199
|
-
if (current < 2) end = Math.min(total - 1, 4);
|
|
200
|
-
else if (current > total - 3) start = Math.max(0, total - 5);
|
|
201
|
-
for(let i = start; i <= end; i++)pages.push(i);
|
|
202
|
-
}
|
|
203
|
-
return pages;
|
|
204
|
-
});
|
|
205
186
|
return (()=>{
|
|
206
187
|
var _el$ = _tmpl$2();
|
|
207
188
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__table_index_js_3c329fbb__["default"], (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(tableProps, {
|
|
@@ -209,6 +190,10 @@ const StreamingTable = (props)=>{
|
|
|
209
190
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__table_index_js_3c329fbb__["default"].ScrollContainer, {
|
|
210
191
|
get children () {
|
|
211
192
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__table_index_js_3c329fbb__["default"].Content, {
|
|
193
|
+
get sortDescriptor () {
|
|
194
|
+
return sortDescriptor();
|
|
195
|
+
},
|
|
196
|
+
onSortChange: handleSortChange,
|
|
212
197
|
get children () {
|
|
213
198
|
return [
|
|
214
199
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__table_index_js_3c329fbb__["default"].Header, {
|
|
@@ -220,16 +205,18 @@ const StreamingTable = (props)=>{
|
|
|
220
205
|
return local.columns;
|
|
221
206
|
},
|
|
222
207
|
children: (col, index)=>{
|
|
208
|
+
const columnId = getColumnId(col, index());
|
|
223
209
|
const isSortable = local.enableSorting && false !== col.enableSorting;
|
|
224
210
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__table_index_js_3c329fbb__["default"].Column, {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
211
|
+
id: columnId,
|
|
212
|
+
allowsSorting: isSortable,
|
|
213
|
+
children: ({ sortDirection })=>(()=>{
|
|
214
|
+
var _el$3 = _tmpl$3(), _el$4 = _el$3.firstChild;
|
|
215
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$3, isSortable ? "flex items-center gap-2 cursor-pointer select-none" : "");
|
|
216
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, ()=>col.header);
|
|
217
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>renderSortIndicator(isSortable ? sortDirection : void 0), null);
|
|
218
|
+
return _el$3;
|
|
219
|
+
})()
|
|
233
220
|
});
|
|
234
221
|
}
|
|
235
222
|
});
|
|
@@ -296,53 +283,16 @@ const StreamingTable = (props)=>{
|
|
|
296
283
|
return enablePagination && totalPages() > 0;
|
|
297
284
|
},
|
|
298
285
|
get children () {
|
|
299
|
-
var _el$2 = _tmpl$()
|
|
300
|
-
_el$6.nextSibling;
|
|
286
|
+
var _el$2 = _tmpl$();
|
|
301
287
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__pagination_index_js_4cbbf7e7__["default"], {
|
|
302
|
-
get
|
|
303
|
-
return
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
size: "sm",
|
|
311
|
-
variant: "ghost",
|
|
312
|
-
children: "\xAB"
|
|
313
|
-
}),
|
|
314
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
|
|
315
|
-
get each () {
|
|
316
|
-
return visiblePageNumbers();
|
|
317
|
-
},
|
|
318
|
-
children: (pageNum)=>{
|
|
319
|
-
const isActive = ()=>pageNum === currentPage();
|
|
320
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__button_index_js_557db1f7__["default"], {
|
|
321
|
-
class: "join-item",
|
|
322
|
-
onClick: ()=>goToPage(pageNum),
|
|
323
|
-
size: "sm",
|
|
324
|
-
get variant () {
|
|
325
|
-
return isActive() ? "primary" : "ghost";
|
|
326
|
-
},
|
|
327
|
-
children: pageNum + 1
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
}),
|
|
331
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__button_index_js_557db1f7__["default"], {
|
|
332
|
-
class: "join-item",
|
|
333
|
-
onClick: nextPage,
|
|
334
|
-
get isDisabled () {
|
|
335
|
-
return currentPage() === totalPages() - 1;
|
|
336
|
-
},
|
|
337
|
-
size: "sm",
|
|
338
|
-
variant: "ghost",
|
|
339
|
-
children: "\xBB"
|
|
340
|
-
})
|
|
341
|
-
];
|
|
342
|
-
}
|
|
343
|
-
}), _el$3);
|
|
344
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>currentPage() + 1, _el$6);
|
|
345
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, totalPages, null);
|
|
288
|
+
get page () {
|
|
289
|
+
return currentPage() + 1;
|
|
290
|
+
},
|
|
291
|
+
get total () {
|
|
292
|
+
return totalPages();
|
|
293
|
+
},
|
|
294
|
+
onChange: (page)=>goToPage(page - 1)
|
|
295
|
+
}));
|
|
346
296
|
return _el$2;
|
|
347
297
|
}
|
|
348
298
|
}), null);
|
|
@@ -351,7 +301,4 @@ const StreamingTable = (props)=>{
|
|
|
351
301
|
})();
|
|
352
302
|
};
|
|
353
303
|
const streaming_table_StreamingTable = StreamingTable;
|
|
354
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
355
|
-
"click"
|
|
356
|
-
]);
|
|
357
304
|
export { streaming_table_StreamingTable as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./Table.css";
|
|
2
2
|
import { type Accessor, type JSX } from "solid-js";
|
|
3
3
|
import { type ColumnDef, type SortingState, type ColumnFiltersState, type PaginationState, type OnChangeFn, type ExpandedState } from "@tanstack/solid-table";
|
|
4
4
|
import { type TableRootProps } from "./Table";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
-
import "./
|
|
2
|
+
import "./Table.css";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__ from "@tanstack/solid-table";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_clsx__ from "clsx";
|
|
@@ -127,6 +127,22 @@ function EnhancedTable_EnhancedTable(props) {
|
|
|
127
127
|
return pageCount > 1 || totalRows > pageSize;
|
|
128
128
|
});
|
|
129
129
|
const headerGroups = ()=>table.getHeaderGroups();
|
|
130
|
+
const sortDescriptor = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
|
|
131
|
+
const activeSort = table.getState().sorting[0];
|
|
132
|
+
if (!activeSort) return;
|
|
133
|
+
return {
|
|
134
|
+
column: activeSort.id,
|
|
135
|
+
direction: activeSort.desc ? "descending" : "ascending"
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
const handleSortChange = (descriptor)=>{
|
|
139
|
+
table.setSorting([
|
|
140
|
+
{
|
|
141
|
+
id: descriptor.column,
|
|
142
|
+
desc: "descending" === descriptor.direction
|
|
143
|
+
}
|
|
144
|
+
]);
|
|
145
|
+
};
|
|
130
146
|
const totalColumns = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>table.getVisibleLeafColumns().length + (local.enableRowSelection ? 1 : 0) + (local.expandable ? 1 : 0));
|
|
131
147
|
const filterTriggerRefs = new Map();
|
|
132
148
|
const [filterPanelStyle, setFilterPanelStyle] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)({
|
|
@@ -322,6 +338,10 @@ function EnhancedTable_EnhancedTable(props) {
|
|
|
322
338
|
get ["class"] () {
|
|
323
339
|
return (0, __WEBPACK_EXTERNAL_MODULE_clsx__["default"])(tableProps.class, "table-auto");
|
|
324
340
|
},
|
|
341
|
+
get sortDescriptor () {
|
|
342
|
+
return sortDescriptor();
|
|
343
|
+
},
|
|
344
|
+
onSortChange: handleSortChange,
|
|
325
345
|
get children () {
|
|
326
346
|
return [
|
|
327
347
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__["default"].Header, {
|
|
@@ -339,6 +359,7 @@ function EnhancedTable_EnhancedTable(props) {
|
|
|
339
359
|
},
|
|
340
360
|
get children () {
|
|
341
361
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__["default"].Column, {
|
|
362
|
+
id: "expand-control",
|
|
342
363
|
class: "w-6"
|
|
343
364
|
});
|
|
344
365
|
}
|
|
@@ -349,6 +370,7 @@ function EnhancedTable_EnhancedTable(props) {
|
|
|
349
370
|
},
|
|
350
371
|
get children () {
|
|
351
372
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__["default"].Column, {
|
|
373
|
+
id: "selection-control",
|
|
352
374
|
class: "w-8",
|
|
353
375
|
get children () {
|
|
354
376
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__checkbox_Checkbox_js_9a9489db__["default"], {
|
|
@@ -375,57 +397,52 @@ function EnhancedTable_EnhancedTable(props) {
|
|
|
375
397
|
const canSort = local.enableSorting && false !== header.column.columnDef.enableSorting && header.column.getCanSort();
|
|
376
398
|
const canFilter = local.enableFilters && false !== header.column.columnDef.enableColumnFilter && header.column.getCanFilter();
|
|
377
399
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__["default"].Column, {
|
|
400
|
+
id: colId,
|
|
401
|
+
allowsSorting: canSort,
|
|
378
402
|
class: canSort ? "relative cursor-pointer select-none" : "relative",
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
return header.column;
|
|
423
|
-
}
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
}), null);
|
|
427
|
-
return _el$13;
|
|
428
|
-
}
|
|
403
|
+
children: ({ sortDirection })=>(()=>{
|
|
404
|
+
var _el$13 = _tmpl$4(), _el$14 = _el$13.firstChild;
|
|
405
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$14, ()=>(0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(header.column.columnDef.header, header.getContext()));
|
|
406
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
407
|
+
when: "ascending" === sortDirection,
|
|
408
|
+
get children () {
|
|
409
|
+
return local.sortAscIcon;
|
|
410
|
+
}
|
|
411
|
+
}), null);
|
|
412
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
413
|
+
when: "descending" === sortDirection,
|
|
414
|
+
get children () {
|
|
415
|
+
return local.sortDescIcon;
|
|
416
|
+
}
|
|
417
|
+
}), null);
|
|
418
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
419
|
+
get when () {
|
|
420
|
+
return canSort && void 0 === sortDirection && local.sortNeutralIcon;
|
|
421
|
+
},
|
|
422
|
+
get children () {
|
|
423
|
+
return local.sortNeutralIcon;
|
|
424
|
+
}
|
|
425
|
+
}), null);
|
|
426
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
427
|
+
when: canFilter,
|
|
428
|
+
get children () {
|
|
429
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(FilterIconTrigger, {
|
|
430
|
+
colId: colId
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}), null);
|
|
434
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
435
|
+
when: canFilter,
|
|
436
|
+
get children () {
|
|
437
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(FilterPanel, {
|
|
438
|
+
get column () {
|
|
439
|
+
return header.column;
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}), null);
|
|
444
|
+
return _el$13;
|
|
445
|
+
})()
|
|
429
446
|
});
|
|
430
447
|
}
|
|
431
448
|
})
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
background-color: var(--color-base-200);
|
|
19
19
|
padding-inline: 0.25rem;
|
|
20
20
|
padding-bottom: 0.25rem;
|
|
21
|
-
border-radius:
|
|
21
|
+
border-radius: 0.75rem;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/* --------------------------------------------------------------------------
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
border-radius: 3px;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
.table__scroll-container::-webkit-scrollbar-thumb:hover {
|
|
48
|
+
background: oklch(0% 0 0 / 0.25);
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
:is([data-theme="dark"], .dark) .table__scroll-container {
|
|
48
52
|
scrollbar-color: oklch(100% 0 0 / 0.15) transparent;
|
|
49
53
|
}
|
|
@@ -52,6 +56,10 @@
|
|
|
52
56
|
background: oklch(100% 0 0 / 0.15);
|
|
53
57
|
}
|
|
54
58
|
|
|
59
|
+
:is([data-theme="dark"], .dark) .table__scroll-container::-webkit-scrollbar-thumb:hover {
|
|
60
|
+
background: oklch(100% 0 0 / 0.25);
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
/* --------------------------------------------------------------------------
|
|
56
64
|
Table Content (<table>)
|
|
57
65
|
-------------------------------------------------------------------------- */
|
|
@@ -94,13 +102,13 @@
|
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
.table-root--secondary .table__column:first-child {
|
|
97
|
-
border-top-left-radius:
|
|
98
|
-
border-bottom-left-radius:
|
|
105
|
+
border-top-left-radius: 0.75rem;
|
|
106
|
+
border-bottom-left-radius: 0.75rem;
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
.table-root--secondary .table__column:last-child {
|
|
102
|
-
border-top-right-radius:
|
|
103
|
-
border-bottom-right-radius:
|
|
110
|
+
border-top-right-radius: 0.75rem;
|
|
111
|
+
border-bottom-right-radius: 0.75rem;
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
.table-root--secondary .table__body tr:first-child td:first-child,
|
|
@@ -187,6 +195,11 @@
|
|
|
187
195
|
}
|
|
188
196
|
}
|
|
189
197
|
|
|
198
|
+
.table__column[data-sort-direction="ascending"],
|
|
199
|
+
.table__column[data-sort-direction="descending"] {
|
|
200
|
+
color: var(--color-base-content);
|
|
201
|
+
}
|
|
202
|
+
|
|
190
203
|
.table__column:focus-visible {
|
|
191
204
|
border-radius: 0.5rem;
|
|
192
205
|
outline: none;
|
|
@@ -197,19 +210,19 @@
|
|
|
197
210
|
Table Body (<tbody>)
|
|
198
211
|
-------------------------------------------------------------------------- */
|
|
199
212
|
.table__body tr:first-child td:first-child {
|
|
200
|
-
border-top-left-radius:
|
|
213
|
+
border-top-left-radius: 0.5rem;
|
|
201
214
|
}
|
|
202
215
|
|
|
203
216
|
.table__body tr:first-child td:last-child {
|
|
204
|
-
border-top-right-radius:
|
|
217
|
+
border-top-right-radius: 0.5rem;
|
|
205
218
|
}
|
|
206
219
|
|
|
207
220
|
.table__body tr:last-child td:first-child {
|
|
208
|
-
border-bottom-left-radius:
|
|
221
|
+
border-bottom-left-radius: 0.5rem;
|
|
209
222
|
}
|
|
210
223
|
|
|
211
224
|
.table__body tr:last-child td:last-child {
|
|
212
|
-
border-bottom-right-radius:
|
|
225
|
+
border-bottom-right-radius: 0.5rem;
|
|
213
226
|
}
|
|
214
227
|
|
|
215
228
|
/* --------------------------------------------------------------------------
|
|
@@ -241,6 +254,10 @@
|
|
|
241
254
|
box-shadow: inset 0 0 0 2px var(--color-accent);
|
|
242
255
|
}
|
|
243
256
|
|
|
257
|
+
.table__row[data-hovered="true"] .table__cell {
|
|
258
|
+
background-color: var(--color-base-200);
|
|
259
|
+
}
|
|
260
|
+
|
|
244
261
|
/* --------------------------------------------------------------------------
|
|
245
262
|
Table Cell (<td>)
|
|
246
263
|
-------------------------------------------------------------------------- */
|
|
@@ -279,4 +296,84 @@
|
|
|
279
296
|
padding-inline: 1rem;
|
|
280
297
|
padding-block: 0.625rem;
|
|
281
298
|
}
|
|
299
|
+
|
|
300
|
+
/* --------------------------------------------------------------------------
|
|
301
|
+
Resizable Container
|
|
302
|
+
-------------------------------------------------------------------------- */
|
|
303
|
+
.table__resizable-container {
|
|
304
|
+
position: relative;
|
|
305
|
+
overflow: auto;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* --------------------------------------------------------------------------
|
|
309
|
+
Column Resizer
|
|
310
|
+
-------------------------------------------------------------------------- */
|
|
311
|
+
.table__column-resizer {
|
|
312
|
+
position: absolute;
|
|
313
|
+
top: 50%;
|
|
314
|
+
right: 0;
|
|
315
|
+
box-sizing: content-box;
|
|
316
|
+
height: 1rem;
|
|
317
|
+
width: 1px;
|
|
318
|
+
padding-inline: 0.5rem;
|
|
319
|
+
transform: translate(50%, -50%);
|
|
320
|
+
border: 0;
|
|
321
|
+
border-radius: 1px;
|
|
322
|
+
background-color: transparent;
|
|
323
|
+
background-clip: content-box;
|
|
324
|
+
cursor: col-resize;
|
|
325
|
+
touch-action: none;
|
|
326
|
+
outline: none;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
330
|
+
.table__column-resizer {
|
|
331
|
+
background-color: color-mix(in oklch, var(--color-base-content) 10%, transparent);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.table__column-resizer[data-hovered="true"],
|
|
336
|
+
.table__column-resizer:hover,
|
|
337
|
+
.table__column-resizer[data-resizing="true"] {
|
|
338
|
+
top: 0;
|
|
339
|
+
height: 100%;
|
|
340
|
+
width: 2px;
|
|
341
|
+
transform: translateX(50%);
|
|
342
|
+
background-color: var(--color-accent);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.table__column-resizer[data-focus-visible="true"],
|
|
346
|
+
.table__column-resizer:focus-visible {
|
|
347
|
+
top: 0;
|
|
348
|
+
height: 100%;
|
|
349
|
+
width: 2px;
|
|
350
|
+
transform: translateX(50%);
|
|
351
|
+
background-color: var(--color-focus, var(--color-accent));
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.table__column:has(.table__column-resizer)::after {
|
|
355
|
+
content: none;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* --------------------------------------------------------------------------
|
|
359
|
+
Load More
|
|
360
|
+
-------------------------------------------------------------------------- */
|
|
361
|
+
.table__load-more td,
|
|
362
|
+
.table__load-more [role="rowheader"] {
|
|
363
|
+
padding-block: 0.75rem;
|
|
364
|
+
text-align: center;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.table__load-more td > *,
|
|
368
|
+
.table__load-more [role="rowheader"] > * {
|
|
369
|
+
margin-inline: auto;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.table__load-more-content {
|
|
373
|
+
display: flex;
|
|
374
|
+
align-items: center;
|
|
375
|
+
justify-content: center;
|
|
376
|
+
gap: 0.5rem;
|
|
377
|
+
padding-block: 0.5rem;
|
|
378
|
+
}
|
|
282
379
|
}
|
|
@@ -1,22 +1,62 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { type Component, type JSX } from "solid-js";
|
|
1
|
+
import "./Table.css";
|
|
2
|
+
import { type Accessor, type Component, type JSX } from "solid-js";
|
|
3
3
|
import type { IComponentBaseProps } from "../types";
|
|
4
4
|
type TableVariant = "primary" | "secondary";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type TableSortDirection = "ascending" | "descending";
|
|
6
|
+
type TableSortDescriptor = {
|
|
7
|
+
column: string;
|
|
8
|
+
direction: TableSortDirection;
|
|
7
9
|
};
|
|
10
|
+
type TableColumnRenderProps = {
|
|
11
|
+
sortDirection: TableSortDirection | undefined;
|
|
12
|
+
};
|
|
13
|
+
type TableColumnChildren = JSX.Element | ((props: TableColumnRenderProps) => JSX.Element);
|
|
14
|
+
type TableContextValue = {
|
|
15
|
+
variant: Accessor<TableVariant>;
|
|
16
|
+
};
|
|
17
|
+
type TableContentContextValue = {
|
|
18
|
+
sortDescriptor: Accessor<TableSortDescriptor | undefined>;
|
|
19
|
+
onSortChange?: (descriptor: TableSortDescriptor) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const useTableContext: () => TableContextValue;
|
|
22
|
+
export declare const useTableContentContext: () => TableContentContextValue;
|
|
8
23
|
export type TableRootProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps & {
|
|
9
24
|
variant?: TableVariant;
|
|
10
25
|
};
|
|
26
|
+
declare const TableRoot: Component<TableRootProps>;
|
|
11
27
|
export type TableScrollContainerProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
12
|
-
|
|
28
|
+
declare const TableScrollContainer: Component<TableScrollContainerProps>;
|
|
29
|
+
export type TableContentProps = JSX.HTMLAttributes<HTMLTableElement> & IComponentBaseProps & {
|
|
30
|
+
sortDescriptor?: TableSortDescriptor;
|
|
31
|
+
onSortChange?: (descriptor: TableSortDescriptor) => void;
|
|
32
|
+
};
|
|
33
|
+
declare const TableContent: Component<TableContentProps>;
|
|
13
34
|
export type TableHeaderProps = JSX.HTMLAttributes<HTMLTableSectionElement> & IComponentBaseProps;
|
|
14
|
-
|
|
35
|
+
declare const TableHeader: Component<TableHeaderProps>;
|
|
36
|
+
export type TableColumnProps = Omit<JSX.ThHTMLAttributes<HTMLTableCellElement>, "id" | "children"> & IComponentBaseProps & {
|
|
37
|
+
id: string;
|
|
38
|
+
allowsSorting?: boolean;
|
|
39
|
+
children?: TableColumnChildren;
|
|
40
|
+
};
|
|
41
|
+
declare const TableColumn: Component<TableColumnProps>;
|
|
15
42
|
export type TableBodyProps = JSX.HTMLAttributes<HTMLTableSectionElement> & IComponentBaseProps;
|
|
43
|
+
declare const TableBody: Component<TableBodyProps>;
|
|
16
44
|
export type TableRowProps = JSX.HTMLAttributes<HTMLTableRowElement> & IComponentBaseProps;
|
|
45
|
+
declare const TableRow: Component<TableRowProps>;
|
|
17
46
|
export type TableCellProps = JSX.TdHTMLAttributes<HTMLTableCellElement> & IComponentBaseProps;
|
|
47
|
+
declare const TableCell: Component<TableCellProps>;
|
|
18
48
|
export type TableFooterProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
19
|
-
|
|
49
|
+
declare const TableFooter: Component<TableFooterProps>;
|
|
50
|
+
export type TableResizableContainerProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
51
|
+
declare const TableResizableContainer: Component<TableResizableContainerProps>;
|
|
52
|
+
export type TableColumnResizerProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
53
|
+
declare const TableColumnResizer: Component<TableColumnResizerProps>;
|
|
54
|
+
export type TableLoadMoreProps = JSX.HTMLAttributes<HTMLTableRowElement> & IComponentBaseProps;
|
|
55
|
+
declare const TableLoadMore: Component<TableLoadMoreProps>;
|
|
56
|
+
export type TableLoadMoreContentProps = JSX.HTMLAttributes<HTMLDivElement> & IComponentBaseProps;
|
|
57
|
+
declare const TableLoadMoreContent: Component<TableLoadMoreContentProps>;
|
|
58
|
+
export type { TableVariant, TableSortDirection, TableSortDescriptor, TableColumnRenderProps, };
|
|
59
|
+
export { TableRoot, TableScrollContainer, TableContent, TableHeader, TableColumn, TableBody, TableRow, TableCell, TableFooter, TableResizableContainer, TableColumnResizer, TableLoadMore, TableLoadMoreContent, };
|
|
20
60
|
declare const _default: Component<TableRootProps> & {
|
|
21
61
|
Root: Component<TableRootProps>;
|
|
22
62
|
ScrollContainer: Component<TableScrollContainerProps>;
|
|
@@ -27,5 +67,9 @@ declare const _default: Component<TableRootProps> & {
|
|
|
27
67
|
Row: Component<TableRowProps>;
|
|
28
68
|
Cell: Component<TableCellProps>;
|
|
29
69
|
Footer: Component<TableFooterProps>;
|
|
70
|
+
ResizableContainer: Component<TableResizableContainerProps>;
|
|
71
|
+
ColumnResizer: Component<TableColumnResizerProps>;
|
|
72
|
+
LoadMore: Component<TableLoadMoreProps>;
|
|
73
|
+
LoadMoreContent: Component<TableLoadMoreContentProps>;
|
|
30
74
|
};
|
|
31
75
|
export default _default;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
-
import "./
|
|
2
|
+
import "./Table.css";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
5
|
-
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table>"), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-scroll-container>"), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<table data-slot=table-content>"), _tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<thead data-slot=table-header>"), _tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<th data-slot=table-column>"), _tmpl$6 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tbody data-slot=table-body>"), _tmpl$7 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tr data-slot=table-row>"), _tmpl$8 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<td data-slot=table-cell>"), _tmpl$9 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-footer>");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table>"), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-scroll-container>"), _tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<table data-slot=table-content>"), _tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<thead data-slot=table-header>"), _tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<th data-slot=table-column>"), _tmpl$6 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tbody data-slot=table-body>"), _tmpl$7 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tr data-slot=table-row>"), _tmpl$8 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<td data-slot=table-cell>"), _tmpl$9 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-footer>"), _tmpl$0 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-resizable-container>"), _tmpl$1 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-column-resizer>"), _tmpl$10 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tr data-slot=table-load-more>"), _tmpl$11 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div data-slot=table-load-more-content>");
|
|
6
|
+
const TABLE_VARIANT_CLASS_MAP = {
|
|
7
|
+
primary: "table-root--primary",
|
|
8
|
+
secondary: "table-root--secondary"
|
|
9
|
+
};
|
|
10
|
+
const TableContext = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createContext)();
|
|
11
|
+
const TableContentContext = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createContext)();
|
|
12
|
+
const useTableContext = ()=>{
|
|
13
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(TableContext);
|
|
14
|
+
if (context) return context;
|
|
15
|
+
return {
|
|
16
|
+
variant: ()=>"primary"
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const useTableContentContext = ()=>{
|
|
20
|
+
const context = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.useContext)(TableContentContext);
|
|
21
|
+
if (context) return context;
|
|
22
|
+
return {
|
|
23
|
+
sortDescriptor: ()=>void 0
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const invokeEventHandler = (handler, event)=>{
|
|
27
|
+
if ("function" == typeof handler) return void handler(event);
|
|
28
|
+
if (Array.isArray(handler) && "function" == typeof handler[0]) handler[0](handler[1], event);
|
|
29
|
+
};
|
|
10
30
|
const TableRoot = (props)=>{
|
|
11
31
|
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
12
32
|
"children",
|
|
@@ -18,18 +38,19 @@ const TableRoot = (props)=>{
|
|
|
18
38
|
const variant = ()=>local.variant ?? "primary";
|
|
19
39
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(TableContext.Provider, {
|
|
20
40
|
value: {
|
|
21
|
-
|
|
22
|
-
return variant();
|
|
23
|
-
}
|
|
41
|
+
variant
|
|
24
42
|
},
|
|
25
43
|
get children () {
|
|
26
44
|
var _el$ = _tmpl$();
|
|
27
45
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
28
46
|
get ["class"] () {
|
|
29
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table-root",
|
|
47
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table-root", TABLE_VARIANT_CLASS_MAP[variant()], local.class, local.className);
|
|
30
48
|
},
|
|
31
49
|
get ["data-theme"] () {
|
|
32
50
|
return local.dataTheme;
|
|
51
|
+
},
|
|
52
|
+
get ["data-variant"] () {
|
|
53
|
+
return variant();
|
|
33
54
|
}
|
|
34
55
|
}, rest), false, true);
|
|
35
56
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
|
|
@@ -63,21 +84,37 @@ const TableContent = (props)=>{
|
|
|
63
84
|
"children",
|
|
64
85
|
"class",
|
|
65
86
|
"className",
|
|
66
|
-
"dataTheme"
|
|
87
|
+
"dataTheme",
|
|
88
|
+
"sortDescriptor",
|
|
89
|
+
"onSortChange"
|
|
67
90
|
]);
|
|
68
|
-
return ((
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
91
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(TableContentContext.Provider, {
|
|
92
|
+
get value () {
|
|
93
|
+
return {
|
|
94
|
+
sortDescriptor: ()=>local.sortDescriptor,
|
|
95
|
+
onSortChange: local.onSortChange
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
get children () {
|
|
99
|
+
var _el$3 = _tmpl$3();
|
|
100
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
101
|
+
get ["class"] () {
|
|
102
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table__content", local.class, local.className);
|
|
103
|
+
},
|
|
104
|
+
get ["data-theme"] () {
|
|
105
|
+
return local.dataTheme;
|
|
106
|
+
},
|
|
107
|
+
get ["data-sort-column"] () {
|
|
108
|
+
return local.sortDescriptor?.column;
|
|
109
|
+
},
|
|
110
|
+
get ["data-sort-direction"] () {
|
|
111
|
+
return local.sortDescriptor?.direction;
|
|
112
|
+
}
|
|
113
|
+
}, rest), false, true);
|
|
114
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>local.children);
|
|
115
|
+
return _el$3;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
81
118
|
};
|
|
82
119
|
const TableHeader = (props)=>{
|
|
83
120
|
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -101,23 +138,78 @@ const TableHeader = (props)=>{
|
|
|
101
138
|
})();
|
|
102
139
|
};
|
|
103
140
|
const TableColumn = (props)=>{
|
|
141
|
+
const contentContext = useTableContentContext();
|
|
104
142
|
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
143
|
+
"id",
|
|
144
|
+
"allowsSorting",
|
|
105
145
|
"children",
|
|
106
146
|
"class",
|
|
107
147
|
"className",
|
|
108
|
-
"dataTheme"
|
|
148
|
+
"dataTheme",
|
|
149
|
+
"onClick",
|
|
150
|
+
"onKeyDown",
|
|
151
|
+
"tabIndex"
|
|
109
152
|
]);
|
|
153
|
+
const isSortable = ()=>Boolean(local.allowsSorting);
|
|
154
|
+
const sortDirection = ()=>{
|
|
155
|
+
const descriptor = contentContext.sortDescriptor();
|
|
156
|
+
if (!descriptor || descriptor.column !== local.id) return;
|
|
157
|
+
return descriptor.direction;
|
|
158
|
+
};
|
|
159
|
+
const emitSortChange = ()=>{
|
|
160
|
+
if (!isSortable() || !contentContext.onSortChange) return;
|
|
161
|
+
contentContext.onSortChange({
|
|
162
|
+
column: local.id,
|
|
163
|
+
direction: "ascending" === sortDirection() ? "descending" : "ascending"
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
const handleClick = (event)=>{
|
|
167
|
+
invokeEventHandler(local.onClick, event);
|
|
168
|
+
if (event.defaultPrevented) return;
|
|
169
|
+
emitSortChange();
|
|
170
|
+
};
|
|
171
|
+
const handleKeyDown = (event)=>{
|
|
172
|
+
invokeEventHandler(local.onKeyDown, event);
|
|
173
|
+
if (event.defaultPrevented) return;
|
|
174
|
+
if (!isSortable()) return;
|
|
175
|
+
if ("Enter" !== event.key && " " !== event.key) return;
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
emitSortChange();
|
|
178
|
+
};
|
|
179
|
+
const renderedChildren = ()=>{
|
|
180
|
+
if ("function" == typeof local.children) return local.children({
|
|
181
|
+
sortDirection: sortDirection()
|
|
182
|
+
});
|
|
183
|
+
return local.children;
|
|
184
|
+
};
|
|
110
185
|
return (()=>{
|
|
111
186
|
var _el$5 = _tmpl$5();
|
|
187
|
+
_el$5.$$keydown = handleKeyDown;
|
|
188
|
+
_el$5.$$click = handleClick;
|
|
112
189
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
113
190
|
get ["class"] () {
|
|
114
191
|
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table__column", local.class, local.className);
|
|
115
192
|
},
|
|
116
193
|
get ["data-theme"] () {
|
|
117
194
|
return local.dataTheme;
|
|
195
|
+
},
|
|
196
|
+
get ["data-column-id"] () {
|
|
197
|
+
return local.id;
|
|
198
|
+
},
|
|
199
|
+
get ["data-allows-sorting"] () {
|
|
200
|
+
return isSortable() ? "true" : void 0;
|
|
201
|
+
},
|
|
202
|
+
get ["data-sort-direction"] () {
|
|
203
|
+
return sortDirection();
|
|
204
|
+
},
|
|
205
|
+
get ["aria-sort"] () {
|
|
206
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!isSortable())() ? sortDirection() ?? "none" : void 0;
|
|
207
|
+
},
|
|
208
|
+
get tabIndex () {
|
|
209
|
+
return isSortable() ? local.tabIndex ?? 0 : local.tabIndex;
|
|
118
210
|
}
|
|
119
211
|
}, rest), false, true);
|
|
120
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5,
|
|
212
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$5, renderedChildren);
|
|
121
213
|
return _el$5;
|
|
122
214
|
})();
|
|
123
215
|
};
|
|
@@ -205,6 +297,98 @@ const TableFooter = (props)=>{
|
|
|
205
297
|
return _el$9;
|
|
206
298
|
})();
|
|
207
299
|
};
|
|
300
|
+
const TableResizableContainer = (props)=>{
|
|
301
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
302
|
+
"children",
|
|
303
|
+
"class",
|
|
304
|
+
"className",
|
|
305
|
+
"dataTheme"
|
|
306
|
+
]);
|
|
307
|
+
return (()=>{
|
|
308
|
+
var _el$0 = _tmpl$0();
|
|
309
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$0, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
310
|
+
get ["class"] () {
|
|
311
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table__resizable-container", local.class, local.className);
|
|
312
|
+
},
|
|
313
|
+
get ["data-theme"] () {
|
|
314
|
+
return local.dataTheme;
|
|
315
|
+
}
|
|
316
|
+
}, rest), false, true);
|
|
317
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$0, ()=>local.children);
|
|
318
|
+
return _el$0;
|
|
319
|
+
})();
|
|
320
|
+
};
|
|
321
|
+
const TableColumnResizer = (props)=>{
|
|
322
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
323
|
+
"children",
|
|
324
|
+
"class",
|
|
325
|
+
"className",
|
|
326
|
+
"dataTheme",
|
|
327
|
+
"role",
|
|
328
|
+
"aria-orientation"
|
|
329
|
+
]);
|
|
330
|
+
return (()=>{
|
|
331
|
+
var _el$1 = _tmpl$1();
|
|
332
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$1, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
333
|
+
get role () {
|
|
334
|
+
return local.role ?? "separator";
|
|
335
|
+
},
|
|
336
|
+
get ["aria-orientation"] () {
|
|
337
|
+
return local["aria-orientation"] ?? "vertical";
|
|
338
|
+
},
|
|
339
|
+
get ["class"] () {
|
|
340
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table__column-resizer", local.class, local.className);
|
|
341
|
+
},
|
|
342
|
+
get ["data-theme"] () {
|
|
343
|
+
return local.dataTheme;
|
|
344
|
+
}
|
|
345
|
+
}, rest), false, true);
|
|
346
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$1, ()=>local.children);
|
|
347
|
+
return _el$1;
|
|
348
|
+
})();
|
|
349
|
+
};
|
|
350
|
+
const TableLoadMore = (props)=>{
|
|
351
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
352
|
+
"children",
|
|
353
|
+
"class",
|
|
354
|
+
"className",
|
|
355
|
+
"dataTheme"
|
|
356
|
+
]);
|
|
357
|
+
return (()=>{
|
|
358
|
+
var _el$10 = _tmpl$10();
|
|
359
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$10, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
360
|
+
get ["class"] () {
|
|
361
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table__load-more", local.class, local.className);
|
|
362
|
+
},
|
|
363
|
+
get ["data-theme"] () {
|
|
364
|
+
return local.dataTheme;
|
|
365
|
+
}
|
|
366
|
+
}, rest), false, true);
|
|
367
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$10, ()=>local.children);
|
|
368
|
+
return _el$10;
|
|
369
|
+
})();
|
|
370
|
+
};
|
|
371
|
+
const TableLoadMoreContent = (props)=>{
|
|
372
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
373
|
+
"children",
|
|
374
|
+
"class",
|
|
375
|
+
"className",
|
|
376
|
+
"dataTheme"
|
|
377
|
+
]);
|
|
378
|
+
return (()=>{
|
|
379
|
+
var _el$11 = _tmpl$11();
|
|
380
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$11, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
381
|
+
get ["class"] () {
|
|
382
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)("table__load-more-content", local.class, local.className);
|
|
383
|
+
},
|
|
384
|
+
get ["data-theme"] () {
|
|
385
|
+
return local.dataTheme;
|
|
386
|
+
}
|
|
387
|
+
}, rest), false, true);
|
|
388
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$11, ()=>local.children);
|
|
389
|
+
return _el$11;
|
|
390
|
+
})();
|
|
391
|
+
};
|
|
208
392
|
const Table = Object.assign(TableRoot, {
|
|
209
393
|
Root: TableRoot,
|
|
210
394
|
ScrollContainer: TableScrollContainer,
|
|
@@ -214,6 +398,14 @@ const Table = Object.assign(TableRoot, {
|
|
|
214
398
|
Body: TableBody,
|
|
215
399
|
Row: TableRow,
|
|
216
400
|
Cell: TableCell,
|
|
217
|
-
Footer: TableFooter
|
|
401
|
+
Footer: TableFooter,
|
|
402
|
+
ResizableContainer: TableResizableContainer,
|
|
403
|
+
ColumnResizer: TableColumnResizer,
|
|
404
|
+
LoadMore: TableLoadMore,
|
|
405
|
+
LoadMoreContent: TableLoadMoreContent
|
|
218
406
|
});
|
|
219
|
-
|
|
407
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
408
|
+
"click",
|
|
409
|
+
"keydown"
|
|
410
|
+
]);
|
|
411
|
+
export { TableBody, TableCell, TableColumn, TableColumnResizer, TableContent, TableFooter, TableHeader, TableLoadMore, TableLoadMoreContent, TableResizableContainer, TableRoot, TableRow, TableScrollContainer, Table as default, useTableContentContext, useTableContext };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default } from "./Table";
|
|
2
|
-
export
|
|
2
|
+
export { TableRoot, TableScrollContainer, TableContent, TableHeader, TableColumn, TableBody, TableRow, TableCell, TableFooter, TableResizableContainer, TableColumnResizer, TableLoadMore, TableLoadMoreContent, } from "./Table";
|
|
3
|
+
export type { TableRootProps as TableProps, TableRootProps, TableScrollContainerProps, TableContentProps, TableHeaderProps, TableColumnProps, TableBodyProps, TableRowProps, TableCellProps, TableFooterProps, TableResizableContainerProps, TableColumnResizerProps, TableLoadMoreProps, TableLoadMoreContentProps, TableVariant, TableSortDirection, TableSortDescriptor, TableColumnRenderProps, } from "./Table";
|
|
3
4
|
export { default as EnhancedTable } from "./EnhancedTable";
|
|
4
5
|
export type { EnhancedTableProps } from "./EnhancedTable";
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__ from "./Table.js";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__EnhancedTable_js_56868370__ from "./EnhancedTable.js";
|
|
3
3
|
var __webpack_exports__EnhancedTable = __WEBPACK_EXTERNAL_MODULE__EnhancedTable_js_56868370__["default"];
|
|
4
|
+
var __webpack_exports__TableBody = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableBody;
|
|
5
|
+
var __webpack_exports__TableCell = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableCell;
|
|
6
|
+
var __webpack_exports__TableColumn = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableColumn;
|
|
7
|
+
var __webpack_exports__TableColumnResizer = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableColumnResizer;
|
|
8
|
+
var __webpack_exports__TableContent = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableContent;
|
|
9
|
+
var __webpack_exports__TableFooter = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableFooter;
|
|
10
|
+
var __webpack_exports__TableHeader = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableHeader;
|
|
11
|
+
var __webpack_exports__TableLoadMore = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableLoadMore;
|
|
12
|
+
var __webpack_exports__TableLoadMoreContent = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableLoadMoreContent;
|
|
13
|
+
var __webpack_exports__TableResizableContainer = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableResizableContainer;
|
|
14
|
+
var __webpack_exports__TableRoot = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableRoot;
|
|
15
|
+
var __webpack_exports__TableRow = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableRow;
|
|
16
|
+
var __webpack_exports__TableScrollContainer = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__.TableScrollContainer;
|
|
4
17
|
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Table_js_0edb6f6c__["default"];
|
|
5
|
-
export { __webpack_exports__EnhancedTable as EnhancedTable, __webpack_exports__default as default };
|
|
18
|
+
export { __webpack_exports__EnhancedTable as EnhancedTable, __webpack_exports__TableBody as TableBody, __webpack_exports__TableCell as TableCell, __webpack_exports__TableColumn as TableColumn, __webpack_exports__TableColumnResizer as TableColumnResizer, __webpack_exports__TableContent as TableContent, __webpack_exports__TableFooter as TableFooter, __webpack_exports__TableHeader as TableHeader, __webpack_exports__TableLoadMore as TableLoadMore, __webpack_exports__TableLoadMoreContent as TableLoadMoreContent, __webpack_exports__TableResizableContainer as TableResizableContainer, __webpack_exports__TableRoot as TableRoot, __webpack_exports__TableRow as TableRow, __webpack_exports__TableScrollContainer as TableScrollContainer, __webpack_exports__default as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export type { NavbarRowProps } from "./components/navbar/NavbarRow";
|
|
|
88
88
|
export { default as NoiseBackground } from "./components/noise-background";
|
|
89
89
|
export type { NoiseBackgroundProps } from "./components/noise-background";
|
|
90
90
|
export { default as Pagination } from "./components/pagination";
|
|
91
|
+
export type { PaginationProps } from "./components/pagination";
|
|
91
92
|
export { default as PhoneMockup, type PhoneMockupProps, } from "./components/phonemockup";
|
|
92
93
|
export { default as Progress, ProgressRoot, ProgressOutput, ProgressTrack, ProgressFill } from "./components/progress";
|
|
93
94
|
export type { ProgressSize, ProgressColor, ProgressRootProps, ProgressOutputProps, ProgressTrackProps, ProgressFillProps } from "./components/progress";
|
|
@@ -114,7 +115,7 @@ export { default as Steps } from "./components/steps";
|
|
|
114
115
|
export { SvgBackground, type SvgBackgroundProps, } from "./components/svgbackground";
|
|
115
116
|
export { default as Swap } from "./components/swap";
|
|
116
117
|
export { default as Table, EnhancedTable } from "./components/table";
|
|
117
|
-
export type { TableProps } from "./components/table";
|
|
118
|
+
export type { TableProps, TableSortDirection, TableSortDescriptor, TableColumnRenderProps, } from "./components/table";
|
|
118
119
|
export type { EnhancedTableProps } from "./components/table/EnhancedTable";
|
|
119
120
|
export { StreamingTable } from "./components/streaming-table";
|
|
120
121
|
export type { StreamingTableProps } from "./components/streaming-table";
|