overview-components 0.9.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 +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 +217 -185
- package/dist/components/lit-attachments-tab.js.map +1 -1
- package/dist/components/lit-case-variables-tab.d.ts +0 -5
- package/dist/components/lit-case-variables-tab.d.ts.map +1 -1
- package/dist/components/lit-case-variables-tab.js +148 -218
- 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 +384 -200
- 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-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
|
+
}
|
|
91
138
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
+
}
|
|
212
|
+
}
|
|
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);
|
|
@@ -423,7 +585,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
423
585
|
</lit-icon-button>
|
|
424
586
|
`
|
|
425
587
|
: null}
|
|
426
|
-
<div class="grid" ${ref(this.tableContainerRef)}>
|
|
588
|
+
<div class="grid" ${ref(this.tableContainerRef)} @scroll="${this.handleScroll}">
|
|
427
589
|
<table style="width: ${this.table.getCenterTotalSize()}px">
|
|
428
590
|
<thead style="height: ${this.enableFiltering ? '4rem' : '1.625rem'};">
|
|
429
591
|
${repeat(this.table.getHeaderGroups(), (headerGroup) => headerGroup.id, (headerGroup) => {
|
|
@@ -450,6 +612,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
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
617
|
return html `
|
|
455
618
|
<th
|
|
@@ -485,15 +648,28 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
485
648
|
: ''}"
|
|
486
649
|
>
|
|
487
650
|
<div
|
|
488
|
-
style="display: flex; align-items: center;
|
|
651
|
+
style="display: flex; align-items: center; height: 100%;"
|
|
489
652
|
>
|
|
490
653
|
<div
|
|
491
654
|
class="column-header"
|
|
492
655
|
@click=${header.column.getToggleSortingHandler()}
|
|
493
656
|
>
|
|
494
|
-
|
|
657
|
+
<lit-overflow-tooltip
|
|
658
|
+
label="${header
|
|
659
|
+
.column
|
|
660
|
+
.columnDef
|
|
661
|
+
.header}"
|
|
662
|
+
>
|
|
663
|
+
${header
|
|
664
|
+
.column
|
|
495
665
|
.columnDef
|
|
496
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'
|
|
@@ -504,72 +680,69 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
504
680
|
icon="chevronUpFilled"
|
|
505
681
|
></lit-icon
|
|
506
682
|
></slot>`
|
|
507
|
-
: html `<
|
|
683
|
+
: html `<slothea
|
|
508
684
|
name="iconSortDown"
|
|
509
685
|
>
|
|
510
686
|
<lit-icon
|
|
511
687
|
size="0.75rem"
|
|
512
688
|
icon="chevronDownFilled"
|
|
513
689
|
></lit-icon>
|
|
514
|
-
</
|
|
515
|
-
:
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
<span
|
|
519
|
-
style="display: flex; height: 100%"
|
|
520
|
-
>
|
|
521
|
-
${!this
|
|
690
|
+
</slothea>`
|
|
691
|
+
: html `<div></div>`}
|
|
692
|
+
<div class="flex">
|
|
693
|
+
${!this
|
|
522
694
|
.actionButtonsInMenu
|
|
523
695
|
? html `
|
|
524
|
-
|
|
696
|
+
${header.column.getCanPin()
|
|
525
697
|
? html `
|
|
526
|
-
|
|
527
|
-
|
|
698
|
+
<lit-tooltip
|
|
699
|
+
label="${header.column.getIsPinned()
|
|
528
700
|
? msg('Zrušit připnutí sloupce')
|
|
529
701
|
: msg('Připnout sloupec vlevo')}"
|
|
530
|
-
|
|
531
|
-
>
|
|
532
|
-
<lit-icon-button
|
|
533
|
-
@click="${() => this.togglePin(header)}"
|
|
534
|
-
size="small"
|
|
535
|
-
variant="text"
|
|
536
|
-
icon="pin"
|
|
537
|
-
.active="${header.column.getIsPinned()}"
|
|
702
|
+
variant="bottom"
|
|
538
703
|
>
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
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
|
+
`
|
|
542
714
|
: ''}
|
|
543
|
-
|
|
715
|
+
${header.column.getCanGroup()
|
|
544
716
|
? html `
|
|
545
|
-
|
|
546
|
-
|
|
717
|
+
<lit-tooltip
|
|
718
|
+
label="${header.column.getIsGrouped()
|
|
547
719
|
? msg('Zrušit seskupení')
|
|
548
720
|
: msg('Seskupit sloupec')}"
|
|
549
|
-
|
|
550
|
-
>
|
|
551
|
-
<lit-icon-button
|
|
552
|
-
@click="${header.column.getToggleGroupingHandler()}"
|
|
553
|
-
size="small"
|
|
554
|
-
variant="text"
|
|
555
|
-
.active="${header.column.getIsGrouped()}"
|
|
556
|
-
icon="agregation"
|
|
721
|
+
variant="bottom"
|
|
557
722
|
>
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
+
`
|
|
561
733
|
: ''}
|
|
562
|
-
|
|
734
|
+
`
|
|
563
735
|
: html `
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
736
|
+
<lit-data-grid-action-buttons-popover
|
|
737
|
+
.group="${header.column.getToggleGroupingHandler()}"
|
|
738
|
+
.pin="${() => this.togglePin(header)}"
|
|
739
|
+
.header="${header}"
|
|
740
|
+
.table="${this
|
|
569
741
|
.table}"
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
742
|
+
></lit-data-grid-action-buttons-popover>
|
|
743
|
+
`}
|
|
744
|
+
</div>
|
|
745
|
+
</div>
|
|
573
746
|
</div>
|
|
574
747
|
</div>
|
|
575
748
|
${header.column.getCanFilter()
|
|
@@ -617,15 +790,15 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
617
790
|
</tr>
|
|
618
791
|
`;
|
|
619
792
|
})}
|
|
620
|
-
|
|
621
|
-
${this.isLoading
|
|
793
|
+
${this.isLoading
|
|
622
794
|
? html `
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
`
|
|
795
|
+
<div style="position: absolute; bottom: 0px; width: 100%;">
|
|
796
|
+
<lit-loading-bar></lit-loading-bar>
|
|
797
|
+
</div>
|
|
798
|
+
`
|
|
628
799
|
: ''}
|
|
800
|
+
</thead>
|
|
801
|
+
|
|
629
802
|
<tbody
|
|
630
803
|
style="height: ${rowVirtualizer &&
|
|
631
804
|
this.table.getRowModel().rows.length > 0
|
|
@@ -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
829
|
? html `
|
|
657
830
|
<tr
|
|
658
|
-
class="
|
|
831
|
+
class="${this.selectedRowId === row.id
|
|
832
|
+
? 'selected body'
|
|
833
|
+
: 'body'}"
|
|
659
834
|
data-index="${item.index}"
|
|
660
|
-
|
|
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 &&
|
|
@@ -676,12 +853,14 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
676
853
|
: ''}
|
|
677
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
865
|
return html `
|
|
687
866
|
<td style="${styleMap(style)}">
|
|
@@ -690,6 +869,7 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
690
869
|
<lit-button
|
|
691
870
|
@click="${row.getToggleExpandedHandler()}"
|
|
692
871
|
variant="inherit"
|
|
872
|
+
size="${buttonSize}"
|
|
693
873
|
count="${row
|
|
694
874
|
.subRows
|
|
695
875
|
.length}"
|
|
@@ -761,6 +941,11 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
761
941
|
${msg('Počet záznamů')}: ${this.table.getRowModel().rows.length}
|
|
762
942
|
</span>
|
|
763
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>
|
|
764
949
|
<lit-responsive-button
|
|
765
950
|
size="small"
|
|
766
951
|
variant="text"
|
|
@@ -773,20 +958,15 @@ let LitDataGridTanstack = class LitDataGridTanstack extends LitElement {
|
|
|
773
958
|
<lit-data-grid-export-popover
|
|
774
959
|
.exportToCsv="${() => this.exportDataToCsv()}"
|
|
775
960
|
.exportToExcel="${() => this.exportDataToExcel()}"
|
|
961
|
+
.disabledButtons="${this.isLoading}"
|
|
776
962
|
>
|
|
777
|
-
<slot slot="iconExcel" name="iconExcel"
|
|
778
|
-
><lit-icon icon="csv"></lit-icon
|
|
779
|
-
></slot>
|
|
780
|
-
<slot slot="iconCsv" name="iconCsv"
|
|
781
|
-
><lit-icon icon="csv"></lit-icon
|
|
782
|
-
></slot>
|
|
783
963
|
</lit-data-grid-export-popover>
|
|
784
964
|
`
|
|
785
965
|
: null}
|
|
786
966
|
</div>
|
|
787
967
|
</div>
|
|
788
968
|
</div>
|
|
789
|
-
${this.table.getRowModel().rows.length < 1
|
|
969
|
+
${this.table.getRowModel().rows.length < 1 && !this.isLoading
|
|
790
970
|
? html ` <div class="data-grid__empty">
|
|
791
971
|
<div style="max-height: 7.125rem; max-width: 7.125rem">
|
|
792
972
|
<not-found></not-found>
|
|
@@ -813,20 +993,21 @@ LitDataGridTanstack.styles = [
|
|
|
813
993
|
font-family: 'Inter', sans-serif;
|
|
814
994
|
box-sizing: border-box;
|
|
815
995
|
|
|
816
|
-
table {
|
|
817
|
-
border-collapse: collapse;
|
|
818
|
-
border-spacing: 0;
|
|
819
|
-
width: 100%;
|
|
820
|
-
}
|
|
821
996
|
td {
|
|
822
997
|
padding: 0px;
|
|
823
998
|
}
|
|
824
999
|
|
|
825
1000
|
.data-grid__wrapper {
|
|
826
1001
|
position: relative;
|
|
827
|
-
padding: var(--section-padding, 0.75rem 1rem);
|
|
828
|
-
border-radius: 0.75rem;
|
|
829
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%;
|
|
830
1011
|
}
|
|
831
1012
|
|
|
832
1013
|
.data-grid__empty {
|
|
@@ -839,15 +1020,12 @@ LitDataGridTanstack.styles = [
|
|
|
839
1020
|
}
|
|
840
1021
|
|
|
841
1022
|
table {
|
|
1023
|
+
border-collapse: collapse;
|
|
1024
|
+
border-spacing: 0;
|
|
1025
|
+
width: 100% !important;
|
|
842
1026
|
height: calc(100% - 38px);
|
|
843
1027
|
}
|
|
844
1028
|
|
|
845
|
-
.grid {
|
|
846
|
-
overflow: auto;
|
|
847
|
-
position: relative;
|
|
848
|
-
height: 500px;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
1029
|
thead {
|
|
852
1030
|
display: flex;
|
|
853
1031
|
position: sticky;
|
|
@@ -890,7 +1068,7 @@ LitDataGridTanstack.styles = [
|
|
|
890
1068
|
display: table-cell;
|
|
891
1069
|
white-space: nowrap;
|
|
892
1070
|
overflow: hidden;
|
|
893
|
-
padding: 0px
|
|
1071
|
+
padding: 0px 14px;
|
|
894
1072
|
font-weight: 500;
|
|
895
1073
|
font-size: 13px;
|
|
896
1074
|
color: var(--text-primary, #111827);
|
|
@@ -902,10 +1080,31 @@ LitDataGridTanstack.styles = [
|
|
|
902
1080
|
color: var(--text-secondary, #5d6371);
|
|
903
1081
|
cursor: pointer;
|
|
904
1082
|
gap: 0.25rem;
|
|
905
|
-
display: flex;
|
|
906
1083
|
justify-content: center;
|
|
907
1084
|
align-items: center;
|
|
908
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;
|
|
909
1108
|
}
|
|
910
1109
|
|
|
911
1110
|
.resizer {
|
|
@@ -958,7 +1157,7 @@ LitDataGridTanstack.styles = [
|
|
|
958
1157
|
flex-direction: row;
|
|
959
1158
|
justify-content: space-between;
|
|
960
1159
|
align-items: center;
|
|
961
|
-
padding: 0 16px;
|
|
1160
|
+
// padding: 0 16px;
|
|
962
1161
|
z-index: 10;
|
|
963
1162
|
}
|
|
964
1163
|
|
|
@@ -991,73 +1190,13 @@ LitDataGridTanstack.styles = [
|
|
|
991
1190
|
right: 3rem;
|
|
992
1191
|
}
|
|
993
1192
|
|
|
994
|
-
.
|
|
995
|
-
|
|
996
|
-
overflow: hidden;
|
|
997
|
-
display: block;
|
|
998
|
-
width: 100%;
|
|
999
|
-
|
|
1000
|
-
height: 4px;
|
|
1001
|
-
background-color: #e0e0e0; /* Podobná farba pozadia ako v MUI */
|
|
1002
|
-
box-sizing: border-box;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.bar {
|
|
1006
|
-
position: absolute;
|
|
1007
|
-
height: 100%;
|
|
1008
|
-
display: block;
|
|
1009
|
-
background-color: #75b603; /* Podobná farba ako primary theme v MUI */
|
|
1010
|
-
width: auto;
|
|
1011
|
-
will-change: left, right;
|
|
1012
|
-
box-sizing: border-box;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
/* Prvá animovaná "vlna" */
|
|
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
|
-
}
|
|
1193
|
+
.selected {
|
|
1194
|
+
background-color: var(--color-primary-light, #f0fadf);
|
|
1056
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);
|