@sneat/datagrid 0.27.50 → 0.27.52
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/fesm2022/sneat-datagrid.mjs +281 -415
- package/fesm2022/sneat-datagrid.mjs.map +1 -1
- package/package.json +2 -2
- package/tsconfig.lib.prod.tsbuildinfo +1 -1
- package/types/sneat-datagrid.d.ts +132 -88
|
@@ -1,423 +1,289 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { ErrorLogger } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewChild, inject } from "@angular/core";
|
|
3
|
+
import { ErrorLogger } from "@sneat/core";
|
|
4
|
+
import { InteractionModule, KeybindingsModule, MenuModule, Module, SelectRangeModule, SelectRowModule, Tabulator } from "tabulator-tables";
|
|
5
|
+
var AdvertModule = class extends Module {
|
|
6
|
+
static {
|
|
7
|
+
this.moduleName = "advert";
|
|
8
|
+
}
|
|
9
|
+
initialize() {}
|
|
10
|
+
};
|
|
12
11
|
Tabulator.registerModule([
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// (see setTabulatorOptions()) so existing consumers see no behaviour change.
|
|
20
|
-
SelectRangeModule,
|
|
21
|
-
KeybindingsModule,
|
|
22
|
-
AdvertModule,
|
|
23
|
-
MenuModule,
|
|
12
|
+
InteractionModule,
|
|
13
|
+
SelectRowModule,
|
|
14
|
+
SelectRangeModule,
|
|
15
|
+
KeybindingsModule,
|
|
16
|
+
AdvertModule,
|
|
17
|
+
MenuModule
|
|
24
18
|
]);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const marker = c.field ? this.columnMarkers?.[c.field] : undefined;
|
|
248
|
-
if (marker) {
|
|
249
|
-
col.titleFormatter = this.buildColumnMarkerTitleFormatter(marker);
|
|
250
|
-
}
|
|
251
|
-
// console.log('col:', col);
|
|
252
|
-
return col;
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Renders the column's title text plus an unobtrusive marker badge.
|
|
257
|
-
* Inline styles (rather than a stylesheet) keep this correct regardless
|
|
258
|
-
* of the host app's CSS and Angular's view encapsulation — Tabulator
|
|
259
|
-
* renders headers into plain DOM nodes outside the component's template,
|
|
260
|
-
* which emulated encapsulation would not otherwise scope styles onto.
|
|
261
|
-
*/
|
|
262
|
-
buildColumnMarkerTitleFormatter(marker) {
|
|
263
|
-
return (cell) => {
|
|
264
|
-
const wrapper = document.createElement('span');
|
|
265
|
-
wrapper.style.display = 'inline-flex';
|
|
266
|
-
wrapper.style.alignItems = 'center';
|
|
267
|
-
wrapper.style.gap = '4px';
|
|
268
|
-
const titleSpan = document.createElement('span');
|
|
269
|
-
titleSpan.textContent = String(cell.getValue() ?? '');
|
|
270
|
-
wrapper.appendChild(titleSpan);
|
|
271
|
-
const markerSpan = document.createElement('span');
|
|
272
|
-
markerSpan.textContent = marker.label;
|
|
273
|
-
markerSpan.style.display = 'inline-block';
|
|
274
|
-
markerSpan.style.fontSize = '0.65em';
|
|
275
|
-
markerSpan.style.fontWeight = '600';
|
|
276
|
-
markerSpan.style.lineHeight = '1.4';
|
|
277
|
-
markerSpan.style.padding = '0 4px';
|
|
278
|
-
markerSpan.style.borderRadius = '3px';
|
|
279
|
-
markerSpan.style.opacity = '0.75';
|
|
280
|
-
markerSpan.style.whiteSpace = 'nowrap';
|
|
281
|
-
markerSpan.style.border =
|
|
282
|
-
marker.kind === 'inferred'
|
|
283
|
-
? '1px dashed currentColor'
|
|
284
|
-
: '1px solid currentColor';
|
|
285
|
-
if (marker.kind === 'inferred') {
|
|
286
|
-
markerSpan.style.fontStyle = 'italic';
|
|
287
|
-
}
|
|
288
|
-
if (marker.title) {
|
|
289
|
-
markerSpan.title = marker.title;
|
|
290
|
-
}
|
|
291
|
-
wrapper.appendChild(markerSpan);
|
|
292
|
-
return wrapper;
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
setTabulatorOptions() {
|
|
296
|
-
this.tabulatorOptions = {
|
|
297
|
-
// tooltipsHeader: true, // enable header tooltips
|
|
298
|
-
// tooltipGenerationMode: 'hover',
|
|
299
|
-
rowContextMenu: this.rowContextMenu,
|
|
300
|
-
selectableRows: this.selectable,
|
|
301
|
-
data: this.data,
|
|
302
|
-
// reactiveData: true, // enable data reactivity
|
|
303
|
-
columns: this.buildColumnDefinitions(),
|
|
304
|
-
layout: this.layout || 'fitColumns',
|
|
305
|
-
};
|
|
306
|
-
if (this.selectableRange) {
|
|
307
|
-
this.tabulatorOptions = {
|
|
308
|
-
...this.tabulatorOptions,
|
|
309
|
-
selectableRange: this.selectableRange,
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
// Registering KeybindingsModule activates its default arrow/page/home
|
|
314
|
-
// keybindings table-wide (they only *do* something in modules that
|
|
315
|
-
// subscribe to them, but scrolling/focus side effects are otherwise
|
|
316
|
-
// observable). Explicitly disabling them keeps existing consumers'
|
|
317
|
-
// behaviour identical unless they opt into selectableRange.
|
|
318
|
-
this.tabulatorOptions = {
|
|
319
|
-
...this.tabulatorOptions,
|
|
320
|
-
keybindings: false,
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
if (this.height) {
|
|
324
|
-
this.tabulatorOptions = {
|
|
325
|
-
...this.tabulatorOptions,
|
|
326
|
-
height: this.height,
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
if (this.maxHeight) {
|
|
330
|
-
this.tabulatorOptions = {
|
|
331
|
-
...this.tabulatorOptions,
|
|
332
|
-
maxHeight: this.maxHeight,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
if (this.groupBy) {
|
|
336
|
-
this.tabulatorOptions = {
|
|
337
|
-
...this.tabulatorOptions,
|
|
338
|
-
groupBy: this.groupBy,
|
|
339
|
-
groupHeader: (value, count) => {
|
|
340
|
-
// value - the value all members of this group share
|
|
341
|
-
// count - the number of rows in this group
|
|
342
|
-
// data - an array of all the row data objects in this group
|
|
343
|
-
// group - the group component for the group
|
|
344
|
-
// console.log('groupHeader', value);
|
|
345
|
-
return `${this.groupBy}: ${value} <span class="ion-margin-start">(${count} ${count === 1 ? 'record' : 'records'})</span>`;
|
|
346
|
-
},
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: DataGridComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
351
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: DataGridComponent, isStandalone: true, selector: "sneat-datagrid", inputs: { layout: "layout", data: "data", columns: "columns", groupBy: "groupBy", height: "height", maxHeight: "maxHeight", rowContextMenu: "rowContextMenu", rowClick: "rowClick", selectableRange: "selectableRange", columnMarkers: "columnMarkers", selectable: "selectable" }, outputs: { rowSelected: "rowSelected", rowDeselected: "rowDeselected", cellSelected: "cellSelected" }, viewQueries: [{ propertyName: "tabulatorDiv", first: true, predicate: ["tabulatorDiv"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
19
|
+
var DataGridComponent = class DataGridComponent {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.errorLogger = inject(ErrorLogger);
|
|
22
|
+
this.layout = "fitColumns";
|
|
23
|
+
this.data = [];
|
|
24
|
+
this.columns = [];
|
|
25
|
+
this.rowSelected = new EventEmitter();
|
|
26
|
+
this.rowDeselected = new EventEmitter();
|
|
27
|
+
this.cellSelected = new EventEmitter();
|
|
28
|
+
}
|
|
29
|
+
ngOnChanges(changes) {
|
|
30
|
+
try {
|
|
31
|
+
if (changes["data"] && this.data && this.columns || changes["columns"] && this.columns || changes["rowClick"] && this.rowClick) this.drawTable();
|
|
32
|
+
else if (changes["columnMarkers"] && this.tabulator && this.columns) {
|
|
33
|
+
const columnDefinitions = this.buildColumnDefinitions();
|
|
34
|
+
if (columnDefinitions) this.tabulator.setColumns(columnDefinitions);
|
|
35
|
+
}
|
|
36
|
+
} catch (ex) {
|
|
37
|
+
this.errorLogger.logError(ex, "Failed to process ngOnChanges in DataGridComponent");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
ngAfterViewInit() {
|
|
41
|
+
if (this.tabulator) try {
|
|
42
|
+
this.tabulator.redraw();
|
|
43
|
+
} catch (e) {
|
|
44
|
+
this.errorLogger.logError(e, "Failed to redraw tabulator", {
|
|
45
|
+
show: false,
|
|
46
|
+
report: false
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
drawTable() {
|
|
51
|
+
if (!this.data || !this.columns) {
|
|
52
|
+
console.warn("drawTable()", "columns:", this.columns, "data:", this.data);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
if (!this.tabulatorDiv) {
|
|
57
|
+
this.errorLogger.logError(/* @__PURE__ */ new Error("!this.tabulatorDiv"));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (this.tabulatorOptions) {
|
|
61
|
+
this.tabulatorOptions = {
|
|
62
|
+
...this.tabulatorOptions,
|
|
63
|
+
data: this.data
|
|
64
|
+
};
|
|
65
|
+
this.tabulator?.setData(this.data).catch(this.errorLogger.logErrorHandler("Failed to set data"));
|
|
66
|
+
} else this.createTabulatorGrid();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
this.errorLogger.logError(e, "Failed to drawTable");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
createTabulatorGrid() {
|
|
72
|
+
this.setTabulatorOptions();
|
|
73
|
+
if (!this.tabulator) {
|
|
74
|
+
this.tabulatorOptions = { ...this.tabulatorOptions };
|
|
75
|
+
this.tabulator = new Tabulator(this.tabulatorDiv?.nativeElement, this.tabulatorOptions);
|
|
76
|
+
this.tabulator.on("rowClick", (event, row) => {
|
|
77
|
+
this.clickEvent = event;
|
|
78
|
+
if (this.rowClick) this.rowClick(event, row);
|
|
79
|
+
});
|
|
80
|
+
this.tabulator.on("rowSelected", (row) => this.rowSelected.emit({
|
|
81
|
+
row,
|
|
82
|
+
event: this.clickEvent
|
|
83
|
+
}));
|
|
84
|
+
this.tabulator.on("rowDeselected", (row) => this.rowDeselected.emit({
|
|
85
|
+
row,
|
|
86
|
+
event: this.clickEvent
|
|
87
|
+
}));
|
|
88
|
+
this.tabulator.on("cellClick", (_event, cell) => {
|
|
89
|
+
this.emitCellSelected(cell);
|
|
90
|
+
});
|
|
91
|
+
this.tabulator.on("rangeChanged", (range) => {
|
|
92
|
+
this.handleRangeChanged(range);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
emitCellSelected(cell) {
|
|
97
|
+
const field = cell.getField();
|
|
98
|
+
this.cellSelected.emit({
|
|
99
|
+
row: cell.getRow(),
|
|
100
|
+
column: {
|
|
101
|
+
field,
|
|
102
|
+
index: this.columns?.findIndex((c) => c.field === field) ?? -1
|
|
103
|
+
},
|
|
104
|
+
value: cell.getValue(),
|
|
105
|
+
rowData: cell.getData()
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
handleRangeChanged(range) {
|
|
109
|
+
const bounds = range.getBounds();
|
|
110
|
+
if (bounds.start.getElement() === bounds.end.getElement()) this.emitCellSelected(bounds.end);
|
|
111
|
+
}
|
|
112
|
+
buildColumnDefinitions() {
|
|
113
|
+
return this.columns?.map((c) => {
|
|
114
|
+
const col = {
|
|
115
|
+
field: c.field,
|
|
116
|
+
title: c.title || c.field || c.title
|
|
117
|
+
};
|
|
118
|
+
if (c.colName !== "Id" && c.colName?.endsWith("Id")) {
|
|
119
|
+
col.formatter = "link";
|
|
120
|
+
col.formatterParams = { url: "test-url" };
|
|
121
|
+
col.cellClick = (e, cell) => {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
e.stopPropagation();
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
if (c.tooltip) col.tooltip = c.tooltip;
|
|
127
|
+
if (c.formatter) col.formatter = c.formatter;
|
|
128
|
+
if (c.hozAlign) col.hozAlign = c.hozAlign;
|
|
129
|
+
if (c.headerHozAlign) col.headerHozAlign = c.headerHozAlign;
|
|
130
|
+
if (c.widthGrow) col.widthGrow = c.widthGrow;
|
|
131
|
+
if (c.widthShrink) col.widthShrink = c.widthShrink;
|
|
132
|
+
if (c.width !== void 0) col.width = c.width;
|
|
133
|
+
const marker = c.field ? this.columnMarkers?.[c.field] : void 0;
|
|
134
|
+
if (marker) col.titleFormatter = this.buildColumnMarkerTitleFormatter(marker);
|
|
135
|
+
return col;
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
buildColumnMarkerTitleFormatter(marker) {
|
|
139
|
+
return (cell) => {
|
|
140
|
+
const wrapper = document.createElement("span");
|
|
141
|
+
wrapper.style.display = "inline-flex";
|
|
142
|
+
wrapper.style.alignItems = "center";
|
|
143
|
+
wrapper.style.gap = "4px";
|
|
144
|
+
const titleSpan = document.createElement("span");
|
|
145
|
+
titleSpan.textContent = String(cell.getValue() ?? "");
|
|
146
|
+
wrapper.appendChild(titleSpan);
|
|
147
|
+
const markerSpan = document.createElement("span");
|
|
148
|
+
markerSpan.textContent = marker.label;
|
|
149
|
+
markerSpan.style.display = "inline-block";
|
|
150
|
+
markerSpan.style.fontSize = "0.65em";
|
|
151
|
+
markerSpan.style.fontWeight = "600";
|
|
152
|
+
markerSpan.style.lineHeight = "1.4";
|
|
153
|
+
markerSpan.style.padding = "0 4px";
|
|
154
|
+
markerSpan.style.borderRadius = "3px";
|
|
155
|
+
markerSpan.style.opacity = "0.75";
|
|
156
|
+
markerSpan.style.whiteSpace = "nowrap";
|
|
157
|
+
markerSpan.style.border = marker.kind === "inferred" ? "1px dashed currentColor" : "1px solid currentColor";
|
|
158
|
+
if (marker.kind === "inferred") markerSpan.style.fontStyle = "italic";
|
|
159
|
+
if (marker.title) markerSpan.title = marker.title;
|
|
160
|
+
wrapper.appendChild(markerSpan);
|
|
161
|
+
return wrapper;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
setTabulatorOptions() {
|
|
165
|
+
this.tabulatorOptions = {
|
|
166
|
+
rowContextMenu: this.rowContextMenu,
|
|
167
|
+
selectableRows: this.selectable,
|
|
168
|
+
data: this.data,
|
|
169
|
+
columns: this.buildColumnDefinitions(),
|
|
170
|
+
layout: this.layout || "fitColumns"
|
|
171
|
+
};
|
|
172
|
+
if (this.selectableRange) this.tabulatorOptions = {
|
|
173
|
+
...this.tabulatorOptions,
|
|
174
|
+
selectableRange: this.selectableRange
|
|
175
|
+
};
|
|
176
|
+
else this.tabulatorOptions = {
|
|
177
|
+
...this.tabulatorOptions,
|
|
178
|
+
keybindings: false
|
|
179
|
+
};
|
|
180
|
+
if (this.height) this.tabulatorOptions = {
|
|
181
|
+
...this.tabulatorOptions,
|
|
182
|
+
height: this.height
|
|
183
|
+
};
|
|
184
|
+
if (this.maxHeight) this.tabulatorOptions = {
|
|
185
|
+
...this.tabulatorOptions,
|
|
186
|
+
maxHeight: this.maxHeight
|
|
187
|
+
};
|
|
188
|
+
if (this.groupBy) this.tabulatorOptions = {
|
|
189
|
+
...this.tabulatorOptions,
|
|
190
|
+
groupBy: this.groupBy,
|
|
191
|
+
groupHeader: (value, count) => {
|
|
192
|
+
return `${this.groupBy}: ${value} <span class="ion-margin-start">(${count} ${count === 1 ? "record" : "records"})</span>`;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
static {
|
|
197
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
198
|
+
minVersion: "12.0.0",
|
|
199
|
+
version: "22.2.6",
|
|
200
|
+
ngImport: i0,
|
|
201
|
+
type: DataGridComponent,
|
|
202
|
+
deps: [],
|
|
203
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
static {
|
|
207
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
208
|
+
minVersion: "14.0.0",
|
|
209
|
+
version: "22.2.6",
|
|
210
|
+
type: DataGridComponent,
|
|
211
|
+
isStandalone: true,
|
|
212
|
+
selector: "sneat-datagrid",
|
|
213
|
+
inputs: {
|
|
214
|
+
layout: "layout",
|
|
215
|
+
data: "data",
|
|
216
|
+
columns: "columns",
|
|
217
|
+
groupBy: "groupBy",
|
|
218
|
+
height: "height",
|
|
219
|
+
maxHeight: "maxHeight",
|
|
220
|
+
rowContextMenu: "rowContextMenu",
|
|
221
|
+
rowClick: "rowClick",
|
|
222
|
+
selectableRange: "selectableRange",
|
|
223
|
+
columnMarkers: "columnMarkers",
|
|
224
|
+
selectable: "selectable"
|
|
225
|
+
},
|
|
226
|
+
outputs: {
|
|
227
|
+
rowSelected: "rowSelected",
|
|
228
|
+
rowDeselected: "rowDeselected",
|
|
229
|
+
cellSelected: "cellSelected"
|
|
230
|
+
},
|
|
231
|
+
viewQueries: [{
|
|
232
|
+
propertyName: "tabulatorDiv",
|
|
233
|
+
first: true,
|
|
234
|
+
predicate: ["tabulatorDiv"],
|
|
235
|
+
descendants: true,
|
|
236
|
+
static: true
|
|
237
|
+
}],
|
|
238
|
+
usesOnChanges: true,
|
|
239
|
+
ngImport: i0,
|
|
240
|
+
template: `
|
|
352
241
|
<div id="tabulator" #tabulatorDiv></div>
|
|
353
242
|
<p class="ion-margin-start">Rows: {{ data?.length }}</p>
|
|
354
|
-
`,
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
243
|
+
`,
|
|
244
|
+
isInline: true,
|
|
245
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
250
|
+
minVersion: "12.0.0",
|
|
251
|
+
version: "22.2.6",
|
|
252
|
+
ngImport: i0,
|
|
253
|
+
type: DataGridComponent,
|
|
254
|
+
decorators: [{
|
|
255
|
+
type: Component,
|
|
256
|
+
args: [{
|
|
257
|
+
selector: "sneat-datagrid",
|
|
258
|
+
template: `
|
|
361
259
|
<div id="tabulator" #tabulatorDiv></div>
|
|
362
260
|
<p class="ion-margin-start">Rows: {{ data?.length }}</p>
|
|
363
261
|
`,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
type: Output
|
|
390
|
-
}], selectableRange: [{
|
|
391
|
-
type: Input
|
|
392
|
-
}], columnMarkers: [{
|
|
393
|
-
type: Input
|
|
394
|
-
}], cellSelected: [{
|
|
395
|
-
type: Output
|
|
396
|
-
}], selectable: [{
|
|
397
|
-
type: Input
|
|
398
|
-
}] } });
|
|
399
|
-
|
|
400
|
-
// export interface TabulatorOptions {
|
|
401
|
-
// readonly tooltipsHeader?: boolean;
|
|
402
|
-
// readonly tooltipGenerationMode?: 'hover' | 'mouseover';
|
|
403
|
-
// readonly reactiveData?: boolean;
|
|
404
|
-
// readonly selectable?: boolean | number | 'highlight';
|
|
405
|
-
// readonly data?: unknown[];
|
|
406
|
-
// readonly layout?: 'fitData' | 'fitColumns';
|
|
407
|
-
// readonly columns?: TabulatorColumn[];
|
|
408
|
-
// readonly height?: string | number;
|
|
409
|
-
// readonly maxHeight?: string | number;
|
|
410
|
-
// readonly groupBy?: string;
|
|
411
|
-
// readonly groupHeader?: (value: unknown, count: number) => string;
|
|
412
|
-
// readonly rowClick?: (event: Event, row: unknown) => void;
|
|
413
|
-
// readonly rowSelect?: (row: unknown) => void;
|
|
414
|
-
// readonly rowDeselect?: (row: unknown) => void;
|
|
415
|
-
// readonly rowContextMenu?: IRowMenu[];
|
|
416
|
-
// }
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Generated bundle index. Do not edit.
|
|
420
|
-
*/
|
|
421
|
-
|
|
262
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
263
|
+
imports: []
|
|
264
|
+
}]
|
|
265
|
+
}],
|
|
266
|
+
propDecorators: {
|
|
267
|
+
layout: [{ type: Input }],
|
|
268
|
+
data: [{ type: Input }],
|
|
269
|
+
columns: [{ type: Input }],
|
|
270
|
+
groupBy: [{ type: Input }],
|
|
271
|
+
height: [{ type: Input }],
|
|
272
|
+
maxHeight: [{ type: Input }],
|
|
273
|
+
rowContextMenu: [{ type: Input }],
|
|
274
|
+
tabulatorDiv: [{
|
|
275
|
+
type: ViewChild,
|
|
276
|
+
args: ["tabulatorDiv", { static: true }]
|
|
277
|
+
}],
|
|
278
|
+
rowClick: [{ type: Input }],
|
|
279
|
+
rowSelected: [{ type: Output }],
|
|
280
|
+
rowDeselected: [{ type: Output }],
|
|
281
|
+
selectableRange: [{ type: Input }],
|
|
282
|
+
columnMarkers: [{ type: Input }],
|
|
283
|
+
cellSelected: [{ type: Output }],
|
|
284
|
+
selectable: [{ type: Input }]
|
|
285
|
+
}
|
|
286
|
+
});
|
|
422
287
|
export { DataGridComponent };
|
|
423
|
-
|
|
288
|
+
|
|
289
|
+
//# sourceMappingURL=sneat-datagrid.mjs.map
|