@universal-material/data-grid 0.1.0 → 0.3.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 +37 -20
- package/custom-elements.json +149 -22
- package/dist/data/data-source.d.ts +6 -2
- package/dist/data/data-source.js.map +1 -1
- package/dist/export/types.d.ts +1 -1
- package/dist/export/types.js.map +1 -1
- package/dist/export-xlsx/index.d.ts +2 -1
- package/dist/export-xlsx/index.js +4 -2
- package/dist/export-xlsx/index.js.map +1 -1
- package/dist/features/column-chooser.js +4 -3
- package/dist/features/column-chooser.js.map +1 -1
- package/dist/features/filter-row.d.ts +1 -0
- package/dist/features/filter-row.js +16 -10
- package/dist/features/filter-row.js.map +1 -1
- package/dist/features/header-filter.d.ts +9 -2
- package/dist/features/header-filter.js +22 -11
- package/dist/features/header-filter.js.map +1 -1
- package/dist/features/scroll-port.d.ts +51 -0
- package/dist/features/scroll-port.js +329 -0
- package/dist/features/scroll-port.js.map +1 -0
- package/dist/grid-column-def.d.ts +60 -14
- package/dist/grid-column-def.js +6 -2
- package/dist/grid-column-def.js.map +1 -1
- package/dist/grid-column.d.ts +31 -7
- package/dist/grid-column.js +40 -7
- package/dist/grid-column.js.map +1 -1
- package/dist/grid-i18n.js +14 -14
- package/dist/grid-i18n.js.map +1 -1
- package/dist/grid.d.ts +61 -14
- package/dist/grid.js +758 -165
- package/dist/grid.js.map +1 -1
- package/dist/grid.min.js +621 -474
- package/dist/grid.styles.js +153 -15
- package/dist/grid.styles.js.map +1 -1
- package/dist/render/cell.js +5 -2
- package/dist/render/cell.js.map +1 -1
- package/dist/render/group-row.js +2 -1
- package/dist/render/group-row.js.map +1 -1
- package/dist/render/header.d.ts +17 -1
- package/dist/render/header.js +23 -2
- package/dist/render/header.js.map +1 -1
- package/dist/render/virtualizer.d.ts +49 -1
- package/dist/render/virtualizer.js +229 -17
- package/dist/render/virtualizer.js.map +1 -1
- package/dist/row-model/columns.d.ts +40 -0
- package/dist/row-model/columns.js +25 -0
- package/dist/row-model/columns.js.map +1 -1
- package/dist/row-model/filter.d.ts +19 -4
- package/dist/row-model/filter.js +29 -9
- package/dist/row-model/filter.js.map +1 -1
- package/dist/row-model/format.js +1 -1
- package/dist/row-model/format.js.map +1 -1
- package/dist/state/grid-state.d.ts +2 -2
- package/dist/state/grid-state.js.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import { ScrollPort } from '../render/virtualizer.js';
|
|
3
|
+
/** O que o controller precisa do grid. */
|
|
4
|
+
export interface ScrollPortHost extends ReactiveControllerHost, HTMLElement {
|
|
5
|
+
scrollContainer: string | null;
|
|
6
|
+
scrollContainerElement: HTMLElement | Window | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ScrollPortCallbacks {
|
|
9
|
+
/** Rolagem da porta externa (janela de colunas, sombras, painel de carga). */
|
|
10
|
+
scroll: () => void;
|
|
11
|
+
/** A porta externa mudou de tamanho ou o grid se moveu dentro dela sem rolagem. */
|
|
12
|
+
moved: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Rolagem por um contêiner externo (spec 27): resolve o contêiner pedido
|
|
16
|
+
* (`scroll-container` / `scrollContainerElement`), avisa no console quando
|
|
17
|
+
* ele não serve, liga o modo pela folha de estilo da instância e ouve a
|
|
18
|
+
* porta (rolagem, tamanho, linhas que se movem sem rolagem). Tudo é solto ao
|
|
19
|
+
* trocar de contêiner e no `hostDisconnected` (spec 14).
|
|
20
|
+
*/
|
|
21
|
+
export declare class ScrollPortController implements ReactiveController {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(host: ScrollPortHost, callbacks: ScrollPortCallbacks);
|
|
24
|
+
hostConnected(): void;
|
|
25
|
+
hostDisconnected(): void;
|
|
26
|
+
/** Porta externa resolvida (`null` = rolagem interna). */
|
|
27
|
+
get port(): ScrollPort | null;
|
|
28
|
+
/**
|
|
29
|
+
* Modo externo no render: resolvido, ou pedido e ainda não resolvido (SSR,
|
|
30
|
+
* 1º render antes da conexão) — o servidor e a hidratação desenham igual.
|
|
31
|
+
*/
|
|
32
|
+
get external(): boolean;
|
|
33
|
+
/** Altura dada ao host no modo externo corta as linhas (o grid precisa crescer com o conteúdo). */
|
|
34
|
+
checkHeight(): void;
|
|
35
|
+
/** Resolve o contêiner pedido; chamado na conexão e quando as duas propriedades mudam. */
|
|
36
|
+
resolve(): void;
|
|
37
|
+
/** Observa as linhas renderizadas do corpo (só as novas; solta as que saíram). */
|
|
38
|
+
observeRows(rows: Iterable<Element>): void;
|
|
39
|
+
/** Quantas linhas estão observadas agora (diagnóstico, testes de vazamento). */
|
|
40
|
+
get observedRows(): number;
|
|
41
|
+
/** Esperas de `scrollend` em curso (diagnóstico, spec 14). */
|
|
42
|
+
get scrollEndWaits(): number;
|
|
43
|
+
/** Chama `callback` quando a rolagem da porta acabar (ou no tempo limite). */
|
|
44
|
+
afterScrollEnd(callback: () => void): void;
|
|
45
|
+
/** `scroll-padding` do contêiner (o que o hospedeiro gruda nele), em px. */
|
|
46
|
+
padding(): {
|
|
47
|
+
top: number;
|
|
48
|
+
bottom: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=scroll-port.d.ts.map
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { ScrollPort } from '../render/virtualizer.js';
|
|
2
|
+
/** Tempo máximo de espera pelo `scrollend` (navegador sem o evento, rolagem interrompida). */
|
|
3
|
+
const SCROLL_END_TIMEOUT = 2000;
|
|
4
|
+
/** `<html>`/`scrollingElement` = a janela (o `<body>` só no modo quirks, quando é o `scrollingElement`). */
|
|
5
|
+
const isViewportElement = (element) => {
|
|
6
|
+
const document = element.ownerDocument;
|
|
7
|
+
return element === document.documentElement || element === document.scrollingElement;
|
|
8
|
+
};
|
|
9
|
+
/** Pai na árvore "composta": o pai, ou o host da shadow root. */
|
|
10
|
+
const composedParent = (node) => {
|
|
11
|
+
if (node.parentElement) {
|
|
12
|
+
return node.parentElement;
|
|
13
|
+
}
|
|
14
|
+
const root = node.parentNode;
|
|
15
|
+
return root instanceof ShadowRoot ? root.host : null;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Rolagem por um contêiner externo (spec 27): resolve o contêiner pedido
|
|
19
|
+
* (`scroll-container` / `scrollContainerElement`), avisa no console quando
|
|
20
|
+
* ele não serve, liga o modo pela folha de estilo da instância e ouve a
|
|
21
|
+
* porta (rolagem, tamanho, linhas que se movem sem rolagem). Tudo é solto ao
|
|
22
|
+
* trocar de contêiner e no `hostDisconnected` (spec 14).
|
|
23
|
+
*/
|
|
24
|
+
export class ScrollPortController {
|
|
25
|
+
#host;
|
|
26
|
+
#callbacks;
|
|
27
|
+
#port = null;
|
|
28
|
+
/** Já resolveu ao menos uma vez desde a conexão (antes disso, vale o pedido). */
|
|
29
|
+
#resolved = false;
|
|
30
|
+
#warned = new Set();
|
|
31
|
+
#sheet;
|
|
32
|
+
#sheetText = '';
|
|
33
|
+
#resizeObserver;
|
|
34
|
+
#intersectionObserver;
|
|
35
|
+
#observedRows = new Set();
|
|
36
|
+
/** Esperas de `scrollend` em curso: o temporizador de reserva de cada uma. */
|
|
37
|
+
#scrollEndWaits = new Map();
|
|
38
|
+
constructor(host, callbacks) {
|
|
39
|
+
this.#host = host;
|
|
40
|
+
this.#callbacks = callbacks;
|
|
41
|
+
host.addController(this);
|
|
42
|
+
}
|
|
43
|
+
hostConnected() {
|
|
44
|
+
this.resolve();
|
|
45
|
+
}
|
|
46
|
+
hostDisconnected() {
|
|
47
|
+
this.#detach();
|
|
48
|
+
this.#resolved = false;
|
|
49
|
+
}
|
|
50
|
+
/** Porta externa resolvida (`null` = rolagem interna). */
|
|
51
|
+
get port() {
|
|
52
|
+
return this.#port;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Modo externo no render: resolvido, ou pedido e ainda não resolvido (SSR,
|
|
56
|
+
* 1º render antes da conexão) — o servidor e a hidratação desenham igual.
|
|
57
|
+
*/
|
|
58
|
+
get external() {
|
|
59
|
+
return this.#resolved ? this.#port !== null : this.#requested();
|
|
60
|
+
}
|
|
61
|
+
#requested() {
|
|
62
|
+
const { scrollContainer, scrollContainerElement } = this.#host;
|
|
63
|
+
return !!scrollContainerElement || !!scrollContainer?.trim();
|
|
64
|
+
}
|
|
65
|
+
/** Avisos por objeto (contêiner, ancestral, host): um por valor, sem segurar o objeto. */
|
|
66
|
+
#warnedObjects = new WeakMap();
|
|
67
|
+
#warnOnce(target, message) {
|
|
68
|
+
const seen = this.#warnedObjects.get(target) ?? new Set();
|
|
69
|
+
if (!seen.has(message)) {
|
|
70
|
+
seen.add(message);
|
|
71
|
+
this.#warnedObjects.set(target, seen);
|
|
72
|
+
console.warn(`<u-grid>: ${message}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Altura dada ao host no modo externo corta as linhas (o grid precisa crescer com o conteúdo). */
|
|
76
|
+
checkHeight() {
|
|
77
|
+
const host = this.#host;
|
|
78
|
+
if (this.#port && host.scrollHeight > host.clientHeight + 1) {
|
|
79
|
+
this.#warnOnce(host, 'with scroll-container the grid grows to its content; do not give it a height (it clips the rows).');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
#warn(key, message) {
|
|
83
|
+
if (!this.#warned.has(key)) {
|
|
84
|
+
this.#warned.add(key);
|
|
85
|
+
console.warn(`<u-grid>: ${message}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Resolve o contêiner pedido; chamado na conexão e quando as duas propriedades mudam. */
|
|
89
|
+
resolve() {
|
|
90
|
+
const host = this.#host;
|
|
91
|
+
if (!host.isConnected) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const source = this.#find();
|
|
95
|
+
this.#resolved = true;
|
|
96
|
+
if (source !== (this.#port?.source ?? null)) {
|
|
97
|
+
this.#detach();
|
|
98
|
+
if (source) {
|
|
99
|
+
this.#attach(new ScrollPort(source));
|
|
100
|
+
}
|
|
101
|
+
host.requestUpdate();
|
|
102
|
+
}
|
|
103
|
+
this.#syncSheet();
|
|
104
|
+
}
|
|
105
|
+
#find() {
|
|
106
|
+
const host = this.#host;
|
|
107
|
+
const element = host.scrollContainerElement;
|
|
108
|
+
const view = host.ownerDocument.defaultView;
|
|
109
|
+
if (element) {
|
|
110
|
+
if (element === view || (element instanceof Element && isViewportElement(element))) {
|
|
111
|
+
this.#checkBetween(null);
|
|
112
|
+
return view;
|
|
113
|
+
}
|
|
114
|
+
// Outro realm (iframe), SVG ou algo que não é elemento ancestral nem a janela deste documento.
|
|
115
|
+
if (!(element instanceof HTMLElement) || !this.#isAncestor(element)) {
|
|
116
|
+
this.#warnOnce(element, 'scrollContainerElement must be an ancestor element of the grid (or window); using the grid\'s own scrolling.');
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
this.#checkBetween(element);
|
|
120
|
+
return element;
|
|
121
|
+
}
|
|
122
|
+
const id = host.scrollContainer;
|
|
123
|
+
if (id === null || id === undefined) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
const wanted = id.trim();
|
|
127
|
+
if (!wanted) {
|
|
128
|
+
this.#warn('empty', 'scroll-container is empty; using the grid\'s own scrolling.');
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
if (wanted === 'window') {
|
|
132
|
+
this.#checkBetween(null);
|
|
133
|
+
return view;
|
|
134
|
+
}
|
|
135
|
+
for (let node = composedParent(host); node; node = composedParent(node)) {
|
|
136
|
+
if (node.id === wanted) {
|
|
137
|
+
if (isViewportElement(node)) {
|
|
138
|
+
this.#checkBetween(null);
|
|
139
|
+
return view;
|
|
140
|
+
}
|
|
141
|
+
this.#checkBetween(node);
|
|
142
|
+
return node;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
this.#warn(`id:${wanted}`, `scroll-container="${wanted}": no ancestor with this id; using the grid's own scrolling.`);
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
#isAncestor(element) {
|
|
149
|
+
for (let node = composedParent(this.#host); node; node = composedParent(node)) {
|
|
150
|
+
if (node === element) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
/** Ancestral entre o grid e o contêiner que corta/rola: o `sticky` gruda nele, não no contêiner. */
|
|
157
|
+
#checkBetween(container) {
|
|
158
|
+
const document = this.#host.ownerDocument;
|
|
159
|
+
for (let node = composedParent(this.#host); node && node !== container; node = composedParent(node)) {
|
|
160
|
+
if (node === document.documentElement || node === document.body) {
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
const style = getComputedStyle(node);
|
|
164
|
+
if (![style.overflowX, style.overflowY].every(value => value === 'visible' || value === 'clip')) {
|
|
165
|
+
this.#warnOnce(node, 'an ancestor between the grid and its scroll container has overflow set; sticky headers will stick to it instead.');
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Folha da instância: o modo externo vindo só da propriedade (`height:
|
|
172
|
+
* auto` no host) e, com o atributo, a anulação quando ele não resolveu (o
|
|
173
|
+
* grid não pode ficar sem altura e sem rolagem).
|
|
174
|
+
*/
|
|
175
|
+
#syncSheet() {
|
|
176
|
+
const root = this.#host.shadowRoot;
|
|
177
|
+
const attribute = this.#host.hasAttribute('scroll-container');
|
|
178
|
+
const text = this.#port && !attribute
|
|
179
|
+
? ':host { height: auto; overflow-anchor: none; }'
|
|
180
|
+
: !this.#port && attribute
|
|
181
|
+
? ':host([scroll-container]:not([scroll-container=""])) { height: 100%; overflow-anchor: auto; }'
|
|
182
|
+
: '';
|
|
183
|
+
if (!root || text === this.#sheetText || typeof CSSStyleSheet === 'undefined' || !('adoptedStyleSheets' in root)) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
this.#sheetText = text;
|
|
187
|
+
const sheets = root.adoptedStyleSheets.filter(sheet => sheet !== this.#sheet);
|
|
188
|
+
if (text) {
|
|
189
|
+
this.#sheet ??= new CSSStyleSheet();
|
|
190
|
+
this.#sheet.replaceSync(text);
|
|
191
|
+
sheets.push(this.#sheet);
|
|
192
|
+
}
|
|
193
|
+
root.adoptedStyleSheets = sheets;
|
|
194
|
+
}
|
|
195
|
+
#attach(port) {
|
|
196
|
+
this.#port = port;
|
|
197
|
+
port.target.addEventListener('scroll', this.#onScroll, { passive: true });
|
|
198
|
+
if (port.isWindow) {
|
|
199
|
+
port.target.addEventListener('resize', this.#onMoved, { passive: true });
|
|
200
|
+
}
|
|
201
|
+
else if (typeof ResizeObserver !== 'undefined') {
|
|
202
|
+
this.#resizeObserver = new ResizeObserver(this.#onMoved);
|
|
203
|
+
this.#resizeObserver.observe(port.element);
|
|
204
|
+
}
|
|
205
|
+
if (typeof IntersectionObserver !== 'undefined') {
|
|
206
|
+
// O conteúdo acima do grid muda de altura sem rolagem: as linhas
|
|
207
|
+
// renderizadas entram/saem da porta e o grid relê a posição.
|
|
208
|
+
this.#intersectionObserver = new IntersectionObserver(this.#onIntersect, {
|
|
209
|
+
root: port.isWindow ? null : port.element,
|
|
210
|
+
threshold: [0, 1],
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
#detach() {
|
|
215
|
+
const port = this.#port;
|
|
216
|
+
if (port) {
|
|
217
|
+
port.target.removeEventListener('scroll', this.#onScroll);
|
|
218
|
+
port.target.removeEventListener('resize', this.#onMoved);
|
|
219
|
+
}
|
|
220
|
+
this.#resizeObserver?.disconnect();
|
|
221
|
+
this.#resizeObserver = undefined;
|
|
222
|
+
this.#intersectionObserver?.disconnect();
|
|
223
|
+
this.#intersectionObserver = undefined;
|
|
224
|
+
this.#observedRows.clear();
|
|
225
|
+
// Esperas em curso terminam já (soltam os próprios listeners e o quadro).
|
|
226
|
+
for (const done of [...this.#scrollEndWaits.keys()]) {
|
|
227
|
+
done();
|
|
228
|
+
}
|
|
229
|
+
this.#port = null;
|
|
230
|
+
}
|
|
231
|
+
#onScroll = () => {
|
|
232
|
+
this.#callbacks.scroll();
|
|
233
|
+
};
|
|
234
|
+
#onMoved = () => {
|
|
235
|
+
this.#callbacks.moved();
|
|
236
|
+
};
|
|
237
|
+
/** Ignora a 1ª entrega de cada alvo (o `observe` sempre entrega uma). */
|
|
238
|
+
#seen = new WeakSet();
|
|
239
|
+
#onIntersect = (entries) => {
|
|
240
|
+
let moved = false;
|
|
241
|
+
for (const entry of entries) {
|
|
242
|
+
if (this.#seen.has(entry.target)) {
|
|
243
|
+
moved = true;
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
this.#seen.add(entry.target);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (moved) {
|
|
250
|
+
this.#callbacks.moved();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
/** Observa as linhas renderizadas do corpo (só as novas; solta as que saíram). */
|
|
254
|
+
observeRows(rows) {
|
|
255
|
+
const observer = this.#intersectionObserver;
|
|
256
|
+
if (!observer) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const wanted = new Set(rows);
|
|
260
|
+
for (const row of this.#observedRows) {
|
|
261
|
+
if (!wanted.has(row)) {
|
|
262
|
+
observer.unobserve(row);
|
|
263
|
+
this.#observedRows.delete(row);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
for (const row of wanted) {
|
|
267
|
+
if (!this.#observedRows.has(row)) {
|
|
268
|
+
observer.observe(row);
|
|
269
|
+
this.#observedRows.add(row);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/** Quantas linhas estão observadas agora (diagnóstico, testes de vazamento). */
|
|
274
|
+
get observedRows() {
|
|
275
|
+
return this.#observedRows.size;
|
|
276
|
+
}
|
|
277
|
+
/** Esperas de `scrollend` em curso (diagnóstico, spec 14). */
|
|
278
|
+
get scrollEndWaits() {
|
|
279
|
+
return this.#scrollEndWaits.size;
|
|
280
|
+
}
|
|
281
|
+
/** Chama `callback` quando a rolagem da porta acabar (ou no tempo limite). */
|
|
282
|
+
afterScrollEnd(callback) {
|
|
283
|
+
const port = this.#port;
|
|
284
|
+
if (!port) {
|
|
285
|
+
callback();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
let moving = false;
|
|
289
|
+
let frame = 0;
|
|
290
|
+
const scrolled = () => {
|
|
291
|
+
moving = true;
|
|
292
|
+
};
|
|
293
|
+
const done = () => {
|
|
294
|
+
const timer = this.#scrollEndWaits.get(done);
|
|
295
|
+
if (timer === undefined) {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
clearTimeout(timer);
|
|
299
|
+
cancelAnimationFrame(frame);
|
|
300
|
+
this.#scrollEndWaits.delete(done);
|
|
301
|
+
port.target.removeEventListener('scrollend', done);
|
|
302
|
+
port.target.removeEventListener('scroll', scrolled);
|
|
303
|
+
callback();
|
|
304
|
+
};
|
|
305
|
+
this.#scrollEndWaits.set(done, setTimeout(done, SCROLL_END_TIMEOUT));
|
|
306
|
+
port.target.addEventListener('scrollend', done);
|
|
307
|
+
port.target.addEventListener('scroll', scrolled, { passive: true });
|
|
308
|
+
// Nada a rolar (o destino já estava à vista): não vem `scrollend`.
|
|
309
|
+
frame = requestAnimationFrame(() => {
|
|
310
|
+
frame = requestAnimationFrame(() => {
|
|
311
|
+
if (!moving) {
|
|
312
|
+
done();
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
/** `scroll-padding` do contêiner (o que o hospedeiro gruda nele), em px. */
|
|
318
|
+
padding() {
|
|
319
|
+
const port = this.#port;
|
|
320
|
+
if (!port) {
|
|
321
|
+
return { top: 0, bottom: 0 };
|
|
322
|
+
}
|
|
323
|
+
const style = getComputedStyle(port.element);
|
|
324
|
+
const top = parseFloat(style.scrollPaddingTop);
|
|
325
|
+
const bottom = parseFloat(style.scrollPaddingBottom);
|
|
326
|
+
return { top: Number.isFinite(top) ? top : 0, bottom: Number.isFinite(bottom) ? bottom : 0 };
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=scroll-port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-port.js","sourceRoot":"","sources":["../../src/features/scroll-port.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAetD,8FAA8F;AAC9F,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,4GAA4G;AAC5G,MAAM,iBAAiB,GAAG,CAAC,OAAgB,EAAW,EAAE;IACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC;IACvC,OAAO,OAAO,KAAK,QAAQ,CAAC,eAAe,IAAI,OAAO,KAAK,QAAQ,CAAC,gBAAgB,CAAC;AACvF,CAAC,CAAC;AAEF,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAC,IAAU,EAAkB,EAAE;IACpD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,OAAO,IAAI,YAAY,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IACtB,KAAK,CAAiB;IACtB,UAAU,CAAsB;IAEzC,KAAK,GAAsB,IAAI,CAAC;IAChC,iFAAiF;IACjF,SAAS,GAAG,KAAK,CAAC;IACT,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,MAAM,CAA4B;IAClC,UAAU,GAAG,EAAE,CAAC;IAChB,eAAe,CAA6B;IAC5C,qBAAqB,CAAmC;IAC/C,aAAa,GAAG,IAAI,GAAG,EAAW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,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAErD,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/F,CAAC;CACF","sourcesContent":["import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\nimport { ScrollPort } from '../render/virtualizer.js';\n\n/** O que o controller precisa do grid. */\nexport interface ScrollPortHost extends ReactiveControllerHost, HTMLElement {\n scrollContainer: string | null;\n scrollContainerElement: HTMLElement | Window | null;\n}\n\nexport interface ScrollPortCallbacks {\n /** Rolagem da porta externa (janela de colunas, sombras, painel de carga). */\n scroll: () => void;\n /** A porta externa mudou de tamanho ou o grid se moveu dentro dela sem rolagem. */\n moved: () => void;\n}\n\n/** Tempo máximo de espera pelo `scrollend` (navegador sem o evento, rolagem interrompida). */\nconst SCROLL_END_TIMEOUT = 2000;\n\n/** `<html>`/`scrollingElement` = a janela (o `<body>` só no modo quirks, quando é o `scrollingElement`). */\nconst isViewportElement = (element: Element): boolean => {\n const document = element.ownerDocument;\n return element === document.documentElement || element === document.scrollingElement;\n};\n\n/** Pai na árvore \"composta\": o pai, ou o host da shadow root. */\nconst composedParent = (node: Node): Element | null => {\n if (node.parentElement) {\n return node.parentElement;\n }\n\n const root = node.parentNode;\n return root instanceof ShadowRoot ? root.host : null;\n};\n\n/**\n * Rolagem por um contêiner externo (spec 27): resolve o contêiner pedido\n * (`scroll-container` / `scrollContainerElement`), avisa no console quando\n * ele não serve, liga o modo pela folha de estilo da instância e ouve a\n * porta (rolagem, tamanho, linhas que se movem sem rolagem). Tudo é solto ao\n * trocar de contêiner e no `hostDisconnected` (spec 14).\n */\nexport class ScrollPortController implements ReactiveController {\n readonly #host: ScrollPortHost;\n readonly #callbacks: ScrollPortCallbacks;\n\n #port: ScrollPort | null = null;\n /** Já resolveu ao menos uma vez desde a conexão (antes disso, vale o pedido). */\n #resolved = false;\n readonly #warned = new Set<string>();\n #sheet: CSSStyleSheet | undefined;\n #sheetText = '';\n #resizeObserver: ResizeObserver | undefined;\n #intersectionObserver: IntersectionObserver | undefined;\n readonly #observedRows = new Set<Element>();\n /** Esperas de `scrollend` em curso: o temporizador de reserva de cada uma. */\n readonly #scrollEndWaits = new Map<() => void, ReturnType<typeof setTimeout>>();\n\n constructor(host: ScrollPortHost, callbacks: ScrollPortCallbacks) {\n this.#host = host;\n this.#callbacks = callbacks;\n host.addController(this);\n }\n\n hostConnected(): void {\n this.resolve();\n }\n\n hostDisconnected(): void {\n this.#detach();\n this.#resolved = false;\n }\n\n /** Porta externa resolvida (`null` = rolagem interna). */\n get port(): ScrollPort | null {\n return this.#port;\n }\n\n /**\n * Modo externo no render: resolvido, ou pedido e ainda não resolvido (SSR,\n * 1º render antes da conexão) — o servidor e a hidratação desenham igual.\n */\n get external(): boolean {\n return this.#resolved ? this.#port !== null : this.#requested();\n }\n\n #requested(): boolean {\n const { scrollContainer, scrollContainerElement } = this.#host;\n return !!scrollContainerElement || !!scrollContainer?.trim();\n }\n\n /** Avisos por objeto (contêiner, ancestral, host): um por valor, sem segurar o objeto. */\n readonly #warnedObjects = new WeakMap<object, Set<string>>();\n\n #warnOnce(target: object, message: string): void {\n const seen = this.#warnedObjects.get(target) ?? new Set<string>();\n\n if (!seen.has(message)) {\n seen.add(message);\n this.#warnedObjects.set(target, seen);\n console.warn(`<u-grid>: ${message}`);\n }\n }\n\n /** Altura dada ao host no modo externo corta as linhas (o grid precisa crescer com o conteúdo). */\n checkHeight(): void {\n const host = this.#host;\n\n if (this.#port && host.scrollHeight > host.clientHeight + 1) {\n this.#warnOnce(host, 'with scroll-container the grid grows to its content; do not give it a height (it clips the rows).');\n }\n }\n\n #warn(key: string, message: string): void {\n if (!this.#warned.has(key)) {\n this.#warned.add(key);\n console.warn(`<u-grid>: ${message}`);\n }\n }\n\n /** Resolve o contêiner pedido; chamado na conexão e quando as duas propriedades mudam. */\n resolve(): void {\n const host = this.#host;\n\n if (!host.isConnected) {\n return;\n }\n\n const source = this.#find();\n this.#resolved = true;\n\n if (source !== (this.#port?.source ?? null)) {\n this.#detach();\n\n if (source) {\n this.#attach(new ScrollPort(source));\n }\n\n host.requestUpdate();\n }\n\n this.#syncSheet();\n }\n\n #find(): HTMLElement | Window | null {\n const host = this.#host;\n const element = host.scrollContainerElement;\n const view = host.ownerDocument.defaultView;\n\n if (element) {\n if (element === view || (element instanceof Element && isViewportElement(element))) {\n this.#checkBetween(null);\n return view;\n }\n\n // Outro realm (iframe), SVG ou algo que não é elemento ancestral nem a janela deste documento.\n if (!(element instanceof HTMLElement) || !this.#isAncestor(element)) {\n this.#warnOnce(element, 'scrollContainerElement must be an ancestor element of the grid (or window); using the grid\\'s own scrolling.');\n return null;\n }\n\n this.#checkBetween(element);\n return element;\n }\n\n const id = host.scrollContainer;\n\n if (id === null || id === undefined) {\n return null;\n }\n\n const wanted = id.trim();\n\n if (!wanted) {\n this.#warn('empty', 'scroll-container is empty; using the grid\\'s own scrolling.');\n return null;\n }\n\n if (wanted === 'window') {\n this.#checkBetween(null);\n return view;\n }\n\n for (let node = composedParent(host); node; node = composedParent(node)) {\n if (node.id === wanted) {\n if (isViewportElement(node)) {\n this.#checkBetween(null);\n return view;\n }\n\n this.#checkBetween(node as HTMLElement);\n return node as HTMLElement;\n }\n }\n\n this.#warn(`id:${wanted}`, `scroll-container=\"${wanted}\": no ancestor with this id; using the grid's own scrolling.`);\n return null;\n }\n\n #isAncestor(element: Element): boolean {\n for (let node = composedParent(this.#host); node; node = composedParent(node)) {\n if (node === element) {\n return true;\n }\n }\n\n return false;\n }\n\n /** Ancestral entre o grid e o contêiner que corta/rola: o `sticky` gruda nele, não no contêiner. */\n #checkBetween(container: HTMLElement | null): void {\n const document = this.#host.ownerDocument;\n\n for (let node = composedParent(this.#host); node && node !== container; node = composedParent(node)) {\n if (node === document.documentElement || node === document.body) {\n break;\n }\n\n const style = getComputedStyle(node);\n\n if (![style.overflowX, style.overflowY].every(value => value === 'visible' || value === 'clip')) {\n this.#warnOnce(node, 'an ancestor between the grid and its scroll container has overflow set; sticky headers will stick to it instead.');\n return;\n }\n }\n }\n\n /**\n * Folha da instância: o modo externo vindo só da propriedade (`height:\n * auto` no host) e, com o atributo, a anulação quando ele não resolveu (o\n * grid não pode ficar sem altura e sem rolagem).\n */\n #syncSheet(): void {\n const root = this.#host.shadowRoot;\n const attribute = this.#host.hasAttribute('scroll-container');\n const text = this.#port && !attribute\n ? ':host { height: auto; overflow-anchor: none; }'\n : !this.#port && attribute\n ? ':host([scroll-container]:not([scroll-container=\"\"])) { height: 100%; overflow-anchor: auto; }'\n : '';\n\n if (!root || text === this.#sheetText || typeof CSSStyleSheet === 'undefined' || !('adoptedStyleSheets' in root)) {\n return;\n }\n\n this.#sheetText = text;\n const sheets = root.adoptedStyleSheets.filter(sheet => sheet !== this.#sheet);\n\n if (text) {\n this.#sheet ??= new CSSStyleSheet();\n this.#sheet.replaceSync(text);\n sheets.push(this.#sheet);\n }\n\n root.adoptedStyleSheets = sheets;\n }\n\n #attach(port: ScrollPort): void {\n this.#port = port;\n port.target.addEventListener('scroll', this.#onScroll, { passive: true });\n\n if (port.isWindow) {\n port.target.addEventListener('resize', this.#onMoved, { passive: true });\n } else if (typeof ResizeObserver !== 'undefined') {\n this.#resizeObserver = new ResizeObserver(this.#onMoved);\n this.#resizeObserver.observe(port.element);\n }\n\n if (typeof IntersectionObserver !== 'undefined') {\n // O conteúdo acima do grid muda de altura sem rolagem: as linhas\n // renderizadas entram/saem da porta e o grid relê a posição.\n this.#intersectionObserver = new IntersectionObserver(this.#onIntersect, {\n root: port.isWindow ? null : port.element,\n threshold: [0, 1],\n });\n }\n }\n\n #detach(): void {\n const port = this.#port;\n\n if (port) {\n port.target.removeEventListener('scroll', this.#onScroll);\n port.target.removeEventListener('resize', this.#onMoved);\n }\n\n this.#resizeObserver?.disconnect();\n this.#resizeObserver = undefined;\n this.#intersectionObserver?.disconnect();\n this.#intersectionObserver = undefined;\n this.#observedRows.clear();\n\n // Esperas em curso terminam já (soltam os próprios listeners e o quadro).\n for (const done of [...this.#scrollEndWaits.keys()]) {\n done();\n }\n\n this.#port = null;\n }\n\n readonly #onScroll = (): void => {\n this.#callbacks.scroll();\n };\n\n readonly #onMoved = (): void => {\n this.#callbacks.moved();\n };\n\n /** Ignora a 1ª entrega de cada alvo (o `observe` sempre entrega uma). */\n readonly #seen = new WeakSet<Element>();\n\n readonly #onIntersect = (entries: IntersectionObserverEntry[]): void => {\n let moved = false;\n\n for (const entry of entries) {\n if (this.#seen.has(entry.target)) {\n moved = true;\n } else {\n this.#seen.add(entry.target);\n }\n }\n\n if (moved) {\n this.#callbacks.moved();\n }\n };\n\n /** Observa as linhas renderizadas do corpo (só as novas; solta as que saíram). */\n observeRows(rows: Iterable<Element>): void {\n const observer = this.#intersectionObserver;\n\n if (!observer) {\n return;\n }\n\n const wanted = new Set(rows);\n\n for (const row of this.#observedRows) {\n if (!wanted.has(row)) {\n observer.unobserve(row);\n this.#observedRows.delete(row);\n }\n }\n\n for (const row of wanted) {\n if (!this.#observedRows.has(row)) {\n observer.observe(row);\n this.#observedRows.add(row);\n }\n }\n }\n\n /** Quantas linhas estão observadas agora (diagnóstico, testes de vazamento). */\n get observedRows(): number {\n return this.#observedRows.size;\n }\n\n /** Esperas de `scrollend` em curso (diagnóstico, spec 14). */\n get scrollEndWaits(): number {\n return this.#scrollEndWaits.size;\n }\n\n /** Chama `callback` quando a rolagem da porta acabar (ou no tempo limite). */\n afterScrollEnd(callback: () => void): void {\n const port = this.#port;\n\n if (!port) {\n callback();\n return;\n }\n\n let moving = false;\n let frame = 0;\n\n const scrolled = (): void => {\n moving = true;\n };\n\n const done = (): void => {\n const timer = this.#scrollEndWaits.get(done);\n\n if (timer === undefined) {\n return;\n }\n\n clearTimeout(timer);\n cancelAnimationFrame(frame);\n this.#scrollEndWaits.delete(done);\n port.target.removeEventListener('scrollend', done);\n port.target.removeEventListener('scroll', scrolled);\n callback();\n };\n\n this.#scrollEndWaits.set(done, setTimeout(done, SCROLL_END_TIMEOUT));\n port.target.addEventListener('scrollend', done);\n port.target.addEventListener('scroll', scrolled, { passive: true });\n // Nada a rolar (o destino já estava à vista): não vem `scrollend`.\n frame = requestAnimationFrame(() => {\n frame = requestAnimationFrame(() => {\n if (!moving) {\n done();\n }\n });\n });\n }\n\n /** `scroll-padding` do contêiner (o que o hospedeiro gruda nele), em px. */\n padding(): { top: number; bottom: number } {\n const port = this.#port;\n\n if (!port) {\n return { top: 0, bottom: 0 };\n }\n\n const style = getComputedStyle(port.element);\n const top = parseFloat(style.scrollPaddingTop);\n const bottom = parseFloat(style.scrollPaddingBottom);\n\n return { top: Number.isFinite(top) ? top : 0, bottom: Number.isFinite(bottom) ? bottom : 0 };\n }\n}\n"]}
|
|
@@ -16,8 +16,12 @@ export type GridColumnComparator<TItem = any> = (a: any, b: any, itemA: TItem, i
|
|
|
16
16
|
export type GridColumnDataType = 'string' | 'number' | 'date' | 'datetime' | 'boolean';
|
|
17
17
|
/** Logical alignment: `start`/`end` follow the direction (RTL). */
|
|
18
18
|
export type GridColumnAlignment = 'start' | 'center' | 'end';
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Boolean as text (`trueText`/`falseText`), as a read-only check/cross icon
|
|
21
|
+
* (`icon`) or as a check for `true` only (`check`: `false` shows nothing, its
|
|
22
|
+
* text stays for screen readers).
|
|
23
|
+
*/
|
|
24
|
+
export type GridColumnBooleanDisplay = 'text' | 'icon' | 'check';
|
|
21
25
|
/** Formats a cell value into its displayed text. */
|
|
22
26
|
export type GridColumnFormatter<TItem = any> = (value: unknown, item: TItem) => string;
|
|
23
27
|
/** `Intl` number/date options or a formatter function. */
|
|
@@ -28,11 +32,14 @@ export type GridColumnFormat<TItem = any> = Intl.NumberFormatOptions | Intl.Date
|
|
|
28
32
|
*/
|
|
29
33
|
export type GridFilterOperation = '=' | '<>' | '<' | '<=' | '>' | '>=' | 'contains' | 'notcontains' | 'startswith' | 'endswith' | 'between' | 'anyof' | 'noneof' | 'isblank' | 'isnotblank';
|
|
30
34
|
/**
|
|
31
|
-
* One condition: `[
|
|
35
|
+
* One condition: `[field, operation, value]`. `field` is the column `path`
|
|
36
|
+
* or, for a column without `path` (computed by `valueGetter`), its `name`;
|
|
37
|
+
* a `path` match wins over a `name` (the reverse of `GridColumnRef`), and a
|
|
38
|
+
* field that matches no column is read from the items as a dot path.
|
|
32
39
|
* `between` takes `[start, end]` (inclusive, either may be `null`), `anyof` /
|
|
33
40
|
* `noneof` take a list, `isblank` / `isnotblank` take no value.
|
|
34
41
|
*/
|
|
35
|
-
export type GridFilterCondition = readonly [
|
|
42
|
+
export type GridFilterCondition = readonly [field: string, operation: GridFilterOperation, value?: unknown] | readonly [field: string, value: unknown];
|
|
36
43
|
/**
|
|
37
44
|
* Serializable filter expression (same shape as DevExtreme): a condition, a
|
|
38
45
|
* negation `['!', expression]` or a group of expressions joined by `'and'` /
|
|
@@ -50,7 +57,7 @@ export interface GridColumnDef<TItem = any> {
|
|
|
50
57
|
/**
|
|
51
58
|
* Nested columns: a column with at least one nested column is a BAND (a
|
|
52
59
|
* header over its columns, no cells). In a band only `label`,
|
|
53
|
-
* `headerRenderer`, `alignment` (of the label; default `
|
|
60
|
+
* `headerRenderer`, `alignment` (of the label; default `start`), `fixed`,
|
|
54
61
|
* `visible` and `showInChooser` apply; the other fields are ignored. A band
|
|
55
62
|
* is shown while it is visible and has a visible column. Columns reorder
|
|
56
63
|
* only inside their own band; only leaf columns sort, group and export.
|
|
@@ -66,15 +73,21 @@ export interface GridColumnDef<TItem = any> {
|
|
|
66
73
|
minWidth?: number | null;
|
|
67
74
|
/** INITIAL grouping level; afterwards grouping is grid state (`groupColumn`, `ungroupColumn`). */
|
|
68
75
|
groupIndex?: number | null;
|
|
69
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* The column's name as text: the header text (unless `headerRenderer`;
|
|
78
|
+
* empty: `path`, or the `name` of a column with a `valueGetter`) and its name everywhere else (header buttons, group chip
|
|
79
|
+
* and rows, column chooser, row details, announcements, export; empty:
|
|
80
|
+
* `path`, then `name`, as is). Set it also with `headerRenderer`.
|
|
81
|
+
*/
|
|
70
82
|
label?: string;
|
|
71
83
|
/** Dot path of the cell value in the row item (`"address.city"`). */
|
|
72
84
|
path?: string;
|
|
73
85
|
/**
|
|
74
86
|
* Stable id of the column in the grid state (`getState`, `stateStorage`)
|
|
75
87
|
* and in string column references (`summary` items look it up before
|
|
76
|
-
* `path`)
|
|
77
|
-
*
|
|
88
|
+
* `path`) and, for a column without `path`, in filter conditions
|
|
89
|
+
* (`filterValue`). Default: `path`. A column without `name` and `path` is
|
|
90
|
+
* left out of the state.
|
|
78
91
|
*/
|
|
79
92
|
name?: string;
|
|
80
93
|
/** Data type; without it, inferred from the first non-null value. */
|
|
@@ -87,10 +100,29 @@ export interface GridColumnDef<TItem = any> {
|
|
|
87
100
|
valueGetter?: ((item: TItem) => unknown) | null;
|
|
88
101
|
/** Displayed text (cell and group row); wins over `format`. */
|
|
89
102
|
displayValue?: ((value: unknown, item: TItem) => string) | null;
|
|
90
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* `'text'` (default: `trueText`/`falseText`), `'icon'` (read-only check/cross,
|
|
105
|
+
* the text as its accessible name) or `'check'` (check for `true` only;
|
|
106
|
+
* `false` keeps its text for screen readers).
|
|
107
|
+
*/
|
|
91
108
|
booleanDisplay?: GridColumnBooleanDisplay | null;
|
|
92
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Text of `true` in a boolean column (declared or inferred): cell, icon
|
|
111
|
+
* name, group row, filters, copy/paste, summaries and export. Empty or
|
|
112
|
+
* `null`: the language's `trueText`. A fixed text: it does not follow
|
|
113
|
+
* `language`.
|
|
114
|
+
*/
|
|
115
|
+
trueText?: string | null;
|
|
116
|
+
/** Text of `false` in a boolean column, like `trueText`. Empty or `null`: the language's `falseText`. */
|
|
117
|
+
falseText?: string | null;
|
|
118
|
+
/** Wraps the cell text in several lines instead of an ellipsis (cells only; see `headerWrap`). */
|
|
93
119
|
wrap?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Wraps the header label in several lines instead of an ellipsis; the
|
|
122
|
+
* header row grows. `null`/absent: the grid's `headerWrap`; `false` turns it
|
|
123
|
+
* off for this column.
|
|
124
|
+
*/
|
|
125
|
+
headerWrap?: boolean | null;
|
|
94
126
|
/** Text for empty values (`null`/`undefined`). */
|
|
95
127
|
emptyText?: string | null;
|
|
96
128
|
/**
|
|
@@ -99,7 +131,11 @@ export interface GridColumnDef<TItem = any> {
|
|
|
99
131
|
* `null`, `undefined` and Lit's `nothing` render an empty cell. See `GridCellRenderer`.
|
|
100
132
|
*/
|
|
101
133
|
renderer?: GridCellRenderer<TItem> | null;
|
|
102
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Builds the header label (sort arrow, filter button and resize handle stay; their accessible names
|
|
136
|
+
* follow the rendered text). Set `label` too: it names the column outside the header (without it
|
|
137
|
+
* the grid warns once and uses `path`, then `name`).
|
|
138
|
+
*/
|
|
103
139
|
headerRenderer?: GridHeaderRenderer<TItem> | null;
|
|
104
140
|
/** Builds the label of the group rows of this column (expand button and aligned summaries stay). */
|
|
105
141
|
groupRenderer?: GridGroupRenderer<TItem> | null;
|
|
@@ -113,8 +149,9 @@ export interface GridColumnDef<TItem = any> {
|
|
|
113
149
|
comparator?: GridColumnComparator<TItem> | null;
|
|
114
150
|
/**
|
|
115
151
|
* Allows filtering by this column (filter row, header filter and, by
|
|
116
|
-
* default, the search panel). Default: `true`
|
|
117
|
-
*
|
|
152
|
+
* default, the search panel). Default: `true` with a `path`, or with a
|
|
153
|
+
* `valueGetter` and a `name` (not with remote filtering). The filter
|
|
154
|
+
* expression refers to the column by `path` or, without one, by `name`.
|
|
118
155
|
*/
|
|
119
156
|
filterable?: boolean | null;
|
|
120
157
|
/**
|
|
@@ -185,7 +222,10 @@ export interface GridColumnDef<TItem = any> {
|
|
|
185
222
|
*/
|
|
186
223
|
valueSetter?: GridValueSetter<TItem> | null;
|
|
187
224
|
}
|
|
188
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* A column of the grid: its `name`, its `path` (first column with that name, else with that path) or the column itself.
|
|
227
|
+
* Leaf columns only, including columns inside a band; a band is not a column reference.
|
|
228
|
+
*/
|
|
189
229
|
export type GridColumnRef<TItem = any> = string | GridColumnDef<TItem>;
|
|
190
230
|
/** Values of a group from the outermost level, e.g. `['Brazil', 'SP']`. */
|
|
191
231
|
export type GridGroupPath = readonly unknown[];
|
|
@@ -322,6 +362,12 @@ export interface GridGroupRenderContext<TItem = any> extends GridRenderContextBa
|
|
|
322
362
|
readonly itemCount: number;
|
|
323
363
|
/** Whether the group is expanded. */
|
|
324
364
|
readonly expanded: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* The first row of the group in the current order (after filtering), to
|
|
367
|
+
* show data of the group's rows (an icon, a link); `undefined` when the
|
|
368
|
+
* group has no loaded rows (remote groups).
|
|
369
|
+
*/
|
|
370
|
+
readonly firstItem: TItem | undefined;
|
|
325
371
|
/** Summaries shown in the group row text (`display: 'inline'`). */
|
|
326
372
|
readonly summaries: readonly GridSummaryValue<TItem>[];
|
|
327
373
|
/** The full label the grid would show (`"Country: Brazil (3, Sum of Population: 1,234)"`). */
|
package/dist/grid-column-def.js
CHANGED
|
@@ -14,10 +14,14 @@ export const isColumnSortable = (column) => column.sortable ?? (!!column.path ||
|
|
|
14
14
|
*/
|
|
15
15
|
export const isColumnExportable = (column) => column.exportable ?? (!!column.path || !!column.valueGetter || !!column.displayValue);
|
|
16
16
|
/**
|
|
17
|
-
* A coluna pode ser filtrada pelo usuário
|
|
17
|
+
* A coluna pode ser filtrada pelo usuário, olhando só a coluna? A condição a
|
|
18
|
+
* aponta pelo `path` ou, sem `path`, pelo `name` (spec 28). Padrão: com
|
|
19
|
+
* `path`, ou com `valueGetter` e `name` (sem getter a coluna sem `path` não
|
|
20
|
+
* tem valor; `filterable: true` não muda isso). O grid ainda tira a colisão
|
|
21
|
+
* de `name` e o remoto.
|
|
18
22
|
* @internal
|
|
19
23
|
*/
|
|
20
|
-
export const isColumnFilterable = (column) => !!column.path
|
|
24
|
+
export const isColumnFilterable = (column) => column.filterable !== false && (!!column.path || (!!column.valueGetter && !!column.name));
|
|
21
25
|
/**
|
|
22
26
|
* A coluna é editável (sem olhar o `allowEditing` do grid)? Padrão: com
|
|
23
27
|
* `path` ou `valueSetter`.
|