overview-components 0.8.0 → 1.0.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/dist/assets/generated/locales/de.d.ts +11 -2
- package/dist/assets/generated/locales/de.d.ts.map +1 -1
- package/dist/assets/generated/locales/de.js +12 -3
- package/dist/assets/generated/locales/de.js.map +1 -1
- package/dist/assets/generated/locales/en.d.ts +11 -2
- package/dist/assets/generated/locales/en.d.ts.map +1 -1
- package/dist/assets/generated/locales/en.js +12 -3
- package/dist/assets/generated/locales/en.js.map +1 -1
- package/dist/assets/generated/locales/pl.d.ts +11 -2
- package/dist/assets/generated/locales/pl.d.ts.map +1 -1
- package/dist/assets/generated/locales/pl.js +14 -5
- package/dist/assets/generated/locales/pl.js.map +1 -1
- package/dist/assets/generated/locales/sk.d.ts +11 -2
- package/dist/assets/generated/locales/sk.d.ts.map +1 -1
- package/dist/assets/generated/locales/sk.js +13 -4
- 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 +6 -0
- package/dist/assets/ilustration/no-preview.d.ts.map +1 -0
- package/dist/assets/ilustration/no-preview.js +133 -0
- package/dist/assets/ilustration/no-preview.js.map +1 -0
- 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 +84 -0
- package/dist/components/lit-attachments-tab.d.ts.map +1 -0
- package/dist/components/lit-attachments-tab.js +545 -0
- package/dist/components/lit-attachments-tab.js.map +1 -0
- package/dist/components/lit-case-variables-tab.d.ts +3 -6
- package/dist/components/lit-case-variables-tab.d.ts.map +1 -1
- package/dist/components/lit-case-variables-tab.js +39 -69
- 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 +62 -12
- package/dist/components/lit-data-grid-tanstack.d.ts.map +1 -1
- package/dist/components/lit-data-grid-tanstack.js +425 -244
- 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/attachments-tab.d.ts +3 -0
- package/dist/components/react-wrappers/attachments-tab.d.ts.map +1 -0
- package/dist/components/react-wrappers/attachments-tab.js +9 -0
- package/dist/components/react-wrappers/attachments-tab.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 +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/scripts/translate-locales.js +3 -1
- package/dist/scripts/translate-locales.js.map +1 -1
- package/dist/shared/filter-inputs.d.ts +18 -8
- package/dist/shared/filter-inputs.d.ts.map +1 -1
- package/dist/shared/filter-inputs.js +213 -58
- package/dist/shared/filter-inputs.js.map +1 -1
- package/dist/shared/lit-button.js +2 -2
- 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 +6 -3
- package/dist/shared/lit-data-grid-export-popover.d.ts.map +1 -1
- package/dist/shared/lit-data-grid-export-popover.js +44 -49
- 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 +27 -6
- package/dist/shared/lit-select.d.ts.map +1 -1
- package/dist/shared/lit-select.js +237 -133
- 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 +50 -49
- 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 +10 -4
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/localization.d.ts +1 -0
- package/dist/utils/localization.d.ts.map +1 -1
- package/dist/utils/localization.js +213 -10
- package/dist/utils/localization.js.map +1 -1
- package/package.json +3 -2
- 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);
|
|
@@ -45,14 +47,24 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
45
47
|
this.enableFiltering = true;
|
|
46
48
|
this.userLang = 'cs';
|
|
47
49
|
this.dateFormat = null;
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
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';
|
|
50
58
|
this.rowsCount = 0;
|
|
51
|
-
|
|
59
|
+
this.selectedRowId = null;
|
|
52
60
|
this.isScrollable = false;
|
|
53
61
|
this.disableScrollLeft = true;
|
|
54
62
|
this.disableScrollRight = false;
|
|
55
|
-
this.
|
|
63
|
+
this.filters = [];
|
|
64
|
+
this.sorting = [];
|
|
65
|
+
this.rowHeight = 31;
|
|
66
|
+
this.scrollToEnd = false;
|
|
67
|
+
this.tableContainerRef = createRef();
|
|
56
68
|
this.scrollInterval = null;
|
|
57
69
|
this.getCellBackgroundColor = (cell) => {
|
|
58
70
|
if (cell.getIsGrouped()) {
|
|
@@ -79,54 +91,157 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
79
91
|
}
|
|
80
92
|
};
|
|
81
93
|
}
|
|
94
|
+
get rows() {
|
|
95
|
+
return [...(this.row || [])];
|
|
96
|
+
}
|
|
97
|
+
get getColumns() {
|
|
98
|
+
return [...(this.columns || [])];
|
|
99
|
+
}
|
|
100
|
+
// lifecycle
|
|
82
101
|
connectedCallback() {
|
|
83
|
-
this.setLanguage();
|
|
84
|
-
this.table.setGrouping([...(this.initialGroups || [])]);
|
|
85
|
-
if (this.enableRowVirtualization && this.table) {
|
|
86
|
-
this.initializeVirtualizer();
|
|
87
|
-
}
|
|
88
|
-
if (this.enableColumnVirtualization) {
|
|
89
|
-
// Inicializácia columnVirtualizerController (stĺpcová virtualizácia)
|
|
90
|
-
this.columnVirtualizerController = new VirtualizerController(this, {
|
|
91
|
-
horizontal: true,
|
|
92
|
-
count: this.table.getVisibleLeafColumns().length,
|
|
93
|
-
getScrollElement: () => this.tableContainerRef.value,
|
|
94
|
-
estimateSize: (index) => this.table.getVisibleLeafColumns()[index].getSize(),
|
|
95
|
-
overscan: 5,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
102
|
super.connectedCallback();
|
|
103
|
+
this.initRowVirtualizer();
|
|
104
|
+
this.initColumnVirtualizer();
|
|
105
|
+
this.initTable();
|
|
99
106
|
window.addEventListener('resize', this.updateScrollState);
|
|
107
|
+
document.addEventListener('keydown', this.handleKeyDown.bind(this));
|
|
100
108
|
}
|
|
101
109
|
disconnectedCallback() {
|
|
102
110
|
super.disconnectedCallback();
|
|
103
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
|
+
}
|
|
104
138
|
}
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
|
|
139
|
+
firstUpdated() {
|
|
140
|
+
const grid = this.tableContainerRef.value;
|
|
141
|
+
if (grid) {
|
|
142
|
+
grid.addEventListener('scroll', this.updateScrollState);
|
|
109
143
|
}
|
|
144
|
+
this.updateScrollState();
|
|
110
145
|
}
|
|
111
|
-
|
|
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
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// virtualization
|
|
214
|
+
initRowVirtualizer() {
|
|
112
215
|
this.rowVirtualizerController = new VirtualizerController(this, {
|
|
113
|
-
count: this.table
|
|
216
|
+
count: this.table?.getRowModel()?.rows.length || this.row?.length || 1,
|
|
114
217
|
getScrollElement: () => this.tableContainerRef.value,
|
|
115
|
-
estimateSize: () =>
|
|
116
|
-
overscan: 5,
|
|
218
|
+
estimateSize: () => this.rowHeight,
|
|
219
|
+
overscan: 5,
|
|
117
220
|
});
|
|
118
221
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
222
|
+
initTable() {
|
|
223
|
+
this.tableController = new TableController(this);
|
|
224
|
+
}
|
|
225
|
+
initColumnVirtualizer() {
|
|
226
|
+
this.columnVirtualizerController = new VirtualizerController(this, {
|
|
227
|
+
horizontal: true,
|
|
228
|
+
count: this.table?.getVisibleLeafColumns().length || this.columns.length || 1,
|
|
229
|
+
getScrollElement: () => this.tableContainerRef.value,
|
|
230
|
+
estimateSize: (index) => this.table.getVisibleLeafColumns()[index].getSize() || 200,
|
|
231
|
+
overscan: 5,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
handleRowClick(row) {
|
|
235
|
+
if (this.onRowClick) {
|
|
236
|
+
this.onRowClick(row);
|
|
127
237
|
}
|
|
128
|
-
if (
|
|
129
|
-
|
|
238
|
+
if (!this.enableRowSelectionOnClick)
|
|
239
|
+
return;
|
|
240
|
+
this.selectedRowId = row.id;
|
|
241
|
+
}
|
|
242
|
+
handleRowDoubleClick(row) {
|
|
243
|
+
if (this.onRowDoubleClick) {
|
|
244
|
+
this.onRowDoubleClick(row);
|
|
130
245
|
}
|
|
131
246
|
}
|
|
132
247
|
getTanstackColumns(columns) {
|
|
@@ -141,19 +256,25 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
141
256
|
const value = props.getValue();
|
|
142
257
|
const isGrouped = props.row.getIsGrouped?.();
|
|
143
258
|
const isAggregated = props.row.getIsAggregated?.();
|
|
144
|
-
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
|
+
}
|
|
145
266
|
return value;
|
|
146
267
|
}
|
|
147
|
-
if (isGrouped && column.type === 'date') {
|
|
148
|
-
return formatDate(value, this.userLang || 'cs', this.dateFormat);
|
|
149
|
-
}
|
|
150
268
|
if (isAggregated) {
|
|
151
269
|
return value;
|
|
152
270
|
}
|
|
153
271
|
if (column.type === 'date' && value) {
|
|
154
|
-
return formatDate(value, this.userLang || 'cs', this.dateFormat);
|
|
272
|
+
return formatDate(value, this.userLang || 'cs', undefined, this.dateFormat);
|
|
155
273
|
}
|
|
156
|
-
|
|
274
|
+
if (column.type === 'dateTime' && value) {
|
|
275
|
+
return formatDate(value, this.userLang || 'cs', true, this.dateFormat);
|
|
276
|
+
}
|
|
277
|
+
return column.cell ? column.cell(props, html) : value;
|
|
157
278
|
},
|
|
158
279
|
filterFn: (() => {
|
|
159
280
|
switch (column.type) {
|
|
@@ -161,12 +282,14 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
161
282
|
return filterFns.inNumberRange;
|
|
162
283
|
case 'select':
|
|
163
284
|
return filterFns.weakEquals;
|
|
285
|
+
case 'multiselect':
|
|
286
|
+
return multiselectFilterFn;
|
|
164
287
|
case 'number':
|
|
165
288
|
return filterFns.weakEquals;
|
|
166
289
|
case 'date':
|
|
290
|
+
case 'dateTime':
|
|
167
291
|
return dateFilterFn;
|
|
168
292
|
case 'string':
|
|
169
|
-
return filterFns.includesString;
|
|
170
293
|
default:
|
|
171
294
|
return filterFns.includesString;
|
|
172
295
|
}
|
|
@@ -183,40 +306,6 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
183
306
|
};
|
|
184
307
|
});
|
|
185
308
|
}
|
|
186
|
-
get table() {
|
|
187
|
-
return this.tableController.table({
|
|
188
|
-
data: this.row || [],
|
|
189
|
-
columns: this.getTanstackColumns(this.columns),
|
|
190
|
-
columnResizeMode: 'onChange',
|
|
191
|
-
columnResizeDirection: 'ltr',
|
|
192
|
-
defaultColumn: {
|
|
193
|
-
size: this.columnDefaultSize || 250, //starting column size
|
|
194
|
-
minSize: this.columnDefaultMinSize || 100, //enforced during column resizing
|
|
195
|
-
maxSize: this.columnDefaultMaxSize || 500, //enforced during column resizing
|
|
196
|
-
},
|
|
197
|
-
initialState: {
|
|
198
|
-
sorting: [...(this.initialSorting || [])],
|
|
199
|
-
columnVisibility: { ...this.initialColumnVisibility },
|
|
200
|
-
columnPinning: {
|
|
201
|
-
left: [...(this.leftPinnedColumns || [])],
|
|
202
|
-
right: [...(this.rightPinnedColumns || [])],
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
filterFns: {
|
|
206
|
-
dateFilterFn: dateFilterFn,
|
|
207
|
-
},
|
|
208
|
-
enableColumnPinning: this.enableColumnPinning,
|
|
209
|
-
enableGrouping: this.enableGrouping,
|
|
210
|
-
// groupedColumnMode: 'reorder',
|
|
211
|
-
getCoreRowModel: getCoreRowModel(),
|
|
212
|
-
getSortedRowModel: getSortedRowModel(),
|
|
213
|
-
getFilteredRowModel: getFilteredRowModel(),
|
|
214
|
-
getFacetedRowModel: getFacetedRowModel(),
|
|
215
|
-
getGroupedRowModel: getGroupedRowModel(),
|
|
216
|
-
getExpandedRowModel: getExpandedRowModel(),
|
|
217
|
-
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
309
|
getCommonPinningStyles(column) {
|
|
221
310
|
const isPinned = column.getIsPinned();
|
|
222
311
|
const isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
|
|
@@ -236,6 +325,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
236
325
|
header.column.pin('left'); // Pripnutie doľava
|
|
237
326
|
}
|
|
238
327
|
}
|
|
328
|
+
// export to excel and csv
|
|
239
329
|
exportDataToCsv() {
|
|
240
330
|
const rows = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows); // Získanie všetkých riadkov vrátane skupín
|
|
241
331
|
if (!rows || rows.length === 0) {
|
|
@@ -278,7 +368,9 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
278
368
|
link.click();
|
|
279
369
|
URL.revokeObjectURL(url);
|
|
280
370
|
}
|
|
281
|
-
exportDataToExcel() {
|
|
371
|
+
async exportDataToExcel() {
|
|
372
|
+
await this.loadXLSX(); // Ensure XLSX is loaded
|
|
373
|
+
const XLSX = window.XLSX;
|
|
282
374
|
const rows = this.getAllRowsIncludingGrouped(this.table.getRowModel().rows); // Získanie všetkých riadkov vrátane skupín
|
|
283
375
|
if (!rows || rows.length === 0) {
|
|
284
376
|
console.warn('No data to export');
|
|
@@ -339,13 +431,6 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
339
431
|
});
|
|
340
432
|
return allRows.filter((row, index, self) => index === self.findIndex((r) => r.id === row.id));
|
|
341
433
|
}
|
|
342
|
-
firstUpdated() {
|
|
343
|
-
const grid = this.tableContainerRef.value;
|
|
344
|
-
if (grid) {
|
|
345
|
-
grid.addEventListener('scroll', this.updateScrollState);
|
|
346
|
-
}
|
|
347
|
-
this.updateScrollState();
|
|
348
|
-
}
|
|
349
434
|
startScroll(direction) {
|
|
350
435
|
const grid = this.tableContainerRef.value;
|
|
351
436
|
if (!grid)
|
|
@@ -364,13 +449,88 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
364
449
|
this.scrollInterval = null;
|
|
365
450
|
}
|
|
366
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
|
+
}
|
|
367
463
|
render() {
|
|
464
|
+
if (getLocale() !== this.userLang) {
|
|
465
|
+
setLocale(this.userLang || 'cs');
|
|
466
|
+
}
|
|
467
|
+
this.table = this.tableController.table({
|
|
468
|
+
data: this.rows || [],
|
|
469
|
+
columns: this.getTanstackColumns(this.getColumns),
|
|
470
|
+
columnResizeMode: 'onChange',
|
|
471
|
+
columnResizeDirection: 'ltr',
|
|
472
|
+
defaultColumn: {
|
|
473
|
+
size: this.columnDefaultSize || undefined, //starting column size
|
|
474
|
+
minSize: this.columnDefaultMinSize || 100, //enforced during column resizing
|
|
475
|
+
maxSize: this.columnDefaultMaxSize || 500, //enforced during column resizing
|
|
476
|
+
},
|
|
477
|
+
initialState: {
|
|
478
|
+
// columnFilters: [...(this.initialFiltering || [])],
|
|
479
|
+
sorting: [...(this.initialSorting || [])],
|
|
480
|
+
grouping: [...(this.initialGroups || [])],
|
|
481
|
+
columnVisibility: { ...this.initialColumnVisibility },
|
|
482
|
+
columnPinning: {
|
|
483
|
+
left: [...(this.leftPinnedColumns || [])],
|
|
484
|
+
right: [...(this.rightPinnedColumns || [])],
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
state: {
|
|
488
|
+
columnFilters: this.filters,
|
|
489
|
+
sorting: this.sorting,
|
|
490
|
+
},
|
|
491
|
+
filterFns: {
|
|
492
|
+
dateFilterFn: dateFilterFn,
|
|
493
|
+
multiselectFilterFn: multiselectFilterFn,
|
|
494
|
+
},
|
|
495
|
+
// debugTable: true,
|
|
496
|
+
enableColumnPinning: this.enableColumnPinning,
|
|
497
|
+
enableGrouping: this.enableGrouping,
|
|
498
|
+
manualFiltering: this.server,
|
|
499
|
+
getRowId: (row, index) => index.toString(),
|
|
500
|
+
// groupedColumnMode: 'reorder',
|
|
501
|
+
getCoreRowModel: getCoreRowModel(),
|
|
502
|
+
getSortedRowModel: getSortedRowModel(),
|
|
503
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
504
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
505
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
506
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
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
|
+
},
|
|
526
|
+
});
|
|
527
|
+
this.rowsCount = this.table.getRowModel().rows.length;
|
|
368
528
|
// Ak virtualizácia nie je povolená, použijeme celý zoznam riadkov alebo stĺpcov
|
|
369
529
|
const rowVirtualizer = this.enableRowVirtualization
|
|
370
|
-
? this.rowVirtualizerController
|
|
530
|
+
? this.rowVirtualizerController?.getVirtualizer()
|
|
371
531
|
: null;
|
|
372
532
|
const columnVirtualizer = this.enableColumnVirtualization
|
|
373
|
-
? this.columnVirtualizerController
|
|
533
|
+
? this.columnVirtualizerController?.getVirtualizer()
|
|
374
534
|
: null;
|
|
375
535
|
const virtualColumns = columnVirtualizer?.getVirtualItems() ?? [];
|
|
376
536
|
// Get table rows (either virtualized or all)
|
|
@@ -381,16 +541,15 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
381
541
|
: rows.map((_, index) => ({
|
|
382
542
|
key: index,
|
|
383
543
|
index,
|
|
384
|
-
start: index *
|
|
385
|
-
end: (index + 1) *
|
|
386
|
-
size:
|
|
544
|
+
start: index * this.rowHeight,
|
|
545
|
+
end: (index + 1) * this.rowHeight,
|
|
546
|
+
size: this.rowHeight,
|
|
387
547
|
lane: 0,
|
|
388
548
|
}));
|
|
389
549
|
// console.log('rowItems', rowItems);
|
|
390
550
|
// Calculate padding for virtualization
|
|
391
551
|
let virtualPaddingLeft;
|
|
392
552
|
let virtualPaddingRight;
|
|
393
|
-
this.rowsCount = this.table.getRowModel().rows.length;
|
|
394
553
|
if (columnVirtualizer && virtualColumns?.length && this.enableColumnVirtualization) {
|
|
395
554
|
virtualPaddingLeft = virtualColumns[0]?.start ?? 0;
|
|
396
555
|
virtualPaddingRight =
|
|
@@ -426,7 +585,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
426
585
|
</lit-icon-button>
|
|
427
586
|
`
|
|
428
587
|
: null}
|
|
429
|
-
<div class="grid" ${ref(this.tableContainerRef)}>
|
|
588
|
+
<div class="grid" ${ref(this.tableContainerRef)} @scroll="${this.handleScroll}">
|
|
430
589
|
<table style="width: ${this.table.getCenterTotalSize()}px">
|
|
431
590
|
<thead style="height: ${this.enableFiltering ? '4rem' : '1.625rem'};">
|
|
432
591
|
${repeat(this.table.getHeaderGroups(), (headerGroup) => headerGroup.id, (headerGroup) => {
|
|
@@ -453,6 +612,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
453
612
|
const style = {
|
|
454
613
|
...this.getCommonPinningStyles(header.column),
|
|
455
614
|
width: `${column.getSize()}px`,
|
|
615
|
+
flexGrow: `${column.columnDef.size === undefined ? 1 : 'unset'}`,
|
|
456
616
|
};
|
|
457
617
|
return html `
|
|
458
618
|
<th
|
|
@@ -488,15 +648,28 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
488
648
|
: ''}"
|
|
489
649
|
>
|
|
490
650
|
<div
|
|
491
|
-
style="display: flex; align-items: center;
|
|
651
|
+
style="display: flex; align-items: center; height: 100%;"
|
|
492
652
|
>
|
|
493
653
|
<div
|
|
494
654
|
class="column-header"
|
|
495
655
|
@click=${header.column.getToggleSortingHandler()}
|
|
496
656
|
>
|
|
497
|
-
|
|
657
|
+
<lit-overflow-tooltip
|
|
658
|
+
label="${header
|
|
659
|
+
.column
|
|
660
|
+
.columnDef
|
|
661
|
+
.header}"
|
|
662
|
+
>
|
|
663
|
+
${header
|
|
664
|
+
.column
|
|
498
665
|
.columnDef
|
|
499
666
|
.header}
|
|
667
|
+
</lit-overflow-tooltip>
|
|
668
|
+
</div>
|
|
669
|
+
|
|
670
|
+
<div
|
|
671
|
+
class="icons-group-pin"
|
|
672
|
+
>
|
|
500
673
|
${header.column.getIsSorted()
|
|
501
674
|
? header.column.getIsSorted() ===
|
|
502
675
|
'asc'
|
|
@@ -507,72 +680,69 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
507
680
|
icon="chevronUpFilled"
|
|
508
681
|
></lit-icon
|
|
509
682
|
></slot>`
|
|
510
|
-
: html `<
|
|
683
|
+
: html `<slothea
|
|
511
684
|
name="iconSortDown"
|
|
512
685
|
>
|
|
513
686
|
<lit-icon
|
|
514
687
|
size="0.75rem"
|
|
515
688
|
icon="chevronDownFilled"
|
|
516
689
|
></lit-icon>
|
|
517
|
-
</
|
|
518
|
-
:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
<span
|
|
522
|
-
style="display: flex; height: 100%"
|
|
523
|
-
>
|
|
524
|
-
${!this
|
|
690
|
+
</slothea>`
|
|
691
|
+
: html `<div></div>`}
|
|
692
|
+
<div class="flex">
|
|
693
|
+
${!this
|
|
525
694
|
.actionButtonsInMenu
|
|
526
695
|
? html `
|
|
527
|
-
|
|
696
|
+
${header.column.getCanPin()
|
|
528
697
|
? html `
|
|
529
|
-
|
|
530
|
-
|
|
698
|
+
<lit-tooltip
|
|
699
|
+
label="${header.column.getIsPinned()
|
|
531
700
|
? msg('Zrušit připnutí sloupce')
|
|
532
701
|
: msg('Připnout sloupec vlevo')}"
|
|
533
|
-
|
|
534
|
-
>
|
|
535
|
-
<lit-icon-button
|
|
536
|
-
@click="${() => this.togglePin(header)}"
|
|
537
|
-
size="small"
|
|
538
|
-
variant="text"
|
|
539
|
-
icon="pin"
|
|
540
|
-
.active="${header.column.getIsPinned()}"
|
|
702
|
+
variant="bottom"
|
|
541
703
|
>
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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
|
+
`
|
|
545
714
|
: ''}
|
|
546
|
-
|
|
715
|
+
${header.column.getCanGroup()
|
|
547
716
|
? html `
|
|
548
|
-
|
|
549
|
-
|
|
717
|
+
<lit-tooltip
|
|
718
|
+
label="${header.column.getIsGrouped()
|
|
550
719
|
? msg('Zrušit seskupení')
|
|
551
720
|
: msg('Seskupit sloupec')}"
|
|
552
|
-
|
|
553
|
-
>
|
|
554
|
-
<lit-icon-button
|
|
555
|
-
@click="${header.column.getToggleGroupingHandler()}"
|
|
556
|
-
size="small"
|
|
557
|
-
variant="text"
|
|
558
|
-
.active="${header.column.getIsGrouped()}"
|
|
559
|
-
icon="agregation"
|
|
721
|
+
variant="bottom"
|
|
560
722
|
>
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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
|
+
`
|
|
564
733
|
: ''}
|
|
565
|
-
|
|
734
|
+
`
|
|
566
735
|
: html `
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
736
|
+
<lit-data-grid-action-buttons-popover
|
|
737
|
+
.group="${header.column.getToggleGroupingHandler()}"
|
|
738
|
+
.pin="${() => this.togglePin(header)}"
|
|
739
|
+
.header="${header}"
|
|
740
|
+
.table="${this
|
|
572
741
|
.table}"
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
742
|
+
></lit-data-grid-action-buttons-popover>
|
|
743
|
+
`}
|
|
744
|
+
</div>
|
|
745
|
+
</div>
|
|
576
746
|
</div>
|
|
577
747
|
</div>
|
|
578
748
|
${header.column.getCanFilter()
|
|
@@ -620,15 +790,15 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
620
790
|
</tr>
|
|
621
791
|
`;
|
|
622
792
|
})}
|
|
623
|
-
|
|
624
|
-
${this.isLoading
|
|
793
|
+
${this.isLoading
|
|
625
794
|
? html `
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
`
|
|
795
|
+
<div style="position: absolute; bottom: 0px; width: 100%;">
|
|
796
|
+
<lit-loading-bar></lit-loading-bar>
|
|
797
|
+
</div>
|
|
798
|
+
`
|
|
631
799
|
: ''}
|
|
800
|
+
</thead>
|
|
801
|
+
|
|
632
802
|
<tbody
|
|
633
803
|
style="height: ${rowVirtualizer &&
|
|
634
804
|
this.table.getRowModel().rows.length > 0
|
|
@@ -647,20 +817,24 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
647
817
|
const newBodyColumns = this.enableColumnVirtualization
|
|
648
818
|
? [...new Set([...pinnedColumns, ...bodyColumns])]
|
|
649
819
|
: bodyColumns;
|
|
650
|
-
const
|
|
820
|
+
const rowStyle = {
|
|
651
821
|
transform: rowVirtualizer
|
|
652
822
|
? `translateY(${item.start}px)`
|
|
653
823
|
: 'none',
|
|
654
|
-
height:
|
|
655
|
-
lineHeight:
|
|
824
|
+
height: `${this.rowHeight}px`,
|
|
825
|
+
lineHeight: `${this.rowHeight}px`,
|
|
656
826
|
position: rowVirtualizer ? 'absolute' : 'relative',
|
|
657
827
|
};
|
|
658
828
|
return row
|
|
659
829
|
? html `
|
|
660
830
|
<tr
|
|
661
|
-
class="
|
|
831
|
+
class="${this.selectedRowId === row.id
|
|
832
|
+
? 'selected body'
|
|
833
|
+
: 'body'}"
|
|
662
834
|
data-index="${item.index}"
|
|
663
|
-
|
|
835
|
+
@click="${() => this.handleRowClick(row)}"
|
|
836
|
+
@dblclick="${() => this.handleRowDoubleClick(row)}"
|
|
837
|
+
style="${styleMap(rowStyle)}"
|
|
664
838
|
${ref((node) => {
|
|
665
839
|
if (node &&
|
|
666
840
|
this.enableRowVirtualization &&
|
|
@@ -679,12 +853,14 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
679
853
|
: ''}
|
|
680
854
|
<!-- Cells for each row -->
|
|
681
855
|
${repeat(newBodyColumns, (cell) => cell.key, (cell) => {
|
|
856
|
+
const buttonSize = this.getButtonSize();
|
|
682
857
|
const { column } = cell;
|
|
683
858
|
const style = {
|
|
684
859
|
...this.getCommonPinningStyles(cell.column),
|
|
685
860
|
width: `${cell.column.getSize()}px`,
|
|
861
|
+
flexGrow: `${column.columnDef.size === undefined ? 1 : 'unset'}`,
|
|
686
862
|
background: this.getCellBackgroundColor(cell),
|
|
687
|
-
lineHeight:
|
|
863
|
+
lineHeight: `${this.rowHeight}px`,
|
|
688
864
|
};
|
|
689
865
|
return html `
|
|
690
866
|
<td style="${styleMap(style)}">
|
|
@@ -693,6 +869,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
693
869
|
<lit-button
|
|
694
870
|
@click="${row.getToggleExpandedHandler()}"
|
|
695
871
|
variant="inherit"
|
|
872
|
+
size="${buttonSize}"
|
|
696
873
|
count="${row
|
|
697
874
|
.subRows
|
|
698
875
|
.length}"
|
|
@@ -764,6 +941,11 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
764
941
|
${msg('Počet záznamů')}: ${this.table.getRowModel().rows.length}
|
|
765
942
|
</span>
|
|
766
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>
|
|
767
949
|
<lit-responsive-button
|
|
768
950
|
size="small"
|
|
769
951
|
variant="text"
|
|
@@ -776,20 +958,15 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
776
958
|
<lit-data-grid-export-popover
|
|
777
959
|
.exportToCsv="${() => this.exportDataToCsv()}"
|
|
778
960
|
.exportToExcel="${() => this.exportDataToExcel()}"
|
|
961
|
+
.disabledButtons="${this.isLoading}"
|
|
779
962
|
>
|
|
780
|
-
<slot slot="iconExcel" name="iconExcel"
|
|
781
|
-
><lit-icon icon="csv"></lit-icon
|
|
782
|
-
></slot>
|
|
783
|
-
<slot slot="iconCsv" name="iconCsv"
|
|
784
|
-
><lit-icon icon="csv"></lit-icon
|
|
785
|
-
></slot>
|
|
786
963
|
</lit-data-grid-export-popover>
|
|
787
964
|
`
|
|
788
965
|
: null}
|
|
789
966
|
</div>
|
|
790
967
|
</div>
|
|
791
968
|
</div>
|
|
792
|
-
${this.table.getRowModel().rows.length < 1
|
|
969
|
+
${this.table.getRowModel().rows.length < 1 && !this.isLoading
|
|
793
970
|
? html ` <div class="data-grid__empty">
|
|
794
971
|
<div style="max-height: 7.125rem; max-width: 7.125rem">
|
|
795
972
|
<not-found></not-found>
|
|
@@ -816,20 +993,21 @@ LitDataGridTanstack.styles = [
|
|
|
816
993
|
font-family: 'Inter', sans-serif;
|
|
817
994
|
box-sizing: border-box;
|
|
818
995
|
|
|
819
|
-
table {
|
|
820
|
-
border-collapse: collapse;
|
|
821
|
-
border-spacing: 0;
|
|
822
|
-
width: 100%;
|
|
823
|
-
}
|
|
824
996
|
td {
|
|
825
997
|
padding: 0px;
|
|
826
998
|
}
|
|
827
999
|
|
|
828
1000
|
.data-grid__wrapper {
|
|
829
1001
|
position: relative;
|
|
830
|
-
padding: var(--section-padding, 0.75rem 1rem);
|
|
831
|
-
border-radius: 0.75rem;
|
|
832
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%;
|
|
833
1011
|
}
|
|
834
1012
|
|
|
835
1013
|
.data-grid__empty {
|
|
@@ -842,15 +1020,12 @@ LitDataGridTanstack.styles = [
|
|
|
842
1020
|
}
|
|
843
1021
|
|
|
844
1022
|
table {
|
|
1023
|
+
border-collapse: collapse;
|
|
1024
|
+
border-spacing: 0;
|
|
1025
|
+
width: 100% !important;
|
|
845
1026
|
height: calc(100% - 38px);
|
|
846
1027
|
}
|
|
847
1028
|
|
|
848
|
-
.grid {
|
|
849
|
-
overflow: auto;
|
|
850
|
-
position: relative;
|
|
851
|
-
height: 500px;
|
|
852
|
-
}
|
|
853
|
-
|
|
854
1029
|
thead {
|
|
855
1030
|
display: flex;
|
|
856
1031
|
position: sticky;
|
|
@@ -893,7 +1068,7 @@ LitDataGridTanstack.styles = [
|
|
|
893
1068
|
display: table-cell;
|
|
894
1069
|
white-space: nowrap;
|
|
895
1070
|
overflow: hidden;
|
|
896
|
-
padding: 0px
|
|
1071
|
+
padding: 0px 14px;
|
|
897
1072
|
font-weight: 500;
|
|
898
1073
|
font-size: 13px;
|
|
899
1074
|
color: var(--text-primary, #111827);
|
|
@@ -905,10 +1080,31 @@ LitDataGridTanstack.styles = [
|
|
|
905
1080
|
color: var(--text-secondary, #5d6371);
|
|
906
1081
|
cursor: pointer;
|
|
907
1082
|
gap: 0.25rem;
|
|
908
|
-
display: flex;
|
|
909
1083
|
justify-content: center;
|
|
910
1084
|
align-items: center;
|
|
911
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;
|
|
912
1108
|
}
|
|
913
1109
|
|
|
914
1110
|
.resizer {
|
|
@@ -961,7 +1157,7 @@ LitDataGridTanstack.styles = [
|
|
|
961
1157
|
flex-direction: row;
|
|
962
1158
|
justify-content: space-between;
|
|
963
1159
|
align-items: center;
|
|
964
|
-
padding: 0 16px;
|
|
1160
|
+
// padding: 0 16px;
|
|
965
1161
|
z-index: 10;
|
|
966
1162
|
}
|
|
967
1163
|
|
|
@@ -994,73 +1190,13 @@ LitDataGridTanstack.styles = [
|
|
|
994
1190
|
right: 3rem;
|
|
995
1191
|
}
|
|
996
1192
|
|
|
997
|
-
.
|
|
998
|
-
|
|
999
|
-
overflow: hidden;
|
|
1000
|
-
display: block;
|
|
1001
|
-
width: 100%;
|
|
1002
|
-
|
|
1003
|
-
height: 4px;
|
|
1004
|
-
background-color: #e0e0e0; /* Podobná farba pozadia ako v MUI */
|
|
1005
|
-
box-sizing: border-box;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
.bar {
|
|
1009
|
-
position: absolute;
|
|
1010
|
-
height: 100%;
|
|
1011
|
-
display: block;
|
|
1012
|
-
background-color: #75b603; /* Podobná farba ako primary theme v MUI */
|
|
1013
|
-
width: auto;
|
|
1014
|
-
will-change: left, right;
|
|
1015
|
-
box-sizing: border-box;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
/* Prvá animovaná "vlna" */
|
|
1019
|
-
|
|
1020
|
-
.bar1Indeterminate {
|
|
1021
|
-
animation: mui-indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
/* Druhá animovaná "vlna" (oneskorená) */
|
|
1025
|
-
|
|
1026
|
-
.bar2Indeterminate {
|
|
1027
|
-
animation: mui-indeterminate2 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
|
|
1028
|
-
animation-delay: 1.05s;
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
@keyframes mui-indeterminate1 {
|
|
1032
|
-
0% {
|
|
1033
|
-
left: -35%;
|
|
1034
|
-
right: 100%;
|
|
1035
|
-
}
|
|
1036
|
-
60% {
|
|
1037
|
-
left: 100%;
|
|
1038
|
-
right: -90%;
|
|
1039
|
-
}
|
|
1040
|
-
100% {
|
|
1041
|
-
left: 100%;
|
|
1042
|
-
right: -90%;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
@keyframes mui-indeterminate2 {
|
|
1047
|
-
0% {
|
|
1048
|
-
left: -200%;
|
|
1049
|
-
right: 100%;
|
|
1050
|
-
}
|
|
1051
|
-
60% {
|
|
1052
|
-
left: 107%;
|
|
1053
|
-
right: -8%;
|
|
1054
|
-
}
|
|
1055
|
-
100% {
|
|
1056
|
-
left: 107%;
|
|
1057
|
-
right: -8%;
|
|
1058
|
-
}
|
|
1193
|
+
.selected {
|
|
1194
|
+
background-color: var(--color-primary-light, #f0fadf);
|
|
1059
1195
|
}
|
|
1060
1196
|
`,
|
|
1061
1197
|
];
|
|
1062
1198
|
__decorate([
|
|
1063
|
-
property({ type: Array })
|
|
1199
|
+
property({ type: Array, reflect: true })
|
|
1064
1200
|
], LitDataGridTanstack.prototype, "row", void 0);
|
|
1065
1201
|
__decorate([
|
|
1066
1202
|
property({ type: Array })
|
|
@@ -1128,9 +1264,45 @@ __decorate([
|
|
|
1128
1264
|
__decorate([
|
|
1129
1265
|
property({ type: String })
|
|
1130
1266
|
], LitDataGridTanstack.prototype, "dateFormat", void 0);
|
|
1267
|
+
__decorate([
|
|
1268
|
+
property({ type: Boolean })
|
|
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);
|
|
@@ -1142,7 +1314,16 @@ __decorate([
|
|
|
1142
1314
|
], LitDataGridTanstack.prototype, "disableScrollRight", void 0);
|
|
1143
1315
|
__decorate([
|
|
1144
1316
|
state()
|
|
1145
|
-
], LitDataGridTanstack.prototype, "
|
|
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);
|
|
1146
1327
|
LitDataGridTanstack = __decorate([
|
|
1147
1328
|
customElement('lit-data-grid-tanstack')
|
|
1148
1329
|
], LitDataGridTanstack);
|