xontable 0.1.3 → 0.1.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 +17 -2
- package/dist/XOnTable.js +1 -1
- package/dist/styles/xontable.base.css +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -139,12 +139,27 @@ Values are `true` / `false`.
|
|
|
139
139
|
|
|
140
140
|
## Column Groups
|
|
141
141
|
|
|
142
|
+
Group columns by giving the same `group` name:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
const columns: ColumnDef<Row>[] = [
|
|
146
|
+
{ key: "name", label: "Name", group: "User" },
|
|
147
|
+
{ key: "active", label: "Active", type: "checkbox", group: "User" },
|
|
148
|
+
{ key: "group", label: "Group", type: "select", group: "Account Details" },
|
|
149
|
+
{ key: "subgroup", label: "Subgroup", type: "select", group: "Account Details" },
|
|
150
|
+
{ key: "city", label: "City", type: "select", group: "Login info" },
|
|
151
|
+
];
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Collapsible groups:
|
|
155
|
+
|
|
142
156
|
```ts
|
|
143
|
-
{ key: "name", label: "Name", group: "User" }
|
|
144
157
|
{ key: "active", label: "Active", group: "User", groupCollapsible: true }
|
|
145
158
|
```
|
|
146
159
|
|
|
147
|
-
|
|
160
|
+
Notes:
|
|
161
|
+
- The top header row shows group labels.
|
|
162
|
+
- If any column in a group has `groupCollapsible: true`, the group is collapsible.
|
|
148
163
|
|
|
149
164
|
## Filters
|
|
150
165
|
Each column header shows a filter icon.
|
package/dist/XOnTable.js
CHANGED
|
@@ -171,7 +171,7 @@ export function XOnTable(props) {
|
|
|
171
171
|
onGridKeyDown(e);
|
|
172
172
|
}, [active.c, active.r, onGridKeyDown, selection]);
|
|
173
173
|
useOutsideClick({ isOpen: filters.filterOpenKey != null, onClose: filters.closeFilter });
|
|
174
|
-
return (_jsxs("div", { className: `xontable-wrap theme-${theme}${readOnly ? " is-readonly" : ""}`, children: [_jsx("textarea", { ref: clipRef, className: "xontable-clip", name: "xontable-clip", "aria-hidden": "true", tabIndex: -1, onCopy: onCopy, onPaste: onPaste, onKeyDown: onGridKeyDownWithCopy, readOnly: true }), _jsx("div", { className:
|
|
174
|
+
return (_jsxs("div", { className: `xontable-wrap theme-${theme}${readOnly ? " is-readonly" : ""}`, children: [_jsx("textarea", { ref: clipRef, className: "xontable-clip", name: "xontable-clip", "aria-hidden": "true", tabIndex: -1, onCopy: onCopy, onPaste: onPaste, onKeyDown: onGridKeyDownWithCopy, readOnly: true }), _jsx("div", { className: `xontable-surface${filters.filterOpenKey ? " is-filter-open" : ""}`, tabIndex: 0, onFocus: (e) => {
|
|
175
175
|
const target = e.target;
|
|
176
176
|
if (target && (target.tagName === "INPUT" || target.tagName === "TEXTAREA"))
|
|
177
177
|
return;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.xontable-wrap { display: block; width: 100%; height: 100%; border: 1px solid #e3e5ea; border-radius: 8px; overflow: hidden; background: #fff; --xontable-range: #1a73e8; --xontable-copy: #1a1a1a; }
|
|
2
|
-
.xontable-surface { outline: none; width: 100%; height: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: #b9c1cd transparent; }
|
|
2
|
+
.xontable-surface { outline: none; width: 100%; height: 100%; min-height: 220px; overflow: auto; scrollbar-width: thin; scrollbar-color: #b9c1cd transparent; }
|
|
3
|
+
.xontable-surface.is-filter-open { overflow-x: auto; overflow-y: visible; }
|
|
3
4
|
.xontable-surface::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
4
5
|
.xontable-surface::-webkit-scrollbar-thumb { background: #b9c1cd; border-radius: 999px; }
|
|
5
6
|
.xontable-surface::-webkit-scrollbar-track { background: transparent; }
|