@serkonda7/solid-components 0.0.2 → 0.0.4
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/README.md +9 -19
- package/dist/data-table.d.ts +20 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +142 -47
- package/dist/styles.css +104 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @serkonda7/solid-components
|
|
2
2
|
[![CI][ci-badge]][ci-status]
|
|
3
3
|
[![npm version][npm-badge]][npm-link]
|
|
4
|
-
[![npm updated][npm-date-badge]][npm-link]
|
|
4
|
+
[![npm updated and downloads][npm-date-dl-badge]][npm-link]
|
|
5
5
|
|
|
6
6
|
Reusable components for [SolidJS](https://www.solidjs.com/).
|
|
7
7
|
|
|
@@ -14,31 +14,21 @@ bun install @serkonda7/solid-components solid-js
|
|
|
14
14
|
|
|
15
15
|
## 🚀 Usage
|
|
16
16
|
```tsx
|
|
17
|
-
import {
|
|
17
|
+
import { DataTable } from '@serkonda7/solid-components'
|
|
18
18
|
import '@serkonda7/solid-components/styles.css'
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
These components are available:
|
|
22
|
-
- `DataTable` - generic table with optional sorting, row selection, actions, loading, and empty states.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## Components
|
|
26
|
-
### DataTable
|
|
27
|
-
The table does not fetch data or perform navigation.
|
|
28
|
-
Consumers provide the rows, cell rendering, and callbacks:
|
|
29
19
|
|
|
30
|
-
```tsx
|
|
31
20
|
<DataTable
|
|
32
21
|
rows={items}
|
|
33
22
|
getRowId={(item) => item.id}
|
|
34
|
-
columns={[{ key: 'name', label: 'Name'
|
|
35
|
-
sortKey={sortKey}
|
|
36
|
-
sortDirection={sortDirection}
|
|
37
|
-
onSort={setSortKey}
|
|
38
|
-
getCell={(item, column) => column.key === 'name' ? item.name : null}
|
|
23
|
+
columns={[{ key: 'name', label: 'Name' }]}
|
|
39
24
|
/>
|
|
40
25
|
```
|
|
41
26
|
|
|
27
|
+
These components are available:
|
|
28
|
+
- `DataTable` - generic table with optional sorting, row selection, actions, loading, empty states, and column customizer.
|
|
29
|
+
|
|
30
|
+
For the full API, examples, and agent notes, see [docs.md](docs.md).
|
|
31
|
+
|
|
42
32
|
|
|
43
33
|
## 📜 License
|
|
44
34
|
This repo is licensed under the [MIT License](LICENSE.txt).
|
|
@@ -47,5 +37,5 @@ This repo is licensed under the [MIT License](LICENSE.txt).
|
|
|
47
37
|
[ci-badge]: https://github.com/serkonda7/solid-components/actions/workflows/ci.yml/badge.svg
|
|
48
38
|
[ci-status]: https://github.com/serkonda7/solid-components/actions/workflows/ci.yml
|
|
49
39
|
[npm-badge]: https://nodei.co/npm/@serkonda7/solid-components.png?style=shields&data=v&color=blue
|
|
50
|
-
[npm-date-badge]: https://nodei.co/npm/@serkonda7/solid-components.png?style=shields&data=u&color=blue
|
|
40
|
+
[npm-date-dl-badge]: https://nodei.co/npm/@serkonda7/solid-components.png?style=shields&data=u,d&color=blue
|
|
51
41
|
[npm-link]: https://www.npmjs.com/package/@serkonda7/solid-components
|
package/dist/data-table.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { Accessor, JSX } from 'solid-js';
|
|
2
2
|
export type DataTableSortDirection = 'asc' | 'desc';
|
|
3
|
+
export interface DataTableSort {
|
|
4
|
+
key: string;
|
|
5
|
+
direction: DataTableSortDirection;
|
|
6
|
+
}
|
|
3
7
|
export interface DataTableColumn<TRow> {
|
|
4
8
|
key: string;
|
|
5
9
|
label: string;
|
|
6
10
|
sortable?: boolean;
|
|
11
|
+
sortValue?: (row: TRow) => unknown;
|
|
7
12
|
class?: string;
|
|
8
13
|
ariaLabel?: string;
|
|
9
14
|
getValue?: (row: TRow) => JSX.Element;
|
|
15
|
+
/** Whether the column is visible by default when the column customizer is used. Defaults to `true`. */
|
|
16
|
+
defaultVisible?: boolean;
|
|
17
|
+
/** Whether the column can be hidden via the column customizer. Defaults to `true`. Non-toggleable columns are always shown. */
|
|
18
|
+
toggleable?: boolean;
|
|
10
19
|
}
|
|
11
20
|
export interface DataTableProps<TRow> {
|
|
12
21
|
rows: TRow[] | Accessor<TRow[]>;
|
|
@@ -19,7 +28,18 @@ export interface DataTableProps<TRow> {
|
|
|
19
28
|
selectionLabel?: string;
|
|
20
29
|
sortKey?: string | Accessor<string | undefined>;
|
|
21
30
|
sortDirection?: DataTableSortDirection | Accessor<DataTableSortDirection>;
|
|
31
|
+
defaultSort?: DataTableSort;
|
|
22
32
|
onSort?: (key: string) => void;
|
|
33
|
+
onSortClear?: () => void;
|
|
34
|
+
onSortChange?: (sort: DataTableSort | undefined) => void;
|
|
35
|
+
visibleColumns?: string[] | Accessor<string[]>;
|
|
36
|
+
defaultVisibleColumns?: string[];
|
|
37
|
+
onVisibleColumnsChange?: (visibleKeys: string[]) => void;
|
|
38
|
+
showColumnCustomizer?: boolean | Accessor<boolean>;
|
|
39
|
+
columnCustomizerLabel?: string;
|
|
40
|
+
columnCustomizerTitle?: string;
|
|
41
|
+
columnCustomizerShowAllLabel?: string;
|
|
42
|
+
columnCustomizerResetLabel?: string;
|
|
23
43
|
loading?: boolean | Accessor<boolean>;
|
|
24
44
|
empty?: boolean | Accessor<boolean>;
|
|
25
45
|
loadingContent?: JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Add components here as they are implemented so consumers can import them
|
|
5
5
|
* from the package root.
|
|
6
6
|
*/
|
|
7
|
-
export { DataTable, type DataTableColumn, type DataTableProps, type DataTableSortDirection, } from './data-table';
|
|
7
|
+
export { DataTable, type DataTableColumn, type DataTableProps, type DataTableSort, type DataTableSortDirection, } from './data-table';
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,134 @@
|
|
|
1
1
|
import { className as e, createComponent as t, delegateEvents as n, effect as r, insert as i, memo as a, setAttribute as o, template as s, use as c } from "solid-js/web";
|
|
2
|
-
import { For as l, Show as u, createEffect as d, createMemo as f } from "solid-js";
|
|
2
|
+
import { For as l, Show as u, createEffect as d, createMemo as f, createSignal as p, createUniqueId as m, onCleanup as h } from "solid-js";
|
|
3
3
|
//#region src/data-table.tsx
|
|
4
|
-
var p = /*#__PURE__*/ s("<th class=data-table-checkbox><span class=data-table-visually-hidden>Select rows</span><input type=checkbox>"),
|
|
5
|
-
function
|
|
4
|
+
var g = /*#__PURE__*/ s("<div role=dialog class=data-table-customizer-panel><p class=data-table-customizer-title></p><ul class=data-table-customizer-list></ul><div class=data-table-customizer-actions><button type=button></button><button type=button>"), ee = /*#__PURE__*/ s("<div class=data-table-toolbar><div class=data-table-customizer><button type=button class=data-table-customizer-button aria-haspopup=dialog><span aria-hidden=true>⚙</span> "), _ = /*#__PURE__*/ s("<th class=data-table-checkbox><span class=data-table-visually-hidden>Select rows</span><input type=checkbox>"), te = /*#__PURE__*/ s("<th>Actions"), v = /*#__PURE__*/ s("<div><div class=data-table-scroll><table class=data-table><thead><tr></tr></thead><tbody>"), y = /*#__PURE__*/ s("<li><label class=data-table-customizer-option><input type=checkbox>"), b = /*#__PURE__*/ s("<button type=button class=data-table-sort>"), ne = /*#__PURE__*/ s("<button type=button class=data-table-sort-clear aria-label=\"Clear sorting\"title=\"Clear sorting\">×"), re = /*#__PURE__*/ s("<th>"), ie = /*#__PURE__*/ s("<td class=data-table-checkbox><input type=checkbox>"), x = /*#__PURE__*/ s("<td>"), ae = /*#__PURE__*/ s("<tr>"), S = /*#__PURE__*/ s("<p class=data-table-status>Loading…"), C = /*#__PURE__*/ s("<p class=data-table-status>No results.");
|
|
5
|
+
function w(e) {
|
|
6
6
|
return typeof e == "function" ? e() : e;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
let s = f(() =>
|
|
10
|
-
let e =
|
|
8
|
+
function T(n) {
|
|
9
|
+
let s = f(() => w(n.rows)), T = () => w(n.loading ?? !1), E = () => w(n.selected ?? []), D = n.sortKey !== void 0 || n.sortDirection !== void 0, [O, k] = p(n.defaultSort), A = () => D ? w(n.sortKey ?? void 0) : O()?.key, j = () => D ? w(n.sortDirection ?? "asc") : O()?.direction ?? "asc", M = () => w(n.showColumnCustomizer ?? !1), N = () => n.selected !== void 0 && n.onSelectionChange !== void 0, P = () => {
|
|
10
|
+
let e = E();
|
|
11
11
|
return s().length > 0 && s().every((t) => e.includes(n.getRowId(t)));
|
|
12
|
-
},
|
|
12
|
+
}, F = f(() => n.defaultVisibleColumns ?? n.columns.filter((e) => e.defaultVisible !== !1).map((e) => e.key)), [I, L] = p(void 0), R = () => n.visibleColumns === void 0 ? I() ?? F() : w(n.visibleColumns), z = f(() => new Set(R())), B = f(() => n.columns.filter((e) => e.toggleable === !1 || z().has(e.key))), V = f(() => n.columns.filter((e) => e.toggleable !== !1)), H = f(() => V().map((e) => e.key));
|
|
13
|
+
function U(e, t) {
|
|
14
|
+
return t.sortValue ? t.sortValue(e) : e[t.key];
|
|
15
|
+
}
|
|
16
|
+
function W(e, t) {
|
|
17
|
+
return e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), void 0, { numeric: !0 });
|
|
18
|
+
}
|
|
19
|
+
let G = f(() => {
|
|
20
|
+
let e = s(), t = A();
|
|
21
|
+
if (D || !t) return e;
|
|
22
|
+
let r = n.columns.find((e) => e.key === t);
|
|
23
|
+
if (!r) return e;
|
|
24
|
+
let i = j() === "asc" ? 1 : -1;
|
|
25
|
+
return [...e].sort((e, t) => i * W(U(e, r), U(t, r)));
|
|
26
|
+
});
|
|
27
|
+
function K(e) {
|
|
28
|
+
let t = {
|
|
29
|
+
key: e,
|
|
30
|
+
direction: A() === e && j() === "asc" ? "desc" : "asc"
|
|
31
|
+
};
|
|
32
|
+
D || k(t), n.onSort?.(e), n.onSortChange?.(t);
|
|
33
|
+
}
|
|
34
|
+
function q() {
|
|
35
|
+
D || k(void 0), n.onSortClear?.(), n.onSortChange?.(void 0);
|
|
36
|
+
}
|
|
37
|
+
function oe(e) {
|
|
38
|
+
let t = new Map(n.columns.map((e, t) => [e.key, t]));
|
|
39
|
+
return [...e].sort((e, n) => (t.get(e) ?? 0) - (t.get(n) ?? 0));
|
|
40
|
+
}
|
|
41
|
+
function J(e) {
|
|
42
|
+
let t = oe(e);
|
|
43
|
+
n.visibleColumns === void 0 && L(t), n.onVisibleColumnsChange?.(t);
|
|
44
|
+
}
|
|
45
|
+
function se(e, t) {
|
|
46
|
+
let n = new Set(R());
|
|
47
|
+
t ? n.add(e) : n.delete(e), J(H().filter((e) => n.has(e)));
|
|
48
|
+
}
|
|
49
|
+
function ce() {
|
|
50
|
+
J(H());
|
|
51
|
+
}
|
|
52
|
+
function le() {
|
|
53
|
+
J(F());
|
|
54
|
+
}
|
|
55
|
+
let Y = `${m()}-panel`, [X, Z] = p(!1), Q;
|
|
13
56
|
d(() => {
|
|
14
|
-
|
|
57
|
+
if (!X() || !M()) return;
|
|
58
|
+
function e(e) {
|
|
59
|
+
Q && !Q.contains(e.target) && Z(!1);
|
|
60
|
+
}
|
|
61
|
+
function t(e) {
|
|
62
|
+
e.key === "Escape" && Z(!1);
|
|
63
|
+
}
|
|
64
|
+
document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), h(() => {
|
|
65
|
+
document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
|
|
66
|
+
});
|
|
15
67
|
});
|
|
16
|
-
|
|
68
|
+
let $;
|
|
69
|
+
d(() => {
|
|
70
|
+
$ && ($.indeterminate = E().length > 0 && !P());
|
|
71
|
+
});
|
|
72
|
+
function ue(e) {
|
|
17
73
|
n.onSelectionChange?.(e ? s().map(n.getRowId) : []);
|
|
18
74
|
}
|
|
19
|
-
function
|
|
20
|
-
let r = n.getRowId(e), i =
|
|
75
|
+
function de(e, t) {
|
|
76
|
+
let r = n.getRowId(e), i = E(), a = t ? [...i, r] : i.filter((e) => e !== r);
|
|
21
77
|
n.onSelectionChange?.(a);
|
|
22
78
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
79
|
+
function fe(e) {
|
|
80
|
+
return E().includes(n.getRowId(e));
|
|
81
|
+
}
|
|
82
|
+
function pe(e) {
|
|
83
|
+
return e.toggleable === !1 || z().has(e.key);
|
|
25
84
|
}
|
|
26
|
-
function
|
|
85
|
+
function me(e, t) {
|
|
27
86
|
return n.getCell?.(e, t) ?? t.getValue?.(e) ?? null;
|
|
28
87
|
}
|
|
29
88
|
return (() => {
|
|
30
|
-
var d =
|
|
31
|
-
return i(
|
|
89
|
+
var d = v(), f = d.firstChild, p = f.firstChild.firstChild, m = p.firstChild, h = p.nextSibling;
|
|
90
|
+
return i(d, t(u, {
|
|
91
|
+
get when() {
|
|
92
|
+
return M();
|
|
93
|
+
},
|
|
94
|
+
get children() {
|
|
95
|
+
var e = ee(), a = e.firstChild, s = a.firstChild;
|
|
96
|
+
s.firstChild.nextSibling;
|
|
97
|
+
var d = Q;
|
|
98
|
+
return typeof d == "function" ? c(d, a) : Q = a, s.$$click = () => Z((e) => !e), o(s, "aria-controls", Y), i(s, () => n.columnCustomizerLabel ?? "Columns", null), i(a, t(u, {
|
|
99
|
+
get when() {
|
|
100
|
+
return X();
|
|
101
|
+
},
|
|
102
|
+
get children() {
|
|
103
|
+
var e = g(), a = e.firstChild, s = a.nextSibling, c = s.nextSibling.firstChild, u = c.nextSibling;
|
|
104
|
+
return o(e, "id", Y), i(a, () => n.columnCustomizerTitle ?? "Shown columns"), i(s, t(l, {
|
|
105
|
+
get each() {
|
|
106
|
+
return n.columns;
|
|
107
|
+
},
|
|
108
|
+
children: (e) => (() => {
|
|
109
|
+
var t = y(), n = t.firstChild, a = n.firstChild;
|
|
110
|
+
return a.addEventListener("change", (t) => se(e.key, t.currentTarget.checked)), i(n, () => e.ariaLabel ?? e.label, null), r(() => a.disabled = e.toggleable === !1), r(() => a.checked = pe(e)), t;
|
|
111
|
+
})()
|
|
112
|
+
})), c.$$click = ce, i(c, () => n.columnCustomizerShowAllLabel ?? "Show all"), u.$$click = le, i(u, () => n.columnCustomizerResetLabel ?? "Reset"), r(() => o(e, "aria-label", n.columnCustomizerTitle ?? "Customize columns")), e;
|
|
113
|
+
}
|
|
114
|
+
}), null), r(() => o(s, "aria-expanded", X())), e;
|
|
115
|
+
}
|
|
116
|
+
}), f), i(m, t(u, {
|
|
32
117
|
get when() {
|
|
33
|
-
return
|
|
118
|
+
return N();
|
|
34
119
|
},
|
|
35
120
|
get children() {
|
|
36
|
-
var e =
|
|
37
|
-
t.addEventListener("change", (e) =>
|
|
38
|
-
var i =
|
|
39
|
-
return typeof i == "function" ? c(i, t) :
|
|
121
|
+
var e = _(), t = e.firstChild.nextSibling;
|
|
122
|
+
t.addEventListener("change", (e) => ue(e.currentTarget.checked));
|
|
123
|
+
var i = $;
|
|
124
|
+
return typeof i == "function" ? c(i, t) : $ = t, r(() => o(t, "aria-label", n.selectionLabel ?? "Select all rows")), r(() => t.checked = P()), e;
|
|
40
125
|
}
|
|
41
|
-
}), null), i(
|
|
126
|
+
}), null), i(m, t(l, {
|
|
42
127
|
get each() {
|
|
43
|
-
return
|
|
128
|
+
return B();
|
|
44
129
|
},
|
|
45
130
|
children: (s) => (() => {
|
|
46
|
-
var c =
|
|
131
|
+
var c = re();
|
|
47
132
|
return i(c, t(u, {
|
|
48
133
|
get when() {
|
|
49
134
|
return a(() => !!s.sortable)() && n.onSort;
|
|
@@ -52,76 +137,86 @@ function w(n) {
|
|
|
52
137
|
return s.label;
|
|
53
138
|
},
|
|
54
139
|
get children() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
140
|
+
return [(() => {
|
|
141
|
+
var e = b();
|
|
142
|
+
return e.$$click = () => K(s.key), i(e, () => s.label, null), i(e, (() => {
|
|
143
|
+
var e = a(() => A() === s.key);
|
|
144
|
+
return () => e() ? j() === "asc" ? " ▲" : " ▼" : "";
|
|
145
|
+
})(), null), e;
|
|
146
|
+
})(), t(u, {
|
|
147
|
+
get when() {
|
|
148
|
+
return a(() => A() === s.key)() && (!D || n.onSortClear || n.onSortChange);
|
|
149
|
+
},
|
|
150
|
+
get children() {
|
|
151
|
+
var e = ne();
|
|
152
|
+
return e.$$click = q, e;
|
|
153
|
+
}
|
|
154
|
+
})];
|
|
60
155
|
}
|
|
61
156
|
})), r((t) => {
|
|
62
|
-
var n = s.class, r = s.sortable ?
|
|
157
|
+
var n = s.class, r = s.sortable ? A() === s.key ? j() === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
63
158
|
return n !== t.e && e(c, t.e = n), r !== t.t && o(c, "aria-sort", t.t = r), t;
|
|
64
159
|
}, {
|
|
65
160
|
e: void 0,
|
|
66
161
|
t: void 0
|
|
67
162
|
}), c;
|
|
68
163
|
})()
|
|
69
|
-
}), null), i(
|
|
164
|
+
}), null), i(m, t(u, {
|
|
70
165
|
get when() {
|
|
71
166
|
return n.rowActions;
|
|
72
167
|
},
|
|
73
168
|
get children() {
|
|
74
|
-
return
|
|
169
|
+
return te();
|
|
75
170
|
}
|
|
76
|
-
}), null), i(
|
|
171
|
+
}), null), i(h, t(l, {
|
|
77
172
|
get each() {
|
|
78
|
-
return
|
|
173
|
+
return G();
|
|
79
174
|
},
|
|
80
175
|
children: (a) => (() => {
|
|
81
|
-
var s =
|
|
176
|
+
var s = ae();
|
|
82
177
|
return i(s, t(u, {
|
|
83
178
|
get when() {
|
|
84
|
-
return
|
|
179
|
+
return N();
|
|
85
180
|
},
|
|
86
181
|
get children() {
|
|
87
|
-
var e =
|
|
88
|
-
return t.addEventListener("change", (e) =>
|
|
182
|
+
var e = ie(), t = e.firstChild;
|
|
183
|
+
return t.addEventListener("change", (e) => de(a, e.currentTarget.checked)), r(() => o(t, "aria-label", `Select row ${n.getRowId(a)}`)), r(() => t.checked = fe(a)), e;
|
|
89
184
|
}
|
|
90
185
|
}), null), i(s, t(l, {
|
|
91
186
|
get each() {
|
|
92
|
-
return
|
|
187
|
+
return B();
|
|
93
188
|
},
|
|
94
189
|
children: (t) => (() => {
|
|
95
|
-
var n =
|
|
96
|
-
return i(n, () =>
|
|
190
|
+
var n = x();
|
|
191
|
+
return i(n, () => me(a, t)), r(() => e(n, t.class)), n;
|
|
97
192
|
})()
|
|
98
193
|
}), null), i(s, t(u, {
|
|
99
194
|
get when() {
|
|
100
195
|
return n.rowActions;
|
|
101
196
|
},
|
|
102
197
|
get children() {
|
|
103
|
-
var e =
|
|
198
|
+
var e = x();
|
|
104
199
|
return i(e, () => n.rowActions?.(a)), e;
|
|
105
200
|
}
|
|
106
201
|
}), null), s;
|
|
107
202
|
})()
|
|
108
203
|
})), i(d, t(u, {
|
|
109
204
|
get when() {
|
|
110
|
-
return
|
|
205
|
+
return T();
|
|
111
206
|
},
|
|
112
207
|
get children() {
|
|
113
|
-
return n.loadingContent ??
|
|
208
|
+
return n.loadingContent ?? S();
|
|
114
209
|
}
|
|
115
210
|
}), null), i(d, t(u, {
|
|
116
211
|
get when() {
|
|
117
|
-
return a(() => !
|
|
212
|
+
return a(() => !T())() && (n.empty === void 0 ? s().length === 0 : w(n.empty));
|
|
118
213
|
},
|
|
119
214
|
get children() {
|
|
120
|
-
return n.emptyContent ??
|
|
215
|
+
return n.emptyContent ?? C();
|
|
121
216
|
}
|
|
122
217
|
}), null), r(() => e(d, `data-table-wrap${n.class ? ` ${n.class}` : ""}`)), d;
|
|
123
218
|
})();
|
|
124
219
|
}
|
|
125
220
|
n(["click"]);
|
|
126
221
|
//#endregion
|
|
127
|
-
export {
|
|
222
|
+
export { T as DataTable };
|
package/dist/styles.css
CHANGED
|
@@ -1,7 +1,95 @@
|
|
|
1
1
|
.data-table-wrap {
|
|
2
|
+
/* `color-scheme` is intentionally inherited so `light-dark()` below follows
|
|
3
|
+
the consumer's theme (e.g. the dark example). */
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.data-table-scroll {
|
|
2
7
|
overflow-x: auto;
|
|
3
8
|
}
|
|
4
9
|
|
|
10
|
+
.data-table-toolbar {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: flex-end;
|
|
13
|
+
margin-bottom: 0.5rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.data-table-customizer {
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.data-table-customizer-button {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 0.375rem;
|
|
24
|
+
padding: 0.375rem 0.625rem;
|
|
25
|
+
border: 1px solid
|
|
26
|
+
var(--data-table-border, var(--border, light-dark(#d0d0d0, #3a3e45)));
|
|
27
|
+
border-radius: 0.375rem;
|
|
28
|
+
background: var(
|
|
29
|
+
--data-table-customizer-bg,
|
|
30
|
+
var(--surface, light-dark(#ffffff, #1d2024))
|
|
31
|
+
);
|
|
32
|
+
color: inherit;
|
|
33
|
+
font: inherit;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.data-table-customizer-button:hover {
|
|
39
|
+
background: var(
|
|
40
|
+
--data-table-customizer-hover-bg,
|
|
41
|
+
var(--surface-hover, light-dark(#f5f5f5, #292d33))
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.data-table-customizer-panel {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: calc(100% + 0.375rem);
|
|
48
|
+
right: 0;
|
|
49
|
+
z-index: 20;
|
|
50
|
+
min-width: 12rem;
|
|
51
|
+
padding: 0.75rem;
|
|
52
|
+
border: 1px solid
|
|
53
|
+
var(--data-table-border, var(--border, light-dark(#d0d0d0, #30343a)));
|
|
54
|
+
border-radius: 0.5rem;
|
|
55
|
+
background: var(
|
|
56
|
+
--data-table-panel-bg,
|
|
57
|
+
var(--surface, light-dark(#ffffff, #1d2024))
|
|
58
|
+
);
|
|
59
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.data-table-customizer-title {
|
|
63
|
+
margin: 0 0 0.5rem;
|
|
64
|
+
font-weight: 600;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.data-table-customizer-list {
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
list-style: none;
|
|
71
|
+
display: grid;
|
|
72
|
+
gap: 0.375rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.data-table-customizer-option {
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: 0.5rem;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.data-table-customizer-option:has(input:disabled) {
|
|
83
|
+
opacity: 0.6;
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.data-table-customizer-actions {
|
|
88
|
+
display: flex;
|
|
89
|
+
gap: 0.5rem;
|
|
90
|
+
margin-top: 0.75rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
5
93
|
.data-table {
|
|
6
94
|
width: 100%;
|
|
7
95
|
max-width: 100%;
|
|
@@ -30,6 +118,22 @@
|
|
|
30
118
|
text-decoration: underline;
|
|
31
119
|
}
|
|
32
120
|
|
|
121
|
+
.data-table-sort-clear {
|
|
122
|
+
margin-left: 0.25rem;
|
|
123
|
+
padding: 0;
|
|
124
|
+
border: none;
|
|
125
|
+
background: transparent;
|
|
126
|
+
color: inherit;
|
|
127
|
+
font: inherit;
|
|
128
|
+
line-height: 1;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.data-table-sort-clear:hover {
|
|
133
|
+
color: var(--data-table-sort-clear-hover, currentColor);
|
|
134
|
+
opacity: 0.7;
|
|
135
|
+
}
|
|
136
|
+
|
|
33
137
|
.data-table-status {
|
|
34
138
|
color: var(--text-secondary, #616161);
|
|
35
139
|
}
|