argus-table 0.2.2 → 0.4.0
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 +1 -1
- package/dist/argus-column-group.js +66 -0
- package/dist/argus-column-group.js.map +1 -0
- package/dist/argus-column.js +28 -26
- package/dist/argus-column.js.map +1 -1
- package/dist/argus-table.js +1497 -285
- package/dist/argus-table.js.map +1 -1
- package/dist/attributes.js +21 -0
- package/dist/attributes.js.map +1 -0
- package/dist/cdn/argus-table.js +120 -61
- package/dist/cdn/argus-table.js.map +1 -1
- package/dist/column-registry.js +23 -0
- package/dist/column-registry.js.map +1 -0
- package/dist/controllers/auto-width.js +16 -4
- package/dist/controllers/auto-width.js.map +1 -1
- package/dist/controllers/column-children.js +32 -9
- package/dist/controllers/column-children.js.map +1 -1
- package/dist/controllers/column-window.js +135 -0
- package/dist/controllers/column-window.js.map +1 -0
- package/dist/controllers/data-controller.js +9 -4
- package/dist/controllers/data-controller.js.map +1 -1
- package/dist/controllers/plugins.js +121 -0
- package/dist/controllers/plugins.js.map +1 -0
- package/dist/controllers/reorder-drag.js +19 -17
- package/dist/controllers/reorder-drag.js.map +1 -1
- package/dist/controllers/row-measure.js +122 -0
- package/dist/controllers/row-measure.js.map +1 -0
- package/dist/controllers/virtual-controller.js +315 -21
- package/dist/controllers/virtual-controller.js.map +1 -1
- package/dist/core/src/columns/column-groups.js +129 -0
- package/dist/core/src/columns/column-groups.js.map +1 -0
- package/dist/core/src/columns/column-order.js +125 -27
- package/dist/core/src/columns/column-order.js.map +1 -1
- package/dist/core/src/columns/resolve-columns.js +18 -5
- package/dist/core/src/columns/resolve-columns.js.map +1 -1
- package/dist/core/src/columns/spread-width.js +43 -0
- package/dist/core/src/columns/spread-width.js.map +1 -0
- package/dist/core/src/data/page-cache.js +4 -0
- package/dist/core/src/data/page-cache.js.map +1 -1
- package/dist/core/src/filters/filter.js +183 -0
- package/dist/core/src/filters/filter.js.map +1 -0
- package/dist/core/src/grid/row-layout.js +19 -11
- package/dist/core/src/grid/row-layout.js.map +1 -1
- package/dist/core/src/state/selection.js +71 -0
- package/dist/core/src/state/selection.js.map +1 -0
- package/dist/core/src/table/create-table.js +276 -66
- package/dist/core/src/table/create-table.js.map +1 -1
- package/dist/core/src/table/filtered-row-model.js +48 -0
- package/dist/core/src/table/filtered-row-model.js.map +1 -0
- package/dist/core/src/table/sorted-row-model.js +13 -2
- package/dist/core/src/table/sorted-row-model.js.map +1 -1
- package/dist/core/src/virtual/column-window.js +72 -0
- package/dist/core/src/virtual/column-window.js.map +1 -0
- package/dist/core/src/virtual/row-pool.js +2 -1
- package/dist/core/src/virtual/row-pool.js.map +1 -1
- package/dist/core/src/virtual/row-sizes.js +152 -0
- package/dist/core/src/virtual/row-sizes.js.map +1 -0
- package/dist/core/src/virtual/scroll-scale.js +41 -3
- package/dist/core/src/virtual/scroll-scale.js.map +1 -1
- package/dist/custom-elements.json +1683 -211
- package/dist/events.js +16 -8
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +808 -127
- package/dist/index.js +4 -2
- package/dist/interactive.js +22 -0
- package/dist/interactive.js.map +1 -0
- package/dist/max-height.js +22 -8
- package/dist/max-height.js.map +1 -1
- package/dist/render/body.js +48 -8
- package/dist/render/body.js.map +1 -1
- package/dist/render/cells.js +22 -11
- package/dist/render/cells.js.map +1 -1
- package/dist/render/content-directive.js +115 -0
- package/dist/render/content-directive.js.map +1 -0
- package/dist/render/content.js +33 -10
- package/dist/render/content.js.map +1 -1
- package/dist/render/header.js +104 -22
- package/dist/render/header.js.map +1 -1
- package/dist/render/pinned-rows.js +1 -1
- package/dist/render/pinned-rows.js.map +1 -1
- package/dist/styles/base.js +1 -1
- package/dist/styles/base.js.map +1 -1
- package/package.json +1 -1
package/dist/render/header.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { ariaSort,
|
|
1
|
+
import { ariaSort, cellStyle, groupSlot, groupStyle, headerSlot } from "./content.js";
|
|
2
2
|
import { html, nothing } from "lit";
|
|
3
|
+
import { live } from "lit/directives/live.js";
|
|
3
4
|
import { repeat } from "lit/directives/repeat.js";
|
|
4
5
|
// src/render/header.ts
|
|
6
|
+
/** The drop slot key of a column (`c:` and its id) or a group cell (its `key`). */
|
|
7
|
+
var columnKey = (columnId) => `c:${columnId}`;
|
|
5
8
|
/**
|
|
6
|
-
* The sticky header row
|
|
7
|
-
*
|
|
9
|
+
* The sticky header: a row per level of column groups, then the row of column
|
|
10
|
+
* headers. Header content is slotted from the light DOM. Pinned
|
|
11
|
+
* header cells use the same private `data-pin` hooks as body cells, and the parts
|
|
12
|
+
* `header-cell-pinned` and `header-cell-pinned-edge`.
|
|
8
13
|
* Every header carries `data-col` (its column id) and sortable ones also
|
|
9
14
|
* `data-sort-col`; the element's delegated handlers read them. Headers take part
|
|
10
15
|
* in the grid's roving tabindex: the active one is the tab stop (`activeCol`).
|
|
@@ -16,34 +21,41 @@ import { repeat } from "lit/directives/repeat.js";
|
|
|
16
21
|
* column. While one is dragged (`drag`), its header adds `header-cell-dragging`
|
|
17
22
|
* and the target header shows a `drop-indicator` on the edge it would land at.
|
|
18
23
|
*/
|
|
19
|
-
function renderHeader(columns, handlers,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
function renderHeader({ columns, groups, handlers, active, drag, checkAll }) {
|
|
25
|
+
const leaf = groups.length;
|
|
26
|
+
const activeCol = active?.index === leaf ? active.col : void 0;
|
|
27
|
+
return html`<div
|
|
28
|
+
part="header"
|
|
29
|
+
role="rowgroup"
|
|
30
|
+
@click=${handlers.click}
|
|
31
|
+
@pointerdown=${handlers.pointerdown}
|
|
32
|
+
@dblclick=${handlers.dblclick}
|
|
33
|
+
>
|
|
34
|
+
${groups.map((cells, level) => groupRow(cells, level, active, drag))}
|
|
35
|
+
<div part="header-row" class="row" role="row" aria-rowindex=${leaf + 1}>
|
|
36
|
+
${repeat(columns, (c) => c.key, (c) => html`<div
|
|
31
37
|
part=${headerParts(c, drag)}
|
|
32
38
|
role="columnheader"
|
|
33
39
|
aria-colindex=${c.colIndex}
|
|
34
40
|
aria-sort=${ariaSort(c.sorted) ?? nothing}
|
|
41
|
+
aria-description=${c.filtered ? "Filtered" : nothing}
|
|
35
42
|
data-col=${c.id}
|
|
36
43
|
data-sort-col=${c.sortable ? c.id : nothing}
|
|
37
44
|
data-move-col=${c.reorderable ? c.id : nothing}
|
|
38
45
|
tabindex=${c.id === activeCol ? 0 : -1}
|
|
39
46
|
data-align=${c.align}
|
|
40
47
|
data-pin=${c.pin ?? nothing}
|
|
41
|
-
style=${
|
|
48
|
+
style=${cellStyle(c) ?? nothing}
|
|
42
49
|
>
|
|
43
|
-
|
|
44
|
-
${c.sortable ? html`<span
|
|
50
|
+
${c.kind === "selection" ? selectAllCheckbox(checkAll) : html`<slot name=${headerSlot(c.slot)}></slot>`}
|
|
51
|
+
${c.sortable ? html`<span
|
|
52
|
+
part="sort-indicator"
|
|
53
|
+
class="sort-indicator"
|
|
54
|
+
aria-hidden="true"
|
|
55
|
+
></span>` : nothing}
|
|
56
|
+
${c.filtered ? html`<span part="filter-indicator" aria-hidden="true"></span>` : nothing}
|
|
45
57
|
${c.resizable ? resizeHandle(c) : nothing}
|
|
46
|
-
${drag?.target?.
|
|
58
|
+
${drag?.target?.id === columnKey(c.id) ? html`<span
|
|
47
59
|
part="drop-indicator"
|
|
48
60
|
data-edge=${drag.target.edge}
|
|
49
61
|
aria-hidden="true"
|
|
@@ -53,11 +65,81 @@ function renderHeader(columns, handlers, activeCol, drag) {
|
|
|
53
65
|
</div>`;
|
|
54
66
|
}
|
|
55
67
|
function headerParts(c, drag) {
|
|
56
|
-
let parts = c.sorted ?
|
|
57
|
-
if (
|
|
68
|
+
let parts = c.sorted ? `header-cell header-cell-sorted header-cell-sorted-${c.sorted}` : "header-cell";
|
|
69
|
+
if (c.pin) parts += c.pinEdge ? " header-cell-pinned header-cell-pinned-edge" : " header-cell-pinned";
|
|
70
|
+
if (c.filtered) parts += " header-cell-filtered";
|
|
71
|
+
if (c.kind === "selection") parts += " header-cell-selection";
|
|
72
|
+
if (drag?.columns.has(c.id)) parts += " header-cell-dragging";
|
|
58
73
|
return parts;
|
|
59
74
|
}
|
|
60
75
|
/**
|
|
76
|
+
* A row of group headers. Every group cell renders, also with `virtualizeColumns`
|
|
77
|
+
* (there are few, and their slots stay put). A group's cell is a `columnheader`
|
|
78
|
+
* spanning its columns (`aria-colspan`), focusable through the roving tabindex,
|
|
79
|
+
* with `data-group-key`; columns without a group at this level sit under an empty
|
|
80
|
+
* filler `gridcell`, so every row covers every column. Neither carries `data-col`:
|
|
81
|
+
* they are no column's header. A group with a resizable column has a
|
|
82
|
+
* `resize-handle` too (`data-resize-group`).
|
|
83
|
+
*/
|
|
84
|
+
function groupRow(cells, level, active, drag) {
|
|
85
|
+
const activeCol = active?.index === level ? active.col : void 0;
|
|
86
|
+
return html`<div part="header-group-row" class="row" role="row" aria-rowindex=${level + 1}>
|
|
87
|
+
${repeat(cells, (c) => c.key, (c) => c.kind === "filler" ? html`<div
|
|
88
|
+
part="header-group-filler"
|
|
89
|
+
role="gridcell"
|
|
90
|
+
aria-colindex=${c.colIndex}
|
|
91
|
+
aria-colspan=${c.span}
|
|
92
|
+
data-pin=${c.pin ?? nothing}
|
|
93
|
+
style=${groupStyle(c)}
|
|
94
|
+
></div>` : html`<div
|
|
95
|
+
part=${drag?.key === c.key ? "header-group-cell header-group-cell-dragging" : "header-group-cell"}
|
|
96
|
+
role="columnheader"
|
|
97
|
+
aria-colindex=${c.colIndex}
|
|
98
|
+
aria-colspan=${c.span}
|
|
99
|
+
data-group-key=${c.key}
|
|
100
|
+
data-move-group=${c.movable ? c.key : nothing}
|
|
101
|
+
tabindex=${activeCol !== void 0 && c.columns.includes(activeCol) ? 0 : -1}
|
|
102
|
+
data-pin=${c.pin ?? nothing}
|
|
103
|
+
style=${groupStyle(c)}
|
|
104
|
+
>
|
|
105
|
+
<span class="group-label"><slot name=${groupSlot(c.slot)}></slot></span>
|
|
106
|
+
${c.resizable ? groupResizeHandle(c.key) : nothing}
|
|
107
|
+
${drag?.target?.id === c.key ? html`<span
|
|
108
|
+
part="drop-indicator"
|
|
109
|
+
data-edge=${drag.target.edge}
|
|
110
|
+
aria-hidden="true"
|
|
111
|
+
></span>` : nothing}
|
|
112
|
+
</div>`)}
|
|
113
|
+
</div>`;
|
|
114
|
+
}
|
|
115
|
+
/** The header's select-all checkbox: not focusable, like the rows' (the header cell holds focus). */
|
|
116
|
+
function selectAllCheckbox(checkAll) {
|
|
117
|
+
if (!checkAll) return nothing;
|
|
118
|
+
return html`<input
|
|
119
|
+
type="checkbox"
|
|
120
|
+
part="selection-checkbox"
|
|
121
|
+
tabindex="-1"
|
|
122
|
+
aria-label="Select all rows"
|
|
123
|
+
.checked=${live(checkAll.state === "all")}
|
|
124
|
+
.indeterminate=${live(checkAll.state === "some")}
|
|
125
|
+
@click=${checkAll.handlers.all}
|
|
126
|
+
@mousedown=${checkAll.handlers.press}
|
|
127
|
+
/>`;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A group's resize handle: dragging it resizes the group's resizable columns,
|
|
131
|
+
* each in proportion to its width; a double-click fits them to their content.
|
|
132
|
+
*/
|
|
133
|
+
function groupResizeHandle(key) {
|
|
134
|
+
return html`<div
|
|
135
|
+
part="resize-handle"
|
|
136
|
+
role="separator"
|
|
137
|
+
aria-orientation="vertical"
|
|
138
|
+
aria-label="Resize group"
|
|
139
|
+
data-resize-group=${key}
|
|
140
|
+
></div>`;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
61
143
|
* A vertical separator with the column's width as its value. A flex column has no
|
|
62
144
|
* fixed width until it is resized, so it reports none.
|
|
63
145
|
*/
|
|
@@ -73,6 +155,6 @@ function resizeHandle(c) {
|
|
|
73
155
|
data-resize-col=${c.id}
|
|
74
156
|
></div>`;
|
|
75
157
|
}
|
|
76
|
-
export { renderHeader };
|
|
158
|
+
export { columnKey, renderHeader };
|
|
77
159
|
|
|
78
160
|
//# sourceMappingURL=header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","names":[],"sources":["../../src/render/header.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { ColumnView } from '@argus-table/core';\nimport type { DropTarget } from '../controllers/reorder-drag.js';\nimport type { CellContent } from '../types.js';\nimport { ariaSort, headerSlot, pinStyle } from './content.js';\n\n/** A column header being dragged, and where it would land (`undefined`: where it is). */\nexport interface HeaderDrag {\n columnId: string;\n target: DropTarget | undefined;\n}\n\nexport interface HeaderHandlers {\n click: (event: MouseEvent) => void;\n pointerdown: (event: PointerEvent) => void;\n dblclick: (event: MouseEvent) => void;\n}\n\n/**\n * The sticky header row. Header content is slotted from the light DOM. Pinned\n * header cells use the same private `data-pin` hooks as body cells, but no parts.\n * Every header carries `data-col` (its column id) and sortable ones also\n * `data-sort-col`; the element's delegated handlers read them. Headers take part\n * in the grid's roving tabindex: the active one is the tab stop (`activeCol`).\n * Resizable columns get a `resize-handle` on the header's inline-end edge; a\n * double-click on it fits the column to its content. It is not focusable: the\n * focused header resizes with Alt+Arrow.\n *\n * Reorderable columns carry `data-move-col`: a drag on the header moves the\n * column. While one is dragged (`drag`), its header adds `header-cell-dragging`\n * and the target header shows a `drop-indicator` on the edge it would land at.\n */\nexport function renderHeader<T>(\n columns: readonly ColumnView<T, CellContent>[],\n handlers: HeaderHandlers,\n activeCol: string | undefined,\n drag?: HeaderDrag,\n) {\n return html`<div part=\"header\" role=\"rowgroup\">\n <div\n part=\"header-row\"\n class=\"row\"\n role=\"row\"\n aria-rowindex=\"1\"\n @click=${handlers.click}\n @pointerdown=${handlers.pointerdown}\n @dblclick=${handlers.dblclick}\n >\n ${repeat(\n columns,\n (c) => c.id,\n (c) =>\n html`<div\n part=${headerParts(c, drag)}\n role=\"columnheader\"\n aria-colindex=${c.colIndex}\n aria-sort=${ariaSort(c.sorted) ?? nothing}\n data-col=${c.id}\n data-sort-col=${c.sortable ? c.id : nothing}\n data-move-col=${c.reorderable ? c.id : nothing}\n tabindex=${c.id === activeCol ? 0 : -1}\n data-align=${c.align}\n data-pin=${c.pin ?? nothing}\n style=${pinStyle(c) ?? nothing}\n >\n <slot name=${headerSlot(c.colIndex)}></slot>\n ${c.sortable ? html`<span class=\"sort-indicator\" aria-hidden=\"true\"></span>` : nothing}\n ${c.resizable ? resizeHandle(c) : nothing}\n ${\n drag?.target?.columnId === c.id\n ? html`<span\n part=\"drop-indicator\"\n data-edge=${drag.target.edge}\n aria-hidden=\"true\"\n ></span>`\n : nothing\n }\n </div>`,\n )}\n </div>\n </div>`;\n}\n\nfunction headerParts<T>(c: ColumnView<T, CellContent>, drag: HeaderDrag | undefined): string {\n let parts = c.sorted ? 'header-cell header-cell-sorted' : 'header-cell';\n if (drag?.columnId === c.id) parts += ' header-cell-dragging';\n return parts;\n}\n\n/**\n * A vertical separator with the column's width as its value. A flex column has no\n * fixed width until it is resized, so it reports none.\n */\nfunction resizeHandle<T>(c: ColumnView<T, CellContent>) {\n return html`<div\n part=\"resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize column\"\n aria-valuenow=${c.flex === undefined ? Math.round(c.width) : nothing}\n aria-valuemin=${c.minWidth}\n aria-valuemax=${Number.isFinite(c.maxWidth) ? c.maxWidth : nothing}\n data-resize-col=${c.id}\n ></div>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,SAAgB,aACd,SACA,UACA,WACA,MACA;CACA,OAAO,IAAI;;;;;;eAME,SAAS,MAAM;qBACT,SAAS,YAAY;kBACxB,SAAS,SAAS;;QAE5B,OACA,UACC,MAAM,EAAE,KACR,MACC,IAAI;mBACK,YAAY,GAAG,IAAI,EAAE;;4BAEZ,EAAE,SAAS;wBACf,SAAS,EAAE,MAAM,KAAK,QAAQ;uBAC/B,EAAE,GAAG;4BACA,EAAE,WAAW,EAAE,KAAK,QAAQ;4BAC5B,EAAE,cAAc,EAAE,KAAK,QAAQ;uBACpC,EAAE,OAAO,YAAY,IAAI,GAAG;yBAC1B,EAAE,MAAM;uBACV,EAAE,OAAO,QAAQ;oBACpB,SAAS,CAAC,KAAK,QAAQ;;yBAElB,WAAW,EAAE,QAAQ,EAAE;cAClC,EAAE,WAAW,IAAI,4DAA4D,QAAQ;cACrF,EAAE,YAAY,aAAa,CAAC,IAAI,QAAQ;cAExC,MAAM,QAAQ,aAAa,EAAE,KACzB,IAAI;;gCAEU,KAAK,OAAO,KAAK;;8BAG/B,QACL;iBAEP,EAAE;;;AAGR;AAEA,SAAS,YAAe,GAA+B,MAAsC;CAC3F,IAAI,QAAQ,EAAE,SAAS,mCAAmC;CAC1D,IAAI,MAAM,aAAa,EAAE,IAAI,SAAS;CACtC,OAAO;AACT;;;;;AAMA,SAAS,aAAgB,GAA+B;CACtD,OAAO,IAAI;;;;;oBAKO,EAAE,SAAS,KAAA,IAAY,KAAK,MAAM,EAAE,KAAK,IAAI,QAAQ;oBACrD,EAAE,SAAS;oBACX,OAAO,SAAS,EAAE,QAAQ,IAAI,EAAE,WAAW,QAAQ;sBACjD,EAAE,GAAG;;AAE3B"}
|
|
1
|
+
{"version":3,"file":"header.js","names":[],"sources":["../../src/render/header.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport type { HeaderGroupCell } from '@argus-table/core';\nimport { live } from 'lit/directives/live.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { RenderedColumn } from '../controllers/column-window.js';\nimport type { DropTarget } from '../controllers/reorder-drag.js';\nimport type { CellContent } from '../types.js';\nimport {\n ariaSort,\n cellStyle,\n groupSlot,\n groupStyle,\n headerSlot,\n type CheckboxHandlers,\n} from './content.js';\n\n/**\n * A column or group header being dragged, and where it would land (`undefined`:\n * where it is). `key` is the drop slot key of what moves (see `unitKey`).\n */\nexport interface HeaderDrag {\n key: string;\n /** The columns that move: the column, or the group's columns on its side. */\n columns: ReadonlySet<string>;\n target: DropTarget | undefined;\n}\n\n/** The drop slot key of a column (`c:` and its id) or a group cell (its `key`). */\nexport const columnKey = (columnId: string) => `c:${columnId}`;\n\nexport interface HeaderOptions<T> {\n columns: readonly RenderedColumn<T>[];\n /** The group header rows above the column headers, top first. */\n groups: readonly (readonly HeaderGroupCell<CellContent>[])[];\n handlers: HeaderHandlers;\n /** The active cell when it is in the header: its header row and column. */\n active: { index: number; col: string } | undefined;\n drag?: HeaderDrag | undefined;\n checkAll?: CheckAll | undefined;\n}\n\nexport interface HeaderHandlers {\n click: (event: MouseEvent) => void;\n pointerdown: (event: PointerEvent) => void;\n dblclick: (event: MouseEvent) => void;\n}\n\n/**\n * The select-all checkbox in the selection column's header, with\n * `selectionMode` `'multi'`: checked when every selectable row is, mixed when\n * some are.\n */\nexport interface CheckAll {\n state: 'all' | 'some' | 'none';\n handlers: CheckboxHandlers;\n}\n\n/**\n * The sticky header: a row per level of column groups, then the row of column\n * headers. Header content is slotted from the light DOM. Pinned\n * header cells use the same private `data-pin` hooks as body cells, and the parts\n * `header-cell-pinned` and `header-cell-pinned-edge`.\n * Every header carries `data-col` (its column id) and sortable ones also\n * `data-sort-col`; the element's delegated handlers read them. Headers take part\n * in the grid's roving tabindex: the active one is the tab stop (`activeCol`).\n * Resizable columns get a `resize-handle` on the header's inline-end edge; a\n * double-click on it fits the column to its content. It is not focusable: the\n * focused header resizes with Alt+Arrow.\n *\n * Reorderable columns carry `data-move-col`: a drag on the header moves the\n * column. While one is dragged (`drag`), its header adds `header-cell-dragging`\n * and the target header shows a `drop-indicator` on the edge it would land at.\n */\nexport function renderHeader<T>({\n columns,\n groups,\n handlers,\n active,\n drag,\n checkAll,\n}: HeaderOptions<T>) {\n const leaf = groups.length;\n const activeCol = active?.index === leaf ? active.col : undefined;\n return html`<div\n part=\"header\"\n role=\"rowgroup\"\n @click=${handlers.click}\n @pointerdown=${handlers.pointerdown}\n @dblclick=${handlers.dblclick}\n >\n ${groups.map((cells, level) => groupRow(cells, level, active, drag))}\n <div part=\"header-row\" class=\"row\" role=\"row\" aria-rowindex=${leaf + 1}>\n ${repeat(\n columns,\n (c) => c.key,\n (c) =>\n html`<div\n part=${headerParts(c, drag)}\n role=\"columnheader\"\n aria-colindex=${c.colIndex}\n aria-sort=${ariaSort(c.sorted) ?? nothing}\n aria-description=${c.filtered ? 'Filtered' : nothing}\n data-col=${c.id}\n data-sort-col=${c.sortable ? c.id : nothing}\n data-move-col=${c.reorderable ? c.id : nothing}\n tabindex=${c.id === activeCol ? 0 : -1}\n data-align=${c.align}\n data-pin=${c.pin ?? nothing}\n style=${cellStyle(c) ?? nothing}\n >\n ${\n c.kind === 'selection'\n ? selectAllCheckbox(checkAll)\n : html`<slot name=${headerSlot(c.slot)}></slot>`\n }\n ${\n c.sortable\n ? html`<span\n part=\"sort-indicator\"\n class=\"sort-indicator\"\n aria-hidden=\"true\"\n ></span>`\n : nothing\n }\n ${c.filtered ? html`<span part=\"filter-indicator\" aria-hidden=\"true\"></span>` : nothing}\n ${c.resizable ? resizeHandle(c) : nothing}\n ${\n drag?.target?.id === columnKey(c.id)\n ? html`<span\n part=\"drop-indicator\"\n data-edge=${drag.target.edge}\n aria-hidden=\"true\"\n ></span>`\n : nothing\n }\n </div>`,\n )}\n </div>\n </div>`;\n}\n\nfunction headerParts<T>(c: RenderedColumn<T>, drag: HeaderDrag | undefined): string {\n let parts = c.sorted\n ? `header-cell header-cell-sorted header-cell-sorted-${c.sorted}`\n : 'header-cell';\n if (c.pin)\n parts += c.pinEdge ? ' header-cell-pinned header-cell-pinned-edge' : ' header-cell-pinned';\n if (c.filtered) parts += ' header-cell-filtered';\n if (c.kind === 'selection') parts += ' header-cell-selection';\n if (drag?.columns.has(c.id)) parts += ' header-cell-dragging';\n return parts;\n}\n\n/**\n * A row of group headers. Every group cell renders, also with `virtualizeColumns`\n * (there are few, and their slots stay put). A group's cell is a `columnheader`\n * spanning its columns (`aria-colspan`), focusable through the roving tabindex,\n * with `data-group-key`; columns without a group at this level sit under an empty\n * filler `gridcell`, so every row covers every column. Neither carries `data-col`:\n * they are no column's header. A group with a resizable column has a\n * `resize-handle` too (`data-resize-group`).\n */\nfunction groupRow(\n cells: readonly HeaderGroupCell<CellContent>[],\n level: number,\n active: { index: number; col: string } | undefined,\n drag: HeaderDrag | undefined,\n) {\n const activeCol = active?.index === level ? active.col : undefined;\n return html`<div part=\"header-group-row\" class=\"row\" role=\"row\" aria-rowindex=${level + 1}>\n ${repeat(\n cells,\n (c) => c.key,\n (c) =>\n c.kind === 'filler'\n ? html`<div\n part=\"header-group-filler\"\n role=\"gridcell\"\n aria-colindex=${c.colIndex}\n aria-colspan=${c.span}\n data-pin=${c.pin ?? nothing}\n style=${groupStyle(c)}\n ></div>`\n : html`<div\n part=${\n drag?.key === c.key\n ? 'header-group-cell header-group-cell-dragging'\n : 'header-group-cell'\n }\n role=\"columnheader\"\n aria-colindex=${c.colIndex}\n aria-colspan=${c.span}\n data-group-key=${c.key}\n data-move-group=${c.movable ? c.key : nothing}\n tabindex=${activeCol !== undefined && c.columns.includes(activeCol) ? 0 : -1}\n data-pin=${c.pin ?? nothing}\n style=${groupStyle(c)}\n >\n <span class=\"group-label\"><slot name=${groupSlot(c.slot)}></slot></span>\n ${c.resizable ? groupResizeHandle(c.key) : nothing}\n ${\n drag?.target?.id === c.key\n ? html`<span\n part=\"drop-indicator\"\n data-edge=${drag.target.edge}\n aria-hidden=\"true\"\n ></span>`\n : nothing\n }\n </div>`,\n )}\n </div>`;\n}\n\n/** The header's select-all checkbox: not focusable, like the rows' (the header cell holds focus). */\nfunction selectAllCheckbox(checkAll: CheckAll | undefined) {\n if (!checkAll) return nothing;\n return html`<input\n type=\"checkbox\"\n part=\"selection-checkbox\"\n tabindex=\"-1\"\n aria-label=\"Select all rows\"\n .checked=${live(checkAll.state === 'all')}\n .indeterminate=${live(checkAll.state === 'some')}\n @click=${checkAll.handlers.all}\n @mousedown=${checkAll.handlers.press}\n />`;\n}\n\n/**\n * A group's resize handle: dragging it resizes the group's resizable columns,\n * each in proportion to its width; a double-click fits them to their content.\n */\nfunction groupResizeHandle(key: string) {\n return html`<div\n part=\"resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize group\"\n data-resize-group=${key}\n ></div>`;\n}\n\n/**\n * A vertical separator with the column's width as its value. A flex column has no\n * fixed width until it is resized, so it reports none.\n */\nfunction resizeHandle<T>(c: RenderedColumn<T>) {\n return html`<div\n part=\"resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize column\"\n aria-valuenow=${c.flex === undefined ? Math.round(c.width) : nothing}\n aria-valuemin=${c.minWidth}\n aria-valuemax=${Number.isFinite(c.maxWidth) ? c.maxWidth : nothing}\n data-resize-col=${c.id}\n ></div>`;\n}\n"],"mappings":";;;;;;AA4BA,IAAa,aAAa,aAAqB,KAAK;;;;;;;;;;;;;;;;;AA6CpD,SAAgB,aAAgB,EAC9B,SACA,QACA,UACA,QACA,MACA,YACmB;CACnB,MAAM,OAAO,OAAO;CACpB,MAAM,YAAY,QAAQ,UAAU,OAAO,OAAO,MAAM,KAAA;CACxD,OAAO,IAAI;;;aAGA,SAAS,MAAM;mBACT,SAAS,YAAY;gBACxB,SAAS,SAAS;;MAE5B,OAAO,KAAK,OAAO,UAAU,SAAS,OAAO,OAAO,QAAQ,IAAI,CAAC,EAAE;kEACP,OAAO,EAAE;QACnE,OACA,UACC,MAAM,EAAE,MACR,MACC,IAAI;mBACK,YAAY,GAAG,IAAI,EAAE;;4BAEZ,EAAE,SAAS;wBACf,SAAS,EAAE,MAAM,KAAK,QAAQ;+BACvB,EAAE,WAAW,aAAa,QAAQ;uBAC1C,EAAE,GAAG;4BACA,EAAE,WAAW,EAAE,KAAK,QAAQ;4BAC5B,EAAE,cAAc,EAAE,KAAK,QAAQ;uBACpC,EAAE,OAAO,YAAY,IAAI,GAAG;yBAC1B,EAAE,MAAM;uBACV,EAAE,OAAO,QAAQ;oBACpB,UAAU,CAAC,KAAK,QAAQ;;cAG9B,EAAE,SAAS,cACP,kBAAkB,QAAQ,IAC1B,IAAI,cAAc,WAAW,EAAE,IAAI,EAAE,UAC1C;cAEC,EAAE,WACE,IAAI;;;;8BAKJ,QACL;cACC,EAAE,WAAW,IAAI,6DAA6D,QAAQ;cACtF,EAAE,YAAY,aAAa,CAAC,IAAI,QAAQ;cAExC,MAAM,QAAQ,OAAO,UAAU,EAAE,EAAE,IAC/B,IAAI;;gCAEU,KAAK,OAAO,KAAK;;8BAG/B,QACL;iBAEP,EAAE;;;AAGR;AAEA,SAAS,YAAe,GAAsB,MAAsC;CAClF,IAAI,QAAQ,EAAE,SACV,qDAAqD,EAAE,WACvD;CACJ,IAAI,EAAE,KACJ,SAAS,EAAE,UAAU,gDAAgD;CACvE,IAAI,EAAE,UAAU,SAAS;CACzB,IAAI,EAAE,SAAS,aAAa,SAAS;CACrC,IAAI,MAAM,QAAQ,IAAI,EAAE,EAAE,GAAG,SAAS;CACtC,OAAO;AACT;;;;;;;;;;AAWA,SAAS,SACP,OACA,OACA,QACA,MACA;CACA,MAAM,YAAY,QAAQ,UAAU,QAAQ,OAAO,MAAM,KAAA;CACzD,OAAO,IAAI,qEAAqE,QAAQ,EAAE;MACtF,OACA,QACC,MAAM,EAAE,MACR,MACC,EAAE,SAAS,WACP,IAAI;;;8BAGc,EAAE,SAAS;6BACZ,EAAE,KAAK;yBACX,EAAE,OAAO,QAAQ;sBACpB,WAAW,CAAC,EAAE;uBAExB,IAAI;qBAEA,MAAM,QAAQ,EAAE,MACZ,iDACA,oBACL;;8BAEe,EAAE,SAAS;6BACZ,EAAE,KAAK;+BACL,EAAE,IAAI;gCACL,EAAE,UAAU,EAAE,MAAM,QAAQ;yBACnC,cAAc,KAAA,KAAa,EAAE,QAAQ,SAAS,SAAS,IAAI,IAAI,GAAG;yBAClE,EAAE,OAAO,QAAQ;sBACpB,WAAW,CAAC,EAAE;;qDAEiB,UAAU,EAAE,IAAI,EAAE;gBACvD,EAAE,YAAY,kBAAkB,EAAE,GAAG,IAAI,QAAQ;gBAEjD,MAAM,QAAQ,OAAO,EAAE,MACnB,IAAI;;kCAEU,KAAK,OAAO,KAAK;;gCAG/B,QACL;mBAEX,EAAE;;AAEN;;AAGA,SAAS,kBAAkB,UAAgC;CACzD,IAAI,CAAC,UAAU,OAAO;CACtB,OAAO,IAAI;;;;;eAKE,KAAK,SAAS,UAAU,KAAK,EAAE;qBACzB,KAAK,SAAS,UAAU,MAAM,EAAE;aACxC,SAAS,SAAS,IAAI;iBAClB,SAAS,SAAS,MAAM;;AAEzC;;;;;AAMA,SAAS,kBAAkB,KAAa;CACtC,OAAO,IAAI;;;;;wBAKW,IAAI;;AAE5B;;;;;AAMA,SAAS,aAAgB,GAAsB;CAC7C,OAAO,IAAI;;;;;oBAKO,EAAE,SAAS,KAAA,IAAY,KAAK,MAAM,EAAE,KAAK,IAAI,QAAQ;oBACrD,EAAE,SAAS;oBACX,OAAO,SAAS,EAAE,QAAQ,IAAI,EAAE,WAAW,QAAQ;sBACjD,EAAE,GAAG;;AAE3B"}
|
|
@@ -20,7 +20,7 @@ function renderPinnedRows(side, count, columns, firstRowIndex, active) {
|
|
|
20
20
|
role="row"
|
|
21
21
|
aria-rowindex=${firstRowIndex + i}
|
|
22
22
|
>
|
|
23
|
-
${repeat(columns, (c) => c.
|
|
23
|
+
${repeat(columns, (c) => c.key, (c) => renderCell(c, active?.index === i && c.id === active.col, pinnedSlot(side, i, c.slot), true))}
|
|
24
24
|
</div>`)}
|
|
25
25
|
</div>`;
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pinned-rows.js","names":[],"sources":["../../src/render/pinned-rows.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type {
|
|
1
|
+
{"version":3,"file":"pinned-rows.js","names":[],"sources":["../../src/render/pinned-rows.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { RowPin } from '@argus-table/core';\nimport type { RenderedColumn } from '../controllers/column-window.js';\nimport { renderCell, type ActiveCell } from './body.js';\nimport { pinnedSlot } from './content.js';\n\n/**\n * The rows pinned to one side: a sticky row group below the header (`top`) or\n * at the bottom of the view (`bottom`). They are few and never recycled, so\n * they aren't pooled; content is slotted from the light DOM like body cells.\n * Cells take part in the grid's roving tabindex (`active.index` is the row's\n * index in its list). `firstRowIndex` is the `aria-rowindex` of the first row.\n */\nexport function renderPinnedRows<T>(\n side: RowPin,\n count: number,\n columns: readonly RenderedColumn<T>[],\n firstRowIndex: number,\n active: ActiveCell | undefined,\n) {\n if (count === 0) return nothing;\n const rows = Array.from({ length: count }, (_, i) => i);\n return html`<div class=\"pinned\" data-side=${side} role=\"rowgroup\">\n ${rows.map(\n (i) =>\n html`<div\n part=${`row row-pinned row-pinned-${side}`}\n class=\"row\"\n role=\"row\"\n aria-rowindex=${firstRowIndex + i}\n >\n ${repeat(\n columns,\n (c) => c.key,\n (c) =>\n renderCell(\n c,\n active?.index === i && c.id === active.col,\n pinnedSlot(side, i, c.slot),\n true,\n ),\n )}\n </div>`,\n )}\n </div>`;\n}\n"],"mappings":";;;;;;;;;;;;AAcA,SAAgB,iBACd,MACA,OACA,SACA,eACA,QACA;CACA,IAAI,UAAU,GAAG,OAAO;CACxB,MAAM,OAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,MAAM,CAAC;CACtD,OAAO,IAAI,iCAAiC,KAAK;MAC7C,KAAK,KACJ,MACC,IAAI;iBACK,6BAA6B,OAAO;;;0BAG3B,gBAAgB,EAAE;;YAEhC,OACA,UACC,MAAM,EAAE,MACR,MACC,WACE,GACA,QAAQ,UAAU,KAAK,EAAE,OAAO,OAAO,KACvC,WAAW,MAAM,GAAG,EAAE,IAAI,GAC1B,IACF,CACJ,EAAE;eAER,EAAE;;AAEN"}
|
package/dist/styles/base.js
CHANGED
|
@@ -5,7 +5,7 @@ import { css } from "lit";
|
|
|
5
5
|
* public token with a neutral fallback, so themes and page CSS always win.
|
|
6
6
|
* `--_*` properties are private.
|
|
7
7
|
*/
|
|
8
|
-
var baseStyles = css`@layer argus-base{:host{box-sizing:border-box;contain:content;color-scheme:light dark;block-size:400px;color:var(--argus-fg,CanvasText);background:var(--argus-bg,Canvas);font:var(--argus-font,inherit);border:var(--argus-
|
|
8
|
+
var baseStyles = css`@layer argus-base{:host{box-sizing:border-box;contain:content;color-scheme:light dark;block-size:400px;color:var(--argus-fg,CanvasText);background:var(--argus-bg,Canvas);font:var(--argus-font,inherit);border:var(--argus-border,none);border-radius:var(--argus-border-radius,0);--_row-height:var(--argus-row-height,40px);--_pad:var(--argus-cell-padding-inline,12px);--_border:var(--argus-border-width,1px) solid var(--argus-border-color,light-dark(#e5e7eb,#374151));--_dir:1;display:block}:host(:dir(rtl)){--_dir:-1}:host([density=compact]){--_row-height:var(--argus-row-height,32px);--_pad:var(--argus-cell-padding-inline,8px)}:host([density=spacious]){--_row-height:var(--argus-row-height,52px);--_pad:var(--argus-cell-padding-inline,16px)}:host([hidden]){display:none}[part~=table]{overscroll-behavior:contain;--_header-h:calc(var(--_header-rows,1) * var(--_row-height));block-size:100%;position:relative;overflow:auto}[part~=body]>.row>[role=gridcell]{scroll-margin-block:calc(var(--_header-h) + var(--_pin-top-rows,0) * var(--_row-height)) calc(var(--_pin-bottom-rows,0) * var(--_row-height))}[role=gridcell]:not([data-pin]),[role=columnheader]:not([data-pin]){scroll-margin-inline:var(--_pin-start,0) var(--_pin-end,0)}.row{grid-template-columns:var(--_cols);inline-size:var(--_width);min-inline-size:100%;block-size:var(--_row-height);box-sizing:border-box;display:grid}[part~=header]{z-index:2;position:sticky;inset-block-start:0}[part~=body]{contain:layout;position:relative}[part~=body]>.row{position:absolute;inset-block-start:0;inset-inline-start:0}[part~=row]{--_row-bg:var(--argus-bg,Canvas);--_row-surface:var(--_row-bg);background:var(--_row-surface)}[part~=row-odd]{--_row-bg:var(--argus-row-odd-bg,var(--argus-bg,Canvas))}[part~=row]:hover{--_row-surface:var(--argus-row-hover-bg,var(--_row-bg))}[part~=row-selected],[part~=row-selected]:hover{--_row-bg:var(--argus-row-selected-bg,color-mix(in srgb, Highlight 22%, var(--argus-bg,Canvas)));--_row-surface:var(--_row-bg)}@media (forced-colors:active){[part~=row-selected]{forced-color-adjust:none;--_row-bg:Highlight;color:highlighttext}}.pinned{z-index:2;position:sticky}.pinned[data-side=top]{inset-block-start:var(--_header-h)}.pinned[data-side=bottom]{inset-block-end:0}[part~=row-pinned]{--_row-bg:var(--argus-row-pinned-bg,var(--argus-bg,Canvas))}[part~=cell],[part~=header-cell]{box-sizing:border-box;min-inline-size:0;padding-inline:var(--_pad);white-space:nowrap;border-block-end:var(--_border);align-items:center;display:flex;overflow:hidden}[part~=cell-selection],[part~=header-cell-selection]{justify-content:center;padding-inline:0}[part~=selection-checkbox]{cursor:pointer;margin:0}[part~=header-cell]{background:var(--argus-header-bg,light-dark(#f9fafb,#111827));color:var(--argus-header-fg,inherit);font-weight:600;position:relative}[part~=header-group-cell],[part~=header-group-filler]{box-sizing:border-box;background:var(--argus-header-bg,light-dark(#f9fafb,#111827));min-inline-size:0;color:var(--argus-header-fg,inherit)}[part~=header-group-cell]{padding-inline:var(--_pad);white-space:nowrap;border-block-end:var(--_border);border-inline-end:var(--_border);align-items:center;font-weight:600;display:flex;position:relative;overflow:clip}.group-label{text-overflow:ellipsis;min-inline-size:0;overflow:hidden}[part~=header-group-cell]:not([data-pin])>.group-label{position:sticky;inset-inline-start:calc(var(--_pin-start,0px) + var(--_pad))}[data-move-group]{user-select:none}[data-dragging] [part~=header-group-cell]{cursor:grabbing}[part~=header-group-cell-dragging]{opacity:.5}[part~=resize-handle]{z-index:1;cursor:col-resize;touch-action:none;inline-size:8px;position:absolute;inset-block:0;inset-inline-end:0}[part~=resize-handle]:after{content:"";background:var(--argus-resize-handle-color,light-dark(#9ca3af,#6b7280));opacity:0;inline-size:2px;position:absolute;inset-block:25%;inset-inline-end:0}[part~=header-cell]:hover [part~=resize-handle]:after,[part~=header-cell]:focus-visible [part~=resize-handle]:after,[part~=header-group-cell]:hover [part~=resize-handle]:after,[part~=header-group-cell]:focus-visible [part~=resize-handle]:after,[part~=resize-handle][data-active]:after{opacity:1}[data-sort-col]{cursor:pointer;user-select:none}[data-move-col]{user-select:none}[data-dragging],[data-dragging] [part~=header-cell]{cursor:grabbing}[part~=header-cell-dragging]{opacity:.5}[part~=drop-indicator]{z-index:2;background:var(--argus-drop-indicator-color,Highlight);pointer-events:none;inline-size:2px;position:absolute;inset-block:0}[part~=drop-indicator][data-edge=start]{inset-inline-start:0}[part~=drop-indicator][data-edge=end]{inset-inline-end:0}[part~=header-cell]:focus-visible,[part~=header-group-cell]:focus-visible,[part~=cell]:focus-visible{outline:var(--argus-focus-ring,2px solid Highlight);outline-offset:-2px}.sort-indicator{visibility:hidden;border-bottom:.12em solid;border-right:.12em solid;flex:none;block-size:.35em;inline-size:.35em;margin-inline-start:.4em}[aria-sort] .sort-indicator{visibility:visible}[aria-sort=ascending] .sort-indicator{transform:translateY(.1em)rotate(-135deg)}[aria-sort=descending] .sort-indicator{transform:translateY(-.1em)rotate(45deg)}[data-align=end] .sort-indicator{order:-1;margin-inline:0 .4em}[part~=filter-indicator]{background:var(--argus-filter-indicator-color,currentColor);clip-path:polygon(0 0,100% 0,62% 48%,62% 100%,38% 82%,38% 48%);flex:none;block-size:.7em;inline-size:.7em;margin-inline-start:.35em}[data-align=end] [part~=filter-indicator]{order:-2;margin-inline:0 .35em}@media (forced-colors:active){[part~=filter-indicator]{forced-color-adjust:none;background:canvastext}}[data-pin]{z-index:1;position:sticky}[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=row]>[data-pin]{position:relative;inset-inline:auto}[part~=row]>[data-pin=start]{transform:translateX(var(--_sx,0px))}[part~=row]>[data-pin=end]{transform:translateX(calc(var(--_sx,0px) - var(--_dir) * var(--_max-x,0px)))}[data-hscroll] [part~=row]>[data-pin]{position:sticky;transform:none}[data-hscroll] [part~=row]>[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-hscroll] [part~=row]>[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=cell-pinned]{background:var(--_row-surface)}.pin-shadow{block-size:min(var(--_view-h,100%), var(--_content-h,100%));z-index:3;pointer-events:none;position:absolute;inset-block-start:0}.pin-shadow[data-side=start]{inset-inline-start:0}.pin-shadow[data-side=end]{inset-inline-end:var(--_sb-x,0px)}.pin-shadow:after{content:"";box-shadow:var(--argus-pinned-shadow,4px 0 6px -4px light-dark(#0003,#0009));transform:scaleX(var(--_dir));position:absolute;inset:0}.pin-shadow[data-side=end]:after{transform:scaleX(calc(-1 * var(--_dir)))}[data-align=center]{text-align:center;justify-content:center}[data-align=end]{text-align:end;justify-content:flex-end}[part~=cell][data-wrap]{white-space:normal;overflow-wrap:anywhere;align-items:safe center}[data-auto-rows]{overflow-anchor:none}[data-auto-rows]>[part~=body]>.row,[data-auto-rows]>.pinned>.row{block-size:auto;min-block-size:var(--_row-height);grid-template-rows:minmax(var(--_row-height), auto)}[data-auto-rows]>[part~=body]>.row[data-measure-row]{min-block-size:var(--_row-height)!important}[data-auto-rows] [part~=cell]{padding-block:var(--argus-cell-padding-block,max(0px, (var(--_row-height) - 1lh - var(--argus-border-width,1px)) / 2));align-items:start}[data-auto-rows] [part~=row-loading]>[part~=cell]{align-items:center;padding-block:0}[data-auto-rows]>[part~=body]>.row>[role=gridcell]{scroll-margin-block:calc(var(--_header-h) + var(--_pin-top-h,0px)) var(--_pin-bottom-h,0px)}[data-auto-rows]>[part~=empty]{min-block-size:calc(100% - var(--_header-h) - var(--_pin-top-h,0px) - var(--_pin-bottom-h,0px))}::slotted(*){text-overflow:ellipsis;min-inline-size:0;overflow:hidden}[data-measure]{inline-size:max-content}[part~=skeleton]{background:var(--argus-skeleton-bg,color-mix(in srgb, currentColor 12%, transparent));border-radius:.3em;flex:none;block-size:.6em;inline-size:min(60%,8em);animation:1.6s ease-in-out infinite argus-skeleton-pulse}[part~=skeleton-error]{opacity:.5;animation:none}@keyframes argus-skeleton-pulse{50%{opacity:.45}}@media (prefers-reduced-motion:reduce){[part~=skeleton]{animation:none}}[part~=retry]{font:inherit;color:inherit;cursor:pointer}[part~=empty]{min-block-size:calc(100% - var(--_header-h) - (var(--_pin-top-rows,0) + var(--_pin-bottom-rows,0)) * var(--_row-height));padding:var(--_pad);box-sizing:border-box;justify-content:center;align-items:center;display:flex}.probe{inline-size:0;block-size:var(--_row-height);visibility:hidden;pointer-events:none;position:absolute;inset-block-start:0}}`;
|
|
9
9
|
export { baseStyles };
|
|
10
10
|
|
|
11
11
|
//# sourceMappingURL=base.js.map
|
package/dist/styles/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":[],"sources":["../../src/styles/base.ts"],"sourcesContent":["import { css } from 'lit';\n\n/**\n * Base styles. Everything sits in `@layer argus-base`, and every value reads a\n * public token with a neutral fallback, so themes and page CSS always win.\n * `--_*` properties are private.\n */\nexport const baseStyles = css`\n @layer argus-base {\n :host {\n display: block;\n /* A table that virtualizes needs a bounded height; set your own on the element. */\n block-size: 400px;\n box-sizing: border-box;\n contain: content;\n color-scheme: light dark;\n color: var(--argus-fg, CanvasText);\n background: var(--argus-bg, Canvas);\n font: var(--argus-font, inherit);\n /* contain: content clips the header, rows and pinned shadows to the rounded corners. */\n border: var(--argus-outline, none);\n border-radius: var(--argus-radius, 0);\n --_row-height: var(--argus-row-height, 40px);\n --_pad: var(--argus-cell-padding-inline, 12px);\n --_border: var(--argus-border-width, 1px) solid\n var(--argus-border-color, light-dark(#e5e7eb, #374151));\n /* 1 in LTR, -1 in RTL: mirrors the pinned-edge shadow. */\n --_dir: 1;\n }\n :host(:dir(rtl)) {\n --_dir: -1;\n }\n :host([density='compact']) {\n --_row-height: var(--argus-row-height, 32px);\n --_pad: var(--argus-cell-padding-inline, 8px);\n }\n :host([density='spacious']) {\n --_row-height: var(--argus-row-height, 52px);\n --_pad: var(--argus-cell-padding-inline, 16px);\n }\n :host([hidden]) {\n display: none;\n }\n\n [part~='table'] {\n position: relative;\n block-size: 100%;\n overflow: auto;\n overscroll-behavior: contain;\n }\n\n /*\n * A cell focused or moved to by keyboard scrolls clear of the sticky header, the\n * pinned rows and the pinned columns: scroll margins on the cells that scroll.\n * Not scroll padding on the scroller: Chromium and WebKit measure the sticky\n * header and pinned rows against it too, so focusing one of them (a click, Tab,\n * an arrow key) scrolled the body.\n */\n [part~='body'] > .row > [role='gridcell'] {\n scroll-margin-block: calc((1 + var(--_pin-top-rows, 0)) * var(--_row-height))\n calc(var(--_pin-bottom-rows, 0) * var(--_row-height));\n }\n [role='gridcell']:not([data-pin]),\n [role='columnheader']:not([data-pin]) {\n scroll-margin-inline: var(--_pin-start, 0) var(--_pin-end, 0);\n }\n\n .row {\n display: grid;\n grid-template-columns: var(--_cols);\n inline-size: var(--_width);\n min-inline-size: 100%;\n block-size: var(--_row-height);\n box-sizing: border-box;\n }\n\n [part~='header'] {\n position: sticky;\n inset-block-start: 0;\n z-index: 2;\n }\n\n [part~='body'] {\n position: relative;\n contain: layout;\n }\n [part~='body'] > .row {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n }\n [part~='row'] {\n --_row-bg: var(--argus-bg, Canvas);\n --_row-surface: var(--_row-bg);\n background: var(--_row-surface);\n }\n [part~='row-odd'] {\n --_row-bg: var(--argus-row-stripe-bg, var(--argus-bg, Canvas));\n }\n [part~='row']:hover {\n --_row-surface: var(--argus-row-hover-bg, var(--_row-bg));\n }\n\n /*\n * Pinned rows: a sticky row group below the header and one at the bottom of\n * the view. The header is one row tall. They keep their place in the flow,\n * so body row i still starts i rows below the top group.\n */\n .pinned {\n position: sticky;\n z-index: 2;\n }\n .pinned[data-side='top'] {\n inset-block-start: var(--_row-height);\n }\n .pinned[data-side='bottom'] {\n inset-block-end: 0;\n }\n [part~='row-pinned'] {\n --_row-bg: var(--argus-pinned-row-bg, var(--argus-bg, Canvas));\n }\n\n [part~='cell'],\n [part~='header-cell'] {\n display: flex;\n align-items: center;\n min-inline-size: 0;\n box-sizing: border-box;\n padding-inline: var(--_pad);\n overflow: hidden;\n white-space: nowrap;\n border-block-end: var(--_border);\n }\n [part~='header-cell'] {\n background: var(--argus-header-bg, light-dark(#f9fafb, #111827));\n color: var(--argus-header-fg, inherit);\n font-weight: 600;\n }\n [part~='header-cell'] {\n position: relative;\n }\n [part~='resize-handle'] {\n position: absolute;\n inset-block: 0;\n inset-inline-end: 0;\n inline-size: 8px;\n z-index: 1;\n cursor: col-resize;\n touch-action: none;\n }\n [part~='resize-handle']::after {\n content: '';\n position: absolute;\n inset-block: 25%;\n inset-inline-end: 0;\n inline-size: 2px;\n background: var(--argus-resize-handle-color, light-dark(#9ca3af, #6b7280));\n opacity: 0;\n }\n [part~='header-cell']:hover [part~='resize-handle']::after,\n [part~='header-cell']:focus-visible [part~='resize-handle']::after,\n [part~='resize-handle'][data-active]::after {\n opacity: 1;\n }\n [data-sort-col] {\n cursor: pointer;\n user-select: none;\n }\n /* A drag on a reorderable header moves the column, so its text isn't selectable. */\n [data-move-col] {\n user-select: none;\n }\n [data-dragging],\n [data-dragging] [part~='header-cell'] {\n cursor: grabbing;\n }\n [part~='header-cell-dragging'] {\n opacity: 0.5;\n }\n /* The line where a dragged column would land, on the target header's logical edge. */\n [part~='drop-indicator'] {\n position: absolute;\n inset-block: 0;\n inline-size: 2px;\n z-index: 2;\n background: var(--argus-drop-indicator-color, Highlight);\n pointer-events: none;\n }\n [part~='drop-indicator'][data-edge='start'] {\n inset-inline-start: 0;\n }\n [part~='drop-indicator'][data-edge='end'] {\n inset-inline-end: 0;\n }\n [part~='header-cell']:focus-visible,\n [part~='cell']:focus-visible {\n outline: var(--argus-focus-ring, 2px solid Highlight);\n outline-offset: -2px;\n }\n /* A small chevron after the header content; only the sorted column shows it. */\n .sort-indicator {\n flex: none;\n inline-size: 0.35em;\n block-size: 0.35em;\n margin-inline-start: 0.4em;\n /* Physical sides on purpose: the chevron is rotated, so it must not mirror in RTL. */\n border-right: 0.12em solid currentColor;\n border-bottom: 0.12em solid currentColor;\n visibility: hidden;\n }\n [aria-sort] .sort-indicator {\n visibility: visible;\n }\n [aria-sort='ascending'] .sort-indicator {\n transform: translateY(0.1em) rotate(-135deg);\n }\n [aria-sort='descending'] .sort-indicator {\n transform: translateY(-0.1em) rotate(45deg);\n }\n [data-align='end'] .sort-indicator {\n order: -1;\n margin-inline: 0 0.4em;\n }\n /*\n * Pinned columns: sticky inside the scroll container, with offsets from the\n * table model. Logical insets make RTL work without extra rules.\n */\n [data-pin] {\n position: sticky;\n z-index: 1;\n }\n [data-pin='start'] {\n inset-inline-start: var(--_pin-offset);\n }\n [data-pin='end'] {\n inset-inline-end: var(--_pin-offset);\n }\n /*\n * Pinned body cells are sticky only while the table scrolls sideways\n * (data-hscroll on the scroller). At rest they are plain cells shifted by the\n * horizontal scroll offset, which vertical scrolling never changes: a sticky\n * cell per row is a compositing layer each, and Safari stutters moving them\n * (PinScrollController). Both place the cells at the same spot.\n */\n [part~='row'] > [data-pin] {\n position: relative;\n inset-inline: auto;\n }\n [part~='row'] > [data-pin='start'] {\n transform: translateX(var(--_sx, 0px));\n }\n [part~='row'] > [data-pin='end'] {\n transform: translateX(calc(var(--_sx, 0px) - var(--_dir) * var(--_max-x, 0px)));\n }\n [data-hscroll] [part~='row'] > [data-pin] {\n position: sticky;\n transform: none;\n }\n [data-hscroll] [part~='row'] > [data-pin='start'] {\n inset-inline-start: var(--_pin-offset);\n }\n [data-hscroll] [part~='row'] > [data-pin='end'] {\n inset-inline-end: var(--_pin-offset);\n }\n [part~='cell-pinned'] {\n background: var(--_row-surface);\n }\n /*\n * The edge shadow, once per pinned side (.pin-shadow, beside the scroller).\n * --argus-pinned-shadow is written for a shadow falling toward the end side;\n * the start edge in RTL and the end edge in LTR mirror it.\n */\n .pin-shadow {\n position: absolute;\n inset-block-start: 0;\n block-size: min(var(--_view-h, 100%), var(--_content-h, 100%));\n z-index: 3;\n pointer-events: none;\n }\n .pin-shadow[data-side='start'] {\n inset-inline-start: 0;\n }\n .pin-shadow[data-side='end'] {\n inset-inline-end: var(--_sb-x, 0px);\n }\n .pin-shadow::after {\n content: '';\n position: absolute;\n inset: 0;\n box-shadow: var(\n --argus-pinned-shadow,\n 4px 0 6px -4px light-dark(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.6))\n );\n transform: scaleX(var(--_dir));\n }\n .pin-shadow[data-side='end']::after {\n transform: scaleX(calc(-1 * var(--_dir)));\n }\n\n [data-align='center'] {\n justify-content: center;\n text-align: center;\n }\n [data-align='end'] {\n justify-content: flex-end;\n text-align: end;\n }\n ::slotted(*) {\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n /* Fitting a column to its content: set for one synchronous measurement, never painted. */\n [data-measure] {\n inline-size: max-content;\n }\n\n /* Rows of a data source that haven't loaded: a bar per cell, pulsing gently. */\n [part~='skeleton'] {\n flex: none;\n inline-size: min(60%, 8em);\n block-size: 0.6em;\n border-radius: 0.3em;\n background: var(--argus-skeleton-bg, color-mix(in srgb, currentColor 12%, transparent));\n animation: argus-skeleton-pulse 1.6s ease-in-out infinite;\n }\n [part~='skeleton-error'] {\n animation: none;\n opacity: 0.5;\n }\n @keyframes argus-skeleton-pulse {\n 50% {\n opacity: 0.45;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n [part~='skeleton'] {\n animation: none;\n }\n }\n [part~='retry'] {\n font: inherit;\n color: inherit;\n cursor: pointer;\n }\n\n [part~='empty'] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-block-size: calc(\n 100% - (1 + var(--_pin-top-rows, 0) + var(--_pin-bottom-rows, 0)) * var(--_row-height)\n );\n padding: var(--_pad);\n box-sizing: border-box;\n }\n\n /* Measures the resolved row height in px for the virtualizer. */\n .probe {\n position: absolute;\n inset-block-start: 0;\n inline-size: 0;\n block-size: var(--_row-height);\n visibility: hidden;\n pointer-events: none;\n }\n }\n`;\n"],"mappings":";;;;;;;AAOA,IAAa,aAAa,GAAG"}
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../../src/styles/base.ts"],"sourcesContent":["import { css } from 'lit';\n\n/**\n * Base styles. Everything sits in `@layer argus-base`, and every value reads a\n * public token with a neutral fallback, so themes and page CSS always win.\n * `--_*` properties are private.\n */\nexport const baseStyles = css`\n @layer argus-base {\n :host {\n display: block;\n /* A table that virtualizes needs a bounded height; set your own on the element. */\n block-size: 400px;\n box-sizing: border-box;\n contain: content;\n color-scheme: light dark;\n color: var(--argus-fg, CanvasText);\n background: var(--argus-bg, Canvas);\n font: var(--argus-font, inherit);\n /* contain: content clips the header, rows and pinned shadows to the rounded corners. */\n border: var(--argus-border, none);\n border-radius: var(--argus-border-radius, 0);\n --_row-height: var(--argus-row-height, 40px);\n --_pad: var(--argus-cell-padding-inline, 12px);\n --_border: var(--argus-border-width, 1px) solid\n var(--argus-border-color, light-dark(#e5e7eb, #374151));\n /* 1 in LTR, -1 in RTL: mirrors the pinned-edge shadow. */\n --_dir: 1;\n }\n :host(:dir(rtl)) {\n --_dir: -1;\n }\n :host([density='compact']) {\n --_row-height: var(--argus-row-height, 32px);\n --_pad: var(--argus-cell-padding-inline, 8px);\n }\n :host([density='spacious']) {\n --_row-height: var(--argus-row-height, 52px);\n --_pad: var(--argus-cell-padding-inline, 16px);\n }\n :host([hidden]) {\n display: none;\n }\n\n [part~='table'] {\n position: relative;\n block-size: 100%;\n overflow: auto;\n overscroll-behavior: contain;\n /* The header: one row tall, and a row more per level of column groups. */\n --_header-h: calc(var(--_header-rows, 1) * var(--_row-height));\n }\n\n /*\n * A cell focused or moved to by keyboard scrolls clear of the sticky header, the\n * pinned rows and the pinned columns: scroll margins on the cells that scroll.\n * Not scroll padding on the scroller: Chromium and WebKit measure the sticky\n * header and pinned rows against it too, so focusing one of them (a click, Tab,\n * an arrow key) scrolled the body.\n */\n [part~='body'] > .row > [role='gridcell'] {\n scroll-margin-block: calc(var(--_header-h) + var(--_pin-top-rows, 0) * var(--_row-height))\n calc(var(--_pin-bottom-rows, 0) * var(--_row-height));\n }\n [role='gridcell']:not([data-pin]),\n [role='columnheader']:not([data-pin]) {\n scroll-margin-inline: var(--_pin-start, 0) var(--_pin-end, 0);\n }\n\n .row {\n display: grid;\n grid-template-columns: var(--_cols);\n inline-size: var(--_width);\n min-inline-size: 100%;\n block-size: var(--_row-height);\n box-sizing: border-box;\n }\n\n [part~='header'] {\n position: sticky;\n inset-block-start: 0;\n z-index: 2;\n }\n\n [part~='body'] {\n position: relative;\n contain: layout;\n }\n [part~='body'] > .row {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n }\n [part~='row'] {\n --_row-bg: var(--argus-bg, Canvas);\n --_row-surface: var(--_row-bg);\n background: var(--_row-surface);\n }\n [part~='row-odd'] {\n --_row-bg: var(--argus-row-odd-bg, var(--argus-bg, Canvas));\n }\n [part~='row']:hover {\n --_row-surface: var(--argus-row-hover-bg, var(--_row-bg));\n }\n /* Selected wins over stripes and hover. */\n [part~='row-selected'],\n [part~='row-selected']:hover {\n --_row-bg: var(\n --argus-row-selected-bg,\n color-mix(in srgb, Highlight 22%, var(--argus-bg, Canvas))\n );\n --_row-surface: var(--_row-bg);\n }\n @media (forced-colors: active) {\n [part~='row-selected'] {\n forced-color-adjust: none;\n --_row-bg: Highlight;\n color: HighlightText;\n }\n }\n\n /*\n * Pinned rows: a sticky row group below the header and one at the bottom of\n * the view. The header is --_header-h tall. They keep their place in the flow,\n * so body row i still starts i rows below the top group.\n */\n .pinned {\n position: sticky;\n z-index: 2;\n }\n .pinned[data-side='top'] {\n inset-block-start: var(--_header-h);\n }\n .pinned[data-side='bottom'] {\n inset-block-end: 0;\n }\n [part~='row-pinned'] {\n --_row-bg: var(--argus-row-pinned-bg, var(--argus-bg, Canvas));\n }\n\n [part~='cell'],\n [part~='header-cell'] {\n display: flex;\n align-items: center;\n min-inline-size: 0;\n box-sizing: border-box;\n padding-inline: var(--_pad);\n overflow: hidden;\n white-space: nowrap;\n border-block-end: var(--_border);\n }\n /* The checkbox column: the checkbox centred, no padding to squeeze it. */\n [part~='cell-selection'],\n [part~='header-cell-selection'] {\n justify-content: center;\n padding-inline: 0;\n }\n [part~='selection-checkbox'] {\n margin: 0;\n cursor: pointer;\n }\n [part~='header-cell'] {\n background: var(--argus-header-bg, light-dark(#f9fafb, #111827));\n color: var(--argus-header-fg, inherit);\n font-weight: 600;\n position: relative;\n }\n /*\n * Column groups: a cell per group over its columns, and an empty filler over\n * columns without a group at that level, so the header reads as one block. The\n * label of a group in the scrolling area stays in view while its columns scroll\n * past (sticky inside the cell, which clips rather than scrolls).\n */\n [part~='header-group-cell'],\n [part~='header-group-filler'] {\n box-sizing: border-box;\n min-inline-size: 0;\n background: var(--argus-header-bg, light-dark(#f9fafb, #111827));\n color: var(--argus-header-fg, inherit);\n }\n [part~='header-group-cell'] {\n display: flex;\n align-items: center;\n position: relative;\n padding-inline: var(--_pad);\n overflow: clip;\n white-space: nowrap;\n font-weight: 600;\n border-block-end: var(--_border);\n border-inline-end: var(--_border);\n }\n .group-label {\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n [part~='header-group-cell']:not([data-pin]) > .group-label {\n position: sticky;\n inset-inline-start: calc(var(--_pin-start, 0px) + var(--_pad));\n }\n [data-move-group] {\n user-select: none;\n }\n [data-dragging] [part~='header-group-cell'] {\n cursor: grabbing;\n }\n [part~='header-group-cell-dragging'] {\n opacity: 0.5;\n }\n [part~='resize-handle'] {\n position: absolute;\n inset-block: 0;\n inset-inline-end: 0;\n inline-size: 8px;\n z-index: 1;\n cursor: col-resize;\n touch-action: none;\n }\n [part~='resize-handle']::after {\n content: '';\n position: absolute;\n inset-block: 25%;\n inset-inline-end: 0;\n inline-size: 2px;\n background: var(--argus-resize-handle-color, light-dark(#9ca3af, #6b7280));\n opacity: 0;\n }\n [part~='header-cell']:hover [part~='resize-handle']::after,\n [part~='header-cell']:focus-visible [part~='resize-handle']::after,\n [part~='header-group-cell']:hover [part~='resize-handle']::after,\n [part~='header-group-cell']:focus-visible [part~='resize-handle']::after,\n [part~='resize-handle'][data-active]::after {\n opacity: 1;\n }\n [data-sort-col] {\n cursor: pointer;\n user-select: none;\n }\n /* A drag on a reorderable header moves the column, so its text isn't selectable. */\n [data-move-col] {\n user-select: none;\n }\n [data-dragging],\n [data-dragging] [part~='header-cell'] {\n cursor: grabbing;\n }\n [part~='header-cell-dragging'] {\n opacity: 0.5;\n }\n /* The line where a dragged column would land, on the target header's logical edge. */\n [part~='drop-indicator'] {\n position: absolute;\n inset-block: 0;\n inline-size: 2px;\n z-index: 2;\n background: var(--argus-drop-indicator-color, Highlight);\n pointer-events: none;\n }\n [part~='drop-indicator'][data-edge='start'] {\n inset-inline-start: 0;\n }\n [part~='drop-indicator'][data-edge='end'] {\n inset-inline-end: 0;\n }\n [part~='header-cell']:focus-visible,\n [part~='header-group-cell']:focus-visible,\n [part~='cell']:focus-visible {\n outline: var(--argus-focus-ring, 2px solid Highlight);\n outline-offset: -2px;\n }\n /* A small chevron after the header content; only the sorted column shows it. */\n .sort-indicator {\n flex: none;\n inline-size: 0.35em;\n block-size: 0.35em;\n margin-inline-start: 0.4em;\n /* Physical sides on purpose: the chevron is rotated, so it must not mirror in RTL. */\n border-right: 0.12em solid currentColor;\n border-bottom: 0.12em solid currentColor;\n visibility: hidden;\n }\n [aria-sort] .sort-indicator {\n visibility: visible;\n }\n [aria-sort='ascending'] .sort-indicator {\n transform: translateY(0.1em) rotate(-135deg);\n }\n [aria-sort='descending'] .sort-indicator {\n transform: translateY(-0.1em) rotate(45deg);\n }\n [data-align='end'] .sort-indicator {\n order: -1;\n margin-inline: 0 0.4em;\n }\n /* A funnel: the column is filtered. */\n [part~='filter-indicator'] {\n flex: none;\n inline-size: 0.7em;\n block-size: 0.7em;\n margin-inline-start: 0.35em;\n background: var(--argus-filter-indicator-color, currentColor);\n clip-path: polygon(0 0, 100% 0, 62% 48%, 62% 100%, 38% 82%, 38% 48%);\n }\n [data-align='end'] [part~='filter-indicator'] {\n order: -2;\n margin-inline: 0 0.35em;\n }\n @media (forced-colors: active) {\n /* Backgrounds are forced to Canvas there, which would hide the funnel. */\n [part~='filter-indicator'] {\n forced-color-adjust: none;\n background: CanvasText;\n }\n }\n /*\n * Pinned columns: sticky inside the scroll container, with offsets from the\n * table model. Logical insets make RTL work without extra rules.\n */\n [data-pin] {\n position: sticky;\n z-index: 1;\n }\n [data-pin='start'] {\n inset-inline-start: var(--_pin-offset);\n }\n [data-pin='end'] {\n inset-inline-end: var(--_pin-offset);\n }\n /*\n * Pinned body cells are sticky only while the table scrolls sideways\n * (data-hscroll on the scroller). At rest they are plain cells shifted by the\n * horizontal scroll offset, which vertical scrolling never changes: a sticky\n * cell per row is a compositing layer each, and Safari stutters moving them\n * (PinScrollController). Both place the cells at the same spot.\n */\n [part~='row'] > [data-pin] {\n position: relative;\n inset-inline: auto;\n }\n [part~='row'] > [data-pin='start'] {\n transform: translateX(var(--_sx, 0px));\n }\n [part~='row'] > [data-pin='end'] {\n transform: translateX(calc(var(--_sx, 0px) - var(--_dir) * var(--_max-x, 0px)));\n }\n [data-hscroll] [part~='row'] > [data-pin] {\n position: sticky;\n transform: none;\n }\n [data-hscroll] [part~='row'] > [data-pin='start'] {\n inset-inline-start: var(--_pin-offset);\n }\n [data-hscroll] [part~='row'] > [data-pin='end'] {\n inset-inline-end: var(--_pin-offset);\n }\n [part~='cell-pinned'] {\n background: var(--_row-surface);\n }\n /*\n * The edge shadow, once per pinned side (.pin-shadow, beside the scroller).\n * --argus-pinned-shadow is written for a shadow falling toward the end side;\n * the start edge in RTL and the end edge in LTR mirror it.\n */\n .pin-shadow {\n position: absolute;\n inset-block-start: 0;\n block-size: min(var(--_view-h, 100%), var(--_content-h, 100%));\n z-index: 3;\n pointer-events: none;\n }\n .pin-shadow[data-side='start'] {\n inset-inline-start: 0;\n }\n .pin-shadow[data-side='end'] {\n inset-inline-end: var(--_sb-x, 0px);\n }\n .pin-shadow::after {\n content: '';\n position: absolute;\n inset: 0;\n box-shadow: var(\n --argus-pinned-shadow,\n 4px 0 6px -4px light-dark(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.6))\n );\n transform: scaleX(var(--_dir));\n }\n .pin-shadow[data-side='end']::after {\n transform: scaleX(calc(-1 * var(--_dir)));\n }\n\n [data-align='center'] {\n justify-content: center;\n text-align: center;\n }\n [data-align='end'] {\n justify-content: flex-end;\n text-align: end;\n }\n /*\n * Wrapped text (ColumnDef.wrap). In a fixed-height row, text taller than the row\n * starts at the top (safe) and is clipped below.\n */\n [part~='cell'][data-wrap] {\n white-space: normal;\n overflow-wrap: anywhere;\n align-items: center;\n align-items: safe center;\n }\n\n /*\n * rowHeight: 'auto'. Body and pinned rows fit their content, at least one row\n * tall; the header keeps its height. Content sits at the top of the cell, with\n * the block padding that centres one line in a one-row cell, so one-line rows\n * look as they do with a fixed height. The rows' heights are measured and\n * placed by the table: the browser's scroll anchoring would fight it.\n */\n [data-auto-rows] {\n overflow-anchor: none;\n }\n [data-auto-rows] > [part~='body'] > .row,\n [data-auto-rows] > .pinned > .row {\n block-size: auto;\n min-block-size: var(--_row-height);\n grid-template-rows: minmax(var(--_row-height), auto);\n }\n /* Reading the rows' own heights: without the height each row renders at. */\n [data-auto-rows] > [part~='body'] > .row[data-measure-row] {\n min-block-size: var(--_row-height) !important;\n }\n [data-auto-rows] [part~='cell'] {\n align-items: start;\n padding-block: var(\n --argus-cell-padding-block,\n max(0px, (var(--_row-height) - 1lh - var(--argus-border-width, 1px)) / 2)\n );\n }\n /* Skeleton bars and the Retry button, centred in a one-row row as before. */\n [data-auto-rows] [part~='row-loading'] > [part~='cell'] {\n align-items: center;\n padding-block: 0;\n }\n [data-auto-rows] > [part~='body'] > .row > [role='gridcell'] {\n scroll-margin-block: calc(var(--_header-h) + var(--_pin-top-h, 0px)) var(--_pin-bottom-h, 0px);\n }\n [data-auto-rows] > [part~='empty'] {\n min-block-size: calc(\n 100% - var(--_header-h) - var(--_pin-top-h, 0px) - var(--_pin-bottom-h, 0px)\n );\n }\n ::slotted(*) {\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n /* Fitting a column to its content: set for one synchronous measurement, never painted. */\n [data-measure] {\n inline-size: max-content;\n }\n\n /* Rows of a data source that haven't loaded: a bar per cell, pulsing gently. */\n [part~='skeleton'] {\n flex: none;\n inline-size: min(60%, 8em);\n block-size: 0.6em;\n border-radius: 0.3em;\n background: var(--argus-skeleton-bg, color-mix(in srgb, currentColor 12%, transparent));\n animation: argus-skeleton-pulse 1.6s ease-in-out infinite;\n }\n [part~='skeleton-error'] {\n animation: none;\n opacity: 0.5;\n }\n @keyframes argus-skeleton-pulse {\n 50% {\n opacity: 0.45;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n [part~='skeleton'] {\n animation: none;\n }\n }\n [part~='retry'] {\n font: inherit;\n color: inherit;\n cursor: pointer;\n }\n\n [part~='empty'] {\n display: flex;\n align-items: center;\n justify-content: center;\n min-block-size: calc(\n 100% - var(--_header-h) - (var(--_pin-top-rows, 0) + var(--_pin-bottom-rows, 0)) *\n var(--_row-height)\n );\n padding: var(--_pad);\n box-sizing: border-box;\n }\n\n /* Measures the resolved row height in px for the virtualizer. */\n .probe {\n position: absolute;\n inset-block-start: 0;\n inline-size: 0;\n block-size: var(--_row-height);\n visibility: hidden;\n pointer-events: none;\n }\n }\n`;\n"],"mappings":";;;;;;;AAOA,IAAa,aAAa,GAAG"}
|