@getdom/studio 0.2.4 → 0.2.5
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.5 - 2026-10-08
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Data grids support `layout="flush"` with application-owned `gutter-class`
|
|
8
|
+
padding, including responsive utilities and CSS variable values. Toolbar,
|
|
9
|
+
footer and outer header/body cell edges align while middle cells retain their
|
|
10
|
+
spacing. Works with ordinary and virtual rows.
|
|
11
|
+
- A copyable full-width article library example documents the layout contract.
|
|
12
|
+
|
|
13
|
+
### Upgrade notes
|
|
14
|
+
|
|
15
|
+
- Existing grids keep their card layout. Applications own the surrounding width
|
|
16
|
+
and negative margins; flush removes side borders, corner rounding and shadow.
|
|
17
|
+
|
|
3
18
|
## 0.2.4 - 2026-10-08
|
|
4
19
|
|
|
5
20
|
Reliable chart hover values and optional sparkline tooltips.
|
package/package.json
CHANGED
|
@@ -7,6 +7,10 @@ defineOptions({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
const props = defineProps({
|
|
10
|
+
gutterClass: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
10
14
|
rows: {
|
|
11
15
|
type: Array,
|
|
12
16
|
default: () => [],
|
|
@@ -168,7 +172,7 @@ function spacerStyle(height) {
|
|
|
168
172
|
v-for="item in renderedRows"
|
|
169
173
|
:key="resolvedRowKey(item.row, item.index)"
|
|
170
174
|
class="group bg-canvas transition hover:bg-secondary/45"
|
|
171
|
-
:class="rowSelected(item.row, item.index) && 'bg-sky-500/5'"
|
|
175
|
+
:class="[rowSelected(item.row, item.index) && 'bg-sky-500/5', gutterClass]"
|
|
172
176
|
:aria-rowindex="item.index + 1"
|
|
173
177
|
:aria-selected="rowSelected(item.row, item.index) || undefined"
|
|
174
178
|
:style="rowStyle()"
|
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
57
|
export const dataGridProps = {
|
|
58
|
+
layout: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: 'card',
|
|
61
|
+
_edit: { description: 'Card keeps the bordered container. Flush removes outer side borders, rounding and shadow; the application owns the surrounding width.', options: ['card', 'flush'] },
|
|
62
|
+
},
|
|
63
|
+
gutterClass: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: 'px-3',
|
|
66
|
+
_edit: { description: 'Horizontal padding classes for flush toolbar, footer and outer cell edges, such as px-4 sm:px-6 or px-[var(--page-gutter)]. Ignored in card layout.' },
|
|
67
|
+
},
|
|
58
68
|
rows: {
|
|
59
69
|
type: Array,
|
|
60
70
|
default: () => [],
|
|
@@ -1178,10 +1188,12 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1178
1188
|
|
|
1179
1189
|
<template>
|
|
1180
1190
|
<section
|
|
1181
|
-
class="dom-data-grid overflow-hidden
|
|
1191
|
+
class="dom-data-grid overflow-hidden border-border bg-canvas text-canvas-fg"
|
|
1192
|
+
:class="layout === 'flush' ? 'border-y' : 'rounded-lg border shadow-sm'"
|
|
1193
|
+
:data-layout="layout"
|
|
1182
1194
|
:aria-labelledby="titleId"
|
|
1183
1195
|
>
|
|
1184
|
-
<header v-if="toolbar" class="border-b border-border bg-secondary/35
|
|
1196
|
+
<header v-if="toolbar" class="border-b border-border bg-secondary/35 py-3" :class="layout === 'flush' ? gutterClass : 'px-3'">
|
|
1185
1197
|
<div class="flex flex-wrap items-center gap-3">
|
|
1186
1198
|
<div class="min-w-0 flex-1">
|
|
1187
1199
|
<h2 :id="titleId" class="truncate text-sm font-semibold tracking-tight text-canvas-fg">{{ title }}</h2>
|
|
@@ -1241,7 +1253,7 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1241
1253
|
</div>
|
|
1242
1254
|
</header>
|
|
1243
1255
|
|
|
1244
|
-
<div ref="scrollViewport" class="overflow-auto pb-3" :style="gridHeightStyle" @scroll="onViewportScroll">
|
|
1256
|
+
<div ref="scrollViewport" class="overflow-auto pb-3" data-grid-viewport :style="gridHeightStyle" @scroll="onViewportScroll">
|
|
1245
1257
|
<table class="w-full table-fixed border-separate border-spacing-0 text-sm" :style="tableStyle">
|
|
1246
1258
|
<colgroup>
|
|
1247
1259
|
<col v-if="selectable" class="w-11" />
|
|
@@ -1254,7 +1266,7 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1254
1266
|
</colgroup>
|
|
1255
1267
|
|
|
1256
1268
|
<thead class="text-xs">
|
|
1257
|
-
<tr v-if="showColumnLetters" class="bg-secondary/60 text-muted-fg">
|
|
1269
|
+
<tr v-if="showColumnLetters" class="bg-secondary/60 text-muted-fg" :class="layout === 'flush' && gutterClass">
|
|
1258
1270
|
<th
|
|
1259
1271
|
v-if="selectable"
|
|
1260
1272
|
class="border-b border-r border-border px-2 py-1.5 font-semibold"
|
|
@@ -1275,7 +1287,7 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1275
1287
|
</th>
|
|
1276
1288
|
</tr>
|
|
1277
1289
|
|
|
1278
|
-
<tr class="bg-canvas text-muted-fg">
|
|
1290
|
+
<tr class="bg-canvas text-muted-fg" :class="layout === 'flush' && gutterClass">
|
|
1279
1291
|
<th
|
|
1280
1292
|
v-if="selectable"
|
|
1281
1293
|
class="border-b border-r border-border px-2 text-center"
|
|
@@ -1506,6 +1518,7 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1506
1518
|
:row-key="rowKey"
|
|
1507
1519
|
:cell-value="cellValue"
|
|
1508
1520
|
:formatted-cell="formattedCell"
|
|
1521
|
+
:gutter-class="layout === 'flush' ? gutterClass : ''"
|
|
1509
1522
|
:cell-align-class="cellAlignClass"
|
|
1510
1523
|
:row-density-class="rowDensityClass"
|
|
1511
1524
|
:selected-keys="internalSelectedKeys"
|
|
@@ -1555,12 +1568,12 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1555
1568
|
</DataGridVirtualRows>
|
|
1556
1569
|
|
|
1557
1570
|
<tbody v-else>
|
|
1558
|
-
<tr v-if="loading">
|
|
1571
|
+
<tr v-if="loading" :class="layout === 'flush' && gutterClass">
|
|
1559
1572
|
<td :colspan="emptyColspan" class="border-b border-border px-4 py-10 text-center text-sm text-muted-fg">
|
|
1560
1573
|
Loading {{ resourceLabel }}...
|
|
1561
1574
|
</td>
|
|
1562
1575
|
</tr>
|
|
1563
|
-
<tr v-else-if="!displayRows.length">
|
|
1576
|
+
<tr v-else-if="!displayRows.length" :class="layout === 'flush' && gutterClass">
|
|
1564
1577
|
<td :colspan="emptyColspan" class="px-4 py-12 text-center text-sm text-muted-fg">
|
|
1565
1578
|
<slot name="empty">{{ emptyText }}</slot>
|
|
1566
1579
|
</td>
|
|
@@ -1570,7 +1583,7 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1570
1583
|
v-for="(row, rowIndex) in displayRows"
|
|
1571
1584
|
:key="rowKey(row, rowIndex)"
|
|
1572
1585
|
class="group bg-canvas transition hover:bg-secondary/45"
|
|
1573
|
-
:class="rowSelected(row, rowIndex) && 'bg-sky-500/5'"
|
|
1586
|
+
:class="[rowSelected(row, rowIndex) && 'bg-sky-500/5', layout === 'flush' && gutterClass]"
|
|
1574
1587
|
:aria-selected="rowSelected(row, rowIndex) || undefined"
|
|
1575
1588
|
@click="emit('row-click', { row, index: rowIndex })"
|
|
1576
1589
|
>
|
|
@@ -1634,10 +1647,35 @@ function onCellComponentAction(row, column, rowIndex, payload) {
|
|
|
1634
1647
|
</table>
|
|
1635
1648
|
</div>
|
|
1636
1649
|
|
|
1637
|
-
<footer class="flex flex-wrap items-center justify-between gap-2 border-t border-border bg-secondary/25
|
|
1650
|
+
<footer class="flex flex-wrap items-center justify-between gap-2 border-t border-border bg-secondary/25 py-2 text-xs text-muted-fg" :class="layout === 'flush' ? gutterClass : 'px-3'">
|
|
1638
1651
|
<span>{{ visibleColumns.length }} columns</span>
|
|
1639
1652
|
<span v-if="internalSelectedKeys.length">{{ internalSelectedKeys.length }} selected</span>
|
|
1640
1653
|
<span v-else>Ready</span>
|
|
1641
1654
|
</footer>
|
|
1642
1655
|
</section>
|
|
1643
1656
|
</template>
|
|
1657
|
+
|
|
1658
|
+
<style scoped>
|
|
1659
|
+
/* Row padding does not affect table layout. Only the two outer cell edges
|
|
1660
|
+
* inherit it, so responsive/custom utility classes remain application-owned.
|
|
1661
|
+
* Direct table ancestry prevents these rules leaking into nested cell content. */
|
|
1662
|
+
[data-layout="flush"] > [data-grid-viewport] > table > :deep(:is(thead, tbody) > tr:not([aria-hidden="true"]) > :is(th, td):first-child) {
|
|
1663
|
+
padding-left: inherit;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
[data-layout="flush"] > [data-grid-viewport] > table > :deep(:is(thead, tbody) > tr:not([aria-hidden="true"]) > :is(th, td):last-child) {
|
|
1667
|
+
padding-right: inherit;
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
/* The sortable header has two inner wrappers; remove their extra edge inset
|
|
1671
|
+
* so the label starts on the same gutter as the toolbar and body cells. */
|
|
1672
|
+
[data-layout="flush"] > [data-grid-viewport] > table > thead > tr > th:first-child > div,
|
|
1673
|
+
[data-layout="flush"] > [data-grid-viewport] > table > thead > tr > th:first-child > div > button {
|
|
1674
|
+
padding-left: 0;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
[data-layout="flush"] > [data-grid-viewport] > table > thead > tr > th:last-child > div:not(.pr-9),
|
|
1678
|
+
[data-layout="flush"] > [data-grid-viewport] > table > thead > tr > th:last-child > div > button {
|
|
1679
|
+
padding-right: 0;
|
|
1680
|
+
}
|
|
1681
|
+
</style>
|
|
@@ -2215,6 +2215,14 @@ export interface DomContextMenuProps {
|
|
|
2215
2215
|
export declare const DomContextMenu: DomComponent<DomContextMenuProps>;
|
|
2216
2216
|
|
|
2217
2217
|
export interface DomDataGridProps {
|
|
2218
|
+
/**
|
|
2219
|
+
* Card keeps the bordered container. Flush removes outer side borders, rounding and shadow; the application owns the surrounding width.
|
|
2220
|
+
*/
|
|
2221
|
+
layout?: "card" | "flush";
|
|
2222
|
+
/**
|
|
2223
|
+
* Horizontal padding classes for flush toolbar, footer and outer cell edges, such as px-4 sm:px-6 or px-[var(--page-gutter)]. Ignored in card layout.
|
|
2224
|
+
*/
|
|
2225
|
+
gutterClass?: string;
|
|
2218
2226
|
/**
|
|
2219
2227
|
* Rows to render. Each row should be a plain object from an API, store, or database result.
|
|
2220
2228
|
*/
|