@columenlabs/lumen-ui 0.1.47 → 0.1.48
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/lumen-view.js +5 -1
- package/package.json +2 -2
package/dist/lumen-view.js
CHANGED
|
@@ -367,6 +367,7 @@ function sortingOf(sort, columns, serverSorts) {
|
|
|
367
367
|
return columns.some((f) => f.key === sort.key) ? [{ id: sort.key, desc: sort.desc }] : [];
|
|
368
368
|
}
|
|
369
369
|
function LumenTableRows({ domain, columns = domain.fields, rows, groupBy = null, chips = [], page = null, inView = false, fit = false, onDetails, tapped, selection, groupActions, sort, onSort, serverSorts, total = true, subgroup = null, add, serverGroups = null, }) {
|
|
370
|
+
const isMobile = useIsMobile();
|
|
370
371
|
const [sorting, setSorting] = useState(() => sortingOf(sort, columns, serverSorts));
|
|
371
372
|
// A saved sort patched while the table is open (the assistant's card move) applies at once.
|
|
372
373
|
const savedSort = JSON.stringify(sort ?? null);
|
|
@@ -555,6 +556,9 @@ function LumenTableRows({ domain, columns = domain.fields, rows, groupBy = null,
|
|
|
555
556
|
const lead = Math.max(1, shown.findIndex((f, i) => i > 0 && rolls(f)) < 0
|
|
556
557
|
? shown.length
|
|
557
558
|
: shown.findIndex((f, i) => i > 0 && rolls(f)));
|
|
559
|
+
// On a phone the hideOnPhone columns are gone, so the label spans only the leading ones still
|
|
560
|
+
// drawn; spanning the hidden ones too pushed the group's totals right of their headers.
|
|
561
|
+
const leadSpan = Math.max(1, lead - (isMobile ? shown.slice(0, lead).filter((f) => f.hideOnPhone).length : 0));
|
|
558
562
|
const rollCell = (f, members) => rollsUp(f) && f.rollRender ? (f.rollRender(members)) : rollsUp(f) ? (_jsx(ViewValueCell, { value: computed.roll(f, members), format: f.aggregate && isCountAgg(f.aggregate) ? 'rounded' : f.format, amount: f.aggregate !== 'count' && f.amount, compact: f.compact })) : null;
|
|
559
563
|
const rollCells = (members) => shown.map((f) => (_jsx(TableCell, { className: colOf(f), children: rollCell(f, members) }, f.key)));
|
|
560
564
|
// A row's chevron opens one level under it, closed by default: its panel, else the view's
|
|
@@ -654,7 +658,7 @@ function LumenTableRows({ domain, columns = domain.fields, rows, groupBy = null,
|
|
|
654
658
|
? true
|
|
655
659
|
: members.some((m) => selection.keys.has(keyOf(m.original)))
|
|
656
660
|
? 'indeterminate'
|
|
657
|
-
: false, onCheckedChange: (on) => toggle(members.map((m) => keyOf(m.original)), on === true), "aria-label": `Select every row of ${key}` }) })), shown.slice(lead - 1).map((f, i) => i === 0 ? (_jsxs(TableCell, { colSpan:
|
|
661
|
+
: false, onCheckedChange: (on) => toggle(members.map((m) => keyOf(m.original)), on === true), "aria-label": `Select every row of ${key}` }) })), shown.slice(lead - 1).map((f, i) => i === 0 ? (_jsxs(TableCell, { colSpan: leadSpan, className: PINNED_GROUP, children: [_jsxs(Button, { variant: "ghost", size: "xs", className: "-mx-2 hover:bg-transparent aria-expanded:bg-transparent", "aria-expanded": open, "aria-label": `${open ? 'Collapse' : 'Expand'} ${key}`, onClick: () => serverGroups
|
|
658
662
|
? serverGroups.onToggle(key)
|
|
659
663
|
: setFlipped((c) => {
|
|
660
664
|
const n = new Set(c);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@columenlabs/lumen-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@codemirror/lang-javascript": "6.2.5",
|
|
42
42
|
"@codemirror/lang-json": "6.0.2",
|
|
43
43
|
"@codemirror/lang-sql": "6.10.0",
|
|
44
|
-
"@columenlabs/lumen-ui-types": "0.1.
|
|
44
|
+
"@columenlabs/lumen-ui-types": "0.1.48",
|
|
45
45
|
"@dnd-kit/core": "6.3.1",
|
|
46
46
|
"@dnd-kit/sortable": "10.0.0",
|
|
47
47
|
"@dnd-kit/utilities": "3.2.2",
|