apex-grid 3.5.0 → 4.0.0-beta.1
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 +573 -0
- package/LICENSE.md +125 -0
- package/README.md +143 -23
- package/components/cell.d.ts +43 -5
- package/components/cell.js +225 -64
- package/components/cell.js.map +1 -1
- package/components/filter-row.d.ts +2 -0
- package/components/filter-row.js +82 -28
- package/components/filter-row.js.map +1 -1
- package/components/grid.d.ts +281 -49
- package/components/grid.js +600 -159
- package/components/grid.js.map +1 -1
- package/components/group-header-row.js +28 -25
- package/components/group-header-row.js.map +1 -1
- package/components/header-row.d.ts +6 -10
- package/components/header-row.js +12 -28
- package/components/header-row.js.map +1 -1
- package/components/header.js +71 -22
- package/components/header.js.map +1 -1
- package/components/paginator.d.ts +20 -5
- package/components/paginator.js +54 -17
- package/components/paginator.js.map +1 -1
- package/components/row.d.ts +19 -3
- package/components/row.js +211 -56
- package/components/row.js.map +1 -1
- package/components/toolbar.d.ts +5 -1
- package/components/toolbar.js +6 -2
- package/components/toolbar.js.map +1 -1
- package/components/virtualize-rows.d.ts +38 -0
- package/components/virtualize-rows.js +286 -0
- package/components/virtualize-rows.js.map +1 -0
- package/components/virtualizer.d.ts +111 -1
- package/components/virtualizer.js +192 -5
- package/components/virtualizer.js.map +1 -1
- package/controllers/dom.d.ts +14 -7
- package/controllers/dom.js +45 -27
- package/controllers/dom.js.map +1 -1
- package/controllers/editing.d.ts +104 -37
- package/controllers/editing.js +230 -78
- package/controllers/editing.js.map +1 -1
- package/controllers/expansion.d.ts +14 -5
- package/controllers/expansion.js +24 -1
- package/controllers/expansion.js.map +1 -1
- package/controllers/filter.d.ts +10 -2
- package/controllers/filter.js +62 -17
- package/controllers/filter.js.map +1 -1
- package/controllers/history.d.ts +45 -8
- package/controllers/history.js +58 -20
- package/controllers/history.js.map +1 -1
- package/controllers/navigation.d.ts +130 -13
- package/controllers/navigation.js +474 -60
- package/controllers/navigation.js.map +1 -1
- package/controllers/pagination.d.ts +13 -6
- package/controllers/pagination.js +29 -22
- package/controllers/pagination.js.map +1 -1
- package/controllers/reorder.js +38 -22
- package/controllers/reorder.js.map +1 -1
- package/controllers/resize.d.ts +17 -2
- package/controllers/resize.js +16 -6
- package/controllers/resize.js.map +1 -1
- package/controllers/row-pin.d.ts +26 -2
- package/controllers/row-pin.js +24 -11
- package/controllers/row-pin.js.map +1 -1
- package/controllers/row-reorder.d.ts +40 -12
- package/controllers/row-reorder.js +137 -43
- package/controllers/row-reorder.js.map +1 -1
- package/controllers/selection.d.ts +33 -4
- package/controllers/selection.js +49 -11
- package/controllers/selection.js.map +1 -1
- package/controllers/sort.d.ts +22 -2
- package/controllers/sort.js +30 -25
- package/controllers/sort.js.map +1 -1
- package/controllers/state.d.ts +74 -7
- package/controllers/state.js +117 -36
- package/controllers/state.js.map +1 -1
- package/controllers/tree.d.ts +15 -10
- package/controllers/tree.js +0 -0
- package/controllers/tree.js.map +1 -1
- package/custom-elements.json +5091 -1023
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/highlight.css +15 -8
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/ApexGrid.html +233 -87
- package/docs/classes/ApexGridPaginator.html +39 -8
- package/docs/classes/ApexGridToolbar.html +11 -7
- package/docs/functions/localize.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +159 -26
- package/docs/interfaces/ApexCellValidationFailedEvent.html +3 -2
- package/docs/interfaces/ApexCellValueChangedEvent.html +4 -2
- package/docs/interfaces/ApexCellValueChangingEvent.html +3 -2
- package/docs/interfaces/ApexGridEventMap.html +5 -2
- package/docs/interfaces/ApexPageChangedEvent.html +3 -1
- package/docs/interfaces/ApexRowEditEndedEvent.html +2 -1
- package/docs/interfaces/ApexRowEditStartedEvent.html +2 -1
- package/docs/interfaces/ApexRowMovingEvent.html +9 -3
- package/docs/interfaces/ApexRowPinningEvent.html +1 -1
- package/docs/interfaces/ApexTreeRowExpandedEvent.html +4 -1
- package/docs/interfaces/ApexTreeRowExpandingEvent.html +4 -1
- package/docs/interfaces/BaseApexCellContext.html +18 -5
- package/docs/interfaces/BaseApexEditorContext.html +20 -5
- package/docs/interfaces/BaseFilterExpression.html +3 -3
- package/docs/interfaces/CSVExportOptions.html +12 -4
- package/docs/interfaces/DataPipelineConfiguration.html +4 -9
- package/docs/interfaces/ExportOptions.html +5 -3
- package/docs/interfaces/GridExpansionConfiguration.html +6 -2
- package/docs/interfaces/GridRowReorderingConfiguration.html +1 -1
- package/docs/interfaces/GridSelectionConfiguration.html +19 -4
- package/docs/interfaces/PaginationConfiguration.html +11 -4
- package/docs/interfaces/PaginationState.html +4 -2
- package/docs/interfaces/SetStateResult.html +3 -2
- package/docs/interfaces/ValidatorContext.html +7 -2
- package/docs/media/_token-values.scss +118 -0
- package/docs/media/package.json +9 -5
- package/docs/modules.html +1 -1
- package/docs/types/DataPipelineParams.html +2 -2
- package/docs/types/ExportSource.html +6 -4
- package/docs/types/OperandKeys.html +9 -0
- package/docs/types/PaginationMode.html +5 -4
- package/docs/variables/EN_LOCALE.html +2 -2
- package/i18n/en.d.ts +7 -0
- package/i18n/en.js +7 -0
- package/i18n/en.js.map +1 -1
- package/i18n/es.js +7 -0
- package/i18n/es.js.map +1 -1
- package/internal/column-types.d.ts +38 -2
- package/internal/column-types.js +83 -55
- package/internal/column-types.js.map +1 -1
- package/internal/constants.d.ts +1 -2
- package/internal/constants.js +0 -4
- package/internal/constants.js.map +1 -1
- package/internal/document-styles.d.ts +30 -0
- package/internal/document-styles.js +48 -0
- package/internal/document-styles.js.map +1 -0
- package/internal/export.d.ts +45 -7
- package/internal/export.js +39 -34
- package/internal/export.js.map +1 -1
- package/internal/feature-module.d.ts +67 -3
- package/internal/feature-module.js +6 -0
- package/internal/feature-module.js.map +1 -1
- package/internal/flip.d.ts +28 -16
- package/internal/flip.js +42 -10
- package/internal/flip.js.map +1 -1
- package/internal/index.d.ts +7 -5
- package/internal/index.js +6 -4
- package/internal/index.js.map +1 -1
- package/internal/normalize-case.d.ts +8 -1
- package/internal/normalize-case.js +3 -2
- package/internal/normalize-case.js.map +1 -1
- package/internal/state-snapshot.d.ts +60 -8
- package/internal/state-snapshot.js +87 -19
- package/internal/state-snapshot.js.map +1 -1
- package/internal/types.d.ts +92 -21
- package/internal/types.js.map +1 -1
- package/internal/utils.d.ts +34 -6
- package/internal/utils.js +30 -21
- package/internal/utils.js.map +1 -1
- package/internal/validators.js +1 -0
- package/internal/validators.js.map +1 -1
- package/operations/filter/operands/number.js +9 -6
- package/operations/filter/operands/number.js.map +1 -1
- package/operations/filter/operands/string.js +2 -3
- package/operations/filter/operands/string.js.map +1 -1
- package/operations/filter/types.d.ts +14 -2
- package/operations/filter/types.js.map +1 -1
- package/operations/filter.d.ts +6 -0
- package/operations/filter.js +23 -7
- package/operations/filter.js.map +1 -1
- package/operations/quick-filter.js +2 -5
- package/operations/quick-filter.js.map +1 -1
- package/operations/sort.d.ts +21 -2
- package/operations/sort.js +41 -14
- package/operations/sort.js.map +1 -1
- package/package.json +9 -4
- package/setup.d.ts +11 -0
- package/setup.js +9 -19
- package/setup.js.map +1 -1
- package/styles/_token-values.css.d.ts +1 -0
- package/styles/_token-values.css.js +3 -0
- package/styles/_token-values.css.js.map +1 -0
- package/styles/_tokens.css.js +1 -1
- package/styles/_tokens.css.js.map +1 -1
- package/styles/body-cell/body-cell.css.js +1 -1
- package/styles/body-cell/body-cell.css.js.map +1 -1
- package/styles/body-cell/cell-renderers.css.js +1 -1
- package/styles/body-cell/cell-renderers.css.js.map +1 -1
- package/styles/body-row/body-row.css.js +1 -1
- package/styles/body-row/body-row.css.js.map +1 -1
- package/styles/document-tokens.css.d.ts +1 -0
- package/styles/document-tokens.css.js +3 -0
- package/styles/document-tokens.css.js.map +1 -0
- package/styles/filter-row/filter-row.css.js +1 -1
- package/styles/filter-row/filter-row.css.js.map +1 -1
- package/styles/grid/_grid.base.css.js +1 -1
- package/styles/grid/_grid.base.css.js.map +1 -1
- package/styles/grid/grid.css.js +1 -1
- package/styles/grid/grid.css.js.map +1 -1
- package/styles/group-header-row/group-header-row.css.js +1 -1
- package/styles/group-header-row/group-header-row.css.js.map +1 -1
- package/styles/header-cell/header-cell.css.js +1 -1
- package/styles/header-cell/header-cell.css.js.map +1 -1
- package/styles/header-row/header-row.base.css.js +1 -1
- package/styles/header-row/header-row.base.css.js.map +1 -1
- package/styles/paginator/paginator.css.js +1 -1
- package/styles/paginator/paginator.css.js.map +1 -1
- package/styles/toolbar/toolbar.css.js +1 -1
- package/styles/toolbar/toolbar.css.js.map +1 -1
- package/tokens.css +78 -0
- package/LICENSE +0 -80
- package/docs/media/LICENSE +0 -80
- package/docs/media/_tokens.scss +0 -214
- package/operations/pagination.d.ts +0 -19
- package/operations/pagination.js +0 -12
- package/operations/pagination.js.map +0 -1
package/components/row.js
CHANGED
|
@@ -5,10 +5,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { consume } from '@lit/context';
|
|
8
|
-
import { html, LitElement, nothing } from 'lit';
|
|
8
|
+
import { html, LitElement, nothing, render } from 'lit';
|
|
9
9
|
import { property, queryAll } from 'lit/decorators.js';
|
|
10
|
+
import { keyed } from 'lit/directives/keyed.js';
|
|
11
|
+
import { live } from 'lit/directives/live.js';
|
|
10
12
|
import { repeat } from 'lit/directives/repeat.js';
|
|
13
|
+
import { captureRowGhost } from '../controllers/row-reorder.js';
|
|
11
14
|
import { gridStateContext } from '../controllers/state.js';
|
|
15
|
+
import { cancelFlips, FLIP_ID_Y, hasFlipsInFlight } from '../internal/flip.js';
|
|
12
16
|
import { registerComponent } from '../internal/register.js';
|
|
13
17
|
import { GRID_ROW_TAG } from '../internal/tags.js';
|
|
14
18
|
import { getPinEdge } from '../internal/utils.js';
|
|
@@ -28,6 +32,71 @@ const GRIP_ICON = html `<svg
|
|
|
28
32
|
<circle cx="6" cy="12.5" r="1.25" />
|
|
29
33
|
<circle cx="10" cy="12.5" r="1.25" />
|
|
30
34
|
</svg>`;
|
|
35
|
+
let reboundPending = new Set();
|
|
36
|
+
let reboundPainted = new Set();
|
|
37
|
+
let reboundFrame = 0;
|
|
38
|
+
function clearRebound() {
|
|
39
|
+
reboundFrame = 0;
|
|
40
|
+
for (const row of reboundPainted)
|
|
41
|
+
row.removeAttribute('data-rebound');
|
|
42
|
+
reboundPainted = reboundPending;
|
|
43
|
+
reboundPending = new Set();
|
|
44
|
+
if (reboundPainted.size)
|
|
45
|
+
reboundFrame = requestAnimationFrame(clearRebound);
|
|
46
|
+
}
|
|
47
|
+
function markRebound(row) {
|
|
48
|
+
row.setAttribute('data-rebound', '');
|
|
49
|
+
reboundPainted.delete(row);
|
|
50
|
+
reboundPending.add(row);
|
|
51
|
+
if (!reboundFrame)
|
|
52
|
+
reboundFrame = requestAnimationFrame(clearRebound);
|
|
53
|
+
}
|
|
54
|
+
let detailKey = 0;
|
|
55
|
+
class DetailRoots {
|
|
56
|
+
#roots = new Map();
|
|
57
|
+
#frame = 0;
|
|
58
|
+
show(record, content, host, row) {
|
|
59
|
+
let root = this.#roots.get(record);
|
|
60
|
+
if (!root) {
|
|
61
|
+
const node = document.createElement('div');
|
|
62
|
+
node.style.display = 'contents';
|
|
63
|
+
root = { node, part: render(nothing, node, { host }), owner: null, key: 0 };
|
|
64
|
+
this.#roots.set(record, root);
|
|
65
|
+
}
|
|
66
|
+
if (root.owner !== row) {
|
|
67
|
+
root.owner = row;
|
|
68
|
+
root.key = ++detailKey;
|
|
69
|
+
}
|
|
70
|
+
render(content, root.node);
|
|
71
|
+
return keyed(root.key, root.node);
|
|
72
|
+
}
|
|
73
|
+
drop(record) {
|
|
74
|
+
const root = this.#roots.get(record);
|
|
75
|
+
if (!root)
|
|
76
|
+
return;
|
|
77
|
+
this.#roots.delete(record);
|
|
78
|
+
root.part.setConnected(false);
|
|
79
|
+
}
|
|
80
|
+
schedule() {
|
|
81
|
+
if (this.#frame || this.#roots.size === 0)
|
|
82
|
+
return;
|
|
83
|
+
this.#frame = requestAnimationFrame(() => {
|
|
84
|
+
this.#frame = 0;
|
|
85
|
+
for (const [record, root] of this.#roots) {
|
|
86
|
+
if (!inBodyRow(root.node))
|
|
87
|
+
this.drop(record);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function inBodyRow(node) {
|
|
93
|
+
if (!node.parentNode)
|
|
94
|
+
return false;
|
|
95
|
+
const row = node.getRootNode().host;
|
|
96
|
+
return row?.parentNode?.nodeType === Node.ELEMENT_NODE;
|
|
97
|
+
}
|
|
98
|
+
const detailRoots = new WeakMap();
|
|
99
|
+
const ROW_PARTS = 'cell,row-number-cell,row-number,reorder-handle-cell,reorder-handle,reorder-grip,selection-cell,selection-checkbox,expansion-cell,expansion-toggle,expansion-chevron,detail-panel,group-row';
|
|
31
100
|
export default class ApexGridRow extends LitElement {
|
|
32
101
|
constructor() {
|
|
33
102
|
super(...arguments);
|
|
@@ -41,10 +110,9 @@ export default class ApexGridRow extends LitElement {
|
|
|
41
110
|
this.coordinateHints = false;
|
|
42
111
|
this.editingKey = null;
|
|
43
112
|
this.decorationVersion = 0;
|
|
113
|
+
this.dataVersion = 0;
|
|
44
114
|
this.validationVersion = 0;
|
|
45
115
|
this.#presented = null;
|
|
46
|
-
this.#dragStartX = 0;
|
|
47
|
-
this.#dragStartY = 0;
|
|
48
116
|
this.#handleReorderPointerDown = (event) => {
|
|
49
117
|
const reorder = this.state?.rowReorder;
|
|
50
118
|
if (!reorder?.enabled || event.button !== 0 || !this.data)
|
|
@@ -66,9 +134,9 @@ export default class ApexGridRow extends LitElement {
|
|
|
66
134
|
return;
|
|
67
135
|
}
|
|
68
136
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
reorder.armPointerDrag(
|
|
137
|
+
const data = this.data;
|
|
138
|
+
const { clientX, clientY } = event;
|
|
139
|
+
reorder.armPointerDrag(data, () => (this.data === data ? this.#captureGhost(clientX, clientY) : null), event);
|
|
72
140
|
};
|
|
73
141
|
this.ariaRowOffset = 1;
|
|
74
142
|
}
|
|
@@ -82,39 +150,47 @@ export default class ApexGridRow extends LitElement {
|
|
|
82
150
|
get cells() {
|
|
83
151
|
return Array.from(this._cells);
|
|
84
152
|
}
|
|
153
|
+
get presentedCell() {
|
|
154
|
+
return this.#presented
|
|
155
|
+
? this.renderRoot.querySelector('[data-presented-cell]')
|
|
156
|
+
: null;
|
|
157
|
+
}
|
|
85
158
|
#presented;
|
|
86
|
-
#dragStartX;
|
|
87
|
-
#dragStartY;
|
|
88
159
|
#handleReorderPointerDown;
|
|
89
160
|
#captureGhost(clientX, clientY) {
|
|
90
|
-
|
|
91
|
-
const cells = this.cells.map((cell) => {
|
|
92
|
-
const el = cell;
|
|
93
|
-
return {
|
|
94
|
-
text: (el.textContent ?? '').replace(/\s+/g, ' ').trim(),
|
|
95
|
-
width: el.getBoundingClientRect().width,
|
|
96
|
-
align: getComputedStyle(el).textAlign,
|
|
97
|
-
};
|
|
98
|
-
});
|
|
99
|
-
return { rect, clientX, clientY, cells };
|
|
161
|
+
return captureRowGhost(this, this.cells, clientX, clientY);
|
|
100
162
|
}
|
|
101
163
|
connectedCallback() {
|
|
102
164
|
super.connectedCallback();
|
|
103
|
-
this.setAttribute('exportparts', 'cell');
|
|
104
165
|
this.setAttribute('role', 'row');
|
|
105
166
|
this.addEventListener('pointerdown', this.#handleReorderPointerDown);
|
|
106
167
|
}
|
|
107
168
|
disconnectedCallback() {
|
|
108
169
|
this.removeEventListener('pointerdown', this.#handleReorderPointerDown);
|
|
170
|
+
const host = this.state?.host;
|
|
171
|
+
if (host)
|
|
172
|
+
detailRoots.get(host)?.schedule();
|
|
109
173
|
super.disconnectedCallback();
|
|
110
174
|
}
|
|
175
|
+
#renderedData;
|
|
111
176
|
willUpdate() {
|
|
177
|
+
if (this.data !== this.#renderedData) {
|
|
178
|
+
const rebound = this.#renderedData !== undefined;
|
|
179
|
+
if (rebound && hasFlipsInFlight())
|
|
180
|
+
cancelFlips(this, FLIP_ID_Y);
|
|
181
|
+
this.#renderedData = this.data;
|
|
182
|
+
if (rebound || this.state?.host?.rowRecycling)
|
|
183
|
+
markRebound(this);
|
|
184
|
+
}
|
|
112
185
|
this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));
|
|
186
|
+
this.toggleAttribute('data-alt', this.index % 2 === 1);
|
|
113
187
|
this.#presented = this.state
|
|
114
188
|
? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })
|
|
115
189
|
: null;
|
|
190
|
+
this.#syncExportParts();
|
|
116
191
|
if (this.#presented) {
|
|
117
192
|
this.selected = false;
|
|
193
|
+
this.expanded = false;
|
|
118
194
|
this.removeAttribute('aria-selected');
|
|
119
195
|
if (typeof this.#presented.level === 'number') {
|
|
120
196
|
this.setAttribute('aria-level', String(this.#presented.level));
|
|
@@ -130,9 +206,10 @@ export default class ApexGridRow extends LitElement {
|
|
|
130
206
|
}
|
|
131
207
|
return;
|
|
132
208
|
}
|
|
133
|
-
|
|
209
|
+
const selection = this.state?.selection;
|
|
210
|
+
this.selected = Boolean(selection?.isSelected(this.data));
|
|
134
211
|
this.expanded = Boolean(this.state?.expansion.isExpanded(this.data));
|
|
135
|
-
if (this.
|
|
212
|
+
if (selection?.enabled && (this.selected || selection.isSelectable(this.data))) {
|
|
136
213
|
this.setAttribute('aria-selected', this.selected ? 'true' : 'false');
|
|
137
214
|
}
|
|
138
215
|
else {
|
|
@@ -170,7 +247,8 @@ export default class ApexGridRow extends LitElement {
|
|
|
170
247
|
}
|
|
171
248
|
else {
|
|
172
249
|
this.removeAttribute('aria-level');
|
|
173
|
-
if (this.state?.
|
|
250
|
+
if (this.state?.hierarchical &&
|
|
251
|
+
(this.expanded || this.state.expansion.canExpand(this.data))) {
|
|
174
252
|
this.setAttribute('aria-expanded', this.expanded ? 'true' : 'false');
|
|
175
253
|
}
|
|
176
254
|
else {
|
|
@@ -179,12 +257,28 @@ export default class ApexGridRow extends LitElement {
|
|
|
179
257
|
}
|
|
180
258
|
}
|
|
181
259
|
}
|
|
260
|
+
#syncExportParts() {
|
|
261
|
+
const presented = this.#presented;
|
|
262
|
+
const own = presented?.part?.split(' ').join(',');
|
|
263
|
+
const list = presented ? presented.exportParts : this.state?.host.expansion?.exportParts;
|
|
264
|
+
let value = ROW_PARTS;
|
|
265
|
+
if (own)
|
|
266
|
+
value += `,${own}`;
|
|
267
|
+
if (list?.length)
|
|
268
|
+
value += `,${list.join(',')}`;
|
|
269
|
+
if (this.getAttribute('exportparts') !== value) {
|
|
270
|
+
this.setAttribute('exportparts', value);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
182
273
|
renderRowNumber() {
|
|
183
274
|
if (!this.coordinateHints)
|
|
184
275
|
return nothing;
|
|
185
|
-
|
|
276
|
+
let label = this.state?.rowCoordinate(this.data);
|
|
277
|
+
if (label === undefined) {
|
|
278
|
+
label = this.state?.rowPin?.isPinned(this.data) ? null : this.index + 1;
|
|
279
|
+
}
|
|
186
280
|
return html `<div part="row-number-cell" data-pinned="start" aria-hidden="true">
|
|
187
|
-
${
|
|
281
|
+
${label === null ? nothing : html `<span part="row-number">${label}</span>`}
|
|
188
282
|
</div>`;
|
|
189
283
|
}
|
|
190
284
|
renderReorderHandle() {
|
|
@@ -218,7 +312,7 @@ export default class ApexGridRow extends LitElement {
|
|
|
218
312
|
type="button"
|
|
219
313
|
part="expansion-toggle"
|
|
220
314
|
aria-label=${expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')}
|
|
221
|
-
aria-expanded=${
|
|
315
|
+
aria-expanded=${canExpand ? String(expanded) : nothing}
|
|
222
316
|
?disabled=${!canExpand}
|
|
223
317
|
@click=${handleClick}
|
|
224
318
|
>
|
|
@@ -243,47 +337,101 @@ export default class ApexGridRow extends LitElement {
|
|
|
243
337
|
}
|
|
244
338
|
renderDetailPanel() {
|
|
245
339
|
const expansion = this.state?.expansion;
|
|
246
|
-
|
|
340
|
+
const host = this.state?.host;
|
|
341
|
+
const roots = host && detailRoots.get(host);
|
|
342
|
+
roots?.schedule();
|
|
343
|
+
if (!expansion?.isExpanded(this.data)) {
|
|
344
|
+
roots?.drop(this.data);
|
|
247
345
|
return nothing;
|
|
248
|
-
|
|
346
|
+
}
|
|
347
|
+
const template = host.expansion?.detailTemplate;
|
|
249
348
|
if (typeof template !== 'function')
|
|
250
349
|
return nothing;
|
|
251
350
|
const content = template({
|
|
252
351
|
data: this.data,
|
|
253
352
|
rowIndex: this.index,
|
|
254
|
-
parent:
|
|
353
|
+
parent: host,
|
|
255
354
|
});
|
|
256
|
-
|
|
355
|
+
let detail;
|
|
356
|
+
if (host.rowRecycling && !this.state.rowPin.isPinned(this.data)) {
|
|
357
|
+
let own = roots;
|
|
358
|
+
if (!own) {
|
|
359
|
+
own = new DetailRoots();
|
|
360
|
+
detailRoots.set(host, own);
|
|
361
|
+
}
|
|
362
|
+
detail = own.show(this.data, content, host, this);
|
|
363
|
+
own.schedule();
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
detail = keyed(this.data, content);
|
|
367
|
+
}
|
|
368
|
+
return html `<div
|
|
369
|
+
part="detail-panel"
|
|
370
|
+
role="gridcell"
|
|
371
|
+
aria-colindex="1"
|
|
372
|
+
aria-colspan=${this.state.colCount}
|
|
373
|
+
>
|
|
374
|
+
<div role="region" aria-label=${this.state.localize('row.detail')}>${detail}</div>
|
|
375
|
+
</div>`;
|
|
257
376
|
}
|
|
258
377
|
renderSelectionCell(colindex) {
|
|
259
|
-
|
|
378
|
+
const selection = this.state?.selection;
|
|
379
|
+
if (!selection?.showCheckboxColumn)
|
|
260
380
|
return nothing;
|
|
261
|
-
const
|
|
381
|
+
const modifierToggle = (event) => {
|
|
382
|
+
if (selection.mode !== 'multiple')
|
|
383
|
+
return false;
|
|
384
|
+
if (event.shiftKey) {
|
|
385
|
+
void selection.rangeToggle(this.data);
|
|
386
|
+
}
|
|
387
|
+
else if (event.ctrlKey || event.metaKey) {
|
|
388
|
+
void selection.additiveToggle(this.data);
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
return true;
|
|
394
|
+
};
|
|
262
395
|
const handleChange = (event) => {
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
this.
|
|
396
|
+
const input = event.target;
|
|
397
|
+
const cell = input.parentElement;
|
|
398
|
+
const focused = this.renderRoot instanceof ShadowRoot && this.renderRoot.activeElement === input;
|
|
399
|
+
const record = this.data;
|
|
400
|
+
void selection.toggleRow(record).then(async () => {
|
|
401
|
+
if (this.data === record)
|
|
402
|
+
input.checked = selection.isSelected(record);
|
|
403
|
+
if (!focused || !cell)
|
|
404
|
+
return;
|
|
405
|
+
await this.updateComplete;
|
|
406
|
+
if (input.isConnected)
|
|
407
|
+
return;
|
|
408
|
+
cell.tabIndex = -1;
|
|
409
|
+
cell.addEventListener('blur', () => cell.removeAttribute('tabindex'), { once: true });
|
|
410
|
+
cell.focus({ preventScroll: true });
|
|
411
|
+
});
|
|
266
412
|
};
|
|
267
413
|
const handleClick = (event) => {
|
|
268
414
|
event.stopPropagation();
|
|
269
|
-
if (event
|
|
270
|
-
event.preventDefault();
|
|
271
|
-
void this.state.selection.rangeToggle(this.data);
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
if ((event.ctrlKey || event.metaKey) && this.state.selection.mode === 'multiple') {
|
|
415
|
+
if (modifierToggle(event))
|
|
275
416
|
event.preventDefault();
|
|
276
|
-
void this.state.selection.additiveToggle(this.data);
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
417
|
};
|
|
280
418
|
const forwardToCheckbox = (event) => {
|
|
281
|
-
|
|
282
|
-
if (target instanceof HTMLInputElement)
|
|
419
|
+
if (event.target instanceof HTMLInputElement || modifierToggle(event))
|
|
283
420
|
return;
|
|
284
|
-
event.currentTarget
|
|
285
|
-
|
|
421
|
+
event.currentTarget
|
|
422
|
+
.querySelector('input[type="checkbox"]')
|
|
423
|
+
?.click();
|
|
286
424
|
};
|
|
425
|
+
const checkbox = this.selected || selection.isSelectable(this.data)
|
|
426
|
+
? html `<input
|
|
427
|
+
type="checkbox"
|
|
428
|
+
part="selection-checkbox"
|
|
429
|
+
aria-label=${this.state.localize('row.select')}
|
|
430
|
+
.checked=${live(this.selected)}
|
|
431
|
+
@click=${handleClick}
|
|
432
|
+
@change=${handleChange}
|
|
433
|
+
/>`
|
|
434
|
+
: nothing;
|
|
287
435
|
return html `<div
|
|
288
436
|
part="selection-cell"
|
|
289
437
|
role="gridcell"
|
|
@@ -291,19 +439,20 @@ export default class ApexGridRow extends LitElement {
|
|
|
291
439
|
data-pinned="start"
|
|
292
440
|
@click=${forwardToCheckbox}
|
|
293
441
|
>
|
|
294
|
-
|
|
295
|
-
type="checkbox"
|
|
296
|
-
part="selection-checkbox"
|
|
297
|
-
aria-label=${this.state.localize('row.select')}
|
|
298
|
-
.checked=${selected}
|
|
299
|
-
@click=${handleClick}
|
|
300
|
-
@change=${handleChange}
|
|
301
|
-
/>
|
|
442
|
+
${checkbox}
|
|
302
443
|
</div>`;
|
|
303
444
|
}
|
|
304
445
|
render() {
|
|
305
446
|
if (this.#presented) {
|
|
306
|
-
return html `<div
|
|
447
|
+
return html `<div
|
|
448
|
+
part=${this.#presented.part ?? 'group-row'}
|
|
449
|
+
role="gridcell"
|
|
450
|
+
aria-colindex="1"
|
|
451
|
+
aria-colspan=${Math.max(1, this.state.colCount)}
|
|
452
|
+
tabindex=${this.activeNode?.row === this.index ? 0 : -1}
|
|
453
|
+
data-presented-cell
|
|
454
|
+
style="grid-column: 1 / -1"
|
|
455
|
+
>
|
|
307
456
|
${this.#presented.content}
|
|
308
457
|
</div>`;
|
|
309
458
|
}
|
|
@@ -336,9 +485,12 @@ export default class ApexGridRow extends LitElement {
|
|
|
336
485
|
.editing=${editing}
|
|
337
486
|
.column=${column}
|
|
338
487
|
.row=${this}
|
|
488
|
+
.record=${this.data}
|
|
339
489
|
.value=${this.data[column.key]}
|
|
340
490
|
.colindex=${ariaColindex}
|
|
491
|
+
.rowIndex=${this.index}
|
|
341
492
|
.decorationVersion=${this.decorationVersion}
|
|
493
|
+
.dataVersion=${this.dataVersion}
|
|
342
494
|
.validationVersion=${this.validationVersion}
|
|
343
495
|
></apex-grid-cell>`;
|
|
344
496
|
})}
|
|
@@ -389,6 +541,9 @@ __decorate([
|
|
|
389
541
|
__decorate([
|
|
390
542
|
property({ attribute: false, type: Number })
|
|
391
543
|
], ApexGridRow.prototype, "decorationVersion", void 0);
|
|
544
|
+
__decorate([
|
|
545
|
+
property({ attribute: false })
|
|
546
|
+
], ApexGridRow.prototype, "dataVersion", void 0);
|
|
392
547
|
__decorate([
|
|
393
548
|
property({ attribute: false, type: Number })
|
|
394
549
|
], ApexGridRow.prototype, "validationVersion", void 0);
|
package/components/row.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../src/components/row.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,YAAY,MAAM,WAAW,CAAC;AAGrC,MAAM,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E,IAAI,EAAE,MAAM,EAAE,CAAC;kDACpB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing } from 'lit';\nimport { property, queryAll } from 'lit/decorators.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport type { RowGhostInit } from '../controllers/row-reorder.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport type { PresentedRow } from '../internal/feature-module.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_ROW_TAG } from '../internal/tags.js';\nimport type { ActiveNode, ColumnConfiguration, Keys } from '../internal/types.js';\nimport { getPinEdge } from '../internal/utils.js';\nimport { styles } from '../styles/body-row/body-row.css.js';\nimport ApexGridCell from './cell.js';\n\n/** The six-dot grip drawn inside the row-reorder drag handle. */\nconst GRIP_ICON = html`<svg\n part=\"reorder-grip\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n>\n <circle cx=\"6\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"12.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"12.5\" r=\"1.25\" />\n</svg>`;\n\n/**\n * Component representing the DOM row in the Apex grid.\n */\nexport default class ApexGridRow<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_ROW_TAG;\n }\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridRow, ApexGridCell);\n }\n\n @queryAll(ApexGridCell.tagName)\n protected _cells!: NodeListOf<ApexGridCell<T>>;\n\n @property({ attribute: false })\n public data!: T;\n\n @property({ attribute: false })\n public columns: Array<ColumnConfiguration<T>> = [];\n\n /** Cumulative pin offsets (px) keyed by column key. */\n @property({ attribute: false })\n public pinOffsets: Map<unknown, number> = new Map();\n\n public get cells() {\n return Array.from(this._cells);\n }\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n @property({ attribute: false })\n public activeNode!: ActiveNode<T>;\n\n @property({ attribute: false, type: Number })\n public index = -1;\n\n /** Reflects current selection state so SCSS can highlight the row. */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /** Reflects current expansion state so SCSS can rotate the chevron. */\n @property({ type: Boolean, reflect: true })\n public expanded = false;\n\n /** Reflects pointer-drag state (row reorder) so SCSS can dim the source. */\n @property({ type: Boolean, reflect: true })\n public dragging = false;\n\n /** Reflects keyboard-grab state (row reorder) so SCSS can outline the row. */\n @property({ type: Boolean, reflect: true })\n public grabbed = false;\n\n /** Reveal the spreadsheet row-number gutter cell (transient formula coordinate hint). */\n @property({ type: Boolean })\n public coordinateHints = false;\n\n /** The column key currently being edited in this row, or `null`. */\n @property({ attribute: false })\n public editingKey: Keys<T> | null = null;\n\n /**\n * Reactive token from {@link StateController.decorationVersion}, forwarded to\n * each cell so a decoration-only change re-renders the row's cells. Stays `0`\n * for the community grid.\n */\n @property({ attribute: false, type: Number })\n public decorationVersion = 0;\n\n /**\n * Reactive token from {@link EditingController.validationVersion}, forwarded to\n * each cell so a validation-only change re-renders the row's cells (toggling\n * `aria-invalid` and the inline error node). Stays `0` until the first\n * validation failure.\n */\n @property({ attribute: false, type: Number })\n public validationVersion = 0;\n\n /**\n * Result of the feature-module row presenter for the current update, or\n * `null` when no module renders this row full-width (the normal case).\n * Computed in {@link willUpdate} and consumed in {@link render}.\n */\n #presented: PresentedRow | null = null;\n\n #dragStartX = 0;\n #dragStartY = 0;\n\n /**\n * Arms a row drag. In handle mode only the grip starts one; in whole-row mode\n * a press anywhere except an interactive sub-part does. The move / up plumbing\n * lives on the grid host (see {@link RowReorderController.armPointerDrag}), so\n * a live-swap that recycles this row's DOM can't break the gesture.\n */\n #handleReorderPointerDown = (event: PointerEvent) => {\n const reorder = this.state?.rowReorder;\n if (!reorder?.enabled || event.button !== 0 || !this.data) return;\n // Pinned rows are not reorder sources (F4 scope).\n if (this.state.rowPin.isPinned(this.data)) return;\n\n const path = event.composedPath();\n const onHandle = path.some(\n (node) =>\n node instanceof Element && (node.getAttribute?.('part') ?? '').includes('reorder-handle')\n );\n\n if (reorder.handleMode) {\n // Handle mode: only the grip starts a drag. The rest of the row stays free\n // for selection / editing / text selection.\n if (!onHandle) return;\n // Own the gesture: keep the grid's body handler from treating the press as\n // a cell interaction, and suppress native text/element drag-selection.\n event.preventDefault();\n event.stopPropagation();\n } else {\n // Whole-row mode: a drag begins anywhere except an interactive sub-part\n // (editor, checkbox, button).\n const target = path[0];\n if (\n target instanceof Element &&\n target.closest?.('input, button, a, select, textarea, [data-apex-editor]')\n ) {\n return;\n }\n }\n\n this.#dragStartX = event.clientX;\n this.#dragStartY = event.clientY;\n // The controller snapshots the ghost the instant the drag engages (the row\n // is still in place then), seeded from the original press point.\n reorder.armPointerDrag(\n this.data,\n () => this.#captureGhost(this.#dragStartX, this.#dragStartY),\n event\n );\n };\n\n /**\n * Snapshots the row's visible cells (text, width, alignment) and bounding rect\n * so the controller can paint a faithful floating ghost. Invoked once, at the\n * moment the drag engages.\n */\n #captureGhost(clientX: number, clientY: number): RowGhostInit {\n const rect = this.getBoundingClientRect();\n const cells = this.cells.map((cell) => {\n const el = cell as unknown as HTMLElement;\n return {\n text: (el.textContent ?? '').replace(/\\s+/g, ' ').trim(),\n width: el.getBoundingClientRect().width,\n align: getComputedStyle(el).textAlign,\n };\n });\n return { rect, clientX, clientY, cells };\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('exportparts', 'cell');\n this.setAttribute('role', 'row');\n this.addEventListener('pointerdown', this.#handleReorderPointerDown);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('pointerdown', this.#handleReorderPointerDown);\n super.disconnectedCallback();\n }\n\n /**\n * The number of \"chrome\" rows (header + filter) above the body. Used to\n * derive `aria-rowindex` from {@link index}. Set by the parent grid.\n */\n @property({ attribute: false, type: Number })\n public ariaRowOffset = 1;\n\n protected override willUpdate() {\n this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));\n\n // Ask feature modules whether this row is rendered full-width (e.g. an\n // enterprise group header). When one owns it, the row is not a selectable\n // data row — it carries its own level/expanded semantics and skips the\n // selection/tree aria below.\n this.#presented = this.state\n ? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })\n : null;\n if (this.#presented) {\n this.selected = false;\n this.removeAttribute('aria-selected');\n if (typeof this.#presented.level === 'number') {\n this.setAttribute('aria-level', String(this.#presented.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof this.#presented.expanded === 'boolean') {\n this.setAttribute('aria-expanded', this.#presented.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n return;\n }\n\n this.selected = Boolean(this.state?.selection.isSelected(this.data));\n this.expanded = Boolean(this.state?.expansion.isExpanded(this.data));\n if (this.state?.selection.enabled) {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-selected');\n }\n\n // Tree mode reports aria-level (1-based depth) and aria-expanded for\n // parent rows; expansion mode shares the same attribute on detail-panel\n // rows. Tree wins when both are enabled since it's the more structural\n // semantic (the row represents a tree node).\n const tree = this.state?.tree;\n const treeMeta = tree?.enabled ? tree.getMeta(this.data) : undefined;\n if (treeMeta) {\n this.setAttribute('aria-level', String(treeMeta.depth + 1));\n if (treeMeta.hasChildren) {\n this.setAttribute('aria-expanded', tree!.isExpanded(this.data) ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n // A module may attach tree/expansion ARIA to a normal cell-rendered row\n // (e.g. pivoting's expandable parent rows, which keep their value cells).\n const aria = this.state?.describeRow(this.data, {\n columns: this.columns,\n rowIndex: this.index,\n });\n if (aria) {\n if (typeof aria.level === 'number') {\n this.setAttribute('aria-level', String(aria.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof aria.expanded === 'boolean') {\n this.setAttribute('aria-expanded', aria.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n this.removeAttribute('aria-level');\n if (this.state?.expansion.enabled) {\n this.setAttribute('aria-expanded', this.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n }\n }\n }\n\n /**\n * Leading row-number gutter cell (transient spreadsheet coordinate hint). Shown\n * only while `coordinateHints` is on; pinned rows render an empty spacer (their\n * band-local index is not a meaningful A1 row number) so the track stays\n * aligned. Presentational: the accessible row index is `aria-rowindex`.\n */\n protected renderRowNumber() {\n if (!this.coordinateHints) return nothing;\n const pinned = Boolean(this.state?.rowPin?.isPinned(this.data));\n return html`<div part=\"row-number-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${pinned ? nothing : html`<span part=\"row-number\">${this.index + 1}</span>`}\n </div>`;\n }\n\n /**\n * Leading drag-handle (grip) cell. Rendered only in handle mode; pinned rows\n * get an empty spacer so the grid track stays aligned. The cell is\n * presentational (`aria-hidden`) — the accessible reorder path is the keyboard\n * grab flow, not this pointer affordance.\n */\n protected renderReorderHandle() {\n const reorder = this.state?.rowReorder;\n if (!reorder?.showHandleColumn) return nothing;\n const draggable = !this.state?.rowPin?.isPinned(this.data);\n return html`<div part=\"reorder-handle-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${draggable ? html`<span part=\"reorder-handle\">${GRIP_ICON}</span>` : nothing}\n </div>`;\n }\n\n protected renderExpansionToggle(colindex: number) {\n const expansion = this.state?.expansion;\n if (!expansion?.showToggleColumn) return nothing;\n const canExpand = expansion.canExpand(this.data) || expansion.isExpanded(this.data);\n const expanded = this.expanded;\n const handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (!canExpand) return;\n void expansion.toggleRow(this.data);\n };\n return html`<div\n part=\"expansion-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n >\n <button\n type=\"button\"\n part=\"expansion-toggle\"\n aria-label=${\n expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')\n }\n aria-expanded=${expanded ? 'true' : 'false'}\n ?disabled=${!canExpand}\n @click=${handleClick}\n >\n <svg\n part=\"expansion-chevron\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n width=\"14\"\n height=\"14\"\n >\n <path\n d=\"M9 6l6 6-6 6\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>`;\n }\n\n protected renderDetailPanel() {\n const expansion = this.state?.expansion;\n if (!expansion?.isExpanded(this.data)) return nothing;\n const template = this.state.host.expansion?.detailTemplate;\n if (typeof template !== 'function') return nothing;\n const content = template({\n data: this.data,\n rowIndex: this.index,\n parent: this.state.host,\n });\n return html`<div part=\"detail-panel\" role=\"region\" aria-label=${this.state.localize('row.detail')}>${content}</div>`;\n }\n\n protected renderSelectionCell(colindex: number) {\n if (!this.state?.selection.showCheckboxColumn) return nothing;\n const selected = this.selected;\n const handleChange = (event: Event) => {\n const mouseEvent = event as Event & {\n shiftKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n };\n // The native `change` event on a checkbox doesn't expose modifier keys\n // — they're carried on the preceding `click`. We handle Shift/Ctrl in\n // the click listener below; the change handler covers keyboard toggles\n // (Space on a focused checkbox) which always behave as plain toggles.\n void mouseEvent;\n this.state.selection.toggleRow(this.data);\n };\n const handleClick = (event: MouseEvent) => {\n // Prevent the click from bubbling to the grid's body click handler\n // (which would otherwise re-target the active cell to a non-existent\n // selection column).\n event.stopPropagation();\n if (event.shiftKey && this.state.selection.mode === 'multiple') {\n event.preventDefault();\n void this.state.selection.rangeToggle(this.data);\n return;\n }\n if ((event.ctrlKey || event.metaKey) && this.state.selection.mode === 'multiple') {\n event.preventDefault();\n void this.state.selection.additiveToggle(this.data);\n return;\n }\n // Plain click: let the default checkbox toggle proceed; `change` will\n // commit the new state via `toggleRow`.\n };\n // The checkbox itself is 14x14, well under the 24x24 WCAG 2.2 AA minimum\n // (2.5.8), and growing it would make a chunky box out of a deliberately\n // small mark. Instead the whole cell is the target: a click anywhere in it\n // forwards to the checkbox, which is both compliant and what people expect\n // of a selection column. Clicks that land on the checkbox are left alone,\n // or the forward would toggle twice and cancel out.\n const forwardToCheckbox = (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n if (target instanceof HTMLInputElement) return;\n event.currentTarget instanceof HTMLElement &&\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"checkbox\"]')?.click();\n };\n return html`<div\n part=\"selection-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n @click=${forwardToCheckbox}\n >\n <input\n type=\"checkbox\"\n part=\"selection-checkbox\"\n aria-label=${this.state.localize('row.select')}\n .checked=${selected}\n @click=${handleClick}\n @change=${handleChange}\n />\n </div>`;\n }\n\n protected override render() {\n // Full-width module-rendered row (e.g. a group header): render the module's\n // content spanning all columns, like the master-detail panel, and skip the\n // normal selection/expansion/cell grid.\n if (this.#presented) {\n return html`<div part=${this.#presented.part ?? 'group-row'} style=\"grid-column: 1 / -1\">\n ${this.#presented.content}\n </div>`;\n }\n\n // A row index can transiently fall beyond the current data — e.g. while a\n // server-side / infinite row model resizes `data` on a filter or sort\n // change, the virtualizer may render a stale index for a frame. Render\n // nothing until the real item arrives, rather than dereferencing undefined.\n if (this.data == null) return nothing;\n\n const { column: key, row: index } = this.activeNode;\n\n // Track aria-colindex (1-based) across the auto chrome columns and the\n // data columns. Selection comes first, then expansion, then data.\n let colCursor = 0;\n const selectionCol = this.state?.selection.showCheckboxColumn ? ++colCursor : 0;\n const expansionCol = this.state?.expansion.showToggleColumn ? ++colCursor : 0;\n\n // Keyed by column.key so the same `<apex-grid-cell>` follows its\n // column through a reorder swap — required for the column-reorder FLIP\n // animation in ReorderController to track motion per cell.\n return html`\n ${this.renderRowNumber()}\n ${this.renderReorderHandle()}\n ${this.renderSelectionCell(selectionCol)}\n ${this.renderExpansionToggle(expansionCol)}\n ${repeat(\n this.columns,\n (column) => String(column.key),\n (column, colIndex) => {\n if (column.hidden) return nothing;\n const offset = this.pinOffsets.get(column.key);\n const pinStyle =\n column.pinned && typeof offset === 'number' ? `--apex-pin-offset:${offset}px` : '';\n const edge = getPinEdge(this.columns, colIndex);\n const editing = this.editingKey === column.key;\n const ariaColindex = ++colCursor;\n return html`<apex-grid-cell\n part=\"cell\"\n data-pinned=${column.pinned ?? 'none'}\n data-pin-edge=${edge ?? 'none'}\n data-cell-type=${column.type ?? 'string'}\n style=${pinStyle}\n .active=${key === column.key && index === this.index}\n .editing=${editing}\n .column=${column}\n .row=${this as ApexGridRow<T>}\n .value=${this.data[column.key]}\n .colindex=${ariaColindex}\n .decorationVersion=${this.decorationVersion}\n .validationVersion=${this.validationVersion}\n ></apex-grid-cell>`;\n }\n )}\n ${this.renderDetailPanel()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridRow.tagName]: ApexGridRow<object>;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../src/components/row.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,EAAE,MAAM,KAAK,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAqB,MAAM,+BAA+B,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AAEjF,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC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ACG;AAIxB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CACU;AAQlC;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAChB;AAQtB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gDACR;AAShB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAChB;AAyFtB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACpB","sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement, nothing, type RootPart, render } from 'lit';\nimport { property, queryAll } from 'lit/decorators.js';\nimport { keyed } from 'lit/directives/keyed.js';\nimport { live } from 'lit/directives/live.js';\nimport { repeat } from 'lit/directives/repeat.js';\nimport { captureRowGhost, type RowGhostInit } from '../controllers/row-reorder.js';\nimport { gridStateContext, type StateController } from '../controllers/state.js';\nimport type { PresentedRow } from '../internal/feature-module.js';\nimport { cancelFlips, FLIP_ID_Y, hasFlipsInFlight } from '../internal/flip.js';\nimport { registerComponent } from '../internal/register.js';\nimport { GRID_ROW_TAG } from '../internal/tags.js';\nimport type { ActiveNode, ColumnConfiguration, Keys } from '../internal/types.js';\nimport { getPinEdge } from '../internal/utils.js';\nimport { styles } from '../styles/body-row/body-row.css.js';\nimport ApexGridCell from './cell.js';\n\n/** The six-dot grip drawn inside the row-reorder drag handle. */\nconst GRIP_ICON = html`<svg\n part=\"reorder-grip\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n>\n <circle cx=\"6\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"3.5\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"8\" r=\"1.25\" />\n <circle cx=\"6\" cy=\"12.5\" r=\"1.25\" />\n <circle cx=\"10\" cy=\"12.5\" r=\"1.25\" />\n</svg>`;\n\n/**\n * Rows marked `data-rebound` whose frame has not painted yet, and the ones\n * whose frame has: the mark comes off one frame after the frame that paints\n * the new record. A `requestAnimationFrame` callback runs before that frame's\n * style pass, so clearing in the first one would let the change animate.\n */\nlet reboundPending = new Set<Element>();\nlet reboundPainted = new Set<Element>();\nlet reboundFrame = 0;\n\nfunction clearRebound() {\n reboundFrame = 0;\n for (const row of reboundPainted) row.removeAttribute('data-rebound');\n reboundPainted = reboundPending;\n reboundPending = new Set();\n if (reboundPainted.size) reboundFrame = requestAnimationFrame(clearRebound);\n}\n\n/**\n * Marks a row that now shows another record (or, under row recycling, its\n * first one) for one painted frame. `body-row.scss` zeroes the motion tokens\n * under the mark, and they inherit into everything the row renders, the\n * cells' shadow roots included, so nothing animates from what the element\n * showed before.\n */\nfunction markRebound(row: Element) {\n row.setAttribute('data-rebound', '');\n reboundPainted.delete(row);\n reboundPending.add(row);\n if (!reboundFrame) reboundFrame = requestAnimationFrame(clearRebound);\n}\n\n/** One record's detail content, rendered into a node of its own. */\ninterface DetailRoot {\n readonly node: HTMLElement;\n readonly part: RootPart;\n /** The row that last took the node. */\n owner: Element | null;\n /** Changes whenever another row takes the node (see {@link DetailRoots.show}). */\n key: number;\n}\n\n/** Source of {@link DetailRoot.key} values, unique across grids. */\nlet detailKey = 0;\n\n/**\n * Detail panel content per record, for a grid that recycles its body rows\n * (`rowRecycling`). A body row element there shows whatever record its slot\n * holds next, so a sort or `moveRow` would hand one record's detail DOM to\n * another, or (keyed) rebuild it. Instead each record's content is rendered\n * into a root node of its own and the row hands Lit that node, which then\n * moves into whichever row shows the record, its DOM state (typed text, a\n * nested grid's sort) intact. A root is dropped when a row renders its record\n * collapsed or the record is no longer in a body row, which is what item\n * keys destroy.\n */\nclass DetailRoots {\n readonly #roots = new Map<object, DetailRoot>();\n #frame = 0;\n\n /**\n * Renders `content` into the root of `record` and returns the root's node\n * for `row` to commit. The node comes keyed by the row that last took it: a\n * row set aside as a spare keeps the node as its committed value after\n * another row took it, so without a new key Lit would skip committing the\n * same node when the spare shows the record again.\n */\n public show(record: object, content: unknown, host: object, row: Element): unknown {\n let root = this.#roots.get(record);\n if (!root) {\n const node = document.createElement('div');\n // Layout-neutral: the content lays out as if it sat in the panel.\n node.style.display = 'contents';\n // The grid is the stable `this` for listeners: the row changes.\n root = { node, part: render(nothing, node, { host }), owner: null, key: 0 };\n this.#roots.set(record, root);\n }\n if (root.owner !== row) {\n root.owner = row;\n root.key = ++detailKey;\n }\n render(content, root.node);\n return keyed(root.key, root.node);\n }\n\n /** Drops the root of `record`, disconnecting the directives it rendered. */\n public drop(record: object) {\n const root = this.#roots.get(record);\n if (!root) return;\n this.#roots.delete(record);\n root.part.setConnected(false);\n }\n\n /**\n * Prunes, at the next frame, the roots no body row shows. Within one batch\n * of row renders a root can sit detached between the row that let go of it\n * and the row that takes it, so the check waits for the batch to finish.\n */\n public schedule() {\n if (this.#frame || this.#roots.size === 0) return;\n this.#frame = requestAnimationFrame(() => {\n this.#frame = 0;\n for (const [record, root] of this.#roots) {\n if (!inBodyRow(root.node)) this.drop(record);\n }\n });\n }\n}\n\n/**\n * Whether a detail root sits in a row the body still holds. A row the body\n * removed has no parent, and one set aside for reuse sits in a fragment. A\n * grid out of the document keeps its rows, so this is not `isConnected`.\n */\nfunction inBodyRow(node: Node): boolean {\n if (!node.parentNode) return false;\n const row = (node.getRootNode() as ShadowRoot).host;\n return row?.parentNode?.nodeType === Node.ELEMENT_NODE;\n}\n\n/** Detail roots per grid: one record may show in several grids. */\nconst detailRoots = new WeakMap<object, DetailRoots>();\n\n/**\n * Every part a row renders in its own shadow root. Rows live in the grid's\n * shadow root, so the row's `exportparts` is the whole surface that\n * `apex-grid::part(...)` can reach; a part missing here cannot be styled.\n * `group-row` is the default container part of a module-rendered row.\n */\nconst ROW_PARTS =\n 'cell,row-number-cell,row-number,reorder-handle-cell,reorder-handle,reorder-grip,selection-cell,selection-checkbox,expansion-cell,expansion-toggle,expansion-chevron,detail-panel,group-row';\n\n/**\n * Component representing the DOM row in the Apex grid.\n */\nexport default class ApexGridRow<T extends object> extends LitElement {\n public static get tagName() {\n return GRID_ROW_TAG;\n }\n public static override styles = styles;\n\n public static register(): void {\n registerComponent(ApexGridRow, ApexGridCell);\n }\n\n @queryAll(ApexGridCell.tagName)\n protected _cells!: NodeListOf<ApexGridCell<T>>;\n\n @property({ attribute: false })\n public data!: T;\n\n @property({ attribute: false })\n public columns: Array<ColumnConfiguration<T>> = [];\n\n /** Cumulative pin offsets (px) keyed by column key. */\n @property({ attribute: false })\n public pinOffsets: Map<unknown, number> = new Map();\n\n public get cells() {\n return Array.from(this._cells);\n }\n\n /**\n * The single focus target of a row a feature module renders full width (a\n * group header, a total row), or `null` for a normal cell-rendered row.\n * Keyboard navigation lands here, whatever the active column, so the body\n * keeps a tab stop on rows that render no cells.\n */\n public get presentedCell(): HTMLElement | null {\n return this.#presented\n ? this.renderRoot.querySelector<HTMLElement>('[data-presented-cell]')\n : null;\n }\n\n @consume({ context: gridStateContext, subscribe: true })\n @property({ attribute: false })\n public state!: StateController<T>;\n\n @property({ attribute: false })\n public activeNode!: ActiveNode<T>;\n\n @property({ attribute: false, type: Number })\n public index = -1;\n\n /** Reflects current selection state so SCSS can highlight the row. */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /** Reflects current expansion state so SCSS can rotate the chevron. */\n @property({ type: Boolean, reflect: true })\n public expanded = false;\n\n /** Reflects pointer-drag state (row reorder) so SCSS can dim the source. */\n @property({ type: Boolean, reflect: true })\n public dragging = false;\n\n /** Reflects keyboard-grab state (row reorder) so SCSS can outline the row. */\n @property({ type: Boolean, reflect: true })\n public grabbed = false;\n\n /** Reveal the spreadsheet row-number gutter cell (transient formula coordinate hint). */\n @property({ type: Boolean })\n public coordinateHints = false;\n\n /** The column key currently being edited in this row, or `null`. */\n @property({ attribute: false })\n public editingKey: Keys<T> | null = null;\n\n /**\n * Reactive token from {@link StateController.decorationVersion}, forwarded to\n * each cell so a decoration-only change re-renders the row's cells. Stays `0`\n * for the community grid.\n */\n @property({ attribute: false, type: Number })\n public decorationVersion = 0;\n\n /**\n * Reactive token from {@link StateController.dataVersion}, forwarded to each\n * cell so a pipeline run (edit, data change, tree toggle) refreshes the row's\n * ARIA and the cells that read their row. Stays `0` for pinned rows.\n */\n @property({ attribute: false })\n public dataVersion = 0;\n\n /**\n * Reactive token from {@link EditingController.validationVersion}, forwarded to\n * each cell so a validation-only change re-renders the row's cells (toggling\n * `aria-invalid` and the inline error node). Stays `0` until the first\n * validation failure.\n */\n @property({ attribute: false, type: Number })\n public validationVersion = 0;\n\n /**\n * Result of the feature-module row presenter for the current update, or\n * `null` when no module renders this row full-width (the normal case).\n * Computed in {@link willUpdate} and consumed in {@link render}.\n */\n #presented: PresentedRow | null = null;\n\n /**\n * Arms a row drag. In handle mode only the grip starts one; in whole-row mode\n * a press anywhere except an interactive sub-part does. The move / up plumbing\n * lives on the grid host (see {@link RowReorderController.armPointerDrag}), so\n * a live-swap that recycles this row's DOM can't break the gesture.\n */\n #handleReorderPointerDown = (event: PointerEvent) => {\n const reorder = this.state?.rowReorder;\n if (!reorder?.enabled || event.button !== 0 || !this.data) return;\n // Pinned rows are not reorder sources (F4 scope).\n if (this.state.rowPin.isPinned(this.data)) return;\n\n const path = event.composedPath();\n const onHandle = path.some(\n (node) =>\n node instanceof Element && (node.getAttribute?.('part') ?? '').includes('reorder-handle')\n );\n\n if (reorder.handleMode) {\n // Handle mode: only the grip starts a drag. The rest of the row stays free\n // for selection / editing / text selection.\n if (!onHandle) return;\n // Own the gesture: keep the grid's body handler from treating the press as\n // a cell interaction, and suppress native text/element drag-selection.\n event.preventDefault();\n event.stopPropagation();\n } else {\n // Whole-row mode: a drag begins anywhere except an interactive sub-part\n // (editor, checkbox, button).\n const target = path[0];\n if (\n target instanceof Element &&\n target.closest?.('input, button, a, select, textarea, [data-apex-editor]')\n ) {\n return;\n }\n }\n\n // The controller snapshots the ghost the instant the drag engages, seeded\n // from the original press point, from whichever row renders the pressed\n // record then. This row may show another record by that time (a re-bind),\n // so its own snapshot declines once it does.\n const data = this.data;\n const { clientX, clientY } = event;\n reorder.armPointerDrag(\n data,\n () => (this.data === data ? this.#captureGhost(clientX, clientY) : null),\n event\n );\n };\n\n /**\n * Snapshots the row's visible cells (text, width, alignment) and bounding rect\n * so the controller can paint a faithful floating ghost.\n */\n #captureGhost(clientX: number, clientY: number): RowGhostInit {\n return captureRowGhost(this, this.cells as unknown as Element[], clientX, clientY);\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('role', 'row');\n this.addEventListener('pointerdown', this.#handleReorderPointerDown);\n }\n\n public override disconnectedCallback(): void {\n this.removeEventListener('pointerdown', this.#handleReorderPointerDown);\n // A row leaving the body (set aside as a spare, or removed) renders\n // nothing more, so it prunes the detail roots itself: a range that\n // shrinks to no rows would otherwise keep them until some later render.\n const host = this.state?.host;\n if (host) detailRoots.get(host)?.schedule();\n super.disconnectedCallback();\n }\n\n /**\n * The number of \"chrome\" rows (header + filter) above the body. Used to\n * derive `aria-rowindex` from {@link index}. Set by the parent grid.\n */\n @property({ attribute: false, type: Number })\n public ariaRowOffset = 1;\n\n /** The record this element rendered last, to spot a re-bind to another one. */\n #renderedData: T | undefined;\n\n protected override willUpdate() {\n // A row FLIP moves the record it was started for. Re-bound to another\n // record mid-flight, the element would carry that motion over to the new\n // one, so it stops. Checked only while a FLIP runs: scroll re-binds pay\n // nothing.\n // A re-bind must not animate either: a progress bar growing from the\n // previous record's value, a selected wash fading out, a chevron turning.\n // Under row recycling a new row counts too, as a spare or fresh body row\n // can be styled before its first update; item mode keeps today's path\n // for new rows. A real toggle keeps the record, so it still animates.\n if (this.data !== this.#renderedData) {\n const rebound = this.#renderedData !== undefined;\n if (rebound && hasFlipsInFlight()) cancelFlips(this, FLIP_ID_Y);\n this.#renderedData = this.data;\n if (rebound || this.state?.host?.rowRecycling) markRebound(this);\n }\n this.setAttribute('aria-rowindex', String(this.index + this.ariaRowOffset + 1));\n // Zebra parity from the row index, not the DOM position (body-row.scss).\n this.toggleAttribute('data-alt', this.index % 2 === 1);\n\n // Ask feature modules whether this row is rendered full-width (e.g. an\n // enterprise group header). When one owns it, the row is not a selectable\n // data row — it carries its own level/expanded semantics and skips the\n // selection/tree aria below.\n this.#presented = this.state\n ? this.state.presentRow(this.data, { columns: this.columns, rowIndex: this.index })\n : null;\n this.#syncExportParts();\n if (this.#presented) {\n // Data-row state does not apply, and an element re-bound from a data\n // row (a pinned band, a recycled body slot) must not carry it over.\n // `dragging` and `grabbed` are bound by record on every render.\n this.selected = false;\n this.expanded = false;\n this.removeAttribute('aria-selected');\n if (typeof this.#presented.level === 'number') {\n this.setAttribute('aria-level', String(this.#presented.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof this.#presented.expanded === 'boolean') {\n this.setAttribute('aria-expanded', this.#presented.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n return;\n }\n\n const selection = this.state?.selection;\n this.selected = Boolean(selection?.isSelected(this.data));\n this.expanded = Boolean(this.state?.expansion.isExpanded(this.data));\n // The grid pattern marks selectable rows with aria-selected; a row that\n // cannot be selected (`isRowSelectable`) omits it rather than claiming\n // an unselected state the user cannot change, unless it is still\n // selected (it can be deselected).\n if (selection?.enabled && (this.selected || selection.isSelectable(this.data))) {\n this.setAttribute('aria-selected', this.selected ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-selected');\n }\n\n // Tree mode reports aria-level (1-based depth) and aria-expanded for\n // parent rows; expansion mode shares the same attribute on detail-panel\n // rows. Tree wins when both are enabled since it's the more structural\n // semantic (the row represents a tree node).\n const tree = this.state?.tree;\n const treeMeta = tree?.enabled ? tree.getMeta(this.data) : undefined;\n if (treeMeta) {\n this.setAttribute('aria-level', String(treeMeta.depth + 1));\n if (treeMeta.hasChildren) {\n this.setAttribute('aria-expanded', tree!.isExpanded(this.data) ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n // A module may attach tree/expansion ARIA to a normal cell-rendered row\n // (e.g. pivoting's expandable parent rows, which keep their value cells).\n const aria = this.state?.describeRow(this.data, {\n columns: this.columns,\n rowIndex: this.index,\n });\n if (aria) {\n if (typeof aria.level === 'number') {\n this.setAttribute('aria-level', String(aria.level));\n } else {\n this.removeAttribute('aria-level');\n }\n if (typeof aria.expanded === 'boolean') {\n this.setAttribute('aria-expanded', aria.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n } else {\n this.removeAttribute('aria-level');\n // Only a row that can open (or is open) is announced as collapsible,\n // and only under the treegrid role: a grid row may not carry\n // aria-expanded, so this follows the same rule as the role.\n if (\n this.state?.hierarchical &&\n (this.expanded || this.state.expansion.canExpand(this.data))\n ) {\n this.setAttribute('aria-expanded', this.expanded ? 'true' : 'false');\n } else {\n this.removeAttribute('aria-expanded');\n }\n }\n }\n }\n\n /**\n * Re-exports the row's own parts plus the ones a module declares for the\n * content it renders here: a presented row's container part and\n * {@link PresentedRow.exportParts}, or the expansion config's\n * `exportParts` for the detail panel content. Re-run on every update, so a\n * row element the virtualizer reuses for another record drops the parts of\n * the one it showed before.\n */\n #syncExportParts() {\n // Runs on every row update, scroll recycling included, so the common\n // case (no extra parts) builds no arrays.\n const presented = this.#presented;\n const own = presented?.part?.split(' ').join(',');\n const list = presented ? presented.exportParts : this.state?.host.expansion?.exportParts;\n let value = ROW_PARTS;\n if (own) value += `,${own}`;\n if (list?.length) value += `,${list.join(',')}`;\n if (this.getAttribute('exportparts') !== value) {\n this.setAttribute('exportparts', value);\n }\n }\n\n /**\n * Leading row-number gutter cell (transient spreadsheet coordinate hint). Shown\n * only while `coordinateHints` is on. A feature module that addresses the data\n * (the enterprise formula engine) supplies the label, so it matches what a\n * reference reads; otherwise it is the view position, and pinned rows render\n * an empty spacer (their band-local index is not a meaningful row number) so\n * the track stays aligned. Presentational: the accessible row index is\n * `aria-rowindex`.\n */\n protected renderRowNumber() {\n if (!this.coordinateHints) return nothing;\n let label: string | number | null | undefined = this.state?.rowCoordinate(this.data);\n if (label === undefined) {\n label = this.state?.rowPin?.isPinned(this.data) ? null : this.index + 1;\n }\n return html`<div part=\"row-number-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${label === null ? nothing : html`<span part=\"row-number\">${label}</span>`}\n </div>`;\n }\n\n /**\n * Leading drag-handle (grip) cell. Rendered only in handle mode; pinned rows\n * get an empty spacer so the grid track stays aligned. The cell is\n * presentational (`aria-hidden`) — the accessible reorder path is the keyboard\n * grab flow, not this pointer affordance.\n */\n protected renderReorderHandle() {\n const reorder = this.state?.rowReorder;\n if (!reorder?.showHandleColumn) return nothing;\n const draggable = !this.state?.rowPin?.isPinned(this.data);\n return html`<div part=\"reorder-handle-cell\" data-pinned=\"start\" aria-hidden=\"true\">\n ${draggable ? html`<span part=\"reorder-handle\">${GRIP_ICON}</span>` : nothing}\n </div>`;\n }\n\n protected renderExpansionToggle(colindex: number) {\n const expansion = this.state?.expansion;\n if (!expansion?.showToggleColumn) return nothing;\n const canExpand = expansion.canExpand(this.data) || expansion.isExpanded(this.data);\n const expanded = this.expanded;\n const handleClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (!canExpand) return;\n void expansion.toggleRow(this.data);\n };\n return html`<div\n part=\"expansion-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n >\n <button\n type=\"button\"\n part=\"expansion-toggle\"\n aria-label=${\n expanded ? this.state.localize('row.collapse') : this.state.localize('row.expand')\n }\n aria-expanded=${canExpand ? String(expanded) : nothing}\n ?disabled=${!canExpand}\n @click=${handleClick}\n >\n <svg\n part=\"expansion-chevron\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n width=\"14\"\n height=\"14\"\n >\n <path\n d=\"M9 6l6 6-6 6\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>`;\n }\n\n protected renderDetailPanel() {\n const expansion = this.state?.expansion;\n const host = this.state?.host;\n const roots = host && detailRoots.get(host);\n roots?.schedule();\n if (!expansion?.isExpanded(this.data)) {\n // Rendered collapsed, the panel closed: an expand builds it fresh.\n roots?.drop(this.data);\n return nothing;\n }\n const template = host.expansion?.detailTemplate;\n if (typeof template !== 'function') return nothing;\n const content = template({\n data: this.data,\n rowIndex: this.index,\n parent: host,\n });\n // A row owns only cells, so the panel is one cell across the whole row.\n // A recycled body row takes the record's own root (see DetailRoots).\n // Otherwise the content is keyed by record: a row element re-bound to\n // another record (a pinned band) builds fresh detail DOM rather than\n // showing the previous record's (a typed input, a nested grid's sort). A\n // row that keeps its record keeps its detail DOM.\n let detail: unknown;\n if (host.rowRecycling && !this.state.rowPin.isPinned(this.data)) {\n let own = roots;\n if (!own) {\n own = new DetailRoots();\n detailRoots.set(host, own);\n }\n detail = own.show(this.data, content, host, this);\n own.schedule();\n } else {\n detail = keyed(this.data, content);\n }\n return html`<div\n part=\"detail-panel\"\n role=\"gridcell\"\n aria-colindex=\"1\"\n aria-colspan=${this.state.colCount}\n >\n <div role=\"region\" aria-label=${this.state.localize('row.detail')}>${detail}</div>\n </div>`;\n }\n\n protected renderSelectionCell(colindex: number) {\n const selection = this.state?.selection;\n if (!selection?.showCheckboxColumn) return nothing;\n // Shift extends a range from the anchor and Ctrl or Cmd toggles one row\n // without moving it (multiple mode only). Shared by the checkbox and the\n // cell around it, so both give the same result for the same gesture.\n // Returns false for a plain click, which the checkbox toggles itself.\n const modifierToggle = (event: MouseEvent): boolean => {\n if (selection.mode !== 'multiple') return false;\n if (event.shiftKey) {\n void selection.rangeToggle(this.data);\n } else if (event.ctrlKey || event.metaKey) {\n void selection.additiveToggle(this.data);\n } else {\n return false;\n }\n return true;\n };\n // The native `change` carries no modifier keys (they ride on the click\n // above), so it covers plain clicks and Space on a focused checkbox. The\n // click has already flipped `checked`; a `rowSelecting` listener that\n // cancels leaves the row as it was without a re-render, so write the\n // real state back once the selection has decided.\n const handleChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n const cell = input.parentElement;\n const focused =\n this.renderRoot instanceof ShadowRoot && this.renderRoot.activeElement === input;\n // The record clicked, captured before the await: by the time the\n // selection settles this row may show another record, whose state its\n // own render (the live `.checked` binding below) already wrote.\n const record = this.data;\n void selection.toggleRow(record).then(async () => {\n if (this.data === record) input.checked = selection.isSelected(record);\n // A rejected row that was still selected loses its checkbox once\n // deselected. Keep focus in its cell rather than letting it fall to\n // the body, where the grid's keys no longer reach.\n if (!focused || !cell) return;\n await this.updateComplete;\n if (input.isConnected) return;\n cell.tabIndex = -1;\n cell.addEventListener('blur', () => cell.removeAttribute('tabindex'), { once: true });\n cell.focus({ preventScroll: true });\n });\n };\n const handleClick = (event: MouseEvent) => {\n // Keeps checkbox clicks from bubbling to the cell's forwarder below and\n // to app click listeners on the grid (the grid's own body handler runs\n // in the capture phase and ignores this target).\n event.stopPropagation();\n // A modifier click is handled here, so cancel the native toggle.\n if (modifierToggle(event)) event.preventDefault();\n };\n // The checkbox itself is 14x14, well under the 24x24 WCAG 2.2 AA minimum\n // (2.5.8), and growing it would make a chunky box out of a deliberately\n // small mark. Instead the whole cell is the target: a click anywhere in it\n // acts like a click on the checkbox, modifiers included, which is both\n // compliant and what people expect of a selection column. Clicks that land\n // on the checkbox are left alone, or the forward would toggle twice and\n // cancel out.\n const forwardToCheckbox = (event: MouseEvent) => {\n if (event.target instanceof HTMLInputElement || modifierToggle(event)) return;\n (event.currentTarget as HTMLElement)\n .querySelector<HTMLInputElement>('input[type=\"checkbox\"]')\n ?.click();\n };\n // A row `isRowSelectable` rejects keeps the cell (the columns stay\n // aligned) but no control, as the controller refuses to select it; a\n // still-selected one keeps its checkbox so it can be deselected. `live`\n // checks against the box itself: a click flips it before the binding\n // knows, so a row re-bound in the same render to a record with the old\n // binding value would otherwise keep the clicked state.\n const checkbox =\n this.selected || selection.isSelectable(this.data)\n ? html`<input\n type=\"checkbox\"\n part=\"selection-checkbox\"\n aria-label=${this.state.localize('row.select')}\n .checked=${live(this.selected)}\n @click=${handleClick}\n @change=${handleChange}\n />`\n : nothing;\n return html`<div\n part=\"selection-cell\"\n role=\"gridcell\"\n aria-colindex=${colindex}\n data-pinned=\"start\"\n @click=${forwardToCheckbox}\n >\n ${checkbox}\n </div>`;\n }\n\n protected override render() {\n // Full-width module-rendered row (e.g. a group header): render the module's\n // content spanning all columns, like the master-detail panel, and skip the\n // normal selection/expansion/cell grid.\n if (this.#presented) {\n return html`<div\n part=${this.#presented.part ?? 'group-row'}\n role=\"gridcell\"\n aria-colindex=\"1\"\n aria-colspan=${Math.max(1, this.state.colCount)}\n tabindex=${this.activeNode?.row === this.index ? 0 : -1}\n data-presented-cell\n style=\"grid-column: 1 / -1\"\n >\n ${this.#presented.content}\n </div>`;\n }\n\n // A row index can transiently fall beyond the current data — e.g. while a\n // server-side / infinite row model resizes `data` on a filter or sort\n // change, the virtualizer may render a stale index for a frame. Render\n // nothing until the real item arrives, rather than dereferencing undefined.\n if (this.data == null) return nothing;\n\n const { column: key, row: index } = this.activeNode;\n\n // Track aria-colindex (1-based) across the auto chrome columns and the\n // data columns. Selection comes first, then expansion, then data.\n let colCursor = 0;\n const selectionCol = this.state?.selection.showCheckboxColumn ? ++colCursor : 0;\n const expansionCol = this.state?.expansion.showToggleColumn ? ++colCursor : 0;\n\n // Keyed by column.key so the same `<apex-grid-cell>` follows its\n // column through a reorder swap — required for the column-reorder FLIP\n // animation in ReorderController to track motion per cell.\n return html`\n ${this.renderRowNumber()}\n ${this.renderReorderHandle()}\n ${this.renderSelectionCell(selectionCol)}\n ${this.renderExpansionToggle(expansionCol)}\n ${repeat(\n this.columns,\n (column) => String(column.key),\n (column, colIndex) => {\n if (column.hidden) return nothing;\n const offset = this.pinOffsets.get(column.key);\n const pinStyle =\n column.pinned && typeof offset === 'number' ? `--apex-pin-offset:${offset}px` : '';\n const edge = getPinEdge(this.columns, colIndex);\n const editing = this.editingKey === column.key;\n const ariaColindex = ++colCursor;\n return html`<apex-grid-cell\n part=\"cell\"\n data-pinned=${column.pinned ?? 'none'}\n data-pin-edge=${edge ?? 'none'}\n data-cell-type=${column.type ?? 'string'}\n style=${pinStyle}\n .active=${key === column.key && index === this.index}\n .editing=${editing}\n .column=${column}\n .row=${this as ApexGridRow<T>}\n .record=${this.data}\n .value=${this.data[column.key]}\n .colindex=${ariaColindex}\n .rowIndex=${this.index}\n .decorationVersion=${this.decorationVersion}\n .dataVersion=${this.dataVersion}\n .validationVersion=${this.validationVersion}\n ></apex-grid-cell>`;\n }\n )}\n ${this.renderDetailPanel()}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [ApexGridRow.tagName]: ApexGridRow<object>;\n }\n}\n"]}
|
package/components/toolbar.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { LitElement, nothing } from 'lit';
|
|
|
2
2
|
import { type StateController } from '../controllers/state.js';
|
|
3
3
|
/**
|
|
4
4
|
* Toolbar shown above the grid's header row. Hosts opt-in toolbar features
|
|
5
|
-
* such as the quick-filter (global search) input and the export menu.
|
|
5
|
+
* such as the quick-filter (global search) input and the export menu. The grid
|
|
6
|
+
* re-exports every part, so `apex-grid::part(name)` styles it.
|
|
6
7
|
*
|
|
7
8
|
* @element apex-grid-toolbar
|
|
8
9
|
*
|
|
@@ -13,7 +14,10 @@ import { type StateController } from '../controllers/state.js';
|
|
|
13
14
|
* @csspart search-input - The text input itself.
|
|
14
15
|
* @csspart toolbar-actions - The trailing actions area (right side).
|
|
15
16
|
* @csspart toolbar-action - A custom host-contributed action button (e.g. "Create chart").
|
|
17
|
+
* @csspart export - The export menu wrapper (trigger plus dropdown).
|
|
16
18
|
* @csspart export-trigger - The export menu trigger button.
|
|
19
|
+
* @csspart export-icon - The download icon in the trigger.
|
|
20
|
+
* @csspart export-caret - The caret icon in the trigger.
|
|
17
21
|
* @csspart export-menu - The dropdown menu containing export options.
|
|
18
22
|
* @csspart export-menu-item - A single menu item inside the export dropdown.
|
|
19
23
|
*/
|