overview-components 0.9.0 → 1.0.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/dist/assets/generated/locales/de.d.ts +9 -0
- package/dist/assets/generated/locales/de.d.ts.map +1 -1
- package/dist/assets/generated/locales/de.js +9 -0
- package/dist/assets/generated/locales/de.js.map +1 -1
- package/dist/assets/generated/locales/en.d.ts +17 -8
- package/dist/assets/generated/locales/en.d.ts.map +1 -1
- package/dist/assets/generated/locales/en.js +18 -9
- package/dist/assets/generated/locales/en.js.map +1 -1
- package/dist/assets/generated/locales/pl.d.ts +9 -0
- package/dist/assets/generated/locales/pl.d.ts.map +1 -1
- package/dist/assets/generated/locales/pl.js +9 -0
- package/dist/assets/generated/locales/pl.js.map +1 -1
- package/dist/assets/generated/locales/sk.d.ts +9 -0
- package/dist/assets/generated/locales/sk.d.ts.map +1 -1
- package/dist/assets/generated/locales/sk.js +9 -0
- package/dist/assets/generated/locales/sk.js.map +1 -1
- package/dist/assets/ilustration/no-content.d.ts +6 -0
- package/dist/assets/ilustration/no-content.d.ts.map +1 -0
- package/dist/assets/ilustration/no-content.js +167 -0
- package/dist/assets/ilustration/no-content.js.map +1 -0
- package/dist/assets/ilustration/no-preview.d.ts +1 -0
- package/dist/assets/ilustration/no-preview.d.ts.map +1 -1
- package/dist/assets/ilustration/no-preview.js +116 -114
- package/dist/assets/ilustration/no-preview.js.map +1 -1
- package/dist/assets/ilustration/not-found.d.ts +1 -0
- package/dist/assets/ilustration/not-found.d.ts.map +1 -1
- package/dist/assets/ilustration/not-found.js +89 -86
- package/dist/assets/ilustration/not-found.js.map +1 -1
- package/dist/components/lit-attachments-tab.d.ts +29 -15
- package/dist/components/lit-attachments-tab.d.ts.map +1 -1
- package/dist/components/lit-attachments-tab.js +352 -318
- package/dist/components/lit-attachments-tab.js.map +1 -1
- package/dist/components/lit-case-variables-tab.d.ts +4 -23
- package/dist/components/lit-case-variables-tab.d.ts.map +1 -1
- package/dist/components/lit-case-variables-tab.js +148 -224
- package/dist/components/lit-case-variables-tab.js.map +1 -1
- package/dist/components/lit-chart.d.ts +46 -0
- package/dist/components/lit-chart.d.ts.map +1 -0
- package/dist/components/lit-chart.js +423 -0
- package/dist/components/lit-chart.js.map +1 -0
- package/dist/components/lit-data-grid-tanstack.d.ts +56 -7
- package/dist/components/lit-data-grid-tanstack.d.ts.map +1 -1
- package/dist/components/lit-data-grid-tanstack.js +748 -564
- package/dist/components/lit-data-grid-tanstack.js.map +1 -1
- package/dist/components/lit-section-tab.d.ts +22 -0
- package/dist/components/lit-section-tab.d.ts.map +1 -0
- package/dist/components/lit-section-tab.js +70 -0
- package/dist/components/lit-section-tab.js.map +1 -0
- package/dist/components/lit-tabs-overview.d.ts +33 -0
- package/dist/components/lit-tabs-overview.d.ts.map +1 -0
- package/dist/components/lit-tabs-overview.js +143 -0
- package/dist/components/lit-tabs-overview.js.map +1 -0
- package/dist/components/react-wrappers/chart.d.ts +3 -0
- package/dist/components/react-wrappers/chart.d.ts.map +1 -0
- package/dist/components/react-wrappers/chart.js +9 -0
- package/dist/components/react-wrappers/chart.js.map +1 -0
- package/dist/components/react-wrappers/section-tab.d.ts +3 -0
- package/dist/components/react-wrappers/section-tab.d.ts.map +1 -0
- package/dist/components/react-wrappers/section-tab.js +9 -0
- package/dist/components/react-wrappers/section-tab.js.map +1 -0
- package/dist/components/react-wrappers/tabs-overview.d.ts +3 -0
- package/dist/components/react-wrappers/tabs-overview.d.ts.map +1 -0
- package/dist/components/react-wrappers/tabs-overview.js +9 -0
- package/dist/components/react-wrappers/tabs-overview.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/scripts/translate-locales.js +1 -0
- package/dist/scripts/translate-locales.js.map +1 -1
- package/dist/shared/filter-inputs.d.ts +14 -4
- package/dist/shared/filter-inputs.d.ts.map +1 -1
- package/dist/shared/filter-inputs.js +207 -51
- package/dist/shared/filter-inputs.js.map +1 -1
- package/dist/shared/lit-button.js +2 -2
- package/dist/shared/lit-case-variables-tab-cell.d.ts +58 -0
- package/dist/shared/lit-case-variables-tab-cell.d.ts.map +1 -0
- package/dist/shared/lit-case-variables-tab-cell.js +224 -0
- package/dist/shared/lit-case-variables-tab-cell.js.map +1 -0
- package/dist/shared/lit-custom-popper.d.ts.map +1 -1
- package/dist/shared/lit-custom-popper.js +31 -31
- package/dist/shared/lit-custom-popper.js.map +1 -1
- package/dist/shared/lit-data-grid-action-buttons-popover.d.ts +14 -5
- package/dist/shared/lit-data-grid-action-buttons-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-action-buttons-popover.js +197 -102
- package/dist/shared/lit-data-grid-action-buttons-popover.js.map +1 -1
- package/dist/shared/lit-data-grid-density-popover.d.ts +18 -0
- package/dist/shared/lit-data-grid-density-popover.d.ts.map +1 -0
- package/dist/shared/lit-data-grid-density-popover.js +102 -0
- package/dist/shared/lit-data-grid-density-popover.js.map +1 -0
- package/dist/shared/lit-data-grid-export-popover.d.ts +3 -0
- package/dist/shared/lit-data-grid-export-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-export-popover.js +41 -46
- package/dist/shared/lit-data-grid-export-popover.js.map +1 -1
- package/dist/shared/lit-loader.d.ts +7 -0
- package/dist/shared/lit-loader.d.ts.map +1 -0
- package/dist/shared/lit-loader.js +51 -0
- package/dist/shared/lit-loader.js.map +1 -0
- package/dist/shared/lit-loading-bar.d.ts +20 -0
- package/dist/shared/lit-loading-bar.d.ts.map +1 -0
- package/dist/shared/lit-loading-bar.js +92 -0
- package/dist/shared/lit-loading-bar.js.map +1 -0
- package/dist/shared/lit-menu-item.d.ts +24 -0
- package/dist/shared/lit-menu-item.d.ts.map +1 -0
- package/dist/shared/lit-menu-item.js +77 -0
- package/dist/shared/lit-menu-item.js.map +1 -0
- package/dist/shared/lit-menu.d.ts +6 -0
- package/dist/shared/lit-menu.d.ts.map +1 -0
- package/dist/shared/lit-menu.js +38 -0
- package/dist/shared/lit-menu.js.map +1 -0
- package/dist/shared/lit-overflow-tooltip.d.ts +16 -0
- package/dist/shared/lit-overflow-tooltip.d.ts.map +1 -0
- package/dist/shared/lit-overflow-tooltip.js +86 -0
- package/dist/shared/lit-overflow-tooltip.js.map +1 -0
- package/dist/shared/lit-select.d.ts +24 -3
- package/dist/shared/lit-select.d.ts.map +1 -1
- package/dist/shared/lit-select.js +234 -130
- package/dist/shared/lit-select.js.map +1 -1
- package/dist/shared/lit-tooltip.d.ts.map +1 -1
- package/dist/shared/lit-tooltip.js +4 -3
- package/dist/shared/lit-tooltip.js.map +1 -1
- package/dist/utils/custom-filters.d.ts +3 -0
- package/dist/utils/custom-filters.d.ts.map +1 -0
- package/dist/{components → utils}/custom-filters.js +6 -0
- package/dist/utils/custom-filters.js.map +1 -0
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +6 -3
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/localization.d.ts.map +1 -1
- package/dist/utils/localization.js +195 -5
- package/dist/utils/localization.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/custom-filters.d.ts +0 -2
- package/dist/components/custom-filters.d.ts.map +0 -1
- package/dist/components/custom-filters.js.map +0 -1
|
@@ -4,7 +4,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import * as XLSX from 'xlsx';
|
|
8
7
|
import { css, html, LitElement } from 'lit';
|
|
9
8
|
import { msg } from '@lit/localize';
|
|
10
9
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
@@ -23,10 +22,13 @@ import '../shared/lit-tooltip.js';
|
|
|
23
22
|
import '../shared/lit-data-grid-export-popover.js';
|
|
24
23
|
import '../shared/lit-data-grid-action-buttons-popover.js';
|
|
25
24
|
import '../assets/ilustration/not-found.js';
|
|
25
|
+
import '../shared/lit-overflow-tooltip.js';
|
|
26
|
+
import '../shared/lit-data-grid-density-popover.js';
|
|
27
|
+
import '../shared/lit-loading-bar.js';
|
|
26
28
|
// utils
|
|
27
29
|
import { formatDate } from '../utils/date.js';
|
|
28
|
-
import { dateFilterFn } from '
|
|
29
|
-
import { setLocale } from '../utils/localization.js';
|
|
30
|
+
import { dateFilterFn, multiselectFilterFn } from '../utils/custom-filters.js';
|
|
31
|
+
import { setLocale, getLocale } from '../utils/localization.js';
|
|
30
32
|
let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
31
33
|
constructor() {
|
|
32
34
|
super(...arguments);
|
|
@@ -46,11 +48,22 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
46
48
|
this.userLang = 'cs';
|
|
47
49
|
this.dateFormat = null;
|
|
48
50
|
this.isLoading = false;
|
|
51
|
+
this.enableRowSelectionOnClick = false;
|
|
52
|
+
this.initialFiltering = [];
|
|
53
|
+
this.server = false;
|
|
54
|
+
this.onColumnFiltersChanged = (filterModel) => { };
|
|
55
|
+
this.onColumnSortChanged = (sortModel) => { };
|
|
56
|
+
this.scrollEndThreshold = 100;
|
|
57
|
+
this.rowDensity = 'standard';
|
|
49
58
|
this.rowsCount = 0;
|
|
59
|
+
this.selectedRowId = null;
|
|
50
60
|
this.isScrollable = false;
|
|
51
61
|
this.disableScrollLeft = true;
|
|
52
62
|
this.disableScrollRight = false;
|
|
53
|
-
this.
|
|
63
|
+
this.filters = [];
|
|
64
|
+
this.sorting = [];
|
|
65
|
+
this.rowHeight = 31;
|
|
66
|
+
this.scrollToEnd = false;
|
|
54
67
|
this.tableContainerRef = createRef();
|
|
55
68
|
this.scrollInterval = null;
|
|
56
69
|
this.getCellBackgroundColor = (cell) => {
|
|
@@ -78,53 +91,157 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
78
91
|
}
|
|
79
92
|
};
|
|
80
93
|
}
|
|
94
|
+
get rows() {
|
|
95
|
+
return [...(this.row || [])];
|
|
96
|
+
}
|
|
97
|
+
get getColumns() {
|
|
98
|
+
return [...(this.columns || [])];
|
|
99
|
+
}
|
|
100
|
+
// lifecycle
|
|
81
101
|
connectedCallback() {
|
|
82
|
-
|
|
102
|
+
super.connectedCallback();
|
|
83
103
|
this.initRowVirtualizer();
|
|
84
104
|
this.initColumnVirtualizer();
|
|
85
|
-
|
|
105
|
+
this.initTable();
|
|
86
106
|
window.addEventListener('resize', this.updateScrollState);
|
|
107
|
+
document.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
87
108
|
}
|
|
88
109
|
disconnectedCallback() {
|
|
89
110
|
super.disconnectedCallback();
|
|
90
111
|
window.removeEventListener('resize', this.updateScrollState);
|
|
112
|
+
document.removeEventListener('keydown', this.handleKeyDown.bind(this));
|
|
113
|
+
}
|
|
114
|
+
updated(changedProperties) {
|
|
115
|
+
if ((changedProperties.has('rowsCount') || changedProperties.has('rowDensity')) &&
|
|
116
|
+
this.enableRowVirtualization) {
|
|
117
|
+
this.scrollToEnd = false;
|
|
118
|
+
this.initRowVirtualizer();
|
|
119
|
+
this.requestUpdate();
|
|
120
|
+
}
|
|
121
|
+
if (changedProperties.has('columns') && this.enableColumnVirtualization) {
|
|
122
|
+
this.initColumnVirtualizer();
|
|
123
|
+
this.requestUpdate();
|
|
124
|
+
}
|
|
125
|
+
if (changedProperties.has('initialFiltering')) {
|
|
126
|
+
this.filters = [...(this.initialFiltering || [])];
|
|
127
|
+
}
|
|
128
|
+
if (changedProperties.has('initialSorting')) {
|
|
129
|
+
this.sorting = [...(this.initialSorting || [])];
|
|
130
|
+
}
|
|
131
|
+
if (changedProperties.has('rowDensity')) {
|
|
132
|
+
this.rowHeight = this.getRowHeight();
|
|
133
|
+
}
|
|
134
|
+
if (changedProperties.has('row') || changedProperties.has('columns')) {
|
|
135
|
+
this.initTable();
|
|
136
|
+
this.requestUpdate();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
firstUpdated() {
|
|
140
|
+
const grid = this.tableContainerRef.value;
|
|
141
|
+
if (grid) {
|
|
142
|
+
grid.addEventListener('scroll', this.updateScrollState);
|
|
143
|
+
}
|
|
144
|
+
this.updateScrollState();
|
|
145
|
+
}
|
|
146
|
+
async loadXLSX() {
|
|
147
|
+
if (!window.XLSX) {
|
|
148
|
+
await new Promise((resolve) => {
|
|
149
|
+
const script = document.createElement('script');
|
|
150
|
+
script.src = '../../public/libs/xlsx.mini.min.js';
|
|
151
|
+
script.onload = resolve;
|
|
152
|
+
document.head.appendChild(script);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// row density
|
|
157
|
+
getRowHeight() {
|
|
158
|
+
switch (this.rowDensity) {
|
|
159
|
+
case 'compact':
|
|
160
|
+
return 31;
|
|
161
|
+
case 'standard':
|
|
162
|
+
return 38;
|
|
163
|
+
case 'comfort':
|
|
164
|
+
return 50;
|
|
165
|
+
default:
|
|
166
|
+
return 38;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
getButtonSize() {
|
|
170
|
+
switch (this.rowDensity) {
|
|
171
|
+
case 'compact':
|
|
172
|
+
return 'small';
|
|
173
|
+
case 'standard':
|
|
174
|
+
return 'medium';
|
|
175
|
+
case 'comfort':
|
|
176
|
+
return 'large';
|
|
177
|
+
default:
|
|
178
|
+
return 'medium';
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
handleSetDensity(density) {
|
|
182
|
+
this.rowDensity = density;
|
|
183
|
+
}
|
|
184
|
+
// scroll by keyboard arrows
|
|
185
|
+
handleKeyDown(event) {
|
|
186
|
+
if (!this.enableRowSelectionOnClick)
|
|
187
|
+
return;
|
|
188
|
+
const rows = this.table.getRowModel().rows;
|
|
189
|
+
const currentIndex = rows.findIndex((row) => row.id === this.selectedRowId);
|
|
190
|
+
if (event.key === 'ArrowDown') {
|
|
191
|
+
if (!this.selectedRowId) {
|
|
192
|
+
// this.selectedRowId = rows[0]?.id; // Select first row if none selected
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const nextIndex = Math.min(currentIndex + 1, (rows.length ?? 0) - 1);
|
|
196
|
+
this.selectedRowId = rows[nextIndex].id;
|
|
197
|
+
}
|
|
198
|
+
else if (event.key === 'ArrowUp') {
|
|
199
|
+
if (!this.selectedRowId) {
|
|
200
|
+
// this.selectedRowId = rows[0]?.id; // Select first row if none selected
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const prevIndex = Math.max(currentIndex - 1, 0);
|
|
204
|
+
this.selectedRowId = rows[prevIndex].id;
|
|
205
|
+
}
|
|
206
|
+
else if (event.key === 'Enter' && this.selectedRowId) {
|
|
207
|
+
const selectedRow = rows.find((row) => row.id === this.selectedRowId);
|
|
208
|
+
if (selectedRow) {
|
|
209
|
+
this.handleRowDoubleClick(selectedRow);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
91
212
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.rowVirtualizerController
|
|
95
|
-
count:
|
|
213
|
+
// virtualization
|
|
214
|
+
initRowVirtualizer() {
|
|
215
|
+
this.rowVirtualizerController = new VirtualizerController(this, {
|
|
216
|
+
count: this.table?.getRowModel()?.rows.length || this.row?.length || 1,
|
|
96
217
|
getScrollElement: () => this.tableContainerRef.value,
|
|
97
|
-
estimateSize: () =>
|
|
218
|
+
estimateSize: () => this.rowHeight,
|
|
98
219
|
overscan: 5,
|
|
99
220
|
});
|
|
100
221
|
}
|
|
101
|
-
|
|
102
|
-
this.
|
|
222
|
+
initTable() {
|
|
223
|
+
this.tableController = new TableController(this);
|
|
224
|
+
}
|
|
225
|
+
initColumnVirtualizer() {
|
|
226
|
+
this.columnVirtualizerController = new VirtualizerController(this, {
|
|
103
227
|
horizontal: true,
|
|
104
|
-
count: table
|
|
228
|
+
count: this.table?.getVisibleLeafColumns().length || this.columns.length || 1,
|
|
105
229
|
getScrollElement: () => this.tableContainerRef.value,
|
|
106
|
-
estimateSize: (index) =>
|
|
230
|
+
estimateSize: (index) => this.table.getVisibleLeafColumns()[index].getSize() || 200,
|
|
107
231
|
overscan: 5,
|
|
108
232
|
});
|
|
109
233
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
setLocale(lang);
|
|
234
|
+
handleRowClick(row) {
|
|
235
|
+
if (this.onRowClick) {
|
|
236
|
+
this.onRowClick(row);
|
|
114
237
|
}
|
|
238
|
+
if (!this.enableRowSelectionOnClick)
|
|
239
|
+
return;
|
|
240
|
+
this.selectedRowId = row.id;
|
|
115
241
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (changedProperties.has('rowsCount') || changedProperties.has('table')) {
|
|
120
|
-
if (this.enableRowVirtualization) {
|
|
121
|
-
this.initRowVirtualizer(this.rowsCount);
|
|
122
|
-
this.requestUpdate();
|
|
123
|
-
}
|
|
124
|
-
if (this.enableColumnVirtualization) {
|
|
125
|
-
this.initColumnVirtualizer(this.table);
|
|
126
|
-
this.requestUpdate();
|
|
127
|
-
}
|
|
242
|
+
handleRowDoubleClick(row) {
|
|
243
|
+
if (this.onRowDoubleClick) {
|
|
244
|
+
this.onRowDoubleClick(row);
|
|
128
245
|
}
|
|
129
246
|
}
|
|
130
247
|
getTanstackColumns(columns) {
|
|
@@ -139,19 +256,25 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
139
256
|
const value = props.getValue();
|
|
140
257
|
const isGrouped = props.row.getIsGrouped?.();
|
|
141
258
|
const isAggregated = props.row.getIsAggregated?.();
|
|
142
|
-
if (isGrouped
|
|
259
|
+
if (isGrouped) {
|
|
260
|
+
if (column.type === 'date') {
|
|
261
|
+
return formatDate(value, this.userLang || 'cs', undefined, this.dateFormat);
|
|
262
|
+
}
|
|
263
|
+
if (column.type === 'dateTime') {
|
|
264
|
+
return formatDate(value, this.userLang || 'cs', true, this.dateFormat);
|
|
265
|
+
}
|
|
143
266
|
return value;
|
|
144
267
|
}
|
|
145
|
-
if (isGrouped && column.type === 'date') {
|
|
146
|
-
return formatDate(value, this.userLang || 'cs', this.dateFormat);
|
|
147
|
-
}
|
|
148
268
|
if (isAggregated) {
|
|
149
269
|
return value;
|
|
150
270
|
}
|
|
151
271
|
if (column.type === 'date' && value) {
|
|
152
|
-
return formatDate(value, this.userLang || 'cs', this.dateFormat);
|
|
272
|
+
return formatDate(value, this.userLang || 'cs', undefined, this.dateFormat);
|
|
273
|
+
}
|
|
274
|
+
if (column.type === 'dateTime' && value) {
|
|
275
|
+
return formatDate(value, this.userLang || 'cs', true, this.dateFormat);
|
|
153
276
|
}
|
|
154
|
-
return column.cell ? column.cell(props) : value;
|
|
277
|
+
return column.cell ? column.cell(props, html) : value;
|
|
155
278
|
},
|
|
156
279
|
filterFn: (() => {
|
|
157
280
|
switch (column.type) {
|
|
@@ -159,12 +282,14 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
159
282
|
return filterFns.inNumberRange;
|
|
160
283
|
case 'select':
|
|
161
284
|
return filterFns.weakEquals;
|
|
285
|
+
case 'multiselect':
|
|
286
|
+
return multiselectFilterFn;
|
|
162
287
|
case 'number':
|
|
163
288
|
return filterFns.weakEquals;
|
|
164
289
|
case 'date':
|
|
290
|
+
case 'dateTime':
|
|
165
291
|
return dateFilterFn;
|
|
166
292
|
case 'string':
|
|
167
|
-
return filterFns.includesString;
|
|
168
293
|
default:
|
|
169
294
|
return filterFns.includesString;
|
|
170
295
|
}
|
|
@@ -200,6 +325,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
200
325
|
header.column.pin('left'); // Pripnutie doľava
|
|
201
326
|
}
|
|
202
327
|
}
|
|
328
|
+
// export to excel and csv
|
|
203
329
|
exportDataToCsv() {
|
|
204
330
|
const rows = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows); // Získanie všetkých riadkov vrátane skupín
|
|
205
331
|
if (!rows || rows.length === 0) {
|
|
@@ -242,7 +368,9 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
242
368
|
link.click();
|
|
243
369
|
URL.revokeObjectURL(url);
|
|
244
370
|
}
|
|
245
|
-
exportDataToExcel() {
|
|
371
|
+
async exportDataToExcel() {
|
|
372
|
+
await this.loadXLSX(); // Ensure XLSX is loaded
|
|
373
|
+
const XLSX = window.XLSX;
|
|
246
374
|
const rows = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows); // Získanie všetkých riadkov vrátane skupín
|
|
247
375
|
if (!rows || rows.length === 0) {
|
|
248
376
|
console.warn('No data to export');
|
|
@@ -303,13 +431,6 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
303
431
|
});
|
|
304
432
|
return allRows.filter((row, index, self) => index === self.findIndex((r) => r.id === row.id));
|
|
305
433
|
}
|
|
306
|
-
firstUpdated() {
|
|
307
|
-
const grid = this.tableContainerRef.value;
|
|
308
|
-
if (grid) {
|
|
309
|
-
grid.addEventListener('scroll', this.updateScrollState);
|
|
310
|
-
}
|
|
311
|
-
this.updateScrollState();
|
|
312
|
-
}
|
|
313
434
|
startScroll(direction) {
|
|
314
435
|
const grid = this.tableContainerRef.value;
|
|
315
436
|
if (!grid)
|
|
@@ -328,18 +449,33 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
328
449
|
this.scrollInterval = null;
|
|
329
450
|
}
|
|
330
451
|
}
|
|
452
|
+
handleScroll(event) {
|
|
453
|
+
const container = event.target;
|
|
454
|
+
if (container.scrollTop + container.clientHeight >=
|
|
455
|
+
container.scrollHeight - (this.scrollEndThreshold || 100) &&
|
|
456
|
+
this.onRowsScrollEnd &&
|
|
457
|
+
!this.isLoading &&
|
|
458
|
+
!this.scrollToEnd) {
|
|
459
|
+
this.scrollToEnd = true;
|
|
460
|
+
this.onRowsScrollEnd();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
331
463
|
render() {
|
|
464
|
+
if (getLocale() !== this.userLang) {
|
|
465
|
+
setLocale(this.userLang || 'cs');
|
|
466
|
+
}
|
|
332
467
|
this.table = this.tableController.table({
|
|
333
|
-
data: this.
|
|
334
|
-
columns: this.getTanstackColumns(this.
|
|
468
|
+
data: this.rows || [],
|
|
469
|
+
columns: this.getTanstackColumns(this.getColumns),
|
|
335
470
|
columnResizeMode: 'onChange',
|
|
336
471
|
columnResizeDirection: 'ltr',
|
|
337
472
|
defaultColumn: {
|
|
338
|
-
size: this.columnDefaultSize ||
|
|
473
|
+
size: this.columnDefaultSize || undefined, //starting column size
|
|
339
474
|
minSize: this.columnDefaultMinSize || 100, //enforced during column resizing
|
|
340
475
|
maxSize: this.columnDefaultMaxSize || 500, //enforced during column resizing
|
|
341
476
|
},
|
|
342
477
|
initialState: {
|
|
478
|
+
// columnFilters: [...(this.initialFiltering || [])],
|
|
343
479
|
sorting: [...(this.initialSorting || [])],
|
|
344
480
|
grouping: [...(this.initialGroups || [])],
|
|
345
481
|
columnVisibility: { ...this.initialColumnVisibility },
|
|
@@ -348,11 +484,19 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
348
484
|
right: [...(this.rightPinnedColumns || [])],
|
|
349
485
|
},
|
|
350
486
|
},
|
|
487
|
+
state: {
|
|
488
|
+
columnFilters: this.filters,
|
|
489
|
+
sorting: this.sorting,
|
|
490
|
+
},
|
|
351
491
|
filterFns: {
|
|
352
492
|
dateFilterFn: dateFilterFn,
|
|
493
|
+
multiselectFilterFn: multiselectFilterFn,
|
|
353
494
|
},
|
|
495
|
+
// debugTable: true,
|
|
354
496
|
enableColumnPinning: this.enableColumnPinning,
|
|
355
497
|
enableGrouping: this.enableGrouping,
|
|
498
|
+
manualFiltering: this.server,
|
|
499
|
+
getRowId: (row, index) => index.toString(),
|
|
356
500
|
// groupedColumnMode: 'reorder',
|
|
357
501
|
getCoreRowModel: getCoreRowModel(),
|
|
358
502
|
getSortedRowModel: getSortedRowModel(),
|
|
@@ -361,6 +505,24 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
361
505
|
getGroupedRowModel: getGroupedRowModel(),
|
|
362
506
|
getExpandedRowModel: getExpandedRowModel(),
|
|
363
507
|
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
508
|
+
onColumnFiltersChange: (updaterOrValue) => {
|
|
509
|
+
const filtersState = typeof updaterOrValue === 'function'
|
|
510
|
+
? updaterOrValue(this.table.getState().columnFilters)
|
|
511
|
+
: updaterOrValue;
|
|
512
|
+
this.filters = filtersState;
|
|
513
|
+
if (this.onColumnFiltersChanged) {
|
|
514
|
+
this.onColumnFiltersChanged(filtersState);
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
onSortingChange: (updaterOrValue) => {
|
|
518
|
+
const sortingState = typeof updaterOrValue === 'function'
|
|
519
|
+
? updaterOrValue(this.table.getState().sorting)
|
|
520
|
+
: updaterOrValue;
|
|
521
|
+
this.sorting = sortingState;
|
|
522
|
+
if (this.onColumnSortChanged) {
|
|
523
|
+
this.onColumnSortChanged(sortingState);
|
|
524
|
+
}
|
|
525
|
+
},
|
|
364
526
|
});
|
|
365
527
|
this.rowsCount = this.table.getRowModel().rows.length;
|
|
366
528
|
// Ak virtualizácia nie je povolená, použijeme celý zoznam riadkov alebo stĺpcov
|
|
@@ -379,9 +541,9 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
379
541
|
: rows.map((_, index) => ({
|
|
380
542
|
key: index,
|
|
381
543
|
index,
|
|
382
|
-
start: index *
|
|
383
|
-
end: (index + 1) *
|
|
384
|
-
size:
|
|
544
|
+
start: index * this.rowHeight,
|
|
545
|
+
end: (index + 1) * this.rowHeight,
|
|
546
|
+
size: this.rowHeight,
|
|
385
547
|
lane: 0,
|
|
386
548
|
}));
|
|
387
549
|
// console.log('rowItems', rowItems);
|
|
@@ -395,37 +557,37 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
395
557
|
(virtualColumns[virtualColumns.length - 1]?.end ?? 0);
|
|
396
558
|
}
|
|
397
559
|
let isMobile = window.matchMedia('(max-width: 600px)').matches;
|
|
398
|
-
return html `
|
|
399
|
-
<div class="data-grid__wrapper">
|
|
560
|
+
return html `
|
|
561
|
+
<div class="data-grid__wrapper">
|
|
400
562
|
${this.isScrollable && !isMobile
|
|
401
|
-
? html `
|
|
402
|
-
<lit-icon-button
|
|
403
|
-
class="scroll-button left"
|
|
404
|
-
.disabled="${this.disableScrollLeft}"
|
|
405
|
-
@pointerdown="${() => this.startScroll('left')}"
|
|
406
|
-
@pointerup="${this.stopScroll}"
|
|
407
|
-
@pointerleave="${this.stopScroll}"
|
|
408
|
-
size="small"
|
|
409
|
-
variant="contained"
|
|
410
|
-
icon="arrowLeft"
|
|
411
|
-
>
|
|
412
|
-
</lit-icon-button>
|
|
413
|
-
<lit-icon-button
|
|
414
|
-
class="scroll-button right"
|
|
415
|
-
.disabled="${this.disableScrollRight}"
|
|
416
|
-
@pointerdown="${() => this.startScroll('right')}"
|
|
417
|
-
@pointerup="${this.stopScroll}"
|
|
418
|
-
@pointerleave="${this.stopScroll}"
|
|
419
|
-
size="small"
|
|
420
|
-
variant="contained"
|
|
421
|
-
icon="arrowRight"
|
|
422
|
-
>
|
|
423
|
-
</lit-icon-button>
|
|
563
|
+
? html `
|
|
564
|
+
<lit-icon-button
|
|
565
|
+
class="scroll-button left"
|
|
566
|
+
.disabled="${this.disableScrollLeft}"
|
|
567
|
+
@pointerdown="${() => this.startScroll('left')}"
|
|
568
|
+
@pointerup="${this.stopScroll}"
|
|
569
|
+
@pointerleave="${this.stopScroll}"
|
|
570
|
+
size="small"
|
|
571
|
+
variant="contained"
|
|
572
|
+
icon="arrowLeft"
|
|
573
|
+
>
|
|
574
|
+
</lit-icon-button>
|
|
575
|
+
<lit-icon-button
|
|
576
|
+
class="scroll-button right"
|
|
577
|
+
.disabled="${this.disableScrollRight}"
|
|
578
|
+
@pointerdown="${() => this.startScroll('right')}"
|
|
579
|
+
@pointerup="${this.stopScroll}"
|
|
580
|
+
@pointerleave="${this.stopScroll}"
|
|
581
|
+
size="small"
|
|
582
|
+
variant="contained"
|
|
583
|
+
icon="arrowRight"
|
|
584
|
+
>
|
|
585
|
+
</lit-icon-button>
|
|
424
586
|
`
|
|
425
|
-
: null}
|
|
426
|
-
<div class="grid" ${ref(this.tableContainerRef)}>
|
|
427
|
-
<table style="width: ${this.table.getCenterTotalSize()}px">
|
|
428
|
-
<thead style="height: ${this.enableFiltering ? '4rem' : '1.625rem'};">
|
|
587
|
+
: null}
|
|
588
|
+
<div class="grid" ${ref(this.tableContainerRef)} @scroll="${this.handleScroll}">
|
|
589
|
+
<table style="width: ${this.table.getCenterTotalSize()}px">
|
|
590
|
+
<thead style="height: ${this.enableFiltering ? '4rem' : '1.625rem'};">
|
|
429
591
|
${repeat(this.table.getHeaderGroups(), (headerGroup) => headerGroup.id, (headerGroup) => {
|
|
430
592
|
const headerColumns = this.enableColumnVirtualization
|
|
431
593
|
? virtualColumns.map((vc) => headerGroup.headers[vc.index])
|
|
@@ -436,37 +598,38 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
436
598
|
...headerColumns.filter((hc) => !hc.column.getIsPinned()),
|
|
437
599
|
]
|
|
438
600
|
: headerColumns;
|
|
439
|
-
return html `
|
|
440
|
-
<tr class="head" data-index="${headerGroup.id}">
|
|
601
|
+
return html `
|
|
602
|
+
<tr class="head" data-index="${headerGroup.id}">
|
|
441
603
|
${virtualPaddingLeft
|
|
442
|
-
? html `
|
|
443
|
-
<th
|
|
444
|
-
style=" display: flex; width: ${virtualPaddingLeft}px;"
|
|
445
|
-
></th>
|
|
604
|
+
? html `
|
|
605
|
+
<th
|
|
606
|
+
style=" display: flex; width: ${virtualPaddingLeft}px;"
|
|
607
|
+
></th>
|
|
446
608
|
`
|
|
447
|
-
: ''}
|
|
609
|
+
: ''}
|
|
448
610
|
${repeat(newHeaderColumns, (header) => header.id, (header, index) => {
|
|
449
611
|
const column = header.column;
|
|
450
612
|
const style = {
|
|
451
613
|
...this.getCommonPinningStyles(header.column),
|
|
452
614
|
width: `${column.getSize()}px`,
|
|
615
|
+
flexGrow: `${column.columnDef.size === undefined ? 1 : 'unset'}`,
|
|
453
616
|
};
|
|
454
|
-
return html `
|
|
455
|
-
<th
|
|
456
|
-
class="head"
|
|
457
|
-
style="${styleMap(style)}"
|
|
458
|
-
colspan="${header.colSpan}"
|
|
459
|
-
data-index="${header.id}"
|
|
460
|
-
>
|
|
617
|
+
return html `
|
|
618
|
+
<th
|
|
619
|
+
class="head"
|
|
620
|
+
style="${styleMap(style)}"
|
|
621
|
+
colspan="${header.colSpan}"
|
|
622
|
+
data-index="${header.id}"
|
|
623
|
+
>
|
|
461
624
|
${header.isPlaceholder
|
|
462
625
|
? ''
|
|
463
|
-
: html `
|
|
464
|
-
<div
|
|
626
|
+
: html `
|
|
627
|
+
<div
|
|
465
628
|
class="resizer ${this
|
|
466
629
|
.table.options
|
|
467
630
|
.columnResizeDirection} ${header.column.getIsResizing()
|
|
468
631
|
? 'is-resizing'
|
|
469
|
-
: ''}"
|
|
632
|
+
: ''}"
|
|
470
633
|
style="transform: ${this
|
|
471
634
|
.table.options
|
|
472
635
|
.columnResizeMode ===
|
|
@@ -482,156 +645,166 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
482
645
|
.columnSizingInfo
|
|
483
646
|
.deltaOffset ??
|
|
484
647
|
0)}px)`
|
|
485
|
-
: ''}"
|
|
486
|
-
>
|
|
487
|
-
<div
|
|
488
|
-
style="display: flex; align-items: center;
|
|
489
|
-
>
|
|
490
|
-
<div
|
|
491
|
-
class="column-header"
|
|
492
|
-
@click=${header.column.getToggleSortingHandler()}
|
|
493
|
-
>
|
|
494
|
-
|
|
648
|
+
: ''}"
|
|
649
|
+
>
|
|
650
|
+
<div
|
|
651
|
+
style="display: flex; align-items: center; height: 100%;"
|
|
652
|
+
>
|
|
653
|
+
<div
|
|
654
|
+
class="column-header"
|
|
655
|
+
@click=${header.column.getToggleSortingHandler()}
|
|
656
|
+
>
|
|
657
|
+
<lit-overflow-tooltip
|
|
658
|
+
label="${header
|
|
659
|
+
.column
|
|
495
660
|
.columnDef
|
|
496
|
-
.header}
|
|
661
|
+
.header}"
|
|
662
|
+
>
|
|
663
|
+
${header
|
|
664
|
+
.column
|
|
665
|
+
.columnDef
|
|
666
|
+
.header}
|
|
667
|
+
</lit-overflow-tooltip>
|
|
668
|
+
</div>
|
|
669
|
+
|
|
670
|
+
<div
|
|
671
|
+
class="icons-group-pin"
|
|
672
|
+
>
|
|
497
673
|
${header.column.getIsSorted()
|
|
498
674
|
? header.column.getIsSorted() ===
|
|
499
675
|
'asc'
|
|
500
|
-
? html `<slot
|
|
501
|
-
name="iconSortUp"
|
|
502
|
-
><lit-icon
|
|
503
|
-
size="0.75rem"
|
|
504
|
-
icon="chevronUpFilled"
|
|
505
|
-
></lit-icon
|
|
676
|
+
? html `<slot
|
|
677
|
+
name="iconSortUp"
|
|
678
|
+
><lit-icon
|
|
679
|
+
size="0.75rem"
|
|
680
|
+
icon="chevronUpFilled"
|
|
681
|
+
></lit-icon
|
|
506
682
|
></slot>`
|
|
507
|
-
: html `<
|
|
508
|
-
name="iconSortDown"
|
|
509
|
-
>
|
|
510
|
-
<lit-icon
|
|
511
|
-
size="0.75rem"
|
|
512
|
-
icon="chevronDownFilled"
|
|
513
|
-
></lit-icon>
|
|
514
|
-
</
|
|
515
|
-
:
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
<span
|
|
519
|
-
style="display: flex; height: 100%"
|
|
520
|
-
>
|
|
521
|
-
${!this
|
|
683
|
+
: html `<slothea
|
|
684
|
+
name="iconSortDown"
|
|
685
|
+
>
|
|
686
|
+
<lit-icon
|
|
687
|
+
size="0.75rem"
|
|
688
|
+
icon="chevronDownFilled"
|
|
689
|
+
></lit-icon>
|
|
690
|
+
</slothea>`
|
|
691
|
+
: html `<div></div>`}
|
|
692
|
+
<div class="flex">
|
|
693
|
+
${!this
|
|
522
694
|
.actionButtonsInMenu
|
|
523
|
-
? html `
|
|
524
|
-
|
|
525
|
-
? html `
|
|
526
|
-
|
|
527
|
-
|
|
695
|
+
? html `
|
|
696
|
+
${header.column.getCanPin()
|
|
697
|
+
? html `
|
|
698
|
+
<lit-tooltip
|
|
699
|
+
label="${header.column.getIsPinned()
|
|
528
700
|
? msg('Zrušit připnutí sloupce')
|
|
529
|
-
: msg('Připnout sloupec vlevo')}"
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
: ''}
|
|
543
|
-
|
|
544
|
-
? html `
|
|
545
|
-
|
|
546
|
-
|
|
701
|
+
: msg('Připnout sloupec vlevo')}"
|
|
702
|
+
variant="bottom"
|
|
703
|
+
>
|
|
704
|
+
<lit-icon-button
|
|
705
|
+
@click="${() => this.togglePin(header)}"
|
|
706
|
+
size="small"
|
|
707
|
+
variant="text"
|
|
708
|
+
icon="pin"
|
|
709
|
+
.active="${header.column.getIsPinned()}"
|
|
710
|
+
>
|
|
711
|
+
</lit-icon-button>
|
|
712
|
+
</lit-tooltip>
|
|
713
|
+
`
|
|
714
|
+
: ''}
|
|
715
|
+
${header.column.getCanGroup()
|
|
716
|
+
? html `
|
|
717
|
+
<lit-tooltip
|
|
718
|
+
label="${header.column.getIsGrouped()
|
|
547
719
|
? msg('Zrušit seskupení')
|
|
548
|
-
: msg('Seskupit sloupec')}"
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
: ''}
|
|
562
|
-
|
|
563
|
-
: html `
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
.table}"
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
720
|
+
: msg('Seskupit sloupec')}"
|
|
721
|
+
variant="bottom"
|
|
722
|
+
>
|
|
723
|
+
<lit-icon-button
|
|
724
|
+
@click="${header.column.getToggleGroupingHandler()}"
|
|
725
|
+
size="small"
|
|
726
|
+
variant="text"
|
|
727
|
+
.active="${header.column.getIsGrouped()}"
|
|
728
|
+
icon="agregation"
|
|
729
|
+
>
|
|
730
|
+
</lit-icon-button>
|
|
731
|
+
</lit-tooltip>
|
|
732
|
+
`
|
|
733
|
+
: ''}
|
|
734
|
+
`
|
|
735
|
+
: html `
|
|
736
|
+
<lit-data-grid-action-buttons-popover
|
|
737
|
+
.group="${header.column.getToggleGroupingHandler()}"
|
|
738
|
+
.pin="${() => this.togglePin(header)}"
|
|
739
|
+
.header="${header}"
|
|
740
|
+
.table="${this
|
|
741
|
+
.table}"
|
|
742
|
+
></lit-data-grid-action-buttons-popover>
|
|
743
|
+
`}
|
|
744
|
+
</div>
|
|
745
|
+
</div>
|
|
746
|
+
</div>
|
|
747
|
+
</div>
|
|
575
748
|
${header.column.getCanFilter()
|
|
576
|
-
? html `
|
|
577
|
-
<div>
|
|
578
|
-
<filter-inputs
|
|
579
|
-
.column=${header.column}
|
|
749
|
+
? html `
|
|
750
|
+
<div>
|
|
751
|
+
<filter-inputs
|
|
752
|
+
.column=${header.column}
|
|
580
753
|
.dateFormat=${this
|
|
581
|
-
.dateFormat}
|
|
754
|
+
.dateFormat}
|
|
582
755
|
.userLang=${this
|
|
583
|
-
.userLang}
|
|
584
|
-
></filter-inputs>
|
|
585
|
-
</div>
|
|
756
|
+
.userLang}
|
|
757
|
+
></filter-inputs>
|
|
758
|
+
</div>
|
|
586
759
|
`
|
|
587
|
-
: null}
|
|
588
|
-
`}
|
|
589
|
-
<div
|
|
590
|
-
class="resize-handle"
|
|
760
|
+
: null}
|
|
761
|
+
`}
|
|
762
|
+
<div
|
|
763
|
+
class="resize-handle"
|
|
591
764
|
@dblclick="${(event) => {
|
|
592
765
|
if (event.target.classList.contains('resize-handle')) {
|
|
593
766
|
header.column.resetSize();
|
|
594
767
|
}
|
|
595
|
-
}}"
|
|
768
|
+
}}"
|
|
596
769
|
@mousedown="${(event) => {
|
|
597
770
|
if (event.target.classList.contains('resize-handle')) {
|
|
598
771
|
header.getResizeHandler()(event);
|
|
599
772
|
}
|
|
600
|
-
}}"
|
|
773
|
+
}}"
|
|
601
774
|
@touchstart="${(event) => {
|
|
602
775
|
if (event.target.classList.contains('resize-handle')) {
|
|
603
776
|
header.getResizeHandler()(event);
|
|
604
777
|
}
|
|
605
|
-
}}"
|
|
606
|
-
></div>
|
|
607
|
-
</th>
|
|
778
|
+
}}"
|
|
779
|
+
></div>
|
|
780
|
+
</th>
|
|
608
781
|
`;
|
|
609
|
-
})}
|
|
782
|
+
})}
|
|
610
783
|
${virtualPaddingRight
|
|
611
|
-
? html `
|
|
612
|
-
<th
|
|
613
|
-
style=" display: flex; width: ${virtualPaddingRight}px;"
|
|
614
|
-
></th>
|
|
784
|
+
? html `
|
|
785
|
+
<th
|
|
786
|
+
style=" display: flex; width: ${virtualPaddingRight}px;"
|
|
787
|
+
></th>
|
|
615
788
|
`
|
|
616
|
-
: ''}
|
|
617
|
-
</tr>
|
|
789
|
+
: ''}
|
|
790
|
+
</tr>
|
|
618
791
|
`;
|
|
619
|
-
})}
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
<tbody
|
|
792
|
+
})}
|
|
793
|
+
${this.isLoading
|
|
794
|
+
? html `
|
|
795
|
+
<div style="position: absolute; bottom: 0px; width: 100%;">
|
|
796
|
+
<lit-loading-bar></lit-loading-bar>
|
|
797
|
+
</div>
|
|
798
|
+
`
|
|
799
|
+
: ''}
|
|
800
|
+
</thead>
|
|
801
|
+
|
|
802
|
+
<tbody
|
|
630
803
|
style="height: ${rowVirtualizer &&
|
|
631
804
|
this.table.getRowModel().rows.length > 0
|
|
632
805
|
? rowVirtualizer.getTotalSize() + 'px'
|
|
633
|
-
: 'auto'};"
|
|
634
|
-
>
|
|
806
|
+
: 'auto'};"
|
|
807
|
+
>
|
|
635
808
|
${rows.length > 0
|
|
636
809
|
? repeat(rowItems, (item) => item.key, (item) => {
|
|
637
810
|
const row = rows[item.index];
|
|
@@ -644,20 +817,24 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
644
817
|
const newBodyColumns = this.enableColumnVirtualization
|
|
645
818
|
? [...new Set([...pinnedColumns, ...bodyColumns])]
|
|
646
819
|
: bodyColumns;
|
|
647
|
-
const
|
|
820
|
+
const rowStyle = {
|
|
648
821
|
transform: rowVirtualizer
|
|
649
822
|
? `translateY(${item.start}px)`
|
|
650
823
|
: 'none',
|
|
651
|
-
height:
|
|
652
|
-
lineHeight:
|
|
824
|
+
height: `${this.rowHeight}px`,
|
|
825
|
+
lineHeight: `${this.rowHeight}px`,
|
|
653
826
|
position: rowVirtualizer ? 'absolute' : 'relative',
|
|
654
827
|
};
|
|
655
828
|
return row
|
|
656
|
-
? html `
|
|
657
|
-
<tr
|
|
658
|
-
class="
|
|
659
|
-
|
|
660
|
-
|
|
829
|
+
? html `
|
|
830
|
+
<tr
|
|
831
|
+
class="${this.selectedRowId === row.id
|
|
832
|
+
? 'selected body'
|
|
833
|
+
: 'body'}"
|
|
834
|
+
data-index="${item.index}"
|
|
835
|
+
@click="${() => this.handleRowClick(row)}"
|
|
836
|
+
@dblclick="${() => this.handleRowDoubleClick(row)}"
|
|
837
|
+
style="${styleMap(rowStyle)}"
|
|
661
838
|
${ref((node) => {
|
|
662
839
|
if (node &&
|
|
663
840
|
this.enableRowVirtualization &&
|
|
@@ -665,65 +842,68 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
665
842
|
// Only measure element if virtualization is enabled
|
|
666
843
|
rowVirtualizer.measureElement(node);
|
|
667
844
|
}
|
|
668
|
-
})}
|
|
669
|
-
>
|
|
845
|
+
})}
|
|
846
|
+
>
|
|
670
847
|
${virtualPaddingLeft
|
|
671
|
-
? html `
|
|
672
|
-
<th
|
|
673
|
-
style=" display: flex; width: ${virtualPaddingLeft}px;"
|
|
674
|
-
></th>
|
|
848
|
+
? html `
|
|
849
|
+
<th
|
|
850
|
+
style=" display: flex; width: ${virtualPaddingLeft}px;"
|
|
851
|
+
></th>
|
|
675
852
|
`
|
|
676
|
-
: ''}
|
|
677
|
-
<!-- Cells for each row -->
|
|
853
|
+
: ''}
|
|
854
|
+
<!-- Cells for each row -->
|
|
678
855
|
${repeat(newBodyColumns, (cell) => cell.key, (cell) => {
|
|
856
|
+
const buttonSize = this.getButtonSize();
|
|
679
857
|
const { column } = cell;
|
|
680
858
|
const style = {
|
|
681
859
|
...this.getCommonPinningStyles(cell.column),
|
|
682
860
|
width: `${cell.column.getSize()}px`,
|
|
861
|
+
flexGrow: `${column.columnDef.size === undefined ? 1 : 'unset'}`,
|
|
683
862
|
background: this.getCellBackgroundColor(cell),
|
|
684
|
-
lineHeight:
|
|
863
|
+
lineHeight: `${this.rowHeight}px`,
|
|
685
864
|
};
|
|
686
|
-
return html `
|
|
687
|
-
<td style="${styleMap(style)}">
|
|
865
|
+
return html `
|
|
866
|
+
<td style="${styleMap(style)}">
|
|
688
867
|
${cell.getIsGrouped()
|
|
689
|
-
? html `
|
|
690
|
-
<lit-button
|
|
691
|
-
@click="${row.getToggleExpandedHandler()}"
|
|
692
|
-
variant="inherit"
|
|
868
|
+
? html `
|
|
869
|
+
<lit-button
|
|
870
|
+
@click="${row.getToggleExpandedHandler()}"
|
|
871
|
+
variant="inherit"
|
|
872
|
+
size="${buttonSize}"
|
|
693
873
|
count="${row
|
|
694
874
|
.subRows
|
|
695
|
-
.length}"
|
|
875
|
+
.length}"
|
|
696
876
|
label="${flexRender(cell
|
|
697
877
|
.column
|
|
698
878
|
.columnDef
|
|
699
|
-
.cell, cell.getContext())}"
|
|
879
|
+
.cell, cell.getContext())}"
|
|
700
880
|
icon="${row.getIsExpanded()
|
|
701
881
|
? 'chevronDownFilled'
|
|
702
|
-
: 'chevron'}"
|
|
703
|
-
>
|
|
882
|
+
: 'chevron'}"
|
|
883
|
+
>
|
|
704
884
|
<!-- ${row.getIsExpanded()
|
|
705
|
-
? html `<slot
|
|
706
|
-
name="groupedIcon-expanded"
|
|
707
|
-
slot="start-icon"
|
|
885
|
+
? html `<slot
|
|
886
|
+
name="groupedIcon-expanded"
|
|
887
|
+
slot="start-icon"
|
|
708
888
|
></slot>`
|
|
709
|
-
: html `<slot
|
|
710
|
-
name="groupedIcon"
|
|
711
|
-
slot="start-icon"
|
|
712
|
-
></slot>`} -->
|
|
713
|
-
}
|
|
889
|
+
: html `<slot
|
|
890
|
+
name="groupedIcon"
|
|
891
|
+
slot="start-icon"
|
|
892
|
+
></slot>`} -->
|
|
893
|
+
}
|
|
714
894
|
${row.subRows
|
|
715
|
-
.length}
|
|
895
|
+
.length}
|
|
716
896
|
${flexRender(cell
|
|
717
897
|
.column
|
|
718
898
|
.columnDef
|
|
719
|
-
.cell, cell.getContext())}
|
|
720
|
-
</lit-button>
|
|
899
|
+
.cell, cell.getContext())}
|
|
900
|
+
</lit-button>
|
|
721
901
|
`
|
|
722
902
|
: cell.getIsAggregated()
|
|
723
|
-
? html `
|
|
724
|
-
<div
|
|
725
|
-
style="display: flex; flex-direction: row; align-items: center;"
|
|
726
|
-
>
|
|
903
|
+
? html `
|
|
904
|
+
<div
|
|
905
|
+
style="display: flex; flex-direction: row; align-items: center;"
|
|
906
|
+
>
|
|
727
907
|
${flexRender(cell
|
|
728
908
|
.column
|
|
729
909
|
.columnDef
|
|
@@ -731,333 +911,292 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
731
911
|
cell
|
|
732
912
|
.column
|
|
733
913
|
.columnDef
|
|
734
|
-
.cell, cell.getContext())}
|
|
735
|
-
</div>
|
|
914
|
+
.cell, cell.getContext())}
|
|
915
|
+
</div>
|
|
736
916
|
`
|
|
737
917
|
: cell.getIsPlaceholder()
|
|
738
918
|
? null
|
|
739
919
|
: flexRender(cell.column
|
|
740
920
|
.columnDef
|
|
741
|
-
.cell, cell.getContext())}
|
|
742
|
-
</td>
|
|
921
|
+
.cell, cell.getContext())}
|
|
922
|
+
</td>
|
|
743
923
|
`;
|
|
744
|
-
})}
|
|
924
|
+
})}
|
|
745
925
|
${virtualPaddingRight
|
|
746
|
-
? html `
|
|
747
|
-
<th
|
|
748
|
-
style=" display: flex; width: ${virtualPaddingRight}px;"
|
|
749
|
-
></th>
|
|
926
|
+
? html `
|
|
927
|
+
<th
|
|
928
|
+
style=" display: flex; width: ${virtualPaddingRight}px;"
|
|
929
|
+
></th>
|
|
750
930
|
`
|
|
751
|
-
: ''}
|
|
752
|
-
</tr>
|
|
931
|
+
: ''}
|
|
932
|
+
</tr>
|
|
753
933
|
`
|
|
754
934
|
: null;
|
|
755
935
|
})
|
|
756
|
-
: null}
|
|
757
|
-
</tbody>
|
|
758
|
-
</table>
|
|
759
|
-
<div class="footer-container">
|
|
760
|
-
<span class="numberCount">
|
|
761
|
-
${msg('Počet záznamů')}: ${this.table.getRowModel().rows.length}
|
|
762
|
-
</span>
|
|
763
|
-
<div class="right-actions">
|
|
764
|
-
<lit-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
936
|
+
: null}
|
|
937
|
+
</tbody>
|
|
938
|
+
</table>
|
|
939
|
+
<div class="footer-container">
|
|
940
|
+
<span class="numberCount">
|
|
941
|
+
${msg('Počet záznamů')}: ${this.table.getRowModel().rows.length}
|
|
942
|
+
</span>
|
|
943
|
+
<div class="right-actions">
|
|
944
|
+
<lit-data-grid-density-popover
|
|
945
|
+
.density="${this.rowDensity}"
|
|
946
|
+
.setDensity="${(density) => this.handleSetDensity(density)}"
|
|
947
|
+
>
|
|
948
|
+
</lit-data-grid-density-popover>
|
|
949
|
+
<lit-responsive-button
|
|
950
|
+
size="small"
|
|
951
|
+
variant="text"
|
|
952
|
+
label=${msg('Přizpůsobit sloupce')}
|
|
953
|
+
icon="columns"
|
|
954
|
+
@click=${() => this.table.resetColumnSizing()}
|
|
955
|
+
></lit-responsive-button>
|
|
771
956
|
${this.exportData
|
|
772
|
-
? html `
|
|
773
|
-
<lit-data-grid-export-popover
|
|
774
|
-
.exportToCsv="${() => this.exportDataToCsv()}"
|
|
775
|
-
.exportToExcel="${() => this.exportDataToExcel()}"
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
></slot>
|
|
780
|
-
<slot slot="iconCsv" name="iconCsv"
|
|
781
|
-
><lit-icon icon="csv"></lit-icon
|
|
782
|
-
></slot>
|
|
783
|
-
</lit-data-grid-export-popover>
|
|
957
|
+
? html `
|
|
958
|
+
<lit-data-grid-export-popover
|
|
959
|
+
.exportToCsv="${() => this.exportDataToCsv()}"
|
|
960
|
+
.exportToExcel="${() => this.exportDataToExcel()}"
|
|
961
|
+
.disabledButtons="${this.isLoading}"
|
|
962
|
+
>
|
|
963
|
+
</lit-data-grid-export-popover>
|
|
784
964
|
`
|
|
785
|
-
: null}
|
|
786
|
-
</div>
|
|
787
|
-
</div>
|
|
788
|
-
</div>
|
|
789
|
-
${this.table.getRowModel().rows.length < 1
|
|
790
|
-
? html ` <div class="data-grid__empty">
|
|
791
|
-
<div style="max-height: 7.125rem; max-width: 7.125rem">
|
|
792
|
-
<not-found></not-found>
|
|
793
|
-
</div>
|
|
794
|
-
${msg('Nic dalšího tu není')}
|
|
965
|
+
: null}
|
|
966
|
+
</div>
|
|
967
|
+
</div>
|
|
968
|
+
</div>
|
|
969
|
+
${this.table.getRowModel().rows.length < 1 && !this.isLoading
|
|
970
|
+
? html ` <div class="data-grid__empty">
|
|
971
|
+
<div style="max-height: 7.125rem; max-width: 7.125rem">
|
|
972
|
+
<not-found></not-found>
|
|
973
|
+
</div>
|
|
974
|
+
${msg('Nic dalšího tu není')}
|
|
795
975
|
</div>`
|
|
796
|
-
: null}
|
|
797
|
-
</div>
|
|
976
|
+
: null}
|
|
977
|
+
</div>
|
|
798
978
|
`;
|
|
799
979
|
}
|
|
800
980
|
};
|
|
801
981
|
LitDataGridTanstack.styles = [
|
|
802
982
|
// styles,
|
|
803
|
-
css `
|
|
804
|
-
*,
|
|
805
|
-
*::before,
|
|
806
|
-
*::after {
|
|
807
|
-
margin: 0;
|
|
808
|
-
padding: 0;
|
|
809
|
-
box-sizing: border-box;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
display: block;
|
|
813
|
-
font-family: 'Inter', sans-serif;
|
|
814
|
-
box-sizing: border-box;
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
.
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
.bar1Indeterminate {
|
|
1018
|
-
animation: mui-indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
/* Druhá animovaná "vlna" (oneskorená) */
|
|
1022
|
-
|
|
1023
|
-
.bar2Indeterminate {
|
|
1024
|
-
animation: mui-indeterminate2 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
1025
|
-
animation-delay: 1.05s;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
@keyframes mui-indeterminate1 {
|
|
1029
|
-
0% {
|
|
1030
|
-
left: -35%;
|
|
1031
|
-
right: 100%;
|
|
1032
|
-
}
|
|
1033
|
-
60% {
|
|
1034
|
-
left: 100%;
|
|
1035
|
-
right: -90%;
|
|
1036
|
-
}
|
|
1037
|
-
100% {
|
|
1038
|
-
left: 100%;
|
|
1039
|
-
right: -90%;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
@keyframes mui-indeterminate2 {
|
|
1044
|
-
0% {
|
|
1045
|
-
left: -200%;
|
|
1046
|
-
right: 100%;
|
|
1047
|
-
}
|
|
1048
|
-
60% {
|
|
1049
|
-
left: 107%;
|
|
1050
|
-
right: -8%;
|
|
1051
|
-
}
|
|
1052
|
-
100% {
|
|
1053
|
-
left: 107%;
|
|
1054
|
-
right: -8%;
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
983
|
+
css `
|
|
984
|
+
*,
|
|
985
|
+
*::before,
|
|
986
|
+
*::after {
|
|
987
|
+
margin: 0;
|
|
988
|
+
padding: 0;
|
|
989
|
+
box-sizing: border-box;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
display: block;
|
|
993
|
+
font-family: 'Inter', sans-serif;
|
|
994
|
+
box-sizing: border-box;
|
|
995
|
+
|
|
996
|
+
td {
|
|
997
|
+
padding: 0px;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
.data-grid__wrapper {
|
|
1001
|
+
position: relative;
|
|
1002
|
+
background-color: var(--background-paper, #fff);
|
|
1003
|
+
height: 100%;
|
|
1004
|
+
z-index: 1;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.grid {
|
|
1008
|
+
overflow: auto;
|
|
1009
|
+
position: relative;
|
|
1010
|
+
height: 100%;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
.data-grid__empty {
|
|
1014
|
+
position: absolute;
|
|
1015
|
+
top: 30%;
|
|
1016
|
+
left: 50%;
|
|
1017
|
+
transform: translate(-50%, -50%);
|
|
1018
|
+
font-size: 0.875rem;
|
|
1019
|
+
text-align: center;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
table {
|
|
1023
|
+
border-collapse: collapse;
|
|
1024
|
+
border-spacing: 0;
|
|
1025
|
+
width: 100% !important;
|
|
1026
|
+
height: calc(100% - 38px);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
thead {
|
|
1030
|
+
display: flex;
|
|
1031
|
+
position: sticky;
|
|
1032
|
+
top: 0;
|
|
1033
|
+
z-index: 10;
|
|
1034
|
+
background-color: var(--background-paper, #fff);
|
|
1035
|
+
border-bottom: 1px solid var(--color-divider, #d0d3db);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
tr.head {
|
|
1039
|
+
display: flex;
|
|
1040
|
+
width: 100%;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
th.head {
|
|
1044
|
+
display: block;
|
|
1045
|
+
position: relative;
|
|
1046
|
+
padding: 0px 6px;
|
|
1047
|
+
gap: 0.25rem;
|
|
1048
|
+
//z-index: auto !important;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
tbody {
|
|
1052
|
+
display: grid;
|
|
1053
|
+
position: relative;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
tr.body {
|
|
1057
|
+
width: 100%;
|
|
1058
|
+
border-bottom: 1px solid var(--color-divider, #d0d3db);
|
|
1059
|
+
display: flex;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
tr.body:hover {
|
|
1063
|
+
cursor: pointer;
|
|
1064
|
+
background-color: var(--background-default, #eff3f4);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
td {
|
|
1068
|
+
display: table-cell;
|
|
1069
|
+
white-space: nowrap;
|
|
1070
|
+
overflow: hidden;
|
|
1071
|
+
padding: 0px 14px;
|
|
1072
|
+
font-weight: 500;
|
|
1073
|
+
font-size: 13px;
|
|
1074
|
+
color: var(--text-primary, #111827);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
.column-header {
|
|
1078
|
+
font-size: 11px;
|
|
1079
|
+
font-weight: 600;
|
|
1080
|
+
color: var(--text-secondary, #5d6371);
|
|
1081
|
+
cursor: pointer;
|
|
1082
|
+
gap: 0.25rem;
|
|
1083
|
+
justify-content: center;
|
|
1084
|
+
align-items: center;
|
|
1085
|
+
margin: 0 0.25rem;
|
|
1086
|
+
overflow: hidden;
|
|
1087
|
+
white-space: nowrap;
|
|
1088
|
+
text-overflow: ellipsis;
|
|
1089
|
+
height: inherit;
|
|
1090
|
+
display: flex;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
.ellipsis {
|
|
1094
|
+
overflow: hidden;
|
|
1095
|
+
white-space: nowrap;
|
|
1096
|
+
text-overflow: ellipsis;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
.icons-group-pin {
|
|
1100
|
+
display: flex;
|
|
1101
|
+
height: 100%;
|
|
1102
|
+
justify-content: space-between;
|
|
1103
|
+
flex-grow: 1;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.flex {
|
|
1107
|
+
display: flex;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
.resizer {
|
|
1111
|
+
height: 23px;
|
|
1112
|
+
padding: 0 0 0 6px;
|
|
1113
|
+
text-align: start;
|
|
1114
|
+
//cursor: col-resize;
|
|
1115
|
+
user-select: none;
|
|
1116
|
+
touch-action: none;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
.resize-handle {
|
|
1120
|
+
position: absolute;
|
|
1121
|
+
top: 0;
|
|
1122
|
+
right: 0px;
|
|
1123
|
+
width: 6px;
|
|
1124
|
+
height: 100%;
|
|
1125
|
+
background: transparent;
|
|
1126
|
+
cursor: col-resize;
|
|
1127
|
+
transition: background-color 0.2s ease-in-out;
|
|
1128
|
+
// border-radius: 5px;
|
|
1129
|
+
// padding-bottom: 5px;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.resize-handle:hover {
|
|
1133
|
+
border-right: 2px solid var(--color-primary-main, #75b603);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
.resizer.ltr {
|
|
1137
|
+
right: 0;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
.resizer.rtl {
|
|
1141
|
+
left: 0;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
.resizer.is-resizing {
|
|
1145
|
+
opacity: 1;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
.footer-container {
|
|
1149
|
+
position: sticky;
|
|
1150
|
+
left: 0;
|
|
1151
|
+
bottom: 0;
|
|
1152
|
+
background-color: var(--background-paper, #fff);
|
|
1153
|
+
width: auto;
|
|
1154
|
+
border-top: 1px solid var(--color-divider, #d0d3db);
|
|
1155
|
+
height: 2.375rem;
|
|
1156
|
+
display: flex;
|
|
1157
|
+
flex-direction: row;
|
|
1158
|
+
justify-content: space-between;
|
|
1159
|
+
align-items: center;
|
|
1160
|
+
// padding: 0 16px;
|
|
1161
|
+
z-index: 10;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
.right-actions {
|
|
1165
|
+
position: absolute;
|
|
1166
|
+
right: 0;
|
|
1167
|
+
display: flex;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
.numberCount {
|
|
1171
|
+
margin: 0.375rem 0;
|
|
1172
|
+
font-size: 12px;
|
|
1173
|
+
font-weight: 400;
|
|
1174
|
+
color: var(--text-primary, #111827);
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
.scroll-button {
|
|
1178
|
+
position: absolute;
|
|
1179
|
+
top: 50%;
|
|
1180
|
+
transform: translateY(-50%);
|
|
1181
|
+
z-index: 1000;
|
|
1182
|
+
cursor: pointer;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.scroll-button.left {
|
|
1186
|
+
left: 3rem;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
.scroll-button.right {
|
|
1190
|
+
right: 3rem;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
.selected {
|
|
1194
|
+
background-color: var(--color-primary-light, #f0fadf);
|
|
1195
|
+
}
|
|
1057
1196
|
`,
|
|
1058
1197
|
];
|
|
1059
1198
|
__decorate([
|
|
1060
|
-
property({ type: Array })
|
|
1199
|
+
property({ type: Array, reflect: true })
|
|
1061
1200
|
], LitDataGridTanstack.prototype, "row", void 0);
|
|
1062
1201
|
__decorate([
|
|
1063
1202
|
property({ type: Array })
|
|
@@ -1128,9 +1267,42 @@ __decorate([
|
|
|
1128
1267
|
__decorate([
|
|
1129
1268
|
property({ type: Boolean })
|
|
1130
1269
|
], LitDataGridTanstack.prototype, "isLoading", void 0);
|
|
1270
|
+
__decorate([
|
|
1271
|
+
property({ type: Function })
|
|
1272
|
+
], LitDataGridTanstack.prototype, "onRowClick", void 0);
|
|
1273
|
+
__decorate([
|
|
1274
|
+
property({ type: Function })
|
|
1275
|
+
], LitDataGridTanstack.prototype, "onRowsScrollEnd", void 0);
|
|
1276
|
+
__decorate([
|
|
1277
|
+
property({ type: Function })
|
|
1278
|
+
], LitDataGridTanstack.prototype, "onRowDoubleClick", void 0);
|
|
1279
|
+
__decorate([
|
|
1280
|
+
property({ type: Boolean })
|
|
1281
|
+
], LitDataGridTanstack.prototype, "enableRowSelectionOnClick", void 0);
|
|
1282
|
+
__decorate([
|
|
1283
|
+
property({ type: Array })
|
|
1284
|
+
], LitDataGridTanstack.prototype, "initialFiltering", void 0);
|
|
1285
|
+
__decorate([
|
|
1286
|
+
property({ type: Boolean })
|
|
1287
|
+
], LitDataGridTanstack.prototype, "server", void 0);
|
|
1288
|
+
__decorate([
|
|
1289
|
+
property({ type: Boolean })
|
|
1290
|
+
], LitDataGridTanstack.prototype, "onColumnFiltersChanged", void 0);
|
|
1291
|
+
__decorate([
|
|
1292
|
+
property({ type: Boolean })
|
|
1293
|
+
], LitDataGridTanstack.prototype, "onColumnSortChanged", void 0);
|
|
1294
|
+
__decorate([
|
|
1295
|
+
property({ type: Number })
|
|
1296
|
+
], LitDataGridTanstack.prototype, "scrollEndThreshold", void 0);
|
|
1297
|
+
__decorate([
|
|
1298
|
+
property({ type: String })
|
|
1299
|
+
], LitDataGridTanstack.prototype, "rowDensity", void 0);
|
|
1131
1300
|
__decorate([
|
|
1132
1301
|
state()
|
|
1133
1302
|
], LitDataGridTanstack.prototype, "rowsCount", void 0);
|
|
1303
|
+
__decorate([
|
|
1304
|
+
state()
|
|
1305
|
+
], LitDataGridTanstack.prototype, "selectedRowId", void 0);
|
|
1134
1306
|
__decorate([
|
|
1135
1307
|
state()
|
|
1136
1308
|
], LitDataGridTanstack.prototype, "isScrollable", void 0);
|
|
@@ -1140,6 +1312,18 @@ __decorate([
|
|
|
1140
1312
|
__decorate([
|
|
1141
1313
|
state()
|
|
1142
1314
|
], LitDataGridTanstack.prototype, "disableScrollRight", void 0);
|
|
1315
|
+
__decorate([
|
|
1316
|
+
state()
|
|
1317
|
+
], LitDataGridTanstack.prototype, "filters", void 0);
|
|
1318
|
+
__decorate([
|
|
1319
|
+
state()
|
|
1320
|
+
], LitDataGridTanstack.prototype, "sorting", void 0);
|
|
1321
|
+
__decorate([
|
|
1322
|
+
state()
|
|
1323
|
+
], LitDataGridTanstack.prototype, "table", void 0);
|
|
1324
|
+
__decorate([
|
|
1325
|
+
state()
|
|
1326
|
+
], LitDataGridTanstack.prototype, "rowHeight", void 0);
|
|
1143
1327
|
LitDataGridTanstack = __decorate([
|
|
1144
1328
|
customElement('lit-data-grid-tanstack')
|
|
1145
1329
|
], LitDataGridTanstack);
|